Jump to content











Photo
- - - - -

Weird problem with USB hotplug


  • Please log in to reply
42 replies to this topic

#26 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 March 2013 - 05:53 PM

I use the same crystal ball as Sherlock Holmes. It's called logic. ;)

Well, maybe Sherlock would have additionally asked Mycroft ;) if there was a way to control the loading of services :unsure:
http://support.micro...kb/115486/en-us

Would this (or something similar to it) still work in a 7 based PE? :dubbio:

Seemingly:
http://msdn.microsof...rdware/ff552319(v=vs.85).aspx
there is also a setting for "WinPE booting", one for "USB disk" and one for USB 3.0"

The idea:
http://www.markwilso...l-usb-drive.htm
of "correcting" the "backing" .inf files seems also to me a good one (for "full" 7), but may possibly applu to the PE as well. :unsure:

 

OT, but not much, how are you logging drivers loading?

Loadorder:

http://technet.micro...s/bb897416.aspx

is said:

http://tinyhacker.co...oad-at-startup/

to work in 7 too.

 

 


:cheers:
Wonko



#27 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 15 March 2013 - 10:02 PM

Thanks for the many interesting links.
Accoring to them, the loading order of the usb drivers in Win7PESE is not correct. No idea if this makes a difference in real life.

Just one thing. Loadorder does not actually gives one the list, how it worked out, but how it should be in theory.
On demand drivers are for instance not listed at all.

:cheers:

#28 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 March 2013 - 12:57 AM

Can someone tell me what happens during PNP Initialization?
No new driver get installed, no services start, but without it, USB is dead.
Google doesn't give me anything.

:cheers:

#29 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 16 March 2013 - 11:41 AM

Just one thing. Loadorder does not actually gives one the list, how it worked out, but how it should be in theory.
On demand drivers are for instance not listed at all.
 

I know, that 's why I asked you HOW you logged the loading order.

This was a question, you can recognize them by the little sign called "question mark", resembling a little hook, on the right, and I would have liked to have an answer to it.

It would be very kind of you to provide that answer :).

The loose idea is/was, presuming that you are logging the "real" order of loading, (please, if it was not clear, would you please kindly describe HOW exactly you are logging the driver load order?) comparing your log with the "theoretical" one provided by LoadOrder it might be possible to pin down what differences there are.

 

More generally, if you could share some info, instead of your vague conclusions only:

 

Accoring to them, the loading order of the usb drivers in Win7PESE is not correct. No idea if this makes a difference in real life.

it might be much more fun to play this game :whistling:

 

:cheers:

Wonko



#30 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 16 March 2013 - 01:06 PM

Yep, found that question paired with a recommendation also a raher strange construct.

Anyway, i use ServiWin from Nirsoft.
It only shows the last access to the driver and not all accesses, like it would be ideal, but btter than nothing.

More generally, if you could share some info, instead of your vague conclusions only:

The correct order would be:
- usbccgp
- usbehci
- usbuhci
- usbohci
- usbhub
- usbstor

In win7PESE the order is
- usbehci
- usbuhci
- usbhub
- usbohci
- usbccgp
- usbstor

:cheers:


#31 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 16 March 2013 - 01:49 PM

And I guess that a 7 Pe won't be able to make a ntbtlog.txt, right? :unsure:
Can you try this one?
http://www.novirusth...rivers-manager/
Or does it behave like the Sysinternals thingy?

Alternatively, would a "complete" bootlog with Procmon work?

Finally, and as well cannot say if it could work in a PE, would the Windows Performance Tools Kit:
http://www.msfn.org/...yresume-issues/
do?

xbootmgr -trace boot -traceFlags BASE+CSWITCH+DRIVERS+POWER -resultPath C:\TEMP

possibly with just the DRIVERS traceflag? :dubbio:

Maybe this is useful:
http://www-user.tu-c...y_wdm/ch02b.htm
to better understand what happens (or should happen) with PNP.

:cheers:
Wonko



#32 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 17 March 2013 - 03:12 PM

Ok, i give up.

Win7PESE seemed like the perfect starting point for this venture, with its mostly almost working USB Hotplug, but it isn't.
Every corner i turn another wtf-moment and nobody, who knows, if this is an error or if it is like this for a reason or at least nobody, who would reply.

Rather strange, isn't it? One would expect a project maintainer to know, what's going on in his project or at least, to be interested to find out, if he doesn't, wouldn't one?

Just look at my inquiry about the startfiles order. Meant as nothing more than a little step on the road to get USB-Hotplug reliable working.
It's over a week and the only reply, i've got from the project maintainer, is that he is angry, that i posted the services.exe sourcecode here.
A sourcecode, which btw, the shortcuts.exe generates itself, when given the switch /ChrisR or /JFX.
That's like providing the sourcecode with the exe and being angry, when people actually look at it! WTF?

Anyhow, after spending a lot of my free time on this issue, without really making any headway, i decided to stop wasting my time.

Working from a PE1 with perfectly working USB-Hotplug seems to be the way better route, especialy since i know a projectmaintainer for one, who would gladly help me. ;)

Big Thanks to everyone, who tryed to help. :cheers: :medieval:

#33 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 17 March 2013 - 03:52 PM

Ok, i give up.

Oww, comeon, giving up is NEVER an option!
 

Just look at my inquiry about the startfiles order. Meant as nothing more than a little step on the road to get USB-Hotplug reliable working.
It's over a week and the only reply, i've got from the project maintainer, is that he is angry, that i posted the services.exe sourcecode here.
A sourcecode, which btw, the shortcuts.exe generates itself, when given the switch /ChrisR or /JFX.
That's like providing the sourcecode with the exe and being angry, when people actually look at it! WTF?

Well, everyone is (or should be) free of doing whatever he/she wants with their intellectual work, but the usual way to keep a secret is NOT "hiding it inside something you give away", as before or later some nosy peep will reveal it's contents. :whistling:

On the other hand I noticed an increased trend also among "resident on reboot.pro" developers to (for whatever reasons) "just do" things without spending a few words of comment on how they did something, why they did that something and why they preferred that something to something else.

I guess most if not all the spirit of the board being a Community is getting lost  :( :frusty:
 

Anyhow, after spending a lot of my free time on this issue, without really making any headway, i decided to stop wasting my time.

Working from a PE1 with perfectly working USB-Hotplug seems to be the way better route, especialy since i know a projectmaintainer for one, who would gladly help me. ;)

Oww, comeon, this is like saying that a horse cart is better than a Ferrari because you happen to know a good horseshoer. :w00t:

And BTW I am not saying in any way that 7 based PE is better than an XP based one. :blink:
 

Big Thanks to everyone, who tryed to help. :cheers: :medieval:

Big thanks my sock :ranting2:, by giving up you are also making the people that tried helping you waste their time. :(

Be a man, fight for your beliefs! (and stop whining!) ;)


:cheers:
Wonko



#34 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 17 March 2013 - 10:20 PM

I guess most if not all the spirit of the board being a Community is getting lost :( :frusty:
Imo it already has, together with Boot-Land.

Oww, comeon, this is like saying that a horse cart is better than a Ferrari because you happen to know a good horseshoer. :w00t:
Actually it's like saying, that a horse cart is better than a Ferrari, because you happen to know someone, who can fix the horse, but noone, who can fix the car. ;)

Big thanks my sock :ranting2:, by giving up you are also making the people that tried helping you waste their time. :(
Yes, i know. Sorry about that, but the ratio of wasted time between us is hardly 1:1.

If you intend though, to continue this venture, determined to make sure your time wasn't wasted.
You better plan on wasting first a couple of months learning, how this PE works, all by glorius, time consuming trial and error, followed by weeks of error fixing.

Cause boy are there issues. If i can spot some wrong names and numbers in the registry, then there most be legions of them.


:cheers:

PS; Completely forgot to mention: Managed to get the drivers to load in the order, they do on the flawlessly working Win7PESE. Didn't gave the same result though.

#35 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 March 2013 - 09:42 AM

Happy to know you have a friend who is a veterinarian. :) ;)

 

 

PS; Completely forgot to mention: Managed to get the drivers to load in the order, they do on the flawlessly working Win7PESE. Didn't gave the same result though.

:w00t:

Then it is *something* else (but still a timing problem of some kind).

 

Could it be (somehow) related to the (sometimes reported) issues with USB booting?

 

From what I have read here and there, there is evidently some differences in enumerating hardware between PE 1.x and 2.x/3.x but the use of drivers such as WaitBT to give some time to the services/detection/what not to go in the right order seem common to the two kinds of PE's. 

 

:cheers:

Wonko



#36 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 18 March 2013 - 12:55 PM

Agree on the timing issue. Still, the problem is, we're trying to look for the issue, by looking through a bunch of keyholes.

It's like the story of the 3 blind men, who should describe an elephant.
One grabs a leg and says it's a tree, the other grabs the trunk and says it's a snake, the third grabs the tail and says it's a twig.

We would need some all encompassing overview, which is detailed enough to see the problem, but not so detailed that the needle disappears in the haystack.
Something were we could 'zoom' in on details on demand.

So far checked:
- services
- drivers
- registry
- starting explorer shell sooner or later (assuming it creates missing registry keys during 1. start)

There is no difference in the 4, between the times the Win7PESE starts with perfectly working USB-Hotplug and those when it is not perfectly working.
There are some fluctuations in driver load order, but they don't seem to affect anything.

I havn't worked on USB booting with PE3, but isn't there a switch for USB-Booting something like "Wait for Hardware"?

And i also doubt that there is any correlation. If USB devices are pluged in before the OS is started, they show up fine, no problems at all.

:cheers:

#37 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 March 2013 - 01:58 PM

I really don't know :unsure:, but the USB booting was an example of where some "queer" things happen (that were reported) in a PE 2.x/3.x (actually in the windows install).

It seems like the PE 1.x (actually XP install) always enumerates the devices "the same", whilst the PE 3.x (actually Windows 7) install changes this enumeration (talking of connected disk drives or disk-like devices).

Some of these wre highlighted in th "Install Windows from USB" forum over at MSFN.

I wonder is something similar may happen for "other" devices (or if this same changes on the disk devices may affect hot-plug). :dubbio:

 

I also have no real experience with boot tracing (let alone on PE 3.x/Windows 7) but seemingly that is the approach to exactly trace the booting. 

 

:cheers:

Wonko



#38 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 18 March 2013 - 03:52 PM

I know that driver binding works completely different during boot, than while Windows is running.
That's why the device manager in PE can report a device as working, while claiming no drivers were needed for this device.
We just don't get to see the full picture.

A full debug log of the whole OS should give us what we need. But without a tool, which let's zoom in and out the raw data is just too much to find anything

I did boot tracing once, it's not that helpful, unless you wanna know, where you loose time during boot.

:cheers:

#39 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 04 April 2013 - 01:08 PM

Another weird thing about USB-Hotplug.

For a long time, i took it as given, that the "safe to remove" dialogs arn't working in PE3.
Then i noticed last week, that SD-Cards do get that dialog, just USB-Sticks don't.

I think, i tracked the problem down to those 2 commands.

rundll32.exe C:\Windows\system32\hotplug.dll,HotPlugSafeRemovalNotification \\.\pipe\PNP_HotPlug_Pipe_1.{0d3a71dc-1221-42bb-8833-e9c3395f6ea0}

rundll32.exe C:\Windows\system32\hotplug.dll,HotPlugSafeRemovalDriveNotification Removable Disk (H:)
The upper is the command to show the safe remove dialog for a USB-Stick. (not working in PE)
The lower is the command to show the safe remove dialog for a USB-Cardreader/SD-Card combo (working in PE)

The problem i have is, that i can't track the command for the USB-Sticks down. It isn't in any file, nor is it in the Registry of a full Win7.

HotPlugSafeRemovalNotification is a parameter hotplug.dll knows, but no other program or the registry. So how is hotplug.dll called with this parameter? :confused1:

{0d3a71dc-1221-42bb-8833-e9c3395f6ea0} looks like it should be a registry key, but it isn't.

The whole command is a complete conundrum to me.

:cheers:


#40 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 April 2013 - 01:25 PM

Can you run Winobj (or a similar tool)?

It is possible that {0d3a71dc-1221-42bb-8833-e9c3395f6ea0} is connected to one of the "volatile" objects. (actually it looks exactly like it could be one of those)

 

You do remember the good ol'times, don't you? ;):

http://reboot.pro/to...emount-ramdisk/

http://reboot.pro/to...amdisk/?p=20223

 

:cheers:

Wonko



#41 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 04 April 2013 - 03:44 PM

Ok, i looked with WinObj, but i can't find the string currently used by the system. Not associated in any way to the USB device or not.
Maybe the object is just created once i click on remove and deleted as soon as the unplug process has finished. :dubbio:

Looking through the data, i can not see, how this could help me, finding the problem. What did you had in mind?

:cheers:

#42 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 April 2013 - 04:20 PM

I have not any particular idea (let alone a "brilliant" one :(), *anything* that begins with \\.\ such as "\\.\pipe\PNP_HotPlug_Pipe_1." is something "low level" that can usually be seen with Winobj.

In the case of this object it seems like being a "named pipe" (whatever a named pipe is :w00t:) and seemingly losely connected to DeviceDisplayObjectProvider.exe

Check the docs here:

http://www.cs.purdue...ions/Microsoft/

maybe you can find in them some explanation of the way it works. :unsure:

 

The whole idea of what you are doing :) which is essentially that of "exploring new, strange worlds" and particularly that of  "boldly go where no man has gone before"  ;) is that there is not much "prior art" and one needs to discover things.....

 

GO, Medevil, GO! :cheerleader:

 

:cheers:

Wonko



#43 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 04 April 2013 - 09:45 PM

I think, i'm getting too old for this shit.

Downloaded a program from SysInternals called Pipelist.
Guess what! There is no such pipe as hotplug is using it! :eek:

Wanted to use processmon to get a more complete picture than with filemon.
Fresh out of the box - it logs explorer.exe events.

If i set the filter to include:
- all events which contain the word explorer.exe in 'process name'
- all events which contain the word explorer.exe in 'image path'
- all events which contain the word explorer.exe in 'command line'

then the program does not log anything anymore! :frusty:

:cheers:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users