Changeset 46593 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine_new
- Timestamp:
- Jun 17, 2013 2:32:51 PM (12 years ago)
- 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 1 1 /* $Id$ */ 2 3 2 /** @file 4 3 * VBox D3D8/9 dll switcher … … 6 5 7 6 /* 8 * Copyright (C) 2009 Oracle Corporation7 * Copyright (C) 2009-2013 Oracle Corporation 9 8 * 10 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 23 22 static char* gsBlackListDll[] = {"awt.dll", "wpfgfx_v0400.dll", "wpfgfx_v0300.dll", NULL}; 24 23 24 /** 25 * Loads a system DLL. 26 * 27 * @returns Module handle or NULL 28 * @param pszName The DLL name. 29 */ 30 static 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 25 42 /* Checks if 3D is enabled for VM and it works on host machine */ 26 43 BOOL isVBox3DEnabled(void) … … 31 48 32 49 #ifdef VBOX_WDDM_WOW64 33 hDLL = LoadLibrary("VBoxOGL-x86.dll");50 hDLL = loadSystemDll("VBoxOGL-x86.dll"); 34 51 #else 35 hDLL = LoadLibrary("VBoxOGL.dll");52 hDLL = loadSystemDll("VBoxOGL.dll"); 36 53 #endif 37 54 … … 108 125 109 126 if (isVBox3DEnabled() && checkOptions()) 110 {111 127 dllName = vboxName; 112 } else 113 { 128 else 114 129 dllName = msName; 115 }116 130 117 hDLL = LoadLibrary(dllName);131 hDLL = loadSystemDll(dllName); 118 132 FillD3DExports(hDLL); 119 133 } 134 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c
r46521 r46593 5121 5121 } 5122 5122 5123 /** 5124 * Loads a system DLL. 5125 * 5126 * @returns Module handle or NULL 5127 * @param pszName The DLL name. 5128 */ 5129 static 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 5123 5141 /* Do not call while under the GL lock. */ 5124 5142 static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal) … … 5142 5160 #ifdef USE_WIN32_OPENGL 5143 5161 { 5144 # ifndef VBOX5162 # ifndef VBOX 5145 5163 HMODULE mod_gl = GetModuleHandleA("opengl32.dll"); 5146 # else5164 # else 5147 5165 BOOL (APIENTRY *pDrvValidateVersion)(DWORD) DECLSPEC_HIDDEN; 5148 # ifdef VBOX_WDDM_WOW645149 HMODULE mod_gl = LoadLibraryA("VBoxOGL-x86.dll");5150 # else5151 HMODULE mod_gl = LoadLibraryA("VBoxOGL.dll");5152 # endif5166 # ifdef VBOX_WDDM_WOW64 5167 HMODULE mod_gl = loadSystemDll("VBoxOGL-x86.dll"); 5168 # else 5169 HMODULE mod_gl = loadSystemDll("VBoxOGL.dll"); 5170 # endif 5153 5171 if (!mod_gl) 5154 5172 { … … 5169 5187 } 5170 5188 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); 5172 5190 VBOX_GL_FUNCS_GEN 5173 # undef VBOX_USE_FUNC5174 # endif5175 # 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); 5176 5194 ALL_WGL_FUNCS 5177 # undef USE_GL_FUNC5195 # undef USE_GL_FUNC 5178 5196 gl_info->gl_ops.wgl.p_wglSwapBuffers = (void *)GetProcAddress(mod_gl, "wglSwapBuffers"); 5179 5197 }
Note:
See TracChangeset
for help on using the changeset viewer.