Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Internals & Software Drivers | 4-8 Dec 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Comments
>
So if IoT core is to replace CE.... I guess we will meet that challenge when we come to it.
Is using Windows 10 IoT Enterprise LTSC 2021 a solution?
https://learn.microsoft.com/en-us/lifecycle/products/windows-10-iot-enterprise-ltsc-2021
I believe that is the way to go and it works, at least for Windows 10/11 x86/x64 (may not work under Windows 11 on ARM64).
We do that for libusb-win32 kernel driver (libusb0.sys). The .sys driver got signed with attestation signing with a proper inf file with one valid VID/PID. Then the end user (of course with different VID/PID) can use Zadig or libusbK-inf-wizard (both are based on libwdi) to install the driver.
libwdi:
https://github.com/pbatard/libwdi/wiki/FAQ#what-are-these-usbvid_pid_mi_-autogenerated-certificates-that-libwdi-installs-in-the-trusted-certificate-stores
Somehow this mechanism does not work under Windows 11 on ARM64.
https://github.com/pbatard/libwdi/issues/289
Just wondering if you know if this works under Windows 11 on ARM64. Thanks.
Reference discussion: libwdi/Zadig does not work under Windows 11 on ARM64.
https://github.com/pbatard/libwdi/issues/289
Thank you for taking the time to reply, Mr. Lockard.
If that worked, there would be MUCH rejoicing in the driver development world. Consider all the military, medical, and process control drivers in the world where we could use this feature. I might even stop being cranky about the whole driver signing topic, if this were so.
Sadly, I have not seen it work in the past, and using Win11 22H2, I was not able to make this work:
:-(
To make this work, I've always had to enable Test Signing.
I would be very, very, happy to hear that I'm doing something wrong.
Thanks again,
Peter
I see in my snip I covered up the actual install status line. It reads:
!!! dvi: Device not started: Device has problem: 0x34 (CM_PROB_UNSIGNED_DRIVER), problem status: 0xc0000428.
Peter Viscarola
OSR
@OSRDrivers
That looks like the personal context. Is there a machine context as well?
Thank you, Mr. Barila... Rookie mistake, posting the personal context instead of the machine context!
Heres's the machine context (the cert is THERE as well):
Peter Viscarola
OSR
@OSRDrivers
Installing your cert in trusted* was the documented and supported "release signed driver" method. That died when microsoft deprecated cross signed certs. Your driver can still be installed this way if and only if you signed it before the deprecation. Unless something changed in redmond, this path no longer exists. I'd be happy to be wrong.
Okay I will try again.
Okay it does not work with Win 11 22H2
Yes we do process control. The last thing you want with process control is for the drivers to stop working after an update right? Just like a large sign in kiosk mode beside a freeway.
Hence Microsoft developed Windows 10/11 IoT Enterprise LTSC. IoT being the new buzzword for embedded systems connected to the internet (We used to use Windows XP and 7 embedded). LTSC meaning 'Long Term Service Channel' in that any updates will not stop drivers from working.
(Also Windows IoT has cheaper licenses. I also see Windows IoT core is replacing Windows CE so you can expect some SBC devs over here).
So we do drivers for Windows 10 IoT Enterprise LTSC 2019
https://learn.microsoft.com/en-us/windows/iot/iot-enterprise/whats-new/windows-iot-enterprise-ltsc
Which is available until 2029 as version '17763' (1809). This is what I develop with at work for now.
(Windows 10 IoT Enterprise LTSC 2021 is available until 2032!).
Can non-PnP drivers be signed and uploaded to the dashboard for these versions of Windows?
>
As per my experience, as long as the .sys driver is Attestation signed, then you can create the driver package and use this method to install the driver package.
libwdi is using this method (it is just adding the on-the-fly generation of the certificate part).
https://github.com/pbatard/libwdi/wiki/FAQ#user-content-What_are_these_USBVID_PID_MI__Autogenerated_certificates_that_libwdi_installs_in_the_Trusted_certificate_stores
Catches: it does not seem to work under Windows 11 on ARM64.
This is my thought for the OP to sort out the issue.
1) Prepare a driver package. The inf should follow the Windows requirement without the legacy "LogConfig" and "FactDef" directive.
2) Sign the driver package with Attestation. We only need the signed .sys file.
3) Throw away the cat file, and modify the inf file to include the legacy "LogConfig" and "FactDef" directive.
4) Use the method mentioned above to install the driver package.
My view is if a driver can be signed under a Windows 10 IoT Enterprise LTSC version then use that version of Windows for now at least.
Peter, can you show the details of the certificate that you used? In my experience, certificates in the trusted root need to have specific key usage and hierarchy requirements or they are ignored by the system.
@Xiaofan_Chen, your plan works only as long as the INF is not a PnP INF. If the INF file is PnP, then the CAT file is required, and you can't modify the INF.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
So is there a reason that Windows IoT LTSC could not solve this problem?
I don't see what you're getting at. IoT has the same driver loading processes as desktop WIndows.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
I never said it did not have the same loading experience.
Do non-PnP signed Windows drivers get accepted for pre 2022 versions of Windows in the Hardware dashboard?
As I mentioned, you will need to throw away the inf and cat file. Only the signed .sys file is needed. Then you regenerate the inf and cat file. You can try it by using the following utility as part of libusbK project (which uses libwdi).
https://github.com/mcuee/libusbk/tree/master/libusbK/src/dpscat
If it is a PnP INF file, then the CAT file has to be signed. The SYS isn't enough.
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
Yes, the CAT file will be signed by the dpscat utility which is based on libwdi. After that the driver package can be installed using dpinst.
Example run log using dpscat (based on libwdi).
.sys file is from Cypress.
The result driver package works fine under Windows 10 and Windows 11.
Reference:
https://github.com/pbatard/libwdi/issues/191
This is another example to use libusb-win32 device driver (libusb0.sys 1.2.7.3 version using Windows attestation signing) to replace Windows USB Composite Parent driver.
Here I am using Zadig which is part of the libwdi project.
Result of the above installation.
https://github.com/pbatard/libwdi/issues/191#issuecomment-1643545517
BTW, libusbK-inf-wizard can generate driver package on the fly.
The driver installer InstallDriver.exe uses dpscat for the signing and dpinst for the driver installation.
You can see initially there is only .sys and .inf file and there is no .cat file.
After running the driver installer, you can see that .cat file is generated. You can now use dpinst to install the driver package as well.
For those who are interested, dpscat is here. It is not limited to USB driver, it should work for all kind of drivers as long as the .sys is signed properly.
https://github.com/mcuee/libusbk/tree/master/libusbK/src/dpscat (libusbk has dual license, BSD or GPL v3 license, but libwdi is LGPL v3).
It uses the following two key files from libwdi project.
https://github.com/mcuee/libusbk/blob/master/libusbK/src/dpscat/pki.c
https://github.com/mcuee/libusbk/blob/master/libusbK/src/dpscat/mssign32.h
Latest libwdi version of the above two files (LGPL license)
https://github.com/pbatard/libwdi/blob/master/libwdi/pki.c
https://github.com/pbatard/libwdi/blob/master/libwdi/mssign32.h
But, hang on. This is performing the same function as inf2cat, right? It certainly can't apply a Microsoft signature to the CAT file, and without that, it can't satisfy KMCS. Right?
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
I dunno. WHICH key usages do they need, specifically? Cuz the cert I used (as you can see) is just a self-signed cert (created by the WDK automagically for test signing purposes).
This is certainly not the case when you enable Test Signing (which requires you put the cert in the Root Cert Auth store for the machine).
@rob18767
Sure. Fine. But, regardless of IoT, not IoT, Sever, or whatever... You can't Attestation Sign an ISA driver anymore. SO, if one of the drivers for an ISA device needs to be fixed, you are screwed. Full stop. The MSFT decision to do this seems... "unwise" in my most humble opinion.
Though, I admit, my bigger issue is all the folks on the planet that are using devices/systems based on Windows "embedded" (whatever the name of the month is) 7, 8.0, and 8.1. There is currently no way, none at all, to update ANY driver for these systems unless you can pass the full set of Logo Tests. And, I'm guessing that the custom system board, stuffed into the hatch on a drone, for which I wrote a driver for the C3I system, is never going to pass those tests. Actually, I'm not guessing. I'm saying: It's never going to pass those tests. Never. Ever. No way. No how. That's not the fault of the system... which demonstrably works "as designed" -- It's a matter of what the tests require. Which really, truly, have nothing to do with the behaviors we want on an embedded system.
Sorry... you can probably tell this is a sore spot for me. Medical equipment, military equipment, shop floor, process control, industrial vision... the logo tests make no sense for these systems, but that is now the only way you can put a new driver on one of these machines if they're not running Windows 10 or later.
Peter
Peter Viscarola
OSR
@OSRDrivers
I can't speak to Windows 10 IoT or Windows 10 (Enterprise?? or otherwise). I left the Windows Embedded world at Windows 10 IoT. The desktop driver model is just WAY too heavy weight to try to force upon a truly embedded system running an ARM core at 1 GHz with 1GB RAM and having even soft realtime requirements.
Greg
On Thu, 20 Jul 2023 20:05:53 +0000 (UTC), "Peter_Viscarola_(OSR)" wrote:
OSR https://community.osr.com/
Peter_Viscarola_(OSR) commented on Driver Development- Found Legacy Operation "LogConfig" and "FactDef"
> certificates in the trusted root need to have specific key usage and hierarchy requirements or they are ignored by the system.
I dunno. WHICH key usages do they need, specifically? Cuz the cert I used (as you can see) is just a self-signed cert (created by the WDK automagically for test signing purposes).
This is certainly not the case when you enable Test Signing (which requires you put the cert in the Root Cert Auth store for the machine).
@rob18767
> Which is available until 2029 as version '17763' (1809). This is what I develop with at work for now.
Sure. Fine. But, regardless of IoT, not IoT, Sever, or whatever... You can't Attestation Sign an ISA driver anymore. SO, if one of the drivers for an ISA device needs to be fixed, you are screwed. Full stop. The MSFT decision to do this seems... "unwise" in my most humble opinion.
Though, I admit, my bigger issue is all the folks on the planet that are using devices/systems based on Windows "embedded" (whatever the name of the month is) 7, 8.0, and 8.1. There is currently no way, none at all, to update ANY driver for these systems unless you can pass the full set of Logo Tests. And, I'm guessing that the custom system board, stuffed into the hatch on a drone, for which I wrote a driver for the C3I system, is never going to pass those tests. Actually, I'm not guessing. I'm saying: It's never going to pass those tests. Never. Ever. No wya. No how. That's not the fault of the system... which demonstrably works "as designed" -- It's a matter of what the tests require. Which really, truly, have nothing to do with the behaviors we want on an embedded system.
Sorry... you can probably tell this is a sore spot for me. Medical equipment, military equipment, shop floor, process control, industrial vision... the logo tests make no sense for these systems, but that is now the only way you can put a new driver on one of these machines if they're not running Windows 10 or later.
Peter
Yeah I had a think about this. If the dashboard refuses to sign an ISA driver, even when select 1809 x64 Client to sign for self attestation, then you cannot sign you driver no matter what (as you said).
Microsoft states the long term service channel on the version we use is available until 2029 for IoT developers. To suddenly not be able to sign a driver for whatever reason would be, at the very least, infuriating.
Windows said they were going to replace Windows CE with Windows IoT core.
We developed a CE product from the open source hardware Beaglebone board. Apparently we cannot use this hardware with Windows 10 IoT core because the interrupt structure on the CPU was TI's own as opposed to ARM.
We have CE platform builders for CE 7.0 and Embedded Compact 2013. It would be ridiculous to have to sign drivers for CE. We can keep going for a bit longer yet. \
And please, Microsoft, for my sanity's sake do not force me down the Linux route again.
I do not know the technical details but libwdi/Zadig/libusbK-inf-wizard has been working for quite some time, including Windows XP/Vista/7/8.1/10/11.
There were reports that the method does not work for certain insider version of Windows 10/11. It is also found that the method does not work for Windows 11 on ARM64.
It does have a major pre-requsite that the .sys driver needs to have valid signature.
This.
Peter Viscarola
OSR
@OSRDrivers