https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df053b7d16d1bba091123…
commit df053b7d16d1bba091123690eed674f58e353089
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Wed Sep 5 00:10:54 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Wed Sep 5 00:10:54 2018 +0200
[MSV1_0] LsaApLogonUser: Update the logon time/count and bad password time/count
---
dll/win32/msv1_0/msv1_0.c | 18 ++++++++++++++++++
dll/win32/msv1_0/msv1_0.h | 20 ++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c
index ce47f0819f..1bb944e744 100644
--- a/dll/win32/msv1_0/msv1_0.c
+++ b/dll/win32/msv1_0/msv1_0.c
@@ -1339,6 +1339,24 @@ LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest,
}
done:
+ /* Update the logon time/count or the bad password time/count */
+ if ((UserHandle != NULL) &&
+ (Status == STATUS_SUCCESS || Status == STATUS_WRONG_PASSWORD))
+ {
+ SAMPR_USER_INFO_BUFFER InternalInfo;
+
+ RtlZeroMemory(&InternalInfo, sizeof(InternalInfo));
+
+ if (Status == STATUS_SUCCESS)
+ InternalInfo.Internal2.Flags = USER_LOGON_SUCCESS;
+ else
+ InternalInfo.Internal2.Flags = USER_LOGON_BAD_PASSWORD;
+
+ SamrSetInformationUser(UserHandle,
+ UserInternal2Information,
+ &InternalInfo);
+ }
+
/* Return the account name */
*AccountName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING));
if (*AccountName != NULL)
diff --git a/dll/win32/msv1_0/msv1_0.h b/dll/win32/msv1_0/msv1_0.h
index efbc90a0f3..773702fdec 100644
--- a/dll/win32/msv1_0/msv1_0.h
+++ b/dll/win32/msv1_0/msv1_0.h
@@ -94,6 +94,18 @@ typedef struct _SAMPR_LOGON_HOURS
unsigned char *LogonHours;
} SAMPR_LOGON_HOURS, *PSAMPR_LOGON_HOURS;
+#define USER_LOGON_BAD_PASSWORD 0x08000000
+#define USER_LOGON_SUCCESS 0x10000000
+
+typedef struct _SAMPR_USER_INTERNAL2_INFORMATION
+{
+ unsigned long Flags;
+ OLD_LARGE_INTEGER LastLogon;
+ OLD_LARGE_INTEGER LastLogoff;
+ unsigned short BadPasswordCount;
+ unsigned short LogonCount;
+} SAMPR_USER_INTERNAL2_INFORMATION, *PSAMPR_USER_INTERNAL2_INFORMATION;
+
typedef struct _SAMPR_USER_ALL_INFORMATION
{
OLD_LARGE_INTEGER LastLogon;
@@ -152,6 +164,9 @@ typedef union _SAMPR_USER_INFO_BUFFER
USER_CONTROL_INFORMATION Control;
USER_EXPIRES_INFORMATION Expires;
SAMPR_USER_INTERNAL1_INFORMATION Internal1;
+#endif
+ SAMPR_USER_INTERNAL2_INFORMATION Internal2;
+#if 0
SAMPR_USER_PARAMETERS_INFORMATION Parameters;
#endif
SAMPR_USER_ALL_INFORMATION All;
@@ -236,6 +251,11 @@ SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
IN USER_INFORMATION_CLASS UserInformationClass,
OUT PSAMPR_USER_INFO_BUFFER *Buffer);
+NTSTATUS
+NTAPI
+SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
+ IN USER_INFORMATION_CLASS UserInformationClass,
+ IN PSAMPR_USER_INFO_BUFFER Buffer);
typedef PVOID LSAPR_HANDLE;