[ros-diffs] [fireball] 23727: Dmitry Philippov: - Implement RTL_QUERY_REGISTRY_DELETE (which simply deletes the key after querying) - Fix REG_MULTI_SZ to actually walk through the whole data, not stopping at the first encountered 0 character. This makes the "ntdll_winetest.exe reg" test behave exactly as on Windows XP

fireball at svn.reactos.org fireball at svn.reactos.org
Sat Aug 26 22:45:31 CEST 2006


Author: fireball
Date: Sun Aug 27 00:45:30 2006
New Revision: 23727

URL: http://svn.reactos.org/svn/reactos?rev=23727&view=rev
Log:
Dmitry Philippov:
 - Implement RTL_QUERY_REGISTRY_DELETE (which simply deletes the key after querying)
 - Fix REG_MULTI_SZ to actually walk through the whole data, not stopping at the first encountered 0 character. This makes the "ntdll_winetest.exe reg" test behave exactly as on Windows XP

Modified:
    trunk/reactos/lib/rtl/registry.c

Modified: trunk/reactos/lib/rtl/registry.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/registry.c?rev=23727&r1=23726&r2=23727&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/registry.c (original)
+++ trunk/reactos/lib/rtl/registry.c Sun Aug 27 00:45:30 2006
@@ -9,7 +9,6 @@
 /*
  * TODO:
  *   - finish RtlQueryRegistryValues()
- *	- support RTL_QUERY_REGISTRY_DELETE
  */
 
 /* INCLUDES *****************************************************************/
@@ -784,7 +783,7 @@
 
 	  if (QueryEntry->Flags & RTL_QUERY_REGISTRY_DELETE)
 	    {
-	      DPRINT1("FIXME: Delete value: %S\n", QueryEntry->Name);
+		  Status = ZwDeleteValueKey(CurrentKeyHandle, &KeyName);
 
 	    }
 
@@ -828,8 +827,9 @@
 		       !(QueryEntry->Flags & RTL_QUERY_REGISTRY_NOEXPAND))
 		{
 		  DPRINT("Expand REG_MULTI_SZ type\n");
+		  ULONG DataSize = 0;
 		  StringPtr = (PWSTR)ValueInfo->Data;
-		  while (*StringPtr != 0)
+		  while (DataSize < (ValueInfo->DataLength-2))
 		    {
 		      StringLen = (wcslen(StringPtr) + 1) * sizeof(WCHAR);
 		      Status = QueryEntry->QueryRoutine(QueryEntry->Name,
@@ -841,6 +841,7 @@
 		      if(!NT_SUCCESS(Status))
 			break;
 		      StringPtr = (PWSTR)((PUCHAR)StringPtr + StringLen);
+			  DataSize += StringLen;
 		    }
 		}
 	      else if ((ValueInfo->Type == REG_EXPAND_SZ) &&
@@ -889,8 +890,7 @@
 
 	      if (QueryEntry->Flags & RTL_QUERY_REGISTRY_DELETE)
 		{
-		  DPRINT1("FIXME: Delete value: %S\n", QueryEntry->Name);
-
+			Status = ZwDeleteValueKey(CurrentKeyHandle, &KeyName);
 		}
 
 	      RtlpFreeMemory(ValueInfo, TAG_RTLREGISTRY);




More information about the Ros-diffs mailing list