1 /*++ NDK Version: 0098 2 3 Copyright (c) Alex Ionescu. All rights reserved. 4 5 Header Name: 6 7 ifssupp.h 8 9 Abstract: 10 11 NDK Support for usage without the IFS. Will be deprecated at WDK Release. 12 13 Author: 14 15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006 16 17 --*/ 18 #ifndef _NTIFS_ 19 #ifndef NTOS_MODE_USER 20 #define _NTIFS_ 21 22 #define TOKEN_SOURCE_LENGTH 8 23 24 #ifndef _NTIFS_ 25 typedef enum _TOKEN_TYPE 26 { 27 TokenPrimary = 1, 28 TokenImpersonation 29 } TOKEN_TYPE, *PTOKEN_TYPE; 30 31 typedef NTSTATUS 32 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)( 33 _In_ PVOID Base, 34 _Inout_ PVOID *CommitAddress, 35 _Inout_ PSIZE_T CommitSize 36 ); 37 38 typedef struct _RTL_HEAP_PARAMETERS 39 { 40 ULONG Length; 41 SIZE_T SegmentReserve; 42 SIZE_T SegmentCommit; 43 SIZE_T DeCommitFreeBlockThreshold; 44 SIZE_T DeCommitTotalFreeThreshold; 45 SIZE_T MaximumAllocationSize; 46 SIZE_T VirtualMemoryThreshold; 47 SIZE_T InitialCommit; 48 SIZE_T InitialReserve; 49 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine; 50 SIZE_T Reserved[2]; 51 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS; 52 53 typedef PVOID PFS_FILTER_CALLBACKS; 54 typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; 55 56 typedef struct _RTL_SPLAY_LINKS 57 { 58 struct _RTL_SPLAY_LINKS *Parent; 59 struct _RTL_SPLAY_LINKS *LeftChild; 60 struct _RTL_SPLAY_LINKS *RightChild; 61 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS; 62 63 typedef struct _RTL_GENERIC_TABLE RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE; 64 typedef ULONG TABLE_SEARCH_RESULT; 65 66 #if defined(USE_LPC6432) 67 #define LPC_CLIENT_ID CLIENT_ID64 68 #define LPC_SIZE_T ULONGLONG 69 #define LPC_PVOID ULONGLONG 70 #define LPC_HANDLE ULONGLONG 71 #else 72 #define LPC_CLIENT_ID CLIENT_ID 73 #define LPC_SIZE_T SIZE_T 74 #define LPC_PVOID PVOID 75 #define LPC_HANDLE HANDLE 76 #endif 77 78 typedef struct _PORT_MESSAGE 79 { 80 union 81 { 82 struct 83 { 84 CSHORT DataLength; 85 CSHORT TotalLength; 86 } s1; 87 ULONG Length; 88 } u1; 89 union 90 { 91 struct 92 { 93 CSHORT Type; 94 CSHORT DataInfoOffset; 95 } s2; 96 ULONG ZeroInit; 97 } u2; 98 union 99 { 100 LPC_CLIENT_ID ClientId; 101 double DoNotUseThisField; 102 }; 103 ULONG MessageId; 104 union 105 { 106 LPC_SIZE_T ClientViewSize; 107 ULONG CallbackId; 108 }; 109 } PORT_MESSAGE, *PPORT_MESSAGE; 110 111 typedef struct _PORT_VIEW 112 { 113 ULONG Length; 114 LPC_HANDLE SectionHandle; 115 ULONG SectionOffset; 116 LPC_SIZE_T ViewSize; 117 LPC_PVOID ViewBase; 118 LPC_PVOID ViewRemoteBase; 119 } PORT_VIEW, *PPORT_VIEW; 120 121 typedef struct _REMOTE_PORT_VIEW 122 { 123 ULONG Length; 124 LPC_SIZE_T ViewSize; 125 LPC_PVOID ViewBase; 126 } REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW; 127 128 typedef struct _KAPC_STATE 129 { 130 LIST_ENTRY ApcListHead[2]; 131 struct _KPROCESS *Process; 132 BOOLEAN KernelApcInProgress; 133 BOOLEAN KernelApcPending; 134 BOOLEAN UserApcPending; 135 } KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE; 136 137 typedef struct _KQUEUE 138 { 139 DISPATCHER_HEADER Header; 140 LIST_ENTRY EntryListHead; 141 ULONG CurrentCount; 142 ULONG MaximumCount; 143 LIST_ENTRY ThreadListHead; 144 } KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE; 145 146 typedef struct _ACE_HEADER 147 { 148 UCHAR AceType; 149 UCHAR AceFlags; 150 USHORT AceSize; 151 } ACE_HEADER, *PACE_HEADER; 152 153 typedef enum _RTL_GENERIC_COMPARE_RESULTS 154 { 155 GenericLessThan, 156 GenericGreaterThan, 157 GenericEqual 158 } RTL_GENERIC_COMPARE_RESULTS; 159 160 typedef struct _SID_IDENTIFIER_AUTHORITY 161 { 162 UCHAR Value[6]; 163 } SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY; 164 165 typedef struct _SID_AND_ATTRIBUTES 166 { 167 PSID Sid; 168 ULONG Attributes; 169 } SID_AND_ATTRIBUTES, * PSID_AND_ATTRIBUTES; 170 171 typedef struct _TOKEN_SOURCE 172 { 173 CHAR SourceName[TOKEN_SOURCE_LENGTH]; 174 LUID SourceIdentifier; 175 } TOKEN_SOURCE, *PTOKEN_SOURCE; 176 177 typedef struct _TOKEN_CONTROL 178 { 179 LUID TokenId; 180 LUID AuthenticationId; 181 LUID ModifiedId; 182 TOKEN_SOURCE TokenSource; 183 } TOKEN_CONTROL, *PTOKEN_CONTROL; 184 185 typedef struct _SECURITY_CLIENT_CONTEXT 186 { 187 SECURITY_QUALITY_OF_SERVICE SecurityQos; 188 PACCESS_TOKEN ClientToken; 189 BOOLEAN DirectlyAccessClientToken; 190 BOOLEAN DirectAccessEffectiveOnly; 191 BOOLEAN ServerIsRemote; 192 TOKEN_CONTROL ClientTokenControl; 193 } SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; 194 195 typedef struct _SECURITY_DESCRIPTOR_RELATIVE 196 { 197 UCHAR Revision; 198 UCHAR Sbz1; 199 SECURITY_DESCRIPTOR_CONTROL Control; 200 ULONG Owner; 201 ULONG Group; 202 ULONG Sacl; 203 ULONG Dacl; 204 } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; 205 206 typedef struct _TOKEN_GROUPS 207 { 208 ULONG GroupCount; 209 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; 210 } TOKEN_GROUPS, *PTOKEN_GROUPS; 211 212 typedef struct _TOKEN_PRIVILEGES 213 { 214 ULONG PrivilegeCount; 215 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; 216 } TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; 217 218 typedef struct _TOKEN_USER 219 { 220 SID_AND_ATTRIBUTES User; 221 } TOKEN_USER, *PTOKEN_USER; 222 223 typedef enum _TOKEN_INFORMATION_CLASS 224 { 225 TokenUser = 1, 226 TokenGroups, 227 TokenPrivileges, 228 TokenOwner, 229 TokenPrimaryGroup, 230 TokenDefaultDacl, 231 TokenSource, 232 TokenType, 233 TokenImpersonationLevel, 234 TokenStatistics, 235 TokenRestrictedSids, 236 TokenSessionId, 237 TokenGroupsAndPrivileges, 238 TokenSessionReference, 239 TokenSandBoxInert, 240 TokenAuditPolicy, 241 TokenOrigin, 242 TokenElevationType, 243 TokenLinkedToken, 244 TokenElevation, 245 TokenIsRestricted, 246 TokenAccessInformation, 247 TokenVirtualization, 248 TokenIntegrityLevel, 249 TokenIntegrityLevelDesktop, 250 TokenMandatoryPolicy, 251 MaxTokenInfoClass 252 } TOKEN_INFORMATION_CLASS, *PTOKEN_INFORMATION_CLASS; 253 254 typedef struct _TOKEN_OWNER 255 { 256 PSID Owner; 257 } TOKEN_OWNER, *PTOKEN_OWNER; 258 259 typedef struct _TOKEN_PRIMARY_GROUP 260 { 261 PSID PrimaryGroup; 262 } TOKEN_PRIMARY_GROUP, *PTOKEN_PRIMARY_GROUP; 263 264 typedef struct _TOKEN_DEFAULT_DACL 265 { 266 PACL DefaultDacl; 267 } TOKEN_DEFAULT_DACL, *PTOKEN_DEFAULT_DACL; 268 269 // 270 // Heap flags 271 // 272 #define HEAP_NO_SERIALIZE 0x00000001 273 #define HEAP_GROWABLE 0x00000002 274 #define HEAP_GENERATE_EXCEPTIONS 0x00000004 275 #define HEAP_ZERO_MEMORY 0x00000008 276 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 277 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020 278 #define HEAP_FREE_CHECKING_ENABLED 0x00000040 279 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080 280 281 #define HEAP_CREATE_ALIGN_16 0x00010000 282 #define HEAP_CREATE_ENABLE_TRACING 0x00020000 283 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000 284 285 #endif 286 287 #endif // !NTOS_MODE_USER 288 #endif // _NTIFS_ 289