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