Changeset 94742 in vbox
- Timestamp:
- Apr 28, 2022 5:59:53 PM (3 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r94660 r94742 76 76 # include <VBox/vrdpusb.h> 77 77 #endif 78 #include <VBox/VBoxCryptoIf.h> 78 79 79 80 #if defined(VBOX_WITH_GUEST_PROPS) || defined(VBOX_WITH_SHARED_CLIPBOARD) \ … … 322 323 HRESULT i_setDiskEncryptionKeys(const Utf8Str &strCfg); 323 324 325 HRESULT i_retainCryptoIf(PCVBOXCRYPTOIF *ppCryptoIf); 326 HRESULT i_releaseCryptoIf(PCVBOXCRYPTOIF pCryptoIf); 324 327 325 328 #ifdef VBOX_WITH_GUEST_PROPS … … 1086 1089 Bstr mstrUuid; 1087 1090 1091 /** @name Members related to the cryptographic support interface. 1092 * @{ */ 1093 /** The loaded module handle if loaded. */ 1094 RTLDRMOD mhLdrModCrypto; 1095 /** Reference counter tracking how many users of the cryptographic support 1096 * are there currently. */ 1097 volatile uint32_t mcRefsCrypto; 1098 /** Pointer to the cryptographic support interface. */ 1099 PCVBOXCRYPTOIF mpCryptoIf; 1100 /** @} */ 1101 1088 1102 #ifdef VBOX_WITH_DRAG_AND_DROP 1089 1103 HGCMSVCEXTHANDLE m_hHgcmSvcExtDragAndDrop; -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r94660 r94742 417 417 , mfUseHostClipboard(true) 418 418 , mMachineState(MachineState_PoweredOff) 419 , mhLdrModCrypto(NIL_RTLDRMOD) 420 , mcRefsCrypto(0) 421 , mpCryptoIf(NULL) 419 422 { 420 423 } … … 8929 8932 } 8930 8933 8934 /** 8935 * Retains a reference to the default cryptographic interface. 8936 * 8937 * @returns COM status code. 8938 * @param ppCryptoIf Where to store the pointer to the cryptographic interface on success. 8939 * 8940 * @note Locks this object for writing. 8941 */ 8942 HRESULT Console::i_retainCryptoIf(PCVBOXCRYPTOIF *ppCryptoIf) 8943 { 8944 AssertReturn(ppCryptoIf != NULL, E_INVALIDARG); 8945 8946 if (mhLdrModCrypto == NIL_RTLDRMOD) 8947 return setError(VBOX_E_NOT_SUPPORTED, 8948 tr("The VM is not configured for encryption")); 8949 8950 ASMAtomicIncU32(&mcRefsCrypto); 8951 *ppCryptoIf = mpCryptoIf; 8952 8953 return S_OK; 8954 } 8955 8956 /** 8957 * Releases the reference of the given cryptographic interface. 8958 * 8959 * @returns COM status code. 8960 * @param pCryptoIf Pointer to the cryptographic interface to release. 8961 * 8962 * @note Locks this object for writing. 8963 */ 8964 HRESULT Console::i_releaseCryptoIf(PCVBOXCRYPTOIF pCryptoIf) 8965 { 8966 AssertReturn(pCryptoIf == mpCryptoIf, E_INVALIDARG); 8967 8968 ASMAtomicDecU32(&mcRefsCrypto); 8969 return S_OK; 8970 } 8971 8931 8972 /** @callback_method_impl{FNVMATSTATE} 8932 8973 *
Note:
See TracChangeset
for help on using the changeset viewer.