- Timestamp:
- Sep 22, 2010 8:40:24 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
r32622 r32687 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 #include "helpers.h" 26 26 #include <malloc.h> 27 #include <VBoxGuestInternal.h> 27 28 28 29 typedef struct _VBOXDISPLAYCONTEXT … … 455 456 maskInfo.u32OrMask = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED; 456 457 maskInfo.u32NotMask = 0; 457 if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 458 { 459 Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - or) succeeded\n")); 460 } 461 else 462 { 463 Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask) failed, DisplayChangeThread exited\n")); 464 return -1; 458 if (!DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 459 { 460 Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - or) failed, thead exiting\n")); 461 return 0; 462 } 463 464 int rc = VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0); 465 if (RT_FAILURE(rc)) 466 { 467 LogRel(("VBoxTray: VBoxDisplayThread: Failed to set the graphics capability with rc=%Rrc, thead exiting\n", rc)); 468 return 0; 465 469 } 466 470 … … 700 704 } while (!fTerminate); 701 705 706 /* 707 * Remove event filter and graphics capability report. 708 */ 702 709 maskInfo.u32OrMask = 0; 703 710 maskInfo.u32NotMask = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED; 704 if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 705 { 706 Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - not) succeeded\n")); 707 } 708 else 709 { 710 Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask) failed\n")); 711 } 711 if (!DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 712 Log(("VBoxTray: VBoxDisplayThread: DeviceIOControl(CtlMask - not) failed\n")); 713 VbglR3SetGuestCaps(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS); 712 714 713 715 Log(("VBoxTray: VBoxDisplayThread: finished display change request thread\n")); -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp
r32249 r32687 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 23 23 #include <VBox/VMMDev.h> 24 24 #include <iprt/assert.h> 25 #include <VBoxGuestInternal.h> 25 26 #include "helpers.h" 26 27 … … 61 62 GetVersionEx (&OSinfo); 62 63 64 int rc = VINF_SUCCESS; 65 63 66 /* We have to jump out here when using NT4, otherwise it complains about 64 67 a missing API function "UnhookWinEvent" used by the dynamically loaded VBoxHook.dll below */ … … 66 69 { 67 70 Log(("VBoxTray: VBoxSeamlessInit: Windows NT 4.0 or older not supported!\n")); 68 return VERR_NOT_SUPPORTED; 69 } 70 71 /* Will fail if SetWinEventHook is not present (version < NT4 SP6 apparently) */ 72 gCtx.hModule = LoadLibrary(VBOXHOOK_DLL_NAME); 73 if (gCtx.hModule) 74 { 75 *(uintptr_t *)&gCtx.pfnVBoxInstallHook = (uintptr_t)GetProcAddress(gCtx.hModule, "VBoxInstallHook"); 76 *(uintptr_t *)&gCtx.pfnVBoxRemoveHook = (uintptr_t)GetProcAddress(gCtx.hModule, "VBoxRemoveHook"); 77 78 /* inform the host that we support the seamless window mode */ 79 VMMDevReqGuestCapabilities vmmreqGuestCaps = {0}; 80 vmmdevInitRequest((VMMDevRequestHeader*)&vmmreqGuestCaps, VMMDevReq_ReportGuestCapabilities); 81 vmmreqGuestCaps.caps = VMMDEV_GUEST_SUPPORTS_SEAMLESS; 82 83 DWORD cbReturned; 84 if (!DeviceIoControl(pEnv->hDriver, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(vmmreqGuestCaps)), &vmmreqGuestCaps, sizeof(vmmreqGuestCaps), 85 &vmmreqGuestCaps, sizeof(vmmreqGuestCaps), &cbReturned, NULL)) 86 { 87 Log(("VBoxTray: VBoxSeamlessInit: VMMDevReq_ReportGuestCapabilities: error doing IOCTL, last error: %d\n", GetLastError())); 88 return VERR_INVALID_PARAMETER; 89 } 90 91 *pfStartThread = true; 92 *ppInstance = &gCtx; 93 return VINF_SUCCESS; 71 rc = VERR_NOT_SUPPORTED; 94 72 } 95 73 else 96 74 { 97 Log(("VBoxTray: VBoxSeamlessInit: LoadLibrary failed with %d\n", GetLastError())); 98 return VERR_INVALID_PARAMETER; 99 } 100 101 return VINF_SUCCESS; 75 /* Will fail if SetWinEventHook is not present (version < NT4 SP6 apparently) */ 76 gCtx.hModule = LoadLibrary(VBOXHOOK_DLL_NAME); 77 if (gCtx.hModule) 78 { 79 *(uintptr_t *)&gCtx.pfnVBoxInstallHook = (uintptr_t)GetProcAddress(gCtx.hModule, "VBoxInstallHook"); 80 *(uintptr_t *)&gCtx.pfnVBoxRemoveHook = (uintptr_t)GetProcAddress(gCtx.hModule, "VBoxRemoveHook"); 81 82 /* Inform the host that we support the seamless window mode. */ 83 rc = VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_SEAMLESS, 0); 84 if (RT_SUCCESS(rc)) 85 { 86 *pfStartThread = true; 87 *ppInstance = &gCtx; 88 } 89 else 90 Log(("VBoxTray: VBoxSeamlessInit: Failed to set seamless capability\n")); 91 } 92 else 93 { 94 rc = RTErrConvertFromWin32(GetLastError()); 95 Log(("VBoxTray: VBoxSeamlessInit: LoadLibrary of \"%s\" failed with rc=%Rrc\n", VBOXHOOK_DLL_NAME, rc)); 96 } 97 } 98 99 return rc; 102 100 } 103 101 … … 106 104 { 107 105 Log(("VBoxTray: VBoxSeamlessDestroy\n")); 108 /* inform the host that we no longer support the seamless window mode */ 109 VMMDevReqGuestCapabilities vmmreqGuestCaps = {0}; 110 vmmdevInitRequest((VMMDevRequestHeader*)&vmmreqGuestCaps, VMMDevReq_ReportGuestCapabilities); 111 vmmreqGuestCaps.caps = 0; 112 113 DWORD cbReturned; 114 if (!DeviceIoControl(pEnv->hDriver, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(vmmreqGuestCaps)), &vmmreqGuestCaps, sizeof(vmmreqGuestCaps), 115 &vmmreqGuestCaps, sizeof(vmmreqGuestCaps), &cbReturned, NULL)) 116 { 117 Log(("VBoxTray: VMMDevReq_ReportGuestCapabilities: error doing IOCTL, last error: %d\n", GetLastError())); 118 } 106 107 /* Inform the host that we no longer support the seamless window mode. */ 108 int rc = VbglR3SetGuestCaps(0, VMMDEV_GUEST_SUPPORTS_SEAMLESS); 109 if (RT_FAILURE(rc)) 110 Log(("VBoxTray: VBoxSeamlessDestroy: Failed to unset seamless capability, rc=%Rrc\n", rc)); 119 111 120 112 if (gCtx.pfnVBoxRemoveHook)
Note:
See TracChangeset
for help on using the changeset viewer.