wine  6.0.1
About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs.
  Fossies Dox: wine-6.0.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

winternl.h
Go to the documentation of this file.
1 /*
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #ifndef __WINE_WINTERNL_H
22 #define __WINE_WINTERNL_H
23 
24 #include <ntdef.h>
25 #include <windef.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* defined(__cplusplus) */
30 
31 
32 /**********************************************************************
33  * Fundamental types and data structures
34  */
35 
36 #ifndef WINE_NTSTATUS_DECLARED
37 #define WINE_NTSTATUS_DECLARED
38 typedef LONG NTSTATUS;
39 #endif
40 
41 typedef const char *PCSZ;
42 
43 typedef short CSHORT;
44 typedef CSHORT *PCSHORT;
45 
46 #ifndef __STRING_DEFINED__
47 #define __STRING_DEFINED__
48 typedef struct _STRING {
49  USHORT Length;
51  PCHAR Buffer;
53 #endif
54 
57 typedef const STRING *PCANSI_STRING;
58 
61 typedef const STRING *PCOEM_STRING;
62 
63 #ifndef __UNICODE_STRING_DEFINED__
64 #define __UNICODE_STRING_DEFINED__
65 typedef struct _UNICODE_STRING {
66  USHORT Length; /* bytes */
67  USHORT MaximumLength; /* bytes */
68  PWSTR Buffer;
70 #endif
71 
73 
74 #ifndef _FILETIME_
75 #define _FILETIME_
76 /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
77 typedef struct _FILETIME
78 {
79 #ifdef WORDS_BIGENDIAN
82 #else
85 #endif
87 #endif /* _FILETIME_ */
88 
89 /*
90  * RTL_SYSTEM_TIME and RTL_TIME_ZONE_INFORMATION are the same as
91  * the SYSTEMTIME and TIME_ZONE_INFORMATION structures defined
92  * in winbase.h, however we need to define them separately so
93  * winternl.h doesn't depend on winbase.h. They are used by
94  * RtlQueryTimeZoneInformation and RtlSetTimeZoneInformation.
95  * The names are guessed; if anybody knows the real names, let me know.
96  */
97 typedef struct _RTL_SYSTEM_TIME {
107 
117 
119 {
130 
131 typedef struct _CLIENT_ID
132 {
136 
137 typedef struct _CURDIR
138 {
142 
144 {
150 
151 typedef struct _RTL_RELATIVE_NAME
152 {
155  void *CurDirRef;
157 
158 typedef struct tagRTL_BITMAP {
159  ULONG SizeOfBitMap; /* Number of bits in the bitmap */
160  PULONG Buffer; /* Bitmap data, assumed sized to a DWORD boundary */
162 
163 typedef const RTL_BITMAP *PCRTL_BITMAP;
164 
165 typedef struct tagRTL_BITMAP_RUN {
166  ULONG StartingIndex; /* Bit position at which run starts */
167  ULONG NumberOfBits; /* Size of the run in bits */
169 
171 
173 {
203 
204 /* value for Flags field (FIXME: not the correct name) */
205 #define PROCESS_PARAMS_FLAG_NORMALIZED 1
206 
207 typedef struct _PEB_LDR_DATA
208 {
219 
220 typedef struct _GDI_TEB_BATCH
221 {
224  ULONG Buffer[0x136];
226 
228 {
233 
235 {
242 
244 {
246  const char *FrameName;
248 
250 {
252  const char *SourceLocation;
254 
255 typedef struct _TEB_ACTIVE_FRAME
256 {
261 
262 typedef struct _TEB_ACTIVE_FRAME_EX
263 {
267 
268 typedef struct _FLS_CALLBACK
269 {
270  void *unknown;
271  PFLS_CALLBACK_FUNCTION callback; /* ~0 if NULL callback is set, NULL if FLS index is free. */
273 
274 typedef struct _FLS_INFO_CHUNK
275 {
276  ULONG count; /* number of allocated FLS indexes in the chunk. */
277  FLS_CALLBACK callbacks[1]; /* the size is 0x10 for chunk 0 and is twice as
278  * the previous chunk size for the rest. */
280 
281 typedef struct _GLOBAL_FLS_DATA
282 {
287 
288 typedef struct _TEB_FLS_DATA
289 {
291  void **fls_data_chunks[8];
293 
294 #define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED 0x00000001
295 #define TEB_ACTIVE_FRAME_FLAG_EXTENDED 0x00000001
296 
297 /***********************************************************************
298  * PEB data structure
299  */
300 typedef struct _PEB
301 { /* win32/win64 */
304  BOOLEAN BeingDebugged; /* 002/002 */
305  BOOLEAN SpareBool; /* 003/003 */
306  HANDLE Mutant; /* 004/008 */
307  HMODULE ImageBaseAddress; /* 008/010 */
308  PPEB_LDR_DATA LdrData; /* 00c/018 */
310  PVOID SubSystemData; /* 014/028 */
311  HANDLE ProcessHeap; /* 018/030 */
313  PVOID /*PPEBLOCKROUTINE*/ FastPebLockRoutine; /* 020/040 */
314  PVOID /*PPEBLOCKROUTINE*/ FastPebUnlockRoutine; /* 024/048 */
316  PVOID KernelCallbackTable; /* 02c/058 */
317  ULONG Reserved; /* 030/060 */
318  ULONG AtlThunkSListPtr32; /* 034/064 */
319  PVOID /*PPEB_FREE_BLOCK*/ FreeList; /* 038/068 */
320  ULONG TlsExpansionCounter; /* 03c/070 */
321  PRTL_BITMAP TlsBitmap; /* 040/078 */
322  ULONG TlsBitmapBits[2]; /* 044/080 */
326  PVOID AnsiCodePageData; /* 058/0a0 */
327  PVOID OemCodePageData; /* 05c/0a8 */
329  ULONG NumberOfProcessors; /* 064/0b8 */
330  ULONG NtGlobalFlag; /* 068/0bc */
332  SIZE_T HeapSegmentReserve; /* 078/0c8 */
333  SIZE_T HeapSegmentCommit; /* 07c/0d0 */
336  ULONG NumberOfHeaps; /* 088/0e8 */
338  PVOID *ProcessHeaps; /* 090/0f0 */
341  PVOID GdiDCAttributeList; /* 09c/108 */
342  PVOID LoaderLock; /* 0a0/110 */
343  ULONG OSMajorVersion; /* 0a4/118 */
344  ULONG OSMinorVersion; /* 0a8/11c */
345  ULONG OSBuildNumber; /* 0ac/120 */
346  ULONG OSPlatformId; /* 0b0/124 */
347  ULONG ImageSubSystem; /* 0b4/128 */
351  HANDLE GdiHandleBuffer[28]; /* 0c4/138 */
352  ULONG unknown[6]; /* 134/218 */
355  ULONG TlsExpansionBitmapBits[32]; /* 154/240 */
356  ULONG SessionId; /* 1d4/2c0 */
359  PVOID ShimData; /* 1e8/2d8 */
360  PVOID AppCompatInfo; /* 1ec/2e0 */
361  UNICODE_STRING CSDVersion; /* 1f0/2e8 */
366  SIZE_T MinimumStackCommit; /* 208/318 */
367  PVOID *FlsCallback; /* 20c/320 */
368  LIST_ENTRY FlsListHead; /* 210/328 */
369  PRTL_BITMAP FlsBitmap; /* 218/338 */
370  ULONG FlsBitmapBits[4]; /* 21c/340 */
371  ULONG FlsHighIndex; /* 22c/350 */
372  PVOID WerRegistrationData; /* 230/358 */
373  PVOID WerShipAssertPtr; /* 234/360 */
374  PVOID pUnused; /* 238/368 */
375  PVOID pImageHeaderHash; /* 23c/370 */
376  ULONG TracingFlags; /* 240/378 */
378  ULONG TppWorkerpListLock; /* 250/388 */
379  LIST_ENTRY TppWorkerpList; /* 254/390 */
380  PVOID WaitOnAddressHashTable [0x80]; /* 25c/3a0 */
382  ULONG CloudFileFlags; /* 460/7a8 */
383  ULONG CloudFileDiagFlags; /* 464/7ac */
386  PVOID LeapSecondData; /* 470/7b8 */
387  ULONG LeapSecondFlags; /* 474/7c0 */
388  ULONG NtGlobalFlag2; /* 478/7c4 */
389 } PEB, *PPEB;
390 
391 
392 /***********************************************************************
393  * TEB data structure
394  */
395 typedef struct _TEB
396 { /* win32/win64 */
397  NT_TIB Tib; /* 000/0000 */
398  PVOID EnvironmentPointer; /* 01c/0038 */
399  CLIENT_ID ClientId; /* 020/0040 */
400  PVOID ActiveRpcHandle; /* 028/0050 */
402  PPEB Peb; /* 030/0060 */
403  ULONG LastErrorValue; /* 034/0068 */
405  PVOID CsrClientThread; /* 03c/0070 */
406  PVOID Win32ThreadInfo; /* 040/0078 */
407  ULONG User32Reserved[26]; /* 044/0080 */
408  ULONG UserReserved[5]; /* 0ac/00e8 */
409  PVOID WOW32Reserved; /* 0c0/0100 */
410  ULONG CurrentLocale; /* 0c4/0108 */
413 #ifdef _WIN64
414  PVOID SystemReserved1[30]; /* /0190 */
415 #else
416  PVOID SystemReserved1[26]; /* 10c/ used for krnl386 private data in Wine */
417 #endif
418  char PlaceholderCompatibilityMode; /* 174/0280 */
419  char PlaceholderReserved[11]; /* 175/0281 */
420  DWORD ProxiedProcessId; /* 180/028c */
422  UCHAR WorkingOnBehalfOfTicket[8]; /* 19c/02b8 */
423  LONG ExceptionCode; /* 1a4/02c0 */
428 #ifdef _WIN64
429  ULONG TxFsContext; /* /02e8 */
431 #else
433  BYTE SpareBytes1[23]; /* 1b9/ */
434  ULONG TxFsContext; /* 1d0/ */
435 #endif
436  GDI_TEB_BATCH GdiTebBatch; /* 1d4/02f0 used for ntdll private data in Wine */
437  CLIENT_ID RealClientId; /* 6b4/07d8 */
439  ULONG GdiClientPID; /* 6c0/07f0 */
440  ULONG GdiClientTID; /* 6c4/07f4 */
441  PVOID GdiThreadLocaleInfo; /* 6c8/07f8 */
442  ULONG_PTR Win32ClientInfo[62]; /* 6cc/0800 used for user32 private data in Wine */
443  PVOID glDispatchTable[233]; /* 7c4/09f0 */
444  PVOID glReserved1[29]; /* b68/1138 */
445  PVOID glReserved2; /* bdc/1220 */
446  PVOID glSectionInfo; /* be0/1228 */
447  PVOID glSection; /* be4/1230 */
448  PVOID glTable; /* be8/1238 */
449  PVOID glCurrentRC; /* bec/1240 */
450  PVOID glContext; /* bf0/1248 */
451  ULONG LastStatusValue; /* bf4/1250 */
453  WCHAR StaticUnicodeBuffer[261]; /* c00/1268 */
454  PVOID DeallocationStack; /* e0c/1478 */
455  PVOID TlsSlots[64]; /* e10/1480 */
456  LIST_ENTRY TlsLinks; /* f10/1680 */
457  PVOID Vdm; /* f18/1690 */
458  PVOID ReservedForNtRpc; /* f1c/1698 */
459  PVOID DbgSsReserved[2]; /* f20/16a0 */
460  ULONG HardErrorDisabled; /* f28/16b0 */
461  PVOID Instrumentation[16]; /* f2c/16b8 */
462  PVOID WinSockData; /* f6c/1738 */
463  ULONG GdiBatchCount; /* f70/1740 */
464  ULONG Spare2; /* f74/1744 */
465  ULONG GuaranteedStackBytes; /* f78/1748 */
466  PVOID ReservedForPerf; /* f7c/1750 */
467  PVOID ReservedForOle; /* f80/1758 */
468  ULONG WaitingOnLoaderLock; /* f84/1760 */
469  PVOID Reserved5[3]; /* f88/1768 */
470  PVOID *TlsExpansionSlots; /* f94/1780 */
471 #ifdef _WIN64
472  PVOID DeallocationBStore; /* /1788 */
473  PVOID BStoreLimit; /* /1790 */
474 #endif
475  ULONG ImpersonationLocale; /* f98/1798 */
476  ULONG IsImpersonating; /* f9c/179c */
477  PVOID NlsCache; /* fa0/17a0 */
478  PVOID ShimData; /* fa4/17a8 */
479  ULONG HeapVirtualAffinity; /* fa8/17b0 */
481  TEB_ACTIVE_FRAME *ActiveFrame; /* fb0/17c0 */
482  TEB_FLS_DATA *FlsSlots; /* fb4/17c8 */
483  PVOID PreferredLanguages; /* fb8/17d0 */
484  PVOID UserPrefLanguages; /* fbc/17d8 */
485  PVOID MergedPrefLanguages; /* fc0/17e0 */
486  ULONG MuiImpersonation; /* fc4/17e8 */
487  USHORT CrossTebFlags; /* fc8/17ec */
488  USHORT SameTebFlags; /* fca/17ee */
489  PVOID TxnScopeEnterCallback; /* fcc/17f0 */
490  PVOID TxnScopeExitCallback; /* fd0/17f8 */
491  PVOID TxnScopeContext; /* fd4/1800 */
492  ULONG LockCount; /* fd8/1808 */
493  LONG WowTebOffset; /* fdc/180c */
494  PVOID ResourceRetValue; /* fe0/1810 */
495  PVOID ReservedForWdf; /* fe4/1818 */
496  ULONGLONG ReservedForCrt; /* fe8/1820 */
497  GUID EffectiveContainerId; /* ff0/1828 */
498 } TEB, *PTEB;
499 
500 
501 /***********************************************************************
502  * The 64-bit version of the PEB and TEB for WoW64
503  */
504 #ifndef _WIN64
505 
506 typedef struct _NT_TIB64
507 {
508  ULONG64 ExceptionList; /* 0000 */
509  ULONG64 StackBase; /* 0008 */
510  ULONG64 StackLimit; /* 0010 */
511  ULONG64 SubSystemTib; /* 0018 */
512  ULONG64 FiberData; /* 0020 */
514  ULONG64 Self; /* 0030 */
516 
517 typedef struct _CLIENT_ID64
518 {
522 
523 typedef struct _LIST_ENTRY64
524 {
528 
529 typedef struct _UNICODE_STRING64
530 {
535 
537 {
544 
545 typedef struct _PEB64
546 {
549  BOOLEAN BeingDebugged; /* 0002 */
550  BOOLEAN SpareBool; /* 0003 */
551  ULONG64 Mutant; /* 0008 */
553  ULONG64 LdrData; /* 0018 */
555  ULONG64 SubSystemData; /* 0028 */
556  ULONG64 ProcessHeap; /* 0030 */
557  ULONG64 FastPebLock; /* 0038 */
562  ULONG Reserved; /* 0060 */
564  ULONG64 FreeList; /* 0068 */
566  ULONG64 TlsBitmap; /* 0078 */
567  ULONG TlsBitmapBits[2]; /* 0080 */
575  ULONG NtGlobalFlag; /* 00bc */
581  ULONG NumberOfHeaps; /* 00e8 */
583  ULONG64 ProcessHeaps; /* 00f0 */
587  ULONG64 LoaderLock; /* 0110 */
588  ULONG OSMajorVersion; /* 0118 */
589  ULONG OSMinorVersion; /* 011c */
590  ULONG OSBuildNumber; /* 0120 */
591  ULONG OSPlatformId; /* 0124 */
592  ULONG ImageSubSystem; /* 0128 */
596  ULONG64 GdiHandleBuffer[28]; /* 0138 */
597  ULONG unknown[6]; /* 0218 */
601  ULONG SessionId; /* 02c0 */
604  ULONG64 ShimData; /* 02d8 */
605  ULONG64 AppCompatInfo; /* 02e0 */
612  ULONG64 FlsCallback; /* 0320 */
614  ULONG64 FlsBitmap; /* 0338 */
615  ULONG FlsBitmapBits[4]; /* 0340 */
616  ULONG FlsHighIndex; /* 0350 */
619  ULONG64 pUnused; /* 0368 */
621  ULONG TracingFlags; /* 0378 */
625  ULONG64 WaitOnAddressHashTable [0x80]; /* 03a0 */
627  ULONG CloudFileFlags; /* 07a8 */
632  ULONG LeapSecondFlags; /* 07c0 */
633  ULONG NtGlobalFlag2; /* 07c4 */
635 
636 typedef struct _TEB64
637 {
638  NT_TIB64 Tib; /* 0000 */
640  CLIENT_ID64 ClientId; /* 0040 */
643  ULONG64 Peb; /* 0060 */
644  ULONG LastErrorValue; /* 0068 */
648  ULONG User32Reserved[26]; /* 0080 */
649  ULONG UserReserved[5]; /* 00e8 */
650  ULONG64 WOW32Reserved; /* 0100 */
651  ULONG CurrentLocale; /* 0108 */
654  ULONG64 SystemReserved1[30]; /* 0190 */
656  char PlaceholderReserved[11]; /* 0281 */
660  LONG ExceptionCode; /* 02c0 */
665  ULONG TxFsContext; /* 02e8 */
667  ULONG64 GdiTebBatch[0x9d]; /* 02f0 */
670  ULONG GdiClientPID; /* 07f0 */
671  ULONG GdiClientTID; /* 07f4 */
673  ULONG64 Win32ClientInfo[62]; /* 0800 */
674  ULONG64 glDispatchTable[233]; /* 09f0 */
675  ULONG64 glReserved1[29]; /* 1138 */
676  ULONG64 glReserved2; /* 1220 */
677  ULONG64 glSectionInfo; /* 1228 */
678  ULONG64 glSection; /* 1230 */
679  ULONG64 glTable; /* 1238 */
680  ULONG64 glCurrentRC; /* 1240 */
681  ULONG64 glContext; /* 1248 */
682  ULONG LastStatusValue; /* 1250 */
684  WCHAR StaticUnicodeBuffer[261]; /* 1268 */
686  ULONG64 TlsSlots[64]; /* 1480 */
687  LIST_ENTRY64 TlsLinks; /* 1680 */
688  ULONG64 Vdm; /* 1690 */
690  ULONG64 DbgSsReserved[2]; /* 16a0 */
692  ULONG64 Instrumentation[16]; /* 16b8 */
693  ULONG64 WinSockData; /* 1738 */
694  ULONG GdiBatchCount; /* 1740 */
695  ULONG Spare2; /* 1744 */
700  ULONG64 Reserved5[3]; /* 1768 */
703  ULONG64 BStoreLimit; /* 1790 */
705  ULONG IsImpersonating; /* 179c */
706  ULONG64 NlsCache; /* 17a0 */
707  ULONG64 ShimData; /* 17a8 */
710  ULONG64 ActiveFrame; /* 17c0 */
711  ULONG64 FlsSlots; /* 17c8 */
716  USHORT CrossTebFlags; /* 17ec */
717  USHORT SameTebFlags; /* 17ee */
721  ULONG LockCount; /* 1808 */
722  LONG WowTebOffset; /* 180c */
728 
729 /* reserved TEB64 TLS slots for Wow64 */
730 #define WOW64_TLS_FILESYSREDIR 8
731 
732 #endif /* _WIN64 */
733 
734 /***********************************************************************
735  * Enums
736  */
737 
804 
818 
834 
850 
868 
886 
903 
904 typedef struct _FILE_BASIC_INFORMATION {
911 
919 
923 
924 typedef struct _FILE_ID_128 {
927 
928 typedef struct _FILE_ID_INFORMATION {
932 
933 typedef struct _FILE_EA_INFORMATION {
936 
937 typedef struct _FILE_ACCESS_INFORMATION {
940 
941 typedef struct _FILE_NAME_INFORMATION {
945 
946 typedef struct _FILE_RENAME_INFORMATION {
952 
953 typedef struct _FILE_LINK_INFORMATION {
959 
960 typedef struct _FILE_NAMES_INFORMATION {
966 
970 
974 
978 
982 
986 
996 
1004 
1005 typedef struct _FILE_MODE_INFORMATION {
1008 
1010 {
1017 
1019 {
1023 
1031 
1035 
1036 typedef struct _FILE_PIPE_INFORMATION {
1040 
1053 
1054 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
1055 #define FILE_PIPE_LISTENING_STATE 0x00000002
1056 #define FILE_PIPE_CONNECTED_STATE 0x00000003
1057 #define FILE_PIPE_CLOSING_STATE 0x00000004
1058 
1060 {
1062  union
1063  {
1064  struct
1065  {
1069  } DUMMYSTRUCTNAME;
1071  } DUMMYUNIONNAME;
1073 
1077  union {
1078  struct {
1082  } DUMMYSTRUCTNAME;
1084  } DUMMYUNIONNAME;
1086 
1087 typedef struct _FILE_QUOTA_INFORMATION {
1096 
1101 
1102 typedef struct _FILE_ALL_INFORMATION {
1113 
1117 
1118 #define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
1119 #define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
1120 #define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
1121 
1122 typedef enum _FSINFOCLASS {
1133 
1145 
1153 
1161 
1162 typedef enum _PROCESSINFOCLASS {
1209 
1210 #define MEM_EXECUTE_OPTION_DISABLE 0x01
1211 #define MEM_EXECUTE_OPTION_ENABLE 0x02
1212 #define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
1213 #define MEM_EXECUTE_OPTION_PERMANENT 0x08
1214 
1215 typedef enum _SECTION_INHERIT {
1217  ViewUnmap = 2
1219 
1224  SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
1306 
1307 typedef enum _THREADINFOCLASS {
1346 
1348 {
1356 
1358 {
1362 
1364 {
1367 
1368 typedef struct _KERNEL_USER_TIMES {
1374 
1375 typedef enum _WINSTATIONINFOCLASS {
1378 
1386 
1387 typedef struct _MEMORY_SECTION_NAME
1388 {
1391 
1394  struct {
1402  } DUMMYSTRUCTNAME;
1404 
1409 
1411 {
1414 
1420 
1422 {
1425 
1427 {
1431 
1432 
1433 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
1434 typedef enum
1435 {
1437  UNC_PATH, /* "//foo" */
1438  ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
1439  RELATIVE_DRIVE_PATH, /* "c:foo" */
1440  ABSOLUTE_PATH, /* "/foo" */
1441  RELATIVE_PATH, /* "foo" */
1442  DEVICE_PATH, /* "//./foo" */
1443  UNC_DOT_PATH /* "//." */
1445 
1446 
1447 /***********************************************************************
1448  * Types and data structures
1449  */
1450 
1451 /* This is used by NtQuerySystemInformation */
1453 { /* win32/win64 */
1457  DWORD dwTickCount; /* 18/18 */
1458  LPVOID StartAddress; /* 1c/20 */
1459  CLIENT_ID ClientId; /* 20/28 */
1461  DWORD dwBasePriority; /* 2c/3c */
1463  DWORD dwThreadState; /* 34/44 */
1464  DWORD dwWaitReason; /* 38/48 */
1465  DWORD dwUnknown; /* 3c/4c */
1467 
1468 typedef struct _IO_STATUS_BLOCK {
1469  union {
1472  } DUMMYUNIONNAME;
1473 
1476 
1478 
1479 typedef struct _KEY_BASIC_INFORMATION {
1485 
1487 {
1494  /* Class[1]; */
1496 
1498 {
1511 
1512 typedef struct _KEY_NAME_INFORMATION {
1516 
1518 {
1528 
1529 typedef struct _KEY_VALUE_ENTRY
1530 {
1536 
1543 
1552 
1559 
1560 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
1561 #define __OBJECT_ATTRIBUTES_DEFINED__
1562 typedef struct _OBJECT_ATTRIBUTES {
1563  ULONG Length;
1566  ULONG Attributes;
1567  PVOID SecurityDescriptor; /* type SECURITY_DESCRIPTOR */
1568  PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
1570 #endif
1571 
1576 
1590 
1594 
1599 
1601 #ifdef __WINESRC__
1602  DWORD_PTR ExitStatus;
1604  DWORD_PTR AffinityMask;
1605  DWORD_PTR BasePriority;
1607  ULONG_PTR InheritedFromUniqueProcessId;
1608 #else
1614 #endif
1616 
1617 #define PROCESS_PRIOCLASS_IDLE 1
1618 #define PROCESS_PRIOCLASS_NORMAL 2
1619 #define PROCESS_PRIOCLASS_HIGH 3
1620 #define PROCESS_PRIOCLASS_REALTIME 4
1621 #define PROCESS_PRIOCLASS_BELOW_NORMAL 5
1622 #define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
1623 
1624 typedef struct _PROCESS_PRIORITY_CLASS {
1628 
1630 {
1635 
1637 {
1644 
1645 typedef struct _RTL_HEAP_DEFINITION {
1646  ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
1647 
1650 
1651 typedef struct _RTL_RWLOCK {
1653 
1656 
1659 
1665 
1666 /* System Information Class 0x00 */
1667 
1669 #ifdef __WINESRC__
1670  DWORD unknown;
1671  ULONG KeMaximumIncrement;
1672  ULONG PageSize;
1673  ULONG MmNumberOfPhysicalPages;
1674  ULONG MmLowestPhysicalPage;
1675  ULONG MmHighestPhysicalPage;
1676  ULONG_PTR AllocationGranularity;
1677  PVOID LowestUserAddress;
1678  PVOID HighestUserAddress;
1679  ULONG_PTR ActiveProcessorsAffinityMask;
1681 #else
1685 #endif
1687 
1688 /* System Information Class 0x01 */
1689 
1690 typedef struct _SYSTEM_CPU_INFORMATION {
1693  WORD Revision; /* combination of CPU model and stepping */
1694  WORD Reserved; /* always zero */
1695  DWORD FeatureSet; /* see bit flags below */
1697 
1698 /* definitions of bits in the Feature set for the x86 processors */
1699 #define CPU_FEATURE_VME 0x00000005 /* Virtual 86 Mode Extensions */
1700 #define CPU_FEATURE_TSC 0x00000002 /* Time Stamp Counter available */
1701 #define CPU_FEATURE_CMOV 0x00000008 /* Conditional Move instruction*/
1702 #define CPU_FEATURE_PGE 0x00000014 /* Page table Entry Global bit */
1703 #define CPU_FEATURE_PSE 0x00000024 /* Page Size Extension */
1704 #define CPU_FEATURE_MTRR 0x00000040 /* Memory Type Range Registers */
1705 #define CPU_FEATURE_CX8 0x00000080 /* Compare and eXchange 8 byte instr. */
1706 #define CPU_FEATURE_MMX 0x00000100 /* Multi Media eXtensions */
1707 #define CPU_FEATURE_X86 0x00000200 /* seems to be always ON, on the '86 */
1708 #define CPU_FEATURE_PAT 0x00000400 /* Page Attribute Table */
1709 #define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
1710 #define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
1711 #define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
1712 #define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
1713 #define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
1714 #define CPU_FEATURE_DS 0x00020000 /* Debug Store */
1715 #define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
1716 #define CPU_FEATURE_SSE3 0x00080000 /* SSE3 extensions */
1717 #define CPU_FEATURE_CX128 0x00100000 /* cmpxchg16b instruction */
1718 #define CPU_FEATURE_XSAVE 0x00800000 /* XSAVE instructions */
1719 #define CPU_FEATURE_2NDLEV 0x04000000 /* Second-level address translation */
1720 #define CPU_FEATURE_VIRT 0x08000000 /* Virtualization support */
1721 #define CPU_FEATURE_RDFS 0x10000000 /* RDFSBASE etc. instructions */
1722 #define CPU_FEATURE_NX 0x20000000 /* Data execution prevention */
1723 
1724 /* FIXME: following values are made up, actual flags are unknown */
1725 #define CPU_FEATURE_SSSE3 0x00008000 /* SSSE3 instructions */
1726 #define CPU_FEATURE_SSE41 0x01000000 /* SSE41 instructions */
1727 #define CPU_FEATURE_SSE42 0x02000000 /* SSE42 instructions */
1728 #define CPU_FEATURE_AVX 0x40000000 /* AVX instructions */
1729 #define CPU_FEATURE_AVX2 0x80000000 /* AVX2 instructions */
1730 
1731 #define CPU_FEATURE_PAE 0x00200000
1732 #define CPU_FEATURE_DAZ 0x00400000
1733 #define CPU_FEATURE_ARM_VFP_32 0x00000001
1734 #define CPU_FEATURE_ARM_NEON 0x00000002
1735 #define CPU_FEATURE_ARM_V8_CRC32 0x00000004
1736 #define CPU_FEATURE_ARM_V8_CRYPTO 0x00000008
1737 
1738 /* System Information Class 0x02 */
1739 
1740 /* Documented in "Windows NT/2000 Native API Reference" by Gary Nebbett. */
1816 
1817 /* System Information Class 0x03 */
1818 
1820 #ifdef __WINESRC__
1821  LARGE_INTEGER BootTime;
1822  LARGE_INTEGER SystemTime;
1823  LARGE_INTEGER TimeZoneBias;
1824  ULONG TimeZoneId;
1825  ULONG Reserved;
1826  ULONGLONG BootTimeBias;
1827  ULONGLONG SleepTimeBias;
1828 #else
1830 #endif
1831 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
1832 
1833 /* System Information Class 0x08 */
1834 
1842 
1843 /* System Information Class 0x0b */
1844 
1851  char szName[MAX_PATH + 1];
1853 
1854 /* System Information Class 0x10 */
1855 
1856 typedef struct _SYSTEM_HANDLE_ENTRY {
1864 
1869 
1871 {
1872  void *Object;
1881 
1883 {
1888 
1889 /* System Information Class 0x15 */
1890 
1898 #ifdef _WIN64
1899  ULONG unknown64[7];
1900 #endif
1902 
1903 /* System Information Class 0x17 */
1904 
1908 
1910  union {
1912  struct {
1915  } tag1;
1916  } tag2;
1927 
1931 
1935 
1940 
1941 typedef struct _VM_COUNTERS
1942 {
1955 
1956 typedef struct _VM_COUNTERS_EX
1957 {
1971 
1973 #ifdef __WINESRC__ /* win32/win64 */
1974  ULONG NextEntryOffset; /* 00/00 */
1975  DWORD dwThreadCount; /* 04/04 */
1976  DWORD dwUnknown1[6]; /* 08/08 */
1977  LARGE_INTEGER CreationTime; /* 20/20 */
1978  LARGE_INTEGER UserTime; /* 28/28 */
1979  LARGE_INTEGER KernelTime; /* 30/30 */
1980  UNICODE_STRING ProcessName; /* 38/38 */
1981  DWORD dwBasePriority; /* 40/48 */
1982  HANDLE UniqueProcessId; /* 44/50 */
1983  HANDLE ParentProcessId; /* 48/58 */
1984  ULONG HandleCount; /* 4c/60 */
1985  ULONG SessionId; /* 50/64 */
1986  DWORD dwUnknown4; /* 54/68 */
1987  VM_COUNTERS_EX vmCounters; /* 58/70 */
1988  IO_COUNTERS ioCounters; /* 88/d0 */
1989  SYSTEM_THREAD_INFORMATION ti[1]; /* b8/100 */
1990 #else
1991  ULONG NextEntryOffset; /* 00/00 */
1992  BYTE Reserved1[52]; /* 04/04 */
1993  PVOID Reserved2[3]; /* 38/38 */
1995  PVOID Reserved3; /* 48/58 */
1996  ULONG HandleCount; /* 4c/60 */
1997  BYTE Reserved4[4]; /* 50/64 */
1998  PVOID Reserved5[11]; /* 54/68 */
2001  LARGE_INTEGER Reserved6[6]; /* 88/d0 */
2002 #endif
2004 
2010 
2016 
2017 typedef struct _SYSTEM_TIME_ADJUSTMENT {
2021 
2023 {
2027 
2028 /* System Information Class 0x4C */
2029 
2031 {
2038 
2039 typedef struct _TIME_FIELDS
2049 
2050 typedef struct _WINSTATIONINFORMATIONW {
2055 
2057 
2058 typedef struct _LDR_RESOURCE_INFO
2059 {
2064 
2065 
2066 /* debug buffer definitions */
2067 
2068 typedef struct _DEBUG_BUFFER {
2086 
2087 #define PDI_MODULES 0x01
2088 #define PDI_BACKTRACE 0x02
2089 #define PDI_HEAPS 0x04
2090 #define PDI_HEAP_TAGS 0x08
2091 #define PDI_HEAP_BLOCKS 0x10
2092 #define PDI_LOCKS 0x20
2093 
2105 
2106 typedef struct _DEBUG_HEAP_INFORMATION {
2119 
2120 typedef struct _DEBUG_LOCK_INFORMATION {
2132 
2133 typedef struct _PORT_MESSAGE_HEADER {
2142 
2143 typedef unsigned short RTL_ATOM, *PRTL_ATOM;
2144 
2145 /* Wine doesn't implement atom table as NT does:
2146  * - in NT, atom tables are user space tables, which ntdll directly accesses
2147  * - on Wine, (even local) atom tables are wineserver objects, hence a HANDLE
2148  */
2150 
2155 
2156 typedef struct _ATOM_BASIC_INFORMATION {
2162 
2163 /* FIXME: names probably not correct */
2164 typedef struct _RTL_HANDLE
2165 {
2166  struct _RTL_HANDLE * Next;
2168 
2169 /* FIXME: names probably not correct */
2170 typedef struct _RTL_HANDLE_TABLE
2171 {
2172  ULONG MaxHandleCount; /* 0x00 */
2173  ULONG HandleSize; /* 0x04 */
2174  ULONG Unused[2]; /* 0x08-0x0c */
2175  PVOID NextFree; /* 0x10 */
2176  PVOID FirstHandle; /* 0x14 */
2177  PVOID ReservedMemory; /* 0x18 */
2178  PVOID MaxHandle; /* 0x1c */
2180 
2181 /***********************************************************************
2182  * Defines
2183  */
2184 
2185 /* flags for NtCreateFile and NtOpenFile */
2186 #define FILE_DIRECTORY_FILE 0x00000001
2187 #define FILE_WRITE_THROUGH 0x00000002
2188 #define FILE_SEQUENTIAL_ONLY 0x00000004
2189 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
2190 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
2191 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
2192 #define FILE_NON_DIRECTORY_FILE 0x00000040
2193 #define FILE_CREATE_TREE_CONNECTION 0x00000080
2194 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
2195 #define FILE_NO_EA_KNOWLEDGE 0x00000200
2196 #define FILE_OPEN_FOR_RECOVERY 0x00000400
2197 #define FILE_RANDOM_ACCESS 0x00000800
2198 #define FILE_DELETE_ON_CLOSE 0x00001000
2199 #define FILE_OPEN_BY_FILE_ID 0x00002000
2200 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
2201 #define FILE_NO_COMPRESSION 0x00008000
2202 #define FILE_RESERVE_OPFILTER 0x00100000
2203 #define FILE_OPEN_REPARSE_POINT 0x00200000
2204 #define FILE_OPEN_OFFLINE_FILE 0x00400000
2205 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
2206 
2207 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
2208 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
2209 
2210 /* status for NtCreateFile or NtOpenFile */
2211 #define FILE_SUPERSEDED 0
2212 #define FILE_OPENED 1
2213 #define FILE_CREATED 2
2214 #define FILE_OVERWRITTEN 3
2215 #define FILE_EXISTS 4
2216 #define FILE_DOES_NOT_EXIST 5
2217 
2218 /* disposition for NtCreateFile */
2219 #define FILE_SUPERSEDE 0
2220 #define FILE_OPEN 1
2221 #define FILE_CREATE 2
2222 #define FILE_OPEN_IF 3
2223 #define FILE_OVERWRITE 4
2224 #define FILE_OVERWRITE_IF 5
2225 #define FILE_MAXIMUM_DISPOSITION 5
2226 
2227 /* Characteristics of a File System */
2228 #define FILE_REMOVABLE_MEDIA 0x00000001
2229 #define FILE_READ_ONLY_DEVICE 0x00000002
2230 #define FILE_FLOPPY_DISKETTE 0x00000004
2231 #define FILE_WRITE_ONE_MEDIA 0x00000008
2232 #define FILE_REMOTE_DEVICE 0x00000010
2233 #define FILE_DEVICE_IS_MOUNTED 0x00000020
2234 #define FILE_VIRTUAL_VOLUME 0x00000040
2235 #define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
2236 #define FILE_DEVICE_SECURE_OPEN 0x00000100
2237 #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
2238 #define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000
2239 #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000
2240 #define FILE_CHARACTERISTIC_CSV 0x00010000
2241 #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
2242 #define FILE_PORTABLE_DEVICE 0x00040000
2243 
2244 /* options for NtCreateNamedPipeFile */
2245 #define FILE_PIPE_INBOUND 0x00000000
2246 #define FILE_PIPE_OUTBOUND 0x00000001
2247 #define FILE_PIPE_FULL_DUPLEX 0x00000002
2248 
2249 /* options for pipe's type */
2250 #define FILE_PIPE_TYPE_MESSAGE 0x00000001
2251 #define FILE_PIPE_TYPE_BYTE 0x00000000
2252 /* options for pipe's message mode */
2253 #define FILE_PIPE_MESSAGE_MODE 0x00000001
2254 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
2255 /* options for pipe's blocking mode */
2256 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
2257 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
2258 /* and client / server end */
2259 #define FILE_PIPE_SERVER_END 0x00000001
2260 #define FILE_PIPE_CLIENT_END 0x00000000
2261 
2262 #define INTERNAL_TS_ACTIVE_CONSOLE_ID ( *((volatile ULONG*)(0x7ffe02d8)) )
2263 
2264 #define LOGONID_CURRENT ((ULONG)-1)
2265 
2266 #define OBJ_PROTECT_CLOSE 0x00000001
2267 #define OBJ_INHERIT 0x00000002
2268 #define OBJ_PERMANENT 0x00000010
2269 #define OBJ_EXCLUSIVE 0x00000020
2270 #define OBJ_CASE_INSENSITIVE 0x00000040
2271 #define OBJ_OPENIF 0x00000080
2272 #define OBJ_OPENLINK 0x00000100
2273 #define OBJ_KERNEL_HANDLE 0x00000200
2274 #define OBJ_VALID_ATTRIBUTES 0x000003F2
2275 
2276 #define SERVERNAME_CURRENT ((HANDLE)NULL)
2277 
2278 typedef void (CALLBACK *PNTAPCFUNC)(ULONG_PTR,ULONG_PTR,ULONG_PTR); /* FIXME: not the right name */
2279 typedef void (CALLBACK *PRTL_THREAD_START_ROUTINE)(LPVOID); /* FIXME: not the right name */
2280 typedef DWORD (CALLBACK *PRTL_WORK_ITEM_ROUTINE)(LPVOID); /* FIXME: not the right name */
2281 typedef void (NTAPI *RTL_WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); /* FIXME: not the right name */
2282 
2283 
2284 /* DbgPrintEx default levels */
2285 #define DPFLTR_ERROR_LEVEL 0
2286 #define DPFLTR_WARNING_LEVEL 1
2287 #define DPFLTR_TRACE_LEVEL 2
2288 #define DPFLTR_INFO_LEVEL 3
2289 #define DPFLTR_MASK 0x8000000
2290 
2291 /* Well-known LUID values */
2292 #define SE_MIN_WELL_KNOWN_PRIVILEGE 2
2293 #define SE_CREATE_TOKEN_PRIVILEGE 2
2294 #define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3
2295 #define SE_LOCK_MEMORY_PRIVILEGE 4
2296 #define SE_INCREASE_QUOTA_PRIVILEGE 5
2297 #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 /* obsolete */
2298 #define SE_MACHINE_ACCOUNT_PRIVILEGE 6
2299 #define SE_TCB_PRIVILEGE 7
2300 #define SE_SECURITY_PRIVILEGE 8
2301 #define SE_TAKE_OWNERSHIP_PRIVILEGE 9
2302 #define SE_LOAD_DRIVER_PRIVILEGE 10
2303 #define SE_SYSTEM_PROFILE_PRIVILEGE 11
2304 #define SE_SYSTEMTIME_PRIVILEGE 12
2305 #define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13
2306 #define SE_INC_BASE_PRIORITY_PRIVILEGE 14
2307 #define SE_CREATE_PAGEFILE_PRIVILEGE 15
2308 #define SE_CREATE_PERMANENT_PRIVILEGE 16
2309 #define SE_BACKUP_PRIVILEGE 17
2310 #define SE_RESTORE_PRIVILEGE 18
2311 #define SE_SHUTDOWN_PRIVILEGE 19
2312 #define SE_DEBUG_PRIVILEGE 20
2313 #define SE_AUDIT_PRIVILEGE 21
2314 #define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22
2315 #define SE_CHANGE_NOTIFY_PRIVILEGE 23
2316 #define SE_REMOTE_SHUTDOWN_PRIVILEGE 24
2317 #define SE_UNDOCK_PRIVILEGE 25
2318 #define SE_SYNC_AGENT_PRIVILEGE 26
2319 #define SE_ENABLE_DELEGATION_PRIVILEGE 27
2320 #define SE_MANAGE_VOLUME_PRIVILEGE 28
2321 #define SE_IMPERSONATE_PRIVILEGE 29
2322 #define SE_CREATE_GLOBAL_PRIVILEGE 30
2323 #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_GLOBAL_PRIVILEGE
2324 
2325 /* NtGlobalFlag bits */
2326 #define FLG_STOP_ON_EXCEPTION 0x00000001
2327 #define FLG_SHOW_LDR_SNAPS 0x00000002
2328 #define FLG_DEBUG_INITIAL_COMMAND 0x00000004
2329 #define FLG_STOP_ON_HUNG_GUI 0x00000008
2330 #define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010
2331 #define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020
2332 #define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040
2333 #define FLG_HEAP_VALIDATE_ALL 0x00000080
2334 #define FLG_APPLICATION_VERIFIER 0x00000100
2335 #define FLG_POOL_ENABLE_TAGGING 0x00000400
2336 #define FLG_HEAP_ENABLE_TAGGING 0x00000800
2337 #define FLG_USER_STACK_TRACE_DB 0x00001000
2338 #define FLG_KERNEL_STACK_TRACE_DB 0x00002000
2339 #define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000
2340 #define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000
2341 #define FLG_DISABLE_STACK_EXTENSION 0x00010000
2342 #define FLG_ENABLE_CSRDEBUG 0x00020000
2343 #define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000
2344 #define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000
2345 #define FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x00100000
2346 #define FLG_HEAP_DISABLE_COALESCING 0x00200000
2347 #define FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000
2348 #define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000
2349 #define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
2350 #define FLG_HEAP_PAGE_ALLOCS 0x02000000
2351 #define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
2352 #define FLG_DISABLE_DBGPRINT 0x08000000
2353 #define FLG_CRITSEC_EVENT_CREATION 0x10000000
2354 #define FLG_LDR_TOP_DOWN 0x20000000
2355 #define FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000
2356 #define FLG_DISABLE_PROTDLLS 0x80000000
2357 
2358 /* Rtl*Registry* functions structs and defines */
2359 #define RTL_REGISTRY_ABSOLUTE 0
2360 #define RTL_REGISTRY_SERVICES 1
2361 #define RTL_REGISTRY_CONTROL 2
2362 #define RTL_REGISTRY_WINDOWS_NT 3
2363 #define RTL_REGISTRY_DEVICEMAP 4
2364 #define RTL_REGISTRY_USER 5
2365 
2366 #define RTL_REGISTRY_HANDLE 0x40000000
2367 #define RTL_REGISTRY_OPTIONAL 0x80000000
2368 
2369 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
2370 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
2371 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
2372 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
2373 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
2374 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
2375 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
2376 #define RTL_QUERY_REGISTRY_TYPECHECK 0x00000100
2377 
2378 #define RTL_QUERY_REGISTRY_TYPECHECK_SHIFT 24
2379 
2381  ULONG ValueType,
2382  PVOID ValueData,
2383  ULONG ValueLength,
2384  PVOID Context,
2385  PVOID EntryContext);
2386 
2388 {
2397 
2399 {
2405 
2407 
2409 
2413 
2418 
2422 
2427 
2429 {
2433 
2439 
2453  union
2454  {
2456  struct
2457  {
2464  } DUMMYSTRUCTNAME;
2465  } DUMMYUNIONNAME;
2470 
2471 typedef struct _LPC_SECTION_WRITE {
2479 
2480 typedef struct _LPC_SECTION_READ {
2485 
2486 typedef struct _LPC_MESSAGE {
2496 
2498 {
2505 
2506 typedef enum _SHUTDOWN_ACTION {
2511 
2513 {
2516  union
2517  {
2518  struct
2519  {
2524  } DUMMYSTRUCTNAME;
2526  } DUMMYUNIONNAME;
2528 
2529 typedef enum _KPROFILE_SOURCE {
2556 
2561 
2562 typedef struct _INITIAL_TEB {
2565  void *StackBase;
2566  void *StackLimit;
2569 
2573 
2577 
2582 
2583 #define IO_COMPLETION_QUERY_STATE 0x0001
2584 #define IO_COMPLETION_MODIFY_STATE 0x0002
2585 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2586 
2592 
2602 
2603 typedef enum _HARDERROR_RESPONSE {
2612  ResponseYes
2614 
2615 typedef enum _SYSDBG_COMMAND {
2637 
2638 typedef struct _CPTABLEINFO
2639 {
2653 
2654 typedef struct _NLSTABLEINFO
2655 {
2661 
2662 /*************************************************************************
2663  * Loader structures
2664  *
2665  * Those are not part of standard Winternl.h
2666  */
2667 
2669 {
2673 
2674 typedef struct _LDRP_CSLIST
2675 {
2678 
2679 typedef enum _LDR_DDAG_STATE
2680 {
2697 
2698 typedef struct _LDR_DDAG_NODE
2699 {
2705  union
2706  {
2709  };
2716 
2718 {
2726  LoadReasonUnknown = -1
2728 
2730 {
2734  void* DllBase;
2735  void* EntryPoint;
2746  void* Lock;
2749  struct _LDRP_LOAD_CONTEXT *LoadContext;
2761 
2763 {
2767  void *DllBase;
2770 
2772 {
2776  void *DllBase;
2779 
2781 {
2785 
2787 
2788 /* those defines are (some of the) regular LDR_DATA_TABLE_ENTRY.Flags values */
2789 #define LDR_IMAGE_IS_DLL 0x00000004
2790 #define LDR_LOAD_IN_PROGRESS 0x00001000
2791 #define LDR_UNLOAD_IN_PROGRESS 0x00002000
2792 #define LDR_NO_DLL_CALLS 0x00040000
2793 #define LDR_PROCESS_ATTACHED 0x00080000
2794 #define LDR_COR_IMAGE 0x00400000
2795 #define LDR_COR_ILONLY 0x01000000
2796 
2797 /* these ones is Wine specific */
2798 #define LDR_DONT_RESOLVE_REFS 0x40000000
2799 #define LDR_WINE_INTERNAL 0x80000000
2800 
2801 /* flag for LdrAddRefDll */
2802 #define LDR_ADDREF_DLL_PIN 0x00000001
2803 
2804 #define LDR_DLL_NOTIFICATION_REASON_LOADED 1
2805 #define LDR_DLL_NOTIFICATION_REASON_UNLOADED 2
2806 
2807 /* FIXME: to be checked */
2808 #define MAXIMUM_FILENAME_LENGTH 256
2809 
2810 typedef struct _SYSTEM_MODULE
2811 {
2812  PVOID Section; /* 00/00 */
2815  ULONG ImageSize; /* 0c/18 */
2816  ULONG Flags; /* 10/1c */
2817  WORD LoadOrderIndex; /* 14/20 */
2818  WORD InitOrderIndex; /* 16/22 */
2819  WORD LoadCount; /* 18/24 */
2820  WORD NameOffset; /* 1a/26 */
2823 
2825 {
2827  SYSTEM_MODULE Modules[1]; /* FIXME: should be Modules[0] */
2829 
2830 #define PROCESS_CREATE_FLAGS_BREAKAWAY 0x00000001
2831 #define PROCESS_CREATE_FLAGS_NO_DEBUG_INHERIT 0x00000002
2832 #define PROCESS_CREATE_FLAGS_INHERIT_HANDLES 0x00000004
2833 #define PROCESS_CREATE_FLAGS_OVERRIDE_ADDRESS_SPACE 0x00000008
2834 #define PROCESS_CREATE_FLAGS_LARGE_PAGES 0x00000010
2835 #define PROCESS_CREATE_FLAGS_LARGE_PAGE_SYSTEM_DLL 0x00000020
2836 #define PROCESS_CREATE_FLAGS_PROTECTED_PROCESS 0x00000040
2837 #define PROCESS_CREATE_FLAGS_CREATE_SESSION 0x00000080
2838 #define PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT 0x00000100
2839 #define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200
2840 #define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400
2841 
2843 {
2850 
2851 #define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
2852 #define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002
2853 #define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
2854 #define THREAD_CREATE_FLAGS_HAS_SECURITY_DESCRIPTOR 0x00000010
2855 #define THREAD_CREATE_FLAGS_ACCESS_CHECK_IN_TARGET 0x00000020
2856 #define THREAD_CREATE_FLAGS_INITIAL_THREAD 0x00000080
2857 
2859 
2861 
2862 #define PS_ATTRIBUTE_THREAD 0x00010000
2863 #define PS_ATTRIBUTE_INPUT 0x00020000
2864 #define PS_ATTRIBUTE_ADDITIVE 0x00040000
2865 
2866 typedef enum _PS_ATTRIBUTE_NUM
2867 {
2897 
2898 #define PS_ATTRIBUTE_PARENT_PROCESS (PsAttributeParentProcess | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
2899 #define PS_ATTRIBUTE_DEBUG_PORT (PsAttributeDebugPort | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
2900 #define PS_ATTRIBUTE_TOKEN (PsAttributeToken | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_ADDITIVE)
2901 #define PS_ATTRIBUTE_CLIENT_ID (PsAttributeClientId | PS_ATTRIBUTE_THREAD)
2902 #define PS_ATTRIBUTE_TEB_ADDRESS (PsAttributeTebAddress | PS_ATTRIBUTE_THREAD)
2903 #define PS_ATTRIBUTE_IMAGE_NAME (PsAttributeImageName | PS_ATTRIBUTE_INPUT)
2904 #define PS_ATTRIBUTE_IMAGE_INFO (PsAttributeImageInfo)
2905 #define PS_ATTRIBUTE_MEMORY_RESERVE (PsAttributeMemoryReserve | PS_ATTRIBUTE_INPUT)
2906 #define PS_ATTRIBUTE_PRIORITY_CLASS (PsAttributePriorityClass | PS_ATTRIBUTE_INPUT)
2907 #define PS_ATTRIBUTE_ERROR_MODE (PsAttributeErrorMode | PS_ATTRIBUTE_INPUT)
2908 #define PS_ATTRIBUTE_STD_HANDLE_INFO (PsAttributeStdHandleInfo | PS_ATTRIBUTE_INPUT)
2909 #define PS_ATTRIBUTE_HANDLE_LIST (PsAttributeHandleList | PS_ATTRIBUTE_INPUT)
2910 #define PS_ATTRIBUTE_GROUP_AFFINITY (PsAttributeGroupAffinity | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
2911 #define PS_ATTRIBUTE_PREFERRED_NODE (PsAttributePreferredNode | PS_ATTRIBUTE_INPUT)
2912 #define PS_ATTRIBUTE_IDEAL_PROCESSOR (PsAttributeIdealProcessor | PS_ATTRIBUTE_THREAD | PS_ATTRIBUTE_INPUT)
2913 #define PS_ATTRIBUTE_MITIGATION_OPTIONS (PsAttributeMitigationOptions | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_UNKNOWN)
2914 #define PS_ATTRIBUTE_PROTECTION_LEVEL (PsAttributeProtectionLevel | PS_ATTRIBUTE_INPUT | PS_ATTRIBUTE_UNKNOWN)
2915 #define PS_ATTRIBUTE_SECURE_PROCESS (PsAttributeSecureProcess | PS_ATTRIBUTE_INPUT)
2916 #define PS_ATTRIBUTE_JOB_LIST (PsAttributeJobList | PS_ATTRIBUTE_INPUT)
2917 #define PS_ATTRIBUTE_CHILD_PROCESS_POLICY (PsAttributeChildProcessPolicy | PS_ATTRIBUTE_INPUT)
2918 #define PS_ATTRIBUTE_ALL_APPLICATION_PACKAGES_POLICY (PsAttributeAllApplicationPackagesPolicy | PS_ATTRIBUTE_INPUT)
2919 #define PS_ATTRIBUTE_WIN32K_FILTER (PsAttributeWin32kFilter | PS_ATTRIBUTE_INPUT)
2920 #define PS_ATTRIBUTE_SAFE_OPEN_PROMPT_ORIGIN_CLAIM (PsAttributeSafeOpenPromptOriginClaim | PS_ATTRIBUTE_INPUT)
2921 #define PS_ATTRIBUTE_BNO_ISOLATION (PsAttributeBnoIsolation | PS_ATTRIBUTE_INPUT)
2922 #define PS_ATTRIBUTE_DESKTOP_APP_POLICY (PsAttributeDesktopAppPolicy | PS_ATTRIBUTE_INPUT)
2923 
2924 typedef struct _PS_ATTRIBUTE
2925 {
2928  union
2929  {
2931  void *ValuePtr;
2932  };
2935 
2936 typedef struct _PS_ATTRIBUTE_LIST
2937 {
2941 
2942 typedef enum _PS_CREATE_STATE
2943 {
2953 
2954 typedef struct _PS_CREATE_INFO
2955 {
2958  union
2959  {
2960  struct
2961  {
2962  union
2963  {
2965  struct
2966  {
2974  };
2975  };
2978  struct
2979  {
2982  struct
2983  {
2986  struct
2987  {
2990  struct
2991  {
2992  union
2993  {
2995  struct
2996  {
3002  UCHAR SpareBits1 : 3;
3003  UCHAR SpareBits2 : 8;
3005  };
3006  };
3017  };
3019 
3020 /***********************************************************************
3021  * Function declarations
3022  */
3023 
3026 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
3028 NTSYSAPI void WINAPI DbgUiRemoteBreakin(void*);
3051 NTSYSAPI void WINAPI LdrShutdownThread(void);
3159