Changeset 10602 for trunk/src


Ignore:
Timestamp:
May 11, 2004, 11:08:20 AM (21 years ago)
Author:
sandervl
Message:

DT: Added wrappers for calling window handlers

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/callwrap.asm

    r10379 r10602  
    1 ; $Id: callwrap.asm,v 1.1 2004-01-11 12:03:12 sandervl Exp $
     1; $Id: callwrap.asm,v 1.2 2004-05-11 09:08:19 sandervl Exp $
    22
    33;/*
     
    5252
    5353
     54        PUBLIC _WrapCallback4@20
     55; WrapCallback4(PFN lpfnFunction, DWORD hwnd, DWORD msg, DWORD wParam, DWORD lParam)
     56_WrapCallback4@20 proc near
     57        push  ebp
     58        mov   ebp, esp
     59        push  dword ptr [ebp+24]
     60        push  dword ptr [ebp+20]
     61        push  dword ptr [ebp+16]
     62        push  dword ptr [ebp+12]
     63        call  dword ptr [ebp+08]
     64
     65        mov   esp, ebp
     66        pop   ebp     
     67        ret   20
     68_WrapCallback4@20 endp
     69
    5470CODE32          ENDS
    5571
  • trunk/src/user32/callwrap.h

    r10379 r10602  
    1 // $Id: callwrap.h,v 1.1 2004-01-11 12:03:13 sandervl Exp $
     1// $Id: callwrap.h,v 1.2 2004-05-11 09:08:20 sandervl Exp $
    22
    33/*
     
    1919DWORD CDECL WrapCallback2(WNDPROC lpfnFunction, DWORD param1, DWORD param2);
    2020
     21DWORD WIN32API WrapCallback4(WNDPROC lpfnFunction, DWORD param1, DWORD param2, DWORD param3, DWORD param4);
     22
    2123#ifdef __cplusplus
    2224}
  • trunk/src/user32/windowmsg.cpp

    r10439 r10602  
    1 /* $Id: windowmsg.cpp,v 1.49 2004-02-04 14:59:57 bird Exp $ */
     1/* $Id: windowmsg.cpp,v 1.50 2004-05-11 09:08:20 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    3434#define INCL_TIMERWIN32
    3535#include "timer.h"
     36#include "callwrap.h"
    3637
    3738#define DBG_LOCALLOG    DBG_windowmsg
     
    326327 * @author  knut st. osmundsen <bird-srcspam@anduin.net>
    327328 * @remark  One cannot attach a threads input queue to it self.
     329 * @remark  This implemenation requires the thread which input is 'forwarded' to
     330 *          process it's message queue. Window (and wine) will not bother that thread
     331 *          at all with the messages. (DEADLOCK WARNING)
    328332 * @todo    Not sure if all this is 100% ok according to the windows reality.
    329333 *          I'm sure some error cases aren't caught.
     
    10021006    if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0;
    10031007
    1004     result = func( hwnd, msg, wParam, lParam );
     1008    result = WrapCallback4(func, hwnd, msg, wParam, lParam );
    10051009    WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam );
    10061010
     
    10131017        {
    10141018            LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR ));
    1015             result = func( hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr );
     1019            result = WrapCallback4(func, hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr );
    10161020            result = lstrlenWtoA( ustr, result );
    10171021            HeapFree( GetProcessHeap(), 0, ustr );
     
    10221026        {
    10231027            LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR ));
    1024             result = func( hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr );
     1028            result = WrapCallback4(func, hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr );
    10251029            if( result != LB_ERR )
    10261030                result = lstrlenWtoA( ustr, result );
     
    10341038        {
    10351039            LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR ));
    1036             result = func( hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr );
     1040            result = WrapCallback4(func, hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr );
    10371041            if( result != CB_ERR )
    10381042                result = lstrlenWtoA( ustr, result );
     
    10601064    if (WINPROC_MapMsg32WTo32A( hwnd, msg, &wParam, &lParam ) == -1) return 0;
    10611065
    1062     result = func( hwnd, msg, wParam, lParam );
     1066    result = WrapCallback4(func, hwnd, msg, wParam, lParam );
    10631067    WINPROC_UnmapMsg32WTo32A( hwnd, msg, wParam, lParam );
    10641068
     
    10711075        {
    10721076            LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 );
    1073             result = func( hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr );
     1077            result = WrapCallback4(func, hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr );
    10741078            result = lstrlenAtoW( astr, result );
    10751079            HeapFree( GetProcessHeap(), 0, astr );
     
    10801084        {
    10811085            LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 );
    1082             result = func( hwnd, LB_GETTEXT, wParam, ( LPARAM )astr );
     1086            result = WrapCallback4(func, hwnd, LB_GETTEXT, wParam, ( LPARAM )astr );
    10831087            if( result != LB_ERR )
    10841088                result = lstrlenAtoW( astr, result );
     
    10921096        {
    10931097            LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 );
    1094             result = func( hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr );
     1098            result = WrapCallback4(func, hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr );
    10951099            if( result != CB_ERR )
    10961100                result = lstrlenAtoW( astr, result );
  • trunk/src/user32/winproc.cpp

    r10256 r10602  
    1 /* $Id: winproc.cpp,v 1.8 2003-10-02 10:36:00 sandervl Exp $ */
     1/* $Id: winproc.cpp,v 1.9 2004-05-11 09:08:20 sandervl Exp $ */
    22/*
    33 * Window procedure callbacks
     
    1717#include <os2win.h>
    1818#include <string.h>
     19#include "callwrap.h"
    1920#include <win\winproc.h>
    2021#include <win\debugtools.h>
     
    313314    }
    314315
    315     if (!proc) return func(hwnd, msg, wParam, lParam );
     316    if (!proc) return WrapCallback4(func, hwnd, msg, wParam, lParam );
    316317
    317318    switch(proc->type)
    318319    {
    319320    case WIN_PROC_32A:
    320         return func(hwnd, msg, wParam, lParam );
     321        return WrapCallback4(func, hwnd, msg, wParam, lParam );
    321322    case WIN_PROC_32W:
    322323        return WINPROC_CallProc32ATo32W( func, hwnd, msg, wParam, lParam );
     
    347348    }
    348349
    349     if (!proc) return func( hwnd, msg, wParam, lParam );
     350    if (!proc) return WrapCallback4(func, hwnd, msg, wParam, lParam );
    350351
    351352    switch(proc->type)
     
    354355        return WINPROC_CallProc32WTo32A( func, hwnd, msg, wParam, lParam );
    355356    case WIN_PROC_32W:
    356         return func(hwnd, msg, wParam, lParam );
     357        return WrapCallback4(func, hwnd, msg, wParam, lParam );
    357358    default:
    358359        WARN_(relay)("Invalid proc %p\n", proc );
Note: See TracChangeset for help on using the changeset viewer.