Sweden-Number/dlls/user32/winproc.c

1559 lines
52 KiB
C
Raw Normal View History

Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
/*
* Window procedure callbacks
*
* Copyright 1995 Martin von Loewis
* Copyright 1996 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
*/
#include <assert.h>
#include <stdarg.h>
#include <string.h>
2000-12-02 21:11:42 +01:00
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wingdi.h"
#include "controls.h"
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
#include "win.h"
#include "dbt.h"
#include "user_private.h"
#include "wine/asm.h"
#include "wine/debug.h"
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
WINE_DEFAULT_DEBUG_CHANNEL(msg);
WINE_DECLARE_DEBUG_CHANNEL(relay);
#define WINPROC_PROC16 ((void *)1) /* placeholder for 16-bit window procs */
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
union packed_structs
{
struct packed_CREATESTRUCTW cs;
struct packed_DRAWITEMSTRUCT dis;
struct packed_MEASUREITEMSTRUCT mis;
struct packed_DELETEITEMSTRUCT dls;
struct packed_COMPAREITEMSTRUCT cis;
struct packed_WINDOWPOS wp;
struct packed_COPYDATASTRUCT cds;
struct packed_HELPINFO hi;
struct packed_NCCALCSIZE_PARAMS ncp;
struct packed_MSG msg;
struct packed_MDINEXTMENU mnm;
struct packed_MDICREATESTRUCTW mcs;
};
static inline void *get_buffer( void *static_buffer, size_t size, size_t need )
{
if (size >= need) return static_buffer;
return HeapAlloc( GetProcessHeap(), 0, need );
}
static inline void free_buffer( void *static_buffer, void *buffer )
{
if (buffer != static_buffer) HeapFree( GetProcessHeap(), 0, buffer );
}
/* return the window proc for a given handle, or NULL for an invalid handle,
* or WINPROC_PROC16 for a handle to a 16-bit proc. */
static inline WINDOWPROC *handle_to_proc( WNDPROC handle )
{
return (WINDOWPROC *)NtUserCallOneParam( HandleToUlong(handle), NtUserGetWinProcPtr );
}
#ifdef __i386__
/* Some window procedures modify registers they shouldn't, or are not
* properly declared stdcall; so we need a small assembly wrapper to
* call them. */
extern LRESULT WINPROC_wrapper( WNDPROC proc, HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam );
__ASM_GLOBAL_FUNC( WINPROC_wrapper,
"pushl %ebp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
"movl %esp,%ebp\n\t"
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
"pushl %edi\n\t"
__ASM_CFI(".cfi_rel_offset %edi,-4\n\t")
"pushl %esi\n\t"
__ASM_CFI(".cfi_rel_offset %esi,-8\n\t")
"pushl %ebx\n\t"
__ASM_CFI(".cfi_rel_offset %ebx,-12\n\t")
/* TreePad X Enterprise assumes that edi is < 0x80000000 in WM_TIMER messages */
"xorl %edi,%edi\n\t"
"subl $12,%esp\n\t"
"pushl 24(%ebp)\n\t"
"pushl 20(%ebp)\n\t"
"pushl 16(%ebp)\n\t"
"pushl 12(%ebp)\n\t"
"movl 8(%ebp),%eax\n\t"
"call *%eax\n\t"
"leal -12(%ebp),%esp\n\t"
"popl %ebx\n\t"
__ASM_CFI(".cfi_same_value %ebx\n\t")
"popl %esi\n\t"
__ASM_CFI(".cfi_same_value %esi\n\t")
"popl %edi\n\t"
__ASM_CFI(".cfi_same_value %edi\n\t")
"leave\n\t"
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
__ASM_CFI(".cfi_same_value %ebp\n\t")
"ret" )
#else
static inline LRESULT WINPROC_wrapper( WNDPROC proc, HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam )
{
return proc( hwnd, msg, wParam, lParam );
}
#endif /* __i386__ */
static WPARAM map_wparam_char_WtoA( WPARAM wParam, DWORD len )
{
WCHAR wch = wParam;
BYTE ch[2];
DWORD cp = get_input_codepage();
len = WideCharToMultiByte( cp, 0, &wch, 1, (LPSTR)ch, len, NULL, NULL );
if (len == 2)
return MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wParam) );
else
return MAKEWPARAM( ch[0], HIWORD(wParam) );
}
/* call a 32-bit window procedure */
static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg )
{
WNDPROC proc = arg;
TRACE_(relay)( "\1Call window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
*result = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
TRACE_(relay)( "\1Ret window proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx\n",
proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, *result );
return *result;
}
/* call a 32-bit dialog procedure */
static LRESULT call_dialog_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, LRESULT *result, void *arg )
{
DPI_AWARENESS_CONTEXT context;
WNDPROC proc = arg;
LRESULT ret;
USER_CheckNotLock();
hwnd = WIN_GetFullHandle( hwnd );
TRACE_(relay)( "\1Call dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp );
context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd ));
ret = WINPROC_wrapper( proc, hwnd, msg, wp, lp );
*result = GetWindowLongPtrW( hwnd, DWLP_MSGRESULT );
SetThreadDpiAwarenessContext( context );
TRACE_(relay)( "\1Ret dialog proc %p (hwnd=%p,msg=%s,wp=%08lx,lp=%08lx) retval=%08lx result=%08lx\n",
proc, hwnd, SPY_GetMsgName(msg, hwnd), wp, lp, ret, *result );
return ret;
}
Release 970509 Tue May 6 19:12:20 1997 Alexandre Julliard <julliard@lrc.epfl.ch> * [loader/task.c] [loader/module.c] Fixed command line in LoadModule to already include the length indicator (thanks to Andreas Mohr). * [windows/dialog.c] DlgDirList: fixed behavior with DDL_DRIVES | DDL_EXCLUSIVE (thanks to Bruce Milner for this one); correctly update file spec on exit. * [windows/winproc.c] [if1632/thunk.c] [include/callback.h] Moved emulator-specific code for calling window procedure to thunk.c. Mon Apr 28 10:21:59 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Better implementation of moveable blocks (first word in block is the handle itself) and discarded blocks. Local(Re)Alloc is much more like the real thing. Thu Apr 24 19:50:19 1997 Albrecht Kleine <kleine@ak.sax.de> * [objects/metafile.c] Added handling of meta record META_DIBCREATEPATTERNBRUSH. Mon Apr 21 14:03:32 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [multimedia/mmsystem.c] [multimedia/audio.c] Fixed leftover problems with masked device IDs. * [msdos/int21.c] Removed code duplications, fixed Write. * [windows/event.c] [windows/dce.c] [windows/nonclient.c] [windows/winpos.c] Yet another attempt to make -managed work better. * [controls/combo.c] UI fix. Mon Apr 21 13:10:24 1997 Marcus Meissner <msmeissn@immd4.informatik.uni-erlangen.de> * [debugger/*] All "Loading from ..." lines merged into one so important information before the crash doesn't scroll out. * [if1632/kernel.spec] Added some ordinal stubs used by win95 OLE and friends. * [win32/process.c] [if1632/kernel.spec] [loader/module.c] MsgWaitForMultipleObjects,GetProcessTimes,RtlImageNtHeaders, LoadLibraryEx32W and GetProcAddress32W added. * [objects/bitmap.c] XImages use another memory layout for depth 4 (and poss. other depths) then Windows bitmaps. Replaced speedup hack by generic (and better working) code. * [objects/dib.c] Another ximage!=bitmap memory layout bug. All _XinitImageFuncPtrs except one removed. Sun Apr 20 17:12:30 1997 Andrew Taylor <andrew@riscan.com> * [multimedia/audio.c] Fixed some regression bugs. Sun Apr 20 12:15:09 1997 Andreas Mohr <100.30936@germany.net> * [loader/module.c] Fixed MODULE_LoadExeHeader() to use the correct offset for fast-load area. Sat Apr 19 16:40:00 1997 Chad Fraleigh <chadf@bookcase.com> * [controls/*] [debugger/*] [graphics/win16drv/*] [loader/*] [misc/*] [win32/*] Removed <malloc.h> and added <stdlib.h> where needed. Changed printf formaters to match argument types (%lx instead of %x). Casted some types to make the compiler happy. Mostly pointer<->ulong. * [graphics/win16drv/init.c] Fixed uninitialized variable. * [include/msdos.h] Added <sys/types.h> needed for <dirent.h>. * [include/sigcontext.h] Combined a common NetBSD & FreeBSD #ifdef, and added in OpenBSD. Casted EIP_sig/ESP_sig to be unsigned long (declared as 'int' in *BSD). * [misc/crtdll.c] [misc/lstr.c] Casted last argument in v*printf() to be va_list. This code seems to make BIG assumptions about the implementation of va_list. * [misc/ver.c] Fixed impossible if() expression (unsigned < 0). * [misc/winsock.c] Removed semicolon on the end of an if() statement. * [windows/mdi.c] Changed a counter/index to unsigned since it was complaining about signed/unsigned comparison and didn't need to be negative. Wed Apr 16 17:43:19 1997 Georg Beyerle <gbeyerle@awi-potsdam.de> * [scheduler/thread.c] Minor fix in thread database initialization. Wed Apr 16 17:28:05 1997 Andreas Mohr <100.30936@germany.net> * [files/file.c] Fixed FILE_FillInfo() to omit the archive flag when handling a DOS directory entry.
1997-05-09 10:40:27 +02:00
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
/**********************************************************************
* WINPROC_AllocProc
Release 970329 Fri Mar 28 14:18:32 1997 Alexandre Julliard <julliard@lrc.epfl.ch> * [misc/main.c] [ANNOUNCE] Update the list of contributors. Please let me know if I forgot someone. * [controls/combo.c] Fixed bug in CB_DIR16 handling. Use correct text color in CBPaintText. * [controls/listbox.c] Fixed WM_CTLCOLOR handling. * [windows/winproc.c] Added translation for EM_*32 messages. Mon Mar 24 01:31:52 1997 Steffen Moeller <moeller@mpimg-berlin-dahlem.mpg.de> * [files/drive.c] Added information on device and inode numbers to the DOSDRIVE struct, using it to find DOS drives in a path even if it contains symbolic links, eliminating annoying messages at startup. Edited functions DRIVE_Init and rewrote DRIVE_FindDriveRoot. Wed Mar 19 16:31:18 1997 John Harvey <john@division.co.uk> * [graphics/win16drv/font.c] [graphics/win16drv/init.c] [graphics/x11drv/font.c] [objects/font.c] [include/gdi.h] [include/win16drv.h] [include/x11drv.h] Implemented GetCharWidth via graphics drivers. * [graphics/win16drv/Makefile.in] [graphics/win16drv/prtdrv.c] Moved printer driver interfaces into a separate file. * [graphics/win16drv/text.c] Fixed bugs that seg-faulted write. Wed Mar 19 13:52:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [BUGS] Update. * [controls/edit.c] Removed useless parameters from a lot of functions. * [controls/menu.c] Improved keyboard shortcuts. Added check for entries with popup menu in EnableMenuItem(). * [windows/winproc.c] [windows/win.c] [memory/selector.c] Do not allocate separate thunks for new windows. * [misc/clipboard.c] [windows/painting.c] Fixed problems with ClipBook. * [controls/combo.c] [controls/edit.c] [controls/listbox.c] [controls/widgets.c] [windows/graphics.c] [windows/defdlg.c] Combo rewrite. * [objects/dib.c] Slight improvements. Wed Mar 19 11:21:17 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [misc/crtdll.c] Added chdir/mkdir. * [misc/ntdll.c] Fixed some bugs, added RtlUnicodeStringToAnsiString. * [win32/process.c] Added initialisation of events/semaphores/mutices. Wed Mar 19 01:55:40 1997 Ricardo R. Massaro <massaro@ime.usp.br> * [resources/sysres_Po.rc] Added support for Portuguese language. Sat Mar 18 18:00:14 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de> * [windows/winpos.c] [if1632/user.spec] [if1632/user32.spec] Implemented SwitchToThisWindow(). * [misc/ver.c] Corrected a flaw in VerInstallFile32A. * [msdos/int21.c] Corrected wrong number in Int21 3305 Corrected Int21 714e, implemented Int21 7160,CL=2, 7143 and 7147 Sun Mar 16 09:53:04 1997 Andreas Mohr <100.30936@germany.net> * [loader/ne_module.c] Fixed NE_LoadSegments() to set size to pSeg->minsize rather than setting it to 0x10000 if pSeg->size is 0. Thu Mar 13 12:15:00 1997 Anand Kumria <akumria@ozemail.com.au> * [ANNOUNCE] Added ftp.progsoc.uts.edu.au as a mirror of Wine. * [memory/global.c] Removed MemManInfo sizeof check. Mon Mar 10 10:35:44 MET 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be> * [files/dos_fs.c] Pick up kernel dirent on glibc systems. * [loader/signal.c] Pick up kernel sigaction on glibc systems. Sat Mar 8 21:05:37 1997 Jimen Ching <jching@aloha.com> * [debugger/stabs.c] [debugger/msc.c] Check return value of mmap. Fri Mar 7 05:42:03 1997 Lee Jaekil <juria@seodu.co.kr> * [win32/code_page.c] Added IsValidCodePage.
1997-03-29 18:20:20 +01:00
*
* Allocate a window procedure for a window or class.
Release 970329 Fri Mar 28 14:18:32 1997 Alexandre Julliard <julliard@lrc.epfl.ch> * [misc/main.c] [ANNOUNCE] Update the list of contributors. Please let me know if I forgot someone. * [controls/combo.c] Fixed bug in CB_DIR16 handling. Use correct text color in CBPaintText. * [controls/listbox.c] Fixed WM_CTLCOLOR handling. * [windows/winproc.c] Added translation for EM_*32 messages. Mon Mar 24 01:31:52 1997 Steffen Moeller <moeller@mpimg-berlin-dahlem.mpg.de> * [files/drive.c] Added information on device and inode numbers to the DOSDRIVE struct, using it to find DOS drives in a path even if it contains symbolic links, eliminating annoying messages at startup. Edited functions DRIVE_Init and rewrote DRIVE_FindDriveRoot. Wed Mar 19 16:31:18 1997 John Harvey <john@division.co.uk> * [graphics/win16drv/font.c] [graphics/win16drv/init.c] [graphics/x11drv/font.c] [objects/font.c] [include/gdi.h] [include/win16drv.h] [include/x11drv.h] Implemented GetCharWidth via graphics drivers. * [graphics/win16drv/Makefile.in] [graphics/win16drv/prtdrv.c] Moved printer driver interfaces into a separate file. * [graphics/win16drv/text.c] Fixed bugs that seg-faulted write. Wed Mar 19 13:52:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [BUGS] Update. * [controls/edit.c] Removed useless parameters from a lot of functions. * [controls/menu.c] Improved keyboard shortcuts. Added check for entries with popup menu in EnableMenuItem(). * [windows/winproc.c] [windows/win.c] [memory/selector.c] Do not allocate separate thunks for new windows. * [misc/clipboard.c] [windows/painting.c] Fixed problems with ClipBook. * [controls/combo.c] [controls/edit.c] [controls/listbox.c] [controls/widgets.c] [windows/graphics.c] [windows/defdlg.c] Combo rewrite. * [objects/dib.c] Slight improvements. Wed Mar 19 11:21:17 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [misc/crtdll.c] Added chdir/mkdir. * [misc/ntdll.c] Fixed some bugs, added RtlUnicodeStringToAnsiString. * [win32/process.c] Added initialisation of events/semaphores/mutices. Wed Mar 19 01:55:40 1997 Ricardo R. Massaro <massaro@ime.usp.br> * [resources/sysres_Po.rc] Added support for Portuguese language. Sat Mar 18 18:00:14 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de> * [windows/winpos.c] [if1632/user.spec] [if1632/user32.spec] Implemented SwitchToThisWindow(). * [misc/ver.c] Corrected a flaw in VerInstallFile32A. * [msdos/int21.c] Corrected wrong number in Int21 3305 Corrected Int21 714e, implemented Int21 7160,CL=2, 7143 and 7147 Sun Mar 16 09:53:04 1997 Andreas Mohr <100.30936@germany.net> * [loader/ne_module.c] Fixed NE_LoadSegments() to set size to pSeg->minsize rather than setting it to 0x10000 if pSeg->size is 0. Thu Mar 13 12:15:00 1997 Anand Kumria <akumria@ozemail.com.au> * [ANNOUNCE] Added ftp.progsoc.uts.edu.au as a mirror of Wine. * [memory/global.c] Removed MemManInfo sizeof check. Mon Mar 10 10:35:44 MET 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be> * [files/dos_fs.c] Pick up kernel dirent on glibc systems. * [loader/signal.c] Pick up kernel sigaction on glibc systems. Sat Mar 8 21:05:37 1997 Jimen Ching <jching@aloha.com> * [debugger/stabs.c] [debugger/msc.c] Check return value of mmap. Fri Mar 7 05:42:03 1997 Lee Jaekil <juria@seodu.co.kr> * [win32/code_page.c] Added IsValidCodePage.
1997-03-29 18:20:20 +01:00
*
* Note that allocated winprocs are never freed; the idea is that even if an app creates a
* lot of windows, it will usually only have a limited number of window procedures, so the
* array won't grow too large, and this way we avoid the need to track allocations per window.
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
*/
static WNDPROC WINPROC_AllocProc( WNDPROC func, BOOL unicode )
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
{
return (WNDPROC)NtUserCallTwoParam( (UINT_PTR)func, !unicode, NtUserAllocWinProc );
Release 960606 Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] [controls/listbox.c] Fixed wParam of WM_DRAWITEM message. * [if1632/Makefile.in] [loader/builtin.c] Remove WPROCS32 DLL, as the relay code can call Wine routines directly. * [loader/module.c] [loader/ne_image.c] Fixed initial stack layout for self-loading modules. * [tools/build.c] Fixed data segment building for Win16 modules. * [windows/defdlg.c] Implemented Win32 versions of DefDlgProc(). * [windows/dialog.c] Merged Win16 and Win32 dialog code. Added support for control extra data in dialog item template. * [windows/win.c] Unified Win16 and Win32 versions of CreateWindow(). Implemented Win32 version of GetWindowLong(). * [windows/winproc.c] Changed the implementation of window procedures, so that 16-bit winprocs are valid segmented pointers. Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [misc/registry.c] Fixed another bug in the w95 loader. Quietened some debug output. Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de> * [windows/winproc.c] Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT. Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk> * [resources/TODO] [resources/sysres_It.rc] Updated font dialog box. Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de> * [include/commdlg.h] [misc/commdlg.c] ChooseFont() and ChooseColor(): Bugfixes and added more support for some CF_* and CC_* flags: dialog templates and font size control. Bugfix in structure definition of CHOOSECOLOR definition. * [ipc/dde_proc.c] [windows/event.c] Replaced SendMessage with SendMessage16 and added inclusion of dde_proc.h for error-free compilation of ipc module. Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/scroll.c] Made ScrollDC to save/restore current clipping region. * [misc/clipboard.c] [windows/event.c] Implemented most of the previously missing features (not tested), improved text pasting from/to X. * [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c] [objects/gdiobj.c] [objects/clipping.c] [windows/dce.c] [windows/winpos.c] [windows/painting.c] Updated DCE code, implemented dynamic invalidation of owned DCs. This fixes a lot of problems with scrolling in WinWord. Not sure about the effect on -desktop. Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [win32/time.c] [if1632/kernel32.spec] Added SetSystemTime and SetTimeZoneInformation. * [if1632/kernel32.spec] Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen. * [include/windows.h] Added SYSTEM_POWER_STATUS structure and prototypes for GetSystemPowerStatus, SetSystemPowerState, SetSystemTime. * [include/kernel32.h] Added a prototype for SetTimeZoneInformation. * [win32/environment.c] [if1632/kernel32.spec] Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
}
/**********************************************************************
* WINPROC_TestLBForStr
*
* Return TRUE if the lparam is a string
*/
static inline BOOL WINPROC_TestLBForStr( HWND hwnd, UINT msg )
{
DWORD style = GetWindowLongA( hwnd, GWL_STYLE );
if (msg <= CB_MSGMAX)
return (!(style & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) || (style & CBS_HASSTRINGS));
else
return (!(style & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) || (style & LBS_HASSTRINGS));
}
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
/**********************************************************************
* WINPROC_CallProcAtoW
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
*
* Call a window procedure, translating args from Ansi to Unicode.
*/
LRESULT WINPROC_CallProcAtoW( winproc_callback_t callback, HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam, LRESULT *result, void *arg, enum wm_char_mapping mapping )
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
{
LRESULT ret = 0;
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
switch(msg)
{
case WM_NCCREATE:
case WM_CREATE:
{
WCHAR *ptr, buffer[512];
CREATESTRUCTA *csA = (CREATESTRUCTA *)lParam;
CREATESTRUCTW csW = *(CREATESTRUCTW *)csA;
MDICREATESTRUCTW mdi_cs;
DWORD name_lenA = 0, name_lenW = 0, class_lenA = 0, class_lenW = 0;
if (!IS_INTRESOURCE(csA->lpszClass))
{
class_lenA = strlen(csA->lpszClass) + 1;
RtlMultiByteToUnicodeSize( &class_lenW, csA->lpszClass, class_lenA );
}
if (!IS_INTRESOURCE(csA->lpszName))
{
name_lenA = strlen(csA->lpszName) + 1;
RtlMultiByteToUnicodeSize( &name_lenW, csA->lpszName, name_lenA );
}
if (!(ptr = get_buffer( buffer, sizeof(buffer), class_lenW + name_lenW ))) break;
if (class_lenW)
{
csW.lpszClass = ptr;
RtlMultiByteToUnicodeN( ptr, class_lenW, NULL, csA->lpszClass, class_lenA );
}
if (name_lenW)
{
csW.lpszName = ptr + class_lenW/sizeof(WCHAR);
RtlMultiByteToUnicodeN( ptr + class_lenW/sizeof(WCHAR), name_lenW, NULL,
csA->lpszName, name_lenA );
}
if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_MDICHILD)
{
mdi_cs = *(MDICREATESTRUCTW *)csA->lpCreateParams;
mdi_cs.szTitle = csW.lpszName;
mdi_cs.szClass = csW.lpszClass;
csW.lpCreateParams = &mdi_cs;
}
ret = callback( hwnd, msg, wParam, (LPARAM)&csW, result, arg );
free_buffer( buffer, ptr );
}
break;
case WM_MDICREATE:
{
WCHAR *ptr, buffer[512];
DWORD title_lenA = 0, title_lenW = 0, class_lenA = 0, class_lenW = 0;
MDICREATESTRUCTA *csA = (MDICREATESTRUCTA *)lParam;
MDICREATESTRUCTW csW;
memcpy( &csW, csA, sizeof(csW) );
if (!IS_INTRESOURCE(csA->szTitle))
{
title_lenA = strlen(csA->szTitle) + 1;
RtlMultiByteToUnicodeSize( &title_lenW, csA->szTitle, title_lenA );
}
if (!IS_INTRESOURCE(csA->szClass))
{
class_lenA = strlen(csA->szClass) + 1;
RtlMultiByteToUnicodeSize( &class_lenW, csA->szClass, class_lenA );
}
if (!(ptr = get_buffer( buffer, sizeof(buffer), title_lenW + class_lenW ))) break;
if (title_lenW)
{
csW.szTitle = ptr;
RtlMultiByteToUnicodeN( ptr, title_lenW, NULL, csA->szTitle, title_lenA );
}
if (class_lenW)
{
csW.szClass = ptr + title_lenW/sizeof(WCHAR);
RtlMultiByteToUnicodeN( ptr + title_lenW/sizeof(WCHAR), class_lenW, NULL,
csA->szClass, class_lenA );
}
ret = callback( hwnd, msg, wParam, (LPARAM)&csW, result, arg );
free_buffer( buffer, ptr );
}
break;
case WM_GETTEXT:
case WM_ASKCBFORMATNAME:
{
WCHAR *ptr, buffer[512];
LPSTR str = (LPSTR)lParam;
DWORD len = wParam * sizeof(WCHAR);
if (!(ptr = get_buffer( buffer, sizeof(buffer), len ))) break;
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
if (wParam)
{
len = 0;
if (*result)
RtlUnicodeToMultiByteN( str, wParam - 1, &len, ptr, ret * sizeof(WCHAR) );
str[len] = 0;
*result = len;
}
free_buffer( buffer, ptr );
}
break;
case LB_ADDSTRING:
case LB_INSERTSTRING:
case LB_FINDSTRING:
case LB_FINDSTRINGEXACT:
case LB_SELECTSTRING:
case CB_ADDSTRING:
case CB_INSERTSTRING:
case CB_FINDSTRING:
case CB_FINDSTRINGEXACT:
case CB_SELECTSTRING:
if (!lParam || !WINPROC_TestLBForStr( hwnd, msg ))
{
ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
}
/* fall through */
case WM_SETTEXT:
case WM_WININICHANGE:
case WM_DEVMODECHANGE:
case CB_DIR:
case LB_DIR:
case LB_ADDFILE:
case EM_REPLACESEL:
if (!lParam) ret = callback( hwnd, msg, wParam, lParam, result, arg );
else
{
WCHAR *ptr, buffer[512];
LPCSTR strA = (LPCSTR)lParam;
DWORD lenW, lenA = strlen(strA) + 1;
RtlMultiByteToUnicodeSize( &lenW, strA, lenA );
if ((ptr = get_buffer( buffer, sizeof(buffer), lenW )))
{
RtlMultiByteToUnicodeN( ptr, lenW, NULL, strA, lenA );
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
free_buffer( buffer, ptr );
}
}
break;
case LB_GETTEXT:
case CB_GETLBTEXT:
if (lParam && WINPROC_TestLBForStr( hwnd, msg ))
{
WCHAR buffer[512]; /* FIXME: fixed sized buffer */
ret = callback( hwnd, msg, wParam, (LPARAM)buffer, result, arg );
if (*result >= 0)
{
DWORD len;
RtlUnicodeToMultiByteN( (LPSTR)lParam, 512 * 3, &len,
buffer, (lstrlenW(buffer) + 1) * sizeof(WCHAR) );
*result = len - 1;
}
}
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
case EM_GETLINE:
{
WCHAR *ptr, buffer[512];
WORD len = *(WORD *)lParam;
if (!(ptr = get_buffer( buffer, sizeof(buffer), len * sizeof(WCHAR) ))) break;
*((WORD *)ptr) = len; /* store the length */
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
if (*result)
{
DWORD reslen;
RtlUnicodeToMultiByteN( (LPSTR)lParam, len, &reslen, ptr, *result * sizeof(WCHAR) );
if (reslen < len) ((LPSTR)lParam)[reslen] = 0;
*result = reslen;
}
free_buffer( buffer, ptr );
}
break;
case WM_GETDLGCODE:
if (lParam)
{
MSG newmsg = *(MSG *)lParam;
if (map_wparam_AtoW( newmsg.message, &newmsg.wParam, WMCHAR_MAP_NOMAPPING ))
ret = callback( hwnd, msg, wParam, (LPARAM)&newmsg, result, arg );
}
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
case WM_CHARTOITEM:
case WM_MENUCHAR:
case WM_CHAR:
case WM_DEADCHAR:
case WM_SYSCHAR:
case WM_SYSDEADCHAR:
case EM_SETPASSWORDCHAR:
case WM_IME_CHAR:
if (map_wparam_AtoW( msg, &wParam, mapping ))
ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
case WM_GETTEXTLENGTH:
case CB_GETLBTEXTLEN:
case LB_GETTEXTLEN:
ret = callback( hwnd, msg, wParam, lParam, result, arg );
if (*result >= 0)
{
WCHAR *ptr, buffer[512];
LRESULT tmp;
DWORD len = *result + 1;
/* Determine respective GETTEXT message */
UINT msgGetText = (msg == WM_GETTEXTLENGTH) ? WM_GETTEXT :
((msg == CB_GETLBTEXTLEN) ? CB_GETLBTEXT : LB_GETTEXT);
/* wParam differs between the messages */
WPARAM wp = (msg == WM_GETTEXTLENGTH) ? len : wParam;
if (!(ptr = get_buffer( buffer, sizeof(buffer), len * sizeof(WCHAR) ))) break;
if (callback == call_window_proc) /* FIXME: hack */
callback( hwnd, msgGetText, wp, (LPARAM)ptr, &tmp, arg );
else
tmp = SendMessageW( hwnd, msgGetText, wp, (LPARAM)ptr );
RtlUnicodeToMultiByteSize( &len, ptr, tmp * sizeof(WCHAR) );
*result = len;
free_buffer( buffer, ptr );
}
break;
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
FIXME_(msg)( "message %s (0x%x) needs translation, please report\n",
SPY_GetMsgName(msg, hwnd), msg );
break;
default:
ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
}
return ret;
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
}
/**********************************************************************
* WINPROC_CallProcWtoA
*
* Call a window procedure, translating args from Unicode to Ansi.
*/
static LRESULT WINPROC_CallProcWtoA( winproc_callback_t callback, HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam, LRESULT *result, void *arg )
{
LRESULT ret = 0;
TRACE_(msg)("(hwnd=%p,msg=%s,wp=%08lx,lp=%08lx)\n",
hwnd, SPY_GetMsgName(msg, hwnd), wParam, lParam);
switch(msg)
{
case WM_NCCREATE:
case WM_CREATE:
{
char buffer[1024], *cls;
CREATESTRUCTW *csW = (CREATESTRUCTW *)lParam;
CREATESTRUCTA csA = *(CREATESTRUCTA *)csW;
MDICREATESTRUCTA mdi_cs;
DWORD name_lenA = 0, name_lenW = 0, class_lenA = 0, class_lenW = 0;
if (!IS_INTRESOURCE(csW->lpszClass))
{
class_lenW = (lstrlenW(csW->lpszClass) + 1) * sizeof(WCHAR);
RtlUnicodeToMultiByteSize(&class_lenA, csW->lpszClass, class_lenW);
}
if (!IS_INTRESOURCE(csW->lpszName))
{
name_lenW = (lstrlenW(csW->lpszName) + 1) * sizeof(WCHAR);
RtlUnicodeToMultiByteSize(&name_lenA, csW->lpszName, name_lenW);
}
if (!(cls = get_buffer( buffer, sizeof(buffer), class_lenA + name_lenA ))) break;
if (class_lenA)
{
RtlUnicodeToMultiByteN(cls, class_lenA, NULL, csW->lpszClass, class_lenW);
csA.lpszClass = cls;
}
if (name_lenA)
{
char *name = cls + class_lenA;
RtlUnicodeToMultiByteN(name, name_lenA, NULL, csW->lpszName, name_lenW);
csA.lpszName = name;
}
if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_MDICHILD)
{
mdi_cs = *(MDICREATESTRUCTA *)csW->lpCreateParams;
mdi_cs.szTitle = csA.lpszName;
mdi_cs.szClass = csA.lpszClass;
csA.lpCreateParams = &mdi_cs;
}
ret = callback( hwnd, msg, wParam, (LPARAM)&csA, result, arg );
free_buffer( buffer, cls );
}
break;
case WM_GETTEXT:
case WM_ASKCBFORMATNAME:
{
char *ptr, buffer[512];
DWORD len = wParam * 2;
if (!(ptr = get_buffer( buffer, sizeof(buffer), len ))) break;
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
if (len)
{
if (*result)
{
RtlMultiByteToUnicodeN( (LPWSTR)lParam, wParam*sizeof(WCHAR), &len, ptr, ret + 1 );
*result = len/sizeof(WCHAR) - 1; /* do not count terminating null */
}
((LPWSTR)lParam)[*result] = 0;
}
free_buffer( buffer, ptr );
}
break;
case LB_ADDSTRING:
case LB_INSERTSTRING:
case LB_FINDSTRING:
case LB_FINDSTRINGEXACT:
case LB_SELECTSTRING:
case CB_ADDSTRING:
case CB_INSERTSTRING:
case CB_FINDSTRING:
case CB_FINDSTRINGEXACT:
case CB_SELECTSTRING:
if (!lParam || !WINPROC_TestLBForStr( hwnd, msg ))
{
ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
}
/* fall through */
case WM_SETTEXT:
case WM_WININICHANGE:
case WM_DEVMODECHANGE:
case CB_DIR:
case LB_DIR:
case LB_ADDFILE:
case EM_REPLACESEL:
if (!lParam) ret = callback( hwnd, msg, wParam, lParam, result, arg );
else
{
char *ptr, buffer[512];
LPCWSTR strW = (LPCWSTR)lParam;
DWORD lenA, lenW = (lstrlenW(strW) + 1) * sizeof(WCHAR);
RtlUnicodeToMultiByteSize( &lenA, strW, lenW );
if ((ptr = get_buffer( buffer, sizeof(buffer), lenA )))
{
RtlUnicodeToMultiByteN( ptr, lenA, NULL, strW, lenW );
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
free_buffer( buffer, ptr );
}
}
break;
case WM_MDICREATE:
{
char *ptr, buffer[1024];
DWORD title_lenA = 0, title_lenW = 0, class_lenA = 0, class_lenW = 0;
MDICREATESTRUCTW *csW = (MDICREATESTRUCTW *)lParam;
MDICREATESTRUCTA csA;
memcpy( &csA, csW, sizeof(csA) );
if (!IS_INTRESOURCE(csW->szTitle))
{
title_lenW = (lstrlenW(csW->szTitle) + 1) * sizeof(WCHAR);
RtlUnicodeToMultiByteSize( &title_lenA, csW->szTitle, title_lenW );
}
if (!IS_INTRESOURCE(csW->szClass))
{
class_lenW = (lstrlenW(csW->szClass) + 1) * sizeof(WCHAR);
RtlUnicodeToMultiByteSize( &class_lenA, csW->szClass, class_lenW );
}
if (!(ptr = get_buffer( buffer, sizeof(buffer), title_lenA + class_lenA ))) break;
if (title_lenA)
{
RtlUnicodeToMultiByteN( ptr, title_lenA, NULL, csW->szTitle, title_lenW );
csA.szTitle = ptr;
}
if (class_lenA)
{
RtlUnicodeToMultiByteN( ptr + title_lenA, class_lenA, NULL, csW->szClass, class_lenW );
csA.szClass = ptr + title_lenA;
}
ret = callback( hwnd, msg, wParam, (LPARAM)&csA, result, arg );
free_buffer( buffer, ptr );
}
break;
case LB_GETTEXT:
case CB_GETLBTEXT:
if (lParam && WINPROC_TestLBForStr( hwnd, msg ))
{
char buffer[512]; /* FIXME: fixed sized buffer */
ret = callback( hwnd, msg, wParam, (LPARAM)buffer, result, arg );
if (*result >= 0)
{
DWORD len;
RtlMultiByteToUnicodeN( (LPWSTR)lParam, 512 * 3, &len, buffer, strlen(buffer) + 1 );
*result = len / sizeof(WCHAR) - 1;
}
}
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
case EM_GETLINE:
{
char *ptr, buffer[512];
WORD len = *(WORD *)lParam;
if (!(ptr = get_buffer( buffer, sizeof(buffer), len * 2 ))) break;
*((WORD *)ptr) = len * 2; /* store the length */
ret = callback( hwnd, msg, wParam, (LPARAM)ptr, result, arg );
if (*result)
{
DWORD reslen;
RtlMultiByteToUnicodeN( (LPWSTR)lParam, len*sizeof(WCHAR), &reslen, ptr, *result );
*result = reslen / sizeof(WCHAR);
if (*result < len) ((LPWSTR)lParam)[*result] = 0;
}
free_buffer( buffer, ptr );
}
break;
case WM_GETDLGCODE:
if (lParam)
{
MSG newmsg = *(MSG *)lParam;
switch(newmsg.message)
{
case WM_CHAR:
case WM_DEADCHAR:
case WM_SYSCHAR:
case WM_SYSDEADCHAR:
newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 1 );
break;
case WM_IME_CHAR:
newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 2 );
break;
}
ret = callback( hwnd, msg, wParam, (LPARAM)&newmsg, result, arg );
}
else ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
case WM_CHAR:
{
WCHAR wch = wParam;
char ch[2];
DWORD cp = get_input_codepage();
DWORD len = WideCharToMultiByte( cp, 0, &wch, 1, ch, 2, NULL, NULL );
ret = callback( hwnd, msg, (BYTE)ch[0], lParam, result, arg );
if (len == 2) ret = callback( hwnd, msg, (BYTE)ch[1], lParam, result, arg );
}
break;
case WM_CHARTOITEM:
case WM_MENUCHAR:
case WM_DEADCHAR:
case WM_SYSCHAR:
case WM_SYSDEADCHAR:
case EM_SETPASSWORDCHAR:
ret = callback( hwnd, msg, map_wparam_char_WtoA(wParam,1), lParam, result, arg );
break;
case WM_IME_CHAR:
ret = callback( hwnd, msg, map_wparam_char_WtoA(wParam,2), lParam, result, arg );
break;
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
FIXME_(msg)( "message %s (%04x) needs translation, please report\n",
SPY_GetMsgName(msg, hwnd), msg );
break;
default:
ret = callback( hwnd, msg, wParam, lParam, result, arg );
break;
}
return ret;
Release 960705 Fri Jul 5 16:27:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/desktop.c] Use Windows file I/O routines to load the desktop bitmap. * [files/file.c] Implemented RemoveDirectory* and DeleteFile*. * [include/wine.h] Added SIGCONTEXT typedef to replace #define sigcontext_struct. * [loader/task.c] Fixed initial breakpoint setting for Win32 tasks. * [misc/wsprintf.c] Ignore Unicode formats for wsprintf16(). * [objects/font.c] Implemented Win32 version of GetTextMetrics. * [windows/winproc.c] [windows/win.c] [windows/class.c] [windows/dialog.c] Modified windows procedures to use thunks, to ensure that the procedure can be called directly from the Windows program. * [windows/win.c] Added function WIN_BuildWinArray() to make it easier to enumerate windows. Implemented Win32 version of EnumWindows() and friends. Fri Jul 5 11:56:22 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de> * [controls/button.c] [windows/win.c] Operator precedence fixes. * [controls/edit.c] Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles. Fixed word wrap with long words. * [debugger/debug.l] New alias "where" for command "backtrace". * [if1632/gdi.spec] Corrected parameter of ExtTextOut. * [loader/module.c] Corrected printing of table of modules. * [misc/spy.c] Removed superfluous \n in message name. * [windows/message.c] Declared MSG_SendMessage as static. Changed parameter of DirectedYield() from queue handle to task handle. Removed warning mesages for argument of printf. * [windows/nonclient.c] Added the flag DT_NOPREFIX when drawing window titles. * [windows/win.c] WIN_WalkWindows now prints the invalid window handle. Added a warning if Get-/SetWindowWord/-Long gets an invalid offset. * [windows/winproc.c] Allows creating dialog windows with NULL as dialog function. Wed Jul 3 09:26:41 1996 Andrew Lewycky <plewycky@oise.utoronto.ca> * [windows/event.c] EVENT_key: Fixes to VK_ code generation for space bar and punctuation. * [files/file.c] GetTempFileName: first character in temporary name is "~". * [memory/heap.c] HEAP_MakeInUseBlockFree now frees the whole subheap if possible. * [objects/text.c] ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE. * [misc/driver.c] Removed some bugs and reformatted. Actually loads drivers now. * [include/callback.h] Added CallDriverProc() and CallWindowsExitProc(). * [loader/module.c] MODULE_CallWEP(): new function. * [misc/lzexpand.c] LZSeek(): return new pointer, not old one. * [misc/ver.c] find_ne_resource(): fixed dependence on LZSeek() bug. GetFileResource(): initialize reslen before using it. * [windows/class.c] SetClassWord(): add missing else. * [objects/font.c] lpFontList is now MAX_FONTS+1. It used to overwrite the array. InitFontList: allocate one huge array of structures. FONT_MatchFont: uppercase the face name. Thu Jun 27 12:41:40 1996 Bruce Milner <bruce@genetics.utah.edu> * [memory/heap.c] Fixed a typo in HeapReAlloc(). Tue Jun 25 22:22:03 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/directory.c] [files/drive.c] [if1632/kernel.spec] [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h] GetTempPath* added GetDriveType* fixed, updated to NewNameStandard. GetCurrentDirectory* fixed (needs to prepend X:\). * [controls/listbox.c] Missing NULL check added. * [if1632/winmm.spec] [loader/builtin.c] winmm.dll (32bit mmsystem equivalent) specs added. * [memory/string.c] [if1632/kernel32.spec] [include/windows.h] Rtl{Move,Zero,Fill}Memory added. * [misc/registry.c] Some NULL ptr dereference bugs fixed. * [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c] Check for NULL ptr. Fill mciOpenDrv when mixing mciOpen and mciSendString("open .."). Aliasing should work for all MCI devices. * [windows/win.c] Allow passing invalid window handles to CloseWindow(). Tue Jun 25 20:02:15 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [files/directory.c] [if1632/kernel32.spec] GetSystemDirectory32A and GetSystemDirectory32W added. * [misc/main.c] [if1632/kernel32.spec] Beep and SetEnvironmentVariable32W added.
1996-07-05 19:14:13 +02:00
}
static void dispatch_win_proc_params( struct win_proc_params *params )
{
DPI_AWARENESS_CONTEXT context = SetThreadDpiAwarenessContext( params->dpi_awareness );
if (!params->ansi)
{
if (params->procW == WINPROC_PROC16)
WINPROC_CallProcWtoA( wow_handlers.call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
else if (params->is_dialog)
{
if (!params->ansi_dst)
{
if (params->procW)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procW );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
else
{
if (params->procA)
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procA );
else
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
}
}
else if (params->procW)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procW );
else if (params->procA)
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procA );
else if (!params->ansi_dst)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
else
WINPROC_CallProcWtoA( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func );
}
else
{
if (params->procA == WINPROC_PROC16)
wow_handlers.call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
else if (params->is_dialog)
{
if (!params->ansi_dst)
{
if (params->procW)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procW, params->mapping );
else
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func, params->mapping );
}
else
{
if (params->procA)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procA );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
}
else if (params->procA)
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->procA );
else if (params->procW)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->procW, params->mapping );
else if (!params->ansi_dst)
WINPROC_CallProcAtoW( call_window_proc, params->hwnd, params->msg, params->wparam,
params->lparam, params->result, params->func, params->mapping );
else
call_window_proc( params->hwnd, params->msg, params->wparam, params->lparam,
params->result, params->func );
}
SetThreadDpiAwarenessContext( context );
}
/* make sure that there is space for 'size' bytes in buffer, growing it if needed */
static inline void *get_buffer_space( void **buffer, size_t size, size_t prev_size )
{
if (prev_size > size && !(*buffer = HeapAlloc( GetProcessHeap(), 0, size ))) return NULL;
return *buffer;
}
/* check whether a combobox expects strings or ids in CB_ADDSTRING/CB_INSERTSTRING */
static inline BOOL combobox_has_strings( HWND hwnd )
{
DWORD style = GetWindowLongA( hwnd, GWL_STYLE );
return (!(style & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) || (style & CBS_HASSTRINGS));
}
/* check whether a listbox expects strings or ids in LB_ADDSTRING/LB_INSERTSTRING */
static inline BOOL listbox_has_strings( HWND hwnd )
{
DWORD style = GetWindowLongA( hwnd, GWL_STYLE );
return (!(style & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) || (style & LBS_HASSTRINGS));
}
/* unpack a potentially 64-bit pointer, returning 0 when truncated */
static inline void *unpack_ptr( ULONGLONG ptr64 )
{
if ((ULONG_PTR)ptr64 != ptr64) return 0;
return (void *)(ULONG_PTR)ptr64;
}
/* convert a server handle to a generic handle */
static inline HANDLE unpack_handle( UINT handle )
{
return (HANDLE)(INT_PTR)(int)handle;
}
/* make sure that the buffer contains a valid null-terminated Unicode string */
static inline BOOL check_string( LPCWSTR str, size_t size )
{
for (size /= sizeof(WCHAR); size; size--, str++)
if (!*str) return TRUE;
return FALSE;
}
/***********************************************************************
* unpack_message
*
* Unpack a message received from another process.
*/
static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size )
{
size_t minsize = 0, prev_size = size;
union packed_structs *ps = *buffer;
switch(message)
{
case WM_NCCREATE:
case WM_CREATE:
{
CREATESTRUCTW cs;
WCHAR *str = (WCHAR *)(&ps->cs + 1);
if (size < sizeof(ps->cs)) return FALSE;
size -= sizeof(ps->cs);
cs.lpCreateParams = unpack_ptr( ps->cs.lpCreateParams );
cs.hInstance = unpack_ptr( ps->cs.hInstance );
cs.hMenu = unpack_handle( ps->cs.hMenu );
cs.hwndParent = unpack_handle( ps->cs.hwndParent );
cs.cy = ps->cs.cy;
cs.cx = ps->cs.cx;
cs.y = ps->cs.y;
cs.x = ps->cs.x;
cs.style = ps->cs.style;
cs.dwExStyle = ps->cs.dwExStyle;
cs.lpszName = unpack_ptr( ps->cs.lpszName );
cs.lpszClass = unpack_ptr( ps->cs.lpszClass );
if (ps->cs.lpszName >> 16)
{
if (!check_string( str, size )) return FALSE;
cs.lpszName = str;
size -= (lstrlenW(str) + 1) * sizeof(WCHAR);
str += lstrlenW(str) + 1;
}
if (ps->cs.lpszClass >> 16)
{
if (!check_string( str, size )) return FALSE;
cs.lpszClass = str;
}
memcpy( &ps->cs, &cs, sizeof(cs) );
break;
}
case WM_GETTEXT:
case WM_ASKCBFORMATNAME:
if (!get_buffer_space( buffer, (*wparam * sizeof(WCHAR)), size )) return FALSE;
break;
case WM_WININICHANGE:
if (!*lparam) return TRUE;
/* fall through */
case WM_SETTEXT:
case WM_DEVMODECHANGE:
case CB_DIR:
case LB_DIR:
case LB_ADDFILE:
case EM_REPLACESEL:
if (!check_string( *buffer, size )) return FALSE;
break;
case WM_GETMINMAXINFO:
minsize = sizeof(MINMAXINFO);
break;
case WM_DRAWITEM:
{
DRAWITEMSTRUCT dis;
if (size < sizeof(ps->dis)) return FALSE;
dis.CtlType = ps->dis.CtlType;
dis.CtlID = ps->dis.CtlID;
dis.itemID = ps->dis.itemID;
dis.itemAction = ps->dis.itemAction;
dis.itemState = ps->dis.itemState;
dis.hwndItem = unpack_handle( ps->dis.hwndItem );
dis.hDC = unpack_handle( ps->dis.hDC );
dis.rcItem = ps->dis.rcItem;
dis.itemData = (ULONG_PTR)unpack_ptr( ps->dis.itemData );
memcpy( &ps->dis, &dis, sizeof(dis) );
break;
}
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT mis;
if (size < sizeof(ps->mis)) return FALSE;
mis.CtlType = ps->mis.CtlType;
mis.CtlID = ps->mis.CtlID;
mis.itemID = ps->mis.itemID;
mis.itemWidth = ps->mis.itemWidth;
mis.itemHeight = ps->mis.itemHeight;
mis.itemData = (ULONG_PTR)unpack_ptr( ps->mis.itemData );
memcpy( &ps->mis, &mis, sizeof(mis) );
break;
}
case WM_DELETEITEM:
{
DELETEITEMSTRUCT dls;
if (size < sizeof(ps->dls)) return FALSE;
dls.CtlType = ps->dls.CtlType;
dls.CtlID = ps->dls.CtlID;
dls.itemID = ps->dls.itemID;
dls.hwndItem = unpack_handle( ps->dls.hwndItem );
dls.itemData = (ULONG_PTR)unpack_ptr( ps->dls.itemData );
memcpy( &ps->dls, &dls, sizeof(dls) );
break;
}
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT cis;
if (size < sizeof(ps->cis)) return FALSE;
cis.CtlType = ps->cis.CtlType;
cis.CtlID = ps->cis.CtlID;
cis.hwndItem = unpack_handle( ps->cis.hwndItem );
cis.itemID1 = ps->cis.itemID1;
cis.itemData1 = (ULONG_PTR)unpack_ptr( ps->cis.itemData1 );
cis.itemID2 = ps->cis.itemID2;
cis.itemData2 = (ULONG_PTR)unpack_ptr( ps->cis.itemData2 );
cis.dwLocaleId = ps->cis.dwLocaleId;
memcpy( &ps->cis, &cis, sizeof(cis) );
break;
}
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS wp;
if (size < sizeof(ps->wp)) return FALSE;
wp.hwnd = unpack_handle( ps->wp.hwnd );
wp.hwndInsertAfter = unpack_handle( ps->wp.hwndInsertAfter );
wp.x = ps->wp.x;
wp.y = ps->wp.y;
wp.cx = ps->wp.cx;
wp.cy = ps->wp.cy;
wp.flags = ps->wp.flags;
memcpy( &ps->wp, &wp, sizeof(wp) );
break;
}
case WM_COPYDATA:
{
COPYDATASTRUCT cds;
if (size < sizeof(ps->cds)) return FALSE;
cds.dwData = (ULONG_PTR)unpack_ptr( ps->cds.dwData );
if (ps->cds.lpData)
{
cds.cbData = ps->cds.cbData;
cds.lpData = &ps->cds + 1;
minsize = sizeof(ps->cds) + cds.cbData;
}
else
{
cds.cbData = 0;
cds.lpData = 0;
}
memcpy( &ps->cds, &cds, sizeof(cds) );
break;
}
case WM_NOTIFY:
/* WM_NOTIFY cannot be sent across processes (MSDN) */
return FALSE;
case WM_HELP:
{
HELPINFO hi;
if (size < sizeof(ps->hi)) return FALSE;
hi.cbSize = sizeof(hi);
hi.iContextType = ps->hi.iContextType;
hi.iCtrlId = ps->hi.iCtrlId;
hi.hItemHandle = unpack_handle( ps->hi.hItemHandle );
hi.dwContextId = (ULONG_PTR)unpack_ptr( ps->hi.dwContextId );
hi.MousePos = ps->hi.MousePos;
memcpy( &ps->hi, &hi, sizeof(hi) );
break;
}
case WM_STYLECHANGING:
case WM_STYLECHANGED:
minsize = sizeof(STYLESTRUCT);
break;
case WM_NCCALCSIZE:
if (!*wparam) minsize = sizeof(RECT);
else
{
NCCALCSIZE_PARAMS ncp;
WINDOWPOS wp;
if (size < sizeof(ps->ncp)) return FALSE;
ncp.rgrc[0] = ps->ncp.rgrc[0];
ncp.rgrc[1] = ps->ncp.rgrc[1];
ncp.rgrc[2] = ps->ncp.rgrc[2];
wp.hwnd = unpack_handle( ps->ncp.hwnd );
wp.hwndInsertAfter = unpack_handle( ps->ncp.hwndInsertAfter );
wp.x = ps->ncp.x;
wp.y = ps->ncp.y;
wp.cx = ps->ncp.cx;
wp.cy = ps->ncp.cy;
wp.flags = ps->ncp.flags;
ncp.lppos = (WINDOWPOS *)((NCCALCSIZE_PARAMS *)&ps->ncp + 1);
memcpy( &ps->ncp, &ncp, sizeof(ncp) );
*ncp.lppos = wp;
}
break;
case WM_GETDLGCODE:
if (*lparam)
{
MSG msg;
if (size < sizeof(ps->msg)) return FALSE;
msg.hwnd = unpack_handle( ps->msg.hwnd );
msg.message = ps->msg.message;
msg.wParam = (ULONG_PTR)unpack_ptr( ps->msg.wParam );
msg.lParam = (ULONG_PTR)unpack_ptr( ps->msg.lParam );
msg.time = ps->msg.time;
msg.pt = ps->msg.pt;
memcpy( &ps->msg, &msg, sizeof(msg) );
break;
}
return TRUE;
case SBM_SETSCROLLINFO:
minsize = sizeof(SCROLLINFO);
break;
case SBM_GETSCROLLINFO:
if (!get_buffer_space( buffer, sizeof(SCROLLINFO), size )) return FALSE;
break;
case SBM_GETSCROLLBARINFO:
if (!get_buffer_space( buffer, sizeof(SCROLLBARINFO), size )) return FALSE;
break;
case EM_GETSEL:
case SBM_GETRANGE:
case CB_GETEDITSEL:
if (*wparam || *lparam)
{
if (!get_buffer_space( buffer, 2*sizeof(DWORD), size )) return FALSE;
if (*wparam) *wparam = (WPARAM)*buffer;
if (*lparam) *lparam = (LPARAM)((DWORD *)*buffer + 1);
}
return TRUE;
case EM_GETRECT:
case LB_GETITEMRECT:
case CB_GETDROPPEDCONTROLRECT:
if (!get_buffer_space( buffer, sizeof(RECT), size )) return FALSE;
break;
case EM_SETRECT:
case EM_SETRECTNP:
minsize = sizeof(RECT);
break;
case EM_GETLINE:
{
WORD len;
if (size < sizeof(WORD)) return FALSE;
len = *(WORD *)*buffer;
if (!get_buffer_space( buffer, (len + 1) * sizeof(WCHAR), size )) return FALSE;
*lparam = (LPARAM)*buffer + sizeof(WORD); /* don't erase WORD at start of buffer */
return TRUE;
}
case EM_SETTABSTOPS:
case LB_SETTABSTOPS:
if (!*wparam) return TRUE;
minsize = *wparam * sizeof(UINT);
break;
case CB_ADDSTRING:
case CB_INSERTSTRING:
case CB_FINDSTRING:
case CB_FINDSTRINGEXACT:
case CB_SELECTSTRING:
case LB_ADDSTRING:
case LB_INSERTSTRING:
case LB_FINDSTRING:
case LB_FINDSTRINGEXACT:
case LB_SELECTSTRING:
if (!*buffer) return TRUE;
if (!check_string( *buffer, size )) return FALSE;
break;
case CB_GETLBTEXT:
{
size = sizeof(ULONG_PTR);
if (combobox_has_strings( hwnd ))
size = (SendMessageW( hwnd, CB_GETLBTEXTLEN, *wparam, 0 ) + 1) * sizeof(WCHAR);
if (!get_buffer_space( buffer, size, prev_size )) return FALSE;
break;
}
case LB_GETTEXT:
{
size = sizeof(ULONG_PTR);
if (listbox_has_strings( hwnd ))
size = (SendMessageW( hwnd, LB_GETTEXTLEN, *wparam, 0 ) + 1) * sizeof(WCHAR);
if (!get_buffer_space( buffer, size, prev_size )) return FALSE;
break;
}
case LB_GETSELITEMS:
if (!get_buffer_space( buffer, *wparam * sizeof(UINT), size )) return FALSE;
break;
case WM_NEXTMENU:
{
MDINEXTMENU mnm;
if (size < sizeof(ps->mnm)) return FALSE;
mnm.hmenuIn = unpack_handle( ps->mnm.hmenuIn );
mnm.hmenuNext = unpack_handle( ps->mnm.hmenuNext );
mnm.hwndNext = unpack_handle( ps->mnm.hwndNext );
memcpy( &ps->mnm, &mnm, sizeof(mnm) );
break;
}
case WM_SIZING:
case WM_MOVING:
minsize = sizeof(RECT);
if (!get_buffer_space( buffer, sizeof(RECT), size )) return FALSE;
break;
case WM_MDICREATE:
{
MDICREATESTRUCTW mcs;
WCHAR *str = (WCHAR *)(&ps->mcs + 1);
if (size < sizeof(ps->mcs)) return FALSE;
size -= sizeof(ps->mcs);
mcs.szClass = unpack_ptr( ps->mcs.szClass );
mcs.szTitle = unpack_ptr( ps->mcs.szTitle );
mcs.hOwner = unpack_ptr( ps->mcs.hOwner );
mcs.x = ps->mcs.x;
mcs.y = ps->mcs.y;
mcs.cx = ps->mcs.cx;
mcs.cy = ps->mcs.cy;
mcs.style = ps->mcs.style;
mcs.lParam = (LPARAM)unpack_ptr( ps->mcs.lParam );
if (ps->mcs.szClass >> 16)
{
if (!check_string( str, size )) return FALSE;
mcs.szClass = str;
size -= (lstrlenW(str) + 1) * sizeof(WCHAR);
str += lstrlenW(str) + 1;
}
if (ps->mcs.szTitle >> 16)
{
if (!check_string( str, size )) return FALSE;
mcs.szTitle = str;
}
memcpy( &ps->mcs, &mcs, sizeof(mcs) );
break;
}
case WM_MDIGETACTIVE:
if (!*lparam) return TRUE;
if (!get_buffer_space( buffer, sizeof(BOOL), size )) return FALSE;
break;
case WM_DEVICECHANGE:
if (!(*wparam & 0x8000)) return TRUE;
minsize = sizeof(DEV_BROADCAST_HDR);
break;
case WM_NCPAINT:
if (*wparam <= 1) return TRUE;
FIXME( "WM_NCPAINT hdc unpacking not supported\n" );
return FALSE;
case WM_PAINT:
if (!*wparam) return TRUE;
/* fall through */
/* these contain an HFONT */
case WM_SETFONT:
case WM_GETFONT:
/* these contain an HDC */
case WM_ERASEBKGND:
case WM_ICONERASEBKGND:
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLORSCROLLBAR:
case WM_CTLCOLORSTATIC:
case WM_PRINT:
case WM_PRINTCLIENT:
/* these contain an HGLOBAL */
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
/* these contain HICON */
case WM_GETICON:
case WM_SETICON:
case WM_QUERYDRAGICON:
case WM_QUERYPARKICON:
/* these contain pointers */
case WM_DROPOBJECT:
case WM_QUERYDROPOBJECT:
case WM_DRAGLOOP:
case WM_DRAGSELECT:
case WM_DRAGMOVE:
FIXME( "msg %x (%s) not supported yet\n", message, SPY_GetMsgName(message, hwnd) );
return FALSE;
default:
return TRUE; /* message doesn't need any unpacking */
}
/* default exit for most messages: check minsize and store buffer in lparam */
if (size < minsize) return FALSE;
*lparam = (LPARAM)*buffer;
return TRUE;
}
BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
{
if (params->needs_unpack)
{
char stack_buffer[128];
void *buffer;
LRESULT result;
MSG msg;
if (size > sizeof(*params))
{
size -= sizeof(*params);
buffer = params + 1;
}
else
{
size = sizeof(stack_buffer);
buffer = stack_buffer;
}
if (!unpack_message( params->hwnd, params->msg, &params->wparam,
&params->lparam, &buffer, size ))
return 0;
params->result = &result;
msg.hwnd = params->hwnd;
msg.message = params->msg;
msg.wParam = params->wparam;
msg.lParam = params->lparam;
dispatch_win_proc_params( params );
NtUserReplyMessage( result, &msg );
if (buffer != stack_buffer && buffer != params + 1)
HeapFree( GetProcessHeap(), 0, buffer );
}
else dispatch_win_proc_params( params );
return TRUE;
}
void get_winproc_params( struct win_proc_params *params )
{
WINDOWPROC *proc = handle_to_proc( params->func );
if (!proc)
{
params->procW = params->procA = NULL;
}
else if (proc == WINPROC_PROC16)
{
params->procW = params->procA = WINPROC_PROC16;
}
else
{
params->procA = proc->procA;
params->procW = proc->procW;
}
}
BOOL WINAPI User32CallSendAsyncCallback( const struct send_async_params *params, ULONG size )
{
params->callback( params->hwnd, params->msg, params->data, params->result );
return TRUE;
}
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
/**********************************************************************
2000-12-22 02:38:01 +01:00
* CallWindowProcA (USER32.@)
Release 980809 Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de> * [*/*] Added some missing WINAPI and some missing prototypes for functions. * [controls/static.c] Got rid of the MODULE32_LookupHMODULE error showing up for every message box. * [windows/winproc.c] WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called). * [misc/winsock.c] hostent/servent/protoent should not use the same static buffers. (has broken nt3.15 finger.exe which does hp=gethostbyname(), then getservbyname("finger","tcp") and the references hp->h_addr_list[0]). Sat Aug 8 13:21:24 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [include/server.h] [tools/make_requests] [server/request.c] [server/trace.c] Automated part of the client/server request code generation. Added tracing of client/server communication. * [scheduler/*.c] [server/process.c] Added support for server-side handles. * [scheduler/thread.c] Added DLL_THREAD_ATTACH/DETACH notifications. * [configure.in] Added check for -lsocket. * [windows/winproc.c] Return the thunk address in WINPROC_GetProc if the function types don't match. Sat Aug 8 02:44:04 1998 Douglas Ridgway <ridgway@winehq.com> * [windows/winproc.c][windows/win.c][windows/message.c] Documentation for CallWindowProc, SetWindowLong, DispatchMessage, WaitMessage, GetMessage, and PeekMessage. Sat Aug 8 01:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de> * [controls/commctrl.c][controls/widgets.c][include/builtin32.h] [include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec] [tools/build.c] [relay32/shell32.spec] Added the functionality of the LibMain function. The common controls are properly initialized now. * [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c] [windows/msgbox.c][windows/win.c] Put TRACE in, put SetLastError() in. * [include/interfaces.h] Added IClassFactory::LockServer. * [include/ole2.h] Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32. * [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c] Reorganized and many structs and classes (IShellBrowser,IShellView) added. shell32.dll should work in many cases now. Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A. New Shell32LibMain started ShellIconCache Implementation. * [misc/shellord.c] Rewrote ILCombine, ILGetSize New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx, SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries. * [include/winerror.h] Class and window related error codes added. * [memory/heap.c] Changed lstrlen32A to strlen to get rid of milions of TRACE lines. * [misc/ddeml.c] First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32. * [misc/network.c][relay32/mpr.spec] Fixed some bugs, changed ordinals. * [windows/class.c] Workarounds for incorrect hInstance handling. Fixes parts of MSWord95/Excel95 and Money95. Thu Aug 6 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [windows/nonclient.c][misc/tweak.c][include/tweak.h] [documentation/win95look] Removed some tweak variables. They are no longer needed. * [files/dos_fs.c] Added check for null pointer in DOSFS_GetDevice(). * [controls/tooltips.c][include/commctrl.h] Improved tooltips. * [controls/status.c][include/commctrl.h] Cleaned up code and added tooltip support. * [controls/toolbar.c][include/commctrl.h] Added tooltip support. * [documentation/common_controls] Updated. Thu Aug 6 00:05:22 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> * [include/ver.h] [misc/ver.c] Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL. * [debugger/hash.c] [debugger/stabs.c] Make debug output more friendly for posting. * [files/file.c] Partial implementation of OF_SHARE_EXCLUSIVE. Needed for Quicklogic/QuickChip (InstallShield). * [files/profile.c] When a cached-only entry is found, return it. * [graphics/x11drv/xfont.c] Accept a space as delimiter for a fontname and inhibit overrun (Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed). * [miscemu/main.c] Delay setting IF1632_CallLargeStack after loading the executables. Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when showing the Blinker error Message Box. * [misc/network.c] Make WNetGetConnection16 recognise a CDROM as a local drive. * [multimedia/mmsystem.c] Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME. Tue Aug 4 21:15:23 1998 James Juran <jrj120@psu.edu> * [ole/ole2nls.c] Fixed bug in CompareString32A. strcmp() doesn't necessarily return -1, 0, or 1, which the previous code depended on. Changed name of is_punctuation to OLE2NLS_isPunctuation. Made NORM_IGNOREWIDTH not print a FIXME message in LCMapString32A. Other debugging messages, documentation, and code cleanups. * [objects/font.c] [relay32/gdi32.spec] [include/winerror.h] Added stub for GetFontData32, and added GDI_ERROR constant to winerror.h. Tue Aug 4 07:44:43 1998 Ove Kaaven <ovek@arcticnet.no> * [multimedia/mmio.c] Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and mmioCreateChunk to the best of my knowledge. But watch out, there's bound to be bugs in there... * [include/mmsystem.h] [multimedia/mmsystem.c] Hacked in support for 32-bit multimedia function callbacks. * [AUTHORS] [misc/shell.c] Selfishly credited my authorship. Hopefully I'm excused. * [include/dosexe.h] [include/module.h] [loader/dos/*] [loader/module.c] [loader/task.c] [Makefile.in] [configure.in] [Makefile.in] Added DOS EXE (MZ) loader and virtual machine. Task structure integration thanks to Ulrich Weigand. * [files/dos_fs.c] Work around a null pointer dereference if ioctlGetDeviceInfo-ing a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd). * [include/miscemu.h] [include/winnt.h] [loader/main.c] [memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c] Added support for DOS memory images, and added DOSMEM_ResizeBlock() and DOSMEM_Available(). * [msdos/int21.c] Added support for the DOS virtual machine, tweaked handle assignment to avoid stdio clashes, forced INT21_FindNext to exit wildcardless searches after finding one entry, added AH=7, 8, 9, C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the long filename calls only respond if running with with -winver win95. * [objects/cursoricon.c] DestroyCursor32 and DestroyIcon32 should now free the objects (hopefully) correctly. Sun Aug 2 21:42:09 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [graphics/psdrv/*] [include/psdrv.h] Added PPD file parsing - at the moment it reads a file called default.ppd from the directory in which you start Wine. Page sizes other than A4 should now work (landscape may not). All fonts that are present on your printer (according to the PPD) should be available, providing you have the AFM files. Fonts should now be the correct size. Graphics is still basically lines only. See graphics/psdrv/README . * [misc/printdrv.c] Yet more Drv[Get/Set]PrinterData fixes. Fri Jul 31 21:33:22 1998 Per Lindstrm <pelinstr@algonet.se> * [relay32/crtdll.spec] [misc/crtdll.c] Added stub for freopen, _findfirst, _findnext, _fstat and _read. * [files/directory.c] Modified warning message. Wed Jul 29 11:25:28 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com> * [objects/font.c] Added stub for GetFontData. * [multimedia/msvideo.c] Created this file to hold the msvideo.dll calls (and maybe also msvfw32.dll). * [objects/cursoricon.c] Added search in Global Heap for cursor when trying to destroy it with DestroyCursor16. This test should be done in many (all?) other functions that use FreeResource. * [controls/treeview.c] [include/commctrl.h] Minor correction in name and addition of many placeholders for TVM messages in TREEVIEW_WindowProc. * [msdos/dpmi.c] Fixed a bug in DPMI_xrealloc where in a copy of a memory region "A" of size "a" to a region "B" of size "b", "b" bytes were being copied, instead of "a", as the new version does. This both increases speed, as well as avoids segfaults.
1998-08-09 14:47:43 +02:00
*
* The CallWindowProc() function invokes the windows procedure _func_,
* with _hwnd_ as the target window, the message specified by _msg_, and
* the message parameters _wParam_ and _lParam_.
*
* Some kinds of argument conversion may be done, I'm not sure what.
*
* CallWindowProc() may be used for windows subclassing. Use
* SetWindowLong() to set a new windows procedure for windows of the
* subclass, and handle subclassed messages in the new windows
* procedure. The new windows procedure may then use CallWindowProc()
* with _func_ set to the parent class's windows procedure to dispatch
* the message to the superclass.
*
* RETURNS
*
* The return value is message dependent.
*
* CONFORMANCE
*
2002-06-01 01:06:46 +02:00
* ECMA-234, Win32
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
*/
LRESULT WINAPI CallWindowProcA( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
struct win_proc_params params;
LRESULT result;
params.func = func;
params.result = &result;
if (!NtUserMessageCall( hwnd, msg, wParam, lParam, &params, NtUserCallWindowProc, TRUE ))
return 0;
dispatch_win_proc_params( &params );
return result;
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
}
/**********************************************************************
2000-12-22 02:38:01 +01:00
* CallWindowProcW (USER32.@)
*
* See CallWindowProcA.
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
*/
LRESULT WINAPI CallWindowProcW( WNDPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
{
struct win_proc_params params;
LRESULT result;
Release 960521 Tue May 21 14:06:07 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/button.c] Made ButtonWndProc a 32-bit window procedure. * [controls/desktop.c] Made DesktopWndProc a 32-bit window procedure. Added handling of WM_SETCURSOR. * [controls/menu.c] Allocate menu items and strings on the 32-bit system heap. Implemented Win32 versions for ChangeMenu, InsertMenu, ModifyMenu, AppendMenu and LoadMenuIndirect. * [controls/widgets.c] Added possibility to have 32-bit built-in classes. * [files/drive.c] Implemented GetLogicalDrive() and GetLogicalDriveStrings(). * [misc/spy.c] [include/spy.h] Added support for spying Win32 messages. * [loader/builtin.c] Fixed bug in -dll option parsing. * [memory/local.c] Added back the change by Huw D. M. Davies to free the block in LocalRealloc() before allocating the new one. * [objects/bitmap.c] [objects/cursoricon.c] [objects/oembitmap.c] Fixed bug in bitmap size that caused memory corruption for 24bpp. * [windows/defwnd.c] Implemented Win32 version of DefWindowProc(). * [windows/dialog.c] Implemented Win32 version of SendDlgItemMessage, Get/SetDlgItemText and Get/SetDlgItemInt. * [windows/mdi.c] Implemented Win32 version of DefFrameProc() and DefMDIChildProc(). Don't make a copy of the OBM bitmaps for every MDI window. * [windows/message.c] Implemented Win32 version of SendMessage(). * [windows/winproc.c] [windows/class.c] [windows/win.c] New scheme for 32-bit window procedures to replace aliases. All 32-bit window procedure get a 16-bit address pointing to a WINDOWPROC structure. Implemented Ansi<->Unicode translation for CallWindowProc(). Added translation of WM_DRAWITEM between Win16 and Win32. * [windows/win.c] [include/callback.h] Added ugly hack to build CREATESTRUCT on the stack when sending WM_NCCREATE. Implemented Win32 version of Get/SetWindowWord/Long and Get/SetWindowText. Fri May 17 10:20:16 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/button.c] Avoid gray text on gray background in disabled push buttons using a b/w raster and some raster operations (PatBlt,BitBlt). * [objects/text.c] DrawText(): don't draw an underbar anymore if DT_CALCRECT is set.
1996-05-21 17:01:41 +02:00
params.func = func;
params.result = &result;
if (!NtUserMessageCall( hwnd, msg, wParam, lParam, &params, NtUserCallWindowProc, FALSE ))
return 0;
dispatch_win_proc_params( &params );
return result;
Release 960516 Thu May 16 13:35:31 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [*/*.c] Renamed RECT, POINT and SIZE structures to RECT16, POINT16 and SIZE16. Implemented Win32 version of most functions that take these types as parameters. * [configure] Patched autoconf to attempt to correctly detect -lnsl and -lsocket. Please check this out. * [controls/button.c] Added support for Win32 BM_* messages. * [controls/menu.c] Avoid sending extra WM_MENUSELECT messages. This avoids crashes with Excel. * [memory.heap.c] [include/heap.h] Added support for SEGPTRs in Win32 heaps. Added a few macros to make using SEGPTRs easier. They are a bit slower than MAKE_SEGPTR, but they work with Win32. * [memory/atom.c] Implemented Win32 atom functions. * [memory/local.c] Fixed LocalReAlloc() changes to avoid copying the whole block twice. * [win32/memory.c] Use /dev/zero instead of MAP_ANON for VirtualAlloc(). * [windows/class.c] Properly implemented the Win32 class functions. * [windows/winproc.c] (New file) New file handling the message translation between Win16 and Win32. Mon May 13 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/mdi.c] [windows/menu.c] Improved WM_MDICREATE and WM_MDICASCADE handling. * [windows/event.c] [objects/bitblt.c] Handle GraphicsExpose event for BitBlt from screen to screen. * [windows/event.c] [windows/win.c] [windows/nonclient.c] Bunch of fixes for problems with -managed. * [windows/win.c] [windows/winpos.c] Changed conditions for WM_SIZE, WM_MOVE, and WM_GETMINMAXINFO in CreateWindow. * [windows/win.c] [windows/queue.c] [misc/user.c] Do not send WM_PARENTNOTIFY when in AppExit and call WH_SHELL on window creation/destruction. * [objects/palette.c] Crude RealizePalette(). At least something is visible in LviewPro. Sun May 12 02:05:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [if1632/gdi32.spec] Added Rectangle (use win16 version). * [if1632/kernel32.spec] Added GetWindowsDirectoryA (use win16 GetWindowsDirectory). * [if1632/user32.spec] Added GetSubMenu, MoveWindow, SetScrollPos, SetScrollRange (use win16 versions). Added SetWindowsHookExA (empty stub for now). * [include/handle32.h] Changed #include <malloc.h> to #include <stdlib.h> to prevent hate message from FreeBSD compiler. * [win32/newfns.c] Added new function SetWindowsHookEx32A (empty stub for now). * [win32/user32.c] Removed redundant debugging printf statement. Sun May 12 01:24:57 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [memory/local.c] Avoid creating adjacent free blocks. Free the block in LocalReAlloc() before allocating a new one. Fixed LocalReAlloc() for discarded blocks. Fri May 10 23:05:12 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [resources/sysres_Fi.rc] ChooseFont and ChooseColor dialogs updated. Fri May 10 17:19:33 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c,if1632/kernel.spec] GetCurrentDirectory(),SetCurrentDirectory() implemented. * [if1632/advapi32.spec] [if1632/kernel.spec] [if1632/shell.spec] [include/windows.h] [include/winreg.h] [loader/main.c] [misc/main.c] [misc/shell.c] [misc/registry.c] Registry fixes: - loads win95 registry databases, - save only updated keys on default, - now adhers to the new function naming standard, - minor cleanups. Tue May 7 22:36:13 1996 Albrecht Kleine <kleine@ak.sax.de> * [combo.c] Added WM_COMMAND-handling for interaction between EDIT and COMBOLBOX and synchronized mine with Greg Kreider's works. * [commdlg.c] Bugfix in ChooseFont: font size handling.
1996-05-16 20:21:06 +02:00
}
/**********************************************************************
* WINPROC_CallDlgProcA
*/
INT_PTR WINPROC_CallDlgProcA( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
WINDOWPROC *proc;
LRESULT result;
INT_PTR ret;
if (!func) return 0;
if (!(proc = handle_to_proc( (WNDPROC)func )))
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, func );
else if (proc == WINPROC_PROC16)
{
ret = wow_handlers.call_dialog_proc( hwnd, msg, wParam, lParam, &result, func );
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, result );
}
else
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procW ? proc->procW : proc->procA );
return ret;
}
/**********************************************************************
* WINPROC_CallDlgProcW
*/
INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
WINDOWPROC *proc;
LRESULT result;
INT_PTR ret;
if (!func) return 0;
if (!(proc = handle_to_proc( (WNDPROC)func )))
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, func );
else if (proc == WINPROC_PROC16)
{
ret = WINPROC_CallProcWtoA( wow_handlers.call_dialog_proc, hwnd, msg, wParam, lParam, &result, func );
SetWindowLongPtrW( hwnd, DWLP_MSGRESULT, result );
}
else
ret = call_dialog_proc( hwnd, msg, wParam, lParam, &result, proc->procW ? proc->procW : proc->procA );
return ret;
}
/***********************************************************************
* Window procedures for builtin classes
*/
static LRESULT WINAPI ButtonWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.button_proc( hwnd, msg, wParam, lParam, FALSE );
}
static LRESULT WINAPI ButtonWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.button_proc( hwnd, msg, wParam, lParam, TRUE );
}
static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.combo_proc( hwnd, message, wParam, lParam, FALSE );
}
static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.combo_proc( hwnd, message, wParam, lParam, TRUE );
}
LRESULT WINAPI EditWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.edit_proc( hwnd, msg, wParam, lParam, FALSE );
}
static LRESULT WINAPI EditWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.edit_proc( hwnd, msg, wParam, lParam, TRUE );
}
static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.listbox_proc( hwnd, msg, wParam, lParam, FALSE );
}
static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.listbox_proc( hwnd, msg, wParam, lParam, TRUE );
}
static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.mdiclient_proc( hwnd, msg, wParam, lParam, FALSE );
}
static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.mdiclient_proc( hwnd, msg, wParam, lParam, TRUE );
}
static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.scrollbar_proc( hwnd, msg, wParam, lParam, FALSE );
}
static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.scrollbar_proc( hwnd, msg, wParam, lParam, TRUE );
}
static LRESULT WINAPI StaticWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.static_proc( hwnd, msg, wParam, lParam, FALSE );
}
static LRESULT WINAPI StaticWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
return wow_handlers.static_proc( hwnd, msg, wParam, lParam, TRUE );
}
/**********************************************************************
* UserRegisterWowHandlers (USER32.@)
*
* NOTE: no attempt has been made to be compatible here,
* the Windows function is most likely completely different.
*/
void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wow_handlers32 *orig )
{
orig->button_proc = ButtonWndProc_common;
orig->combo_proc = ComboWndProc_common;
orig->edit_proc = EditWndProc_common;
orig->listbox_proc = ListBoxWndProc_common;
orig->mdiclient_proc = MDIClientWndProc_common;
orig->scrollbar_proc = ScrollBarWndProc_common;
orig->static_proc = StaticWndProc_common;
orig->create_window = WIN_CreateWindowEx;
orig->get_win_handle = WIN_GetFullHandle;
orig->alloc_winproc = WINPROC_AllocProc;
orig->get_dialog_info = DIALOG_get_info;
orig->dialog_box_loop = DIALOG_DoDialogBox;
wow_handlers = *new;
}
struct wow_handlers16 wow_handlers =
{
ButtonWndProc_common,
ComboWndProc_common,
EditWndProc_common,
ListBoxWndProc_common,
MDIClientWndProc_common,
ScrollBarWndProc_common,
StaticWndProc_common,
WIN_CreateWindowEx,
NULL, /* call_window_proc */
NULL, /* call_dialog_proc */
};
static const struct user_client_procs client_procsA =
{
.pButtonWndProc = ButtonWndProcA,
.pComboWndProc = ComboWndProcA,
.pDefWindowProc = DefWindowProcA,
.pDefDlgProc = DefDlgProcA,
.pEditWndProc = EditWndProcA,
.pListBoxWndProc = ListBoxWndProcA,
.pMDIClientWndProc = MDIClientWndProcA,
.pScrollBarWndProc = ScrollBarWndProcA,
.pStaticWndProc = StaticWndProcA,
.pImeWndProc = ImeWndProcA,
};
static const struct user_client_procs client_procsW =
{
.pButtonWndProc = ButtonWndProcW,
.pComboWndProc = ComboWndProcW,
.pDefWindowProc = DefWindowProcW,
.pDefDlgProc = DefDlgProcW,
.pEditWndProc = EditWndProcW,
.pListBoxWndProc = ListBoxWndProcW,
.pMDIClientWndProc = MDIClientWndProcW,
.pScrollBarWndProc = ScrollBarWndProcW,
.pStaticWndProc = StaticWndProcW,
.pImeWndProc = ImeWndProcW,
.pDesktopWndProc = DesktopWndProc,
.pIconTitleWndProc = IconTitleWndProc,
.pPopupMenuWndProc = PopupMenuWndProc,
.pMessageWndProc = MessageWndProc,
};
void winproc_init(void)
{
NtUserInitializeClientPfnArrays( &client_procsA, &client_procsW, NULL, user32_module );
}