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