status = IoRegisterPlugPlayNotification
(EventCategoryDeviceInterfaceChange,
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,
(PVOID)&GUID_PARALLEL_DEVICE,//GUID_PARALLEL_DEVICE,
pDriverObject,
(PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)LbkEnumPorts,
(PVOID)NULL,//Context Points to
a caller-allocated buffer containing context that the PnP Manager passes to
the callback routine.
&NotificationHandle);
My computer has one parallel port and the function ...
NTSTATUS
LbkEnumPorts (
IN PDEVICE_INTERFACE_CHANGE_NOTIFICATION NotificationStructure,
IN PVOID Context
)
{
CUString s("abc");
DbgPrint ("+++++ %08x %04x %S",
NotificationStructure->InterfaceClassGuid.Data1,
NotificationStructure->InterfaceClassGuid.Data2,
NotificationStructure->SymbolicLinkName);
return STATUS_SUCCESS;
}
... is called once. So far so good, as I can see the InterfaceClassGuid
corresponds to GUID_PARALLEL_DEVICE.
Ok, BUT NotificationStructure->SymbolicLinkName contains '????' instead of
LPT1. Is that ok? As far as I understood the PARCLASS example this funktion
determined the devices SymbolicLinkName.
the SymbolicLinkName returned in the notification structure is a
plug and play device interface path, not the LPT name for the
device. the device interface path is a symbolic link to the device
stack for the parallel port device, and is preferred because it is
independent of whatever legacy DosDevices LPT symbolic link
name the device is currently assigned.
the device interface symbolic link name begins with the \?? prefix,
but your driver shouldn't need to worry about that; just know that
the string as a fully qualified object manager path which you can use
to access the device in calls such as IoGetDeviceObjectPointer or
ZwCreateFile.
hope this helps,
jim.
"ben" <b...@gmx.com> wrote in message news:3dea84aa$0$342$a961...@news.cityweb.de...