mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 09:09:09 +02:00
* fix for Mantis #38020: apply patch by Sergey Larin to use GetModuleHandle instead of LoadLibrary to retrieve GetTickCount64
git-svn-id: trunk@47274 -
This commit is contained in:
parent
5b4e028da4
commit
71c30761dd
@ -911,19 +911,13 @@ var
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
function GetTickCount64: QWord;
|
function GetTickCount64: QWord;
|
||||||
{$IFNDEF WINCE}
|
|
||||||
var
|
|
||||||
lib: THandle;
|
|
||||||
{$ENDIF}
|
|
||||||
begin
|
begin
|
||||||
{$IFNDEF WINCE}
|
{$IFNDEF WINCE}
|
||||||
|
if Assigned(WinGetTickCount64) then
|
||||||
|
Exit(WinGetTickCount64());
|
||||||
{ on Vista and newer there is a GetTickCount64 implementation }
|
{ on Vista and newer there is a GetTickCount64 implementation }
|
||||||
if Win32MajorVersion >= 6 then begin
|
if Win32MajorVersion >= 6 then begin
|
||||||
if not Assigned(WinGetTickCount64) then begin
|
WinGetTickCount64 := TGetTickCount64(GetProcAddress(GetModuleHandle('kernel32.dll'), 'GetTickCount64'));
|
||||||
lib := LoadLibrary('kernel32.dll');
|
|
||||||
WinGetTickCount64 := TGetTickCount64(
|
|
||||||
GetProcAddress(lib, 'GetTickCount64'));
|
|
||||||
end;
|
|
||||||
Result := WinGetTickCount64();
|
Result := WinGetTickCount64();
|
||||||
end else
|
end else
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Loading…
Reference in New Issue
Block a user