Bug 1460022: Part 5 - Update launcher process to work with new DLL interceptor interface; r=mhowell
authorAaron Klotz <aklotz@mozilla.com>
Wed, 27 Jun 2018 11:49:30 -0600
changeset 424935 388defa609728a5bcacd0bb48f461f5fca783e0e
parent 424934 f538fbf4d5099cbd84c3777d5eb338333dca33a4
child 424936 137f27a03ba3b56b87a698adc34cbcf4b2def52f
push id104944
push useraklotz@mozilla.com
push dateWed, 04 Jul 2018 02:23:52 +0000
treeherdermozilla-inbound@ff25e66da36e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1460022
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460022: Part 5 - Update launcher process to work with new DLL interceptor interface; r=mhowell
browser/app/winlauncher/DllBlocklistWin.cpp
--- a/browser/app/winlauncher/DllBlocklistWin.cpp
+++ b/browser/app/winlauncher/DllBlocklistWin.cpp
@@ -241,17 +241,18 @@ IsDllAllowed(const UNICODE_STRING& aLeaf
     gBlockSet.Add(info->name, version);
     return false;
   }
 
   return true;
 }
 
 typedef decltype(&NtMapViewOfSection) NtMapViewOfSection_func;
-static NtMapViewOfSection_func stub_NtMapViewOfSection;
+static mozilla::CrossProcessDllInterceptor::FuncHookType<NtMapViewOfSection_func>
+  stub_NtMapViewOfSection;
 
 static NTSTATUS NTAPI
 patched_NtMapViewOfSection(HANDLE aSection, HANDLE aProcess, PVOID* aBaseAddress,
                            ULONG_PTR aZeroBits, SIZE_T aCommitSize,
                            PLARGE_INTEGER aSectionOffset, PSIZE_T aViewSize,
                            SECTION_INHERIT aInheritDisposition,
                            ULONG aAllocationType, ULONG aProtectionFlags)
 {
@@ -351,19 +352,18 @@ private:
   DWORD   mPrevProt;
 };
 
 bool
 InitializeDllBlocklistOOP(HANDLE aChildProcess)
 {
   mozilla::CrossProcessDllInterceptor intcpt(aChildProcess);
   intcpt.Init(L"ntdll.dll");
-  bool ok = intcpt.AddDetour("NtMapViewOfSection",
-                             reinterpret_cast<intptr_t>(&patched_NtMapViewOfSection),
-                             (void**) &stub_NtMapViewOfSection);
+  bool ok = stub_NtMapViewOfSection.SetDetour(intcpt, "NtMapViewOfSection",
+                                              &patched_NtMapViewOfSection);
   if (!ok) {
     return false;
   }
 
   // Set the child process's copy of stub_NtMapViewOfSection
   SIZE_T bytesWritten;
   ok = !!::WriteProcessMemory(aChildProcess, &stub_NtMapViewOfSection,
                               &stub_NtMapViewOfSection,