3.2.4.1.9 RawGetFileData (Opnum 8)

The RawGetFileData method is used to transfer successive segments of compressed marshaled data for a file from the server to the client. This method does not use the Remote Differential Compression Algorithm (as specified in [MS-RDC]) to transfer data.

 DWORD RawGetFileData(
   [in, out] PFRS_SERVER_CONTEXT* serverContext,
   [out, size_is(bufferSize), length_is(*sizeRead)] 
     byte* dataBuffer,
   [in, range(0, CONFIG_TRANSPORT_MAX_BUFFER_SIZE)] 
     DWORD bufferSize,
   [out] DWORD* sizeRead,
   [out] long* isEndOfFile
 );

serverContext: The context handle that represents the requested file replication operation. The client MUST specify a pointer to a server context that was retrieved by a previously successful call to the InitializeFileTransferAsync method. The server MUST NOT change the value of serverContext and then return the same serverContext that was passed in.

dataBuffer: The file data received from the server.

bufferSize: The size, in bytes, of dataBuffer.

sizeRead: The size, in bytes, of the file data returned in dataBuffer.

isEndOfFile: The value is TRUE if the end of the specified file has been reached and there is no more file data to replicate to the client; otherwise, the value is FALSE.

Return Values: This method MUST return 0 on success or a nonzero error code on failure. For protocol purposes all nonzero values MUST be treated as equivalent failures unless otherwise specified.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The method completed successfully.

0x00000057

ERROR_INVALID_PARAMETER

The context is invalid.

0x00002344

FRS_ERROR_CONTENTSET_NOT_FOUND

The content set was not found.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].

Validating the file transfer request: The server MUST validate the file transfer request by performing the following checks.

  • If the specified server context was not retrieved by a previously successful call to the InitializeFileTransferAsync method, then the server MUST fail the call with the ERROR_INVALID_PARAMETER failure value.

  • If the server has already completed transferring the file associated with the server context, the server MUST fail the call with an implementation-defined failure value.

  • If the server is not currently participating in the replication of the replicated folder that is associated with the specified server context, then the server MUST fail the call with the FRS_ERROR_CONTENTSET_NOT_FOUND failure value.

Actions Triggered: Upon successfully validating the file transfer request, the server retrieves the next segment of the file’s marshaled data.

Remarks: If the bufferSize parameter is zero then the server MAY complete the call successfully with the sizeRead parameter set to zero, or fail the call with an implementation-defined failure value. <28>

The data returned in the dataBuffer parameter is a continuation of the data returned by a previous call to the InitializeFileTransferAsync method.