[vlc-commits] [Git][videolan/vlc][master] 6 commits: d3d11_fmt: only load DXGIDEBUG.DLL from %windows%\system32

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Feb 4 06:41:20 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
833641de by Steve Lhomme at 2025-02-04T06:21:32+00:00
d3d11_fmt: only load DXGIDEBUG.DLL from %windows%\system32

- - - - -
57570b45 by Steve Lhomme at 2025-02-04T06:21:32+00:00
d3d11_fmt: only load d3d11_1sdklayers.dll from %windows%\system32

- - - - -
aaaaa7dc by Steve Lhomme at 2025-02-04T06:21:32+00:00
mft_d3d: only load mfplat.dll from %windows%\system32

- - - - -
d57d4751 by Steve Lhomme at 2025-02-04T06:21:32+00:00
direct3d9: only load D3dx9_XX.dll from %windows%\system32

- - - - -
07ac5669 by Steve Lhomme at 2025-02-04T06:21:32+00:00
wgl: only load opengl32.dll from %windows%\system32

- - - - -
a926c055 by Steve Lhomme at 2025-02-04T06:21:32+00:00
amf_helper: only load amfrt64.dll from %windows%\system32

- - - - -


5 changed files:

- modules/codec/mft_d3d.cpp
- modules/hw/amf/amf_helper.c
- modules/video_chroma/d3d11_fmt.cpp
- modules/video_output/win32/direct3d9.c
- modules/video_output/win32/wgl.c


Changes:

=====================================
modules/codec/mft_d3d.cpp
=====================================
@@ -50,7 +50,7 @@ vlc_mf_d3d::~vlc_mf_d3d()
 void vlc_mf_d3d::Init()
 {
 #if _WIN32_WINNT < _WIN32_WINNT_WIN8
-    HINSTANCE mfplat_dll = LoadLibraryA("mfplat.dll");
+    HINSTANCE mfplat_dll = LoadLibraryExA("mfplat.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
     if (mfplat_dll)
     {
         fptr_MFCreateDXGIDeviceManager = reinterpret_cast<decltype(fptr_MFCreateDXGIDeviceManager)>(


=====================================
modules/hw/amf/amf_helper.c
=====================================
@@ -17,7 +17,7 @@ int vlc_AMFCreateContext(struct vlc_amf_context *c)
 {
 #ifdef _WIN32
 # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-    HMODULE hLib = LoadLibraryA(AMF_DLL_NAMEA);
+    HMODULE hLib = LoadLibraryExA(AMF_DLL_NAMEA, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
     if (hLib == NULL)
         return VLC_ENOTSUP;
 


=====================================
modules/video_chroma/d3d11_fmt.cpp
=====================================
@@ -337,7 +337,7 @@ struct dxgi_debug_handle_t
         pf_DXGIGetDebugInterface = nullptr;
         if (IsDebuggerPresent())
         {
-            dxgidebug_dll = LoadLibrary(TEXT("DXGIDEBUG.DLL"));
+            dxgidebug_dll = LoadLibraryExA("DXGIDEBUG.DLL", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
             if (dxgidebug_dll)
             {
                 pf_DXGIGetDebugInterface =
@@ -474,7 +474,7 @@ static HRESULT CreateDevice(vlc_object_t *obj,
 #if !defined(NDEBUG) && !defined(BUILD_FOR_UAP)
     if (IsDebuggerPresent())
     {
-        HINSTANCE sdklayer_dll = LoadLibraryW(L"d3d11_1sdklayers.dll");
+        HINSTANCE sdklayer_dll = LoadLibraryExA("d3d11_1sdklayers.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
         if (sdklayer_dll) {
             creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
             FreeLibrary(sdklayer_dll);


=====================================
modules/video_output/win32/direct3d9.c
=====================================
@@ -187,9 +187,9 @@ static HINSTANCE Direct3D9LoadShaderLibrary(void)
 {
     HINSTANCE instance = NULL;
     for (int i = 43; i > 23; --i) {
-        WCHAR filename[16];
-        _snwprintf(filename, ARRAY_SIZE(filename), TEXT("D3dx9_%d.dll"), i);
-        instance = LoadLibrary(filename);
+        char filename[16];
+        _snprintf(filename, ARRAY_SIZE(filename), "D3dx9_%d.dll", i);
+        instance = LoadLibraryExA(filename, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
         if (instance)
             break;
     }


=====================================
modules/video_output/win32/wgl.c
=====================================
@@ -175,7 +175,7 @@ static int Open(vlc_gl_t *gl, unsigned width, unsigned height,
 
     sys->hvideownd = wnd->handle.hwnd;
     sys->hGLDC = GetDC(sys->hvideownd);
-    sys->hOpengl = LoadLibraryA("opengl32.dll");
+    sys->hOpengl = LoadLibraryExA("opengl32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
     if (sys->hGLDC == NULL)
     {
         msg_Err(gl, "Could not get the device context");



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9ab3f7da8b434fa5e348f5e1d679df66eef36511...a926c0558f84f11953dccc548a8146b4cf0a322a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9ab3f7da8b434fa5e348f5e1d679df66eef36511...a926c0558f84f11953dccc548a8146b4cf0a322a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list