DriverEntry of NDIS Full-NIC Drivers

ULONG
   DriverEntry(
       IN PVOID SystemSpecific1,
       IN PVOID SystemSpecific2
       );

DriverEntry is the initial entry point for Windows NT NDIS drivers, called automatically when the driver is loaded by the system.

Parameters

SystemSpecific1

Points to an OS-specific argument. For Windows NT drivers, this parameter is a DriverObject pointer.

SystemSpecific2

Points to an OS-specific argument. For Windows NT drivers, this parameter is a RegistryPath pointer.

Return Value

The DriverEntry function of a full-NIC driver usually returns the value returned by NdisRegisterMac.

Comments

DriverEntry first must call NdisInitializeWrapper, passing the pointers it was given as parameters to NdisInitializeWrapper. The returned NdisWrapperHandle is a required parameter for its subsequent call to NdisRegisterMac.

Next, DriverEntry calls NdisRegisterMac. If its call to NdisRegisterMac returns something other than NDIS_STATUS_SUCCESS, the driver will not remain loaded after DriverEntry returns control.

If NdisRegisterMac returns something other than NDIS_STATUS_SUCCESS, DriverEntry calls NdisTerminateWrapper and returns control with the error NDIS_STATUS_XXX returned by NdisRegisterMac or, possibly, with the general error NDIS_STATUS_FAILURE.

Otherwise, DriverEntry returns control with NDIS_STATUS_SUCCESS, and the driver’s MacAddAdapter function is called next to initialize and configure each NIC the driver supports.

DriverEntry runs at IRQL PASSIVE_LEVEL in the context of a system thread.

See Also

DriverEntry of NDIS Miniport Drivers, MacAddAdapter, NdisInitializeWrapper, NdisRegisterMac, NdisTerminateWrapper