>>Also the constant resizing of the buffsizes value is pointless being that they never change through out this
That's needed because RegEnumValue() changes the variable to the actual length of the text inserted into the destination buffer (the string may or may not be null-terminated). So you have to change it back to the original value before calling RegEnumValue() again.
Quote:
lpcbData
A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes. When the function returns, this variable contains the size of the data copied to lpData.
|