Changeset 75773 in vbox
- Timestamp:
- Nov 27, 2018 2:14:41 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
include/VBox/HostServices/Service.h (modified) (1 diff)
-
include/VBox/hgcmsvc.h (modified) (4 diffs)
-
src/VBox/HostServices/GuestControl/service.cpp (modified) (1 diff)
-
src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp (modified) (2 diffs)
-
src/VBox/HostServices/GuestProperties/service.cpp (modified) (2 diffs)
-
src/VBox/HostServices/HostChannel/service.cpp (modified) (2 diffs)
-
src/VBox/HostServices/SharedClipboard/service.cpp (modified) (1 diff)
-
src/VBox/HostServices/SharedFolders/service.cpp (modified) (1 diff)
-
src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp (modified) (2 diffs)
-
src/VBox/Main/src-client/HGCM.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/Service.h
r75500 r75773 289 289 static DECLCALLBACK(int) svcConnect(void *pvService, 290 290 uint32_t u32ClientID, 291 void *pvClient) 292 { 291 void *pvClient, 292 uint32_t fRequestor, 293 bool fRestoring) 294 { 295 RT_NOREF(fRequestor, fRestoring); 293 296 AssertLogRelReturn(VALID_PTR(pvService), VERR_INVALID_PARAMETER); 294 297 LogFlowFunc(("pvService=%p, u32ClientID=%u, pvClient=%p\n", pvService, u32ClientID, pvClient)); -
trunk/include/VBox/hgcmsvc.h
r75771 r75773 70 70 * 6.1->6.2 Because pfnCallComplete starts returning a status code (VBox 6.0). 71 71 * 6.2->6.3 Because pfnGetRequestor was added (VBox 6.0). 72 * 6.3->6.4 Bacause pfnConnect got an additional parameter (VBox 6.0). 72 73 */ 73 74 #define VBOX_HGCM_SVC_VERSION_MAJOR (0x0006) 74 #define VBOX_HGCM_SVC_VERSION_MINOR (0x000 3)75 #define VBOX_HGCM_SVC_VERSION_MINOR (0x0004) 75 76 #define VBOX_HGCM_SVC_VERSION ((VBOX_HGCM_SVC_VERSION_MAJOR << 16) + VBOX_HGCM_SVC_VERSION_MINOR) 76 77 … … 455 456 456 457 /* The structure is used in separately compiled binaries so an explicit packing is required. */ 457 #pragma pack(1) /** @todo r=bird: The pragma pack(1) is not at all required!! */458 458 typedef struct VBOXHGCMSVCFNTABLE 459 459 { … … 484 484 485 485 /** Inform the service about a client connection. */ 486 DECLR3CALLBACKMEMBER(int, pfnConnect, (void *pvService, uint32_t u32ClientID, void *pvClient ));486 DECLR3CALLBACKMEMBER(int, pfnConnect, (void *pvService, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring)); 487 487 488 488 /** Inform the service that the client wants to disconnect. */ … … 514 514 /** @} */ 515 515 } VBOXHGCMSVCFNTABLE; 516 #pragma pack()517 516 518 517 -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r75757 r75773 985 985 static DECLCALLBACK(int) svcConnect(void *pvService, 986 986 uint32_t u32ClientID, 987 void *pvClient) 988 { 987 void *pvClient, 988 uint32_t fRequestor, bool fRestoring) 989 { 990 RT_NOREF(fRequestor, fRestoring); 989 991 AssertLogRelReturn(VALID_PTR(pvService), VERR_INVALID_PARAMETER); 990 992 SELF *pSelf = reinterpret_cast<SELF *>(pvService); -
trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
r75749 r75773 116 116 if (pCmd[i].fNeedsClient) 117 117 { 118 int client_rc = pTable->pfnConnect(pTable->pvService, 1000 /* Client ID */, NULL /* pvClient */ );118 int client_rc = pTable->pfnConnect(pTable->pvService, 1000 /* Client ID */, NULL /* pvClient */, 0, false); 119 119 if (RT_FAILURE(client_rc)) 120 120 rc = client_rc; … … 202 202 RTTestSub(g_hTest, "Testing client commands ..."); 203 203 204 int rc = pTable->pfnConnect(pTable->pvService, 1 /* Client ID */, NULL /* pvClient */ );204 int rc = pTable->pfnConnect(pTable->pvService, 1 /* Client ID */, NULL /* pvClient */, 0, false); 205 205 if (RT_SUCCESS(rc)) 206 206 { -
trunk/src/VBox/HostServices/GuestProperties/service.cpp
r75737 r75773 334 334 /** 335 335 * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnConnect} 336 * Stub implementation of pfnConnect. 337 */ 338 static DECLCALLBACK(int) svcConnect(void * /* pvService */, 339 uint32_t /* u32ClientID */, 340 void * /* pvClient */, 341 uint32_t /*fRequestor*/, 342 bool /*fRestoring*/) 343 { 344 return VINF_SUCCESS; 345 } 346 347 /** 348 * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnConnect} 336 349 * Stub implementation of pfnConnect and pfnDisconnect. 337 350 */ 338 static DECLCALLBACK(int) svc ConnectDisconnect(void * /* pvService */,339 uint32_t /* u32ClientID */,340 void * /* pvClient */)351 static DECLCALLBACK(int) svcDisconnect(void * /* pvService */, 352 uint32_t /* u32ClientID */, 353 void * /* pvClient */) 341 354 { 342 355 return VINF_SUCCESS; … … 1708 1721 1709 1722 ptable->pfnUnload = Service::svcUnload; 1710 ptable->pfnConnect = Service::svcConnect Disconnect;1711 ptable->pfnDisconnect = Service::svc ConnectDisconnect;1723 ptable->pfnConnect = Service::svcConnect; 1724 ptable->pfnDisconnect = Service::svcDisconnect; 1712 1725 ptable->pfnCall = Service::svcCall; 1713 1726 ptable->pfnHostCall = Service::svcHostCall; -
trunk/src/VBox/HostServices/HostChannel/service.cpp
r75500 r75773 181 181 } 182 182 183 static DECLCALLBACK(int) svcConnect(void *pvService, uint32_t u32ClientID, void *pvClient )184 { 185 RT_NOREF 1(pvService);183 static DECLCALLBACK(int) svcConnect(void *pvService, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring) 184 { 185 RT_NOREF(pvService, fRequestor, fRestoring); 186 186 VBOXHOSTCHCLIENT *pClient = (VBOXHOSTCHCLIENT *)pvClient; 187 188 int rc = VINF_SUCCESS;189 187 190 188 /* Register the client. */ … … 193 191 pClient->u32ClientID = u32ClientID; 194 192 195 rc = vboxHostChannelClientConnect(pClient);193 int rc = vboxHostChannelClientConnect(pClient); 196 194 197 195 LogRel2(("svcConnect: rc = %Rrc\n", rc)); -
trunk/src/VBox/HostServices/SharedClipboard/service.cpp
r75506 r75773 368 368 } 369 369 370 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient) 371 { 370 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring) 371 { 372 RT_NOREF(fRequestor, fRestoring); 372 373 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient; 373 374 -
trunk/src/VBox/HostServices/SharedFolders/service.cpp
r75506 r75773 154 154 } 155 155 156 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient )156 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring) 157 157 { 158 RT_NOREF 2(u32ClientID, pvClient);158 RT_NOREF(u32ClientID, pvClient, fRequestor, fRestoring); 159 159 int rc = VINF_SUCCESS; 160 160 -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r75500 r75773 111 111 } 112 112 113 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient )113 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring) 114 114 { 115 int rc = VINF_SUCCESS; 116 117 NOREF(pvClient); 115 RT_NOREF(pvClient, fRequestor, fRestoring); 118 116 119 117 if (g_u32fCrHgcmDisabled) … … 125 123 Log(("SHARED_CROPENGL svcConnect: u32ClientID = %d\n", u32ClientID)); 126 124 127 rc = crVBoxServerAddClient(u32ClientID);125 int rc = crVBoxServerAddClient(u32ClientID); 128 126 129 127 return rc; -
trunk/src/VBox/Main/src-client/HGCM.cpp
r75771 r75773 170 170 static int LoadState(PSSMHANDLE pSSM); 171 171 172 int CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn );172 int CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn, uint32_t fRequestor, bool fRestoring); 173 173 int DisconnectClient(uint32_t u32ClientId, bool fFromService); 174 174 … … 412 412 { 413 413 public: 414 /* client identifier */414 /** client identifier */ 415 415 uint32_t u32ClientId; 416 /** Requestor flags. */ 417 uint32_t fRequestor; 418 /** Set if restoring. */ 419 bool fRestoring; 416 420 }; 417 421 … … 434 438 PPDMIHGCMPORT pHGCMPort; 435 439 }; 436 437 440 438 441 class HGCMMsgCall: public HGCMMsgHeader … … 606 609 { 607 610 rc = pSvc->m_fntable.pfnConnect(pSvc->m_fntable.pvService, pMsg->u32ClientId, 608 HGCM_CLIENT_DATA(pSvc, pClient)); 611 HGCM_CLIENT_DATA(pSvc, pClient), 612 pMsg->fRequestor, pMsg->fRestoring); 609 613 610 614 hgcmObjDereference(pClient); … … 1423 1427 uint32_t u32ClientId; 1424 1428 rc = SSMR3GetU32(pSSM, &u32ClientId); 1429 uint32_t fRequestor = VMMDEV_REQUESTOR_LEGACY; /** @todo save/restore fRequestor. */ 1425 1430 if (RT_FAILURE(rc)) 1426 1431 { … … 1431 1436 1432 1437 /* Connect the client. */ 1433 rc = pSvc->CreateAndConnectClient(NULL, u32ClientId );1438 rc = pSvc->CreateAndConnectClient(NULL, u32ClientId, fRequestor, true /*fRestoring*/); 1434 1439 if (RT_FAILURE(rc)) 1435 1440 { … … 1460 1465 * If NULL, use the given 'u32ClientIdIn' handle. 1461 1466 * @param u32ClientIdIn The handle for the client, when 'pu32ClientIdOut' is NULL. 1462 * @return VBox rc. 1463 */ 1464 int HGCMService::CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn) 1465 { 1466 LogFlowFunc(("pu32ClientIdOut = %p, u32ClientIdIn = %d\n", pu32ClientIdOut, u32ClientIdIn)); 1467 * @param fRequestor The requestor flags, VMMDEV_REQUESTOR_LEGACY if not available. 1468 * @param fRestoring Set if we're restoring a saved state. 1469 * @return VBox status code. 1470 */ 1471 int HGCMService::CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn, uint32_t fRequestor, bool fRestoring) 1472 { 1473 LogFlowFunc(("pu32ClientIdOut = %p, u32ClientIdIn = %d, fRequestor = %#x, fRestoring = %d\n", 1474 pu32ClientIdOut, u32ClientIdIn, fRequestor, fRestoring)); 1467 1475 1468 1476 /* Allocate a client information structure. */ … … 1980 1988 { 1981 1989 /* Call the service instance method. */ 1982 rc = pService->CreateAndConnectClient(pMsg->pu32ClientId, 0); 1990 rc = pService->CreateAndConnectClient(pMsg->pu32ClientId, 1991 0, 1992 pMsg->pHGCMPort->pfnGetRequestor(pMsg->pHGCMPort, pMsg->pCmd), 1993 pMsg->pHGCMPort->pfnIsCmdRestored(pMsg->pHGCMPort, pMsg->pCmd)); 1983 1994 1984 1995 /* Release the service after resolve. */
Note:
See TracChangeset
for help on using the changeset viewer.

