-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
build(windows): add arm64 initial support #3905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
bd1d49c
8d0d9e6
e8c62fc
c299f9a
ea61996
ba9b25c
9c6fedc
de22b27
885acc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# windows specific dependencies | ||
|
||
# Make sure MinHook is installed | ||
find_library(MINHOOK_LIBRARY libMinHook.a REQUIRED) | ||
find_path(MINHOOK_INCLUDE_DIR MinHook.h PATH_SUFFIXES include REQUIRED) | ||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64") | ||
# Make sure MinHook is installed | ||
find_library(MINHOOK_LIBRARY libMinHook.a REQUIRED) | ||
find_path(MINHOOK_INCLUDE_DIR MinHook.h PATH_SUFFIXES include REQUIRED) | ||
|
||
add_library(minhook::minhook STATIC IMPORTED) | ||
set_property(TARGET minhook::minhook PROPERTY IMPORTED_LOCATION ${MINHOOK_LIBRARY}) | ||
target_include_directories(minhook::minhook INTERFACE ${MINHOOK_INCLUDE_DIR}) | ||
add_library(minhook::minhook STATIC IMPORTED) | ||
set_property(TARGET minhook::minhook PROPERTY IMPORTED_LOCATION ${MINHOOK_LIBRARY}) | ||
target_include_directories(minhook::minhook INTERFACE ${MINHOOK_INCLUDE_DIR}) | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,11 @@ | |
// lib includes | ||
#include <boost/algorithm/string/join.hpp> | ||
#include <boost/process/v1.hpp> | ||
#include <MinHook.h> | ||
|
||
// conditional includes | ||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) | ||
#include <MinHook.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can/should do this. It might work now by luck because none of the Windows ARM64 machines out in the wild have a discrete GPU, but it is definitely not guaranteed to continue working. We should look into hooking libraries that support ARM64, like Detours. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MediaTek + NVIDIA SoCs in 2026 Step by step, complete the initial support first |
||
#endif | ||
|
||
// We have to include boost/process/v1.hpp before display.h due to WinSock.h, | ||
// but that prevents the definition of NTSTATUS so we must define it ourself. | ||
|
@@ -407,6 +411,7 @@ namespace platf::dxgi { | |
return false; | ||
} | ||
|
||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) | ||
/** | ||
* @brief Hook for NtGdiDdDDIGetCachedHybridQueryValue() from win32u.dll. | ||
* @param gpuPreference A pointer to the location where the preference will be written. | ||
|
@@ -425,6 +430,7 @@ namespace platf::dxgi { | |
return STATUS_INVALID_PARAMETER; | ||
} | ||
} | ||
#endif | ||
|
||
int display_base_t::init(const ::video::config_t &config, const std::string &display_name) { | ||
std::once_flag windows_cpp_once_flag; | ||
|
@@ -444,12 +450,14 @@ namespace platf::dxgi { | |
FreeLibrary(user32); | ||
} | ||
|
||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) | ||
{ | ||
// We aren't calling MH_Uninitialize(), but that's okay because this hook lasts for the life of the process | ||
MH_Initialize(); | ||
MH_CreateHookApi(L"win32u.dll", "NtGdiDdDDIGetCachedHybridQueryValue", (void *) NtGdiDdDDIGetCachedHybridQueryValueHook, nullptr); | ||
MH_EnableHook(MH_ALL_HOOKS); | ||
} | ||
#endif | ||
}); | ||
|
||
// Get rectangle of full desktop for absolute mouse coordinates | ||
|
Uh oh!
There was an error while loading. Please reload this page.