Hi Dan!
The code with MmUnmapLockedPages works fine in windows 2000 machines.
All the problems appear when NT4.0 is used.
The following is the source code:
On allocation: works fine
VirtualBuffer =
HalAllocateCommonBuffer(DmaAdapter,0x1000,&PhysicalBuffer,FALSE);
MemMDL = IoAllocateMdl(VirtualBuffer,0x1000,FALSE,FALSE,NULL);
MmBuildMdlForNonPagedPool(MemMDL);
UserBuffer = MmMapLockedPages(MemMDL,UserMode
On deallocation: works fine
MmUnmapLockedPages(VirtualBuffer, MemMDL);
IoFreeMdl(MemMDL);
HalFreeCommonBuffer(DmaAdapter,0x1000,PhysicalBuffer,VirtualBuffer,FALSE);
When I close the application BSOD comes up
The stack trace is as follows:
ntoskrnl!DbgBreakPointWithStatus+0x4
ntoskrnl!Kei386EoiHelper+0x2948
hal!HalStartProfileInterrupt+0x34
If you want some more info let me know!!!
Vysyaraju Dali Raju
Vysyaraju Daliraju, / Systems Software Engineer
SBS Technologies, 8371C Central Ave. / Newark, CA 94560
Phone: 510-742-2570 / Fax: -2501 / EMail: xxxxx@sbs.com
mailto:xxxxx
-----Original Message-----
From: Dan Partelly [mailto:xxxxx@rdsor.ro]
Sent: Friday, August 23, 2002 6:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: BSOD appears when MmUnmapLockedPages is used in n t4.0
Maybe would help if you would post a stack trace. Im sorry if I repet myself
for 1001 time on this list, but ppl do yourself a big favor and please use
debug symbols, checked builds, and try to post as much information when you
seek advices regarding crashes. Most of the time I can make more sense from
a stack trace then from tiny pieces of code ppl insist to post. 3 lines of
code out of context aint of much use.
Your mail subject says “when MmUnmapLockedPages() is used” the code you
paste here dont have any MmUnmap…(). I asked in a previous post: “Do you
unmap ?” So , gimme a proper stack trace and probably I can give you a
solution.
Ciao
----- Original Message -----
From: “Vysyaraju Daliraju”
To: “NT Developers Interest List”
Sent: Saturday, August 24, 2002 3:22 AM
Subject: [ntdev] RE: BSOD appears when MmUnmapLockedPages is used in n t4.0
> Hi
> I tried with skipping unlocking function. Still I get BSOD.
> So the code becomes as follows. MmMapLockedPages is required in my
driver,
> as I need to pass user address to application.
>
> On Allocation:
> VirtualBuffer =
> AllocateCommonBuffer(DmaAdapter,0x1000,&PhysicalBuffer,FALSE);
>
> MemMDL = IoAllocateMdl(VirtualBuffer,0x1000,FALSE,FALSE,NULL);
>
> MmBuildMdlForNonPagedPool(MemMDL);
>
> UserBuffer = MmMapLockedPages(MemMDL,UserMode);
>
> On deallocation:
> IoFreeMdl(MemMDL);
>
> HalFreeCommonBuffer(DmaAdapter,0x1000,PhysicalBuffer,VirtualBuffer,FALSE);
>
>
> If I take out MmMapLockedPages in the code, it works but my requirement is
> not met as I need user buffer.
>
> Thank you
>
>
> Vysyaraju Dali Raju
> _____________________________________
> Vysyaraju Daliraju, / Systems Software Engineer
> SBS Technologies, 8371C Central Ave. / Newark, CA 94560
> Phone: 510-742-2570 / Fax: -2501 / EMail: xxxxx@sbs.com
> mailto:xxxxx
>
>
> -----Original Message-----
> From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
> Sent: Friday, August 23, 2002 6:45 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: BSOD appears when MmUnmapLockedPages is used in nt4.0
>
> since you never locked the buffer you shouldn’t be unlocking it. You can
> just free the MDL.
>
> -p
>
>
> From: DALIRAJU VYSYARAJU [mailto:xxxxx@sbs.com]
> Sent: Thu 8/22/2002 10:32 PM
> To: NT Developers Interest List
> Cc:
> Subject: [ntdev] BSOD appears when MmUnmapLockedPages is used in
> nt4.0
>
>
>
> Hi
>
> Can someone help me in finding a solution for acheiving common buffer dma
> .The following is the source code. On allocation I used the following
> code and it works fine.
>
>
>
>
>
> VirtualBuffer =
> HalAllocateCommonBuffer(DmaAdapter,0x1000,&PhysicalBuffer,FALSE);
>
>
> MemMDL = IoAllocateMdl(VirtualBuffer,0x1000,FALSE,FALSE,NULL);
>
>
> MmBuildMdlForNonPagedPool(MemMDL);
>
>
> UserBuffer = MmMapLockedPages(MemMDL,UserMode);
>
>
>
>
>
> On deallocation I used the following code and works fine.
> MmUnlockPages(MemMDL); IoFreeMdl(MemMDL);
> HalFreeCommonBuffer(DmaAdapter,0x1000,PhysicalBuffer,VirtualBuffer,FALSE);
>
>
>
>
>
> BSOD appears when I close the application.
>
> A fatal system error has occurred.
>
>
*************************************************************************
>
>
> *
> *
> * Bugcheck Analysis
> *
> *
> *
>
*************************************************************************
>
>
> WARNING: Unable to verify Timestamp for ntoskrnl.exe
> ERROR: Symbol file could not be found. Defaulted to export symbols
> for ntoskrnl.exe -
> Bugcheck code 0000000A
> Arguments c0503000 00000002 00000000 8012d773
>
> ChildEBP RetAddr Args to Child
> f7497bfc 801415e0 0000000a c0503000 00000002
> ntoskrnl!DbgBreakPointWithStatus+0x4
> WARNING: Unable to verify Timestamp for halapic.dll
> ERROR: Symbol file could not be found. Defaulted to export symbols
> for halapic.dll -
> f7497c18 80010880 f7497c60 8010a465 e1194d68
> ntoskrnl!Kei386EoiHelper+0x2948
> 00000001 00000000 00000000 00000000 00000000 halapic+0xf880
>
> ntoskrnl!DbgBreakPointWithStatus+4:
> 8012ff7c cc
>
> Your responce is highly appreciated
>
> Daliraju
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@microsoft.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@sbs.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>
—
You are currently subscribed to ntdev as: xxxxx@sbs.com
To unsubscribe send a blank email to %%email.unsub%%</mailto:xxxxx></mailto:xxxxx>