[out] Array of bytes read from the device.
LowLevelRead
Reads raw bytes directly from a device without going through the formatted I/O read buffer.
Syntax
Section titled “Syntax”virtual HRESULT LowLevelRead(BYTE* pBuf, long cbDesired, long* pcbActual, long lTimeout = CUR_TIMEOUT) override;
virtual HRESULT LowLevelRead(SAFEARRAY** pBuf, long cbDesired, long lTimeout = CUR_TIMEOUT) override;Parameters
Section titled “Parameters”pBuf
cbDesired
[in] Number of bytes to read from the device.
pcbActual
[out] Actual number of bytes read from the device.
lTimeout
[in] I/O timeout value in milliseconds.
Return value
Section titled “Return value”Returns S_OK if successful, otherwise a failure HRESULT.
Remarks
Section titled “Remarks”Unlike the buffered I/O functions, such as Queryf, Read, ReadNumber, etc., the LowLevelRead function reads raw bytes directly from the device, rather than going through the formatted I/O read buffer.
Example
Section titled “Example”The following example demonstrates use of the LowLevelRead function.
STDMETHODIMP Acme4321::IAcme4321_QueryData(SAFEARRAY** ppsaData){ HRESULT hr = S_OK;
// Read 1000 bytes hr = io.LowLevel.LowLevelRead(ppsaData, 1000);
return hr;}