I have made two changes:
RegEnumValueW needs a buffer for value name:
if(RegQueryValueW(hCurKey, NULL, buffer, &lenBuffer) == ERROR_SUCCESS && *buffer)
U(tvis).item.pszText = buffer;
else
if(RegEnumValueW(hCurKey, 0, valName, &lenBuffer, NULL, NULL,
(LPBYTE)buffer, &lenBufferHlp) == ERROR_SUCCESS && *buffer)
Win2K compatibly:
// if(RegGetValueW(hKey, NULL, wszEnableDCOM, RRF_RT_REG_SZ, NULL, buffer, &bufSize) != ERROR_SUCCESS)
if(RegQueryValueExW(hKey, wszEnableDCOM, NULL, NULL, (LPBYTE)buffer, &bufSize) != ERROR_SUCCESS)
{
bufSize = sizeof(wszYes);
RegSetValueExW(hKey, wszEnableDCOM, 0, REG_SZ, (BYTE*)wszYes, bufSize);
}
CheckDlgButton(hDlgWnd, IDC_ENABLEDCOM,
buffer[0]=='Y' ? BST_CHECKED : BST_UNCHECKED);
bufSize = sizeof(buffer);
// if(RegGetValueW(hKey, NULL, wszEnableRemote, RRF_RT_REG_SZ, NULL, buffer, &bufSize) != ERROR_SUCCESS)
if(RegQueryValueExW(hKey, wszEnableRemote, NULL, NULL, (LPBYTE)buffer, &bufSize) != ERROR_SUCCESS)
czerny