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:
David Bienvenu 2019-01-02 15:36:06 -08:00 committed by Commit Bot
parent 60ff012872
commit bcce074143
3 changed files with 11 additions and 3 deletions

View File

@ -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"

View File

@ -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

View File

@ -17,7 +17,9 @@
#include <windows.h>
#define PSAPI_VERSION 1
#ifndef PSAPI_VERSION
#define PSAPI_VERSION 2
#endif
#include <psapi.h>
namespace crashpad {