From 06cede988b4d15b4d6b7e759fda676bfe3455682 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek" Date: Fri, 11 Nov 2011 19:05:51 +0000 Subject: Allow CrashGenerationClient to request that a dump of the parent process be written. A=Jim Mathies R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=679238 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@883 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/windows/crash_generation/client_info.cc | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/client/windows/crash_generation/client_info.cc') diff --git a/src/client/windows/crash_generation/client_info.cc b/src/client/windows/crash_generation/client_info.cc index 94f9c3cd..12f4bb30 100644 --- a/src/client/windows/crash_generation/client_info.cc +++ b/src/client/windows/crash_generation/client_info.cc @@ -50,6 +50,8 @@ ClientInfo::ClientInfo(CrashGenerationServer* crash_server, thread_id_(thread_id), process_handle_(NULL), dump_requested_handle_(NULL), + parent_dump_requested_handle_(NULL), + parent_dump_request_wait_handle_(NULL), dump_generated_handle_(NULL), dump_request_wait_handle_(NULL), process_exit_wait_handle_(NULL) { @@ -70,6 +72,14 @@ bool ClientInfo::Initialize() { return false; } + parent_dump_requested_handle_ = CreateEvent(NULL, // Security attributes. + TRUE, // Manual reset. + FALSE, // Initial state. + NULL); // Name. + if (!parent_dump_requested_handle_) { + return false; + } + dump_generated_handle_ = CreateEvent(NULL, // Security attributes. TRUE, // Manual reset. FALSE, // Initial state. @@ -88,6 +98,10 @@ ClientInfo::~ClientInfo() { UnregisterWaitEx(process_exit_wait_handle_, INVALID_HANDLE_VALUE); } + if (parent_dump_request_wait_handle_) { + UnregisterWaitEx(parent_dump_request_wait_handle_, INVALID_HANDLE_VALUE); + } + if (process_handle_) { CloseHandle(process_handle_); } @@ -96,6 +110,10 @@ ClientInfo::~ClientInfo() { CloseHandle(dump_requested_handle_); } + if (parent_dump_requested_handle_) { + CloseHandle(parent_dump_requested_handle_); + } + if (dump_generated_handle_) { CloseHandle(dump_generated_handle_); } @@ -107,6 +125,11 @@ void ClientInfo::UnregisterWaits() { dump_request_wait_handle_ = NULL; } + if (parent_dump_request_wait_handle_) { + UnregisterWait(parent_dump_request_wait_handle_); + parent_dump_request_wait_handle_ = NULL; + } + if (process_exit_wait_handle_) { UnregisterWait(process_exit_wait_handle_); process_exit_wait_handle_ = NULL; -- cgit v1.2.1