VirtualBox

儲存庫 vbox 的更動 35279


忽略:
時間撮記:
2010-12-21 下午04:44:39 (14 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
69128
訊息:

ExtPack: Send the HWND down to the helper app so we can later make the UAC dialog go to the foreground. This is currently not possible because the main GUI thread is in an API call and does not respond to messages sent by ShellExecuteEx, thus creating a deadlock.

位置:
trunk/src/VBox
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp

    r35273 r35279  
    178178     */
    179179    QString displayInfo;
     180#ifdef RT_OS_WINDOWS
     181    if (pParent)
     182        displayInfo.sprintf("hwnd=%#llx", (uint64_t)(uintptr_t)pParent->winId());
     183#endif
    180184    CProgress progress = extPackFile.Install(fReplaceIt, displayInfo);
    181185    if (extPackFile.isOk())
     
    395399            /** @todo Refuse this if any VMs are running. */
    396400            QString displayInfo;
     401#ifdef RT_OS_WINDOWS
     402            displayInfo.sprintf("hwnd=%#llx", (uint64_t)(uintptr_t)this->winId());
     403#endif
    397404            CProgress progress = manager.Uninstall(strSelectedPackageName, false /* forced removal? */, displayInfo);
    398405            if (manager.isOk())
  • trunk/src/VBox/Main/VBoxExtPackHelperApp.cpp

    r35273 r35279  
    9292/** @}  */
    9393
     94
     95/*******************************************************************************
     96*   Global Variables                                                           *
     97*******************************************************************************/
     98#ifdef RT_OS_WINDOWS
     99static HINSTANCE g_hInstance;
     100#endif
    94101
    95102#ifdef IN_RT_R3
     
    11591166 * @param   iCmd                The command that is being executed. (For
    11601167 *                              selecting messages.)
     1168 * @param   pszDisplayInfoHack  Display information hack.  Platform specific++.
    11611169 */
    11621170static RTEXITCODE RelaunchElevatedNative(const char *pszExecPath, const char **papszArgs, int cSuArgs, int cMyArgs,
    1163                                          int iCmd)
     1171                                         int iCmd, const char *pszDisplayInfoHack)
    11641172{
    11651173    RTEXITCODE rcExit = RTEXITCODE_FAILURE;
     
    11671175    NOREF(iCmd);
    11681176
     1177    MSG Msg;
     1178    PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE);
    11691179    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
    11701180
     
    11921202                Info.hkeyClass   = NULL;
    11931203                Info.dwHotKey    = 0;
    1194                 Info.hIcon       = INVALID_HANDLE_VALUE;
     1204                Info.hMonitor    = NULL;
    11951205                Info.hProcess    = INVALID_HANDLE_VALUE;
     1206
     1207#if 0 /* This deadlocks with the GUI because the GUI thread is stuck in the API call :/ */
     1208                /* Apply display hacks. */
     1209                if (pszDisplayInfoHack)
     1210                {
     1211                    const char *pszArg = strstr(pszDisplayInfoHack, "hwnd=");
     1212                    if (pszArg)
     1213                    {
     1214                        uint64_t u64Hwnd;
     1215                        rc = RTStrToUInt64Ex(pszArg + sizeof("hwnd=") - 1, NULL, 0, &u64Hwnd);
     1216                        if (RT_SUCCESS(rc))
     1217                        {
     1218                            HWND hwnd = (HWND)(uintptr_t)u64Hwnd;
     1219                            Info.hwnd = hwnd;
     1220                            Info.hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);
     1221                        }
     1222                    }
     1223                }
     1224                if (Info.hMonitor == NULL)
     1225                {
     1226                    POINT Pt = {0,0};
     1227                    Info.hMonitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
     1228                }
     1229                if (Info.hMonitor != NULL)
     1230                    Info.fMask |= SEE_MASK_HMONITOR;
     1231 #endif
    11961232
    11971233                if (ShellExecuteExW(&Info))
     
    15301566                     * Do the platform specific process execution (waiting included).
    15311567                     */
    1532                     rcExit = RelaunchElevatedNative(szExecPath, papszArgs, cSuArgs, cArgs, iCmd);
     1568                    rcExit = RelaunchElevatedNative(szExecPath, papszArgs, cSuArgs, cArgs, iCmd, pszDisplayInfoHack);
    15331569
    15341570                    /*
     
    18191855extern "C" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
    18201856{
    1821     NOREF(hPrevInstance); NOREF(nShowCmd); NOREF(lpCmdLine); NOREF(hInstance);
     1857    g_hInstance = hInstance;
     1858    NOREF(hPrevInstance); NOREF(nShowCmd); NOREF(lpCmdLine);
    18221859    return main(__argc, __argv);
    18231860}
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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