Author: hbelusca
Date: Sat Jul 20 00:37:47 2013
New Revision: 59529
URL: http://svn.reactos.org/svn/reactos?rev=59529&view=rev
Log:
[REGEDIT]
Fix the creation of empty REG_MULTI_SZ values (they have to contain only one NULL char, since a multi-string has the form:
str1\0str2\0...strN\0\0
where each strI\0 is a null-terminated string, and a multi-string is terminated by a null string.
And therefore an empty multi-string has only one null char, corresponding to the terminating null string.
Modified:
trunk/reactos/base/applications/regedit/framewnd.c
trunk/reactos/base/applications/regedit/listview.c
Modified: trunk/reactos/base/applications/regedit/framewnd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] Sat Jul 20 00:37:47 2013
@@ -853,10 +853,19 @@
cbData = sizeof(WCHAR);
break;
case REG_MULTI_SZ:
- cbData = sizeof(WCHAR) * 2;
- break;
- case REG_QWORD:
- cbData = sizeof(DWORD) * 2;
+ /*
+ * WARNING: An empty multi-string has only one null char.
+ * Indeed, multi-strings are built in the following form:
+ * str1\0str2\0...strN\0\0
+ * where each strI\0 is a null-terminated string, and it
+ * ends with a terminating empty string.
+ * Therefore an empty multi-string contains only the terminating
+ * empty string, that is, one null char.
+ */
+ cbData = sizeof(WCHAR);
+ break;
+ case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
+ cbData = sizeof(DWORDLONG); // == sizeof(DWORD) * 2;
break;
default:
cbData = 0;
Modified: trunk/reactos/base/applications/regedit/listview.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/listview.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/listview.c [iso-8859-1] Sat Jul 20 00:37:47 2013
@@ -439,7 +439,7 @@
return ((int)dw2 - (int)dw1);
}
- case REG_QWORD:
+ case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
{
qw1 = *(DWORDLONG*)l->val;
qw2 = *(DWORDLONG*)r->val;