From 0767bc491c5e70d6f623a49b37103f43263a70ff Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 4 Jul 2023 15:07:14 +0200 Subject: [PATCH] winvlc: call SetProcessDEPPolicy directly We build for Win7+, the function is always there. And no need to define PROCESS_DEP_ENABLE. It's available in mingw-w64 since 4.0. --- bin/winvlc.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/bin/winvlc.c b/bin/winvlc.c index 6b781eb6ac..af0ec5be8b 100644 --- a/bin/winvlc.c +++ b/bin/winvlc.c @@ -141,21 +141,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); - /* SetProcessDEPPolicy, SetDllDirectory, & Co. */ - HINSTANCE h_Kernel32 = GetModuleHandle(TEXT("kernel32.dll")); - if (h_Kernel32 != NULL) - { - /* Enable DEP */ -#ifndef PROCESS_DEP_ENABLE -# define PROCESS_DEP_ENABLE 1 -#endif /* PROCESS_DEP_ENABLE */ - BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags); - mySetProcessDEPPolicy = (BOOL (WINAPI *)(DWORD)) - GetProcAddress(h_Kernel32, "SetProcessDEPPolicy"); - if(mySetProcessDEPPolicy) - mySetProcessDEPPolicy(PROCESS_DEP_ENABLE); - - } + /* Enable DEP */ + SetProcessDEPPolicy(PROCESS_DEP_ENABLE); /* Do NOT load any library from cwd. */ SetDllDirectory(TEXT(""));