Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Releasing a COM Port from an Active Application

1 view
Skip to first unread message

davidm...@gmail.com

unread,
Jul 29, 2008, 10:59:33 AM7/29/08
to
Hey, quick question here...

I have a software app that is communicating to some hardware on
COM1... but I want to use COM1 for another application (while the
original app still runs). So, I want to release COM1 from that app
and use it on my new app... I don't want to share the COM Port between
the two... I simply want to release it from one app and use it in the
new one.


I didn't know where to post this question, but I thought that the
solution may lie within driver development.

I'd really appreciate any help.

chris.a...@gmail.com

unread,
Jul 29, 2008, 2:30:43 PM7/29/08
to
On Jul 29, 9:59 am, davidmurr...@gmail.com wrote:

> I have a software app that is communicating to some hardware on
> COM1... but I want to use COM1 for another application (while the
> original app still runs). So, I want to release COM1 from that app
> and use it on my new app... I don't want to share the COM Port between
> the two... I simply want to release it from one app and use it in the
> new one.

You could try disabling/enabling the port in question, assuming the
original app doesn't try to reclaim it when it comes back up (and also
assuming it drops its handle when the device disappears). A more
foolproof solution would be to layer some sort of upper filter on the
port that would control access somehow.

Doron Holan [MSFT]

unread,
Jul 30, 2008, 6:21:50 PM7/30/08
to
how about closing the first app?

--
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.


<davidm...@gmail.com> wrote in message
news:1c800b0e-23fe-4b4c...@34g2000hsh.googlegroups.com...

Don Burn

unread,
Jul 30, 2008, 6:38:48 PM7/30/08
to
You should realize that if this is a for a general purpose application your
ass will be sued. For instance, I know a glass artist who uses com1 to
control her kiln, you mess with it and a multi-thousand dollar piece of art
can be ruined.


--
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


<davidm...@gmail.com> wrote in message
news:1c800b0e-23fe-4b4c...@34g2000hsh.googlegroups.com...

chris.a...@gmail.com

unread,
Jul 31, 2008, 11:17:38 AM7/31/08
to
On Jul 30, 5:38 pm, "Don Burn" <b...@stopspam.windrvr.com> wrote:

> You should realize that if this is a for a general purpose application your
> ass will be sued. For instance, I know a glass artist who uses com1 to
> control her kiln, you mess with it and a multi-thousand dollar piece of art
> can be ruined.

Why do you think that lawsuit could possibly be won? Your glass
artist is the one who installed the offending application *and* ran
it.....and the EULA will just avow all damages

Don Burn

unread,
Jul 31, 2008, 11:38:33 AM7/31/08
to
Only if the the software explicitly stated that they were going to do this.
I know of a little firm that hijacked some resources on computers, and has
now had there assets being disposed of by the court, which stated that
people had a reasonable expectation to warned of such actions.

--
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


<chris.a...@gmail.com> wrote in message
news:6a44e280-d8e2-4ba7...@t54g2000hsg.googlegroups.com...

davidm...@gmail.com

unread,
Jul 31, 2008, 5:00:00 PM7/31/08
to
thanks for the replies, everyone.


as previously stated, you can't rip the COM port away from the
application unless the application is coded in a way that would allow
it (presumably by allowing sharing at handle creation).

however, i have discovered that you can create an upper-level driver
filter that will allow for control over the COM port's IRPs and such.

Doron Holan [MSFT]

unread,
Aug 1, 2008, 2:46:06 PM8/1/08
to
you can do that, but what will it mean? what if both apps want different
baud rates? how will you know which app to report data to?

--
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.


<davidm...@gmail.com> wrote in message
news:6ad0d49c-a3f2-43f5...@m44g2000hsc.googlegroups.com...

Ray Trent

unread,
Aug 1, 2008, 7:41:21 PM8/1/08
to
Obviously this isn't something that's going to work in the general case,
but to be fair to the OP (who didn't really word their question very
well, however), I can certainly see creating a mechanism that would work
for one specific set of known applications.

Doron Holan [MSFT] wrote:
> you can do that, but what will it mean? what if both apps want different
> baud rates? how will you know which app to report data to?
>


--
Ray

Doron Holan [MSFT]

unread,
Aug 4, 2008, 2:23:43 PM8/4/08
to
i have my doubts it will even work then...the only way he would know that
this scheme would work is if he had src for both apps...and if he did, he
should just fix the first app to release the com port

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.


"Ray Trent" <r...@nospam.nospam> wrote in message
news:ehI9bAD...@TK2MSFTNGP02.phx.gbl...

0 new messages