-; $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
;
RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString@12
RtlOemToUnicodeN@20
-;RtlOpenCurrentUser
+RtlOpenCurrentUser@8
;RtlPcToFileHeader
RtlPinAtomInAtomTable@8
RtlPrefixString@12
-; $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
;
RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12
RtlOemToUnicodeN=RtlOemToUnicodeN@20
-;RtlOpenCurrentUser
+RtlOpenCurrentUser=RtlOpenCurrentUser@8
;RtlPcToFileHeader
RtlPinAtomInAtomTable=RtlPinAtomInAtomTable@8
RtlPrefixString=RtlPrefixString@12
-/* $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
NTSTATUS STDCALL
RtlFormatCurrentUserKeyPath(PUNICODE_STRING KeyPath)
{
+ /* FIXME: !!! */
RtlCreateUnicodeString(KeyPath,
L"\\Registry\\User\\.Default");
return STATUS_SUCCESS;
}
-/*
+
NTSTATUS STDCALL
-RtlOpenCurrentUser(...)
+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,
}
-NTSTATUS
-STDCALL
-RtlCreateRegistryKey (
- IN ULONG RelativeTo,
- IN PWSTR Path
- )
+NTSTATUS STDCALL
+RtlCreateRegistryKey(IN ULONG RelativeTo,
+ IN PWSTR Path)
{
HANDLE KeyHandle;
NTSTATUS Status;
}
-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;
}
-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;
NTSTATUS STDCALL
RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath)
{
- return STATUS_UNSUCCESSFUL;
+ /* FIXME: !!! */
+ RtlCreateUnicodeString(KeyPath,
+ L"\\Registry\\User\\.Default");
+
+ return STATUS_SUCCESS;
}
/* ------------------------------------------ Private Implementation */