Don
Fri Jun 08 07:10:54 CDT 2007
It depends on what your communication is like. You can have one
communication device and have the messages indicate the target device they
are for (or if the communication is global for all), or you can create a
second device for each filtered device. If it is one communication device,
create it in DriverEntry if if is multiple comm devices create them in
AddDevice at the same time you create the filter target device. Note in
either circumstance your symbolic links should be pointing to the the
communication devices not the targets.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website:
http://www.windrvr.com
Blog:
http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"firefox78" <g.giacomello@gmail.com> wrote in message
news:1181290992.944073.19460@m36g2000hse.googlegroups.com...
> On 4 Giu, 17:20, "Don Burn" <b...@stopspam.windrvr.com> wrote:
>> You typically create a second device object as a control device. Then
>> it
>> is easy in the dispatch routine to identify requests for the control
>> device
>> versus the filtered device. This also can make things easier in the
>> case
>> your filter is filtering a bunch of devices, but you only want one
>> control.
>>
>
> I'm a little bit confuse, for every driver object I can have more
> device object and every device object is created with IoCreateDevice
> inside FilterAddDevice (PNP configuration).
>
> Now
>
> IoGetDeviceProperty(PhysicalDeviceObject,
> DevicePropertyPhysicalDeviceObjectName, 0, NULL, &len);
> pdoName = (PWSTR) ExAllocatePoolWithTag(PagedPool, len,
> 'aaaa');
> IoGetDeviceProperty(PhysicalDeviceObject,
> DevicePropertyPhysicalDeviceObjectName, len, pdoName, &len);
> us_pdoName.Buffer = pdoName;
> us_pdoName.Length = (USHORT)len - sizeof(UNICODE_NULL);
> us_pdoName.MaximumLength = (USHORT)len;
> RtlInitUnicodeString(&symbolicLinkName, L"\\DosDevices\
> \Filter_Step1");
> status = IoCreateSymbolicLink(&symbolicLinkName,
> &us_pdoName);
>
> whith the above code I create a symbolic link with every device
> Object, but Filter_Step1 name is common for every device and is not a
> second deviceobject!!!
> The step I don't understend is where I have to create a second
> DeviceObject as controldevice? Is to be created every time inside
> FilterAddDevice? And then have I to create a symboliclink to that
> device? In this way I have a lot of seconddevices!!!!
>
> Tankyou for every help
>