VirtualBox

Changeset 33171 in vbox


Ignore:
Timestamp:
Oct 15, 2010 11:10:10 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66707
Message:

wddm/3d: chromium hgsmi fixes

Location:
trunk/src/VBox
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp

    r33146 r33171  
    5454    if (g_hVBoxCrHgsmiProvider)
    5555    {
     56        if (g_pfnVBoxDispCrHgsmiInit)
     57        {
     58            g_pfnVBoxDispCrHgsmiInit(pCallbacks);
     59        }
    5660        ++g_cVBoxCrHgsmiProvider;
    5761        return VINF_SUCCESS;
     
    7377    {
    7478        hClient = g_pfnVBoxDispCrHgsmiQueryClient();
     79#ifdef DEBUG_misha
     80        Assert(hClient);
     81#endif
    7582        if (hClient)
    7683            return hClient;
     
    7885    PVBOXUHGSMI_PRIVATE_KMT pHgsmiGL = gt_pHgsmiGL;
    7986    if (pHgsmiGL)
     87    {
     88        Assert(pHgsmiGL->BasePrivate.hClient);
    8089        return pHgsmiGL->BasePrivate.hClient;
     90    }
    8191    pHgsmiGL = (PVBOXUHGSMI_PRIVATE_KMT)RTMemAllocZ(sizeof (*pHgsmiGL));
    8292    if (pHgsmiGL)
     
    8494        HRESULT hr = vboxUhgsmiKmtCreate(pHgsmiGL, TRUE /* bD3D tmp for injection thread*/);
    8595        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        }
    90103    }
    91104    else
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp

    r33117 r33171  
    732732#endif
    733733
    734 VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiInit(PVBOXCRHGSMI_CALLBACKS pCallbacks)
    735 {
    736 #ifdef VBOX_WITH_CRHGSMI
    737     g_VBoxCrHgsmiCallbacks = *pCallbacks;
    738 #endif
    739     return VINF_SUCCESS;
    740 }
    741 
    742734#ifdef VBOX_WITH_CRHGSMI
    743735static __declspec(thread) PVBOXUHGSMI_PRIVATE_BASE gt_pHgsmi = NULL;
    744736#endif
    745737
     738VBOXWDDMDISP_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
    746761VBOXWDDMDISP_DECL(int) VBoxDispCrHgsmiTerm()
    747762{
     
    753768#ifdef VBOX_WITH_CRHGSMI
    754769    PVBOXUHGSMI_PRIVATE_BASE pHgsmi = gt_pHgsmi;
     770#ifdef DEBUG_misha
     771    Assert(pHgsmi);
     772#endif
    755773    if (pHgsmi)
     774    {
     775        Assert(pHgsmi->hClient);
    756776        return pHgsmi->hClient;
     777    }
    757778#endif
    758779    return NULL;
     
    760781
    761782#ifdef VBOX_WITH_CRHGSMI
    762 static int vboxUhgsmiGlobalRetain()
    763 {
    764     int rc = VINF_SUCCESS;
     783static HRESULT vboxUhgsmiGlobalRetain()
     784{
     785    HRESULT hr = S_OK;
    765786    vboxDispLock();
    766787    if (!g_cVBoxUhgsmiKmtRefs)
    767788    {
    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)
    773802    {
    774803        ++g_cVBoxUhgsmiKmtRefs;
     
    776805    vboxDispUnlock();
    777806
    778     return rc;
    779 }
    780 
    781 static int vboxUhgsmiGlobalRelease()
    782 {
    783     int rc = VINF_SUCCESS;
     807    return hr;
     808}
     809
     810static HRESULT vboxUhgsmiGlobalRelease()
     811{
     812    HRESULT hr = S_OK;
    784813    vboxDispLock();
    785814    --g_cVBoxUhgsmiKmtRefs;
    786815    if (!g_cVBoxUhgsmiKmtRefs)
    787816    {
    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);
    790821    }
    791822    vboxDispUnlock();
    792     return rc;
     823    return hr;
    793824}
    794825
     
    803834}
    804835
    805 int vboxUhgsmiGlobalSetCurrent()
    806 {
    807     int rc = vboxUhgsmiGlobalRetain();
    808     AssertRC(rc);
    809     if (RT_SUCCESS(rc))
     836HRESULT vboxUhgsmiGlobalSetCurrent()
     837{
     838    HRESULT hr = vboxUhgsmiGlobalRetain();
     839    Assert(hr == S_OK);
     840    if (hr == S_OK)
    810841        vboxDispCrHgsmiClientSet(&g_VBoxUhgsmiKmt.BasePrivate);
    811     return rc;
    812 }
    813 
    814 int vboxUhgsmiGlobalClearCurrent()
     842    return hr;
     843}
     844
     845HRESULT vboxUhgsmiGlobalClearCurrent()
    815846{
    816847    vboxUhgsmiGlobalRelease();
    817848    vboxDispCrHgsmiClientClear();
    818     return VINF_SUCCESS;
     849    return S_OK;
    819850}
    820851
     
    69676998        pDevice->pDevice9If->Release();
    69686999    }
     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
    69697007
    69707008    HRESULT hr = vboxDispCmCtxDestroy(pDevice, &pDevice->DefaultContext);
     
    77277765            {
    77287766#ifdef VBOX_WITH_CRHGSMI
    7729                 int rc = vboxUhgsmiGlobalRetain();
    7730                 AssertRC(rc);
    7731                 if (RT_SUCCESS(rc))
     7767                hr = vboxUhgsmiGlobalRetain();
     7768                Assert(hr == S_OK);
     7769                if (hr == S_OK)
    77327770#endif
    77337771                {
     
    77727810#endif
    77737811                }
    7774 #ifdef VBOX_WITH_CRHGSMI
    7775                 else
    7776                 {
    7777                     hr = E_FAIL;
    7778                 }
    7779 #endif
    77807812            } while (0);
    77817813        }
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.h

    r33116 r33171  
    267267
    268268#ifdef VBOX_WITH_CRHGSMI
    269 int vboxUhgsmiGlobalSetCurrent();
    270 int vboxUhgsmiGlobalClearCurrent();
     269HRESULT vboxUhgsmiGlobalSetCurrent();
     270HRESULT vboxUhgsmiGlobalClearCurrent();
    271271#endif
    272272
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiBase.h

    r33146 r33171  
    9393    fLockFlags.WriteOnly = fFlags.bWriteOnly;
    9494    fLockFlags.DonotWait = fFlags.bDonotWait;
    95     fLockFlags.Discard = fFlags.bDiscard;
     95//    fLockFlags.Discard = fFlags.bDiscard;
    9696    *pfFlags = fLockFlags;
    9797    return VINF_SUCCESS;
     
    129129                  NULL, /* LPSECURITY_ATTRIBUTES lpSemaphoreAttributes */
    130130                  0, /* LONG lInitialCount */
    131                   ~0L, /* LONG lMaximumCount */
     131                  (LONG)((~0UL) >> 1), /* LONG lMaximumCount */
    132132                  NULL /* LPCTSTR lpName */
    133133                );
     
    187187        memset(pAllocationList, 0, sizeof (D3DDDI_ALLOCATIONLIST));
    188188        pAllocationList->hAllocation = pBuffer->hAllocation;
     189        pAllocationList->Value = 0;
    189190        pAllocationList->WriteOperation = !pBufInfo->fFlags.bHostReadOnly;
    190191        pAllocationList->DoNotRetireInstance = pBufInfo->fFlags.bDoNotRetire;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r33165 r33171  
    6060    {
    6161        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
     69static 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;
    6275        pInfo->segmentIdAlloc = pDmaAlloc->SegmentId;
    6376    }
     
    14371450        case VBOXWDDM_ALLOC_TYPE_UMD_HGSMI_BUFFER:
    14381451        {
    1439             ObDereferenceObject(pAllocation->pSynchEvent);
     1452            if (pAllocation->pSynchEvent)
     1453            {
     1454                ObDereferenceObject(pAllocation->pSynchEvent);
     1455            }
    14401456            break;
    14411457        }
     
    15771593                    pAllocation->SurfDesc.cbSize = pAllocInfo->cbBuffer;
    15781594                    pAllocationInfo->Flags.CpuVisible = 1;
    1579                     pAllocationInfo->Flags.SynchronousPaging = 1;
     1595//                    pAllocationInfo->Flags.SynchronousPaging = 1;
    15801596                    pAllocationInfo->AllocationPriority = D3DDDI_ALLOCATIONPRIORITY_MAXIMUM;
    15811597                    switch (pAllocInfo->enmSynchType)
     
    15951611                        case VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE:
    15961612                            pAllocation->pSynchEvent = NULL;
    1597                             Status == STATUS_SUCCESS;
     1613                            Status = STATUS_SUCCESS;
    15981614                            break;
    15991615                        default:
     
    20332049                        DXGK_ALLOCATIONLIST *pAllocation2Patch = (DXGK_ALLOCATIONLIST*)(pPrivateBuf + pPatchList->PatchOffset);
    20342050                        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 */
    20362053                    }
    20372054                }
     
    25432560
    25442561    NTSTATUS Status = STATUS_SUCCESS;
     2562    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
    25452563
    25462564    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     
    25512569        case DXGK_OPERATION_TRANSFER:
    25522570        {
     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);
    25532604//            pBuildPagingBuffer->pDmaBuffer = (uint8_t*)pBuildPagingBuffer->pDmaBuffer + VBOXVDMACMD_SIZE(VBOXVDMACMD_DMA_BPB_TRANSFER);
    25542605            break;
     
    40674118            {
    40684119                PVBOXWDDM_ALLOCATION pAlloc = vboxWddmGetAllocationFromAllocList(pDevExt, pAllocationList);
    4069                 vboxWddmPopulateDmaAllocInfo(&pSubmInfo->Alloc, pAlloc, pAllocationList);
     4120                vboxWddmPopulateDmaAllocInfoWithOffset(&pSubmInfo->Alloc, pAlloc, pAllocationList, pSubmUmInfo->offData);
    40704121
    40714122                pSubmInfo->cbData = pSubmUmInfo->cbData;
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r33146 r33171  
    247247                if (pVGAState->pDrv->pfnCrHgsmiCommandProcess)
    248248                {
     249                    VBoxSHGSMICommandMarkAsynchCompletion(pCmd);
    249250                    pVGAState->pDrv->pfnCrHgsmiCommandProcess(pVGAState->pDrv, pCrCmd);
    250251                    return true;
     
    276277    VBOXVDMACMD *pDmaHdr = VBOXVDMACMD_FROM_BODY(pCmd);
    277278    VBOXVDMACBUF_DR *pDr = VBOXVDMACBUF_DR_FROM_TAIL(pDmaHdr);
     279    AssertRC(rc);
    278280    pDr->rc = rc;
    279281
    280282    Assert(pVGAState->fGuestCaps & VBVACAPS_COMPLETEGCMD_BY_IOREAD);
    281     rc = HGSMICompleteGuestCommand(pIns, pDr, true /* do Irq */);
     283    rc = VBoxSHGSMICommandComplete(pIns, pDr);
    282284    AssertRC(rc);
    283285    return rc;
     
    289291    PVBOXVDMACMD_CHROMIUM_CTL_PRIVATE pCmdPrivate = VBOXVDMACMD_CHROMIUM_CTL_PRIVATE_FROM_CTL(pCmd);
    290292    pCmdPrivate->rc = rc;
     293    AssertRC(rc);
    291294    if (pCmdPrivate->pfnCompletion)
    292295    {
     
    10761079#endif
    10771080
     1081#ifdef DEBUG_misha
     1082    Assert(0);
     1083#endif
     1084
    10781085    VBOXVDMACMD_SUBMIT_CONTEXT Context;
    10791086    Context.pVdma = pVdma;
  • trunk/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c

    r33116 r33171  
    3939
    4040#include <iprt/thread.h>
     41#include <iprt/assert.h>
    4142
    4243#include <VBox/VBoxCrHgsmi.h>
     
    104105DECLINLINE(PCRVBOXHGSMI_CLIENT) _crVBoxHGSMIClientGet()
    105106{
    106     return (PCRVBOXHGSMI_CLIENT)VBoxCrHgsmiQueryClient();
     107    PCRVBOXHGSMI_CLIENT pClient = (PCRVBOXHGSMI_CLIENT)VBoxCrHgsmiQueryClient();
     108    Assert(pClient);
     109    return pClient;
    107110}
    108111
     
    142145        return VINF_SUCCESS;
    143146    }
     147    Assert(0);
    144148    crDebug("vboxCall failed with %x\n", GetLastError());
    145149    return VERR_NOT_SUPPORTED;
     
    237241    fFlags.bDiscard = 1;
    238242    rc = pClient->pCmdBuffer->pfnLock(pClient->pCmdBuffer, 0, cbBuffer, fFlags, (void**)&pHdr);
     243    AssertRC(rc);
    239244    if (RT_FAILURE(rc))
    240245        crWarning("Failed to Lock the command buffer of size(%d), rc(%d)\n", cbBuffer, rc);
     
    260265    fFlags.bReadOnly = 1;
    261266    rc = pClient->pCmdBuffer->pfnLock(pClient->pCmdBuffer, 0, cbBuffer, fFlags, (void**)&pHdr);
     267    AssertRC(rc);
    262268    if (RT_FAILURE(rc))
    263269        crWarning("Failed to Lock the command buffer of size(%d), rc(%d)\n", cbBuffer, rc);
     
    268274{
    269275    int rc = pClient->pCmdBuffer->pfnUnlock(pClient->pCmdBuffer);
     276    AssertRC(rc);
    270277    if (RT_FAILURE(rc))
    271278        crWarning("Failed to Unlock the command buffer rc(%d)\n", rc);
     
    277284    VBOXUHGSMI_BUFFER_LOCK_FLAGS fFlags;
    278285    int rc;
     286
    279287    fFlags.Value = 0;
    280288    fFlags.bReadOnly = 1;
    281289    rc = pClient->pCmdBuffer->pfnLock(pClient->pCmdBuffer, 0, sizeof (*pHdr), fFlags, (void**)&pHdr);
     290    AssertRC(rc);
    282291    if (RT_FAILURE(rc))
    283292    {
     
    287296
    288297    rc = pHdr->result;
     298    AssertRC(rc);
    289299    pClient->pCmdBuffer->pfnUnlock(pClient->pCmdBuffer);
    290300
     
    297307    PVBOXUHGSMI_BUFFER pBuf;
    298308    int rc;
     309
    299310    CRASSERT(pHdr->magic == CR_VBOXHGSMI_BUFFER_MAGIC);
    300311    pBuf = pHdr->pBuffer;
    301312    rc = pBuf->pfnUnlock(pBuf);
     313    AssertRC(rc);
    302314    if (RT_FAILURE(rc))
    303315    {
     
    311323    PVBOXUHGSMI_BUFFER buf;
    312324    int rc;
     325
    313326    buf = (PVBOXUHGSMI_BUFFER ) crBufferPoolPop(pClient->bufpool, cbSize);
    314327
    315328    if (!buf)
    316329    {
     330        Assert(0);
     331
    317332        crDebug("Buffer pool %p was empty; allocating new %d byte buffer.",
    318333                        (void *) pClient->bufpool,
     
    321336                                VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE, NULL,
    322337                                &buf);
     338        AssertRC(rc);
    323339        if (RT_FAILURE(rc))
    324340            crWarning("Failed to Create a buffer of size(%d), rc(%d)\n", cbSize, rc);
     
    341357    if (!pBuf)
    342358    {
     359        Assert(0);
     360
    343361        pBuf = (CRVBOXHGSMIBUFFER*)crAlloc(CRVBOXHGSMI_BUF_HDR_SIZE() + cbSize);
     362        Assert(pBuf);
    344363        if (pBuf)
    345364        {
     
    363382
    364383    buf = _crVBoxHGSMIBufAlloc(pClient, CRVBOXHGSMI_BUF_SIZE(cbSize));
    365 
     384    Assert(buf);
    366385    if (buf)
    367386    {
     
    390409{
    391410    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;
    393414}
    394415
     
    422443    {
    423444        CRVBOXHGSMIINJECT *parms = (CRVBOXHGSMIINJECT *)_crVBoxHGSMICmdBufferLock(pClient, sizeof (*parms));
     445        Assert(parms);
    424446        if (!parms)
    425447        {
     
    446468
    447469        rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);
     470        AssertRC(rc);
    448471        if (RT_SUCCESS(rc))
    449472        {
     
    478501
    479502        rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);
     503        AssertRC(rc);
    480504        if (RT_SUCCESS(rc))
    481505        {
     
    497521static void crVBoxHGSMIWriteExact(CRConnection *conn, const void *buf, unsigned int len)
    498522{
     523    Assert(0);
     524
    499525    CRASSERT(0);
    500526//    PCRVBOXHGSMI_CLIENT pClient;
     
    515541    uint32_t cbBuffer;
    516542
     543    Assert(parms);
     544
    517545    parms->hdr.result      = VERR_WRONG_ORDER;
    518546    parms->hdr.u32ClientID = conn->u32ClientID;
     
    545573
    546574    rc = pClient->pHgsmi->pfnBufferSubmitAsynch(pClient->pHgsmi, aSubmit, 2);
     575    AssertRC(rc);
    547576    if (RT_FAILURE(rc))
    548577    {
     
    552581
    553582    parms = (CRVBOXHGSMIREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms));
     583    Assert(parms);
    554584    if (!parms)
    555585    {
     
    569599        fFlags.Value = 0;
    570600        rc = pClient->pHGBuffer->pfnLock(pClient->pHGBuffer, 0, cbBuffer, fFlags, &pClient->pvHGBuffer);
     601        AssertRC(rc);
    571602        if (RT_SUCCESS(rc))
    572603        {
     
    617648        void *pvBuf;
    618649        pBuf = _crVBoxHGSMIBufAlloc(pClient, len);
     650        Assert(pBuf);
    619651        if (!pBuf)
    620652            return;
     653
     654        Assert(!offBuffer);
    621655
    622656        offBuffer = 0;
     
    625659        fFlags.bWriteOnly = 1;
    626660        rc = pBuf->pfnLock(pBuf, 0, len, fFlags, &pvBuf);
     661        AssertRC(rc);
    627662        if (RT_SUCCESS(rc))
    628663        {
    629664            memcpy(pvBuf, buf, len);
    630665            rc = pBuf->pfnUnlock(pBuf);
     666            AssertRC(rc);
    631667            CRASSERT(rc);
    632668        }
     
    637673        }
    638674    }
     675    else
     676    {
     677        pBuf = (PVBOXUHGSMI_BUFFER)buf;
     678    }
    639679
    640680    do
     
    643683        {
    644684            rc = pClient->pHGBuffer->pfnUnlock(pClient->pHGBuffer);
     685            AssertRC(rc);
    645686            if (RT_FAILURE(rc))
    646687                break;
     
    660701        aSubmit[2].cbData = pClient->pHGBuffer->cbBuffer;
    661702        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);
    665706        if (RT_FAILURE(rc))
    666707        {
     
    670711
    671712        parms = (CRVBOXHGSMIWRITEREAD *)_crVBoxHGSMICmdBufferLockRo(pClient, sizeof (*parms));
     713        Assert(parms);
    672714        if (parms)
    673715        {
     
    681723                rc = pClient->pHgsmi->pfnBufferCreate(pClient->pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(cbWriteback),
    682724                                VBOXUHGSMI_SYNCHOBJECT_TYPE_NONE, NULL, &pClient->pHGBuffer);
     725                AssertRC(rc);
    683726                CRASSERT(RT_SUCCESS(rc));
    684727                if (RT_SUCCESS(rc))
     
    713756    PCRVBOXHGSMI_CLIENT pClient;
    714757    PVBOXUHGSMI_BUFFER pBuf;
     758
     759    Assert(0);
    715760
    716761    if (!bufp) /* We're sending a user-allocated buffer. */
     
    735780
    736781    pBuf = _crVBoxHGSMIBufFromMemPtr(*bufp);
     782    Assert(pBuf);
    737783    if (!pBuf)
    738784        return;
     
    767813    PCRVBOXHGSMI_CLIENT pClient;
    768814    PVBOXUHGSMI_BUFFER pBuf = _crVBoxHGSMIBufFromMemPtr(buf);
     815    Assert(pBuf);
     816    Assert(0);
    769817    CRASSERT(0);
    770818    if (!pBuf)
     
    777825{
    778826    CRVBOXHGSMIBUFFER *hgsmi_buffer = (CRVBOXHGSMIBUFFER *) buf - 1;
     827
     828    Assert(0);
     829
    779830    CRASSERT(hgsmi_buffer->magic == CR_VBOXHGSMI_BUFFER_MAGIC);
    780831
     
    809860
    810861    len = conn->cbBuffer;
     862    Assert(len > 0);
     863    Assert(conn->pBuffer);
    811864    CRASSERT(len > 0);
    812865    CRASSERT(conn->pBuffer);
     
    883936{
    884937    PCRVBOXHGSMI_CLIENT pClient = _crVBoxHGSMIClientGet();
     938
     939    Assert(pClient);
     940    Assert(0);
     941
    885942    _crVBoxHGSMIReceiveMessage(conn, pClient);
    886943}
     
    890947static void crVBoxHGSMIAccept( CRConnection *conn, const char *hostname, unsigned short port )
    891948{
     949    Assert(0);
     950
    892951    CRASSERT(conn && conn->pHostBuffer);
    893952#ifdef IN_GUEST
     
    912971
    913972    rc = crVBoxHGCMCall(&parms, sizeof(parms));
     973
     974    AssertRC(rc);
    914975
    915976    if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.result))
     
    9541015        if (g_crvboxhgsmi.hGuestDrv == INVALID_HANDLE_VALUE)
    9551016        {
     1017            Assert(0);
    9561018            crDebug("could not open VBox Guest Additions driver! rc = %d\n", GetLastError());
    9571019            return FALSE;
     
    10041066        else
    10051067        {
     1068            Assert(0);
    10061069            crDebug("HGCM connect failed with rc=0x%x\n", info.result);
    10071070        }
     
    11181181static void crVBoxHGSMIInstantReclaim(CRConnection *conn, CRMessage *mess)
    11191182{
     1183    Assert(0);
     1184
    11201185    crVBoxHGSMIFree(conn, mess);
    11211186    CRASSERT(FALSE);
     
    11241189static void crVBoxHGSMIHandleNewMessage( CRConnection *conn, CRMessage *msg, unsigned int len )
    11251190{
     1191    Assert(0);
     1192
    11261193    CRASSERT(FALSE);
    11271194}
     
    11301197{
    11311198    PCRVBOXHGSMI_CLIENT pClient = crAlloc(sizeof (CRVBOXHGSMI_CLIENT));
     1199
    11321200    if (pClient)
    11331201    {
     
    11371205                                VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE, NULL,
    11381206                                &pClient->pCmdBuffer);
     1207        AssertRC(rc);
    11391208        if (RT_SUCCESS(rc))
    11401209        {
     
    11421211                                            VBOXUHGSMI_SYNCHOBJECT_TYPE_SEMAPHORE, NULL,
    11431212                                            &pClient->pHGBuffer);
     1213            AssertRC(rc);
    11441214            if (RT_SUCCESS(rc))
    11451215            {
     
    11561226DECLCALLBACK(void) _crVBoxHGSMIClientDestroy(HVBOXCRHGSMI_CLIENT hClient)
    11571227{
     1228    Assert(0);
     1229
    11581230    /* @todo */
    11591231}
     
    11621234bool crVBoxHGSMIInit(CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu)
    11631235{
    1164     /* static */ int bHasHGSMI = -1; /* <- do it for each connection */
     1236    /* static */ int bHasHGSMI = -1; /* do it for all connections */
    11651237    (void) mtu;
    11661238
     
    11721244        Callbacks.pfnClientDestroy = _crVBoxHGSMIClientDestroy;
    11731245        rc = VBoxCrHgsmiInit(&Callbacks);
     1246        AssertRC(rc);
    11741247        if (RT_SUCCESS(rc))
    11751248            bHasHGSMI = 1;
     
    11781251    }
    11791252
     1253    Assert(bHasHGSMI);
     1254
    11801255    if (!bHasHGSMI)
    11811256        return false;
     
    11971272    /*@todo as we have 2 dll versions, can do it now.*/
    11981273
     1274#ifdef RT_OS_WINDOWS
     1275    g_crvboxhgsmi.hGuestDrv = INVALID_HANDLE_VALUE;
     1276#else
     1277    g_crvboxhgsmi.iGuestDrv = INVALID_HANDLE_VALUE;
     1278#endif
    11991279
    12001280#ifdef CHROMIUM_THREADSAFE
     
    12091289void _crVBoxHGSMISysMemFree(void *data)
    12101290{
     1291    Assert(0);
     1292
    12111293    crFree(data);
    12121294}
     
    12151297{
    12161298    int32_t i, cCons;
     1299
     1300    Assert(0);
    12171301
    12181302    if (!g_crvboxhgsmi.initialized) return;
     
    13021386    int32_t i;
    13031387
     1388    Assert(0);
     1389
    13041390#ifdef IN_GUEST
    13051391    /* we're on guest side, poll host if it got something for us */
     
    13381424CRConnection** crVBoxHGSMIDump( int *num )
    13391425{
     1426    Assert(0);
    13401427    *num = g_crvboxhgsmi.num_conns;
    13411428
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r33146 r33171  
    461461{
    462462    int rc;
     463
    463464    switch (pCtl->enmType)
    464465    {
Note: See TracChangeset for help on using the changeset viewer.

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