IDeviceIoControl::DeviceIoControlAsync method

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, size_is(inputBufferSize)]   UCHAR                            *inputBuffer,
  [in]                             DWORD                            inputBufferSize,
  [out, size_is(outputBufferSize)] UCHAR                            *outputBuffer,
  [in]                             DWORD                            outputBufferSize,
  [in]                             IDeviceRequestCompletionCallback *requestCompletionCallback,
  [out]                            ULONG_PTR                        *cancelContext
);

Parameters

ioControlCode [in]

The I/O control code for the operation.

inputBuffer [in]

An optional input buffer for the operation.

inputBufferSize [in]

The size of input buffer, in bytes.

outputBuffer [out]

An operational output buffer for the operation.

outputBufferSize [in]

The size of output buffer, in bytes.

requestCompletionCallback [in]

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

cancelContext [out]

An optional pointer that receives a cancel context that can be passed to the CancelOperationmethod 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

Header

Deviceaccess.h

IDL

Deviceaccess.idl

Library

Deviceaccess.lib

See also

IDeviceIoControl

 

 

Community Additions

ADD
Show: