Changeset 27805 in vbox
- Timestamp:
- Mar 29, 2010 8:12:44 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59465
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r27607 r27805 7 7 8 8 /* 9 * Copyright (C) 2006-20 08Sun Microsystems, Inc.9 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 64 64 void SystemProperties::FinalRelease() 65 65 { 66 uninit 66 uninit(); 67 67 } 68 68 … … 75 75 * @returns COM result indicator 76 76 */ 77 HRESULT SystemProperties::init 77 HRESULT SystemProperties::init(VirtualBox *aParent) 78 78 { 79 79 LogFlowThisFunc(("aParent=%p\n", aParent)); … … 102 102 /// any number of backends 103 103 104 /// @todo We currently leak memory because it's not actually clear what to105 /// free in structures returned by VDBackendInfo. Must be fixed ASAP!106 107 104 VDBACKENDINFO aVDInfo[100]; 108 105 unsigned cEntries; 109 int vrc = VDBackendInfo(RT_ELEMENTS 106 int vrc = VDBackendInfo(RT_ELEMENTS(aVDInfo), aVDInfo, &cEntries); 110 107 AssertRC(vrc); 111 108 if (RT_SUCCESS(vrc)) … … 125 122 126 123 /* Driver defaults which are OS specific */ 127 #if defined 124 #if defined(RT_OS_WINDOWS) 128 125 # ifdef VBOX_WITH_WINMM 129 126 mDefaultAudioDriver = AudioDriverType_WinMM; … … 131 128 mDefaultAudioDriver = AudioDriverType_DirectSound; 132 129 # endif /* !VBOX_WITH_WINMM */ 133 #elif defined 130 #elif defined(RT_OS_SOLARIS) 134 131 mDefaultAudioDriver = AudioDriverType_SolAudio; 135 #elif defined 136 # if defined 132 #elif defined(RT_OS_LINUX) 133 # if defined(VBOX_WITH_PULSE) 137 134 /* Check for the pulse library & that the pulse audio daemon is running. */ 138 if (RTProcIsRunningByName 139 RTLdrIsLoadable 135 if (RTProcIsRunningByName("pulseaudio") && 136 RTLdrIsLoadable("libpulse.so.0")) 140 137 mDefaultAudioDriver = AudioDriverType_Pulse; 141 138 else 142 139 # endif /* VBOX_WITH_PULSE */ 143 # if defined 140 # if defined(VBOX_WITH_ALSA) 144 141 /* Check if we can load the ALSA library */ 145 if (RTLdrIsLoadable 142 if (RTLdrIsLoadable("libasound.so.2")) 146 143 mDefaultAudioDriver = AudioDriverType_ALSA; 147 144 else 148 145 # endif /* VBOX_WITH_ALSA */ 149 146 mDefaultAudioDriver = AudioDriverType_OSS; 150 #elif defined 147 #elif defined(RT_OS_DARWIN) 151 148 mDefaultAudioDriver = AudioDriverType_CoreAudio; 152 #elif defined 149 #elif defined(RT_OS_OS2) 153 150 mDefaultAudioDriver = AudioDriverType_MMP; 154 #elif defined 151 #elif defined(RT_OS_FREEBSD) 155 152 mDefaultAudioDriver = AudioDriverType_OSS; 156 153 #else … … 187 184 STDMETHODIMP SystemProperties::COMGETTER(MinGuestRAM)(ULONG *minRAM) 188 185 { 189 if (!minRAM) 190 return E_POINTER; 186 CheckComArgOutPointerValid(minRAM); 191 187 192 188 AutoCaller autoCaller(this); … … 202 198 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestRAM)(ULONG *maxRAM) 203 199 { 204 if (!maxRAM) 205 return E_POINTER; 200 CheckComArgOutPointerValid(maxRAM); 206 201 207 202 AutoCaller autoCaller(this); … … 226 221 STDMETHODIMP SystemProperties::COMGETTER(MinGuestVRAM)(ULONG *minVRAM) 227 222 { 228 if (!minVRAM) 229 return E_POINTER; 223 CheckComArgOutPointerValid(minVRAM); 230 224 231 225 AutoCaller autoCaller(this); … … 240 234 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestVRAM)(ULONG *maxVRAM) 241 235 { 242 if (!maxVRAM) 243 return E_POINTER; 236 CheckComArgOutPointerValid(maxVRAM); 244 237 245 238 AutoCaller autoCaller(this); … … 254 247 STDMETHODIMP SystemProperties::COMGETTER(MinGuestCPUCount)(ULONG *minCPUCount) 255 248 { 256 if (!minCPUCount) 257 return E_POINTER; 249 CheckComArgOutPointerValid(minCPUCount); 258 250 259 251 AutoCaller autoCaller(this); … … 268 260 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestCPUCount)(ULONG *maxCPUCount) 269 261 { 270 if (!maxCPUCount) 271 return E_POINTER; 262 CheckComArgOutPointerValid(maxCPUCount); 272 263 273 264 AutoCaller autoCaller(this); … … 282 273 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestMonitors)(ULONG *maxMonitors) 283 274 { 284 if (!maxMonitors) 285 return E_POINTER; 275 CheckComArgOutPointerValid(maxMonitors); 286 276 287 277 AutoCaller autoCaller(this); … … 296 286 STDMETHODIMP SystemProperties::COMGETTER(MaxVDISize)(ULONG64 *maxVDISize) 297 287 { 298 if (!maxVDISize) 299 return E_POINTER; 288 CheckComArgOutPointerValid(maxVDISize); 300 289 301 290 AutoCaller autoCaller(this); … … 319 308 STDMETHODIMP SystemProperties::COMGETTER(NetworkAdapterCount)(ULONG *count) 320 309 { 321 if (!count) 322 return E_POINTER; 310 CheckComArgOutPointerValid(count); 323 311 324 312 AutoCaller autoCaller(this); … … 333 321 STDMETHODIMP SystemProperties::COMGETTER(SerialPortCount)(ULONG *count) 334 322 { 335 if (!count) 336 return E_POINTER; 323 CheckComArgOutPointerValid(count); 337 324 338 325 AutoCaller autoCaller(this); … … 347 334 STDMETHODIMP SystemProperties::COMGETTER(ParallelPortCount)(ULONG *count) 348 335 { 349 if (!count) 350 return E_POINTER; 336 CheckComArgOutPointerValid(count); 351 337 352 338 AutoCaller autoCaller(this); … … 372 358 } 373 359 374 STDMETHODIMP SystemProperties::GetMaxDevicesPerPortForStorageBus (StorageBus_T aBus, ULONG *aMaxDevicesPerPort) 360 STDMETHODIMP SystemProperties::GetMaxDevicesPerPortForStorageBus(StorageBus_T aBus, 361 ULONG *aMaxDevicesPerPort) 375 362 { 376 363 CheckComArgOutPointerValid(aMaxDevicesPerPort); … … 405 392 } 406 393 407 STDMETHODIMP SystemProperties::GetMinPortCountForStorageBus (StorageBus_T aBus, ULONG *aMinPortCount) 394 STDMETHODIMP SystemProperties::GetMinPortCountForStorageBus(StorageBus_T aBus, 395 ULONG *aMinPortCount) 408 396 { 409 397 CheckComArgOutPointerValid(aMinPortCount); … … 447 435 } 448 436 449 STDMETHODIMP SystemProperties::GetMaxPortCountForStorageBus (StorageBus_T aBus, ULONG *aMaxPortCount) 437 STDMETHODIMP SystemProperties::GetMaxPortCountForStorageBus(StorageBus_T aBus, 438 ULONG *aMaxPortCount) 450 439 { 451 440 CheckComArgOutPointerValid(aMaxPortCount); … … 489 478 } 490 479 491 STDMETHODIMP SystemProperties::GetMaxInstancesOfStorageBus(StorageBus_T aBus, ULONG *aMaxInstances) 480 STDMETHODIMP SystemProperties::GetMaxInstancesOfStorageBus(StorageBus_T aBus, 481 ULONG *aMaxInstances) 492 482 { 493 483 CheckComArgOutPointerValid(aMaxInstances); … … 517 507 518 508 STDMETHODIMP SystemProperties::GetDeviceTypesForStorageBus(StorageBus_T aBus, 519 ComSafeArrayOut(DeviceType_T, aDeviceTypes))509 ComSafeArrayOut(DeviceType_T, aDeviceTypes)) 520 510 { 521 511 CheckComArgOutSafeArrayPointerValid(aDeviceTypes); … … 558 548 } 559 549 560 STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder) 550 STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder)(BSTR *aDefaultMachineFolder) 561 551 { 562 552 CheckComArgOutPointerValid(aDefaultMachineFolder); … … 572 562 } 573 563 574 STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder) 564 STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder)(IN_BSTR aDefaultMachineFolder) 575 565 { 576 566 AutoCaller autoCaller(this); … … 580 570 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 581 571 582 HRESULT rc = setDefaultMachineFolder 572 HRESULT rc = setDefaultMachineFolder(aDefaultMachineFolder); 583 573 if (SUCCEEDED(rc)) 584 574 rc = mParent->saveSettings(); … … 587 577 } 588 578 589 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFolder) 579 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFolder)(BSTR *aDefaultHardDiskFolder) 590 580 { 591 581 CheckComArgOutPointerValid(aDefaultHardDiskFolder); … … 601 591 } 602 592 603 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder) 593 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder)(IN_BSTR aDefaultHardDiskFolder) 604 594 { 605 595 AutoCaller autoCaller(this); … … 609 599 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 610 600 611 HRESULT rc = setDefaultHardDiskFolder 601 HRESULT rc = setDefaultHardDiskFolder(aDefaultHardDiskFolder); 612 602 if (SUCCEEDED(rc)) 613 603 rc = mParent->saveSettings(); … … 616 606 } 617 607 618 STDMETHODIMP SystemProperties:: 619 COMGETTER(MediumFormats) (ComSafeArrayOut(IMediumFormat *, aMediumFormats)) 620 { 621 if (ComSafeArrayOutIsNull(aMediumFormats)) 622 return E_POINTER; 608 STDMETHODIMP SystemProperties::COMGETTER(MediumFormats)(ComSafeArrayOut(IMediumFormat *, aMediumFormats)) 609 { 610 CheckComArgOutSafeArrayPointerValid(aMediumFormats); 623 611 624 612 AutoCaller autoCaller(this); … … 627 615 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 628 616 629 SafeIfaceArray<IMediumFormat> mediumFormats 617 SafeIfaceArray<IMediumFormat> mediumFormats(mMediumFormats); 630 618 mediumFormats.detachTo(ComSafeArrayOutArg(aMediumFormats)); 631 619 … … 633 621 } 634 622 635 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat) 623 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat)(BSTR *aDefaultHardDiskFormat) 636 624 { 637 625 CheckComArgOutPointerValid(aDefaultHardDiskFormat); … … 647 635 } 648 636 649 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat) 637 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat)(IN_BSTR aDefaultHardDiskFormat) 650 638 { 651 639 AutoCaller autoCaller(this); … … 655 643 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 656 644 657 HRESULT rc = setDefaultHardDiskFormat 645 HRESULT rc = setDefaultHardDiskFormat(aDefaultHardDiskFormat); 658 646 if (SUCCEEDED(rc)) 659 647 rc = mParent->saveSettings(); … … 662 650 } 663 651 664 STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary) 652 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceWarning)(ULONG64 *aFreeSpace) 653 { 654 CheckComArgOutPointerValid(aFreeSpace); 655 656 ReturnComNotImplemented(); 657 } 658 659 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceWarning)(ULONG64 aFreeSpace) 660 { 661 ReturnComNotImplemented(); 662 } 663 664 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentWarning)(ULONG *aFreeSpacePercent) 665 { 666 CheckComArgOutPointerValid(aFreeSpacePercent); 667 668 ReturnComNotImplemented(); 669 } 670 671 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentWarning)(ULONG aFreeSpacePercent) 672 { 673 ReturnComNotImplemented(); 674 } 675 676 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceError)(ULONG64 *aFreeSpace) 677 { 678 CheckComArgOutPointerValid(aFreeSpace); 679 680 ReturnComNotImplemented(); 681 } 682 683 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceError)(ULONG64 aFreeSpace) 684 { 685 ReturnComNotImplemented(); 686 } 687 688 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentError)(ULONG *aFreeSpacePercent) 689 { 690 CheckComArgOutPointerValid(aFreeSpacePercent); 691 692 ReturnComNotImplemented(); 693 } 694 695 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentError)(ULONG aFreeSpacePercent) 696 { 697 ReturnComNotImplemented(); 698 } 699 700 STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary)(BSTR *aRemoteDisplayAuthLibrary) 665 701 { 666 702 CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary); … … 676 712 } 677 713 678 STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) 714 STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary)(IN_BSTR aRemoteDisplayAuthLibrary) 679 715 { 680 716 AutoCaller autoCaller(this); … … 684 720 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 685 721 686 HRESULT rc = setRemoteDisplayAuthLibrary 722 HRESULT rc = setRemoteDisplayAuthLibrary(aRemoteDisplayAuthLibrary); 687 723 if (SUCCEEDED(rc)) 688 724 rc = mParent->saveSettings(); … … 691 727 } 692 728 693 STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary) 729 STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary)(BSTR *aWebServiceAuthLibrary) 694 730 { 695 731 CheckComArgOutPointerValid(aWebServiceAuthLibrary); … … 705 741 } 706 742 707 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary) 743 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary)(IN_BSTR aWebServiceAuthLibrary) 708 744 { 709 745 AutoCaller autoCaller(this); … … 713 749 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 714 750 715 HRESULT rc = setWebServiceAuthLibrary 751 HRESULT rc = setWebServiceAuthLibrary(aWebServiceAuthLibrary); 716 752 if (SUCCEEDED(rc)) 717 753 rc = mParent->saveSettings(); … … 720 756 } 721 757 722 STDMETHODIMP SystemProperties::COMGETTER(LogHistoryCount) (ULONG *count) 723 { 724 if (!count) 725 return E_POINTER; 758 STDMETHODIMP SystemProperties::COMGETTER(LogHistoryCount)(ULONG *count) 759 { 760 CheckComArgOutPointerValid(count); 726 761 727 762 AutoCaller autoCaller(this); … … 735 770 } 736 771 737 STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount) 772 STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount)(ULONG count) 738 773 { 739 774 AutoCaller autoCaller(this); … … 750 785 } 751 786 752 STDMETHODIMP SystemProperties::COMGETTER(DefaultAudioDriver) (AudioDriverType_T *aAudioDriver) 753 { 754 if (!aAudioDriver) 755 return E_POINTER; 787 STDMETHODIMP SystemProperties::COMGETTER(DefaultAudioDriver)(AudioDriverType_T *aAudioDriver) 788 { 789 CheckComArgOutPointerValid(aAudioDriver); 756 790 757 791 AutoCaller autoCaller(this); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r27792 r27805 1316 1316 1317 1317 <interface 1318 name="ILocalOwner" extends="$ dispatched"1318 name="ILocalOwner" extends="$unknown" 1319 1319 uuid="308FF42A-DC45-49D4-A950-B1EEE5E00BB5" wsmap="suppress" 1320 1320 > … … 1689 1689 1690 1690 <interface 1691 name="IVirtualBox" extends="$ dispatched"1691 name="IVirtualBox" extends="$unknown" 1692 1692 uuid="3f36e024-7fed-4f20-a02c-9158a82b44e6" 1693 1693 wsmap="managed" … … 8035 8035 name="ISystemProperties" 8036 8036 extends="$unknown" 8037 uuid=" fca0d89c-d2ce-45c1-a7b9-e6e7d8501eb1"8037 uuid="07c3ffd8-8f59-49cc-b608-53a332e85cc3" 8038 8038 wsmap="managed" 8039 8039 > … … 8241 8241 </see> 8242 8242 </desc> 8243 </attribute> 8244 8245 <attribute name="freeDiskSpaceWarning" type="unsigned long long"> 8246 <desc>Issue a warning if the free disk space is below (or in some disk 8247 intensive operation is expected to go below) the given size in 8248 Megabytes.</desc> 8249 </attribute> 8250 8251 <attribute name="freeDiskSpacePercentWarning" type="unsigned long"> 8252 <desc>Issue a warning if the free disk space is below (or in some disk 8253 intensive operation is expected to go below) the given percentage.</desc> 8254 </attribute> 8255 8256 <attribute name="freeDiskSpaceError" type="unsigned long long"> 8257 <desc>Issue an error if the free disk space is below (or in some disk 8258 intensive operation is expected to go below) the given size in 8259 Megabytes.</desc> 8260 </attribute> 8261 8262 <attribute name="freeDiskSpacePercentError" type="unsigned long"> 8263 <desc>Issue an error if the free disk space is below (or in some disk 8264 intensive operation is expected to go below) the given percentage.</desc> 8243 8265 </attribute> 8244 8266 … … 13246 13268 13247 13269 <interface 13248 name="ISession" extends="$ dispatched"13270 name="ISession" extends="$unknown" 13249 13271 uuid="12F4DCDB-12B2-4EC1-B7CD-DDD9F6C5BF4D" 13250 13272 wsmap="managed" -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r27607 r27805 7 7 8 8 /* 9 * Copyright (C) 2006-20 08Sun Microsystems, Inc.9 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 86 86 STDMETHOD(COMGETTER(DefaultHardDiskFormat)) (BSTR *aDefaultHardDiskFormat); 87 87 STDMETHOD(COMSETTER(DefaultHardDiskFormat)) (IN_BSTR aDefaultHardDiskFormat); 88 STDMETHOD(COMGETTER(FreeDiskSpaceWarning))(ULONG64 *aFreeDiskSpace); 89 STDMETHOD(COMSETTER(FreeDiskSpaceWarning))(ULONG64 aFreeDiskSpace); 90 STDMETHOD(COMGETTER(FreeDiskSpacePercentWarning))(ULONG *aFreeDiskSpacePercent); 91 STDMETHOD(COMSETTER(FreeDiskSpacePercentWarning))(ULONG aFreeDiskSpacePercent); 92 STDMETHOD(COMGETTER(FreeDiskSpaceError))(ULONG64 *aFreeDiskSpace); 93 STDMETHOD(COMSETTER(FreeDiskSpaceError))(ULONG64 aFreeDiskSpace); 94 STDMETHOD(COMGETTER(FreeDiskSpacePercentError))(ULONG *aFreeDiskSpacePercent); 95 STDMETHOD(COMSETTER(FreeDiskSpacePercentError))(ULONG aFreeDiskSpacePercent); 88 96 STDMETHOD(COMGETTER(RemoteDisplayAuthLibrary)) (BSTR *aRemoteDisplayAuthLibrary); 89 97 STDMETHOD(COMSETTER(RemoteDisplayAuthLibrary)) (IN_BSTR aRemoteDisplayAuthLibrary);
Note:
See TracChangeset
for help on using the changeset viewer.