SOLVED: zwMapViewOfSection on x64 causes bugcheck 0x0000007A

Hi to all,
1st of all, I’d like to thank you all for the will to help, and for the
ideas and pointers.
I’ll certainly hang around here more, learning and hopefully helping in the
future… :sunglasses:

While debugging the module this morning, trying to gather all the
information I can in order to forward it to you,
I managed to find the problem:
The original developer used a SpinLock to synchronize the memory mapping
code, which raised the IRQL to DISPATCH_LEVEL.
Since zwMapViewOfSection likes to run in nothing more than PASSIVE_LEVEL, it
crashed.
I changed the synchronization mechanism, and the code works perfectly.

I have NO idea how this worked so far in XP 32bit.

Zvika

“Zvika Meiseles” wrote in message news:xxxxx@ntdev…
> Hi,
>
> I’m porting a driver we have to XP x64 (it works on XP now), but am having
> a hard time getting zwMapViewOfSection to work.
>
> My calls to zwMapViewOfSection work fine, as long as my view size is less
> than ~800KB.
> anything larger bugchecks with code 0x0000007A
> (KERNEL_STACK_INPAGE_ERROR).
> on 32-bit XP the driver created views of size 2MB.
>
> any ideas what to look for?
> any changes in the function’s behaviour under x64 that you know of?
>
> according to the stack trace, the bugcheck happens while in the function
> MiMakePDEExistAndValid, which makes me think that
> for the large views i’m requesting the system tries to create a PDE
> instead of a PTE, and fails.
>
> And, while we’re at it, many of the parameters i tried to pass to
> zwMapViewOfSection are treated as not-valid:
> * zerobits != 0 (although the documentation says anything below 21 is
> fine)
> * BaseAddress != 0
> * AllocationType (MEM_PHYSICAL and MEM_RESERVE are not accepted)
>
> 10x for any help
>
> zvika
>
>