Platform SDK: RAS/Routing and RAS |
The custom-scripting DLL calls the RasReceiveBuffer function to inform RAS that it is ready to receive data from the server over the specified port.
typedef DWORD (APIENTRY *PFNRASRECEIVEBUFFER) ( HANDLE hPort, PBYTE pBuffer, PDWORD pdwSize, DWORD dwTimeout, HANDLE hEvent );
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. |
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 may pass the same buffer pointer in RasRetrieveBuffer that it passed in RasReceiveData.
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.
The custom-scripting DLL calls RasReceiveBuffer 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.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Rasdlg.h.