NDIS_PAGEABLE_FUNCTION

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

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

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有