DriverEntry of SCSI Miniport Driver

ULONG
DriverEntry(

IN PVOID Argument1,
IN PVOID Argument2
);

Each miniport driver must have a routine explicitly named DriverEntry in order to be loaded.

Parameters

Argument1

Is a pointer with which the miniport driver must call ScsiPortInitialize.

Argument2

Is a pointer with which the miniport driver must call ScsiPortInitialize.

Return Value

DriverEntry returns the value returned by ScsiPortInitialize. If it calls ScsiPortInitialize more than once, DriverEntry returns the lowest value returned by ScsiPortInitialize.

Comments

A miniport’s DriverEntry routine allocates memory on the stack and initializes a HW_INITIALIZATION_DATA structure with zeros. DriverEntry must zero all members in the HW_INITIALIZATION_DATA structure before initializing it with values appropriate to the HBA(s) the miniport supports.

DriverEntry should set the HwInitializationDataSize member to sizeof(HW_INITIALIZATION_DATA) to indicate which version of this structure it is using, as well as initializing all members appropriately for its HBA(s).

Next, DriverEntry calls ScsiPortInitialize. If a miniport driver supports HBA(s) that can be connected on more than one type of I/O bus, such as both MicroChannel and Isa type buses, it should call ScsiPortInitialize once for each type of I/O bus. Such a miniport driver must return the lowest value returned by its calls to ScsiPortInitialize from the DriverEntry routine. A miniport driver writer can make no assumptions about the values returned by ScsiPortInitialize.

See Also

HwScsiFindAdapter, HW_INITIALIZATION_DATA, ScsiPortInitialize