Ignore:
Timestamp:
Jan 8, 2000, 3:15:38 PM (26 years ago)
Author:
sandervl
Message:

OSLibGetMsg bugfix + WM_QUIT translation fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibmsg.cpp

    r2314 r2371  
    1 /* $Id: oslibmsg.cpp,v 1.21 2000-01-03 22:53:16 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.22 2000-01-08 14:15:06 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    151151 APIRET rc;
    152152
    153   rc = WinPostQueueMsg(NULLHANDLE, WM_QUIT, (MPARAM)nExitCode, 0);
     153  rc = WinPostQueueMsg(NULLHANDLE, WM_QUIT, MPFROMLONG(nExitCode), 0);
    154154  dprintf(("WinPostQueueMsg %d returned %d", nExitCode, rc));
    155155}
     
    174174        memcpy(&os2msg, MsgThreadPtr, sizeof(QMSG));
    175175        MsgThreadPtr->time = -1;
    176         if(msg->hwnd) {
     176        if(os2msg.hwnd || os2msg.msg == WM_QUIT) {
    177177            thdb->nrOfMsgs = 1;
    178178            thdb->msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg
    179179            memcpy(&thdb->msg, msg, sizeof(MSG));
    180         }
    181         return (LONG)WinDispatchMsg(thdb->hab, &os2msg);
     180            return (LONG)WinDispatchMsg(thdb->hab, &os2msg);
     181        }
     182        //SvL: Don't dispatch messages sent by PostThreadMessage (correct??)
     183        return 0;
     184
    182185  }
    183186  else {//is this allowed?
     
    225228        while(rc == FALSE);
    226229
    227         return rc;
     230    return (pMsg->message == WINWM_QUIT);
    228231  }
    229232  else
     
    236239    } while (eaten);
    237240  }
    238   if(rc) {
    239         OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
    240         memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG));
    241   }
     241  OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
     242  memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG));
    242243  return rc;
    243244}
     
    410411
    411412    return yyrc;
    412 } 
     413}
    413414//******************************************************************************
    414415BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
Note: See TracChangeset for help on using the changeset viewer.