Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: chrome_elf/blacklist/blacklist_interceptions.cc

Issue 154653002: Breakpad coverage for chrome_elf start up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests on chromium builds Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_elf/blacklist.gypi ('k') | chrome_elf/breakpad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/blacklist/blacklist_interceptions.cc
diff --git a/chrome_elf/blacklist/blacklist_interceptions.cc b/chrome_elf/blacklist/blacklist_interceptions.cc
index 9a3bdab09068f0984ed7965261df7ac236f0c703..b3f3d8256fceedfb74fd01dcc7382b16403079d3 100644
--- a/chrome_elf/blacklist/blacklist_interceptions.cc
+++ b/chrome_elf/blacklist/blacklist_interceptions.cc
@@ -17,6 +17,7 @@
#include "base/strings/string16.h"
#include "base/win/pe_image.h"
#include "chrome_elf/blacklist/blacklist.h"
+#include "chrome_elf/breakpad.h"
#include "sandbox/win/src/internal_types.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/sandbox_nt_util.h"
@@ -167,25 +168,7 @@ bool IsSameAsCurrentProcess(HANDLE process) {
(::GetProcessId(process) == ::GetCurrentProcessId());
}
-} // namespace
-
-namespace blacklist {
-
-bool InitializeInterceptImports() {
- g_nt_query_section_func = reinterpret_cast<NtQuerySectionFunction>(
- GetNtDllExportByName("NtQuerySection"));
- g_nt_query_virtual_memory_func =
- reinterpret_cast<NtQueryVirtualMemoryFunction>(
- GetNtDllExportByName("NtQueryVirtualMemory"));
- g_nt_unmap_view_of_section_func =
- reinterpret_cast<NtUnmapViewOfSectionFunction>(
- GetNtDllExportByName("NtUnmapViewOfSection"));
-
- return g_nt_query_section_func && g_nt_query_virtual_memory_func &&
- g_nt_unmap_view_of_section_func;
-}
-
-SANDBOX_INTERCEPT NTSTATUS WINAPI BlNtMapViewOfSection(
+NTSTATUS BlNtMapViewOfSectionImpl(
NtMapViewOfSectionFunction orig_MapViewOfSection,
HANDLE section,
HANDLE process,
@@ -230,6 +213,50 @@ SANDBOX_INTERCEPT NTSTATUS WINAPI BlNtMapViewOfSection(
return ret;
}
+} // namespace
+
+namespace blacklist {
+
+bool InitializeInterceptImports() {
+ g_nt_query_section_func =
+ reinterpret_cast<NtQuerySectionFunction>(
+ GetNtDllExportByName("NtQuerySection"));
+ g_nt_query_virtual_memory_func =
+ reinterpret_cast<NtQueryVirtualMemoryFunction>(
+ GetNtDllExportByName("NtQueryVirtualMemory"));
+ g_nt_unmap_view_of_section_func =
+ reinterpret_cast<NtUnmapViewOfSectionFunction>(
+ GetNtDllExportByName("NtUnmapViewOfSection"));
+
+ return (g_nt_query_section_func && g_nt_query_virtual_memory_func &&
+ g_nt_unmap_view_of_section_func);
+}
+
+SANDBOX_INTERCEPT NTSTATUS WINAPI BlNtMapViewOfSection(
+ NtMapViewOfSectionFunction orig_MapViewOfSection,
+ HANDLE section,
+ HANDLE process,
+ PVOID *base,
+ ULONG_PTR zero_bits,
+ SIZE_T commit_size,
+ PLARGE_INTEGER offset,
+ PSIZE_T view_size,
+ SECTION_INHERIT inherit,
+ ULONG allocation_type,
+ ULONG protect) {
+ NTSTATUS ret = STATUS_UNSUCCESSFUL;
+
+ __try {
+ ret = BlNtMapViewOfSectionImpl(orig_MapViewOfSection, section, process,
+ base, zero_bits, commit_size, offset,
+ view_size, inherit, allocation_type,
+ protect);
+ } __except(GenerateCrashDump(GetExceptionInformation())) {
+ }
+
+ return ret;
+}
+
#if defined(_WIN64)
NTSTATUS WINAPI BlNtMapViewOfSection64(
HANDLE section, HANDLE process, PVOID *base, ULONG_PTR zero_bits,
« no previous file with comments | « chrome_elf/blacklist.gypi ('k') | chrome_elf/breakpad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698