Index: components/crash/app/breakpad_win.cc |
diff --git a/components/crash/app/breakpad_win.cc b/components/crash/app/breakpad_win.cc |
index b0dba9899e593ca3967444c2b5bf713293dc96d0..1dc5fbcdee3f54b7fd1b269a403c4525c4bce966 100644 |
--- a/components/crash/app/breakpad_win.cc |
+++ b/components/crash/app/breakpad_win.cc |
@@ -611,4 +611,35 @@ extern "C" void __declspec(dllexport) __cdecl |
env->UnSetVar(kPipeNameVar); |
} |
+#ifdef _WIN64 |
+PRUNTIME_FUNCTION GetRuntimeFunctionCallback(DWORD64 ControlPC, PVOID Context) { |
+ if (g_breakpad) { |
+ g_breakpad->WriteMinidump(); |
+ // Patched stub exists based on conditions (See InitCrashReporter). |
+ // As a side note this function also gets called from |
+ // WindowProcExceptionFilter. |
+ if (g_real_terminate_process_stub == NULL) { |
+ ::TerminateProcess(::GetCurrentProcess(), content::RESULT_CODE_KILLED); |
+ } else { |
+ NtTerminateProcessPtr real_terminate_proc = |
+ reinterpret_cast<NtTerminateProcessPtr>( |
+ static_cast<char*>(g_real_terminate_process_stub)); |
+ real_terminate_proc(::GetCurrentProcess(), content::RESULT_CODE_KILLED); |
+ } |
+ } |
+ return NULL; |
+} |
+ |
+extern "C" void __declspec(dllexport) __cdecl |
+RegisterNonABICompliantCodeRange(void* start, size_t size_in_bytes) { |
+ RtlInstallFunctionTableCallback( |
+ reinterpret_cast<DWORD64>(start) | 0x3, // Required by API. |
+ reinterpret_cast<DWORD64>(start), |
+ static_cast<DWORD>(size_in_bytes), |
Will Harris
2014/09/30 20:39:59
check limits here during size_t -> DWORD conversio
|
+ GetRuntimeFunctionCallback, |
+ NULL, |
+ NULL); |
+} |
+#endif |
+ |
} // namespace breakpad |