Changeset 2463 in vbox for trunk/src/VBox
- Timestamp:
- May 3, 2007 1:53:29 PM (18 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r2271 r2463 264 264 265 265 STDMETHOD(OnExtraDataCanChange)(INPTR GUIDPARAM machineId, INPTR BSTR key, INPTR BSTR value, 266 B OOL *changeAllowed)266 BSTR *error, BOOL *changeAllowed) 267 267 { 268 268 /* we never disagree */ 269 269 if (!changeAllowed) 270 270 return E_INVALIDARG; 271 *changeAllowed = true;271 *changeAllowed = TRUE; 272 272 return S_OK; 273 273 } … … 500 500 fPaused ? "The VM was paused. Continue with HostKey + P after you solved the problem.\n" : ""); 501 501 return S_OK; 502 } 503 504 STDMETHOD(OnCanShowWindow)(BOOL *canShow) 505 { 506 if (!canShow) 507 return E_POINTER; 508 /* @todo return TRUE if gConsole is not NULL */ 509 *canShow = FALSE; 510 return S_OK; 511 } 512 513 STDMETHOD(OnShowWindow)() 514 { 515 /* @todo implement */ 516 return E_NOTIMPL; 502 517 } 503 518 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r2378 r2463 367 367 QString::fromUcs2 (message))); 368 368 return S_OK; 369 } 370 371 STDMETHOD(OnCanShowWindow)(BOOL *canShow) 372 { 373 if (!canShow) 374 return E_POINTER; 375 /* @todo return TRUE... */ 376 *canShow = FALSE; 377 return S_OK; 378 } 379 380 STDMETHOD(OnShowWindow)() 381 { 382 /* @todo implement */ 383 return E_NOTIMPL; 369 384 } 370 385 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r2392 r2463 174 174 STDMETHOD(OnExtraDataCanChange)(IN_GUIDPARAM id, 175 175 IN_BSTRPARAM key, IN_BSTRPARAM value, 176 B OOL *allowChange)177 { 178 if (! allowChange)176 BSTR *error, BOOL *allowChange) 177 { 178 if (!error || !allowChange) 179 179 return E_INVALIDARG; 180 180 181 181 if (COMBase::toQUuid (id).isNull()) 182 182 { 183 / / it's a global extra data key someone wants to change183 /* it's a global extra data key someone wants to change */ 184 184 QString sKey = QString::fromUcs2 (key); 185 185 QString sVal = QString::fromUcs2 (value); 186 186 if (sKey.startsWith ("GUI/")) 187 187 { 188 / / try to set the global setting to check its syntax188 /* try to set the global setting to check its syntax */ 189 189 VBoxGlobalSettings gs (false /* non-null */); 190 190 if (gs.setPublicProperty (sKey, sVal)) 191 191 { 192 /// @todo (dmik) 193 // report the error message to the server using 194 // IVurtualBoxError 195 *allowChange = !!gs; // allow only when no error 192 /* this is a known GUI property key */ 193 if (!gs) 194 { 195 /* disallow the change when there is an error*/ 196 *error = SysAllocString ((const OLECHAR *) 197 gs.lastError().ucs2()); 198 *allowChange = FALSE; 199 } 200 else 201 *allowChange = TRUE; 196 202 return S_OK; 197 203 } … … 199 205 } 200 206 201 / / not interested in this key -- never disagree207 /* not interested in this key -- never disagree */ 202 208 *allowChange = TRUE; 203 209 return S_OK; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.cpp
r2354 r2463 197 197 198 198 /** 199 * Sets a value of theproperty with the given public name.200 * Returns false if suchproperty is not found, and true otherwise.199 * Sets a value of a property with the given public name. 200 * Returns false if the specified property is not found, and true otherwise. 201 201 * 202 202 * This method (as opposed to #setProperty (const char *name, const QVariant& value)) … … 204 204 * 205 205 * If an error occures while setting the value of the property, #operator !() 206 * will return false after this method returns , and #lastError() will contain206 * will return false after this method returns true, and #lastError() will contain 207 207 * the error message. 208 208 * -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui.h
r2420 r2463 656 656 */ 657 657 CHost host = vboxGlobal().virtualBox().GetHost(); 658 CHostUSBDeviceFilter removedFilter;659 658 if (mUSBFilterListModified) 660 for (ulong c ount = host.GetUSBDeviceFilters().GetCount(); count; -- count)661 host.RemoveUSBDeviceFilter (0 , removedFilter);659 for (ulong cnt = host.GetUSBDeviceFilters().GetCount(); cnt; -- cnt) 660 host.RemoveUSBDeviceFilter (0); 662 661 663 662 /* then add all new filters */ … … 877 876 } 878 877 879 /* creat ingnew usb filter */880 CHost USBDeviceFilter hostFilter;881 vboxGlobal().virtualBox().GetHost().CreateUSBDeviceFilter (882 usbFilterName.arg (maxFilterIndex + 1), hostFilter);878 /* create a new usb filter */ 879 CHost host = vboxGlobal().virtualBox().GetHost(); 880 CHostUSBDeviceFilter hostFilter = host 881 .CreateUSBDeviceFilter (usbFilterName.arg (maxFilterIndex + 1)); 883 882 hostFilter.SetAction (CEnums::USBDeviceFilterHold); 884 883 … … 904 903 905 904 CHost host = vboxGlobal().virtualBox().GetHost(); 906 CHostUSBDeviceFilter hostFilter ;907 host.CreateUSBDeviceFilter (vboxGlobal().details (usb), hostFilter);905 CHostUSBDeviceFilter hostFilter = host 906 .CreateUSBDeviceFilter (vboxGlobal().details (usb)); 908 907 hostFilter.SetAction (CEnums::USBDeviceFilterHold); 909 908 -
trunk/src/VBox/Main/ConsoleImpl.cpp
r2453 r2463 3502 3502 while (it != mCallbacks.end()) 3503 3503 (*it++)->OnRuntimeError (aFatal, aErrorID, aMessage); 3504 } 3505 3506 /** 3507 * @note Locks this object for reading. 3508 */ 3509 HRESULT Console::onShowWindow (BOOL aCheck, BOOL *aCanShow) 3510 { 3511 AssertReturn (aCanShow, E_POINTER); 3512 3513 *aCanShow = FALSE; 3514 3515 AutoCaller autoCaller (this); 3516 AssertComRCReturnRC (autoCaller.rc()); 3517 3518 AutoReaderLock alock (this); 3519 3520 HRESULT rc = S_OK; 3521 CallbackList::iterator it = mCallbacks.begin(); 3522 3523 if (aCheck) 3524 { 3525 while (it != mCallbacks.end()) 3526 { 3527 BOOL canShow = FALSE; 3528 rc = (*it++)->OnCanShowWindow (&canShow); 3529 AssertComRC (rc); 3530 if (FAILED (rc) || !canShow) 3531 return rc; 3532 } 3533 *aCanShow = TRUE; 3534 } 3535 else 3536 { 3537 while (it != mCallbacks.end()) 3538 { 3539 rc = (*it++)->OnShowWindow(); 3540 if (FAILED (rc)) 3541 return rc; 3542 } 3543 } 3544 3545 return S_OK; 3504 3546 } 3505 3547 -
trunk/src/VBox/Main/MachineImpl.cpp
r2408 r2463 1791 1791 } 1792 1792 1793 /** 1794 * Returns the extra data key name following the given key. If the key 1795 * is not found, an error is returned. If NULL is supplied, the first 1796 * key will be returned. If key is the last item, NULL will be returned. 1797 * 1798 * @returns COM status code 1799 * @param key extra data key name 1800 * @param nextKey name of the key following "key". NULL if "key" is the last. 1801 * @param nextValue value of the key following "key". Optional parameter. 1802 */ 1803 STDMETHODIMP Machine::GetNextExtraDataKey(INPTR BSTR key, BSTR *nextKey, BSTR *nextValue) 1804 { 1805 if (!nextKey) 1793 STDMETHODIMP Machine::GetNextExtraDataKey (INPTR BSTR aKey, BSTR *aNextKey, BSTR *aNextValue) 1794 { 1795 if (!aNextKey) 1806 1796 return E_POINTER; 1807 1797 … … 1812 1802 1813 1803 /* start with nothing found */ 1814 * nextKey = NULL;1804 *aNextKey = NULL; 1815 1805 1816 1806 /* … … 1848 1838 1849 1839 /* if we're supposed to return the first one */ 1850 if ( key == NULL)1840 if (aKey == NULL) 1851 1841 { 1852 name.cloneTo( nextKey);1853 if ( nextValue)1854 CFGLDRQueryBSTR(extraDataItemNode, "value", nextValue);1842 name.cloneTo(aNextKey); 1843 if (aNextValue) 1844 CFGLDRQueryBSTR(extraDataItemNode, "value", aNextValue); 1855 1845 found = true; 1856 1846 } 1857 1847 /* did we find the key we're looking for? */ 1858 else if (name == key)1848 else if (name == aKey) 1859 1849 { 1860 1850 found = true; … … 1864 1854 CFGLDRGetChildNode(extraDataNode, "ExtraDataItem", i + 1, &extraDataItemNode); 1865 1855 CFGLDRQueryBSTR(extraDataItemNode, "name", name.asOutParam()); 1866 name.cloneTo( nextKey);1867 if ( nextValue)1868 CFGLDRQueryBSTR(extraDataItemNode, "value", nextValue);1856 name.cloneTo(aNextKey); 1857 if (aNextValue) 1858 CFGLDRQueryBSTR(extraDataItemNode, "value", aNextValue); 1869 1859 found = true; 1870 1860 } … … 1872 1862 { 1873 1863 /* it's the last one */ 1874 * nextKey = NULL;1864 *aNextKey = NULL; 1875 1865 } 1876 1866 } … … 1891 1881 } 1892 1882 1893 /** 1894 * Returns associated extra data from the configuration. If the key does 1895 * not exist, NULL will be stored in the output pointer. 1896 * 1897 * @returns COM status code 1898 * @param key extra data key 1899 * @param value address of result pointer 1900 */ 1901 STDMETHODIMP Machine::GetExtraData(INPTR BSTR key, BSTR *value) 1902 { 1903 if (!key) 1883 STDMETHODIMP Machine::GetExtraData (INPTR BSTR aKey, BSTR *aValue) 1884 { 1885 if (!aKey) 1904 1886 return E_INVALIDARG; 1905 if (! value)1887 if (!aValue) 1906 1888 return E_POINTER; 1907 1889 … … 1912 1894 1913 1895 /* start with nothing found */ 1914 * value = NULL;1896 *aValue = NULL; 1915 1897 1916 1898 /* … … 1946 1928 CFGLDRGetChildNode(extraDataNode, "ExtraDataItem", i, &extraDataItemNode); 1947 1929 CFGLDRQueryBSTR(extraDataItemNode, "name", name.asOutParam()); 1948 if (name == key)1930 if (name == aKey) 1949 1931 { 1950 1932 found = true; 1951 CFGLDRQueryBSTR(extraDataItemNode, "value", value);1933 CFGLDRQueryBSTR(extraDataItemNode, "value", aValue); 1952 1934 } 1953 1935 CFGLDRReleaseNode(extraDataItemNode); … … 1964 1946 1965 1947 /** 1966 * Stores associated extra data in the configuration. If the data value is NULL1967 * then the corresponding extra data item is deleted. This method can be called1968 * outside a session and therefore belongs to the non protected machine data.1969 *1970 * @param key extra data key1971 * @param value extra data value1972 *1973 1948 * @note Locks mParent for reading + this object for writing. 1974 1949 */ 1975 STDMETHODIMP Machine::SetExtraData (INPTR BSTR key, INPTR BSTR value)1976 { 1977 if (! key)1950 STDMETHODIMP Machine::SetExtraData (INPTR BSTR aKey, INPTR BSTR aValue) 1951 { 1952 if (!aKey) 1978 1953 return E_INVALIDARG; 1979 1954 … … 2015 1990 2016 1991 vrc = CFGLDRGetChildNode (machineNode, "ExtraData", 0, &extraDataNode); 2017 if (VBOX_FAILURE (vrc) && value)1992 if (VBOX_FAILURE (vrc) && aValue) 2018 1993 vrc = CFGLDRCreateChildNode (machineNode, "ExtraData", &extraDataNode); 2019 1994 … … 2031 2006 Bstr name; 2032 2007 CFGLDRQueryBSTR (extraDataItemNode, "name", name.asOutParam()); 2033 if (name == key)2008 if (name == aKey) 2034 2009 { 2035 2010 CFGLDRQueryBSTR (extraDataItemNode, "value", oldVal.asOutParam()); … … 2044 2019 * Note: 2045 2020 * 1. when oldVal is null, |oldVal == (BSTR) NULL| is true 2046 * 2. we cannot do |oldVal != value| because it will compare2021 * 2. we cannot do |oldVal != aValue| because it will compare 2047 2022 * BSTR pointers instead of strings (due to type conversion ops) 2048 2023 */ 2049 changed = !(oldVal == value);2024 changed = !(oldVal == aValue); 2050 2025 2051 2026 if (changed) 2052 2027 { 2053 2028 /* ask for permission from all listeners */ 2054 if (!mParent->onExtraDataCanChange (mData->mUuid, key, value)) 2029 Bstr error; 2030 if (!mParent->onExtraDataCanChange (mData->mUuid, aKey, aValue, error)) 2055 2031 { 2056 LogWarningFunc (("Someone vetoed! Change refused!\n")); 2032 const char *sep = error.isEmpty() ? "" : ": "; 2033 const BSTR err = error.isNull() ? (const BSTR) L"" : error.raw(); 2034 LogWarningFunc (("Someone vetoed! Change refused%s%ls\n", 2035 sep, err)); 2057 2036 rc = setError (E_ACCESSDENIED, 2058 2037 tr ("Could not set extra data because someone refused " 2059 "the requested change of '%ls' to '%ls'"), key, value); 2038 "the requested change of '%ls' to '%ls'%s%ls"), 2039 aKey, aValue, sep, err); 2060 2040 } 2061 2041 else 2062 2042 { 2063 if ( value)2043 if (aValue) 2064 2044 { 2065 2045 if (!extraDataItemNode) … … 2068 2048 CFGLDRAppendChildNode (extraDataNode, "ExtraDataItem", 2069 2049 &extraDataItemNode); 2070 CFGLDRSetBSTR (extraDataItemNode, "name", key);2050 CFGLDRSetBSTR (extraDataItemNode, "name", aKey); 2071 2051 } 2072 CFGLDRSetBSTR (extraDataItemNode, "value", value);2052 CFGLDRSetBSTR (extraDataItemNode, "value", aValue); 2073 2053 } 2074 2054 else … … 2097 2077 if (SUCCEEDED (rc) && changed) 2098 2078 { 2099 mParent->onExtraDataChange (mData->mUuid, key, value);2079 mParent->onExtraDataChange (mData->mUuid, aKey, aValue); 2100 2080 } 2101 2081 … … 2313 2293 2314 2294 return S_OK; 2295 } 2296 2297 STDMETHODIMP Machine::CanShowConsoleWindow (BOOL *aCanShow) 2298 { 2299 if (!aCanShow) 2300 return E_POINTER; 2301 2302 /* start with No */ 2303 aCanShow = FALSE; 2304 2305 AutoCaller autoCaller (this); 2306 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 2307 2308 ComPtr <IInternalSessionControl> directControl; 2309 { 2310 AutoReaderLock alock (this); 2311 2312 if (mData->mSession.mState != SessionState_SessionOpen) 2313 return setError (E_FAIL, 2314 tr ("Machine session is not open (session state: %d)"), 2315 mData->mSession.mState); 2316 2317 directControl = mData->mSession.mDirectControl; 2318 } 2319 2320 /* ignore calls made after #OnSessionEnd() is called */ 2321 if (!directControl) 2322 return S_OK; 2323 2324 return directControl->OnShowWindow (TRUE /* aCheck */, aCanShow); 2325 } 2326 2327 STDMETHODIMP Machine::ShowConsoleWindow() 2328 { 2329 AutoCaller autoCaller (this); 2330 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 2331 2332 ComPtr <IInternalSessionControl> directControl; 2333 { 2334 AutoReaderLock alock (this); 2335 2336 if (mData->mSession.mState != SessionState_SessionOpen) 2337 return setError (E_FAIL, 2338 tr ("Machine session is not open (session state: %d)"), 2339 mData->mSession.mState); 2340 2341 directControl = mData->mSession.mDirectControl; 2342 } 2343 2344 /* ignore calls made after #OnSessionEnd() is called */ 2345 if (!directControl) 2346 return S_OK; 2347 2348 BOOL dummy; 2349 return directControl->OnShowWindow (FALSE /* aCheck */, &dummy); 2315 2350 } 2316 2351 -
trunk/src/VBox/Main/SessionImpl.cpp
r678 r2463 588 588 589 589 return mConsole->onUSBDeviceDetach (aId); 590 } 591 592 STDMETHODIMP Session::OnShowWindow (BOOL aCheck, BOOL *aCanShow) 593 { 594 AutoCaller autoCaller (this); 595 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 596 597 AutoReaderLock alock (this); 598 AssertReturn (mState == SessionState_SessionOpen && 599 mType == SessionType_DirectSession, E_FAIL); 600 601 return mConsole->onShowWindow (aCheck, aCanShow); 590 602 } 591 603 -
trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp
r1 r2463 26 26 //////////////////////////////////////////////////////////////////////////////// 27 27 28 void VirtualBoxErrorInfo::init (HRESULT resultCode, const GUID &iid, 29 const BSTR component, const BSTR text) 28 void VirtualBoxErrorInfo::init (HRESULT aResultCode, const GUID &aIID, 29 const BSTR aComponent, const BSTR aText, 30 IVirtualBoxErrorInfo *aNext) 30 31 { 31 mResultCode = resultCode; 32 mIID = iid; 33 mComponent = component; 34 mText = text; 32 mResultCode = aResultCode; 33 mIID = aIID; 34 mComponent = aComponent; 35 mText = aText; 36 mNext = aNext; 35 37 } 36 38 … … 38 40 //////////////////////////////////////////////////////////////////////////////// 39 41 40 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(ResultCode) (HRESULT * resultCode)42 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(ResultCode) (HRESULT *aResultCode) 41 43 { 42 if (! resultCode)44 if (!aResultCode) 43 45 return E_POINTER; 44 46 45 * resultCode = mResultCode;47 *aResultCode = mResultCode; 46 48 return S_OK; 47 49 } 48 50 49 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(InterfaceID) (GUIDPARAMOUT iid)51 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(InterfaceID) (GUIDPARAMOUT aIID) 50 52 { 51 if (! iid)53 if (!aIID) 52 54 return E_POINTER; 53 55 54 mIID.cloneTo ( iid);56 mIID.cloneTo (aIID); 55 57 return S_OK; 56 58 } 57 59 58 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Component) (BSTR * component)60 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Component) (BSTR *aComponent) 59 61 { 60 if (! component)62 if (!aComponent) 61 63 return E_POINTER; 62 64 63 mComponent.cloneTo ( component);65 mComponent.cloneTo (aComponent); 64 66 return S_OK; 65 67 } 66 68 67 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Text) (BSTR * text)69 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Text) (BSTR *aText) 68 70 { 69 if (! text)71 if (!aText) 70 72 return E_POINTER; 71 73 72 mText.cloneTo ( text);74 mText.cloneTo (aText); 73 75 return S_OK; 76 } 77 78 STDMETHODIMP VirtualBoxErrorInfo::COMGETTER(Next) (IVirtualBoxErrorInfo **aNext) 79 { 80 if (!aNext) 81 return E_POINTER; 82 83 /* this will set aNext to NULL if mNext is null */ 84 return mNext.queryInterfaceTo (aNext); 74 85 } 75 86 … … 158 169 NS_IMETHODIMP VirtualBoxErrorInfo::GetInner (nsIException **aInner) 159 170 { 160 return NS_ERROR_NOT_IMPLEMENTED; 171 ComPtr <IVirtualBoxErrorInfo> info; 172 nsresult rv = COMGETTER(Next) (info.asOutParam()); 173 CheckComRCReturnRC (rv); 174 return info.queryInterfaceTo (aInner); 161 175 } 162 176 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r2358 r2463 1812 1812 { 1813 1813 /* ask for permission from all listeners */ 1814 if (!onExtraDataCanChange (emptyGuid, aKey, aValue)) 1814 Bstr error; 1815 if (!onExtraDataCanChange (emptyGuid, aKey, aValue, error)) 1815 1816 { 1816 Log (("VirtualBox::SetExtraData(): Someone vetoed! Change refused\n")); 1817 const char *sep = error.isEmpty() ? "" : ": "; 1818 const BSTR err = error.isNull() ? (const BSTR) L"" : error.raw(); 1819 LogWarningFunc (("Someone vetoed! Change refused%s%ls\n", 1820 sep, err)); 1817 1821 rc = setError (E_ACCESSDENIED, 1818 1822 tr ("Could not set extra data because someone refused " 1819 "the requested change of '%ls' to '%ls'"), aKey, aValue); 1823 "the requested change of '%ls' to '%ls'%s%ls"), 1824 aKey, aValue, sep, err); 1820 1825 } 1821 1826 else … … 2490 2495 * @note Doesn't lock any object. 2491 2496 */ 2492 void VirtualBox::onMachineStateChange (const Guid & id, MachineState_T state)2493 { 2494 postEvent (new MachineEvent (this, id, state));2497 void VirtualBox::onMachineStateChange (const Guid &aId, MachineState_T aState) 2498 { 2499 postEvent (new MachineEvent (this, aId, aState)); 2495 2500 } 2496 2501 … … 2498 2503 * @note Doesn't lock any object. 2499 2504 */ 2500 void VirtualBox::onMachineDataChange (const Guid & id)2501 { 2502 postEvent (new MachineEvent (this, id));2505 void VirtualBox::onMachineDataChange (const Guid &aId) 2506 { 2507 postEvent (new MachineEvent (this, aId)); 2503 2508 } 2504 2509 … … 2506 2511 * @note Locks this object for reading. 2507 2512 */ 2508 BOOL VirtualBox::onExtraDataCanChange(const Guid &id, INPTR BSTR key, INPTR BSTR value) 2509 { 2510 LogFlowThisFunc(("machine={%s} key={%ls} val={%ls}\n", 2511 id.toString().raw(), key, value)); 2513 BOOL VirtualBox::onExtraDataCanChange (const Guid &aId, INPTR BSTR aKey, INPTR BSTR aValue, 2514 Bstr &aError) 2515 { 2516 LogFlowThisFunc (("machine={%s} aKey={%ls} aValue={%ls}\n", 2517 aId.toString().raw(), aKey, aValue)); 2518 2519 AutoCaller autoCaller (this); 2520 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 2512 2521 2513 2522 CallbackList list; … … 2517 2526 } 2518 2527 2519 BOOL allowChange = true;2528 BOOL allowChange = TRUE; 2520 2529 CallbackList::iterator it = list.begin(); 2521 2530 while ((it != list.end()) && allowChange) 2522 2531 { 2523 HRESULT rc = (*it++)->OnExtraDataCanChange(id, key, value, &allowChange); 2532 HRESULT rc = (*it++)->OnExtraDataCanChange (aId, aKey, aValue, 2533 aError.asOutParam(), &allowChange); 2524 2534 if (FAILED (rc)) 2525 2535 { 2526 /* 2527 * if a call to this method fails for some reason (for ex., because 2528 * the other side is dead), we ensure allowChange stays true 2529 * (MS COM RPC implementation seems to zero all output vars before 2530 * issuing an IPC call or after a failure, so it's essential there) 2531 */ 2532 allowChange = true; 2533 } 2534 } 2535 2536 LogFlowThisFunc (("allowChange=%d\n", allowChange)); 2536 /* if a call to this method fails for some reason (for ex., because 2537 * the other side is dead), we ensure allowChange stays true 2538 * (MS COM RPC implementation seems to zero all output vars before 2539 * issuing an IPC call or after a failure, so it's essential 2540 * there) */ 2541 allowChange = TRUE; 2542 } 2543 } 2544 2545 LogFlowThisFunc (("allowChange=%RTbool\n", allowChange)); 2537 2546 return allowChange; 2538 2547 } … … 2561 2570 * @note Doesn't lock any object. 2562 2571 */ 2563 void VirtualBox::onExtraDataChange (const Guid & id, INPTR BSTR key, INPTR BSTR value)2564 { 2565 postEvent (new ExtraDataEvent (this, id, key, value));2572 void VirtualBox::onExtraDataChange (const Guid &aId, INPTR BSTR aKey, INPTR BSTR aValue) 2573 { 2574 postEvent (new ExtraDataEvent (this, aId, aKey, aValue)); 2566 2575 } 2567 2576 … … 2595 2604 * @note Doesn't lock any object. 2596 2605 */ 2597 void VirtualBox::onSessionStateChange (const Guid & id, SessionState_T state)2598 { 2599 postEvent (new SessionEvent (this, id, state));2606 void VirtualBox::onSessionStateChange (const Guid &aId, SessionState_T aState) 2607 { 2608 postEvent (new SessionEvent (this, aId, aState)); 2600 2609 } 2601 2610 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r2365 r2463 349 349 <interface 350 350 name="IVirtualBoxErrorInfo" extends="$errorinfo" 351 uuid=" 37EDE76D-6E16-4CE4-9D48-2C5A87AFFEA2"351 uuid="e98b5376-8eb4-4eea-812a-3964bf3bb26f" 352 352 supportsErrorInfo="no" 353 353 wsmap="struct" … … 360 360 In MS COM, this interface extends the IErrorInfo interface, 361 361 in XPCOM, it extends the nsIException interface. In both cases, 362 it provides a set of common attributes to retrieve error information. 362 it provides a set of common attributes to retrieve error 363 information. 364 365 Sometimes invocation of some component's method may involve 366 methods of other components that may also fail (independently of 367 this method's failure), or a series of non-fatal errors may precede 368 a fatal error that causes method failure. In cases like that, it 369 may be desirable to preserve information about all errors happened 370 during method invocation and deliver it to the caller. The <link 371 to="#next"/> attribute is intended specifically for this purpose 372 and allows to represent a chain of errors through a single 373 IVirtualBoxErrorInfo instance set after method invocation. 363 374 </desc> 364 375 … … 374 385 <note> 375 386 In MS COM, there is no equivalent. 376 In XPCOM, it is the same as tonsIException::result.387 In XPCOM, it is the same as nsIException::result. 377 388 </note> 378 389 </desc> … … 383 394 UUID of the interface that defined the error. 384 395 <note> 385 In MS COM, it is the same as toIErrorInfo::GetGUID.396 In MS COM, it is the same as IErrorInfo::GetGUID. 386 397 In XPCOM, there is no equivalent. 387 398 </note> … … 393 404 Name of the component that generated the error. 394 405 <note> 395 In MS COM, it is the same as toIErrorInfo::GetSource.406 In MS COM, it is the same as IErrorInfo::GetSource. 396 407 In XPCOM, there is no eqiuvalent. 397 408 </note> … … 404 415 <note> 405 416 In MS COM, it is the same as IErrorInfo::GetDescription. 406 In XPCOM, it is the same as to nsIException::message. 417 In XPCOM, it is the same as nsIException::message. 418 </note> 419 </desc> 420 </attribute> 421 422 <attribute name="next" type="IVirtualBoxErrorInfo" readonly="yes"> 423 <desc> 424 Next error object if there is any, or @c null otherwise. 425 <note> 426 In MS COM, there is no equivalent. 427 In XPCOM, it is the same as nsIException::inner. 407 428 </note> 408 429 </desc> … … 419 440 <interface 420 441 name="IVirtualBoxCallback" extends="$unknown" 421 uuid=" 1293842f-0380-47cf-80b5-e4f821861b26"442 uuid="ee95ffc2-b6c6-4ce8-9e9e-ceadbb5019fe" 422 443 wsmap="suppress" 423 444 > … … 452 473 <param name="machineId" type="uuid" dir="in"> 453 474 <desc> 454 ID of the machine this event relates to .455 Nul for global extra data change requests.475 ID of the machine this event relates to 476 (null ID for global extra data change requests). 456 477 </desc> 457 478 </param> … … 466 487 </desc> 467 488 </param> 489 <param name="error" type="wstring" dir="out"> 490 <desc> 491 Optional error message describing the reason of the 492 veto (ignored if this notification returns @c true). 493 </desc> 494 </param> 468 495 <param name="allowChange" type="boolean" dir="return"> 469 496 <desc> 470 Flag to indicate whether the callee agrees ( true)471 or vetoes against the change ( false).497 Flag to indicate whether the callee agrees (@ true) 498 or vetoes against the change (@ false). 472 499 </desc> 473 500 </param> … … 972 999 until <link to="#registerHardDisk()"/> is called. 973 1000 974 @deprecated Use <link to=" #openHardDisk()"/> instead.1001 @deprecated Use <link to="IVirtualBox::openHardDisk()"/> instead. 975 1002 976 1003 <note>Opening differencing images is not supported.</note> … … 1056 1083 Returns a registered hard disk that uses the given image file. 1057 1084 1058 @deprecated Use <link to=" #findHardDisk()"/> instead.1085 @deprecated Use <link to="IVirtualBox::findHardDisk()"/> instead. 1059 1086 1060 1087 <note>The specified file path can be absolute (full path) or … … 1362 1389 Returns the extra data key name following the supplied key. 1363 1390 An error is returned if the supplied key does not exist. 1364 NULL is returned if the supplied key is the last key. 1365 When supplying NULL for the key, the first item is returned. 1366 NextValue is an optional parameter and if supplied, the next 1367 key's value is returned as well. 1368 </desc> 1369 <param name="key" type="wstring" dir="in"/> 1370 <param name="nextKey" type="wstring" dir="out"/> 1371 <param name="nextValue" type="wstring" dir="out"/> 1391 @c NULL is returned if the supplied key is the last key. 1392 When supplying @c NULL for the key, the first item is returned. 1393 @a nextValue is an optional parameter and if supplied, the next 1394 key's value is returned in it. 1395 </desc> 1396 <param name="key" type="wstring" dir="in"> 1397 <desc>Name of the data key to follow.</desc> 1398 </param> 1399 <param name="nextKey" type="wstring" dir="out"> 1400 <desc>Name of the next data key.</desc> 1401 </param> 1402 <param name="nextValue" type="wstring" dir="out"> 1403 <desc>Value of the next data key.</desc> 1404 </param> 1372 1405 </method> 1373 1406 1374 1407 <method name="getExtraData"> 1375 <desc>Returns associated extra data.</desc> 1376 <param name="key" type="wstring" dir="in"/> 1377 <param name="value" type="wstring" dir="return"/> 1408 <desc> 1409 Returns associated extra data. 1410 If the reuqested key does not exist, this function will 1411 succeed and return @c null in the @a value argument. 1412 </desc> 1413 <param name="key" type="wstring" dir="in"> 1414 <desc>Name of the data key to get.</desc> 1415 </param> 1416 <param name="value" type="wstring" dir="return"> 1417 <desc>Value of the requested data key.</desc> 1418 </param> 1378 1419 </method> 1379 1420 1380 1421 <method name="setExtraData"> 1381 <desc>Sets associated extra data.</desc> 1382 <param name="key" type="wstring" dir="in"/> 1383 <param name="value" type="wstring" dir="in"/> 1422 <desc> 1423 Sets associated extra data. 1424 If you pass @c NULL as a key @a vaule, the given key will be 1425 deleted. 1426 <note> 1427 This method can be called outside a machine session and 1428 therefore it's a caller's responsibility to handle race 1429 condition when several clients change the same key at the 1430 same time. 1431 </note> 1432 </desc> 1433 <param name="key" type="wstring" dir="in"> 1434 <desc>Name of the data key to set.</desc> 1435 </param> 1436 <param name="value" type="wstring" dir="in"> 1437 <desc>Value to assign to the key.</desc> 1438 </param> 1384 1439 </method> 1385 1440 … … 1825 1880 <interface 1826 1881 name="IMachine" extends="$unknown" 1827 uuid=" 50fa9181-d2d4-45ca-bf0e-742677b9c707"1882 uuid="f0ad6688-2216-4654-a375-10afc5b88dcd" 1828 1883 wsmap="uuid" 1829 1884 > … … 2510 2565 </method> 2511 2566 2567 <method name="canShowConsoleWindow"> 2568 <desc> 2569 Returns @c true if the VM console process can activate the 2570 console window and bring it to foreground on the desktop of 2571 the host PC. 2572 <note> 2573 This method will fail if a session for this machine is not 2574 currently open. 2575 </note> 2576 </desc> 2577 <param name="canShow" type="boolean" dir="return"> 2578 <desc> 2579 @c true if the console window can be shown and @c 2580 false otherwise. 2581 </desc> 2582 </param> 2583 </method> 2584 2585 <method name="showConsoleWindow"> 2586 <desc> 2587 Returns @c true if the VM console process can activate the 2588 console window and bring it to foreground on the desktop of 2589 the host PC. 2590 <note> 2591 This method will fail if a session for this machine is not 2592 currently open. 2593 </note> 2594 </desc> 2595 </method> 2596 2512 2597 </interface> 2513 2598 … … 2519 2604 <interface 2520 2605 name="IConsoleCallback" extends="$unknown" 2521 uuid=" 05D3DD3F-0550-4953-BB3C-4ECB3EBF7C2E"2606 uuid="a56eff10-6db9-4985-a12a-039b604b491b" 2522 2607 wsmap="suppress" 2523 2608 > … … 2673 2758 2674 2759 <note> 2675 This notification is not designed to be implemented by more2676 than one callback at a time. If you have multiple2760 This notification is not designed to be implemented by 2761 more than one callback at a time. If you have multiple 2677 2762 IConsoleCallback instances registered on the given 2678 IConsole object, make sure you just return S_OK from allbut2679 one of them that does actual user notification and performs2680 necessary actions.2763 IConsole object, make sure you simply do nothing but 2764 return @c S_OK from all but one of them that does actual 2765 user notification and performs necessary actions. 2681 2766 </note> 2682 2767 … … 2691 2776 <desc>Optional error message</desc> 2692 2777 </param> 2778 </method> 2779 2780 <method name="onCanShowWindow"> 2781 <desc> 2782 Notification when a call to 2783 <link to="IMachine::canShowConsoleWindow()"/> is made by a 2784 front-end to check if a subsequent call to 2785 <link to="IMachine::showConsoleWindow()"/> can succeed. 2786 2787 The callee should give an answer appropriate to the current 2788 machine state in the @a canShow argument. This answer must 2789 remain valid at least until the next 2790 <link to="IConsole::state">machine state</link> change. 2791 2792 <note> 2793 This notification is not designed to be implemented by 2794 more than one callback at a time. If you have multiple 2795 IConsoleCallback instances registered on the given 2796 IConsole object, make sure you simply do nothing but 2797 return @c true and @c S_OK from all but one of them that 2798 actually manages console window activation. 2799 </note> 2800 </desc> 2801 <param name="canShow" type="boolean" dir="return"> 2802 <desc> 2803 @c true if the console window can be shown and @c 2804 false otherwise. 2805 </desc> 2806 </param> 2807 </method> 2808 2809 <method name="onShowWindow"> 2810 <desc> 2811 Notification when a call to 2812 <link to="IMachine::showConsoleWindow()"/> 2813 requests the console window to be activated and brought to 2814 foreground on the desktop of the host PC. 2815 2816 This notification should cause the VM console process to 2817 perform the requested action as described above. If it is 2818 impossible to do it at a time of this notification, this 2819 method should return a failure. 2820 2821 <note> 2822 This notification is not designed to be implemented by 2823 more than one callback at a time. If you have multiple 2824 IConsoleCallback instances registered on the given 2825 IConsole object, make sure you simply do nothing but 2826 return@c S_OK from all but one of them that actually 2827 manages console window activation. 2828 </note> 2829 </desc> 2693 2830 </method> 2694 2831 … … 3427 3564 <interface 3428 3565 name="IHost" extends="$unknown" 3429 uuid=" FD443EC1-000B-4F5B-9282-D72760A66916"3566 uuid="81729c26-1aec-46f5-b7c0-cc7364738fdb" 3430 3567 wsmap="global" 3431 3568 > … … 3561 3698 </desc> 3562 3699 </param> 3563 <param name="filter" type="IHostUSBDeviceFilter" dir=" out">3700 <param name="filter" type="IHostUSBDeviceFilter" dir="return"> 3564 3701 <desc>Created filter object.</desc> 3565 3702 </param> … … 3605 3742 <desc>Position to remove the filter from.</desc> 3606 3743 </param> 3607 <param name="filter" type="IHostUSBDeviceFilter" dir=" out">3744 <param name="filter" type="IHostUSBDeviceFilter" dir="return"> 3608 3745 <desc>Removed USB device filter.</desc> 3609 3746 </param> … … 5878 6015 the @a vram parameter of this method. 5879 6016 5880 For non linear modes (such as text and standard VGA), the 5881 @vram parameter isNULL and must not be used. When it's not6017 For non linear modes (such as text and standard VGA), the @a 6018 vram parameter is @c NULL and must not be used. When it's not 5882 6019 NULL, it is recommended to use it to access the guest video 5883 6020 memory instead of creating a separate buffer as it will at … … 5898 6035 <desc>Pointer to the guest VRAM (NULL for non linear modes)</desc> 5899 6036 </param> 5900 <param name="lineSize" type="unsigned long" dir="in"/> 5901 <param name="width" type="unsigned long" dir="in"/> 5902 <param name="height" type="unsigned long" dir="in"/> 5903 <param name="finished" type="boolean" dir="return"/> 6037 <param name="lineSize" type="unsigned long" dir="in"> 6038 <desc>Size of one scan line, in bytes.</desc> 6039 </param> 6040 <param name="width" type="unsigned long" dir="in"> 6041 <desc>Width of the guest display, in pixels.</desc> 6042 </param> 6043 <param name="height" type="unsigned long" dir="in"> 6044 <desc>Height of the guest display, in pixels.</desc> 6045 </param> 6046 <param name="finished" type="boolean" dir="return"> 6047 <desc> 6048 Can the VM start using the new framebuffer immediately 6049 after this method returns or it should wait for 6050 <link to="IDisplay::resizeCompleted()"/>. 6051 </desc> 6052 </param> 5904 6053 </method> 5905 6054 … … 7146 7295 <interface 7147 7296 name="IInternalSessionControl" extends="$unknown" 7148 uuid=" A99D5EB3-02DE-48e4-B059-91A8A41B4DA1"7297 uuid="9c6bec01-4135-40a0-b9d3-ab119a9c5412" 7149 7298 internal="yes" 7150 7299 wsmap="suppress" … … 7249 7398 </method> 7250 7399 7400 <method name="onShowWindow"> 7401 <desc> 7402 Called by <link to="IMachine::canShowConsoleWindow()"/> and by 7403 <link to="IMachine::showConsoleWindow()"/> in order to notify 7404 console callbacks 7405 <link to="IConsoleCallback::onCanShowWindow()"/> 7406 and <link to="IConsoleCallback::onShowWindow()"/>. 7407 </desc> 7408 <param name="check" type="boolean" dir="in"/> 7409 <param name="canShow" type="boolean" dir="out"/> 7410 </method> 7411 7251 7412 </interface> 7252 7413 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r2453 r2463 199 199 void onKeyboardLedsChange (bool fNumLock, bool fCapsLock, bool fScrollLock); 200 200 void onRuntimeError (BOOL aFatal, INPTR BSTR aErrorID, INPTR BSTR aMessage); 201 HRESULT onShowWindow (BOOL aCheck, BOOL *aCanShow); 201 202 202 203 static const PDMDRVREG DrvStatusReg; -
trunk/src/VBox/Main/include/DisplayImpl.h
r2219 r2463 108 108 } 109 109 110 STDMETHOD(OnCanShowWindow)(BOOL *canShow) 111 { 112 if (canShow) 113 *canShow = TRUE; 114 return S_OK; 115 } 116 117 STDMETHOD(OnShowWindow)() 118 { 119 return S_OK; 120 } 121 110 122 // IDisplay properties 111 123 STDMETHOD(COMGETTER(Width)) (ULONG *width); -
trunk/src/VBox/Main/include/MachineImpl.h
r1721 r2463 355 355 STDMETHOD(DetachHardDisk) (DiskControllerType_T aCtl, LONG aDev); 356 356 STDMETHOD(GetNetworkAdapter) (ULONG slot, INetworkAdapter **adapter); 357 STDMETHOD(GetNextExtraDataKey)(INPTR BSTR key, BSTR *nextKey, BSTR *nextValue);358 STDMETHOD(GetExtraData)(INPTR BSTR key, BSTR *value);359 STDMETHOD(SetExtraData)(INPTR BSTR key, INPTR BSTR value);357 STDMETHOD(GetNextExtraDataKey)(INPTR BSTR aKey, BSTR *aNextKey, BSTR *aNextValue); 358 STDMETHOD(GetExtraData)(INPTR BSTR aKey, BSTR *aValue); 359 STDMETHOD(SetExtraData)(INPTR BSTR aKey, INPTR BSTR aValue); 360 360 STDMETHOD(SaveSettings)(); 361 361 STDMETHOD(DiscardSettings)(); … … 364 364 STDMETHOD(FindSnapshot) (INPTR BSTR aName, ISnapshot **aSnapshot); 365 365 STDMETHOD(SetCurrentSnapshot) (INPTR GUIDPARAM aId); 366 STDMETHOD(CreateSharedFolder)(INPTR BSTR aName, INPTR BSTR aHostPath); 367 STDMETHOD(RemoveSharedFolder)(INPTR BSTR aName); 366 STDMETHOD(CreateSharedFolder) (INPTR BSTR aName, INPTR BSTR aHostPath); 367 STDMETHOD(RemoveSharedFolder) (INPTR BSTR aName); 368 STDMETHOD(CanShowConsoleWindow) (BOOL *aCanShow); 369 STDMETHOD(ShowConsoleWindow)(); 368 370 369 371 // public methods only for internal purposes -
trunk/src/VBox/Main/include/SessionImpl.h
r606 r2463 102 102 STDMETHOD(OnUSBDeviceAttach) (IUSBDevice *aDevice); 103 103 STDMETHOD(OnUSBDeviceDetach) (INPTR GUIDPARAM aId); 104 STDMETHOD(OnShowWindow) (BOOL aCheck, BOOL *aCanShow); 104 105 105 106 // for VirtualBoxSupportErrorInfoImpl -
trunk/src/VBox/Main/include/VirtualBoxErrorInfoImpl.h
r1 r2463 61 61 62 62 // public initializer/uninitializer for internal purposes only 63 void init (HRESULT resultCode, const GUID &iid, 64 const BSTR component, const BSTR text); 63 void init (HRESULT aResultCode, const GUID &aIID, 64 const BSTR aComponent, const BSTR aText, 65 IVirtualBoxErrorInfo *aNext = NULL); 65 66 66 67 // IVirtualBoxErrorInfo properties 67 STDMETHOD(COMGETTER(ResultCode)) (HRESULT *resultCode); 68 STDMETHOD(COMGETTER(InterfaceID)) (GUIDPARAMOUT iid); 69 STDMETHOD(COMGETTER(Component)) (BSTR *component); 70 STDMETHOD(COMGETTER(Text)) (BSTR *text); 68 STDMETHOD(COMGETTER(ResultCode)) (HRESULT *aResultCode); 69 STDMETHOD(COMGETTER(InterfaceID)) (GUIDPARAMOUT aIID); 70 STDMETHOD(COMGETTER(Component)) (BSTR *aComponent); 71 STDMETHOD(COMGETTER(Text)) (BSTR *aText); 72 STDMETHOD(COMGETTER(Next)) (IVirtualBoxErrorInfo **aNext); 71 73 72 74 private: … … 76 78 Guid mIID; 77 79 Bstr mComponent; 80 ComPtr <IVirtualBoxErrorInfo> mNext; 78 81 }; 79 82 -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r2029 r2463 197 197 void updateClientWatcher(); 198 198 199 void onMachineStateChange (const Guid &id, MachineState_T state); 200 void onMachineDataChange (const Guid &id); 201 BOOL onExtraDataCanChange(const Guid &id, INPTR BSTR key, INPTR BSTR value); 202 void onExtraDataChange(const Guid &id, INPTR BSTR key, INPTR BSTR value); 199 void onMachineStateChange (const Guid &aId, MachineState_T aState); 200 void onMachineDataChange (const Guid &aId); 201 BOOL onExtraDataCanChange(const Guid &aId, INPTR BSTR aKey, INPTR BSTR aValue, 202 Bstr &aError); 203 void onExtraDataChange(const Guid &aId, INPTR BSTR aKey, INPTR BSTR aValue); 203 204 void onMachineRegistered (const Guid &aId, BOOL aRegistered); 204 void onSessionStateChange (const Guid & id, SessionState_T state);205 void onSessionStateChange (const Guid &aId, SessionState_T aState); 205 206 206 207 void onSnapshotTaken (const Guid &aMachineId, const Guid &aSnapshotId);
Note:
See TracChangeset
for help on using the changeset viewer.