Changeset 44619 in vbox
- Timestamp:
- Feb 10, 2013 8:26:28 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83706
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/Nvram.cpp
r44591 r44619 68 68 69 69 70 /******************************************************************************* 71 * Defined Constants And Macros * 72 *******************************************************************************/ 73 /** The default NVRAM attribute value (non-volatile, boot servier access, 74 runtime access). */ 75 #define NVRAM_DEFAULT_ATTRIB UINT32_C(0x7) 76 /** The CFGM overlay path of the NVRAM variables. */ 77 #define NVRAM_CFGM_OVERLAY_PATH "VBoxInternal/Devices/efi/0/LUN#0/Config/Vars" 78 70 79 /** 71 80 * Constructor/destructor … … 111 120 { 112 121 memcpy(pszStr, s_szPrefix, sizeof(s_szPrefix) - 1); 113 int rc = RTBase64Encode(pvBuf, cbBuf, &pszStr[sizeof(s_szPrefix) - 1], cb Buf- sizeof(s_szPrefix) + 1, NULL);122 int rc = RTBase64Encode(pvBuf, cbBuf, &pszStr[sizeof(s_szPrefix) - 1], cbStr - sizeof(s_szPrefix) + 1, NULL); 114 123 if (RT_FAILURE(rc)) 115 124 { … … 135 144 char szExtraName[256]; 136 145 size_t offValueNm = RTStrPrintf(szExtraName, sizeof(szExtraName) - 16, 137 "VBoxInternal/Devices/efi/0/LUN#0/Config/Vars/%4u/", idxVariable); 138 139 char szAttribs[32]; 140 RTStrPrintf(szAttribs, sizeof(szAttribs), "%#x", fAttributes); 146 NVRAM_CFGM_OVERLAY_PATH "/%04u/", idxVariable); 141 147 142 148 char szUuid[RTUUID_STR_LENGTH]; 143 149 int rc2 = RTUuidToStr(pVendorUuid, szUuid, sizeof(szUuid)); AssertRC(rc2); 150 151 char szAttribs[32]; 152 if (fAttributes != NVRAM_DEFAULT_ATTRIB) 153 RTStrPrintf(szAttribs, sizeof(szAttribs), "%#x", fAttributes); 154 else 155 szAttribs[0] = '\0'; 144 156 145 157 char *pszValue = drvNvram_binaryToCfgmString(pbValue, cbValue); … … 150 162 "Name", pszName, 151 163 "Uuid", szUuid, 164 "Value", pszValue, 152 165 "Attribs", szAttribs, 153 "Value", pszValue,154 166 }; 155 167 for (unsigned i = 0; i < RT_ELEMENTS(apszTodo); i += 2) 156 168 { 169 if (!apszTodo[i + 1][0]) 170 continue; 171 157 172 Assert(strlen(apszTodo[i]) < 16); 158 173 strcpy(szExtraName + offValueNm, apszTodo[i]); … … 193 208 { 194 209 char szExtraName[256]; 195 size_t offValue = RTStrPrintf(szExtraName, sizeof(szExtraName) - 16, 196 "VBoxInternal/Devices/efi/0/LUN#0/Config/Vars/%s/", pszVarNodeNm); 197 static const char *s_apszValueNames[] = { "Name", "Attribs", "Value" }; 210 size_t offValue = RTStrPrintf(szExtraName, sizeof(szExtraName) - 16, NVRAM_CFGM_OVERLAY_PATH "/%s/", pszVarNodeNm); 211 static const char *s_apszValueNames[] = { "Name", "Uuid", "Value", "Attribs" }; 198 212 for (unsigned i = 0; i < RT_ELEMENTS(s_apszValueNames); i++) 199 213 { … … 257 271 else 258 272 { 259 pVarNode = CFGMR3GetFirstChild(pThis->p LastVarNode);273 pVarNode = CFGMR3GetFirstChild(pThis->pCfgVarRoot); 260 274 for (uint32_t i = 0; i < idxVariable && pVarNode; i++) 261 275 pVarNode = CFGMR3GetNextChild(pVarNode); … … 281 295 AssertRCReturn(rc, rc); 282 296 283 rc = CFGMR3QueryU32 (pVarNode, "Attribs", pfAttributes);297 rc = CFGMR3QueryU32Def(pVarNode, "Attribs", pfAttributes, NVRAM_DEFAULT_ATTRIB); 284 298 AssertRCReturn(rc, rc); 285 299 … … 290 304 rc = CFGMR3QueryBytes(pVarNode, "Value", pbValue, cbValue); 291 305 AssertRCReturn(rc, rc); 306 *pcbValue = cbValue; 292 307 293 308 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.