3.7.4.1.32 RpcWinStationCheckLoopBack (Opnum 65)

The RpcWinStationCheckLoopBack method checks if there is a loopback when a client tries to connect. Loopback refers to opening a terminal server session on the local machine.<209> The caller is not required to have any specific permission to call this method.

 BOOLEAN RpcWinStationCheckLoopBack(
   [in] SERVER_HANDLE hServer,
   [out] DWORD* pResult,
   [in] DWORD ClientLogonId,
   [in] DWORD TargetLogonId,
   [in, size_is(NameSize)] PWCHAR pTargetServerName,
   [in, range(0, 1024)] DWORD NameSize
 );

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: Failure error code if the call to RpcWinStationCheckLoopBack failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).

Value

Meaning

STATUS_SUCCESS

0x00000000

The call was successful.

STATUS_ACCESS_DENIED

0xC0000022

A loopback was detected.

STATUS_CTX_WINSTATION_ACCESS_DENIED

0xC00A002B

The server is in the process of shutting down and cannot complete the request.

ClientLogonId: The ID of the session from which the terminal server client was started.

TargetLogonId: The session ID to which the client is trying to connect.

pTargetServerName: The name of the target server to which the client is connecting. The string MUST contain the terminating NULL character.

NameSize: The length of the pTargetServerName string in characters including the terminating NULL character.

Return Values:  Returns FALSE if there is no loopback, and TRUE if a loopback was detected. This method returns TRUE also in the case when an error was encountered during the loopback test. In this case, the pResult value contains the relevant error code.

Return value/code

Description

0x01

TRUE

A loopback was detected or the method call failed.

0x00

FALSE

A loopback was not detected.