IPort::Init method

The Init method initializes the port driver.

Syntax


NTSTATUS Init(
  [in]            PDEVICE_OBJECT DeviceObject,
  [in, optional]  PIRP Irp,
  [in]            PUNKNOWN UnknownMiniport,
  [in, optional]  PUNKNOWN UnknownAdapter,
  [in]            PRESOURCELIST ResourceList
);

Parameters

DeviceObject [in]

Pointer to the device object that was passed as an argument to the adapter driver's device-startup routine. The device object is a system structure of type DEVICE_OBJECT.

Irp [in, optional]

Pointer to the IRP that was passed as an argument to the adapter driver's device-startup routine.

UnknownMiniport [in]

Pointer to the IUnknown interface of the uninitialized miniport object. This interface is queried for the specific miniport interface supported by the port driver, and the initialization function on that interface is called.

UnknownAdapter [in, optional]

Pointer to the IUnknown interface of the adapter object whose port driver is being initialized. This pointer is optional and can be specified as NULL. For more information, see the following Remarks section.

ResourceList [in]

Pointer to the IResourceList object that was passed as an argument to the adapter driver's device-startup routine. After passing this reference to the miniport driver, the port driver is free to examine the contents of the resource list but will not modify the contents of this list.

Return value

Init returns STATUS_SUCCESS if the call was successful. Otherwise, the method returns an appropriate error code.

Remarks

The miniport object specified by UnknownMiniport must support the miniport interface that the port driver requires or the Init call will fail.

During the IPort::Init call, the port driver calls the miniport driver's initialization method (for example, see IMiniportWavePci::Init).

Parameter UnknownAdapter points to the COM interface of an adapter object. The adapter driver typically creates this object within its device-startup routine, which is the routine that the operating system calls to start the device (see Startup Sequence). For an example of an interface for an adapter object, see the definition and implementation of the IAdapterObject interface in the sb16 and msvad sample audio drivers in the Microsoft Windows Driver Kit (WDK).

The UnknownMiniport, UnknownAdapter, and ResourceList parameters follow the reference-counting conventions for COM objects.

Requirements

Header

Portcls.h (include Portcls.h)

IRQL

PASSIVE_LEVEL

See also

DEVICE_OBJECT
IRP
IResourceList
IMiniportWavePci::Init

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft