🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8275

Re: Port Scans - unsolved

#8275
From: Pete Fraser
Date: Tue, 09 Nov 2004 15:16
68 lines
2650 bytes
You don't need the second createfile and in fact it won't work as it's 
already open
You just change the baud rate.
(It's the same as opening a file that's already open - it can't be done!)
Note that closePort leaves the handle returned from CreateFile still open.
HTH Pete

"Max Blank" <MaxBlank@MaxBlank-Institute.net> wrote in message 
news:4190dcd2$1@newsgroups.borland.com...
>> So psuedo code is:
>> CreateFile
>>   Set baud rate to 9600
>>   openPort
>>   try to find device
>>   if it fails
>>     close port
> -->   CreateFile ???   <----------------
>>     set baud rate to 19200
>>     try to find device
>>     if it fails
>>       close port
>
>
> What I do is almost exactly what you suggested, except that I perform a
> second CreateFile() as shown above. Actually, the following happens:
>
> Scenario 1:
>
>     CreateFile for COM8
>       Set baud rate to 9600
>       OpenPort
>       Try to find device -> fails, as expected
>       Close Port
>     CreateFile for COM8  => fails !!!
>
>
> Scenario 2:
>
>     CreateFile for COM8
>       Set baud rate to 19200
>       OpenPort
>       Device Found ...
>       Close Port
>
>
> The second CreateFile on the same port seems to fail. However, if I stop 
> the program's execution shortly, and then continue, everything works fine 
> like this:
>
> Scenario 3:
>
>     CreateFile for COM8
>       Set baud rate to 9600
>       OpenPort
>       Try to find device -> fails, as expected
>       Close Port
>     CreateFile for COM8  -> succeeds !!
>       Set baud rate to 19200
>       OpenPort
>       Device Found ...
>       Close Port
>
>
> That's annoying !
>
>
> Max
> 
Technical Details
Message-ID: <4190df74@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <418ebc0d@newsgroups.borland.com> <418f380f@newsgroups.borland.com> <4190dcd2$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9fcab49b7cf126f6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Pete Fraser" <pete._no_spam_fraser@frasersoft.nospam.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <418ebc0d@newsgroups.borland.com> <418f380f@newsgroups.borland.com> <4190dcd2$1@newsgroups.borland.com>
Subject: Re: Port Scans - unsolved
Date: Tue, 9 Nov 2004 15:16:59 -0000
Lines: 70
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 195.12.18.1
Message-ID: <4190df74@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100013428 195.12.18.1 (9 Nov 2004 07:17:08 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail