Changeset 33171 in vbox
- Timestamp:
- Oct 15, 2010 11:10:10 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66707
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp
r33146 r33171 54 54 if (g_hVBoxCrHgsmiProvider) 55 55 { 56 if (g_pfnVBoxDispCrHgsmiInit) 57 { 58 g_pfnVBoxDispCrHgsmiInit(pCallbacks); 59 } 56 60 ++g_cVBoxCrHgsmiProvider; 57 61 return VINF_SUCCESS; … … 73 77 { 74 78 hClient = g_pfnVBoxDispCrHgsmiQueryClient(); 79 #ifdef DEBUG_misha 80 Assert(hClient); 81 #endif 75 82 if (hClient) 76 83 return hClient; … … 78 85 PVBOXUHGSMI_PRIVATE_KMT pHgsmiGL = gt_pHgsmiGL; 79 86 if (pHgsmiGL) 87 { 88 Assert(pHgsmiGL->BasePrivate.hClient); 80 89 return pHgsmiGL->BasePrivate.hClient; 90 } 81 91 pHgsmiGL = (PVBOXUHGSMI_PRIVATE_KMT)RTMemAllocZ(sizeof (*pHgsmiGL)); 82 92 if (pHgsmiGL) … … 84 94 HRESULT hr = vboxUhgsmiKmtCreate(pHgsmiGL, TRUE /* bD3D tmp for injection thread*/); 85 95 Assert(hr == S_OK); 86 hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&pHgsmiGL->BasePrivate.Base); 87 Assert(hClient); 88 pHgsmiGL->BasePrivate.hClient = hClient; 89 gt_pHgsmiGL = pHgsmiGL; 96 if (hr == S_OK) 97 { 98 hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&pHgsmiGL->BasePrivate.Base); 99 Assert(hClient); 100 pHgsmiGL->BasePrivate.hClient = hClient; 101 gt_pHgsmiGL = pHgsmiGL; 102 } 90 103 } 91 104 else -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r33117 r33171 732 732 #endif 733 733 734 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks)735 {736 #ifdef VBOX_WITH_CRHGSMI737 g_VBoxCrHgsmiCallbacks = *pCallbacks;738 #endif739 return VINF_SUCCESS;740 }741 742 734 #ifdef VBOX_WITH_CRHGSMI 743 735 static __declspec(thread) PVBOXUHGSMI_PRIVATE_BASE gt_pHgsmi = NULL; 744 736 #endif 745 737 738 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks) 739 { 740 #ifdef VBOX_WITH_CRHGSMI 741 vboxDispLock(); /* the lock is needed here only to ensure callbacks are not initialized & used concurrently 742 * @todo: make a separate call used to init the per-thread info and make the VBoxDispCrHgsmiInit be called only once */ 743 g_VBoxCrHgsmiCallbacks = *pCallbacks; 744 PVBOXUHGSMI_PRIVATE_BASE pHgsmi = gt_pHgsmi; 745 #ifdef DEBUG_misha 746 Assert(pHgsmi); 747 #endif 748 if (pHgsmi) 749 { 750 if (!pHgsmi->hClient) 751 { 752 pHgsmi->hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&pHgsmi->Base); 753 Assert(pHgsmi->hClient); 754 } 755 } 756 vboxDispUnlock(); 757 #endif 758 return VINF_SUCCESS; 759 } 760 746 761 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiTerm() 747 762 { … … 753 768 #ifdef VBOX_WITH_CRHGSMI 754 769 PVBOXUHGSMI_PRIVATE_BASE pHgsmi = gt_pHgsmi; 770 #ifdef DEBUG_misha 771 Assert(pHgsmi); 772 #endif 755 773 if (pHgsmi) 774 { 775 Assert(pHgsmi->hClient); 756 776 return pHgsmi->hClient; 777 } 757 778 #endif 758 779 return NULL; … … 760 781 761 782 #ifdef VBOX_WITH_CRHGSMI 762 static intvboxUhgsmiGlobalRetain()763 { 764 int rc = VINF_SUCCESS;783 static HRESULT vboxUhgsmiGlobalRetain() 784 { 785 HRESULT hr = S_OK; 765 786 vboxDispLock(); 766 787 if (!g_cVBoxUhgsmiKmtRefs) 767 788 { 768 rc = vboxUhgsmiKmtCreate(&g_VBoxUhgsmiKmt, TRUE); 769 AssertRC(rc); 770 } 771 772 if (RT_SUCCESS(rc)) 789 hr = vboxUhgsmiKmtCreate(&g_VBoxUhgsmiKmt, TRUE); 790 Assert(hr == S_OK); 791 /* can not do it here because callbacks may not be set yet 792 * @todo: need to call the cr lib from here to get the callbacks 793 * rather than making the cr lib call us */ 794 // if (hr == S_OK) 795 // { 796 // g_VBoxUhgsmiKmt.BasePrivate.hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&g_VBoxUhgsmiKmt.BasePrivate.Base); 797 // Assert(g_VBoxUhgsmiKmt.BasePrivate.hClient); 798 // } 799 } 800 801 if (hr == S_OK) 773 802 { 774 803 ++g_cVBoxUhgsmiKmtRefs; … … 776 805 vboxDispUnlock(); 777 806 778 return rc;779 } 780 781 static intvboxUhgsmiGlobalRelease()782 { 783 int rc = VINF_SUCCESS;807 return hr; 808 } 809 810 static HRESULT vboxUhgsmiGlobalRelease() 811 { 812 HRESULT hr = S_OK; 784 813 vboxDispLock(); 785 814 --g_cVBoxUhgsmiKmtRefs; 786 815 if (!g_cVBoxUhgsmiKmtRefs) 787 816 { 788 rc = vboxUhgsmiKmtDestroy(&g_VBoxUhgsmiKmt); 789 AssertRC(rc); 817 if (g_VBoxUhgsmiKmt.BasePrivate.hClient) 818 g_VBoxCrHgsmiCallbacks.pfnClientDestroy(g_VBoxUhgsmiKmt.BasePrivate.hClient); 819 hr = vboxUhgsmiKmtDestroy(&g_VBoxUhgsmiKmt); 820 Assert(hr == S_OK); 790 821 } 791 822 vboxDispUnlock(); 792 return rc;823 return hr; 793 824 } 794 825 … … 803 834 } 804 835 805 intvboxUhgsmiGlobalSetCurrent()806 { 807 int rc= vboxUhgsmiGlobalRetain();808 Assert RC(rc);809 if ( RT_SUCCESS(rc))836 HRESULT vboxUhgsmiGlobalSetCurrent() 837 { 838 HRESULT hr = vboxUhgsmiGlobalRetain(); 839 Assert(hr == S_OK); 840 if (hr == S_OK) 810 841 vboxDispCrHgsmiClientSet(&g_VBoxUhgsmiKmt.BasePrivate); 811 return rc;812 } 813 814 intvboxUhgsmiGlobalClearCurrent()842 return hr; 843 } 844 845 HRESULT vboxUhgsmiGlobalClearCurrent() 815 846 { 816 847 vboxUhgsmiGlobalRelease(); 817 848 vboxDispCrHgsmiClientClear(); 818 return VINF_SUCCESS;849 return S_OK; 819 850 } 820 851 … … 6967 6998 pDevice->pDevice9If->Release(); 6968 6999 } 7000 7001 #ifdef VBOX_WITH_CRHGSMI 7002 vboxDispLock(); 7003 if (pDevice->Uhgsmi.BasePrivate.hClient) 7004 g_VBoxCrHgsmiCallbacks.pfnClientDestroy(pDevice->Uhgsmi.BasePrivate.hClient); 7005 vboxDispUnlock(); 7006 #endif 6969 7007 6970 7008 HRESULT hr = vboxDispCmCtxDestroy(pDevice, &pDevice->DefaultContext); … … 7727 7765 { 7728 7766 #ifdef VBOX_WITH_CRHGSMI 7729 int rc= vboxUhgsmiGlobalRetain();7730 Assert RC(rc);7731 if ( RT_SUCCESS(rc))7767 hr = vboxUhgsmiGlobalRetain(); 7768 Assert(hr == S_OK); 7769 if (hr == S_OK) 7732 7770 #endif 7733 7771 { … … 7772 7810 #endif 7773 7811 } 7774 #ifdef VBOX_WITH_CRHGSMI7775 else7776 {7777 hr = E_FAIL;7778 }7779 #endif7780 7812 } while (0); 7781 7813 } -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h
r33116 r33171 267 267 268 268 #ifdef VBOX_WITH_CRHGSMI 269 intvboxUhgsmiGlobalSetCurrent();270 intvboxUhgsmiGlobalClearCurrent();269 HRESULT vboxUhgsmiGlobalSetCurrent(); 270 HRESULT vboxUhgsmiGlobalClearCurrent(); 271 271 #endif 272 272 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiBase.h
r33146 r33171 93 93 fLockFlags.WriteOnly = fFlags.bWriteOnly; 94 94 fLockFlags.DonotWait = fFlags.bDonotWait; 95 fLockFlags.Discard = fFlags.bDiscard;95 // fLockFlags.Discard = fFlags.bDiscard; 96 96 *pfFlags = fLockFlags; 97 97 return VINF_SUCCESS; … … 129 129 NULL, /* LPSECURITY_ATTRIBUTES lpSemaphoreAttributes */ 130 130 0, /* LONG lInitialCount */ 131 ~0L, /* LONG lMaximumCount */131 (LONG)((~0UL) >> 1), /* LONG lMaximumCount */ 132 132 NULL /* LPCTSTR lpName */ 133 133 ); … … 187 187 memset(pAllocationList, 0, sizeof (D3DDDI_ALLOCATIONLIST)); 188 188 pAllocationList->hAllocation = pBuffer->hAllocation; 189 pAllocationList->Value = 0; 189 190 pAllocationList->WriteOperation = !pBufInfo->fFlags.bHostReadOnly; 190 191 pAllocationList->DoNotRetireInstance = pBufInfo->fFlags.bDoNotRetire; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r33165 r33171 60 60 { 61 61 pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart; 62 pInfo->segmentIdAlloc = pDmaAlloc->SegmentId; 63 } 64 else 65 pInfo->segmentIdAlloc = 0; 66 pInfo->srcId = pAlloc->SurfDesc.VidPnSourceId; 67 } 68 69 static void vboxWddmPopulateDmaAllocInfoWithOffset(PVBOXWDDM_DMA_ALLOCINFO pInfo, PVBOXWDDM_ALLOCATION pAlloc, DXGK_ALLOCATIONLIST *pDmaAlloc, uint32_t offStart) 70 { 71 pInfo->pAlloc = pAlloc; 72 if (pDmaAlloc->SegmentId) 73 { 74 pInfo->offAlloc = (VBOXVIDEOOFFSET)pDmaAlloc->PhysicalAddress.QuadPart + offStart; 62 75 pInfo->segmentIdAlloc = pDmaAlloc->SegmentId; 63 76 } … … 1437 1450 case VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER: 1438 1451 { 1439 ObDereferenceObject(pAllocation->pSynchEvent); 1452 if (pAllocation->pSynchEvent) 1453 { 1454 ObDereferenceObject(pAllocation->pSynchEvent); 1455 } 1440 1456 break; 1441 1457 } … … 1577 1593 pAllocation->SurfDesc.cbSize = pAllocInfo->cbBuffer; 1578 1594 pAllocationInfo->Flags.CpuVisible = 1; 1579 pAllocationInfo->Flags.SynchronousPaging = 1;1595 // pAllocationInfo->Flags.SynchronousPaging = 1; 1580 1596 pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_MAXIMUM; 1581 1597 switch (pAllocInfo->enmSynchType) … … 1595 1611 case VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE: 1596 1612 pAllocation->pSynchEvent = NULL; 1597 Status = =STATUS_SUCCESS;1613 Status = STATUS_SUCCESS; 1598 1614 break; 1599 1615 default: … … 2033 2049 DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*)(pPrivateBuf + pPatchList->PatchOffset); 2034 2050 pAllocation2Patch->SegmentId = pAllocationList->SegmentId; 2035 pAllocation2Patch->PhysicalAddress = pAllocationList->PhysicalAddress; 2051 pAllocation2Patch->PhysicalAddress.QuadPart = pAllocationList->PhysicalAddress.QuadPart + pPatchList->AllocationOffset; 2052 Assert(!(pAllocationList->PhysicalAddress.QuadPart & 0xfffUL)); /* <- just a check to ensure allocation offset does not go here */ 2036 2053 } 2037 2054 } … … 2543 2560 2544 2561 NTSTATUS Status = STATUS_SUCCESS; 2562 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2545 2563 2546 2564 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); … … 2551 2569 case DXGK_OPERATION_TRANSFER: 2552 2570 { 2571 PVBOXWDDM_ALLOCATION pAlloc = (PVBOXWDDM_ALLOCATION)pBuildPagingBuffer->Transfer.hAllocation; 2572 uint8_t* pvVramBase = pDevExt->pvVisibleVram; 2573 SIZE_T cbSize = pBuildPagingBuffer->Transfer.TransferSize; 2574 uint8_t *pvSrc, *pvDst; 2575 if (pBuildPagingBuffer->Transfer.Source.SegmentId) 2576 { 2577 #ifdef DEBUG_misha 2578 Assert(pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart); 2579 #endif 2580 pvSrc = pvVramBase + pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart; 2581 pvSrc += pBuildPagingBuffer->Transfer.TransferOffset; 2582 } 2583 else 2584 { 2585 pvSrc = (uint8_t*)MmGetMdlVirtualAddress(pBuildPagingBuffer->Transfer.Source.pMdl); 2586 pvSrc += pBuildPagingBuffer->Transfer.MdlOffset * 0x1000 /* page size */; 2587 } 2588 2589 if (pBuildPagingBuffer->Transfer.Destination.SegmentId) 2590 { 2591 #ifdef DEBUG_misha 2592 Assert(pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart); 2593 #endif 2594 pvDst = pvVramBase + pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart; 2595 pvDst += pBuildPagingBuffer->Transfer.TransferOffset; 2596 } 2597 else 2598 { 2599 pvDst = (uint8_t*)MmGetMdlVirtualAddress(pBuildPagingBuffer->Transfer.Destination.pMdl); 2600 pvDst += pBuildPagingBuffer->Transfer.MdlOffset * 0x1000 /* page size */; 2601 } 2602 2603 memcpy(pvDst, pvSrc, cbSize); 2553 2604 // pBuildPagingBuffer->pDmaBuffer = (uint8_t*)pBuildPagingBuffer->pDmaBuffer + VBOXVDMACMD_SIZE(VBOXVDMACMD_DMA_BPB_TRANSFER); 2554 2605 break; … … 4067 4118 { 4068 4119 PVBOXWDDM_ALLOCATION pAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pAllocationList); 4069 vboxWddmPopulateDmaAllocInfo (&pSubmInfo->Alloc, pAlloc, pAllocationList);4120 vboxWddmPopulateDmaAllocInfoWithOffset(&pSubmInfo->Alloc, pAlloc, pAllocationList, pSubmUmInfo->offData); 4070 4121 4071 4122 pSubmInfo->cbData = pSubmUmInfo->cbData; -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r33146 r33171 247 247 if (pVGAState->pDrv->pfnCrHgsmiCommandProcess) 248 248 { 249 VBoxSHGSMICommandMarkAsynchCompletion(pCmd); 249 250 pVGAState->pDrv->pfnCrHgsmiCommandProcess(pVGAState->pDrv, pCrCmd); 250 251 return true; … … 276 277 VBOXVDMACMD *pDmaHdr = VBOXVDMACMD_FROM_BODY(pCmd); 277 278 VBOXVDMACBUF_DR *pDr = VBOXVDMACBUF_DR_FROM_TAIL(pDmaHdr); 279 AssertRC(rc); 278 280 pDr->rc = rc; 279 281 280 282 Assert(pVGAState->fGuestCaps & VBVACAPS_COMPLETEGCMD_BY_IOREAD); 281 rc = HGSMICompleteGuestCommand(pIns, pDr, true /* do Irq */);283 rc = VBoxSHGSMICommandComplete(pIns, pDr); 282 284 AssertRC(rc); 283 285 return rc; … … 289 291 PVBOXVDMACMD_CHROMIUM_CTL_PRIVATE pCmdPrivate = VBOXVDMACMD_CHROMIUM_CTL_PRIVATE_FROM_CTL(pCmd); 290 292 pCmdPrivate->rc = rc; 293 AssertRC(rc); 291 294 if (pCmdPrivate->pfnCompletion) 292 295 { … … 1076 1079 #endif 1077 1080 1081 #ifdef DEBUG_misha 1082 Assert(0); 1083 #endif 1084 1078 1085 VBOXVDMACMD_SUBMIT_CONTEXT Context; 1079 1086 Context.pVdma = pVdma; -
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c
r33116 r33171 39 39 40 40 #include <iprt/thread.h> 41 #include <iprt/assert.h> 41 42 42 43 #include <VBox/VBoxCrHgsmi.h> … … 104 105 DECLINLINE(PCRVBOXHGSMI_CLIENT) _crVBoxHGSMIClientGet() 105 106 { 106 return (PCRVBOXHGSMI_CLIENT)VBoxCrHgsmiQueryClient(); 107 PCRVBOXHGSMI_CLIENT pClient = (PCRVBOXHGSMI_CLIENT)VBoxCrHgsmiQueryClient(); 108 Assert(pClient); 109 return pClient; 107 110 } 108 111 … … 142 145 return VINF_SUCCESS; 143 146 } 147 Assert(0); 144 148 crDebug("vboxCall failed with %x\n", GetLastError()); 145 149 return VERR_NOT_SUPPORTED; … … 237 241 fFlags.bDiscard = 1; 238 242 rc = pClient->pCmdBuffer->pfnLock(pClient->pCmdBuffer, 0, cbBuffer, fFlags, (void**)&pHdr); 243 AssertRC(rc); 239 244 if (RT_FAILURE(rc)) 240 245 crWarning("Failed to Lock the command buffer of size(%d), rc(%d)\n", cbBuffer, rc); … … 260 265 fFlags.bReadOnly = 1; 261 266 rc = pClient->pCmdBuffer->pfnLock(pClient->pCmdBuffer, 0, cbBuffer, fFlags, (void**)&pHdr); 267 AssertRC(rc); 262 268 if (RT_FAILURE(rc)) 263 269 crWarning("Failed to Lock the command buffer of size(%d), rc(%d)\n", cbBuffer, rc); … … 268 274 { 269 275 int rc = pClient->pCmdBuffer->pfnUnlock(pClient->pCmdBuffer); 276 AssertRC(rc); 270 277 if (RT_FAILURE(rc)) 271 278 crWarning("Failed to Unlock the command buffer rc(%d)\n", rc); … … 277 284 VBOXUHGSMI_BUFFER_LOCK_FLAGS fFlags; 278 285 int rc; 286 279 287 fFlags.Value = 0; 280 288 fFlags.bReadOnly = 1; 281 289 rc = pClient->pCmdBuffer->pfnLock(pClient->pCmdBuffer, 0, sizeof (*pHdr), fFlags, (void**)&pHdr); 290 AssertRC(rc); 282 291 if (RT_FAILURE(rc)) 283 292 { … … 287 296 288 297 rc = pHdr->result; 298 AssertRC(rc); 289 299 pClient->pCmdBuffer->pfnUnlock(pClient->pCmdBuffer); 290 300 … … 297 307 PVBOXUHGSMI_BUFFER pBuf; 298 308 int rc; 309 299 310 CRASSERT(pHdr->magic == CR_VBOXHGSMI_BUFFER_MAGIC); 300 311 pBuf = pHdr->pBuffer; 301 312 rc = pBuf->pfnUnlock(pBuf); 313 AssertRC(rc); 302 314 if (RT_FAILURE(rc)) 303 315 { … … 311 323 PVBOXUHGSMI_BUFFER buf; 312 324 int rc; 325 313 326 buf = (PVBOXUHGSMI_BUFFER ) crBufferPoolPop(pClient->bufpool, cbSize); 314 327 315 328 if (!buf) 316 329 { 330 Assert(0); 331 317 332 crDebug("Buffer pool %p was empty; allocating new %d byte buffer.", 318 333 (void *) pClient->bufpool, … … 321 336 VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE, NULL, 322 337 &buf); 338 AssertRC(rc); 323 339 if (RT_FAILURE(rc)) 324 340 crWarning("Failed to Create a buffer of size(%d), rc(%d)\n", cbSize, rc); … … 341 357 if (!pBuf) 342 358 { 359 Assert(0); 360 343 361 pBuf = (CRVBOXHGSMIBUFFER*)crAlloc(CRVBOXHGSMI_BUF_HDR_SIZE() + cbSize); 362 Assert(pBuf); 344 363 if (pBuf) 345 364 { … … 363 382 364 383 buf = _crVBoxHGSMIBufAlloc(pClient, CRVBOXHGSMI_BUF_SIZE(cbSize)); 365 384 Assert(buf); 366 385 if (buf) 367 386 { … … 390 409 { 391 410 PCRVBOXHGSMI_CLIENT pClient = _crVBoxHGSMIClientGet(); 392 return _crVBoxHGSMIDoAlloc(pClient, conn->buffer_size); 411 void *pvBuf = _crVBoxHGSMIDoAlloc(pClient, conn->buffer_size); 412 Assert(pvBuf); 413 return pvBuf; 393 414 } 394 415 … … 422 443 { 423 444 CRVBOXHGSMIINJECT *parms = (CRVBOXHGSMIINJECT *)_crVBoxHGSMICmdBufferLock(pClient, sizeof (*parms)); 445 Assert(parms); 424 446 if (!parms) 425 447 { … … 446 468 447 469 rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2); 470 AssertRC(rc); 448 471 if (RT_SUCCESS(rc)) 449 472 { … … 478 501 479 502 rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2); 503 AssertRC(rc); 480 504 if (RT_SUCCESS(rc)) 481 505 { … … 497 521 static void crVBoxHGSMIWriteExact(CRConnection *conn, const void *buf, unsigned int len) 498 522 { 523 Assert(0); 524 499 525 CRASSERT(0); 500 526 // PCRVBOXHGSMI_CLIENT pClient; … … 515 541 uint32_t cbBuffer; 516 542 543 Assert(parms); 544 517 545 parms->hdr.result = VERR_WRONG_ORDER; 518 546 parms->hdr.u32ClientID = conn->u32ClientID; … … 545 573 546 574 rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2); 575 AssertRC(rc); 547 576 if (RT_FAILURE(rc)) 548 577 { … … 552 581 553 582 parms = (CRVBOXHGSMIREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms)); 583 Assert(parms); 554 584 if (!parms) 555 585 { … … 569 599 fFlags.Value = 0; 570 600 rc = pClient->pHGBuffer->pfnLock(pClient->pHGBuffer, 0, cbBuffer, fFlags, &pClient->pvHGBuffer); 601 AssertRC(rc); 571 602 if (RT_SUCCESS(rc)) 572 603 { … … 617 648 void *pvBuf; 618 649 pBuf = _crVBoxHGSMIBufAlloc(pClient, len); 650 Assert(pBuf); 619 651 if (!pBuf) 620 652 return; 653 654 Assert(!offBuffer); 621 655 622 656 offBuffer = 0; … … 625 659 fFlags.bWriteOnly = 1; 626 660 rc = pBuf->pfnLock(pBuf, 0, len, fFlags, &pvBuf); 661 AssertRC(rc); 627 662 if (RT_SUCCESS(rc)) 628 663 { 629 664 memcpy(pvBuf, buf, len); 630 665 rc = pBuf->pfnUnlock(pBuf); 666 AssertRC(rc); 631 667 CRASSERT(rc); 632 668 } … … 637 673 } 638 674 } 675 else 676 { 677 pBuf = (PVBOXUHGSMI_BUFFER)buf; 678 } 639 679 640 680 do … … 643 683 { 644 684 rc = pClient->pHGBuffer->pfnUnlock(pClient->pHGBuffer); 685 AssertRC(rc); 645 686 if (RT_FAILURE(rc)) 646 687 break; … … 660 701 aSubmit[2].cbData = pClient->pHGBuffer->cbBuffer; 661 702 aSubmit[2].fFlags.Value = 0; 662 aSubmit[2].fFlags.bHostWriteOnly = 1; 663 664 rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);703 704 rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 3); 705 AssertRC(rc); 665 706 if (RT_FAILURE(rc)) 666 707 { … … 670 711 671 712 parms = (CRVBOXHGSMIWRITEREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms)); 713 Assert(parms); 672 714 if (parms) 673 715 { … … 681 723 rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(cbWriteback), 682 724 VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE, NULL, &pClient->pHGBuffer); 725 AssertRC(rc); 683 726 CRASSERT(RT_SUCCESS(rc)); 684 727 if (RT_SUCCESS(rc)) … … 713 756 PCRVBOXHGSMI_CLIENT pClient; 714 757 PVBOXUHGSMI_BUFFER pBuf; 758 759 Assert(0); 715 760 716 761 if (!bufp) /* We're sending a user-allocated buffer. */ … … 735 780 736 781 pBuf = _crVBoxHGSMIBufFromMemPtr(*bufp); 782 Assert(pBuf); 737 783 if (!pBuf) 738 784 return; … … 767 813 PCRVBOXHGSMI_CLIENT pClient; 768 814 PVBOXUHGSMI_BUFFER pBuf = _crVBoxHGSMIBufFromMemPtr(buf); 815 Assert(pBuf); 816 Assert(0); 769 817 CRASSERT(0); 770 818 if (!pBuf) … … 777 825 { 778 826 CRVBOXHGSMIBUFFER *hgsmi_buffer = (CRVBOXHGSMIBUFFER *) buf - 1; 827 828 Assert(0); 829 779 830 CRASSERT(hgsmi_buffer->magic == CR_VBOXHGSMI_BUFFER_MAGIC); 780 831 … … 809 860 810 861 len = conn->cbBuffer; 862 Assert(len > 0); 863 Assert(conn->pBuffer); 811 864 CRASSERT(len > 0); 812 865 CRASSERT(conn->pBuffer); … … 883 936 { 884 937 PCRVBOXHGSMI_CLIENT pClient = _crVBoxHGSMIClientGet(); 938 939 Assert(pClient); 940 Assert(0); 941 885 942 _crVBoxHGSMIReceiveMessage(conn, pClient); 886 943 } … … 890 947 static void crVBoxHGSMIAccept( CRConnection *conn, const char *hostname, unsigned short port ) 891 948 { 949 Assert(0); 950 892 951 CRASSERT(conn && conn->pHostBuffer); 893 952 #ifdef IN_GUEST … … 912 971 913 972 rc = crVBoxHGCMCall(&parms, sizeof(parms)); 973 974 AssertRC(rc); 914 975 915 976 if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.result)) … … 954 1015 if (g_crvboxhgsmi.hGuestDrv == INVALID_HANDLE_VALUE) 955 1016 { 1017 Assert(0); 956 1018 crDebug("could not open VBox Guest Additions driver! rc = %d\n", GetLastError()); 957 1019 return FALSE; … … 1004 1066 else 1005 1067 { 1068 Assert(0); 1006 1069 crDebug("HGCM connect failed with rc=0x%x\n", info.result); 1007 1070 } … … 1118 1181 static void crVBoxHGSMIInstantReclaim(CRConnection *conn, CRMessage *mess) 1119 1182 { 1183 Assert(0); 1184 1120 1185 crVBoxHGSMIFree(conn, mess); 1121 1186 CRASSERT(FALSE); … … 1124 1189 static void crVBoxHGSMIHandleNewMessage( CRConnection *conn, CRMessage *msg, unsigned int len ) 1125 1190 { 1191 Assert(0); 1192 1126 1193 CRASSERT(FALSE); 1127 1194 } … … 1130 1197 { 1131 1198 PCRVBOXHGSMI_CLIENT pClient = crAlloc(sizeof (CRVBOXHGSMI_CLIENT)); 1199 1132 1200 if (pClient) 1133 1201 { … … 1137 1205 VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE, NULL, 1138 1206 &pClient->pCmdBuffer); 1207 AssertRC(rc); 1139 1208 if (RT_SUCCESS(rc)) 1140 1209 { … … 1142 1211 VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE, NULL, 1143 1212 &pClient->pHGBuffer); 1213 AssertRC(rc); 1144 1214 if (RT_SUCCESS(rc)) 1145 1215 { … … 1156 1226 DECLCALLBACK(void) _crVBoxHGSMIClientDestroy(HVBOXCRHGSMI_CLIENT hClient) 1157 1227 { 1228 Assert(0); 1229 1158 1230 /* @todo */ 1159 1231 } … … 1162 1234 bool crVBoxHGSMIInit(CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu) 1163 1235 { 1164 /* static */ int bHasHGSMI = -1; /* <- do it for each connection*/1236 /* static */ int bHasHGSMI = -1; /* do it for all connections */ 1165 1237 (void) mtu; 1166 1238 … … 1172 1244 Callbacks.pfnClientDestroy = _crVBoxHGSMIClientDestroy; 1173 1245 rc = VBoxCrHgsmiInit(&Callbacks); 1246 AssertRC(rc); 1174 1247 if (RT_SUCCESS(rc)) 1175 1248 bHasHGSMI = 1; … … 1178 1251 } 1179 1252 1253 Assert(bHasHGSMI); 1254 1180 1255 if (!bHasHGSMI) 1181 1256 return false; … … 1197 1272 /*@todo as we have 2 dll versions, can do it now.*/ 1198 1273 1274 #ifdef RT_OS_WINDOWS 1275 g_crvboxhgsmi.hGuestDrv = INVALID_HANDLE_VALUE; 1276 #else 1277 g_crvboxhgsmi.iGuestDrv = INVALID_HANDLE_VALUE; 1278 #endif 1199 1279 1200 1280 #ifdef CHROMIUM_THREADSAFE … … 1209 1289 void _crVBoxHGSMISysMemFree(void *data) 1210 1290 { 1291 Assert(0); 1292 1211 1293 crFree(data); 1212 1294 } … … 1215 1297 { 1216 1298 int32_t i, cCons; 1299 1300 Assert(0); 1217 1301 1218 1302 if (!g_crvboxhgsmi.initialized) return; … … 1302 1386 int32_t i; 1303 1387 1388 Assert(0); 1389 1304 1390 #ifdef IN_GUEST 1305 1391 /* we're on guest side, poll host if it got something for us */ … … 1338 1424 CRConnection** crVBoxHGSMIDump( int *num ) 1339 1425 { 1426 Assert(0); 1340 1427 *num = g_crvboxhgsmi.num_conns; 1341 1428 -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r33146 r33171 461 461 { 462 462 int rc; 463 463 464 switch (pCtl->enmType) 464 465 {
Note:
See TracChangeset
for help on using the changeset viewer.