Re: minidriver for HIDClass by Kim
Kim
Tue Mar 22 09:06:01 CST 2005
I have the book, and have read most of it, including the HID-chapter. And I
understand all your'e saying as well ;)
Anyway.. I'll read it again, hoping to figure it out, or I'll try asking you
again :)
What you were asking about what the name of the device was in the ANHW, it
is simply "unknown". As I said, it seems like HIDCLASS can't figure the out
report-descriptor, and therefore can't let kdbhid be the FDO for it.
That's whats really bugging me, because the reportdescriptor is fine, and
works with everything but mouse and keyboard.
/Kim
"Doron Holan [MS]" <doronh@nospam.microsoft.com> skrev i en meddelelse
news23ETCnnqLFHA.244@TK2MSFTNGP12.phx.gbl...
> HIDclass will act as the FDO for the miniport part. it will then
> enumerate a child (a PDO) for the keyboard part. HIDCLASS will not be the
> FDO for the child stack, kbdhid will be. when the ANHW shows up, what is
> the device name? the name of your FDO or PDO? you should really read
> walter oney's book (2nd edition), things will get much clearer for you.
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "Kim Povlsen" <kim@kimpix.dk> wrote in message
> news:%23GvmNujLFHA.2384@tk2msftngp13.phx.gbl...
>> Okay. But isn't HIDCLASS supposed to enumerate this and together with the
>> minidriver act as a functiondriver driver for my fake device?
>>
>> And another strange thing is this:
>> I use the keyboard report-descriptor from the HID descriptor tool, which
>> is identical to the one MS supplies. If I use that report descriptor and
>> try to install my minidriver, windows promts me with the hardware wizard,
>> I guess because it can't find a class driver to handle this fake device
>> (why doesn't it fint the keyboard hid class?). If I change the
>> report-descriptor from having a keyboard usagepage, to e.g. at
>> gaming-control usagepage, windows doesn't promt with the hardware wizard,
>> and tells me that the hardware has installed correctly. I can't figure
>> that one out!
>>
>> But that's no good to me, as I want to emulate mouse and keyboard ;(
>>
>> Thanks for helping so far! ;-)
>> Regards
>> /Kim
>>
>> "Doron Holan [MS]" <doronh@nospam.microsoft.com> skrev i en meddelelse
>> news:uQv8zJSLFHA.2252@TK2MSFTNGP15.phx.gbl...
>>> each top level collection is reported as a child device, so you will
>>> have to have one for the keyboard to be enumerated. i would suggest
>>> look at the hidfake example in the server 2003 DDK.
>>>
>>> d
>>>
>>> --
>>> Please do not send e-mail directly to this alias. this alias is for
>>> newsgroup purposes only.
>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.
>>>
>>>
>>> "Kim Povlsen" <kim@kimpix.dk> wrote in message
>>> news:ulx8yeJLFHA.2748@TK2MSFTNGP09.phx.gbl...
>>>> Exactly right.
>>>> There is a Child device, yes. But it has no hardware-id. I don't see
>>>> why there should even be a child device? I guess it's the
>>>> ReportDescriptor there is something wrong with?
>>>>
>>>> When I get asked for IOCTL_HID_GET_DEVICE_ATTRIBUTES in my
>>>> dispatchIOCTL routine, I have to return a VendorID, and a ProductID. I
>>>> guess I should just return some dummy values in this case?
>>>>
>>>> And thanks for replying, I really appreciate it ;-)
>>>> /Kim
>>>>
>>>> "Doron Holan [MS]" <doronh@nospam.microsoft.com> skrev i en meddelelse
>>>> news:el7kocELFHA.1172@TK2MSFTNGP12.phx.gbl...
>>>>> open up device manager.
>>>>> view by connection
>>>>> find your device
>>>>>
>>>>> is there a child device from yours? if so, is it started? double
>>>>> click on it and see. if you are using xp sp2, goto the details tab.
>>>>> look under the hardware ids category. is HID_DEVICE_SYSTEM_KEYBOARD
>>>>> listed? you can also get the details tab on earlier OS's with a env
>>>>> var set (search msdn for it).
>>>>>
>>>>> d
>>>>>
>>>>> --
>>>>> Please do not send e-mail directly to this alias. this alias is for
>>>>> newsgroup purposes only.
>>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>>> rights.
>>>>>
>>>>>
>>>>> "Kim Povlsen" <kim@kimpix.dk> wrote in message
>>>>> news:uR4lJL8KFHA.1916@TK2MSFTNGP12.phx.gbl...
>>>>>> Ah sure.. I get your point ;-)
>>>>>>
>>>>>> But windows still doesn't want to use my driver (still pops up the
>>>>>> hardware wizard (it even pops up 2 instances of it??)).
>>>>>>
>>>>>> Is it possible that hidclass doesn't want to use my hidfake driver
>>>>>> for a keyboard minidriver, as it is unsigned?
>>>>>> I use a standard keyboard reportdescriptor. When I use a descriptor
>>>>>> for a different device(generic desktop) than keyboard, mouse or
>>>>>> joystick, it installs alright.
>>>>>>
>>>>>> Thanks for replying!
>>>>>> /Kim
>>>>>>
>>>>>> "Doron Holan [MS]" <doronh@nospam.microsoft.com> skrev i en
>>>>>> meddelelse news:uLw8lO3KFHA.2748@TK2MSFTNGP09.phx.gbl...
>>>>>>> this section
>>>>>>>
>>>>>>> [DeviceList]
>>>>>>> %DESCRIPTION%=DriverInstall,USB\VID_045E&PID_000B,HID_DEVICE_SYSTEM_KEYBOARD
>>>>>>>
>>>>>>> indicates you want to match to a usb enumerated device with the hw
>>>>>>> id of USB\VID_045E&PID_000B. unless such a device is plugged into
>>>>>>> the usb bus, there is no way to match to that ID. create a new id,
>>>>>>> something like ROOT\MyHidFake.
>>>>>>>
>>>>>>> HID_DEVICE_SYSTEM_KEYBOARD is enuemrated by HIDClass for the
>>>>>>> keyboard PDO, you dont need to specify that.
>>>>>>>
>>>>>>> d
>>>>>>>
>>>>>>> --
>>>>>>> Please do not send e-mail directly to this alias. this alias is for
>>>>>>> newsgroup purposes only.
>>>>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>>>>> rights.
>>>>>>>
>>>>>>>
>>>>>>> "Kim Povlsen" <kim@kimpix.dk> wrote in message
>>>>>>> news:OLlTkdwKFHA.1284@TK2MSFTNGP14.phx.gbl...
>>>>>>>> Hi.
>>>>>>>> I'm trying to make a virtual USB HID Keyboard through HIDClass.
>>>>>>>> I'm working out from Walter Oneys HIDFAKE minidriver example.
>>>>>>>> The thing I'm trying to make work is installing the driver, so
>>>>>>>> windows register it as a HID usb keyboard.
>>>>>>>>
>>>>>>>> When the PNP dispatch function in the minidriver gets called, and
>>>>>>>> asks for BusQueryDeviceID, i return USB\\VID_045E&PID_000B.
>>>>>>>>
>>>>>>>> My .inf file looks as follows (the important bits presentet only):
>>>>>>>>
>>>>>>>> ; Fake HID Keyboard
>>>>>>>>
>>>>>>>> [Version]
>>>>>>>> Signature=$Windows NT$
>>>>>>>> Class=HIDClass
>>>>>>>> ClassGuid={745A17A0-74D3-11D0-B6FE-00A0C90F57DA}
>>>>>>>> DriverVer=03/17/2005,1.000
>>>>>>>> CatalogFile=DummyCat.cat
>>>>>>>> Provider=Test
>>>>>>>>
>>>>>>>> ;------------------------------------------------------------------------------
>>>>>>>> ; Standard INF sections
>>>>>>>> ;------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> [Manufacturer]
>>>>>>>> %MFGNAME%=DeviceList
>>>>>>>>
>>>>>>>> [DestinationDirs]
>>>>>>>> DefaultDestDir=10,System32\Drivers
>>>>>>>>
>>>>>>>> [SourceDisksFiles]
>>>>>>>> hidfake.sys=1,objchk~1\i386,
>>>>>>>> wdmstub.sys=1,..\..\..\Append~1\newstub\objchk~1\i386,
>>>>>>>> generic.sys=1,..\..\..\generic\objchk~1\i386,
>>>>>>>> generic.sys=1
>>>>>>>>
>>>>>>>> [SourceDisksNames]
>>>>>>>> 1=%INSTDISK%,,,
>>>>>>>>
>>>>>>>> [DeviceList]
>>>>>>>> %DESCRIPTION%=DriverInstall,USB\VID_045E&PID_000B,HID_DEVICE_SYSTEM_KEYBOARD
>>>>>>>>
>>>>>>>> ;------------------------------------------------------------------------------
>>>>>>>> ; Windows 2000+ Sections
>>>>>>>> ;------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> [DriverInstall.ntx86]
>>>>>>>> CopyFiles=DriverCopyFiles
>>>>>>>>
>>>>>>>> [DriverCopyFiles]
>>>>>>>> hidfake.sys,,,2
>>>>>>>> generic.sys,,,2
>>>>>>>>
>>>>>>>> [DriverInstall.ntx86.Services]
>>>>>>>> AddService=FakeKeyboard,2,DriverService
>>>>>>>>
>>>>>>>> [DriverService]
>>>>>>>> ServiceType=1
>>>>>>>> StartType=3
>>>>>>>> ErrorControl=1
>>>>>>>> ServiceBinary=%10%\system32\drivers\hidfake.sys
>>>>>>>>
>>>>>>>> ...
>>>>>>>>
>>>>>>>> If I try to install the driver through the hardware wizard, it
>>>>>>>> tells me that the the inf file contains no information about my
>>>>>>>> hardware. I know it's because of the ClassGuid, but howcome?
>>>>>>>> And I know I'm doing something else wrong as well.. I would like
>>>>>>>> the kbhid.sys to work as the client hid driver(windows standard hid
>>>>>>>> keyboard driver), and I have this driver working as the minidriver
>>>>>>>> alright. How do I accomplish to do that?
>>>>>>>>
>>>>>>>> (I of course use a standard keyboard ReportDescriptor, if you might
>>>>>>>> wonder about that)
>>>>>>>>
>>>>>>>> Thanks in advance!
>>>>>>>> /Kim P.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>