Commit d56b3c10 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Don't hardcode the system32 directory in registered classes.

parent 959113d2
......@@ -273,23 +273,23 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list)
}
if (list->idName) {
char buffer[64] = "@%SYSTEMROOT%\\system32\\shell32.dll,-";
sprintf(buffer+strlen(buffer), "%u", list->idName);
res = RegSetValueExA(clsid_key, localized_valuename, 0, REG_EXPAND_SZ,
char buffer[64];
sprintf(buffer, "@shell32.dll,-%u", list->idName);
res = RegSetValueExA(clsid_key, localized_valuename, 0, REG_SZ,
(CONST BYTE*)(buffer), strlen(buffer)+1);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
}
if (list->idDefaultIcon) {
HKEY icon_key;
char buffer[64] = "%SYSTEMROOT%\\system32\\shell32.dll,-";
char buffer[64];
res = RegCreateKeyExW(clsid_key, defaulticon_keyname, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &icon_key, NULL);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
sprintf(buffer+strlen(buffer), "%u", list->idDefaultIcon);
res = RegSetValueExA(icon_key, NULL, 0, REG_EXPAND_SZ,
sprintf(buffer, "shell32.dll,-%u", list->idDefaultIcon);
res = RegSetValueExA(icon_key, NULL, 0, REG_SZ,
(CONST BYTE*)(buffer), strlen(buffer)+1);
RegCloseKey(icon_key);
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment