title: How can I get connected storage devices and information about those on Windows?
body: <p>I want to do the following:</p>
  <ol>
  <li>Get a list of physical storage devices connected to the PC</li>
  <li>For each of these devices, query information: display name, drive letter, storage capacity, free storage capacity and, if possible, a device type (SD Card, Phone etc.)</li>
  </ol>
  <p>For me, it seems like there were many ways to achieve the first goal (list of devices), for example <a href="https://docs.microsoft.com/en-us/windows/win32/api/portabledeviceapi/nf-portabledeviceapi-iportabledevicemanager-getdevices" rel="nofollow noreferrer"><code>IPortableDeviceManager::GetDevices</code></a> or the volume management functions in <a href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/" rel="nofollow noreferrer">fileapi.h</a>. But since I've never used the winapi before, I'm unable to determine which API I should use.</p>