Fixed NtLoadKey(), NtLoadKey2() and NtSaveKey() signature.
authorEric Kohl <eric.kohl@reactos.org>
Sat, 22 Mar 2003 11:26:51 +0000 (11:26 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 22 Mar 2003 11:26:51 +0000 (11:26 +0000)
svn path=/trunk/; revision=4393

reactos/include/ntos/zw.h
reactos/ntoskrnl/cm/ntfunc.c

index 1dedb83..d9212af 100755 (executable)
@@ -1,5 +1,5 @@
 
-/* $Id: zw.h,v 1.9 2003/03/19 23:16:00 gdalsnes Exp $
+/* $Id: zw.h,v 1.10 2003/03/22 11:25:33 ekohl Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -4313,31 +4313,6 @@ ZwQuerySystemTime (
        OUT TIME *CurrentTime
        );
 
-/*
- * FUNCTION: Loads a registry key.
- * ARGUMENTS:
- *       KeyHandle = Handle to the registry key
- *       ObjectAttributes = ???
- *       Unknown3 = ???
- * REMARK:
- *       This procedure maps to the win32 procedure RegLoadKey
- * RETURNS: Status
- */
-NTSTATUS
-STDCALL
-NtLoadKey2 (
-       PHANDLE                 KeyHandle,
-       POBJECT_ATTRIBUTES      ObjectAttributes,
-       ULONG                   Unknown3
-       );
-NTSTATUS
-STDCALL
-ZwLoadKey2 (
-       PHANDLE                 KeyHandle,
-       POBJECT_ATTRIBUTES      ObjectAttributes,
-       ULONG                   Unknown3
-       );
-
 /*
  * FUNCTION: Copies a handle from one process space to another
  * ARGUMENTS:
@@ -4677,39 +4652,64 @@ ZwGetTickCount(
 /*
  * FUNCTION: Loads a registry key.
  * ARGUMENTS:
- *       KeyHandle = Handle to the registry key
- *       ObjectAttributes = ???
+ *       KeyObjectAttributes = Key to be loaded
+ *       FileObjectAttributes = File to load the key from
  * REMARK:
  *      This procedure maps to the win32 procedure RegLoadKey
  * RETURNS: Status
  */
 NTSTATUS
-STDCALL 
+STDCALL
 NtLoadKey(
-       PHANDLE KeyHandle,
-       POBJECT_ATTRIBUTES ObjectAttributes
+       IN      POBJECT_ATTRIBUTES      KeyObjectAttributes,
+       IN      POBJECT_ATTRIBUTES      FileObjectAttributes
        );
 
 NTSTATUS
-STDCALL 
+STDCALL
 ZwLoadKey(
-       PHANDLE KeyHandle,
-       POBJECT_ATTRIBUTES ObjectAttributes
+       IN      POBJECT_ATTRIBUTES      KeyObjectAttributes,
+       IN      POBJECT_ATTRIBUTES      FileObjectAttributes
        );
 
 /*
- * FUNCTION: Locks a range of virtual memory. 
+ * FUNCTION: Loads a registry key.
+ * ARGUMENTS:
+ *       KeyObjectAttributes = Key to be loaded
+ *       FileObjectAttributes = File to load the key from
+ *       Flags = ???
+ * REMARK:
+ *       This procedure maps to the win32 procedure RegLoadKey
+ * RETURNS: Status
+ */
+NTSTATUS
+STDCALL
+NtLoadKey2(
+       IN      POBJECT_ATTRIBUTES      KeyObjectAttributes,
+       IN      POBJECT_ATTRIBUTES      FileObjectAttributes,
+       IN      ULONG                   Flags
+       );
+NTSTATUS
+STDCALL
+ZwLoadKey2(
+       IN      POBJECT_ATTRIBUTES      KeyObjectAttributes,
+       IN      POBJECT_ATTRIBUTES      FileObjectAttributes,
+       IN      ULONG                   Flags
+       );
+
+/*
+ * FUNCTION: Locks a range of virtual memory.
  * ARGUMENTS: 
  *       ProcessHandle = Handle to the process
- *       BaseAddress =  Lower boundary of the range of bytes to lock. 
+ *       BaseAddress =  Lower boundary of the range of bytes to lock.
  *       NumberOfBytesLock = Offset to the upper boundary.
  *       NumberOfBytesLocked (OUT) = Number of bytes actually locked.
  * REMARK:
-       This procedure maps to the win32 procedure VirtualLock 
+       This procedure maps to the win32 procedure VirtualLock.
  * RETURNS: Status [STATUS_SUCCESS | STATUS_WAS_LOCKED ]
  */    
 NTSTATUS
-STDCALL 
+STDCALL
 NtLockVirtualMemory(
        HANDLE ProcessHandle,
        PVOID BaseAddress,
@@ -4718,7 +4718,7 @@ NtLockVirtualMemory(
        );
 
 NTSTATUS
-STDCALL 
+STDCALL
 ZwLockVirtualMemory(
        HANDLE ProcessHandle,
        PVOID BaseAddress,
@@ -5213,13 +5213,13 @@ ZwSetTimer(
 NTSTATUS
 STDCALL
 NtUnloadKey(
-       HANDLE KeyHandle
+       IN      POBJECT_ATTRIBUTES      KeyObjectAttributes
        );
 
 NTSTATUS
 STDCALL
 ZwUnloadKey(
-       HANDLE KeyHandle
+       IN      POBJECT_ATTRIBUTES      KeyObjectAttributes
        );
 
 /*
index 5ed606d..74e6dd3 100644 (file)
@@ -821,14 +821,11 @@ NtQueryKey(IN HANDLE KeyHandle,
                NULL);
   if (!NT_SUCCESS(Status))
     {
-CHECKPOINT1;
       return Status;
     }
-CHECKPOINT1;
 
   /* Acquire hive lock */
   ExAcquireResourceSharedLite(&KeyObject->RegistryHive->HiveResource, TRUE);
-CHECKPOINT1;
 
   VERIFY_KEY_OBJECT(KeyObject);
 
@@ -840,7 +837,6 @@ CHECKPOINT1;
   switch (KeyInformationClass)
     {
     case KeyBasicInformation:
-CHECKPOINT1;
       /* Check size of buffer */
       if (Length < sizeof(KEY_BASIC_INFORMATION) + 
           KeyObject->NameSize * sizeof(WCHAR))
@@ -861,7 +857,6 @@ CHECKPOINT1;
           *ResultLength = sizeof(KEY_BASIC_INFORMATION) + 
             KeyObject->NameSize * sizeof(WCHAR);
         }
-CHECKPOINT1;
       break;
 
     case KeyNodeInformation:
@@ -943,11 +938,8 @@ CHECKPOINT1;
       break;
     }
 
-CHECKPOINT1;
   ExReleaseResourceLite(&KeyObject->RegistryHive->HiveResource);
-CHECKPOINT1;
   ObDereferenceObject(KeyObject);
-CHECKPOINT1;
 
   return(Status);
 }
@@ -1185,8 +1177,8 @@ NtSetValueKey(IN HANDLE KeyHandle,
   PHBIN pBin;
   ULONG DesiredAccess;
 
-  DPRINT("NtSetValueKey(KeyHandle %x  ValueName %S  Type %d)\n",
-        KeyHandle, ValueName? ValueName->Buffer : NULL, Type);
+  DPRINT("NtSetValueKey(KeyHandle %x  ValueName '%wZ'  Type %d)\n",
+        KeyHandle, ValueName, Type);
 
   DesiredAccess = KEY_SET_VALUE;
   if (Type == REG_LINK)
@@ -1389,21 +1381,31 @@ NtDeleteValueKey(IN HANDLE KeyHandle,
   return Status;
 }
 
-
+/*
+ * NOTE:
+ * KeyObjectAttributes->RootDirectory specifies the handle to the parent key and
+ * KeyObjectAttributes->Name specifies the name of the key to load.
+ */
 NTSTATUS STDCALL
-NtLoadKey(PHANDLE KeyHandle,
-         POBJECT_ATTRIBUTES ObjectAttributes)
+NtLoadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes,
+         IN POBJECT_ATTRIBUTES FileObjectAttributes)
 {
-  return NtLoadKey2(KeyHandle, ObjectAttributes, 0);
+  return NtLoadKey2(KeyObjectAttributes, FileObjectAttributes, 0);
 }
 
 
+/*
+ * NOTE:
+ * KeyObjectAttributes->RootDirectory specifies the handle to the parent key and
+ * KeyObjectAttributes->Name specifies the name of the key to load.
+ */
 NTSTATUS STDCALL
-NtLoadKey2(IN PHANDLE KeyHandle,
-       IN POBJECT_ATTRIBUTES ObjectAttributes,
-       IN ULONG Flags)
+NtLoadKey2(IN POBJECT_ATTRIBUTES KeyObjectAttributes,
+          IN POBJECT_ATTRIBUTES FileObjectAttributes,
+          IN ULONG Flags)
 {
-       UNIMPLEMENTED;
+  UNIMPLEMENTED;
+  return STATUS_NOT_IMPLEMENTED;
 }
 
 
@@ -1579,8 +1581,13 @@ NtSetInformationKey(
 }
 
 
+/*
+ * NOTE:
+ * KeyObjectAttributes->RootDirectory specifies the handle to the parent key and
+ * KeyObjectAttributes->Name specifies the name of the key to unload.
+ */
 NTSTATUS STDCALL
-NtUnloadKey(IN HANDLE KeyHandle)
+NtUnloadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes)
 {
   UNIMPLEMENTED;
 }