From cf4e195b49d131537459e88d87aadc6f168824d0 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 27 May 2017 18:02:35 +0200 Subject: [PATCH] Added patch to implement ntoskrnl.ExInterlockedPopEntrySList. --- ...Implement-ExInterlockedPopEntrySList.patch | 51 +++++++++++++++++++ patches/ntoskrnl-Stubs/definition | 1 + patches/patchinstall.sh | 2 + 3 files changed, 54 insertions(+) create mode 100644 patches/ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch diff --git a/patches/ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch b/patches/ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch new file mode 100644 index 00000000..0747fc98 --- /dev/null +++ b/patches/ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch @@ -0,0 +1,51 @@ +From be9ca596fa1d1b3c6d4be54853b812b2f8bce246 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 May 2017 16:12:09 +0200 +Subject: ntoskrnl: Implement ExInterlockedPopEntrySList. + +--- + dlls/ntoskrnl.exe/ntoskrnl.c | 14 ++++++++++++++ + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- + 2 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c +index 2ee727a8940..9332c3ef2a6 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.c ++++ b/dlls/ntoskrnl.exe/ntoskrnl.c +@@ -1664,6 +1664,20 @@ PSLIST_ENTRY WINAPI NTOSKRNL_InterlockedPopEntrySList( PSLIST_HEADER list ) + + + /*********************************************************************** ++ * ExInterlockedPopEntrySList (NTOSKRNL.EXE.@) ++ */ ++#ifdef DEFINE_FASTCALL2_ENTRYPOINT ++DEFINE_FASTCALL2_ENTRYPOINT( NTOSKRNL_ExInterlockedPopEntrySList ) ++PSLIST_ENTRY WINAPI __regs_NTOSKRNL_ExInterlockedPopEntrySList( PSLIST_HEADER list, PKSPIN_LOCK lock ) ++#else ++PSLIST_ENTRY WINAPI NTOSKRNL_ExInterlockedPopEntrySList( PSLIST_HEADER list, PKSPIN_LOCK lock ) ++#endif ++{ ++ return InterlockedPopEntrySList( list ); ++} ++ ++ ++/*********************************************************************** + * InterlockedPushEntrySList (NTOSKRNL.EXE.@) + */ + #ifdef DEFINE_FASTCALL2_ENTRYPOINT +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +index dd2e31feac0..3b5c361a862 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec ++++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +@@ -5,7 +5,7 @@ + @ stub ExInterlockedAddLargeStatistic + @ stub ExInterlockedCompareExchange64 + @ stub ExInterlockedFlushSList +-@ stub ExInterlockedPopEntrySList ++@ stdcall -norelay ExInterlockedPopEntrySList(ptr ptr) NTOSKRNL_ExInterlockedPopEntrySList + @ stub ExInterlockedPushEntrySList + @ stub ExReInitializeRundownProtection + @ stdcall -norelay ExReleaseFastMutexUnsafe(ptr) +-- +2.12.2 + diff --git a/patches/ntoskrnl-Stubs/definition b/patches/ntoskrnl-Stubs/definition index 9df2cd63..36f370e2 100644 --- a/patches/ntoskrnl-Stubs/definition +++ b/patches/ntoskrnl-Stubs/definition @@ -9,3 +9,4 @@ Fixes: Add stub for ntoskrnl.Mm{Map,Unmap}LockedPages Fixes: Implement ntoskrnl.KeInitializeMutex Fixes: Add stub for ntoskrnl.IoGetDeviceAttachmentBaseRef Fixes: Add stub for ntoskrnl.IoStopTimer +Fixes: Implement ntoskrnl.ExInterlockedPopEntrySList diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index f8993441..7108a57a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -6229,6 +6229,7 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then patch_apply ntoskrnl-Stubs/0009-ntoskrnl.exe-Implement-MmMapLockedPages-and-MmUnmapL.patch patch_apply ntoskrnl-Stubs/0010-ntoskrnl.exe-Implement-KeInitializeMutex.patch patch_apply ntoskrnl-Stubs/0011-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch + patch_apply ntoskrnl-Stubs/0012-ntoskrnl-Implement-ExInterlockedPopEntrySList.patch ( printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Add stubs for ExAcquireFastMutexUnsafe and ExReleaseFastMutexUnsafe.", 1 },'; printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Add stub for ObReferenceObjectByPointer.", 1 },'; @@ -6239,6 +6240,7 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then printf '%s\n' '+ { "Christian Costa", "ntoskrnl.exe: Implement MmMapLockedPages and MmUnmapLockedPages.", 1 },'; printf '%s\n' '+ { "Alexander Morozov", "ntoskrnl.exe: Implement KeInitializeMutex.", 1 },'; printf '%s\n' '+ { "Jarkko Korpi", "ntoskrnl.exe: Add IoGetDeviceAttachmentBaseRef stub.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "ntoskrnl: Implement ExInterlockedPopEntrySList.", 1 },'; ) >> "$patchlist" fi