Share via


RasReceiveBuffer (Windows Embedded CE 6.0)

1/6/2010

This function informs RAS that it is ready to receive data from the server over the specified port. A custom-scripting DLL, which is implemented by the developer, calls RasReceiveBuffer through a function pointer. RAS passes the function pointer through the phnRasReceiveBuffer parameter of the DLL's RasCustomScriptExecute function.

Syntax

typedef DWORD (APIENTRY *PFNRASRECEIVEBUFFER)(
  HANDLE hPort,
  PBYTE pBuffer,
  PDWORD pdwSize,
  DWORD dwTimeout,
  HANDLE hEvent
);

Parameters

  • hPort
    Handle to the port on which to receive 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.
  • pdwSize
    Pointer to a DWORD variable that receives the size of the data returned in the buffer pointed to by the pBuffer parameter.
  • dwTimeout
    Specifies a time-out period, in milliseconds, after which the custom-scripting DLL will no longer wait for the data.
  • hEvent
    Handle to an event object that RAS will signal when the received data is available.

Return Value

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

Remarks

RasReceiveBuffer is an asynchronous function. RasReceiveBuffer returns immediately even if the data is not yet available. The custom-scripting DLL must wait on the event object specified by the hEvent parameter. When the data is available, RAS signals this event. The custom-scripting DLL should then call the RasRetrieveBuffer function to obtain the data. The custom-scripting DLL can pass the same buffer pointer in RasRetrieveBuffer that it passed in RasReceiveBuffer.

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

Requirements

Header ras.h
Library Ppp.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Scripting Functions
RasCustomScriptExecute
RasSendBuffer

Concepts

RAS Custom Scripting