diff options
Diffstat (limited to 'winsup/w32api/include/ddk/winddk.h')
-rw-r--r-- | winsup/w32api/include/ddk/winddk.h | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/winsup/w32api/include/ddk/winddk.h b/winsup/w32api/include/ddk/winddk.h index 1f489fa9a..6631f36e3 100644 --- a/winsup/w32api/include/ddk/winddk.h +++ b/winsup/w32api/include/ddk/winddk.h @@ -5124,6 +5124,24 @@ ExAllocateFromNPagedLookasideList( return Entry; } +static __inline VOID +ExFreeToNPagedLookasideList( + IN PNPAGED_LOOKASIDE_LIST Lookaside, + IN PVOID Entry) +{ + Lookaside->TotalFrees++; + if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) { + Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++; + (Lookaside->Free)(Entry); + } else { + ExInterlockedPushEntrySList(&Lookaside->ListHead, + (PSLIST_ENTRY)Entry, + &Lookaside->Obsoleted); + } +} + +#if (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501) + static __inline PVOID ExAllocateFromPagedLookasideList( IN PPAGED_LOOKASIDE_LIST Lookaside) @@ -5131,8 +5149,7 @@ ExAllocateFromPagedLookasideList( PVOID Entry; Lookaside->TotalAllocates++; - Entry = ExInterlockedPopEntrySList(&Lookaside->ListHead, - &Lookaside->Obsoleted); + Entry = InterlockedPopEntrySList(&Lookaside->ListHead); if (Entry == NULL) { Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++; Entry = (Lookaside->Allocate)(Lookaside->Type, @@ -5143,8 +5160,8 @@ ExAllocateFromPagedLookasideList( } static __inline VOID -ExFreeToNPagedLookasideList( - IN PNPAGED_LOOKASIDE_LIST Lookaside, +ExFreeToPagedLookasideList( + IN PPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry) { Lookaside->TotalFrees++; @@ -5152,27 +5169,27 @@ ExFreeToNPagedLookasideList( Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++; (Lookaside->Free)(Entry); } else { - ExInterlockedPushEntrySList(&Lookaside->ListHead, - (PSLIST_ENTRY)Entry, - &Lookaside->Obsoleted); + InterlockedPushEntrySList(&Lookaside->ListHead, + (PSLIST_ENTRY)Entry); } } -static __inline VOID +#else /* (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501) */ + +NTOSAPI +PVOID +DDKAPI +ExAllocateFromPagedLookasideList( + IN PPAGED_LOOKASIDE_LIST Lookaside); + +NTOSAPI +VOID +DDKAPI ExFreeToPagedLookasideList( IN PPAGED_LOOKASIDE_LIST Lookaside, - IN PVOID Entry) -{ - Lookaside->TotalFrees++; - if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) { - Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++; - (Lookaside->Free)(Entry); - } else { - ExInterlockedPushEntrySList(&Lookaside->ListHead, - (PSLIST_ENTRY)Entry, - &Lookaside->Obsoleted); - } -} + IN PVOID Entry); + +#endif /* (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501) */ NTOSAPI PVOID |