VirtualBox

Changeset 51469 in vbox


Ignore:
Timestamp:
May 30, 2014 11:49:42 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94055
Message:

VBoxTray: Logging; ripped out all custom logging.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
16 edited

Legend:

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

    r50323 r51469  
    66
    77/*
    8  * Copyright (C) 2006-2012 Oracle Corporation
     8 * Copyright (C) 2006-2014 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323#include <strsafe.h>
    2424
     25#include <VBox/VMMDev.h>
     26#ifdef DEBUG
     27# define LOG_ENABLED
     28# define LOG_GROUP LOG_GROUP_DEFAULT
     29#endif
     30#include <VBox/log.h>
     31
     32
     33
    2534typedef struct _VBOXCLIPBOARDCONTEXT
    2635{
     
    6776        while ((format = EnumClipboardFormats (format)) != 0)
    6877        {
    69             Log(("VBoxTray: vboxClipboardChanged: format = 0x%08X\n", format));
     78            LogFlowFunc(("vboxClipboardChanged: format = 0x%08X\n", format));
    7079            switch (format)
    7180            {
     
    141150            HWND hwndNext    = (HWND)lParam;
    142151
    143             Log(("VBoxTray: vboxClipboardProcessMsg: WM_CHANGECBCHAIN: hwndRemoved %p, hwndNext %p, hwnd %p\n", hwndRemoved, hwndNext, pCtx->hwnd));
     152            LogFlowFunc(("WM_CHANGECBCHAIN: hwndRemoved %p, hwndNext %p, hwnd %p\n", hwndRemoved, hwndNext, pCtx->hwnd));
    144153
    145154            if (hwndRemoved == pCtx->hwndNextInChain)
     
    164173        case WM_DRAWCLIPBOARD:
    165174        {
    166             Log(("VBoxTray: vboxClipboardProcessMsg: WM_DRAWCLIPBOARD, hwnd %p\n", pCtx->hwnd));
     175            LogFlowFunc(("WM_DRAWCLIPBOARD, hwnd %p\n", pCtx->hwnd));
    167176
    168177            if (GetClipboardOwner () != hwnd)
     
    172181                int vboxrc = vboxClipboardChanged(pCtx);
    173182                if (RT_FAILURE(vboxrc))
    174                     Log(("VBoxTray: vboxClipboardProcessMsg: vboxClipboardChanged failed, rc = %Rrc\n", vboxrc));
     183                    LogFlowFunc(("vboxClipboardChanged failed, rc = %Rrc\n", vboxrc));
    175184            }
    176185
     
    209218            UINT format = (UINT)wParam;
    210219
    211             Log(("VBoxTray: vboxClipboardProcessMsg: WM_RENDERFORMAT, format = %x\n", format));
     220            LogFlowFunc(("WM_RENDERFORMAT, format = %x\n", format));
    212221            switch (format)
    213222            {
     
    240249            {
    241250                /* Unsupported clipboard format is requested. */
    242                 Log(("VBoxTray: vboxClipboardProcessMsg: Unsupported clipboard format requested: %ld\n", u32Format));
     251                LogFlowFunc(("Unsupported clipboard format requested: %ld\n", u32Format));
    243252                EmptyClipboard();
    244253            }
     
    250259                /* Preallocate a buffer, most of small text transfers will fit into it. */
    251260                HANDLE hMem = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, cbPrealloc);
    252                 Log(("VBoxTray: vboxClipboardProcessMsg: Preallocated handle hMem = %p\n", hMem));
     261                LogFlowFunc(("Preallocated handle hMem = %p\n", hMem));
    253262
    254263                if (hMem)
    255264                {
    256265                    void *pMem = GlobalLock(hMem);
    257                     Log(("VBoxTray: vboxClipboardProcessMsg: Locked pMem = %p, GlobalSize = %ld\n", pMem, GlobalSize(hMem)));
     266                    LogFlowFunc(("Locked pMem = %p, GlobalSize = %ld\n", pMem, GlobalSize(hMem)));
    258267
    259268                    if (pMem)
     
    261270                        /* Read the host data to the preallocated buffer. */
    262271                        int vboxrc = VbglR3ClipboardReadData(pCtx->u32ClientID, u32Format, pMem, cbPrealloc, &cb);
    263                         Log(("VBoxTray: vboxClipboardProcessMsg: VbglR3ClipboardReadData returned with rc = %Rrc\n",  vboxrc));
     272                        LogFlowFunc(("VbglR3ClipboardReadData returned with rc = %Rrc\n",  vboxrc));
    264273
    265274                        if (RT_SUCCESS(vboxrc))
     
    280289                                /* The preallocated buffer is too small, adjust the size. */
    281290                                hMem = GlobalReAlloc(hMem, cb, 0);
    282                                 Log(("VBoxTray: vboxClipboardProcessMsg: Reallocated hMem = %p\n", hMem));
     291                                LogFlowFunc(("Reallocated hMem = %p\n", hMem));
    283292
    284293                                if (hMem)
    285294                                {
    286295                                    pMem = GlobalLock(hMem);
    287                                     Log(("VBoxTray: vboxClipboardProcessMsg: Locked pMem = %p, GlobalSize = %ld\n", pMem, GlobalSize(hMem)));
     296                                    LogFlowFunc(("Locked pMem = %p, GlobalSize = %ld\n", pMem, GlobalSize(hMem)));
    288297
    289298                                    if (pMem)
     
    292301                                        uint32_t cbNew = 0;
    293302                                        vboxrc = VbglR3ClipboardReadData(pCtx->u32ClientID, u32Format, pMem, cb, &cbNew);
    294                                         Log(("VBoxTray: VbglR3ClipboardReadData returned with rc = %Rrc, cb = %d, cbNew = %d\n", vboxrc, cb, cbNew));
     303                                        LogFlowFunc(("VbglR3ClipboardReadData returned with rc = %Rrc, cb = %d, cbNew = %d\n", vboxrc, cb, cbNew));
    295304
    296305                                        if (RT_SUCCESS (vboxrc) && cbNew <= cb)
     
    345354
    346355                                hMem = GlobalReAlloc(hMem, cb, 0);
    347                                 Log(("VBoxTray: vboxClipboardProcessMsg: Reallocated hMem = %p\n", hMem));
     356                                LogFlowFunc(("Reallocated hMem = %p\n", hMem));
    348357
    349358                                if (hMem)
     
    352361                                     * size is 'cb' and format is 'format'. */
    353362                                    HANDLE hClip = SetClipboardData(format, hMem);
    354                                     Log(("VBoxTray: vboxClipboardProcessMsg: WM_RENDERFORMAT hClip = %p\n", hClip));
     363                                    LogFlowFunc(("WM_RENDERFORMAT hClip = %p\n", hClip));
    355364
    356365                                    if (hClip)
     
    395404            if (FALSE == OpenClipboard(hwnd))
    396405            {
    397                 Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER: Failed to open clipboard! Last error = %ld\n", GetLastError()));
     406                LogFlowFunc(("WM_USER: Failed to open clipboard! Last error = %ld\n", GetLastError()));
    398407            }
    399408            else
     
    405414                if (u32Formats & VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT)
    406415                {
    407                     Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n"));
     416                    LogFlowFunc(("WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n"));
    408417                    hClip = SetClipboardData(CF_UNICODETEXT, NULL);
    409418                }
     
    411420                if (u32Formats & VBOX_SHARED_CLIPBOARD_FMT_BITMAP)
    412421                {
    413                     Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n"));
     422                    LogFlowFunc(("WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n"));
    414423                    hClip = SetClipboardData(CF_DIB, NULL);
    415424                }
     
    418427                {
    419428                    UINT format = RegisterClipboardFormat ("HTML Format");
    420                     Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER: VBOX_SHARED_CLIPBOARD_FMT_HTML 0x%04X\n", format));
     429                    LogFlowFunc(("WM_USER: VBOX_SHARED_CLIPBOARD_FMT_HTML 0x%04X\n", format));
    421430                    if (format != 0)
    422431                    {
     
    426435
    427436                CloseClipboard();
    428                 Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER: hClip = %p, err = %ld\n", hClip, GetLastError ()));
     437                LogFlowFunc(("WM_USER: hClip = %p, err = %ld\n", hClip, GetLastError ()));
    429438            }
    430439        } break;
     
    438447            if (FALSE == OpenClipboard(hwnd))
    439448            {
    440                 Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER: Failed to open clipboard! Last error = %ld\n", GetLastError()));
     449                LogFlowFunc(("WM_USER: Failed to open clipboard! Last error = %ld\n", GetLastError()));
    441450            }
    442451            else
     
    452461                        if (lp != NULL)
    453462                        {
    454                             Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER + 1: CF_DIB\n"));
     463                            LogFlowFunc(("WM_USER + 1: CF_DIB\n"));
    455464                            vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_BITMAP,
    456465                                                              lp, GlobalSize(hClip));
     
    473482                        if (uniString != NULL)
    474483                        {
    475                             Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER + 1: CF_UNICODETEXT\n"));
     484                            LogFlowFunc(("WM_USER + 1: CF_UNICODETEXT\n"));
    476485                            vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT,
    477486                                                              uniString, (lstrlenW(uniString) + 1) * 2);
     
    496505                            if (lp != NULL)
    497506                            {
    498                                 Log(("VBoxTray: vboxClipboardProcessMsg: WM_USER + 1: CF_HTML\n"));
     507                                LogFlowFunc(("WM_USER + 1: CF_HTML\n"));
    499508                                vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_HTML,
    500509                                                                  lp, GlobalSize(hClip));
     
    526535
    527536#ifndef DEBUG_andy
    528     Log(("VBoxTray: vboxClipboardProcessMsg returned with rc = %ld\n", rc));
     537    LogFlowFunc(("vboxClipboardProcessMsg returned with rc = %ld\n", rc));
    529538#endif
    530539    return rc;
     
    578587    }
    579588
    580     Log(("VBoxTray: vboxClipboardInit returned with rc = %Rrc\n", rc));
     589    LogFlowFunc(("vboxClipboardInit returned with rc = %Rrc\n", rc));
    581590    return rc;
    582591}
     
    612621int VBoxClipboardInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread)
    613622{
    614     Log(("VBoxTray: VBoxClipboardInit\n"));
     623    LogFlowFunc(("VBoxClipboardInit\n"));
    615624    if (gCtx.pEnv)
    616625    {
     
    651660unsigned __stdcall VBoxClipboardThread(void *pInstance)
    652661{
    653     Log(("VBoxTray: VBoxClipboardThread\n"));
     662    LogFlowFunc(("VBoxClipboardThread\n"));
    654663
    655664    VBOXCLIPBOARDCONTEXT *pCtx = (VBOXCLIPBOARDCONTEXT *)pInstance;
     
    664673        if (RT_FAILURE(rc))
    665674        {
    666             Log(("VBoxTray: VBoxClipboardThread: Failed to call the driver for host message! rc = %Rrc\n", rc));
     675            LogFlowFunc(("VBoxClipboardThread: Failed to call the driver for host message! rc = %Rrc\n", rc));
    667676            if (rc == VERR_INTERRUPTED)
    668677            {
     
    681690        else
    682691        {
    683             Log(("VBoxTray: VBoxClipboardThread: VbglR3ClipboardGetHostMsg u32Msg = %ld, u32Formats = %ld\n", u32Msg, u32Formats));
     692            LogFlowFunc(("VBoxClipboardThread: VbglR3ClipboardGetHostMsg u32Msg = %ld, u32Formats = %ld\n", u32Msg, u32Formats));
    684693            switch (u32Msg)
    685694            {
     
    706715                default:
    707716                {
    708                     Log(("VBoxTray: VBoxClipboardThread: Unsupported message from host! Message = %ld\n", u32Msg));
     717                    LogFlowFunc(("VBoxClipboardThread: Unsupported message from host! Message = %ld\n", u32Msg));
    709718                }
    710719            }
     
    719728    if (pCtx != &gCtx)
    720729    {
    721         Log(("VBoxTray: VBoxClipboardDestroy: invalid instance %p (our = %p)!\n", pCtx, &gCtx));
     730        LogFlowFunc(("VBoxClipboardDestroy: invalid instance %p (our = %p)!\n", pCtx, &gCtx));
    722731        pCtx = &gCtx;
    723732    }
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp

    r49010 r51469  
    11/** @file
    2  * VBoxTray - Display Settings Interface abstraction for XPDM & WDDM
     2 * VBoxDispIf.cpp - Display Settings Interface abstraction for XPDM & WDDM.
    33 */
    44
    55/*
    6  * Copyright (C) 2006-2012 Oracle Corporation
     6 * Copyright (C) 2006-2014 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1414 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1515 */
    16 
    1716#include "VBoxTray.h"
     17#include "VBoxDisplay.h"
     18
     19#include <malloc.h>
    1820#define _WIN32_WINNT 0x0601
     21
    1922#include <iprt/log.h>
    2023#include <iprt/err.h>
    2124#include <iprt/assert.h>
    2225
    23 #include <malloc.h>
    24 
    2526#ifdef VBOX_WITH_WDDM
    2627#include <iprt/asm.h>
    2728#endif
    2829
    29 #include "VBoxDisplay.h"
     30
    3031
    3132#ifndef NT_SUCCESS
     
    8485    if (winEr != ERROR_SUCCESS)
    8586    {
    86         WARN(("VBoxTray: (WDDM) Failed GetDisplayConfigBufferSizes\n"));
     87        LogFlowFunc(("Failed calling GetDisplayConfigBufferSizes, dwErr=%ld\n", winEr));
    8788        return winEr;
    8889    }
    8990
     91    /** @todo r=andy Why using malloc() instead of RTMemAlloc*? */
    9092    pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(cPathInfoArray * sizeof(DISPLAYCONFIG_PATH_INFO));
    9193    if (!pPathInfoArray)
    9294    {
    93         WARN(("VBoxTray: (WDDM) malloc failed!\n"));
     95        LogFlowFunc(("Allocating pPathInfoArray failed\n"));
    9496        return ERROR_OUTOFMEMORY;
    9597    }
     
    9799    if (!pModeInfoArray)
    98100    {
    99         WARN(("VBoxTray: (WDDM) malloc failed!\n"));
     101        LogFlowFunc(("Allocating pModeInfoArray failed\n"));
    100102        free(pPathInfoArray);
    101103        return ERROR_OUTOFMEMORY;
     
    105107    if (winEr != ERROR_SUCCESS)
    106108    {
    107         WARN(("VBoxTray: (WDDM) Failed QueryDisplayConfig\n"));
     109        LogFlowFunc(("Failed calling QueryDisplayConfig, dwErr=%ld\n", winEr));
    108110        free(pPathInfoArray);
    109111        free(pModeInfoArray);
     
    122124    memset(pCfgDst, 0, sizeof (*pCfgDst));
    123125
     126    /** @todo r=andy Why using malloc() instead of RTMemAlloc*? */
    124127    if (pCfg->cPathInfoArray)
    125128    {
     
    127130        if (!pCfgDst->pPathInfoArray)
    128131        {
    129             WARN(("VBoxTray: (WDDM) malloc failed!\n"));
     132            LogFlowFunc(("malloc failed!\n"));
    130133            return ERROR_OUTOFMEMORY;
    131134        }
     
    141144        if (!pCfgDst->pModeInfoArray)
    142145        {
    143             WARN(("VBoxTray: (WDDM) malloc failed!\n"));
     146            LogFlowFunc(("malloc failed!\n"));
    144147            if (pCfgDst->pPathInfoArray)
    145148            {
     
    179182        if (winEr != ERROR_SUCCESS)
    180183        {
    181             WARN(("VBoxTray:(WDDM) vboxDispIfWddmDcCreate Failed winEr %d\n", winEr));
     184            LogFlowFunc(("vboxDispIfWddmDcCreate failed winEr %ld\n", winEr));
    182185            return winEr;
    183186        }
     
    255258    if (!pModeInfoArray)
    256259    {
    257         WARN(("VBoxTray: (WDDM) malloc failed!\n"));
     260        LogFlowFunc(("malloc failed!\n"));
    258261        return ERROR_OUTOFMEMORY;
    259262    }
     
    280283        {
    281284
    282             WARN(("VBoxTray: (WDDM) no source mode index specified"));
     285            LogFlowFunc(("no source mode index specified"));
    283286            DWORD winEr = vboxDispIfWddmDcSettingsModeAdd(pCfg, &iSrcMode);
    284287            if (winEr != ERROR_SUCCESS)
    285288            {
    286                 WARN(("VBoxTray:(WDDM) vboxDispIfWddmDcSettingsModeAdd Failed winEr %d\n", winEr));
     289                LogFlowFunc(("vboxDispIfWddmDcSettingsModeAdd Failed winEr %d\n", winEr));
    287290                return winEr;
    288291            }
     
    298301            {
    299302                /* this is something we're not expecting/supporting */
    300                 WARN(("VBoxTray: (WDDM) multiple paths have the same mode index"));
     303                LogFlowFunc(("multiple paths have the same mode index"));
    301304                return ERROR_NOT_SUPPORTED;
    302305            }
     
    329332                    break;
    330333                default:
    331                     LogRel(("VBoxTray: (WDDM) invalid bpp %d, using 32\n", pDeviceMode->dmBitsPerPel));
     334                    LogRel(("invalid bpp %d, using 32\n", pDeviceMode->dmBitsPerPel));
    332335                    pCfg->pModeInfoArray[iSrcMode].sourceMode.pixelFormat = DISPLAYCONFIG_PIXELFORMAT_32BPP;
    333336                    break;
     
    350353    DWORD winEr = gCtx.pfnSetDisplayConfig(pCfg->cPathInfoArray, pCfg->pPathInfoArray, pCfg->cModeInfoArray, pCfg->pModeInfoArray, fFlags);
    351354    if (winEr != ERROR_SUCCESS)
    352         Log(("VBoxTray:(WDDM) pfnSetDisplayConfig Failed for Flags 0x%x\n", fFlags));
     355        LogFlowFunc(("pfnSetDisplayConfig Failed for Flags 0x%x\n", fFlags));
    353356    return winEr;
    354357}
     
    394397    if (winEr != ERROR_SUCCESS)
    395398    {
    396         WARN(("VBoxTray:(WDDM) vboxDispIfWddmDcQueryNumDisplays Failed winEr %d\n", winEr));
     399        LogFlowFunc(("vboxDispIfWddmDcQueryNumDisplays Failed winEr %d\n", winEr));
    397400        return winEr;
    398401    }
     
    401404    if (!pPathInfoArray)
    402405    {
    403         WARN(("malloc failed\n"));
     406        LogFlowFunc(("malloc failed\n"));
    404407        return ERROR_OUTOFMEMORY;
    405408    }
     
    413416            if (idx >= 0)
    414417            {
    415                 WARN(("VBoxTray:(WDDM) different source and target paare enabled, this is something we would not expect\n"));
     418                LogFlowFunc(("different source and target paare enabled, this is something we would not expect\n"));
    416419            }
    417420        }
     
    426429                if (winEr != ERROR_SUCCESS)
    427430                {
    428                     WARN(("VBoxTray:(WDDM) vboxDispIfWddmDcCreate Failed winEr %d\n", winEr));
     431                    LogFlowFunc(("vboxDispIfWddmDcCreate Failed winEr %d\n", winEr));
    429432                    free(pPathInfoArray);
    430433                    return winEr;
     
    436439            if (idx < 0)
    437440            {
    438                 WARN(("VBoxTray:(WDDM) %d %d path not supported\n", i, i));
     441                LogFlowFunc(("%d %d path not supported\n", i, i));
    439442                idx = vboxDispIfWddmDcSearchPath(pCfg, -1, i);
    440443                if (idx < 0)
    441444                {
    442                     WARN(("VBoxTray:(WDDM) %d %d path not supported\n", -1, i));
     445                    LogFlowFunc(("%d %d path not supported\n", -1, i));
    443446                }
    444447            }
     
    450453                if (pPathInfoArray[i].flags & DISPLAYCONFIG_PATH_ACTIVE)
    451454                {
    452                     WARN(("VBoxTray:(WDDM) disabled path %d %d is marked active\n",
     455                    LogFlowFunc(("disabled path %d %d is marked active\n",
    453456                            pPathInfoArray[i].sourceInfo.id, pPathInfoArray[i].targetInfo.id));
    454457                    pPathInfoArray[i].flags &= ~DISPLAYCONFIG_PATH_ACTIVE;
     
    518521                return ERROR_SUCCESS;
    519522            else
    520                 WARN(("VBoxTray: vboxDispKmtCreateContext failed hr 0x%x", hr));
     523                LogFlowFunc(("vboxDispKmtCreateContext failed hr 0x%x", hr));
    521524
    522525            vboxDispKmtDestroyDevice(&pOp->Device);
    523526        }
    524527        else
    525             WARN(("VBoxTray: vboxDispKmtCreateDevice failed hr 0x%x", hr));
     528            LogFlowFunc(("vboxDispKmtCreateDevice failed hr 0x%x", hr));
    526529
    527530        vboxDispKmtCloseAdapter(&pOp->Adapter);
     
    597600    if (OSinfo.dwMajorVersion >= 6)
    598601    {
    599         Log((__FUNCTION__": this is vista and up\n"));
     602        LogFlowFunc(("this is vista and up\n"));
    600603        HMODULE hUser = GetModuleHandle("user32.dll");
    601604        if (hUser)
    602605        {
    603606            *(uintptr_t *)&pIf->modeData.wddm.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA");
    604             Log((__FUNCTION__": VBoxDisplayInit: pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.wddm.pfnChangeDisplaySettingsEx));
     607            LogFlowFunc(("pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.wddm.pfnChangeDisplaySettingsEx));
    605608            bSupported &= !!(pIf->modeData.wddm.pfnChangeDisplaySettingsEx);
    606609
    607610            *(uintptr_t *)&pIf->modeData.wddm.pfnEnumDisplayDevices = (uintptr_t)GetProcAddress(hUser, "EnumDisplayDevicesA");
    608             Log((__FUNCTION__": VBoxDisplayInit: pfnEnumDisplayDevices = %p\n", pIf->modeData.wddm.pfnEnumDisplayDevices));
     611            LogFlowFunc(("pfnEnumDisplayDevices = %p\n", pIf->modeData.wddm.pfnEnumDisplayDevices));
    609612            bSupported &= !!(pIf->modeData.wddm.pfnEnumDisplayDevices);
    610613            /* for win 7 and above */
     
    612615            {
    613616                *(uintptr_t *)&gCtx.pfnSetDisplayConfig = (uintptr_t)GetProcAddress(hUser, "SetDisplayConfig");
    614                 Log((__FUNCTION__": VBoxDisplayInit: pfnSetDisplayConfig = %p\n", gCtx.pfnSetDisplayConfig));
     617                LogFlowFunc(("pfnSetDisplayConfig = %p\n", gCtx.pfnSetDisplayConfig));
    615618                bSupported &= !!(gCtx.pfnSetDisplayConfig);
    616619
    617620                *(uintptr_t *)&gCtx.pfnQueryDisplayConfig = (uintptr_t)GetProcAddress(hUser, "QueryDisplayConfig");
    618                 Log((__FUNCTION__": VBoxDisplayInit: pfnQueryDisplayConfig = %p\n", gCtx.pfnQueryDisplayConfig));
     621                LogFlowFunc(("pfnQueryDisplayConfig = %p\n", gCtx.pfnQueryDisplayConfig));
    619622                bSupported &= !!(gCtx.pfnQueryDisplayConfig);
    620623
    621624                *(uintptr_t *)&gCtx.pfnGetDisplayConfigBufferSizes = (uintptr_t)GetProcAddress(hUser, "GetDisplayConfigBufferSizes");
    622                 Log((__FUNCTION__": VBoxDisplayInit: pfnGetDisplayConfigBufferSizes = %p\n", gCtx.pfnGetDisplayConfigBufferSizes));
     625                LogFlowFunc(("pfnGetDisplayConfigBufferSizes = %p\n", gCtx.pfnGetDisplayConfigBufferSizes));
    623626                bSupported &= !!(gCtx.pfnGetDisplayConfigBufferSizes);
    624627            }
     
    628631            if (FAILED(hr))
    629632            {
    630                 WARN(("VBoxTray: vboxDispKmtCallbacksInit failed hr 0x%x\n", hr));
     633                LogFlowFunc(("vboxDispKmtCallbacksInit failed hr 0x%x\n", hr));
    631634                err = hr;
    632635            }
     
    634637        else
    635638        {
    636             WARN((__FUNCTION__": GetModuleHandle(USER32) failed, err(%d)\n", GetLastError()));
     639            LogFlowFunc(("GetModuleHandle(USER32) failed, err(%d)\n", GetLastError()));
    637640            err = ERROR_NOT_SUPPORTED;
    638641        }
     
    640643    else
    641644    {
    642         WARN((__FUNCTION__": can not switch to VBOXDISPIF_MODE_WDDM, because os is not Vista or upper\n"));
     645        LogFlowFunc(("Could not switch to VBOXDISPIF_MODE_WDDM, because os is not Vista or upper\n"));
    643646        err = ERROR_NOT_SUPPORTED;
    644647    }
     
    679682                {
    680683                    winEr = GetLastError();
    681                     WARN(("CreateDC failed %d", winEr));
     684                    LogFlowFunc(("CreateDC failed %d", winEr));
    682685                    break;
    683686                }
    684687            }
    685             Log(("display data no match display(%d): i(%d), flags(%d)", iDisplay, i, pDev->StateFlags));
     688            LogFlowFunc(("display data no match display(%d): i(%d), flags(%d)", iDisplay, i, pDev->StateFlags));
    686689        }
    687690        else
    688691        {
    689692            winEr = GetLastError();
    690             WARN(("EnumDisplayDevices failed %d", winEr));
     693            LogFlowFunc(("EnumDisplayDevices failed %d", winEr));
    691694            break;
    692695        }
    693696    }
    694697
    695     WARN(("vboxDispIfWDDMAdpHdcCreate failure branch %d", winEr));
     698    LogFlowFunc(("vboxDispIfWDDMAdpHdcCreate failure branch %d", winEr));
    696699    return winEr;
    697700}
     
    704707    if (!SUCCEEDED(hr))
    705708    {
    706         WARN(("VBoxTray: vboxDispKmtOpenAdapter failed hr 0x%x\n", hr));
     709        LogFlowFunc(("vboxDispKmtOpenAdapter failed hr 0x%x\n", hr));
    707710        return hr;
    708711    }
     
    723726    else
    724727    {
    725         WARN(("VBoxTray: pfnD3DKMTEscape failed Status 0x%x\n", Status));
     728        LogFlowFunc(("pfnD3DKMTEscape failed Status 0x%x\n", Status));
    726729        winEr = ERROR_GEN_FAILURE;
    727730    }
     
    746749#endif
    747750        default:
    748             Log((__FUNCTION__": unknown mode (%d)\n", pIf->enmMode));
     751            LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode));
    749752            return ERROR_INVALID_PARAMETER;
    750753    }
     
    764767#endif
    765768        default:
    766             Log((__FUNCTION__": unknown mode (%d)\n", pIf->enmMode));
     769            LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode));
    767770            return ERROR_INVALID_PARAMETER;
    768771    }
     
    848851    pMon->fExtDispSup = fExtDispSup;
    849852
     853    /** @todo r=andy Why using malloc() instead of RTMemAlloc*? */
    850854    if (cDevModes)
    851855    {
     
    854858        if (!pMon->paDisplayDevices)
    855859        {
    856             Log(("malloc failed!"));
     860            LogFlowFunc(("malloc failed"));
    857861            vboxRrRetryStopLocked();
    858862            LeaveCriticalSection(&pMon->CritSect);
     
    865869        if (!pMon->paDeviceModes)
    866870        {
    867             Log(("malloc failed!"));
     871            LogFlowFunc(("malloc failed"));
    868872            vboxRrRetryStopLocked();
    869873            LeaveCriticalSection(&pMon->CritSect);
     
    878882    if (!pMon->idTimer)
    879883    {
    880         WARN(("VBoxTray: SetTimer failed!, err %d\n", GetLastError()));
     884        LogFlowFunc(("SetTimer failed, err %ld\n", GetLastError()));
    881885        vboxRrRetryStopLocked();
    882886    }
     
    910914        case WM_DISPLAYCHANGE:
    911915        {
    912             Log(("VBoxTray: WM_DISPLAYCHANGE\n"));
     916            LogFlowFunc(("WM_DISPLAYCHANGE\n"));
    913917            VBoxRrRetryStop();
    914918            return 0;
     
    918922            if (wParam == VBOXRR_TIMER_ID)
    919923            {
    920                 Log(("VBoxTray: VBOXRR_TIMER_ID\n"));
     924                LogFlowFunc(("VBOXRR_TIMER_ID\n"));
    921925                vboxRrRetryPerform();
    922926                return 0;
     
    925929        }
    926930        case WM_CLOSE:
    927             Log((__FUNCTION__": got WM_CLOSE for hwnd(0x%x)", hwnd));
     931            LogFlowFunc(("got WM_CLOSE for hwnd(0x%x)", hwnd));
    928932            return 0;
    929933        case WM_DESTROY:
    930             Log((__FUNCTION__": got WM_DESTROY for hwnd(0x%x)", hwnd));
     934            LogFlowFunc(("got WM_DESTROY for hwnd(0x%x)", hwnd));
    931935            return 0;
    932936        case WM_NCHITTEST:
    933             Log((__FUNCTION__": got WM_NCHITTEST for hwnd(0x%x)\n", hwnd));
     937            LogFlowFunc(("got WM_NCHITTEST for hwnd(0x%x)\n", hwnd));
    934938            return HTNOWHERE;
    935939        default:
     
    963967        {
    964968            DWORD winErr = GetLastError();
    965             WARN((__FUNCTION__": RegisterClass failed, winErr(%d)\n", winErr));
     969            LogFlowFunc(("RegisterClass failed, winErr(%d)\n", winErr));
    966970            hr = E_FAIL;
    967971        }
     
    987991        {
    988992            DWORD winErr = GetLastError();
    989             WARN((__FUNCTION__": CreateWindowEx failed, winErr(%d)\n", winErr));
     993            LogFlowFunc(("CreateWindowEx failed, winErr(%d)\n", winErr));
    990994            hr = E_FAIL;
    991995        }
     
    10021006
    10031007    DWORD winErr = GetLastError();
    1004     WARN((__FUNCTION__": DestroyWindow failed, winErr(%d) for hWnd(0x%x)\n", winErr, hWnd));
     1008    LogFlowFunc(("DestroyWindow failed, winErr(%d) for hWnd(0x%x)\n", winErr, hWnd));
    10051009
    10061010    return HRESULT_FROM_WIN32(winErr);
     
    10511055        {
    10521056            hr = S_FALSE;
    1053             Log(("VBoxTray: GetMessage returned FALSE\n"));
     1057            LogFlowFunc(("GetMessage returned FALSE\n"));
    10541058            VBoxRrRetryStop();
    10551059            break;
     
    10651069            if (hr == S_OK || hr == S_FALSE)
    10661070                hr = E_FAIL;
    1067             WARN(("VBoxTray: GetMessage returned -1, err %d\n", winEr));
     1071            LogFlowFunc(("GetMessage returned -1, err %d\n", winEr));
    10681072            VBoxRrRetryStop();
    10691073            break;
     
    10751079            case WM_CLOSE:
    10761080            {
    1077                 Log(("VBoxTray: closing Rr %d\n", Msg.message));
     1081                LogFlowFunc(("closing Rr %d\n", Msg.message));
    10781082                VBoxRrRetryStop();
    10791083                PostQuitMessage(0);
     
    10971101    {
    10981102        DWORD winErr = GetLastError();
    1099         WARN((__FUNCTION__": SetEvent failed, winErr = (%d)", winErr));
     1103        LogFlowFunc(("SetEvent failed, winErr = (%d)", winErr));
    11001104        HRESULT tmpHr = HRESULT_FROM_WIN32(winErr);
    11011105        Assert(tmpHr != S_OK);
     
    11431147            else
    11441148            {
    1145                 Log(("WaitForSingleObject failed!"));
     1149                LogFlowFunc(("WaitForSingleObject failed"));
    11461150                hr = E_FAIL;
    11471151            }
     
    11501154        {
    11511155            DWORD winErr = GetLastError();
    1152             WARN((__FUNCTION__": CreateThread failed, winErr = (%d)", winErr));
     1156            LogFlowFunc(("CreateThread failed, winErr = (%d)", winErr));
    11531157            hr = HRESULT_FROM_WIN32(winErr);
    11541158            Assert(hr != S_OK);
     
    11591163    {
    11601164        DWORD winErr = GetLastError();
    1161         WARN((__FUNCTION__": CreateEvent failed, winErr = (%d)", winErr));
     1165        LogFlowFunc(("CreateEvent failed, winErr = (%d)", winErr));
    11621166        hr = HRESULT_FROM_WIN32(winErr);
    11631167        Assert(hr != S_OK);
     
    12121216        return ERROR_SUCCESS;
    12131217    }
    1214     WARN(("VBoxTray: VBoxRrInit failed hr 0x%x\n", hr));
     1218    LogFlowFunc(("VBoxRrInit failed hr 0x%x\n", hr));
    12151219    return hr;
    12161220}
     
    12361240    if (winEr != ERROR_SUCCESS)
    12371241    {
    1238         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));
     1242        LogFlowFunc(("Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));
    12391243        return winEr;
    12401244    }
     
    12611265        if (Status != 0)
    12621266        {
    1263             Log(("VBoxTray: (WDDM) pfnD3DKMTPollDisplayChildren failed, Status (0x%x)\n", Status));
     1267            LogFlowFunc(("pfnD3DKMTPollDisplayChildren failed, Status (0x%x)\n", Status));
    12641268            continue;
    12651269        }
     
    12761280            if (winEr != ERROR_SUCCESS)
    12771281            {
    1278                 WARN(("VBoxTray: (WDDM) Failed vboxDispIfQueryDisplayConnection winEr %d\n", winEr));
     1282                LogFlowFunc(("Failed vboxDispIfQueryDisplayConnection winEr %d\n", winEr));
    12791283                return winEr;
    12801284            }
     
    12821286            if (!fConnected)
    12831287            {
    1284                 WARN(("VBoxTray: (WDDM) Display %d not connected, not expected\n", i));
     1288                LogFlowFunc(("Display %d not connected, not expected\n", i));
    12851289                fFound = TRUE;
    12861290                break;
     
    13191323    else
    13201324    {
    1321         WARN(("VBoxTray: pfnD3DKMTEscape VBOXESC_REINITVIDEOMODESBYMASK failed Status 0x%x\n", Status));
     1325        LogFlowFunc(("pfnD3DKMTEscape VBOXESC_REINITVIDEOMODESBYMASK failed Status 0x%x\n", Status));
    13221326        winEr = ERROR_GEN_FAILURE;
    13231327    }
     
    13251329    winEr =  vboxDispIfWaitDisplayDataInited(pOp, pScreenIdMask);
    13261330    if (winEr != NO_ERROR)
    1327         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWaitDisplayDataInited winEr %d\n", winEr));
     1331        LogFlowFunc(("Failed vboxDispIfWaitDisplayDataInited winEr %d\n", winEr));
    13281332
    13291333    return winEr;
     
    13321336DWORD vboxDispIfCancelPendingResizeWDDM(PCVBOXDISPIF const pIf)
    13331337{
    1334     Log(("VBoxTray: cancelling pending resize\n"));
     1338    LogFlowFunc(("cancelling pending resize\n"));
    13351339    VBoxRrRetryStop();
    13361340    return NO_ERROR;
     
    13481352        tempDevMode.dmSize = sizeof(DEVMODE);
    13491353        EnumDisplaySettings((LPSTR)paDisplayDevices[i].DeviceName, 0xffffff, &tempDevMode);
    1350         Log(("VBoxTray: ResizeDisplayDevice: EnumDisplaySettings last error %d\n", GetLastError ()));
     1354        LogFlowFunc(("ResizeDisplayDevice: EnumDisplaySettings last error %d\n", GetLastError ()));
    13511355    }
    13521356
     
    13541358            paDeviceModes[iChangedMode].dmBitsPerPel, paDeviceModes[iChangedMode].dmPosition.x, paDeviceModes[iChangedMode].dmPosition.y, fEnable, fExtDispSup);
    13551359    if (winEr != NO_ERROR)
    1356         WARN(("VBoxTray: (WDDM) Failed EnableAndResizeDispDev winEr %d\n", winEr));
     1360        LogFlowFunc(("Failed EnableAndResizeDispDev winEr %d\n", winEr));
    13571361
    13581362    return winEr;
     
    13661370        winEr = vboxDispIfWddmResizeDisplay(pIf, iChangedMode, fEnable, paDisplayDevices, paDeviceModes, cDevModes);
    13671371        if (winEr != NO_ERROR)
    1368             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmResizeDisplay winEr %d\n", winEr));
     1372            LogFlowFunc(("Failed vboxDispIfWddmResizeDisplay winEr %d\n", winEr));
    13691373    }
    13701374    else
     
    13721376        winEr = vboxDispIfWddmResizeDisplayVista(paDeviceModes, paDisplayDevices, cDevModes, iChangedMode, fEnable, fExtDispSup);
    13731377        if (winEr != NO_ERROR)
    1374             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmResizeDisplayVista winEr %d\n", winEr));
     1378            LogFlowFunc(("Failed vboxDispIfWddmResizeDisplayVista winEr %d\n", winEr));
    13751379    }
    13761380    return winEr;
     
    13861390    UINT i = 0;
    13871391
    1388     Log(("VBoxTray: vboxDispIfResizeModesWDDM\n"));
     1392    LogFlowFunc(("vboxDispIfResizeModesWDDM\n"));
    13891393    VBoxRrRetryStop();
    13901394
     
    13941398    if (winEr != NO_ERROR)
    13951399    {
    1396         WARN(("VBoxTray: vboxDispIfOpBegin failed winEr 0x%x", winEr));
     1400        LogFlowFunc(("vboxDispIfOpBegin failed winEr 0x%x", winEr));
    13971401        return winEr;
    13981402    }
     
    14311435    if (winEr != ERROR_SUCCESS)
    14321436    {
    1433         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));
     1437        LogFlowFunc(("Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));
    14341438        return winEr;
    14351439    }
     
    14391443    if (!pChangeIds)
    14401444    {
    1441         WARN(("VBoxTray: (WDDM) Failed to alloc change ids\n"));
     1445        LogFlowFunc(("Failed to alloc change ids\n"));
    14421446        winEr = ERROR_OUTOFMEMORY;
    14431447        goto done;
     
    14711475    if (cChangeIds == 0)
    14721476    {
    1473         Log(("VBoxTray: (WDDM) vboxDispIfWddmEnableDisplay: settings are up to date\n"));
     1477        LogFlowFunc(("vboxDispIfWddmEnableDisplay: settings are up to date\n"));
    14741478        winEr = ERROR_SUCCESS;
    14751479        goto done;
     
    14801484    if (winEr != ERROR_SUCCESS)
    14811485    {
    1482         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcSettingsIncludeAllTargets winEr %d\n", winEr));
     1486        LogFlowFunc(("Failed vboxDispIfWddmDcSettingsIncludeAllTargets winEr %d\n", winEr));
    14831487        return winEr;
    14841488    }
     
    14941498        if (iPath < 0)
    14951499        {
    1496             WARN(("VBoxTray: (WDDM) path index not found while it should"));
     1500            LogFlowFunc(("path index not found while it should"));
    14971501            winEr = ERROR_GEN_FAILURE;
    14981502            goto done;
     
    15021506        if (winEr != ERROR_SUCCESS)
    15031507        {
    1504             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr));
     1508            LogFlowFunc(("Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr));
    15051509            goto done;
    15061510        }
     
    15151519    if (iPath < 0)
    15161520    {
    1517         WARN(("VBoxTray: (WDDM) path index not found while it should"));
     1521        LogFlowFunc(("path index not found while it should"));
    15181522        winEr = ERROR_GEN_FAILURE;
    15191523        goto done;
     
    15231527    if (winEr != ERROR_SUCCESS)
    15241528    {
    1525         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr));
     1529        LogFlowFunc(("Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr));
    15261530        goto done;
    15271531    }
     
    15341538        if (!fSetTopology)
    15351539        {
    1536             WARN(("VBoxTray: (WDDM) vboxDispIfWddmDcSet validation failed winEr, trying with changes %d\n", winEr));
     1540            LogFlowFunc(("vboxDispIfWddmDcSet validation failed winEr, trying with changes %d\n", winEr));
    15371541            fSetFlags |= SDC_ALLOW_CHANGES;
    15381542        }
    15391543        else
    15401544        {
    1541             Log(("VBoxTray: (WDDM) vboxDispIfWddmDcSet topology validation failed winEr %d\n", winEr));
     1545            LogFlowFunc(("vboxDispIfWddmDcSet topology validation failed winEr %d\n", winEr));
    15421546            goto done;
    15431547        }
     
    15491553    winEr = vboxDispIfWddmDcSet(&DispCfg, fSetFlags | SDC_APPLY);
    15501554    if (winEr != ERROR_SUCCESS)
    1551         WARN(("VBoxTray: (WDDM) vboxDispIfWddmDcSet apply failed winEr %d\n", winEr));
     1555        LogFlowFunc(("vboxDispIfWddmDcSet apply failed winEr %d\n", winEr));
    15521556
    15531557done:
     
    15631567    {
    15641568        if (fEnable)
    1565             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));
     1569            LogFlowFunc(("Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));
    15661570        else
    1567             Log(("VBoxTray: (WDDM) Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));
     1571            LogFlowFunc(("Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));
    15681572        winEr = vboxDispIfWddmEnableDisplays(pIf, cIds, pIds, fEnable, TRUE, NULL);
    15691573        if (winEr != ERROR_SUCCESS)
    1570             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));
     1574            LogFlowFunc(("Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));
    15711575    }
    15721576
     
    15831587    if (winEr != ERROR_SUCCESS)
    15841588    {
    1585         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcCreate\n"));
     1589        LogFlowFunc(("Failed vboxDispIfWddmDcCreate\n"));
    15861590        return winEr;
    15871591    }
     
    16021606        if (winEr != ERROR_SUCCESS)
    16031607        {
    1604             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr));
     1608            LogFlowFunc(("Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr));
    16051609            return winEr;
    16061610        }
     
    16091613        if (winEr != ERROR_SUCCESS)
    16101614        {
    1611             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));
     1615            LogFlowFunc(("Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));
    16121616            return winEr;
    16131617        }
     
    16161620        if (iPath < 0)
    16171621        {
    1618             WARN(("VBoxTray: (WDDM) path (%d) is still disabled, going to retry winEr %d\n", winEr));
     1622            LogFlowFunc(("path (%d) is still disabled, going to retry winEr %d\n", winEr));
    16191623            vboxDispIfWddmDcTerm(&DispCfg);
    16201624            return ERROR_RETRY;
     
    16321636        if (winEr != ERROR_SUCCESS)
    16331637        {
    1634             WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr));
     1638            LogFlowFunc(("Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr));
    16351639            return winEr;
    16361640        }
     
    16441648    if (winEr != ERROR_SUCCESS)
    16451649    {
    1646         WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmDcSettingsUpdate\n"));
     1650        LogFlowFunc(("Failed vboxDispIfWddmDcSettingsUpdate\n"));
    16471651        vboxDispIfWddmDcTerm(&DispCfg);
    16481652        return winEr;
     
    16531657    if (winEr != ERROR_SUCCESS)
    16541658    {
    1655         WARN(("VBoxTray:(WDDM) pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr));
     1659        LogFlowFunc(("pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr));
    16561660        fSetFlags |= SDC_ALLOW_CHANGES;
    16571661    }
     
    16601664    if (winEr != ERROR_SUCCESS)
    16611665    {
    1662         WARN(("VBoxTray:(WDDM) pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr));
     1666        LogFlowFunc(("pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr));
    16631667    }
    16641668
     
    16841688#endif
    16851689        default:
    1686             WARN((__FUNCTION__": unknown mode (%d)\n", pIf->enmMode));
     1690            LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode));
    16871691            return ERROR_INVALID_PARAMETER;
    16881692    }
     
    17031707#endif
    17041708        default:
    1705             WARN((__FUNCTION__": unknown mode (%d)\n", pIf->enmMode));
     1709            LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode));
    17061710            return ERROR_INVALID_PARAMETER;
    17071711    }
     
    17331737        return NO_ERROR;
    17341738    }
    1735     WARN(("VBoxTray: pfnD3DKMTEscape VBOXESC_CONFIGURETARGETS failed Status 0x%x\n", Status));
     1739    LogFlowFunc(("pfnD3DKMTEscape VBOXESC_CONFIGURETARGETS failed Status 0x%x\n", Status));
    17361740    return Status;
    17371741}
     
    17421746    if (NumDevices == 0)
    17431747    {
    1744         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: Zero devices found\n"));
     1748        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: Zero devices found\n"));
    17451749        return ERROR_GEN_FAILURE;
    17461750    }
     
    17541758    if (winEr != NO_ERROR)
    17551759    {
    1756         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed, %d\n", winEr));
     1760        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed, %d\n", winEr));
    17571761        return winEr;
    17581762    }
    17591763
    17601764    if (NumDevices != DevNum)
    1761         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum));
     1765        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum));
    17621766
    17631767
     
    17661770    if (winEr != NO_ERROR)
    17671771    {
    1768         WARN(("VBoxTray: vboxDispIfConfigureTargetsWDDM failed winEr 0x%x\n", winEr));
     1772        LogFlowFunc(("vboxDispIfConfigureTargetsWDDM failed winEr 0x%x\n", winEr));
    17691773        return winEr;
    17701774    }
     
    17721776    if (!cConnected)
    17731777    {
    1774         Log(("VBoxTray: all targets already connected, nothing to do\n"));
     1778        LogFlowFunc(("all targets already connected, nothing to do\n"));
    17751779        return NO_ERROR;
    17761780    }
     
    17781782    winEr = vboxDispIfWaitDisplayDataInited(pOp, NULL);
    17791783    if (winEr != NO_ERROR)
    1780         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: vboxDispIfWaitDisplayDataInited failed winEr 0x%x\n", winEr));
     1784        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: vboxDispIfWaitDisplayDataInited failed winEr 0x%x\n", winEr));
    17811785
    17821786    DWORD NewNumDevices = VBoxGetDisplayConfigCount();
    17831787    if (NewNumDevices == 0)
    17841788    {
    1785         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: Zero devices found\n"));
     1789        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: Zero devices found\n"));
    17861790        return ERROR_GEN_FAILURE;
    17871791    }
    17881792
    17891793    if (NewNumDevices != NumDevices)
    1790         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != NewNumDevices(%d)\n", NumDevices, NewNumDevices));
     1794        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != NewNumDevices(%d)\n", NumDevices, NewNumDevices));
    17911795
    17921796    DISPLAY_DEVICE *paNewDisplayDevices = (DISPLAY_DEVICE *)alloca (sizeof (DISPLAY_DEVICE) * NewNumDevices);
     
    17981802    if (winEr != NO_ERROR)
    17991803    {
    1800         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed for new devices, %d\n", winEr));
     1804        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed for new devices, %d\n", winEr));
    18011805        return winEr;
    18021806    }
    18031807
    18041808    if (NewNumDevices != NewDevNum)
    1805         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: NewNumDevices(%d) != NewDevNum(%d)\n", NewNumDevices, NewDevNum));
     1809        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: NewNumDevices(%d) != NewDevNum(%d)\n", NewNumDevices, NewDevNum));
    18061810
    18071811    DWORD minDevNum = RT_MIN(DevNum, NewDevNum);
     
    18211825    {
    18221826        /* this is something we would not regularly expect */
    1823         WARN(("VBoxTray: all targets already have proper config, nothing to do\n"));
     1827        LogFlowFunc(("all targets already have proper config, nothing to do\n"));
    18241828        return NO_ERROR;
    18251829    }
     
    18291833        winEr = vboxDispIfWddmEnableDisplaysTryingTopology(pOp->pIf, cIds, pIds, FALSE);
    18301834        if (winEr != NO_ERROR)
    1831             WARN(("VBoxTray: vboxDispIfWddmEnableDisplaysTryingTopology failed to record current settings, %d, ignoring\n", winEr));
     1835            LogFlowFunc(("vboxDispIfWddmEnableDisplaysTryingTopology failed to record current settings, %d, ignoring\n", winEr));
    18321836    }
    18331837    else
     
    18371841            winEr = vboxDispIfWddmResizeDisplayVista(paNewDeviceModes, paNewDisplayDevices, NewDevNum, i, FALSE, TRUE);
    18381842            if (winEr != NO_ERROR)
    1839                 WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp: vboxDispIfWddmResizeDisplayVista failed winEr 0x%x\n", winEr));
     1843                LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: vboxDispIfWddmResizeDisplayVista failed winEr 0x%x\n", winEr));
    18401844        }
    18411845    }
     
    18521856    if (winEr != NO_ERROR)
    18531857    {
    1854         WARN(("VBoxTray: vboxDispIfOpBegin failed winEr 0x%x\n", winEr));
     1858        LogFlowFunc(("vboxDispIfOpBegin failed winEr 0x%x\n", winEr));
    18551859        return winEr;
    18561860    }
     
    18591863    if (winEr != NO_ERROR)
    18601864    {
    1861         WARN(("VBoxTray: vboxDispIfResizeStartedWDDMOp failed winEr 0x%x\n", winEr));
     1865        LogFlowFunc(("vboxDispIfResizeStartedWDDMOp failed winEr 0x%x\n", winEr));
    18621866    }
    18631867
     
    18811885#endif
    18821886        default:
    1883             WARN((__FUNCTION__": unknown mode (%d)\n", pIf->enmMode));
     1887            LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode));
    18841888            return ERROR_INVALID_PARAMETER;
    18851889    }
     
    19051909            bool bSupported = true;
    19061910            *(uintptr_t *)&pIf->modeData.xpdm.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA");
    1907             Log((__FUNCTION__": pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.xpdm.pfnChangeDisplaySettingsEx));
     1911            LogFlowFunc(("pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.xpdm.pfnChangeDisplaySettingsEx));
    19081912            bSupported &= !!(pIf->modeData.xpdm.pfnChangeDisplaySettingsEx);
    19091913
    19101914            if (!bSupported)
    19111915            {
    1912                 WARN((__FUNCTION__": pfnChangeDisplaySettingsEx function pointer failed to initialize\n"));
     1916                LogFlowFunc(("pfnChangeDisplaySettingsEx function pointer failed to initialize\n"));
    19131917                err = ERROR_NOT_SUPPORTED;
    19141918            }
     
    19161920        else
    19171921        {
    1918             WARN((__FUNCTION__": failed to get USER32 handle, err (%d)\n", GetLastError()));
     1922            LogFlowFunc(("failed to get USER32 handle, err (%d)\n", GetLastError()));
    19191923            err = ERROR_NOT_SUPPORTED;
    19201924        }
     
    19221926    else
    19231927    {
    1924         WARN((__FUNCTION__": can not switch to VBOXDISPIF_MODE_XPDM, because os is not >= w2k\n"));
     1928        LogFlowFunc(("can not switch to VBOXDISPIF_MODE_XPDM, because os is not >= w2k\n"));
    19251929        err = ERROR_NOT_SUPPORTED;
    19261930    }
     
    19521956    {
    19531957        case VBOXDISPIF_MODE_XPDM_NT4:
    1954             Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_XPDM_NT4\n"));
     1958            LogFlowFunc(("request to switch to VBOXDISPIF_MODE_XPDM_NT4\n"));
    19551959            err = vboxDispIfSwitchToXPDM_NT4(pIf);
    19561960            if (err == NO_ERROR)
    19571961            {
    1958                 Log((__FUNCTION__": successfully switched to XPDM_NT4 mode\n"));
     1962                LogFlowFunc(("successfully switched to XPDM_NT4 mode\n"));
    19591963                pIf->enmMode = VBOXDISPIF_MODE_XPDM_NT4;
    19601964            }
    19611965            else
    1962                 WARN((__FUNCTION__": failed to switch to XPDM_NT4 mode, err (%d)\n", err));
     1966                LogFlowFunc(("failed to switch to XPDM_NT4 mode, err (%d)\n", err));
    19631967            break;
    19641968        case VBOXDISPIF_MODE_XPDM:
    1965             Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_XPDM\n"));
     1969            LogFlowFunc(("request to switch to VBOXDISPIF_MODE_XPDM\n"));
    19661970            err = vboxDispIfSwitchToXPDM(pIf);
    19671971            if (err == NO_ERROR)
    19681972            {
    1969                 Log((__FUNCTION__": successfully switched to XPDM mode\n"));
     1973                LogFlowFunc(("successfully switched to XPDM mode\n"));
    19701974                pIf->enmMode = VBOXDISPIF_MODE_XPDM;
    19711975            }
    19721976            else
    1973                 WARN((__FUNCTION__": failed to switch to XPDM mode, err (%d)\n", err));
     1977                LogFlowFunc(("failed to switch to XPDM mode, err (%d)\n", err));
    19741978            break;
    19751979#ifdef VBOX_WITH_WDDM
    19761980        case VBOXDISPIF_MODE_WDDM:
    19771981        {
    1978             Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_WDDM\n"));
     1982            LogFlowFunc(("request to switch to VBOXDISPIF_MODE_WDDM\n"));
    19791983            err = vboxDispIfSwitchToWDDM(pIf);
    19801984            if (err == NO_ERROR)
    19811985            {
    1982                 Log((__FUNCTION__": successfully switched to WDDM mode\n"));
     1986                LogFlowFunc(("successfully switched to WDDM mode\n"));
    19831987                pIf->enmMode = VBOXDISPIF_MODE_WDDM;
    19841988            }
    19851989            else
    1986                 WARN((__FUNCTION__": failed to switch to WDDM mode, err (%d)\n", err));
     1990                LogFlowFunc(("failed to switch to WDDM mode, err (%d)\n", err));
    19871991            break;
    19881992        }
    19891993        case VBOXDISPIF_MODE_WDDM_W7:
    19901994        {
    1991             Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_WDDM_W7\n"));
     1995            LogFlowFunc(("request to switch to VBOXDISPIF_MODE_WDDM_W7\n"));
    19921996            err = vboxDispIfSwitchToWDDM_W7(pIf);
    19931997            if (err == NO_ERROR)
    19941998            {
    1995                 Log((__FUNCTION__": successfully switched to WDDM mode\n"));
     1999                LogFlowFunc(("successfully switched to WDDM mode\n"));
    19962000                pIf->enmMode = VBOXDISPIF_MODE_WDDM_W7;
    19972001            }
    19982002            else
    1999                 WARN((__FUNCTION__": failed to switch to WDDM mode, err (%d)\n", err));
     2003                LogFlowFunc(("failed to switch to WDDM mode, err (%d)\n", err));
    20002004            break;
    20012005        }
     
    20242028#ifdef VBOX_DISPIF_WITH_OPCONTEXT
    20252029            else
    2026                 WARN(("VBoxTray: vboxDispKmtCreateContext failed hr 0x%x", hr));
     2030                LogFlowFunc(("vboxDispKmtCreateContext failed hr 0x%x", hr));
    20272031
    20282032            vboxDispKmtDestroyDevice(&pSeamless->modeData.wddm.Device);
    20292033        }
    20302034        else
    2031             WARN(("VBoxTray: vboxDispKmtCreateDevice failed hr 0x%x", hr));
     2035            LogFlowFunc(("vboxDispKmtCreateDevice failed hr 0x%x", hr));
    20322036
    20332037        vboxDispKmtCloseAdapter(&pSeamless->modeData.wddm.Adapter);
     
    20662070        return ERROR_SUCCESS;
    20672071
    2068     WARN(("VBoxTray: pfnD3DKMTEscape Seamless failed Status 0x%x\n", Status));
     2072    LogFlowFunc(("pfnD3DKMTEscape Seamless failed Status 0x%x\n", Status));
    20692073    return Status;
    20702074}
     
    20862090#endif
    20872091        default:
    2088             WARN(("VBoxTray: VBoxDispIfSeamlesCreate: invalid mode %d\n", pIf->enmMode));
     2092            LogFlowFunc(("VBoxDispIfSeamlesCreate: invalid mode %d\n", pIf->enmMode));
    20892093            return ERROR_INVALID_PARAMETER;
    20902094    }
     
    21082112#endif
    21092113        default:
    2110             WARN(("VBoxTray: VBoxDispIfSeamlesTerm: invalid mode %d\n", pIf->enmMode));
     2114            LogFlowFunc(("VBoxDispIfSeamlesTerm: invalid mode %d\n", pIf->enmMode));
    21112115            winEr = ERROR_INVALID_PARAMETER;
    21122116            break;
     
    21252129    if (pData->escapeCode != VBOXESC_SETVISIBLEREGION)
    21262130    {
    2127         WARN(("VBoxTray: invalid escape code for Seamless submit %d\n", pData->escapeCode));
     2131        LogFlowFunc(("invalid escape code for Seamless submit %d\n", pData->escapeCode));
    21282132        return ERROR_INVALID_PARAMETER;
    21292133    }
     
    21402144#endif
    21412145        default:
    2142             WARN(("VBoxTray: VBoxDispIfSeamlesSubmit: invalid mode %d\n", pIf->enmMode));
     2146            LogFlowFunc(("VBoxDispIfSeamlesSubmit: invalid mode %d\n", pIf->enmMode));
    21432147            return ERROR_INVALID_PARAMETER;
    21442148    }
  • 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}
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDataObject.cpp

    r50460 r51469  
    2222#include <iprt/semaphore.h>
    2323#include <iprt/uri.h>
     24
     25#ifdef LOG_GROUP
     26# undef LOG_GROUP
     27#endif
     28#define LOG_GROUP LOG_GROUP_GUEST_DND
     29#include <VBox/log.h>
    2430
    2531#include "VBoxTray.h"
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropSource.cpp

    r50177 r51469  
    1717#include <windows.h>
    1818#include <new> /* For bad_alloc. */
     19
     20#ifdef LOG_GROUP
     21# undef LOG_GROUP
     22#endif
     23#define LOG_GROUP LOG_GROUP_GUEST_DND
     24#include <VBox/log.h>
    1925
    2026#include "VBoxTray.h"
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropTarget.cpp

    r50830 r51469  
    2525#include "VBox/GuestHost/DragAndDrop.h"
    2626#include "VBox/HostServices/DragAndDropSvc.h"
     27
     28#ifdef LOG_GROUP
     29# undef LOG_GROUP
     30#endif
     31#define LOG_GROUP LOG_GROUP_GUEST_DND
     32#include <VBox/log.h>
    2733
    2834
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDEnumFormat.cpp

    r49947 r51469  
    2121#include "VBoxHelpers.h"
    2222#include "VBoxDnD.h"
     23
     24#ifdef DEBUG
     25# define LOG_ENABLED
     26# define LOG_GROUP LOG_GROUP_DEFAULT
     27#endif
     28#include <VBox/log.h>
     29
    2330
    2431
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.cpp

    r44529 r51469  
    66
    77/*
    8  * Copyright (C) 2010-2011 Oracle Corporation
     8 * Copyright (C) 2010-2014 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2222
    2323#include <VBox/VBoxGuestLib.h>
     24
     25#ifdef DEBUG
     26# define LOG_ENABLED
     27# define LOG_GROUP LOG_GROUP_DEFAULT
     28#endif
     29#include <VBox/log.h>
     30
    2431
    2532
     
    5562                                       5000 /* Time to display in msec */, NIIF_INFO);
    5663                if (RT_FAILURE(rc))
    57                     Log(("VBoxTray: Guest Additions update found; however: could not show version notifier balloon tooltip! rc = %d\n", rc));
     64                    LogFlowFunc(("Guest Additions update found; however: could not show version notifier balloon tooltip, rc=%Rrc\n", rc));
    5865            }
    5966
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp

    r50040 r51469  
    3232#include <iprt/mem.h>
    3333#include <VBoxGuestInternal.h>
     34
     35#include <VBox/VMMDev.h>
     36#ifdef DEBUG
     37# define LOG_ENABLED
     38# define LOG_GROUP LOG_GROUP_DEFAULT
     39#endif
     40#include <VBox/log.h>
    3441
    3542
     
    229236    AssertPtrReturnVoid(pInstance);
    230237
    231     LogFunc(("Stopping pInstance=%p\n", pInstance));
     238    LogFlowFunc(("Stopping pInstance=%p\n", pInstance));
    232239
    233240    /* Shut down local IPC server. */
     
    239246        int rc2 = RTLocalIpcServerCancel(pCtx->hServer);
    240247        if (RT_FAILURE(rc2))
    241             LogFunc(("Cancelling current listening call failed with rc=%Rrc\n", rc2));
     248            LogFlowFunc(("Cancelling current listening call failed with rc=%Rrc\n", rc2));
    242249    }
    243250
     
    252259            if (RT_FAILURE(rc2))
    253260            {
    254                 LogFunc(("Stopping IPC session %p failed with rc=%Rrc\n",
     261                LogFlowFunc(("Stopping IPC session %p failed with rc=%Rrc\n",
    255262                         pSession, rc2));
    256263                /* Keep going. */
     
    265272    AssertPtrReturnVoid(pInstance);
    266273
    267     LogFunc(("Destroying pInstance=%p\n", pInstance));
     274    LogFlowFunc(("Destroying pInstance=%p\n", pInstance));
    268275
    269276    PVBOXIPCCONTEXT pCtx = (PVBOXIPCCONTEXT)pInstance;
     
    276283        rc = RTLocalIpcServerDestroy(pCtx->hServer);
    277284        if (RT_FAILURE(rc))
    278             LogFunc(("Unable to destroy IPC server, rc=%Rrc\n", rc));
     285            LogFlowFunc(("Unable to destroy IPC server, rc=%Rrc\n", rc));
    279286
    280287        int rc2 = RTCritSectLeave(&pCtx->CritSect);
     
    283290    }
    284291
    285     LogFunc(("Waiting for remaining IPC sessions to shut down ...\n"));
     292    LogFlowFunc(("Waiting for remaining IPC sessions to shut down ...\n"));
    286293
    287294    /* Wait for all IPC session threads to shut down. */
     
    307314              ("Session thread list is not empty when it should\n"));
    308315
    309     LogFunc(("All remaining IPC sessions shut down\n"));
     316    LogFlowFunc(("All remaining IPC sessions shut down\n"));
    310317
    311318    int rc2 = RTCritSectDelete(&pCtx->CritSect);
     
    313320        rc = rc2;
    314321
    315     LogFunc(("Destroyed pInstance=%p, rc=%Rrc\n",
     322    LogFlowFunc(("Destroyed pInstance=%p, rc=%Rrc\n",
    316323             pInstance, rc));
    317324}
     
    331338    AssertReturn(hSession != NIL_RTLOCALIPCSESSION, VERR_INVALID_PARAMETER);
    332339
    333     LogFunc(("pThis=%p\n", pThis));
     340    LogFlowFunc(("pThis=%p\n", pThis));
    334341
    335342    int rc = VINF_SUCCESS;
     
    347354            if (rc == VERR_CANCELLED)
    348355            {
    349                 LogFunc(("Session %p: Waiting for data cancelled\n", pThis));
     356                LogFlowFunc(("Session %p: Waiting for data cancelled\n", pThis));
    350357                rc = VINF_SUCCESS;
    351358                break;
    352359            }
    353360            else
    354                 LogFunc(("Session %p: Waiting for session data failed with rc=%Rrc\n",
     361                LogFlowFunc(("Session %p: Waiting for session data failed with rc=%Rrc\n",
    355362                         pThis, rc));
    356363        }
     
    391398
    392399                if (RT_FAILURE(rc))
    393                     LogFunc(("Session %p: Handling command %RU32 failed with rc=%Rrc\n",
     400                    LogFlowFunc(("Session %p: Handling command %RU32 failed with rc=%Rrc\n",
    394401                             pThis, ipcHdr.uMsgType, rc));
    395402            }
     
    423430    }
    424431
    425     LogFunc(("Session %p: Handler ended with rc=%Rrc\n",
     432    LogFlowFunc(("Session %p: Handler ended with rc=%Rrc\n",
    426433             pThis, rc));
    427434
     
    431438    int rc2 = RTLocalIpcSessionClose(hSession);
    432439    if (RT_FAILURE(rc2))
    433         LogFunc(("Session %p: Failed closing session %p, rc=%Rrc\n", pThis, rc2));
     440        LogFlowFunc(("Session %p: Failed closing session %p, rc=%Rrc\n", pThis, rc2));
    434441
    435442    /*
     
    449456    }
    450457
    451     LogFunc(("Session %p: Terminated with rc=%Rrc, freeing ...\n",
     458    LogFlowFunc(("Session %p: Terminated with rc=%Rrc, freeing ...\n",
    452459             pThis, rc));
    453460
     
    488495                int rc2 = RTLocalIpcSessionClose(hSession);
    489496                if (RT_FAILURE(rc2))
    490                     LogFunc(("Failed closing session %p, rc=%Rrc\n", pSession, rc2));
    491 
    492                 LogFunc(("Failed to create thread for session %p, rc=%Rrc\n", pSession, rc));
     497                    LogFlowFunc(("Failed closing session %p, rc=%Rrc\n", pSession, rc2));
     498
     499                LogFlowFunc(("Failed to create thread for session %p, rc=%Rrc\n", pSession, rc));
    493500                RTMemFree(pSession);
    494501            }
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxLA.cpp

    r46625 r51469  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 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 
    18 // #define LOG_ENABLED
    19 
    2017#define _WIN32_WINNT 0x0501
    2118#include <windows.h>
     
    2926#include <iprt/ldr.h>
    3027
    31 #define LALOG(a) do { if (gCtx.fLogEnabled) LogRel(a); } while(0)
    32 #define LALOGFORCE(a) do { LogRel(a); } while(0)
     28#ifdef DEBUG
     29# define LOG_ENABLED
     30# define LOG_GROUP LOG_GROUP_DEFAULT
     31#endif
     32#include <VBox/log.h>
     33
     34
    3335
    3436#define REG_KEY_LEN 1024
     
    147149    if (lErr != ERROR_SUCCESS)
    148150    {
    149         LALOGFORCE(("LA: RegOpenKeyExW: failed [%ls]\n",
     151        LogRel(("LA: RegOpenKeyExW: failed [%ls]\n",
    150152                    pwszRegKey));
    151153        return FALSE;
     
    163165    if (lErr != ERROR_SUCCESS)
    164166    {
    165         LALOGFORCE(("LA: RegQueryValueExW: failed [%ls/%ls]\n",
     167        LogRel(("LA: RegQueryValueExW: failed [%ls/%ls]\n",
    166168                    pwszRegKey, pwszName));
    167169        RegCloseKey(hKey);
     
    171173    if (nRegData != sizeof(DWORD))
    172174    {
    173         LALOGFORCE(("LA: buffer overflow reg %d, [%ls]\n",
     175        LogRel(("LA: buffer overflow reg %d, [%ls]\n",
    174176                    nRegData, pwszRegKey));
    175177        RegCloseKey(hKey);
     
    179181    if (dwType != REG_DWORD)
    180182    {
    181         LALOGFORCE(("LA: wrong type %d, [%ls/%ls]\n",
     183        LogRel(("LA: wrong type %d, [%ls/%ls]\n",
    182184                    dwType, pwszRegKey, pwszName));
    183185        RegCloseKey(hKey);
     
    221223    if (dwErr != ERROR_SUCCESS)
    222224    {
    223         LALOG(("LA: Can't open registry key [%ls], error %d\n",
     225        LogFlowFunc(("Can't open registry key [%ls], error %d\n",
    224226               pwszRegKey, dwErr));
    225227        return FALSE;
     
    249251        if (dwRet == ERROR_NO_MORE_ITEMS)
    250252        {
    251             LALOG(("LA: Enumeration exhausted\n"));
     253            LogFlowFunc(("Enumeration exhausted\n"));
    252254            bRet = TRUE;
    253255            break;
     
    255257        else if (dwRet != ERROR_SUCCESS)
    256258        {
    257             LALOG(("LA: Enumeration failed, error %d\n",
     259            LogFlowFunc(("Enumeration failed, error %d\n",
    258260                   dwRet));
    259261            bRet = FALSE;
     
    263265        if ((type != REG_SZ) && (type != REG_EXPAND_SZ))
    264266        {
    265             LALOG(("LA: skipped type %d\n",
     267            LogFlowFunc(("skipped type %d\n",
    266268                   type));
    267269            continue;
     
    275277        if (RT_FAILURE(rc))
    276278        {
    277             LALOG(("LA: RTUtf16ToUtf8Ex for [%ls] rc %Rrc\n",
     279            LogFlowFunc(("RTUtf16ToUtf8Ex for [%ls] rc %Rrc\n",
    278280                    wszValueName, rc));
    279281            continue;
     
    283285        if (RTStrNICmp(szName, g_szCommandPrefix, RT_ELEMENTS(g_szCommandPrefix) - 1) != 0)
    284286        {
    285             LALOG(("LA: skipped prefix %s\n",
     287            LogFlowFunc(("skipped prefix %s\n",
    286288                   szName));
    287289            continue;
     
    293295        if (nIndex == 0)
    294296        {
    295             LALOG(("LA: skipped index %s\n",
     297            LogFlowFunc(("skipped index %s\n",
    296298                   szName));
    297299            continue;
     
    302304        if (!pEntry)
    303305        {
    304             LALOG(("LA: RTMemAlloc failed\n"));
     306            LogFlowFunc(("RTMemAlloc failed\n"));
    305307            bRet = FALSE;
    306308            break;
     
    336338        }
    337339
    338         LALOG(("LA: added %d %ls\n",
     340        LogFlowFunc(("added %d %ls\n",
    339341               pEntry->u32Index, pEntry->wszCommandLine));
    340342    }
     
    346348    RTListForEach(listActions, pIter, ACTIONENTRY, nodeActionEntry)
    347349    {
    348         LALOG(("LA: [%u]: [%ls]\n",
     350        LogFlowFunc(("[%u]: [%ls]\n",
    349351               pIter->u32Index, pIter->wszCommandLine));
    350352    }
     
    356358    }
    357359
    358     LALOG(("LA: action enum %d\n",
     360    LogFlowFunc(("action enum %d\n",
    359361           bRet));
    360362
     
    364366static void ActionExecutorExecuteActions(RTLISTANCHOR *listActions)
    365367{
    366     LALOG(("LA: ExecuteActions\n"));
     368    LogFlowFunc(("ExecuteActions\n"));
    367369
    368370    ACTIONENTRY *pIter = NULL;
    369371    RTListForEach(listActions, pIter, ACTIONENTRY, nodeActionEntry)
    370372    {
    371         LALOG(("LA: [%u]: [%ls]\n",
     373        LogFlowFunc(("[%u]: [%ls]\n",
    372374               pIter->u32Index, pIter->wszCommandLine));
    373375
     
    388390                            &pi))                  // lpProcessInformation
    389391        {
    390             LALOG(("LA: Executing [%ls] failed, error %d\n",
     392            LogFlowFunc(("Executing [%ls] failed, error %d\n",
    391393                   pIter->wszCommandLine, GetLastError()));
    392394        }
    393395        else
    394396        {
    395             LALOG(("LA: Executing [%ls] succeeded\n",
     397            LogFlowFunc(("Executing [%ls] succeeded\n",
    396398                   pIter->wszCommandLine));
    397399
     
    402404    }
    403405
    404     LALOG(("LA: ExecuteActions leave\n"));
     406    LogFlowFunc(("ExecuteActions leave\n"));
    405407}
    406408
     
    457459    if (fFound)
    458460    {
    459         LALOG(("LA: GetVolatileEnvironmentKey: [%s]\n", szRegKey));
     461        LogFlowFunc(("GetVolatileEnvironmentKey: [%s]\n", szRegKey));
    460462
    461463        /* Convert szRegKey to Utf16 string. */
     
    467469        if (RT_FAILURE(rc))
    468470        {
    469             LALOG(("LA: RTStrToUtf16Ex failed %Rrc\n", rc));
     471            LogFlowFunc(("RTStrToUtf16Ex failed %Rrc\n", rc));
    470472            fFound = FALSE;
    471473        }
    472474        else
    473475        {
    474             LALOG(("LA: unicode [%ls]\n", putf16Unicode));
     476            LogFlowFunc(("unicode [%ls]\n", putf16Unicode));
    475477        }
    476478    }
    477479    else
    478480    {
    479         LALOG(("LA: GetVolatileEnvironmentKey: not found\n"));
     481        LogFlowFunc(("GetVolatileEnvironmentKey: not found\n"));
    480482    }
    481483
     
    502504    if (lErr != ERROR_SUCCESS)
    503505    {
    504         LALOG(("LA: RegOpenKeyExW: failed [%ls]\n",
     506        LogFlowFunc(("RegOpenKeyExW: failed [%ls]\n",
    505507               wszRegKey));
    506508        return FALSE;
     
    518520    if (lErr != ERROR_SUCCESS)
    519521    {
    520         LALOG(("LA: RegQueryValueExW: failed [%ls]\n",
     522        LogFlowFunc(("RegQueryValueExW: failed [%ls]\n",
    521523               wszRegKey));
    522524        RegCloseKey(hKey);
     
    526528    if (nRegData >= cbClientName)
    527529    {
    528         LALOG(("LA: buffer overflow reg %d, buffer %d, [%ls]\n",
     530        LogFlowFunc(("buffer overflow reg %d, buffer %d, [%ls]\n",
    529531               nRegData, cbClientName, wszRegKey));
    530532        RegCloseKey(hKey);
     
    534536    if (dwType != REG_SZ)
    535537    {
    536         LALOG(("LA: wrong type %d, [%ls]\n",
     538        LogFlowFunc(("wrong type %d, [%ls]\n",
    537539               dwType, wszRegKey));
    538540        RegCloseKey(hKey);
     
    611613                            &dwResult) == 0)
    612614    {
    613         LALOG(("LA: SendMessageTimeout failed, error %d\n", GetLastError()));
     615        LogFlowFunc(("SendMessageTimeout failed, error %d\n", GetLastError()));
    614616    }
    615617}
     
    642644    if (!GetVolatileEnvironmentKey(wszRegKey, sizeof(wszRegKey)))
    643645    {
    644         LALOG(("LA: Failed to get 'Volatile Environment' registry key\n"));
     646        LogFlowFunc(("Failed to get 'Volatile Environment' registry key\n"));
    645647        return;
    646648    }
     
    658660    if (lRet != ERROR_SUCCESS)
    659661    {
    660         LALOG(("LA: Failed to open key [%ls], error %lu\n",
     662        LogFlowFunc(("Failed to open key [%ls], error %lu\n",
    661663               wszRegKey, lRet));
    662664        return;
     
    677679        if (RT_FAILURE(rc))
    678680        {
    679             LALOG(("LA: RTStrToUniEx failed %Rrc\n", rc));
     681            LogFlowFunc(("RTStrToUniEx failed %Rrc\n", rc));
    680682            break;
    681683        }
     
    691693        if (lRet != ERROR_SUCCESS)
    692694        {
    693             LALOG(("LA: RegSetValueExW failed error %lu for %s \n", lRet, g_pwszUTCINFOClientInfo[idx]));
     695            LogFlowFunc(("RegSetValueExW failed error %lu for %s \n", lRet, g_pwszUTCINFOClientInfo[idx]));
    694696        }
    695697    }
     
    716718static void laDoAttach(VBOXLACONTEXT *pCtx)
    717719{
    718     LALOG(("LA: laDoAttach\n"));
     720    LogFlowFunc(("laDoAttach\n"));
    719721
    720722    /* Hardcoded action. */
     
    727729static void laDoDetach(VBOXLACONTEXT *pCtx)
    728730{
    729     LALOG(("LA: laDoDetach\n"));
     731    LogFlowFunc(("laDoDetach\n"));
    730732
    731733    /* Process configured actions. */
     
    773775    if (RT_SUCCESS(rc))
    774776    {
    775         LALOG(("LA: laGetProperty: [%s]\n"
     777        LogFlowFunc(("laGetProperty: [%s]\n"
    776778               "            value: [%s]\n"
    777779               "        timestamp: %lld ns\n",
     
    782784    else if (rc == VERR_NOT_FOUND)
    783785    {
    784         LALOG(("LA: laGetProperty: not found [%s]\n", pszName));
     786        LogFlowFunc(("laGetProperty: not found [%s]\n", pszName));
    785787        RTMemFree(pvBuf);
    786788    }
    787789    else
    788790    {
    789         LALOG(("LA: Failed to retrieve the property value, error %Rrc\n", rc));
     791        LogFlowFunc(("Failed to retrieve the property value, error %Rrc\n", rc));
    790792        RTMemFree(pvBuf);
    791793    }
     
    879881    }
    880882
    881     LALOG(("LA: laGetUint32: rc = %Rrc, [%s]\n",
     883    LogFlowFunc(("laGetUint32: rc = %Rrc, [%s]\n",
    882884           rc, pszName));
    883885
     
    892894                           ppszValue);
    893895
    894     LALOG(("LA: laGetString: rc = %Rrc, [%s]\n",
     896    LogFlowFunc(("laGetString: rc = %Rrc, [%s]\n",
    895897           rc, pszName));
    896898
     
    905907                         pu32Value);
    906908
    907     LALOG(("LA: laGetActiveClient: rc %Rrc, %d, %lld\n", rc, *pu32Value, *pu64Timestamp));
     909    LogFlowFunc(("laGetActiveClient: rc %Rrc, %d, %lld\n", rc, *pu32Value, *pu64Timestamp));
    908910
    909911    return rc;
     
    915917     * If u32ActiveClientId is 0, then there is no connected clients.
    916918     */
    917     LALOG(("LA: laUpdateCurrentState: %u %lld\n",
     919    LogFlowFunc(("laUpdateCurrentState: %u %lld\n",
    918920            u32ActiveClientId, u64ActiveClientTS));
    919921
     
    10171019    }
    10181020
    1019     LALOG(("LA: laUpdateCurrentState rc = %Rrc\n",
     1021    LogFlowFunc(("laUpdateCurrentState rc = %Rrc\n",
    10201022           rc));
    10211023
     
    10251027static int laWait(VBOXLACONTEXT *pCtx, uint64_t *pu64Timestamp, uint32_t u32Timeout)
    10261028{
    1027     LALOG(("LA: laWait [%s]\n",
     1029    LogFlowFunc(("laWait [%s]\n",
    10281030           pCtx->activeClient.pszPropWaitPattern));
    10291031
     
    10341036                              u32Timeout);
    10351037
    1036     LALOG(("LA: laWait rc %Rrc\n",
     1038    LogFlowFunc(("laWait rc %Rrc\n",
    10371039           rc));
    10381040
     
    10641066                         &pClientInfoMap[idx][LA_UTCINFO_PROP_VALUE]);
    10651067
    1066          LALOG(("LA: laProcessClientInfo: read [%s], at %lld\n",
     1068         LogFlowFunc(("laProcessClientInfo: read [%s], at %lld\n",
    10671069                pClientInfoMap[idx][LA_UTCINFO_PROP_VALUE], u64Timestamp));
    10681070
    10691071        if (RT_FAILURE(rc))
    10701072        {
    1071             LALOG(("LA: laProcessClientInfo failed at %s\n", pClientInfoMap[idx][LA_UTCINFO_PROP_NAME]));
     1073            LogFlowFunc(("laProcessClientInfo failed at %s\n", pClientInfoMap[idx][LA_UTCINFO_PROP_NAME]));
    10721074            break;
    10731075        }
     
    11081110    if (RT_SUCCESS(rc))
    11091111    {
    1110         LALOG(("LA: laProcessAttach: read %d, at %lld\n",
     1112        LogFlowFunc(("laProcessAttach: read %d, at %lld\n",
    11111113               u32Attach, u64Timestamp));
    11121114
     
    11151117            if (u32Attach != pCtx->activeClient.u32LastAttach)
    11161118            {
    1117                 LALOG(("LA: laProcessAttach: changed\n"));
     1119                LogFlowFunc(("laProcessAttach: changed\n"));
    11181120
    11191121                /* Just do the last action. */
     
    11261128            else
    11271129            {
    1128                 LALOG(("LA: laProcessAttach: same\n"));
     1130                LogFlowFunc(("laProcessAttach: same\n"));
    11291131
    11301132                /* The property has changed but the value is the same,
     
    11411143    }
    11421144
    1143     LALOG(("LA: laProcessAttach: action %d\n",
     1145    LogFlowFunc(("laProcessAttach: action %d\n",
    11441146           pCtx->u32Action));
    11451147}
     
    11521154     * That is two or more LA_DO_ATTACH will do just one LA_DO_ATTACH.
    11531155     */
    1154     LALOG(("LA: laDoActions: action %d, prev %d\n",
     1156    LogFlowFunc(("laDoActions: action %d, prev %d\n",
    11551157           pCtx->u32Action, pCtx->u32PrevAction));
    11561158
     
    12041206    pCtx->u32Action = LA_DO_NOTHING;
    12051207
    1206     LALOG(("LA: laDoActions: leave\n"));
     1208    LogFlowFunc(("laDoActions: leave\n"));
    12071209}
    12081210
     
    12221224    }
    12231225
    1224     LALOG(("VBoxTray: VBoxLAInit\n"));
     1226    LogFlowFunc(("\n"));
    12251227
    12261228    /* DetachOnDisconnect is enabled by default. */
     
    12361238    }
    12371239
    1238     LALOGFORCE(("VBoxTray: VBoxLAInit: dod %d, VBoxTrayLA %x\n", gCtx.fDetachOnDisconnect, dwValue));
     1240    LogRel(("LA: DetachOnDisconnect=%RTbool\n", gCtx.fDetachOnDisconnect));
    12391241
    12401242    int rc = VbglR3GuestPropConnect(&gCtx.u32GuestPropHandle);
     
    12581260void VBoxLADestroy(const VBOXSERVICEENV *pEnv, void *pInstance)
    12591261{
    1260     LALOG(("VBoxTray: VBoxLADestroy\n"));
     1262    LogFlowFuncEnter();
    12611263
    12621264    VBOXLACONTEXT *pCtx = (VBOXLACONTEXT *)pInstance;
     
    12801282    VBOXLACONTEXT *pCtx = (VBOXLACONTEXT *)pInstance;
    12811283
    1282     LALOG(("VBoxTray: VBoxLAThread: Started.\n"));
     1284    LogFlowFunc(("Started\n"));
    12831285
    12841286    /*
     
    12951297    if (!ActionExecutorEnumerateRegistryKey(g_pwszRegKeyReconnectActions, &gCtx.listAttachActions))
    12961298    {
    1297         LALOG(("LA: Can't enumerate registry key %ls\n", g_pwszRegKeyReconnectActions));
     1299        LogFlowFunc(("Can't enumerate registry key %ls\n", g_pwszRegKeyReconnectActions));
    12981300    }
    12991301    if (!ActionExecutorEnumerateRegistryKey(g_pwszRegKeyDisconnectActions, &gCtx.listDetachActions))
    13001302    {
    1301         LALOG(("LA: Can't enumerate registry key %ls\n", g_pwszRegKeyDisconnectActions));
     1303        LogFlowFunc(("Can't enumerate registry key %ls\n", g_pwszRegKeyDisconnectActions));
    13021304    }
    13031305
     
    13551357                        && fClientIdChanged)
    13561358                    {
    1357                         LALOG(("LA: client disconnected\n"));
     1359                        LogFlowFunc(("client disconnected\n"));
    13581360
    13591361                        /* laDoActions will prevent a repeated detach action. So if there
     
    13951397    }
    13961398
    1397     LALOG(("VBoxTray: VBoxLAThread: Finished.\n"));
     1399    LogFlowFunc(("Finished\n"));
    13981400    return 0;
    13991401}
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxMMR.cpp

    r47231 r51469  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2012-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1919#include "VBoxMMR.h"
    2020#include <iprt/ldr.h>
     21
     22#ifdef DEBUG
     23# define LOG_ENABLED
     24# define LOG_GROUP LOG_GROUP_DEFAULT
     25#endif
     26#include <VBox/log.h>
     27
     28
    2129
    2230struct VBOXMMRCONTEXT
     
    4856int VBoxMMRInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread)
    4957{
    50     LogRel2(("VBoxMMR: Initializing\n"));
     58    LogFlowFuncEnter();
    5159
    5260    int rc = RTLdrLoadAppPriv(g_pszMMRDLL, &gCtx.hModHook);
     
    6674
    6775            rc = RTErrConvertFromWin32(GetLastError());
    68             LogRel2(("VBoxMMR: Error installing hooking proc: %Rrc\n", rc));
     76            LogFlowFunc(("Error installing hooking proc: %Rrc\n", rc));
    6977        }
    7078        else
    7179        {
    72             LogRel2(("VBoxMMR: Hooking proc not found\n"));
     80            LogFlowFunc(("Hooking proc not found\n"));
    7381            rc = VERR_NOT_FOUND;
    7482        }
     
    7886    }
    7987    else
    80         LogRel2(("VBoxMMR: Hooking library not found (%Rrc)\n", rc));
     88        LogFlowFunc(("Hooking library not found (%Rrc)\n", rc));
    8189
    8290    return rc;
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp

    r48070 r51469  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818#define _WIN32_WINNT 0x0500
    1919#include <Windows.h>
     20
     21#include <iprt/assert.h>
     22#include <iprt/ldr.h>
     23
     24#include <VBoxDisplay.h>
     25#include <VBoxGuestInternal.h>
     26#include <VBoxHook.h>
     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
    2035#include "VBoxTray.h"
    2136#include "VBoxHelpers.h"
    2237#include "VBoxSeamless.h"
    23 #include <VBoxHook.h>
    24 #include <VBoxDisplay.h>
    25 #include <VBox/VMMDev.h>
    26 #include <iprt/assert.h>
    27 #include <iprt/ldr.h>
    28 #include <VBoxGuestInternal.h>
     38
     39
    2940
    3041typedef struct _VBOXSEAMLESSCONTEXT
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSharedFolders.cpp

    r44529 r51469  
    55
    66/*
    7  * Copyright (C) 2010-2012 Oracle Corporation
     7 * Copyright (C) 2010-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323#include <VBox/VBoxGuestLib.h>
    2424
     25#ifdef DEBUG
     26# define LOG_ENABLED
     27# define LOG_GROUP LOG_GROUP_DEFAULT
     28#endif
     29#include <VBox/log.h>
     30
     31
     32
    2533int VBoxSharedFoldersAutoMount(void)
    2634{
     
    4048            if (VbglR3SharedFolderExists(u32ClientId, "vbsfAutoMount"))
    4149            {
    42                 Log(("VBoxTray: Hosts supports auto-mount root\n"));
     50                LogFlowFunc(("Hosts supports auto-mount root\n"));
    4351            }
    4452            else
    4553            {
    4654#endif
    47                 Log(("VBoxTray: Got %u shared folder mappings\n", cMappings));
     55                LogFlowFunc(("Got %u shared folder mappings\n", cMappings));
    4856                for (uint32_t i = 0; i < cMappings && RT_SUCCESS(rc); i++)
    4957                {
     
    5361                        && *pszName)
    5462                    {
    55                         Log(("VBoxTray: Connecting share %u (%s) ...\n", i+1, pszName));
     63                        LogFlowFunc(("Connecting share %u (%s) ...\n", i+1, pszName));
    5664
    5765                        char *pszShareName;
     
    7785                                if (dwErr == NO_ERROR)
    7886                                {
    79                                     LogRel(("VBoxTray: Shared folder \"%s\" was mounted to drive \"%s\"\n", pszName, szCurDrive));
     87                                    LogRel(("Shared folder \"%s\" was mounted to drive \"%s\"\n", pszName, szCurDrive));
    8088                                    break;
    8189                                }
    8290                                else
    8391                                {
    84                                     LogRel(("VBoxTray: Mounting \"%s\" to \"%s\" resulted in dwErr = %ld\n", pszName, szCurDrive, dwErr));
     92                                    LogRel(("Mounting \"%s\" to \"%s\" resulted in dwErr = %ld\n", pszName, szCurDrive, dwErr));
    8593
    8694                                    switch (dwErr)
     
    94102
    95103                                        default:
    96                                             LogRel(("VBoxTray: Error while mounting shared folder \"%s\" to \"%s\", error = %ld\n",
     104                                            LogRel(("Error while mounting shared folder \"%s\" to \"%s\", error = %ld\n",
    97105                                                    pszName, szCurDrive, dwErr));
    98106                                            break;
     
    103111                            if (chDrive > 'Z')
    104112                            {
    105                                 LogRel(("VBoxTray: No free driver letter found to assign shared folder \"%s\", aborting\n", pszName));
     113                                LogRel(("No free driver letter found to assign shared folder \"%s\", aborting\n", pszName));
    106114                                break;
    107115                            }
     
    114122                    }
    115123                    else
    116                         Log(("VBoxTray: Error while getting the shared folder name for root node = %u, rc = %Rrc\n",
     124                        LogFlowFunc(("Error while getting the shared folder name for root node = %u, rc = %Rrc\n",
    117125                             paMappings[i].u32Root, rc));
    118126                }
     
    123131        }
    124132        else
    125             Log(("VBoxTray: Error while getting the shared folder mappings, rc = %Rrc\n", rc));
     133            LogFlowFunc(("Error while getting the shared folder mappings, rc = %Rrc\n", rc));
    126134        VbglR3SharedFolderDisconnect(u32ClientId);
    127135    }
    128136    else
    129137    {
    130         Log(("VBoxTray: Failed to connect to the shared folder service, error %Rrc\n", rc));
     138        LogFlowFunc(("Failed to connect to the shared folder service, error %Rrc\n", rc));
    131139        /* return success, otherwise VBoxTray will not start! */
    132140        rc = VINF_SUCCESS;
     
    140148    int rc = VbglR3SharedFolderConnect(&u32ClientId);
    141149    if (!RT_SUCCESS(rc))
    142         Log(("VBoxTray: Failed to connect to the shared folder service, error %Rrc\n", rc));
     150        LogFlowFunc(("Failed to connect to the shared folder service, error %Rrc\n", rc));
    143151    else
    144152    {
     
    157165                    && *pszName)
    158166                {
    159                     Log(("VBoxTray: Disconnecting share %u (%s) ...\n", i+1, pszName));
     167                    LogFlowFunc(("Disconnecting share %u (%s) ...\n", i+1, pszName));
    160168
    161169                    char *pszShareName;
     
    165173                        if (dwErr == NO_ERROR)
    166174                        {
    167                             LogRel(("VBoxTray: Share \"%s\" was disconnected\n", pszShareName));
     175                            LogRel(("Share \"%s\" was disconnected\n", pszShareName));
    168176                            RTStrFree(pszShareName);
    169177                            RTStrFree(pszName);
     
    171179                        }
    172180
    173                         LogRel(("VBoxTray: Disconnecting \"%s\" failed, dwErr = %ld\n", pszShareName, dwErr));
     181                        LogRel(("Disconnecting \"%s\" failed, dwErr = %ld\n", pszShareName, dwErr));
    174182
    175183                        switch (dwErr)
     
    179187
    180188                            default:
    181                                 LogRel(("VBoxTray: Error while disconnecting shared folder \"%s\", error = %ld\n",
     189                                LogRel(("Error while disconnecting shared folder \"%s\", error = %ld\n",
    182190                                        pszShareName, dwErr));
    183191                                break;
     
    191199                }
    192200                else
    193                     Log(("VBoxTray: Error while getting the shared folder name for root node = %u, rc = %Rrc\n",
     201                    LogFlowFunc(("Error while getting the shared folder name for root node = %u, rc = %Rrc\n",
    194202                         paMappings[i].u32Root, rc));
    195203            }
     
    197205        }
    198206        else
    199             Log(("VBoxTray: Error while getting the shared folder mappings, rc = %Rrc\n", rc));
     207            LogFlowFunc(("Error while getting the shared folder mappings, rc = %Rrc\n", rc));
    200208        VbglR3SharedFolderDisconnect(u32ClientId);
    201209    }
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r51224 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
     
    2020*   Header Files                                                               *
    2121*******************************************************************************/
    22 #ifdef DEBUG
    23 # define LOG_ENABLED
    24 # define LOG_GROUP LOG_GROUP_DEFAULT
    25 #endif
    26 
    2722#include <package-generated.h>
    2823#include "product-generated.h"
     
    5651#include <iprt/system.h>
    5752#include <iprt/time.h>
     53
     54#ifdef DEBUG
     55# define LOG_ENABLED
     56# define LOG_GROUP LOG_GROUP_DEFAULT
     57#endif
    5858#include <VBox/log.h>
    5959
     
    257257    {
    258258        DWORD dwErr = GetLastError();
    259         Log(("VBoxTray: Could not load tray icon, error %08X\n", dwErr));
     259        Log(("Could not load tray icon, error %08X\n", dwErr));
    260260        return RTErrConvertFromWin32(dwErr);
    261261    }
     
    277277    {
    278278        DWORD dwErr = GetLastError();
    279         Log(("VBoxTray: Could not create tray icon, error = %08X\n", dwErr));
     279        Log(("Could not create tray icon, error = %08X\n", dwErr));
    280280        rc = RTErrConvertFromWin32(dwErr);
    281281        RT_ZERO(gNotifyIconData);
     
    309309    AssertPtrReturn(pTable, VERR_INVALID_POINTER);
    310310
    311     Log(("VBoxTray: Starting services ...\n"));
     311    Log(("Starting services ...\n"));
    312312
    313313    /** @todo Use IPRT events here. */
     
    324324           && pTable->pszName)
    325325    {
    326         Log(("VBoxTray: Starting %s ...\n", pTable->pszName));
     326        Log(("Starting %s ...\n", pTable->pszName));
    327327
    328328        int rc = VINF_SUCCESS;
     
    339339        if (RT_FAILURE(rc))
    340340        {
    341             LogRel(("VBoxTray: Failed to initialize service \"%s\", rc=%Rrc\n",
     341            LogRel(("Failed to initialize service \"%s\", rc=%Rrc\n",
    342342                    pTable->pszName, rc));
    343343        }
     
    363363            else
    364364            {
    365                 Log(("VBoxTray: Failed to start the thread\n"));
     365                Log(("Failed to start the thread\n"));
    366366                if (pTable->pfnDestroy)
    367367                    pTable->pfnDestroy(pEnv, pTable->pInstance);
     
    438438        {
    439439            DWORD dwErr = GetLastError();
    440             Log(("VBoxTray: Registering global message \"%s\" failed, error = %08X\n", dwErr));
     440            Log(("Registering global message \"%s\" failed, error = %08X\n", dwErr));
    441441            rc = RTErrConvertFromWin32(dwErr);
    442442        }
     
    482482    {
    483483        dwErr = GetLastError();
    484         LogRel(("VBoxTray: Could not open VirtualBox Guest Additions driver! Please install / start it first! Error = %08X\n", dwErr));
     484        LogRel(("Could not open VirtualBox Guest Additions driver! Please install / start it first! Error = %08X\n", dwErr));
    485485    }
    486486    return RTErrConvertFromWin32(dwErr);
     
    623623    if (ghwndToolWindow)
    624624    {
    625         Log(("VBoxTray: Destroying tool window ...\n"));
     625        Log(("Destroying tool window ...\n"));
    626626
    627627        /* Destroy the tool window. */
     
    647647    {
    648648        dwErr = GetLastError();
    649         Log(("VBoxTray: Registering invisible tool window failed, error = %08X\n", dwErr));
     649        Log(("Registering invisible tool window failed, error = %08X\n", dwErr));
    650650    }
    651651    else
     
    665665        {
    666666            dwErr = GetLastError();
    667             Log(("VBoxTray: Creating invisible tool window failed, error = %08X\n", dwErr));
     667            Log(("Creating invisible tool window failed, error = %08X\n", dwErr));
    668668        }
    669669        else
     
    672672            hlpReloadCursor();
    673673
    674             Log(("VBoxTray: Invisible tool window handle = %p\n", ghwndToolWindow));
     674            Log(("Invisible tool window handle = %p\n", ghwndToolWindow));
    675675        }
    676676    }
     
    688688    if (GetVersionEx(&info))
    689689    {
    690         Log(("VBoxTray: Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion));
     690        Log(("Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion));
    691691        gMajorVersion = info.dwMajorVersion;
    692692    }
     
    706706    {
    707707        dwErr = GetLastError();
    708         Log(("VBoxTray: SetSecurityDescriptorDacl failed with last error = %08X\n", dwErr));
     708        Log(("SetSecurityDescriptorDacl failed with last error = %08X\n", dwErr));
    709709    }
    710710    else
     
    716716            *(void **)&pfnConvertStringSecurityDescriptorToSecurityDescriptorA =
    717717                RTLdrGetSystemSymbol("advapi32.dll", "ConvertStringSecurityDescriptorToSecurityDescriptorA");
    718             Log(("VBoxTray: pfnConvertStringSecurityDescriptorToSecurityDescriptorA = %x\n", pfnConvertStringSecurityDescriptorToSecurityDescriptorA));
     718            Log(("pfnConvertStringSecurityDescriptorToSecurityDescriptorA = %x\n", pfnConvertStringSecurityDescriptorToSecurityDescriptorA));
    719719            if (pfnConvertStringSecurityDescriptorToSecurityDescriptorA)
    720720            {
     
    729729                {
    730730                    dwErr = GetLastError();
    731                     Log(("VBoxTray: ConvertStringSecurityDescriptorToSecurityDescriptorA failed with last error = %08X\n", dwErr));
     731                    Log(("ConvertStringSecurityDescriptorToSecurityDescriptorA failed with last error = %08X\n", dwErr));
    732732                }
    733733                else
     
    737737                    {
    738738                        dwErr = GetLastError();
    739                         Log(("VBoxTray: GetSecurityDescriptorSacl failed with last error = %08X\n", dwErr));
     739                        Log(("GetSecurityDescriptorSacl failed with last error = %08X\n", dwErr));
    740740                    }
    741741                    else
     
    745745                        {
    746746                            dwErr = GetLastError();
    747                             Log(("VBoxTray: SetSecurityDescriptorSacl failed with last error = %08X\n", dwErr));
     747                            Log(("SetSecurityDescriptorSacl failed with last error = %08X\n", dwErr));
    748748                        }
    749749                    }
     
    759759            {
    760760                dwErr = GetLastError();
    761                 Log(("VBoxTray: CreateEvent for Seamless failed, last error = %08X\n", dwErr));
     761                Log(("CreateEvent for Seamless failed, last error = %08X\n", dwErr));
    762762            }
    763763
     
    766766            {
    767767                dwErr = GetLastError();
    768                 Log(("VBoxTray: CreateEvent for Seamless failed, last error = %08X\n", dwErr));
     768                Log(("CreateEvent for Seamless failed, last error = %08X\n", dwErr));
    769769            }
    770770        }
     
    801801{
    802802    int rc = VINF_SUCCESS;
    803     Log(("VBoxTray: Entering vboxTrayServiceMain\n"));
     803    Log(("Entering vboxTrayServiceMain\n"));
    804804
    805805    ghStopSem = CreateEvent(NULL, TRUE, FALSE, NULL);
     
    807807    {
    808808        rc = RTErrConvertFromWin32(GetLastError());
    809         Log(("VBoxTray: CreateEvent for stopping VBoxTray failed, rc=%Rrc\n", rc));
     809        Log(("CreateEvent for stopping VBoxTray failed, rc=%Rrc\n", rc));
    810810    }
    811811    else
     
    891891                }
    892892
    893                 Log(("VBoxTray: Number of events to wait in main loop: %ld\n", dwEventCount));
     893                Log(("Number of events to wait in main loop: %ld\n", dwEventCount));
    894894                while (true)
    895895                {
     
    898898
    899899                    /* Only enable for message debugging, lots of traffic! */
    900                     //Log(("VBoxTray: Wait result  = %ld\n", waitResult));
     900                    //Log(("Wait result  = %ld\n", waitResult));
    901901
    902902                    if (waitResult == 0)
    903903                    {
    904                         Log(("VBoxTray: Event 'Exit' triggered\n"));
     904                        Log(("Event 'Exit' triggered\n"));
    905905                        /* exit */
    906906                        break;
     
    915915                                if (hWaitEvent[waitResult] == ghSeamlessWtNotifyEvent)
    916916                                {
    917                                     Log(("VBoxTray: Event 'Seamless' triggered\n"));
     917                                    Log(("Event 'Seamless' triggered\n"));
    918918
    919919                                    /* seamless window notification */
     
    923923                                else if (hWaitEvent[waitResult] == ghSeamlessKmNotifyEvent)
    924924                                {
    925                                     Log(("VBoxTray: Event 'Km Seamless' triggered\n"));
     925                                    Log(("Event 'Km Seamless' triggered\n"));
    926926
    927927                                    /* seamless window notification */
     
    931931                                else if (hWaitEvent[waitResult] == vboxDtGetNotifyEvent())
    932932                                {
    933                                     Log(("VBoxTray: Event 'Dt' triggered\n"));
     933                                    Log(("Event 'Dt' triggered\n"));
    934934                                    VBoxTrayCheckDt();
    935935                                    fHandled = TRUE;
     
    945945                            {
    946946#ifndef DEBUG_andy
    947                                 Log(("VBoxTray: msg %p\n", msg.message));
     947                                Log(("msg %p\n", msg.message));
    948948#endif
    949949                                if (msg.message == WM_QUIT)
    950950                                {
    951                                     Log(("VBoxTray: WM_QUIT!\n"));
     951                                    Log(("WM_QUIT!\n"));
    952952                                    SetEvent(ghStopSem);
    953953                                }
     
    958958                    }
    959959                }
    960                 Log(("VBoxTray: Returned from main loop, exiting ...\n"));
    961             }
    962             Log(("VBoxTray: Waiting for services to stop ...\n"));
     960                Log(("Returned from main loop, exiting ...\n"));
     961            }
     962            Log(("Waiting for services to stop ...\n"));
    963963            vboxTrayStopServices(&svcEnv, vboxServiceTable);
    964964        } /* Services started */
     
    968968    vboxTrayRemoveTrayIcon();
    969969
    970     Log(("VBoxTray: Leaving vboxTrayServiceMain with rc=%Rrc\n", rc));
     970    Log(("Leaving vboxTrayServiceMain with rc=%Rrc\n", rc));
    971971    return rc;
    972972}
     
    989989    }
    990990
    991     LogRel(("VBoxTray: %s r%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));
     991    LogRel(("%s r%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));
    992992
    993993    int rc = RTR3InitExeNoArguments(0);
     
    10161016            if (!RT_SUCCESS(rc))
    10171017            {
    1018                 WARN(("VBoxTray: vboxStInit failed, rc %d\n"));
     1018                LogFlowFunc(("vboxStInit failed, rc %d\n"));
    10191019                /* ignore the St Init failure. this can happen for < XP win that do not support WTS API
    10201020                 * in that case the session is treated as active connected to the physical console
     
    10261026            if (!RT_SUCCESS(rc))
    10271027            {
    1028                 WARN(("VBoxTray: vboxDtInit failed, rc %d\n"));
     1028                LogFlowFunc(("vboxDtInit failed, rc %d\n"));
    10291029                /* ignore the Dt Init failure. this can happen for < XP win that do not support WTS API
    10301030                 * in that case the session is treated as active connected to the physical console
     
    10361036            if (!RT_SUCCESS(rc))
    10371037            {
    1038                 WARN(("VBoxAcquireGuestCaps cfg failed rc %d, ignoring..\n", rc));
     1038                LogFlowFunc(("VBoxAcquireGuestCaps cfg failed rc %d, ignoring..\n", rc));
    10391039            }
    10401040
     
    10421042            if (RT_SUCCESS(rc))
    10431043            {
    1044                 Log(("VBoxTray: Init successful\n"));
     1044                Log(("Init successful\n"));
    10451045                rc = vboxTrayServiceMain();
    10461046                if (RT_SUCCESS(rc))
     
    10651065    if (RT_FAILURE(rc))
    10661066    {
    1067         LogRel(("VBoxTray: Error while starting, rc=%Rrc\n", rc));
     1067        LogRel(("Error while starting, rc=%Rrc\n", rc));
    10681068        hlpReportStatus(VBoxGuestFacilityStatus_Failed);
    10691069    }
    1070     LogRel(("VBoxTray: Ended\n"));
     1070    LogRel(("Ended\n"));
    10711071    vboxTrayCloseBaseDriver();
    10721072
     
    10941094        case WM_CREATE:
    10951095        {
    1096             Log(("VBoxTray: Tool window created\n"));
     1096            Log(("Tool window created\n"));
    10971097
    10981098            int rc = vboxTrayRegisterGlobalMessages(&s_vboxGlobalMessageTable[0]);
    10991099            if (RT_FAILURE(rc))
    1100                 Log(("VBoxTray: Error registering global window messages, rc=%Rrc\n", rc));
     1100                Log(("Error registering global window messages, rc=%Rrc\n", rc));
    11011101            return 0;
    11021102        }
     
    11061106
    11071107        case WM_DESTROY:
    1108             Log(("VBoxTray: Tool window destroyed\n"));
     1108            Log(("Tool window destroyed\n"));
    11091109            KillTimer(ghwndToolWindow, TIMERID_VBOXTRAY_CHECK_HOSTVERSION);
    11101110            return 0;
     
    12261226
    12271227        DWORD dwErr = GetLastError();
    1228         WARN(("VBoxTray: WTSQuerySessionInformationA WTSClientProtocolType failed, error = %08X\n", dwErr));
     1228        LogFlowFunc(("WTSQuerySessionInformationA WTSClientProtocolType failed, error = %08X\n", dwErr));
    12291229        rc = RTErrConvertFromWin32(dwErr);
    12301230    }
     
    12321232    {
    12331233        DWORD dwErr = GetLastError();
    1234         WARN(("VBoxTray: WTSQuerySessionInformationA WTSConnectState failed, error = %08X\n", dwErr));
     1234        LogFlowFunc(("WTSQuerySessionInformationA WTSConnectState failed, error = %08X\n", dwErr));
    12351235        rc = RTErrConvertFromWin32(dwErr);
    12361236    }
     
    12601260                                    (void **)&gVBoxSt.pfnWTSQuerySessionInformationA);
    12611261                if (RT_FAILURE(rc))
    1262                     WARN(("VBoxTray: WTSQuerySessionInformationA not found\n"));
     1262                    LogFlowFunc(("WTSQuerySessionInformationA not found\n"));
    12631263            }
    12641264            else
    1265                 WARN(("VBoxTray: WTSUnRegisterSessionNotification not found\n"));
     1265                LogFlowFunc(("WTSUnRegisterSessionNotification not found\n"));
    12661266        }
    12671267        else
    1268             WARN(("VBoxTray: WTSRegisterSessionNotification not found\n"));
     1268            LogFlowFunc(("WTSRegisterSessionNotification not found\n"));
    12691269        if (RT_SUCCESS(rc))
    12701270        {
     
    12751275            {
    12761276                DWORD dwErr = GetLastError();
    1277                 WARN(("VBoxTray: WTSRegisterSessionNotification failed, error = %08X\n", dwErr));
     1277                LogFlowFunc(("WTSRegisterSessionNotification failed, error = %08X\n", dwErr));
    12781278                if (dwErr == RPC_S_INVALID_BINDING)
    12791279                {
     
    12951295    }
    12961296    else
    1297         WARN(("VBoxTray: WTSAPI32 load failed, rc = %Rrc\n", rc));
     1297        LogFlowFunc(("WTSAPI32 load failed, rc = %Rrc\n", rc));
    12981298
    12991299    RT_ZERO(gVBoxSt);
     
    13071307    if (!gVBoxSt.hWTSAPIWnd)
    13081308    {
    1309         WARN(("VBoxTray: vboxStTerm called for non-initialized St\n"));
     1309        LogFlowFunc(("vboxStTerm called for non-initialized St\n"));
    13101310        return;
    13111311    }
     
    13221322        {
    13231323            DWORD dwErr = GetLastError();
    1324             WARN(("VBoxTray: WTSAPI32 load failed, error = %08X\n", dwErr));
     1324            LogFlowFunc(("WTSAPI32 load failed, error = %08X\n", dwErr));
    13251325        }
    13261326    }
     
    13461346        VBOXST_DBG_MAKECASE(WTS_SESSION_REMOTE_CONTROL);
    13471347        default:
    1348             WARN(("VBoxTray: invalid WTS state %d\n", val));
     1348            LogFlowFunc(("invalid WTS state %d\n", val));
    13491349            return "Unknown";
    13501350    }
     
    13651365    {
    13661366        DWORD dwErr = GetLastError();
    1367         WARN(("VBoxTray: timer WTSRegisterSessionNotification failed, error = %08X\n", dwErr));
     1367        LogFlowFunc(("timer WTSRegisterSessionNotification failed, error = %08X\n", dwErr));
    13681368        Assert(gVBoxSt.fIsConsole == TRUE);
    13691369        Assert(gVBoxSt.enmConnectState == WTSActive);
     
    13761376static BOOL vboxStHandleEvent(WPARAM wEvent, LPARAM SessionID)
    13771377{
    1378     WARN(("VBoxTray: WTS Event: %s\n", vboxStDbgGetString(wEvent)));
     1378    LogFlowFunc(("WTS Event: %s\n", vboxStDbgGetString(wEvent)));
    13791379    BOOL fOldIsActiveConsole = vboxStIsActiveConsole();
    13801380
     
    14251425//        {
    14261426//            DWORD dwErr = GetLastError();
    1427 //            WARN(("VBoxTray: pfnGetThreadDesktop for Seamless failed, last error = %08X\n", dwErr));
     1427//            LogFlowFunc(("pfnGetThreadDesktop for Seamless failed, last error = %08X\n", dwErr));
    14281428//        }
    14291429
     
    14331433    {
    14341434        DWORD dwErr = GetLastError();
    1435 //        WARN(("VBoxTray: pfnOpenInputDesktop for Seamless failed, last error = %08X\n", dwErr));
     1435//        LogFlowFunc(("pfnOpenInputDesktop for Seamless failed, last error = %08X\n", dwErr));
    14361436    }
    14371437    return fIsInputDt;
     
    14561456    if (GetVersionEx(&info))
    14571457    {
    1458         LogRel(("VBoxTray: Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion));
     1458        LogRel(("Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion));
    14591459        gMajorVersion = info.dwMajorVersion;
    14601460    }
     
    14761476                                    (void **)&gVBoxDt.pfnVBoxHookRemoveActiveDesktopTracker);
    14771477                if (RT_FAILURE(rc))
    1478                     WARN(("VBoxTray: VBoxHookRemoveActiveDesktopTracker not found\n"));
     1478                    LogFlowFunc(("VBoxHookRemoveActiveDesktopTracker not found\n"));
    14791479            }
    14801480            else
    1481                 WARN(("VBoxTray: VBoxHookInstallActiveDesktopTracker not found\n"));
     1481                LogFlowFunc(("VBoxHookInstallActiveDesktopTracker not found\n"));
    14821482            if (RT_SUCCESS(rc))
    14831483            {
     
    14861486                if (!gVBoxDt.pfnGetThreadDesktop)
    14871487                {
    1488                     WARN(("VBoxTray: GetThreadDesktop not found\n"));
     1488                    LogFlowFunc(("GetThreadDesktop not found\n"));
    14891489                    rc = VERR_NOT_SUPPORTED;
    14901490                }
     
    14931493                if (!gVBoxDt.pfnOpenInputDesktop)
    14941494                {
    1495                     WARN(("VBoxTray: OpenInputDesktop not found\n"));
     1495                    LogFlowFunc(("OpenInputDesktop not found\n"));
    14961496                    rc = VERR_NOT_SUPPORTED;
    14971497                }
     
    15001500                if (!gVBoxDt.pfnCloseDesktop)
    15011501                {
    1502                     WARN(("VBoxTray: CloseDesktop not found\n"));
     1502                    LogFlowFunc(("CloseDesktop not found\n"));
    15031503                    rc = VERR_NOT_SUPPORTED;
    15041504                }
     
    15161516                        {
    15171517                            DWORD dwErr = GetLastError();
    1518                             WARN(("VBoxTray: pfnVBoxHookInstallActiveDesktopTracker failed, last error = %08X\n", dwErr));
     1518                            LogFlowFunc(("pfnVBoxHookInstallActiveDesktopTracker failed, last error = %08X\n", dwErr));
    15191519                        }
    15201520                    }
     
    15261526                        {
    15271527                            DWORD dwErr = GetLastError();
    1528                             WARN(("VBoxTray: SetTimer error %08X\n", dwErr));
     1528                            LogFlowFunc(("SetTimer error %08X\n", dwErr));
    15291529                            rc = RTErrConvertFromWin32(dwErr);
    15301530                        }
     
    15441544        {
    15451545            DWORD dwErr = GetLastError();
    1546             WARN(("VBoxTray: CreateEvent for Seamless failed, last error = %08X\n", dwErr));
     1546            LogFlowFunc(("CreateEvent for Seamless failed, last error = %08X\n", dwErr));
    15471547            rc = RTErrConvertFromWin32(dwErr);
    15481548        }
     
    15531553    {
    15541554        DWORD dwErr = GetLastError();
    1555         WARN(("VBoxTray: CreateEvent for Seamless failed, last error = %08X\n", dwErr));
     1555        LogFlowFunc(("CreateEvent for Seamless failed, last error = %08X\n", dwErr));
    15561556        rc = RTErrConvertFromWin32(dwErr);
    15571557    }
     
    16031603    DWORD cbReturned = 0;
    16041604    VBoxGuestCapsAquire Info;
    1605     Log(("VBoxTray: VBoxAcquireGuestCaps or(0x%x), not(0x%x), cfx(%d)\n", fOr, fNot, fCfg));
     1605    Log(("VBoxAcquireGuestCaps or(0x%x), not(0x%x), cfx(%d)\n", fOr, fNot, fCfg));
    16061606    Info.enmFlags = fCfg ? VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE : VBOXGUESTCAPSACQUIRE_FLAGS_NONE;
    16071607    Info.rc = VERR_NOT_IMPLEMENTED;
     
    16111611    {
    16121612        DWORD LastErr = GetLastError();
    1613         WARN(("VBoxTray: DeviceIoControl VBOXGUEST_IOCTL_GUEST_CAPS_ACQUIRE failed LastErr %d\n", LastErr));
     1613        LogFlowFunc(("DeviceIoControl VBOXGUEST_IOCTL_GUEST_CAPS_ACQUIRE failed LastErr %d\n", LastErr));
    16141614        return RTErrConvertFromWin32(LastErr);
    16151615    }
     
    16181618    if (!RT_SUCCESS(rc))
    16191619    {
    1620         WARN(("VBoxTray: VBOXGUEST_IOCTL_GUEST_CAPS_ACQUIRE failed rc %d\n", rc));
     1620        LogFlowFunc(("VBOXGUEST_IOCTL_GUEST_CAPS_ACQUIRE failed rc %d\n", rc));
    16211621        return rc;
    16221622    }
     
    16631663    if (fEnabled)
    16641664    {
    1665         Log(("VBoxTray: vboxCapsOnEnableSeamles: ENABLED\n"));
     1665        Log(("vboxCapsOnEnableSeamles: ENABLED\n"));
    16661666        Assert(pCap->enmAcState == VBOXCAPS_ENTRY_ACSTATE_ACQUIRED);
    16671667        Assert(pCap->enmFuncState == VBOXCAPS_ENTRY_FUNCSTATE_STARTED);
     
    16701670    else
    16711671    {
    1672         Log(("VBoxTray: vboxCapsOnEnableSeamles: DISABLED\n"));
     1672        Log(("vboxCapsOnEnableSeamles: DISABLED\n"));
    16731673        Assert(pCap->enmAcState != VBOXCAPS_ENTRY_ACSTATE_ACQUIRED || pCap->enmFuncState != VBOXCAPS_ENTRY_FUNCSTATE_STARTED);
    16741674        VBoxSeamlessDisable();
     
    16801680    VBOXCAPS *pConsole = &gVBoxCaps;
    16811681
    1682     Log(("VBoxTray: vboxCapsEntryAcStateSet: new state enmAcState(%d); pCap: fCap(%d), iCap(%d), enmFuncState(%d), enmAcState(%d)\n",
     1682    Log(("vboxCapsEntryAcStateSet: new state enmAcState(%d); pCap: fCap(%d), iCap(%d), enmFuncState(%d), enmAcState(%d)\n",
    16831683            enmAcState, pCap->fCap, pCap->iCap, pCap->enmFuncState, pCap->enmAcState));
    16841684
     
    17081708    VBOXCAPS *pConsole = &gVBoxCaps;
    17091709
    1710     Log(("VBoxTray: vboxCapsEntryFuncStateSet: new state enmAcState(%d); pCap: fCap(%d), iCap(%d), enmFuncState(%d), enmAcState(%d)\n",
     1710    Log(("vboxCapsEntryFuncStateSet: new state enmAcState(%d); pCap: fCap(%d), iCap(%d), enmFuncState(%d), enmAcState(%d)\n",
    17111711            enmFuncState, pCap->fCap, pCap->iCap, pCap->enmFuncState, pCap->enmAcState));
    17121712
     
    17561756{
    17571757    VBOXCAPS *pConsole = &gVBoxCaps;
    1758     Log(("VBoxTray: VBoxCapsReleaseAll\n"));
     1758    Log(("VBoxCapsReleaseAll\n"));
    17591759    int rc = VBoxAcquireGuestCaps(0, VMMDEV_GUEST_SUPPORTS_SEAMLESS | VMMDEV_GUEST_SUPPORTS_GRAPHICS, false);
    17601760    if (!RT_SUCCESS(rc))
    17611761    {
    1762         WARN(("VBoxTray: vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc));
     1762        LogFlowFunc(("vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc));
    17631763        return rc;
    17641764    }
     
    17661766    if (pConsole->idTimer)
    17671767    {
    1768         Log(("VBoxTray: killing console timer\n"));
     1768        Log(("killing console timer\n"));
    17691769        KillTimer(ghwndToolWindow, pConsole->idTimer);
    17701770        pConsole->idTimer = 0;
     
    18431843    if (pCap->enmAcState == VBOXCAPS_ENTRY_ACSTATE_RELEASED)
    18441844    {
    1845         WARN(("VBoxTray: invalid cap[%d] state[%d] on release\n", iCap, pCap->enmAcState));
     1845        LogFlowFunc(("invalid cap[%d] state[%d] on release\n", iCap, pCap->enmAcState));
    18461846        return VERR_INVALID_STATE;
    18471847    }
     
    18631863    Assert(VBoxConsoleIsAllowed());
    18641864    VBOXCAPS_ENTRY *pCap = &pConsole->aCaps[iCap];
    1865     Log(("VBoxTray: VBoxCapsEntryAcquire %d\n", iCap));
     1865    Log(("VBoxCapsEntryAcquire %d\n", iCap));
    18661866    if (pCap->enmAcState != VBOXCAPS_ENTRY_ACSTATE_RELEASED)
    18671867    {
    1868         WARN(("VBoxTray: invalid cap[%d] state[%d] on acquire\n", iCap, pCap->enmAcState));
     1868        LogFlowFunc(("invalid cap[%d] state[%d] on acquire\n", iCap, pCap->enmAcState));
    18691869        return VERR_INVALID_STATE;
    18701870    }
     
    18801880    if (rc != VERR_RESOURCE_BUSY)
    18811881    {
    1882         WARN(("VBoxTray: vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc));
     1882        LogFlowFunc(("vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc));
    18831883        return rc;
    18841884    }
    18851885
    1886     WARN(("VBoxTray: iCap %d is busy!\n", iCap));
     1886    LogFlowFunc(("iCap %d is busy!\n", iCap));
    18871887
    18881888    /* the cap was busy, most likely it is still used by other VBoxTray instance running in another session,
     
    18941894        {
    18951895            DWORD dwErr = GetLastError();
    1896             WARN(("VBoxTray: SetTimer error %08X\n", dwErr));
     1896            LogFlowFunc(("SetTimer error %08X\n", dwErr));
    18971897            return RTErrConvertFromWin32(dwErr);
    18981898        }
     
    19051905{
    19061906    VBOXCAPS *pConsole = &gVBoxCaps;
    1907     Log(("VBoxTray: VBoxCapsAcquireAllSupported\n"));
     1907    Log(("VBoxCapsAcquireAllSupported\n"));
    19081908    for (int i = 0; i < RT_ELEMENTS(pConsole->aCaps); ++i)
    19091909    {
    19101910        if (pConsole->aCaps[i].enmFuncState >= VBOXCAPS_ENTRY_FUNCSTATE_SUPPORTED)
    19111911        {
    1912             Log(("VBoxTray: VBoxCapsAcquireAllSupported acquiring cap %d, state %d\n", i, pConsole->aCaps[i].enmFuncState));
     1912            Log(("VBoxCapsAcquireAllSupported acquiring cap %d, state %d\n", i, pConsole->aCaps[i].enmFuncState));
    19131913            VBoxCapsEntryAcquire(i);
    19141914        }
    19151915        else
    19161916        {
    1917             WARN(("VBoxTray: VBoxCapsAcquireAllSupported: WARN: cap %d not supported, state %d\n", i, pConsole->aCaps[i].enmFuncState));
     1917            LogFlowFunc(("VBoxCapsAcquireAllSupported: WARN: cap %d not supported, state %d\n", i, pConsole->aCaps[i].enmFuncState));
    19181918        }
    19191919    }
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.h

    r51224 r51469  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848
    4949#include <VBox/version.h>
    50 #include <VBox/Log.h>
    5150#include <VBox/VBoxGuest.h> /** @todo use the VbglR3 interface! */
    5251#include <VBox/VBoxGuestLib.h>
     
    5453
    5554#include "VBoxDispIf.h"
    56 
    57 #ifdef DEBUG_misha
    58 #define WARN(_m) do { \
    59             Assert(0); \
    60             Log(_m); \
    61         } while (0)
    62 #else
    63 #define WARN(_m) do { \
    64             Log(_m); \
    65         } while (0)
    66 #endif
    6755
    6856/*
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp

    r49891 r51469  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2222#include "VBoxHelpers.h"
    2323#include "VBoxVRDP.h"
     24
    2425#include <VBox/VMMDev.h>
     26#ifdef DEBUG
     27# define LOG_ENABLED
     28# define LOG_GROUP LOG_GROUP_DEFAULT
     29#endif
     30#include <VBox/log.h>
     31
    2532#include <VBoxGuestInternal.h>
    2633#include <iprt/assert.h>
    2734#include <iprt/ldr.h>
     35
    2836
    2937
     
    94102             * The parameter has to be disabled.
    95103             */
    96             Log(("VBoxTray: vboxExperienceSet: Saving %s\n", parameters[i].name));
     104            LogFlowFunc(("Saving %s\n", parameters[i].name));
    97105
    98106            /* Save the current value. */
     
    128136                    if (parameters[i].cbSavedValue > sizeof (parameters[i].achSavedValue))
    129137                    {
    130                         Log(("VBoxTray: vboxExperienceSet: Not enough space %d > %d\n", parameters[i].cbSavedValue, sizeof (parameters[i].achSavedValue)));
     138                        LogFlowFunc(("Not enough space %d > %d\n", parameters[i].cbSavedValue, sizeof (parameters[i].achSavedValue)));
    131139                        break;
    132140                    }
     
    144152            }
    145153
    146             Log(("VBoxTray: vboxExperienceSet: Disabling %s\n", parameters[i].name));
     154            LogFlowFunc(("Disabling %s\n", parameters[i].name));
    147155
    148156            /* Disable the feature. */
     
    199207        if (parameters[i].level > level)
    200208        {
    201             Log(("VBoxTray: vboxExperienceRestore: Restoring %s\n", parameters[i].name));
     209            LogFlowFunc(("Restoring %s\n", parameters[i].name));
    202210
    203211            /* Restore the feature. */
     
    269277int VBoxVRDPInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread)
    270278{
    271     Log(("VBoxTray: VBoxVRDPInit\n"));
     279    LogFlowFunc(("VBoxVRDPInit\n"));
    272280
    273281    gCtx.pEnv      = pEnv;
     
    296304void VBoxVRDPDestroy(const VBOXSERVICEENV *pEnv, void *pInstance)
    297305{
    298     Log(("VBoxTray: VBoxVRDPDestroy\n"));
     306    LogFlowFunc(("VBoxVRDPDestroy\n"));
    299307    VBOXVRDPCONTEXT *pCtx = (VBOXVRDPCONTEXT *)pInstance;
    300308    vboxExperienceRestore (pCtx->level);
     
    322330    if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
    323331    {
    324         Log(("VBoxTray: VBoxVRDPThread: DeviceIOControl(CtlMask - or) succeeded\n"));
     332        LogFlowFunc(("DeviceIOControl(CtlMask - or) succeeded\n"));
    325333    }
    326334    else
    327335    {
    328         Log(("VBoxTray: VBoxVRDPThread: DeviceIOControl(CtlMask) failed\n"));
     336        LogFlowFunc(("DeviceIOControl(CtlMask) failed\n"));
    329337        return 0;
    330338    }
     
    338346        if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent), &waitEvent, sizeof(waitEvent), &cbReturned, NULL))
    339347        {
    340             Log(("VBoxTray: VBoxVRDPThread: DeviceIOControl succeeded\n"));
     348            LogFlowFunc(("DeviceIOControl succeeded\n"));
    341349
    342350            /* are we supposed to stop? */
     
    344352                break;
    345353
    346             Log(("VBoxTray: VBoxVRDPThread: checking event\n"));
     354            LogFlowFunc(("checking event\n"));
    347355
    348356            /* did we get the right event? */
     
    366374                                     &cbReturned, NULL))
    367375                {
    368                     Log(("VBoxTray: VBoxVRDPThread: u8VRDPActive = %d, level %d\n", vrdpChangeRequest.u8VRDPActive, vrdpChangeRequest.u32VRDPExperienceLevel));
     376                    LogFlowFunc(("u8VRDPActive = %d, level %d\n", vrdpChangeRequest.u8VRDPActive, vrdpChangeRequest.u32VRDPExperienceLevel));
    369377
    370378                    if (vrdpChangeRequest.u8VRDPActive)
     
    379387                            pCtx->fSavedThemeEnabled = pCtx->pfnIsThemeActive ();
    380388
    381                             Log(("VBoxTray: VBoxVRDPThread: pCtx->fSavedThemeEnabled = %d\n", pCtx->fSavedThemeEnabled));
     389                            LogFlowFunc(("pCtx->fSavedThemeEnabled = %d\n", pCtx->fSavedThemeEnabled));
    382390
    383391                            if (pCtx->fSavedThemeEnabled)
     
    397405                                /* @todo the call returns S_OK but theming remains disabled. */
    398406                                HRESULT hrc = pCtx->pfnEnableTheming (TRUE);
    399                                 Log(("VBoxTray: VBoxVRDPThread: enabling theme rc = 0x%08X\n", hrc));
     407                                LogFlowFunc(("enabling theme rc = 0x%08X\n", hrc));
    400408                                pCtx->fSavedThemeEnabled = FALSE;
    401409                            }
     
    410418                {
    411419#ifndef DEBUG_andy /* Too noisy for me. */
    412                     Log(("VBoxTray: VBoxVRDPThread: Error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n"));
     420                    LogFlowFunc(("Error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n"));
    413421#endif
    414422                    /* sleep a bit to not eat too much CPU in case the above call always fails */
     
    424432        {
    425433#ifndef DEBUG_andy
    426             Log(("VBoxTray: VBoxVRDPThread: Error from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n"));
     434            LogFlowFunc(("Error from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n"));
    427435#endif
    428436            /* sleep a bit to not eat too much CPU in case the above call always fails */
     
    439447    if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL))
    440448    {
    441         Log(("VBoxTray: VBoxVRDPThread: DeviceIOControl(CtlMask - not) succeeded\n"));
     449        LogFlowFunc(("DeviceIOControl(CtlMask - not) succeeded\n"));
    442450    }
    443451    else
    444452    {
    445         Log(("VBoxTray: VBoxVRDPThread: DeviceIOControl(CtlMask) failed\n"));
    446     }
    447 
    448     Log(("VBoxTray: VBoxVRDPThread: Finished VRDP change request thread\n"));
     453        LogFlowFunc(("DeviceIOControl(CtlMask) failed\n"));
     454    }
     455
     456    LogFlowFunc(("Finished VRDP change request thread\n"));
    449457    return 0;
    450458}
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