-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
_w95_dump_dke has code in it that processes sibling keys in the registry
recursively. This results in a stack blowout for large registries (in my case
in the Software\CLASSES key).
It's trivial to stop the stack blowing out by changing this not to be
recursive, but processing siblings recursively is such an unusual thing to do
that I suspect it must have been done for a reason. Attached is the way I've
"fixed" it, but this causes the keys to be output in the opposite order to
the way they are output with the CVS code.
Is there a reason this needs to be done in the order the CVS code is doing
it?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA8bbd2IoBoXB5Q0kRAoJEAJ9IbtBVxkly+8t8LPL2ZmD/RVwq6wCdHG2t
QxlBYcbU/VVdeXLx0QVgQlo=
=ZSKw
-----END PGP SIGNATURE-----
Index: misc/registry.c
===================================================================
RCS file: /home/wine/wine/misc/registry.c,v
retrieving revision 1.144
diff -u -r1.144 registry.c
--- misc/registry.c 14 Jun 2004 17:04:34 -0000 1.144
+++ misc/registry.c 10 Jul 2004 22:55:22 -0000
@@ -688,10 +688,24 @@
return TRUE;
}
+static int _w95_dump_one_dke(LPCSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *dke,FILE *f,int level);
+
+static int _w95_dump_dke(LPCSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *dke,FILE *f,int level)
+{
+ while (1)
+ {
+ if (!_w95_dump_one_dke(key_name, creg, rgkn, dke, f, level))
+ return FALSE;
+ if (dke->next == 0xffffffff)
+ return TRUE;
+ dke = (_w95dke*)((char*)rgkn+dke->next);
+ }
+}
+
/******************************************************************************
* _w95_dump_dke [Internal]
*/
-static int _w95_dump_dke(LPCSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *dke,FILE *f,int level)
+static int _w95_dump_one_dke(LPCSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *dke,FILE *f,int level)
{
_w95dkh * dkh;
LPSTR new_key_name = NULL;
@@ -720,6 +734,7 @@
memcpy( new_key_name + len, dkh->name, dkh->keynamelen );
new_key_name[len + dkh->keynamelen] = 0;
+#if 0
/* walk sibling keys */
if (dke->next != 0xffffffff ) {
if (!_w95_dump_dke(key_name, creg, rgkn, (_w95dke*)((char*)rgkn+dke->next),f,level)) {
@@ -727,6 +742,7 @@
return FALSE;
}
}
+#endif
/* write the key path (something like [Software\\Microsoft\\..]) only if:
1) key has some values