ntdll: Implement RtlCreateRegistryKey.
Signed-off-by: Stefan Leichter <sle85276@gmx.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f07e8ca8f0
commit
535419a2bf
@ -509,7 +509,7 @@
|
|||||||
@ stdcall RtlCreateProcessParameters(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
|
@ stdcall RtlCreateProcessParameters(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
|
||||||
@ stub RtlCreatePropertySet
|
@ stub RtlCreatePropertySet
|
||||||
@ stdcall RtlCreateQueryDebugBuffer(long long)
|
@ stdcall RtlCreateQueryDebugBuffer(long long)
|
||||||
@ stub RtlCreateRegistryKey
|
@ stdcall RtlCreateRegistryKey(long wstr)
|
||||||
@ stdcall RtlCreateSecurityDescriptor(ptr long)
|
@ stdcall RtlCreateSecurityDescriptor(ptr long)
|
||||||
# @ stub RtlCreateSystemVolumeInformationFolder
|
# @ stub RtlCreateSystemVolumeInformationFolder
|
||||||
@ stub RtlCreateTagHeap
|
@ stub RtlCreateTagHeap
|
||||||
|
@ -1133,13 +1133,10 @@ static NTSTATUS RTL_ReportRegistryValue(PKEY_VALUE_FULL_INFORMATION pInfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle)
|
static NTSTATUS RTL_KeyHandleCreateObject(ULONG RelativeTo, PCWSTR Path, POBJECT_ATTRIBUTES regkey, PUNICODE_STRING str)
|
||||||
{
|
{
|
||||||
UNICODE_STRING KeyString;
|
|
||||||
OBJECT_ATTRIBUTES regkey;
|
|
||||||
PCWSTR base;
|
PCWSTR base;
|
||||||
INT len;
|
INT len;
|
||||||
NTSTATUS status;
|
|
||||||
|
|
||||||
static const WCHAR empty[] = {0};
|
static const WCHAR empty[] = {0};
|
||||||
static const WCHAR control[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e',
|
static const WCHAR control[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e',
|
||||||
@ -1191,17 +1188,30 @@ static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
len = (strlenW(base) + strlenW(Path) + 1) * sizeof(WCHAR);
|
len = (strlenW(base) + strlenW(Path) + 1) * sizeof(WCHAR);
|
||||||
KeyString.Buffer = RtlAllocateHeap(GetProcessHeap(), 0, len);
|
str->Buffer = RtlAllocateHeap(GetProcessHeap(), 0, len);
|
||||||
if (KeyString.Buffer == NULL)
|
if (str->Buffer == NULL)
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
strcpyW(KeyString.Buffer, base);
|
strcpyW(str->Buffer, base);
|
||||||
strcatW(KeyString.Buffer, Path);
|
strcatW(str->Buffer, Path);
|
||||||
KeyString.Length = len - sizeof(WCHAR);
|
str->Length = len - sizeof(WCHAR);
|
||||||
KeyString.MaximumLength = len;
|
str->MaximumLength = len;
|
||||||
InitializeObjectAttributes(®key, &KeyString, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
InitializeObjectAttributes(regkey, str, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static NTSTATUS RTL_GetKeyHandle(ULONG RelativeTo, PCWSTR Path, PHANDLE handle)
|
||||||
|
{
|
||||||
|
OBJECT_ATTRIBUTES regkey;
|
||||||
|
UNICODE_STRING string;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
status = RTL_KeyHandleCreateObject(RelativeTo, Path, ®key, &string);
|
||||||
|
if(status != STATUS_SUCCESS)
|
||||||
|
return status;
|
||||||
|
|
||||||
status = NtOpenKey(handle, KEY_ALL_ACCESS, ®key);
|
status = NtOpenKey(handle, KEY_ALL_ACCESS, ®key);
|
||||||
RtlFreeHeap(GetProcessHeap(), 0, KeyString.Buffer);
|
RtlFreeUnicodeString( &string );
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1414,6 +1424,41 @@ NTSTATUS WINAPI RtlCheckRegistryKey(IN ULONG RelativeTo, IN PWSTR Path)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* RtlCreateRegistryKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
* Add a key to the registry given by absolute or relative path
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
* RelativeTo [I] Registry path that Path refers to
|
||||||
|
* path [I] Path to key
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* STATUS_SUCCESS or an appropriate NTSTATUS error code.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlCreateRegistryKey(ULONG RelativeTo, PWSTR path)
|
||||||
|
{
|
||||||
|
OBJECT_ATTRIBUTES regkey;
|
||||||
|
UNICODE_STRING string;
|
||||||
|
HANDLE handle;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
RelativeTo &= ~RTL_REGISTRY_OPTIONAL;
|
||||||
|
|
||||||
|
if (!RelativeTo && (path == NULL || path[0] == 0))
|
||||||
|
return STATUS_OBJECT_PATH_SYNTAX_BAD;
|
||||||
|
if (RelativeTo <= RTL_REGISTRY_USER && (path == NULL || path[0] == 0))
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
status = RTL_KeyHandleCreateObject(RelativeTo, path, ®key, &string);
|
||||||
|
if(status != STATUS_SUCCESS)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
status = NtCreateKey(&handle, KEY_ALL_ACCESS, ®key, 0, NULL, REG_OPTION_NON_VOLATILE, NULL);
|
||||||
|
if (handle) NtClose(handle);
|
||||||
|
RtlFreeUnicodeString( &string );
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* RtlDeleteRegistryValue [NTDLL.@]
|
* RtlDeleteRegistryValue [NTDLL.@]
|
||||||
*
|
*
|
||||||
|
@ -976,7 +976,7 @@
|
|||||||
@ stdcall RtlCreateAcl(ptr long long)
|
@ stdcall RtlCreateAcl(ptr long long)
|
||||||
@ stdcall RtlCreateAtomTable(long ptr)
|
@ stdcall RtlCreateAtomTable(long ptr)
|
||||||
@ stdcall RtlCreateHeap(long ptr long long ptr ptr)
|
@ stdcall RtlCreateHeap(long ptr long long ptr ptr)
|
||||||
@ stub RtlCreateRegistryKey
|
@ stdcall RtlCreateRegistryKey(long wstr)
|
||||||
@ stdcall RtlCreateSecurityDescriptor(ptr long)
|
@ stdcall RtlCreateSecurityDescriptor(ptr long)
|
||||||
@ stub RtlCreateSystemVolumeInformationFolder
|
@ stub RtlCreateSystemVolumeInformationFolder
|
||||||
@ stdcall RtlCreateUnicodeString(ptr wstr)
|
@ stdcall RtlCreateUnicodeString(ptr wstr)
|
||||||
|
@ -2517,6 +2517,7 @@ NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP);
|
|||||||
NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
|
NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP,ULONG,ULONG);
|
||||||
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
|
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE*,const void*);
|
||||||
NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
|
NTSYSAPI PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(ULONG,BOOLEAN);
|
||||||
|
NTSYSAPI NTSTATUS WINAPI RtlCreateRegistryKey(ULONG,PWSTR);
|
||||||
NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
|
NTSYSAPI ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
|
||||||
NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
|
NTSYSAPI LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
|
||||||
NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
|
NTSYSAPI LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user