Remove some obsolete and/or redundant info.
[wine/multimedia.git] / include / winternl.h
blob95b6a26dcd6e40a0ba0440565f1768897c7b8af0
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"
25 #include "winnt.h"
26 #include "winreg.h"
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* defined(__cplusplus) */
32 /***********************************************************************
33 * PEB data structure
35 typedef struct _PEB {
36 BYTE Reserved1[2];
37 BYTE BeingDebugged;
38 BYTE Reserved2[229];
39 PVOID Reserved3[59];
40 ULONG SessionId;
41 } PEB, *PPEB;
43 /***********************************************************************
44 * TEB data structure
46 #if 0
47 typedef struct _TEB {
48 BYTE Reserved1[1952];
49 PVOID Reserved2[412];
50 PVOID TlsSlots[64];
51 BYTE Reserved3[8];
52 PVOID Reserved4[26];
53 PVOID ReservedForOle; /* Windows 2000 only */
54 PVOID Reserved5[4];
55 PVOID TlsExpansionSlots;
56 } TEB, *PTEB;
57 #endif
59 /**********************************************************************
60 * Fundamental types and data structures
63 typedef LONG NTSTATUS;
65 typedef CONST char *PCSZ;
67 typedef short CSHORT;
68 typedef CSHORT *PCSHORT;
70 typedef struct _STRING {
71 USHORT Length;
72 USHORT MaximumLength;
73 PCHAR Buffer;
74 } STRING, *PSTRING;
76 typedef STRING ANSI_STRING;
77 typedef PSTRING PANSI_STRING;
78 typedef const STRING *PCANSI_STRING;
80 typedef STRING OEM_STRING;
81 typedef PSTRING POEM_STRING;
82 typedef const STRING *PCOEM_STRING;
84 typedef struct _UNICODE_STRING {
85 USHORT Length; /* bytes */
86 USHORT MaximumLength; /* bytes */
87 PWSTR Buffer;
88 } UNICODE_STRING, *PUNICODE_STRING;
90 typedef const UNICODE_STRING *PCUNICODE_STRING;
92 typedef struct _CLIENT_ID
94 HANDLE UniqueProcess;
95 HANDLE UniqueThread;
96 } CLIENT_ID, *PCLIENT_ID;
98 /***********************************************************************
99 * Enums
102 typedef enum _FILE_INFORMATION_CLASS {
103 FileDirectoryInformation = 1,
104 FileFullDirectoryInformation,
105 FileBothDirectoryInformation,
106 FileBasicInformation,
107 FileStandardInformation,
108 FileInternalInformation,
109 FileEaInformation,
110 FileAccessInformation,
111 FileNameInformation,
112 FileRenameInformation,
113 FileLinkInformation,
114 FileNamesInformation,
115 FileDispositionInformation,
116 FilePositionInformation,
117 FileFullEaInformation,
118 FileModeInformation,
119 FileAlignmentInformation,
120 FileAllInformation,
121 FileAllocationInformation,
122 FileEndOfFileInformation,
123 FileAlternateNameInformation,
124 FileStreamInformation,
125 FilePipeInformation,
126 FilePipeLocalInformation,
127 FilePipeRemoteInformation,
128 FileMailslotQueryInformation,
129 FileMailslotSetInformation,
130 FileCompressionInformation,
131 FileObjectIdInformation,
132 FileCompletionInformation,
133 FileMoveClusterInformation,
134 FileQuotaInformation,
135 FileReparsePointInformation,
136 FileNetworkOpenInformation,
137 FileAttributeTagInformation,
138 FileTrackingInformation,
139 FileMaximumInformation
140 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
142 typedef struct _FILE_BASIC_INFORMATION {
143 LARGE_INTEGER CreationTime;
144 LARGE_INTEGER LastAccessTime;
145 LARGE_INTEGER LastWriteTime;
146 LARGE_INTEGER ChangeTime;
147 ULONG FileAttributes;
148 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
150 typedef struct _FILE_STANDARD_INFORMATION {
151 LARGE_INTEGER AllocationSize;
152 LARGE_INTEGER EndOfFile;
153 ULONG NumberOfLinks;
154 BOOLEAN DeletePending;
155 BOOLEAN Directory;
156 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
158 typedef struct _FILE_POSITION_INFORMATION {
159 LARGE_INTEGER CurrentByteOffset;
160 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
162 typedef struct _FILE_ALIGNMENT_INFORMATION {
163 ULONG AlignmentRequirement;
164 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
166 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
167 LARGE_INTEGER CreationTime;
168 LARGE_INTEGER LastAccessTime;
169 LARGE_INTEGER LastWriteTime;
170 LARGE_INTEGER ChangeTime;
171 LARGE_INTEGER AllocationSize;
172 LARGE_INTEGER EndOfFile;
173 ULONG FileAttributes;
174 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
176 typedef struct _FILE_FULL_EA_INFORMATION {
177 ULONG NextEntryOffset;
178 UCHAR Flags;
179 UCHAR EaNameLength;
180 USHORT EaValueLength;
181 CHAR EaName[1];
182 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
184 typedef struct _FILE_STREAM_INFORMATION
186 ULONG NextEntryOffset;
187 ULONG StreamNameLength;
188 LARGE_INTEGER StreamSize;
189 LARGE_INTEGER StreamAllocationSize;
190 WCHAR StreamName[1];
191 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
193 struct _FILE_ATTRIBUTE_TAG_INFORMATION
195 ULONG FileAttributes;
196 ULONG ReparseTag;
197 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
199 typedef enum _FSINFOCLASS {
200 FileFsVolumeInformation = 1,
201 FileFsLabelInformation,
202 FileFsSizeInformation,
203 FileFsDeviceInformation,
204 FileFsAttributeInformation,
205 FileFsControlInformation,
206 FileFsFullSizeInformation,
207 FileFsObjectIdInformation,
208 FileFsMaximumInformation
209 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
211 typedef enum _KEY_INFORMATION_CLASS {
212 KeyBasicInformation,
213 KeyNodeInformation,
214 KeyFullInformation
215 } KEY_INFORMATION_CLASS;
217 typedef enum _KEY_VALUE_INFORMATION_CLASS {
218 KeyValueBasicInformation,
219 KeyValueFullInformation,
220 KeyValuePartialInformation,
221 KeyValueFullInformationAlign64,
222 KeyValuePartialInformationAlign64
223 } KEY_VALUE_INFORMATION_CLASS;
225 typedef enum _OBJECT_INFORMATION_CLASS {
226 DunnoTheConstants1 /* FIXME */
227 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
229 typedef enum _PROCESSINFOCLASS {
230 ProcessBasicInformation = 0,
231 ProcessQuotaLimits = 1,
232 ProcessIoCounters = 2,
233 ProcessVmCounters = 3,
234 ProcessTimes = 4,
235 ProcessBasePriority = 5,
236 ProcessRaisePriority = 6,
237 ProcessDebugPort = 7,
238 ProcessExceptionPort = 8,
239 ProcessAccessToken = 9,
240 ProcessLdtInformation = 10,
241 ProcessLdtSize = 11,
242 ProcessDefaultHardErrorMode = 12,
243 ProcessIoPortHandlers = 13,
244 ProcessPooledUsageAndLimits = 14,
245 ProcessWorkingSetWatch = 15,
246 ProcessUserModeIOPL = 16,
247 ProcessEnableAlignmentFaultFixup = 17,
248 ProcessPriorityClass = 18,
249 ProcessWx86Information = 19,
250 ProcessHandleCount = 20,
251 ProcessAffinityMask = 21,
252 ProcessPriorityBoost = 22,
253 ProcessDeviceMap = 23,
254 ProcessSessionInformation = 24,
255 ProcessForegroundInformation = 25,
256 ProcessWow64Information = 26,
257 MaxProcessInfoClass
258 } PROCESSINFOCLASS;
260 typedef enum _SECTION_INHERIT {
261 ViewShare = 1,
262 ViewUnmap = 2
263 } SECTION_INHERIT;
265 typedef enum SYSTEM_INFORMATION_CLASS {
266 SystemBasicInformation = 0,
267 Unknown1,
268 SystemPerformanceInformation = 2,
269 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
270 Unknown4,
271 SystemProcessInformation = 5,
272 Unknown6,
273 Unknown7,
274 SystemProcessorPerformanceInformation = 8,
275 Unknown9,
276 Unknown10,
277 SystemDriverInformation,
278 Unknown12,
279 Unknown13,
280 Unknown14,
281 Unknown15,
282 SystemHandleList,
283 Unknown17,
284 Unknown18,
285 Unknown19,
286 Unknown20,
287 SystemCacheInformation,
288 Unknown22,
289 SystemInterruptInformation = 23,
290 SystemExceptionInformation = 33,
291 SystemRegistryQuotaInformation = 37,
292 SystemLookasideInformation = 45
293 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
295 typedef enum _TIMER_TYPE {
296 NotificationTimer,
297 SynchronizationTimer
298 } TIMER_TYPE;
300 typedef enum _THREADINFOCLASS {
301 ThreadBasicInformation,
302 ThreadTimes,
303 ThreadPriority,
304 ThreadBasePriority,
305 ThreadAffinityMask,
306 ThreadImpersonationToken,
307 ThreadDescriptorTableEntry,
308 ThreadEnableAlignmentFaultFixup,
309 ThreadEventPair_Reusable,
310 ThreadQuerySetWin32StartAddress,
311 ThreadZeroTlsCell,
312 ThreadPerformanceCount,
313 ThreadAmILastThread,
314 ThreadIdealProcessor,
315 ThreadPriorityBoost,
316 ThreadSetTlsArrayAddress,
317 ThreadIsIoPending,
318 MaxThreadInfoClass
319 } THREADINFOCLASS;
321 typedef enum _WINSTATIONINFOCLASS {
322 WinStationInformation = 8
323 } WINSTATIONINFOCLASS;
325 typedef enum
327 MemoryBasicInformation = 0
328 } MEMORY_INFORMATION_CLASS;
330 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
331 typedef enum
333 INVALID_PATH = 0,
334 UNC_PATH, /* "//foo" */
335 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
336 RELATIVE_DRIVE_PATH, /* "c:foo" */
337 ABSOLUTE_PATH, /* "/foo" */
338 RELATIVE_PATH, /* "foo" */
339 DEVICE_PATH, /* "//./foo" */
340 UNC_DOT_PATH /* "//." */
341 } DOS_PATHNAME_TYPE;
343 /***********************************************************************
344 * IA64 specific types and data structures
347 #ifdef __ia64__
349 typedef struct _FRAME_POINTERS {
350 ULONGLONG MemoryStackFp;
351 ULONGLONG BackingStoreFp;
352 } FRAME_POINTERS, *PFRAME_POINTERS;
354 #define UNWIND_HISTORY_TABLE_SIZE 12
356 typedef struct _RUNTIME_FUNCTION {
357 ULONG BeginAddress;
358 ULONG EndAddress;
359 ULONG UnwindInfoAddress;
360 } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
362 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
363 ULONG64 ImageBase;
364 ULONG64 Gp;
365 PRUNTIME_FUNCTION FunctionEntry;
366 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
368 typedef struct _UNWIND_HISTORY_TABLE {
369 ULONG Count;
370 UCHAR Search;
371 ULONG64 LowAddress;
372 ULONG64 HighAddress;
373 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
374 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
376 #endif /* defined(__ia64__) */
378 /***********************************************************************
379 * Types and data structures
382 /* This is used by NtQuerySystemInformation */
383 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
384 typedef struct {
385 FILETIME ftCreationTime;
386 DWORD dwUnknown1;
387 DWORD dwStartAddress;
388 DWORD dwOwningPID;
389 DWORD dwThreadID;
390 DWORD dwCurrentPriority;
391 DWORD dwBasePriority;
392 DWORD dwContextSwitches;
393 DWORD dwThreadState;
394 DWORD dwWaitReason;
395 DWORD dwUnknown2[5];
396 } THREADINFO, *PTHREADINFO;
398 /* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
399 typedef struct _THREAD_INFO{
400 DWORD Unknown1[6];
401 DWORD ThreadID;
402 DWORD Unknown2[3];
403 DWORD Status;
404 DWORD WaitReason;
405 DWORD Unknown3[4];
406 } THREAD_INFO, PTHREAD_INFO;
408 /***********************************************************************
409 * Types and data structures
412 typedef struct _IO_STATUS_BLOCK {
413 union {
414 NTSTATUS Status;
415 PVOID Pointer;
416 } DUMMYUNIONNAME;
418 ULONG_PTR Information;
419 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
421 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
423 typedef struct _KEY_BASIC_INFORMATION {
424 LARGE_INTEGER LastWriteTime;
425 ULONG TitleIndex;
426 ULONG NameLength;
427 WCHAR Name[1];
428 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
430 typedef struct _KEY_NODE_INFORMATION
432 LARGE_INTEGER LastWriteTime;
433 ULONG TitleIndex;
434 ULONG ClassOffset;
435 ULONG ClassLength;
436 ULONG NameLength;
437 WCHAR Name[1];
438 /* Class[1]; */
439 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
441 typedef struct _KEY_FULL_INFORMATION
443 LARGE_INTEGER LastWriteTime;
444 ULONG TitleIndex;
445 ULONG ClassOffset;
446 ULONG ClassLength;
447 ULONG SubKeys;
448 ULONG MaxNameLen;
449 ULONG MaxClassLen;
450 ULONG Values;
451 ULONG MaxValueNameLen;
452 ULONG MaxValueDataLen;
453 WCHAR Class[1];
454 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
456 typedef struct _KEY_VALUE_ENTRY
458 PUNICODE_STRING ValueName;
459 ULONG DataLength;
460 ULONG DataOffset;
461 ULONG Type;
462 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
464 typedef struct _KEY_VALUE_BASIC_INFORMATION {
465 ULONG TitleIndex;
466 ULONG Type;
467 ULONG NameLength;
468 WCHAR Name[1];
469 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
471 typedef struct _KEY_VALUE_FULL_INFORMATION {
472 ULONG TitleIndex;
473 ULONG Type;
474 ULONG DataOffset;
475 ULONG DataLength;
476 ULONG NameLength;
477 WCHAR Name[1];
478 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
480 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
481 ULONG TitleIndex;
482 ULONG Type;
483 ULONG DataLength;
484 UCHAR Data[1];
485 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
487 typedef struct _OBJECT_ATTRIBUTES {
488 ULONG Length;
489 HANDLE RootDirectory;
490 PUNICODE_STRING ObjectName;
491 ULONG Attributes;
492 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
493 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
494 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
496 typedef struct _PROCESS_BASIC_INFORMATION {
497 #ifdef __WINESRC__
498 DWORD ExitStatus;
499 DWORD PebBaseAddress;
500 DWORD AffinityMask;
501 DWORD BasePriority;
502 ULONG UniqueProcessId;
503 ULONG InheritedFromUniqueProcessId;
504 #else
505 PVOID Reserved1;
506 PPEB PebBaseAddress;
507 PVOID Reserved2[2];
508 ULONG_PTR UniqueProcessId;
509 PVOID Reserved3;
510 #endif
511 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
513 typedef struct _PROCESS_INFO {
514 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
515 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
516 DWORD Unknown1[6];
517 FILETIME CreationTime; /* 20 */
518 DWORD Unknown2[5];
519 PWCHAR ProcessName; /* 3c ok */
520 DWORD BasePriority;
521 DWORD ProcessID; /* 44 ok*/
522 DWORD ParentProcessID;
523 DWORD HandleCount;
524 DWORD Unknown3[2]; /* 50 */
525 ULONG PeakVirtualSize;
526 ULONG VirtualSize;
527 ULONG PageFaultCount;
528 ULONG PeakWorkingSetSize;
529 ULONG WorkingSetSize;
530 ULONG QuotaPeakPagedPoolUsage;
531 ULONG QuotaPagedPoolUsage;
532 ULONG QuotaPeakNonPagedPoolUsage;
533 ULONG QuotaNonPagedPoolUsage;
534 ULONG PagefileUsage;
535 ULONG PeakPagefileUsage;
536 DWORD PrivateBytes;
537 DWORD Unknown6[4];
538 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
539 } PROCESS_INFO, PPROCESS_INFO;
541 typedef struct _RTL_HEAP_DEFINITION {
542 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
544 ULONG Unknown[11];
545 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
547 typedef struct tagRTL_BITMAP {
548 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
549 LPBYTE BitMapBuffer; /* Bitmap data, assumed sized to a DWORD boundary */
550 } RTL_BITMAP, *PRTL_BITMAP;
552 typedef const RTL_BITMAP *PCRTL_BITMAP;
554 typedef struct tagRTL_BITMAP_RUN {
555 ULONG StartOfRun; /* Bit position at which run starts - FIXME: Name? */
556 ULONG SizeOfRun; /* Size of the run in bits - FIXME: Name? */
557 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
559 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
561 typedef struct _RTL_RWLOCK {
562 RTL_CRITICAL_SECTION rtlCS;
564 HANDLE hSharedReleaseSemaphore;
565 UINT uSharedWaiters;
567 HANDLE hExclusiveReleaseSemaphore;
568 UINT uExclusiveWaiters;
570 INT iNumberActive;
571 HANDLE hOwningThreadId;
572 DWORD dwTimeoutBoost;
573 PVOID pDebugInfo;
574 } RTL_RWLOCK, *LPRTL_RWLOCK;
576 /* System Information Class 0x00 */
577 typedef struct _SYSTEM_BASIC_INFORMATION {
578 #ifdef __WINESRC__
579 DWORD dwUnknown1;
580 ULONG uKeMaximumIncrement;
581 ULONG uPageSize;
582 ULONG uMmNumberOfPhysicalPages;
583 ULONG uMmLowestPhysicalPage;
584 ULONG uMmHighestPhysicalPage;
585 ULONG uAllocationGranularity;
586 PVOID pLowestUserAddress;
587 PVOID pMmHighestUserAddress;
588 ULONG uKeActiveProcessors;
589 BYTE bKeNumberProcessors;
590 BYTE bUnknown2;
591 WORD wUnknown3;
592 #else
593 BYTE Reserved1[24];
594 PVOID Reserved2[4];
595 CCHAR NumberOfProcessors;
596 #endif
597 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
599 /* System Information Class 0x15 */
600 typedef struct {
601 ULONG CurrentSize;
602 ULONG PeakSize;
603 ULONG PageFaultCount;
604 ULONG MinimumWorkingSet;
605 ULONG MaximumWorkingSet;
606 ULONG unused[4];
607 } SYSTEM_CACHE_INFORMATION;
609 typedef struct _SYSTEM_CONFIGURATION_INFO {
610 union {
611 ULONG OemId;
612 struct {
613 WORD ProcessorArchitecture;
614 WORD Reserved;
615 } tag1;
616 } tag2;
617 ULONG PageSize;
618 PVOID MinimumApplicationAddress;
619 PVOID MaximumApplicationAddress;
620 ULONG ActiveProcessorMask;
621 ULONG NumberOfProcessors;
622 ULONG ProcessorType;
623 ULONG AllocationGranularity;
624 WORD ProcessorLevel;
625 WORD ProcessorRevision;
626 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
628 /* System Information Class 0x0b */
629 typedef struct {
630 PVOID pvAddress;
631 DWORD dwUnknown1;
632 DWORD dwUnknown2;
633 DWORD dwEntryIndex;
634 DWORD dwUnknown3;
635 char szName[MAX_PATH + 1];
636 } SYSTEM_DRIVER_INFORMATION;
638 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
639 BYTE Reserved1[16];
640 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
642 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
643 BYTE Reserved1[32];
644 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
646 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
647 BYTE Reserved1[24];
648 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
650 /* System Information Class 0x10 */
651 typedef struct {
652 USHORT dwPID;
653 USHORT dwCreatorBackTraceIndex;
654 BYTE bObjectType;
655 BYTE bHandleAttributes;
656 USHORT usHandleOffset;
657 DWORD dwKeObject;
658 ULONG ulGrantedAccess;
659 } HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
661 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
662 BYTE Reserved1[312];
663 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
665 /* System Information Class 0x02 */
666 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
667 #ifdef __WINESRC__
668 LARGE_INTEGER liIdleTime;
669 DWORD dwSpare[76];
670 #else
671 LARGE_INTEGER IdleTime;
672 LARGE_INTEGER KernelTime;
673 LARGE_INTEGER UserTime;
674 LARGE_INTEGER Reserved1[2];
675 ULONG Reserved2;
676 #endif
677 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
679 /* System Information Class 0x05 */
680 typedef struct _SYSTEM_PROCESS_INFORMATION {
681 #ifdef __WINESRC__
682 DWORD dwOffset;
683 DWORD dwThreadCount;
684 DWORD dwUnknown1[6];
685 FILETIME ftCreationTime;
686 DWORD dwUnknown2[5];
687 WCHAR *pszProcessName;
688 DWORD dwBasePriority;
689 DWORD dwProcessID;
690 DWORD dwParentProcessID;
691 DWORD dwHandleCount;
692 DWORD dwUnknown3;
693 DWORD dwUnknown4;
694 DWORD dwVirtualBytesPeak;
695 DWORD dwVirtualBytes;
696 DWORD dwPageFaults;
697 DWORD dwWorkingSetPeak;
698 DWORD dwWorkingSet;
699 DWORD dwUnknown5;
700 DWORD dwPagedPool;
701 DWORD dwUnknown6;
702 DWORD dwNonPagedPool;
703 DWORD dwPageFileBytesPeak;
704 DWORD dwPrivateBytes;
705 DWORD dwPageFileBytes;
706 DWORD dwUnknown7[4];
707 THREADINFO ti[1];
708 #else
709 ULONG NextEntryOffset;
710 BYTE Reserved1[52];
711 PVOID Reserved2[3];
712 HANDLE UniqueProcessId;
713 PVOID Reserved3;
714 ULONG HandleCount;
715 BYTE Reserved4[4];
716 PVOID Reserved5[11];
717 SIZE_T PeakPagefileUsage;
718 SIZE_T PrivatePageCount;
719 LARGE_INTEGER Reserved6[6];
720 #endif
721 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
723 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
724 ULONG RegistryQuotaAllowed;
725 ULONG RegistryQuotaUsed;
726 PVOID Reserved1;
727 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
729 typedef struct _SYSTEM_TIME_ADJUSTMENT {
730 ULONG TimeAdjustment;
731 BOOLEAN TimeAdjustmentDisabled;
732 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
734 /* System Information Class 0x03 */
735 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
736 #ifdef __WINESRC__
737 LARGE_INTEGER liKeBootTime;
738 LARGE_INTEGER liKeSystemTime;
739 LARGE_INTEGER liExpTimeZoneBias;
740 ULONG uCurrentTimeZoneId;
741 DWORD dwReserved;
742 #else
743 BYTE Reserved1[48];
744 #endif
745 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
747 typedef struct _TIME_FIELDS
748 { CSHORT Year;
749 CSHORT Month;
750 CSHORT Day;
751 CSHORT Hour;
752 CSHORT Minute;
753 CSHORT Second;
754 CSHORT Milliseconds;
755 CSHORT Weekday;
756 } TIME_FIELDS, *PTIME_FIELDS;
758 typedef struct _WINSTATIONINFORMATIONW {
759 BYTE Reserved2[70];
760 ULONG LogonId;
761 BYTE Reserved3[1140];
762 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
764 typedef struct _VM_COUNTERS_ {
765 ULONG PeakVirtualSize;
766 ULONG VirtualSize;
767 ULONG PageFaultCount;
768 ULONG PeakWorkingSetSize;
769 ULONG WorkingSetSize;
770 ULONG QuotaPeakPagedPoolUsage;
771 ULONG QuotaPagedPoolUsage;
772 ULONG QuotaPeakNonPagedPoolUsage;
773 ULONG QuotaNonPagedPoolUsage;
774 ULONG PagefileUsage;
775 ULONG PeakPagefileUsage;
776 } VM_COUNTERS, *PVM_COUNTERS;
778 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
780 typedef struct _LDR_RESOURCE_INFO
782 ULONG Type;
783 ULONG Name;
784 ULONG Language;
785 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
787 /***********************************************************************
788 * Defines
791 /* flags for NtCreateFile and NtOpenFile */
792 #define FILE_DIRECTORY_FLAG 0x00000001
793 #define FILE_WRITE_THROUGH 0x00000002
794 #define FILE_SEQUENTIAL_ONLY 0x00000004
795 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
796 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
797 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
798 #define FILE_NON_DIRECTORY_FILE 0x00000040
799 #define FILE_CREATE_TREE_CONNECTION 0x00000080
801 /* status for NtCreateFile or NtOpenFile */
802 #define FILE_SUPERSEDED 0x00000000
803 #define FILE_OPENED 0x00000001
804 #define FILE_CREATED 0x00000002
805 #define FILE_OVERWRITTEN 0x00000003
806 #define FILE_EXISTS 0x00000004
807 #define FILE_DOES_NOT_EXIST 0x00000005
809 #if (_WIN32_WINNT >= 0x0501)
810 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
811 #endif /* (_WIN32_WINNT >= 0x0501) */
813 #define LOGONID_CURRENT ((ULONG)-1)
815 #define OBJ_INHERIT 0x00000002L
816 #define OBJ_PERMANENT 0x00000010L
817 #define OBJ_EXCLUSIVE 0x00000020L
818 #define OBJ_CASE_INSENSITIVE 0x00000040L
819 #define OBJ_OPENIF 0x00000080L
820 #define OBJ_OPENLINK 0x00000100L
821 #define OBJ_KERNEL_HANDLE 0x00000200L
822 #define OBJ_VALID_ATTRIBUTES 0x000003F2L
824 #define SERVERNAME_CURRENT ((HANDLE)NULL)
826 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
828 /***********************************************************************
829 * Function declarations
832 extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
833 extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
835 #if defined(__i386__) && defined(__GNUC__)
836 static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
837 static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
838 #else /* __i386__ && __GNUC__ */
839 void WINAPI DbgBreakPoint(void);
840 void WINAPI DbgUserBreakPoint(void);
841 #endif /* __i386__ && __GNUC__ */
842 void WINAPIV DbgPrint(LPCSTR fmt, ...);
844 NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
845 NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY_ENTRY**);
846 NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
847 NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,PBOOLEAN);
848 NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
849 NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,PVOID,ULONG*,ULONG,ULONG);
850 NTSTATUS WINAPI NtClearEvent(HANDLE);
851 NTSTATUS WINAPI NtClose(HANDLE);
852 NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
853 NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
854 NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
855 NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
856 NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
857 NTSTATUS WINAPI NtDeleteKey(HKEY);
858 NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
859 NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
860 NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
861 NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
862 NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
863 NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
864 NTSTATUS WINAPI NtFlushKey(HKEY);
865 NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
866 NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
867 NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
868 NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
869 NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
870 NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
871 NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
872 NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
873 NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
874 NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
875 NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
876 NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
877 NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
878 NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
879 NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
880 NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
881 NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
882 NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
883 NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
884 NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
885 NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
886 NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
887 NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
888 NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
889 NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
890 NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
891 NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
892 NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
893 void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
894 NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
895 NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
896 NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
897 NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
898 NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
899 NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
900 NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
901 NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
902 NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
903 NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
904 NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
905 NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
906 NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
907 NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
908 NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
909 NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
910 NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
911 NTSTATUS WINAPI NtUnloadKey(HKEY);
912 NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
913 NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
914 NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,PLARGE_INTEGER);
915 NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,PLARGE_INTEGER);
917 void WINAPI RtlAcquirePebLock(void);
918 BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
919 BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
920 NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
921 NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
922 BOOL WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
923 NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
924 DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
925 BOOLEAN WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
926 PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
927 DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
928 NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
929 NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
930 NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
931 NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
932 NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
933 BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
934 BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
935 BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
936 BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
938 NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
939 void WINAPI RtlClearAllBits(PRTL_BITMAP);
940 void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
941 ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
942 LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
943 LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
944 DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
945 NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
946 LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
947 ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
948 void WINAPI RtlCopyLuid(PLUID,const LUID*);
949 void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
950 DWORD WINAPI RtlCopySid(DWORD,PSID,PSID);
951 void WINAPI RtlCopyString(STRING*,const STRING*);
952 void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
953 NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
954 DWORD WINAPI RtlCreateEnvironment(DWORD,DWORD);
955 HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
956 NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
957 BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
958 BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
960 NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
961 void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
962 DWORD WINAPI RtlDeleteSecurityObject(DWORD);
963 DWORD WINAPI RtlDestroyEnvironment(DWORD);
964 HANDLE WINAPI RtlDestroyHeap(HANDLE);
965 DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
966 BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,DWORD,DWORD);
967 WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
968 NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
969 void WINAPI RtlDumpResource(LPRTL_RWLOCK);
971 LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
972 ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
973 UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
974 NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
975 void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
976 NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
977 NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
978 BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
979 BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
980 BOOL WINAPI RtlEqualSid(PSID,PSID);
981 BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
982 BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
983 LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
984 LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
985 LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
987 ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
988 ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
989 ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
990 ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
991 ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
992 CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
993 ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
994 ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
995 NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
996 CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
997 ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
998 ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
999 ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1000 ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1001 ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1002 BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1003 NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
1004 void WINAPI RtlFreeAnsiString(PANSI_STRING);
1005 BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1006 void WINAPI RtlFreeOemString(POEM_STRING);
1007 DWORD WINAPI RtlFreeSid(PSID);
1008 void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1010 DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
1011 NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
1012 NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1013 ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
1014 NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1015 BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1016 NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1017 ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1018 NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1020 PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1021 PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1022 PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1023 PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1024 PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1025 BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1026 void WINAPI RtlInitString(PSTRING,PCSZ);
1027 void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1028 void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
1029 NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1030 NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1031 void WINAPI RtlInitializeBitMap(PRTL_BITMAP,LPBYTE,ULONG);
1032 void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1033 BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1035 NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1036 NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1037 NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
1038 ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
1039 BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
1040 DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1042 LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1043 LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1044 ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1045 LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1046 LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1047 LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1048 LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
1049 NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
1050 NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1051 DWORD WINAPI RtlLengthRequiredSid(DWORD);
1052 ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1053 DWORD WINAPI RtlLengthSid(PSID);
1054 NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1055 BOOLEAN WINAPI RtlLockHeap(HANDLE);
1057 NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
1058 void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
1059 NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1060 NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1062 DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
1063 LPVOID WINAPI RtlNormalizeProcessParams(LPVOID);
1064 ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
1065 ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1066 ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1068 UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1069 NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1070 NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1071 DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
1073 BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1074 BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1076 DWORD WINAPI RtlQueryEnvironmentVariable_U(DWORD,PUNICODE_STRING,PUNICODE_STRING) ;
1077 NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1079 void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1080 void WINAPI RtlRaiseStatus(NTSTATUS);
1081 ULONG WINAPI RtlRandom(PULONG);
1082 PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1083 void WINAPI RtlReleasePebLock(void);
1084 void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
1086 void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1087 void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
1088 void WINAPI RtlSetAllBits(PRTL_BITMAP);
1089 void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
1090 NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1091 DWORD WINAPI RtlSetEnvironmentVariable(DWORD,PUNICODE_STRING,PUNICODE_STRING);
1092 NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1093 NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1094 NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
1095 NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
1096 ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1097 LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1098 LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
1099 NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
1101 void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
1102 BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
1103 void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
1104 BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,PULONG);
1105 BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1106 BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1108 ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
1109 DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1110 NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
1111 NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
1112 DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1113 NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1114 NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1115 NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1116 NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1117 ULONG WINAPI RtlUniform(PULONG);
1118 BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1119 void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1120 #ifdef __ia64__
1121 void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1122 void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1123 #endif
1124 WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
1125 NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1126 NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
1127 NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1128 NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1129 NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1130 NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1131 CHAR WINAPI RtlUpperChar(CHAR);
1132 void WINAPI RtlUpperString(STRING *,const STRING *);
1134 NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
1135 BOOLEAN WINAPI RtlValidAcl(PACL);
1136 BOOLEAN WINAPI RtlValidSid(PSID);
1137 BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
1139 NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1141 NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1142 NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1144 /***********************************************************************
1145 * Inline functions
1148 #define InitializeObjectAttributes(p,n,a,r,s) \
1149 do { \
1150 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1151 (p)->RootDirectory = r; \
1152 (p)->Attributes = a; \
1153 (p)->ObjectName = n; \
1154 (p)->SecurityDescriptor = s; \
1155 (p)->SecurityQualityOfService = NULL; \
1156 } while (0)
1158 #define NtCurrentProcess() ((HANDLE)-1)
1160 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1161 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1162 #define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1163 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1164 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1165 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1166 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1168 inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1170 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1171 lpBits->BitMapBuffer[ulBit >> 3] & (1 << (ulBit & 7)))
1172 return TRUE;
1173 return FALSE;
1176 #define RtlClearAllBits(p) \
1177 do { \
1178 PRTL_BITMAP _p = (p); \
1179 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1180 } while (0)
1182 #define RtlInitializeBitMap(p,b,s) \
1183 do { \
1184 PRTL_BITMAP _p = (p); \
1185 _p->SizeOfBitMap = (s); \
1186 _p->BitMapBuffer = (b); \
1187 } while (0)
1189 #define RtlSetAllBits(p) \
1190 do { \
1191 PRTL_BITMAP _p = (p); \
1192 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1193 } while (0)
1195 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1196 inline static USHORT RtlUshortByteSwap(USHORT s)
1198 return (s >> 8) | (s << 8);
1200 inline static ULONG RtlUlongByteSwap(ULONG i)
1202 #if defined(__i386__) && defined(__GNUC__)
1203 ULONG ret;
1204 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1205 return ret;
1206 #else
1207 return ((ULONG)RtlUshortByteSwap(i) << 16) | RtlUshortByteSwap(i >> 16);
1208 #endif
1211 /*************************************************************************
1212 * Loader functions and structures.
1214 * Those are not part of standard Winternl.h
1216 typedef struct _LDR_MODULE
1218 LIST_ENTRY InLoadOrderModuleList;
1219 LIST_ENTRY InMemoryOrderModuleList;
1220 LIST_ENTRY InInitializationOrderModuleList;
1221 void* BaseAddress;
1222 void* EntryPoint;
1223 ULONG SizeOfImage;
1224 UNICODE_STRING FullDllName;
1225 UNICODE_STRING BaseDllName;
1226 ULONG Flags;
1227 SHORT LoadCount;
1228 SHORT TlsIndex;
1229 HANDLE SectionHandle;
1230 ULONG CheckSum;
1231 ULONG TimeDateStamp;
1232 } LDR_MODULE, *PLDR_MODULE;
1234 /* those defines are (some of the) regular LDR_MODULE.Flags values */
1235 #define LDR_IMAGE_IS_DLL 0x00000004
1236 #define LDR_LOAD_IN_PROGRESS 0x00001000
1237 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
1238 #define LDR_NO_DLL_CALLS 0x00040000
1239 #define LDR_PROCESS_ATTACHED 0x00080000
1240 #define LDR_MODULE_REBASED 0x00200000
1242 /* these ones is Wine specific */
1243 #define LDR_DONT_RESOLVE_REFS 0x40000000
1244 #define LDR_WINE_INTERNAL 0x80000000
1246 /* FIXME: to be checked */
1247 #define MAXIMUM_FILENAME_LENGTH 256
1249 typedef struct _SYSTEM_MODULE
1251 ULONG Reserved1;
1252 ULONG Reserved2;
1253 PVOID ImageBaseAddress;
1254 ULONG ImageSize;
1255 ULONG Flags;
1256 WORD Id;
1257 WORD Rank;
1258 WORD Unknown;
1259 WORD NameOffset;
1260 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1261 } SYSTEM_MODULE, *PSYSTEM_MODULE;
1263 typedef struct _SYSTEM_MODULE_INFORMATION
1265 ULONG ModulesCount;
1266 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1267 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1269 NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
1270 NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
1271 NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, PUNICODE_STRING, HMODULE*);
1272 NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, PANSI_STRING, ULONG, void**);
1273 NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, PUNICODE_STRING, HMODULE*);
1274 NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
1275 NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
1276 NTSTATUS WINAPI LdrShutdownProcess(void);
1277 NTSTATUS WINAPI LdrShutdownThread(void);
1278 NTSTATUS WINAPI LdrUnloadDll(HMODULE);
1279 NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
1281 #ifdef __cplusplus
1282 } /* extern "C" */
1283 #endif /* defined(__cplusplus) */
1285 #endif /* __WINE_WINTERNAL_H */