Hi, I’m trying to write a mirror driver and so far it’s been a bumpy but
progressive ride. I’ve managed to get the DrvCopyBits function working
for the most part, but I keep getting an access violation error everytime
I copy from my device managed bitmaps to my device managed surface. It
says memory location at address 0x4 was accessed. I’ve got no null
pointers that I can see in my bitmaps. I checked the disassembly and the
error occurs at a movsd, where the esi is incremented by 0x4. So it would
seem it’s the bitmaps that’re missing some sort of initialization. But
what? If anyone can shed some light into what possible extra
initialization the bitmaps require when created in the
DrvCreateDeviceBitmap function, (besides what’s done in the sample driver)
I’d appreciate it. A side note might be that the surface memory is non
paged, and shared with user mode… would there be a context switch
problem or some such thing? I’m not familiar with the memory management of
the kernel. Thanks for any help!
benjamin
I just did an EngProbeForRead on my dhsurf member of the psoSrc object
(for a length of 1 byte, and 1 byte alignment), and it still threw an
exception. Yet the address where it says the violation is happening is
nowhere near the address of the dhsurf value. Am I missing something
here???
benjamin
Hi, I’m trying to write a mirror driver and so far it’s been a bumpy but
progressive ride. I’ve managed to get the DrvCopyBits function working
for the most part, but I keep getting an access violation error everytime
I copy from my device managed bitmaps to my device managed surface. It
says memory location at address 0x4 was accessed. I’ve got no null
pointers that I can see in my bitmaps. I checked the disassembly and the
error occurs at a movsd, where the esi is incremented by 0x4. So it would
seem it’s the bitmaps that’re missing some sort of initialization. But
what? If anyone can shed some light into what possible extra
initialization the bitmaps require when created in the
DrvCreateDeviceBitmap function, (besides what’s done in the sample driver)
I’d appreciate it. A side note might be that the surface memory is non
paged, and shared with user mode… would there be a context switch
problem or some such thing? I’m not familiar with the memory management of
the kernel. Thanks for any help!
benjamin
I finally figured out that the Bitmaps that I was creating needed to be
associated with the GDI engine with the EngModifySurface function. It
wasnt enough to modify the surface objects whenever I punted the
EngCopyBits calls to the GDI engine.
benjamin
I just did an EngProbeForRead on my dhsurf member of the psoSrc object
(for a length of 1 byte, and 1 byte alignment), and it still threw an
exception. Yet the address where it says the violation is happening is
nowhere near the address of the dhsurf value. Am I missing something
here???
benjamin> Hi, I’m trying to write a mirror driver and so far it’s been a bumpy but
> progressive ride. I’ve managed to get the DrvCopyBits function working
> for the most part, but I keep getting an access violation error everytime
> I copy from my device managed bitmaps to my device managed surface. It
> says memory location at address 0x4 was accessed. I’ve got no null
> pointers that I can see in my bitmaps. I checked the disassembly and the
> error occurs at a movsd, where the esi is incremented by 0x4. So it would
> seem it’s the bitmaps that’re missing some sort of initialization. But
> what? If anyone can shed some light into what possible extra
> initialization the bitmaps require when created in the
> DrvCreateDeviceBitmap function, (besides what’s done in the sample driver)
> I’d appreciate it. A side note might be that the surface memory is non
> paged, and shared with user mode… would there be a context switch
> problem or some such thing? I’m not familiar with the memory management of
> the kernel. Thanks for any help!
> benjamin
It sounds like you’re doing something very similar to what the VNC mirror
driver does. You may want to check out
http://services.simac.be/vnc/winvncdrv/howto.htm for information on how to
pass the data back up to userland.
sean