What's wrong with this code, it works in Win2K, but
not in WinXP ?

It seems that the program enters an infinite loop, using
RegEnumValue, because the function suddenly doesn't return
ERROR_NO_MORE_ITEMS.

Why is this in XP :confused: :(
Posted on 2004-06-22 17:14:58 by The SharK
I got the infinite loop when I ran your exe.

Maybe you should change your code after you call RegEnumValue
Check the return code, if it is not equal to ERROR_SUCCESS and not equal to ERROR_MORE_DATA then stop the loop and go to an error handling routine.

If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Posted on 2004-06-22 19:42:39 by Mecurius
I found your problem.

There was a few little things around your "proc" that kinda all added up to a problem. Basically as Mecurius pointed out, your error checking was extremely limited, and the setup to each enumeration call was not correct. The call will modify the 255 values in the byte count pointers.. As such you get "Stuck" in your loop because it "Has more data" but needs a string that has been identified to hold the next value.

Another issue i have is your using JMP's to CALL a proc, and rely on this "proc" to return from the scope that jumped to it. Basically you want a function not a proc.

Lastly, it appears your deliberately looking to avoid proc's. I dont know why or where this trend comes from, but your source is more or less spegetti code and would be far more readable and stable if your did use procs and a systematic calling stack. To this end, i only got it working past your first "call". It crashed later on, and i dont really care to find it in the spegetti. I know i got the enumerations working, which is what your asked for help on.

Regards,
:alright:
:NaN:
Posted on 2004-06-22 20:20:47 by NaN
Hi NaN !

Thanks for the hints about good coding practice.

You're right,
I have to make the code more readable, and with
less spaghetti in it :)

I'll try to boil it down to maybe 4 PROC's==clean code ;-)



Btw. I love (to eat) spaghetti.:alright:
Posted on 2004-06-24 03:15:32 by The SharK