Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/hal/Makefile.in | 1 + dlls/ntoskrnl.exe/Makefile.in | 2 +- dlls/ntoskrnl.exe/ntoskrnl.c | 10 ---------- dlls/ntoskrnl.exe/sync.c | 11 +++++++++++ 4 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/dlls/hal/Makefile.in b/dlls/hal/Makefile.in index 8efaf55512..cc2620e921 100644 --- a/dlls/hal/Makefile.in +++ b/dlls/hal/Makefile.in @@ -1,4 +1,5 @@ MODULE = hal.dll +IMPORTLIB = hal
C_SRCS = \ hal.c diff --git a/dlls/ntoskrnl.exe/Makefile.in b/dlls/ntoskrnl.exe/Makefile.in index 8cafaada85..3861d26a4a 100644 --- a/dlls/ntoskrnl.exe/Makefile.in +++ b/dlls/ntoskrnl.exe/Makefile.in @@ -1,6 +1,6 @@ MODULE = ntoskrnl.exe IMPORTLIB = ntoskrnl -IMPORTS = advapi32 +IMPORTS = advapi32 hal DELAYIMPORTS = setupapi user32
C_SRCS = \ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index a48b9e39c2..2a061f3338 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -785,16 +785,6 @@ void WINAPI IoAcquireCancelSpinLock(PKIRQL irql) FIXME("(%p): stub\n", irql); }
- -/*********************************************************************** - * IoReleaseCancelSpinLock (NTOSKRNL.EXE.@) - */ -void WINAPI IoReleaseCancelSpinLock(KIRQL irql) -{ - FIXME("(%u): stub\n", irql); -} - - /*********************************************************************** * IoAllocateDriverObjectExtension (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 74e84a6505..36282fec67 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -413,3 +413,14 @@ KIRQL WINAPI KeAcquireSpinLockRaiseToDpc( KSPIN_LOCK *lock ) return 0; } #endif + +static KSPIN_LOCK cancel_lock; + +/*********************************************************************** + * IoReleaseCancelSpinLock (NTOSKRNL.EXE.@) + */ +void WINAPI IoReleaseCancelSpinLock( KIRQL irql ) +{ + TRACE("irql %u.\n", irql); + KeReleaseSpinLock( &cancel_lock, irql ); +}
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 9 --------- dlls/ntoskrnl.exe/sync.c | 9 +++++++++ include/ddk/wdm.h | 1 + 3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 2a061f3338..994cd90b7e 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -776,15 +776,6 @@ void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX FastMutex) FIXME("(%p): stub\n", FastMutex); }
- -/*********************************************************************** - * IoAcquireCancelSpinLock (NTOSKRNL.EXE.@) - */ -void WINAPI IoAcquireCancelSpinLock(PKIRQL irql) -{ - FIXME("(%p): stub\n", irql); -} - /*********************************************************************** * IoAllocateDriverObjectExtension (NTOSKRNL.EXE.@) */ diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index 36282fec67..c46d7f583f 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -416,6 +416,15 @@ KIRQL WINAPI KeAcquireSpinLockRaiseToDpc( KSPIN_LOCK *lock )
static KSPIN_LOCK cancel_lock;
+/*********************************************************************** + * IoAcquireCancelSpinLock (NTOSKRNL.EXE.@) + */ +void WINAPI IoAcquireCancelSpinLock( KIRQL *irql ) +{ + TRACE("irql %p.\n", irql); + KeAcquireSpinLock( &cancel_lock, irql ); +} + /*********************************************************************** * IoReleaseCancelSpinLock (NTOSKRNL.EXE.@) */ diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 1c12c1e110..a9bdd3de85 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1388,6 +1388,7 @@ PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK); PSLIST_ENTRY WINAPI ExInterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY,PKSPIN_LOCK); void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
+void WINAPI IoAcquireCancelSpinLock(KIRQL*); NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOID*); PVOID WINAPI IoAllocateErrorLogEntry(PVOID,UCHAR); PIRP WINAPI IoAllocateIrp(CCHAR,BOOLEAN);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 48 ++-------------------------- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/ntoskrnl_private.h | 47 +++++++++++++++++++++++++++ dlls/ntoskrnl.exe/sync.c | 28 ++++++++++++++++ include/ddk/wdm.h | 1 + 5 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 dlls/ntoskrnl.exe/ntoskrnl_private.h
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 994cd90b7e..4986ca1f67 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -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.@) */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 8483b36a63..bf87504f44 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -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 diff --git a/dlls/ntoskrnl.exe/ntoskrnl_private.h b/dlls/ntoskrnl.exe/ntoskrnl_private.h new file mode 100644 index 0000000000..241e15f827 --- /dev/null +++ b/dlls/ntoskrnl.exe/ntoskrnl_private.h @@ -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 diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index c46d7f583f..852f2b50d4 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -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_FASTCALL1_ENTRYPOINT( ExfInterlockedRemoveHeadList ) +LIST_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; +} diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index a9bdd3de85..a53c7a26ca 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -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*);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntoskrnl.exe/ntoskrnl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 4986ca1f67..ec78f4bc46 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2803,10 +2803,10 @@ NTSTATUS WINAPI PsRemoveCreateThreadNotifyRoutine( PCREATE_THREAD_NOTIFY_ROUTINE /*********************************************************************** * PsTerminateSystemThread (NTOSKRNL.EXE.@) */ -NTSTATUS WINAPI PsTerminateSystemThread(NTSTATUS ExitStatus) +NTSTATUS WINAPI PsTerminateSystemThread(NTSTATUS status) { - FIXME( "stub: %u\n", ExitStatus ); - return STATUS_NOT_IMPLEMENTED; + TRACE("status %#x.\n", status); + ExitThread( status ); }