Driver for USB trackball pls help :-(

Hi

I have to write a driver for USB track ball, i have to change current functionality of trackball.

ie. if i connect a USB mouse and a USB trackball, i can have normal functionality with mouse and extended functionality with track ball.

I am a newbie (I am new to Driver development also), and just read
some thing about WDF and UMDF arch etc.

My specification for USB trackball

  1. It must run on XP 32bit and Vista 32 bit

  2. I need to write driver for a “USB trackball”

I have couple of queries. can any one please help me out?

  1. How do i begin? Is UMDF is ok for writing USB trackball driver?

  2. The WDK sample for UMDF Sample Driver for OSR USB Fx2 Learning Kit (\src\umdf\usb\fx2_driver) is ok for starting?
    Is it must to have a OSR USB Fx2 Learning Kit for writing a USB trackball driver?

  3. Is it possible to debug it using Visual studio?

  4. Can i have line by line debugging as in visual studio (using break points)?

Expecting reply,
bachu

Queries 3 & 4 are both NO, NO WAY, NEVER (I hope).

Take a decent course in driver development.
“bachu” wrote in message news:xxxxx@ntdev…
Hi

I have to write a driver for USB track ball, i have to change current functionality of trackball.

ie. if i connect a USB mouse and a USB trackball, i can have normal functionality with mouse and extended functionality with track ball.

I am a newbie (I am new to Driver development also), and just read
some thing about WDF and UMDF arch etc.

My specification for USB trackball

1) It must run on XP 32bit and Vista 32 bit

2) I need to write driver for a “USB trackball”

I have couple of queries. can any one please help me out?

1) How do i begin? Is UMDF is ok for writing USB trackball driver?

2) The WDK sample for UMDF Sample Driver for OSR USB Fx2 Learning Kit (\src\umdf\usb\fx2_driver) is ok for starting?
Is it must to have a OSR USB Fx2 Learning Kit for writing a USB trackball driver?

3) Is it possible to debug it using Visual studio?

4) Can i have line by line debugging as in visual studio (using break points)?

Expecting reply,
bachu

I’ve never used UMDF, but I thought you could use VS to debug it?

For (4), it depends on what you mean - if you’re looking for point and click, then no, but it sounds like you might just mean single
stepping, which would be a yes.

Good luck,

mm

David Craig wrote:

Queries 3 & 4 are both NO, NO WAY, NEVER (I hope).

Take a decent course in driver development.

“bachu” > wrote in
> message news:xxxxx@ntdev…
> Hi
>
> I have to write a driver for USB track ball, i have to change
> current functionality of trackball.
>
> ie. if i connect a USB mouse and a USB trackball, i can have normal
> functionality with mouse and extended functionality with track ball.
>
> I am a newbie (I am new to Driver development also), and just read
> some thing about WDF and UMDF arch etc.
>
> My specification for USB trackball
>
> 1) It must run on XP 32bit and Vista 32 bit
>
> 2) I need to write driver for a “USB trackball”
>
> I have couple of queries. can any one please help me out?
>
> 1) How do i begin? Is UMDF is ok for writing USB trackball driver?
>
> 2) The WDK sample for UMDF Sample Driver for OSR USB Fx2 Learning
> Kit (\src\umdf\usb\fx2_driver) is ok for starting?
> Is it must to have a OSR USB Fx2 Learning Kit for writing a USB
> trackball driver?
>
> 3) Is it possible to debug it using Visual studio?
>
> 4) Can i have line by line debugging as in visual studio (using
> break points)?
>
> Expecting reply,
> bachu

bachu wrote:

I have to write a driver for USB track ball, i have to change current
functionality of trackball.

ie. if i connect a USB mouse and a USB trackball, i can have normal
functionality with mouse and extended functionality with track ball.

What kind of “extended functionality”? The BEST option for you, by far,
is to let it be a standard USB HID device. That way, you do not need to
write a driver at all. Perhaps your “extended functionality” can be
done in a filter driver, but we’d need to know more about what you need
to do.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Yes, please expand on what “extended functionality” means in terms of features. Do you want to do this for all trackballs? Or just a specific model? Do you want to do this only when there are other mice on the system or anytime a trackball is plugged in?

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, June 10, 2008 10:03 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Driver for USB trackball pls help :frowning:

bachu wrote:

I have to write a driver for USB track ball, i have to change current
functionality of trackball.

ie. if i connect a USB mouse and a USB trackball, i can have normal
functionality with mouse and extended functionality with track ball.

What kind of “extended functionality”? The BEST option for you, by far,
is to let it be a standard USB HID device. That way, you do not need to
write a driver at all. Perhaps your “extended functionality” can be
done in a filter driver, but we’d need to know more about what you need
to do.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

The intention of the driver is to modify the behaviour of a connected usb
trackball in a way that it allows

  1. to move both scrollbars of the currently focused window with the trackball (assign trackball directions north / east / south / west to HSCROLL LEFT/RIGHT, VSCROLL UP/DOWN respectively)
  2. to zoom in and out with the scrollwheel (assign scroll directions up / down to ZOOM IN/OUT)
  3. to assign arbitrary shortcuts to the trackball buttons dependant of the program window
    currently focused
  4. and it should also be possible to change the trackball action speed and wheel action speed.

* The trackball will be used in conjunction with another pointing device (mouse).
* Driver must be independent of trackball model

Is filter driver is ok for me?
Please give me the best way to begin with…
I am now checking the WDK sample for UMDF Sample Driver for OSR USB Fx2 Learning Kit …

Bachu

You do not want a filter, you want to write a function driver that replaces mouhid in the stack. You will want to install a device class other than “pointers and mice” so that mouclass does not load on the stack either. This function driver is actually quite simple, all you do is enable the HID device interface GUID (which is not automatically enabled by hidclass b/c it is a mouse) in the FDO and fwd all creates and IOCTLS and reads and writes down the stack and let HIDClass take care of all the I/O processing.

This driver can easily be either umdf or kmdf (or wdm, but why bother really?).

Drivers do not have a concept of current window or windows messages. What you will need to do is write a complementary application which opens the HID, reads the data and then process the input as needed, converting it into whatever action you want to do. The HID data will be on the pointer usage page and this page has defined usages for x, y, z, wheel and buttons 1-5. This application is where all of the complicated logic lives, not in the driver.

Now, the hard part is that there is no compatible ID reported by the device which says “I am a trackball”. All these trackballs report themselves as mice, which means you cannot write an INF which will automatically target trackballs and ignore non trackball mice. Your user will have to selectively apply the driver to the right device.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, June 10, 2008 9:49 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver for USB trackball pls help :frowning:

The intention of the driver is to modify the behaviour of a connected usb
trackball in a way that it allows

  1. to move both scrollbars of the currently focused window with the trackball (assign trackball directions north / east / south / west to HSCROLL LEFT/RIGHT, VSCROLL UP/DOWN respectively)
  2. to zoom in and out with the scrollwheel (assign scroll directions up / down to ZOOM IN/OUT)
  3. to assign arbitrary shortcuts to the trackball buttons dependant of the program window
    currently focused
  4. and it should also be possible to change the trackball action speed and wheel action speed.

* The trackball will be used in conjunction with another pointing device (mouse).
* Driver must be independent of trackball model

Is filter driver is ok for me?
Please give me the best way to begin with…
I am now checking the WDK sample for UMDF Sample Driver for OSR USB Fx2 Learning Kit …

Bachu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thank you very much for your valuable reply…

  1. Do I need to create new device setup class or use the existing HIDClass?

  2. How to enable the HID device interface GUID in the FDO?
    Is it enough to specify ClassGuid in “INF Version section of a device’s INF file”?

Class = HIDClass
ClassGuid = {745a17a0-74d3-11d0-b6fe-00a0c90f57da}

Hello Holan,
As i read from one of the documentation

I registerded my driver as a HIDMiniDriver using HIDRegisterMinidriver() in its DriverEntry() routine and passing the HID_MINIDRIVER_REGISTRATION structure as an argument. The Hidclass driver (hidclass.sys) takes charge and all subsequent system calls to the minidriver first get handled by the Hidclass driver.

Now i have to communicate with HID minidriver from an HID client to parse the HID descriptor.

Whether i am in a correct path?

Expecting reply

bachu

You are too low level in the stack. You want the in box std HID minidriver. You want to write a HID *client* driver that is attached to a HID enumerated PDO. Like I told you previously (I can’t remember if it was here or in the newsgroups), all you need to write is a very simple filter driver that enables the HID device interface and then forwards all creates/cleanup/closes/ioctls/reads/writes down the stack and the HID stack will do *all* of the work for you. Then your app can read the standard HID data and transform it into whatever you want.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, June 16, 2008 4:11 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver for USB trackball pls help :frowning:

Hello Holan,
As i read from one of the documentation

I registerded my driver as a HIDMiniDriver using HIDRegisterMinidriver() in its DriverEntry() routine and passing the HID_MINIDRIVER_REGISTRATION structure as an argument. The Hidclass driver (hidclass.sys) takes charge and all subsequent system calls to the minidriver first get handled by the Hidclass driver.

Now i have to communicate with HID minidriver from an HID client to parse the HID descriptor.

Whether i am in a correct path?

Expecting reply

bachu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hello Holan,

Thanks for your reply…

According one of your post in this thread you told me i need is a function driver (not a filter driver) which enables the HID device interface GUID in the FDO and fwd all creates and IOCTLS and reads and writes down the stack and let HIDClass take care of all the I/O processing.

As you said in the last post i started with a filter driver which enabled GUID_DEVCLASS_HIDCLASS.

I used the sample \src\umdf\usb\filter (as UMDF driver seems easier to understand compared to KMDF)

HRESULT
TrackballDevice::Initialize(
__in IWDFDriver * FxDriver,
__in IWDFDeviceInitialize * FxDeviceInit
)
{
IWDFDevice *fxDevice = NULL;

HRESULT hr = S_OK;
FxDeviceInit->SetLockingConstraint(None);
FxDeviceInit->SetFilter();
FxDeviceInit->SetPowerPolicyOwnership(FALSE);

if (SUCCEEDED(hr))
{
IUnknown *unknown = this->QueryIUnknown();
hr = FxDriver->CreateDevice(FxDeviceInit, unknown, &fxDevice);
unknown->Release();
}

if (SUCCEEDED(hr))
{
m_FxDevice = fxDevice;
fxDevice->Release();
}
return hr;
}

HRESULT
TrackballDevice::Configure(
VOID
)
{
PCMyQueue defaultQueue;
HRESULT hr;
hr = CMyQueue::CreateInstance(m_FxDevice, &defaultQueue);
if (FAILED(hr))
{
return hr;
}

hr = defaultQueue->Configure();
defaultQueue->Release();
if (SUCCEEDED(hr))
{
hr = m_FxDevice->CreateDeviceInterface(&GUID_DEVCLASS_HIDCLASS,
NULL);
}
return hr;
}

And forwarded all requests using

CMyQueue::OnDefaultIoHandler(
__in IWDFIoQueue* FxQueue,
__in IWDFIoRequest* FxRequest
)
{
ForwardRequest(FxRequest);
}

Is a filter driver is ok for me? As you said now HIDClass will take care of all the I/O processing, right?

Now I have to write an application which opens the HID descriptor, reads the data and then process the input, right?

Expecting Reply
Bachu

Yes, a filter should be fine. You also need to fwd creates / cleanup /closes down the stack by calling FxDeviceInit->AutoForwardCreateCleanupClose(WdfTrue). Note that reads/writes may fail b/c hidclass sets the device object Flags field for direct io during pnp start irp handling and the UMDF reflector driver does not reflect this change in current releases (should be fixed in the next version). In the end, the code you have below can be rewritten in KMDF rather quickly if UMDF cannot reflect the io type properly…

d

(and Holan is my last name, Doron is usually what people call me ;P)

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, June 17, 2008 1:40 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver for USB trackball pls help :frowning:

Hello Holan,

Thanks for your reply…

According one of your post in this thread you told me i need is a function driver (not a filter driver) which enables the HID device interface GUID in the FDO and fwd all creates and IOCTLS and reads and writes down the stack and let HIDClass take care of all the I/O processing.

As you said in the last post i started with a filter driver which enabled GUID_DEVCLASS_HIDCLASS.

I used the sample \src\umdf\usb\filter (as UMDF driver seems easier to understand compared to KMDF)

HRESULT
TrackballDevice::Initialize(
__in IWDFDriver * FxDriver,
__in IWDFDeviceInitialize * FxDeviceInit
)
{
IWDFDevice *fxDevice = NULL;

HRESULT hr = S_OK;
FxDeviceInit->SetLockingConstraint(None);
FxDeviceInit->SetFilter();
FxDeviceInit->SetPowerPolicyOwnership(FALSE);

if (SUCCEEDED(hr))
{
IUnknown *unknown = this->QueryIUnknown();
hr = FxDriver->CreateDevice(FxDeviceInit, unknown, &fxDevice);
unknown->Release();
}

if (SUCCEEDED(hr))
{
m_FxDevice = fxDevice;
fxDevice->Release();
}
return hr;
}

HRESULT
TrackballDevice::Configure(
VOID
)
{
PCMyQueue defaultQueue;
HRESULT hr;
hr = CMyQueue::CreateInstance(m_FxDevice, &defaultQueue);
if (FAILED(hr))
{
return hr;
}

hr = defaultQueue->Configure();
defaultQueue->Release();
if (SUCCEEDED(hr))
{
hr = m_FxDevice->CreateDeviceInterface(&GUID_DEVCLASS_HIDCLASS,
NULL);
}
return hr;
}

And forwarded all requests using

CMyQueue::OnDefaultIoHandler(
__in IWDFIoQueue* FxQueue,
__in IWDFIoRequest* FxRequest
)
{
ForwardRequest(FxRequest);
}

Is a filter driver is ok for me? As you said now HIDClass will take care of all the I/O processing, right?

Now I have to write an application which opens the HID descriptor, reads the data and then process the input, right?

Expecting Reply
Bachu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hello Doron ,

( Sorry to call your last name. :slight_smile: )

As information that I have from you I created a HIDClass USB filter driver for trackball. I do not have a trackball to give its hardware id . So I used a temp id for it. (Is it ok?)

[Microsoft.NTx86]
%Trackball%=Trackball_Install,HID\Vid_xxxx&Pid_yyyy

I tried to install my trackball driver using following INF file. Every thing went smooth
* the device node created
* the lower filter is found in Details->Device Lower Filters
* Only one service is found in the Details->service section WUDFRd

But driver do not get started.

The device status section in device manager showed an error :- “This device cannot start. (Code 10)”

I just edited the skeleton INF file to create this. Is there any special tags to be added for a filter driver?

NB: I tried with Windows XP
//////////////////////////////
Errors:
Line 41: (E22.1.1002) Unable to include WINUSB.INF. Note that only system provided INFs may be specified with the INCLUDE directive.

Warnings:
Line 21: (W22.1.2077) System defined classes should usually not specify a class installer.
Line 51: (W22.1.2083) Section [STOLLTRACKBALL_INSTALL.NT.WDF] not referenced
Line 61: (W22.1.2083) Section [WINUSB_INSTALL] not referenced
Line 64: (W22.1.2083) Section [WUDFSTOLLTRACKBALL_INSTALL] not referenced

Annotated INF - Output from ChkInf

; (W22.1.9998) NOTE: The ChkInf tool does not verify the WDF sections and directives of the INF file.
; (W22.1.2212) No Copyright information found.
;
; STOLLTrackball.inf
;

[Version]
Signature=“$Windows NT$”
Class=HIDClass
ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Provider=%MSFTUMDF%
DriverVer=06/17/2008,6.0.6001.18000
CatalogFile=WUDF.cat

[Manufacturer]
%MSFTUMDF%=Microsoft,NTx86

[Microsoft.NTx86]
%STOLLTrackball%=STOLLTrackball_Install,HID\Vid_xxxx&Pid_yyyy

[ClassInstall32]
; (W22.1.2077) System defined classes should usually not specify a class installer.
AddReg=STOLLTrackballClass_RegistryAdd

[STOLLTrackballClass_RegistryAdd]
HKR,%ClassName%
HKR,Icon,“-10”

[SourceDisksFiles]
STOLLTrackball.dll=1
WudfUpdate_01007.dll=1
WdfCoInstaller01007.dll=1
WinUsbCoinstaller.dll=1

[SourceDisksNames]
1 = %MediaDescription%

; =================== STOLL Trackball Device ==================================

[STOLLTrackball_Install.NT]
CopyFiles=UMDriverCopy
Include=WINUSB.INF ; Import sections from WINUSB.INF
; (E22.1.1002) Unable to include WINUSB.INF. Note that only system provided INFs may be specified with the INCLUDE directive.
Needs=WINUSB.NT ; Run the CopyFiles & AddReg directives for WinUsb.INF

[STOLLTrackball_Install.NT.hw]
AddReg=STOLLTrackball_Device_AddReg

[STOLLTrackball_Install.NT.Services]
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall
AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall ; this service is installed because its a filter.

[STOLLTrackball_Install.NT.Wdf]
; (W22.1.2083) Section [STOLLTRACKBALL_INSTALL.NT.WDF] not referenced
KmdfService=WINUSB, WinUsb_Install
UmdfDispatcher=WinUsb
UmdfService=WUDFSTOLLTrackball,WUDFSTOLLTrackball_Install
UmdfServiceOrder=WUDFSTOLLTrackball

[STOLLTrackball_Install.NT.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[WinUsb_Install]
; (W22.1.2083) Section [WINUSB_INSTALL] not referenced
KmdfLibraryVersion = 1.7

[WUDFSTOLLTrackball_Install]
; (W22.1.2083) Section [WUDFSTOLLTRACKBALL_INSTALL] not referenced
UmdfLibraryVersion=1.7.0
DriverCLSID = “{f7e408d9-e950-474b-adc3-74f99335b4e1}”
ServiceBinary= “%12%\UMDF\STOLLTrackball.dll”

[STOLLTrackball_Device_AddReg]
HKR,“LowerFilters”,0x00010008,“WinUsb” ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND

[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys
LoadOrderGroup = Base

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[CoInstallers_AddReg]
HKR,CoInstallers32,0x00010000,“WudfUpdate_01007.dll”, “WinUsbCoinstaller.dll”, “WdfCoInstaller01007.dll,WdfCoInstaller”
[CoInstallers_CopyFiles]
WudfUpdate_01007.dll
WdfCoInstaller01007.dll
WinUsbCoinstaller.dll

[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to driversMdf
CoInstallers_CopyFiles=11

[UMDriverCopy]
STOLLTrackball.dll

; =================== Generic ==================================

[Strings]
MSFTUMDF=“STOLL”
MediaDescription=“STOLL Trackball Driver Installation Media”
ClassName=“STOLL Trackball”
WudfRdDisplayName=“Windows Driver Foundation - User-mode Driver Framework Reflector”
STOLLTrackball=“STOLL Trackball Device”
WinUsb_SvcDesc=“WinUSB Driver”

Expecting Reply
Bachu

Attach a debugger to your UM driver host process and set a bunch of breakpoints, AddDevice and D0Entry (if you registered it) and see how far you are getting in your code…

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, June 17, 2008 5:15 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver for USB trackball pls help :frowning:

Hello Doron ,

( Sorry to call your last name. :slight_smile: )

As information that I have from you I created a HIDClass USB filter driver for trackball. I do not have a trackball to give its hardware id . So I used a temp id for it. (Is it ok?)

[Microsoft.NTx86]
%Trackball%=Trackball_Install,HID\Vid_xxxx&Pid_yyyy

I tried to install my trackball driver using following INF file. Every thing went smooth
* the device node created
* the lower filter is found in Details->Device Lower Filters
* Only one service is found in the Details->service section WUDFRd

But driver do not get started.

The device status section in device manager showed an error :- “This device cannot start. (Code 10)”

I just edited the skeleton INF file to create this. Is there any special tags to be added for a filter driver?

NB: I tried with Windows XP
//////////////////////////////
Errors:
Line 41: (E22.1.1002) Unable to include WINUSB.INF. Note that only system provided INFs may be specified with the INCLUDE directive.

Warnings:
Line 21: (W22.1.2077) System defined classes should usually not specify a class installer.
Line 51: (W22.1.2083) Section [STOLLTRACKBALL_INSTALL.NT.WDF] not referenced
Line 61: (W22.1.2083) Section [WINUSB_INSTALL] not referenced
Line 64: (W22.1.2083) Section [WUDFSTOLLTRACKBALL_INSTALL] not referenced

Annotated INF - Output from ChkInf

; (W22.1.9998) NOTE: The ChkInf tool does not verify the WDF sections and directives of the INF file.
; (W22.1.2212) No Copyright information found.
;
; STOLLTrackball.inf
;

[Version]
Signature=“$Windows NT$”
Class=HIDClass
ClassGuid={745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Provider=%MSFTUMDF%
DriverVer=06/17/2008,6.0.6001.18000
CatalogFile=WUDF.cat

[Manufacturer]
%MSFTUMDF%=Microsoft,NTx86

[Microsoft.NTx86]
%STOLLTrackball%=STOLLTrackball_Install,HID\Vid_xxxx&Pid_yyyy

[ClassInstall32]
; (W22.1.2077) System defined classes should usually not specify a class installer.
AddReg=STOLLTrackballClass_RegistryAdd

[STOLLTrackballClass_RegistryAdd]
HKR,%ClassName%
HKR,Icon,“-10”

[SourceDisksFiles]
STOLLTrackball.dll=1
WudfUpdate_01007.dll=1
WdfCoInstaller01007.dll=1
WinUsbCoinstaller.dll=1

[SourceDisksNames]
1 = %MediaDescription%

; =================== STOLL Trackball Device ==================================

[STOLLTrackball_Install.NT]
CopyFiles=UMDriverCopy
Include=WINUSB.INF ; Import sections from WINUSB.INF
; (E22.1.1002) Unable to include WINUSB.INF. Note that only system provided INFs may be specified with the INCLUDE directive.
Needs=WINUSB.NT ; Run the CopyFiles & AddReg directives for WinUsb.INF

[STOLLTrackball_Install.NT.hw]
AddReg=STOLLTrackball_Device_AddReg

[STOLLTrackball_Install.NT.Services]
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall
AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall ; this service is installed because its a filter.

[STOLLTrackball_Install.NT.Wdf]
; (W22.1.2083) Section [STOLLTRACKBALL_INSTALL.NT.WDF] not referenced
KmdfService=WINUSB, WinUsb_Install
UmdfDispatcher=WinUsb
UmdfService=WUDFSTOLLTrackball,WUDFSTOLLTrackball_Install
UmdfServiceOrder=WUDFSTOLLTrackball

[STOLLTrackball_Install.NT.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[WinUsb_Install]
; (W22.1.2083) Section [WINUSB_INSTALL] not referenced
KmdfLibraryVersion = 1.7

[WUDFSTOLLTrackball_Install]
; (W22.1.2083) Section [WUDFSTOLLTRACKBALL_INSTALL] not referenced
UmdfLibraryVersion=1.7.0
DriverCLSID = “{f7e408d9-e950-474b-adc3-74f99335b4e1}”
ServiceBinary= “%12%\UMDF\STOLLTrackball.dll”

[STOLLTrackball_Device_AddReg]
HKR,“LowerFilters”,0x00010008,“WinUsb” ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND

[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys
LoadOrderGroup = Base

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[CoInstallers_AddReg]
HKR,CoInstallers32,0x00010000,“WudfUpdate_01007.dll”, “WinUsbCoinstaller.dll”, “WdfCoInstaller01007.dll,WdfCoInstaller”
[CoInstallers_CopyFiles]
WudfUpdate_01007.dll
WdfCoInstaller01007.dll
WinUsbCoinstaller.dll

[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to driversMdf
CoInstallers_CopyFiles=11

[UMDriverCopy]
STOLLTrackball.dll

; =================== Generic ==================================

[Strings]
MSFTUMDF=“STOLL”
MediaDescription=“STOLL Trackball Driver Installation Media”
ClassName=“STOLL Trackball”
WudfRdDisplayName=“Windows Driver Foundation - User-mode Driver Framework Reflector”
STOLLTrackball=“STOLL Trackball Device”
WinUsb_SvcDesc=“WinUSB Driver”

Expecting Reply
Bachu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hello Doron,

I Attached windbg to my UMDF host process (WudfHost.exe) and I set a some of breakpoints in all functions……

Below given is the main content of command window of windbg.

*** wait with pending attach
Symbol search path is: C:\WINXP\Symbols;SRV*c:\symbols*http://msdl.microsoft.com/download/symbols;C:\symbols;SRV\*e:\DebugSymbols\*http://msdl.microsoft.com/download/symbols
Executable search path is:
ModLoad: 01000000 01025000 C:\WINXP\System32\wudfhost.exe
ModLoad: 7c900000 7c9b0000 C:\WINXP\system32\ntdll.dll
ModLoad: 7c800000 7c8f5000 C:\WINXP\system32\kernel32.dll
ModLoad: 77dd0000 77e6b000 C:\WINXP\system32\ADVAPI32.dll
ModLoad: 77e70000 77f01000 C:\WINXP\system32\RPCRT4.dll
ModLoad: 77c10000 77c68000 C:\WINXP\system32\msvcrt.dll
ModLoad: 774e0000 7761d000 C:\WINXP\system32\ole32.dll
ModLoad: 77f10000 77f57000 C:\WINXP\system32\GDI32.dll
ModLoad: 77d40000 77dd0000 C:\WINXP\system32\USER32.dll
ModLoad: 00400000 0042b000 C:\WINXP\System32\WUDFPlatform.dll
ModLoad: 77c00000 77c08000 C:\WINXP\system32\VERSION.dll
ModLoad: 76390000 763ad000 C:\WINXP\system32\IMM32.DLL
ModLoad: 77920000 77a13000 C:\WINXP\System32\SETUPAPI.dll
ModLoad: 76c30000 76c5e000 C:\WINXP\system32\WINTRUST.dll
ModLoad: 77a80000 77b14000 C:\WINXP\system32\CRYPT32.dll
ModLoad: 77b20000 77b32000 C:\WINXP\system32\MSASN1.dll
ModLoad: 76c90000 76cb8000 C:\WINXP\system32\IMAGEHLP.dll
ModLoad: 1ed80000 1ed87000 C:\WINXP\System32\WINUSB.DLL
ModLoad: 1a8e0000 1a92e000 C:\WINXP\System32\WUDFx.dll
ModLoad: 77120000 771ac000 C:\WINXP\system32\OLEAUT32.dll
ModLoad: 008a0000 008a7000 C:\WINXP\system32\drivers\UMDF\Trackball.dll
Breakpoint 0 hit
Trackball!TrackballDriver::CreateInstance+0x4d:
Trackball!TrackballDriver::QueryInterface+0x24:
Breakpoint 2 hit
Trackball!TrackballDevice::CreateInstance+0x35:
Breakpoint 3 hit
Trackball!TrackballDevice::Initialize+0x19:
Breakpoint 4 hit
Trackball!TrackballDevice::Initialize+0x99:
Breakpoint 5 hit
Trackball!TrackballDevice::CreateInstance+0x55:
Breakpoint 6 hit
Trackball!TrackballDevice::CreateInstance+0x5b:
Breakpoint 7 hit
Trackball!TrackballDriver::OnDeviceAdd+0x29:
Trackball!TrackballDevice::Configure:
Breakpoint 8 hit
Trackball!TrackballDevice::Configure+0xb:
Breakpoint 9 hit
Trackball!TrackballDevice::Configure+0x29:
Trackball!TrackballDevice::Configure+0x34:
Breakpoint 10 hit
Trackball!TrackballDriver::OnDeviceAdd+0x31:
Trackball!TrackballDriver::OnDeviceAdd+0x34:
WUDFx!CWdfDriver::OnAddDevice+0x56d:
WUDFx!CWdfDriver::OnAddDevice+0x56f:
WUDFx!CWdfDriver::OnAddDevice+0x575:
wudfhost!CWudfDeviceStack::LoadDrivers+0x165:
wudfhost!CWudfDeviceStack::LoadDrivers+0x168:
wudfhost!CLpcNotification::Message+0x18a:
WUDFPlatform!WdfLpcPort::ProcessMessage+0x308:
WUDFPlatform!WdfLpcConnPort::ProcessMessage+0xe9:
WUDFPlatform!WdfLpc::WorkerThread+0xcc:
Unable to insert breakpoint 10 at 008a1de9, Win32 error 0n299
“Only part of a ReadProcessMemory or WriteProcessMemory request was completed.”
bp10 at 008a1de9 failed
WaitForEvent failed
ntdll!KiFastSystemCallRet:
7c90eb94 c3 ret

In b/w when I tried to checkk the INF file using chkinf I get the error “Unable to include WINUSB.INF. Note that only system provided INFs may be specified with the INCLUDE directive.”

I think some problem in winusb kernal driver installation.
I am using Windows XP. Is there any problem in it?

bachu

You do not need to reference winusb at all, the HID usb miniport will talk to usb. You just talk to the HID driver using HID APIs

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, June 17, 2008 10:08 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver for USB trackball pls help :frowning:

Hello Doron,

I Attached windbg to my UMDF host process (WudfHost.exe) and I set a some of breakpoints in all functions…

Below given is the main content of command window of windbg.

*** wait with pending attach
Symbol search path is: C:\WINXP\Symbols;SRV*c:\symbols*http://msdl.microsoft.com/download/symbols;C:\symbols;SRV\*e:\DebugSymbols\*http://msdl.microsoft.com/download/symbols
Executable search path is:
ModLoad: 01000000 01025000 C:\WINXP\System32\wudfhost.exe
ModLoad: 7c900000 7c9b0000 C:\WINXP\system32\ntdll.dll
ModLoad: 7c800000 7c8f5000 C:\WINXP\system32\kernel32.dll
ModLoad: 77dd0000 77e6b000 C:\WINXP\system32\ADVAPI32.dll
ModLoad: 77e70000 77f01000 C:\WINXP\system32\RPCRT4.dll
ModLoad: 77c10000 77c68000 C:\WINXP\system32\msvcrt.dll
ModLoad: 774e0000 7761d000 C:\WINXP\system32\ole32.dll
ModLoad: 77f10000 77f57000 C:\WINXP\system32\GDI32.dll
ModLoad: 77d40000 77dd0000 C:\WINXP\system32\USER32.dll
ModLoad: 00400000 0042b000 C:\WINXP\System32\WUDFPlatform.dll
ModLoad: 77c00000 77c08000 C:\WINXP\system32\VERSION.dll
ModLoad: 76390000 763ad000 C:\WINXP\system32\IMM32.DLL
ModLoad: 77920000 77a13000 C:\WINXP\System32\SETUPAPI.dll
ModLoad: 76c30000 76c5e000 C:\WINXP\system32\WINTRUST.dll
ModLoad: 77a80000 77b14000 C:\WINXP\system32\CRYPT32.dll
ModLoad: 77b20000 77b32000 C:\WINXP\system32\MSASN1.dll
ModLoad: 76c90000 76cb8000 C:\WINXP\system32\IMAGEHLP.dll
ModLoad: 1ed80000 1ed87000 C:\WINXP\System32\WINUSB.DLL
ModLoad: 1a8e0000 1a92e000 C:\WINXP\System32\WUDFx.dll
ModLoad: 77120000 771ac000 C:\WINXP\system32\OLEAUT32.dll
ModLoad: 008a0000 008a7000 C:\WINXP\system32\drivers\UMDF\Trackball.dll
Breakpoint 0 hit
Trackball!TrackballDriver::CreateInstance+0x4d:
Trackball!TrackballDriver::QueryInterface+0x24:
Breakpoint 2 hit
Trackball!TrackballDevice::CreateInstance+0x35:
Breakpoint 3 hit
Trackball!TrackballDevice::Initialize+0x19:
Breakpoint 4 hit
Trackball!TrackballDevice::Initialize+0x99:
Breakpoint 5 hit
Trackball!TrackballDevice::CreateInstance+0x55:
Breakpoint 6 hit
Trackball!TrackballDevice::CreateInstance+0x5b:
Breakpoint 7 hit
Trackball!TrackballDriver::OnDeviceAdd+0x29:
Trackball!TrackballDevice::Configure:
Breakpoint 8 hit
Trackball!TrackballDevice::Configure+0xb:
Breakpoint 9 hit
Trackball!TrackballDevice::Configure+0x29:
Trackball!TrackballDevice::Configure+0x34:
Breakpoint 10 hit
Trackball!TrackballDriver::OnDeviceAdd+0x31:
Trackball!TrackballDriver::OnDeviceAdd+0x34:
WUDFx!CWdfDriver::OnAddDevice+0x56d:
WUDFx!CWdfDriver::OnAddDevice+0x56f:
WUDFx!CWdfDriver::OnAddDevice+0x575:
wudfhost!CWudfDeviceStack::LoadDrivers+0x165:
wudfhost!CWudfDeviceStack::LoadDrivers+0x168:
wudfhost!CLpcNotification::Message+0x18a:
WUDFPlatform!WdfLpcPort::ProcessMessage+0x308:
WUDFPlatform!WdfLpcConnPort::ProcessMessage+0xe9:
WUDFPlatform!WdfLpc::WorkerThread+0xcc:
Unable to insert breakpoint 10 at 008a1de9, Win32 error 0n299
“Only part of a ReadProcessMemory or WriteProcessMemory request was completed.”
bp10 at 008a1de9 failed
WaitForEvent failed
ntdll!KiFastSystemCallRet:
7c90eb94 c3 ret

In b/w when I tried to checkk the INF file using chkinf I get the error “Unable to include WINUSB.INF. Note that only system provided INFs may be specified with the INCLUDE directive.”

I think some problem in winusb kernal driver installation.
I am using Windows XP. Is there any problem in it?

bachu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hello Doron,
Yes its ok now. :slight_smile:

Now HIDClass USB filter driver is installed and now will HIDClass take care of all the I/O processing. Windbg now shows no error. :slight_smile:

I left is to specify the hardware id of Trackball in the INF. Now it is HID\Vid_xxxx&Pid_yyyy. As soon as I am available with a Trackball I will do it.

Now I have to write a complementary application which reads the HID data to process the input as needed. For that I have to use windows HID API’s to get the information on the HID descriptors. Right?

Is it ok to use VC++ to do the complementary application?

Expecting Reply
Bachu

Yes, you can use VC++ to write the app.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, June 18, 2008 4:06 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Driver for USB trackball pls help :frowning:

Hello Doron,
Yes its ok now. :slight_smile:

Now HIDClass USB filter driver is installed and now will HIDClass take care of all the I/O processing. Windbg now shows no error. :slight_smile:

I left is to specify the hardware id of Trackball in the INF. Now it is HID\Vid_xxxx&Pid_yyyy. As soon as I am available with a Trackball I will do it.

Now I have to write a complementary application which reads the HID data to process the input as needed. For that I have to use windows HID API’s to get the information on the HID descriptors. Right?

Is it ok to use VC++ to do the complementary application?

Expecting Reply
Bachu


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer