https://git.reactos.org/?p=reactos.git;a=commitdiff;h=653a9be05bebd56ab50ba…
commit 653a9be05bebd56ab50baedfe4b7f0e2c2a0e650
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Sep 2 17:53:29 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Sep 2 17:54:26 2018 +0200
[SAMSRV] Implement SamrQueryInformationUser.UserInternal2Information
---
dll/win32/samsrv/samrpc.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/dll/win32/samsrv/samrpc.c b/dll/win32/samsrv/samrpc.c
index 2f3729d3eb..114532cdb6 100644
--- a/dll/win32/samsrv/samrpc.c
+++ b/dll/win32/samsrv/samrpc.c
@@ -6738,6 +6738,54 @@ done:
}
+static
+NTSTATUS
+SampQueryUserInternal2(PSAM_DB_OBJECT UserObject,
+ PSAMPR_USER_INFO_BUFFER *Buffer)
+{
+ PSAMPR_USER_INFO_BUFFER InfoBuffer = NULL;
+ SAM_USER_FIXED_DATA FixedData;
+ ULONG Length = 0;
+ NTSTATUS Status;
+
+ *Buffer = NULL;
+
+ InfoBuffer = midl_user_allocate(sizeof(SAMPR_USER_INFO_BUFFER));
+ if (InfoBuffer == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ Length = sizeof(SAM_USER_FIXED_DATA);
+ Status = SampGetObjectAttribute(UserObject,
+ L"F",
+ NULL,
+ (PVOID)&FixedData,
+ &Length);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
+ InfoBuffer->Internal2.Flags = 0;
+ InfoBuffer->Internal2.LastLogon.LowPart = FixedData.LastLogon.LowPart;
+ InfoBuffer->Internal2.LastLogon.HighPart = FixedData.LastLogon.HighPart;
+ InfoBuffer->Internal2.LastLogoff.LowPart = FixedData.LastLogoff.LowPart;
+ InfoBuffer->Internal2.LastLogoff.HighPart = FixedData.LastLogoff.HighPart;
+ InfoBuffer->Internal2.BadPasswordCount = FixedData.BadPasswordCount;
+ InfoBuffer->Internal2.LogonCount = FixedData.LogonCount;
+
+ *Buffer = InfoBuffer;
+
+done:
+ if (!NT_SUCCESS(Status))
+ {
+ if (InfoBuffer != NULL)
+ {
+ midl_user_free(InfoBuffer);
+ }
+ }
+
+ return Status;
+}
+
+
static NTSTATUS
SampQueryUserParameters(PSAM_DB_OBJECT UserObject,
PSAMPR_USER_INFO_BUFFER *Buffer)
@@ -7315,6 +7363,7 @@ SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
break;
case UserInternal1Information:
+ case UserInternal2Information:
case UserAllInformation:
DesiredAccess = 0;
break;
@@ -7423,6 +7472,11 @@ SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
Buffer);
break;
+ case UserInternal2Information:
+ Status = SampQueryUserInternal2(UserObject,
+ Buffer);
+ break;
+
case UserParametersInformation:
Status = SampQueryUserParameters(UserObject,
Buffer);