Changeset 51469 in vbox
- Timestamp:
- May 30, 2014 11:49:42 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94055
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r50323 r51469 6 6 7 7 /* 8 * Copyright (C) 2006-201 2Oracle Corporation8 * Copyright (C) 2006-2014 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 23 23 #include <strsafe.h> 24 24 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 25 34 typedef struct _VBOXCLIPBOARDCONTEXT 26 35 { … … 67 76 while ((format = EnumClipboardFormats (format)) != 0) 68 77 { 69 Log (("VBoxTray:vboxClipboardChanged: format = 0x%08X\n", format));78 LogFlowFunc(("vboxClipboardChanged: format = 0x%08X\n", format)); 70 79 switch (format) 71 80 { … … 141 150 HWND hwndNext = (HWND)lParam; 142 151 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)); 144 153 145 154 if (hwndRemoved == pCtx->hwndNextInChain) … … 164 173 case WM_DRAWCLIPBOARD: 165 174 { 166 Log (("VBoxTray: vboxClipboardProcessMsg:WM_DRAWCLIPBOARD, hwnd %p\n", pCtx->hwnd));175 LogFlowFunc(("WM_DRAWCLIPBOARD, hwnd %p\n", pCtx->hwnd)); 167 176 168 177 if (GetClipboardOwner () != hwnd) … … 172 181 int vboxrc = vboxClipboardChanged(pCtx); 173 182 if (RT_FAILURE(vboxrc)) 174 Log (("VBoxTray: vboxClipboardProcessMsg:vboxClipboardChanged failed, rc = %Rrc\n", vboxrc));183 LogFlowFunc(("vboxClipboardChanged failed, rc = %Rrc\n", vboxrc)); 175 184 } 176 185 … … 209 218 UINT format = (UINT)wParam; 210 219 211 Log (("VBoxTray: vboxClipboardProcessMsg:WM_RENDERFORMAT, format = %x\n", format));220 LogFlowFunc(("WM_RENDERFORMAT, format = %x\n", format)); 212 221 switch (format) 213 222 { … … 240 249 { 241 250 /* 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)); 243 252 EmptyClipboard(); 244 253 } … … 250 259 /* Preallocate a buffer, most of small text transfers will fit into it. */ 251 260 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)); 253 262 254 263 if (hMem) 255 264 { 256 265 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))); 258 267 259 268 if (pMem) … … 261 270 /* Read the host data to the preallocated buffer. */ 262 271 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)); 264 273 265 274 if (RT_SUCCESS(vboxrc)) … … 280 289 /* The preallocated buffer is too small, adjust the size. */ 281 290 hMem = GlobalReAlloc(hMem, cb, 0); 282 Log (("VBoxTray: vboxClipboardProcessMsg:Reallocated hMem = %p\n", hMem));291 LogFlowFunc(("Reallocated hMem = %p\n", hMem)); 283 292 284 293 if (hMem) 285 294 { 286 295 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))); 288 297 289 298 if (pMem) … … 292 301 uint32_t cbNew = 0; 293 302 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)); 295 304 296 305 if (RT_SUCCESS (vboxrc) && cbNew <= cb) … … 345 354 346 355 hMem = GlobalReAlloc(hMem, cb, 0); 347 Log (("VBoxTray: vboxClipboardProcessMsg:Reallocated hMem = %p\n", hMem));356 LogFlowFunc(("Reallocated hMem = %p\n", hMem)); 348 357 349 358 if (hMem) … … 352 361 * size is 'cb' and format is 'format'. */ 353 362 HANDLE hClip = SetClipboardData(format, hMem); 354 Log (("VBoxTray: vboxClipboardProcessMsg:WM_RENDERFORMAT hClip = %p\n", hClip));363 LogFlowFunc(("WM_RENDERFORMAT hClip = %p\n", hClip)); 355 364 356 365 if (hClip) … … 395 404 if (FALSE == OpenClipboard(hwnd)) 396 405 { 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())); 398 407 } 399 408 else … … 405 414 if (u32Formats & VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) 406 415 { 407 Log (("VBoxTray: vboxClipboardProcessMsg:WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n"));416 LogFlowFunc(("WM_USER: VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT\n")); 408 417 hClip = SetClipboardData(CF_UNICODETEXT, NULL); 409 418 } … … 411 420 if (u32Formats & VBOX_SHARED_CLIPBOARD_FMT_BITMAP) 412 421 { 413 Log (("VBoxTray: vboxClipboardProcessMsg:WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n"));422 LogFlowFunc(("WM_USER: VBOX_SHARED_CLIPBOARD_FMT_BITMAP\n")); 414 423 hClip = SetClipboardData(CF_DIB, NULL); 415 424 } … … 418 427 { 419 428 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)); 421 430 if (format != 0) 422 431 { … … 426 435 427 436 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 ())); 429 438 } 430 439 } break; … … 438 447 if (FALSE == OpenClipboard(hwnd)) 439 448 { 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())); 441 450 } 442 451 else … … 452 461 if (lp != NULL) 453 462 { 454 Log (("VBoxTray: vboxClipboardProcessMsg:WM_USER + 1: CF_DIB\n"));463 LogFlowFunc(("WM_USER + 1: CF_DIB\n")); 455 464 vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_BITMAP, 456 465 lp, GlobalSize(hClip)); … … 473 482 if (uniString != NULL) 474 483 { 475 Log (("VBoxTray: vboxClipboardProcessMsg:WM_USER + 1: CF_UNICODETEXT\n"));484 LogFlowFunc(("WM_USER + 1: CF_UNICODETEXT\n")); 476 485 vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 477 486 uniString, (lstrlenW(uniString) + 1) * 2); … … 496 505 if (lp != NULL) 497 506 { 498 Log (("VBoxTray: vboxClipboardProcessMsg:WM_USER + 1: CF_HTML\n"));507 LogFlowFunc(("WM_USER + 1: CF_HTML\n")); 499 508 vboxrc = VbglR3ClipboardWriteData(pCtx->u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_HTML, 500 509 lp, GlobalSize(hClip)); … … 526 535 527 536 #ifndef DEBUG_andy 528 Log (("VBoxTray:vboxClipboardProcessMsg returned with rc = %ld\n", rc));537 LogFlowFunc(("vboxClipboardProcessMsg returned with rc = %ld\n", rc)); 529 538 #endif 530 539 return rc; … … 578 587 } 579 588 580 Log (("VBoxTray:vboxClipboardInit returned with rc = %Rrc\n", rc));589 LogFlowFunc(("vboxClipboardInit returned with rc = %Rrc\n", rc)); 581 590 return rc; 582 591 } … … 612 621 int VBoxClipboardInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread) 613 622 { 614 Log (("VBoxTray:VBoxClipboardInit\n"));623 LogFlowFunc(("VBoxClipboardInit\n")); 615 624 if (gCtx.pEnv) 616 625 { … … 651 660 unsigned __stdcall VBoxClipboardThread(void *pInstance) 652 661 { 653 Log (("VBoxTray:VBoxClipboardThread\n"));662 LogFlowFunc(("VBoxClipboardThread\n")); 654 663 655 664 VBOXCLIPBOARDCONTEXT *pCtx = (VBOXCLIPBOARDCONTEXT *)pInstance; … … 664 673 if (RT_FAILURE(rc)) 665 674 { 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)); 667 676 if (rc == VERR_INTERRUPTED) 668 677 { … … 681 690 else 682 691 { 683 Log (("VBoxTray:VBoxClipboardThread: VbglR3ClipboardGetHostMsg u32Msg = %ld, u32Formats = %ld\n", u32Msg, u32Formats));692 LogFlowFunc(("VBoxClipboardThread: VbglR3ClipboardGetHostMsg u32Msg = %ld, u32Formats = %ld\n", u32Msg, u32Formats)); 684 693 switch (u32Msg) 685 694 { … … 706 715 default: 707 716 { 708 Log (("VBoxTray:VBoxClipboardThread: Unsupported message from host! Message = %ld\n", u32Msg));717 LogFlowFunc(("VBoxClipboardThread: Unsupported message from host! Message = %ld\n", u32Msg)); 709 718 } 710 719 } … … 719 728 if (pCtx != &gCtx) 720 729 { 721 Log (("VBoxTray:VBoxClipboardDestroy: invalid instance %p (our = %p)!\n", pCtx, &gCtx));730 LogFlowFunc(("VBoxClipboardDestroy: invalid instance %p (our = %p)!\n", pCtx, &gCtx)); 722 731 pCtx = &gCtx; 723 732 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r49010 r51469 1 1 /** @file 2 * VBox Tray - Display Settings Interface abstraction for XPDM & WDDM2 * VBoxDispIf.cpp - Display Settings Interface abstraction for XPDM & WDDM. 3 3 */ 4 4 5 5 /* 6 * Copyright (C) 2006-201 2Oracle Corporation6 * Copyright (C) 2006-2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 14 14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 15 15 */ 16 17 16 #include "VBoxTray.h" 17 #include "VBoxDisplay.h" 18 19 #include <malloc.h> 18 20 #define _WIN32_WINNT 0x0601 21 19 22 #include <iprt/log.h> 20 23 #include <iprt/err.h> 21 24 #include <iprt/assert.h> 22 25 23 #include <malloc.h>24 25 26 #ifdef VBOX_WITH_WDDM 26 27 #include <iprt/asm.h> 27 28 #endif 28 29 29 #include "VBoxDisplay.h" 30 30 31 31 32 #ifndef NT_SUCCESS … … 84 85 if (winEr != ERROR_SUCCESS) 85 86 { 86 WARN(("VBoxTray: (WDDM) Failed GetDisplayConfigBufferSizes\n"));87 LogFlowFunc(("Failed calling GetDisplayConfigBufferSizes, dwErr=%ld\n", winEr)); 87 88 return winEr; 88 89 } 89 90 91 /** @todo r=andy Why using malloc() instead of RTMemAlloc*? */ 90 92 pPathInfoArray = (DISPLAYCONFIG_PATH_INFO *)malloc(cPathInfoArray * sizeof(DISPLAYCONFIG_PATH_INFO)); 91 93 if (!pPathInfoArray) 92 94 { 93 WARN(("VBoxTray: (WDDM) malloc failed!\n"));95 LogFlowFunc(("Allocating pPathInfoArray failed\n")); 94 96 return ERROR_OUTOFMEMORY; 95 97 } … … 97 99 if (!pModeInfoArray) 98 100 { 99 WARN(("VBoxTray: (WDDM) malloc failed!\n"));101 LogFlowFunc(("Allocating pModeInfoArray failed\n")); 100 102 free(pPathInfoArray); 101 103 return ERROR_OUTOFMEMORY; … … 105 107 if (winEr != ERROR_SUCCESS) 106 108 { 107 WARN(("VBoxTray: (WDDM) Failed QueryDisplayConfig\n"));109 LogFlowFunc(("Failed calling QueryDisplayConfig, dwErr=%ld\n", winEr)); 108 110 free(pPathInfoArray); 109 111 free(pModeInfoArray); … … 122 124 memset(pCfgDst, 0, sizeof (*pCfgDst)); 123 125 126 /** @todo r=andy Why using malloc() instead of RTMemAlloc*? */ 124 127 if (pCfg->cPathInfoArray) 125 128 { … … 127 130 if (!pCfgDst->pPathInfoArray) 128 131 { 129 WARN(("VBoxTray: (WDDM)malloc failed!\n"));132 LogFlowFunc(("malloc failed!\n")); 130 133 return ERROR_OUTOFMEMORY; 131 134 } … … 141 144 if (!pCfgDst->pModeInfoArray) 142 145 { 143 WARN(("VBoxTray: (WDDM)malloc failed!\n"));146 LogFlowFunc(("malloc failed!\n")); 144 147 if (pCfgDst->pPathInfoArray) 145 148 { … … 179 182 if (winEr != ERROR_SUCCESS) 180 183 { 181 WARN(("VBoxTray:(WDDM) vboxDispIfWddmDcCreate Failed winEr %d\n", winEr));184 LogFlowFunc(("vboxDispIfWddmDcCreate failed winEr %ld\n", winEr)); 182 185 return winEr; 183 186 } … … 255 258 if (!pModeInfoArray) 256 259 { 257 WARN(("VBoxTray: (WDDM)malloc failed!\n"));260 LogFlowFunc(("malloc failed!\n")); 258 261 return ERROR_OUTOFMEMORY; 259 262 } … … 280 283 { 281 284 282 WARN(("VBoxTray: (WDDM)no source mode index specified"));285 LogFlowFunc(("no source mode index specified")); 283 286 DWORD winEr = vboxDispIfWddmDcSettingsModeAdd(pCfg, &iSrcMode); 284 287 if (winEr != ERROR_SUCCESS) 285 288 { 286 WARN(("VBoxTray:(WDDM)vboxDispIfWddmDcSettingsModeAdd Failed winEr %d\n", winEr));289 LogFlowFunc(("vboxDispIfWddmDcSettingsModeAdd Failed winEr %d\n", winEr)); 287 290 return winEr; 288 291 } … … 298 301 { 299 302 /* 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")); 301 304 return ERROR_NOT_SUPPORTED; 302 305 } … … 329 332 break; 330 333 default: 331 LogRel((" VBoxTray: (WDDM)invalid bpp %d, using 32\n", pDeviceMode->dmBitsPerPel));334 LogRel(("invalid bpp %d, using 32\n", pDeviceMode->dmBitsPerPel)); 332 335 pCfg->pModeInfoArray[iSrcMode].sourceMode.pixelFormat = DISPLAYCONFIG_PIXELFORMAT_32BPP; 333 336 break; … … 350 353 DWORD winEr = gCtx.pfnSetDisplayConfig(pCfg->cPathInfoArray, pCfg->pPathInfoArray, pCfg->cModeInfoArray, pCfg->pModeInfoArray, fFlags); 351 354 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)); 353 356 return winEr; 354 357 } … … 394 397 if (winEr != ERROR_SUCCESS) 395 398 { 396 WARN(("VBoxTray:(WDDM)vboxDispIfWddmDcQueryNumDisplays Failed winEr %d\n", winEr));399 LogFlowFunc(("vboxDispIfWddmDcQueryNumDisplays Failed winEr %d\n", winEr)); 397 400 return winEr; 398 401 } … … 401 404 if (!pPathInfoArray) 402 405 { 403 WARN(("malloc failed\n"));406 LogFlowFunc(("malloc failed\n")); 404 407 return ERROR_OUTOFMEMORY; 405 408 } … … 413 416 if (idx >= 0) 414 417 { 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")); 416 419 } 417 420 } … … 426 429 if (winEr != ERROR_SUCCESS) 427 430 { 428 WARN(("VBoxTray:(WDDM)vboxDispIfWddmDcCreate Failed winEr %d\n", winEr));431 LogFlowFunc(("vboxDispIfWddmDcCreate Failed winEr %d\n", winEr)); 429 432 free(pPathInfoArray); 430 433 return winEr; … … 436 439 if (idx < 0) 437 440 { 438 WARN(("VBoxTray:(WDDM)%d %d path not supported\n", i, i));441 LogFlowFunc(("%d %d path not supported\n", i, i)); 439 442 idx = vboxDispIfWddmDcSearchPath(pCfg, -1, i); 440 443 if (idx < 0) 441 444 { 442 WARN(("VBoxTray:(WDDM)%d %d path not supported\n", -1, i));445 LogFlowFunc(("%d %d path not supported\n", -1, i)); 443 446 } 444 447 } … … 450 453 if (pPathInfoArray[i].flags & DISPLAYCONFIG_PATH_ACTIVE) 451 454 { 452 WARN(("VBoxTray:(WDDM)disabled path %d %d is marked active\n",455 LogFlowFunc(("disabled path %d %d is marked active\n", 453 456 pPathInfoArray[i].sourceInfo.id, pPathInfoArray[i].targetInfo.id)); 454 457 pPathInfoArray[i].flags &= ~DISPLAYCONFIG_PATH_ACTIVE; … … 518 521 return ERROR_SUCCESS; 519 522 else 520 WARN(("VBoxTray:vboxDispKmtCreateContext failed hr 0x%x", hr));523 LogFlowFunc(("vboxDispKmtCreateContext failed hr 0x%x", hr)); 521 524 522 525 vboxDispKmtDestroyDevice(&pOp->Device); 523 526 } 524 527 else 525 WARN(("VBoxTray:vboxDispKmtCreateDevice failed hr 0x%x", hr));528 LogFlowFunc(("vboxDispKmtCreateDevice failed hr 0x%x", hr)); 526 529 527 530 vboxDispKmtCloseAdapter(&pOp->Adapter); … … 597 600 if (OSinfo.dwMajorVersion >= 6) 598 601 { 599 Log ((__FUNCTION__":this is vista and up\n"));602 LogFlowFunc(("this is vista and up\n")); 600 603 HMODULE hUser = GetModuleHandle("user32.dll"); 601 604 if (hUser) 602 605 { 603 606 *(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)); 605 608 bSupported &= !!(pIf->modeData.wddm.pfnChangeDisplaySettingsEx); 606 609 607 610 *(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)); 609 612 bSupported &= !!(pIf->modeData.wddm.pfnEnumDisplayDevices); 610 613 /* for win 7 and above */ … … 612 615 { 613 616 *(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)); 615 618 bSupported &= !!(gCtx.pfnSetDisplayConfig); 616 619 617 620 *(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)); 619 622 bSupported &= !!(gCtx.pfnQueryDisplayConfig); 620 623 621 624 *(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)); 623 626 bSupported &= !!(gCtx.pfnGetDisplayConfigBufferSizes); 624 627 } … … 628 631 if (FAILED(hr)) 629 632 { 630 WARN(("VBoxTray:vboxDispKmtCallbacksInit failed hr 0x%x\n", hr));633 LogFlowFunc(("vboxDispKmtCallbacksInit failed hr 0x%x\n", hr)); 631 634 err = hr; 632 635 } … … 634 637 else 635 638 { 636 WARN((__FUNCTION__":GetModuleHandle(USER32) failed, err(%d)\n", GetLastError()));639 LogFlowFunc(("GetModuleHandle(USER32) failed, err(%d)\n", GetLastError())); 637 640 err = ERROR_NOT_SUPPORTED; 638 641 } … … 640 643 else 641 644 { 642 WARN((__FUNCTION__": cannot 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")); 643 646 err = ERROR_NOT_SUPPORTED; 644 647 } … … 679 682 { 680 683 winEr = GetLastError(); 681 WARN(("CreateDC failed %d", winEr));684 LogFlowFunc(("CreateDC failed %d", winEr)); 682 685 break; 683 686 } 684 687 } 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)); 686 689 } 687 690 else 688 691 { 689 692 winEr = GetLastError(); 690 WARN(("EnumDisplayDevices failed %d", winEr));693 LogFlowFunc(("EnumDisplayDevices failed %d", winEr)); 691 694 break; 692 695 } 693 696 } 694 697 695 WARN(("vboxDispIfWDDMAdpHdcCreate failure branch %d", winEr));698 LogFlowFunc(("vboxDispIfWDDMAdpHdcCreate failure branch %d", winEr)); 696 699 return winEr; 697 700 } … … 704 707 if (!SUCCEEDED(hr)) 705 708 { 706 WARN(("VBoxTray:vboxDispKmtOpenAdapter failed hr 0x%x\n", hr));709 LogFlowFunc(("vboxDispKmtOpenAdapter failed hr 0x%x\n", hr)); 707 710 return hr; 708 711 } … … 723 726 else 724 727 { 725 WARN(("VBoxTray:pfnD3DKMTEscape failed Status 0x%x\n", Status));728 LogFlowFunc(("pfnD3DKMTEscape failed Status 0x%x\n", Status)); 726 729 winEr = ERROR_GEN_FAILURE; 727 730 } … … 746 749 #endif 747 750 default: 748 Log ((__FUNCTION__":unknown mode (%d)\n", pIf->enmMode));751 LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode)); 749 752 return ERROR_INVALID_PARAMETER; 750 753 } … … 764 767 #endif 765 768 default: 766 Log ((__FUNCTION__":unknown mode (%d)\n", pIf->enmMode));769 LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode)); 767 770 return ERROR_INVALID_PARAMETER; 768 771 } … … 848 851 pMon->fExtDispSup = fExtDispSup; 849 852 853 /** @todo r=andy Why using malloc() instead of RTMemAlloc*? */ 850 854 if (cDevModes) 851 855 { … … 854 858 if (!pMon->paDisplayDevices) 855 859 { 856 Log (("malloc failed!"));860 LogFlowFunc(("malloc failed")); 857 861 vboxRrRetryStopLocked(); 858 862 LeaveCriticalSection(&pMon->CritSect); … … 865 869 if (!pMon->paDeviceModes) 866 870 { 867 Log (("malloc failed!"));871 LogFlowFunc(("malloc failed")); 868 872 vboxRrRetryStopLocked(); 869 873 LeaveCriticalSection(&pMon->CritSect); … … 878 882 if (!pMon->idTimer) 879 883 { 880 WARN(("VBoxTray: SetTimer failed!, err %d\n", GetLastError()));884 LogFlowFunc(("SetTimer failed, err %ld\n", GetLastError())); 881 885 vboxRrRetryStopLocked(); 882 886 } … … 910 914 case WM_DISPLAYCHANGE: 911 915 { 912 Log (("VBoxTray:WM_DISPLAYCHANGE\n"));916 LogFlowFunc(("WM_DISPLAYCHANGE\n")); 913 917 VBoxRrRetryStop(); 914 918 return 0; … … 918 922 if (wParam == VBOXRR_TIMER_ID) 919 923 { 920 Log (("VBoxTray:VBOXRR_TIMER_ID\n"));924 LogFlowFunc(("VBOXRR_TIMER_ID\n")); 921 925 vboxRrRetryPerform(); 922 926 return 0; … … 925 929 } 926 930 case WM_CLOSE: 927 Log ((__FUNCTION__":got WM_CLOSE for hwnd(0x%x)", hwnd));931 LogFlowFunc(("got WM_CLOSE for hwnd(0x%x)", hwnd)); 928 932 return 0; 929 933 case WM_DESTROY: 930 Log ((__FUNCTION__":got WM_DESTROY for hwnd(0x%x)", hwnd));934 LogFlowFunc(("got WM_DESTROY for hwnd(0x%x)", hwnd)); 931 935 return 0; 932 936 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)); 934 938 return HTNOWHERE; 935 939 default: … … 963 967 { 964 968 DWORD winErr = GetLastError(); 965 WARN((__FUNCTION__":RegisterClass failed, winErr(%d)\n", winErr));969 LogFlowFunc(("RegisterClass failed, winErr(%d)\n", winErr)); 966 970 hr = E_FAIL; 967 971 } … … 987 991 { 988 992 DWORD winErr = GetLastError(); 989 WARN((__FUNCTION__":CreateWindowEx failed, winErr(%d)\n", winErr));993 LogFlowFunc(("CreateWindowEx failed, winErr(%d)\n", winErr)); 990 994 hr = E_FAIL; 991 995 } … … 1002 1006 1003 1007 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)); 1005 1009 1006 1010 return HRESULT_FROM_WIN32(winErr); … … 1051 1055 { 1052 1056 hr = S_FALSE; 1053 Log (("VBoxTray:GetMessage returned FALSE\n"));1057 LogFlowFunc(("GetMessage returned FALSE\n")); 1054 1058 VBoxRrRetryStop(); 1055 1059 break; … … 1065 1069 if (hr == S_OK || hr == S_FALSE) 1066 1070 hr = E_FAIL; 1067 WARN(("VBoxTray:GetMessage returned -1, err %d\n", winEr));1071 LogFlowFunc(("GetMessage returned -1, err %d\n", winEr)); 1068 1072 VBoxRrRetryStop(); 1069 1073 break; … … 1075 1079 case WM_CLOSE: 1076 1080 { 1077 Log (("VBoxTray:closing Rr %d\n", Msg.message));1081 LogFlowFunc(("closing Rr %d\n", Msg.message)); 1078 1082 VBoxRrRetryStop(); 1079 1083 PostQuitMessage(0); … … 1097 1101 { 1098 1102 DWORD winErr = GetLastError(); 1099 WARN((__FUNCTION__":SetEvent failed, winErr = (%d)", winErr));1103 LogFlowFunc(("SetEvent failed, winErr = (%d)", winErr)); 1100 1104 HRESULT tmpHr = HRESULT_FROM_WIN32(winErr); 1101 1105 Assert(tmpHr != S_OK); … … 1143 1147 else 1144 1148 { 1145 Log (("WaitForSingleObject failed!"));1149 LogFlowFunc(("WaitForSingleObject failed")); 1146 1150 hr = E_FAIL; 1147 1151 } … … 1150 1154 { 1151 1155 DWORD winErr = GetLastError(); 1152 WARN((__FUNCTION__":CreateThread failed, winErr = (%d)", winErr));1156 LogFlowFunc(("CreateThread failed, winErr = (%d)", winErr)); 1153 1157 hr = HRESULT_FROM_WIN32(winErr); 1154 1158 Assert(hr != S_OK); … … 1159 1163 { 1160 1164 DWORD winErr = GetLastError(); 1161 WARN((__FUNCTION__":CreateEvent failed, winErr = (%d)", winErr));1165 LogFlowFunc(("CreateEvent failed, winErr = (%d)", winErr)); 1162 1166 hr = HRESULT_FROM_WIN32(winErr); 1163 1167 Assert(hr != S_OK); … … 1212 1216 return ERROR_SUCCESS; 1213 1217 } 1214 WARN(("VBoxTray:VBoxRrInit failed hr 0x%x\n", hr));1218 LogFlowFunc(("VBoxRrInit failed hr 0x%x\n", hr)); 1215 1219 return hr; 1216 1220 } … … 1236 1240 if (winEr != ERROR_SUCCESS) 1237 1241 { 1238 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));1242 LogFlowFunc(("Failed vboxDispIfWddmDcCreate winEr %d\n", winEr)); 1239 1243 return winEr; 1240 1244 } … … 1261 1265 if (Status != 0) 1262 1266 { 1263 Log (("VBoxTray: (WDDM)pfnD3DKMTPollDisplayChildren failed, Status (0x%x)\n", Status));1267 LogFlowFunc(("pfnD3DKMTPollDisplayChildren failed, Status (0x%x)\n", Status)); 1264 1268 continue; 1265 1269 } … … 1276 1280 if (winEr != ERROR_SUCCESS) 1277 1281 { 1278 WARN(("VBoxTray: (WDDM)Failed vboxDispIfQueryDisplayConnection winEr %d\n", winEr));1282 LogFlowFunc(("Failed vboxDispIfQueryDisplayConnection winEr %d\n", winEr)); 1279 1283 return winEr; 1280 1284 } … … 1282 1286 if (!fConnected) 1283 1287 { 1284 WARN(("VBoxTray: (WDDM)Display %d not connected, not expected\n", i));1288 LogFlowFunc(("Display %d not connected, not expected\n", i)); 1285 1289 fFound = TRUE; 1286 1290 break; … … 1319 1323 else 1320 1324 { 1321 WARN(("VBoxTray:pfnD3DKMTEscape VBOXESC_REINITVIDEOMODESBYMASK failed Status 0x%x\n", Status));1325 LogFlowFunc(("pfnD3DKMTEscape VBOXESC_REINITVIDEOMODESBYMASK failed Status 0x%x\n", Status)); 1322 1326 winEr = ERROR_GEN_FAILURE; 1323 1327 } … … 1325 1329 winEr = vboxDispIfWaitDisplayDataInited(pOp, pScreenIdMask); 1326 1330 if (winEr != NO_ERROR) 1327 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWaitDisplayDataInited winEr %d\n", winEr));1331 LogFlowFunc(("Failed vboxDispIfWaitDisplayDataInited winEr %d\n", winEr)); 1328 1332 1329 1333 return winEr; … … 1332 1336 DWORD vboxDispIfCancelPendingResizeWDDM(PCVBOXDISPIF const pIf) 1333 1337 { 1334 Log (("VBoxTray:cancelling pending resize\n"));1338 LogFlowFunc(("cancelling pending resize\n")); 1335 1339 VBoxRrRetryStop(); 1336 1340 return NO_ERROR; … … 1348 1352 tempDevMode.dmSize = sizeof(DEVMODE); 1349 1353 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 ())); 1351 1355 } 1352 1356 … … 1354 1358 paDeviceModes[iChangedMode].dmBitsPerPel, paDeviceModes[iChangedMode].dmPosition.x, paDeviceModes[iChangedMode].dmPosition.y, fEnable, fExtDispSup); 1355 1359 if (winEr != NO_ERROR) 1356 WARN(("VBoxTray: (WDDM)Failed EnableAndResizeDispDev winEr %d\n", winEr));1360 LogFlowFunc(("Failed EnableAndResizeDispDev winEr %d\n", winEr)); 1357 1361 1358 1362 return winEr; … … 1366 1370 winEr = vboxDispIfWddmResizeDisplay(pIf, iChangedMode, fEnable, paDisplayDevices, paDeviceModes, cDevModes); 1367 1371 if (winEr != NO_ERROR) 1368 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmResizeDisplay winEr %d\n", winEr));1372 LogFlowFunc(("Failed vboxDispIfWddmResizeDisplay winEr %d\n", winEr)); 1369 1373 } 1370 1374 else … … 1372 1376 winEr = vboxDispIfWddmResizeDisplayVista(paDeviceModes, paDisplayDevices, cDevModes, iChangedMode, fEnable, fExtDispSup); 1373 1377 if (winEr != NO_ERROR) 1374 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmResizeDisplayVista winEr %d\n", winEr));1378 LogFlowFunc(("Failed vboxDispIfWddmResizeDisplayVista winEr %d\n", winEr)); 1375 1379 } 1376 1380 return winEr; … … 1386 1390 UINT i = 0; 1387 1391 1388 Log (("VBoxTray:vboxDispIfResizeModesWDDM\n"));1392 LogFlowFunc(("vboxDispIfResizeModesWDDM\n")); 1389 1393 VBoxRrRetryStop(); 1390 1394 … … 1394 1398 if (winEr != NO_ERROR) 1395 1399 { 1396 WARN(("VBoxTray:vboxDispIfOpBegin failed winEr 0x%x", winEr));1400 LogFlowFunc(("vboxDispIfOpBegin failed winEr 0x%x", winEr)); 1397 1401 return winEr; 1398 1402 } … … 1431 1435 if (winEr != ERROR_SUCCESS) 1432 1436 { 1433 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));1437 LogFlowFunc(("Failed vboxDispIfWddmDcCreate winEr %d\n", winEr)); 1434 1438 return winEr; 1435 1439 } … … 1439 1443 if (!pChangeIds) 1440 1444 { 1441 WARN(("VBoxTray: (WDDM)Failed to alloc change ids\n"));1445 LogFlowFunc(("Failed to alloc change ids\n")); 1442 1446 winEr = ERROR_OUTOFMEMORY; 1443 1447 goto done; … … 1471 1475 if (cChangeIds == 0) 1472 1476 { 1473 Log (("VBoxTray: (WDDM)vboxDispIfWddmEnableDisplay: settings are up to date\n"));1477 LogFlowFunc(("vboxDispIfWddmEnableDisplay: settings are up to date\n")); 1474 1478 winEr = ERROR_SUCCESS; 1475 1479 goto done; … … 1480 1484 if (winEr != ERROR_SUCCESS) 1481 1485 { 1482 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcSettingsIncludeAllTargets winEr %d\n", winEr));1486 LogFlowFunc(("Failed vboxDispIfWddmDcSettingsIncludeAllTargets winEr %d\n", winEr)); 1483 1487 return winEr; 1484 1488 } … … 1494 1498 if (iPath < 0) 1495 1499 { 1496 WARN(("VBoxTray: (WDDM)path index not found while it should"));1500 LogFlowFunc(("path index not found while it should")); 1497 1501 winEr = ERROR_GEN_FAILURE; 1498 1502 goto done; … … 1502 1506 if (winEr != ERROR_SUCCESS) 1503 1507 { 1504 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr));1508 LogFlowFunc(("Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr)); 1505 1509 goto done; 1506 1510 } … … 1515 1519 if (iPath < 0) 1516 1520 { 1517 WARN(("VBoxTray: (WDDM)path index not found while it should"));1521 LogFlowFunc(("path index not found while it should")); 1518 1522 winEr = ERROR_GEN_FAILURE; 1519 1523 goto done; … … 1523 1527 if (winEr != ERROR_SUCCESS) 1524 1528 { 1525 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr));1529 LogFlowFunc(("Failed vboxDispIfWddmDcSettingsUpdate winEr %d\n", winEr)); 1526 1530 goto done; 1527 1531 } … … 1534 1538 if (!fSetTopology) 1535 1539 { 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)); 1537 1541 fSetFlags |= SDC_ALLOW_CHANGES; 1538 1542 } 1539 1543 else 1540 1544 { 1541 Log (("VBoxTray: (WDDM)vboxDispIfWddmDcSet topology validation failed winEr %d\n", winEr));1545 LogFlowFunc(("vboxDispIfWddmDcSet topology validation failed winEr %d\n", winEr)); 1542 1546 goto done; 1543 1547 } … … 1549 1553 winEr = vboxDispIfWddmDcSet(&DispCfg, fSetFlags | SDC_APPLY); 1550 1554 if (winEr != ERROR_SUCCESS) 1551 WARN(("VBoxTray: (WDDM)vboxDispIfWddmDcSet apply failed winEr %d\n", winEr));1555 LogFlowFunc(("vboxDispIfWddmDcSet apply failed winEr %d\n", winEr)); 1552 1556 1553 1557 done: … … 1563 1567 { 1564 1568 if (fEnable) 1565 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));1569 LogFlowFunc(("Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr)); 1566 1570 else 1567 Log (("VBoxTray: (WDDM)Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));1571 LogFlowFunc(("Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr)); 1568 1572 winEr = vboxDispIfWddmEnableDisplays(pIf, cIds, pIds, fEnable, TRUE, NULL); 1569 1573 if (winEr != ERROR_SUCCESS) 1570 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr));1574 LogFlowFunc(("Failed vboxDispIfWddmEnableDisplay mode winEr %d\n", winEr)); 1571 1575 } 1572 1576 … … 1583 1587 if (winEr != ERROR_SUCCESS) 1584 1588 { 1585 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcCreate\n"));1589 LogFlowFunc(("Failed vboxDispIfWddmDcCreate\n")); 1586 1590 return winEr; 1587 1591 } … … 1602 1606 if (winEr != ERROR_SUCCESS) 1603 1607 { 1604 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr));1608 LogFlowFunc(("Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr)); 1605 1609 return winEr; 1606 1610 } … … 1609 1613 if (winEr != ERROR_SUCCESS) 1610 1614 { 1611 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcCreate winEr %d\n", winEr));1615 LogFlowFunc(("Failed vboxDispIfWddmDcCreate winEr %d\n", winEr)); 1612 1616 return winEr; 1613 1617 } … … 1616 1620 if (iPath < 0) 1617 1621 { 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)); 1619 1623 vboxDispIfWddmDcTerm(&DispCfg); 1620 1624 return ERROR_RETRY; … … 1632 1636 if (winEr != ERROR_SUCCESS) 1633 1637 { 1634 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr));1638 LogFlowFunc(("Failed vboxDispIfWddmEnableDisplaysTryingTopology winEr %d\n", winEr)); 1635 1639 return winEr; 1636 1640 } … … 1644 1648 if (winEr != ERROR_SUCCESS) 1645 1649 { 1646 WARN(("VBoxTray: (WDDM)Failed vboxDispIfWddmDcSettingsUpdate\n"));1650 LogFlowFunc(("Failed vboxDispIfWddmDcSettingsUpdate\n")); 1647 1651 vboxDispIfWddmDcTerm(&DispCfg); 1648 1652 return winEr; … … 1653 1657 if (winEr != ERROR_SUCCESS) 1654 1658 { 1655 WARN(("VBoxTray:(WDDM)pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr));1659 LogFlowFunc(("pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr)); 1656 1660 fSetFlags |= SDC_ALLOW_CHANGES; 1657 1661 } … … 1660 1664 if (winEr != ERROR_SUCCESS) 1661 1665 { 1662 WARN(("VBoxTray:(WDDM)pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr));1666 LogFlowFunc(("pfnSetDisplayConfig Failed to validate winEr %d.\n", winEr)); 1663 1667 } 1664 1668 … … 1684 1688 #endif 1685 1689 default: 1686 WARN((__FUNCTION__":unknown mode (%d)\n", pIf->enmMode));1690 LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode)); 1687 1691 return ERROR_INVALID_PARAMETER; 1688 1692 } … … 1703 1707 #endif 1704 1708 default: 1705 WARN((__FUNCTION__":unknown mode (%d)\n", pIf->enmMode));1709 LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode)); 1706 1710 return ERROR_INVALID_PARAMETER; 1707 1711 } … … 1733 1737 return NO_ERROR; 1734 1738 } 1735 WARN(("VBoxTray:pfnD3DKMTEscape VBOXESC_CONFIGURETARGETS failed Status 0x%x\n", Status));1739 LogFlowFunc(("pfnD3DKMTEscape VBOXESC_CONFIGURETARGETS failed Status 0x%x\n", Status)); 1736 1740 return Status; 1737 1741 } … … 1742 1746 if (NumDevices == 0) 1743 1747 { 1744 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: Zero devices found\n"));1748 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: Zero devices found\n")); 1745 1749 return ERROR_GEN_FAILURE; 1746 1750 } … … 1754 1758 if (winEr != NO_ERROR) 1755 1759 { 1756 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed, %d\n", winEr));1760 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed, %d\n", winEr)); 1757 1761 return winEr; 1758 1762 } 1759 1763 1760 1764 if (NumDevices != DevNum) 1761 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum));1765 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum)); 1762 1766 1763 1767 … … 1766 1770 if (winEr != NO_ERROR) 1767 1771 { 1768 WARN(("VBoxTray:vboxDispIfConfigureTargetsWDDM failed winEr 0x%x\n", winEr));1772 LogFlowFunc(("vboxDispIfConfigureTargetsWDDM failed winEr 0x%x\n", winEr)); 1769 1773 return winEr; 1770 1774 } … … 1772 1776 if (!cConnected) 1773 1777 { 1774 Log (("VBoxTray:all targets already connected, nothing to do\n"));1778 LogFlowFunc(("all targets already connected, nothing to do\n")); 1775 1779 return NO_ERROR; 1776 1780 } … … 1778 1782 winEr = vboxDispIfWaitDisplayDataInited(pOp, NULL); 1779 1783 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)); 1781 1785 1782 1786 DWORD NewNumDevices = VBoxGetDisplayConfigCount(); 1783 1787 if (NewNumDevices == 0) 1784 1788 { 1785 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: Zero devices found\n"));1789 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: Zero devices found\n")); 1786 1790 return ERROR_GEN_FAILURE; 1787 1791 } 1788 1792 1789 1793 if (NewNumDevices != NumDevices) 1790 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != NewNumDevices(%d)\n", NumDevices, NewNumDevices));1794 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: NumDevices(%d) != NewNumDevices(%d)\n", NumDevices, NewNumDevices)); 1791 1795 1792 1796 DISPLAY_DEVICE *paNewDisplayDevices = (DISPLAY_DEVICE *)alloca (sizeof (DISPLAY_DEVICE) * NewNumDevices); … … 1798 1802 if (winEr != NO_ERROR) 1799 1803 { 1800 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed for new devices, %d\n", winEr));1804 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: VBoxGetDisplayConfig failed for new devices, %d\n", winEr)); 1801 1805 return winEr; 1802 1806 } 1803 1807 1804 1808 if (NewNumDevices != NewDevNum) 1805 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp: NewNumDevices(%d) != NewDevNum(%d)\n", NewNumDevices, NewDevNum));1809 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp: NewNumDevices(%d) != NewDevNum(%d)\n", NewNumDevices, NewDevNum)); 1806 1810 1807 1811 DWORD minDevNum = RT_MIN(DevNum, NewDevNum); … … 1821 1825 { 1822 1826 /* 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")); 1824 1828 return NO_ERROR; 1825 1829 } … … 1829 1833 winEr = vboxDispIfWddmEnableDisplaysTryingTopology(pOp->pIf, cIds, pIds, FALSE); 1830 1834 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)); 1832 1836 } 1833 1837 else … … 1837 1841 winEr = vboxDispIfWddmResizeDisplayVista(paNewDeviceModes, paNewDisplayDevices, NewDevNum, i, FALSE, TRUE); 1838 1842 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)); 1840 1844 } 1841 1845 } … … 1852 1856 if (winEr != NO_ERROR) 1853 1857 { 1854 WARN(("VBoxTray:vboxDispIfOpBegin failed winEr 0x%x\n", winEr));1858 LogFlowFunc(("vboxDispIfOpBegin failed winEr 0x%x\n", winEr)); 1855 1859 return winEr; 1856 1860 } … … 1859 1863 if (winEr != NO_ERROR) 1860 1864 { 1861 WARN(("VBoxTray:vboxDispIfResizeStartedWDDMOp failed winEr 0x%x\n", winEr));1865 LogFlowFunc(("vboxDispIfResizeStartedWDDMOp failed winEr 0x%x\n", winEr)); 1862 1866 } 1863 1867 … … 1881 1885 #endif 1882 1886 default: 1883 WARN((__FUNCTION__":unknown mode (%d)\n", pIf->enmMode));1887 LogFlowFunc(("unknown mode (%d)\n", pIf->enmMode)); 1884 1888 return ERROR_INVALID_PARAMETER; 1885 1889 } … … 1905 1909 bool bSupported = true; 1906 1910 *(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)); 1908 1912 bSupported &= !!(pIf->modeData.xpdm.pfnChangeDisplaySettingsEx); 1909 1913 1910 1914 if (!bSupported) 1911 1915 { 1912 WARN((__FUNCTION__":pfnChangeDisplaySettingsEx function pointer failed to initialize\n"));1916 LogFlowFunc(("pfnChangeDisplaySettingsEx function pointer failed to initialize\n")); 1913 1917 err = ERROR_NOT_SUPPORTED; 1914 1918 } … … 1916 1920 else 1917 1921 { 1918 WARN((__FUNCTION__":failed to get USER32 handle, err (%d)\n", GetLastError()));1922 LogFlowFunc(("failed to get USER32 handle, err (%d)\n", GetLastError())); 1919 1923 err = ERROR_NOT_SUPPORTED; 1920 1924 } … … 1922 1926 else 1923 1927 { 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")); 1925 1929 err = ERROR_NOT_SUPPORTED; 1926 1930 } … … 1952 1956 { 1953 1957 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")); 1955 1959 err = vboxDispIfSwitchToXPDM_NT4(pIf); 1956 1960 if (err == NO_ERROR) 1957 1961 { 1958 Log ((__FUNCTION__":successfully switched to XPDM_NT4 mode\n"));1962 LogFlowFunc(("successfully switched to XPDM_NT4 mode\n")); 1959 1963 pIf->enmMode = VBOXDISPIF_MODE_XPDM_NT4; 1960 1964 } 1961 1965 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)); 1963 1967 break; 1964 1968 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")); 1966 1970 err = vboxDispIfSwitchToXPDM(pIf); 1967 1971 if (err == NO_ERROR) 1968 1972 { 1969 Log ((__FUNCTION__":successfully switched to XPDM mode\n"));1973 LogFlowFunc(("successfully switched to XPDM mode\n")); 1970 1974 pIf->enmMode = VBOXDISPIF_MODE_XPDM; 1971 1975 } 1972 1976 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)); 1974 1978 break; 1975 1979 #ifdef VBOX_WITH_WDDM 1976 1980 case VBOXDISPIF_MODE_WDDM: 1977 1981 { 1978 Log ((__FUNCTION__":request to switch to VBOXDISPIF_MODE_WDDM\n"));1982 LogFlowFunc(("request to switch to VBOXDISPIF_MODE_WDDM\n")); 1979 1983 err = vboxDispIfSwitchToWDDM(pIf); 1980 1984 if (err == NO_ERROR) 1981 1985 { 1982 Log ((__FUNCTION__":successfully switched to WDDM mode\n"));1986 LogFlowFunc(("successfully switched to WDDM mode\n")); 1983 1987 pIf->enmMode = VBOXDISPIF_MODE_WDDM; 1984 1988 } 1985 1989 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)); 1987 1991 break; 1988 1992 } 1989 1993 case VBOXDISPIF_MODE_WDDM_W7: 1990 1994 { 1991 Log ((__FUNCTION__":request to switch to VBOXDISPIF_MODE_WDDM_W7\n"));1995 LogFlowFunc(("request to switch to VBOXDISPIF_MODE_WDDM_W7\n")); 1992 1996 err = vboxDispIfSwitchToWDDM_W7(pIf); 1993 1997 if (err == NO_ERROR) 1994 1998 { 1995 Log ((__FUNCTION__":successfully switched to WDDM mode\n"));1999 LogFlowFunc(("successfully switched to WDDM mode\n")); 1996 2000 pIf->enmMode = VBOXDISPIF_MODE_WDDM_W7; 1997 2001 } 1998 2002 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)); 2000 2004 break; 2001 2005 } … … 2024 2028 #ifdef VBOX_DISPIF_WITH_OPCONTEXT 2025 2029 else 2026 WARN(("VBoxTray:vboxDispKmtCreateContext failed hr 0x%x", hr));2030 LogFlowFunc(("vboxDispKmtCreateContext failed hr 0x%x", hr)); 2027 2031 2028 2032 vboxDispKmtDestroyDevice(&pSeamless->modeData.wddm.Device); 2029 2033 } 2030 2034 else 2031 WARN(("VBoxTray:vboxDispKmtCreateDevice failed hr 0x%x", hr));2035 LogFlowFunc(("vboxDispKmtCreateDevice failed hr 0x%x", hr)); 2032 2036 2033 2037 vboxDispKmtCloseAdapter(&pSeamless->modeData.wddm.Adapter); … … 2066 2070 return ERROR_SUCCESS; 2067 2071 2068 WARN(("VBoxTray:pfnD3DKMTEscape Seamless failed Status 0x%x\n", Status));2072 LogFlowFunc(("pfnD3DKMTEscape Seamless failed Status 0x%x\n", Status)); 2069 2073 return Status; 2070 2074 } … … 2086 2090 #endif 2087 2091 default: 2088 WARN(("VBoxTray:VBoxDispIfSeamlesCreate: invalid mode %d\n", pIf->enmMode));2092 LogFlowFunc(("VBoxDispIfSeamlesCreate: invalid mode %d\n", pIf->enmMode)); 2089 2093 return ERROR_INVALID_PARAMETER; 2090 2094 } … … 2108 2112 #endif 2109 2113 default: 2110 WARN(("VBoxTray:VBoxDispIfSeamlesTerm: invalid mode %d\n", pIf->enmMode));2114 LogFlowFunc(("VBoxDispIfSeamlesTerm: invalid mode %d\n", pIf->enmMode)); 2111 2115 winEr = ERROR_INVALID_PARAMETER; 2112 2116 break; … … 2125 2129 if (pData->escapeCode != VBOXESC_SETVISIBLEREGION) 2126 2130 { 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)); 2128 2132 return ERROR_INVALID_PARAMETER; 2129 2133 } … … 2140 2144 #endif 2141 2145 default: 2142 WARN(("VBoxTray:VBoxDispIfSeamlesSubmit: invalid mode %d\n", pIf->enmMode));2146 LogFlowFunc(("VBoxDispIfSeamlesSubmit: invalid mode %d\n", pIf->enmMode)); 2143 2147 return ERROR_INVALID_PARAMETER; 2144 2148 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
r49891 r51469 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 #define _WIN32_WINNT 0x050018 17 #include "VBoxTray.h" 19 18 #include "VBoxHelpers.h" 20 19 #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> 21 37 #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 30 40 31 41 typedef struct _VBOXDISPLAYCONTEXT … … 57 67 int VBoxDisplayInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread) 58 68 { 59 Log (("VBoxTray:VBoxDisplayInit ...\n"));69 LogFlowFunc(("VBoxDisplayInit ...\n")); 60 70 61 71 OSVERSIONINFO OSinfo; … … 69 79 if (NULL == hUser) 70 80 { 71 Log (("VBoxTray: VBoxDisplayInit:Could not get module handle of USER32.DLL!\n"));81 LogFlowFunc(("Could not get module handle of USER32.DLL!\n")); 72 82 return VERR_NOT_IMPLEMENTED; 73 83 } … … 75 85 { 76 86 *(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)); 78 88 79 89 *(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)); 81 91 82 92 #ifdef VBOX_WITH_WDDM … … 84 94 { 85 95 /* 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")); 87 97 VBOXDISPLAY_DRIVER_TYPE enmType = getVBoxDisplayDriverType (&gCtx); 88 98 if (enmType == VBOXDISPLAY_DRIVER_TYPE_WDDM) 89 99 { 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")); 91 101 /* this is hacky, but the most easiest way */ 92 102 VBOXDISPIF_MODE enmMode = (OSinfo.dwMajorVersion > 6 || OSinfo.dwMinorVersion > 0) ? VBOXDISPIF_MODE_WDDM_W7 : VBOXDISPIF_MODE_WDDM; 93 103 DWORD err = VBoxDispIfSwitchMode(const_cast<PVBOXDISPIF>(&pEnv->dispIf), enmMode, NULL /* old mode, we don't care about it */); 94 104 if (err == NO_ERROR) 95 Log (("VBoxTray: VBoxDisplayInit:DispIf switched to WDDM mode successfully\n"));105 LogFlowFunc(("DispIf switched to WDDM mode successfully\n")); 96 106 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)); 98 108 } 99 109 } … … 106 116 else /* Unsupported platform */ 107 117 { 108 Log (("VBoxTray: VBoxDisplayInit:Warning, display for platform not handled yet!\n"));118 LogFlowFunc(("Warning, display for platform not handled yet!\n")); 109 119 return VERR_NOT_IMPLEMENTED; 110 120 } … … 118 128 gCtx.fAnyX = TRUE; 119 129 120 Log (("VBoxTray: VBoxDisplayInit:Display init successful\n"));130 LogFlowFunc(("Display init successful\n")); 121 131 122 132 *pfStartThread = true; … … 149 159 dispDevice.cb = sizeof(DISPLAY_DEVICE); 150 160 151 Log (("VBoxTray:isVBoxDisplayDriverActive: Checking for active VBox display driver (W2K+) ...\n"));161 LogFlowFunc(("isVBoxDisplayDriverActive: Checking for active VBox display driver (W2K+) ...\n")); 152 162 153 163 while (EnumDisplayDevices(NULL, … … 156 166 0)) 157 167 { 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", 159 169 devNum, 160 170 &dispDevice.DeviceName[0], … … 166 176 if (dispDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) 167 177 { 168 Log (("VBoxTray:isVBoxDisplayDriverActive: Primary device\n"));178 LogFlowFunc(("isVBoxDisplayDriverActive: Primary device\n")); 169 179 170 180 if (strcmp(&dispDevice.DeviceString[0], "VirtualBox Graphics Adapter") == 0) … … 191 201 else /* This must be NT 4 or something really old, so don't use EnumDisplayDevices() here ... */ 192 202 { 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")); 194 204 195 205 DEVMODE tempDevMode; … … 249 259 if(!(displayDevice.StateFlags & DISPLAY_DEVICE_ACTIVE)) 250 260 { 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)); 252 262 deviceMode.dmPosition.x = paDeviceModes[0].dmPelsWidth; 253 263 deviceMode.dmPosition.y = 0; … … 272 282 if (aWidth !=0 && aHeight != 0) 273 283 { 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)); 275 285 deviceMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL 276 286 | DM_DISPLAYFREQUENCY | DM_DISPLAYFLAGS; … … 281 291 if (aPosX != 0 || aPosY != 0) 282 292 { 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)); 284 294 deviceMode.dmFields |= DM_POSITION; 285 295 deviceMode.dmPosition.x = aPosX; … … 294 304 else /* Request is there to disable the monitor with ID = Id*/ 295 305 { 296 LogRel((" VBoxTray:Disable the Display: %d\n", displayDevice.DeviceName));306 LogRel(("Disable the Display: %d\n", displayDevice.DeviceName)); 297 307 298 308 DEVMODE deviceModeTmp; … … 322 332 while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0)) 323 333 { 324 Log (("VBoxTray:ResizeDisplayDevice: [%d] %s\n", i, DisplayDevice.DeviceName));334 LogFlowFunc(("ResizeDisplayDevice: [%d] %s\n", i, DisplayDevice.DeviceName)); 325 335 326 336 if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) 327 337 { 328 Log (("VBoxTray:ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ()));338 LogFlowFunc(("ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ())); 329 339 NumDevices++; 330 340 } … … 332 342 { 333 343 334 Log (("VBoxTray:ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ()));344 LogFlowFunc(("ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ())); 335 345 NumDevices++; 336 346 } … … 358 368 while (EnumDisplayDevices (NULL, i, &DisplayDevice, 0)) 359 369 { 360 Log (("VBoxTray:ResizeDisplayDevice: [%d(%d)] %s\n", i, DevNum, DisplayDevice.DeviceName));370 LogFlowFunc(("ResizeDisplayDevice: [%d(%d)] %s\n", i, DevNum, DisplayDevice.DeviceName)); 361 371 362 372 BOOL bFetchDevice = FALSE; … … 364 374 if (DisplayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) 365 375 { 366 Log (("VBoxTray:ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ()));376 LogFlowFunc(("ResizeDisplayDevice: Found primary device. err %d\n", GetLastError ())); 367 377 DevPrimaryNum = DevNum; 368 378 bFetchDevice = TRUE; … … 371 381 { 372 382 373 Log (("VBoxTray:ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ()));383 LogFlowFunc(("ResizeDisplayDevice: Found secondary device. err %d\n", GetLastError ())); 374 384 bFetchDevice = TRUE; 375 385 } … … 379 389 if (DevNum >= NumDevices) 380 390 { 381 WARN(("VBoxTray:ResizeDisplayDevice: %d >= %d\n", NumDevices, DevNum));391 LogFlowFunc(("ResizeDisplayDevice: %d >= %d\n", NumDevices, DevNum)); 382 392 return ERROR_BUFFER_OVERFLOW; 383 393 } … … 394 404 ENUM_REGISTRY_SETTINGS, &paDeviceModes[DevNum])) 395 405 { 396 Log (("VBoxTray:ResizeDisplayDevice: EnumDisplaySettings error %d\n", GetLastError ()));406 LogFlowFunc(("ResizeDisplayDevice: EnumDisplaySettings error %d\n", GetLastError ())); 397 407 } 398 408 … … 412 422 * Do not return here, ignore the error and set the display info to 0x0x0. 413 423 */ 414 Log (("VBoxTray:ResizeDisplayDevice: EnumDisplaySettings(ENUM_CURRENT_SETTINGS) error %d\n", GetLastError ()));424 LogFlowFunc(("ResizeDisplayDevice: EnumDisplaySettings(ENUM_CURRENT_SETTINGS) error %d\n", GetLastError ())); 415 425 } 416 426 } … … 440 450 DWORD dmFields = 0; 441 451 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 \ 443 453 fEnabled = %d, fExtDisSup = %d\n", 444 454 Width, Height, dwNewPosX, dwNewPosY, fEnabled, fExtDispSup)); … … 453 463 if (NumDevices == 0 || Id >= NumDevices) 454 464 { 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 ())); 456 466 return FALSE; 457 467 } 458 468 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 ())); 460 470 461 471 DISPLAY_DEVICE *paDisplayDevices = (DISPLAY_DEVICE *)alloca (sizeof (DISPLAY_DEVICE) * NumDevices); … … 467 477 if (dwStatus != NO_ERROR) 468 478 { 469 WARN(("VBoxTray:ResizeDisplayDevice: VBoxGetDisplayConfig failed, %d\n", dwStatus));479 LogFlowFunc(("ResizeDisplayDevice: VBoxGetDisplayConfig failed, %d\n", dwStatus)); 470 480 return dwStatus; 471 481 } 472 482 473 483 if (NumDevices != DevNum) 474 WARN(("VBoxTray:ResizeDisplayDevice: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum));484 LogFlowFunc(("ResizeDisplayDevice: NumDevices(%d) != DevNum(%d)\n", NumDevices, DevNum)); 475 485 476 486 DWORD i = 0; … … 480 490 if (fExtDispSup) 481 491 { 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", 484 494 paDeviceModes[Id].dmPelsWidth, 485 495 paDeviceModes[Id].dmPelsHeight, … … 491 501 else 492 502 { 493 LogRel((" VBoxTray:NO Ext Display Support \n"));503 LogRel(("NO Ext Display Support \n")); 494 504 } 495 505 … … 503 513 if (paDisplayDevices[Id].StateFlags & DISPLAY_DEVICE_ACTIVE) 504 514 { 505 LogRel((" VBoxTray:Display with ID=%d already enabled\n", Id));515 LogRel(("Display with ID=%d already enabled\n", Id)); 506 516 fDispAlreadyEnabled = TRUE; 507 517 } … … 559 569 && paDeviceModes[Id].dmBitsPerPel == BitsPerPixel) 560 570 { 561 LogRel((" VBoxTray:Already at desired resolution. No Change.\n"));571 LogRel(("Already at desired resolution. No Change.\n")); 562 572 return FALSE; 563 573 } … … 568 578 for (i = 0; i < NumDevices; i++) 569 579 { 570 Log (("VBoxTray:ResizeDisplayDevice: [%d]: %d,%d %dx%d\n",580 LogFlowFunc(("ResizeDisplayDevice: [%d]: %d,%d %dx%d\n", 571 581 i, paRects[i].left, paRects[i].top, 572 582 paRects[i].right - paRects[i].left, … … 597 607 if (!(paDeviceModes[i].dmFields & DM_BITSPERPEL)) 598 608 { 599 WARN(("VBoxTray: (WDDM)no DM_BITSPERPEL\n"));609 LogFlowFunc(("no DM_BITSPERPEL\n")); 600 610 paDeviceModes[i].dmFields |= DM_BITSPERPEL; 601 611 paDeviceModes[i].dmBitsPerPel = 32; 602 612 } 603 613 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", 605 615 gCtx.pfnChangeDisplaySettingsEx, 606 616 paDeviceModes[i].dmPelsWidth, … … 611 621 } 612 622 613 Log (("VBoxTray: (WDDM)Request to resize the displa\n"));623 LogFlowFunc(("Request to resize the displa\n")); 614 624 DWORD err = VBoxDispIfResizeModes(&pCtx->pEnv->dispIf, Id, fEnabled, fExtDispSup, paDisplayDevices, paDeviceModes, DevNum); 615 625 if (err == NO_ERROR || err != ERROR_RETRY) 616 626 { 617 627 if (err == NO_ERROR) 618 Log (("VBoxTray: VBoxDisplayThread: (WDDM)VBoxDispIfResizeModes succeeded\n"));628 LogFlowFunc(("VBoxDispIfResizeModes succeeded\n")); 619 629 else 620 WARN(("VBoxTray: VBoxDisplayThread: (WDDM)Failure VBoxDispIfResizeModes (%d)\n", err));630 LogFlowFunc(("Failure VBoxDispIfResizeModes (%d)\n", err)); 621 631 return FALSE; 622 632 } 623 633 624 Log (("VBoxTray: ResizeDisplayDevice: (WDDM)RETRY requested\n"));634 LogFlowFunc(("ResizeDisplayDevice: RETRY requested\n")); 625 635 return TRUE; 626 636 } … … 635 645 tempDevMode.dmSize = sizeof(DEVMODE); 636 646 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 ())); 638 648 } 639 649 … … 658 668 } 659 669 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", 661 671 i, 662 672 paDeviceModes[i].dmPelsWidth, … … 668 678 LONG status = gCtx.pfnChangeDisplaySettingsEx((LPSTR)paDisplayDevices[i].DeviceName, 669 679 &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, \ 674 684 dwNewPosX = %d, dwNewPosY = %d fEnabled=%d & fExtDispSupport = %d \n", 675 685 Id, Width, Height, dwNewPosX, dwNewPosY, fEnabled, fExtDispSup)); … … 693 703 unsigned __stdcall VBoxDisplayThread(void *pInstance) 694 704 { 695 Log (("VBoxTray: VBoxDisplayThread:Entered\n"));705 LogFlowFunc(("Entered\n")); 696 706 697 707 VBOXDISPLAYCONTEXT *pCtx = (VBOXDISPLAYCONTEXT *)pInstance; … … 705 715 if (!DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 706 716 { 707 Log (("VBoxTray: VBoxDisplayThread:DeviceIOControl(CtlMask - or) failed, thread exiting\n"));717 LogFlowFunc(("DeviceIOControl(CtlMask - or) failed, thread exiting\n")); 708 718 return 0; 709 719 } … … 722 732 if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent), &waitEvent, sizeof(waitEvent), &cbReturned, NULL)) 723 733 { 724 /*Log (("VBoxTray: VBoxDisplayThread:DeviceIOControl succeeded\n"));*/734 /*LogFlowFunc(("DeviceIOControl succeeded\n"));*/ 725 735 726 736 if (NULL == pCtx) { 727 Log (("VBoxTray: VBoxDisplayThread:Invalid context detected!\n"));737 LogFlowFunc(("Invalid context detected!\n")); 728 738 break; 729 739 } 730 740 731 741 if (NULL == pCtx->pEnv) { 732 Log (("VBoxTray: VBoxDisplayThread:Invalid context environment detected!\n"));742 LogFlowFunc(("Invalid context environment detected!\n")); 733 743 break; 734 744 } … … 738 748 break; 739 749 740 /*Log (("VBoxTray: VBoxDisplayThread:checking event\n"));*/750 /*LogFlowFunc(("checking event\n"));*/ 741 751 742 752 /* did we get the right event? */ 743 753 if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST) 744 754 { 745 Log (("VBoxTray: VBoxDisplayThread:going to get display change information\n"));755 LogFlowFunc(("going to get display change information\n")); 746 756 BOOL fDisplayChangeQueried; 747 757 … … 763 773 if (!fDisplayChangeQueried) 764 774 { 765 Log (("VBoxTray:Extended Display Not Supported. Trying VMMDevDisplayChangeRequest2\n"));775 LogFlowFunc(("Extended Display Not Supported. Trying VMMDevDisplayChangeRequest2\n")); 766 776 fExtDispSup = FALSE; /* Extended display Change request is not supported */ 767 777 … … 780 790 if (!fDisplayChangeQueried) 781 791 { 782 Log (("VBoxTray:Extended Display Not Supported. Trying VMMDevDisplayChangeRequest\n"));792 LogFlowFunc(("Extended Display Not Supported. Trying VMMDevDisplayChangeRequest\n")); 783 793 fExtDispSup = FALSE; /*Extended display Change request is not supported */ 784 794 /* Try the old version of the request for old VBox hosts. */ … … 801 811 for (;;) 802 812 { 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)); 804 814 805 815 /* … … 810 820 811 821 if (enmDriverType == VBOXDISPLAY_DRIVER_TYPE_WDDM) 812 Log (("VBoxTray: VBoxDisplayThread:Detected WDDM Driver\n"));822 LogFlowFunc(("Detected WDDM Driver\n")); 813 823 814 824 if (enmDriverType != VBOXDISPLAY_DRIVER_TYPE_UNKNOWN) … … 817 827 #endif 818 828 { 819 Log (("VBoxTray: VBoxDisplayThread:Display driver is active!\n"));829 LogFlowFunc(("Display driver is active!\n")); 820 830 821 831 if (pCtx->pfnChangeDisplaySettingsEx != 0) 822 832 { 823 Log (("VBoxTray: VBoxDisplayThread:Detected W2K or later\n"));833 LogFlowFunc(("Detected W2K or later\n")); 824 834 /* 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", 826 836 displayChangeRequest.display, 827 837 displayChangeRequest.xres, … … 843 853 )) 844 854 { 845 Log (("ResizeDipspalyDevice return 0\n"));855 LogFlowFunc(("ResizeDipspalyDevice return 0\n")); 846 856 break; 847 857 } … … 850 860 else 851 861 { 852 Log (("VBoxTray: VBoxDisplayThread:Detected NT\n"));862 LogFlowFunc(("Detected NT\n")); 853 863 854 864 /* Single monitor NT. */ … … 860 870 if (EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &devMode)) 861 871 { 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", 863 873 devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel, devMode.dmPosition.x, devMode.dmPosition.y)); 864 874 … … 879 889 { 880 890 /* All zero values means a forced mode reset. Do nothing. */ 881 Log (("VBoxTray: VBoxDisplayThread:Forced mode reset\n"));891 LogFlowFunc(("Forced mode reset\n")); 882 892 } 883 893 … … 887 897 && devMode.dmBitsPerPel == displayChangeRequest.bpp) 888 898 { 889 Log (("VBoxTray: VBoxDisplayThread:already at desired resolution\n"));899 LogFlowFunc(("already at desired resolution\n")); 890 900 break; 891 901 } … … 905 915 devMode.dmBitsPerPel = displayChangeRequest.bpp; 906 916 907 Log (("VBoxTray: VBoxDisplayThread:setting new mode %d x %d, %d BPP\n",917 LogFlowFunc(("setting new mode %d x %d, %d BPP\n", 908 918 devMode.dmPelsWidth, devMode.dmPelsHeight, devMode.dmBitsPerPel)); 909 919 … … 912 922 if (status != DISP_CHANGE_SUCCESSFUL) 913 923 { 914 Log (("VBoxTray: VBoxDisplayThread:error from ChangeDisplaySettings: %d\n", status));924 LogFlowFunc(("error from ChangeDisplaySettings: %d\n", status)); 915 925 916 926 if (status == DISP_CHANGE_BADMODE) … … 928 938 else 929 939 { 930 Log (("VBoxTray: VBoxDisplayThread:error from EnumDisplaySettings: %d\n", GetLastError ()));940 LogFlowFunc(("error from EnumDisplaySettings: %d\n", GetLastError ())); 931 941 break; 932 942 } … … 935 945 else 936 946 { 937 Log (("VBoxTray: VBoxDisplayThread:vboxDisplayDriver is not active\n"));947 LogFlowFunc(("vboxDisplayDriver is not active\n")); 938 948 } 939 949 … … 949 959 else 950 960 { 951 Log (("VBoxTray: VBoxDisplayThread:error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n"));961 LogFlowFunc(("error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n")); 952 962 /* sleep a bit to not eat too much CPU while retrying */ 953 963 /* are we supposed to stop? */ … … 965 975 { 966 976 #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")); 968 978 #endif 969 979 /* sleep a bit to not eat too much CPU in case the above call always fails */ … … 982 992 maskInfo.u32NotMask = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED; 983 993 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")); 985 995 PostMessage(ghwndToolWindow, WM_VBOX_GRAPHICS_UNSUPPORTED, 0, 0); 986 996 987 Log (("VBoxTray: VBoxDisplayThread:finished display change request thread\n"));997 LogFlowFunc(("finished display change request thread\n")); 988 998 return 0; 989 999 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDataObject.cpp
r50460 r51469 22 22 #include <iprt/semaphore.h> 23 23 #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> 24 30 25 31 #include "VBoxTray.h" -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropSource.cpp
r50177 r51469 17 17 #include <windows.h> 18 18 #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> 19 25 20 26 #include "VBoxTray.h" -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropTarget.cpp
r50830 r51469 25 25 #include "VBox/GuestHost/DragAndDrop.h" 26 26 #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> 27 33 28 34 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDEnumFormat.cpp
r49947 r51469 21 21 #include "VBoxHelpers.h" 22 22 #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 23 30 24 31 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxHostVersion.cpp
r44529 r51469 6 6 7 7 /* 8 * Copyright (C) 2010-201 1Oracle Corporation8 * Copyright (C) 2010-2014 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 22 22 23 23 #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 24 31 25 32 … … 55 62 5000 /* Time to display in msec */, NIIF_INFO); 56 63 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)); 58 65 } 59 66 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp
r50040 r51469 32 32 #include <iprt/mem.h> 33 33 #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> 34 41 35 42 … … 229 236 AssertPtrReturnVoid(pInstance); 230 237 231 LogF unc(("Stopping pInstance=%p\n", pInstance));238 LogFlowFunc(("Stopping pInstance=%p\n", pInstance)); 232 239 233 240 /* Shut down local IPC server. */ … … 239 246 int rc2 = RTLocalIpcServerCancel(pCtx->hServer); 240 247 if (RT_FAILURE(rc2)) 241 LogF unc(("Cancelling current listening call failed with rc=%Rrc\n", rc2));248 LogFlowFunc(("Cancelling current listening call failed with rc=%Rrc\n", rc2)); 242 249 } 243 250 … … 252 259 if (RT_FAILURE(rc2)) 253 260 { 254 LogF unc(("Stopping IPC session %p failed with rc=%Rrc\n",261 LogFlowFunc(("Stopping IPC session %p failed with rc=%Rrc\n", 255 262 pSession, rc2)); 256 263 /* Keep going. */ … … 265 272 AssertPtrReturnVoid(pInstance); 266 273 267 LogF unc(("Destroying pInstance=%p\n", pInstance));274 LogFlowFunc(("Destroying pInstance=%p\n", pInstance)); 268 275 269 276 PVBOXIPCCONTEXT pCtx = (PVBOXIPCCONTEXT)pInstance; … … 276 283 rc = RTLocalIpcServerDestroy(pCtx->hServer); 277 284 if (RT_FAILURE(rc)) 278 LogF unc(("Unable to destroy IPC server, rc=%Rrc\n", rc));285 LogFlowFunc(("Unable to destroy IPC server, rc=%Rrc\n", rc)); 279 286 280 287 int rc2 = RTCritSectLeave(&pCtx->CritSect); … … 283 290 } 284 291 285 LogF unc(("Waiting for remaining IPC sessions to shut down ...\n"));292 LogFlowFunc(("Waiting for remaining IPC sessions to shut down ...\n")); 286 293 287 294 /* Wait for all IPC session threads to shut down. */ … … 307 314 ("Session thread list is not empty when it should\n")); 308 315 309 LogF unc(("All remaining IPC sessions shut down\n"));316 LogFlowFunc(("All remaining IPC sessions shut down\n")); 310 317 311 318 int rc2 = RTCritSectDelete(&pCtx->CritSect); … … 313 320 rc = rc2; 314 321 315 LogF unc(("Destroyed pInstance=%p, rc=%Rrc\n",322 LogFlowFunc(("Destroyed pInstance=%p, rc=%Rrc\n", 316 323 pInstance, rc)); 317 324 } … … 331 338 AssertReturn(hSession != NIL_RTLOCALIPCSESSION, VERR_INVALID_PARAMETER); 332 339 333 LogF unc(("pThis=%p\n", pThis));340 LogFlowFunc(("pThis=%p\n", pThis)); 334 341 335 342 int rc = VINF_SUCCESS; … … 347 354 if (rc == VERR_CANCELLED) 348 355 { 349 LogF unc(("Session %p: Waiting for data cancelled\n", pThis));356 LogFlowFunc(("Session %p: Waiting for data cancelled\n", pThis)); 350 357 rc = VINF_SUCCESS; 351 358 break; 352 359 } 353 360 else 354 LogF unc(("Session %p: Waiting for session data failed with rc=%Rrc\n",361 LogFlowFunc(("Session %p: Waiting for session data failed with rc=%Rrc\n", 355 362 pThis, rc)); 356 363 } … … 391 398 392 399 if (RT_FAILURE(rc)) 393 LogF unc(("Session %p: Handling command %RU32 failed with rc=%Rrc\n",400 LogFlowFunc(("Session %p: Handling command %RU32 failed with rc=%Rrc\n", 394 401 pThis, ipcHdr.uMsgType, rc)); 395 402 } … … 423 430 } 424 431 425 LogF unc(("Session %p: Handler ended with rc=%Rrc\n",432 LogFlowFunc(("Session %p: Handler ended with rc=%Rrc\n", 426 433 pThis, rc)); 427 434 … … 431 438 int rc2 = RTLocalIpcSessionClose(hSession); 432 439 if (RT_FAILURE(rc2)) 433 LogF unc(("Session %p: Failed closing session %p, rc=%Rrc\n", pThis, rc2));440 LogFlowFunc(("Session %p: Failed closing session %p, rc=%Rrc\n", pThis, rc2)); 434 441 435 442 /* … … 449 456 } 450 457 451 LogF unc(("Session %p: Terminated with rc=%Rrc, freeing ...\n",458 LogFlowFunc(("Session %p: Terminated with rc=%Rrc, freeing ...\n", 452 459 pThis, rc)); 453 460 … … 488 495 int rc2 = RTLocalIpcSessionClose(hSession); 489 496 if (RT_FAILURE(rc2)) 490 LogF unc(("Failed closing session %p, rc=%Rrc\n", pSession, rc2));491 492 LogF unc(("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)); 493 500 RTMemFree(pSession); 494 501 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxLA.cpp
r46625 r51469 5 5 6 6 /* 7 * Copyright (C) 201 2Oracle Corporation7 * Copyright (C) 2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 18 // #define LOG_ENABLED19 20 17 #define _WIN32_WINNT 0x0501 21 18 #include <windows.h> … … 29 26 #include <iprt/ldr.h> 30 27 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 33 35 34 36 #define REG_KEY_LEN 1024 … … 147 149 if (lErr != ERROR_SUCCESS) 148 150 { 149 L ALOGFORCE(("LA: RegOpenKeyExW: failed [%ls]\n",151 LogRel(("LA: RegOpenKeyExW: failed [%ls]\n", 150 152 pwszRegKey)); 151 153 return FALSE; … … 163 165 if (lErr != ERROR_SUCCESS) 164 166 { 165 L ALOGFORCE(("LA: RegQueryValueExW: failed [%ls/%ls]\n",167 LogRel(("LA: RegQueryValueExW: failed [%ls/%ls]\n", 166 168 pwszRegKey, pwszName)); 167 169 RegCloseKey(hKey); … … 171 173 if (nRegData != sizeof(DWORD)) 172 174 { 173 L ALOGFORCE(("LA: buffer overflow reg %d, [%ls]\n",175 LogRel(("LA: buffer overflow reg %d, [%ls]\n", 174 176 nRegData, pwszRegKey)); 175 177 RegCloseKey(hKey); … … 179 181 if (dwType != REG_DWORD) 180 182 { 181 L ALOGFORCE(("LA: wrong type %d, [%ls/%ls]\n",183 LogRel(("LA: wrong type %d, [%ls/%ls]\n", 182 184 dwType, pwszRegKey, pwszName)); 183 185 RegCloseKey(hKey); … … 221 223 if (dwErr != ERROR_SUCCESS) 222 224 { 223 L ALOG(("LA:Can't open registry key [%ls], error %d\n",225 LogFlowFunc(("Can't open registry key [%ls], error %d\n", 224 226 pwszRegKey, dwErr)); 225 227 return FALSE; … … 249 251 if (dwRet == ERROR_NO_MORE_ITEMS) 250 252 { 251 L ALOG(("LA:Enumeration exhausted\n"));253 LogFlowFunc(("Enumeration exhausted\n")); 252 254 bRet = TRUE; 253 255 break; … … 255 257 else if (dwRet != ERROR_SUCCESS) 256 258 { 257 L ALOG(("LA:Enumeration failed, error %d\n",259 LogFlowFunc(("Enumeration failed, error %d\n", 258 260 dwRet)); 259 261 bRet = FALSE; … … 263 265 if ((type != REG_SZ) && (type != REG_EXPAND_SZ)) 264 266 { 265 L ALOG(("LA:skipped type %d\n",267 LogFlowFunc(("skipped type %d\n", 266 268 type)); 267 269 continue; … … 275 277 if (RT_FAILURE(rc)) 276 278 { 277 L ALOG(("LA:RTUtf16ToUtf8Ex for [%ls] rc %Rrc\n",279 LogFlowFunc(("RTUtf16ToUtf8Ex for [%ls] rc %Rrc\n", 278 280 wszValueName, rc)); 279 281 continue; … … 283 285 if (RTStrNICmp(szName, g_szCommandPrefix, RT_ELEMENTS(g_szCommandPrefix) - 1) != 0) 284 286 { 285 L ALOG(("LA:skipped prefix %s\n",287 LogFlowFunc(("skipped prefix %s\n", 286 288 szName)); 287 289 continue; … … 293 295 if (nIndex == 0) 294 296 { 295 L ALOG(("LA:skipped index %s\n",297 LogFlowFunc(("skipped index %s\n", 296 298 szName)); 297 299 continue; … … 302 304 if (!pEntry) 303 305 { 304 L ALOG(("LA:RTMemAlloc failed\n"));306 LogFlowFunc(("RTMemAlloc failed\n")); 305 307 bRet = FALSE; 306 308 break; … … 336 338 } 337 339 338 L ALOG(("LA:added %d %ls\n",340 LogFlowFunc(("added %d %ls\n", 339 341 pEntry->u32Index, pEntry->wszCommandLine)); 340 342 } … … 346 348 RTListForEach(listActions, pIter, ACTIONENTRY, nodeActionEntry) 347 349 { 348 L ALOG(("LA:[%u]: [%ls]\n",350 LogFlowFunc(("[%u]: [%ls]\n", 349 351 pIter->u32Index, pIter->wszCommandLine)); 350 352 } … … 356 358 } 357 359 358 L ALOG(("LA:action enum %d\n",360 LogFlowFunc(("action enum %d\n", 359 361 bRet)); 360 362 … … 364 366 static void ActionExecutorExecuteActions(RTLISTANCHOR *listActions) 365 367 { 366 L ALOG(("LA:ExecuteActions\n"));368 LogFlowFunc(("ExecuteActions\n")); 367 369 368 370 ACTIONENTRY *pIter = NULL; 369 371 RTListForEach(listActions, pIter, ACTIONENTRY, nodeActionEntry) 370 372 { 371 L ALOG(("LA:[%u]: [%ls]\n",373 LogFlowFunc(("[%u]: [%ls]\n", 372 374 pIter->u32Index, pIter->wszCommandLine)); 373 375 … … 388 390 &pi)) // lpProcessInformation 389 391 { 390 L ALOG(("LA:Executing [%ls] failed, error %d\n",392 LogFlowFunc(("Executing [%ls] failed, error %d\n", 391 393 pIter->wszCommandLine, GetLastError())); 392 394 } 393 395 else 394 396 { 395 L ALOG(("LA:Executing [%ls] succeeded\n",397 LogFlowFunc(("Executing [%ls] succeeded\n", 396 398 pIter->wszCommandLine)); 397 399 … … 402 404 } 403 405 404 L ALOG(("LA:ExecuteActions leave\n"));406 LogFlowFunc(("ExecuteActions leave\n")); 405 407 } 406 408 … … 457 459 if (fFound) 458 460 { 459 L ALOG(("LA:GetVolatileEnvironmentKey: [%s]\n", szRegKey));461 LogFlowFunc(("GetVolatileEnvironmentKey: [%s]\n", szRegKey)); 460 462 461 463 /* Convert szRegKey to Utf16 string. */ … … 467 469 if (RT_FAILURE(rc)) 468 470 { 469 L ALOG(("LA:RTStrToUtf16Ex failed %Rrc\n", rc));471 LogFlowFunc(("RTStrToUtf16Ex failed %Rrc\n", rc)); 470 472 fFound = FALSE; 471 473 } 472 474 else 473 475 { 474 L ALOG(("LA:unicode [%ls]\n", putf16Unicode));476 LogFlowFunc(("unicode [%ls]\n", putf16Unicode)); 475 477 } 476 478 } 477 479 else 478 480 { 479 L ALOG(("LA:GetVolatileEnvironmentKey: not found\n"));481 LogFlowFunc(("GetVolatileEnvironmentKey: not found\n")); 480 482 } 481 483 … … 502 504 if (lErr != ERROR_SUCCESS) 503 505 { 504 L ALOG(("LA:RegOpenKeyExW: failed [%ls]\n",506 LogFlowFunc(("RegOpenKeyExW: failed [%ls]\n", 505 507 wszRegKey)); 506 508 return FALSE; … … 518 520 if (lErr != ERROR_SUCCESS) 519 521 { 520 L ALOG(("LA:RegQueryValueExW: failed [%ls]\n",522 LogFlowFunc(("RegQueryValueExW: failed [%ls]\n", 521 523 wszRegKey)); 522 524 RegCloseKey(hKey); … … 526 528 if (nRegData >= cbClientName) 527 529 { 528 L ALOG(("LA:buffer overflow reg %d, buffer %d, [%ls]\n",530 LogFlowFunc(("buffer overflow reg %d, buffer %d, [%ls]\n", 529 531 nRegData, cbClientName, wszRegKey)); 530 532 RegCloseKey(hKey); … … 534 536 if (dwType != REG_SZ) 535 537 { 536 L ALOG(("LA:wrong type %d, [%ls]\n",538 LogFlowFunc(("wrong type %d, [%ls]\n", 537 539 dwType, wszRegKey)); 538 540 RegCloseKey(hKey); … … 611 613 &dwResult) == 0) 612 614 { 613 L ALOG(("LA:SendMessageTimeout failed, error %d\n", GetLastError()));615 LogFlowFunc(("SendMessageTimeout failed, error %d\n", GetLastError())); 614 616 } 615 617 } … … 642 644 if (!GetVolatileEnvironmentKey(wszRegKey, sizeof(wszRegKey))) 643 645 { 644 L ALOG(("LA:Failed to get 'Volatile Environment' registry key\n"));646 LogFlowFunc(("Failed to get 'Volatile Environment' registry key\n")); 645 647 return; 646 648 } … … 658 660 if (lRet != ERROR_SUCCESS) 659 661 { 660 L ALOG(("LA:Failed to open key [%ls], error %lu\n",662 LogFlowFunc(("Failed to open key [%ls], error %lu\n", 661 663 wszRegKey, lRet)); 662 664 return; … … 677 679 if (RT_FAILURE(rc)) 678 680 { 679 L ALOG(("LA:RTStrToUniEx failed %Rrc\n", rc));681 LogFlowFunc(("RTStrToUniEx failed %Rrc\n", rc)); 680 682 break; 681 683 } … … 691 693 if (lRet != ERROR_SUCCESS) 692 694 { 693 L ALOG(("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])); 694 696 } 695 697 } … … 716 718 static void laDoAttach(VBOXLACONTEXT *pCtx) 717 719 { 718 L ALOG(("LA:laDoAttach\n"));720 LogFlowFunc(("laDoAttach\n")); 719 721 720 722 /* Hardcoded action. */ … … 727 729 static void laDoDetach(VBOXLACONTEXT *pCtx) 728 730 { 729 L ALOG(("LA:laDoDetach\n"));731 LogFlowFunc(("laDoDetach\n")); 730 732 731 733 /* Process configured actions. */ … … 773 775 if (RT_SUCCESS(rc)) 774 776 { 775 L ALOG(("LA:laGetProperty: [%s]\n"777 LogFlowFunc(("laGetProperty: [%s]\n" 776 778 " value: [%s]\n" 777 779 " timestamp: %lld ns\n", … … 782 784 else if (rc == VERR_NOT_FOUND) 783 785 { 784 L ALOG(("LA:laGetProperty: not found [%s]\n", pszName));786 LogFlowFunc(("laGetProperty: not found [%s]\n", pszName)); 785 787 RTMemFree(pvBuf); 786 788 } 787 789 else 788 790 { 789 L ALOG(("LA:Failed to retrieve the property value, error %Rrc\n", rc));791 LogFlowFunc(("Failed to retrieve the property value, error %Rrc\n", rc)); 790 792 RTMemFree(pvBuf); 791 793 } … … 879 881 } 880 882 881 L ALOG(("LA:laGetUint32: rc = %Rrc, [%s]\n",883 LogFlowFunc(("laGetUint32: rc = %Rrc, [%s]\n", 882 884 rc, pszName)); 883 885 … … 892 894 ppszValue); 893 895 894 L ALOG(("LA:laGetString: rc = %Rrc, [%s]\n",896 LogFlowFunc(("laGetString: rc = %Rrc, [%s]\n", 895 897 rc, pszName)); 896 898 … … 905 907 pu32Value); 906 908 907 L ALOG(("LA:laGetActiveClient: rc %Rrc, %d, %lld\n", rc, *pu32Value, *pu64Timestamp));909 LogFlowFunc(("laGetActiveClient: rc %Rrc, %d, %lld\n", rc, *pu32Value, *pu64Timestamp)); 908 910 909 911 return rc; … … 915 917 * If u32ActiveClientId is 0, then there is no connected clients. 916 918 */ 917 L ALOG(("LA:laUpdateCurrentState: %u %lld\n",919 LogFlowFunc(("laUpdateCurrentState: %u %lld\n", 918 920 u32ActiveClientId, u64ActiveClientTS)); 919 921 … … 1017 1019 } 1018 1020 1019 L ALOG(("LA:laUpdateCurrentState rc = %Rrc\n",1021 LogFlowFunc(("laUpdateCurrentState rc = %Rrc\n", 1020 1022 rc)); 1021 1023 … … 1025 1027 static int laWait(VBOXLACONTEXT *pCtx, uint64_t *pu64Timestamp, uint32_t u32Timeout) 1026 1028 { 1027 L ALOG(("LA:laWait [%s]\n",1029 LogFlowFunc(("laWait [%s]\n", 1028 1030 pCtx->activeClient.pszPropWaitPattern)); 1029 1031 … … 1034 1036 u32Timeout); 1035 1037 1036 L ALOG(("LA:laWait rc %Rrc\n",1038 LogFlowFunc(("laWait rc %Rrc\n", 1037 1039 rc)); 1038 1040 … … 1064 1066 &pClientInfoMap[idx][LA_UTCINFO_PROP_VALUE]); 1065 1067 1066 L ALOG(("LA:laProcessClientInfo: read [%s], at %lld\n",1068 LogFlowFunc(("laProcessClientInfo: read [%s], at %lld\n", 1067 1069 pClientInfoMap[idx][LA_UTCINFO_PROP_VALUE], u64Timestamp)); 1068 1070 1069 1071 if (RT_FAILURE(rc)) 1070 1072 { 1071 L ALOG(("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])); 1072 1074 break; 1073 1075 } … … 1108 1110 if (RT_SUCCESS(rc)) 1109 1111 { 1110 L ALOG(("LA:laProcessAttach: read %d, at %lld\n",1112 LogFlowFunc(("laProcessAttach: read %d, at %lld\n", 1111 1113 u32Attach, u64Timestamp)); 1112 1114 … … 1115 1117 if (u32Attach != pCtx->activeClient.u32LastAttach) 1116 1118 { 1117 L ALOG(("LA:laProcessAttach: changed\n"));1119 LogFlowFunc(("laProcessAttach: changed\n")); 1118 1120 1119 1121 /* Just do the last action. */ … … 1126 1128 else 1127 1129 { 1128 L ALOG(("LA:laProcessAttach: same\n"));1130 LogFlowFunc(("laProcessAttach: same\n")); 1129 1131 1130 1132 /* The property has changed but the value is the same, … … 1141 1143 } 1142 1144 1143 L ALOG(("LA:laProcessAttach: action %d\n",1145 LogFlowFunc(("laProcessAttach: action %d\n", 1144 1146 pCtx->u32Action)); 1145 1147 } … … 1152 1154 * That is two or more LA_DO_ATTACH will do just one LA_DO_ATTACH. 1153 1155 */ 1154 L ALOG(("LA:laDoActions: action %d, prev %d\n",1156 LogFlowFunc(("laDoActions: action %d, prev %d\n", 1155 1157 pCtx->u32Action, pCtx->u32PrevAction)); 1156 1158 … … 1204 1206 pCtx->u32Action = LA_DO_NOTHING; 1205 1207 1206 L ALOG(("LA:laDoActions: leave\n"));1208 LogFlowFunc(("laDoActions: leave\n")); 1207 1209 } 1208 1210 … … 1222 1224 } 1223 1225 1224 L ALOG(("VBoxTray: VBoxLAInit\n"));1226 LogFlowFunc(("\n")); 1225 1227 1226 1228 /* DetachOnDisconnect is enabled by default. */ … … 1236 1238 } 1237 1239 1238 L ALOGFORCE(("VBoxTray: VBoxLAInit: dod %d, VBoxTrayLA %x\n", gCtx.fDetachOnDisconnect, dwValue));1240 LogRel(("LA: DetachOnDisconnect=%RTbool\n", gCtx.fDetachOnDisconnect)); 1239 1241 1240 1242 int rc = VbglR3GuestPropConnect(&gCtx.u32GuestPropHandle); … … 1258 1260 void VBoxLADestroy(const VBOXSERVICEENV *pEnv, void *pInstance) 1259 1261 { 1260 L ALOG(("VBoxTray: VBoxLADestroy\n"));1262 LogFlowFuncEnter(); 1261 1263 1262 1264 VBOXLACONTEXT *pCtx = (VBOXLACONTEXT *)pInstance; … … 1280 1282 VBOXLACONTEXT *pCtx = (VBOXLACONTEXT *)pInstance; 1281 1283 1282 L ALOG(("VBoxTray: VBoxLAThread: Started.\n"));1284 LogFlowFunc(("Started\n")); 1283 1285 1284 1286 /* … … 1295 1297 if (!ActionExecutorEnumerateRegistryKey(g_pwszRegKeyReconnectActions, &gCtx.listAttachActions)) 1296 1298 { 1297 L ALOG(("LA:Can't enumerate registry key %ls\n", g_pwszRegKeyReconnectActions));1299 LogFlowFunc(("Can't enumerate registry key %ls\n", g_pwszRegKeyReconnectActions)); 1298 1300 } 1299 1301 if (!ActionExecutorEnumerateRegistryKey(g_pwszRegKeyDisconnectActions, &gCtx.listDetachActions)) 1300 1302 { 1301 L ALOG(("LA:Can't enumerate registry key %ls\n", g_pwszRegKeyDisconnectActions));1303 LogFlowFunc(("Can't enumerate registry key %ls\n", g_pwszRegKeyDisconnectActions)); 1302 1304 } 1303 1305 … … 1355 1357 && fClientIdChanged) 1356 1358 { 1357 L ALOG(("LA:client disconnected\n"));1359 LogFlowFunc(("client disconnected\n")); 1358 1360 1359 1361 /* laDoActions will prevent a repeated detach action. So if there … … 1395 1397 } 1396 1398 1397 L ALOG(("VBoxTray: VBoxLAThread: Finished.\n"));1399 LogFlowFunc(("Finished\n")); 1398 1400 return 0; 1399 1401 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxMMR.cpp
r47231 r51469 5 5 6 6 /* 7 * Copyright (C) 2012 Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 19 19 #include "VBoxMMR.h" 20 20 #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 21 29 22 30 struct VBOXMMRCONTEXT … … 48 56 int VBoxMMRInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread) 49 57 { 50 Log Rel2(("VBoxMMR: Initializing\n"));58 LogFlowFuncEnter(); 51 59 52 60 int rc = RTLdrLoadAppPriv(g_pszMMRDLL, &gCtx.hModHook); … … 66 74 67 75 rc = RTErrConvertFromWin32(GetLastError()); 68 Log Rel2(("VBoxMMR:Error installing hooking proc: %Rrc\n", rc));76 LogFlowFunc(("Error installing hooking proc: %Rrc\n", rc)); 69 77 } 70 78 else 71 79 { 72 Log Rel2(("VBoxMMR:Hooking proc not found\n"));80 LogFlowFunc(("Hooking proc not found\n")); 73 81 rc = VERR_NOT_FOUND; 74 82 } … … 78 86 } 79 87 else 80 Log Rel2(("VBoxMMR:Hooking library not found (%Rrc)\n", rc));88 LogFlowFunc(("Hooking library not found (%Rrc)\n", rc)); 81 89 82 90 return rc; -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp
r48070 r51469 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 #define _WIN32_WINNT 0x0500 19 19 #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 20 35 #include "VBoxTray.h" 21 36 #include "VBoxHelpers.h" 22 37 #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 29 40 30 41 typedef struct _VBOXSEAMLESSCONTEXT -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSharedFolders.cpp
r44529 r51469 5 5 6 6 /* 7 * Copyright (C) 2010-201 2Oracle Corporation7 * Copyright (C) 2010-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 23 23 #include <VBox/VBoxGuestLib.h> 24 24 25 #ifdef DEBUG 26 # define LOG_ENABLED 27 # define LOG_GROUP LOG_GROUP_DEFAULT 28 #endif 29 #include <VBox/log.h> 30 31 32 25 33 int VBoxSharedFoldersAutoMount(void) 26 34 { … … 40 48 if (VbglR3SharedFolderExists(u32ClientId, "vbsfAutoMount")) 41 49 { 42 Log (("VBoxTray:Hosts supports auto-mount root\n"));50 LogFlowFunc(("Hosts supports auto-mount root\n")); 43 51 } 44 52 else 45 53 { 46 54 #endif 47 Log (("VBoxTray:Got %u shared folder mappings\n", cMappings));55 LogFlowFunc(("Got %u shared folder mappings\n", cMappings)); 48 56 for (uint32_t i = 0; i < cMappings && RT_SUCCESS(rc); i++) 49 57 { … … 53 61 && *pszName) 54 62 { 55 Log (("VBoxTray:Connecting share %u (%s) ...\n", i+1, pszName));63 LogFlowFunc(("Connecting share %u (%s) ...\n", i+1, pszName)); 56 64 57 65 char *pszShareName; … … 77 85 if (dwErr == NO_ERROR) 78 86 { 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)); 80 88 break; 81 89 } 82 90 else 83 91 { 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)); 85 93 86 94 switch (dwErr) … … 94 102 95 103 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", 97 105 pszName, szCurDrive, dwErr)); 98 106 break; … … 103 111 if (chDrive > 'Z') 104 112 { 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)); 106 114 break; 107 115 } … … 114 122 } 115 123 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", 117 125 paMappings[i].u32Root, rc)); 118 126 } … … 123 131 } 124 132 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)); 126 134 VbglR3SharedFolderDisconnect(u32ClientId); 127 135 } 128 136 else 129 137 { 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)); 131 139 /* return success, otherwise VBoxTray will not start! */ 132 140 rc = VINF_SUCCESS; … … 140 148 int rc = VbglR3SharedFolderConnect(&u32ClientId); 141 149 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)); 143 151 else 144 152 { … … 157 165 && *pszName) 158 166 { 159 Log (("VBoxTray:Disconnecting share %u (%s) ...\n", i+1, pszName));167 LogFlowFunc(("Disconnecting share %u (%s) ...\n", i+1, pszName)); 160 168 161 169 char *pszShareName; … … 165 173 if (dwErr == NO_ERROR) 166 174 { 167 LogRel((" VBoxTray:Share \"%s\" was disconnected\n", pszShareName));175 LogRel(("Share \"%s\" was disconnected\n", pszShareName)); 168 176 RTStrFree(pszShareName); 169 177 RTStrFree(pszName); … … 171 179 } 172 180 173 LogRel((" VBoxTray:Disconnecting \"%s\" failed, dwErr = %ld\n", pszShareName, dwErr));181 LogRel(("Disconnecting \"%s\" failed, dwErr = %ld\n", pszShareName, dwErr)); 174 182 175 183 switch (dwErr) … … 179 187 180 188 default: 181 LogRel((" VBoxTray:Error while disconnecting shared folder \"%s\", error = %ld\n",189 LogRel(("Error while disconnecting shared folder \"%s\", error = %ld\n", 182 190 pszShareName, dwErr)); 183 191 break; … … 191 199 } 192 200 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", 194 202 paMappings[i].u32Root, rc)); 195 203 } … … 197 205 } 198 206 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)); 200 208 VbglR3SharedFolderDisconnect(u32ClientId); 201 209 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r51224 r51469 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 * Header Files * 21 21 *******************************************************************************/ 22 #ifdef DEBUG23 # define LOG_ENABLED24 # define LOG_GROUP LOG_GROUP_DEFAULT25 #endif26 27 22 #include <package-generated.h> 28 23 #include "product-generated.h" … … 56 51 #include <iprt/system.h> 57 52 #include <iprt/time.h> 53 54 #ifdef DEBUG 55 # define LOG_ENABLED 56 # define LOG_GROUP LOG_GROUP_DEFAULT 57 #endif 58 58 #include <VBox/log.h> 59 59 … … 257 257 { 258 258 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)); 260 260 return RTErrConvertFromWin32(dwErr); 261 261 } … … 277 277 { 278 278 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)); 280 280 rc = RTErrConvertFromWin32(dwErr); 281 281 RT_ZERO(gNotifyIconData); … … 309 309 AssertPtrReturn(pTable, VERR_INVALID_POINTER); 310 310 311 Log((" VBoxTray:Starting services ...\n"));311 Log(("Starting services ...\n")); 312 312 313 313 /** @todo Use IPRT events here. */ … … 324 324 && pTable->pszName) 325 325 { 326 Log((" VBoxTray:Starting %s ...\n", pTable->pszName));326 Log(("Starting %s ...\n", pTable->pszName)); 327 327 328 328 int rc = VINF_SUCCESS; … … 339 339 if (RT_FAILURE(rc)) 340 340 { 341 LogRel((" VBoxTray:Failed to initialize service \"%s\", rc=%Rrc\n",341 LogRel(("Failed to initialize service \"%s\", rc=%Rrc\n", 342 342 pTable->pszName, rc)); 343 343 } … … 363 363 else 364 364 { 365 Log((" VBoxTray:Failed to start the thread\n"));365 Log(("Failed to start the thread\n")); 366 366 if (pTable->pfnDestroy) 367 367 pTable->pfnDestroy(pEnv, pTable->pInstance); … … 438 438 { 439 439 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)); 441 441 rc = RTErrConvertFromWin32(dwErr); 442 442 } … … 482 482 { 483 483 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)); 485 485 } 486 486 return RTErrConvertFromWin32(dwErr); … … 623 623 if (ghwndToolWindow) 624 624 { 625 Log((" VBoxTray:Destroying tool window ...\n"));625 Log(("Destroying tool window ...\n")); 626 626 627 627 /* Destroy the tool window. */ … … 647 647 { 648 648 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)); 650 650 } 651 651 else … … 665 665 { 666 666 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)); 668 668 } 669 669 else … … 672 672 hlpReloadCursor(); 673 673 674 Log((" VBoxTray:Invisible tool window handle = %p\n", ghwndToolWindow));674 Log(("Invisible tool window handle = %p\n", ghwndToolWindow)); 675 675 } 676 676 } … … 688 688 if (GetVersionEx(&info)) 689 689 { 690 Log((" VBoxTray:Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion));690 Log(("Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion)); 691 691 gMajorVersion = info.dwMajorVersion; 692 692 } … … 706 706 { 707 707 dwErr = GetLastError(); 708 Log((" VBoxTray:SetSecurityDescriptorDacl failed with last error = %08X\n", dwErr));708 Log(("SetSecurityDescriptorDacl failed with last error = %08X\n", dwErr)); 709 709 } 710 710 else … … 716 716 *(void **)&pfnConvertStringSecurityDescriptorToSecurityDescriptorA = 717 717 RTLdrGetSystemSymbol("advapi32.dll", "ConvertStringSecurityDescriptorToSecurityDescriptorA"); 718 Log((" VBoxTray:pfnConvertStringSecurityDescriptorToSecurityDescriptorA = %x\n", pfnConvertStringSecurityDescriptorToSecurityDescriptorA));718 Log(("pfnConvertStringSecurityDescriptorToSecurityDescriptorA = %x\n", pfnConvertStringSecurityDescriptorToSecurityDescriptorA)); 719 719 if (pfnConvertStringSecurityDescriptorToSecurityDescriptorA) 720 720 { … … 729 729 { 730 730 dwErr = GetLastError(); 731 Log((" VBoxTray:ConvertStringSecurityDescriptorToSecurityDescriptorA failed with last error = %08X\n", dwErr));731 Log(("ConvertStringSecurityDescriptorToSecurityDescriptorA failed with last error = %08X\n", dwErr)); 732 732 } 733 733 else … … 737 737 { 738 738 dwErr = GetLastError(); 739 Log((" VBoxTray:GetSecurityDescriptorSacl failed with last error = %08X\n", dwErr));739 Log(("GetSecurityDescriptorSacl failed with last error = %08X\n", dwErr)); 740 740 } 741 741 else … … 745 745 { 746 746 dwErr = GetLastError(); 747 Log((" VBoxTray:SetSecurityDescriptorSacl failed with last error = %08X\n", dwErr));747 Log(("SetSecurityDescriptorSacl failed with last error = %08X\n", dwErr)); 748 748 } 749 749 } … … 759 759 { 760 760 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)); 762 762 } 763 763 … … 766 766 { 767 767 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)); 769 769 } 770 770 } … … 801 801 { 802 802 int rc = VINF_SUCCESS; 803 Log((" VBoxTray:Entering vboxTrayServiceMain\n"));803 Log(("Entering vboxTrayServiceMain\n")); 804 804 805 805 ghStopSem = CreateEvent(NULL, TRUE, FALSE, NULL); … … 807 807 { 808 808 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)); 810 810 } 811 811 else … … 891 891 } 892 892 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)); 894 894 while (true) 895 895 { … … 898 898 899 899 /* Only enable for message debugging, lots of traffic! */ 900 //Log((" VBoxTray:Wait result = %ld\n", waitResult));900 //Log(("Wait result = %ld\n", waitResult)); 901 901 902 902 if (waitResult == 0) 903 903 { 904 Log((" VBoxTray:Event 'Exit' triggered\n"));904 Log(("Event 'Exit' triggered\n")); 905 905 /* exit */ 906 906 break; … … 915 915 if (hWaitEvent[waitResult] == ghSeamlessWtNotifyEvent) 916 916 { 917 Log((" VBoxTray:Event 'Seamless' triggered\n"));917 Log(("Event 'Seamless' triggered\n")); 918 918 919 919 /* seamless window notification */ … … 923 923 else if (hWaitEvent[waitResult] == ghSeamlessKmNotifyEvent) 924 924 { 925 Log((" VBoxTray:Event 'Km Seamless' triggered\n"));925 Log(("Event 'Km Seamless' triggered\n")); 926 926 927 927 /* seamless window notification */ … … 931 931 else if (hWaitEvent[waitResult] == vboxDtGetNotifyEvent()) 932 932 { 933 Log((" VBoxTray:Event 'Dt' triggered\n"));933 Log(("Event 'Dt' triggered\n")); 934 934 VBoxTrayCheckDt(); 935 935 fHandled = TRUE; … … 945 945 { 946 946 #ifndef DEBUG_andy 947 Log((" VBoxTray:msg %p\n", msg.message));947 Log(("msg %p\n", msg.message)); 948 948 #endif 949 949 if (msg.message == WM_QUIT) 950 950 { 951 Log((" VBoxTray:WM_QUIT!\n"));951 Log(("WM_QUIT!\n")); 952 952 SetEvent(ghStopSem); 953 953 } … … 958 958 } 959 959 } 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")); 963 963 vboxTrayStopServices(&svcEnv, vboxServiceTable); 964 964 } /* Services started */ … … 968 968 vboxTrayRemoveTrayIcon(); 969 969 970 Log((" VBoxTray:Leaving vboxTrayServiceMain with rc=%Rrc\n", rc));970 Log(("Leaving vboxTrayServiceMain with rc=%Rrc\n", rc)); 971 971 return rc; 972 972 } … … 989 989 } 990 990 991 LogRel((" VBoxTray:%s r%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()));991 LogRel(("%s r%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr())); 992 992 993 993 int rc = RTR3InitExeNoArguments(0); … … 1016 1016 if (!RT_SUCCESS(rc)) 1017 1017 { 1018 WARN(("VBoxTray:vboxStInit failed, rc %d\n"));1018 LogFlowFunc(("vboxStInit failed, rc %d\n")); 1019 1019 /* ignore the St Init failure. this can happen for < XP win that do not support WTS API 1020 1020 * in that case the session is treated as active connected to the physical console … … 1026 1026 if (!RT_SUCCESS(rc)) 1027 1027 { 1028 WARN(("VBoxTray:vboxDtInit failed, rc %d\n"));1028 LogFlowFunc(("vboxDtInit failed, rc %d\n")); 1029 1029 /* ignore the Dt Init failure. this can happen for < XP win that do not support WTS API 1030 1030 * in that case the session is treated as active connected to the physical console … … 1036 1036 if (!RT_SUCCESS(rc)) 1037 1037 { 1038 WARN(("VBoxAcquireGuestCaps cfg failed rc %d, ignoring..\n", rc));1038 LogFlowFunc(("VBoxAcquireGuestCaps cfg failed rc %d, ignoring..\n", rc)); 1039 1039 } 1040 1040 … … 1042 1042 if (RT_SUCCESS(rc)) 1043 1043 { 1044 Log((" VBoxTray:Init successful\n"));1044 Log(("Init successful\n")); 1045 1045 rc = vboxTrayServiceMain(); 1046 1046 if (RT_SUCCESS(rc)) … … 1065 1065 if (RT_FAILURE(rc)) 1066 1066 { 1067 LogRel((" VBoxTray:Error while starting, rc=%Rrc\n", rc));1067 LogRel(("Error while starting, rc=%Rrc\n", rc)); 1068 1068 hlpReportStatus(VBoxGuestFacilityStatus_Failed); 1069 1069 } 1070 LogRel((" VBoxTray:Ended\n"));1070 LogRel(("Ended\n")); 1071 1071 vboxTrayCloseBaseDriver(); 1072 1072 … … 1094 1094 case WM_CREATE: 1095 1095 { 1096 Log((" VBoxTray:Tool window created\n"));1096 Log(("Tool window created\n")); 1097 1097 1098 1098 int rc = vboxTrayRegisterGlobalMessages(&s_vboxGlobalMessageTable[0]); 1099 1099 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)); 1101 1101 return 0; 1102 1102 } … … 1106 1106 1107 1107 case WM_DESTROY: 1108 Log((" VBoxTray:Tool window destroyed\n"));1108 Log(("Tool window destroyed\n")); 1109 1109 KillTimer(ghwndToolWindow, TIMERID_VBOXTRAY_CHECK_HOSTVERSION); 1110 1110 return 0; … … 1226 1226 1227 1227 DWORD dwErr = GetLastError(); 1228 WARN(("VBoxTray:WTSQuerySessionInformationA WTSClientProtocolType failed, error = %08X\n", dwErr));1228 LogFlowFunc(("WTSQuerySessionInformationA WTSClientProtocolType failed, error = %08X\n", dwErr)); 1229 1229 rc = RTErrConvertFromWin32(dwErr); 1230 1230 } … … 1232 1232 { 1233 1233 DWORD dwErr = GetLastError(); 1234 WARN(("VBoxTray:WTSQuerySessionInformationA WTSConnectState failed, error = %08X\n", dwErr));1234 LogFlowFunc(("WTSQuerySessionInformationA WTSConnectState failed, error = %08X\n", dwErr)); 1235 1235 rc = RTErrConvertFromWin32(dwErr); 1236 1236 } … … 1260 1260 (void **)&gVBoxSt.pfnWTSQuerySessionInformationA); 1261 1261 if (RT_FAILURE(rc)) 1262 WARN(("VBoxTray:WTSQuerySessionInformationA not found\n"));1262 LogFlowFunc(("WTSQuerySessionInformationA not found\n")); 1263 1263 } 1264 1264 else 1265 WARN(("VBoxTray:WTSUnRegisterSessionNotification not found\n"));1265 LogFlowFunc(("WTSUnRegisterSessionNotification not found\n")); 1266 1266 } 1267 1267 else 1268 WARN(("VBoxTray:WTSRegisterSessionNotification not found\n"));1268 LogFlowFunc(("WTSRegisterSessionNotification not found\n")); 1269 1269 if (RT_SUCCESS(rc)) 1270 1270 { … … 1275 1275 { 1276 1276 DWORD dwErr = GetLastError(); 1277 WARN(("VBoxTray:WTSRegisterSessionNotification failed, error = %08X\n", dwErr));1277 LogFlowFunc(("WTSRegisterSessionNotification failed, error = %08X\n", dwErr)); 1278 1278 if (dwErr == RPC_S_INVALID_BINDING) 1279 1279 { … … 1295 1295 } 1296 1296 else 1297 WARN(("VBoxTray:WTSAPI32 load failed, rc = %Rrc\n", rc));1297 LogFlowFunc(("WTSAPI32 load failed, rc = %Rrc\n", rc)); 1298 1298 1299 1299 RT_ZERO(gVBoxSt); … … 1307 1307 if (!gVBoxSt.hWTSAPIWnd) 1308 1308 { 1309 WARN(("VBoxTray:vboxStTerm called for non-initialized St\n"));1309 LogFlowFunc(("vboxStTerm called for non-initialized St\n")); 1310 1310 return; 1311 1311 } … … 1322 1322 { 1323 1323 DWORD dwErr = GetLastError(); 1324 WARN(("VBoxTray:WTSAPI32 load failed, error = %08X\n", dwErr));1324 LogFlowFunc(("WTSAPI32 load failed, error = %08X\n", dwErr)); 1325 1325 } 1326 1326 } … … 1346 1346 VBOXST_DBG_MAKECASE(WTS_SESSION_REMOTE_CONTROL); 1347 1347 default: 1348 WARN(("VBoxTray:invalid WTS state %d\n", val));1348 LogFlowFunc(("invalid WTS state %d\n", val)); 1349 1349 return "Unknown"; 1350 1350 } … … 1365 1365 { 1366 1366 DWORD dwErr = GetLastError(); 1367 WARN(("VBoxTray:timer WTSRegisterSessionNotification failed, error = %08X\n", dwErr));1367 LogFlowFunc(("timer WTSRegisterSessionNotification failed, error = %08X\n", dwErr)); 1368 1368 Assert(gVBoxSt.fIsConsole == TRUE); 1369 1369 Assert(gVBoxSt.enmConnectState == WTSActive); … … 1376 1376 static BOOL vboxStHandleEvent(WPARAM wEvent, LPARAM SessionID) 1377 1377 { 1378 WARN(("VBoxTray:WTS Event: %s\n", vboxStDbgGetString(wEvent)));1378 LogFlowFunc(("WTS Event: %s\n", vboxStDbgGetString(wEvent))); 1379 1379 BOOL fOldIsActiveConsole = vboxStIsActiveConsole(); 1380 1380 … … 1425 1425 // { 1426 1426 // 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)); 1428 1428 // } 1429 1429 … … 1433 1433 { 1434 1434 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)); 1436 1436 } 1437 1437 return fIsInputDt; … … 1456 1456 if (GetVersionEx(&info)) 1457 1457 { 1458 LogRel((" VBoxTray:Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion));1458 LogRel(("Windows version %ld.%ld\n", info.dwMajorVersion, info.dwMinorVersion)); 1459 1459 gMajorVersion = info.dwMajorVersion; 1460 1460 } … … 1476 1476 (void **)&gVBoxDt.pfnVBoxHookRemoveActiveDesktopTracker); 1477 1477 if (RT_FAILURE(rc)) 1478 WARN(("VBoxTray:VBoxHookRemoveActiveDesktopTracker not found\n"));1478 LogFlowFunc(("VBoxHookRemoveActiveDesktopTracker not found\n")); 1479 1479 } 1480 1480 else 1481 WARN(("VBoxTray:VBoxHookInstallActiveDesktopTracker not found\n"));1481 LogFlowFunc(("VBoxHookInstallActiveDesktopTracker not found\n")); 1482 1482 if (RT_SUCCESS(rc)) 1483 1483 { … … 1486 1486 if (!gVBoxDt.pfnGetThreadDesktop) 1487 1487 { 1488 WARN(("VBoxTray:GetThreadDesktop not found\n"));1488 LogFlowFunc(("GetThreadDesktop not found\n")); 1489 1489 rc = VERR_NOT_SUPPORTED; 1490 1490 } … … 1493 1493 if (!gVBoxDt.pfnOpenInputDesktop) 1494 1494 { 1495 WARN(("VBoxTray:OpenInputDesktop not found\n"));1495 LogFlowFunc(("OpenInputDesktop not found\n")); 1496 1496 rc = VERR_NOT_SUPPORTED; 1497 1497 } … … 1500 1500 if (!gVBoxDt.pfnCloseDesktop) 1501 1501 { 1502 WARN(("VBoxTray:CloseDesktop not found\n"));1502 LogFlowFunc(("CloseDesktop not found\n")); 1503 1503 rc = VERR_NOT_SUPPORTED; 1504 1504 } … … 1516 1516 { 1517 1517 DWORD dwErr = GetLastError(); 1518 WARN(("VBoxTray:pfnVBoxHookInstallActiveDesktopTracker failed, last error = %08X\n", dwErr));1518 LogFlowFunc(("pfnVBoxHookInstallActiveDesktopTracker failed, last error = %08X\n", dwErr)); 1519 1519 } 1520 1520 } … … 1526 1526 { 1527 1527 DWORD dwErr = GetLastError(); 1528 WARN(("VBoxTray:SetTimer error %08X\n", dwErr));1528 LogFlowFunc(("SetTimer error %08X\n", dwErr)); 1529 1529 rc = RTErrConvertFromWin32(dwErr); 1530 1530 } … … 1544 1544 { 1545 1545 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)); 1547 1547 rc = RTErrConvertFromWin32(dwErr); 1548 1548 } … … 1553 1553 { 1554 1554 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)); 1556 1556 rc = RTErrConvertFromWin32(dwErr); 1557 1557 } … … 1603 1603 DWORD cbReturned = 0; 1604 1604 VBoxGuestCapsAquire Info; 1605 Log(("VBox Tray: 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)); 1606 1606 Info.enmFlags = fCfg ? VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE : VBOXGUESTCAPSACQUIRE_FLAGS_NONE; 1607 1607 Info.rc = VERR_NOT_IMPLEMENTED; … … 1611 1611 { 1612 1612 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)); 1614 1614 return RTErrConvertFromWin32(LastErr); 1615 1615 } … … 1618 1618 if (!RT_SUCCESS(rc)) 1619 1619 { 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)); 1621 1621 return rc; 1622 1622 } … … 1663 1663 if (fEnabled) 1664 1664 { 1665 Log((" VBoxTray:vboxCapsOnEnableSeamles: ENABLED\n"));1665 Log(("vboxCapsOnEnableSeamles: ENABLED\n")); 1666 1666 Assert(pCap->enmAcState == VBOXCAPS_ENTRY_ACSTATE_ACQUIRED); 1667 1667 Assert(pCap->enmFuncState == VBOXCAPS_ENTRY_FUNCSTATE_STARTED); … … 1670 1670 else 1671 1671 { 1672 Log((" VBoxTray:vboxCapsOnEnableSeamles: DISABLED\n"));1672 Log(("vboxCapsOnEnableSeamles: DISABLED\n")); 1673 1673 Assert(pCap->enmAcState != VBOXCAPS_ENTRY_ACSTATE_ACQUIRED || pCap->enmFuncState != VBOXCAPS_ENTRY_FUNCSTATE_STARTED); 1674 1674 VBoxSeamlessDisable(); … … 1680 1680 VBOXCAPS *pConsole = &gVBoxCaps; 1681 1681 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", 1683 1683 enmAcState, pCap->fCap, pCap->iCap, pCap->enmFuncState, pCap->enmAcState)); 1684 1684 … … 1708 1708 VBOXCAPS *pConsole = &gVBoxCaps; 1709 1709 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", 1711 1711 enmFuncState, pCap->fCap, pCap->iCap, pCap->enmFuncState, pCap->enmAcState)); 1712 1712 … … 1756 1756 { 1757 1757 VBOXCAPS *pConsole = &gVBoxCaps; 1758 Log(("VBox Tray: VBoxCapsReleaseAll\n"));1758 Log(("VBoxCapsReleaseAll\n")); 1759 1759 int rc = VBoxAcquireGuestCaps(0, VMMDEV_GUEST_SUPPORTS_SEAMLESS | VMMDEV_GUEST_SUPPORTS_GRAPHICS, false); 1760 1760 if (!RT_SUCCESS(rc)) 1761 1761 { 1762 WARN(("VBoxTray:vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc));1762 LogFlowFunc(("vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc)); 1763 1763 return rc; 1764 1764 } … … 1766 1766 if (pConsole->idTimer) 1767 1767 { 1768 Log((" VBoxTray:killing console timer\n"));1768 Log(("killing console timer\n")); 1769 1769 KillTimer(ghwndToolWindow, pConsole->idTimer); 1770 1770 pConsole->idTimer = 0; … … 1843 1843 if (pCap->enmAcState == VBOXCAPS_ENTRY_ACSTATE_RELEASED) 1844 1844 { 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)); 1846 1846 return VERR_INVALID_STATE; 1847 1847 } … … 1863 1863 Assert(VBoxConsoleIsAllowed()); 1864 1864 VBOXCAPS_ENTRY *pCap = &pConsole->aCaps[iCap]; 1865 Log(("VBox Tray: VBoxCapsEntryAcquire %d\n", iCap));1865 Log(("VBoxCapsEntryAcquire %d\n", iCap)); 1866 1866 if (pCap->enmAcState != VBOXCAPS_ENTRY_ACSTATE_RELEASED) 1867 1867 { 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)); 1869 1869 return VERR_INVALID_STATE; 1870 1870 } … … 1880 1880 if (rc != VERR_RESOURCE_BUSY) 1881 1881 { 1882 WARN(("VBoxTray:vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc));1882 LogFlowFunc(("vboxCapsEntryReleaseAll VBoxAcquireGuestCaps failed rc %d\n", rc)); 1883 1883 return rc; 1884 1884 } 1885 1885 1886 WARN(("VBoxTray:iCap %d is busy!\n", iCap));1886 LogFlowFunc(("iCap %d is busy!\n", iCap)); 1887 1887 1888 1888 /* the cap was busy, most likely it is still used by other VBoxTray instance running in another session, … … 1894 1894 { 1895 1895 DWORD dwErr = GetLastError(); 1896 WARN(("VBoxTray:SetTimer error %08X\n", dwErr));1896 LogFlowFunc(("SetTimer error %08X\n", dwErr)); 1897 1897 return RTErrConvertFromWin32(dwErr); 1898 1898 } … … 1905 1905 { 1906 1906 VBOXCAPS *pConsole = &gVBoxCaps; 1907 Log(("VBox Tray: VBoxCapsAcquireAllSupported\n"));1907 Log(("VBoxCapsAcquireAllSupported\n")); 1908 1908 for (int i = 0; i < RT_ELEMENTS(pConsole->aCaps); ++i) 1909 1909 { 1910 1910 if (pConsole->aCaps[i].enmFuncState >= VBOXCAPS_ENTRY_FUNCSTATE_SUPPORTED) 1911 1911 { 1912 Log(("VBox Tray: 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)); 1913 1913 VBoxCapsEntryAcquire(i); 1914 1914 } 1915 1915 else 1916 1916 { 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)); 1918 1918 } 1919 1919 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.h
r51224 r51469 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 49 49 #include <VBox/version.h> 50 #include <VBox/Log.h>51 50 #include <VBox/VBoxGuest.h> /** @todo use the VbglR3 interface! */ 52 51 #include <VBox/VBoxGuestLib.h> … … 54 53 55 54 #include "VBoxDispIf.h" 56 57 #ifdef DEBUG_misha58 #define WARN(_m) do { \59 Assert(0); \60 Log(_m); \61 } while (0)62 #else63 #define WARN(_m) do { \64 Log(_m); \65 } while (0)66 #endif67 55 68 56 /* -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp
r49891 r51469 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 22 22 #include "VBoxHelpers.h" 23 23 #include "VBoxVRDP.h" 24 24 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 25 32 #include <VBoxGuestInternal.h> 26 33 #include <iprt/assert.h> 27 34 #include <iprt/ldr.h> 35 28 36 29 37 … … 94 102 * The parameter has to be disabled. 95 103 */ 96 Log (("VBoxTray: vboxExperienceSet:Saving %s\n", parameters[i].name));104 LogFlowFunc(("Saving %s\n", parameters[i].name)); 97 105 98 106 /* Save the current value. */ … … 128 136 if (parameters[i].cbSavedValue > sizeof (parameters[i].achSavedValue)) 129 137 { 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))); 131 139 break; 132 140 } … … 144 152 } 145 153 146 Log (("VBoxTray: vboxExperienceSet:Disabling %s\n", parameters[i].name));154 LogFlowFunc(("Disabling %s\n", parameters[i].name)); 147 155 148 156 /* Disable the feature. */ … … 199 207 if (parameters[i].level > level) 200 208 { 201 Log (("VBoxTray: vboxExperienceRestore:Restoring %s\n", parameters[i].name));209 LogFlowFunc(("Restoring %s\n", parameters[i].name)); 202 210 203 211 /* Restore the feature. */ … … 269 277 int VBoxVRDPInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread) 270 278 { 271 Log (("VBoxTray:VBoxVRDPInit\n"));279 LogFlowFunc(("VBoxVRDPInit\n")); 272 280 273 281 gCtx.pEnv = pEnv; … … 296 304 void VBoxVRDPDestroy(const VBOXSERVICEENV *pEnv, void *pInstance) 297 305 { 298 Log (("VBoxTray:VBoxVRDPDestroy\n"));306 LogFlowFunc(("VBoxVRDPDestroy\n")); 299 307 VBOXVRDPCONTEXT *pCtx = (VBOXVRDPCONTEXT *)pInstance; 300 308 vboxExperienceRestore (pCtx->level); … … 322 330 if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 323 331 { 324 Log (("VBoxTray: VBoxVRDPThread:DeviceIOControl(CtlMask - or) succeeded\n"));332 LogFlowFunc(("DeviceIOControl(CtlMask - or) succeeded\n")); 325 333 } 326 334 else 327 335 { 328 Log (("VBoxTray: VBoxVRDPThread:DeviceIOControl(CtlMask) failed\n"));336 LogFlowFunc(("DeviceIOControl(CtlMask) failed\n")); 329 337 return 0; 330 338 } … … 338 346 if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent), &waitEvent, sizeof(waitEvent), &cbReturned, NULL)) 339 347 { 340 Log (("VBoxTray: VBoxVRDPThread:DeviceIOControl succeeded\n"));348 LogFlowFunc(("DeviceIOControl succeeded\n")); 341 349 342 350 /* are we supposed to stop? */ … … 344 352 break; 345 353 346 Log (("VBoxTray: VBoxVRDPThread:checking event\n"));354 LogFlowFunc(("checking event\n")); 347 355 348 356 /* did we get the right event? */ … … 366 374 &cbReturned, NULL)) 367 375 { 368 Log (("VBoxTray: VBoxVRDPThread:u8VRDPActive = %d, level %d\n", vrdpChangeRequest.u8VRDPActive, vrdpChangeRequest.u32VRDPExperienceLevel));376 LogFlowFunc(("u8VRDPActive = %d, level %d\n", vrdpChangeRequest.u8VRDPActive, vrdpChangeRequest.u32VRDPExperienceLevel)); 369 377 370 378 if (vrdpChangeRequest.u8VRDPActive) … … 379 387 pCtx->fSavedThemeEnabled = pCtx->pfnIsThemeActive (); 380 388 381 Log (("VBoxTray: VBoxVRDPThread:pCtx->fSavedThemeEnabled = %d\n", pCtx->fSavedThemeEnabled));389 LogFlowFunc(("pCtx->fSavedThemeEnabled = %d\n", pCtx->fSavedThemeEnabled)); 382 390 383 391 if (pCtx->fSavedThemeEnabled) … … 397 405 /* @todo the call returns S_OK but theming remains disabled. */ 398 406 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)); 400 408 pCtx->fSavedThemeEnabled = FALSE; 401 409 } … … 410 418 { 411 419 #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")); 413 421 #endif 414 422 /* sleep a bit to not eat too much CPU in case the above call always fails */ … … 424 432 { 425 433 #ifndef DEBUG_andy 426 Log (("VBoxTray: VBoxVRDPThread:Error from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n"));434 LogFlowFunc(("Error from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n")); 427 435 #endif 428 436 /* sleep a bit to not eat too much CPU in case the above call always fails */ … … 439 447 if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 440 448 { 441 Log (("VBoxTray: VBoxVRDPThread:DeviceIOControl(CtlMask - not) succeeded\n"));449 LogFlowFunc(("DeviceIOControl(CtlMask - not) succeeded\n")); 442 450 } 443 451 else 444 452 { 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")); 449 457 return 0; 450 458 }
Note:
See TracChangeset
for help on using the changeset viewer.