Changeset 104286 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 11, 2024 1:56:27 AM (8 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r101477 r104286 1013 1013 /** @name Encrypted log interface 1014 1014 * @{ */ 1015 static DECLCALLBACK(int) i_logEncryptedOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename, uint32_t fFlags); 1015 static DECLCALLBACK(int) i_logEncryptedDirCtxOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename, void **pvDirCtx); 1016 static DECLCALLBACK(int) i_logEncryptedDirCtxClose(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx); 1017 static DECLCALLBACK(int) i_logEncryptedDelete(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx, const char *pszFilename); 1018 static DECLCALLBACK(int) i_logEncryptedRename(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx, 1019 const char *pszFilenameOld, const char *pszFilenameNew, uint32_t fFlags); 1020 static DECLCALLBACK(int) i_logEncryptedOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx, const char *pszFilename, uint32_t fFlags); 1016 1021 static DECLCALLBACK(int) i_logEncryptedClose(PCRTLOGOUTPUTIF pIf, void *pvUser); 1017 static DECLCALLBACK(int) i_logEncryptedDelete(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename);1018 static DECLCALLBACK(int) i_logEncryptedRename(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilenameOld,1019 const char *pszFilenameNew, uint32_t fFlags);1020 1022 static DECLCALLBACK(int) i_logEncryptedQuerySize(PCRTLOGOUTPUTIF pIf, void *pvUser, uint64_t *pcbSize); 1021 1023 static DECLCALLBACK(int) i_logEncryptedWrite(PCRTLOGOUTPUTIF pIf, void *pvUser, const void *pvBuf, 1022 1024 size_t cbWrite, size_t *pcbWritten); 1023 1025 static DECLCALLBACK(int) i_logEncryptedFlush(PCRTLOGOUTPUTIF pIf, void *pvUser); 1026 /** The logging output interface for encrypted logs. */ 1027 static RTLOGOUTPUTIF const s_ConsoleEncryptedLogOutputIf; 1024 1028 /** @} */ 1025 1029 #endif … … 1215 1219 /** The file handle of the encrypted log. */ 1216 1220 RTVFSFILE m_hVfsFileLog; 1217 /** The logging output interface for encrypted logs. */1218 RTLOGOUTPUTIF m_LogOutputIf;1219 1221 /** The log file key ID. */ 1220 1222 Utf8Str m_strLogKeyId; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r103856 r104286 8161 8161 } 8162 8162 8163 8164 8163 #ifdef VBOX_WITH_FULL_VM_ENCRYPTION 8165 /*static*/ 8166 DECLCALLBACK(int) Console::i_logEncryptedOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename, uint32_t fFlags) 8167 { 8168 RT_NOREF(pIf); 8164 8165 /*static*/ DECLCALLBACK(int) 8166 Console::i_logEncryptedDirCtxOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename, void **ppvDirCtx) 8167 { 8168 RT_NOREF(pIf, pvUser, pszFilename, ppvDirCtx); 8169 *ppvDirCtx = (void *)(intptr_t)22; 8170 return VINF_SUCCESS; 8171 } 8172 8173 /*static*/ DECLCALLBACK(int) 8174 Console::i_logEncryptedDirCtxClose(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx) 8175 { 8176 RT_NOREF(pIf, pvUser, pvDirCtx); 8177 Assert((intptr_t)pvDirCtx == 22); 8178 return VINF_SUCCESS; 8179 } 8180 8181 /*static*/ DECLCALLBACK(int) 8182 Console::i_logEncryptedDelete(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx, const char *pszFilename) 8183 { 8184 RT_NOREF(pIf, pvDirCtx, pvUser); 8185 return RTFileDelete(pszFilename); 8186 } 8187 8188 8189 /*static*/ DECLCALLBACK(int) 8190 Console::i_logEncryptedRename(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx, 8191 const char *pszFilenameOld, const char *pszFilenameNew, uint32_t fFlags) 8192 { 8193 RT_NOREF(pIf, pvDirCtx, pvUser); 8194 return RTFileRename(pszFilenameOld, pszFilenameNew, fFlags); 8195 } 8196 8197 /*static*/ DECLCALLBACK(int) 8198 Console::i_logEncryptedOpen(PCRTLOGOUTPUTIF pIf, void *pvUser, void *pvDirCtx, const char *pszFilename, uint32_t fFlags) 8199 { 8200 RT_NOREF(pIf, pvDirCtx); 8169 8201 Console *pConsole = static_cast<Console *>(pvUser); 8170 8202 RTVFSFILE hVfsFile = NIL_RTVFSFILE; … … 8204 8236 8205 8237 8206 /*static*/ 8207 DECLCALLBACK(int)Console::i_logEncryptedClose(PCRTLOGOUTPUTIF pIf, void *pvUser)8238 /*static*/ DECLCALLBACK(int) 8239 Console::i_logEncryptedClose(PCRTLOGOUTPUTIF pIf, void *pvUser) 8208 8240 { 8209 8241 RT_NOREF(pIf); … … 8216 8248 8217 8249 8218 /*static*/ 8219 DECLCALLBACK(int) Console::i_logEncryptedDelete(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilename) 8220 { 8221 RT_NOREF(pIf, pvUser); 8222 return RTFileDelete(pszFilename); 8223 } 8224 8225 8226 /*static*/ 8227 DECLCALLBACK(int) Console::i_logEncryptedRename(PCRTLOGOUTPUTIF pIf, void *pvUser, const char *pszFilenameOld, 8228 const char *pszFilenameNew, uint32_t fFlags) 8229 { 8230 RT_NOREF(pIf, pvUser); 8231 return RTFileRename(pszFilenameOld, pszFilenameNew, fFlags); 8232 } 8233 8234 8235 /*static*/ 8236 DECLCALLBACK(int) Console::i_logEncryptedQuerySize(PCRTLOGOUTPUTIF pIf, void *pvUser, uint64_t *pcbSize) 8250 /*static*/ DECLCALLBACK(int) 8251 Console::i_logEncryptedQuerySize(PCRTLOGOUTPUTIF pIf, void *pvUser, uint64_t *pcbSize) 8237 8252 { 8238 8253 RT_NOREF(pIf); … … 8243 8258 8244 8259 8245 /*static*/ 8246 DECLCALLBACK(int) Console::i_logEncryptedWrite(PCRTLOGOUTPUTIF pIf, void *pvUser, const void *pvBuf, 8247 size_t cbWrite, size_t *pcbWritten) 8260 /*static*/ DECLCALLBACK(int) 8261 Console::i_logEncryptedWrite(PCRTLOGOUTPUTIF pIf, void *pvUser, const void *pvBuf, size_t cbWrite, size_t *pcbWritten) 8248 8262 { 8249 8263 RT_NOREF(pIf); … … 8254 8268 8255 8269 8256 /*static*/ 8257 DECLCALLBACK(int)Console::i_logEncryptedFlush(PCRTLOGOUTPUTIF pIf, void *pvUser)8270 /*static*/ DECLCALLBACK(int) 8271 Console::i_logEncryptedFlush(PCRTLOGOUTPUTIF pIf, void *pvUser) 8258 8272 { 8259 8273 RT_NOREF(pIf); … … 8262 8276 return RTVfsFileFlush(pConsole->m_hVfsFileLog); 8263 8277 } 8264 #endif 8265 8278 8279 8280 /*static*/ RTLOGOUTPUTIF const Console::s_ConsoleEncryptedLogOutputIf = 8281 { 8282 Console::i_logEncryptedDirCtxOpen, 8283 Console::i_logEncryptedDirCtxClose, 8284 Console::i_logEncryptedDelete, 8285 Console::i_logEncryptedRename, 8286 Console::i_logEncryptedOpen, 8287 Console::i_logEncryptedClose, 8288 Console::i_logEncryptedQuerySize, 8289 Console::i_logEncryptedWrite, 8290 Console::i_logEncryptedFlush 8291 }; 8292 8293 #endif /* VBOX_WITH_FULL_VM_ENCRYPTION */ 8266 8294 8267 8295 /** … … 8336 8364 && bstrLogKeyStore.isNotEmpty()) 8337 8365 { 8338 m_LogOutputIf.pfnOpen = Console::i_logEncryptedOpen;8339 m_LogOutputIf.pfnClose = Console::i_logEncryptedClose;8340 m_LogOutputIf.pfnDelete = Console::i_logEncryptedDelete;8341 m_LogOutputIf.pfnRename = Console::i_logEncryptedRename;8342 m_LogOutputIf.pfnQuerySize = Console::i_logEncryptedQuerySize;8343 m_LogOutputIf.pfnWrite = Console::i_logEncryptedWrite;8344 m_LogOutputIf.pfnFlush = Console::i_logEncryptedFlush;8345 8346 8366 m_strLogKeyId = Utf8Str(bstrLogKeyId); 8347 8367 m_strLogKeyStore = Utf8Str(bstrLogKeyStore); 8348 8368 8349 pLogOutputIf = & m_LogOutputIf;8369 pLogOutputIf = &s_ConsoleEncryptedLogOutputIf; 8350 8370 pvLogOutputUser = this; 8351 8371 m_fEncryptedLog = true;
Note:
See TracChangeset
for help on using the changeset viewer.