Changeset 46593 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d
- Timestamp:
- Jun 17, 2013 2:32:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.