title: What is the preferred way to get a device path for CreateFile() in a UWP C++ App?
body: <p>I am converting a project to a UWP App, and thus have been following guidelines outlined in the MSDN post <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/install/porting-from-setupapi-to-cfgmgr32" rel="nofollow noreferrer">here</a>. The existing project heavily relies on CreateFile() to communicate with connected devices.</p>
  
  <p>There are many posts in SO that show us how to get a CreateFile()-accepted device path using SetupAPI's <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff551120(v=vs.85).aspx" rel="nofollow noreferrer">SetupDiGetDeviceInterfaceDetail()</a> Is there an alternative way to do this using the PnP Configuration Manager API? Or an alternative, user-mode way at all?</p>
  
  <p>I had some hope when I saw this <a href="https://github.com/Microsoft/Windows-driver-samples/blob/master/bluetooth/bthecho/bthcli/app/main.cpp" rel="nofollow noreferrer">example</a> in Windows Driver Samples github, but quickly became dismayed when I saw that the function they used in the sample is ironically not intended for developer use, as noted in this <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff549753(v=vs.85).aspx" rel="nofollow noreferrer">MSDN</a> page. </p>