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

Unified Diff: util/win/exception_handler_server.cc

Issue 1405323003: win: Add and use GET_FUNCTION() and GET_FUNCTION_REQUIRED() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 2 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 | « util/win/critical_section_with_debug_info.cc ('k') | util/win/get_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/exception_handler_server.cc
diff --git a/util/win/exception_handler_server.cc b/util/win/exception_handler_server.cc
index 9cc69e6791c1d1f10429199f3265020e2546ca18..304319b757fbcda6f6eb0d70a56dc077a58a6588 100644
--- a/util/win/exception_handler_server.cc
+++ b/util/win/exception_handler_server.cc
@@ -27,6 +27,7 @@
#include "util/file/file_writer.h"
#include "util/misc/tri_state.h"
#include "util/misc/uuid.h"
+#include "util/win/get_function.h"
#include "util/win/registration_protocol_win.h"
#include "util/win/xp_compat.h"
@@ -35,10 +36,9 @@ namespace crashpad {
namespace {
decltype(GetNamedPipeClientProcessId)* GetNamedPipeClientProcessIdFunction() {
- static decltype(GetNamedPipeClientProcessId)* func =
- reinterpret_cast<decltype(GetNamedPipeClientProcessId)*>(GetProcAddress(
- GetModuleHandle(L"kernel32.dll"), "GetNamedPipeClientProcessId"));
- return func;
+ static const auto get_named_pipe_client_process_id =
+ GET_FUNCTION(L"kernel32.dll", ::GetNamedPipeClientProcessId);
+ return get_named_pipe_client_process_id;
}
HANDLE DuplicateEvent(HANDLE process, HANDLE event) {
« no previous file with comments | « util/win/critical_section_with_debug_info.cc ('k') | util/win/get_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698