IDeviceIoControl::DeviceIoControlSync method (deviceaccess.h)

The DeviceIoControlSync method sends a synchronous device input/output (I/O) control request to the device interface that the call to the CreateDeviceAccessInstance function specified.

Syntax

HRESULT DeviceIoControlSync(
  [in]  DWORD ioControlCode,
  [in]  UCHAR *inputBuffer,
  [in]  DWORD inputBufferSize,
  [out] UCHAR *outputBuffer,
  [in]  DWORD outputBufferSize,
  [out] DWORD *bytesReturned
);

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 optional output buffer for the operation.

[in] outputBufferSize

The size of output buffer, in bytes.

[out] bytesReturned

A pointer to a variable that receives the number of bytes that were written into the output buffer, if one was specified.

Return value

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

Remarks

Because this is a synchronous method, you must not use it on a thread that can't handle being blocked for an extended period. In this case, you use the DeviceIoControlAsync method.

Requirements

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

See also

IDeviceIoControl