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