Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


NULL pointer dereferencing is throwing an exception, although it shouldn't

ArtoriosArtorios Member Posts: 1
edited January 14 in WINDBG

Hello! Can anybody, please help me with my problem.
I decided to write a driver that will map zero virtual address to 0 physical page. To do this, I wrote dword 0x00000001 to VA 0xC0000000. After it, i check result:
kd> dd 0xC0000000
c0000000 00000001 00000000 00000000 00000000

kd> !pte 0
VA 00000000
PDE at C0300000 PTE at C0000000
contains 2FA62867 contains 00000001
pfn 2fa62 ---DA--UWEV pfn 0 -------KREV

kd> !db 0

0 53 ff 00 f0 53 ff 00 f0-c3 e2 00 f0 53 ff 00 f0 S...S.......S...

check VA 0:
kd> db 0

0 53 ff 00 f0 53 ff 00 f0-c3 e2 00 f0 53 ff 00 f0 S...S.......S...

everything works in the kernel debugger. Now 0 VA is mapped to 0 physical address. I get the same result if I attach to program through the user mode debugger in guest vm. Its mean, that it work! But this only works in the debuggers, because, after that, when my program tries to read 0 and to get 0x53, it throws an exception, although now it should not be.
Tell me, please, what could be the problem? Could it be TLB? How i can view tlb from windbg?
P.S I'm testing on a Windows 7 x86 without PAF, for simplicity.

UPD: i solv it. I forget to set U/S fkag :smiley:

Post edited by Artorios on
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 19-23 June 2023 Live, Online
Writing WDF Drivers 10-14 July 2023 Live, Online
Kernel Debugging 16-20 October 2023 Live, Online
Developing Minifilters 13-17 November 2023 Live, Online