3.2.6.2.1 TsProxySendToServer (Opnum 9)
The method is used for data transfer from the RDG client to the target server, via the RDG server. The RDG server SHOULD send the buffer data received in this method to the target server. The RPC runtime MUST NOT perform a strict NDR data consistency check for this method. The Remote Desktop Gateway Server Protocol bypasses NDR for this method. The wire data MUST follow the regular RPC specifications as specified in [C706] section 2.1, and [MS-RPCE] minus all NDR headers, trailers, and NDR-specific payload. The RDG server MUST have created the channel to the target server before completing this method call. This method MAY be called multiple times by the RDG client, but only after the previous method call finishes. The RDG server MUST handle multiple sequential invocations of this method call. This method bypasses NDR. For this reason, unlike other RPC methods that return an HRESULT, this method returns a DWORD. This is directly passed to the callee from underlying RPC calls.<48> When this call fails, the RDG server MUST send the final response to TsProxySetupReceivePipe call.
Prerequisites: The connection MUST be in Pipe Created state. If this call is made in any other state, ERROR_ONLY_IF_CONNECTED or E_PROXY_TS_CONNECTFAILED is returned.
Sequential Processing Rules:
If some unexpected error occurs in the following process, the RDG server MUST return HRESULT_CODE(E_PROXY_INTERNALERROR).
The RDG server MUST extract the channel context handle from the pRpcMessage parameter. Refer to Generic Send Data Message Packet for the pRpcMessage format.
The RDG server MUST verify that the channel context handle is not NULL. Otherwise, it MUST return ERROR_ACCESS_DENIED.
The RDG server MUST verify that the connection is in Pipe Created state. Otherwise, it MUST return ERROR_ONLY_IF_CONNECTED or E_PROXY_TS_CONNECTFAILED.
The RDG server MUST extract the RDG client data from the pRpcMessage parameter. For the pRpcMessage format, refer to Generic Send Data Message Packet (section 2.2.9.3).
The RDG server MUST verify that the totalDataBytes field in pRpcMessage is not zero. Otherwise, it MUST return ERROR_ACCESS_DENIED.
The RDG server MUST verify that the numBuffers filed in pRpcMessage is in the range of 1 and 3, both inclusive. Otherwise, it MUST return ERROR_ACCESS_DENIED.
The RDG server MUST verify that buffer1Length + buffer2Length, (if numBuffers >= 2), + buffer3Length, (if numBuffers == 3), + size of buffer1Length + size of buffer2Length, (if numBuffers >= 2), + size of buffer3Length, (if numBuffers == 3), does not exceed totalDataBytes. Otherwise, it MUST return ERROR_ACCESS_DENIED.
The RDG server MUST verify that the buffer1Length field in pRpcMessage is not zero. Otherwise, it MUST return HRESULT_CODE(E_PROXY_INTERNALERROR).
The RDG server MUST send the data extracted in the preceding step to the target server.
The RDG server MUST return ERROR_SUCCESS.
DWORD TsProxySendToServer( [in, max_is(32767)] byte pRpcMessage[] );
pRpcMessage: The protocol data between RDG client and RDG server MUST be decoded as specified in section 2.2.9.3. RPC stub information is specified in [MS-RPCE] sections 1.1 and 1.5.
Return Values: The method MUST return ERROR_SUCCESS on success. Other failures MUST be one of the codes listed. The client MAY interpret failures in any way it deems appropriate. See section 2.2.6 for details on these errors.
-
Return value
State transition
Description
ERROR_SUCCESS (0x00000000)
The connection MUST remain in PipeCreated state.
Returned when a call to the TsProxySendToServer method succeeds.
ERROR_ONLY_IF_CONNECTED (0x000004E3)
The connection MUST transition to Channel Close Pending state.
Returned by the RDG server when an attempt is made by the client to send data to the target server on connection state other than Pipe Created state.
The RDG client MUST end the protocol when this error is returned.
ERROR_ACCESS_DENIED (0x00000005)
The connection MUST transition to Channel Close Pending state.
Returned if the channel context handle passed in the pRpcMessage parameter is NULL. The RDG client MUST end the protocol when this error is received.
HRESULT_CODE(E_PROXY_INTERNALERROR) (0x000059D8)
The connection MUST transition to Channel Close Pending state.
Returned when an unexpected error occurs in TsProxySendToServer. The RDG client MUST end the protocol when this error is received.