From a4be1ca6db06766f6d35b0fa65afd704115e62a9 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 11 Feb 2016 03:52:21 +0100 Subject: [PATCH] ntdll: Implement RtlInterlockedPushListSListEx and fix calling convention of RtlInterlockedPushListSList. Signed-off-by: Sebastian Lackner Signed-off-by: Alexandre Julliard --- dlls/ntdll/ntdll.spec | 3 ++- dlls/ntdll/rtl.c | 31 ++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 4e49709248d..d3cd489dd70 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -706,7 +706,8 @@ @ stdcall RtlInterlockedFlushSList(ptr) @ stdcall RtlInterlockedPopEntrySList(ptr) @ stdcall RtlInterlockedPushEntrySList(ptr ptr) -@ stdcall RtlInterlockedPushListSList(ptr ptr ptr long) +@ stdcall -norelay RtlInterlockedPushListSList(ptr ptr ptr long) +@ stdcall RtlInterlockedPushListSListEx(ptr ptr ptr long) # @ stub RtlInvertRangeList @ stdcall RtlIpv4AddressToStringA(ptr ptr) @ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index f699cff9a10..3e985d5d266 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -58,6 +58,16 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug = }; static RTL_CRITICAL_SECTION peb_lock = { &critsect_debug, -1, 0, 0, 0, 0 }; +#ifdef __i386__ +#define DEFINE_FASTCALL4_ENTRYPOINT( name ) \ + __ASM_STDCALL_FUNC( name, 16, \ + "popl %eax\n\t" \ + "pushl %edx\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(16)) +#endif + /* CRC polynomial 0xedb88320 */ static const DWORD CRC_table[256] = { @@ -1191,10 +1201,10 @@ PSLIST_ENTRY WINAPI RtlInterlockedPopEntrySList(PSLIST_HEADER list) } /************************************************************************* - * RtlInterlockedPushListSList [NTDLL.@] + * RtlInterlockedPushListSListEx [NTDLL.@] */ -PSLIST_ENTRY WINAPI RtlInterlockedPushListSList(PSLIST_HEADER list, PSLIST_ENTRY first, - PSLIST_ENTRY last, ULONG count) +PSLIST_ENTRY WINAPI RtlInterlockedPushListSListEx(PSLIST_HEADER list, PSLIST_ENTRY first, + PSLIST_ENTRY last, ULONG count) { SLIST_HEADER old, new; @@ -1222,6 +1232,21 @@ PSLIST_ENTRY WINAPI RtlInterlockedPushListSList(PSLIST_HEADER list, PSLIST_ENTRY #endif } +/************************************************************************* + * RtlInterlockedPushListSList [NTDLL.@] + */ +#ifdef DEFINE_FASTCALL4_ENTRYPOINT +DEFINE_FASTCALL4_ENTRYPOINT(RtlInterlockedPushListSList) +PSLIST_ENTRY WINAPI __regs_RtlInterlockedPushListSList(PSLIST_HEADER list, PSLIST_ENTRY first, + PSLIST_ENTRY last, ULONG count) +#else +PSLIST_ENTRY WINAPI RtlInterlockedPushListSList(PSLIST_HEADER list, PSLIST_ENTRY first, + PSLIST_ENTRY last, ULONG count) +#endif +{ + return RtlInterlockedPushListSListEx(list, first, last, count); +} + /****************************************************************************** * RtlGetCompressionWorkSpaceSize [NTDLL.@] */