diff --git a/plugins/common/unicode/farcolor.hpp b/plugins/common/unicode/farcolor.hpp index c8ac858f35..6a3e5eefda 100644 --- a/plugins/common/unicode/farcolor.hpp +++ b/plugins/common/unicode/farcolor.hpp @@ -5,7 +5,7 @@ /* farcolor.hpp -Colors Index for FAR Manager 3.0.6334.0 +Colors Index for FAR Manager 3.0.6406.0 */ /* Copyright © 1996 Eugene Roshal diff --git a/plugins/common/unicode/plugin.hpp b/plugins/common/unicode/plugin.hpp index f265e590c4..6bc8cdfe63 100644 --- a/plugins/common/unicode/plugin.hpp +++ b/plugins/common/unicode/plugin.hpp @@ -6,7 +6,7 @@ /* plugin.hpp -Plugin API for Far Manager 3.0.6334.0 +Plugin API for Far Manager 3.0.6406.0 */ /* Copyright © 1996 Eugene Roshal @@ -44,7 +44,7 @@ other possible license with no implications from the above license on them. #define FARMANAGERVERSION_MAJOR 3 #define FARMANAGERVERSION_MINOR 0 #define FARMANAGERVERSION_REVISION 0 -#define FARMANAGERVERSION_BUILD 6334 +#define FARMANAGERVERSION_BUILD 6406 #define FARMANAGERVERSION_STAGE VS_PRIVATE #ifndef RC_INVOKED diff --git a/plugins/common/vc_crt_fix.asm b/plugins/common/vc_crt_fix.asm index fab6b7ccb7..7f2302995b 100644 --- a/plugins/common/vc_crt_fix.asm +++ b/plugins/common/vc_crt_fix.asm @@ -62,6 +62,10 @@ HOOK QueryDepthSList , 4, :dword HOOK GetNumaHighestNodeNumber , 4, :dword HOOK GetLogicalProcessorInformation , 8, :dword, :dword HOOK SetThreadStackGuarantee , 4, :dword +HOOK FlsAlloc , 4, :dword +HOOK FlsGetValue , 4, :dword +HOOK FlsSetValue , 8, :dword, :dword +HOOK FlsFree , 4, :dword endif HOOK InitializeCriticalSectionEx , 12, :dword, :dword, :dword HOOK CompareStringEx , 36, :dword, :dword, :dword, :dword, :dword, :dword, :dword, :dword, :dword diff --git a/plugins/common/vc_crt_fix_impl.cpp b/plugins/common/vc_crt_fix_impl.cpp index 4743fded8b..1d8554848c 100644 --- a/plugins/common/vc_crt_fix_impl.cpp +++ b/plugins/common/vc_crt_fix_impl.cpp @@ -433,6 +433,20 @@ extern "C" BOOL WINAPI WRAPPER(InitializeCriticalSectionEx)(LPCRITICAL_SECTION C CREATE_AND_RETURN(modules::kernel32, CriticalSection, SpinCount, Flags); } +static LCID locale_name_to_lcid(const wchar_t* LocaleName) +{ + if (!LocaleName) + return LOCALE_USER_DEFAULT; + + if (!*LocaleName) + return LOCALE_INVARIANT; + + if (!lstrcmp(LocaleName, LOCALE_NAME_SYSTEM_DEFAULT)) + return LOCALE_SYSTEM_DEFAULT; + + return LOCALE_USER_DEFAULT; +} + // VC2019 extern "C" int WINAPI WRAPPER(CompareStringEx)(LPCWSTR LocaleName, DWORD CmpFlags, LPCWCH String1, int Count1, LPCWCH String2, int Count2, LPNLSVERSIONINFO VersionInformation, LPVOID Reserved, LPARAM Param) { @@ -440,7 +454,7 @@ extern "C" int WINAPI WRAPPER(CompareStringEx)(LPCWSTR LocaleName, DWORD CmpFlag { static int WINAPI impl(LPCWSTR LocaleName, DWORD CmpFlags, LPCWCH String1, int Count1, LPCWCH String2, int Count2, LPNLSVERSIONINFO VersionInformation, LPVOID Reserved, LPARAM Param) { - return CompareStringW(LOCALE_USER_DEFAULT, CmpFlags, String1, Count1, String2, Count2); + return CompareStringW(locale_name_to_lcid(LocaleName), CmpFlags, String1, Count1, String2, Count2); } }; @@ -454,7 +468,7 @@ extern "C" int WINAPI WRAPPER(LCMapStringEx)(LPCWSTR LocaleName, DWORD MapFlags, { static int WINAPI impl(LPCWSTR LocaleName, DWORD MapFlags, LPCWSTR SrcStr, int SrcCount, LPWSTR DestStr, int DestCount, LPNLSVERSIONINFO VersionInformation, LPVOID Reserved, LPARAM SortHandle) { - return LCMapStringW(LOCALE_USER_DEFAULT, MapFlags, SrcStr, SrcCount, DestStr, DestCount); + return LCMapStringW(locale_name_to_lcid(LocaleName), MapFlags, SrcStr, SrcCount, DestStr, DestCount); } }; @@ -518,6 +532,58 @@ extern "C" void WINAPI WRAPPER(ReleaseSRWLockExclusive)(PSRWLOCK SRWLock) CREATE_AND_RETURN(modules::kernel32, SRWLock); } +extern "C" DWORD WINAPI WRAPPER(FlsAlloc)(PFLS_CALLBACK_FUNCTION Callback) +{ + struct implementation + { + static DWORD WINAPI impl(PFLS_CALLBACK_FUNCTION Callback) + { + return TlsAlloc(); + } + }; + + CREATE_AND_RETURN(modules::kernel32, Callback); +} + +extern "C" PVOID WINAPI WRAPPER(FlsGetValue)(DWORD FlsIndex) +{ + struct implementation + { + static PVOID WINAPI impl(DWORD FlsIndex) + { + return TlsGetValue(FlsIndex); + } + }; + + CREATE_AND_RETURN(modules::kernel32, FlsIndex); +} + +extern "C" BOOL WINAPI WRAPPER(FlsSetValue)(DWORD FlsIndex, PVOID FlsData) +{ + struct implementation + { + static BOOL WINAPI impl(DWORD FlsIndex, PVOID FlsData) + { + return TlsSetValue(FlsIndex, FlsData); + } + }; + + CREATE_AND_RETURN(modules::kernel32, FlsIndex, FlsData); +} + +extern "C" BOOL WINAPI WRAPPER(FlsFree)(DWORD FlsIndex) +{ + struct implementation + { + static BOOL WINAPI impl(DWORD FlsIndex) + { + return TlsFree(FlsIndex); + } + }; + + CREATE_AND_RETURN(modules::kernel32, FlsIndex); +} + #undef CREATE_AND_RETURN #undef CREATE_AND_RETURN_NAMED #undef CREATE_AND_RETURN_IMPL