2 * Copyright 2004 Martin Fuchs
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #define NTOS_MODE_USER
21 #include <ndk/ntndk.h>
22 #include <ndk/rtlfuncs.h>
25 // All the possible values are defined here because I want the type field to be
26 // "persistable" and not change if more types are added in the future.
28 DIRECTORY_OBJECT
, SYMBOLICLINK_OBJECT
,
29 MUTANT_OBJECT
, SECTION_OBJECT
, EVENT_OBJECT
, SEMAPHORE_OBJECT
,
30 TIMER_OBJECT
, KEY_OBJECT
, EVENTPAIR_OBJECT
, IOCOMPLETITION_OBJECT
,
31 DEVICE_OBJECT
, FILE_OBJECT
, CONTROLLER_OBJECT
, PROFILE_OBJECT
,
32 TYPE_OBJECT
, DESKTOP_OBJECT
, WINDOWSTATION_OBJECT
, DRIVER_OBJECT
,
33 TOKEN_OBJECT
, PROCESS_OBJECT
, THREAD_OBJECT
, ADAPTER_OBJECT
, PORT_OBJECT
,
35 UNKNOWN_OBJECT_TYPE
= -1
37 extern const LPCWSTR ObjectTypeNames
[];
39 #define NT_OBJECT_PIDL_MAGIC (USHORT)0x9A03
40 #define REGISTRY_PIDL_MAGIC (USHORT)0x5364
48 USHORT magic
; // 0x9A03 ~~~ "NTOB"
50 // If this is -1, there will be a NtPidlTypeData following this, and before any other extensions
51 OBJECT_TYPE objectType
;
53 OBJECT_BASIC_INFORMATION objectInformation
;
55 USHORT entryNameLength
;
56 WCHAR entryName
[ANYSIZE_ARRAY
];
62 USHORT typeNameLength
;
63 WCHAR typeName
[ANYSIZE_ARRAY
];
66 struct NtPidlSymlinkData
68 USHORT targetNameLength
;
69 WCHAR targetName
[ANYSIZE_ARRAY
];
77 REG_ENTRY_VALUE_WITH_CONTENT
80 extern const LPCWSTR RegistryTypeNames
[];
85 USHORT magic
; // 0x5364 ~~~ "REGK"
87 REG_ENTRY_TYPE entryType
;
89 USHORT entryNameLength
;
91 // For Value entries, this contains the value contents, if it's resonably small.
92 // For Key entries, this contains the custom class name
94 USHORT contentsLength
;
103 HRESULT
EnumerateNtDirectory(HDPA hdpa
, PCWSTR path
, UINT
* hdpaCount
);
104 HRESULT
EnumerateRegistryKey(HDPA hdpa
, PCWSTR path
, HKEY root
, UINT
* hdpaCount
);