Major cleanup of User-Mode NDK
Modified: trunk/reactos/include/ndk/umtypes.h

Modified: trunk/reactos/include/ndk/umtypes.h
--- trunk/reactos/include/ndk/umtypes.h	2005-06-19 18:06:53 UTC (rev 16099)
+++ trunk/reactos/include/ndk/umtypes.h	2005-06-19 18:21:58 UTC (rev 16100)
@@ -10,9 +10,20 @@
 #ifndef _UMTYPES_H
 #define _UMTYPES_H
 
-/*FIXME: REORGANIZE!!!*/
+/* DEPENDENCIES **************************************************************/
+#include <winioctl.h>
+#include <ntstatus.h>
+#include <ddk/ntnls.h>
+#define STATIC static
 
+/* EXPORTED DATA *************************************************************/
+
+/* CONSTANTS *****************************************************************/
+
+/* NTAPI Define */
 #define NTAPI __stdcall
+
+/* Definitions for Object Creation -- winternl.h */
 #define OBJ_INHERIT 2L
 #define OBJ_PERMANENT 16L
 #define OBJ_EXCLUSIVE 32L
@@ -28,685 +39,727 @@
   (p)->SecurityDescriptor = (s); \
   (p)->SecurityQualityOfService = NULL; \
 }
-#ifndef NT_SUCCESS
+
+/* Native API Return Value Macros */
 #define NT_SUCCESS(x) ((x)>=0)
-#define STATUS_SUCCESS ((NTSTATUS)0)
-#endif
 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
-#define PAGE_SIZE                         0x1000
-#define PAGE_SHIFT                        12L
-#define SharedUserData                    ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA)
-#include <ddk/ntstatus.h>
-typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 
-#ifdef DBG
+/* I/O Control Codes for communicating with Mailslots */
+#define FSCTL_MAILSLOT_PEEK             \
+    CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
 
-#define ASSERT(exp) \
-  ((!(exp)) ? \
-    (RtlAssert( #exp, __FILE__, __LINE__, NULL ), FALSE) : TRUE)
+/* I/O Control Codes for communicating with Network Drivers */
+#define IOCTL_REDIR_QUERY_PATH                  \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_SET_CONFIGURATION_INFO    \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_GET_CONFIGURATION_INFO    \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_GET_CONNECTION_INFO       \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_ENUMERATE_CONNECTIONS     \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_DELETE_CONNECTION         \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_GET_STATISTICS            \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_SET_DOMAIN_NAME           \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT     \
+    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
-#define ASSERTMSG(msg, exp) \
-  ((!(exp)) ? \
-    (RtlAssert( #exp, __FILE__, __LINE__, msg ), FALSE) : TRUE)
+/* I/O Control Codes for communicating with Pipes */
+#define FSCTL_PIPE_ASSIGN_EVENT         \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_DISCONNECT           \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_LISTEN               \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_PEEK                 \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
+    
+#define FSCTL_PIPE_QUERY_EVENT          \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_TRANSCEIVE           \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER,  FILE_READ_DATA | FILE_WRITE_DATA)
+    
+#define FSCTL_PIPE_WAIT                 \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_IMPERSONATE          \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_SET_CLIENT_PROCESS   \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_QUERY_CLIENT_PROCESS \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
+    
+#define FSCTL_PIPE_INTERNAL_READ        \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
+    
+#define FSCTL_PIPE_INTERNAL_WRITE       \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
+    
+#define FSCTL_PIPE_INTERNAL_TRANSCEIVE  \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
+    
+#define FSCTL_PIPE_INTERNAL_READ_OVFLOW \
+    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
 
-#define RTL_SOFT_ASSERT(exp) \
-  ((!(_exp)) ? \
-    (DbgPrint("%s(%d): Soft assertion failed\n   Expression: %s\n", __FILE__, __LINE__, #exp), FALSE) : TRUE)
+/* Macros for getting the current Process or Thread */
+#define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 )  
+#define ZwCurrentProcess() NtCurrentProcess()         
+#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )   
+#define ZwCurrentThread() NtCurrentThread()      
 
-#define RTL_SOFT_ASSERTMSG(msg, exp) \
-  ((!(exp)) ? \
-    (DbgPrint("%s(%d): Soft assertion failed\n   Expression: %s\n   Message: %s\n", __FILE__, __LINE__, #exp, (msg)), FALSE) : TRUE)
+/* Kernel Shared Data Constants */
+#define PROCESSOR_FEATURE_MAX 64
+#define KI_USER_SHARED_DATA   0xffdf0000
+#define SharedUserData ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA)
 
-#define RTL_VERIFY(exp) ASSERT(exp)
-#define RTL_VERIFYMSG(msg, exp) ASSERT(msg, exp)
+/* Paging Values on x86 */
+#define PAGE_SIZE                         0x1000
+#define PAGE_SHIFT                        12L
 
-#define RTL_SOFT_VERIFY(exp) RTL_SOFT_ASSERT(exp)
-#define RTL_SOFT_VERIFYMSG(msg, exp) RTL_SOFT_ASSERTMSG(msg, exp)
+/* Run-Time Library (RTL) Registry Constants */
+#define RTL_REGISTRY_ABSOLUTE       0
+#define RTL_REGISTRY_SERVICES       1
+#define RTL_REGISTRY_CONTROL        2
+#define RTL_REGISTRY_WINDOWS_NT     3
+#define RTL_REGISTRY_DEVICEMAP      4
+#define RTL_REGISTRY_USER           5
+#define RTL_REGISTRY_MAXIMUM        6
+#define RTL_REGISTRY_HANDLE         0x40000000
+#define RTL_REGISTRY_OPTIONAL       0x80000000
+#define RTL_QUERY_REGISTRY_SUBKEY   0x00000001
+#define RTL_QUERY_REGISTRY_TOPKEY   0x00000002
+#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
+#define RTL_QUERY_REGISTRY_NOVALUE  0x00000008
+#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
+#define RTL_QUERY_REGISTRY_DIRECT   0x00000020
+#define RTL_QUERY_REGISTRY_DELETE   0x00000040
 
-#else /* !DBG */
+/* SID Constants */
+#define SID_MAX_SUB_AUTHORITIES     15
 
-#define ASSERT(exp) ((VOID) 0)
-#define ASSERTMSG(msg, exp) ((VOID) 0)
+/* Version Constants */
+#define VER_MINORVERSION                0x0000001
+#define VER_MAJORVERSION                0x0000002
+#define VER_BUILDNUMBER                 0x0000004
+#define VER_PLATFORMID                  0x0000008
+#define VER_SERVICEPACKMINOR            0x0000010
+#define VER_SERVICEPACKMAJOR            0x0000020
+#define VER_SUITENAME                   0x0000040
+#define VER_PRODUCT_TYPE                0x0000080
+#define VER_PLATFORM_WIN32s             0
+#define VER_PLATFORM_WIN32_WINDOWS      1
+#define VER_PLATFORM_WIN32_NT           2
+#define VER_EQUAL                       1
+#define VER_GREATER                     2
+#define VER_GREATER_EQUAL               3
+#define VER_LESS                        4
+#define VER_LESS_EQUAL                  5
+#define VER_AND                         6
+#define VER_OR                          7
+#define VER_CONDITION_MASK              7
+#define VER_NUM_BITS_PER_CONDITION_MASK 3
 
-#define RTL_SOFT_ASSERT(exp) ((VOID) 0)
-#define RTL_SOFT_ASSERTMSG(msg, exp) ((VOID) 0)
+/* ENUMERATIONS **************************************************************/
 
-#define RTL_VERIFY(exp) ((exp) ? TRUE : FALSE)
-#define RTL_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
+/* Kernel Shared Data Values */
+typedef enum _NT_PRODUCT_TYPE 
+{
+    NtProductWinNt = 1,
+    NtProductLanManNt,
+    NtProductServer
+} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
 
-#define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE)
-#define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
+typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE 
+{
+    StandardDesign,
+    NEC98x86,
+    EndAlternatives
+} ALTERNATIVE_ARCHITECTURE_TYPE;
 
-#endif /* DBG */
+/* Run-Time Library (RTL) Enumerations */
+typedef enum _TABLE_SEARCH_RESULT
+{
+    TableEmptyTree,
+    TableFoundNode,
+    TableInsertAsLeft,
+    TableInsertAsRight
+} TABLE_SEARCH_RESULT;
 
-#define FILE_ANY_ACCESS   0
-#define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS
-#define FILE_READ_ACCESS  1
-#define FILE_WRITE_ACCESS 2
+typedef enum _RTL_GENERIC_COMPARE_RESULTS 
+{
+    GenericLessThan,
+    GenericGreaterThan,
+    GenericEqual
+} RTL_GENERIC_COMPARE_RESULTS;
 
-#define METHOD_BUFFERED                   0
-#define METHOD_IN_DIRECT                  1
-#define METHOD_OUT_DIRECT                 2
-#define METHOD_NEITHER                    3
+/* Kernel or Native Enumerations used by Native API */
+typedef enum _SECTION_INHERIT 
+{
+    ViewShare = 1,
+    ViewUnmap = 2
+} SECTION_INHERIT;
 
-#define DEVICE_TYPE ULONG
+typedef enum _POOL_TYPE 
+{
+    NonPagedPool,
+    PagedPool,
+    NonPagedPoolMustSucceed,
+    DontUseThisType,
+    NonPagedPoolCacheAligned,
+    PagedPoolCacheAligned,
+    NonPagedPoolCacheAlignedMustS,
+    MaxPoolType,
+    NonPagedPoolSession = 32,
+    PagedPoolSession,
+    NonPagedPoolMustSucceedSession,
+    DontUseThisTypeSession,
+    NonPagedPoolCacheAlignedSession,
+    PagedPoolCacheAlignedSession,
+    NonPagedPoolCacheAlignedMustSSession
+} POOL_TYPE;
 
-#define FILE_DEVICE_BEEP                  0x00000001
-#define FILE_DEVICE_CD_ROM                0x00000002
-#define FILE_DEVICE_CD_ROM_FILE_SYSTEM    0x00000003
-#define FILE_DEVICE_CONTROLLER            0x00000004
-#define FILE_DEVICE_DATALINK              0x00000005
-#define FILE_DEVICE_DFS                   0x00000006
-#define FILE_DEVICE_DISK                  0x00000007
-#define FILE_DEVICE_DISK_FILE_SYSTEM      0x00000008
-#define FILE_DEVICE_FILE_SYSTEM           0x00000009
-#define FILE_DEVICE_INPORT_PORT           0x0000000a
-#define FILE_DEVICE_KEYBOARD              0x0000000b
-#define FILE_DEVICE_MAILSLOT              0x0000000c
-#define FILE_DEVICE_MIDI_IN               0x0000000d
-#define FILE_DEVICE_MIDI_OUT              0x0000000e
-#define FILE_DEVICE_MOUSE                 0x0000000f
-#define FILE_DEVICE_MULTI_UNC_PROVIDER    0x00000010
-#define FILE_DEVICE_NAMED_PIPE            0x00000011
-#define FILE_DEVICE_NETWORK               0x00000012
-#define FILE_DEVICE_NETWORK_BROWSER       0x00000013
-#define FILE_DEVICE_NETWORK_FILE_SYSTEM   0x00000014
-#define FILE_DEVICE_NULL                  0x00000015
-#define FILE_DEVICE_PARALLEL_PORT         0x00000016
-#define FILE_DEVICE_PHYSICAL_NETCARD      0x00000017
-#define FILE_DEVICE_PRINTER               0x00000018
-#define FILE_DEVICE_SCANNER               0x00000019
-#define FILE_DEVICE_SERIAL_MOUSE_PORT     0x0000001a
-#define FILE_DEVICE_SERIAL_PORT           0x0000001b
-#define FILE_DEVICE_SCREEN                0x0000001c
-#define FILE_DEVICE_SOUND                 0x0000001d
-#define FILE_DEVICE_STREAMS               0x0000001e
-#define FILE_DEVICE_TAPE                  0x0000001f
-#define FILE_DEVICE_TAPE_FILE_SYSTEM      0x00000020
-#define FILE_DEVICE_TRANSPORT             0x00000021
-#define FILE_DEVICE_UNKNOWN               0x00000022
-#define FILE_DEVICE_VIDEO                 0x00000023
-#define FILE_DEVICE_VIRTUAL_DISK          0x00000024
-#define FILE_DEVICE_WAVE_IN               0x00000025
-#define FILE_DEVICE_WAVE_OUT              0x00000026
-#define FILE_DEVICE_8042_PORT             0x00000027
-#define FILE_DEVICE_NETWORK_REDIRECTOR    0x00000028
-#define FILE_DEVICE_BATTERY               0x00000029
-#define FILE_DEVICE_BUS_EXTENDER          0x0000002a
-#define FILE_DEVICE_MODEM                 0x0000002b
-#define FILE_DEVICE_VDM                   0x0000002c
-#define FILE_DEVICE_MASS_STORAGE          0x0000002d
-#define FILE_DEVICE_SMB                   0x0000002e
-#define FILE_DEVICE_KS                    0x0000002f
-#define FILE_DEVICE_CHANGER               0x00000030
-#define FILE_DEVICE_SMARTCARD             0x00000031
-#define FILE_DEVICE_ACPI                  0x00000032
-#define FILE_DEVICE_DVD                   0x00000033
-#define FILE_DEVICE_FULLSCREEN_VIDEO      0x00000034
-#define FILE_DEVICE_DFS_FILE_SYSTEM       0x00000035
-#define FILE_DEVICE_DFS_VOLUME            0x00000036
-#define FILE_DEVICE_SERENUM               0x00000037
-#define FILE_DEVICE_TERMSRV               0x00000038
-#define FILE_DEVICE_KSEC                  0x00000039
-#define FILE_DEVICE_FIPS		              0x0000003a
-#define CTL_CODE(DeviceType, Function, Method, Access)( \
-  ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
-#define FSCTL_REQUEST_OPLOCK_LEVEL_1    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  0, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_OPLOCK_LEVEL_2    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  1, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_BATCH_OPLOCK      CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  2, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE  CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  3, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  4, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OPLOCK_BREAK_NOTIFY       CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  5, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_LOCK_VOLUME               CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  6, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_UNLOCK_VOLUME             CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  7, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DISMOUNT_VOLUME           CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  8, METHOD_BUFFERED, FILE_ANY_ACCESS)
+typedef enum _EVENT_TYPE 
+{
+    NotificationEvent,
+    SynchronizationEvent
+} EVENT_TYPE;
 
-#define FSCTL_IS_VOLUME_MOUNTED         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_IS_PATHNAME_VALID         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_MARK_VOLUME_DIRTY         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
+typedef enum _TIMER_TYPE 
+{
+    NotificationTimer,
+    SynchronizationTimer
+} TIMER_TYPE;
 
-#define FSCTL_QUERY_RETRIEVAL_POINTERS  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_GET_COMPRESSION           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_COMPRESSION           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
+typedef enum _MODE 
+{
+    KernelMode,
+    UserMode,
+    MaximumMode
+} MODE;
 
+typedef enum _KWAIT_REASON
+{
+    Executive,
+    FreePage,
+    PageIn,
+    PoolAllocation,
+    DelayExecution,
+    Suspended,
+    UserRequest,
+    WrExecutive,
+    WrFreePage,
+    WrPageIn,
+    WrPoolAllocation,
+    WrDelayExecution,
+    WrSuspended,
+    WrUserRequest,
+    WrEventPair,
+    WrQueue,
+    WrLpcReceive,
+    WrLpcReply,
+    WrVirtualMemory,
+    WrPageOut,
+    WrRendezvous,
+    Spare2,
+    WrGuardedMutex,
+    Spare4,
+    Spare5,
+    Spare6,
+    WrKernel,
+    WrResource,
+    WrPushLock,
+    WrMutex,
+    WrQuantumEnd,
+    WrDispatchInt,
+    WrPreempted,
+    WrYieldExecution,
+    MaximumWaitReason
+} KWAIT_REASON;
 
-#define FSCTL_MARK_AS_SYSTEM_HIVE       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_OPLOCK_BREAK_ACK_NO_2     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_INVALIDATE_VOLUMES        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_FAT_BPB             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_FILTER_OPLOCK     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_NTFS_VOLUME_DATA      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_NTFS_FILE_RECORD      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_VOLUME_BITMAP         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_GET_RETRIEVAL_POINTERS    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_MOVE_FILE                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_IS_VOLUME_DIRTY           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_HFS_INFORMATION       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_ALLOW_EXTENDED_DASD_IO    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_READ_PROPERTY_DATA        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_WRITE_PROPERTY_DATA       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_FIND_FILES_BY_SID         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_DUMP_PROPERTY_DATA        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_SET_OBJECT_ID             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_GET_OBJECT_ID             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DELETE_OBJECT_ID          CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_SET_REPARSE_POINT         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_GET_REPARSE_POINT         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DELETE_REPARSE_POINT      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_ENUM_USN_DATA             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_SECURITY_ID_CHECK         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_READ_USN_JOURNAL          CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_SET_OBJECT_ID_EXTENDED    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_CREATE_OR_GET_OBJECT_ID   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_SPARSE                CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_SET_ZERO_DATA             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_QUERY_ALLOCATED_RANGES    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_ENABLE_UPGRADE            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_SET_ENCRYPTION            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_ENCRYPTION_FSCTL_IO       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_WRITE_RAW_ENCRYPTED       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_READ_RAW_ENCRYPTED        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56,  METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_CREATE_USN_JOURNAL        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_READ_FILE_USN_DATA        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_WRITE_USN_CLOSE_RECORD    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59,  METHOD_NEITHER, FILE_READ_DATA)
-#define FSCTL_EXTEND_VOLUME             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_USN_JOURNAL         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DELETE_USN_JOURNAL        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_MARK_HANDLE               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SIS_COPYFILE              CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SIS_LINK_FILES            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_HSM_MSG                   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 66, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_NSS_CONTROL               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 67, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_HSM_DATA                  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 68, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_RECALL_FILE               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_NSS_RCONTROL              CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 70, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_READ_FROM_PLEX            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
-#define FSCTL_FILE_PREFETCH             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
+typedef enum _KPROFILE_SOURCE 
+{
+    ProfileTime,
+    ProfileAlignmentFixup,
+    ProfileTotalIssues,
+    ProfilePipelineDry,
+    ProfileLoadInstructions,
+    ProfilePipelineFrozen,
+    ProfileBranchInstructions,
+    ProfileTotalNonissues,
+    ProfileDcacheMisses,
+    ProfileIcacheMisses,
+    ProfileCacheMisses,
+    ProfileBranchMispredictions,
+    ProfileStoreInstructions,
+    ProfileFpInstructions,
+    ProfileIntegerInstructions,
+    Profile2Issue,
+    Profile3Issue,
+    Profile4Issue,
+    ProfileSpecialInstructions,
+    ProfileTotalCycles,
+    ProfileIcacheIssues,
+    ProfileDcacheAccesses,
+    ProfileMemoryBarrierCycles,
+    ProfileLoadLinkedIssues,
+    ProfileMaximum
+} KPROFILE_SOURCE;
 
+/**** Information Classes ****/
 
-#define FSCTL_MAILSLOT_PEEK             CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
+/*
+ * File
+ */
+typedef enum _FILE_INFORMATION_CLASS 
+{
+    FileDirectoryInformation = 1,
+    FileFullDirectoryInformation,
+    FileBothDirectoryInformation,
+    FileBasicInformation,
+    FileStandardInformation,
+    FileInternalInformation,
+    FileEaInformation,
+    FileAccessInformation,
+    FileNameInformation,
+    FileRenameInformation,
+    FileLinkInformation,
+    FileNamesInformation,
+    FileDispositionInformation,
+    FilePositionInformation,
+    FileFullEaInformation,
+    FileModeInformation,
+    FileAlignmentInformation,
+    FileAllInformation,
+    FileAllocationInformation,
+    FileEndOfFileInformation,
+    FileAlternateNameInformation,
+    FileStreamInformation,
+    FilePipeInformation,
+    FilePipeLocalInformation,
+    FilePipeRemoteInformation,
+    FileMailslotQueryInformation,
+    FileMailslotSetInformation,
+    FileCompressionInformation,
+    FileObjectIdInformation,
+    FileCompletionInformation,
+    FileMoveClusterInformation,
+    FileQuotaInformation,
+    FileReparsePointInformation,
+    FileNetworkOpenInformation,
+    FileAttributeTagInformation,
+    FileTrackingInformation,
+    FileIdBothDirectoryInformation,
+    FileIdFullDirectoryInformation,
+    FileValidDataLengthInformation,
+    FileShortNameInformation,
+    FileMaximumInformation
+} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
 
-#define FSCTL_NETWORK_SET_CONFIGURATION_INFO    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_GET_CONFIGURATION_INFO    CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_GET_CONNECTION_INFO       CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_ENUMERATE_CONNECTIONS     CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_DELETE_CONNECTION         CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_GET_STATISTICS            CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_SET_DOMAIN_NAME           CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT     CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS)
+/*
+ * File System
+ */
+typedef enum _FSINFOCLASS
+{
+    FileFsVolumeInformation = 1,
+    FileFsLabelInformation,
+    FileFsSizeInformation,
+    FileFsDeviceInformation,
+    FileFsAttributeInformation,
+    FileFsControlInformation,
+    FileFsFullSizeInformation,
+    FileFsObjectIdInformation,
+    FileFsDriverPathInformation,
+    FileFsMaximumInformation
+} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
 
-#define FSCTL_PIPE_ASSIGN_EVENT         CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_DISCONNECT           CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_LISTEN               CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_PEEK                 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_PIPE_QUERY_EVENT          CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_TRANSCEIVE           CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER,  FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_PIPE_WAIT                 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_IMPERSONATE          CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_SET_CLIENT_PROCESS   CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_QUERY_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_INTERNAL_READ        CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_PIPE_INTERNAL_WRITE       CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_PIPE_INTERNAL_TRANSCEIVE  CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_PIPE_INTERNAL_READ_OVFLOW CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
+/*
+ * Registry Key
+ */
+typedef enum _KEY_INFORMATION_CLASS 
+{
+    KeyBasicInformation,
+    KeyNodeInformation,
+    KeyFullInformation,
+    KeyNameInformation,
+    KeyCachedInformation,
+    KeyFlagsInformation
+} KEY_INFORMATION_CLASS;
 
-#define IOCTL_REDIR_QUERY_PATH          CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS)
+/*
+ * Registry Key Value
+ */
+typedef enum _KEY_VALUE_INFORMATION_CLASS 
+{
+    KeyValueBasicInformation,
+    KeyValueFullInformation,
+    KeyValuePartialInformation,
+    KeyValueFullInformationAlign64,
+    KeyValuePartialInformationAlign64
+} KEY_VALUE_INFORMATION_CLASS;
 
-#define IOCTL_DISK_BASE                   FILE_DEVICE_DISK
-#define IOCTL_DISK_GET_DRIVE_GEOMETRY \
-  CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
-  
-#define IOCTL_DISK_GET_PARTITION_INFO \
-  CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
+/*
+ * Registry Key Set
+ */
+typedef enum _KEY_SET_INFORMATION_CLASS 
+{
+    KeyWriteTimeInformation,
+    KeyUserFlagsInformation,
+    MaxKeySetInfoClass
+} KEY_SET_INFORMATION_CLASS;
 
-#define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 )  
-#define ZwCurrentProcess() NtCurrentProcess()         
-#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )   
-#define ZwCurrentThread() NtCurrentThread()      
+/*
+ * Process
+ */
+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,
+    MaxProcessInfoClass
+} PROCESSINFOCLASS;
 
-typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
+/*
+ * Thread
+ */
+typedef enum _THREADINFOCLASS 
+{
+    ThreadBasicInformation,
+    ThreadTimes,
+    ThreadPriority,
+    ThreadBasePriority,
+    ThreadAffinityMask,
+    ThreadImpersonationToken,
+    ThreadDescriptorTableEntry,
+    ThreadEnableAlignmentFaultFixup,
+    ThreadEventPair_Reusable,
+    ThreadQuerySetWin32StartAddress,
+    ThreadZeroTlsCell,
+    ThreadPerformanceCount,
+    ThreadAmILastThread,
+    ThreadIdealProcessor,
+    ThreadPriorityBoost,
+    ThreadSetTlsArrayAddress,
+    ThreadIsIoPending,
+    ThreadHideFromDebugger,
+    ThreadBreakOnTermination,
+    MaxThreadInfoClass
+} THREADINFOCLASS;
 
+/* TYPES *********************************************************************/
+
+/* Basic Types that aren't defined in User-Mode Headers */
 typedef CONST int CINT;
+typedef CONST char *PCSZ;
+typedef CONST short CSHORT;
+typedef CSHORT *PCSHORT;
+typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
+
+/* Kernel Types used by Native APIs */
 typedef LONG KPRIORITY;
 typedef LONG NTSTATUS, *PNTSTATUS;
 typedef UCHAR KIRQL, *PKIRQL;
+typedef ULONG KAFFINITY, *PKAFFINITY;
 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
 typedef ULONG WAIT_TYPE;
-typedef struct _PEB                             *PPEB;
-typedef CONST char *PCSZ;
+typedef struct _PEB *PPEB;
 typedef ULONG KPROCESSOR_MODE;
 typedef PVOID PTHREAD_START_ROUTINE;
-typedef short CSHORT;
-typedef CSHORT *PCSHORT;
-#define STATIC static
+typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 
-typedef enum _MODE 
+/* Basic NT Types */
+typedef struct _UNICODE_STRING 
 {
-    KernelMode,
-    UserMode,
-    MaximumMode
-} MODE;
-
-typedef struct _UNICODE_STRING {
-  USHORT Length;
-  USHORT MaximumLength;
-  PWSTR  Buffer;
+    USHORT Length;
+    USHORT MaximumLength;
+    PWSTR  Buffer;
 } UNICODE_STRING, *PUNICODE_STRING;
-
 typedef const UNICODE_STRING* PCUNICODE_STRING;
 
-typedef struct _STRING {
-  USHORT Length;
-  USHORT MaximumLength;
-  PCHAR  Buffer;
+typedef struct _STRING 
+{
+    USHORT Length;
+    USHORT MaximumLength;
+    PCHAR  Buffer;
 } STRING, *PSTRING;
-
 typedef STRING ANSI_STRING;
 typedef PSTRING PANSI_STRING;
 typedef STRING OEM_STRING;
 typedef PSTRING POEM_STRING;
-typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
 
-typedef enum _SECTION_INHERIT {
-  ViewShare = 1,
-  ViewUnmap = 2
-} SECTION_INHERIT;
-
-typedef struct _OBJECT_ATTRIBUTES {
-  ULONG Length;
-  HANDLE RootDirectory;
-  PUNICODE_STRING ObjectName;
-  ULONG Attributes;                      
-  PVOID SecurityDescriptor;              
-  PVOID SecurityQualityOfService;
+typedef struct _OBJECT_ATTRIBUTES 
+{
+    ULONG Length;
+    HANDLE RootDirectory;
+    PUNICODE_STRING ObjectName;
+    ULONG Attributes;                      
+    PVOID SecurityDescriptor;              
+    PVOID SecurityQualityOfService;
 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
 
-typedef ULONG KAFFINITY, *PKAFFINITY;
+typedef struct _IO_STATUS_BLOCK 
+{
+    union 
+    {
+        NTSTATUS  Status;
+        PVOID  Pointer;
+    };
+    ULONG_PTR  Information;
+} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
 
-typedef struct _CLIENT_ID {
-  HANDLE  UniqueProcess;
-  HANDLE  UniqueThread;
+typedef VOID NTAPI
+(*PIO_APC_ROUTINE)(
+    IN PVOID ApcContext,
+    IN PIO_STATUS_BLOCK IoStatusBlock,
+    IN ULONG Reserved);
+  
+typedef VOID NTAPI
+(*PKNORMAL_ROUTINE)(
+    IN PVOID  NormalContext,
+    IN PVOID  SystemArgument1,
+    IN PVOID  SystemArgument2);
+  
+typedef VOID NTAPI
+(*PTIMER_APC_ROUTINE)(
+    IN PVOID  TimerContext,
+    IN ULONG  TimerLowValue,
+    IN LONG  TimerHighValue);
+
+/* Kernel Types which are returned or used by Native API */
+typedef struct _CLIENT_ID 
+{
+    HANDLE  UniqueProcess;
+    HANDLE  UniqueThread;
 } CLIENT_ID, *PCLIENT_ID; 
 
-typedef enum _POOL_TYPE {
-  NonPagedPool,
-  PagedPool,
-  NonPagedPoolMustSucceed,
-  DontUseThisType,
-  NonPagedPoolCacheAligned,
-  PagedPoolCacheAligned,
-  NonPagedPoolCacheAlignedMustS,
-	MaxPoolType,
-	NonPagedPoolSession = 32,
-	PagedPoolSession,
-	NonPagedPoolMustSucceedSession,
-	DontUseThisTypeSession,
-	NonPagedPoolCacheAlignedSession,
-	PagedPoolCacheAlignedSession,
-	NonPagedPoolCacheAlignedMustSSession
-} POOL_TYPE;
+typedef struct _KSYSTEM_TIME 
+{
+    ULONG LowPart;
+    LONG High1Time;
+    LONG High2Time;
+} KSYSTEM_TIME, *PKSYSTEM_TIME;
 
-typedef enum _EVENT_TYPE {
-  NotificationEvent,
-  SynchronizationEvent
-} EVENT_TYPE;
+typedef struct _TIME_FIELDS
+{
+    CSHORT Year;
+    CSHORT Month;
+    CSHORT Day;
+    CSHORT Hour;
+    CSHORT Minute;
+    CSHORT Second;
+    CSHORT Milliseconds;
+    CSHORT Weekday;
+} TIME_FIELDS, *PTIME_FIELDS;
 
-typedef enum _TIMER_TYPE {
-  NotificationTimer,
-  SynchronizationTimer
-} TIMER_TYPE;
+typedef struct _VM_COUNTERS 
+{
+    SIZE_T PeakVirtualSize;
+    SIZE_T VirtualSize;
+    ULONG PageFaultCount;
+    SIZE_T PeakWorkingSetSize;
+    SIZE_T WorkingSetSize;
+    SIZE_T QuotaPeakPagedPoolUsage;
+    SIZE_T QuotaPagedPoolUsage;
+    SIZE_T QuotaPeakNonPagedPoolUsage;
+    SIZE_T QuotaNonPagedPoolUsage;
+    SIZE_T PagefileUsage;
+    SIZE_T PeakPagefileUsage;
+} VM_COUNTERS, *PVM_COUNTERS;
 
-typedef enum _KEY_INFORMATION_CLASS {
-  KeyBasicInformation,
-  KeyNodeInformation,
-  KeyFullInformation,
-  KeyNameInformation,
-  KeyCachedInformation,
-  KeyFlagsInformation
-} KEY_INFORMATION_CLASS;
+typedef struct _VM_COUNTERS_EX 
+{
+    SIZE_T PeakVirtualSize;
+    SIZE_T VirtualSize;
+    ULONG PageFaultCount;
+    SIZE_T PeakWorkingSetSize;
+    SIZE_T WorkingSetSize;
+    SIZE_T QuotaPeakPagedPoolUsage;
+    SIZE_T QuotaPagedPoolUsage;
+    SIZE_T QuotaPeakNonPagedPoolUsage;
+    SIZE_T QuotaNonPagedPoolUsage;
+    SIZE_T PagefileUsage;
+    SIZE_T PeakPagefileUsage;
+    SIZE_T PrivateUsage;
+} VM_COUNTERS_EX, *PVM_COUNTERS_EX;
 
-typedef enum _KEY_VALUE_INFORMATION_CLASS {
-  KeyValueBasicInformation,
-  KeyValueFullInformation,
-  KeyValuePartialInformation,
-  KeyValueFullInformationAlign64,
-  KeyValuePartialInformationAlign64
-} KEY_VALUE_INFORMATION_CLASS;
+/**** Information Types ****/
 
-typedef enum _KEY_SET_INFORMATION_CLASS {
-    KeyWriteTimeInformation,
-    KeyUserFlagsInformation,
-    MaxKeySetInfoClass
-} KEY_SET_INFORMATION_CLASS;
-
-typedef struct _KEY_WRITE_TIME_INFORMATION {
+/*
+ * Registry Key Set
+ */
+ 
+/* Class 0 */
+typedef struct _KEY_WRITE_TIME_INFORMATION
+{
     LARGE_INTEGER LastWriteTime;
 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
 
-typedef struct _KEY_USER_FLAGS_INFORMATION {
+/* Class 1 */
+typedef struct _KEY_USER_FLAGS_INFORMATION 
+{
     ULONG   UserFlags;
 } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
 
-typedef struct _IO_STATUS_BLOCK {
-  _ANONYMOUS_UNION union {
-    NTSTATUS  Status;
-    PVOID  Pointer;
-  } DUMMYUNIONNAME;
-  ULONG_PTR  Information;
-} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
-
-typedef VOID NTAPI
-(*PIO_APC_ROUTINE)(
-  IN PVOID ApcContext,
-  IN PIO_STATUS_BLOCK IoStatusBlock,
-  IN ULONG Reserved);
-
-typedef struct _FILE_BASIC_INFORMATION {
-  LARGE_INTEGER  CreationTime;
-  LARGE_INTEGER  LastAccessTime;
-  LARGE_INTEGER  LastWriteTime;
-  LARGE_INTEGER  ChangeTime;
-  ULONG  FileAttributes;
+/* 
+ * File
+ */
+ 
+/* Class 1 */
+typedef struct _FILE_BASIC_INFORMATION 
+{
+    LARGE_INTEGER CreationTime;
+    LARGE_INTEGER LastAccessTime;
+    LARGE_INTEGER LastWriteTime;
+    LARGE_INTEGER ChangeTime;
+    ULONG FileAttributes;
 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
 
-typedef struct _FILE_NETWORK_OPEN_INFORMATION {                 
-  LARGE_INTEGER  CreationTime;                                 
-  LARGE_INTEGER  LastAccessTime;                               
-  LARGE_INTEGER  LastWriteTime;                                
-  LARGE_INTEGER  ChangeTime;                                   
-  LARGE_INTEGER  AllocationSize;                               
-  LARGE_INTEGER  EndOfFile;                                    
-  ULONG  FileAttributes;                                       
+/* Class 2 */
+typedef struct _FILE_NETWORK_OPEN_INFORMATION 
+{
+    LARGE_INTEGER CreationTime;                                 
+    LARGE_INTEGER LastAccessTime;                               
+    LARGE_INTEGER LastWriteTime;                                
+    LARGE_INTEGER ChangeTime;                                   
+    LARGE_INTEGER AllocationSize;                               
+    LARGE_INTEGER EndOfFile;                                    
+    ULONG FileAttributes;                                       
 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;   
 
-typedef enum _PROCESSINFOCLASS {
-  ProcessBasicInformation,
-  ProcessQuotaLimits,
-  ProcessIoCounters,
-  ProcessVmCounters,
-  ProcessTimes,
-  ProcessBasePriority,
-  ProcessRaisePriority,
-  ProcessDebugPort,
-  ProcessExceptionPort,
-  ProcessAccessToken,
-  ProcessLdtInformation,
-  ProcessLdtSize,
-  ProcessDefaultHardErrorMode,
[truncated at 1000 lines; 709 more skipped]