mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Make crashpad support either PSAPI_VERSION 1 or 2
Bug: 584969 Change-Id: I03913e8987a576154b29cac18e95c14d121c9762 Reviewed-on: https://chromium-review.googlesource.com/c/1393605 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
60ff012872
commit
bcce074143
@ -14,7 +14,9 @@
|
||||
|
||||
#include "snapshot/win/pe_image_reader.h"
|
||||
|
||||
#define PSAPI_VERSION 1
|
||||
#ifndef PSAPI_VERSION
|
||||
#define PSAPI_VERSION 2
|
||||
#endif
|
||||
#include <psapi.h>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
|
@ -22,9 +22,13 @@ BOOL CrashpadGetModuleInformation(HANDLE process,
|
||||
HMODULE module,
|
||||
MODULEINFO* module_info,
|
||||
DWORD cb) {
|
||||
#if PSAPI_VERSION == 1
|
||||
static const auto get_module_information =
|
||||
GET_FUNCTION_REQUIRED(L"psapi.dll", GetModuleInformation);
|
||||
GET_FUNCTION_REQUIRED(L"psapi.dll", GetModuleInformation);
|
||||
return get_module_information(process, module, module_info, cb);
|
||||
#elif PSAPI_VERSION == 2
|
||||
return GetModuleInformation(process, module, module_info, cb);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace crashpad
|
||||
|
@ -17,7 +17,9 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define PSAPI_VERSION 1
|
||||
#ifndef PSAPI_VERSION
|
||||
#define PSAPI_VERSION 2
|
||||
#endif
|
||||
#include <psapi.h>
|
||||
|
||||
namespace crashpad {
|
||||
|
Loading…
x
Reference in New Issue
Block a user