How to get fixed storage media type (HDD or SSD) using winapi?
13:14 26 Dec 2025

As a disclaimer, I have successfully used DeviceIoControl with IOCTL_STORAGE_QUERY_PROPERTY to get a STORAGE_DEVICE_DESCRIPTOR structure that contains the BusType enum, such as SATA or NVMe for fixed storage.

I am using C# and .NET 10.

I am looking to get the media type, such as HDD or SSD, with winapi on Windows OS. Similar to how Windows Task Manager, Advanced storage settings, or Get-PhysicalDisk PowerShell command show:

Task Manager

Advanced storage settings

Get-PhysicalDisk PowerShell command

Would anyone know how I can do this with winapi?

c# c++ c windows winapi