VirtualBox

Ignore:
Timestamp:
Apr 5, 2010 7:12:43 PM (15 years ago)
Author:
vboxsync
Message:

yet another burn fix (sorry)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r27990 r27991  
    868868}
    869869
    870 static DWORD vboxDispIfResizeXPDM(PCVBOXDISPIF const pIf, LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, LONG *pResult)
     870static DWORD vboxDispIfResizeXPDM(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel)
    871871{
    872872    return ERROR_NOT_SUPPORTED;
     
    880880            return ERROR_NOT_SUPPORTED;
    881881        case VBOXDISPIF_MODE_XPDM:
    882             return vboxDispIfResizeXPDM(pIf, lpszDeviceName, lpDevMode, pResult);
     882            return vboxDispIfResizeXPDM(pIf, Id, Width, Height, BitsPerPixel);
    883883#ifdef VBOXWDDM
    884884        case VBOXDISPIF_MODE_WDDM:
     
    900900    DWORD err = NO_ERROR;
    901901    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    }
    923932
    924933    return err;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette