#include <bus.h>
Inherits BazisLib::DDK::PNPDevice.
Public Member Functions | |
BusPDO (BusDevice *pBusDevice, const wchar_t *pwszDeviceType=L"StandardDevice", const wchar_t *pwszDeviceName=L"Unknown device", const wchar_t *pwszLocation=L"Unknown") | |
virtual | ~BusPDO () |
NTSTATUS | Register (Driver *pDriver) |
NTSTATUS | Eject () |
void | PlugOut () |
Protected Member Functions | |
virtual void | GenerateIDStrings (int UniqueDeviceNumber) |
virtual NTSTATUS | OnRemoveDevice (NTSTATUS LowerDeviceRemovalStatus) override |
virtual NTSTATUS | OnQueryDeviceRelations (DEVICE_RELATION_TYPE Type, PDEVICE_RELATIONS *ppDeviceRelations) |
virtual NTSTATUS | OnQueryCapabilities (PDEVICE_CAPABILITIES Capabilities) |
virtual NTSTATUS | OnQueryDeviceID (BUS_QUERY_ID_TYPE Type, PWCHAR *ppDeviceID) |
virtual NTSTATUS | OnQueryDeviceText (DEVICE_TEXT_TYPE Type, LCID Locale, PWCHAR *ppDeviceText) |
virtual NTSTATUS | OnQueryResources (PCM_RESOURCE_LIST *ppResourceList) |
virtual NTSTATUS | OnQueryResourceRequirements (PIO_RESOURCE_REQUIREMENTS_LIST *ppResourceRequirementsList) |
virtual NTSTATUS | OnQueryBusInformation (PPNP_BUS_INFORMATION *ppBusInformation) |
virtual NTSTATUS | OnEject () |
virtual NTSTATUS | OnQueryInterfaceRaw (CONST GUID *InterfaceType, USHORT Size, USHORT Version, PINTERFACE pInterface, PVOID InterfaceSpecificData) |
virtual IUnknownDeviceInterface * | CreateObjectByInterfaceID (LPCGUID lpGuid, unsigned Version, PVOID pSpecificData) |
PDEVICE_OBJECT | GetDeviceObject () |
virtual NTSTATUS | DispatchPNP (IN IncomingIrp *Irp, IO_STACK_LOCATION *IrpSp) |
BusDevice * | GetBusDevice () |
unsigned | GetUniqueID () |
Protected Attributes | |
string | m_DeviceID |
string | m_HardwareIDs |
string | m_InstanceID |
string | m_CompatibleIDs |
string | m_DeviceType |
string | m_DeviceName |
string | m_DeviceLocation |
Static Private Member Functions | |
static void | sInterfaceReference (PVOID Context) |
static void | sInterfaceDereference (PVOID Context) |
Private Attributes | |
BusDevice * | m_pBusDevice |
long | m_UniqueID |
bool | m_bDevicePresent |
Actual device is present. Set to false on ejection and removal. | |
bool | m_bReportedMissing |
Friends | |
class | BusDevice |
BazisLib::DDK::BusPDO::BusPDO | ( | BusDevice * | pBusDevice, | |
const wchar_t * | pwszDeviceType = L"StandardDevice" , |
|||
const wchar_t * | pwszDeviceName = L"Unknown device" , |
|||
const wchar_t * | pwszLocation = L"Unknown" | |||
) |
virtual BazisLib::DDK::BusPDO::~BusPDO | ( | ) | [virtual] |
virtual IUnknownDeviceInterface* BazisLib::DDK::BusPDO::CreateObjectByInterfaceID | ( | LPCGUID | lpGuid, | |
unsigned | Version, | |||
PVOID | pSpecificData | |||
) | [inline, protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::DispatchPNP | ( | IN IncomingIrp * | Irp, | |
IO_STACK_LOCATION * | IrpSp | |||
) | [protected, virtual] |
Actual handler for IRP_MJ_PNP requests.
Reimplemented from BazisLib::DDK::PNPDevice.
NTSTATUS BazisLib::DDK::BusPDO::Eject | ( | ) |
virtual void BazisLib::DDK::BusPDO::GenerateIDStrings | ( | int | UniqueDeviceNumber | ) | [protected, virtual] |
BusDevice* BazisLib::DDK::BusPDO::GetBusDevice | ( | ) | [inline, protected] |
PDEVICE_OBJECT BazisLib::DDK::BusPDO::GetDeviceObject | ( | ) | [inline, protected] |
Reimplemented from BazisLib::DDK::Device.
unsigned BazisLib::DDK::BusPDO::GetUniqueID | ( | ) | [inline, protected] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnEject | ( | ) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryBusInformation | ( | PPNP_BUS_INFORMATION * | ppBusInformation | ) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryCapabilities | ( | PDEVICE_CAPABILITIES | Capabilities | ) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryDeviceID | ( | BUS_QUERY_ID_TYPE | Type, | |
PWCHAR * | ppDeviceID | |||
) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryDeviceRelations | ( | DEVICE_RELATION_TYPE | Type, | |
PDEVICE_RELATIONS * | ppDeviceRelations | |||
) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryDeviceText | ( | DEVICE_TEXT_TYPE | Type, | |
LCID | Locale, | |||
PWCHAR * | ppDeviceText | |||
) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryInterfaceRaw | ( | CONST GUID * | InterfaceType, | |
USHORT | Size, | |||
USHORT | Version, | |||
PINTERFACE | pInterface, | |||
PVOID | InterfaceSpecificData | |||
) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryResourceRequirements | ( | PIO_RESOURCE_REQUIREMENTS_LIST * | ppResourceRequirementsList | ) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnQueryResources | ( | PCM_RESOURCE_LIST * | ppResourceList | ) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusPDO::OnRemoveDevice | ( | NTSTATUS | LowerDeviceRemovalStatus | ) | [override, protected, virtual] |
Called when IRP_MN_REMOVE_DEVICE is received. Disables the device interface and deletes the device object. The OnRemoveDevice() minihandler is called after the lower driver processes the IRP.
LowerDeviceRemovalStatus | Contains the status returned by lower driver. |
<<< Perform actual cleanup >>> status = ... if (NT_SUCCESS(status)) return __super::OnRemoveDevice(LowerDeviceRemovalStatus);
Additionally, if you want to report an error code, do it AFTER calling __super::OnRemoveDevice():
NTSTATUS status2 = __super::OnRemoveDevice(LowerDeviceRemovalStatus); if (!NT_SUCCESS(status2)) return status2;
return status;
Reimplemented from BazisLib::DDK::PNPDevice.
void BazisLib::DDK::BusPDO::PlugOut | ( | ) |
NTSTATUS BazisLib::DDK::BusPDO::Register | ( | Driver * | pDriver | ) |
static void BazisLib::DDK::BusPDO::sInterfaceDereference | ( | PVOID | Context | ) | [static, private] |
static void BazisLib::DDK::BusPDO::sInterfaceReference | ( | PVOID | Context | ) | [static, private] |
friend class BusDevice [friend] |
bool BazisLib::DDK::BusPDO::m_bDevicePresent [private] |
Actual device is present. Set to false on ejection and removal.
bool BazisLib::DDK::BusPDO::m_bReportedMissing [private] |
The I/O manager no longer considers the device to be one of the child devices for bus FDO This means that either the FDO handled IRP_MN_QUERY_DEVICE_RELATIONS with m_bDevicePresent = false, or bus FDO is being removed or received surprise removal IRP.
string BazisLib::DDK::BusPDO::m_CompatibleIDs [protected] |
string BazisLib::DDK::BusPDO::m_DeviceID [protected] |
string BazisLib::DDK::BusPDO::m_DeviceLocation [protected] |
string BazisLib::DDK::BusPDO::m_DeviceName [protected] |
string BazisLib::DDK::BusPDO::m_DeviceType [protected] |
Reimplemented from BazisLib::DDK::Device.
string BazisLib::DDK::BusPDO::m_HardwareIDs [protected] |
string BazisLib::DDK::BusPDO::m_InstanceID [protected] |
BusDevice* BazisLib::DDK::BusPDO::m_pBusDevice [private] |
long BazisLib::DDK::BusPDO::m_UniqueID [private] |