Match USB Printer to friendly name
-
Hi! I need to implement bidirectional communication with a USB printer. Short story is: there can be more than one printer of the same model connected to the system at a time. I may have access to the serial numbers of the printers through the device ID (not even sure of this yet), but I need to match this up with the "friendly name" used in the spooler to be sure that I have the right printer. I also have a sort of virtual port number obtained from the registry, but that seems to be completely irrelevant. Does anyone have any ideas how to do this? The unmodified driver (we are an OEM) cannot tell identical printers apart from the driver level, so I don't even know if this is possible. Obviously the spooler knows the difference, but the spooler interface (WritePrinter, ReadPrinter) is not bidirectional-capable in this driver. Thanks much...
-
Hi! I need to implement bidirectional communication with a USB printer. Short story is: there can be more than one printer of the same model connected to the system at a time. I may have access to the serial numbers of the printers through the device ID (not even sure of this yet), but I need to match this up with the "friendly name" used in the spooler to be sure that I have the right printer. I also have a sort of virtual port number obtained from the registry, but that seems to be completely irrelevant. Does anyone have any ideas how to do this? The unmodified driver (we are an OEM) cannot tell identical printers apart from the driver level, so I don't even know if this is possible. Obviously the spooler knows the difference, but the spooler interface (WritePrinter, ReadPrinter) is not bidirectional-capable in this driver. Thanks much...
no reply on this one huh? Yeah, it seems to be a toughie...well just wanted to add some info I think I left out: I'm using file-based access to the port to achieve the communication. I call SetupDiGetDeviceInterfaceDetail to get the device path, and use ReadFile and WriteFile from there on. So the problem is getting some piece of information from the SetupDi functions (or maybe CM_ functions) that I can match with something that I get from the spooler functions (OpenPrinter, GetPrinter, etc.) The SetupDi functions only give me manufacturer name, model, and serial #. As I tried to say above, the options as I see them are: 1 retrieve serial # from spooler functions (I can get it from the other side) 2 match virtual USB port in spooler (ie "USB0001") to actual port (maybe "hub#:port#", but any format will do) <-seems more likely option Just wanted to make sure I was being as clear as possible. Thanks!
-
no reply on this one huh? Yeah, it seems to be a toughie...well just wanted to add some info I think I left out: I'm using file-based access to the port to achieve the communication. I call SetupDiGetDeviceInterfaceDetail to get the device path, and use ReadFile and WriteFile from there on. So the problem is getting some piece of information from the SetupDi functions (or maybe CM_ functions) that I can match with something that I get from the spooler functions (OpenPrinter, GetPrinter, etc.) The SetupDi functions only give me manufacturer name, model, and serial #. As I tried to say above, the options as I see them are: 1 retrieve serial # from spooler functions (I can get it from the other side) 2 match virtual USB port in spooler (ie "USB0001") to actual port (maybe "hub#:port#", but any format will do) <-seems more likely option Just wanted to make sure I was being as clear as possible. Thanks!