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:
29
src/library/driver_device.hpp
Normal file
29
src/library/driver_device.hpp
Normal 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_{};
|
||||
};
|
Reference in New Issue
Block a user