Changeset 44931 in vbox
- Timestamp:
- Mar 6, 2013 12:24:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r44763 r44931 448 448 449 449 #ifdef VBOX_WITH_WDDM 450 /**/ 450 451 451 #define VBOXRR_TIMER_ID 1234 452 452 … … 876 876 pMon->hThread = 0; 877 877 } 878 /**/ 878 879 879 880 880 typedef struct VBOXDISPIF_WDDM_INTERNAL … … 1275 1275 BOOL fAbleToInvalidateVidPn = FALSE; 1276 1276 1277 if ( winEr == NO_ERROR)1277 if (0 && winEr == NO_ERROR) 1278 1278 { 1279 1279 Assert(hAdapter); … … 1339 1339 vboxDispIfReninitModesWDDM(pIf, ScreenMask, TRUE); 1340 1340 1341 winEr = vboxDispIfWddmValidateFixResize(pIf, paDisplayDevices, paDeviceModes, cDevModes); 1342 1341 OSVERSIONINFO OSinfo; 1342 OSinfo.dwOSVersionInfoSize = sizeof (OSinfo); 1343 GetVersionEx (&OSinfo); 1344 if (OSinfo.dwMajorVersion >= 6 && OSinfo.dwMinorVersion >= 1) 1345 winEr = vboxDispIfWddmResizeDisplay(pIf, iChangedMode, paDisplayDevices, paDeviceModes, cDevModes); 1346 else 1347 winEr = vboxDispIfWddmValidateFixResize(pIf, paDisplayDevices, paDeviceModes, cDevModes); 1343 1348 Assert(winEr == NO_ERROR); 1344 1349 } … … 1427 1432 UINT numModeInfoArrayElements = 0; 1428 1433 ULONG dwStatus; 1434 bool fFoundDisplay = false; 1429 1435 1430 1436 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &numPathArrayElements, &numModeInfoArrayElements); … … 1453 1459 free(pModeInfoArray); 1454 1460 return dwStatus; 1455 } 1456 for (unsigned int i=0; i < numPathArrayElements; ++i) 1457 { 1458 LogRel(("Sourceid= %d and targetid = %d\n", pPathInfoArray[i].sourceInfo.id, pPathInfoArray[i].targetInfo.id)); 1459 if (pPathInfoArray[i].sourceInfo.id == Id) 1460 { 1461 LogRel(("VBoxTray: (Resize) Enable the Display Device i =%d \n", i)); 1462 int test = pPathInfoArray[i].sourceInfo.modeInfoIdx; 1463 pModeInfoArray[test].sourceMode.width = paDeviceMode[Id].dmPelsWidth; 1464 pModeInfoArray[test].sourceMode.height = paDeviceMode[Id].dmPelsHeight; 1465 pModeInfoArray[test].sourceMode.position.x = paDeviceMode[Id].dmPosition.x; 1466 pModeInfoArray[test].sourceMode.position.y = paDeviceMode[Id].dmPosition.y; 1461 } 1462 LogFlow(("VBoxTray: NumPath =%d and NumMod=%d\n", numPathArrayElements, numModeInfoArrayElements)); 1463 for (UINT iter = 0; iter < numPathArrayElements; ++iter) 1464 { 1465 LogFlow(("Sourceid= %d and targetid = %d iter =%d and id = %d\n", pPathInfoArray[iter].sourceInfo.id, pPathInfoArray[iter].targetInfo.id, iter, Id)); 1466 if (pPathInfoArray[iter].sourceInfo.id == Id) 1467 { 1468 UINT iModIdx = pPathInfoArray[iter].sourceInfo.modeInfoIdx; 1469 LogFlow(("VBoxTray: Mode Index = %d\n", iModIdx)); 1470 pModeInfoArray[iModIdx].sourceMode.width = paDeviceMode[Id].dmPelsWidth; 1471 pModeInfoArray[iModIdx].sourceMode.height = paDeviceMode[Id].dmPelsHeight; 1472 if(paDeviceMode[Id].dmPosition.x != 0 || paDeviceMode[Id].dmPosition.y != 0) 1473 { 1474 pModeInfoArray[iModIdx].sourceMode.position.x = paDeviceMode[Id].dmPosition.x; 1475 pModeInfoArray[iModIdx].sourceMode.position.y = paDeviceMode[Id].dmPosition.y; 1476 } 1477 fFoundDisplay = true; 1467 1478 break; 1468 1479 } 1469 1480 } 1470 dwStatus = gCtx.pfnSetDisplayConfig(numPathArrayElements, pPathInfoArray, numModeInfoArrayElements, pModeInfoArray,(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1471 if (dwStatus != ERROR_SUCCESS) 1472 { 1473 free(pPathInfoArray); 1474 free(pModeInfoArray); 1475 LogRel(("VBoxTray:(WDDM) Failed to Enable/ disable the monitor.")); 1476 return dwStatus; 1481 if (fFoundDisplay) 1482 { 1483 /* Call SetDisplayConfig only if displaywith ID=Id has been found. */ 1484 LogFlow(("VBoxTray: Found Display with Id=%d\n", Id)); 1485 dwStatus = gCtx.pfnSetDisplayConfig(numPathArrayElements, pPathInfoArray, numModeInfoArrayElements, pModeInfoArray,(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1486 if (dwStatus != ERROR_SUCCESS) 1487 { 1488 LogRel(("VBoxTray:(WDDM) Failed to resize the monitor.")); 1489 free(pPathInfoArray); 1490 free(pModeInfoArray); 1491 return dwStatus; 1492 } 1477 1493 } 1478 1494 free(pPathInfoArray);
Note:
See TracChangeset
for help on using the changeset viewer.