nt.h revision 4221c34ed2180fbc3a82504145c4a66c589e9e6a
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Header for code using the Native NT API.
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync * Copyright (C) 2010-2014 Oracle Corporation
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 * 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 * 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.
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).
d618bed3882cd227cf8f5d0d2824f8db42fad415vboxsync# define NtQueryInformationFile ZwQueryInformationFile
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync# define NtQueryInformationProcess ZwQueryInformationProcess
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync# define NtQueryInformationThread ZwQueryInformationThread
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync# define NtQuerySystemInformation ZwQuerySystemInformation
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync/** @todo this is very incomplete! */
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync * Hacks common to both base header sets.
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
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define _FILE_INFORMATION_CLASS IncompleteWinternl_FILE_INFORMATION_CLASS
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define FILE_INFORMATION_CLASS IncompleteWinternl_FILE_INFORMATION_CLASS
ea6c70405e39fa563a55780ef25e0933d8c73a1avboxsync# define FileDirectoryInformation IncompleteWinternl_FileDirectoryInformation
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# define NtQueryInformationThread IncompleteWinternl_NtQueryInformationThread
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define NtSetInformationThread IncompleteWinternl_NtSetInformationThread
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREADINFOCLASS IncompleteWinternl_THREADINFOCLASS
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define _THREADINFOCLASS IncompleteWinternl_THREADINFOCLASS
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define ThreadIsIoPending IncompleteWinternl_ThreadIsIoPending
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
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** @name Useful macros
b6097213cd07c5383c49168bfb61f915dbd4587avboxsync/** Indicates that we're targetting native NT in the current source. */
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 )
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name IPRT helper functions for NT
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRTDECL(int) RTNtPathOpen(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs, ULONG fShareAccess,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs,
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncRTDECL(int) RTNtPathOpenDir(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fShareAccess, ULONG fCreateOptions,
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync ULONG fObjAttribs, PHANDLE phHandle, bool *pfObjDir);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name NT API delcarations.
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name Process access rights missing in ntddk headers
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_CREATE_PROCESS UINT32_C(0x00000080)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_SET_INFORMATION UINT32_C(0x00000200)
fd546afe09073de92e5422c1334f1c27b4108687vboxsync# define PROCESS_QUERY_INFORMATION UINT32_C(0x00000400)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_SUSPEND_RESUME UINT32_C(0x00000800)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_QUERY_LIMITED_INFORMATION UINT32_C(0x00001000)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define PROCESS_SET_LIMITED_INFORMATION UINT32_C(0x00002000)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define PROCESS_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | UINT32_C(0x0000ffff) )
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync/** @name Thread access rights missing in ntddk headers
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_QUERY_INFORMATION UINT32_C(0x00000040)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_SET_THREAD_TOKEN UINT32_C(0x00000080)
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsync# define THREAD_DIRECT_IMPERSONATION UINT32_C(0x00000200)
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync/** @name Special handle values.
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsync# define NtCurrentProcess() ( (HANDLE)-(intptr_t)1 )
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync/** @name Directory object access rights.
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_CREATE_OBJECT UINT32_C(0x00000004)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_CREATE_SUBDIRECTORY UINT32_C(0x00000008)
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync# define DIRECTORY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | UINT32_C(0x0000000f) )
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsynctypedef struct _CLIENT_ID
4fa08e9052161e65bfe8d2e3bb38fa227af628c0vboxsyncNTSYSAPI NTSTATUS NTAPI NtCreateSection(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG, HANDLE);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef FILE_FS_ATTRIBUTE_INFORMATION *PFILE_FS_ATTRIBUTE_INFORMATION;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef FS_INFORMATION_CLASS *PFS_INFORMATION_CLASS;
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsynctypedef FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsynctypedef FILE_INFORMATION_CLASS *PFILE_INFORMATION_CLASS;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef PROCESS_BASIC_INFORMATION *PPROCESS_BASIC_INFORMATION;
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtSetInformationThread(HANDLE, THREADINFOCLASS, LPCVOID, ULONG);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
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);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtReadVirtualMemory(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
b1cf57acefb5d1ce6ae2466f43e225a81083ff34vboxsyncNTSYSAPI NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE, PVOID, void const *, SIZE_T, PSIZE_T);
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#endif /* IPRT_NT_USE_WINTERNL */
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsynctypedef OBJECT_INFORMATION_CLASS *POBJECT_INFORMATION_CLASS;
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);
da97b7ac000d0f02e86c31a4f2767a00d83c6167vboxsyncNTSYSAPI NTSTATUS NTAPI NtOpenDirectoryObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
81587231c9c584851518872e197f6f02dffe68cavboxsynctypedef OBJECT_DIRECTORY_INFORMATION *POBJECT_DIRECTORY_INFORMATION;
81587231c9c584851518872e197f6f02dffe68cavboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
81587231c9c584851518872e197f6f02dffe68cavboxsync/** Retured by ProcessImageInformation as well as NtQuerySection. */
fd546afe09073de92e5422c1334f1c27b4108687vboxsync union /**< Since Vista, used to be a spare BOOLEAN. */
fd546afe09073de92e5422c1334f1c27b4108687vboxsync ULONG CheckSum; /**< Since Vista, Used to be a reserved/spare ULONG. */
fd546afe09073de92e5422c1334f1c27b4108687vboxsynctypedef SECTION_IMAGE_INFORMATION *PSECTION_IMAGE_INFORMATION;
fd546afe09073de92e5422c1334f1c27b4108687vboxsyncNTSYSAPI NTSTATUS NTAPI NtQuerySection(HANDLE, SECTION_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
45e9c1c72518aeba6673332bdd4d70b59e1c11a4vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryInformationThread(HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG);
fd546afe09073de92e5422c1334f1c27b4108687vboxsynctypedef MEMORY_BASIC_INFORMATION *PMEMORY_BASIC_INFORMATION;
7e0c3d180b978b8f4b5b33f8e924520248ee3ab3vboxsyncNTSYSAPI NTSTATUS NTAPI NtQueryVirtualMemory(HANDLE, void const *, MEMORY_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
f6f8bfbbbc6a59ba94b01886ed5a8d6e5813073bvboxsync SystemLoadGdiDriverInSystemSpaceInformation, /* 54 */
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsync /** @todo fill gap. they've added a whole bunch of things */
03c2683d4e59cc500217b1d5d76fdf9b8cdfefa5vboxsynctypedef struct _VM_COUNTERS
} VM_COUNTERS;
typedef struct _IO_COUNTERS
} IO_COUNTERS;
typedef struct _RTNT_SYSTEM_PROCESS_INFORMATION
#ifndef IPRT_NT_USE_WINTERNL
typedef struct _SYSTEM_HANDLE_ENTRY_INFO
typedef struct _SYSTEM_HANDLE_INFORMATION
typedef struct _SYSTEM_HANDLE_ENTRY_INFO_EX
typedef struct _SYSTEM_HANDLE_INFORMATION_EX
typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
NTSYSAPI BOOLEAN NTAPI ObFindHandleForObject(PEPROCESS pProcess, PVOID pvObject, POBJECT_TYPE pObjectType,
NTSYSAPI NTSTATUS NTAPI ObReferenceObjectByName(PUNICODE_STRING pObjectPath, ULONG fAttributes, PACCESS_STATE pAccessState,
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. */