VirtualBox

Changeset 75773 in vbox


Ignore:
Timestamp:
Nov 27, 2018 2:14:41 PM (6 years ago)
Author:
vboxsync
Message:

HGCM: Added fRequestor and fRestoring to VBOXHGCMSVCFNTABLE::pfnConnect. bugref:9105

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/Service.h

    r75500 r75773  
    289289    static DECLCALLBACK(int) svcConnect(void *pvService,
    290290                                        uint32_t u32ClientID,
    291                                         void *pvClient)
    292     {
     291                                        void *pvClient,
     292                                        uint32_t fRequestor,
     293                                        bool fRestoring)
     294    {
     295        RT_NOREF(fRequestor, fRestoring);
    293296        AssertLogRelReturn(VALID_PTR(pvService), VERR_INVALID_PARAMETER);
    294297        LogFlowFunc(("pvService=%p, u32ClientID=%u, pvClient=%p\n", pvService, u32ClientID, pvClient));
  • trunk/include/VBox/hgcmsvc.h

    r75771 r75773  
    7070 * 6.1->6.2 Because pfnCallComplete starts returning a status code (VBox 6.0).
    7171 * 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).
    7273 */
    7374#define VBOX_HGCM_SVC_VERSION_MAJOR (0x0006)
    74 #define VBOX_HGCM_SVC_VERSION_MINOR (0x0003)
     75#define VBOX_HGCM_SVC_VERSION_MINOR (0x0004)
    7576#define VBOX_HGCM_SVC_VERSION ((VBOX_HGCM_SVC_VERSION_MAJOR << 16) + VBOX_HGCM_SVC_VERSION_MINOR)
    7677
     
    455456
    456457/* 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!! */
    458458typedef struct VBOXHGCMSVCFNTABLE
    459459{
     
    484484
    485485    /** 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));
    487487
    488488    /** Inform the service that the client wants to disconnect. */
     
    514514    /** @} */
    515515} VBOXHGCMSVCFNTABLE;
    516 #pragma pack()
    517516
    518517
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r75757 r75773  
    985985    static DECLCALLBACK(int) svcConnect(void *pvService,
    986986                                        uint32_t u32ClientID,
    987                                         void *pvClient)
    988     {
     987                                        void *pvClient,
     988                                        uint32_t fRequestor, bool fRestoring)
     989    {
     990        RT_NOREF(fRequestor, fRestoring);
    989991        AssertLogRelReturn(VALID_PTR(pvService), VERR_INVALID_PARAMETER);
    990992        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
  • trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp

    r75749 r75773  
    116116            if (pCmd[i].fNeedsClient)
    117117            {
    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);
    119119                if (RT_FAILURE(client_rc))
    120120                    rc = client_rc;
     
    202202    RTTestSub(g_hTest, "Testing client commands ...");
    203203
    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);
    205205    if (RT_SUCCESS(rc))
    206206    {
  • trunk/src/VBox/HostServices/GuestProperties/service.cpp

    r75737 r75773  
    334334    /**
    335335     * @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}
    336349     * Stub implementation of pfnConnect and pfnDisconnect.
    337350     */
    338     static DECLCALLBACK(int) svcConnectDisconnect(void * /* pvService */,
    339                                                   uint32_t /* u32ClientID */,
    340                                                   void * /* pvClient */)
     351    static DECLCALLBACK(int) svcDisconnect(void * /* pvService */,
     352                                           uint32_t /* u32ClientID */,
     353                                           void * /* pvClient */)
    341354    {
    342355        return VINF_SUCCESS;
     
    17081721
    17091722                ptable->pfnUnload             = Service::svcUnload;
    1710                 ptable->pfnConnect            = Service::svcConnectDisconnect;
    1711                 ptable->pfnDisconnect         = Service::svcConnectDisconnect;
     1723                ptable->pfnConnect            = Service::svcConnect;
     1724                ptable->pfnDisconnect         = Service::svcDisconnect;
    17121725                ptable->pfnCall               = Service::svcCall;
    17131726                ptable->pfnHostCall           = Service::svcHostCall;
  • trunk/src/VBox/HostServices/HostChannel/service.cpp

    r75500 r75773  
    181181}
    182182
    183 static DECLCALLBACK(int) svcConnect(void *pvService, uint32_t u32ClientID, void *pvClient)
    184 {
    185     RT_NOREF1(pvService);
     183static DECLCALLBACK(int) svcConnect(void *pvService, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring)
     184{
     185    RT_NOREF(pvService, fRequestor, fRestoring);
    186186    VBOXHOSTCHCLIENT *pClient = (VBOXHOSTCHCLIENT *)pvClient;
    187 
    188     int rc = VINF_SUCCESS;
    189187
    190188    /* Register the client. */
     
    193191    pClient->u32ClientID = u32ClientID;
    194192
    195     rc = vboxHostChannelClientConnect(pClient);
     193    int rc = vboxHostChannelClientConnect(pClient);
    196194
    197195    LogRel2(("svcConnect: rc = %Rrc\n", rc));
  • trunk/src/VBox/HostServices/SharedClipboard/service.cpp

    r75506 r75773  
    368368}
    369369
    370 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient)
    371 {
     370static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring)
     371{
     372    RT_NOREF(fRequestor, fRestoring);
    372373    VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;
    373374
  • trunk/src/VBox/HostServices/SharedFolders/service.cpp

    r75506 r75773  
    154154}
    155155
    156 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient)
     156static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring)
    157157{
    158     RT_NOREF2(u32ClientID, pvClient);
     158    RT_NOREF(u32ClientID, pvClient, fRequestor, fRestoring);
    159159    int rc = VINF_SUCCESS;
    160160
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r75500 r75773  
    111111}
    112112
    113 static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient)
     113static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient, uint32_t fRequestor, bool fRestoring)
    114114{
    115     int rc = VINF_SUCCESS;
    116 
    117     NOREF(pvClient);
     115    RT_NOREF(pvClient, fRequestor, fRestoring);
    118116
    119117    if (g_u32fCrHgcmDisabled)
     
    125123    Log(("SHARED_CROPENGL svcConnect: u32ClientID = %d\n", u32ClientID));
    126124
    127     rc = crVBoxServerAddClient(u32ClientID);
     125    int rc = crVBoxServerAddClient(u32ClientID);
    128126
    129127    return rc;
  • trunk/src/VBox/Main/src-client/HGCM.cpp

    r75771 r75773  
    170170        static int LoadState(PSSMHANDLE pSSM);
    171171
    172         int CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn);
     172        int CreateAndConnectClient(uint32_t *pu32ClientIdOut, uint32_t u32ClientIdIn, uint32_t fRequestor, bool fRestoring);
    173173        int DisconnectClient(uint32_t u32ClientId, bool fFromService);
    174174
     
    412412{
    413413    public:
    414         /* client identifier */
     414        /** client identifier */
    415415        uint32_t u32ClientId;
     416        /** Requestor flags. */
     417        uint32_t fRequestor;
     418        /** Set if restoring. */
     419        bool fRestoring;
    416420};
    417421
     
    434438        PPDMIHGCMPORT pHGCMPort;
    435439};
    436 
    437440
    438441class HGCMMsgCall: public HGCMMsgHeader
     
    606609                {
    607610                    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);
    609613
    610614                    hgcmObjDereference(pClient);
     
    14231427            uint32_t u32ClientId;
    14241428            rc = SSMR3GetU32(pSSM, &u32ClientId);
     1429            uint32_t fRequestor = VMMDEV_REQUESTOR_LEGACY; /** @todo save/restore fRequestor. */
    14251430            if (RT_FAILURE(rc))
    14261431            {
     
    14311436
    14321437            /* Connect the client. */
    1433             rc = pSvc->CreateAndConnectClient(NULL, u32ClientId);
     1438            rc = pSvc->CreateAndConnectClient(NULL, u32ClientId, fRequestor, true /*fRestoring*/);
    14341439            if (RT_FAILURE(rc))
    14351440            {
     
    14601465 *                        If NULL, use the given 'u32ClientIdIn' handle.
    14611466 * @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 */
     1471int 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));
    14671475
    14681476    /* Allocate a client information structure. */
     
    19801988                {
    19811989                    /* 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));
    19831994
    19841995                    /* Release the service after resolve. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette