Platform SDK: RAS/Routing and RAS |
The custom-scripting DLL calls the RasRetrieveBuffer function to obtain data received from the RAS server over the specified port. The custom-scripting DLL should call RasRetrieveBuffer only after RAS has signaled the event object passed in the call to RasReceiveBuffer.
typedef DWORD (APIENTRY * PRASPORTRETRIEIVEBUFFER ) ( HPORT hPort, PBYTE pBuffer PDWORD pdwSize );
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value can be one of the following error codes.
Value | Meaning |
---|---|
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.
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 in the call to RasReceiveBuffer.
The custom-scripting DLL calls RasRetrieveBuffer through a function pointer. The function pointer is passed to the custom-scripting DLL as a parameter when RAS calls the DLL's implementation of RasCustomScriptExecute.
RAS Custom-Scripting, RasCustomScriptExecute, RasReceiveBuffer, RasSendBuffer