Changeset 49891 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Dec 12, 2013 8:09:20 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/VBox-4.1 merged: 85944-85947,85949-85950,85953,86701,86728,87009 /branches/andy/draganddrop (added) merged: 90781-91268
- Property svn:mergeinfo changed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/andy/draganddrop/src/VBox (added) merged: 90781-91268
- Property svn:mergeinfo changed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/Makefile.kmk
r48070 r49891 26 26 endif 27 27 VBoxTray_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST) 28 VBoxTray_DEFS = VBOX_WITH_HGCM LOG_TO_BACKDOOR 28 VBoxTray_DEFS = \ 29 VBOX_WITH_HGCM \ 30 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" 29 31 VBoxTray_INCS = ../include 30 32 VBoxTray_SOURCES = \ … … 39 41 VBoxHelpers.cpp \ 40 42 VBoxTray.rc 43 ifdef VBOX_WITH_DRAG_AND_DROP 44 VBoxTray_DEFS += \ 45 VBOX_WITH_DRAG_AND_DROP \ 46 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) 47 VBoxTray_SOURCES += \ 48 VBoxDnD.cpp \ 49 VBoxDnDDataObject.cpp \ 50 VBoxDnDEnumFormat.cpp \ 51 VBoxDnDDropSource.cpp 52 endif 41 53 ifdef VBOX_WITH_GUEST_PROPS 42 VBoxTray_DEFS += 54 VBoxTray_DEFS += _WIN32_IE=0x500 VBOX_WITH_GUEST_PROPS 43 55 VBoxTray_SOURCES += \ 44 56 VBoxHostVersion.cpp \ … … 46 58 endif 47 59 ifdef VBOX_WITH_SHARED_FOLDERS 48 VBoxTray_DEFS += 60 VBoxTray_DEFS += VBOX_WITH_SHARED_FOLDERS 49 61 VBoxTray_SOURCES += \ 50 62 VBoxSharedFolders.cpp … … 57 69 VBoxMMR.cpp 58 70 endif 59 60 71 ifdef VBOX_WITH_WDDM 61 72 VBoxTray_DEFS += VBOX_WITH_WDDM -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r44528 r49891 525 525 } 526 526 527 #ifndef DEBUG_andy 527 528 Log(("VBoxTray: vboxClipboardProcessMsg returned with rc = %ld\n", rc)); 529 #endif 528 530 return rc; 529 531 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
r48979 r49891 964 964 else 965 965 { 966 #ifndef DEBUG_andy /* Too noisy for me. */ 966 967 Log(("VBoxTray: VBoxDisplayThread: error 0 from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n")); 968 #endif 967 969 /* sleep a bit to not eat too much CPU in case the above call always fails */ 968 970 if (WaitForSingleObject(pCtx->pEnv->hStopEvent, 10) == WAIT_OBJECT_0) -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r48070 r49891 20 20 * Header Files * 21 21 *******************************************************************************/ 22 #ifdef DEBUG 23 # define LOG_ENABLED 24 # define LOG_GROUP LOG_GROUP_DEFAULT 25 #endif 26 27 #include <package-generated.h> 28 #include "product-generated.h" 29 22 30 #include "VBoxTray.h" 23 31 #include "VBoxTrayMsg.h" … … 30 38 #include "VBoxHostVersion.h" 31 39 #include "VBoxSharedFolders.h" 40 #ifdef VBOX_WITH_DRAG_AND_DROP 41 # include "VBoxDnD.h" 42 #endif 32 43 #include "VBoxIPC.h" 33 44 #include "VBoxLA.h" … … 42 53 #include <iprt/buildconfig.h> 43 54 #include <iprt/ldr.h> 55 #include <iprt/process.h> 56 #include <iprt/system.h> 57 #include <iprt/time.h> 58 #include <VBox/log.h> 44 59 45 60 /* Default desktop state tracking */ … … 133 148 DWORD gMajorVersion; 134 149 150 static PRTLOGGER g_pLoggerRelease = NULL; 151 static uint32_t g_cHistory = 10; /* Enable log rotation, 10 files. */ 152 static uint32_t g_uHistoryFileTime = RT_SEC_1DAY; /* Max 1 day per file. */ 153 static uint64_t g_uHistoryFileSize = 100 * _1M; /* Max 100MB per file. */ 135 154 136 155 /* The service table. */ … … 195 214 NULL /* pfnStop */, 196 215 VBoxMMRDestroy 216 }, 217 #endif 218 #ifdef VBOX_WITH_DRAG_AND_DROP 219 { 220 "Drag and Drop", 221 VBoxDnDInit, 222 VBoxDnDThread, 223 VBoxDnDStop, 224 VBoxDnDDestroy 197 225 }, 198 226 #endif … … 475 503 ghVBoxDriver = NULL; 476 504 } 505 } 506 507 /** 508 * Release logger callback. 509 * 510 * @return IPRT status code. 511 * @param pLoggerRelease 512 * @param enmPhase 513 * @param pfnLog 514 */ 515 static void vboxTrayLogHeaderFooter(PRTLOGGER pLoggerRelease, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog) 516 { 517 /* Some introductory information. */ 518 static RTTIMESPEC s_TimeSpec; 519 char szTmp[256]; 520 if (enmPhase == RTLOGPHASE_BEGIN) 521 RTTimeNow(&s_TimeSpec); 522 RTTimeSpecToString(&s_TimeSpec, szTmp, sizeof(szTmp)); 523 524 switch (enmPhase) 525 { 526 case RTLOGPHASE_BEGIN: 527 { 528 pfnLog(pLoggerRelease, 529 "VBoxTray %s r%s %s (%s %s) release log\n" 530 "Log opened %s\n", 531 RTBldCfgVersion(), RTBldCfgRevisionStr(), VBOX_BUILD_TARGET, 532 __DATE__, __TIME__, szTmp); 533 534 int vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp)); 535 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 536 pfnLog(pLoggerRelease, "OS Product: %s\n", szTmp); 537 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szTmp, sizeof(szTmp)); 538 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 539 pfnLog(pLoggerRelease, "OS Release: %s\n", szTmp); 540 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_VERSION, szTmp, sizeof(szTmp)); 541 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 542 pfnLog(pLoggerRelease, "OS Version: %s\n", szTmp); 543 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 544 pfnLog(pLoggerRelease, "OS Service Pack: %s\n", szTmp); 545 546 /* the package type is interesting for Linux distributions */ 547 char szExecName[RTPATH_MAX]; 548 char *pszExecName = RTProcGetExecutablePath(szExecName, sizeof(szExecName)); 549 pfnLog(pLoggerRelease, 550 "Executable: %s\n" 551 "Process ID: %u\n" 552 "Package type: %s" 553 #ifdef VBOX_OSE 554 " (OSE)" 555 #endif 556 "\n", 557 pszExecName ? pszExecName : "unknown", 558 RTProcSelf(), 559 VBOX_PACKAGE_STRING); 560 break; 561 } 562 563 case RTLOGPHASE_PREROTATE: 564 pfnLog(pLoggerRelease, "Log rotated - Log started %s\n", szTmp); 565 break; 566 567 case RTLOGPHASE_POSTROTATE: 568 pfnLog(pLoggerRelease, "Log continuation - Log started %s\n", szTmp); 569 break; 570 571 case RTLOGPHASE_END: 572 pfnLog(pLoggerRelease, "End of log file - Log started %s\n", szTmp); 573 break; 574 575 default: 576 /* nothing */; 577 } 578 } 579 580 /** 581 * Creates the default release logger outputting to the specified file. 582 * Pass NULL for disabled logging. 583 * 584 * @return IPRT status code. 585 * @param pszLogFile Filename for log output. Optional. 586 */ 587 static int vboxTrayLogCreate(const char *pszLogFile) 588 { 589 /* Create release logger (stdout + file). */ 590 static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 591 RTUINT fFlags = RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG; 592 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 593 fFlags |= RTLOGFLAGS_USECRLF; 594 #endif 595 char szError[RTPATH_MAX + 128] = ""; 596 int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags, 597 #ifdef DEBUG 598 "all.e.l.f", 599 "VBOXTRAY_LOG", 600 #else 601 "all", 602 "VBOXTRAY_RELEASE_LOG", 603 #endif 604 RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_STDOUT, 605 vboxTrayLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime, 606 szError, sizeof(szError), pszLogFile); 607 if (RT_SUCCESS(rc)) 608 { 609 #ifdef DEBUG 610 RTLogSetDefaultInstance(g_pLoggerRelease); 611 #else 612 /* Register this logger as the release logger. */ 613 RTLogRelSetDefaultInstance(g_pLoggerRelease); 614 #endif 615 /* Explicitly flush the log in case of VBOXTRAY_RELEASE_LOG=buffered. */ 616 RTLogFlush(g_pLoggerRelease); 617 } 618 else 619 MessageBox(GetDesktopWindow(), 620 szError, "VBoxTray - Logging Error", MB_OK | MB_ICONERROR); 621 622 return rc; 623 } 624 625 static void vboxTrayLogDestroy(void) 626 { 627 RTLogDestroy(RTLogRelSetDefaultInstance(NULL)); 477 628 } 478 629 … … 802 953 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 803 954 { 955 #ifndef DEBUG_andy 804 956 Log(("VBoxTray: msg %p\n", msg.message)); 957 #endif 805 958 if (msg.message == WM_QUIT) 806 959 { … … 833 986 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 834 987 { 835 /* Do not use a global namespace ("Global\\") for mutex name here, will blow up NT4 compatibility! */ 988 /* Note: Do not use a global namespace ("Global\\") for mutex name here, 989 * will blow up NT4 compatibility! */ 836 990 HANDLE hMutexAppRunning = CreateMutex(NULL, FALSE, "VBoxTray"); 837 991 if ( hMutexAppRunning != NULL 838 992 && GetLastError() == ERROR_ALREADY_EXISTS) 839 993 { 840 /* Close the mutex for this application instance. */994 /* VBoxTray already running? Bail out. */ 841 995 CloseHandle (hMutexAppRunning); 842 996 hMutexAppRunning = NULL; … … 847 1001 848 1002 int rc = RTR3InitExeNoArguments(0); 1003 if (RT_SUCCESS(rc)) 1004 rc = vboxTrayLogCreate(NULL /* pszLogFile */); 1005 849 1006 if (RT_SUCCESS(rc)) 850 1007 { … … 931 1088 932 1089 VbglR3Term(); 1090 1091 vboxTrayLogDestroy(); 1092 933 1093 return RT_SUCCESS(rc) ? 0 : 1; 934 1094 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxVRDP.cpp
r46593 r49891 409 409 else 410 410 { 411 #ifndef DEBUG_andy /* Too noisy for me. */ 411 412 Log(("VBoxTray: VBoxVRDPThread: Error from DeviceIoControl VBOXGUEST_IOCTL_VMMREQUEST\n")); 412 413 #endif 413 414 /* sleep a bit to not eat too much CPU in case the above call always fails */ 414 415 if (WaitForSingleObject(pCtx->pEnv->hStopEvent, 10) == WAIT_OBJECT_0) … … 422 423 else 423 424 { 425 #ifndef DEBUG_andy 424 426 Log(("VBoxTray: VBoxVRDPThread: Error from DeviceIoControl VBOXGUEST_IOCTL_WAITEVENT\n")); 425 427 #endif 426 428 /* sleep a bit to not eat too much CPU in case the above call always fails */ 427 429 if (WaitForSingleObject(pCtx->pEnv->hStopEvent, 10) == WAIT_OBJECT_0)
Note:
See TracChangeset
for help on using the changeset viewer.