diff options
-rw-r--r-- | winsup/w32api/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/w32api/include/ddk/winddk.h | 57 |
2 files changed, 44 insertions, 20 deletions
diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index 72e402342..8438d6770 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,5 +1,12 @@ 2004-11-11 Danny Smith <dannysmith@users.sourceforge.net> + * include/ddk/winddk.h (ExAllocateFromPagedLookasideList, + ExFreeToPagedLookasideList): Guard inline versions with + (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501). Declare as + external functions for earlier _WIN32_WINNT. + +2004-11-11 Danny Smith <dannysmith@users.sourceforge.net> + * include/ras.h (RASCONN[AW]): Remove dwSessionId field. 2004-11-09 Danny Smith <dannysmith@users.sourceforge.net> 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 |