From Doron’s message on i8042 stack:
Kbdfiltr has some comments in it describing how to do this. You need
to create a 2ndary
device object that has a hardcoded name and create a symbolic link to
it (via
IoCreateSymbolicLink) so that your user mode application can open it.
Unfortunately, you
cannot use a device interface for this
This problem is in fact much more general, not input-related only.
Sometimes is is desirable to create a device object just out of thin
air, not enumerated by anything, which will be PnP-compatible -
supporting device interfaces, intelligent removal or child devices,
for instance. Or, for instance, sometimes it is desirable to create a
virtual bus, which will have some child (BusRelations) devices. The
problem is that the parent device must be PnP-compatible for this, not
just created by IoCreateDevice.
Is it possible to use IoReportDetectedDevice (without any hardware
resources) to create a PDO for such out-of-thin-air device, and then
attach the FDO to it?
Also one more question:
- sometimes it is desirable to allow user apps to ask some driver to
create one more device instance and to remove it then. - this is conceptually similar to NetWare’s “load ne2000 int=3
port=300” command, which loads ne2000 binary if necessary and then
asks it to create one more device instance (it also allowed to specify
the instance name for protocol binds and further unload, though I have
forgotten the exact syntax). The only difference is that I’m talking
on software-only devices which have no hardware resources. - or, for instance, w2k’s RRAS stack seems to use something similar
for its virtual VPN and WAN adapters. I can imagine some other
software which will benefit from such functionality. - what is the best way to implement such functionality on w2k/XP? I
mean the user-mode call which will load some .SYS (possibly using .INF
files) and then tell it to create one more device instance, with the
ability of creation parameters passing and instance naming, and also
the ability of removing such instances (triggering PnP remove or
eject) by user-mode call using instance name? Instances are better to
be volatile and not saved to any persistent registry. - can this be done by root enumerator and SetupDixxx calls? Or maybe
SWENUM can be used for this - is it too tied to KS stack?
Max