diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index 7c87b904e58..63e331ad22c 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -1,4 +1,4 @@ -; $Id: ntdll.def,v 1.76 2001/06/17 22:53:14 ekohl Exp $ +; $Id: ntdll.def,v 1.77 2001/06/18 18:37:12 ekohl Exp $ ; ; ReactOS Operating System ; @@ -491,7 +491,7 @@ RtlNumberOfSetBits@4 RtlOemStringToUnicodeSize@4 RtlOemStringToUnicodeString@12 RtlOemToUnicodeN@20 -;RtlOpenCurrentUser +RtlOpenCurrentUser@8 ;RtlPcToFileHeader RtlPinAtomInAtomTable@8 RtlPrefixString@12 diff --git a/reactos/lib/ntdll/def/ntdll.edf b/reactos/lib/ntdll/def/ntdll.edf index 9081e27809d..19e2488e719 100644 --- a/reactos/lib/ntdll/def/ntdll.edf +++ b/reactos/lib/ntdll/def/ntdll.edf @@ -1,4 +1,4 @@ -; $Id: ntdll.edf,v 1.65 2001/06/17 22:53:14 ekohl Exp $ +; $Id: ntdll.edf,v 1.66 2001/06/18 18:37:12 ekohl Exp $ ; ; ReactOS Operating System ; @@ -490,7 +490,7 @@ RtlNumberOfSetBits=RtlNumberOfSetBits@4 RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4 RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12 RtlOemToUnicodeN=RtlOemToUnicodeN@20 -;RtlOpenCurrentUser +RtlOpenCurrentUser=RtlOpenCurrentUser@8 ;RtlPcToFileHeader RtlPinAtomInAtomTable=RtlPinAtomInAtomTable@8 RtlPrefixString=RtlPrefixString@12 diff --git a/reactos/lib/ntdll/rtl/registry.c b/reactos/lib/ntdll/rtl/registry.c index 673217432ee..8f8f0db4dc7 100644 --- a/reactos/lib/ntdll/rtl/registry.c +++ b/reactos/lib/ntdll/rtl/registry.c @@ -1,4 +1,4 @@ -/* $Id: registry.c,v 1.4 2001/06/17 22:53:57 ekohl Exp $ +/* $Id: registry.c,v 1.5 2001/06/18 18:36:32 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -100,18 +100,51 @@ RtlDeleteRegistryValue(IN ULONG RelativeTo, NTSTATUS STDCALL RtlFormatCurrentUserKeyPath(PUNICODE_STRING KeyPath) { + /* FIXME: !!! */ RtlCreateUnicodeString(KeyPath, L"\\Registry\\User\\.Default"); return STATUS_SUCCESS; } -/* -NTSTATUS STDCALL -RtlOpenCurrentUser(...) -{ +NTSTATUS STDCALL +RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess, + OUT PHANDLE KeyHandle) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyPath; + NTSTATUS Status; + + Status = RtlFormatCurrentUserKeyPath(&KeyPath); + if (NT_SUCCESS(Status)) + { + InitializeObjectAttributes(&ObjectAttributes, + &KeyPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtOpenKey(KeyHandle, + DesiredAccess, + &ObjectAttributes); + RtlFreeUnicodeString(&KeyPath); + if (NT_SUCCESS(Status)) + return STATUS_SUCCESS; + } + + RtlInitUnicodeString(&KeyPath, + L"\\Registry\\User\\.Default"); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtOpenKey(KeyHandle, + DesiredAccess, + &ObjectAttributes); + return(Status); } -*/ + NTSTATUS STDCALL RtlQueryRegistryValues(IN ULONG RelativeTo, diff --git a/reactos/ntoskrnl/cm/rtlfunc.c b/reactos/ntoskrnl/cm/rtlfunc.c index 5f0fe2ce994..1d6a607d1e7 100644 --- a/reactos/ntoskrnl/cm/rtlfunc.c +++ b/reactos/ntoskrnl/cm/rtlfunc.c @@ -28,12 +28,9 @@ RtlCheckRegistryKey(IN ULONG RelativeTo, } -NTSTATUS -STDCALL -RtlCreateRegistryKey ( - IN ULONG RelativeTo, - IN PWSTR Path - ) +NTSTATUS STDCALL +RtlCreateRegistryKey(IN ULONG RelativeTo, + IN PWSTR Path) { HANDLE KeyHandle; NTSTATUS Status; @@ -51,13 +48,10 @@ RtlCreateRegistryKey ( } -NTSTATUS -STDCALL -RtlDeleteRegistryValue ( - IN ULONG RelativeTo, - IN PWSTR Path, - IN PWSTR ValueName - ) +NTSTATUS STDCALL +RtlDeleteRegistryValue(IN ULONG RelativeTo, + IN PWSTR Path, + IN PWSTR ValueName) { HANDLE KeyHandle; NTSTATUS Status; @@ -82,30 +76,63 @@ RtlDeleteRegistryValue ( } -NTSTATUS -STDCALL -RtlQueryRegistryValues ( - IN ULONG RelativeTo, - IN PWSTR Path, - IN PRTL_QUERY_REGISTRY_TABLE QueryTable, - IN PVOID Context, - IN PVOID Environment - ) +NTSTATUS STDCALL +RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess, + OUT PHANDLE KeyHandle) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyPath; + NTSTATUS Status; + + Status = RtlFormatCurrentUserKeyPath(&KeyPath); + if (NT_SUCCESS(Status)) + { + InitializeObjectAttributes(&ObjectAttributes, + &KeyPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtOpenKey(KeyHandle, + DesiredAccess, + &ObjectAttributes); + RtlFreeUnicodeString(&KeyPath); + if (NT_SUCCESS(Status)) + return STATUS_SUCCESS; + } + + RtlInitUnicodeString(&KeyPath, + L"\\Registry\\User\\.Default"); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtOpenKey(KeyHandle, + DesiredAccess, + &ObjectAttributes); + return(Status); +} + + +NTSTATUS STDCALL +RtlQueryRegistryValues(IN ULONG RelativeTo, + IN PWSTR Path, + IN PRTL_QUERY_REGISTRY_TABLE QueryTable, + IN PVOID Context, + IN PVOID Environment) { UNIMPLEMENTED; } -NTSTATUS -STDCALL -RtlWriteRegistryValue ( - IN ULONG RelativeTo, - IN PWSTR Path, - IN PWSTR ValueName, - IN ULONG ValueType, - IN PVOID ValueData, - IN ULONG ValueLength - ) +NTSTATUS STDCALL +RtlWriteRegistryValue(IN ULONG RelativeTo, + IN PWSTR Path, + IN PWSTR ValueName, + IN ULONG ValueType, + IN PVOID ValueData, + IN ULONG ValueLength) { HANDLE KeyHandle; NTSTATUS Status; @@ -136,7 +163,11 @@ RtlWriteRegistryValue ( NTSTATUS STDCALL RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath) { - return STATUS_UNSUCCESSFUL; + /* FIXME: !!! */ + RtlCreateUnicodeString(KeyPath, + L"\\Registry\\User\\.Default"); + + return STATUS_SUCCESS; } /* ------------------------------------------ Private Implementation */