NDIS_INIT_FUNCTION

NDIS_INIT_FUNCTION(FunctionName)

NDIS_INIT_FUNCTION is a macro used to mark a driver function to be run once only during initialization.

Parameters

FunctionName

The name of the function that is only used during initialization.

Comments

Any driver function marked with NDIS_INIT_FUNCTION is discarded when the DriverEntry function returns control.

For example, such a function is declared in the driver source as follows:

NDIS_STATUS DriverEntry(...);

#pragma NDIS_INIT_FUNCTION(DriverEntry)

    ...  //other function declarations

NDIS_STATUS

DriverEntry(...)

{

    ...

}

    ...

NDIS drivers can use this macro on their DriverEntry functions and on internal driver functions that are called only by their DriverEntry functions.

A NIC driver cannot use this macro on its MiniportInitialize function, nor on any internal driver function called by MiniportInitialize, because this function can be called at runtime in a Plug-and-Play environment.

See Also

DriverEntry of NDIS Miniport Drivers, DriverEntry of NDIS Protocol Drivers, NDIS_PAGABLE_FUNCTION