NDIS_PAGEABLE_FUNCTION

类别:软件工程 点击:0 评论:0 推荐:
NDIS_PAGEABLE_FUNCTIONNDIS_PAGEABLE_FUNCTION is a macro used to mark a driver function as pageable code.

NDIS_PAGEABLE_FUNCTION(FunctionName)

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

Return Value

None

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

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

本文地址:http://com.8s8s.com/it/it33332.htm