From 78f92747a559ffa1011d2cabab1e77a755e20a4f Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 31 Dec 2022 13:47:52 +0100 Subject: [PATCH] Initial commit. --- .gitignore | 5 ++ CompatLib.sln | 25 ++++++ CompatLib/CompatLib.vcxproj | 132 ++++++++++++++++++++++++++++ CompatLib/CompatLib.vcxproj.filters | 30 +++++++ CompatLib/src/compat.c | 17 ++++ CompatLib/src/compat_x64.asm | 17 ++++ CompatLib/src/compat_x86.asm | 19 ++++ 7 files changed, 245 insertions(+) create mode 100644 .gitignore create mode 100644 CompatLib.sln create mode 100644 CompatLib/CompatLib.vcxproj create mode 100644 CompatLib/CompatLib.vcxproj.filters create mode 100644 CompatLib/src/compat.c create mode 100644 CompatLib/src/compat_x64.asm create mode 100644 CompatLib/src/compat_x86.asm diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8568f8a --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/.vs +/**/bin +/**/obj +/**/lib +*.user diff --git a/CompatLib.sln b/CompatLib.sln new file mode 100644 index 0000000..6d20165 --- /dev/null +++ b/CompatLib.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33130.400 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatLib", "CompatLib\CompatLib.vcxproj", "{42C9DDA4-0375-45AF-952D-825EA83EAE4C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {42C9DDA4-0375-45AF-952D-825EA83EAE4C}.Release|x64.ActiveCfg = Release|x64 + {42C9DDA4-0375-45AF-952D-825EA83EAE4C}.Release|x64.Build.0 = Release|x64 + {42C9DDA4-0375-45AF-952D-825EA83EAE4C}.Release|x86.ActiveCfg = Release|Win32 + {42C9DDA4-0375-45AF-952D-825EA83EAE4C}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4410546A-14CD-4ADB-9577-56AB75E55DB2} + EndGlobalSection +EndGlobal diff --git a/CompatLib/CompatLib.vcxproj b/CompatLib/CompatLib.vcxproj new file mode 100644 index 0000000..44458de --- /dev/null +++ b/CompatLib/CompatLib.vcxproj @@ -0,0 +1,132 @@ + + + + + Release + Win32 + + + Release + x64 + + + + + true + false + + + true + false + + + + + + + 16.0 + Win32Proj + {42c9dda4-0375-45af-952d-825ea83eae4c} + CompatLib + 10.0.17763.0 + + + + StaticLibrary + false + v142 + true + Unicode + + + StaticLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + false + $(ProjectDir)\lib\ + $(ProjectDir)\obj\$(Configuration)\$(Platform)\ + libcompat-x86 + + + false + $(ProjectDir)\lib\ + $(ProjectDir)\obj\$(Configuration)\$(Platform)\ + libcompat-x64 + + + + Level3 + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + MultiThreaded + Size + true + MaxSpeed + false + NoExtensions + Fast + + + + + true + true + true + + + true + + + + + Level3 + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + MultiThreaded + Size + true + MaxSpeed + false + Fast + + + + + true + true + true + + + true + + + + + + + \ No newline at end of file diff --git a/CompatLib/CompatLib.vcxproj.filters b/CompatLib/CompatLib.vcxproj.filters new file mode 100644 index 0000000..8e82512 --- /dev/null +++ b/CompatLib/CompatLib.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + + + Source Files + + + \ No newline at end of file diff --git a/CompatLib/src/compat.c b/CompatLib/src/compat.c new file mode 100644 index 0000000..e04306a --- /dev/null +++ b/CompatLib/src/compat.c @@ -0,0 +1,17 @@ +/******************************************************************************/ +/* CompatLib for Windows XP, by LoRd_MuldeR */ +/* This work has been released under the CC0 1.0 Universal license! */ +/******************************************************************************/ + +#define WIN32_LEAN_AND_MEAN 1 +#include + +BOOL WINAPI XPCompatLib_InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags) +{ + return InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount); +} + +int WINAPI XPCompatLib_LCMapStringEx(LPCWSTR lpLocaleName, DWORD dwMapFlags, LPCWSTR lpSrcStr, int cchSrc, LPWSTR lpDestStr, int cchDest, LPNLSVERSIONINFO lpVersionInformation, LPVOID lpReserved, LPARAM sortHandle) +{ + return LCMapStringW(LOCALE_SYSTEM_DEFAULT, dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest); +} diff --git a/CompatLib/src/compat_x64.asm b/CompatLib/src/compat_x64.asm new file mode 100644 index 0000000..7c34b07 --- /dev/null +++ b/CompatLib/src/compat_x64.asm @@ -0,0 +1,17 @@ +; **************************************************************************** +; CompatLib for Windows XP, by LoRd_MuldeR * +; This work has been released under the CC0 1.0 Universal license! * +; **************************************************************************** + +.data + +__imp_InitializeCriticalSectionEx dq XPCompatLib_InitializeCriticalSectionEx +__imp_LCMapStringEx dq XPCompatLib_LCMapStringEx + +externdef __imp_InitializeCriticalSectionEx : QWORD +externdef __imp_LCMapStringEx : QWORD + +extern XPCompatLib_InitializeCriticalSectionEx : proc +extern XPCompatLib_LCMapStringEx : proc + +end diff --git a/CompatLib/src/compat_x86.asm b/CompatLib/src/compat_x86.asm new file mode 100644 index 0000000..9062ac8 --- /dev/null +++ b/CompatLib/src/compat_x86.asm @@ -0,0 +1,19 @@ +; **************************************************************************** +; CompatLib for Windows XP, by LoRd_MuldeR * +; This work has been released under the CC0 1.0 Universal license! * +; **************************************************************************** + +.model flat + +.data + +__imp__InitializeCriticalSectionEx@12 dd _XPCompatLib_InitializeCriticalSectionEx@12 +__imp__LCMapStringEx@36 dd _XPCompatLib_LCMapStringEx@36 + +externdef __imp__InitializeCriticalSectionEx@12 : DWORD +externdef __imp__LCMapStringEx@36 : DWORD + +extern _XPCompatLib_InitializeCriticalSectionEx@12 : proc +extern _XPCompatLib_LCMapStringEx@36 : proc + +end