User Mode address? Sounds like you're thinking desktop, not CE. You have a
physical or a virtual address? P/Invoking MmMapIoSpace or
VirtualAlloc/VirtualCopy is probably what you're after.
There's nothing inherently "bad" about what you want to do. I've done it
before, and on many occasions. I have all the "work" done for you.
Here's an article:
http://msdn.microsoft.com/library/de...edcode_cf2.asp
And here's a class:
http://www.opennetcf.org/library/Ope...erMembers.html
Simply create the class instance with your address and size, then call
GetUnsafePointer and go to it.
--
Chris Tacke
OpenNETCF Consulting
www.opennetcf.com
--
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I like .NET CF 2.0. I love speed. I need both.
>
> Situation: PCI device on CE 5.0. Memory mapped IO connectivity to
> device.
>
> Desires:
>
> o I want to have my driver init routine return an address pointing to
> the user mode address of the memory mapped region in the hardware.
>
> o I want to PInvoke into this code to grab that pointer and load it
> into an unsafe block in c#.
>
> o I want to manipulate things in the hardware via .NET by using this
> unsafe block to change values in the memory region I got from the prior
> step.
>
> I think this all works, but I am not peaked on the performance issues.
> I belive that I can avoid all the pinvoke business this way (except for
> the first one that sets things up) and do fast .NET access to the
> hardware.
>
> Can anybody comment on my peculiar approach? I am willing to take the
> risks, but I am looking for people who understand the thing I am doing
> at a CE internals level who may know reasons this is bad bad bad.
>
> Thanks,
>
> Paul
>