次の方法で共有


NDIS_INIT_FUNCTION macro

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

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

Syntax

VOID NDIS_INIT_FUNCTION(
   LPTSTR FunctionName
);

Parameters

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

Return value

None

Remarks

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:

DRIVER_INITIALIZE DriverEntry;
#pragma NDIS_INIT_FUNCTION(DriverEntry)
    ...  //other function declarations
NTSTATUS
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 run time in a Plug and Play environment.

Requirements

Target platform

Desktop

Header

Ndis.h (include Ndis.h)

See also

DriverEntry of NDIS Miniport Drivers

DriverEntry of NDIS Protocol Drivers

NDIS_PAGEABLE_FUNCTION

 

 

Send comments about this topic to Microsoft