Tech Support > Microsoft Windows > Drivers > BSOD_PAGE_FAULT_IN_NON_PAGED_AREA
BSOD_PAGE_FAULT_IN_NON_PAGED_AREA
Posted by fotis on May 13th, 2008


Hi there people,

I have problem running the following driver code. It worked for sometime
but without no obvious reason whenever I try to stop the driver service
a BSOD appears with the PAGE_FAULT_IN_NON_PAGED_AREA error.
I found out that when I remove the set DriverName code the problem disappears
but the question is why.

I'm desperate I cant find a way to fix this thing. I load the driver
with the instdrv.In the Debug Viewer only the HI message apperars Any ideas?

Here is the code

VOID UnLoadMe(IN PDRIVER_OBJECT obj);
UNICODE_STRING us;

NTSTATUS DriverEntry ( IN PDRIVER_OBJECT theDriverObject, IN PUNICODE_STRING
theRegistryPath )
{

DbgPrint("HELLO");
RtlInitUnicodeString( &us, L"TEST\0" );
theDriverObject->DriverName=us;
theDriverObject->DriverUnload=UnLoadMe;
return STATUS_SUCCESS;
}


VOID UnLoadMe(IN PDRIVER_OBJECT obj)
{
DbgPrint("BYE");
}

Posted by Alexander Grigoriev on May 14th, 2008


You CAN'T do that... Why do you think you can?

"fotis" <fotis@discussions.microsoft.com> wrote in message
news:7809FC03-18C3-4A11-84E0-DEF3B7BD2BBC@microsoft.com...


Posted by Doron Holan [MSFT] on May 14th, 2008


alexander is correct, you cannot reassign this value. this field is owned
by the io manager. since the io manager owns it, it thinks it can free it,
which it does on unload. since the buffer points to a constant in your
driver's image and not from pool, it blows up.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:e3owKRXtIHA.748@TK2MSFTNGP05.phx.gbl...

Posted by fotis on May 14th, 2008


Thanks for the info, but how can I set my drivers name?

I thought I can do that because in driver tree I 've seen the driver listed
with the name set.

"Doron Holan [MSFT]" wrote:

Posted by GNRaj on May 14th, 2008


You can try setting a new driver name in the INF file.

If you still want to change in the code you can directly change the
theDriverObject->DriverName
by either Initializing that string or by RtlCopyUnicodeString. The latter
would be better.

"fotis" wrote: