Changeset 1013 in vbox
- Timestamp:
- Feb 21, 2007 5:09:53 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18868
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/COMDefs.cpp
r967 r1013 116 116 HRESULT COMBase::initializeCOM() 117 117 { 118 LogFlow (("COMBase::initializeCOM(): BEGIN\n"));118 LogFlowFuncEnter(); 119 119 120 120 #if defined (Q_OS_WIN32) 121 121 122 // disable this damn CoInitialize* somehow made by Qt during creation of 123 // the QApplication instance (didn't explore deeply why does it do this) 122 /* disable this damn CoInitialize* somehow made by Qt during 123 * creation of the QApplication instance (didn't explore deeply 124 * why does it do this) */ 124 125 CoUninitialize(); 125 CoInitializeEx ( 126 NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE | COINIT_SPEED_OVER_MEMORY127 );128 129 LogFlow (("COMBase::initializeCOM(): END\n"));126 CoInitializeEx (NULL, COINIT_MULTITHREADED | 127 COINIT_DISABLE_OLE1DDE | 128 COINIT_SPEED_OVER_MEMORY); 129 130 LogFlowFuncLeave(); 130 131 return S_OK; 131 132 … … 134 135 if (gComponentManager) 135 136 { 136 LogFlow (("COMBase::initializeCOM(): END\n"));137 LogFlowFuncLeave(); 137 138 return S_OK; 138 139 } … … 143 144 nsCOMPtr <nsIServiceManager> serviceManager; 144 145 145 / / create a file object containing the path to the executable146 /* create a file object containing the path to the executable */ 146 147 QCString appDir; 147 148 #ifdef DEBUG … … 160 161 if (SUCCEEDED( rc )) 161 162 { 162 / / initialize XPCOM and get the service manager163 /* initialize XPCOM and get the service manager */ 163 164 rc = NS_InitXPCOM2 (getter_AddRefs (serviceManager), fAppDir, nsnull); 164 165 } … … 167 168 if (SUCCEEDED (rc)) 168 169 { 169 / / get the registrar170 /* get the registrar */ 170 171 nsCOMPtr <nsIComponentRegistrar> registrar = 171 172 do_QueryInterface (serviceManager, &rc); 172 173 if (SUCCEEDED (rc)) 173 174 { 174 / / autoregister components from a component directory175 /* autoregister components from a component directory */ 175 176 registrar->AutoRegister (nsnull); 176 177 177 / / get the component manager178 /* get the component manager */ 178 179 rc = registrar->QueryInterface (NS_GET_IID (nsIComponentManager), 179 180 (void**) &gComponentManager); 180 181 if (SUCCEEDED (rc)) 181 182 { 182 // get the main thread's event queue (afaik, the dconnect service always 183 // gets created upon XPCOM startup, so it will use the main (this) 184 // thread's event queue to receive IPC events) 183 /* get the main thread's event queue (afaik, the 184 * dconnect service always gets created upon XPCOM 185 * startup, so it will use the main (this) thread's 186 * event queue to receive IPC events) */ 185 187 rc = NS_GetMainEventQ (&gEventQ); 186 188 #ifdef DEBUG … … 193 195 # endif 194 196 195 / / get the IPC service197 /* get the IPC service */ 196 198 nsCOMPtr <ipcIService> ipcServ = 197 199 do_GetService (IPC_SERVICE_CONTRACTID, serviceManager, &rc); 198 200 if (SUCCEEDED (rc)) 199 201 { 200 / / get the VirtualBox out-of-proc server ID202 /* get the VirtualBox out-of-proc server ID */ 201 203 rc = ipcServ->ResolveClientName ("VirtualBoxServer", 202 204 &gVBoxServerID); 203 205 if (SUCCEEDED (rc)) 204 206 { 205 / / get the DConnect service207 /* get the DConnect service */ 206 208 rc = serviceManager-> 207 209 GetServiceByContractID (IPC_DCONNECTSERVICE_CONTRACTID, … … 217 219 cleanupCOM(); 218 220 219 LogFlow (("COMBase::initializeCOM(): END: rc=%08X\n", rc));221 LogFlowFuncLeave(); 220 222 return rc; 221 223 … … 228 230 HRESULT COMBase::cleanupCOM() 229 231 { 230 LogFlow (("COMBase::cleanupCOM(): BEGIN\n"));232 LogFlowFuncEnter(); 231 233 232 234 #if defined (Q_OS_WIN32) … … 241 243 if (isOnCurrentThread) 242 244 { 243 LogFlow (("COMBase::cleanupCOM(): doing cleanup...\n"));245 LogFlowFunc (("Doing cleanup...\n")); 244 246 # if !defined (__DARWIN__) && !defined (__OS2__) 245 247 if (gSocketListener) … … 247 249 # endif 248 250 if (gDConnectService) 251 { 249 252 gDConnectService->Release(); 253 gDConnectService = nsnull; 254 } 250 255 if (gEventQ) 256 { 251 257 gEventQ->Release(); 258 gEventQ = nsnull; 259 } 252 260 gComponentManager->Release(); 261 gComponentManager = nsnull; 262 /* note: gComponentManager = nsnull indicates that we're 263 * cleaned up */ 253 264 NS_ShutdownXPCOM (nsnull); 254 265 XPCOMGlueShutdown(); … … 257 268 #endif 258 269 259 LogFlow (("COMBase::cleanupCOM(): END\n"));270 LogFlowFuncLeave(); 260 271 return S_OK; 261 272 }
Note:
See TracChangeset
for help on using the changeset viewer.