myoung5655 has asked for the wisdom of the Perl Monks concerning the following question:
Looking at that code, it appeared there was an assumption that an error would be generated by the call to RegEnumKeyEx (specifically, that it would be ERROR_NO_MORE_ITEMS) when there were no more subkeys. In single stepping this code, I saw that there was no error...the call to Errnum was returning zero. Modifying the code to NoMoreItems to check for either $_NoMoreItems or zeroif( ! _NoMoreItems() ) { return (); }
eliminated the error and allowed the code to return data as expected. if this is expected, the change would have to be augmented to deal with a "no error" message as well. Has anyone know if there was an interface change for RegEnumKeyEx that resulted in it returning no error after processing the last subkey? gratz.sub _NoMoreItems { my $rval; return $_NoMoreItems =~ /^\d/ ? (_ErrNum() == $_NoMoreItems || _ErrNum() == 0) : _ErrMsg() =~ /$_NoMoreItems/io; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with TieRegistry.pm on windows xp/cygwin ($^E)
by tye (Sage) on Dec 13, 2007 at 18:27 UTC | |
by myoung5655 (Initiate) on Dec 13, 2007 at 20:20 UTC |