WMI or CIM Query for USB camera firmware version - wmi

The properties for my USB webcam in Device Manager show a "Device Information" tab, which includes the Firmware Version of the camera. I am trying to find the WMI or CIM class that contains that information. I've been using WMI Code Creator. The most obvious class is "CIM_DeviceSoftware" but calls to that always return null.
Does someone know the WMI or CIM class which would contain the information found in the Device Information tab, particularly the Firmware Version?

Related

Claim device is not working while using the EPSON TM-T88VI printer once we upgrade it to Advanced driver printer from ADK 270

My POS Terminal has installed the Epson driver ADK 2.70E for model EPSON TM-T88VI.
That time the printer was working fine from my POS Terminal application which is in C++.
The registry contains the key in \HKEY_CLASSES_ROOT\OPOS.POSPrinter
enter image description here
In Device MAnager,
the device is displaying in the USB prot.
enter image description here
In Devices, it is displaying in the Unspecified category,
enter image description here
And from my application it is working fine without any problem.
Then I Installed the advanced driver version APD 512E on top of it.
And then try to print the receipt from my application which uses C++
code the print is not happening.
The OPOS error returning as 106 during the claimDevice funciton.
Device MAnager,
enter image description here
Devices,
enter image description here
If I uninstall the Advanced driver it is working fine from my application, like to know y it not working once we upgrade it to Advanced driver ?
Is there any Language compatibility is there, that c++ is not compatible for this Advanced driver ?
You should be concerned with hardware and software mode settings and related APIs, whether C++ or not.
Advanced Printer Driver and OPOS ADK are exclusive and can be used with only one of the settings.
If you want to use OPOS, delete the TM-T88VI related information from the Windows printer list and printer queue, and uninstall Advanced Printer Driver.
If you want to update OPOS, please get it from the above link and update it.
In response to comments:
As per the question in your comment. However, it depends on the hardware settings. It cannot be handled simply by changing the API used.
If you want to use Advanced Printer Driver, you need to use this utility to change the interface hardware settings from vendor class to printer class.
TM-T88VI Utility
Then print using the standard Windows desktop printer API.
Printing (Documents and Printing)
In that case, you will create image data for each page of the print content and print it as bit image data.
If you want to print using printer fonts, cut paper or open a cash drawer, you will need to create and embed RawPrinterHelper.
Send raw data to a printer by using the Win32 API
Print Direct To Windows Printer (EPOS Receipt)
How to send page cut command to Epson printer
Furthermore:
You probably can't use it like a question in a comment.
is that the behaviour of the driver or any other way to add the device to qindows printer without installing Advance printer drivers ?
To be able to use it as a Windows desktop printer, you need to install some printer driver, even if it is not an Advanced printer driver.
For example, it seems that it is no longer provided in windows 10, but before that there was a generic text only printer driver.
You will need to have some such driver installed.
And perhaps if you install the windows printer driver and create a print queue, it's likely that the connection port will be occupied at system startup and will not be available to others.
This corresponds to the phenomenon of "3. The OPOS error returning as 106 during the claimDevice funciton." In the question.
About: what u mentioning as hardware settings ?
This is the interface mode setting by the TM-T88VI Utility described above.
Printer class or Vendor class of USB.
However, if it is currently available in OPOS, you do not need to consider it.
Rather, it should not be changed.

How to programmatically get all printer models for a given manufacturer on windows?

I'm trying to enumerate printer models for a given manufacturer. Windows 'Add Printer' is somehow able to do that - i.e. when a manufacturer is selected in the left list a list of printer models is displayed on the right side.
I'm familiar with EnumPrinters and EnumPrinterDrivers API but neither of the related structures (PRINTER_INFO* and DRIVER_INFO*) contain printer models.
DRIVER_INFO* does contain manufacturer's name but I'm not sure where to find printer models that a corresponding driver supports.
Any suggestions and pointers to on-line docs will be appreciated.
Thanks.
EnumPrinterDrivers only enumerates installed printer drivers. The Add Printer dialog shows available drivers including the built-in drivers not yet installed.
The built-in driver files are in the Driver Store. For instance, if you click on HP in the left pane, the drivers for HP 910 and 915 are in this INF:
C:\Windows\System32\DriverStore\FileRepository\prnhp003.inf_amd64_4480210763997eb4\prnhp003.inf
To install these you could try the old Setup API or new Windows Installer API.
There doesn't seem to be a public API to enumerate the Driver Store contents, but the DISM command line tool can. It will parse all the right folders and INF files (for inbox drivers if you supply the /all switch to /get-drivers) and then you just need to parse the output. E.g.
Dism /online /get-drivers /all /format:list >drivers.txt
(I did suggest DriverStore Explorer but it turns out that's just a wrapper around the Windows PnPUtil.exe tool which can't enumerate inbox drivers.)

Windows C++: Get driver device ID

I'm writing a C++ program that should check Driver Device ID.
My input is the driver name as it should appear in the Device Manager.
I tried to Google, and I figured that:
I could get the driver pointer using this sample code http://msdn.microsoft.com/en-us/library/ms682619%28VS.85%29.aspx
I should use IRP_MN_QUERY_ID function to get the device ID- http://msdn.microsoft.com/en-us/library/windows/hardware/ff551679(v=vs.85).aspx.
However, I couldn't find any examples or code snippets for how to actually do it, and how those two functions connect?
I have no experience in drivers, sample code will be very appreciated...
On windows there are no device ids (as name =) ). Device matches by hardware id and compatible ids. From this ids system generate instance id - uniquely identifies the device on specific port on bus. You can get hardware/compatible id without sending IRPs, by using IoGetDeviceProperty function (http://msdn.microsoft.com/en-us/library/windows/hardware/ff549203(v=vs.85).aspx), it`s more easy than roll up your own IRP.

Path to a USB Device in Windows

I would be using a USB hub to connect multiple devices. I want to fix a specific USB device to a particular slot. Then check if it is done properly.
The way I am planning to achieve this is to get the complete USB path like
PCIROOT(0)#PCI(1D00)#USBROOT(0)#USB(1)#USB(2)#USB(3)#USB(3)
I can get this particular string in w7 via device property but the same is not available in wXP.
You can build this path by using the SetupAPI.
The device manager is built with this.
You start with CM_Locate_DevNode and enumerate children with CM_Get_Child.
I strongly advise you against what you're planning to do. AFAIK a USB device MUST function regardless on the USB port it's plugged in. If you'll creating such a device, forget e.g. about the "Certified for Windows" logo.
Just handle WM_DEVICECHANGE message, then use e.g. WMI to search for the USB device you're interested in. Here's my article about it: that time I coded C# language, however WMI has C++ API as well.

PNPDeviceID Format

I'm working on developing a WMI query for my application. It needs to find the assigned virtual COM port for a given VID/PID. Using the WMI Code Creator I have found that...
Namespace: root\CIMV2
Class: Win32_SerialPort
Property: PNPDeviceID
...returns a value of USB\VID_10C4&PID_EA60\0001. This same value can be found by going to the appropriate entry in Device Manager -> Properties -> Details tab and selecting Device Instance Id.
My question is, what does the \0001 signify? Or, can I expect my device to have a device ID of USB\VID_10C4&PID_EA60\0001 when plugged into any Windows system? Thanks.
It references the device instance. That is, devices with identical identifiers (more than one plugged in) are enumerated, so that the system can identify them.
http://forums.techguy.org/software-development/959095-solved-pnpdeviceid-format.html#3