VirtualBox

Ignore:
Timestamp:
May 3, 2015 3:21:53 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99993
Message:

3D: addition: treat a little bit more carefully with pointers (Win GAs).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/icd_drv.c

    r51559 r55620  
    110110PICDTABLE APIENTRY DrvSetContext(HDC hdc, HGLRC hglrc, void *callback)
    111111{
    112     ContextInfo *context;
    113     WindowInfo *window;
    114     BOOL ret;
    115 
    116     CR_DDI_PROLOGUE();
    117 
    118     /*crDebug( "DrvSetContext called(0x%x, 0x%x)", hdc, hglrc );*/
     112    ContextInfo *pContext;
     113    WindowInfo  *pWindowInfo;
     114    BOOL ret = false;
     115
     116    CR_DDI_PROLOGUE();
     117
    119118    (void) (callback);
    120119
     
    122121    crHashtableLock(stub.contextTable);
    123122
    124     context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc);
    125     window = stubGetWindowInfo(hdc);
    126 
    127     ret = stubMakeCurrent(window, context);
     123    pContext = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc);
     124    if (pContext)
     125    {
     126        pWindowInfo = stubGetWindowInfo(hdc);
     127        if (pWindowInfo)
     128            ret = stubMakeCurrent(pWindowInfo, pContext);
     129        else
     130            crError("no window info available.");
     131    }
     132    else
     133        crError("No context found.");
    128134
    129135    crHashtableUnlock(stub.contextTable);
    130136    crHashtableUnlock(stub.windowTable);
    131137
    132     return ret ? &icdTable:NULL;
     138    return ret ? &icdTable : NULL;
    133139}
    134140
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