Ignore:
Timestamp:
Aug 9, 2001, 10:45:41 AM (24 years ago)
Author:
sandervl
Message:

rewrote PostThreadMessage + query message queue of first thread with WinQueueFromId

File:
1 edited

Legend:

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

    r6420 r6501  
    1 /* $Id: oslibmsg.cpp,v 1.40 2001-07-30 20:48:51 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.41 2001-08-09 08:45:40 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    507507BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
    508508{
    509 // TEB *teb = GetTEBFromThreadId(threadid);
     509 TEB *teb = GetTEBFromThreadId(threadid);
    510510 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    511 
    512 //    if(teb == NULL) {
    513 //        dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));
    514 //        return FALSE;
    515 //    }
    516     dprintf(("PostThreadMessageA %x %x %x %x", threadid, msg, wParam, lParam));
     511 BOOL ret;
     512
     513    if(teb == NULL) {
     514        dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));
     515        return FALSE;
     516    }
     517    dprintf(("PostThreadMessageA %x %x %x %x -> hmq %x", threadid, msg, wParam, lParam, teb->o.odin.hmq));
    517518    packet->wParam   = wParam;
    518519    packet->lParam   = lParam;
    519 #ifdef USING_OPEN32
    520     return O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF+msg, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet);
    521 #else
    522     return O32_PostThreadMessage(threadid, WIN32APP_POSTMSG+msg, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet);
    523 #endif
    524 }
    525 //******************************************************************************
    526 //******************************************************************************
    527 
     520
     521    ret = WinPostQueueMsg((HMQ)teb->o.odin.hmq, WIN32APP_POSTMSG+msg,
     522                          (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA),
     523                          (MPARAM)packet);
     524
     525    if(ret == FALSE)
     526    {
     527       SetLastError(ERROR_INVALID_PARAMETER_W);
     528       return FALSE;
     529    }
     530    SetLastError(ERROR_SUCCESS_W);
     531    return TRUE;
     532}
     533//******************************************************************************
     534//******************************************************************************
     535
Note: See TracChangeset for help on using the changeset viewer.