inject root enumerated device offline

What is the (best) way to add a root enumerated device instance to an offline image?

I have my VHD mounted on E:, but devcon appears to only work on the local system.

Thanks

James

A believe one strategy is to make the driver load, which can be done simply by setting registry entries, and then in DriverEntry conditionally call IoReportDetectedDevice, which will among other things crate a root enumerated PnP entry for use NEXT time. A PDO will be be returned and its state is assumed to be started, and you need make the right stuff happen. The next time the system starts, you don’t call IoReportDetectedDevice, and the root enumerated PnP entry that was previously crated will work.

I have no idea if this is still the “recommended” way to inject a root enumerated device into an image. There might now be a WinPE OS setup configuration value that can create root enumerated device entries. I’ve never completely understood offline image servicing.

I suspect the OS setup process does some registry redirection trickery, so it can be running under WinPE and detect PnP devices and run their driver install which updates the registry of the OS image being installed instead of the running WinPE registry.

Jan

From: on behalf of James Harper
Reply-To: Windows List
Date: Monday, June 6, 2016 at 4:12 AM
To: Windows List
Subject: [ntdev] inject root enumerated device offline

What is the (best) way to add a root enumerated device instance to an offline image?

I have my VHD mounted on E:, but devcon appears to only work on the local system.

Thanks

James


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

The driver is storport, and it seems that if I IoReportDetectedDevices, storport won’t see the device. As you indicate, it might on the next boot, but I’m network booting off the root enumerated device (or trying to), and all changes will be thrown away on reboot so there is no “next time”. I’m network booting off an image which I want to minimally update offline first (eg inject driver), but the changes do have to be done offline.

So the next method would be to inject the device into the registry manually… sounds nasty.

Thanks

James

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Jan Bottorff
Sent: Tuesday, 7 June 2016 5:33 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] inject root enumerated device offline

A believe one strategy is to make the driver load, which can be done simply by setting registry entries, and then in DriverEntry conditionally call IoReportDetectedDevice, which will among other things crate a root enumerated PnP entry for use NEXT time. A PDO will be be returned and its state is assumed to be started, and you need make the right stuff happen. The next time the system starts, you don’t call IoReportDetectedDevice, and the root enumerated PnP entry that was previously crated will work.

I have no idea if this is still the “recommended” way to inject a root enumerated device into an image. There might now be a WinPE OS setup configuration value that can create root enumerated device entries. I’ve never completely understood offline image servicing.

I suspect the OS setup process does some registry redirection trickery, so it can be running under WinPE and detect PnP devices and run their driver install which updates the registry of the OS image being installed instead of the running WinPE registry.

Jan

From: > on behalf of James Harper >
Reply-To: Windows List >
Date: Monday, June 6, 2016 at 4:12 AM
To: Windows List >
Subject: [ntdev] inject root enumerated device offline

What is the (best) way to add a root enumerated device instance to an offline image?

I have my VHD mounted on E:, but devcon appears to only work on the local system.

Thanks

James


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:></http:></http:></http:>

I was recently looking into this problem myself, and found out about the
[DeviceInstall32] INF section. This section isn’t documented, but is used by
kdnic (see %SystemRoot%\inf\kdnic.inf) and by the avssamp sample driver (see
https://github.com/Microsoft/Windows-driver-samples/blob/master/avstream/avssamp/avssamp.inf).

Do something like this…

[DeviceInstall32]
AddDevice = ROOT\XYZ\0001,RootDevice_Install

[RootDevice_Install]
HardwareIds = ROOT\XYZ

In theory, DISM will add the root device ID when it injects the driver.

DeviceInstall32 only appears to be available on Windows 8 and Windows 10 (and
equivalent server SKU’s). For older OS versions you’ll probably need to hack
the registry directly. That may not be as bad as it sounds, since you’ll only
be doing it for older OS versions. The registry keys you need to add are
known, and aren’t going to change.

IMPORTANT: I haven’t tested this yet myself. I’m just relying the information
that I gathered.

-------- Original Message --------
Subject: [ntdev] inject root enumerated device offline
From: James Harper
To: Windows System Software Devs Interest List
Date: 6/6/2016 6:12 AM

> What is the (best) way to add a root enumerated device instance to an offline
> image?
>
> I have my VHD mounted on E:, but devcon appears to only work on the local system.