Changeset 100651 in vbox
- Timestamp:
- Jul 19, 2023 11:52:59 AM (18 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestShClPrivate.h
r100606 r100651 32 32 #endif 33 33 34 #include <VBox/HostServices/VBoxClipboardExt.h> 35 34 36 /** 35 37 * Forward prototype declarations. … … 44 46 /** Service extension callback function. 45 47 * Setting this to NULL deactivates the extension. */ 46 PFNHGCMSVCEXT pfnExt;48 PFNHGCMSVCEXT pfnExt; 47 49 /** User-supplied service extension data. Might be NULL if not being used. */ 48 void *pvExt; 50 void * pvExt; 51 /** Pointer to an optional extension callback. 52 * Might be NULL if not being used. */ 53 PFNSHCLEXTCALLBACK pfnExtCallback; 49 54 }; 50 55 /** Pointer to a Shared Clipboard service extension. */ … … 136 141 /** Pointer an additional service extension handle to serve (daisy chaining). 137 142 * 138 * This currently only is being used by the Console VRDP server helper class. 139 * We might want to transform this into a map later if we (ever) need more than one service extension. */ 143 * This currently only is being used by the Console VRDP server helper class (historical reasons). 144 * We might want to transform this into a map later if we (ever) need more than one service extension, 145 * or drop this concept althogether when we move the service stuff out of the VM process (later). */ 140 146 SHCLSVCEXT m_SvcExtVRDP; 147 /** Pointer to an optional extension callback. 148 * Might be NULL if not being used. */ 149 PFNSHCLEXTCALLBACK m_pfnExtCallback; 141 150 /** @} */ 142 151 -
trunk/src/VBox/Main/src-client/GuestShClPrivate.cpp
r100619 r100651 60 60 GuestShCl::GuestShCl(Console *pConsole) 61 61 : m_pConsole(pConsole) 62 , m_pfnExtCallback(NULL) 62 63 { 63 64 LogFlowFuncEnter(); … … 86 87 87 88 RT_ZERO(m_SvcExtVRDP); 89 90 m_pfnExtCallback = NULL; 88 91 } 89 92 … … 122 125 { 123 126 AssertPtrReturn(pfnExtension, VERR_INVALID_POINTER); 127 /* pvExtension is optional. */ 124 128 125 129 lock(); 126 130 131 LogFlowFunc(("m_pfnExtCallback=%p\n", this->m_pfnExtCallback)); 132 127 133 PSHCLSVCEXT pExt = &this->m_SvcExtVRDP; /* Currently we only have one extension only. */ 128 134 129 135 Assert(pExt->pfnExt == NULL); 130 136 131 pExt->pfnExt = pfnExtension; 132 pExt->pvExt = pvExtension; 137 pExt->pfnExt = pfnExtension; 138 pExt->pvExt = pvExtension; 139 pExt->pfnExtCallback = this->m_pfnExtCallback; /* Assign callback function. Optional and can be NULL. */ 140 141 if (pExt->pfnExtCallback) 142 { 143 /* Make sure to also give the extension the ability to use the callback. */ 144 SHCLEXTPARMS parms; 145 RT_ZERO(parms); 146 147 parms.u.SetCallback.pfnCallback = pExt->pfnExtCallback; 148 149 /* ignore rc, callback is optional */ pExt->pfnExt(pExt->pvExt, 150 VBOX_CLIPBOARD_EXT_FN_SET_CALLBACK, &parms, sizeof(parms)); 151 } 133 152 134 153 unlock(); … … 153 172 AssertReturnStmt(pExt->pfnExt == pfnExtension, unlock(), VERR_INVALID_PARAMETER); 154 173 AssertPtr(pExt->pfnExt); 174 175 /* Unregister the callback (setting to NULL). */ 176 SHCLEXTPARMS parms; 177 RT_ZERO(parms); 178 179 /* ignore rc, callback is optional */ pExt->pfnExt(pExt->pvExt, 180 VBOX_CLIPBOARD_EXT_FN_SET_CALLBACK, &parms, sizeof(parms)); 155 181 156 182 RT_BZERO(pExt, sizeof(SHCLSVCEXT)); … … 244 270 switch (u32Function) 245 271 { 272 case VBOX_CLIPBOARD_EXT_FN_SET_CALLBACK: 273 pThis->m_pfnExtCallback = pParms->u.SetCallback.pfnCallback; 274 vrc = VINF_SUCCESS; 275 break; 276 246 277 case VBOX_CLIPBOARD_EXT_FN_ERROR: 247 278 {
Note:
See TracChangeset
for help on using the changeset viewer.