Changeset 75894 in vbox
- Timestamp:
- Dec 3, 2018 12:07:43 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestControl/service.cpp
r75889 r75894 134 134 /** Array of HGCM parameters. */ 135 135 PVBOXHGCMSVCPARM mpParms; 136 /** Set if we detected the message skipping hack from r121400. */ 137 bool m_f60BetaHackInPlay; 136 138 137 139 HostCommand() … … 140 142 , mParmCount(0) 141 143 , mpParms(NULL) 144 , m_f60BetaHackInPlay(false) 142 145 { 143 146 RTListInit(&m_ListEntry); … … 472 475 /** Set if master. */ 473 476 bool m_fIsMaster; 477 /** Set if restored (needed for shutting legacy mode assert on non-masters). */ 478 bool m_fRestored; 474 479 475 480 /** Set if we've got a pending wait cancel. */ … … 489 494 , m_idSession(UINT32_MAX) 490 495 , m_fIsMaster(false) 496 , m_fRestored(false) 491 497 , m_fPendingCancel(false) 492 498 , m_enmIsPending((guestControl::eGuestFn)0) … … 503 509 , m_idSession(UINT32_MAX) 504 510 , m_fIsMaster(false) 511 , m_fRestored(false) 505 512 , m_fPendingCancel(false) 506 513 , m_enmIsPending((guestControl::eGuestFn)0) … … 652 659 Assert(pFirstCmd); 653 660 RTListNodeRemove(&pFirstCmd->m_ListEntry); 661 pFirstCmd->Delete(); 654 662 655 663 /* Reset state else. */ … … 896 904 uint32_t fRequestor, bool fRestoring); 897 905 static DECLCALLBACK(int) svcDisconnect(void *pvService, uint32_t idClient, void *pvClient); 898 static DECLCALLBACK(void) svcCall(void *pvService, VBOXHGCMCALLHANDLE callHandle, uint32_t idClient, void *pvClient,906 static DECLCALLBACK(void) svcCall(void *pvService, VBOXHGCMCALLHANDLE hCall, uint32_t idClient, void *pvClient, 899 907 uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival); 900 908 static DECLCALLBACK(int) svcHostCall(void *pvService, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); … … 915 923 int clientToMain(ClientState *pClient, uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 916 924 917 int clientMsgOldGet(ClientState *pClient, VBOXHGCMCALLHANDLE callHandle, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);925 int clientMsgOldGet(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 918 926 int clientMsgOldFilterSet(ClientState *pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 919 int clientMsgOldSkip(ClientState *pClient, uint32_t cParms);927 int clientMsgOldSkip(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms); 920 928 921 929 int hostCallback(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); … … 1088 1096 int GstCtrlService::clientMsgOldGet(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1089 1097 { 1090 ASSERT_GUEST(pClient->m_idSession != UINT32_MAX || pClient->m_fIsMaster );1098 ASSERT_GUEST(pClient->m_idSession != UINT32_MAX || pClient->m_fIsMaster || pClient->m_fRestored); 1091 1099 1092 1100 /* Use the current (inbound) connection. */ … … 1781 1789 uint32_t const fFlags = paParms[1].u.uint32; 1782 1790 1783 ASSERT_GUEST_RETURN(pClient->m_fIsMaster , VERR_ACCESS_DENIED);1791 ASSERT_GUEST_RETURN(pClient->m_fIsMaster || (m_fLegacyMode && pClient->m_idSession == UINT32_MAX), VERR_ACCESS_DENIED); 1784 1792 1785 1793 /* … … 1877 1885 * @return VBox status code. 1878 1886 * @param pClient The client state. 1887 * @param hCall The call handle for completing it. 1879 1888 * @param cParms Number of parameters. 1880 1889 */ 1881 int GstCtrlService::clientMsgOldSkip(ClientState *pClient, uint32_t cParms)1890 int GstCtrlService::clientMsgOldSkip(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms) 1882 1891 { 1883 1892 /* … … 1888 1897 /* 1889 1898 * Execute the request. 1890 */ 1891 if (!RTListIsEmpty(&pClient->m_HostCmdList)) 1892 pClient->OldDitchFirstHostCmd(); 1893 1894 LogFlowFunc(("[Client %RU32] Skipped current message - leagcy function\n", pClient->m_idClient)); 1899 * 1900 * Note! As it turns out the old and new skip should be mostly the same. The 1901 * pre-6.0 GAs (up to BETA3) has a hack which tries to issue a 1902 * VERR_NOT_SUPPORTED reply to unknown host requests, however the 5.2.x 1903 * and earlier GAs doesn't. We need old skip behavior only for the 6.0 1904 * beta GAs, nothing else. 1905 * So, we have to track whether they issued a MSG_REPLY or not. Wonderful. 1906 */ 1907 HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry); 1908 if (pFirstCmd) 1909 { 1910 uint32_t const idMsg = pFirstCmd->mMsgType; 1911 bool const f60BetaHackInPlay = pFirstCmd->m_f60BetaHackInPlay; 1912 int rc; 1913 if (!f60BetaHackInPlay) 1914 rc = clientMsgSkip(pClient, hCall, 0, NULL); 1915 else 1916 { 1917 RTListNodeRemove(&pFirstCmd->m_ListEntry); 1918 pFirstCmd->Delete(); 1919 rc = VINF_SUCCESS; 1920 } 1921 1922 /* Reset legacy message wait/get state: */ 1923 if (RT_SUCCESS(rc)) 1924 { 1925 pClient->mHostCmdRc = VINF_SUCCESS; 1926 pClient->mHostCmdTries = 0; 1927 pClient->mPeekCount = 0; 1928 } 1929 1930 LogFlowFunc(("[Client %RU32] Legacy message skipping: Skipped %u (%s)%s!\n", 1931 pClient->m_idClient, idMsg, GstCtrlHostFnName((eHostFn)idMsg), f60BetaHackInPlay ? " hack style" : "")); 1932 NOREF(idMsg); 1933 return rc; 1934 } 1935 LogFlowFunc(("[Client %RU32] Legacy message skipping: No messages pending!\n", pClient->m_idClient)); 1895 1936 return VINF_SUCCESS; 1896 1937 } … … 2012 2053 */ 2013 2054 case GUEST_MSG_REPLY: 2055 if (cParms >= 3 && paParms[2].u.uint32 == (uint32_t)VERR_NOT_SUPPORTED) 2056 { 2057 HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry); 2058 if (pFirstCmd && pFirstCmd->m_idContext == paParms[0].u.uint32) 2059 pFirstCmd->m_f60BetaHackInPlay = true; 2060 } 2061 RT_FALL_THROUGH(); 2014 2062 case GUEST_MSG_PROGRESS_UPDATE: 2015 2063 case GUEST_SESSION_NOTIFY: … … 2036 2084 case GUEST_MSG_SKIP_OLD: 2037 2085 LogFlowFunc(("[Client %RU32] GUEST_MSG_SKIP_OLD\n", idClient)); 2038 rc = pThis->clientMsgOldSkip(pClient, cParms);2086 rc = pThis->clientMsgOldSkip(pClient, hCall, cParms); 2039 2087 break; 2040 2088 … … 2315 2363 */ 2316 2364 } 2365 pClient->m_fRestored = true; 2317 2366 return VINF_SUCCESS; 2318 2367 }
Note:
See TracChangeset
for help on using the changeset viewer.

