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