VirtualBox

Changeset 71596 in vbox for trunk/src


Ignore:
Timestamp:
Mar 31, 2018 9:23:46 PM (7 years ago)
Author:
vboxsync
Message:

DevVGA,VBoxVideo: Code cleanup in progress. bugref:9094

Location:
trunk/src/VBox
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp

    r71595 r71596  
    239239    ((_type*)(((uint8_t*)(_pCmd)) + VBOXMP_CRSHGSMICON_CMD_CMDBUF_OFFSET(_cBuffers)))
    240240#define VBOXMP_CRSHGSMICON_CMD_GET_CMDCTX(_pCmd, _cBuffers, _cbCmdBuf, _type)  \
    241     ((_type*)(((uint8_t*)(_pCmd)) +  VBOXMP_CRSHGSMICON_CMD_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
     241    ((_type RT_UNTRUSTED_VOLATILE_HOST *)(((uint8_t RT_UNTRUSTED_VOLATILE_HOST *)(_pCmd)) +  VBOXMP_CRSHGSMICON_CMD_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
    242242#define VBOXMP_CRSHGSMICON_CMD_GET_FROM_CMDCTX(_pCtx, _cBuffers, _cbCmdBuf, _type)  \
    243     ((_type*)(((uint8_t*)(_pCtx)) -  VBOXMP_CRSHGSMICON_CMD_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
     243    ((_type RT_UNTRUSTED_VOLATILE_HOST  *)(((uint8_t RT_UNTRUSTED_VOLATILE_HOST  *)(_pCtx)) -  VBOXMP_CRSHGSMICON_CMD_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
    244244#define VBOXMP_CRSHGSMICON_CMD_SIZE(_cBuffers, _cbCmdBuf, _cbCtx)  \
    245245    (VBOXMP_CRSHGSMICON_CMD_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf) + (_cbCtx))
     
    253253    (VBOXVDMACMD_BODY((_pDr), VBOXVDMACMD_CHROMIUM_CMD))
    254254#define VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(_pDr, _cBuffers, _type)  \
    255     ((_type*)(((uint8_t*)(_pDr)) + VBOXMP_CRSHGSMICON_DR_CMDBUF_OFFSET(_cBuffers)))
     255    ((_type RT_UNTRUSTED_VOLATILE_HOST *)(((uint8_t RT_UNTRUSTED_VOLATILE_HOST *)(_pDr)) + VBOXMP_CRSHGSMICON_DR_CMDBUF_OFFSET(_cBuffers)))
    256256#define VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(_pDr, _cBuffers, _cbCmdBuf, _type)  \
    257     ((_type*)(((uint8_t*)(_pDr)) +  VBOXMP_CRSHGSMICON_DR_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
     257    ((_type RT_UNTRUSTED_VOLATILE_HOST *)(((uint8_t RT_UNTRUSTED_VOLATILE_HOST *)(_pDr)) +  VBOXMP_CRSHGSMICON_DR_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
    258258#define VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(_pCtx, _cBuffers, _cbCmdBuf)  \
    259     ((VBOXVDMACMD*)(((uint8_t*)(_pCtx)) -  VBOXMP_CRSHGSMICON_DR_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
     259    ((VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *)(((uint8_t RT_UNTRUSTED_VOLATILE_HOST *)(_pCtx)) -  VBOXMP_CRSHGSMICON_DR_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf)))
    260260#define VBOXMP_CRSHGSMICON_DR_SIZE(_cBuffers, _cbCmdBuf, _cbCtx)  \
    261261    (VBOXMP_CRSHGSMICON_DR_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf) + (_cbCtx))
     
    298298typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc,
    299299                                                                               void RT_UNTRUSTED_VOLATILE_HOST *pvRx,
    300                                                                                uint32_t cbRx, void *pvCtx);
     300                                                                               uint32_t cbRx,
     301                                                                               void RT_UNTRUSTED_VOLATILE_HOST *pvCtx);
    301302typedef FNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION *PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION;
    302303
     
    308309    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    309310
    310     PVBOXMP_CRSHGSMITRANSPORT               pCon  = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
    311     PVBOXVDMACBUF_DR                        pDr   = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
    312     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr  = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    313     VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    314     const UINT                              cBuffers = 2;
     311    PVBOXMP_CRSHGSMITRANSPORT                               pCon  = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
     312    PVBOXVDMACBUF_DR                                        pDr   = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
     313    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST                 *pHdr  = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     314    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST    *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     315    const UINT                                              cBuffers = 2;
    315316    Assert(pBody->cBuffers == cBuffers);
    316317
    317     PVBOXMP_CRHGSMICMD_READ                 pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
    318     CRVBOXHGSMIREAD                        *pCmd    = &pWrData->Cmd;
    319     VBOXVDMACMD_CHROMIUM_BUFFER           *pBufCmd = &pBody->aBuffers[0];
     318    VBOXMP_CRHGSMICMD_READ RT_UNTRUSTED_VOLATILE_HOST      *pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
     319    CRVBOXHGSMIREAD RT_UNTRUSTED_VOLATILE_HOST             *pCmd    = &pWrData->Cmd;
     320    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0];
    320321    Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIREAD));
    321322
    322     CRVBOXHGSMIREAD                        *pWr = (CRVBOXHGSMIREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
    323     PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION)pBufCmd->u64GuestData;
    324     VBOXVDMACMD_CHROMIUM_BUFFER            *pRxBuf = &pBody->aBuffers[1];
    325     PVBOXMP_CRSHGSMICON_BUFDR               pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
    326     void RT_UNTRUSTED_VOLATILE_HOST        *pvRx = NULL;
    327     uint32_t                                cbRx = 0;
     323    CRVBOXHGSMIREAD RT_UNTRUSTED_VOLATILE_HOST             *pWr = (CRVBOXHGSMIREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
     324    PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION    pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION)pBufCmd->u64GuestData;
     325    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pRxBuf = &pBody->aBuffers[1];
     326    VBOXMP_CRSHGSMICON_BUFDR                               *pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
     327
     328    void RT_UNTRUSTED_VOLATILE_HOST                        *pvRx = NULL;
     329    uint32_t                                                cbRx = 0;
    328330
    329331    int rc = pDr->rc;
     
    349351    if (pfnCompletion)
    350352    {
    351         void *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_READ), void);
     353        void RT_UNTRUSTED_VOLATILE_HOST *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers,
     354                                                                                  sizeof(VBOXMP_CRHGSMICMD_READ), void);
    352355        pfnCompletion(pCon, rc, pvRx, cbRx, pvCtx);
    353356    }
     
    356359}
    357360
    358 static void* vboxMpCrShgsmiTransportCmdCreateReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, PVBOXVDMACBUF_DR pDr,
    359                                                        uint32_t cbDrData, PVBOXMP_CRSHGSMICON_BUFDR pWbDr,
    360                                                        PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION pfnCompletion,
    361                                                        uint32_t cbContextData)
     361static void RT_UNTRUSTED_VOLATILE_HOST *
     362vboxMpCrShgsmiTransportCmdCreateReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, PVBOXVDMACBUF_DR pDr,
     363                                          uint32_t cbDrData, PVBOXMP_CRSHGSMICON_BUFDR pWbDr,
     364                                          PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION pfnCompletion,
     365                                          uint32_t cbContextData)
    362366{
    363367    RT_NOREF(cbDrData);
    364368    const uint32_t cBuffers = 2;
    365369    const uint32_t cbCmd = VBOXMP_CRSHGSMICON_DR_SIZE(cBuffers, sizeof (VBOXMP_CRHGSMICMD_READ), cbContextData);
    366     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr    = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    367     VBOXVDMACMD_CHROMIUM_CMD               *pBody   = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    368     PVBOXMP_CRHGSMICMD_READ                 pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
    369     CRVBOXHGSMIREAD                        *pCmd    = &pWrData->Cmd;
     370    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST              *pHdr    = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     371    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST *pBody   = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     372    VBOXMP_CRHGSMICMD_READ RT_UNTRUSTED_VOLATILE_HOST   *pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
     373    CRVBOXHGSMIREAD RT_UNTRUSTED_VOLATILE_HOST          *pCmd    = &pWrData->Cmd;
    370374
    371375    if (cbCmd > cbContextData)
     
    393397    pCmd->iBuffer = 1;
    394398
    395     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];
     399    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0];
    396400    pBufCmd->offBuffer = vboxMpCrShgsmiTransportBufOffset(pCon, pCmd);
    397401    pBufCmd->cbBuffer = sizeof (*pCmd);
     
    405409    pBufCmd->u64GuestData = (uintptr_t)pWbDr;
    406410
    407     return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_READ), void);
     411    return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof(VBOXMP_CRHGSMICMD_READ), void);
    408412}
    409413
     
    417421{
    418422    PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion;
    419     void *pvContext;
     423    void RT_UNTRUSTED_VOLATILE_HOST *pvContext;
    420424
    421425} VBOXMP_CRHGSMICON_WRR_COMPLETION_CTX, *PVBOXMP_CRHGSMICON_WRR_COMPLETION_CTX;
     
    424428static DECLCALLBACK(void) vboxMpCrShgsmiTransportSendWriteReadReadRepostCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc,
    425429                                                                                   void RT_UNTRUSTED_VOLATILE_HOST *pvRx,
    426                                                                                    uint32_t cbRx, void *pvCtx)
     430                                                                                   uint32_t cbRx,
     431                                                                                   void RT_UNTRUSTED_VOLATILE_HOST *pvCtx)
    427432{
    428433    PVBOXMP_CRHGSMICON_WRR_COMPLETION_CTX pData = (PVBOXMP_CRHGSMICON_WRR_COMPLETION_CTX)pvCtx;
     
    439444    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    440445
    441     PVBOXMP_CRSHGSMITRANSPORT               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
    442     PVBOXVDMACBUF_DR                        pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
    443     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    444     VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     446    PVBOXMP_CRSHGSMITRANSPORT                               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
     447    PVBOXVDMACBUF_DR                                        pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
     448    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST                 *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     449    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST    *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    445450    const UINT cBuffers = 3;
    446451    Assert(pBody->cBuffers == cBuffers);
    447452
    448     PVBOXMP_CRHGSMICMD_WRITEREAD            pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
    449     CRVBOXHGSMIWRITEREAD                   *pCmd = &pWrData->Cmd;
    450     VBOXVDMACMD_CHROMIUM_BUFFER           *pBufCmd = &pBody->aBuffers[0];
    451     Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIWRITEREAD));
    452 
    453     CRVBOXHGSMIWRITEREAD                   *pWr = (CRVBOXHGSMIWRITEREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
    454     VBOXVDMACMD_CHROMIUM_BUFFER           *pRxBuf = &pBody->aBuffers[2];
    455     PVBOXMP_CRSHGSMICON_BUFDR               pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
     453    VBOXMP_CRHGSMICMD_WRITEREAD RT_UNTRUSTED_VOLATILE_HOST *pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
     454    CRVBOXHGSMIWRITEREAD RT_UNTRUSTED_VOLATILE_HOST        *pCmd = &pWrData->Cmd;
     455    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0];
     456    Assert(pBufCmd->cbBuffer == sizeof(CRVBOXHGSMIWRITEREAD));
     457
     458    CRVBOXHGSMIWRITEREAD RT_UNTRUSTED_VOLATILE_HOST        *pWr = (CRVBOXHGSMIWRITEREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
     459    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pRxBuf = &pBody->aBuffers[2];
     460    VBOXMP_CRSHGSMICON_BUFDR                               *pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
    456461    PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION)pBufCmd->u64GuestData;
    457     void RT_UNTRUSTED_VOLATILE_HOST        *pvRx = NULL;
    458     uint32_t                                cbRx = 0;
     462
     463    void RT_UNTRUSTED_VOLATILE_HOST                        *pvRx = NULL;
     464    uint32_t                                                cbRx = 0;
    459465
    460466    int rc = pDr->rc;
     
    471477        {
    472478            /* issue read */
    473             void *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITEREAD), void);
     479            void RT_UNTRUSTED_VOLATILE_HOST *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers,
     480                                                                                      sizeof(VBOXMP_CRHGSMICMD_WRITEREAD), void);
    474481            vboxMpCrShgsmiBufCacheFree(pCon, &pCon->WbDrCache, pWbDr);
    475             pWbDr =  vboxMpCrShgsmiBufCacheAlloc(pCon, &pCon->WbDrCache, pCmd->cbWriteback);
     482            pWbDr = vboxMpCrShgsmiBufCacheAlloc(pCon, &pCon->WbDrCache, pCmd->cbWriteback);
    476483            if (pWbDr)
    477484            {
     
    511518    if (pfnCompletion)
    512519    {
    513         void *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITEREAD), void);
     520        void RT_UNTRUSTED_VOLATILE_HOST *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers,
     521                                                                                  sizeof(VBOXMP_CRHGSMICMD_WRITEREAD), void);
    514522        pfnCompletion(pCon, rc, pvRx, cbRx, pvCtx);
    515523    }
     
    526534    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    527535
    528     PVBOXMP_CRSHGSMITRANSPORT               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
    529     PVBOXVDMACBUF_DR                        pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
    530     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    531     VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    532     const UINT                              cBuffers = 2;
     536    PVBOXMP_CRSHGSMITRANSPORT                               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
     537    PVBOXVDMACBUF_DR                                        pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
     538    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST                 *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     539    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST    *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     540    const UINT                                              cBuffers = 2;
    533541    Assert(pBody->cBuffers == cBuffers);
    534542
    535     PVBOXMP_CRHGSMICMD_WRITE                pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
    536     CRVBOXHGSMIWRITE                       *pCmd = &pWrData->Cmd;
    537     VBOXVDMACMD_CHROMIUM_BUFFER           *pBufCmd = &pBody->aBuffers[0];
     543    VBOXMP_CRHGSMICMD_WRITE RT_UNTRUSTED_VOLATILE_HOST     *pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
     544    CRVBOXHGSMIWRITE RT_UNTRUSTED_VOLATILE_HOST            *pCmd = &pWrData->Cmd;
     545    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0];
    538546    Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIWRITE));
    539547    PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION)pBufCmd->u64GuestData;
     
    555563    if (pfnCompletion)
    556564    {
    557         void *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITE), void);
     565        void RT_UNTRUSTED_VOLATILE_HOST *pvCtx = VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof(VBOXMP_CRHGSMICMD_WRITE), void);
    558566        pfnCompletion(pCon, rc, pvCtx);
    559567    }
     
    573581    const UINT cBuffers = 2;
    574582    Assert(pCmd->cBuffers == cBuffers);
    575     uint64_t*pu64Completion = VBOXMP_CRSHGSMICON_CMD_GET_CMDCTX(pCmd, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITE), uint64_t);
    576     PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION)(*pu64Completion);
     583    uint64_t RT_UNTRUSTED_VOLATILE_HOST *pu64Completion = VBOXMP_CRSHGSMICON_CMD_GET_CMDCTX(pCmd, cBuffers,
     584                                                                                            sizeof(VBOXMP_CRHGSMICMD_WRITE),
     585                                                                                            uint64_t);
     586    PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion
     587        = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION)*pu64Completion;
    577588
    578589    if (!RT_SUCCESS(rc))
     
    580591
    581592    if (pfnCompletion)
    582         pfnCompletion(pCon, rc, (void*)(pu64Completion+1));
    583 }
    584 
    585 void* VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer,
    586                                                      uint32_t cbBuffer,
    587                                                      PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion,
    588                                                      uint32_t cbContextData)
     593        pfnCompletion(pCon, rc, (void RT_UNTRUSTED_VOLATILE_HOST *)(pu64Completion + 1));
     594}
     595
     596void RT_UNTRUSTED_VOLATILE_HOST *
     597VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer,
     598                                               uint32_t cbBuffer,
     599                                               PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion,
     600                                               uint32_t cbContextData)
    589601{
    590602    const uint32_t cBuffers = 3;
     
    606618    }
    607619
    608     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    609     VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    610     PVBOXMP_CRHGSMICMD_WRITEREAD            pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
    611     CRVBOXHGSMIWRITEREAD                   *pCmd = &pWrData->Cmd;
     620    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST                 *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     621    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST    *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     622    VBOXMP_CRHGSMICMD_WRITEREAD RT_UNTRUSTED_VOLATILE_HOST *pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
     623    CRVBOXHGSMIWRITEREAD RT_UNTRUSTED_VOLATILE_HOST        *pCmd = &pWrData->Cmd;
    612624
    613625    pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR;
     
    630642    pCmd->cbWriteback = 0;
    631643
    632     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];
     644    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0];
    633645    pBufCmd->offBuffer = vboxVdmaCBufDrPtrOffset(&pDevExt->u.primary.Vdma, pCmd);
    634646    pBufCmd->cbBuffer = sizeof (*pCmd);
     
    648660    pBufCmd->u64GuestData = (uintptr_t)pWbDr;
    649661
    650     return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITEREAD), void);
    651 }
    652 
    653 static void * vboxMpCrShgsmiTransportCmdVbvaCreateWriteAsync(PVBOXMP_DEVEXT pDevExt, uint32_t u32ClientID, void *pvBuffer,
    654                                                              uint32_t cbBuffer,
    655                                                              PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion,
    656                                                              uint32_t cbContextData)
     662    return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof(VBOXMP_CRHGSMICMD_WRITEREAD), void);
     663}
     664
     665static void RT_UNTRUSTED_VOLATILE_HOST *
     666vboxMpCrShgsmiTransportCmdVbvaCreateWriteAsync(PVBOXMP_DEVEXT pDevExt, uint32_t u32ClientID, void *pvBuffer,
     667                                               uint32_t cbBuffer,
     668                                               PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion,
     669                                               uint32_t cbContextData)
    657670{
    658671    const uint32_t cBuffers = 2;
    659672    const uint32_t cbCmd = VBOXMP_CRSHGSMICON_CMD_SIZE(cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITE) + 8, cbContextData);
    660     VBOXCMDVBVA_CRCMD_CMD* pCmd = VBoxCmdVbvaConCmdAlloc(pDevExt, cbCmd);
     673    VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd = VBoxCmdVbvaConCmdAlloc(pDevExt, cbCmd);
    661674    if (!pCmd)
    662675    {
     
    667680    pCmd->cBuffers = cBuffers;
    668681
    669     PVBOXMP_CRHGSMICMD_WRITE pWrData = VBOXMP_CRSHGSMICON_CMD_GET_CMDBUF(pCmd, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
    670     CRVBOXHGSMIWRITE *pCmdWrite = &pWrData->Cmd;
     682    VBOXMP_CRHGSMICMD_WRITE RT_UNTRUSTED_VOLATILE_HOST *pWrData
     683        = VBOXMP_CRSHGSMICON_CMD_GET_CMDBUF(pCmd, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
     684    CRVBOXHGSMIWRITE RT_UNTRUSTED_VOLATILE_HOST *pCmdWrite = &pWrData->Cmd;
    671685
    672686    pCmdWrite->hdr.result      = VERR_WRONG_ORDER;
     
    676690    pCmdWrite->iBuffer = 1;
    677691
    678     VBOXCMDVBVA_CRCMD_BUFFER *pBufCmd = &pCmd->aBuffers[0];
     692    VBOXCMDVBVA_CRCMD_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pCmd->aBuffers[0];
    679693    pBufCmd->offBuffer = (VBOXCMDVBVAOFFSET)vboxMpCrShgsmiBufferOffset(pDevExt, pCmdWrite);
    680694    pBufCmd->cbBuffer = sizeof (*pCmdWrite);
     
    684698    pBufCmd->cbBuffer = cbBuffer;
    685699
    686     uint64_t*pu64Completion = VBOXMP_CRSHGSMICON_CMD_GET_CMDCTX(pCmd, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITE), uint64_t);
     700    uint64_t RT_UNTRUSTED_VOLATILE_HOST *pu64Completion = VBOXMP_CRSHGSMICON_CMD_GET_CMDCTX(pCmd, cBuffers,
     701                                                                                            sizeof(VBOXMP_CRHGSMICMD_WRITE),
     702                                                                                            uint64_t);
    687703    *pu64Completion = (uintptr_t)pfnCompletion;
    688704    return pu64Completion + 1;
    689705}
    690706
    691 void* vboxMpCrShgsmiTransportCmdVdmaCreateWriteAsync(PVBOXMP_DEVEXT pDevExt, uint32_t u32ClientID, void *pvBuffer,
    692                                                      uint32_t cbBuffer,
    693                                                      PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion,
    694                                                      uint32_t cbContextData)
     707void RT_UNTRUSTED_VOLATILE_HOST *
     708vboxMpCrShgsmiTransportCmdVdmaCreateWriteAsync(PVBOXMP_DEVEXT pDevExt, uint32_t u32ClientID, void *pvBuffer,
     709                                               uint32_t cbBuffer,
     710                                               PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion,
     711                                               uint32_t cbContextData)
    695712{
    696713    const uint32_t cBuffers = 2;
     
    703720    }
    704721
    705     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    706     VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    707     PVBOXMP_CRHGSMICMD_WRITE                pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
    708     CRVBOXHGSMIWRITE                       *pCmd = &pWrData->Cmd;
     722    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST              *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     723    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     724    VBOXMP_CRHGSMICMD_WRITE RT_UNTRUSTED_VOLATILE_HOST  *pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
     725    CRVBOXHGSMIWRITE RT_UNTRUSTED_VOLATILE_HOST         *pCmd = &pWrData->Cmd;
    709726
    710727    pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR;
     
    724741    pCmd->iBuffer = 1;
    725742
    726     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];
     743    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0];
    727744    pBufCmd->offBuffer = vboxVdmaCBufDrPtrOffset(&pDevExt->u.primary.Vdma, pCmd);
    728745    pBufCmd->cbBuffer = sizeof (*pCmd);
     
    736753    pBufCmd->u64GuestData = 0;
    737754
    738     return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITE), void);
    739 }
    740 
    741 void* VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer,
    742                                                 uint32_t cbBuffer,
    743                                                  PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion,
    744                                                  uint32_t cbContextData)
     755    return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof(VBOXMP_CRHGSMICMD_WRITE), void);
     756}
     757
     758void RT_UNTRUSTED_VOLATILE_HOST *
     759VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer,
     760                                           PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion,
     761                                           uint32_t cbContextData)
    745762{
    746763    PVBOXMP_DEVEXT pDevExt = pCon->pDevExt;
     
    751768}
    752769
    753 int VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
    754 {
    755     VBOXVDMACMD* pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3, sizeof (VBOXMP_CRHGSMICMD_WRITEREAD));
     770int VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
     771{
     772    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3,
     773                                                                                         sizeof(VBOXMP_CRHGSMICMD_WRITEREAD));
    756774    return vboxMpCrShgsmiTransportCmdSubmitDmaCmd(pCon, pHdr, vboxMpCrShgsmiTransportSendWriteReadAsyncCompletion);
    757775}
    758776
    759 static int vboxMpCrShgsmiTransportCmdVdmaSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
    760 {
    761     VBOXVDMACMD* pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_WRITE));
     777static int vboxMpCrShgsmiTransportCmdVdmaSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
     778{
     779    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 2, sizeof(VBOXMP_CRHGSMICMD_WRITE));
    762780    return vboxMpCrShgsmiTransportCmdSubmitDmaCmd(pCon, pHdr, vboxMpCrShgsmiTransportVdmaSendWriteAsyncCompletion);
    763781}
    764782
    765 static int vboxMpCrShgsmiTransportCmdVbvaSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
     783static int vboxMpCrShgsmiTransportCmdVbvaSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
    766784{
    767785    PVBOXMP_DEVEXT pDevExt = pCon->pDevExt;
    768     VBOXCMDVBVA_CRCMD_CMD* pCmd = VBOXMP_CRSHGSMICON_CMD_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_WRITE) + 8,
    769                                                                         VBOXCMDVBVA_CRCMD_CMD);
     786    VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd
     787        = VBOXMP_CRSHGSMICON_CMD_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_WRITE) + 8, VBOXCMDVBVA_CRCMD_CMD);
    770788    return VBoxCmdVbvaConCmdSubmitAsync(pDevExt, pCmd, vboxMpCrShgsmiTransportVbvaSendWriteAsyncCompletion, pCon);
    771789}
    772790
    773 int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
     791int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
    774792{
    775793    if (pCon->pDevExt->fCmdVbvaEnabled)
     
    778796}
    779797
    780 void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
     798void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
    781799{
    782800    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3,
     
    785803}
    786804
    787 static void vboxMpCrShgsmiTransportCmdVbvaTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
    788 {
    789     VBOXCMDVBVA_CRCMD_CMD* pCmd = VBOXMP_CRSHGSMICON_CMD_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_WRITE) + 8,
    790                                                                          VBOXCMDVBVA_CRCMD_CMD);
     805static void vboxMpCrShgsmiTransportCmdVbvaTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon,
     806                                                         void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
     807{
     808    VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd
     809        = VBOXMP_CRSHGSMICON_CMD_GET_FROM_CMDCTX(pvContext, 2, sizeof(VBOXMP_CRHGSMICMD_WRITE) + 8, VBOXCMDVBVA_CRCMD_CMD);
    791810    VBoxCmdVbvaConCmdFree(pCon->pDevExt, pCmd);
    792811}
    793812
    794 static void vboxMpCrShgsmiTransportCmdVdmaTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
    795 {
    796     VBOXVDMACMD* pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_WRITE));
     813static void vboxMpCrShgsmiTransportCmdVdmaTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon,
     814                                                         void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
     815{
     816    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 2, sizeof(VBOXMP_CRHGSMICMD_WRITE));
    797817    vboxMpCrShgsmiTransportCmdTermDmaCmd(pCon, pHdr);
    798818}
    799819
    800 void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
     820void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext)
    801821{
    802822    if (pCon->pDevExt->fCmdVbvaEnabled)
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h

    r71590 r71596  
    6464typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc,
    6565                                                                                    void RT_UNTRUSTED_VOLATILE_HOST *pvRx,
    66                                                                                     uint32_t cbRx, void *pvCtx);
     66                                                                                    uint32_t cbRx,
     67                                                                                    void RT_UNTRUSTED_VOLATILE_HOST *pvCtx);
    6768typedef FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION *PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION;
    6869
    69 typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void *pvCtx);
     70typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc,
     71                                                                                void RT_UNTRUSTED_VOLATILE_HOST *pvCtx);
    7072typedef FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION *PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION;
    7173
    7274int VBoxMpCrShgsmiTransportCreate(PVBOXMP_CRSHGSMITRANSPORT pCon, PVBOXMP_DEVEXT pDevExt);
    7375void VBoxMpCrShgsmiTransportTerm(PVBOXMP_CRSHGSMITRANSPORT pCon);
    74 void* VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer,
     76void RT_UNTRUSTED_VOLATILE_HOST *VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon,
     77        uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer,
    7578        PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, uint32_t cbContextData);
    76 void* VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer,
     79void RT_UNTRUSTED_VOLATILE_HOST *VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon,
     80        uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer,
    7781        PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion, uint32_t cbContextData);
    78 int VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext);
    79 int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext);
    80 void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext);
    81 void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext);
     82int VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext);
     83int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext);
     84void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext);
     85void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext);
    8286
    8387void RT_UNTRUSTED_VOLATILE_HOST *VBoxMpCrShgsmiTransportBufAlloc(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t cbBuffer);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r71595 r71596  
    13571357
    13581358    PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)pvContext;
    1359     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    1360     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD);
     1359    VBOXVDMACMD              RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     1360    VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD);
    13611361    UINT cBufs = pBody->cBuffers;
    13621362    for (UINT i = 0; i < cBufs; ++i)
    13631363    {
    1364         VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i];
     1364        VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[i];
    13651365        PVBOXVIDEOCM_ALLOC_REF pRef = (PVBOXVIDEOCM_ALLOC_REF)pBufCmd->u64GuestData;
    13661366        if (!pBufCmd->u32GuestData)
     
    14031403        pHdr->enmType = VBOXVDMACMD_TYPE_CHROMIUM_CMD;
    14041404        pHdr->u32CmdSpecific = 0;
    1405         VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD);
     1405
     1406        VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_HOST *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD);
    14061407        pBody->cBuffers = cBuffers;
    14071408        for (UINT i = 0; i < cBuffers; ++i)
    14081409        {
    1409             VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i];
     1410            VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[i];
    14101411            VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE *pBufInfo = &paBuffers[i];
    14111412            PVBOXVIDEOCM_ALLOC_REF pRef = vboxVideoAMgrCtxAllocRefAcquire(pContext, pBufInfo->hAlloc);
     
    14261427                for (UINT j = 0; j < i; ++j)
    14271428                {
    1428                     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmdJ = &pBody->aBuffers[j];
     1429                    VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmdJ = &pBody->aBuffers[j];
    14291430                    PVBOXVIDEOCM_ALLOC_REF pRefJ = (PVBOXVIDEOCM_ALLOC_REF)pBufCmdJ;
    14301431                    vboxVideoAMgrCtxAllocRefRelease(pRefJ);
     
    14531454            for (UINT i = 0; i < cBuffers; ++i)
    14541455            {
    1455                 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i];
     1456                VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[i];
    14561457                PVBOXVIDEOCM_ALLOC_REF pRef = (PVBOXVIDEOCM_ALLOC_REF)pBufCmd;
    14571458                vboxVideoAMgrCtxAllocRefRelease(pRef);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPShgsmi.cpp

    r71590 r71596  
    126126const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST *
    127127VBoxSHGSMICommandPrepAsynch(PVBOXSHGSMI pHeap, void RT_UNTRUSTED_VOLATILE_HOST *pvBuff,
    128                             PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags)
     128                            PFNVBOXSHGSMICMDCOMPLETION pfnCompletion,
     129                            void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion, uint32_t fFlags)
    129130{
    130131    fFlags &= ~VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPShgsmi.h

    r71590 r71596  
    4545const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST *
    4646    VBoxSHGSMICommandPrepAsynch(PVBOXSHGSMI pHeap, void RT_UNTRUSTED_VOLATILE_HOST *pvBuff,
    47                                 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion,  PVOID pvCompletion, uint32_t fFlags);
     47                                PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion,
     48                                uint32_t fFlags);
    4849const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST *
    4950    VBoxSHGSMICommandPrepAsynchIrq(PVBOXSHGSMI pHeap, void RT_UNTRUSTED_VOLATILE_HOST *pvBuff,
     
    6263/* allows getting VRAM offset of arbitrary pointer within the SHGSMI command
    6364 * if invalid pointer is passed in, behavior is undefined */
    64 DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandPtrOffset(const PVBOXSHGSMI pHeap, const void * pvPtr)
     65DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandPtrOffset(const PVBOXSHGSMI pHeap, const void RT_UNTRUSTED_VOLATILE_HOST *pvPtr)
    6566{
    66     return HGSMIPointerToOffset (&pHeap->Heap.area, (const HGSMIBUFFERHEADER *)pvPtr);
     67    return HGSMIPointerToOffset(&pHeap->Heap.area, (const HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HOST *)pvPtr);
    6768}
    6869
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVModes.cpp

    r71595 r71596  
    561561    PVBOXWDDMCHILDSTATUSCB pCtx = (PVBOXWDDMCHILDSTATUSCB)pvContext;
    562562    PVBOXVDMACBUF_DR pDr = pCtx->pDr;
    563     VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    564     VBOXVDMACMD_CHILD_STATUS_IRQ *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHILD_STATUS_IRQ);
     563    VBOXVDMACMD                  RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     564    VBOXVDMACMD_CHILD_STATUS_IRQ RT_UNTRUSTED_VOLATILE_HOST *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHILD_STATUS_IRQ);
    565565
    566566    vboxWddmChildStatusHandleRequest(pDevExt, pBody);
     
    593593        pHdr->enmType = VBOXVDMACMD_TYPE_CHILD_STATUS_IRQ;
    594594        pHdr->u32CmdSpecific = 0;
    595         PVBOXVDMACMD_CHILD_STATUS_IRQ pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHILD_STATUS_IRQ);
     595
     596        VBOXVDMACMD_CHILD_STATUS_IRQ RT_UNTRUSTED_VOLATILE_HOST *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHILD_STATUS_IRQ);
    596597        pBody->cInfos = 1;
    597598        if (iChild == D3DDDI_ID_ALL)
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp

    r71590 r71596  
    175175}
    176176
    177 static int vboxCmdVbvaCtlSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CTL * pCtl, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion)
     177static int vboxCmdVbvaCtlSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CTL RT_UNTRUSTED_VOLATILE_HOST *pCtl,
     178                                     FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion)
    178179{
    179180    const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBoxSHGSMICommandPrepAsynch(&pHGSMICtx->heapCtx, pCtl, pfnCompletion,
     
    13121313}
    13131314
    1314 VBOXCMDVBVA_CRCMD_CMD* vboxCmdVbvaConCmdAlloc(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, uint32_t cbCmd)
    1315 {
    1316     VBOXCMDVBVA_CTL_3DCTL_CMD *pCmd = (VBOXCMDVBVA_CTL_3DCTL_CMD*)vboxCmdVbvaCtlCreate(pHGSMICtx, sizeof (VBOXCMDVBVA_CTL_3DCTL_CMD) + cbCmd);
     1315static VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *vboxCmdVbvaConCmdAlloc(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, uint32_t cbCmd)
     1316{
     1317    VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd =
     1318        (VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *)vboxCmdVbvaCtlCreate(pHGSMICtx,
     1319                                                                                     sizeof(VBOXCMDVBVA_CTL_3DCTL_CMD) + cbCmd);
    13171320    if (!pCmd)
    13181321    {
     
    13301333    pCmd->Cmd.Cmd.u2.u32FenceID = 0;
    13311334
    1332     return (VBOXCMDVBVA_CRCMD_CMD*)(pCmd+1);
    1333 }
    1334 
    1335 void vboxCmdVbvaConCmdFree(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CRCMD_CMD *pCmd)
     1335    return (VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *)(pCmd + 1);
     1336}
     1337
     1338void vboxCmdVbvaConCmdFree(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd)
    13361339{
    13371340    VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = ((VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *)pCmd) - 1;
     
    13391342}
    13401343
    1341 int vboxCmdVbvaConSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CRCMD_CMD* pCmd, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion)
    1342 {
    1343     VBOXCMDVBVA_CTL_3DCTL_CMD *pHdr = ((VBOXCMDVBVA_CTL_3DCTL_CMD*)pCmd)-1;
     1344int vboxCmdVbvaConSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd,
     1345                              FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion)
     1346{
     1347    VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = ((VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *)pCmd)-1;
    13441348    return vboxCmdVbvaCtlSubmitAsync(pHGSMICtx, &pHdr->Hdr, pfnCompletion, pvCompletion);
    13451349}
    13461350
    1347 VBOXCMDVBVA_CRCMD_CMD* VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd)
     1351VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd)
    13481352{
    13491353    return vboxCmdVbvaConCmdAlloc(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, cbCmd);
    13501354}
    13511355
    1352 void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD *pCmd)
     1356void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd)
    13531357{
    13541358    vboxCmdVbvaConCmdFree(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, pCmd);
    13551359}
    13561360
    1357 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD* pCmd,
    1358                                  PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion)
     1361int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd,
     1362                                 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion)
    13591363{
    13601364    return vboxCmdVbvaConSubmitAsync(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, pCmd, pfnCompletion, pvCompletion);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h

    r71590 r71596  
    237237        uint32_t *pu32ClientID);
    238238int VBoxCmdVbvaConDisconnect(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, uint32_t u32ClientID);
    239 VBOXCMDVBVA_CRCMD_CMD* VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd);
    240 void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD* pCmd);
    241 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD* pCmd,
    242                                  PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion);
     239VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd);
     240void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd);
     241int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd,
     242                                 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion);
    243243int VBoxCmdVbvaConCmdCompletionData(void RT_UNTRUSTED_VOLATILE_HOST *pvCmd, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST **ppCmd);
    244244int VBoxCmdVbvaConCmdResize(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const uint32_t *pTargetMap, const POINT * pVScreenPos, uint16_t fFlags);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp

    r71590 r71596  
    315315} VBOXMP_VDMACR_WRITECOMPLETION, *PVBOXMP_VDMACR_WRITECOMPLETION;
    316316
    317 static DECLCALLBACK(void) vboxVdmaCrWriteCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void *pvCtx)
     317static DECLCALLBACK(void) vboxVdmaCrWriteCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void RT_UNTRUSTED_VOLATILE_HOST *pvCtx)
    318318{
    319319    RT_NOREF(rc);
    320320    PVBOXMP_VDMACR_WRITECOMPLETION pData = (PVBOXMP_VDMACR_WRITECOMPLETION)pvCtx;
    321     void* pvBufferToFree = pData->pvBufferToFree;
     321    void *pvBufferToFree = pData->pvBufferToFree;
    322322    if (pvBufferToFree)
    323323        VBoxMpCrShgsmiTransportBufFree(pCon, pvBufferToFree);
     
    328328typedef struct VBOXMP_VDMACR_WRITEREADCOMPLETION
    329329{
    330     void *pvBufferToFree;
    331     void *pvContext;
     330    void RT_UNTRUSTED_VOLATILE_HOST *pvBufferToFree;
     331    void RT_UNTRUSTED_VOLATILE_HOST *pvContext;
    332332} VBOXMP_VDMACR_WRITEREADCOMPLETION, *PVBOXMP_VDMACR_WRITEREADCOMPLETION;
    333333
    334 void vboxVdmaCrSubmitWriteReadAsyncGenericCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvCtx)
    335 {
    336     PVBOXMP_VDMACR_WRITEREADCOMPLETION pData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)pvCtx;
    337     void* pvBufferToFree = pData->pvBufferToFree;
     334void vboxVdmaCrSubmitWriteReadAsyncGenericCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvCtx)
     335{
     336    VBOXMP_VDMACR_WRITEREADCOMPLETION RT_UNTRUSTED_VOLATILE_HOST *pData
     337        = (VBOXMP_VDMACR_WRITEREADCOMPLETION RT_UNTRUSTED_VOLATILE_HOST *)pvCtx;
     338    void RT_UNTRUSTED_VOLATILE_HOST *pvBufferToFree = pData->pvBufferToFree;
    338339    if (pvBufferToFree)
    339340        VBoxMpCrShgsmiTransportBufFree(pCon, pvBufferToFree);
     
    342343}
    343344
    344 NTSTATUS vboxVdmaCrSubmitWriteReadAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID,
    345                                         PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, void *pvCompletion)
     345static NTSTATUS vboxVdmaCrSubmitWriteReadAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID,
     346                                               PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion,
     347                                               void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion)
    346348{
    347349    Assert(u32CrConClientID);
     
    352354    if (pvBuffer)
    353355    {
    354         PVBOXMP_VDMACR_WRITEREADCOMPLETION pvCompletionData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(&pDevExt->CrHgsmiTransport, u32CrConClientID, pvBuffer, cbBuffer,
    355                 pfnCompletion, sizeof (*pvCompletionData));
    356         if (pvCompletionData)
    357         {
    358             pvCompletionData->pvBufferToFree = pvPackBuffer;
    359             pvCompletionData->pvContext = pvCompletion;
    360             int rc = VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(&pDevExt->CrHgsmiTransport, pvCompletionData);
     356        VBOXMP_VDMACR_WRITEREADCOMPLETION RT_UNTRUSTED_VOLATILE_HOST *pCompletionData
     357            = (VBOXMP_VDMACR_WRITEREADCOMPLETION RT_UNTRUSTED_VOLATILE_HOST  *)
     358              VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(&pDevExt->CrHgsmiTransport, u32CrConClientID, pvBuffer, cbBuffer,
     359                                                             pfnCompletion, sizeof(*pCompletionData));
     360        if (pCompletionData)
     361        {
     362            pCompletionData->pvBufferToFree = pvPackBuffer;
     363            pCompletionData->pvContext = pvCompletion;
     364            int rc = VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(&pDevExt->CrHgsmiTransport, pCompletionData);
    361365            if (RT_SUCCESS(rc))
    362366            {
     
    365369            WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync failed, rc %d", rc));
    366370            Status = STATUS_UNSUCCESSFUL;
    367             VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(&pDevExt->CrHgsmiTransport, pvCompletionData);
     371            VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(&pDevExt->CrHgsmiTransport, pCompletionData);
    368372        }
    369373        else
     
    386390    if (pvBuffer)
    387391    {
    388         PVBOXMP_VDMACR_WRITECOMPLETION pvCompletionData = (PVBOXMP_VDMACR_WRITECOMPLETION)VBoxMpCrShgsmiTransportCmdCreateWriteAsync(&pDevExt->CrHgsmiTransport, u32CrConClientID, pvBuffer, cbBuffer,
    389                 vboxVdmaCrWriteCompletion, sizeof (*pvCompletionData));
    390         if (pvCompletionData)
    391         {
    392             pvCompletionData->pvBufferToFree = pvPackBuffer;
    393             int rc = VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(&pDevExt->CrHgsmiTransport, pvCompletionData);
     392        VBOXMP_VDMACR_WRITECOMPLETION RT_UNTRUSTED_VOLATILE_HOST *pCompletionData
     393            = (VBOXMP_VDMACR_WRITECOMPLETION RT_UNTRUSTED_VOLATILE_HOST *)
     394              VBoxMpCrShgsmiTransportCmdCreateWriteAsync(&pDevExt->CrHgsmiTransport, u32CrConClientID, pvBuffer, cbBuffer,
     395                                                         vboxVdmaCrWriteCompletion, sizeof(*pCompletionData));
     396        if (pCompletionData)
     397        {
     398            pCompletionData->pvBufferToFree = pvPackBuffer;
     399            int rc = VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(&pDevExt->CrHgsmiTransport, pCompletionData);
    394400            if (RT_SUCCESS(rc))
    395401            {
     
    398404            WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteAsync failed, rc %d", rc));
    399405            Status = STATUS_UNSUCCESSFUL;
    400             VBoxMpCrShgsmiTransportCmdTermWriteAsync(&pDevExt->CrHgsmiTransport, pvCompletionData);
     406            VBoxMpCrShgsmiTransportCmdTermWriteAsync(&pDevExt->CrHgsmiTransport, pCompletionData);
    401407        }
    402408        else
     
    881887/** @callback_method_impl{PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION}   */
    882888static DECLCALLBACK(void) vboxVdmaCrRxGenericSyncCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc,
    883                                                             void RT_UNTRUSTED_VOLATILE_HOST *pvRx, uint32_t cbRx, void *pvCtx)
    884 {
    885     PVBOXMP_VDMACR_WRITEREADCOMPLETION pvCompletionData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)pvCtx;
    886     PVBOXVDMA_CRRXGENERICSYNC pData = (PVBOXVDMA_CRRXGENERICSYNC)pvCompletionData->pvContext;
     889                                                            void RT_UNTRUSTED_VOLATILE_HOST *pvRx, uint32_t cbRx,
     890                                                            void RT_UNTRUSTED_VOLATILE_HOST *pvCtx)
     891{
     892    VBOXMP_VDMACR_WRITEREADCOMPLETION RT_UNTRUSTED_VOLATILE_HOST *pCompletionData
     893        = (VBOXMP_VDMACR_WRITEREADCOMPLETION RT_UNTRUSTED_VOLATILE_HOST *)pvCtx;
     894    PVBOXVDMA_CRRXGENERICSYNC pData = (PVBOXVDMA_CRRXGENERICSYNC)pCompletionData->pvContext;
    887895    if (RT_SUCCESS(rc))
    888896    {
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h

    r71590 r71596  
    278278#ifdef VBOX_WITH_VDMA
    279279int vboxVdmaFlush(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo);
    280 DECLINLINE(HGSMIOFFSET) vboxVdmaCBufDrPtrOffset(const PVBOXVDMAINFO pInfo, const void* pvPtr)
     280DECLINLINE(HGSMIOFFSET) vboxVdmaCBufDrPtrOffset(const PVBOXVDMAINFO pInfo, const void RT_UNTRUSTED_VOLATILE_HOST *pvPtr)
    281281{
    282282    return VBoxSHGSMICommandPtrOffset(&pInfo->CmdHeap, pvPtr);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r71595 r71596  
    39733973                    pHdr->enmType = VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER;
    39743974                    pHdr->u32CmdSpecific = 0;
    3975                     VBOXVDMACMD_DMA_BPB_TRANSFER *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_DMA_BPB_TRANSFER);
     3975                    VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_HOST *pBody
     3976                        = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_DMA_BPB_TRANSFER);
    39763977//                    pBody->cbTransferSize = (uint32_t)pBuildPagingBuffer->Transfer.TransferSize;
    39773978                    pBody->fFlags = 0;
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r71595 r71596  
    221221static void VBoxVBVAExHPDataCompleteCtl(struct VBVAEXHOSTCONTEXT *pCmdVbva, VBVAEXHOSTCTL *pCtl, int rc);
    222222static int  VBoxVDMAThreadEventNotify(PVBOXVDMATHREAD pThread);
    223 static int  vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, const VBOXVDMACMD_DMA_BPB_TRANSFER *pTransfer, uint32_t cbBuffer);
     223static int  vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_GUEST *pTransfer,
     224                                       uint32_t cbBuffer);
    224225static int  vdmaVBVACtlSubmitSync(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL *pCtl, VBVAEXHOSTCTL_SOURCE enmSource);
    225226static DECLCALLBACK(void) vdmaVBVACtlSubmitSyncCompletion(VBVAEXHOSTCONTEXT *pVbva, struct VBVAEXHOSTCTL *pCtl,
     
    24342435            case VBOXVDMACMD_TYPE_CHROMIUM_CMD:
    24352436            {
    2436                 PVBOXVDMACMD_CHROMIUM_CMD pCrCmd = VBOXVDMACMD_BODY(pDmaCmd, VBOXVDMACMD_CHROMIUM_CMD);
     2437                VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_GUEST *pCrCmd = VBOXVDMACMD_BODY(pDmaCmd, VBOXVDMACMD_CHROMIUM_CMD);
    24372438                AssertReturn(cbBody >= sizeof(*pCrCmd), VERR_INVALID_PARAMETER);
    24382439
     
    24542455            case VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER:
    24552456            {
    2456                 PVBOXVDMACMD_DMA_BPB_TRANSFER pTransfer = VBOXVDMACMD_BODY(pDmaCmd, VBOXVDMACMD_DMA_BPB_TRANSFER);
     2457                VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_GUEST *pTransfer
     2458                    = VBOXVDMACMD_BODY(pDmaCmd, VBOXVDMACMD_DMA_BPB_TRANSFER);
    24572459                AssertReturn(cbBody >= sizeof(*pTransfer), VERR_INVALID_PARAMETER);
    24582460
    2459                 rc = vboxVDMACmdExecBpbTransfer(pVdma, pTransfer, sizeof (*pTransfer));
     2461                rc = vboxVDMACmdExecBpbTransfer(pVdma, pTransfer, sizeof(*pTransfer));
    24602462                AssertRC(rc);
    24612463                if (RT_SUCCESS(rc))
     
    26162618 * @param   cbBuffer        Number of bytes accessible at @a pBtl.
    26172619 */
    2618 static int vboxVDMACmdExecBlt(PVBOXVDMAHOST pVdma, const PVBOXVDMACMD_DMA_PRESENT_BLT pBlt, uint32_t cbBuffer)
     2620static int vboxVDMACmdExecBlt(PVBOXVDMAHOST pVdma, const VBOXVDMACMD_DMA_PRESENT_BLT RT_UNTRUSTED_VOLATILE_GUEST *pBlt,
     2621                              uint32_t cbBuffer)
    26192622{
    26202623    /*
     
    26232626    AssertReturn(cbBuffer >= RT_UOFFSETOF(VBOXVDMACMD_DMA_PRESENT_BLT, aDstSubRects), VERR_INVALID_PARAMETER);
    26242627    VBOXVDMACMD_DMA_PRESENT_BLT BltSafe;
    2625     memcpy(&BltSafe, pBlt, RT_UOFFSETOF(VBOXVDMACMD_DMA_PRESENT_BLT, aDstSubRects));
     2628    memcpy(&BltSafe, (void const *)pBlt, RT_UOFFSETOF(VBOXVDMACMD_DMA_PRESENT_BLT, aDstSubRects));
     2629    ASMCompilerBarrier();
    26262630
    26272631    AssertReturn(BltSafe.cDstSubRects < _8M, VERR_INVALID_PARAMETER);
     
    26442648        for (uint32_t i = 0; i < BltSafe.cDstSubRects; ++i)
    26452649        {
    2646             VBOXVDMA_RECTL dstSubRectl = pBlt->aDstSubRects[i];
     2650            VBOXVDMA_RECTL dstSubRectl;
     2651            dstSubRectl.left   = pBlt->aDstSubRects[i].left;
     2652            dstSubRectl.top    = pBlt->aDstSubRects[i].top;
     2653            dstSubRectl.width  = pBlt->aDstSubRects[i].width;
     2654            dstSubRectl.height = pBlt->aDstSubRects[i].height;
     2655            ASMCompilerBarrier();
     2656
    26472657            VBOXVDMA_RECTL srcSubRectl = dstSubRectl;
    26482658
     
    26852695 * @param   cbBuffer        Number of bytes accessible at @a pTransfer.
    26862696 */
    2687 static int vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, const VBOXVDMACMD_DMA_BPB_TRANSFER *pTransfer, uint32_t cbBuffer)
     2697static int vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_GUEST *pTransfer,
     2698                                      uint32_t cbBuffer)
    26882699{
    26892700    /*
     
    26912702     */
    26922703    AssertReturn(cbBuffer >= sizeof(*pTransfer), VERR_INVALID_PARAMETER);
    2693     VBOXVDMACMD_DMA_BPB_TRANSFER const TransferSafeCopy = *pTransfer;
    2694     pTransfer = &TransferSafeCopy;
     2704    VBOXVDMACMD_DMA_BPB_TRANSFER TransferSafeCopy;
     2705    memcpy(&TransferSafeCopy, (void const *)pTransfer, sizeof(TransferSafeCopy));
     2706    ASMCompilerBarrier();
    26952707
    26962708    PVGASTATE   pVGAState    = pVdma->pVGAState;
     
    27172729    uint32_t    cbTransfered = 0;
    27182730    int         rc           = VINF_SUCCESS;
    2719 
    2720     if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_SRC_VRAMOFFSET)
    2721     {
    2722         if (RT_LIKELY(   pTransfer->cbTransferSize <= pVGAState->vram_size
    2723                       && pTransfer->Src.offVramBuf <= pVGAState->vram_size - pTransfer->cbTransferSize))
    2724         { /* likely */ }
    2725         else
    2726             return VERR_INVALID_PARAMETER;
    2727     }
    2728 
    2729     if (pTransfer->fFlags & VBOXVDMACMD_DMA_BPB_TRANSFER_F_DST_VRAMOFFSET)
    2730     {
    2731         if (RT_LIKELY(   pTransfer->cbTransferSize <= pVGAState->vram_size
    2732                       && pTransfer->Dst.offVramBuf <= pVGAState->vram_size - pTransfer->cbTransferSize))
    2733         { /* likely */ }
    2734         else
    2735             return VERR_INVALID_PARAMETER;
    2736     }
    2737 
    27382731    do
    27392732    {
     
    28392832            case VBOXVDMACMD_TYPE_DMA_PRESENT_BLT:
    28402833            {
    2841                 const PVBOXVDMACMD_DMA_PRESENT_BLT pBlt = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT);
     2834                VBOXVDMACMD_DMA_PRESENT_BLT RT_UNTRUSTED_VOLATILE_GUEST *pBlt = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT);
    28422835                cbProcessed = vboxVDMACmdExecBlt(pVdma, pBlt, cbBuffer - VBOXVDMACMD_HEADER_SIZE());
    28432836                Assert(cbProcessed >= 0);
     
    28472840            case VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER:
    28482841            {
    2849                 const PVBOXVDMACMD_DMA_BPB_TRANSFER pTransfer = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_BPB_TRANSFER);
     2842                VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_GUEST *pTransfer
     2843                    = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_BPB_TRANSFER);
    28502844                cbProcessed = vboxVDMACmdExecBpbTransfer(pVdma, pTransfer, cbBuffer - VBOXVDMACMD_HEADER_SIZE());
    28512845                Assert(cbProcessed >= 0);
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