3.3.4.3.6 RpcGetEnumResult (Opnum 5)
The RpcGetEnumResult method returns a pointer of the type PSESSIONENUM which points to the list of sessions currently running on the terminal server after applying the specified filter. This method MUST be called after RpcOpenEnum. No special permissions are required to call this method. However, only sessions for 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 skips the sessions for which the caller does not have the permission.
-
HRESULT RpcGetEnumResult( [in] ENUM_HANDLE hEnum, [out, size_is(,*pEntries)] PSESSIONENUM* ppSessionEnumResult, [in] DWORD Level, [out] ULONG* pEntries );
hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE.
ppSessionEnumResult: A pointer of the type PSESSIONENUM which points to the list of sessions currently running on the terminal server.
Level: The level of information requested. This field MUST be set to the supported values of 1 or 2. If the server does not support the level requested, it will set the level to the maximum supported level and return information accordingly.<151>
pEntries: The number of sessions currently running on the terminal server and returned in the ppSessionEnumResult structure.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
-
Return value/code
Description
0x00000000
S_OK
Successful completion.