Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. Unable to start UMDF driver for USB device [Solved]

Unable to start UMDF driver for USB device [Solved]

Scheduled Pinned Locked Moved Hardware & Devices
data-structuresdebugginghelpquestiondiscussion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roger Stoltz
    wrote on last edited by
    #1

    I'm exploring the UMDF framework as I try to develop a UMDF driver for a USB device. I've used the UMDF sample "usb/fx2_driver" final step as starting point, comparing various steps in the sample and removed things specific to the fx2 device that I don't need, such as the read/write queue functionality and 7-segment handling. My driver is supposed to use the control endpoint only so the user application will use ::DeviceIoControl calls for communicating with the driver, thus no ::ReadFile or ::WriteFile calls will be made. I've managed to set up the debugging environment in a way that I'm able to break into the driver when it loads using WinDbg and attach to the WudfHost process. My problem is that my driver fails to start, error code 10. When I try to debug it everything according to my knowledge (which is limited in this area...) looks fine until I hit a breakpoint in CMyDevice::OnReleaseHardware. The call stack prior to my code looks like this:

    007ffd98 1a9208c6 WUDFx!WdfPnpHardwareCallback::ReleaseHardware+0x26
    007ffda0 1a91e887 WUDFx!CWudfPnp::PnpEventFailedOwnHardware+0x10
    007ffdbc 1a91ed8a WUDFx!CWudfPnp::PnpEnterNewState+0x8e
    007ffde8 1a91ee7a WUDFx!CWudfPnp::ProcessEvent+0x2a2
    007ffdfc 1a90d65b WUDFx!CWudfPnp::OnStartComplete+0x27
    007ffe18 1a90d790 WUDFx!CWdfDevice::ProcessPnPCompletion+0x3c

    I haven't got a clue why PnpEventFailedOwnHardware is called. Most likely I've failed to do something that I was supposed to, but what steps should I take in order to figure out what? I don't know whether this is relevant or not but !umirps tells me that I have one pending IRP at 0x9f008 and !umirp 0x9f008 gives me this:

    Error in reading UM IRP at 0x0009f008
    UM IRP: 0x0009f008 UniqueId: 0x0 Kernel Irp: 0x0x89b9b698
    Type: ÿÿ
    ClientProcessId: 0x0
    Device Stack: 0x000930c8
    IoStatus
    hrStatus: 0xd0000001
    Information: 0x0
    Total number of stack locations: 2
    CurrentStackLocation: StackLocation[ 1 ]
    StackLocation[ 0 ]
    DISCARDED

    StackLocation[ 1 ]
    Completion:
    Callback: 0x00000000
    Context: 0x00000000

    I haven't found any information on the net that I've found to be helpful in overcoming this problem. The documentation for UMDF is rather limited, to say the least... Thoughts and/or ideas anyone? At this point I'll run for every ball tossed in my direction....

    R S 2 Replies Last reply
    0
    • R Roger Stoltz

      I'm exploring the UMDF framework as I try to develop a UMDF driver for a USB device. I've used the UMDF sample "usb/fx2_driver" final step as starting point, comparing various steps in the sample and removed things specific to the fx2 device that I don't need, such as the read/write queue functionality and 7-segment handling. My driver is supposed to use the control endpoint only so the user application will use ::DeviceIoControl calls for communicating with the driver, thus no ::ReadFile or ::WriteFile calls will be made. I've managed to set up the debugging environment in a way that I'm able to break into the driver when it loads using WinDbg and attach to the WudfHost process. My problem is that my driver fails to start, error code 10. When I try to debug it everything according to my knowledge (which is limited in this area...) looks fine until I hit a breakpoint in CMyDevice::OnReleaseHardware. The call stack prior to my code looks like this:

      007ffd98 1a9208c6 WUDFx!WdfPnpHardwareCallback::ReleaseHardware+0x26
      007ffda0 1a91e887 WUDFx!CWudfPnp::PnpEventFailedOwnHardware+0x10
      007ffdbc 1a91ed8a WUDFx!CWudfPnp::PnpEnterNewState+0x8e
      007ffde8 1a91ee7a WUDFx!CWudfPnp::ProcessEvent+0x2a2
      007ffdfc 1a90d65b WUDFx!CWudfPnp::OnStartComplete+0x27
      007ffe18 1a90d790 WUDFx!CWdfDevice::ProcessPnPCompletion+0x3c

      I haven't got a clue why PnpEventFailedOwnHardware is called. Most likely I've failed to do something that I was supposed to, but what steps should I take in order to figure out what? I don't know whether this is relevant or not but !umirps tells me that I have one pending IRP at 0x9f008 and !umirp 0x9f008 gives me this:

      Error in reading UM IRP at 0x0009f008
      UM IRP: 0x0009f008 UniqueId: 0x0 Kernel Irp: 0x0x89b9b698
      Type: ÿÿ
      ClientProcessId: 0x0
      Device Stack: 0x000930c8
      IoStatus
      hrStatus: 0xd0000001
      Information: 0x0
      Total number of stack locations: 2
      CurrentStackLocation: StackLocation[ 1 ]
      StackLocation[ 0 ]
      DISCARDED

      StackLocation[ 1 ]
      Completion:
      Callback: 0x00000000
      Context: 0x00000000

      I haven't found any information on the net that I've found to be helpful in overcoming this problem. The documentation for UMDF is rather limited, to say the least... Thoughts and/or ideas anyone? At this point I'll run for every ball tossed in my direction....

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      Due to my lack of experience from WinDbg, I didn't realize that CMyDevice::OnPrepareHardware returned an error. I used the mouse to hover above the local HRESULT variable and I was told that the value was 0x00. When I checked the register (EDI) that is used for the return value I found it to be something else (0xd0000001). After I corrected this the driver starts up nicely.

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      1 Reply Last reply
      0
      • R Roger Stoltz

        I'm exploring the UMDF framework as I try to develop a UMDF driver for a USB device. I've used the UMDF sample "usb/fx2_driver" final step as starting point, comparing various steps in the sample and removed things specific to the fx2 device that I don't need, such as the read/write queue functionality and 7-segment handling. My driver is supposed to use the control endpoint only so the user application will use ::DeviceIoControl calls for communicating with the driver, thus no ::ReadFile or ::WriteFile calls will be made. I've managed to set up the debugging environment in a way that I'm able to break into the driver when it loads using WinDbg and attach to the WudfHost process. My problem is that my driver fails to start, error code 10. When I try to debug it everything according to my knowledge (which is limited in this area...) looks fine until I hit a breakpoint in CMyDevice::OnReleaseHardware. The call stack prior to my code looks like this:

        007ffd98 1a9208c6 WUDFx!WdfPnpHardwareCallback::ReleaseHardware+0x26
        007ffda0 1a91e887 WUDFx!CWudfPnp::PnpEventFailedOwnHardware+0x10
        007ffdbc 1a91ed8a WUDFx!CWudfPnp::PnpEnterNewState+0x8e
        007ffde8 1a91ee7a WUDFx!CWudfPnp::ProcessEvent+0x2a2
        007ffdfc 1a90d65b WUDFx!CWudfPnp::OnStartComplete+0x27
        007ffe18 1a90d790 WUDFx!CWdfDevice::ProcessPnPCompletion+0x3c

        I haven't got a clue why PnpEventFailedOwnHardware is called. Most likely I've failed to do something that I was supposed to, but what steps should I take in order to figure out what? I don't know whether this is relevant or not but !umirps tells me that I have one pending IRP at 0x9f008 and !umirp 0x9f008 gives me this:

        Error in reading UM IRP at 0x0009f008
        UM IRP: 0x0009f008 UniqueId: 0x0 Kernel Irp: 0x0x89b9b698
        Type: ÿÿ
        ClientProcessId: 0x0
        Device Stack: 0x000930c8
        IoStatus
        hrStatus: 0xd0000001
        Information: 0x0
        Total number of stack locations: 2
        CurrentStackLocation: StackLocation[ 1 ]
        StackLocation[ 0 ]
        DISCARDED

        StackLocation[ 1 ]
        Completion:
        Callback: 0x00000000
        Context: 0x00000000

        I haven't found any information on the net that I've found to be helpful in overcoming this problem. The documentation for UMDF is rather limited, to say the least... Thoughts and/or ideas anyone? At this point I'll run for every ball tossed in my direction....

        S Offline
        S Offline
        Sebastian Schneider
        wrote on last edited by
        #3

        Thanks for taking the time to modify your post to "resolved" AND posting the solution. If only everyone did that :)

        Cheers, Sebastian -- "If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton

        R 1 Reply Last reply
        0
        • S Sebastian Schneider

          Thanks for taking the time to modify your post to "resolved" AND posting the solution. If only everyone did that :)

          Cheers, Sebastian -- "If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton

          R Offline
          R Offline
          Roger Stoltz
          wrote on last edited by
          #4

          Well, thank you for noticing! ;) As this is a searchable forum, this is how I think it should be done. Otherwise there wouldn't be any benefit for others. Just following my own guidelines... :-\

          "It's supposed to be hard, otherwise anybody could do it!" - selfquote
          "High speed never compensates for wrong direction!" - unknown

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups