Changeset 6614 for trunk/src


Ignore:
Timestamp:
Aug 31, 2001, 9:55:41 PM (24 years ago)
Author:
phaller
Message:

better behaviour if PostMessage fails due to low memory

File:
1 edited

Legend:

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

    r6501 r6614  
    1 /* $Id: oslibmsg.cpp,v 1.41 2001-08-09 08:45:40 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.42 2001-08-31 19:55:41 phaller Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3838#include "dbglocal.h"
    3939
     40
     41// PH 2001-08-24 It seems a failure to post a message
     42// kills Opera here and there.
     43#define VERIFY_SHARED_HEAP 1
     44
     45
    4046typedef BOOL (EXPENTRY FNTRANS)(MSG *, QMSG *);
    4147typedef FNTRANS *PFNTRANS;
     
    461467{
    462468 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    463 
     469 
     470#ifdef VERIFY_SHARED_HEAP
     471  if (NULL == packet)
     472  {
     473    dprintf(("user32::oslibmsg::OSLibSendMessage - allocated packet structure is NULL, heapmin=%d\n",
     474             _sheapmin() ));
     475   
     476    // PH: we cannot provide a correct returncode :(
     477    return 0;
     478  }
     479#endif
     480 
    464481    packet->wParam   = wParam;
    465482    packet->lParam   = lParam;
     
    479496{
    480497 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    481 
     498 
     499#ifdef VERIFY_SHARED_HEAP
     500  if (NULL == packet)
     501  {
     502    dprintf(("user32::oslibmsg::OSLibPostMessage - allocated packet structure is NULL, heapmin=%d\n",
     503             _sheapmin() ));
     504   
     505    // PH: we can provide a correct returncode
     506    return FALSE;
     507  }
     508#endif
    482509    packet->wParam   = wParam;
    483510    packet->lParam   = lParam;
     
    510537 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    511538 BOOL ret;
    512 
     539 
     540#ifdef VERIFY_SHARED_HEAP
     541  if (NULL == packet)
     542  {
     543    dprintf(("user32::oslibmsg::OSLibPostMessage - allocated packet structure is NULL, heapmin=%d\n",
     544             _sheapmin() ));
     545   
     546    // PH: we can provide a correct returncode
     547    return FALSE;
     548  }
     549#endif
     550 
     551 
    513552    if(teb == NULL) {
    514553        dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));
Note: See TracChangeset for help on using the changeset viewer.