Not really being a DirectX developer, I don’t have a good sense on what
percentage of systems it will work on, my guess is almost anything except
perhaps the base VGA driver. Offscreen surfaces were a pretty basic feature.
I also don’t know if this is all now obsolete and possibly will no longer
work on a modern display adapter. You might have to adjust the type of
surface based on the display hardware capability. A fragment of code to do
this looks something like below (return code checking has been removed in
many cases to shorten the code posted here). I would find the docs for the
CreateSurface API, and find a simple sample that did all the right stuff. It
not really much more than below to get things set up enough to play with,
but you may need to do things like enumerate the available pixel format
types. I actually had a COM object that wrapped around all this and I called
it from a VBScript script, so it must not need a lot of fancy context to
work.
// Create the main DirectDraw object.
hRet = DirectDrawCreateEx(NULL, (LPVOID *)&dd,
IID_IDirectDraw7, NULL);
// Get normal mode.
hRet = dd->SetCooperativeLevel(NULL, DDSCL_NORMAL);
// create an offscreen surface in video memory
ZeroMemory( &ddsd, sizeof( ddsd ) );
ddsd.dwSize = sizeof( ddsd );
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT |
DDSD_PIXELFORMAT;
ddsd.ddpfPixelFormat.dwSize = sizeof( ddsd.ddpfPixelFormat
);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |
DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
ddsd.dwWidth = 1024;
ddsd.dwHeight = (desiredSize / 4096);
hRet = dd->CreateSurface(&ddsd, &videoSurface, NULL );
hRet = videoSurface->Lock(NULL,&ddsd,
DDLOCK_SURFACEMEMORYPTR, NULL);
videoBuffer = (PVOID)ddsd.lpSurface;
You then take the virtual address of the display bitmap and pass it via an
ioctl to the driver, which maps it to system virtual addresses. Back in
about 2004 when I did this, you got a pointer to memory on the video card
with the display hardware programmed such that any changes to the bitmap
were displayed. You could pre-render some text/graphics into another bitmap
with a matching format and then all you need to do is copy from the memory
bitmap to the live display surface in your driver. This would be enough to
give some animated activity indicator. I actually had hardware DMA directly
to the display surface bitmap, and you could see on the screen when DMA
happened. It was part of a hardware testing application.
Jan
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-414160-
xxxxx@lists.osr.com] On Behalf Of b@if0.com
Sent: Wednesday, June 09, 2010 10:49 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Write to screen inside kernel driver
Hi Peter, no, I’m afraid, it has to work on any computer, Win2k, WinXP, or
Vista. Not 7 yet thank God! 
I spent my day trying stuff of the sort of EngCreateBitmap, with no
result.
Jan, I guess I will have to look into the DirectX memory window idea of
yours,
but will it work even on a plain Windows2k machine, without any additional
DirectX installations?
Don, thanks, I might have to go the good old Text Mode way, and then reset
the computer when finished, I have an Out port from the good old days that
still seems to work, does a hardware reset 
Philip D. Barila, not sure what you mean about someone else. The system
stays in Kernel mode for up to 1 hour, being 100% busy with the driver,
nothing else works, no dispatcher, no other threads.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer