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

Home NTDEV
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: https://www.osr.com/osr-learning-library/


How to realize hot-plug function of Virtual Display with indirect display?

wentao786wentao786 Member Posts: 3

on basis of this sample github.com/kfroe/IndirectDisplay i have realized virtual monitor in win10, But i want to realize the hot-plug function that using DeviceIoControl from application to open/close virtual monitor,what would i do?

Comments

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,516
    If you want the display to come and go dynamically, a root device is not going to help you. You need a root enumerated bus driver which will then enumerate a child display device(s). Statbus and dynambus in the wdk toaster sample both show how to implement a root enumerated bus driver and you can probably reuse 95% of the code there. You will need to change the hardware id of the virtual display device in the virtual display inf too

    d
    d
  • wentao786wentao786 Member Posts: 3

    Hi ,
    thanks for your reply,the indirect display sample in github what noticed above is based on wdf framework,now ,in oder to implement communication from application to driver, i use WdfDeviceCreateDeviceInterface function to generate the guid that application can find and CreateFile with it ,but it does not work when driver init IDD_CX_CLIENT_CONFIG struct. it return fail. so, it seam to should not handle DeviceIoControl message via standard driver device, it seam to use idd device,because i find the attribute of EvtIddCxDeviceIoControl In IDD_CX_CLIENT_CONFIG struct ,what does the mean of the attribute of EvtIddCxDeviceIoControl? How to establish communication between application and idd device?thank you.

  • wentao786wentao786 Member Posts: 3

    @JiaBang_Lin
    Hi JiaBang,
    some times ago,i ask you for some advice about LCI proxy driver in github, now,could you help me solve this problem, thank you .

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,578
    via Email
    wentao786 wrote:
    > it return fail.

    What fails?  Do you mean the CreateFile fails?  How did you get the file
    name to open?


    > In IDD_CX_CLIENT_CONFIG struct ,what does the mean of the attribute of EvtIddCxDeviceIoControl? How to establish communication between application and idd device?thank you.

    Ordinarily, the IddCx framework handles all of the ioctls internally. 
    The EvtIddCxDeviceIoControl callback lets you handle them instead.

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

  • xwh9315xwh9315 Member Posts: 3

    Hi,
    in Indirect display driver,after use WdfDeviceCreateDeviceInterface to create guid,you should use IddCxDeviceInitialize,IddDeviceIoControl is not the same as other wdf's DeviceIoControl function ,his first argument is WDFDEVICE Device,not WDFQUEUE,so you don't need to use WdfIoQueueCreate to create a queue to receive I/O queue message.After all of the above,you should create IOCTL code,this can establish communication between application and idd device.

  • Marcel_RuedingerMarcel_Ruedinger Member Posts: 147

    Doron's approach is correct and would work, but usually it is not necessary in a WDDM IddCx driver. Typically it is not the graphics adapter itself which needs to be hot-plugged. Typically it is the display monitor which is hot-plugged. The display monitor is a child device object of the WDDM IddCx Adapter device object. The IddCx framework itself (namely IndirectKmd.sys kernel mode filter driver) acts as a bus driver creating a child device object (PDO) for each hot-plugged display monitor. In a WDDM IddCx driver, a new display monitor child device object is created using IddCxMonitorCreate(...). After being created, it can be hot-plugged using IddCxMonitorArrival(...). Currently IddCx seems to support up to 16 hot-plugged display monitors. If more than 16 are needed, then Doron's approach could be used to support multiple IddCx Adapters.

    Marcel Ruedinger
    datronicsoft

  • xwh9315xwh9315 Member Posts: 3

    @Marcel_Ruedinger said:
    Doron's approach is correct and would work, but usually it is not necessary in a WDDM IddCx driver. Typically it is not the graphics adapter itself which needs to be hot-plugged. Typically it is the display monitor which is hot-plugged. The display monitor is a child device object of the WDDM IddCx Adapter device object. The IddCx framework itself (namely IndirectKmd.sys kernel mode filter driver) acts as a bus driver creating a child device object (PDO) for each hot-plugged display monitor. In a WDDM IddCx driver, a new display monitor child device object is created using IddCxMonitorCreate(...). After being created, it can be hot-plugged using IddCxMonitorArrival(...). Currently IddCx seems to support up to 16 hot-plugged display monitors. If more than 16 are needed, then Doron's approach could be used to support multiple IddCx Adapters.

    Marcel Ruedinger
    datronicsoft

    hi,can i ask you a question?I use Idd drvier to plugin a monitor,and it works in my physical machine,but i try it to my kvm virtual machine(i passthrough a NVIDIA adapter to it),the monitor can plugin to the win10 system,but the monitor's status is "display is not active",because of it, i can't extend the second montior.I don't know why Idd driver in virtual machine with NVIDIA adpater passthrough can't let NVIDIA adpater use the monitor....thanks

  • Marcel_RuedingerMarcel_Ruedinger Member Posts: 147
    edited February 28

    If you develop WDDM IddCx driver, then you should always compare your driver to the two WDDM IddCx drivers with the largest market share worldwide. Buy a DisplayLink USB Display and download spacedesk multi monitor virtual display software (our freeware).
    If these two products work and yours doesn't, then it is your driver's problem.
    If these two don't work, then it is most likely an IddCx problem.
    Hint: When testing Wddm IddCx drivers in virtual machines, then always also test with Microsoft Basic Display as main monitor.
    Marcel Ruedinger
    datronicsoft

  • xwh9315xwh9315 Member Posts: 3

    @Marcel_Ruedinger said:
    If you develop WDDM IddCx driver, then you should always compare your driver to the two WDDM IddCx drivers with the largest market share worldwide. Buy a DisplayLink USB Display and download spacedesk multi monitor virtual display software (our freeware).
    If these two products work and yours doesn't, then it is your driver's problem.
    If these two don't work, then it is most likely an IddCx problem.
    Hint: When testing Wddm IddCx drivers in virtual machines, then always also test with Microsoft Basic Display as main monitor.
    Marcel Ruedinger
    datronicsoft

    Hi,first of all, thank you for giving me these suggestions,i had tried my IddCx driver in vmvare and kvm machine,when i use Microsoft Basic Display as main monitor,iddCx driver can works now, but i still have some other questions about Iddcx driver,i just started learning the driver for about half a year,may I ask you some related questions?Thank you!

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