-1

I have an UWP C# application that needs to use printers that are connected via USB. Unfortunately the UWP built-in functionality for these sorts of devices (Windows.Devices.Usb namespace) has some major shortcomings. It doesn't recognize the USB printers as printers without installing the manufacture's driver (because Pnp manager doesn't provide enough info to the registry). Installing a specific driver is something that I don't want to do. I have written a C++ script using CreateFile and WriteFile to access the printers, but unfortunately UWP doesn't offer support for CreateFile and CreateFile2 has limited access only to app's local folder and the package's installed location. Do you have any suggestions how I might be able to bypass the UWP restrictions, or maybe some other way besides CreateFile to get the device handle that I could pass to WriteFile?

1 Answers1

0

UWP app run sandboxed, it only can access certain file system locations by default as the document File access permissions. So my suggestion is that you can try to create a classic app to use these specific APIs, then convert it to UWP using Desktop Bridge.

Breeze Liu - MSFT
  • 3,734
  • 1
  • 10
  • 13