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

Unified Diff: handler/win/crashy_test_program.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 | « no previous file | snapshot/win/pe_image_reader_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/win/crashy_test_program.cc
diff --git a/handler/win/crashy_test_program.cc b/handler/win/crashy_test_program.cc
index 4057df89a36e4e41a6ae2b43fdf3170853749e66..6650404859e54574d88dd2b70e5ef698c528e249 100644
--- a/handler/win/crashy_test_program.cc
+++ b/handler/win/crashy_test_program.cc
@@ -25,6 +25,7 @@
#include "client/crashpad_client.h"
#include "tools/tool_support.h"
#include "util/win/critical_section_with_debug_info.h"
+#include "util/win/get_function.h"
namespace crashpad {
namespace {
@@ -32,10 +33,8 @@ namespace {
CRITICAL_SECTION g_test_critical_section;
ULONG RtlNtStatusToDosError(NTSTATUS status) {
- static decltype(::RtlNtStatusToDosError)* rtl_nt_status_to_dos_error =
- reinterpret_cast<decltype(::RtlNtStatusToDosError)*>(
- GetProcAddress(LoadLibrary(L"ntdll.dll"), "RtlNtStatusToDosError"));
- DCHECK(rtl_nt_status_to_dos_error);
+ static const auto rtl_nt_status_to_dos_error =
+ GET_FUNCTION_REQUIRED(L"ntdll.dll", ::RtlNtStatusToDosError);
return rtl_nt_status_to_dos_error(status);
}
« no previous file with comments | « no previous file | snapshot/win/pe_image_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698