From: Derek Lesho Subject: [PATCH v4 11/11] ntoskrnl.exe: Implement Ex(Acquire/Release)FastMutex. Message-Id: <20190411194558.31939-11-dereklesho52@Gmail.com> Date: Thu, 11 Apr 2019 15:45:58 -0400 In-Reply-To: <20190411182706.25812-11-dereklesho52@Gmail.com> References: <20190411182706.25812-11-dereklesho52@Gmail.com> Signed-off-by: Derek Lesho --- dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 ++ dlls/ntoskrnl.exe/sync.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 8c347999ba..d6edf6143a 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -1,4 +1,5 @@ @ stdcall -fastcall ExAcquireFastMutexUnsafe(ptr) +@ stdcall -arch=x86_64 ExAcquireFastMutex(ptr) @ stub ExAcquireRundownProtection @ stub ExAcquireRundownProtectionEx @ stub ExInitializeRundownProtection @@ -9,6 +10,7 @@ @ stdcall -fastcall -arch=i386 ExInterlockedPushEntrySList (ptr ptr ptr) NTOSKRNL_ExInterlockedPushEntrySList @ stub ExReInitializeRundownProtection @ stdcall -fastcall ExReleaseFastMutexUnsafe(ptr) +@ stdcall -arch=x86_64 ExReleaseFastMutex(ptr) @ stdcall -fastcall ExReleaseResourceLite(ptr) @ stub ExReleaseRundownProtection @ stub ExReleaseRundownProtectionEx diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c index e97c6993f9..11fc945041 100644 --- a/dlls/ntoskrnl.exe/sync.c +++ b/dlls/ntoskrnl.exe/sync.c @@ -1167,3 +1167,24 @@ ULONG WINAPI ExIsResourceAcquiredSharedLite( ERESOURCE *resource ) return ret; } + + +/********************************************************************* + * ExAcquireFastMutex (NTOSKRNL.@) + */ +void WINAPI ExAcquireFastMutex(PFAST_MUTEX mutex) +{ + /* TODO: The safe variant raises thread to APC_LEVEL + and stores the previous IRQL in mutex->OldIrql */ + ExAcquireFastMutexUnsafe( mutex ); +} + + + /********************************************************************* + * ExReleaseFastMutex (NTOSKRNL.@) + */ +void WINAPI ExReleaseFastMutex(PFAST_MUTEX mutex) +{ + ExReleaseFastMutexUnsafe( mutex ); + /* TODO: the safe variant restores the IRQL to mutex->OldIrql */ +} -- 2.20.1