How to programmatically determine in C or C++ whether a specified path is on a flash (SSD) drive or a magnetic hard drive? I'm only interested in fixed drives, not removable ones, although it will be nice to determine the type of a removable drive as well.

I can see ways to get the root volume path for a specified end path, and a way to get the GUID of this volume, but I'm not finding a way to query this volume's hardware traits.