Share via


RasRetrieveBuffer (Compact 2013)

3/26/2014

This function obtains data received from the RAS server over the specified port. You can implement a custom-scripting DLL that calls RasRetrieveBuffer through a function pointer.

Syntax

typedef DWORD (APIENTRY *PFNRASRETRIEVEBUFFER)(
  HANDLE hPort,
  PBYTE pBuffer,
  PDWORD pdwSize
);

Parameters

  • hPort
    Handle to the port on which to retrieve the data. This handle should be the handle passed in by RAS as the first parameter of the RasCustomScriptExecute function.
  • pBuffer
    Pointer to a buffer to receive the data from the port specified by the hPort parameter. Obtain this buffer using the RasGetBuffer function. The value of this parameter may be the same as the pointer to the buffer passed into the RasReceiveBuffer function.
  • pdwSize
    Pointer to a DWORD variable that receives the size of the data returned in the buffer pointed to by the pBuffer parameter.

Return Value

  • ERROR_SUCCESS
    The function completes successfully.
  • ERROR_BUFFER_INVALID
    The pointer to the buffer passed in the pBuffer parameter is invalid.
  • ERROR_INVALID_PORT_HANDLE
    The handle specified by the hPort parameter is invalid.

RAS signals the event object if the port gets disconnected for some reason before the data is posted. In this case, RasRetrieveBuffer returns an error defined in Raserror.h that indicates the cause of the failure.

Remarks

RAS passes the function pointer that you use to call RasRetrieveBuffer through the phnRasReceiveBuffer parameter of the DLL's RasCustomScriptExecute function.

The RasRetrieveBuffer function is synchronous. When it returns, the buffer that the pBuffer parameter points to contains the data received over the specified port. The custom-scripting DLL should call RasRetrieveBuffer only after RAS has signaled the event object that the DLL passed the call to RasReceiveBuffer.

Requirements

Header

ras.h

Library

Ppp.lib

See Also

Reference

Scripting Functions
RasCustomScriptExecute
RasSendBuffer
RasReceiveBuffer