Skip to content

Instantly share code, notes, and snippets.

@IceCubeDev
Created October 5, 2015 06:37
Show Gist options
  • Save IceCubeDev/201012d90212f34c473c to your computer and use it in GitHub Desktop.
Save IceCubeDev/201012d90212f34c473c to your computer and use it in GitHub Desktop.
itunnel_mux fix
// OLD Line: 41
HRESULT error = S_OK;
error = rgv(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Apple Inc.\\Apple Application Support", L"InstallDir", RRF_RT_REG_SZ|RRF_ZEROONFAILURE, NULL, (LPBYTE)wbuf, &cbBuf);
if (ERROR_SUCCESS != error) {
print_error(error);
Log(LOG_FATAL, "Could not locate 'Apple Application Support' folder path in registry: ABORTING");
return LIBMD_ERR_REGISTRY_ERROR;
}
// NEW
HRESULT error = S_OK;
HKEY deviceSupport = 0;
error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Apple Inc.\\Apple Application Support", 0, KEY_READ|KEY_WOW64_64KEY, &deviceSupport);
if (ERROR_SUCCESS != error) {
print_error(error);
Log(LOG_FATAL, "Could not read 'Apple Application Support' folder path in registry: ABORTING");
return LIBMD_ERR_REGISTRY_ERROR;
}
HRESULT error = S_OK;
error = rgv(deviceSupport, NULL, L"InstallDir", RRF_RT_REG_SZ|RRF_ZEROONFAILURE, NULL, (LPBYTE)wbuf, &cbBuf);
if (ERROR_SUCCESS != error) {
print_error(error);
Log(LOG_FATAL, "Could not locate 'Apple Application Support' folder path in registry: ABORTING");
RegCloseKey(deviceSupport);
return LIBMD_ERR_REGISTRY_ERROR;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment