I had been messing with this a bit from the original, but I wasn't exactly sure of what it was the VB was doing. Could you provide an example of what the function is intended to do? Something along the lines of...
[Background information about function usage.]
The function
DWORD RegGetStringValue(HKEY hKey,LPTSTR sValue,DWORD* dwDataSize)
is used to retrieve a string from the registry. The example on MSDN is not sufficient because [...].
I have already done a [...] to get the hKey that is passed to this function. An example value would be [...]. The sValue is where the string will go, and dwDataSize is a pointer to a variable containing its maximum length.
I realize that the calling code must free() the pointer returned by this function. An example usage would be like this.
/* setup code */
retval = RegGetStringValue(hKey, "", 1);
/* cleanup code */ More information will make the question easier to answer correctly.