Convert the per-thread mutex list to a standard list.
[wine.git] / include / winternl.h
blobe4474958dae9aa612e14d13cfbbbb5aab168511b
1 /*
2 * Internal NT APIs and data structures
4 * Copyright (C) the Wine project
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_WINTERNL_H
22 #define __WINE_WINTERNL_H
24 #include <windef.h>
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* defined(__cplusplus) */
31 /**********************************************************************
32 * Fundamental types and data structures
35 typedef LONG NTSTATUS;
37 typedef CONST char *PCSZ;
39 typedef short CSHORT;
40 typedef CSHORT *PCSHORT;
42 typedef struct _STRING {
43 USHORT Length;
44 USHORT MaximumLength;
45 PCHAR Buffer;
46 } STRING, *PSTRING;
48 typedef STRING ANSI_STRING;
49 typedef PSTRING PANSI_STRING;
50 typedef const STRING *PCANSI_STRING;
52 typedef STRING OEM_STRING;
53 typedef PSTRING POEM_STRING;
54 typedef const STRING *PCOEM_STRING;
56 typedef struct _UNICODE_STRING {
57 USHORT Length; /* bytes */
58 USHORT MaximumLength; /* bytes */
59 PWSTR Buffer;
60 } UNICODE_STRING, *PUNICODE_STRING;
62 typedef const UNICODE_STRING *PCUNICODE_STRING;
64 typedef struct _CLIENT_ID
66 HANDLE UniqueProcess;
67 HANDLE UniqueThread;
68 } CLIENT_ID, *PCLIENT_ID;
70 typedef struct _CURDIR
72 UNICODE_STRING DosPath;
73 PVOID Handle;
74 } CURDIR, *PCURDIR;
76 typedef struct RTL_DRIVE_LETTER_CURDIR
78 USHORT Flags;
79 USHORT Length;
80 ULONG TimeStamp;
81 UNICODE_STRING DosPath;
82 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
84 typedef struct tagRTL_BITMAP {
85 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
86 PULONG Buffer; /* Bitmap data, assumed sized to a DWORD boundary */
87 } RTL_BITMAP, *PRTL_BITMAP;
89 typedef const RTL_BITMAP *PCRTL_BITMAP;
91 typedef struct tagRTL_BITMAP_RUN {
92 ULONG StartingIndex; /* Bit position at which run starts */
93 ULONG NumberOfBits; /* Size of the run in bits */
94 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
96 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
98 typedef struct _RTL_USER_PROCESS_PARAMETERS
100 ULONG AllocationSize;
101 ULONG Size;
102 ULONG Flags;
103 ULONG DebugFlags;
104 HANDLE ConsoleHandle;
105 ULONG ConsoleFlags;
106 HANDLE hStdInput;
107 HANDLE hStdOutput;
108 HANDLE hStdError;
109 CURDIR CurrentDirectory;
110 UNICODE_STRING DllPath;
111 UNICODE_STRING ImagePathName;
112 UNICODE_STRING CommandLine;
113 PWSTR Environment;
114 ULONG dwX;
115 ULONG dwY;
116 ULONG dwXSize;
117 ULONG dwYSize;
118 ULONG dwXCountChars;
119 ULONG dwYCountChars;
120 ULONG dwFillAttribute;
121 ULONG dwFlags;
122 ULONG wShowWindow;
123 UNICODE_STRING WindowTitle;
124 UNICODE_STRING Desktop;
125 UNICODE_STRING ShellInfo;
126 UNICODE_STRING RuntimeInfo;
127 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
128 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
130 /* value for Flags field (FIXME: not the correct name) */
131 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
133 typedef struct _PEB_LDR_DATA
135 ULONG Length;
136 BOOLEAN Initialized;
137 PVOID SsHandle;
138 LIST_ENTRY InLoadOrderModuleList;
139 LIST_ENTRY InMemoryOrderModuleList;
140 LIST_ENTRY InInitializationOrderModuleList;
141 } PEB_LDR_DATA, *PPEB_LDR_DATA;
143 /***********************************************************************
144 * PEB data structure
146 typedef struct _PEB
148 BOOLEAN InheritedAddressSpace; /* 00 */
149 BOOLEAN ReadImageFileExecOptions; /* 01 */
150 BOOLEAN BeingDebugged; /* 02 */
151 BOOLEAN SpareBool; /* 03 */
152 HANDLE Mutant; /* 04 */
153 HMODULE ImageBaseAddress; /* 08 */
154 PPEB_LDR_DATA LdrData; /* 0c */
155 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10 */
156 PVOID SubSystemData; /* 14 */
157 HANDLE ProcessHeap; /* 18 */
158 PRTL_CRITICAL_SECTION FastPebLock; /* 1c */
159 PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 20 */
160 PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 24 */
161 ULONG EnvironmentUpdateCount; /* 28 */
162 PVOID KernelCallbackTable; /* 2c */
163 PVOID EventLogSection; /* 30 */
164 PVOID EventLog; /* 34 */
165 PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 38 */
166 ULONG TlsExpansionCounter; /* 3c */
167 PRTL_BITMAP TlsBitmap; /* 40 */
168 ULONG TlsBitmapBits[2]; /* 44 */
169 PVOID ReadOnlySharedMemoryBase; /* 4c */
170 PVOID ReadOnlySharedMemoryHeap; /* 50 */
171 PVOID *ReadOnlyStaticServerData; /* 54 */
172 PVOID AnsiCodePageData; /* 58 */
173 PVOID OemCodePageData; /* 5c */
174 PVOID UnicodeCaseTableData; /* 60 */
175 ULONG NumberOfProcessors; /* 64 */
176 ULONG NtGlobalFlag; /* 68 */
177 BYTE Spare2[4]; /* 6c */
178 LARGE_INTEGER CriticalSectionTimeout; /* 70 */
179 ULONG HeapSegmentReserve; /* 78 */
180 ULONG HeapSegmentCommit; /* 7c */
181 ULONG HeapDeCommitTotalFreeThreshold; /* 80 */
182 ULONG HeapDeCommitFreeBlockThreshold; /* 84 */
183 ULONG NumberOfHeaps; /* 88 */
184 ULONG MaximumNumberOfHeaps; /* 8c */
185 PVOID *ProcessHeaps; /* 90 */
186 PVOID GdiSharedHandleTable; /* 94 */
187 PVOID ProcessStarterHelper; /* 98 */
188 PVOID GdiDCAttributeList; /* 9c */
189 PVOID LoaderLock; /* a0 */
190 ULONG OSMajorVersion; /* a4 */
191 ULONG OSMinorVersion; /* a8 */
192 ULONG OSBuildNumber; /* ac */
193 ULONG OSPlatformId; /* b0 */
194 ULONG ImageSubSystem; /* b4 */
195 ULONG ImageSubSystemMajorVersion; /* b8 */
196 ULONG ImageSubSystemMinorVersion; /* bc */
197 ULONG ImageProcessAffinityMask; /* c0 */
198 ULONG GdiHandleBuffer[34]; /* c4 */
199 ULONG PostProcessInitRoutine; /* 14c */
200 ULONG TlsExpansionBitmap; /* 150 */
201 ULONG TlsExpansionBitmapBits[32]; /* 154 */
202 ULONG SessionId; /* 1d4 */
203 } PEB, *PPEB;
206 /***********************************************************************
207 * TEB data structure
209 #if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
210 # define WINE_NO_TEB
211 #endif
213 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
214 # ifndef WINE_TEB_DEFINED
215 # define WINE_TEB_DEFINED
216 typedef struct _TEB
218 NT_TIB Tib; /* 000 */
219 PVOID EnvironmentPointer; /* 01c */
220 CLIENT_ID ClientId; /* 020 */
221 PVOID ActiveRpcHandle; /* 028 */
222 PVOID ThreadLocalStoragePointer; /* 02c */
223 PPEB Peb; /* 030 */
224 ULONG LastErrorValue; /* 034 */
225 BYTE __pad038[140]; /* 038 */
226 ULONG CurrentLocale; /* 0c4 */
227 BYTE __pad0c8[1752]; /* 0c8 */
228 PVOID Reserved2[277]; /* 7a0 */
229 ULONG LastStatusValue; /* bf4 */
230 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
231 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
232 PVOID DeallocationStack; /* e0c */
233 PVOID TlsSlots[64]; /* e10 */
234 LIST_ENTRY TlsLinks; /* f10 */
235 PVOID Reserved4[26]; /* f18 */
236 PVOID ReservedForOle; /* f80 Windows 2000 only */
237 PVOID Reserved5[4]; /* f84 */
238 PVOID TlsExpansionSlots; /* f94 */
239 } TEB, *PTEB;
240 # endif /* WINE_TEB_DEFINED */
241 #endif /* WINE_NO_TEB */
243 /***********************************************************************
244 * Enums
247 typedef enum _FILE_INFORMATION_CLASS {
248 FileDirectoryInformation = 1,
249 FileFullDirectoryInformation,
250 FileBothDirectoryInformation,
251 FileBasicInformation,
252 FileStandardInformation,
253 FileInternalInformation,
254 FileEaInformation,
255 FileAccessInformation,
256 FileNameInformation,
257 FileRenameInformation,
258 FileLinkInformation,
259 FileNamesInformation,
260 FileDispositionInformation,
261 FilePositionInformation,
262 FileFullEaInformation,
263 FileModeInformation,
264 FileAlignmentInformation,
265 FileAllInformation,
266 FileAllocationInformation,
267 FileEndOfFileInformation,
268 FileAlternateNameInformation,
269 FileStreamInformation,
270 FilePipeInformation,
271 FilePipeLocalInformation,
272 FilePipeRemoteInformation,
273 FileMailslotQueryInformation,
274 FileMailslotSetInformation,
275 FileCompressionInformation,
276 FileObjectIdInformation,
277 FileCompletionInformation,
278 FileMoveClusterInformation,
279 FileQuotaInformation,
280 FileReparsePointInformation,
281 FileNetworkOpenInformation,
282 FileAttributeTagInformation,
283 FileTrackingInformation,
284 FileMaximumInformation
285 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
287 typedef struct _FILE_DIRECTORY_INFORMATION {
288 ULONG NextEntryOffset;
289 ULONG FileIndex;
290 LARGE_INTEGER CreationTime;
291 LARGE_INTEGER LastAccessTime;
292 LARGE_INTEGER LastWriteTime;
293 LARGE_INTEGER ChangeTime;
294 LARGE_INTEGER EndOfFile;
295 LARGE_INTEGER AllocationSize;
296 ULONG FileAttributes;
297 ULONG FileNameLength;
298 WCHAR FileName[ANYSIZE_ARRAY];
299 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
301 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
302 ULONG NextEntryOffset;
303 ULONG FileIndex;
304 LARGE_INTEGER CreationTime;
305 LARGE_INTEGER LastAccessTime;
306 LARGE_INTEGER LastWriteTime;
307 LARGE_INTEGER ChangeTime;
308 LARGE_INTEGER EndOfFile;
309 LARGE_INTEGER AllocationSize;
310 ULONG FileAttributes;
311 ULONG FileNameLength;
312 ULONG EaSize;
313 WCHAR FileName[ANYSIZE_ARRAY];
314 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
315 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
317 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
318 ULONG NextEntryOffset;
319 ULONG FileIndex;
320 LARGE_INTEGER CreationTime;
321 LARGE_INTEGER LastAccessTime;
322 LARGE_INTEGER LastWriteTime;
323 LARGE_INTEGER ChangeTime;
324 LARGE_INTEGER EndOfFile;
325 LARGE_INTEGER AllocationSize;
326 ULONG FileAttributes;
327 ULONG FileNameLength;
328 ULONG EaSize;
329 CHAR ShortNameLength;
330 WCHAR ShortName[12];
331 WCHAR FileName[ANYSIZE_ARRAY];
332 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
333 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
335 typedef struct _FILE_BASIC_INFORMATION {
336 LARGE_INTEGER CreationTime;
337 LARGE_INTEGER LastAccessTime;
338 LARGE_INTEGER LastWriteTime;
339 LARGE_INTEGER ChangeTime;
340 ULONG FileAttributes;
341 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
343 typedef struct _FILE_STANDARD_INFORMATION {
344 LARGE_INTEGER AllocationSize;
345 LARGE_INTEGER EndOfFile;
346 ULONG NumberOfLinks;
347 BOOLEAN DeletePending;
348 BOOLEAN Directory;
349 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
351 typedef struct _FILE_INTERNAL_INFORMATION {
352 LARGE_INTEGER IndexNumber;
353 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
355 typedef struct _FILE_EA_INFORMATION {
356 ULONG EaSize;
357 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
359 typedef struct _FILE_ACCESS_INFORMATION {
360 ACCESS_MASK AccessFlags;
361 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
363 typedef struct _FILE_NAME_INFORMATION {
364 ULONG FileNameLength;
365 WCHAR FileName[1];
366 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
368 typedef struct _FILE_RENAME_INFORMATION {
369 BOOLEAN Replace;
370 HANDLE RootDir;
371 ULONG FileNameLength;
372 WCHAR FileName[1];
373 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
375 typedef struct _FILE_NAMES_INFORMATION {
376 ULONG NextEntryOffset;
377 ULONG FileIndex;
378 ULONG FileNameLength;
379 WCHAR FileName[1];
380 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
382 typedef struct _FILE_DISPOSITION_INFORMATION {
383 BOOLEAN DoDeleteFile;
384 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
386 typedef struct _FILE_POSITION_INFORMATION {
387 LARGE_INTEGER CurrentByteOffset;
388 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
390 typedef struct _FILE_ALIGNMENT_INFORMATION {
391 ULONG AlignmentRequirement;
392 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
394 typedef struct _FILE_ALLOCATION_INFORMATION {
395 LARGE_INTEGER AllocationSize;
396 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
398 typedef struct _FILE_END_OF_FILE_INFORMATION {
399 LARGE_INTEGER EndOfFile;
400 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
402 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
403 LARGE_INTEGER CreationTime;
404 LARGE_INTEGER LastAccessTime;
405 LARGE_INTEGER LastWriteTime;
406 LARGE_INTEGER ChangeTime;
407 LARGE_INTEGER AllocationSize;
408 LARGE_INTEGER EndOfFile;
409 ULONG FileAttributes;
410 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
412 typedef struct _FILE_FULL_EA_INFORMATION {
413 ULONG NextEntryOffset;
414 UCHAR Flags;
415 UCHAR EaNameLength;
416 USHORT EaValueLength;
417 CHAR EaName[1];
418 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
420 typedef struct _FILE_MODE_INFORMATION {
421 ULONG Mode;
422 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
424 typedef struct _FILE_STREAM_INFORMATION
426 ULONG NextEntryOffset;
427 ULONG StreamNameLength;
428 LARGE_INTEGER StreamSize;
429 LARGE_INTEGER StreamAllocationSize;
430 WCHAR StreamName[1];
431 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
433 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
435 ULONG FileAttributes;
436 ULONG ReparseTag;
437 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
439 typedef struct _FILE_ALL_INFORMATION
441 FILE_BASIC_INFORMATION BasicInformation;
442 FILE_STANDARD_INFORMATION StandardInformation;
443 FILE_INTERNAL_INFORMATION InternalInformation;
444 FILE_EA_INFORMATION EaInformation;
445 FILE_ACCESS_INFORMATION AccessInformation;
446 FILE_POSITION_INFORMATION PositionInformation;
447 FILE_MODE_INFORMATION ModeInformation;
448 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
449 FILE_NAME_INFORMATION NameInformation;
450 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
452 typedef enum _FSINFOCLASS {
453 FileFsVolumeInformation = 1,
454 FileFsLabelInformation,
455 FileFsSizeInformation,
456 FileFsDeviceInformation,
457 FileFsAttributeInformation,
458 FileFsControlInformation,
459 FileFsFullSizeInformation,
460 FileFsObjectIdInformation,
461 FileFsMaximumInformation
462 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
464 typedef enum _KEY_INFORMATION_CLASS {
465 KeyBasicInformation,
466 KeyNodeInformation,
467 KeyFullInformation
468 } KEY_INFORMATION_CLASS;
470 typedef enum _KEY_VALUE_INFORMATION_CLASS {
471 KeyValueBasicInformation,
472 KeyValueFullInformation,
473 KeyValuePartialInformation,
474 KeyValueFullInformationAlign64,
475 KeyValuePartialInformationAlign64
476 } KEY_VALUE_INFORMATION_CLASS;
478 typedef enum _OBJECT_INFORMATION_CLASS {
479 ObjectBasicInformation,
480 ObjectNameInformation,
481 ObjectTypeInformation,
482 ObjectAllInformation,
483 ObjectDataInformation
484 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
486 typedef enum _PROCESSINFOCLASS {
487 ProcessBasicInformation = 0,
488 ProcessQuotaLimits = 1,
489 ProcessIoCounters = 2,
490 ProcessVmCounters = 3,
491 ProcessTimes = 4,
492 ProcessBasePriority = 5,
493 ProcessRaisePriority = 6,
494 ProcessDebugPort = 7,
495 ProcessExceptionPort = 8,
496 ProcessAccessToken = 9,
497 ProcessLdtInformation = 10,
498 ProcessLdtSize = 11,
499 ProcessDefaultHardErrorMode = 12,
500 ProcessIoPortHandlers = 13,
501 ProcessPooledUsageAndLimits = 14,
502 ProcessWorkingSetWatch = 15,
503 ProcessUserModeIOPL = 16,
504 ProcessEnableAlignmentFaultFixup = 17,
505 ProcessPriorityClass = 18,
506 ProcessWx86Information = 19,
507 ProcessHandleCount = 20,
508 ProcessAffinityMask = 21,
509 ProcessPriorityBoost = 22,
510 ProcessDeviceMap = 23,
511 ProcessSessionInformation = 24,
512 ProcessForegroundInformation = 25,
513 ProcessWow64Information = 26,
514 MaxProcessInfoClass
515 } PROCESSINFOCLASS;
517 typedef enum _SECTION_INHERIT {
518 ViewShare = 1,
519 ViewUnmap = 2
520 } SECTION_INHERIT;
522 typedef enum _SYSTEM_INFORMATION_CLASS {
523 SystemBasicInformation = 0,
524 SystemCpuInformation = 1,
525 SystemPerformanceInformation = 2,
526 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
527 Unknown4,
528 SystemProcessInformation = 5,
529 Unknown6,
530 Unknown7,
531 SystemProcessorPerformanceInformation = 8,
532 Unknown9,
533 Unknown10,
534 SystemDriverInformation,
535 Unknown12,
536 Unknown13,
537 Unknown14,
538 Unknown15,
539 SystemHandleList,
540 Unknown17,
541 Unknown18,
542 Unknown19,
543 Unknown20,
544 SystemCacheInformation,
545 Unknown22,
546 SystemInterruptInformation = 23,
547 SystemDpcBehaviourInformation = 24,
548 SystemFullMemoryInformation = 25,
549 SystemNotImplemented6 = 25,
550 SystemLoadImage = 26,
551 SystemUnloadImage = 27,
552 SystemTimeAdjustmentInformation = 28,
553 SystemTimeAdjustment = 28,
554 SystemSummaryMemoryInformation = 29,
555 SystemNotImplemented7 = 29,
556 SystemNextEventIdInformation = 30,
557 SystemNotImplemented8 = 30,
558 SystemEventIdsInformation = 31,
559 SystemCrashDumpInformation = 32,
560 SystemExceptionInformation = 33,
561 SystemCrashDumpStateInformation = 34,
562 SystemKernelDebuggerInformation = 35,
563 SystemContextSwitchInformation = 36,
564 SystemRegistryQuotaInformation = 37,
565 SystemCurrentTimeZoneInformation = 44,
566 SystemTimeZoneInformation = 44,
567 SystemLookasideInformation = 45,
568 SystemSetTimeSlipEvent = 46,
569 SystemCreateSession = 47,
570 SystemDeleteSession = 48,
571 SystemInvalidInfoClass4 = 49,
572 SystemRangeStartInformation = 50,
573 SystemVerifierInformation = 51,
574 SystemAddVerifier = 52,
575 SystemSessionProcessesInformation = 53,
576 SystemInformationClassMax
577 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
579 typedef enum _TIMER_TYPE {
580 NotificationTimer,
581 SynchronizationTimer
582 } TIMER_TYPE;
584 typedef enum _THREADINFOCLASS {
585 ThreadBasicInformation,
586 ThreadTimes,
587 ThreadPriority,
588 ThreadBasePriority,
589 ThreadAffinityMask,
590 ThreadImpersonationToken,
591 ThreadDescriptorTableEntry,
592 ThreadEnableAlignmentFaultFixup,
593 ThreadEventPair_Reusable,
594 ThreadQuerySetWin32StartAddress,
595 ThreadZeroTlsCell,
596 ThreadPerformanceCount,
597 ThreadAmILastThread,
598 ThreadIdealProcessor,
599 ThreadPriorityBoost,
600 ThreadSetTlsArrayAddress,
601 ThreadIsIoPending,
602 MaxThreadInfoClass
603 } THREADINFOCLASS;
605 typedef struct _THREAD_BASIC_INFORMATION
607 NTSTATUS ExitStatus;
608 PVOID TebBaseAddress;
609 CLIENT_ID ClientId;
610 ULONG AffinityMask;
611 LONG Priority;
612 LONG BasePriority;
613 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
616 typedef enum _WINSTATIONINFOCLASS {
617 WinStationInformation = 8
618 } WINSTATIONINFOCLASS;
620 typedef enum _MEMORY_INFORMATION_CLASS {
621 MemoryBasicInformation,
622 MemoryWorkingSetList,
623 MemorySectionName,
624 MemoryBasicVlmInformation
625 } MEMORY_INFORMATION_CLASS;
627 typedef enum _MUTANT_INFORMATION_CLASS
629 MutantBasicInformation
630 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
632 typedef struct _MUTANT_BASIC_INFORMATION {
633 LONG CurrentCount;
634 BOOLEAN OwnedByCaller;
635 BOOLEAN AbandonedState;
636 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
638 typedef enum _TIMER_INFORMATION_CLASS
640 TimerBasicInformation = 0
641 } TIMER_INFORMATION_CLASS;
643 typedef struct _TIMER_BASIC_INFORMATION
645 LARGE_INTEGER RemainingTime;
646 BOOLEAN TimerState;
647 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
650 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
651 typedef enum
653 INVALID_PATH = 0,
654 UNC_PATH, /* "//foo" */
655 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
656 RELATIVE_DRIVE_PATH, /* "c:foo" */
657 ABSOLUTE_PATH, /* "/foo" */
658 RELATIVE_PATH, /* "foo" */
659 DEVICE_PATH, /* "//./foo" */
660 UNC_DOT_PATH /* "//." */
661 } DOS_PATHNAME_TYPE;
663 /***********************************************************************
664 * IA64 specific types and data structures
667 #ifdef __ia64__
669 typedef struct _FRAME_POINTERS {
670 ULONGLONG MemoryStackFp;
671 ULONGLONG BackingStoreFp;
672 } FRAME_POINTERS, *PFRAME_POINTERS;
674 #define UNWIND_HISTORY_TABLE_SIZE 12
676 typedef struct _RUNTIME_FUNCTION {
677 ULONG BeginAddress;
678 ULONG EndAddress;
679 ULONG UnwindInfoAddress;
680 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
682 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
683 ULONG64 ImageBase;
684 ULONG64 Gp;
685 PRUNTIME_FUNCTION FunctionEntry;
686 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
688 typedef struct _UNWIND_HISTORY_TABLE {
689 ULONG Count;
690 UCHAR Search;
691 ULONG64 LowAddress;
692 ULONG64 HighAddress;
693 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
694 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
696 #endif /* defined(__ia64__) */
698 /***********************************************************************
699 * Types and data structures
702 /* This is used by NtQuerySystemInformation */
703 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
704 typedef struct {
705 FILETIME ftKernelTime;
706 FILETIME ftUserTime;
707 FILETIME ftCreateTime;
708 DWORD dwTickCount;
709 DWORD dwStartAddress;
710 DWORD dwOwningPID;
711 DWORD dwThreadID;
712 DWORD dwCurrentPriority;
713 DWORD dwBasePriority;
714 DWORD dwContextSwitches;
715 DWORD dwThreadState;
716 DWORD dwWaitReason;
717 } THREADINFO, *PTHREADINFO;
719 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
720 typedef struct _THREAD_INFO{
721 DWORD Unknown1[6];
722 DWORD ThreadID;
723 DWORD Unknown2[3];
724 DWORD Status;
725 DWORD WaitReason;
726 DWORD Unknown3[4];
727 } THREAD_INFO, PTHREAD_INFO;
729 /***********************************************************************
730 * Types and data structures
733 typedef struct _IO_STATUS_BLOCK {
734 union {
735 NTSTATUS Status;
736 PVOID Pointer;
737 } DUMMYUNIONNAME;
739 ULONG_PTR Information;
740 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
742 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
744 typedef struct _KEY_BASIC_INFORMATION {
745 LARGE_INTEGER LastWriteTime;
746 ULONG TitleIndex;
747 ULONG NameLength;
748 WCHAR Name[1];
749 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
751 typedef struct _KEY_NODE_INFORMATION
753 LARGE_INTEGER LastWriteTime;
754 ULONG TitleIndex;
755 ULONG ClassOffset;
756 ULONG ClassLength;
757 ULONG NameLength;
758 WCHAR Name[1];
759 /* Class[1]; */
760 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
762 typedef struct _KEY_FULL_INFORMATION
764 LARGE_INTEGER LastWriteTime;
765 ULONG TitleIndex;
766 ULONG ClassOffset;
767 ULONG ClassLength;
768 ULONG SubKeys;
769 ULONG MaxNameLen;
770 ULONG MaxClassLen;
771 ULONG Values;
772 ULONG MaxValueNameLen;
773 ULONG MaxValueDataLen;
774 WCHAR Class[1];
775 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
777 typedef struct _KEY_VALUE_ENTRY
779 PUNICODE_STRING ValueName;
780 ULONG DataLength;
781 ULONG DataOffset;
782 ULONG Type;
783 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
785 typedef struct _KEY_VALUE_BASIC_INFORMATION {
786 ULONG TitleIndex;
787 ULONG Type;
788 ULONG NameLength;
789 WCHAR Name[1];
790 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
792 typedef struct _KEY_VALUE_FULL_INFORMATION {
793 ULONG TitleIndex;
794 ULONG Type;
795 ULONG DataOffset;
796 ULONG DataLength;
797 ULONG NameLength;
798 WCHAR Name[1];
799 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
801 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
802 ULONG TitleIndex;
803 ULONG Type;
804 ULONG DataLength;
805 UCHAR Data[1];
806 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
808 typedef struct _OBJECT_ATTRIBUTES {
809 ULONG Length;
810 HANDLE RootDirectory;
811 PUNICODE_STRING ObjectName;
812 ULONG Attributes;
813 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
814 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
815 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
817 typedef struct _OBJECT_DATA_INFORMATION {
818 BOOLEAN InheritHandle;
819 BOOLEAN ProtectFromClose;
820 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
822 typedef struct _PROCESS_BASIC_INFORMATION {
823 #ifdef __WINESRC__
824 DWORD ExitStatus;
825 DWORD PebBaseAddress;
826 DWORD AffinityMask;
827 DWORD BasePriority;
828 ULONG UniqueProcessId;
829 ULONG InheritedFromUniqueProcessId;
830 #else
831 PVOID Reserved1;
832 PPEB PebBaseAddress;
833 PVOID Reserved2[2];
834 ULONG_PTR UniqueProcessId;
835 PVOID Reserved3;
836 #endif
837 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
839 typedef struct _PROCESS_INFO {
840 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
841 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
842 DWORD Unknown1[6];
843 FILETIME CreationTime; /* 20 */
844 DWORD Unknown2[5];
845 PWCHAR ProcessName; /* 3c ok */
846 DWORD BasePriority;
847 DWORD ProcessID; /* 44 ok*/
848 DWORD ParentProcessID;
849 DWORD HandleCount;
850 DWORD Unknown3[2]; /* 50 */
851 ULONG PeakVirtualSize;
852 ULONG VirtualSize;
853 ULONG PageFaultCount;
854 ULONG PeakWorkingSetSize;
855 ULONG WorkingSetSize;
856 ULONG QuotaPeakPagedPoolUsage;
857 ULONG QuotaPagedPoolUsage;
858 ULONG QuotaPeakNonPagedPoolUsage;
859 ULONG QuotaNonPagedPoolUsage;
860 ULONG PagefileUsage;
861 ULONG PeakPagefileUsage;
862 DWORD PrivateBytes;
863 DWORD Unknown6[4];
864 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
865 } PROCESS_INFO, PPROCESS_INFO;
867 typedef struct _RTL_HEAP_DEFINITION {
868 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
870 ULONG Unknown[11];
871 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
873 typedef struct _RTL_RWLOCK {
874 RTL_CRITICAL_SECTION rtlCS;
876 HANDLE hSharedReleaseSemaphore;
877 UINT uSharedWaiters;
879 HANDLE hExclusiveReleaseSemaphore;
880 UINT uExclusiveWaiters;
882 INT iNumberActive;
883 HANDLE hOwningThreadId;
884 DWORD dwTimeoutBoost;
885 PVOID pDebugInfo;
886 } RTL_RWLOCK, *LPRTL_RWLOCK;
888 /* System Information Class 0x00 */
889 typedef struct _SYSTEM_BASIC_INFORMATION {
890 #ifdef __WINESRC__
891 DWORD dwUnknown1;
892 ULONG uKeMaximumIncrement;
893 ULONG uPageSize;
894 ULONG uMmNumberOfPhysicalPages;
895 ULONG uMmLowestPhysicalPage;
896 ULONG uMmHighestPhysicalPage;
897 ULONG uAllocationGranularity;
898 PVOID pLowestUserAddress;
899 PVOID pMmHighestUserAddress;
900 ULONG uKeActiveProcessors;
901 BYTE bKeNumberProcessors;
902 BYTE bUnknown2;
903 WORD wUnknown3;
904 #else
905 BYTE Reserved1[24];
906 PVOID Reserved2[4];
907 CCHAR NumberOfProcessors;
908 #endif
909 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
911 /* CPU Information Class 0x01 */
912 typedef struct {
913 WORD Architecture;
914 WORD Level;
915 WORD Revision; /* combination of CPU model and stepping */
916 WORD Reserved; /* always zero */
917 DWORD FeatureSet; /* see bit flags below */
918 } SYSTEM_CPU_INFORMATION;
920 /* definitions of bits in the Feature set for the x86 processors */
921 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
922 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
923 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
924 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
925 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
926 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
927 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
928 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
929 #define CPU_FEATURE_X86 0x00000200 /* seems to be alway ON, on the '86 */
930 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
931 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
932 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
933 #define CPU_FEATURE_SSE 0x00002000 /* SSE extenstions (ext. MMX) */
934 #define CPU_FEATURE_3DNOW 0x00008000 /* 3DNOW instructions available
935 (FIXME: needs to be confirmed) */
936 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
937 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
938 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
940 /* System Information Class 0x15 */
941 typedef struct {
942 ULONG CurrentSize;
943 ULONG PeakSize;
944 ULONG PageFaultCount;
945 ULONG MinimumWorkingSet;
946 ULONG MaximumWorkingSet;
947 ULONG unused[4];
948 } SYSTEM_CACHE_INFORMATION;
950 typedef struct _SYSTEM_CONFIGURATION_INFO {
951 union {
952 ULONG OemId;
953 struct {
954 WORD ProcessorArchitecture;
955 WORD Reserved;
956 } tag1;
957 } tag2;
958 ULONG PageSize;
959 PVOID MinimumApplicationAddress;
960 PVOID MaximumApplicationAddress;
961 ULONG ActiveProcessorMask;
962 ULONG NumberOfProcessors;
963 ULONG ProcessorType;
964 ULONG AllocationGranularity;
965 WORD ProcessorLevel;
966 WORD ProcessorRevision;
967 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
969 /* System Information Class 0x0b */
970 typedef struct {
971 PVOID pvAddress;
972 DWORD dwUnknown1;
973 DWORD dwUnknown2;
974 DWORD dwEntryIndex;
975 DWORD dwUnknown3;
976 char szName[MAX_PATH + 1];
977 } SYSTEM_DRIVER_INFORMATION;
979 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
980 BYTE Reserved1[16];
981 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
983 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
984 BYTE Reserved1[32];
985 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
987 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
988 BYTE Reserved1[24];
989 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
991 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
992 BOOLEAN DebuggerEnabled;
993 BOOLEAN DebuggerNotPresent;
994 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
996 /* System Information Class 0x10 */
997 typedef struct {
998 USHORT dwPID;
999 USHORT dwCreatorBackTraceIndex;
1000 BYTE bObjectType;
1001 BYTE bHandleAttributes;
1002 USHORT usHandleOffset;
1003 DWORD dwKeObject;
1004 ULONG ulGrantedAccess;
1005 } HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
1007 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
1008 BYTE Reserved1[312];
1009 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
1011 /* System Information Class 0x02 */
1012 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
1013 #ifdef __WINESRC__
1014 LARGE_INTEGER liIdleTime;
1015 DWORD dwSpare[10];
1016 #else
1017 LARGE_INTEGER IdleTime;
1018 LARGE_INTEGER KernelTime;
1019 LARGE_INTEGER UserTime;
1020 LARGE_INTEGER Reserved1[2];
1021 ULONG Reserved2;
1022 #endif
1023 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
1025 /* System Information Class 0x05 */
1026 typedef struct _SYSTEM_PROCESS_INFORMATION {
1027 #ifdef __WINESRC__
1028 DWORD dwOffset;
1029 DWORD dwThreadCount;
1030 DWORD dwUnknown1[6];
1031 FILETIME ftCreationTime;
1032 DWORD dwUnknown2[5];
1033 WCHAR *pszProcessName;
1034 DWORD dwBasePriority;
1035 DWORD dwProcessID;
1036 DWORD dwParentProcessID;
1037 DWORD dwHandleCount;
1038 DWORD dwUnknown3;
1039 DWORD dwUnknown4;
1040 DWORD dwVirtualBytesPeak;
1041 DWORD dwVirtualBytes;
1042 DWORD dwPageFaults;
1043 DWORD dwWorkingSetPeak;
1044 DWORD dwWorkingSet;
1045 DWORD dwUnknown5;
1046 DWORD dwPagedPool;
1047 DWORD dwUnknown6;
1048 DWORD dwNonPagedPool;
1049 DWORD dwPageFileBytesPeak;
1050 DWORD dwPrivateBytes;
1051 DWORD dwPageFileBytes;
1052 DWORD dwUnknown7[4];
1053 THREADINFO ti[1];
1054 #else
1055 ULONG NextEntryOffset;
1056 BYTE Reserved1[52];
1057 PVOID Reserved2[3];
1058 HANDLE UniqueProcessId;
1059 PVOID Reserved3;
1060 ULONG HandleCount;
1061 BYTE Reserved4[4];
1062 PVOID Reserved5[11];
1063 SIZE_T PeakPagefileUsage;
1064 SIZE_T PrivatePageCount;
1065 LARGE_INTEGER Reserved6[6];
1066 #endif
1067 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
1069 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
1070 ULONG RegistryQuotaAllowed;
1071 ULONG RegistryQuotaUsed;
1072 PVOID Reserved1;
1073 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
1075 typedef struct _SYSTEM_TIME_ADJUSTMENT {
1076 ULONG TimeAdjustment;
1077 BOOLEAN TimeAdjustmentDisabled;
1078 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
1080 /* System Information Class 0x03 */
1081 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
1082 #ifdef __WINESRC__
1083 LARGE_INTEGER liKeBootTime;
1084 LARGE_INTEGER liKeSystemTime;
1085 LARGE_INTEGER liExpTimeZoneBias;
1086 ULONG uCurrentTimeZoneId;
1087 DWORD dwReserved;
1088 #else
1089 BYTE Reserved1[48];
1090 #endif
1091 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1093 typedef struct _TIME_FIELDS
1094 { CSHORT Year;
1095 CSHORT Month;
1096 CSHORT Day;
1097 CSHORT Hour;
1098 CSHORT Minute;
1099 CSHORT Second;
1100 CSHORT Milliseconds;
1101 CSHORT Weekday;
1102 } TIME_FIELDS, *PTIME_FIELDS;
1104 typedef struct _WINSTATIONINFORMATIONW {
1105 BYTE Reserved2[70];
1106 ULONG LogonId;
1107 BYTE Reserved3[1140];
1108 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1110 typedef struct _VM_COUNTERS_ {
1111 SIZE_T PeakVirtualSize;
1112 SIZE_T VirtualSize;
1113 ULONG PageFaultCount;
1114 SIZE_T PeakWorkingSetSize;
1115 SIZE_T WorkingSetSize;
1116 SIZE_T QuotaPeakPagedPoolUsage;
1117 SIZE_T QuotaPagedPoolUsage;
1118 SIZE_T QuotaPeakNonPagedPoolUsage;
1119 SIZE_T QuotaNonPagedPoolUsage;
1120 SIZE_T PagefileUsage;
1121 SIZE_T PeakPagefileUsage;
1122 } VM_COUNTERS, *PVM_COUNTERS;
1124 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1126 typedef struct _LDR_RESOURCE_INFO
1128 ULONG Type;
1129 ULONG Name;
1130 ULONG Language;
1131 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1134 /* debug buffer definitions */
1136 typedef struct _DEBUG_BUFFER {
1137 HANDLE SectionHandle;
1138 PVOID SectionBase;
1139 PVOID RemoteSectionBase;
1140 ULONG SectionBaseDelta;
1141 HANDLE EventPairHandle;
1142 ULONG Unknown[2];
1143 HANDLE RemoteThreadHandle;
1144 ULONG InfoClassMask;
1145 ULONG SizeOfInfo;
1146 ULONG AllocatedSize;
1147 ULONG SectionSize;
1148 PVOID ModuleInformation;
1149 PVOID BackTraceInformation;
1150 PVOID HeapInformation;
1151 PVOID LockInformation;
1152 PVOID Reserved[8];
1153 } DEBUG_BUFFER, *PDEBUG_BUFFER;
1155 #define PDI_MODULES 0x01
1156 #define PDI_BACKTRACE 0x02
1157 #define PDI_HEAPS 0x04
1158 #define PDI_HEAP_TAGS 0x08
1159 #define PDI_HEAP_BLOCKS 0x10
1160 #define PDI_LOCKS 0x20
1162 typedef struct _DEBUG_MODULE_INFORMATION {
1163 ULONG Reserved[2];
1164 ULONG Base;
1165 ULONG Size;
1166 ULONG Flags;
1167 USHORT Index;
1168 USHORT Unknown;
1169 USHORT LoadCount;
1170 USHORT ModuleNameOffset;
1171 CHAR ImageName[256];
1172 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1174 typedef struct _DEBUG_HEAP_INFORMATION {
1175 ULONG Base;
1176 ULONG Flags;
1177 USHORT Granularity;
1178 USHORT Unknown;
1179 ULONG Allocated;
1180 ULONG Committed;
1181 ULONG TagCount;
1182 ULONG BlockCount;
1183 ULONG Reserved[7];
1184 PVOID Tags;
1185 PVOID Blocks;
1186 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1188 typedef struct _DEBUG_LOCK_INFORMATION {
1189 PVOID Address;
1190 USHORT Type;
1191 USHORT CreatorBackTraceIndex;
1192 ULONG OwnerThreadId;
1193 ULONG ActiveCount;
1194 ULONG ContentionCount;
1195 ULONG EntryCount;
1196 ULONG RecursionCount;
1197 ULONG NumberOfSharedWaiters;
1198 ULONG NumberOfExclusiveWaiters;
1199 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1201 typedef struct _PORT_MESSAGE_HEADER {
1202 USHORT DataSize;
1203 USHORT MessageSize;
1204 USHORT MessageType;
1205 USHORT VirtualRangesOffset;
1206 CLIENT_ID ClientId;
1207 ULONG MessageId;
1208 ULONG SectionSize;
1209 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1211 /* FIXME: names probably not correct */
1212 typedef struct _RTL_HANDLE
1214 struct _RTL_HANDLE * Next;
1215 } RTL_HANDLE;
1217 /* FIXME: names probably not correct */
1218 typedef struct _RTL_HANDLE_TABLE
1220 ULONG MaxHandleCount; /* 0x00 */
1221 ULONG HandleSize; /* 0x04 */
1222 ULONG Unused[2]; /* 0x08-0x0c */
1223 PVOID NextFree; /* 0x10 */
1224 PVOID FirstHandle; /* 0x14 */
1225 PVOID ReservedMemory; /* 0x18 */
1226 PVOID MaxHandle; /* 0x1c */
1227 } RTL_HANDLE_TABLE;
1229 /***********************************************************************
1230 * Defines
1233 /* flags for NtCreateFile and NtOpenFile */
1234 #define FILE_DIRECTORY_FILE 0x00000001
1235 #define FILE_WRITE_THROUGH 0x00000002
1236 #define FILE_SEQUENTIAL_ONLY 0x00000004
1237 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1238 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1239 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1240 #define FILE_NON_DIRECTORY_FILE 0x00000040
1241 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1242 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1243 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1244 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1245 #define FILE_RANDOM_ACCESS 0x00000800
1246 #define FILE_DELETE_ON_CLOSE 0x00001000
1247 #define FILE_OPEN_BY_FILE_ID 0x00002000
1248 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1249 #define FILE_NO_COMPRESSION 0x00008000
1250 #define FILE_RESERVE_OPFILTER 0x00100000
1251 #define FILE_TRANSACTED_MODE 0x00200000
1252 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1253 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
1255 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1256 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1258 /* status for NtCreateFile or NtOpenFile */
1259 #define FILE_SUPERSEDED 0
1260 #define FILE_OPENED 1
1261 #define FILE_CREATED 2
1262 #define FILE_OVERWRITTEN 3
1263 #define FILE_EXISTS 4
1264 #define FILE_DOES_NOT_EXIST 5
1266 /* disposition for NtCreateFile */
1267 #define FILE_SUPERSEDE 0
1268 #define FILE_OPEN 1
1269 #define FILE_CREATE 2
1270 #define FILE_OPEN_IF 3
1271 #define FILE_OVERWRITE 4
1272 #define FILE_OVERWRITE_IF 5
1273 #define FILE_MAXIMUM_DISPOSITION 5
1275 /* Characteristics of a File System */
1276 #define FILE_REMOVABLE_MEDIA 0x00000001
1277 #define FILE_READ_ONLY_DEVICE 0x00000002
1278 #define FILE_FLOPPY_DISKETTE 0x00000004
1279 #define FILE_WRITE_ONE_MEDIA 0x00000008
1280 #define FILE_REMOTE_DEVICE 0x00000010
1281 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1282 #define FILE_VIRTUAL_VOLUME 0x00000040
1283 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
1284 #define FILE_DEVICE_SECURE_OPEN 0x00000100
1286 #if (_WIN32_WINNT >= 0x0501)
1287 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1288 #endif /* (_WIN32_WINNT >= 0x0501) */
1290 #define LOGONID_CURRENT ((ULONG)-1)
1292 #define OBJ_INHERIT 0x00000002L
1293 #define OBJ_PERMANENT 0x00000010L
1294 #define OBJ_EXCLUSIVE 0x00000020L
1295 #define OBJ_CASE_INSENSITIVE 0x00000040L
1296 #define OBJ_OPENIF 0x00000080L
1297 #define OBJ_OPENLINK 0x00000100L
1298 #define OBJ_KERNEL_HANDLE 0x00000200L
1299 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
1301 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1303 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1304 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1307 /* DbgPrintEx default levels */
1308 #define DPFLTR_ERROR_LEVEL 0
1309 #define DPFLTR_WARNING_LEVEL 1
1310 #define DPFLTR_TRACE_LEVEL 2
1311 #define DPFLTR_INFO_LEVEL 3
1312 #define DPFLTR_MASK 0x8000000
1314 /* Well-known LUID values */
1315 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2L
1316 #define SE_CREATE_TOKEN_PRIVILEGE 2L
1317 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3L
1318 #define SE_LOCK_MEMORY_PRIVILEGE 4L
1319 #define SE_INCREASE_QUOTA_PRIVILEGE 5L
1320 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6L /* obsolete */
1321 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6L
1322 #define SE_TCB_PRIVILEGE 7L
1323 #define SE_SECURITY_PRIVILEGE 8L
1324 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9L
1325 #define SE_LOAD_DRIVER_PRIVILEGE 10L
1326 #define SE_SYSTEM_PROFILE_PRIVILEGE 11L
1327 #define SE_SYSTEMTIME_PRIVILEGE 12L
1328 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13L
1329 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14L
1330 #define SE_CREATE_PAGEFILE_PRIVILEGE 15L
1331 #define SE_CREATE_PERMANENT_PRIVILEGE 16L
1332 #define SE_BACKUP_PRIVILEGE 17L
1333 #define SE_RESTORE_PRIVILEGE 18L
1334 #define SE_SHUTDOWN_PRIVILEGE 19L
1335 #define SE_DEBUG_PRIVILEGE 20L
1336 #define SE_AUDIT_PRIVILEGE 21L
1337 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22L
1338 #define SE_CHANGE_NOTIFY_PRIVILLEGE 23L
1339 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24L
1340 #define SE_UNDOCK_PRIVILEGE 25L
1341 #define SE_SYNC_AGENT_PRIVILEGE 26L
1342 #define SE_ENABLE_DELEGATION_PRIVILEGE 27L
1343 #define SE_MANAGE_VOLUME_PRIVILEGE 28L
1344 #define SE_IMPERSONATE_PRIVILEGE 29L
1345 #define SE_CREATE_GLOBAL_PRIVILEGE 30L
1346 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
1349 /* Rtl*Registry* functions structs and defines */
1350 #define RTL_REGISTRY_ABSOLUTE 0
1351 #define RTL_REGISTRY_SERVICES 1
1352 #define RTL_REGISTRY_CONTROL 2
1353 #define RTL_REGISTRY_WINDOWS_NT 3
1354 #define RTL_REGISTRY_DEVICEMAP 4
1355 #define RTL_REGISTRY_USER 5
1357 #define RTL_REGISTRY_HANDLE 0x40000000
1358 #define RTL_REGISTRY_OPTIONAL 0x80000000
1360 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
1361 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
1362 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
1363 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
1364 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
1365 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
1366 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
1368 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
1369 ULONG ValueType,
1370 PVOID ValueData,
1371 ULONG ValueLength,
1372 PVOID Context,
1373 PVOID EntryContext);
1375 typedef struct _RTL_QUERY_REGISTRY_TABLE
1377 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1378 ULONG Flags;
1379 PWSTR Name;
1380 PVOID EntryContext;
1381 ULONG DefaultType;
1382 PVOID DefaultData;
1383 ULONG DefaultLength;
1384 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1387 /***********************************************************************
1388 * Function declarations
1391 extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
1392 extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
1394 #if defined(__i386__) && defined(__GNUC__)
1395 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1396 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1397 #else /* __i386__ && __GNUC__ */
1398 void WINAPI DbgBreakPoint(void);
1399 void WINAPI DbgUserBreakPoint(void);
1400 #endif /* __i386__ && __GNUC__ */
1401 NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1402 NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
1404 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
1405 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
1406 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
1407 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1408 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
1409 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
1410 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
1411 void WINAPI LdrShutdownProcess(void);
1412 void WINAPI LdrShutdownThread(void);
1413 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
1414 NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
1415 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1416 NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
1417 NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
1418 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG,ULONG*,ULONG,ULONG);
1419 NTSTATUS WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
1420 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1421 NTSTATUS WINAPI NtClearEvent(HANDLE);
1422 NTSTATUS WINAPI NtClose(HANDLE);
1423 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1424 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1425 NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
1426 NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1427 NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
1428 NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
1429 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1430 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
1431 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1432 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1433 NTSTATUS WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
1434 NTSTATUS WINAPI NtDeleteKey(HKEY);
1435 NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
1436 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1437 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1438 NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1439 NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1440 NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1441 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1442 NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,ULONG);
1443 NTSTATUS WINAPI NtFlushKey(HKEY);
1444 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
1445 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1446 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1447 NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1448 NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1449 NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
1450 NTSTATUS WINAPI NtLoadDriver(const UNICODE_STRING *);
1451 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
1452 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1453 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1454 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
1455 NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1456 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1457 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1458 NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
1459 NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1460 NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1461 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1462 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1463 NTSTATUS WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1464 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1465 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1466 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1467 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
1468 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1469 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1470 NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
1471 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1472 NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
1473 NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1474 NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
1475 NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
1476 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1477 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1478 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1479 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1480 NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
1481 NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1482 NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
1483 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1484 NTSTATUS WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
1485 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1486 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1487 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1488 NTSTATUS WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1489 NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1490 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
1491 NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1492 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1493 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1494 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1495 NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG);
1496 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1497 NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER);
1498 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
1499 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1500 NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
1501 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1502 NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
1503 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1504 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
1505 NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
1506 NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
1507 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1508 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1509 NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
1510 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1511 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1512 NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
1513 NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
1514 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1515 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1516 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1517 NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1518 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
1519 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1520 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
1521 NTSTATUS WINAPI NtUnloadDriver(const UNICODE_STRING *);
1522 NTSTATUS WINAPI NtUnloadKey(HKEY);
1523 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
1524 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1525 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
1526 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1527 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1528 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1529 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
1530 NTSTATUS WINAPI NtYieldExecution(void);
1532 void WINAPI RtlAcquirePebLock(void);
1533 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1534 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1535 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
1536 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1537 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1538 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1539 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1540 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1541 DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
1542 NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1543 RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
1544 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
1545 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1546 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1547 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1548 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1549 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1550 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
1551 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1552 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1553 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1554 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1556 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1557 NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
1558 void WINAPI RtlClearAllBits(PRTL_BITMAP);
1559 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1560 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1561 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1562 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1563 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
1564 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1565 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1566 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
1567 void WINAPI RtlCopyLuid(PLUID,const LUID*);
1568 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
1569 BOOLEAN WINAPI RtlCopySid(DWORD,PSID,PSID);
1570 void WINAPI RtlCopyString(STRING*,const STRING*);
1571 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
1572 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
1573 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
1574 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
1575 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
1576 const UNICODE_STRING*,const UNICODE_STRING*,
1577 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
1578 const UNICODE_STRING*,const UNICODE_STRING*,
1579 const UNICODE_STRING*);
1580 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1581 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
1582 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
1583 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
1585 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
1586 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
1587 NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
1588 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
1589 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
1590 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1591 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
1592 NTSTATUS WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
1593 HANDLE WINAPI RtlDestroyHeap(HANDLE);
1594 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
1595 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
1596 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
1597 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
1598 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
1599 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
1600 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1601 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
1602 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
1604 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
1605 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
1606 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
1607 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
1608 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
1609 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
1610 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
1611 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
1612 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
1613 BOOL WINAPI RtlEqualSid(PSID,PSID);
1614 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
1615 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1616 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
1617 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
1618 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
1619 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
1621 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
1622 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
1623 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
1624 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1625 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1626 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1627 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
1628 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
1629 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
1630 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
1631 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
1632 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1633 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1634 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1635 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1636 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1637 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1638 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
1639 NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
1640 void WINAPI RtlFreeAnsiString(PANSI_STRING);
1641 BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
1642 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1643 void WINAPI RtlFreeOemString(POEM_STRING);
1644 DWORD WINAPI RtlFreeSid(PSID);
1645 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1647 NTSTATUS WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
1648 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1649 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
1650 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1651 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
1652 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1653 NTSTATUS WINAPI RtlGetLastNtStatus(void);
1654 DWORD WINAPI RtlGetLastWin32Error(void);
1655 DWORD WINAPI RtlGetLongestNtPathLength(void);
1656 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1657 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1658 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1659 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1660 NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
1662 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1663 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1664 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1665 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1666 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1667 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1668 void WINAPI RtlInitString(PSTRING,PCSZ);
1669 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1670 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
1671 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
1672 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1673 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1674 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
1675 void WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
1676 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1677 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1679 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1680 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1681 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
1682 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
1683 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
1684 DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1685 BOOLEAN WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
1686 BOOLEAN WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
1688 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1689 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1690 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1691 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1692 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1693 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1694 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
1695 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
1696 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1697 DWORD WINAPI RtlLengthRequiredSid(DWORD);
1698 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1699 DWORD WINAPI RtlLengthSid(PSID);
1700 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1701 BOOLEAN WINAPI RtlLockHeap(HANDLE);
1703 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1704 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
1705 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1706 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1708 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
1709 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1710 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1711 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
1712 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1713 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1715 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1716 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1717 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1718 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
1720 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1721 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1723 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
1724 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
1725 NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
1726 NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1728 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1729 void WINAPI RtlRaiseStatus(NTSTATUS);
1730 ULONG WINAPI RtlRandom(PULONG);
1731 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1732 void WINAPI RtlReleasePebLock(void);
1733 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
1734 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
1735 void WINAPI RtlRestoreLastWin32Error(DWORD);
1737 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1738 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
1739 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
1740 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
1741 void WINAPI RtlSetAllBits(PRTL_BITMAP);
1742 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
1743 ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
1744 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
1745 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
1746 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1747 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
1748 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1749 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1750 void WINAPI RtlSetLastWin32Error(DWORD);
1751 void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
1752 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1753 NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
1754 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1755 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1756 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
1757 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1759 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
1760 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
1761 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
1762 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
1763 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1764 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1766 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
1767 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1768 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
1769 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
1770 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1771 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1772 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1773 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1774 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1775 ULONG WINAPI RtlUniform(PULONG);
1776 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1777 void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1778 #ifdef __ia64__
1779 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1780 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1781 #endif
1782 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
1783 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1784 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
1785 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1786 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1787 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1788 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1789 CHAR WINAPI RtlUpperChar(CHAR);
1790 void WINAPI RtlUpperString(STRING *,const STRING *);
1792 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1793 BOOLEAN WINAPI RtlValidAcl(PACL);
1794 BOOLEAN WINAPI RtlValidSid(PSID);
1795 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
1796 NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
1798 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1800 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1801 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1803 /* Wine internal functions */
1805 extern NTSTATUS wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
1806 UINT disposition, BOOLEAN check_case );
1808 /***********************************************************************
1809 * Inline functions
1812 #define InitializeObjectAttributes(p,n,a,r,s) \
1813 do { \
1814 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1815 (p)->RootDirectory = r; \
1816 (p)->Attributes = a; \
1817 (p)->ObjectName = n; \
1818 (p)->SecurityDescriptor = s; \
1819 (p)->SecurityQualityOfService = NULL; \
1820 } while (0)
1822 #define NtCurrentProcess() ((HANDLE)-1)
1824 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1825 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1826 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1827 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1828 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1829 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1830 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1832 inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1834 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1835 lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
1836 return TRUE;
1837 return FALSE;
1840 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1841 inline static USHORT RtlUshortByteSwap(USHORT s)
1843 return (s >> 8) | (s << 8);
1845 inline static ULONG RtlUlongByteSwap(ULONG i)
1847 #if defined(__i386__) && defined(__GNUC__)
1848 ULONG ret;
1849 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1850 return ret;
1851 #else
1852 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
1853 #endif
1856 /*************************************************************************
1857 * Loader functions and structures.
1859 * Those are not part of standard Winternl.h
1861 typedef struct _LDR_MODULE
1863 LIST_ENTRY InLoadOrderModuleList;
1864 LIST_ENTRY InMemoryOrderModuleList;
1865 LIST_ENTRY InInitializationOrderModuleList;
1866 void* BaseAddress;
1867 void* EntryPoint;
1868 ULONG SizeOfImage;
1869 UNICODE_STRING FullDllName;
1870 UNICODE_STRING BaseDllName;
1871 ULONG Flags;
1872 SHORT LoadCount;
1873 SHORT TlsIndex;
1874 HANDLE SectionHandle;
1875 ULONG CheckSum;
1876 ULONG TimeDateStamp;
1877 } LDR_MODULE, *PLDR_MODULE;
1879 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1880 #define LDR_IMAGE_IS_DLL 0x00000004
1881 #define LDR_LOAD_IN_PROGRESS 0x00001000
1882 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1883 #define LDR_NO_DLL_CALLS 0x00040000
1884 #define LDR_PROCESS_ATTACHED 0x00080000
1885 #define LDR_MODULE_REBASED 0x00200000
1887 /* these ones is Wine specific */
1888 #define LDR_DONT_RESOLVE_REFS 0x40000000
1889 #define LDR_WINE_INTERNAL 0x80000000
1891 /* FIXME: to be checked */
1892 #define MAXIMUM_FILENAME_LENGTH 256
1894 typedef struct _SYSTEM_MODULE
1896 ULONG Reserved1;
1897 ULONG Reserved2;
1898 PVOID ImageBaseAddress;
1899 ULONG ImageSize;
1900 ULONG Flags;
1901 WORD Id;
1902 WORD Rank;
1903 WORD Unknown;
1904 WORD NameOffset;
1905 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1906 } SYSTEM_MODULE, *PSYSTEM_MODULE;
1908 typedef struct _SYSTEM_MODULE_INFORMATION
1910 ULONG ModulesCount;
1911 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1912 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1914 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
1915 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
1916 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
1917 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
1918 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
1919 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
1921 /* list manipulation macros */
1922 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1923 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1924 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1925 #define IsListEmpty(le) ((le)->Flink == (le))
1926 #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)
1927 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
1929 PLIST_ENTRY f, b, e;
1931 e = le->Flink;
1932 f = le->Flink->Flink;
1933 b = le->Flink->Blink;
1934 f->Blink = b;
1935 b->Flink = f;
1937 if (e != le) e->Flink = e->Blink = NULL;
1938 return e;
1940 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
1942 PLIST_ENTRY f, b, e;
1944 e = le->Blink;
1945 f = le->Blink->Flink;
1946 b = le->Blink->Blink;
1947 f->Blink = b;
1948 b->Flink = f;
1950 if (e != le) e->Flink = e->Blink = NULL;
1951 return e;
1954 #ifdef __cplusplus
1955 } /* extern "C" */
1956 #endif /* defined(__cplusplus) */
1958 #endif /* __WINE_WINTERNL_H */