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