Prev: USB transfer not working after 6 incomplete IN transactions
Next: HID mini - Touchscreen not behaving properly
From: J. Lourens on 1 Feb 2009 08:34 Hi Tim, And thanks again for your reply. I've done loads and loads of reading, I've found an article from Toby Opferman with complete source. This is a working XPDM driver, and the Windows 7 WDK Sample is WDDM if I'm not mistaking. Indeed I've seen that I can call on the Eng* Api for drawing operations, and for sake of the example Toby uses a mapped file for sharing data between the driver and the application. in the DrEnablePDEV he calls: pDeviceData->pVideoMemory = EngMapFile(L"\\??\\c:\\video.dat", RESOLUTION_X*RESOLUTION_Y*4, &pDeviceData->pMappedFile); then in the DrvEnableSurface he calls: EngModifySurface(pDeviceData->hsurf, pDeviceData->hdev, HOOK_FILLPATH | HOOK_STROKEPATH | HOOK_LINETO | HOOK_TEXTOUT | HOOK_BITBLT | HOOK_COPYBITS, 0, (DHSURF)pDeviceData->pDeviceSurface, pDeviceData->pVideoMemory, RESOLUTION_X*4, NULL); I've tried replicating this in the WDK sample but with no luck, I've done all the drawing operations and tried the shared file. All compiles well, the driver gets loaded, but no file is being created. I know this subject is more like black magic, but I don't think that's an argument to stay away from it. I've already learnt so much about the subject, and I haven't even got it working ;) Any way, I'm coming closer and closer to understanding this stuff, I hope someone can kick me in the right direction. Kind regard, Jonathan Lourens "Tim Roberts" wrote: > J. Lourens <JLourens(a)discussions.microsoft.com> wrote: > > > >Thanks for your response, and you are right. C/C++ can't do any more magic > >then Delphi they both access the same api's, only differnce is that Delphi > >can only compile (PE) .exe or Dll. No driver writing in delphi. > > That's patently untrue. A driver is a normal PE DLL. There is no > difference. Several people have ported the include files and written > kernel drivers in Delphi, although I wouldn't recommend it... > > >I'm aware of the struggle and the part that it is not documented. > >And although it's going to be very hard. > >I would still like to gain this knowledge > > > >I hope someone can explain the key asspects, of doing the drawing yourself. > >And pointing me in the right direction. > > Check the sample in the WDK. You can pass most of the drawing on to GDI, > so you don't actually have to manipulate the bitmap yourself very much, > although you will want to intercept most of the calls so you know when the > bitmap has changed. > > I'm still strongly recommending that you take a good, close look at VNC and > UltraVNC to find a way to make it do what you need. Really. > -- > Tim Roberts, timr(a)probo.com > Providenza & Boekelheide, Inc. >
From: Tim Roberts on 2 Feb 2009 21:38
J. Lourens <JLourens(a)discussions.microsoft.com> wrote: > >And thanks again for your reply. >I've done loads and loads of reading, I've found >an article from Toby Opferman with complete source. > >This is a working XPDM driver, and the Windows 7 WDK Sample is WDDM if >I'm not mistaking. WDDM does not yet have mirror drivers. If you're talking about the mirror driver sample, then it's still XPDM. >Indeed I've seen that I can call on the Eng* Api for drawing operations, >and for sake of the example Toby uses a mapped file for sharing data between >the driver and the application. >... >I've tried replicating this in the WDK sample but with no luck, >I've done all the drawing operations and tried the shared file. > >All compiles well, the driver gets loaded, but no file is being created. Now, you get to fire up your kernel debugger and step through it, to figure out where the error is happening. -- Tim Roberts, timr(a)probo.com Providenza & Boekelheide, Inc. |