XXX_Read

This function reads data from the device identified by the open context.

Syntax

DWORD XXX_Read( DWORD hOpenContext, LPVOID pBuffer,
DWORD Count );

Parameters

hOpenContext
Handle to the open context of the device. The XXX_Open function creates and returns this identifier.
pBuffer
Pointer to the buffer which stores the data read from the device. This buffer should be at least Count bytes long.
Count
Specifies the number of bytes to read from the device into pBuffer.

Return Values

Returns 0 for the end-of-file, –1 for an error, or the number of bytes read for success.

Remarks

An application calls the ReadFile function to read from the device. The operating system, in turn, invokes this function. The hFile parameter is a handle to your device. The pData parameter points to the buffer that contains the data read from the device. The Size parameter indicates the number of bytes that the application wants to read from the device. The pSizeRead parameter is a pointer to a value where this function can store the number of bytes actually read from the device. The value returned from this function is equal to the value contained in pSizeRead, unless this function returns -1 for an error. If this function returns an error, pSizeRead contains 0.