儲存庫 vbox 的更動 63099
- 時間撮記:
- 2016-8-6 下午03:38:51 (8 年 以前)
- 位置:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r62522 r63099 24 24 #include <malloc.h> 25 25 26 /********************************************************************************************************************************* 27 * Defined Constants And Macros * 28 *********************************************************************************************************************************/ 26 29 #ifdef DEBUG_misha 27 # define WARN(_m) do { \30 # define WARN(_m) do { \ 28 31 Assert(0); \ 29 32 Log(_m); \ 30 33 } while (0) 31 # define WARN_FUNC(_m) do { \34 # define WARN_FUNC(_m) do { \ 32 35 Assert(0); \ 33 36 LogFunc(_m); \ 34 37 } while (0) 35 38 #else 36 # define WARN(_m) do { \39 # define WARN(_m) do { \ 37 40 Log(_m); \ 38 41 } while (0) 39 # define WARN_FUNC(_m) do { \42 # define WARN_FUNC(_m) do { \ 40 43 LogFunc(_m); \ 41 44 } while (0) … … 52 55 #endif 53 56 57 58 /********************************************************************************************************************************* 59 * Structures and Typedefs * 60 *********************************************************************************************************************************/ 54 61 typedef struct VBOXDISPIF_OP 55 62 { … … 59 66 VBOXDISPKMT_CONTEXT Context; 60 67 } VBOXDISPIF_OP; 61 62 static DWORD vboxDispIfWddmResizeDisplay(PCVBOXDISPIF const pIf, UINT Id, BOOL fEnable, DISPLAY_DEVICE * paDisplayDevices, DEVMODE *paDeviceMode, UINT devModes);63 static DWORD vboxDispIfResizePerform(PCVBOXDISPIF const pIf, UINT iChangedMode, BOOL fEnable, BOOL fExtDispSup, DISPLAY_DEVICE *paDisplayDevices, DEVMODE *paDeviceModes, UINT cDevModes);64 static DWORD vboxDispIfWddmEnableDisplaysTryingTopology(PCVBOXDISPIF const pIf, UINT cIds, UINT *pIds, BOOL fEnable);65 static DWORD vboxDispIfResizeStartedWDDMOp(VBOXDISPIF_OP *pOp);66 68 67 69 /* … … 89 91 } VBOXDISPIF_WDDM_DISPCFG; 90 92 93 94 /********************************************************************************************************************************* 95 * Internal Functions * 96 *********************************************************************************************************************************/ 97 static DWORD vboxDispIfWddmResizeDisplay(PCVBOXDISPIF const pIf, UINT Id, BOOL fEnable, DISPLAY_DEVICE * paDisplayDevices, 98 DEVMODE *paDeviceModes, UINT devModes); 99 static DWORD vboxDispIfResizePerform(PCVBOXDISPIF const pIf, UINT iChangedMode, BOOL fEnable, BOOL fExtDispSup, 100 DISPLAY_DEVICE *paDisplayDevices, DEVMODE *paDeviceModes, UINT cDevModes); 101 static DWORD vboxDispIfWddmEnableDisplaysTryingTopology(PCVBOXDISPIF const pIf, UINT cIds, UINT *pIds, BOOL fEnable); 102 static DWORD vboxDispIfResizeStartedWDDMOp(VBOXDISPIF_OP *pOp); 103 104 91 105 static DWORD vboxDispIfWddmDcCreate(VBOXDISPIF_WDDM_DISPCFG *pCfg, UINT32 fFlags) 92 106 { … … 217 231 } 218 232 233 #define VBOX_WDDM_DC_SEARCH_PATH_ANY (~(UINT)0) 219 234 static int vboxDispIfWddmDcSearchPath(VBOXDISPIF_WDDM_DISPCFG *pCfg, UINT srcId, UINT trgId) 220 235 { 221 236 for (UINT iter = 0; iter < pCfg->cPathInfoArray; ++iter) 222 237 { 223 if ( (srcId == ~0UL|| pCfg->pPathInfoArray[iter].sourceInfo.id == srcId)224 && (trgId == ~0UL|| pCfg->pPathInfoArray[iter].targetInfo.id == trgId))238 if ( (srcId == VBOX_WDDM_DC_SEARCH_PATH_ANY || pCfg->pPathInfoArray[iter].sourceInfo.id == srcId) 239 && (trgId == VBOX_WDDM_DC_SEARCH_PATH_ANY || pCfg->pPathInfoArray[iter].targetInfo.id == trgId)) 225 240 { 226 241 return (int)iter; … … 284 299 static DWORD vboxDispIfWddmDcSettingsUpdate(VBOXDISPIF_WDDM_DISPCFG *pCfg, int idx, DEVMODE *pDeviceMode, BOOL fInvalidateSrcMode, BOOL fEnable) 285 300 { 286 UINT Id = pCfg->pPathInfoArray[idx].sourceInfo.id;287 288 301 if (fInvalidateSrcMode) 289 302 pCfg->pPathInfoArray[idx].sourceInfo.modeInfoIdx = DISPLAYCONFIG_PATH_MODE_IDX_INVALID; … … 445 458 if (idx < 0) 446 459 { 447 idx = vboxDispIfWddmDcSearchPath(pCfg, -1, i);460 idx = vboxDispIfWddmDcSearchPath(pCfg, VBOX_WDDM_DC_SEARCH_PATH_ANY, i); 448 461 if (idx >= 0) 449 462 { … … 472 485 { 473 486 WARN(("VBoxTray:(WDDM) %d %d path not supported\n", i, i)); 474 idx = vboxDispIfWddmDcSearchPath(pCfg, -1, i);487 idx = vboxDispIfWddmDcSearchPath(pCfg, VBOX_WDDM_DC_SEARCH_PATH_ANY, i); 475 488 if (idx < 0) 476 489 { … … 605 618 static DWORD vboxDispIfEscapeXPDM(PCVBOXDISPIF pIf, PVBOXDISPIFESCAPE pEscape, int cbData, int iDirection) 606 619 { 620 RT_NOREF(pIf); 607 621 HDC hdc = GetDC(HWND_DESKTOP); 608 622 VOID *pvData = cbData ? VBOXDISPIFESCAPE_DATA(pEscape, VOID) : NULL; … … 615 629 if (iRet > 0) 616 630 return VINF_SUCCESS; 617 elseif (iRet == 0)631 if (iRet == 0) 618 632 return ERROR_NOT_SUPPORTED; 619 633 /* else */ … … 990 1004 if (!RegisterClassEx(&wc)) 991 1005 { 992 DWORD winErr = GetLastError(); 993 WARN_FUNC(("RegisterClass failed, winErr(%d)\n", winErr)); 1006 WARN_FUNC(("RegisterClass failed, winErr(%d)\n", GetLastError())); 994 1007 hr = E_FAIL; 995 1008 } … … 1014 1027 else 1015 1028 { 1016 DWORD winErr = GetLastError(); 1017 WARN_FUNC(("CreateWindowEx failed, winErr(%d)\n", winErr)); 1029 WARN_FUNC(("CreateWindowEx failed, winErr(%d)\n", GetLastError())); 1018 1030 hr = E_FAIL; 1019 1031 } … … 1044 1056 { 1045 1057 PVBOXRR pMon = &g_VBoxRr; 1046 HRESULT tmpHr= vboxRrWndDestroy(pMon->hWnd);1047 Assert( tmpHr == S_OK);1058 HRESULT hrTmp = vboxRrWndDestroy(pMon->hWnd); 1059 Assert(hrTmp == S_OK); NOREF(hrTmp); 1048 1060 1049 1061 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); … … 1078 1090 DWORD winErr = GetLastError(); 1079 1091 WARN_FUNC(("SetEvent failed, winErr = (%d)", winErr)); 1080 HRESULT tmpHr= HRESULT_FROM_WIN32(winErr);1081 Assert( tmpHr != S_OK);1092 HRESULT hrTmp = HRESULT_FROM_WIN32(winErr); 1093 Assert(hrTmp != S_OK); NOREF(hrTmp); 1082 1094 } 1083 1095 … … 1133 1145 static DWORD WINAPI vboxRrRunnerThread(void *pvUser) 1134 1146 { 1147 RT_NOREF(pvUser); 1135 1148 HRESULT hr = vboxRrWndInit(); 1136 1149 Assert(hr == S_OK); … … 1238 1251 static DWORD vboxDispIfWddmInit(PCVBOXDISPIF pIf) 1239 1252 { 1253 RT_NOREF(pIf); 1240 1254 HRESULT hr = VBoxRrInit(); 1241 1255 if (SUCCEEDED(hr)) 1242 {1243 1256 return ERROR_SUCCESS; 1244 }1245 1257 WARN(("VBoxTray: VBoxRrInit failed hr 0x%x\n", hr)); 1246 1258 return hr; … … 1249 1261 static void vboxDispIfWddmTerm(PCVBOXDISPIF pIf) 1250 1262 { 1263 RT_NOREF(pIf); 1251 1264 VBoxRrTerm(); 1252 1265 } … … 1365 1378 DWORD vboxDispIfCancelPendingResizeWDDM(PCVBOXDISPIF const pIf) 1366 1379 { 1380 RT_NOREF(pIf); 1367 1381 Log(("VBoxTray: cancelling pending resize\n")); 1368 1382 VBoxRrRetryStop(); … … 1512 1526 static DWORD vboxDispIfWddmEnableDisplays(PCVBOXDISPIF const pIf, UINT cIds, UINT *pIds, BOOL fEnabled, BOOL fSetTopology, DEVMODE *pDeviceMode) 1513 1527 { 1528 RT_NOREF(pIf); 1514 1529 VBOXDISPIF_WDDM_DISPCFG DispCfg; 1515 1530 … … 1580 1595 UINT Id = pChangeIds[i]; 1581 1596 /* re-query paths */ 1582 iPath = vboxDispIfWddmDcSearchPath(&DispCfg, -1, Id);1597 iPath = vboxDispIfWddmDcSearchPath(&DispCfg, VBOX_WDDM_DC_SEARCH_PATH_ANY, Id); 1583 1598 if (iPath < 0) 1584 1599 { … … 1663 1678 } 1664 1679 1665 static DWORD vboxDispIfWddmResizeDisplay(PCVBOXDISPIF const pIf, UINT Id, BOOL fEnable, DISPLAY_DEVICE * paDisplayDevices, DEVMODE *paDeviceMode, UINT devModes) 1666 { 1680 static DWORD vboxDispIfWddmResizeDisplay(PCVBOXDISPIF const pIf, UINT Id, BOOL fEnable, DISPLAY_DEVICE *paDisplayDevices, 1681 DEVMODE *paDeviceModes, UINT devModes) 1682 { 1683 RT_NOREF(paDisplayDevices, devModes); 1667 1684 VBOXDISPIF_WDDM_DISPCFG DispCfg; 1668 1685 DWORD winEr; … … 1730 1747 Assert(fEnable); 1731 1748 1732 winEr = vboxDispIfWddmDcSettingsUpdate(&DispCfg, iPath, &paDeviceMode [Id], FALSE, fEnable);1749 winEr = vboxDispIfWddmDcSettingsUpdate(&DispCfg, iPath, &paDeviceModes[Id], FALSE, fEnable); 1733 1750 if (winEr != ERROR_SUCCESS) 1734 1751 { … … 1977 1994 static DWORD vboxDispIfSwitchToXPDM_NT4(PVBOXDISPIF pIf) 1978 1995 { 1996 RT_NOREF(pIf); 1979 1997 return NO_ERROR; 1980 1998 } … … 2099 2117 static DWORD vboxDispIfSeamlessCreateWDDM(PCVBOXDISPIF const pIf, VBOXDISPIF_SEAMLESS *pSeamless, HANDLE hEvent) 2100 2118 { 2119 RT_NOREF(hEvent); 2101 2120 HRESULT hr = vboxDispKmtOpenAdapter(&pIf->modeData.wddm.KmtCallbacks, &pSeamless->modeData.wddm.Adapter); 2102 2121 if (SUCCEEDED(hr)) 2103 2122 { 2104 #ifdef VBOX_DISPIF_WITH_OPCONTEXT 2123 #ifndef VBOX_DISPIF_WITH_OPCONTEXT 2124 return ERROR_SUCCESS; 2125 #else 2105 2126 hr = vboxDispKmtCreateDevice(&pSeamless->modeData.wddm.Adapter, &pSeamless->modeData.wddm.Device); 2106 2127 if (SUCCEEDED(hr)) … … 2109 2130 0, 0, hEvent, 0ULL); 2110 2131 if (SUCCEEDED(hr)) 2111 #endif2112 2132 return ERROR_SUCCESS; 2113 #ifdef VBOX_DISPIF_WITH_OPCONTEXT 2114 else 2115 WARN(("VBoxTray: vboxDispKmtCreateContext failed hr 0x%x", hr)); 2133 WARN(("VBoxTray: vboxDispKmtCreateContext failed hr 0x%x", hr)); 2116 2134 2117 2135 vboxDispKmtDestroyDevice(&pSeamless->modeData.wddm.Device); … … 2121 2139 2122 2140 vboxDispKmtCloseAdapter(&pSeamless->modeData.wddm.Adapter); 2123 #endif 2141 #endif /* VBOX_DISPIF_WITH_OPCONTEXT */ 2124 2142 } 2125 2143 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r62865 r63099 67 67 static void vboxStTerm(void); 68 68 /* @returns true on "IsActiveConsole" state change */ 69 static BOOL vboxStHandleEvent(WPARAM EventID , LPARAM SessionID);69 static BOOL vboxStHandleEvent(WPARAM EventID); 70 70 static BOOL vboxStIsActiveConsole(); 71 71 static BOOL vboxStCheckTimer(WPARAM wEvent); … … 169 169 170 170 /* The global message table. */ 171 static VBOXGLOBALMESSAGE s_vboxGlobalMessageTable[] =171 static VBOXGLOBALMESSAGE g_vboxGlobalMessageTable[] = 172 172 { 173 173 /* Windows specific stuff. */ … … 195 195 static int vboxTrayGlMsgTaskbarCreated(WPARAM wParam, LPARAM lParam) 196 196 { 197 RT_NOREF(wParam, lParam); 197 198 return vboxTrayCreateTrayIcon(); 198 199 } … … 981 982 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 982 983 { 984 RT_NOREF(hPrevInstance, lpCmdLine, nCmdShow); 985 983 986 /* Note: Do not use a global namespace ("Global\\") for mutex name here, 984 987 * will blow up NT4 compatibility! */ … … 1099 1102 LogFunc(("Tool window created\n")); 1100 1103 1101 int rc = vboxTrayRegisterGlobalMessages(& s_vboxGlobalMessageTable[0]);1104 int rc = vboxTrayRegisterGlobalMessages(&g_vboxGlobalMessageTable[0]); 1102 1105 if (RT_FAILURE(rc)) 1103 1106 LogFunc(("Error registering global window messages, rc=%Rrc\n", rc)); … … 1191 1194 { 1192 1195 BOOL fOldAllowedState = VBoxConsoleIsAllowed(); 1193 if (vboxStHandleEvent(wParam , lParam))1196 if (vboxStHandleEvent(wParam)) 1194 1197 { 1195 1198 if (!VBoxConsoleIsAllowed() != !fOldAllowedState) … … 1202 1205 { 1203 1206 /* Handle all globally registered window messages. */ 1204 if (vboxTrayHandleGlobalMessages(& s_vboxGlobalMessageTable[0], uMsg,1207 if (vboxTrayHandleGlobalMessages(&g_vboxGlobalMessageTable[0], uMsg, 1205 1208 wParam, lParam)) 1206 1209 { … … 1344 1347 if (!gVBoxSt.pfnWTSUnRegisterSessionNotification(gVBoxSt.hWTSAPIWnd)) 1345 1348 { 1346 DWORD dwErr = GetLastError(); 1347 LogFlowFunc(("WTSAPI32 load failed, error = %08X\n", dwErr)); 1349 LogFlowFunc(("WTSAPI32 load failed, error = %08X\n", GetLastError())); 1348 1350 } 1349 1351 } … … 1387 1389 else 1388 1390 { 1389 DWORD dwErr = GetLastError(); 1390 LogFlowFunc(("timer WTSRegisterSessionNotification failed, error = %08X\n", dwErr)); 1391 LogFlowFunc(("timer WTSRegisterSessionNotification failed, error = %08X\n", GetLastError())); 1391 1392 Assert(gVBoxSt.fIsConsole == TRUE); 1392 1393 Assert(gVBoxSt.enmConnectState == WTSActive); … … 1397 1398 1398 1399 1399 static BOOL vboxStHandleEvent(WPARAM wEvent, LPARAM SessionID) 1400 { 1400 static BOOL vboxStHandleEvent(WPARAM wEvent) 1401 { 1402 RT_NOREF(wEvent); 1401 1403 LogFlowFunc(("WTS Event: %s\n", vboxStDbgGetString(wEvent))); 1402 1404 BOOL fOldIsActiveConsole = vboxStIsActiveConsole(); … … 1407 1409 } 1408 1410 1409 static BOOL vboxStIsActiveConsole( )1411 static BOOL vboxStIsActiveConsole(void) 1410 1412 { 1411 1413 return (gVBoxSt.enmConnectState == WTSActive && gVBoxSt.fIsConsole); … … 1455 1457 else 1456 1458 { 1457 DWORD dwErr = GetLastError();1459 // DWORD dwErr = GetLastError(); 1458 1460 // LogFlowFunc(("pfnOpenInputDesktop for Seamless failed, last error = %08X\n", dwErr)); 1459 1461 } … … 1537 1539 fRc = gVBoxDt.pfnVBoxHookInstallActiveDesktopTracker(hModHook); 1538 1540 if (!fRc) 1539 { 1540 DWORD dwErr = GetLastError(); 1541 LogFlowFunc(("pfnVBoxHookInstallActiveDesktopTracker failed, last error = %08X\n", dwErr)); 1542 } 1541 LogFlowFunc(("pfnVBoxHookInstallActiveDesktopTracker failed, last error = %08X\n", GetLastError())); 1543 1542 } 1544 1543 … … 1683 1682 static DECLCALLBACK(void) vboxCapsOnEnableSeamless(struct VBOXCAPS *pConsole, struct VBOXCAPS_ENTRY *pCap, BOOL fEnabled) 1684 1683 { 1684 RT_NOREF(pConsole, pCap); 1685 1685 if (fEnabled) 1686 1686 {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器