Detours
Detours copied to clipboard
fix build error for error C2065: 'GetThreadLocale'
When I try to build sample in vcpkg's download detours code(v4.0.1-2f7d798f9a) , I meet same build error: C2065: 'GetThreadLocale'
as #202 and #240 , although there is fix by add #if(WINVER >= 0x0500)
, but I think it's not best solution now, especially for traceapi( it can not hook GetThreadLocale ).
consider detour src build configuration is D_WIN32_WINNT=0x501
now, so update the samples's build macro to high value, 0x0501(same as source code define macro)
Microsoft Reviewers: Open in CodeFlow
If you look at the Detours FAQ we explicitly try to maintain compatibility with Windows NT.
If we took this change, we would be breaking that by assuming the minimum Windows API we support is Windows XP? https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
The source code builds with Windows XP as target, and does use APIs introduced in Windows XP, so the idea of Windows NT compat is probably gone already. This just fixes up the samples to also target Windows XP.
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days.
The source code builds with Windows XP as target, and does use APIs introduced in Windows XP, so the idea of Windows NT compat is probably gone already. This just fixes up the samples to also target Windows XP.
That's true, I had misremembered the _WIN32_WINNT
version src\Makefile
specifies.
Thanks for keeping me honest!