summaryrefslogtreecommitdiffstats
path: root/widget/windows
diff options
context:
space:
mode:
Diffstat (limited to 'widget/windows')
-rw-r--r--widget/windows/GfxInfo.cpp100
-rw-r--r--widget/windows/KeyboardLayout.cpp117
-rw-r--r--widget/windows/LSPAnnotator.cpp156
-rw-r--r--widget/windows/moz.build5
-rw-r--r--widget/windows/nsAppShell.cpp4
5 files changed, 1 insertions, 381 deletions
diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp
index bfea41851..8a429ad32 100644
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -21,12 +21,6 @@
#include "nsPrintfCString.h"
#include "jsapi.h"
-#if defined(MOZ_CRASHREPORTER)
-#include "nsExceptionHandler.h"
-#include "nsICrashReporter.h"
-#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
-#endif
-
using namespace mozilla;
using namespace mozilla::gfx;
using namespace mozilla::widget;
@@ -721,102 +715,10 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
return NS_OK;
}
-#if defined(MOZ_CRASHREPORTER)
-/* Cisco's VPN software can cause corruption of the floating point state.
- * Make a note of this in our crash reports so that some weird crashes
- * make more sense */
-static void
-CheckForCiscoVPN() {
- LONG result;
- HKEY key;
- /* This will give false positives, but hopefully no false negatives */
- result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Cisco Systems\\VPN Client", 0, KEY_QUERY_VALUE, &key);
- if (result == ERROR_SUCCESS) {
- RegCloseKey(key);
- CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("Cisco VPN\n"));
- }
-}
-#endif
-
void
GfxInfo::AddCrashReportAnnotations()
{
-#if defined(MOZ_CRASHREPORTER)
- CheckForCiscoVPN();
-
- if (mHasDriverVersionMismatch) {
- CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("DriverVersionMismatch\n"));
- }
-
- nsString deviceID, vendorID, driverVersion, subsysID;
- nsCString narrowDeviceID, narrowVendorID, narrowDriverVersion, narrowSubsysID;
-
- GetAdapterDeviceID(deviceID);
- CopyUTF16toUTF8(deviceID, narrowDeviceID);
- GetAdapterVendorID(vendorID);
- CopyUTF16toUTF8(vendorID, narrowVendorID);
- GetAdapterDriverVersion(driverVersion);
- CopyUTF16toUTF8(driverVersion, narrowDriverVersion);
- GetAdapterSubsysID(subsysID);
- CopyUTF16toUTF8(subsysID, narrowSubsysID);
-
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"),
- narrowVendorID);
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
- narrowDeviceID);
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"),
- narrowDriverVersion);
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterSubsysID"),
- narrowSubsysID);
-
- /* Add an App Note for now so that we get the data immediately. These
- * can go away after we store the above in the socorro db */
- nsAutoCString note;
- /* AppendPrintf only supports 32 character strings, mrghh. */
- note.AppendLiteral("AdapterVendorID: ");
- note.Append(narrowVendorID);
- note.AppendLiteral(", AdapterDeviceID: ");
- note.Append(narrowDeviceID);
- note.AppendLiteral(", AdapterSubsysID: ");
- note.Append(narrowSubsysID);
- note.AppendLiteral(", AdapterDriverVersion: ");
- note.Append(NS_LossyConvertUTF16toASCII(driverVersion));
-
- if (vendorID == GfxDriverInfo::GetDeviceVendor(VendorAll)) {
- /* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */
- note.AppendLiteral(", ");
- LossyAppendUTF16toASCII(mDeviceID, note);
- note.AppendLiteral(", ");
- LossyAppendUTF16toASCII(mDeviceKeyDebug, note);
- LossyAppendUTF16toASCII(mDeviceKeyDebug, note);
- }
- note.Append("\n");
-
- if (mHasDualGPU) {
- nsString deviceID2, vendorID2, subsysID2;
- nsAutoString adapterDriverVersionString2;
- nsCString narrowDeviceID2, narrowVendorID2, narrowSubsysID2;
-
- note.AppendLiteral("Has dual GPUs. GPU #2: ");
- GetAdapterDeviceID2(deviceID2);
- CopyUTF16toUTF8(deviceID2, narrowDeviceID2);
- GetAdapterVendorID2(vendorID2);
- CopyUTF16toUTF8(vendorID2, narrowVendorID2);
- GetAdapterDriverVersion2(adapterDriverVersionString2);
- GetAdapterSubsysID(subsysID2);
- CopyUTF16toUTF8(subsysID2, narrowSubsysID2);
- note.AppendLiteral("AdapterVendorID2: ");
- note.Append(narrowVendorID2);
- note.AppendLiteral(", AdapterDeviceID2: ");
- note.Append(narrowDeviceID2);
- note.AppendLiteral(", AdapterSubsysID2: ");
- note.Append(narrowSubsysID2);
- note.AppendLiteral(", AdapterDriverVersion2: ");
- note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2));
- }
- CrashReporter::AppendAppNotesToCrashReport(note);
-
-#endif
+ /*** STUB ***/
}
static OperatingSystem
diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp
index 341a40c18..9166d97d7 100644
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -13,9 +13,6 @@
#include "mozilla/WindowsVersion.h"
#include "nsAlgorithm.h"
-#ifdef MOZ_CRASHREPORTER
-#include "nsExceptionHandler.h"
-#endif
#include "nsGkAtoms.h"
#include "nsIDOMKeyEvent.h"
#include "nsIIdleServiceInternal.h"
@@ -2740,42 +2737,6 @@ NativeKey::NeedsToHandleWithoutFollowingCharMessages() const
return mIsPrintableKey;
}
-#ifdef MOZ_CRASHREPORTER
-
-static nsCString
-GetResultOfInSendMessageEx()
-{
- DWORD ret = ::InSendMessageEx(nullptr);
- if (!ret) {
- return NS_LITERAL_CSTRING("ISMEX_NOSEND");
- }
- nsAutoCString result;
- if (ret & ISMEX_CALLBACK) {
- result = "ISMEX_CALLBACK";
- }
- if (ret & ISMEX_NOTIFY) {
- if (!result.IsEmpty()) {
- result += " | ";
- }
- result += "ISMEX_NOTIFY";
- }
- if (ret & ISMEX_REPLIED) {
- if (!result.IsEmpty()) {
- result += " | ";
- }
- result += "ISMEX_REPLIED";
- }
- if (ret & ISMEX_SEND) {
- if (!result.IsEmpty()) {
- result += " | ";
- }
- result += "ISMEX_SEND";
- }
- return result;
-}
-
-#endif // #ifdef MOZ_CRASHREPORTER
-
bool
NativeKey::MayBeSameCharMessage(const MSG& aCharMsg1,
const MSG& aCharMsg2) const
@@ -3019,33 +2980,6 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg)
}
if (doCrash) {
-#ifdef MOZ_CRASHREPORTER
- nsPrintfCString info("\nPeekMessage() failed to remove char message! "
- "\nActive keyboard layout=0x%08X (%s), "
- "\nHandling message: %s, InSendMessageEx()=%s, "
- "\nFound message: %s, "
- "\nWM_NULL has been removed: %d, "
- "\nNext key message in all windows: %s, "
- "time=%d, ",
- KeyboardLayout::GetActiveLayout(),
- KeyboardLayout::GetActiveLayoutName().get(),
- ToString(mMsg).get(),
- GetResultOfInSendMessageEx().get(),
- ToString(kFoundCharMsg).get(), i,
- ToString(nextKeyMsgInAllWindows).get(),
- nextKeyMsgInAllWindows.time);
- CrashReporter::AppendAppNotesToCrashReport(info);
- MSG nextMsg;
- if (WinUtils::PeekMessage(&nextMsg, 0, 0, 0,
- PM_NOREMOVE | PM_NOYIELD)) {
- nsPrintfCString info("\nNext message in all windows: %s, time=%d",
- ToString(nextMsg).get(), nextMsg.time);
- CrashReporter::AppendAppNotesToCrashReport(info);
- } else {
- CrashReporter::AppendAppNotesToCrashReport(
- NS_LITERAL_CSTRING("\nThere is no message in any window"));
- }
-#endif // #ifdef MOZ_CRASHREPORTER
MOZ_CRASH("We lost the following char message");
}
@@ -3164,63 +3098,12 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg)
"nextKeyMsg=%s, kFoundCharMsg=%s",
this, ToString(removedMsg).get(), ToString(nextKeyMsg).get(),
ToString(kFoundCharMsg).get()));
-#ifdef MOZ_CRASHREPORTER
- nsPrintfCString info("\nPeekMessage() removed unexpcted char message! "
- "\nActive keyboard layout=0x%08X (%s), "
- "\nHandling message: %s, InSendMessageEx()=%s, "
- "\nFound message: %s, "
- "\nRemoved message: %s, ",
- KeyboardLayout::GetActiveLayout(),
- KeyboardLayout::GetActiveLayoutName().get(),
- ToString(mMsg).get(),
- GetResultOfInSendMessageEx().get(),
- ToString(kFoundCharMsg).get(),
- ToString(removedMsg).get());
- CrashReporter::AppendAppNotesToCrashReport(info);
- // What's the next key message?
- MSG nextKeyMsgAfter;
- if (WinUtils::PeekMessage(&nextKeyMsgAfter, mMsg.hwnd,
- WM_KEYFIRST, WM_KEYLAST,
- PM_NOREMOVE | PM_NOYIELD)) {
- nsPrintfCString info("\nNext key message after unexpected char message "
- "removed: %s, ",
- ToString(nextKeyMsgAfter).get());
- CrashReporter::AppendAppNotesToCrashReport(info);
- } else {
- CrashReporter::AppendAppNotesToCrashReport(
- NS_LITERAL_CSTRING("\nThere is no key message after unexpected char "
- "message removed, "));
- }
- // Another window has a key message?
- if (WinUtils::PeekMessage(&nextKeyMsgInAllWindows, 0,
- WM_KEYFIRST, WM_KEYLAST,
- PM_NOREMOVE | PM_NOYIELD)) {
- nsPrintfCString info("\nNext key message in all windows: %s.",
- ToString(nextKeyMsgInAllWindows).get());
- CrashReporter::AppendAppNotesToCrashReport(info);
- } else {
- CrashReporter::AppendAppNotesToCrashReport(
- NS_LITERAL_CSTRING("\nThere is no key message in any windows."));
- }
-#endif // #ifdef MOZ_CRASHREPORTER
MOZ_CRASH("PeekMessage() removed unexpected message");
}
MOZ_LOG(sNativeKeyLogger, LogLevel::Error,
("%p NativeKey::GetFollowingCharMessage(), FAILED, removed messages "
"are all WM_NULL, nextKeyMsg=%s",
this, ToString(nextKeyMsg).get()));
-#ifdef MOZ_CRASHREPORTER
- nsPrintfCString info("\nWe lost following char message! "
- "\nActive keyboard layout=0x%08X (%s), "
- "\nHandling message: %s, InSendMessageEx()=%s, \n"
- "Found message: %s, removed a lot of WM_NULL",
- KeyboardLayout::GetActiveLayout(),
- KeyboardLayout::GetActiveLayoutName().get(),
- ToString(mMsg).get(),
- GetResultOfInSendMessageEx().get(),
- ToString(kFoundCharMsg).get());
- CrashReporter::AppendAppNotesToCrashReport(info);
-#endif // #ifdef MOZ_CRASHREPORTER
MOZ_CRASH("We lost the following char message");
return false;
}
diff --git a/widget/windows/LSPAnnotator.cpp b/widget/windows/LSPAnnotator.cpp
deleted file mode 100644
index 97f6e5b50..000000000
--- a/widget/windows/LSPAnnotator.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * LSPs are evil little bits of code that are allowed to inject into our
- * networking stack by Windows. Once they have wormed into our process
- * they gnaw at our innards until we crash. Here we force the buggers
- * into the light by recording them in our crash information.
- * We do the enumeration on a thread because I'm concerned about startup perf
- * on machines with several LSPs.
- */
-
-#include "nsICrashReporter.h"
-#include "nsISupportsImpl.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-#include "nsQueryObject.h"
-#include "nsWindowsHelpers.h"
-#include <windows.h>
-#include <rpc.h>
-#include <ws2spi.h>
-
-namespace mozilla {
-namespace crashreporter {
-
-class LSPAnnotationGatherer : public Runnable
-{
- ~LSPAnnotationGatherer() {}
-
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIRUNNABLE
-
- void Annotate();
- nsCString mString;
- nsCOMPtr<nsIThread> mThread;
-};
-
-NS_IMPL_ISUPPORTS(LSPAnnotationGatherer, nsIRunnable)
-
-void
-LSPAnnotationGatherer::Annotate()
-{
- nsCOMPtr<nsICrashReporter> cr =
- do_GetService("@mozilla.org/toolkit/crash-reporter;1");
- bool enabled;
- if (cr && NS_SUCCEEDED(cr->GetEnabled(&enabled)) && enabled) {
- cr->AnnotateCrashReport(NS_LITERAL_CSTRING("Winsock_LSP"), mString);
- }
- mThread->AsyncShutdown();
-}
-
-NS_IMETHODIMP
-LSPAnnotationGatherer::Run()
-{
- PR_SetCurrentThreadName("LSP Annotator");
-
- mThread = NS_GetCurrentThread();
-
- DWORD size = 0;
- int err;
- // Get the size of the buffer we need
- if (SOCKET_ERROR != WSCEnumProtocols(nullptr, nullptr, &size, &err) ||
- err != WSAENOBUFS) {
- // Er, what?
- NS_NOTREACHED("WSCEnumProtocols suceeded when it should have failed ...");
- return NS_ERROR_FAILURE;
- }
-
- auto byteArray = MakeUnique<char[]>(size);
- WSAPROTOCOL_INFOW* providers =
- reinterpret_cast<WSAPROTOCOL_INFOW*>(byteArray.get());
-
- int n = WSCEnumProtocols(nullptr, providers, &size, &err);
- if (n == SOCKET_ERROR) {
- // Lame. We provided the right size buffer; we'll just give up now.
- NS_WARNING("Could not get LSP list");
- return NS_ERROR_FAILURE;
- }
-
- nsCString str;
- for (int i = 0; i < n; i++) {
- AppendUTF16toUTF8(nsDependentString(providers[i].szProtocol), str);
- str.AppendLiteral(" : ");
- str.AppendInt(providers[i].iVersion);
- str.AppendLiteral(" : ");
- str.AppendInt(providers[i].iAddressFamily);
- str.AppendLiteral(" : ");
- str.AppendInt(providers[i].iSocketType);
- str.AppendLiteral(" : ");
- str.AppendInt(providers[i].iProtocol);
- str.AppendLiteral(" : ");
- str.AppendPrintf("0x%x", providers[i].dwServiceFlags1);
- str.AppendLiteral(" : ");
- str.AppendPrintf("0x%x", providers[i].dwProviderFlags);
- str.AppendLiteral(" : ");
-
- wchar_t path[MAX_PATH];
- int pathLen = MAX_PATH;
- if (!WSCGetProviderPath(&providers[i].ProviderId, path, &pathLen, &err)) {
- AppendUTF16toUTF8(nsDependentString(path), str);
- }
-
- str.AppendLiteral(" : ");
- // If WSCGetProviderInfo is available, we should call it to obtain the
- // category flags for this provider. When present, these flags inform
- // Windows as to which order to chain the providers.
- nsModuleHandle ws2_32(LoadLibraryW(L"ws2_32.dll"));
- if (ws2_32) {
- decltype(WSCGetProviderInfo)* pWSCGetProviderInfo =
- reinterpret_cast<decltype(WSCGetProviderInfo)*>(
- GetProcAddress(ws2_32, "WSCGetProviderInfo"));
- if (pWSCGetProviderInfo) {
- DWORD categoryInfo;
- size_t categoryInfoSize = sizeof(categoryInfo);
- if (!pWSCGetProviderInfo(&providers[i].ProviderId,
- ProviderInfoLspCategories,
- (PBYTE)&categoryInfo, &categoryInfoSize, 0,
- &err)) {
- str.AppendPrintf("0x%x", categoryInfo);
- }
- }
- }
-
- str.AppendLiteral(" : ");
- if (providers[i].ProtocolChain.ChainLen <= BASE_PROTOCOL) {
- // If we're dealing with a catalog entry that identifies an individual
- // base or layer provider, log its provider GUID.
- RPC_CSTR provIdStr = nullptr;
- if (UuidToStringA(&providers[i].ProviderId, &provIdStr) == RPC_S_OK) {
- str.Append(reinterpret_cast<char*>(provIdStr));
- RpcStringFreeA(&provIdStr);
- }
- }
-
- if (i + 1 != n) {
- str.AppendLiteral(" \n ");
- }
- }
-
- mString = str;
- NS_DispatchToMainThread(NewRunnableMethod(this, &LSPAnnotationGatherer::Annotate));
- return NS_OK;
-}
-
-void LSPAnnotate()
-{
- nsCOMPtr<nsIThread> thread;
- nsCOMPtr<nsIRunnable> runnable =
- do_QueryObject(new LSPAnnotationGatherer());
- NS_NewThread(getter_AddRefs(thread), runnable);
-}
-
-} // namespace crashreporter
-} // namespace mozilla
diff --git a/widget/windows/moz.build b/widget/windows/moz.build
index d4f089eea..1e7fc4b02 100644
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -79,11 +79,6 @@ SOURCES += [
'WinMouseScrollHandler.cpp',
]
-if CONFIG['MOZ_CRASHREPORTER']:
- UNIFIED_SOURCES += [
- 'LSPAnnotator.cpp',
- ]
-
if CONFIG['NS_PRINTING']:
UNIFIED_SOURCES += [
'nsDeviceContextSpecWin.cpp',
diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp
index c8820e7d1..c3e99b2d3 100644
--- a/widget/windows/nsAppShell.cpp
+++ b/widget/windows/nsAppShell.cpp
@@ -213,10 +213,6 @@ nsAppShell::~nsAppShell()
nsresult
nsAppShell::Init()
{
-#ifdef MOZ_CRASHREPORTER
- LSPAnnotate();
-#endif
-
mLastNativeEventScheduled = TimeStamp::NowLoRes();
mozilla::ipc::windows::InitUIThread();