How a host application read/write to usb device using USB umdf dri

Discussion in 'Windows Vista Drivers' started by Dean, Jul 25, 2009.

  1. Dean

    Dean Guest

    Hi, I build my own usb umdf driver based on the exmaple in
    %WinDDK%\6001.18002\src\umdf\usb\fx2_driver\step4. I install the driver
    successfully, and my usb device is working properly.

    I have a C# application need to read/write message to the usb device. Could
    anyone help?

    Thanks.
     
    Dean, Jul 25, 2009
    #1
    1. Advertisements

  2. Dean

    Pavel A. Guest

    From the application point of view, UMFD devices behave
    exactly as "classic" devices. Do exactly same what you would
    do to talk with any other device.

    --pa
     
    Pavel A., Jul 25, 2009
    #2
    1. Advertisements

  3. Dean

    Dean Guest

    Using UMDF driver, what win32 API should I use to read or write message to a
    USB device?
     
    Dean, Jul 27, 2009
    #3
  4. WinUsb APIs.

    If you have an UMDF driver for the USB device, then you need a special INF file which will register WinUsb as the kmode driver for your device with UMDF reflector on top of it.
     
    Maxim S. Shatskih, Jul 27, 2009
    #4
  5. Dean

    Praveen Rao Guest

    Dean,

    Did you mean how would app send read/write to UMDF driver or did you mean
    how would UMDF driver send read/write to USB device?

    If it is the former, then as Pavel suggested, there is no difference for an
    app whether it is talking to a UMDF driver or a KMDF/WDM driver.

    If it is the latter, while using WinUsb is a possibility, UMDF Usb I/O
    targets would be the preferred way (since they will handle async,
    cancellation, synchronization etc. for you). Please look at the UMDF Fx2
    driver samples in WDK.

    Praveen
     
    Praveen Rao, Jul 30, 2009
    #5
  6. Dean

    Dean Guest

    Thanks you very much.

    If I use UMDF, I should use DeviceIOControl api (I don't remember what dll
    to import), if I only use WinUSB, I should use winusb.dll, here is an example
    [DllImport("winusb.dll", SetLastError = true)]
    internal static extern Boolean WinUsb_Initialize(SafeFileHandle
    DeviceHandle, ref IntPtr InterfaceHandle);
     
    Dean, Sep 7, 2009
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.