Bug 1388903 - Part 1: Add PrintDlgW to x64 DLL Interceptor Test. r=jimm, a=gchang
authorDavid Parks <dparks@mozilla.com>
Tue, 29 Aug 2017 15:23:19 -0700
changeset 423972 9c1450703b0a43810727299bec81040573378912
parent 423971 178da21590bb488edcc696d6131d6c399698d6be
child 423973 755dff9960436d7feb9b9ee34e0d61f644ad9faa
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, gchang
bugs1388903
milestone56.0
Bug 1388903 - Part 1: Add PrintDlgW to x64 DLL Interceptor Test. r=jimm, a=gchang We will hook PrintDlgW in another part.
toolkit/xre/test/win/TestDllInterceptor.cpp
--- a/toolkit/xre/test/win/TestDllInterceptor.cpp
+++ b/toolkit/xre/test/win/TestDllInterceptor.cpp
@@ -427,16 +427,24 @@ bool TestTlsAlloc(void* aFunc)
 
 bool TestTlsFree(void* aFunc)
 {
   auto patchedTlsFree =
     reinterpret_cast<decltype(&TlsFree)>(aFunc);
   return sTlsIndex != 0 && patchedTlsFree(sTlsIndex);
 }
 
+bool TestPrintDlgW(void* aFunc)
+{
+  auto patchedPrintDlgW =
+    reinterpret_cast<decltype(&PrintDlgW)>(aFunc);
+  patchedPrintDlgW(0);
+  return true;
+}
+
 int main()
 {
   payload initial = { 0x12345678, 0xfc4e9d31, 0x87654321 };
   payload p0, p1;
   ZeroMemory(&p0, sizeof(p0));
   ZeroMemory(&p1, sizeof(p1));
 
   p0 = rotatePayload(initial);
@@ -526,16 +534,17 @@ int main()
       TestHook(TestImmNotifyIME, "imm32.dll", "ImmNotifyIME") &&
       TestHook(TestGetSaveFileNameW, "comdlg32.dll", "GetSaveFileNameW") &&
       TestHook(TestGetOpenFileNameW, "comdlg32.dll", "GetOpenFileNameW") &&
 #ifdef _M_X64
       TestHook(TestGetKeyState, "user32.dll", "GetKeyState") &&    // see Bug 1316415
       TestHook(TestLdrUnloadDll, "ntdll.dll", "LdrUnloadDll") &&
       MaybeTestHook(IsWin8OrLater(), TestLdrResolveDelayLoadedAPI, "ntdll.dll", "LdrResolveDelayLoadedAPI") &&
       MaybeTestHook(!IsWin8OrLater(), TestRtlInstallFunctionTableCallback, "kernel32.dll", "RtlInstallFunctionTableCallback") &&
+      TestHook(TestPrintDlgW, "comdlg32.dll", "PrintDlgW") &&
 #endif
       MaybeTestHook(ShouldTestTipTsf(), TestProcessCaretEvents, "tiptsf.dll", "ProcessCaretEvents") &&
 #ifdef _M_IX86
       TestHook(TestSendMessageTimeoutW, "user32.dll", "SendMessageTimeoutW") &&
 #endif
       TestHook(TestSetCursorPos, "user32.dll", "SetCursorPos") &&
       TestHook(TestTlsAlloc, "kernel32.dll", "TlsAlloc") &&
       TestHook(TestTlsFree, "kernel32.dll", "TlsFree") &&