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