Closed fgmailbox closed 1 year ago
大哥,问题依然存在页故障,建议你用以下函数试试 template <typename LookAsideType, ULONG SIZE, ULONG TAG, ULONG ARENA> LookAsideType init_lookaside_private() {
__try
{
if constexpr (std::is_same_v<LookAsideType, PNPAGED_LOOKASIDE_LIST>)
{
static NPAGED_LOOKASIDE_LIST npageList{0};
ExInitializeNPagedLookasideList(
&npageList,
NULL, NULL,
0,
SIZE,
TAG,
0
);
return &npageList;
}
else if constexpr (std::is_same_v<LookAsideType, PPAGED_LOOKASIDE_LIST>)
{
static PAGED_LOOKASIDE_LIST pageList{0};
ExInitializePagedLookasideList(
&pageList,
NULL, NULL,
0,
SIZE,
TAG,
0);
return &pageList;
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
// User opted to ignore the breakpoint
ASSERTMSG((PSTR) "初始化 LookasideList 失败,发生异常", false);
return nullptr;
}
};
void testfunc() { static PNPAGED_LOOKASIDE_LIST pNpageList = init_lookaside_private<PNPAGED_LOOKASIDE_LIST,256, 'CACT', NonPagedPool>(); }; 你可以用这两个函数测试,需要c++17以上支持
大哥,问题依然存在页故障,