Need notification to my application when a SCSI disk gets connected to the system
Posted on 2013-01-23
I am using an application written in C++ on Windows 7, that is used to detect SAS disks connected to the LSI HBA on my system and to send various SCSI commands to the disk.
Presently to the detect the disks connected to the system, user has to scan the device tree of windows, get the details of the new disks that are added to the system and update my application with those details.
my application uses SetupDiGetClassDevs API with the flag GUID_DEVINTERFACE_DISK for this purpose.
I have a requirement of enabling the application to receive a notification from windows when the disk is connected/removed to/from the system. In other words, i need to make my application PNP enabled.
Is it possible to get a notification when a new disk gets connected to the SAS HBA or removed from the HBA? Does windows 7 provide any APIS for this purpose?
Can i find some sample code which does this?