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

Unified Diff: snapshot/win/pe_image_reader_test.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 | « handler/win/crashy_test_program.cc ('k') | util/util.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/pe_image_reader_test.cc
diff --git a/snapshot/win/pe_image_reader_test.cc b/snapshot/win/pe_image_reader_test.cc
index 4a3bbd2205a344926911a9d99c8a78dd768c0026..3928fee92412cbdc92a49fe460ab3f7ddb85f43d 100644
--- a/snapshot/win/pe_image_reader_test.cc
+++ b/snapshot/win/pe_image_reader_test.cc
@@ -19,6 +19,7 @@
#include "gtest/gtest.h"
#include "snapshot/win/process_reader_win.h"
+#include "util/win/get_function.h"
extern "C" IMAGE_DOS_HEADER __ImageBase;
@@ -30,10 +31,8 @@ BOOL CrashpadGetModuleInformation(HANDLE process,
HMODULE module,
MODULEINFO* module_info,
DWORD cb) {
- static decltype(GetModuleInformation)* get_module_information =
- reinterpret_cast<decltype(GetModuleInformation)*>(
- GetProcAddress(LoadLibrary(L"psapi.dll"), "GetModuleInformation"));
- DCHECK(get_module_information);
+ static const auto get_module_information =
+ GET_FUNCTION_REQUIRED(L"psapi.dll", ::GetModuleInformation);
return get_module_information(process, module, module_info, cb);
}
« no previous file with comments | « handler/win/crashy_test_program.cc ('k') | util/util.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698