3.7.4.1.4 RpcWinStationEnumerate (Opnum 3)
The RpcWinStationEnumerate method retrieves a list of LOGONID structures for sessions on a terminal server. No special permissions are required to call this method. However, only sessions to which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
-
BOOLEAN RpcWinStationEnumerate( [in] SERVER_HANDLE hServer, [out] DWORD* pResult, [in, out] PULONG pEntries, [in, out, unique, size_is(*pByteCount)] PCHAR pLogonId, [in, out] PULONG pByteCount, [in, out] PULONG pIndex );
hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer.
pResult: If the call was successful, this parameter will be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF]; otherwise, it MUST be an implementation-specific negative value.
pEntries: Pointer to the number of entries to return to the caller. On return from this method, this is the number of logon IDs actually returned in this call to RpcWinStationEnumerate.
pLogonId: Buffer where the logon IDs are stored when the method returns. This will be an array of LOGONID structures. Caller MUST cast this to PCHAR before calling this method.
pByteCount: Size of the buffer, in bytes, to which pLogonId points.
pIndex: Last index of the logon ID lookup from this call, passed to the server the next time this method is called. Initial value of this passed by the caller MUST be 0.
Return Values: Returns TRUE if the call succeeded, or FALSE if the lookup failed. On failure, pResult indicates the failure status code. If all of the logon IDs have already been retrieved from the server, TRUE will be returned, and pResult will be STATUS_NO_MORE_ENTRIES (as specified in [MS-ERREF]), indicating to the call that all logon IDs have been retrieved.
-
Return value/code
Description
0x01
TRUE
Successful completion.
0x00
FALSE
Method call failed.