mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
[WKSSVC] NetrWkstaGetInfo Level 102: Return the number of currently logged-on users
This commit is contained in:
parent
42d5dfd3de
commit
26f8fa7ade
1 changed files with 30 additions and 1 deletions
|
@ -141,6 +141,7 @@ NetrWkstaGetInfo(
|
|||
LSA_OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
LSA_HANDLE PolicyHandle;
|
||||
PPOLICY_PRIMARY_DOMAIN_INFO DomainInfo = NULL;
|
||||
ULONG LoggedOnUsers;
|
||||
NTSTATUS NtStatus;
|
||||
DWORD dwResult = NERR_Success;
|
||||
|
||||
|
@ -173,6 +174,33 @@ NetrWkstaGetInfo(
|
|||
return LsaNtStatusToWinError(NtStatus);
|
||||
}
|
||||
|
||||
if (Level == 102)
|
||||
{
|
||||
MSV1_0_ENUMUSERS_REQUEST EnumRequest;
|
||||
PMSV1_0_ENUMUSERS_RESPONSE EnumResponseBuffer = NULL;
|
||||
DWORD EnumResponseBufferSize = 0;
|
||||
NTSTATUS ProtocolStatus;
|
||||
|
||||
/* enumerate all currently logged-on users */
|
||||
EnumRequest.MessageType = MsV1_0EnumerateUsers;
|
||||
NtStatus = LsaCallAuthenticationPackage(LsaHandle,
|
||||
LsaAuthenticationPackage,
|
||||
&EnumRequest,
|
||||
sizeof(EnumRequest),
|
||||
(PVOID*)&EnumResponseBuffer,
|
||||
&EnumResponseBufferSize,
|
||||
&ProtocolStatus);
|
||||
if (!NT_SUCCESS(NtStatus))
|
||||
{
|
||||
dwResult = RtlNtStatusToDosError(NtStatus);
|
||||
goto done;
|
||||
}
|
||||
|
||||
LoggedOnUsers = EnumResponseBuffer->NumberOfLoggedOnUsers;
|
||||
|
||||
LsaFreeReturnBuffer(EnumResponseBuffer);
|
||||
}
|
||||
|
||||
switch (Level)
|
||||
{
|
||||
case 100:
|
||||
|
@ -252,7 +280,7 @@ NetrWkstaGetInfo(
|
|||
if (pWkstaInfo->WkstaInfo102.wki102_lanroot != NULL)
|
||||
wcscpy(pWkstaInfo->WkstaInfo102.wki102_lanroot, pszLanRoot);
|
||||
|
||||
pWkstaInfo->WkstaInfo102.wki102_logged_on_users = 1; /* FIXME */
|
||||
pWkstaInfo->WkstaInfo102.wki102_logged_on_users = LoggedOnUsers;
|
||||
|
||||
*WkstaInfo = pWkstaInfo;
|
||||
break;
|
||||
|
@ -276,6 +304,7 @@ NetrWkstaGetInfo(
|
|||
break;
|
||||
}
|
||||
|
||||
done:
|
||||
if (DomainInfo != NULL)
|
||||
LsaFreeMemory(DomainInfo);
|
||||
|
||||
|
|
Loading…
Reference in a new issue