Partager via


XXX_Read (Device Manager) (Compact 2013)

3/26/2014

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

Syntax

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

Parameters

  • hOpenContext
    [in] Handle to the open context of the device. The XXX_Open (Device Manager) function creates and returns this identifier.
  • pBuffer
    [out] Pointer to the buffer that stores the data read from the device. This buffer should be at leastCount bytes long.
  • Count
    [in] Number of bytes to read from the device into pBuffer.
  • hAsyncRef
    [in] Handle to an I/O packet. This parameter is optional and is used as an input reference handle for CreateAsyncIoHandle.

Return Value

Returns zero to indicate end-of-file. Returns -1 to indicate an error. Returns the number of bytes read to indicate success.

Remarks

After an application calls the ReadFile function to read from the device, the operating system invokes this function. The hFile parameter is a handle to the device. The pBuffer parameter points to the buffer that contains the data read from the device. The Count parameter indicates the number of bytes that the application requests to read from the device.

Device Manager uses the XXX prefix as a placeholder. When implementing the stream interface, replace XXX with a prefix appropriate for your implementation or use undecorated entry point names in conjunction with DEVFLAGS_NAKEDENTRIES. For more information about other valid Flags values, see ActivateDeviceEx.

Requirements

Header

Developer Implemented

Library

Developer Implemented

See Also

Reference

Stream Interface Driver Functions
ActivateDeviceEx
XXX_Open (Device Manager)

Other Resources

ReadFile