(I omitted it before to avoid cluttering the response words with code, but here it is now:
I didn't see anything wrong in the asm
code. Looks perfectly fine. So the problem must lie in your own
code.
Here's a thing to try: Modify the
WaitForRX function to add another COMMS_RX_THREAD_DATA param,
like:
DWORD
WaitForRX(COMMS_RX_THREAD_DATA_S& rsCheck, COMMS_RX_THREAD_DATA_S&
rsThreadData, OVERLAPPED& rsNotifyOverlapData);
And also modify the caller to call the
function like this:
dwNumBytes =
WaitForRX(*psThreadData, *psThreadData, sNotifyOverlapData);
Then, inside the new WaitForRX's
implementation, change the code like this:
DWORD
WaitForRX(COMMS_RX_THREAD_DATA_S& rsCheck,
COMMS_RX_THREAD_DATA_S& rsThreadData, OVERLAPPED&
rsNotifyOverlapData)
{
BOOL bDone ;
COMSTAT sStatus ;
DWORD dwEvent, dwError, dwDummy, dwNumBytes ;
dwNumBytes = 0 ; // Until we have definitely been notified of something
// being received.
{
BOOL bDone ;
COMSTAT sStatus ;
DWORD dwEvent, dwError, dwDummy, dwNumBytes ;
dwNumBytes = 0 ; // Until we have definitely been notified of something
// being received.
if
(rsCheck == 0x00000001)
::DebugBreak();
if (!::WaitCommEvent(rsThreadData.hPortHandle, &dwEvent,
&rsNotifyOverlapData) )
{
if (!::WaitCommEvent(rsThreadData.hPortHandle, &dwEvent,
&rsNotifyOverlapData) )
{
Check the generated code to make sure the
new rsCheck param doesn't get optimized away. Then, run the code and see
if the breakpoint is hit, and if it is, check out the value of
rsThreadData. The idea is to add a check parameter to the function to see
if it gets corrupetd as well/instead of the real parameter, so that we can get
further ideas about how to proceed.
Also, what happened to your efforts to
force the debugger to break when the specified variable gets
changed?
If this doesn't lead to anywhere, I think
it would be nice if you could zip up a copy of your project and mail it to me
(and /dev perhaps, as he's offered this earlier) to investigate further
(provided that the code doesn't need an external hardware be present.
---------
Ehsan Akhgari
www.farda-tech.com
List Owner: [email protected]
[Email: [EMAIL PROTECTED]]
[WWW: http://www.beginthread.com/Ehsan
]
| "The brightest future will always be based on a forgotten past." |
_______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
