Group: Security - Library: secur32
How to enumerate logon sessions on local computer
NTSTATUS NTAPI LsaGetLogonSessionData(
_In_ PLUID LogonId,
_Out_ PSECURITY_LOGON_SESSION_DATA *ppLogonSessionData
);
DECLARE INTEGER LsaGetLogonSessionData IN secur32;
INTEGER LogonId,;
INTEGER @ppLogonSessionData
LogonId [in] Specifies a pointer to a LUID that identifies the logon session whose information will be retrieved.
ppLogonSessionData [out] Address of a pointer to a SECURITY_LOGON_SESSION_DATA structure containing information on the logon session specified by LogonId.
If the function succeeds, the return value is STATUS_SUCCESS.
The SECURITY_LOGON_SESSION_DATA structure is allocated by the LSA. When the information is no longer needed, call the LSAFreeReturnBuffer function to free the memory used by this structure.
See also: LsaEnumerateLogonSessions, LSAFreeReturnBuffer.