PortClass各适配器端口驱动类继随承关系
2022-08-29
104
0
Mini端口类驱动程序
通过PcNewPort实现:
//
// Instantiate the port by calling a function supplied by PortCls.
//
PPORT port;
NTSTATUS ntStatus = PcNewPort(&port, PortClassId);
if (NT_SUCCESS(ntStatus))
{
PUNKNOWN miniport;
//
// Create the miniport object.
//
if (MiniportCreate) // a function to create a proprietary miniport
{
ntStatus = MiniportCreate(&miniport,
MiniportClassId, NULL, NonPagedPool);
}
else // Ask PortCls for one of its built-in miniports.
{
ntStatus = PcNewMiniport((PMINIPORT*)&miniport,
MiniportClassId);
}
if (NT_SUCCESS(ntStatus))
{
//
// Bind the port, miniport, and resources.
//
ntStatus = port->Init(DeviceObject,
Irp, miniport, UnknownAdapter, ResourceList);
if (NT_SUCCESS(ntStatus))
{
//
// Hand the port driver and the reference
// string to PortCls.
//
ntStatus = PcRegisterSubdevice(DeviceObject,
Name, port);
}
//
// We no longer need to reference the miniport driver.
// Either the port driver now references it,
// or binding failed and it should be deleted.
//
miniport->Release();
}
//
// Release the reference that existed when PcNewPort() gave us
// the pointer in the first place. This reference must be released
// regardless of whether the binding of the port and miniport
// drivers succeeded.
//
port->Release();
}
其有以下几种:
Class GUID | Port Interface Name |
---|---|
CLSID_PortWaveCyclic | IPortWaveCyclic |
CLSID_PortWavePci | IPortWavePci |
CLSID_PortWaveRT | IPortWaveRT |
CLSID_PortMidi | IPortMidi |
CLSID_PortDMus | IPortDMus |
CLSID_PortTopology | IPortTopology |
对应的就是这些: