How to access USB port from user mode program on Win2K/XP?

Discussion in 'Windows Vista Drivers' started by Narendra Kulkarni, Jul 22, 2004.

  1. Hi,

    I am writing an User Mode program to access an device connected to the USB
    port. How to access it?
    Can we use CreateFile,ReadFile,WriteFile functions to access it?


    Narendra
     
    Narendra Kulkarni, Jul 22, 2004
    #1
    1. Advertising

  2. What type of USB device is this? Very likely you will need to write a
    driver for this device in order to access it. A user-mode interface for USB
    devices is coming in Longhorn, but isn't available natively in Windows
    today. If your device is a HID device, or belongs to a standard class (such
    as a disk device) then perhaps there are existing drivers that will suffice.
    Otherwise, you will need a driver.

    --
    Bill McKenzie
    Software Engineer - Prism 802.11 Wireless Solutions
    Conexant Systems, Inc.


    "Narendra Kulkarni" <> wrote in message
    news:%...
    > Hi,
    >
    > I am writing an User Mode program to access an device connected to the USB
    > port. How to access it?
    > Can we use CreateFile,ReadFile,WriteFile functions to access it?
    >
    >
    > Narendra
    >
    >
     
    Bill McKenzie, Jul 22, 2004
    #2
    1. Advertising

  3. It is a type of HID device(touch screen) for which i have the driver. I am
    writing an calibration utility as an uiser mode application. I need to get
    the raw and calibrated X,Y coordinates from the touchscreen. Can anyone give
    me suggestions in this regard

    TIA
    Narendra


    Can anyone explain how to read and write data from
    "Bill McKenzie" <> wrote in message
    news:%...
    > What type of USB device is this? Very likely you will need to write a
    > driver for this device in order to access it. A user-mode interface for

    USB
    > devices is coming in Longhorn, but isn't available natively in Windows
    > today. If your device is a HID device, or belongs to a standard class

    (such
    > as a disk device) then perhaps there are existing drivers that will

    suffice.
    > Otherwise, you will need a driver.
    >
    > --
    > Bill McKenzie
    > Software Engineer - Prism 802.11 Wireless Solutions
    > Conexant Systems, Inc.
    >
    >
    > "Narendra Kulkarni" <> wrote in message
    > news:%...
    > > Hi,
    > >
    > > I am writing an User Mode program to access an device connected to the

    USB
    > > port. How to access it?
    > > Can we use CreateFile,ReadFile,WriteFile functions to access it?
    > >
    > >
    > > Narendra
    > >
    > >

    >
    >
     
    Narendra Kulkarni, Jul 22, 2004
    #3
  4. Narendra Kulkarni

    Jackal Huang Guest

    You can try hclient sample code in DDK.
    The sample code demonstrates how an user mode program
    to communicate the HID device.
    It locates in <DDK>\src\wdm\hid\hclient.

    Best Regards

    Jackal Huang

    >-----Original Message-----
    >It is a type of HID device(touch screen) for which i

    have the driver. I am
    >writing an calibration utility as an uiser mode

    application. I need to get
    >the raw and calibrated X,Y coordinates from the

    touchscreen. Can anyone give
    >me suggestions in this regard
    >
    >TIA
    >Narendra
    >
    >
    >Can anyone explain how to read and write data from
    >"Bill McKenzie" <> wrote

    in message
    >news:%...
    >> What type of USB device is this? Very likely you will

    need to write a
    >> driver for this device in order to access it. A user-

    mode interface for
    >USB
    >> devices is coming in Longhorn, but isn't available

    natively in Windows
    >> today. If your device is a HID device, or belongs to a

    standard class
    >(such
    >> as a disk device) then perhaps there are existing

    drivers that will
    >suffice.
    >> Otherwise, you will need a driver.
    >>
    >> --
    >> Bill McKenzie
    >> Software Engineer - Prism 802.11 Wireless Solutions
    >> Conexant Systems, Inc.
    >>
    >>
    >> "Narendra Kulkarni" <> wrote in

    message
    >> news:%...
    >> > Hi,
    >> >
    >> > I am writing an User Mode program to access an device

    connected to the
    >USB
    >> > port. How to access it?
    >> > Can we use CreateFile,ReadFile,WriteFile functions to

    access it?
    >> >
    >> >
    >> > Narendra
    >> >
    >> >

    >>
    >>

    >
    >
    >.
    >
     
    Jackal Huang, Jul 22, 2004
    #4
  5. Narendra Kulkarni wrote:

    > It is a type of HID device(touch screen) for which i have the driver.


    Now what? HID or not?

    If the device identifies itself as HID mouse then no access is possible
    because Windows grabs all mice (and keyboards) with an exclusive
    CreateFile call.
     
    Robert Marquardt, Jul 22, 2004
    #5
  6. From: http://www.lvr.com/hidfaq.htm

    Windows 2000 and Windows XP have exclusive read/write access to HIDs that
    are configured as a system keyboards or mice. An application can obtain a
    handle to a system keyboard or mouse by not requesting READ or WRITE access
    with CreateFile. Communications can then use HidD_SetFeature and
    HidD_GetFeature (assuming the device supports Feature reports).
     
    David S Thompson, Aug 20, 2004
    #6
  7. David S Thompson wrote:
    > From: http://www.lvr.com/hidfaq.htm
    >
    > Windows 2000 and Windows XP have exclusive read/write access to HIDs that
    > are configured as a system keyboards or mice. An application can obtain a
    > handle to a system keyboard or mouse by not requesting READ or WRITE access
    > with CreateFile. Communications can then use HidD_SetFeature and
    > HidD_GetFeature (assuming the device supports Feature reports).


    I know that for years, but it will not help for the original question
    because i am sure he wants to get the standard position information.
     
    Robert Marquardt, Aug 20, 2004
    #7
  8. Narendra Kulkarni

    Ray Trent Guest

    What do you mean by "for which i have the driver"? If you've written a
    HID filter driver or HID mini-driver, then what you'd typically do is
    have your driver expose a device object as an API and use IOCTLs to
    communication private information such as raw and calibrated positions
    to your user-mode application.

    Narendra Kulkarni wrote:

    > It is a type of HID device(touch screen) for which i have the driver. I am
    > writing an calibration utility as an uiser mode application. I need to get
    > the raw and calibrated X,Y coordinates from the touchscreen. Can anyone give
    > me suggestions in this regard
    >
    > TIA
    > Narendra
    >
    >
    > Can anyone explain how to read and write data from
    > "Bill McKenzie" <> wrote in message
    > news:%...
    >
    >>What type of USB device is this? Very likely you will need to write a
    >>driver for this device in order to access it. A user-mode interface for

    >
    > USB
    >
    >>devices is coming in Longhorn, but isn't available natively in Windows
    >>today. If your device is a HID device, or belongs to a standard class

    >
    > (such
    >
    >>as a disk device) then perhaps there are existing drivers that will

    >
    > suffice.
    >
    >>Otherwise, you will need a driver.
    >>
    >>--
    >>Bill McKenzie
    >>Software Engineer - Prism 802.11 Wireless Solutions
    >>Conexant Systems, Inc.
    >>
    >>
    >>"Narendra Kulkarni" <> wrote in message
    >>news:%...
    >>
    >>>Hi,
    >>>
    >>>I am writing an User Mode program to access an device connected to the

    >
    > USB
    >
    >>>port. How to access it?
    >>>Can we use CreateFile,ReadFile,WriteFile functions to access it?
    >>>
    >>>
    >>>Narendra
    >>>
    >>>

    >>
    >>

    >
    >


    --
    .../ray\..

    Please remove ".spamblock" from my email address if you need to contact
    me outside the newsgroup.
     
    Ray Trent, Aug 23, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary Schnabl

    USB hard drive won't work on a USB 2 port but will on a USB 1.1 port.Why?

    Gary Schnabl, May 24, 2007, in forum: Windows Vista General Discussion
    Replies:
    0
    Views:
    469
    Gary Schnabl
    May 24, 2007
  2. satadru

    How to revert a USB 1.1 port to USB 2.0 port.

    satadru, Sep 10, 2008, in forum: Windows Vista Hardware
    Replies:
    12
    Views:
    395
    Paul Montgomery
    Sep 13, 2008
  3. Adam
    Replies:
    22
    Views:
    1,481
  4. Jackal Huang

    How to access parallel port from user mode program on Win2K/XP?

    Jackal Huang, Jul 22, 2004, in forum: Windows Vista Drivers
    Replies:
    4
    Views:
    346
    Arthur Tu
    Jul 23, 2004
  5. Hapary

    Suspending a USB Port in User Mode

    Hapary, Jul 1, 2007, in forum: Windows Vista Drivers
    Replies:
    2
    Views:
    376
    Doron Holan [MSFT]
    Jul 3, 2007
Loading...

Share This Page