Fix for bug 824 - proper handling of REG_MULTI_SZ

Randy Galbraith randy.galbraith at cox.net
Mon Oct 11 20:19:42 CDT 2004


This proposed patch addresses the concern raised by bug 824.  This patch 
changes the handling of REG_MULTI_SZ from REG_SZ to REG_BINARY.  For 
more details follow this URL:

http://bugs.winehq.org/show_bug.cgi?id=824

To see a test program follow this URL:

http://members.cox.net/~rgalbraith10/wine/bug824/demo824.c
http://members.cox.net/~rgalbraith10/wine/bug824/Makefile

===begin diff -u output of wine/server/registry.c 1.60===
--- registry.c- 2004-10-10 10:46:15.000000000 -0700
+++ registry.c  2004-10-10 12:26:35.000000000 -0700
@@ -157,7 +157,8 @@
  * - strings and key names can contain \x escapes for Unicode
  * - key names use escapes too in order to support Unicode
  * - the modification time optionally follows the key name
- * - REG_EXPAND_SZ and REG_MULTI_SZ are saved as strings instead of hex
+ * - REG_EXPAND_SZ are saved as strings instead of hex
+ * - REG_MULTI_SZ are saved hex (as of 10/10/04 -- see Bug 824)
  */
                                                                                                              

 static inline char to_hex( char ch )
@@ -195,7 +196,6 @@
     {
     case REG_SZ:
     case REG_EXPAND_SZ:
-    case REG_MULTI_SZ:
         if (value->type != REG_SZ) fprintf( f, "str(%d):", value->type );
         fputc( '\"', f );
         if (value->data) dump_strW( (WCHAR *)value->data, value->len / 
sizeof(WCHAR), f, "\"\"" );
@@ -1123,7 +1123,7 @@
         { "\"",        1,   REG_SZ,              REG_SZ },
         { "str:\"",    5,   REG_SZ,              REG_SZ },
         { "str(2):\"", 8,   REG_EXPAND_SZ,       REG_SZ },
-        { "str(7):\"", 8,   REG_MULTI_SZ,        REG_SZ },
+        { "hex(7):",   8,   REG_MULTI_SZ,        REG_BINARY },
         { "hex:",      4,   REG_BINARY,          REG_BINARY },
         { "dword:",    6,   REG_DWORD,           REG_DWORD },
         { "hex(",      4,   -1,                  REG_BINARY },
===end diff -u output===
This is my first attempt at creating a patch for wine.  Any feedback is 
greatly appreciated.

Kind regards,
-Randy Galbraith




More information about the wine-patches mailing list