Start source tree (final, I hope!) restructuration. Part 1/X
[reactos.git] / reactos / base / shell / shellext / ntobjshex / ntobjutil.h
1 /*
2 * Copyright 2004 Martin Fuchs
3 *
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.
8 *
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.
13 *
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
17 */
18
19 extern "C" {
20 #define NTOS_MODE_USER
21 #include <ndk/ntndk.h>
22 #include <ndk/rtlfuncs.h>
23 }
24
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.
27 enum OBJECT_TYPE {
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,
34
35 UNKNOWN_OBJECT_TYPE = -1
36 };
37 extern const LPCWSTR ObjectTypeNames[];
38
39 #define NT_OBJECT_PIDL_MAGIC (USHORT)0x9A03
40 #define REGISTRY_PIDL_MAGIC (USHORT)0x5364
41
42 #include <pshpack1.h>
43
44 // NT OBJECT browser
45 struct NtPidlEntry
46 {
47 USHORT cb;
48 USHORT magic; // 0x9A03 ~~~ "NTOB"
49
50 // If this is -1, there will be a NtPidlTypeData following this, and before any other extensions
51 OBJECT_TYPE objectType;
52
53 OBJECT_BASIC_INFORMATION objectInformation;
54
55 USHORT entryNameLength;
56 WCHAR entryName[ANYSIZE_ARRAY];
57
58 };
59
60 struct NtPidlTypeData
61 {
62 USHORT typeNameLength;
63 WCHAR typeName[ANYSIZE_ARRAY];
64 };
65
66 struct NtPidlSymlinkData
67 {
68 USHORT targetNameLength;
69 WCHAR targetName[ANYSIZE_ARRAY];
70 };
71
72 // REGISTRY browser
73 enum REG_ENTRY_TYPE
74 {
75 REG_ENTRY_KEY,
76 REG_ENTRY_VALUE,
77 REG_ENTRY_VALUE_WITH_CONTENT
78 // any more?
79 };
80 extern const LPCWSTR RegistryTypeNames [];
81
82 struct RegPidlEntry
83 {
84 USHORT cb;
85 USHORT magic; // 0x5364 ~~~ "REGK"
86
87 REG_ENTRY_TYPE entryType;
88
89 USHORT entryNameLength;
90
91 // For Value entries, this contains the value contents, if it's resonably small.
92 // For Key entries, this contains the custom class name
93 DWORD contentType;
94 USHORT contentsLength;
95
96 WCHAR entryName[0];
97
98 };
99
100
101 #include <poppack.h>
102
103 HRESULT EnumerateNtDirectory(HDPA hdpa, PCWSTR path, UINT * hdpaCount);
104 HRESULT EnumerateRegistryKey(HDPA hdpa, PCWSTR path, HKEY root, UINT * hdpaCount);