[PSDK]
[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 { /* win32/win64 */
876 LARGE_INTEGER KernelTime; /* 00/00 */
877 LARGE_INTEGER UserTime; /* 08/08 */
878 LARGE_INTEGER CreateTime; /* 10/10 */
879 DWORD dwTickCount; /* 18/18 */
880 LPVOID StartAddress; /* 1c/20 */
881 CLIENT_ID ClientId; /* 20/28 */
882 DWORD dwCurrentPriority; /* 28/38 */
883 DWORD dwBasePriority; /* 2c/3c */
884 DWORD dwContextSwitches; /* 30/40 */
885 DWORD dwThreadState; /* 34/44 */
886 DWORD dwWaitReason; /* 38/48 */
887 DWORD dwUnknown; /* 3c/4c */
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 SIZE_T PrivatePageCount;
1199 } VM_COUNTERS, *PVM_COUNTERS;
1200
1201 typedef struct _SYSTEM_PROCESS_INFORMATION {
1202 #ifdef __WINESRC__ /* win32/win64 */
1203 ULONG NextEntryOffset; /* 00/00 */
1204 DWORD dwThreadCount; /* 04/04 */
1205 DWORD dwUnknown1[6]; /* 08/08 */
1206 LARGE_INTEGER CreationTime; /* 20/20 */
1207 LARGE_INTEGER UserTime; /* 28/28 */
1208 LARGE_INTEGER KernelTime; /* 30/30 */
1209 UNICODE_STRING ProcessName; /* 38/38 */
1210 DWORD dwBasePriority; /* 40/48 */
1211 HANDLE UniqueProcessId; /* 44/50 */
1212 HANDLE ParentProcessId; /* 48/58 */
1213 ULONG HandleCount; /* 4c/60 */
1214 DWORD dwUnknown3; /* 50/64 */
1215 DWORD dwUnknown4; /* 54/68 */
1216 VM_COUNTERS vmCounters; /* 58/70 */
1217 IO_COUNTERS ioCounters; /* 88/d0 */
1218 SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
1219 #else
1220 ULONG NextEntryOffset; /* 00/00 */
1221 BYTE Reserved1[52]; /* 04/04 */
1222 PVOID Reserved2[3]; /* 38/38 */
1223 HANDLE UniqueProcessId; /* 44/50 */
1224 PVOID Reserved3; /* 48/58 */
1225 ULONG HandleCount; /* 4c/60 */
1226 BYTE Reserved4[4]; /* 50/64 */
1227 PVOID Reserved5[11]; /* 54/68 */
1228 SIZE_T PeakPagefileUsage; /* 80/c0 */
1229 SIZE_T PrivatePageCount; /* 84/c8 */
1230 LARGE_INTEGER Reserved6[6]; /* 88/d0 */
1231 #endif
1232 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1233
1234 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1235 ULONG RegistryQuotaAllowed;
1236 ULONG RegistryQuotaUsed;
1237 PVOID Reserved1;
1238 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1239
1240 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1241 ULONG TimeAdjustment;
1242 BOOLEAN TimeAdjustmentDisabled;
1243 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1244
1245 typedef struct _TIME_FIELDS
1246 { CSHORT Year;
1247 CSHORT Month;
1248 CSHORT Day;
1249 CSHORT Hour;
1250 CSHORT Minute;
1251 CSHORT Second;
1252 CSHORT Milliseconds;
1253 CSHORT Weekday;
1254 } TIME_FIELDS, *PTIME_FIELDS;
1255
1256 typedef struct _WINSTATIONINFORMATIONW {
1257 BYTE Reserved2[70];
1258 ULONG LogonId;
1259 BYTE Reserved3[1140];
1260 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1261
1262 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1263
1264 typedef struct _LDR_RESOURCE_INFO
1265 {
1266 ULONG Type;
1267 ULONG Name;
1268 ULONG Language;
1269 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1270
1271
1272 /* debug buffer definitions */
1273
1274 typedef struct _DEBUG_BUFFER {
1275 HANDLE SectionHandle;
1276 PVOID SectionBase;
1277 PVOID RemoteSectionBase;
1278 ULONG SectionBaseDelta;
1279 HANDLE EventPairHandle;
1280 ULONG Unknown[2];
1281 HANDLE RemoteThreadHandle;
1282 ULONG InfoClassMask;
1283 ULONG SizeOfInfo;
1284 ULONG AllocatedSize;
1285 ULONG SectionSize;
1286 PVOID ModuleInformation;
1287 PVOID BackTraceInformation;
1288 PVOID HeapInformation;
1289 PVOID LockInformation;
1290 PVOID Reserved[8];
1291 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1292
1293 #define PDI_MODULES 0x01
1294 #define PDI_BACKTRACE 0x02
1295 #define PDI_HEAPS 0x04
1296 #define PDI_HEAP_TAGS 0x08
1297 #define PDI_HEAP_BLOCKS 0x10
1298 #define PDI_LOCKS 0x20
1299
1300 typedef struct _DEBUG_MODULE_INFORMATION {
1301 ULONG Reserved[2];
1302 ULONG Base;
1303 ULONG Size;
1304 ULONG Flags;
1305 USHORT Index;
1306 USHORT Unknown;
1307 USHORT LoadCount;
1308 USHORT ModuleNameOffset;
1309 CHAR ImageName[256];
1310 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1311
1312 typedef struct _DEBUG_HEAP_INFORMATION {
1313 ULONG Base;
1314 ULONG Flags;
1315 USHORT Granularity;
1316 USHORT Unknown;
1317 ULONG Allocated;
1318 ULONG Committed;
1319 ULONG TagCount;
1320 ULONG BlockCount;
1321 ULONG Reserved[7];
1322 PVOID Tags;
1323 PVOID Blocks;
1324 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1325
1326 typedef struct _DEBUG_LOCK_INFORMATION {
1327 PVOID Address;
1328 USHORT Type;
1329 USHORT CreatorBackTraceIndex;
1330 ULONG OwnerThreadId;
1331 ULONG ActiveCount;
1332 ULONG ContentionCount;
1333 ULONG EntryCount;
1334 ULONG RecursionCount;
1335 ULONG NumberOfSharedWaiters;
1336 ULONG NumberOfExclusiveWaiters;
1337 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1338
1339 typedef struct _PORT_MESSAGE_HEADER {
1340 USHORT DataSize;
1341 USHORT MessageSize;
1342 USHORT MessageType;
1343 USHORT VirtualRangesOffset;
1344 CLIENT_ID ClientId;
1345 ULONG MessageId;
1346 ULONG SectionSize;
1347 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1348
1349 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
1350
1351 /* Wine doesn't implement atom table as NT does:
1352 * - in NT, atom tables are user space tables, which ntdll directly accesses
1353 * - on Wine, (even local) atom tables are wineserver object, hence a HANDLE
1354 */
1355 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
1356
1357 typedef enum _ATOM_INFORMATION_CLASS {
1358 AtomBasicInformation = 0,
1359 AtomTableInformation = 1,
1360 } ATOM_INFORMATION_CLASS;
1361
1362 typedef struct _ATOM_BASIC_INFORMATION {
1363 USHORT ReferenceCount;
1364 USHORT Pinned;
1365 USHORT NameLength;
1366 WCHAR Name[1];
1367 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
1368
1369 /* FIXME: names probably not correct */
1370 typedef struct _RTL_HANDLE
1371 {
1372 struct _RTL_HANDLE * Next;
1373 } RTL_HANDLE;
1374
1375 /* FIXME: names probably not correct */
1376 typedef struct _RTL_HANDLE_TABLE
1377 {
1378 ULONG MaxHandleCount; /* 0x00 */
1379 ULONG HandleSize; /* 0x04 */
1380 ULONG Unused[2]; /* 0x08-0x0c */
1381 PVOID NextFree; /* 0x10 */
1382 PVOID FirstHandle; /* 0x14 */
1383 PVOID ReservedMemory; /* 0x18 */
1384 PVOID MaxHandle; /* 0x1c */
1385 } RTL_HANDLE_TABLE;
1386
1387 /***********************************************************************
1388 * Defines
1389 */
1390
1391 /* flags for NtCreateFile and NtOpenFile */
1392 #define FILE_DIRECTORY_FILE 0x00000001
1393 #define FILE_WRITE_THROUGH 0x00000002
1394 #define FILE_SEQUENTIAL_ONLY 0x00000004
1395 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1396 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1397 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1398 #define FILE_NON_DIRECTORY_FILE 0x00000040
1399 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1400 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1401 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1402 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400
1403 #define FILE_RANDOM_ACCESS 0x00000800
1404 #define FILE_DELETE_ON_CLOSE 0x00001000
1405 #define FILE_OPEN_BY_FILE_ID 0x00002000
1406 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1407 #define FILE_NO_COMPRESSION 0x00008000
1408 #define FILE_RESERVE_OPFILTER 0x00100000
1409 #define FILE_TRANSACTED_MODE 0x00200000
1410 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1411 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1412
1413 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1414 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1415
1416 /* status for NtCreateFile or NtOpenFile */
1417 #define FILE_SUPERSEDED 0
1418 #define FILE_OPENED 1
1419 #define FILE_CREATED 2
1420 #define FILE_OVERWRITTEN 3
1421 #define FILE_EXISTS 4
1422 #define FILE_DOES_NOT_EXIST 5
1423
1424 /* disposition for NtCreateFile */
1425 #define FILE_SUPERSEDE 0
1426 #define FILE_OPEN 1
1427 #define FILE_CREATE 2
1428 #define FILE_OPEN_IF 3
1429 #define FILE_OVERWRITE 4
1430 #define FILE_OVERWRITE_IF 5
1431 #define FILE_MAXIMUM_DISPOSITION 5
1432
1433 /* Characteristics of a File System */
1434 #define FILE_REMOVABLE_MEDIA 0x00000001
1435 #define FILE_READ_ONLY_DEVICE 0x00000002
1436 #define FILE_FLOPPY_DISKETTE 0x00000004
1437 #define FILE_WRITE_ONE_MEDIA 0x00000008
1438 #define FILE_REMOTE_DEVICE 0x00000010
1439 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1440 #define FILE_VIRTUAL_VOLUME 0x00000040
1441 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1442 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1443
1444 /* options for NtCreateNamedPipeFile */
1445 #define FILE_PIPE_INBOUND 0x00000000
1446 #define FILE_PIPE_OUTBOUND 0x00000001
1447 #define FILE_PIPE_FULL_DUPLEX 0x00000002
1448
1449 #if (_WIN32_WINNT >= 0x0501)
1450 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1451 #endif /* (_WIN32_WINNT >= 0x0501) */
1452
1453 #define LOGONID_CURRENT ((ULONG)-1)
1454
1455 #define OBJ_INHERIT 0x00000002L
1456 #define OBJ_PERMANENT 0x00000010L
1457 #define OBJ_EXCLUSIVE 0x00000020L
1458 #define OBJ_CASE_INSENSITIVE 0x00000040L
1459 #define OBJ_OPENIF 0x00000080L
1460 #define OBJ_OPENLINK 0x00000100L
1461 #define OBJ_KERNEL_HANDLE 0x00000200L
1462 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
1463
1464 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1465
1466 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1467 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1468
1469
1470 /* DbgPrintEx default levels */
1471 #define DPFLTR_ERROR_LEVEL 0
1472 #define DPFLTR_WARNING_LEVEL 1
1473 #define DPFLTR_TRACE_LEVEL 2
1474 #define DPFLTR_INFO_LEVEL 3
1475 #define DPFLTR_MASK 0x8000000
1476
1477 /* Well-known LUID values */
1478 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2L
1479 #define SE_CREATE_TOKEN_PRIVILEGE 2L
1480 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3L
1481 #define SE_LOCK_MEMORY_PRIVILEGE 4L
1482 #define SE_INCREASE_QUOTA_PRIVILEGE 5L
1483 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6L /* obsolete */
1484 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6L
1485 #define SE_TCB_PRIVILEGE 7L
1486 #define SE_SECURITY_PRIVILEGE 8L
1487 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9L
1488 #define SE_LOAD_DRIVER_PRIVILEGE 10L
1489 #define SE_SYSTEM_PROFILE_PRIVILEGE 11L
1490 #define SE_SYSTEMTIME_PRIVILEGE 12L
1491 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13L
1492 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14L
1493 #define SE_CREATE_PAGEFILE_PRIVILEGE 15L
1494 #define SE_CREATE_PERMANENT_PRIVILEGE 16L
1495 #define SE_BACKUP_PRIVILEGE 17L
1496 #define SE_RESTORE_PRIVILEGE 18L
1497 #define SE_SHUTDOWN_PRIVILEGE 19L
1498 #define SE_DEBUG_PRIVILEGE 20L
1499 #define SE_AUDIT_PRIVILEGE 21L
1500 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22L
1501 #define SE_CHANGE_NOTIFY_PRIVILLEGE 23L
1502 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24L
1503 #define SE_UNDOCK_PRIVILEGE 25L
1504 #define SE_SYNC_AGENT_PRIVILEGE 26L
1505 #define SE_ENABLE_DELEGATION_PRIVILEGE 27L
1506 #define SE_MANAGE_VOLUME_PRIVILEGE 28L
1507 #define SE_IMPERSONATE_PRIVILEGE 29L
1508 #define SE_CREATE_GLOBAL_PRIVILEGE 30L
1509 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1510
1511
1512 /* Rtl*Registry* functions structs and defines */
1513 #define RTL_REGISTRY_ABSOLUTE 0
1514 #define RTL_REGISTRY_SERVICES 1
1515 #define RTL_REGISTRY_CONTROL 2
1516 #define RTL_REGISTRY_WINDOWS_NT 3
1517 #define RTL_REGISTRY_DEVICEMAP 4
1518 #define RTL_REGISTRY_USER 5
1519
1520 #define RTL_REGISTRY_HANDLE 0x40000000
1521 #define RTL_REGISTRY_OPTIONAL 0x80000000
1522
1523 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1524 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1525 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1526 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1527 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1528 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1529 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1530
1531 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1532 ULONG ValueType,
1533 PVOID ValueData,
1534 ULONG ValueLength,
1535 PVOID Context,
1536 PVOID EntryContext);
1537
1538 typedef struct _RTL_QUERY_REGISTRY_TABLE
1539 {
1540 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1541 ULONG Flags;
1542 PWSTR Name;
1543 PVOID EntryContext;
1544 ULONG DefaultType;
1545 PVOID DefaultData;
1546 ULONG DefaultLength;
1547 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1548
1549 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
1550 {
1551 PUNICODE_STRING ValueName;
1552 ULONG DataLength;
1553 ULONG DataOffset;
1554 ULONG Type;
1555 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
1556
1557 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
1558
1559 typedef enum _EVENT_TYPE {
1560 NotificationEvent,
1561 SynchronizationEvent
1562 } EVENT_TYPE, *PEVENT_TYPE;
1563
1564 typedef enum _EVENT_INFORMATION_CLASS {
1565 EventBasicInformation
1566 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
1567
1568 typedef struct _EVENT_BASIC_INFORMATION {
1569 EVENT_TYPE EventType;
1570 LONG EventState;
1571 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
1572
1573 typedef enum _SEMAPHORE_INFORMATION_CLASS {
1574 SemaphoreBasicInformation
1575 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
1576
1577 typedef struct _SEMAPHORE_BASIC_INFORMATION {
1578 ULONG CurrentCount;
1579 ULONG MaximumCount;
1580 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
1581
1582 typedef enum _SECTION_INFORMATION_CLASS
1583 {
1584 SectionBasicInformation,
1585 SectionImageInformation,
1586 } SECTION_INFORMATION_CLASS;
1587
1588 typedef struct _SECTION_BASIC_INFORMATION {
1589 ULONG BaseAddress;
1590 ULONG Attributes;
1591 LARGE_INTEGER Size;
1592 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
1593
1594 typedef struct _SECTION_IMAGE_INFORMATION {
1595 PVOID EntryPoint;
1596 ULONG StackZeroBits;
1597 ULONG StackReserved;
1598 ULONG StackCommit;
1599 ULONG ImageSubsystem;
1600 WORD SubsystemVersionLow;
1601 WORD SubsystemVersionHigh;
1602 ULONG Unknown1;
1603 ULONG ImageCharacteristics;
1604 ULONG ImageMachineType;
1605 ULONG Unknown2[3];
1606 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
1607
1608 typedef struct _LPC_SECTION_WRITE {
1609 ULONG Length;
1610 HANDLE SectionHandle;
1611 ULONG SectionOffset;
1612 ULONG ViewSize;
1613 PVOID ViewBase;
1614 PVOID TargetViewBase;
1615 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
1616
1617 typedef struct _LPC_SECTION_READ {
1618 ULONG Length;
1619 ULONG ViewSize;
1620 PVOID ViewBase;
1621 } LPC_SECTION_READ, *PLPC_SECTION_READ;
1622
1623 typedef struct _LPC_MESSAGE {
1624 USHORT DataSize;
1625 USHORT MessageSize;
1626 USHORT MessageType;
1627 USHORT VirtualRangesOffset;
1628 CLIENT_ID ClientId;
1629 ULONG MessageId;
1630 ULONG SectionSize;
1631 UCHAR Data[ANYSIZE_ARRAY];
1632 } LPC_MESSAGE, *PLPC_MESSAGE;
1633
1634 typedef enum _SHUTDOWN_ACTION {
1635 ShutdownNoReboot,
1636 ShutdownReboot,
1637 ShutdownPowerOff
1638 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
1639
1640 typedef enum _KPROFILE_SOURCE {
1641 ProfileTime,
1642 ProfileAlignmentFixup,
1643 ProfileTotalIssues,
1644 ProfilePipelineDry,
1645 ProfileLoadInstructions,
1646 ProfilePipelineFrozen,
1647 ProfileBranchInstructions,
1648 ProfileTotalNonissues,
1649 ProfileDcacheMisses,
1650 ProfileIcacheMisses,
1651 ProfileCacheMisses,
1652 ProfileBranchMispredictions,
1653 ProfileStoreInstructions,
1654 ProfileFpInstructions,
1655 ProfileIntegerInstructions,
1656 Profile2Issue,
1657 Profile3Issue,
1658 Profile4Issue,
1659 ProfileSpecialInstructions,
1660 ProfileTotalCycles,
1661 ProfileIcacheIssues,
1662 ProfileDcacheAccesses,
1663 ProfileMemoryBarrierCycles,
1664 ProfileLoadLinkedIssues,
1665 ProfileMaximum
1666 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
1667
1668 typedef struct _OBJDIR_INFORMATION {
1669 UNICODE_STRING ObjectName;
1670 UNICODE_STRING ObjectTypeName;
1671 BYTE Data[1];
1672 } OBJDIR_INFORMATION, *POBJDIR_INFORMATION;
1673
1674 typedef struct _INITIAL_TEB {
1675 PVOID StackBase;
1676 PVOID StackLimit;
1677 PVOID StackCommit;
1678 PVOID StackCommitMax;
1679 PVOID StackReserved;
1680 } INITIAL_TEB, *PINITIAL_TEB;
1681
1682 typedef enum _PORT_INFORMATION_CLASS {
1683 PortNoInformation
1684 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
1685
1686 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
1687 IoCompletionBasicInformation
1688 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
1689
1690 typedef struct _FILE_COMPLETION_INFORMATION {
1691 HANDLE CompletionPort;
1692 ULONG_PTR CompletionKey;
1693 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
1694
1695 typedef enum _HARDERROR_RESPONSE_OPTION {
1696 OptionAbortRetryIgnore,
1697 OptionOk,
1698 OptionOkCancel,
1699 OptionRetryCancel,
1700 OptionYesNo,
1701 OptionYesNoCancel,
1702 OptionShutdownSystem
1703 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
1704
1705 typedef enum _HARDERROR_RESPONSE {
1706 ResponseReturnToCaller,
1707 ResponseNotHandled,
1708 ResponseAbort,
1709 ResponseCancel,
1710 ResponseIgnore,
1711 ResponseNo,
1712 ResponseOk,
1713 ResponseRetry,
1714 ResponseYes
1715 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
1716
1717 typedef enum _SYSDBG_COMMAND {
1718 SysDbgQueryModuleInformation,
1719 SysDbgQueryTraceInformation,
1720 SysDbgSetTracepoint,
1721 SysDbgSetSpecialCall,
1722 SysDbgClearSpecialCalls,
1723 SysDbgQuerySpecialCalls
1724 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
1725
1726 /***********************************************************************
1727 * Function declarations
1728 */
1729
1730 #if defined(__i386__) && defined(__GNUC__)
1731 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1732 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1733 #else /* __i386__ && __GNUC__ */
1734 void WINAPI DbgBreakPoint(void);
1735 void WINAPI DbgUserBreakPoint(void);
1736 #endif /* __i386__ && __GNUC__ */
1737 //NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1738 NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
1739
1740 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
1741 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
1742 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
1743 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1744 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
1745 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
1746 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
1747 void WINAPI LdrShutdownProcess(void);
1748 void WINAPI LdrShutdownThread(void);
1749 NTSTATUS WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
1750 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
1751 NTSTATUS WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PULONG,PULONG,PBOOLEAN);
1752 NTSTATUS WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
1753 NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
1754 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1755 NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
1756 NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
1757 NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
1758 NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG);
1759 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,SIZE_T*,ULONG,ULONG);
1760 NTSTATUS WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
1761 NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1762 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1763 NTSTATUS WINAPI NtClearEvent(HANDLE);
1764 NTSTATUS WINAPI NtClose(HANDLE);
1765 NTSTATUS WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
1766 NTSTATUS WINAPI NtCompleteConnectPort(HANDLE);
1767 NTSTATUS WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1768 NTSTATUS WINAPI NtContinue(PCONTEXT,BOOLEAN);
1769 NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1770 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1771 NTSTATUS WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1772 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1773 NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
1774 NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1775 NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1776 NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
1777 NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1778 NTSTATUS WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
1779 NTSTATUS WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
1780 NTSTATUS WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
1781 //NTSTATUS WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
1782 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1783 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
1784 NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
1785 NTSTATUS WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
1786 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1787 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);
1788 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1789 NTSTATUS WINAPI NtDeleteAtom(RTL_ATOM);
1790 NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
1791 NTSTATUS WINAPI NtDeleteKey(HANDLE);
1792 NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
1793 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1794 NTSTATUS WINAPI NtDisplayString(PUNICODE_STRING);
1795 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1796 NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1797 NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1798 NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1799 NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
1800 NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
1801 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1802 NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
1803 NTSTATUS WINAPI NtFlushKey(HANDLE);
1804 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,PIO_STATUS_BLOCK);
1805 NTSTATUS WINAPI NtFlushWriteBuffer(VOID);
1806 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1807 NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1808 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1809 NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
1810 ULONG WINAPI NtGetTickCount(VOID);
1811 NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1812 NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1813 NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
1814 NTSTATUS WINAPI NtInitializeRegistry(BOOLEAN);
1815 NTSTATUS WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
1816 NTSTATUS WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
1817 NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
1818 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
1819 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1820 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1821 NTSTATUS WINAPI NtMakeTemporaryObject(HANDLE);
1822 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
1823 NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
1824 NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1825 NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1826 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1827 NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1828 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1829 NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1830 NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1831 NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1832 NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
1833 NTSTATUS WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1834 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1835 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1836 NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1837 NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1838 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1839 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1840 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1841 NTSTATUS WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
1842 NTSTATUS WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
1843 NTSTATUS WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
1844 NTSTATUS WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
1845 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
1846 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1847 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1848 NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
1849 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1850 NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
1851 NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1852 NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE,POBJDIR_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
1853 NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1854 NTSTATUS WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1855 NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1856 NTSTATUS WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,RTL_ATOM_TABLE,ULONG,ULONG*);
1857 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1858 NTSTATUS WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1859 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1860 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1861 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1862 NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
1863 NTSTATUS WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
1864 NTSTATUS WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1865 NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1866 NTSTATUS WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
1867 NTSTATUS WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1868 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1869 NTSTATUS WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
1870 NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
1871 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1872 NTSTATUS WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1873 NTSTATUS WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1874 NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
1875 NTSTATUS WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
1876 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1877 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1878 NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1879 NTSTATUS WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
1880 NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1881 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
1882 NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1883 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1884 NTSTATUS WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
1885 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1886 NTSTATUS WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT,ULONG,PLARGE_INTEGER,PULONG);
1887 NTSTATUS WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
1888 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1889 NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE);
1890 NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
1891 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1892 NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER);
1893 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
1894 NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
1895 NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
1896 NTSTATUS WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
1897 NTSTATUS WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
1898 NTSTATUS WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
1899 NTSTATUS WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
1900 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1901 NTSTATUS WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
1902 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1903 NTSTATUS WINAPI NtSaveKey(HANDLE,HANDLE);
1904 NTSTATUS WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
1905 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1906 NTSTATUS WINAPI NtSetDefaultHardErrorPort(HANDLE);
1907 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
1908 NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
1909 NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1910 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1911 NTSTATUS WINAPI NtSetHighEventPair(HANDLE);
1912 NTSTATUS WINAPI NtSetHighWaitLowEventPair(HANDLE);
1913 NTSTATUS WINAPI NtSetHighWaitLowThread(VOID);
1914 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1915 NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
1916 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1917 NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
1918 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1919 NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
1920 NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
1921 NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1922 NTSTATUS WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY);
1923 NTSTATUS WINAPI NtSetLowEventPair(HANDLE);
1924 NTSTATUS WINAPI NtSetLowWaitHighEventPair(HANDLE);
1925 NTSTATUS WINAPI NtSetLowWaitHighThread(VOID);
1926 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1927 NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
1928 NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
1929 NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
1930 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1931 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1932 NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
1933 NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1934 NTSTATUS WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1935 NTSTATUS WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
1936 NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
1937 NTSTATUS WINAPI NtStartProfile(HANDLE);
1938 NTSTATUS WINAPI NtStopProfile(HANDLE);
1939 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
1940 NTSTATUS WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
1941 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1942 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
1943 NTSTATUS WINAPI NtTestAlert(VOID);
1944 NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
1945 NTSTATUS WINAPI NtUnloadKey(HANDLE);
1946 NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
1947 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
1948 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
1949 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
1950 NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
1951 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1952 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1953 NTSTATUS WINAPI NtWaitHighEventPair(HANDLE);
1954 NTSTATUS WINAPI NtWaitLowEventPair(HANDLE);
1955 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1956 NTSTATUS WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT,ULONG,PLARGE_INTEGER,PULONG);
1957 NTSTATUS WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
1958 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
1959 NTSTATUS WINAPI NtYieldExecution(void);
1960
1961 void WINAPI RtlAcquirePebLock(void);
1962 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1963 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1964 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
1965 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1966 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1967 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1968 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1969 NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
1970 NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
1971 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1972 NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
1973 NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1974 RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
1975 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T);
1976 WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
1977 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1978 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1979 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1980 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1981 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1982 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
1983 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1984 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1985 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1986 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1987
1988 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1989 NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
1990 void WINAPI RtlClearAllBits(PRTL_BITMAP);
1991 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1992 PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
1993 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1994 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1995 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1996 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
1997 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1998 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1999 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
2000 void WINAPI RtlCopyLuid(PLUID,const LUID*);
2001 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
2002 BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
2003 NTSTATUS WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
2004 void WINAPI RtlCopyString(STRING*,const STRING*);
2005 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
2006 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
2007 NTSTATUS WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
2008 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
2009 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
2010 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
2011 const UNICODE_STRING*,const UNICODE_STRING*,
2012 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
2013 const UNICODE_STRING*,const UNICODE_STRING*,
2014 const UNICODE_STRING*);
2015 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
2016 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
2017 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
2018 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
2019
2020 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
2021 NTSTATUS WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
2022 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
2023 NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
2024 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
2025 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
2026 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2027 NTSTATUS WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
2028 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
2029 NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
2030 HANDLE WINAPI RtlDestroyHeap(HANDLE);
2031 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
2032 NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
2033 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
2034 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
2035 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PCWSTR*,CURDIR*);
2036 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
2037 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
2038 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2039 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
2040 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
2041
2042 NTSTATUS WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
2043 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
2044 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
2045 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
2046 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
2047 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
2048 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
2049 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
2050 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
2051 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
2052 BOOL WINAPI RtlEqualSid(PSID,PSID);
2053 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
2054 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2055 DECLSPEC_NORETURN void WINAPI RtlExitUserThread(ULONG);
2056 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
2057 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
2058 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
2059 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
2060
2061 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
2062 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
2063 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
2064 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2065 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2066 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2067 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
2068 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
2069 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
2070 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
2071 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
2072 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
2073 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
2074 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
2075 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
2076 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
2077 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
2078 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
2079 NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
2080 void WINAPI RtlFreeAnsiString(PANSI_STRING);
2081 BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
2082 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
2083 void WINAPI RtlFreeOemString(POEM_STRING);
2084 DWORD WINAPI RtlFreeSid(PSID);
2085 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
2086
2087 NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
2088 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
2089 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
2090 PEB * WINAPI RtlGetCurrentPeb(void);
2091 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2092 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
2093 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2094 NTSTATUS WINAPI RtlGetLastNtStatus(void);
2095 DWORD WINAPI RtlGetLastWin32Error(void);
2096 DWORD WINAPI RtlGetLongestNtPathLength(void);
2097 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
2098 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
2099 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
2100 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
2101 //NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
2102 NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
2103
2104 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
2105 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
2106 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
2107 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
2108 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
2109 NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
2110 void WINAPI RtlInitString(PSTRING,PCSZ);
2111 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
2112 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
2113 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
2114 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
2115 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
2116 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
2117 void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
2118 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
2119 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
2120
2121 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
2122 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
2123 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
2124 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
2125 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
2126 BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
2127 BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
2128 BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
2129
2130 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
2131 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
2132 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
2133 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
2134 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
2135 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
2136 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
2137 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
2138 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
2139 DWORD WINAPI RtlLengthRequiredSid(DWORD);
2140 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
2141 DWORD WINAPI RtlLengthSid(PSID);
2142 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2143 BOOLEAN WINAPI RtlLockHeap(HANDLE);
2144 NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
2145
2146 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
2147 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
2148 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2149 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
2150
2151 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
2152 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
2153 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
2154 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
2155 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
2156 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
2157
2158 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
2159 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
2160 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
2161 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
2162
2163 NTSTATUS WINAPI RtlPinAtomInAtomTable(PRTL_ATOM_TABLE,RTL_ATOM);
2164 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
2165 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
2166
2167 NTSTATUS WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
2168 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
2169 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
2170 NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
2171 NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
2172 NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
2173 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
2174 void WINAPI RtlRaiseStatus(NTSTATUS);
2175 ULONG WINAPI RtlRandom(PULONG);
2176 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
2177 void WINAPI RtlReleasePebLock(void);
2178 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
2179 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
2180 void WINAPI RtlRestoreLastWin32Error(DWORD);
2181
2182 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
2183 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
2184 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
2185 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
2186 void WINAPI RtlSetAllBits(PRTL_BITMAP);
2187 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
2188 ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
2189 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
2190 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
2191 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2192 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
2193 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2194 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
2195 void WINAPI RtlSetLastWin32Error(DWORD);
2196 void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
2197 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
2198 NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
2199 SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
2200 NTSTATUS WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
2201 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
2202 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
2203 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
2204
2205 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
2206 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
2207 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
2208 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
2209 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
2210 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
2211
2212 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
2213 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
2214 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
2215 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
2216 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
2217 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
2218 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2219 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
2220 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2221 ULONG WINAPI RtlUniform(PULONG);
2222 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
2223 #ifdef __ia64__
2224 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
2225 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
2226 #endif
2227 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
2228 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
2229 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
2230 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2231 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
2232 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2233 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
2234 CHAR WINAPI RtlUpperChar(CHAR);
2235 void WINAPI RtlUpperString(STRING *,const STRING *);
2236
2237 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
2238 BOOLEAN WINAPI RtlValidAcl(PACL);
2239 BOOLEAN WINAPI RtlValidSid(PSID);
2240 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
2241 //NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
2242
2243 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
2244
2245 NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
2246 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
2247 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
2248
2249 ULONG WINAPI
2250 vDbgPrintEx(IN ULONG ComponentId,
2251 IN ULONG Level,
2252 IN LPCSTR Format,
2253 IN va_list ap);
2254 ULONG WINAPI
2255 vDbgPrintExWithPrefix(IN LPCSTR Prefix,
2256 IN ULONG ComponentId,
2257 IN ULONG Level,
2258 IN LPCSTR Format,
2259 IN va_list ap);
2260
2261 /* Wine internal functions */
2262
2263 extern NTSTATUS wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
2264 UINT disposition, BOOLEAN check_case );
2265
2266 /***********************************************************************
2267 * Inline functions
2268 */
2269
2270 #define InitializeObjectAttributes(p,n,a,r,s) \
2271 do { \
2272 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
2273 (p)->RootDirectory = r; \
2274 (p)->Attributes = a; \
2275 (p)->ObjectName = n; \
2276 (p)->SecurityDescriptor = s; \
2277 (p)->SecurityQualityOfService = NULL; \
2278 } while (0)
2279
2280 #define NtCurrentProcess() ((HANDLE)-1)
2281
2282 #ifndef RtlFillMemory
2283 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
2284 #endif
2285 #ifndef RtlMoveMemory
2286 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
2287 #endif
2288 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2289 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
2290 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
2291 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
2292 #ifndef RtlZeroMemory
2293 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
2294 #endif
2295
2296 static __inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
2297 {
2298 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
2299 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
2300 return TRUE;
2301 return FALSE;
2302 }
2303
2304 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
2305 static __inline USHORT RtlUshortByteSwap(USHORT s)
2306 {
2307 return (s >> 8) | (s << 8);
2308 }
2309 static __inline ULONG RtlUlongByteSwap(ULONG i)
2310 {
2311 #if defined(__i386__) && defined(__GNUC__)
2312 ULONG ret;
2313 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
2314 return ret;
2315 #else
2316 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
2317 #endif
2318 }
2319
2320 /*************************************************************************
2321 * Loader functions and structures.
2322 *
2323 * Those are not part of standard Winternl.h
2324 */
2325 typedef struct _LDR_MODULE
2326 {
2327 LIST_ENTRY InLoadOrderModuleList;
2328 LIST_ENTRY InMemoryOrderModuleList;
2329 LIST_ENTRY InInitializationOrderModuleList;
2330 void* BaseAddress;
2331 void* EntryPoint;
2332 ULONG SizeOfImage;
2333 UNICODE_STRING FullDllName;
2334 UNICODE_STRING BaseDllName;
2335 ULONG Flags;
2336 SHORT LoadCount;
2337 SHORT TlsIndex;
2338 HANDLE SectionHandle;
2339 ULONG CheckSum;
2340 ULONG TimeDateStamp;
2341 } LDR_MODULE, *PLDR_MODULE;
2342
2343 /* those defines are (some of the) regular LDR_MODULE.Flags values */
2344 #define LDR_IMAGE_IS_DLL 0x00000004
2345 #define LDR_LOAD_IN_PROGRESS 0x00001000
2346 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2347 #define LDR_NO_DLL_CALLS 0x00040000
2348 #define LDR_PROCESS_ATTACHED 0x00080000
2349 #define LDR_MODULE_REBASED 0x00200000
2350
2351 /* these ones is Wine specific */
2352 #define LDR_DONT_RESOLVE_REFS 0x40000000
2353 #define LDR_WINE_INTERNAL 0x80000000
2354
2355 /* FIXME: to be checked */
2356 #define MAXIMUM_FILENAME_LENGTH 256
2357
2358 typedef struct _SYSTEM_MODULE
2359 {
2360 ULONG Reserved1;
2361 ULONG Reserved2;
2362 PVOID ImageBaseAddress;
2363 ULONG ImageSize;
2364 ULONG Flags;
2365 WORD Id;
2366 WORD Rank;
2367 WORD Unknown;
2368 WORD NameOffset;
2369 BYTE Name[MAXIMUM_FILENAME_LENGTH];
2370 } SYSTEM_MODULE, *PSYSTEM_MODULE;
2371
2372 typedef struct _SYSTEM_MODULE_INFORMATION
2373 {
2374 ULONG ModulesCount;
2375 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2376 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
2377
2378 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
2379 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
2380 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
2381 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
2382 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
2383 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
2384
2385 /* list manipulation macros */
2386 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
2387 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
2388 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
2389 #define IsListEmpty(le) ((le)->Flink == (le))
2390 #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)
2391 static __inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
2392 {
2393 PLIST_ENTRY f, b, e;
2394
2395 e = le->Flink;
2396 f = le->Flink->Flink;
2397 b = le->Flink->Blink;
2398 f->Blink = b;
2399 b->Flink = f;
2400
2401 if (e != le) e->Flink = e->Blink = NULL;
2402 return e;
2403 }
2404 static __inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
2405 {
2406 PLIST_ENTRY f, b, e;
2407
2408 e = le->Blink;
2409 f = le->Blink->Flink;
2410 b = le->Blink->Blink;
2411 f->Blink = b;
2412 b->Flink = f;
2413
2414 if (e != le) e->Flink = e->Blink = NULL;
2415 return e;
2416 }
2417
2418 #ifdef __cplusplus
2419 } /* extern "C" */
2420 #endif /* defined(__cplusplus) */
2421
2422 #endif /* __WINE_WINTERNL_H */