[vlc-devel] [PATCH] vlc: call SetDllDirectory() directly

RĂ©mi Denis-Courmont remi at remlab.net
Wed Nov 23 17:50:21 CET 2016


This is supported since XP SP1, so there does not seem to be a benefit
in looking the symbol up at run-time.

Also this respects the Unicode setting.
---
 bin/winvlc.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index dfe8878..e789fd2 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -106,21 +106,15 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     if (h_Kernel32 != NULL)
     {
         BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
-        BOOL (WINAPI * mySetDllDirectoryA)(const char* lpPathName);
 # define PROCESS_DEP_ENABLE 1
 
         mySetProcessDEPPolicy = (BOOL (WINAPI *)(DWORD))
                             GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");
         if(mySetProcessDEPPolicy)
             mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);
-
-        /* Do NOT load any library from cwd. */
-        mySetDllDirectoryA = (BOOL (WINAPI *)(const char*))
-                            GetProcAddress(h_Kernel32, "SetDllDirectoryA");
-        if(mySetDllDirectoryA)
-            mySetDllDirectoryA("");
     }
 
+    SetDllDirectory(TEXT(""));
     SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
 
     /* Args */
-- 
2.10.2



More information about the vlc-devel mailing list