VirtualBox

Changeset 21954 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Aug 4, 2009 11:49:32 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: fix stack corruption leading to crash when running call of duty

Location:
trunk/src/VBox/Additions/common/crOpenGL
Files:
2 edited

Legend:

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

    r21880 r21954  
    697697}
    698698
    699 const GLubyte * WINAPI wglGetExtensionsStringEXT_prox( HDC hdc )
    700 {
    701     static GLubyte *retval = "WGL_EXT_pixel_format WGL_ARB_pixel_format WGL_ARB_multisample";
    702 
     699BOOL WINAPI wglSwapIntervalEXT_prox(int interval)
     700{
     701    return TRUE;
     702}
     703
     704int  WINAPI wglGetSwapIntervalEXT_prox()
     705{
     706    return 1;
     707}
     708
     709static GLubyte *gsz_wgl_extensions = "WGL_EXT_pixel_format WGL_ARB_pixel_format WGL_ARB_multisample";
     710
     711const GLubyte * WINAPI wglGetExtensionsStringEXT_prox()
     712{
     713    return gsz_wgl_extensions;
     714}
     715
     716const GLubyte * WINAPI wglGetExtensionsStringARB_prox(HDC hdc)
     717{
    703718    (void) hdc;
    704719
    705     return retval;
    706 }
    707 
     720    return gsz_wgl_extensions;
     721}
  • trunk/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py

    r20635 r21954  
    9292};
    9393
    94 extern const GLubyte * WINAPI wglGetExtensionsStringEXT_prox( HDC hdc );
     94extern const GLubyte * WINAPI wglGetExtensionsStringEXT_prox(void);
     95extern const GLubyte * WINAPI wglGetExtensionsStringARB_prox(HDC hdc);
    9596extern BOOL WINAPI wglChoosePixelFormatEXT_prox(HDC hdc, const int *piAttributes, const FLOAT *pfAttributes, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
    9697extern BOOL WINAPI wglGetPixelFormatAttribivEXT_prox(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *pValues);
     
    101102    int i;
    102103    wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT = wglGetExtensionsStringEXT_prox;
     104    wglGetExtensionsStringARBFunc_t wglGetExtensionsStringARB = wglGetExtensionsStringARB_prox;
    103105    wglChoosePixelFormatEXTFunc_t wglChoosePixelFormatEXT = wglChoosePixelFormatEXT_prox;
    104106    wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT = wglGetPixelFormatAttribivEXT_prox;
     
    115117
    116118    if (!crStrcmp( name, "wglGetExtensionsStringEXT" )) return (CR_PROC) wglGetExtensionsStringEXT;
    117     if (!crStrcmp( name, "wglGetExtensionsStringARB" )) return (CR_PROC) wglGetExtensionsStringEXT;
     119    if (!crStrcmp( name, "wglGetExtensionsStringARB" )) return (CR_PROC) wglGetExtensionsStringARB;
    118120
    119121    if (!crStrcmp( name, "wglChoosePixelFormatEXT" )) return (CR_PROC) wglChoosePixelFormatEXT;
     
    123125    if (!crStrcmp( name, "wglChoosePixelFormatARB" )) return (CR_PROC) wglChoosePixelFormatEXT;
    124126    if (!crStrcmp( name, "wglGetPixelFormatAttribivARB" )) return (CR_PROC) wglGetPixelFormatAttribivEXT;
    125     if (!crStrcmp( name, "wglGetPixelFormatAttribfvARB" )) return (CR_PROC) wglGetPixelFormatAttribfvEXT; 
     127    if (!crStrcmp( name, "wglGetPixelFormatAttribfvARB" )) return (CR_PROC) wglGetPixelFormatAttribfvEXT;
    126128
    127129    crDebug("Returning GetProcAddress:NULL for %s", name);
Note: See TracChangeset for help on using the changeset viewer.

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