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.
The DriverEntry function of a full-NIC driver usually returns the value returned by NdisRegisterMac.
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.
DriverEntry of NDIS Miniport Drivers, MacAddAdapter, NdisInitializeWrapper, NdisRegisterMac, NdisTerminateWrapper