more NtXxx vs. ZwXxx fixes
Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
Modified: trunk/reactos/ntoskrnl/cm/registry.c
Modified: trunk/reactos/ntoskrnl/ex/uuid.c

Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
--- trunk/reactos/ntoskrnl/cm/ntfunc.c	2005-01-22 15:27:06 UTC (rev 13214)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c	2005-01-22 15:48:00 UTC (rev 13215)
@@ -237,16 +237,19 @@
 NTSTATUS STDCALL
 NtDeleteKey(IN HANDLE KeyHandle)
 {
+  KPROCESSOR_MODE PreviousMode;
   PKEY_OBJECT KeyObject;
   NTSTATUS Status;
 
   DPRINT1("NtDeleteKey(KeyHandle %x) called\n", KeyHandle);
+  
+  PreviousMode = ExGetPreviousMode();
 
   /* Verify that the handle is valid and is a registry key */
   Status = ObReferenceObjectByHandle(KeyHandle,
 				     DELETE,
 				     CmiKeyType,
-				     UserMode,
+				     PreviousMode,
 				     (PVOID *)&KeyObject,
 				     NULL);
   if (!NT_SUCCESS(Status))
@@ -899,14 +902,17 @@
   NTSTATUS Status;
   PKEY_OBJECT  KeyObject;
   PREGISTRY_HIVE  RegistryHive;
+  KPROCESSOR_MODE  PreviousMode;
 
   DPRINT("NtFlushKey (KeyHandle %lx) called\n", KeyHandle);
+  
+  PreviousMode = ExGetPreviousMode();
 
   /* Verify that the handle is valid and is a registry key */
   Status = ObReferenceObjectByHandle(KeyHandle,
 				     KEY_QUERY_VALUE,
 				     CmiKeyType,
-				     UserMode,
+				     PreviousMode,
 				     (PVOID *)&KeyObject,
 				     NULL);
   if (!NT_SUCCESS(Status))
@@ -947,8 +953,10 @@
 	  IN POBJECT_ATTRIBUTES ObjectAttributes)
 {
   UNICODE_STRING RemainingPath;
-  NTSTATUS Status;
+  KPROCESSOR_MODE PreviousMode;
   PVOID Object;
+  HANDLE hKey;
+  NTSTATUS Status = STATUS_SUCCESS;
 
   DPRINT("NtOpenKey(KH %x  DA %x  OA %x  OA->ON '%wZ'\n",
 	 KeyHandle,
@@ -956,6 +964,28 @@
 	 ObjectAttributes,
 	 ObjectAttributes ? ObjectAttributes->ObjectName : NULL);
 
+  PreviousMode = ExGetPreviousMode();
+  
+  if(PreviousMode != KernelMode)
+  {
+    _SEH_TRY
+    {
+      ProbeForWrite(KeyHandle,
+                    sizeof(HANDLE),
+                    sizeof(ULONG));
+    }
+    _SEH_HANDLE
+    {
+      Status = _SEH_GetExceptionCode();
+    }
+    _SEH_END;
+    
+    if(!NT_SUCCESS(Status))
+    {
+      return Status;
+    }
+  }
+
   RemainingPath.Buffer = NULL;
   Status = ObFindObject(ObjectAttributes,
 			&Object,
@@ -990,7 +1020,7 @@
 			  Object,
 			  DesiredAccess,
 			  TRUE,
-			  KeyHandle);
+			  &hKey);
   ObDereferenceObject(Object);
 
   if (!NT_SUCCESS(Status))
@@ -998,7 +1028,17 @@
       return(Status);
     }
 
-  return(STATUS_SUCCESS);
+  _SEH_TRY
+  {
+    *KeyHandle = hKey;
+  }
+  _SEH_HANDLE
+  {
+    Status = _SEH_GetExceptionCode();
+  }
+  _SEH_END;
+
+  return Status;
 }
 
 

Modified: trunk/reactos/ntoskrnl/cm/regfile.c
--- trunk/reactos/ntoskrnl/cm/regfile.c	2005-01-22 15:27:06 UTC (rev 13214)
+++ trunk/reactos/ntoskrnl/cm/regfile.c	2005-01-22 15:48:00 UTC (rev 13215)
@@ -71,7 +71,7 @@
   RootKeyCell->CellSize = -sizeof(KEY_CELL);
   RootKeyCell->Id = REG_KEY_CELL_ID;
   RootKeyCell->Flags = REG_KEY_ROOT_CELL | REG_KEY_NAME_PACKED;
-  NtQuerySystemTime(&RootKeyCell->LastWriteTime);
+  ZwQuerySystemTime(&RootKeyCell->LastWriteTime);
   RootKeyCell->ParentKeyOffset = 0;
   RootKeyCell->NumberOfSubKeys = 0;
   RootKeyCell->HashTableOffset = -1;
@@ -384,7 +384,7 @@
   /* The rest of the block is free */
   FreeCell->CellSize = REG_BLOCK_SIZE - (REG_HBIN_DATA_OFFSET + sizeof(KEY_CELL));
 
-  Status = NtWriteFile(FileHandle,
+  Status = ZwWriteFile(FileHandle,
 		       NULL,
 		       NULL,
 		       NULL,
@@ -403,7 +403,7 @@
       return(Status);
     }
 
-  Status = NtFlushBuffersFile(FileHandle,
+  Status = ZwFlushBuffersFile(FileHandle,
 			      &IoStatusBlock);
 
   return(Status);
@@ -483,7 +483,7 @@
   else if (!NT_SUCCESS(Status))
     {
       DPRINT("ZwCreateFile() failed (Status %lx)\n", Status);
-      NtClose(HiveHandle);
+      ZwClose(HiveHandle);
       return(Status);
     }
 
@@ -499,7 +499,7 @@
 
   /* Read hive base block */
   FileOffset.QuadPart = 0ULL;
-  Status = NtReadFile(HiveHandle,
+  Status = ZwReadFile(HiveHandle,
 		      0,
 		      0,
 		      0,
@@ -510,7 +510,7 @@
 		      0);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtReadFile() failed (Status %lx)\n", Status);
+      DPRINT("ZwReadFile() failed (Status %lx)\n", Status);
       goto ByeBye;
     }
 
@@ -541,7 +541,7 @@
 
       /* Read log file header */
       FileOffset.QuadPart = 0ULL;
-      Status = NtReadFile(LogHandle,
+      Status = ZwReadFile(LogHandle,
 			  0,
 			  0,
 			  0,
@@ -552,7 +552,7 @@
 			  0);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT("NtReadFile() failed (Status %lx)\n", Status);
+	  DPRINT("ZwReadFile() failed (Status %lx)\n", Status);
 	  goto ByeBye;
 	}
 
@@ -585,14 +585,14 @@
        */
 
       /* Get file size */
-      Status = NtQueryInformationFile(LogHandle,
+      Status = ZwQueryInformationFile(LogHandle,
 				      &IoStatusBlock,
 				      &fsi,
 				      sizeof(fsi),
 				      FileStandardInformation);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT("NtQueryInformationFile() failed (Status %lx)\n", Status);
+	  DPRINT("ZwQueryInformationFile() failed (Status %lx)\n", Status);
 	  goto ByeBye;
 	}
       FileSize = fsi.EndOfFile.u.LowPart;
@@ -617,7 +617,7 @@
 
       /* Read log file header */
       FileOffset.QuadPart = 0ULL;
-      Status = NtReadFile(LogHandle,
+      Status = ZwReadFile(LogHandle,
 			  0,
 			  0,
 			  0,
@@ -628,7 +628,7 @@
 			  0);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT("NtReadFile() failed (Status %lx)\n", Status);
+	  DPRINT("ZwReadFile() failed (Status %lx)\n", Status);
 	  goto ByeBye;
 	}
 
@@ -656,9 +656,9 @@
     ExFreePool(LogHeader);
 
   if (LogHandle != INVALID_HANDLE_VALUE)
-    NtClose(LogHandle);
+    ZwClose(LogHandle);
 
-  NtClose(HiveHandle);
+  ZwClose(HiveHandle);
 
   return(Status);
 }
@@ -929,7 +929,7 @@
       if (!NT_SUCCESS(Status))
 	{
 	  DPRINT("CmiCreateNewRegFile() failed (Status %lx)\n", Status);
-	  NtClose(FileHandle);
+	  ZwClose(FileHandle);
 	  RtlFreeUnicodeString(&RegistryHive->HiveFileName);
 	  RtlFreeUnicodeString(&RegistryHive->LogFileName);
 	  return(Status);
@@ -972,7 +972,7 @@
       ObDereferenceObject(SectionObject);
       RtlFreeUnicodeString(&RegistryHive->HiveFileName);
       RtlFreeUnicodeString(&RegistryHive->LogFileName);
-      NtClose(FileHandle);
+      ZwClose(FileHandle);
       return(Status);
     }
   DPRINT("ViewBase %p  ViewSize %lx\n", ViewBase, ViewSize);
@@ -996,7 +996,7 @@
       ObDereferenceObject(SectionObject);
       RtlFreeUnicodeString(&RegistryHive->HiveFileName);
       RtlFreeUnicodeString(&RegistryHive->LogFileName);
-      NtClose(FileHandle);
+      ZwClose(FileHandle);
       return STATUS_INSUFFICIENT_RESOURCES;
     }
   RtlZeroMemory (RegistryHive->BlockList,
@@ -1013,7 +1013,7 @@
       ObDereferenceObject(SectionObject);
       RtlFreeUnicodeString(&RegistryHive->HiveFileName);
       RtlFreeUnicodeString(&RegistryHive->LogFileName);
-      NtClose(FileHandle);
+      ZwClose(FileHandle);
       return Status;
     }
 
@@ -1023,7 +1023,7 @@
   ObDereferenceObject(SectionObject);
 
   /* Close the hive file */
-  NtClose(FileHandle);
+  ZwClose(FileHandle);
 
   /* Initialize the free cell list */
   Status = CmiCreateHiveFreeCellList (RegistryHive);
@@ -1438,7 +1438,7 @@
 
   /* Write hive block and block bitmap */
   FileOffset.QuadPart = (ULONGLONG)0;
-  Status = NtWriteFile(FileHandle,
+  Status = ZwWriteFile(FileHandle,
 		       NULL,
 		       NULL,
 		       NULL,
@@ -1449,8 +1449,8 @@
 		       NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwWriteFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       ExFreePool(Buffer);
       return(Status);
     }
@@ -1479,7 +1479,7 @@
       DPRINT("File offset %I64x\n", FileOffset.QuadPart);
 
       /* Write hive block */
-      Status = NtWriteFile(FileHandle,
+      Status = ZwWriteFile(FileHandle,
 			   NULL,
 			   NULL,
 			   NULL,
@@ -1490,8 +1490,8 @@
 			   NULL);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT1("NtWriteFile() failed (Status %lx)\n", Status);
-	  NtClose(FileHandle);
+	  DPRINT1("ZwWriteFile() failed (Status %lx)\n", Status);
+	  ZwClose(FileHandle);
 	  return(Status);
 	}
 
@@ -1501,40 +1501,40 @@
 
   /* Truncate log file */
   EndOfFileInfo.EndOfFile.QuadPart = FileOffset.QuadPart;
-  Status = NtSetInformationFile(FileHandle,
+  Status = ZwSetInformationFile(FileHandle,
 				&IoStatusBlock,
 				&EndOfFileInfo,
 				sizeof(FILE_END_OF_FILE_INFORMATION),
 				FileEndOfFileInformation);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtSetInformationFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwSetInformationFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       return(Status);
     }
 
   FileAllocationInfo.AllocationSize.QuadPart = FileOffset.QuadPart;
-  Status = NtSetInformationFile(FileHandle,
+  Status = ZwSetInformationFile(FileHandle,
 				&IoStatusBlock,
 				&FileAllocationInfo,
 				sizeof(FILE_ALLOCATION_INFORMATION),
 				FileAllocationInformation);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtSetInformationFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwSetInformationFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       return(Status);
     }
 
   /* Flush the log file */
-  Status = NtFlushBuffersFile(FileHandle,
+  Status = ZwFlushBuffersFile(FileHandle,
 			      &IoStatusBlock);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtFlushBuffersFile() failed (Status %lx)\n", Status);
+      DPRINT("ZwFlushBuffersFile() failed (Status %lx)\n", Status);
     }
 
-  NtClose(FileHandle);
+  ZwClose(FileHandle);
 
   return(Status);
 }
@@ -1616,7 +1616,7 @@
 
   /* Write hive block and block bitmap */
   FileOffset.QuadPart = (ULONGLONG)0;
-  Status = NtWriteFile(FileHandle,
+  Status = ZwWriteFile(FileHandle,
 		       NULL,
 		       NULL,
 		       NULL,
@@ -1627,8 +1627,8 @@
 		       NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwWriteFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       ExFreePool(Buffer);
       return(Status);
     }
@@ -1636,14 +1636,14 @@
   ExFreePool(Buffer);
 
   /* Flush the log file */
-  Status = NtFlushBuffersFile(FileHandle,
+  Status = ZwFlushBuffersFile(FileHandle,
 			      &IoStatusBlock);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtFlushBuffersFile() failed (Status %lx)\n", Status);
+      DPRINT("ZwFlushBuffersFile() failed (Status %lx)\n", Status);
     }
 
-  NtClose(FileHandle);
+  ZwClose(FileHandle);
 
   return(Status);
 }
@@ -1697,20 +1697,20 @@
 
   /* Truncate log file */
   EndOfFileInfo.EndOfFile.QuadPart = (ULONGLONG)BufferSize;
-  Status = NtSetInformationFile(FileHandle,
+  Status = ZwSetInformationFile(FileHandle,
 				&IoStatusBlock,
 				&EndOfFileInfo,
 				sizeof(FILE_END_OF_FILE_INFORMATION),
 				FileEndOfFileInformation);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtSetInformationFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwSetInformationFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       return(Status);
     }
 
   FileAllocationInfo.AllocationSize.QuadPart = (ULONGLONG)BufferSize;
-  Status = NtSetInformationFile(FileHandle,
+  Status = ZwSetInformationFile(FileHandle,
 				&IoStatusBlock,
 				&FileAllocationInfo,
 				sizeof(FILE_ALLOCATION_INFORMATION),
@@ -1718,19 +1718,19 @@
   if (!NT_SUCCESS(Status))
     {
       DPRINT("NtSetInformationFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      ZwClose(FileHandle);
       return(Status);
     }
 
   /* Flush the log file */
-  Status = NtFlushBuffersFile(FileHandle,
+  Status = ZwFlushBuffersFile(FileHandle,
 			      &IoStatusBlock);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtFlushBuffersFile() failed (Status %lx)\n", Status);
+      DPRINT("ZwFlushBuffersFile() failed (Status %lx)\n", Status);
     }
 
-  NtClose(FileHandle);
+  ZwClose(FileHandle);
 
   return(Status);
 }
@@ -1780,7 +1780,7 @@
 
   /* Write hive block */
   FileOffset.QuadPart = (ULONGLONG)0;
-  Status = NtWriteFile(FileHandle,
+  Status = ZwWriteFile(FileHandle,
 		       NULL,
 		       NULL,
 		       NULL,
@@ -1791,8 +1791,8 @@
 		       NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwWriteFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       return(Status);
     }
 
@@ -1819,7 +1819,7 @@
       DPRINT("  File offset %I64x\n", FileOffset.QuadPart);
 
       /* Write hive block */
-      Status = NtWriteFile(FileHandle,
+      Status = ZwWriteFile(FileHandle,
 			   NULL,
 			   NULL,
 			   NULL,
@@ -1830,22 +1830,22 @@
 			   NULL);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
-	  NtClose(FileHandle);
+	  DPRINT("ZwWriteFile() failed (Status %lx)\n", Status);
+	  ZwClose(FileHandle);
 	  return(Status);
 	}
 
       BlockIndex++;
     }
 
-  Status = NtFlushBuffersFile(FileHandle,
+  Status = ZwFlushBuffersFile(FileHandle,
 			      &IoStatusBlock);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtFlushBuffersFile() failed (Status %lx)\n", Status);
+      DPRINT("ZwFlushBuffersFile() failed (Status %lx)\n", Status);
     }
 
-  NtClose(FileHandle);
+  ZwClose(FileHandle);
 
   return(Status);
 }
@@ -1892,7 +1892,7 @@
 
   /* Write hive block */
   FileOffset.QuadPart = (ULONGLONG)0;
-  Status = NtWriteFile(FileHandle,
+  Status = ZwWriteFile(FileHandle,
 		       NULL,
 		       NULL,
 		       NULL,
@@ -1903,19 +1903,19 @@
 		       NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtWriteFile() failed (Status %lx)\n", Status);
-      NtClose(FileHandle);
+      DPRINT("ZwWriteFile() failed (Status %lx)\n", Status);
+      ZwClose(FileHandle);
       return(Status);
     }
 
-  Status = NtFlushBuffersFile(FileHandle,
+  Status = ZwFlushBuffersFile(FileHandle,
 			      &IoStatusBlock);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT("NtFlushBuffersFile() failed (Status %lx)\n", Status);
+      DPRINT("ZwFlushBuffersFile() failed (Status %lx)\n", Status);
     }
 
-  NtClose(FileHandle);
+  ZwClose(FileHandle);
 
   return(Status);
 }
@@ -1939,7 +1939,7 @@
 	 &RegistryHive->LogFileName);
 
   /* Update hive header modification time */
-  NtQuerySystemTime(&RegistryHive->HiveHeader->DateModified);
+  ZwQuerySystemTime(&RegistryHive->HiveHeader->DateModified);
 
   /* Start log update */
   Status = CmiStartLogUpdate(RegistryHive);
@@ -2436,7 +2436,7 @@
     {
       NewKeyCell->Id = REG_KEY_CELL_ID;
       NewKeyCell->Flags = 0;
-      NtQuerySystemTime(&NewKeyCell->LastWriteTime);
+      ZwQuerySystemTime(&NewKeyCell->LastWriteTime);
       NewKeyCell->ParentKeyOffset = -1;
       NewKeyCell->NumberOfSubKeys = 0;
       NewKeyCell->HashTableOffset = -1;
@@ -2552,7 +2552,7 @@
       ParentKeyCell->NumberOfSubKeys++;
     }
 
-  NtQuerySystemTime (&ParentKeyCell->LastWriteTime);
+  ZwQuerySystemTime (&ParentKeyCell->LastWriteTime);
   CmiMarkBlockDirty (RegistryHive, ParentKey->KeyCellOffset);
 
   return(Status);
@@ -2710,7 +2710,7 @@
 	    }
 	}
 
-      NtQuerySystemTime(&ParentKey->KeyCell->LastWriteTime);
+      ZwQuerySystemTime(&ParentKey->KeyCell->LastWriteTime);
       CmiMarkBlockDirty(ParentKey->RegistryHive,
 			ParentKey->KeyCellOffset);
     }
@@ -3210,7 +3210,7 @@
 
       /* Update time of heap */
       if (!IsNoFileHive(RegistryHive))
-	NtQuerySystemTime(&Bin->DateModified);
+	ZwQuerySystemTime(&Bin->DateModified);
     }
 
   /* Destroy the value cell */
@@ -3219,7 +3219,7 @@
   /* Update time of heap */
   if (!IsNoFileHive(RegistryHive) && CmiGetCell (RegistryHive, ValueCellOffset, &Bin))
     {
-      NtQuerySystemTime(&Bin->DateModified);
+      ZwQuerySystemTime(&Bin->DateModified);
     }
 
   return Status;
@@ -3254,7 +3254,7 @@
   RegistryHive->FileSize += BinSize;
   tmpBin->BinSize = BinSize;
   tmpBin->Unused1 = 0;
-  NtQuerySystemTime(&tmpBin->DateModified);
+  ZwQuerySystemTime(&tmpBin->DateModified);
   tmpBin->Unused2 = 0;
 
   DPRINT ("  BinOffset %lx  BinSize %lx\n", tmpBin->BinOffset,tmpBin->BinSize);
@@ -3382,7 +3382,7 @@
 		  return STATUS_UNSUCCESSFUL;
 		}
 
-	      NtQuerySystemTime(&Bin->DateModified);
+	      ZwQuerySystemTime(&Bin->DateModified);
 	      CmiMarkBlockDirty(RegistryHive, RegistryHive->FreeListOffset[i]);
 
 	      if ((i + 1) < RegistryHive->FreeListSize)
@@ -3471,7 +3471,7 @@
 
       /* Update time of heap */
       if (!IsNoFileHive(RegistryHive) && CmiGetCell (RegistryHive, CellOffset,&pBin))
-	NtQuerySystemTime(&pBin->DateModified);
+	ZwQuerySystemTime(&pBin->DateModified);
 
       CmiMarkBlockDirty(RegistryHive, CellOffset);
     }
@@ -4247,7 +4247,7 @@
 
   /* Write hive block */
   FileOffset.QuadPart = (ULONGLONG)0;
-  Status = NtWriteFile (FileHandle,
+  Status = ZwWriteFile (FileHandle,
 			NULL,
 			NULL,
 			NULL,
@@ -4258,7 +4258,7 @@
 			NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1 ("NtWriteFile() failed (Status %lx)\n", Status);
+      DPRINT1 ("ZwWriteFile() failed (Status %lx)\n", Status);
       return Status;
     }
 
@@ -4272,7 +4272,7 @@
       DPRINT ("File offset %I64x\n", FileOffset.QuadPart);
 
       /* Write hive block */
-      Status = NtWriteFile (FileHandle,
+      Status = ZwWriteFile (FileHandle,
 			    NULL,
 			    NULL,
 			    NULL,
@@ -4283,16 +4283,16 @@
 			    NULL);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT1 ("NtWriteFile() failed (Status %lx)\n", Status);
+	  DPRINT1 ("ZwWriteFile() failed (Status %lx)\n", Status);
 	  return Status;
 	}
     }
 
-  Status = NtFlushBuffersFile (FileHandle,
+  Status = ZwFlushBuffersFile (FileHandle,
 			       &IoStatusBlock);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1 ("NtFlushBuffersFile() failed (Status %lx)\n", Status);
+      DPRINT1 ("ZwFlushBuffersFile() failed (Status %lx)\n", Status);
     }
 
   DPRINT ("CmiSaveTempHive() done\n");

Modified: trunk/reactos/ntoskrnl/cm/registry.c
--- trunk/reactos/ntoskrnl/cm/registry.c	2005-01-22 15:27:06 UTC (rev 13214)
+++ trunk/reactos/ntoskrnl/cm/registry.c	2005-01-22 15:48:00 UTC (rev 13215)
@@ -73,7 +73,7 @@
       BufferSize = sizeof(KEY_NODE_INFORMATION) + 4096;
       KeyInfo = ExAllocatePool(PagedPool, BufferSize);
 
-      Status = NtEnumerateKey(Key,
+      Status = ZwEnumerateKey(Key,
 			      Index,
 			      KeyNodeInformation,
 			      KeyInfo,
@@ -111,7 +111,7 @@
 				 NULL,
 				 NULL);
 
-      Status = NtOpenKey(&SubKey,
+      Status = ZwOpenKey(&SubKey,
 			 KEY_ALL_ACCESS,
 			 &ObjectAttributes);
 
@@ -119,7 +119,7 @@
 
       CmiCheckKey(Verbose, SubKey);
 
-      NtClose(SubKey);
+      ZwClose(SubKey);
 
       Index++;
     }
@@ -145,7 +145,7 @@
       BufferSize = sizeof(KEY_NODE_INFORMATION) + 4096;
       ValueInfo = ExAllocatePool(PagedPool, BufferSize);
 
-      Status = NtEnumerateValueKey(Key,
+      Status = ZwEnumerateValueKey(Key,
 				   Index,
 				   KeyNodeInformation,
 				   ValueInfo,
@@ -209,7 +209,7 @@
 		NULL,
 		NULL);
 
-  Status = NtOpenKey(&Key,
+  Status = ZwOpenKey(&Key,
 		KEY_ALL_ACCESS,
 		&ObjectAttributes);
 
@@ -225,7 +225,7 @@
 
   CmiCheckKey(Verbose, Key);
 
-  NtClose(Key);
+  ZwClose(Key);
 }
 
 
@@ -341,7 +341,7 @@
 			     0,
 			     RootKeyHandle,
 			     NULL);
-  Status = NtCreateKey(&KeyHandle,
+  Status = ZwCreateKey(&KeyHandle,
 		       STANDARD_RIGHTS_REQUIRED,
 		       &ObjectAttributes,
 		       0,
@@ -358,7 +358,7 @@
 			     0,
 			     RootKeyHandle,
 			     NULL);
-  Status = NtCreateKey(&KeyHandle,
+  Status = ZwCreateKey(&KeyHandle,
 		       STANDARD_RIGHTS_REQUIRED,
 		       &ObjectAttributes,
 		       0,
@@ -541,7 +541,7 @@
 			     OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_OPENLINK,
 			     NULL,
 			     NULL);
-  Status = NtCreateKey(&KeyHandle,
+  Status = ZwCreateKey(&KeyHandle,
 		       KEY_ALL_ACCESS | KEY_CREATE_LINK,
 		       &ObjectAttributes,
 		       0,
@@ -550,13 +550,13 @@
 		       NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
+      DPRINT1("ZwCreateKey() failed (Status %lx)\n", Status);
       return(Status);
     }
 
   RtlRosInitUnicodeStringFromLiteral(&LinkValue,
 				  L"SymbolicLinkValue");
-  Status = NtSetValueKey(KeyHandle,
+  Status = ZwSetValueKey(KeyHandle,
 			 &LinkValue,
 			 0,
 			 REG_LINK,
@@ -564,10 +564,10 @@
 			 TargetNameLength);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
+      DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status);
     }
 
-  NtClose(KeyHandle);
+  ZwClose(KeyHandle);
 
   return Status;
 }
@@ -721,7 +721,7 @@
 				      KernelMode,
 				      (PVOID*)&KeyObject,
 				      NULL);
-  NtClose (KeyHandle);
+  ZwClose (KeyHandle);
   if (!NT_SUCCESS(Status))
     {
       DPRINT1 ("ObReferenceObjectByName() failed (Status %lx)\n", Status);
@@ -776,7 +776,7 @@
 			      OBJ_CASE_INSENSITIVE,
 			      NULL,
 			      NULL);
-  Status = NtCreateKey (&KeyHandle,
+  Status = ZwCreateKey (&KeyHandle,
 			KEY_ALL_ACCESS,
 			&ObjectAttributes,
 			0,
@@ -785,10 +785,10 @@
 			NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1 ("NtCreateKey() failed (Status %lx)\n", Status);
+      DPRINT1 ("ZwCreateKey() failed (Status %lx)\n", Status);
       return Status;
     }
-  NtClose (KeyHandle);
+  ZwClose (KeyHandle);
 
   /* Link 'CurrentControlSet' to 'ControlSet001' key */
   RtlRosInitUnicodeStringFromLiteral (&ControlSetLinkName,
@@ -798,7 +798,7 @@
 			      OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_OPENLINK,
 			      NULL,
 			      NULL);
-  Status = NtCreateKey (&KeyHandle,
+  Status = ZwCreateKey (&KeyHandle,
 			KEY_ALL_ACCESS | KEY_CREATE_LINK,
 			&ObjectAttributes,
 			0,
@@ -807,13 +807,13 @@
 			NULL);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1 ("NtCreateKey() failed (Status %lx)\n", Status);
+      DPRINT1 ("ZwCreateKey() failed (Status %lx)\n", Status);
       return Status;
     }
 
   RtlRosInitUnicodeStringFromLiteral (&ControlSetValueName,
 				   L"SymbolicLinkValue");
-  Status = NtSetValueKey (KeyHandle,
+  Status = ZwSetValueKey (KeyHandle,
 			  &ControlSetValueName,
 			  0,
 			  REG_LINK,
@@ -821,9 +821,9 @@
 			  ControlSetKeyName.Length);
   if (!NT_SUCCESS(Status))
     {
-      DPRINT1 ("NtSetValueKey() failed (Status %lx)\n", Status);
+      DPRINT1 ("ZwSetValueKey() failed (Status %lx)\n", Status);
     }
-  NtClose (KeyHandle);
+  ZwClose (KeyHandle);
 
   return STATUS_SUCCESS;
 }
@@ -859,12 +859,12 @@
 				 OBJ_CASE_INSENSITIVE,
 				 NULL,
 				 NULL);
-      Status =  NtOpenKey(&KeyHandle,
+      Status =  ZwOpenKey(&KeyHandle,
 			  KEY_ALL_ACCESS,
 			  &ObjectAttributes);
       if (!NT_SUCCESS(Status))
 	{
-	  DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
+	  DPRINT1("ZwOpenKey() failed (Status %lx)\n", Status);
 	  return(Status);
 	}
 
@@ -876,17 +876,17 @@
 				 BufferSize);
       if (ValueInfo == NULL)
 	{
-	  NtClose(KeyHandle);
+	  ZwClose(KeyHandle);
 	  return(STATUS_INSUFFICIENT_RESOURCES);
 	}
 
-      Status = NtQueryValueKey(KeyHandle,
+      Status = ZwQueryValueKey(KeyHandle,
 			       &ValueName,
 			       KeyValuePartialInformation,
 			       ValueInfo,
 			       BufferSize,
 			       &ResultSize);
-      NtClose(KeyHandle);
+      ZwClose(KeyHandle);
       if (!NT_SUCCESS(Status))
 	{
 	  ExFreePool(ValueInfo);

Modified: trunk/reactos/ntoskrnl/ex/uuid.c
--- trunk/reactos/ntoskrnl/ex/uuid.c	2005-01-22 15:27:06 UTC (rev 13214)
+++ trunk/reactos/ntoskrnl/ex/uuid.c	2005-01-22 15:48:00 UTC (rev 13215)
@@ -72,12 +72,12 @@
 			     OBJ_CASE_INSENSITIVE,
 			     NULL,
 			     NULL);
-  Status = NtOpenKey(&KeyHandle,
+  Status = ZwOpenKey(&KeyHandle,
 		     KEY_QUERY_VALUE,
 		     &ObjectAttributes);
   if (!NT_SUCCESS(Status))
   {
-    DPRINT("NtOpenKey() failed (Status %lx)\n", Status);
+    DPRINT("ZwOpenKey() failed (Status %lx)\n", Status);
     return Status;
   }
 
@@ -85,16 +85,16 @@
 		       L"UuidSequenceNumber");
 
   ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
-  Status = NtQueryValueKey(KeyHandle,
+  Status = ZwQueryValueKey(KeyHandle,
 			   &Name,
 			   KeyValuePartialInformation,
 			   ValueBuffer,
 			   VALUE_BUFFER_SIZE,
 			   &ValueLength);
-  NtClose(KeyHandle);
+  ZwClose(KeyHandle);
   if (!NT_SUCCESS(Status))
   {
-    DPRINT("NtQueryValueKey() failed (Status %lx)\n", Status);
+    DPRINT("ZwQueryValueKey() failed (Status %lx)\n", Status);
     return Status;
   }
 
@@ -122,27 +122,27 @@
 			     OBJ_CASE_INSENSITIVE,
 			     NULL,
 			     NULL);
-  Status = NtOpenKey(&KeyHandle,
+  Status = ZwOpenKey(&KeyHandle,
 		     KEY_SET_VALUE,
 		     &ObjectAttributes);
   if (!NT_SUCCESS(Status))
   {
-    DPRINT("NtOpenKey() failed (Status %lx)\n", Status);
+    DPRINT("ZwOpenKey() failed (Status %lx)\n", Status);
     return Status;
   }
 
   RtlInitUnicodeString(&Name,
 		       L"UuidSequenceNumber");
-  Status = NtSetValueKey(KeyHandle,
+  Status = ZwSetValueKey(KeyHandle,
 			 &Name,
 			 0,
 			 REG_DWORD,
 			 Sequence,
 			 sizeof(ULONG));
-  NtClose(KeyHandle);
+  ZwClose(KeyHandle);
   if (!NT_SUCCESS(Status))
   {
-    DPRINT("NtSetValueKey() failed (Status %lx)\n", Status);
+    DPRINT("ZwSetValueKey() failed (Status %lx)\n", Status);
   }
 
   return Status;