Changeset 19242 in vbox for trunk/src/VBox/Main/testcase
- Timestamp:
- Apr 28, 2009 2:10:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp
r17970 r19242 143 143 } 144 144 145 ns ID *iid = nsnull;146 machine->GetId( &iid);147 const char *uuidString = nsIDToString(iid);145 nsXPIDLString iid; 146 machine->GetId(getter_Copies(iid)); 147 const char *uuidString = ToNewCString(iid); 148 148 printf("\tUUID: %s\n", uuidString); 149 149 free((void*)uuidString); 150 nsMemory::Free(iid);151 150 152 151 if (isAccessible) … … 194 193 * in the configuration until we explicitely choose to do so. 195 194 */ 196 nsID VMuuid = {0};197 195 nsCOMPtr <IMachine> machine; 198 196 rc = virtualBox->CreateMachine(NS_LITERAL_STRING("A brand new name").get(), 199 nsnull, nsnull, VMuuid, getter_AddRefs(machine));197 nsnull, nsnull, nsnull, getter_AddRefs(machine)); 200 198 if (NS_FAILED(rc)) 201 199 { … … 272 270 } 273 271 274 nsID *machineUUID = nsnull; 275 machine->GetId(&machineUUID); 276 rc = virtualBox->OpenSession(session, *machineUUID); 277 nsMemory::Free(machineUUID); 272 nsXPIDLString machineUUID; 273 machine->GetId(getter_Copies(machineUUID)); 274 rc = virtualBox->OpenSession(session, machineUUID); 278 275 if (NS_FAILED(rc)) 279 276 { … … 329 326 */ 330 327 rc = progress->WaitForCompletion(-1); 331 nsresultresultCode;328 PRInt32 resultCode; 332 329 progress->GetResultCode(&resultCode); 333 330 if (NS_FAILED(rc) || NS_FAILED(resultCode)) … … 343 340 * when we've created the image. 344 341 */ 345 ns ID *vdiUUID = nsnull;346 hardDisk->GetId( &vdiUUID);347 rc = machine->AttachHardDisk( *vdiUUID,342 nsXPIDLString vdiUUID; 343 hardDisk->GetId(getter_Copies(vdiUUID)); 344 rc = machine->AttachHardDisk(vdiUUID, 348 345 NS_LITERAL_STRING("IDE").get(), // controler identifier 349 346 0, // channel number on the controller 350 347 0); // device number on the controller 351 nsMemory::Free(vdiUUID);352 348 if (NS_FAILED(rc)) 353 349 { … … 364 360 * as the boot device. 365 361 */ 366 nsID uuid = {0};367 362 nsCOMPtr<IDVDImage> dvdImage; 368 363 369 364 rc = virtualBox->OpenDVDImage(NS_LITERAL_STRING("/home/achimha/isoimages/winnt4ger.iso").get(), 370 uuid, /* NULL UUID, i.e. a new one will be created */365 nsnull, /* NULL UUID, i.e. a new one will be created */ 371 366 getter_AddRefs(dvdImage)); 372 367 if (NS_FAILED(rc)) … … 379 374 * Now assign it to our VM 380 375 */ 381 ns ID *isoUUID = nsnull;382 dvdImage->GetId( &isoUUID);376 nsXPIDLString isoUUID; 377 dvdImage->GetId(getter_Copies(isoUUID)); 383 378 nsCOMPtr<IDVDDrive> dvdDrive; 384 379 machine->GetDVDDrive(getter_AddRefs(dvdDrive)); 385 rc = dvdDrive->MountImage(*isoUUID); 386 nsMemory::Free(isoUUID); 380 rc = dvdDrive->MountImage(isoUUID); 387 381 if (NS_FAILED(rc)) 388 382 {
Note:
See TracChangeset
for help on using the changeset viewer.