[vlc-commits] Winvlc: add comments
Jean-Baptiste Kempf
git at videolan.org
Fri Mar 10 13:59:43 CET 2017
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Mar 10 13:58:57 2017 +0100| [82326be1e9ce201d95f141638b5ff2103b060277] | committer: Jean-Baptiste Kempf
Winvlc: add comments
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=82326be1e9ce201d95f141638b5ff2103b060277
---
bin/winvlc.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/bin/winvlc.c b/bin/winvlc.c
index 05cbe75..ce44f5d 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -101,26 +101,30 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
SetErrorMode(SEM_FAILCRITICALERRORS);
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
- /* SetProcessDEPPolicy */
+ /* SetProcessDEPPolicy, SetDllDirectory, & Co. */
HINSTANCE h_Kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
if (h_Kernel32 != NULL)
{
- BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
- BOOL (WINAPI * mySetDllDirectoryA)(const char* lpPathName);
+ /* Enable DEP */
# define PROCESS_DEP_ENABLE 1
-
+ BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);
mySetProcessDEPPolicy = (BOOL (WINAPI *)(DWORD))
GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");
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("");
}
+ /***
+ * The LoadLibrary* calls from the modules and the 3rd party code
+ * will search in SYSTEM32 only
+ * */
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
/* Args */
More information about the vlc-commits
mailing list