Changeset 44735 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Feb 18, 2013 2:01:33 PM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r44732 r44735 1323 1323 */ 1324 1324 if (OSinfo.dwMajorVersion >= 6 && OSinfo.dwMinorVersion >= 1) 1325 winEr = vboxDispIfWddmResizeDisplay(pIf, iChangedMode, paDisplayDevices, paDeviceModes, cDevModes);1325 winEr = vboxDispIfWddmResizeDisplay(pIf, iChangedMode, paDisplayDevices, paDeviceModes, cDevModes); 1326 1326 else 1327 1327 winEr = vboxDispIfWddmValidateFixResize(pIf, paDisplayDevices, paDeviceModes, cDevModes); … … 1358 1358 DISPLAYCONFIG_PATH_INFO *pPathInfoArray; 1359 1359 DISPLAYCONFIG_MODE_INFO *pModeInfoArray; 1360 UINT NumPathArrayElements = 0;1361 UINT NumModeInfoArrayElements = 0;1360 UINT numPathArrayElements = 0; 1361 UINT numModeInfoArrayElements = 0; 1362 1362 ULONG dwStatus; 1363 1363 1364 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS, &NumPathArrayElements,&NumModeInfoArrayElements);1364 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS, &numPathArrayElements, &numModeInfoArrayElements); 1365 1365 if (dwStatus != ERROR_SUCCESS) 1366 1366 { … … 1368 1368 return dwStatus; 1369 1369 } 1370 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(NumPathArrayElements * sizeof(DISPLAYCONFIG_PATH_INFO)); 1371 pModeInfoArray = (DISPLAYCONFIG_MODE_INFO *)malloc(NumModeInfoArrayElements * sizeof(DISPLAYCONFIG_MODE_INFO)); 1372 if (!pPathInfoArray || !pModeInfoArray ) 1373 { 1370 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(numPathArrayElements * sizeof(DISPLAYCONFIG_PATH_INFO)); 1371 if (!pPathInfoArray) 1374 1372 return ERROR_OUTOFMEMORY; 1375 } 1376 dwStatus = gCtx.pfnQueryDisplayConfig(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements, pPathInfoArray,&NumModeInfoArrayElements, pModeInfoArray,NULL); 1373 pModeInfoArray = (DISPLAYCONFIG_MODE_INFO *)malloc(numModeInfoArrayElements * sizeof(DISPLAYCONFIG_MODE_INFO)); 1374 if (!pModeInfoArray ) 1375 { 1376 if (pPathInfoArray) 1377 { 1378 free(pPathInfoArray); 1379 } 1380 return ERROR_OUTOFMEMORY; 1381 } 1382 dwStatus = gCtx.pfnQueryDisplayConfig(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS, &numPathArrayElements, pPathInfoArray,&numModeInfoArrayElements, pModeInfoArray, NULL); 1377 1383 if (dwStatus != ERROR_SUCCESS) 1378 1384 { … … 1384 1390 return dwStatus; 1385 1391 } 1386 for (unsigned int i=0; i < NumPathArrayElements; ++i)1392 for (unsigned int i=0; i < numPathArrayElements; ++i) 1387 1393 { 1388 1394 LogRel(("Sourceid= %d and targetid = %d\n", pPathInfoArray[i].sourceInfo.id, pPathInfoArray[i].targetInfo.id)); … … 1403 1409 } 1404 1410 } 1405 dwStatus = gCtx.pfnSetDisplayConfig( NumPathArrayElements, pPathInfoArray, NumModeInfoArrayElements, pModeInfoArray, (SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG));1411 dwStatus = gCtx.pfnSetDisplayConfig(numPathArrayElements, pPathInfoArray, numModeInfoArrayElements, pModeInfoArray, (SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1406 1412 if (dwStatus != ERROR_SUCCESS) 1407 1413 { … … 1424 1430 DISPLAYCONFIG_PATH_INFO *pPathInfoArray; 1425 1431 DISPLAYCONFIG_MODE_INFO *pModeInfoArray; 1426 UINT NumPathArrayElements = 0;1427 UINT NumModeInfoArrayElements = 0;1432 UINT numPathArrayElements = 0; 1433 UINT numModeInfoArrayElements = 0; 1428 1434 ULONG dwStatus; 1429 1435 1430 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &NumPathArrayElements,&NumModeInfoArrayElements);1436 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &numPathArrayElements, &numModeInfoArrayElements); 1431 1437 if (dwStatus != ERROR_SUCCESS) 1432 1438 { … … 1434 1440 return dwStatus; 1435 1441 } 1436 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(NumPathArrayElements * sizeof(DISPLAYCONFIG_PATH_INFO)); 1437 pModeInfoArray = (DISPLAYCONFIG_MODE_INFO *)malloc(NumModeInfoArrayElements * sizeof(DISPLAYCONFIG_MODE_INFO)); 1438 if (!pPathInfoArray || !pModeInfoArray ) 1439 { 1442 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(numPathArrayElements * sizeof(DISPLAYCONFIG_PATH_INFO)); 1443 if (!pPathInfoArray) 1440 1444 return ERROR_OUTOFMEMORY; 1441 } 1442 dwStatus = gCtx.pfnQueryDisplayConfig( QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements, pPathInfoArray,&NumModeInfoArrayElements, pModeInfoArray,NULL); 1445 pModeInfoArray = (DISPLAYCONFIG_MODE_INFO *)malloc(numModeInfoArrayElements * sizeof(DISPLAYCONFIG_MODE_INFO)); 1446 if (!pModeInfoArray ) 1447 { 1448 if (pPathInfoArray) 1449 { 1450 free(pPathInfoArray); 1451 } 1452 return ERROR_OUTOFMEMORY; 1453 } 1454 dwStatus = gCtx.pfnQueryDisplayConfig( QDC_ONLY_ACTIVE_PATHS, &numPathArrayElements, pPathInfoArray,&numModeInfoArrayElements, pModeInfoArray, NULL); 1443 1455 if (dwStatus != ERROR_SUCCESS) 1444 1456 { … … 1450 1462 return dwStatus; 1451 1463 } 1452 for (unsigned int i=0; i < NumPathArrayElements; ++i)1464 for (unsigned int i=0; i < numPathArrayElements; ++i) 1453 1465 { 1454 1466 LogRel(("Sourceid= %d and targetid = %d\n", pPathInfoArray[i].sourceInfo.id, pPathInfoArray[i].targetInfo.id)); … … 1464 1476 } 1465 1477 } 1466 dwStatus = gCtx.pfnSetDisplayConfig(NumPathArrayElements, pPathInfoArray, NumModeInfoArrayElements, pModeInfoArray,(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1467 if (dwStatus != ERROR_SUCCESS) { 1478 dwStatus = gCtx.pfnSetDisplayConfig(numPathArrayElements, pPathInfoArray, numModeInfoArrayElements, pModeInfoArray,(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1479 if (dwStatus != ERROR_SUCCESS) 1480 { 1468 1481 if (pPathInfoArray) 1469 1482 free(pPathInfoArray); -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
r44648 r44735 213 213 } 214 214 215 static DWORD EnableAndResizeDispDev(DEVMODE *paDeviceModes, DISPLAY_DEVICE *paDisplayDevices, DWORD totalDispNum, U LONGId, DWORD aWidth, DWORD aHeight,215 static DWORD EnableAndResizeDispDev(DEVMODE *paDeviceModes, DISPLAY_DEVICE *paDisplayDevices, DWORD totalDispNum, UINT Id, DWORD aWidth, DWORD aHeight, 216 216 DWORD aBitsPerPixel, DWORD aPosX, DWORD aPosY, BOOL fEnabled, BOOL fExtDispSup, VBOXDISPLAYCONTEXT *pCtx) 217 217 { … … 310 310 311 311 /* Returns TRUE to try again. */ 312 static BOOL ResizeDisplayDevice(U LONGId, DWORD Width, DWORD Height, DWORD BitsPerPixel,312 static BOOL ResizeDisplayDevice(UINT Id, DWORD Width, DWORD Height, DWORD BitsPerPixel, 313 313 BOOL fEnabled, DWORD dwNewPosX, DWORD dwNewPosY, 314 314 VBOXDISPLAYCONTEXT *pCtx, BOOL fExtDispSup)
Note:
See TracChangeset
for help on using the changeset viewer.