mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
[SAMLIB]
SamSetInformationUser: Add special code for the UserSetPasswordInformation class that calculates the NT hash of the password and stores it by calling SamrSetInformationUser using the UserInternal1Information class. svn path=/trunk/; revision=58256
This commit is contained in:
parent
3bdd2d8119
commit
3097671ab5
1 changed files with 45 additions and 0 deletions
|
@ -31,6 +31,12 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(samlib);
|
||||
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
SystemFunction007(PUNICODE_STRING string,
|
||||
LPBYTE hash);
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
|
||||
|
@ -1594,11 +1600,50 @@ SamSetInformationUser(IN SAM_HANDLE UserHandle,
|
|||
IN USER_INFORMATION_CLASS UserInformationClass,
|
||||
IN PVOID Buffer)
|
||||
{
|
||||
PSAMPR_USER_SET_PASSWORD_INFORMATION PasswordBuffer;
|
||||
SAMPR_USER_INTERNAL1_INFORMATION Internal1Buffer;
|
||||
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("SamSetInformationUser(%p %lu %p)\n",
|
||||
UserHandle, UserInformationClass, Buffer);
|
||||
|
||||
if (UserInformationClass == UserSetPasswordInformation)
|
||||
{
|
||||
PasswordBuffer = (PSAMPR_USER_SET_PASSWORD_INFORMATION)Buffer;
|
||||
|
||||
/* Calculate the NT hash value of the passord */
|
||||
Status = SystemFunction007((PUNICODE_STRING)&PasswordBuffer->Password,
|
||||
(LPBYTE)&Internal1Buffer.EncryptedNtOwfPassword);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
TRACE("SystemFunction007 failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
Internal1Buffer.NtPasswordPresent = TRUE;
|
||||
Internal1Buffer.LmPasswordPresent = FALSE;
|
||||
Internal1Buffer.PasswordExpired = PasswordBuffer->PasswordExpired;
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
Status = SamrSetInformationUser((SAMPR_HANDLE)UserHandle,
|
||||
UserInternal1Information,
|
||||
(PVOID)&Internal1Buffer);
|
||||
}
|
||||
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = I_RpcMapWin32Status(RpcExceptionCode());
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
TRACE("SamrSetInformation() failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
Status = SamrSetInformationUser((SAMPR_HANDLE)UserHandle,
|
||||
|
|
Loading…
Reference in a new issue