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

Unified Diff: util/win/get_module_information.cc

Issue 1586433003: Adding an API to read module annotations in snapshot.gyp (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Last comments Created 4 years, 11 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
« util/win/get_module_information.h ('K') | « util/win/get_module_information.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/get_module_information.cc
diff --git a/util/file/file_seeker.cc b/util/win/get_module_information.cc
similarity index 53%
copy from util/file/file_seeker.cc
copy to util/win/get_module_information.cc
index a38e2f918546e955a1e114215907c35f3820a230..1a9fd0c4016b15e070b5df1f4fd466a532b0edf0 100644
--- a/util/file/file_seeker.cc
+++ b/util/win/get_module_information.cc
@@ -1,4 +1,4 @@
-// Copyright 2015 The Crashpad Authors. All rights reserved.
+// Copyright 2016 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,26 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "util/file/file_seeker.h"
+#include "util/win/get_module_information.h"
-#include "base/logging.h"
+#include "util/win/get_function.h"
namespace crashpad {
-FileOffset FileSeekerInterface::SeekGet() {
- return Seek(0, SEEK_CUR);
-}
-
-bool FileSeekerInterface::SeekSet(FileOffset offset) {
- FileOffset rv = Seek(offset, SEEK_SET);
- if (rv < 0) {
- // Seek() will have logged its own error.
- return false;
- } else if (rv != offset) {
- LOG(ERROR) << "SeekSet(): expected " << offset << ", observed " << rv;
- return false;
- }
- return true;
+BOOL CrashpadGetModuleInformation(HANDLE process,
+ HMODULE module,
+ MODULEINFO* module_info,
+ DWORD cb) {
+ static const auto get_module_information =
+ GET_FUNCTION_REQUIRED(L"psapi.dll", GetModuleInformation);
+ return get_module_information(process, module, module_info, cb);
}
} // namespace crashpad
« util/win/get_module_information.h ('K') | « util/win/get_module_information.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698