Changeset 7097 for trunk/src


Ignore:
Timestamp:
Oct 17, 2001, 5:16:58 PM (24 years ago)
Author:
phaller
Message:

Minor performance enhancement for window mgmt functions (GetWindowFromHandle)

Location:
trunk/src/user32
Files:
2 edited

Legend:

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

    r7095 r7097  
    1 /* $Id: win32wbase.cpp,v 1.291 2001-10-17 14:30:09 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.292 2001-10-17 15:16:57 phaller Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    8181static int iMenuSysKey = 0;
    8282
     83
     84
     85/***
     86 * Performance Optimization:
     87 * we're directly inlining this micro function from win32wndhandle.cpp.
     88 * Changes there must be reflected here.
     89 ***/
     90extern ULONG WindowHandleTable[MAX_WINDOW_HANDLES];
     91
     92BOOL INLINE i_HwGetWindowHandleData(HWND hwnd, DWORD *pdwUserData)
     93{
     94  if((hwnd & 0xFFFF0000) != WNDHANDLE_MAGIC_HIGHWORD) {
     95        return FALSE; //unknown window (PM?)
     96  }
     97  hwnd &= WNDHANDLE_MAGIC_MASK;
     98  if(hwnd < MAX_WINDOW_HANDLES) {
     99        *pdwUserData = WindowHandleTable[hwnd];
     100        return TRUE;
     101  }
     102  *pdwUserData = 0;
     103  return FALSE;
     104}
     105#define HwGetWindowHandleData(a,b) i_HwGetWindowHandleData(a,b)
     106
     107
    83108//******************************************************************************
    84109//******************************************************************************
  • trunk/src/user32/win32wndhandle.cpp

    r5685 r7097  
    1 /* $Id: win32wndhandle.cpp,v 1.9 2001-05-11 08:39:46 sandervl Exp $ */
     1/* $Id: win32wndhandle.cpp,v 1.10 2001-10-17 15:16:58 phaller Exp $ */
    22/*
    33 * Win32 Handle Management Code for OS/2
     
    8181//******************************************************************************
    8282//******************************************************************************
     83/* 2001-10-17 PH
     84 * Note: this function is repeated as "inline macro" in win32wbase.cpp.
     85 * Changes here must be reflected there, tool.
     86 */
    8387BOOL HwGetWindowHandleData(HWND hwnd, DWORD *pdwUserData)
    8488{
Note: See TracChangeset for help on using the changeset viewer.