?
Solved

Security issues with WaitForCommEvent on a laptop?

Posted on 2014-03-12
6
Medium Priority
?
321 Views
Last Modified: 2014-03-18
Have I ever mentioned that I hate computers? ( just kidding of course!) I have a simple WIN32 console program that runs minimized and waits for DSR to be asserted on a com port ( RS232 ), It uses WaitForCommEvent.  When the test instrument sets DSR, the program querys the instrument for several pieces of data and reformats the data then uses INPUT functions from WinUser.h to insert the string in the stream from the keyboard. Like magic the data is inserted into a cell on a spreadsheet...  or at least it is on a desktop. When I try to run the program on a new laptop ( Win 7 ) it opens the com port OK but never gets an event from the WaitForCommEvent function. I've tested the com port using Hyperterminal and all is well. I smell a security setting!!!  Anyone have any ideas on what setting I need to address?

Regards
RonHarsh
0
Comment
Question by:RonHarsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 37

Expert Comment

by:bbao
ID: 39925384
any earlier versions before W7 ever ran the program and got the results as you expected?
0
 

Author Comment

by:RonHarsh
ID: 39925715
No it hasn't been around long enough. But it does work as expected on Windows 7 on any of 4 desktops.  I ran into a similar problem with HIPS ( host intrusion prevention software ) and a wired network connection to a camera ( GigE ) where the HIPS software prevented the camera from sending data.  The com port works normally on this laptop but the detection of DSR using WaitForCommEvent hangs. Yes I have verified that the DSR line is indeed toggling..
0
 

Accepted Solution

by:
RonHarsh earned 0 total points
ID: 39925902
OK, Problem solved ( sort of! ) If I open the port with the OverLapped flag set and use the event to trigger action, it works on the new laptop.  
NOW, Can someone point me a good tutorial on the simplest way to read and write strings to a comport in Overlapped mode?

Thanks
RonHarsh
0
Four New Appliances. Same Industry-leading Speeds.

But don't take it from us.  The Firebox M370 is Miercom tested and Miercom approved, outperforming its competitors for stateless and stateful traffic throughput scenarios.  Learn more about the M370, M470, M570 and M670 and find the right solution for your organization today!

 
LVL 19

Expert Comment

by:regmigrant
ID: 39925978
0
 
LVL 37

Expert Comment

by:bbao
ID: 39928381
it would be good to accept your own comment as the answer and keep this question as PAQ.
0
 

Author Closing Comment

by:RonHarsh
ID: 39936365
pretty straight forward, just had to go down a road I have not traveled before... OverLapped!
0

Featured Post

Ransomware Attacks Keeping You Up at Night?

Will your organization be ransomware's next victim?  The good news is that these attacks are predicable and therefore preventable. Learn more about how you can  stop a ransomware attacks before encryption takes place with our Ransomware Prevention Kit!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No security measures warrant 100% as a "silver bullet". The truth is we also cannot assume anything but a defensive and vigilance posture. Adopt no trust by default and reveal in assumption. Only assume anonymity or invisibility in the reverse. Safe…
In this article you will get to know about pros and cons of storage drives HDD, SSD and SSHD.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question