2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2022-05-10 01:40:30 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2019-02-27 18:39:32 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-03-16 19:41:25 +08:00
|
|
|
#include "shared/source/os_interface/driver_info.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-03-17 18:55:53 +08:00
|
|
|
#include <functional>
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-05-28 01:44:47 +08:00
|
|
|
class SettingsReader;
|
|
|
|
|
2021-05-21 07:17:57 +08:00
|
|
|
bool isCompatibleDriverStore(std::string &&deviceRegistryPath);
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
class DriverInfoWindows : public DriverInfo {
|
|
|
|
public:
|
2022-08-04 19:29:25 +08:00
|
|
|
static constexpr DriverInfoType driverInfoType = DriverInfoType::WINDOWS;
|
|
|
|
|
2020-11-05 20:40:03 +08:00
|
|
|
DriverInfoWindows(const std::string &path, const PhysicalDevicePciBusInfo &pciBusInfo);
|
2022-05-10 01:40:30 +08:00
|
|
|
~DriverInfoWindows() override;
|
2020-03-17 18:55:53 +08:00
|
|
|
std::string getDeviceName(std::string defaultName) override;
|
|
|
|
std::string getVersion(std::string defaultVersion) override;
|
|
|
|
bool isCompatibleDriverStore() const;
|
2022-08-04 19:29:25 +08:00
|
|
|
MOCKABLE_VIRTUAL bool containsSetting(const char *setting);
|
2020-03-17 18:55:53 +08:00
|
|
|
static std::function<std::unique_ptr<SettingsReader>(const std::string ®istryPath)> createRegistryReaderFunc;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
protected:
|
2020-03-16 17:11:27 +08:00
|
|
|
static std::string trimRegistryKey(std::string key);
|
|
|
|
const std::string path;
|
2017-12-21 07:45:38 +08:00
|
|
|
std::unique_ptr<SettingsReader> registryReader;
|
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|