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

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

WDDM Display Only Driver to create a Virtual Display/Monitor

muniateguimuniategui Member Posts: 12
edited May 2019 in NTDEV

I am a student who just started in Windows Driver Development. The project I am trying to do is to create a Virtual Monitor and capturing its framebuffer.

The examples that Microsoft have about Display Drivers is a KMDOD and i don't know if i will be capable of archiving my goal using this type of driver.

Another doubt i have is that if KMDOD can use a real GPU to render the windows on the display. In WDDM 1.2 features documentation it says that "Windows handles the 2-D or 3-D rendering by using software-simulated GPU." but on MS forums "Even WDDM Display-Only-Drivers (which do not have a WDDM User Mode Driver) need actual graphics adapter hardware." so i do not know if the rendering would be done by HW GPU or SF GPU.

Comments

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,310

    You would be much better off targeting Win7 (or XP) and starting with the sample XPDM mirror driver. A WDDM mirror is way outside the scope of a student project.

  • muniateguimuniategui Member Posts: 12
    edited May 2019

    But is the XPDM model compatible on windowws 8.1 and above? I tougth it was not.
    Also the extrictly the feature i need is not mirror one but to create an independent virtual display i don't know if that can be achieved with mirror driver.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,198

    No, it's not. Mark's point (and he is entirely correct) is that a WDDM driver is a very complicated beast, and is clearly not a good place for a beginner to start. If you are creating your own project, you should make another choice. The USB world is a much better place to learn about driver development. There are hundreds and hundreds of little USB experimenter's boards where you can control both the firmware on the device and the driver on the host.

    What's the point of a virtual monitor that's not a mirror? If the user can't see the results, he's never going to drag any windows to it, and he won't be able to interact with the windows to click any buttons.

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

  • muniateguimuniategui Member Posts: 12

    The procjet has to be a display driver is not an option to change the driver type since what is wanted to archive with the driver is to capture the framebuffer to send it over the network. As KMDOD semed the easier option is what i've choose but still has the doubts about virtualized GPU

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,198

    You are aware, I hope, that there are dozens of products out there that do this, including several that are open source. Many of them do it with no kernel drivers at all. Have you looked at any of the VNC products?

    And if you want to capture a framebuffer, why would you not want to capture the live desktop? What is the point of capturing an invisible screen? I just don't think you have thought through this effort at all.

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

  • muniateguimuniategui Member Posts: 12
    edited May 2019

    In the scenario where it will work hooking functions is not an option since there are some incompativilities with that method. Aslo the monitors are needed to switch them between primary monitor when aplications are lanched to have one aplication in their own display to avoid superposition between them.

  • muniateguimuniategui Member Posts: 12

    Okay i've followed your recommendation and choosed to change to XPDM, apart from VirtualMonitor project source code where can i find more examples to create a virtual monitor? thanks!

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,198

    Your whole concept seems very strange to me. How is the user going to move an application to a monitor that he cannot see? How will he ever know that it is where it belongs? I just don't think you have worked through the user stories here. If you want to have a single application send its window over the network to another computer for remote display, there are traditional ways of doing that which are MUCH less trouble than writing a display driver.

    The Windows 7 (7600) DDK includes an XPDM mirror driver sample. That is probably your best starting point. Remember that the ONLY difference between a normal display driver and a mirror driver is the way it is configured. You would just change the user-mode app in that sample to configure the driver as an "extend the desktop" monitor instead of a mirror monitor.

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

  • Marcel_RuedingerMarcel_Ruedinger Member Posts: 135

    The long story can be cut very short:
    Creating virtual display monitors was never supported by recent Windows versions(since Windows 7). End of story.

    Two types of WDDM display drivers can reasonably be written by regular driver developers:
    WDDM DOD Display Only Drivers (e.g. KMDOD).
    WDDM IddCx Indirect Display Drivers.
    The downside of both: Currently they both need real hardware.
    The downside of Display Only Drivers: No GPU acceleration.

    For those who want to go beyond the regular and documented scope of Windows operating system support and really write a contemporary virtual display driver: Write a USB bus driver which emulates a USB bus with connected display device (e.g. DisplayLink USB display). Then install this WDDM IddCx Indirect Display sample on the virtual USB driver's emulated display device: https://github.com/kfroe/IndirectDisplay
    Voila - there is your virtual display!

    Hint: I heard that the above named IddCx sample can supposedly even be operated without hardware when starting Windows with "Driver Signature Enforcement" disabled (F7).

    Marcel Ruedinger
    datronicsoft

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,198

    As a note to the original poster, Mr. Ruedinger knows what he is talking about.

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

  • philippemnoelphilippemnoel Member Posts: 1

    Hello @Tim_Roberts @Marcel_Ruedinger,

    I'm a student working on a project to capture the desktop of an Azure Windows 10 virtual machine using Microsoft Desktop Duplication API. Unfortunately, since there is no monitor, the second I exit the RDP session the API stops working. It appears I need a "virtual display adapter" to "fake" having a monitor so that the Desktop Duplication API can work. This sample you @Marcel_Ruedinger have linked appears to be the best thing I've found in a week of searching to fix this issue, do you happen to know if it can fix my problem? Is there anything else I should be aware of/look at to fix this problem?

    As a summary: I'm looking to capture the desktop of a Windows 10 headless VM, and it appears I need a "virtual display adapter" to trick the GPU into actually rendering the desktop since there is no monitor.

    Thanks for your help, I really appreciate it!

    Philippe

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,570

    @philippemnoel In your studies, have you learned what necroposting is? Cuz, you know, we discourage it here. As you know, because you've done this:

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,198

    Once you end the RDP session, there is no desktop. What, exactly, do you plan to capture? Without RDP, what applications are going to be running? Where will they get their input? I don't think you've thought this through.

    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