nt.h revision 0dce96288d862069ff8c049d6b7a8dc625f9f555
9ad572a3ac0fd3845a9abecfbf41e8db9b3a5cf0vboxsync/* $Id$ */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** @file
adf2bcd2e5d07d5a11553b88e147c1f4b2249bffvboxsync * IPRT - Header for code using the Native NT API.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/*
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync * Copyright (C) 2010-2014 Oracle Corporation
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync *
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * available from http://www.virtualbox.org. This file is free software;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * you can redistribute it and/or modify it under the terms of the GNU
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * General Public License (GPL) as published by the Free Software
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync *
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * The contents of this file may alternatively be used under the terms
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * of the Common Development and Distribution License Version 1.0
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * VirtualBox OSE distribution, in which case the provisions of the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * CDDL are applicable instead of those of the GPL.
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync *
70bb61ea2f96e80150e807529ce5df435607706bvboxsync * You may elect to license modified versions of this file under the
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * terms and conditions of either the GPL or the CDDL or both.
23179f1443b03947d85eccc81cbc6b5153a4abf3vboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifndef ___iprt_nt_nt_h___
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#define ___iprt_nt_nt_h___
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
edefdc20eedaf9ef5b1293e56ba9b8cca7b5c740vboxsync/** @def IPRT_NT_MAP_TO_ZW
edefdc20eedaf9ef5b1293e56ba9b8cca7b5c740vboxsync * Map Nt calls to Zw calls. In ring-0 the Zw calls let you pass kernel memory
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync * to the APIs (takes care of the previous context checks).
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifdef DOXYGEN_RUNNING
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define IPRT_NT_MAP_TO_ZW
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifdef IPRT_NT_MAP_TO_ZW
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtQueryInformationFile ZwQueryInformationFile
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtQueryInformationProcess ZwQueryInformationProcess
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtQueryInformationThread ZwQueryInformationThread
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtQuerySystemInformation ZwQuerySystemInformation
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtQuerySecurityObject ZwQuerySecurityObject
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtClose ZwClose
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtCreateFile ZwCreateFile
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define NtReadFile ZwReadFile
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define NtWriteFile ZwWriteFile
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** @todo this is very incomplete! */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#endif
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync#include <ntstatus.h>
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync/*
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * Hacks common to both base header sets.
b304856b23107864c9c594a80cebca6006623f31vboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define RtlFreeUnicodeString WrongLinkage_RtlFreeUnicodeString
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define NtQueryObject Incomplete_NtQueryObject
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define ZwQueryObject Incomplete_ZwQueryObject
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define NtSetInformationObject Incomplete_NtSetInformationObject
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define _OBJECT_INFORMATION_CLASS Incomplete_OBJECT_INFORMATION_CLASS
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync#define OBJECT_INFORMATION_CLASS Incomplete_OBJECT_INFORMATION_CLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define ObjectBasicInformation Incomplete_ObjectBasicInformation
5e0d1b28833a92e30446e95ced085bce4d794067vboxsync#define ObjectTypeInformation Incomplete_ObjectTypeInformation
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync#define _PEB Incomplete__PEB
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define PEB Incomplete_PEB
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define PPEB Incomplete_PPEB
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync#define _TEB Incomplete__TEB
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define TEB Incomplete_TEB
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync#define PTEB Incomplete_PTEB
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#define _PEB_LDR_DATA Incomplete__PEB_LDR_DATA
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#define PEB_LDR_DATA Incomplete_PEB_LDR_DATA
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#define PPEB_LDR_DATA Incomplete_PPEB_LDR_DATA
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#define _KUSER_SHARED_DATA Incomplete__KUSER_SHARED_DATA
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync#define KUSER_SHARED_DATA Incomplete_KUSER_SHARED_DATA
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync#define PKUSER_SHARED_DATA Incomplete_PKUSER_SHARED_DATA
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#ifdef IPRT_NT_USE_WINTERNL
9353e321b583ed6f2b42414257a5212885575b5cvboxsync/*
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * Use Winternl.h.
9353e321b583ed6f2b42414257a5212885575b5cvboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define _FILE_INFORMATION_CLASS IncompleteWinternl_FILE_INFORMATION_CLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define FILE_INFORMATION_CLASS IncompleteWinternl_FILE_INFORMATION_CLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define FileDirectoryInformation IncompleteWinternl_FileDirectoryInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define NtQueryInformationProcess IncompleteWinternl_NtQueryInformationProcess
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define NtSetInformationProcess IncompleteWinternl_NtSetInformationProcess
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define PROCESSINFOCLASS IncompleteWinternl_PROCESSINFOCLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define _PROCESSINFOCLASS IncompleteWinternl_PROCESSINFOCLASS
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define PROCESS_BASIC_INFORMATION IncompleteWinternl_PROCESS_BASIC_INFORMATION
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define PPROCESS_BASIC_INFORMATION IncompleteWinternl_PPROCESS_BASIC_INFORMATION
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define _PROCESS_BASIC_INFORMATION IncompleteWinternl_PROCESS_BASIC_INFORMATION
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define ProcessBasicInformation IncompleteWinternl_ProcessBasicInformation
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define ProcessDebugPort IncompleteWinternl_ProcessDebugPort
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define ProcessWow64Information IncompleteWinternl_ProcessWow64Information
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define ProcessImageFileName IncompleteWinternl_ProcessImageFileName
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define ProcessBreakOnTermination IncompleteWinternl_ProcessBreakOnTermination
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define RTL_USER_PROCESS_PARAMETERS IncompleteWinternl_RTL_USER_PROCESS_PARAMETERS
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define PRTL_USER_PROCESS_PARAMETERS IncompleteWinternl_PRTL_USER_PROCESS_PARAMETERS
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync# define _RTL_USER_PROCESS_PARAMETERS IncompleteWinternl__RTL_USER_PROCESS_PARAMETERS
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define NtQueryInformationThread IncompleteWinternl_NtQueryInformationThread
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define NtSetInformationThread IncompleteWinternl_NtSetInformationThread
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync# define THREADINFOCLASS IncompleteWinternl_THREADINFOCLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define _THREADINFOCLASS IncompleteWinternl_THREADINFOCLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define ThreadIsIoPending IncompleteWinternl_ThreadIsIoPending
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync# define NtQuerySystemInformation IncompleteWinternl_NtQuerySystemInformation
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync# define NtSetSystemInformation IncompleteWinternl_NtSetSystemInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define SYSTEM_INFORMATION_CLASS IncompleteWinternl_SYSTEM_INFORMATION_CLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define _SYSTEM_INFORMATION_CLASS IncompleteWinternl_SYSTEM_INFORMATION_CLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define SystemBasicInformation IncompleteWinternl_SystemBasicInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define SystemPerformanceInformation IncompleteWinternl_SystemPerformanceInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define SystemTimeOfDayInformation IncompleteWinternl_SystemTimeOfDayInformation
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync# define SystemProcessInformation IncompleteWinternl_SystemProcessInformation
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync# define SystemProcessorPerformanceInformation IncompleteWinternl_SystemProcessorPerformanceInformation
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync# define SystemInterruptInformation IncompleteWinternl_SystemInterruptInformation
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SystemExceptionInformation IncompleteWinternl_SystemExceptionInformation
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SystemRegistryQuotaInformation IncompleteWinternl_SystemRegistryQuotaInformation
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SystemLookasideInformation IncompleteWinternl_SystemLookasideInformation
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync# define SystemPolicyInformation IncompleteWinternl_SystemPolicyInformation
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define WIN32_NO_STATUS
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# include <windef.h>
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# include <winnt.h>
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# include <winternl.h>
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef WIN32_NO_STATUS
19cb1f8699e352d590c4946caee33863a5157241vboxsync# include <ntstatus.h>
19cb1f8699e352d590c4946caee33863a5157241vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef _FILE_INFORMATION_CLASS
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync# undef FILE_INFORMATION_CLASS
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync# undef FileDirectoryInformation
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync# undef NtQueryInformationProcess
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef NtSetInformationProcess
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef PROCESSINFOCLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef _PROCESSINFOCLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef PROCESS_BASIC_INFORMATION
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync# undef PPROCESS_BASIC_INFORMATION
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef _PROCESS_BASIC_INFORMATION
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef ProcessBasicInformation
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef ProcessDebugPort
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef ProcessWow64Information
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef ProcessImageFileName
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef ProcessBreakOnTermination
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef RTL_USER_PROCESS_PARAMETERS
cc74f15083bf80fbc96723a89faa06c15d0dead8vboxsync# undef PRTL_USER_PROCESS_PARAMETERS
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync# undef _RTL_USER_PROCESS_PARAMETERS
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef NtQueryInformationThread
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync# undef NtSetInformationThread
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef THREADINFOCLASS
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef _THREADINFOCLASS
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef ThreadIsIoPending
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
9ca017ceee656f9d33f2cb6652e401b5f17fcfb7vboxsync# undef NtQuerySystemInformation
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# undef NtSetSystemInformation
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync# undef SYSTEM_INFORMATION_CLASS
9601ea695ea96905d6f5d484facd272732365c40vboxsync# undef _SYSTEM_INFORMATION_CLASS
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef SystemBasicInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef SystemPerformanceInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef SystemTimeOfDayInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef SystemProcessInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef SystemProcessorPerformanceInformation
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# undef SystemInterruptInformation
ad9e5a61fea617d40d07390ff1737277d6aef869vboxsync# undef SystemExceptionInformation
23d9dbdaf1b83107abf9882246a4a46933f733efvboxsync# undef SystemRegistryQuotaInformation
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync# undef SystemLookasideInformation
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync# undef SystemPolicyInformation
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync
dbabc9de5bf52ce5eb77cf82b038e9a6166c5a04vboxsync#else
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync/*
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync * Use ntifs.h and wdm.h.
40dce69ff1c2949a489337922f30f1021d62d864vboxsync */
40dce69ff1c2949a489337922f30f1021d62d864vboxsync# ifdef RT_ARCH_X86
40dce69ff1c2949a489337922f30f1021d62d864vboxsync# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
40dce69ff1c2949a489337922f30f1021d62d864vboxsync# pragma warning(disable : 4163)
40dce69ff1c2949a489337922f30f1021d62d864vboxsync# endif
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync
7a29aa5ce149ccd344a2929d2815b8e212690b92vboxsync# include <ntifs.h>
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync# include <wdm.h>
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync# ifdef RT_ARCH_X86
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync# pragma warning(default : 4163)
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync# undef _InterlockedAddLargeStatistic
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync# endif
7708252d252a55417a6a817041e4356797e34255vboxsync
7708252d252a55417a6a817041e4356797e34255vboxsync# define IPRT_NT_NEED_API_GROUP_NTIFS
7708252d252a55417a6a817041e4356797e34255vboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#undef RtlFreeUnicodeString
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#undef NtQueryObject
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync#undef ZwQueryObject
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#undef NtSetInformationObject
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#undef _OBJECT_INFORMATION_CLASS
f2dbf051efd73ff79892d4cec2b466139f962a40vboxsync#undef OBJECT_INFORMATION_CLASS
5d57bcb78f1f3f918bd3daf709b551b8c2d30485vboxsync#undef ObjectBasicInformation
cccc6ee5f7156cfcdf13acca545cf65124d9ed44vboxsync#undef ObjectTypeInformation
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#undef _PEB
904810c4c6668233349b025cc58013cb7c11c701vboxsync#undef PEB
904810c4c6668233349b025cc58013cb7c11c701vboxsync#undef PPEB
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#undef _TEB
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#undef TEB
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#undef PTEB
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#undef _PEB_LDR_DATA
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#undef PEB_LDR_DATA
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync#undef PPEB_LDR_DATA
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync#undef _KUSER_SHARED_DATA
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#undef KUSER_SHARED_DATA
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync#undef PKUSER_SHARED_DATA
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
b304856b23107864c9c594a80cebca6006623f31vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#include <iprt/types.h>
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#include <iprt/assert.h>
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync/** @name Useful macros
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync * @{ */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync/** Indicates that we're targetting native NT in the current source. */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync#define RTNT_USE_NATIVE_NT 1
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync/** Initializes a IO_STATUS_BLOCK. */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync#define RTNT_IO_STATUS_BLOCK_INITIALIZER { STATUS_FAILED_DRIVER_ENTRY, ~(uintptr_t)42 }
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync/** Similar to INVALID_HANDLE_VALUE in the Windows environment. */
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync#define RTNT_INVALID_HANDLE_VALUE ( (HANDLE)~(uintptr_t)0 )
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync/** Constant UNICODE_STRING initializer. */
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync#define RTNT_CONSTANT_UNISTR(a_String) { sizeof(a_String) - sizeof(WCHAR), sizeof(a_String), (WCHAR *)a_String }
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync/** @} */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync/** @name IPRT helper functions for NT
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync * @{ */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsyncRT_C_DECLS_BEGIN
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsyncRTDECL(int) RTNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PHANDLE phHandle, PULONG_PTR puDisposition);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncRTDECL(int) RTNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir);
9353e321b583ed6f2b42414257a5212885575b5cvboxsyncRTDECL(int) RTNtPathClose(HANDLE hHandle);
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
9353e321b583ed6f2b42414257a5212885575b5cvboxsync/**
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync * Converts a UTF-16 windows-style path to NT format.
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync *
fc5f879e9508f333e20b37c63db9189a33059308vboxsync * @returns IPRT status code.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @param pNtName Where to return the NT name. Free using
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * RTNtPathFree.
1c6ec9a3a329da6f61978a372e509cd233f0d9f9vboxsync * @param phRootDir Where to return the root handle, if applicable.
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync * @param pwszPath The UTF-16 windows-style path.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @param cwcPath The max length of the windows-style path in
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * RTUTF16 units. Use RTSTR_MAX if unknown and @a
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * pwszPath is correctly terminated.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncRTDECL(int) RTNtPathFromWinUtf16Ex(struct _UNICODE_STRING *pNtName, HANDLE *phRootDir, PCRTUTF16 pwszPath, size_t cwcPath);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync/**
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * Frees the native path and root handle.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync *
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @param pNtName The NT path after a successful
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * RTNtPathFromWinUtf16Ex call.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @param phRootDir The root handle variable after a successfull
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * RTNtPathFromWinUtf16Ex call.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncRTDECL(void) RTNtPathFree(struct _UNICODE_STRING *pNtName, HANDLE *phRootDir);
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncRT_C_DECLS_END
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync/** @} */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync/** @name NT API delcarations.
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @{ */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsyncRT_C_DECLS_BEGIN
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync/** @name Process access rights missing in ntddk headers
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @{ */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync#ifndef PROCESS_TERMINATE
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync# define PROCESS_TERMINATE UINT32_C(0x00000001)
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync#endif
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync#ifndef PROCESS_CREATE_THREAD
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define PROCESS_CREATE_THREAD UINT32_C(0x00000002)
95cb8e789c1eed6f2bb3195d0b996feee11d548evboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef PROCESS_SET_SESSIONID
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync# define PROCESS_SET_SESSIONID UINT32_C(0x00000004)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef PROCESS_VM_OPERATION
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define PROCESS_VM_OPERATION UINT32_C(0x00000008)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef PROCESS_VM_READ
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define PROCESS_VM_READ UINT32_C(0x00000010)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#endif
19cb1f8699e352d590c4946caee33863a5157241vboxsync#ifndef PROCESS_VM_WRITE
19cb1f8699e352d590c4946caee33863a5157241vboxsync# define PROCESS_VM_WRITE UINT32_C(0x00000020)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#endif
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#ifndef PROCESS_DUP_HANDLE
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync# define PROCESS_DUP_HANDLE UINT32_C(0x00000040)
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync#endif
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync#ifndef PROCESS_CREATE_PROCESS
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync# define PROCESS_CREATE_PROCESS UINT32_C(0x00000080)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#endif
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#ifndef PROCESS_SET_QUOTA
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define PROCESS_SET_QUOTA UINT32_C(0x00000100)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#endif
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#ifndef PROCESS_SET_INFORMATION
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# define PROCESS_SET_INFORMATION UINT32_C(0x00000200)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#ifndef PROCESS_QUERY_INFORMATION
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# define PROCESS_QUERY_INFORMATION UINT32_C(0x00000400)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#ifndef PROCESS_SUSPEND_RESUME
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsync# define PROCESS_SUSPEND_RESUME UINT32_C(0x00000800)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
cc74f15083bf80fbc96723a89faa06c15d0dead8vboxsync#ifndef PROCESS_QUERY_LIMITED_INFORMATION
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync# define PROCESS_QUERY_LIMITED_INFORMATION UINT32_C(0x00001000)
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#ifndef PROCESS_SET_LIMITED_INFORMATION
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync# define PROCESS_SET_LIMITED_INFORMATION UINT32_C(0x00002000)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define PROCESS_UNKNOWN_4000 UINT32_C(0x00004000)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define PROCESS_UNKNOWN_6000 UINT32_C(0x00008000)
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsync#ifndef PROCESS_ALL_ACCESS
9ca017ceee656f9d33f2cb6652e401b5f17fcfb7vboxsync# define PROCESS_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | UINT32_C(0x0000ffff) )
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
9601ea695ea96905d6f5d484facd272732365c40vboxsync/** @} */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync/** @name Thread access rights missing in ntddk headers
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync * @{ */
f106b549ead77cab51ff1e2c116060aaabb90d5evboxsync#ifndef THREAD_QUERY_INFORMATION
f106b549ead77cab51ff1e2c116060aaabb90d5evboxsync# define THREAD_QUERY_INFORMATION UINT32_C(0x00000040)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#endif
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#ifndef THREAD_SET_THREAD_TOKEN
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define THREAD_SET_THREAD_TOKEN UINT32_C(0x00000080)
23d9dbdaf1b83107abf9882246a4a46933f733efvboxsync#endif
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync#ifndef THREAD_IMPERSONATE
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync# define THREAD_IMPERSONATE UINT32_C(0x00000100)
a9315925c69e4c3bb342bb317ca5b6d29e1ee467vboxsync#endif
ad9e5a61fea617d40d07390ff1737277d6aef869vboxsync#ifndef THREAD_DIRECT_IMPERSONATION
dbabc9de5bf52ce5eb77cf82b038e9a6166c5a04vboxsync# define THREAD_DIRECT_IMPERSONATION UINT32_C(0x00000200)
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync#endif
4090390866c02d5d0ad061151cdb298b9a173e86vboxsync#ifndef THREAD_RESUME
40dce69ff1c2949a489337922f30f1021d62d864vboxsync# define THREAD_RESUME UINT32_C(0x00001000)
40dce69ff1c2949a489337922f30f1021d62d864vboxsync#endif
40dce69ff1c2949a489337922f30f1021d62d864vboxsync#define THREAD_UNKNOWN_2000 UINT32_C(0x00002000)
40dce69ff1c2949a489337922f30f1021d62d864vboxsync#define THREAD_UNKNOWN_4000 UINT32_C(0x00004000)
40dce69ff1c2949a489337922f30f1021d62d864vboxsync#define THREAD_UNKNOWN_8000 UINT32_C(0x00008000)
7a29aa5ce149ccd344a2929d2815b8e212690b92vboxsync/** @} */
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync
f57758f0bcf995d350d64a7c059ac93573144c05vboxsync/** @name Special handle values.
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync * @{ */
f57758f0bcf995d350d64a7c059ac93573144c05vboxsync#ifndef NtCurrentProcess
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync# define NtCurrentProcess() ( (HANDLE)-(intptr_t)1 )
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#endif
5d57bcb78f1f3f918bd3daf709b551b8c2d30485vboxsync#ifndef NtCurrentThread
cccc6ee5f7156cfcdf13acca545cf65124d9ed44vboxsync# define NtCurrentThread() ( (HANDLE)-(intptr_t)2 )
3f00104a87d8a725dfa0348b69cbdac901062a4avboxsync#endif
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync#ifndef ZwCurrentProcess
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync# define ZwCurrentProcess() NtCurrentProcess()
45a01ef53b009e9f56ce427bd8688da02ad32389vboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#ifndef ZwCurrentThread
505ddd00252720bfb5569fcb17bfda53dc141e3bvboxsync# define ZwCurrentThread() NtCurrentThread()
505ddd00252720bfb5569fcb17bfda53dc141e3bvboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync/** @} */
7708252d252a55417a6a817041e4356797e34255vboxsync
7708252d252a55417a6a817041e4356797e34255vboxsync
7708252d252a55417a6a817041e4356797e34255vboxsync/** @name Directory object access rights.
904810c4c6668233349b025cc58013cb7c11c701vboxsync * @{ */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#ifndef DIRECTORY_QUERY
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# define DIRECTORY_QUERY UINT32_C(0x00000001)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#ifndef DIRECTORY_TRAVERSE
3933885bc0c2c93436d858a14564c6179ec72872vboxsync# define DIRECTORY_TRAVERSE UINT32_C(0x00000002)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#ifndef DIRECTORY_CREATE_OBJECT
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync# define DIRECTORY_CREATE_OBJECT UINT32_C(0x00000004)
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#ifndef DIRECTORY_CREATE_SUBDIRECTORY
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync# define DIRECTORY_CREATE_SUBDIRECTORY UINT32_C(0x00000008)
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#ifndef DIRECTORY_ALL_ACCESS
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync# define DIRECTORY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | UINT32_C(0x0000000f) )
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync/** @} */
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#ifdef IPRT_NT_USE_WINTERNL
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsynctypedef struct _CLIENT_ID
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync{
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync HANDLE UniqueProcess;
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync HANDLE UniqueThread;
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync} CLIENT_ID;
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsynctypedef CLIENT_ID *PCLIENT_ID;
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync#endif
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** Extended affinity type, introduced in Windows 7 (?). */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsynctypedef struct _KAFFINITY_EX
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync{
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync /** Count of valid bitmap entries. */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync uint16_t Count;
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync /** Count of allocated bitmap entries. */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync uint16_t Size;
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync /** Reserved / aligmment padding. */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync uint32_t Reserved;
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync /** Bitmap where one bit corresponds to a CPU. */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync uintptr_t Bitmap[20];
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync} KAFFINITY_EX;
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsynctypedef KAFFINITY_EX *PKAFFINITY_EX;
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsynctypedef KAFFINITY_EX const *PCKAFFINITY_EX;
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync/** @name User Shared Data
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync * @{ */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync#ifdef IPRT_NT_USE_WINTERNL
48890ac9b4b339e0341e826b5c26ce6408729987vboxsynctypedef struct _KSYSTEM_TIME
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync{
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync ULONG LowPart;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync LONG High1Time;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync LONG High2Time;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync} KSYSTEM_TIME;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsynctypedef KSYSTEM_TIME *PKSYSTEM_TIME;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync
48890ac9b4b339e0341e826b5c26ce6408729987vboxsynctypedef enum _NT_PRODUCT_TYPE
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync{
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync NtProductWinNt = 1,
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync NtProductLanManNt,
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync NtProductServer
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync} NT_PRODUCT_TYPE;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync#define PROCESSOR_FEATURE_MAX 64
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync
48890ac9b4b339e0341e826b5c26ce6408729987vboxsynctypedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync{
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync StandardDesign = 0,
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync NEC98x86,
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync EndAlternatives
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync} ALTERNATIVE_ARCHITECTURE_TYPE;
48890ac9b4b339e0341e826b5c26ce6408729987vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# if 0
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef struct _XSTATE_FEATURE
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG Offset;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG Size;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync} XSTATE_FEATURE;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsynctypedef XSTATE_FEATURE *PXSTATE_FEATURE;
c970e7d40b648d5c8f3e2b060692e670d85997d1vboxsync
c970e7d40b648d5c8f3e2b060692e670d85997d1vboxsync#define MAXIMUM_XSTATE_FEATURES 64
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef struct _XSTATE_CONFIGURATION
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG64 EnabledFeatures;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG Size;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG OptimizedSave : 1;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync XSTATE_FEATURE Features[MAXIMUM_XSTATE_FEATURES];
508452243fd3328f7b9e0405d39fb9dc004e31b8vboxsync} XSTATE_CONFIGURATION;
508452243fd3328f7b9e0405d39fb9dc004e31b8vboxsynctypedef XSTATE_CONFIGURATION *PXSTATE_CONFIGURATION;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# endif
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync#endif /* IPRT_NT_USE_WINTERNL */
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsynctypedef struct _KUSER_SHARED_DATA
89aedeb1d8af54aba6ae46dbbd256281315c1be6vboxsync{
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG TickCountLowDeprecated; /**< 0x000 */
f409459bdd4c15cdb8d7fb6c6d54338cce9ac814vboxsync ULONG TickCountMultiplier; /**< 0x004 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync KSYSTEM_TIME volatile InterruptTime; /**< 0x008 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync KSYSTEM_TIME volatile SystemTime; /**< 0x014 */
f4e792b5d6ee04e9d93499b747cce21510c3cdb3vboxsync KSYSTEM_TIME volatile TimeZoneBias; /**< 0x020 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync USHORT ImageNumberLow; /**< 0x02c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync USHORT ImageNumberHigh; /**< 0x02e */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync WCHAR NtSystemRoot[260]; /**< 0x030 */
fb1975a6972d89de9e515bed0248db93f04ec9d8vboxsync ULONG MaxStackTraceDepth; /**< 0x238 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG CryptoExponent; /**< 0x23c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG TimeZoneId; /**< 0x240 */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync ULONG LargePageMinimum; /**< 0x244 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG AitSamplingValue; /**< 0x248 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG AppCompatFlag; /**< 0x24c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONGLONG RNGSeedVersion; /**< 0x250 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONG GlobalValidationRunlevel; /**< 0x258 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LONG volatile TimeZoneBiasStamp; /**< 0x25c*/
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync ULONG Reserved2; /**< 0x260 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync NT_PRODUCT_TYPE NtProductType; /**< 0x264 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync BOOLEAN ProductTypeIsValid; /**< 0x268 */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync BOOLEAN Reserved0[1]; /**< 0x269 */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync USHORT NativeProcessorArchitecture; /**< 0x26a */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync ULONG NtMajorVersion; /**< 0x26c */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync ULONG NtMinorVersion; /**< 0x270 */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX]; /**< 0x274 */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync ULONG Reserved1; /**< 0x2b4 */
1147e980f6ab0b7ff1d08c13ad1c03eea30d102dvboxsync ULONG Reserved3; /**< 0x2b8 */
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync ULONG volatile TimeSlip; /**< 0x2bc */
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; /**< 0x2c0 */
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync ULONG AltArchitecturePad[1]; /**< 0x2c4 */
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync LARGE_INTEGER SystemExpirationDate; /**< 0x2c8 */
e59069cf1c98c1c2e90a18ec76fbc2e9907fb917vboxsync ULONG SuiteMask; /**< 0x2d0 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOLEAN KdDebuggerEnabled; /**< 0x2d4 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union /**< 0x2d5 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync {
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync UCHAR MitigationPolicies; /**< 0x2d5 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync struct
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync UCHAR NXSupportPolicy : 2;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync UCHAR SEHValidationPolicy : 2;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync UCHAR CurDirDevicesSkippedForDlls : 2;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync UCHAR Reserved : 2;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync };
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync };
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync UCHAR Reserved6[2]; /**< 0x2d6 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG volatile ActiveConsoleId; /**< 0x2d8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG volatile DismountCount; /**< 0x2dc */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG ComPlusPackage; /**< 0x2e0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG LastSystemRITEventTickCount; /**< 0x2e4 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG NumberOfPhysicalPages; /**< 0x2e8 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync BOOLEAN SafeBootMode; /**< 0x2ec */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync UCHAR Reserved12[3]; /**< 0x2ed */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync union /**< 0x2f0 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync {
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG SharedDataFlags; /**< 0x2f0 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync struct
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync {
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgErrorPortPresent : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgElevationEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgVirtEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgInstallerDetectEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgLkgEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgDynProcessorEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgConsoleBrokerEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DbgSecureBootEnabled : 1;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG SpareBits : 24;
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync };
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync };
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG DataFlagsPad[1]; /**< 0x2f4 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONGLONG TestRetInstruction; /**< 0x2f8 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync LONGLONG QpcFrequency; /**< 0x300 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONGLONG SystemCallPad[3]; /**< 0x308 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync union /**< 0x320 */
cedd207acc51a49839fdf51554fc19539ac68b4dvboxsync {
cedd207acc51a49839fdf51554fc19539ac68b4dvboxsync ULONG64 volatile TickCountQuad; /**< 0x320 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync KSYSTEM_TIME volatile TickCount; /**< 0x320 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync struct /**< 0x320 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync {
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG ReservedTickCountOverlay[3]; /**< 0x320 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG TickCountPad[1]; /**< 0x32c */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync };
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync };
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG Cookie; /**< 0x330 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONG CookiePad[1]; /**< 0x334 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync LONGLONG ConsoleSessionForegroundProcessId; /**< 0x338 */
361a7fb527903c8dbfd0cc7dc779f943c6e348f6vboxsync ULONGLONG TimeUpdateLock; /**< 0x340 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONGLONG BaselineSystemTimeQpc; /**< 0x348 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONGLONG BaselineInterruptTimeQpc; /**< 0x350 */
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync ULONGLONG QpcSystemTimeIncrement; /**< 0x358 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONGLONG QpcInterruptTimeIncrement; /**< 0x360 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG QpcSystemTimeIncrement32; /**< 0x368 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG QpcInterruptTimeIncrement32; /**< 0x36c */
b304856b23107864c9c594a80cebca6006623f31vboxsync UCHAR QpcSystemTimeIncrementShift; /**< 0x370 */
b304856b23107864c9c594a80cebca6006623f31vboxsync UCHAR QpcInterruptTimeIncrementShift; /**< 0x371 */
b304856b23107864c9c594a80cebca6006623f31vboxsync UCHAR Reserved8[14]; /**< 0x372 */
b304856b23107864c9c594a80cebca6006623f31vboxsync USHORT UserModeGlobalLogger[16]; /**< 0x380 */
b304856b23107864c9c594a80cebca6006623f31vboxsync ULONG ImageFileExecutionOptions; /**< 0x3a0 */
b304856b23107864c9c594a80cebca6006623f31vboxsync ULONG LangGenerationCount; /**< 0x3a4 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ULONGLONG Reserved4; /**< 0x3a8 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONGLONG volatile InterruptTimeBias; /**< 0x3b0 */
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync ULONGLONG volatile QpcBias; /**< 0x3b8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG volatile ActiveProcessorCount; /**< 0x3c0 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync UCHAR volatile ActiveGroupCount; /**< 0x3c4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync UCHAR Reserved9; /**< 0x3c5 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync union /**< 0x3c6 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync USHORT QpcData; /**< 0x3c6 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct /**< 0x3c6 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync {
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync BOOLEAN volatile QpcBypassEnabled; /**< 0x3c6 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync UCHAR QpcShift; /**< 0x3c7 */
3a0bc95d0adf57baefd303e94b8f1b7b31a8f080vboxsync };
3a0bc95d0adf57baefd303e94b8f1b7b31a8f080vboxsync };
3a0bc95d0adf57baefd303e94b8f1b7b31a8f080vboxsync LARGE_INTEGER TimeZoneBiasEffectiveStart; /**< 0x3c8 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync LARGE_INTEGER TimeZoneBiasEffectiveEnd; /**< 0x3d0 */
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync XSTATE_CONFIGURATION XState; /**< 0x3d8 */
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsync} KUSER_SHARED_DATA;
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsynctypedef KUSER_SHARED_DATA *PKUSER_SHARED_DATA;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, InterruptTime, 0x008);
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, SystemTime, 0x014);
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, NtSystemRoot, 0x030);
21ddd8aa21b8d7ad25b18ab341ede34c1cb4a125vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, LargePageMinimum, 0x244);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, Reserved1, 0x2b4);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, TestRetInstruction, 0x2f8);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, Cookie, 0x330);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, ImageFileExecutionOptions, 0x3a0);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncAssertCompileMemberOffset(KUSER_SHARED_DATA, XState, 0x3d8);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync/** @def MM_SHARED_USER_DATA_VA
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync * Read only userland mapping of KUSER_SHARED_DATA. */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#ifndef MM_SHARED_USER_DATA_VA
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# if ARCH_BITS == 32
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# define MM_SHARED_USER_DATA_VA UINT32_C(0x7ffe0000)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# elif ARCH_BITS == 64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# define MM_SHARED_USER_DATA_VA UINT64_C(0x7ffe0000)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# else
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# error "Unsupported/undefined ARCH_BITS value."
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync# endif
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#endif
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** @def KI_USER_SHARED_DATA
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync * Read write kernel mapping of KUSER_SHARED_DATA. */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync#ifndef KI_USER_SHARED_DATA
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# ifdef RT_ARCH_X86
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync# define KI_USER_SHARED_DATA UINT32_C(0xffdf0000)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# elif defined(RT_ARCH_AMD64)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define KI_USER_SHARED_DATA UINT64_C(0xfffff78000000000)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# else
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# error "PORT ME - KI_USER_SHARED_DATA"
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# endif
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync#endif
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** @} */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync/** @name Process And Thread Environment Blocks
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync * @{ */
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsynctypedef struct _PEB_LDR_DATA
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync{
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync uint32_t Length;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync BOOLEAN Initialized;
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync BOOLEAN Padding[3];
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync HANDLE SsHandle;
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync LIST_ENTRY InLoadOrderModuleList;
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync LIST_ENTRY InMemoryOrderModuleList;
36929067a9d3cba77fd78f1e8fa042ed3a8ae2d6vboxsync LIST_ENTRY InInitializationOrderModuleList;
5e0d1b28833a92e30446e95ced085bce4d794067vboxsync /* End NT4 */
5e0d1b28833a92e30446e95ced085bce4d794067vboxsync LIST_ENTRY *EntryInProgress;
5e0d1b28833a92e30446e95ced085bce4d794067vboxsync BOOLEAN ShutdownInProgress;
5e0d1b28833a92e30446e95ced085bce4d794067vboxsync HANDLE ShutdownThreadId;
5e0d1b28833a92e30446e95ced085bce4d794067vboxsync} PEB_LDR_DATA;
5e0d1b28833a92e30446e95ced085bce4d794067vboxsynctypedef PEB_LDR_DATA *PPEB_LDR_DATA;
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsynctypedef struct _PEB_COMMON
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync{
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync BOOLEAN InheritedAddressSpace; /**< 0x000 / 0x000 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync BOOLEAN ReadImageFileExecOptions; /**< 0x001 / 0x001 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync BOOLEAN BeingDebugged; /**< 0x002 / 0x002 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync union
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync {
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t BitField; /**< 0x003 / 0x003 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync struct
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync {
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t ImageUsesLargePages : 1; /**< 0x003 / 0x003 : Pos 0, 1 Bit */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync } Common;
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync struct
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync {
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t ImageUsesLargePages : 1; /**< 0x003 / 0x003 : Pos 0, 1 Bit */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t IsProtectedProcess : 1; /**< 0x003 / 0x003 : Pos 1, 1 Bit */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t IsImageDynamicallyRelocated : 1; /**< 0x003 / 0x003 : Pos 2, 1 Bit - Differs from W80 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t SkipPatchingUser32Forwarders : 1; /**< 0x003 / 0x003 : Pos 3, 1 Bit - Differs from W80 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t IsPackagedProcess : 1; /**< 0x003 / 0x003 : Pos 4, 1 Bit - Differs from W80 */
56343f236d9d7c0e3d2b75e23f0f5575dc77f2e3vboxsync uint8_t IsAppContainer : 1; /**< 0x003 / 0x003 : Pos 5, 1 Bit - Differs from W80 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync uint8_t IsProtectedProcessLight : 1; /**< 0x003 / 0x003 : Pos 6, 1 Bit - Differs from W80 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint8_t SpareBits : 1; /**< 0x003 / 0x003 : Pos 7, 1 Bit */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync } W81;
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync struct
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync {
ab2292e9c32bd271ec91123ef38699a0284b72cbvboxsync uint8_t ImageUsesLargePages : 1; /**< 0x003 / 0x003 : Pos 0, 1 Bit */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t IsProtectedProcess : 1; /**< 0x003 / 0x003 : Pos 1, 1 Bit */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsLegacyProcess : 1; /**< 0x003 / 0x003 : Pos 2, 1 Bit - Differs from W81 */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsImageDynamicallyRelocated : 1; /**< 0x003 / 0x003 : Pos 3, 1 Bit - Differs from W81 */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t SkipPatchingUser32Forwarders : 1; /**< 0x003 / 0x003 : Pos 4, 1 Bit - Differs from W81 */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsPackagedProcess : 1; /**< 0x003 / 0x003 : Pos 5, 1 Bit - Differs from W81 */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsAppContainer : 1; /**< 0x003 / 0x003 : Pos 6, 1 Bit - Differs from W81 */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t SpareBits : 1; /**< 0x003 / 0x003 : Pos 7, 1 Bit */
121568d0a1e932e6f6acd49376827a0e593815favboxsync } W80;
121568d0a1e932e6f6acd49376827a0e593815favboxsync struct
121568d0a1e932e6f6acd49376827a0e593815favboxsync {
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t ImageUsesLargePages : 1; /**< 0x003 / 0x003 : Pos 0, 1 Bit */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsProtectedProcess : 1; /**< 0x003 / 0x003 : Pos 1, 1 Bit */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsLegacyProcess : 1; /**< 0x003 / 0x003 : Pos 2, 1 Bit - Differs from W81, same as W80 & W6. */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t IsImageDynamicallyRelocated : 1; /**< 0x003 / 0x003 : Pos 3, 1 Bit - Differs from W81, same as W80 & W6. */
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync uint8_t SkipPatchingUser32Forwarders : 1; /**< 0x003 / 0x003 : Pos 4, 1 Bit - Added in W7; Differs from W81, same as W80. */
121568d0a1e932e6f6acd49376827a0e593815favboxsync uint8_t SpareBits : 3; /**< 0x003 / 0x003 : Pos 5, 3 Bit - Differs from W81 & W80, more spare bits. */
121568d0a1e932e6f6acd49376827a0e593815favboxsync } W7;
121568d0a1e932e6f6acd49376827a0e593815favboxsync struct
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync {
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t ImageUsesLargePages : 1; /**< 0x003 / 0x003 : Pos 0, 1 Bit */
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync uint8_t IsProtectedProcess : 1; /**< 0x003 / 0x003 : Pos 1, 1 Bit */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t IsLegacyProcess : 1; /**< 0x003 / 0x003 : Pos 2, 1 Bit - Differs from W81, same as W80 & W7. */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t IsImageDynamicallyRelocated : 1; /**< 0x003 / 0x003 : Pos 3, 1 Bit - Differs from W81, same as W80 & W7. */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t SpareBits : 4; /**< 0x003 / 0x003 : Pos 4, 4 Bit - Differs from W81, W80, & W7, more spare bits. */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync } W6;
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync struct
f31ac84c1c57e23801423b5bd184fadabe6456f3vboxsync {
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t ImageUsesLargePages : 1; /**< 0x003 / 0x003 : Pos 0, 1 Bit */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync uint8_t SpareBits : 7; /**< 0x003 / 0x003 : Pos 1, 7 Bit - Differs from W81, W80, & W7, more spare bits. */
db0ecde8f28fdb4525bc6d94056166c70b02ebb8vboxsync } W52;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync BOOLEAN SpareBool;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W51;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } Diff0;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync uint32_t Padding0; /**< 0x004 / NA */
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync#endif
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync HANDLE Mutant; /**< 0x008 / 0x004 */
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync PVOID ImageBaseAddress; /**< 0x010 / 0x008 */
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync PPEB_LDR_DATA Ldr; /**< 0x018 / 0x00c */
c33fc49611f2444dade533488bf431e29eb88bcdvboxsync struct _RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /**< 0x020 / 0x010 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync PVOID SubSystemData; /**< 0x028 / 0x014 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HANDLE ProcessHeap; /**< 0x030 / 0x018 */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync struct _RTL_CRITICAL_SECTION *FastPebLock; /**< 0x038 / 0x01c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync {
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync PVOID AtlThunkSListPtr; /**< 0x040 / 0x020 */
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync PVOID IFEOKey; /**< 0x048 / 0x024 */
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync union
1bf151411167b02ebdc6d6a18de8b97030341e1fvboxsync {
8fdb854581fe3cb394d84835dc09b02e6e18d4edvboxsync ULONG CrossProcessFlags; /**< 0x050 / 0x028 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync uint32_t ProcessInJob : 1; /**< 0x050 / 0x028: Pos 0, 1 Bit */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t ProcessInitializing : 1; /**< 0x050 / 0x028: Pos 1, 1 Bit */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t ProcessUsingVEH : 1; /**< 0x050 / 0x028: Pos 2, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t ProcessUsingVCH : 1; /**< 0x050 / 0x028: Pos 3, 1 Bit */
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync uint32_t ProcessUsingFTH : 1; /**< 0x050 / 0x028: Pos 4, 1 Bit */
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync uint32_t ReservedBits0 : 1; /**< 0x050 / 0x028: Pos 5, 27 Bits */
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync } W7, W8, W80, W81;
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync struct
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync {
e2760cdc84c692bc46cfaf5018d313db2f122acavboxsync uint32_t ProcessInJob : 1; /**< 0x050 / 0x028: Pos 0, 1 Bit */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync uint32_t ProcessInitializing : 1; /**< 0x050 / 0x028: Pos 1, 1 Bit */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync uint32_t ReservedBits0 : 30; /**< 0x050 / 0x028: Pos 2, 30 Bits */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync } W6;
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync };
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#if ARCH_BITS == 64
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync uint32_t Padding1; /**< 0x054 / */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#endif
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync } W6, W7, W8, W80, W81;
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync struct
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync {
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync PVOID AtlThunkSListPtr; /**< 0x040 / 0x020 */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync PVOID SparePtr2; /**< 0x048 / 0x024 */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync uint32_t EnvironmentUpdateCount; /**< 0x050 / 0x028 */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#if ARCH_BITS == 64
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync uint32_t Padding1; /**< 0x054 / */
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync#endif
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync } W52;
6e12ccc60ac657fb87e27b7a2b26e0a63bebe024vboxsync struct
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync {
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync PVOID FastPebLockRoutine; /**< NA / 0x020 */
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync PVOID FastPebUnlockRoutine; /**< NA / 0x024 */
d6f9950e2cf4ba7fd217c083400d9812ff745374vboxsync uint32_t EnvironmentUpdateCount; /**< NA / 0x028 */
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync } W51;
657b2c9f6d33f08001e5fa6f6e0572dcf0391013vboxsync } Diff1;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync union
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID KernelCallbackTable; /**< 0x058 / 0x02c */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID UserSharedInfoPtr; /**< 0x058 / 0x02c - Alternative use in W6.*/
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync };
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t SystemReserved; /**< 0x060 / 0x030 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync union
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync struct
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
ae94ad7e769e467419ab99cab5403bdb39bc544fvboxsync uint32_t AtlThunkSListPtr32; /**< 0x064 / 0x034 */
ae94ad7e769e467419ab99cab5403bdb39bc544fvboxsync } W7, W8, W80, W81;
ae94ad7e769e467419ab99cab5403bdb39bc544fvboxsync struct
ae94ad7e769e467419ab99cab5403bdb39bc544fvboxsync {
ae94ad7e769e467419ab99cab5403bdb39bc544fvboxsync uint32_t SpareUlong; /**< 0x064 / 0x034 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync } W52, W6;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync struct
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t ExecuteOptions : 2; /**< NA / 0x034: Pos 0, 2 Bits */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t SpareBits : 30; /**< NA / 0x034: Pos 2, 30 Bits */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync } W51;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync } Diff2;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync union
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync {
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync struct
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID ApiSetMap; /**< 0x068 / 0x038 */
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync } W7, W8, W80, W81;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync {
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync struct _PEB_FREE_BLOCK *FreeList; /**< 0x068 / 0x038 */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync } W52, W6;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct _PEB_FREE_BLOCK *FreeList; /**< NA / 0x038 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync } W51;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync } Diff3;
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync uint32_t TlsExpansionCounter; /**< 0x070 / 0x03c */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync#if ARCH_BITS == 64
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync uint32_t Padding2; /**< 0x074 / NA */
49e54e2ffe0c10864d06e9d1ebe24a8eb1327a6bvboxsync#endif
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync struct _RTL_BITMAP *TlsBitmap; /**< 0x078 / 0x040 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t TlsBitmapBits[2]; /**< 0x080 / 0x044 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync PVOID ReadOnlySharedMemoryBase; /**< 0x088 / 0x04c */
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync union
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID SparePvoid0; /**< 0x090 / 0x050 - HotpatchInformation before W81. */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync } W81;
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync struct
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID HotpatchInformation; /**< 0x090 / 0x050 - Retired in W81. */
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync } W6, W7, W80;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync {
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync PVOID ReadOnlySharedMemoryHeap;
fc5f879e9508f333e20b37c63db9189a33059308vboxsync } W52;
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync } Diff4;
91f8453d16b48876deddaba298c211071d0ca3a5vboxsync PVOID *ReadOnlyStaticServerData; /**< 0x098 / 0x054 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID AnsiCodePageData; /**< 0x0a0 / 0x058 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync PVOID OemCodePageData; /**< 0x0a8 / 0x05c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID UnicodeCaseTableData; /**< 0x0b0 / 0x060 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t NumberOfProcessors; /**< 0x0b8 / 0x064 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t NtGlobalFlag; /**< 0x0bc / 0x068 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER CriticalSectionTimeout; /**< 0x0c0 / 0x070 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T HeapSegmentReserve; /**< 0x0c8 / 0x078 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync SIZE_T HeapSegmentCommit; /**< 0x0d0 / 0x07c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SIZE_T HeapDeCommitTotalFreeThreshold; /**< 0x0d8 / 0x080 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SIZE_T HeapDeCommitFreeBlockThreshold; /**< 0x0e0 / 0x084 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t NumberOfHeaps; /**< 0x0e8 / 0x088 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint32_t MaximumNumberOfHeaps; /**< 0x0ec / 0x08c */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync PVOID *ProcessHeaps; /**< 0x0f0 / 0x090 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID GdiSharedHandleTable; /**< 0x0f8 / 0x094 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync PVOID ProcessStarterHelper; /**< 0x100 / 0x098 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint32_t GdiDCAttributeList; /**< 0x108 / 0x09c */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#if ARCH_BITS == 64
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t Padding3; /**< 0x10c / NA */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#endif
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync struct _RTL_CRITICAL_SECTION *LoaderLock; /**< 0x110 / 0x0a0 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint32_t OSMajorVersion; /**< 0x118 / 0x0a4 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint32_t OSMinorVersion; /**< 0x11c / 0x0a8 */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint16_t OSBuildNumber; /**< 0x120 / 0x0ac */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint16_t OSCSDVersion; /**< 0x122 / 0x0ae */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync uint32_t OSPlatformId; /**< 0x124 / 0x0b0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t ImageSubsystem; /**< 0x128 / 0x0b4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t ImageSubsystemMajorVersion; /**< 0x12c / 0x0b8 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t ImageSubsystemMinorVersion; /**< 0x130 / 0x0bc */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync uint32_t Padding4; /**< 0x134 / NA */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#endif
1c6ec9a3a329da6f61978a372e509cd233f0d9f9vboxsync union
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync SIZE_T ActiveProcessAffinityMask; /**< 0x138 / 0x0c0 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W7, W8, W80, W81;
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SIZE_T ImageProcessAffinityMask; /**< 0x138 / 0x0c0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W52, W6;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync } Diff5;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t GdiHandleBuffer[ARCH_BITS == 64 ? 60 : 34]; /**< 0x140 / 0x0c4 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID PostProcessInitRoutine; /**< 0x230 / 0x14c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID TlsExpansionBitmap; /**< 0x238 / 0x150 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync uint32_t TlsExpansionBitmapBits[32]; /**< 0x240 / 0x154 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t SessionId; /**< 0x2c0 / 0x1d4 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync#if ARCH_BITS == 64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t Padding5; /**< 0x2c4 / NA */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULARGE_INTEGER AppCompatFlags; /**< 0x2c8 / 0x1d8 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULARGE_INTEGER AppCompatFlagsUser; /**< 0x2d0 / 0x1e0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID pShimData; /**< 0x2d8 / 0x1e8 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync PVOID AppCompatInfo; /**< 0x2e0 / 0x1ec */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync UNICODE_STRING CSDVersion; /**< 0x2e8 / 0x1f0 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync struct _ACTIVATION_CONTEXT_DATA *ActivationContextData; /**< 0x2f8 / 0x1f8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct _ASSEMBLY_STORAGE_MAP *ProcessAssemblyStorageMap; /**< 0x300 / 0x1fc */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync struct _ACTIVATION_CONTEXT_DATA *SystemDefaultActivationContextData; /**< 0x308 / 0x200 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct _ASSEMBLY_STORAGE_MAP *SystemAssemblyStorageMap; /**< 0x310 / 0x204 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SIZE_T MinimumStackCommit; /**< 0x318 / 0x208 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /* End of PEB in W52 (Windows XP (RTM))! */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync struct _FLS_CALLBACK_INFO *FlsCallback; /**< 0x320 / 0x20c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync LIST_ENTRY FlsListHead; /**< 0x328 / 0x210 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID FlsBitmap; /**< 0x338 / 0x218 */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync uint32_t FlsBitmapBits[4]; /**< 0x340 / 0x21c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t FlsHighIndex; /**< 0x350 / 0x22c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync /* End of PEB in W52 (Windows Server 2003)! */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID WerRegistrationData; /**< 0x358 / 0x230 */
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync PVOID WerShipAssertPtr; /**< 0x360 / 0x234 */
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync /* End of PEB in W6 (windows Vista)! */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync union
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
7922c4cd397713a387c9e854e74c31a0d5065365vboxsync {
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync PVOID pUnused; /**< 0x368 / 0x238 - Was pContextData in W7. */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync } W8, W80, W81;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync PVOID pContextData; /**< 0x368 / 0x238 - Retired in W80. */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync } W7;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync } Diff6;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync PVOID pImageHeaderHash; /**< 0x370 / 0x23c */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync union
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync {
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t TracingFlags; /**< 0x378 / 0x240 */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync struct
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync {
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t HeapTracingEnabled : 1; /**< 0x378 / 0x240 : Pos 0, 1 Bit */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t CritSecTracingEnabled : 1; /**< 0x378 / 0x240 : Pos 1, 1 Bit */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t LibLoaderTracingEnabled : 1; /**< 0x378 / 0x240 : Pos 2, 1 Bit */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t SpareTracingBits : 29; /**< 0x378 / 0x240 : Pos 3, 29 Bits */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync } W8, W80, W81;
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync struct
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync {
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t HeapTracingEnabled : 1; /**< 0x378 / 0x240 : Pos 0, 1 Bit */
4a0e2f51aaf27c0bca61ff0f1adb91106264f0dbvboxsync uint32_t CritSecTracingEnabled : 1; /**< 0x378 / 0x240 : Pos 1, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t SpareTracingBits : 30; /**< 0x378 / 0x240 : Pos 3, 30 Bits - One bit more than W80 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W7;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync } Diff7;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t Padding6; /**< 0x37c / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint64_t CsrServerReadOnlySharedMemoryBase; /**< 0x380 / 0x248 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} PEB_COMMON;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef PEB_COMMON *PPEB_COMMON;
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsyncAssertCompileMemberOffset(PEB_COMMON, ProcessHeap, ARCH_BITS == 64 ? 0x30 : 0x18);
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsyncAssertCompileMemberOffset(PEB_COMMON, SystemReserved, ARCH_BITS == 64 ? 0x60 : 0x30);
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsyncAssertCompileMemberOffset(PEB_COMMON, TlsExpansionCounter, ARCH_BITS == 64 ? 0x70 : 0x3c);
67e7d53d62514401efcd0e7a34f5faf772a3fe04vboxsyncAssertCompileMemberOffset(PEB_COMMON, NtGlobalFlag, ARCH_BITS == 64 ? 0xbc : 0x68);
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsyncAssertCompileMemberOffset(PEB_COMMON, LoaderLock, ARCH_BITS == 64 ? 0x110 : 0xa0);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(PEB_COMMON, Diff5.W52.ImageProcessAffinityMask, ARCH_BITS == 64 ? 0x138 : 0xc0);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(PEB_COMMON, PostProcessInitRoutine, ARCH_BITS == 64 ? 0x230 : 0x14c);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsyncAssertCompileMemberOffset(PEB_COMMON, AppCompatFlags, ARCH_BITS == 64 ? 0x2c8 : 0x1d8);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsyncAssertCompileSize(PEB_COMMON, ARCH_BITS == 64 ? 0x388 : 0x250);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync/** The size of the windows 8.1 PEB structure. */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define PEB_SIZE_W81 sizeof(PEB_COMMON)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** The size of the windows 8.0 PEB structure. */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define PEB_SIZE_W80 sizeof(PEB_COMMON)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** The size of the windows 7 PEB structure. */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define PEB_SIZE_W7 RT_UOFFSETOF(PEB_COMMON, CsrServerReadOnlySharedMemoryBase)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** The size of the windows vista PEB structure. */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define PEB_SIZE_W6 RT_UOFFSETOF(PEB_COMMON, Diff3)
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync/** The size of the windows server 2003 PEB structure. */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#define PEB_SIZE_W52 RT_UOFFSETOF(PEB_COMMON, WerRegistrationData)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** The size of the windows XP PEB structure. */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync#define PEB_SIZE_W51 RT_UOFFSETOF(PEB_COMMON, FlsCallback)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if 0
2823fbb1428e982169f04923472d7c94e7ed8385vboxsynctypedef struct _NT_TIB
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID StackBase;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync PVOID StackLimit;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID SubSystemTib;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync union
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync PVOID FiberData;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG Version;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync };
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID ArbitraryUserPointer;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct _NT_TIB *Self;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} NT_TIB;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsynctypedef NT_TIB *PNT_TIB;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef struct _ACTIVATION_CONTEXT_STACK
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t Flags;
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync uint32_t NextCookieSequenceNumber;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID ActiveFrame;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync LIST_ENTRY FrameListCache;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync} ACTIVATION_CONTEXT_STACK;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/* Common TEB. */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsynctypedef struct _TEB_COMMON
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync NT_TIB NtTib; /**< 0x000 / 0x000 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID EnvironmentPointer; /**< 0x038 / 0x01c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync CLIENT_ID ClientId; /**< 0x040 / 0x020 */
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync PVOID ActiveRpcHandle; /**< 0x050 / 0x028 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID ThreadLocalStoragePointer; /**< 0x058 / 0x02c */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PPEB_COMMON ProcessEnvironmentBlock; /**< 0x060 / 0x030 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t LastErrorValue; /**< 0x068 / 0x034 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t CountOfOwnedCriticalSections; /**< 0x06c / 0x038 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID CsrClientThread; /**< 0x070 / 0x03c */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID Win32ThreadInfo; /**< 0x078 / 0x040 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t User32Reserved[26]; /**< 0x080 / 0x044 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync uint32_t UserReserved[5]; /**< 0x0e8 / 0x0ac */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID WOW32Reserved; /**< 0x100 / 0x0c0 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t CurrentLocale; /**< 0x108 / 0x0c4 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t FpSoftwareStatusRegister; /**< 0x10c / 0x0c8 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID SystemReserved1[54]; /**< 0x110 / 0x0cc */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync uint32_t ExceptionCode; /**< 0x2c0 / 0x1a4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t Padding0; /**< 0x2c4 / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync union
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer;/**< 0x2c8 / 0x1a8 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint8_t SpareBytes[ARCH_BITS == 64 ? 24 : 36]; /**< 0x2d0 / 0x1ac */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W52, W6, W7, W8, W80, W81;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync#if ARCH_BITS == 32
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ACTIVATION_CONTEXT_STACK ActivationContextStack; /**< NA / 0x1a8 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint8_t SpareBytes[20]; /**< NA / 0x1bc */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W51;
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync#endif
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync } Diff0;
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync union
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync {
67e7d53d62514401efcd0e7a34f5faf772a3fe04vboxsync struct
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t TxFsContext; /**< 0x2e8 / 0x1d0 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W6, W7, W8, W80, W81;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync struct
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t SpareBytesContinues; /**< 0x2e8 / 0x1d0 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync } W52;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } Diff1;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync#if ARCH_BITS == 64
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t Padding1; /**< 0x2ec / NA */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync#endif
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync /*_GDI_TEB_BATCH*/ uint8_t GdiTebBatch[ARCH_BITS == 64 ? 0x4e8 :0x4e0]; /**< 0x2f0 / 0x1d4 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync CLIENT_ID RealClientId; /**< 0x7d8 / 0x6b4 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HANDLE GdiCachedProcessHandle; /**< 0x7e8 / 0x6bc */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t GdiClientPID; /**< 0x7f0 / 0x6c0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t GdiClientTID; /**< 0x7f4 / 0x6c4 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID GdiThreadLocalInfo; /**< 0x7f8 / 0x6c8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T Win32ClientInfo[62]; /**< 0x800 / 0x6cc */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID glDispatchTable[233]; /**< 0x9f0 / 0x7c4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T glReserved1[29]; /**< 0x1138 / 0xb68 */
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync PVOID glReserved2; /**< 0x1220 / 0xbdc */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID glSectionInfo; /**< 0x1228 / 0xbe0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID glSection; /**< 0x1230 / 0xbe4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID glTable; /**< 0x1238 / 0xbe8 */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync PVOID glCurrentRC; /**< 0x1240 / 0xbec */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID glContext; /**< 0x1248 / 0xbf0 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync NTSTATUS LastStatusValue; /**< 0x1250 / 0xbf4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t Padding2; /**< 0x1254 / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync UNICODE_STRING StaticUnicodeString; /**< 0x1258 / 0xbf8 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync WCHAR StaticUnicodeBuffer[261]; /**< 0x1268 / 0xc00 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync WCHAR Padding3[3]; /**< 0x1472 / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID DeallocationStack; /**< 0x1478 / 0xe0c */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync PVOID TlsSlots[64]; /**< 0x1480 / 0xe10 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LIST_ENTRY TlsLinks; /**< 0x1680 / 0xf10 */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync PVOID Vdm; /**< 0x1690 / 0xf18 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID ReservedForNtRpc; /**< 0x1698 / 0xf1c */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID DbgSsReserved[2]; /**< 0x16a0 / 0xf20 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t HardErrorMode; /**< 0x16b0 / 0xf28 - Called HardErrorsAreDisabled in W51. */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync#if ARCH_BITS == 64
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t Padding4; /**< 0x16b4 / NA */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync#endif
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID Instrumentation[ARCH_BITS == 64 ? 11 : 9]; /**< 0x16b8 / 0xf2c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync union
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
e214bb78026c1d64078b34ca9504d3f5abbc52efvboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync GUID ActivityId; /**< 0x1710 / 0xf50 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID SubProcessTag; /**< 0x1720 / 0xf60 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W6, W7, W8, W80, W81;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID InstrumentationContinues[ARCH_BITS == 64 ? 3 : 5]; /**< 0x1710 / 0xf50 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W52;
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync } Diff2;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union /**< 0x1728 / 0xf64 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID PerflibData; /**< 0x1728 / 0xf64 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync } W8, W80, W81;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync struct
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID EtwLocalData; /**< 0x1728 / 0xf64 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync } W7, W6;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID SubProcessTag; /**< 0x1728 / 0xf64 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync } W52;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID InstrumentationContinues[1]; /**< 0x1728 / 0xf64 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W51;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } Diff3;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID EtwTraceData; /**< 0x1730 / 0xf68 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync } W52, W6, W7, W8, W80, W81;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID InstrumentationContinues[1]; /**< 0x1730 / 0xf68 */
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync } W51;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } Diff4;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID WinSockData; /**< 0x1738 / 0xf6c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t GdiBatchCount; /**< 0x1740 / 0xf70 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union
fc148a6b23d25a87561beaffe0ba06c3ba93bf5avboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PROCESSOR_NUMBER CurrentIdealProcessor; /**< 0x1744 / 0xf74 - W7+ */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t IdealProcessorValue; /**< 0x1744 / 0xf74 - W7+ */
794c574111980e7fb3a86847e5495156afa13134vboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint8_t ReservedPad1; /**< 0x1744 / 0xf74 - Called SpareBool0 in W6 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync uint8_t ReservedPad2; /**< 0x1745 / 0xf75 - Called SpareBool0 in W6 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint8_t ReservedPad3; /**< 0x1746 / 0xf76 - Called SpareBool0 in W6 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint8_t IdealProcessor; /**< 0x1747 / 0xf77 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync };
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W6, W7, W8, W80, W81;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync BOOLEAN InDbgPrint; /**< 0x1744 / 0xf74 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync BOOLEAN FreeStackOnTermination; /**< 0x1745 / 0xf75 */
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync BOOLEAN HasFiberData; /**< 0x1746 / 0xf76 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint8_t IdealProcessor; /**< 0x1747 / 0xf77 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W51, W52;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } Diff5;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint32_t GuaranteedStackBytes; /**< 0x1748 / 0xf78 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync#if ARCH_BITS == 64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t Padding5; /**< 0x174c / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync PVOID ReservedForPerf; /**< 0x1750 / 0xf7c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID ReservedForOle; /**< 0x1758 / 0xf80 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t WaitingOnLoaderLock; /**< 0x1760 / 0xf84 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t Padding6; /**< 0x1764 / NA */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#endif
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union /**< 0x1770 / 0xf8c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync struct
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync {
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync PVOID SavedPriorityState; /**< 0x1768 / 0xf88 */
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync SIZE_T ReservedForCodeCoverage; /**< 0x1770 / 0xf8c */
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync PVOID ThreadPoolData; /**< 0x1778 / 0xf90 */
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync } W8, W80, W81;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID SavedPriorityState; /**< 0x1768 / 0xf88 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SIZE_T SoftPatchPtr1; /**< 0x1770 / 0xf8c */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID ThreadPoolData; /**< 0x1778 / 0xf90 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W6, W7;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
d107911787df36a78788a841b73d24da896d02f6vboxsync PVOID SparePointer1; /**< 0x1768 / 0xf88 */
d107911787df36a78788a841b73d24da896d02f6vboxsync SIZE_T SoftPatchPtr1; /**< 0x1770 / 0xf8c */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID SoftPatchPtr2; /**< 0x1778 / 0xf90 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W52;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#if ARCH_BITS == 32
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct _Wx86ThreadState
2a5e5a032e6f23f8937718e4ee4d6979188bdd19vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID CallBx86Eip; /**< NA / 0xf88 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID DeallocationCpu; /**< NA / 0xf8c */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync BOOLEAN UseKnownWx86Dll; /**< NA / 0xf90 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync int8_t OleStubInvoked; /**< NA / 0xf91 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync } W51;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } Diff6;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID TlsExpansionSlots; /**< 0x1780 / 0xf94 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID DallocationBStore; /**< 0x1788 / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID BStoreLimit; /**< 0x1790 / NA */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync#endif
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync union
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t MuiGeneration; /**< 0x1798 / 0xf98 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W7, W8, W80, W81;
1871985cb4854e5bfb2ead8174ee28dbfce74df5vboxsync struct
1871985cb4854e5bfb2ead8174ee28dbfce74df5vboxsync {
1871985cb4854e5bfb2ead8174ee28dbfce74df5vboxsync uint32_t ImpersonationLocale;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W6;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } Diff7;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t IsImpersonating; /**< 0x179c / 0xf9c */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID NlsCache; /**< 0x17a0 / 0xfa0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID pShimData; /**< 0x17a8 / 0xfa4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync union /**< 0x17b0 / 0xfa8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
794c574111980e7fb3a86847e5495156afa13134vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t HeapVirtualAffinity; /**< 0x17b0 / 0xfa8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t LowFragHeapDataSlot; /**< 0x17b2 / 0xfaa */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W8, W80, W81;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync struct
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t HeapVirtualAffinity; /**< 0x17b0 / 0xfa8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W7;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync } Diff8;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if ARCH_BITS == 64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint32_t Padding7; /**< 0x17b4 / NA */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HANDLE CurrentTransactionHandle; /**< 0x17b8 / 0xfac */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct _TEB_ACTIVE_FRAME *ActiveFrame; /**< 0x17c0 / 0xfb0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /* End of TEB in W51 (Windows XP)! */
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync PVOID FlsData; /**< 0x17c8 / 0xfb4 */
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync union
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync {
a9f530691071e3496b072915b0c5ceabd4e05ea5vboxsync struct
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync {
b7a8ce033b32a429def2feb142bc1bdd1b5dffa2vboxsync PVOID PreferredLanguages; /**< 0x17d0 / 0xfb8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W6, W7, W8, W80, W81;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync BOOLEAN SafeThunkCall; /**< 0x17d0 / 0xfb8 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint8_t BooleanSpare[3]; /**< 0x17d1 / 0xfb9 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /* End of TEB in W52 (Windows server 2003)! */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync } W52;
d107911787df36a78788a841b73d24da896d02f6vboxsync } Diff9;
d107911787df36a78788a841b73d24da896d02f6vboxsync PVOID UserPrefLanguages; /**< 0x17d8 / 0xfbc */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync PVOID MergedPrefLanguages; /**< 0x17e0 / 0xfc0 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t MuiImpersonation; /**< 0x17e8 / 0xfc4 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync union
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t CrossTebFlags; /**< 0x17ec / 0xfc8 */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t SpareCrossTebBits : 16; /**< 0x17ec / 0xfc8 : Pos 0, 16 Bits */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync };
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync };
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync union
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync uint16_t SameTebFlags; /**< 0x17ee / 0xfca */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t SafeThunkCall : 1; /**< 0x17ee / 0xfca : Pos 0, 1 Bit */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync uint16_t InDebugPrint : 1; /**< 0x17ee / 0xfca : Pos 1, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t HasFiberData : 1; /**< 0x17ee / 0xfca : Pos 2, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t SkipThreadAttach : 1; /**< 0x17ee / 0xfca : Pos 3, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t WerInShipAssertCode : 1; /**< 0x17ee / 0xfca : Pos 4, 1 Bit */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync uint16_t RanProcessInit : 1; /**< 0x17ee / 0xfca : Pos 5, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t ClonedThread : 1; /**< 0x17ee / 0xfca : Pos 6, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t SuppressDebugMsg : 1; /**< 0x17ee / 0xfca : Pos 7, 1 Bit */
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync } Common;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t SafeThunkCall : 1; /**< 0x17ee / 0xfca : Pos 0, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t InDebugPrint : 1; /**< 0x17ee / 0xfca : Pos 1, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t HasFiberData : 1; /**< 0x17ee / 0xfca : Pos 2, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SkipThreadAttach : 1; /**< 0x17ee / 0xfca : Pos 3, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t WerInShipAssertCode : 1; /**< 0x17ee / 0xfca : Pos 4, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t RanProcessInit : 1; /**< 0x17ee / 0xfca : Pos 5, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t ClonedThread : 1; /**< 0x17ee / 0xfca : Pos 6, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SuppressDebugMsg : 1; /**< 0x17ee / 0xfca : Pos 7, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DisableUserStackWalk : 1; /**< 0x17ee / 0xfca : Pos 8, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t RtlExceptionAttached : 1; /**< 0x17ee / 0xfca : Pos 9, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t InitialThread : 1; /**< 0x17ee / 0xfca : Pos 10, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SessionAware : 1; /**< 0x17ee / 0xfca : Pos 11, 1 Bit - New Since W7. */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SpareSameTebBits : 4; /**< 0x17ee / 0xfca : Pos 12, 4 Bits */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync } W8, W80, W81;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync struct
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync {
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SafeThunkCall : 1; /**< 0x17ee / 0xfca : Pos 0, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t InDebugPrint : 1; /**< 0x17ee / 0xfca : Pos 1, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t HasFiberData : 1; /**< 0x17ee / 0xfca : Pos 2, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SkipThreadAttach : 1; /**< 0x17ee / 0xfca : Pos 3, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t WerInShipAssertCode : 1; /**< 0x17ee / 0xfca : Pos 4, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t RanProcessInit : 1; /**< 0x17ee / 0xfca : Pos 5, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t ClonedThread : 1; /**< 0x17ee / 0xfca : Pos 6, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SuppressDebugMsg : 1; /**< 0x17ee / 0xfca : Pos 7, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DisableUserStackWalk : 1; /**< 0x17ee / 0xfca : Pos 8, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t RtlExceptionAttached : 1; /**< 0x17ee / 0xfca : Pos 9, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t InitialThread : 1; /**< 0x17ee / 0xfca : Pos 10, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t SpareSameTebBits : 5; /**< 0x17ee / 0xfca : Pos 12, 4 Bits */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync } W7;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync struct
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync {
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgSafeThunkCall : 1; /**< 0x17ee / 0xfca : Pos 0, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgInDebugPrint : 1; /**< 0x17ee / 0xfca : Pos 1, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgHasFiberData : 1; /**< 0x17ee / 0xfca : Pos 2, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgSkipThreadAttach : 1; /**< 0x17ee / 0xfca : Pos 3, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgWerInShipAssertCode : 1; /**< 0x17ee / 0xfca : Pos 4, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgRanProcessInit : 1; /**< 0x17ee / 0xfca : Pos 5, 1 Bit */
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync uint16_t DbgClonedThread : 1; /**< 0x17ee / 0xfca : Pos 6, 1 Bit */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync uint16_t DbgSuppressDebugMsg : 1; /**< 0x17ee / 0xfca : Pos 7, 1 Bit */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint16_t SpareSameTebBits : 8; /**< 0x17ee / 0xfca : Pos 8, 8 Bits */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } W6;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync } Diff10;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync PVOID TxnScopeEnterCallback; /**< 0x17f0 / 0xfcc */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID TxnScopeExitCallback; /**< 0x17f8 / 0xfd0 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID TxnScopeContext; /**< 0x1800 / 0xfd4 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t LockCount; /**< 0x1808 / 0xfd8 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint32_t SpareUlong0; /**< 0x180c / 0xfdc */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync } W7, W8, W80, W81;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync uint32_t ProcessRundown;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W6;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync } Diff11;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync union
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync struct
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync {
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PVOID ResourceRetValue; /**< 0x1810 / 0xfe0 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync /* End of TEB in W7 (windows 7)! */
5704a317c3b6bdf4b59f6a6ebe45d443296b1995vboxsync PVOID ReservedForWdf; /**< 0x1818 / 0xfe4 - New Since W7. */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync /* End of TEB in W8 (windows 8.0 & 8.1)! */
5704a317c3b6bdf4b59f6a6ebe45d443296b1995vboxsync } W8, W80, W81;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync struct
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync {
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID ResourceRetValue; /**< 0x1810 / 0xfe0 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W7;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync struct
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync {
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync uint64_t LastSwitchTime; /**< 0x1810 / 0xfe0 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync uint64_t TotalSwitchOutTime; /**< 0x1818 / 0xfe8 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER WaitReasonBitMap; /**< 0x1820 / 0xff0 */
6c1f3eb64096421b9ba7272f297bac6ff3d29fe7vboxsync /* End of TEB in W6 (windows Vista)! */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } W6;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync } Diff12;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} TEB_COMMON;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef TEB_COMMON *PTEB_COMMON;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(TEB_COMMON, ExceptionCode, ARCH_BITS == 64 ? 0x2c0 : 0x1a4);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncAssertCompileMemberOffset(TEB_COMMON, LastStatusValue, ARCH_BITS == 64 ? 0x1250 : 0xbf4);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncAssertCompileMemberOffset(TEB_COMMON, DeallocationStack, ARCH_BITS == 64 ? 0x1478 : 0xe0c);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(TEB_COMMON, ReservedForNtRpc, ARCH_BITS == 64 ? 0x1698 : 0xf1c);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(TEB_COMMON, Instrumentation, ARCH_BITS == 64 ? 0x16b8 : 0xf2c);
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsyncAssertCompileMemberOffset(TEB_COMMON, Diff2, ARCH_BITS == 64 ? 0x1710 : 0xf50);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(TEB_COMMON, Diff3, ARCH_BITS == 64 ? 0x1728 : 0xf64);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncAssertCompileMemberOffset(TEB_COMMON, Diff4, ARCH_BITS == 64 ? 0x1730 : 0xf68);
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsyncAssertCompileMemberOffset(TEB_COMMON, WinSockData, ARCH_BITS == 64 ? 0x1738 : 0xf6c);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncAssertCompileMemberOffset(TEB_COMMON, GuaranteedStackBytes, ARCH_BITS == 64 ? 0x1748 : 0xf78);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncAssertCompileMemberOffset(TEB_COMMON, MuiImpersonation, ARCH_BITS == 64 ? 0x17e8 : 0xfc4);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncAssertCompileMemberOffset(TEB_COMMON, LockCount, ARCH_BITS == 64 ? 0x1808 : 0xfd8);
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsyncAssertCompileSize(TEB_COMMON, ARCH_BITS == 64 ? 0x1828 : 0xff8);
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
f8df398d066204e2bf0ba209ea3554fc113fb484vboxsync/** The size of the windows 8.1 PEB structure. */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define TEB_SIZE_W81 ( RT_UOFFSETOF(TEB_COMMON, Diff12.W8.ReservedForWdf) + sizeof(PVOID) )
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync/** The size of the windows 8.0 PEB structure. */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define TEB_SIZE_W80 ( RT_UOFFSETOF(TEB_COMMON, Diff12.W8.ReservedForWdf) + sizeof(PVOID) )
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync/** The size of the windows 7 PEB structure. */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define TEB_SIZE_W7 RT_UOFFSETOF(TEB_COMMON, Diff12.W8.ReservedForWdf)
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync/** The size of the windows vista PEB structure. */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define TEB_SIZE_W6 ( RT_UOFFSETOF(TEB_COMMON, Diff12.W6.WaitReasonBitMap) + sizeof(LARGE_INTEGER) )
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync/** The size of the windows server 2003 PEB structure. */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define TEB_SIZE_W52 RT_ALIGN_Z(RT_UOFFSETOF(TEB_COMMON, Diff9.W52.BooleanSpare), sizeof(PVOID))
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync/** The size of the windows XP PEB structure. */
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define TEB_SIZE_W51 RT_UOFFSETOF(TEB_COMMON, FlsData)
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define _PEB _PEB_COMMON
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsynctypedef PEB_COMMON PEB;
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsynctypedef PPEB_COMMON PPEB;
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync
f62342e2cc901a67e27fa69c0e712ee35e9c4c68vboxsync#define _TEB _TEB_COMMON
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsynctypedef TEB_COMMON TEB;
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsynctypedef PTEB_COMMON PTEB;
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync#define RTNtCurrentTeb() ((PTEB)NtCurrentTeb())
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync#define RTNtCurrentPeb() (RTNtCurrentTeb()->ProcessEnvironmentBlock)
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync#define NtCurrentPeb() RTNtCurrentPeb()
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync#define RTNtCurrentThreadId() ((uint32_t)(uintptr_t)RTNtCurrentTeb()->ClientId.UniqueThread)
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync/** @} */
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync#ifdef IPRT_NT_USE_WINTERNL
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsyncNTSYSAPI NTSTATUS NTAPI NtCreateSection(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG, HANDLE);
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsyncNTSYSAPI NTSTATUS NTAPI NtUnmapViewOfSection(HANDLE, PVOID);
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsynctypedef enum _SECTION_INHERIT
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync{
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync ViewShare = 1,
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync ViewUnmap
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync} SECTION_INHERIT;
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsyncNTSYSAPI NTSTATUS NTAPI NtMapViewOfSection(HANDLE, HANDLE, PVOID *, ULONG, SIZE_T, PLARGE_INTEGER, PSIZE_T, SECTION_INHERIT,
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync ULONG, ULONG);
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsynctypedef struct _FILE_FS_ATTRIBUTE_INFORMATION
b604fbf16eda38d14b4999c245f032bfaa5aa85avboxsync{
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync ULONG FileSystemAttributes;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync LONG MaximumComponentNameLength;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync ULONG FileSystemNameLength;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync WCHAR FileSystemName[1];
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync} FILE_FS_ATTRIBUTE_INFORMATION;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsynctypedef FILE_FS_ATTRIBUTE_INFORMATION *PFILE_FS_ATTRIBUTE_INFORMATION;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenProcess(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenThread(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsynctypedef enum _FSINFOCLASS
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync{
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsVolumeInformation = 1,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsLabelInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsSizeInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsDeviceInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsAttributeInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsControlInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsFullSizeInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsObjectIdInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsDriverPathInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsVolumeFlagsInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsSectorSizeInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsDataCopyInformation,
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync FileFsMaximumInformation
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsync} FS_INFORMATION_CLASS;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsynctypedef FS_INFORMATION_CLASS *PFS_INFORMATION_CLASS;
13d1fd6f43e9a245a4f2b4fc6845bdaa5d0f4134vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef struct _FILE_BOTH_DIR_INFORMATION
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG NextEntryOffset;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ULONG FileIndex;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync LARGE_INTEGER CreationTime;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync LARGE_INTEGER LastAccessTime;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync LARGE_INTEGER LastWriteTime;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER ChangeTime;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync LARGE_INTEGER EndOfFile;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER AllocationSize;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG FileAttributes;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG FileNameLength;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ULONG EaSize;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync CCHAR ShortNameLength;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync WCHAR ShortName[12];
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync WCHAR FileName[1];
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync} FILE_BOTH_DIR_INFORMATION;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsynctypedef FILE_BOTH_DIR_INFORMATION *PFILE_BOTH_DIR_INFORMATION;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsynctypedef struct _FILE_BASIC_INFORMATION
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync LARGE_INTEGER CreationTime;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync LARGE_INTEGER LastAccessTime;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER LastWriteTime;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync LARGE_INTEGER ChangeTime;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync ULONG FileAttributes;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync} FILE_BASIC_INFORMATION;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsynctypedef FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef struct _FILE_STANDARD_INFORMATION
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync{
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync LARGE_INTEGER AllocationSize;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER EndOfFile;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG NumberOfLinks;
14650dbf3041b8fcb092b55cf673bd6f392390c2vboxsync BOOLEAN DeletePending;
04c6e2bf4c47aa33be5ee50ac468b1b86b7125b4vboxsync BOOLEAN Directory;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync} FILE_STANDARD_INFORMATION;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsynctypedef FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
14650dbf3041b8fcb092b55cf673bd6f392390c2vboxsynctypedef struct _FILE_NAME_INFORMATION
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync{
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync ULONG FileNameLength;
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync WCHAR FileName[1];
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync} FILE_NAME_INFORMATION;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsynctypedef FILE_NAME_INFORMATION *PFILE_NAME_INFORMATION;
8c58249d7f93d82395aa6c8b31526443892bc375vboxsynctypedef enum _FILE_INFORMATION_CLASS
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync{
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync FileDirectoryInformation = 1,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync FileFullDirectoryInformation,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync FileBothDirectoryInformation,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync FileBasicInformation,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync FileStandardInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileInternalInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileEaInformation,
6c1f3eb64096421b9ba7272f297bac6ff3d29fe7vboxsync FileAccessInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileNameInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileRenameInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileLinkInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileNamesInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileDispositionInformation,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync FilePositionInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileFullEaInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileModeInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileAlignmentInformation,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync FileAllInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileAllocationInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileEndOfFileInformation,
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsync FileAlternateNameInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileStreamInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FilePipeInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FilePipeLocalInformation,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync FilePipeRemoteInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileMailslotQueryInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileMailslotSetInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileCompressionInformation,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync FileObjectIdInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileCompletionInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileMoveClusterInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileQuotaInformation,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync FileReparsePointInformation,
9bb98d54790a98dad0ad6d9bdc5d319b6fdf0bffvboxsync FileNetworkOpenInformation,
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsync FileAttributeTagInformation,
9bb98d54790a98dad0ad6d9bdc5d319b6fdf0bffvboxsync FileTrackingInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileIdBothDirectoryInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileIdFullDirectoryInformation,
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync FileValidDataLengthInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileShortNameInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileIoCompletionNotificationInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileIoStatusBlockRangeInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileIoPriorityHintInformation,
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync FileSfioReserveInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileSfioVolumeInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileHardLinkInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileProcessIdsUsingFileInformation,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync FileNormalizedNameInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileNetworkPhysicalNameInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileIdGlobalTxDirectoryInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileIsRemoteDeviceInformation,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync FileUnusedInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileNumaNodeInformation,
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsync FileStandardLinkInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileRemoteProtocolInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileRenameInformationBypassAccessCheck,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileLinkInformationBypassAccessCheck,
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync FileVolumeNameInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileIdInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync FileIdExtdDirectoryInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileReplaceCompletionInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync FileHardLinkFullIdInformation,
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync FileMaximumInformation
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync} FILE_INFORMATION_CLASS;
8c58249d7f93d82395aa6c8b31526443892bc375vboxsynctypedef FILE_INFORMATION_CLASS *PFILE_INFORMATION_CLASS;
8c58249d7f93d82395aa6c8b31526443892bc375vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
8c58249d7f93d82395aa6c8b31526443892bc375vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryDirectoryFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG,
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync FILE_INFORMATION_CLASS, BOOLEAN, PUNICODE_STRING, BOOLEAN);
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsynctypedef struct _MEMORY_SECTION_NAME
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync{
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync UNICODE_STRING SectionFileName;
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsync WCHAR NameBuffer[1];
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync} MEMORY_SECTION_NAME;
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync#ifdef IPRT_NT_USE_WINTERNL
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsynctypedef struct _PROCESS_BASIC_INFORMATION
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync{
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync NTSTATUS ExitStatus;
8c58249d7f93d82395aa6c8b31526443892bc375vboxsync PPEB PebBaseAddress;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync ULONG_PTR AffinityMask;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync int32_t BasePriority;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync ULONG_PTR UniqueProcessId;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync ULONG_PTR InheritedFromUniqueProcessId;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync} PROCESS_BASIC_INFORMATION;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsynctypedef PROCESS_BASIC_INFORMATION *PPROCESS_BASIC_INFORMATION;
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync#endif
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsynctypedef enum _PROCESSINFOCLASS
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync{
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync ProcessBasicInformation = 0,
aa0553becec2abc2e781f839ba1d399c31c2c07fvboxsync ProcessQuotaLimits,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessIoCounters,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessVmCounters,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessTimes,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessBasePriority,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessRaisePriority,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessDebugPort,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessExceptionPort,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessAccessToken,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessLdtInformation,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessLdtSize,
4b9a9888c020ed3508c8ac3a5b47842d6aa3f8d2vboxsync ProcessDefaultHardErrorMode,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync ProcessIoPortHandlers,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ProcessPooledUsageAndLimits,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ProcessWorkingSetWatch,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ProcessUserModeIOPL,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ProcessEnableAlignmentFaultFixup,
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ProcessPriorityClass,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ProcessWx86Information,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ProcessHandleCount,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ProcessAffinityMask,
4a7d8f564249fb379bc53ebea77574be0e38b131vboxsync ProcessPriorityBoost,
4a7d8f564249fb379bc53ebea77574be0e38b131vboxsync ProcessDeviceMap,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ProcessSessionInformation,
4a7d8f564249fb379bc53ebea77574be0e38b131vboxsync ProcessForegroundInformation,
4a7d8f564249fb379bc53ebea77574be0e38b131vboxsync ProcessWow64Information,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ProcessImageFileName,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ProcessLUIDDeviceMapsEnabled,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ProcessBreakOnTermination,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ProcessDebugObjectHandle,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessDebugFlags,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessHandleTracing,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessIoPriority,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ProcessExecuteFlags,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessTlsInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessCookie,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessImageInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessCycleTime,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ProcessPagePriority,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ProcessInstrumentationCallbak,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessThreadStackAllocation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessWorkingSetWatchEx,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ProcessImageFileNameWin32,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessImageFileMapping,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessAffinityUpdateMode,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessMemoryAllocationMode,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessGroupInformation,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessTokenVirtualizationEnabled,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessConsoleHostProcess,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ProcessWindowsInformation,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync MaxProcessInfoClass
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync} PROCESSINFOCLASS;
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsynctypedef enum _THREADINFOCLASS
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync{
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ThreadBasicInformation = 0,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ThreadTimes,
fa80a38f04b00afbb167e46c385cf24df0e223ddvboxsync ThreadPriority,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadBasePriority,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadAffinityMask,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadImpersonationToken,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ThreadDescriptorTableEntry,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadEnableAlignmentFaultFixup,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadEventPair_Reusable,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadQuerySetWin32StartAddress,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadZeroTlsCell,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadPerformanceCount,
468c2bcb36eb9a032f5dd0fcb34db10bd58e9996vboxsync ThreadAmILastThread,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadIdealProcessor,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ThreadPriorityBoost,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadSetTlsArrayAddress,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ThreadIsIoPending,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadHideFromDebugger,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ThreadBreakOnTermination,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadSwitchLegacyState,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ThreadIsTerminated,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadLastSystemCall,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ThreadIoPriority,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadCycleTime,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadPagePriority,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadActualBasePriority,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadTebInformation,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ThreadCSwitchMon,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ThreadCSwitchPmu,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadWow64Context,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadGroupInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadUmsInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadCounterProfiling,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadIdealProcessorEx,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ThreadCpuAccountingInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync MaxThreadInfoClass
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} THREADINFOCLASS;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsyncNTSYSAPI NTSTATUS NTAPI NtSetInformationThread(HANDLE, THREADINFOCLASS, LPCVOID, ULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtReadFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsyncNTSYSAPI NTSTATUS NTAPI NtWriteFile(HANDLE, HANDLE, PIO_APC_ROUTINE, void const *, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtReadVirtualMemory(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE, PVOID, void const *, SIZE_T, PSIZE_T);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI RtlAddAccessAllowedAce(PACL, ULONG, ULONG, PSID);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI RtlCopySid(ULONG, PSID, PSID);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL, ULONG, ULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI BOOLEAN NTAPI RtlEqualSid(PSID, PSID);
468c2bcb36eb9a032f5dd0fcb34db10bd58e9996vboxsyncNTSYSAPI NTSTATUS NTAPI RtlGetVersion(PRTL_OSVERSIONINFOW);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI RtlInitializeSid(PSID, PSID_IDENTIFIER_AUTHORITY, UCHAR);
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsyncNTSYSAPI NTSTATUS NTAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI PULONG NTAPI RtlSubAuthoritySid(PSID, ULONG);
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif /* IPRT_NT_USE_WINTERNL */
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsynctypedef enum _OBJECT_INFORMATION_CLASS
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync{
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ObjectBasicInformation = 0,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ObjectNameInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ObjectTypeInformation,
cb2880968807a37c9efe6d5d32d56f2def91d908vboxsync ObjectAllInformation,
1407e1d0e3666d810460e291ecfc3c0b5f6feab3vboxsync ObjectDataInformation
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} OBJECT_INFORMATION_CLASS;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsynctypedef OBJECT_INFORMATION_CLASS *POBJECT_INFORMATION_CLASS;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifdef IN_RING0
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define NtQueryObject ZwQueryObject
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtDuplicateObject(HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenDirectoryObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsynctypedef struct _OBJECT_DIRECTORY_INFORMATION
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync{
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync UNICODE_STRING Name;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync UNICODE_STRING TypeName;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} OBJECT_DIRECTORY_INFORMATION;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsynctypedef OBJECT_DIRECTORY_INFORMATION *POBJECT_DIRECTORY_INFORMATION;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtSuspendProcess(HANDLE);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtResumeProcess(HANDLE);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync/** @name ProcessDefaultHardErrorMode bit definitions.
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync * @{ */
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync#define PROCESS_HARDERR_CRITICAL_ERROR UINT32_C(0x00000001) /**< Inverted from the win32 define. */
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#define PROCESS_HARDERR_NO_GP_FAULT_ERROR UINT32_C(0x00000002)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#define PROCESS_HARDERR_NO_ALIGNMENT_FAULT_ERROR UINT32_C(0x00000004)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#define PROCESS_HARDERR_NO_OPEN_FILE_ERROR UINT32_C(0x00008000)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync/** @} */
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsyncNTSYSAPI NTSTATUS NTAPI NtSetInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG);
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsyncNTSYSAPI NTSTATUS NTAPI NtTerminateProcess(HANDLE, LONG);
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync/** Retured by ProcessImageInformation as well as NtQuerySection. */
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsynctypedef struct _SECTION_IMAGE_INFORMATION
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync{
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync PVOID TransferAddress;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync ULONG ZeroBits;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync SIZE_T MaximumStackSize;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync SIZE_T CommittedStackSize;
904810c4c6668233349b025cc58013cb7c11c701vboxsync ULONG SubSystemType;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync union
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync {
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync struct
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync {
794c574111980e7fb3a86847e5495156afa13134vboxsync USHORT SubSystemMinorVersion;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync USHORT SubSystemMajorVersion;
794c574111980e7fb3a86847e5495156afa13134vboxsync };
794c574111980e7fb3a86847e5495156afa13134vboxsync ULONG SubSystemVersion;
794c574111980e7fb3a86847e5495156afa13134vboxsync };
794c574111980e7fb3a86847e5495156afa13134vboxsync ULONG GpValue;
794c574111980e7fb3a86847e5495156afa13134vboxsync USHORT ImageCharacteristics;
794c574111980e7fb3a86847e5495156afa13134vboxsync USHORT DllCharacteristics;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync USHORT Machine;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync BOOLEAN ImageContainsCode;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync union /**< Since Vista, used to be a spare BOOLEAN. */
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync {
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync struct
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync {
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync UCHAR ComPlusNativeRead : 1;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync UCHAR ComPlusILOnly : 1;
62a515eec8de1b7804ec6997c0f2013fef5c5a6bvboxsync UCHAR ImageDynamicallyRelocated : 1;
468c2bcb36eb9a032f5dd0fcb34db10bd58e9996vboxsync UCHAR ImageMAppedFlat : 1;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync UCHAR Reserved : 4;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync };
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync UCHAR ImageFlags;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync };
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ULONG LoaderFlags;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ULONG ImageFileSize; /**< Since XP? */
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ULONG CheckSum; /**< Since Vista, Used to be a reserved/spare ULONG. */
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} SECTION_IMAGE_INFORMATION;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsynctypedef SECTION_IMAGE_INFORMATION *PSECTION_IMAGE_INFORMATION;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsynctypedef enum _SECTION_INFORMATION_CLASS
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync{
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync SectionBasicInformation = 0,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync SectionImageInformation,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync MaxSectionInfoClass
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} SECTION_INFORMATION_CLASS;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsyncNTSYSAPI NTSTATUS NTAPI NtQuerySection(HANDLE, SECTION_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtCreateSymbolicLinkObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PUNICODE_STRING pTarget);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenSymbolicLinkObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtQuerySymbolicLinkObject(HANDLE, PUNICODE_STRING, PULONG);
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync#ifndef SYMBOLIC_LINK_QUERY
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync# define SYMBOLIC_LINK_QUERY UINT32_C(0x00000001)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef SYMBOLIC_LINK_ALL_ACCESS
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYMBOLIC_LINK_QUERY)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationThread(HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG);
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsyncNTSYSAPI NTSTATUS NTAPI NtResumeThread(HANDLE, PULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtSuspendThread(HANDLE, PULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtTerminateThread(HANDLE, LONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtGetContextThread(HANDLE, PCONTEXT);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtSetContextThread(HANDLE, PCONTEXT);
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef SEC_FILE
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SEC_FILE UINT32_C(0x00800000)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef SEC_IMAGE
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SEC_IMAGE UINT32_C(0x01000000)
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef SEC_PROTECTED_IMAGE
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define SEC_PROTECTED_IMAGE UINT32_C(0x02000000)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef SEC_NOCACHE
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync# define SEC_NOCACHE UINT32_C(0x10000000)
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifndef MEM_ROTATE
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define MEM_ROTATE UINT32_C(0x00800000)
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsynctypedef enum _MEMORY_INFORMATION_CLASS
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync{
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync MemoryBasicInformation = 0,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync MemoryWorkingSetList,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync MemorySectionName,
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync MemoryBasicVlmInformation
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} MEMORY_INFORMATION_CLASS;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#ifdef IN_RING0
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsynctypedef struct _MEMORY_BASIC_INFORMATION
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync{
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync PVOID BaseAddress;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync PVOID AllocationBase;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ULONG AllocationProtect;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync SIZE_T RegionSize;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ULONG State;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync ULONG Protect;
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync ULONG Type;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync} MEMORY_BASIC_INFORMATION;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsynctypedef MEMORY_BASIC_INFORMATION *PMEMORY_BASIC_INFORMATION;
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync# define NtQueryVirtualMemory ZwQueryVirtualMemory
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryVirtualMemory(HANDLE, void const *, MEMORY_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync#ifdef IPRT_NT_USE_WINTERNL
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsyncNTSYSAPI NTSTATUS NTAPI NtAllocateVirtualMemory(HANDLE, PVOID *, ULONG, PSIZE_T, ULONG, ULONG);
cebc93936b5bb4d867e1c086dd1b206db33c31dcvboxsync#endif
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncNTSYSAPI NTSTATUS NTAPI NtFreeVirtualMemory(HANDLE, PVOID *, PSIZE_T, ULONG);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncNTSYSAPI NTSTATUS NTAPI NtProtectVirtualMemory(HANDLE, PVOID *, PSIZE_T, ULONG, PULONG);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef enum _SYSTEM_INFORMATION_CLASS
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SystemBasicInformation = 0,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SystemCpuInformation,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SystemPerformanceInformation,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SystemTimeOfDayInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_4,
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsync SystemProcessInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_6,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_7,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemProcessorPerformanceInformation,
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync SystemInformation_Unknown_9,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_10,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SystemModuleInformation,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_12,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_13,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_14,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_15,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemHandleInformation,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SystemInformation_Unknown_17,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemPageFileInformation,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync SystemInformation_Unknown_19,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_20,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SystemCacheInformation,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_22,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync SystemInterruptInformation,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemDpcBehaviourInformation,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemFullMemoryInformation,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemLoadGdiDriverInformation, /* 26 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SystemUnloadGdiDriverInformation, /* 27 */
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemTimeAdjustmentInformation,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync SystemSummaryMemoryInformation,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_30,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_31,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_32,
a85c47589af3385deccdbb1367b75108806d7cf5vboxsync SystemExceptionInformation,
a85c47589af3385deccdbb1367b75108806d7cf5vboxsync SystemCrashDumpStateInformation,
a85c47589af3385deccdbb1367b75108806d7cf5vboxsync SystemKernelDebuggerInformation,
a85c47589af3385deccdbb1367b75108806d7cf5vboxsync SystemContextSwitchInformation,
a85c47589af3385deccdbb1367b75108806d7cf5vboxsync SystemRegistryQuotaInformation,
a85c47589af3385deccdbb1367b75108806d7cf5vboxsync SystemInformation_Unknown_38,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_39,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_40,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_41,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_42,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_43,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemCurrentTimeZoneInformation,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemLookasideInformation,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemSetTimeSlipEvent,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemCreateSession,
7a7a4fb86f66f7ab919948a2ad6aae0483061e18vboxsync SystemDeleteSession,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_49,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemRangeStartInformation,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemVerifierInformation,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_52,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemSessionProcessInformation,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemLoadGdiDriverInSystemSpaceInformation, /* 54 */
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_55,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_56,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemExtendedProcessInformation,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_58,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_59,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_60,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_61,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_62,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SystemInformation_Unknown_63,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemExtendedHandleInformation, /* 64 */
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync SystemInformation_Unknown_65,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_66,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SystemInformation_Unknown_67,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_68,
1cd59fdf671ca60c64d77e3f7046aaecf7003824vboxsync SystemInformation_HotPatchInfo, /* 69 */
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_70,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_71,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_72,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_73,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_74,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_75,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_76,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_77,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_78,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_79,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_80,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_81,
7a7a4fb86f66f7ab919948a2ad6aae0483061e18vboxsync SystemInformation_Unknown_82,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_83,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_84,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_85,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_86,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_87,
bdb01608062958ff140a733533f3d6574886c831vboxsync SystemInformation_Unknown_88,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_89,
45e0b20bd50b7124efbbe1cdb1c65d67eb41498avboxsync SystemInformation_Unknown_90,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_91,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_92,
19cb1f8699e352d590c4946caee33863a5157241vboxsync SystemInformation_Unknown_93,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync SystemInformation_Unknown_94,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SystemInformation_Unknown_95,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SystemInformation_KiOpPrefetchPatchCount,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync /** @todo fill gap. they've added a whole bunch of things */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync SystemPolicyInformation = 134,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SystemInformationClassMax
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} SYSTEM_INFORMATION_CLASS;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifdef IPRT_NT_USE_WINTERNL
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsynctypedef struct _VM_COUNTERS
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SIZE_T PeakVirtualSize;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync SIZE_T VirtualSize;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG PageFaultCount;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SIZE_T PeakWorkingSetSize;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync SIZE_T WorkingSetSize;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T QuotaPeakPagedPoolUsage;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync SIZE_T QuotaPagedPoolUsage;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync SIZE_T QuotaPeakNonPagedPoolUsage;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T QuotaNonPagedPoolUsage;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T PagefileUsage;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync SIZE_T PeakPagefileUsage;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} VM_COUNTERS;
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsynctypedef VM_COUNTERS *PVM_COUNTERS;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#endif
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#if 0
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsynctypedef struct _IO_COUNTERS
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONGLONG ReadOperationCount;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONGLONG WriteOperationCount;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONGLONG OtherOperationCount;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ULONGLONG ReadTransferCount;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ULONGLONG WriteTransferCount;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONGLONG OtherTransferCount;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync} IO_COUNTERS;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef IO_COUNTERS *PIO_COUNTERS;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef struct _RTNT_SYSTEM_PROCESS_INFORMATION
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG NextEntryOffset; /**< 0x00 / 0x00 */
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsync ULONG NumberOfThreads; /**< 0x04 / 0x04 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync LARGE_INTEGER Reserved1[3]; /**< 0x08 / 0x08 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER CreationTime; /**< 0x20 / 0x20 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync LARGE_INTEGER UserTime; /**< 0x28 / 0x28 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync LARGE_INTEGER KernelTime; /**< 0x30 / 0x30 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync UNICODE_STRING ProcessName; /**< 0x38 / 0x38 Clean unicode encoding? */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync int32_t BasePriority; /**< 0x40 / 0x48 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync HANDLE UniqueProcessId; /**< 0x44 / 0x50 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync HANDLE ParentProcessId; /**< 0x48 / 0x58 */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG HandleCount; /**< 0x4c / 0x60 */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync ULONG Reserved2; /**< 0x50 / 0x64 Session ID? */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG_PTR Reserved3; /**< 0x54 / 0x68 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync VM_COUNTERS VmCounters; /**< 0x58 / 0x70 */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync IO_COUNTERS IoCounters; /**< 0x88 / 0xd0 Might not be present in earlier windows versions. */
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync /* After this follows the threads, then the ProcessName.Buffer. */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync} RTNT_SYSTEM_PROCESS_INFORMATION;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef RTNT_SYSTEM_PROCESS_INFORMATION *PRTNT_SYSTEM_PROCESS_INFORMATION;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync#ifndef IPRT_NT_USE_WINTERNL
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef RTNT_SYSTEM_PROCESS_INFORMATION SYSTEM_PROCESS_INFORMATION;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef SYSTEM_PROCESS_INFORMATION *PSYSTEM_PROCESS_INFORMATION;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync#endif
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef struct _SYSTEM_HANDLE_ENTRY_INFO
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync USHORT UniqueProcessId;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync USHORT CreatorBackTraceIndex;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync UCHAR ObjectTypeIndex;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync UCHAR HandleAttributes;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync USHORT HandleValue;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID Object;
2823fbb1428e982169f04923472d7c94e7ed8385vboxsync ULONG GrantedAccess;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync} SYSTEM_HANDLE_ENTRY_INFO;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef SYSTEM_HANDLE_ENTRY_INFO *PSYSTEM_HANDLE_ENTRY_INFO;
1dc37bff2fb26897f5892d8330fe2bc0c9859aecvboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** Returned by SystemHandleInformation */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef struct _SYSTEM_HANDLE_INFORMATION
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync ULONG NumberOfHandles;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync SYSTEM_HANDLE_ENTRY_INFO Handles[1];
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync} SYSTEM_HANDLE_INFORMATION;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef SYSTEM_HANDLE_INFORMATION *PSYSTEM_HANDLE_INFORMATION;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync/** Extended handle information entry.
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync * @remarks 3 x PVOID + 4 x ULONG = 28 bytes on 32-bit / 40 bytes on 64-bit */
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef struct _SYSTEM_HANDLE_ENTRY_INFO_EX
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync{
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync PVOID Object;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync HANDLE UniqueProcessId;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync HANDLE HandleValue;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ACCESS_MASK GrantedAccess;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync USHORT CreatorBackTraceIndex;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync USHORT ObjectTypeIndex;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ULONG HandleAttributes;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ULONG Reserved;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync} SYSTEM_HANDLE_ENTRY_INFO_EX;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef SYSTEM_HANDLE_ENTRY_INFO_EX *PSYSTEM_HANDLE_ENTRY_INFO_EX;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync/** Returned by SystemExtendedHandleInformation. */
8b36957d815c23b479eb35d93ac76c66392e9402vboxsynctypedef struct _SYSTEM_HANDLE_INFORMATION_EX
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync{
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ULONG_PTR NumberOfHandles;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ULONG_PTR Reserved;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync SYSTEM_HANDLE_ENTRY_INFO_EX Handles[1];
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync} SYSTEM_HANDLE_INFORMATION_EX;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef SYSTEM_HANDLE_INFORMATION_EX *PSYSTEM_HANDLE_INFORMATION_EX;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync/** Input to SystemSessionProcessInformation. */
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync{
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ULONG SessionId;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync ULONG BufferLength;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync /** Return buffer, SYSTEM_PROCESS_INFORMATION entries. */
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync PVOID Buffer;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync} SYSTEM_SESSION_PROCESS_INFORMATION;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef SYSTEM_SESSION_PROCESS_INFORMATION *PSYSTEM_SESSION_PROCESS_INFORMATION;
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsyncNTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsyncNTSYSAPI NTSTATUS NTAPI NtDelayExecution(BOOLEAN, PLARGE_INTEGER);
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsyncNTSYSAPI NTSTATUS NTAPI NtYieldExecution(void);
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync#ifndef IPRT_NT_USE_WINTERNL
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsyncNTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(HANDLE, BOOLEAN PLARGE_INTEGER);
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsync#endif
67ee25dd0b63a61dc35a35d0aade75ca6cd06350vboxsynctypedef NTSYSAPI NTSTATUS (NTAPI *PFNNTWAITFORSINGLEOBJECT)(HANDLE, BOOLEAN, PLARGE_INTEGER);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsynctypedef enum _OBJECT_WAIT_TYPE { WaitAllObjects = 0, WaitAnyObject = 1, ObjectWaitTypeHack = 0x7fffffff } OBJECT_WAIT_TYPE;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncNTSYSAPI NTSTATUS NTAPI NtWaitForMultipleObjects(ULONG, PHANDLE, OBJECT_WAIT_TYPE, BOOLEAN, PLARGE_INTEGER);
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI NtQuerySecurityObject(HANDLE, ULONG, PSECURITY_DESCRIPTOR, ULONG, PULONG);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#ifdef IPRT_NT_USE_WINTERNL
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsynctypedef enum _EVENT_TYPE
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync /* Manual reset event. */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync NotificationEvent = 0,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync /* Automaitc reset event. */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SynchronizationEvent
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync} EVENT_TYPE;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#endif
8b36957d815c23b479eb35d93ac76c66392e9402vboxsyncNTSYSAPI NTSTATUS NTAPI NtCreateEvent(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, EVENT_TYPE, BOOLEAN);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenEvent(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsynctypedef NTSYSAPI NTSTATUS (NTAPI *PFNNTCLEAREVENT)(HANDLE);
7ffa227f187f4ff5561da9916c2b7bc949723018vboxsyncNTSYSAPI NTSTATUS NTAPI NtClearEvent(HANDLE);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI NtResetEvent(HANDLE, PULONG);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI NtSetEvent(HANDLE, PULONG);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef NTSYSAPI NTSTATUS (NTAPI *PFNNTSETEVENT)(HANDLE, PULONG);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef enum _EVENT_INFORMATION_CLASS
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync EventBasicInformation = 0
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync} EVENT_INFORMATION_CLASS;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** Data returned by NtQueryEvent + EventBasicInformation. */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsynctypedef struct EVENT_BASIC_INFORMATION
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync EVENT_TYPE EventType;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG EventState;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync} EVENT_BASIC_INFORMATION;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef EVENT_BASIC_INFORMATION *PEVENT_BASIC_INFORMATION;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryEvent(HANDLE, EVENT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#ifdef IPRT_NT_USE_WINTERNL
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync/** For NtQueryValueKey. */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef enum _KEY_VALUE_INFORMATION_CLASS
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync{
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync KeyValueBasicInformation = 0,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync KeyValueFullInformation,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync KeyValuePartialInformation,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync KeyValueFullInformationAlign64,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync KeyValuePartialInformationAlign64
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} KEY_VALUE_INFORMATION_CLASS;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync/** KeyValuePartialInformation and KeyValuePartialInformationAlign64 struct. */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef struct _KEY_VALUE_PARTIAL_INFORMATION
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync{
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG TitleIndex;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG Type;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG DataLength;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync UCHAR Data[1];
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync} KEY_VALUE_PARTIAL_INFORMATION;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef KEY_VALUE_PARTIAL_INFORMATION *PKEY_VALUE_PARTIAL_INFORMATION;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#endif
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenKey(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryValueKey(HANDLE, PUNICODE_STRING, KEY_VALUE_INFORMATION_CLASS, PVOID, ULONG, PULONG);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI RtlAddAccessDeniedAce(PACL, ULONG, ULONG, PSID);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef struct _CURDIR
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync UNICODE_STRING DosPath;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HANDLE Handle;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync} CURDIR;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef CURDIR *PCURDIR;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef struct _RTL_DRIVE_LETTER_CURDIR
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync{
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync USHORT Flags;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync USHORT Length;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG TimeStamp;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync STRING DosPath; /**< Yeah, it's STRING according to dt ntdll!_RTL_DRIVE_LETTER_CURDIR. */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync} RTL_DRIVE_LETTER_CURDIR;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef RTL_DRIVE_LETTER_CURDIR *PRTL_DRIVE_LETTER_CURDIR;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef struct _RTL_USER_PROCESS_PARAMETERS
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync{
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG MaximumLength;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync ULONG Length;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync ULONG Flags;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync ULONG DebugFlags;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync HANDLE ConsoleHandle;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync ULONG ConsoleFlags;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HANDLE StandardInput;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync HANDLE StandardOutput;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync HANDLE StandardError;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync CURDIR CurrentDirectory;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync UNICODE_STRING DllPath;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync UNICODE_STRING ImagePathName;
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync UNICODE_STRING CommandLine;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PWSTR Environment;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG StartingX;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG StartingY;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG CountX;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG CountY;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG CountCharsX;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG CountCharsY;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG FillAttribute;
9055ac3d8c552334b0ef35f0f10783e6d49b41d4vboxsync ULONG WindowFlags;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG ShowWindowFlags;
ccf574508b96ea0f7dc62b4048f6156c1df160cdvboxsync UNICODE_STRING WindowTitle;
ccf574508b96ea0f7dc62b4048f6156c1df160cdvboxsync UNICODE_STRING DesktopInfo;
ccf574508b96ea0f7dc62b4048f6156c1df160cdvboxsync UNICODE_STRING ShellInfo;
ccf574508b96ea0f7dc62b4048f6156c1df160cdvboxsync UNICODE_STRING RuntimeInfo;
ccf574508b96ea0f7dc62b4048f6156c1df160cdvboxsync RTL_DRIVE_LETTER_CURDIR CurrentDirectories[0x20];
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync SIZE_T EnvironmentSize; /**< Added in Vista */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync SIZE_T EnvironmentVersion; /**< Added in Windows 7. */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync PVOID PackageDependencyData; /**< Added Windows 8? */
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync ULONG ProcessGroupId; /**< Added Windows 8? */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync} RTL_USER_PROCESS_PARAMETERS;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef RTL_USER_PROCESS_PARAMETERS *PRTL_USER_PROCESS_PARAMETERS;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync#define RTL_USER_PROCESS_PARAMS_FLAG_NORMALIZED 1
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsynctypedef struct _RTL_USER_PROCESS_INFORMATION
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync{
6fe1329154975472e055284198df7fa8e64dee3avboxsync ULONG Size;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HANDLE ProcessHandle;
6fe1329154975472e055284198df7fa8e64dee3avboxsync HANDLE ThreadHandle;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync CLIENT_ID ClientId;
6fe1329154975472e055284198df7fa8e64dee3avboxsync SECTION_IMAGE_INFORMATION ImageInformation;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync} RTL_USER_PROCESS_INFORMATION;
6fe1329154975472e055284198df7fa8e64dee3avboxsynctypedef RTL_USER_PROCESS_INFORMATION *PRTL_USER_PROCESS_INFORMATION;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
6fe1329154975472e055284198df7fa8e64dee3avboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateUserProcess(PUNICODE_STRING, ULONG, PRTL_USER_PROCESS_PARAMETERS, PSECURITY_DESCRIPTOR,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync PSECURITY_DESCRIPTOR, HANDLE, BOOLEAN, HANDLE, HANDLE, PRTL_USER_PROCESS_INFORMATION);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *, PUNICODE_STRING ImagePathName,
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync PUNICODE_STRING DllPath, PUNICODE_STRING CurrentDirectory,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync PUNICODE_STRING CommandLine, PUNICODE_STRING Environment,
6fe1329154975472e055284198df7fa8e64dee3avboxsync PUNICODE_STRING WindowTitle, PUNICODE_STRING DesktopInfo,
6fe1329154975472e055284198df7fa8e64dee3avboxsync PUNICODE_STRING ShellInfo, PUNICODE_STRING RuntimeInfo);
6fe1329154975472e055284198df7fa8e64dee3avboxsyncNTSYSAPI VOID NTAPI RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS);
6fe1329154975472e055284198df7fa8e64dee3avboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateUserThread(HANDLE, PSECURITY_DESCRIPTOR, BOOLEAN, ULONG, SIZE_T, SIZE_T,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PFNRT, PVOID, PHANDLE, PCLIENT_ID);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#ifndef RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsynctypedef struct _RTL_CRITICAL_SECTION
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync struct _RTL_CRITICAL_SECTION_DEBUG *DebugInfo;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync LONG LockCount;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync LONG Recursioncount;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync HANDLE OwningThread;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync HANDLE LockSemaphore;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync ULONG_PTR SpinCount;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync} RTL_CRITICAL_SECTION;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsynctypedef RTL_CRITICAL_SECTION *PRTL_CRITICAL_SECTION;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#endif
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncRT_C_DECLS_END
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/** @} */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#if defined(IN_RING0) || defined(DOXYGEN_RUNNING)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/** @name NT Kernel APIs
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @{ */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncRT_C_DECLS_BEGIN
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsynctypedef ULONG KEPROCESSORINDEX; /**< Bitmap indexes != process numbers, apparently. */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
9ca017ceee656f9d33f2cb6652e401b5f17fcfb7vboxsyncNTSYSAPI VOID NTAPI KeInitializeAffinityEx(PKAFFINITY_EX pAffinity);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef VOID (NTAPI *PFNKEINITIALIZEAFFINITYEX)(PKAFFINITY_EX pAffinity);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI VOID NTAPI KeAddProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef VOID (NTAPI *PFNKEADDPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI VOID NTAPI KeRemoveProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef VOID (NTAPI *PFNKEREMOVEPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI BOOLEAN NTAPI KeInterlockedSetProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef BOOLEAN (NTAPI *PFNKEINTERLOCKEDSETPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsyncNTSYSAPI BOOLEAN NTAPI KeInterlockedClearProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef BOOLEAN (NTAPI *PFNKEINTERLOCKEDCLEARPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI BOOLEAN NTAPI KeCheckProcessorAffinityEx(PCKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
9ca017ceee656f9d33f2cb6652e401b5f17fcfb7vboxsynctypedef BOOLEAN (NTAPI *PFNKECHECKPROCESSORAFFINITYEX)(PCKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI VOID NTAPI KeCopyAffinityEx(PKAFFINITY_EX pDst, PCKAFFINITY_EX pSrc);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef VOID (NTAPI *PFNKECOPYAFFINITYEX)(PKAFFINITY_EX pDst, PCKAFFINITY_EX pSrc);
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsyncNTSYSAPI VOID NTAPI KeComplementAffinityEx(PKAFFINITY_EX pResult, PCKAFFINITY_EX pIn);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef VOID (NTAPI *PFNKECOMPLEMENTAFFINITYEX)(PKAFFINITY_EX pResult, PCKAFFINITY_EX pIn);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI BOOLEAN NTAPI KeAndAffinityEx(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsynctypedef BOOLEAN (NTAPI *PFNKEANDAFFINITYEX)(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
fc60d7c6501c5e676e41b11c042d4358d9faa81dvboxsyncNTSYSAPI BOOLEAN NTAPI KeOrAffinityEx(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
cc74f15083bf80fbc96723a89faa06c15d0dead8vboxsynctypedef BOOLEAN (NTAPI *PFNKEORAFFINITYEX)(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** Works like anding the complemented subtrahend with the minuend. */
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI BOOLEAN NTAPI KeSubtractAffinityEx(PCKAFFINITY_EX pMinuend, PCKAFFINITY_EX pSubtrahend, PKAFFINITY_EX pResult OPTIONAL);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef BOOLEAN (NTAPI *PFNKESUBTRACTAFFINITYEX)(PCKAFFINITY_EX pMinuend, PCKAFFINITY_EX pSubtrahend, PKAFFINITY_EX pResult OPTIONAL);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI BOOLEAN NTAPI KeIsEqualAffinityEx(PCKAFFINITY_EX pLeft, PCKAFFINITY_EX pRight);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef BOOLEAN (NTAPI *PFNKEISEQUALAFFINITYEX)(PCKAFFINITY_EX pLeft, PCKAFFINITY_EX pRight);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI BOOLEAN NTAPI KeIsEmptyAffinityEx(PCKAFFINITY_EX pAffinity);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef BOOLEAN (NTAPI *PFNKEISEMPTYAFFINITYEX)(PCKAFFINITY_EX pAffinity);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI BOOLEAN NTAPI KeIsSubsetAffinityEx(PCKAFFINITY_EX pSubset, PCKAFFINITY_EX pSuperSet);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef BOOLEAN (NTAPI *PFNKEISSUBSETAFFINITYEX)(PCKAFFINITY_EX pSubset, PCKAFFINITY_EX pSuperSet);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI ULONG NTAPI KeCountSetBitsAffinityEx(PCKAFFINITY_EX pAffinity);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef ULONG (NTAPI *PFNKECOUNTSETAFFINITYEX)(PCKAFFINITY_EX pAffinity);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI KEPROCESSORINDEX NTAPI KeFindFirstSetLeftAffinityEx(PCKAFFINITY_EX pAffinity);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef KEPROCESSORINDEX (NTAPI *PFNKEFINDFIRSTSETLEFTAFFINITYEX)(PCKAFFINITY_EX pAffinity);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef NTSTATUS (NTAPI *PFNKEGETPROCESSORNUMBERFROMINDEX)(KEPROCESSORINDEX idxProcessor, PPROCESSOR_NUMBER pProcNumber);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef KEPROCESSORINDEX (NTAPI *PFNKEGETPROCESSORINDEXFROMNUMBER)(const PROCESSOR_NUMBER *pProcNumber);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI BOOLEAN NTAPI ObFindHandleForObject(PEPROCESS pProcess, PVOID pvObject, POBJECT_TYPE pObjectType,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync PVOID pvOptionalConditions, PHANDLE phFound);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI NTSTATUS NTAPI ObReferenceObjectByName(PUNICODE_STRING pObjectPath, ULONG fAttributes, PACCESS_STATE pAccessState,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync ACCESS_MASK fDesiredAccess, POBJECT_TYPE pObjectType,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync KPROCESSOR_MODE enmAccessMode, PVOID pvParseContext, PVOID *ppvObject);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI HANDLE NTAPI PsGetProcessInheritedFromUniqueProcessId(PEPROCESS);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI UCHAR * NTAPI PsGetProcessImageFileName(PEPROCESS);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI BOOLEAN NTAPI PsIsProcessBeingDebugged(PEPROCESS);
cc74f15083bf80fbc96723a89faa06c15d0dead8vboxsyncNTSYSAPI ULONG NTAPI PsGetProcessSessionId(PEPROCESS);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncextern DECLIMPORT(POBJECT_TYPE *) LpcPortObjectType; /**< In vista+ this is the ALPC port object type. */
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncextern DECLIMPORT(POBJECT_TYPE *) LpcWaitablePortObjectType; /**< In vista+ this is the ALPC port object type. */
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef VOID (NTAPI *PFNHALREQUESTIPI_PRE_W7)(KAFFINITY TargetSet);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef VOID (NTAPI *PFNHALREQUESTIPI_W7PLUS)(ULONG uUsuallyZero, PCKAFFINITY_EX pTargetSet);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncRT_C_DECLS_END
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** @ */
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#endif /* IN_RING0 */
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#if defined(IN_RING3) || defined(DOXYGEN_RUNNING)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** @name NT Userland APIs
3933885bc0c2c93436d858a14564c6179ec72872vboxsync * @{ */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncRT_C_DECLS_BEGIN
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#if 0 /** @todo figure this out some time... */
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsynctypedef struct CSR_MSG_DATA_CREATED_PROCESS
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync{
3933885bc0c2c93436d858a14564c6179ec72872vboxsync HANDLE hProcess;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync HANDLE hThread;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync CLIENT_ID
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync DWORD idProcess;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync DWORD idThread;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync DWORD fCreate;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsync} CSR_MSG_DATA_CREATED_PROCESS;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define CSR_MSG_NO_CREATED_PROCESS UINT32_C(0x10000)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define CSR_MSG_NO_CREATED_THREAD UINT32_C(0x10001)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncNTSYSAPI NTSTATUS NTAPI CsrClientCallServer(PVOID, PVOID, ULONG, SIZE_T);
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync#endif
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsyncNTSYSAPI VOID NTAPI LdrInitializeThunk(PVOID, PVOID, PVOID);
a72b5355eb89aafe6bfcc8912cf02645d7cccceavboxsync
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
3933885bc0c2c93436d858a14564c6179ec72872vboxsync{
3933885bc0c2c93436d858a14564c6179ec72872vboxsync ULONG Flags;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PCUNICODE_STRING FullDllName;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync PCUNICODE_STRING BaseDllName;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync PVOID DllBase;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync ULONG SizeOfImage;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} LDR_DLL_LOADED_NOTIFICATION_DATA, LDR_DLL_UNLOADED_NOTIFICATION_DATA;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsynctypedef LDR_DLL_LOADED_NOTIFICATION_DATA *PLDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_UNLOADED_NOTIFICATION_DATA;
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef LDR_DLL_LOADED_NOTIFICATION_DATA const *PCLDR_DLL_LOADED_NOTIFICATION_DATA, *PCLDR_DLL_UNLOADED_NOTIFICATION_DATA;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef union _LDR_DLL_NOTIFICATION_DATA
3933885bc0c2c93436d858a14564c6179ec72872vboxsync{
3933885bc0c2c93436d858a14564c6179ec72872vboxsync LDR_DLL_LOADED_NOTIFICATION_DATA Loaded;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync} LDR_DLL_NOTIFICATION_DATA;
8b36957d815c23b479eb35d93ac76c66392e9402vboxsynctypedef LDR_DLL_NOTIFICATION_DATA *PLDR_DLL_NOTIFICATION_DATA;
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef LDR_DLL_NOTIFICATION_DATA const *PCLDR_DLL_NOTIFICATION_DATA;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef VOID (NTAPI *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG ulReason, PCLDR_DLL_NOTIFICATION_DATA pData, PVOID pvUser);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync#define LDR_DLL_NOTIFICATION_REASON_LOADED UINT32_C(1)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDR_DLL_NOTIFICATION_REASON_UNLOADED UINT32_C(2)
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI LdrRegisterDllNotification(ULONG fFlags, PLDR_DLL_NOTIFICATION_FUNCTION pfnCallback, PVOID pvUser,
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync PVOID *pvCookie);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef NTSTATUS (NTAPI *PFNLDRREGISTERDLLNOTIFICATION)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, PVOID, PVOID *);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI NTSTATUS NTAPI LdrUnregisterDllNotification(PVOID pvCookie);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef NTSTATUS (NTAPI *PFNLDRUNREGISTERDLLNOTIFICATION)(PVOID);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI NTSTATUS NTAPI LdrLoadDll(IN PWSTR pwszSearchPathOrFlags OPTIONAL, IN PULONG pfFlags OPTIONAL,
b8908d384db2324f04a2f68a13e67ea32ebf609avboxsync IN PCUNICODE_STRING pName, OUT PHANDLE phMod);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsynctypedef NTSTATUS (NTAPI *PFNLDRLOADDLL)(IN PWSTR pwszSearchPathOrFlags OPTIONAL, IN PULONG pfFlags OPTIONAL,
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync IN PCUNICODE_STRING pName, OUT PHANDLE phMod);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI LdrUnloadDll(IN HANDLE hMod);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef NTSTATUS (NTAPI *PFNLDRUNLOADDLL)(IN HANDLE hMod);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI LdrGetDllHandle(IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsynctypedef NTSTATUS (NTAPI *PFNLDRGETDLLHANDLE)(IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync#define LDRGETDLLHANDLEEX_F_UNCHANGED_REFCOUNT RT_BIT_32(0)
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync#define LDRGETDLLHANDLEEX_F_PIN RT_BIT_32(1)
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync/** @since Windows XP. */
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsyncNTSYSAPI NTSTATUS NTAPI LdrGetDllHandleEx(IN ULONG fFlags, IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync/** @since Windows XP. */
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsynctypedef NTSTATUS (NTAPI *PFNLDRGETDLLHANDLEEX)(IN ULONG fFlags, IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync/** @since Windows 7. */
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsyncNTSYSAPI NTSTATUS NTAPI LdrGetDllHandleByMapping(IN PVOID pvBase, OUT PHANDLE phDll);
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync/** @since Windows 7. */
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsynctypedef NTSTATUS (NTAPI *PFNLDRGETDLLHANDLEBYMAPPING)(IN PVOID pvBase, OUT PHANDLE phDll);
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync/** @since Windows 7. */
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsyncNTSYSAPI NTSTATUS NTAPI LdrGetDllHandleByName(IN PCUNICODE_STRING pName OPTIONAL, IN PCUNICODE_STRING pFullName OPTIONAL,
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync OUT PHANDLE phDll);
6e25221ce8ef8e656d1e15eb7ec5cf8ae758ceb2vboxsync/** @since Windows 7. */
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsynctypedef NTSTATUS (NTAPI *PFNLDRGETDLLHANDLEBYNAME)(IN PCUNICODE_STRING pName OPTIONAL, IN PCUNICODE_STRING pFullName OPTIONAL,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync OUT PHANDLE phDll);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDRADDREFDLL_F_PIN RT_BIT_32(0)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI LdrAddRefDll(IN ULONG fFlags, IN HANDLE hDll);
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef NTSTATUS (NTAPI *PFNLDRADDREFDLL)(IN ULONG fFlags, IN HANDLE hDll);
3933885bc0c2c93436d858a14564c6179ec72872vboxsyncNTSYSAPI NTSTATUS NTAPI LdrGetProcedureAddress(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync IN ULONG uOrdinal OPTIONAL, OUT PVOID *ppvSymbol);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsynctypedef NTSTATUS (NTAPI *PFNLDRGETPROCEDUREADDRESS)(IN HANDLE hDll, IN PCANSI_STRING pSymbol OPTIONAL,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync IN ULONG uOrdinal OPTIONAL, OUT PVOID *ppvSymbol);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define LDRGETPROCEDUREADDRESSEX_F_DONT_RECORD_FORWARDER RT_BIT_32(0)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** @since Windows Vista. */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI LdrGetProcedureAddressEx(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync IN ULONG uOrdinal OPTIONAL, OUT PVOID *ppvSymbol, ULONG fFlags);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** @since Windows Vista. */
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef NTSTATUS (NTAPI *PFNLDRGETPROCEDUREADDRESSEX)(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync IN ULONG uOrdinal OPTIONAL, OUT PVOID *ppvSymbol, ULONG fFlags);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDRLOCKLOADERLOCK_F_RAISE_ERRORS RT_BIT_32(0)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDRLOCKLOADERLOCK_F_NO_WAIT RT_BIT_32(1)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDRLOCKLOADERLOCK_DISP_INVALID UINT32_C(0)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync#define LDRLOCKLOADERLOCK_DISP_ACQUIRED UINT32_C(1)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDRLOCKLOADERLOCK_DISP_NOT_ACQUIRED UINT32_C(2)
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync/** @since Windows XP. */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncNTSYSAPI NTSTATUS NTAPI LdrLockLoaderLock(IN ULONG fFlags, OUT PULONG puDisposition OPTIONAL, OUT PVOID *ppvCookie);
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** @since Windows XP. */
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsynctypedef NTSTATUS (NTAPI *PFNLDRLOCKLOADERLOCK)(IN ULONG fFlags, OUT PULONG puDisposition OPTIONAL, OUT PVOID *ppvCookie);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync#define LDRUNLOCKLOADERLOCK_F_RAISE_ERRORS RT_BIT_32(0)
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** @since Windows XP. */
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsyncNTSYSAPI NTSTATUS NTAPI LdrUnlockLoaderLock(IN ULONG fFlags, OUT PVOID pvCookie);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync/** @since Windows XP. */
3933885bc0c2c93436d858a14564c6179ec72872vboxsynctypedef NTSTATUS (NTAPI *PFNLDRUNLOCKLOADERLOCK)(IN ULONG fFlags, OUT PVOID pvCookie);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsyncNTSYSAPI NTSTATUS NTAPI RtlExpandEnvironmentStrings_U(PVOID, PUNICODE_STRING, PUNICODE_STRING, PULONG);
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsyncNTSYSAPI VOID NTAPI RtlExitUserProcess(NTSTATUS rcExitCode); /**< Vista and later. */
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsyncNTSYSAPI VOID NTAPI RtlExitUserThread(NTSTATUS rcExitCode);
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsyncNTSYSAPI NTSTATUS NTAPI RtlDosApplyFileIsolationRedirection_Ustr(IN ULONG fFlags,
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync IN PCUNICODE_STRING pOrgName,
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync IN PUNICODE_STRING pDefaultSuffix,
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync IN OUT PUNICODE_STRING pStaticString,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync IN OUT PUNICODE_STRING pDynamicString,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync IN OUT PUNICODE_STRING *ppResultString,
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync IN PULONG pfNewFlags OPTIONAL,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync IN PSIZE_T pcbFilename OPTIONAL,
3933885bc0c2c93436d858a14564c6179ec72872vboxsync IN PSIZE_T pcbNeeded OPTIONAL);
3933885bc0c2c93436d858a14564c6179ec72872vboxsync
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync# ifdef IPRT_NT_USE_WINTERNL
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsynctypedef NTSTATUS NTAPI RTL_HEAP_COMMIT_ROUTINE(PVOID, PVOID *, PSIZE_T);
060f7ec6ae5c99df18341ef2e1f3e91f4b0c89f1vboxsynctypedef RTL_HEAP_COMMIT_ROUTINE *PRTL_HEAP_COMMIT_ROUTINE;
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsynctypedef struct _RTL_HEAP_PARAMETERS
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync{
b8462d2d5e78448e277a4214655ce1cd6c7e9249vboxsync ULONG Length;
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync SIZE_T SegmentReserve;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync SIZE_T SegmentCommit;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync SIZE_T DeCommitFreeBlockThreshold;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync SIZE_T DeCommitTotalFreeThreshold;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync SIZE_T MaximumAllocationSize;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync SIZE_T VirtualMemoryThreshold;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync SIZE_T InitialCommit;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T InitialReserve;
3933885bc0c2c93436d858a14564c6179ec72872vboxsync PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync SIZE_T Reserved[2];
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync} RTL_HEAP_PARAMETERS;
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsynctypedef RTL_HEAP_PARAMETERS *PRTL_HEAP_PARAMETERS;
9601ea695ea96905d6f5d484facd272732365c40vboxsyncNTSYSAPI PVOID NTAPI RtlCreateHeap(ULONG fFlags, PVOID pvHeapBase, SIZE_T cbReserve, SIZE_T cbCommit, PVOID pvLock,
9601ea695ea96905d6f5d484facd272732365c40vboxsync PRTL_HEAP_PARAMETERS pParameters);
9601ea695ea96905d6f5d484facd272732365c40vboxsync/** @name Heap flags (for RtlCreateHeap).
9601ea695ea96905d6f5d484facd272732365c40vboxsync * @{ */
9601ea695ea96905d6f5d484facd272732365c40vboxsync/*# define HEAP_NO_SERIALIZE UINT32_C(0x00000001)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_GROWABLE UINT32_C(0x00000002)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_GENERATE_EXCEPTIONS UINT32_C(0x00000004)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_ZERO_MEMORY UINT32_C(0x00000008)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_REALLOC_IN_PLACE_ONLY UINT32_C(0x00000010)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_TAIL_CHECKING_ENABLED UINT32_C(0x00000020)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_FREE_CHECKING_ENABLED UINT32_C(0x00000040)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_DISABLE_COALESCE_ON_FREE UINT32_C(0x00000080)*/
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_SETTABLE_USER_VALUE UINT32_C(0x00000100)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_SETTABLE_USER_FLAG1 UINT32_C(0x00000200)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_SETTABLE_USER_FLAG2 UINT32_C(0x00000400)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_SETTABLE_USER_FLAG3 UINT32_C(0x00000800)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_SETTABLE_USER_FLAGS UINT32_C(0x00000e00)
9601ea695ea96905d6f5d484facd272732365c40vboxsync# define HEAP_CLASS_0 UINT32_C(0x00000000)
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define HEAP_CLASS_1 UINT32_C(0x00001000)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define HEAP_CLASS_2 UINT32_C(0x00002000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_3 UINT32_C(0x00003000)
7a7a4fb86f66f7ab919948a2ad6aae0483061e18vboxsync# define HEAP_CLASS_4 UINT32_C(0x00004000)
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync# define HEAP_CLASS_5 UINT32_C(0x00005000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_6 UINT32_C(0x00006000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_7 UINT32_C(0x00007000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_8 UINT32_C(0x00008000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_MASK UINT32_C(0x0000f000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# endif
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_PROCESS HEAP_CLASS_0
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_PRIVATE HEAP_CLASS_1
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_KERNEL HEAP_CLASS_2
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_GDI HEAP_CLASS_3
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CLASS_USER HEAP_CLASS_4
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# define HEAP_CLASS_CONSOLE HEAP_CLASS_5
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define HEAP_CLASS_USER_DESKTOP HEAP_CLASS_6
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# define HEAP_CLASS_CSRSS_SHARED HEAP_CLASS_7
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync# define HEAP_CLASS_CSRSS_PORT HEAP_CLASS_8
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync# ifdef IPRT_NT_USE_WINTERNL
bdb01608062958ff140a733533f3d6574886c831vboxsync/*# define HEAP_CREATE_ALIGN_16 UINT32_C(0x00010000)
7a7a4fb86f66f7ab919948a2ad6aae0483061e18vboxsync# define HEAP_CREATE_ENABLE_TRACING UINT32_C(0x00020000)
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsync# define HEAP_CREATE_ENABLE_EXECUTE UINT32_C(0x00040000)*/
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_CREATE_VALID_MASK UINT32_C(0x0007f0ff)
bdb01608062958ff140a733533f3d6574886c831vboxsync# endif /* IPRT_NT_USE_WINTERNL */
bdb01608062958ff140a733533f3d6574886c831vboxsync/** @} */
bdb01608062958ff140a733533f3d6574886c831vboxsync# ifdef IPRT_NT_USE_WINTERNL
bdb01608062958ff140a733533f3d6574886c831vboxsync/** @name Heap tagging constants
bdb01608062958ff140a733533f3d6574886c831vboxsync * @{ */
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_GLOBAL_TAG UINT32_C(0x00000800)
bdb01608062958ff140a733533f3d6574886c831vboxsync/*# define HEAP_MAXIMUM_TAG UINT32_C(0x00000fff)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_PSEUDO_TAG_FLAG UINT32_C(0x00008000)
bdb01608062958ff140a733533f3d6574886c831vboxsync# define HEAP_TAG_SHIFT 18 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync# define HEAP_TAG_MASK (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsync/** @} */
71c8a528203c289a8585ce10ac6bafc4274058c6vboxsyncNTSYSAPI PVOID NTAPI RtlAllocateHeap(HANDLE hHeap, ULONG fFlags, SIZE_T cb);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncNTSYSAPI PVOID NTAPI RtlReAllocateHeap(HANDLE hHeap, ULONG fFlags, PVOID pvOld, SIZE_T cbNew);
e214bb78026c1d64078b34ca9504d3f5abbc52efvboxsyncNTSYSAPI BOOLEAN NTAPI RtlFreeHeap(HANDLE hHeap, ULONG fFlags, PVOID pvMem);
8b36957d815c23b479eb35d93ac76c66392e9402vboxsync# endif /* IPRT_NT_USE_WINTERNL */
56349fc0a23f96f82208016f8f59f8377bb284b1vboxsyncNTSYSAPI SIZE_T NTAPI RtlCompactHeap(HANDLE hHeap, ULONG fFlags);
d29ab0cfbeef254251f0a2458163034999abb8a0vboxsyncNTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING);
1207f59aa62006952dbb0bf7700decf34d8caeb2vboxsyncNTSYSAPI SIZE_T NTAPI RtlSizeHeap(HANDLE hHeap, ULONG fFlags, PVOID pvMem);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI NTSTATUS NTAPI RtlGetLastNtStatus(VOID);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI ULONG NTAPI RtlGetLastWin32Error(VOID);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI VOID NTAPI RtlSetLastWin32Error(ULONG uError);
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncNTSYSAPI VOID NTAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS rcNt);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI VOID NTAPI RtlRestoreLastWin32Error(ULONG uError);
261b44f7fa60a1d4bb4102142d3aa44188908484vboxsyncNTSYSAPI BOOLEAN NTAPI RtlQueryPerformanceCounter(PLARGE_INTEGER);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsyncNTSYSAPI uint64_t NTAPI RtlGetSystemTimePrecise(VOID);
e214bb78026c1d64078b34ca9504d3f5abbc52efvboxsynctypedef uint64_t (NTAPI * PFNRTLGETSYSTEMTIMEPRECISE)(VOID);
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsyncRT_C_DECLS_END
a59528c40bbfdcee2e315756333f8c66f35b5accvboxsync/** @} */
6efcf94383d6e48c764c6518cf1b4069ad34e210vboxsync#endif /* IN_RING3 */
147e101bcd061b5e085e4a2c0cc9fc35546ff1aavboxsync
a59528c40bbfdcee2e315756333f8c66f35b5accvboxsync#endif
e214bb78026c1d64078b34ca9504d3f5abbc52efvboxsync
9e4ea89b1085fdaa5861e45a729d9c978db1a8f1vboxsync