Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Virtual HID (keyboard and mouse) driver

Reply
Thread Tools Display Modes

Virtual HID (keyboard and mouse) driver

 
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-01-2009
Hello,

I wish to develop 2 drivers. One will act as a virtual keyboard and the
other as a virtual mouse.

Can I start from the vhidmini sample? (src\hid\vhidmini -- it's not
available in the lastest WDK, but it's in 6001.18002). From my understanding
this is a miniclass driver that should work with kbdclass and mouclass, the
class drivers for keyboards and mice. Basically all I would need is to
generate IRPs for the class drivers to process, right?

I never worked with HID, from my understanding HID drivers don't get IOCTLs,
that's why, if you need to comunicate with the driver, you need to do it some
other way. The vhidmini sample implements such a way. Also, never working
with HID, I don't really know what/how to generate the IRPs.

One thing I don't understand is how such a driver would work with multiple
sessions.

Thanks in advance for any resources and documentation!

--
Aram Hăvărneanu
 
Reply With Quote
 
 
 
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-04-2009
I decided to start from the vhidmini sample but I can't install it on Windows
7 32 bit.

Y:\ws\kernel\vhidmini>devcon install vhidmini.inf
"{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE"
Device node created. Install is complete when drivers are updated...
Updating drivers for devcon failed.

I checked the logs at:

%windir%\setupapi.log
%windir%\setupact.log
%windir%\setuperr.log
%windir%\inf\setupapi.app.log
%windir%\inf\setupapi.dev.log

and I have found this in %windir%\inf\setupapi.dev.log

>>> [Device Install (UpdateDriverForPlugAndPlayDevices) - “{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE”]
>>> Section start 2009/12/04 15:23:58.556

cmd: devcon install vhidmini.inf
“{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE”
dvi: Set selected driver complete.
dvi: {Build Driver List} 15:23:58.618
dvi: Searching for hardware ID(s):
dvi: “{d49f883c-6486-400a-8c22-1a9ef48577e4}\hid_device”
cpy: Policy is set to make all digital signatures equal.
dvi: Processing a single INF: 'y:\ws\kernel\vhidmini\vhidmini.inf'
inf: Opened INF: 'y:\ws\kernel\vhidmini\vhidmini.inf' ([strings])
dvi: {Build Driver List - exit(0x00000000)} 15:23:58.618
dvi: {DIF_SELECTBESTCOMPATDRV} 15:23:58.618
dvi: No class installer for 'Human Interface Devices'
dvi: No CoInstallers found
dvi: Default installer: Enter 15:23:58.618
dvi: {Select Best Driver}
! dvi: Selecting driver failed(0xe0000228)
dvi: {Select Best Driver - exit(0xe0000228)}
! dvi: Default installer: failed!
! dvi: Error 0xe0000228: There are no compatible drivers for this
device.
dvi: {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 15:23:58.634
<<< Section end 2009/12/04 15:23:58.634
<<< [Exit status: SUCCESS]

What am I missing?

Thanks,

--
Aram Hăvărneanu


"Aram Hăvărneanu" wrote:

> Hello,
>
> I wish to develop 2 drivers. One will act as a virtual keyboard and the
> other as a virtual mouse.
>
> Can I start from the vhidmini sample? (src\hid\vhidmini -- it's not
> available in the lastest WDK, but it's in 6001.18002). From my understanding
> this is a miniclass driver that should work with kbdclass and mouclass, the
> class drivers for keyboards and mice. Basically all I would need is to
> generate IRPs for the class drivers to process, right?
>
> I never worked with HID, from my understanding HID drivers don't get IOCTLs,
> that's why, if you need to comunicate with the driver, you need to do it some
> other way. The vhidmini sample implements such a way. Also, never working
> with HID, I don't really know what/how to generate the IRPs.
>
> One thing I don't understand is how such a driver would work with multiple
> sessions.
>
> Thanks in advance for any resources and documentation!
>
> --
> Aram Hăvărneanu

 
Reply With Quote
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-04-2009
I have also tried to start it with sc.exe. I have created a service with sc
create TestSrv type= kernel binPath= \path\to\vhidmini.sys and start the
service with sc start TestSrv but it fails with:

[SC] StartService FAILED 1058:

The service cannot be started, either because it is disabled or because
it has n
o enabled devices associated with it.

--
Aram Hăvărneanu


"Aram Hăvărneanu" wrote:

> I decided to start from the vhidmini sample but I can't install it on Windows
> 7 32 bit.
>
> Y:\ws\kernel\vhidmini>devcon install vhidmini.inf
> "{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE"
> Device node created. Install is complete when drivers are updated...
> Updating drivers for devcon failed.
>
> I checked the logs at:
>
> %windir%\setupapi.log
> %windir%\setupact.log
> %windir%\setuperr.log
> %windir%\inf\setupapi.app.log
> %windir%\inf\setupapi.dev.log
>
> and I have found this in %windir%\inf\setupapi.dev.log
>
> >>> [Device Install (UpdateDriverForPlugAndPlayDevices) - “{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE”]
> >>> Section start 2009/12/04 15:23:58.556

> cmd: devcon install vhidmini.inf
> “{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE”
> dvi: Set selected driver complete.
> dvi: {Build Driver List} 15:23:58.618
> dvi: Searching for hardware ID(s):
> dvi: “{d49f883c-6486-400a-8c22-1a9ef48577e4}\hid_device”
> cpy: Policy is set to make all digital signatures equal.
> dvi: Processing a single INF: 'y:\ws\kernel\vhidmini\vhidmini.inf'
> inf: Opened INF: 'y:\ws\kernel\vhidmini\vhidmini.inf' ([strings])
> dvi: {Build Driver List - exit(0x00000000)} 15:23:58.618
> dvi: {DIF_SELECTBESTCOMPATDRV} 15:23:58.618
> dvi: No class installer for 'Human Interface Devices'
> dvi: No CoInstallers found
> dvi: Default installer: Enter 15:23:58.618
> dvi: {Select Best Driver}
> ! dvi: Selecting driver failed(0xe0000228)
> dvi: {Select Best Driver - exit(0xe0000228)}
> ! dvi: Default installer: failed!
> ! dvi: Error 0xe0000228: There are no compatible drivers for this
> device.
> dvi: {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 15:23:58.634
> <<< Section end 2009/12/04 15:23:58.634
> <<< [Exit status: SUCCESS]
>
> What am I missing?
>
> Thanks,
>
> --
> Aram Hăvărneanu
>
>
> "Aram Hăvărneanu" wrote:
>
> > Hello,
> >
> > I wish to develop 2 drivers. One will act as a virtual keyboard and the
> > other as a virtual mouse.
> >
> > Can I start from the vhidmini sample? (src\hid\vhidmini -- it's not
> > available in the lastest WDK, but it's in 6001.18002). From my understanding
> > this is a miniclass driver that should work with kbdclass and mouclass, the
> > class drivers for keyboards and mice. Basically all I would need is to
> > generate IRPs for the class drivers to process, right?
> >
> > I never worked with HID, from my understanding HID drivers don't get IOCTLs,
> > that's why, if you need to comunicate with the driver, you need to do it some
> > other way. The vhidmini sample implements such a way. Also, never working
> > with HID, I don't really know what/how to generate the IRPs.
> >
> > One thing I don't understand is how such a driver would work with multiple
> > sessions.
> >
> > Thanks in advance for any resources and documentation!
> >
> > --
> > Aram Hăvărneanu

 
Reply With Quote
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-04-2009
Btw, I could install the driver with the aid of the Toaster sample (as it's
documented in the sample Readme), however, for my application I'd like to
load and unload the driver at runtime, as needed, using the the Service
Control Manager APIs.

So why are devcon.exe, sc.exe, and the Service Control Manager APIs failing?

--
Aram Hăvărneanu


"Aram Hăvărneanu" wrote:

> I have also tried to start it with sc.exe. I have created a service with sc
> create TestSrv type= kernel binPath= \path\to\vhidmini.sys and start the
> service with sc start TestSrv but it fails with:
>
> [SC] StartService FAILED 1058:
>
> The service cannot be started, either because it is disabled or because
> it has n
> o enabled devices associated with it.
>
> --
> Aram Hăvărneanu
>
>
> "Aram Hăvărneanu" wrote:
>
> > I decided to start from the vhidmini sample but I can't install it on Windows
> > 7 32 bit.
> >
> > Y:\ws\kernel\vhidmini>devcon install vhidmini.inf
> > "{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE"
> > Device node created. Install is complete when drivers are updated...
> > Updating drivers for devcon failed.
> >
> > I checked the logs at:
> >
> > %windir%\setupapi.log
> > %windir%\setupact.log
> > %windir%\setuperr.log
> > %windir%\inf\setupapi.app.log
> > %windir%\inf\setupapi.dev.log
> >
> > and I have found this in %windir%\inf\setupapi.dev.log
> >
> > >>> [Device Install (UpdateDriverForPlugAndPlayDevices) - “{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE”]
> > >>> Section start 2009/12/04 15:23:58.556

> > cmd: devcon install vhidmini.inf
> > “{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE”
> > dvi: Set selected driver complete.
> > dvi: {Build Driver List} 15:23:58.618
> > dvi: Searching for hardware ID(s):
> > dvi: “{d49f883c-6486-400a-8c22-1a9ef48577e4}\hid_device”
> > cpy: Policy is set to make all digital signatures equal.
> > dvi: Processing a single INF: 'y:\ws\kernel\vhidmini\vhidmini.inf'
> > inf: Opened INF: 'y:\ws\kernel\vhidmini\vhidmini.inf' ([strings])
> > dvi: {Build Driver List - exit(0x00000000)} 15:23:58.618
> > dvi: {DIF_SELECTBESTCOMPATDRV} 15:23:58.618
> > dvi: No class installer for 'Human Interface Devices'
> > dvi: No CoInstallers found
> > dvi: Default installer: Enter 15:23:58.618
> > dvi: {Select Best Driver}
> > ! dvi: Selecting driver failed(0xe0000228)
> > dvi: {Select Best Driver - exit(0xe0000228)}
> > ! dvi: Default installer: failed!
> > ! dvi: Error 0xe0000228: There are no compatible drivers for this
> > device.
> > dvi: {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 15:23:58.634
> > <<< Section end 2009/12/04 15:23:58.634
> > <<< [Exit status: SUCCESS]
> >
> > What am I missing?
> >
> > Thanks,
> >
> > --
> > Aram Hăvărneanu
> >
> >
> > "Aram Hăvărneanu" wrote:
> >
> > > Hello,
> > >
> > > I wish to develop 2 drivers. One will act as a virtual keyboard and the
> > > other as a virtual mouse.
> > >
> > > Can I start from the vhidmini sample? (src\hid\vhidmini -- it's not
> > > available in the lastest WDK, but it's in 6001.18002). From my understanding
> > > this is a miniclass driver that should work with kbdclass and mouclass, the
> > > class drivers for keyboards and mice. Basically all I would need is to
> > > generate IRPs for the class drivers to process, right?
> > >
> > > I never worked with HID, from my understanding HID drivers don't get IOCTLs,
> > > that's why, if you need to comunicate with the driver, you need to do it some
> > > other way. The vhidmini sample implements such a way. Also, never working
> > > with HID, I don't really know what/how to generate the IRPs.
> > >
> > > One thing I don't understand is how such a driver would work with multiple
> > > sessions.
> > >
> > > Thanks in advance for any resources and documentation!
> > >
> > > --
> > > Aram Hăvărneanu

 
Reply With Quote
 
Max
Guest
Posts: n/a

 
      12-04-2009
On Fri, 4 Dec 2009 05:34:01 -0800, Aram H?v?rneanu
<> wrote:

>I decided to start from the vhidmini sample but I can't install it on Windows
>7 32 bit.
>
>Y:\ws\kernel\vhidmini>devcon install vhidmini.inf
>"{D49F883C-6486-400a-8C22-1A9EF48577E4}\HID_DEVICE"
>Device node created. Install is complete when drivers are updated...
>Updating drivers for devcon failed.


I had the same problem with the installation of vhidmini. Don't type
the devcon.exe ..... command directly into the command promp, but
instead create a batch file with this command inside and run it, in
this case it worked for me.
 
Reply With Quote
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-05-2009
"Max" wrote:
>
> I had the same problem with the installation of vhidmini. Don't type
> the devcon.exe ..... command directly into the command promp, but
> instead create a batch file with this command inside and run it, in
> this case it worked for me.
> .
>


Same error.

--
Aram Hăvărneanu

 
Reply With Quote
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-05-2009
"Max" wrote:

>
> I had the same problem with the installation of vhidmini. Don't type
> the devcon.exe ..... command directly into the command promp, but
> instead create a batch file with this command inside and run it, in
> this case it worked for me.
> .
>


Didn't work on Windows 7, but worked on Windows 2003 Server x86. How is
running devcon.exe from a bat file any different to running it directly?

Also, I still can't load the driver with the service control manager api,
and although I can test the driver on NT 5.2 installed via bat file that
calls devcon, I need to be able to load it dynamically in my application.
Also, I need Windows Vista and 7.

Thanks,

--
Aram Hăvărneanu

 
Reply With Quote
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-05-2009
"Aram Hăvărneanu" wrote:

>
> How is
> running devcon.exe from a bat file any different to running it directly?
>


I think I may have an answer, I have copied the devcon line from the docs,
and in the docs it uses smart quotes. The bat file was created manually using
normal quotes. So that's why the bat file worked. If I type correct quotes in
the command line it works as well.

However I still have all the other problems (can't load the driver with the
SCM API, doesn't work on Windows 7, etc).

Thanks,

--
Aram Hăvărneanu



> Also, I still can't load the driver with the service control manager api,
> and although I can test the driver on NT 5.2 installed via bat file that
> calls devcon, I need to be able to load it dynamically in my application.
> Also, I need Windows Vista and 7.
>
> Thanks,
>
> --
> Aram Hăvărneanu
>

 
Reply With Quote
 
Max
Guest
Posts: n/a

 
      12-05-2009
Have you set the administrative privileges to the devcon.exe into
windows 7? About how to load the driver the source code of devcon
program are in the DDK, you can study it for understand how this
software is able to load the driver.

regards

On Sat, 5 Dec 2009 04:10:01 -0800, Aram H?v?rneanu
<> wrote:

>"Aram H?v?rneanu" wrote:
>
>>
>> How is
>> running devcon.exe from a bat file any different to running it directly?
>>

>
>I think I may have an answer, I have copied the devcon line from the docs,
>and in the docs it uses smart quotes. The bat file was created manually using
>normal quotes. So that's why the bat file worked. If I type correct quotes in
>the command line it works as well.
>
>However I still have all the other problems (can't load the driver with the
>SCM API, doesn't work on Windows 7, etc).
>
>Thanks,

 
Reply With Quote
 
Aram Hăvărneanu
Guest
Posts: n/a

 
      12-05-2009
"Max" wrote:

> Have you set the administrative privileges to the devcon.exe into
> windows 7?


Yes, I am running as admin and I have disabled UAC. I checked the logs, and
with that information I was able to load the driver on Windows 7. On 2003, I
was able to install the driver with the inf file and the sys file in the same
directory, however, if I tried to do the same on Windows 7, it didn't work.
Fortunately, the logs were of great help.

> About how to load the driver the source code of devcon
> program are in the DDK, you can study it for understand how this
> software is able to load the driver.
>


I didn't know the source code for devcon was available. I can't find it in
the current WDK. Probably I'm not looking where I need to. The SCM API is
really simple, the problem with the fact that it doesn't work is that I don't
know what to check. Are there any logs I should look into?

Thanks,

--
Aram Hăvărneanu


 
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
Game Compatibility BCurrey Windows Vista Games 6 11-29-2007 09:11 PM
BUGCODE_USB_DRIVER with external USB HDD PHILIPS Deathwing00 Windows Vista Hardware 11 06-15-2007 08:02 PM
Going Golfing but not with Vista markbyrn Windows Vista Games 15 03-08-2007 11:59 AM
americas army stuttering under vista premium ernie Windows Vista Games 0 02-27-2007 11:20 PM
problem in dxdiag Peewee64 Windows Vista Games 0 02-14-2007 10:49 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59