USB Mass storage device mounting

This is a discussion on USB Mass storage device mounting within the Windows Programming forums, part of the Platform Specific Boards category; I have a custom developed mass storage hardware that has been working perfectly in Windows XP, mounting with a drive ...

  1. #1
    Registered User
    Join Date
    Jun 2012
    Location
    BRITISH COLUMBIA
    Posts
    4

    Question USB Mass storage device mounting

    I have a custom developed mass storage hardware that has been working perfectly in Windows XP, mounting with a drive letter on windows XP within seconds of plugging it in to any USB port. In windows 7 however the same hardware takes several minutes to mount. First, in a few seconds, Windows recognises it as a USB mass Storage device when you plug it in. But if you look at the process in the action centre ( I think thats what its called, it's the icon in the taskbar area on the bottom right that shows that there's a new device detected and being installed), there are two items to be installed for the device. The first has a tick and is called USB Mass Storage Device. The second one, the name of the actual device itself takes several minutes to finally settle on the generic, default windows driver and eventually gets a tick, causing the autorun to pop up asking if I want to open it. Like I said, it mounts like a breeze on XP but is REALLY slow on Windows 7. What is going on?
    I'm a software developer tasked with sorting this out for my client's Windows 7 clients and so far, I have not been able to work out what Windows 7 is doing differently to Windows XP or how I can programmatically fix this. They had the product developped as a mass storage device and its been working well for years on XP. I have NO access to the firmware and don't know where to start in developing a driver for this custom hardware, if that is indeed what needs to be done.. I can however make some sort of program run in the installer for the software that I wrote for the chip. Basically al the software does is lets you upload and download files of a specific type (encrypted proprietary file format for this device that show up on the chip as files in its window). There's nothing fancy going on at all and it doesn't need a device driver to run, just a fix to get it to mount quickly or the software falls over when it formats the device prior to uploading new files to it.
    What is different about the process used by Windows 7 when installing a generic mass storage device? Other flash drives I have mount much faster than this custom hardware. What is different about them? Its not the speed of the hardware, because that is not an issue on XP, as I said. Can I write the hardware id into registry somewhere special so Windows 7 stops mucking about looking for an appropriate driver EVERY time it is plugged in? Can I 'tell' Windows 7 to always use the default mass storage device and file system drivers without it getting confused and searching for 2 minutes every single time it is plugged in?

    Is there an ini file that could somehow be used by Windows 7 for this specific device or something like that? What do I need to do programatically to get Windows 7 to behave like Windows XP for this device only?

    Can I copy the default Windows mass storage device driver inf file or some other inf file and somehow decompile it and edit it to only apply to this custom flash drive?

    Im totally stuck right now! The solution is time sensitive as well. (Sad face)



  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    Have you watched what is going on with something like this?
    USBlyzer - USB Protocol Analyzer and USB Traffic Sniffer for Windows

    This might be worth using as well
    Process Monitor

    Do you see the same "slow" behaviour on a clean install of XP the first time you plug the device in?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2012
    Location
    BRITISH COLUMBIA
    Posts
    4

    Unhappy Ill check out the monitoring

    Thanks for the links. Regarding a clean install of Windows Xp, umm you mean 7 right? In Windows XP, its always fast. In Windows 7, after a clean boot it is just as slow.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    > Regarding a clean install of Windows Xp, umm you mean 7 right?
    No, I mean XP
    That is, does XP do anything special the first time it ever sees the device (which subsequently makes it seem "quicker")

    If XP is slow the very first time, and then quick thereafter, it might be a clue as to what XP does (that Win7 doesn't).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jun 2012
    Location
    BRITISH COLUMBIA
    Posts
    4

    XP is just as quick every time

    Quote Originally Posted by Salem View Post
    If XP is slow the very first time, and then quick thereafter, it might be a clue as to what XP does (that Win7 doesn't).
    There's no difference I can see in detection time on XP. I did get the reports for the Windows 7 and Windows XP from UsbLizer and I put them up here:
    XP:
    USBlyzer Report

    XP produces this data pretty much instantly and mounts the device.

    Windows 7:
    USBlyzer Report

    Data is generated like this instantly but it pauses for a minute and displays anothe big chunk and so on until it detects. There is more data at the end of this report after it was detected. If you scroll up you can see something different from that common Bulk or Interrupt Transfer description.

    Id like to be able to make a Windows driver for this device. I believe that if I can get the driver to do what XP is doing, then there will be no problem. The default Windows 7 mass storage device driver that is being used is clearly making different traffic. Im not sure exactly how to use this yet. Help?

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    Win7 is doing a lot of weird crap compared to XP.

    $ grep -c MSDOS5 *uptomount*
    win7uptomount.html:66
    winXPuptomount.html:6
    Excessive amnesia - why either of them would want to read the boot sector more than once is beyond me, but 66 times, sheesh!

    $ grep -c Unsuccessful *uptomount*
    win7uptomount.html:16
    winXPuptomount.html:5
    Maybe nothing important, since win7 seems to be doing a lot more, so perhaps proportionately more unsuccessful attempts.

    However, this seems to be the real time killer.
    $ grep -c Cancelled *uptomount*
    win7uptomount.html:8
    winXPuptomount.html:0
    There are 4 pairs of cancelled transactions (first at elapsed time 68.924565). The real issue being the 1 minute timeout (first is 59.818194s) which precedes each one.
    This soaks up 240 seconds of the trace with doing nothing at all.

    The XP trace has an elapsed time of about 14.5 seconds. The Win7 trace would be about 25 seconds, if not for those pesky 4 minutes of cancelled timeouts.

    PS
    USB isn't my thing, and Windows really isn't my thing.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Registered User
    Join Date
    Jun 2012
    Location
    BRITISH COLUMBIA
    Posts
    4
    Anyone, is this something that can be handled by a driver for Windows? Could Windows XP drivers be used instead of the Windows 7 ones? When I try, I am told by windows that the drivers are already up to date. How do you customize the Windows 7 default mass storage device drivers for a specific device, programmatically, or do you have to re-invent the wheel and make a USB mass storage device driver from scratch? Is there no publicly available source code for a USB mass storage device driver that will work in Windows 7? Maybe the XP driver source code somewhere? And why does Microsoft charge to be directly contacted with a problem with THEIR stuff? Why does one have to scour the internet for technical minded people? Why can't Microsoft get their multi billion dollar ass in gear? USB isn't MY thing either. Its quickly becoming my thing though, out of necessity. Ive lived with windows all my IT career. Programming Windows device drivers though is something Ive never done. I could use some help with this one.
    Last edited by Borthwick; 06-17-2012 at 11:12 PM. Reason: typos

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Hologaphic storage device.
    By adrianxw in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-25-2005, 09:43 AM
  2. Mass Data Storage, Files, Howto?
    By Zeusbwr in forum C++ Programming
    Replies: 11
    Last Post: 10-26-2004, 08:47 PM
  3. Mounting
    By JasonLikesJava in forum Linux Programming
    Replies: 2
    Last Post: 03-22-2002, 07:53 PM
  4. WHat does mounting mean?
    By Nutshell in forum C Programming
    Replies: 5
    Last Post: 02-26-2002, 04:44 AM
  5. WHat does mounting mean?
    By Nutshell in forum Linux Programming
    Replies: 7
    Last Post: 02-23-2002, 07:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21