From 53288141e787291456fecdfed41ce835356f8341 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Fri, 17 Oct 2014 00:15:49 +0000 Subject: [PATCH] sys_sdl_win: Sys_SetDPIAware: only call GetProcAddress on a non-NULL library handle git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1121 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/sys_sdl_win.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Quake/sys_sdl_win.c b/Quake/sys_sdl_win.c index 090e9cb5..2fbc3af5 100644 --- a/Quake/sys_sdl_win.c +++ b/Quake/sys_sdl_win.c @@ -190,8 +190,8 @@ void Sys_SetDPIAware (void) hShcore = LoadLibraryA ("Shcore.dll"); hUser32 = LoadLibraryA ("user32.dll"); - setDPIAwareness = (SetProcessDPIAwarenessFunc) GetProcAddress(hShcore, "SetProcessDpiAwareness"); - setDPIAware = (SetProcessDPIAwareFunc) GetProcAddress (hUser32, "SetProcessDPIAware"); + setDPIAwareness = (SetProcessDPIAwarenessFunc) (hShcore ? GetProcAddress (hShcore, "SetProcessDpiAwareness") : NULL); + setDPIAware = (SetProcessDPIAwareFunc) (hUser32 ? GetProcAddress (hUser32, "SetProcessDPIAware") : NULL); if (setDPIAwareness) /* Windows 8.1+ */ setDPIAwareness (dpi_monitor_aware);