ec = RegSetValueEx (h, key, 0, REG_SZ, (const BYTE*)val, strlen(val));
if (strchr (val, '%')) type = REG_EXPAND_SZ; ec = RegSetValueEx (h, key, 0, type, (const BYTE*)val, strlen(val));
store_config_value (HKEY hk, const char *path, const char *key, const char *val){    HKEY h;    int ec;    if (hk == NULL)	hk = HKEY_CURRENT_USER;    ec = RegOpenKeyEx (hk, path, 0, KEY_ALL_ACCESS, &h);    if (ec != ERROR_SUCCESS)	return -1;    ec = RegSetValueEx (h, key, 0, REG_SZ, (const BYTE*)val, strlen(val));    if (ec != ERROR_SUCCESS) {	RegCloseKey(h);	return -1;    }    RegCloseKey(h);    return 0;}