update for HEAD-2003050101
[reactos.git] / ntoskrnl / cm / regobj.c
index e4570e4..27944d5 100644 (file)
@@ -6,9 +6,6 @@
  * UPDATE HISTORY:
 */
 
-#ifdef WIN32_REGDBG
-#include "cm_win32.h"
-#else
 #include <ddk/ntddk.h>
 #include <roscfg.h>
 #include <internal/ob.h>
@@ -22,7 +19,6 @@
 #include <internal/debug.h>
 
 #include "cm.h"
-#endif
 
 
 static NTSTATUS
@@ -209,16 +205,8 @@ CmiObjectParse(PVOID ParsedObject,
                                 NULL,
                                 UserMode);
     }
-#ifndef WIN32_REGDBG
+
   DPRINT("CmiObjectParse: %s\n", FoundObject->Name);
-#else
-  {
-      char buffer[_BUFFER_LEN];
-      memset(buffer, 0, _BUFFER_LEN);
-      strncpy(buffer, FoundObject->Name, min(FoundObject->NameSize, _BUFFER_LEN - 1));
-      DPRINT("CmiObjectParse: %s\n", buffer);
-  }
-#endif
 
   *Path = EndPtr;
 
@@ -234,7 +222,7 @@ NTSTATUS STDCALL
 CmiObjectCreate(PVOID ObjectBody,
                PVOID Parent,
                PWSTR RemainingPath,
-               struct _OBJECT_ATTRIBUTES* ObjectAttributes)
+               POBJECT_ATTRIBUTES ObjectAttributes)
 {
   PKEY_OBJECT pKey = ObjectBody;
 
@@ -283,16 +271,27 @@ CmiObjectDelete(PVOID DeletedObject)
                      KeyObject->ParentKey,
                      KeyObject);
 
-      if (IsPermanentHive(KeyObject->RegistryHive))
-       CmiSyncHives();
-    }
-  else
-    {
-      CmiReleaseBlock(KeyObject->RegistryHive, KeyObject->KeyCell);
+      if (!IsVolatileHive(KeyObject->RegistryHive))
+       {
+         CmiSyncHives();
+       }
     }
 }
 
 
+NTSTATUS STDCALL
+CmiObjectSecurity(PVOID ObjectBody,
+                 SECURITY_OPERATION_CODE OperationCode,
+                 SECURITY_INFORMATION SecurityInformation,
+                 PSECURITY_DESCRIPTOR SecurityDescriptor,
+                 PULONG BufferLength)
+{
+  DPRINT1("CmiObjectSecurity() called\n");
+
+  return(STATUS_SUCCESS);
+}
+
+
 VOID
 CmiAddKeyToList(PKEY_OBJECT ParentKey,
                PKEY_OBJECT NewKey)
@@ -306,13 +305,13 @@ CmiAddKeyToList(PKEY_OBJECT ParentKey,
   if (ParentKey->SizeOfSubKeys <= ParentKey->NumberOfSubKeys)
     {
       PKEY_OBJECT *tmpSubKeys = ExAllocatePool(NonPagedPool,
-       (ParentKey->NumberOfSubKeys + 1) * sizeof(DWORD));
+       (ParentKey->NumberOfSubKeys + 1) * sizeof(ULONG));
 
       if (ParentKey->NumberOfSubKeys > 0)
        {
-         memcpy(tmpSubKeys,
-                ParentKey->SubKeys,
-                ParentKey->NumberOfSubKeys * sizeof(DWORD));
+         RtlCopyMemory (tmpSubKeys,
+                        ParentKey->SubKeys,
+                        ParentKey->NumberOfSubKeys * sizeof(ULONG));
        }
 
       if (ParentKey->SubKeys)
@@ -380,17 +379,8 @@ CmiScanKeyList(PKEY_OBJECT Parent,
   WORD NameSize;
   DWORD Index;
 
-#ifndef WIN32_REGDBG
   DPRINT("Scanning key list for: %s (Parent: %s)\n",
     KeyName, Parent->Name);
-#else
-  {
-      char buffer[_BUFFER_LEN];
-      memset(buffer, 0, _BUFFER_LEN);
-      strncpy(buffer, Parent->Name, min(Parent->NameSize, _BUFFER_LEN - 1));
-      DPRINT("Scanning key list for: %s (Parent: %s)\n", KeyName, buffer);
-  }
-#endif
 
   NameSize = strlen(KeyName);
   KeAcquireSpinLock(&CmiKeyListLock, &OldIrql);
@@ -418,7 +408,7 @@ CmiScanKeyList(PKEY_OBJECT Parent,
        }
     }
   KeReleaseSpinLock(&CmiKeyListLock, OldIrql);
-  
+
   return NULL;
 }
 
@@ -471,7 +461,6 @@ CmiGetLinkTarget(PREGISTRY_HIVE RegistryHive,
                    DataCell->Data,
                    TargetPath->Length);
       TargetPath->Buffer[TargetPath->Length / sizeof(WCHAR)] = 0;
-      CmiReleaseBlock(RegistryHive, DataCell);
     }
   else
     {