Add parallel port device dependency to parport.sys, with _DEP property

I wrote a WDK 10 driver for a legacy LPT port device.
Since it uses services of parport.sys it opens device “\Device\ParallelPort0”.

Under Win7 the driver works OK.
Under Win8 and Win10, Apparently \device\parallelport0 is brought up
AFTER my device, so my AddDevice() call fails.

As I searched for a solution, I learned that there are two ways to establish a dependency between my device and parallelport0:
a) Register a callback in my driver, which is called when parallelport0 is brought up or down. See IoRegisterPlugPlayNotification()
b) Under Win8, use the “_DEP property of the device node”.

The latter sounds interesting, but I found no information about ACPI “_DEP” dependency setups between devices.

Can anybody point me to docs or to an example?

Thanks,
J. Hoppe, PEAK-System Technik GmbH, Darmstadt, Germany

don’t use _DEP, use IoRegisterPlugPlayNotification

Sent from Mailhttp: for Windows 10

From: xxxxx@t-online.de
Sent: Wednesday, October 7, 2015 4:04 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Add parallel port device dependency to parport.sys, with _DEP property

I wrote a WDK 10 driver for a legacy LPT port device.
Since it uses services of parport.sys it opens device “\Device\ParallelPort0”.

Under Win7 the driver works OK.
Under Win8 and Win10, Apparently \device\parallelport0 is brought up
AFTER my device, so my AddDevice() call fails.

As I searched for a solution, I learned that there are two ways to establish a dependency between my device and parallelport0:
a) Register a callback in my driver, which is called when parallelport0 is brought up or down. See IoRegisterPlugPlayNotification()
b) Under Win8, use the “_DEP property of the device node”.

The latter sounds interesting, but I found no information about ACPI “_DEP” dependency setups between devices.

Can anybody point me to docs or to an example?

Thanks,
J. Hoppe, PEAK-System Technik GmbH, Darmstadt, Germany


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</http:>

> a) Register a callback in my driver, which is called when parallelport0 is brought up or down. See

IoRegisterPlugPlayNotification()

This is the way to go.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Doron, Maxim,

thanks for answering.

I experimented with IoRegisterPlugPlayNotification(), but ran into the following problem:

My device driver needs the services of parport.sys in very early
(mostly because of the I/O address of the parallel port, but I need also the Interrupt).

So I need to delay the call to my EvtDevicePrepareHardware() callback, until
\Device\Parallelport0 is started (and I got my PlugPlayNotification fired).

Such a delay seems impossible todo from within my driver.
A solution would be to construct a parent-child relation between my device and
\Device\Parallelport0, so the PnP manager orders the callback events properly.

I tried to construct a device instance path where I’m a sub component of PNP0400 … but this led to nowhere: my device is always installed at Enum\ROOT\UNKNOWN.

You see, this topic is slightly over my skills … any pointers?

Joerg Hoppe - PEAK System Technik GmbH