# HG changeset patch # Parent c4cc354989ec979c597016a6f40ce5fac89cd916 # User timeless@mozdev.org Bug 575266 Mozilla Crash Reporter should not display all options but "Close Window" r=ted diff --git a/toolkit/crashreporter/client/crashreporter.cpp b/toolkit/crashreporter/client/crashreporter.cpp --- a/toolkit/crashreporter/client/crashreporter.cpp +++ b/toolkit/crashreporter/client/crashreporter.cpp @@ -613,10 +613,36 @@ int main(int argc, char** argv) } #if defined(XP_WIN) && !defined(__GNUC__) +#include "windows.h" + +#define REG_OPEN_KEY(hkParent, szPath, lhKey) \ + RegCreateKeyEx(hkParent, szPath, \ + 0, 0, REG_OPTION_NON_VOLATILE, \ + 0, 0, lhKey, 0) + // We need WinMain in order to not be a console app. This function is unused // if we are a console application. int WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR args, int ) { + { + HKEY hkApps; + if (REG_OPEN_KEY(HKEY_CURRENT_USER, L"Software\\Applications", &hkApps) == ERROR_SUCCESS) { + HKEY hkApp; + WCHAR* appname = wcsrchr(__wargv[0], '\\'); + if (appname && + REG_OPEN_KEY(hkApps, appname + 1, &hkApp) == ERROR_SUCCESS) { + if (RegQueryValueExW(hkApp, L"IsHostApp", 0, 0, 0, 0) == ERROR_FILE_NOT_FOUND) { + RegSetValueEx(hkApp, L"IsHostApp", 0, REG_NONE, 0, 0); + } + if (RegQueryValueExW(hkApp, L"NoStartPage", 0, 0, 0, 0) == ERROR_FILE_NOT_FOUND) { + RegSetValueEx(hkApp, L"NoStartPage", 0, REG_NONE, 0, 0); + } + RegCloseKey(hkApp); + } + RegCloseKey(hkApps); + } + } + char** argv = static_cast(malloc(__argc * sizeof(char*))); for (int i = 0; i < __argc; i++) { argv[i] = strdup(WideToUTF8(__wargv[i]).c_str());