mirror of
https://github.com/reactos/reactos.git
synced 2025-06-07 10:20:26 +00:00
[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 svn path=/trunk/; revision=56318
This commit is contained in:
parent
9f28638f51
commit
925c587c81
4 changed files with 30 additions and 58 deletions
|
@ -436,51 +436,7 @@ typedef struct _KPROCESSOR_STATE
|
||||||
CONTEXT ContextFrame;
|
CONTEXT ContextFrame;
|
||||||
} KPROCESSOR_STATE, *PKPROCESSOR_STATE;
|
} KPROCESSOR_STATE, *PKPROCESSOR_STATE;
|
||||||
|
|
||||||
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
|
#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
|
|
||||||
#define GENERAL_LOOKASIDE_POOL PP_LOOKASIDE_LIST
|
#define GENERAL_LOOKASIDE_POOL PP_LOOKASIDE_LIST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,7 @@ ObFindHandleForObject(
|
||||||
OUT PHANDLE Handle
|
OUT PHANDLE Handle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NTKERNELAPI
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
ObDereferenceObjectDeferDelete(
|
ObDereferenceObjectDeferDelete(
|
||||||
|
|
|
@ -143,7 +143,7 @@ NTAPI
|
||||||
PsGetCurrentProcessSessionId(
|
PsGetCurrentProcessSessionId(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Process Impersonation Functions
|
// Process Impersonation Functions
|
||||||
//
|
//
|
||||||
|
@ -371,7 +371,18 @@ NtCreateThread(
|
||||||
IN BOOLEAN CreateSuspended
|
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
|
NTSYSCALLAPI
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -5152,12 +5152,19 @@ typedef struct _OBJECT_TYPE_LIST {
|
||||||
} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST;
|
} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST;
|
||||||
|
|
||||||
#if defined(_M_IX86)
|
#if defined(_M_IX86)
|
||||||
|
FORCEINLINE struct _TEB * NtCurrentTeb(void)
|
||||||
|
{
|
||||||
|
return (struct _TEB *)__readfsdword(0x18);
|
||||||
|
}
|
||||||
FORCEINLINE PVOID GetCurrentFiber(VOID)
|
FORCEINLINE PVOID GetCurrentFiber(VOID)
|
||||||
{
|
{
|
||||||
return (PVOID)(ULONG_PTR)__readfsdword(0x10);
|
return (PVOID)(ULONG_PTR)__readfsdword(0x10);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined (_M_AMD64)
|
#elif defined (_M_AMD64)
|
||||||
|
FORCEINLINE struct _TEB * NtCurrentTeb(void)
|
||||||
|
{
|
||||||
|
return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
|
||||||
|
}
|
||||||
FORCEINLINE PVOID GetCurrentFiber(VOID)
|
FORCEINLINE PVOID GetCurrentFiber(VOID)
|
||||||
{
|
{
|
||||||
#ifdef NONAMELESSUNION
|
#ifdef NONAMELESSUNION
|
||||||
|
@ -5166,12 +5173,10 @@ FORCEINLINE PVOID GetCurrentFiber(VOID)
|
||||||
return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData));
|
return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined (_M_ARM)
|
#elif defined (_M_ARM)
|
||||||
PVOID WINAPI GetCurrentFiber(VOID);
|
PVOID WINAPI GetCurrentFiber(VOID);
|
||||||
|
|
||||||
#elif defined(_M_PPC)
|
#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;
|
unsigned long result;
|
||||||
__asm__("\tadd 7,13,%1\n"
|
__asm__("\tadd 7,13,%1\n"
|
||||||
|
@ -5181,19 +5186,18 @@ static __inline__ __attribute__((always_inline)) unsigned long __readfsdword_win
|
||||||
: "r7");
|
: "r7");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
FORCEINLINE struct _TEB * NtCurrentTeb(void)
|
||||||
static __inline__ PVOID GetCurrentFiber(void)
|
|
||||||
{
|
{
|
||||||
return __readfsdword_winnt(0x10);
|
return (struct _TEB *)_read_teb_dword(0x18);
|
||||||
|
}
|
||||||
|
FORCEINLINE PVOID GetCurrentFiber(void)
|
||||||
|
{
|
||||||
|
return _read_teb_dword(0x10);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#error Unknown architecture
|
#error Unknown architecture
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "inline_ntcurrentteb.h"
|
|
||||||
|
|
||||||
static __inline PVOID GetFiberData(void)
|
static __inline PVOID GetFiberData(void)
|
||||||
{
|
{
|
||||||
return *((PVOID *)GetCurrentFiber());
|
return *((PVOID *)GetCurrentFiber());
|
||||||
|
|
Loading…
Reference in a new issue