IMDSPDevice3::DeviceIoControl

banner art

The DeviceIoControl method calls the device I/O control.

Syntax

HRESULT DeviceIoControl(
  DWORD  dwIoControlCode,
  BYTE*  lpInBuffer,
  DWORD  nInBufferSize,
  BYTE*  lpOutBuffer,
  LPDWORD  pnOutBufferSize
);

Parameters

dwIoControlCode

[in]  I/O control code of the device.

lpInBuffer

[in]  Input buffer size, in bytes.

nInBufferSize

[in]  Count of the input buffers.

lpOutBuffer

[out]  Output buffer size, in bytes.

pnOutBufferSize

[in]  Count of the output buffer.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider 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 a complete list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table. If the method fails with an error, it returns a standard error code.

Return code Description
S_OK The method succeeded.
S_FALSE The method failed.
E_INVALIDARG The parameters are invalid or NULL.
WMDM_E_NOTSUPPORTED The service provider or device does not support this method or control code.

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 SendOpaqueCommand, this method better aligns with the DeviceIoControl Windows API because the output buffer is supplied by the caller. Also, unlike SendOpaqueCommand, this method does not involve any MAC check and is more efficient.

Requirements

Header: Defined in wmsp.idl.

Library: mssachlp.lib

See Also