thqby / ahk2_lib

MIT License
215 stars 29 forks source link

Value type mismatch for QueryPerformance functions #1

Closed vmech closed 2 years ago

vmech commented 2 years ago

In WinAPI\Kernel32.ahk value types should be Int64 but is currently Int.

thqby commented 2 years ago
QueryPerformanceCounter(lpPerformanceCount) => DllCall('Kernel32\QueryPerformanceCounter', 'ptr', lpPerformanceCount, 'int')
QueryPerformanceFrequency(lpFrequency) => DllCall('Kernel32\QueryPerformanceFrequency', 'ptr', lpFrequency, 'int')

Currently type is ptr, this is correct. Of course, it will be more convenient to use Int64*.

QueryPerformanceCounter() => (DllCall('Kernel32\QueryPerformanceCounter', 'int64*', &PerformanceCount := 0, 'int'), PerformanceCount)
QueryPerformanceFrequency() => (DllCall('Kernel32\QueryPerformanceFrequency', 'int64*', &Frequency := 0, 'int'), Frequency)