libobs/util: Add function to get Windows x64 emulation status

This commit is contained in:
Tommy Vercetti
2022-11-09 03:03:26 -08:00
committed by Jim
parent dc024a8643
commit 41efdc498c
3 changed files with 23 additions and 4 deletions
+17
View File
@@ -1088,9 +1088,26 @@ bool is_64_bit_windows(void)
#endif
}
bool is_arm64_windows(void)
{
#if defined(_M_ARM64) || defined(_M_ARM64EC)
return true;
#else
USHORT processMachine;
USHORT nativeMachine;
bool result = IsWow64Process2(GetCurrentProcess(), &processMachine,
&nativeMachine);
return (result && (nativeMachine == IMAGE_FILE_MACHINE_ARM64));
#endif
}
bool os_get_emulation_status(void)
{
#if defined(_M_ARM64) || defined(_M_ARM64EC)
return false;
#else
return is_arm64_windows();
#endif
}
void get_reg_dword(HKEY hkey, LPCWSTR sub_key, LPCWSTR value_name,
+1
View File
@@ -48,6 +48,7 @@ static inline int win_version_compare(const struct win_version_info *dst,
}
EXPORT bool is_64_bit_windows(void);
EXPORT bool is_arm64_windows(void);
EXPORT bool get_dll_ver(const wchar_t *lib, struct win_version_info *info);
EXPORT void get_win_ver(struct win_version_info *info);
EXPORT uint32_t get_win_ver_int(void);