none
winusb sample app RRS feed

  • Question

  • Hi

    I am using below link as a reference  to write a sample app to communicate with usb device.

    https://msdn.microsoft.com/en-us/library/windows/hardware/dn376872%28v=vs.85%29.aspx

    But there seems to be problem with 

    WinUsb_Initialize API which is failing with error ERROR_NOT_ENOUGH_MEMORY(error code 8)

    Thanks

    • Moved by Shu 2017 Monday, March 2, 2015 2:03 AM from C++ forum
    Friday, February 27, 2015 9:44 AM

Answers

  • this means that you can't use the winusb APIs with this device. winusb is being used as a utlity to UMDF for transporting USB io. you want to use WPD APIs to talk to the devic.e

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 5, 2015 6:19 PM
  • you would need to install your own Inf to replace the current driver stack. All current functionality will go away when you do thid

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by nis7 Tuesday, March 10, 2015 5:43 AM
    Monday, March 9, 2015 2:51 PM
  • > do i need to install custom winuSb driver??

    Not exactly. The winusb driver is already installed in the system, but to use it, you may need to write a custom INF or do other tweaks. See here.

    -- pa

    Tuesday, March 3, 2015 3:24 PM

All replies

  • Hi nis7,

    Thanks for posting in MSDN forum.

    Your question is more related to driver development, so I will move this to Windows Hardware WDK and Driver Development forum. Thanks for your understanding.

    Best regards,

    Shu Hu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 2, 2015 2:06 AM
  • did you install the winusb driver? If so, post your inf. How did you install the driver?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, March 2, 2015 2:46 AM
  • no i did not install winsub driver as it was already installed on my usb (android ) device.

    do i need to install custom winsub driver???

    Thanks

    Tuesday, March 3, 2015 2:23 PM
  • winusb may be used with a umdf driver, in which case you can't use the winusb APIs. Also, how do you know which device interface guid to use?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, March 3, 2015 3:31 PM
  • I would like to explain my problem in detail

    1) i created winusb sample app project on visual studio.

    2) project has two component (winusb api and inf project auto generated)

    3)i was not able to install the custom inf on my usb driver(may be because it was already installed)

    4)i ran winusb project but it failed to detect any usb device(SetupDiEnumDeviceInterfaces - It returned FALSE and GetLastError() returned ERROR_NO_MORE_ITEMS )

    5)i changed the uuid in winusb project

    from  0x979d093d,0xb52e,0x49a5,0x84,0xfc,0x68,0x15,0x4f,0x01,0xe0,0xc1 to

      0xA5DCBF10, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4f, 0xB9, 0x51, 0xED

    (reference http://forums.codeguru.com/showthread.php?331907-SetupDiEnumDeviceInterfaces%28%29)

    6)now winusb program detects all usb device connected to my system.

    7)but now WinUsb_Initialize API is failing with error

    ERROR_NOT_ENOUGH_MEMORY(error code 8)

    Thanks


    nis7

    Thursday, March 5, 2015 6:07 AM
  • what are the drivers listed in the driver details in properties of the device in device manager? does it include wudfrd.sys?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 5, 2015 7:10 AM
  • Yes it includes wudfrd.sys

    Along with that it also includes

    1)wpdMtpDr.dll

    2)winusb.sys

    3)WpdUpFltr.sys

    4)WUDFRd.sys

    5)WpdMtp.dll

    6)WpdMtpUS.dll

    Thanks


    nis7

    Thursday, March 5, 2015 10:49 AM
  • this means that you can't use the winusb APIs with this device. winusb is being used as a utlity to UMDF for transporting USB io. you want to use WPD APIs to talk to the devic.e

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, March 5, 2015 6:19 PM
  • if i need to use winusb API, then what is the solution?

    Thanks


    nis7

    Friday, March 6, 2015 8:54 AM
  • i want to write a sample app that communicate with usb device using winUSB apis.

    1)discover my usb device.

    2)open an handle for read/write operaton.

    3)do read and write on usb device.

    Thanks


    nis7

    Monday, March 9, 2015 6:19 AM
  • you would need to install your own Inf to replace the current driver stack. All current functionality will go away when you do thid

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by nis7 Tuesday, March 10, 2015 5:43 AM
    Monday, March 9, 2015 2:51 PM