ISideShowClassExtension2::InitializeAsync method

The ISideShowClassExtension2::InitializeAsync method initializes an instance of the class extension object used for raising events, and registers the SideShow driver's ISideShowDriver interface.

Syntax


HRESULT InitializeAsync(
  [in, optional]  IUnknown *pWdfDeviceUnknown,
  [in, optional]  IUnknown *pSideShowDriverUnknown
);

Parameters

pWdfDeviceUnknown [in, optional]

A pointer to the IUnknown interface that supports the IWDFDevice interface. The class extension object uses the methods of IWDFDevice to interact with the User-Mode Driver Framework (UMDF) platform and communicate with other Windows SideShow platform components.

pSideShowDriverUnknown [in, optional]

A pointer to the IUnknown interface that supports the driver's ISideShowDriver interface.

Return value

The InitializeAsync method returns S_OK if the class extension object registers the driver's ISideShowDriver interface. Otherwise, this method returns one of the error codes that are defined in Winerror.h. If the class extension object returns an error code, the Windows SideShow platform will not allow the associated device to work.

Remarks

Use this method instead of ISideShowClassExtension::Initialize when you want to use the SideShow class extension in asynchronous mode. This mode changes the behavior of ISideShowClassExtension::OnProcessIoControl, although, your code does not need to handle OnProcessIoControl differently than in the past. The following list describes these changes in behavior:

  • I/O requests that are processed asynchronously return E_PENDING. The pcbWritten parameter is set to zero. The class extension calls IWDFIoRequest::CompleteWithInformation when the request has been completed.

  • I/O requests that can be processed synchronously return S_OK. The pcbWritten parameter is set to zero. The class extension calls IWDFIoRequest::CompleteWithInformation before returning.

To uninitialize the SideShow class extension, you must first call IWDFIoQueue::DrainSynchronously, and then call ISideShowClassExtension::Uninitialize. You can retrieve the queue interface by calling IWDFDevice::GetDefaultIoQueue on the WDF device object. Then, call IWDFIoQueue::DrainSynchronously to process all the queued requests. Calling IWDFIoQueue::DrainSynchronously blocks the queuing of new requests, so you must call IWDFIoQueue::Start after you reinitialize the class extension.

Requirements

Version

Available in Windows 7

Header

Windowssideshowclassextension.h (include WindowsSideShowClassExtension.h)

 

 

Send comments about this topic to Microsoft

显示:
© 2014 Microsoft