ntoskrnl.exe: Implement ExInterlockedRemoveHeadList().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-01-24 22:56:23 -06:00 committed by Alexandre Julliard
parent 834db73121
commit 171bf1e2a0
5 changed files with 79 additions and 47 deletions

View File

@ -52,6 +52,8 @@
#include "wine/rbtree.h"
#include "wine/svcctl.h"
#include "ntoskrnl_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl);
WINE_DECLARE_DEBUG_CHANNEL(relay);
WINE_DECLARE_DEBUG_CHANNEL(plugplay);
@ -143,29 +145,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
static CRITICAL_SECTION drivers_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
#ifdef __i386__
#define DEFINE_FASTCALL1_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 4, \
"popl %eax\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(4))
#define DEFINE_FASTCALL2_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 8, \
"popl %eax\n\t" \
"pushl %edx\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8))
#define DEFINE_FASTCALL3_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 12, \
"popl %eax\n\t" \
"pushl %edx\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(12))
#endif
static inline LPCSTR debugstr_us( const UNICODE_STRING *us )
{
if (!us) return "<null>";
@ -3089,29 +3068,6 @@ NTSTATUS WINAPI ExDeleteResourceLite(PERESOURCE resource)
return STATUS_NOT_IMPLEMENTED;
}
/*****************************************************
* ExInterlockedRemoveHeadList (NTOSKRNL.EXE.@)
*/
PLIST_ENTRY WINAPI ExInterlockedRemoveHeadList(PLIST_ENTRY head, PKSPIN_LOCK lock)
{
FIXME("(%p %p) stub\n", head, lock);
return NULL;
}
/***********************************************************************
* ExfInterlockedRemoveHeadList (NTOSKRNL.EXE.@)
*/
#ifdef DEFINE_FASTCALL2_ENTRYPOINT
DEFINE_FASTCALL2_ENTRYPOINT( ExfInterlockedRemoveHeadList )
PLIST_ENTRY WINAPI DECLSPEC_HIDDEN __regs_ExfInterlockedRemoveHeadList(PLIST_ENTRY head, PKSPIN_LOCK lock)
#else
PLIST_ENTRY WINAPI ExfInterlockedRemoveHeadList(PLIST_ENTRY head, PKSPIN_LOCK lock)
#endif
{
FIXME("(%p %p) stub\n", head, lock);
return ExInterlockedRemoveHeadList( head, lock );
}
/***********************************************************************
* ExReleaseResourceForThreadLite (NTOSKRNL.EXE.@)
*/

View File

@ -22,7 +22,7 @@
@ stub ExfInterlockedInsertTailList
@ stub ExfInterlockedPopEntryList
@ stub ExfInterlockedPushEntryList
@ stdcall -norelay ExfInterlockedRemoveHeadList(ptr ptr)
@ stdcall -norelay -arch=i386 ExfInterlockedRemoveHeadList(ptr ptr)
@ stub ExfReleasePushLock
@ stub Exfi386InterlockedDecrementLong
@ stub Exfi386InterlockedExchangeUlong

View File

@ -0,0 +1,47 @@
/*
* ntoskrnl.exe implementation
*
* Copyright (C) 2007 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_NTOSKRNL_PRIVATE_H
#define __WINE_NTOSKRNL_PRIVATE_H
#ifdef __i386__
#define DEFINE_FASTCALL1_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 4, \
"popl %eax\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(4))
#define DEFINE_FASTCALL2_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 8, \
"popl %eax\n\t" \
"pushl %edx\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(8))
#define DEFINE_FASTCALL3_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 12, \
"popl %eax\n\t" \
"pushl %edx\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
"jmp " __ASM_NAME("__regs_") #name __ASM_STDCALL(12))
#endif
#endif

View File

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "ntstatus.h"
@ -30,6 +31,8 @@
#include "wine/debug.h"
#include "ntoskrnl_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl);
enum object_type
@ -433,3 +436,28 @@ void WINAPI IoReleaseCancelSpinLock( KIRQL irql )
TRACE("irql %u.\n", irql);
KeReleaseSpinLock( &cancel_lock, irql );
}
#ifdef __i386__
DEFINE_FASTCALL2_ENTRYPOINT( ExfInterlockedRemoveHeadList )
PLIST_ENTRY WINAPI DECLSPEC_HIDDEN __regs_ExfInterlockedRemoveHeadList( LIST_ENTRY *list, KSPIN_LOCK *lock )
{
return ExInterlockedRemoveHeadList( list, lock );
}
#endif
/***********************************************************************
* ExInterlockedRemoveHeadList (NTOSKRNL.EXE.@)
*/
LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList( LIST_ENTRY *list, KSPIN_LOCK *lock )
{
LIST_ENTRY *ret;
KIRQL irql;
TRACE("list %p, lock %p.\n", list, lock);
KeAcquireSpinLock( lock, &irql );
ret = RemoveHeadList( list );
KeReleaseSpinLock( lock, irql );
return ret;
}

View File

@ -1386,6 +1386,7 @@ void WINAPI ExFreePool(PVOID);
void WINAPI ExFreePoolWithTag(PVOID,ULONG);
PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);
PSLIST_ENTRY WINAPI ExInterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY,PKSPIN_LOCK);
LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList(LIST_ENTRY*,KSPIN_LOCK*);
void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
void WINAPI IoAcquireCancelSpinLock(KIRQL*);