Release 960805
Sun Aug 4 18:18:48 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/scroll.c]
Attempted to implement undocumented scroll-bar messages.
* [tools/build.c] [include/callback.h] [windows/winproc.c]
CallTo16_* functions now get DS from the previous 16-bit stackframe.
* [if1632/thunk.c] [include/callback.h]
Added thunks to implement callbacks for the emulator. Now all the
Enum* functions always take a real function pointer even in the
emulator.
* [loader/builtin.c]
Removed binary search in BUILTIN_GetEntryPoint32(), as it didn't
work with NULL entry points. Using linear search now.
* [loader/module.c]
Implemented IsSharedSelector().
* [loader/task.c]
Changed SwitchStackTo/Back to use the instance data to store the
previous stack instead of the TDB. Also copy the local variables
onto the new stack.
Added GetExeVersion() and SetTackSignalProc().
Implemented SetSigHandler().
Sat Aug 3 22:19:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [controls/menu.c]
"Fixed" problem in deleting menus where win32 could get into an
endless loop when it crashed. I think I've fixed the symptoms, not
the original problem so it might be worth further investigation.
* [debugger/registers.c]
Added missing #ifdefs on FS_REG and GS_REG, needed for FreeBSD to
compile wine properly.
* [files/dos_fs.c]
Made DOSFS_Hash and DOSFS_Match non-static so they can be called
from win32/findfile.c (q.v.).
* [if1632/gdi32.spec]
Added SetMapMode (call existing function)
* [if1632/kernel32.spec]
Added FindFirstFileA and SetFileAttributesA.
* [if1632/user32.spec]
Added BringWindowToTop, CreatePopupMenu, GetKeyState, GetParent,
IsDlgButtonChecked (call existing functions) and IsDialogMessageA,
UnhookWindowsHookEx.
* [win32/file.c]
Added stub function SetFileAttributes32A. It's a stub because I
can't really work out what this function should do with most
attributes in a Unix environment. Anyone care to expand it?
* [win32/findfile.c]
New file. Initial stab at FindFirstFile. This doesn't work as
specified yet, though a lot of the groundwork is there. I haven't
time to work on this for the next month, so if anyone wants to pick
it up and run with it please do.
* [win32/memory.c]
Removed malloc.h from includes (covered by stdlib.h include, and
gets rid of a warning in FreeBSD).
* [win32/newfns.c]
UnhookWindowsHookEx32A stub added.
* [win32/user32.c]
Added implementation of IsDialogMessage32A.
* [windows/dialog.c]
IsDlgButtonChecked now calls SendDlgItemMessage32A instead of
SendDlgItemMessage16.
Sat Aug 3 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/graphics.c]
Removed rectangle checking (conflicted with nonstandard
mapping modes).
* [windows/dialog.c]
Added check for child-style dialogs to DS_ABSALIGN
coordinate conversion.
* [objects/color.c]
Cleaned up misc. bits
Thu Aug 1 10:51:45 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [windows/focus.c] [windows/event.c] [windows/win.c]
[windows/defdlg.c]
Fixes to focusing and activation.
* [windows/defdlg.c]
Properly(?) handle DM_GETDEFID.
* [controls/combo.c]
Handle CB_FINDSTRINGEXACT, CB_SETEDITSEL, CB_GETEDITSEL.
CBCheckSize: Adjust edit position.
Tue Jul 30 09:46:36 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/file.c] [include/file.h] [loader/module.c] [loader/ne_image.c]
Pass HFILEs instead of unix-fds to self-loader code.
Mon Jul 29 21:48:25 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/metafile.h] [objects/metafile.c] [objects/text.c]
Implemented handling of some new metafile records (META_...)
in PlayMetaFileRecord(), rewrite of 'case META_EXTTEXTOUT'.
Added functions like MF_StretchBlt() for usage in metafiles.
Minor bugfix in CopyMetafile().
* [objects/bitmap.c][objects/dib.c]
Added check for metafile-DC in Bitmap and DIB functions:
CreateCompatibleBitmap() etc.
1996-08-05 19:42:43 +02:00
|
|
|
/*
|
|
|
|
* Emulator thunks
|
|
|
|
*
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "windows.h"
|
|
|
|
#include "callback.h"
|
1996-08-18 18:21:52 +02:00
|
|
|
#include "stddebug.h"
|
|
|
|
#include "debug.h"
|
Release 960805
Sun Aug 4 18:18:48 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/scroll.c]
Attempted to implement undocumented scroll-bar messages.
* [tools/build.c] [include/callback.h] [windows/winproc.c]
CallTo16_* functions now get DS from the previous 16-bit stackframe.
* [if1632/thunk.c] [include/callback.h]
Added thunks to implement callbacks for the emulator. Now all the
Enum* functions always take a real function pointer even in the
emulator.
* [loader/builtin.c]
Removed binary search in BUILTIN_GetEntryPoint32(), as it didn't
work with NULL entry points. Using linear search now.
* [loader/module.c]
Implemented IsSharedSelector().
* [loader/task.c]
Changed SwitchStackTo/Back to use the instance data to store the
previous stack instead of the TDB. Also copy the local variables
onto the new stack.
Added GetExeVersion() and SetTackSignalProc().
Implemented SetSigHandler().
Sat Aug 3 22:19:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [controls/menu.c]
"Fixed" problem in deleting menus where win32 could get into an
endless loop when it crashed. I think I've fixed the symptoms, not
the original problem so it might be worth further investigation.
* [debugger/registers.c]
Added missing #ifdefs on FS_REG and GS_REG, needed for FreeBSD to
compile wine properly.
* [files/dos_fs.c]
Made DOSFS_Hash and DOSFS_Match non-static so they can be called
from win32/findfile.c (q.v.).
* [if1632/gdi32.spec]
Added SetMapMode (call existing function)
* [if1632/kernel32.spec]
Added FindFirstFileA and SetFileAttributesA.
* [if1632/user32.spec]
Added BringWindowToTop, CreatePopupMenu, GetKeyState, GetParent,
IsDlgButtonChecked (call existing functions) and IsDialogMessageA,
UnhookWindowsHookEx.
* [win32/file.c]
Added stub function SetFileAttributes32A. It's a stub because I
can't really work out what this function should do with most
attributes in a Unix environment. Anyone care to expand it?
* [win32/findfile.c]
New file. Initial stab at FindFirstFile. This doesn't work as
specified yet, though a lot of the groundwork is there. I haven't
time to work on this for the next month, so if anyone wants to pick
it up and run with it please do.
* [win32/memory.c]
Removed malloc.h from includes (covered by stdlib.h include, and
gets rid of a warning in FreeBSD).
* [win32/newfns.c]
UnhookWindowsHookEx32A stub added.
* [win32/user32.c]
Added implementation of IsDialogMessage32A.
* [windows/dialog.c]
IsDlgButtonChecked now calls SendDlgItemMessage32A instead of
SendDlgItemMessage16.
Sat Aug 3 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/graphics.c]
Removed rectangle checking (conflicted with nonstandard
mapping modes).
* [windows/dialog.c]
Added check for child-style dialogs to DS_ABSALIGN
coordinate conversion.
* [objects/color.c]
Cleaned up misc. bits
Thu Aug 1 10:51:45 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [windows/focus.c] [windows/event.c] [windows/win.c]
[windows/defdlg.c]
Fixes to focusing and activation.
* [windows/defdlg.c]
Properly(?) handle DM_GETDEFID.
* [controls/combo.c]
Handle CB_FINDSTRINGEXACT, CB_SETEDITSEL, CB_GETEDITSEL.
CBCheckSize: Adjust edit position.
Tue Jul 30 09:46:36 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/file.c] [include/file.h] [loader/module.c] [loader/ne_image.c]
Pass HFILEs instead of unix-fds to self-loader code.
Mon Jul 29 21:48:25 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/metafile.h] [objects/metafile.c] [objects/text.c]
Implemented handling of some new metafile records (META_...)
in PlayMetaFileRecord(), rewrite of 'case META_EXTTEXTOUT'.
Added functions like MF_StretchBlt() for usage in metafiles.
Minor bugfix in CopyMetafile().
* [objects/bitmap.c][objects/dib.c]
Added check for metafile-DC in Bitmap and DIB functions:
CreateCompatibleBitmap() etc.
1996-08-05 19:42:43 +02:00
|
|
|
#include "heap.h"
|
|
|
|
|
|
|
|
typedef void (*RELAY)();
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE popl_eax; /* 0x58 popl %eax (return address) */
|
|
|
|
BYTE pushl_func; /* 0x68 pushl $proc */
|
|
|
|
FARPROC32 proc WINE_PACKED;
|
|
|
|
BYTE pushl_eax; /* 0x50 pushl %eax */
|
|
|
|
BYTE jmp; /* 0xe9 jmp relay (relative jump)*/
|
|
|
|
RELAY relay WINE_PACKED;
|
|
|
|
} THUNK;
|
|
|
|
|
|
|
|
#define DECL_THUNK(name,proc,relay) \
|
|
|
|
THUNK name = { 0x58, 0x68, (FARPROC32)(proc), 0x50, 0xe9, \
|
|
|
|
(RELAY)((char *)(relay) - (char *)(&(name) + 1)) }
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_Alloc
|
|
|
|
*/
|
|
|
|
static THUNK *THUNK_Alloc( FARPROC32 func, RELAY relay )
|
|
|
|
{
|
|
|
|
THUNK *thunk = HeapAlloc( SystemHeap, 0, sizeof(*thunk) );
|
|
|
|
if (thunk)
|
|
|
|
{
|
|
|
|
thunk->popl_eax = 0x58;
|
|
|
|
thunk->pushl_func = 0x68;
|
|
|
|
thunk->proc = func;
|
|
|
|
thunk->pushl_eax = 0x50;
|
|
|
|
thunk->jmp = 0xe9;
|
|
|
|
thunk->relay = relay;
|
|
|
|
}
|
|
|
|
return thunk;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_Free
|
|
|
|
*/
|
|
|
|
static void THUNK_Free( THUNK *thunk )
|
|
|
|
{
|
|
|
|
HeapFree( SystemHeap, 0, thunk );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_EnumObjects16 (GDI.71)
|
|
|
|
*/
|
|
|
|
INT16 THUNK_EnumObjects16( HDC16 hdc, INT16 nObjType,
|
|
|
|
GOBJENUMPROC16 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_ll );
|
|
|
|
return EnumObjects( hdc, nObjType, (GOBJENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* THUNK_EnumFonts16 (GDI.70)
|
|
|
|
*/
|
|
|
|
INT16 THUNK_EnumFonts16( HDC16 hdc, LPCSTR lpFaceName,
|
|
|
|
FONTENUMPROC16 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_llwl );
|
|
|
|
return EnumFonts( hdc, lpFaceName, (FONTENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* THUNK_EnumMetaFile16 (GDI.175)
|
|
|
|
*/
|
|
|
|
BOOL16 THUNK_EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf,
|
|
|
|
MFENUMPROC16 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wllwl );
|
|
|
|
return EnumMetaFile( hdc, hmf, (MFENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* THUNK_EnumFontFamilies16 (GDI.330)
|
|
|
|
*/
|
|
|
|
INT16 THUNK_EnumFontFamilies16( HDC16 hdc, LPCSTR lpszFamily,
|
|
|
|
FONTENUMPROC16 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_llwl );
|
|
|
|
return EnumFontFamilies( hdc, lpszFamily, (FONTENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* THUNK_LineDDA16 (GDI.100)
|
|
|
|
*/
|
|
|
|
void THUNK_LineDDA16( INT16 nXStart, INT16 nYStart, INT16 nXEnd, INT16 nYEnd,
|
|
|
|
LINEDDAPROC16 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wwl );
|
|
|
|
LineDDA16( nXStart, nYStart, nXEnd, nYEnd, (LINEDDAPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* THUNK_LineDDA32 (GDI32.248)
|
|
|
|
*/
|
|
|
|
BOOL32 THUNK_LineDDA32( INT32 nXStart, INT32 nYStart, INT32 nXEnd, INT32 nYEnd,
|
|
|
|
LINEDDAPROC32 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_3 );
|
|
|
|
return LineDDA32( nXStart, nYStart, nXEnd, nYEnd,
|
|
|
|
(LINEDDAPROC32)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* THUNK_EnumWindows16 (USER.54)
|
|
|
|
*/
|
|
|
|
BOOL16 THUNK_EnumWindows16( WNDENUMPROC16 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wl );
|
|
|
|
return EnumWindows16( (WNDENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* THUNK_EnumWindows32 (USER32.192)
|
|
|
|
*/
|
|
|
|
BOOL32 THUNK_EnumWindows32( WNDENUMPROC32 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_2 );
|
|
|
|
return EnumWindows32( (WNDENUMPROC32)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* THUNK_EnumChildWindows16 (USER.55)
|
|
|
|
*/
|
|
|
|
BOOL16 THUNK_EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func,
|
|
|
|
LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wl );
|
|
|
|
return EnumChildWindows16( parent, (WNDENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* THUNK_EnumChildWindows32 (USER32.177)
|
|
|
|
*/
|
|
|
|
BOOL32 THUNK_EnumChildWindows32( HWND32 parent, WNDENUMPROC32 func,
|
|
|
|
LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_2 );
|
|
|
|
return EnumChildWindows32( parent, (WNDENUMPROC32)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* THUNK_EnumTaskWindows16 (USER.225)
|
|
|
|
*/
|
|
|
|
BOOL16 THUNK_EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func,
|
|
|
|
LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wl );
|
|
|
|
return EnumTaskWindows16( hTask, (WNDENUMPROC16)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* THUNK_EnumThreadWindows (USER32.189)
|
|
|
|
*/
|
|
|
|
BOOL32 THUNK_EnumThreadWindows( DWORD id, WNDENUMPROC32 func, LPARAM lParam )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_2 );
|
|
|
|
return EnumThreadWindows( id, (WNDENUMPROC32)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_EnumProps16 (USER.27)
|
|
|
|
*/
|
|
|
|
INT16 THUNK_EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wlw );
|
|
|
|
return EnumProps16( hwnd, (PROPENUMPROC16)&thunk );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_EnumProps32A (USER32.185)
|
|
|
|
*/
|
|
|
|
INT32 THUNK_EnumProps32A( HWND32 hwnd, PROPENUMPROC32A func )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_3 );
|
|
|
|
return EnumProps32A( hwnd, (PROPENUMPROC32A)&thunk );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_EnumProps32W (USER32.188)
|
|
|
|
*/
|
|
|
|
INT32 THUNK_EnumProps32W( HWND32 hwnd, PROPENUMPROC32W func )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_3 );
|
|
|
|
return EnumProps32W( hwnd, (PROPENUMPROC32W)&thunk );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_EnumPropsEx32A (USER32.186)
|
|
|
|
*/
|
|
|
|
INT32 THUNK_EnumPropsEx32A( HWND32 hwnd, PROPENUMPROCEX32A func, LPARAM lParam)
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_4 );
|
|
|
|
return EnumPropsEx32A( hwnd, (PROPENUMPROCEX32A)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_EnumPropsEx32W (USER32.187)
|
|
|
|
*/
|
|
|
|
INT32 THUNK_EnumPropsEx32W( HWND32 hwnd, PROPENUMPROCEX32W func, LPARAM lParam)
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo32_4 );
|
|
|
|
return EnumPropsEx32W( hwnd, (PROPENUMPROCEX32W)&thunk, lParam );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* THUNK_GrayString16 (USER.185)
|
|
|
|
*/
|
|
|
|
BOOL16 THUNK_GrayString16( HDC16 hdc, HBRUSH16 hbr, GRAYSTRINGPROC16 func,
|
|
|
|
LPARAM lParam, INT16 cch, INT16 x, INT16 y,
|
|
|
|
INT16 cx, INT16 cy )
|
|
|
|
{
|
|
|
|
DECL_THUNK( thunk, func, CallTo16_word_wlw );
|
|
|
|
if (!func)
|
|
|
|
return GrayString( hdc, hbr, NULL, lParam, cch, x, y, cx, cy );
|
|
|
|
else
|
|
|
|
return GrayString( hdc, hbr, (GRAYSTRINGPROC16)&thunk, lParam, cch,
|
|
|
|
x, y, cx, cy );
|
|
|
|
}
|
|
|
|
|
1996-08-18 18:21:52 +02:00
|
|
|
|
|
|
|
struct thunkstruct
|
|
|
|
{
|
|
|
|
char magic[4];
|
|
|
|
DWORD x1;
|
|
|
|
DWORD x2;
|
|
|
|
};
|
|
|
|
|
|
|
|
UINT32 ThunkConnect32( struct thunkstruct *ths, LPSTR thunkfun16,
|
|
|
|
LPSTR module16, LPSTR module32, HMODULE32 hmod32,
|
|
|
|
DWORD dllinitarg1 )
|
|
|
|
{
|
|
|
|
HINSTANCE16 hmm;
|
|
|
|
|
|
|
|
fprintf(stdnimp,"ThunkConnect32(<struct>,%s,%s,%s,%lx,%lx)\n",
|
|
|
|
thunkfun16,module32,module16,hmod32,dllinitarg1
|
|
|
|
);
|
|
|
|
fprintf(stdnimp," magic = %c%c%c%c\n",
|
|
|
|
ths->magic[0],
|
|
|
|
ths->magic[1],
|
|
|
|
ths->magic[2],
|
|
|
|
ths->magic[3]
|
|
|
|
);
|
|
|
|
fprintf(stdnimp," x1 = %lx\n",ths->x1);
|
|
|
|
fprintf(stdnimp," x2 = %lx\n",ths->x2);
|
|
|
|
hmm=LoadModule(module16,NULL);
|
|
|
|
return TRUE;
|
|
|
|
}
|