blob: 121a62fbca0e44427778a001048359e17df816a4 [file] [log] [blame]
Patrik Stridvalleba96492002-09-10 00:33:34 +00001/*
2 * Internal NT APIs and data structures
3 *
4 * Copyright (C) the Wine project
5 *
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.
10 *
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.
15 *
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
19 */
20
21#ifndef __WINE_WINTERNAL_H
22#define __WINE_WINTERNAL_H
23
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +000024#include <windef.h>
Patrik Stridvalleba96492002-09-10 00:33:34 +000025
26#ifdef __cplusplus
27extern "C" {
28#endif /* defined(__cplusplus) */
29
Patrik Stridvalleba96492002-09-10 00:33:34 +000030
Patrik Stridvalleba96492002-09-10 00:33:34 +000031/**********************************************************************
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +000032 * Fundamental types and data structures
Patrik Stridvalleba96492002-09-10 00:33:34 +000033 */
34
35typedef LONG NTSTATUS;
36
37typedef CONST char *PCSZ;
38
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +000039typedef short CSHORT;
40typedef CSHORT *PCSHORT;
41
Patrik Stridvalleba96492002-09-10 00:33:34 +000042typedef struct _STRING {
43 USHORT Length;
44 USHORT MaximumLength;
45 PCHAR Buffer;
46} STRING, *PSTRING;
47
48typedef STRING ANSI_STRING;
49typedef PSTRING PANSI_STRING;
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +000050typedef const STRING *PCANSI_STRING;
Patrik Stridvalleba96492002-09-10 00:33:34 +000051
52typedef STRING OEM_STRING;
53typedef PSTRING POEM_STRING;
54typedef const STRING *PCOEM_STRING;
55
56typedef struct _UNICODE_STRING {
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +000057 USHORT Length; /* bytes */
58 USHORT MaximumLength; /* bytes */
Patrik Stridvalleba96492002-09-10 00:33:34 +000059 PWSTR Buffer;
60} UNICODE_STRING, *PUNICODE_STRING;
61
62typedef const UNICODE_STRING *PCUNICODE_STRING;
63
Alexandre Julliard088bcf92003-04-04 22:26:34 +000064typedef struct _CLIENT_ID
65{
66 HANDLE UniqueProcess;
67 HANDLE UniqueThread;
68} CLIENT_ID, *PCLIENT_ID;
69
Eric Pouech35d5d062003-05-15 04:20:42 +000070typedef struct _CURDIR
71{
72 UNICODE_STRING DosPath;
73 PVOID Handle;
74} CURDIR, *PCURDIR;
75
Alexandre Julliard6bc50912003-05-22 03:44:01 +000076typedef struct RTL_DRIVE_LETTER_CURDIR
77{
78 USHORT Flags;
79 USHORT Length;
80 ULONG TimeStamp;
81 UNICODE_STRING DosPath;
82} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
83
Alexandre Julliard5cb5aa62003-10-09 19:58:56 +000084typedef 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;
88
89typedef const RTL_BITMAP *PCRTL_BITMAP;
90
91typedef 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;
95
96typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
97
Alexandre Julliard6bc50912003-05-22 03:44:01 +000098typedef struct _RTL_USER_PROCESS_PARAMETERS
99{
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;
Alexandre Julliarddfcfc982004-04-16 05:00:46 +0000109 CURDIR CurrentDirectory;
Alexandre Julliard6bc50912003-05-22 03:44:01 +0000110 UNICODE_STRING DllPath;
111 UNICODE_STRING ImagePathName;
112 UNICODE_STRING CommandLine;
113 PWSTR Environment;
114 ULONG dwX;
115 ULONG dwY;
116 ULONG dwXSize;
117 ULONG dwYSize;
118 ULONG dwXCountChars;
119 ULONG dwYCountChars;
120 ULONG dwFillAttribute;
121 ULONG dwFlags;
122 ULONG wShowWindow;
123 UNICODE_STRING WindowTitle;
Eric Pouechb53b5bc2003-06-18 03:23:22 +0000124 UNICODE_STRING Desktop;
Alexandre Julliard6bc50912003-05-22 03:44:01 +0000125 UNICODE_STRING ShellInfo;
126 UNICODE_STRING RuntimeInfo;
127 RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
128} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
129
Alexandre Julliard5e3549b2003-10-04 03:11:57 +0000130/* value for Flags field (FIXME: not the correct name) */
131#define PROCESS_PARAMS_FLAG_NORMALIZED 1
Alexandre Julliard6bc50912003-05-22 03:44:01 +0000132
Eric Pouech675b7552003-07-01 03:38:56 +0000133typedef struct _PEB_LDR_DATA
134{
135 ULONG Length;
136 BOOLEAN Initialized;
137 PVOID SsHandle;
138 LIST_ENTRY InLoadOrderModuleList;
139 LIST_ENTRY InMemoryOrderModuleList;
140 LIST_ENTRY InInitializationOrderModuleList;
141} PEB_LDR_DATA, *PPEB_LDR_DATA;
142
Alexandre Julliard6bc50912003-05-22 03:44:01 +0000143/***********************************************************************
144 * PEB data structure
145 */
146typedef struct _PEB
147{
148 BYTE Reserved1[2]; /* 00 */
149 BYTE BeingDebugged; /* 02 */
150 BYTE Reserved2[5]; /* 03 */
151 HMODULE ImageBaseAddress; /* 08 */
Eric Pouech675b7552003-07-01 03:38:56 +0000152 PPEB_LDR_DATA LdrData; /* 0c */
Alexandre Julliard6bc50912003-05-22 03:44:01 +0000153 RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10 */
154 PVOID __pad_14; /* 14 */
155 HANDLE ProcessHeap; /* 18 */
Alexandre Julliard5cb5aa62003-10-09 19:58:56 +0000156 BYTE __pad_1c[36]; /* 1c */
157 PRTL_BITMAP TlsBitmap; /* 40 */
158 ULONG TlsBitmapBits[2]; /* 44 */
Alexandre Julliardcc461322004-06-15 00:52:03 +0000159 BYTE __pad_4c[24]; /* 4c */
160 ULONG NumberOfProcessors; /* 64 */
161 BYTE __pad_68[128]; /* 68 */
Alexandre Julliard6bc50912003-05-22 03:44:01 +0000162 PVOID Reserved3[59]; /* e8 */
163 ULONG SessionId; /* 1d4 */
164} PEB, *PPEB;
165
166
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000167/***********************************************************************
Alexandre Julliard7df1b9e2003-08-28 19:57:35 +0000168 * TEB data structure
169 */
170#if defined(_NTSYSTEM_) || defined(_KERNEL32_) /* hack, should go away */
171# define WINE_NO_TEB
172#endif
173
174#ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */
175# ifndef WINE_TEB_DEFINED
176# define WINE_TEB_DEFINED
177typedef struct _TEB
178{
179 NT_TIB Tib; /* 000 */
180 PVOID EnvironmentPointer; /* 01c */
181 CLIENT_ID ClientId; /* 020 */
182 PVOID ActiveRpcHandle; /* 028 */
183 PVOID ThreadLocalStoragePointer; /* 02c */
184 PPEB Peb; /* 030 */
185 ULONG LastErrorValue; /* 034 */
186 BYTE __pad038[140]; /* 038 */
187 ULONG CurrentLocale; /* 0c4 */
188 BYTE __pad0c8[1752]; /* 0c8 */
189 PVOID Reserved2[278]; /* 7a0 */
190 UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
191 WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
192 PVOID DeallocationStack; /* e0c */
193 PVOID TlsSlots[64]; /* e10 */
Alexandre Julliard2eb5d8b2003-09-08 19:02:01 +0000194 LIST_ENTRY TlsLinks; /* f10 */
Alexandre Julliard7df1b9e2003-08-28 19:57:35 +0000195 PVOID Reserved4[26]; /* f18 */
196 PVOID ReservedForOle; /* f80 Windows 2000 only */
197 PVOID Reserved5[4]; /* f84 */
198 PVOID TlsExpansionSlots; /* f94 */
199} TEB, *PTEB;
200# endif /* WINE_TEB_DEFINED */
201#endif /* WINE_NO_TEB */
202
203/***********************************************************************
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000204 * Enums
205 */
Patrik Stridvalleba96492002-09-10 00:33:34 +0000206
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000207typedef enum _FILE_INFORMATION_CLASS {
208 FileDirectoryInformation = 1,
209 FileFullDirectoryInformation,
210 FileBothDirectoryInformation,
211 FileBasicInformation,
212 FileStandardInformation,
213 FileInternalInformation,
214 FileEaInformation,
215 FileAccessInformation,
216 FileNameInformation,
217 FileRenameInformation,
218 FileLinkInformation,
219 FileNamesInformation,
220 FileDispositionInformation,
221 FilePositionInformation,
222 FileFullEaInformation,
223 FileModeInformation,
224 FileAlignmentInformation,
225 FileAllInformation,
226 FileAllocationInformation,
227 FileEndOfFileInformation,
228 FileAlternateNameInformation,
229 FileStreamInformation,
230 FilePipeInformation,
231 FilePipeLocalInformation,
232 FilePipeRemoteInformation,
233 FileMailslotQueryInformation,
234 FileMailslotSetInformation,
235 FileCompressionInformation,
236 FileObjectIdInformation,
237 FileCompletionInformation,
238 FileMoveClusterInformation,
239 FileQuotaInformation,
240 FileReparsePointInformation,
241 FileNetworkOpenInformation,
242 FileAttributeTagInformation,
243 FileTrackingInformation,
244 FileMaximumInformation
245} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000246
Alexandre Julliardf30cfa82004-03-16 01:32:02 +0000247typedef struct _FILE_DIRECTORY_INFORMATION {
248 ULONG NextEntryOffset;
249 ULONG FileIndex;
250 LARGE_INTEGER CreationTime;
251 LARGE_INTEGER LastAccessTime;
252 LARGE_INTEGER LastWriteTime;
253 LARGE_INTEGER ChangeTime;
254 LARGE_INTEGER EndOfFile;
255 LARGE_INTEGER AllocationSize;
256 ULONG FileAttributes;
257 ULONG FileNameLength;
258 WCHAR FileName[ANYSIZE_ARRAY];
259} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
260
261typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
262 ULONG NextEntryOffset;
263 ULONG FileIndex;
264 LARGE_INTEGER CreationTime;
265 LARGE_INTEGER LastAccessTime;
266 LARGE_INTEGER LastWriteTime;
267 LARGE_INTEGER ChangeTime;
268 LARGE_INTEGER EndOfFile;
269 LARGE_INTEGER AllocationSize;
270 ULONG FileAttributes;
271 ULONG FileNameLength;
272 ULONG EaSize;
273 WCHAR FileName[ANYSIZE_ARRAY];
274} FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
275 FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
276
277typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
278 ULONG NextEntryOffset;
279 ULONG FileIndex;
280 LARGE_INTEGER CreationTime;
281 LARGE_INTEGER LastAccessTime;
282 LARGE_INTEGER LastWriteTime;
283 LARGE_INTEGER ChangeTime;
284 LARGE_INTEGER EndOfFile;
285 LARGE_INTEGER AllocationSize;
286 ULONG FileAttributes;
287 ULONG FileNameLength;
288 ULONG EaSize;
289 CHAR ShortNameLength;
290 WCHAR ShortName[12];
291 WCHAR FileName[ANYSIZE_ARRAY];
292} FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
293 FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
294
Mike McCormack997e2352002-11-18 19:44:17 +0000295typedef struct _FILE_BASIC_INFORMATION {
296 LARGE_INTEGER CreationTime;
297 LARGE_INTEGER LastAccessTime;
298 LARGE_INTEGER LastWriteTime;
299 LARGE_INTEGER ChangeTime;
300 ULONG FileAttributes;
301} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
302
303typedef struct _FILE_STANDARD_INFORMATION {
304 LARGE_INTEGER AllocationSize;
305 LARGE_INTEGER EndOfFile;
306 ULONG NumberOfLinks;
307 BOOLEAN DeletePending;
308 BOOLEAN Directory;
309} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
310
Alexandre Julliardd4874d62004-04-30 21:03:09 +0000311typedef struct _FILE_INTERNAL_INFORMATION {
312 LARGE_INTEGER IndexNumber;
313} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
314
315typedef struct _FILE_EA_INFORMATION {
316 ULONG EaSize;
317} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
318
319typedef struct _FILE_ACCESS_INFORMATION {
320 ACCESS_MASK AccessFlags;
321} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
322
323typedef struct _FILE_NAME_INFORMATION {
324 ULONG FileNameLength;
325 WCHAR FileName[1];
326} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
327
328typedef struct _FILE_RENAME_INFORMATION {
329 BOOLEAN Replace;
330 HANDLE RootDir;
331 ULONG FileNameLength;
332 WCHAR FileName[1];
333} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
334
335typedef struct _FILE_NAMES_INFORMATION {
336 ULONG NextEntryOffset;
337 ULONG FileIndex;
338 ULONG FileNameLength;
339 WCHAR FileName[1];
340} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
341
342typedef struct _FILE_DISPOSITION_INFORMATION {
343 BOOLEAN DoDeleteFile;
344} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
345
Mike McCormack997e2352002-11-18 19:44:17 +0000346typedef struct _FILE_POSITION_INFORMATION {
347 LARGE_INTEGER CurrentByteOffset;
348} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
349
350typedef struct _FILE_ALIGNMENT_INFORMATION {
351 ULONG AlignmentRequirement;
352} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
353
Alexandre Julliardd4874d62004-04-30 21:03:09 +0000354typedef struct _FILE_ALLOCATION_INFORMATION {
355 LARGE_INTEGER AllocationSize;
356} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
357
358typedef struct _FILE_END_OF_FILE_INFORMATION {
359 LARGE_INTEGER EndOfFile;
360} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
361
Mike McCormack997e2352002-11-18 19:44:17 +0000362typedef struct _FILE_NETWORK_OPEN_INFORMATION {
363 LARGE_INTEGER CreationTime;
364 LARGE_INTEGER LastAccessTime;
365 LARGE_INTEGER LastWriteTime;
366 LARGE_INTEGER ChangeTime;
367 LARGE_INTEGER AllocationSize;
368 LARGE_INTEGER EndOfFile;
369 ULONG FileAttributes;
370} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
371
372typedef struct _FILE_FULL_EA_INFORMATION {
373 ULONG NextEntryOffset;
374 UCHAR Flags;
375 UCHAR EaNameLength;
376 USHORT EaValueLength;
377 CHAR EaName[1];
378} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
379
Alexandre Julliardd4874d62004-04-30 21:03:09 +0000380typedef struct _FILE_MODE_INFORMATION {
381 ULONG Mode;
382} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
383
Mike McCormack997e2352002-11-18 19:44:17 +0000384typedef struct _FILE_STREAM_INFORMATION
385{
386 ULONG NextEntryOffset;
387 ULONG StreamNameLength;
388 LARGE_INTEGER StreamSize;
389 LARGE_INTEGER StreamAllocationSize;
390 WCHAR StreamName[1];
391} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
392
Eric Pouech9ff652d2004-05-10 19:58:15 +0000393typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
Mike McCormack997e2352002-11-18 19:44:17 +0000394{
395 ULONG FileAttributes;
396 ULONG ReparseTag;
397} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
398
Alexandre Julliardd4874d62004-04-30 21:03:09 +0000399typedef struct _FILE_ALL_INFORMATION
400{
401 FILE_BASIC_INFORMATION BasicInformation;
402 FILE_STANDARD_INFORMATION StandardInformation;
403 FILE_INTERNAL_INFORMATION InternalInformation;
404 FILE_EA_INFORMATION EaInformation;
405 FILE_ACCESS_INFORMATION AccessInformation;
406 FILE_POSITION_INFORMATION PositionInformation;
407 FILE_MODE_INFORMATION ModeInformation;
408 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
409 FILE_NAME_INFORMATION NameInformation;
410} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
411
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000412typedef enum _FSINFOCLASS {
413 FileFsVolumeInformation = 1,
414 FileFsLabelInformation,
415 FileFsSizeInformation,
416 FileFsDeviceInformation,
417 FileFsAttributeInformation,
418 FileFsControlInformation,
419 FileFsFullSizeInformation,
420 FileFsObjectIdInformation,
421 FileFsMaximumInformation
422} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000423
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000424typedef enum _KEY_INFORMATION_CLASS {
425 KeyBasicInformation,
426 KeyNodeInformation,
427 KeyFullInformation
428} KEY_INFORMATION_CLASS;
429
430typedef enum _KEY_VALUE_INFORMATION_CLASS {
431 KeyValueBasicInformation,
432 KeyValueFullInformation,
433 KeyValuePartialInformation,
434 KeyValueFullInformationAlign64,
435 KeyValuePartialInformationAlign64
436} KEY_VALUE_INFORMATION_CLASS;
437
438typedef enum _OBJECT_INFORMATION_CLASS {
Eric Pouechb3504382003-05-20 19:20:42 +0000439 ObjectBasicInformation,
440 ObjectNameInformation,
441 ObjectTypeInformation,
442 ObjectAllInformation,
443 ObjectDataInformation
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000444} OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
445
446typedef enum _PROCESSINFOCLASS {
447 ProcessBasicInformation = 0,
448 ProcessQuotaLimits = 1,
449 ProcessIoCounters = 2,
450 ProcessVmCounters = 3,
451 ProcessTimes = 4,
452 ProcessBasePriority = 5,
453 ProcessRaisePriority = 6,
454 ProcessDebugPort = 7,
455 ProcessExceptionPort = 8,
456 ProcessAccessToken = 9,
457 ProcessLdtInformation = 10,
458 ProcessLdtSize = 11,
459 ProcessDefaultHardErrorMode = 12,
460 ProcessIoPortHandlers = 13,
461 ProcessPooledUsageAndLimits = 14,
462 ProcessWorkingSetWatch = 15,
463 ProcessUserModeIOPL = 16,
464 ProcessEnableAlignmentFaultFixup = 17,
465 ProcessPriorityClass = 18,
466 ProcessWx86Information = 19,
467 ProcessHandleCount = 20,
468 ProcessAffinityMask = 21,
469 ProcessPriorityBoost = 22,
470 ProcessDeviceMap = 23,
471 ProcessSessionInformation = 24,
472 ProcessForegroundInformation = 25,
473 ProcessWow64Information = 26,
474 MaxProcessInfoClass
475} PROCESSINFOCLASS;
476
477typedef enum _SECTION_INHERIT {
478 ViewShare = 1,
479 ViewUnmap = 2
480} SECTION_INHERIT;
481
482typedef enum SYSTEM_INFORMATION_CLASS {
483 SystemBasicInformation = 0,
484 Unknown1,
485 SystemPerformanceInformation = 2,
486 SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
487 Unknown4,
488 SystemProcessInformation = 5,
489 Unknown6,
490 Unknown7,
491 SystemProcessorPerformanceInformation = 8,
492 Unknown9,
493 Unknown10,
494 SystemDriverInformation,
495 Unknown12,
496 Unknown13,
497 Unknown14,
498 Unknown15,
499 SystemHandleList,
500 Unknown17,
501 Unknown18,
502 Unknown19,
503 Unknown20,
504 SystemCacheInformation,
505 Unknown22,
506 SystemInterruptInformation = 23,
Mike McCormacke79ff702004-04-21 22:21:35 +0000507 SystemDpcBehaviourInformation = 24,
508 SystemFullMemoryInformation = 25,
509 SystemNotImplemented6 = 25,
510 SystemLoadImage = 26,
511 SystemUnloadImage = 27,
512 SystemTimeAdjustmentInformation = 28,
513 SystemTimeAdjustment = 28,
514 SystemSummaryMemoryInformation = 29,
515 SystemNotImplemented7 = 29,
516 SystemNextEventIdInformation = 30,
517 SystemNotImplemented8 = 30,
518 SystemEventIdsInformation = 31,
519 SystemCrashDumpInformation = 32,
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000520 SystemExceptionInformation = 33,
Mike McCormacke79ff702004-04-21 22:21:35 +0000521 SystemCrashDumpStateInformation = 34,
522 SystemKernelDebuggerInformation = 35,
523 SystemContextSwitchInformation = 36,
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000524 SystemRegistryQuotaInformation = 37,
Mike McCormacke79ff702004-04-21 22:21:35 +0000525 SystemCurrentTimeZoneInformation = 44,
526 SystemTimeZoneInformation = 44,
527 SystemLookasideInformation = 45,
528 SystemSetTimeSlipEvent = 46,
529 SystemCreateSession = 47,
530 SystemDeleteSession = 48,
531 SystemInvalidInfoClass4 = 49,
532 SystemRangeStartInformation = 50,
533 SystemVerifierInformation = 51,
534 SystemAddVerifier = 52,
535 SystemSessionProcessesInformation = 53,
536 SystemInformationClassMax
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000537} SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
538
539typedef enum _TIMER_TYPE {
540 NotificationTimer,
541 SynchronizationTimer
542} TIMER_TYPE;
543
544typedef enum _THREADINFOCLASS {
545 ThreadBasicInformation,
546 ThreadTimes,
547 ThreadPriority,
548 ThreadBasePriority,
549 ThreadAffinityMask,
550 ThreadImpersonationToken,
551 ThreadDescriptorTableEntry,
552 ThreadEnableAlignmentFaultFixup,
553 ThreadEventPair_Reusable,
554 ThreadQuerySetWin32StartAddress,
555 ThreadZeroTlsCell,
556 ThreadPerformanceCount,
557 ThreadAmILastThread,
558 ThreadIdealProcessor,
559 ThreadPriorityBoost,
560 ThreadSetTlsArrayAddress,
561 ThreadIsIoPending,
562 MaxThreadInfoClass
563} THREADINFOCLASS;
564
Alexandre Julliard4f196ea2003-07-09 02:57:57 +0000565typedef struct _THREAD_BASIC_INFORMATION
566{
567 NTSTATUS ExitStatus;
568 PVOID TebBaseAddress;
569 CLIENT_ID ClientId;
570 ULONG AffinityMask;
571 LONG Priority;
572 LONG BasePriority;
573} THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
574
575
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000576typedef enum _WINSTATIONINFOCLASS {
577 WinStationInformation = 8
578} WINSTATIONINFOCLASS;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000579
Alexandre Julliard341b7dc2002-09-17 18:54:42 +0000580typedef enum
581{
582 MemoryBasicInformation = 0
583} MEMORY_INFORMATION_CLASS;
584
Alexandre Julliardaa94a5a2003-04-12 00:10:13 +0000585/* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
586typedef enum
587{
588 INVALID_PATH = 0,
589 UNC_PATH, /* "//foo" */
590 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
591 RELATIVE_DRIVE_PATH, /* "c:foo" */
592 ABSOLUTE_PATH, /* "/foo" */
593 RELATIVE_PATH, /* "foo" */
594 DEVICE_PATH, /* "//./foo" */
595 UNC_DOT_PATH /* "//." */
596} DOS_PATHNAME_TYPE;
597
Patrik Stridvalleba96492002-09-10 00:33:34 +0000598/***********************************************************************
599 * IA64 specific types and data structures
600 */
601
602#ifdef __ia64__
603
604typedef struct _FRAME_POINTERS {
605 ULONGLONG MemoryStackFp;
606 ULONGLONG BackingStoreFp;
607} FRAME_POINTERS, *PFRAME_POINTERS;
608
609#define UNWIND_HISTORY_TABLE_SIZE 12
610
611typedef struct _RUNTIME_FUNCTION {
612 ULONG BeginAddress;
613 ULONG EndAddress;
614 ULONG UnwindInfoAddress;
615} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
616
617typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
618 ULONG64 ImageBase;
619 ULONG64 Gp;
620 PRUNTIME_FUNCTION FunctionEntry;
621} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
622
623typedef struct _UNWIND_HISTORY_TABLE {
624 ULONG Count;
625 UCHAR Search;
626 ULONG64 LowAddress;
627 ULONG64 HighAddress;
628 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
629} UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
630
631#endif /* defined(__ia64__) */
632
633/***********************************************************************
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000634 * Types and data structures
Patrik Stridvalleba96492002-09-10 00:33:34 +0000635 */
636
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000637/* This is used by NtQuerySystemInformation */
638/* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
639typedef struct {
Eric Pouech9fd54b22003-09-16 01:07:21 +0000640 FILETIME ftKernelTime;
641 FILETIME ftUserTime;
642 FILETIME ftCreateTime;
643 DWORD dwTickCount;
644 DWORD dwStartAddress;
645 DWORD dwOwningPID;
646 DWORD dwThreadID;
647 DWORD dwCurrentPriority;
648 DWORD dwBasePriority;
649 DWORD dwContextSwitches;
650 DWORD dwThreadState;
651 DWORD dwWaitReason;
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000652} THREADINFO, *PTHREADINFO;
653
654/* FIXME: Isn't THREAD_INFO and THREADINFO the same structure? */
655typedef struct _THREAD_INFO{
656 DWORD Unknown1[6];
657 DWORD ThreadID;
658 DWORD Unknown2[3];
659 DWORD Status;
660 DWORD WaitReason;
661 DWORD Unknown3[4];
662} THREAD_INFO, PTHREAD_INFO;
663
664/***********************************************************************
665 * Types and data structures
666 */
667
668typedef struct _IO_STATUS_BLOCK {
669 union {
670 NTSTATUS Status;
671 PVOID Pointer;
672 } DUMMYUNIONNAME;
673
674 ULONG_PTR Information;
675} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
676
677typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
678
679typedef struct _KEY_BASIC_INFORMATION {
680 LARGE_INTEGER LastWriteTime;
681 ULONG TitleIndex;
682 ULONG NameLength;
683 WCHAR Name[1];
684} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
685
686typedef struct _KEY_NODE_INFORMATION
687{
688 LARGE_INTEGER LastWriteTime;
689 ULONG TitleIndex;
690 ULONG ClassOffset;
691 ULONG ClassLength;
692 ULONG NameLength;
693 WCHAR Name[1];
694 /* Class[1]; */
695} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
696
697typedef struct _KEY_FULL_INFORMATION
698{
699 LARGE_INTEGER LastWriteTime;
700 ULONG TitleIndex;
701 ULONG ClassOffset;
702 ULONG ClassLength;
703 ULONG SubKeys;
704 ULONG MaxNameLen;
705 ULONG MaxClassLen;
706 ULONG Values;
707 ULONG MaxValueNameLen;
708 ULONG MaxValueDataLen;
709 WCHAR Class[1];
710} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
711
712typedef struct _KEY_VALUE_ENTRY
713{
714 PUNICODE_STRING ValueName;
715 ULONG DataLength;
716 ULONG DataOffset;
717 ULONG Type;
718} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
719
720typedef struct _KEY_VALUE_BASIC_INFORMATION {
721 ULONG TitleIndex;
722 ULONG Type;
723 ULONG NameLength;
724 WCHAR Name[1];
725} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
726
727typedef struct _KEY_VALUE_FULL_INFORMATION {
728 ULONG TitleIndex;
729 ULONG Type;
730 ULONG DataOffset;
731 ULONG DataLength;
732 ULONG NameLength;
733 WCHAR Name[1];
734} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
735
736typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
737 ULONG TitleIndex;
738 ULONG Type;
739 ULONG DataLength;
740 UCHAR Data[1];
741} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
742
743typedef struct _OBJECT_ATTRIBUTES {
744 ULONG Length;
745 HANDLE RootDirectory;
746 PUNICODE_STRING ObjectName;
747 ULONG Attributes;
748 PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
749 PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
750} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
751
Eric Pouechb3504382003-05-20 19:20:42 +0000752typedef struct _OBJECT_DATA_INFORMATION {
753 BOOLEAN InheritHandle;
754 BOOLEAN ProtectFromClose;
755} OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
756
Patrik Stridvalleba96492002-09-10 00:33:34 +0000757typedef struct _PROCESS_BASIC_INFORMATION {
Dimitrie O. Paun8b366812003-01-04 00:52:18 +0000758#ifdef __WINESRC__
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000759 DWORD ExitStatus;
760 DWORD PebBaseAddress;
761 DWORD AffinityMask;
762 DWORD BasePriority;
763 ULONG UniqueProcessId;
764 ULONG InheritedFromUniqueProcessId;
765#else
Patrik Stridvalleba96492002-09-10 00:33:34 +0000766 PVOID Reserved1;
767 PPEB PebBaseAddress;
768 PVOID Reserved2[2];
769 ULONG_PTR UniqueProcessId;
770 PVOID Reserved3;
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000771#endif
Patrik Stridvalleba96492002-09-10 00:33:34 +0000772} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
773
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000774typedef struct _PROCESS_INFO {
775 DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
776 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
777 DWORD Unknown1[6];
778 FILETIME CreationTime; /* 20 */
779 DWORD Unknown2[5];
780 PWCHAR ProcessName; /* 3c ok */
781 DWORD BasePriority;
782 DWORD ProcessID; /* 44 ok*/
783 DWORD ParentProcessID;
784 DWORD HandleCount;
785 DWORD Unknown3[2]; /* 50 */
786 ULONG PeakVirtualSize;
787 ULONG VirtualSize;
788 ULONG PageFaultCount;
789 ULONG PeakWorkingSetSize;
790 ULONG WorkingSetSize;
791 ULONG QuotaPeakPagedPoolUsage;
792 ULONG QuotaPagedPoolUsage;
793 ULONG QuotaPeakNonPagedPoolUsage;
794 ULONG QuotaNonPagedPoolUsage;
795 ULONG PagefileUsage;
796 ULONG PeakPagefileUsage;
797 DWORD PrivateBytes;
798 DWORD Unknown6[4];
799 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
800} PROCESS_INFO, PPROCESS_INFO;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000801
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000802typedef struct _RTL_HEAP_DEFINITION {
803 ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
Patrik Stridvalleba96492002-09-10 00:33:34 +0000804
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000805 ULONG Unknown[11];
806} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000807
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000808typedef struct _RTL_RWLOCK {
809 RTL_CRITICAL_SECTION rtlCS;
810
811 HANDLE hSharedReleaseSemaphore;
812 UINT uSharedWaiters;
813
814 HANDLE hExclusiveReleaseSemaphore;
815 UINT uExclusiveWaiters;
816
817 INT iNumberActive;
818 HANDLE hOwningThreadId;
819 DWORD dwTimeoutBoost;
820 PVOID pDebugInfo;
821} RTL_RWLOCK, *LPRTL_RWLOCK;
822
823/* System Information Class 0x00 */
Patrik Stridvalleba96492002-09-10 00:33:34 +0000824typedef struct _SYSTEM_BASIC_INFORMATION {
Dimitrie O. Paun8b366812003-01-04 00:52:18 +0000825#ifdef __WINESRC__
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000826 DWORD dwUnknown1;
827 ULONG uKeMaximumIncrement;
828 ULONG uPageSize;
829 ULONG uMmNumberOfPhysicalPages;
830 ULONG uMmLowestPhysicalPage;
831 ULONG uMmHighestPhysicalPage;
832 ULONG uAllocationGranularity;
833 PVOID pLowestUserAddress;
834 PVOID pMmHighestUserAddress;
835 ULONG uKeActiveProcessors;
836 BYTE bKeNumberProcessors;
837 BYTE bUnknown2;
838 WORD wUnknown3;
839#else
Patrik Stridvalleba96492002-09-10 00:33:34 +0000840 BYTE Reserved1[24];
841 PVOID Reserved2[4];
842 CCHAR NumberOfProcessors;
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000843#endif
Patrik Stridvalleba96492002-09-10 00:33:34 +0000844} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
845
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000846/* System Information Class 0x15 */
847typedef struct {
848 ULONG CurrentSize;
849 ULONG PeakSize;
850 ULONG PageFaultCount;
851 ULONG MinimumWorkingSet;
852 ULONG MaximumWorkingSet;
853 ULONG unused[4];
854} SYSTEM_CACHE_INFORMATION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000855
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000856typedef struct _SYSTEM_CONFIGURATION_INFO {
857 union {
858 ULONG OemId;
859 struct {
860 WORD ProcessorArchitecture;
861 WORD Reserved;
862 } tag1;
863 } tag2;
864 ULONG PageSize;
865 PVOID MinimumApplicationAddress;
866 PVOID MaximumApplicationAddress;
867 ULONG ActiveProcessorMask;
868 ULONG NumberOfProcessors;
869 ULONG ProcessorType;
870 ULONG AllocationGranularity;
871 WORD ProcessorLevel;
872 WORD ProcessorRevision;
873} SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
874
875/* System Information Class 0x0b */
876typedef struct {
877 PVOID pvAddress;
878 DWORD dwUnknown1;
879 DWORD dwUnknown2;
880 DWORD dwEntryIndex;
881 DWORD dwUnknown3;
882 char szName[MAX_PATH + 1];
883} SYSTEM_DRIVER_INFORMATION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000884
885typedef struct _SYSTEM_EXCEPTION_INFORMATION {
886 BYTE Reserved1[16];
887} SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
888
889typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
890 BYTE Reserved1[32];
891} SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
892
893typedef struct _SYSTEM_INTERRUPT_INFORMATION {
894 BYTE Reserved1[24];
895} SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
896
Mike McCormacke79ff702004-04-21 22:21:35 +0000897typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
898 BOOLEAN DebuggerEnabled;
899 BOOLEAN DebuggerNotPresent;
900} SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
901
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000902/* System Information Class 0x10 */
903typedef struct {
904 USHORT dwPID;
905 USHORT dwCreatorBackTraceIndex;
906 BYTE bObjectType;
907 BYTE bHandleAttributes;
908 USHORT usHandleOffset;
909 DWORD dwKeObject;
910 ULONG ulGrantedAccess;
911} HANDLEINFO, *PHANDLEINFO; /* FIXME: SYSTEM_HANDLE_INFORMATION? */
Patrik Stridvalleba96492002-09-10 00:33:34 +0000912
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000913typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
914 BYTE Reserved1[312];
915} SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000916
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000917/* System Information Class 0x02 */
918typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
Dimitrie O. Paun8b366812003-01-04 00:52:18 +0000919#ifdef __WINESRC__
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000920 LARGE_INTEGER liIdleTime;
Eric Pouech9fd54b22003-09-16 01:07:21 +0000921 DWORD dwSpare[10];
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000922#else
923 LARGE_INTEGER IdleTime;
924 LARGE_INTEGER KernelTime;
925 LARGE_INTEGER UserTime;
926 LARGE_INTEGER Reserved1[2];
927 ULONG Reserved2;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000928#endif
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000929} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000930
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000931/* System Information Class 0x05 */
932typedef struct _SYSTEM_PROCESS_INFORMATION {
Dimitrie O. Paun8b366812003-01-04 00:52:18 +0000933#ifdef __WINESRC__
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000934 DWORD dwOffset;
935 DWORD dwThreadCount;
936 DWORD dwUnknown1[6];
937 FILETIME ftCreationTime;
938 DWORD dwUnknown2[5];
939 WCHAR *pszProcessName;
940 DWORD dwBasePriority;
941 DWORD dwProcessID;
942 DWORD dwParentProcessID;
943 DWORD dwHandleCount;
944 DWORD dwUnknown3;
945 DWORD dwUnknown4;
946 DWORD dwVirtualBytesPeak;
947 DWORD dwVirtualBytes;
948 DWORD dwPageFaults;
949 DWORD dwWorkingSetPeak;
950 DWORD dwWorkingSet;
951 DWORD dwUnknown5;
952 DWORD dwPagedPool;
953 DWORD dwUnknown6;
954 DWORD dwNonPagedPool;
955 DWORD dwPageFileBytesPeak;
956 DWORD dwPrivateBytes;
957 DWORD dwPageFileBytes;
958 DWORD dwUnknown7[4];
959 THREADINFO ti[1];
960#else
961 ULONG NextEntryOffset;
962 BYTE Reserved1[52];
963 PVOID Reserved2[3];
964 HANDLE UniqueProcessId;
965 PVOID Reserved3;
966 ULONG HandleCount;
967 BYTE Reserved4[4];
968 PVOID Reserved5[11];
969 SIZE_T PeakPagefileUsage;
970 SIZE_T PrivatePageCount;
971 LARGE_INTEGER Reserved6[6];
972#endif
973} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000974
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000975typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
976 ULONG RegistryQuotaAllowed;
977 ULONG RegistryQuotaUsed;
978 PVOID Reserved1;
979} SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
Patrik Stridvalleba96492002-09-10 00:33:34 +0000980
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000981typedef struct _SYSTEM_TIME_ADJUSTMENT {
982 ULONG TimeAdjustment;
983 BOOLEAN TimeAdjustmentDisabled;
984} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
985
986/* System Information Class 0x03 */
987typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
Dimitrie O. Paun8b366812003-01-04 00:52:18 +0000988#ifdef __WINESRC__
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +0000989 LARGE_INTEGER liKeBootTime;
990 LARGE_INTEGER liKeSystemTime;
991 LARGE_INTEGER liExpTimeZoneBias;
992 ULONG uCurrentTimeZoneId;
993 DWORD dwReserved;
994#else
995 BYTE Reserved1[48];
996#endif
997} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
998
999typedef struct _TIME_FIELDS
1000{ CSHORT Year;
1001 CSHORT Month;
1002 CSHORT Day;
1003 CSHORT Hour;
1004 CSHORT Minute;
1005 CSHORT Second;
1006 CSHORT Milliseconds;
1007 CSHORT Weekday;
1008} TIME_FIELDS, *PTIME_FIELDS;
Patrik Stridvalleba96492002-09-10 00:33:34 +00001009
1010typedef struct _WINSTATIONINFORMATIONW {
1011 BYTE Reserved2[70];
1012 ULONG LogonId;
1013 BYTE Reserved3[1140];
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001014} WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
1015
1016typedef struct _VM_COUNTERS_ {
1017 ULONG PeakVirtualSize;
1018 ULONG VirtualSize;
1019 ULONG PageFaultCount;
1020 ULONG PeakWorkingSetSize;
1021 ULONG WorkingSetSize;
1022 ULONG QuotaPeakPagedPoolUsage;
1023 ULONG QuotaPagedPoolUsage;
1024 ULONG QuotaPeakNonPagedPoolUsage;
1025 ULONG QuotaNonPagedPoolUsage;
1026 ULONG PagefileUsage;
1027 ULONG PeakPagefileUsage;
1028} VM_COUNTERS, *PVM_COUNTERS;
Patrik Stridvalleba96492002-09-10 00:33:34 +00001029
1030typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
1031
Alexandre Julliard86666c52003-04-29 23:00:48 +00001032typedef struct _LDR_RESOURCE_INFO
1033{
1034 ULONG Type;
1035 ULONG Name;
1036 ULONG Language;
1037} LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
1038
Raphael Junqueiraca6b0722004-03-18 02:08:43 +00001039
1040/* debug buffer definitions */
1041
1042typedef struct _DEBUG_BUFFER {
1043 HANDLE SectionHandle;
1044 PVOID SectionBase;
1045 PVOID RemoteSectionBase;
1046 ULONG SectionBaseDelta;
1047 HANDLE EventPairHandle;
1048 ULONG Unknown[2];
1049 HANDLE RemoteThreadHandle;
1050 ULONG InfoClassMask;
1051 ULONG SizeOfInfo;
1052 ULONG AllocatedSize;
1053 ULONG SectionSize;
1054 PVOID ModuleInformation;
1055 PVOID BackTraceInformation;
1056 PVOID HeapInformation;
1057 PVOID LockInformation;
1058 PVOID Reserved[8];
1059} DEBUG_BUFFER, *PDEBUG_BUFFER;
1060
1061#define PDI_MODULES 0x01
1062#define PDI_BACKTRACE 0x02
1063#define PDI_HEAPS 0x04
1064#define PDI_HEAP_TAGS 0x08
1065#define PDI_HEAP_BLOCKS 0x10
1066#define PDI_LOCKS 0x20
1067
1068typedef struct _DEBUG_MODULE_INFORMATION {
1069 ULONG Reserved[2];
1070 ULONG Base;
1071 ULONG Size;
1072 ULONG Flags;
1073 USHORT Index;
1074 USHORT Unknown;
1075 USHORT LoadCount;
1076 USHORT ModuleNameOffset;
1077 CHAR ImageName[256];
1078} DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
1079
1080typedef struct _DEBUG_HEAP_INFORMATION {
1081 ULONG Base;
1082 ULONG Flags;
1083 USHORT Granularity;
1084 USHORT Unknown;
1085 ULONG Allocated;
1086 ULONG Committed;
1087 ULONG TagCount;
1088 ULONG BlockCount;
1089 ULONG Reserved[7];
1090 PVOID Tags;
1091 PVOID Blocks;
1092} DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
1093
1094typedef struct _DEBUG_LOCK_INFORMATION {
1095 PVOID Address;
1096 USHORT Type;
1097 USHORT CreatorBackTraceIndex;
1098 ULONG OwnerThreadId;
1099 ULONG ActiveCount;
1100 ULONG ContentionCount;
1101 ULONG EntryCount;
1102 ULONG RecursionCount;
1103 ULONG NumberOfSharedWaiters;
1104 ULONG NumberOfExclusiveWaiters;
1105} DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
1106
Raphael Junqueira43b9f972004-04-07 19:05:34 +00001107typedef struct _PORT_MESSAGE_HEADER {
1108 USHORT DataSize;
1109 USHORT MessageSize;
1110 USHORT MessageType;
1111 USHORT VirtualRangesOffset;
1112 CLIENT_ID ClientId;
1113 ULONG MessageId;
1114 ULONG SectionSize;
1115} PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
Raphael Junqueiraca6b0722004-03-18 02:08:43 +00001116
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001117/***********************************************************************
1118 * Defines
1119 */
1120
1121/* flags for NtCreateFile and NtOpenFile */
Alexandre Julliard014099c2004-03-12 01:56:49 +00001122#define FILE_DIRECTORY_FILE 0x00000001
1123#define FILE_WRITE_THROUGH 0x00000002
1124#define FILE_SEQUENTIAL_ONLY 0x00000004
1125#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
1126#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
1127#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
1128#define FILE_NON_DIRECTORY_FILE 0x00000040
1129#define FILE_CREATE_TREE_CONNECTION 0x00000080
1130#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
1131#define FILE_NO_EA_KNOWLEDGE 0x00000200
1132#define FILE_OPEN_FOR_RECOVERY 0x00000400
1133#define FILE_RANDOM_ACCESS 0x00000800
1134#define FILE_DELETE_ON_CLOSE 0x00001000
1135#define FILE_OPEN_BY_FILE_ID 0x00002000
1136#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
1137#define FILE_NO_COMPRESSION 0x00008000
1138#define FILE_RESERVE_OPFILTER 0x00100000
1139#define FILE_TRANSACTED_MODE 0x00200000
1140#define FILE_OPEN_OFFLINE_FILE 0x00400000
1141
1142#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
1143#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001144
1145/* status for NtCreateFile or NtOpenFile */
Alexandre Julliard014099c2004-03-12 01:56:49 +00001146#define FILE_SUPERSEDED 0
1147#define FILE_OPENED 1
1148#define FILE_CREATED 2
1149#define FILE_OVERWRITTEN 3
1150#define FILE_EXISTS 4
1151#define FILE_DOES_NOT_EXIST 5
1152
1153/* disposition for NtCreateFile */
1154#define FILE_SUPERSEDE 0
1155#define FILE_OPEN 1
1156#define FILE_CREATE 2
1157#define FILE_OPEN_IF 3
1158#define FILE_OVERWRITE 4
1159#define FILE_OVERWRITE_IF 5
1160#define FILE_MAXIMUM_DISPOSITION 5
1161
1162/* Characteristics of a File System */
1163#define FILE_REMOVABLE_MEDIA 0x00000001
1164#define FILE_READ_ONLY_DEVICE 0x00000002
1165#define FILE_FLOPPY_DISKETTE 0x00000004
1166#define FILE_WRITE_ONE_MEDIA 0x00000008
1167#define FILE_REMOTE_DEVICE 0x00000010
1168#define FILE_DEVICE_IS_MOUNTED 0x00000020
1169#define FILE_VIRTUAL_VOLUME 0x00000040
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001170
1171#if (_WIN32_WINNT >= 0x0501)
1172#define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
1173#endif /* (_WIN32_WINNT >= 0x0501) */
1174
1175#define LOGONID_CURRENT ((ULONG)-1)
1176
1177#define OBJ_INHERIT 0x00000002L
1178#define OBJ_PERMANENT 0x00000010L
1179#define OBJ_EXCLUSIVE 0x00000020L
1180#define OBJ_CASE_INSENSITIVE 0x00000040L
1181#define OBJ_OPENIF 0x00000080L
1182#define OBJ_OPENLINK 0x00000100L
1183#define OBJ_KERNEL_HANDLE 0x00000200L
1184#define OBJ_VALID_ATTRIBUTES 0x000003F2L
1185
1186#define SERVERNAME_CURRENT ((HANDLE)NULL)
1187
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001188typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
Alexandre Julliard7370f602003-10-31 00:16:20 +00001189typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001190
Raphael Junqueira43b9f972004-04-07 19:05:34 +00001191
1192/* DbgPrintEx default levels */
1193#define DPFLTR_ERROR_LEVEL 0
1194#define DPFLTR_WARNING_LEVEL 1
1195#define DPFLTR_TRACE_LEVEL 2
1196#define DPFLTR_INFO_LEVEL 3
1197#define DPFLTR_MASK 0x8000000
1198
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001199/***********************************************************************
1200 * Function declarations
1201 */
1202
1203extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
1204extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
1205
1206#if defined(__i386__) && defined(__GNUC__)
1207static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1208static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1209#else /* __i386__ && __GNUC__ */
1210void WINAPI DbgBreakPoint(void);
1211void WINAPI DbgUserBreakPoint(void);
1212#endif /* __i386__ && __GNUC__ */
Raphael Junqueira43b9f972004-04-07 19:05:34 +00001213NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
1214NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001215
Alexandre Julliard86666c52003-04-29 23:00:48 +00001216NTSTATUS WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
Alexandre Julliardce4d1112003-05-07 03:21:26 +00001217NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
Alexandre Julliard86666c52003-04-29 23:00:48 +00001218NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
Alexandre Julliardf80b8692003-09-29 20:42:24 +00001219NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
1220NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
Alexandre Julliardf19c9e72004-02-07 01:11:54 +00001221void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
Alexandre Julliardf80b8692003-09-29 20:42:24 +00001222NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
Alexandre Julliardd9bab572003-05-08 04:13:26 +00001223void WINAPI LdrShutdownProcess(void);
1224void WINAPI LdrShutdownThread(void);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001225NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,PBOOLEAN);
1226NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001227NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,PVOID,ULONG*,ULONG,ULONG);
Eric Pouech4c591d42003-05-20 04:00:42 +00001228NTSTATUS WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001229NTSTATUS WINAPI NtClearEvent(HANDLE);
1230NTSTATUS WINAPI NtClose(HANDLE);
1231NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1232NTSTATUS WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
Mike McCormackf8e28732004-08-20 19:24:33 +00001233NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001234NTSTATUS WINAPI NtCreateKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
Mike McCormack278f7432004-08-16 21:08:38 +00001235NTSTATUS WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001236NTSTATUS WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001237NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
Eric Pouech4c591d42003-05-20 04:00:42 +00001238NTSTATUS WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
Alexandre Julliard217fdab2003-06-30 21:00:15 +00001239NTSTATUS WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001240NTSTATUS WINAPI NtDeleteKey(HKEY);
1241NTSTATUS WINAPI NtDeleteValueKey(HKEY,const UNICODE_STRING *);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001242NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
Alexandre Julliardac7b9d32002-09-16 19:32:50 +00001243NTSTATUS WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001244NTSTATUS WINAPI NtEnumerateKey(HKEY,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1245NTSTATUS WINAPI NtEnumerateValueKey(HKEY,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
Eric Pouechb6338872003-04-22 04:04:17 +00001246NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
Mike McCormacke3d88532004-08-04 18:15:04 +00001247NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,ULONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001248NTSTATUS WINAPI NtFlushKey(HKEY);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001249NTSTATUS WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,ULONG*,ULONG);
1250NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001251NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*);
Raphael Junqueira43b9f972004-04-07 19:05:34 +00001252NTSTATUS WINAPI NtImpersonateAnonymousToken(HANDLE);
1253NTSTATUS WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
1254NTSTATUS WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001255NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,const OBJECT_ATTRIBUTES *);
Eric Pouechf6a70962003-06-24 02:32:01 +00001256NTSTATUS WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001257NTSTATUS WINAPI NtLockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1258NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,ULONG,const LARGE_INTEGER*,ULONG*,SECTION_INHERIT,ULONG,ULONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001259NTSTATUS WINAPI NtNotifyChangeKey(HKEY,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001260NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
1261NTSTATUS WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
Mike McCormackf8e28732004-08-20 19:24:33 +00001262NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001263NTSTATUS WINAPI NtOpenKey(PHKEY,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001264NTSTATUS WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001265NTSTATUS WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001266NTSTATUS WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001267NTSTATUS WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
Eric Pouech4c591d42003-05-20 04:00:42 +00001268NTSTATUS WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001269NTSTATUS WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG,ULONG*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001270NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001271NTSTATUS WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
Alexandre Julliard174e2a62004-04-20 00:36:29 +00001272NTSTATUS WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
Alexandre Julliard86666c52003-04-29 23:00:48 +00001273NTSTATUS WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
Alexandre Julliard81b22372004-07-30 01:45:16 +00001274NTSTATUS WINAPI NtQueryDefaultUILanguage(LANGID*);
Alexandre Julliardf30cfa82004-03-16 01:32:02 +00001275NTSTATUS WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
Mike McCormackf8e28732004-08-20 19:24:33 +00001276NTSTATUS WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PVOID,BOOLEAN);
Alexandre Julliarde4409322004-04-20 04:06:49 +00001277NTSTATUS WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
Eric Pouechf6a70962003-06-24 02:32:01 +00001278NTSTATUS WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001279NTSTATUS WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
1280NTSTATUS WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
1281NTSTATUS WINAPI NtQueryInformationToken(HANDLE,DWORD,LPVOID,DWORD,LPDWORD);
Alexandre Julliard81b22372004-07-30 01:45:16 +00001282NTSTATUS WINAPI NtQueryInstallUILanguage(LANGID*);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001283NTSTATUS WINAPI NtQueryKey(HKEY,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
1284NTSTATUS WINAPI NtQueryMultipleValueKey(HKEY,PVALENTW,ULONG,PVOID,ULONG,PULONG);
Eric Pouechb3504382003-05-20 19:20:42 +00001285NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001286NTSTATUS WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
1287NTSTATUS WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
1288NTSTATUS WINAPI NtQuerySystemTime(PLARGE_INTEGER);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001289NTSTATUS WINAPI NtQueryValueKey(HKEY,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001290NTSTATUS WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
Alexandre Julliard670711e2004-04-06 23:13:47 +00001291NTSTATUS WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001292void WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
1293NTSTATUS WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
Alexandre Julliard4f4b9802003-07-08 21:18:45 +00001294NTSTATUS WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001295NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
Mike McCormackf8e28732004-08-20 19:24:33 +00001296NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG,PULONG,PIO_STATUS_BLOCK,PLARGE_INTEGER);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001297NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HKEY,POBJECT_ATTRIBUTES);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001298NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001299NTSTATUS WINAPI NtRestoreKey(HKEY,HANDLE,ULONG);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001300NTSTATUS WINAPI NtResumeThread(HANDLE,PULONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001301NTSTATUS WINAPI NtSaveKey(HKEY,HANDLE);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001302NTSTATUS WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
Alexandre Julliard86666c52003-04-29 23:00:48 +00001303NTSTATUS WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
Alexandre Julliard81b22372004-07-30 01:45:16 +00001304NTSTATUS WINAPI NtSetDefaultUILanguage(LANGID);
Mike McCormackf8e28732004-08-20 19:24:33 +00001305NTSTATUS WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001306NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
Eric Pouechf6a70962003-06-24 02:32:01 +00001307NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001308NTSTATUS WINAPI NtSetInformationKey(HKEY,const int,PVOID,ULONG);
Eric Pouechb3504382003-05-20 19:20:42 +00001309NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
Alexandre Julliard2eb5d8b2003-09-08 19:02:01 +00001310NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
Mike McCormackb255c112004-08-17 22:09:55 +00001311NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
Mike McCormackf8e28732004-08-20 19:24:33 +00001312NTSTATUS WINAPI NtSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001313NTSTATUS WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
György 'Nog' Jeney6f3015b2002-11-25 01:12:39 +00001314NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
Eric Pouech4c591d42003-05-20 04:00:42 +00001315NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMERAPCROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001316NTSTATUS WINAPI NtSetValueKey(HKEY,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
Alexandre Julliard088bcf92003-04-04 22:26:34 +00001317NTSTATUS WINAPI NtSuspendThread(HANDLE,PULONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001318NTSTATUS WINAPI NtTerminateProcess(HANDLE,LONG);
1319NTSTATUS WINAPI NtTerminateThread(HANDLE,LONG);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001320NTSTATUS WINAPI NtUnloadKey(HKEY);
Eric Pouechf6a70962003-06-24 02:32:01 +00001321NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
Alexandre Julliard341b7dc2002-09-17 18:54:42 +00001322NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,ULONG*,ULONG);
1323NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
Alexandre Julliard217fdab2003-06-30 21:00:15 +00001324NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
1325NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
Eric Pouech9bd4f6b2003-06-26 02:08:17 +00001326NTSTATUS WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
Alexandre Julliard4f4b9802003-07-08 21:18:45 +00001327NTSTATUS WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001328
1329void WINAPI RtlAcquirePebLock(void);
1330BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
1331BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
1332NTSTATUS WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
Robert Shearmanf0025e22003-05-01 00:29:26 +00001333NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
736ff982003-06-16 19:44:06 +00001334NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
Robert Shearmanf0025e22003-05-01 00:29:26 +00001335NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
736ff982003-06-16 19:44:06 +00001336NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
Alexandre Julliard54b1d872003-10-28 21:22:50 +00001337PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001338DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
1339BOOLEAN WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
1340PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
1341DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
1342NTSTATUS WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
1343NTSTATUS WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
1344NTSTATUS WINAPI RtlAppendStringToString(STRING *,const STRING *);
1345NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
1346NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
Thomas Mertes0ce48262003-04-08 00:55:36 +00001347BOOLEAN WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
1348BOOLEAN WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001349BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
1350BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
1351
1352NTSTATUS WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
1353void WINAPI RtlClearAllBits(PRTL_BITMAP);
1354void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
1355ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
1356LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
1357LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
Jon Griffithsccf2f612003-03-18 20:12:07 +00001358DWORD WINAPI RtlComputeCrc32(DWORD,PBYTE,INT);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001359NTSTATUS WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
1360LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG);
1361ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
Thomas Mertes0ce48262003-04-08 00:55:36 +00001362void WINAPI RtlCopyLuid(PLUID,const LUID*);
1363void WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001364DWORD WINAPI RtlCopySid(DWORD,PSID,PSID);
1365void WINAPI RtlCopyString(STRING*,const STRING*);
1366void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
1367NTSTATUS WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
Eric Pouech2d758c62003-05-08 03:47:00 +00001368NTSTATUS WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001369HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
Alexandre Julliard5e3549b2003-10-04 03:11:57 +00001370NTSTATUS WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,
1371 const UNICODE_STRING*,const UNICODE_STRING*,
1372 const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,
1373 const UNICODE_STRING*,const UNICODE_STRING*,
1374 const UNICODE_STRING*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001375NTSTATUS WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
1376BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
1377BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
Alexandre Julliard7370f602003-10-31 00:16:20 +00001378NTSTATUS WINAPI RtlCreateUserThread(HANDLE,const SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001379
Ulrich Czekallafd5e8112003-11-11 22:03:24 +00001380NTSTATUS WINAPI RtlDeleteAce(PACL,DWORD);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001381NTSTATUS WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
1382void WINAPI RtlDeleteResource(LPRTL_RWLOCK);
1383DWORD WINAPI RtlDeleteSecurityObject(DWORD);
Alexandre Julliard5e3549b2003-10-04 03:11:57 +00001384PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
Eric Pouech2d758c62003-05-08 03:47:00 +00001385NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001386HANDLE WINAPI RtlDestroyHeap(HANDLE);
Alexandre Julliard5e3549b2003-10-04 03:11:57 +00001387void WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
Alexandre Julliardaa94a5a2003-04-12 00:10:13 +00001388DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
Eric Pouech2e5cdf92003-06-16 01:24:30 +00001389BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR);
Alexandre Julliard27b1cf92004-04-05 20:21:16 +00001390BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
Eric Pouech2e5cdf92003-06-16 01:24:30 +00001391ULONG WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
Jon Griffithsccf2f612003-03-18 20:12:07 +00001392WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
Thomas Mertesc83aa0d2003-03-22 00:20:58 +00001393NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001394void WINAPI RtlDumpResource(LPRTL_RWLOCK);
Thomas Mertesd628d122003-05-06 18:27:40 +00001395NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001396
1397LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
1398ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
1399UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
1400NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
1401void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
Jon Griffithsccf2f612003-03-18 20:12:07 +00001402NTSTATUS WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
1403NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
Thomas Mertes0ce48262003-04-08 00:55:36 +00001404BOOLEAN WINAPI RtlEqualLuid(const LUID*,const LUID*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001405BOOL WINAPI RtlEqualPrefixSid(PSID,PSID);
1406BOOL WINAPI RtlEqualSid(PSID,PSID);
1407BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
1408BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
Eric Pouechb124fa92003-05-13 04:45:50 +00001409NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001410LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
1411LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
1412LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
1413
Thomas Mertesd628d122003-05-06 18:27:40 +00001414NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001415ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
1416ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
1417ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1418ULONG WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1419ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1420CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG);
1421ULONG WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
1422ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
Alexandre Julliard86666c52003-04-29 23:00:48 +00001423NTSTATUS WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001424CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG);
1425ULONG WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
1426ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
1427ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
1428ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
1429ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
1430BOOLEAN WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
1431NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
Robert Shearmane2490a02004-04-20 01:07:23 +00001432NTSTATUS WINAPI RtlFormatMessage(LPWSTR,UCHAR,BOOLEAN,BOOLEAN,BOOLEAN,va_list *,LPWSTR,ULONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001433void WINAPI RtlFreeAnsiString(PANSI_STRING);
1434BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
1435void WINAPI RtlFreeOemString(POEM_STRING);
1436DWORD WINAPI RtlFreeSid(PSID);
1437void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
1438
1439DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001440NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
Eric Pouech35d5d062003-05-15 04:20:42 +00001441NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
Alexandre Julliardaa94a5a2003-04-12 00:10:13 +00001442NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
1443ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001444NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
Jon Griffiths31c50cc2003-12-10 00:35:44 +00001445DWORD WINAPI RtlGetLastWin32Error(void);
Eric Pouech35d5d062003-05-15 04:20:42 +00001446DWORD WINAPI RtlGetLongestNtPathLength(void);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001447BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
1448NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
1449ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
1450NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
Alexandre Julliard240b0a92003-09-24 05:26:00 +00001451NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001452
1453PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
1454PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
1455PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
1456PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
1457PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
1458BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1459void WINAPI RtlInitString(PSTRING,PCSZ);
1460void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
1461void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
Thomas Mertesd628d122003-05-06 18:27:40 +00001462NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001463NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
1464NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
1465void WINAPI RtlInitializeBitMap(PRTL_BITMAP,LPBYTE,ULONG);
1466void WINAPI RtlInitializeResource(LPRTL_RWLOCK);
1467BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
1468
Thomas Mertesf4757bb2003-02-19 03:39:46 +00001469NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
1470NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
1471NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
Alexandre Julliardaa94a5a2003-04-12 00:10:13 +00001472ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
Alexandre Julliardd6da1f32003-04-16 23:15:29 +00001473BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001474DWORD WINAPI RtlIsTextUnicode(LPVOID,DWORD,DWORD *);
1475
1476LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
1477LONGLONG WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
1478ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
1479LONGLONG WINAPI RtlLargeIntegerNegate(LONGLONG);
1480LONGLONG WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
1481LONGLONG WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
1482LONGLONG WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
Thomas Mertesf4757bb2003-02-19 03:39:46 +00001483NTSTATUS WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001484NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
1485DWORD WINAPI RtlLengthRequiredSid(DWORD);
1486ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
1487DWORD WINAPI RtlLengthSid(PSID);
György 'Nog' Jeney4d6ba252002-12-11 00:19:56 +00001488NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001489BOOLEAN WINAPI RtlLockHeap(HANDLE);
1490
1491NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
Thomas Mertes0ce48262003-04-08 00:55:36 +00001492void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001493NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
1494NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
1495
1496DWORD WINAPI RtlNewSecurityObject(DWORD,DWORD,DWORD,DWORD,DWORD,DWORD);
Alexandre Julliard5e3549b2003-10-04 03:11:57 +00001497PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001498ULONG WINAPI RtlNtStatusToDosError(NTSTATUS);
Jon Griffiths31c50cc2003-12-10 00:35:44 +00001499ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001500ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
1501ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
1502
1503UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
1504NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
1505NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
Alexandre Julliard9b5c3f92002-10-25 19:14:29 +00001506DWORD WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHKEY);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001507
1508BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
1509BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
1510
Eric Pouech2d758c62003-05-08 03:47:00 +00001511NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
Ulrich Czekallafd5e8112003-11-11 22:03:24 +00001512NTSTATUS WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
György 'Nog' Jeney6f3015b2002-11-25 01:12:39 +00001513NTSTATUS WINAPI RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION);
Thomas Mertes0ce48262003-04-08 00:55:36 +00001514
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001515void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
1516void WINAPI RtlRaiseStatus(NTSTATUS);
Thomas Mertes0ce48262003-04-08 00:55:36 +00001517ULONG WINAPI RtlRandom(PULONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001518PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
1519void WINAPI RtlReleasePebLock(void);
1520void WINAPI RtlReleaseResource(LPRTL_RWLOCK);
Alexandre Julliard54b1d872003-10-28 21:22:50 +00001521ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
Jon Griffithsae0ca562003-12-12 05:56:44 +00001522void WINAPI RtlRestoreLastWin32Error(DWORD);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001523
1524void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
1525void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
Ulrich Czekallafd5e8112003-11-11 22:03:24 +00001526NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,
1527 PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001528void WINAPI RtlSetAllBits(PRTL_BITMAP);
1529void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
Alexandre Julliardcc461322004-06-15 00:52:03 +00001530ULONG WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
Eric Pouech35d5d062003-05-15 04:20:42 +00001531NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
Eric Pouech2d758c62003-05-08 03:47:00 +00001532void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001533NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
Eric Pouech2d758c62003-05-08 03:47:00 +00001534NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001535NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
1536NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
Jon Griffithsae0ca562003-12-12 05:56:44 +00001537void WINAPI RtlSetLastWin32Error(DWORD);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001538NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
György 'Nog' Jeney6f3015b2002-11-25 01:12:39 +00001539NTSTATUS WINAPI RtlSetTimeZoneInformation(const TIME_ZONE_INFORMATION*);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001540ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
1541LPDWORD WINAPI RtlSubAuthoritySid(PSID,DWORD);
1542LPBYTE WINAPI RtlSubAuthorityCountSid(PSID);
György 'Nog' Jeney4d6ba252002-12-11 00:19:56 +00001543NTSTATUS WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001544
György 'Nog' Jeney6f3015b2002-11-25 01:12:39 +00001545void WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001546BOOLEAN WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
Alexandre Julliarda16ed902002-12-18 02:31:33 +00001547void WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
Jon Griffiths08922852003-08-19 00:56:34 +00001548BOOLEAN WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001549BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
1550BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
1551
Alexandre Julliard6da4c272003-03-19 00:09:57 +00001552ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001553DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
1554NTSTATUS WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
Thomas Mertesf4757bb2003-02-19 03:39:46 +00001555NTSTATUS WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001556DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
1557NTSTATUS WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
1558NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1559NTSTATUS WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
1560NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1561ULONG WINAPI RtlUniform(PULONG);
1562BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
1563void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
1564#ifdef __ia64__
1565void WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
1566void WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
1567#endif
Thomas Mertesf4757bb2003-02-19 03:39:46 +00001568WCHAR WINAPI RtlUpcaseUnicodeChar(WCHAR);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001569NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
1570NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
Alexandre Julliardd6da1f32003-04-16 23:15:29 +00001571NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001572NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
1573NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
1574NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
Thomas Mertesf4757bb2003-02-19 03:39:46 +00001575CHAR WINAPI RtlUpperChar(CHAR);
1576void WINAPI RtlUpperString(STRING *,const STRING *);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001577
1578NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
Robert Shearmanf0025e22003-05-01 00:29:26 +00001579BOOLEAN WINAPI RtlValidAcl(PACL);
1580BOOLEAN WINAPI RtlValidSid(PSID);
Francois Gougetbba4bb12002-09-17 01:35:09 +00001581BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
Alexandre Julliard240b0a92003-09-24 05:26:00 +00001582NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001583
1584NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
1585
1586NTSTATUS WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
1587NTSTATUS WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
1588
Alexandre Julliard9db147e2004-04-23 02:46:18 +00001589/* Wine internal functions */
1590
1591extern NTSTATUS wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRING *unix_name_ret,
Alexandre Julliardcf678392004-04-27 02:15:52 +00001592 UINT disposition, BOOLEAN check_case );
Alexandre Julliard9db147e2004-04-23 02:46:18 +00001593
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +00001594/***********************************************************************
1595 * Inline functions
1596 */
1597
1598#define InitializeObjectAttributes(p,n,a,r,s) \
1599 do { \
1600 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
1601 (p)->RootDirectory = r; \
1602 (p)->Attributes = a; \
1603 (p)->ObjectName = n; \
1604 (p)->SecurityDescriptor = s; \
1605 (p)->SecurityQualityOfService = NULL; \
1606 } while (0)
1607
1608#define NtCurrentProcess() ((HANDLE)-1)
1609
1610#define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
1611#define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
1612#define RtlStoreUlong(p,v) do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1613#define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
1614#define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
1615#define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
1616#define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
1617
1618inline static BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
1619{
1620 if (lpBits && ulBit < lpBits->SizeOfBitMap &&
1621 lpBits->BitMapBuffer[ulBit >> 3] & (1 << (ulBit & 7)))
1622 return TRUE;
1623 return FALSE;
1624}
1625
1626#define RtlClearAllBits(p) \
1627 do { \
1628 PRTL_BITMAP _p = (p); \
1629 memset(_p->BitMapBuffer,0,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1630 } while (0)
1631
1632#define RtlInitializeBitMap(p,b,s) \
1633 do { \
1634 PRTL_BITMAP _p = (p); \
1635 _p->SizeOfBitMap = (s); \
1636 _p->BitMapBuffer = (b); \
1637 } while (0)
1638
1639#define RtlSetAllBits(p) \
1640 do { \
1641 PRTL_BITMAP _p = (p); \
1642 memset(_p->BitMapBuffer,0xff,((_p->SizeOfBitMap + 31) & 0xffffffe0) >> 3); \
1643 } while (0)
1644
Alexandre Julliard6da4c272003-03-19 00:09:57 +00001645/* These are implemented as __fastcall, so we can't let Winelib apps link with them */
1646inline static USHORT RtlUshortByteSwap(USHORT s)
1647{
1648 return (s >> 8) | (s << 8);
1649}
1650inline static ULONG RtlUlongByteSwap(ULONG i)
1651{
1652#if defined(__i386__) && defined(__GNUC__)
1653 ULONG ret;
1654 __asm__("bswap %0" : "=r" (ret) : "0" (i) );
1655 return ret;
1656#else
Jon Griffithsc0ae5f82003-07-18 22:55:02 +00001657 return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
Alexandre Julliard6da4c272003-03-19 00:09:57 +00001658#endif
1659}
1660
Eric Pouech7d609642003-03-04 04:36:56 +00001661/*************************************************************************
1662 * Loader functions and structures.
1663 *
1664 * Those are not part of standard Winternl.h
1665 */
1666typedef struct _LDR_MODULE
1667{
1668 LIST_ENTRY InLoadOrderModuleList;
1669 LIST_ENTRY InMemoryOrderModuleList;
1670 LIST_ENTRY InInitializationOrderModuleList;
1671 void* BaseAddress;
Eric Pouech32872b12003-03-14 05:01:20 +00001672 void* EntryPoint;
Eric Pouech7d609642003-03-04 04:36:56 +00001673 ULONG SizeOfImage;
1674 UNICODE_STRING FullDllName;
1675 UNICODE_STRING BaseDllName;
1676 ULONG Flags;
1677 SHORT LoadCount;
1678 SHORT TlsIndex;
1679 HANDLE SectionHandle;
1680 ULONG CheckSum;
1681 ULONG TimeDateStamp;
1682} LDR_MODULE, *PLDR_MODULE;
1683
Eric Pouech19e050e2003-03-20 23:40:08 +00001684/* those defines are (some of the) regular LDR_MODULE.Flags values */
1685#define LDR_IMAGE_IS_DLL 0x00000004
1686#define LDR_LOAD_IN_PROGRESS 0x00001000
1687#define LDR_UNLOAD_IN_PROGRESS 0x00002000
1688#define LDR_NO_DLL_CALLS 0x00040000
1689#define LDR_PROCESS_ATTACHED 0x00080000
1690#define LDR_MODULE_REBASED 0x00200000
1691
1692/* these ones is Wine specific */
1693#define LDR_DONT_RESOLVE_REFS 0x40000000
1694#define LDR_WINE_INTERNAL 0x80000000
1695
Eric Pouech7d609642003-03-04 04:36:56 +00001696/* FIXME: to be checked */
1697#define MAXIMUM_FILENAME_LENGTH 256
1698
1699typedef struct _SYSTEM_MODULE
1700{
1701 ULONG Reserved1;
1702 ULONG Reserved2;
1703 PVOID ImageBaseAddress;
1704 ULONG ImageSize;
1705 ULONG Flags;
1706 WORD Id;
1707 WORD Rank;
1708 WORD Unknown;
1709 WORD NameOffset;
1710 BYTE Name[MAXIMUM_FILENAME_LENGTH];
1711} SYSTEM_MODULE, *PSYSTEM_MODULE;
1712
1713typedef struct _SYSTEM_MODULE_INFORMATION
1714{
1715 ULONG ModulesCount;
1716 SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
1717} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
1718
Eric Pouech7d609642003-03-04 04:36:56 +00001719NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
Eric Pouech84d1a8f2003-03-18 18:29:13 +00001720NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
Alexandre Julliard500a2f92003-03-20 04:29:21 +00001721NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG*);
Eric Pouech051f8712003-03-21 00:34:36 +00001722NTSTATUS WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
Eric Pouech7d609642003-03-04 04:36:56 +00001723NTSTATUS WINAPI LdrUnloadDll(HMODULE);
Alexandre Julliard500a2f92003-03-20 04:29:21 +00001724NTSTATUS WINAPI LdrUnlockLoaderLock(ULONG,ULONG);
Eric Pouech7d609642003-03-04 04:36:56 +00001725
Eric Pouech675b7552003-07-01 03:38:56 +00001726/* list manipulation macros */
1727#define InitializeListHead(le) (void)((le)->Flink = (le)->Blink = (le))
1728#define InsertHeadList(le,e) do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
1729#define InsertTailList(le,e) do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
1730#define IsListEmpty(le) ((le)->Flink == (le))
1731#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)
1732static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
1733{
1734 PLIST_ENTRY f, b, e;
1735
1736 e = le->Flink;
1737 f = le->Flink->Flink;
1738 b = le->Flink->Blink;
1739 f->Blink = b;
1740 b->Flink = f;
1741
1742 if (e != le) e->Flink = e->Blink = NULL;
1743 return e;
1744}
1745static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
1746{
1747 PLIST_ENTRY f, b, e;
1748
1749 e = le->Blink;
1750 f = le->Blink->Flink;
1751 b = le->Blink->Blink;
1752 f->Blink = b;
1753 b->Flink = f;
1754
1755 if (e != le) e->Flink = e->Blink = NULL;
1756 return e;
1757}
1758
Patrik Stridvalleba96492002-09-10 00:33:34 +00001759#ifdef __cplusplus
1760} /* extern "C" */
1761#endif /* defined(__cplusplus) */
1762
1763#endif /* __WINE_WINTERNAL_H */