From 5c5ebd199afc66724e257c4003de940c6f2622b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 10 Dec 2017 18:04:10 +0200 Subject: [PATCH] win32: call SetDllDirectort() directly This looks like cargo cult. The function exists since XP SP1. --- 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 -- 2.11.4.GIT