> > This is it, nothing removed in between.
>
> Good.  But I asked you to post the asm if possible.  Otherwide we wouldn't
> be able to tell if the compiler is generating bad code or the problem lies
> elsewhere.

(I omitted it before to avoid cluttering the response words with code, but here it is now:

523:  DWORD WaitForRX(COMMS_RX_THREAD_DATA_S& rsThreadData, OVERLAPPED& rsNotifyOverlapData)
524:  {
02CC1BAA   push        ebp
02CC1BAB   mov         ebp,esp
02CC1BAD   sub         esp,0Ch
02CC1BB0   push        ebx
02CC1BB1   push        esi
525:      BYTE    byBuffer[1024];
526:      BOOL    bDone ;
527:      COMSTAT sStatus ;
528:      DWORD   dwEvent, dwError, dwDummy, dwNumBytes ;
529:
530:      dwNumBytes = 0 ;    // Until we have definitely been notified of something
531:                          // being received.
532:
533:      if (!::WaitCommEvent(rsThreadData.hPortHandle, &dwEvent,
534:                              &rsNotifyOverlapData) )
02CC1BB2   mov         esi,dword ptr [ebp+8]
02CC1BB5   push        edi
02CC1BB6   mov         edi,dword ptr [rsNotifyOverlapData]
02CC1BB9   lea         eax,[rsThreadData]
02CC1BBC   push        edi
02CC1BBD   push        eax
02CC1BBE   push        dword ptr [esi+0Ch]
02CC1BC1   xor         ebx,ebx
02CC1BC3   call        dword ptr [EMAIL PROTECTED] (02d093d4)]
02CC1BC9   test        eax,eax
02CC1BCB   jne         WaitForRX+45h (02cc1bef)
535:      {


And here's the code that calls it, minus the confusing debug statements (which aren't doing much good anyway):

508:          while (!psThreadData->bTerminate)
02CC1B75   cmp         dword ptr [esi],edi
02CC1B77   jne         CommsRXThreadProc+58h (02cc1b94)
509:          {
510:              dwNumBytes = WaitForRX(*psThreadData, sNotifyOverlapData);
02CC1B79   lea         eax,[sNotifyOverlapData]
02CC1B7C   push        eax
02CC1B7D   push        esi
02CC1B7E   call        WaitForRX (02cc1baa)
02CC1B83   pop         ecx
511:              if (dwNumBytes > 0)
02CC1B84   cmp         eax,edi
02CC1B86   pop         ecx
02CC1B87   jbe         CommsRXThreadProc+39h (02cc1b75)
512:                  ReceiveBytes(*psThreadData, dwNumBytes);
02CC1B89   push        eax
02CC1B8A   push        esi
02CC1B8B   call        ReceiveBytes (02cc1c1e)
02CC1B90   pop         ecx
02CC1B91   pop         ecx
02CC1B92   jmp         CommsRXThreadProc+39h (02cc1b75)
513:          }


--
Jason Teagle
[EMAIL PROTECTED]
 

_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to