mirror of
https://github.com/momo5502/hypervisor.git
synced 2025-08-30 05:33:16 +00:00
30 lines
777 B
C++
30 lines
777 B
C++
#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_{};
|
|
};
|