- Timestamp:
- Mar 31, 2018 9:23:46 PM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp
r71595 r71596 239 239 ((_type*)(((uint8_t*)(_pCmd)) + VBOXMP_CRSHGSMICON_CMD_CMDBUF_OFFSET(_cBuffers))) 240 240 #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))) 242 242 #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))) 244 244 #define VBOXMP_CRSHGSMICON_CMD_SIZE(_cBuffers, _cbCmdBuf, _cbCtx) \ 245 245 (VBOXMP_CRSHGSMICON_CMD_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf) + (_cbCtx)) … … 253 253 (VBOXVDMACMD_BODY((_pDr), VBOXVDMACMD_CHROMIUM_CMD)) 254 254 #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))) 256 256 #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))) 258 258 #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))) 260 260 #define VBOXMP_CRSHGSMICON_DR_SIZE(_cBuffers, _cbCmdBuf, _cbCtx) \ 261 261 (VBOXMP_CRSHGSMICON_DR_CMDCTX_OFFSET(_cBuffers, _cbCmdBuf) + (_cbCtx)) … … 298 298 typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, 299 299 void RT_UNTRUSTED_VOLATILE_HOST *pvRx, 300 uint32_t cbRx, void *pvCtx); 300 uint32_t cbRx, 301 void RT_UNTRUSTED_VOLATILE_HOST *pvCtx); 301 302 typedef FNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION *PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION; 302 303 … … 308 309 Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); 309 310 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 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; 315 316 Assert(pBody->cBuffers == cBuffers); 316 317 317 PVBOXMP_CRHGSMICMD_READpWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);318 CRVBOXHGSMIREAD 319 VBOXVDMACMD_CHROMIUM_BUFFER 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]; 320 321 Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIREAD)); 321 322 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; 328 330 329 331 int rc = pDr->rc; … … 349 351 if (pfnCompletion) 350 352 { 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); 352 355 pfnCompletion(pCon, rc, pvRx, cbRx, pvCtx); 353 356 } … … 356 359 } 357 360 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) 361 static void RT_UNTRUSTED_VOLATILE_HOST * 362 vboxMpCrShgsmiTransportCmdCreateReadAsync(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) 362 366 { 363 367 RT_NOREF(cbDrData); 364 368 const uint32_t cBuffers = 2; 365 369 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 368 PVBOXMP_CRHGSMICMD_READpWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);369 CRVBOXHGSMIREAD 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; 370 374 371 375 if (cbCmd > cbContextData) … … 393 397 pCmd->iBuffer = 1; 394 398 395 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];399 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0]; 396 400 pBufCmd->offBuffer = vboxMpCrShgsmiTransportBufOffset(pCon, pCmd); 397 401 pBufCmd->cbBuffer = sizeof (*pCmd); … … 405 409 pBufCmd->u64GuestData = (uintptr_t)pWbDr; 406 410 407 return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof 411 return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof(VBOXMP_CRHGSMICMD_READ), void); 408 412 } 409 413 … … 417 421 { 418 422 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion; 419 void *pvContext;423 void RT_UNTRUSTED_VOLATILE_HOST *pvContext; 420 424 421 425 } VBOXMP_CRHGSMICON_WRR_COMPLETION_CTX, *PVBOXMP_CRHGSMICON_WRR_COMPLETION_CTX; … … 424 428 static DECLCALLBACK(void) vboxMpCrShgsmiTransportSendWriteReadReadRepostCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, 425 429 void RT_UNTRUSTED_VOLATILE_HOST *pvRx, 426 uint32_t cbRx, void *pvCtx) 430 uint32_t cbRx, 431 void RT_UNTRUSTED_VOLATILE_HOST *pvCtx) 427 432 { 428 433 PVBOXMP_CRHGSMICON_WRR_COMPLETION_CTX pData = (PVBOXMP_CRHGSMICON_WRR_COMPLETION_CTX)pvCtx; … … 439 444 Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); 440 445 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 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); 445 450 const UINT cBuffers = 3; 446 451 Assert(pBody->cBuffers == cBuffers); 447 452 448 PVBOXMP_CRHGSMICMD_WRITEREADpWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);449 CRVBOXHGSMIWRITEREAD 450 VBOXVDMACMD_CHROMIUM_BUFFER 451 Assert(pBufCmd->cbBuffer == sizeof 452 453 CRVBOXHGSMIWRITEREAD 454 VBOXVDMACMD_CHROMIUM_BUFFER 455 PVBOXMP_CRSHGSMICON_BUFDRpWbDr = (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; 456 461 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; 459 465 460 466 int rc = pDr->rc; … … 471 477 { 472 478 /* 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); 474 481 vboxMpCrShgsmiBufCacheFree(pCon, &pCon->WbDrCache, pWbDr); 475 pWbDr = 482 pWbDr = vboxMpCrShgsmiBufCacheAlloc(pCon, &pCon->WbDrCache, pCmd->cbWriteback); 476 483 if (pWbDr) 477 484 { … … 511 518 if (pfnCompletion) 512 519 { 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); 514 522 pfnCompletion(pCon, rc, pvRx, cbRx, pvCtx); 515 523 } … … 526 534 Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); 527 535 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 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; 533 541 Assert(pBody->cBuffers == cBuffers); 534 542 535 PVBOXMP_CRHGSMICMD_WRITEpWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);536 CRVBOXHGSMIWRITE 537 VBOXVDMACMD_CHROMIUM_BUFFER 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]; 538 546 Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIWRITE)); 539 547 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION)pBufCmd->u64GuestData; … … 555 563 if (pfnCompletion) 556 564 { 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); 558 566 pfnCompletion(pCon, rc, pvCtx); 559 567 } … … 573 581 const UINT cBuffers = 2; 574 582 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; 577 588 578 589 if (!RT_SUCCESS(rc)) … … 580 591 581 592 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 596 void RT_UNTRUSTED_VOLATILE_HOST * 597 VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, 598 uint32_t cbBuffer, 599 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, 600 uint32_t cbContextData) 589 601 { 590 602 const uint32_t cBuffers = 3; … … 606 618 } 607 619 608 VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);609 VBOXVDMACMD_CHROMIUM_CMD 610 PVBOXMP_CRHGSMICMD_WRITEREADpWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);611 CRVBOXHGSMIWRITEREAD 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; 612 624 613 625 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; … … 630 642 pCmd->cbWriteback = 0; 631 643 632 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];644 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0]; 633 645 pBufCmd->offBuffer = vboxVdmaCBufDrPtrOffset(&pDevExt->u.primary.Vdma, pCmd); 634 646 pBufCmd->cbBuffer = sizeof (*pCmd); … … 648 660 pBufCmd->u64GuestData = (uintptr_t)pWbDr; 649 661 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 665 static void RT_UNTRUSTED_VOLATILE_HOST * 666 vboxMpCrShgsmiTransportCmdVbvaCreateWriteAsync(PVBOXMP_DEVEXT pDevExt, uint32_t u32ClientID, void *pvBuffer, 667 uint32_t cbBuffer, 668 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion, 669 uint32_t cbContextData) 657 670 { 658 671 const uint32_t cBuffers = 2; 659 672 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); 661 674 if (!pCmd) 662 675 { … … 667 680 pCmd->cBuffers = cBuffers; 668 681 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; 671 685 672 686 pCmdWrite->hdr.result = VERR_WRONG_ORDER; … … 676 690 pCmdWrite->iBuffer = 1; 677 691 678 VBOXCMDVBVA_CRCMD_BUFFER *pBufCmd = &pCmd->aBuffers[0];692 VBOXCMDVBVA_CRCMD_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pCmd->aBuffers[0]; 679 693 pBufCmd->offBuffer = (VBOXCMDVBVAOFFSET)vboxMpCrShgsmiBufferOffset(pDevExt, pCmdWrite); 680 694 pBufCmd->cbBuffer = sizeof (*pCmdWrite); … … 684 698 pBufCmd->cbBuffer = cbBuffer; 685 699 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); 687 703 *pu64Completion = (uintptr_t)pfnCompletion; 688 704 return pu64Completion + 1; 689 705 } 690 706 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) 707 void RT_UNTRUSTED_VOLATILE_HOST * 708 vboxMpCrShgsmiTransportCmdVdmaCreateWriteAsync(PVBOXMP_DEVEXT pDevExt, uint32_t u32ClientID, void *pvBuffer, 709 uint32_t cbBuffer, 710 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion, 711 uint32_t cbContextData) 695 712 { 696 713 const uint32_t cBuffers = 2; … … 703 720 } 704 721 705 VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);706 VBOXVDMACMD_CHROMIUM_CMD 707 PVBOXMP_CRHGSMICMD_WRITEpWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);708 CRVBOXHGSMIWRITE 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; 709 726 710 727 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; … … 724 741 pCmd->iBuffer = 1; 725 742 726 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];743 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[0]; 727 744 pBufCmd->offBuffer = vboxVdmaCBufDrPtrOffset(&pDevExt->u.primary.Vdma, pCmd); 728 745 pBufCmd->cbBuffer = sizeof (*pCmd); … … 736 753 pBufCmd->u64GuestData = 0; 737 754 738 return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof 739 } 740 741 void * VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer,742 743 744 755 return VBOXMP_CRSHGSMICON_DR_GET_CMDCTX(pHdr, cBuffers, sizeof(VBOXMP_CRHGSMICMD_WRITE), void); 756 } 757 758 void RT_UNTRUSTED_VOLATILE_HOST * 759 VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer, 760 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion, 761 uint32_t cbContextData) 745 762 { 746 763 PVBOXMP_DEVEXT pDevExt = pCon->pDevExt; … … 751 768 } 752 769 753 int VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext) 754 { 755 VBOXVDMACMD* pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3, sizeof (VBOXMP_CRHGSMICMD_WRITEREAD)); 770 int 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)); 756 774 return vboxMpCrShgsmiTransportCmdSubmitDmaCmd(pCon, pHdr, vboxMpCrShgsmiTransportSendWriteReadAsyncCompletion); 757 775 } 758 776 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));777 static 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)); 762 780 return vboxMpCrShgsmiTransportCmdSubmitDmaCmd(pCon, pHdr, vboxMpCrShgsmiTransportVdmaSendWriteAsyncCompletion); 763 781 } 764 782 765 static int vboxMpCrShgsmiTransportCmdVbvaSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)783 static int vboxMpCrShgsmiTransportCmdVbvaSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext) 766 784 { 767 785 PVBOXMP_DEVEXT pDevExt = pCon->pDevExt; 768 VBOXCMDVBVA_CRCMD_CMD * pCmd = VBOXMP_CRSHGSMICON_CMD_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_WRITE) + 8,769 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); 770 788 return VBoxCmdVbvaConCmdSubmitAsync(pDevExt, pCmd, vboxMpCrShgsmiTransportVbvaSendWriteAsyncCompletion, pCon); 771 789 } 772 790 773 int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)791 int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext) 774 792 { 775 793 if (pCon->pDevExt->fCmdVbvaEnabled) … … 778 796 } 779 797 780 void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)798 void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext) 781 799 { 782 800 VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3, … … 785 803 } 786 804 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); 805 static 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); 791 810 VBoxCmdVbvaConCmdFree(pCon->pDevExt, pCmd); 792 811 } 793 812 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)); 813 static 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)); 797 817 vboxMpCrShgsmiTransportCmdTermDmaCmd(pCon, pHdr); 798 818 } 799 819 800 void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)820 void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext) 801 821 { 802 822 if (pCon->pDevExt->fCmdVbvaEnabled) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h
r71590 r71596 64 64 typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, 65 65 void RT_UNTRUSTED_VOLATILE_HOST *pvRx, 66 uint32_t cbRx, void *pvCtx); 66 uint32_t cbRx, 67 void RT_UNTRUSTED_VOLATILE_HOST *pvCtx); 67 68 typedef FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION *PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION; 68 69 69 typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void *pvCtx); 70 typedef DECLCALLBACK(void) FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, 71 void RT_UNTRUSTED_VOLATILE_HOST *pvCtx); 70 72 typedef FNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION *PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION; 71 73 72 74 int VBoxMpCrShgsmiTransportCreate(PVBOXMP_CRSHGSMITRANSPORT pCon, PVBOXMP_DEVEXT pDevExt); 73 75 void VBoxMpCrShgsmiTransportTerm(PVBOXMP_CRSHGSMITRANSPORT pCon); 74 void* VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer, 76 void RT_UNTRUSTED_VOLATILE_HOST *VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, 77 uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer, 75 78 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, uint32_t cbContextData); 76 void* VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer, 79 void RT_UNTRUSTED_VOLATILE_HOST *VBoxMpCrShgsmiTransportCmdCreateWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, 80 uint32_t u32ClientID, void *pvBuffer, uint32_t cbBuffer, 77 81 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);82 int VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext); 83 int VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext); 84 void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext); 85 void VBoxMpCrShgsmiTransportCmdTermWriteAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void RT_UNTRUSTED_VOLATILE_HOST *pvContext); 82 86 83 87 void RT_UNTRUSTED_VOLATILE_HOST *VBoxMpCrShgsmiTransportBufAlloc(PVBOXMP_CRSHGSMITRANSPORT pCon, uint32_t cbBuffer); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r71595 r71596 1357 1357 1358 1358 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); 1361 1361 UINT cBufs = pBody->cBuffers; 1362 1362 for (UINT i = 0; i < cBufs; ++i) 1363 1363 { 1364 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i];1364 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[i]; 1365 1365 PVBOXVIDEOCM_ALLOC_REF pRef = (PVBOXVIDEOCM_ALLOC_REF)pBufCmd->u64GuestData; 1366 1366 if (!pBufCmd->u32GuestData) … … 1403 1403 pHdr->enmType = VBOXVDMACMD_TYPE_CHROMIUM_CMD; 1404 1404 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); 1406 1407 pBody->cBuffers = cBuffers; 1407 1408 for (UINT i = 0; i < cBuffers; ++i) 1408 1409 { 1409 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i];1410 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[i]; 1410 1411 VBOXWDDM_UHGSMI_BUFFER_UI_INFO_ESCAPE *pBufInfo = &paBuffers[i]; 1411 1412 PVBOXVIDEOCM_ALLOC_REF pRef = vboxVideoAMgrCtxAllocRefAcquire(pContext, pBufInfo->hAlloc); … … 1426 1427 for (UINT j = 0; j < i; ++j) 1427 1428 { 1428 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmdJ = &pBody->aBuffers[j];1429 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmdJ = &pBody->aBuffers[j]; 1429 1430 PVBOXVIDEOCM_ALLOC_REF pRefJ = (PVBOXVIDEOCM_ALLOC_REF)pBufCmdJ; 1430 1431 vboxVideoAMgrCtxAllocRefRelease(pRefJ); … … 1453 1454 for (UINT i = 0; i < cBuffers; ++i) 1454 1455 { 1455 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[i];1456 VBOXVDMACMD_CHROMIUM_BUFFER RT_UNTRUSTED_VOLATILE_HOST *pBufCmd = &pBody->aBuffers[i]; 1456 1457 PVBOXVIDEOCM_ALLOC_REF pRef = (PVBOXVIDEOCM_ALLOC_REF)pBufCmd; 1457 1458 vboxVideoAMgrCtxAllocRefRelease(pRef); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPShgsmi.cpp
r71590 r71596 126 126 const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST * 127 127 VBoxSHGSMICommandPrepAsynch(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) 129 130 { 130 131 fFlags &= ~VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPShgsmi.h
r71590 r71596 45 45 const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST * 46 46 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); 48 49 const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST * 49 50 VBoxSHGSMICommandPrepAsynchIrq(PVBOXSHGSMI pHeap, void RT_UNTRUSTED_VOLATILE_HOST *pvBuff, … … 62 63 /* allows getting VRAM offset of arbitrary pointer within the SHGSMI command 63 64 * if invalid pointer is passed in, behavior is undefined */ 64 DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandPtrOffset(const PVBOXSHGSMI pHeap, const void *pvPtr)65 DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandPtrOffset(const PVBOXSHGSMI pHeap, const void RT_UNTRUSTED_VOLATILE_HOST *pvPtr) 65 66 { 66 return HGSMIPointerToOffset (&pHeap->Heap.area, (const HGSMIBUFFERHEADER*)pvPtr);67 return HGSMIPointerToOffset(&pHeap->Heap.area, (const HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HOST *)pvPtr); 67 68 } 68 69 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVModes.cpp
r71595 r71596 561 561 PVBOXWDDMCHILDSTATUSCB pCtx = (PVBOXWDDMCHILDSTATUSCB)pvContext; 562 562 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); 565 565 566 566 vboxWddmChildStatusHandleRequest(pDevExt, pBody); … … 593 593 pHdr->enmType = VBOXVDMACMD_TYPE_CHILD_STATUS_IRQ; 594 594 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); 596 597 pBody->cInfos = 1; 597 598 if (iChild == D3DDDI_ID_ALL) -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
r71590 r71596 175 175 } 176 176 177 static int vboxCmdVbvaCtlSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CTL * pCtl, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion) 177 static int vboxCmdVbvaCtlSubmitAsync(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CTL RT_UNTRUSTED_VOLATILE_HOST *pCtl, 178 FNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion) 178 179 { 179 180 const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBoxSHGSMICommandPrepAsynch(&pHGSMICtx->heapCtx, pCtl, pfnCompletion, … … 1312 1313 } 1313 1314 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); 1315 static 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); 1317 1320 if (!pCmd) 1318 1321 { … … 1330 1333 pCmd->Cmd.Cmd.u2.u32FenceID = 0; 1331 1334 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 1338 void vboxCmdVbvaConCmdFree(PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd) 1336 1339 { 1337 1340 VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = ((VBOXCMDVBVA_CTL_3DCTL_CMD RT_UNTRUSTED_VOLATILE_HOST *)pCmd) - 1; … … 1339 1342 } 1340 1343 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; 1344 int 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; 1344 1348 return vboxCmdVbvaCtlSubmitAsync(pHGSMICtx, &pHdr->Hdr, pfnCompletion, pvCompletion); 1345 1349 } 1346 1350 1347 VBOXCMDVBVA_CRCMD_CMD *VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd)1351 VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd) 1348 1352 { 1349 1353 return vboxCmdVbvaConCmdAlloc(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, cbCmd); 1350 1354 } 1351 1355 1352 void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD *pCmd)1356 void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd) 1353 1357 { 1354 1358 vboxCmdVbvaConCmdFree(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, pCmd); 1355 1359 } 1356 1360 1357 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD *pCmd,1358 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void *pvCompletion)1361 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd, 1362 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion) 1359 1363 { 1360 1364 return vboxCmdVbvaConSubmitAsync(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, pCmd, pfnCompletion, pvCompletion); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.h
r71590 r71596 237 237 uint32_t *pu32ClientID); 238 238 int 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);239 VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *VBoxCmdVbvaConCmdAlloc(PVBOXMP_DEVEXT pDevExt, uint32_t cbCmd); 240 void VBoxCmdVbvaConCmdFree(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd); 241 int VBoxCmdVbvaConCmdSubmitAsync(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST *pCmd, 242 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion); 243 243 int VBoxCmdVbvaConCmdCompletionData(void RT_UNTRUSTED_VOLATILE_HOST *pvCmd, VBOXCMDVBVA_CRCMD_CMD RT_UNTRUSTED_VOLATILE_HOST **ppCmd); 244 244 int 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 315 315 } VBOXMP_VDMACR_WRITECOMPLETION, *PVBOXMP_VDMACR_WRITECOMPLETION; 316 316 317 static DECLCALLBACK(void) vboxVdmaCrWriteCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void *pvCtx)317 static DECLCALLBACK(void) vboxVdmaCrWriteCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void RT_UNTRUSTED_VOLATILE_HOST *pvCtx) 318 318 { 319 319 RT_NOREF(rc); 320 320 PVBOXMP_VDMACR_WRITECOMPLETION pData = (PVBOXMP_VDMACR_WRITECOMPLETION)pvCtx; 321 void *pvBufferToFree = pData->pvBufferToFree;321 void *pvBufferToFree = pData->pvBufferToFree; 322 322 if (pvBufferToFree) 323 323 VBoxMpCrShgsmiTransportBufFree(pCon, pvBufferToFree); … … 328 328 typedef struct VBOXMP_VDMACR_WRITEREADCOMPLETION 329 329 { 330 void *pvBufferToFree;331 void *pvContext;330 void RT_UNTRUSTED_VOLATILE_HOST *pvBufferToFree; 331 void RT_UNTRUSTED_VOLATILE_HOST *pvContext; 332 332 } VBOXMP_VDMACR_WRITEREADCOMPLETION, *PVBOXMP_VDMACR_WRITEREADCOMPLETION; 333 333 334 void vboxVdmaCrSubmitWriteReadAsyncGenericCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvCtx) 335 { 336 PVBOXMP_VDMACR_WRITEREADCOMPLETION pData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)pvCtx; 337 void* pvBufferToFree = pData->pvBufferToFree; 334 void 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; 338 339 if (pvBufferToFree) 339 340 VBoxMpCrShgsmiTransportBufFree(pCon, pvBufferToFree); … … 342 343 } 343 344 344 NTSTATUS vboxVdmaCrSubmitWriteReadAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID, 345 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, void *pvCompletion) 345 static NTSTATUS vboxVdmaCrSubmitWriteReadAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID, 346 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, 347 void RT_UNTRUSTED_VOLATILE_HOST *pvCompletion) 346 348 { 347 349 Assert(u32CrConClientID); … … 352 354 if (pvBuffer) 353 355 { 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); 361 365 if (RT_SUCCESS(rc)) 362 366 { … … 365 369 WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync failed, rc %d", rc)); 366 370 Status = STATUS_UNSUCCESSFUL; 367 VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(&pDevExt->CrHgsmiTransport, p vCompletionData);371 VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(&pDevExt->CrHgsmiTransport, pCompletionData); 368 372 } 369 373 else … … 386 390 if (pvBuffer) 387 391 { 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); 394 400 if (RT_SUCCESS(rc)) 395 401 { … … 398 404 WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteAsync failed, rc %d", rc)); 399 405 Status = STATUS_UNSUCCESSFUL; 400 VBoxMpCrShgsmiTransportCmdTermWriteAsync(&pDevExt->CrHgsmiTransport, p vCompletionData);406 VBoxMpCrShgsmiTransportCmdTermWriteAsync(&pDevExt->CrHgsmiTransport, pCompletionData); 401 407 } 402 408 else … … 881 887 /** @callback_method_impl{PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION} */ 882 888 static 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; 887 895 if (RT_SUCCESS(rc)) 888 896 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h
r71590 r71596 278 278 #ifdef VBOX_WITH_VDMA 279 279 int vboxVdmaFlush(PVBOXMP_DEVEXT pDevExt, PVBOXVDMAINFO pInfo); 280 DECLINLINE(HGSMIOFFSET) vboxVdmaCBufDrPtrOffset(const PVBOXVDMAINFO pInfo, const void *pvPtr)280 DECLINLINE(HGSMIOFFSET) vboxVdmaCBufDrPtrOffset(const PVBOXVDMAINFO pInfo, const void RT_UNTRUSTED_VOLATILE_HOST *pvPtr) 281 281 { 282 282 return VBoxSHGSMICommandPtrOffset(&pInfo->CmdHeap, pvPtr); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r71595 r71596 3973 3973 pHdr->enmType = VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER; 3974 3974 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); 3976 3977 // pBody->cbTransferSize = (uint32_t)pBuildPagingBuffer->Transfer.TransferSize; 3977 3978 pBody->fFlags = 0; -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r71595 r71596 221 221 static void VBoxVBVAExHPDataCompleteCtl(struct VBVAEXHOSTCONTEXT *pCmdVbva, VBVAEXHOSTCTL *pCtl, int rc); 222 222 static int VBoxVDMAThreadEventNotify(PVBOXVDMATHREAD pThread); 223 static int vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, const VBOXVDMACMD_DMA_BPB_TRANSFER *pTransfer, uint32_t cbBuffer); 223 static int vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_GUEST *pTransfer, 224 uint32_t cbBuffer); 224 225 static int vdmaVBVACtlSubmitSync(PVBOXVDMAHOST pVdma, VBVAEXHOSTCTL *pCtl, VBVAEXHOSTCTL_SOURCE enmSource); 225 226 static DECLCALLBACK(void) vdmaVBVACtlSubmitSyncCompletion(VBVAEXHOSTCONTEXT *pVbva, struct VBVAEXHOSTCTL *pCtl, … … 2434 2435 case VBOXVDMACMD_TYPE_CHROMIUM_CMD: 2435 2436 { 2436 PVBOXVDMACMD_CHROMIUM_CMDpCrCmd = VBOXVDMACMD_BODY(pDmaCmd, VBOXVDMACMD_CHROMIUM_CMD);2437 VBOXVDMACMD_CHROMIUM_CMD RT_UNTRUSTED_VOLATILE_GUEST *pCrCmd = VBOXVDMACMD_BODY(pDmaCmd, VBOXVDMACMD_CHROMIUM_CMD); 2437 2438 AssertReturn(cbBody >= sizeof(*pCrCmd), VERR_INVALID_PARAMETER); 2438 2439 … … 2454 2455 case VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER: 2455 2456 { 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); 2457 2459 AssertReturn(cbBody >= sizeof(*pTransfer), VERR_INVALID_PARAMETER); 2458 2460 2459 rc = vboxVDMACmdExecBpbTransfer(pVdma, pTransfer, sizeof 2461 rc = vboxVDMACmdExecBpbTransfer(pVdma, pTransfer, sizeof(*pTransfer)); 2460 2462 AssertRC(rc); 2461 2463 if (RT_SUCCESS(rc)) … … 2616 2618 * @param cbBuffer Number of bytes accessible at @a pBtl. 2617 2619 */ 2618 static int vboxVDMACmdExecBlt(PVBOXVDMAHOST pVdma, const PVBOXVDMACMD_DMA_PRESENT_BLT pBlt, uint32_t cbBuffer) 2620 static int vboxVDMACmdExecBlt(PVBOXVDMAHOST pVdma, const VBOXVDMACMD_DMA_PRESENT_BLT RT_UNTRUSTED_VOLATILE_GUEST *pBlt, 2621 uint32_t cbBuffer) 2619 2622 { 2620 2623 /* … … 2623 2626 AssertReturn(cbBuffer >= RT_UOFFSETOF(VBOXVDMACMD_DMA_PRESENT_BLT, aDstSubRects), VERR_INVALID_PARAMETER); 2624 2627 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(); 2626 2630 2627 2631 AssertReturn(BltSafe.cDstSubRects < _8M, VERR_INVALID_PARAMETER); … … 2644 2648 for (uint32_t i = 0; i < BltSafe.cDstSubRects; ++i) 2645 2649 { 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 2647 2657 VBOXVDMA_RECTL srcSubRectl = dstSubRectl; 2648 2658 … … 2685 2695 * @param cbBuffer Number of bytes accessible at @a pTransfer. 2686 2696 */ 2687 static int vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, const VBOXVDMACMD_DMA_BPB_TRANSFER *pTransfer, uint32_t cbBuffer) 2697 static int vboxVDMACmdExecBpbTransfer(PVBOXVDMAHOST pVdma, VBOXVDMACMD_DMA_BPB_TRANSFER RT_UNTRUSTED_VOLATILE_GUEST *pTransfer, 2698 uint32_t cbBuffer) 2688 2699 { 2689 2700 /* … … 2691 2702 */ 2692 2703 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(); 2695 2707 2696 2708 PVGASTATE pVGAState = pVdma->pVGAState; … … 2717 2729 uint32_t cbTransfered = 0; 2718 2730 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_size2723 && pTransfer->Src.offVramBuf <= pVGAState->vram_size - pTransfer->cbTransferSize))2724 { /* likely */ }2725 else2726 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_size2732 && pTransfer->Dst.offVramBuf <= pVGAState->vram_size - pTransfer->cbTransferSize))2733 { /* likely */ }2734 else2735 return VERR_INVALID_PARAMETER;2736 }2737 2738 2731 do 2739 2732 { … … 2839 2832 case VBOXVDMACMD_TYPE_DMA_PRESENT_BLT: 2840 2833 { 2841 const PVBOXVDMACMD_DMA_PRESENT_BLTpBlt = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT);2834 VBOXVDMACMD_DMA_PRESENT_BLT RT_UNTRUSTED_VOLATILE_GUEST *pBlt = VBOXVDMACMD_BODY(pCmd, VBOXVDMACMD_DMA_PRESENT_BLT); 2842 2835 cbProcessed = vboxVDMACmdExecBlt(pVdma, pBlt, cbBuffer - VBOXVDMACMD_HEADER_SIZE()); 2843 2836 Assert(cbProcessed >= 0); … … 2847 2840 case VBOXVDMACMD_TYPE_DMA_BPB_TRANSFER: 2848 2841 { 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); 2850 2844 cbProcessed = vboxVDMACmdExecBpbTransfer(pVdma, pTransfer, cbBuffer - VBOXVDMACMD_HEADER_SIZE()); 2851 2845 Assert(cbProcessed >= 0);
Note:
See TracChangeset
for help on using the changeset viewer.