Implement the Rtlp* registry functions.
This commit is contained in:
parent
f752be843e
commit
03ce33f629
|
@ -80,7 +80,7 @@
|
||||||
@ stub NtCreateEventPair
|
@ stub NtCreateEventPair
|
||||||
@ stdcall NtCreateFile(ptr long ptr ptr long long long ptr long long ptr)
|
@ stdcall NtCreateFile(ptr long ptr ptr long long long ptr long long ptr)
|
||||||
@ stub NtCreateIoCompletion
|
@ stub NtCreateIoCompletion
|
||||||
@ stdcall NtCreateKey(long long long long long long long)
|
@ stdcall NtCreateKey(ptr long ptr long ptr long long)
|
||||||
@ stdcall NtCreateMailslotFile(long long long long long long long long)
|
@ stdcall NtCreateMailslotFile(long long long long long long long long)
|
||||||
@ stub NtCreateMutant
|
@ stub NtCreateMutant
|
||||||
@ stub NtCreateNamedPipeFile
|
@ stub NtCreateNamedPipeFile
|
||||||
|
@ -579,12 +579,12 @@
|
||||||
@ stub RtlZeroHeap
|
@ stub RtlZeroHeap
|
||||||
@ stdcall RtlZeroMemory(ptr long)
|
@ stdcall RtlZeroMemory(ptr long)
|
||||||
@ stub RtlpInitializeRtl
|
@ stub RtlpInitializeRtl
|
||||||
@ stub RtlpNtCreateKey
|
@ stdcall RtlpNtCreateKey(ptr long ptr long ptr long long)
|
||||||
@ stub RtlpNtEnumerateSubKey
|
@ stdcall RtlpNtEnumerateSubKey(ptr ptr long)
|
||||||
@ stub RtlpNtMakeTemporaryKey
|
@ stdcall RtlpNtMakeTemporaryKey(ptr)
|
||||||
@ stub RtlpNtOpenKey
|
@ stdcall RtlpNtOpenKey(ptr long ptr)
|
||||||
@ stub RtlpNtQueryValueKey
|
@ stdcall RtlpNtQueryValueKey(long ptr ptr ptr)
|
||||||
@ stub RtlpNtSetValueKey
|
@ stdcall RtlpNtSetValueKey(ptr long ptr long)
|
||||||
@ stdcall RtlpUnWaitCriticalSection(ptr)
|
@ stdcall RtlpUnWaitCriticalSection(ptr)
|
||||||
@ stdcall RtlpWaitForCriticalSection(ptr)
|
@ stdcall RtlpWaitForCriticalSection(ptr)
|
||||||
@ stdcall RtlxAnsiStringToUnicodeSize(ptr) RtlAnsiStringToUnicodeSize
|
@ stdcall RtlxAnsiStringToUnicodeSize(ptr) RtlAnsiStringToUnicodeSize
|
||||||
|
@ -616,7 +616,7 @@
|
||||||
@ stub ZwCreateEventPair
|
@ stub ZwCreateEventPair
|
||||||
@ stdcall ZwCreateFile(ptr long ptr ptr long long long ptr long long ptr) NtCreateFile
|
@ stdcall ZwCreateFile(ptr long ptr ptr long long long ptr long long ptr) NtCreateFile
|
||||||
@ stub ZwCreateIoCompletion
|
@ stub ZwCreateIoCompletion
|
||||||
@ stdcall ZwCreateKey(long long long long long long long) NtCreateKey
|
@ stdcall ZwCreateKey(ptr long ptr long ptr long long) NtCreateKey
|
||||||
@ stdcall ZwCreateMailslotFile(long long long long long long long long) NtCreateMailslotFile
|
@ stdcall ZwCreateMailslotFile(long long long long long long long long) NtCreateMailslotFile
|
||||||
@ stub ZwCreateMutant
|
@ stub ZwCreateMutant
|
||||||
@ stub ZwCreateNamedPipeFile
|
@ stub ZwCreateNamedPipeFile
|
||||||
|
|
129
dlls/ntdll/reg.c
129
dlls/ntdll/reg.c
|
@ -85,6 +85,20 @@ NTSTATUS WINAPI NtCreateKey( PHKEY retkey, ACCESS_MASK access, const OBJECT_ATTR
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* RtlpNtCreateKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
* See NtCreateKey.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlpNtCreateKey( PHKEY retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr,
|
||||||
|
ULONG TitleIndex, const UNICODE_STRING *class, ULONG options,
|
||||||
|
PULONG dispos )
|
||||||
|
{
|
||||||
|
if (attr)
|
||||||
|
attr->Attributes &= ~(OBJ_PERMANENT|OBJ_EXCLUSIVE);
|
||||||
|
|
||||||
|
return NtCreateKey(retkey, access, attr, 0, NULL, 0, dispos);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtOpenKey [NTDLL.@]
|
* NtOpenKey [NTDLL.@]
|
||||||
|
@ -118,6 +132,17 @@ NTSTATUS WINAPI NtOpenKey( PHKEY retkey, ACCESS_MASK access, const OBJECT_ATTRIB
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* RtlpNtOpenKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
* See NtOpenKey.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlpNtOpenKey( PHKEY retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr )
|
||||||
|
{
|
||||||
|
if (attr)
|
||||||
|
attr->Attributes &= ~(OBJ_PERMANENT|OBJ_EXCLUSIVE);
|
||||||
|
return NtOpenKey(retkey, access, attr);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtDeleteKey [NTDLL.@]
|
* NtDeleteKey [NTDLL.@]
|
||||||
|
@ -138,6 +163,15 @@ NTSTATUS WINAPI NtDeleteKey( HKEY hkey )
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* RtlpNtMakeTemporaryKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
* See NtDeleteKey.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlpNtMakeTemporaryKey( HKEY hkey )
|
||||||
|
{
|
||||||
|
return NtDeleteKey(hkey);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtDeleteValueKey [NTDLL.@]
|
* NtDeleteValueKey [NTDLL.@]
|
||||||
|
@ -265,6 +299,53 @@ NTSTATUS WINAPI NtEnumerateKey( HKEY handle, ULONG index, KEY_INFORMATION_CLASS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* RtlpNtEnumerateSubKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlpNtEnumerateSubKey( HKEY handle, UNICODE_STRING *out, ULONG index )
|
||||||
|
{
|
||||||
|
KEY_BASIC_INFORMATION *info;
|
||||||
|
DWORD dwLen, dwResultLen;
|
||||||
|
NTSTATUS ret;
|
||||||
|
|
||||||
|
if (out->Length)
|
||||||
|
{
|
||||||
|
dwLen = out->Length + sizeof(KEY_BASIC_INFORMATION);
|
||||||
|
info = (KEY_BASIC_INFORMATION*)RtlAllocateHeap( ntdll_get_process_heap(), 0, dwLen );
|
||||||
|
if (!info)
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dwLen = 0;
|
||||||
|
info = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = NtEnumerateKey( handle, index, KeyBasicInformation, info, dwLen, &dwResultLen );
|
||||||
|
dwResultLen -= sizeof(KEY_BASIC_INFORMATION);
|
||||||
|
|
||||||
|
if (ret == STATUS_BUFFER_OVERFLOW)
|
||||||
|
out->Length = dwResultLen;
|
||||||
|
else if (!ret)
|
||||||
|
{
|
||||||
|
if (out->Length < info->NameLength)
|
||||||
|
{
|
||||||
|
out->Length = dwResultLen;
|
||||||
|
ret = STATUS_BUFFER_OVERFLOW;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out->Length = info->NameLength;
|
||||||
|
memcpy(out->Buffer, info->Name, info->NameLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info)
|
||||||
|
RtlFreeHeap( ntdll_get_process_heap(), 0, info );
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtQueryKey [NTDLL.@]
|
* NtQueryKey [NTDLL.@]
|
||||||
* ZwQueryKey [NTDLL.@]
|
* ZwQueryKey [NTDLL.@]
|
||||||
|
@ -421,6 +502,41 @@ NTSTATUS WINAPI NtQueryValueKey( HKEY handle, const UNICODE_STRING *name,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* RtlpNtQueryValueKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlpNtQueryValueKey( HKEY handle, ULONG *result_type, PBYTE dest,
|
||||||
|
DWORD *result_len )
|
||||||
|
{
|
||||||
|
KEY_VALUE_PARTIAL_INFORMATION *info;
|
||||||
|
UNICODE_STRING name;
|
||||||
|
NTSTATUS ret;
|
||||||
|
DWORD dwResultLen;
|
||||||
|
DWORD dwLen = sizeof (KEY_VALUE_PARTIAL_INFORMATION) + result_len ? *result_len : 0;
|
||||||
|
|
||||||
|
info = (KEY_VALUE_PARTIAL_INFORMATION*)RtlAllocateHeap( ntdll_get_process_heap(), 0, dwLen );
|
||||||
|
if (!info)
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
|
name.Length = 0;
|
||||||
|
ret = NtQueryValueKey( handle, &name, KeyValuePartialInformation, info, dwLen, &dwResultLen );
|
||||||
|
|
||||||
|
if (!ret || ret == STATUS_BUFFER_OVERFLOW)
|
||||||
|
{
|
||||||
|
if (result_len)
|
||||||
|
*result_len = info->DataLength;
|
||||||
|
|
||||||
|
if (result_type)
|
||||||
|
*result_type = info->Type;
|
||||||
|
|
||||||
|
if (ret != STATUS_BUFFER_OVERFLOW)
|
||||||
|
memcpy( dest, info->Data, info->DataLength );
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlFreeHeap( ntdll_get_process_heap(), 0, info );
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtFlushKey [NTDLL.@]
|
* NtFlushKey [NTDLL.@]
|
||||||
|
@ -571,6 +687,19 @@ NTSTATUS WINAPI NtSetValueKey( HKEY hkey, const UNICODE_STRING *name, ULONG Titl
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* RtlpNtSetValueKey [NTDLL.@]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlpNtSetValueKey( HKEY hkey, ULONG type, const void *data,
|
||||||
|
ULONG count )
|
||||||
|
{
|
||||||
|
UNICODE_STRING name;
|
||||||
|
|
||||||
|
name.Length = 0;
|
||||||
|
return NtSetValueKey( hkey, &name, 0, type, data, count );
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtUnloadKey [NTDLL.@]
|
* NtUnloadKey [NTDLL.@]
|
||||||
* ZwUnloadKey [NTDLL.@]
|
* ZwUnloadKey [NTDLL.@]
|
||||||
|
|
Loading…
Reference in New Issue