Changeset 32249 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp
- Timestamp:
- Sep 6, 2010 12:57:48 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 65576
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSeamless.cpp
r28800 r32249 52 52 int VBoxSeamlessInit(const VBOXSERVICEENV *pEnv, void **ppInstance, bool *pfStartThread) 53 53 { 54 Log(("VBox SeamlessInit\n"));54 Log(("VBoxTray: VBoxSeamlessInit\n")); 55 55 56 56 *pfStartThread = false; … … 65 65 if (OSinfo.dwMajorVersion <= 4) /* Windows NT 4.0 or older */ 66 66 { 67 Log(("VBox SeamlessInit: Windows NT 4.0 or older not supported!\n"));67 Log(("VBoxTray: VBoxSeamlessInit: Windows NT 4.0 or older not supported!\n")); 68 68 return VERR_NOT_SUPPORTED; 69 69 } … … 85 85 &vmmreqGuestCaps, sizeof(vmmreqGuestCaps), &cbReturned, NULL)) 86 86 { 87 Log(("VBox SeamlessInit: VMMDevReq_ReportGuestCapabilities: error doing IOCTL, last error: %d\n", GetLastError()));87 Log(("VBoxTray: VBoxSeamlessInit: VMMDevReq_ReportGuestCapabilities: error doing IOCTL, last error: %d\n", GetLastError())); 88 88 return VERR_INVALID_PARAMETER; 89 89 } … … 95 95 else 96 96 { 97 Log(("VBox SeamlessInit: LoadLibrary failed with %d\n", GetLastError()));97 Log(("VBoxTray: VBoxSeamlessInit: LoadLibrary failed with %d\n", GetLastError())); 98 98 return VERR_INVALID_PARAMETER; 99 99 } … … 105 105 void VBoxSeamlessDestroy(const VBOXSERVICEENV *pEnv, void *pInstance) 106 106 { 107 Log(("VBox SeamlessDestroy\n"));107 Log(("VBoxTray: VBoxSeamlessDestroy\n")); 108 108 /* inform the host that we no longer support the seamless window mode */ 109 109 VMMDevReqGuestCapabilities vmmreqGuestCaps = {0}; … … 115 115 &vmmreqGuestCaps, sizeof(vmmreqGuestCaps), &cbReturned, NULL)) 116 116 { 117 Log(("V MMDevReq_ReportGuestCapabilities: error doing IOCTL, last error: %d\n", GetLastError()));117 Log(("VBoxTray: VMMDevReq_ReportGuestCapabilities: error doing IOCTL, last error: %d\n", GetLastError())); 118 118 } 119 119 … … 161 161 return TRUE; 162 162 163 Log(("VBox EnumFunc %x\n", hwnd));163 Log(("VBoxTray: VBoxEnumFunc %x\n", hwnd)); 164 164 /* Only visible windows that are present on the desktop are interesting here */ 165 165 #ifndef MMSEAMLESS … … 182 182 && dwExStyle == (WS_EX_LAYERED|WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT|WS_EX_TOPMOST)) 183 183 { 184 Log((" Filter out shadow window style=%x exstyle=%x\n", dwStyle, dwExStyle));184 Log(("VBoxTray: Filter out shadow window style=%x exstyle=%x\n", dwStyle, dwExStyle)); 185 185 return TRUE; 186 186 } … … 189 189 if (strcmp(szWindowText, "Program Manager")) 190 190 { 191 Log((" Enum hwnd=%x rect (%d,%d) (%d,%d)\n", hwnd, rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom));192 Log((" title=%s style=%x exStyle=%x\n", szWindowText, dwStyle, dwExStyle));191 Log(("VBoxTray: Enum hwnd=%x rect (%d,%d) (%d,%d)\n", hwnd, rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom)); 192 Log(("VBoxTray: title=%s style=%x exStyle=%x\n", szWindowText, dwStyle, dwExStyle)); 193 193 194 194 HRGN hrgn = CreateRectRgn(0,0,0,0); … … 198 198 if (ret == ERROR) 199 199 { 200 Log((" GetWindowRgn failed with rc=%d\n", GetLastError()));200 Log(("VBoxTray: GetWindowRgn failed with rc=%d\n", GetLastError())); 201 201 SetRectRgn(hrgn, rectVisible.left, rectVisible.top, rectVisible.right, rectVisible.bottom); 202 202 } … … 217 217 else 218 218 { 219 Log((" Enum hwnd=%x rect (%d,%d) (%d,%d) (ignored)\n", hwnd, rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom));220 Log((" title=%s style=%x\n", szWindowText, dwStyle));219 Log(("VBoxTray: Enum hwnd=%x rect (%d,%d) (%d,%d) (ignored)\n", hwnd, rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom)); 220 Log(("VBoxTray: title=%s style=%x\n", szWindowText, dwStyle)); 221 221 } 222 222 } … … 233 233 #ifndef MMSEAMLESS 234 234 GetWindowRect(GetDesktopWindow(), ¶m.rect); 235 Log(("VBox RecheckVisibleWindows desktop=%x rect (%d,%d) (%d,%d)\n", GetDesktopWindow(), param.rect.left, param.rect.top, param.rect.right, param.rect.bottom));235 Log(("VBoxTray: VBoxRecheckVisibleWindows desktop=%x rect (%d,%d) (%d,%d)\n", GetDesktopWindow(), param.rect.left, param.rect.top, param.rect.right, param.rect.bottom)); 236 236 #endif 237 237 EnumWindows(VBoxEnumFunc, (LPARAM)¶m); … … 255 255 #ifdef DEBUG 256 256 RECT *lpRect = (RECT *)&lpRgnData->Buffer[0]; 257 Log((" New visible region: \n"));257 Log(("VBoxTray: New visible region: \n")); 258 258 259 259 for (DWORD i=0;i<lpRgnData->rdh.nCount;i++) 260 260 { 261 Log((" visible rect (%d,%d)(%d,%d)\n", lpRect[i].left, lpRect[i].top, lpRect[i].right, lpRect[i].bottom));261 Log(("VBoxTray: visible rect (%d,%d)(%d,%d)\n", lpRect[i].left, lpRect[i].top, lpRect[i].right, lpRect[i].bottom)); 262 262 } 263 263 #endif … … 275 275 } 276 276 else 277 Log(("V isible rectangles haven't changed; ignore\n"));277 Log(("VBoxTray: Visible rectangles haven't changed; ignore\n")); 278 278 } 279 279 if (lpEscapeData != gCtx.lpEscapeData) … … 305 305 if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 306 306 { 307 Log(("VBox SeamlessThread: DeviceIOControl(CtlMask - or) succeeded\n"));307 Log(("VBoxTray: VBoxSeamlessThread: DeviceIOControl(CtlMask - or) succeeded\n")); 308 308 } 309 309 else 310 310 { 311 Log(("VBox SeamlessThread: DeviceIOControl(CtlMask) failed, SeamlessChangeThread exited\n"));311 Log(("VBoxTray: VBoxSeamlessThread: DeviceIOControl(CtlMask) failed, SeamlessChangeThread exited\n")); 312 312 return 0; 313 313 } … … 321 321 if (DeviceIoControl(gVBoxDriver, VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent), &waitEvent, sizeof(waitEvent), &cbReturned, NULL)) 322 322 { 323 Log(("VBox SeamlessThread: DeviceIOControl succeded\n"));323 Log(("VBoxTray: VBoxSeamlessThread: DeviceIOControl succeded\n")); 324 324 325 325 /* are we supposed to stop? */ … … 327 327 break; 328 328 329 Log(("VBox SeamlessThread: checking event\n"));329 Log(("VBoxTray: VBoxSeamlessThread: checking event\n")); 330 330 331 331 /* did we get the right event? */ 332 332 if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST) 333 333 { 334 Log(("VBoxTray: going to get seamless change information.\n"));334 Log(("VBoxTray: VBoxTray: going to get seamless change information.\n")); 335 335 336 336 /* We got at least one event. Read the requested resolution … … 349 349 if (fSeamlessChangeQueried) 350 350 { 351 Log(("VBox SeamlessThread: mode change to %d\n", seamlessChangeRequest.mode));351 Log(("VBoxTray: VBoxSeamlessThread: mode change to %d\n", seamlessChangeRequest.mode)); 352 352 353 353 switch(seamlessChangeRequest.mode) … … 356 356 if (fWasScreenSaverActive) 357 357 { 358 Log((" Re-enabling the screensaver\n"));358 Log(("VBoxTray: Re-enabling the screensaver\n")); 359 359 ret = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, 0); 360 360 if (!ret) 361 Log((" SystemParametersInfo SPI_SETSCREENSAVEACTIVE failed with %d\n", GetLastError()));361 Log(("VBoxTray: SystemParametersInfo SPI_SETSCREENSAVEACTIVE failed with %d\n", GetLastError())); 362 362 } 363 363 PostMessage(gToolWindow, WM_VBOX_REMOVE_SEAMLESS_HOOK, 0, 0); … … 367 367 ret = SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &fWasScreenSaverActive, 0); 368 368 if (!ret) 369 Log((" SystemParametersInfo SPI_GETSCREENSAVEACTIVE failed with %d\n", GetLastError()));369 Log(("VBoxTray: SystemParametersInfo SPI_GETSCREENSAVEACTIVE failed with %d\n", GetLastError())); 370 370 371 371 if (fWasScreenSaverActive) 372 Log((" Disabling the screensaver\n"));372 Log(("VBoxTray: Disabling the screensaver\n")); 373 373 374 374 ret = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0); 375 375 if (!ret) 376 Log((" SystemParametersInfo SPI_SETSCREENSAVEACTIVE failed with %d\n", GetLastError()));376 Log(("VBoxTray: SystemParametersInfo SPI_SETSCREENSAVEACTIVE failed with %d\n", GetLastError())); 377 377 PostMessage(gToolWindow, WM_VBOX_INSTALL_SEAMLESS_HOOK, 0, 0); 378 378 break; … … 389 389 else 390 390 { 391 Log(("VBox SeamlessThread: error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n"));391 Log(("VBoxTray: VBoxSeamlessThread: error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n")); 392 392 } 393 393 /* sleep a bit to not eat too much CPU while retrying */ … … 403 403 else 404 404 { 405 Log(("VBoxTray: error 0 from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n"));405 Log(("VBoxTray: VBoxTray: error 0 from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n")); 406 406 /* sleep a bit to not eat too much CPU in case the above call always fails */ 407 407 if (WaitForSingleObject(pCtx->pEnv->hStopEvent, 10) == WAIT_OBJECT_0) … … 418 418 if (DeviceIoControl (gVBoxDriver, VBOXGUEST_IOCTL_CTL_FILTER_MASK, &maskInfo, sizeof (maskInfo), NULL, 0, &cbReturned, NULL)) 419 419 { 420 Log(("VBox SeamlessThread: DeviceIOControl(CtlMask - not) succeeded\n"));420 Log(("VBoxTray: VBoxSeamlessThread: DeviceIOControl(CtlMask - not) succeeded\n")); 421 421 } 422 422 else 423 423 { 424 Log(("VBox SeamlessThread: DeviceIOControl(CtlMask) failed\n"));425 } 426 427 Log(("VBox SeamlessThread: finished seamless change request thread\n"));424 Log(("VBoxTray: VBoxSeamlessThread: DeviceIOControl(CtlMask) failed\n")); 425 } 426 427 Log(("VBoxTray: VBoxSeamlessThread: finished seamless change request thread\n")); 428 428 return 0; 429 429 }
Note:
See TracChangeset
for help on using the changeset viewer.