Previous Next

IPort::Init

The Init method initializes the port driver.

NTSTATUS
  Init(
    IN PDEVICE_OBJECT  DeviceObject,
    IN PIRP  Irp,
    IN PUNKNOWN  UnknownMiniport,
    IN PUNKNOWN  UnknownAdapter  OPTIONAL,
    IN PRESOURCELIST  ResourceList
    );

Parameters

DeviceObject
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
Pointer to the IRP that was passed as an argument to the adapter driver's device-startup routine.
UnknownMiniport
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
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. See the following Comments section.
ResourceList
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.

Headers

Declared in portcls.h. Include portcls.h.

Comments

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 adapters in the Windows DDK.

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

Callers of Init must run at IRQL PASSIVE_LEVEL.

See Also

DEVICE_OBJECT, IRP, IResourceList