Changeset 51469 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
- Timestamp:
- May 30, 2014 11:49:42 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.