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