VirtualBox

Ignore:
Timestamp:
May 30, 2014 11:49:42 AM (11 years ago)
Author:
vboxsync
Message:

VBoxTray: Logging; ripped out all custom logging.

File:
1 edited

Legend:

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

    r49891 r51469  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616 */
    17 #define _WIN32_WINNT 0x0500
    1817#include "VBoxTray.h"
    1918#include "VBoxHelpers.h"
    2019#include "VBoxSeamless.h"
     20
     21#include <malloc.h>
     22
     23#include <iprt/assert.h>
     24#ifdef VBOX_WITH_WDDM
     25# include <iprt/asm.h>
     26#endif
     27
     28#ifdef DEBUG
     29# define LOG_ENABLED
     30# define LOG_GROUP LOG_GROUP_DEFAULT
     31#endif
     32#include <VBox/log.h>
     33#include <VBox/VMMDev.h>
     34
     35#include <VBoxDisplay.h>
     36#include <VBoxGuestInternal.h>
    2137#include <VBoxHook.h>
    22 #include <VBoxDisplay.h>
    23 #include <VBox/VMMDev.h>
    24 #include <iprt/assert.h>
    25 #include <malloc.h>
    26 #include <VBoxGuestInternal.h>
    27 #ifdef VBOX_WITH_WDDM
    28 #include <iprt/asm.h>
    29 #endif
     38
     39
    3040
    3141typedef struct _VBOXDISPLAYCONTEXT
     
    5767int VBoxDisplayInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread)
    5868{
    59     Log(("VBoxTray: VBoxDisplayInit ...\n"));
     69    LogFlowFunc(("VBoxDisplayInit ...\n"));
    6070
    6171    OSVERSIONINFO OSinfo;
     
    6979    if (NULL == hUser)
    7080    {
    71         Log(("VBoxTray: VBoxDisplayInit: Could not get module handle of USER32.DLL!\n"));
     81        LogFlowFunc(("Could not get module handle of USER32.DLL!\n"));
    7282        return VERR_NOT_IMPLEMENTED;
    7383    }
     
    7585    {
    7686        *(uintptr_t *)&gCtx.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA");
    77         Log(("VBoxTray: VBoxDisplayInit: pfnChangeDisplaySettingsEx = %p\n", gCtx.pfnChangeDisplaySettingsEx));
     87        LogFlowFunc(("pfnChangeDisplaySettingsEx = %p\n", gCtx.pfnChangeDisplaySettingsEx));
    7888
    7989        *(uintptr_t *)&gCtx.pfnEnumDisplayDevices = (uintptr_t)GetProcAddress(hUser, "EnumDisplayDevicesA");
    80         Log(("VBoxTray: VBoxDisplayInit: pfnEnumDisplayDevices = %p\n", gCtx.pfnEnumDisplayDevices));
     90        LogFlowFunc(("pfnEnumDisplayDevices = %p\n", gCtx.pfnEnumDisplayDevices));
    8191
    8292#ifdef VBOX_WITH_WDDM
     
    8494        {
    8595            /* this is vista and up, check if we need to switch the display driver if to WDDM mode */
    86             Log(("VBoxTray: VBoxDisplayInit: this is Windows Vista and up\n"));
     96            LogFlowFunc(("this is Windows Vista and up\n"));
    8797            VBOXDISPLAY_DRIVER_TYPE enmType = getVBoxDisplayDriverType (&gCtx);
    8898            if (enmType == VBOXDISPLAY_DRIVER_TYPE_WDDM)
    8999            {
    90                 Log(("VBoxTray: VBoxDisplayInit: WDDM driver is installed, switching display driver if to WDDM mode\n"));
     100                LogFlowFunc(("WDDM driver is installed, switching display driver if to WDDM mode\n"));
    91101                /* this is hacky, but the most easiest way */
    92102                VBOXDISPIF_MODE enmMode = (OSinfo.dwMajorVersion > 6 || OSinfo.dwMinorVersion > 0) ? VBOXDISPIF_MODE_WDDM_W7 : VBOXDISPIF_MODE_WDDM;
    93103                DWORD err = VBoxDispIfSwitchMode(const_cast<PVBOXDISPIF>(&pEnv->dispIf), enmMode, NULL /* old mode, we don't care about it */);
    94104                if (err == NO_ERROR)
    95                     Log(("VBoxTray: VBoxDisplayInit: DispIf switched to WDDM mode successfully\n"));
     105                    LogFlowFunc(("DispIf switched to WDDM mode successfully\n"));
    96106                else
    97                     Log(("VBoxTray: VBoxDisplayInit: Failed to switch DispIf to WDDM mode, err (%d)\n", err));
     107                    LogFlowFunc(("Failed to switch DispIf to WDDM mode, err (%d)\n", err));
    98108            }
    99109        }
     
    106116    else                                /* Unsupported platform */
    107117    {
    108         Log(("VBoxTray: VBoxDisplayInit: Warning, display for platform not handled yet!\n"));
     118        LogFlowFunc(("Warning, display for platform not handled yet!\n"));
    109119        return VERR_NOT_IMPLEMENTED;
    110120    }
     
    118128        gCtx.fAnyX = TRUE;
    119129
    120     Log(("VBoxTray: VBoxDisplayInit: Display init successful\n"));
     130    LogFlowFunc(("Display init successful\n"));
    121131
    122132    *pfStartThread = true;
     
    149159        dispDevice.cb = sizeof(DISPLAY_DEVICE);
    150160
    151         Log(("VBoxTray: isVBoxDisplayDriverActive: Checking for active VBox display driver (W2K+) ...\n"));
     161        LogFlowFunc(("isVBoxDisplayDriverActive: Checking for active VBox display driver (W2K+) ...\n"));
    152162
    153163        while (EnumDisplayDevices(NULL,
     
    156166                                  0))
    157167        {
    158             Log(("VBoxTray: isVBoxDisplayDriverActive: DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\nFlags=%08X\n\n",
     168            LogFlowFunc(("isVBoxDisplayDriverActive: DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\nFlags=%08X\n\n",
    159169                          devNum,
    160170                          &dispDevice.DeviceName[0],
     
    166176            if (dispDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
    167177            {
    168                 Log(("VBoxTray: isVBoxDisplayDriverActive: Primary device\n"));
     178                LogFlowFunc(("isVBoxDisplayDriverActive: Primary device\n"));
    169179
    170180                if (strcmp(&dispDevice.DeviceString[0], "VirtualBox Graphics Adapter") == 0)
     
    191201    else    /* This must be NT 4 or something really old, so don't use EnumDisplayDevices() here  ... */
    192202    {
    193         Log(("VBoxTray: isVBoxDisplayDriverActive: Checking for active VBox display driver (NT or older) ...\n"));
     203        LogFlowFunc(("isVBoxDisplayDriverActive: Checking for active VBox display driver (NT or older) ...\n"));
    194204
    195205        DEVMODE tempDevMode;
     
    249259            if(!(displayDevice.StateFlags & DISPLAY_DEVICE_ACTIVE))
    250260            {
    251                 LogRel(("VBoxTray: Secondary Monitor with ID=%d and name=%s Not Enabled. Enabling it.\n", Id, displayDevice.DeviceName));
     261                LogRel(("Secondary Monitor with ID=%d and name=%s Not Enabled. Enabling it.\n", Id, displayDevice.DeviceName));
    252262                deviceMode.dmPosition.x = paDeviceModes[0].dmPelsWidth;
    253263                deviceMode.dmPosition.y = 0;
     
    272282                if (aWidth !=0 && aHeight != 0)
    273283                {
    274                     LogRel(("VBoxTray: Display : %s , Change Height: %d & Width: %d\n", displayDevice.DeviceName, aWidth, aHeight));
     284                    LogRel(("Display : %s , Change Height: %d & Width: %d\n", displayDevice.DeviceName, aWidth, aHeight));
    275285                    deviceMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL
    276286                                          | DM_DISPLAYFREQUENCY | DM_DISPLAYFLAGS;
     
    281291                if (aPosX != 0 || aPosY != 0)
    282292                {
    283                     LogRel(("VBoxTray: Display: %s PosX: %d, PosY: %d\n", displayDevice.DeviceName, aPosX, aPosY));
     293                    LogRel(("Display: %s PosX: %d, PosY: %d\n", displayDevice.DeviceName, aPosX, aPosY));
    284294                    deviceMode.dmFields |=  DM_POSITION;
    285295                    deviceMode.dmPosition.x = aPosX;
     
    294304        else /* Request is there to disable the monitor with ID = Id*/
    295305        {
    296             LogRel(("VBoxTray: Disable the Display: %d\n", displayDevice.DeviceName));
     306            LogRel(("Disable the Display: %d\n", displayDevice.DeviceName));
    297307
    298308            DEVMODE deviceModeTmp;
     
    322332    while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0))
    323333    {
    324         Log(("VBoxTray: ResizeDisplayDevice: [%d] %s\n", i, DisplayDevice.DeviceName));
     334        LogFlowFunc(("ResizeDisplayDevice: [%d] %s\n", i, DisplayDevice.DeviceName));
    325335
    326336        if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
    327337        {
    328             Log(("VBoxTray: ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ()));
     338            LogFlowFunc(("ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ()));
    329339            NumDevices++;
    330340        }
     
    332342        {
    333343
    334             Log(("VBoxTray: ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ()));
     344            LogFlowFunc(("ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ()));
    335345            NumDevices++;
    336346        }
     
    358368    while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0))
    359369    {
    360         Log(("VBoxTray: ResizeDisplayDevice: [%d(%d)] %s\n", i, DevNum, DisplayDevice.DeviceName));
     370        LogFlowFunc(("ResizeDisplayDevice: [%d(%d)] %s\n", i, DevNum, DisplayDevice.DeviceName));
    361371
    362372        BOOL bFetchDevice = FALSE;
     
    364374        if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
    365375        {
    366             Log(("VBoxTray: ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ()));
     376            LogFlowFunc(("ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ()));
    367377            DevPrimaryNum = DevNum;
    368378            bFetchDevice = TRUE;
     
    371381        {
    372382
    373             Log(("VBoxTray: ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ()));
     383            LogFlowFunc(("ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ()));
    374384            bFetchDevice = TRUE;
    375385        }
     
    379389            if (DevNum >= NumDevices)
    380390            {
    381                 WARN(("VBoxTray: ResizeDisplayDevice: %d >= %d\n", NumDevices, DevNum));
     391                LogFlowFunc(("ResizeDisplayDevice: %d >= %d\n", NumDevices, DevNum));
    382392                return ERROR_BUFFER_OVERFLOW;
    383393            }
     
    394404                 ENUM_REGISTRY_SETTINGS, &paDeviceModes[DevNum]))
    395405            {
    396                 Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings error %d\n", GetLastError ()));
     406                LogFlowFunc(("ResizeDisplayDevice: EnumDisplaySettings error %d\n", GetLastError ()));
    397407            }
    398408
     
    412422                     * Do not return here, ignore the error and set the display info to 0x0x0.
    413423                     */
    414                     Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings(ENUM_CURRENT_SETTINGS) error %d\n", GetLastError ()));
     424                    LogFlowFunc(("ResizeDisplayDevice: EnumDisplaySettings(ENUM_CURRENT_SETTINGS) error %d\n", GetLastError ()));
    415425                }
    416426            }
     
    440450    DWORD dmFields = 0;
    441451
    442     Log(("VBoxTray: ResizeDisplayDevice Width= %d, Height=%d , PosX=%d and PosY=%d \
     452    LogFlowFunc(("ResizeDisplayDevice Width= %d, Height=%d , PosX=%d and PosY=%d \
    443453         fEnabled = %d, fExtDisSup = %d\n",
    444454          Width, Height, dwNewPosX, dwNewPosY, fEnabled, fExtDispSup));
     
    453463    if (NumDevices == 0 || Id >= NumDevices)
    454464    {
    455         WARN(("VBoxTray: ResizeDisplayDevice: Requested identifier %d is invalid. err %d\n", Id, GetLastError ()));
     465        LogFlowFunc(("ResizeDisplayDevice: Requested identifier %d is invalid. err %d\n", Id, GetLastError ()));
    456466        return FALSE;
    457467    }
    458468
    459     Log(("VBoxTray: ResizeDisplayDevice: Found total %d devices. err %d\n", NumDevices, GetLastError ()));
     469    LogFlowFunc(("ResizeDisplayDevice: Found total %d devices. err %d\n", NumDevices, GetLastError ()));
    460470
    461471    DISPLAY_DEVICE *paDisplayDevices = (DISPLAY_DEVICE *)alloca (sizeof (DISPLAY_DEVICE) * NumDevices);
     
    467477    if (dwStatus != NO_ERROR)
    468478    {
    469         WARN(("VBoxTray: ResizeDisplayDevice: VBoxGetDisplayConfig failed, %d\n", dwStatus));
     479        LogFlowFunc(("ResizeDisplayDevice: VBoxGetDisplayConfig failed, %d\n", dwStatus));
    470480        return dwStatus;
    471481    }
    472482
    473483    if (NumDevices != DevNum)
    474         WARN(("VBoxTray: ResizeDisplayDevice: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum));
     484        LogFlowFunc(("ResizeDisplayDevice: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum));
    475485
    476486    DWORD i = 0;
     
    480490        if (fExtDispSup)
    481491        {
    482             LogRel(("VBoxTray: Extended Display Support.\n"));
    483             Log(("VBoxTray: ResizeDisplayDevice1: %dx%dx%d at %d,%d . Id = %d and DevNum=%d, fEnabled=%d\n",
     492            LogRel(("Extended Display Support.\n"));
     493            LogFlowFunc(("ResizeDisplayDevice1: %dx%dx%d at %d,%d . Id = %d and DevNum=%d, fEnabled=%d\n",
    484494                  paDeviceModes[Id].dmPelsWidth,
    485495                  paDeviceModes[Id].dmPelsHeight,
     
    491501        else
    492502        {
    493             LogRel(("VBoxTray: NO Ext Display Support \n"));
     503            LogRel(("NO Ext Display Support \n"));
    494504        }
    495505
     
    503513    if (paDisplayDevices[Id].StateFlags & DISPLAY_DEVICE_ACTIVE)
    504514    {
    505         LogRel(("VBoxTray: Display with ID=%d already enabled\n", Id));
     515        LogRel(("Display with ID=%d already enabled\n", Id));
    506516        fDispAlreadyEnabled = TRUE;
    507517    }
     
    559569        && paDeviceModes[Id].dmBitsPerPel == BitsPerPixel)
    560570    {
    561         LogRel(("VBoxTray: Already at desired resolution. No Change.\n"));
     571        LogRel(("Already at desired resolution. No Change.\n"));
    562572        return FALSE;
    563573    }
     
    568578    for (i = 0; i < NumDevices; i++)
    569579    {
    570         Log(("VBoxTray: ResizeDisplayDevice: [%d]: %d,%d %dx%d\n",
     580        LogFlowFunc(("ResizeDisplayDevice: [%d]: %d,%d %dx%d\n",
    571581                i, paRects[i].left, paRects[i].top,
    572582                paRects[i].right - paRects[i].left,
     
    597607            if (!(paDeviceModes[i].dmFields & DM_BITSPERPEL))
    598608            {
    599                 WARN(("VBoxTray: (WDDM) no DM_BITSPERPEL\n"));
     609                LogFlowFunc(("no DM_BITSPERPEL\n"));
    600610                paDeviceModes[i].dmFields |= DM_BITSPERPEL;
    601611                paDeviceModes[i].dmBitsPerPel = 32;
    602612            }
    603613
    604             Log(("VBoxTray: (WDDM) ResizeDisplayDevice: pfnChangeDisplaySettingsEx %x: %dx%dx%d at %d,%d\n",
     614            LogFlowFunc(("ResizeDisplayDevice: pfnChangeDisplaySettingsEx %x: %dx%dx%d at %d,%d\n",
    605615                  gCtx.pfnChangeDisplaySettingsEx,
    606616                  paDeviceModes[i].dmPelsWidth,
     
    611621        }
    612622
    613         Log(("VBoxTray: (WDDM) Request to resize the displa\n"));
     623        LogFlowFunc(("Request to resize the displa\n"));
    614624        DWORD err = VBoxDispIfResizeModes(&pCtx->pEnv->dispIf, Id, fEnabled, fExtDispSup, paDisplayDevices, paDeviceModes, DevNum);
    615625        if (err == NO_ERROR || err != ERROR_RETRY)
    616626        {
    617627            if (err == NO_ERROR)
    618                 Log(("VBoxTray: VBoxDisplayThread: (WDDM) VBoxDispIfResizeModes succeeded\n"));
     628                LogFlowFunc(("VBoxDispIfResizeModes succeeded\n"));
    619629            else
    620                WARN(("VBoxTray: VBoxDisplayThread: (WDDM) Failure VBoxDispIfResizeModes (%d)\n", err));
     630               LogFlowFunc(("Failure VBoxDispIfResizeModes (%d)\n", err));
    621631            return FALSE;
    622632        }
    623633
    624         Log(("VBoxTray: ResizeDisplayDevice: (WDDM) RETRY requested\n"));
     634        LogFlowFunc(("ResizeDisplayDevice: RETRY requested\n"));
    625635        return TRUE;
    626636    }
     
    635645        tempDevMode.dmSize = sizeof(DEVMODE);
    636646        EnumDisplaySettings((LPSTR)paDisplayDevices[i].DeviceName, 0xffffff, &tempDevMode);
    637         Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings last error %d\n", GetLastError ()));
     647        LogFlowFunc(("ResizeDisplayDevice: EnumDisplaySettings last error %d\n", GetLastError ()));
    638648    }
    639649
     
    658668        }
    659669
    660         Log(("VBoxTray: ResizeDisplayDevice: pfnChangeDisplaySettingsEx Current MonitorId=%d: %dx%dx%d at %d,%d\n",
     670        LogFlowFunc(("ResizeDisplayDevice: pfnChangeDisplaySettingsEx Current MonitorId=%d: %dx%dx%d at %d,%d\n",
    661671              i,
    662672              paDeviceModes[i].dmPelsWidth,
     
    668678        LONG status = gCtx.pfnChangeDisplaySettingsEx((LPSTR)paDisplayDevices[i].DeviceName,
    669679                                        &paDeviceModes[i], NULL, CDS_NORESET | CDS_UPDATEREGISTRY, NULL);
    670         Log(("VBoxTray: ResizeDisplayDevice: ChangeDisplaySettingsEx position status %d, err %d\n", status, GetLastError ()));
    671     }
    672 
    673     Log(("VBoxTray: Enable And Resize Device. Id = %d, Width=%d Height=%d, \
     680        LogFlowFunc(("ResizeDisplayDevice: ChangeDisplaySettingsEx position status %d, err %d\n", status, GetLastError ()));
     681    }
     682
     683    LogFlowFunc(("Enable And Resize Device. Id = %d, Width=%d Height=%d, \
    674684         dwNewPosX = %d, dwNewPosY = %d fEnabled=%d & fExtDispSupport = %d \n",
    675685         Id, Width, Height, dwNewPosX, dwNewPosY, fEnabled, fExtDispSup));
     
    693703unsigned __stdcall VBoxDisplayThread(void *pInstance)
    694704{
    695     Log(("VBoxTray: VBoxDisplayThread: Entered\n"));
     705    LogFlowFunc(("Entered\n"));
    696706
    697707    VBOXDISPLAYCONTEXT *pCtx = (VBOXDISPLAYCONTEXT *)pInstance;
     
    705715    if (!DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
    706716    {
    707         Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - or) failed, thread exiting\n"));
     717        LogFlowFunc(("DeviceIOControl(CtlMask - or) failed, thread exiting\n"));
    708718        return 0;
    709719    }
     
    722732        if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent), &waitEvent, sizeof(waitEvent), &cbReturned, NULL))
    723733        {
    724             /*Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl succeeded\n"));*/
     734            /*LogFlowFunc(("DeviceIOControl succeeded\n"));*/
    725735
    726736            if (NULL == pCtx) {
    727                 Log(("VBoxTray: VBoxDisplayThread: Invalid context detected!\n"));
     737                LogFlowFunc(("Invalid context detected!\n"));
    728738                break;
    729739            }
    730740
    731741            if (NULL == pCtx->pEnv) {
    732                 Log(("VBoxTray: VBoxDisplayThread: Invalid context environment detected!\n"));
     742                LogFlowFunc(("Invalid context environment detected!\n"));
    733743                break;
    734744            }
     
    738748                break;
    739749
    740             /*Log(("VBoxTray: VBoxDisplayThread: checking event\n"));*/
     750            /*LogFlowFunc(("checking event\n"));*/
    741751
    742752            /* did we get the right event? */
    743753            if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST)
    744754            {
    745                 Log(("VBoxTray: VBoxDisplayThread: going to get display change information\n"));
     755                LogFlowFunc(("going to get display change information\n"));
    746756                BOOL fDisplayChangeQueried;
    747757
     
    763773               if (!fDisplayChangeQueried)
    764774               {
    765                     Log(("VBoxTray: Extended Display Not Supported. Trying VMMDevDisplayChangeRequest2\n"));
     775                    LogFlowFunc(("Extended Display Not Supported. Trying VMMDevDisplayChangeRequest2\n"));
    766776                    fExtDispSup = FALSE; /* Extended display Change request is not supported */
    767777
     
    780790                if (!fDisplayChangeQueried)
    781791                {
    782                     Log(("VBoxTray: Extended Display Not Supported. Trying VMMDevDisplayChangeRequest\n"));
     792                    LogFlowFunc(("Extended Display Not Supported. Trying VMMDevDisplayChangeRequest\n"));
    783793                    fExtDispSup = FALSE; /*Extended display Change request is not supported */
    784794                    /* Try the old version of the request for old VBox hosts. */
     
    801811                    for (;;)
    802812                    {
    803                         Log(("VBoxTray: VBoxDisplayThread: VMMDevReq_GetDisplayChangeRequest2: %dx%dx%d at %d\n", displayChangeRequest.xres, displayChangeRequest.yres, displayChangeRequest.bpp, displayChangeRequest.display));
     813                        LogFlowFunc(("VMMDevReq_GetDisplayChangeRequest2: %dx%dx%d at %d\n", displayChangeRequest.xres, displayChangeRequest.yres, displayChangeRequest.bpp, displayChangeRequest.display));
    804814
    805815                        /*
     
    810820
    811821                        if (enmDriverType == VBOXDISPLAY_DRIVER_TYPE_WDDM)
    812                             Log(("VBoxTray: VBoxDisplayThread: Detected WDDM Driver\n"));
     822                            LogFlowFunc(("Detected WDDM Driver\n"));
    813823
    814824                        if (enmDriverType != VBOXDISPLAY_DRIVER_TYPE_UNKNOWN)
     
    817827#endif
    818828                        {
    819                             Log(("VBoxTray: VBoxDisplayThread: Display driver is active!\n"));
     829                            LogFlowFunc(("Display driver is active!\n"));
    820830
    821831                            if (pCtx->pfnChangeDisplaySettingsEx != 0)
    822832                            {
    823                                 Log(("VBoxTray: VBoxDisplayThread: Detected W2K or later\n"));
     833                                LogFlowFunc(("Detected W2K or later\n"));
    824834                                /* W2K or later. */
    825                                 Log(("DisplayChangeReqEx parameters  aDisplay=%d x xRes=%d x yRes=%d x bpp=%d x SecondayMonEnb=%d x NewOriginX=%d x NewOriginY=%d x ChangeOrigin=%d\n",
     835                                LogFlowFunc(("DisplayChangeReqEx parameters  aDisplay=%d x xRes=%d x yRes=%d x bpp=%d x SecondayMonEnb=%d x NewOriginX=%d x NewOriginY=%d x ChangeOrigin=%d\n",
    826836                                     displayChangeRequest.display,
    827837                                     displayChangeRequest.xres,
     
    843853                                                         ))
    844854                                {
    845                                     Log(("ResizeDipspalyDevice return 0\n"));
     855                                    LogFlowFunc(("ResizeDipspalyDevice return 0\n"));
    846856                                    break;
    847857                                }
     
    850860                            else
    851861                            {
    852                                 Log(("VBoxTray: VBoxDisplayThread: Detected NT\n"));
     862                                LogFlowFunc(("Detected NT\n"));
    853863
    854864                                /* Single monitor NT. */
     
    860870                                if (EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &devMode))
    861871                                {
    862                                     Log(("VBoxTray: VBoxDisplayThread: Current mode: %d x %d x %d at %d,%d\n",
     872                                    LogFlowFunc(("Current mode: %d x %d x %d at %d,%d\n",
    863873                                          devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel, devMode.dmPosition.x, devMode.dmPosition.y));
    864874
     
    879889                                    {
    880890                                        /* All zero values means a forced mode reset. Do nothing. */
    881                                         Log(("VBoxTray: VBoxDisplayThread: Forced mode reset\n"));
     891                                        LogFlowFunc(("Forced mode reset\n"));
    882892                                    }
    883893
     
    887897                                        && devMode.dmBitsPerPel == displayChangeRequest.bpp)
    888898                                    {
    889                                         Log(("VBoxTray: VBoxDisplayThread: already at desired resolution\n"));
     899                                        LogFlowFunc(("already at desired resolution\n"));
    890900                                        break;
    891901                                    }
     
    905915                                        devMode.dmBitsPerPel = displayChangeRequest.bpp;
    906916
    907                                     Log(("VBoxTray: VBoxDisplayThread: setting new mode %d x %d, %d BPP\n",
     917                                    LogFlowFunc(("setting new mode %d x %d, %d BPP\n",
    908918                                         devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel));
    909919
     
    912922                                    if (status != DISP_CHANGE_SUCCESSFUL)
    913923                                    {
    914                                         Log(("VBoxTray: VBoxDisplayThread: error from ChangeDisplaySettings: %d\n", status));
     924                                        LogFlowFunc(("error from ChangeDisplaySettings: %d\n", status));
    915925
    916926                                        if (status == DISP_CHANGE_BADMODE)
     
    928938                                else
    929939                                {
    930                                     Log(("VBoxTray: VBoxDisplayThread: error from EnumDisplaySettings: %d\n", GetLastError ()));
     940                                    LogFlowFunc(("error from EnumDisplaySettings: %d\n", GetLastError ()));
    931941                                    break;
    932942                                }
     
    935945                        else
    936946                        {
    937                             Log(("VBoxTray: VBoxDisplayThread: vboxDisplayDriver is not active\n"));
     947                            LogFlowFunc(("vboxDisplayDriver is not active\n"));
    938948                        }
    939949
     
    949959                else
    950960                {
    951                     Log(("VBoxTray: VBoxDisplayThread: error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n"));
     961                    LogFlowFunc(("error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n"));
    952962                    /* sleep a bit to not eat too much CPU while retrying */
    953963                    /* are we supposed to stop? */
     
    965975        {
    966976#ifndef DEBUG_andy /* Too noisy for me. */
    967             Log(("VBoxTray: VBoxDisplayThread: error 0 from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n"));
     977            LogFlowFunc(("error 0 from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n"));
    968978#endif
    969979            /* sleep a bit to not eat too much CPU in case the above call always fails */
     
    982992    maskInfo.u32NotMask = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED;
    983993    if (!DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
    984         Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - not) failed\n"));
     994        LogFlowFunc(("DeviceIOControl(CtlMask - not) failed\n"));
    985995    PostMessage(ghwndToolWindow, WM_VBOX_GRAPHICS_UNSUPPORTED, 0, 0);
    986996
    987     Log(("VBoxTray: VBoxDisplayThread: finished display change request thread\n"));
     997    LogFlowFunc(("finished display change request thread\n"));
    988998    return 0;
    989999}
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