[SAMSRV]
authorEric Kohl <eric.kohl@reactos.org>
Tue, 9 Jul 2013 21:47:55 +0000 (21:47 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 9 Jul 2013 21:47:55 +0000 (21:47 +0000)
SamrChangePasswordUser: Use SampSetUserPassword to set the password hashes and update the password history.

svn path=/trunk/; revision=59453

reactos/dll/win32/samsrv/samrpc.c

index b571fa9..fce4676 100644 (file)
@@ -7577,41 +7577,16 @@ SamrChangePasswordUser(IN SAMPR_HANDLE UserHandle,
         }
     }
 
-    /* Store the new LM password */
+    /* Store the new password hashes */
     if (NT_SUCCESS(Status))
     {
-        if (LmPresent)
-        {
-            Length = sizeof(ENCRYPTED_LM_OWF_PASSWORD);
-            Status = SampSetObjectAttribute(UserObject,
-                                            L"LMPwd",
-                                            REG_BINARY,
-                                            NewLmPassword,
-                                            Length);
-            if (!NT_SUCCESS(Status))
-            {
-                goto done;
-            }
-        }
-
-        /* Store the new NT password */
-        if (NtPresent)
-        {
-            Length = sizeof(ENCRYPTED_NT_OWF_PASSWORD);
-            Status = SampSetObjectAttribute(UserObject,
-                                            L"NTPwd",
-                                            REG_BINARY,
-                                            NewNtPassword,
-                                            Length);
-            if (!NT_SUCCESS(Status))
-            {
-                goto done;
-            }
-        }
+        Status = SampSetUserPassword(UserObject,
+                                     NewNtPassword,
+                                     NtPresent,
+                                     NewLmPassword,
+                                     LmPresent);
     }
 
-
-done:
     return Status;
 }