"Fossies" - the Fresh Open Source Software Archive

Member "wine-6.0.1/include/winternl.h" (7 Jun 2021, 177078 Bytes) of package /linux/misc/wine-6.0.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "winternl.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.0_vs_6.0.1.

    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;
   50   USHORT MaximumLength;
   51   PCHAR Buffer;
   52 } STRING, *PSTRING;
   53 #endif
   54 
   55 typedef STRING ANSI_STRING;
   56 typedef PSTRING PANSI_STRING;
   57 typedef const STRING *PCANSI_STRING;
   58 
   59 typedef STRING OEM_STRING;
   60 typedef PSTRING POEM_STRING;
   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;
   69 } UNICODE_STRING, *PUNICODE_STRING;
   70 #endif
   71 
   72 typedef const UNICODE_STRING *PCUNICODE_STRING;
   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
   80   DWORD  dwHighDateTime;
   81   DWORD  dwLowDateTime;
   82 #else
   83   DWORD  dwLowDateTime;
   84   DWORD  dwHighDateTime;
   85 #endif
   86 } FILETIME, *PFILETIME, *LPFILETIME;
   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 {
   98     WORD wYear;
   99     WORD wMonth;
  100     WORD wDayOfWeek;
  101     WORD wDay;
  102     WORD wHour;
  103     WORD wMinute;
  104     WORD wSecond;
  105     WORD wMilliseconds;
  106 } RTL_SYSTEM_TIME, *PRTL_SYSTEM_TIME;
  107 
  108 typedef struct _RTL_TIME_ZONE_INFORMATION {
  109     LONG Bias;
  110     WCHAR StandardName[32];
  111     RTL_SYSTEM_TIME StandardDate;
  112     LONG StandardBias;
  113     WCHAR DaylightName[32];
  114     RTL_SYSTEM_TIME DaylightDate;
  115     LONG DaylightBias;
  116 } RTL_TIME_ZONE_INFORMATION, *PRTL_TIME_ZONE_INFORMATION;
  117 
  118 typedef struct _RTL_TIME_DYNAMIC_ZONE_INFORMATION
  119 {
  120     LONG Bias;
  121     WCHAR StandardName[32];
  122     RTL_SYSTEM_TIME StandardDate;
  123     LONG StandardBias;
  124     WCHAR DaylightName[32];
  125     RTL_SYSTEM_TIME DaylightDate;
  126     LONG DaylightBias;
  127     WCHAR TimeZoneKeyName[128];
  128     BOOLEAN DynamicDaylightTimeDisabled;
  129 } RTL_DYNAMIC_TIME_ZONE_INFORMATION, *PRTL_DYNAMIC_TIME_ZONE_INFORMATION;
  130 
  131 typedef struct _CLIENT_ID
  132 {
  133    HANDLE UniqueProcess;
  134    HANDLE UniqueThread;
  135 } CLIENT_ID, *PCLIENT_ID;
  136 
  137 typedef struct _CURDIR
  138 {
  139     UNICODE_STRING DosPath;
  140     PVOID Handle;
  141 } CURDIR, *PCURDIR;
  142 
  143 typedef struct RTL_DRIVE_LETTER_CURDIR
  144 {
  145     USHORT              Flags;
  146     USHORT              Length;
  147     ULONG               TimeStamp;
  148     UNICODE_STRING      DosPath;
  149 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
  150 
  151 typedef struct _RTL_RELATIVE_NAME
  152 {
  153     UNICODE_STRING RelativeName;
  154     HANDLE         ContainerDirectory;
  155     void          *CurDirRef;
  156 } RTL_RELATIVE_NAME, *PRTL_RELATIVE_NAME;
  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 */
  161 } RTL_BITMAP, *PRTL_BITMAP;
  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 */
  168 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
  169 
  170 typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
  171 
  172 typedef struct _RTL_USER_PROCESS_PARAMETERS
  173 {
  174     ULONG               AllocationSize;
  175     ULONG               Size;
  176     ULONG               Flags;
  177     ULONG               DebugFlags;
  178     HANDLE              ConsoleHandle;
  179     ULONG               ConsoleFlags;
  180     HANDLE              hStdInput;
  181     HANDLE              hStdOutput;
  182     HANDLE              hStdError;
  183     CURDIR              CurrentDirectory;
  184     UNICODE_STRING      DllPath;
  185     UNICODE_STRING      ImagePathName;
  186     UNICODE_STRING      CommandLine;
  187     PWSTR               Environment;
  188     ULONG               dwX;
  189     ULONG               dwY;
  190     ULONG               dwXSize;
  191     ULONG               dwYSize;
  192     ULONG               dwXCountChars;
  193     ULONG               dwYCountChars;
  194     ULONG               dwFillAttribute;
  195     ULONG               dwFlags;
  196     ULONG               wShowWindow;
  197     UNICODE_STRING      WindowTitle;
  198     UNICODE_STRING      Desktop;
  199     UNICODE_STRING      ShellInfo;
  200     UNICODE_STRING      RuntimeInfo;
  201     RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
  202 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
  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 {
  209     ULONG               Length;
  210     BOOLEAN             Initialized;
  211     PVOID               SsHandle;
  212     LIST_ENTRY          InLoadOrderModuleList;
  213     LIST_ENTRY          InMemoryOrderModuleList;
  214     LIST_ENTRY          InInitializationOrderModuleList;
  215     PVOID               EntryInProgress;
  216     BOOLEAN             ShutdownInProgress;
  217     HANDLE              ShutdownThreadId;
  218 } PEB_LDR_DATA, *PPEB_LDR_DATA;
  219 
  220 typedef struct _GDI_TEB_BATCH
  221 {
  222     ULONG  Offset;
  223     HANDLE HDC;
  224     ULONG  Buffer[0x136];
  225 } GDI_TEB_BATCH;
  226 
  227 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
  228 {
  229     struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
  230     struct _ACTIVATION_CONTEXT                 *ActivationContext;
  231     ULONG                                       Flags;
  232 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
  233 
  234 typedef struct _ACTIVATION_CONTEXT_STACK
  235 {
  236     RTL_ACTIVATION_CONTEXT_STACK_FRAME *ActiveFrame;
  237     LIST_ENTRY                          FrameListCache;
  238     ULONG                               Flags;
  239     ULONG                               NextCookieSequenceNumber;
  240     ULONG_PTR                           StackId;
  241 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
  242 
  243 typedef struct _TEB_ACTIVE_FRAME_CONTEXT
  244 {
  245     ULONG       Flags;
  246     const char *FrameName;
  247 } TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT;
  248 
  249 typedef struct _TEB_ACTIVE_FRAME_CONTEXT_EX
  250 {
  251     TEB_ACTIVE_FRAME_CONTEXT BasicContext;
  252     const char              *SourceLocation;
  253 } TEB_ACTIVE_FRAME_CONTEXT_EX, *PTEB_ACTIVE_FRAME_CONTEXT_EX;
  254 
  255 typedef struct _TEB_ACTIVE_FRAME
  256 {
  257     ULONG                     Flags;
  258     struct _TEB_ACTIVE_FRAME *Previous;
  259     TEB_ACTIVE_FRAME_CONTEXT *Context;
  260 } TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME;
  261 
  262 typedef struct _TEB_ACTIVE_FRAME_EX
  263 {
  264     TEB_ACTIVE_FRAME BasicFrame;
  265     void            *ExtensionIdentifier;
  266 } TEB_ACTIVE_FRAME_EX, *PTEB_ACTIVE_FRAME_EX;
  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. */
  272 } FLS_CALLBACK, *PFLS_CALLBACK;
  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. */
  279 } FLS_INFO_CHUNK, *PFLS_INFO_CHUNK;
  280 
  281 typedef struct _GLOBAL_FLS_DATA
  282 {
  283     FLS_INFO_CHUNK *fls_callback_chunks[8];
  284     LIST_ENTRY      fls_list_head;
  285     ULONG           fls_high_index;
  286 } GLOBAL_FLS_DATA, *PGLOBAL_FLS_DATA;
  287 
  288 typedef struct _TEB_FLS_DATA
  289 {
  290     LIST_ENTRY      fls_list_entry;
  291     void          **fls_data_chunks[8];
  292 } TEB_FLS_DATA, *PTEB_FLS_DATA;
  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 */
  302     BOOLEAN                      InheritedAddressSpace;             /* 000/000 */
  303     BOOLEAN                      ReadImageFileExecOptions;          /* 001/001 */
  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 */
  309     RTL_USER_PROCESS_PARAMETERS *ProcessParameters;                 /* 010/020 */
  310     PVOID                        SubSystemData;                     /* 014/028 */
  311     HANDLE                       ProcessHeap;                       /* 018/030 */
  312     PRTL_CRITICAL_SECTION        FastPebLock;                       /* 01c/038 */
  313     PVOID /*PPEBLOCKROUTINE*/    FastPebLockRoutine;                /* 020/040 */
  314     PVOID /*PPEBLOCKROUTINE*/    FastPebUnlockRoutine;              /* 024/048 */
  315     ULONG                        EnvironmentUpdateCount;            /* 028/050 */
  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 */
  323     PVOID                        ReadOnlySharedMemoryBase;          /* 04c/088 */
  324     PVOID                        ReadOnlySharedMemoryHeap;          /* 050/090 */
  325     PVOID                       *ReadOnlyStaticServerData;          /* 054/098 */
  326     PVOID                        AnsiCodePageData;                  /* 058/0a0 */
  327     PVOID                        OemCodePageData;                   /* 05c/0a8 */
  328     PVOID                        UnicodeCaseTableData;              /* 060/0b0 */
  329     ULONG                        NumberOfProcessors;                /* 064/0b8 */
  330     ULONG                        NtGlobalFlag;                      /* 068/0bc */
  331     LARGE_INTEGER                CriticalSectionTimeout;            /* 070/0c0 */
  332     SIZE_T                       HeapSegmentReserve;                /* 078/0c8 */
  333     SIZE_T                       HeapSegmentCommit;                 /* 07c/0d0 */
  334     SIZE_T                       HeapDeCommitTotalFreeThreshold;    /* 080/0d8 */
  335     SIZE_T                       HeapDeCommitFreeBlockThreshold;    /* 084/0e0 */
  336     ULONG                        NumberOfHeaps;                     /* 088/0e8 */
  337     ULONG                        MaximumNumberOfHeaps;              /* 08c/0ec */
  338     PVOID                       *ProcessHeaps;                      /* 090/0f0 */
  339     PVOID                        GdiSharedHandleTable;              /* 094/0f8 */
  340     PVOID                        ProcessStarterHelper;              /* 098/100 */
  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 */
  348     ULONG                        ImageSubSystemMajorVersion;        /* 0b8/12c */
  349     ULONG                        ImageSubSystemMinorVersion;        /* 0bc/130 */
  350     ULONG                        ImageProcessAffinityMask;          /* 0c0/134 */
  351     HANDLE                       GdiHandleBuffer[28];               /* 0c4/138 */
  352     ULONG                        unknown[6];                        /* 134/218 */
  353     PVOID                        PostProcessInitRoutine;            /* 14c/230 */
  354     PRTL_BITMAP                  TlsExpansionBitmap;                /* 150/238 */
  355     ULONG                        TlsExpansionBitmapBits[32];        /* 154/240 */
  356     ULONG                        SessionId;                         /* 1d4/2c0 */
  357     ULARGE_INTEGER               AppCompatFlags;                    /* 1d8/2c8 */
  358     ULARGE_INTEGER               AppCompatFlagsUser;                /* 1e0/2d0 */
  359     PVOID                        ShimData;                          /* 1e8/2d8 */
  360     PVOID                        AppCompatInfo;                     /* 1ec/2e0 */
  361     UNICODE_STRING               CSDVersion;                        /* 1f0/2e8 */
  362     PVOID                        ActivationContextData;             /* 1f8/2f8 */
  363     PVOID                        ProcessAssemblyStorageMap;         /* 1fc/300 */
  364     PVOID                        SystemDefaultActivationData;       /* 200/308 */
  365     PVOID                        SystemAssemblyStorageMap;          /* 204/310 */
  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 */
  377     ULONGLONG                    CsrServerReadOnlySharedMemoryBase; /* 248/380 */
  378     ULONG                        TppWorkerpListLock;                /* 250/388 */
  379     LIST_ENTRY                   TppWorkerpList;                    /* 254/390 */
  380     PVOID                        WaitOnAddressHashTable [0x80];     /* 25c/3a0 */
  381     PVOID                        TelemetryCoverageHeader;           /* 45c/7a0 */
  382     ULONG                        CloudFileFlags;                    /* 460/7a8 */
  383     ULONG                        CloudFileDiagFlags;                /* 464/7ac */
  384     CHAR                         PlaceholderCompatibilityMode;      /* 468/7b0 */
  385     CHAR                         PlaceholderCompatibilityModeReserved[7]; /* 469/7b1 */
  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 */
  401     PVOID                        ThreadLocalStoragePointer;         /* 02c/0058 */
  402     PPEB                         Peb;                               /* 030/0060 */
  403     ULONG                        LastErrorValue;                    /* 034/0068 */
  404     ULONG                        CountOfOwnedCriticalSections;      /* 038/006c */
  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 */
  411     ULONG                        FpSoftwareStatusRegister;          /* 0c8/010c */
  412     PVOID                        ReservedForDebuggerInstrumentation[16]; /* 0cc/0110 */
  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 */
  421     ACTIVATION_CONTEXT_STACK     ActivationContextStack;            /* 184/0290 */
  422     UCHAR                        WorkingOnBehalfOfTicket[8];        /* 19c/02b8 */
  423     LONG                         ExceptionCode;                     /* 1a4/02c0 */
  424     ACTIVATION_CONTEXT_STACK    *ActivationContextStackPointer;     /* 1a8/02c8 */
  425     ULONG_PTR                    InstrumentationCallbackSp;         /* 1ac/02d0 */
  426     ULONG_PTR                    InstrumentationCallbackPreviousPc; /* 1b0/02d8 */
  427     ULONG_PTR                    InstrumentationCallbackPreviousSp; /* 1b4/02e0 */
  428 #ifdef _WIN64
  429     ULONG                        TxFsContext;                       /*    /02e8 */
  430     BOOLEAN                      InstrumentationCallbackDisabled;   /*    /02ec */
  431 #else
  432     BOOLEAN                      InstrumentationCallbackDisabled;   /* 1b8/     */
  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 */
  438     HANDLE                       GdiCachedProcessHandle;            /* 6bc/07e8 */
  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 */
  452     UNICODE_STRING               StaticUnicodeString;               /* bf8/1258 */
  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 */
  480     PVOID                        CurrentTransactionHandle;          /* fac/17b8 */
  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 */
  513     ULONG64 ArbitraryUserPointer; /* 0028 */
  514     ULONG64 Self;                 /* 0030 */
  515 } NT_TIB64;
  516 
  517 typedef struct _CLIENT_ID64
  518 {
  519    ULONG64 UniqueProcess;
  520    ULONG64 UniqueThread;
  521 } CLIENT_ID64;
  522 
  523 typedef struct _LIST_ENTRY64
  524 {
  525   ULONG64 Flink;
  526   ULONG64 Blink;
  527 } LIST_ENTRY64;
  528 
  529 typedef struct _UNICODE_STRING64
  530 {
  531   USHORT  Length;
  532   USHORT  MaximumLength;
  533   ULONG64 Buffer;
  534 } UNICODE_STRING64;
  535 
  536 typedef struct _ACTIVATION_CONTEXT_STACK64
  537 {
  538     ULONG64      ActiveFrame;
  539     LIST_ENTRY64 FrameListCache;
  540     ULONG        Flags;
  541     ULONG        NextCookieSequenceNumber;
  542     ULONG64      StackId;
  543 } ACTIVATION_CONTEXT_STACK64;
  544 
  545 typedef struct _PEB64
  546 {
  547     BOOLEAN                      InheritedAddressSpace;             /* 0000 */
  548     BOOLEAN                      ReadImageFileExecOptions;          /* 0001 */
  549     BOOLEAN                      BeingDebugged;                     /* 0002 */
  550     BOOLEAN                      SpareBool;                         /* 0003 */
  551     ULONG64                      Mutant;                            /* 0008 */
  552     ULONG64                      ImageBaseAddress;                  /* 0010 */
  553     ULONG64                      LdrData;                           /* 0018 */
  554     ULONG64                      ProcessParameters;                 /* 0020 */
  555     ULONG64                      SubSystemData;                     /* 0028 */
  556     ULONG64                      ProcessHeap;                       /* 0030 */
  557     ULONG64                      FastPebLock;                       /* 0038 */
  558     ULONG64                      FastPebLockRoutine;                /* 0040 */
  559     ULONG64                      FastPebUnlockRoutine;              /* 0048 */
  560     ULONG                        EnvironmentUpdateCount;            /* 0050 */
  561     ULONG64                      KernelCallbackTable;               /* 0058 */
  562     ULONG                        Reserved;                          /* 0060 */
  563     ULONG                        AtlThunkSListPtr32;                /* 0064 */
  564     ULONG64                      FreeList;                          /* 0068 */
  565     ULONG                        TlsExpansionCounter;               /* 0070 */
  566     ULONG64                      TlsBitmap;                         /* 0078 */
  567     ULONG                        TlsBitmapBits[2];                  /* 0080 */
  568     ULONG64                      ReadOnlySharedMemoryBase;          /* 0088 */
  569     ULONG64                      ReadOnlySharedMemoryHeap;          /* 0090 */
  570     ULONG64                      ReadOnlyStaticServerData;          /* 0098 */
  571     ULONG64                      AnsiCodePageData;                  /* 00a0 */
  572     ULONG64                      OemCodePageData;                   /* 00a8 */
  573     ULONG64                      UnicodeCaseTableData;              /* 00b0 */
  574     ULONG                        NumberOfProcessors;                /* 00b8 */
  575     ULONG                        NtGlobalFlag;                      /* 00bc */
  576     LARGE_INTEGER                CriticalSectionTimeout;            /* 00c0 */
  577     ULONG64                      HeapSegmentReserve;                /* 00c8 */
  578     ULONG64                      HeapSegmentCommit;                 /* 00d0 */
  579     ULONG64                      HeapDeCommitTotalFreeThreshold;    /* 00d8 */
  580     ULONG64                      HeapDeCommitFreeBlockThreshold;    /* 00e0 */
  581     ULONG                        NumberOfHeaps;                     /* 00e8 */
  582     ULONG                        MaximumNumberOfHeaps;              /* 00ec */
  583     ULONG64                      ProcessHeaps;                      /* 00f0 */
  584     ULONG64                      GdiSharedHandleTable;              /* 00f8 */
  585     ULONG64                      ProcessStarterHelper;              /* 0100 */
  586     ULONG64                      GdiDCAttributeList;                /* 0108 */
  587     ULONG64                      LoaderLock;                        /* 0110 */
  588     ULONG                        OSMajorVersion;                    /* 0118 */
  589     ULONG                        OSMinorVersion;                    /* 011c */
  590     ULONG                        OSBuildNumber;                     /* 0120 */
  591     ULONG                        OSPlatformId;                      /* 0124 */
  592     ULONG                        ImageSubSystem;                    /* 0128 */
  593     ULONG                        ImageSubSystemMajorVersion;        /* 012c */
  594     ULONG                        ImageSubSystemMinorVersion;        /* 0130 */
  595     ULONG                        ImageProcessAffinityMask;          /* 0134 */
  596     ULONG64                      GdiHandleBuffer[28];               /* 0138 */
  597     ULONG                        unknown[6];                        /* 0218 */
  598     ULONG64                      PostProcessInitRoutine;            /* 0230 */
  599     ULONG64                      TlsExpansionBitmap;                /* 0238 */
  600     ULONG                        TlsExpansionBitmapBits[32];        /* 0240 */
  601     ULONG                        SessionId;                         /* 02c0 */
  602     ULARGE_INTEGER               AppCompatFlags;                    /* 02c8 */
  603     ULARGE_INTEGER               AppCompatFlagsUser;                /* 02d0 */
  604     ULONG64                      ShimData;                          /* 02d8 */
  605     ULONG64                      AppCompatInfo;                     /* 02e0 */
  606     UNICODE_STRING64             CSDVersion;                        /* 02e8 */
  607     ULONG64                      ActivationContextData;             /* 02f8 */
  608     ULONG64                      ProcessAssemblyStorageMap;         /* 0300 */
  609     ULONG64                      SystemDefaultActivationData;       /* 0308 */
  610     ULONG64                      SystemAssemblyStorageMap;          /* 0310 */
  611     ULONG64                      MinimumStackCommit;                /* 0318 */
  612     ULONG64                      FlsCallback;                       /* 0320 */
  613     LIST_ENTRY64                 FlsListHead;                       /* 0328 */
  614     ULONG64                      FlsBitmap;                         /* 0338 */
  615     ULONG                        FlsBitmapBits[4];                  /* 0340 */
  616     ULONG                        FlsHighIndex;                      /* 0350 */
  617     ULONG64                      WerRegistrationData;               /* 0358 */
  618     ULONG64                      WerShipAssertPtr;                  /* 0360 */
  619     ULONG64                      pUnused;                           /* 0368 */
  620     ULONG64                      pImageHeaderHash;                  /* 0370 */
  621     ULONG                        TracingFlags;                      /* 0378 */
  622     ULONGLONG                    CsrServerReadOnlySharedMemoryBase; /* 0380 */
  623     ULONG                        TppWorkerpListLock;                /* 0388 */
  624     LIST_ENTRY64                 TppWorkerpList;                    /* 0390 */
  625     ULONG64                      WaitOnAddressHashTable [0x80];     /* 03a0 */
  626     ULONG64                      TelemetryCoverageHeader;           /* 07a0 */
  627     ULONG                        CloudFileFlags;                    /* 07a8 */
  628     ULONG                        CloudFileDiagFlags;                /* 07ac */
  629     CHAR                         PlaceholderCompatibilityMode;      /* 07b0 */
  630     CHAR                         PlaceholderCompatibilityModeReserved[7]; /* 07b1 */
  631     ULONG64                      LeapSecondData;                    /* 07b8 */
  632     ULONG                        LeapSecondFlags;                   /* 07c0 */
  633     ULONG                        NtGlobalFlag2;                     /* 07c4 */
  634 } PEB64;
  635 
  636 typedef struct _TEB64
  637 {
  638     NT_TIB64                     Tib;                               /* 0000 */
  639     ULONG64                      EnvironmentPointer;                /* 0038 */
  640     CLIENT_ID64                  ClientId;                          /* 0040 */
  641     ULONG64                      ActiveRpcHandle;                   /* 0050 */
  642     ULONG64                      ThreadLocalStoragePointer;         /* 0058 */
  643     ULONG64                      Peb;                               /* 0060 */
  644     ULONG                        LastErrorValue;                    /* 0068 */
  645     ULONG                        CountOfOwnedCriticalSections;      /* 006c */
  646     ULONG64                      CsrClientThread;                   /* 0070 */
  647     ULONG64                      Win32ThreadInfo;                   /* 0078 */
  648     ULONG                        User32Reserved[26];                /* 0080 */
  649     ULONG                        UserReserved[5];                   /* 00e8 */
  650     ULONG64                      WOW32Reserved;                     /* 0100 */
  651     ULONG                        CurrentLocale;                     /* 0108 */
  652     ULONG                        FpSoftwareStatusRegister;          /* 010c */
  653     ULONG64                      ReservedForDebuggerInstrumentation[16]; /* 0110 */
  654     ULONG64                      SystemReserved1[30];               /* 0190 */
  655     char                         PlaceholderCompatibilityMode;      /* 0280 */
  656     char                         PlaceholderReserved[11];           /* 0281 */
  657     DWORD                        ProxiedProcessId;                  /* 028c */
  658     ACTIVATION_CONTEXT_STACK64   ActivationContextStack;            /* 0290 */
  659     UCHAR                        WorkingOnBehalfOfTicket[8];        /* 02b8 */
  660     LONG                         ExceptionCode;                     /* 02c0 */
  661     ULONG64                      ActivationContextStackPointer;     /* 02c8 */
  662     ULONG64                      InstrumentationCallbackSp;         /* 02d0 */
  663     ULONG64                      InstrumentationCallbackPreviousPc; /* 02d8 */
  664     ULONG64                      InstrumentationCallbackPreviousSp; /* 02e0 */
  665     ULONG                        TxFsContext;                       /* 02e8 */
  666     BOOLEAN                      InstrumentationCallbackDisabled;   /* 02ec */
  667     ULONG64                      GdiTebBatch[0x9d];                 /* 02f0 */
  668     CLIENT_ID64                  RealClientId;                      /* 07d8 */
  669     ULONG64                      GdiCachedProcessHandle;            /* 07e8 */
  670     ULONG                        GdiClientPID;                      /* 07f0 */
  671     ULONG                        GdiClientTID;                      /* 07f4 */
  672     ULONG64                      GdiThreadLocaleInfo;               /* 07f8 */
  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 */
  683     UNICODE_STRING64             StaticUnicodeString;               /* 1258 */
  684     WCHAR                        StaticUnicodeBuffer[261];          /* 1268 */
  685     ULONG64                      DeallocationStack;                 /* 1478 */
  686     ULONG64                      TlsSlots[64];                      /* 1480 */
  687     LIST_ENTRY64                 TlsLinks;                          /* 1680 */
  688     ULONG64                      Vdm;                               /* 1690 */
  689     ULONG64                      ReservedForNtRpc;                  /* 1698 */
  690     ULONG64                      DbgSsReserved[2];                  /* 16a0 */
  691     ULONG                        HardErrorDisabled;                 /* 16b0 */
  692     ULONG64                      Instrumentation[16];               /* 16b8 */
  693     ULONG64                      WinSockData;                       /* 1738 */
  694     ULONG                        GdiBatchCount;                     /* 1740 */
  695     ULONG                        Spare2;                            /* 1744 */
  696     ULONG                        GuaranteedStackBytes;              /* 1748 */
  697     ULONG64                      ReservedForPerf;                   /* 1750 */
  698     ULONG64                      ReservedForOle;                    /* 1758 */
  699     ULONG                        WaitingOnLoaderLock;               /* 1760 */
  700     ULONG64                      Reserved5[3];                      /* 1768 */
  701     ULONG64                      TlsExpansionSlots;                 /* 1780 */
  702     ULONG64                      DeallocationBStore;                /* 1788 */
  703     ULONG64                      BStoreLimit;                       /* 1790 */
  704     ULONG                        ImpersonationLocale;               /* 1798 */
  705     ULONG                        IsImpersonating;                   /* 179c */
  706     ULONG64                      NlsCache;                          /* 17a0 */
  707     ULONG64                      ShimData;                          /* 17a8 */
  708     ULONG                        HeapVirtualAffinity;               /* 17b0 */
  709     ULONG64                      CurrentTransactionHandle;          /* 17b8 */
  710     ULONG64                      ActiveFrame;                       /* 17c0 */
  711     ULONG64                      FlsSlots;                          /* 17c8 */
  712     ULONG64                      PreferredLanguages;                /* 17d0 */
  713     ULONG64                      UserPrefLanguages;                 /* 17d8 */
  714     ULONG64                      MergedPrefLanguages;               /* 17e0 */
  715     ULONG                        MuiImpersonation;                  /* 17e8 */
  716     USHORT                       CrossTebFlags;                     /* 17ec */
  717     USHORT                       SameTebFlags;                      /* 17ee */
  718     ULONG64                      TxnScopeEnterCallback;             /* 17f0 */
  719     ULONG64                      TxnScopeExitCallback;              /* 17f8 */
  720     ULONG64                      TxnScopeContext;                   /* 1800 */
  721     ULONG                        LockCount;                         /* 1808 */
  722     LONG                         WowTebOffset;                      /* 180c */
  723     ULONG64                      ResourceRetValue;                  /* 1810 */
  724     ULONG64                      ReservedForWdf;                    /* 1818 */
  725     ULONGLONG                    ReservedForCrt;                    /* 1820 */
  726     GUID                         EffectiveContainerId;              /* 1828 */
  727 } TEB64;
  728 
  729 /* reserved TEB64 TLS slots for Wow64 */
  730 #define WOW64_TLS_FILESYSREDIR 8
  731 
  732 #endif  /* _WIN64 */
  733 
  734 /***********************************************************************
  735  * Enums
  736  */
  737 
  738 typedef enum _FILE_INFORMATION_CLASS {
  739     FileDirectoryInformation = 1,
  740     FileFullDirectoryInformation,
  741     FileBothDirectoryInformation,
  742     FileBasicInformation,
  743     FileStandardInformation,
  744     FileInternalInformation,
  745     FileEaInformation,
  746     FileAccessInformation,
  747     FileNameInformation,
  748     FileRenameInformation,
  749     FileLinkInformation,
  750     FileNamesInformation,
  751     FileDispositionInformation,
  752     FilePositionInformation,
  753     FileFullEaInformation,
  754     FileModeInformation,
  755     FileAlignmentInformation,
  756     FileAllInformation,
  757     FileAllocationInformation,
  758     FileEndOfFileInformation,
  759     FileAlternateNameInformation,
  760     FileStreamInformation,
  761     FilePipeInformation,
  762     FilePipeLocalInformation,
  763     FilePipeRemoteInformation,
  764     FileMailslotQueryInformation,
  765     FileMailslotSetInformation,
  766     FileCompressionInformation,
  767     FileObjectIdInformation,
  768     FileCompletionInformation,
  769     FileMoveClusterInformation,
  770     FileQuotaInformation,
  771     FileReparsePointInformation,
  772     FileNetworkOpenInformation,
  773     FileAttributeTagInformation,
  774     FileTrackingInformation,
  775     FileIdBothDirectoryInformation,
  776     FileIdFullDirectoryInformation,
  777     FileValidDataLengthInformation,
  778     FileShortNameInformation,
  779     FileIoCompletionNotificationInformation,
  780     FileIoStatusBlockRangeInformation,
  781     FileIoPriorityHintInformation,
  782     FileSfioReserveInformation,
  783     FileSfioVolumeInformation,
  784     FileHardLinkInformation,
  785     FileProcessIdsUsingFileInformation,
  786     FileNormalizedNameInformation,
  787     FileNetworkPhysicalNameInformation,
  788     FileIdGlobalTxDirectoryInformation,
  789     FileIsRemoteDeviceInformation,
  790     FileAttributeCacheInformation,
  791     FileNumaNodeInformation,
  792     FileStandardLinkInformation,
  793     FileRemoteProtocolInformation,
  794     FileRenameInformationBypassAccessCheck,
  795     FileLinkInformationBypassAccessCheck,
  796     FileVolumeNameInformation,
  797     FileIdInformation,
  798     FileIdExtdDirectoryInformation,
  799     FileReplaceCompletionInformation,
  800     FileHardLinkFullIdInformation,
  801     FileIdExtdBothDirectoryInformation,
  802     FileMaximumInformation
  803 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
  804 
  805 typedef struct _FILE_DIRECTORY_INFORMATION {
  806     ULONG               NextEntryOffset;
  807     ULONG               FileIndex;
  808     LARGE_INTEGER       CreationTime;
  809     LARGE_INTEGER       LastAccessTime;
  810     LARGE_INTEGER       LastWriteTime;
  811     LARGE_INTEGER       ChangeTime;
  812     LARGE_INTEGER       EndOfFile;
  813     LARGE_INTEGER       AllocationSize;
  814     ULONG               FileAttributes;
  815     ULONG               FileNameLength;
  816     WCHAR               FileName[ANYSIZE_ARRAY];
  817 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
  818 
  819 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
  820     ULONG               NextEntryOffset;
  821     ULONG               FileIndex;
  822     LARGE_INTEGER       CreationTime;
  823     LARGE_INTEGER       LastAccessTime;
  824     LARGE_INTEGER       LastWriteTime;
  825     LARGE_INTEGER       ChangeTime;
  826     LARGE_INTEGER       EndOfFile;
  827     LARGE_INTEGER       AllocationSize;
  828     ULONG               FileAttributes;
  829     ULONG               FileNameLength;
  830     ULONG               EaSize;
  831     WCHAR               FileName[ANYSIZE_ARRAY];
  832 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION,
  833   FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
  834 
  835 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION {
  836     ULONG               NextEntryOffset;
  837     ULONG               FileIndex;
  838     LARGE_INTEGER       CreationTime;
  839     LARGE_INTEGER       LastAccessTime;
  840     LARGE_INTEGER       LastWriteTime;
  841     LARGE_INTEGER       ChangeTime;
  842     LARGE_INTEGER       EndOfFile;
  843     LARGE_INTEGER       AllocationSize;
  844     ULONG               FileAttributes;
  845     ULONG               FileNameLength;
  846     ULONG               EaSize;
  847     LARGE_INTEGER       FileId;
  848     WCHAR               FileName[ANYSIZE_ARRAY];
  849 } FILE_ID_FULL_DIRECTORY_INFORMATION, *PFILE_ID_FULL_DIRECTORY_INFORMATION;
  850 
  851 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
  852     ULONG               NextEntryOffset;
  853     ULONG               FileIndex;
  854     LARGE_INTEGER       CreationTime;
  855     LARGE_INTEGER       LastAccessTime;
  856     LARGE_INTEGER       LastWriteTime;
  857     LARGE_INTEGER       ChangeTime;
  858     LARGE_INTEGER       EndOfFile;
  859     LARGE_INTEGER       AllocationSize;
  860     ULONG               FileAttributes;
  861     ULONG               FileNameLength;
  862     ULONG               EaSize;
  863     CHAR                ShortNameLength;
  864     WCHAR               ShortName[12];
  865     WCHAR               FileName[ANYSIZE_ARRAY];
  866 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION,
  867   FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
  868 
  869 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION {
  870     ULONG               NextEntryOffset;
  871     ULONG               FileIndex;
  872     LARGE_INTEGER       CreationTime;
  873     LARGE_INTEGER       LastAccessTime;
  874     LARGE_INTEGER       LastWriteTime;
  875     LARGE_INTEGER       ChangeTime;
  876     LARGE_INTEGER       EndOfFile;
  877     LARGE_INTEGER       AllocationSize;
  878     ULONG               FileAttributes;
  879     ULONG               FileNameLength;
  880     ULONG               EaSize;
  881     CHAR                ShortNameLength;
  882     WCHAR               ShortName[12];
  883     LARGE_INTEGER       FileId;
  884     WCHAR               FileName[ANYSIZE_ARRAY];
  885 } FILE_ID_BOTH_DIRECTORY_INFORMATION, *PFILE_ID_BOTH_DIRECTORY_INFORMATION;
  886 
  887 typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
  888     ULONG               NextEntryOffset;
  889     ULONG               FileIndex;
  890     LARGE_INTEGER       CreationTime;
  891     LARGE_INTEGER       LastAccessTime;
  892     LARGE_INTEGER       LastWriteTime;
  893     LARGE_INTEGER       ChangeTime;
  894     LARGE_INTEGER       EndOfFile;
  895     LARGE_INTEGER       AllocationSize;
  896     ULONG               FileAttributes;
  897     ULONG               FileNameLength;
  898     LARGE_INTEGER       FileId;
  899     GUID                LockingTransactionId;
  900     ULONG               TxInfoFlags;
  901     WCHAR               FileName[ANYSIZE_ARRAY];
  902 } FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
  903 
  904 typedef struct _FILE_BASIC_INFORMATION {
  905     LARGE_INTEGER CreationTime;
  906     LARGE_INTEGER LastAccessTime;
  907     LARGE_INTEGER LastWriteTime;
  908     LARGE_INTEGER ChangeTime;
  909     ULONG FileAttributes;
  910 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
  911 
  912 typedef struct _FILE_STANDARD_INFORMATION {
  913     LARGE_INTEGER AllocationSize;
  914     LARGE_INTEGER EndOfFile;
  915     ULONG NumberOfLinks;
  916     BOOLEAN DeletePending;
  917     BOOLEAN Directory;
  918 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
  919 
  920 typedef struct _FILE_INTERNAL_INFORMATION {
  921     LARGE_INTEGER IndexNumber;
  922 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
  923 
  924 typedef struct _FILE_ID_128 {
  925     UCHAR Identifier[16];
  926 } FILE_ID_128, *PFILE_ID_128;
  927 
  928 typedef struct _FILE_ID_INFORMATION {
  929     ULONGLONG VolumeSerialNumber;
  930     FILE_ID_128 FileId;
  931 } FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
  932 
  933 typedef struct _FILE_EA_INFORMATION {
  934     ULONG EaSize;
  935 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
  936 
  937 typedef struct _FILE_ACCESS_INFORMATION {
  938     ACCESS_MASK AccessFlags;
  939 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
  940 
  941 typedef struct _FILE_NAME_INFORMATION {
  942     ULONG FileNameLength;
  943     WCHAR FileName[1];
  944 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
  945 
  946 typedef struct _FILE_RENAME_INFORMATION {
  947     BOOLEAN ReplaceIfExists;
  948     HANDLE RootDirectory;
  949     ULONG FileNameLength;
  950     WCHAR FileName[1];
  951 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
  952 
  953 typedef struct _FILE_LINK_INFORMATION {
  954     BOOLEAN ReplaceIfExists;
  955     HANDLE RootDirectory;
  956     ULONG FileNameLength;
  957     WCHAR FileName[1];
  958 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
  959 
  960 typedef struct _FILE_NAMES_INFORMATION {
  961     ULONG NextEntryOffset;
  962     ULONG FileIndex;
  963     ULONG FileNameLength;
  964     WCHAR FileName[1];
  965 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
  966 
  967 typedef struct _FILE_DISPOSITION_INFORMATION {
  968     BOOLEAN DoDeleteFile;
  969 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
  970 
  971 typedef struct _FILE_POSITION_INFORMATION {
  972     LARGE_INTEGER CurrentByteOffset;
  973 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
  974 
  975 typedef struct _FILE_ALIGNMENT_INFORMATION {
  976     ULONG AlignmentRequirement;
  977 } FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
  978 
  979 typedef struct _FILE_ALLOCATION_INFORMATION {
  980     LARGE_INTEGER AllocationSize;
  981 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
  982 
  983 typedef struct _FILE_END_OF_FILE_INFORMATION {
  984     LARGE_INTEGER EndOfFile;
  985 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
  986 
  987 typedef struct _FILE_NETWORK_OPEN_INFORMATION {
  988     LARGE_INTEGER CreationTime;
  989     LARGE_INTEGER LastAccessTime;
  990     LARGE_INTEGER LastWriteTime;
  991     LARGE_INTEGER ChangeTime;
  992     LARGE_INTEGER AllocationSize;
  993     LARGE_INTEGER EndOfFile;
  994     ULONG FileAttributes;
  995 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
  996 
  997 typedef struct _FILE_FULL_EA_INFORMATION {
  998     ULONG NextEntryOffset;
  999     UCHAR Flags;
 1000     UCHAR EaNameLength;
 1001     USHORT EaValueLength;
 1002     CHAR EaName[1];
 1003 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
 1004 
 1005 typedef struct _FILE_MODE_INFORMATION {
 1006     ULONG Mode;
 1007 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
 1008 
 1009 typedef struct _FILE_STREAM_INFORMATION
 1010 {
 1011     ULONG NextEntryOffset;
 1012     ULONG StreamNameLength;
 1013     LARGE_INTEGER StreamSize;
 1014     LARGE_INTEGER StreamAllocationSize;
 1015     WCHAR StreamName[1];
 1016 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
 1017 
 1018 typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
 1019 {
 1020     ULONG FileAttributes;
 1021     ULONG ReparseTag;
 1022 } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
 1023 
 1024 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
 1025     ULONG MaximumMessageSize;
 1026     ULONG MailslotQuota;
 1027     ULONG NextMessageSize;
 1028     ULONG MessagesAvailable;
 1029     LARGE_INTEGER ReadTimeout;
 1030 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
 1031 
 1032 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
 1033     LARGE_INTEGER ReadTimeout;
 1034 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
 1035 
 1036 typedef struct _FILE_PIPE_INFORMATION {
 1037     ULONG ReadMode;
 1038     ULONG CompletionMode;
 1039 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
 1040 
 1041 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
 1042     ULONG NamedPipeType;
 1043     ULONG NamedPipeConfiguration;
 1044     ULONG MaximumInstances;
 1045     ULONG CurrentInstances;
 1046     ULONG InboundQuota;
 1047     ULONG ReadDataAvailable;
 1048     ULONG OutboundQuota;
 1049     ULONG WriteQuotaAvailable;
 1050     ULONG NamedPipeState;
 1051     ULONG NamedPipeEnd;
 1052 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
 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 
 1059 typedef struct _FILE_OBJECTID_BUFFER
 1060 {
 1061     BYTE ObjectId[16];
 1062     union
 1063     {
 1064         struct
 1065         {
 1066             BYTE BirthVolumeId[16];
 1067             BYTE BirthObjectId[16];
 1068             BYTE DomainId[16];
 1069         } DUMMYSTRUCTNAME;
 1070         BYTE ExtendedInfo[48];
 1071     } DUMMYUNIONNAME;
 1072 } FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
 1073 
 1074 typedef struct _FILE_OBJECTID_INFORMATION {
 1075     LONGLONG FileReference;
 1076     UCHAR ObjectId[16];
 1077     union {
 1078         struct {
 1079             UCHAR BirthVolumeId[16];
 1080             UCHAR BirthObjectId[16];
 1081             UCHAR DomainId[16];
 1082         } DUMMYSTRUCTNAME;
 1083         UCHAR ExtendedInfo[48];
 1084     } DUMMYUNIONNAME;
 1085 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
 1086 
 1087 typedef struct _FILE_QUOTA_INFORMATION {
 1088     ULONG NextEntryOffset;
 1089     ULONG SidLength;
 1090     LARGE_INTEGER ChangeTime;
 1091     LARGE_INTEGER QuotaUsed;
 1092     LARGE_INTEGER QuotaThreshold;
 1093     LARGE_INTEGER QuotaLimit;
 1094     SID Sid;
 1095 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
 1096 
 1097 typedef struct _FILE_REPARSE_POINT_INFORMATION {
 1098     LONGLONG FileReference;
 1099     ULONG Tag;
 1100 } FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
 1101 
 1102 typedef struct _FILE_ALL_INFORMATION {
 1103     FILE_BASIC_INFORMATION     BasicInformation;
 1104     FILE_STANDARD_INFORMATION  StandardInformation;
 1105     FILE_INTERNAL_INFORMATION  InternalInformation;
 1106     FILE_EA_INFORMATION        EaInformation;
 1107     FILE_ACCESS_INFORMATION    AccessInformation;
 1108     FILE_POSITION_INFORMATION  PositionInformation;
 1109     FILE_MODE_INFORMATION      ModeInformation;
 1110     FILE_ALIGNMENT_INFORMATION AlignmentInformation;
 1111     FILE_NAME_INFORMATION      NameInformation;
 1112 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
 1113 
 1114 typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
 1115     ULONG Flags;
 1116 } FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION;
 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 {
 1123     FileFsVolumeInformation = 1,
 1124     FileFsLabelInformation,
 1125     FileFsSizeInformation,
 1126     FileFsDeviceInformation,
 1127     FileFsAttributeInformation,
 1128     FileFsControlInformation,
 1129     FileFsFullSizeInformation,
 1130     FileFsObjectIdInformation,
 1131     FileFsMaximumInformation
 1132 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
 1133 
 1134 typedef enum _KEY_INFORMATION_CLASS {
 1135     KeyBasicInformation,
 1136     KeyNodeInformation,
 1137     KeyFullInformation,
 1138     KeyNameInformation,
 1139     KeyCachedInformation,
 1140     KeyFlagsInformation,
 1141     KeyVirtualizationInformation,
 1142     KeyHandleTagsInformation,
 1143     MaxKeyInfoClass
 1144 } KEY_INFORMATION_CLASS;
 1145 
 1146 typedef enum _KEY_VALUE_INFORMATION_CLASS {
 1147     KeyValueBasicInformation,
 1148     KeyValueFullInformation,
 1149     KeyValuePartialInformation,
 1150     KeyValueFullInformationAlign64,
 1151     KeyValuePartialInformationAlign64
 1152 } KEY_VALUE_INFORMATION_CLASS;
 1153 
 1154 typedef enum _OBJECT_INFORMATION_CLASS {
 1155     ObjectBasicInformation,
 1156     ObjectNameInformation,
 1157     ObjectTypeInformation,
 1158     ObjectAllInformation,
 1159     ObjectDataInformation
 1160 } OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
 1161 
 1162 typedef enum _PROCESSINFOCLASS {
 1163     ProcessBasicInformation = 0,
 1164     ProcessQuotaLimits = 1,
 1165     ProcessIoCounters = 2,
 1166     ProcessVmCounters = 3,
 1167     ProcessTimes = 4,
 1168     ProcessBasePriority = 5,
 1169     ProcessRaisePriority = 6,
 1170     ProcessDebugPort = 7,
 1171     ProcessExceptionPort = 8,
 1172     ProcessAccessToken = 9,
 1173     ProcessLdtInformation = 10,
 1174     ProcessLdtSize = 11,
 1175     ProcessDefaultHardErrorMode = 12,
 1176     ProcessIoPortHandlers = 13,
 1177     ProcessPooledUsageAndLimits = 14,
 1178     ProcessWorkingSetWatch = 15,
 1179     ProcessUserModeIOPL = 16,
 1180     ProcessEnableAlignmentFaultFixup = 17,
 1181     ProcessPriorityClass = 18,
 1182     ProcessWx86Information = 19,
 1183     ProcessHandleCount = 20,
 1184     ProcessAffinityMask = 21,
 1185     ProcessPriorityBoost = 22,
 1186     ProcessDeviceMap = 23,
 1187     ProcessSessionInformation = 24,
 1188     ProcessForegroundInformation = 25,
 1189     ProcessWow64Information = 26,
 1190     ProcessImageFileName = 27,
 1191     ProcessLUIDDeviceMapsEnabled = 28,
 1192     ProcessBreakOnTermination = 29,
 1193     ProcessDebugObjectHandle = 30,
 1194     ProcessDebugFlags = 31,
 1195     ProcessHandleTracing = 32,
 1196     ProcessIoPriority = 33,
 1197     ProcessExecuteFlags = 34,
 1198     ProcessTlsInformation = 35,
 1199     ProcessCookie = 36,
 1200     ProcessImageInformation = 37,
 1201     ProcessCycleTime = 38,
 1202     ProcessPagePriority = 39,
 1203     ProcessInstrumentationCallback = 40,
 1204     ProcessThreadStackAllocation = 41,
 1205     ProcessWorkingSetWatchEx = 42,
 1206     ProcessImageFileNameWin32 = 43,
 1207     MaxProcessInfoClass
 1208 } PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS;
 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 {
 1216     ViewShare = 1,
 1217     ViewUnmap = 2
 1218 } SECTION_INHERIT;
 1219 
 1220 typedef enum _SYSTEM_INFORMATION_CLASS {
 1221     SystemBasicInformation = 0,
 1222     SystemCpuInformation = 1,
 1223     SystemPerformanceInformation = 2,
 1224     SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
 1225     Unknown4,
 1226     SystemProcessInformation = 5,
 1227     Unknown6,
 1228     Unknown7,
 1229     SystemProcessorPerformanceInformation = 8,
 1230     Unknown9,
 1231     Unknown10,
 1232     SystemModuleInformation = 11,
 1233     Unknown12,
 1234     Unknown13,
 1235     Unknown14,
 1236     Unknown15,
 1237     SystemHandleInformation = 16,
 1238     Unknown17,
 1239     SystemPageFileInformation = 18,
 1240     Unknown19,
 1241     Unknown20,
 1242     SystemCacheInformation = 21,
 1243     Unknown22,
 1244     SystemInterruptInformation = 23,
 1245     SystemDpcBehaviourInformation = 24,
 1246     SystemFullMemoryInformation = 25,
 1247     SystemNotImplemented6 = 25,
 1248     SystemLoadImage = 26,
 1249     SystemUnloadImage = 27,
 1250     SystemTimeAdjustmentInformation = 28,
 1251     SystemTimeAdjustment = 28,
 1252     SystemSummaryMemoryInformation = 29,
 1253     SystemNotImplemented7 = 29,
 1254     SystemNextEventIdInformation = 30,
 1255     SystemNotImplemented8 = 30,
 1256     SystemEventIdsInformation = 31,
 1257     SystemCrashDumpInformation = 32,
 1258     SystemExceptionInformation = 33,
 1259     SystemCrashDumpStateInformation = 34,
 1260     SystemKernelDebuggerInformation = 35,
 1261     SystemContextSwitchInformation = 36,
 1262     SystemRegistryQuotaInformation = 37,
 1263     SystemCurrentTimeZoneInformation = 44,
 1264     SystemTimeZoneInformation = 44,
 1265     SystemLookasideInformation = 45,
 1266     SystemSetTimeSlipEvent = 46,
 1267     SystemCreateSession = 47,
 1268     SystemDeleteSession = 48,
 1269     SystemInvalidInfoClass4 = 49,
 1270     SystemRangeStartInformation = 50,
 1271     SystemVerifierInformation = 51,
 1272     SystemAddVerifier = 52,
 1273     SystemSessionProcessesInformation   = 53,
 1274     SystemLoadGdiDriverInSystemSpace = 54,
 1275     SystemNumaProcessorMap = 55,
 1276     SystemPrefetcherInformation = 56,
 1277     SystemExtendedProcessInformation = 57,
 1278     SystemRecommendedSharedDataAlignment = 58,
 1279     SystemComPlusPackage = 59,
 1280     SystemNumaAvailableMemory = 60,
 1281     SystemProcessorPowerInformation = 61,
 1282     SystemEmulationBasicInformation = 62,
 1283     SystemEmulationProcessorInformation = 63,
 1284     SystemExtendedHandleInformation = 64,
 1285     SystemLostDelayedWriteInformation = 65,
 1286     SystemBigPoolInformation = 66,
 1287     SystemSessionPoolTagInformation = 67,
 1288     SystemSessionMappedViewInformation = 68,
 1289     SystemHotpatchInformation = 69,
 1290     SystemObjectSecurityMode = 70,
 1291     SystemWatchdogTimerHandler = 71,
 1292     SystemWatchdogTimerInformation = 72,
 1293     SystemLogicalProcessorInformation = 73,
 1294     SystemWow64SharedInformation = 74,
 1295     SystemRegisterFirmwareTableInformationHandler = 75,
 1296     SystemFirmwareTableInformation = 76,
 1297     SystemModuleInformationEx = 77,
 1298     SystemVerifierTriageInformation = 78,
 1299     SystemSuperfetchInformation = 79,
 1300     SystemMemoryListInformation = 80,
 1301     SystemFileCacheInformationEx = 81,
 1302     SystemDynamicTimeZoneInformation = 102,
 1303     SystemLogicalProcessorInformationEx = 107,
 1304     SystemInformationClassMax
 1305 } SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
 1306 
 1307 typedef enum _THREADINFOCLASS {
 1308     ThreadBasicInformation = 0,
 1309     ThreadTimes,
 1310     ThreadPriority,
 1311     ThreadBasePriority,
 1312     ThreadAffinityMask,
 1313     ThreadImpersonationToken,
 1314     ThreadDescriptorTableEntry,
 1315     ThreadEnableAlignmentFaultFixup,
 1316     ThreadEventPair_Reusable,
 1317     ThreadQuerySetWin32StartAddress,
 1318     ThreadZeroTlsCell,
 1319     ThreadPerformanceCount,
 1320     ThreadAmILastThread,
 1321     ThreadIdealProcessor,
 1322     ThreadPriorityBoost,
 1323     ThreadSetTlsArrayAddress,
 1324     ThreadIsIoPending,
 1325     ThreadHideFromDebugger,
 1326     ThreadBreakOnTermination,
 1327     ThreadSwitchLegacyState,
 1328     ThreadIsTerminated,
 1329     ThreadLastSystemCall,
 1330     ThreadIoPriority,
 1331     ThreadCycleTime,
 1332     ThreadPagePriority,
 1333     ThreadActualBasePriority,
 1334     ThreadTebInformation,
 1335     ThreadCSwitchMon,
 1336     ThreadCSwitchPmu,
 1337     ThreadWow64Context,
 1338     ThreadGroupInformation,
 1339     ThreadUmsInformation,
 1340     ThreadCounterProfiling,
 1341     ThreadIdealProcessorEx,
 1342     ThreadSuspendCount = 35,
 1343     ThreadDescription = 38,
 1344     MaxThreadInfoClass
 1345 } THREADINFOCLASS;
 1346 
 1347 typedef struct _THREAD_BASIC_INFORMATION
 1348 {
 1349     NTSTATUS  ExitStatus;
 1350     PVOID     TebBaseAddress;
 1351     CLIENT_ID ClientId;
 1352     ULONG_PTR AffinityMask;
 1353     LONG      Priority;
 1354     LONG      BasePriority;
 1355 } THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
 1356 
 1357 typedef struct _THREAD_DESCRIPTOR_INFORMATION
 1358 {
 1359     DWORD       Selector;
 1360     LDT_ENTRY   Entry;
 1361 } THREAD_DESCRIPTOR_INFORMATION, *PTHREAD_DESCRIPTOR_INFORMATION;
 1362 
 1363 typedef struct _THREAD_DESCRIPTION_INFORMATION
 1364 {
 1365     UNICODE_STRING Description;
 1366 } THREAD_DESCRIPTION_INFORMATION, *PTHREAD_DESCRIPTION_INFORMATION;
 1367 
 1368 typedef struct _KERNEL_USER_TIMES {
 1369     LARGE_INTEGER  CreateTime;
 1370     LARGE_INTEGER  ExitTime;
 1371     LARGE_INTEGER  KernelTime;
 1372     LARGE_INTEGER  UserTime;
 1373 } KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
 1374 
 1375 typedef enum _WINSTATIONINFOCLASS {
 1376     WinStationInformation = 8
 1377 } WINSTATIONINFOCLASS;
 1378 
 1379 typedef enum _MEMORY_INFORMATION_CLASS {
 1380     MemoryBasicInformation,
 1381     MemoryWorkingSetList,
 1382     MemorySectionName,
 1383     MemoryBasicVlmInformation,
 1384     MemoryWorkingSetExInformation
 1385 } MEMORY_INFORMATION_CLASS;
 1386 
 1387 typedef struct _MEMORY_SECTION_NAME
 1388 {
 1389     UNICODE_STRING SectionFileName;
 1390 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
 1391 
 1392 typedef union _MEMORY_WORKING_SET_EX_BLOCK {
 1393     ULONG_PTR Flags;
 1394     struct {
 1395         ULONG_PTR Valid : 1;
 1396         ULONG_PTR ShareCount : 3;
 1397         ULONG_PTR Win32Protection : 11;
 1398         ULONG_PTR Shared : 1;
 1399         ULONG_PTR Node : 6;
 1400         ULONG_PTR Locked : 1;
 1401         ULONG_PTR LargePage : 1;
 1402     } DUMMYSTRUCTNAME;
 1403 } MEMORY_WORKING_SET_EX_BLOCK, *PMEMORY_WORKING_SET_EX_BLOCK;
 1404 
 1405 typedef struct _MEMORY_WORKING_SET_EX_INFORMATION {
 1406     PVOID                       VirtualAddress;
 1407     MEMORY_WORKING_SET_EX_BLOCK VirtualAttributes;
 1408 } MEMORY_WORKING_SET_EX_INFORMATION, *PMEMORY_WORKING_SET_EX_INFORMATION;
 1409 
 1410 typedef enum _MUTANT_INFORMATION_CLASS
 1411 {
 1412     MutantBasicInformation
 1413 } MUTANT_INFORMATION_CLASS, *PMUTANT_INFORMATION_CLASS;
 1414 
 1415 typedef struct _MUTANT_BASIC_INFORMATION {
 1416     LONG        CurrentCount;
 1417     BOOLEAN     OwnedByCaller;
 1418     BOOLEAN     AbandonedState;
 1419 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
 1420 
 1421 typedef enum _TIMER_INFORMATION_CLASS
 1422 {
 1423     TimerBasicInformation = 0
 1424 } TIMER_INFORMATION_CLASS;
 1425 
 1426 typedef struct _TIMER_BASIC_INFORMATION
 1427 {
 1428     LARGE_INTEGER RemainingTime;
 1429     BOOLEAN       TimerState;
 1430 } TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION;
 1431 
 1432 
 1433 /* return type of RtlDetermineDosPathNameType_U (FIXME: not the correct names) */
 1434 typedef enum
 1435 {
 1436     INVALID_PATH = 0,
 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           /* "//." */
 1444 } DOS_PATHNAME_TYPE;
 1445 
 1446 
 1447 /***********************************************************************
 1448  * Types and data structures
 1449  */
 1450 
 1451 /* This is used by NtQuerySystemInformation */
 1452 typedef struct _SYSTEM_THREAD_INFORMATION
 1453 {                                    /* win32/win64 */
 1454     LARGE_INTEGER KernelTime;          /* 00/00 */
 1455     LARGE_INTEGER UserTime;            /* 08/08 */
 1456     LARGE_INTEGER CreateTime;          /* 10/10 */
 1457     DWORD         dwTickCount;         /* 18/18 */
 1458     LPVOID        StartAddress;        /* 1c/20 */
 1459     CLIENT_ID     ClientId;            /* 20/28 */
 1460     DWORD         dwCurrentPriority;   /* 28/38 */
 1461     DWORD         dwBasePriority;      /* 2c/3c */
 1462     DWORD         dwContextSwitches;   /* 30/40 */
 1463     DWORD         dwThreadState;       /* 34/44 */
 1464     DWORD         dwWaitReason;        /* 38/48 */
 1465     DWORD         dwUnknown;           /* 3c/4c */
 1466 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
 1467 
 1468 typedef struct _IO_STATUS_BLOCK {
 1469   union {
 1470     NTSTATUS Status;
 1471     PVOID Pointer;
 1472   } DUMMYUNIONNAME;
 1473 
 1474   ULONG_PTR Information;
 1475 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
 1476 
 1477 typedef void (WINAPI * PIO_APC_ROUTINE)(PVOID,PIO_STATUS_BLOCK,ULONG);
 1478 
 1479 typedef struct _KEY_BASIC_INFORMATION {
 1480     LARGE_INTEGER LastWriteTime;
 1481     ULONG         TitleIndex;
 1482     ULONG         NameLength;
 1483     WCHAR         Name[1];
 1484 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
 1485 
 1486 typedef struct _KEY_NODE_INFORMATION
 1487 {
 1488     LARGE_INTEGER LastWriteTime;
 1489     ULONG         TitleIndex;
 1490     ULONG         ClassOffset;
 1491     ULONG         ClassLength;
 1492     ULONG         NameLength;
 1493     WCHAR         Name[1];
 1494    /* Class[1]; */
 1495 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
 1496 
 1497 typedef struct _KEY_FULL_INFORMATION
 1498 {
 1499     LARGE_INTEGER LastWriteTime;
 1500     ULONG         TitleIndex;
 1501     ULONG         ClassOffset;
 1502     ULONG         ClassLength;
 1503     ULONG         SubKeys;
 1504     ULONG         MaxNameLen;
 1505     ULONG         MaxClassLen;
 1506     ULONG         Values;
 1507     ULONG         MaxValueNameLen;
 1508     ULONG         MaxValueDataLen;
 1509     WCHAR         Class[1];
 1510 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
 1511 
 1512 typedef struct _KEY_NAME_INFORMATION {
 1513     ULONG         NameLength;
 1514     WCHAR         Name[1];
 1515 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
 1516 
 1517 typedef struct _KEY_CACHED_INFORMATION
 1518 {
 1519     LARGE_INTEGER LastWriteTime;
 1520     ULONG         TitleIndex;
 1521     ULONG         SubKeys;
 1522     ULONG         MaxNameLen;
 1523     ULONG         Values;
 1524     ULONG         MaxValueNameLen;
 1525     ULONG         MaxValueDataLen;
 1526     ULONG         NameLength;
 1527 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
 1528 
 1529 typedef struct _KEY_VALUE_ENTRY
 1530 {
 1531     PUNICODE_STRING ValueName;
 1532     ULONG           DataLength;
 1533     ULONG           DataOffset;
 1534     ULONG           Type;
 1535 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
 1536 
 1537 typedef struct _KEY_VALUE_BASIC_INFORMATION {
 1538     ULONG TitleIndex;
 1539     ULONG Type;
 1540     ULONG NameLength;
 1541     WCHAR Name[1];
 1542 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
 1543 
 1544 typedef struct _KEY_VALUE_FULL_INFORMATION {
 1545     ULONG TitleIndex;
 1546     ULONG Type;
 1547     ULONG DataOffset;
 1548     ULONG DataLength;
 1549     ULONG NameLength;
 1550     WCHAR Name[1];
 1551 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
 1552 
 1553 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
 1554     ULONG TitleIndex;
 1555     ULONG Type;
 1556     ULONG DataLength;
 1557     UCHAR Data[1];
 1558 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
 1559 
 1560 #ifndef __OBJECT_ATTRIBUTES_DEFINED__
 1561 #define __OBJECT_ATTRIBUTES_DEFINED__
 1562 typedef struct _OBJECT_ATTRIBUTES {
 1563   ULONG Length;
 1564   HANDLE RootDirectory;
 1565   PUNICODE_STRING ObjectName;
 1566   ULONG Attributes;
 1567   PVOID SecurityDescriptor;       /* type SECURITY_DESCRIPTOR */
 1568   PVOID SecurityQualityOfService; /* type SECURITY_QUALITY_OF_SERVICE */
 1569 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
 1570 #endif
 1571 
 1572 typedef struct _OBJECT_DATA_INFORMATION {
 1573     BOOLEAN InheritHandle;
 1574     BOOLEAN ProtectFromClose;
 1575 } OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION;
 1576 
 1577 typedef struct _OBJECT_BASIC_INFORMATION {
 1578     ULONG  Attributes;
 1579     ACCESS_MASK  GrantedAccess;
 1580     ULONG  HandleCount;
 1581     ULONG  PointerCount;
 1582     ULONG  PagedPoolUsage;
 1583     ULONG  NonPagedPoolUsage;
 1584     ULONG  Reserved[3];
 1585     ULONG  NameInformationLength;
 1586     ULONG  TypeInformationLength;
 1587     ULONG  SecurityDescriptorLength;
 1588     LARGE_INTEGER  CreateTime;
 1589 } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
 1590 
 1591 typedef struct _OBJECT_NAME_INFORMATION {
 1592     UNICODE_STRING Name;
 1593 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
 1594 
 1595 typedef struct __OBJECT_TYPE_INFORMATION {
 1596     UNICODE_STRING TypeName;
 1597     ULONG Reserved [22];
 1598 } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
 1599 
 1600 typedef struct _PROCESS_BASIC_INFORMATION {
 1601 #ifdef __WINESRC__
 1602     DWORD_PTR ExitStatus;
 1603     PPEB PebBaseAddress;
 1604     DWORD_PTR AffinityMask;
 1605     DWORD_PTR BasePriority;
 1606     ULONG_PTR UniqueProcessId;
 1607     ULONG_PTR InheritedFromUniqueProcessId;
 1608 #else
 1609     PVOID Reserved1;
 1610     PPEB PebBaseAddress;
 1611     PVOID Reserved2[2];
 1612     ULONG_PTR UniqueProcessId;
 1613     PVOID Reserved3;
 1614 #endif
 1615 } PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION;
 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 {
 1625     BOOLEAN     Foreground;
 1626     UCHAR       PriorityClass;
 1627 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
 1628 
 1629 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION
 1630 {
 1631     SIZE_T ReserveSize;
 1632     SIZE_T ZeroBits;
 1633     PVOID  StackBase;
 1634 } PROCESS_STACK_ALLOCATION_INFORMATION, *PPROCESS_STACK_ALLOCATION_INFORMATION;
 1635 
 1636 typedef struct _PROCESS_STACK_ALLOCATION_INFORMATION_EX
 1637 {
 1638     ULONG PreferredNode;
 1639     ULONG Reserved0;
 1640     ULONG Reserved1;
 1641     ULONG Reserved2;
 1642     PROCESS_STACK_ALLOCATION_INFORMATION AllocInfo;
 1643 } PROCESS_STACK_ALLOCATION_INFORMATION_EX, *PPROCESS_STACK_ALLOCATION_INFORMATION_EX;
 1644 
 1645 typedef struct _RTL_HEAP_DEFINITION {
 1646     ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
 1647 
 1648     ULONG Unknown[11];
 1649 } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
 1650 
 1651 typedef struct _RTL_RWLOCK {
 1652     RTL_CRITICAL_SECTION rtlCS;
 1653 
 1654     HANDLE hSharedReleaseSemaphore;
 1655     UINT   uSharedWaiters;
 1656 
 1657     HANDLE hExclusiveReleaseSemaphore;
 1658     UINT   uExclusiveWaiters;
 1659 
 1660     INT    iNumberActive;
 1661     HANDLE hOwningThreadId;
 1662     DWORD  dwTimeoutBoost;
 1663     PVOID  pDebugInfo;
 1664 } RTL_RWLOCK, *LPRTL_RWLOCK;
 1665 
 1666 /* System Information Class 0x00 */
 1667 
 1668 typedef struct _SYSTEM_BASIC_INFORMATION {
 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;
 1680     BYTE      NumberOfProcessors;
 1681 #else
 1682     BYTE Reserved1[24];
 1683     PVOID Reserved2[4];
 1684     CCHAR NumberOfProcessors;
 1685 #endif
 1686 } SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
 1687 
 1688 /* System Information Class 0x01 */
 1689 
 1690 typedef struct _SYSTEM_CPU_INFORMATION {
 1691     WORD Architecture;
 1692     WORD Level;
 1693     WORD Revision;       /* combination of CPU model and stepping */
 1694     WORD Reserved;       /* always zero */
 1695     DWORD FeatureSet;    /* see bit flags below */
 1696 } SYSTEM_CPU_INFORMATION, *PSYSTEM_CPU_INFORMATION;
 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. */
 1741 typedef struct _SYSTEM_PERFORMANCE_INFORMATION {
 1742     LARGE_INTEGER IdleTime;
 1743     LARGE_INTEGER ReadTransferCount;
 1744     LARGE_INTEGER WriteTransferCount;
 1745     LARGE_INTEGER OtherTransferCount;
 1746     ULONG ReadOperationCount;
 1747     ULONG WriteOperationCount;
 1748     ULONG OtherOperationCount;
 1749     ULONG AvailablePages;
 1750     ULONG TotalCommittedPages;
 1751     ULONG TotalCommitLimit;
 1752     ULONG PeakCommitment;
 1753     ULONG PageFaults;
 1754     ULONG WriteCopyFaults;
 1755     ULONG TransitionFaults;
 1756     ULONG Reserved1;
 1757     ULONG DemandZeroFaults;
 1758     ULONG PagesRead;
 1759     ULONG PageReadIos;
 1760     ULONG Reserved2[2];
 1761     ULONG PagefilePagesWritten;
 1762     ULONG PagefilePageWriteIos;
 1763     ULONG MappedFilePagesWritten;
 1764     ULONG MappedFilePageWriteIos;
 1765     ULONG PagedPoolUsage;
 1766     ULONG NonPagedPoolUsage;
 1767     ULONG PagedPoolAllocs;
 1768     ULONG PagedPoolFrees;
 1769     ULONG NonPagedPoolAllocs;
 1770     ULONG NonPagedPoolFrees;
 1771     ULONG TotalFreeSystemPtes;
 1772     ULONG SystemCodePage;
 1773     ULONG TotalSystemDriverPages;
 1774     ULONG TotalSystemCodePages;
 1775     ULONG SmallNonPagedLookasideListAllocateHits;
 1776     ULONG SmallPagedLookasideListAllocateHits;
 1777     ULONG Reserved3;
 1778     ULONG MmSystemCachePage;
 1779     ULONG PagedPoolPage;
 1780     ULONG SystemDriverPage;
 1781     ULONG FastReadNoWait;
 1782     ULONG FastReadWait;
 1783     ULONG FastReadResourceMiss;
 1784     ULONG FastReadNotPossible;
 1785     ULONG FastMdlReadNoWait;
 1786     ULONG FastMdlReadWait;
 1787     ULONG FastMdlReadResourceMiss;
 1788     ULONG FastMdlReadNotPossible;
 1789     ULONG MapDataNoWait;
 1790     ULONG MapDataWait;
 1791     ULONG MapDataNoWaitMiss;
 1792     ULONG MapDataWaitMiss;
 1793     ULONG PinMappedDataCount;
 1794     ULONG PinReadNoWait;
 1795     ULONG PinReadWait;
 1796     ULONG PinReadNoWaitMiss;
 1797     ULONG PinReadWaitMiss;
 1798     ULONG CopyReadNoWait;
 1799     ULONG CopyReadWait;
 1800     ULONG CopyReadNoWaitMiss;
 1801     ULONG CopyReadWaitMiss;
 1802     ULONG MdlReadNoWait;
 1803     ULONG MdlReadWait;
 1804     ULONG MdlReadNoWaitMiss;
 1805     ULONG MdlReadWaitMiss;
 1806     ULONG ReadAheadIos;
 1807     ULONG LazyWriteIos;
 1808     ULONG LazyWritePages;
 1809     ULONG DataFlushes;
 1810     ULONG DataPages;
 1811     ULONG ContextSwitches;
 1812     ULONG FirstLevelTbFills;
 1813     ULONG SecondLevelTbFills;
 1814     ULONG SystemCalls;
 1815 } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
 1816 
 1817 /* System Information Class 0x03 */
 1818 
 1819 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
 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
 1829     BYTE Reserved1[48];
 1830 #endif
 1831 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; /* was SYSTEM_TIME_INFORMATION */
 1832 
 1833 /* System Information Class 0x08 */
 1834 
 1835 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
 1836     LARGE_INTEGER IdleTime;
 1837     LARGE_INTEGER KernelTime;
 1838     LARGE_INTEGER UserTime;
 1839     LARGE_INTEGER Reserved1[2];
 1840     ULONG Reserved2;
 1841 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
 1842 
 1843 /* System Information Class 0x0b */
 1844 
 1845 typedef struct _SYSTEM_DRIVER_INFORMATION {
 1846     PVOID pvAddress;
 1847     DWORD dwUnknown1;
 1848     DWORD dwUnknown2;
 1849     DWORD dwEntryIndex;
 1850     DWORD dwUnknown3;
 1851     char szName[MAX_PATH + 1];
 1852 } SYSTEM_DRIVER_INFORMATION, *PSYSTEM_DRIVER_INFORMATION;
 1853 
 1854 /* System Information Class 0x10 */
 1855 
 1856 typedef struct _SYSTEM_HANDLE_ENTRY {
 1857     ULONG  OwnerPid;
 1858     BYTE   ObjectType;
 1859     BYTE   HandleFlags;
 1860     USHORT HandleValue;
 1861     PVOID  ObjectPointer;
 1862     ULONG  AccessMask;
 1863 } SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
 1864 
 1865 typedef struct _SYSTEM_HANDLE_INFORMATION {
 1866     ULONG               Count;
 1867     SYSTEM_HANDLE_ENTRY Handle[1];
 1868 } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
 1869 
 1870 typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
 1871 {
 1872     void *Object;
 1873     ULONG_PTR UniqueProcessId;
 1874     ULONG_PTR HandleValue;
 1875     ULONG GrantedAccess;
 1876     USHORT CreatorBackTraceIndex;
 1877     USHORT ObjectTypeIndex;
 1878     ULONG HandleAttributes;
 1879     ULONG Reserved;
 1880 } SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
 1881 
 1882 typedef struct _SYSTEM_HANDLE_INFORMATION_EX
 1883 {
 1884     ULONG_PTR NumberOfHandles;
 1885     ULONG_PTR Reserved;
 1886     SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handles[1];
 1887 } SYSTEM_HANDLE_INFORMATION_EX;
 1888 
 1889 /* System Information Class 0x15 */
 1890 
 1891 typedef struct _SYSTEM_CACHE_INFORMATION {
 1892     ULONG CurrentSize;
 1893     ULONG PeakSize;
 1894     ULONG PageFaultCount;
 1895     ULONG MinimumWorkingSet;
 1896     ULONG MaximumWorkingSet;
 1897     ULONG unused[4];
 1898 #ifdef _WIN64
 1899     ULONG unknown64[7];
 1900 #endif
 1901 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
 1902 
 1903 /* System Information Class 0x17 */
 1904 
 1905 typedef struct _SYSTEM_INTERRUPT_INFORMATION {
 1906     BYTE Reserved1[24];
 1907 } SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION;
 1908 
 1909 typedef struct _SYSTEM_CONFIGURATION_INFO {
 1910     union {
 1911         ULONG   OemId;
 1912         struct {
 1913         WORD ProcessorArchitecture;
 1914         WORD Reserved;
 1915     } tag1;
 1916     } tag2;
 1917     ULONG PageSize;
 1918     PVOID MinimumApplicationAddress;
 1919     PVOID MaximumApplicationAddress;
 1920     ULONG ActiveProcessorMask;
 1921     ULONG NumberOfProcessors;
 1922     ULONG ProcessorType;
 1923     ULONG AllocationGranularity;
 1924     WORD  ProcessorLevel;
 1925     WORD  ProcessorRevision;
 1926 } SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
 1927 
 1928 typedef struct _SYSTEM_EXCEPTION_INFORMATION {
 1929     BYTE Reserved1[16];
 1930 } SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION;
 1931 
 1932 typedef struct _SYSTEM_LOOKASIDE_INFORMATION {
 1933     BYTE Reserved1[32];
 1934 } SYSTEM_LOOKASIDE_INFORMATION, *PSYSTEM_LOOKASIDE_INFORMATION;
 1935 
 1936 typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {
 1937     BOOLEAN  DebuggerEnabled;
 1938     BOOLEAN  DebuggerNotPresent;
 1939 } SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
 1940 
 1941 typedef struct _VM_COUNTERS
 1942 {
 1943     SIZE_T PeakVirtualSize;
 1944     SIZE_T VirtualSize;
 1945     ULONG PageFaultCount;
 1946     SIZE_T PeakWorkingSetSize;
 1947     SIZE_T WorkingSetSize;
 1948     SIZE_T QuotaPeakPagedPoolUsage;
 1949     SIZE_T QuotaPagedPoolUsage;
 1950     SIZE_T QuotaPeakNonPagedPoolUsage;
 1951     SIZE_T QuotaNonPagedPoolUsage;
 1952     SIZE_T PagefileUsage;
 1953     SIZE_T PeakPagefileUsage;
 1954 } VM_COUNTERS, *PVM_COUNTERS;
 1955 
 1956 typedef struct _VM_COUNTERS_EX
 1957 {
 1958     SIZE_T PeakVirtualSize;
 1959     SIZE_T VirtualSize;
 1960     ULONG PageFaultCount;
 1961     SIZE_T PeakWorkingSetSize;
 1962     SIZE_T WorkingSetSize;
 1963     SIZE_T QuotaPeakPagedPoolUsage;
 1964     SIZE_T QuotaPagedPoolUsage;
 1965     SIZE_T QuotaPeakNonPagedPoolUsage;
 1966     SIZE_T QuotaNonPagedPoolUsage;
 1967     SIZE_T PagefileUsage;
 1968     SIZE_T PeakPagefileUsage;
 1969     SIZE_T PrivateUsage;
 1970 } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
 1971 
 1972 typedef struct _SYSTEM_PROCESS_INFORMATION {
 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 */
 1994     HANDLE UniqueProcessId;            /* 44/50 */
 1995     PVOID Reserved3;                   /* 48/58 */
 1996     ULONG HandleCount;                 /* 4c/60 */
 1997     BYTE Reserved4[4];                 /* 50/64 */
 1998     PVOID Reserved5[11];               /* 54/68 */
 1999     SIZE_T PeakPagefileUsage;          /* 80/c0 */
 2000     SIZE_T PrivatePageCount;           /* 84/c8 */
 2001     LARGE_INTEGER Reserved6[6];        /* 88/d0 */
 2002 #endif
 2003 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
 2004 
 2005 typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION {
 2006     ULONG RegistryQuotaAllowed;
 2007     ULONG RegistryQuotaUsed;
 2008     PVOID Reserved1;
 2009 } SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION;
 2010 
 2011 typedef struct _SYSTEM_TIME_ADJUSTMENT_QUERY {
 2012     ULONG   TimeAdjustment;
 2013     ULONG   TimeIncrement;
 2014     BOOLEAN TimeAdjustmentDisabled;
 2015 } SYSTEM_TIME_ADJUSTMENT_QUERY, *PSYSTEM_TIME_ADJUSTMENT_QUERY;
 2016 
 2017 typedef struct _SYSTEM_TIME_ADJUSTMENT {
 2018     ULONG   TimeAdjustment;
 2019     BOOLEAN TimeAdjustmentDisabled;
 2020 } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
 2021 
 2022 typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
 2023 {
 2024     SystemFirmwareTable_Enumerate = 0,
 2025     SystemFirmwareTable_Get = 1
 2026 } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
 2027 
 2028 /* System Information Class 0x4C */
 2029 
 2030 typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
 2031 {
 2032     ULONG ProviderSignature;
 2033     SYSTEM_FIRMWARE_TABLE_ACTION Action;
 2034     ULONG TableID;
 2035     ULONG TableBufferLength;
 2036     UCHAR TableBuffer[1];
 2037 } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
 2038 
 2039 typedef struct _TIME_FIELDS
 2040 {   CSHORT Year;
 2041     CSHORT Month;
 2042     CSHORT Day;
 2043     CSHORT Hour;
 2044     CSHORT Minute;
 2045     CSHORT Second;
 2046     CSHORT Milliseconds;
 2047     CSHORT Weekday;
 2048 } TIME_FIELDS, *PTIME_FIELDS;
 2049 
 2050 typedef struct _WINSTATIONINFORMATIONW {
 2051   BYTE Reserved2[70];
 2052   ULONG LogonId;
 2053   BYTE Reserved3[1140];
 2054 } WINSTATIONINFORMATIONW, *PWINSTATIONINFORMATIONW;
 2055 
 2056 typedef BOOLEAN (WINAPI * PWINSTATIONQUERYINFORMATIONW)(HANDLE,ULONG,WINSTATIONINFOCLASS,PVOID,ULONG,PULONG);
 2057 
 2058 typedef struct _LDR_RESOURCE_INFO
 2059 {
 2060     ULONG_PTR Type;
 2061     ULONG_PTR Name;
 2062     ULONG Language;
 2063 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
 2064 
 2065 
 2066 /* debug buffer definitions */
 2067 
 2068 typedef struct _DEBUG_BUFFER {
 2069   HANDLE SectionHandle;
 2070   PVOID  SectionBase;
 2071   PVOID  RemoteSectionBase;
 2072   ULONG  SectionBaseDelta;
 2073   HANDLE EventPairHandle;
 2074   ULONG  Unknown[2];
 2075   HANDLE RemoteThreadHandle;
 2076   ULONG  InfoClassMask;
 2077   ULONG  SizeOfInfo;
 2078   ULONG  AllocatedSize;
 2079   ULONG  SectionSize;
 2080   PVOID  ModuleInformation;
 2081   PVOID  BackTraceInformation;
 2082   PVOID  HeapInformation;
 2083   PVOID  LockInformation;
 2084   PVOID  Reserved[8];
 2085 } DEBUG_BUFFER, *PDEBUG_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 
 2094 typedef struct _DEBUG_MODULE_INFORMATION {
 2095   ULONG  Reserved[2];
 2096   ULONG  Base;
 2097   ULONG  Size;
 2098   ULONG  Flags;
 2099   USHORT Index;
 2100   USHORT Unknown;
 2101   USHORT LoadCount;
 2102   USHORT ModuleNameOffset;
 2103   CHAR   ImageName[256];
 2104 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
 2105 
 2106 typedef struct _DEBUG_HEAP_INFORMATION {
 2107   ULONG  Base;
 2108   ULONG  Flags;
 2109   USHORT Granularity;
 2110   USHORT Unknown;
 2111   ULONG  Allocated;
 2112   ULONG  Committed;
 2113   ULONG  TagCount;
 2114   ULONG  BlockCount;
 2115   ULONG  Reserved[7];
 2116   PVOID  Tags;
 2117   PVOID  Blocks;
 2118 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
 2119 
 2120 typedef struct _DEBUG_LOCK_INFORMATION {
 2121   PVOID  Address;
 2122   USHORT Type;
 2123   USHORT CreatorBackTraceIndex;
 2124   ULONG  OwnerThreadId;
 2125   ULONG  ActiveCount;
 2126   ULONG  ContentionCount;
 2127   ULONG  EntryCount;
 2128   ULONG  RecursionCount;
 2129   ULONG  NumberOfSharedWaiters;
 2130   ULONG  NumberOfExclusiveWaiters;
 2131 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
 2132 
 2133 typedef struct _PORT_MESSAGE_HEADER {
 2134   USHORT DataSize;
 2135   USHORT MessageSize;
 2136   USHORT MessageType;
 2137   USHORT VirtualRangesOffset;
 2138   CLIENT_ID ClientId;
 2139   ULONG MessageId;
 2140   ULONG SectionSize;
 2141 } PORT_MESSAGE_HEADER, *PPORT_MESSAGE_HEADER, PORT_MESSAGE, *PPORT_MESSAGE;
 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  */
 2149 typedef struct atom_table *RTL_ATOM_TABLE, **PRTL_ATOM_TABLE;
 2150 
 2151 typedef enum _ATOM_INFORMATION_CLASS {
 2152    AtomBasicInformation         = 0,
 2153    AtomTableInformation         = 1,
 2154 } ATOM_INFORMATION_CLASS;
 2155 
 2156 typedef struct _ATOM_BASIC_INFORMATION {
 2157    USHORT       ReferenceCount;
 2158    USHORT       Pinned;
 2159    USHORT       NameLength;
 2160    WCHAR        Name[1];
 2161 } ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION;
 2162 
 2163 /* FIXME: names probably not correct */
 2164 typedef struct _RTL_HANDLE
 2165 {
 2166     struct _RTL_HANDLE * Next;
 2167 } RTL_HANDLE;
 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 */
 2179 } RTL_HANDLE_TABLE;
 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 
 2380 typedef NTSTATUS (WINAPI *PRTL_QUERY_REGISTRY_ROUTINE)( PCWSTR ValueName,
 2381                                                         ULONG  ValueType,
 2382                                                         PVOID  ValueData,
 2383                                                         ULONG  ValueLength,
 2384                                                         PVOID  Context,
 2385                                                         PVOID  EntryContext);
 2386 
 2387 typedef struct _RTL_QUERY_REGISTRY_TABLE
 2388 {
 2389   PRTL_QUERY_REGISTRY_ROUTINE  QueryRoutine;
 2390   ULONG  Flags;
 2391   PWSTR  Name;
 2392   PVOID  EntryContext;
 2393   ULONG  DefaultType;
 2394   PVOID  DefaultData;
 2395   ULONG  DefaultLength;
 2396 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
 2397 
 2398 typedef struct _KEY_MULTIPLE_VALUE_INFORMATION
 2399 {
 2400   PUNICODE_STRING ValueName;
 2401   ULONG DataLength;
 2402   ULONG DataOffset;
 2403   ULONG Type;
 2404 } KEY_MULTIPLE_VALUE_INFORMATION, *PKEY_MULTIPLE_VALUE_INFORMATION;
 2405 
 2406 typedef VOID (CALLBACK *PRTL_OVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPVOID);
 2407 
 2408 typedef VOID (CALLBACK *PTIMER_APC_ROUTINE) ( PVOID, ULONG, LONG );
 2409 
 2410 typedef enum _EVENT_INFORMATION_CLASS {
 2411   EventBasicInformation
 2412 } EVENT_INFORMATION_CLASS, *PEVENT_INFORMATION_CLASS;
 2413 
 2414 typedef struct _EVENT_BASIC_INFORMATION {
 2415   EVENT_TYPE EventType;
 2416   LONG EventState;
 2417 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
 2418 
 2419 typedef enum _SEMAPHORE_INFORMATION_CLASS {
 2420   SemaphoreBasicInformation
 2421 } SEMAPHORE_INFORMATION_CLASS, *PSEMAPHORE_INFORMATION_CLASS;
 2422 
 2423 typedef struct _SEMAPHORE_BASIC_INFORMATION {
 2424   ULONG CurrentCount;
 2425   ULONG MaximumCount;
 2426 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
 2427 
 2428 typedef enum _SECTION_INFORMATION_CLASS
 2429 {
 2430   SectionBasicInformation,
 2431   SectionImageInformation,
 2432 } SECTION_INFORMATION_CLASS;
 2433 
 2434 typedef struct _SECTION_BASIC_INFORMATION {
 2435   PVOID BaseAddress;
 2436   ULONG Attributes;
 2437   LARGE_INTEGER Size;
 2438 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
 2439 
 2440 typedef struct _SECTION_IMAGE_INFORMATION {
 2441   PVOID TransferAddress;
 2442   ULONG ZeroBits;
 2443   SIZE_T MaximumStackSize;
 2444   SIZE_T CommittedStackSize;
 2445   ULONG SubSystemType;
 2446   WORD SubsystemVersionLow;
 2447   WORD SubsystemVersionHigh;
 2448   ULONG GpValue;
 2449   USHORT ImageCharacteristics;
 2450   USHORT DllCharacteristics;
 2451   USHORT Machine;
 2452   BOOLEAN ImageContainsCode;
 2453   union
 2454   {
 2455       UCHAR ImageFlags;
 2456       struct
 2457       {
 2458           UCHAR ComPlusNativeReady        : 1;
 2459           UCHAR ComPlusILOnly             : 1;
 2460           UCHAR ImageDynamicallyRelocated : 1;
 2461           UCHAR ImageMappedFlat           : 1;
 2462           UCHAR BaseBelow4gb              : 1;
 2463           UCHAR Reserved                  : 3;
 2464       } DUMMYSTRUCTNAME;
 2465   } DUMMYUNIONNAME;
 2466   ULONG LoaderFlags;
 2467   ULONG ImageFileSize;
 2468   ULONG CheckSum;
 2469 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
 2470 
 2471 typedef struct _LPC_SECTION_WRITE {
 2472   ULONG Length;
 2473   HANDLE SectionHandle;
 2474   ULONG SectionOffset;
 2475   ULONG ViewSize;
 2476   PVOID ViewBase;
 2477   PVOID TargetViewBase;
 2478 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
 2479 
 2480 typedef struct _LPC_SECTION_READ {
 2481   ULONG Length;
 2482   ULONG ViewSize;
 2483   PVOID ViewBase;
 2484 } LPC_SECTION_READ, *PLPC_SECTION_READ;
 2485 
 2486 typedef struct _LPC_MESSAGE {
 2487   USHORT DataSize;
 2488   USHORT MessageSize;
 2489   USHORT MessageType;
 2490   USHORT VirtualRangesOffset;
 2491   CLIENT_ID ClientId;
 2492   ULONG_PTR MessageId;
 2493   ULONG_PTR SectionSize;
 2494   UCHAR Data[ANYSIZE_ARRAY];
 2495 } LPC_MESSAGE, *PLPC_MESSAGE;
 2496 
 2497 typedef struct _RTL_USER_PROCESS_INFORMATION
 2498 {
 2499   ULONG Length;
 2500   HANDLE Process;
 2501   HANDLE Thread;
 2502   CLIENT_ID ClientId;
 2503   SECTION_IMAGE_INFORMATION ImageInformation;
 2504 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
 2505 
 2506 typedef enum _SHUTDOWN_ACTION {
 2507   ShutdownNoReboot,
 2508   ShutdownReboot,
 2509   ShutdownPowerOff
 2510 } SHUTDOWN_ACTION, *PSHUTDOWN_ACTION;
 2511 
 2512 typedef struct _COUNTED_REASON_CONTEXT
 2513 {
 2514     ULONG Version;
 2515     ULONG Flags;
 2516     union
 2517     {
 2518         struct
 2519         {
 2520             UNICODE_STRING ResourceFileName;
 2521             USHORT ResourceReasonId;
 2522             ULONG StringCount;
 2523             UNICODE_STRING *ReasonStrings;
 2524         } DUMMYSTRUCTNAME;
 2525         UNICODE_STRING SimpleString;
 2526     } DUMMYUNIONNAME;
 2527 } COUNTED_REASON_CONTEXT, *PCOUNTED_REASON_CONTEXT;
 2528 
 2529 typedef enum _KPROFILE_SOURCE {
 2530   ProfileTime,
 2531   ProfileAlignmentFixup,
 2532   ProfileTotalIssues,
 2533   ProfilePipelineDry,
 2534   ProfileLoadInstructions,
 2535   ProfilePipelineFrozen,
 2536   ProfileBranchInstructions,
 2537   ProfileTotalNonissues,
 2538   ProfileDcacheMisses,
 2539   ProfileIcacheMisses,
 2540   ProfileCacheMisses,
 2541   ProfileBranchMispredictions,
 2542   ProfileStoreInstructions,
 2543   ProfileFpInstructions,
 2544   ProfileIntegerInstructions,
 2545   Profile2Issue,
 2546   Profile3Issue,
 2547   Profile4Issue,
 2548   ProfileSpecialInstructions,
 2549   ProfileTotalCycles,
 2550   ProfileIcacheIssues,
 2551   ProfileDcacheAccesses,
 2552   ProfileMemoryBarrierCycles,
 2553   ProfileLoadLinkedIssues,
 2554   ProfileMaximum
 2555 } KPROFILE_SOURCE, *PKPROFILE_SOURCE;
 2556 
 2557 typedef struct _DIRECTORY_BASIC_INFORMATION {
 2558   UNICODE_STRING ObjectName;
 2559   UNICODE_STRING ObjectTypeName;
 2560 } DIRECTORY_BASIC_INFORMATION, *PDIRECTORY_BASIC_INFORMATION;
 2561 
 2562 typedef struct _INITIAL_TEB {
 2563     void *OldStackBase;
 2564     void *OldStackLimit;
 2565     void *StackBase;
 2566     void *StackLimit;
 2567     void *DeallocationStack;
 2568 } INITIAL_TEB, *PINITIAL_TEB;
 2569 
 2570 typedef enum _PORT_INFORMATION_CLASS {
 2571   PortNoInformation
 2572 } PORT_INFORMATION_CLASS, *PPORT_INFORMATION_CLASS;
 2573 
 2574 typedef enum _IO_COMPLETION_INFORMATION_CLASS {
 2575   IoCompletionBasicInformation
 2576 } IO_COMPLETION_INFORMATION_CLASS, *PIO_COMPLETION_INFORMATION_CLASS;
 2577 
 2578 typedef struct _FILE_COMPLETION_INFORMATION {
 2579     HANDLE CompletionPort;
 2580     ULONG_PTR CompletionKey;
 2581 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
 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 
 2587 typedef struct _FILE_IO_COMPLETION_INFORMATION {
 2588     ULONG_PTR CompletionKey;
 2589     ULONG_PTR CompletionValue;
 2590     IO_STATUS_BLOCK IoStatusBlock;
 2591 } FILE_IO_COMPLETION_INFORMATION, *PFILE_IO_COMPLETION_INFORMATION;
 2592 
 2593 typedef enum _HARDERROR_RESPONSE_OPTION {
 2594   OptionAbortRetryIgnore,
 2595   OptionOk,
 2596   OptionOkCancel,
 2597   OptionRetryCancel,
 2598   OptionYesNo,
 2599   OptionYesNoCancel,
 2600   OptionShutdownSystem
 2601 } HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION;
 2602 
 2603 typedef enum _HARDERROR_RESPONSE {
 2604   ResponseReturnToCaller,
 2605   ResponseNotHandled,
 2606   ResponseAbort,
 2607   ResponseCancel,
 2608   ResponseIgnore,
 2609   ResponseNo,
 2610   ResponseOk,
 2611   ResponseRetry,
 2612   ResponseYes
 2613 } HARDERROR_RESPONSE, *PHARDERROR_RESPONSE;
 2614 
 2615 typedef enum _SYSDBG_COMMAND {
 2616   SysDbgQueryModuleInformation,
 2617   SysDbgQueryTraceInformation,
 2618   SysDbgSetTracepoint,
 2619   SysDbgSetSpecialCall,
 2620   SysDbgClearSpecialCalls,
 2621   SysDbgQuerySpecialCalls,
 2622   SysDbgBreakPoint,
 2623   SysDbgQueryVersion,
 2624   SysDbgReadVirtual,
 2625   SysDbgWriteVirtual,
 2626   SysDbgReadPhysical,
 2627   SysDbgWritePhysical,
 2628   SysDbgReadControlSpace,
 2629   SysDbgWriteControlSpace,
 2630   SysDbgReadIoSpace,
 2631   SysDbgWriteIoSpace,
 2632   SysDbgReadMsr,
 2633   SysDbgWriteMsr,
 2634   SysDbgReadBusData,
 2635   SysDbgWriteBusData
 2636 } SYSDBG_COMMAND, *PSYSDBG_COMMAND;
 2637 
 2638 typedef struct _CPTABLEINFO
 2639 {
 2640     USHORT  CodePage;
 2641     USHORT  MaximumCharacterSize;
 2642     USHORT  DefaultChar;
 2643     USHORT  UniDefaultChar;
 2644     USHORT  TransDefaultChar;
 2645     USHORT  TransUniDefaultChar;
 2646     USHORT  DBCSCodePage;
 2647     UCHAR   LeadByte[12];
 2648     USHORT *MultiByteTable;
 2649     void   *WideCharTable;
 2650     USHORT *DBCSRanges;
 2651     USHORT *DBCSOffsets;
 2652 } CPTABLEINFO, *PCPTABLEINFO;
 2653 
 2654 typedef struct _NLSTABLEINFO
 2655 {
 2656     CPTABLEINFO OemTableInfo;
 2657     CPTABLEINFO AnsiTableInfo;
 2658     USHORT     *UpperCaseTable;
 2659     USHORT     *LowerCaseTable;
 2660 } NLSTABLEINFO, *PNLSTABLEINFO;
 2661 
 2662 /*************************************************************************
 2663  * Loader structures
 2664  *
 2665  * Those are not part of standard Winternl.h
 2666  */
 2667 
 2668 typedef struct _LDR_SERVICE_TAG_RECORD
 2669 {
 2670     struct _LDR_SERVICE_TAG_RECORD *Next;
 2671     ULONG ServiceTag;
 2672 } LDR_SERVICE_TAG_RECORD, *PLDR_SERVICE_TAG_RECORD;
 2673 
 2674 typedef struct _LDRP_CSLIST
 2675 {
 2676     SINGLE_LIST_ENTRY *Tail;
 2677 } LDRP_CSLIST, *PLDRP_CSLIST;
 2678 
 2679 typedef enum _LDR_DDAG_STATE
 2680 {
 2681     LdrModulesMerged = -5,
 2682     LdrModulesInitError = -4,
 2683     LdrModulesSnapError = -3,
 2684     LdrModulesUnloaded = -2,
 2685     LdrModulesUnloading = -1,
 2686     LdrModulesPlaceHolder = 0,
 2687     LdrModulesMapping = 1,
 2688     LdrModulesMapped = 2,
 2689     LdrModulesWaitingForDependencies = 3,
 2690     LdrModulesSnapping = 4,
 2691     LdrModulesSnapped = 5,
 2692     LdrModulesCondensed = 6,
 2693     LdrModulesReadyToInit = 7,
 2694     LdrModulesInitializing = 8,
 2695     LdrModulesReadyToRun = 9,
 2696 } LDR_DDAG_STATE;
 2697 
 2698 typedef struct _LDR_DDAG_NODE
 2699 {
 2700     LIST_ENTRY Modules;
 2701     LDR_SERVICE_TAG_RECORD *ServiceTagList;
 2702     ULONG LoadCount;
 2703     ULONG ReferenceCount;
 2704     ULONG DependencyCount;
 2705     union
 2706     {
 2707         LDRP_CSLIST Dependencies;
 2708         SINGLE_LIST_ENTRY RemovalLink;
 2709     };
 2710     LDRP_CSLIST IncomingDependencies;
 2711     LDR_DDAG_STATE State;
 2712     SINGLE_LIST_ENTRY CondenseLink;
 2713     ULONG PreorderNumber;
 2714     ULONG LowestLink;
 2715 } LDR_DDAG_NODE, *PLDR_DDAG_NODE;
 2716 
 2717 typedef enum _LDR_DLL_LOAD_REASON
 2718 {
 2719     LoadReasonStaticDependency,
 2720     LoadReasonStaticForwarderDependency,
 2721     LoadReasonDynamicForwarderDependency,
 2722     LoadReasonDelayloadDependency,
 2723     LoadReasonDynamicLoad,
 2724     LoadReasonAsImageLoad,
 2725     LoadReasonAsDataLoad,
 2726     LoadReasonUnknown = -1
 2727 } LDR_DLL_LOAD_REASON, *PLDR_DLL_LOAD_REASON;
 2728 
 2729 typedef struct _LDR_DATA_TABLE_ENTRY
 2730 {
 2731     LIST_ENTRY          InLoadOrderLinks;
 2732     LIST_ENTRY          InMemoryOrderLinks;
 2733     LIST_ENTRY          InInitializationOrderLinks;
 2734     void*               DllBase;
 2735     void*               EntryPoint;
 2736     ULONG               SizeOfImage;
 2737     UNICODE_STRING      FullDllName;
 2738     UNICODE_STRING      BaseDllName;
 2739     ULONG               Flags;
 2740     SHORT               LoadCount;
 2741     SHORT               TlsIndex;
 2742     HANDLE              SectionHandle;
 2743     ULONG               CheckSum;
 2744     ULONG               TimeDateStamp;
 2745     HANDLE              ActivationContext;
 2746     void*               Lock;
 2747     LDR_DDAG_NODE*      DdagNode;
 2748     LIST_ENTRY          NodeModuleLink;
 2749     struct _LDRP_LOAD_CONTEXT *LoadContext;
 2750     void*               ParentDllBase;
 2751     void*               SwitchBackContext;
 2752     RTL_BALANCED_NODE   BaseAddressIndexNode;
 2753     RTL_BALANCED_NODE   MappingInfoIndexNode;
 2754     ULONG_PTR           OriginalBase;
 2755     LARGE_INTEGER       LoadTime;
 2756     ULONG               BaseNameHashValue;
 2757     LDR_DLL_LOAD_REASON LoadReason;
 2758     ULONG               ImplicitPathOptions;
 2759     ULONG               ReferenceCount;
 2760 } LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;
 2761 
 2762 typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
 2763 {
 2764     ULONG Flags;
 2765     const UNICODE_STRING *FullDllName;
 2766     const UNICODE_STRING *BaseDllName;
 2767     void *DllBase;
 2768     ULONG SizeOfImage;
 2769 } LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;
 2770 
 2771 typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA
 2772 {
 2773     ULONG Flags;
 2774     const UNICODE_STRING *FullDllName;
 2775     const UNICODE_STRING *BaseDllName;
 2776     void *DllBase;
 2777     ULONG SizeOfImage;
 2778 } LDR_DLL_UNLOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;
 2779 
 2780 typedef union _LDR_DLL_NOTIFICATION_DATA
 2781 {
 2782     LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
 2783     LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
 2784 } LDR_DLL_NOTIFICATION_DATA, *PLDR_DLL_NOTIFICATION_DATA;
 2785 
 2786 typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICATION_DATA*, void*);
 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 */
 2813     PVOID               MappedBaseAddress;              /* 04/08 */
 2814     PVOID               ImageBaseAddress;               /* 08/10 */
 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 */
 2821     BYTE                Name[MAXIMUM_FILENAME_LENGTH];  /* 1c/28 */
 2822 } SYSTEM_MODULE, *PSYSTEM_MODULE;
 2823 
 2824 typedef struct _SYSTEM_MODULE_INFORMATION
 2825 {
 2826     ULONG               ModulesCount;
 2827     SYSTEM_MODULE       Modules[1]; /* FIXME: should be Modules[0] */
 2828 } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
 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 
 2842 typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
 2843 {
 2844     USHORT NextOffset;
 2845     SYSTEM_MODULE BaseInfo;
 2846     ULONG ImageCheckSum;
 2847     ULONG TimeDateStamp;
 2848     void *DefaultBase;
 2849 } RTL_PROCESS_MODULE_INFORMATION_EX;
 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 
 2858 typedef LONG (CALLBACK *PRTL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
 2859 
 2860 typedef void (CALLBACK *PTP_IO_CALLBACK)(PTP_CALLBACK_INSTANCE,void*,void*,IO_STATUS_BLOCK*,PTP_IO);
 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 {
 2868     PsAttributeParentProcess,
 2869     PsAttributeDebugPort,
 2870     PsAttributeToken,
 2871     PsAttributeClientId,
 2872     PsAttributeTebAddress,
 2873     PsAttributeImageName,
 2874     PsAttributeImageInfo,
 2875     PsAttributeMemoryReserve,
 2876     PsAttributePriorityClass,
 2877     PsAttributeErrorMode,
 2878     PsAttributeStdHandleInfo,
 2879     PsAttributeHandleList,
 2880     PsAttributeGroupAffinity,
 2881     PsAttributePreferredNode,
 2882     PsAttributeIdealProcessor,
 2883     PsAttributeUmsThread,
 2884     PsAttributeMitigationOptions,
 2885     PsAttributeProtectionLevel,
 2886     PsAttributeSecureProcess,
 2887     PsAttributeJobList,
 2888     PsAttributeChildProcessPolicy,
 2889     PsAttributeAllApplicationPackagesPolicy,
 2890     PsAttributeWin32kFilter,
 2891     PsAttributeSafeOpenPromptOriginClaim,
 2892     PsAttributeBnoIsolation,
 2893     PsAttributeDesktopAppPolicy,
 2894     PsAttributeChpe,
 2895     PsAttributeMax
 2896 } PS_ATTRIBUTE_NUM;
 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 {
 2926     ULONG_PTR Attribute;
 2927     SIZE_T    Size;
 2928     union
 2929     {
 2930         ULONG_PTR Value;
 2931         void     *ValuePtr;
 2932     };
 2933     SIZE_T *ReturnLength;
 2934 } PS_ATTRIBUTE;
 2935 
 2936 typedef struct _PS_ATTRIBUTE_LIST
 2937 {
 2938     SIZE_T       TotalLength;
 2939     PS_ATTRIBUTE Attributes[1];
 2940 } PS_ATTRIBUTE_LIST, *PPS_ATTRIBUTE_LIST;
 2941 
 2942 typedef enum _PS_CREATE_STATE
 2943 {
 2944     PsCreateInitialState,
 2945     PsCreateFailOnFileOpen,
 2946     PsCreateFailOnSectionCreate,
 2947     PsCreateFailExeFormat,
 2948     PsCreateFailMachineMismatch,
 2949     PsCreateFailExeName,
 2950     PsCreateSuccess,
 2951     PsCreateMaximumStates
 2952 } PS_CREATE_STATE;
 2953 
 2954 typedef struct _PS_CREATE_INFO
 2955 {
 2956     SIZE_T Size;
 2957     PS_CREATE_STATE State;
 2958     union
 2959     {
 2960         struct
 2961         {
 2962             union
 2963             {
 2964                 ULONG InitFlags;
 2965                 struct
 2966                 {
 2967                     UCHAR WriteOutputOnExit : 1;
 2968                     UCHAR DetectManifest : 1;
 2969                     UCHAR IFEOSkipDebugger : 1;
 2970                     UCHAR IFEODoNotPropagateKeyState : 1;
 2971                     UCHAR SpareBits1 : 4;
 2972                     UCHAR SpareBits2 : 8;
 2973                     USHORT ProhibitedImageCharacteristics : 16;
 2974                 };
 2975             };
 2976             ACCESS_MASK AdditionalFileAccess;
 2977         } InitState;
 2978         struct
 2979         {
 2980             HANDLE FileHandle;
 2981         } FailSection;
 2982         struct
 2983         {
 2984             USHORT DllCharacteristics;
 2985         } ExeFormat;
 2986         struct
 2987         {
 2988             HANDLE IFEOKey;
 2989         } ExeName;
 2990         struct
 2991         {
 2992             union
 2993             {
 2994                 ULONG OutputFlags;
 2995                 struct
 2996                 {
 2997                     UCHAR ProtectedProcess : 1;
 2998                     UCHAR AddressSpaceOverride : 1;
 2999                     UCHAR DevOverrideEnabled : 1;
 3000                     UCHAR ManifestDetected : 1;
 3001                     UCHAR ProtectedProcessLight : 1;
 3002                     UCHAR SpareBits1 : 3;
 3003                     UCHAR SpareBits2 : 8;
 3004                     USHORT SpareBits3 : 16;
 3005                 };
 3006             };
 3007             HANDLE FileHandle;
 3008             HANDLE SectionHandle;
 3009             ULONGLONG UserProcessParametersNative;
 3010             ULONG UserProcessParametersWow64;
 3011             ULONG CurrentParameterFlags;
 3012             ULONGLONG PebAddressNative;
 3013             ULONG PebAddressWow64;
 3014             ULONGLONG ManifestAddress;
 3015             ULONG ManifestSize;
 3016         } SuccessState;
 3017     };
 3018 } PS_CREATE_INFO, *PPS_CREATE_INFO;
 3019 
 3020 /***********************************************************************
 3021  * Function declarations
 3022  */
 3023 
 3024 NTSYSAPI void      WINAPI DbgBreakPoint(void);
 3025 NTSYSAPI NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...);
 3026 NTSYSAPI NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...);
 3027 NTSYSAPI NTSTATUS  WINAPI DbgUiIssueRemoteBreakin(HANDLE);
 3028 NTSYSAPI void      WINAPI DbgUiRemoteBreakin(void*);
 3029 NTSYSAPI void      WINAPI DbgUserBreakPoint(void);
 3030 NTSYSAPI NTSTATUS  WINAPI LdrAccessResource(HMODULE,const IMAGE_RESOURCE_DATA_ENTRY*,void**,PULONG);
 3031 NTSYSAPI NTSTATUS  WINAPI LdrAddDllDirectory(const UNICODE_STRING*,void**);
 3032 NTSYSAPI NTSTATUS  WINAPI LdrAddRefDll(ULONG,HMODULE);
 3033 NTSYSAPI NTSTATUS  WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
 3034 NTSYSAPI NTSTATUS  WINAPI LdrFindEntryForAddress(const void*, PLDR_DATA_TABLE_ENTRY*);
 3035 NTSYSAPI NTSTATUS  WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DIRECTORY**);
 3036 NTSYSAPI NTSTATUS  WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const IMAGE_RESOURCE_DATA_ENTRY**);
 3037 NTSYSAPI NTSTATUS  WINAPI LdrGetDllDirectory(UNICODE_STRING*);
 3038 NTSYSAPI NTSTATUS  WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
 3039 NTSYSAPI NTSTATUS  WINAPI LdrGetDllPath(PCWSTR,ULONG,PWSTR*,PWSTR*);
 3040 NTSYSAPI NTSTATUS  WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
 3041 NTSYSAPI NTSTATUS  WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
 3042 NTSYSAPI NTSTATUS  WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
 3043 IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
 3044 NTSYSAPI NTSTATUS  WINAPI LdrQueryImageFileExecutionOptions(const UNICODE_STRING*,LPCWSTR,ULONG,void*,ULONG,ULONG*);
 3045 NTSYSAPI NTSTATUS  WINAPI LdrQueryProcessModuleInformation(SYSTEM_MODULE_INFORMATION*, ULONG, ULONG*);
 3046 NTSYSAPI NTSTATUS  WINAPI LdrRegisterDllNotification(ULONG,PLDR_DLL_NOTIFICATION_FUNCTION,void*,void**);
 3047 NTSYSAPI NTSTATUS  WINAPI LdrRemoveDllDirectory(void*);
 3048 NTSYSAPI NTSTATUS  WINAPI LdrSetDefaultDllDirectories(ULONG);
 3049 NTSYSAPI NTSTATUS  WINAPI LdrSetDllDirectory(const UNICODE_STRING*);
 3050 NTSYSAPI void      WINAPI LdrShutdownProcess(void);
 3051 NTSYSAPI void      WINAPI LdrShutdownThread(void);
 3052 NTSYSAPI NTSTATUS  WINAPI LdrUnloadDll(HMODULE);
 3053 NTSYSAPI NTSTATUS  WINAPI LdrUnlockLoaderLock(ULONG,ULONG_PTR);
 3054 NTSYSAPI NTSTATUS  WINAPI LdrUnregisterDllNotification(void*);
 3055 NTSYSAPI NTSTATUS  WINAPI NtAcceptConnectPort(PHANDLE,ULONG,PLPC_MESSAGE,BOOLEAN,PLPC_SECTION_WRITE,PLPC_SECTION_READ);
 3056 NTSYSAPI NTSTATUS  WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
 3057 NTSYSAPI NTSTATUS  WINAPI NtAccessCheckAndAuditAlarm(PUNICODE_STRING,HANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,ACCESS_MASK,PGENERIC_MAPPING,BOOLEAN,PACCESS_MASK,PBOOLEAN,PBOOLEAN);
 3058 NTSYSAPI NTSTATUS  WINAPI NtAddAtom(const WCHAR*,ULONG,RTL_ATOM*);
 3059 NTSYSAPI NTSTATUS  WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
 3060 NTSYSAPI NTSTATUS  WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
 3061 NTSYSAPI NTSTATUS  WINAPI NtAlertResumeThread(HANDLE,PULONG);
 3062 NTSYSAPI NTSTATUS  WINAPI NtAlertThread(HANDLE ThreadHandle);
 3063 NTSYSAPI NTSTATUS  WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
 3064 NTSYSAPI NTSTATUS  WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR);
 3065 NTSYSAPI NTSTATUS  WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG_PTR,SIZE_T*,ULONG,ULONG);
 3066 NTSYSAPI NTSTATUS  WINAPI NtAllocateVirtualMemoryEx(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG,MEM_EXTENDED_PARAMETER*,ULONG);
 3067 NTSYSAPI NTSTATUS  WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
 3068 NTSYSAPI NTSTATUS  WINAPI NtAssignProcessToJobObject(HANDLE,HANDLE);
 3069 NTSYSAPI NTSTATUS  WINAPI NtCallbackReturn(PVOID,ULONG,NTSTATUS);
 3070 NTSYSAPI NTSTATUS  WINAPI NtCancelIoFile(HANDLE,PIO_STATUS_BLOCK);
 3071 NTSYSAPI NTSTATUS  WINAPI NtCancelIoFileEx(HANDLE,PIO_STATUS_BLOCK,PIO_STATUS_BLOCK);
 3072 NTSYSAPI NTSTATUS  WINAPI NtCancelTimer(HANDLE, BOOLEAN*);
 3073 NTSYSAPI NTSTATUS  WINAPI NtClearEvent(HANDLE);
 3074 NTSYSAPI NTSTATUS  WINAPI NtClearPowerRequest(HANDLE,POWER_REQUEST_TYPE);
 3075 NTSYSAPI NTSTATUS  WINAPI NtClose(HANDLE);
 3076 NTSYSAPI NTSTATUS  WINAPI NtCloseObjectAuditAlarm(PUNICODE_STRING,HANDLE,BOOLEAN);
 3077 NTSYSAPI NTSTATUS  WINAPI NtCompleteConnectPort(HANDLE);
 3078 NTSYSAPI NTSTATUS  WINAPI NtConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
 3079 NTSYSAPI NTSTATUS  WINAPI NtContinue(PCONTEXT,BOOLEAN);
 3080 NTSYSAPI NTSTATUS  WINAPI NtCreateDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
 3081 NTSYSAPI NTSTATUS  WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,EVENT_TYPE,BOOLEAN);
 3082 NTSYSAPI NTSTATUS  WINAPI NtCreateEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES);
 3083 NTSYSAPI NTSTATUS  WINAPI NtCreateFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,PLARGE_INTEGER,ULONG,ULONG,ULONG,ULONG,PVOID,ULONG);
 3084 NTSYSAPI NTSTATUS  WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG);
 3085 NTSYSAPI NTSTATUS  WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3086 NTSYSAPI NTSTATUS  WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
 3087 NTSYSAPI NTSTATUS  WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*);
 3088 NTSYSAPI NTSTATUS  WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
 3089 NTSYSAPI NTSTATUS  WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER);
 3090 NTSYSAPI NTSTATUS  WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN);
 3091 NTSYSAPI NTSTATUS  WINAPI NtCreateNamedPipeFile(PHANDLE,ULONG,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,ULONG,PLARGE_INTEGER);
 3092 NTSYSAPI NTSTATUS  WINAPI NtCreatePagingFile(PUNICODE_STRING,PLARGE_INTEGER,PLARGE_INTEGER,PLARGE_INTEGER);
 3093 NTSYSAPI NTSTATUS  WINAPI NtCreatePort(PHANDLE,POBJECT_ATTRIBUTES,ULONG,ULONG,PULONG);
 3094 NTSYSAPI NTSTATUS  WINAPI NtCreatePowerRequest(HANDLE*,COUNTED_REASON_CONTEXT*);
 3095 NTSYSAPI NTSTATUS  WINAPI NtCreateProcess(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,BOOLEAN,HANDLE,HANDLE,HANDLE);
 3096 NTSYSAPI NTSTATUS  WINAPI NtCreateProfile(PHANDLE,HANDLE,PVOID,ULONG,ULONG,PVOID,ULONG,KPROFILE_SOURCE,KAFFINITY);
 3097 NTSYSAPI NTSTATUS  WINAPI NtCreateSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const LARGE_INTEGER*,ULONG,ULONG,HANDLE);
 3098 NTSYSAPI NTSTATUS  WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,LONG,LONG);
 3099 NTSYSAPI NTSTATUS  WINAPI NtCreateSymbolicLinkObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PUNICODE_STRING);
 3100 NTSYSAPI NTSTATUS  WINAPI NtCreateThread(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,HANDLE,PCLIENT_ID,PCONTEXT,PINITIAL_TEB,BOOLEAN);
 3101 NTSYSAPI NTSTATUS  WINAPI NtCreateThreadEx(HANDLE*,ACCESS_MASK,OBJECT_ATTRIBUTES*,HANDLE,PRTL_THREAD_START_ROUTINE,void*,ULONG,SIZE_T,SIZE_T,SIZE_T,PS_ATTRIBUTE_LIST*);
 3102 NTSYSAPI NTSTATUS  WINAPI NtCreateTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*, TIMER_TYPE);
 3103 NTSYSAPI NTSTATUS  WINAPI NtCreateToken(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,TOKEN_TYPE,PLUID,PLARGE_INTEGER,PTOKEN_USER,PTOKEN_GROUPS,PTOKEN_PRIVILEGES,PTOKEN_OWNER,PTOKEN_PRIMARY_GROUP,PTOKEN_DEFAULT_DACL,PTOKEN_SOURCE);
 3104 NTSYSAPI NTSTATUS  WINAPI NtCreateUserProcess(HANDLE*,HANDLE*,ACCESS_MASK,ACCESS_MASK,OBJECT_ATTRIBUTES*,OBJECT_ATTRIBUTES*,ULONG,ULONG,RTL_USER_PROCESS_PARAMETERS*,PS_CREATE_INFO*,PS_ATTRIBUTE_LIST*);
 3105 NTSYSAPI NTSTATUS  WINAPI NtDelayExecution(BOOLEAN,const LARGE_INTEGER*);
 3106 NTSYSAPI NTSTATUS  WINAPI NtDeleteAtom(RTL_ATOM);
 3107 NTSYSAPI NTSTATUS  WINAPI NtDeleteFile(POBJECT_ATTRIBUTES);
 3108 NTSYSAPI NTSTATUS  WINAPI NtDeleteKey(HANDLE);
 3109 NTSYSAPI NTSTATUS  WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING *);
 3110 NTSYSAPI NTSTATUS  WINAPI NtDeviceIoControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
 3111 NTSYSAPI NTSTATUS  WINAPI NtDisplayString(PUNICODE_STRING);
 3112 NTSYSAPI NTSTATUS  WINAPI NtDuplicateObject(HANDLE,HANDLE,HANDLE,PHANDLE,ACCESS_MASK,ULONG,ULONG);
 3113 NTSYSAPI NTSTATUS  WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
 3114 NTSYSAPI NTSTATUS  WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
 3115 NTSYSAPI NTSTATUS  WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3116 NTSYSAPI NTSTATUS  WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
 3117 NTSYSAPI NTSTATUS  WINAPI NtFilterToken(HANDLE,ULONG,TOKEN_GROUPS*,TOKEN_PRIVILEGES*,TOKEN_GROUPS*,HANDLE*);
 3118 NTSYSAPI NTSTATUS  WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
 3119 NTSYSAPI NTSTATUS  WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
 3120 NTSYSAPI NTSTATUS  WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
 3121 NTSYSAPI NTSTATUS  WINAPI NtFlushKey(HANDLE);
 3122 NTSYSAPI void      WINAPI NtFlushProcessWriteBuffers(void);
 3123 NTSYSAPI NTSTATUS  WINAPI NtFlushVirtualMemory(HANDLE,LPCVOID*,SIZE_T*,ULONG);
 3124 NTSYSAPI NTSTATUS  WINAPI NtFlushWriteBuffer(VOID);
 3125 NTSYSAPI NTSTATUS  WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
 3126 NTSYSAPI NTSTATUS  WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG);
 3127 NTSYSAPI NTSTATUS  WINAPI NtGetContextThread(HANDLE,CONTEXT*);
 3128 NTSYSAPI ULONG     WINAPI NtGetCurrentProcessorNumber(void);
 3129 NTSYSAPI NTSTATUS  WINAPI NtGetNlsSectionPtr(ULONG,ULONG,void*,void**,SIZE_T*);
 3130 NTSYSAPI NTSTATUS  WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG);
 3131 NTSYSAPI ULONG     WINAPI NtGetTickCount(VOID);
 3132 NTSYSAPI NTSTATUS  WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*);
 3133 NTSYSAPI NTSTATUS  WINAPI NtImpersonateAnonymousToken(HANDLE);
 3134 NTSYSAPI NTSTATUS  WINAPI NtImpersonateClientOfPort(HANDLE,PPORT_MESSAGE);
 3135 NTSYSAPI NTSTATUS  WINAPI NtImpersonateThread(HANDLE,HANDLE,PSECURITY_QUALITY_OF_SERVICE);
 3136 NTSYSAPI NTSTATUS  WINAPI NtInitializeRegistry(BOOLEAN);
 3137 NTSYSAPI NTSTATUS  WINAPI NtInitiatePowerAction(POWER_ACTION,SYSTEM_POWER_STATE,ULONG,BOOLEAN);
 3138 NTSYSAPI NTSTATUS  WINAPI NtIsProcessInJob(HANDLE,HANDLE);
 3139 NTSYSAPI NTSTATUS  WINAPI NtListenPort(HANDLE,PLPC_MESSAGE);
 3140 NTSYSAPI NTSTATUS  WINAPI NtLoadDriver(const UNICODE_STRING *);
 3141 NTSYSAPI NTSTATUS  WINAPI NtLoadKey(const OBJECT_ATTRIBUTES *,OBJECT_ATTRIBUTES *);
 3142 NTSYSAPI NTSTATUS  WINAPI NtLockFile(HANDLE,HANDLE,PIO_APC_ROUTINE,void*,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,ULONG*,BOOLEAN,BOOLEAN);
 3143 NTSYSAPI NTSTATUS  WINAPI NtLockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
 3144 NTSYSAPI NTSTATUS  WINAPI NtMakeTemporaryObject(HANDLE);
 3145 NTSYSAPI NTSTATUS  WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG_PTR,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG);
 3146 NTSYSAPI NTSTATUS  WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN);
 3147 NTSYSAPI NTSTATUS  WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
 3148 NTSYSAPI NTSTATUS  WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN);
 3149 NTSYSAPI NTSTATUS  WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3150 NTSYSAPI NTSTATUS  WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
 3151 NTSYSAPI NTSTATUS  WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3152 NTSYSAPI NTSTATUS  WINAPI NtOpenFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG);
 3153 NTSYSAPI NTSTATUS  WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3154 NTSYSAPI NTSTATUS  WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3155 NTSYSAPI NTSTATUS  WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *);
 3156 NTSYSAPI NTSTATUS  WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG);
 3157 NTSYSAPI NTSTATUS  WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE);
 3158 NTSYSAPI NTSTATUS  WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE);
 3159 NTSYSAPI NTSTATUS  WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3160 NTSYSAPI NTSTATUS  WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3161 NTSYSAPI NTSTATUS  WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN);
 3162 NTSYSAPI NTSTATUS  WINAPI NtOpenProcess(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
 3163 NTSYSAPI NTSTATUS  WINAPI NtOpenProcessToken(HANDLE,DWORD,HANDLE *);
 3164 NTSYSAPI NTSTATUS  WINAPI NtOpenProcessTokenEx(HANDLE,DWORD,DWORD,HANDLE *);
 3165 NTSYSAPI NTSTATUS  WINAPI NtOpenSection(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3166 NTSYSAPI NTSTATUS  WINAPI NtOpenSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3167 NTSYSAPI NTSTATUS  WINAPI NtOpenSymbolicLinkObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
 3168 NTSYSAPI NTSTATUS  WINAPI NtOpenThread(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,const CLIENT_ID*);
 3169 NTSYSAPI NTSTATUS  WINAPI NtOpenThreadToken(HANDLE,DWORD,BOOLEAN,HANDLE *);
 3170 NTSYSAPI NTSTATUS  WINAPI NtOpenThreadTokenEx(HANDLE,DWORD,BOOLEAN,DWORD,HANDLE *);
 3171 NTSYSAPI NTSTATUS  WINAPI NtOpenTimer(HANDLE*, ACCESS_MASK, const OBJECT_ATTRIBUTES*);
 3172 NTSYSAPI NTSTATUS  WINAPI NtPowerInformation(POWER_INFORMATION_LEVEL,PVOID,ULONG,PVOID,ULONG);
 3173 NTSYSAPI NTSTATUS  WINAPI NtPrivilegeCheck(HANDLE,PPRIVILEGE_SET,PBOOLEAN);
 3174 NTSYSAPI NTSTATUS  WINAPI NtPrivilegeObjectAuditAlarm(PUNICODE_STRING,HANDLE,HANDLE,ULONG,PPRIVILEGE_SET,BOOLEAN);
 3175 NTSYSAPI NTSTATUS  WINAPI NtPrivilegedServiceAuditAlarm(PUNICODE_STRING,PUNICODE_STRING,HANDLE,PPRIVILEGE_SET,BOOLEAN);
 3176 NTSYSAPI NTSTATUS  WINAPI NtProtectVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG,ULONG*);
 3177 NTSYSAPI NTSTATUS  WINAPI NtPulseEvent(HANDLE,LONG*);
 3178 NTSYSAPI NTSTATUS  WINAPI NtQueueApcThread(HANDLE,PNTAPCFUNC,ULONG_PTR,ULONG_PTR,ULONG_PTR);
 3179 NTSYSAPI NTSTATUS  WINAPI NtQueryAttributesFile(const OBJECT_ATTRIBUTES*,FILE_BASIC_INFORMATION*);
 3180 NTSYSAPI NTSTATUS  WINAPI NtQueryDefaultLocale(BOOLEAN,LCID*);
 3181 NTSYSAPI NTSTATUS  WINAPI NtQueryDefaultUILanguage(LANGID*);
 3182 NTSYSAPI NTSTATUS  WINAPI NtQueryDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN);
 3183 NTSYSAPI NTSTATUS  WINAPI NtQueryDirectoryObject(HANDLE,PDIRECTORY_BASIC_INFORMATION,ULONG,BOOLEAN,BOOLEAN,PULONG,PULONG);
 3184 NTSYSAPI NTSTATUS  WINAPI NtQueryEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,BOOLEAN,PVOID,ULONG,PULONG,BOOLEAN);
 3185 NTSYSAPI NTSTATUS  WINAPI NtQueryEvent(HANDLE,EVENT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3186 NTSYSAPI NTSTATUS  WINAPI NtQueryFullAttributesFile(const OBJECT_ATTRIBUTES*,FILE_NETWORK_OPEN_INFORMATION*);
 3187 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationAtom(RTL_ATOM,ATOM_INFORMATION_CLASS,PVOID,ULONG,ULONG*);
 3188 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,LONG,FILE_INFORMATION_CLASS);
 3189 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG,PULONG);
 3190 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationPort(HANDLE,PORT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3191 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG);
 3192 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationThread(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG);
 3193 NTSYSAPI NTSTATUS  WINAPI NtQueryInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3194 NTSYSAPI NTSTATUS  WINAPI NtQueryInstallUILanguage(LANGID*);
 3195 NTSYSAPI NTSTATUS  WINAPI NtQueryIntervalProfile(KPROFILE_SOURCE,PULONG);
 3196 NTSYSAPI NTSTATUS  WINAPI NtQueryIoCompletion(HANDLE,IO_COMPLETION_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3197 NTSYSAPI NTSTATUS  WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
 3198 NTSYSAPI NTSTATUS  WINAPI NtQueryMultipleValueKey(HANDLE,PKEY_MULTIPLE_VALUE_INFORMATION,ULONG,PVOID,ULONG,PULONG);
 3199 NTSYSAPI NTSTATUS  WINAPI NtQueryMutant(HANDLE,MUTANT_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3200 NTSYSAPI NTSTATUS  WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
 3201 NTSYSAPI NTSTATUS  WINAPI NtQueryOpenSubKeys(POBJECT_ATTRIBUTES,PULONG);
 3202 NTSYSAPI NTSTATUS  WINAPI NtQueryPerformanceCounter(PLARGE_INTEGER, PLARGE_INTEGER);
 3203 NTSYSAPI NTSTATUS  WINAPI NtQuerySecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,ULONG,PULONG);
 3204 NTSYSAPI NTSTATUS  WINAPI NtQuerySection(HANDLE,SECTION_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
 3205 NTSYSAPI NTSTATUS  WINAPI NtQuerySemaphore(HANDLE,SEMAPHORE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3206 NTSYSAPI NTSTATUS  WINAPI NtQuerySymbolicLinkObject(HANDLE,PUNICODE_STRING,PULONG);
 3207 NTSYSAPI NTSTATUS  WINAPI NtQuerySystemEnvironmentValue(PUNICODE_STRING,PWCHAR,ULONG,PULONG);
 3208 NTSYSAPI NTSTATUS  WINAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3209 NTSYSAPI NTSTATUS  WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS,void*,ULONG,void*,ULONG,ULONG*);
 3210 NTSYSAPI NTSTATUS  WINAPI NtQuerySystemTime(PLARGE_INTEGER);
 3211 NTSYSAPI NTSTATUS  WINAPI NtQueryTimer(HANDLE,TIMER_INFORMATION_CLASS,PVOID,ULONG,PULONG);
 3212 NTSYSAPI NTSTATUS  WINAPI NtQueryTimerResolution(PULONG,PULONG,PULONG);
 3213 NTSYSAPI NTSTATUS  WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING *,KEY_VALUE_INFORMATION_CLASS,void *,DWORD,DWORD *);
 3214 NTSYSAPI NTSTATUS  WINAPI NtQueryLicenseValue(const UNICODE_STRING *,ULONG *,PVOID,ULONG,ULONG *);
 3215 NTSYSAPI NTSTATUS  WINAPI NtQueryVirtualMemory(HANDLE,LPCVOID,MEMORY_INFORMATION_CLASS,PVOID,SIZE_T,SIZE_T*);
 3216 NTSYSAPI NTSTATUS  WINAPI NtQueryVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
 3217 NTSYSAPI NTSTATUS  WINAPI NtRaiseException(PEXCEPTION_RECORD,PCONTEXT,BOOL);
 3218 NTSYSAPI NTSTATUS  WINAPI NtRaiseHardError(NTSTATUS,ULONG,PUNICODE_STRING,PVOID*,HARDERROR_RESPONSE_OPTION,PHARDERROR_RESPONSE);
 3219 NTSYSAPI NTSTATUS  WINAPI NtReadFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,PLARGE_INTEGER,PULONG);
 3220 NTSYSAPI NTSTATUS  WINAPI NtReadFileScatter(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
 3221 NTSYSAPI NTSTATUS  WINAPI NtReadRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
 3222 NTSYSAPI NTSTATUS  WINAPI NtReadVirtualMemory(HANDLE,const void*,void*,SIZE_T,SIZE_T*);
 3223 NTSYSAPI NTSTATUS  WINAPI NtRegisterThreadTerminatePort(HANDLE);
 3224 NTSYSAPI NTSTATUS  WINAPI NtReleaseKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
 3225 NTSYSAPI NTSTATUS  WINAPI NtReleaseMutant(HANDLE,PLONG);
 3226 NTSYSAPI NTSTATUS  WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
 3227 NTSYSAPI NTSTATUS  WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER);
 3228 NTSYSAPI NTSTATUS  WINAPI NtRemoveIoCompletionEx(HANDLE,FILE_IO_COMPLETION_INFORMATION*,ULONG,ULONG*,LARGE_INTEGER*,BOOLEAN);
 3229 NTSYSAPI NTSTATUS  WINAPI NtRenameKey(HANDLE,UNICODE_STRING*);
 3230 NTSYSAPI NTSTATUS  WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES);
 3231 NTSYSAPI NTSTATUS  WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE);
 3232 NTSYSAPI NTSTATUS  WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE);
 3233 NTSYSAPI NTSTATUS  WINAPI NtReplyWaitReceivePortEx(HANDLE,PVOID*,PPORT_MESSAGE,PPORT_MESSAGE,PLARGE_INTEGER);
 3234 NTSYSAPI NTSTATUS  WINAPI NtReplyWaitReplyPort(HANDLE,PLPC_MESSAGE);
 3235 NTSYSAPI NTSTATUS  WINAPI NtRequestPort(HANDLE,PLPC_MESSAGE);
 3236 NTSYSAPI NTSTATUS  WINAPI NtRequestWaitReplyPort(HANDLE,PLPC_MESSAGE,PLPC_MESSAGE);
 3237 NTSYSAPI NTSTATUS  WINAPI NtResetEvent(HANDLE,LONG*);
 3238 NTSYSAPI NTSTATUS  WINAPI NtResetWriteWatch(HANDLE,PVOID,SIZE_T);
 3239 NTSYSAPI NTSTATUS  WINAPI NtRestoreKey(HANDLE,HANDLE,ULONG);
 3240 NTSYSAPI NTSTATUS  WINAPI NtResumeProcess(HANDLE);
 3241 NTSYSAPI NTSTATUS  WINAPI NtResumeThread(HANDLE,PULONG);
 3242 NTSYSAPI NTSTATUS  WINAPI NtSaveKey(HANDLE,HANDLE);
 3243 NTSYSAPI NTSTATUS  WINAPI NtSecureConnectPort(PHANDLE,PUNICODE_STRING,PSECURITY_QUALITY_OF_SERVICE,PLPC_SECTION_WRITE,PSID,PLPC_SECTION_READ,PULONG,PVOID,PULONG);
 3244 NTSYSAPI NTSTATUS  WINAPI NtSetContextThread(HANDLE,const CONTEXT*);
 3245 NTSYSAPI NTSTATUS  WINAPI NtSetDefaultHardErrorPort(HANDLE);
 3246 NTSYSAPI NTSTATUS  WINAPI NtSetDefaultLocale(BOOLEAN,LCID);
 3247 NTSYSAPI NTSTATUS  WINAPI NtSetDefaultUILanguage(LANGID);
 3248 NTSYSAPI NTSTATUS  WINAPI NtSetEaFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG);
 3249 NTSYSAPI NTSTATUS  WINAPI NtSetEvent(HANDLE,LONG*);
 3250 NTSYSAPI NTSTATUS  WINAPI NtSetHighEventPair(HANDLE);
 3251 NTSYSAPI NTSTATUS  WINAPI NtSetHighWaitLowEventPair(HANDLE);
 3252 NTSYSAPI NTSTATUS  WINAPI NtSetHighWaitLowThread(VOID);
 3253 NTSYSAPI NTSTATUS  WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS);
 3254 NTSYSAPI NTSTATUS  WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG);
 3255 NTSYSAPI NTSTATUS  WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG);
 3256 NTSYSAPI NTSTATUS  WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
 3257 NTSYSAPI NTSTATUS  WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG);
 3258 NTSYSAPI NTSTATUS  WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG);
 3259 NTSYSAPI NTSTATUS  WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG);
 3260 NTSYSAPI NTSTATUS  WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);
 3261 NTSYSAPI NTSTATUS  WINAPI NtSetIoCompletion(HANDLE,ULONG_PTR,ULONG_PTR,NTSTATUS,SIZE_T);
 3262 NTSYSAPI NTSTATUS  WINAPI NtSetLdtEntries(ULONG,LDT_ENTRY,ULONG,LDT_ENTRY);
 3263 NTSYSAPI NTSTATUS  WINAPI NtSetLowEventPair(HANDLE);
 3264 NTSYSAPI NTSTATUS  WINAPI NtSetLowWaitHighEventPair(HANDLE);
 3265 NTSYSAPI NTSTATUS  WINAPI NtSetLowWaitHighThread(VOID);
 3266 NTSYSAPI NTSTATUS  WINAPI NtSetPowerRequest(HANDLE,POWER_REQUEST_TYPE);
 3267 NTSYSAPI NTSTATUS  WINAPI NtSetSecurityObject(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
 3268 NTSYSAPI NTSTATUS  WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_STRING);
 3269 NTSYSAPI NTSTATUS  WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
 3270 NTSYSAPI NTSTATUS  WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
 3271 NTSYSAPI NTSTATUS  WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
 3272 NTSYSAPI NTSTATUS  WINAPI NtSetThreadExecutionState(EXECUTION_STATE,EXECUTION_STATE*);
 3273 NTSYSAPI NTSTATUS  WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
 3274 NTSYSAPI NTSTATUS  WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
 3275 NTSYSAPI NTSTATUS  WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
 3276 NTSYSAPI NTSTATUS  WINAPI NtSetVolumeInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS);
 3277 NTSYSAPI NTSTATUS  WINAPI NtSignalAndWaitForSingleObject(HANDLE,HANDLE,BOOLEAN,const LARGE_INTEGER*);
 3278 NTSYSAPI NTSTATUS  WINAPI NtShutdownSystem(SHUTDOWN_ACTION);
 3279 NTSYSAPI NTSTATUS  WINAPI NtStartProfile(HANDLE);
 3280 NTSYSAPI NTSTATUS  WINAPI NtStopProfile(HANDLE);
 3281 NTSYSAPI NTSTATUS  WINAPI NtSuspendProcess(HANDLE);
 3282 NTSYSAPI NTSTATUS  WINAPI NtSuspendThread(HANDLE,PULONG);
 3283 NTSYSAPI NTSTATUS  WINAPI NtSystemDebugControl(SYSDBG_COMMAND,PVOID,ULONG,PVOID,ULONG,PULONG);
 3284 NTSYSAPI NTSTATUS  WINAPI NtTerminateJobObject(HANDLE,NTSTATUS);
 3285 NTSYSAPI NTSTATUS  WINAPI NtTerminateProcess(HANDLE,LONG);
 3286 NTSYSAPI NTSTATUS  WINAPI NtTerminateThread(HANDLE,LONG);
 3287 NTSYSAPI NTSTATUS  WINAPI NtTestAlert(VOID);
 3288 NTSYSAPI NTSTATUS  WINAPI NtUnloadDriver(const UNICODE_STRING *);
 3289 NTSYSAPI NTSTATUS  WINAPI NtUnloadKey(POBJECT_ATTRIBUTES);
 3290 NTSYSAPI NTSTATUS  WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
 3291 NTSYSAPI NTSTATUS  WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
 3292 NTSYSAPI NTSTATUS  WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
 3293 NTSYSAPI NTSTATUS  WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
 3294 NTSYSAPI NTSTATUS  WINAPI NtVdmControl(ULONG,PVOID);
 3295 NTSYSAPI NTSTATUS  WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
 3296 NTSYSAPI NTSTATUS  WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
 3297 NTSYSAPI NTSTATUS  WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
 3298 NTSYSAPI NTSTATUS  WINAPI NtWaitHighEventPair(HANDLE);
 3299 NTSYSAPI NTSTATUS  WINAPI NtWaitLowEventPair(HANDLE);
 3300 NTSYSAPI NTSTATUS  WINAPI NtWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
 3301 NTSYSAPI NTSTATUS  WINAPI NtWriteFileGather(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,FILE_SEGMENT_ELEMENT*,ULONG,PLARGE_INTEGER,PULONG);
 3302 NTSYSAPI NTSTATUS  WINAPI NtWriteRequestData(HANDLE,PLPC_MESSAGE,ULONG,PVOID,ULONG,PULONG);
 3303 NTSYSAPI NTSTATUS  WINAPI NtWriteVirtualMemory(HANDLE,void*,const void*,SIZE_T,SIZE_T*);
 3304 NTSYSAPI NTSTATUS  WINAPI NtYieldExecution(void);
 3305 
 3306 NTSYSAPI NTSTATUS  WINAPI RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PULONG);
 3307 NTSYSAPI void      WINAPI RtlAcquirePebLock(void);
 3308 NTSYSAPI BYTE      WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK,BYTE);
 3309 NTSYSAPI BYTE      WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK,BYTE);
 3310 NTSYSAPI void      WINAPI RtlAcquireSRWLockExclusive(RTL_SRWLOCK*);
 3311 NTSYSAPI void      WINAPI RtlAcquireSRWLockShared(RTL_SRWLOCK*);
 3312 NTSYSAPI NTSTATUS  WINAPI RtlActivateActivationContext(DWORD,HANDLE,ULONG_PTR*);
 3313 NTSYSAPI NTSTATUS  WINAPI RtlActivateActivationContextEx(ULONG,TEB*,HANDLE,ULONG_PTR*);
 3314 NTSYSAPI NTSTATUS  WINAPI RtlAddAce(PACL,DWORD,DWORD,PACE_HEADER,DWORD);
 3315 NTSYSAPI NTSTATUS  WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
 3316 NTSYSAPI NTSTATUS  WINAPI RtlAddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
 3317 NTSYSAPI NTSTATUS  WINAPI RtlAddAccessAllowedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
 3318 NTSYSAPI NTSTATUS  WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
 3319 NTSYSAPI NTSTATUS  WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
 3320 NTSYSAPI NTSTATUS  WINAPI RtlAddAccessDeniedObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID);
 3321 NTSYSAPI NTSTATUS  WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
 3322 NTSYSAPI NTSTATUS  WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
 3323 NTSYSAPI NTSTATUS  WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
 3324 NTSYSAPI NTSTATUS  WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
 3325 NTSYSAPI NTSTATUS  WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
 3326 NTSYSAPI void      WINAPI RtlAddRefActivationContext(HANDLE);
 3327 NTSYSAPI PVOID     WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
 3328 NTSYSAPI NTSTATUS  WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
 3329 NTSYSAPI NTSTATUS  WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
 3330 NTSYSAPI RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
 3331 NTSYSAPI PVOID     WINAPI RtlAllocateHeap(HANDLE,ULONG,SIZE_T) __WINE_ALLOC_SIZE(3);
 3332 NTSYSAPI WCHAR     WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);
 3333 NTSYSAPI DWORD     WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
 3334 NTSYSAPI NTSTATUS  WINAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING,PCANSI_STRING,BOOLEAN);
 3335 NTSYSAPI NTSTATUS  WINAPI RtlAppendAsciizToString(STRING *,LPCSTR);
 3336 NTSYSAPI NTSTATUS  WINAPI RtlAppendStringToString(STRING *,const STRING *);
 3337 NTSYSAPI NTSTATUS  WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING *,const UNICODE_STRING *);
 3338 NTSYSAPI NTSTATUS  WINAPI RtlAppendUnicodeToString(UNICODE_STRING *,LPCWSTR);
 3339 NTSYSAPI BOOLEAN   WINAPI RtlAreAllAccessesGranted(ACCESS_MASK,ACCESS_MASK);
 3340 NTSYSAPI BOOLEAN   WINAPI RtlAreAnyAccessesGranted(ACCESS_MASK,ACCESS_MASK);
 3341 NTSYSAPI BOOLEAN   WINAPI RtlAreBitsSet(PCRTL_BITMAP,ULONG,ULONG);
 3342 NTSYSAPI BOOLEAN   WINAPI RtlAreBitsClear(PCRTL_BITMAP,ULONG,ULONG);
 3343 NTSYSAPI NTSTATUS  WINAPI RtlCharToInteger(PCSZ,ULONG,PULONG);
 3344 NTSYSAPI NTSTATUS  WINAPI RtlCheckRegistryKey(ULONG, PWSTR);
 3345 NTSYSAPI void      WINAPI RtlClearAllBits(PRTL_BITMAP);
 3346 NTSYSAPI void      WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
 3347 NTSYSAPI NTSTATUS  WINAPI RtlCreateActivationContext(HANDLE*,const void*);
 3348 NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
 3349 NTSYSAPI NTSTATUS  WINAPI RtlCreateRegistryKey(ULONG,PWSTR);
 3350 NTSYSAPI ULONG     WINAPI RtlCompactHeap(HANDLE,ULONG);
 3351 NTSYSAPI LONG      WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
 3352 NTSYSAPI LONG      WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
 3353 NTSYSAPI LONG      WINAPI RtlCompareUnicodeStrings(const WCHAR*,SIZE_T,const WCHAR*,SIZE_T,BOOLEAN);
 3354 NTSYSAPI NTSTATUS  WINAPI RtlCompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
 3355 NTSYSAPI DWORD     WINAPI RtlComputeCrc32(DWORD,const BYTE*,INT);
 3356 NTSYSAPI NTSTATUS  WINAPI RtlConvertSidToUnicodeString(PUNICODE_STRING,PSID,BOOLEAN);
 3357 NTSYSAPI NTSTATUS  WINAPI RtlConvertToAutoInheritSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID*,BOOL,PGENERIC_MAPPING);
 3358 NTSYSAPI void      WINAPI RtlCopyLuid(PLUID,const LUID*);
 3359 NTSYSAPI void      WINAPI RtlCopyLuidAndAttributesArray(ULONG,const LUID_AND_ATTRIBUTES*,PLUID_AND_ATTRIBUTES);
 3360 NTSYSAPI BOOLEAN   WINAPI RtlCopySid(DWORD,PSID,PSID);
 3361 NTSYSAPI NTSTATUS  WINAPI RtlCopySecurityDescriptor(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR);
 3362 NTSYSAPI void      WINAPI RtlCopyString(STRING*,const STRING*);
 3363 NTSYSAPI void      WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
 3364 NTSYSAPI NTSTATUS  WINAPI RtlCreateAcl(PACL,DWORD,DWORD);
 3365 NTSYSAPI NTSTATUS  WINAPI RtlCreateAtomTable(ULONG,RTL_ATOM_TABLE*);
 3366 NTSYSAPI NTSTATUS  WINAPI RtlCreateEnvironment(BOOLEAN, PWSTR*);
 3367 NTSYSAPI HANDLE    WINAPI RtlCreateHeap(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION);
 3368 NTSYSAPI NTSTATUS  WINAPI RtlCreateProcessParameters(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*);
 3369 NTSYSAPI NTSTATUS  WINAPI RtlCreateProcessParametersEx(RTL_USER_PROCESS_PARAMETERS**,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,PWSTR,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,const UNICODE_STRING*,ULONG);
 3370 NTSYSAPI NTSTATUS  WINAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
 3371 NTSYSAPI NTSTATUS  WINAPI RtlCreateTimerQueue(PHANDLE);
 3372 NTSYSAPI NTSTATUS  WINAPI RtlCreateTimer(PHANDLE, HANDLE, RTL_WAITORTIMERCALLBACKFUNC, PVOID, DWORD, DWORD, ULONG);
 3373 NTSYSAPI BOOLEAN   WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
 3374 NTSYSAPI BOOLEAN   WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
 3375 NTSYSAPI NTSTATUS  WINAPI RtlCreateUserProcess(UNICODE_STRING*,ULONG,RTL_USER_PROCESS_PARAMETERS*,SECURITY_DESCRIPTOR*,SECURITY_DESCRIPTOR*,HANDLE,BOOLEAN,HANDLE,HANDLE,RTL_USER_PROCESS_INFORMATION*);
 3376 NTSYSAPI NTSTATUS  WINAPI RtlCreateUserThread(HANDLE,SECURITY_DESCRIPTOR*,BOOLEAN,PVOID,SIZE_T,SIZE_T,PRTL_THREAD_START_ROUTINE,void*,HANDLE*,CLIENT_ID*);
 3377 NTSYSAPI NTSTATUS  WINAPI RtlCreateUserStack(SIZE_T,SIZE_T,ULONG,SIZE_T,SIZE_T,INITIAL_TEB*);
 3378 NTSYSAPI NTSTATUS  WINAPI RtlCustomCPToUnicodeN(CPTABLEINFO*,WCHAR*,DWORD,DWORD*,const char*,DWORD);
 3379 NTSYSAPI void      WINAPI RtlDeactivateActivationContext(DWORD,ULONG_PTR);
 3380 NTSYSAPI PVOID     WINAPI RtlDecodePointer(PVOID);
 3381 NTSYSAPI NTSTATUS  WINAPI RtlDecompressBuffer(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,PULONG);
 3382 NTSYSAPI NTSTATUS  WINAPI RtlDecompressFragment(USHORT,PUCHAR,ULONG,PUCHAR,ULONG,ULONG,PULONG,PVOID);
 3383 NTSYSAPI NTSTATUS  WINAPI RtlDeleteAce(PACL,DWORD);
 3384 NTSYSAPI NTSTATUS  WINAPI RtlDeleteAtomFromAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
 3385 NTSYSAPI NTSTATUS  WINAPI RtlDeleteCriticalSection(RTL_CRITICAL_SECTION *);
 3386 NTSYSAPI NTSTATUS  WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR);
 3387 NTSYSAPI void      WINAPI RtlDeleteResource(LPRTL_RWLOCK);
 3388 NTSYSAPI NTSTATUS  WINAPI RtlDeleteSecurityObject(PSECURITY_DESCRIPTOR*);
 3389 NTSYSAPI NTSTATUS  WINAPI RtlDeleteTimer(HANDLE, HANDLE, HANDLE);
 3390 NTSYSAPI NTSTATUS  WINAPI RtlDeleteTimerQueueEx(HANDLE, HANDLE);
 3391 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlDeNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
 3392 NTSYSAPI NTSTATUS  WINAPI RtlDeregisterWait(HANDLE);
 3393 NTSYSAPI NTSTATUS  WINAPI RtlDeregisterWaitEx(HANDLE,HANDLE);
 3394 NTSYSAPI NTSTATUS  WINAPI RtlDestroyAtomTable(RTL_ATOM_TABLE);
 3395 NTSYSAPI NTSTATUS  WINAPI RtlDestroyEnvironment(PWSTR);
 3396 NTSYSAPI NTSTATUS  WINAPI RtlDestroyHandleTable(RTL_HANDLE_TABLE *);
 3397 NTSYSAPI HANDLE    WINAPI RtlDestroyHeap(HANDLE);
 3398 NTSYSAPI void      WINAPI RtlDestroyProcessParameters(RTL_USER_PROCESS_PARAMETERS*);
 3399 NTSYSAPI NTSTATUS  WINAPI RtlDestroyQueryDebugBuffer(PDEBUG_BUFFER);
 3400 NTSYSAPI DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
 3401 NTSYSAPI BOOLEAN   WINAPI RtlDllShutdownInProgress(void);
 3402 NTSYSAPI BOOLEAN   WINAPI RtlDoesFileExists_U(LPCWSTR);
 3403 NTSYSAPI BOOLEAN   WINAPI RtlDosPathNameToNtPathName_U(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
 3404 NTSYSAPI NTSTATUS  WINAPI RtlDosPathNameToNtPathName_U_WithStatus(PCWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
 3405 NTSYSAPI ULONG     WINAPI RtlDosSearchPath_U(LPCWSTR, LPCWSTR, LPCWSTR, ULONG, LPWSTR, LPWSTR*);
 3406 NTSYSAPI WCHAR     WINAPI RtlDowncaseUnicodeChar(WCHAR);
 3407 NTSYSAPI NTSTATUS  WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
 3408 NTSYSAPI void      WINAPI RtlDumpResource(LPRTL_RWLOCK);
 3409 NTSYSAPI NTSTATUS  WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
 3410 NTSYSAPI NTSTATUS  WINAPI RtlEmptyAtomTable(RTL_ATOM_TABLE,BOOLEAN);
 3411 NTSYSAPI PVOID     WINAPI RtlEncodePointer(PVOID);
 3412 NTSYSAPI NTSTATUS  WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *);
 3413 NTSYSAPI void      WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
 3414 NTSYSAPI NTSTATUS  WINAPI RtlEqualComputerName(const UNICODE_STRING*,const UNICODE_STRING*);
 3415 NTSYSAPI NTSTATUS  WINAPI RtlEqualDomainName(const UNICODE_STRING*,const UNICODE_STRING*);
 3416 NTSYSAPI BOOLEAN   WINAPI RtlEqualLuid(const LUID*,const LUID*);
 3417 NTSYSAPI BOOL      WINAPI RtlEqualPrefixSid(PSID,PSID);
 3418 NTSYSAPI BOOL      WINAPI RtlEqualSid(PSID,PSID);
 3419 NTSYSAPI BOOLEAN   WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
 3420 NTSYSAPI BOOLEAN   WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
 3421 NTSYSAPI void      DECLSPEC_NORETURN WINAPI RtlExitUserProcess(ULONG);
 3422 NTSYSAPI void      DECLSPEC_NORETURN WINAPI RtlExitUserThread(ULONG);
 3423 NTSYSAPI NTSTATUS  WINAPI RtlExpandEnvironmentStrings(const WCHAR*,WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
 3424 NTSYSAPI NTSTATUS  WINAPI RtlExpandEnvironmentStrings_U(PCWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*);
 3425 NTSYSAPI NTSTATUS  WINAPI RtlFindActivationContextSectionString(ULONG,const GUID*,ULONG,const UNICODE_STRING*,PVOID);
 3426 NTSYSAPI NTSTATUS  WINAPI RtlFindActivationContextSectionGuid(ULONG,const GUID*,ULONG,const GUID*,PVOID);
 3427 NTSYSAPI NTSTATUS  WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
 3428 NTSYSAPI ULONG     WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
 3429 NTSYSAPI ULONG     WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
 3430 NTSYSAPI ULONG     WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
 3431 NTSYSAPI ULONG     WINAPI RtlFindLastBackwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
 3432 NTSYSAPI ULONG     WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
 3433 NTSYSAPI CCHAR     WINAPI RtlFindLeastSignificantBit(ULONGLONG);
 3434 NTSYSAPI ULONG     WINAPI RtlFindLongestRunSet(PCRTL_BITMAP,PULONG);
 3435 NTSYSAPI ULONG     WINAPI RtlFindLongestRunClear(PCRTL_BITMAP,PULONG);
 3436 NTSYSAPI NTSTATUS  WINAPI RtlFindMessage(HMODULE,ULONG,ULONG,ULONG,const MESSAGE_RESOURCE_ENTRY**);
 3437 NTSYSAPI CCHAR     WINAPI RtlFindMostSignificantBit(ULONGLONG);
 3438 NTSYSAPI ULONG     WINAPI RtlFindNextForwardRunSet(PCRTL_BITMAP,ULONG,PULONG);
 3439 NTSYSAPI ULONG     WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP,ULONG,PULONG);
 3440 NTSYSAPI ULONG     WINAPI RtlFindSetBits(PCRTL_BITMAP,ULONG,ULONG);
 3441 NTSYSAPI ULONG     WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP,ULONG,ULONG);
 3442 NTSYSAPI ULONG     WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
 3443 NTSYSAPI BOOLEAN   WINAPI RtlFirstFreeAce(PACL,PACE_HEADER *);
 3444 NTSYSAPI NTSTATUS  WINAPI RtlFlsAlloc(PFLS_CALLBACK_FUNCTION,ULONG *);
 3445 NTSYSAPI NTSTATUS  WINAPI RtlFlsFree(ULONG);
 3446 NTSYSAPI NTSTATUS  WINAPI RtlFlsGetValue(ULONG,void **);
 3447 NTSYSAPI NTSTATUS  WINAPI RtlFlsSetValue(ULONG,void *);
 3448 NTSYSAPI NTSTATUS  WINAPI RtlFormatCurrentUserKeyPath(PUNICODE_STRING);
 3449 NTSYSAPI NTSTATUS  WINAPI RtlFormatMessage(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*);
 3450 NTSYSAPI NTSTATUS  WINAPI RtlFormatMessageEx(LPCWSTR,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list *,LPWSTR,ULONG,ULONG*,ULONG);
 3451 NTSYSAPI void      WINAPI RtlFreeAnsiString(PANSI_STRING);
 3452 NTSYSAPI BOOLEAN   WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
 3453 NTSYSAPI BOOLEAN   WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
 3454 NTSYSAPI void      WINAPI RtlFreeOemString(POEM_STRING);
 3455 NTSYSAPI DWORD     WINAPI RtlFreeSid(PSID);
 3456 NTSYSAPI void      WINAPI RtlFreeThreadActivationContextStack(void);
 3457 NTSYSAPI void      WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
 3458 NTSYSAPI void      WINAPI RtlFreeUserStack(void*);
 3459 NTSYSAPI NTSTATUS  WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
 3460 NTSYSAPI NTSTATUS  WINAPI RtlGetActiveActivationContext(HANDLE*);
 3461 NTSYSAPI NTSTATUS  WINAPI RtlGetCompressionWorkSpaceSize(USHORT,PULONG,PULONG);
 3462 NTSYSAPI NTSTATUS  WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
 3463 NTSYSAPI ULONG     WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
 3464 NTSYSAPI PEB *     WINAPI RtlGetCurrentPeb(void);
 3465 NTSYSAPI NTSTATUS  WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
 3466 NTSYSAPI NTSTATUS  WINAPI RtlGetExePath(PCWSTR,PWSTR*);
 3467 NTSYSAPI TEB_ACTIVE_FRAME * WINAPI RtlGetFrame(void);
 3468 NTSYSAPI ULONG     WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
 3469 NTSYSAPI NTSTATUS  WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
 3470 NTSYSAPI NTSTATUS  WINAPI RtlGetLastNtStatus(void);
 3471 NTSYSAPI DWORD     WINAPI RtlGetLastWin32Error(void);
 3472 NTSYSAPI DWORD     WINAPI RtlGetLongestNtPathLength(void);
 3473 NTSYSAPI ULONG     WINAPI RtlGetNtGlobalFlags(void);
 3474 NTSYSAPI BOOLEAN   WINAPI RtlGetNtProductType(LPDWORD);
 3475 NTSYSAPI NTSTATUS  WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
 3476 NTSYSAPI ULONG     WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
 3477 NTSYSAPI NTSTATUS  WINAPI RtlGetProcessPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
 3478 NTSYSAPI NTSTATUS  WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
 3479 NTSYSAPI NTSTATUS  WINAPI RtlGetSearchPath(PWSTR*);
 3480 NTSYSAPI NTSTATUS  WINAPI RtlGetSystemPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
 3481 NTSYSAPI LONGLONG  WINAPI RtlGetSystemTimePrecise(void);
 3482 NTSYSAPI DWORD     WINAPI RtlGetThreadErrorMode(void);
 3483 NTSYSAPI NTSTATUS  WINAPI RtlGetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
 3484 NTSYSAPI NTSTATUS  WINAPI RtlGetUserPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
 3485 NTSYSAPI NTSTATUS  WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
 3486 NTSYSAPI NTSTATUS  WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
 3487 NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
 3488 NTSYSAPI NTSTATUS  WINAPI RtlIdnToAscii(DWORD,const WCHAR*,INT,WCHAR*,INT*);
 3489 NTSYSAPI NTSTATUS  WINAPI RtlIdnToNameprepUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
 3490 NTSYSAPI NTSTATUS  WINAPI RtlIdnToUnicode(DWORD,const WCHAR*,INT,WCHAR*,INT*);
 3491 NTSYSAPI PVOID     WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
 3492 NTSYSAPI PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE);
 3493 NTSYSAPI PIMAGE_SECTION_HEADER WINAPI RtlImageRvaToSection(const IMAGE_NT_HEADERS *,HMODULE,DWORD);
 3494 NTSYSAPI PVOID     WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SECTION_HEADER **);
 3495 NTSYSAPI NTSTATUS  WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
 3496 NTSYSAPI void      WINAPI RtlInitString(PSTRING,PCSZ);
 3497 NTSYSAPI void      WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
 3498 NTSYSAPI NTSTATUS  WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
 3499 NTSYSAPI void      WINAPI RtlInitCodePageTable(USHORT*,CPTABLEINFO*);
 3500 NTSYSAPI void      WINAPI RtlInitNlsTables(USHORT*,USHORT*,USHORT*,NLSTABLEINFO*);
 3501 NTSYSAPI void      WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
 3502 NTSYSAPI NTSTATUS  WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
 3503 NTSYSAPI void      WINAPI RtlInitializeBitMap(PRTL_BITMAP,PULONG,ULONG);
 3504 NTSYSAPI void      WINAPI RtlInitializeConditionVariable(RTL_CONDITION_VARIABLE *);
 3505 NTSYSAPI NTSTATUS  WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
 3506 NTSYSAPI NTSTATUS  WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,ULONG);
 3507 NTSYSAPI NTSTATUS  WINAPI RtlInitializeCriticalSectionEx(RTL_CRITICAL_SECTION *,ULONG,ULONG);
 3508 NTSYSAPI void      WINAPI RtlInitializeHandleTable(ULONG,ULONG,RTL_HANDLE_TABLE *);
 3509 NTSYSAPI void      WINAPI RtlInitializeResource(LPRTL_RWLOCK);
 3510 NTSYSAPI void      WINAPI RtlInitializeSRWLock(RTL_SRWLOCK*);
 3511 NTSYSAPI BOOL      WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
 3512 NTSYSAPI NTSTATUS  WINAPI RtlInt64ToUnicodeString(ULONGLONG,ULONG,UNICODE_STRING *);
 3513 NTSYSAPI NTSTATUS  WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR);
 3514 NTSYSAPI NTSTATUS  WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *);
 3515 NTSYSAPI BOOLEAN   WINAPI RtlIsActivationContextActive(HANDLE);
 3516 NTSYSAPI BOOL      WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
 3517 NTSYSAPI BOOL      WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
 3518 NTSYSAPI ULONG     WINAPI RtlIsDosDeviceName_U(PCWSTR);
 3519 NTSYSAPI BOOLEAN   WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
 3520 NTSYSAPI NTSTATUS  WINAPI RtlIsNormalizedString(ULONG,const WCHAR*,INT,BOOLEAN*);
 3521 NTSYSAPI BOOLEAN   WINAPI RtlIsProcessorFeaturePresent(UINT);
 3522 NTSYSAPI BOOLEAN   WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *);
 3523 NTSYSAPI BOOLEAN   WINAPI RtlIsValidHandle(const RTL_HANDLE_TABLE *, const RTL_HANDLE *);
 3524 NTSYSAPI BOOLEAN   WINAPI RtlIsValidIndexHandle(const RTL_HANDLE_TABLE *, ULONG Index, RTL_HANDLE **);
 3525 NTSYSAPI NTSTATUS  WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *);
 3526 NTSYSAPI DWORD     WINAPI RtlLengthRequiredSid(DWORD);
 3527 NTSYSAPI ULONG     WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR);
 3528 NTSYSAPI DWORD     WINAPI RtlLengthSid(PSID);
 3529 NTSYSAPI NTSTATUS  WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER);
 3530 NTSYSAPI NTSTATUS  WINAPI RtlLocaleNameToLcid(const WCHAR*,LCID*,ULONG);
 3531 NTSYSAPI BOOLEAN   WINAPI RtlLockHeap(HANDLE);
 3532 NTSYSAPI NTSTATUS  WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*);
 3533 NTSYSAPI NTSTATUS  WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
 3534 NTSYSAPI void      WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*);
 3535 NTSYSAPI NTSTATUS  WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
 3536 NTSYSAPI NTSTATUS  WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
 3537 NTSYSAPI NTSTATUS  WINAPI RtlNewSecurityObject(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOLEAN,HANDLE,PGENERIC_MAPPING);
 3538 NTSYSAPI PRTL_USER_PROCESS_PARAMETERS WINAPI RtlNormalizeProcessParams(RTL_USER_PROCESS_PARAMETERS*);
 3539 NTSYSAPI NTSTATUS  WINAPI RtlNormalizeString(ULONG,const WCHAR*,INT,WCHAR*,INT*);
 3540 NTSYSAPI ULONG     WINAPI RtlNtStatusToDosError(NTSTATUS);
 3541 NTSYSAPI ULONG     WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS);
 3542 NTSYSAPI ULONG     WINAPI RtlNumberOfSetBits(PCRTL_BITMAP);
 3543 NTSYSAPI ULONG     WINAPI RtlNumberOfClearBits(PCRTL_BITMAP);
 3544 NTSYSAPI UINT      WINAPI RtlOemStringToUnicodeSize(const STRING*);
 3545 NTSYSAPI NTSTATUS  WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
 3546 NTSYSAPI NTSTATUS  WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
 3547 NTSYSAPI NTSTATUS  WINAPI RtlOpenCurrentUser(ACCESS_MASK,PHANDLE);
 3548 NTSYSAPI PVOID     WINAPI RtlPcToFileHeader(PVOID,PVOID*);
 3549 NTSYSAPI NTSTATUS  WINAPI RtlPinAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM);
 3550 NTSYSAPI void      WINAPI RtlPopFrame(TEB_ACTIVE_FRAME*);
 3551 NTSYSAPI BOOLEAN   WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
 3552 NTSYSAPI BOOLEAN   WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
 3553 NTSYSAPI void      WINAPI RtlProcessFlsData(void*,ULONG);
 3554 NTSYSAPI void      WINAPI RtlPushFrame(TEB_ACTIVE_FRAME*);
 3555 NTSYSAPI NTSTATUS  WINAPI RtlQueryActivationContextApplicationSettings(DWORD,HANDLE,const WCHAR*,const WCHAR*,WCHAR*,SIZE_T,SIZE_T*);
 3556 NTSYSAPI NTSTATUS  WINAPI RtlQueryAtomInAtomTable(RTL_ATOM_TABLE,RTL_ATOM,ULONG*,ULONG*,WCHAR*,ULONG*);
 3557 NTSYSAPI NTSTATUS  WINAPI RtlQueryDynamicTimeZoneInformation(RTL_DYNAMIC_TIME_ZONE_INFORMATION*);
 3558 NTSYSAPI NTSTATUS  WINAPI RtlQueryEnvironmentVariable(WCHAR*,const WCHAR*,SIZE_T,WCHAR*,SIZE_T,SIZE_T*);
 3559 NTSYSAPI NTSTATUS  WINAPI RtlQueryEnvironmentVariable_U(PWSTR,PUNICODE_STRING,PUNICODE_STRING);
 3560 NTSYSAPI NTSTATUS  WINAPI RtlQueryHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T,PSIZE_T);
 3561 NTSYSAPI NTSTATUS  WINAPI RtlQueryInformationAcl(PACL,LPVOID,DWORD,ACL_INFORMATION_CLASS);
 3562 NTSYSAPI NTSTATUS  WINAPI RtlQueryInformationActivationContext(ULONG,HANDLE,PVOID,ULONG,PVOID,SIZE_T,SIZE_T*);
 3563 NTSYSAPI BOOL      WINAPI RtlQueryPerformanceCounter(LARGE_INTEGER*);
 3564 NTSYSAPI BOOL      WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*);
 3565 NTSYSAPI NTSTATUS  WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
 3566 NTSYSAPI NTSTATUS  WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
 3567 NTSYSAPI NTSTATUS  WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
 3568 NTSYSAPI BOOL      WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
 3569 NTSYSAPI NTSTATUS  WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
 3570 NTSYSAPI void      WINAPI RtlRaiseException(PEXCEPTION_RECORD);
 3571 NTSYSAPI void      WINAPI RtlRaiseStatus(NTSTATUS);
 3572 NTSYSAPI ULONG     WINAPI RtlRandom(PULONG);
 3573 NTSYSAPI PVOID     WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T);
 3574 NTSYSAPI NTSTATUS  WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);
 3575 NTSYSAPI void      WINAPI RtlReleaseActivationContext(HANDLE);
 3576 NTSYSAPI void      WINAPI RtlReleasePath(PWSTR);
 3577 NTSYSAPI void      WINAPI RtlReleasePebLock(void);
 3578 NTSYSAPI void      WINAPI RtlReleaseResource(LPRTL_RWLOCK);
 3579 NTSYSAPI void      WINAPI RtlReleaseSRWLockExclusive(RTL_SRWLOCK*);
 3580 NTSYSAPI void      WINAPI RtlReleaseSRWLockShared(RTL_SRWLOCK*);
 3581 NTSYSAPI ULONG     WINAPI RtlRemoveVectoredExceptionHandler(PVOID);
 3582 NTSYSAPI void      WINAPI RtlResetRtlTranslations(const NLSTABLEINFO*);
 3583 NTSYSAPI void      WINAPI RtlRestoreLastWin32Error(DWORD);
 3584 NTSYSAPI void      WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
 3585 NTSYSAPI void      WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
 3586 NTSYSAPI NTSTATUS  WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);
 3587 NTSYSAPI void      WINAPI RtlSetAllBits(PRTL_BITMAP);
 3588 NTSYSAPI void      WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
 3589 NTSYSAPI ULONG     WINAPI RtlSetCriticalSectionSpinCount(RTL_CRITICAL_SECTION*,ULONG);
 3590 NTSYSAPI NTSTATUS  WINAPI RtlSetControlSecurityDescriptor(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);
 3591 NTSYSAPI NTSTATUS  WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
 3592 NTSYSAPI void      WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
 3593 NTSYSAPI NTSTATUS  WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
 3594 NTSYSAPI NTSTATUS  WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
 3595 NTSYSAPI NTSTATUS  WINAPI RtlSetHeapInformation(HANDLE,HEAP_INFORMATION_CLASS,PVOID,SIZE_T);
 3596 NTSYSAPI NTSTATUS  WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
 3597 NTSYSAPI NTSTATUS  WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID,BOOLEAN);
 3598 NTSYSAPI NTSTATUS  WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
 3599 NTSYSAPI void      WINAPI RtlSetLastWin32Error(DWORD);
 3600 NTSYSAPI void      WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
 3601 NTSYSAPI NTSTATUS  WINAPI RtlSetProcessPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
 3602 NTSYSAPI NTSTATUS  WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
 3603 NTSYSAPI NTSTATUS  WINAPI RtlSetSearchPathMode(ULONG);
 3604 NTSYSAPI NTSTATUS  WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
 3605 NTSYSAPI NTSTATUS  WINAPI RtlSetThreadPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
 3606 NTSYSAPI NTSTATUS  WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
 3607 NTSYSAPI void      WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER);
 3608 NTSYSAPI SIZE_T    WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);
 3609 NTSYSAPI NTSTATUS  WINAPI RtlSleepConditionVariableCS(RTL_CONDITION_VARIABLE*,RTL_CRITICAL_SECTION*,const LARGE_INTEGER*);
 3610 NTSYSAPI NTSTATUS  WINAPI RtlSleepConditionVariableSRW(RTL_CONDITION_VARIABLE*,RTL_SRWLOCK*,const LARGE_INTEGER*,ULONG);
 3611 NTSYSAPI NTSTATUS  WINAPI RtlStringFromGUID(REFGUID,PUNICODE_STRING);
 3612 NTSYSAPI LPDWORD   WINAPI RtlSubAuthoritySid(PSID,DWORD);
 3613 NTSYSAPI LPBYTE    WINAPI RtlSubAuthorityCountSid(PSID);
 3614 NTSYSAPI NTSTATUS  WINAPI RtlSystemTimeToLocalTime(const LARGE_INTEGER*,PLARGE_INTEGER);
 3615 NTSYSAPI void      WINAPI RtlTimeToTimeFields(const LARGE_INTEGER*,PTIME_FIELDS);
 3616 NTSYSAPI BOOLEAN   WINAPI RtlTimeFieldsToTime(PTIME_FIELDS,PLARGE_INTEGER);
 3617 NTSYSAPI void      WINAPI RtlTimeToElapsedTimeFields(const LARGE_INTEGER *,PTIME_FIELDS);
 3618 NTSYSAPI BOOLEAN   WINAPI RtlTimeToSecondsSince1970(const LARGE_INTEGER *,LPDWORD);
 3619 NTSYSAPI BOOLEAN   WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *,LPDWORD);
 3620 NTSYSAPI BOOLEAN   WINAPI RtlTryAcquireSRWLockExclusive(RTL_SRWLOCK *);
 3621 NTSYSAPI BOOLEAN   WINAPI RtlTryAcquireSRWLockShared(RTL_SRWLOCK *);
 3622 NTSYSAPI BOOL      WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *);
 3623 NTSYSAPI NTSTATUS  WINAPI RtlUTF8ToUnicodeN(WCHAR*,DWORD,DWORD*,const char*,DWORD);
 3624 NTSYSAPI ULONGLONG __cdecl RtlUlonglongByteSwap(ULONGLONG);
 3625 NTSYSAPI DWORD     WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
 3626 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeStringToAnsiString(PANSI_STRING,PCUNICODE_STRING,BOOLEAN);
 3627 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeStringToInteger(const UNICODE_STRING *,ULONG,ULONG *);
 3628 NTSYSAPI DWORD     WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
 3629 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeStringToOemString(POEM_STRING,PCUNICODE_STRING,BOOLEAN);
 3630 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
 3631 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
 3632 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeToMultiByteSize(PULONG,PCWSTR,ULONG);
 3633 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
 3634 NTSYSAPI NTSTATUS  WINAPI RtlUnicodeToUTF8N(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
 3635 NTSYSAPI ULONG     WINAPI RtlUniform(PULONG);
 3636 NTSYSAPI BOOLEAN   WINAPI RtlUnlockHeap(HANDLE);
 3637 NTSYSAPI void      WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
 3638 #ifdef __x86_64__
 3639 NTSYSAPI void      WINAPI RtlUnwindEx(PVOID,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
 3640 #elif defined(__ia64__)
 3641 NTSYSAPI void      WINAPI RtlUnwind2(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT);
 3642 NTSYSAPI void      WINAPI RtlUnwindEx(FRAME_POINTERS,PVOID,PEXCEPTION_RECORD,PVOID,PCONTEXT,PUNWIND_HISTORY_TABLE);
 3643 #endif
 3644 NTSYSAPI WCHAR     WINAPI RtlUpcaseUnicodeChar(WCHAR);
 3645 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
 3646 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
 3647 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
 3648 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
 3649 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeToCustomCPN(CPTABLEINFO*,char*,DWORD,DWORD*,const WCHAR*,DWORD);
 3650 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
 3651 NTSYSAPI NTSTATUS  WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
 3652 NTSYSAPI NTSTATUS  WINAPI RtlUpdateTimer(HANDLE, HANDLE, DWORD, DWORD);
 3653 NTSYSAPI CHAR      WINAPI RtlUpperChar(CHAR);
 3654 NTSYSAPI void      WINAPI RtlUpperString(STRING *,const STRING *);
 3655 NTSYSAPI void      WINAPI RtlUserThreadStart(PRTL_THREAD_START_ROUTINE,void*);
 3656 NTSYSAPI NTSTATUS  WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
 3657 NTSYSAPI BOOLEAN   WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION);
 3658 NTSYSAPI BOOLEAN   WINAPI RtlValidAcl(PACL);
 3659 NTSYSAPI BOOLEAN   WINAPI RtlValidSid(PSID);
 3660 NTSYSAPI BOOLEAN   WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
 3661 NTSYSAPI NTSTATUS  WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
 3662 NTSYSAPI NTSTATUS  WINAPI RtlWaitOnAddress(const void *,const void *,SIZE_T,const LARGE_INTEGER *);
 3663 NTSYSAPI void      WINAPI RtlWakeAddressAll(const void *);
 3664 NTSYSAPI void      WINAPI RtlWakeAddressSingle(const void *);
 3665 NTSYSAPI void      WINAPI RtlWakeAllConditionVariable(RTL_CONDITION_VARIABLE *);
 3666 NTSYSAPI void      WINAPI RtlWakeConditionVariable(RTL_CONDITION_VARIABLE *);
 3667 NTSYSAPI NTSTATUS  WINAPI RtlWalkHeap(HANDLE,PVOID);
 3668 NTSYSAPI NTSTATUS  WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
 3669 NTSYSAPI NTSTATUS  WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
 3670 #ifdef __x86_64__
 3671 NTSYSAPI NTSTATUS  WINAPI RtlWow64GetThreadContext(HANDLE, WOW64_CONTEXT *);
 3672 NTSYSAPI NTSTATUS  WINAPI RtlWow64SetThreadContext(HANDLE, const WOW64_CONTEXT *);
 3673 #endif
 3674 NTSYSAPI NTSTATUS  WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
 3675 NTSYSAPI NTSTATUS  WINAPI RtlZombifyActivationContext(HANDLE);
 3676 NTSYSAPI NTSTATUS  WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
 3677 NTSYSAPI NTSTATUS  WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
 3678 NTSYSAPI NTSTATUS  WINAPI RtlpWaitForCriticalSection(RTL_CRITICAL_SECTION *);
 3679 NTSYSAPI NTSTATUS  WINAPI RtlpUnWaitCriticalSection(RTL_CRITICAL_SECTION *);
 3680 NTSYSAPI NTSTATUS  WINAPI vDbgPrintEx(ULONG,ULONG,LPCSTR,__ms_va_list);
 3681 NTSYSAPI NTSTATUS  WINAPI vDbgPrintExWithPrefix(LPCSTR,ULONG,ULONG,LPCSTR,__ms_va_list);
 3682 
 3683 #if defined(__x86_64__) || defined(__i386__)
 3684 NTSYSAPI NTSTATUS  WINAPI RtlCopyExtendedContext(CONTEXT_EX*,ULONG,CONTEXT_EX*);
 3685 NTSYSAPI NTSTATUS  WINAPI RtlInitializeExtendedContext(void*,ULONG,CONTEXT_EX**);
 3686 NTSYSAPI NTSTATUS  WINAPI RtlInitializeExtendedContext2(void*,ULONG,CONTEXT_EX**,ULONG64);
 3687 NTSYSAPI ULONG64   WINAPI RtlGetEnabledExtendedFeatures(ULONG64);
 3688 NTSYSAPI NTSTATUS  WINAPI RtlGetExtendedContextLength(ULONG,ULONG*);
 3689 NTSYSAPI NTSTATUS  WINAPI RtlGetExtendedContextLength2(ULONG,ULONG*,ULONG64);
 3690 NTSYSAPI void *    WINAPI RtlLocateLegacyContext(CONTEXT_EX*,ULONG*);
 3691 NTSYSAPI void *    WINAPI RtlLocateExtendedFeature(CONTEXT_EX*,ULONG,ULONG*);
 3692 NTSYSAPI void *    WINAPI RtlLocateExtendedFeature2(CONTEXT_EX*,ULONG,XSTATE_CONFIGURATION*,ULONG*);
 3693 NTSYSAPI ULONG64   WINAPI RtlGetExtendedFeaturesMask(CONTEXT_EX*);
 3694 NTSYSAPI void      WINAPI RtlSetExtendedFeaturesMask(CONTEXT_EX*,ULONG64);
 3695 #endif
 3696 
 3697 #ifndef __WINE_USE_MSVCRT
 3698 NTSYSAPI int __cdecl _strnicmp(LPCSTR,LPCSTR,size_t);
 3699 #endif
 3700 
 3701 /* 32-bit only functions */
 3702 
 3703 #ifndef _WIN64
 3704 NTSYSAPI LONGLONG  WINAPI RtlConvertLongToLargeInteger(LONG);
 3705 NTSYSAPI ULONGLONG WINAPI RtlConvertUlongToLargeInteger(ULONG);
 3706 NTSYSAPI LONGLONG  WINAPI RtlEnlargedIntegerMultiply(INT,INT);
 3707 NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
 3708 NTSYSAPI UINT      WINAPI RtlEnlargedUnsignedDivide(ULONGLONG,UINT,UINT *);
 3709 NTSYSAPI LONGLONG  WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
 3710 NTSYSAPI LONGLONG  WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
 3711 NTSYSAPI LONGLONG  WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
 3712 NTSYSAPI LONGLONG  WINAPI RtlInterlockedCompareExchange64(LONGLONG*,LONGLONG,LONGLONG);
 3713 NTSYSAPI LONGLONG  WINAPI RtlLargeIntegerAdd(LONGLONG,LONGLONG);
 3714 NTSYSAPI LONGLONG  WINAPI RtlLargeIntegerArithmeticShift(LONGLONG,INT);
 3715 NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG,ULONGLONG,ULONGLONG *);
 3716 NTSYSAPI LONGLONG  WINAPI RtlLargeIntegerNegate(LONGLONG);
 3717 NTSYSAPI LONGLONG  WINAPI RtlLargeIntegerShiftLeft(LONGLONG,INT);
 3718 NTSYSAPI LONGLONG  WINAPI RtlLargeIntegerShiftRight(LONGLONG,INT);
 3719 NTSYSAPI LONGLONG  WINAPI RtlLargeIntegerSubtract(LONGLONG,LONGLONG);
 3720 NTSYSAPI NTSTATUS  WINAPI RtlLargeIntegerToChar(const ULONGLONG *,ULONG,ULONG,PCHAR);
 3721 #endif
 3722 
 3723 /* Threadpool functions */
 3724 
 3725 NTSYSAPI NTSTATUS  WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **);
 3726 NTSYSAPI NTSTATUS  WINAPI TpAllocIoCompletion(TP_IO **,HANDLE,PTP_IO_CALLBACK,void *,TP_CALLBACK_ENVIRON *);
 3727 NTSYSAPI NTSTATUS  WINAPI TpAllocPool(TP_POOL **,PVOID);
 3728 NTSYSAPI NTSTATUS  WINAPI TpAllocTimer(TP_TIMER **,PTP_TIMER_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
 3729 NTSYSAPI NTSTATUS  WINAPI TpAllocWait(TP_WAIT **,PTP_WAIT_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
 3730 NTSYSAPI NTSTATUS  WINAPI TpAllocWork(TP_WORK **,PTP_WORK_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
 3731 NTSYSAPI void      WINAPI TpCallbackLeaveCriticalSectionOnCompletion(TP_CALLBACK_INSTANCE *,RTL_CRITICAL_SECTION *);
 3732 NTSYSAPI NTSTATUS  WINAPI TpCallbackMayRunLong(TP_CALLBACK_INSTANCE *);
 3733 NTSYSAPI void      WINAPI TpCallbackReleaseMutexOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
 3734 NTSYSAPI void      WINAPI TpCallbackReleaseSemaphoreOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE,DWORD);
 3735 NTSYSAPI void      WINAPI TpCallbackSetEventOnCompletion(TP_CALLBACK_INSTANCE *,HANDLE);
 3736 NTSYSAPI void      WINAPI TpCallbackUnloadDllOnCompletion(TP_CALLBACK_INSTANCE *,HMODULE);
 3737 NTSYSAPI void      WINAPI TpCancelAsyncIoOperation(TP_IO *);
 3738 NTSYSAPI void      WINAPI TpDisassociateCallback(TP_CALLBACK_INSTANCE *);
 3739 NTSYSAPI BOOL      WINAPI TpIsTimerSet(TP_TIMER *);
 3740 NTSYSAPI void      WINAPI TpPostWork(TP_WORK *);
 3741 NTSYSAPI NTSTATUS  WINAPI TpQueryPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
 3742 NTSYSAPI void      WINAPI TpReleaseCleanupGroup(TP_CLEANUP_GROUP *);
 3743 NTSYSAPI void      WINAPI TpReleaseCleanupGroupMembers(TP_CLEANUP_GROUP *,BOOL,PVOID);
 3744 NTSYSAPI void      WINAPI TpReleaseIoCompletion(TP_IO *);
 3745 NTSYSAPI void      WINAPI TpReleasePool(TP_POOL *);
 3746 NTSYSAPI void      WINAPI TpReleaseTimer(TP_TIMER *);
 3747 NTSYSAPI void      WINAPI TpReleaseWait(TP_WAIT *);
 3748 NTSYSAPI void      WINAPI TpReleaseWork(TP_WORK *);
 3749 NTSYSAPI void      WINAPI TpSetPoolMaxThreads(TP_POOL *,DWORD);
 3750 NTSYSAPI BOOL      WINAPI TpSetPoolMinThreads(TP_POOL *,DWORD);
 3751 NTSYSAPI NTSTATUS  WINAPI TpSetPoolStackInformation(TP_POOL *, TP_POOL_STACK_INFORMATION *stack_info);
 3752 NTSYSAPI void      WINAPI TpSetTimer(TP_TIMER *, LARGE_INTEGER *,LONG,LONG);
 3753 NTSYSAPI void      WINAPI TpSetWait(TP_WAIT *,HANDLE,LARGE_INTEGER *);
 3754 NTSYSAPI NTSTATUS  WINAPI TpSimpleTryPost(PTP_SIMPLE_CALLBACK,PVOID,TP_CALLBACK_ENVIRON *);
 3755 NTSYSAPI void      WINAPI TpStartAsyncIoOperation(TP_IO *);
 3756 NTSYSAPI void      WINAPI TpWaitForIoCompletion(TP_IO *,BOOL);
 3757 NTSYSAPI void      WINAPI TpWaitForTimer(TP_TIMER *,BOOL);
 3758 NTSYSAPI void      WINAPI TpWaitForWait(TP_WAIT *,BOOL);
 3759 NTSYSAPI void      WINAPI TpWaitForWork(TP_WORK *,BOOL);
 3760 
 3761 /* Wine internal functions */
 3762 
 3763 NTSYSAPI NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, char *nameA, SIZE_T *size,
 3764                                                    UINT disposition );
 3765 NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, SIZE_T *size );
 3766 
 3767 
 3768 /***********************************************************************
 3769  * Inline functions
 3770  */
 3771 
 3772 #define InitializeObjectAttributes(p,n,a,r,s) \
 3773     do { \
 3774         (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
 3775         (p)->RootDirectory = r; \
 3776         (p)->Attributes = a; \
 3777         (p)->ObjectName = n; \
 3778         (p)->SecurityDescriptor = s; \
 3779         (p)->SecurityQualityOfService = NULL; \
 3780     } while (0)
 3781 
 3782 #define NtCurrentProcess() ((HANDLE)-1)
 3783 
 3784 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
 3785 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
 3786 #define RtlStoreUlong(p,v)  do { ULONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
 3787 #define RtlStoreUlonglong(p,v) do { ULONGLONG _v = (v); memcpy((p), &_v, sizeof(_v)); } while (0)
 3788 #define RtlRetrieveUlong(p,s) memcpy((p), (s), sizeof(ULONG))
 3789 #define RtlRetrieveUlonglong(p,s) memcpy((p), (s), sizeof(ULONGLONG))
 3790 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
 3791 
 3792 static inline BOOLEAN RtlCheckBit(PCRTL_BITMAP lpBits, ULONG ulBit)
 3793 {
 3794     if (lpBits && ulBit < lpBits->SizeOfBitMap &&
 3795         lpBits->Buffer[ulBit >> 5] & (1 << (ulBit & 31)))
 3796         return TRUE;
 3797     return FALSE;
 3798 }
 3799 
 3800 /* These are implemented as __fastcall, so we can't let Winelib apps link with them */
 3801 static inline USHORT RtlUshortByteSwap(USHORT s)
 3802 {
 3803     return (s >> 8) | (s << 8);
 3804 }
 3805 static inline ULONG RtlUlongByteSwap(ULONG i)
 3806 {
 3807 #if defined(__i386__) && defined(__GNUC__)
 3808     ULONG ret;
 3809     __asm__("bswap %0" : "=r" (ret) : "0" (i) );
 3810     return ret;
 3811 #else
 3812     return ((ULONG)RtlUshortByteSwap((USHORT)i) << 16) | RtlUshortByteSwap((USHORT)(i >> 16));
 3813 #endif
 3814 }
 3815 
 3816 /* list manipulation macros */
 3817 #define InitializeListHead(le)  (void)((le)->Flink = (le)->Blink = (le))
 3818 #define InsertHeadList(le,e)    do { PLIST_ENTRY f = (le)->Flink; (e)->Flink = f; (e)->Blink = (le); f->Blink = (e); (le)->Flink = (e); } while (0)
 3819 #define InsertTailList(le,e)    do { PLIST_ENTRY b = (le)->Blink; (e)->Flink = (le); (e)->Blink = b; b->Flink = (e); (le)->Blink = (e); } while (0)
 3820 #define IsListEmpty(le)         ((le)->Flink == (le))
 3821 #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)
 3822 static inline PLIST_ENTRY RemoveHeadList(PLIST_ENTRY le)
 3823 {
 3824     PLIST_ENTRY f, b, e;
 3825 
 3826     e = le->Flink;
 3827     f = le->Flink->Flink;
 3828     b = le->Flink->Blink;
 3829     f->Blink = b;
 3830     b->Flink = f;
 3831 
 3832     if (e != le) e->Flink = e->Blink = NULL;
 3833     return e;
 3834 }
 3835 static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
 3836 {
 3837     PLIST_ENTRY f, b, e;
 3838 
 3839     e = le->Blink;
 3840     f = le->Blink->Flink;
 3841     b = le->Blink->Blink;
 3842     f->Blink = b;
 3843     b->Flink = f;
 3844 
 3845     if (e != le) e->Flink = e->Blink = NULL;
 3846     return e;
 3847 }
 3848 
 3849 
 3850 #ifdef __WINESRC__
 3851 
 3852 /* Wine internal functions */
 3853 extern NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out );
 3854 
 3855 /* The thread information for 16-bit threads */
 3856 /* NtCurrentTeb()->SubSystemTib points to this */
 3857 typedef struct
 3858 {
 3859     void           *unknown;    /* 00 unknown */
 3860     UNICODE_STRING *exe_name;   /* 04 exe module name */
 3861 
 3862     /* the following fields do not exist under Windows */
 3863     UNICODE_STRING  exe_str;    /* exe name string pointed to by exe_name */
 3864     CURDIR          curdir;     /* current directory */
 3865     WCHAR           curdir_buffer[MAX_PATH];
 3866 } WIN16_SUBSYSTEM_TIB;
 3867 
 3868 #endif /* __WINESRC__ */
 3869 
 3870 #ifdef __cplusplus
 3871 } /* extern "C" */
 3872 #endif /* defined(__cplusplus) */
 3873 
 3874 #endif  /* __WINE_WINTERNL_H */