Compartir a través de


RasRetrieveBuffer

This function obtains data received from the RAS server over the specified port. A custom-scripting DLL, which is implemented by the developer, calls RasRetrieveBuffer through a function pointer. RAS passes the function pointer through the phnRasReceiveBuffer parameter of the DLL's RasCustomScriptExecute function.

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 Values

  • 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

The RasRetrieveBuffer function is synchronous. When it returns, the buffer pointed to by the pBuffer parameter 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

OS Versions: Windows CE .NET 4.0 and later.
Header: Ras.h.
Link Library: Ppp.lib.

See Also

RAS Custom Scripting | RasCustomScriptExecute | RasSendBuffer | RasReceiveBuffer

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.