[vlc-commits] commit: Win32: do not load DLL from cwd (Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Wed Aug 25 22:57:12 CEST 2010
vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Aug 25 22:56:38 2010 +0200| [43a31df56c37bd62c691cdbe3c1f11babd164b56] | committer: Jean-Baptiste Kempf
Win32: do not load DLL from cwd
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=43a31df56c37bd62c691cdbe3c1f11babd164b56
---
bin/winvlc.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/bin/winvlc.c b/bin/winvlc.c
index 2d09cba..ac9b97c 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -131,12 +131,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