Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Wed, 14 Jul 2004 13:28:43 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com Subject: Re: cat /proc/registry/HKEY_PERFOMANCE_DATA/@ hangs In-Reply-To: <20040714171503.GX1389@cygbert.vinschen.de> Message-ID: References: <20040714171503 DOT GX1389 AT cygbert DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 On Wed, 14 Jul 2004, Corinna Vinschen wrote: > On Jul 14 17:58, Dave Korn wrote: > > > -----Original Message----- > > > From: cygwin-owner On Behalf Of Igor Pechtchanski > > > Sent: 14 July 2004 04:22 > > > > > Ok, the theory washed out. The code above is actually simply buggy. > > > When RegQueryValueEx is called (2 lines below the arrow), the "size" > > > parameter is uninitialized, so, in effect, it keeps thinking that > > > the buffer has some random size and reallocating (which, of course, > > > doesn't change the size, hence the infinite loop). > > > > I concur; that is bad code. The variable unambiguously needs > > initialising, and since RegQueryValueEx damages it, it needs to be re-set > > each time round the loop. > > [...] > > I'm wondering if that isn't mildly OT here. Shouldn't that be discussed > on cygwin-developers in a perfect world? > > Corinna Yes, but the world is not perfect, and if we move this thread to cygwin-developers now, we'll lose thread continuity. I'll do it if you insist, though. I'm about to reply to Dave, so please let me know. :-) Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/