This documentation is archived and is not being maintained.

ISideShowClassExtension::OnProcessIoControl method

Processes Windows Portable Device (WPD) commands.

Syntax


HRESULT OnProcessIoControl(
  [in, optional] IWDFIoQueue   *pWdfQueue,
  [in, optional] IWDFIoRequest *pWdfRequest,
  [in]           ULONG         ControlCode,
  [in]           SIZE_T        InputBufferSizeInBytes,
  [in]           SIZE_T        OutputBufferSizeInBytes,
  [out]          DWORD         *pcbWritten
);

Parameters

pWdfQueue [in, optional]

A pointer to the IWDFIoQueue interface for the I/O queue object that the WPD command arrives from.

pWdfRequest [in, optional]

A pointer to the IWDFIoRequest interface that represents a framework request object for the WPD command.

ControlCode [in]

The WPD command (WPD I/O control code (IOCTL)) that identifies the specific operation to be performed and that is associated with the request.

InputBufferSizeInBytes [in]

The size, in bytes, of the input buffer for the request.

OutputBufferSizeInBytes [in]

The size, in bytes, of the output buffer for the request.

pcbWritten [out]

A pointer to a variable that receives the number of bytes that were written for the request.

Return value

The OnProcessIoControl method returns S_OK if the operation succeeds. Otherwise, this method returns one of the error codes that are defined in Winerror.h. If the class extension cannot handle the WPD command, the class extension returns HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED).

Remarks

After the driver calls the ISideShowClassExtension::Initialize method to initialize the class extension object, the driver can use the class extension object to process WPD commands. The following example code shows how WPD commands are processed:


HRESULT CMyDevice::ProcessIoControl(
        /* [in] */ IWDFIoQueue*    pQueue,
        /* [in] */ IWDFIoRequest*  pRequest,
        /* [in] */ ULONG           ControlCode,   
        /* [in] */ SIZE_T          InputBufferSizeInBytes,
        /* [in] */ SIZE_T          OutputBufferSizeInBytes,
        /* [out]*/ DWORD*          pcbWritten)
{
     if (m_pClassExtension == NULL)
     {
        return E_UNEXPECTED;
     }

     if (WPD_MESSAGE == ControlCode)
     {
          hr = m_pClassExtension->OnProcessIoControl(
                                   pQueue,
                                   pRequest,
                                   ControlCode,
                                   InputBufferSizeInBytes,
                                   OutputBufferSizeInBytes,
                                   pcbWritten);
     }

    return hr;
}

For more information about WPD commands, see the Windows Portable Devices Driver documentation.

Requirements

Target platform

Desktop

Header

Windowssideshowclassextension.h (include WindowsSideShowClassExtension.h)

See also

ISideShowClassExtension::Initialize
IWDFIoQueue
IWDFIoRequest

 

 

Send comments about this topic to Microsoft

Show: