#include <bus.h>
Inherits BazisLib::DDK::IODevice.
Public Member Functions | |
BusDevice (string BusPrefix, bool bDeleteThisAfterRemoveRequest=false, ULONG DeviceCharacteristics=FILE_DEVICE_SECURE_OPEN, bool bExclusive=FALSE, ULONG AdditionalDeviceFlags=DO_POWER_PAGABLE) | |
virtual | ~BusDevice () |
Protected Member Functions | |
virtual NTSTATUS | OnSurpriseRemoval () override |
virtual NTSTATUS | OnRemoveDevice (NTSTATUS LowerDeviceRemovalStatus) override |
NTSTATUS | CreateNewPDO (OUT LONG *pUniqueID=NULL, void *pContext=NULL) |
BusPDO * | FindPDOByUniqueID (LONG UniqueID) |
NTSTATUS | QueryParentPDOCapabilities (PDEVICE_CAPABILITIES Capabilities) |
virtual BusPDO * | CreatePDOInstance (void *pContext) |
virtual NTSTATUS | OnQueryDeviceRelations (DEVICE_RELATION_TYPE Type, PDEVICE_RELATIONS *ppDeviceRelations) |
virtual NTSTATUS | DispatchPNP (IN IncomingIrp *Irp, IO_STACK_LOCATION *IrpSp) |
Private Attributes | |
std::list< BusPDO * > | m_PhysicalDevObjects |
FastMutex | m_ListAccessMutex |
long | m_NextDeviceNumber |
string | m_BusPrefix |
Friends | |
class | BusPDO |
BazisLib::DDK::BusDevice::BusDevice | ( | string | BusPrefix, | |
bool | bDeleteThisAfterRemoveRequest = false , |
|||
ULONG | DeviceCharacteristics = FILE_DEVICE_SECURE_OPEN , |
|||
bool | bExclusive = FALSE , |
|||
ULONG | AdditionalDeviceFlags = DO_POWER_PAGABLE | |||
) |
virtual BazisLib::DDK::BusDevice::~BusDevice | ( | ) | [virtual] |
NTSTATUS BazisLib::DDK::BusDevice::CreateNewPDO | ( | OUT LONG * | pUniqueID = NULL , |
|
void * | pContext = NULL | |||
) | [protected] |
virtual BusPDO* BazisLib::DDK::BusDevice::CreatePDOInstance | ( | void * | pContext | ) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusDevice::DispatchPNP | ( | IN IncomingIrp * | Irp, | |
IO_STACK_LOCATION * | IrpSp | |||
) | [protected, virtual] |
Actual handler for IRP_MJ_PNP requests.
Reimplemented from BazisLib::DDK::PNPDevice.
BusPDO* BazisLib::DDK::BusDevice::FindPDOByUniqueID | ( | LONG | UniqueID | ) | [protected] |
virtual NTSTATUS BazisLib::DDK::BusDevice::OnQueryDeviceRelations | ( | DEVICE_RELATION_TYPE | Type, | |
PDEVICE_RELATIONS * | ppDeviceRelations | |||
) | [protected, virtual] |
virtual NTSTATUS BazisLib::DDK::BusDevice::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.
virtual NTSTATUS BazisLib::DDK::BusDevice::OnSurpriseRemoval | ( | ) | [override, protected, virtual] |
Reimplemented from BazisLib::DDK::PNPDevice.
NTSTATUS BazisLib::DDK::BusDevice::QueryParentPDOCapabilities | ( | PDEVICE_CAPABILITIES | Capabilities | ) | [protected] |
friend class BusPDO [friend] |
string BazisLib::DDK::BusDevice::m_BusPrefix [private] |
long BazisLib::DDK::BusDevice::m_NextDeviceNumber [private] |
std::list<BusPDO *> BazisLib::DDK::BusDevice::m_PhysicalDevObjects [private] |