From f3d5302e1affc1f2603c0609e650af15514824bc Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Mon, 28 Mar 2005 20:46:08 +0000 Subject: [PATCH] More additions for amd64: - On amd64, InterlockedPushEntrySList() and InterlockedPopEntrySList() are mapped to ExpInterlockedPushEntrySList and ExpInterlockedPopEntrySList() via macros (which do the same thing). Add IMPORT_FUNC_MAP()s for these. - Implement ExQueryDepthSList(). --- sys/compat/ndis/subr_ntoskrnl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index c8ef3b06cdf..285e25c5028 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -138,6 +138,8 @@ __fastcall static slist_entry __fastcall static slist_entry *ExInterlockedPopEntrySList(REGARGS2(slist_header *head, kspin_lock *lock)); +__stdcall static uint16_t + ExQueryDepthSList(slist_header *); __fastcall static uint32_t InterlockedIncrement(REGARGS1(volatile uint32_t *addend)); __fastcall static uint32_t @@ -1697,6 +1699,20 @@ ExInterlockedPopEntrySList(REGARGS2(slist_header *head, kspin_lock *lock)) return(first); } +__stdcall static uint16_t +ExQueryDepthSList(head) + slist_header *head; +{ + uint16_t depth; + uint8_t irql; + + KeAcquireSpinLock(&ntoskrnl_global, &irql); + depth = head->slh_list.slh_depth; + KeReleaseSpinLock(&ntoskrnl_global, irql); + + return(depth); +} + /* * The KeInitializeSpinLock(), KefAcquireSpinLockAtDpcLevel() * and KefReleaseSpinLockFromDpcLevel() appear to be analagous @@ -2719,6 +2735,10 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_FUNC(ExDeleteNPagedLookasideList), IMPORT_FUNC(InterlockedPopEntrySList), IMPORT_FUNC(InterlockedPushEntrySList), + IMPORT_FUNC(ExQueryDepthSList), + IMPORT_FUNC_MAP(ExpInterlockedPopEntrySList, InterlockedPopEntrySList), + IMPORT_FUNC_MAP(ExpInterlockedPushEntrySList, + InterlockedPushEntrySList), IMPORT_FUNC(ExInterlockedPopEntrySList), IMPORT_FUNC(ExInterlockedPushEntrySList), IMPORT_FUNC(ExAllocatePoolWithTag),