mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
added RTL registry routines
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3344 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -94,7 +94,7 @@ VOID PhHandleInfoInitialization()
|
||||
|
||||
if (stringSid)
|
||||
{
|
||||
HkcuPrefix = PhConcatStrings2(L"\\REGISTRY\\USER\\", stringSid->Buffer);
|
||||
HkcuPrefix = PhConcatStrings2(L"\\Registry\\User\\", stringSid->Buffer);
|
||||
HkcucrPrefix = PhConcatStrings2(HkcuPrefix->Buffer, L"_Classes");
|
||||
}
|
||||
else
|
||||
@@ -355,11 +355,11 @@ PPH_STRING PhFormatNativeKeyName(
|
||||
__in PPH_STRING Name
|
||||
)
|
||||
{
|
||||
#define HKLM_PREFIX L"\\REGISTRY\\MACHINE"
|
||||
#define HKLM_PREFIX L"\\Registry\\Machine"
|
||||
#define HKLM_PREFIX_LENGTH 17
|
||||
#define HKCR_PREFIX L"\\REGISTRY\\MACHINE\\SOFTWARE\\CLASSES"
|
||||
#define HKCR_PREFIX L"\\Registry\\Machine\\Software\\Classes"
|
||||
#define HKCR_PREFIX_LENGTH 34
|
||||
#define HKU_PREFIX L"\\REGISTRY\\USER"
|
||||
#define HKU_PREFIX L"\\Registry\\User"
|
||||
#define HKU_PREFIX_LENGTH 14
|
||||
|
||||
PPH_STRING newName;
|
||||
|
||||
@@ -4017,6 +4017,102 @@ RtlDeleteTimerQueueEx(
|
||||
__in HANDLE Event
|
||||
);
|
||||
|
||||
// Registry access
|
||||
|
||||
// begin_wdm
|
||||
|
||||
#define RTL_REGISTRY_ABSOLUTE 0
|
||||
#define RTL_REGISTRY_SERVICES 1 // \Registry\Machine\System\CurrentControlSet\Services
|
||||
#define RTL_REGISTRY_CONTROL 2 // \Registry\Machine\System\CurrentControlSet\Control
|
||||
#define RTL_REGISTRY_WINDOWS_NT 3 // \Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion
|
||||
#define RTL_REGISTRY_DEVICEMAP 4 // \Registry\Machine\Hardware\DeviceMap
|
||||
#define RTL_REGISTRY_USER 5 // \Registry\User\CurrentUser
|
||||
#define RTL_REGISTRY_MAXIMUM 6
|
||||
#define RTL_REGISTRY_HANDLE 0x40000000
|
||||
#define RTL_REGISTRY_OPTIONAL 0x80000000
|
||||
|
||||
// end_wdm
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlCreateRegistryKey(
|
||||
__in ULONG RelativeTo,
|
||||
__in PWSTR Path
|
||||
);
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlCheckRegistryKey(
|
||||
__in ULONG RelativeTo,
|
||||
__in PWSTR Path
|
||||
);
|
||||
|
||||
// begin_wdm
|
||||
|
||||
typedef NTSTATUS (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
|
||||
__in PWSTR ValueName,
|
||||
__in ULONG ValueType,
|
||||
__in PVOID ValueData,
|
||||
__in ULONG ValueLength,
|
||||
__in PVOID Context,
|
||||
__in PVOID EntryContext
|
||||
);
|
||||
|
||||
typedef struct _RTL_QUERY_REGISTRY_TABLE
|
||||
{
|
||||
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
|
||||
ULONG Flags;
|
||||
PWSTR Name;
|
||||
PVOID EntryContext;
|
||||
ULONG DefaultType;
|
||||
PVOID DefaultData;
|
||||
ULONG DefaultLength;
|
||||
} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
|
||||
|
||||
#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
|
||||
#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
|
||||
#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
|
||||
#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
|
||||
#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
|
||||
#define RTL_QUERY_REGISTRY_DIRECT 0x00000020
|
||||
#define RTL_QUERY_REGISTRY_DELETE 0x00000040
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlQueryRegistryValues(
|
||||
__in ULONG RelativeTo,
|
||||
__in PWSTR Path,
|
||||
__in PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||
__in PVOID Context,
|
||||
__in_opt PVOID Environment
|
||||
);
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlWriteRegistryValue(
|
||||
__in ULONG RelativeTo,
|
||||
__in PWSTR Path,
|
||||
__in PWSTR ValueName,
|
||||
__in ULONG ValueType,
|
||||
__in PVOID ValueData,
|
||||
__in ULONG ValueLength
|
||||
);
|
||||
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlDeleteRegistryValue(
|
||||
__in ULONG RelativeTo,
|
||||
__in PWSTR Path,
|
||||
__in PWSTR ValueName
|
||||
);
|
||||
|
||||
// end_wdm
|
||||
|
||||
// Misc.
|
||||
|
||||
NTSYSAPI
|
||||
|
||||
@@ -3801,7 +3801,7 @@ NTSTATUS PhpUnloadDriver(
|
||||
|
||||
if ((win32Result = RegCreateKey(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
L"SYSTEM\\CurrentControlSet\\Services",
|
||||
L"System\\CurrentControlSet\\Services",
|
||||
&servicesKeyHandle
|
||||
)) != ERROR_SUCCESS)
|
||||
{
|
||||
@@ -3842,7 +3842,7 @@ NTSTATUS PhpUnloadDriver(
|
||||
}
|
||||
|
||||
servicePath = PhConcatStrings2(
|
||||
L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Services\\",
|
||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\",
|
||||
ServiceKeyName->Buffer
|
||||
);
|
||||
status = NtUnloadDriver(&servicePath->us);
|
||||
|
||||
Reference in New Issue
Block a user