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

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging

The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.

Check out The OSR Learning Library at:

Waiting a precise amount of time in a video miniport

DoaJC_BloggerDoaJC_Blogger Member Posts: 11

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,403

    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: 11

    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,403

    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: 11

    "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,403

    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
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA