184.108.40.206.5 RpcGetRemoteAddress (Opnum 4)
The RpcGetRemoteAddress method retrieves the IP address of the client computer connected to the session on the terminal server. The caller MUST have WINSTATION_QUERY permission for the session. 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.
HRESULT RpcGetRemoteAddress( [in] handle_t hBinding, [in] ULONG SessionId, [out] PRCM_REMOTEADDRESS pRemoteAddress );
SessionId: The ID of the session for which client data is to be retrieved.
pRemoteAddress: The address of the client computer that is connected to the session. This is of the type PRCM_REMOTEADDRESS.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.