Changeset 88821 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 3, 2021 10:45:45 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144155
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/svcmain.cpp
r88783 r88821 57 57 { 58 58 public: 59 LONG Lock();60 59 LONG Unlock(); 61 60 DWORD dwThreadID; … … 105 104 } 106 105 107 108 LONG CExeModule::Lock()109 {110 LONG cLocks = ATL::CComModule::Lock();111 LogRel(("CExeModule::Lock: cLocks = %d\n", (int)cLocks));112 return cLocks;113 }114 115 116 106 LONG CExeModule::Unlock() 117 107 { 118 108 LONG cLocks = ATL::CComModule::Unlock(); 119 LogRel(("CExeModule::Unlock: cLocks = %d\n", (int)cLocks));120 109 if (isIdleLockCount(cLocks)) 121 110 { … … 128 117 bool CExeModule::HasActiveConnection() 129 118 { 130 const LONG cLocks = GetLockCount(); 131 LogRel(("%s: bActivity = %s; cLocks = %d\n", 132 __FUNCTION__, 133 bActivity ? "TRUE" : "false", 134 (int)cLocks)); 135 return bActivity || !isIdleLockCount(cLocks); 119 return bActivity || !isIdleLockCount(GetLockCount()); 136 120 } 137 121 … … 155 139 while (1) 156 140 { 141 WaitForSingleObject(hEventShutdown, INFINITE); 157 142 DWORD dwWait; 158 dwWait = WaitForSingleObject(hEventShutdown, INFINITE);159 LogRel(("%s: dwWait INFINITE = 0x%x\n", __FUNCTION__, dwWait));160 143 do 161 144 { 162 145 bActivity = false; 163 146 dwWait = WaitForSingleObject(hEventShutdown, dwTimeOut); 164 LogRel(("%s: dwWait %d = 0x%x\n", __FUNCTION__, dwTimeOut, dwWait));165 147 } while (dwWait == WAIT_OBJECT_0); 166 148 /* timed out */ 167 // LogRel(("%s: dwWait = %x\n", __FUNCTION__, dwWait));168 149 if (!HasActiveConnection()) /* if no activity let's really bail */ 169 150 { … … 190 171 #if _WIN32_WINNT >= 0x0400 191 172 CoSuspendClassObjects(); 192 LogRel(("%s (end of loop)\n", __FUNCTION__));193 173 if (!HasActiveConnection()) 194 174 #endif … … 344 324 rcRpc, CallAttribs.ClientPID, CallAttribs.IsClientLocal, CallAttribs.ProtocolSequence, CallAttribs.CallStatus, 345 325 CallAttribs.CallType, CallAttribs.OpNum, &CallAttribs.InterfaceUuid)); 346 # else // XXX: uwe347 LogRel(("VirtualBoxClassFactory::i_registerWithSds\n"));348 326 # endif 349 327 … … 376 354 void VirtualBoxClassFactory::i_deregisterWithSds(void) 377 355 { 378 Log Rel(("VirtualBoxClassFactory::i_deregisterWithSds\n"));356 Log(("VirtualBoxClassFactory::i_deregisterWithSds\n")); 379 357 380 358 if (m_ptrVirtualBoxSDS.isNotNull()) … … 413 391 pObj->AddRef(); 414 392 *ppResult = pObj; 415 Log Rel(("VirtualBoxClassFactory::GetVirtualBox: S_OK - %p\n", pObj));393 Log(("VirtualBoxClassFactory::GetVirtualBox: S_OK - %p\n", pObj)); 416 394 return S_OK; 417 395 } 418 396 *ppResult = NULL; 419 Log Rel(("VirtualBoxClassFactory::GetVirtualBox: E_FAIL\n"));397 Log(("VirtualBoxClassFactory::GetVirtualBox: E_FAIL\n")); 420 398 return E_FAIL; 421 399 } … … 453 431 { 454 432 AssertMsg(ATL::_pAtlModule, ("ATL: referring to ATL module without having one declared in this linking namespace\n")); 455 LogRel(("VirtualBoxObjectCached::AddRef: cRefs = 2, LOCKING the module\n"));456 433 ATL::_pAtlModule->Lock(); 457 }458 else459 {460 LogRel(("VirtualBoxObjectCached::AddRef: cRefs = %u\n", (unsigned)cRefs));461 434 } 462 435 return cRefs; … … 467 440 ULONG cRefs = InternalRelease(); 468 441 if (cRefs == 0) 469 {470 LogRel(("VirtualBoxObjectCached::Release: cRefs = 0: deleting...\n"));471 442 delete this; 472 }473 443 else if (cRefs == 1) 474 444 { 475 445 AssertMsg(ATL::_pAtlModule, ("ATL: referring to ATL module without having one declared in this linking namespace\n")); 476 LogRel(("VirtualBoxObjectCached::Release: cRefs = 1: unlocking the module\n"));477 446 ATL::_pAtlModule->Unlock(); 478 }479 else480 {481 LogRel(("VirtualBoxObjectCached::Release: cRefs = %u\n", (unsigned)cRefs));482 447 } 483 448 return cRefs; … … 515 480 *ppObj = p; 516 481 } 517 LogRel(("VirtualBoxObjectCached::CreateInstance: %Rhrc\n", hrc));518 482 return hrc; 519 483 } … … 562 526 * terminate the module in case when CreateInstance() fails) 563 527 */ 564 LogRel(("VirtualBoxClassFactory::CreateInstance: LOCKING the module\n"));565 528 ATL::_pAtlModule->Lock(); 566 529 __try … … 575 538 else if (SUCCEEDED(hrc)) 576 539 { 577 LogRel(("VirtualBoxClassFactory::CreateInstance: LOCKING the module\n"));578 540 ATL::_pAtlModule->Lock(); 579 541 VirtualBoxObjectCached *p; … … 596 558 __finally 597 559 { 598 LogRel(("VirtualBoxClassFactory::CreateInstance: finally unlocking the module\n"));599 560 ATL::_pAtlModule->Unlock(); 600 561 } … … 669 630 case WM_QUERYENDSESSION: 670 631 { 671 LogRel(("WM_QUERYENDSESSION\n"));672 632 if (g_pModule) 673 633 { … … 679 639 /* decrease a latency of MonitorShutdown loop */ 680 640 ASMAtomicXchgU32(&dwTimeOut, 100); 681 Log Rel(("VBoxSVCWinMain: WM_QUERYENDSESSION: VBoxSvc has active connections. bActivity = %d. Loc count = %d\n",641 Log(("VBoxSVCWinMain: WM_QUERYENDSESSION: VBoxSvc has active connections. bActivity = %d. Loc count = %d\n", 682 642 g_pModule->bActivity, g_pModule->GetLockCount())); 683 643 } … … 690 650 case WM_ENDSESSION: 691 651 { 692 LogRel(("WM_ENDSESSION(%s)\n", wParam == FALSE ? "false" : "true"));693 652 /* Restore timeout of Monitor Shutdown if user canceled system shutdown */ 694 653 if (wParam == FALSE) 695 654 { 696 655 ASMAtomicXchgU32(&dwTimeOut, dwNormalTimeout); 697 Log Rel(("VBoxSVCWinMain: user canceled system shutdown.\n"));656 Log(("VBoxSVCWinMain: user canceled system shutdown.\n")); 698 657 } 699 658 break; … … 735 694 if (atomWindowClass == 0) 736 695 { 737 Log Rel(("Failed to register main window class\n"));696 Log(("Failed to register main window class\n")); 738 697 rc = VERR_NOT_SUPPORTED; 739 698 } … … 747 706 if (g_hMainWindow == NULL) 748 707 { 749 Log Rel(("Failed to create main window\n"));708 Log(("Failed to create main window\n")); 750 709 rc = VERR_NOT_SUPPORTED; 751 710 } … … 764 723 { 765 724 Assert(g_hMainWindow != NULL); 766 Log Rel(("SVCMain: DestroyMainWindow \n"));725 Log(("SVCMain: DestroyMainWindow \n")); 767 726 if (g_hMainWindow != NULL) 768 727 { … … 1014 973 if (pszPipeName) 1015 974 { 1016 Log Rel(("SVCMAIN: Processing Helper request (cmdline=\"%s\")...\n", pszPipeName));975 Log(("SVCMAIN: Processing Helper request (cmdline=\"%s\")...\n", pszPipeName)); 1017 976 1018 977 if (!*pszPipeName) … … 1029 988 if (RT_FAILURE(vrc)) 1030 989 { 1031 Log Rel(("SVCMAIN: Failed to process Helper request (%Rrc).\n", vrc));990 Log(("SVCMAIN: Failed to process Helper request (%Rrc).\n", vrc)); 1032 991 nRet = 1; 1033 992 } … … 1047 1006 1048 1007 if (RT_SUCCESS(CreateMainWindow())) 1049 Log Rel(("SVCMain: Main window succesfully created\n"));1008 Log(("SVCMain: Main window succesfully created\n")); 1050 1009 else 1051 Log Rel(("SVCMain: Failed to create main window\n"));1010 Log(("SVCMain: Failed to create main window\n")); 1052 1011 1053 1012 MSG msg; … … 1074 1033 g_pModule = NULL; 1075 1034 1076 Log Rel(("SVCMAIN: Returning, COM server process ends.\n"));1035 Log(("SVCMAIN: Returning, COM server process ends.\n")); 1077 1036 return nRet; 1078 1037 }
Note:
See TracChangeset
for help on using the changeset viewer.