mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 08:59:32 +02:00
Merged revision(s) 56180 #9823f61682 from trunk:
win32: fix GetDpiForMonitor SIGSEGV if Shcore is not available (e.g. on MS Windows Server 2012 R2) ........ git-svn-id: branches/fixes_1_8@56238 -
This commit is contained in:
parent
07c9056e62
commit
643398e6f9
@ -296,19 +296,18 @@ function InitShellScalingStubs: Boolean;
|
||||
var
|
||||
hShcore: Windows.HMODULE;
|
||||
begin
|
||||
if g_fShellScalingInitDone then
|
||||
Exit(@g_pfnGetDpiForMonitor <> nil);
|
||||
|
||||
hShcore := GetModuleHandle('Shcore');
|
||||
if hShcore<>0 then
|
||||
if not g_fShellScalingInitDone then
|
||||
begin
|
||||
Pointer(g_pfnGetDpiForMonitor) := GetProcAddress(hShcore, 'GetDpiForMonitor');
|
||||
hShcore := GetModuleHandle('Shcore');
|
||||
if hShcore<>0 then
|
||||
Pointer(g_pfnGetDpiForMonitor) := GetProcAddress(hShcore, 'GetDpiForMonitor')
|
||||
else
|
||||
Pointer(g_pfnGetDpiForMonitor) := nil;
|
||||
|
||||
g_fShellScalingInitDone := True;
|
||||
end else
|
||||
begin
|
||||
Pointer(g_pfnGetDpiForMonitor) := nil;
|
||||
end;
|
||||
|
||||
Result := (Pointer(g_pfnGetDpiForMonitor)<>nil) and (@g_pfnGetDpiForMonitor <> nil);
|
||||
end;
|
||||
|
||||
function xGetDpiForMonitor(hmonitor: HMONITOR; dpiType: TMonitorDpiType;
|
||||
|
Loading…
Reference in New Issue
Block a user