Changeset 6998 in vbox for trunk/src/VBox/Frontends/VBoxBFE
- Timestamp:
- Feb 18, 2008 4:12:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBFE/HGCM.cpp
r6967 r6998 30 30 #include <iprt/critsect.h> 31 31 #include <iprt/asm.h> 32 #include <iprt/ldr.h> 32 33 #include <iprt/param.h> 33 34 #include <iprt/path.h> 34 #include <iprt/ldr.h>35 35 #include <iprt/string.h> 36 36 #include <iprt/semaphore.h> … … 126 126 127 127 static DECLCALLBACK(void) svcHlpCallComplete (VBOXHGCMCALLHANDLE callHandle, int32_t rc); 128 128 static DECLCALLBACK(void) svcHlpDisconnectClient (void *pvInstance, uint32_t u32ClientId); 129 129 130 public: 130 131 … … 147 148 148 149 int CreateAndConnectClient (uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn); 149 int DisconnectClient (uint32_t u32ClientId );150 int DisconnectClient (uint32_t u32ClientId, bool fFromService); 150 151 151 152 int HostCall (uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM *paParms); … … 765 766 } 766 767 768 /* static */ DECLCALLBACK(void) HGCMService::svcHlpDisconnectClient (void *pvInstance, uint32_t u32ClientId) 769 { 770 HGCMService *pService = static_cast <HGCMService *> (pvInstance); 771 772 if (pService) 773 { 774 pService->DisconnectClient (u32ClientId, true); 775 } 776 } 777 767 778 static DECLCALLBACK(void) hgcmMsgCompletionCallback (int32_t result, HGCMMsgCore *pMsgCore) 768 779 { … … 812 823 { 813 824 /* Initialize service helpers table. */ 814 m_svcHelpers.pfnCallComplete = svcHlpCallComplete; 815 m_svcHelpers.pvInstance = this; 825 m_svcHelpers.pfnCallComplete = svcHlpCallComplete; 826 m_svcHelpers.pvInstance = this; 827 m_svcHelpers.pfnDisconnectClient = svcHlpDisconnectClient; 816 828 817 829 /* Execute the load request on the service thread. */ … … 1116 1128 { 1117 1129 LogFlowFunc(("handle %d\n", pSvc->m_paClientIds[0])); 1118 pSvc->DisconnectClient (pSvc->m_paClientIds[0] );1130 pSvc->DisconnectClient (pSvc->m_paClientIds[0], false); 1119 1131 } 1120 1132 … … 1375 1387 * @return VBox rc. 1376 1388 */ 1377 int HGCMService::DisconnectClient (uint32_t u32ClientId) 1378 { 1379 LogFlowFunc(("client id = %d\n", u32ClientId)); 1380 1381 /* Call the service. */ 1382 HGCMMSGHANDLE hMsg; 1383 1384 int rc = hgcmMsgAlloc (m_thread, &hMsg, SVC_MSG_DISCONNECT, hgcmMessageAllocSvc); 1385 1386 if (VBOX_SUCCESS(rc)) 1387 { 1388 HGCMMsgSvcDisconnect *pMsg = (HGCMMsgSvcDisconnect *)hgcmObjReference (hMsg, HGCMOBJ_MSG); 1389 AssertRelease(pMsg); 1390 1391 pMsg->u32ClientId = u32ClientId; 1392 1393 hgcmObjDereference (pMsg); 1394 1395 rc = hgcmMsgSend (hMsg); 1396 1389 int HGCMService::DisconnectClient (uint32_t u32ClientId, bool fFromService) 1390 { 1391 int rc = VINF_SUCCESS; 1392 1393 LogFlowFunc(("client id = %d, fFromService = %d\n", u32ClientId, fFromService)); 1394 1395 if (!fFromService) 1396 { 1397 /* Call the service. */ 1398 HGCMMSGHANDLE hMsg; 1399 1400 rc = hgcmMsgAlloc (m_thread, &hMsg, SVC_MSG_DISCONNECT, hgcmMessageAllocSvc); 1401 1402 if (VBOX_SUCCESS(rc)) 1403 { 1404 HGCMMsgSvcDisconnect *pMsg = (HGCMMsgSvcDisconnect *)hgcmObjReference (hMsg, HGCMOBJ_MSG); 1405 AssertRelease(pMsg); 1406 1407 pMsg->u32ClientId = u32ClientId; 1408 1409 hgcmObjDereference (pMsg); 1410 1411 rc = hgcmMsgSend (hMsg); 1412 } 1413 } 1414 1415 if (VBOX_SUCCESS (rc)) 1416 { 1397 1417 /* Remove the client id from the array in any case. */ 1398 1418 int i; … … 1730 1750 1731 1751 /* Call the service instance to disconnect the client. */ 1732 rc = pService->DisconnectClient (pMsg->u32ClientId );1752 rc = pService->DisconnectClient (pMsg->u32ClientId, false); 1733 1753 1734 1754 hgcmObjDereference (pClient);
Note:
See TracChangeset
for help on using the changeset viewer.