I've developed a KM (mouse and keyboard sharing) type of program, alike
Synergy, etc.
I have a problem: some people play games are picking up events prior to the
global mouse hook, I'm sure this is DirectInput. This is causing troubles in
various ways, so the solution I see is to use a driver of some type.
What I need to do:
1) Block input totally on the non active PC.
2) Generate clicks and movement on the active PC.
I'm looking at using a filter driver (the moufiltr example) and controlling
it using DeviceIoControl, which I have succeeded to connect to drivers with.
I don't want to use a driver if you can just control the existing mouclass
driver tho.
I have DriverspyNT that shows IRP_MJ_INTERNAL_DEVICE_CONTROL is the ultimate
gloal. I have the DDK and also dbgview.
ty for any help/pointers
Whether you need a mouse port driver/HID minidriver or a device filter
will depend on whether you're willing to rely on installing on an
existing pointing device or want to make sure to work even in server
rack with no mouse attached.
Please note that any mechanism you provide to allow user mode apps to
inject mouse packets via a driver opens a security hole in UAC and
Vista's anti-Shatter protections. Not saying you shouldn't do it, just
be aware of the tradeoff.
--
Ray
> Yes, if you want mouse input that will work regardless of the situation,
> you'll need to write a driver for it. SendInput used to be pretty good,
> but in Vista elevated apps don't receive those either, in addition to
> the DirectX issue (though what the justification is for simulating input
> on a device the application specifically identified as the one it wanted
> to receive input from is beyond me).
Basically, my app is for multiboxing, where you take an MMORPG, and play 2
or more characters. If your using more than 1 computer you don't wanna
change mouse / keyboard. For me, it's just something to learn but it's free
and on sourceforge.
> Whether you need a mouse port driver/HID minidriver or a device filter
> will depend on whether you're willing to rely on installing on an
> existing pointing device or want to make sure to work even in server
> rack with no mouse attached.
Currently I'm looking at the KMDF kbfltr example in the DDK and the
possibilty of adapting it to a mouse class upper filter. This isn't based on
wanting to stay away from an additional device, I'm looking for the easist
option for a newbie, so I rely on examples more or less:)
PMOUSE_INPUT_DATA mid = (PMOUSE_INPUT_DATA)Irp->AssociatedIrp.SystemBuffer;
ULONG count = 1;
KIRQL irq = KeGetCurrentIrql();
KeRaiseIrqlToDpcLevel();
(*(PSERVICE_CALLBACK_ROUTINE) ConnectData->ClassService)(
ConnectData->ClassDeviceObject,
mid,
mid + 1,
&count
);
KeLowerIrql(irq);
ConnectData is the same info stored to the device extension that is used in
the normal service call back.
Anyway I probably got it all wrong, if anyone knows how, pls pls help :)
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
"fishnchips" <fishn...@discussions.microsoft.com> wrote in message
news:4A9390E8-E5E4-4256...@microsoft.com...
When it is done, the code will be available at
http://www.sourceforge.net/projects/octo