libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
DEVICE_OBJECT.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include "OBJECT.hh"
19
21
23
24#include <cstdint>
25#include <string>
26
27namespace introvirt {
28namespace windows {
29namespace nt {
30
38class DEVICE_OBJECT : public OBJECT {
39 public:
41 public:
46 bool FILE_REMOTE_DEVICE() const;
48 bool FILE_VIRTUAL_VOLUME() const;
57 uint32_t value() const { return value_; }
58
59 explicit DeviceCharacteristics(uint32_t value) : value_(value) {}
60
61 private:
62 const uint32_t value_;
63 };
64
68 virtual nt::DeviceType DeviceType() const = 0;
69
73 virtual std::string DeviceName() const = 0;
74
78 virtual const DRIVER_OBJECT& DriverObject() const = 0;
79
80 static std::shared_ptr<DEVICE_OBJECT> make_shared(const NtKernel& kernel,
81 const guest_ptr<void>& ptr);
82
83 static std::shared_ptr<DEVICE_OBJECT>
84 make_shared(const NtKernel& kernel, std::unique_ptr<OBJECT_HEADER>&& object_header);
85
86 virtual ~DEVICE_OBJECT() = default;
87};
88
89} /* namespace nt */
90} /* namespace windows */
91} /* namespace introvirt */
Definition guest_ptr.hh:88
uint32_t value() const
Definition DEVICE_OBJECT.hh:57
DeviceCharacteristics(uint32_t value)
Definition DEVICE_OBJECT.hh:59
Class for the Windows NT DEVICE_OBJECT structure.
Definition DEVICE_OBJECT.hh:38
static std::shared_ptr< DEVICE_OBJECT > make_shared(const NtKernel &kernel, std::unique_ptr< OBJECT_HEADER > &&object_header)
static std::shared_ptr< DEVICE_OBJECT > make_shared(const NtKernel &kernel, const guest_ptr< void > &ptr)
virtual const DRIVER_OBJECT & DriverObject() const =0
Get the DRIVER_OBJECT associated with this device.
virtual std::string DeviceName() const =0
virtual nt::DeviceType DeviceType() const =0
Get the type of device.
Definition DRIVER_OBJECT.hh:28
Abstraction for the Windows NT kernel.
Definition NtKernel.hh:37
Base class for all kernel objects.
Definition OBJECT.hh:30
virtual guest_ptr< void > ptr() const =0
DeviceType
Definition DeviceType.hh:25
Core IntroVirt classes.
Definition Cr0.hh:20