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%%</mailto:xxxxx>