I’m having a hard time getting my head wrapped around all this
I asked about IoReportDetectedDevice() and mentioned my plans:
Plan A:
>Create a DO in DriverEntry plus do all the stuff that would normally be
>done in AddDevice. [… the smartcard library …]
>
>Plan B:
>Reformat the code as a WDM PnP driver […]
I got a couple of responses about KMDF that for several reasons I
will consider Plan C.
I’m still working on Plan A.
Maxim Shatskih writes:
You can create a do-nothing PDO via IoReportDetectedDevice with NULL
parameters
>though, and then attach your own FDO on top of such a PDO.
The only reference to IoReportDetectedDevice() I can find in the samples
is in the serial
driver which on first glance looks about as clear as mud. (Reminds me of
the VMS one.)
Is my thinking correct here? I think I’m creating a hybrid legacy/pnp
driver that
supports most of the PnP functions. No AddDevice() == legacy but
IRP_MJ_PNP etc == PnP?
DriverEntry (DriverObject…
DriverObject->DriverUnload = (func)
DriverObject->DriverExtension->AddDevice = NULL
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (func)
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = (func)
DriverObject->MajorFunction[IRP_MJ_PNP] = (func)
DriverObject->MajorFunction[IRP_MJ_POWER] = (func)
(plus others)
IoCreateDevice (
DriverObject,
sizeof(EXTENSION),
&DeviceObjName,
FILE_DEVICE_SMARTCARD,…
&NewDeviceObject
IoReportDetectedDevice (
DriverObject,
InterfaceTypeUndefined,
-1,
-1,
NULL,
NULL,
FALSE,
&NewPdo
LowerDevice = IoAttachDeviceToDeviceStack (NewDeviceObject, NewPdo);
IoRegisterDeviceInterface (
&NewPdo
&SmartCardReaderGuid,…
Every IRP I get that would normally be passed on to the lower bus
driver(etc) gets
completed by me so from this point on, I pretty much ignore NewPdo. (True?)
I sincerly appreciate our comments
Mickey.