Skip to content

Commit

Permalink
Update headers to 6406
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Dec 26, 2024
1 parent 644b09a commit dd224bd
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/common/unicode/farcolor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions plugins/common/unicode/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions plugins/common/vc_crt_fix.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
70 changes: 68 additions & 2 deletions plugins/common/vc_crt_fix_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,28 @@ 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)
{
struct implementation
{
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);
}
};

Expand All @@ -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);
}
};

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dd224bd

Please sign in to comment.