Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > How to access USB port from user mode program on Win2K/XP?

Reply
Thread Tools Display Modes

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

 
 
Narendra Kulkarni
Guest
Posts: n/a

 
      07-22-2004
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


 
Reply With Quote
 
 
 
 
Bill McKenzie
Guest
Posts: n/a

 
      07-22-2004
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
>
>



 
Reply With Quote
 
 
 
 
Narendra Kulkarni
Guest
Posts: n/a

 
      07-22-2004
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
> >
> >

>
>



 
Reply With Quote
 
Jackal Huang
Guest
Posts: n/a

 
      07-22-2004
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
>> >
>> >

>>
>>

>
>
>.
>

 
Reply With Quote
 
Robert Marquardt
Guest
Posts: n/a

 
      07-22-2004
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.

 
Reply With Quote
 
David S Thompson
Guest
Posts: n/a

 
      08-20-2004
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).

 
Reply With Quote
 
Robert Marquardt
Guest
Posts: n/a

 
      08-20-2004
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.
 
Reply With Quote
 
Ray Trent
Guest
Posts: n/a

 
      08-23-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to revert a USB 1.1 port to USB 2.0 port. satadru Windows Vista Hardware 12 09-13-2008 07:53 AM
Suspending a USB Port in User Mode Hapary Windows Vista Drivers 2 07-02-2007 11:53 PM
USB hard drive won't work on a USB 2 port but will on a USB 1.1 port.Why? Gary Schnabl Windows Vista General Discussion 0 05-24-2007 08:29 AM
How to access parallel port from user mode program on Win2K/XP? Jackal Huang Windows Vista Drivers 4 07-23-2004 10:22 AM
I2C through PC parallel port, serial port and/or USB port - please help Adam Windows Vista Drivers 22 06-29-2004 04:48 PM