diff --git a/reactos/include/ndk/amd64/ketypes.h b/reactos/include/ndk/amd64/ketypes.h index 1037ce1d3b2..1fd74732bd4 100644 --- a/reactos/include/ndk/amd64/ketypes.h +++ b/reactos/include/ndk/amd64/ketypes.h @@ -436,51 +436,7 @@ typedef struct _KPROCESSOR_STATE CONTEXT ContextFrame; } KPROCESSOR_STATE, *PKPROCESSOR_STATE; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) -typedef struct _GENERAL_LOOKASIDE_POOL -{ - union - { - SLIST_HEADER ListHead; - SINGLE_LIST_ENTRY SingleListHead; - }; - USHORT Depth; - USHORT MaximumDepth; - ULONG TotalAllocates; - union - { - ULONG AllocateMisses; - ULONG AllocateHits; - }; - union - { - ULONG TotalFrees; - ULONG FreeMisses; - }; - ULONG FreeHits; - POOL_TYPE Type; - ULONG Tag; - ULONG Size; - union - { - PVOID AllocateEx; - PVOID Allocate; - }; - union - { - PVOID FreeEx; - PVOID Free; - }; - LIST_ENTRY ListEntry; - ULONG LastTotalAllocates; - union - { - ULONG LastAllocateMisses; - ULONG LastAllocateHits; - }; - ULONG Future[2]; -} GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL; -#else +#if (NTDDI_VERSION < NTDDI_LONGHORN) #define GENERAL_LOOKASIDE_POOL PP_LOOKASIDE_LIST #endif diff --git a/reactos/include/ndk/obfuncs.h b/reactos/include/ndk/obfuncs.h index 19ed1fd4314..4835bfcfd2d 100644 --- a/reactos/include/ndk/obfuncs.h +++ b/reactos/include/ndk/obfuncs.h @@ -153,6 +153,7 @@ ObFindHandleForObject( OUT PHANDLE Handle ); +NTKERNELAPI VOID NTAPI ObDereferenceObjectDeferDelete( diff --git a/reactos/include/ndk/psfuncs.h b/reactos/include/ndk/psfuncs.h index ff33730d2f8..49c7b9f5412 100644 --- a/reactos/include/ndk/psfuncs.h +++ b/reactos/include/ndk/psfuncs.h @@ -143,7 +143,7 @@ NTAPI PsGetCurrentProcessSessionId( VOID ); - + // // Process Impersonation Functions // @@ -371,7 +371,18 @@ NtCreateThread( IN BOOLEAN CreateSuspended ); -#include "inline_ntcurrentteb.h" +#ifndef NTOS_MODE_USER +FORCEINLINE struct _TEB * NtCurrentTeb(VOID) +{ +#if defined(_M_IX86) + return (PTEB)__readfsdword(0x18); +#elif defined (_M_AMD64) + return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); +#endif +} +#else +struct _TEB * NtCurrentTeb(void); +#endif NTSYSCALLAPI NTSTATUS diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index ba4f3bf9f27..8026969f345 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -5152,12 +5152,19 @@ typedef struct _OBJECT_TYPE_LIST { } OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST; #if defined(_M_IX86) +FORCEINLINE struct _TEB * NtCurrentTeb(void) +{ + return (struct _TEB *)__readfsdword(0x18); +} FORCEINLINE PVOID GetCurrentFiber(VOID) { return (PVOID)(ULONG_PTR)__readfsdword(0x10); } - #elif defined (_M_AMD64) +FORCEINLINE struct _TEB * NtCurrentTeb(void) +{ + return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); +} FORCEINLINE PVOID GetCurrentFiber(VOID) { #ifdef NONAMELESSUNION @@ -5166,12 +5173,10 @@ FORCEINLINE PVOID GetCurrentFiber(VOID) return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData)); #endif } - #elif defined (_M_ARM) PVOID WINAPI GetCurrentFiber(VOID); - #elif defined(_M_PPC) -static __inline__ __attribute__((always_inline)) unsigned long __readfsdword_winnt(const unsigned long Offset) +FORCEINLINE unsigned long _read_teb_dword(const unsigned long Offset) { unsigned long result; __asm__("\tadd 7,13,%1\n" @@ -5181,19 +5186,18 @@ static __inline__ __attribute__((always_inline)) unsigned long __readfsdword_win : "r7"); return result; } - -static __inline__ PVOID GetCurrentFiber(void) +FORCEINLINE struct _TEB * NtCurrentTeb(void) { - return __readfsdword_winnt(0x10); + return (struct _TEB *)_read_teb_dword(0x18); +} +FORCEINLINE PVOID GetCurrentFiber(void) +{ + return _read_teb_dword(0x10); } #else #error Unknown architecture #endif - - -#include "inline_ntcurrentteb.h" - static __inline PVOID GetFiberData(void) { return *((PVOID *)GetCurrentFiber());