mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:03:02 +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_OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
LSA_HANDLE PolicyHandle;
|
LSA_HANDLE PolicyHandle;
|
||||||
PPOLICY_PRIMARY_DOMAIN_INFO DomainInfo = NULL;
|
PPOLICY_PRIMARY_DOMAIN_INFO DomainInfo = NULL;
|
||||||
|
ULONG LoggedOnUsers;
|
||||||
NTSTATUS NtStatus;
|
NTSTATUS NtStatus;
|
||||||
DWORD dwResult = NERR_Success;
|
DWORD dwResult = NERR_Success;
|
||||||
|
|
||||||
|
@ -173,6 +174,33 @@ NetrWkstaGetInfo(
|
||||||
return LsaNtStatusToWinError(NtStatus);
|
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)
|
switch (Level)
|
||||||
{
|
{
|
||||||
case 100:
|
case 100:
|
||||||
|
@ -252,7 +280,7 @@ NetrWkstaGetInfo(
|
||||||
if (pWkstaInfo->WkstaInfo102.wki102_lanroot != NULL)
|
if (pWkstaInfo->WkstaInfo102.wki102_lanroot != NULL)
|
||||||
wcscpy(pWkstaInfo->WkstaInfo102.wki102_lanroot, pszLanRoot);
|
wcscpy(pWkstaInfo->WkstaInfo102.wki102_lanroot, pszLanRoot);
|
||||||
|
|
||||||
pWkstaInfo->WkstaInfo102.wki102_logged_on_users = 1; /* FIXME */
|
pWkstaInfo->WkstaInfo102.wki102_logged_on_users = LoggedOnUsers;
|
||||||
|
|
||||||
*WkstaInfo = pWkstaInfo;
|
*WkstaInfo = pWkstaInfo;
|
||||||
break;
|
break;
|
||||||
|
@ -276,6 +304,7 @@ NetrWkstaGetInfo(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
if (DomainInfo != NULL)
|
if (DomainInfo != NULL)
|
||||||
LsaFreeMemory(DomainInfo);
|
LsaFreeMemory(DomainInfo);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue