mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
56833edae7
There is no need to LoadLibrary and GetProcAddress to get pointers to NtDelayExecution or NtSetTimerResolution. These functions don't have prototypes in any SDK header, but they are exported in ntdll.dll and we can simply declare the prototype and link ntdll. There is also no chance that the functions do not exist: I checked an old install of Windows NT 4.0 and both of these functions exist. Also used NtSetTimerResolution instead of ZeSetTimerResolution for consistency (they are the same). Also changed system timer resolution log message units to μs with one decimal digit for readability. This is the actual amount of precision available to us.
27 lines
928 B
C
27 lines
928 B
C
/**
|
|
* Looking Glass
|
|
* Copyright (C) 2017-2021 The Looking Glass Authors
|
|
* https://looking-glass.io
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
#include <windows.h>
|
|
|
|
void delayInit(void);
|
|
|
|
// like sleep but more accurate
|
|
void delayExecution(float ms);
|