Changeset 27991 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray
- Timestamp:
- Apr 5, 2010 7:12:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r27990 r27991 868 868 } 869 869 870 static DWORD vboxDispIfResizeXPDM(PCVBOXDISPIF const pIf, LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, LONG *pResult)870 static DWORD vboxDispIfResizeXPDM(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel) 871 871 { 872 872 return ERROR_NOT_SUPPORTED; … … 880 880 return ERROR_NOT_SUPPORTED; 881 881 case VBOXDISPIF_MODE_XPDM: 882 return vboxDispIfResizeXPDM(pIf, lpszDeviceName, lpDevMode, pResult);882 return vboxDispIfResizeXPDM(pIf, Id, Width, Height, BitsPerPixel); 883 883 #ifdef VBOXWDDM 884 884 case VBOXDISPIF_MODE_WDDM: … … 900 900 DWORD err = NO_ERROR; 901 901 AssertBreakpoint(); 902 // OSVERSIONINFO OSinfo; 903 // OSinfo.dwOSVersionInfoSize = sizeof (OSinfo); 904 // GetVersionEx (&OSinfo); 905 // if (OSinfo.dwMajorVersion >= 5) 906 // { 907 // bool bSupported = true; 908 // *(uintptr_t *)&pIf->modeData.xpdm.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA"); 909 // Log((__FUNCTION__": pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.xpdm.pfnChangeDisplaySettingsEx)); 910 // bSupported &= !!(pIf->modeData.xpdm.pfnChangeDisplaySettingsEx); 911 // 912 // if (!bSupported) 913 // { 914 // Log((__FUNCTION__": pfnChangeDisplaySettingsEx function pointer failed to initialize\n")); 915 // err = ERROR_NOT_SUPPORTED; 916 // } 917 // } 918 // else 919 // { 920 // Log((__FUNCTION__": can not switch to VBOXDISPIF_MODE_XPDM, because os is not >= w2k\n")); 921 // err = ERROR_NOT_SUPPORTED; 922 // } 902 OSVERSIONINFO OSinfo; 903 OSinfo.dwOSVersionInfoSize = sizeof (OSinfo); 904 GetVersionEx (&OSinfo); 905 if (OSinfo.dwMajorVersion >= 5) 906 { 907 HMODULE hUser = GetModuleHandle("USER32"); 908 if (NULL != hUser) 909 { 910 bool bSupported = true; 911 *(uintptr_t *)&pIf->modeData.xpdm.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA"); 912 Log((__FUNCTION__": pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.xpdm.pfnChangeDisplaySettingsEx)); 913 bSupported &= !!(pIf->modeData.xpdm.pfnChangeDisplaySettingsEx); 914 915 if (!bSupported) 916 { 917 Log((__FUNCTION__": pfnChangeDisplaySettingsEx function pointer failed to initialize\n")); 918 err = ERROR_NOT_SUPPORTED; 919 } 920 } 921 else 922 { 923 Log((__FUNCTION__": failed to get USER32 handle, err (%d)\n", GetLastError())); 924 err = ERROR_NOT_SUPPORTED; 925 } 926 } 927 else 928 { 929 Log((__FUNCTION__": can not switch to VBOXDISPIF_MODE_XPDM, because os is not >= w2k\n")); 930 err = ERROR_NOT_SUPPORTED; 931 } 923 932 924 933 return err;
Note:
See TracChangeset
for help on using the changeset viewer.