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
This commit is contained in:
Eric Wasylishen 2014-10-17 00:15:49 +00:00
parent 336cbb1cb2
commit 53288141e7

View file

@ -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);