1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-08-31 05:57:27 +00:00

Extract into library

This commit is contained in:
Maurice Heumann
2022-12-27 16:27:33 +01:00
parent f8f636a829
commit 28dd94f2ef
31 changed files with 279 additions and 237 deletions

View File

@@ -0,0 +1,29 @@
#pragma once
#include "native_handle.hpp"
class driver_device
{
public:
driver_device() = default;
driver_device(const std::string& driver_device);
~driver_device() = default;
driver_device(const driver_device&) = delete;
driver_device& operator=(const driver_device&) = delete;
driver_device(driver_device&& obj) noexcept = default;
driver_device& operator=(driver_device&& obj) noexcept = default;
operator bool() const
{
return this->device_;
}
using data = std::vector<uint8_t>;
bool send(DWORD ioctl_code, const data& input) const;
bool send(DWORD ioctl_code, const data& input, data& output) const;
bool send(DWORD ioctl_code, const void* input, size_t input_length, void* output, size_t* output_length) const;
private:
native_handle device_{};
};