Coder Social home page Coder Social logo

Comments (21)

koudis avatar koudis commented on June 26, 2024 1

I guess that I found the way. I will test it and then post a snippet.

from usbip-win.

koudis avatar koudis commented on June 26, 2024 1

I am going to work on install feature at start of the next month (2019/10).
I guesst that it's work for a few days, so it can be done in first half of 2019/10

from usbip-win.

cezuni avatar cezuni commented on June 26, 2024

@koudis: It's wonderful that vhci is ready for use with a simple usbip command. Current stub driver is installed by usbip.exe.
BTW, SetupCopyOEMInfA cannot install a legacy device?

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni thanks, I will look at it :).

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni
SetupCopyOEMInfA install driver but not device. The device is not present in Device Manager and usbip attach command does not work.

I call SetupCopyOEMInfA exactly as in StackOverflow link. Function returns true but if I want to attach device by "usbip attach" comman i get
usbip: error: open vhci driver
usbip: error: failed to read: err:6

But if I install driver manually "usbip attach" works fine.

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni
I try this
https://stackoverflow.com/questions/53864109/windows-driver-install-legacy-hardware-with-command-line-tool

I try every section I found in the inf file. But It does not work...

from usbip-win.

koudis avatar koudis commented on June 26, 2024

I guess that there are some missing sections in .inf file.

It has no priority but It will be really nice install driver without problems from C/C++ or C#.

The Device Manager probably parse the inf file and go thru all sections, make some heuristics and determine Device info. Then it installs the devicen and driver.
We have no sources for Device Manager so it's really hard to track exact steps which Device Manager do while installs Device.

from usbip-win.

cezuni avatar cezuni commented on June 26, 2024

@koudis: I'll try too but I will be busy next week. 😞 My testing will be late..

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni thank you :).

I am doing some research around SetupDi functions.
I found https://docs.microsoft.com/en-us/windows/win32/api/setupapi/nf-setupapi-setupdicreatedeviceinterfacea

But I really do not known what is "interface_class_guid"? I found macros GUID_DEVICEINTERFACE* but I do not known what I may choose.

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni
Solution with the code:
https://github.com/koudis/usbip-win-vhci-install

Just change "INF_FILE" to absolute path to your vhci .inf file.

It installs new device. If device already exist remove it and install the new one.
Then install driver for already added device.

EDIT: There are some small typo bugs etc.

from usbip-win.

cezuni avatar cezuni commented on June 26, 2024

@koudis: superb!! I'll check your work.
How about integrating the awesome feature into usbip.exe ?

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni
ok :).

How the vhci installer is supposed to be integrated into usbipwin? As part of usbip command? As separate utility which installs given inf? Or direct installer for vhci driver (driver packed as resource or present in the same dir as installer)?

I will make small refactoring and try to remove "PlugAndPlay" driver install routine.

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni
I vote for "Separate installer which has all resources present in the same dir as installer".

I Create PR with new project for vhci installer. VS Solution has project called "Driver package" which copies all linked drivers to specified directory and permit to compile own C code.

So I create Driver Package project, implement installer and create PR.

(I have not succeed with replacement of "PlugandPlay" install driver function. I guess that install by PnP is not so bad. Any advise welcome.)

from usbip-win.

cezuni avatar cezuni commented on June 26, 2024

I vote for "Separate installer which has all resources present in the same dir as installer".

I slightly prefer usbip.exe. :) But welcome any approach.

(I have not succeed with replacement of "PlugandPlay" install driver function. I guess that install by PnP is not so bad. Any advise welcome.)

What’s the reason to replace UpdateDriverForPlugAndPlayDevices?

from usbip-win.

koudis avatar koudis commented on June 26, 2024

I slightly prefer usbip.exe. :) But welcome any approach.

Ok, i will try.

prerequisite: Driver files will have to be in the same dir as usbip.exe

What’s the reason to replace UpdateDriverForPlugAndPlayDevices?

It installs driver for all already inserted/created devices. Not for only specific which I created seconds before. It's not a big problem If the usbip installs driver (because when usbip installs driver It can choose Device Path and HW Id so there will be no collisions)

from usbip-win.

cezuni avatar cezuni commented on June 26, 2024

prerequisite: Driver files will have to be in the same dir as usbip.exe

I also agree that it's the best way for the current state where an installation package is not ready.

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni I guess that the install procedure can be done in usbip_vhci_driver_open function? If open fails we try to install usbip_vhci driver (according to error code value)

from usbip-win.

cezuni avatar cezuni commented on June 26, 2024

@koudis: interesting idea! But explicit installation with an usbip command would be better as a first step. Implicit installation for convenience can be next.

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni I created #86 . Can you test code in PR?
You need "trust" driver before you can install it by usbip.exe install

from usbip-win.

koudis avatar koudis commented on June 26, 2024

@cezuni I closed original PR and create another one

#90

from usbip-win.

cezanne avatar cezanne commented on June 26, 2024

@koudis: This issue had been successfully resolved. πŸ˜„

from usbip-win.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.