Changeset 75747 in vbox
- Timestamp:
- Nov 26, 2018 6:54:55 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126948
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/hgcmsvc.h
r75745 r75747 68 68 * this problem is already solved by service extension callbacks 69 69 * 5.1->6.1 Because pfnCall got a new parameter. Also new helpers. (VBox 6.0) 70 * 6.1->6.2 Because pfnCallComplete starts returning a status code (VBox 6.0). 70 71 */ 71 72 #define VBOX_HGCM_SVC_VERSION_MAJOR (0x0006) 72 #define VBOX_HGCM_SVC_VERSION_MINOR (0x000 1)73 #define VBOX_HGCM_SVC_VERSION_MINOR (0x0002) 73 74 #define VBOX_HGCM_SVC_VERSION ((VBOX_HGCM_SVC_VERSION_MAJOR << 16) + VBOX_HGCM_SVC_VERSION_MINOR) 74 75 … … 82 83 { 83 84 /** The service has processed the Call request. */ 84 DECLR3CALLBACKMEMBER( void, pfnCallComplete, (VBOXHGCMCALLHANDLE callHandle, int32_t rc));85 DECLR3CALLBACKMEMBER(int, pfnCallComplete, (VBOXHGCMCALLHANDLE callHandle, int32_t rc)); 85 86 86 87 void *pvInstance; -
trunk/src/VBox/Main/include/HGCMThread.h
r75740 r75747 123 123 /** Initialize threads. 124 124 * 125 * @return VBox error code125 * @return VBox status code. 126 126 */ 127 127 int hgcmThreadInit(void); … … 141 141 * NULL if no stats. 142 142 * 143 * @return VBox error code143 * @return VBox status code. 144 144 */ 145 145 int hgcmThreadCreate(HGCMThread **ppThread, const char *pszThreadName, PFNHGCMTHREAD pfnThread, void *pvUser, … … 151 151 * consumed. 152 152 * 153 * @return VBox error code153 * @return VBox status code. 154 154 */ 155 155 int hgcmThreadWait(HGCMThread *pThread); … … 162 162 * @param pfnNewMessage New message allocation callback. 163 163 * 164 * @return VBox error code164 * @return VBox status code. 165 165 */ 166 166 int hgcmMsgAlloc(HGCMThread *pThread, HGCMMsgCore **ppHandle, uint32_t u32MsgId, PFNHGCMNEWMSGALLOC pfnNewMessage); … … 171 171 * @param pfnCallback Message completion callback. 172 172 * 173 * @return VBox error code173 * @return VBox status code. 174 174 * @retval VINF_HGCM_ASYNC_EXECUTE on success. 175 175 * … … 184 184 * @param pMsg The message. Reference will be consumed! 185 185 * 186 * @return VBox error code186 * @return VBox status code. 187 187 * 188 188 * @thread any … … 196 196 * @param ppMsg Where to store returned message pointer. 197 197 * 198 * @return VBox error code198 * @return VBox status code. 199 199 * 200 200 * @thread worker thread … … 206 206 * 207 207 * @param pMsg Processed message pointer. 208 * @param result Result code, VBox erro code. 209 * 210 * @return VBox error code 208 * @param result Result code, VBox status code. 209 * 210 * @return Restricted set of VBox status codes when guest call message: 211 * @retval VINF_SUCCESS on success 212 * @retval VERR_CANCELLED if the request was cancelled. 213 * @retval VERR_ALREADY_RESET if the VM is resetting. 214 * @retval VERR_NOT_AVAILABLE if HGCM has been disconnected from the VMMDev 215 * (shouldn't happen). 211 216 * 212 217 * @thread worker thread 213 218 */ 214 voidhgcmMsgComplete(HGCMMsgCore *pMsg, int32_t result);219 int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t result); 215 220 216 221 -
trunk/src/VBox/Main/src-client/HGCM.cpp
r75740 r75747 139 139 ~HGCMService() {}; 140 140 141 static DECLCALLBACK( void)svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc);141 static DECLCALLBACK(int) svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc); 142 142 static DECLCALLBACK(void) svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId); 143 143 static DECLCALLBACK(bool) svcHlpIsCallRestored(VBOXHGCMCALLHANDLE callHandle); … … 796 796 * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnCallComplete} 797 797 */ 798 /* static */ DECLCALLBACK( void) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)798 /* static */ DECLCALLBACK(int) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc) 799 799 { 800 800 HGCMMsgCore *pMsgCore = (HGCMMsgCore *)callHandle; 801 801 802 if (pMsgCore->MsgId () == SVC_MSG_GUESTCALL) 803 { 804 /* Only call the completion for these messages. The helper 805 * is called by the service, and the service does not get 806 * any other messages. 807 */ 808 hgcmMsgComplete(pMsgCore, rc); 809 } 810 else 811 { 812 AssertFailed(); 813 } 802 /* Only call the completion for these messages. The helper 803 * is called by the service, and the service does not get 804 * any other messages. 805 */ 806 AssertMsgReturn(pMsgCore->MsgId() == SVC_MSG_GUESTCALL, ("%d\n", pMsgCore->MsgId()), VERR_WRONG_TYPE); 807 return hgcmMsgComplete(pMsgCore, rc); 814 808 } 815 809 -
trunk/src/VBox/Main/src-client/HGCMThread.cpp
r75601 r75747 147 147 int MsgGet(HGCMMsgCore **ppMsg); 148 148 int MsgPost(HGCMMsgCore *pMsg, PHGCMMSGCALLBACK pfnCallback, bool bWait); 149 voidMsgComplete(HGCMMsgCore *pMsg, int32_t result);149 int MsgComplete(HGCMMsgCore *pMsg, int32_t result); 150 150 }; 151 151 … … 554 554 } 555 555 556 voidHGCMThread::MsgComplete(HGCMMsgCore *pMsg, int32_t result)556 int HGCMThread::MsgComplete(HGCMMsgCore *pMsg, int32_t result) 557 557 { 558 558 LogFlow(("HGCMThread::MsgComplete: thread = %p, pMsg = %p\n", this, pMsg)); … … 561 561 AssertReleaseMsg((pMsg->m_fu32Flags & HGCM_MSG_F_IN_PROCESS) != 0, ("%p %x\n", pMsg, pMsg->m_fu32Flags)); 562 562 563 int rcRet = VINF_SUCCESS; 563 564 if (pMsg->m_pfnCallback) 564 565 { 565 566 /** @todo call callback with error code in MsgPost in case of errors */ 566 567 567 pMsg->m_pfnCallback(result, pMsg);568 569 LogFlow(("HGCMThread::MsgComplete: callback executed. pMsg = %p, thread = %p \n", pMsg, this));568 rcRet = pMsg->m_pfnCallback(result, pMsg); 569 570 LogFlow(("HGCMThread::MsgComplete: callback executed. pMsg = %p, thread = %p, rcRet = %Rrc\n", pMsg, this, rcRet)); 570 571 } 571 572 … … 616 617 } 617 618 } 619 620 return rcRet; 618 621 } 619 622 … … 737 740 } 738 741 739 voidhgcmMsgComplete(HGCMMsgCore *pMsg, int32_t u32Result)742 int hgcmMsgComplete(HGCMMsgCore *pMsg, int32_t u32Result) 740 743 { 741 744 LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p\n", pMsg)); 742 745 746 int rc; 743 747 if (pMsg) 744 pMsg->Thread()->MsgComplete(pMsg, u32Result); 745 746 747 LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rc = void\n", pMsg)); 748 rc = pMsg->Thread()->MsgComplete(pMsg, u32Result); 749 else 750 rc = VINF_SUCCESS; 751 752 LogFlow(("MAIN::hgcmMsgComplete: pMsg = %p, rc = %Rrc\n", pMsg, rc)); 753 return rc; 748 754 } 749 755
Note:
See TracChangeset
for help on using the changeset viewer.