dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dxd::portcls::adapter Class Referenceabstract

PortCls adapter driver. More...

#include <dxd_portcls_adapter.h>

Inheritance diagram for dxd::portcls::adapter:
Collaboration diagram for dxd::portcls::adapter:

Classes

class  device
 per-FDO adapter device: miniport subdevices are created in start() More...

Public Member Functions

 adapter(::DRIVER_OBJECT* wdm_driver, ::UNICODE_STRING* registry, const wchar_t* name, const dxd::guid& guid= 0)
client* client_create() override
 a client for an open of the driver itself: none where the platform gives the driver no access point of its own
virtual os_result ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
 driver-wide control I/O: the version, and the log mask - the input sets it, the output reads it back
 operator const ::HANDLE() const
template<typename type_t>
os_result query(const ::UNICODE_STRING& key, type_t& value)
template<typename key_t, typename type_t>
os_result query(key_t* key, type_t& value)
os_result remove()
os_result set(const ::UNICODE_STRING& key, const ::GUID& value)
os_result set(const ::UNICODE_STRING& key, const ::UNICODE_STRING& value, unsigned long type= REG_SZ)
os_result set(const ::UNICODE_STRING& key, const char* value)
os_result set(const ::UNICODE_STRING& key, const wchar_t* value)
os_result set(const ::UNICODE_STRING& key, unsigned int value)
template<typename key_t, typename type_t>
os_result set(key_t* key, const type_t& value)
device* start(::IOService* shell, ::IOService* provider)
 a device's shell starts on its provider: the device of the pending request, or of the hardware the OS matched, launched
void stop(::IOService* shell)
 a device's shell stops: it leaves the driver's devices
template<typename type_t>
unsigned long type()

Static Public Member Functions

static device* hosted(::IOService* shell)
 the device a device shell hosts, the driver a driver shell hosts - the shells name no framework type, iig would take it for one of its own
static driver* hosting(::IOService* shell)
static driver* owned(::IOService* shell)
 the driver a device shell on hardware owns: this one, a product composing dxd::power defines its own

Public Attributes

const ::GUID guid
 < the driver's, not the Parameters key's
wdm::unicode icon
 endpoint icon: the driver binary's own icon resource 1
dx::log log{}
 log mask: every module at error until dx::ioctl::log sets it
bool managed{}
 dxd::power binds the OS's power management to the devices' sleep() and wake()
const wchar_t* name
 subdevice base name
unsigned int ports{1}
 PcAddAdapterDevice MaxObjects: subdevice capacity per device.
::IOService* service
 the driver's shell
os_result status
uint32_t version{DX_VERSION32}
 what dx::ioctl::version answers

Protected Member Functions

os_result create(const void* request, size_t size)
device* create(::DEVICE_OBJECT* wdm_device, ::DEVICE_OBJECT* wdm_pdo, ::DEVICE_OBJECT* wdm_bus) override= 0
 device factory
os_result destroy(const char* id)
void dispatch(::DRIVER_OBJECT* wdm_driver)
 installs the clients' dispatch and the removal over what the form's registration wrote
::IOService* find(const char* id) const
 the shell hosting the device of the given id
virtual os_result started(device &)
 a device started, in every form: what a driver binds per device (dxd::power) binds here

Static Protected Member Functions

::NTSTATUS __cleanup(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
 IRP_MJ_CLEANUP concludes the client, IRP_MJ_CLOSE deletes it and lets its device go.
::NTSTATUS __close(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
::NTSTATUS __create(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
 control opens carry no file name; a KS filter open carries its reference string
::NTSTATUS __forward(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
::NTSTATUS __ioctl(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
 METHOD_BUFFERED: SystemBuffer carries input and output.
::NTSTATUS __plain(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
 the plain form's PnP around the forms' own (__pnp) The start launches the device with its resources once the bus started it. A stop - a rebalance - retires the device as its clients see a removal: unplugged(), conclude(), removed; a successor takes its place, which the next start launches on the new resources, and the retired one goes with its last client. The resource requirements pass the device's filter on their way up, the capabilities state a surprise removal expected, the device object goes behind the remove.
::NTSTATUS __pnp(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
static void __unload(::DRIVER_OBJECT* wdm_driver)
::NTSTATUS complete(::IRP* irp, os_result status, size_t information= 0)
static device *& context(::DEVICE_OBJECT* wdm_device)
static driver& context(::DRIVER_OBJECT* wdm_driver)
static device::client *& context(::FILE_OBJECT* wdm_file)
static bool ours(::FILE_OBJECT* wdm_file)
 a control open: no file name, the device it opened in FsContext2 - which a rebalance may have retired since

Protected Attributes

size_t extension{}
 where a device's context sits in its device extension

Detailed Description

PortCls adapter driver.

One adapter per driver object, one adapter::device per FDO. The WDM driver (dxd::platform::driver) carries the control clients' dispatch and the removal; PortCls owns the device extension's head (the device's context sits behind PORT_CLASS_DEVICE_EXTENSION_SIZE) and everything that is not a control client's goes to its own dispatch - KS never sees the control clients' file objects.

Constructor & Destructor Documentation

◆ adapter()

dxd::portcls::adapter::adapter(::DRIVER_OBJECT* wdm_driver, ::UNICODE_STRING* registry, const wchar_t* name, const dxd::guid& guid= 0)
inline
Parameters
wdm_driverA pointer to a DRIVER_OBJECT structure that represents the driver's WDM driver object.
registryA pointer to an UNICODE_STRING structure that specifies the path to the driver's Parameters key in the registry.
nameAn internal unique name
Here is the call graph for this function:

Member Function Documentation

◆ __cleanup()

::NTSTATUS dxd::platform::driver::__cleanup(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited

IRP_MJ_CLEANUP concludes the client, IRP_MJ_CLOSE deletes it and lets its device go.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __close()

::NTSTATUS dxd::platform::driver::__close(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __create()

::NTSTATUS dxd::platform::driver::__create(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited

control opens carry no file name; a KS filter open carries its reference string

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __forward()

::NTSTATUS dxd::platform::driver::__forward(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __ioctl()

::NTSTATUS dxd::platform::driver::__ioctl(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited

METHOD_BUFFERED: SystemBuffer carries input and output.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __plain()

::NTSTATUS dxd::platform::driver::__plain(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited

the plain form's PnP around the forms' own (__pnp) The start launches the device with its resources once the bus started it. A stop - a rebalance - retires the device as its clients see a removal: unplugged(), conclude(), removed; a successor takes its place, which the next start launches on the new resources, and the retired one goes with its last client. The resource requirements pass the device's filter on their way up, the capabilities state a surprise removal expected, the device object goes behind the remove.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pnp()

::NTSTATUS dxd::platform::driver::__pnp(::DEVICE_OBJECT* wdm_device, ::IRP* irp)
inlinestaticprotectedinherited

the device outlives the stack's own remove handling: what tears down below may still reach it. The surprise removal comes with the clients' handles open, the remove after their close: unplugged() and conclude() each go ahead of their IRP, the destructor frees memory alone, with the device's last reference. A form's stop is refused: its device launches once (dxd::device); the plain form rebalances (__plain)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __unload()

void dxd::platform::driver::__unload(::DRIVER_OBJECT* wdm_driver)
inlinestaticprotectedinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ client_create()

client* dxd::platform::driver::client_create()
inlineoverridevirtualinherited

a client for an open of the driver itself: none where the platform gives the driver no access point of its own

Reimplemented from dxd::driver.

◆ complete()

::NTSTATUS dxd::platform::driver::complete(::IRP* irp, os_result status, size_t information= 0)
inlinestaticprotectedinherited
Here is the caller graph for this function:

◆ context() [1/3]

device *& dxd::platform::driver::context(::DEVICE_OBJECT* wdm_device)
inlinestaticprotectedinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ context() [2/3]

driver& dxd::platform::driver::context(::DRIVER_OBJECT* wdm_driver)
inlinestaticprotectedinherited
Here is the call graph for this function:

◆ context() [3/3]

device::client *& dxd::platform::driver::context(::FILE_OBJECT* wdm_file)
inlinestaticprotectedinherited

◆ create() [1/2]

os_result dxd::platform::driver::create(const void* request, size_t size)
inlineprotectedinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/2]

device* dxd::portcls::adapter::create(::DEVICE_OBJECT* wdm_device, ::DEVICE_OBJECT* wdm_pdo, ::DEVICE_OBJECT* wdm_bus)
overrideprotectedpure virtual

device factory

Implements dxd::platform::driver.

◆ destroy()

os_result dxd::platform::driver::destroy(const char* id)
inlineprotectedinherited
Here is the call graph for this function:

◆ dispatch()

void dxd::platform::driver::dispatch(::DRIVER_OBJECT* wdm_driver)
inlineprotectedinherited

installs the clients' dispatch and the removal over what the form's registration wrote

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

::IOService* dxd::platform::driver::find(const char* id) const
inlineprotectedinherited

the shell hosting the device of the given id

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hosted()

dxd::platform::device* dxd::platform::driver::hosted(::IOService* shell)
staticinherited

the device a device shell hosts, the driver a driver shell hosts - the shells name no framework type, iig would take it for one of its own

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hosting()

dxd::platform::driver* dxd::platform::driver::hosting(::IOService* shell)
staticinherited
Here is the call graph for this function:

◆ ioctl()

virtual os_result dxd::driver::ioctl(unsigned int ioctl, const void* in, size_t size_in, void* out, size_t size_out, size_t& size)
inlinevirtualinherited

driver-wide control I/O: the version, and the log mask - the input sets it, the output reads it back

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator const ::HANDLE()

dxd::wdm::registry::operator const ::HANDLE() const
inlineinherited
Here is the caller graph for this function:

◆ ours()

bool dxd::platform::driver::ours(::FILE_OBJECT* wdm_file)
inlinestaticprotectedinherited

a control open: no file name, the device it opened in FsContext2 - which a rebalance may have retired since

Here is the caller graph for this function:

◆ owned()

driver* dxd::platform::driver::owned(::IOService* shell)
staticinherited

the driver a device shell on hardware owns: this one, a product composing dxd::power defines its own

Here is the call graph for this function:

◆ query() [1/2]

template<typename type_t>
os_result dxd::wdm::registry::query(const ::UNICODE_STRING& key, type_t& value)
inlineinherited

◆ query() [2/2]

template<typename key_t, typename type_t>
os_result dxd::wdm::registry::query(key_t* key, type_t& value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

os_result dxd::wdm::registry::remove()
inlineinherited

◆ set() [1/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const ::GUID& value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [2/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const ::UNICODE_STRING& value, unsigned long type= REG_SZ)
inlineinherited
Here is the call graph for this function:

◆ set() [3/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const char* value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [4/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, const wchar_t* value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [5/6]

os_result dxd::wdm::registry::set(const ::UNICODE_STRING& key, unsigned int value)
inlineinherited
Here is the caller graph for this function:

◆ set() [6/6]

template<typename key_t, typename type_t>
os_result dxd::wdm::registry::set(key_t* key, const type_t& value)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

device* dxd::platform::driver::start(::IOService* shell, ::IOService* provider)
inlineinherited

a device's shell starts on its provider: the device of the pending request, or of the hardware the OS matched, launched

Here is the call graph for this function:

◆ started()

virtual os_result dxd::platform::driver::started(device&)
inlineprotectedvirtualinherited

a device started, in every form: what a driver binds per device (dxd::power) binds here

Reimplemented in dxd::power< portcls::adapter >.

◆ stop()

void dxd::platform::driver::stop(::IOService* shell)
inlineinherited

a device's shell stops: it leaves the driver's devices

◆ type()

template<typename type_t>
unsigned long dxd::wdm::registry::type()
inherited
Here is the caller graph for this function:

Member Data Documentation

◆ extension

size_t dxd::platform::driver::extension{}
protectedinherited

where a device's context sits in its device extension

◆ guid

const ::GUID dxd::platform::driver::guid
inherited

< the driver's, not the Parameters key's

the product's: the control clients' device interface and property key //////////////////////////////////////////////////////////////////////////// the plain form: its devices made on AddDevice, every IRP the driver's, its PnP the plain one's

◆ icon

wdm::unicode dxd::portcls::adapter::icon

endpoint icon: the driver binary's own icon resource 1

◆ log

dx::log dxd::driver::log{}
inherited

log mask: every module at error until dx::ioctl::log sets it

◆ managed

bool dxd::driver::managed{}
inherited

dxd::power binds the OS's power management to the devices' sleep() and wake()

◆ name

const wchar_t* dxd::portcls::adapter::name

subdevice base name

◆ ports

unsigned int dxd::portcls::adapter::ports{1}

PcAddAdapterDevice MaxObjects: subdevice capacity per device.

◆ service

::IOService* dxd::platform::driver::service
inherited

the driver's shell

◆ status

◆ version

uint32_t dxd::driver::version{DX_VERSION32}
inherited

what dx::ioctl::version answers


The documentation for this class was generated from the following file: