IMDSPDevice3::DeviceIoControl method (mswmdm.h)

The DeviceIoControl method calls the device I/O control.

Syntax

HRESULT DeviceIoControl(
  [in]  DWORD   dwIoControlCode,
  [in]  BYTE    *lpInBuffer,
  [in]  DWORD   nInBufferSize,
  [out] BYTE    *lpOutBuffer,
  [in]  LPDWORD pnOutBufferSize
);

Parameters

[in] dwIoControlCode

I/O control code being sent to the device.

[in] lpInBuffer

Input buffer supplied by the calling application. This can be NULL if nInBufferSize is zero.

[in] nInBufferSize

Size of lpInBuffer, in bytes.

[out] lpOutBuffer

Output buffer, supplied by the calling application.

[in] pnOutBufferSize

Size of lpOutBuffer, in bytes.

Return value

The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes
For an extensive list of possible error codes, see Error Codes.

Remarks

This method provides a private mode of communication between the application and the service provider. The service provider can then process this IOCTL, optionally modify it, and pass it to the kernel-mode driver.

Compared to IMDSPDevice::SendOpaqueCommand, this method better aligns with the DeviceIoControl Windows API because the output buffer is supplied by the caller. Also, unlike IMDSPDevice::SendOpaqueCommand, this method does not involve any MAC check and is more efficient.

Requirements

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

IMDSPDevice3 Interface

IMDSPDevice::SendOpaqueCommand

IWMDMDevice3::DeviceIoControl