NtUndoc.h (2419B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_NtUndoc_h 8 #define mozilla_NtUndoc_h 9 10 #include <winternl.h> 11 12 #if defined(__cplusplus) 13 extern "C" { 14 #endif 15 16 #ifndef STATUS_INFO_LENGTH_MISMATCH 17 # define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) 18 #endif 19 20 #ifndef STATUS_BUFFER_TOO_SMALL 21 # define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) 22 #endif 23 24 #ifndef STATUS_MORE_ENTRIES 25 # define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105L) 26 #endif 27 28 enum UndocSystemInformationClass { SystemExtendedHandleInformation = 64 }; 29 30 struct SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX { 31 PVOID mObject; 32 ULONG_PTR mPid; 33 ULONG_PTR mHandle; 34 ACCESS_MASK mGrantedAccess; 35 USHORT mCreatorBackTraceIndex; 36 USHORT mObjectTypeIndex; 37 ULONG mAttributes; 38 ULONG mReserved; 39 }; 40 41 struct SYSTEM_HANDLE_INFORMATION_EX { 42 ULONG_PTR mHandleCount; 43 ULONG_PTR mReserved; 44 SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX mHandles[1]; 45 }; 46 47 #ifndef __MINGW32__ 48 enum UndocObjectInformationClass { ObjectNameInformation = 1 }; 49 50 struct OBJECT_NAME_INFORMATION { 51 UNICODE_STRING Name; 52 }; 53 #endif 54 55 // The following declarations are documented on MSDN but are not included in 56 // public user-mode headers. 57 58 enum DirectoryObjectAccessFlags { 59 DIRECTORY_QUERY = 0x0001, 60 DIRECTORY_TRAVERSE = 0x0002, 61 DIRECTORY_CREATE_OBJECT = 0x0004, 62 DIRECTORY_CREATE_SUBDIRECTORY = 0x0008, 63 DIRECTORY_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | 0x000F 64 }; 65 66 NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE aDirectoryHandle, 67 ACCESS_MASK aDesiredAccess, 68 POBJECT_ATTRIBUTES aObjectAttributes); 69 70 struct OBJECT_DIRECTORY_INFORMATION { 71 UNICODE_STRING mName; 72 UNICODE_STRING mTypeName; 73 }; 74 75 NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE aDirectoryHandle, 76 PVOID aOutBuffer, ULONG aBufferLength, 77 BOOLEAN aReturnSingleEntry, 78 BOOLEAN aRestartScan, PULONG aContext, 79 PULONG aOutReturnLength); 80 81 #if defined(__cplusplus) 82 } // extern "C" 83 #endif 84 85 #endif // mozilla_NtUndoc_h