Hi all, I have made a filter driver, I have implemented all MJ
functions, but now I have a problem. I want to read / write from my
monitor application to my filter driver for get some data, but how can
I recognize inside my filter driver if IRP_MJ_DEVICE_CONTROL,
IRP_MJ_READ, IRP_MJ_WRITE is comming from my monitor application or
is external and so the IRP must be passed to the next node?


Best Regards.

Re: How to comunicate with Filter Driver by Don

Don
Mon Jun 04 10:20:59 CDT 2007

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.

--
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:1180969967.918228.94070@o11g2000prd.googlegroups.com...
> Hi all, I have made a filter driver, I have implemented all MJ
> functions, but now I have a problem. I want to read / write from my
> monitor application to my filter driver for get some data, but how can
> I recognize inside my filter driver if IRP_MJ_DEVICE_CONTROL,
> IRP_MJ_READ, IRP_MJ_WRITE is comming from my monitor application or
> is external and so the IRP must be passed to the next node?
>
>
> Best Regards.
>



Re: How to comunicate with Filter Driver by firefox78

firefox78
Tue Jun 05 01:21:22 CDT 2007

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.
>
> --
> 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.giacome...@gmail.com> wrote in message
>
> news:1180969967.918228.94070@o11g2000prd.googlegroups.com...
>
>
>
> > Hi all, I have made a filter driver, I have implemented all MJ
> > functions, but now I have a problem. I want to read / write from my
> > monitor application to my filter driver for get some data, but how can
> > I recognize inside my filter driver if IRP_MJ_DEVICE_CONTROL,
> > IRP_MJ_READ, IRP_MJ_WRITE is comming from my monitor application or
> > is external and so the IRP must be passed to the next node?
>
> > Best Regards.- Nascondi testo tra virgolette -
>
> - Mostra testo tra virgolette -

What do you mean exactly? Do you have an example?

Best regards


Re: How to comunicate with Filter Driver by Don

Don
Tue Jun 05 06:42:13 CDT 2007

Take a look at the Toaster filter sample in the DDK.

--
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:1181024482.804937.300200@p47g2000hsd.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.
>>
>> --
>> 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.giacome...@gmail.com> wrote in message
>>
>> news:1180969967.918228.94070@o11g2000prd.googlegroups.com...
>>
>>
>>
>> > Hi all, I have made a filter driver, I have implemented all MJ
>> > functions, but now I have a problem. I want to read / write from my
>> > monitor application to my filter driver for get some data, but how can
>> > I recognize inside my filter driver if IRP_MJ_DEVICE_CONTROL,
>> > IRP_MJ_READ, IRP_MJ_WRITE is comming from my monitor application or
>> > is external and so the IRP must be passed to the next node?
>>
>> > Best Regards.- Nascondi testo tra virgolette -
>>
>> - Mostra testo tra virgolette -
>
> What do you mean exactly? Do you have an example?
>
> Best regards
>



Re: How to comunicate with Filter Driver by Doron

Doron
Tue Jun 05 22:40:25 CDT 2007

or the KMDF kbdfiltr example which enumerates a raw PDO for communication
with the user mode application

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.


"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:eWbBha2pHHA.3512@TK2MSFTNGP06.phx.gbl...
> Take a look at the Toaster filter sample in the DDK.
>
> --
> 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:1181024482.804937.300200@p47g2000hsd.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.
>>>
>>> --
>>> 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.giacome...@gmail.com> wrote in message
>>>
>>> news:1180969967.918228.94070@o11g2000prd.googlegroups.com...
>>>
>>>
>>>
>>> > Hi all, I have made a filter driver, I have implemented all MJ
>>> > functions, but now I have a problem. I want to read / write from my
>>> > monitor application to my filter driver for get some data, but how can
>>> > I recognize inside my filter driver if IRP_MJ_DEVICE_CONTROL,
>>> > IRP_MJ_READ, IRP_MJ_WRITE is comming from my monitor application or
>>> > is external and so the IRP must be passed to the next node?
>>>
>>> > Best Regards.- Nascondi testo tra virgolette -
>>>
>>> - Mostra testo tra virgolette -
>>
>> What do you mean exactly? Do you have an example?
>>
>> Best regards
>>
>
>



Re: How to comunicate with Filter Driver by firefox78

firefox78
Fri Jun 08 03:23:12 CDT 2007

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


Re: How to comunicate with Filter Driver by Don

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
>