Changeset 108620 in vbox
- Timestamp:
- Mar 19, 2025 7:29:06 PM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 168032
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/NvramStoreImpl.h
r106061 r108620 85 85 #endif 86 86 87 int i_getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile);88 87 com::Utf8Str i_getNonVolatileStorageFile(); 89 88 void i_updateNonVolatileStorageFile(const com::Utf8Str &aNonVolatileStorageFile); -
trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp
r108554 r108620 357 357 HRESULT NvramStore::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile) 358 358 { 359 int vrc = i_getNonVolatileStorageFile(aNonVolatileStorageFile); 360 if (RT_FAILURE(vrc)) 361 return setError(E_FAIL, tr("This machine does not have an NVRAM store file")); 359 #ifndef VBOX_COM_INPROC 360 Utf8Str strTmp; 361 { 362 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 363 strTmp = m->bd->strNvramPath; 364 } 365 366 AutoReadLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS); 367 if (strTmp.isEmpty()) 368 strTmp = m->pParent->i_getDefaultNVRAMFilename(); 369 if (strTmp.isNotEmpty()) 370 m->pParent->i_calculateFullPath(strTmp, aNonVolatileStorageFile); 371 #else 372 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 373 aNonVolatileStorageFile = m->bd->strNvramPath; 374 #endif 362 375 363 376 return S_OK; … … 369 382 #ifndef VBOX_COM_INPROC 370 383 Utf8Str strPath; 371 int vrc = i_getNonVolatileStorageFile(strPath);372 if ( RT_FAILURE(vrc))384 NvramStore::getNonVolatileStorageFile(strPath); 385 if (strPath.isEmpty()) 373 386 return setError(E_FAIL, tr("No NVRAM store file found")); 374 387 … … 383 396 if (!m->mapNvram.size()) 384 397 { 385 vrc = i_loadStore(strPath.c_str());398 int vrc = i_loadStore(strPath.c_str()); 386 399 if (RT_FAILURE(vrc)) 387 400 hrc = setError(E_FAIL, tr("Loading the NVRAM store failed (%Rrc)\n"), vrc); … … 453 466 if (FAILED(adep.hrc())) return adep.hrc(); 454 467 455 Utf8Str strPath = i_getNonVolatileStorageFile(); 468 Utf8Str strPath; 469 NvramStore::getNonVolatileStorageFile(strPath); 456 470 457 471 /* We need a write lock because of the lazy initialization. */ … … 521 535 522 536 /** 523 * Returns the path of the non-volatile storage file.524 *525 * @returns VBox status code.526 * @retval VERR_FILE_NOT_FOUND if the storage file was not found.527 * @param aNonVolatileStorageFile Returns path to non-volatile stroage file on success.528 */529 int NvramStore::i_getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile)530 {531 #ifndef VBOX_COM_INPROC532 Utf8Str strTmp;533 {534 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);535 strTmp = m->bd->strNvramPath;536 }537 538 AutoReadLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS);539 if (strTmp.isEmpty())540 strTmp = m->pParent->i_getDefaultNVRAMFilename();541 if (strTmp.isNotEmpty())542 m->pParent->i_calculateFullPath(strTmp, aNonVolatileStorageFile);543 #else544 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);545 aNonVolatileStorageFile = m->bd->strNvramPath;546 #endif547 548 if (aNonVolatileStorageFile.isEmpty())549 return VERR_FILE_NOT_FOUND;550 551 return VINF_SUCCESS;552 }553 554 555 /**556 537 * Returns the path of the non-volatile stroage file. 557 538 * … … 566 547 567 548 Utf8Str strTmp; 568 /* rc ignored */ i_getNonVolatileStorageFile(strTmp);549 NvramStore::getNonVolatileStorageFile(strTmp); 569 550 return strTmp; 570 551 } … … 1197 1178 int vrc = VINF_SUCCESS; 1198 1179 1199 Utf8Str strPath = i_getNonVolatileStorageFile(); 1180 Utf8Str strPath; 1181 NvramStore::getNonVolatileStorageFile(strPath); 1200 1182 1201 1183 /*
Note:
See TracChangeset
for help on using the changeset viewer.