VirtualBox

Ignore:
Timestamp:
Sep 17, 2010 11:34:06 AM (14 years ago)
Author:
vboxsync
Message:

Logging.

File:
1 edited

Legend:

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

    r32588 r32592  
    6565int VBoxDisplayInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread)
    6666{
     67    Log(("VBoxTray: VBoxDisplayInit ...\n"));
     68
    6769    OSVERSIONINFO OSinfo;
    6870    OSinfo.dwOSVersionInfoSize = sizeof (OSinfo);
     
    7577    if (NULL == hUser)
    7678    {
    77         Log(("VBoxTray: Could not get module handle of USER32.DLL!\n"));
     79        Log(("VBoxTray: VBoxDisplayInit: Could not get module handle of USER32.DLL!\n"));
    7880        return VERR_NOT_IMPLEMENTED;
    7981    }
     
    8183    {
    8284        *(uintptr_t *)&gCtx.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA");
    83         Log(("VBoxTray: pfnChangeDisplaySettingsEx = %p\n", gCtx.pfnChangeDisplaySettingsEx));
     85        Log(("VBoxTray: VBoxDisplayInit: pfnChangeDisplaySettingsEx = %p\n", gCtx.pfnChangeDisplaySettingsEx));
    8486
    8587        *(uintptr_t *)&gCtx.pfnEnumDisplayDevices = (uintptr_t)GetProcAddress(hUser, "EnumDisplayDevicesA");
    86         Log(("VBoxTray: pfnEnumDisplayDevices = %p\n", gCtx.pfnEnumDisplayDevices));
     88        Log(("VBoxTray: VBoxDisplayInit: pfnEnumDisplayDevices = %p\n", gCtx.pfnEnumDisplayDevices));
    8789
    8890#ifdef VBOXWDDM
     
    9092        {
    9193            /* this is vista and up, check if we need to switch the display driver if to WDDM mode */
    92             Log(("VBoxTray: this is vista and up\n"));
     94            Log(("VBoxTray: VBoxDisplayInit: this is Windows Vista and up\n"));
    9395            VBOXDISPLAY_DRIVER_TYPE enmType = getVBoxDisplayDriverType (&gCtx);
    9496            if (enmType == VBOXDISPLAY_DRIVER_TYPE_WDDM)
    9597            {
    96                 Log(("VBoxTray: WDDM driver is installed, switching display driver if to WDDM mode\n"));
     98                Log(("VBoxTray: VBoxDisplayInit: WDDM driver is installed, switching display driver if to WDDM mode\n"));
    9799                /* this is hacky, but the most easiest way */
    98100                DWORD err = VBoxDispIfSwitchMode(const_cast<PVBOXDISPIF>(&pEnv->dispIf), VBOXDISPIF_MODE_WDDM, NULL /* old mode, we don't care about it */);
    99101                if (err == NO_ERROR)
    100                     Log(("VBoxTray: DispIf switched to WDDM mode successfully\n"));
     102                    Log(("VBoxTray: VBoxDisplayInit: DispIf switched to WDDM mode successfully\n"));
    101103                else
    102                     Log(("VBoxTray: failed to switch DispIf to WDDM mode, err (%d)\n", err));
     104                    Log(("VBoxTray: VBoxDisplayInit: Failed to switch DispIf to WDDM mode, err (%d)\n", err));
    103105            }
    104106        }
     
    111113    else                                /* Unsupported platform */
    112114    {
    113         Log(("VBoxTray: Warning, display for platform not handled yet!\n"));
     115        Log(("VBoxTray: VBoxDisplayInit: Warning, display for platform not handled yet!\n"));
    114116        return VERR_NOT_IMPLEMENTED;
    115117    }
    116118
    117     Log(("VBoxTray: Display init successful.\n"));
     119    Log(("VBoxTray: VBoxDisplayInit: Display init successful\n"));
    118120
    119121    *pfStartThread = true;
     
    128130
    129131#ifdef VBOXWDDM
    130 static VBOXDISPLAY_DRIVER_TYPE getVBoxDisplayDriverType (VBOXDISPLAYCONTEXT *pCtx)
     132static VBOXDISPLAY_DRIVER_TYPE getVBoxDisplayDriverType(VBOXDISPLAYCONTEXT *pCtx)
    131133#else
    132 static bool isVBoxDisplayDriverActive (VBOXDISPLAYCONTEXT *pCtx)
     134static bool isVBoxDisplayDriverActive(VBOXDISPLAYCONTEXT *pCtx)
    133135#endif
    134136{
     
    146148        dispDevice.cb = sizeof(DISPLAY_DEVICE);
    147149
    148         Log(("VBoxTray: Checking for active VBox display driver (W2K+)...\n"));
     150        Log(("VBoxTray: isVBoxDisplayDriverActive: Checking for active VBox display driver (W2K+) ...\n"));
    149151
    150152        while (EnumDisplayDevices(NULL,
     
    153155                                  0))
    154156        {
    155             Log(("VBoxTray: DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\nFlags=%08X\n\n",
     157            Log(("VBoxTray: isVBoxDisplayDriverActive: DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\nFlags=%08X\n\n",
    156158                          devNum,
    157159                          &dispDevice.DeviceName[0],
     
    163165            if (dispDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
    164166            {
    165                 Log(("VBoxTray: Primary device.\n"));
     167                Log(("VBoxTray: isVBoxDisplayDriverActive: Primary device\n"));
    166168
    167169                if (strcmp(&dispDevice.DeviceString[0], "VirtualBox Graphics Adapter") == 0)
     
    185187    else    /* This must be NT 4 or something really old, so don't use EnumDisplayDevices() here  ... */
    186188    {
    187         Log(("VBoxTray: Checking for active VBox display driver (NT or older)...\n"));
     189        Log(("VBoxTray: isVBoxDisplayDriverActive: Checking for active VBox display driver (NT or older) ...\n"));
    188190
    189191        DEVMODE tempDevMode;
     
    209211
    210212/* Returns TRUE to try again. */
    211 static BOOL ResizeDisplayDevice(
    212         ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel
    213         )
     213static BOOL ResizeDisplayDevice(ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel)
    214214{
    215215    BOOL fModeReset = (Width == 0 && Height == 0 && BitsPerPixel == 0);
     
    225225    while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0))
    226226    {
    227         Log(("VBoxTray: [%d] %s\n", i, DisplayDevice.DeviceName));
     227        Log(("VBoxTray: ResizeDisplayDevice: [%d] %s\n", i, DisplayDevice.DeviceName));
    228228
    229229        if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
     
    302302                 ENUM_REGISTRY_SETTINGS, &paDeviceModes[DevNum]))
    303303            {
    304                 Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings err %d\n", GetLastError ()));
     304                Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings error %d\n", GetLastError ()));
    305305                return FALSE;
    306306            }
     
    321321                     * Do not return here, ignore the error and set the display info to 0x0x0.
    322322                     */
    323                     Log(("VBoxTray: EnumDisplaySettings(ENUM_CURRENT_SETTINGS) err %d\n", GetLastError ()));
     323                    Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings(ENUM_CURRENT_SETTINGS) error %d\n", GetLastError ()));
    324324                    ZeroMemory(&paDeviceModes[DevNum], sizeof(DEVMODE));
    325325                }
     
    443443 * requests
    444444 */
    445 unsigned __stdcall VBoxDisplayThread  (void *pInstance)
     445unsigned __stdcall VBoxDisplayThread(void *pInstance)
    446446{
     447    Log(("VBoxTray: VBoxDisplayThread: Entered\n"));
     448
    447449    VBOXDISPLAYCONTEXT *pCtx = (VBOXDISPLAYCONTEXT *)pInstance;
    448450    HANDLE gVBoxDriver = pCtx->pEnv->hDriver;
     
    453455    maskInfo.u32OrMask = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED;
    454456    maskInfo.u32NotMask = 0;
    455     if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
     457    if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
    456458    {
    457459        Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - or) succeeded\n"));
     
    465467    do
    466468    {
    467         /* wait for a display change event */
     469        /* Wait for a display change event. */
    468470        VBoxGuestWaitEventInfo waitEvent;
    469471        waitEvent.u32TimeoutIn = 1000;
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