Hi...

Today I discovered that the definition of SECURITY_LOGON_SESSION_DATA in ntsecapi.h is incomplete. It is missing several fields.

Reference: http://msdn.microsoft.com/en-us/library/aa380128.aspx

Also the substruct LSA_LAST_INTER_LOGON_INFO is missing.

Reference: http://msdn.microsoft.com/en-us/library/hh920949.aspx

The attached patch adds support for these things.

These fields (and LSA_LAST_INTER_LOGON_INFO) have been added in XP SP2 (desktop) or 2008(server) - according to msdn.

I made a test. It seems to be true that 2003 does not support this at all. So to be on the safe side I have encapsulated support for these "new" things with #if (_WIN32_WINNT >= 0x0600) as it cannot be guaranteed on compiletime to have a sane XP (means SP2 or better) or 2008 server present at the same time.

I hope this can be applied cleanly. Thanks.

Roland
Index: include/ntsecapi.h
===================================================================
--- include/ntsecapi.h  (revision 6412)
+++ include/ntsecapi.h  (working copy)
@@ -465,6 +465,14 @@
   NTSTATUS NTAPI LsaFreeMemory(PVOID Buffer);
   NTSTATUS NTAPI LsaClose(LSA_HANDLE ObjectHandle);
 
+  #if (_WIN32_WINNT >= 0x0600)
+  typedef struct _LSA_LAST_INTER_LOGON_INFO {
+    LARGE_INTEGER LastSuccessfulLogon;
+    LARGE_INTEGER LastFailedLogon;
+    ULONG FailedAttemptCountSinceLastSuccessfulLogon;
+  } LSA_LAST_INTER_LOGON_INFO,*PLSA_LAST_INTER_LOGON_INFO;
+  #endif
+  
   typedef struct _SECURITY_LOGON_SESSION_DATA {
     ULONG Size;
     LUID LogonId;
@@ -478,6 +486,19 @@
     LSA_UNICODE_STRING LogonServer;
     LSA_UNICODE_STRING DnsDomainName;
     LSA_UNICODE_STRING Upn;
+    #if (_WIN32_WINNT >= 0x0600)
+    ULONG UserFlags;
+    LSA_LAST_INTER_LOGON_INFO LastLogonInfo;
+    LSA_UNICODE_STRING LogonScript;
+    LSA_UNICODE_STRING ProfilePath;
+    LSA_UNICODE_STRING HomeDirectory;
+    LSA_UNICODE_STRING HomeDirectoryDrive;
+    LARGE_INTEGER LogoffTime;
+    LARGE_INTEGER KickOffTime;
+    LARGE_INTEGER PasswordLastSet;
+    LARGE_INTEGER PasswordCanChange;
+    LARGE_INTEGER PasswordMustChange;
+    #endif
   } SECURITY_LOGON_SESSION_DATA,*PSECURITY_LOGON_SESSION_DATA;
 
   NTSTATUS NTAPI LsaEnumerateLogonSessions(PULONG LogonSessionCount,PLUID 
*LogonSessionList);
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to