Changeset 17408


Ignore:
Timestamp:
Sep 27, 2001, 12:42:59 PM (24 years ago)
Author:
phaller
Message:

added message code check to TranslateMessage (like in NT)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/windowmsg.cpp

    r17322 r17408  
    1 /* $Id: windowmsg.cpp,v 1.29 2001-09-19 15:39:52 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.30 2001-09-27 10:42:59 phaller Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    1515 *
    1616 */
     17
     18#include <odin.h>
     19#include <odinwrap.h>
     20#include <os2sel.h>
     21
    1722#include <os2win.h>
    1823#include <misc.h>
     
    2934#include "dbglocal.h"
    3035
     36ODINDEBUGCHANNEL(USER32-WINDOWMSG)
     37
     38
    3139//******************************************************************************
    3240//******************************************************************************
     
    5260//******************************************************************************
    5361//******************************************************************************
    54 BOOL WIN32API TranslateMessage( const MSG * msg)
    55 {
    56    return OSLibWinTranslateMessage((MSG *)msg);
     62BOOL WIN32API TranslateMessage(const MSG *msg)
     63{
     64  // check the message code
     65  if ( (msg->message <  WM_KEYDOWN) ||
     66       (msg->message >  WM_SYSKEYUP)||
     67       (msg->message == WM_CHAR)    ||
     68       (msg->message == WM_DEADCHAR) )
     69  {
     70    SetLastError(ERROR_INVALID_PARAMETER);
     71    return FALSE;
     72  }
     73 
     74  // only WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP
     75  // can go into TranslateMessage
     76 
     77  return OSLibWinTranslateMessage((MSG *)msg);
    5778}
    5879//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.