Mail Archives: cygwin-developers/1999/04/29/17:06:46
The following fix is hopefully obvious. Think of what happens when you
pass a copy of a (open) reg_key to a function -- it calls the destructor
on the way back, and so the does the original and RegClose crashes trying.
The current implementation of reg_key is dangerous in that it blindly
allows a copy construction; it should really disable copying by using
a private copy. However that'll break the subkey generation, so it'll
take a bit of rework.
The current code should always crash in mount_info::from_registry ()
when Cygwin1.dll starts up.
Against ss-1999-04-27.
Thu Apr 29 13:55:57 1999 Mumit Khan <khan AT xraylith DOT wisc DOT edu>
* shared.h (read_mounts): Change prototype to accept a reference
to reg_key, not a copy.
* path.cc (read_mounts): Likewise.
--- shared.h.~1 Thu Apr 29 13:51:51 1999
+++ shared.h Thu Apr 29 13:52:13 1999
@@ -335,7 +335,7 @@ public:
private:
void sort ();
- void read_mounts (reg_key r);
+ void read_mounts (reg_key& r);
void read_v1_mounts (reg_key r, const int which);
void mount_slash ();
void to_registry ();
--- path.cc.~1 Thu Apr 29 13:55:20 1999
+++ path.cc Thu Apr 29 13:52:19 1999
@@ -1158,7 +1158,7 @@ mount_info::binary_win32_path_p (const c
key. */
void
-mount_info::read_mounts (reg_key r)
+mount_info::read_mounts (reg_key& r)
{
HKEY key = r.get_key ();
LONG err;
Regards,
Mumit
- Raw text -