Partager via


IMDSPDevice3::DeviceIoControl

banner art

The DeviceIoControl method calls the device I/O control.

Syntax

HRESULT DeviceIoControl(DWORDdwIoControlCode,BYTE*lpInBuffer,DWORDnInBufferSize,BYTE*lpOutBuffer,LPDWORDpnOutBufferSize);

Parameters

dwIoControlCode

[in]  I/O control code being sent to the device.

lpInBuffer

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

nInBufferSize

[in]  Size of lpInBuffer, in bytes.

lpOutBuffer

[out]  Output buffer, supplied by the calling application.

pnOutBufferSize

[in]  Size of lpOutBuffer, in bytes.

Return Values

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 extenstive 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 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

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also