Physical memory access from C# in WinCE 6.0
- From: Albert_Knosos <AlbertKnosos@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Nov 2008 09:24:01 -0800
Hi,
I am using Windows CE 6.0, Compact Framework 2.0, and I want to access
physical memory from C#.
I have a driver and I can call it from C#, because it is loaded in boot time.
I have tried an IoControl, that does the following:
case IOCTL_FPGA_MAPPING:
PHYSICAL_ADDRESS FPGA_addr;
FPGA_addr.HighPart = 0;
FPGA_addr.LowPart = 0x110;
PVOID pFPGA;
pFPGA = MmMapIoSpace(FPGA_addr,0xA6,FALSE);
if (pFPGA == NULL) {
DEBUGMSG(ZONE_INIT,(L"MMA: MmMap Malament\r\n"));
} else {
DEBUGMSG(ZONE_INIT,(L"MMA: MmMap OK\r\n"));
}
pBufOut = (PBYTE)
VirtualAllocCopyEx((HANDLE)GetDirectCallerProcessId(),GetCurrentProcess(),pFPGA,0xA6,PAGE_READWRITE);
break;
What I pretend to do here is to map from 0x110 to 0x1B5, for the C#
application to use them.
I use the MmMapIoSpace to have a virtual address, and then I do a
VirtualAllocCopyEx to copy the virtual address pointer (pFPGA) to the out
pointer of the IoControl (pBufOut).
Could it work?
Thanks in advance, I am new to drivers in Windows in general and I feel
quite lost...
Albert
.
- Follow-Ups:
- Re: Physical memory access from C# in WinCE 6.0
- From: Bradley Remedios
- Re: Physical memory access from C# in WinCE 6.0
- Prev by Date: Re: Link Error While Building DLL [ LNK 2019: __imp__xxx() ]
- Next by Date: InterruptInitialize fails
- Previous by thread: CE 6.0 Building SDK - with and without MFC Support
- Next by thread: Re: Physical memory access from C# in WinCE 6.0
- Index(es):