nt.h revision 4221c34ed2180fbc3a82504145c4a66c589e9e6a
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync/* $Id$ */
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync/** @file
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Header for code using the Native NT API.
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync */
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync/*
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync * Copyright (C) 2010-2014 Oracle Corporation
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * available from http://www.virtualbox.org. This file is free software;
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * you can redistribute it and/or modify it under the terms of the GNU
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * General Public License (GPL) as published by the Free Software
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * The contents of this file may alternatively be used under the terms
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * of the Common Development and Distribution License Version 1.0
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * VirtualBox OSE distribution, in which case the provisions of the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * CDDL are applicable instead of those of the GPL.
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync *
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * You may elect to license modified versions of this file under the
bd8e360cd1db83dcb2694ea9122ce3bc5bae678avboxsync * terms and conditions of either the GPL or the CDDL or both.
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync */
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync#ifndef ___iprt_nt_nt_h___
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync#define ___iprt_nt_nt_h___
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync/** @def IPRT_NT_MAP_TO_ZW
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync * Map Nt calls to Zw calls. In ring-0 the Zw calls let you pass kernel memory
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync * to the APIs (takes care of the previous context checks).
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync */
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync#ifdef DOXYGEN_RUNNING
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync# define IPRT_NT_MAP_TO_ZW
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync#endif
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync#ifdef IPRT_NT_MAP_TO_ZW
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync# define NtQueryInformationFile ZwQueryInformationFile
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync# define NtQueryInformationProcess ZwQueryInformationProcess
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync# define NtQueryInformationThread ZwQueryInformationThread
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync# define NtQuerySystemInformation ZwQuerySystemInformation
5ef92c0006229b3fc7bc7eb4ad80ed65fb0dd98bvboxsync# define NtClose ZwClose
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync# define NtCreateFile ZwCreateFile
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync# define NtReadFile ZwReadFile
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define NtWriteFile ZwWriteFile
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync/** @todo this is very incomplete! */
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#endif
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#include <ntstatus.h>
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync/*
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync * Hacks common to both base header sets.
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync */
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define NtQueryObject Incomplete_NtQueryObject
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define ZwQueryObject Incomplete_ZwQueryObject
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define NtSetInformationObject Incomplete_NtSetInformationObject
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define _OBJECT_INFORMATION_CLASS Incomplete_OBJECT_INFORMATION_CLASS
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define OBJECT_INFORMATION_CLASS Incomplete_OBJECT_INFORMATION_CLASS
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define ObjectBasicInformation Incomplete_ObjectBasicInformation
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define ObjectTypeInformation Incomplete_ObjectTypeInformation
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync#ifdef IPRT_NT_USE_WINTERNL
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync/*
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync * Use Winternl.h.
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync */
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define _FILE_INFORMATION_CLASS IncompleteWinternl_FILE_INFORMATION_CLASS
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define FILE_INFORMATION_CLASS IncompleteWinternl_FILE_INFORMATION_CLASS
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define FileDirectoryInformation IncompleteWinternl_FileDirectoryInformation
81587231c9c584851518872e197f6f02dffe68cavboxsync
81587231c9c584851518872e197f6f02dffe68cavboxsync# define NtQueryInformationProcess IncompleteWinternl_NtQueryInformationProcess
81587231c9c584851518872e197f6f02dffe68cavboxsync# define NtSetInformationProcess IncompleteWinternl_NtSetInformationProcess
81587231c9c584851518872e197f6f02dffe68cavboxsync# define PROCESSINFOCLASS IncompleteWinternl_PROCESSINFOCLASS
81587231c9c584851518872e197f6f02dffe68cavboxsync# define _PROCESSINFOCLASS IncompleteWinternl_PROCESSINFOCLASS
81587231c9c584851518872e197f6f02dffe68cavboxsync# define PROCESS_BASIC_INFORMATION IncompleteWinternl_PROCESS_BASIC_INFORMATION
7be2140da7230ed5736528554a4dc34b2ac482acvboxsync# define PPROCESS_BASIC_INFORMATION IncompleteWinternl_PPROCESS_BASIC_INFORMATION
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define _PROCESS_BASIC_INFORMATION IncompleteWinternl_PROCESS_BASIC_INFORMATION
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define ProcessBasicInformation IncompleteWinternl_ProcessBasicInformation
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define ProcessDebugPort IncompleteWinternl_ProcessDebugPort
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define ProcessWow64Information IncompleteWinternl_ProcessWow64Information
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define ProcessImageFileName IncompleteWinternl_ProcessImageFileName
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define ProcessBreakOnTermination IncompleteWinternl_ProcessBreakOnTermination
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define NtQueryInformationThread IncompleteWinternl_NtQueryInformationThread
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define NtSetInformationThread IncompleteWinternl_NtSetInformationThread
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREADINFOCLASS IncompleteWinternl_THREADINFOCLASS
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define _THREADINFOCLASS IncompleteWinternl_THREADINFOCLASS
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define ThreadIsIoPending IncompleteWinternl_ThreadIsIoPending
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define NtQuerySystemInformation IncompleteWinternl_NtQuerySystemInformation
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define NtSetSystemInformation IncompleteWinternl_NtSetSystemInformation
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync# define SYSTEM_INFORMATION_CLASS IncompleteWinternl_SYSTEM_INFORMATION_CLASS
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define _SYSTEM_INFORMATION_CLASS IncompleteWinternl_SYSTEM_INFORMATION_CLASS
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define SystemBasicInformation IncompleteWinternl_SystemBasicInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemPerformanceInformation IncompleteWinternl_SystemPerformanceInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemTimeOfDayInformation IncompleteWinternl_SystemTimeOfDayInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemProcessInformation IncompleteWinternl_SystemProcessInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# define SystemProcessorPerformanceInformation IncompleteWinternl_SystemProcessorPerformanceInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemInterruptInformation IncompleteWinternl_SystemInterruptInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemExceptionInformation IncompleteWinternl_SystemExceptionInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemRegistryQuotaInformation IncompleteWinternl_SystemRegistryQuotaInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemLookasideInformation IncompleteWinternl_SystemLookasideInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define SystemPolicyInformation IncompleteWinternl_SystemPolicyInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# define WIN32_NO_STATUS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# include <windef.h>
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# include <winnt.h>
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# include <winternl.h>
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef WIN32_NO_STATUS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# include <ntstatus.h>
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef _FILE_INFORMATION_CLASS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef FILE_INFORMATION_CLASS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef FileDirectoryInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef NtQueryInformationProcess
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef NtSetInformationProcess
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef PROCESSINFOCLASS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef _PROCESSINFOCLASS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef PROCESS_BASIC_INFORMATION
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef PPROCESS_BASIC_INFORMATION
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef _PROCESS_BASIC_INFORMATION
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef ProcessBasicInformation
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef ProcessDebugPort
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef ProcessWow64Information
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef ProcessImageFileName
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef ProcessBreakOnTermination
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef NtQueryInformationThread
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef NtSetInformationThread
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef THREADINFOCLASS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef _THREADINFOCLASS
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef ThreadIsIoPending
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync
c882ddf98a60a4aab1218108b334083f98b7d66avboxsync# undef NtQuerySystemInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef NtSetSystemInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SYSTEM_INFORMATION_CLASS
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef _SYSTEM_INFORMATION_CLASS
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemBasicInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemPerformanceInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemTimeOfDayInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemProcessInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemProcessorPerformanceInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemInterruptInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemExceptionInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemRegistryQuotaInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemLookasideInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef SystemPolicyInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#else
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/*
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync * Use ntifs.h and wdm.h.
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync */
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# ifdef RT_ARCH_X86
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# pragma warning(disable : 4163)
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# endif
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# include <ntifs.h>
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# include <wdm.h>
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# ifdef RT_ARCH_X86
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# pragma warning(default : 4163)
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# undef _InterlockedAddLargeStatistic
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# endif
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# define IPRT_NT_NEED_API_GROUP_NTIFS
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#endif
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef NtQueryObject
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef ZwQueryObject
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef NtSetInformationObject
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef _OBJECT_INFORMATION_CLASS
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef OBJECT_INFORMATION_CLASS
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef ObjectBasicInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#undef ObjectTypeInformation
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#include <iprt/types.h>
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** @name Useful macros
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync * @{ */
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** Indicates that we're targetting native NT in the current source. */
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#define RTNT_USE_NATIVE_NT 1
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** Initializes a IO_STATUS_BLOCK. */
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#define RTNT_IO_STATUS_BLOCK_INITIALIZER { STATUS_FAILED_DRIVER_ENTRY, ~(uintptr_t)42 }
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** Similar to INVALID_HANDLE_VALUE in the Windows environment. */
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync#define RTNT_INVALID_HANDLE_VALUE ( (HANDLE)~(uintptr_t)0 )
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** @} */
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name IPRT helper functions for NT
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync * @{ */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRT_C_DECLS_BEGIN
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRTDECL(int) RTNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync PHANDLE phHandle, PULONG_PTR puDisposition);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRTDECL(int) RTNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRTDECL(int) RTNtPathClose(HANDLE hHandle);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRT_C_DECLS_END
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @} */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name NT API delcarations.
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync * @{ */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRT_C_DECLS_BEGIN
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name Process access rights missing in ntddk headers
fd546afe09073de92e5422c1334f1c27b4108687vboxsync * @{ */
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_TERMINATE
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_TERMINATE UINT32_C(0x00000001)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_CREATE_THREAD
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_CREATE_THREAD UINT32_C(0x00000002)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef PROCESS_SET_SESSIONID
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_SET_SESSIONID UINT32_C(0x00000004)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_VM_OPERATION
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_VM_OPERATION UINT32_C(0x00000008)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_VM_READ
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_VM_READ UINT32_C(0x00000010)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_VM_WRITE
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_VM_WRITE UINT32_C(0x00000020)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_DUP_HANDLE
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_DUP_HANDLE UINT32_C(0x00000040)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_CREATE_PROCESS
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_CREATE_PROCESS UINT32_C(0x00000080)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_SET_QUOTA
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_SET_QUOTA UINT32_C(0x00000100)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_SET_INFORMATION
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_SET_INFORMATION UINT32_C(0x00000200)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#ifndef PROCESS_QUERY_INFORMATION
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_QUERY_INFORMATION UINT32_C(0x00000400)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef PROCESS_SUSPEND_RESUME
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_SUSPEND_RESUME UINT32_C(0x00000800)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef PROCESS_QUERY_LIMITED_INFORMATION
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_QUERY_LIMITED_INFORMATION UINT32_C(0x00001000)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#ifndef PROCESS_SET_LIMITED_INFORMATION
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define PROCESS_SET_LIMITED_INFORMATION UINT32_C(0x00002000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#endif
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define PROCESS_UNKNOWN_4000 UINT32_C(0x00004000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define PROCESS_UNKNOWN_6000 UINT32_C(0x00008000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#ifndef PROCESS_ALL_ACCESS
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | UINT32_C(0x0000ffff) )
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @} */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name Thread access rights missing in ntddk headers
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync * @{ */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef THREAD_QUERY_INFORMATION
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_QUERY_INFORMATION UINT32_C(0x00000040)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef THREAD_SET_THREAD_TOKEN
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_SET_THREAD_TOKEN UINT32_C(0x00000080)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef THREAD_IMPERSONATE
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define THREAD_IMPERSONATE UINT32_C(0x00000100)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef THREAD_DIRECT_IMPERSONATION
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_DIRECT_IMPERSONATION UINT32_C(0x00000200)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef THREAD_RESUME
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_RESUME UINT32_C(0x00001000)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#define THREAD_UNKNOWN_2000 UINT32_C(0x00002000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define THREAD_UNKNOWN_4000 UINT32_C(0x00004000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#define THREAD_UNKNOWN_8000 UINT32_C(0x00008000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync/** @} */
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync/** @name Special handle values.
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync * @{ */
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#ifndef NtCurrentProcess
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define NtCurrentProcess() ( (HANDLE)-(intptr_t)1 )
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef NtCurrentThread
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define NtCurrentThread() ( (HANDLE)-(intptr_t)2 )
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef ZwCurrentProcess
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define ZwCurrentProcess() NtCurrentProcess()
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef ZwCurrentThread
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define ZwCurrentThread() NtCurrentThread()
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync/** @} */
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync/** @name Directory object access rights.
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync * @{ */
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef DIRECTORY_QUERY
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_QUERY UINT32_C(0x00000001)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef DIRECTORY_TRAVERSE
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_TRAVERSE UINT32_C(0x00000002)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef DIRECTORY_CREATE_OBJECT
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_CREATE_OBJECT UINT32_C(0x00000004)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef DIRECTORY_CREATE_SUBDIRECTORY
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_CREATE_SUBDIRECTORY UINT32_C(0x00000008)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef DIRECTORY_ALL_ACCESS
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | UINT32_C(0x0000000f) )
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync/** @} */
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync#ifdef IPRT_NT_USE_WINTERNL
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsynctypedef struct _CLIENT_ID
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync{
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync HANDLE UniqueProcess;
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync HANDLE UniqueThread;
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync} CLIENT_ID;
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsynctypedef CLIENT_ID *PCLIENT_ID;
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsync
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsyncNTSYSAPI NTSTATUS NTAPI NtCreateSection(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG, HANDLE);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef struct _FILE_FS_ATTRIBUTE_INFORMATION
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync{
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync ULONG FileSystemAttributes;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync LONG MaximumComponentNameLength;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync ULONG FileSystemNameLength;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync WCHAR FileSystemName[1];
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync} FILE_FS_ATTRIBUTE_INFORMATION;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef FILE_FS_ATTRIBUTE_INFORMATION *PFILE_FS_ATTRIBUTE_INFORMATION;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef enum _FSINFOCLASS
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync{
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsVolumeInformation = 1,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsLabelInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsSizeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsDeviceInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsAttributeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsControlInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsFullSizeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsObjectIdInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsDriverPathInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsVolumeFlagsInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsSectorSizeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsDataCopyInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFsMaximumInformation
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync} FS_INFORMATION_CLASS;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef FS_INFORMATION_CLASS *PFS_INFORMATION_CLASS;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef struct _FILE_STANDARD_INFORMATION
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync{
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync LARGE_INTEGER AllocationSize;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync LARGE_INTEGER EndOfFile;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync ULONG NumberOfLinks;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync BOOLEAN DeletePending;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync BOOLEAN Directory;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync} FILE_STANDARD_INFORMATION;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef enum _FILE_INFORMATION_CLASS
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync{
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileDirectoryInformation = 1,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFullDirectoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileBothDirectoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileBasicInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileStandardInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileInternalInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileEaInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileAccessInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileNameInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileRenameInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileLinkInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileNamesInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileDispositionInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FilePositionInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileFullEaInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileModeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileAlignmentInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileAllInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileAllocationInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileEndOfFileInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileAlternateNameInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileStreamInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FilePipeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FilePipeLocalInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FilePipeRemoteInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileMailslotQueryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileMailslotSetInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileCompressionInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileObjectIdInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileCompletionInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileMoveClusterInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileQuotaInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileReparsePointInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileNetworkOpenInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileAttributeTagInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileTrackingInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIdBothDirectoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIdFullDirectoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileValidDataLengthInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileShortNameInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIoCompletionNotificationInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIoStatusBlockRangeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIoPriorityHintInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileSfioReserveInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileSfioVolumeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileHardLinkInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileProcessIdsUsingFileInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileNormalizedNameInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileNetworkPhysicalNameInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIdGlobalTxDirectoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileIsRemoteDeviceInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileUnusedInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileNumaNodeInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileStandardLinkInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileRemoteProtocolInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileRenameInformationBypassAccessCheck,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync FileLinkInformationBypassAccessCheck,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync FileVolumeNameInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync FileIdInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync FileIdExtdDirectoryInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync FileReplaceCompletionInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync FileHardLinkFullIdInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync FileMaximumInformation
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync} FILE_INFORMATION_CLASS;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsynctypedef FILE_INFORMATION_CLASS *PFILE_INFORMATION_CLASS;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsynctypedef struct _MEMORY_SECTION_NAME
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync{
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync UNICODE_STRING SectionFileName;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync WCHAR NameBuffer[1];
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync} MEMORY_SECTION_NAME;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync#ifdef IPRT_NT_USE_WINTERNL
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsynctypedef struct _PROCESS_BASIC_INFORMATION
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync{
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync NTSTATUS ExitStatus;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync PPEB PebBaseAddress;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG_PTR AffinityMask;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync int32_t BasePriority;
7be2140da7230ed5736528554a4dc34b2ac482acvboxsync ULONG_PTR UniqueProcessId;
7e0c3d180b978b8f4b5b33f8e924520248ee3ab3vboxsync ULONG_PTR InheritedFromUniqueProcessId;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync} PROCESS_BASIC_INFORMATION;
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef PROCESS_BASIC_INFORMATION *PPROCESS_BASIC_INFORMATION;
81587231c9c584851518872e197f6f02dffe68cavboxsync#endif
81587231c9c584851518872e197f6f02dffe68cavboxsync
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsynctypedef enum _PROCESSINFOCLASS
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync{
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsync ProcessBasicInformation = 0,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessQuotaLimits,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessIoCounters,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessVmCounters,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessTimes,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessBasePriority,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessRaisePriority,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessDebugPort,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessExceptionPort,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessAccessToken,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessLdtInformation,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessLdtSize,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessDefaultHardErrorMode,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessIoPortHandlers,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessPooledUsageAndLimits,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessWorkingSetWatch,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessUserModeIOPL,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessEnableAlignmentFaultFixup,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessPriorityClass,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessWx86Information,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessHandleCount,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessAffinityMask,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessPriorityBoost,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessDeviceMap,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessSessionInformation,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessForegroundInformation,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessWow64Information,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessImageFileName,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessLUIDDeviceMapsEnabled,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessBreakOnTermination,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessDebugObjectHandle,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessDebugFlags,
81587231c9c584851518872e197f6f02dffe68cavboxsync ProcessHandleTracing,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessIoPriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessExecuteFlags,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessTlsInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessCookie,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessImageInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessCycleTime,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessPagePriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessInstrumentationCallbak,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessThreadStackAllocation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessWorkingSetWatchEx,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessImageFileNameWin32,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessImageFileMapping,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessAffinityUpdateMode,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessMemoryAllocationMode,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessGroupInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessTokenVirtualizationEnabled,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessConsoleHostProcess,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ProcessWindowsInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync MaxProcessInfoClass
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync} PROCESSINFOCLASS;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsynctypedef enum _THREADINFOCLASS
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync{
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadBasicInformation = 0,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadTimes,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadPriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadBasePriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadAffinityMask,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadImpersonationToken,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadDescriptorTableEntry,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadEnableAlignmentFaultFixup,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadEventPair_Reusable,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadQuerySetWin32StartAddress,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadZeroTlsCell,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadPerformanceCount,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadAmILastThread,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadIdealProcessor,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadPriorityBoost,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadSetTlsArrayAddress,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadIsIoPending,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadHideFromDebugger,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadBreakOnTermination,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadSwitchLegacyState,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadIsTerminated,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadLastSystemCall,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadIoPriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadCycleTime,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadPagePriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadActualBasePriority,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadTebInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadCSwitchMon,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadCSwitchPmu,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadWow64Context,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadGroupInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadUmsInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadCounterProfiling,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadIdealProcessorEx,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ThreadCpuAccountingInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync MaxThreadInfoClass
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync} THREADINFOCLASS;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtSetInformationThread(HANDLE, THREADINFOCLASS, LPCVOID, ULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtReadFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtWriteFile(HANDLE, HANDLE, PIO_APC_ROUTINE, void const *, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtReadVirtualMemory(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE, PVOID, void const *, SIZE_T, PSIZE_T);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
81587231c9c584851518872e197f6f02dffe68cavboxsyncNTSYSAPI NTSTATUS NTAPI RtlAddAccessAllowedAce(PACL, ULONG, ULONG, PSID);
81587231c9c584851518872e197f6f02dffe68cavboxsyncNTSYSAPI NTSTATUS NTAPI RtlCopySid(ULONG, PSID, PSID);
81587231c9c584851518872e197f6f02dffe68cavboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL, ULONG, ULONG);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI RtlGetVersion(PRTL_OSVERSIONINFOW);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI RtlInitializeSid(PSID, PSID_IDENTIFIER_AUTHORITY, UCHAR);
dccbafa70b5a9a6f933c5566e4542caf9f379b97vboxsyncNTSYSAPI NTSTATUS NTAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI PULONG NTAPI RtlSubAuthoritySid(PSID, ULONG);
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsync
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsync#endif /* IPRT_NT_USE_WINTERNL */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsynctypedef enum _OBJECT_INFORMATION_CLASS
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync{
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync ObjectBasicInformation = 0,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync ObjectNameInformation,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync ObjectTypeInformation,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync ObjectAllInformation,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync ObjectDataInformation
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync} OBJECT_INFORMATION_CLASS;
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsynctypedef OBJECT_INFORMATION_CLASS *POBJECT_INFORMATION_CLASS;
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync#ifdef IN_RING0
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define NtQueryObject ZwQueryObject
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsyncNTSYSAPI NTSTATUS NTAPI NtDuplicateObject(HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG);
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenDirectoryObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsynctypedef struct _OBJECT_DIRECTORY_INFORMATION
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync{
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsync UNICODE_STRING Name;
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsync UNICODE_STRING TypeName;
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync} OBJECT_DIRECTORY_INFORMATION;
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef OBJECT_DIRECTORY_INFORMATION *POBJECT_DIRECTORY_INFORMATION;
81587231c9c584851518872e197f6f02dffe68cavboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
81587231c9c584851518872e197f6f02dffe68cavboxsync
81587231c9c584851518872e197f6f02dffe68cavboxsync/** Retured by ProcessImageInformation as well as NtQuerySection. */
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef struct _SECTION_IMAGE_INFORMATION
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync{
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync PVOID TransferAddress;
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync ULONG ZeroBits;
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync SIZE_T MaximumStackSize;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync SIZE_T CommittedStackSize;
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync ULONG SubSystemType;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync union
fd546afe09073de92e5422c1334f1c27b4108687vboxsync {
fd546afe09073de92e5422c1334f1c27b4108687vboxsync struct
fd546afe09073de92e5422c1334f1c27b4108687vboxsync {
7e0c3d180b978b8f4b5b33f8e924520248ee3ab3vboxsync USHORT SubSystemMinorVersion;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync USHORT SubSystemMajorVersion;
7e0c3d180b978b8f4b5b33f8e924520248ee3ab3vboxsync };
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG SubSystemVersion;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync };
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG GpValue;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync USHORT ImageCharacteristics;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync USHORT DllCharacteristics;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync USHORT Machine;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync BOOLEAN ImageContainsCode;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync union /**< Since Vista, used to be a spare BOOLEAN. */
fd546afe09073de92e5422c1334f1c27b4108687vboxsync {
fd546afe09073de92e5422c1334f1c27b4108687vboxsync struct
fd546afe09073de92e5422c1334f1c27b4108687vboxsync {
fd546afe09073de92e5422c1334f1c27b4108687vboxsync UCHAR ComPlusNativeRead : 1;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync UCHAR ComPlusILOnly : 1;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync UCHAR ImageDynamicallyRelocated : 1;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync UCHAR ImageMAppedFlat : 1;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync UCHAR Reserved : 4;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync };
fd546afe09073de92e5422c1334f1c27b4108687vboxsync UCHAR ImageFlags;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync };
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG LoaderFlags;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG ImageFileSize; /**< Since XP? */
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG CheckSum; /**< Since Vista, Used to be a reserved/spare ULONG. */
fd546afe09073de92e5422c1334f1c27b4108687vboxsync} SECTION_IMAGE_INFORMATION;
fd546afe09073de92e5422c1334f1c27b4108687vboxsynctypedef SECTION_IMAGE_INFORMATION *PSECTION_IMAGE_INFORMATION;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync
fd546afe09073de92e5422c1334f1c27b4108687vboxsynctypedef enum _SECTION_INFORMATION_CLASS
fd546afe09073de92e5422c1334f1c27b4108687vboxsync{
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync SectionBasicInformation = 0,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync SectionImageInformation,
fd546afe09073de92e5422c1334f1c27b4108687vboxsync MaxSectionInfoClass
fd546afe09073de92e5422c1334f1c27b4108687vboxsync} SECTION_INFORMATION_CLASS;
fd546afe09073de92e5422c1334f1c27b4108687vboxsyncNTSYSAPI NTSTATUS NTAPI NtQuerySection(HANDLE, SECTION_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
fd546afe09073de92e5422c1334f1c27b4108687vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationThread(HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef SEC_FILE
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define SEC_FILE UINT32_C(0x00800000)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync#ifndef SEC_IMAGE
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define SEC_IMAGE UINT32_C(0x01000000)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#endif
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync#ifndef SEC_PROTECTED_IMAGE
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync# define SEC_PROTECTED_IMAGE UINT32_C(0x02000000)
81587231c9c584851518872e197f6f02dffe68cavboxsync#endif
81587231c9c584851518872e197f6f02dffe68cavboxsync#ifndef SEC_NOCACHE
81587231c9c584851518872e197f6f02dffe68cavboxsync# define SEC_NOCACHE UINT32_C(0x10000000)
81587231c9c584851518872e197f6f02dffe68cavboxsync#endif
81587231c9c584851518872e197f6f02dffe68cavboxsync#ifndef MEM_ROTATE
81587231c9c584851518872e197f6f02dffe68cavboxsync# define MEM_ROTATE UINT32_C(0x00800000)
81587231c9c584851518872e197f6f02dffe68cavboxsync#endif
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef enum _MEMORY_INFORMATION_CLASS
81587231c9c584851518872e197f6f02dffe68cavboxsync{
81587231c9c584851518872e197f6f02dffe68cavboxsync MemoryBasicInformation = 0,
81587231c9c584851518872e197f6f02dffe68cavboxsync MemoryWorkingSetList,
81587231c9c584851518872e197f6f02dffe68cavboxsync MemorySectionName,
81587231c9c584851518872e197f6f02dffe68cavboxsync MemoryBasicVlmInformation
81587231c9c584851518872e197f6f02dffe68cavboxsync} MEMORY_INFORMATION_CLASS;
81587231c9c584851518872e197f6f02dffe68cavboxsync#ifdef IN_RING0
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef struct _MEMORY_BASIC_INFORMATION
81587231c9c584851518872e197f6f02dffe68cavboxsync{
81587231c9c584851518872e197f6f02dffe68cavboxsync PVOID BaseAddress;
81587231c9c584851518872e197f6f02dffe68cavboxsync PVOID AllocationBase;
81587231c9c584851518872e197f6f02dffe68cavboxsync ULONG AllocationProtect;
81587231c9c584851518872e197f6f02dffe68cavboxsync SIZE_T RegionSize;
81587231c9c584851518872e197f6f02dffe68cavboxsync ULONG State;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG Protect;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG Type;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync} MEMORY_BASIC_INFORMATION;
fd546afe09073de92e5422c1334f1c27b4108687vboxsynctypedef MEMORY_BASIC_INFORMATION *PMEMORY_BASIC_INFORMATION;
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define NtQueryVirtualMemory ZwQueryVirtualMemory
fd546afe09073de92e5422c1334f1c27b4108687vboxsync#endif
7e0c3d180b978b8f4b5b33f8e924520248ee3ab3vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryVirtualMemory(HANDLE, void const *, MEMORY_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
fd546afe09073de92e5422c1334f1c27b4108687vboxsync
7e0c3d180b978b8f4b5b33f8e924520248ee3ab3vboxsynctypedef enum _SYSTEM_INFORMATION_CLASS
fd546afe09073de92e5422c1334f1c27b4108687vboxsync{
fd546afe09073de92e5422c1334f1c27b4108687vboxsync SystemBasicInformation = 0,
fd546afe09073de92e5422c1334f1c27b4108687vboxsync SystemCpuInformation,
fd546afe09073de92e5422c1334f1c27b4108687vboxsync SystemPerformanceInformation,
81587231c9c584851518872e197f6f02dffe68cavboxsync SystemTimeOfDayInformation,
7be2140da7230ed5736528554a4dc34b2ac482acvboxsync SystemInformation_Unknown_4,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync SystemProcessInformation,
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync SystemInformation_Unknown_6,
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync SystemInformation_Unknown_7,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync SystemProcessorPerformanceInformation,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync SystemInformation_Unknown_9,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync SystemInformation_Unknown_10,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync SystemModuleInformation,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync SystemInformation_Unknown_12,
81587231c9c584851518872e197f6f02dffe68cavboxsync SystemInformation_Unknown_13,
81587231c9c584851518872e197f6f02dffe68cavboxsync SystemInformation_Unknown_14,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync SystemInformation_Unknown_15,
81587231c9c584851518872e197f6f02dffe68cavboxsync SystemHandleInformation,
14e0667f834cd0e2a8c365084cd2ad0a893109e8vboxsync SystemInformation_Unknown_17,
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync SystemPageFileInformation,
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync SystemInformation_Unknown_19,
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync SystemInformation_Unknown_20,
aa4bcf0a4b2db3ac352b56a291d49cb8d4b66d32vboxsync SystemCacheInformation,
4d6dcfe00aab559241d9ed05b89f803ab5ddf611vboxsync SystemInformation_Unknown_22,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInterruptInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemDpcBehaviourInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemFullMemoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemLoadGdiDriverInformation, /* 26 */
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemUnloadGdiDriverInformation, /* 27 */
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemTimeAdjustmentInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemSummaryMemoryInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_30,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_31,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_32,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemExceptionInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemCrashDumpStateInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemKernelDebuggerInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemContextSwitchInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemRegistryQuotaInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_38,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_39,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_40,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_41,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_42,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_43,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemCurrentTimeZoneInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemLookasideInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync SystemSetTimeSlipEvent,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemCreateSession,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemDeleteSession,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync SystemInformation_Unknown_49,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync SystemRangeStartInformation,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync SystemVerifierInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemInformation_Unknown_52,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemSessionProcessInformation,
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemLoadGdiDriverInSystemSpaceInformation, /* 54 */
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_55,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_56,
f181d21bd7f14d7ee3709246500c9353bb33c922vboxsync SystemExtendedProcessInformation,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_58,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_59,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_60,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_61,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_62,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformation_Unknown_63,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemExtendedHandleInformation, /* 64 */
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync /** @todo fill gap. they've added a whole bunch of things */
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemPolicyInformation = 134,
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SystemInformationClassMax
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync} SYSTEM_INFORMATION_CLASS;
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync#ifdef IPRT_NT_USE_WINTERNL
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsynctypedef struct _VM_COUNTERS
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync{
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SIZE_T PeakVirtualSize;
f181d21bd7f14d7ee3709246500c9353bb33c922vboxsync SIZE_T VirtualSize;
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync ULONG PageFaultCount;
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SIZE_T PeakWorkingSetSize;
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync SIZE_T WorkingSetSize;
SIZE_T QuotaPeakPagedPoolUsage;
SIZE_T QuotaPagedPoolUsage;
SIZE_T QuotaPeakNonPagedPoolUsage;
SIZE_T QuotaNonPagedPoolUsage;
SIZE_T PagefileUsage;
SIZE_T PeakPagefileUsage;
} VM_COUNTERS;
typedef VM_COUNTERS *PVM_COUNTERS;
#endif
#if 0
typedef struct _IO_COUNTERS
{
ULONGLONG ReadOperationCount;
ULONGLONG WriteOperationCount;
ULONGLONG OtherOperationCount;
ULONGLONG ReadTransferCount;
ULONGLONG WriteTransferCount;
ULONGLONG OtherTransferCount;
} IO_COUNTERS;
typedef IO_COUNTERS *PIO_COUNTERS;
#endif
typedef struct _RTNT_SYSTEM_PROCESS_INFORMATION
{
ULONG NextEntryOffset; /**< 0x00 / 0x00 */
ULONG NumberOfThreads; /**< 0x04 / 0x04 */
LARGE_INTEGER Reserved1[3]; /**< 0x08 / 0x08 */
LARGE_INTEGER CreationTime; /**< 0x20 / 0x20 */
LARGE_INTEGER UserTime; /**< 0x28 / 0x28 */
LARGE_INTEGER KernelTime; /**< 0x30 / 0x30 */
UNICODE_STRING ProcessName; /**< 0x38 / 0x38 Clean unicode encoding? */
int32_t BasePriority; /**< 0x40 / 0x48 */
HANDLE UniqueProcessId; /**< 0x44 / 0x50 */
HANDLE ParentProcessId; /**< 0x48 / 0x58 */
ULONG HandleCount; /**< 0x4c / 0x60 */
ULONG Reserved2; /**< 0x50 / 0x64 Session ID? */
ULONG_PTR Reserved3; /**< 0x54 / 0x68 */
VM_COUNTERS VmCounters; /**< 0x58 / 0x70 */
IO_COUNTERS IoCounters; /**< 0x88 / 0xd0 Might not be present in earlier windows versions. */
/* After this follows the threads, then the ProcessName.Buffer. */
} RTNT_SYSTEM_PROCESS_INFORMATION;
typedef RTNT_SYSTEM_PROCESS_INFORMATION *PRTNT_SYSTEM_PROCESS_INFORMATION;
#ifndef IPRT_NT_USE_WINTERNL
typedef RTNT_SYSTEM_PROCESS_INFORMATION SYSTEM_PROCESS_INFORMATION ;
typedef SYSTEM_PROCESS_INFORMATION *PSYSTEM_PROCESS_INFORMATION;
#endif
typedef struct _SYSTEM_HANDLE_ENTRY_INFO
{
USHORT UniqueProcessId;
USHORT CreatorBackTraceIndex;
UCHAR ObjectTypeIndex;
UCHAR HandleAttributes;
USHORT HandleValue;
PVOID Object;
ULONG GrantedAccess;
} SYSTEM_HANDLE_ENTRY_INFO;
typedef SYSTEM_HANDLE_ENTRY_INFO *PSYSTEM_HANDLE_ENTRY_INFO;
/** Returned by SystemHandleInformation */
typedef struct _SYSTEM_HANDLE_INFORMATION
{
ULONG NumberOfHandles;
SYSTEM_HANDLE_ENTRY_INFO Handles[1];
} SYSTEM_HANDLE_INFORMATION;
typedef SYSTEM_HANDLE_INFORMATION *PSYSTEM_HANDLE_INFORMATION;
/** Extended handle information entry.
* @remarks 3 x PVOID + 4 x ULONG = 28 bytes on 32-bit / 40 bytes on 64-bit */
typedef struct _SYSTEM_HANDLE_ENTRY_INFO_EX
{
PVOID Object;
HANDLE UniqueProcessId;
HANDLE HandleValue;
ACCESS_MASK GrantedAccess;
USHORT CreatorBackTraceIndex;
USHORT ObjectTypeIndex;
ULONG HandleAttributes;
ULONG Reserved;
} SYSTEM_HANDLE_ENTRY_INFO_EX;
typedef SYSTEM_HANDLE_ENTRY_INFO_EX *PSYSTEM_HANDLE_ENTRY_INFO_EX;
/** Returned by SystemExtendedHandleInformation. */
typedef struct _SYSTEM_HANDLE_INFORMATION_EX
{
ULONG_PTR NumberOfHandles;
ULONG_PTR Reserved;
SYSTEM_HANDLE_ENTRY_INFO_EX Handles[1];
} SYSTEM_HANDLE_INFORMATION_EX;
typedef SYSTEM_HANDLE_INFORMATION_EX *PSYSTEM_HANDLE_INFORMATION_EX;
/** Input to SystemSessionProcessInformation. */
typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
{
ULONG SessionId;
ULONG BufferLength;
/** Return buffer, SYSTEM_PROCESS_INFORMATION entries. */
PVOID Buffer;
} SYSTEM_SESSION_PROCESS_INFORMATION;
typedef SYSTEM_SESSION_PROCESS_INFORMATION *PSYSTEM_SESSION_PROCESS_INFORMATION;
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
NTSYSAPI NTSTATUS NTAPI NtDelayExecution(BOOLEAN, PLARGE_INTEGER);
NTSYSAPI NTSTATUS NTAPI NtYieldExecution(void);
NTSYSAPI NTSTATUS NTAPI RtlAddAccessDeniedAce(PACL, ULONG, ULONG, PSID);
RT_C_DECLS_END
/** @} */
#if defined(IN_RING0) || defined(DOXYGEN_RUNNING)
/** @name NT Kernel APIs
* @{ */
NTSYSAPI BOOLEAN NTAPI ObFindHandleForObject(PEPROCESS pProcess, PVOID pvObject, POBJECT_TYPE pObjectType,
PVOID pvOptionalConditions, PHANDLE phFound);
NTSYSAPI NTSTATUS NTAPI ObReferenceObjectByName(PUNICODE_STRING pObjectPath, ULONG fAttributes, PACCESS_STATE pAccessState,
ACCESS_MASK fDesiredAccess, POBJECT_TYPE pObjectType,
KPROCESSOR_MODE enmAccessMode, PVOID pvParseContext, PVOID *ppvObject);
NTSYSAPI HANDLE NTAPI PsGetProcessInheritedFromUniqueProcessId(PEPROCESS);
NTSYSAPI UCHAR * NTAPI PsGetProcessImageFileName(PEPROCESS);
NTSYSAPI BOOLEAN NTAPI PsIsProcessBeingDebugged(PEPROCESS);
NTSYSAPI ULONG NTAPI PsGetProcessSessionId(PEPROCESS);
extern DECLIMPORT(POBJECT_TYPE *) LpcPortObjectType; /**< In vista+ this is the ALPC port object type. */
extern DECLIMPORT(POBJECT_TYPE *) LpcWaitablePortObjectType; /**< In vista+ this is the ALPC port object type. */
/** @ */
#endif /* IN_RING0 */
#endif