Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/96ff15c970b389c6807d2cc2159663c950191abc
>---------------------------------------------------------------
commit 96ff15c970b389c6807d2cc2159663c950191abc
Author: Alex Alabuzhev <
alab...@gmail.com>
Date: Sat May 9 13:06:59 2026 +0100
Update headers to 6682
>---------------------------------------------------------------
96ff15c970b389c6807d2cc2159663c950191abc
plugins/common/unicode/farcolor.hpp | 2 +-
plugins/common/unicode/plugin.hpp | 5 ++--
plugins/common/vc_crt_fix.asm | 4 +++
plugins/common/vc_crt_fix_impl.cpp | 54 +++++++++++++++++++++++++++++++------
4 files changed, 53 insertions(+), 12 deletions(-)
diff --git a/plugins/common/unicode/farcolor.hpp b/plugins/common/unicode/farcolor.hpp
index 918edd5d3..26c62be8c 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.6632.0
+Colors Index for FAR Manager 3.0.6682.0
*/
/*
Copyright © 1996 Eugene Roshal
diff --git a/plugins/common/unicode/plugin.hpp b/plugins/common/unicode/plugin.hpp
index f80d2d2a8..c5afa66a8 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.6632.0
+Plugin API for Far Manager 3.0.6682.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 6632
+#define FARMANAGERVERSION_BUILD 6682
#define FARMANAGERVERSION_STAGE VS_PRIVATE
#ifndef RC_INVOKED
@@ -1858,7 +1858,6 @@ enum EDITOR_CURRENTSTATE
ECSTATE_LOCKED = 0x00000004,
};
-
struct EditorInfo
{
size_t StructSize;
diff --git a/plugins/common/vc_crt_fix.asm b/plugins/common/vc_crt_fix.asm
index b9af5667c..1d47488ca 100644
--- a/plugins/common/vc_crt_fix.asm
+++ b/plugins/common/vc_crt_fix.asm
@@ -44,7 +44,11 @@ else
endif
WRAPPER proto stdcall DARGS
+ifdef X64
IMP dq WRAPPER
+else
+ IMP dd WRAPPER
+endif
public IMP
ENDM
diff --git a/plugins/common/vc_crt_fix_impl.cpp b/plugins/common/vc_crt_fix_impl.cpp
index b8a294aa5..6b6a55d83 100644
--- a/plugins/common/vc_crt_fix_impl.cpp
+++ b/plugins/common/vc_crt_fix_impl.cpp
@@ -340,6 +340,45 @@ extern "C" int WINAPI WRAPPER(LCMapStringEx)(LPCWSTR LocaleName, DWORD MapFlags,
CREATE_AND_RETURN(modules::kernel32, LocaleName, MapFlags, SrcStr, SrcCount, DestStr, DestCount, VersionInformation, Reserved, SortHandle);
}
+namespace srw_lock_impl
+{
+ constexpr uintptr_t EXCLUSIVE_LOCKED = 0x1;
+
+ static void spin_wait(unsigned int Iteration)
+ {
+ if (Iteration < 10)
+ YieldProcessor();
+ else if (Iteration < 20)
+ Sleep(0);
+ else
+ Sleep(1);
+ }
+
+ void initialize(SRWLOCK* SRWLock)
+ {
+ *SRWLock = {};
+ }
+
+ bool try_acquire(SRWLOCK* SRWLock)
+ {
+ return InterlockedCompareExchangePointer(
+ &SRWLock->Ptr,
+ reinterpret_cast<PVOID>(EXCLUSIVE_LOCKED),
+ nullptr) == nullptr;
+ }
+
+ void acquire(SRWLOCK* SRWLock)
+ {
+ for (unsigned int SpinCount = 0; !try_acquire(SRWLock); spin_wait(SpinCount++))
+ ;
+ }
+
+ void release(SRWLOCK* SRWLock)
+ {
+ InterlockedExchangePointer(&SRWLock->Ptr, {});
+ }
+}
+
// VC2022
extern "C" BOOL WINAPI WRAPPER(SleepConditionVariableSRW)(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK SRWLock, DWORD Milliseconds, ULONG Flags)
{
@@ -374,9 +413,9 @@ extern "C" void WINAPI WRAPPER(AcquireSRWLockExclusive)(PSRWLOCK SRWLock)
{
struct implementation
{
- static void WINAPI impl(PSRWLOCK)
+ static void WINAPI impl(PSRWLOCK SRWLock)
{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ srw_lock_impl::acquire(SRWLock);
}
};
@@ -388,9 +427,9 @@ extern "C" void WINAPI WRAPPER(ReleaseSRWLockExclusive)(PSRWLOCK SRWLock)
{
struct implementation
{
- static void WINAPI impl(PSRWLOCK)
+ static void WINAPI impl(PSRWLOCK SRWLock)
{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ srw_lock_impl::release(SRWLock);
}
};
@@ -402,10 +441,9 @@ extern "C" BOOLEAN WINAPI WRAPPER(TryAcquireSRWLockExclusive)(PSRWLOCK SRWLock)
{
struct implementation
{
- static BOOLEAN WINAPI impl(PSRWLOCK)
+ static BOOLEAN WINAPI impl(PSRWLOCK SRWLock)
{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ return srw_lock_impl::try_acquire(SRWLock);
}
};
@@ -419,7 +457,7 @@ extern "C" void WINAPI WRAPPER(InitializeSRWLock)(PSRWLOCK SRWLock)
{
static void WINAPI impl(PSRWLOCK SRWLock)
{
- *SRWLock = SRWLOCK_INIT;
+ srw_lock_impl::initialize(SRWLock);
}
};