2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/os_library.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#define UMDF_USING_NTSTATUS
|
2021-05-20 04:12:09 +08:00
|
|
|
#include <Windows.h>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
namespace Windows {
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
class OsLibrary : public NEO::OsLibrary {
|
2017-12-21 07:45:38 +08:00
|
|
|
private:
|
|
|
|
HMODULE handle;
|
|
|
|
|
|
|
|
public:
|
2021-03-12 09:01:51 +08:00
|
|
|
OsLibrary(const std::string &name, std::string *errorValue);
|
2017-12-21 07:45:38 +08:00
|
|
|
~OsLibrary();
|
|
|
|
|
|
|
|
bool isLoaded();
|
|
|
|
void *getProcAddress(const std::string &procName);
|
2020-10-30 20:42:13 +08:00
|
|
|
static decltype(&GetSystemDirectoryA) getSystemDirectoryA;
|
2021-03-12 09:01:51 +08:00
|
|
|
void getLastErrorString(std::string *errorValue);
|
2018-03-02 22:19:29 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
HMODULE loadDependency(const std::string &dependencyFileName) const;
|
|
|
|
|
|
|
|
static decltype(&LoadLibraryExA) loadLibraryExA;
|
|
|
|
static decltype(&GetModuleFileNameA) getModuleFileNameA;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2018-06-13 03:54:39 +08:00
|
|
|
} // namespace Windows
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|