VirtualBox

Changeset 7801 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 8, 2008 1:12:40 PM (17 years ago)
Author:
vboxsync
Message:

HGCM: Add user data pointer to HGCM service function table

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBFE/HGCM.cpp

    r6998 r7801  
    353353                    if (m_fntable.pfnUnload)
    354354                    {
    355                         m_fntable.pfnUnload ();
     355                        m_fntable.pfnUnload (m_fntable.pvService);
    356356                    }
    357357                }
     
    551551                if (pSvc->m_fntable.pfnUnload)
    552552                {
    553                     pSvc->m_fntable.pfnUnload ();
     553                    pSvc->m_fntable.pfnUnload (pSvc->m_fntable.pvService);
    554554                }
    555555
     
    568568                if (pClient)
    569569                {
    570                     rc = pSvc->m_fntable.pfnConnect (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
     570                    rc = pSvc->m_fntable.pfnConnect (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
    571571
    572572                    hgcmObjDereference (pClient);
     
    588588                if (pClient)
    589589                {
    590                     rc = pSvc->m_fntable.pfnDisconnect (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
     590                    rc = pSvc->m_fntable.pfnDisconnect (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
    591591
    592592                    hgcmObjDereference (pClient);
     
    609609                if (pClient)
    610610                {
    611                     pSvc->m_fntable.pfnCall ((VBOXHGCMCALLHANDLE)pMsg, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->u32Function, pMsg->cParms, pMsg->paParms);
     611                    pSvc->m_fntable.pfnCall (pSvc->m_fntable.pvService, (VBOXHGCMCALLHANDLE)pMsg, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->u32Function, pMsg->cParms, pMsg->paParms);
    612612
    613613                    hgcmObjDereference (pClient);
     
    625625                LogFlowFunc(("SVC_MSG_HOSTCALL u32Function = %d, cParms = %d, paParms = %p\n", pMsg->u32Function, pMsg->cParms, pMsg->paParms));
    626626
    627                 rc = pSvc->m_fntable.pfnHostCall (pMsg->u32Function, pMsg->cParms, pMsg->paParms);
     627                rc = pSvc->m_fntable.pfnHostCall (pSvc->m_fntable.pvService, pMsg->u32Function, pMsg->cParms, pMsg->paParms);
    628628            } break;
    629629
     
    640640                    if (pSvc->m_fntable.pfnLoadState)
    641641                    {
    642                         rc = pSvc->m_fntable.pfnLoadState (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
     642                        rc = pSvc->m_fntable.pfnLoadState (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
    643643                    }
    644644
     
    666666                    {
    667667                        g_fSaveState = true;
    668                         rc = pSvc->m_fntable.pfnSaveState (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
     668                        rc = pSvc->m_fntable.pfnSaveState (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
    669669                        g_fSaveState = false;
    670670                    }
     
    692692                    if (pSvc->m_fntable.pfnRegisterExtension)
    693693                    {
    694                         rc = pSvc->m_fntable.pfnRegisterExtension (pMsg->pfnExtension, pMsg->pvExtension);
     694                        rc = pSvc->m_fntable.pfnRegisterExtension (pSvc->m_fntable.pvService, pMsg->pfnExtension, pMsg->pvExtension);
    695695                    }
    696696                    else
     
    720720                    if (pSvc->m_fntable.pfnRegisterExtension)
    721721                    {
    722                         rc = pSvc->m_fntable.pfnRegisterExtension (NULL, NULL);
     722                        rc = pSvc->m_fntable.pfnRegisterExtension (pSvc->m_fntable.pvService, NULL, NULL);
    723723                    }
    724724                    else
  • trunk/src/VBox/HostServices/SharedClipboard/service.cpp

    r7165 r7801  
    242242}
    243243
    244 static DECLCALLBACK(int) svcUnload (void)
     244static DECLCALLBACK(int) svcUnload (void *)
    245245{
    246246    vboxClipboardDestroy ();
     
    253253 * to the guest side.
    254254 */
    255 static DECLCALLBACK(int) svcDisconnect (uint32_t u32ClientID, void *pvClient)
     255static DECLCALLBACK(int) svcDisconnect (void *, uint32_t u32ClientID, void *pvClient)
    256256{
    257257    VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;
     
    268268}
    269269
    270 static DECLCALLBACK(int) svcConnect (uint32_t u32ClientID, void *pvClient)
     270static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient)
    271271{
    272272    VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;
     
    279279        uint32_t u32ClientID = g_pClient->u32ClientID;
    280280
    281         svcDisconnect(u32ClientID, g_pClient);
     281        svcDisconnect(NULL, u32ClientID, g_pClient);
    282282        /* And free the resources in the hgcm subsystem. */
    283283        g_pHelpers->pfnDisconnectClient(g_pHelpers->pvInstance, u32ClientID);
     
    301301}
    302302
    303 static DECLCALLBACK(void) svcCall (VBOXHGCMCALLHANDLE callHandle,
     303static DECLCALLBACK(void) svcCall (void *,
     304                                   VBOXHGCMCALLHANDLE callHandle,
    304305                                   uint32_t u32ClientID,
    305306                                   void *pvClient,
     
    562563 * We differentiate between a function handler for the guest and one for the host.
    563564 */
    564 static DECLCALLBACK(int) svcHostCall (uint32_t u32Function,
     565static DECLCALLBACK(int) svcHostCall (void *,
     566                                      uint32_t u32Function,
    565567                                      uint32_t cParms,
    566568                                      VBOXHGCMSVCPARM paParms[])
     
    605607}
    606608
    607 static DECLCALLBACK(int) svcSaveState(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
     609static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
    608610{
    609611    /* If there are any pending requests, they must be completed here. Since
     
    638640}
    639641
    640 static DECLCALLBACK(int) svcLoadState(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
     642static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
    641643{
    642644    Log(("svcLoadState: u32ClientID = %d\n", u32ClientID));
     
    704706}
    705707
    706 static DECLCALLBACK(int) svcRegisterExtension(PFNHGCMSVCEXT pfnExtension, void *pvExtension)
     708static DECLCALLBACK(int) svcRegisterExtension(void *, PFNHGCMSVCEXT pfnExtension, void *pvExtension)
    707709{
    708710    LogFlowFunc(("pfnExtension = %p\n", pfnExtension));
     
    768770            ptable->pfnLoadState  = svcLoadState;
    769771            ptable->pfnRegisterExtension  = svcRegisterExtension;
     772            ptable->pvService     = NULL;
    770773
    771774            /* Service specific initialization. */
  • trunk/src/VBox/HostServices/SharedFolders/service.cpp

    r7429 r7801  
    7272static PPDMLED      pStatusLed = NULL;
    7373
    74 static DECLCALLBACK(int) svcUnload (void)
     74static DECLCALLBACK(int) svcUnload (void *)
    7575{
    7676    int rc = VINF_SUCCESS;
     
    8181}
    8282
    83 static DECLCALLBACK(int) svcConnect (uint32_t u32ClientID, void *pvClient)
     83static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient)
    8484{
    8585    int rc = VINF_SUCCESS;
     
    9393}
    9494
    95 static DECLCALLBACK(int) svcDisconnect (uint32_t u32ClientID, void *pvClient)
     95static DECLCALLBACK(int) svcDisconnect (void *, uint32_t u32ClientID, void *pvClient)
    9696{
    9797    int rc = VINF_SUCCESS;
     
    110110 *        as the contents of a shared folder might change in between save and restore.
    111111 */
    112 static DECLCALLBACK(int) svcSaveState(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
     112static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
    113113{
    114114    SHFLCLIENTDATA *pClient = (SHFLCLIENTDATA *)pvClient;
     
    167167}
    168168
    169 static DECLCALLBACK(int) svcLoadState(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
     169static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
    170170{
    171171    uint32_t        nrMappings;
     
    273273}
    274274
    275 static DECLCALLBACK(void) svcCall (VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     275static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    276276{
    277277    int rc = VINF_SUCCESS;
     
    10681068 * We differentiate between a function handler for the guest and one for the host. The guest is not allowed to add or remove mappings for obvious security reasons.
    10691069 */
    1070 static DECLCALLBACK(int) svcHostCall (uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     1070static DECLCALLBACK(int) svcHostCall (void *, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    10711071{
    10721072    int rc = VINF_SUCCESS;
     
    12221222}
    12231223
    1224 extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable)
     1224extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (void *, VBOXHGCMSVCFNTABLE *ptable)
    12251225{
    12261226    int rc = VINF_SUCCESS;
     
    12541254            ptable->pfnSaveState  = svcSaveState;
    12551255            ptable->pfnLoadState  = svcLoadState;
     1256            ptable->pvService     = NULL;
    12561257        }
    12571258
  • trunk/src/VBox/HostServices/SharedOpenGL/service.cpp

    r5999 r7801  
    2929
    3030
    31 static DECLCALLBACK(int) svcUnload (void)
     31static DECLCALLBACK(int) svcUnload (void *)
    3232{
    3333    int rc = VINF_SUCCESS;
     
    3939}
    4040
    41 static DECLCALLBACK(int) svcConnect (uint32_t u32ClientID, void *pvClient)
     41static DECLCALLBACK(int) svcConnect (void *, uint32_t u32ClientID, void *pvClient)
    4242{
    4343    int rc = VINF_SUCCESS;
     
    5252}
    5353
    54 static DECLCALLBACK(int) svcDisconnect (uint32_t u32ClientID, void *pvClient)
     54static DECLCALLBACK(int) svcDisconnect (void *, uint32_t u32ClientID, void *pvClient)
    5555{
    5656    int rc = VINF_SUCCESS;
     
    6767 * We can't save the OpenGL state, so there's not much to do. Perhaps we should invalidate the client id?
    6868 */
    69 static DECLCALLBACK(int) svcSaveState(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
     69static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
    7070{
    7171    VBOXOGLCTX *pClient = (VBOXOGLCTX *)pvClient;
     
    7979}
    8080
    81 static DECLCALLBACK(int) svcLoadState(uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
     81static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM)
    8282{
    8383    VBOXOGLCTX *pClient = (VBOXOGLCTX *)pvClient;
     
    9191}
    9292
    93 static DECLCALLBACK(void) svcCall (VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     93static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32_t u32ClientID, void *pvClient, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    9494{
    9595    int rc = VINF_SUCCESS;
     
    316316 * We differentiate between a function handler for the guest and one for the host. The guest is not allowed to add or remove mappings for obvious security reasons.
    317317 */
    318 static DECLCALLBACK(int) svcHostCall (uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     318static DECLCALLBACK(int) svcHostCall (void *, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    319319{
    320320    int rc = VINF_SUCCESS;
     
    375375            ptable->pfnSaveState  = svcSaveState;
    376376            ptable->pfnLoadState  = svcLoadState;
     377            ptable->pvService     = NULL;
    377378
    378379            vboxglGlobalInit();
  • trunk/src/VBox/Main/hgcm/HGCM.cpp

    r7761 r7801  
    294294                    if (m_fntable.pfnUnload)
    295295                    {
    296                         m_fntable.pfnUnload ();
     296                        m_fntable.pfnUnload (m_fntable.pvService);
    297297                    }
    298298                }
     
    492492                if (pSvc->m_fntable.pfnUnload)
    493493                {
    494                     pSvc->m_fntable.pfnUnload ();
     494                    pSvc->m_fntable.pfnUnload (pSvc->m_fntable.pvService);
    495495                }
    496496
     
    509509                if (pClient)
    510510                {
    511                     rc = pSvc->m_fntable.pfnConnect (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
     511                    rc = pSvc->m_fntable.pfnConnect (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
    512512
    513513                    hgcmObjDereference (pClient);
     
    529529                if (pClient)
    530530                {
    531                     rc = pSvc->m_fntable.pfnDisconnect (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
     531                    rc = pSvc->m_fntable.pfnDisconnect (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient));
    532532
    533533                    hgcmObjDereference (pClient);
     
    550550                if (pClient)
    551551                {
    552                     pSvc->m_fntable.pfnCall ((VBOXHGCMCALLHANDLE)pMsg, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->u32Function, pMsg->cParms, pMsg->paParms);
     552                    pSvc->m_fntable.pfnCall (pSvc->m_fntable.pvService, (VBOXHGCMCALLHANDLE)pMsg, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->u32Function, pMsg->cParms, pMsg->paParms);
    553553
    554554                    hgcmObjDereference (pClient);
     
    566566                LogFlowFunc(("SVC_MSG_HOSTCALL u32Function = %d, cParms = %d, paParms = %p\n", pMsg->u32Function, pMsg->cParms, pMsg->paParms));
    567567
    568                 rc = pSvc->m_fntable.pfnHostCall (pMsg->u32Function, pMsg->cParms, pMsg->paParms);
     568                rc = pSvc->m_fntable.pfnHostCall (pSvc->m_fntable.pvService, pMsg->u32Function, pMsg->cParms, pMsg->paParms);
    569569            } break;
    570570
     
    581581                    if (pSvc->m_fntable.pfnLoadState)
    582582                    {
    583                         rc = pSvc->m_fntable.pfnLoadState (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
     583                        rc = pSvc->m_fntable.pfnLoadState (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
    584584                    }
    585585
     
    607607                    {
    608608                        g_fSaveState = true;
    609                         rc = pSvc->m_fntable.pfnSaveState (pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
     609                        rc = pSvc->m_fntable.pfnSaveState (pSvc->m_fntable.pvService, pMsg->u32ClientId, HGCM_CLIENT_DATA(pSvc, pClient), pMsg->pSSM);
    610610                        g_fSaveState = false;
    611611                    }
     
    633633                    if (pSvc->m_fntable.pfnRegisterExtension)
    634634                    {
    635                         rc = pSvc->m_fntable.pfnRegisterExtension (pMsg->pfnExtension, pMsg->pvExtension);
     635                        rc = pSvc->m_fntable.pfnRegisterExtension (pSvc->m_fntable.pvService, pMsg->pfnExtension, pMsg->pvExtension);
    636636                    }
    637637                    else
     
    661661                    if (pSvc->m_fntable.pfnRegisterExtension)
    662662                    {
    663                         rc = pSvc->m_fntable.pfnRegisterExtension (NULL, NULL);
     663                        rc = pSvc->m_fntable.pfnRegisterExtension (pSvc->m_fntable.pvService, NULL, NULL);
    664664                    }
    665665                    else
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