[vlc-commits] Win32: do not load DLL from cwd

Jean-Baptiste Kempf git at videolan.org
Sat Sep 3 18:28:48 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep  3 18:26:59 2011 +0200| [f87e9843a7d50b63e78690f02860c993c22e9be4] | committer: Rémi Duraffort

Win32: do not load DLL from cwd

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 bin/winvlc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 076781f..71a791f 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -128,12 +128,19 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     if(h_Kernel32)
     {
         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("");
+
         FreeLibrary(h_Kernel32);
     }
 



More information about the vlc-commits mailing list