ReactOS 0.4.15-dev-7889-g76290a6
ntobjenum.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for ntobjenum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NtPidlEntry
 
struct  NtPidlTypeData
 
struct  RegPidlEntry
 

Macros

#define NT_OBJECT_PIDL_MAGIC   (USHORT)0x9A03
 
#define REGISTRY_PIDL_MAGIC   (USHORT)0x5364
 

Enumerations

enum  OBJECT_TYPE {
  DIRECTORY_OBJECT , SYMBOLICLINK_OBJECT , MUTANT_OBJECT , SECTION_OBJECT ,
  EVENT_OBJECT , SEMAPHORE_OBJECT , TIMER_OBJECT , KEY_OBJECT ,
  EVENTPAIR_OBJECT , IOCOMPLETION_OBJECT , DEVICE_OBJECT , FILE_OBJECT ,
  CONTROLLER_OBJECT , PROFILE_OBJECT , TYPE_OBJECT , DESKTOP_OBJECT ,
  WINDOWSTATION_OBJECT , DRIVER_OBJECT , TOKEN_OBJECT , PROCESS_OBJECT ,
  THREAD_OBJECT , ADAPTER_OBJECT , PORT_OBJECT , UNKNOWN_OBJECT_TYPE = -1 ,
  DIRECTORY_OBJECT , SYMBOLICLINK_OBJECT , MUTANT_OBJECT , SECTION_OBJECT ,
  EVENT_OBJECT , SEMAPHORE_OBJECT , TIMER_OBJECT , KEY_OBJECT ,
  EVENTPAIR_OBJECT , IOCOMPLETITION_OBJECT , DEVICE_OBJECT , FILE_OBJECT ,
  CONTROLLER_OBJECT , PROFILE_OBJECT , TYPE_OBJECT , DESKTOP_OBJECT ,
  WINDOWSTATION_OBJECT , DRIVER_OBJECT , TOKEN_OBJECT , PROCESS_OBJECT ,
  THREAD_OBJECT , ADAPTER_OBJECT , PORT_OBJECT , UNKNOWN_OBJECT_TYPE =-1
}
 
enum  REG_ENTRY_TYPE { REG_ENTRY_ROOT , REG_ENTRY_KEY , REG_ENTRY_VALUE , REG_ENTRY_VALUE_WITH_CONTENT }
 

Functions

HRESULT ReadRegistryValue (HKEY root, PCWSTR path, PCWSTR valueName, PVOID *valueData, PDWORD valueLength)
 
HRESULT GetEnumRegistryRoot (IEnumIDList **ppil)
 
HRESULT GetEnumRegistryKey (LPCWSTR path, HKEY root, IEnumIDList **ppil)
 
HRESULT GetEnumNTDirectory (LPCWSTR path, IEnumIDList **ppil)
 
HRESULT GetNTObjectSymbolicLinkTarget (LPCWSTR path, LPCWSTR entryName, PUNICODE_STRING LinkTarget)
 

Variables

const LPCWSTR ObjectTypeNames []
 
const LPCWSTR RegistryTypeNames []
 

Macro Definition Documentation

◆ NT_OBJECT_PIDL_MAGIC

#define NT_OBJECT_PIDL_MAGIC   (USHORT)0x9A03

Definition at line 25 of file ntobjenum.h.

◆ REGISTRY_PIDL_MAGIC

#define REGISTRY_PIDL_MAGIC   (USHORT)0x5364

Definition at line 26 of file ntobjenum.h.

Enumeration Type Documentation

◆ OBJECT_TYPE

Enumerator
DIRECTORY_OBJECT 
SYMBOLICLINK_OBJECT 
MUTANT_OBJECT 
SECTION_OBJECT 
EVENT_OBJECT 
SEMAPHORE_OBJECT 
TIMER_OBJECT 
KEY_OBJECT 
EVENTPAIR_OBJECT 
IOCOMPLETION_OBJECT 
DEVICE_OBJECT 
FILE_OBJECT 
CONTROLLER_OBJECT 
PROFILE_OBJECT 
TYPE_OBJECT 
DESKTOP_OBJECT 
WINDOWSTATION_OBJECT 
DRIVER_OBJECT 
TOKEN_OBJECT 
PROCESS_OBJECT 
THREAD_OBJECT 
ADAPTER_OBJECT 
PORT_OBJECT 
UNKNOWN_OBJECT_TYPE 
DIRECTORY_OBJECT 
SYMBOLICLINK_OBJECT 
MUTANT_OBJECT 
SECTION_OBJECT 
EVENT_OBJECT 
SEMAPHORE_OBJECT 
TIMER_OBJECT 
KEY_OBJECT 
EVENTPAIR_OBJECT 
IOCOMPLETITION_OBJECT 
DEVICE_OBJECT 
FILE_OBJECT 
CONTROLLER_OBJECT 
PROFILE_OBJECT 
TYPE_OBJECT 
DESKTOP_OBJECT 
WINDOWSTATION_OBJECT 
DRIVER_OBJECT 
TOKEN_OBJECT 
PROCESS_OBJECT 
THREAD_OBJECT 
ADAPTER_OBJECT 
PORT_OBJECT 
UNKNOWN_OBJECT_TYPE 

Definition at line 13 of file ntobjenum.h.

13 {
20
22};
@ ADAPTER_OBJECT
Definition: ntobjenum.h:19
@ KEY_OBJECT
Definition: ntobjenum.h:16
@ TOKEN_OBJECT
Definition: ntobjenum.h:19
@ TYPE_OBJECT
Definition: ntobjenum.h:18
@ CONTROLLER_OBJECT
Definition: ntobjenum.h:17
@ MUTANT_OBJECT
Definition: ntobjenum.h:15
@ WINDOWSTATION_OBJECT
Definition: ntobjenum.h:18
@ EVENT_OBJECT
Definition: ntobjenum.h:15
@ SYMBOLICLINK_OBJECT
Definition: ntobjenum.h:14
@ FILE_OBJECT
Definition: ntobjenum.h:17
@ DESKTOP_OBJECT
Definition: ntobjenum.h:18
@ IOCOMPLETION_OBJECT
Definition: ntobjenum.h:16
@ SECTION_OBJECT
Definition: ntobjenum.h:15
@ DIRECTORY_OBJECT
Definition: ntobjenum.h:14
@ SEMAPHORE_OBJECT
Definition: ntobjenum.h:15
@ DRIVER_OBJECT
Definition: ntobjenum.h:18
@ DEVICE_OBJECT
Definition: ntobjenum.h:17
@ PROCESS_OBJECT
Definition: ntobjenum.h:19
@ PORT_OBJECT
Definition: ntobjenum.h:19
@ EVENTPAIR_OBJECT
Definition: ntobjenum.h:16
@ UNKNOWN_OBJECT_TYPE
Definition: ntobjenum.h:21
@ PROFILE_OBJECT
Definition: ntobjenum.h:17
@ THREAD_OBJECT
Definition: ntobjenum.h:19
@ TIMER_OBJECT
Definition: ntobjenum.h:16

◆ REG_ENTRY_TYPE

Enumerator
REG_ENTRY_ROOT 
REG_ENTRY_KEY 
REG_ENTRY_VALUE 
REG_ENTRY_VALUE_WITH_CONTENT 

Definition at line 50 of file ntobjenum.h.

51{
56 // any more?
57};
@ REG_ENTRY_KEY
Definition: ntobjenum.h:53
@ REG_ENTRY_VALUE_WITH_CONTENT
Definition: ntobjenum.h:55
@ REG_ENTRY_VALUE
Definition: ntobjenum.h:54
@ REG_ENTRY_ROOT
Definition: ntobjenum.h:52

Function Documentation

◆ GetEnumNTDirectory()

HRESULT GetEnumNTDirectory ( LPCWSTR  path,
IEnumIDList **  ppil 
)

Definition at line 737 of file ntobjenum.cpp.

738{
739 return ShellObjectCreatorInit<CEnumNTDirectory>(path, IID_PPV_ARG(IEnumIDList, ppil));
740}
#define IID_PPV_ARG(Itype, ppType)

Referenced by CNtObjectFolder::EnumObjects().

◆ GetEnumRegistryKey()

HRESULT GetEnumRegistryKey ( LPCWSTR  path,
HKEY  root,
IEnumIDList **  ppil 
)

Definition at line 732 of file ntobjenum.cpp.

733{
734 return ShellObjectCreatorInit<CEnumRegKey>(path, root, IID_PPV_ARG(IEnumIDList, ppil));
735}

Referenced by CRegistryFolder::EnumObjects().

◆ GetEnumRegistryRoot()

HRESULT GetEnumRegistryRoot ( IEnumIDList **  ppil)

Definition at line 727 of file ntobjenum.cpp.

728{
729 return ShellObjectCreator<CEnumRegRoot>(IID_PPV_ARG(IEnumIDList, ppil));
730}

Referenced by CRegistryFolder::EnumObjects().

◆ GetNTObjectSymbolicLinkTarget()

HRESULT GetNTObjectSymbolicLinkTarget ( LPCWSTR  path,
LPCWSTR  entryName,
PUNICODE_STRING  LinkTarget 
)

Definition at line 151 of file ntobjenum.cpp.

152{
155 LPWSTR pend = buffer;
156
157 StringCbCopyExW(buffer, sizeof(buffer), path, &pend, NULL, 0);
158
159 if (pend[-1] != '\\')
160 {
161 *pend++ = '\\';
162 *pend = 0;
163 }
164
165 StringCbCatW(buffer, sizeof(buffer), entryName);
166
167 DbgPrint("GetNTObjectSymbolicLinkTarget %d\n", buffer);
168
169 LinkTarget->Length = 0;
170
172 if (!NT_SUCCESS(err))
173 return HRESULT_FROM_NT(err);
174
176 if (!NT_SUCCESS(err))
177 return HRESULT_FROM_NT(err);
178
180
181 return S_OK;
182}
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint buffer
Definition: glext.h:5915
#define DbgPrint
Definition: hal.h:12
#define S_OK
Definition: intsafe.h:52
#define SYMBOLIC_LINK_QUERY
Definition: nt_native.h:1265
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
static DWORD NtOpenObject(OBJECT_TYPE type, PHANDLE phandle, DWORD access, LPCWSTR path)
Definition: ntobjenum.cpp:50
#define err(...)
STRSAFEAPI StringCbCopyExW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:210
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:342
#define HRESULT_FROM_NT(x)
Definition: winerror.h:94
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
_Inout_ PUNICODE_STRING LinkTarget
Definition: zwfuncs.h:292

Referenced by CNtObjectFolder::CompareIDs(), CNtObjectFolder::GetDetailsEx(), CNtObjectFolder::GetDetailsOf(), and CNtObjectFolder::ResolveSymLink().

◆ ReadRegistryValue()

HRESULT ReadRegistryValue ( HKEY  root,
PCWSTR  path,
PCWSTR  valueName,
PVOID valueData,
PDWORD  valueLength 
)

Definition at line 98 of file ntobjenum.cpp.

99{
100 HKEY hkey;
101
102 DWORD res;
103 if (root)
104 {
105 res = RegOpenKeyExW(root, *path == '\\' ? path + 1 : path, 0, STANDARD_RIGHTS_READ | KEY_QUERY_VALUE, &hkey);
106 }
107 else
108 {
110 }
111 if (!NT_SUCCESS(res))
112 {
113 ERR("RegOpenKeyExW failed for path %S with status=%x\n", path, res);
114 return HRESULT_FROM_NT(res);
115 }
116
117 res = RegQueryValueExW(hkey, valueName, NULL, NULL, NULL, valueLength);
118 if (!NT_SUCCESS(res))
119 {
120 ERR("RegQueryValueExW failed for path %S with status=%x\n", path, res);
121 return HRESULT_FROM_NT(res);
122 }
123
124 if (*valueLength > 0)
125 {
126 PBYTE data = (PBYTE) CoTaskMemAlloc(*valueLength);
127 *valueData = data;
128
129 res = RegQueryValueExW(hkey, valueName, NULL, NULL, data, valueLength);
130 if (!NT_SUCCESS(res))
131 {
133 *valueData = NULL;
134
135 RegCloseKey(hkey);
136
137 ERR("RegOpenKeyExW failed for path %S with status=%x\n", path, res);
138 return HRESULT_FROM_NT(res);
139 }
140 }
141 else
142 {
143 *valueData = NULL;
144 }
145
146 RegCloseKey(hkey);
147
148 return S_OK;
149}
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
BYTE * PBYTE
Definition: pedump.c:66

Variable Documentation

◆ ObjectTypeNames

const LPCWSTR ObjectTypeNames[]
extern

◆ RegistryTypeNames

const LPCWSTR RegistryTypeNames[]
extern

Definition at line 35 of file ntobjenum.cpp.

Referenced by CRegistryFolder::GetDetailsEx(), and CRegistryFolder::GetDetailsOf().