Try:
a) devmgmt.msc + Scan For Hardware Changes
and
b) run diskmgmt.msc
after adding the disk physically (powering up a eSATA external box or such).
If a) will work - then yes, IoInvalidateDeviceRelations is enough.
If a) will not work - then IoInvalidateDeviceRelations will not work too.
Then, for the b) case, use some IRP tracing tool to trace the IOCTLs sent by diskmgmt.msc at startup. Probably it sends the legacy IOCTL_SCSI_RESCAN_BUS.
Probably this legacy IOCTL is just plain the only way. Probably there are other controller-specific undocumented IOCTLs.
And, if the b) path does not work - then sorry, no ways at all, thanks MS for forgetting to add this functionality to ATAPORT. Probably this is also the case.
In this latter case, just require the AHCI controller for your product, it’s driver (Vista+) surely supports hot disk arrival (though it does not work always due to some strange electrical or software cases).
Pre-AHCI ancient-style PC/AT IDE (even with Intel’s adornments for DMA) just plain does not support hot disk arrival electrically. So, there are chances that the Windows ATA stack just plain does not support bus rescans at all.
More so: parallel ATA and SATA (not eSATA) do not support hot plug.
More so: the users are aware on aforementioned facts, so, I have major doubts you will ever see the disk hot plug to PC/AT controller. There is a case of external eSATA box (wired to PC/AT controller by the SATA-to-eSATA wire from the motherboard to the box’s rear side hole) powering up, but the users are aware that controller restart in Device Manager is a must for this.
And yes, if this is the boot controller - then please reboot.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> Thanks Maxim.
>
> as per msdn IOCTL_SCSI_RESCAN_BUS is for legacy drivers only so probably I can’t use it.
> disable/enable using setupDi* is not an option for me as my target is boot controller.
>
> My requirement is to force the portdriver to re-obtain identify data from the target disk and re-report it to the system.
>
>
>
>