Improve DYNAMIC_IMPORT

Don't call get_proc_address every time if if failed.
Also rename Utilities/dynamic_library.h to util/dyn_lib.hpp
This commit is contained in:
Nekotekina 2020-11-10 01:11:30 +03:00
parent cdaa8cb5c4
commit bd5253047b
7 changed files with 27 additions and 23 deletions

View file

@ -17,7 +17,7 @@
#include "Utilities/sema.h"
#ifdef _WIN32
#include <windows.h>
#include "Utilities/dynamic_library.h"
#include "util/dyn_lib.hpp"
DYNAMIC_IMPORT("ntdll.dll", NtQueryTimerResolution, NTSTATUS(PULONG MinimumResolution, PULONG MaximumResolution, PULONG CurrentResolution));
DYNAMIC_IMPORT("ntdll.dll", NtSetTimerResolution, NTSTATUS(ULONG DesiredResolution, BOOLEAN SetResolution, PULONG CurrentResolution));
#else