Virtual Display Adapter

Hi, I’m completely new to driver development. I would like to create a virtual display adapter like the one at http://www.codeproject.com/system/driverdev6asp.asp for Windows XP SP2. Although I have successfully compiled the miniport, gdi display dll, and application with the WDK XP Checked build, it seems that my gdi dll results in the “Invalid Display Settings. It was written for a previous version of Windows and is no longer compatible with this version of Windows.” error.

In order to compile the GDI driver, I had to use the sample code from codeproject and add the X86 define and also change the DDI_VERSION to NT1_SP1 (which I looked up on MSDN). I’ve also looked at the mirror driver sample, that I’m not sure how to operate.

Any hints as to how to correctly compile the sample code provided at code project would be great. I’d also like to know how to use windbg or some other debugging tools to somehow debug this kernel mode driver and other user-mode drivers. Any references or links to recommended docs would be greatly appreciated.

This is not really my thing, but as it is Sunday, and you might not get another reply until tomorrow, I’ll do my best.

This first thing is where are you getting this error message, and what do you do that causes it?

I believe what you are trying to do is get a XP SP2 display driver (GDI) to work on Vista? If this is correct, the good news is that I believe that while Vista does have a totally different video driver model, it still supports the Windows 2000 model, so you should be OK here. As far as the compilation part, you lose me. The first thing is, while I am not familiar with the codeproject source code, I would wonder why the X86 macro has to be defined; that seems unusal. The bigger issue is that, to the best of my knowledge neither “DDI_VERSION” nor “NT1_SP1” are WDK macros; assuming that this is correct, redefining them doesn’t do anything, unless they are specific to the codeproject source code, in this case I can’t comment. In the case of the first, I think you probably mean “NTDDI_VERSION;” I don’t know what you mean by the second. From a purely WDF point of view, that is, leaving out the specific source code you are using, if I understand the situation correctly, you should be able to compile for XP SP2 and it should work on Vista, although it will not be of the newer model.

In general, you’re in a tough position - starting from scratch. You’re looking at steep learning curve, particularly as you are not familar with WinDbg. As far as WinDbg goes, this is a very common question - how to use it - but there are no tutorials of which I know, and you’re just going to have to dive in to the documentation and spend some time with it; until you have some more specific questions, there really is no other way, much as it may suck at the moment. Actually, I take back what I just wrote - I believe that there is a WinDbg series actually on codeproject; I have never read it, so I can’t comment on its quality. Still, in the end, you’re just going to have to spend some serious time with it.

Finally, I’m not knocking the article, as I haven’t read it, but it sounds like it does not use the normal WDK build system. If it does not, and really either way, in my opinion, you don’t want to use it as the basis for your first driver; use mirror. While it is probably more complicated, it is “official,” which means that some people on this list will be able to help you, whereas with this one, it’s possible no one is familiar with it. This is important, because, in my opinion, you can count the number of people who comment of video threads on this list easily with one hand. If you were to use mirror, there is at least one person, not I, who I know will be able to tell you all about it, as long as you promise to remember that CLIPOBJ can be NULL.

Please keep in mind that everything in here, other than the recommendation to use mirror, is an amateur opinion.

Good luck,

mm

> the good news is that I believe that while Vista does have a totally different video driver model,

it still supports the Windows 2000 model, so you should be OK here.

OK, so long as you’ve not loaded a WDDM graphics driver and you’re not expecting the Aero Glass theme. WDDM doesn’t allow other extend graphics drivers to load. Using a mirror driver is allowed, but it knocks you back to Basic Mode while it’s loaded.

Definitely go with a mirror driver first as it doesn’t need to be too complicated before you start getting pixels.

Good luck!

Tim Green
DisplayLink.

Thanks for the input so far. The actual purpose of getting this particular driver to work is to do something like maxivista , except with VNC. And as I don’t have Vista installed (I plan to wait for SP1), I’m actually developing still for XP at the moment. I know “maxivista” idea works with the “fake graphics adapter” and VNC, because I’ve tried it with realVNC/UltraVNC and it does “sorta” work. However, the sample driver that comes with the codeproject source code has a similar minimal implementation very similar to the mirror driver, and only supports one resolution (800x600).

I guess I’ll go back to reading through the mirror driver code and figure out how it differs from the codeproject source code and implement the remaining portions. I guess I still am curious about how kernel-mode debugging works with windbg as I’ve read somewhere that remote debugging is also possible.

As a part of my previous project, we had developed a display driver from the
sample that you are mentioning. I remember facing the same error in the
initial phases, and if i remember right it was some issue with the inf file
and had nothing to do with the driver. Will try to dig out more if I can and
let you know later.

Thanks,
Anees

On 9/10/07, xxxxx@unoc.net wrote:
>
> Thanks for the input so far. The actual purpose of getting this particular
> driver to work is to do something like maxivista , except with VNC. And as I
> don’t have Vista installed (I plan to wait for SP1), I’m actually developing
> still for XP at the moment. I know “maxivista” idea works with the “fake
> graphics adapter” and VNC, because I’ve tried it with realVNC/UltraVNC and
> it does “sorta” work. However, the sample driver that comes with the
> codeproject source code has a similar minimal implementation very similar to
> the mirror driver, and only supports one resolution (800x600).
>
> I guess I’ll go back to reading through the mirror driver code and figure
> out how it differs from the codeproject source code and implement the
> remaining portions. I guess I still am curious about how kernel-mode
> debugging works with windbg as I’ve read somewhere that remote debugging is
> also possible.
>
> —
> 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
>