Changeset 12942 in vbox for trunk/src/VBox/Main/Performance.cpp
- Timestamp:
- Oct 2, 2008 2:53:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r12802 r12942 417 417 ComSafeArrayIn(IUnknown *, objects)) 418 418 { 419 /* 420 * Let's work around null/empty safe array mess. I am not sure there is 421 * a way to pass null arrays via webservice, I haven't found one. So I 422 * guess the users will be forced to use empty arrays instead. Constructing 423 * an empty SafeArray is a bit awkward, so what we do in this method is 424 * actually convert null arrays to empty arrays and pass them down to 425 * init() method. If someone knows how to do it better, please be my guest, 426 * fix it. 427 */ 428 if (ComSafeArrayInIsNull(metricNames)) 429 { 430 com::SafeArray <BSTR> nameArray; 431 if (ComSafeArrayInIsNull(objects)) 432 { 433 com::SafeIfaceArray <IUnknown> objectArray; 434 objectArray.reset(0); 435 init(ComSafeArrayAsInParam(nameArray), 436 ComSafeArrayAsInParam(objectArray)); 437 } 438 else 439 { 440 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 441 init(ComSafeArrayAsInParam(nameArray), 442 ComSafeArrayAsInParam(objectArray)); 443 } 444 } 445 else 446 { 447 com::SafeArray <INPTR BSTR> nameArray(ComSafeArrayInArg(metricNames)); 448 if (ComSafeArrayInIsNull(objects)) 449 { 450 com::SafeIfaceArray <IUnknown> objectArray; 451 objectArray.reset(0); 452 init(ComSafeArrayAsInParam(nameArray), 453 ComSafeArrayAsInParam(objectArray)); 454 } 455 else 456 { 457 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 458 init(ComSafeArrayAsInParam(nameArray), 459 ComSafeArrayAsInParam(objectArray)); 460 } 461 } 462 } 463 464 void Filter::init(ComSafeArrayIn(INPTR BSTR, metricNames), 465 ComSafeArrayIn(IUnknown *, objects)) 466 { 419 467 com::SafeArray <INPTR BSTR> nameArray(ComSafeArrayInArg(metricNames)); 420 421 if (ComSafeArrayInIsNull(objects)) 468 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 469 470 if (!objectArray.size()) 422 471 { 423 472 if (nameArray.size()) … … 431 480 else 432 481 { 433 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 434 482 435 483 for (size_t i = 0; i < objectArray.size(); ++i) 436 484 switch (nameArray.size())
Note:
See TracChangeset
for help on using the changeset viewer.