VirtualBox

Changeset 105527 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jul 26, 2024 5:13:32 PM (4 months ago)
Author:
vboxsync
Message:

GA/Windows: Send VBOXESC_RECONNECT_TARGETS from VboxService to VBoxWddm upon request from a host. bugref:10714

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceDisplayConfig.cpp

    r105495 r105527  
    7373}
    7474
    75 void ReplugDisplays(uint32_t cDisplays, VMMDevDisplayDef *paDisplays)
    76 {
    77     RT_NOREF2(cDisplays, paDisplays);
     75void ReconnectDisplays(uint32_t cDisplays, VMMDevDisplayDef *paDisplays)
     76{
    7877    D3DKMT_HANDLE hAdapter;
    7978    D3DKMT_ENUMADAPTERS EnumAdapters = {0};
    8079    NTSTATUS rcNt;
    81     ULONG id = 0;
     80    uint32_t u32Mask = 0;
     81
     82    for(uint32_t i = 0; i < cDisplays; i++)
     83    {
     84        u32Mask |= (paDisplays[i].fDisplayFlags & VMMDEV_DISPLAY_DISABLED) ? 0 : RT_BIT(i);
     85    }
     86
     87    VGSvcVerbose(2, "ReconnectDisplays u32Mask 0x%x\n", u32Mask);
    8288
    8389    EnumAdapters.NumAdapters = RT_ELEMENTS(EnumAdapters.Adapters);
     
    8692    VGSvcVerbose(2, "D3DKMTEnumAdapters  rcNt=%#x NumAdapters=%d\n", rcNt, EnumAdapters.NumAdapters);
    8793
    88     for(id = 0; id < EnumAdapters.NumAdapters; id++)
     94    for(ULONG id = 0; id < EnumAdapters.NumAdapters; id++)
    8995    {
    9096        D3DKMT_ADAPTERINFO *pAdapterInfo = &EnumAdapters.Adapters[id];
     
    104110    {
    105111        VBOXDISPIFESCAPE EscapeHdr = {0};
    106         EscapeHdr.escapeCode = VBOXESC_CONFIGURETARGETS;
    107         EscapeHdr.u32CmdSpecific = 0;
     112        EscapeHdr.escapeCode = VBOXESC_RECONNECT_TARGETS;
     113        EscapeHdr.u32CmdSpecific = u32Mask;
    108114
    109115        D3DKMT_ESCAPE EscapeData = {0};
     
    162168            if (cDisplays > 0)
    163169            {
    164                 ReplugDisplays(cDisplays, &aDisplays[0]);
    165                 VGSvcVerbose(2, "Display[0] (%dx%d)\n", aDisplays[0].cx, aDisplays[0].cy);
     170                for(uint32_t i = 0; i < cDisplays; i++)
     171                {
     172                    VGSvcVerbose(2, "Display[%i] flags=%#x (%dx%d)\n", i,
     173                        aDisplays[i].fDisplayFlags,
     174                        aDisplays[i].cx, aDisplays[i].cy);
     175                }
     176
     177                ReconnectDisplays(cDisplays, &aDisplays[0]);
    166178            }
    167179        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette