![]() | LowLevelReadNoPoll |
Reads raw bytes directly from a device without going through the formatted I/O read buffer.
virtual HRESULT LowLevelReadNoPoll(BYTE* pBuf, long cbDesired, long* pcbActual, long lTimeout = CUR_TIMEOUT) override; virtual HRESULT LowLevelReadNoPoll(SAFEARRAY** pBuf, long cbDesired, long lTimeout = CUR_TIMEOUT) override;
[out] Array of bytes read from the device.
[in] Number of bytes to read from the device.
[out] Actual number of bytes read from the device.
[in] I/O timeout value in milliseconds.
Returns S_OK if successful, otherwise a failure HRESULT.
This function behaves identically to the LowLevelRead function except that the device is not polled for errors after the data is read.
![]() |
---|
It is critical that these low-level functions not be intermixed with buffered I/O functions in a sequence of operations, such as a set of calls implementing a single driver method. The buffered I/O functions assume that all data read from or sent to the device passes through the I/O buffer, and intermixing these calls with low-level functions that directly access the device can produce incorrect results and/or I/O errors. |
The following example demonstrates use of the LowLevelReadNoPoll function.
// CoAcme4321.cpp STDMETHODIMP Acme4321::IAcme4321_QueryData(SAFEARRAY** ppsaData) { HRESULT hr = S_OK; // Read 1000 bytes hr = io.LowLevel.LowLevelReadNoPoll(ppsaData, 1000); return hr; }