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