VirtualBox

Changeset 75406 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Nov 12, 2018 7:49:08 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126548
Message:

VMMDev/HGCM: Added PDM interface + HGCM server helper for finding out if a command/call is being resubmitted on restore or not. This is handy for returning returning an async wait call to the guest upon restore. bugref:3544

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/HGCM.cpp

    r75385 r75406  
    132132        static DECLCALLBACK(void) svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc);
    133133        static DECLCALLBACK(void) svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId);
     134        static DECLCALLBACK(bool) svcHlpIsCallRestored(VBOXHGCMCALLHANDLE callHandle);
    134135
    135136    public:
     
    755756}
    756757
     758/**
     759 * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnCallComplete}
     760 */
    757761/* static */ DECLCALLBACK(void) HGCMService::svcHlpCallComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
    758762{
     
    773777}
    774778
     779/**
     780 * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnDisconnectClient}
     781 */
    775782/* static */ DECLCALLBACK(void) HGCMService::svcHlpDisconnectClient(void *pvInstance, uint32_t u32ClientId)
    776783{
     
    781788         pService->DisconnectClient(u32ClientId, true);
    782789     }
     790}
     791
     792/**
     793 * @interface_method_impl{VBOXHGCMSVCHELPERS,pfnIsCallRestored}
     794 */
     795/* static */ DECLCALLBACK(bool) HGCMService::svcHlpIsCallRestored(VBOXHGCMCALLHANDLE callHandle)
     796{
     797    HGCMMsgHeader *pMsgHdr = (HGCMMsgHeader *)(callHandle);
     798    AssertPtrReturn(pMsgHdr, false);
     799
     800    PVBOXHGCMCMD pCmd = pMsgHdr->pCmd;
     801    AssertPtrReturn(pCmd, false);
     802
     803    PPDMIHGCMPORT pHgcmPort = pMsgHdr->pHGCMPort;
     804    AssertPtrReturn(pHgcmPort, false);
     805
     806    return pHgcmPort->pfnIsCmdRestored(pHgcmPort, pCmd);
    783807}
    784808
     
    836860            m_svcHelpers.pvInstance          = this;
    837861            m_svcHelpers.pfnDisconnectClient = svcHlpDisconnectClient;
     862            m_svcHelpers.pfnIsCallRestored   = svcHlpIsCallRestored;
    838863
    839864            /* Execute the load request on the service thread. */
Note: See TracChangeset for help on using the changeset viewer.

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