[vlc-commits] win32: call SetDllDirectort() directly

Rémi Denis-Courmont git at videolan.org
Sun Dec 10 17:04:53 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 10 18:04:10 2017 +0200| [5c5ebd199afc66724e257c4003de940c6f2622b4] | committer: Rémi Denis-Courmont

win32: call SetDllDirectort() directly

This looks like cargo cult. The function exists since XP SP1.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5c5ebd199afc66724e257c4003de940c6f2622b4
---

 bin/winvlc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 0edadb0f88..37ad457919 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -149,14 +149,11 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
         if(mySetProcessDEPPolicy)
             mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
 
-        /* Do NOT load any library from cwd. */
-        BOOL (WINAPI * mySetDllDirectoryA)(const char* lpPathName);
-        mySetDllDirectoryA = (BOOL (WINAPI *)(const char*))
-                            GetProcAddress(h_Kernel32, "SetDllDirectoryA");
-        if(mySetDllDirectoryA)
-            mySetDllDirectoryA("");
     }
 
+    /* Do NOT load any library from cwd. */
+    SetDllDirectory(TEXT(""));
+
     /***
      * The LoadLibrary* calls from the modules and the 3rd party code
      * will search in SYSTEM32 only



More information about the vlc-commits mailing list