diff --git a/plugins/common/vc_crt_fix.asm b/plugins/common/vc_crt_fix.asm index 980c8e2b16..a3eab96204 100644 --- a/plugins/common/vc_crt_fix.asm +++ b/plugins/common/vc_crt_fix.asm @@ -35,6 +35,12 @@ EncodePointerWrapper proto stdcall :dword DecodePointerWrapper proto stdcall :dword GetModuleHandleExWWrapper proto stdcall :dword, :dword, :dword InitializeSListHeadWrapper proto stdcall :dword +InterlockedFlushSListWrapper proto stdcall :dword +InterlockedPopEntrySListWrapper proto stdcall :dword +InterlockedPushEntrySListWrapper proto stdcall :dword, :dword +InterlockedPushListSListExWrapper proto stdcall :dword, :dword, :dword, :dword +RtlFirstEntrySListWrapper proto stdcall :dword +QueryDepthSListWrapper proto stdcall :dword .const align 4 @@ -42,10 +48,22 @@ __imp__EncodePointer@4 dd EncodePointerWrapper __imp__DecodePointer@4 dd DecodePointerWrapper __imp__GetModuleHandleExW@12 dd GetModuleHandleExWWrapper __imp__InitializeSListHead@4 dd InitializeSListHeadWrapper +__imp__InterlockedFlushSList@4 dd InterlockedFlushSListWrapper +__imp__InterlockedPopEntrySList@4 dd InterlockedPopEntrySListWrapper +__imp__InterlockedPushEntrySList@8 dd InterlockedPushEntrySListWrapper +__imp__InterlockedPushListSListEx@16 dd InterlockedPushListSListExWrapper +__imp__RtlFirstEntrySList@4 dd RtlFirstEntrySListWrapper +__imp__QueryDepthSList@4 dd QueryDepthSListWrapper public \ __imp__EncodePointer@4, __imp__DecodePointer@4, __imp__GetModuleHandleExW@12, -__imp__InitializeSListHead@4 +__imp__InitializeSListHead@4, +__imp__InterlockedFlushSList@4, +__imp__InterlockedPopEntrySList@4, +__imp__InterlockedPushEntrySList@8, +__imp__InterlockedPushListSListEx@16, +__imp__RtlFirstEntrySList@4, +__imp__QueryDepthSList@4 end diff --git a/plugins/common/vc_crt_fix_impl.cpp b/plugins/common/vc_crt_fix_impl.cpp index 2b9c8f3186..fdea2f81ff 100644 --- a/plugins/common/vc_crt_fix_impl.cpp +++ b/plugins/common/vc_crt_fix_impl.cpp @@ -111,6 +111,102 @@ extern "C" void WINAPI InitializeSListHeadWrapper(PSLIST_HEADER ListHead) return Function(ListHead); } +// InterlockedFlushSList (VC2015) +extern "C" PSLIST_ENTRY WINAPI InterlockedFlushSListWrapper(PSLIST_HEADER ListHead) +{ + struct implementation + { + static PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER ListHead) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return nullptr; + } + }; + + CREATE_FUNCTION_POINTER(kernel32, InterlockedFlushSList); + return Function(ListHead); +} + +// InterlockedPopEntrySList (VC2015) +extern "C" PSLIST_ENTRY WINAPI InterlockedPopEntrySListWrapper(PSLIST_HEADER ListHead) +{ + struct implementation + { + static PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return nullptr; + } + }; + + CREATE_FUNCTION_POINTER(kernel32, InterlockedPopEntrySList); + return Function(ListHead); +} + +// InterlockedPushEntrySList (VC2015) +extern "C" PSLIST_ENTRY WINAPI InterlockedPushEntrySListWrapper(PSLIST_HEADER ListHead, PSLIST_ENTRY ListEntry) +{ + struct implementation + { + static PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER ListHead, PSLIST_ENTRY ListEntry) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return nullptr; + } + }; + + CREATE_FUNCTION_POINTER(kernel32, InterlockedPushEntrySList); + return Function(ListHead, ListEntry); +} + +// InterlockedPushListSList (VC2015) +extern "C" PSLIST_ENTRY WINAPI InterlockedPushListSListExWrapper(PSLIST_HEADER ListHead, PSLIST_ENTRY List, PSLIST_ENTRY ListEnd, ULONG Count) +{ + struct implementation + { + static PSLIST_ENTRY WINAPI InterlockedPushListSListEx(PSLIST_HEADER ListHead, PSLIST_ENTRY List, PSLIST_ENTRY ListEnd, ULONG Count) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return nullptr; + } + }; + + CREATE_FUNCTION_POINTER(kernel32, InterlockedPushListSListEx); + return Function(ListHead, List, ListEnd, Count); +} + +// RtlFirstEntrySList (VC2015) +extern "C" PSLIST_ENTRY WINAPI RtlFirstEntrySListWrapper(PSLIST_HEADER ListHead) +{ + struct implementation + { + static PSLIST_ENTRY WINAPI RtlFirstEntrySList(PSLIST_HEADER ListHead) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return nullptr; + } + }; + + CREATE_FUNCTION_POINTER(kernel32, RtlFirstEntrySList); + return Function(ListHead); +} + +// QueryDepthSList (VC2015) +extern "C" USHORT WINAPI QueryDepthSListWrapper(PSLIST_HEADER ListHead) +{ + struct implementation + { + static USHORT WINAPI QueryDepthSList(PSLIST_HEADER ListHead) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; + } + }; + + CREATE_FUNCTION_POINTER(kernel32, QueryDepthSList); + return Function(ListHead); +} + // RtlGenRandom (VC2015) // RtlGenRandom is used in rand_s implementation in ucrt. // As long as we don't use the rand_s in the code (which is easy: it's non-standard, requires _CRT_RAND_S to be defined first and not recommended in general)