WDDM support for VirtualMoniton - VirtualMonitor/VirtualMonitor GitHub Wiki
# Child Enumeration Process (Source WinDDK) and our hacks to dupe the dxgkrnl into believing that that it has mulitple monitors (output targets) connected to it.
The following sequence of steps describes how the display port driver, display miniport driver, and video present network (VidPN) manager collaborate at initialization time to enumerate child devices of a display adapter.
- The display port driver calls the display miniport driver's DxgkDdiStartDevice function. DxgkDdiStartDevice returns (in the NumberOfChildren parameter) the number of devices that are (or could become by docking) children of the display adapter. DxgkDdiStartDevice also returns (in the NumberOfVideoPresentSources parameter) the number N of video present sources supported by the display adapter. Those video present sources will subsequently be identified by the numbers 0, 1, ... N -1. . Here in our display miniport driver we manipulate the NumberOfChilder as NumberOfChilder+1 and report to Dxgkrnl.
- The display port driver calls the display miniport driver's DxgkDdiQueryChildRelations function, which enumerates child devices of the display adapter. DxgkDdiQueryChildRelations fills in an array of DXGK_CHILD_DESCRIPTOR structures: one for each child device. Note that all child devices of the display adapter are on-board: monitors and other external devices that connect to the display adapter are not considered child devices. Here our display miniport driver returns the new created virtual monitor's child UDID and ACPIUID.
- For each child device (enumerated as described in Step 1) that has an HPD awareness value of HpdAwarenessInterruptible or HpdAwarenessPolled, the display port driver calls the display miniport driver's DxgkDdiQueryChildStatus function to determine whether the child device has an external device connected to it. In our display miniport driver, we return TRUE for the newly added virtual monitor so as to give the impression that its connected.
- The display port driver creates a PDO for each child device that satisfies one of the following conditions: --> The child device has an HPD awareness value of HpdAwarenessAlwaysConnected. -->The child device has an HPD awareness value of HpdAwarenessPolled or HpdAwarenessInterruptible, and the operating system knows from a previous query or notification that the child device has an external device connected.
- The display port driver calls the display miniport driver's DxgkDdiQueryDeviceDescriptor function for each child device that satisfies one of the following conditions: -->The child device is known to have an external device connected. -->The child device is assumed to have an external device connected. --> The child device has a type of TypeOther.
- The VidPN manager obtains identifiers for all of the video present sources and video present targets supported by the display adapter. The video present sources are identified by the numbers 0, 1, ... N - 1, where N is the number of sources returned by the display miniport driver's DxgkDdiStartDevice function. The video present targets have unique integer identifiers that were previously created by the display miniport driver during DxgkDdiQueryChildRelations. Each child device of type TypeVideoOutput is associated with a video present target, and the ChildUid member of the child device's DXGK_CHILD_DESCRIPTOR structure is used as the identifier for the video present target.