- Timestamp:
- Jul 2, 2009 3:31:20 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r21079 r21173 852 852 { 853 853 if (VBOX_SUCCESS (vrc)) 854 vrc = loadStateFileExec (ssm, this, 0);854 vrc = loadStateFileExecInternal (ssm, version); 855 855 else if (vrc == VERR_SSM_UNIT_NOT_FOUND) 856 856 vrc = VINF_SUCCESS; … … 926 926 /** 927 927 * Callback handler to load various console data from the state file. 928 * When \a u32Version is 0, this method is called from #loadDataFromSavedState, 929 * otherwise it is called when the VM is being restored from the saved state. 928 * Called when the VM is being restored from the saved state. 930 929 * 931 930 * @param pvUser pointer to Console 932 931 * @param u32Version Console unit version. 933 * When not 0, should match sSSMConsoleVer.934 * 935 * @note Locks the Console object for writing.932 * Should match sSSMConsoleVer. 933 * 934 * @note Should locks the Console object for writing, if necessary. 936 935 */ 937 936 //static … … 941 940 LogFlowFunc (("\n")); 942 941 943 if ( u32Version != 0 &&SSM_VERSION_MAJOR_CHANGED(u32Version, sSSMConsoleVer))942 if (SSM_VERSION_MAJOR_CHANGED(u32Version, sSSMConsoleVer)) 944 943 return VERR_VERSION_MISMATCH; 945 946 if (u32Version != 0)947 {948 /* currently, nothing to do when we've been called from VMR3Load */949 return VINF_SUCCESS;950 }951 944 952 945 Console *that = static_cast <Console *> (pvUser); 953 946 AssertReturn (that, VERR_INVALID_PARAMETER); 954 947 955 AutoCaller autoCaller (that); 948 /* Currently, nothing to do when we've been called from VMR3Load. */ 949 950 return VINF_SUCCESS; 951 } 952 953 /** 954 * Method to load various console data from the state file. 955 * Called from #loadDataFromSavedState. 956 * 957 * @param pvUser pointer to Console 958 * @param u32Version Console unit version. 959 * Should match sSSMConsoleVer. 960 * 961 * @note Locks the Console object for writing. 962 */ 963 int 964 Console::loadStateFileExecInternal (PSSMHANDLE pSSM, uint32_t u32Version) 965 { 966 AutoCaller autoCaller (this); 956 967 AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED); 957 968 958 AutoWriteLock alock (th at);959 960 AssertReturn ( that->mSharedFolders.size() == 0, VERR_INTERNAL_ERROR);969 AutoWriteLock alock (this); 970 971 AssertReturn (mSharedFolders.size() == 0, VERR_INTERNAL_ERROR); 961 972 962 973 uint32_t size = 0; … … 994 1005 ComObjPtr <SharedFolder> sharedFolder; 995 1006 sharedFolder.createObject(); 996 HRESULT rc = sharedFolder->init (th at, name, hostPath, writable);1007 HRESULT rc = sharedFolder->init (this, name, hostPath, writable); 997 1008 AssertComRCReturn (rc, VERR_INTERNAL_ERROR); 998 1009 999 that->mSharedFolders.insert (std::make_pair (name, sharedFolder));1010 mSharedFolders.insert (std::make_pair (name, sharedFolder)); 1000 1011 } 1001 1012 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r20928 r21173 495 495 496 496 HRESULT loadDataFromSavedState(); 497 int loadStateFileExecInternal (PSSMHANDLE pSSM, uint32_t u32Version); 497 498 498 499 static DECLCALLBACK(void) saveStateFileExec (PSSMHANDLE pSSM, void *pvUser);
Note:
See TracChangeset
for help on using the changeset viewer.