DriverEntry of NDIS Miniport Drivers function

The DriverEntry function is required and is the first function that the system calls in any NDIS miniport driver.

Syntax


ULONG DriverEntry(
  _In_  PVOID Argument1,
  _In_  PVOID Argument2
);

Parameters

Argument1 [in]

A pointer to a system-supplied parameter. For Windows 2000 and later drivers, this points to a driver object, which is opaque to any NDIS driver that exports only MiniportXxx functions.

Argument2 [in]

A pointer to a second system-supplied parameter. For Windows 2000 and later drivers, this points to a registry path, which is opaque to any NDIS driver that exports only MiniportXxx functions.

Return value

DriverEntry returns the value that is returned by the NdisMRegisterMiniportDriver function.

Remarks

NDIS miniport drivers fill in an NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure with the appropriate version numbers and the entry points for driver-supplied MiniportXxx functions and then call NdisMRegisterMiniportDriver.

Intermediate drivers share most of the DriverEntry requirements of miniport drivers. For more information about the DriverEntry function for intermediate drivers, see DriverEntry of NDIS Intermediate Drivers.

DriverEntry can allocate the NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure on the stack because the NDIS library copies the relevant information to its own storage. DriverEntry should clear the memory for this structure with NdisZeroMemory before setting any driver-supplied values in its members. The MajorNdisVersion and MinorNdisVersion members must contain the major and minor versions of NDIS that that driver supports. In each XxxHandler member of the characteristics structure, DriverEntry must set the entry point of a driver-supplied MiniportXxx function, or the member must be NULL.

To enable a miniport driver to configure optional services, NDIS calls the MiniportSetOptions function in the context of the miniport driver's call to NdisMRegisterMiniportDriver.

Drivers that call NdisMRegisterMiniportDriver must be prepared for NDIS to call their MiniportInitializeEx functions any time after DriverEntry returns. Such a driver must have sufficient installation and configuration information stored in the registry or available from calls to an NdisXxx bus-type-specific configuration function to set up any NIC-specific resources the driver will need to carry out network I/O operations.

If NdisMRegisterMiniportDriver does not return NDIS_STATUS_SUCCESS, DriverEntry must release any resources that it allocated before it returns control. The driver will not be loaded if this occurs.

Requirements

Version

Supported in NDIS 5.1, and NDIS 6.0 and later. For NDIS 5.1 drivers, see DriverEntry of NDIS Miniport Drivers (NDIS 5.1).

Header

Ndis.h (include Ndis.h)

IRQL

PASSIVE_LEVEL

See also

MiniportInitializeEx
MiniportSetOptions
NDIS_MINIPORT_DRIVER_CHARACTERISTICS
NdisMRegisterMiniportDriver
NdisZeroMemory
Initializing a Miniport Driver

 

 

Send comments about this topic to Microsoft

Afficher:
© 2014 Microsoft