[ntdev]serial Port change manually

I have a usb-serial port converter which I would like to add a filter
driver to detect any serial port changes.

For example, If i manually change the port number 4 to 5. I would like that
the system notifies the filter driver of this change and also needs what’s
the new port number.

Regards

Christian

You can’t simply. From what I remember msports(?) just updates the value in
the serialcomm device map and wherever
the usb adapter picks up its default value.

This means its -only- valid when the serial port driver creates the entry in
the device map.

In the usb adapter driver its useless to store the COM number per device
object because it can change dynamically above you. The driver doesn’t need
to know the COM assignment after you’ve created your entry in the devicemap
anyways.

If you really do need to know. A solution might be to monitor the serialcomm
map for your known symlinks, and watch for changes.

Rob Linegar
Software Engineer
Data Encryption Systems Limited
www.des.co.uk | www.deslock.co.uk

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of CG
Sent: 25 March 2004 16:10
To: Windows System Software Devs Interest List
Subject: [ntdev] [ntdev]serial Port change manually

I have a usb-serial port converter which I would like to add a filter
driver to detect any serial port changes.

For example, If i manually change the port number 4 to 5. I would like that
the system notifies the filter driver of this change and also needs what’s
the new port number.

Regards

Christian


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com

I would like to know how can I monitor the serialComm? Is there any samples
available in the win XP DDK?

Regards

Christian
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, March 25, 2004 11:36 AM
Subject: RE: [ntdev] [ntdev]serial Port change manually

>
> You can’t simply. From what I remember msports(?) just updates the value
in
> the serialcomm device map and wherever
> the usb adapter picks up its default value.
>
> This means its -only- valid when the serial port driver creates the entry
in
> the device map.
>
> In the usb adapter driver its useless to store the COM number per device
> object because it can change dynamically above you. The driver doesn’t
need
> to know the COM assignment after you’ve created your entry in the
devicemap
> anyways.
>
> If you really do need to know. A solution might be to monitor the
serialcomm
> map for your known symlinks, and watch for changes.
>
>
> Rob Linegar
> Software Engineer
> Data Encryption Systems Limited
> www.des.co.uk | www.deslock.co.uk
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of CG
> Sent: 25 March 2004 16:10
> To: Windows System Software Devs Interest List
> Subject: [ntdev] [ntdev]serial Port change manually
>
>
> I have a usb-serial port converter which I would like to add a filter
> driver to detect any serial port changes.
>
> For example, If i manually change the port number 4 to 5. I would like
that
> the system notifies the filter driver of this change and also needs what’s
> the new port number.
>
> Regards
>
> Christian
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@des.co.uk
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@mcdi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

If you want to monitor serial communication, being a filter above serial
is the right place to be. You don’t have to be aware of the com name
changes though. You just see all the traffic coming in and out of the
port via the IRPs.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of CG
Sent: Thursday, March 25, 2004 9:48 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] [ntdev]serial Port change manually

I would like to know how can I monitor the serialComm? Is there any
samples
available in the win XP DDK?

Regards

Christian
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, March 25, 2004 11:36 AM
Subject: RE: [ntdev] [ntdev]serial Port change manually

>
> You can’t simply. From what I remember msports(?) just updates the
value
in
> the serialcomm device map and wherever
> the usb adapter picks up its default value.
>
> This means its -only- valid when the serial port driver creates the
entry
in
> the device map.
>
> In the usb adapter driver its useless to store the COM number per
device
> object because it can change dynamically above you. The driver doesn’t
need
> to know the COM assignment after you’ve created your entry in the
devicemap
> anyways.
>
> If you really do need to know. A solution might be to monitor the
serialcomm
> map for your known symlinks, and watch for changes.
>
>
> Rob Linegar
> Software Engineer
> Data Encryption Systems Limited
> www.des.co.uk | www.deslock.co.uk
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of CG
> Sent: 25 March 2004 16:10
> To: Windows System Software Devs Interest List
> Subject: [ntdev] [ntdev]serial Port change manually
>
>
> I have a usb-serial port converter which I would like to add a filter
> driver to detect any serial port changes.
>
> For example, If i manually change the port number 4 to 5. I would
like
that
> the system notifies the filter driver of this change and also needs
what’s
> the new port number.
>
> Regards
>
> Christian
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@des.co.uk
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@mcdi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I have a lower filter in a usb stack. I would like to be notified when a
serial com port is changed. Because I could change manually the virtual com
port, but i have to know that there is a change at the lower filter level.

I can see that the lower filter receives a IRP_MJ_POWER at each serial port
number change. This IRP is dispatches to a FilterDispatchPower function.

The device power state is PowerDeviceD0. So, could I do something here to
retrieve the good port number?

I tried it, but it gets the previous port number. If I change once again
the port number, I read again the previous one.

For example, If I change Com3 to Com4, I read Com 3…
If I change Com4 to Com 5, I read Com 4.

Again, if I “scan for hardware changes” in Device Manager… i got the right
com port.

Regards

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Thursday, March 25, 2004 1:17 PM
Subject: RE: [ntdev] [ntdev]serial Port change manually

> If you want to monitor serial communication, being a filter above serial
> is the right place to be. You don’t have to be aware of the com name
> changes though. You just see all the traffic coming in and out of the
> port via the IRPs.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of CG
> Sent: Thursday, March 25, 2004 9:48 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] [ntdev]serial Port change manually
>
> I would like to know how can I monitor the serialComm? Is there any
> samples
> available in the win XP DDK?
>
> Regards
>
> Christian
> ----- Original Message -----
> From:
> To: “Windows System Software Devs Interest List”
> Sent: Thursday, March 25, 2004 11:36 AM
> Subject: RE: [ntdev] [ntdev]serial Port change manually
>
>
> >
> > You can’t simply. From what I remember msports(?) just updates the
> value
> in
> > the serialcomm device map and wherever
> > the usb adapter picks up its default value.
> >
> > This means its -only- valid when the serial port driver creates the
> entry
> in
> > the device map.
> >
> > In the usb adapter driver its useless to store the COM number per
> device
> > object because it can change dynamically above you. The driver doesn’t
> need
> > to know the COM assignment after you’ve created your entry in the
> devicemap
> > anyways.
> >
> > If you really do need to know. A solution might be to monitor the
> serialcomm
> > map for your known symlinks, and watch for changes.
> >
> >
> > Rob Linegar
> > Software Engineer
> > Data Encryption Systems Limited
> > www.des.co.uk | www.deslock.co.uk
> >
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of CG
> > Sent: 25 March 2004 16:10
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] [ntdev]serial Port change manually
> >
> >
> > I have a usb-serial port converter which I would like to add a filter
> > driver to detect any serial port changes.
> >
> > For example, If i manually change the port number 4 to 5. I would
> like
> that
> > the system notifies the filter driver of this change and also needs
> what’s
> > the new port number.
> >
> > Regards
> >
> > Christian
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@des.co.uk
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@mcdi.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@mcdi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

I don’t get it. Why is the name important? Are you opening the port by
name in kernel mode? When you are initially put in the stack, find the
real device name for the com port \Device\Xxx (you can find this out via
the SERIALCOMM key). And anytime you want to find out the mapping in
user mode, call QueryDosDevices and look through the list and find the
name. Using set power to find the name is not right.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of CG
Sent: Thursday, March 25, 2004 11:39 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] [ntdev]serial Port change manually

I have a lower filter in a usb stack. I would like to be notified when
a
serial com port is changed. Because I could change manually the virtual
com
port, but i have to know that there is a change at the lower filter
level.

I can see that the lower filter receives a IRP_MJ_POWER at each serial
port
number change. This IRP is dispatches to a FilterDispatchPower
function.

The device power state is PowerDeviceD0. So, could I do something here
to
retrieve the good port number?

I tried it, but it gets the previous port number. If I change once
again
the port number, I read again the previous one.

For example, If I change Com3 to Com4, I read Com 3…
If I change Com4 to Com 5, I read Com 4.

Again, if I “scan for hardware changes” in Device Manager… i got the
right
com port.

Regards

----- Original Message -----
From: “Doron Holan”
To: “Windows System Software Devs Interest List”
Sent: Thursday, March 25, 2004 1:17 PM
Subject: RE: [ntdev] [ntdev]serial Port change manually

> If you want to monitor serial communication, being a filter above
serial
> is the right place to be. You don’t have to be aware of the com name
> changes though. You just see all the traffic coming in and out of the
> port via the IRPs.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of CG
> Sent: Thursday, March 25, 2004 9:48 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] [ntdev]serial Port change manually
>
> I would like to know how can I monitor the serialComm? Is there any
> samples
> available in the win XP DDK?
>
> Regards
>
> Christian
> ----- Original Message -----
> From:
> To: “Windows System Software Devs Interest List”
> Sent: Thursday, March 25, 2004 11:36 AM
> Subject: RE: [ntdev] [ntdev]serial Port change manually
>
>
> >
> > You can’t simply. From what I remember msports(?) just updates the
> value
> in
> > the serialcomm device map and wherever
> > the usb adapter picks up its default value.
> >
> > This means its -only- valid when the serial port driver creates the
> entry
> in
> > the device map.
> >
> > In the usb adapter driver its useless to store the COM number per
> device
> > object because it can change dynamically above you. The driver
doesn’t
> need
> > to know the COM assignment after you’ve created your entry in the
> devicemap
> > anyways.
> >
> > If you really do need to know. A solution might be to monitor the
> serialcomm
> > map for your known symlinks, and watch for changes.
> >
> >
> > Rob Linegar
> > Software Engineer
> > Data Encryption Systems Limited
> > www.des.co.uk | www.deslock.co.uk
> >
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of CG
> > Sent: 25 March 2004 16:10
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] [ntdev]serial Port change manually
> >
> >
> > I have a usb-serial port converter which I would like to add a
filter
> > driver to detect any serial port changes.
> >
> > For example, If i manually change the port number 4 to 5. I would
> like
> that
> > the system notifies the filter driver of this change and also needs
> what’s
> > the new port number.
> >
> > Regards
> >
> > Christian
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@des.co.uk
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@mcdi.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@mcdi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

(1) Use WinObj to see how the Dos Symbolic Links are set up for COMx to you
\Device\Xxx as Mr. Holan said.
(2) Then if believe this may work: You could write a user mode application
to watch the registry when anything in the registry related to mapping COMx
ports is changed. There is a user mode api for this but off the top of my
head I do not know. Then when getting this callback you could see a irp to
your filter driver that the COMx name has changed. This may work.
(3) I agree with Mr. Holan why does your filter driver need to know this.
The Dos Symbolic mapping are independent of the Kernal mode drivers. They
are used to connect to user mode apps, given the user a string to use in
CreateFile().

Thanks
Michael Jones

“CG” wrote in message news:xxxxx@ntdev…
> I have a usb-serial port converter which I would like to add a filter
> driver to detect any serial port changes.
>
> For example, If i manually change the port number 4 to 5. I would like
that
> the system notifies the filter driver of this change and also needs what’s
> the new port number.
>
> Regards
>
> Christian
>
>