#ifndef _WINSTA_H
/**
* The WinStationQueryInformationW routine retrieves information about a window station.
*
* @param ServerHandle A handle to an RD Session Host server. Specify a handle opened by the WinStationOpenServerW function, or specify WINSTATION_CURRENT_SERVER to indicate the server on which your application is running.
* @param SessionId A Remote Desktop Services session identifier.
* To indicate the session in which the calling application is running (or the current session) specify WINSTATION_CURRENT_SESSION.
* Only specify WINSTATION_CURRENT_SESSION when obtaining session information on the local server.
* If WINSTATION_CURRENT_SESSION is specified when querying session information on a remote server, the returned session information will be inconsistent. Do not use the returned data.
* @param WinStationInformationClass A value from the TOKEN_INFORMATION_CLASS enumerated type identifying the type of information to be retrieved.
* @param WinStationInformation Pointer to a caller-allocated buffer that receives the requested information about the token.
* @param WinStationInformationLength Length, in bytes, of the caller-allocated TokenInformation buffer.
* @param ReturnLength Pointer to a caller-allocated variable that receives the actual length, in bytes, of the information returned in the TokenInformation buffer.
* @return BOOLEAN Nonzero if the function succeeds, or zero otherwise. To get extended error information, call GetLastError.
* @sa https://learn.microsoft.com/en-us/previous-versions/aa383827(v=vs.85)
*/
NTSYSAPI
BOOLEAN
NTAPI
WinStationQueryInformationW(
_In_opt_ HANDLE ServerHandle,
_In_ ULONG SessionId,
_In_ WINSTATIONINFOCLASS WinStationInformationClass,
_Out_writes_bytes_(WinStationInformationLength) PVOID WinStationInformation,
_In_ ULONG WinStationInformationLength,
_Out_ PULONG ReturnLength
);
View code on GitHubThis function is a wrapper over an RPC method documented in the [MS-TSTS] specification.