mirror of
https://github.com/outbackdingo/Hardware-Sniffer.git
synced 2026-01-27 10:19:09 +00:00
Use disk drive name instead of storage controller name
This commit is contained in:
@@ -83,6 +83,7 @@ class WindowsHardwareInfo:
|
||||
"Mouse": [],
|
||||
"HDC": [],
|
||||
"SCSIAdapter": [],
|
||||
"DiskDrive": [],
|
||||
"Biometric": [],
|
||||
"Bluetooth": [],
|
||||
"SDHost": [],
|
||||
@@ -532,6 +533,12 @@ class WindowsHardwareInfo:
|
||||
def storage_controllers(self):
|
||||
storage_controller_info = {}
|
||||
|
||||
disk_drive_name_by_id = {}
|
||||
for device in self.devices_by_class.get("DiskDrive"):
|
||||
device_name = device.Name or None
|
||||
parent_id = device.GetDeviceProperties(["DEVPKEY_Device_Parent"])[0][0].Data.upper()
|
||||
disk_drive_name_by_id[parent_id] = device_name
|
||||
|
||||
for device in self.devices_by_class.get("HDC") + self.devices_by_class.get("SCSIAdapter"):
|
||||
device_name = device.Name or "Unknown"
|
||||
pnp_device_id = device.PNPDeviceID
|
||||
@@ -549,7 +556,7 @@ class WindowsHardwareInfo:
|
||||
pass
|
||||
|
||||
device_info.update(self.get_device_location_paths(device))
|
||||
storage_controller_info[self.utils.get_unique_key(device_name, storage_controller_info)] = device_info
|
||||
storage_controller_info[self.utils.get_unique_key(disk_drive_name_by_id.get(pnp_device_id, device_name), storage_controller_info)] = device_info
|
||||
|
||||
return storage_controller_info
|
||||
|
||||
|
||||
Reference in New Issue
Block a user