RasRetrieveBuffer (Windows Embedded CE 6.0)
1/6/2010
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.
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
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
Header | ras.h |
Library | Ppp.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
See Also
Reference
Scripting Functions
RasCustomScriptExecute
RasSendBuffer
RasReceiveBuffer