Followup: parasite UI installing RAW devnode with NULL INF

A month ago I filed a question here about the parasite UI boxes (including the reboot request) installing a NULL INF file for the raw devnode.

OS: Win7

The cause was: the OS first starts the raw (RawDeviceOk) devnode without the INF being installed, and then it query removes it to install the INF. The next MN_START_DEVICE follows after the INF file was installed for this devnode.

My code was starting some Activity on the devnode and, when the Activity was running, it vetoes query remove. This was the cause of the bug.

Starting the Activity only in a case if the INF is already installed (IoGetDeviceProperty for the setup class succeeds) solved the problem. For now, the RAW devnode is first started pre-install without Activity, then it is query removed and the INF is installed, and when it is started the second time, Activity starts.

After this remake, the code was fine with a complex set of pnpdtest and pwrtest test quites, all on 2008 R2 x64 Checked (kernel+HAL only) with Verifier on.

So, I would suggest everybody to note this behavior of the RAW devnodes - it is first started without installing a NULL INF, then query removed and NULL INF is installed, and then started again. In the second start, the values from the INF are available by IoGetDeviceProperty.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Instead of IoGetDeviceProperty, a cleaner approach would be to register the
device interface GUID for the PDO by the INF file. This way, you would not
see it until the device is installed with the proper INF. And don’t forget
to register device notification in your client code, too, for cleaner
disable path.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
A month ago I filed a question here about the parasite UI boxes
(including the reboot request) installing a NULL INF file for the raw
devnode.

OS: Win7

The cause was: the OS first starts the raw (RawDeviceOk) devnode without
the INF being installed, and then it query removes it to install the INF.
The next MN_START_DEVICE follows after the INF file was installed for this
devnode.

My code was starting some Activity on the devnode and, when the Activity
was running, it vetoes query remove. This was the cause of the bug.

Starting the Activity only in a case if the INF is already installed
(IoGetDeviceProperty for the setup class succeeds) solved the problem. For
now, the RAW devnode is first started pre-install without Activity, then it
is query removed and the INF is installed, and when it is started the second
time, Activity starts.

After this remake, the code was fine with a complex set of pnpdtest and
pwrtest test quites, all on 2008 R2 x64 Checked (kernel+HAL only) with
Verifier on.

So, I would suggest everybody to note this behavior of the RAW
devnodes - it is first started without installing a NULL INF, then query
removed and NULL INF is installed, and then started again. In the second
start, the values from the INF are available by IoGetDeviceProperty.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com