Changeset 81820 in vbox
- Timestamp:
- Nov 13, 2019 11:19:52 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134611
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard.h
r81768 r81820 278 278 extern int ClipStopX11(CLIPBACKEND *pBackend); 279 279 extern int ClipAnnounceFormatToX11(CLIPBACKEND *pBackend, SHCLFORMATS vboxFormats); 280 extern int ClipRe questDataFromX11(CLIPBACKEND *pBackend, SHCLFORMATS vboxFormat, CLIPREADCBREQ *pReq);280 extern int ClipReadDataFromX11(CLIPBACKEND *pBackend, SHCLFORMATS vboxFormat, CLIPREADCBREQ *pReq); 281 281 /** @} */ 282 282 -
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r81369 r81820 263 263 { 264 264 pReq->u32Format = fFormats; 265 ClipRe questDataFromX11(g_ctx.pBackend, fFormats,265 ClipReadDataFromX11(g_ctx.pBackend, fFormats, 266 266 pReq); 267 267 } -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
r81750 r81820 428 428 #endif 429 429 430 LogRel2(("Shared Clipboard: Reported formats = 0x%x\n", fFormats)); 431 430 432 ClipReportX11FormatsCallback(pCtx->pFrontend, fFormats); 431 433 } … … 711 713 } 712 714 713 #if defined(DEBUG) &&!defined(TESTCASE)715 #if !defined(TESTCASE) 714 716 if (pValue) 715 717 { 716 718 for (i = 0; i < *pcLen; ++i) 719 { 717 720 if (pAtoms[i]) 718 721 { 719 722 char *pszName = XGetAtomName(XtDisplay(widget), pAtoms[i]); 720 Log Func(("Found target '%s'\n", pszName));723 LogRel2(("Shared Clipboard: Found target '%s'\n", pszName)); 721 724 XFree(pszName); 722 725 } 723 726 else 724 727 LogFunc(("Found empty target\n")); 728 } 725 729 } 726 730 #endif … … 1652 1656 * clipboard context data. Must be freed by the worker. 1653 1657 */ 1654 static void clip NewVBoxFormatsWorker(void *pUserData,1655 void * /* interval */)1658 static void clipAnnounceFormatToX11Worker(void *pUserData, 1659 void * /* interval */) 1656 1660 { 1657 1661 CLIPNEWVBOXFORMATS *pFormats = (CLIPNEWVBOXFORMATS *)pUserData; … … 1672 1676 1673 1677 /** 1674 * VBox is taking possession of the Shared Clipboard.1675 * 1676 * @ param u32Formats clipboard formats that VBox is offering.1677 * @ note X11 backend code1678 * Announces new clipboard formats to the host. 1679 * 1680 * @returns VBox status code. 1681 * @param u32Formats Clipboard formats offered. 1678 1682 */ 1679 1683 int ClipAnnounceFormatToX11(CLIPBACKEND *pCtx, uint32_t u32Formats) … … 1694 1698 pFormats->formats = u32Formats; 1695 1699 1696 rc = clipQueueToEventThread(pCtx, clip NewVBoxFormatsWorker,1700 rc = clipQueueToEventThread(pCtx, clipAnnounceFormatToX11Worker, 1697 1701 (XtPointer) pFormats); 1698 1702 } … … 1939 1943 } 1940 1944 1941 1942 1943 /** A structure containing information about where to store a request 1944 * for the X11 clipboard contents. */1945 struct _CLIPREADX11CBREQ1946 { 1947 /** The format VBox would like the data in */1945 /** 1946 * A structure containing information about where to store a request 1947 * for the X11 clipboard contents. 1948 */ 1949 typedef struct _CLIPREADX11CBREQ 1950 { 1951 /** The format VBox would like the data in. */ 1948 1952 SHCLFORMAT mFormat; 1949 /** @todo Put the following variables in an union or just use one for all formats? */ 1950 /** The text format we requested from X11 if we requested text */ 1951 CLIPX11FORMAT mTextFormat; 1952 /** The bitmap format we requested from X11 if we requested bitmap */ 1953 CLIPX11FORMAT mBitmapFormat; 1954 /** The HTML format we requested from X11 if we requested HTML */ 1955 CLIPX11FORMAT mHtmlFormat; 1956 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1957 /** The URI list format we requested from X11 if we requested URI lists. */ 1958 CLIPX11FORMAT mURIListFormat; 1959 #endif 1960 /** The clipboard context this request is associated with */ 1953 /** The format we requested from X11. */ 1954 CLIPX11FORMAT mX11Format; 1955 /** The clipboard context this request is associated with. */ 1961 1956 CLIPBACKEND *mpCtx; 1962 1957 /** The request structure passed in from the backend. */ 1963 1958 CLIPREADCBREQ *mpReq; 1964 }; 1965 1966 typedef struct _CLIPREADX11CBREQ CLIPREADX11CBREQ; 1959 } CLIPREADX11CBREQ; 1967 1960 1968 1961 /** … … 1980 1973 CLIPREADX11CBREQ *pReq = (CLIPREADX11CBREQ *)pClient; 1981 1974 1982 LogFlowFunc(("pReq->mFormat=%02X, pReq->mTextFormat=%u, pReq->mBitmapFormat=%u, pReq->mHtmlFormat=%u, pReq->mCtx=%p\n", 1983 pReq->mFormat, pReq->mTextFormat, pReq->mBitmapFormat, pReq->mHtmlFormat, pReq->mpCtx)); 1984 1985 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1986 LogFlowFunc(("pReq->mURIListFormat=%u\n", pReq->mURIListFormat)); 1987 #endif 1975 LogFlowFunc(("pReq->mFormat=%02X, pReq->mX11Format=%u, pReq->mCtx=%p\n", pReq->mFormat, pReq->mX11Format, pReq->mpCtx)); 1988 1976 1989 1977 AssertPtr(pReq->mpCtx); … … 2003 1991 { 2004 1992 /* In which format is the clipboard data? */ 2005 switch (clipRealFormatForX11Format(pReq->m TextFormat))1993 switch (clipRealFormatForX11Format(pReq->mX11Format)) 2006 1994 { 2007 1995 case UTF8: … … 2033 2021 { 2034 2022 /* In which format is the clipboard data? */ 2035 switch (clipRealFormatForX11Format(pReq->m BitmapFormat))2023 switch (clipRealFormatForX11Format(pReq->mX11Format)) 2036 2024 { 2037 2025 case BMP: … … 2065 2053 { 2066 2054 /* In which format is the clipboard data? */ 2067 switch (clipRealFormatForX11Format(pReq->m HtmlFormat))2055 switch (clipRealFormatForX11Format(pReq->mX11Format)) 2068 2056 { 2069 2057 case HTML: … … 2123 2111 { 2124 2112 /* In which format is the clipboard data? */ 2125 switch (clipRealFormatForX11Format(pReq->m URIListFormat))2113 switch (clipRealFormatForX11Format(pReq->mX11Format)) 2126 2114 { 2127 2115 case URI_LIST: … … 2223 2211 2224 2212 /** 2225 * Worker function for ClipRe questDataFromX11 which runs on the event thread.2226 */ 2227 static void clipRead X11Worker(void *pvUserData, void * /* interval */)2213 * Worker function for ClipReadDataFromX11 which runs on the event thread. 2214 */ 2215 static void clipReadDataFromX11Worker(void *pvUserData, void * /* interval */) 2228 2216 { 2229 2217 AssertPtrReturnVoid(pvUserData); … … 2238 2226 if (pReq->mFormat == VBOX_SHCL_FMT_UNICODETEXT) 2239 2227 { 2240 pReq->m TextFormat = pCtx->X11TextFormat;2241 if (pReq->m TextFormat != INVALID)2228 pReq->mX11Format = pCtx->X11TextFormat; 2229 if (pReq->mX11Format != INVALID) 2242 2230 { 2243 2231 /* Send out a request for the data to the current clipboard owner. */ … … 2247 2235 else if (pReq->mFormat == VBOX_SHCL_FMT_BITMAP) 2248 2236 { 2249 pReq->m BitmapFormat = pCtx->X11BitmapFormat;2250 if (pReq->m BitmapFormat != INVALID)2237 pReq->mX11Format = pCtx->X11BitmapFormat; 2238 if (pReq->mX11Format != INVALID) 2251 2239 { 2252 2240 /* Send out a request for the data to the current clipboard owner. */ … … 2256 2244 else if (pReq->mFormat == VBOX_SHCL_FMT_HTML) 2257 2245 { 2258 pReq->m HtmlFormat = pCtx->X11HTMLFormat;2259 if (pReq->m HtmlFormat != INVALID)2246 pReq->mX11Format = pCtx->X11HTMLFormat; 2247 if (pReq->mX11Format != INVALID) 2260 2248 { 2261 2249 /* Send out a request for the data to the current clipboard owner. */ … … 2266 2254 else if (pReq->mFormat == VBOX_SHCL_FMT_URI_LIST) 2267 2255 { 2268 pReq->m URIListFormat = pCtx->X11URIListFormat;2269 if (pReq->m URIListFormat != INVALID)2256 pReq->mX11Format = pCtx->X11URIListFormat; 2257 if (pReq->mX11Format != INVALID) 2270 2258 { 2271 2259 /* Send out a request for the data to the current clipboard owner. */ … … 2297 2285 * @param pCtx Context data for the clipboard backend. 2298 2286 * @param u32Format The format that the VBox would like to receive the data in. 2299 * @param pv Where to write the data to. 2300 * @param cb The size of the buffer to write the data to. 2301 * @param pcbActual Where to write the actual size of the written data. 2287 * @param pReq Read callback request to use. Must be free'd in the callback. 2302 2288 * 2303 2289 * @note We allocate a request structure which must be freed by the worker. 2304 2290 */ 2305 int ClipRe questDataFromX11(CLIPBACKEND *pCtx, uint32_t u32Format, CLIPREADCBREQ *pReq)2291 int ClipReadDataFromX11(CLIPBACKEND *pCtx, uint32_t u32Format, CLIPREADCBREQ *pReq) 2306 2292 { 2307 2293 /* … … 2316 2302 if (pX11Req) 2317 2303 { 2304 pX11Req->mpCtx = pCtx; 2318 2305 pX11Req->mFormat = u32Format; 2319 pX11Req->mpCtx = pCtx;2320 2306 pX11Req->mpReq = pReq; 2321 2307 2322 2308 /* We use this to schedule a worker function on the event thread. */ 2323 rc = clipQueueToEventThread(pCtx, clipRead X11Worker, (XtPointer)pX11Req);2309 rc = clipQueueToEventThread(pCtx, clipReadDataFromX11Worker, (XtPointer)pX11Req); 2324 2310 } 2325 2311 else … … 2716 2702 char *pc; 2717 2703 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL; 2718 ClipRe questDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);2704 ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq); 2719 2705 int rc = VINF_SUCCESS; 2720 2706 uint32_t cbActual = 0; … … 2773 2759 char *pc; 2774 2760 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL; 2775 ClipRe questDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);2761 ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq); 2776 2762 int rc = VINF_SUCCESS; 2777 2763 uint32_t cbActual = 0; … … 2849 2835 { 2850 2836 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq; 2851 int rc = ClipRe questDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);2837 int rc = ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq); 2852 2838 RTTESTI_CHECK_MSG(rc == VERR_NO_DATA, ("context: %s\n", pcszTestCtx)); 2853 2839 } … … 2886 2872 char *pc; 2887 2873 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)&pReq, *pReqRet = NULL; 2888 ClipRe questDataFromX11(pCtx, 100, pReq); /* Bad format. */2874 ClipReadDataFromX11(pCtx, 100, pReq); /* Bad format. */ 2889 2875 int rc = VINF_SUCCESS; 2890 2876 uint32_t cbActual = 0; … … 2995 2981 tstClipSetSelectionValues("UTF8_STRING", XA_STRING, NULL, 2996 2982 0, 8); 2997 ClipRe questDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq);2983 ClipReadDataFromX11(pCtx, VBOX_SHCL_FMT_UNICODETEXT, pReq); 2998 2984 tstClipGetCompletedRequest(&rc, &pc, &cbActual, &pReqRet); 2999 2985 RTTEST_CHECK_MSG(hTest, rc == VERR_NO_DATA, … … 3013 2999 /*** request for an invalid VBox format from X11 ***/ 3014 3000 RTTestSub(hTest, "a request for an invalid VBox format from X11"); 3015 ClipRe questDataFromX11(pCtx, 0xffff, pReq);3001 ClipReadDataFromX11(pCtx, 0xffff, pReq); 3016 3002 tstClipGetCompletedRequest(&rc, &pc, &cbActual, &pReqRet); 3017 3003 RTTEST_CHECK_MSG(hTest, rc == VERR_NOT_IMPLEMENTED, -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r81768 r81820 138 138 /** General client state data. */ 139 139 SHCLCLIENTSTATE State; 140 RTCRITSECT CritSect; 140 141 /** The client's message queue (FIFO). */ 141 142 RTCList<SHCLCLIENTMSG *> queueMsg; … … 210 211 int shClSvcSetSource(PSHCLCLIENT pClient, SHCLSOURCE enmSource); 211 212 212 void shclSvcMsgQueueReset(PSHCLCLIENT pClient); 213 PSHCLCLIENTMSG shclSvcMsgAlloc(uint32_t uMsg, uint32_t cParms); 214 void shclSvcMsgFree(PSHCLCLIENTMSG pMsg); 215 void shclSvcMsgSetPeekReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms); 216 int shclSvcMsgAdd(PSHCLCLIENT pClient, PSHCLCLIENTMSG pMsg, bool fAppend); 217 int shclSvcMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool fWait); 218 int shclSvcMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 219 220 int shclSvcClientInit(PSHCLCLIENT pClient, uint32_t uClientID); 221 void shclSvcClientReset(PSHCLCLIENT pClient); 222 223 int shclSvcClientStateInit(PSHCLCLIENTSTATE pClientState, uint32_t uClientID); 224 int shclSvcClientStateDestroy(PSHCLCLIENTSTATE pClientState); 213 void shClSvcMsgQueueReset(PSHCLCLIENT pClient); 214 PSHCLCLIENTMSG shClSvcMsgAlloc(uint32_t uMsg, uint32_t cParms); 215 void shClSvcMsgFree(PSHCLCLIENTMSG pMsg); 216 void shClSvcMsgSetPeekReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms); 217 int shClSvcMsgAdd(PSHCLCLIENT pClient, PSHCLCLIENTMSG pMsg, bool fAppend); 218 int shClSvcMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool fWait); 219 int shClSvcMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 220 221 int shClSvcClientInit(PSHCLCLIENT pClient, uint32_t uClientID); 222 void shClSvcClientDestroy(PSHCLCLIENT pClient); 223 void shClSvcClientReset(PSHCLCLIENT pClient); 224 225 int shClSvcClientStateInit(PSHCLCLIENTSTATE pClientState, uint32_t uClientID); 226 int shClSvcClientStateDestroy(PSHCLCLIENTSTATE pClientState); 225 227 void shclSvcClientStateReset(PSHCLCLIENTSTATE pClientState); 226 228 227 int sh clSvcClientWakeup(PSHCLCLIENT pClient);229 int shClSvcClientWakeup(PSHCLCLIENT pClient); 228 230 229 231 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS … … 232 234 int shClSvcTransferStop(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); 233 235 bool shClSvcTransferMsgIsAllowed(uint32_t uMode, uint32_t uMsg); 234 void sh clSvcClientTransfersReset(PSHCLCLIENT pClient);236 void shClSvcClientTransfersReset(PSHCLCLIENT pClient); 235 237 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 236 238 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r81698 r81820 65 65 * @param pClient Client to reset transfers for. 66 66 */ 67 void sh clSvcClientTransfersReset(PSHCLCLIENT pClient)67 void shClSvcClientTransfersReset(PSHCLCLIENT pClient) 68 68 { 69 69 if (!pClient) … … 120 120 int rc; 121 121 122 PSHCLCLIENTMSG pMsgHdr = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ,122 PSHCLCLIENTMSG pMsgHdr = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ, 123 123 VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ_REQ); 124 124 if (pMsgHdr) … … 130 130 HGCMSvcSetU32(&pMsgHdr->paParms[1], 0 /* fRoots */); 131 131 132 rc = sh clSvcMsgAdd(pClient, pMsgHdr, true /* fAppend */);132 rc = shClSvcMsgAdd(pClient, pMsgHdr, true /* fAppend */); 133 133 if (RT_SUCCESS(rc)) 134 134 { … … 136 136 AssertRC(rc2); 137 137 138 rc = sh clSvcClientWakeup(pClient);138 rc = shClSvcClientWakeup(pClient); 139 139 if (RT_SUCCESS(rc)) 140 140 { … … 161 161 for (uint32_t i = 0; i < pSrcRootListHdr->cRoots; i++) 162 162 { 163 PSHCLCLIENTMSG pMsgEntry = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ,163 PSHCLCLIENTMSG pMsgEntry = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ, 164 164 VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ); 165 165 … … 175 175 AssertRC(rc2); 176 176 177 rc = sh clSvcMsgAdd(pClient, pMsgEntry, true /* fAppend */);177 rc = shClSvcMsgAdd(pClient, pMsgEntry, true /* fAppend */); 178 178 if (RT_FAILURE(rc)) 179 179 break; … … 239 239 int rc; 240 240 241 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN,241 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN, 242 242 VBOX_SHCL_CPARMS_LIST_OPEN); 243 243 if (pMsg) … … 251 251 if (RT_SUCCESS(rc)) 252 252 { 253 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);253 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 254 254 if (RT_SUCCESS(rc)) 255 255 { … … 257 257 AssertRC(rc2); 258 258 259 rc = sh clSvcClientWakeup(pClient);259 rc = shClSvcClientWakeup(pClient); 260 260 if (RT_SUCCESS(rc)) 261 261 { … … 299 299 int rc; 300 300 301 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE,301 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE, 302 302 VBOX_SHCL_CPARMS_LIST_CLOSE); 303 303 if (pMsg) … … 311 311 if (RT_SUCCESS(rc)) 312 312 { 313 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);313 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 314 314 if (RT_SUCCESS(rc)) 315 315 { … … 317 317 AssertRC(rc2); 318 318 319 rc = sh clSvcClientWakeup(pClient);319 rc = shClSvcClientWakeup(pClient); 320 320 if (RT_SUCCESS(rc)) 321 321 { … … 347 347 int rc; 348 348 349 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ,349 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ, 350 350 VBOX_SHCL_CPARMS_LIST_HDR_READ_REQ); 351 351 if (pMsg) … … 358 358 HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */); 359 359 360 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);360 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 361 361 if (RT_SUCCESS(rc)) 362 362 { … … 364 364 AssertRC(rc2); 365 365 366 rc = sh clSvcClientWakeup(pClient);366 rc = shClSvcClientWakeup(pClient); 367 367 if (RT_SUCCESS(rc)) 368 368 { … … 408 408 int rc; 409 409 410 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ,410 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ, 411 411 VBOX_SHCL_CPARMS_LIST_ENTRY_READ); 412 412 if (pMsg) … … 419 419 HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fInfo */); 420 420 421 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);421 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 422 422 if (RT_SUCCESS(rc)) 423 423 { … … 425 425 AssertRC(rc2); 426 426 427 rc = sh clSvcClientWakeup(pClient);427 rc = shClSvcClientWakeup(pClient); 428 428 if (RT_SUCCESS(rc)) 429 429 { … … 468 468 int rc; 469 469 470 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN,470 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN, 471 471 VBOX_SHCL_CPARMS_OBJ_OPEN); 472 472 if (pMsg) … … 485 485 HGCMSvcSetU32(&pMsg->paParms[4], pCreateParms->fCreate); 486 486 487 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);487 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 488 488 if (RT_SUCCESS(rc)) 489 489 { … … 491 491 AssertRC(rc2); 492 492 493 rc = sh clSvcClientWakeup(pClient);493 rc = shClSvcClientWakeup(pClient); 494 494 if (RT_SUCCESS(rc)) 495 495 { … … 530 530 int rc; 531 531 532 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE,532 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE, 533 533 VBOX_SHCL_CPARMS_OBJ_CLOSE); 534 534 if (pMsg) … … 540 540 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 541 541 542 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);542 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 543 543 if (RT_SUCCESS(rc)) 544 544 { … … 546 546 AssertRC(rc2); 547 547 548 rc = sh clSvcClientWakeup(pClient);548 rc = shClSvcClientWakeup(pClient); 549 549 if (RT_SUCCESS(rc)) 550 550 { … … 586 586 int rc; 587 587 588 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ,588 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ, 589 589 VBOX_SHCL_CPARMS_OBJ_READ_REQ); 590 590 if (pMsg) … … 598 598 HGCMSvcSetU32(&pMsg->paParms[3], fFlags); 599 599 600 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);600 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 601 601 if (RT_SUCCESS(rc)) 602 602 { … … 604 604 AssertRC(rc2); 605 605 606 rc = sh clSvcClientWakeup(pClient);606 rc = shClSvcClientWakeup(pClient); 607 607 if (RT_SUCCESS(rc)) 608 608 { … … 645 645 int rc; 646 646 647 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE,647 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE, 648 648 VBOX_SHCL_CPARMS_OBJ_WRITE); 649 649 if (pMsg) … … 657 657 HGCMSvcSetU64(&pMsg->paParms[3], fFlags); 658 658 659 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);659 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 660 660 if (RT_SUCCESS(rc)) 661 661 { … … 663 663 AssertRC(rc2); 664 664 665 rc = sh clSvcClientWakeup(pClient);665 rc = shClSvcClientWakeup(pClient); 666 666 if (RT_SUCCESS(rc)) 667 667 { … … 1956 1956 /* puEvent is optional. */ 1957 1957 1958 PSHCLCLIENTMSG pMsgReadData = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_STATUS,1958 PSHCLCLIENTMSG pMsgReadData = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_STATUS, 1959 1959 VBOX_SHCL_CPARMS_TRANSFER_STATUS); 1960 1960 if (!pMsgReadData) … … 1970 1970 HGCMSvcSetU32(&pMsgReadData->paParms[4], 0 /* fFlags, unused */); 1971 1971 1972 int rc = sh clSvcMsgAdd(pClient, pMsgReadData, true /* fAppend */);1972 int rc = shClSvcMsgAdd(pClient, pMsgReadData, true /* fAppend */); 1973 1973 if (RT_SUCCESS(rc)) 1974 1974 { … … 1976 1976 if (RT_SUCCESS(rc)) 1977 1977 { 1978 rc = sh clSvcClientWakeup(pClient);1978 rc = shClSvcClientWakeup(pClient); 1979 1979 if (RT_SUCCESS(rc)) 1980 1980 { … … 2214 2214 AssertPtr(pClient); 2215 2215 2216 sh clSvcClientTransfersReset(pClient);2216 shClSvcClientTransfersReset(pClient); 2217 2217 2218 2218 ++itClient; -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.h
r80863 r81820 22 22 #endif 23 23 24 int sharedClipboardSvcTransferHandler(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE callHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival);25 int sharedClipboardSvcTransferHostHandler(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);26 27 int sharedClipboardSvcTransferAreaRegister(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer);28 int sharedClipboardSvcTransferAreaUnregister(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer);29 int sharedClipboardSvcTransferAreaAttach(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer, SHCLAREAID uID);30 int sharedClipboardSvcTransferAreaDetach(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer);31 32 24 #endif /* !VBOX_INCLUDED_SRC_SharedClipboard_VBoxSharedClipboardSvc_transfers_h */ 33 25 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp
r80847 r81820 96 96 */ 97 97 int SharedClipboardSvcImplFormatAnnounce(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 98 PSHCLFORMATDATA pFormats)98 PSHCLFORMATDATA pFormats) 99 99 { 100 100 RT_NOREF(pClient, pCmdCtx, pFormats); … … 111 111 */ 112 112 int SharedClipboardSvcImplReadData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 113 PSHCLDATABLOCK pData, uint32_t *pcbActual)113 PSHCLDATABLOCK pData, uint32_t *pcbActual) 114 114 { 115 115 RT_NOREF(pClient, pCmdCtx, pData); … … 122 122 123 123 int SharedClipboardSvcImplWriteData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, 124 PSHCLDATABLOCK pData)124 PSHCLDATABLOCK pData) 125 125 { 126 126 RT_NOREF(pClient, pCmdCtx, pData); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r81746 r81820 209 209 if (RT_SUCCESS(rc)) 210 210 { 211 rc = ClipRe questDataFromX11(pClient->State.pCtx->pBackend, pData->uFormat, pReq);211 rc = ClipReadDataFromX11(pClient->State.pCtx->pBackend, pData->uFormat, pReq); 212 212 if (RT_SUCCESS(rc)) 213 213 { … … 409 409 { 410 410 #endif 411 rc = ClipRe questDataFromX11(pClient->State.pCtx->pBackend, VBOX_SHCL_FMT_URI_LIST, pReq);411 rc = ClipReadDataFromX11(pClient->State.pCtx->pBackend, VBOX_SHCL_FMT_URI_LIST, pReq); 412 412 #if 0 413 413 if (RT_SUCCESS(rc)) -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r81769 r81820 336 336 * @param pClient Pointer to the client data structure to reset message queue for. 337 337 */ 338 void sh clSvcMsgQueueReset(PSHCLCLIENT pClient)338 void shClSvcMsgQueueReset(PSHCLCLIENT pClient) 339 339 { 340 340 LogFlowFuncEnter(); … … 354 354 * @param cParms Number of HGCM parameters to allocate. 355 355 */ 356 PSHCLCLIENTMSG sh clSvcMsgAlloc(uint32_t uMsg, uint32_t cParms)356 PSHCLCLIENTMSG shClSvcMsgAlloc(uint32_t uMsg, uint32_t cParms) 357 357 { 358 358 PSHCLCLIENTMSG pMsg = (PSHCLCLIENTMSG)RTMemAlloc(sizeof(SHCLCLIENTMSG)); … … 379 379 * The pointer will be invalid after calling this function. 380 380 */ 381 void sh clSvcMsgFree(PSHCLCLIENTMSG pMsg)381 void shClSvcMsgFree(PSHCLCLIENTMSG pMsg) 382 382 { 383 383 if (!pMsg) … … 400 400 * @remarks ASSUMES the parameters has been cleared by clientMsgPeek. 401 401 */ 402 void sh clSvcMsgSetPeekReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms)402 void shClSvcMsgSetPeekReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms) 403 403 { 404 404 Assert(cDstParms >= 2); … … 432 432 * This is needed for certain messages which need to stay around for more than one (guest) call. 433 433 */ 434 int sh clSvcMsgSetGetHostMsgOldReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms,434 int shClSvcMsgSetGetHostMsgOldReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms, 435 435 bool *pfRemove) 436 436 { … … 522 522 * @param fAppend Whether to append or prepend the message to the queue. 523 523 */ 524 int sh clSvcMsgAdd(PSHCLCLIENT pClient, PSHCLCLIENTMSG pMsg, bool fAppend)524 int shClSvcMsgAdd(PSHCLCLIENT pClient, PSHCLCLIENTMSG pMsg, bool fAppend) 525 525 { 526 526 AssertPtrReturn(pMsg, VERR_INVALID_POINTER); … … 545 545 * @param uClientID HGCM client ID to assign client to. 546 546 */ 547 int sh clSvcClientInit(PSHCLCLIENT pClient, uint32_t uClientID)547 int shClSvcClientInit(PSHCLCLIENT pClient, uint32_t uClientID) 548 548 { 549 549 AssertPtrReturn(pClient, VERR_INVALID_POINTER); … … 554 554 LogFlowFunc(("[Client %RU32]\n", pClient->State.uClientID)); 555 555 556 /* Create the client's own event source. */ 557 int rc = ShClEventSourceCreate(&pClient->Events, 0 /* ID, ignored */); 556 int rc = RTCritSectInit(&pClient->CritSect); 558 557 if (RT_SUCCESS(rc)) 559 558 { 560 LogFlowFunc(("[Client %RU32] Using event source %RU32\n", uClientID, pClient->Events.uID)); 561 562 /* Reset the client state. */ 563 shclSvcClientStateReset(&pClient->State); 564 565 /* (Re-)initialize the client state. */ 566 rc = shclSvcClientStateInit(&pClient->State, uClientID); 559 /* Create the client's own event source. */ 560 rc = ShClEventSourceCreate(&pClient->Events, 0 /* ID, ignored */); 561 if (RT_SUCCESS(rc)) 562 { 563 LogFlowFunc(("[Client %RU32] Using event source %RU32\n", uClientID, pClient->Events.uID)); 564 565 /* Reset the client state. */ 566 shclSvcClientStateReset(&pClient->State); 567 568 /* (Re-)initialize the client state. */ 569 rc = shClSvcClientStateInit(&pClient->State, uClientID); 567 570 568 571 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 569 if (RT_SUCCESS(rc))570 rc = ShClTransferCtxInit(&pClient->TransferCtx);572 if (RT_SUCCESS(rc)) 573 rc = ShClTransferCtxInit(&pClient->TransferCtx); 571 574 #endif 575 } 572 576 } 573 577 … … 577 581 578 582 /** 583 * Destroys a Shared Clipboard client. 584 * 585 * @param pClient Client to destroy. 586 */ 587 void shClSvcClientDestroy(PSHCLCLIENT pClient) 588 { 589 AssertPtrReturnVoid(pClient); 590 591 LogFlowFunc(("[Client %RU32]\n", pClient->State.uClientID)); 592 593 /* Make sure to send a quit message to the guest so that it can terminate gracefully. */ 594 if (pClient->Pending.uType) 595 { 596 if (pClient->Pending.cParms >= 2) 597 { 598 HGCMSvcSetU32(&pClient->Pending.paParms[0], VBOX_SHCL_HOST_MSG_QUIT); 599 HGCMSvcSetU32(&pClient->Pending.paParms[1], 0); 600 } 601 g_pHelpers->pfnCallComplete(pClient->Pending.hHandle, VINF_SUCCESS); 602 pClient->Pending.uType = 0; 603 } 604 605 ShClEventSourceDestroy(&pClient->Events); 606 607 shClSvcClientStateDestroy(&pClient->State); 608 609 int rc2 = RTCritSectDelete(&pClient->CritSect); 610 AssertRC(rc2); 611 612 ClipboardClientMap::iterator itClient = g_mapClients.find(pClient->State.uClientID); 613 if (itClient != g_mapClients.end()) 614 { 615 g_mapClients.erase(itClient); 616 } 617 else 618 AssertFailed(); 619 620 LogFlowFuncLeave(); 621 } 622 623 /** 579 624 * Resets a Shared Clipboard client. 580 625 * 581 626 * @param pClient Client to reset. 582 627 */ 583 void sh clSvcClientReset(PSHCLCLIENT pClient)628 void shClSvcClientReset(PSHCLCLIENT pClient) 584 629 { 585 630 if (!pClient) … … 589 634 590 635 /* Reset message queue. */ 591 sh clSvcMsgQueueReset(pClient);636 shClSvcMsgQueueReset(pClient); 592 637 593 638 /* Reset event source. */ … … 598 643 599 644 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 600 sh clSvcClientTransfersReset(pClient);645 shClSvcClientTransfersReset(pClient); 601 646 #endif 602 647 … … 618 663 * @param paParms Array of parameters. 619 664 */ 620 int sh clSvcClientReportFeatures(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall,665 int shClSvcClientReportFeatures(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, 621 666 uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 622 667 { … … 666 711 * @param paParms Array of parameters. 667 712 */ 668 int sh clSvcClientQueryFeatures(VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[])713 int shClSvcClientQueryFeatures(VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 669 714 { 670 715 /* … … 704 749 * immediately. 705 750 */ 706 int sh clSvcMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[],751 int shClSvcMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[], 707 752 bool fWait) 708 753 { … … 751 796 if (pFirstMsg) 752 797 { 753 sh clSvcMsgSetPeekReturn(pFirstMsg, paParms, cParms);798 shClSvcMsgSetPeekReturn(pFirstMsg, paParms, cParms); 754 799 LogFlowFunc(("[Client %RU32] VBOX_SHCL_GUEST_FN_MSG_PEEK_XXX -> VINF_SUCCESS (idMsg=%u (%s), cParms=%u)\n", 755 800 pClient->State.uClientID, pFirstMsg->uMsg, ShClHostMsgToStr(pFirstMsg->uMsg), … … 793 838 * @param paParms Array of parameters. 794 839 */ 795 int sh clSvcMsgGetOld(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[])840 int shClSvcMsgGetOld(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 796 841 { 797 842 int rc; … … 818 863 819 864 bool fRemove; 820 rc = sh clSvcMsgSetGetHostMsgOldReturn(pFirstMsg, paParms, cParms, &fRemove);865 rc = shClSvcMsgSetGetHostMsgOldReturn(pFirstMsg, paParms, cParms, &fRemove); 821 866 if (RT_SUCCESS(rc)) 822 867 { … … 827 872 { 828 873 pClient->queueMsg.removeFirst(); 829 sh clSvcMsgFree(pFirstMsg);874 shClSvcMsgFree(pFirstMsg); 830 875 831 876 rc = VINF_HGCM_ASYNC_EXECUTE; /* The caller must not complete it. */ … … 871 916 * @param paParms Array of parameters. 872 917 */ 873 int sh clSvcMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[])918 int shClSvcMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 874 919 { 875 920 /* … … 961 1006 { 962 1007 pClient->queueMsg.removeFirst(); 963 sh clSvcMsgFree(pFirstMsg);1008 shClSvcMsgFree(pFirstMsg); 964 1009 } 965 1010 … … 986 1031 * @param pClient Client to wake up. 987 1032 */ 988 int sh clSvcClientWakeup(PSHCLCLIENT pClient)1033 int shClSvcClientWakeup(PSHCLCLIENT pClient) 989 1034 { 990 1035 int rc = VINF_NO_CHANGE; … … 1009 1054 if (pClient->Pending.uType == VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT) 1010 1055 { 1011 sh clSvcMsgSetPeekReturn(pFirstMsg, pClient->Pending.paParms, pClient->Pending.cParms);1056 shClSvcMsgSetPeekReturn(pFirstMsg, pClient->Pending.paParms, pClient->Pending.cParms); 1012 1057 fDonePending = true; 1013 1058 } … … 1015 1060 { 1016 1061 bool fRemove; 1017 rc = sh clSvcMsgSetGetHostMsgOldReturn(pFirstMsg, pClient->Pending.paParms, pClient->Pending.cParms,1062 rc = shClSvcMsgSetGetHostMsgOldReturn(pFirstMsg, pClient->Pending.paParms, pClient->Pending.cParms, 1018 1063 &fRemove); 1019 1064 if (RT_SUCCESS(rc)) … … 1024 1069 * remove the actual message from our queue right now. */ 1025 1070 pClient->queueMsg.removeFirst(); 1026 sh clSvcMsgFree(pFirstMsg);1071 shClSvcMsgFree(pFirstMsg); 1027 1072 } 1028 1073 … … 1074 1119 int rc; 1075 1120 1076 PSHCLCLIENTMSG pMsgReadData = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_READ_DATA,1121 PSHCLCLIENTMSG pMsgReadData = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_READ_DATA, 1077 1122 VBOX_SHCL_CPARMS_READ_DATA_REQ); 1078 1123 if (pMsgReadData) … … 1088 1133 HGCMSvcSetU32(&pMsgReadData->paParms[3], pClient->State.cbChunkSize); 1089 1134 1090 rc = sh clSvcMsgAdd(pClient, pMsgReadData, true /* fAppend */);1135 rc = shClSvcMsgAdd(pClient, pMsgReadData, true /* fAppend */); 1091 1136 if (RT_SUCCESS(rc)) 1092 1137 { … … 1094 1139 if (RT_SUCCESS(rc)) 1095 1140 { 1096 rc = sh clSvcClientWakeup(pClient);1141 rc = shClSvcClientWakeup(pClient); 1097 1142 if (RT_SUCCESS(rc)) 1098 1143 { … … 1157 1202 int rc; 1158 1203 1159 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(VBOX_SHCL_HOST_MSG_FORMATS_REPORT, 3);1204 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(VBOX_SHCL_HOST_MSG_FORMATS_REPORT, 3); 1160 1205 if (pMsg) 1161 1206 { … … 1167 1212 HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */); 1168 1213 1169 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);1214 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 1170 1215 if (RT_SUCCESS(rc)) 1171 1216 { … … 1185 1230 pClient->State.fFlags |= SHCLCLIENTSTATE_FLAGS_READ_ACTIVE; 1186 1231 1187 rc = sh clSvcClientWakeup(pClient);1232 rc = shClSvcClientWakeup(pClient); 1188 1233 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1189 1234 } … … 1464 1509 * @param pRc Where to store the received error code. 1465 1510 */ 1466 static int sh clSvcGetError(uint32_t cParms, VBOXHGCMSVCPARM paParms[], int *pRc)1511 static int shClSvcGetError(uint32_t cParms, VBOXHGCMSVCPARM paParms[], int *pRc) 1467 1512 { 1468 1513 AssertPtrReturn(paParms, VERR_INVALID_PARAMETER); … … 1537 1582 static DECLCALLBACK(int) svcDisconnect(void *, uint32_t u32ClientID, void *pvClient) 1538 1583 { 1584 RT_NOREF(u32ClientID); 1585 1539 1586 LogFunc(("u32ClientID=%RU32\n", u32ClientID)); 1540 1587 … … 1543 1590 1544 1591 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1545 sh clSvcClientTransfersReset(pClient);1592 shClSvcClientTransfersReset(pClient); 1546 1593 #endif 1547 1594 1548 1595 ShClSvcImplDisconnect(pClient); 1549 1596 1550 /* Make sure to send a quit message to the guest so that it can terminate gracefully. */ 1551 if (pClient->Pending.uType) 1552 { 1553 if (pClient->Pending.cParms >= 2) 1554 { 1555 HGCMSvcSetU32(&pClient->Pending.paParms[0], VBOX_SHCL_HOST_MSG_QUIT); 1556 HGCMSvcSetU32(&pClient->Pending.paParms[1], 0); 1557 } 1558 g_pHelpers->pfnCallComplete(pClient->Pending.hHandle, VINF_SUCCESS); 1559 pClient->Pending.uType = 0; 1560 } 1561 1562 shclSvcClientStateDestroy(&pClient->State); 1563 ShClEventSourceDestroy(&pClient->Events); 1564 1565 ClipboardClientMap::iterator itClient = g_mapClients.find(u32ClientID); 1566 if (itClient != g_mapClients.end()) 1567 { 1568 g_mapClients.erase(itClient); 1569 } 1570 else 1571 AssertFailed(); 1597 shClSvcClientDestroy(pClient); 1572 1598 1573 1599 return VINF_SUCCESS; … … 1581 1607 AssertPtr(pvClient); 1582 1608 1583 int rc = sh clSvcClientInit(pClient, u32ClientID);1609 int rc = shClSvcClientInit(pClient, u32ClientID); 1584 1610 if (RT_SUCCESS(rc)) 1585 1611 { … … 1639 1665 case VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD: 1640 1666 { 1641 rc = sh clSvcMsgGetOld(pClient, callHandle, cParms, paParms);1667 rc = shClSvcMsgGetOld(pClient, callHandle, cParms, paParms); 1642 1668 break; 1643 1669 } … … 1672 1698 case VBOX_SHCL_GUEST_FN_REPORT_FEATURES: 1673 1699 { 1674 rc = sh clSvcClientReportFeatures(pClient, callHandle, cParms, paParms);1700 rc = shClSvcClientReportFeatures(pClient, callHandle, cParms, paParms); 1675 1701 break; 1676 1702 } … … 1678 1704 case VBOX_SHCL_GUEST_FN_QUERY_FEATURES: 1679 1705 { 1680 rc = sh clSvcClientQueryFeatures(callHandle, cParms, paParms);1706 rc = shClSvcClientQueryFeatures(callHandle, cParms, paParms); 1681 1707 break; 1682 1708 } … … 1684 1710 case VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT: 1685 1711 { 1686 rc = sh clSvcMsgPeek(pClient, callHandle, cParms, paParms, false /*fWait*/);1712 rc = shClSvcMsgPeek(pClient, callHandle, cParms, paParms, false /*fWait*/); 1687 1713 break; 1688 1714 } … … 1690 1716 case VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT: 1691 1717 { 1692 rc = sh clSvcMsgPeek(pClient, callHandle, cParms, paParms, true /*fWait*/);1718 rc = shClSvcMsgPeek(pClient, callHandle, cParms, paParms, true /*fWait*/); 1693 1719 break; 1694 1720 } … … 1696 1722 case VBOX_SHCL_GUEST_FN_MSG_GET: 1697 1723 { 1698 rc = sh clSvcMsgGet(pClient, callHandle, cParms, paParms);1724 rc = shClSvcMsgGet(pClient, callHandle, cParms, paParms); 1699 1725 break; 1700 1726 } … … 1802 1828 shclSvcClientStateReset(&pClient->State); 1803 1829 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1804 sh clSvcClientTransfersReset(pClient);1830 shClSvcClientTransfersReset(pClient); 1805 1831 #endif 1806 1832 /** @todo Do we need to do anything else here? */ … … 1811 1837 { 1812 1838 int rcGuest; 1813 rc = sh clSvcGetError(cParms,paParms, &rcGuest);1839 rc = shClSvcGetError(cParms,paParms, &rcGuest); 1814 1840 if (RT_SUCCESS(rc)) 1815 1841 { … … 1819 1845 shclSvcClientStateReset(&pClient->State); 1820 1846 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1821 sh clSvcClientTransfersReset(pClient);1847 shClSvcClientTransfersReset(pClient); 1822 1848 #endif 1823 1849 } … … 1857 1883 * @param uClientID Client ID (HGCM) to use for this client state. 1858 1884 */ 1859 int sh clSvcClientStateInit(PSHCLCLIENTSTATE pClientState, uint32_t uClientID)1885 int shClSvcClientStateInit(PSHCLCLIENTSTATE pClientState, uint32_t uClientID) 1860 1886 { 1861 1887 LogFlowFuncEnter(); … … 1875 1901 * @param pClientState Client state to destroy. 1876 1902 */ 1877 int sh clSvcClientStateDestroy(PSHCLCLIENTSTATE pClientState)1903 int shClSvcClientStateDestroy(PSHCLCLIENTSTATE pClientState) 1878 1904 { 1879 1905 RT_NOREF(pClientState); … … 2230 2256 } 2231 2257 2232 rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);2258 rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 2233 2259 AssertRCReturn(rc, rc); 2234 2260 } -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r81451 r81820 129 129 static void testMsgAddOld(PSHCLCLIENT pClient, uint32_t uMsg, uint32_t uParm1) 130 130 { 131 PSHCLCLIENTMSG pMsg = sh clSvcMsgAlloc(uMsg, 2 /* cParms */); /* The old protocol (v0) has a fixed parameter count of 2. */131 PSHCLCLIENTMSG pMsg = shClSvcMsgAlloc(uMsg, 2 /* cParms */); /* The old protocol (v0) has a fixed parameter count of 2. */ 132 132 RTTESTI_CHECK_RETV(pMsg != NULL); 133 133 … … 135 135 HGCMSvcSetU32(&pMsg->paParms[1], uParm1); 136 136 137 int rc = sh clSvcMsgAdd(pClient, pMsg, true /* fAppend */);138 RTTESTI_CHECK_RC_OK(rc); 139 rc = sh clSvcClientWakeup(pClient);137 int rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */); 138 RTTESTI_CHECK_RC_OK(rc); 139 rc = shClSvcClientWakeup(pClient); 140 140 RTTESTI_CHECK_RC_OK(rc); 141 141 } … … 157 157 RTTESTI_CHECK_RC_OK(rc); 158 158 159 rc = sh clSvcClientInit(&g_Client, 1 /* clientId */);159 rc = shClSvcClientInit(&g_Client, 1 /* clientId */); 160 160 RTTESTI_CHECK_RC_OK(rc); 161 161 … … 176 176 177 177 RTTestISub("Testing one format, no waiting guest calls."); 178 sh clSvcClientReset(&g_Client);178 shClSvcClientReset(&g_Client); 179 179 testMsgAddOld(&g_Client, VBOX_SHCL_HOST_MSG_READ_DATA, VBOX_SHCL_FMT_HTML); 180 180 HGCMSvcSetU32(&parms[0], 0); … … 190 190 191 191 RTTestISub("Testing two formats, waiting guest call."); 192 sh clSvcClientReset(&g_Client);192 shClSvcClientReset(&g_Client); 193 193 HGCMSvcSetU32(&parms[0], 0); 194 194 HGCMSvcSetU32(&parms[1], 0); … … 210 210 211 211 RTTestISub("Testing two formats, no waiting guest calls."); 212 sh clSvcClientReset(&g_Client);212 shClSvcClientReset(&g_Client); 213 213 testMsgAddOld(&g_Client, VBOX_SHCL_HOST_MSG_READ_DATA, VBOX_SHCL_FMT_UNICODETEXT | VBOX_SHCL_FMT_HTML); 214 214 HGCMSvcSetU32(&parms[0], 0);
Note:
See TracChangeset
for help on using the changeset viewer.