NDIS_PAGEABLE_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_PAGEABLE_FUNCTION is a macro used to mark a driver function as pageable code.

Syntax

VOID NDIS_PAGEABLE_FUNCTION(
   LPTSTR FunctionName
);

Parameters

  • FunctionName
    Specifies the name of the driver function to be made pageable.

Return value

None

Remarks

Any driver function marked with NDIS_PAGEABLE_FUNCTION can be paged out of memory after it returns control and paged back into memory if it is called subsequently.

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

VOID miniportXxx(...);
#pragma NDIS_PAGEABLE_FUNCTION(miniportXxx)
    ...  //other function declarations
VOID
miniportXxx(...)
{
    ...
}
    ...

Because Windows 2000 and later versions in-page operations run at IRQL < DISPATCH_LEVEL, any NDIS driver function that can possibly execute at IRQL >= DISPATCH_LEVEL cannot be made pageable. Marking a driver function pageable when it runs at IRQL >= DISPATCH_LEVEL can cause fatal page faults in that driver.

Usually, NIC drivers can use this macro on their MiniportInitialize and MiniportHalt functions. A miniport driver also can use this macro on internal driver functions called only by MiniportInitialize or MiniportHalt, as long as the functions marked pageable never call any of the NdisXxx that raise IRQL, such as NdisAcquireSpinLock.

NDIS protocol drivers can use this macro on any driver function that always runs at IRQL < DISPATCH_LEVEL. Such a function is never called at raised IRQL. Such a function cannot call driver or system-supplied functions that run at IRQL >= DISPATCH_LEVEL.

Requirements

Target platform

Desktop

Header

Ndis.h (include Ndis.h)

IRQL

See Remarks section.

See also

MiniportHalt

MiniportInitialize

NDIS_INIT_FUNCTION

ProtocolBindAdapter

ProtocolUnbindAdapter

Send comments about this topic to Microsoft