Using GetModuleHandle instead of LoadLibrary when getting the GetTickCount64 address
Original Reporter info from Mantis: Sergey Larin @sergy.larin
-
Reporter name: Sergey Larin
Original Reporter info from Mantis: Sergey Larin @sergy.larin
- Reporter name: Sergey Larin
Description:
When getting the address of the GetTickCount64 function, GetModuleHandle('kernel32.dll') is used, not LoadLibrary('kernel32.dll').
It is generally wrong to use LoadLibrary('kernel32.dll') without FreeLibrary('kernel32.dll').
You can use GetModuleHandle('kernel32.dll') because at the time of calling GetTickCount64 from SysUtils, the kernel32.dll library is guaranteed to be loaded.
Mantis conversion info:
- Mantis ID: 38020
- Fixed in version: 3.3.1
- Fixed in revision: 47274 (#71c30761)