VirtualBox

Ignore:
Timestamp:
Jun 17, 2013 2:32:51 PM (12 years ago)
Author:
vboxsync
Message:

updates

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/switcher/sw_common.c

    r46521 r46593  
    11/* $Id$ */
    2 
    32/** @file
    43 * VBox D3D8/9 dll switcher
     
    65
    76/*
    8  * Copyright (C) 2009 Oracle Corporation
     7 * Copyright (C) 2009-2013 Oracle Corporation
    98 *
    109 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2322static char* gsBlackListDll[] = {"awt.dll", "wpfgfx_v0400.dll", "wpfgfx_v0300.dll", NULL};
    2423
     24/**
     25 * Loads a system DLL.
     26 *
     27 * @returns Module handle or NULL
     28 * @param   pszName             The DLL name.
     29 */
     30static HMODULE loadSystemDll(const char *pszName)
     31{
     32    char   szPath[MAX_PATH];
     33    UINT   cchPath = GetSystemDirectoryA(szPath, sizeof(szPath));
     34    size_t cbName  = strlen(pszName) + 1;
     35    if (cchPath + 1 + cbName > sizeof(szPath))
     36        return NULL;
     37    szPath[cchPath] = '\\';
     38    memcpy(&szPath[cchPath + 1], pszName, cbName);
     39    return LoadLibraryA(szPath);
     40}
     41
    2542/* Checks if 3D is enabled for VM and it works on host machine */
    2643BOOL isVBox3DEnabled(void)
     
    3148
    3249#ifdef VBOX_WDDM_WOW64
    33     hDLL = LoadLibrary("VBoxOGL-x86.dll");
     50    hDLL = loadSystemDll("VBoxOGL-x86.dll");
    3451#else
    35     hDLL = LoadLibrary("VBoxOGL.dll");
     52    hDLL = loadSystemDll("VBoxOGL.dll");
    3653#endif
    3754
     
    108125
    109126    if (isVBox3DEnabled() && checkOptions())
    110     {
    111127        dllName = vboxName;
    112     } else
    113     {
     128    else
    114129        dllName = msName;
    115     }
    116130
    117     hDLL = LoadLibrary(dllName);
     131    hDLL = loadSystemDll(dllName);
    118132    FillD3DExports(hDLL);
    119133}
     134
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c

    r46521 r46593  
    51215121}
    51225122
     5123/**
     5124 * Loads a system DLL.
     5125 *
     5126 * @returns Module handle or NULL
     5127 * @param   pszName             The DLL name.
     5128 */
     5129static HMODULE loadSystemDll(const char *pszName)
     5130{
     5131    char   szPath[MAX_PATH];
     5132    UINT   cchPath = GetSystemDirectoryA(szPath, sizeof(szPath));
     5133    size_t cbName  = strlen(pszName) + 1;
     5134    if (cchPath + 1 + cbName > sizeof(szPath))
     5135        return NULL;
     5136    szPath[cchPath] = '\\';
     5137    memcpy(&szPath[cchPath + 1], pszName, cbName);
     5138    return LoadLibraryA(szPath);
     5139}
     5140
    51235141/* Do not call while under the GL lock. */
    51245142static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal)
     
    51425160#ifdef USE_WIN32_OPENGL
    51435161    {
    5144 #ifndef VBOX
     5162# ifndef VBOX
    51455163        HMODULE mod_gl = GetModuleHandleA("opengl32.dll");
    5146 #else
     5164# else
    51475165        BOOL (APIENTRY *pDrvValidateVersion)(DWORD) DECLSPEC_HIDDEN;
    5148 # ifdef VBOX_WDDM_WOW64
    5149         HMODULE mod_gl = LoadLibraryA("VBoxOGL-x86.dll");
    5150 # else
    5151         HMODULE mod_gl = LoadLibraryA("VBoxOGL.dll");
    5152 # endif
     5166#  ifdef VBOX_WDDM_WOW64
     5167        HMODULE mod_gl = loadSystemDll("VBoxOGL-x86.dll");
     5168#  else
     5169        HMODULE mod_gl = loadSystemDll("VBoxOGL.dll");
     5170#  endif
    51535171        if (!mod_gl)
    51545172        {
     
    51695187        }
    51705188
    5171 # define VBOX_USE_FUNC(f) p##f = (void *)GetProcAddress(mod_gl, #f);
     5189#  define VBOX_USE_FUNC(f) p##f = (void *)GetProcAddress(mod_gl, #f);
    51725190        VBOX_GL_FUNCS_GEN
    5173 # undef VBOX_USE_FUNC
    5174 #endif
    5175 #define USE_GL_FUNC(f) gl_info->gl_ops.gl.p_##f = (void *)GetProcAddress(mod_gl, #f);
     5191#  undef VBOX_USE_FUNC
     5192# endif
     5193# define USE_GL_FUNC(f) gl_info->gl_ops.gl.p_##f = (void *)GetProcAddress(mod_gl, #f);
    51765194        ALL_WGL_FUNCS
    5177 #undef USE_GL_FUNC
     5195# undef USE_GL_FUNC
    51785196        gl_info->gl_ops.wgl.p_wglSwapBuffers = (void *)GetProcAddress(mod_gl, "wglSwapBuffers");
    51795197    }
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