Windows XP custom USB class driver, pre-install without WHQL signing? - windows-xp

I'm working on a Windows driver for a USB device and the installation has to override the built-in class driver from Microsoft, so that the device uses my driver.
The driver is self-signed but not WHQL signed. Installation is not a problem on Vista or Win7, where SetupAPI acknowledges the driver as signed and selects it as the preferred driver over the built-in class driver.
However, this does not work on Windows XP SP3. The SetupAPI log tells me that it finds the driver, but considers it untrusted. (Log excerpt: "Driver node not trusted, rank changed from 0x00000001 to 0x0000c001")
Previous answers to similar questions here on stackoverflow, and other places, suggest that WHQL signing is the only way for this to work on XP. Is that really the case, or are there any known workarounds?
Does anybody have any links to resources with information about workarounds, or a solution to the problem?
I appreciate any help on the matter.

Yes, this is really the case.
I might've mentioned a workaround we use in my project, but it's irrelevant for you, as your product is intended for the broad market and you cannot rely on your devices having a static Device Instance ID. (To maintain a "known" Device Instance ID, we use a filter driver on top of the USB hub. I'm only mentioning this because you might be curious about that "mysterious" workaround we use.)
By the way, maybe you could rewrite your driver as a device filter driver. They're not subject to the same WHQL limitations.
Edit: If you're willing to install your certificate into your customers' root certificate stores (a risky choice that might alienate your customers), there might be a solution for you:
Preinstalling WinXP USB drivers to be able to connect device without interaction

Related

Cannot update FEZ Hydra firmware: Device is not connected or not responding

Update 1:
Hi friends, could you please recommend me a powered USB hub in Australia(preferred in Melbourne)? I guess my problem is caused by the insufficient power supply.
Hi friends,
I have a FEZ Hydra Basic kit. I got it in 2012 (might be in Sep).
Today I downloaded the latest SDKs, drivers and everything(NETMF and Gadgeteer Package 2014 R1). (.NET Micro Framework 4.3 and the firmware I have on my laptop is 4.2.6.2)
But the firmware on my deivce is 4.1.x.x(I was lucky to saw the device's firmware version just once and I followed the instruction on the software FEZ Config, but failed with errors).
After that, I cannot get the Device's firmware version any more.
I found changing USB ports sometimes help. I have 4 USB ports, some of them can connected to the device, others are not.
So I have no idea to update the firmware in other way.
Could someone please help me to figure out how to find a way to update my firmware?
In the attached image, it shows: the FEZ Config detected the FEZ Hydra and was trying to get the device's firmware version, but it failed to do so and followed by an error message say: Failure - Device is not connected or not responding.
As I mentioned above, I was lucky to see the FEZ Config successfully got the device's version only once.
So my guess is - is it because the output power is not strong enough to support the operation, so I have to use something like a USB hub which has a strong and stable power?(I saw someone mentioned this and cannot find the comments any more).
Bt the way, all USB ports I mentioned above are directly on my laptop which means they get power directly from motherboard, so they should have strong and stable power to support my operations.
I have been stuck at this issue for the whole day, I really hope some friends can help me out.
Thank you very much in advance.
I've had like the same issue. While updating the firmware it threw me that message and I could not reach my Gadgeteer *Fez Hydra at all. I managed to solve it by attaching an external power supply to it. I use the USB Client DP (Dual Power) 1.3. This way you do need the power over USB part and you can safely update the firmware.
USB Client: https://www.ghielectronics.com/catalog/product/280
edit: If that doesn't solve your isse you might want to reset the Loader first. Which is given as a tip on the GHI website before updating the firmware.

How does Win32_Product work?

While working on an auditing project I came across different problems regarding software and licenses. My project runs on Linux with Perl and I successfully retried remote machine software via both SNMP and WMI. The big issue is that the two protocols return quite different results. For instance one may find a program and the other may not, and vice versa.
I know that SNMP retrieves software wich have a related uninstall key on (correct me if I am wrong):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
But what about Win32_Product? This is what the documentation says about:
The Win32_Product WMI class represents products as they are installed
by Windows Installer. A product generally correlates to one
installation package.
What does that mean? And, last but not least, is there a way to improve how installed software are retrieved? I mean if I lookt at my installed software from the control panel and confront results with SNMP and WMI there are a lot of wierd things.
EDIT: Just a quick update, I developed a couple of programs in .NET C# that I installed on many computers. Too bad neither WMI and SNMP find them out. I installed these programs with the usual Visual Studio generated setup. Any hints?
People basically use WMI to query various system parameters. WMI exposes a lot of interfaces which one can leverage. It is mostly used with VBScript but one can also use C++/COM or C# to interact with it. This Wikipedia article can give you a detailed explanation about WMI and then you may understand what Win32_Product Class does. This is another great article and a must-read for someone beginning to work with WMI.
Also go through these articles without fail:
Retrieving a CLASS
Retrieving an Instance
Retrieving part of an Instance
Accessing a Qualifier
These articles will give you a good understanding of WMI concepts.
As far as Windows installer is concerned:
Windows installer is based on Server-Client architecture. The Windows Installer is actually a Windows Service. The various features that Windows installer supports has made it the most standard method of application life-cycle management. The Basic MSI(there is nothing Basic about it) package with the .msi extension is used to package and distribute apps.
The Basic MSI package is basically a DATABASE. The application binaries and other stuff may be packaged as CAB files and included in the MSI package or may exist outside of it.
This is known as TRANSACTIONAL install method. The Application Packaging developer just has to fill in the various tables in the database and the Windows Installer engine takes care of everything else. This may seem or sound easy but is very difficult and needs a lot of knowledge.
When the application is installed on to any sytem, Windows Installer writes all the Registry keys needed for proper management of all resources installed on to the system. As the life-cycle of an application is managed by Windows Installer, it can easily support:
1) Repair
2) Resilience
Once you go through all this, you may have a better idea of all the parties involved in your case. Then you will have clearer questions(or may not!), and we can help you better(or you may not need it at all!).

Install device driver silently on Windows XP

Is there a way to programmatically install device driver silently without cat file and without connecting the device on Windows Xp?
I'm using DriverPackageInstall function from Windows Driver Kit. And I can install driver only if device is attached. In other case I get an error: ERROR_NO_SUCH_DEVINST. But that method works fine with Windows Vista.
Another problem is warning dialog that asks user to continue or stop installation because cat file is missing . It shows on both OSes.
Any ideas?
You're not going to get past the signing prompt, as this is baked pretty far into windows, but there is a tool in the DDK called devinst that works well for device installations.
There's Source Code included with it.
The only way to avoid any UI interaction caused by your driver being unsigned is to hackishly preinstall the driver by modifying the registry directly.
Yes, it can be done. You'd have to modify the ACLs on the HKLM\System\CurrentControlSet\Enum registry key run as SYSTEM (by installing yourself as a service or using Sysinternals psexec -s), and add all the registry keys which Windows device installation would usually add - on your own. This will only work if you can predict precisely what your device's Device Instance ID would be -- e.g. in case of a USB device, the precise port it'd be connected to etc.
This is hacky, but the result would be the device being essentially "preinstalled". It'll be a lot of work, and it'll break on Windows Vista.
Microsoft really wants you to go the WHQL way on Windows XP, sorry :(

When they say OS requires modification, what do they mean in Virtualization?

I'm reading an article about Xen, a virtual machine monitor. They say that an operating system requires some modification in order to be able to act as a guest OS on top of Xen. Now, for an OS like Linux, I can understand what a "modification" might mean but in the case of an OS like say, Windows XP, what does it mean? I mean, XP is closed source proprietary OS right?
It means exactly the same thing. It's just harder because the source is not widely available. Note that the modifications are no longer required when Xen is used in conjunction with hardware virtualization.
Xen was originally a university project. As a researcher (or as a government agency tasked with infrastructure security), you can get the Windows sourcecode from Microsoft. You're just not allowed to distribute your own version of Windows.
This is exactly what they did: they had the sourcecode of Windows XP and then they ported XP to Xen, just to show that if Microsoft were ever to officially support Xen, it would be doable.
On the other hand, although para-virtualization cannot provide an end-to-end virtualization solution, it can improve performance.

Are there any USB stick runnable, no-install, cross platform software frameworks (with GUI)?

Does anyone know of a good software development framework or similar that has the following properties?
Cross platform: it should be runnable on XP, Vista, OSX and common versions of Linux (such as Ubuntu and Kubuntu).
No installation: Be able to run the software from a USB stick without having to copy anything to the host machine.
Have good GUI support (this is why this question doesn't give a suitable answer, as far as I can tell).
Permissive licensing such as LGPL or BSD or such.
Among the softer requirements are having a set of abstractions for the most common backend functionality, such as sockets, file IO, and so on (There is usually some platform specific adaptations necessary), and supporting a good language such as Python or C++, though it is usually fun to learn a new one (i.e. not perl).
I think possible candidates are Qt 4.5 or above (but IFAIK Qt software will not run on Vista without any installation(?)), some wxWidgets or maybe wxPython solution, perhaps gtkmm. The examples I have found have failed on one or another of the requirements. This does not mean that no such examples exist, it just means that I have not found any. So I was wondering if anyone out there know of any existing solutions to this?
Some clarifications;
By "framework" I mean something like Qt or gtkmm or python with a widget package.
This is about being able to run the finished product on multiple platforms, from a stick, without installation, it is not about having a portable development environment.
It is not a boot stick.
It is ok to have to build the software specifically for the different targets, if necessary.
The use case I am seeing is that you have some software that you rely on (such as project planning, administration of information, analysis tools or similar) that:
does not rely on having an internet connection being available.
is run on different host machines where it is not really ok to install anything.
is moved by a user via a physical medium (such as a USB stick).
is run on different operating systems, such as Windows, Vista, Ubuntu, OSX.
works on the same data on these different hosts (the data can be stored on the host or on the stick).
is not really restricted in how big the bundled framework is (unless it is several gigabytes, which is not really realistic).
It is also ok to have parallel installations on the stick as long as the software behaves the same and can work on the same data when run on the different targets.
A different view on the use case would be that I have five newly installed machines with Vista, XP, OSX, Ubuntu and Kubuntu respectively in front of me. I would like to, without having to install anything new on the machines, be able to run the same software from a single USB stick (meeting the above GUI requirements and so on) on each of these five machines (though, if necessary from different bundles on the stick).
Is this possible?
Edit:
I have experimented a little with a Qt app that uses some widgets and a sqlite database. It was easy to get it to work on an ubuntu dist and on osx. For windows xp and vista I had to copy QtCored4.dll, QtGuid4.dll, QtSqld4.dll and mingwm10.dll to distribution directory (this was debug code) and I copied the qsqlited4.dll to a folder named "sqldrivers" in the distribution directory.
You mention wxWidgets but dismiss it as failing at least one of the requirements.
I don't know what your requirements are and in what way wxWidgets wouldn't work for you, but IMO it does fulfill them:
Cross platform: it should be runnable on XP, Vista, OSX and common versions of Linux.
It does run on those platforms, but "common versions of Linux" isn't good enough, as you can never be sure that the necessary GUI libraries for wxGTK (which should not be linked to statically) will be installed. This is however a problem for other solutions as well, unless you plan to put everything onto the stick.
No installation: Be able to run the software from a USB stick without having to copy anything to the host machine.
See the previous point, you would need to specify which libraries are needed on Linux. Also you could specify at build time not to use some of the system-provided libraries (for example for graphics, compression, regexes) but to use the wxWidgets-internal libraries instead.
Have good GUI support
Check.
Permissive licensing such as LGPL or BSD or such.
Check. You can statically link wxWidgets into your application too.
supporting a good language such as Python or C++
Supports both, and there are bindings to other languages as well.
having a set of abstractions for the most common backend functionality, such as sockets, file IO, and so on
It does have some abstractions like that, but you can link to other cross-platform libraries as well.
We use wxWidgets for FlameRobin, a graphical administration program for the Firebird SQL server. It has active ports to Windows, Linux and Mac OS X, and has been compiled for at least some BSD variant and Solaris as well. It definitely runs from a stick on Windows, I haven't tried with Linux or Mac OS X, but I don't see why it shouldn't there too.
Java.
It has GUI support.
It provides your network/file/etc. abstractions.
It is cross-platform. Most platforms you can think of have a JRE available.
No need to install a JRE. Most users probably already have one, and if not, you can run the appropriate JRE right off the stick.
You can provide several startup scripts for various platforms to run the app under the appropriate JRE.
Something else to consider is HTML+Javascript. :D
You can look at Mono it cross platform, has GUI (GTK+, or Winforms 2.0) and I can execute code without installing.
This might not be crossplatform, but is maybe even better, it dont even use the platform : linux on a stick :-)
The subtitle is
Take your Java workspaces wherever you go on a USB key
Here with java and eclipse, but nothing stops you there of course.
http://knol.google.com/k/inderjeet-singh/installing-a-ubuntu-hardy-heron-java/1j9pj7d01g86i/2#
Well, it depends on what you mean by 'package'. Kylix came close to being such a thing. It was QT based, and it allowed you to write once and compile for Windows + Linux. However, it was not an open source solution.
I asked a similar question in this link
http://www.24hsoftware.com/DevelopersForum/CrossPlatform-C-Library.html
and the best asnswer seems to be QT.
I have started using QT, but it is not as easy as I expected mainly due to deployment problems due to the DLL hell, Winsxs hell and manifest hell.
Tclkit is a single-file, self-contained Tcl/Tk system. The mac version I have is about 3.8 megs. You can get a version for just about any modern OS. I carry around a thumb drive that has mac, windows and linux binaries so I can run my scripts on any platform. No install is required, just copy one file wherever you want.
The most recent versions of tcklit use native, themed widgets (though, on *nix there really isn't a single "native" set of widgets...)