Author: ekohl
Date: Sat May 21 15:05:49 2016
New Revision: 71365
URL:
http://svn.reactos.org/svn/reactos?rev=71365&view=rev
Log:
[SAMSRV]
Implement SamrGetDomainPasswordInformation.
Modified:
trunk/reactos/dll/win32/samsrv/samrpc.c
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sat May 21 15:05:49 2016
@@ -9212,6 +9212,7 @@
return STATUS_NOT_IMPLEMENTED;
}
+
/* Function 56 */
NTSTATUS
NTAPI
@@ -9219,8 +9220,59 @@
IN PRPC_UNICODE_STRING Unused,
OUT PUSER_DOMAIN_PASSWORD_INFORMATION
PasswordInformation)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ SAMPR_HANDLE ServerHandle = NULL;
+ PSAM_DB_OBJECT DomainObject = NULL;
+ SAM_DOMAIN_FIXED_DATA FixedData;
+ ULONG Length;
+ NTSTATUS Status;
+
+ TRACE("(%p %p %p)\n", BindingHandle, Unused, PasswordInformation);
+
+ Status = SamrConnect(NULL,
+ &ServerHandle,
+ SAM_SERVER_LOOKUP_DOMAIN);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("SamrConnect() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ Status = SampOpenDbObject((PSAM_DB_OBJECT)ServerHandle,
+ L"Domains",
+ L"Account",
+ 0,
+ SamDbDomainObject,
+ DOMAIN_READ_PASSWORD_PARAMETERS,
+ &DomainObject);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("SampOpenDbObject() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ Length = sizeof(SAM_DOMAIN_FIXED_DATA);
+ Status = SampGetObjectAttribute(DomainObject,
+ L"F",
+ NULL,
+ &FixedData,
+ &Length);
+ if (!NT_SUCCESS(Status))
+ {
+ TRACE("SampGetObjectAttribute() failed (Status 0x%08lx)\n", Status);
+ goto done;
+ }
+
+ PasswordInformation->MinPasswordLength = FixedData.MinPasswordLength;
+ PasswordInformation->PasswordProperties = FixedData.PasswordProperties;
+
+done:
+ if (DomainObject != NULL)
+ SampCloseDbObject(DomainObject);
+
+ if (ServerHandle != NULL)
+ SamrCloseHandle(ServerHandle);
+
+ return Status;
}