Author: tkreuzer Date: Mon Apr 2 08:28:17 2012 New Revision: 56318
URL: http://svn.reactos.org/svn/reactos?rev=56318&view=rev Log: [PSDK/NDK] - Don't include NDK from winnt.h, instead duplicate NtCurrentTeb inline definition between psfuncs.h and winnt.h as it used to be - remove duplicated _GENERAL_LOOKASIDE_POOL - Add missing NTKERNELAPI to ObDereferenceObjectDeferDelete
Modified: trunk/reactos/include/ndk/amd64/ketypes.h trunk/reactos/include/ndk/obfuncs.h trunk/reactos/include/ndk/psfuncs.h trunk/reactos/include/psdk/winnt.h
Modified: trunk/reactos/include/ndk/amd64/ketypes.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/ketypes.h... ============================================================================== --- trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] Mon Apr 2 08:28:17 2012 @@ -436,51 +436,7 @@ 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
Modified: trunk/reactos/include/ndk/obfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/obfuncs.h?rev=5... ============================================================================== --- trunk/reactos/include/ndk/obfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/obfuncs.h [iso-8859-1] Mon Apr 2 08:28:17 2012 @@ -153,6 +153,7 @@ OUT PHANDLE Handle );
+NTKERNELAPI VOID NTAPI ObDereferenceObjectDeferDelete(
Modified: trunk/reactos/include/ndk/psfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=5... ============================================================================== --- trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] Mon Apr 2 08:28:17 2012 @@ -143,7 +143,7 @@ PsGetCurrentProcessSessionId( VOID ); - + // // Process Impersonation Functions // @@ -371,7 +371,18 @@ 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
Modified: trunk/reactos/include/psdk/winnt.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=56... ============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Mon Apr 2 08:28:17 2012 @@ -5152,12 +5152,19 @@ } 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 @@ 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,18 +5186,17 @@ : "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) {