Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 on ARM64 support #155

Closed
gbaman opened this issue Mar 24, 2019 · 90 comments
Closed

Windows 10 on ARM64 support #155

gbaman opened this issue Mar 24, 2019 · 90 comments
Assignees

Comments

@gbaman
Copy link

gbaman commented Mar 24, 2019

I am well aware this is probably pushing it, but I have an ARM64 based Windows 10 Pro machine sitting in front of me currently and am attempting to get it working with an RTL-SDR.

Zadig runs fine and doesn't seem to have any issues, unfortunately though when I select the usual "Bulk-In, Interface (Interface 0)" and hit Install Driver for "WinUSB", I get a "The driver installation failed" error.
I have attached the log.

I have no idea if the drivers etc will work on this machine, will admit I am no major expert in Windows 10 Pro on ARM64 (simply a machine that has been handed to me for this project), but am intrigued if it would be possible to make it work.
Finally, the machine itself is an HP Envy x2.

Zadig 2.3.701
Windows 10 32 bit (Build 17134)
ini file 'zadig.ini' not found - default parameters will be used
default driver set to 'WinUSB'
2 devices found.
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_00
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (0): USB\VID_0BDA&PID_2838&MI_00\6&38A180A5&0&0000
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 0)'
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_01
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (2): USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 1)'
Checking for Zadig updates...

Checking release channel...

Using inf name: Bulk-In_Interface_(Interface_0).inf
Successfully extracted driver files.
Installing driver. Please wait...
Updates: Unable to acces version data

libwdi:info [extract_binaries] successfully extracted driver files to C:\Users\HAB\usb_driver
libwdi:info [wdi_prepare_driver] successfully created 'C:\Users\HAB\usb_driver\Bulk-In_Interface_(Interface_0).inf'
libwdi:info [wdi_prepare_driver] Creating and self-signing a .cat file...
libwdi:debug [AddFileHash] 'wdfcoinstaller01011.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\HAB\usb_driver\amd64\wdfcoinstaller01011.dll'
libwdi:debug [AddFileHash] 'winusbcoinstaller2.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\HAB\usb_driver\amd64\winusbcoinstaller2.dll'
libwdi:debug [AddFileHash] 'bulk-in_interface_(interface_0).inf': INF type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\HAB\usb_driver\bulk-in_interface_(interface_0).inf'
libwdi:debug [AddFileHash] 'wdfcoinstaller01011.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\HAB\usb_driver\x86\wdfcoinstaller01011.dll'
libwdi:debug [AddFileHash] 'winusbcoinstaller2.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\HAB\usb_driver\x86\winusbcoinstaller2.dll'
libwdi:info [CreateCat] successfully created file 'C:\Users\HAB\usb_driver\Bulk-In_Interface_(Interface_0).cat'
libwdi:info [RemoveCertFromStore] deleted existing certificate 'CN=USB\VID_0BDA&PID_2838&MI_00 (libwdi autogenerated)' from 'Root' store
libwdi:info [RemoveCertFromStore] deleted existing certificate 'CN=USB\VID_0BDA&PID_2838&MI_00 (libwdi autogenerated)' from 'TrustedPublisher' store
libwdi:debug [CreateSelfSignedCert] set Enhanced Key Usage, URL and CPS
libwdi:debug [CreateSelfSignedCert] created new key container
libwdi:debug [CreateSelfSignedCert] generated new keypair
libwdi:info [CreateSelfSignedCert] created new self-signed certificate 'CN=USB\VID_0BDA&PID_2838&MI_00 (libwdi autogenerated)'
libwdi:debug [SelfSignFile] successfully created certificate 'CN=USB\VID_0BDA&PID_2838&MI_00 (libwdi autogenerated)'
libwdi:info [SelfSignFile] added certificate 'CN=USB\VID_0BDA&PID_2838&MI_00 (libwdi autogenerated)' to 'Root' and 'TrustedPublisher' stores
libwdi:info [SelfSignFile] successfully signed file 'C:\Users\HAB\usb_driver\Bulk-In_Interface_(Interface_0).cat'
libwdi:info [SelfSignFile] successfully deleted private key
libwdi:debug [wdi_install_driver] using progress bar mode
libwdi:debug [installer process] got parameter Bulk-In_Interface_(Interface_0).inf
libwdi:debug [process_message] got request for device_id
libwdi:debug [installer process] got device_id: 'USB\VID_0BDA&PID_2838&MI_00\6&38A180A5&0&0000'
libwdi:debug [process_message] got request for hardware_id
libwdi:debug [installer process] got hardware_id: 'USB\VID_0BDA&PID_2838&REV_0100&MI_00'
libwdi:debug [installer process] got user_sid: 'S-1-5-21-4036245373-3405510498-1736261573-1003'
libwdi:debug [installer process] using syslog 'C:\WINDOWS\inf\setupapi.dev.log'
libwdi:debug [installer process] syslog reader thread started
libwdi:debug [installer process] successfully disabled the system restore point creation setting
libwdi:debug [process_message] switching timeout to infinite
libwdi:debug [installer process] Installing driver for USB\VID_0BDA&PID_2838&REV_0100&MI_00 - please wait...
libwdi:debug [process_message] switching timeout back to finite
libwdi:debug [installer process] attempted to use a 32 bit installer on a 64 bit machine
libwdi:debug [process_message] installer process completed
Driver Installation: FAILED (Attempted to use a 32 bit installer on a 64 bit machine)
2 devices found.
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_00
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (0): USB\VID_0BDA&PID_2838&MI_00\6&38A180A5&0&0000
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 0)'
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_01
libwdi:debug [wdi_create_list] Compatible ID: USB\Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (2): USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 1)'
@pbatard
Copy link
Owner

pbatard commented Mar 24, 2019

Zadig runs fine

Wait, are you running the x86 version of Zadig that is published at https://zadig.akeo.ie?
That will not work, first of all because it will run on ARM64 in x86 emulation mode (which I doubt Microsoft allows installing ARM64 drivers from) and second, because there are no ARM64 embedded in Zadig in the first place, so even if it "worked", it wouldn't be able to find the files it requires for ARM64.

Also:

Windows 10 32 bit (Build 17134)
(...)
Driver Installation: FAILED (Attempted to use a 32 bit installer on a 64 bit machine)

Zadig detects a 32-bit x86 emulation (likely because that's what Microsoft used by default) and therefore tries to run the 32-bit installer, which of course the system doesn't like.

For Zadig to work on ARM64, I'd have to recompile an ARM64 version and edit the embedded files to include ARM64 files.

I may do that eventually, but I'm afraid I'm too busy with other stuff to look into that in the short term (short term meaning 0-6 months).

Now, if somebody else wants to take a stab at it and send a patch I can review, that's a different story...

@pbatard pbatard self-assigned this Mar 24, 2019
@gbaman
Copy link
Author

gbaman commented Mar 24, 2019

Haha yeah, I was installing a batch of random laptops with SDR# for use in a school next week (for use with High Altitude Ballooning STEM project) and hadn't even crossed my mind that this one was different till I hit the error (guess is what I get for doing it this time of the night), then started digging around.

What you are saying does make sense, it does only emulate x86 based apps and not x86_64 based apps full stop.
If you have somewhere rough you could point me to on where to start, I don't mind taking a glance at recompiling it. No guarantees though... :)

@pbatard
Copy link
Owner

pbatard commented Mar 25, 2019

If you have somewhere rough you could point me to on where to start

Oh boy...

  • Well, first you'll have to find if and where MS provides ARM64 versions of their CoInstaller DLLs.
  • Once you have that, you'll need to edit this mess to handle ARM64 (and while you're at it you may also want to add ARM).
  • You'll also want to edit this and this to add ARM64 support.
  • Then you'll need to edit the MS project files so lbwdi/Zadig can be compiled for ARM64 (and while you're at it you may also want to add ARM - btw this might help you.
  • There's also some more stuff that will be needed, such as updating the check for update in Zadig so that the ARM64 version doesn't try to download the x86 version, or reporting the arch on startup, but I've already done that in Rufus, so you don't really have to do it as I should be able to reuse that code.
  • Last but not least you will need to test, test and test again to make sure that your changes work on ARM64 machines! Adding the code is 20% of the work. Testing is 80%!

@vielmetti
Copy link

Thanks for writing this up - I am also trying to get Zadig running on Windows 10 on ARM64 to support a Lenovo Yoga C620 using an Adafruit USB-to-serial cable so I can talk to a Jetson Nano.

Thanks for the detailed situation report here, I'll hope to get some help to look at this.

@jkunkee
Copy link

jkunkee commented Oct 13, 2019

WOW64 programs - so x86 on x64 as well as on ARM64 - can't install drivers. The API exists but just returns an error.

The ARM64 SDK is supposed to be fully featured, so if you can't find the DLLs you need, let me know the SDK piece you'd expect them to be in and the path you expect the file to be at and I can talk to a friend.

libusb v1 recompiles for ARM64 by just retargeting the VS projects for Windows 10. (VS2019 has some simplifications for this.)

ARM64 should be pretty straightforward to add as a configuration under VS 2017 or VS 2019--I recommend 2019.

You may find IsWow64Process2 handy for probing architectures, but to run on Windows 7 you'll have to use GetProcAddress to see if it's available.

ARM32 support is likely not going to be useful unless you port to IoT Edition, but VS does make it easy.

I just got an RTL-SDR and would be happy to test things on my Windows 10 on ARM systems, especially if there's a decent way to make sure things are uninstalled. (Just the 'delete drivers, yes' workflow in Device Manager, I expect.)

(Hi @vielmetti ! If you to get some time to look at this, hit me up--I'd be happy to at least kibbitz. I think these machines have great potential for mobile maker scenarios.)

(Yes, I work for Microsoft. I even work on Windows 10 on ARM(64) and have ported OSS projects as part of my day job, but I am here as a hobbyist, user, and fan and not as an employee or representative of my employer.)

@pbatard
Copy link
Owner

pbatard commented Oct 13, 2019

Hi Jon,

First of all, whether in an official position or not, it's nice to know that there are some people from Microsoft looking at independent projects that relate to the installation of Windows drivers. And I'm actually glad you decided to chime in and offer to see if you can use your connections, because you may actually be able to help with the biggest roadblock I have at the moment (besides time to work on this feature) which is best illustrated by the picture below:

Image1

Namely: if you install the latest Windows 10 WDK, you still don't get any of the WDF and WinUSB coinstaller DLLs for arm64 (Still no arm64 directory). And what's more, even for ARM, there's no winusbcoinstaller2.dll provided, which means we can't support that platform either.

At the very least, libwdi requires the following 2 DLLs to be provided able to support an architecture:

  • WdfCoInstaller01011.dll
  • winusbcoinstaller2.dll

So, if possible, can you find out with your colleagues what the story is with regards to finally providing these files for ARM/ARM64 in the WDK, just like they are provided for x86 and x64?

With regards to your other points, I agree that VS2019 has made things easier for ARM64, and I'm planning to retarget libwdi for VS2019 when I get a chance (Since I'm already using VS2019 internally). My only issue here is that, whereas AppVeyor added the VS2019 target not that long ago (but still not in an official mode), they don't have MinGW support working on that target. So if I switch from VS2017 to VS2019, my MinGW libwdi builds will break, and I'd rather not have to go through what I had to do for Rufus, which is to use a mix of 2017 and 2019 (and still end up with a Coverity that doesn't work — C'mon AppVeyor, update your platforms already!!).

Apart from that, I agree that adding ARM64 support shouldn't be that difficult (as usual, it's going to be the ability to allocate time to complete that task that'll be a challenge). I'll keep in mind your recommendation to use IsWow64Process2(), as this seems more useful than IsWow64Process() indeed.

@jkunkee
Copy link

jkunkee commented Oct 14, 2019

That's what my system shows too; I'll see what I can do.

@jkunkee
Copy link

jkunkee commented Oct 14, 2019

Ah, that would do it. I got a quick answer: the CoInstallers are not needed on Windows 10 on ARM because the first version to ship was 1709. You can drop the references to them for ARM64. (I'm afraid I'm currently rather behind on what the coinstallers do, so I'm probably not much more help there. :/

@pbatard
Copy link
Owner

pbatard commented Oct 14, 2019

Thanks for the info.

This is actually going to make things slightly more complex for ARM/ARM64, coz we'll need to conditionally sort out a [USB_Install.CoInstallers] section from the winusb.inf template... I'm hoping we can filter these things out with [USB_Install.CoInstallers.x86] and [USB_Install.CoInstallers.amd64] but this will require some testing. And of course I'll need to add conditional logic on whether to search for the coinstallers or not depending on the platform.

No idea when I'll have a chance to look into that, but most likely it won't be before a couple of months... I do appreciate the help however, as it solves one of the main question I had about how we might be able to proceed for ARM/ARM64.

@vielmetti
Copy link

This writeup from @jkunkee gives a good state-of-the-art report, if you find this issue you'll be interested in https://daskunkee.blogspot.com/2020/02/tech-esp32-programming-from-arm64.html

@sidd-kishan
Copy link

Please pursue it we at Windows on Rasberry Pi community will be glad to extend support in testing your drivers and tools for ARM64. We have successfully booted WOA on Rasberry Pi 4 B+ and hence have Cheap ARM64 Windows On ARM device with sort of current hardware but way cheaper than a surface pro device.

@pbatard
Copy link
Owner

pbatard commented Jun 6, 2021

Yes, I am well aware of it. I am one of the many people who helped develop the UEFI firmware needed to run Windows on the Raspberry Pi and I also helped figure out a way to run Windows off the Pi 4 USB 3.0 ports while using more than 1 GB RAM. And the reason I was involved in this effort was precisely so that I could have access to a cheap platform to test ARM64 versions of Rufus or libwdi.

However, the downside of all this is that I find myself having to allocate time to maintain the Raspberry Pi firmware... which, outside of other prioritization matters (I'm afraid that libwdi will never be that high a priority for me) actually takes time away from tasks such as adding Windows 10 ARM64 support for libwdi...

@jkunkee
Copy link

jkunkee commented Jun 9, 2021

One day, there will be a low-cost, supported options for developers--I get to work on one--but for now the Snapdragon Development Kit is slated to be released this summer. It won't be on a patch with the indomitable, inexpensive, and community-maintained Raspberry Pi, but Qualcomm will provide and maintain the BSP and is intended to be much less than $1000.

@dougmsbbs
Copy link

I'd like to chime in here to say please pursue this. Getting a RTL up and running on a Pi 4 running Windows 10 ARM64 would be a real boost to a lot of people. I have two projects stalled just for lack of a driver I can install for RTL-SDR's. I'd be happy to help do any testing needed when it gets that far.

Or is there some other way to get an RTL driver loaded, maybe through pnputil?

@mcuee
Copy link
Contributor

mcuee commented Jul 6, 2021

How many people really care about Windows on ARM? I am an ARM fan. My main computer is the Mac Mini M1 (based on ARM64). My main Linux machine is the Raspberry Pi 400 (along with some other ARM boards). But I do not really care for Windows on ARM. My work and home Windows laptops are running on Intel CPU (AMD CPU is also okay).

Ref: libusb does support ARM32/ARM64 on Windows with VS, but not MinGW.
libusb/libusb#921

@pbatard
Copy link
Owner

pbatard commented Jul 6, 2021

Hi Xiaofan,

I think more people care about Windows on ARM than you give them credit for. Having worked on the effort to make Windows run on the Pi 4, I can tell you that there is genuine interest for an cheap yet powerful enough ARM64 platform that can run modern Windows, as buying into the intel/AMD framework can still be prohibitive for a lot of people for varied reasons.

And the thing is, Microsoft is perfectly placed to compete with Apple on ARM at a junction where apple will never ever go: cheap platforms.

In other words, if Microsoft embraced cheap ARM64 platforms like the Pi 4 (which we know can run Windows 10, or even 11, with "good enough" performance for every day tasks like web surfing, e-mail, document editing and so on), they would probably find a vast sway of users to follow them there, that aren't going to find their match with other options, and especially not Apple MX or Linux on ARM. And that's because the existing Windows ecosystem, with a market dominance that means that if you're looking for an application chances are that you're always going to find at least a Windows version of it, is way too attractive to pass when given the opportunity. Which eventually means that, for a lot of users with limited budget, the choice is between secondhand intel/AMD platforms that run Windows, but that come with the drawbacks of being secondhand, or modern ARM64 platforms that may actually turn out to cheaper than secondhand intel/AMD ones, and run Windows.

So, provided that Microsoft are able to read the writing on the wall (which, judging from what's happening with the Pi 4 Windows effort, they sadly don't appear to be able to do. But then again, it wouldn't be Microsoft if they were able to make decisions that actually benefit Windows users in the long run...), you should find that quite a lot of people will eventually care about Windows on ARM, and, even if Microsoft really does make the beginnings of that platform a lot less inviting that it has any rights to be (because, right now, one really has to wonder if Microsoft isn't effectively trying to kill Windows on ARM before it can gain any traction, on account of their complete disregard for all the aspects that effectively contributed to make Windows the dominant OS on x86, such as not getting into some kind of lock in with a specific vendor when it comes to platform development), I am considering that there is more than enough demand to warrant an ARM64 version of Zadig/libwdi.

Thus, I am still committed to produce such a version. But, for the foreseeable future, I still have quite a few things that take precedence over that (and the planned release of Windows 11 just added a new major one to that list) so, once again, it'll still have to be quite a few months away...

@mcuee
Copy link
Contributor

mcuee commented Jul 6, 2021

Thanks for the detailed explanation.

Yes it will be good if there are really cheap cheap yet powerful enough ARM64 platform that can run modern Windows. Apparently Raspberry Pi 4 is not yet powerful enough in that aspect. Qualcomm stuff is expensive. And they do not have enough native ARM apps (UWP is very much locked) so that they have to rely on x86/x64 emulation -- that will mean powerful ARM based solution from Qualcomm or similar -- not cheap stuff like Raspberry Pi. So I do not see that happen any time soon.

Windows on ARM is pretty much locked, I believe it will be more so in the future with Windows 11.

Personally I run Linux on Raspberry Pi 400 and it is really pretty smooth (forget Youtube 1080p for a moment). And you have enough apps. Then Apple has done a great job for Apple Silicon Macs that they run both native ARM apps and x64 apps very well. I use homebrew and within a few month the ARM64 forumlas are mostly working for me already. The main missing thing is Virtual Box but I have alternatives like UTM to run ARM Linux if I want (I do not need now because of Raspberry Pi 400).

Anyway, it is just my personal opinion. Sorry for the rant here. And it is great that you are planning to support ARM on Windows with libwdi.

@dougmsbbs
Copy link

There are A LOT of people out here that care about Windows on ARM. They're just getting discouraged that Microsoft got us this far, and then just seemed to lose interest in finishing it.

For a lot of people it's a matter of older software that there is no replacement for. I'm in that boat myself. But guess what, the old XP stuff works pretty darn well on a Pi 4 and Windows 10. You just need to give it the memory to run right, so get the 8GB version, and don't skimp on the SD card size . Booting Linux for the RTL stuff, then an emulator on top of that for the Windows program is not a good solution, but it's what a lot of people are trying to get by.

I have no doubt that as soon as an RTL-SDR driver that works on Windows 10 ARM64 on a Raspberry Pi 4 becomes available it'll have thousands of downloads in very short order. Maybe Microsoft is just used to thinking in terms of millions of new downloads a week, while I think in the thousand's, but still...

@mcuee
Copy link
Contributor

mcuee commented Jul 7, 2021

Good to know that there are "There are A LOT of people out here that care about Windows on ARM". To me it seems the main interests are on Raspberry Pi 4 which somehow gets a license to run Windows on ARM. Raspberry Pi is an exception for Windows on ARM, not the norm.

If you read Microsoft document, it is all talking about Qualcomm stuff, which is more expensive than many Intel/AMD laptops.
https://docs.microsoft.com/en-us/windows/uwp/porting/apps-on-arm

Anyway, Pete is committed to support libwdi on ARM and that is good.

For the projects I am involved, at least libusb already supports Windows on ARM. As for libusb-win32, no further development on the project. As for libusbK, I am not so sure if it is worth porting to Windows on ARM or not. Thanks for the changes of Microsoft on Driver signing, we are not going to update libusbk.sys any time soon but we will focus on the support of libusbk.dll which supports WinUSB.

@mcuee
Copy link
Contributor

mcuee commented Jul 7, 2021

@jkunkee you wrote the following

I believe Zadig relies on libusb's binary releases, so this needs to change upstream before Zadig Just Works(TM).
in Re: https://daskunkee.blogspot.com/2020/02/tech-esp32-programming-from-arm64.html

I do not think this is a real issue for Pete, remember Pete is the original developer of libusb Windows, so he knows the ins and outs of libusb Windows. So there will be no issue for him to host the ARM binary for libusb Windows.

Most importantly libwdi/Zadig do not depend on libusb Windows binaries at all (it does not ship with libusb-1.0.dll). You may want to change your blog.

@sidd-kishan
Copy link

sidd-kishan commented Jul 8, 2021

lib usb arm64 dll build made by rusb, great effort is the arm64 version of the lib usb dll

a1ien/rusb#68

@mcuee
Copy link
Contributor

mcuee commented Jul 8, 2021

Based on a1ien/rusb#68, vcpkg has already libusb-1.0 Windows ARM binary if you do not want to build the binary by yourself (it is super easy to build libusb-1.0.dll for Windows ARM with VS2019). However, the issue here has nothing to do with that, as libwdi does not depend on libusb-1.0.dll binary at all.

@mcuee
Copy link
Contributor

mcuee commented Sep 13, 2021

I checked out some Youtube video, now it seems to be much easier to install Windows 10 or Windows 11 onto Raspberry Pi 4 and 400. So I kind of change a bit of my mind in this topic.

As for myself, I will not touch Windows on my Raspberry Pi 400 any time soon (Linux is good) and I have no intention to get an 8GB Raspberry Pi 4B. Maybe I will touch Windows 11 on next generation Raspberry Pi 5.

@mcuee
Copy link
Contributor

mcuee commented Sep 13, 2021

Namely: if you install the latest Windows 10 WDK, you still don't get any of the WDF and WinUSB coinstaller DLLs for arm64 (Still no arm64 directory). And what's more, even for ARM, there's no winusbcoinstaller2.dll provided, which means we can't support that platform either.

This is still true with Windows 11 WDK. I just installed Windows 11 WDK.
https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk

@mcuee
Copy link
Contributor

mcuee commented Sep 13, 2021

I believe the way for WinUSB on ARM64 is probably different from ARM32/x86/AMD64, as per the following test and other WinUSB related tests (total 10 WinUSB related tests).
Ref: https://docs.microsoft.com/en-us/windows-hardware/test/hlk/testref/e1c0c2dd-cd25-4f60-a4bc-c8544d481225

On the other hand, ARM32 is mostly dead. ARM64 is probably the future for Windows on ARM.
https://community.osr.com/discussion/293059/32-bit-arm-driver-signing-a-forgotten-niche

@pbatard
Copy link
Owner

pbatard commented Sep 13, 2021

As Jon mentioned:

the CoInstallers are not needed on Windows 10 on ARM because the first version to ship was 1709. You can drop the references to them for ARM64.

So the way to approach WinUSB on ARM64 should be to use a .inf that's similar to the one that was posted in this thread, updated for ARM64.

Unfortunately, it's because the .inf for ARM64 is going to be much simpler than the .inf for x64 and win32 that it makes things more complex to automate, because the .inf.in we use for WinUSB is tailored for systems where CoInstallers are needed, which means I'm going to have to add a different path and a different .inf.in for ARM64 installation.

However, this whole thing may be rendered completely moot by Windows 11, since Microsoft is no longer trusting certificates that are installed in Trusted Publishers for the signing of driver packages, and that is what we have been relying on to be able to install drivers on Windows 7 up to Windows 10 without having to ask users to enable test signing.

Which means that Zadig cannot be used on regular Windows 11 to install WinUSB (fails with Driver package failed signature validation. Error = 0x800B0100), and since it looks like the new way to get a custom driver package allowed for installation on a regular Windows 11 system is to go through a Microsoft web portal, this may very well spell the end of Zadig/libwdi altogether.

As such, unless there's a way to make libwdi/Zadig relevant for Window 11, I'm not sure spending time adding ARM64 support is that great of an investment...

@mcuee
Copy link
Contributor

mcuee commented Sep 14, 2021

However, this whole thing may be rendered completely moot by Windows 11, since Microsoft is no longer trusting certificates that are installed in Trusted Publishers for the signing of driver packages, and that is what we have been relying on to be able to install drivers on Windows 7 up to Windows 10 without having to ask users to enable test signing.

Which means that Zadig cannot be used on regular Windows 11 to install WinUSB (fails with Driver package failed signature validation. Error = 0x800B0100), and since it looks like the new way to get a custom driver package allowed for installation on a regular Windows 11 system is to go through a Microsoft web portal, this may very well spell the end of Zadig/libwdi altogether.

Hmm, where do you get this info that "Microsoft is no longer trusting certificates that are installed in Trusted Publishers for the signing of driver packages"?

For Windows 10, Microsoft also says that Attestation Signing (you need an EV certificate to create an account to sign in the Microsoft Partner Center Developer Dashboard and then get the signed driver package) or HLK (aka WHQL) is needed but in reality Zadig just works.

@pbatard
Copy link
Owner

pbatard commented Feb 26, 2023

I believe I now have a version of the library that can take care of ARM64 driver installation.

Note that, since I'm not planning to build native ARM64 versions of the library or the examples at this stage (mostly because I don't want to multiply the versions of Zadig people need to download), this requires x86 or x64 emulation on the ARM64 platform, which shouldn't be an issue if using Windows 10 or Windows 11. Oh, and for the underlying platform detection to work, you must use Windows 10 1511 or later. Earlier platforms are not supported. And only the MSVC build can support ARM64, since MinGW is unable to compile the required ARM64 installer binary.

I have tested WinUSB driver installation through the x86 build of Zadig on a Raspberry Pi 4 platform running Windows 11 21H2, and was able to both get the WinUSB driver successfully installed for an XBox Controller, and confirmed that it behaved as expected by invoking libusb's xusb -x.

Obviously, I could use some more testing, so if you want to download the latest VS2022 artifact from GitHub Actions you should be able to extract and run Win32\Release\examples\zadig.exe to confirm that it also works for you.

pbatard added a commit that referenced this issue Feb 26, 2023
* Requires x86 emulation on the ARM64 platform since we are not compiling
  native libraries or examples (only the internal installer is native).
* Only WinUSB and USBSer drivers are supported.
* Addresses #155.
@pbatard pbatard removed the deferred label Feb 26, 2023
@sidd-kishan
Copy link

To avoid the above, an alternative to Zadig is to use dpscat utility from libusbK project which can be used to sign any driver package. But I have not checked how easy to build dpscat under Windows on ARM64. https://github.com/mcuee/libusbk/tree/master/libusbK/src/dpscat

@ArminiusTux Here is the libusbK binary for Windows on ARM64 (built using VS2019), including dpscat. Please give it a try. Thanks. libusbK_bin_arm64.zip

You can follow the following procedure to use dpscat to sign the driver package. dpscat is based on libwdi.

It does not have the libusbK.sys for Arm64 windows, If possible can the same be provided aswell?

@mcuee
Copy link
Contributor

mcuee commented Feb 27, 2023

It does not have the libusbK.sys for Arm64 windows, If possible can the same be provided aswell?

No, there will be no libusbK.sys for ARM/ARM64. Rather the focus is to support WinUSB.

Please help to try out the libusbK Windows ARM64 test binary mentioned above to see if that works or not. Thanks.
https://github.com/mcuee/libusbk/files/10680835/libusbK_bin_arm64.zip

@pbatard
Copy link
Owner

pbatard commented Mar 1, 2023

With the release of libwdi 1.5.0 and Zadig 2.8, both of which should support ARM64 driver installation, I'm going to consider this issue closed.

@pbatard pbatard closed this as completed Mar 1, 2023
@mcuee
Copy link
Contributor

mcuee commented Apr 26, 2023

As per #288, Virtual Machine using Parallel under macOS Apple Silicon (ARM64) does not seem to work. The workaround of using test signing is probably not a good way to go. Let's see if there are other reports as well to see if Zadig 2.8 works well for Windows on ARM64 or not.

@mcuee
Copy link
Contributor

mcuee commented Apr 26, 2023

There is another report that Zadig does not work on Windows on ARM64 here.

@CartBlanche
Please help to post the details on your Windows on ARM64. And please post the debug log as well. Thanks.

@mcuee
Copy link
Contributor

mcuee commented Apr 26, 2023

@ArminiusTux

Have you tried to use Zadig 2.8 on your Windows on ARM64 machine? Does it work? Thanks.

@CartBlanche
Copy link

I'm using Zadig - Version 2.8 (Build 782)

My device details are:
Processor Apple Silicon 3.20 GHz (4 processors)
Installed RAM 6.00 GB
Device ID 50ED38DF-6610-4C35-BA95-5A510C2A71EB
Product ID 00330-80000-00000-AA637
System type 64-bit operating system, ARM-based processor
Pen and touch Pen support

Edition Windows 11 Pro
Version 21H2
Installed on ‎11/‎08/‎2022
OS build 22000.1880
Experience Windows Feature Experience Pack 1000.22001.1000.0

@mcuee I see that Zadig has an option for logging (currently set to Debug), but where are the logs kept?

@mcuee
Copy link
Contributor

mcuee commented Apr 26, 2023

I'm using Zadig - Version 2.8 (Build 782)

My device details are: Processor Apple Silicon 3.20 GHz (4 processors) Installed RAM 6.00 GB Device ID 50ED38DF-6610-4C35-BA95-5A510C2A71EB Product ID 00330-80000-00000-AA637 System type 64-bit operating system, ARM-based processor Pen and touch Pen support

Edition Windows 11 Pro Version 21H2 Installed on ‎11/‎08/‎2022 OS build 22000.1880 Experience Windows Feature Experience Pack 1000.22001.1000.0

@mcuee I see that Zadig has an option for logging (currently set to Debug), but where are the logs kept?

Ah, yours is another virtual installation like #288 and it seems currently Zadig does not support virtual installation. Are you using Parallel Desktop 18 for Mac?

If you have set up the log verbosity option to Debug, then the debug log will appear in the textbox once you run the driver installation.

Please post the full debug log here, you should get something similar to the following.

@ArminiusTux
Copy link

@ArminiusTux

Have you tried to use Zadig 2.8 on your Windows on ARM64 machine? Does it work? Thanks.

Nope it does not, tested it on WinARM v10 & v11. 😕

@mcuee
Copy link
Contributor

mcuee commented May 2, 2023

@ArminiusTux
Have you tried to use Zadig 2.8 on your Windows on ARM64 machine? Does it work? Thanks.

Nope it does not, tested it on WinARM v10 & v11. 😕

Thanks for the confirmation. What is the HW you are testing with?

@mateuszdrab
Copy link

Hello all

Just wanted to second that the version 2.8 does not install the drivers on my Windows DevKit 2023 - log provided below.

Zadig 2.8.782
Windows 11 Enterprise, 64-bit (Build 22621.1555)
ini file 'zadig.ini' not found in 'C:\Users\mateuszd\OneDrive - Extreme\Downloads' - default parameters will be used
default driver set to 'WinUSB'
2 devices found.
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_00
libwdi:debug [wdi_create_list] Compatible ID: USB\COMPAT_VID_0bda&Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (7): USB\VID_0BDA&PID_2838&MI_00\6&38A180A5&0&0000
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 0)'
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_01
libwdi:debug [wdi_create_list] Compatible ID: USB\COMPAT_VID_0bda&Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (19): USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 1)'
Using inf name: Bulk-In_Interface_(Interface_1).inf
Successfully extracted driver files.
Installing driver. Please wait...
libwdi:info [extract_binaries] Successfully extracted driver files to 'C:\Users\mateuszd\usb_driver'
libwdi:info [wdi_prepare_driver] Successfully created 'C:\Users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).inf'
libwdi:info [wdi_prepare_driver] Creating and self-signing a .cat file...
libwdi:info [wdi_prepare_driver] Test signing is: Disabled
libwdi:debug [AddFileHash] 'wdfcoinstaller01011.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\mateuszd\usb_driver\amd64\wdfcoinstaller01011.dll'
libwdi:debug [AddFileHash] 'winusbcoinstaller2.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\mateuszd\usb_driver\amd64\winusbcoinstaller2.dll'
libwdi:debug [AddFileHash] 'bulk-in_interface_(interface_1).inf': INF type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf'
libwdi:debug [AddFileHash] 'wdfcoinstaller01011.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\mateuszd\usb_driver\x86\wdfcoinstaller01011.dll'
libwdi:debug [AddFileHash] 'winusbcoinstaller2.dll': PE type
libwdi:info [ScanDirAndHash] added hash for 'C:\Users\mateuszd\usb_driver\x86\winusbcoinstaller2.dll'
libwdi:info [CreateCat] Successfully created file 'C:\Users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).cat'
libwdi:debug [CreateSelfSignedCert] Set Enhanced Key Usage, URL and CPS
libwdi:debug [CreateSelfSignedCert] Created new key container
libwdi:debug [CreateSelfSignedCert] Generated new keypair...
libwdi:info [CreateSelfSignedCert] Created new self-signed certificate 'CN=USB\VID_0BDA&PID_2838&MI_01 (libwdi autogenerated)'
libwdi:debug [SelfSignFile] Successfully created certificate 'CN=USB\VID_0BDA&PID_2838&MI_01 (libwdi autogenerated)'
libwdi:info [SelfSignFile] Added certificate 'CN=USB\VID_0BDA&PID_2838&MI_01 (libwdi autogenerated)' to 'Root' and 'TrustedPublisher' stores
libwdi:info [SelfSignFile] Successfully signed file 'C:\Users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).cat'
libwdi:info [SelfSignFile] Successfully deleted private key
libwdi:debug [wdi_install_driver] Using progress bar mode
libwdi:debug [installer process] got parameter Bulk-In_Interface_(Interface_1).inf
libwdi:debug [process_message] Got request for device_id
libwdi:debug [installer process] got device_id: 'USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001'
libwdi:debug [process_message] Got request for hardware_id
libwdi:debug [installer process] got hardware_id: 'USB\VID_0BDA&PID_2838&REV_0100&MI_01'
libwdi:debug [installer process] got user_sid: 'S-1-5-21-4080826124-1646858994-3449080585-1134'
libwdi:debug [installer process] using syslog 'C:\Windows\inf\setupapi.dev.log'
libwdi:debug [installer process] syslog reader thread started
libwdi:debug [installer process] successfully disabled the system restore point creation setting
libwdi:debug [process_message] Switching timeout to infinite
libwdi:debug [installer process] Installing driver for USB\VID_0BDA&PID_2838&REV_0100&MI_01 - please wait...
libwdi:debug [syslog] ll (UpdateDriverForPlugAndPlayDevices) - USB\VID_0BDA&PID_2838&REV_0100&MI_01]
libwdi:debug [syslog] >>>  Section start 2023/05/17 11:55:43.072
libwdi:debug [syslog]       cmd: "C:\Users\mateuszd\usb_driver\installer_arm64.exe" "Bulk-In_Interface_(Interface_1).inf"
libwdi:debug [syslog]      ndv: INF path: C:\Users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).inf
libwdi:debug [syslog]      ndv: Install flags: 0x00000001
libwdi:debug [syslog]      ndv: {Update Device Driver - USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001}
libwdi:debug [syslog]      ndv:      Search options: 0x00000080
libwdi:debug [syslog]      ndv:      Searching single INF 'C:\Users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).inf'
libwdi:debug [syslog]      dvi:      {Build Driver List} 11:55:43.176
libwdi:debug [syslog]      dvi:           Searching for hardware ID(s):
libwdi:debug [syslog]      dvi:                usb\vid_0bda&pid_2838&rev_0100&mi_01
libwdi:debug [syslog]      dvi:                usb\vid_0bda&pid_2838&mi_01
libwdi:debug [syslog]      dvi:           Searching for compatible ID(s):
libwdi:debug [syslog]      dvi:                usb\compat_vid_0bda&class_ff&subclass_ff&prot_ff
libwdi:debug [syslog]      dvi:                usb\compat_vid_0bda&class_ff&subclass_ff
libwdi:debug [syslog]      dvi:                usb\compat_vid_0bda&class_ff
libwdi:debug [syslog]      dvi:                usb\class_ff&subclass_ff&prot_ff
libwdi:debug [syslog]      dvi:                usb\class_ff&subclass_ff
libwdi:debug [syslog]      dvi:                usb\class_ff
libwdi:debug [syslog]      sig:           {_VERIFY_FILE_SIGNATURE} 11:55:43.312
libwdi:debug [syslog]      sig:                Key      = bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                FilePath = c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                Catalog  = c:\users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).cat
libwdi:debug [syslog] !    sig:                Verifying file against specific (valid) catalog failed.
libwdi:debug [syslog] !    sig:                Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
libwdi:debug [syslog]      sig:           {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 11:55:43.377
libwdi:debug [syslog]      sig:           {_VERIFY_FILE_SIGNATURE} 11:55:43.392
libwdi:debug [syslog]      sig:                Key      = bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                FilePath = c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                Catalog  = c:\users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).cat
libwdi:debug [syslog] !    sig:                Verifying file against specific Authenticode(tm) catalog failed.
libwdi:debug [syslog] !    sig:                Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
libwdi:debug [syslog]      sig:           {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 11:55:43.459
libwdi:debug [syslog]      dvi:           Created Driver Node:
libwdi:debug [syslog]      dvi:                HardwareID   - USB\VID_0BDA&PID_2838&MI_01
libwdi:debug [syslog]      dvi:                InfName      - c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      dvi:                DevDesc      - Bulk-In, Interface (Interface 1)
libwdi:debug [syslog]      dvi:                Section      - USB_Install
libwdi:debug [syslog]      dvi:                Rank         - 0x80ff0001
libwdi:debug [syslog]      dvi:                Signer Score - Not digitally signed
libwdi:debug [syslog]      dvi:                DrvDate      - 06/02/2012
libwdi:debug [syslog]      dvi:                Version      - 6.1.7600.16385
libwdi:debug [syslog]      dvi:      {Build Driver List - exit(0x00000000)} 11:55:43.583
libwdi:debug [syslog]      dvi:      {DIF_SELECTBESTCOMPATDRV} 11:55:43.591
libwdi:debug [syslog]      dvi:           Default installer: Enter 11:55:43.606
libwdi:debug [syslog]      dvi:                {Select Best Driver}
libwdi:debug [syslog]      dvi:                     Class GUID of device changed to: {88bae032-5a81-49f0-bc3d-a4ff138216d6}.
libwdi:debug [syslog]      dvi:                     Selected Driver:
libwdi:debug [syslog]      dvi:                          Description - Bulk-In, Interface (Interface 1)
libwdi:debug [syslog]      dvi:                          InfFile     - c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      dvi:                          Section     - USB_Install
libwdi:debug [syslog]      dvi:                {Select Best Driver - exit(0x00000000)}
libwdi:debug [syslog]      dvi:           Default installer: Exit
libwdi:debug [syslog]      dvi:      {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 11:55:43.684
libwdi:debug [syslog]      ndv:      Force Installing Driver:
libwdi:debug [syslog]      ndv:           Inf Name       - bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      ndv:           Driver Date    - 06/02/2012
libwdi:debug [syslog]      ndv:           Driver Version - 6.1.7600.16385
libwdi:debug [syslog]      sto:      {Setup Import Driver Package: c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf} 11:55:43.731
libwdi:debug [syslog]      inf:           Provider: libwdi
libwdi:debug [syslog]      inf:           Class GUID: {88bae032-5a81-49f0-bc3d-a4ff138216d6}
libwdi:debug [syslog]      inf:           Driver Version: 06/02/2012,6.1.7600.16385
libwdi:debug [syslog]      inf:           Catalog File: Bulk-In_Interface_(Interface_1).cat
libwdi:debug [syslog]      sto:           {Copy Driver Package: c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf} 11:55:43.778
libwdi:debug [syslog]      sto:                Driver Package = c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sto:                Flags          = 0x00000007
libwdi:debug [syslog]      sto:                Destination    = C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}
libwdi:debug [syslog]      sto:                Copying driver package files to 'C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}'.
libwdi:debug [syslog]      flq:                {FILE_QUEUE_COMMIT} 11:55:43.829
libwdi:debug [syslog]      flq:                     Copying 'c:\users\mateuszd\usb_driver\Bulk-In_Interface_(Interface_1).cat' to 'C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}\Bulk-In_Interface_(Interface_1).cat'.
libwdi:debug [syslog]      flq:                     Copying 'c:\users\mateuszd\usb_driver\bulk-in_interface_(interface_1).inf' to 'C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}\bulk-in_interface_(interface_1).inf'.
libwdi:debug [syslog]      flq:                {FILE_QUEUE_COMMIT - exit(0x00000000)} 11:55:43.872
libwdi:debug [syslog]      sto:           {Copy Driver Package: exit(0x00000000)} 11:55:43.872
libwdi:debug [syslog]      ump:           Import flags: 0x00000000
libwdi:debug [syslog]      pol:           {Driver package policy check} 11:55:43.918
libwdi:debug [syslog]      pol:           {Driver package policy check - exit(0x00000000)} 11:55:43.918
libwdi:debug [syslog]      sto:           {Stage Driver Package: C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}\bulk-in_interface_(interface_1).inf} 11:55:43.918
libwdi:debug [syslog]      inf:                Provider       = libwdi
libwdi:debug [syslog]      inf:                Class GUID     = {88bae032-5a81-49f0-bc3d-a4ff138216d6}
libwdi:debug [syslog]      inf:                Driver Version = 06/02/2012,6.1.7600.16385
libwdi:debug [syslog]      inf:                Catalog File   = Bulk-In_Interface_(Interface_1).cat
libwdi:debug [syslog]      inf:                Version Flags  = 0x00000011
libwdi:debug [syslog]      inf:                {Query Configurability: C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}\bulk-in_interface_(interface_1).inf} 11:55:43.934
libwdi:debug [syslog]      inf:                     Driver package uses WDF.
libwdi:debug [syslog]      inf:                     Driver package 'bulk-in_interface_(interface_1).inf' is configurable.
libwdi:debug [syslog]      inf:                {Query Configurability: exit(0x00000000)} 11:55:43.934
libwdi:debug [syslog]      flq:                {FILE_QUEUE_COMMIT} 11:55:43.934
libwdi:debug [syslog]      flq:                     Copying 'C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}\Bulk-In_Interface_(Interface_1).cat' to 'C:\Windows\System32\DriverStore\Temp\{3b8d91c6-b745-184a-82c6-de4ec168c41f}\Bulk-In_Interface_(Interface_1).cat'.
libwdi:debug [syslog]      flq:                     Copying 'C:\Users\mateuszd\AppData\Local\Temp\{7ad345c0-a39d-5545-a7a8-d411417bca2d}\bulk-in_interface_(interface_1).inf' to 'C:\Windows\System32\DriverStore\Temp\{3b8d91c6-b745-184a-82c6-de4ec168c41f}\bulk-in_interface_(interface_1).inf'.
libwdi:debug [syslog]      flq:                {FILE_QUEUE_COMMIT - exit(0x00000000)} 11:55:43.950
libwdi:debug [syslog]      sto:                {DRIVERSTORE IMPORT VALIDATE} 11:55:43.950
libwdi:debug [syslog]      sig:                     Driver package catalog is valid.
libwdi:debug [syslog]      sig:                     {_VERIFY_FILE_SIGNATURE} 11:55:43.965
libwdi:debug [syslog]      sig:                          Key      = bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                          FilePath = C:\Windows\System32\DriverStore\Temp\{3b8d91c6-b745-184a-82c6-de4ec168c41f}\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                          Catalog  = C:\Windows\System32\DriverStore\Temp\{3b8d91c6-b745-184a-82c6-de4ec168c41f}\Bulk-In_Interface_(Interface_1).cat
libwdi:debug [syslog] !    sig:                          Verifying file against specific (valid) catalog failed.
libwdi:debug [syslog] !    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
libwdi:debug [syslog]      sig:                     {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 11:55:43.965
libwdi:debug [syslog]      sig:                     {_VERIFY_FILE_SIGNATURE} 11:55:43.965
libwdi:debug [syslog]      sig:                          Key      = bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                          FilePath = C:\Windows\System32\DriverStore\Temp\{3b8d91c6-b745-184a-82c6-de4ec168c41f}\bulk-in_interface_(interface_1).inf
libwdi:debug [syslog]      sig:                          Catalog  = C:\Windows\System32\DriverStore\Temp\{3b8d91c6-b745-184a-82c6-de4ec168c41f}\Bulk-In_Interface_(Interface_1).cat
libwdi:debug [syslog] !    sig:                          Verifying file against specific Authenticode(tm) catalog failed.
libwdi:debug [syslog] !    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
libwdi:debug [syslog]      sig:                     {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 11:55:43.981
libwdi:debug [syslog] !!!  sig:                     Driver package catalog file certificate does not belong to Trusted Root Certificates, and Code Integrity is enforced.
libwdi:debug [syslog] !!!  sig:                     Driver package failed signature validation. Error = 0x800B0109
libwdi:debug [syslog]      sto:                {DRIVERSTORE IMPORT VALIDATE: exit(0x800b0109)} 11:55:43.981
libwdi:debug [syslog] !!!  sig:                Driver package failed signature verification. Error = 0x800B0109
libwdi:debug [syslog] !!!  sto:                Failed to import driver package into Driver Store. Error = 0x800B0109
libwdi:debug [syslog]      sto:           {Stage Driver Package: exit(0x800b0109)} 11:55:43.981
libwdi:debug [syslog]      sto:      {Setup Import Driver Package - exit (0x800b0109)} 11:55:43.996
libwdi:debug [syslog] !!!  ndv:      Driver package import failed for device.
libwdi:debug [syslog]      ndv:      Installing NULL driver.
libwdi:debug [syslog]      ump:      {Plug and Play Service: Device Install for USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001}
libwdi:debug [syslog] !    dvi:           Installing NULL driver!
libwdi:debug [syslog]      dvi:           {Core Device Install} 11:55:44.034
libwdi:debug [syslog]      dvi:                {Configure Device - USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001} 11:55:44.035
libwdi:debug [syslog]      dvi:                     Device Status: 0x01802400 [0x1c - 0xc0000490]
libwdi:debug [syslog]      dvi:                     Config Flags: 0x00000040
libwdi:debug [syslog]      dvi:                     Parent Device: USB\VID_0BDA&PID_2838\00000001
libwdi:debug [syslog]      dvi:                     Install Device: Configuring device. 11:55:44.038
libwdi:debug [syslog]      dvi:                          Configuration: null
libwdi:debug [syslog]      dvi:                     Install Device: Configuring device completed. 11:55:44.040
libwdi:debug [syslog]      dvi:                     Device Status: 0x01802400 [0x1c - 0xc0000490]
libwdi:debug [syslog]      dvi:                     Install Device: Starting device 'USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001'. 11:55:44.042
libwdi:debug [syslog]      dvi:                     Install Device: Starting device completed. 11:55:44.115
libwdi:debug [syslog] !    dvi:                     Device not started (unknown reason): Device has no problem.
libwdi:debug [syslog]      dvi:                {Configure Device - exit(0x00000000)} 11:55:44.118
libwdi:debug [syslog]      dvi:           {Core Device Install - exit(0x00000000)} 11:55:44.121
libwdi:debug [syslog]      ump:      {Plug and Play Service: Device Install exit(00000000)}
libwdi:debug [syslog]      ndv: {Update Device Driver - exit(00000109)}
libwdi:debug [syslog] !!!  ndv: Failed to install device instance 'USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001'. Error = 0x00000109
libwdi:debug [process_message] Switching timeout back to finite
libwdi:debug [installer process] This version of Windows is refusing to trust the installed certificate.
libwdi:debug [process_message] Installer process completed
Driver Installation: FAILED (Operation not supported or not implemented)
2 devices found.
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_00
libwdi:debug [wdi_create_list] Compatible ID: USB\COMPAT_VID_0bda&Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (7): USB\VID_0BDA&PID_2838&MI_00\6&38A180A5&0&0000
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 0)'
libwdi:debug [wdi_create_list] Hardware ID: USB\VID_0BDA&PID_2838&REV_0100&MI_01
libwdi:debug [wdi_create_list] Compatible ID: USB\COMPAT_VID_0bda&Class_ff&SubClass_ff&Prot_ff
libwdi:debug [wdi_create_list] Driverless USB device (19): USB\VID_0BDA&PID_2838&MI_01\6&38A180A5&0&0001
libwdi:debug [wdi_create_list] Device description: 'Bulk-In, Interface (Interface 1)'

Am I right understanding that test signing needs to be on? The message This version of Windows is refusing to trust the installed certificate. seems to point towards that requirement.

@pbatard
Copy link
Owner

pbatard commented May 18, 2023

The message This version of Windows is refusing to trust the installed certificate. seems to point towards that requirement.

Yes, the issue is that on some Windows 11 platforms, Microsoft appears to no longer honour their official documentation that states that one should be able to sign a driver package and get the signing certificate into Trusted Publishers and is therefore producing the message:

Driver package catalog file certificate does not belong to Trusted Root Certificates, and Code Integrity is enforced.

(Note that, since the above mentions Trusted Root rather than Trusted Publishers, and in case you wonder if that could be the issue, libwdi does installs a driver package's self signing certificate in both Trusted Publishers and Trusted Root, so it's not an issue of installing it to the wrong store, even more so as I'm pretty sure I tried all the stores when I last saw this issue).

This is a problem we had seen pop out in some Windows 11 Insider releases (#242) and which we also discussed on osr.com.

At the time, it was only manifesting in the pre-release version of Windows 11 x64 but that, thankfully, was not carried out into the actual release of Windows 11 x64. Unfortunately, it appears that these changes were not innocuous and that Microsoft carried them into the Windows 11 ARM64 release.

Unfortunately, we do not know if this is due to a "new" security option that could be altered (e.g. Group Policy) and if so, which one, or if it something set in stone. Another possibility is that the certificate we create is missing some new property that Microsoft wants to see before it considers it as a valid Trusted Publishers certificate. Especially, they seem to have changed the wording of their trusted-publishers-certificate-store article linked above to heavily imply that only Authenticode certificates will work, so I have to wonder if Microsoft hasn't added additional validation checks to determine whether a certificate is really an Authenticode one or not, whatever that means...

I'm obviously planning to investigate this further, but I don't know when I'll be able to do so.

@mcuee
Copy link
Contributor

mcuee commented May 18, 2023

@mateuszdrab

Thanks for the report. Since you are using the Windows DevKit 2023, are you running an insider version of Windows 11 on ARM64 or a release version? What is the version number? Any chance you can run a release version if you are currently running an insider version? Thanks.

@mateuszdrab
Copy link

mateuszdrab commented May 19, 2023

Hey, thanks for getting back to me, I'm running a release version - Windows 11 Enterprise 22621.1555 22H2

It is interesting what @pbatard said about the driver signature enforcement misbehaving on ARM64 - it is something I might be able to help with, I will reach out to a ARM64 DL internally and see if anyone can weigh in on the matter.

Perhaps it would be a good idea to reopen the issue?

@pbatard
Copy link
Owner

pbatard commented May 19, 2023

I will reach out to a ARM64 DL internally and see if anyone can weigh in on the matter.

Appreciated, thanks.

Perhaps it would be a good idea to reopen the issue?

I may do that, but the core of this specific issue was to have a version of libwdi that was compatible with Windows on ARM64 (i.e. that could provide a WinUSB driver that one could actually install on ARM64 one way or another), which I consider sorted, even if the current solution is obviously less than satisfactory for Windows 11 users. Plus this issue has a bit too many comments, and was originally about Windows 10, not Windows 11, and I kind of expect Windows 10 not to have that issue on ARM64...

So I will probably open a new issue specifically for the current topic once I see a bit clearer...

@mcuee
Copy link
Contributor

mcuee commented May 19, 2023

So I will probably open a new issue specifically for the current topic once I see a bit clearer...

I think that is a good idea.

@jkunkee
Copy link

jkunkee commented May 19, 2023

Happy to tack this onto a new issue, and sorry if this is a non-sequitur: It may be worth keeping an eye out for DeviceGuard (WDAC, I think). At least some ARM64 devices ship with it enabled, and IIRC I've had to mess with it to load a test-signed hypervisor with Secure Boot disabled before. (I don't know if it should cause issues with trusting additional Trusted Publisher certs for a WinUSB INF, but it wouldn't shock me...)

In particular, I'd be looing for a non-zero value in HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard!RequirePlatformSecurityFeatures in the failing cases.

@phantomski77
Copy link

I think I may have found a workaround. You need to disable Driver Signature Enforcement in Windows. To do that, you need to reboot your Windows into a Safe Mode (Start Menu, right click on power button, and hold SHIFT while clicking on Restart). While in the safe mode, go into Troubleshoot / Advanced Options / Startup Settings. Click Restart, select option 7 (Disable Driver Signature Enforcement). Once the Windows reboots, install Zadig drivers as usual.

I'm running Win 11 Pro in Parallels on Mac and it works well.

My setup:

  • Apple MacBook Pro M2 Max (Apple Silicon)
  • macOS Sonoma 14.1.2
  • Parallels Desktop 19.1.1
  • Windows 11 Pro 22H2 OS Build 22621.2792 (VM on ARM)
  • Zadig 2.8 Build 782

@creafinch
Copy link

I think I may have found a workaround. You need to disable Driver Signature Enforcement in Windows. To do that, you need to reboot your Windows into a Safe Mode (Start Menu, right click on power button, and hold SHIFT while clicking on Restart). While in the safe mode, go into Troubleshoot / Advanced Options / Startup Settings. Click Restart, select option 7 (Disable Driver Signature Enforcement). Once the Windows reboots, install Zadig drivers as usual.

I'm running Win 11 Pro in Parallels on Mac and it works well.

My setup:

  • Apple MacBook Pro M2 Max (Apple Silicon)
  • macOS Sonoma 14.1.2
  • Parallels Desktop 19.1.1
  • Windows 11 Pro 22H2 OS Build 22621.2792 (VM on ARM)
  • Zadig 2.8 Build 782

Wow! This is great news. I've been researching this for weeks. I tried this method you shared and everything seems fine! Thank you very much for sharing and thank you very much to everyone here who worked on this. I can now remove my old laptop with Intel processor from my desk! :)

Thanks again David :)

my setup;

Macbook Pro M1 (Apple Silicon) 2020
macOS Big Sur 11.7.10
Parallels Desktop 18.0.1
Windows 11 Home 22H2 22621.2715
Zadig 2.8

@mcuee
Copy link
Contributor

mcuee commented Dec 15, 2023

Please take note what @phantomski77 proposed is well-known and not a real work-around. It is not recommended for typical end users.

Please refer to the comments here by libwdi developer (Pete).

@phantomski77
Copy link

phantomski77 commented Dec 15, 2023

Please take note what @phantomski77 proposed is well-known and not a real work-around. It is not recommended for typical end users.

I would offer a different perspective @mcuee if I may.

  • "Well known" - it very well may be in some circles, but for someone who just wants to use SDR every now and then and who just bought a new computer on which it suddenly doesn't work anymore I can assure you it is not well known at all. Neither it is publicised enough to be available as an option or a note during installation. It took considerable time to find. It can be easy if you know what you're looking for, but that's developer's perspective, not an user perspective.
  • "Not a real workaround" - well it works, doesn't it? So I'd say that's a definition of a workaround. It works around Windows restrictions on 3rd party drivers.
  • "Not recommended" - what are the real downsides here? You get one extra and extra red warning during the driver installation. So you've done two extra steps to circumvent something that exposed you to a potential security risk (a risk that Microsoft itself ignored for decades). I would argue that both of these risks are publicised enough during the whole setup process. They're kinda hard to ignore. You're doing them willingly, accepting the risks. You may very well choose not to accept them and stay with vanilla Win and no driver. That is a choice, but a choice that imho should be an option.

I completely understand that for someone running Windows 11 on their only computer as a primary OS this might be a significant threat and a step too far. That in my opinion should still not be kept secret, but advertised as an option with the appropriate warnings and pitfalls. Keep in mind, that for someone it literally is the only option.

But please also consider that there's non-zero amount of users who have no emotional connection to their Windows instance and run it purely as a side note in their sandboxed VM, which sole purpose is to provide a place to run a software that's restricted to that particular niche.

And don't let me start about the whole arm64 saga. It's been more than a decade. It's time to adapt (not directed at you and not your fault)

@Bradavvon
Copy link

Bradavvon commented Feb 3, 2024

I think I may have found a workaround. You need to disable Driver Signature Enforcement in Windows. To do that, you need to reboot your Windows into a Safe Mode (Start Menu, right click on power button, and hold SHIFT while clicking on Restart). While in the safe mode, go into Troubleshoot / Advanced Options / Startup Settings. Click Restart, select option 7 (Disable Driver Signature Enforcement). Once the Windows reboots, install Zadig drivers as usual.

I'm running Win 11 Pro in Parallels on Mac and it works well.

Thanks so much for this. I wasn't able to find an answer and so would differ that this isn't well known and is a workaroud. By its very nature is safe "for technically minded people", the option is very hidden in Windows and on my Surface Pro X even had to enter my Bitlocker Recovery Key to get to this option.

I'm pleased to add you only need to do this "to install the driver" and "if you change the physical device". Once installed it continues to work even with Driver Signature Enforcement re-enabled.

Thanks again.

@RubbaCippi
Copy link

I think I may have found a workaround. You need to disable Driver Signature Enforcement in Windows. To do that, you need to reboot your Windows into a Safe Mode (Start Menu, right click on power button, and hold SHIFT while clicking on Restart). While in the safe mode, go into Troubleshoot / Advanced Options / Startup Settings. Click Restart, select option 7 (Disable Driver Signature Enforcement). Once the Windows reboots, install Zadig drivers as usual.

I'm running Win 11 Pro in Parallels on Mac and it works well.

My setup:

  • Apple MacBook Pro M2 Max (Apple Silicon)
  • macOS Sonoma 14.1.2
  • Parallels Desktop 19.1.1
  • Windows 11 Pro 22H2 OS Build 22621.2792 (VM on ARM)
  • Zadig 2.8 Build 782

Thank you.
Indeed, my Windows 11 does not restarted; the screen show only the stylised window logo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests