Bug 1294650 - Install shim 'qipcap' dlls into the Firefox folder to circumvent dll injection by the 3rd party Websense product. r=aklotz a=sylvestre
authorJim Mathies <jmathies@mozilla.com>
Mon, 22 Aug 2016 06:53:38 -0500
changeset 349865 a72bfbdf5c9b36e68ca806a25944180f2652f0c9
parent 349864 36fd886d42c158fb2c613681c938960dfccda74b
child 349866 4808dc6e844f73db06db0405114d9cb1884e7bf4
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz, sylvestre
bugs1294650
milestone50.0a2
Bug 1294650 - Install shim 'qipcap' dlls into the Firefox folder to circumvent dll injection by the 3rd party Websense product. r=aklotz a=sylvestre CLOSED TREE MozReview-Commit-ID: 11qJbfim7Lm
browser/installer/package-manifest.in
toolkit/library/dummydll/dummydll.cpp
toolkit/library/dummydll/moz.build
toolkit/library/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -136,16 +136,23 @@
 @BINPATH@/@DLL_PREFIX@mozavcodec@DLL_SUFFIX@
 #endif
 @RESPATH@/browser/blocklist.xml
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
 @RESPATH@/run-mozilla.sh
 #endif
 #endif
+#ifdef XP_WIN
+#ifdef _AMD64_
+@BINPATH@/@DLL_PREFIX@qipcap64@DLL_SUFFIX@
+#else
+@BINPATH@/@DLL_PREFIX@qipcap@DLL_SUFFIX@
+#endif
+#endif
 
 ; [Components]
 @RESPATH@/browser/components/components.manifest
 @RESPATH@/components/alerts.xpt
 #ifdef ACCESSIBILITY
 #ifdef XP_WIN32
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
new file mode 100644
--- /dev/null
+++ b/toolkit/library/dummydll/dummydll.cpp
@@ -0,0 +1,17 @@
+/* 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/. */
+
+#include <windows.h>
+
+BOOL WINAPI DllMain(
+  HANDLE hModule,
+  DWORD dwReason,
+  LPVOID lpvReserved
+)
+{
+  if (dwReason == DLL_PROCESS_ATTACH) {
+    ::DisableThreadLibraryCalls((HMODULE)hModule);
+  }
+  return TRUE;
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/library/dummydll/moz.build
@@ -0,0 +1,19 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+# Bug 1294650 - populate our install with a shim dll to work around a
+# 3rd party code injection crash.
+
+SOURCES += [
+    'dummydll.cpp',
+]
+
+if CONFIG['CPU_ARCH'] == 'x86_64':
+  GeckoSharedLibrary('qipcap64')
+else:
+  GeckoSharedLibrary('qipcap')
+
+NO_VISIBILITY_FLAGS = True
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -92,16 +92,19 @@ LOCAL_INCLUDES += [
 
 if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
     LOCAL_INCLUDES += [
         '/xpcom/base',
     ]
 
 DIRS += ['gtest']
 
+if CONFIG['OS_ARCH'] == 'WINNT':
+  DIRS += ['dummydll']
+
 # js needs to come after xul for now, because it is an archive and its content
 # is discarded when it comes first.
 USE_LIBS += [
     'js',
 ]
 
 USE_LIBS += [
     'gkmedias',