Discussion:
MmMapLockedPagesSpecifyCache in XP and Server2003
(too old to reply)
ysht
2010-07-05 05:19:21 UTC
Permalink
Hi,
I'm Yot and I'm writing a driver.

Here is my driver code:
===
DeviceExtension->SystemVirtualAddress = ExAllocatePool( NonPagedPool , Size6M );
DeviceExtension->Mdl = IoAllocateMdl( DeviceExtension->SystemVirtualAddress,
Size6M, FALSE, FALSE, NULL );
DeviceExtension->UserVirtualAddress = MmMapLockedPagesSpecifyCache(
DeviceExtension->Mdl,
UserMode, MmNonCached, NULL,
FALSE, NormalPagePriority);
---
After MmMapLockedPagesSpecifyCache returns the address of the mapped pages,
my application code accesses the address with it.
===

This code and my application code works well in WindowsXP
Professional Version 2002 SP3.
But in Windows Server 2003 R2 Standard Edition SP3,
MmMapLockedPagesSpecifyCache returns non-NULL value but my application code
can't access the address with it.

Therefore I use WindowsXP,but want to actually Windows Server 2003 now.

Can anyone provide suggestions ?
Any help or guidance would be appreciated.

Thanks!
David Craig
2010-07-05 07:17:16 UTC
Permalink
This newsgroup is for Win32 where it intersects the kernel. This is not a
device driver forum except for those few in the win32 arena. Sharing kernel
memory with a user mode program is a very difficult task to master and
usually leads to security holes unless the driver writer is very experienced
(10 years or more in kernel mode).
Post by ysht
Hi,
I'm Yot and I'm writing a driver.
===
DeviceExtension->SystemVirtualAddress = ExAllocatePool( NonPagedPool , Size6M );
DeviceExtension->Mdl = IoAllocateMdl(
DeviceExtension->SystemVirtualAddress,
Size6M, FALSE, FALSE, NULL );
DeviceExtension->UserVirtualAddress = MmMapLockedPagesSpecifyCache(
DeviceExtension->Mdl,
UserMode, MmNonCached, NULL,
FALSE, NormalPagePriority);
---
After MmMapLockedPagesSpecifyCache returns the address of the mapped pages,
my application code accesses the address with it.
===
This code and my application code works well in WindowsXP
Professional Version 2002 SP3.
But in Windows Server 2003 R2 Standard Edition SP3,
MmMapLockedPagesSpecifyCache returns non-NULL value but my application code
can't access the address with it.
Therefore I use WindowsXP,but want to actually Windows Server 2003 now.
Can anyone provide suggestions ?
Any help or guidance would be appreciated.
Thanks!
ysht
2010-07-05 09:34:15 UTC
Permalink
David,thank you very much.

I'm sorry that I took wrong what I contributed to here because
I had had all of you help here before.

Yot.
Post by David Craig
This newsgroup is for Win32 where it intersects the kernel. This is not
a device driver forum except for those few in the win32 arena. Sharing
kernel memory with a user mode program is a very difficult task to
master and usually leads to security holes unless the driver writer is
very experienced (10 years or more in kernel mode).
Post by ysht
Hi,
I'm Yot and I'm writing a driver.
===
DeviceExtension->SystemVirtualAddress = ExAllocatePool( NonPagedPool , Size6M );
DeviceExtension->Mdl = IoAllocateMdl(
DeviceExtension->SystemVirtualAddress,
Size6M, FALSE, FALSE, NULL );
DeviceExtension->UserVirtualAddress = MmMapLockedPagesSpecifyCache(
DeviceExtension->Mdl,
UserMode, MmNonCached, NULL,
FALSE, NormalPagePriority);
---
After MmMapLockedPagesSpecifyCache returns the address of the mapped pages,
my application code accesses the address with it.
===
This code and my application code works well in WindowsXP
Professional Version 2002 SP3.
But in Windows Server 2003 R2 Standard Edition SP3,
MmMapLockedPagesSpecifyCache returns non-NULL value but my application code
can't access the address with it.
Therefore I use WindowsXP,but want to actually Windows Server 2003 now.
Can anyone provide suggestions ?
Any help or guidance would be appreciated.
Thanks!
Loading...