CFanatic

Go Back   CFanatic > Programming > Win32 Programming

Join CFanatic Forum Now

Overlapped Serial I/O on WinXP or Win2k topic posted under Win32 Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2006, 09:44 AM
Junior Member
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
MichaelLondonIV is on a distinguished road
| More
Overlapped Serial I/O on WinXP or Win2k

Hi All,

I have an old piece of software that uses overlapped I/O to read/write from/to a serial port. The code is part of a larger app, that would be difficult to modify.

The app appears to be dropping an input string, depending on PU/interrupt load. Im not sure if its a hardware or software problem.

Now to the question:

The code uses handles in the Overlapped structures in an unusual way (I've been working with overlapped IO for a long time, never seen this). The worker thread runs in a loop, at the top of the loop it waits on 4 handles. 3 of these handles are in the Overlapped structs handle member. When one of the handles signals, it calls a function to process (read or write) data.

I have always used overlapped IO the opposite way (the way the documentation says to use it):

1) Call any of the functions that take an Overlapped struct as an argument
2) Check the return value. If its ERROR_IO_PENDING, then you have to wait on the handle in the Overlapped sturct.
3) If its OK, then you can continue with whatever you were doing (reading, writing, etc).

The old code I'm working with does it backwards, first waits on the handles, then calls the function (ReadFile, etc). The documentation does not state what happens in this case.

Is it valid to first wait on all of the overlapped handles, THEN do the function call?

Thanks for any help you might provide!!

Regards,
Mike London
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Programming-really beginner's ? fab Win32 Programming 0 08-14-2008 10:27 PM
transmit and recieve data from serial port using c sakshamgupta C Programming 1 05-29-2007 06:42 AM
c code for transmitting and recieving data from serial port sakshamgupta C Programming 0 05-29-2007 05:15 AM
pda communication with serial port sleepyzzz C Programming 0 03-24-2007 12:29 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:48 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board