Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available

Download PDF here:

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Waiting a precise amount of time in a video miniport

DoaJC_BloggerDoaJC_Blogger Member Posts: 8

I'm trying to write a Windows driver for the Intel UHD Graphics 605 and there are some parts of initialization that require the driver to wait a certain length of time. My first thought was to use KeQueryTickCount() and KeQueryTimeIncrement() but my code refused to compile. I tried including the header and library files necessary but it still wouldn't compile. Further research showed this in the WDK documentation: "A miniport driver can only make calls exported by videoprt.sys" It looks like the closest function exported by videoprt.sys is VideoPortStallExecution(), but if at all possible I would prefer not to keep control of the CPU while I'm waiting.

There is also a statement on that says, "All kernel-mode drivers except video and SCSI miniport drivers and NDIS drivers are likely to call at least some KeXxx routines", so I can't call anything beginning with "Ke" in a video miniport.

Just so you know that I've "done my homework" as requested by the community guidelines, I went through the i915 Linux code and official Intel PDF's to figure out how the hardware works and then looked through the WDK documentation, MSDN, and sources for the the ET6000 and a couple of virtual video devices. Can someone recommend a good way to wait up to 2 milliseconds in a video miniport? Thank you in advance.


  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,131

    You can use VideoPortWaitForSingleObject with a timeout. If it is only during initialization, there's nothing wrong with using VideoPortStallExecution for 2ms.

    But what is really going on here? Intel already has WDDM drivers for the 605. Why are you trying to write an XPDM driver? What operating systems do you need to support?

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • DoaJC_BloggerDoaJC_Blogger Member Posts: 8

    Thank you for the tips. For VideoPortWaitForSingleObject, is it okay to use NULL for the Object argument?

    I want these graphics to work on 64-bit Windows XP and Windows 7. Someone said there should be an old driver for Windows 7 but I'm having trouble finding one for anything less than Windows 10.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,131

    No, you'll need to create a dummy object with VideoPortCreateEvent.

    It's an enormous task to create a display driver and miniport from scratch, especially if you weren't part of the design team and thus don't have full specs and access to engineering support. Doesn't the generic VGA driver work for this? You wouldn't get acceleration, but you're never going to use XP64 for gaming anyway.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • DoaJC_BloggerDoaJC_Blogger Member Posts: 8

    "Doesn't the generic VGA driver work for this?" Windows 8.1 seemed to have limited support, so I assume XP64 would at least have basic support as well. I was hoping to do better by writing a driver that supports acceleration.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,131

    I'm sure you could do better, but it's not clear to me that it will be worth the enormous effort.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE