Stub and documentation for RtlFormatMessage.
[wine.git] / include / winternl.h
blob46a18679a85142ee5cfe0fc9a8eee17765ecceb6
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_WINTERNAL_H
22 #define __WINE_WINTERNAL_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 LPBYTE BitMapBuffer; /* 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 StartOfRun; /* Bit position at which run starts - FIXME: Name? */
93 ULONG SizeOfRun; /* Size of the run in bits - FIXME: Name? */
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 hConsole;
105 ULONG ProcessGroup;
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 BYTE Reserved1[2]; /* 00 */
149 BYTE BeingDebugged; /* 02 */
150 BYTE Reserved2[5]; /* 03 */
151 HMODULE ImageBaseAddress; /* 08 */
152 PPEB_LDR_DATA LdrData; /* 0c */
153 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10 */
154 PVOID __pad_14; /* 14 */
155 HANDLE ProcessHeap; /* 18 */
156 BYTE __pad_1c[36]; /* 1c */
157 PRTL_BITMAP TlsBitmap; /* 40 */
158 ULONG TlsBitmapBits[2]; /* 44 */
159 BYTE __pad_4c[156]; /* 4c */
160 PVOID Reserved3[59]; /* e8 */
161 ULONG SessionId; /* 1d4 */
162 } PEB, *PPEB;
165 /***********************************************************************
166 * TEB data structure
168 #if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
169 # define WINE_NO_TEB
170 #endif
172 #ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
173 # ifndef WINE_TEB_DEFINED
174 # define WINE_TEB_DEFINED
175 typedef struct _TEB
177 NT_TIB Tib; /* 000 */
178 PVOID EnvironmentPointer; /* 01c */
179 CLIENT_ID ClientId; /* 020 */
180 PVOID ActiveRpcHandle; /* 028 */
181 PVOID ThreadLocalStoragePointer; /* 02c */
182 PPEB Peb; /* 030 */
183 ULONG LastErrorValue; /* 034 */
184 BYTE __pad038[140]; /* 038 */
185 ULONG CurrentLocale; /* 0c4 */
186 BYTE __pad0c8[1752]; /* 0c8 */
187 PVOID Reserved2[278]; /* 7a0 */
188 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
189 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
190 PVOID DeallocationStack; /* e0c */
191 PVOID TlsSlots[64]; /* e10 */
192 LIST_ENTRY TlsLinks; /* f10 */
193 PVOID Reserved4[26]; /* f18 */
194 PVOID ReservedForOle; /* f80 Windows 2000 only */
195 PVOID Reserved5[4]; /* f84 */
196 PVOID TlsExpansionSlots; /* f94 */
197 } TEB, *PTEB;
198 # endif /* WINE_TEB_DEFINED */
199 #endif /* WINE_NO_TEB */
201 /***********************************************************************
202 * Enums
205 typedef enum _FILE_INFORMATION_CLASS {
206 FileDirectoryInformation = 1,
207 FileFullDirectoryInformation,
208 FileBothDirectoryInformation,
209 FileBasicInformation,
210 FileStandardInformation,
211 FileInternalInformation,
212 FileEaInformation,
213 FileAccessInformation,
214 FileNameInformation,
215 FileRenameInformation,
216 FileLinkInformation,
217 FileNamesInformation,
218 FileDispositionInformation,
219 FilePositionInformation,
220 FileFullEaInformation,
221 FileModeInformation,
222 FileAlignmentInformation,
223 FileAllInformation,
224 FileAllocationInformation,
225 FileEndOfFileInformation,
226 FileAlternateNameInformation,
227 FileStreamInformation,
228 FilePipeInformation,
229 FilePipeLocalInformation,
230 FilePipeRemoteInformation,
231 FileMailslotQueryInformation,
232 FileMailslotSetInformation,
233 FileCompressionInformation,
234 FileObjectIdInformation,
235 FileCompletionInformation,
236 FileMoveClusterInformation,
237 FileQuotaInformation,
238 FileReparsePointInformation,
239 FileNetworkOpenInformation,
240 FileAttributeTagInformation,
241 FileTrackingInformation,
242 FileMaximumInformation
243 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
245 typedef struct _FILE_DIRECTORY_INFORMATION {
246 ULONG NextEntryOffset;
247 ULONG FileIndex;
248 LARGE_INTEGER CreationTime;
249 LARGE_INTEGER LastAccessTime;
250 LARGE_INTEGER LastWriteTime;
251 LARGE_INTEGER ChangeTime;
252 LARGE_INTEGER EndOfFile;
253 LARGE_INTEGER AllocationSize;
254 ULONG FileAttributes;
255 ULONG FileNameLength;
256 WCHAR FileName[ANYSIZE_ARRAY];
257 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
259 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
260 ULONG NextEntryOffset;
261 ULONG FileIndex;
262 LARGE_INTEGER CreationTime;
263 LARGE_INTEGER LastAccessTime;
264 LARGE_INTEGER LastWriteTime;
265 LARGE_INTEGER ChangeTime;
266 LARGE_INTEGER EndOfFile;
267 LARGE_INTEGER AllocationSize;
268 ULONG FileAttributes;
269 ULONG FileNameLength;
270 ULONG EaSize;
271 WCHAR FileName[ANYSIZE_ARRAY];
272 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
273 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
275 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
276 ULONG NextEntryOffset;
277 ULONG FileIndex;
278 LARGE_INTEGER CreationTime;
279 LARGE_INTEGER LastAccessTime;
280 LARGE_INTEGER LastWriteTime;
281 LARGE_INTEGER ChangeTime;
282 LARGE_INTEGER EndOfFile;
283 LARGE_INTEGER AllocationSize;
284 ULONG FileAttributes;
285 ULONG FileNameLength;
286 ULONG EaSize;
287 CHAR ShortNameLength;
288 WCHAR ShortName[12];
289 WCHAR FileName[ANYSIZE_ARRAY];
290 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
291 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
293 typedef struct _FILE_BASIC_INFORMATION {
294 LARGE_INTEGER CreationTime;
295 LARGE_INTEGER LastAccessTime;
296 LARGE_INTEGER LastWriteTime;
297 LARGE_INTEGER ChangeTime;
298 ULONG FileAttributes;
299 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
301 typedef struct _FILE_STANDARD_INFORMATION {
302 LARGE_INTEGER AllocationSize;
303 LARGE_INTEGER EndOfFile;
304 ULONG NumberOfLinks;
305 BOOLEAN DeletePending;
306 BOOLEAN Directory;
307 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
309 typedef struct _FILE_POSITION_INFORMATION {
310 LARGE_INTEGER CurrentByteOffset;
311 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
313 typedef struct _FILE_ALIGNMENT_INFORMATION {
314 ULONG AlignmentRequirement;
315 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
317 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
318 LARGE_INTEGER CreationTime;
319 LARGE_INTEGER LastAccessTime;
320 LARGE_INTEGER LastWriteTime;
321 LARGE_INTEGER ChangeTime;
322 LARGE_INTEGER AllocationSize;
323 LARGE_INTEGER EndOfFile;
324 ULONG FileAttributes;
325 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
327 typedef struct _FILE_FULL_EA_INFORMATION {
328 ULONG NextEntryOffset;
329 UCHAR Flags;
330 UCHAR EaNameLength;
331 USHORT EaValueLength;
332 CHAR EaName[1];
333 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
335 typedef struct _FILE_STREAM_INFORMATION
337 ULONG NextEntryOffset;
338 ULONG StreamNameLength;
339 LARGE_INTEGER StreamSize;
340 LARGE_INTEGER StreamAllocationSize;
341 WCHAR StreamName[1];
342 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
344 struct _FILE_ATTRIBUTE_TAG_INFORMATION
346 ULONG FileAttributes;
347 ULONG ReparseTag;
348 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
350 typedef enum _FSINFOCLASS {
351 FileFsVolumeInformation = 1,
352 FileFsLabelInformation,
353 FileFsSizeInformation,
354 FileFsDeviceInformation,
355 FileFsAttributeInformation,
356 FileFsControlInformation,
357 FileFsFullSizeInformation,
358 FileFsObjectIdInformation,
359 FileFsMaximumInformation
360 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
362 typedef enum _KEY_INFORMATION_CLASS {
363 KeyBasicInformation,
364 KeyNodeInformation,
365 KeyFullInformation
366 } KEY_INFORMATION_CLASS;
368 typedef enum _KEY_VALUE_INFORMATION_CLASS {
369 KeyValueBasicInformation,
370 KeyValueFullInformation,
371 KeyValuePartialInformation,
372 KeyValueFullInformationAlign64,
373 KeyValuePartialInformationAlign64
374 } KEY_VALUE_INFORMATION_CLASS;
376 typedef enum _OBJECT_INFORMATION_CLASS {
377 ObjectBasicInformation,
378 ObjectNameInformation,
379 ObjectTypeInformation,
380 ObjectAllInformation,
381 ObjectDataInformation
382 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
384 typedef enum _PROCESSINFOCLASS {
385 ProcessBasicInformation = 0,
386 ProcessQuotaLimits = 1,
387 ProcessIoCounters = 2,
388 ProcessVmCounters = 3,
389 ProcessTimes = 4,
390 ProcessBasePriority = 5,
391 ProcessRaisePriority = 6,
392 ProcessDebugPort = 7,
393 ProcessExceptionPort = 8,
394 ProcessAccessToken = 9,
395 ProcessLdtInformation = 10,
396 ProcessLdtSize = 11,
397 ProcessDefaultHardErrorMode = 12,
398 ProcessIoPortHandlers = 13,
399 ProcessPooledUsageAndLimits = 14,
400 ProcessWorkingSetWatch = 15,
401 ProcessUserModeIOPL = 16,
402 ProcessEnableAlignmentFaultFixup = 17,
403 ProcessPriorityClass = 18,
404 ProcessWx86Information = 19,
405 ProcessHandleCount = 20,
406 ProcessAffinityMask = 21,
407 ProcessPriorityBoost = 22,
408 ProcessDeviceMap = 23,
409 ProcessSessionInformation = 24,
410 ProcessForegroundInformation = 25,
411 ProcessWow64Information = 26,
412 MaxProcessInfoClass
413 } PROCESSINFOCLASS;
415 typedef enum _SECTION_INHERIT {
416 ViewShare = 1,
417 ViewUnmap = 2
418 } SECTION_INHERIT;
420 typedef enum SYSTEM_INFORMATION_CLASS {
421 SystemBasicInformation = 0,
422 Unknown1,
423 SystemPerformanceInformation = 2,
424 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
425 Unknown4,
426 SystemProcessInformation = 5,
427 Unknown6,
428 Unknown7,
429 SystemProcessorPerformanceInformation = 8,
430 Unknown9,
431 Unknown10,
432 SystemDriverInformation,
433 Unknown12,
434 Unknown13,
435 Unknown14,
436 Unknown15,
437 SystemHandleList,
438 Unknown17,
439 Unknown18,
440 Unknown19,
441 Unknown20,
442 SystemCacheInformation,
443 Unknown22,
444 SystemInterruptInformation = 23,
445 SystemExceptionInformation = 33,
446 SystemRegistryQuotaInformation = 37,
447 SystemLookasideInformation = 45
448 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
450 typedef enum _TIMER_TYPE {
451 NotificationTimer,
452 SynchronizationTimer
453 } TIMER_TYPE;
455 typedef enum _THREADINFOCLASS {
456 ThreadBasicInformation,
457 ThreadTimes,
458 ThreadPriority,
459 ThreadBasePriority,
460 ThreadAffinityMask,
461 ThreadImpersonationToken,
462 ThreadDescriptorTableEntry,
463 ThreadEnableAlignmentFaultFixup,
464 ThreadEventPair_Reusable,
465 ThreadQuerySetWin32StartAddress,
466 ThreadZeroTlsCell,
467 ThreadPerformanceCount,
468 ThreadAmILastThread,
469 ThreadIdealProcessor,
470 ThreadPriorityBoost,
471 ThreadSetTlsArrayAddress,
472 ThreadIsIoPending,
473 MaxThreadInfoClass
474 } THREADINFOCLASS;
476 typedef struct _THREAD_BASIC_INFORMATION
478 NTSTATUS ExitStatus;
479 PVOID TebBaseAddress;
480 CLIENT_ID ClientId;
481 ULONG AffinityMask;
482 LONG Priority;
483 LONG BasePriority;
484 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
487 typedef enum _WINSTATIONINFOCLASS {
488 WinStationInformation = 8
489 } WINSTATIONINFOCLASS;
491 typedef enum
493 MemoryBasicInformation = 0
494 } MEMORY_INFORMATION_CLASS;
496 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
497 typedef enum
499 INVALID_PATH = 0,
500 UNC_PATH, /* "//foo" */
501 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
502 RELATIVE_DRIVE_PATH, /* "c:foo" */
503 ABSOLUTE_PATH, /* "/foo" */
504 RELATIVE_PATH, /* "foo" */
505 DEVICE_PATH, /* "//./foo" */
506 UNC_DOT_PATH /* "//." */
507 } DOS_PATHNAME_TYPE;
509 /***********************************************************************
510 * IA64 specific types and data structures
513 #ifdef __ia64__
515 typedef struct _FRAME_POINTERS {
516 ULONGLONG MemoryStackFp;
517 ULONGLONG BackingStoreFp;
518 } FRAME_POINTERS, *PFRAME_POINTERS;
520 #define UNWIND_HISTORY_TABLE_SIZE 12
522 typedef struct _RUNTIME_FUNCTION {
523 ULONG BeginAddress;
524 ULONG EndAddress;
525 ULONG UnwindInfoAddress;
526 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
528 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
529 ULONG64 ImageBase;
530 ULONG64 Gp;
531 PRUNTIME_FUNCTION FunctionEntry;
532 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
534 typedef struct _UNWIND_HISTORY_TABLE {
535 ULONG Count;
536 UCHAR Search;
537 ULONG64 LowAddress;
538 ULONG64 HighAddress;
539 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
540 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
542 #endif /* defined(__ia64__) */
544 /***********************************************************************
545 * Types and data structures
548 /* This is used by NtQuerySystemInformation */
549 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
550 typedef struct {
551 FILETIME ftKernelTime;
552 FILETIME ftUserTime;
553 FILETIME ftCreateTime;
554 DWORD dwTickCount;
555 DWORD dwStartAddress;
556 DWORD dwOwningPID;
557 DWORD dwThreadID;
558 DWORD dwCurrentPriority;
559 DWORD dwBasePriority;
560 DWORD dwContextSwitches;
561 DWORD dwThreadState;
562 DWORD dwWaitReason;
563 } THREADINFO, *PTHREADINFO;
565 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
566 typedef struct _THREAD_INFO{
567 DWORD Unknown1[6];
568 DWORD ThreadID;
569 DWORD Unknown2[3];
570 DWORD Status;
571 DWORD WaitReason;
572 DWORD Unknown3[4];
573 } THREAD_INFO, PTHREAD_INFO;
575 /***********************************************************************
576 * Types and data structures
579 typedef struct _IO_STATUS_BLOCK {
580 union {
581 NTSTATUS Status;
582 PVOID Pointer;
583 } DUMMYUNIONNAME;
585 ULONG_PTR Information;
586 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
588 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
590 typedef struct _KEY_BASIC_INFORMATION {
591 LARGE_INTEGER LastWriteTime;
592 ULONG TitleIndex;
593 ULONG NameLength;
594 WCHAR Name[1];
595 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
597 typedef struct _KEY_NODE_INFORMATION
599 LARGE_INTEGER LastWriteTime;
600 ULONG TitleIndex;
601 ULONG ClassOffset;
602 ULONG ClassLength;
603 ULONG NameLength;
604 WCHAR Name[1];
605 /* Class[1]; */
606 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
608 typedef struct _KEY_FULL_INFORMATION
610 LARGE_INTEGER LastWriteTime;
611 ULONG TitleIndex;
612 ULONG ClassOffset;
613 ULONG ClassLength;
614 ULONG SubKeys;
615 ULONG MaxNameLen;
616 ULONG MaxClassLen;
617 ULONG Values;
618 ULONG MaxValueNameLen;
619 ULONG MaxValueDataLen;
620 WCHAR Class[1];
621 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
623 typedef struct _KEY_VALUE_ENTRY
625 PUNICODE_STRING ValueName;
626 ULONG DataLength;
627 ULONG DataOffset;
628 ULONG Type;
629 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
631 typedef struct _KEY_VALUE_BASIC_INFORMATION {
632 ULONG TitleIndex;
633 ULONG Type;
634 ULONG NameLength;
635 WCHAR Name[1];
636 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
638 typedef struct _KEY_VALUE_FULL_INFORMATION {
639 ULONG TitleIndex;
640 ULONG Type;
641 ULONG DataOffset;
642 ULONG DataLength;
643 ULONG NameLength;
644 WCHAR Name[1];
645 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
647 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
648 ULONG TitleIndex;
649 ULONG Type;
650 ULONG DataLength;
651 UCHAR Data[1];
652 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
654 typedef struct _OBJECT_ATTRIBUTES {
655 ULONG Length;
656 HANDLE RootDirectory;
657 PUNICODE_STRING ObjectName;
658 ULONG Attributes;
659 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
660 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
661 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
663 typedef struct _OBJECT_DATA_INFORMATION {
664 BOOLEAN InheritHandle;
665 BOOLEAN ProtectFromClose;
666 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
668 typedef struct _PROCESS_BASIC_INFORMATION {
669 #ifdef __WINESRC__
670 DWORD ExitStatus;
671 DWORD PebBaseAddress;
672 DWORD AffinityMask;
673 DWORD BasePriority;
674 ULONG UniqueProcessId;
675 ULONG InheritedFromUniqueProcessId;
676 #else
677 PVOID Reserved1;
678 PPEB PebBaseAddress;
679 PVOID Reserved2[2];
680 ULONG_PTR UniqueProcessId;
681 PVOID Reserved3;
682 #endif
683 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
685 typedef struct _PROCESS_INFO {
686 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
687 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
688 DWORD Unknown1[6];
689 FILETIME CreationTime; /* 20 */
690 DWORD Unknown2[5];
691 PWCHAR ProcessName; /* 3c ok */
692 DWORD BasePriority;
693 DWORD ProcessID; /* 44 ok*/
694 DWORD ParentProcessID;
695 DWORD HandleCount;
696 DWORD Unknown3[2]; /* 50 */
697 ULONG PeakVirtualSize;
698 ULONG VirtualSize;
699 ULONG PageFaultCount;
700 ULONG PeakWorkingSetSize;
701 ULONG WorkingSetSize;
702 ULONG QuotaPeakPagedPoolUsage;
703 ULONG QuotaPagedPoolUsage;
704 ULONG QuotaPeakNonPagedPoolUsage;
705 ULONG QuotaNonPagedPoolUsage;
706 ULONG PagefileUsage;
707 ULONG PeakPagefileUsage;
708 DWORD PrivateBytes;
709 DWORD Unknown6[4];
710 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
711 } PROCESS_INFO, PPROCESS_INFO;
713 typedef struct _RTL_HEAP_DEFINITION {
714 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
716 ULONG Unknown[11];
717 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
719 typedef struct _RTL_RWLOCK {
720 RTL_CRITICAL_SECTION rtlCS;
722 HANDLE hSharedReleaseSemaphore;
723 UINT uSharedWaiters;
725 HANDLE hExclusiveReleaseSemaphore;
726 UINT uExclusiveWaiters;
728 INT iNumberActive;
729 HANDLE hOwningThreadId;
730 DWORD dwTimeoutBoost;
731 PVOID pDebugInfo;
732 } RTL_RWLOCK, *LPRTL_RWLOCK;
734 /* System Information Class 0x00 */
735 typedef struct _SYSTEM_BASIC_INFORMATION {
736 #ifdef __WINESRC__
737 DWORD dwUnknown1;
738 ULONG uKeMaximumIncrement;
739 ULONG uPageSize;
740 ULONG uMmNumberOfPhysicalPages;
741 ULONG uMmLowestPhysicalPage;
742 ULONG uMmHighestPhysicalPage;
743 ULONG uAllocationGranularity;
744 PVOID pLowestUserAddress;
745 PVOID pMmHighestUserAddress;
746 ULONG uKeActiveProcessors;
747 BYTE bKeNumberProcessors;
748 BYTE bUnknown2;
749 WORD wUnknown3;
750 #else
751 BYTE Reserved1[24];
752 PVOID Reserved2[4];
753 CCHAR NumberOfProcessors;
754 #endif
755 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
757 /* System Information Class 0x15 */
758 typedef struct {
759 ULONG CurrentSize;
760 ULONG PeakSize;
761 ULONG PageFaultCount;
762 ULONG MinimumWorkingSet;
763 ULONG MaximumWorkingSet;
764 ULONG unused[4];
765 } SYSTEM_CACHE_INFORMATION;
767 typedef struct _SYSTEM_CONFIGURATION_INFO {
768 union {
769 ULONG OemId;
770 struct {
771 WORD ProcessorArchitecture;
772 WORD Reserved;
773 } tag1;
774 } tag2;
775 ULONG PageSize;
776 PVOID MinimumApplicationAddress;
777 PVOID MaximumApplicationAddress;
778 ULONG ActiveProcessorMask;
779 ULONG NumberOfProcessors;
780 ULONG ProcessorType;
781 ULONG AllocationGranularity;
782 WORD ProcessorLevel;
783 WORD ProcessorRevision;
784 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
786 /* System Information Class 0x0b */
787 typedef struct {
788 PVOID pvAddress;
789 DWORD dwUnknown1;
790 DWORD dwUnknown2;
791 DWORD dwEntryIndex;
792 DWORD dwUnknown3;
793 char szName[MAX_PATH + 1];
794 } SYSTEM_DRIVER_INFORMATION;
796 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
797 BYTE Reserved1[16];
798 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
800 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
801 BYTE Reserved1[32];
802 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
804 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
805 BYTE Reserved1[24];
806 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
808 /* System Information Class 0x10 */
809 typedef struct {
810 USHORT dwPID;
811 USHORT dwCreatorBackTraceIndex;
812 BYTE bObjectType;
813 BYTE bHandleAttributes;
814 USHORT usHandleOffset;
815 DWORD dwKeObject;
816 ULONG ulGrantedAccess;
817 } HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
819 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
820 BYTE Reserved1[312];
821 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
823 /* System Information Class 0x02 */
824 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
825 #ifdef __WINESRC__
826 LARGE_INTEGER liIdleTime;
827 DWORD dwSpare[10];
828 #else
829 LARGE_INTEGER IdleTime;
830 LARGE_INTEGER KernelTime;
831 LARGE_INTEGER UserTime;
832 LARGE_INTEGER Reserved1[2];
833 ULONG Reserved2;
834 #endif
835 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
837 /* System Information Class 0x05 */
838 typedef struct _SYSTEM_PROCESS_INFORMATION {
839 #ifdef __WINESRC__
840 DWORD dwOffset;
841 DWORD dwThreadCount;
842 DWORD dwUnknown1[6];
843 FILETIME ftCreationTime;
844 DWORD dwUnknown2[5];
845 WCHAR *pszProcessName;
846 DWORD dwBasePriority;
847 DWORD dwProcessID;
848 DWORD dwParentProcessID;
849 DWORD dwHandleCount;
850 DWORD dwUnknown3;
851 DWORD dwUnknown4;
852 DWORD dwVirtualBytesPeak;
853 DWORD dwVirtualBytes;
854 DWORD dwPageFaults;
855 DWORD dwWorkingSetPeak;
856 DWORD dwWorkingSet;
857 DWORD dwUnknown5;
858 DWORD dwPagedPool;
859 DWORD dwUnknown6;
860 DWORD dwNonPagedPool;
861 DWORD dwPageFileBytesPeak;
862 DWORD dwPrivateBytes;
863 DWORD dwPageFileBytes;
864 DWORD dwUnknown7[4];
865 THREADINFO ti[1];
866 #else
867 ULONG NextEntryOffset;
868 BYTE Reserved1[52];
869 PVOID Reserved2[3];
870 HANDLE UniqueProcessId;
871 PVOID Reserved3;
872 ULONG HandleCount;
873 BYTE Reserved4[4];
874 PVOID Reserved5[11];
875 SIZE_T PeakPagefileUsage;
876 SIZE_T PrivatePageCount;
877 LARGE_INTEGER Reserved6[6];
878 #endif
879 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
881 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
882 ULONG RegistryQuotaAllowed;
883 ULONG RegistryQuotaUsed;
884 PVOID Reserved1;
885 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
887 typedef struct _SYSTEM_TIME_ADJUSTMENT {
888 ULONG TimeAdjustment;
889 BOOLEAN TimeAdjustmentDisabled;
890 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
892 /* System Information Class 0x03 */
893 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
894 #ifdef __WINESRC__
895 LARGE_INTEGER liKeBootTime;
896 LARGE_INTEGER liKeSystemTime;
897 LARGE_INTEGER liExpTimeZoneBias;
898 ULONG uCurrentTimeZoneId;
899 DWORD dwReserved;
900 #else
901 BYTE Reserved1[48];
902 #endif
903 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
905 typedef struct _TIME_FIELDS
906 { CSHORT Year;
907 CSHORT Month;
908 CSHORT Day;
909 CSHORT Hour;
910 CSHORT Minute;
911 CSHORT Second;
912 CSHORT Milliseconds;
913 CSHORT Weekday;
914 } TIME_FIELDS, *PTIME_FIELDS;
916 typedef struct _WINSTATIONINFORMATIONW {
917 BYTE Reserved2[70];
918 ULONG LogonId;
919 BYTE Reserved3[1140];
920 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
922 typedef struct _VM_COUNTERS_ {
923 ULONG PeakVirtualSize;
924 ULONG VirtualSize;
925 ULONG PageFaultCount;
926 ULONG PeakWorkingSetSize;
927 ULONG WorkingSetSize;
928 ULONG QuotaPeakPagedPoolUsage;
929 ULONG QuotaPagedPoolUsage;
930 ULONG QuotaPeakNonPagedPoolUsage;
931 ULONG QuotaNonPagedPoolUsage;
932 ULONG PagefileUsage;
933 ULONG PeakPagefileUsage;
934 } VM_COUNTERS, *PVM_COUNTERS;
936 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
938 typedef struct _LDR_RESOURCE_INFO
940 ULONG Type;
941 ULONG Name;
942 ULONG Language;
943 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
946 /* debug buffer definitions */
948 typedef struct _DEBUG_BUFFER {
949 HANDLE SectionHandle;
950 PVOID SectionBase;
951 PVOID RemoteSectionBase;
952 ULONG SectionBaseDelta;
953 HANDLE EventPairHandle;
954 ULONG Unknown[2];
955 HANDLE RemoteThreadHandle;
956 ULONG InfoClassMask;
957 ULONG SizeOfInfo;
958 ULONG AllocatedSize;
959 ULONG SectionSize;
960 PVOID ModuleInformation;
961 PVOID BackTraceInformation;
962 PVOID HeapInformation;
963 PVOID LockInformation;
964 PVOID Reserved[8];
965 } DEBUG_BUFFER, *PDEBUG_BUFFER;
967 #define PDI_MODULES 0x01
968 #define PDI_BACKTRACE 0x02
969 #define PDI_HEAPS 0x04
970 #define PDI_HEAP_TAGS 0x08
971 #define PDI_HEAP_BLOCKS 0x10
972 #define PDI_LOCKS 0x20
974 typedef struct _DEBUG_MODULE_INFORMATION {
975 ULONG Reserved[2];
976 ULONG Base;
977 ULONG Size;
978 ULONG Flags;
979 USHORT Index;
980 USHORT Unknown;
981 USHORT LoadCount;
982 USHORT ModuleNameOffset;
983 CHAR ImageName[256];
984 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
986 typedef struct _DEBUG_HEAP_INFORMATION {
987 ULONG Base;
988 ULONG Flags;
989 USHORT Granularity;
990 USHORT Unknown;
991 ULONG Allocated;
992 ULONG Committed;
993 ULONG TagCount;
994 ULONG BlockCount;
995 ULONG Reserved[7];
996 PVOID Tags;
997 PVOID Blocks;
998 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1000 typedef struct _DEBUG_LOCK_INFORMATION {
1001 PVOID Address;
1002 USHORT Type;
1003 USHORT CreatorBackTraceIndex;
1004 ULONG OwnerThreadId;
1005 ULONG ActiveCount;
1006 ULONG ContentionCount;
1007 ULONG EntryCount;
1008 ULONG RecursionCount;
1009 ULONG NumberOfSharedWaiters;
1010 ULONG NumberOfExclusiveWaiters;
1011 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1013 typedef struct _PORT_MESSAGE_HEADER {
1014 USHORT DataSize;
1015 USHORT MessageSize;
1016 USHORT MessageType;
1017 USHORT VirtualRangesOffset;
1018 CLIENT_ID ClientId;
1019 ULONG MessageId;
1020 ULONG SectionSize;
1021 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
1023 /***********************************************************************
1024 * Defines
1027 /* flags for NtCreateFile and NtOpenFile */
1028 #define FILE_DIRECTORY_FILE 0x00000001
1029 #define FILE_WRITE_THROUGH 0x00000002
1030 #define FILE_SEQUENTIAL_ONLY 0x00000004
1031 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1032 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1033 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1034 #define FILE_NON_DIRECTORY_FILE 0x00000040
1035 #define FILE_CREATE_TREE_CONNECTION 0x00000080
1036 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1037 #define FILE_NO_EA_KNOWLEDGE 0x00000200
1038 #define FILE_OPEN_FOR_RECOVERY 0x00000400
1039 #define FILE_RANDOM_ACCESS 0x00000800
1040 #define FILE_DELETE_ON_CLOSE 0x00001000
1041 #define FILE_OPEN_BY_FILE_ID 0x00002000
1042 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1043 #define FILE_NO_COMPRESSION 0x00008000
1044 #define FILE_RESERVE_OPFILTER 0x00100000
1045 #define FILE_TRANSACTED_MODE 0x00200000
1046 #define FILE_OPEN_OFFLINE_FILE 0x00400000
1048 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1049 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
1051 /* status for NtCreateFile or NtOpenFile */
1052 #define FILE_SUPERSEDED 0
1053 #define FILE_OPENED 1
1054 #define FILE_CREATED 2
1055 #define FILE_OVERWRITTEN 3
1056 #define FILE_EXISTS 4
1057 #define FILE_DOES_NOT_EXIST 5
1059 /* disposition for NtCreateFile */
1060 #define FILE_SUPERSEDE 0
1061 #define FILE_OPEN 1
1062 #define FILE_CREATE 2
1063 #define FILE_OPEN_IF 3
1064 #define FILE_OVERWRITE 4
1065 #define FILE_OVERWRITE_IF 5
1066 #define FILE_MAXIMUM_DISPOSITION 5
1068 /* Characteristics of a File System */
1069 #define FILE_REMOVABLE_MEDIA 0x00000001
1070 #define FILE_READ_ONLY_DEVICE 0x00000002
1071 #define FILE_FLOPPY_DISKETTE 0x00000004
1072 #define FILE_WRITE_ONE_MEDIA 0x00000008
1073 #define FILE_REMOTE_DEVICE 0x00000010
1074 #define FILE_DEVICE_IS_MOUNTED 0x00000020
1075 #define FILE_VIRTUAL_VOLUME 0x00000040
1077 #if (_WIN32_WINNT >= 0x0501)
1078 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1079 #endif /* (_WIN32_WINNT >= 0x0501) */
1081 #define LOGONID_CURRENT ((ULONG)-1)
1083 #define OBJ_INHERIT 0x00000002L
1084 #define OBJ_PERMANENT 0x00000010L
1085 #define OBJ_EXCLUSIVE 0x00000020L
1086 #define OBJ_CASE_INSENSITIVE 0x00000040L
1087 #define OBJ_OPENIF 0x00000080L
1088 #define OBJ_OPENLINK 0x00000100L
1089 #define OBJ_KERNEL_HANDLE 0x00000200L
1090 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
1092 #define SERVERNAME_CURRENT ((HANDLE)NULL)
1094 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
1095 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
1098 /* DbgPrintEx default levels */
1099 #define DPFLTR_ERROR_LEVEL 0
1100 #define DPFLTR_WARNING_LEVEL 1
1101 #define DPFLTR_TRACE_LEVEL 2
1102 #define DPFLTR_INFO_LEVEL 3
1103 #define DPFLTR_MASK 0x8000000
1105 /***********************************************************************
1106 * Function declarations
1109 extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
1110 extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
1112 #if defined(__i386__) && defined(__GNUC__)
1113 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1114 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1115 #else /* __i386__ && __GNUC__ */
1116 void WINAPI DbgBreakPoint(void);
1117 void WINAPI DbgUserBreakPoint(void);
1118 #endif /* __i386__ && __GNUC__ */
1119 NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1120 NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
1122 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
1123 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
1124 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
1125 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1126 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
1127 void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
1128 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
1129 void WINAPI LdrShutdownProcess(void);
1130 void WINAPI LdrShutdownThread(void);
1131 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,PBOOLEAN);
1132 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
1133 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,PVOID,ULONG*,ULONG,ULONG);
1134 NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
1135 NTSTATUS WINAPI NtClearEvent(HANDLE);
1136 NTSTATUS WINAPI NtClose(HANDLE);
1137 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1138 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
1139 NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
1140 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
1141 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
1142 NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
1143 NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
1144 NTSTATUS WINAPI NtDeleteKey(HKEY);
1145 NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
1146 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
1147 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
1148 NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1149 NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1150 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
1151 NTSTATUS WINAPI NtFlushKey(HKEY);
1152 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
1153 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1154 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
1155 NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1156 NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1157 NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
1158 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
1159 NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
1160 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1161 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
1162 NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
1163 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1164 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
1165 NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1166 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
1167 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
1168 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
1169 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
1170 NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
1171 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
1172 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1173 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
1174 NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
1175 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
1176 NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
1177 NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
1178 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1179 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1180 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
1181 NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1182 NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
1183 NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
1184 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1185 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1186 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
1187 NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
1188 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
1189 NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
1190 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1191 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
1192 NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
1193 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1194 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
1195 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1196 NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
1197 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
1198 NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
1199 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
1200 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
1201 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1202 NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
1203 NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
1204 NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
1205 NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
1206 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
1207 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
1208 NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
1209 NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
1210 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
1211 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1212 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
1213 NTSTATUS WINAPI NtUnloadKey(HKEY);
1214 NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
1215 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1216 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
1217 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1218 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
1219 NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
1220 NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
1222 void WINAPI RtlAcquirePebLock(void);
1223 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1224 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1225 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
1226 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
1227 NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1228 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
1229 NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
1230 PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
1231 DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
1232 BOOLEAN WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1233 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
1234 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1235 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1236 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1237 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1238 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1239 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
1240 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1241 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1242 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1243 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1245 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1246 void WINAPI RtlClearAllBits(PRTL_BITMAP);
1247 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1248 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1249 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1250 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1251 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
1252 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1253 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1254 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
1255 void WINAPI RtlCopyLuid(PLUID,const LUID*);
1256 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
1257 DWORD WINAPI RtlCopySid(DWORD,PSID,PSID);
1258 void WINAPI RtlCopyString(STRING*,const STRING*);
1259 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
1260 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
1261 NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
1262 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
1263 NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
1264 const UNICODE_STRING*,const UNICODE_STRING*,
1265 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
1266 const UNICODE_STRING*,const UNICODE_STRING*,
1267 const UNICODE_STRING*);
1268 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1269 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
1270 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
1271 NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
1273 NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
1274 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
1275 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
1276 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
1277 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1278 NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
1279 HANDLE WINAPI RtlDestroyHeap(HANDLE);
1280 void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
1281 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
1282 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
1283 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
1284 ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
1285 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
1286 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1287 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
1288 NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
1290 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
1291 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
1292 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
1293 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
1294 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
1295 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
1296 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
1297 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
1298 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
1299 BOOL WINAPI RtlEqualSid(PSID,PSID);
1300 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
1301 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1302 NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
1303 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
1304 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
1305 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
1307 NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
1308 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
1309 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
1310 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1311 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1312 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1313 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
1314 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
1315 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
1316 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
1317 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
1318 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1319 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1320 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1321 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1322 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1323 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1324 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
1325 NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
1326 void WINAPI RtlFreeAnsiString(PANSI_STRING);
1327 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1328 void WINAPI RtlFreeOemString(POEM_STRING);
1329 DWORD WINAPI RtlFreeSid(PSID);
1330 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1332 DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
1333 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1334 NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
1335 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1336 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
1337 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1338 DWORD WINAPI RtlGetLastWin32Error(void);
1339 DWORD WINAPI RtlGetLongestNtPathLength(void);
1340 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1341 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1342 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1343 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1344 NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
1346 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1347 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1348 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1349 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1350 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1351 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1352 void WINAPI RtlInitString(PSTRING,PCSZ);
1353 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1354 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
1355 NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
1356 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1357 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1358 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,LPBYTE,ULONG);
1359 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1360 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1362 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1363 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1364 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
1365 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
1366 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
1367 DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1369 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1370 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1371 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1372 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1373 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1374 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1375 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
1376 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
1377 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1378 DWORD WINAPI RtlLengthRequiredSid(DWORD);
1379 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1380 DWORD WINAPI RtlLengthSid(PSID);
1381 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1382 BOOLEAN WINAPI RtlLockHeap(HANDLE);
1384 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1385 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
1386 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1387 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1389 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
1390 PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
1391 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1392 ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
1393 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1394 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1396 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1397 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1398 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1399 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
1401 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1402 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1404 NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
1405 NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
1406 NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1408 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1409 void WINAPI RtlRaiseStatus(NTSTATUS);
1410 ULONG WINAPI RtlRandom(PULONG);
1411 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1412 void WINAPI RtlReleasePebLock(void);
1413 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
1414 ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
1415 void WINAPI RtlRestoreLastWin32Error(DWORD);
1417 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1418 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
1419 NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
1420 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
1421 void WINAPI RtlSetAllBits(PRTL_BITMAP);
1422 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
1423 NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
1424 void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
1425 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1426 NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
1427 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1428 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1429 void WINAPI RtlSetLastWin32Error(DWORD);
1430 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1431 NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
1432 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1433 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1434 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
1435 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1437 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
1438 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
1439 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
1440 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
1441 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1442 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1444 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
1445 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1446 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
1447 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
1448 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1449 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1450 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1451 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1452 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1453 ULONG WINAPI RtlUniform(PULONG);
1454 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1455 void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1456 #ifdef __ia64__
1457 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1458 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1459 #endif
1460 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
1461 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1462 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
1463 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1464 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1465 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1466 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1467 CHAR WINAPI RtlUpperChar(CHAR);
1468 void WINAPI RtlUpperString(STRING *,const STRING *);
1470 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1471 BOOLEAN WINAPI RtlValidAcl(PACL);
1472 BOOLEAN WINAPI RtlValidSid(PSID);
1473 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
1474 NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
1476 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1478 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1479 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1481 /***********************************************************************
1482 * Inline functions
1485 #define InitializeObjectAttributes(p,n,a,r,s) \
1486 do { \
1487 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1488 (p)->RootDirectory = r; \
1489 (p)->Attributes = a; \
1490 (p)->ObjectName = n; \
1491 (p)->SecurityDescriptor = s; \
1492 (p)->SecurityQualityOfService = NULL; \
1493 } while (0)
1495 #define NtCurrentProcess() ((HANDLE)-1)
1497 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1498 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1499 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1500 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1501 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1502 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1503 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1505 inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1507 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1508 lpBits->BitMapBuffer[ulBit >> 3] & (1 << (ulBit & 7)))
1509 return TRUE;
1510 return FALSE;
1513 #define RtlClearAllBits(p) \
1514 do { \
1515 PRTL_BITMAP _p = (p); \
1516 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1517 } while (0)
1519 #define RtlInitializeBitMap(p,b,s) \
1520 do { \
1521 PRTL_BITMAP _p = (p); \
1522 _p->SizeOfBitMap = (s); \
1523 _p->BitMapBuffer = (b); \
1524 } while (0)
1526 #define RtlSetAllBits(p) \
1527 do { \
1528 PRTL_BITMAP _p = (p); \
1529 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1530 } while (0)
1532 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1533 inline static USHORT RtlUshortByteSwap(USHORT s)
1535 return (s >> 8) | (s << 8);
1537 inline static ULONG RtlUlongByteSwap(ULONG i)
1539 #if defined(__i386__) && defined(__GNUC__)
1540 ULONG ret;
1541 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1542 return ret;
1543 #else
1544 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
1545 #endif
1548 /*************************************************************************
1549 * Loader functions and structures.
1551 * Those are not part of standard Winternl.h
1553 typedef struct _LDR_MODULE
1555 LIST_ENTRY InLoadOrderModuleList;
1556 LIST_ENTRY InMemoryOrderModuleList;
1557 LIST_ENTRY InInitializationOrderModuleList;
1558 void* BaseAddress;
1559 void* EntryPoint;
1560 ULONG SizeOfImage;
1561 UNICODE_STRING FullDllName;
1562 UNICODE_STRING BaseDllName;
1563 ULONG Flags;
1564 SHORT LoadCount;
1565 SHORT TlsIndex;
1566 HANDLE SectionHandle;
1567 ULONG CheckSum;
1568 ULONG TimeDateStamp;
1569 } LDR_MODULE, *PLDR_MODULE;
1571 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1572 #define LDR_IMAGE_IS_DLL 0x00000004
1573 #define LDR_LOAD_IN_PROGRESS 0x00001000
1574 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1575 #define LDR_NO_DLL_CALLS 0x00040000
1576 #define LDR_PROCESS_ATTACHED 0x00080000
1577 #define LDR_MODULE_REBASED 0x00200000
1579 /* these ones is Wine specific */
1580 #define LDR_DONT_RESOLVE_REFS 0x40000000
1581 #define LDR_WINE_INTERNAL 0x80000000
1583 /* FIXME: to be checked */
1584 #define MAXIMUM_FILENAME_LENGTH 256
1586 typedef struct _SYSTEM_MODULE
1588 ULONG Reserved1;
1589 ULONG Reserved2;
1590 PVOID ImageBaseAddress;
1591 ULONG ImageSize;
1592 ULONG Flags;
1593 WORD Id;
1594 WORD Rank;
1595 WORD Unknown;
1596 WORD NameOffset;
1597 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1598 } SYSTEM_MODULE, *PSYSTEM_MODULE;
1600 typedef struct _SYSTEM_MODULE_INFORMATION
1602 ULONG ModulesCount;
1603 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1604 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1606 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
1607 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
1608 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
1609 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
1610 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
1611 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
1613 /* list manipulation macros */
1614 #define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1615 #define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1616 #define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1617 #define IsListEmpty(le) ((le)->Flink == (le))
1618 #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)
1619 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
1621 PLIST_ENTRY f, b, e;
1623 e = le->Flink;
1624 f = le->Flink->Flink;
1625 b = le->Flink->Blink;
1626 f->Blink = b;
1627 b->Flink = f;
1629 if (e != le) e->Flink = e->Blink = NULL;
1630 return e;
1632 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
1634 PLIST_ENTRY f, b, e;
1636 e = le->Blink;
1637 f = le->Blink->Flink;
1638 b = le->Blink->Blink;
1639 f->Blink = b;
1640 b->Flink = f;
1642 if (e != le) e->Flink = e->Blink = NULL;
1643 return e;
1646 #ifdef __cplusplus
1647 } /* extern "C" */
1648 #endif /* defined(__cplusplus) */
1650 #endif /* __WINE_WINTERNAL_H */