mirror of
https://github.com/reactos/reactos.git
synced 2024-09-10 12:54:51 +00:00
![Amine Khaldi](/assets/img/avatar_default.png)
- Add the missing definitions needed to autogenerate ntddk.h - Add ntddk.template.h as a template for autogenerating ntddk.h - Adjust generate.bat to generate ntddk.h too. [DDK] - Introduce the autogenerated ntddk.h into DDK. svn path=/branches/header-work/; revision=46348
335 lines
8.7 KiB
C
335 lines
8.7 KiB
C
/******************************************************************************
|
|
* Process Manager Types *
|
|
******************************************************************************/
|
|
|
|
$if (_NTDDK_)
|
|
|
|
typedef VOID
|
|
(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)(
|
|
IN HANDLE ParentId,
|
|
IN HANDLE ProcessId,
|
|
IN BOOLEAN Create);
|
|
|
|
typedef struct _PS_CREATE_NOTIFY_INFO {
|
|
IN SIZE_T Size;
|
|
union {
|
|
IN ULONG Flags;
|
|
struct {
|
|
IN ULONG FileOpenNameAvailable:1;
|
|
IN ULONG Reserved:31;
|
|
};
|
|
};
|
|
IN HANDLE ParentProcessId;
|
|
IN CLIENT_ID CreatingThreadId;
|
|
IN OUT struct _FILE_OBJECT *FileObject;
|
|
IN PCUNICODE_STRING ImageFileName;
|
|
IN PCUNICODE_STRING CommandLine OPTIONAL;
|
|
IN OUT NTSTATUS CreationStatus;
|
|
} PS_CREATE_NOTIFY_INFO, *PPS_CREATE_NOTIFY_INFO;
|
|
|
|
typedef VOID
|
|
(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE_EX)(
|
|
IN OUT PEPROCESS Process,
|
|
IN HANDLE ProcessId,
|
|
IN PPS_CREATE_NOTIFY_INFO CreateInfo OPTIONAL);
|
|
|
|
typedef VOID
|
|
(NTAPI *PCREATE_THREAD_NOTIFY_ROUTINE)(
|
|
IN HANDLE ProcessId,
|
|
IN HANDLE ThreadId,
|
|
IN BOOLEAN Create);
|
|
|
|
#define IMAGE_ADDRESSING_MODE_32BIT 3
|
|
|
|
typedef struct _IMAGE_INFO {
|
|
_ANONYMOUS_UNION union {
|
|
ULONG Properties;
|
|
_ANONYMOUS_STRUCT struct {
|
|
ULONG ImageAddressingMode:8;
|
|
ULONG SystemModeImage:1;
|
|
ULONG ImageMappedToAllPids:1;
|
|
ULONG ExtendedInfoPresent:1;
|
|
ULONG Reserved:21;
|
|
} DUMMYSTRUCTNAME;
|
|
} DUMMYUNIONNAME;
|
|
PVOID ImageBase;
|
|
ULONG ImageSelector;
|
|
SIZE_T ImageSize;
|
|
ULONG ImageSectionNumber;
|
|
} IMAGE_INFO, *PIMAGE_INFO;
|
|
|
|
typedef struct _IMAGE_INFO_EX {
|
|
SIZE_T Size;
|
|
IMAGE_INFO ImageInfo;
|
|
struct _FILE_OBJECT *FileObject;
|
|
} IMAGE_INFO_EX, *PIMAGE_INFO_EX;
|
|
|
|
typedef VOID
|
|
(NTAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)(
|
|
IN PUNICODE_STRING FullImageName,
|
|
IN HANDLE ProcessId,
|
|
IN PIMAGE_INFO ImageInfo);
|
|
|
|
#define THREAD_CSWITCH_PMU_DISABLE FALSE
|
|
#define THREAD_CSWITCH_PMU_ENABLE TRUE
|
|
|
|
#define PROCESS_LUID_DOSDEVICES_ONLY 0x00000001
|
|
|
|
#define PROCESS_HANDLE_TRACING_MAX_STACKS 16
|
|
|
|
typedef struct _NT_TIB {
|
|
struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
|
|
PVOID StackBase;
|
|
PVOID StackLimit;
|
|
PVOID SubSystemTib;
|
|
_ANONYMOUS_UNION union {
|
|
PVOID FiberData;
|
|
ULONG Version;
|
|
} DUMMYUNIONNAME;
|
|
PVOID ArbitraryUserPointer;
|
|
struct _NT_TIB *Self;
|
|
} NT_TIB, *PNT_TIB;
|
|
|
|
typedef struct _NT_TIB32 {
|
|
ULONG ExceptionList;
|
|
ULONG StackBase;
|
|
ULONG StackLimit;
|
|
ULONG SubSystemTib;
|
|
__GNU_EXTENSION union {
|
|
ULONG FiberData;
|
|
ULONG Version;
|
|
};
|
|
ULONG ArbitraryUserPointer;
|
|
ULONG Self;
|
|
} NT_TIB32,*PNT_TIB32;
|
|
|
|
typedef struct _NT_TIB64 {
|
|
ULONG64 ExceptionList;
|
|
ULONG64 StackBase;
|
|
ULONG64 StackLimit;
|
|
ULONG64 SubSystemTib;
|
|
__GNU_EXTENSION union {
|
|
ULONG64 FiberData;
|
|
ULONG Version;
|
|
};
|
|
ULONG64 ArbitraryUserPointer;
|
|
ULONG64 Self;
|
|
} NT_TIB64,*PNT_TIB64;
|
|
|
|
typedef enum _PROCESSINFOCLASS {
|
|
ProcessBasicInformation,
|
|
ProcessQuotaLimits,
|
|
ProcessIoCounters,
|
|
ProcessVmCounters,
|
|
ProcessTimes,
|
|
ProcessBasePriority,
|
|
ProcessRaisePriority,
|
|
ProcessDebugPort,
|
|
ProcessExceptionPort,
|
|
ProcessAccessToken,
|
|
ProcessLdtInformation,
|
|
ProcessLdtSize,
|
|
ProcessDefaultHardErrorMode,
|
|
ProcessIoPortHandlers,
|
|
ProcessPooledUsageAndLimits,
|
|
ProcessWorkingSetWatch,
|
|
ProcessUserModeIOPL,
|
|
ProcessEnableAlignmentFaultFixup,
|
|
ProcessPriorityClass,
|
|
ProcessWx86Information,
|
|
ProcessHandleCount,
|
|
ProcessAffinityMask,
|
|
ProcessPriorityBoost,
|
|
ProcessDeviceMap,
|
|
ProcessSessionInformation,
|
|
ProcessForegroundInformation,
|
|
ProcessWow64Information,
|
|
ProcessImageFileName,
|
|
ProcessLUIDDeviceMapsEnabled,
|
|
ProcessBreakOnTermination,
|
|
ProcessDebugObjectHandle,
|
|
ProcessDebugFlags,
|
|
ProcessHandleTracing,
|
|
ProcessIoPriority,
|
|
ProcessExecuteFlags,
|
|
ProcessTlsInformation,
|
|
ProcessCookie,
|
|
ProcessImageInformation,
|
|
ProcessCycleTime,
|
|
ProcessPagePriority,
|
|
ProcessInstrumentationCallback,
|
|
ProcessThreadStackAllocation,
|
|
ProcessWorkingSetWatchEx,
|
|
ProcessImageFileNameWin32,
|
|
ProcessImageFileMapping,
|
|
ProcessAffinityUpdateMode,
|
|
ProcessMemoryAllocationMode,
|
|
ProcessGroupInformation,
|
|
ProcessTokenVirtualizationEnabled,
|
|
ProcessConsoleHostProcess,
|
|
ProcessWindowInformation,
|
|
MaxProcessInfoClass
|
|
} PROCESSINFOCLASS;
|
|
|
|
typedef enum _THREADINFOCLASS {
|
|
ThreadBasicInformation,
|
|
ThreadTimes,
|
|
ThreadPriority,
|
|
ThreadBasePriority,
|
|
ThreadAffinityMask,
|
|
ThreadImpersonationToken,
|
|
ThreadDescriptorTableEntry,
|
|
ThreadEnableAlignmentFaultFixup,
|
|
ThreadEventPair_Reusable,
|
|
ThreadQuerySetWin32StartAddress,
|
|
ThreadZeroTlsCell,
|
|
ThreadPerformanceCount,
|
|
ThreadAmILastThread,
|
|
ThreadIdealProcessor,
|
|
ThreadPriorityBoost,
|
|
ThreadSetTlsArrayAddress,
|
|
ThreadIsIoPending,
|
|
ThreadHideFromDebugger,
|
|
ThreadBreakOnTermination,
|
|
ThreadSwitchLegacyState,
|
|
ThreadIsTerminated,
|
|
ThreadLastSystemCall,
|
|
ThreadIoPriority,
|
|
ThreadCycleTime,
|
|
ThreadPagePriority,
|
|
ThreadActualBasePriority,
|
|
ThreadTebInformation,
|
|
ThreadCSwitchMon,
|
|
ThreadCSwitchPmu,
|
|
ThreadWow64Context,
|
|
ThreadGroupInformation,
|
|
ThreadUmsInformation,
|
|
ThreadCounterProfiling,
|
|
ThreadIdealProcessorEx,
|
|
MaxThreadInfoClass
|
|
} THREADINFOCLASS;
|
|
|
|
typedef struct _PAGE_PRIORITY_INFORMATION {
|
|
ULONG PagePriority;
|
|
} PAGE_PRIORITY_INFORMATION, *PPAGE_PRIORITY_INFORMATION;
|
|
|
|
typedef struct _PROCESS_WS_WATCH_INFORMATION {
|
|
PVOID FaultingPc;
|
|
PVOID FaultingVa;
|
|
} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION;
|
|
|
|
typedef struct _PROCESS_BASIC_INFORMATION {
|
|
NTSTATUS ExitStatus;
|
|
struct _PEB *PebBaseAddress;
|
|
ULONG_PTR AffinityMask;
|
|
KPRIORITY BasePriority;
|
|
ULONG_PTR UniqueProcessId;
|
|
ULONG_PTR InheritedFromUniqueProcessId;
|
|
} PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION;
|
|
|
|
typedef struct _PROCESS_EXTENDED_BASIC_INFORMATION {
|
|
SIZE_T Size;
|
|
PROCESS_BASIC_INFORMATION BasicInfo;
|
|
union {
|
|
ULONG Flags;
|
|
struct {
|
|
ULONG IsProtectedProcess:1;
|
|
ULONG IsWow64Process:1;
|
|
ULONG IsProcessDeleting:1;
|
|
ULONG IsCrossSessionCreate:1;
|
|
ULONG SpareBits:28;
|
|
} DUMMYSTRUCTNAME;
|
|
} DUMMYUNIONNAME;
|
|
} PROCESS_EXTENDED_BASIC_INFORMATION, *PPROCESS_EXTENDED_BASIC_INFORMATION;
|
|
|
|
typedef struct _PROCESS_DEVICEMAP_INFORMATION {
|
|
__GNU_EXTENSION union {
|
|
struct {
|
|
HANDLE DirectoryHandle;
|
|
} Set;
|
|
struct {
|
|
ULONG DriveMap;
|
|
UCHAR DriveType[32];
|
|
} Query;
|
|
};
|
|
} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
|
|
|
|
typedef struct _PROCESS_DEVICEMAP_INFORMATION_EX {
|
|
union {
|
|
struct {
|
|
HANDLE DirectoryHandle;
|
|
} Set;
|
|
struct {
|
|
ULONG DriveMap;
|
|
UCHAR DriveType[32];
|
|
} Query;
|
|
} DUMMYUNIONNAME;
|
|
ULONG Flags;
|
|
} PROCESS_DEVICEMAP_INFORMATION_EX, *PPROCESS_DEVICEMAP_INFORMATION_EX;
|
|
|
|
typedef struct _PROCESS_SESSION_INFORMATION {
|
|
ULONG SessionId;
|
|
} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
|
|
|
|
typedef struct _PROCESS_HANDLE_TRACING_ENABLE {
|
|
ULONG Flags;
|
|
} PROCESS_HANDLE_TRACING_ENABLE, *PPROCESS_HANDLE_TRACING_ENABLE;
|
|
|
|
typedef struct _PROCESS_HANDLE_TRACING_ENABLE_EX {
|
|
ULONG Flags;
|
|
ULONG TotalSlots;
|
|
} PROCESS_HANDLE_TRACING_ENABLE_EX, *PPROCESS_HANDLE_TRACING_ENABLE_EX;
|
|
|
|
typedef struct _PROCESS_HANDLE_TRACING_ENTRY {
|
|
HANDLE Handle;
|
|
CLIENT_ID ClientId;
|
|
ULONG Type;
|
|
PVOID Stacks[PROCESS_HANDLE_TRACING_MAX_STACKS];
|
|
} PROCESS_HANDLE_TRACING_ENTRY, *PPROCESS_HANDLE_TRACING_ENTRY;
|
|
|
|
typedef struct _PROCESS_HANDLE_TRACING_QUERY {
|
|
HANDLE Handle;
|
|
ULONG TotalTraces;
|
|
PROCESS_HANDLE_TRACING_ENTRY HandleTrace[1];
|
|
} PROCESS_HANDLE_TRACING_QUERY, *PPROCESS_HANDLE_TRACING_QUERY;
|
|
|
|
$endif
|
|
|
|
$if (_WDMDDK_)
|
|
#define QUOTA_LIMITS_HARDWS_MIN_ENABLE 0x00000001
|
|
#define QUOTA_LIMITS_HARDWS_MIN_DISABLE 0x00000002
|
|
#define QUOTA_LIMITS_HARDWS_MAX_ENABLE 0x00000004
|
|
#define QUOTA_LIMITS_HARDWS_MAX_DISABLE 0x00000008
|
|
#define QUOTA_LIMITS_USE_DEFAULT_LIMITS 0x00000010
|
|
|
|
/* Thread Access Rights */
|
|
#define THREAD_TERMINATE 0x0001
|
|
#define THREAD_SUSPEND_RESUME 0x0002
|
|
#define THREAD_ALERT 0x0004
|
|
#define THREAD_GET_CONTEXT 0x0008
|
|
#define THREAD_SET_CONTEXT 0x0010
|
|
#define THREAD_SET_INFORMATION 0x0020
|
|
#define THREAD_SET_LIMITED_INFORMATION 0x0400
|
|
#define THREAD_QUERY_LIMITED_INFORMATION 0x0800
|
|
|
|
#define PROCESS_DUP_HANDLE (0x0040)
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF)
|
|
#else
|
|
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF)
|
|
#endif
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF)
|
|
#else
|
|
#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3FF)
|
|
#endif
|
|
|
|
#define LOW_PRIORITY 0
|
|
#define LOW_REALTIME_PRIORITY 16
|
|
#define HIGH_PRIORITY 31
|
|
#define MAXIMUM_PRIORITY 32
|
|
$endif
|
|
|