605a4e09e1641fd27a2ea3fc82c2fecdc1641ed6
[reactos.git] / reactos / include / psdk / winternl.h
1 /*
2 * Internal NT APIs and data structures
3 *
4 * Copyright (C) the Wine project
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef __WINE_WINTERNL_H
22 #define __WINE_WINTERNL_H
23
24 #include <windef.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* defined(__cplusplus) */
29
30
31 /**********************************************************************
32 * Fundamental types and data structures
33 */
34
35 typedef LONG NTSTATUS, *PNTSTATUS;
36
37 typedef CONST char *PCSZ;
38
39 typedef short CSHORT;
40 typedef CSHORT *PCSHORT;
41
42 typedef struct _STRING {
43 USHORT Length;
44 USHORT MaximumLength;
45 PCHAR Buffer;
46 } STRING, *PSTRING;
47
48 typedef STRING ANSI_STRING;
49 typedef PSTRING PANSI_STRING;
50 typedef const STRING *PCANSI_STRING;
51
52 typedef STRING OEM_STRING;
53 typedef PSTRING POEM_STRING;
54 typedef const STRING *PCOEM_STRING;
55
56 typedef struct _UNICODE_STRING {
57 USHORT Length; /* bytes */
58 USHORT MaximumLength; /* bytes */
59 PWSTR Buffer;
60 } UNICODE_STRING, *PUNICODE_STRING;
61
62 typedef const UNICODE_STRING *PCUNICODE_STRING;
63
64 #ifndef _FILETIME_
65 #define _FILETIME_
66 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
67 typedef struct _FILETIME
68 {
69 #ifdef WORDS_BIGENDIAN
70 DWORD dwHighDateTime;
71 DWORD dwLowDateTime;
72 #else
73 DWORD dwLowDateTime;
74 DWORD dwHighDateTime;
75 #endif
76 } FILETIME, *PFILETIME, *LPFILETIME;
77 #endif /* _FILETIME_ */
78
79 /*
80 * RTL_SYSTEM_TIME and RTL_TIME_ZONE_INFORMATION are the same as
81 * the SYSTEMTIME and TIME_ZONE_INFORMATION structures defined
82 * in winbase.h, however we need to define them seperately so
83 * winternl.h doesn't depend on winbase.h. They are used by
84 * RtlQueryTimeZoneInformation and RtlSetTimeZoneInformation.
85 * The names are guessed; if anybody knows the real names, let me know.
86 */
87 typedef struct _RTL_SYSTEM_TIME {
88 WORD wYear;
89 WORD wMonth;
90 WORD wDayOfWeek;
91 WORD wDay;
92 WORD wHour;
93 WORD wMinute;
94 WORD wSecond;
95 WORD wMilliseconds;
96 } RTL_SYSTEM_TIME, *PRTL_SYSTEM_TIME;
97
98 typedef struct _RTL_TIME_ZONE_INFORMATION {
99 LONG Bias;
100 WCHAR StandardName[32];
101 RTL_SYSTEM_TIME StandardDate;
102 LONG StandardBias;
103 WCHAR DaylightName[32];
104 RTL_SYSTEM_TIME DaylightDate;
105 LONG DaylightBias;
106 } RTL_TIME_ZONE_INFORMATION, *PRTL_TIME_ZONE_INFORMATION;
107
108 typedef struct _CLIENT_ID
109 {
110 HANDLE UniqueProcess;
111 HANDLE UniqueThread;
112 } CLIENT_ID, *PCLIENT_ID;
113
114 typedef struct _CURDIR
115 {
116 UNICODE_STRING DosPath;
117 PVOID Handle;
118 } CURDIR, *PCURDIR;
119
120 typedef struct RTL_DRIVE_LETTER_CURDIR
121 {
122 USHORT Flags;
123 USHORT Length;
124 ULONG TimeStamp;
125 UNICODE_STRING DosPath;
126 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
127
128 typedef struct tagRTL_BITMAP {
129 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
130 PULONG Buffer; /* Bitmap data, assumed sized to a DWORD boundary */
131 } RTL_BITMAP, *PRTL_BITMAP;
132
133 typedef const RTL_BITMAP *PCRTL_BITMAP;
134
135 typedef struct tagRTL_BITMAP_RUN {
136 ULONG StartingIndex; /* Bit position at which run starts */
137 ULONG NumberOfBits; /* Size of the run in bits */
138 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
139
140 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
141
142 typedef struct _RTL_USER_PROCESS_PARAMETERS
143 {
144 ULONG AllocationSize;
145 ULONG Size;
146 ULONG Flags;
147 ULONG DebugFlags;
148 HANDLE ConsoleHandle;
149 ULONG ConsoleFlags;
150 HANDLE hStdInput;
151 HANDLE hStdOutput;
152 HANDLE hStdError;
153 CURDIR CurrentDirectory;
154 UNICODE_STRING DllPath;
155 UNICODE_STRING ImagePathName;
156 UNICODE_STRING CommandLine;
157 PWSTR Environment;
158 ULONG dwX;
159 ULONG dwY;
160 ULONG dwXSize;
161 ULONG dwYSize;
162 ULONG dwXCountChars;
163 ULONG dwYCountChars;
164 ULONG dwFillAttribute;
165 ULONG dwFlags;
166 ULONG wShowWindow;
167 UNICODE_STRING WindowTitle;
168 UNICODE_STRING Desktop;
169 UNICODE_STRING ShellInfo;
170 UNICODE_STRING RuntimeInfo;
171 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
172 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
173
174 /* value for Flags field (FIXME: not the correct name) */
175 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
176
177 typedef struct _PEB_LDR_DATA
178 {
179 ULONG Length;
180 BOOLEAN Initialized;
181 PVOID SsHandle;
182 LIST_ENTRY InLoadOrderModuleList;
183 LIST_ENTRY InMemoryOrderModuleList;
184 LIST_ENTRY InInitializationOrderModuleList;
185 } PEB_LDR_DATA, *PPEB_LDR_DATA;
186
187 typedef struct _GDI_TEB_BATCH
188 {
189 ULONG Offset;
190 HANDLE HDC;
191 ULONG Buffer[0x136];
192 } GDI_TEB_BATCH;
193
194 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
195 {
196 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
197 struct _ACTIVATION_CONTEXT *ActivationContext;
198 ULONG Flags;
199 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
200
201 typedef struct _ACTIVATION_CONTEXT_STACK
202 {
203 ULONG Flags;
204 ULONG NextCookieSequenceNumber;
205 RTL_ACTIVATION_CONTEXT_STACK_FRAME *ActiveFrame;
206 LIST_ENTRY FrameListCache;
207 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
208
209 /***********************************************************************
210 * PEB data structure
211 */
212 typedef struct _PEB
213 {
214 BOOLEAN InheritedAddressSpace; /* 00 */
215 BOOLEAN ReadImageFileExecOptions; /* 01 */
216 BOOLEAN BeingDebugged; /* 02 */
217 BOOLEAN SpareBool; /* 03 */
218 HANDLE Mutant; /* 04 */
219 HMODULE ImageBaseAddress; /* 08 */
220 PPEB_LDR_DATA LdrData; /* 0c */
221 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10 */
222 PVOID SubSystemData; /* 14 */
223 HANDLE ProcessHeap; /* 18 */
224 PRTL_CRITICAL_SECTION FastPebLock; /* 1c */
225 PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 20 */
226 PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 24 */
227 ULONG EnvironmentUpdateCount; /* 28 */
228 PVOID KernelCallbackTable; /* 2c */
229 PVOID EventLogSection; /* 30 */
230 PVOID EventLog; /* 34 */
231 PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 38 */
232 ULONG TlsExpansionCounter; /* 3c */
233 PRTL_BITMAP TlsBitmap; /* 40 */
234 ULONG TlsBitmapBits[2]; /* 44 */
235 PVOID ReadOnlySharedMemoryBase; /* 4c */
236 PVOID ReadOnlySharedMemoryHeap; /* 50 */
237 PVOID *ReadOnlyStaticServerData; /* 54 */
238 PVOID AnsiCodePageData; /* 58 */
239 PVOID OemCodePageData; /* 5c */
240 PVOID UnicodeCaseTableData; /* 60 */
241 ULONG NumberOfProcessors; /* 64 */
242 ULONG NtGlobalFlag; /* 68 */
243 BYTE Spare2[4]; /* 6c */
244 LARGE_INTEGER CriticalSectionTimeout; /* 70 */
245 ULONG HeapSegmentReserve; /* 78 */
246 ULONG HeapSegmentCommit; /* 7c */
247 ULONG HeapDeCommitTotalFreeThreshold; /* 80 */
248 ULONG HeapDeCommitFreeBlockThreshold; /* 84 */
249 ULONG NumberOfHeaps; /* 88 */
250 ULONG MaximumNumberOfHeaps; /* 8c */
251 PVOID *ProcessHeaps; /* 90 */
252 PVOID GdiSharedHandleTable; /* 94 */
253 PVOID ProcessStarterHelper; /* 98 */
254 PVOID GdiDCAttributeList; /* 9c */
255 PVOID LoaderLock; /* a0 */
256 ULONG OSMajorVersion; /* a4 */
257 ULONG OSMinorVersion; /* a8 */
258 ULONG OSBuildNumber; /* ac */
259 ULONG OSPlatformId; /* b0 */
260 ULONG ImageSubSystem; /* b4 */
261 ULONG ImageSubSystemMajorVersion; /* b8 */
262 ULONG ImageSubSystemMinorVersion; /* bc */
263 ULONG ImageProcessAffinityMask; /* c0 */
264 ULONG GdiHandleBuffer[34]; /* c4 */
265 ULONG PostProcessInitRoutine; /* 14c */
266 PRTL_BITMAP TlsExpansionBitmap; /* 150 */
267 ULONG TlsExpansionBitmapBits[32]; /* 154 */
268 ULONG SessionId; /* 1d4 */
269 } PEB, *PPEB;
270
271
272 /***********************************************************************
273 * TEB data structure
274 */
275 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
276 # ifndef WINE_TEB_DEFINED
277 # define WINE_TEB_DEFINED
278 typedef struct _TEB
279 {
280 NT_TIB Tib; /* 000 */
281 PVOID EnvironmentPointer; /* 01c */
282 CLIENT_ID ClientId; /* 020 */
283 PVOID ActiveRpcHandle; /* 028 */
284 PVOID ThreadLocalStoragePointer; /* 02c */
285 PPEB Peb; /* 030 */
286 ULONG LastErrorValue; /* 034 */
287 ULONG CountOfOwnedCriticalSections;/* 038 */
288 PVOID CsrClientThread; /* 03c */
289 PVOID Win32ThreadInfo; /* 040 */
290 ULONG Win32ClientInfo[31]; /* 044 used for user32 private data in Wine */
291 PVOID WOW32Reserved; /* 0c0 */
292 ULONG CurrentLocale; /* 0c4 */
293 ULONG FpSoftwareStatusRegister; /* 0c8 */
294 PVOID SystemReserved1[54]; /* 0cc used for kernel32 private data in Wine */
295 PVOID Spare1; /* 1a4 */
296 LONG ExceptionCode; /* 1a8 */
297 PACTIVATION_CONTEXT_STACK ActivationContextStackPointer; /* 1a8/02c8 */
298 BYTE SpareBytes1[36]; /* 1ac */
299 PVOID SystemReserved2[10]; /* 1d4 used for ntdll private data in Wine */
300 GDI_TEB_BATCH GdiTebBatch; /* 1fc */
301 ULONG gdiRgn; /* 6dc */
302 ULONG gdiPen; /* 6e0 */
303 ULONG gdiBrush; /* 6e4 */
304 CLIENT_ID RealClientId; /* 6e8 */
305 HANDLE GdiCachedProcessHandle; /* 6f0 */
306 ULONG GdiClientPID; /* 6f4 */
307 ULONG GdiClientTID; /* 6f8 */
308 PVOID GdiThreadLocaleInfo; /* 6fc */
309 PVOID UserReserved[5]; /* 700 */
310 PVOID glDispatchTable[280]; /* 714 */
311 ULONG glReserved1[26]; /* b74 */
312 PVOID glReserved2; /* bdc */
313 PVOID glSectionInfo; /* be0 */
314 PVOID glSection; /* be4 */
315 PVOID glTable; /* be8 */
316 PVOID glCurrentRC; /* bec */
317 PVOID glContext; /* bf0 */
318 ULONG LastStatusValue; /* bf4 */
319 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
320 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
321 PVOID DeallocationStack; /* e0c */
322 PVOID TlsSlots[64]; /* e10 */
323 LIST_ENTRY TlsLinks; /* f10 */
324 PVOID Vdm; /* f18 */
325 PVOID ReservedForNtRpc; /* f1c */
326 PVOID DbgSsReserved[2]; /* f20 */
327 ULONG HardErrorDisabled; /* f28 */
328 PVOID Instrumentation[16]; /* f2c */
329 PVOID WinSockData; /* f6c */
330 ULONG GdiBatchCount; /* f70 */
331 ULONG Spare2; /* f74 */
332 ULONG Spare3; /* f78 */
333 ULONG Spare4; /* f7c */
334 PVOID ReservedForOle; /* f80 */
335 ULONG WaitingOnLoaderLock; /* f84 */
336 PVOID Reserved5[3]; /* f88 */
337 PVOID *TlsExpansionSlots; /* f94 */
338 } TEB, *PTEB;
339 # endif /* WINE_TEB_DEFINED */
340 #endif /* WINE_NO_TEB */
341
342 /***********************************************************************
343 * Enums
344 */
345
346 typedef enum _FILE_INFORMATION_CLASS {
347 FileDirectoryInformation = 1,
348 FileFullDirectoryInformation,
349 FileBothDirectoryInformation,
350 FileBasicInformation,
351 FileStandardInformation,
352 FileInternalInformation,
353 FileEaInformation,
354 FileAccessInformation,
355 FileNameInformation,
356 FileRenameInformation,
357 FileLinkInformation,
358 FileNamesInformation,
359 FileDispositionInformation,
360 FilePositionInformation,
361 FileFullEaInformation,
362 FileModeInformation,
363 FileAlignmentInformation,
364 FileAllInformation,
365 FileAllocationInformation,
366 FileEndOfFileInformation,
367 FileAlternateNameInformation,
368 FileStreamInformation,
369 FilePipeInformation,
370 FilePipeLocalInformation,
371 FilePipeRemoteInformation,
372 FileMailslotQueryInformation,
373 FileMailslotSetInformation,
374 FileCompressionInformation,
375 FileObjectIdInformation,
376 FileCompletionInformation,
377 FileMoveClusterInformation,
378 FileQuotaInformation,
379 FileReparsePointInformation,
380 FileNetworkOpenInformation,
381 FileAttributeTagInformation,
382 FileTrackingInformation,
383 FileIdBothDirectoryInformation,
384 FileIdFullDirectoryInformation,
385 FileValidDataLengthInformation,
386 FileShortNameInformation = 40,
387 /* 41, 42, 43 undocumented */
388 FileSfioReserveInformation = 44,
389 FileSfioVolumeInformation = 45,
390 FileHardLinkInformation = 46,
391 /* 47 undocumented */
392 FileNormalizedNameInformation = 48,
393 /* 49 undocumented */
394 FileIdGlobalTxDirectoryInformation = 50,
395 /* 51, 52, 53 undocumented */
396 FileStandardLinkInformation = 54,
397 FileMaximumInformation
398 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
399
400 typedef struct _FILE_DIRECTORY_INFORMATION {
401 ULONG NextEntryOffset;
402 ULONG FileIndex;
403 LARGE_INTEGER CreationTime;
404 LARGE_INTEGER LastAccessTime;
405 LARGE_INTEGER LastWriteTime;
406 LARGE_INTEGER ChangeTime;
407 LARGE_INTEGER EndOfFile;
408 LARGE_INTEGER AllocationSize;
409 ULONG FileAttributes;
410 ULONG FileNameLength;
411 WCHAR FileName[ANYSIZE_ARRAY];
412 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
413
414 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
415 ULONG NextEntryOffset;
416 ULONG FileIndex;
417 LARGE_INTEGER CreationTime;
418 LARGE_INTEGER LastAccessTime;
419 LARGE_INTEGER LastWriteTime;
420 LARGE_INTEGER ChangeTime;
421 LARGE_INTEGER EndOfFile;
422 LARGE_INTEGER AllocationSize;
423 ULONG FileAttributes;
424 ULONG FileNameLength;
425 ULONG EaSize;
426 WCHAR FileName[ANYSIZE_ARRAY];
427 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
428 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
429
430 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
431 ULONG NextEntryOffset;
432 ULONG FileIndex;
433 LARGE_INTEGER CreationTime;
434 LARGE_INTEGER LastAccessTime;
435 LARGE_INTEGER LastWriteTime;
436 LARGE_INTEGER ChangeTime;
437 LARGE_INTEGER EndOfFile;
438 LARGE_INTEGER AllocationSize;
439 ULONG FileAttributes;
440 ULONG FileNameLength;
441 ULONG EaSize;
442 LARGE_INTEGER FileId;
443 WCHAR FileName[ANYSIZE_ARRAY];
444 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
445
446 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
447 ULONG NextEntryOffset;
448 ULONG FileIndex;
449 LARGE_INTEGER CreationTime;
450 LARGE_INTEGER LastAccessTime;
451 LARGE_INTEGER LastWriteTime;
452 LARGE_INTEGER ChangeTime;
453 LARGE_INTEGER EndOfFile;
454 LARGE_INTEGER AllocationSize;
455 ULONG FileAttributes;
456 ULONG FileNameLength;
457 ULONG EaSize;
458 CHAR ShortNameLength;
459 WCHAR ShortName[12];
460 WCHAR FileName[ANYSIZE_ARRAY];
461 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
462 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
463
464 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
465 ULONG NextEntryOffset;
466 ULONG FileIndex;
467 LARGE_INTEGER CreationTime;
468 LARGE_INTEGER LastAccessTime;
469 LARGE_INTEGER LastWriteTime;
470 LARGE_INTEGER ChangeTime;
471 LARGE_INTEGER EndOfFile;
472 LARGE_INTEGER AllocationSize;
473 ULONG FileAttributes;
474 ULONG FileNameLength;
475 ULONG EaSize;
476 CHAR ShortNameLength;
477 WCHAR ShortName[12];
478 LARGE_INTEGER FileId;
479 WCHAR FileName[ANYSIZE_ARRAY];
480 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
481
482 typedef struct _FILE_BASIC_INFORMATION {
483 LARGE_INTEGER CreationTime;
484 LARGE_INTEGER LastAccessTime;
485 LARGE_INTEGER LastWriteTime;
486 LARGE_INTEGER ChangeTime;
487 ULONG FileAttributes;
488 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
489
490 typedef struct _FILE_STANDARD_INFORMATION {
491 LARGE_INTEGER AllocationSize;
492 LARGE_INTEGER EndOfFile;
493 ULONG NumberOfLinks;
494 BOOLEAN DeletePending;
495 BOOLEAN Directory;
496 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
497
498 typedef struct _FILE_INTERNAL_INFORMATION {
499 LARGE_INTEGER IndexNumber;
500 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
501
502 typedef struct _FILE_EA_INFORMATION {
503 ULONG EaSize;
504 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
505
506 typedef struct _FILE_ACCESS_INFORMATION {
507 ACCESS_MASK AccessFlags;
508 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
509
510 typedef struct _FILE_NAME_INFORMATION {
511 ULONG FileNameLength;
512 WCHAR FileName[1];
513 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
514
515 typedef struct _FILE_RENAME_INFORMATION {
516 BOOLEAN Replace;
517 HANDLE RootDir;
518 ULONG FileNameLength;
519 WCHAR FileName[1];
520 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
521
522 typedef struct _FILE_NAMES_INFORMATION {
523 ULONG NextEntryOffset;
524 ULONG FileIndex;
525 ULONG FileNameLength;
526 WCHAR FileName[1];
527 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
528
529 typedef struct _FILE_DISPOSITION_INFORMATION {
530 BOOLEAN DoDeleteFile;
531 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
532
533 typedef struct _FILE_POSITION_INFORMATION {
534 LARGE_INTEGER CurrentByteOffset;
535 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
536
537 typedef struct _FILE_ALIGNMENT_INFORMATION {
538 ULONG AlignmentRequirement;
539 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
540
541 typedef struct _FILE_ALLOCATION_INFORMATION {
542 LARGE_INTEGER AllocationSize;
543 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
544
545 typedef struct _FILE_END_OF_FILE_INFORMATION {
546 LARGE_INTEGER EndOfFile;
547 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
548
549 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
550 LARGE_INTEGER CreationTime;
551 LARGE_INTEGER LastAccessTime;
552 LARGE_INTEGER LastWriteTime;
553 LARGE_INTEGER ChangeTime;
554 LARGE_INTEGER AllocationSize;
555 LARGE_INTEGER EndOfFile;
556 ULONG FileAttributes;
557 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
558
559 typedef struct _FILE_FULL_EA_INFORMATION {
560 ULONG NextEntryOffset;
561 UCHAR Flags;
562 UCHAR EaNameLength;
563 USHORT EaValueLength;
564 CHAR EaName[1];
565 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
566
567 typedef struct _FILE_MODE_INFORMATION {
568 ULONG Mode;
569 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
570
571 typedef struct _FILE_STREAM_INFORMATION
572 {
573 ULONG NextEntryOffset;
574 ULONG StreamNameLength;
575 LARGE_INTEGER StreamSize;
576 LARGE_INTEGER StreamAllocationSize;
577 WCHAR StreamName[1];
578 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
579
580 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
581 {
582 ULONG FileAttributes;
583 ULONG ReparseTag;
584 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
585
586 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
587 ULONG MaximumMessageSize;
588 ULONG MailslotQuota;
589 ULONG NextMessageSize;
590 ULONG MessagesAvailable;
591 LARGE_INTEGER ReadTimeout;
592 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
593
594 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
595 LARGE_INTEGER ReadTimeout;
596 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
597
598 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
599 ULONG NamedPipeType;
600 ULONG NamedPipeConfiguration;
601 ULONG MaximumInstances;
602 ULONG CurrentInstances;
603 ULONG InboundQuota;
604 ULONG ReadDataAvailable;
605 ULONG OutboundQuota;
606 ULONG WriteQuotaAvailable;
607 ULONG NamedPipeState;
608 ULONG NamedPipeEnd;
609 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
610
611 typedef struct _FILE_ALL_INFORMATION {
612 FILE_BASIC_INFORMATION BasicInformation;
613 FILE_STANDARD_INFORMATION StandardInformation;
614 FILE_INTERNAL_INFORMATION InternalInformation;
615 FILE_EA_INFORMATION EaInformation;
616 FILE_ACCESS_INFORMATION AccessInformation;
617 FILE_POSITION_INFORMATION PositionInformation;
618 FILE_MODE_INFORMATION ModeInformation;
619 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
620 FILE_NAME_INFORMATION NameInformation;
621 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
622
623 typedef enum _FSINFOCLASS {
624 FileFsVolumeInformation = 1,
625 FileFsLabelInformation,
626 FileFsSizeInformation,
627 FileFsDeviceInformation,
628 FileFsAttributeInformation,
629 FileFsControlInformation,
630 FileFsFullSizeInformation,
631 FileFsObjectIdInformation,
632 FileFsMaximumInformation
633 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
634
635 typedef enum _KEY_INFORMATION_CLASS {
636 KeyBasicInformation,
637 KeyNodeInformation,
638 KeyFullInformation
639 } KEY_INFORMATION_CLASS;
640
641 typedef enum _KEY_VALUE_INFORMATION_CLASS {
642 KeyValueBasicInformation,
643 KeyValueFullInformation,
644 KeyValuePartialInformation,
645 KeyValueFullInformationAlign64,
646 KeyValuePartialInformationAlign64
647 } KEY_VALUE_INFORMATION_CLASS;
648
649 typedef enum _OBJECT_INFORMATION_CLASS {
650 ObjectBasicInformation,
651 ObjectNameInformation,
652 ObjectTypeInformation,
653 ObjectAllInformation,
654 ObjectDataInformation
655 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
656
657 typedef enum _PROCESSINFOCLASS {
658 ProcessBasicInformation = 0,
659 ProcessQuotaLimits = 1,
660 ProcessIoCounters = 2,
661 ProcessVmCounters = 3,
662 ProcessTimes = 4,
663 ProcessBasePriority = 5,
664 ProcessRaisePriority = 6,
665 ProcessDebugPort = 7,
666 ProcessExceptionPort = 8,
667 ProcessAccessToken = 9,
668 ProcessLdtInformation = 10,
669 ProcessLdtSize = 11,
670 ProcessDefaultHardErrorMode = 12,
671 ProcessIoPortHandlers = 13,
672 ProcessPooledUsageAndLimits = 14,
673 ProcessWorkingSetWatch = 15,
674 ProcessUserModeIOPL = 16,
675 ProcessEnableAlignmentFaultFixup = 17,
676 ProcessPriorityClass = 18,
677 ProcessWx86Information = 19,
678 ProcessHandleCount = 20,
679 ProcessAffinityMask = 21,
680 ProcessPriorityBoost = 22,
681 ProcessDeviceMap = 23,
682 ProcessSessionInformation = 24,
683 ProcessForegroundInformation = 25,
684 ProcessWow64Information = 26,
685 ProcessImageFileName = 27,
686 ProcessLUIDDeviceMapsEnabled = 28,
687 ProcessBreakOnTermination = 29,
688 ProcessDebugObjectHandle = 30,
689 ProcessDebugFlags = 31,
690 ProcessHandleTracing = 32,
691 ProcessExecuteFlags = 34,
692 MaxProcessInfoClass
693 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
694
695 #define MEM_EXECUTE_OPTION_DISABLE 0x01
696 #define MEM_EXECUTE_OPTION_ENABLE 0x02
697 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
698
699 typedef enum _SECTION_INHERIT {
700 ViewShare = 1,
701 ViewUnmap = 2
702 } SECTION_INHERIT;
703
704 typedef enum _SYSTEM_INFORMATION_CLASS {
705 SystemBasicInformation = 0,
706 SystemCpuInformation = 1,
707 SystemPerformanceInformation = 2,
708 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
709 Unknown4,
710 SystemProcessInformation = 5,
711 Unknown6,
712 Unknown7,
713 SystemProcessorPerformanceInformation = 8,
714 Unknown9,
715 Unknown10,
716 SystemModuleInformation = 11,
717 Unknown12,
718 Unknown13,
719 Unknown14,
720 Unknown15,
721 SystemHandleInformation = 16,
722 Unknown17,
723 SystemPageFileInformation = 18,
724 Unknown19,
725 Unknown20,
726 SystemCacheInformation = 21,
727 Unknown22,
728 SystemInterruptInformation = 23,
729 SystemDpcBehaviourInformation = 24,
730 SystemFullMemoryInformation = 25,
731 SystemNotImplemented6 = 25,
732 SystemLoadImage = 26,
733 SystemUnloadImage = 27,
734 SystemTimeAdjustmentInformation = 28,
735 SystemTimeAdjustment = 28,
736 SystemSummaryMemoryInformation = 29,
737 SystemNotImplemented7 = 29,
738 SystemNextEventIdInformation = 30,
739 SystemNotImplemented8 = 30,
740 SystemEventIdsInformation = 31,
741 SystemCrashDumpInformation = 32,
742 SystemExceptionInformation = 33,
743 SystemCrashDumpStateInformation = 34,
744 SystemKernelDebuggerInformation = 35,
745 SystemContextSwitchInformation = 36,
746 SystemRegistryQuotaInformation = 37,
747 SystemCurrentTimeZoneInformation = 44,
748 SystemTimeZoneInformation = 44,
749 SystemLookasideInformation = 45,
750 SystemSetTimeSlipEvent = 46,
751 SystemCreateSession = 47,
752 SystemDeleteSession = 48,
753 SystemInvalidInfoClass4 = 49,
754 SystemRangeStartInformation = 50,
755 SystemVerifierInformation = 51,
756 SystemAddVerifier = 52,
757 SystemSessionProcessesInformation = 53,
758 Unknown54,
759 Unknown55,
760 Unknown56,
761 Unknown57,
762 Unknown58,
763 Unknown59,
764 Unknown60,
765 Unknown61,
766 Unknown62,
767 Unknown63,
768 Unknown64,
769 Unknown65,
770 Unknown66,
771 Unknown67,
772 Unknown68,
773 Unknown69,
774 Unknown70,
775 Unknown71,
776 Unknown72,
777 SystemLogicalProcessorInformation = 73,
778 SystemInformationClassMax
779 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
780
781 typedef enum _TIMER_TYPE {
782 NotificationTimer,
783 SynchronizationTimer
784 } TIMER_TYPE;
785
786 typedef enum _THREADINFOCLASS {
787 ThreadBasicInformation,
788 ThreadTimes,
789 ThreadPriority,
790 ThreadBasePriority,
791 ThreadAffinityMask,
792 ThreadImpersonationToken,
793 ThreadDescriptorTableEntry,
794 ThreadEnableAlignmentFaultFixup,
795 ThreadEventPair_Reusable,
796 ThreadQuerySetWin32StartAddress,
797 ThreadZeroTlsCell,
798 ThreadPerformanceCount,
799 ThreadAmILastThread,
800 ThreadIdealProcessor,
801 ThreadPriorityBoost,
802 ThreadSetTlsArrayAddress,
803 ThreadIsIoPending,
804 MaxThreadInfoClass
805 } THREADINFOCLASS;
806
807 typedef struct _THREAD_BASIC_INFORMATION
808 {
809 NTSTATUS ExitStatus;
810 PVOID TebBaseAddress;
811 CLIENT_ID ClientId;
812 ULONG_PTR AffinityMask;
813 LONG Priority;
814 LONG BasePriority;
815 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
816
817 typedef struct _KERNEL_USER_TIMES {
818 LARGE_INTEGER CreateTime;
819 LARGE_INTEGER ExitTime;
820 LARGE_INTEGER KernelTime;
821 LARGE_INTEGER UserTime;
822 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
823
824 typedef enum _WINSTATIONINFOCLASS {
825 WinStationInformation = 8
826 } WINSTATIONINFOCLASS;
827
828 typedef enum _MEMORY_INFORMATION_CLASS {
829 MemoryBasicInformation,
830 MemoryWorkingSetList,
831 MemorySectionName,
832 MemoryBasicVlmInformation
833 } MEMORY_INFORMATION_CLASS;
834
835 typedef enum _MUTANT_INFORMATION_CLASS
836 {
837 MutantBasicInformation
838 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
839
840 typedef struct _MUTANT_BASIC_INFORMATION {
841 LONG CurrentCount;
842 BOOLEAN OwnedByCaller;
843 BOOLEAN AbandonedState;
844 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
845
846 typedef enum _TIMER_INFORMATION_CLASS
847 {
848 TimerBasicInformation = 0
849 } TIMER_INFORMATION_CLASS;
850
851 typedef struct _TIMER_BASIC_INFORMATION
852 {
853 LARGE_INTEGER RemainingTime;
854 BOOLEAN TimerState;
855 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
856
857
858 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
859 typedef enum
860 {
861 INVALID_PATH = 0,
862 UNC_PATH, /* "//foo" */
863 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
864 RELATIVE_DRIVE_PATH, /* "c:foo" */
865 ABSOLUTE_PATH, /* "/foo" */
866 RELATIVE_PATH, /* "foo" */
867 DEVICE_PATH, /* "//./foo" */
868 UNC_DOT_PATH /* "//." */
869 } DOS_PATHNAME_TYPE;
870
871 /***********************************************************************
872 * IA64 specific types and data structures
873 */
874
875 #ifdef __ia64__
876
877 typedef struct _FRAME_POINTERS {
878 ULONGLONG MemoryStackFp;
879 ULONGLONG BackingStoreFp;
880 } FRAME_POINTERS, *PFRAME_POINTERS;
881
882 #define UNWIND_HISTORY_TABLE_SIZE 12
883
884 typedef struct _RUNTIME_FUNCTION {
885 ULONG BeginAddress;
886 ULONG EndAddress;
887 ULONG UnwindInfoAddress;
888 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
889
890 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
891 ULONG64 ImageBase;
892 ULONG64 Gp;
893 PRUNTIME_FUNCTION FunctionEntry;
894 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
895
896 typedef struct _UNWIND_HISTORY_TABLE {
897 ULONG Count;
898 UCHAR Search;
899 ULONG64 LowAddress;
900 ULONG64 HighAddress;
901 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
902 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
903
904 #endif /* defined(__ia64__) */
905
906 /***********************************************************************
907 * Types and data structures
908 */
909
910 /* This is used by NtQuerySystemInformation */
911 typedef struct _SYSTEM_THREAD_INFORMATION
912 { /* win32/win64 */
913 LARGE_INTEGER KernelTime; /* 00/00 */
914 LARGE_INTEGER UserTime; /* 08/08 */
915 LARGE_INTEGER CreateTime; /* 10/10 */
916 DWORD dwTickCount; /* 18/18 */
917 LPVOID StartAddress; /* 1c/20 */
918 CLIENT_ID ClientId; /* 20/28 */
919 DWORD dwCurrentPriority; /* 28/38 */
920 DWORD dwBasePriority; /* 2c/3c */
921 DWORD dwContextSwitches; /* 30/40 */
922 DWORD dwThreadState; /* 34/44 */
923 DWORD dwWaitReason; /* 38/48 */
924 DWORD dwUnknown; /* 3c/4c */
925 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
926
927 typedef struct _IO_STATUS_BLOCK {
928 union {
929 NTSTATUS Status;
930 PVOID Pointer;
931 } DUMMYUNIONNAME;
932
933 ULONG_PTR Information;
934 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
935
936 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
937
938 typedef struct _KEY_BASIC_INFORMATION {
939 LARGE_INTEGER LastWriteTime;
940 ULONG TitleIndex;
941 ULONG NameLength;
942 WCHAR Name[1];
943 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
944
945 typedef struct _KEY_NODE_INFORMATION
946 {
947 LARGE_INTEGER LastWriteTime;
948 ULONG TitleIndex;
949 ULONG ClassOffset;
950 ULONG ClassLength;
951 ULONG NameLength;
952 WCHAR Name[1];
953 /* Class[1]; */
954 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
955
956 typedef struct _KEY_FULL_INFORMATION
957 {
958 LARGE_INTEGER LastWriteTime;
959 ULONG TitleIndex;
960 ULONG ClassOffset;
961 ULONG ClassLength;
962 ULONG SubKeys;
963 ULONG MaxNameLen;
964 ULONG MaxClassLen;
965 ULONG Values;
966 ULONG MaxValueNameLen;
967 ULONG MaxValueDataLen;
968 WCHAR Class[1];
969 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
970
971 typedef struct _KEY_VALUE_ENTRY
972 {
973 PUNICODE_STRING ValueName;
974 ULONG DataLength;
975 ULONG DataOffset;
976 ULONG Type;
977 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
978
979 typedef struct _KEY_VALUE_BASIC_INFORMATION {
980 ULONG TitleIndex;
981 ULONG Type;
982 ULONG NameLength;
983 WCHAR Name[1];
984 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
985
986 typedef struct _KEY_VALUE_FULL_INFORMATION {
987 ULONG TitleIndex;
988 ULONG Type;
989 ULONG DataOffset;
990 ULONG DataLength;
991 ULONG NameLength;
992 WCHAR Name[1];
993 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
994
995 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
996 ULONG TitleIndex;
997 ULONG Type;
998 ULONG DataLength;
999 UCHAR Data[1];
1000 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
1001
1002 typedef struct _OBJECT_ATTRIBUTES {
1003 ULONG Length;
1004 HANDLE RootDirectory;
1005 PUNICODE_STRING ObjectName;
1006 ULONG Attributes;
1007 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
1008 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
1009 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
1010
1011 typedef struct _OBJECT_DATA_INFORMATION {
1012 BOOLEAN InheritHandle;
1013 BOOLEAN ProtectFromClose;
1014 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
1015
1016 typedef struct _OBJECT_BASIC_INFORMATION {
1017 ULONG Attributes;
1018 ACCESS_MASK GrantedAccess;
1019 ULONG HandleCount;
1020 ULONG PointerCount;
1021 ULONG PagedPoolUsage;
1022 ULONG NonPagedPoolUsage;
1023 ULONG Reserved[3];
1024 ULONG NameInformationLength;
1025 ULONG TypeInformationLength;
1026 ULONG SecurityDescriptorLength;
1027 LARGE_INTEGER CreateTime;
1028 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
1029
1030 typedef struct _OBJECT_NAME_INFORMATION {
1031 UNICODE_STRING Name;
1032 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
1033
1034 typedef struct __OBJECT_TYPE_INFORMATION {
1035 UNICODE_STRING TypeName;
1036 ULONG Reserved [22];
1037 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
1038
1039 typedef struct _PROCESS_BASIC_INFORMATION {
1040 #ifdef __WINESRC__
1041 DWORD_PTR ExitStatus;
1042 PPEB PebBaseAddress;
1043 DWORD_PTR AffinityMask;
1044 DWORD_PTR BasePriority;
1045 ULONG_PTR UniqueProcessId;
1046 ULONG_PTR InheritedFromUniqueProcessId;
1047 #else
1048 PVOID Reserved1;
1049 PPEB PebBaseAddress;
1050 PVOID Reserved2[2];
1051 ULONG_PTR UniqueProcessId;
1052 PVOID Reserved3;
1053 #endif
1054 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
1055
1056 typedef struct _RTL_HEAP_DEFINITION {
1057 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
1058
1059 ULONG Unknown[11];
1060 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
1061
1062 typedef struct _RTL_RWLOCK {
1063 RTL_CRITICAL_SECTION rtlCS;
1064
1065 HANDLE hSharedReleaseSemaphore;
1066 UINT uSharedWaiters;
1067
1068 HANDLE hExclusiveReleaseSemaphore;
1069 UINT uExclusiveWaiters;
1070
1071 INT iNumberActive;
1072 HANDLE hOwningThreadId;
1073 DWORD dwTimeoutBoost;
1074 PVOID pDebugInfo;
1075 } RTL_RWLOCK, *LPRTL_RWLOCK;
1076
1077 /* System Information Class 0x00 */
1078
1079 typedef struct _SYSTEM_BASIC_INFORMATION {
1080 #ifdef __WINESRC__
1081 DWORD dwUnknown1;
1082 ULONG uKeMaximumIncrement;
1083 ULONG uPageSize;
1084 ULONG uMmNumberOfPhysicalPages;
1085 ULONG uMmLowestPhysicalPage;
1086 ULONG uMmHighestPhysicalPage;
1087 ULONG uAllocationGranularity;
1088 PVOID pLowestUserAddress;
1089 PVOID pMmHighestUserAddress;
1090 ULONG uKeActiveProcessors;
1091 BYTE bKeNumberProcessors;
1092 BYTE bUnknown2;
1093 WORD wUnknown3;
1094 #else
1095 BYTE Reserved1[24];
1096 PVOID Reserved2[4];
1097 CCHAR NumberOfProcessors;
1098 #endif
1099 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
1100
1101 /* System Information Class 0x01 */
1102
1103 typedef struct _SYSTEM_CPU_INFORMATION {
1104 WORD Architecture;
1105 WORD Level;
1106 WORD Revision; /* combination of CPU model and stepping */
1107 WORD Reserved; /* always zero */
1108 DWORD FeatureSet; /* see bit flags below */
1109 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
1110
1111 /* definitions of bits in the Feature set for the x86 processors */
1112 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
1113 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
1114 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
1115 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
1116 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
1117 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
1118 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
1119 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
1120 #define CPU_FEATURE_X86 0x00000200 /* seems to be alway ON, on the '86 */
1121 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
1122 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
1123 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
1124 #define CPU_FEATURE_SSE 0x00002000 /* SSE extenstions (ext. MMX) */
1125 #define CPU_FEATURE_3DNOW 0x00008000 /* 3DNOW instructions available
1126 (FIXME: needs to be confirmed) */
1127 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
1128 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
1129 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
1130
1131 /* System Information Class 0x02 */
1132
1133 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1134 BYTE Reserved1[312];
1135 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1136
1137 /* System Information Class 0x03 */
1138
1139 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1140 #ifdef __WINESRC__
1141 LARGE_INTEGER liKeBootTime;
1142 LARGE_INTEGER liKeSystemTime;
1143 LARGE_INTEGER liExpTimeZoneBias;
1144 ULONG uCurrentTimeZoneId;
1145 DWORD dwUnknown1[5];
1146 #else
1147 BYTE Reserved1[48];
1148 #endif
1149 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1150
1151 /* System Information Class 0x08 */
1152
1153 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1154 #ifdef __WINESRC__
1155 LARGE_INTEGER liIdleTime;
1156 LARGE_INTEGER liKernelTime;
1157 LARGE_INTEGER liUserTime;
1158 DWORD dwSpare[5];
1159 #else
1160 LARGE_INTEGER IdleTime;
1161 LARGE_INTEGER KernelTime;
1162 LARGE_INTEGER UserTime;
1163 LARGE_INTEGER Reserved1[2];
1164 ULONG Reserved2;
1165 #endif
1166 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1167
1168 /* System Information Class 0x0b */
1169
1170 typedef struct _SYSTEM_DRIVER_INFORMATION {
1171 PVOID pvAddress;
1172 DWORD dwUnknown1;
1173 DWORD dwUnknown2;
1174 DWORD dwEntryIndex;
1175 DWORD dwUnknown3;
1176 char szName[MAX_PATH + 1];
1177 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
1178
1179 /* System Information Class 0x10 */
1180
1181 typedef struct _SYSTEM_HANDLE_ENTRY {
1182 ULONG OwnerPid;
1183 BYTE ObjectType;
1184 BYTE HandleFlags;
1185 USHORT HandleValue;
1186 PVOID ObjectPointer;
1187 ULONG AccessMask;
1188 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
1189
1190 typedef struct _SYSTEM_HANDLE_INFORMATION {
1191 ULONG Count;
1192 SYSTEM_HANDLE_ENTRY Handle[1];
1193 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
1194
1195 /* System Information Class 0x15 */
1196
1197 typedef struct _SYSTEM_CACHE_INFORMATION {
1198 ULONG CurrentSize;
1199 ULONG PeakSize;
1200 ULONG PageFaultCount;
1201 ULONG MinimumWorkingSet;
1202 ULONG MaximumWorkingSet;
1203 ULONG unused[4];
1204 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
1205
1206 /* System Information Class 0x17 */
1207
1208 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
1209 BYTE Reserved1[24];
1210 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1211
1212 typedef struct _SYSTEM_CONFIGURATION_INFO {
1213 union {
1214 ULONG OemId;
1215 struct {
1216 WORD ProcessorArchitecture;
1217 WORD Reserved;
1218 } tag1;
1219 } tag2;
1220 ULONG PageSize;
1221 PVOID MinimumApplicationAddress;
1222 PVOID MaximumApplicationAddress;
1223 ULONG ActiveProcessorMask;
1224 ULONG NumberOfProcessors;
1225 ULONG ProcessorType;
1226 ULONG AllocationGranularity;
1227 WORD ProcessorLevel;
1228 WORD ProcessorRevision;
1229 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
1230
1231 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
1232 BYTE Reserved1[16];
1233 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1234
1235 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
1236 BYTE Reserved1[32];
1237 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1238
1239 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
1240 BOOLEAN DebuggerEnabled;
1241 BOOLEAN DebuggerNotPresent;
1242 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1243
1244 /* System Information Class 0x05 */
1245
1246 typedef struct _VM_COUNTERS_ {
1247 SIZE_T PeakVirtualSize;
1248 SIZE_T VirtualSize;
1249 ULONG PageFaultCount;
1250 SIZE_T PeakWorkingSetSize;
1251 SIZE_T WorkingSetSize;
1252 SIZE_T QuotaPeakPagedPoolUsage;
1253 SIZE_T QuotaPagedPoolUsage;
1254 SIZE_T QuotaPeakNonPagedPoolUsage;
1255 SIZE_T QuotaNonPagedPoolUsage;
1256 SIZE_T PagefileUsage;
1257 SIZE_T PeakPagefileUsage;
1258 SIZE_T PrivatePageCount;
1259 } VM_COUNTERS, *PVM_COUNTERS;
1260
1261 typedef struct _SYSTEM_PROCESS_INFORMATION {
1262 #ifdef __WINESRC__ /* win32/win64 */
1263 ULONG NextEntryOffset; /* 00/00 */
1264 DWORD dwThreadCount; /* 04/04 */
1265 DWORD dwUnknown1[6]; /* 08/08 */
1266 LARGE_INTEGER CreationTime; /* 20/20 */
1267 LARGE_INTEGER UserTime; /* 28/28 */
1268 LARGE_INTEGER KernelTime; /* 30/30 */
1269 UNICODE_STRING ProcessName; /* 38/38 */
1270 DWORD dwBasePriority; /* 40/48 */
1271 HANDLE UniqueProcessId; /* 44/50 */
1272 HANDLE ParentProcessId; /* 48/58 */
1273 ULONG HandleCount; /* 4c/60 */
1274 DWORD dwUnknown3; /* 50/64 */
1275 DWORD dwUnknown4; /* 54/68 */
1276 VM_COUNTERS vmCounters; /* 58/70 */
1277 IO_COUNTERS ioCounters; /* 88/d0 */
1278 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
1279 #else
1280 ULONG NextEntryOffset; /* 00/00 */
1281 BYTE Reserved1[52]; /* 04/04 */
1282 PVOID Reserved2[3]; /* 38/38 */
1283 HANDLE UniqueProcessId; /* 44/50 */
1284 PVOID Reserved3; /* 48/58 */
1285 ULONG HandleCount; /* 4c/60 */
1286 BYTE Reserved4[4]; /* 50/64 */
1287 PVOID Reserved5[11]; /* 54/68 */
1288 SIZE_T PeakPagefileUsage; /* 80/c0 */
1289 SIZE_T PrivatePageCount; /* 84/c8 */
1290 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
1291 #endif
1292 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1293
1294 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1295 ULONG RegistryQuotaAllowed;
1296 ULONG RegistryQuotaUsed;
1297 PVOID Reserved1;
1298 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1299
1300 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1301 ULONG TimeAdjustment;
1302 BOOLEAN TimeAdjustmentDisabled;
1303 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1304
1305 typedef struct _TIME_FIELDS
1306 { CSHORT Year;
1307 CSHORT Month;
1308 CSHORT Day;
1309 CSHORT Hour;
1310 CSHORT Minute;
1311 CSHORT Second;
1312 CSHORT Milliseconds;
1313 CSHORT Weekday;
1314 } TIME_FIELDS, *PTIME_FIELDS;
1315
1316 typedef struct _WINSTATIONINFORMATIONW {
1317 BYTE Reserved2[70];
1318 ULONG LogonId;
1319 BYTE Reserved3[1140];
1320 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1321
1322 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1323
1324 typedef struct _LDR_RESOURCE_INFO
1325 {
1326 ULONG Type;
1327 ULONG Name;
1328 ULONG Language;
1329 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1330
1331
1332 /* debug buffer definitions */
1333
1334 typedef struct _DEBUG_BUFFER {
1335 HANDLE SectionHandle;
1336 PVOID SectionBase;
1337 PVOID RemoteSectionBase;
1338 ULONG SectionBaseDelta;
1339 HANDLE EventPairHandle;
1340 ULONG Unknown[2];
1341 HANDLE RemoteThreadHandle;
1342 ULONG InfoClassMask;
1343 ULONG SizeOfInfo;
1344 ULONG AllocatedSize;
1345 ULONG SectionSize;
1346 PVOID ModuleInformation;
1347 PVOID BackTraceInformation;
1348 PVOID HeapInformation;
1349 PVOID LockInformation;
1350 PVOID Reserved[8];
1351 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1352
1353 #define PDI_MODULES 0x01
1354 #define PDI_BACKTRACE 0x02
1355 #define PDI_HEAPS 0x04
1356 #define PDI_HEAP_TAGS 0x08
1357 #define PDI_HEAP_BLOCKS 0x10
1358 #define PDI_LOCKS 0x20
1359
1360 typedef struct _DEBUG_MODULE_INFORMATION {
1361 ULONG Reserved[2];
1362 ULONG Base;
1363 ULONG Size;
1364 ULONG Flags;
1365 USHORT Index;
1366 USHORT Unknown;
1367 USHORT LoadCount;
1368 USHORT ModuleNameOffset;
1369 CHAR ImageName[256];
1370 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1371
1372 typedef struct _DEBUG_HEAP_INFORMATION {
1373 ULONG Base;
1374 ULONG Flags;
1375 USHORT Granularity;
1376 USHORT Unknown;
1377 ULONG Allocated;
1378 ULONG Committed;
1379 ULONG TagCount;
1380 ULONG BlockCount;
1381 ULONG Reserved[7];
1382 PVOID Tags;
1383 PVOID Blocks;
1384 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1385
1386 typedef struct _DEBUG_LOCK_INFORMATION {
1387 PVOID Address;
1388 USHORT Type;
1389 USHORT CreatorBackTraceIndex;
1390 ULONG OwnerThreadId;
1391 ULONG ActiveCount;
1392 ULONG ContentionCount;
1393 ULONG EntryCount;
1394 ULONG RecursionCount;
1395 ULONG NumberOfSharedWaiters;
1396 ULONG NumberOfExclusiveWaiters;
1397 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1398
1399 typedef struct _PORT_MESSAGE_HEADER {
1400 USHORT DataSize;
1401 USHORT MessageSize;
1402 USHORT MessageType;
1403 USHORT VirtualRangesOffset;
1404 CLIENT_ID ClientId;
1405 ULONG MessageId;
1406 ULONG SectionSize;
1407 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1408
1409 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
1410
1411 /* Wine doesn't implement atom table as NT does:
1412 * - in NT, atom tables are user space tables, which ntdll directly accesses
1413 * - on Wine, (even local) atom tables are wineserver object, hence a HANDLE
1414 */
1415 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
1416
1417 typedef enum _ATOM_INFORMATION_CLASS {
1418 AtomBasicInformation = 0,
1419 AtomTableInformation = 1,
1420 } ATOM_INFORMATION_CLASS;
1421
1422 typedef struct _ATOM_BASIC_INFORMATION {
1423 USHORT ReferenceCount;
1424 USHORT Pinned;
1425 USHORT NameLength;
1426 WCHAR Name[1];
1427 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
1428
1429 /* FIXME: names probably not correct */
1430 typedef struct _RTL_HANDLE
1431 {
1432 struct _RTL_HANDLE * Next;
1433 } RTL_HANDLE;
1434
1435 /* FIXME: names probably not correct */
1436 typedef struct _RTL_HANDLE_TABLE
1437 {
1438 ULONG MaxHandleCount; /* 0x00 */
1439 ULONG HandleSize; /* 0x04 */
1440 ULONG Unused[2]; /* 0x08-0x0c */
1441 PVOID NextFree; /* 0x10 */
1442 PVOID FirstHandle; /* 0x14 */
1443 PVOID ReservedMemory; /* 0x18 */
1444 PVOID MaxHandle; /* 0x1c */
1445 } RTL_HANDLE_TABLE;
1446
1447 /***********************************************************************
1448 * Defines
1449 */
1450
1451 /* flags for NtCreateFile and NtOpenFile */
1452 #define FILE_DIRECTORY_FILE 0x00000001
1453 #define FILE_WRITE_THROUGH 0x00000002
1454 #define FILE_SEQUENTIAL_ONLY 0x00000004
1455 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1456 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1457 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1458 #define FILE_NON_DIRECTORY_FILE 0x00000040
1459 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1460 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1461 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1462 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400
1463 #define FILE_RANDOM_ACCESS 0x00000800
1464 #define FILE_DELETE_ON_CLOSE 0x00001000
1465 #define FILE_OPEN_BY_FILE_ID 0x00002000
1466 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1467 #define FILE_NO_COMPRESSION 0x00008000
1468 #define FILE_RESERVE_OPFILTER 0x00100000
1469 #define FILE_TRANSACTED_MODE 0x00200000
1470 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1471 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1472
1473 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1474 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1475
1476 /* status for NtCreateFile or NtOpenFile */
1477 #define FILE_SUPERSEDED 0
1478 #define FILE_OPENED 1
1479 #define FILE_CREATED 2
1480 #define FILE_OVERWRITTEN 3
1481 #define FILE_EXISTS 4
1482 #define FILE_DOES_NOT_EXIST 5
1483
1484 /* disposition for NtCreateFile */
1485 #define FILE_SUPERSEDE 0
1486 #define FILE_OPEN 1
1487 #define FILE_CREATE 2
1488 #define FILE_OPEN_IF 3
1489 #define FILE_OVERWRITE 4
1490 #define FILE_OVERWRITE_IF 5
1491 #define FILE_MAXIMUM_DISPOSITION 5
1492
1493 /* Characteristics of a File System */
1494 #define FILE_REMOVABLE_MEDIA 0x00000001
1495 #define FILE_READ_ONLY_DEVICE 0x00000002
1496 #define FILE_FLOPPY_DISKETTE 0x00000004
1497 #define FILE_WRITE_ONE_MEDIA 0x00000008
1498 #define FILE_REMOTE_DEVICE 0x00000010
1499 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1500 #define FILE_VIRTUAL_VOLUME 0x00000040
1501 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1502 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1503
1504 /* options for NtCreateNamedPipeFile */
1505 #define FILE_PIPE_INBOUND 0x00000000
1506 #define FILE_PIPE_OUTBOUND 0x00000001
1507 #define FILE_PIPE_FULL_DUPLEX 0x00000002
1508
1509 #if (_WIN32_WINNT >= 0x0501)
1510 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1511 #endif /* (_WIN32_WINNT >= 0x0501) */
1512
1513 #define LOGONID_CURRENT ((ULONG)-1)
1514
1515 #define OBJ_INHERIT 0x00000002L
1516 #define OBJ_PERMANENT 0x00000010L
1517 #define OBJ_EXCLUSIVE 0x00000020L
1518 #define OBJ_CASE_INSENSITIVE 0x00000040L
1519 #define OBJ_OPENIF 0x00000080L
1520 #define OBJ_OPENLINK 0x00000100L
1521 #define OBJ_KERNEL_HANDLE 0x00000200L
1522 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
1523
1524 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1525
1526 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1527 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1528
1529
1530 /* DbgPrintEx default levels */
1531 #define DPFLTR_ERROR_LEVEL 0
1532 #define DPFLTR_WARNING_LEVEL 1
1533 #define DPFLTR_TRACE_LEVEL 2
1534 #define DPFLTR_INFO_LEVEL 3
1535 #define DPFLTR_MASK 0x8000000
1536
1537 /* Well-known LUID values */
1538 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2L
1539 #define SE_CREATE_TOKEN_PRIVILEGE 2L
1540 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3L
1541 #define SE_LOCK_MEMORY_PRIVILEGE 4L
1542 #define SE_INCREASE_QUOTA_PRIVILEGE 5L
1543 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6L /* obsolete */
1544 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6L
1545 #define SE_TCB_PRIVILEGE 7L
1546 #define SE_SECURITY_PRIVILEGE 8L
1547 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9L
1548 #define SE_LOAD_DRIVER_PRIVILEGE 10L
1549 #define SE_SYSTEM_PROFILE_PRIVILEGE 11L
1550 #define SE_SYSTEMTIME_PRIVILEGE 12L
1551 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13L
1552 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14L
1553 #define SE_CREATE_PAGEFILE_PRIVILEGE 15L
1554 #define SE_CREATE_PERMANENT_PRIVILEGE 16L
1555 #define SE_BACKUP_PRIVILEGE 17L
1556 #define SE_RESTORE_PRIVILEGE 18L
1557 #define SE_SHUTDOWN_PRIVILEGE 19L
1558 #define SE_DEBUG_PRIVILEGE 20L
1559 #define SE_AUDIT_PRIVILEGE 21L
1560 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22L
1561 #define SE_CHANGE_NOTIFY_PRIVILLEGE 23L
1562 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24L
1563 #define SE_UNDOCK_PRIVILEGE 25L
1564 #define SE_SYNC_AGENT_PRIVILEGE 26L
1565 #define SE_ENABLE_DELEGATION_PRIVILEGE 27L
1566 #define SE_MANAGE_VOLUME_PRIVILEGE 28L
1567 #define SE_IMPERSONATE_PRIVILEGE 29L
1568 #define SE_CREATE_GLOBAL_PRIVILEGE 30L
1569 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1570
1571 /* NtGlobalFlag bits */
1572 #define FLG_STOP_ON_EXCEPTION 0x00000001
1573 #define FLG_SHOW_LDR_SNAPS 0x00000002
1574 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
1575 #define FLG_STOP_ON_HUNG_GUI 0x00000008
1576 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
1577 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
1578 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
1579 #define FLG_HEAP_VALIDATE_ALL 0x00000080
1580 #define FLG_APPLICATION_VERIFIER 0x00000100
1581 #define FLG_POOL_ENABLE_TAGGING 0x00000400
1582 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
1583 #define FLG_USER_STACK_TRACE_DB 0x00001000
1584 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
1585 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
1586 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
1587 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
1588 #define FLG_ENABLE_CSRDEBUG 0x00020000
1589 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
1590 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
1591 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
1592 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
1593 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
1594 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
1595 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
1596 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
1597 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
1598 #define FLG_DISABLE_DBGPRINT 0x08000000
1599 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
1600 #define FLG_LDR_TOP_DOWN 0x20000000
1601 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
1602 #define FLG_DISABLE_PROTDLLS 0x80000000
1603
1604 /* Rtl*Registry* functions structs and defines */
1605 #define RTL_REGISTRY_ABSOLUTE 0
1606 #define RTL_REGISTRY_SERVICES 1
1607 #define RTL_REGISTRY_CONTROL 2
1608 #define RTL_REGISTRY_WINDOWS_NT 3
1609 #define RTL_REGISTRY_DEVICEMAP 4
1610 #define RTL_REGISTRY_USER 5
1611
1612 #define RTL_REGISTRY_HANDLE 0x40000000
1613 #define RTL_REGISTRY_OPTIONAL 0x80000000
1614
1615 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1616 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1617 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1618 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1619 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1620 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1621 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1622
1623 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1624 ULONG ValueType,
1625 PVOID ValueData,
1626 ULONG ValueLength,
1627 PVOID Context,
1628 PVOID EntryContext);
1629
1630 typedef struct _RTL_QUERY_REGISTRY_TABLE
1631 {
1632 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1633 ULONG Flags;
1634 PWSTR Name;
1635 PVOID EntryContext;
1636 ULONG DefaultType;
1637 PVOID DefaultData;
1638 ULONG DefaultLength;
1639 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1640
1641 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
1642 {
1643 PUNICODE_STRING ValueName;
1644 ULONG DataLength;
1645 ULONG DataOffset;
1646 ULONG Type;
1647 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
1648
1649 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
1650
1651 typedef enum _EVENT_TYPE {
1652 NotificationEvent,
1653 SynchronizationEvent
1654 } EVENT_TYPE, *PEVENT_TYPE;
1655
1656 typedef enum _EVENT_INFORMATION_CLASS {
1657 EventBasicInformation
1658 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
1659
1660 typedef struct _EVENT_BASIC_INFORMATION {
1661 EVENT_TYPE EventType;
1662 LONG EventState;
1663 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
1664
1665 typedef enum _SEMAPHORE_INFORMATION_CLASS {
1666 SemaphoreBasicInformation
1667 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
1668
1669 typedef struct _SEMAPHORE_BASIC_INFORMATION {
1670 ULONG CurrentCount;
1671 ULONG MaximumCount;
1672 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
1673
1674 typedef enum _SECTION_INFORMATION_CLASS
1675 {
1676 SectionBasicInformation,
1677 SectionImageInformation,
1678 } SECTION_INFORMATION_CLASS;
1679
1680 typedef struct _SECTION_BASIC_INFORMATION {
1681 ULONG BaseAddress;
1682 ULONG Attributes;
1683 LARGE_INTEGER Size;
1684 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
1685
1686 typedef struct _SECTION_IMAGE_INFORMATION {
1687 PVOID EntryPoint;
1688 ULONG StackZeroBits;
1689 ULONG StackReserved;
1690 ULONG StackCommit;
1691 ULONG ImageSubsystem;
1692 WORD SubsystemVersionLow;
1693 WORD SubsystemVersionHigh;
1694 ULONG Unknown1;
1695 ULONG ImageCharacteristics;
1696 ULONG ImageMachineType;
1697 ULONG Unknown2[3];
1698 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
1699
1700 typedef struct _LPC_SECTION_WRITE {
1701 ULONG Length;
1702 HANDLE SectionHandle;
1703 ULONG SectionOffset;
1704 ULONG ViewSize;
1705 PVOID ViewBase;
1706 PVOID TargetViewBase;
1707 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
1708
1709 typedef struct _LPC_SECTION_READ {
1710 ULONG Length;
1711 ULONG ViewSize;
1712 PVOID ViewBase;
1713 } LPC_SECTION_READ, *PLPC_SECTION_READ;
1714
1715 typedef struct _LPC_MESSAGE {
1716 USHORT DataSize;
1717 USHORT MessageSize;
1718 USHORT MessageType;
1719 USHORT VirtualRangesOffset;
1720 CLIENT_ID ClientId;
1721 ULONG MessageId;
1722 ULONG SectionSize;
1723 UCHAR Data[ANYSIZE_ARRAY];
1724 } LPC_MESSAGE, *PLPC_MESSAGE;
1725
1726 typedef enum _SHUTDOWN_ACTION {
1727 ShutdownNoReboot,
1728 ShutdownReboot,
1729 ShutdownPowerOff
1730 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
1731
1732 typedef enum _KPROFILE_SOURCE {
1733 ProfileTime,
1734 ProfileAlignmentFixup,
1735 ProfileTotalIssues,
1736 ProfilePipelineDry,
1737 ProfileLoadInstructions,
1738 ProfilePipelineFrozen,
1739 ProfileBranchInstructions,
1740 ProfileTotalNonissues,
1741 ProfileDcacheMisses,
1742 ProfileIcacheMisses,
1743 ProfileCacheMisses,
1744 ProfileBranchMispredictions,
1745 ProfileStoreInstructions,
1746 ProfileFpInstructions,
1747 ProfileIntegerInstructions,
1748 Profile2Issue,
1749 Profile3Issue,
1750 Profile4Issue,
1751 ProfileSpecialInstructions,
1752 ProfileTotalCycles,
1753 ProfileIcacheIssues,
1754 ProfileDcacheAccesses,
1755 ProfileMemoryBarrierCycles,
1756 ProfileLoadLinkedIssues,
1757 ProfileMaximum
1758 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
1759
1760 typedef struct _OBJDIR_INFORMATION {
1761 UNICODE_STRING ObjectName;
1762 UNICODE_STRING ObjectTypeName;
1763 BYTE Data[1];
1764 } OBJDIR_INFORMATION, *POBJDIR_INFORMATION;
1765
1766 typedef struct _INITIAL_TEB {
1767 PVOID StackBase;
1768 PVOID StackLimit;
1769 PVOID StackCommit;
1770 PVOID StackCommitMax;
1771 PVOID StackReserved;
1772 } INITIAL_TEB, *PINITIAL_TEB;
1773
1774 typedef enum _PORT_INFORMATION_CLASS {
1775 PortNoInformation
1776 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
1777
1778 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
1779 IoCompletionBasicInformation
1780 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
1781
1782 typedef struct _FILE_COMPLETION_INFORMATION {
1783 HANDLE CompletionPort;
1784 ULONG_PTR CompletionKey;
1785 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
1786
1787 typedef enum _HARDERROR_RESPONSE_OPTION {
1788 OptionAbortRetryIgnore,
1789 OptionOk,
1790 OptionOkCancel,
1791 OptionRetryCancel,
1792 OptionYesNo,
1793 OptionYesNoCancel,
1794 OptionShutdownSystem
1795 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
1796
1797 typedef enum _HARDERROR_RESPONSE {
1798 ResponseReturnToCaller,
1799 ResponseNotHandled,
1800 ResponseAbort,
1801 ResponseCancel,
1802 ResponseIgnore,
1803 ResponseNo,
1804 ResponseOk,
1805 ResponseRetry,
1806 ResponseYes
1807 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
1808
1809 typedef enum _SYSDBG_COMMAND {
1810 SysDbgQueryModuleInformation,
1811 SysDbgQueryTraceInformation,
1812 SysDbgSetTracepoint,
1813 SysDbgSetSpecialCall,
1814 SysDbgClearSpecialCalls,
1815 SysDbgQuerySpecialCalls
1816 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
1817
1818 /***********************************************************************
1819 * Function declarations
1820 */
1821
1822 #if defined(__i386__) && defined(__GNUC__)
1823 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1824 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1825 #else /* __i386__ && __GNUC__ */
1826 void WINAPI DbgBreakPoint(void);
1827 void WINAPI DbgUserBreakPoint(void);
1828 #endif /* __i386__ && __GNUC__ */
1829 //NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1830 NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
1831
1832 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
1833 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
1834 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
1835 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1836 NTSTATUS WINAPI LdrGetDllHandleEx(ULONG,PWSTR,PULONG,PUNICODE_STRING,PVOID);
1837 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
1838 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
1839 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
1840 void WINAPI LdrShutdownProcess(void);
1841 void WINAPI LdrShutdownThread(void);
1842 NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
1843 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
1844 NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PULONG,PULONG,PBOOLEAN);
1845 NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
1846 NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
1847 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1848 NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
1849 NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
1850 NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
1851 NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG);
1852 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
1853 NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
1854 NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1855 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1856 NTSTATUS WINAPI NtClearEvent(HANDLE);
1857 NTSTATUS WINAPI NtClose(HANDLE);
1858 NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
1859 NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
1860 NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1861 NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
1862 NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1863 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1864 NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1865 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1866 NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
1867 NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1868 NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1869 NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
1870 NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1871 NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
1872 NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
1873 NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
1874 //NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
1875 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1876 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
1877 NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
1878 NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
1879 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1880 NTSTATUS WINAPI NtCreateToken(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,TOKEN_TYPE,PLUID,PLARGE_INTEGER,PTOKEN_USER,PTOKEN_GROUPS,PTOKEN_PRIVILEGES,PTOKEN_OWNER,PTOKEN_PRIMARY_GROUP,PTOKEN_DEFAULT_DACL,PTOKEN_SOURCE);
1881 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1882 NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
1883 NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
1884 NTSTATUS WINAPI NtDeleteKey(HANDLE);
1885 NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
1886 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1887 NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
1888 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1889 NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1890 NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1891 NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1892 NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
1893 NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
1894 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1895 NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1896 NTSTATUS WINAPI NtFlushKey(HANDLE);
1897 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,PIO_STATUS_BLOCK);
1898 NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
1899 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1900 NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1901 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1902 NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
1903 ULONG WINAPI NtGetTickCount(VOID);
1904 NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1905 NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1906 NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
1907 NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
1908 NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
1909 NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
1910 NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
1911 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
1912 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1913 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1914 NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
1915 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
1916 NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
1917 NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1918 NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1919 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1920 NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1921 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1922 NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1923 NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1924 NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1925 NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
1926 NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1927 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1928 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1929 NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1930 NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1931 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1932 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1933 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1934 NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
1935 NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
1936 NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
1937 NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
1938 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
1939 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1940 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1941 NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
1942 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1943 NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
1944 NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1945 NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,POBJDIR_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
1946 NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1947 NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1948 NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1949 NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,RTL_ATOM_TABLE,ULONG,ULONG*);
1950 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1951 NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1952 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1953 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1954 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1955 NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
1956 NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
1957 NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1958 NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1959 NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
1960 NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1961 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1962 NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
1963 NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
1964 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1965 NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1966 NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1967 NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
1968 NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
1969 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1970 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1971 NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1972 NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
1973 NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1974 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
1975 NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1976 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1977 NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
1978 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1979 NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT,ULONG,PLARGE_INTEGER,PULONG);
1980 NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
1981 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1982 NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
1983 NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
1984 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1985 NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER);
1986 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
1987 NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
1988 NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
1989 NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
1990 NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
1991 NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
1992 NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
1993 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1994 NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
1995 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1996 NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
1997 NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1998 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1999 NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
2000 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
2001 NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
2002 NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
2003 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
2004 NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
2005 NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
2006 NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
2007 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
2008 NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
2009 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
2010 NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
2011 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
2012 NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
2013 NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
2014 NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
2015 NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY);
2016 NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
2017 NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
2018 NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
2019 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2020 NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
2021 NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
2022 NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
2023 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
2024 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
2025 NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
2026 NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
2027 NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2028 NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
2029 NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
2030 NTSTATUS WINAPI NtStartProfile(HANDLE);
2031 NTSTATUS WINAPI NtStopProfile(HANDLE);
2032 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
2033 NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
2034 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
2035 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
2036 NTSTATUS WINAPI NtTestAlert(VOID);
2037 NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
2038 NTSTATUS WINAPI NtUnloadKey(HANDLE);
2039 NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
2040 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
2041 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2042 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
2043 NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
2044 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
2045 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
2046 NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
2047 NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
2048 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
2049 NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT,ULONG,PLARGE_INTEGER,PULONG);
2050 NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2051 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
2052 NTSTATUS WINAPI NtYieldExecution(void);
2053
2054 void WINAPI RtlAcquirePebLock(void);
2055 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
2056 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
2057 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
2058 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
2059 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2060 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
2061 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2062 NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2063 NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
2064 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
2065 NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
2066 NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
2067 RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
2068 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T);
2069 WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
2070 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
2071 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
2072 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
2073 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
2074 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
2075 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
2076 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2077 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2078 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
2079 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
2080
2081 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
2082 NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
2083 void WINAPI RtlClearAllBits(PRTL_BITMAP);
2084 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
2085 PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
2086 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
2087 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
2088 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2089 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
2090 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
2091 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
2092 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
2093 void WINAPI RtlCopyLuid(PLUID,const LUID*);
2094 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
2095 BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
2096 NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
2097 void WINAPI RtlCopyString(STRING*,const STRING*);
2098 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
2099 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
2100 NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
2101 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
2102 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
2103 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
2104 const UNICODE_STRING*,const UNICODE_STRING*,
2105 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
2106 const UNICODE_STRING*,const UNICODE_STRING*,
2107 const UNICODE_STRING*);
2108 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
2109 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
2110 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
2111 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
2112
2113 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
2114 NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2115 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
2116 NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
2117 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
2118 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
2119 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2120 NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
2121 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
2122 NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
2123 HANDLE WINAPI RtlDestroyHeap(HANDLE);
2124 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
2125 NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
2126 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
2127 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
2128 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PCWSTR*,CURDIR*);
2129 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
2130 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
2131 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2132 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
2133 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
2134
2135 NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
2136 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
2137 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
2138 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
2139 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
2140 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
2141 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
2142 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
2143 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
2144 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
2145 BOOL WINAPI RtlEqualSid(PSID,PSID);
2146 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
2147 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2148 DECLSPEC_NORETURN void WINAPI RtlExitUserThread(ULONG);
2149 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
2150 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
2151 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
2152 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
2153
2154 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
2155 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
2156 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
2157 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2158 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2159 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2160 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
2161 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
2162 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
2163 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
2164 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
2165 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2166 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2167 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
2168 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
2169 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2170 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
2171 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
2172 NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
2173 void WINAPI RtlFreeAnsiString(PANSI_STRING);
2174 BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
2175 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
2176 void WINAPI RtlFreeOemString(POEM_STRING);
2177 DWORD WINAPI RtlFreeSid(PSID);
2178 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
2179
2180 NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
2181 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
2182 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
2183 PEB * WINAPI RtlGetCurrentPeb(void);
2184 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2185 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
2186 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2187 NTSTATUS WINAPI RtlGetLastNtStatus(void);
2188 DWORD WINAPI RtlGetLastWin32Error(void);
2189 DWORD WINAPI RtlGetLongestNtPathLength(void);
2190 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
2191 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2192 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
2193 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2194 //NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
2195 NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
2196
2197 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
2198 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
2199 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
2200 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
2201 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
2202 NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
2203 void WINAPI RtlInitString(PSTRING,PCSZ);
2204 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
2205 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
2206 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
2207 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
2208 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
2209 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
2210 void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
2211 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
2212 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
2213
2214 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
2215 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
2216 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
2217 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
2218 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
2219 BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
2220 BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
2221 BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
2222
2223 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
2224 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
2225 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
2226 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
2227 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
2228 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
2229 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
2230 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
2231 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
2232 DWORD WINAPI RtlLengthRequiredSid(DWORD);
2233 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
2234 DWORD WINAPI RtlLengthSid(PSID);
2235 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2236 BOOLEAN WINAPI RtlLockHeap(HANDLE);
2237 NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2238
2239 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
2240 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
2241 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2242 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
2243
2244 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
2245 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2246 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
2247 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
2248 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
2249 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
2250
2251 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
2252 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
2253 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2254 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
2255
2256 NTSTATUS WINAPI RtlPinAtomInAtomTable(PRTL_ATOM_TABLE,RTL_ATOM);
2257 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
2258 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2259
2260 NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
2261 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
2262 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
2263 NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
2264 NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
2265 NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
2266 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
2267 void WINAPI RtlRaiseStatus(NTSTATUS);
2268 ULONG WINAPI RtlRandom(PULONG);
2269 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
2270 void WINAPI RtlReleasePebLock(void);
2271 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
2272 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
2273 void WINAPI RtlRestoreLastWin32Error(DWORD);
2274
2275 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
2276 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
2277 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
2278 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
2279 void WINAPI RtlSetAllBits(PRTL_BITMAP);
2280 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
2281 ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
2282 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
2283 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
2284 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2285 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
2286 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2287 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2288 void WINAPI RtlSetLastWin32Error(DWORD);
2289 void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
2290 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2291 NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
2292 SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
2293 NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
2294 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
2295 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
2296 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2297
2298 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
2299 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
2300 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
2301 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
2302 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
2303 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
2304
2305 ULONGLONG __fastcall RtlUlonglongByteSwap(ULONGLONG);
2306 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
2307 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
2308 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
2309 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
2310 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
2311 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2312 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
2313 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2314 ULONG WINAPI RtlUniform(PULONG);
2315 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
2316 #ifdef __ia64__
2317 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
2318 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2319 #endif
2320 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
2321 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
2322 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
2323 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2324 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2325 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2326 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2327 CHAR WINAPI RtlUpperChar(CHAR);
2328 void WINAPI RtlUpperString(STRING *,const STRING *);
2329
2330 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
2331 BOOLEAN WINAPI RtlValidAcl(PACL);
2332 BOOLEAN WINAPI RtlValidSid(PSID);
2333 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
2334 //NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
2335
2336 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
2337
2338 NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2339 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
2340 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
2341
2342 ULONG WINAPI
2343 vDbgPrintEx(IN ULONG ComponentId,
2344 IN ULONG Level,
2345 IN LPCSTR Format,
2346 IN va_list ap);
2347 ULONG WINAPI
2348 vDbgPrintExWithPrefix(IN LPCSTR Prefix,
2349 IN ULONG ComponentId,
2350 IN ULONG Level,
2351 IN LPCSTR Format,
2352 IN va_list ap);
2353
2354 /* Wine internal functions */
2355
2356 extern NTSTATUS wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
2357 UINT disposition, BOOLEAN check_case );
2358
2359 /***********************************************************************
2360 * Inline functions
2361 */
2362
2363 #define InitializeObjectAttributes(p,n,a,r,s) \
2364 do { \
2365 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
2366 (p)->RootDirectory = r; \
2367 (p)->Attributes = a; \
2368 (p)->ObjectName = n; \
2369 (p)->SecurityDescriptor = s; \
2370 (p)->SecurityQualityOfService = NULL; \
2371 } while (0)
2372
2373 #define NtCurrentProcess() ((HANDLE)-1)
2374
2375 #ifndef RtlFillMemory
2376 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
2377 #endif
2378 #ifndef RtlMoveMemory
2379 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
2380 #endif
2381 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2382 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2383 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
2384 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
2385 #ifndef RtlZeroMemory
2386 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
2387 #endif
2388
2389 static __inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
2390 {
2391 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
2392 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
2393 return TRUE;
2394 return FALSE;
2395 }
2396
2397 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
2398 static __inline USHORT RtlUshortByteSwap(USHORT s)
2399 {
2400 return (s >> 8) | (s << 8);
2401 }
2402 static __inline ULONG RtlUlongByteSwap(ULONG i)
2403 {
2404 #if defined(__i386__) && defined(__GNUC__)
2405 ULONG ret;
2406 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
2407 return ret;
2408 #else
2409 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
2410 #endif
2411 }
2412
2413 /*************************************************************************
2414 * Loader functions and structures.
2415 *
2416 * Those are not part of standard Winternl.h
2417 */
2418 typedef struct _LDR_MODULE
2419 {
2420 LIST_ENTRY InLoadOrderModuleList;
2421 LIST_ENTRY InMemoryOrderModuleList;
2422 LIST_ENTRY InInitializationOrderModuleList;
2423 void* BaseAddress;
2424 void* EntryPoint;
2425 ULONG SizeOfImage;
2426 UNICODE_STRING FullDllName;
2427 UNICODE_STRING BaseDllName;
2428 ULONG Flags;
2429 SHORT LoadCount;
2430 SHORT TlsIndex;
2431 HANDLE SectionHandle;
2432 ULONG CheckSum;
2433 ULONG TimeDateStamp;
2434 } LDR_MODULE, *PLDR_MODULE;
2435
2436 /* those defines are (some of the) regular LDR_MODULE.Flags values */
2437 #define LDR_IMAGE_IS_DLL 0x00000004
2438 #define LDR_LOAD_IN_PROGRESS 0x00001000
2439 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2440 #define LDR_NO_DLL_CALLS 0x00040000
2441 #define LDR_PROCESS_ATTACHED 0x00080000
2442 #define LDR_MODULE_REBASED 0x00200000
2443
2444 /* these ones is Wine specific */
2445 #define LDR_DONT_RESOLVE_REFS 0x40000000
2446 #define LDR_WINE_INTERNAL 0x80000000
2447
2448 /* FIXME: to be checked */
2449 #define MAXIMUM_FILENAME_LENGTH 256
2450
2451 typedef struct _SYSTEM_MODULE
2452 {
2453 ULONG Reserved1;
2454 ULONG Reserved2;
2455 PVOID ImageBaseAddress;
2456 ULONG ImageSize;
2457 ULONG Flags;
2458 WORD Id;
2459 WORD Rank;
2460 WORD Unknown;
2461 WORD NameOffset;
2462 BYTE Name[MAXIMUM_FILENAME_LENGTH];
2463 } SYSTEM_MODULE, *PSYSTEM_MODULE;
2464
2465 typedef struct _SYSTEM_MODULE_INFORMATION
2466 {
2467 ULONG ModulesCount;
2468 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2469 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
2470
2471 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
2472 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
2473 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
2474 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
2475 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
2476 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
2477
2478 /* list manipulation macros */
2479 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
2480 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
2481 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
2482 #define IsListEmpty(le) ((le)->Flink == (le))
2483 #define RemoveEntryList(e) do { PLIST_ENTRY f = (e)->Flink, b = (e)->Blink; f->Blink = b; b->Flink = f; (e)->Flink = (e)->Blink = NULL; } while (0)
2484 static __inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
2485 {
2486 PLIST_ENTRY f, b, e;
2487
2488 e = le->Flink;
2489 f = le->Flink->Flink;
2490 b = le->Flink->Blink;
2491 f->Blink = b;
2492 b->Flink = f;
2493
2494 if (e != le) e->Flink = e->Blink = NULL;
2495 return e;
2496 }
2497 static __inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
2498 {
2499 PLIST_ENTRY f, b, e;
2500
2501 e = le->Blink;
2502 f = le->Blink->Flink;
2503 b = le->Blink->Blink;
2504 f->Blink = b;
2505 b->Flink = f;
2506
2507 if (e != le) e->Flink = e->Blink = NULL;
2508 return e;
2509 }
2510
2511 typedef struct _FILE_FS_VOLUME_INFORMATION
2512 {
2513 LARGE_INTEGER VolumeCreationTime;
2514 ULONG VolumeSerialNumber;
2515 ULONG VolumeLabelLength;
2516 BOOLEAN SupportsObjects;
2517 WCHAR VolumeLabel[1];
2518 } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
2519 #define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
2520
2521 #ifdef __cplusplus
2522 } /* extern "C" */
2523 #endif /* defined(__cplusplus) */
2524
2525 #endif /* __WINE_WINTERNL_H */