Implemented RtlOpenCurrentUser().

svn path=/trunk/; revision=1988
This commit is contained in:
Eric Kohl 2001-06-18 18:37:12 +00:00
parent 439bc219e0
commit 76f1b8fa3c
4 changed files with 107 additions and 43 deletions

View file

@ -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 ; ReactOS Operating System
; ;
@ -491,7 +491,7 @@ RtlNumberOfSetBits@4
RtlOemStringToUnicodeSize@4 RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString@12 RtlOemStringToUnicodeString@12
RtlOemToUnicodeN@20 RtlOemToUnicodeN@20
;RtlOpenCurrentUser RtlOpenCurrentUser@8
;RtlPcToFileHeader ;RtlPcToFileHeader
RtlPinAtomInAtomTable@8 RtlPinAtomInAtomTable@8
RtlPrefixString@12 RtlPrefixString@12

View file

@ -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 ; ReactOS Operating System
; ;
@ -490,7 +490,7 @@ RtlNumberOfSetBits=RtlNumberOfSetBits@4
RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4 RtlOemStringToUnicodeSize=RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12 RtlOemStringToUnicodeString=RtlOemStringToUnicodeString@12
RtlOemToUnicodeN=RtlOemToUnicodeN@20 RtlOemToUnicodeN=RtlOemToUnicodeN@20
;RtlOpenCurrentUser RtlOpenCurrentUser=RtlOpenCurrentUser@8
;RtlPcToFileHeader ;RtlPcToFileHeader
RtlPinAtomInAtomTable=RtlPinAtomInAtomTable@8 RtlPinAtomInAtomTable=RtlPinAtomInAtomTable@8
RtlPrefixString=RtlPrefixString@12 RtlPrefixString=RtlPrefixString@12

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -100,18 +100,51 @@ RtlDeleteRegistryValue(IN ULONG RelativeTo,
NTSTATUS STDCALL NTSTATUS STDCALL
RtlFormatCurrentUserKeyPath(PUNICODE_STRING KeyPath) RtlFormatCurrentUserKeyPath(PUNICODE_STRING KeyPath)
{ {
/* FIXME: !!! */
RtlCreateUnicodeString(KeyPath, RtlCreateUnicodeString(KeyPath,
L"\\Registry\\User\\.Default"); L"\\Registry\\User\\.Default");
return STATUS_SUCCESS; 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 NTSTATUS STDCALL
RtlQueryRegistryValues(IN ULONG RelativeTo, RtlQueryRegistryValues(IN ULONG RelativeTo,

View file

@ -28,12 +28,9 @@ RtlCheckRegistryKey(IN ULONG RelativeTo,
} }
NTSTATUS NTSTATUS STDCALL
STDCALL RtlCreateRegistryKey(IN ULONG RelativeTo,
RtlCreateRegistryKey ( IN PWSTR Path)
IN ULONG RelativeTo,
IN PWSTR Path
)
{ {
HANDLE KeyHandle; HANDLE KeyHandle;
NTSTATUS Status; NTSTATUS Status;
@ -51,13 +48,10 @@ RtlCreateRegistryKey (
} }
NTSTATUS NTSTATUS STDCALL
STDCALL RtlDeleteRegistryValue(IN ULONG RelativeTo,
RtlDeleteRegistryValue (
IN ULONG RelativeTo,
IN PWSTR Path, IN PWSTR Path,
IN PWSTR ValueName IN PWSTR ValueName)
)
{ {
HANDLE KeyHandle; HANDLE KeyHandle;
NTSTATUS Status; NTSTATUS Status;
@ -82,30 +76,63 @@ RtlDeleteRegistryValue (
} }
NTSTATUS NTSTATUS STDCALL
STDCALL RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess,
RtlQueryRegistryValues ( OUT PHANDLE KeyHandle)
IN ULONG RelativeTo, {
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 PWSTR Path,
IN PRTL_QUERY_REGISTRY_TABLE QueryTable, IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
IN PVOID Context, IN PVOID Context,
IN PVOID Environment IN PVOID Environment)
)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
NTSTATUS NTSTATUS STDCALL
STDCALL RtlWriteRegistryValue(IN ULONG RelativeTo,
RtlWriteRegistryValue (
IN ULONG RelativeTo,
IN PWSTR Path, IN PWSTR Path,
IN PWSTR ValueName, IN PWSTR ValueName,
IN ULONG ValueType, IN ULONG ValueType,
IN PVOID ValueData, IN PVOID ValueData,
IN ULONG ValueLength IN ULONG ValueLength)
)
{ {
HANDLE KeyHandle; HANDLE KeyHandle;
NTSTATUS Status; NTSTATUS Status;
@ -136,7 +163,11 @@ RtlWriteRegistryValue (
NTSTATUS STDCALL NTSTATUS STDCALL
RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath) RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath)
{ {
return STATUS_UNSUCCESSFUL; /* FIXME: !!! */
RtlCreateUnicodeString(KeyPath,
L"\\Registry\\User\\.Default");
return STATUS_SUCCESS;
} }
/* ------------------------------------------ Private Implementation */ /* ------------------------------------------ Private Implementation */