Share via

My Driver Causes Bluescreen whose error code is KERNEL_SECURITY_CHECK_FAILURE

wk Q 1 Reputation point
2022-08-23T08:14:56.807+00:00

When I was debugging my driver code ,I found that the following code can cause Bluescreen whose error code is KERNEL_SECURITY_CHECK_FAILURE
//LookasideList
NPAGED_LOOKASIDE_LIST lookaside;
memset(&lookaside, 0, sizeof(lookaside));
ExInitializeNPagedLookasideList(&lookaside, NULL, NULL, 0, 10 * LOOKASIDE_MINIMUM_BLOCK_SIZE, 'tag2', 0);
KdBreakPoint();
memptr = ExAllocateFromNPagedLookasideList(&lookaside);
if (memptr == NULL)
{
DbgPrint("allocate fail!\n");
}
else
{
DbgPrint("allocate mem:%p", memptr);
}
ExFreeToNPagedLookasideList(&lookaside, memptr);
memptr = NULL;
ExDeleteNPagedLookasideList(&lookaside);
DbgPrint("initialize mem!\n");

I found that the problem make come from this place: memptr = ExAllocateFromNPagedLookasideList(&lookaside);
Since I just learnt WDK for a week,I couldn't solve this bug.Could anyone help me?
Thanks a lot!!!

Windows for business | Windows Client for IT Pros | Devices and deployment | Other
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.