vadimgrn / usbip-win2

USB/IP Client for Windows
GNU General Public License v3.0
450 stars 41 forks source link

[question] is visual studio 2022 supported? #8

Closed ivanjx closed 2 years ago

ivanjx commented 2 years ago

im wondering if visual studio 2022 with the preview sdk and wdk are supported. or do i need to use visual studio 2019? thanks.

vadimgrn commented 2 years ago

I'm waiting for release of WDK for VS-2022. I don't want to install preview versions of SDK/WDK.

vadimgrn commented 2 years ago

VS2022 can be used to build "develop" branch.

docterling commented 2 years ago

1、 windows 10 professional 2004(for this wsk version,I reinstall my windows to this version) Microsoft Visual Studio Enterprise 2022 (64 bit) - Current - version 17.2.2 sdk version 10.0.22621.0 wdk version 10.0.22621.0 2、 Install driver/usbip_test.pfx (password: usbip) "Trusted Root Certification Authority" in "Local Computer" (not current user) and "Trusted Publishers" in "Local Computer" (not current user) Set certificate driver signing for usbip_vhci project bcdedit.exe /set TESTSIGNING ON and reboot 3、 in cmd with administrator priviledge devcon.exe install usbip_root.inf USBIPWIN\root after that in device manager,it looks like somethings wrong image

and the property details: Windows cannot load the device driver for this hardware. The driver may be damaged or missing. (Code 39) {driver input point not found} %hs device driver cannot find the input point %hs in the driver %hs. any suggestions? and the previous develop version(not wsk) ok for me

vadimgrn commented 2 years ago

The build should create an installer, you don't have to install the driver manually. Readme.md describes everything.

userspace/src/innosetup/setup.iss executes commands which you could run yourself.

docterling commented 2 years ago

yes,I also try that to image but the problem the same

vadimgrn commented 2 years ago

InnoSetup executes these commands

certutil.exe -f -p usbip -importPFX Root usbip_test.pfx FriendlyName="USBIP Test"
certutil.exe -f -p usbip -importPFX TrustedPublisher usbip_test.pfx FriendlyName="USBIP Test"

pnputil.exe /add-driver usbip_vhci.inf /install
devnode.exe install usbip_root.inf USBIPWIN\root

I don't have Win10 to test this issue, it works on Win11.

docterling commented 2 years ago

1、 I set this,and it works now! image 2、 in my win10 2004 attach,detach are ok,but when I reattach the same device it will be BSOD(I've tried many times),and the log BSOD.log 3、 my uac first attach I've hearded unnormal sound,and the traceview print lots of info,after that,in the task bar I change the sound volume,no sound Name Filename Line# System Time Message Unknown 16 06\02\2022-14:19:14:540 Unknown( 16): GUID=8a5fa127-5168-34fa-c75d-e92ce166ec49 (No Format Information found).

vadimgrn commented 2 years ago

Use debug build and get full log as described in Readme.md, please.

!analyze -v
!wmitrace.searchpath %TEMP%\tmfs
!wmitrace.setprefix [%9]%3!04x! %!LEVEL! %!FUNC!:
!wmitrace.logdump usbip-vhci
docterling commented 2 years ago

1.this one is when I change the sound volume over the task bar BSOD1.log 2.this one is do attach-detach-attach,and do the log cmds BSOD2.log

vadimgrn commented 2 years ago

I'm testing the driver using driver verifier from WDK. Several issues were found for two hours :) I want to finish this testing before dealing with these bsods.

vadimgrn commented 2 years ago

I've fixed several bugs that cause BSOD. I'm testing vhci driver using Driver Verifier and there are no issues so far. Could you please try your devices with new build?

docterling commented 2 years ago
  1. I do attach-change vol-detach,when attach windows will play the new usb device arriving sound,but The voice sounds trembling,and then I change the sound volume through task bar,the ui seem stuck and no sound,after that I do detach attach-change vol-detach.txt
  2. in 1 after detach I've found the server was crashed and I restart it,and I do attach and change sound volume again,it BSOD BSOD3.txt
  3. just do attach-detach-attach BSOD4-attach-detach-attach.txt
vadimgrn commented 2 years ago

Please, make logs exactly as described in "Obtaining USB/IP logs on Windows". Your logs are hard to understand due to another TRACE_FORMAT_PREFIX.

vadimgrn commented 2 years ago

BSOD4-attach-detach-attach.txt caused by NT_ASSERT, I've commented it. BSOD3.txt is very similar to behavior of the driver before recent fixes, make sure that you are building and testing the latest develop branch.

docterling commented 2 years ago
  1. yes,I first delete the files about usbip_vhci* in two directories.after install I check the timestamp of sys file in C:\Windows\System32\drivers directory,it's the one I've just compiled,also it's the fresh latest dev branch C:\Windows\System32\DriverStore\FileRepository C:\Windows\System32\drivers I do many times the attach-detach-attach,Eventually it will BSOD,the log looks like BSOD3 BSOD5,I don't know if it's about server side too,cause in the usbip_xfer dev branch I don't see such much unlink and stalled print
  2. another change sound vol bsod file,it looks lots of the same as BOSD3,and the server side log too BSOD5-change vol.txt server-side.txt
  3. I don't change the sound vol and just play music,it can play,but the sound was slow down and server side print a lot of usbip-host 1-2.1.1: unlinked by a call to usb_unlink_urb() usbip-host 1-2.1.1: usb_clear_halt error: devnum 6 endp 1 ret -32 usbip-host 1-2.1.1: endpoint 0 is stalled usbip-host 1-2.1.1: unlink urb cb1a0200 usbip-host 1-2.1.1: unlinked by a call to usb_unlink_urb() usbip-host 1-2.1.1: usb_clear_halt error: devnum 6 endp 1 ret -32 usbip-host 1-2.1.1: endpoint 0 is stalled usbip-host 1-2.1.1: unlink urb cb1a0e00 usbip-host 1-2.1.1: unlinked by a call to usb_unlink_urb() usbip-host 1-2.1.1: usb_clear_halt error: devnum 6 endp 1 ret -32 usbip-host 1-2.1.1: endpoint 0 is stalled usbip-host 1-2.1.1: unlink urb cb1a0200 usbip-host 1-2.1.1: unlinked by a call to usb_unlink_urb() usbip-host 1-2.1.1: usb_clear_halt error: devnum 6 endp 1 ret -32 usbip-host 1-2.1.1: endpoint 0 is stalled usbip-host 1-2.1.1: unlink urb cb1a0e00
vadimgrn commented 2 years ago

I've fixed a bug that was found in BSOD5-change.vol.txt, thank you! copy_isoc_data:src_offset(0) != src_len(192)

I don't have a device to test the fix, but it should work.

docterling commented 2 years ago

I've tried,when attach it will failed on sending and then auto unplug,here is the etl log file LogSession_20220610_093143.zip I am used to using the traceview.exe,You can navigate to the following line vhci wsk.events.cpp 634 WskDisconnectEvent 06\10\2022-09:34:03:423 vpdo 49ccb420, Flags 0x9

vadimgrn commented 2 years ago

I can't and won't view binary file.

docterling commented 2 years ago

I've just tried again the strange thing is the device name in device manager,now it's image it used to be "AUCTOPUS I-65" but the sound is ok now : )

vadimgrn commented 2 years ago

Do you notice a difference between this WSK build and old version that uses usbip_xfer.exe ?

docterling commented 2 years ago

xfer first connect to server and get the device-configration descriptor and then create vpdo wsk first create vpdo and then connect but when plugin xfer is not use the already got descrptor info after IoInvalidateDeviceRelations the upper driver will URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE I know the sting "AUCTOPUS I-65" is frome iProduct string in device descriptor,but I don't know the string "USB Audio Device" from where?

vadimgrn commented 2 years ago

Fixed