IDeviceIoControl::DeviceIoControlAsync method (deviceaccess.h)

The DeviceIoControlAsync method sends an asynchronous device input/output (I/O) control request to the device interface that the call to the CreateDeviceAccessInstance function specified.

Syntax

HRESULT DeviceIoControlAsync(
  [in]  DWORD                            ioControlCode,
  [in]  UCHAR                            *inputBuffer,
  [in]  DWORD                            inputBufferSize,
  [out] UCHAR                            *outputBuffer,
  [in]  DWORD                            outputBufferSize,
  [in]  IDeviceRequestCompletionCallback *requestCompletionCallback,
  [out] ULONG_PTR                        *cancelContext
);

Parameters

[in] ioControlCode

The I/O control code for the operation.

[in] inputBuffer

An optional input buffer for the operation.

[in] inputBufferSize

The size of input buffer, in bytes.

[out] outputBuffer

An operational output buffer for the operation.

[in] outputBufferSize

The size of output buffer, in bytes.

[in] requestCompletionCallback

The callback interface on which the RequestCompletion method is called if the operation is submitted successfully.

[out] cancelContext

An optional pointer that receives a cancel context that can be passed to the CancelOperation method to cancel an outstanding request.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

If the request is submitted successfully (that is, calling this function doesn't immediately return an error), the result of the operation is available in the RequestCompletion callback of the supplied IDeviceRequestCompletionCallback interface.

An operation that the system (operating system or device driver) fails immediately doesn't result in a callback.This means that the caller receives a callback only if this function returns S_OK.

Requirements

Requirement Value
Target Platform Windows
Header deviceaccess.h
Library Deviceaccess.lib

See also

IDeviceIoControl