Changeset 60063 in vbox for trunk/src/VBox/Main/testcase
- Timestamp:
- Mar 16, 2016 3:00:06 PM (9 years ago)
- Location:
- trunk/src/VBox/Main/testcase
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstAPI.cpp
r55969 r60063 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 223 223 //////////////////////////////////////////////////////////////////////////// 224 224 225 ComPtr<IVirtualBoxClient> virtualBoxClient; 225 226 ComPtr<IVirtualBox> virtualBox; 226 227 ComPtr<ISession> session; … … 242 243 243 244 RTPrintf("Creating VirtualBox object...\n"); 244 rc = virtualBox.createLocalObject(CLSID_VirtualBox); 245 rc = virtualBoxClient.createInprocObject(CLSID_VirtualBoxClient); 246 if (SUCCEEDED(rc)) 247 rc = virtualBoxClient->COMGETTER(VirtualBox)(virtualBox.asOutParam()); 245 248 if (FAILED(rc)) 246 249 RTPrintf("ERROR: failed to create the VirtualBox object!\n"); … … 303 306 304 307 RTPrintf("Creating one more VirtualBox object...\n"); 305 CHECK_RC(virtualBox 2.createLocalObject(CLSID_VirtualBox));308 CHECK_RC(virtualBoxClient->COMGETTER(virtualBox2.asOutParam())); 306 309 if (FAILED(rc)) 307 310 { -
trunk/src/VBox/Main/testcase/tstMediumLock.cpp
r55969 r60063 5 5 6 6 /* 7 * Copyright (C) 2013-201 5Oracle Corporation7 * Copyright (C) 2013-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 73 73 74 74 bool fComInit = false; 75 ComPtr<IVirtualBoxClient> pVirtualBoxClient; 75 76 ComPtr<IVirtualBox> pVirtualBox; 76 77 char szPathTemp[RTPATH_MAX] = ""; … … 99 100 100 101 RTTestSub(hTest, "Getting VirtualBox reference"); 101 TEST_COM_SUCCESS(hTest, pVirtualBox.createLocalObject(CLSID_VirtualBox), "vbox reference"); 102 TEST_COM_SUCCESS(hTest, pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient), "vboxclient reference"); 103 TEST_COM_SUCCESS(hTest, pVirtualBoxClient->COMGETTER(VirtualBox)(pVirtualBox.asOutParam()), "vbox reference"); 102 104 } 103 105 … … 279 281 280 282 pVirtualBox.setNull(); 283 pVirtualBoxClient.setNull(); 281 284 282 285 /* Make sure that there are no object references alive here, XPCOM does -
trunk/src/VBox/Main/testcase/tstOVF.cpp
r50351 r60063 6 6 7 7 /* 8 * Copyright (C) 2010-201 4Oracle Corporation8 * Copyright (C) 2010-2016 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 296 296 std::list<Guid> llMachinesCreated; 297 297 298 ComPtr<IVirtualBoxClient> pVirtualBoxClient; 298 299 ComPtr<IVirtualBox> pVirtualBox; 299 300 … … 307 308 308 309 RTPrintf("Creating VirtualBox object...\n"); 309 rc = pVirtualBox.createLocalObject(CLSID_VirtualBox); 310 rc = pVirtualBoxClient.createInprocObject(CLSID_VirtualBoxClient); 311 if (SUCCEEDED(rc)) 312 rc = pVirtualBoxClient->COMGETTER(VirtualBox)(pVirtualBox.asOutParam()); 310 313 if (FAILED(rc)) throw MyError(rc, "failed to create the VirtualBox object!\n"); 311 314 -
trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp
r57358 r60063 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 369 369 if (SUCCEEDED(hrc)) 370 370 { 371 ComPtr<IVirtualBoxClient> ptrVBoxClient; 371 372 ComPtr<IVirtualBox> ptrVBox; 372 hrc = TST_COM_EXPR(ptrVBox.createLocalObject(CLSID_VirtualBox)); 373 hrc = TST_COM_EXPR(ptrVBoxClient.createInprocObject(CLSID_VirtualBoxClient)); 374 if (SUCCEEDED(hrc)) 375 hrc = TST_COM_EXPR(ptrVBoxClient->COMGETTER(VirtualBox)(ptrVBox.asOutParam())); 373 376 if (SUCCEEDED(hrc)) 374 377 { -
trunk/src/VBox/Main/testcase/tstVBoxAPIPerf.cpp
r57358 r60063 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 211 211 if (SUCCEEDED(hrc)) 212 212 { 213 ComPtr<IVirtualBoxClient> ptrVBoxClient; 213 214 ComPtr<IVirtualBox> ptrVBox; 214 hrc = TST_COM_EXPR(ptrVBox.createLocalObject(CLSID_VirtualBox)); 215 hrc = TST_COM_EXPR(ptrVBoxClient.createInprocObject(CLSID_VirtualBoxClient)); 216 if (SUCCEEDED(hrc)) 217 hrc = TST_COM_EXPR(ptrVBoxClient->COMGETTER(VirtualBox)(ptrVBox.asOutParam())); 215 218 if (SUCCEEDED(hrc)) 216 219 { -
trunk/src/VBox/Main/testcase/tstVBoxAPIWin.cpp
r50339 r60063 13 13 14 14 /* 15 * Copyright (C) 2006-201 4Oracle Corporation15 * Copyright (C) 2006-2016 Oracle Corporation 16 16 * 17 17 * This file is part of VirtualBox Open Source Edition (OSE), as … … 199 199 rc = CoCreateInstance(CLSID_Session, /* the VirtualBox base object */ 200 200 NULL, /* no aggregation */ 201 CLSCTX_INPROC_SERVER, /* the object lives in a server process on this machine*/201 CLSCTX_INPROC_SERVER, /* the object lives in the current process */ 202 202 IID_ISession, /* IID of the interface */ 203 203 (void**)&session); … … 259 259 { 260 260 HRESULT rc; 261 IVirtualBoxClient *virtualBoxClient; 261 262 IVirtualBox *virtualBox; 262 263 … … 267 268 268 269 /* Instantiate the VirtualBox root object. */ 269 rc = CoCreateInstance(CLSID_VirtualBox , /* the VirtualBox baseobject */270 rc = CoCreateInstance(CLSID_VirtualBoxClient, /* the VirtualBoxClient object */ 270 271 NULL, /* no aggregation */ 271 CLSCTX_LOCAL_SERVER, /* the object lives in a server process on this machine */ 272 IID_IVirtualBox, /* IID of the interface */ 273 (void**)&virtualBox); 272 CLSCTX_INPROC_SERVER, /* the object lives in the current process */ 273 IID_IVirtualBoxClient, /* IID of the interface */ 274 (void**)&virtualBoxClient); 275 if (SUCCEEDED(rc)) 276 virtualBoxClient->get_VirtualBox(&virtualBox); 274 277 275 278 if (!SUCCEEDED(rc)) … … 288 291 /* Release the VirtualBox object. */ 289 292 virtualBox->Release(); 293 virtualBoxClient->Release(); 290 294 291 295 } while (0);
Note:
See TracChangeset
for help on using the changeset viewer.