Changeset 82527 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray
- Timestamp:
- Dec 10, 2019 1:46:40 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r82525 r82527 93 93 94 94 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 95 95 96 /** 96 97 * Cleanup helper function for transfer callbacks. … … 218 219 vboxClipboardTransferCallbackCleanup(pData); 219 220 } 221 220 222 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 221 223 … … 559 561 Assert(pEvent->enmType == VBGLR3CLIPBOARDEVENTTYPE_READ_DATA); 560 562 561 const SHCLFORMAT fFormat = (uint32_t)pEvent->u. ReadData.uFmt;563 const SHCLFORMAT fFormat = (uint32_t)pEvent->u.fReadData; 562 564 563 565 HANDLE hClip = NULL; … … 991 993 int rc; 992 994 993 uint32_t uMsg;994 uint32_t uFormats;995 996 995 /* The thread waits for incoming messages from the host. */ 997 996 for (;;) 998 997 { 999 PVBGLR3CLIPBOARDEVENT pEvent = NULL;1000 1001 998 LogFlowFunc(("Waiting for host message (fUseLegacyProtocol=%RTbool, fHostFeatures=%#RX64) ...\n", 1002 999 pCtx->CmdCtx.fUseLegacyProtocol, pCtx->CmdCtx.fHostFeatures)); 1003 1000 1004 if (pCtx->CmdCtx.fUseLegacyProtocol) 1005 { 1006 rc = VbglR3ClipboardGetHostMsgOld(pCtx->CmdCtx.idClient, &uMsg, &uFormats); 1007 if (RT_FAILURE(rc)) 1008 { 1009 if (rc == VERR_INTERRUPTED) 1010 break; 1011 1012 LogFunc(("Error getting host message, rc=%Rrc\n", rc)); 1013 } 1014 else 1015 { 1016 pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); 1017 AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY); 1018 1019 switch (uMsg) 1020 { 1021 case VBOX_SHCL_HOST_MSG_FORMATS_REPORT: 1022 { 1023 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS; 1024 pEvent->u.ReportedFormats.Formats = uFormats; 1025 break; 1026 } 1027 1028 case VBOX_SHCL_HOST_MSG_READ_DATA: 1029 { 1030 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_READ_DATA; 1031 pEvent->u.ReadData.uFmt = uFormats; 1032 break; 1033 } 1034 1035 case VBOX_SHCL_HOST_MSG_QUIT: 1036 { 1037 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_QUIT; 1038 break; 1039 } 1040 1041 default: 1042 rc = VERR_NOT_SUPPORTED; 1043 break; 1044 } 1045 1046 if (RT_SUCCESS(rc)) 1047 { 1048 /* Copy over our command context to the event. */ 1049 pEvent->cmdCtx = pCtx->CmdCtx; 1050 } 1051 } 1052 } 1053 else /* Host service has peeking for messages support. */ 1054 { 1055 pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); 1056 AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY); 1057 1058 uint32_t uMsg = 0; 1059 uint32_t cParms = 0; 1060 rc = VbglR3ClipboardMsgPeekWait(&pCtx->CmdCtx, &uMsg, &cParms, NULL /* pidRestoreCheck */); 1061 if (RT_SUCCESS(rc)) 1062 { 1063 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1064 rc = VbglR3ClipboardEventGetNextEx(uMsg, cParms, &pCtx->CmdCtx, &pCtx->TransferCtx, pEvent); 1001 PVBGLR3CLIPBOARDEVENT pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); 1002 AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY); 1003 1004 uint32_t idMsg = 0; 1005 uint32_t cParms = 0; 1006 rc = VbglR3ClipboardMsgPeekWait(&pCtx->CmdCtx, &idMsg, &cParms, NULL /* pidRestoreCheck */); 1007 if (RT_SUCCESS(rc)) 1008 { 1009 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1010 rc = VbglR3ClipboardEventGetNextEx(idMsg, cParms, &pCtx->CmdCtx, &pCtx->TransferCtx, pEvent); 1065 1011 #else 1066 rc = VbglR3ClipboardEventGetNext(uMsg, cParms, &pCtx->CmdCtx, pEvent); 1067 #endif 1068 } 1012 rc = VbglR3ClipboardEventGetNext(idMsg, cParms, &pCtx->CmdCtx, pEvent); 1013 #endif 1069 1014 } 1070 1015
Note:
See TracChangeset
for help on using the changeset viewer.