803256fac4c28383b07c4417b3c5db25ce59a80c
[reactos.git] / sdk / include / reactos / wine / 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 St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #ifndef __WINE_WINTERNL_H
22 #define __WINE_WINTERNL_H
23
24 #ifndef __REACTOS__
25 #include <ntdef.h>
26 #endif /* __REACTOS__ */
27 #include <windef.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* defined(__cplusplus) */
32
33 #ifdef __REACTOS__
34 typedef enum _TIMER_TYPE {
35 NotificationTimer,
36 SynchronizationTimer
37 } TIMER_TYPE;
38 typedef enum _EVENT_TYPE {
39 NotificationEvent,
40 SynchronizationEvent
41 } EVENT_TYPE, *PEVENT_TYPE;
42 #define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
43 #endif /* __REACTOS__ */
44
45 /**********************************************************************
46 * Fundamental types and data structures
47 */
48
49 #ifndef WINE_NTSTATUS_DECLARED
50 #define WINE_NTSTATUS_DECLARED
51 typedef LONG NTSTATUS;
52 #ifdef __REACTOS__
53 typedef NTSTATUS *PNTSTATUS;
54 #endif /* __REACTOS__ */
55 #endif
56
57 typedef const char *PCSZ;
58
59 typedef short CSHORT;
60 typedef CSHORT *PCSHORT;
61
62 #ifndef __STRING_DEFINED__
63 #define __STRING_DEFINED__
64 typedef struct _STRING {
65 USHORT Length;
66 USHORT MaximumLength;
67 PCHAR Buffer;
68 } STRING, *PSTRING;
69 #endif
70
71 typedef STRING ANSI_STRING;
72 typedef PSTRING PANSI_STRING;
73 typedef const STRING *PCANSI_STRING;
74
75 typedef STRING OEM_STRING;
76 typedef PSTRING POEM_STRING;
77 typedef const STRING *PCOEM_STRING;
78
79 #ifndef __UNICODE_STRING_DEFINED__
80 #define __UNICODE_STRING_DEFINED__
81 typedef struct _UNICODE_STRING {
82 USHORT Length; /* bytes */
83 USHORT MaximumLength; /* bytes */
84 PWSTR Buffer;
85 } UNICODE_STRING, *PUNICODE_STRING;
86 #endif
87
88 typedef const UNICODE_STRING *PCUNICODE_STRING;
89
90 #ifndef _FILETIME_
91 #define _FILETIME_
92 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
93 typedef struct _FILETIME
94 {
95 #ifdef WORDS_BIGENDIAN
96 DWORD dwHighDateTime;
97 DWORD dwLowDateTime;
98 #else
99 DWORD dwLowDateTime;
100 DWORD dwHighDateTime;
101 #endif
102 } FILETIME, *PFILETIME, *LPFILETIME;
103 #endif /* _FILETIME_ */
104
105 /*
106 * RTL_SYSTEM_TIME and RTL_TIME_ZONE_INFORMATION are the same as
107 * the SYSTEMTIME and TIME_ZONE_INFORMATION structures defined
108 * in winbase.h, however we need to define them separately so
109 * winternl.h doesn't depend on winbase.h. They are used by
110 * RtlQueryTimeZoneInformation and RtlSetTimeZoneInformation.
111 * The names are guessed; if anybody knows the real names, let me know.
112 */
113 typedef struct _RTL_SYSTEM_TIME {
114 WORD wYear;
115 WORD wMonth;
116 WORD wDayOfWeek;
117 WORD wDay;
118 WORD wHour;
119 WORD wMinute;
120 WORD wSecond;
121 WORD wMilliseconds;
122 } RTL_SYSTEM_TIME, *PRTL_SYSTEM_TIME;
123
124 typedef struct _RTL_TIME_ZONE_INFORMATION {
125 LONG Bias;
126 WCHAR StandardName[32];
127 RTL_SYSTEM_TIME StandardDate;
128 LONG StandardBias;
129 WCHAR DaylightName[32];
130 RTL_SYSTEM_TIME DaylightDate;
131 LONG DaylightBias;
132 } RTL_TIME_ZONE_INFORMATION, *PRTL_TIME_ZONE_INFORMATION;
133
134 typedef struct _RTL_TIME_DYNAMIC_ZONE_INFORMATION
135 {
136 LONG Bias;
137 WCHAR StandardName[32];
138 RTL_SYSTEM_TIME StandardDate;
139 LONG StandardBias;
140 WCHAR DaylightName[32];
141 RTL_SYSTEM_TIME DaylightDate;
142 LONG DaylightBias;
143 WCHAR TimeZoneKeyName[128];
144 BOOLEAN DynamicDaylightTimeDisabled;
145 } RTL_DYNAMIC_TIME_ZONE_INFORMATION, *PRTL_DYNAMIC_TIME_ZONE_INFORMATION;
146
147 typedef struct _CLIENT_ID
148 {
149 HANDLE UniqueProcess;
150 HANDLE UniqueThread;
151 } CLIENT_ID, *PCLIENT_ID;
152
153 typedef struct _CURDIR
154 {
155 UNICODE_STRING DosPath;
156 PVOID Handle;
157 } CURDIR, *PCURDIR;
158
159 typedef struct RTL_DRIVE_LETTER_CURDIR
160 {
161 USHORT Flags;
162 USHORT Length;
163 ULONG TimeStamp;
164 UNICODE_STRING DosPath;
165 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
166
167 typedef struct tagRTL_BITMAP {
168 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
169 PULONG Buffer; /* Bitmap data, assumed sized to a DWORD boundary */
170 } RTL_BITMAP, *PRTL_BITMAP;
171
172 typedef const RTL_BITMAP *PCRTL_BITMAP;
173
174 typedef struct tagRTL_BITMAP_RUN {
175 ULONG StartingIndex; /* Bit position at which run starts */
176 ULONG NumberOfBits; /* Size of the run in bits */
177 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
178
179 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
180
181 typedef struct _RTL_USER_PROCESS_PARAMETERS
182 {
183 ULONG AllocationSize;
184 ULONG Size;
185 ULONG Flags;
186 ULONG DebugFlags;
187 HANDLE ConsoleHandle;
188 ULONG ConsoleFlags;
189 HANDLE hStdInput;
190 HANDLE hStdOutput;
191 HANDLE hStdError;
192 CURDIR CurrentDirectory;
193 UNICODE_STRING DllPath;
194 UNICODE_STRING ImagePathName;
195 UNICODE_STRING CommandLine;
196 PWSTR Environment;
197 ULONG dwX;
198 ULONG dwY;
199 ULONG dwXSize;
200 ULONG dwYSize;
201 ULONG dwXCountChars;
202 ULONG dwYCountChars;
203 ULONG dwFillAttribute;
204 ULONG dwFlags;
205 ULONG wShowWindow;
206 UNICODE_STRING WindowTitle;
207 UNICODE_STRING Desktop;
208 UNICODE_STRING ShellInfo;
209 UNICODE_STRING RuntimeInfo;
210 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
211 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
212
213 /* value for Flags field (FIXME: not the correct name) */
214 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
215
216 typedef struct _PEB_LDR_DATA
217 {
218 ULONG Length;
219 BOOLEAN Initialized;
220 PVOID SsHandle;
221 LIST_ENTRY InLoadOrderModuleList;
222 LIST_ENTRY InMemoryOrderModuleList;
223 LIST_ENTRY InInitializationOrderModuleList;
224 PVOID EntryInProgress;
225 } PEB_LDR_DATA, *PPEB_LDR_DATA;
226
227 typedef struct _GDI_TEB_BATCH
228 {
229 ULONG Offset;
230 HANDLE HDC;
231 ULONG Buffer[0x136];
232 } GDI_TEB_BATCH;
233
234 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
235 {
236 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
237 struct _ACTIVATION_CONTEXT *ActivationContext;
238 ULONG Flags;
239 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
240
241 typedef struct _ACTIVATION_CONTEXT_STACK
242 {
243 ULONG Flags;
244 ULONG NextCookieSequenceNumber;
245 RTL_ACTIVATION_CONTEXT_STACK_FRAME *ActiveFrame;
246 LIST_ENTRY FrameListCache;
247 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
248
249 /***********************************************************************
250 * PEB data structure
251 */
252 typedef struct _PEB
253 { /* win32/win64 */
254 BOOLEAN InheritedAddressSpace; /* 000/000 */
255 BOOLEAN ReadImageFileExecOptions; /* 001/001 */
256 BOOLEAN BeingDebugged; /* 002/002 */
257 BOOLEAN SpareBool; /* 003/003 */
258 HANDLE Mutant; /* 004/008 */
259 HMODULE ImageBaseAddress; /* 008/010 */
260 PPEB_LDR_DATA LdrData; /* 00c/018 */
261 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 010/020 */
262 PVOID SubSystemData; /* 014/028 */
263 HANDLE ProcessHeap; /* 018/030 */
264 PRTL_CRITICAL_SECTION FastPebLock; /* 01c/038 */
265 PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 020/040 */
266 PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 024/048 */
267 ULONG EnvironmentUpdateCount; /* 028/050 */
268 PVOID KernelCallbackTable; /* 02c/058 */
269 ULONG Reserved[2]; /* 030/060 */
270 PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 038/068 */
271 ULONG TlsExpansionCounter; /* 03c/070 */
272 PRTL_BITMAP TlsBitmap; /* 040/078 */
273 ULONG TlsBitmapBits[2]; /* 044/080 */
274 PVOID ReadOnlySharedMemoryBase; /* 04c/088 */
275 PVOID ReadOnlySharedMemoryHeap; /* 050/090 */
276 PVOID *ReadOnlyStaticServerData; /* 054/098 */
277 PVOID AnsiCodePageData; /* 058/0a0 */
278 PVOID OemCodePageData; /* 05c/0a8 */
279 PVOID UnicodeCaseTableData; /* 060/0b0 */
280 ULONG NumberOfProcessors; /* 064/0b8 */
281 ULONG NtGlobalFlag; /* 068/0bc */
282 LARGE_INTEGER CriticalSectionTimeout; /* 070/0c0 */
283 SIZE_T HeapSegmentReserve; /* 078/0c8 */
284 SIZE_T HeapSegmentCommit; /* 07c/0d0 */
285 SIZE_T HeapDeCommitTotalFreeThreshold; /* 080/0d8 */
286 SIZE_T HeapDeCommitFreeBlockThreshold; /* 084/0e0 */
287 ULONG NumberOfHeaps; /* 088/0e8 */
288 ULONG MaximumNumberOfHeaps; /* 08c/0ec */
289 PVOID *ProcessHeaps; /* 090/0f0 */
290 PVOID GdiSharedHandleTable; /* 094/0f8 */
291 PVOID ProcessStarterHelper; /* 098/100 */
292 PVOID GdiDCAttributeList; /* 09c/108 */
293 PVOID LoaderLock; /* 0a0/110 */
294 ULONG OSMajorVersion; /* 0a4/118 */
295 ULONG OSMinorVersion; /* 0a8/11c */
296 ULONG OSBuildNumber; /* 0ac/120 */
297 ULONG OSPlatformId; /* 0b0/124 */
298 ULONG ImageSubSystem; /* 0b4/128 */
299 ULONG ImageSubSystemMajorVersion; /* 0b8/12c */
300 ULONG ImageSubSystemMinorVersion; /* 0bc/130 */
301 ULONG ImageProcessAffinityMask; /* 0c0/134 */
302 HANDLE GdiHandleBuffer[28]; /* 0c4/138 */
303 ULONG unknown[6]; /* 134/218 */
304 PVOID PostProcessInitRoutine; /* 14c/230 */
305 PRTL_BITMAP TlsExpansionBitmap; /* 150/238 */
306 ULONG TlsExpansionBitmapBits[32]; /* 154/240 */
307 ULONG SessionId; /* 1d4/2c0 */
308 ULARGE_INTEGER AppCompatFlags; /* 1d8/2c8 */
309 ULARGE_INTEGER AppCompatFlagsUser; /* 1e0/2d0 */
310 PVOID ShimData; /* 1e8/2d8 */
311 PVOID AppCompatInfo; /* 1ec/2e0 */
312 UNICODE_STRING CSDVersion; /* 1f0/2e8 */
313 PVOID ActivationContextData; /* 1f8/2f8 */
314 PVOID ProcessAssemblyStorageMap; /* 1fc/300 */
315 PVOID SystemDefaultActivationData; /* 200/308 */
316 PVOID SystemAssemblyStorageMap; /* 204/310 */
317 SIZE_T MinimumStackCommit; /* 208/318 */
318 PVOID *FlsCallback; /* 20c/320 */
319 LIST_ENTRY FlsListHead; /* 210/328 */
320 PRTL_BITMAP FlsBitmap; /* 218/338 */
321 ULONG FlsBitmapBits[4]; /* 21c/340 */
322 } PEB, *PPEB;
323
324
325 /***********************************************************************
326 * TEB data structure
327 */
328 typedef struct _TEB
329 { /* win32/win64 */
330 NT_TIB Tib; /* 000/0000 */
331 PVOID EnvironmentPointer; /* 01c/0038 */
332 CLIENT_ID ClientId; /* 020/0040 */
333 PVOID ActiveRpcHandle; /* 028/0050 */
334 PVOID ThreadLocalStoragePointer; /* 02c/0058 */
335 PPEB Peb; /* 030/0060 */
336 ULONG LastErrorValue; /* 034/0068 */
337 ULONG CountOfOwnedCriticalSections; /* 038/006c */
338 PVOID CsrClientThread; /* 03c/0070 */
339 PVOID Win32ThreadInfo; /* 040/0078 */
340 ULONG Win32ClientInfo[31]; /* 044/0080 used for user32 private data in Wine */
341 PVOID WOW32Reserved; /* 0c0/0100 */
342 ULONG CurrentLocale; /* 0c4/0108 */
343 ULONG FpSoftwareStatusRegister; /* 0c8/010c */
344 PVOID SystemReserved1[54]; /* 0cc/0110 used for kernel32 private data in Wine */
345 LONG ExceptionCode; /* 1a4/02c0 */
346 ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8/02c8 */
347 BYTE SpareBytes1[24]; /* 1bc/02e8 used for ntdll private data in Wine */
348 PVOID SystemReserved2[10]; /* 1d4/0300 used for ntdll private data in Wine */
349 GDI_TEB_BATCH GdiTebBatch; /* 1fc/0350 used for vm86 private data in Wine */
350 HANDLE gdiRgn; /* 6dc/0838 */
351 HANDLE gdiPen; /* 6e0/0840 */
352 HANDLE gdiBrush; /* 6e4/0848 */
353 CLIENT_ID RealClientId; /* 6e8/0850 */
354 HANDLE GdiCachedProcessHandle; /* 6f0/0860 */
355 ULONG GdiClientPID; /* 6f4/0868 */
356 ULONG GdiClientTID; /* 6f8/086c */
357 PVOID GdiThreadLocaleInfo; /* 6fc/0870 */
358 ULONG UserReserved[5]; /* 700/0878 */
359 PVOID glDispatchTable[280]; /* 714/0890 */
360 PVOID glReserved1[26]; /* b74/1150 */
361 PVOID glReserved2; /* bdc/1220 */
362 PVOID glSectionInfo; /* be0/1228 */
363 PVOID glSection; /* be4/1230 */
364 PVOID glTable; /* be8/1238 */
365 PVOID glCurrentRC; /* bec/1240 */
366 PVOID glContext; /* bf0/1248 */
367 ULONG LastStatusValue; /* bf4/1250 */
368 UNICODE_STRING StaticUnicodeString; /* bf8/1258 used by advapi32 */
369 WCHAR StaticUnicodeBuffer[261]; /* c00/1268 used by advapi32 */
370 PVOID DeallocationStack; /* e0c/1478 */
371 PVOID TlsSlots[64]; /* e10/1480 */
372 LIST_ENTRY TlsLinks; /* f10/1680 */
373 PVOID Vdm; /* f18/1690 */
374 PVOID ReservedForNtRpc; /* f1c/1698 */
375 PVOID DbgSsReserved[2]; /* f20/16a0 */
376 ULONG HardErrorDisabled; /* f28/16b0 */
377 PVOID Instrumentation[16]; /* f2c/16b8 */
378 PVOID WinSockData; /* f6c/1738 */
379 ULONG GdiBatchCount; /* f70/1740 */
380 ULONG Spare2; /* f74/1744 */
381 PVOID Spare3; /* f78/1748 */
382 PVOID Spare4; /* f7c/1750 */
383 PVOID ReservedForOle; /* f80/1758 */
384 ULONG WaitingOnLoaderLock; /* f84/1760 */
385 PVOID Reserved5[3]; /* f88/1768 used for x86_64 OSX and wineserver shared memory */
386 PVOID *TlsExpansionSlots; /* f94/1780 */
387 ULONG ImpersonationLocale; /* f98/1788 */
388 ULONG IsImpersonating; /* f9c/178c */
389 PVOID NlsCache; /* fa0/1790 */
390 PVOID ShimData; /* fa4/1798 */
391 ULONG HeapVirtualAffinity; /* fa8/17a0 */
392 PVOID CurrentTransactionHandle; /* fac/17a8 */
393 PVOID ActiveFrame; /* fb0/17b0 */
394 #ifdef _WIN64
395 PVOID unknown[2]; /* 17b8 */
396 #endif
397 PVOID *FlsSlots; /* fb4/17c8 */
398 } TEB, *PTEB;
399
400 /***********************************************************************
401 * Enums
402 */
403
404 typedef enum _FILE_INFORMATION_CLASS {
405 FileDirectoryInformation = 1,
406 FileFullDirectoryInformation,
407 FileBothDirectoryInformation,
408 FileBasicInformation,
409 FileStandardInformation,
410 FileInternalInformation,
411 FileEaInformation,
412 FileAccessInformation,
413 FileNameInformation,
414 FileRenameInformation,
415 FileLinkInformation,
416 FileNamesInformation,
417 FileDispositionInformation,
418 FilePositionInformation,
419 FileFullEaInformation,
420 FileModeInformation,
421 FileAlignmentInformation,
422 FileAllInformation,
423 FileAllocationInformation,
424 FileEndOfFileInformation,
425 FileAlternateNameInformation,
426 FileStreamInformation,
427 FilePipeInformation,
428 FilePipeLocalInformation,
429 FilePipeRemoteInformation,
430 FileMailslotQueryInformation,
431 FileMailslotSetInformation,
432 FileCompressionInformation,
433 FileObjectIdInformation,
434 FileCompletionInformation,
435 FileMoveClusterInformation,
436 FileQuotaInformation,
437 FileReparsePointInformation,
438 FileNetworkOpenInformation,
439 FileAttributeTagInformation,
440 FileTrackingInformation,
441 FileIdBothDirectoryInformation,
442 FileIdFullDirectoryInformation,
443 FileValidDataLengthInformation,
444 FileShortNameInformation,
445 FileIoCompletionNotificationInformation,
446 FileIoStatusBlockRangeInformation,
447 FileIoPriorityHintInformation,
448 FileSfioReserveInformation,
449 FileSfioVolumeInformation,
450 FileHardLinkInformation,
451 FileProcessIdsUsingFileInformation,
452 FileNormalizedNameInformation,
453 FileNetworkPhysicalNameInformation,
454 FileIdGlobalTxDirectoryInformation,
455 FileIsRemoteDeviceInformation,
456 FileAttributeCacheInformation,
457 FileNumaNodeInformation,
458 FileStandardLinkInformation,
459 FileRemoteProtocolInformation,
460 FileRenameInformationBypassAccessCheck,
461 FileLinkInformationBypassAccessCheck,
462 FileVolumeNameInformation,
463 FileIdInformation,
464 FileIdExtdDirectoryInformation,
465 FileReplaceCompletionInformation,
466 FileHardLinkFullIdInformation,
467 FileIdExtdBothDirectoryInformation,
468 FileMaximumInformation
469 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
470
471 typedef struct _FILE_DIRECTORY_INFORMATION {
472 ULONG NextEntryOffset;
473 ULONG FileIndex;
474 LARGE_INTEGER CreationTime;
475 LARGE_INTEGER LastAccessTime;
476 LARGE_INTEGER LastWriteTime;
477 LARGE_INTEGER ChangeTime;
478 LARGE_INTEGER EndOfFile;
479 LARGE_INTEGER AllocationSize;
480 ULONG FileAttributes;
481 ULONG FileNameLength;
482 WCHAR FileName[ANYSIZE_ARRAY];
483 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
484
485 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
486 ULONG NextEntryOffset;
487 ULONG FileIndex;
488 LARGE_INTEGER CreationTime;
489 LARGE_INTEGER LastAccessTime;
490 LARGE_INTEGER LastWriteTime;
491 LARGE_INTEGER ChangeTime;
492 LARGE_INTEGER EndOfFile;
493 LARGE_INTEGER AllocationSize;
494 ULONG FileAttributes;
495 ULONG FileNameLength;
496 ULONG EaSize;
497 WCHAR FileName[ANYSIZE_ARRAY];
498 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
499 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
500
501 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
502 ULONG NextEntryOffset;
503 ULONG FileIndex;
504 LARGE_INTEGER CreationTime;
505 LARGE_INTEGER LastAccessTime;
506 LARGE_INTEGER LastWriteTime;
507 LARGE_INTEGER ChangeTime;
508 LARGE_INTEGER EndOfFile;
509 LARGE_INTEGER AllocationSize;
510 ULONG FileAttributes;
511 ULONG FileNameLength;
512 ULONG EaSize;
513 LARGE_INTEGER FileId;
514 WCHAR FileName[ANYSIZE_ARRAY];
515 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
516
517 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
518 ULONG NextEntryOffset;
519 ULONG FileIndex;
520 LARGE_INTEGER CreationTime;
521 LARGE_INTEGER LastAccessTime;
522 LARGE_INTEGER LastWriteTime;
523 LARGE_INTEGER ChangeTime;
524 LARGE_INTEGER EndOfFile;
525 LARGE_INTEGER AllocationSize;
526 ULONG FileAttributes;
527 ULONG FileNameLength;
528 ULONG EaSize;
529 CHAR ShortNameLength;
530 WCHAR ShortName[12];
531 WCHAR FileName[ANYSIZE_ARRAY];
532 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
533 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
534
535 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
536 ULONG NextEntryOffset;
537 ULONG FileIndex;
538 LARGE_INTEGER CreationTime;
539 LARGE_INTEGER LastAccessTime;
540 LARGE_INTEGER LastWriteTime;
541 LARGE_INTEGER ChangeTime;
542 LARGE_INTEGER EndOfFile;
543 LARGE_INTEGER AllocationSize;
544 ULONG FileAttributes;
545 ULONG FileNameLength;
546 ULONG EaSize;
547 CHAR ShortNameLength;
548 WCHAR ShortName[12];
549 LARGE_INTEGER FileId;
550 WCHAR FileName[ANYSIZE_ARRAY];
551 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
552
553 typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
554 ULONG NextEntryOffset;
555 ULONG FileIndex;
556 LARGE_INTEGER CreationTime;
557 LARGE_INTEGER LastAccessTime;
558 LARGE_INTEGER LastWriteTime;
559 LARGE_INTEGER ChangeTime;
560 LARGE_INTEGER EndOfFile;
561 LARGE_INTEGER AllocationSize;
562 ULONG FileAttributes;
563 ULONG FileNameLength;
564 LARGE_INTEGER FileId;
565 GUID LockingTransactionId;
566 ULONG TxInfoFlags;
567 WCHAR FileName[ANYSIZE_ARRAY];
568 } FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
569
570 typedef struct _FILE_BASIC_INFORMATION {
571 LARGE_INTEGER CreationTime;
572 LARGE_INTEGER LastAccessTime;
573 LARGE_INTEGER LastWriteTime;
574 LARGE_INTEGER ChangeTime;
575 ULONG FileAttributes;
576 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
577
578 typedef struct _FILE_STANDARD_INFORMATION {
579 LARGE_INTEGER AllocationSize;
580 LARGE_INTEGER EndOfFile;
581 ULONG NumberOfLinks;
582 BOOLEAN DeletePending;
583 BOOLEAN Directory;
584 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
585
586 typedef struct _FILE_INTERNAL_INFORMATION {
587 LARGE_INTEGER IndexNumber;
588 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
589
590 typedef struct _FILE_ID_128 {
591 UCHAR Identifier[16];
592 } FILE_ID_128, *PFILE_ID_128;
593
594 typedef struct _FILE_ID_INFORMATION {
595 ULONGLONG VolumeSerialNumber;
596 FILE_ID_128 FileId;
597 } FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
598
599 typedef struct _FILE_EA_INFORMATION {
600 ULONG EaSize;
601 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
602
603 typedef struct _FILE_ACCESS_INFORMATION {
604 ACCESS_MASK AccessFlags;
605 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
606
607 typedef struct _FILE_NAME_INFORMATION {
608 ULONG FileNameLength;
609 WCHAR FileName[1];
610 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
611
612 typedef struct _FILE_RENAME_INFORMATION {
613 BOOLEAN Replace;
614 HANDLE RootDir;
615 ULONG FileNameLength;
616 WCHAR FileName[1];
617 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
618
619 typedef struct _FILE_LINK_INFORMATION {
620 BOOLEAN ReplaceIfExists;
621 HANDLE RootDirectory;
622 ULONG FileNameLength;
623 WCHAR FileName[1];
624 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
625
626 typedef struct _FILE_NAMES_INFORMATION {
627 ULONG NextEntryOffset;
628 ULONG FileIndex;
629 ULONG FileNameLength;
630 WCHAR FileName[1];
631 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
632
633 typedef struct _FILE_DISPOSITION_INFORMATION {
634 BOOLEAN DoDeleteFile;
635 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
636
637 typedef struct _FILE_POSITION_INFORMATION {
638 LARGE_INTEGER CurrentByteOffset;
639 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
640
641 typedef struct _FILE_ALIGNMENT_INFORMATION {
642 ULONG AlignmentRequirement;
643 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
644
645 typedef struct _FILE_ALLOCATION_INFORMATION {
646 LARGE_INTEGER AllocationSize;
647 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
648
649 typedef struct _FILE_END_OF_FILE_INFORMATION {
650 LARGE_INTEGER EndOfFile;
651 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
652
653 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
654 LARGE_INTEGER CreationTime;
655 LARGE_INTEGER LastAccessTime;
656 LARGE_INTEGER LastWriteTime;
657 LARGE_INTEGER ChangeTime;
658 LARGE_INTEGER AllocationSize;
659 LARGE_INTEGER EndOfFile;
660 ULONG FileAttributes;
661 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
662
663 typedef struct _FILE_FULL_EA_INFORMATION {
664 ULONG NextEntryOffset;
665 UCHAR Flags;
666 UCHAR EaNameLength;
667 USHORT EaValueLength;
668 CHAR EaName[1];
669 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
670
671 typedef struct _FILE_MODE_INFORMATION {
672 ULONG Mode;
673 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
674
675 typedef struct _FILE_STREAM_INFORMATION
676 {
677 ULONG NextEntryOffset;
678 ULONG StreamNameLength;
679 LARGE_INTEGER StreamSize;
680 LARGE_INTEGER StreamAllocationSize;
681 WCHAR StreamName[1];
682 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
683
684 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
685 {
686 ULONG FileAttributes;
687 ULONG ReparseTag;
688 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
689
690 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
691 ULONG MaximumMessageSize;
692 ULONG MailslotQuota;
693 ULONG NextMessageSize;
694 ULONG MessagesAvailable;
695 LARGE_INTEGER ReadTimeout;
696 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
697
698 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
699 LARGE_INTEGER ReadTimeout;
700 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
701
702 typedef struct _FILE_PIPE_INFORMATION {
703 ULONG ReadMode;
704 ULONG CompletionMode;
705 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
706
707 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
708 ULONG NamedPipeType;
709 ULONG NamedPipeConfiguration;
710 ULONG MaximumInstances;
711 ULONG CurrentInstances;
712 ULONG InboundQuota;
713 ULONG ReadDataAvailable;
714 ULONG OutboundQuota;
715 ULONG WriteQuotaAvailable;
716 ULONG NamedPipeState;
717 ULONG NamedPipeEnd;
718 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
719
720 typedef struct _FILE_OBJECTID_INFORMATION {
721 LONGLONG FileReference;
722 UCHAR ObjectId[16];
723 union {
724 struct {
725 UCHAR BirthVolumeId[16];
726 UCHAR BirthObjectId[16];
727 UCHAR DomainId[16];
728 } DUMMYSTRUCTNAME;
729 UCHAR ExtendedInfo[48];
730 } DUMMYUNIONNAME;
731 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
732
733 typedef struct _FILE_QUOTA_INFORMATION {
734 ULONG NextEntryOffset;
735 ULONG SidLength;
736 LARGE_INTEGER ChangeTime;
737 LARGE_INTEGER QuotaUsed;
738 LARGE_INTEGER QuotaThreshold;
739 LARGE_INTEGER QuotaLimit;
740 SID Sid;
741 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
742
743 typedef struct _FILE_REPARSE_POINT_INFORMATION {
744 LONGLONG FileReference;
745 ULONG Tag;
746 } FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
747
748 #define FILE_PIPE_DISCONNECTED_STATE 0x01
749 #define FILE_PIPE_LISTENING_STATE 0x02
750 #define FILE_PIPE_CONNECTED_STATE 0x03
751 #define FILE_PIPE_CLOSING_STATE 0x04
752
753 typedef struct _FILE_ALL_INFORMATION {
754 FILE_BASIC_INFORMATION BasicInformation;
755 FILE_STANDARD_INFORMATION StandardInformation;
756 FILE_INTERNAL_INFORMATION InternalInformation;
757 FILE_EA_INFORMATION EaInformation;
758 FILE_ACCESS_INFORMATION AccessInformation;
759 FILE_POSITION_INFORMATION PositionInformation;
760 FILE_MODE_INFORMATION ModeInformation;
761 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
762 FILE_NAME_INFORMATION NameInformation;
763 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
764
765 typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
766 ULONG Flags;
767 } FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION;
768
769 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
770 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
771 #define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
772
773 typedef enum _FSINFOCLASS {
774 FileFsVolumeInformation = 1,
775 FileFsLabelInformation,
776 FileFsSizeInformation,
777 FileFsDeviceInformation,
778 FileFsAttributeInformation,
779 FileFsControlInformation,
780 FileFsFullSizeInformation,
781 FileFsObjectIdInformation,
782 FileFsMaximumInformation
783 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
784
785 typedef enum _KEY_INFORMATION_CLASS {
786 KeyBasicInformation,
787 KeyNodeInformation,
788 KeyFullInformation,
789 KeyNameInformation,
790 KeyCachedInformation,
791 KeyFlagsInformation,
792 KeyVirtualizationInformation,
793 KeyHandleTagsInformation,
794 MaxKeyInfoClass
795 } KEY_INFORMATION_CLASS;
796
797 typedef enum _KEY_VALUE_INFORMATION_CLASS {
798 KeyValueBasicInformation,
799 KeyValueFullInformation,
800 KeyValuePartialInformation,
801 KeyValueFullInformationAlign64,
802 KeyValuePartialInformationAlign64
803 } KEY_VALUE_INFORMATION_CLASS;
804
805 typedef enum _OBJECT_INFORMATION_CLASS {
806 ObjectBasicInformation,
807 ObjectNameInformation,
808 ObjectTypeInformation,
809 ObjectTypesInformation,
810 ObjectDataInformation
811 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
812
813 typedef enum _PROCESSINFOCLASS {
814 ProcessBasicInformation = 0,
815 ProcessQuotaLimits = 1,
816 ProcessIoCounters = 2,
817 ProcessVmCounters = 3,
818 ProcessTimes = 4,
819 ProcessBasePriority = 5,
820 ProcessRaisePriority = 6,
821 ProcessDebugPort = 7,
822 ProcessExceptionPort = 8,
823 ProcessAccessToken = 9,
824 ProcessLdtInformation = 10,
825 ProcessLdtSize = 11,
826 ProcessDefaultHardErrorMode = 12,
827 ProcessIoPortHandlers = 13,
828 ProcessPooledUsageAndLimits = 14,
829 ProcessWorkingSetWatch = 15,
830 ProcessUserModeIOPL = 16,
831 ProcessEnableAlignmentFaultFixup = 17,
832 ProcessPriorityClass = 18,
833 ProcessWx86Information = 19,
834 ProcessHandleCount = 20,
835 ProcessAffinityMask = 21,
836 ProcessPriorityBoost = 22,
837 ProcessDeviceMap = 23,
838 ProcessSessionInformation = 24,
839 ProcessForegroundInformation = 25,
840 ProcessWow64Information = 26,
841 ProcessImageFileName = 27,
842 ProcessLUIDDeviceMapsEnabled = 28,
843 ProcessBreakOnTermination = 29,
844 ProcessDebugObjectHandle = 30,
845 ProcessDebugFlags = 31,
846 ProcessHandleTracing = 32,
847 ProcessExecuteFlags = 34,
848 ProcessTlsInformation = 35,
849 ProcessCookie = 36,
850 ProcessImageInformation = 37,
851 ProcessCycleTime = 38,
852 ProcessPagePriority = 39,
853 ProcessInstrumentationCallback = 40,
854 ProcessThreadStackAllocation = 41,
855 ProcessWorkingSetWatchEx = 42,
856 ProcessImageFileNameWin32 = 43,
857 ProcessImageFileMapping = 44,
858 ProcessAffinityUpdateMode = 45,
859 ProcessMemoryAllocationMode = 46,
860 ProcessGroupInformation = 47,
861 ProcessTokenVirtualizationEnabled = 48,
862 ProcessConsoleHostProcess = 49,
863 ProcessWindowInformation = 50,
864 MaxProcessInfoClass
865 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
866
867 #define MEM_EXECUTE_OPTION_DISABLE 0x01
868 #define MEM_EXECUTE_OPTION_ENABLE 0x02
869 #define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
870 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
871
872 typedef enum _SECTION_INHERIT {
873 ViewShare = 1,
874 ViewUnmap = 2
875 } SECTION_INHERIT;
876
877 typedef enum _SYSTEM_INFORMATION_CLASS {
878 SystemBasicInformation = 0,
879 SystemCpuInformation = 1,
880 SystemPerformanceInformation = 2,
881 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
882 Unknown4,
883 SystemProcessInformation = 5,
884 Unknown6,
885 Unknown7,
886 SystemProcessorPerformanceInformation = 8,
887 Unknown9,
888 Unknown10,
889 SystemModuleInformation = 11,
890 Unknown12,
891 Unknown13,
892 Unknown14,
893 Unknown15,
894 SystemHandleInformation = 16,
895 Unknown17,
896 SystemPageFileInformation = 18,
897 Unknown19,
898 Unknown20,
899 SystemCacheInformation = 21,
900 Unknown22,
901 SystemInterruptInformation = 23,
902 SystemDpcBehaviourInformation = 24,
903 SystemFullMemoryInformation = 25,
904 SystemNotImplemented6 = 25,
905 SystemLoadImage = 26,
906 SystemUnloadImage = 27,
907 SystemTimeAdjustmentInformation = 28,
908 SystemTimeAdjustment = 28,
909 SystemSummaryMemoryInformation = 29,
910 SystemNotImplemented7 = 29,
911 SystemNextEventIdInformation = 30,
912 SystemNotImplemented8 = 30,
913 SystemEventIdsInformation = 31,
914 SystemCrashDumpInformation = 32,
915 SystemExceptionInformation = 33,
916 SystemCrashDumpStateInformation = 34,
917 SystemKernelDebuggerInformation = 35,
918 SystemContextSwitchInformation = 36,
919 SystemRegistryQuotaInformation = 37,
920 SystemCurrentTimeZoneInformation = 44,
921 SystemTimeZoneInformation = 44,
922 SystemLookasideInformation = 45,
923 SystemSetTimeSlipEvent = 46,
924 SystemCreateSession = 47,
925 SystemDeleteSession = 48,
926 SystemInvalidInfoClass4 = 49,
927 SystemRangeStartInformation = 50,
928 SystemVerifierInformation = 51,
929 SystemAddVerifier = 52,
930 SystemSessionProcessesInformation = 53,
931 SystemLoadGdiDriverInSystemSpace = 54,
932 SystemNumaProcessorMap = 55,
933 SystemPrefetcherInformation = 56,
934 SystemExtendedProcessInformation = 57,
935 SystemRecommendedSharedDataAlignment = 58,
936 SystemComPlusPackage = 59,
937 SystemNumaAvailableMemory = 60,
938 SystemProcessorPowerInformation = 61,
939 SystemEmulationBasicInformation = 62,
940 SystemEmulationProcessorInformation = 63,
941 SystemExtendedHandleInformation = 64,
942 SystemLostDelayedWriteInformation = 65,
943 SystemBigPoolInformation = 66,
944 SystemSessionPoolTagInformation = 67,
945 SystemSessionMappedViewInformation = 68,
946 SystemHotpatchInformation = 69,
947 SystemObjectSecurityMode = 70,
948 SystemWatchdogTimerHandler = 71,
949 SystemWatchdogTimerInformation = 72,
950 SystemLogicalProcessorInformation = 73,
951 SystemWow64SharedInformation = 74,
952 SystemRegisterFirmwareTableInformationHandler = 75,
953 SystemFirmwareTableInformation = 76,
954 SystemModuleInformationEx = 77,
955 SystemVerifierTriageInformation = 78,
956 SystemSuperfetchInformation = 79,
957 SystemMemoryListInformation = 80,
958 SystemFileCacheInformationEx = 81,
959 SystemLogicalProcessorInformationEx = 107,
960 SystemInformationClassMax
961 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
962
963 typedef enum _THREADINFOCLASS {
964 ThreadBasicInformation,
965 ThreadTimes,
966 ThreadPriority,
967 ThreadBasePriority,
968 ThreadAffinityMask,
969 ThreadImpersonationToken,
970 ThreadDescriptorTableEntry,
971 ThreadEnableAlignmentFaultFixup,
972 ThreadEventPair_Reusable,
973 ThreadQuerySetWin32StartAddress,
974 ThreadZeroTlsCell,
975 ThreadPerformanceCount,
976 ThreadAmILastThread,
977 ThreadIdealProcessor,
978 ThreadPriorityBoost,
979 ThreadSetTlsArrayAddress,
980 ThreadIsIoPending,
981 ThreadHideFromDebugger,
982 ThreadBreakOnTermination,
983 ThreadSwitchLegacyState,
984 ThreadIsTerminated,
985 ThreadLastSystemCall,
986 ThreadIoPriority,
987 ThreadCycleTime,
988 ThreadPagePriority,
989 ThreadActualBasePriority,
990 ThreadTebInformation,
991 ThreadCSwitchMon,
992 ThreadCSwitchPmu,
993 ThreadWow64Context,
994 ThreadGroupInformation,
995 ThreadUmsInformation,
996 ThreadCounterProfiling,
997 ThreadIdealProcessorEx,
998 MaxThreadInfoClass
999 } THREADINFOCLASS;
1000
1001 typedef struct _THREAD_BASIC_INFORMATION
1002 {
1003 NTSTATUS ExitStatus;
1004 PVOID TebBaseAddress;
1005 CLIENT_ID ClientId;
1006 ULONG_PTR AffinityMask;
1007 LONG Priority;
1008 LONG BasePriority;
1009 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
1010
1011 typedef struct _THREAD_DESCRIPTOR_INFORMATION
1012 {
1013 DWORD Selector;
1014 LDT_ENTRY Entry;
1015 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
1016
1017 typedef struct _KERNEL_USER_TIMES {
1018 LARGE_INTEGER CreateTime;
1019 LARGE_INTEGER ExitTime;
1020 LARGE_INTEGER KernelTime;
1021 LARGE_INTEGER UserTime;
1022 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
1023
1024 typedef enum _WINSTATIONINFOCLASS {
1025 WinStationInformation = 8
1026 } WINSTATIONINFOCLASS;
1027
1028 typedef enum _MEMORY_INFORMATION_CLASS {
1029 MemoryBasicInformation,
1030 MemoryWorkingSetList,
1031 MemorySectionName,
1032 MemoryBasicVlmInformation
1033 } MEMORY_INFORMATION_CLASS;
1034
1035 typedef struct _MEMORY_SECTION_NAME
1036 {
1037 UNICODE_STRING SectionFileName;
1038 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
1039
1040 typedef enum _MUTANT_INFORMATION_CLASS
1041 {
1042 MutantBasicInformation
1043 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
1044
1045 typedef struct _MUTANT_BASIC_INFORMATION {
1046 LONG CurrentCount;
1047 BOOLEAN OwnedByCaller;
1048 BOOLEAN AbandonedState;
1049 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
1050
1051 typedef enum _TIMER_INFORMATION_CLASS
1052 {
1053 TimerBasicInformation = 0
1054 } TIMER_INFORMATION_CLASS;
1055
1056 typedef struct _TIMER_BASIC_INFORMATION
1057 {
1058 LARGE_INTEGER RemainingTime;
1059 BOOLEAN TimerState;
1060 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
1061
1062
1063 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
1064 typedef enum
1065 {
1066 INVALID_PATH = 0,
1067 UNC_PATH, /* "//foo" */
1068 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
1069 RELATIVE_DRIVE_PATH, /* "c:foo" */
1070 ABSOLUTE_PATH, /* "/foo" */
1071 RELATIVE_PATH, /* "foo" */
1072 DEVICE_PATH, /* "//./foo" */
1073 UNC_DOT_PATH /* "//." */
1074 } DOS_PATHNAME_TYPE;
1075
1076
1077 /***********************************************************************
1078 * Types and data structures
1079 */
1080
1081 /* This is used by NtQuerySystemInformation */
1082 typedef struct _SYSTEM_THREAD_INFORMATION
1083 { /* win32/win64 */
1084 LARGE_INTEGER KernelTime; /* 00/00 */
1085 LARGE_INTEGER UserTime; /* 08/08 */
1086 LARGE_INTEGER CreateTime; /* 10/10 */
1087 DWORD dwTickCount; /* 18/18 */
1088 LPVOID StartAddress; /* 1c/20 */
1089 CLIENT_ID ClientId; /* 20/28 */
1090 DWORD dwCurrentPriority; /* 28/38 */
1091 DWORD dwBasePriority; /* 2c/3c */
1092 DWORD dwContextSwitches; /* 30/40 */
1093 DWORD dwThreadState; /* 34/44 */
1094 DWORD dwWaitReason; /* 38/48 */
1095 DWORD dwUnknown; /* 3c/4c */
1096 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
1097
1098 typedef struct _IO_STATUS_BLOCK {
1099 union {
1100 NTSTATUS Status;
1101 PVOID Pointer;
1102 } DUMMYUNIONNAME;
1103
1104 ULONG_PTR Information;
1105 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
1106
1107 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
1108
1109 typedef struct _KEY_BASIC_INFORMATION {
1110 LARGE_INTEGER LastWriteTime;
1111 ULONG TitleIndex;
1112 ULONG NameLength;
1113 WCHAR Name[1];
1114 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
1115
1116 typedef struct _KEY_NODE_INFORMATION
1117 {
1118 LARGE_INTEGER LastWriteTime;
1119 ULONG TitleIndex;
1120 ULONG ClassOffset;
1121 ULONG ClassLength;
1122 ULONG NameLength;
1123 WCHAR Name[1];
1124 /* Class[1]; */
1125 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
1126
1127 typedef struct _KEY_FULL_INFORMATION
1128 {
1129 LARGE_INTEGER LastWriteTime;
1130 ULONG TitleIndex;
1131 ULONG ClassOffset;
1132 ULONG ClassLength;
1133 ULONG SubKeys;
1134 ULONG MaxNameLen;
1135 ULONG MaxClassLen;
1136 ULONG Values;
1137 ULONG MaxValueNameLen;
1138 ULONG MaxValueDataLen;
1139 WCHAR Class[1];
1140 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
1141
1142 typedef struct _KEY_NAME_INFORMATION {
1143 ULONG NameLength;
1144 WCHAR Name[1];
1145 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
1146
1147 typedef struct _KEY_CACHED_INFORMATION
1148 {
1149 LARGE_INTEGER LastWriteTime;
1150 ULONG TitleIndex;
1151 ULONG SubKeys;
1152 ULONG MaxNameLen;
1153 ULONG Values;
1154 ULONG MaxValueNameLen;
1155 ULONG MaxValueDataLen;
1156 ULONG NameLength;
1157 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
1158
1159 typedef struct _KEY_VALUE_ENTRY
1160 {
1161 PUNICODE_STRING ValueName;
1162 ULONG DataLength;
1163 ULONG DataOffset;
1164 ULONG Type;
1165 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
1166
1167 typedef struct _KEY_VALUE_BASIC_INFORMATION {
1168 ULONG TitleIndex;
1169 ULONG Type;
1170 ULONG NameLength;
1171 WCHAR Name[1];
1172 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
1173
1174 typedef struct _KEY_VALUE_FULL_INFORMATION {
1175 ULONG TitleIndex;
1176 ULONG Type;
1177 ULONG DataOffset;
1178 ULONG DataLength;
1179 ULONG NameLength;
1180 WCHAR Name[1];
1181 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
1182
1183 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
1184 ULONG TitleIndex;
1185 ULONG Type;
1186 ULONG DataLength;
1187 UCHAR Data[1];
1188 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
1189
1190 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
1191 #define __OBJECT_ATTRIBUTES_DEFINED__
1192 typedef struct _OBJECT_ATTRIBUTES {
1193 ULONG Length;
1194 HANDLE RootDirectory;
1195 PUNICODE_STRING ObjectName;
1196 ULONG Attributes;
1197 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
1198 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
1199 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
1200 #endif
1201
1202 typedef struct _OBJECT_DATA_INFORMATION {
1203 BOOLEAN InheritHandle;
1204 BOOLEAN ProtectFromClose;
1205 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
1206
1207 typedef struct _OBJECT_BASIC_INFORMATION {
1208 ULONG Attributes;
1209 ACCESS_MASK GrantedAccess;
1210 ULONG HandleCount;
1211 ULONG PointerCount;
1212 ULONG PagedPoolUsage;
1213 ULONG NonPagedPoolUsage;
1214 ULONG Reserved[3];
1215 ULONG NameInformationLength;
1216 ULONG TypeInformationLength;
1217 ULONG SecurityDescriptorLength;
1218 LARGE_INTEGER CreateTime;
1219 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
1220
1221 typedef struct _OBJECT_NAME_INFORMATION {
1222 UNICODE_STRING Name;
1223 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
1224
1225 typedef struct __OBJECT_TYPE_INFORMATION {
1226 UNICODE_STRING TypeName;
1227 ULONG TotalNumberOfObjects;
1228 ULONG TotalNumberOfHandles;
1229 ULONG TotalPagedPoolUsage;
1230 ULONG TotalNonPagedPoolUsage;
1231 ULONG TotalNamePoolUsage;
1232 ULONG TotalHandleTableUsage;
1233 ULONG HighWaterNumberOfObjects;
1234 ULONG HighWaterNumberOfHandles;
1235 ULONG HighWaterPagedPoolUsage;
1236 ULONG HighWaterNonPagedPoolUsage;
1237 ULONG HighWaterNamePoolUsage;
1238 ULONG HighWaterHandleTableUsage;
1239 ULONG InvalidAttributes;
1240 GENERIC_MAPPING GenericMapping;
1241 ULONG ValidAccessMask;
1242 BOOLEAN SecurityRequired;
1243 BOOLEAN MaintainHandleCount;
1244 UCHAR TypeIndex;
1245 CHAR Reserved;
1246 ULONG PoolType;
1247 ULONG DefaultPagedPoolCharge;
1248 ULONG DefaultNonPagedPoolCharge;
1249 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
1250
1251 typedef struct _OBJECT_TYPES_INFORMATION
1252 {
1253 ULONG NumberOfTypes;
1254 } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;
1255
1256 typedef struct _PROCESS_BASIC_INFORMATION {
1257 #ifdef __WINESRC__
1258 DWORD_PTR ExitStatus;
1259 PPEB PebBaseAddress;
1260 DWORD_PTR AffinityMask;
1261 DWORD_PTR BasePriority;
1262 ULONG_PTR UniqueProcessId;
1263 ULONG_PTR InheritedFromUniqueProcessId;
1264 #else
1265 PVOID Reserved1;
1266 PPEB PebBaseAddress;
1267 PVOID Reserved2[2];
1268 ULONG_PTR UniqueProcessId;
1269 PVOID Reserved3;
1270 #endif
1271 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
1272
1273 #define PROCESS_PRIOCLASS_IDLE 1
1274 #define PROCESS_PRIOCLASS_NORMAL 2
1275 #define PROCESS_PRIOCLASS_HIGH 3
1276 #define PROCESS_PRIOCLASS_REALTIME 4
1277 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
1278 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
1279
1280 typedef struct _PROCESS_PRIORITY_CLASS {
1281 BOOLEAN Foreground;
1282 UCHAR PriorityClass;
1283 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
1284
1285 typedef struct _RTL_HEAP_DEFINITION {
1286 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
1287
1288 ULONG Unknown[11];
1289 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
1290
1291 typedef struct _RTL_RWLOCK {
1292 RTL_CRITICAL_SECTION rtlCS;
1293
1294 HANDLE hSharedReleaseSemaphore;
1295 UINT uSharedWaiters;
1296
1297 HANDLE hExclusiveReleaseSemaphore;
1298 UINT uExclusiveWaiters;
1299
1300 INT iNumberActive;
1301 HANDLE hOwningThreadId;
1302 DWORD dwTimeoutBoost;
1303 PVOID pDebugInfo;
1304 } RTL_RWLOCK, *LPRTL_RWLOCK;
1305
1306 /* System Information Class 0x00 */
1307
1308 typedef struct _SYSTEM_BASIC_INFORMATION {
1309 #ifdef __WINESRC__
1310 DWORD unknown;
1311 ULONG KeMaximumIncrement;
1312 ULONG PageSize;
1313 ULONG MmNumberOfPhysicalPages;
1314 ULONG MmLowestPhysicalPage;
1315 ULONG MmHighestPhysicalPage;
1316 ULONG_PTR AllocationGranularity;
1317 PVOID LowestUserAddress;
1318 PVOID HighestUserAddress;
1319 ULONG_PTR ActiveProcessorsAffinityMask;
1320 BYTE NumberOfProcessors;
1321 #else
1322 BYTE Reserved1[24];
1323 PVOID Reserved2[4];
1324 CCHAR NumberOfProcessors;
1325 #endif
1326 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
1327
1328 /* System Information Class 0x01 */
1329
1330 typedef struct _SYSTEM_CPU_INFORMATION {
1331 WORD Architecture;
1332 WORD Level;
1333 WORD Revision; /* combination of CPU model and stepping */
1334 WORD Reserved; /* always zero */
1335 DWORD FeatureSet; /* see bit flags below */
1336 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
1337
1338 /* definitions of bits in the Feature set for the x86 processors */
1339 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
1340 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
1341 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
1342 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
1343 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
1344 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
1345 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
1346 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
1347 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
1348 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
1349 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
1350 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
1351 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
1352 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
1353 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
1354 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
1355 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
1356
1357 /* System Information Class 0x02 */
1358
1359 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
1360 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1361 LARGE_INTEGER IdleTime;
1362 LARGE_INTEGER ReadTransferCount;
1363 LARGE_INTEGER WriteTransferCount;
1364 LARGE_INTEGER OtherTransferCount;
1365 ULONG ReadOperationCount;
1366 ULONG WriteOperationCount;
1367 ULONG OtherOperationCount;
1368 ULONG AvailablePages;
1369 ULONG TotalCommittedPages;
1370 ULONG TotalCommitLimit;
1371 ULONG PeakCommitment;
1372 ULONG PageFaults;
1373 ULONG WriteCopyFaults;
1374 ULONG TransitionFaults;
1375 ULONG Reserved1;
1376 ULONG DemandZeroFaults;
1377 ULONG PagesRead;
1378 ULONG PageReadIos;
1379 ULONG Reserved2[2];
1380 ULONG PagefilePagesWritten;
1381 ULONG PagefilePageWriteIos;
1382 ULONG MappedFilePagesWritten;
1383 ULONG MappedFilePageWriteIos;
1384 ULONG PagedPoolUsage;
1385 ULONG NonPagedPoolUsage;
1386 ULONG PagedPoolAllocs;
1387 ULONG PagedPoolFrees;
1388 ULONG NonPagedPoolAllocs;
1389 ULONG NonPagedPoolFrees;
1390 ULONG TotalFreeSystemPtes;
1391 ULONG SystemCodePage;
1392 ULONG TotalSystemDriverPages;
1393 ULONG TotalSystemCodePages;
1394 ULONG SmallNonPagedLookasideListAllocateHits;
1395 ULONG SmallPagedLookasideListAllocateHits;
1396 ULONG Reserved3;
1397 ULONG MmSystemCachePage;
1398 ULONG PagedPoolPage;
1399 ULONG SystemDriverPage;
1400 ULONG FastReadNoWait;
1401 ULONG FastReadWait;
1402 ULONG FastReadResourceMiss;
1403 ULONG FastReadNotPossible;
1404 ULONG FastMdlReadNoWait;
1405 ULONG FastMdlReadWait;
1406 ULONG FastMdlReadResourceMiss;
1407 ULONG FastMdlReadNotPossible;
1408 ULONG MapDataNoWait;
1409 ULONG MapDataWait;
1410 ULONG MapDataNoWaitMiss;
1411 ULONG MapDataWaitMiss;
1412 ULONG PinMappedDataCount;
1413 ULONG PinReadNoWait;
1414 ULONG PinReadWait;
1415 ULONG PinReadNoWaitMiss;
1416 ULONG PinReadWaitMiss;
1417 ULONG CopyReadNoWait;
1418 ULONG CopyReadWait;
1419 ULONG CopyReadNoWaitMiss;
1420 ULONG CopyReadWaitMiss;
1421 ULONG MdlReadNoWait;
1422 ULONG MdlReadWait;
1423 ULONG MdlReadNoWaitMiss;
1424 ULONG MdlReadWaitMiss;
1425 ULONG ReadAheadIos;
1426 ULONG LazyWriteIos;
1427 ULONG LazyWritePages;
1428 ULONG DataFlushes;
1429 ULONG DataPages;
1430 ULONG ContextSwitches;
1431 ULONG FirstLevelTbFills;
1432 ULONG SecondLevelTbFills;
1433 ULONG SystemCalls;
1434 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1435
1436 /* System Information Class 0x03 */
1437
1438 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1439 #ifdef __WINESRC__
1440 LARGE_INTEGER liKeBootTime;
1441 LARGE_INTEGER liKeSystemTime;
1442 LARGE_INTEGER liExpTimeZoneBias;
1443 ULONG uCurrentTimeZoneId;
1444 DWORD dwUnknown1[5];
1445 #else
1446 BYTE Reserved1[48];
1447 #endif
1448 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1449
1450 /* System Information Class 0x08 */
1451
1452 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1453 LARGE_INTEGER IdleTime;
1454 LARGE_INTEGER KernelTime;
1455 LARGE_INTEGER UserTime;
1456 LARGE_INTEGER Reserved1[2];
1457 ULONG Reserved2;
1458 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1459
1460 /* System Information Class 0x0b */
1461
1462 typedef struct _SYSTEM_DRIVER_INFORMATION {
1463 PVOID pvAddress;
1464 DWORD dwUnknown1;
1465 DWORD dwUnknown2;
1466 DWORD dwEntryIndex;
1467 DWORD dwUnknown3;
1468 char szName[MAX_PATH + 1];
1469 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
1470
1471 /* System Information Class 0x10 */
1472
1473 typedef struct _SYSTEM_HANDLE_ENTRY {
1474 ULONG OwnerPid;
1475 BYTE ObjectType;
1476 BYTE HandleFlags;
1477 USHORT HandleValue;
1478 PVOID ObjectPointer;
1479 ULONG AccessMask;
1480 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
1481
1482 typedef struct _SYSTEM_HANDLE_INFORMATION {
1483 ULONG Count;
1484 SYSTEM_HANDLE_ENTRY Handle[1];
1485 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
1486
1487 /* System Information Class 0x40 */
1488
1489 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
1490 {
1491 PVOID Object;
1492 ULONG_PTR UniqueProcessId;
1493 ULONG_PTR HandleValue;
1494 ULONG GrantedAccess;
1495 USHORT CreatorBackTraceIndex;
1496 USHORT ObjectTypeIndex;
1497 ULONG HandleAttributes;
1498 ULONG Reserved;
1499 } SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
1500
1501 typedef struct _SYSTEM_HANDLE_INFORMATION_EX
1502 {
1503 ULONG_PTR Count;
1504 ULONG_PTR Reserved;
1505 SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handle[1];
1506 } SYSTEM_HANDLE_INFORMATION_EX, *PSYSTEM_HANDLE_INFORMATION_EX;
1507
1508 /* System Information Class 0x15 */
1509
1510 typedef struct _SYSTEM_CACHE_INFORMATION {
1511 ULONG CurrentSize;
1512 ULONG PeakSize;
1513 ULONG PageFaultCount;
1514 ULONG MinimumWorkingSet;
1515 ULONG MaximumWorkingSet;
1516 ULONG unused[4];
1517 #ifdef _WIN64
1518 ULONG unknown64[7];
1519 #endif
1520 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
1521
1522 /* System Information Class 0x17 */
1523
1524 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
1525 BYTE Reserved1[24];
1526 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
1527
1528 typedef struct _SYSTEM_CONFIGURATION_INFO {
1529 union {
1530 ULONG OemId;
1531 struct {
1532 WORD ProcessorArchitecture;
1533 WORD Reserved;
1534 } tag1;
1535 } tag2;
1536 ULONG PageSize;
1537 PVOID MinimumApplicationAddress;
1538 PVOID MaximumApplicationAddress;
1539 ULONG ActiveProcessorMask;
1540 ULONG NumberOfProcessors;
1541 ULONG ProcessorType;
1542 ULONG AllocationGranularity;
1543 WORD ProcessorLevel;
1544 WORD ProcessorRevision;
1545 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
1546
1547 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
1548 BYTE Reserved1[16];
1549 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
1550
1551 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
1552 BYTE Reserved1[32];
1553 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
1554
1555 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
1556 BOOLEAN DebuggerEnabled;
1557 BOOLEAN DebuggerNotPresent;
1558 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
1559
1560 /* System Information Class 0x05 */
1561
1562 typedef struct _VM_COUNTERS_ {
1563 SIZE_T PeakVirtualSize;
1564 SIZE_T VirtualSize;
1565 ULONG PageFaultCount;
1566 SIZE_T PeakWorkingSetSize;
1567 SIZE_T WorkingSetSize;
1568 SIZE_T QuotaPeakPagedPoolUsage;
1569 SIZE_T QuotaPagedPoolUsage;
1570 SIZE_T QuotaPeakNonPagedPoolUsage;
1571 SIZE_T QuotaNonPagedPoolUsage;
1572 SIZE_T PagefileUsage;
1573 SIZE_T PeakPagefileUsage;
1574 SIZE_T PrivatePageCount;
1575 } VM_COUNTERS, *PVM_COUNTERS;
1576
1577 typedef struct _SYSTEM_PROCESS_INFORMATION {
1578 #ifdef __WINESRC__ /* win32/win64 */
1579 ULONG NextEntryOffset; /* 00/00 */
1580 DWORD dwThreadCount; /* 04/04 */
1581 DWORD dwUnknown1[6]; /* 08/08 */
1582 LARGE_INTEGER CreationTime; /* 20/20 */
1583 LARGE_INTEGER UserTime; /* 28/28 */
1584 LARGE_INTEGER KernelTime; /* 30/30 */
1585 UNICODE_STRING ProcessName; /* 38/38 */
1586 DWORD dwBasePriority; /* 40/48 */
1587 HANDLE UniqueProcessId; /* 44/50 */
1588 HANDLE ParentProcessId; /* 48/58 */
1589 ULONG HandleCount; /* 4c/60 */
1590 ULONG SessionId; /* 50/64 */
1591 DWORD dwUnknown4; /* 54/68 */
1592 VM_COUNTERS vmCounters; /* 58/70 */
1593 IO_COUNTERS ioCounters; /* 88/d0 */
1594 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
1595 #else
1596 ULONG NextEntryOffset; /* 00/00 */
1597 BYTE Reserved1[52]; /* 04/04 */
1598 PVOID Reserved2[3]; /* 38/38 */
1599 HANDLE UniqueProcessId; /* 44/50 */
1600 PVOID Reserved3; /* 48/58 */
1601 ULONG HandleCount; /* 4c/60 */
1602 BYTE Reserved4[4]; /* 50/64 */
1603 PVOID Reserved5[11]; /* 54/68 */
1604 SIZE_T PeakPagefileUsage; /* 80/c0 */
1605 SIZE_T PrivatePageCount; /* 84/c8 */
1606 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
1607 #endif
1608 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1609
1610 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1611 ULONG RegistryQuotaAllowed;
1612 ULONG RegistryQuotaUsed;
1613 PVOID Reserved1;
1614 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1615
1616 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1617 ULONG TimeAdjustment;
1618 BOOLEAN TimeAdjustmentDisabled;
1619 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1620
1621 typedef struct _TIME_FIELDS
1622 { CSHORT Year;
1623 CSHORT Month;
1624 CSHORT Day;
1625 CSHORT Hour;
1626 CSHORT Minute;
1627 CSHORT Second;
1628 CSHORT Milliseconds;
1629 CSHORT Weekday;
1630 } TIME_FIELDS, *PTIME_FIELDS;
1631
1632 typedef struct _WINSTATIONINFORMATIONW {
1633 BYTE Reserved2[70];
1634 ULONG LogonId;
1635 BYTE Reserved3[1140];
1636 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1637
1638 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1639
1640 typedef struct _LDR_RESOURCE_INFO
1641 {
1642 ULONG_PTR Type;
1643 ULONG_PTR Name;
1644 ULONG Language;
1645 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1646
1647
1648 /* debug buffer definitions */
1649
1650 typedef struct _DEBUG_BUFFER {
1651 HANDLE SectionHandle;
1652 PVOID SectionBase;
1653 PVOID RemoteSectionBase;
1654 ULONG SectionBaseDelta;
1655 HANDLE EventPairHandle;
1656 ULONG Unknown[2];
1657 HANDLE RemoteThreadHandle;
1658 ULONG InfoClassMask;
1659 ULONG SizeOfInfo;
1660 ULONG AllocatedSize;
1661 ULONG SectionSize;
1662 PVOID ModuleInformation;
1663 PVOID BackTraceInformation;
1664 PVOID HeapInformation;
1665 PVOID LockInformation;
1666 PVOID Reserved[8];
1667 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1668
1669 #define PDI_MODULES 0x01
1670 #define PDI_BACKTRACE 0x02
1671 #define PDI_HEAPS 0x04
1672 #define PDI_HEAP_TAGS 0x08
1673 #define PDI_HEAP_BLOCKS 0x10
1674 #define PDI_LOCKS 0x20
1675
1676 typedef struct _DEBUG_MODULE_INFORMATION {
1677 ULONG Reserved[2];
1678 ULONG Base;
1679 ULONG Size;
1680 ULONG Flags;
1681 USHORT Index;
1682 USHORT Unknown;
1683 USHORT LoadCount;
1684 USHORT ModuleNameOffset;
1685 CHAR ImageName[256];
1686 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1687
1688 typedef struct _DEBUG_HEAP_INFORMATION {
1689 ULONG Base;
1690 ULONG Flags;
1691 USHORT Granularity;
1692 USHORT Unknown;
1693 ULONG Allocated;
1694 ULONG Committed;
1695 ULONG TagCount;
1696 ULONG BlockCount;
1697 ULONG Reserved[7];
1698 PVOID Tags;
1699 PVOID Blocks;
1700 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1701
1702 typedef struct _DEBUG_LOCK_INFORMATION {
1703 PVOID Address;
1704 USHORT Type;
1705 USHORT CreatorBackTraceIndex;
1706 ULONG OwnerThreadId;
1707 ULONG ActiveCount;
1708 ULONG ContentionCount;
1709 ULONG EntryCount;
1710 ULONG RecursionCount;
1711 ULONG NumberOfSharedWaiters;
1712 ULONG NumberOfExclusiveWaiters;
1713 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1714
1715 typedef struct _PORT_MESSAGE_HEADER {
1716 USHORT DataSize;
1717 USHORT MessageSize;
1718 USHORT MessageType;
1719 USHORT VirtualRangesOffset;
1720 CLIENT_ID ClientId;
1721 ULONG MessageId;
1722 ULONG SectionSize;
1723 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1724
1725 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
1726
1727 /* Wine doesn't implement atom table as NT does:
1728 * - in NT, atom tables are user space tables, which ntdll directly accesses
1729 * - on Wine, (even local) atom tables are wineserver objects, hence a HANDLE
1730 */
1731 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
1732
1733 typedef enum _ATOM_INFORMATION_CLASS {
1734 AtomBasicInformation = 0,
1735 AtomTableInformation = 1,
1736 } ATOM_INFORMATION_CLASS;
1737
1738 typedef struct _ATOM_BASIC_INFORMATION {
1739 USHORT ReferenceCount;
1740 USHORT Pinned;
1741 USHORT NameLength;
1742 WCHAR Name[1];
1743 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
1744
1745 /* FIXME: names probably not correct */
1746 typedef struct _RTL_HANDLE
1747 {
1748 struct _RTL_HANDLE * Next;
1749 } RTL_HANDLE;
1750
1751 /* FIXME: names probably not correct */
1752 typedef struct _RTL_HANDLE_TABLE
1753 {
1754 ULONG MaxHandleCount; /* 0x00 */
1755 ULONG HandleSize; /* 0x04 */
1756 ULONG Unused[2]; /* 0x08-0x0c */
1757 PVOID NextFree; /* 0x10 */
1758 PVOID FirstHandle; /* 0x14 */
1759 PVOID ReservedMemory; /* 0x18 */
1760 PVOID MaxHandle; /* 0x1c */
1761 } RTL_HANDLE_TABLE;
1762
1763 /***********************************************************************
1764 * Defines
1765 */
1766
1767 /* flags for NtCreateFile and NtOpenFile */
1768 #define FILE_DIRECTORY_FILE 0x00000001
1769 #define FILE_WRITE_THROUGH 0x00000002
1770 #define FILE_SEQUENTIAL_ONLY 0x00000004
1771 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1772 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1773 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1774 #define FILE_NON_DIRECTORY_FILE 0x00000040
1775 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1776 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1777 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1778 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1779 #define FILE_RANDOM_ACCESS 0x00000800
1780 #define FILE_DELETE_ON_CLOSE 0x00001000
1781 #define FILE_OPEN_BY_FILE_ID 0x00002000
1782 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1783 #define FILE_NO_COMPRESSION 0x00008000
1784 #define FILE_RESERVE_OPFILTER 0x00100000
1785 #define FILE_TRANSACTED_MODE 0x00200000
1786 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1787 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1788
1789 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1790 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1791
1792 /* status for NtCreateFile or NtOpenFile */
1793 #define FILE_SUPERSEDED 0
1794 #define FILE_OPENED 1
1795 #define FILE_CREATED 2
1796 #define FILE_OVERWRITTEN 3
1797 #define FILE_EXISTS 4
1798 #define FILE_DOES_NOT_EXIST 5
1799
1800 /* disposition for NtCreateFile */
1801 #define FILE_SUPERSEDE 0
1802 #define FILE_OPEN 1
1803 #define FILE_CREATE 2
1804 #define FILE_OPEN_IF 3
1805 #define FILE_OVERWRITE 4
1806 #define FILE_OVERWRITE_IF 5
1807 #define FILE_MAXIMUM_DISPOSITION 5
1808
1809 /* Characteristics of a File System */
1810 #define FILE_REMOVABLE_MEDIA 0x00000001
1811 #define FILE_READ_ONLY_DEVICE 0x00000002
1812 #define FILE_FLOPPY_DISKETTE 0x00000004
1813 #define FILE_WRITE_ONE_MEDIA 0x00000008
1814 #define FILE_REMOTE_DEVICE 0x00000010
1815 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1816 #define FILE_VIRTUAL_VOLUME 0x00000040
1817 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1818 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1819
1820 /* options for NtCreateNamedPipeFile */
1821 #define FILE_PIPE_INBOUND 0x00000000
1822 #define FILE_PIPE_OUTBOUND 0x00000001
1823 #define FILE_PIPE_FULL_DUPLEX 0x00000002
1824
1825 /* options for pipe's type */
1826 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
1827 #define FILE_PIPE_TYPE_BYTE 0x00000000
1828 /* options for pipe's message mode */
1829 #define FILE_PIPE_MESSAGE_MODE 0x00000001
1830 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
1831 /* options for pipe's blocking mode */
1832 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
1833 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
1834 /* and client / server end */
1835 #define FILE_PIPE_SERVER_END 0x00000001
1836 #define FILE_PIPE_CLIENT_END 0x00000000
1837
1838 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1839
1840 #define LOGONID_CURRENT ((ULONG)-1)
1841
1842 #define OBJ_INHERIT 0x00000002
1843 #define OBJ_PERMANENT 0x00000010
1844 #define OBJ_EXCLUSIVE 0x00000020
1845 #define OBJ_CASE_INSENSITIVE 0x00000040
1846 #define OBJ_OPENIF 0x00000080
1847 #define OBJ_OPENLINK 0x00000100
1848 #define OBJ_KERNEL_HANDLE 0x00000200
1849 #define OBJ_FORCE_ACCESS_CHECK 0x00000400
1850 #define OBJ_VALID_ATTRIBUTES 0x000007F2
1851
1852 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1853
1854 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1855 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1856 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
1857 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
1858
1859
1860 /* DbgPrintEx default levels */
1861 #define DPFLTR_ERROR_LEVEL 0
1862 #define DPFLTR_WARNING_LEVEL 1
1863 #define DPFLTR_TRACE_LEVEL 2
1864 #define DPFLTR_INFO_LEVEL 3
1865 #define DPFLTR_MASK 0x8000000
1866
1867 /* Well-known LUID values */
1868 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
1869 #define SE_CREATE_TOKEN_PRIVILEGE 2
1870 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
1871 #define SE_LOCK_MEMORY_PRIVILEGE 4
1872 #define SE_INCREASE_QUOTA_PRIVILEGE 5
1873 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
1874 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
1875 #define SE_TCB_PRIVILEGE 7
1876 #define SE_SECURITY_PRIVILEGE 8
1877 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
1878 #define SE_LOAD_DRIVER_PRIVILEGE 10
1879 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
1880 #define SE_SYSTEMTIME_PRIVILEGE 12
1881 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
1882 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
1883 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
1884 #define SE_CREATE_PERMANENT_PRIVILEGE 16
1885 #define SE_BACKUP_PRIVILEGE 17
1886 #define SE_RESTORE_PRIVILEGE 18
1887 #define SE_SHUTDOWN_PRIVILEGE 19
1888 #define SE_DEBUG_PRIVILEGE 20
1889 #define SE_AUDIT_PRIVILEGE 21
1890 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
1891 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
1892 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
1893 #define SE_UNDOCK_PRIVILEGE 25
1894 #define SE_SYNC_AGENT_PRIVILEGE 26
1895 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
1896 #define SE_MANAGE_VOLUME_PRIVILEGE 28
1897 #define SE_IMPERSONATE_PRIVILEGE 29
1898 #define SE_CREATE_GLOBAL_PRIVILEGE 30
1899 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1900
1901 /* NtGlobalFlag bits */
1902 #define FLG_STOP_ON_EXCEPTION 0x00000001
1903 #define FLG_SHOW_LDR_SNAPS 0x00000002
1904 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
1905 #define FLG_STOP_ON_HUNG_GUI 0x00000008
1906 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
1907 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
1908 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
1909 #define FLG_HEAP_VALIDATE_ALL 0x00000080
1910 #define FLG_APPLICATION_VERIFIER 0x00000100
1911 #define FLG_POOL_ENABLE_TAGGING 0x00000400
1912 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
1913 #define FLG_USER_STACK_TRACE_DB 0x00001000
1914 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
1915 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
1916 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
1917 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
1918 #define FLG_ENABLE_CSRDEBUG 0x00020000
1919 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
1920 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
1921 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
1922 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
1923 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
1924 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
1925 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
1926 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
1927 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
1928 #define FLG_DISABLE_DBGPRINT 0x08000000
1929 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
1930 #define FLG_LDR_TOP_DOWN 0x20000000
1931 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
1932 #define FLG_DISABLE_PROTDLLS 0x80000000
1933
1934 /* Rtl*Registry* functions structs and defines */
1935 #define RTL_REGISTRY_ABSOLUTE 0
1936 #define RTL_REGISTRY_SERVICES 1
1937 #define RTL_REGISTRY_CONTROL 2
1938 #define RTL_REGISTRY_WINDOWS_NT 3
1939 #define RTL_REGISTRY_DEVICEMAP 4
1940 #define RTL_REGISTRY_USER 5
1941
1942 #define RTL_REGISTRY_HANDLE 0x40000000
1943 #define RTL_REGISTRY_OPTIONAL 0x80000000
1944
1945 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1946 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1947 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1948 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1949 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1950 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1951 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1952
1953 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1954 ULONG ValueType,
1955 PVOID ValueData,
1956 ULONG ValueLength,
1957 PVOID Context,
1958 PVOID EntryContext);
1959
1960 typedef struct _RTL_QUERY_REGISTRY_TABLE
1961 {
1962 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1963 ULONG Flags;
1964 PWSTR Name;
1965 PVOID EntryContext;
1966 ULONG DefaultType;
1967 PVOID DefaultData;
1968 ULONG DefaultLength;
1969 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1970
1971 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
1972 {
1973 PUNICODE_STRING ValueName;
1974 ULONG DataLength;
1975 ULONG DataOffset;
1976 ULONG Type;
1977 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
1978
1979 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
1980
1981 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
1982
1983 typedef enum _EVENT_INFORMATION_CLASS {
1984 EventBasicInformation
1985 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
1986
1987 typedef struct _EVENT_BASIC_INFORMATION {
1988 EVENT_TYPE EventType;
1989 LONG EventState;
1990 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
1991
1992 typedef enum _SEMAPHORE_INFORMATION_CLASS {
1993 SemaphoreBasicInformation
1994 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
1995
1996 typedef struct _SEMAPHORE_BASIC_INFORMATION {
1997 ULONG CurrentCount;
1998 ULONG MaximumCount;
1999 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
2000
2001 typedef enum _SECTION_INFORMATION_CLASS
2002 {
2003 SectionBasicInformation,
2004 SectionImageInformation,
2005 } SECTION_INFORMATION_CLASS;
2006
2007 typedef struct _SECTION_BASIC_INFORMATION {
2008 PVOID BaseAddress;
2009 ULONG Attributes;
2010 LARGE_INTEGER Size;
2011 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
2012
2013 typedef struct _SECTION_IMAGE_INFORMATION {
2014 PVOID TransferAddress;
2015 ULONG ZeroBits;
2016 SIZE_T MaximumStackSize;
2017 SIZE_T CommittedStackSize;
2018 ULONG SubSystemType;
2019 WORD SubsystemVersionLow;
2020 WORD SubsystemVersionHigh;
2021 ULONG GpValue;
2022 USHORT ImageCharacteristics;
2023 USHORT DllCharacteristics;
2024 USHORT Machine;
2025 BOOLEAN ImageContainsCode;
2026 UCHAR ImageFlags;
2027 ULONG LoaderFlags;
2028 ULONG ImageFileSize;
2029 ULONG CheckSum;
2030 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
2031
2032 typedef struct _LPC_SECTION_WRITE {
2033 ULONG Length;
2034 HANDLE SectionHandle;
2035 ULONG SectionOffset;
2036 ULONG ViewSize;
2037 PVOID ViewBase;
2038 PVOID TargetViewBase;
2039 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
2040
2041 typedef struct _LPC_SECTION_READ {
2042 ULONG Length;
2043 ULONG ViewSize;
2044 PVOID ViewBase;
2045 } LPC_SECTION_READ, *PLPC_SECTION_READ;
2046
2047 typedef struct _LPC_MESSAGE {
2048 USHORT DataSize;
2049 USHORT MessageSize;
2050 USHORT MessageType;
2051 USHORT VirtualRangesOffset;
2052 CLIENT_ID ClientId;
2053 ULONG_PTR MessageId;
2054 ULONG_PTR SectionSize;
2055 UCHAR Data[ANYSIZE_ARRAY];
2056 } LPC_MESSAGE, *PLPC_MESSAGE;
2057
2058 typedef struct _RTL_USER_PROCESS_INFORMATION
2059 {
2060 ULONG Length;
2061 HANDLE Process;
2062 HANDLE Thread;
2063 CLIENT_ID ClientId;
2064 SECTION_IMAGE_INFORMATION ImageInformation;
2065 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
2066
2067 typedef enum _SHUTDOWN_ACTION {
2068 ShutdownNoReboot,
2069 ShutdownReboot,
2070 ShutdownPowerOff
2071 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
2072
2073 typedef enum _KPROFILE_SOURCE {
2074 ProfileTime,
2075 ProfileAlignmentFixup,
2076 ProfileTotalIssues,
2077 ProfilePipelineDry,
2078 ProfileLoadInstructions,
2079 ProfilePipelineFrozen,
2080 ProfileBranchInstructions,
2081 ProfileTotalNonissues,
2082 ProfileDcacheMisses,
2083 ProfileIcacheMisses,
2084 ProfileCacheMisses,
2085 ProfileBranchMispredictions,
2086 ProfileStoreInstructions,
2087 ProfileFpInstructions,
2088 ProfileIntegerInstructions,
2089 Profile2Issue,
2090 Profile3Issue,
2091 Profile4Issue,
2092 ProfileSpecialInstructions,
2093 ProfileTotalCycles,
2094 ProfileIcacheIssues,
2095 ProfileDcacheAccesses,
2096 ProfileMemoryBarrierCycles,
2097 ProfileLoadLinkedIssues,
2098 ProfileMaximum
2099 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
2100
2101 typedef struct _DIRECTORY_BASIC_INFORMATION {
2102 UNICODE_STRING ObjectName;
2103 UNICODE_STRING ObjectTypeName;
2104 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
2105
2106 typedef struct _INITIAL_TEB {
2107 PVOID StackBase;
2108 PVOID StackLimit;
2109 PVOID StackCommit;
2110 PVOID StackCommitMax;
2111 PVOID StackReserved;
2112 } INITIAL_TEB, *PINITIAL_TEB;
2113
2114 typedef enum _PORT_INFORMATION_CLASS {
2115 PortNoInformation
2116 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
2117
2118 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
2119 IoCompletionBasicInformation
2120 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
2121
2122 typedef struct _FILE_COMPLETION_INFORMATION {
2123 HANDLE CompletionPort;
2124 ULONG_PTR CompletionKey;
2125 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
2126
2127 #define IO_COMPLETION_QUERY_STATE 0x0001
2128 #define IO_COMPLETION_MODIFY_STATE 0x0002
2129 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2130
2131 typedef enum _HARDERROR_RESPONSE_OPTION {
2132 OptionAbortRetryIgnore,
2133 OptionOk,
2134 OptionOkCancel,
2135 OptionRetryCancel,
2136 OptionYesNo,
2137 OptionYesNoCancel,
2138 OptionShutdownSystem
2139 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
2140
2141 typedef enum _HARDERROR_RESPONSE {
2142 ResponseReturnToCaller,
2143 ResponseNotHandled,
2144 ResponseAbort,
2145 ResponseCancel,
2146 ResponseIgnore,
2147 ResponseNo,
2148 ResponseOk,
2149 ResponseRetry,
2150 ResponseYes
2151 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
2152
2153 typedef enum _SYSDBG_COMMAND {
2154 SysDbgQueryModuleInformation,
2155 SysDbgQueryTraceInformation,
2156 SysDbgSetTracepoint,
2157 SysDbgSetSpecialCall,
2158 SysDbgClearSpecialCalls,
2159 SysDbgQuerySpecialCalls,
2160 SysDbgBreakPoint,
2161 SysDbgQueryVersion,
2162 SysDbgReadVirtual,
2163 SysDbgWriteVirtual,
2164 SysDbgReadPhysical,
2165 SysDbgWritePhysical,
2166 SysDbgReadControlSpace,
2167 SysDbgWriteControlSpace,
2168 SysDbgReadIoSpace,
2169 SysDbgWriteIoSpace,
2170 SysDbgReadMsr,
2171 SysDbgWriteMsr,
2172 SysDbgReadBusData,
2173 SysDbgWriteBusData
2174 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
2175
2176
2177 /*************************************************************************
2178 * Loader structures
2179 *
2180 * Those are not part of standard Winternl.h
2181 */
2182 typedef struct _LDR_MODULE
2183 {
2184 LIST_ENTRY InLoadOrderModuleList;
2185 LIST_ENTRY InMemoryOrderModuleList;
2186 LIST_ENTRY InInitializationOrderModuleList;
2187 void* BaseAddress;
2188 void* EntryPoint;
2189 ULONG SizeOfImage;
2190 UNICODE_STRING FullDllName;
2191 UNICODE_STRING BaseDllName;
2192 ULONG Flags;
2193 SHORT LoadCount;
2194 SHORT TlsIndex;
2195 LIST_ENTRY HashLinks;
2196 ULONG TimeDateStamp;
2197 HANDLE ActivationContext;
2198 PVOID PatchInformation;
2199 LIST_ENTRY ForwarderLinks;
2200 LIST_ENTRY ServiceTagLinks;
2201 LIST_ENTRY StaticLinks;
2202 PVOID ContextInformation;
2203 ULONG_PTR OriginalBase;
2204 LARGE_INTEGER LoadTime;
2205
2206 /* Not part of Win7 but used by Wine */
2207 HANDLE SectionHandle;
2208 } LDR_MODULE, *PLDR_MODULE;
2209
2210 typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
2211 {
2212 ULONG Flags;
2213 PCUNICODE_STRING FullDllName;
2214 PCUNICODE_STRING BaseDllName;
2215 PVOID DllBase;
2216 ULONG SizeOfImage;
2217 } LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;
2218
2219 typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA
2220 {
2221 ULONG Flags;
2222 PCUNICODE_STRING FullDllName;
2223 PCUNICODE_STRING BaseDllName;
2224 PVOID DllBase;
2225 ULONG SizeOfImage;
2226 } LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;
2227
2228 typedef union _LDR_DLL_NOTIFICATION_DATA
2229 {
2230 LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
2231 LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
2232 } LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA;
2233
2234 typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*);
2235
2236 /* those defines are (some of the) regular LDR_MODULE.Flags values */
2237 #define LDR_IMAGE_IS_DLL 0x00000004
2238 #define LDR_LOAD_IN_PROGRESS 0x00001000
2239 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2240 #define LDR_NO_DLL_CALLS 0x00040000
2241 #define LDR_PROCESS_ATTACHED 0x00080000
2242 #define LDR_MODULE_REBASED 0x00200000
2243
2244 /* these ones is Wine specific */
2245 #define LDR_DONT_RESOLVE_REFS 0x40000000
2246 #define LDR_WINE_INTERNAL 0x80000000
2247
2248 /* flag for LdrAddRefDll */
2249 #define LDR_ADDREF_DLL_PIN 0x00000001
2250
2251 /* FIXME: to be checked */
2252 #define MAXIMUM_FILENAME_LENGTH 256
2253
2254 #define LDR_DLL_NOTIFICATION_REASON_LOADED 1
2255 #define LDR_DLL_NOTIFICATION_REASON_UNLOADED 2
2256
2257 typedef struct _SYSTEM_MODULE
2258 {
2259 PVOID Reserved1; /* 00/00 */
2260 PVOID Reserved2; /* 04/08 */
2261 PVOID ImageBaseAddress; /* 08/10 */
2262 ULONG ImageSize; /* 0c/18 */
2263 ULONG Flags; /* 10/1c */
2264 WORD Id; /* 14/20 */
2265 WORD Rank; /* 16/22 */
2266 WORD Unknown; /* 18/24 */
2267 WORD NameOffset; /* 1a/26 */
2268 BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */
2269 } SYSTEM_MODULE, *PSYSTEM_MODULE;
2270
2271 typedef struct _SYSTEM_MODULE_INFORMATION
2272 {
2273 ULONG ModulesCount;
2274 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2275 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
2276
2277 #define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
2278 #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002
2279 #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
2280 #define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010
2281 #define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET 0x00000020
2282 #define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080
2283
2284 /***********************************************************************
2285 * Function declarations
2286 */
2287
2288 #if defined(__i386__) && defined(__GNUC__)
2289 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
2290 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
2291 #else /* __i386__ && __GNUC__ */
2292 NTSYSAPI void WINAPI DbgBreakPoint(void);
2293 NTSYSAPI void WINAPI DbgUserBreakPoint(void);
2294 #endif /* __i386__ && __GNUC__ */
2295 #ifndef __REACTOS__
2296 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
2297 #endif /* __REACTOS__ */
2298 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
2299 NTSYSAPI NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
2300 NTSYSAPI NTSTATUS WINAPI LdrAddRefDll(ULONG,HMODULE);
2301 NTSYSAPI NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
2302 NTSYSAPI NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
2303 NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
2304 NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
2305 NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
2306 NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
2307 NTSYSAPI void WINAPI LdrInitializeThunk(void*,ULONG_PTR,ULONG_PTR,ULONG_PTR);
2308 NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
2309 NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
2310 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
2311 NTSYSAPI NTSTATUS WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
2312 NTSYSAPI NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
2313 NTSYSAPI void WINAPI LdrShutdownProcess(void);
2314 NTSYSAPI void WINAPI LdrShutdownThread(void);
2315 NTSYSAPI NTSTATUS WINAPI LdrUnloadDll(HMODULE);
2316 NTSYSAPI NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
2317 NTSYSAPI NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
2318 NTSYSAPI NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
2319 NTSYSAPI NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
2320 NTSYSAPI NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
2321 NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
2322 NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
2323 NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
2324 NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
2325 NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
2326 NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR);
2327 NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
2328 NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
2329 NTSYSAPI NTSTATUS WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
2330 NTSYSAPI NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
2331 NTSYSAPI NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
2332 NTSYSAPI NTSTATUS WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
2333 NTSYSAPI NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
2334 NTSYSAPI NTSTATUS WINAPI NtClearEvent(HANDLE);
2335 NTSYSAPI NTSTATUS WINAPI NtClose(HANDLE);
2336 NTSYSAPI NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
2337 NTSYSAPI NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
2338 NTSYSAPI NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
2339 NTSYSAPI NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
2340 NTSYSAPI NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2341 NTSYSAPI NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
2342 NTSYSAPI NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
2343 NTSYSAPI NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
2344 NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
2345 NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2346 NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2347 NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
2348 NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
2349 NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
2350 NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
2351 NTSYSAPI NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
2352 NTSYSAPI NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
2353 NTSYSAPI NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
2354 NTSYSAPI NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
2355 NTSYSAPI NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
2356 NTSYSAPI NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
2357 NTSYSAPI NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
2358 NTSYSAPI NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
2359 NTSYSAPI NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
2360 NTSYSAPI NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
2361 NTSYSAPI 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);
2362 NTSYSAPI NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
2363 NTSYSAPI NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
2364 NTSYSAPI NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
2365 NTSYSAPI NTSTATUS WINAPI NtDeleteKey(HANDLE);
2366 NTSYSAPI NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
2367 NTSYSAPI NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
2368 NTSYSAPI NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
2369 NTSYSAPI NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
2370 NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
2371 NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
2372 NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2373 NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
2374 NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
2375 NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
2376 NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
2377 NTSYSAPI NTSTATUS WINAPI NtFlushKey(HANDLE);
2378 NTSYSAPI NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
2379 NTSYSAPI NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
2380 NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2381 NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
2382 NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
2383 NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void);
2384 NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
2385 NTSYSAPI ULONG WINAPI NtGetTickCount(VOID);
2386 NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
2387 NTSYSAPI NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
2388 NTSYSAPI NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
2389 NTSYSAPI NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
2390 NTSYSAPI NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
2391 NTSYSAPI NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
2392 NTSYSAPI NTSTATUS WINAPI NtIsProcessInJob(HANDLE,HANDLE);
2393 NTSYSAPI NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
2394 NTSYSAPI NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
2395 NTSYSAPI NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
2396 NTSYSAPI NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
2397 NTSYSAPI NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2398 NTSYSAPI NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
2399 NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
2400 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
2401 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
2402 NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
2403 NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2404 NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
2405 NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2406 NTSYSAPI NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
2407 NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2408 NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2409 NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
2410 NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
2411 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
2412 NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
2413 NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2414 NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2415 NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
2416 NTSYSAPI NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
2417 NTSYSAPI NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
2418 NTSYSAPI NTSTATUS WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
2419 NTSYSAPI NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2420 NTSYSAPI NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2421 NTSYSAPI NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
2422 NTSYSAPI NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
2423 NTSYSAPI NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
2424 NTSYSAPI NTSTATUS WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
2425 NTSYSAPI NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
2426 NTSYSAPI NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
2427 NTSYSAPI NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
2428 NTSYSAPI NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
2429 NTSYSAPI NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
2430 NTSYSAPI NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
2431 NTSYSAPI NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
2432 NTSYSAPI NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
2433 NTSYSAPI NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
2434 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
2435 NTSYSAPI NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
2436 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
2437 NTSYSAPI NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
2438 NTSYSAPI NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
2439 NTSYSAPI NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2440 NTSYSAPI NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
2441 NTSYSAPI NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
2442 NTSYSAPI NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
2443 NTSYSAPI NTSTATUS WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
2444 NTSYSAPI NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2445 NTSYSAPI NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
2446 NTSYSAPI NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
2447 NTSYSAPI NTSTATUS WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2448 NTSYSAPI NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
2449 NTSYSAPI NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
2450 NTSYSAPI NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2451 NTSYSAPI NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
2452 NTSYSAPI NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
2453 NTSYSAPI NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2454 NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
2455 NTSYSAPI NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
2456 NTSYSAPI NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
2457 NTSYSAPI NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
2458 NTSYSAPI NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2459 NTSYSAPI NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2460 NTSYSAPI NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
2461 NTSYSAPI NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
2462 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2463 NTSYSAPI NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS,void*,ULONG,void*,ULONG,ULONG*);
2464 NTSYSAPI NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
2465 NTSYSAPI NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
2466 NTSYSAPI NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
2467 NTSYSAPI NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
2468 NTSYSAPI NTSTATUS WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
2469 NTSYSAPI NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
2470 NTSYSAPI NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2471 NTSYSAPI NTSTATUS WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
2472 NTSYSAPI NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
2473 NTSYSAPI NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
2474 NTSYSAPI NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
2475 NTSYSAPI NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2476 NTSYSAPI NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
2477 NTSYSAPI NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
2478 NTSYSAPI NTSTATUS WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
2479 NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
2480 NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
2481 NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
2482 NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
2483 NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
2484 NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
2485 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
2486 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
2487 NTSYSAPI NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
2488 NTSYSAPI NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
2489 NTSYSAPI NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
2490 NTSYSAPI NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
2491 NTSYSAPI NTSTATUS WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
2492 NTSYSAPI NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
2493 NTSYSAPI NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
2494 NTSYSAPI NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
2495 NTSYSAPI NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
2496 NTSYSAPI NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
2497 NTSYSAPI NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
2498 NTSYSAPI NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
2499 NTSYSAPI NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
2500 NTSYSAPI NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
2501 NTSYSAPI NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
2502 NTSYSAPI NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
2503 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
2504 NTSYSAPI NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
2505 NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
2506 NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
2507 NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
2508 NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
2509 NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
2510 NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
2511 NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
2512 NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
2513 NTSYSAPI NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
2514 NTSYSAPI NTSTATUS WINAPI NtSetLdtEntries(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG);
2515 NTSYSAPI NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
2516 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
2517 NTSYSAPI NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
2518 NTSYSAPI NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
2519 NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
2520 NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
2521 NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
2522 NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
2523 NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
2524 NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
2525 NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
2526 NTSYSAPI NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
2527 NTSYSAPI NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
2528 NTSYSAPI NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
2529 NTSYSAPI NTSTATUS WINAPI NtStartProfile(HANDLE);
2530 NTSYSAPI NTSTATUS WINAPI NtStopProfile(HANDLE);
2531 NTSYSAPI NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
2532 NTSYSAPI NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
2533 NTSYSAPI NTSTATUS WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
2534 NTSYSAPI NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
2535 NTSYSAPI NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
2536 NTSYSAPI NTSTATUS WINAPI NtTestAlert(VOID);
2537 NTSYSAPI NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
2538 NTSYSAPI NTSTATUS WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
2539 NTSYSAPI NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
2540 NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
2541 NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
2542 NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
2543 NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
2544 NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
2545 NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
2546 NTSYSAPI NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
2547 NTSYSAPI NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
2548 NTSYSAPI NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
2549 NTSYSAPI NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
2550 NTSYSAPI NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
2551 NTSYSAPI NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
2552 NTSYSAPI NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
2553 NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void);
2554
2555 NTSYSAPI void WINAPI RtlAcquirePebLock(void);
2556 NTSYSAPI BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
2557 NTSYSAPI BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
2558 NTSYSAPI void WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
2559 NTSYSAPI void WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
2560 NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
2561 NTSYSAPI NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
2562 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
2563 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2564 NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
2565 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
2566 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
2567 NTSYSAPI NTSTATUS WINAPI RtlAddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
2568 NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2569 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
2570 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
2571 NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
2572 NTSYSAPI NTSTATUS WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
2573 NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
2574 NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
2575 NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
2576 NTSYSAPI NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
2577 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
2578 NTSYSAPI PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3);
2579 NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
2580 NTSYSAPI DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
2581 NTSYSAPI NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
2582 NTSYSAPI NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
2583 NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
2584 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
2585 NTSYSAPI NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
2586 NTSYSAPI BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2587 NTSYSAPI BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
2588 NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
2589 NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
2590 NTSYSAPI NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
2591 NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
2592 NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
2593 NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
2594 NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
2595 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
2596 NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
2597 NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
2598 NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2599 NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN);
2600 NTSYSAPI NTSTATUS WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
2601 NTSYSAPI DWORD WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
2602 NTSYSAPI NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
2603 NTSYSAPI void WINAPI RtlCopyLuid(PLUID,const LUID*);
2604 NTSYSAPI void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
2605 NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
2606 NTSYSAPI NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
2607 NTSYSAPI void WINAPI RtlCopyString(STRING*,const STRING*);
2608 NTSYSAPI void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
2609 NTSYSAPI NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
2610 NTSYSAPI NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
2611 NTSYSAPI NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
2612 NTSYSAPI HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
2613 NTSYSAPI NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*);
2614 NTSYSAPI NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
2615 NTSYSAPI NTSTATUS WINAPI RtlCreateTimerQueue(PHANDLE);
2616 NTSYSAPI NTSTATUS WINAPI RtlCreateTimer(PHANDLE, HANDLE, RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
2617 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
2618 NTSYSAPI BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
2619 NTSYSAPI NTSTATUS WINAPI RtlCreateUserProcess(UNICODE_STRING*,ULONG,RTL_USER_PROCESS_PARAMETERS*,SECURITY_DESCRIPTOR*,SECURITY_DESCRIPTOR*,HANDLE,BOOLEAN,HANDLE,HANDLE,RTL_USER_PROCESS_INFORMATION*);
2620 NTSYSAPI NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
2621 NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
2622 NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID);
2623 NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
2624 NTSYSAPI NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
2625 NTSYSAPI NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2626 NTSYSAPI NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
2627 NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
2628 NTSYSAPI void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
2629 NTSYSAPI NTSTATUS WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
2630 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
2631 NTSYSAPI NTSTATUS WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
2632 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2633 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWait(HANDLE);
2634 NTSYSAPI NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
2635 NTSYSAPI NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
2636 NTSYSAPI NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
2637 NTSYSAPI NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
2638 NTSYSAPI HANDLE WINAPI RtlDestroyHeap(HANDLE);
2639 NTSYSAPI void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
2640 NTSYSAPI NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
2641 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
2642 NTSYSAPI BOOLEAN WINAPI RtlDllShutdownInProgress(void);
2643 NTSYSAPI BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
2644 NTSYSAPI BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
2645 NTSYSAPI ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
2646 NTSYSAPI WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
2647 NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2648 NTSYSAPI void WINAPI RtlDumpResource(LPRTL_RWLOCK);
2649 NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
2650 NTSYSAPI NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
2651 NTSYSAPI PVOID WINAPI RtlEncodePointer(PVOID);
2652 NTSYSAPI NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
2653 NTSYSAPI void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
2654 NTSYSAPI NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
2655 NTSYSAPI NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
2656 NTSYSAPI BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
2657 NTSYSAPI BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
2658 NTSYSAPI BOOL WINAPI RtlEqualSid(PSID,PSID);
2659 NTSYSAPI BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
2660 NTSYSAPI BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2661 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
2662 NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
2663 NTSYSAPI NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
2664 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
2665 NTSYSAPI NTSTATUS WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
2666 NTSYSAPI NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
2667 NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
2668 NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
2669 NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2670 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2671 NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2672 NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
2673 NTSYSAPI ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
2674 NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
2675 NTSYSAPI NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
2676 NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
2677 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2678 NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2679 NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
2680 NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
2681 NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2682 NTSYSAPI BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
2683 NTSYSAPI NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
2684 NTSYSAPI NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG);
2685 NTSYSAPI void WINAPI RtlFreeAnsiString(PANSI_STRING);
2686 NTSYSAPI BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
2687 NTSYSAPI BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
2688 NTSYSAPI void WINAPI RtlFreeOemString(POEM_STRING);
2689 NTSYSAPI DWORD WINAPI RtlFreeSid(PSID);
2690 NTSYSAPI void WINAPI RtlFreeThreadActivationContextStack(void);
2691 NTSYSAPI void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
2692 NTSYSAPI NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
2693 NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE*);
2694 NTSYSAPI NTSTATUS WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
2695 NTSYSAPI NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
2696 NTSYSAPI NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
2697 NTSYSAPI PEB * WINAPI RtlGetCurrentPeb(void);
2698 NTSYSAPI NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2699 NTSYSAPI ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
2700 NTSYSAPI NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2701 NTSYSAPI NTSTATUS WINAPI RtlGetLastNtStatus(void);
2702 NTSYSAPI DWORD WINAPI RtlGetLastWin32Error(void);
2703 NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void);
2704 NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
2705 NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
2706 NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2707 NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
2708 NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
2709 NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2710 NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
2711 NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
2712 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
2713 NTSYSAPI PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
2714 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
2715 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
2716 NTSYSAPI PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
2717 NTSYSAPI NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
2718 NTSYSAPI void WINAPI RtlInitString(PSTRING,PCSZ);
2719 NTSYSAPI void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
2720 NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
2721 NTSYSAPI void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
2722 NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
2723 NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
2724 NTSYSAPI void WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
2725 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
2726 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
2727 NTSYSAPI NTSTATUS WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
2728 NTSYSAPI void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
2729 NTSYSAPI void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
2730 NTSYSAPI void WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
2731 NTSYSAPI BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
2732 NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
2733 NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
2734 NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
2735 NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
2736 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
2737 NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
2738 NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
2739 NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
2740 NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
2741 NTSYSAPI BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
2742 NTSYSAPI BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
2743 NTSYSAPI NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
2744 NTSYSAPI DWORD WINAPI RtlLengthRequiredSid(DWORD);
2745 NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
2746 NTSYSAPI DWORD WINAPI RtlLengthSid(PSID);
2747 NTSYSAPI NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2748 NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE);
2749 NTSYSAPI NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2750 NTSYSAPI NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
2751 NTSYSAPI void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
2752 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2753 NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
2754 NTSYSAPI NTSTATUS WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
2755 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2756 NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
2757 NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
2758 NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
2759 NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
2760 NTSYSAPI UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
2761 NTSYSAPI NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
2762 NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2763 NTSYSAPI NTSTATUS WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
2764 NTSYSAPI PVOID WINAPI RtlPcToFileHeader(PVOID,PVOID*);
2765 NTSYSAPI NTSTATUS WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2766 NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
2767 NTSYSAPI BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2768 NTSYSAPI NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
2769 NTSYSAPI NTSTATUS WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
2770 NTSYSAPI NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
2771 NTSYSAPI NTSTATUS WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
2772 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
2773 NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
2774 NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
2775 NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
2776 NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
2777 NTSYSAPI NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
2778 NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
2779 NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
2780 NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);
2781 NTSYSAPI ULONG WINAPI RtlRandom(PULONG);
2782 NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
2783 NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
2784 NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE);
2785 NTSYSAPI void WINAPI RtlReleasePebLock(void);
2786 NTSYSAPI void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
2787 NTSYSAPI void WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
2788 NTSYSAPI void WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
2789 NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
2790 NTSYSAPI void WINAPI RtlRestoreLastWin32Error(DWORD);
2791 NTSYSAPI void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
2792 NTSYSAPI void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
2793 NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
2794 NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP);
2795 NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
2796 NTSYSAPI ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
2797 NTSYSAPI NTSTATUS WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
2798 NTSYSAPI NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
2799 NTSYSAPI void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
2800 NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2801 NTSYSAPI NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
2802 NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
2803 NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2804 NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2805 NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
2806 NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
2807 NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
2808 NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2809 NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
2810 NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
2811 NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
2812 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
2813 NTSYSAPI NTSTATUS WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
2814 NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
2815 NTSYSAPI LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
2816 NTSYSAPI LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
2817 NTSYSAPI NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2818 NTSYSAPI void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
2819 NTSYSAPI BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
2820 NTSYSAPI void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
2821 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
2822 NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
2823 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
2824 NTSYSAPI BOOLEAN WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
2825 NTSYSAPI BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
2826 #ifdef __REACTOS__
2827 ULONGLONG __fastcall RtlUlonglongByteSwap(ULONGLONG);
2828 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
2829 #else
2830 NTSYSAPI ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
2831 #endif /* __REACTOS__ */
2832 NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
2833 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
2834 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
2835 NTSYSAPI DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
2836 NTSYSAPI NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
2837 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2838 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
2839 NTSYSAPI NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2840 NTSYSAPI ULONG WINAPI RtlUniform(PULONG);
2841 NTSYSAPI BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
2842 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
2843 #ifdef __x86_64__
2844 NTSYSAPI void WINAPI RtlUnwindEx(PVOID,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2845 #elif defined(__ia64__)
2846 NTSYSAPI void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
2847 NTSYSAPI void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2848 #endif
2849 NTSYSAPI WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
2850 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
2851 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
2852 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2853 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2854 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2855 NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2856 NTSYSAPI NTSTATUS WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
2857 NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR);
2858 NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *);
2859 NTSYSAPI NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
2860 NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
2861 NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL);
2862 NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
2863 NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
2864 NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
2865 NTSYSAPI void WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
2866 NTSYSAPI void WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
2867 NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
2868 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
2869 NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
2870 NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
2871 NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE);
2872 NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2873 NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
2874 NTSYSAPI NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
2875 NTSYSAPI NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
2876 NTSYSAPI NTSTATUS WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
2877 NTSYSAPI NTSTATUS WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
2878
2879 /* 32-bit only functions */
2880
2881 #ifndef _WIN64
2882 NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
2883 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
2884 NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
2885 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
2886 NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
2887 NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
2888 NTSYSAPI LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
2889 NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
2890 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
2891 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
2892 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
2893 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
2894 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
2895 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
2896 NTSYSAPI LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
2897 NTSYSAPI NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
2898 #endif
2899
2900 /* Wine internal functions */
2901
2902 NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
2903 UINT disposition, BOOLEAN check_case );
2904 NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRING *nt );
2905
2906 NTSYSAPI SIZE_T CDECL wine_uninterrupted_read_memory( const void *addr, void *buffer, SIZE_T size );
2907 NTSYSAPI SIZE_T CDECL wine_uninterrupted_write_memory( void *addr, const void *buffer, SIZE_T size );
2908
2909
2910 /***********************************************************************
2911 * Inline functions
2912 */
2913
2914 #define InitializeObjectAttributes(p,n,a,r,s) \
2915 do { \
2916 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
2917 (p)->RootDirectory = r; \
2918 (p)->Attributes = a; \
2919 (p)->ObjectName = n; \
2920 (p)->SecurityDescriptor = s; \
2921 (p)->SecurityQualityOfService = NULL; \
2922 } while (0)
2923
2924 #define NtCurrentProcess() ((HANDLE)-1)
2925
2926 #ifndef RtlFillMemory // REACTOS
2927 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
2928 #endif // REACTOS
2929 #ifndef RtlMoveMemory // REACTOS
2930 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
2931 #endif // REACTOS
2932 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2933 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2934 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
2935 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
2936 #ifndef RtlZeroMemory // REACTOS
2937 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
2938 #endif // REACTOS
2939
2940 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
2941 {
2942 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
2943 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
2944 return TRUE;
2945 return FALSE;
2946 }
2947
2948 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
2949 static inline USHORT RtlUshortByteSwap(USHORT s)
2950 {
2951 return (s >> 8) | (s << 8);
2952 }
2953 static inline ULONG RtlUlongByteSwap(ULONG i)
2954 {
2955 #if defined(__i386__) && defined(__GNUC__)
2956 ULONG ret;
2957 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
2958 return ret;
2959 #else
2960 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
2961 #endif
2962 }
2963
2964 /* list manipulation macros */
2965 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
2966 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
2967 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
2968 #define IsListEmpty(le) ((le)->Flink == (le))
2969 #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)
2970 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
2971 {
2972 PLIST_ENTRY f, b, e;
2973
2974 e = le->Flink;
2975 f = le->Flink->Flink;
2976 b = le->Flink->Blink;
2977 f->Blink = b;
2978 b->Flink = f;
2979
2980 if (e != le) e->Flink = e->Blink = NULL;
2981 return e;
2982 }
2983 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
2984 {
2985 PLIST_ENTRY f, b, e;
2986
2987 e = le->Blink;
2988 f = le->Blink->Flink;
2989 b = le->Blink->Blink;
2990 f->Blink = b;
2991 b->Flink = f;
2992
2993 if (e != le) e->Flink = e->Blink = NULL;
2994 return e;
2995 }
2996
2997
2998 #ifdef __WINESRC__
2999
3000 /* FIXME: private structure for vm86 mode, stored in teb->GdiTebBatch */
3001 typedef struct
3002 {
3003 DWORD dpmi_vif;
3004 DWORD vm86_pending;
3005 } WINE_VM86_TEB_INFO;
3006
3007 static inline WINE_VM86_TEB_INFO *get_vm86_teb_info(void)
3008 {
3009 return (WINE_VM86_TEB_INFO *)&NtCurrentTeb()->GdiTebBatch;
3010 }
3011
3012 /* The thread information for 16-bit threads */
3013 /* NtCurrentTeb()->SubSystemTib points to this */
3014 typedef struct
3015 {
3016 void *unknown; /* 00 unknown */
3017 UNICODE_STRING *exe_name; /* 04 exe module name */
3018
3019 /* the following fields do not exist under Windows */
3020 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
3021 CURDIR curdir; /* current directory */
3022 WCHAR curdir_buffer[MAX_PATH];
3023 } WIN16_SUBSYSTEM_TIB;
3024
3025 #endif /* __WINESRC__ */
3026
3027 #ifdef __cplusplus
3028 } /* extern "C" */
3029 #endif /* defined(__cplusplus) */
3030
3031 #endif /* __WINE_WINTERNL_H */