Changeset 44732 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Feb 18, 2013 1:20:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r44729 r44732 1362 1362 ULONG dwStatus; 1363 1363 1364 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(NumPathArrayElements);1365 pModeInfoArray = (DISPLAYCONFIG_MODE_INFO *)malloc(NumModeInfoArrayElements);1366 if (!pPathInfoArray || !pModeInfoArray ) {1367 return ERROR_OUTOFMEMORY;1368 }1369 1364 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements,&NumModeInfoArrayElements); 1370 1365 if (dwStatus != ERROR_SUCCESS) 1371 1366 { 1372 1367 LogFlow(("VBoxTray: (WDDM) Failed GetDisplayConfigBufferSizes \n")); 1373 if (pPathInfoArray)1374 free(pPathInfoArray);1375 if (pModeInfoArray)1376 free(pModeInfoArray);1377 1368 return dwStatus; 1378 1369 } 1379 dwStatus = gCtx.pfnQueryDisplayConfig(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements, &pPathInfoArray[0],&NumModeInfoArrayElements, &pModeInfoArray[0],NULL); 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 { 1374 return ERROR_OUTOFMEMORY; 1375 } 1376 dwStatus = gCtx.pfnQueryDisplayConfig(fEnabled ? QDC_ALL_PATHS : QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements, pPathInfoArray,&NumModeInfoArrayElements, pModeInfoArray,NULL); 1380 1377 if (dwStatus != ERROR_SUCCESS) 1381 1378 { … … 1406 1403 } 1407 1404 } 1408 dwStatus = gCtx.pfnSetDisplayConfig(NumPathArrayElements, &pPathInfoArray[0],NumModeInfoArrayElements, &pModeInfoArray[0],(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG));1405 dwStatus = gCtx.pfnSetDisplayConfig(NumPathArrayElements, pPathInfoArray, NumModeInfoArrayElements, pModeInfoArray, (SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1409 1406 if (dwStatus != ERROR_SUCCESS) 1410 1407 { … … 1416 1413 return dwStatus; 1417 1414 } 1415 if (pPathInfoArray) 1416 free(pPathInfoArray); 1417 if (pModeInfoArray) 1418 free(pModeInfoArray); 1418 1419 return ERROR_SUCCESS; 1419 1420 } … … 1427 1428 ULONG dwStatus; 1428 1429 1429 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(NumPathArrayElements);1430 pModeInfoArray = (DISPLAYCONFIG_MODE_INFO *)malloc(NumModeInfoArrayElements);1431 if (!pPathInfoArray || !pModeInfoArray ) {1432 return ERROR_OUTOFMEMORY;1433 }1434 1430 dwStatus = gCtx.pfnGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements,&NumModeInfoArrayElements); 1435 1431 if (dwStatus != ERROR_SUCCESS) 1436 1432 { 1437 1433 LogFlow(("VBoxTray: (WDDM) Failed GetDisplayConfigBufferSizes \n")); 1438 if (pPathInfoArray)1439 free(pPathInfoArray);1440 if (pModeInfoArray)1441 free(pModeInfoArray);1442 1434 return dwStatus; 1443 1435 } 1444 dwStatus = gCtx.pfnQueryDisplayConfig( QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements, &pPathInfoArray[0],&NumModeInfoArrayElements, &pModeInfoArray[0],NULL); 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 { 1440 return ERROR_OUTOFMEMORY; 1441 } 1442 dwStatus = gCtx.pfnQueryDisplayConfig( QDC_ONLY_ACTIVE_PATHS,&NumPathArrayElements, pPathInfoArray,&NumModeInfoArrayElements, pModeInfoArray,NULL); 1445 1443 if (dwStatus != ERROR_SUCCESS) 1446 1444 { … … 1466 1464 } 1467 1465 } 1468 dwStatus = gCtx.pfnSetDisplayConfig(NumPathArrayElements, &pPathInfoArray[0],NumModeInfoArrayElements, &pModeInfoArray[0],(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG));1466 dwStatus = gCtx.pfnSetDisplayConfig(NumPathArrayElements, pPathInfoArray, NumModeInfoArrayElements, pModeInfoArray,(SDC_APPLY | SDC_SAVE_TO_DATABASE| SDC_ALLOW_CHANGES | SDC_USE_SUPPLIED_DISPLAY_CONFIG)); 1469 1467 if (dwStatus != ERROR_SUCCESS) { 1470 1468 if (pPathInfoArray)
Note:
See TracChangeset
for help on using the changeset viewer.