mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 18:35:32 +00:00
[DDK/PSDK]
- Update changes from header branch [NDK] - add KeTickCount for amd64 (HACK) svn path=/branches/ros-amd64-bringup/; revision=46402
This commit is contained in:
parent
0e42f72853
commit
5e7490747c
|
@ -3135,6 +3135,9 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
|
|||
ULONG64 LastExceptionFromRip;
|
||||
} CONTEXT;
|
||||
|
||||
#define PCR_MINOR_VERSION 1
|
||||
#define PCR_MAJOR_VERSION 1
|
||||
|
||||
typedef struct _KPCR
|
||||
{
|
||||
_ANONYMOUS_UNION union
|
||||
|
@ -3209,6 +3212,10 @@ KeGetCurrentProcessorNumber(VOID)
|
|||
#define PDE_TOP 0xFFFFF6FB7FFFFFFFULL
|
||||
#define PTE_TOP 0xFFFFF6FFFFFFFFFFULL
|
||||
|
||||
extern NTKERNELAPI PVOID MmHighestUserAddress;
|
||||
extern NTKERNELAPI PVOID MmSystemRangeStart;
|
||||
extern NTKERNELAPI ULONG64 MmUserProbeAddress;
|
||||
|
||||
#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
|
||||
#define MM_SYSTEM_RANGE_START MmSystemRangeStart
|
||||
#define MM_USER_PROBE_ADDRESS MmUserProbeAddress
|
||||
|
@ -3376,13 +3383,14 @@ ExRaiseDatatypeMisalignment(VOID);
|
|||
|
||||
/* Hardware Abstraction Layer Functions */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
||||
#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
|
||||
|
||||
/* Nothing here */
|
||||
|
||||
#else /* USE_DMA_MACROS ... */
|
||||
|
||||
#else
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
//DECLSPEC_DEPRECATED_DDK
|
||||
NTHALAPI
|
||||
VOID
|
||||
|
@ -3448,16 +3456,9 @@ HalAllocateAdapterChannel(
|
|||
IN ULONG NumberOfMapRegisters,
|
||||
IN PDRIVER_CONTROL ExecutionRoutine);
|
||||
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* USE_DMA_MACROS ... */
|
||||
|
||||
#if !defined(NO_LEGACY_DRIVERS)
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
||||
NTHALAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
@ -3507,13 +3508,8 @@ BOOLEAN
|
|||
NTAPI
|
||||
HalMakeBeep(
|
||||
IN ULONG Frequency);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* !defined(NO_LEGACY_DRIVERS) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
||||
NTHALAPI
|
||||
PADAPTER_OBJECT
|
||||
NTAPI
|
||||
|
@ -3601,7 +3597,7 @@ HalExamineMBR(
|
|||
IN ULONG SectorSize,
|
||||
IN ULONG MBRTypeIdentifier,
|
||||
OUT PVOID *Buffer);
|
||||
#endif
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
||||
|
||||
|
@ -3618,7 +3614,7 @@ NTAPI
|
|||
HalFreeHardwareCounters(
|
||||
IN HANDLE CounterSetHandle);
|
||||
|
||||
#endif
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
|
||||
|
||||
#if defined(_IA64_)
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
@ -4137,7 +4133,6 @@ KeInvalidateRangeAllCaches(
|
|||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -4178,7 +4173,6 @@ KeBugCheck(
|
|||
IN ULONG BugCheckCode);
|
||||
|
||||
|
||||
|
||||
#if defined(SINGLE_GROUP_LEGACY_API)
|
||||
|
||||
|
||||
|
@ -4210,15 +4204,17 @@ KeAreApcsDisabled(VOID);
|
|||
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03)
|
||||
|
||||
|
||||
NTKERNELAPI
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
KeInvalidateAllCaches(VOID);
|
||||
|
||||
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
||||
|
||||
NTKERNELAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
@ -4242,6 +4238,7 @@ KeLeaveGuardedRegion(VOID);
|
|||
|
||||
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
||||
|
||||
|
||||
#if defined(SINGLE_GROUP_LEGACY_API)
|
||||
NTKERNELAPI
|
||||
ULONG
|
||||
|
@ -4254,7 +4251,7 @@ ULONG
|
|||
NTAPI
|
||||
KeQueryMaximumProcessorCount(VOID);
|
||||
|
||||
#endif
|
||||
#endif /* SINGLE_GROUP_LEGACY_API */
|
||||
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
|
||||
|
||||
|
|
|
@ -4689,7 +4689,7 @@ FASTCALL
|
|||
KeAcquireQueuedSpinLock(
|
||||
IN OUT KSPIN_LOCK_QUEUE_NUMBER Number);
|
||||
|
||||
NTHALAPI
|
||||
_DECL_HAL_KE_IMPORT
|
||||
VOID
|
||||
FASTCALL
|
||||
KeReleaseQueuedSpinLock(
|
||||
|
|
|
@ -1694,7 +1694,7 @@ typedef enum _MM_SYSTEM_SIZE {
|
|||
MmLargeSystem
|
||||
} MM_SYSTEMSIZE;
|
||||
|
||||
extern PBOOLEAN Mm64BitPhysicalAddress;
|
||||
extern NTKERNELAPI BOOLEAN Mm64BitPhysicalAddress;
|
||||
extern PVOID MmBadPointer;
|
||||
|
||||
|
||||
|
@ -7923,9 +7923,6 @@ KeRaiseIrqlToSynchLevel(VOID)
|
|||
return KfRaiseIrql(12); // SYNCH_LEVEL = IPI_LEVEL - 2
|
||||
}
|
||||
|
||||
#define KeAcquireSpinLock(SpinLock, OldIrql) \
|
||||
*(OldIrql) = KeAcquireSpinLockRaiseToDpc(SpinLock)
|
||||
|
||||
FORCEINLINE
|
||||
PKTHREAD
|
||||
KeGetCurrentThread(VOID)
|
||||
|
@ -9685,7 +9682,6 @@ KeClearEvent(
|
|||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
||||
|
||||
|
||||
#if defined(_NTDDK_) || defined(_NTIFS_)
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
|
@ -9734,7 +9730,6 @@ KeQueryActiveProcessors(VOID);
|
|||
#endif /* defined(SINGLE_GROUP_LEGACY_API) */
|
||||
|
||||
#if !defined(_M_AMD64)
|
||||
|
||||
NTKERNELAPI
|
||||
ULONGLONG
|
||||
NTAPI
|
||||
|
@ -9745,9 +9740,38 @@ VOID
|
|||
NTAPI
|
||||
KeQuerySystemTime(
|
||||
OUT PLARGE_INTEGER CurrentTime);
|
||||
|
||||
#endif /* !_M_AMD64 */
|
||||
|
||||
#if !defined(_X86_)
|
||||
NTKERNELAPI
|
||||
KIRQL
|
||||
NTAPI
|
||||
KeAcquireSpinLockRaiseToDpc(
|
||||
IN OUT PKSPIN_LOCK SpinLock);
|
||||
|
||||
#define KeAcquireSpinLock(SpinLock, OldIrql) \
|
||||
*(OldIrql) = KeAcquireSpinLockRaiseToDpc(SpinLock)
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
KeAcquireSpinLockAtDpcLevel(
|
||||
IN OUT PKSPIN_LOCK SpinLock);
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
KeReleaseSpinLock(
|
||||
IN OUT PKSPIN_LOCK SpinLock,
|
||||
IN KIRQL NewIrql);
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
NTAPI
|
||||
KeReleaseSpinLockFromDpcLevel(
|
||||
IN OUT PKSPIN_LOCK SpinLock);
|
||||
#endif /* !_X86_ */
|
||||
|
||||
#if defined(_X86_) && (defined(_WDM_INCLUDED_) || defined(WIN9X_COMPAT_SPINLOCK))
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
|
@ -10191,10 +10215,12 @@ FASTCALL
|
|||
KeTestSpinLock(
|
||||
IN PKSPIN_LOCK SpinLock);
|
||||
|
||||
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
||||
|
||||
|
||||
NTKERNELAPI
|
||||
BOOLEAN
|
||||
FASTCALL
|
||||
|
@ -10255,6 +10281,7 @@ KeTryToAcquireGuardedMutex(
|
|||
#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
||||
|
||||
NTKERNELAPI
|
||||
VOID
|
||||
FASTCALL
|
||||
|
@ -10298,7 +10325,7 @@ NTKERNELAPI
|
|||
ULONG
|
||||
NTAPI
|
||||
KeQueryMaximumProcessorCount(VOID);
|
||||
#endif
|
||||
#endif /* SINGLE_GROUP_LEGACY_API */
|
||||
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
|
||||
|
||||
|
@ -13270,6 +13297,8 @@ FASTCALL
|
|||
ExInterlockedFlushSList(
|
||||
IN OUT PSLIST_HEADER ListHead);
|
||||
|
||||
#endif /* !defined(_WIN64) */
|
||||
|
||||
#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
|
||||
|
||||
NTKERNELAPI
|
||||
|
@ -13300,12 +13329,14 @@ ExFreeToPagedLookasideList(
|
|||
IN OUT PPAGED_LOOKASIDE_LIST Lookaside,
|
||||
IN PVOID Entry);
|
||||
|
||||
#else
|
||||
#else /* !_WIN2K_COMPAT_SLIST_USAGE */
|
||||
|
||||
#if !defined(_WIN64)
|
||||
#define ExInterlockedPopEntrySList(_ListHead, _Lock) \
|
||||
InterlockedPopEntrySList(_ListHead)
|
||||
#define ExInterlockedPushEntrySList(_ListHead, _ListEntry, _Lock) \
|
||||
InterlockedPushEntrySList(_ListHead, _ListEntry)
|
||||
#endif
|
||||
|
||||
static __inline
|
||||
PVOID
|
||||
|
@ -13342,7 +13373,6 @@ ExFreeToPagedLookasideList(
|
|||
|
||||
#endif /* _WIN2K_COMPAT_SLIST_USAGE */
|
||||
|
||||
#endif /* !defined(_WIN64) */
|
||||
|
||||
/* ERESOURCE_THREAD
|
||||
* ExGetCurrentResourceThread(
|
||||
|
@ -14565,8 +14595,9 @@ KdChangeOption(
|
|||
#endif
|
||||
/* Hardware Abstraction Layer Functions */
|
||||
|
||||
#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
|
||||
#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
|
||||
|
||||
FORCEINLINE
|
||||
PVOID
|
||||
|
@ -14632,9 +14663,8 @@ HalGetDmaAlignment(
|
|||
return alignment;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* USE_DMA_MACROS ... */
|
||||
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
|
||||
|
||||
#ifndef _NTTMAPI_
|
||||
#define _NTTMAPI_
|
||||
|
|
|
@ -877,5 +877,8 @@ KeGetCurrentPrcb(VOID)
|
|||
return (struct _KPRCB *)__readgsqword(FIELD_OFFSET(KIPCR, CurrentPrcb));
|
||||
}
|
||||
|
||||
// HACK
|
||||
extern NTKERNELAPI volatile KSYSTEM_TIME KeTickCount;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -72,7 +72,10 @@
|
|||
#define MAX_TRANSACTION_DESCRIPTION_LENGTH 64
|
||||
#define MAX_RESOURCEMANAGER_DESCRIPTION_LENGTH 64
|
||||
|
||||
#ifndef _WDMDDK_
|
||||
typedef GUID UOW, *PUOW;
|
||||
#endif
|
||||
|
||||
typedef GUID CRM_PROTOCOL_ID, *PCRM_PROTOCOL_ID;
|
||||
typedef ULONG NOTIFICATION_MASK;
|
||||
typedef ULONG SAVEPOINT_ID, *PSAVEPOINT_ID;
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
#ifndef _NTDEF_H
|
||||
#define _NTDEF_H
|
||||
#ifndef _NTDEF_
|
||||
#define _NTDEF_
|
||||
|
||||
//
|
||||
// Dependencies
|
||||
//
|
||||
/* Dependencies */
|
||||
#include <ctype.h>
|
||||
#include <basetsd.h>
|
||||
#include <excpt.h>
|
||||
#include <sdkddkver.h>
|
||||
|
||||
// FIXME: Should we include these here?
|
||||
// FIXME: Shouldn't be included!
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -24,11 +22,8 @@
|
|||
|
||||
typedef unsigned long POINTER_64; // FIXME! HACK!!!
|
||||
|
||||
/* Pseudo Modifiers for Input Parameters */
|
||||
|
||||
|
||||
//
|
||||
// Pseudo Modifiers for Input Parameters
|
||||
//
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#endif
|
||||
|
@ -54,29 +49,21 @@ typedef unsigned long POINTER_64; // FIXME! HACK!!!
|
|||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Defines the "size" of an any-size array
|
||||
//
|
||||
/* Defines the "size" of an any-size array */
|
||||
#ifndef ANYSIZE_ARRAY
|
||||
#define ANYSIZE_ARRAY 1
|
||||
#endif
|
||||
|
||||
//
|
||||
// Constant modifier
|
||||
//
|
||||
/* Constant modifier */
|
||||
#ifndef CONST
|
||||
#define CONST const
|
||||
#endif
|
||||
|
||||
//
|
||||
// TRUE/FALSE
|
||||
//
|
||||
/* TRUE/FALSE */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
//
|
||||
// NULL/NULL64
|
||||
//
|
||||
/* NULL/NULL64 */
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
|
@ -85,22 +72,8 @@ typedef unsigned long POINTER_64; // FIXME! HACK!!!
|
|||
#define NULL ((void *)0)
|
||||
#define NULL64 ((void * POINTER_64)0)
|
||||
#endif
|
||||
#endif // NULL
|
||||
#endif /* NULL */
|
||||
|
||||
typedef enum _EVENT_TYPE {
|
||||
NotificationEvent,
|
||||
SynchronizationEvent
|
||||
} EVENT_TYPE;
|
||||
|
||||
typedef enum _TIMER_TYPE {
|
||||
NotificationTimer,
|
||||
SynchronizationTimer
|
||||
} TIMER_TYPE;
|
||||
|
||||
typedef enum _WAIT_TYPE {
|
||||
WaitAll,
|
||||
WaitAny
|
||||
} WAIT_TYPE;
|
||||
|
||||
//
|
||||
// FIXME
|
||||
|
@ -171,35 +144,27 @@ typedef enum _WAIT_TYPE {
|
|||
#define ARGUMENT_PRESENT(ArgumentPointer) \
|
||||
((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL)
|
||||
|
||||
//
|
||||
// Returns the base address of a structure from a structure member
|
||||
//
|
||||
/* Returns the base address of a structure from a structure member */
|
||||
#ifndef CONTAINING_RECORD
|
||||
#define CONTAINING_RECORD(address, type, field) \
|
||||
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
||||
#endif
|
||||
|
||||
//
|
||||
// Returns the byte offset of the specified structure's member
|
||||
//
|
||||
/* Returns the byte offset of the specified structure's member */
|
||||
#ifndef __GNUC__
|
||||
#define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field))
|
||||
#else
|
||||
#define FIELD_OFFSET(Type, Field) __builtin_offsetof(Type, Field)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Returns the type's alignment
|
||||
//
|
||||
/* Returns the type's alignment */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
|
||||
#define TYPE_ALIGNMENT(t) __alignof(t)
|
||||
#else
|
||||
#define TYPE_ALIGNMENT(t) FIELD_OFFSET( struct { char x; t test; }, test )
|
||||
#endif
|
||||
|
||||
//
|
||||
// Calling Conventions
|
||||
//
|
||||
/* Calling Conventions */
|
||||
#if defined(_M_IX86)
|
||||
#define FASTCALL __fastcall
|
||||
#else
|
||||
|
@ -214,15 +179,12 @@ typedef enum _WAIT_TYPE {
|
|||
#define DDKAPI __stdcall // Use NTAPI instead
|
||||
#define DDKCDECLAPI __cdecl // Just use __cdecl
|
||||
|
||||
//
|
||||
// Import and Export Specifiers
|
||||
//
|
||||
/* Import and Export Specifiers */
|
||||
|
||||
// Done the same way as in windef.h for now
|
||||
/* Done the same way as in windef.h for now */
|
||||
#define DECLSPEC_IMPORT __declspec(dllimport)
|
||||
#define DECLSPEC_NORETURN __declspec(noreturn)
|
||||
|
||||
|
||||
#ifndef DECLSPEC_ADDRSAFE
|
||||
#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64))
|
||||
#define DECLSPEC_ADDRSAFE __declspec(address_safe)
|
||||
|
@ -243,9 +205,7 @@ typedef enum _WAIT_TYPE {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
/* Inlines */
|
||||
#ifndef FORCEINLINE
|
||||
#if (_MSC_VER >= 1200)
|
||||
#define FORCEINLINE __forceinline
|
||||
|
@ -272,9 +232,7 @@ typedef enum _WAIT_TYPE {
|
|||
#define NTAPI_INLINE
|
||||
#endif
|
||||
|
||||
//
|
||||
// Use to specify structure alignment
|
||||
//
|
||||
/* Use to specify structure alignment */
|
||||
#ifndef DECLSPEC_ALIGN
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
|
||||
#define DECLSPEC_ALIGN(x) __declspec(align(x))
|
||||
|
@ -285,21 +243,13 @@ typedef enum _WAIT_TYPE {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Use to silence unused variable warnings when it is intentional
|
||||
//
|
||||
/* Use to silence unused variable warnings when it is intentional */
|
||||
#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
|
||||
#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
|
||||
#define DBG_UNREFERENCED_PARAMETER(P)
|
||||
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
|
||||
|
||||
|
||||
|
||||
//
|
||||
// min/max helper macros
|
||||
//
|
||||
/* min/max helper macros */
|
||||
#ifndef NOMINMAX
|
||||
|
||||
#ifndef min
|
||||
|
@ -310,25 +260,17 @@ typedef enum _WAIT_TYPE {
|
|||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#endif // NOMINMAX
|
||||
#endif /* NOMINMAX */
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Tell windef.h that we have defined some basic types
|
||||
//
|
||||
/* Tell windef.h that we have defined some basic types */
|
||||
#define BASETYPES
|
||||
|
||||
//
|
||||
// Void Pointers
|
||||
//
|
||||
/* Void Pointers */
|
||||
typedef void *PVOID;
|
||||
//typedef void * POINTER_64 PVOID64;
|
||||
typedef PVOID PVOID64; // FIXME!
|
||||
|
||||
//
|
||||
// Handle Type
|
||||
//
|
||||
/* Handle Type */
|
||||
#ifdef STRICT
|
||||
typedef void *HANDLE;
|
||||
#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n
|
||||
|
@ -338,9 +280,7 @@ typedef PVOID HANDLE;
|
|||
#endif
|
||||
typedef HANDLE *PHANDLE;
|
||||
|
||||
//
|
||||
// Upper-Case Versions of Some Standard C Types
|
||||
//
|
||||
/* Upper-Case Versions of Some Standard C Types */
|
||||
#ifndef VOID
|
||||
#define VOID void
|
||||
typedef char CHAR;
|
||||
|
@ -352,47 +292,25 @@ typedef int INT;
|
|||
#endif
|
||||
typedef double DOUBLE;
|
||||
|
||||
//
|
||||
// Used to store a non-float 8 byte aligned structure
|
||||
//
|
||||
typedef struct _QUAD
|
||||
{
|
||||
_ANONYMOUS_UNION union
|
||||
{
|
||||
__GNU_EXTENSION __int64 UseThisFieldToCopy;
|
||||
double DoNotUseThisField;
|
||||
};
|
||||
} QUAD, *PQUAD, UQUAD, *PUQUAD;
|
||||
|
||||
|
||||
//
|
||||
// Unsigned Types
|
||||
//
|
||||
/* Unsigned Types */
|
||||
typedef unsigned char UCHAR, *PUCHAR;
|
||||
typedef unsigned short USHORT, *PUSHORT;
|
||||
typedef unsigned long ULONG, *PULONG;
|
||||
typedef CONST UCHAR *PCUCHAR;
|
||||
typedef CONST USHORT *PCUSHORT;
|
||||
typedef CONST ULONG *PCULONG;
|
||||
|
||||
typedef UCHAR FCHAR;
|
||||
typedef USHORT FSHORT;
|
||||
typedef ULONG FLONG;
|
||||
typedef UCHAR BOOLEAN;
|
||||
typedef BOOLEAN *PBOOLEAN;
|
||||
|
||||
typedef UCHAR BOOLEAN, *PBOOLEAN;
|
||||
typedef ULONG LOGICAL;
|
||||
typedef ULONG *PLOGICAL;
|
||||
|
||||
//
|
||||
// Signed Types
|
||||
//
|
||||
/* Signed Types */
|
||||
typedef SHORT *PSHORT;
|
||||
typedef LONG *PLONG;
|
||||
|
||||
typedef LONG NTSTATUS;
|
||||
typedef NTSTATUS *PNTSTATUS;
|
||||
|
||||
typedef signed char SCHAR;
|
||||
typedef SCHAR *PSCHAR;
|
||||
|
||||
|
@ -401,22 +319,15 @@ typedef SCHAR *PSCHAR;
|
|||
typedef LONG HRESULT;
|
||||
#endif
|
||||
|
||||
//
|
||||
// 64-bit types
|
||||
//
|
||||
/* 64-bit types */
|
||||
__GNU_EXTENSION typedef __int64 LONGLONG, *PLONGLONG;
|
||||
__GNU_EXTENSION typedef unsigned __int64 ULONGLONG, *PULONGLONG;
|
||||
typedef ULONGLONG DWORDLONG, *PDWORDLONG;
|
||||
|
||||
//
|
||||
// Update Sequence Number
|
||||
//
|
||||
/* Update Sequence Number */
|
||||
typedef LONGLONG USN;
|
||||
|
||||
|
||||
//
|
||||
// ANSI (Multi-byte Character) types
|
||||
//
|
||||
/* ANSI (Multi-byte Character) types */
|
||||
typedef CHAR *PCHAR, *LPCH, *PCH;
|
||||
typedef CONST CHAR *LPCCH, *PCCH;
|
||||
typedef CHAR *NPSTR, *LPSTR, *PSTR;
|
||||
|
@ -425,15 +336,11 @@ typedef CONST PSTR *PCZPSTR;
|
|||
typedef CONST CHAR *LPCSTR, *PCSTR;
|
||||
typedef PCSTR *PZPCSTR;
|
||||
|
||||
//
|
||||
// Pointer to an Asciiz string
|
||||
//
|
||||
/* Pointer to an Asciiz string */
|
||||
typedef CHAR *PSZ;
|
||||
typedef CONST char *PCSZ;
|
||||
|
||||
//
|
||||
// UNICODE (Wide Character) types
|
||||
//
|
||||
/* UNICODE (Wide Character) types */
|
||||
typedef wchar_t WCHAR;
|
||||
typedef WCHAR *PWCHAR, *LPWCH, *PWCH;
|
||||
typedef CONST WCHAR *LPCWCH, *PCWCH;
|
||||
|
@ -445,25 +352,27 @@ typedef CONST WCHAR *LPCWSTR, *PCWSTR;
|
|||
typedef PCWSTR *PZPCWSTR;
|
||||
typedef CONST WCHAR UNALIGNED *LPCUWSTR, *PCUWSTR;
|
||||
|
||||
//
|
||||
// Cardinal Data Types
|
||||
//
|
||||
/* Cardinal Data Types */
|
||||
typedef char CCHAR, *PCCHAR;
|
||||
typedef short CSHORT, *PCSHORT;
|
||||
typedef ULONG CLONG, *PCLONG;
|
||||
|
||||
//
|
||||
// NLS basics (Locale and Language Ids)
|
||||
//
|
||||
/* NLS basics (Locale and Language Ids) */
|
||||
typedef ULONG LCID;
|
||||
typedef PULONG PLCID;
|
||||
typedef USHORT LANGID;
|
||||
|
||||
/* Used to store a non-float 8 byte aligned structure */
|
||||
typedef struct _QUAD
|
||||
{
|
||||
_ANONYMOUS_UNION union
|
||||
{
|
||||
__GNU_EXTENSION __int64 UseThisFieldToCopy;
|
||||
double DoNotUseThisField;
|
||||
} DUMMYUNIONNAME;
|
||||
} QUAD, *PQUAD, UQUAD, *PUQUAD;
|
||||
|
||||
|
||||
//
|
||||
// Large Integer Unions
|
||||
//
|
||||
/* Large Integer Unions */
|
||||
#if defined(MIDL_PASS)
|
||||
typedef struct _LARGE_INTEGER {
|
||||
#else
|
||||
|
@ -478,7 +387,7 @@ typedef union _LARGE_INTEGER {
|
|||
ULONG LowPart;
|
||||
LONG HighPart;
|
||||
} u;
|
||||
#endif //MIDL_PASS
|
||||
#endif /* MIDL_PASS */
|
||||
LONGLONG QuadPart;
|
||||
} LARGE_INTEGER, *PLARGE_INTEGER;
|
||||
|
||||
|
@ -496,40 +405,26 @@ typedef union _ULARGE_INTEGER {
|
|||
ULONG LowPart;
|
||||
ULONG HighPart;
|
||||
} u;
|
||||
#endif //MIDL_PASS
|
||||
#endif /* MIDL_PASS */
|
||||
ULONGLONG QuadPart;
|
||||
} ULARGE_INTEGER, *PULARGE_INTEGER;
|
||||
|
||||
//
|
||||
// Physical Addresses are always treated as 64-bit wide
|
||||
//
|
||||
/* Physical Addresses are always treated as 64-bit wide */
|
||||
typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Locally Unique Identifier
|
||||
//
|
||||
/* Locally Unique Identifier */
|
||||
typedef struct _LUID {
|
||||
ULONG LowPart;
|
||||
LONG HighPart;
|
||||
} LUID, *PLUID;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Native API Return Value Macros
|
||||
//
|
||||
/* Native API Return Value Macros */
|
||||
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
|
||||
#define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1)
|
||||
#define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2)
|
||||
#define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3)
|
||||
|
||||
|
||||
|
||||
//
|
||||
// String Types
|
||||
//
|
||||
/* String Types */
|
||||
typedef struct _UNICODE_STRING {
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
|
@ -575,9 +470,7 @@ typedef struct _STRING64 {
|
|||
UNICODE_STRING64, *PUNICODE_STRING64,
|
||||
ANSI_STRING64, *PANSI_STRING64;
|
||||
|
||||
//
|
||||
// LangID and NLS
|
||||
//
|
||||
/* LangID and NLS */
|
||||
#define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p))
|
||||
#define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff)
|
||||
#define SUBLANGID(lgid) ((USHORT)(lgid) >> 10)
|
||||
|
@ -594,10 +487,7 @@ typedef struct _STRING64 {
|
|||
#define SORTVERSIONFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 20) & 0xf))
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Object Attributes
|
||||
//
|
||||
/* Object Attributes */
|
||||
typedef struct _OBJECT_ATTRIBUTES {
|
||||
ULONG Length;
|
||||
HANDLE RootDirectory;
|
||||
|
@ -608,9 +498,7 @@ typedef struct _OBJECT_ATTRIBUTES {
|
|||
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
|
||||
typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES;
|
||||
|
||||
//
|
||||
// Values for the Attributes member
|
||||
//
|
||||
/* Values for the Attributes member */
|
||||
#define OBJ_INHERIT 0x00000002
|
||||
#define OBJ_PERMANENT 0x00000010
|
||||
#define OBJ_EXCLUSIVE 0x00000020
|
||||
|
@ -621,9 +509,7 @@ typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES;
|
|||
#define OBJ_FORCE_ACCESS_CHECK 0x00000400
|
||||
#define OBJ_VALID_ATTRIBUTES 0x000007F2
|
||||
|
||||
//
|
||||
// Helper Macro
|
||||
//
|
||||
/* Helper Macro */
|
||||
#define InitializeObjectAttributes(p,n,a,r,s) { \
|
||||
(p)->Length = sizeof(OBJECT_ATTRIBUTES); \
|
||||
(p)->RootDirectory = (r); \
|
||||
|
@ -633,22 +519,29 @@ typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES;
|
|||
(p)->SecurityQualityOfService = NULL; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Product Types
|
||||
//
|
||||
/* Product Types */
|
||||
typedef enum _NT_PRODUCT_TYPE {
|
||||
NtProductWinNt = 1,
|
||||
NtProductLanManNt,
|
||||
NtProductServer
|
||||
} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
|
||||
|
||||
typedef enum _EVENT_TYPE {
|
||||
NotificationEvent,
|
||||
SynchronizationEvent
|
||||
} EVENT_TYPE;
|
||||
|
||||
typedef enum _TIMER_TYPE {
|
||||
NotificationTimer,
|
||||
SynchronizationTimer
|
||||
} TIMER_TYPE;
|
||||
|
||||
//
|
||||
// Doubly Linked Lists
|
||||
//
|
||||
typedef enum _WAIT_TYPE {
|
||||
WaitAll,
|
||||
WaitAny
|
||||
} WAIT_TYPE;
|
||||
|
||||
/* Doubly Linked Lists */
|
||||
typedef struct _LIST_ENTRY {
|
||||
struct _LIST_ENTRY *Flink;
|
||||
struct _LIST_ENTRY *Blink;
|
||||
|
@ -666,14 +559,11 @@ typedef struct LIST_ENTRY64
|
|||
ULONGLONG Blink;
|
||||
} LIST_ENTRY64, *PLIST_ENTRY64;
|
||||
|
||||
//
|
||||
// Singly Linked Lists
|
||||
//
|
||||
/* Singly Linked Lists */
|
||||
typedef struct _SINGLE_LIST_ENTRY {
|
||||
struct _SINGLE_LIST_ENTRY *Next;
|
||||
} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
|
||||
|
||||
|
||||
typedef struct _PROCESSOR_NUMBER {
|
||||
USHORT Group;
|
||||
UCHAR Number;
|
||||
|
@ -681,16 +571,19 @@ typedef struct _PROCESSOR_NUMBER {
|
|||
} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;
|
||||
|
||||
typedef EXCEPTION_DISPOSITION
|
||||
(DDKAPI *PEXCEPTION_ROUTINE)(
|
||||
(NTAPI *PEXCEPTION_ROUTINE)(
|
||||
IN struct _EXCEPTION_RECORD *ExceptionRecord,
|
||||
IN PVOID EstablisherFrame,
|
||||
IN OUT struct _CONTEXT *ContextRecord,
|
||||
IN OUT PVOID DispatcherContext);
|
||||
|
||||
typedef struct _GROUP_AFFINITY {
|
||||
KAFFINITY Mask;
|
||||
USHORT Group;
|
||||
USHORT Reserved[3];
|
||||
} GROUP_AFFINITY, *PGROUP_AFFINITY;
|
||||
|
||||
//
|
||||
// Helper Macros
|
||||
//
|
||||
/* Helper Macros */
|
||||
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
|
||||
|
||||
#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
|
||||
|
@ -704,11 +597,7 @@ typedef EXCEPTION_DISPOSITION
|
|||
#endif
|
||||
#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Type Limits
|
||||
//
|
||||
/* Type Limits */
|
||||
#define MINCHAR 0x80
|
||||
#define MAXCHAR 0x7f
|
||||
#define MINSHORT 0x8000
|
||||
|
@ -720,29 +609,17 @@ typedef EXCEPTION_DISPOSITION
|
|||
#define MAXULONG 0xffffffff
|
||||
#define MAXLONGLONG (0x7fffffffffffffffLL)
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Multiplication and Shift Operations
|
||||
//
|
||||
/* Multiplication and Shift Operations */
|
||||
#define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b))
|
||||
#define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b))
|
||||
#define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b))
|
||||
#define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b))
|
||||
#define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b))
|
||||
|
||||
|
||||
|
||||
//
|
||||
// C_ASSERT Definition
|
||||
//
|
||||
/* C_ASSERT Definition */
|
||||
#define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Primary language IDs.
|
||||
//
|
||||
/* Primary language IDs. */
|
||||
#define LANG_NEUTRAL 0x00
|
||||
#define LANG_INVARIANT 0x7f
|
||||
|
||||
|
@ -873,6 +750,4 @@ typedef EXCEPTION_DISPOSITION
|
|||
#define LANG_YORUBA 0x6a
|
||||
#define LANG_ZULU 0x35
|
||||
|
||||
|
||||
|
||||
#endif /* _NTDEF_H */
|
||||
#endif /* _NTDEF_ */
|
||||
|
|
Loading…
Reference in a new issue