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
21 // All the possible values are defined here because I want the type field to be
22 // "persistable" and not change if more types are added in the future.
24 DIRECTORY_OBJECT
, SYMBOLICLINK_OBJECT
,
25 MUTANT_OBJECT
, SECTION_OBJECT
, EVENT_OBJECT
, SEMAPHORE_OBJECT
,
26 TIMER_OBJECT
, KEY_OBJECT
, EVENTPAIR_OBJECT
, IOCOMPLETION_OBJECT
,
27 DEVICE_OBJECT
, FILE_OBJECT
, CONTROLLER_OBJECT
, PROFILE_OBJECT
,
28 TYPE_OBJECT
, DESKTOP_OBJECT
, WINDOWSTATION_OBJECT
, DRIVER_OBJECT
,
29 TOKEN_OBJECT
, PROCESS_OBJECT
, THREAD_OBJECT
, ADAPTER_OBJECT
, PORT_OBJECT
,
31 UNKNOWN_OBJECT_TYPE
= -1
33 extern const LPCWSTR ObjectTypeNames
[];
35 #define NT_OBJECT_PIDL_MAGIC (USHORT)0x9A03
36 #define REGISTRY_PIDL_MAGIC (USHORT)0x5364
44 USHORT magic
; // 0x9A03 ~~~ "NTOB"
46 // If this is -1, there will be a NtPidlTypeData following this, and before any other extensions
47 OBJECT_TYPE objectType
;
49 USHORT entryNameLength
;
50 WCHAR entryName
[ANYSIZE_ARRAY
];
55 USHORT typeNameLength
;
56 WCHAR typeName
[ANYSIZE_ARRAY
];
65 REG_ENTRY_VALUE_WITH_CONTENT
68 extern const LPCWSTR RegistryTypeNames
[];
73 USHORT magic
; // 0x5364 ~~~ "REGK"
75 REG_ENTRY_TYPE entryType
;
77 USHORT entryNameLength
;
81 // For Value entries, this contains the value contents, if it's reasonably small.
82 // For Key entries, this contains the custom class name
84 USHORT contentsLength
;
90 WCHAR entryName
[ANYSIZE_ARRAY
];
97 HRESULT
ReadRegistryValue(HKEY root
, PCWSTR path
, PCWSTR valueName
, PVOID
* valueData
, PDWORD valueLength
);
99 HRESULT
GetEnumRegistryRoot(IEnumIDList
** ppil
);
100 HRESULT
GetEnumRegistryKey(LPCWSTR path
, HKEY root
, IEnumIDList
** ppil
);
101 HRESULT
GetEnumNTDirectory(LPCWSTR path
, IEnumIDList
** ppil
);
103 HRESULT
GetNTObjectSymbolicLinkTarget(LPCWSTR path
, LPCWSTR entryName
, PUNICODE_STRING LinkTarget
);