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); |
} |