diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2008-01-28 20:02:01 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2008-01-28 20:02:01 +0000 |
commit | 469580e2dfe4860966200f8c451b7b8b6d7554a2 (patch) | |
tree | 6f402097b17267bbcc2d6b621b01be50a5a518b5 /src/client/windows/handler/exception_handler.cc | |
parent | Fix issue 235, properly handling included(inlined) code. (diff) | |
download | breakpad-469580e2dfe4860966200f8c451b7b8b6d7554a2.tar.xz |
Remove dependency on ole32 on Windows (#132). Patch by Sorin Jianu <sorinj>, r=me.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@237 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows/handler/exception_handler.cc')
-rw-r--r-- | src/client/windows/handler/exception_handler.cc | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc index 0e6c43c9..cd1d7f26 100644 --- a/src/client/windows/handler/exception_handler.cc +++ b/src/client/windows/handler/exception_handler.cc @@ -62,6 +62,8 @@ ExceptionHandler::ExceptionHandler(const wstring &dump_path, next_minidump_path_c_(NULL), dbghelp_module_(NULL), minidump_write_dump_(NULL), + rpcrt4_module_(NULL), + uuid_create_(NULL), handler_types_(handler_types), previous_filter_(NULL), previous_pch_(NULL), @@ -78,10 +80,6 @@ ExceptionHandler::ExceptionHandler(const wstring &dump_path, previous_iph_ = NULL; #endif // _MSC_VER >= 1400 - // set_dump_path calls UpdateNextID. This sets up all of the path and id - // strings, and their equivalent c_str pointers. - set_dump_path(dump_path); - // Set synchronization primitives and the handler thread. Each // ExceptionHandler object gets its own handler thread because that's the // only way to reliably guarantee sufficient stack space in an exception, @@ -105,6 +103,19 @@ ExceptionHandler::ExceptionHandler(const wstring &dump_path, GetProcAddress(dbghelp_module_, "MiniDumpWriteDump")); } + // Load this library dynamically to not affect existing projects. Most + // projects don't link against this directly, it's usually dynamically + // loaded by dependent code. + rpcrt4_module_ = LoadLibrary(L"rpcrt4.dll"); + if (rpcrt4_module_) { + uuid_create_ = reinterpret_cast<UuidCreate_type>( + GetProcAddress(rpcrt4_module_, "UuidCreate")); + } + + // set_dump_path calls UpdateNextID. This sets up all of the path and id + // strings, and their equivalent c_str pointers. + set_dump_path(dump_path); + if (handler_types != HANDLER_NONE) { if (!handler_stack_critical_section_initialized_) { InitializeCriticalSection(&handler_stack_critical_section_); @@ -140,6 +151,10 @@ ExceptionHandler::~ExceptionHandler() { FreeLibrary(dbghelp_module_); } + if (rpcrt4_module_) { + FreeLibrary(rpcrt4_module_); + } + if (handler_types_ != HANDLER_NONE) { EnterCriticalSection(&handler_stack_critical_section_); @@ -518,8 +533,11 @@ bool ExceptionHandler::WriteMinidumpWithException( } void ExceptionHandler::UpdateNextID() { - GUID id; - CoCreateGuid(&id); + assert(uuid_create_); + UUID id = {0}; + if (uuid_create_) { + uuid_create_(&id); + } next_minidump_id_ = GUIDString::GUIDToWString(&id); next_minidump_id_c_ = next_minidump_id_.c_str(); |