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