Giter VIP home page Giter VIP logo

rustdeskidddriver's Introduction

The sample based on Indirect Display Driver Sample.

This project gives the following abilities:

  1. Plugin and plugout monitors.
  2. Update monitor modes.

See IOCTL_CHANGER_IDD_PLUG_IN IOCTL_CHANGER_IDD_PLUG_OUT IOCTL_CHANGER_IDD_UPDATE_MONITOR_MODE.

See RustDeskIddApp for examples.

The test application to create device, install idd, and plugin monitors.

TODOs

  1. Get the status code from driver when calling DeviceIoControl.

topic: sample page_type: sample languages:

  • cpp products:
  • windows
  • windows-wdk name: 'IddSample' description: "Implements a sample IddCx 1.4 driver and a sample application that instantiates a software device using it." statusNotificationTargets:
  • [email protected]

Indirect Display Driver Sample

This is a sample driver that shows how to create a Windows Indirect Display Driver using IddCx (Indirect Display Driver Class eXtension).

Background reading

Start at the Indirect Display Driver Model Overview on MSDN.

Customizing the sample

The sample driver code is very simplistic and does nothing more than enumerate a single monitor when its device enters the D0/started power state. Throughout the code, there are TODO blocks with important information on implementing functionality in a production driver.

Code structure

  • Direct3DDevice class
    • Contains logic for enumerating the correct render GPU from DXGI and creating a D3D device.
    • Manages the lifetime of a DXGI factory and a D3D device created for the render GPU the system is using to render frames for your indirect display device's swap-chain.
  • SwapChainProcessor class
    • Processes frames for a swap-chain assigned to the monitor object on a dedicated thread.
    • The sample code does nothing with the frames, but demonstrates a correct processing loop with error handling and notifying the OS of frame completion.
  • IndirectDeviceContext class
    • Processes device callbacks from IddCx.
    • Manages the creation and arrival of the sample monitor.
    • Handles swap-chain arrival and departure by creating a Direct3DDevice and handing it off to a SwapChainProcessor.

First steps

Consider the capabilities of your device. If the device supports multiple monitors being hotplugged and removed at runtime, you may want to abstract the monitors further from the IndirectDeviceContext class.

The INF file included in the sample needs updating for production use. One field, DeviceGroupId, controls how the UMDF driver gets pooled with other UMDF drivers in the same process. Since indirect display drivers tend to be more complicated than other driver classes, it's highly recommended that you pick a unique string for this field which will cause instances of your device driver to pool in a dedicated process. This will improve system reliability in case your driver encounters a problem since other drivers will not be affected.

Ensure the device information reported to IddCxAdapterInitAsync is accurate. This information determines how the device is reported to the OS and what static features (like support for gamma tables) the device will have available. If some information cannot be known immediately in the EvtDeviceD0Entry callback, IddCx allows the driver to call IddCxAdapterInitAsync at any point after D0 entry, before D0 exit.

Careful attention should be paid to the frame processing loop. This will directly impact the performance of the user's system, so making use of the Multimedia Class Scheduler Service and DXGI's support for GPU prioritization should be considered. Any significant work should be performed outside the main processing loop, such as by queuing work in a thread pool. See SwapChainProcessor::RunCore for more information.

rustdeskidddriver's People

Contributors

fufesou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rustdeskidddriver's Issues

Can we expand this to add more than 3 monitors ?

I wanted to try and see how many virtual monitors can be added to a system to test an application i have which requires large number of monitors.
I cannot test with physical monitors so virtual monitors is next best thing for me.
I already test with 3 monitors using this driver and app. it worked great.

有持久化的创建显示适配器方法吗?

您好:
我发现SwDeviceCreate方法只能在应用的生命周期有效,程序必须一直运行状态,但是我希望创建显示适配器,或者adapter后能一直处于plugin的状态,这个有其他api实现吗?因为我不是一个驱动开发人员,最近在了解虚拟显示器,基于阅读的官方和非官方资料,我的理解是,可以先创建一个适配器,然后基于这个适配器再添加显示器(监视器),现在就是希望找到一种持久化的方法创建一个适配器,类似手动添加过时硬件的方式,加载驱动,因为微软官方的例子里面就是加载驱动后就会同时创建一个显示适配器和一个显示器
如果您有什么好的建议,希望能回复下

When following the README.md and attempting to install the driver it fails with last error 0xe000020b

when running RustDeskIddApp.exe and attemping to install with "i" it fails.

RustDeskIdd: UpdateDriverForPlugAndPlayDevices failed, last error 0xe000020b

I was able to install the driver by first creating device with "c" followed by "i".

The README.md located in the RustDeskIddDriver_x64.zip does not state to create the device first before installilng.

Steps

  1. Double click "RustDeskIddDriver.cer" to install cert.
  2. Run "RustDeskIddApp.exe" as administrator.
    Press "c" to create device. If you get 0xe0000247 error code. You should follow step 3. # should be added
    Press "i" to install. If you get 0xe0000247 error code. You should follow step 3.
  3. Disable Driver Signature Verification.

This was on a Windows 11 Home version 22H2

There is a problem updating the monitor mode

When entering a, except for the first increased display resolution, the other display resolutions are not changed, and all resolutions are the default resolution at the time of creation

SwDeviceCreate returns 0x800700b7 when open an existed device

MSDN: When a client app calls SwDeviceCreate for a software device that was previously marked for SwDeviceLifetimeParentPresent, SwDeviceCreate succeeds if there are no open software device handles for the device (only one handle can be open for a device). A client app can then regain control over a persistent software device for the purposes of updating properties and interfaces or changing the lifetime.

But after I set idd software device to SwDeviceLifetimeParentPresent, and then call SwDeviceCreate again with same createInfo, it returns 0x800700b7, which means object already exist. This result is not what MSDN said.

Even I can't remove the persist software device manually, it's always enumerated again after removed from device manager.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.