WDM: no display driver calls the HwVidStartIo of my miniport driver

I am writing a graphic miniport driver for Windows NT 4.0 - 5.1. I am stuck in the situation, that HwVidStartIo of my miniport driver never gets called.


I would expect that a display driver triggers the function calls by sending requests to videoprt.sys and then videoprt.sys calls my HwVidStartIo. But somehow no display driver cares about my miniport driver.


Do I need to announce or register my miniport driver to a display driver somehow?


When the system boots the flow is like this:

  1. DriverEntry gets called
  2. HwVidFindAdapter gets called
  3. HwVidFindAdapter returns NO_ERROR/0x00
  4. HwVidFindAdapter gets called
  5. HwVidFindAdapter returns ERROR_INVALID_PARAMETER/0x57
  6. HwVidFindAdapter gets called
  7. HwVidFindAdapter returns ERROR_INVALID_PARAMETER/0x57
  8. HwVidFindAdapter gets called
  9. HwVidFindAdapter returns NO_ERROR/0x00
  10. DriverEntry returns 0x00 (return value of VideoPortInitialize)
  11. HwVidInitialize gets called
  12. HwVidInitialize returns true/0x01
  13. HwVidInitialize gets called
  14. HwVidInitialize returns true/0x01


    Also, when I start the display program from the control panel, I get the following message:
The currently selected graphics driver cannot be used. It was written for a previous version of Windows, and is no longer compatible with this version of Windows.

The system has been started using the default VGA driver.

...
http://ontheserver.de/temp/2021-12-27/Fehlermeldung.png ![Image](http://ontheserver.de/temp/2021-12-27/Fehlermeldung.png "http://ontheserver.de/temp/2021-12-27/Fehlermeldung.png")
This is really frustrating. I have no idea what Windows wants from me. Does someone know what I could do to figure out?

Thank you.

I’ve forgotten the details now, and I am trying to find them, but yes, you have to do a registry tweak to tell the system which display drivers your miniport is compatible with. What operating system are you testing? That error message implies that you are trying to use an NT 3.51 (that is, “user mode”) display driver with an NT 4.0 system that uses “kernel mode” display drivers.

1 Like

Thank you for your reply, Tim Roberts.


I was using NT 5.0 (Windows 2000) for my tests.


The only thing my driver does in this area is to announce that it is VGA compatible. Here is the relevant part of the install section of my .inf-file:

[Treiberinstallation.SoftwareSettings]
AddReg = Treiberkonfiguration.Registrierung

[Treiberkonfiguration.Registrierung]
HKR, , VgaCompatible, 0x10001, 0x1

And here is the rest of my .inf-file if it is somehow relevant: http://ontheserver.de/temp/2021-12-27/graphic.inf
I also figured out, that the error message seems to originate from themeui.dll. It contains strings as resources with the following:
MSG_INVALID_OLD_DISPLAY_DRIVER = "The currently selected graphics display driver can not be used. It was written for a previous version of Windows, and is no longer compatible with this version of Windows.\n\nThe system has been started using the default VGA driver.\n\nPlease contact your hardware manufacturer to get an upgraded driver, or select one of the Microsoft provided drivers."

Your INF file is not enough. Remember, the miniport doesn’t do any of the drawing. It just sets up the video modes. The drawing is all done in the display driver, which gets installed with an INI file. I still haven’t been able to find the old references for how to hook up the two.

Seems as my last message got caught by the spam filter and the admin doesn’t manually review the potential spam.

Anyway … I tried to add

HKR, , InstalledDisplayDrivers, 0x10000, vga, vga256, vga64k
to my .inf-file to tell the system to use the vga-display driver. But after rebooting the system always starts with a blue screen saying that the function KeQuerySystemTime of ntoskrnl.exe tried to write at 0xFF FF FF FC because the function was called with the value 0xFF FF FF F8 for the input parameter CurrentTime. My driver does not use this function and my HwVidStartIo still doesn't get called.

Oh man, it’s been more than a week now that I am trying to figure out how to get Windows calling HwVidStartIo but still no success.

Seems as my last message got caught by the spam filter and the admin doesn’t manually review the potential spam.

We do manually review the list. When you notice a post goes missing and ask us to do so. Like it says in the sticky post at the top of this forum, right?

Please follow the rules, and avoid complaining about what happens when you don’t. Please.

Peter

I read that sticky post and followed the rules by not reporting it.

If this happens to you, there are two things you can do:

1. Chill for a bit and wait for a mod/admin to notice. If it's not spam, we'll mark it as such. If you've been around awhile and/or your post is clearly technical and not lame, we'll mark your account as being known good, so you will never get caught in the spam filters again.
So my understanding was, that 2. (reporting) was not necessary.

Well, given that you didn’t “wait for an admin to notice” long enough (which over the holidays could be, admittedly, many weeks) your only other option was #2 “Post a plea in the A&A” section.

Because, you’ll notice the very next paragraph that says ”What I’d appreciate is you not posting the same query again. This just makes more work for the mods (we have to merge the replies, delete one of the posts, etc.).” Which is what you did. Along with a complaint.

Look, I get that you’re frustrated and would dearly like an answer to your problem. And, believe me, if I knew the answer I’d tell you. Now, behave and don’t be naughty going forward.

Peter

If Windows tells us that our display driver does not match the operating system, then we write a display driver that does match. We use the correct tool chain corresponding to the operating system: NT 4.0 or W2K DDK (Device Driver Kit). When using this old DDK version, then we will find a very nice and simple working virtual display driver sample (miniport.sys/display.dll pair). This source code sample can easily be compiled, installed, run, debugged and morphed into a customer specific VGA compatible NT 4.0 or W2K display driver.

PS: Why does the title inlude “WDM”? The term “WDM” is not related to the topic in any way. The current WDK uses the terms “XDDM” and “XPDM” for legacy display drivers. Actually this legacy display driver model existed long before WDM was introduced.

Marcel Rüdinger
datronicsoft

Thank you for your reply, Marcel Rüdiger.

The error message is incorrect and the error is not in the display driver. There was an error in the .inf-file of my miniport driver. I fixed it already and now it works fine.

When I saw that the admin of this forum adding a senseless provocation to every post, trying to escalate a discussion about who broke which rule I decided to move to a different forum and not further post any update about this issue here.

So this issue is solved and can be closed.

And that’s the last we will be hearing from Mr Ultrasick.

Peter