"QuasiCodo" <QuasiCodo_nospam_@Yahoo.com> wrote in message
news:uDcSYo$...
> I actually get 64 GB of VA space allocated -- which is plenty for my
> purposes
What, may I ask, are you trying to do exactly?
> I don't know if I need this following line
> MmBuildMdlForNonPagedPool (mdl);
No, you don't.
>When I try to probe and lock, MmProbeAndLockPages() throws an
>EXCEPTION_EXECUTION_HANDLER exception with status 0xC0000005,
>which is an access violation.
You don't need to probe and lock either, though it probably shouldn't raise.
Have you tried this with a checked kernel/hal and Verifier running?
You also might really want to describe the problem you're trying to solve,
there might be a better answer.
-scott
--
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
http://twitter.com/analyzev
"QuasiCodo" <QuasiCodo_nospam_@Yahoo.com> wrote in message
news:uDcSYo$...
> I'm trying to manage my own virtual address space from my driver, but I am
> having trouble when try to allocate, map and lock a subset of the VA
> space. Here is what I am doing:
>
> // Allocate our virtual address space
> // Start at 1 TB and work our way down va_space_size =
> MAX_VA_SPACE_SIZE;
> do
> {
> va_space = MmAllocateMappingAddress (
> pgallctr.va_space_size,
> PGALLCTR_TAG);
> if ( !va_space )
> {
> // Negoiate to smaller size
> va_space_size >>= 1;
> if ( va_space_size < MIN_VA_SPACE_SIZE )
> {
> error ("Cannot allocate VA space!\n");
> goto Exit;
> }
> }
> } while (!va_space);
>
> >> I actually get 64 GB of VA space allocated -- which is plenty for my
> >> purposes
>
>
> >> I tried two different ways to allocate an MLD
>
> // Allocate an MDL for the slot address
> alloc_size = 128 * 1024 * 1024;
> //mdl = IoAllocateMdl (ptr, alloc_size, FALSE, FALSE, NULL);
> //if ( !mdl )
> //{
> // error ("IoAllcateMdl failed\n");
> // goto Exit;
> //}
> low.QuadPart = 0;
> high.QuadPart = 0xFFFFFFFFFFFFFFFF;
> skip.QuadPart = PAGE_SIZE;
> mdl = MmAllocatePagesForMdlEx (low, high, skip, alloc_size,
> MmNonCached, 0);
> if ( !mdl )
> {
> error ("MmAllocatePagesForMdlEx failed\n");
> goto Exit;
> }
>
> >> I don't know if I need this following line
>
> MmBuildMdlForNonPagedPool (mdl);
>
> >> When I try to probe and lock, MmProbeAndLockPages() throws an
> >> EXCEPTION_EXECUTION_HANDLER exception with status 0xC0000005,
> >> which is an access violation.
>
> __try
> {
> // Probe and lock pages
> MmProbeAndLockPages (mdl, KernelMode, IoWriteAccess);
> locked = TRUE;
> }
> __except(EXCEPTION_EXECUTE_HANDLER)
> {
> error ("MmProbeAndLockPages failed, status = 0x%x\n",
> GetExceptionCode());
> goto Exit;
> }
>
>
> I would appreciate any help or reference.
>
> thx,
>
> ((&->
>