Skip to content
Snippets Groups Projects
Commit fa68b75b authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Release 950403

Sun Apr  2 18:31:12 1995  Alexandre Julliard  (julliard@sunsite.unc.edu)

	* [Configure] [if1632/Imakefile]
	Removed new build and short names options.

	* [if1632/*.c] [tools/build.c]
	Implemented compiled call-back functions for better performance;
	all the relay code is now done in assembly code generated by the
	build program.
	Relay code is no longer dependent on being loaded below 64K.

	* [loader/resource.c]
	Fixed memory leak in LoadString(). A fix will also be needed for
	other resources.

	* [memory/global.c]
	Implemented global heap arenas, so we can store informations about
	global blocks, like lock counts or owner handle.
	Implemented FarGetOwner() and FarSetOwner().
	Implemented global heap TOOLHELP functions.

	* [memory/selector.c]
	Bug fix: it was not possible to re-use a free selector.

Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis  (csapuntz@mit.edu)

	*  [controls/listbox.c]
	Major work on listbox code
         - Many bugs fixed (still many bugs)
         - More messages supported
         - Code simplified

Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)

	* [controls/edit.c]
	Lots of bug fixes related to diappearing text, lost carets,
	highlighting, segmentation faults, occurance of random
	characters, insertion of characters over selection, misplaced
	caret location, display corruption, end of line behavior, etc.

	* [controls/widgets.c]
	EDIT class doesn't want to use CS_PARENTDC flag.

Thu Mar 30 20:58:25 1995   Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
        
	* [loader/selector.c]
	  FixupFunctionPrologs() should also handle multiple data modules.
	  (this bug only became visible because MakeProcInstance() was fixed
	  in 950319)
	
	* [misc/dosfs.c]
	  Simplified DOS_SimplifyPath.
	  Small fix to DOS_opendir to reuse an entry if an open directory
	  is opened again, to prevent "too many open directories" messages.

Thu Mar 30 12:05:05 1995 Martin von Loewis  <loewis@informatik.hu-berlin.de>

	* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
	CoDisconnectObject: new stub function

	* [include/msdos.h]
	fix DOSVERSION

	* [loader/ne_image.c]
	NE_FixupSegment: Be more generous on additive fixups

	* [if1632/user.spec][misc/network.c]
	Add more WNet* stubs

Wed Mar 29 11:47:22 1995   Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>

        * [controls/listbox.c]
	  DlgDirList(): send segptr instead of linear pointer 
	  in message to static control
	* [controls/menu.c]
	  Tried to implement ownerdrawn menuitems. Doesn't work.
	* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
	  Provide a stub for GetRasterizerCaps()
	* [loader/selector.c]
	  Pass end address instead of length to LocalInit() in 
	  CreateSelectors()
	* [memory/local.c]
	  LocalInit(): If there's already a local heap in the segment, do
	  nothing and return TRUE
	* [objects/linedda.c]
	  Replaced buggy LineDDA() with a Bresenham algorithm. Should work
	  now.
	* [windows/cursor.c]
	  LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
	  more work still.

Tue Mar 21 17:54:43 1995   Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>

        * [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
	  [if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
	  [controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
	  [windows/nonclient.c] [misc/message.c]
	  Added a new builtin DLL that provides 16 bit entry points for all
	  the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
	  again.
	* [misc/shell.c]
	  RegOpenKey()/RegCreateKey() bugs fixed.
        * [loader/ne_image.c]
	  Skipping the initialization of a DLL when CS == 0 was broken.
parent e2abbb1b
No related branches found
No related tags found
No related merge requests found
This is release 950319 of Wine the MS Windows emulator. This is still a
This is release 950403 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "wine-new@amscons.com". Please don't forget
to include a ChangeLog entry. I'll make a new release every other Sunday.
WHAT'S NEW with Wine-950319: (see ChangeLog for details)
- New memory management scheme. This will probably cause many
new problems, please report them. I'm particularly interested
to hear how it works for the *BSD people.
- Many fixes in file and directory handling.
- Handling of additive fixup records.
- Lots of bug fixes
WHAT'S NEW with Wine-950403: (see ChangeLog for details)
- Compiled callbacks for better performance.
- Many listbox fixes.
- Many edit control fixes.
- 16-bit entry points for built-in window procedures to make
Borland programs happy.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -19,10 +19,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-950319.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-950319.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-950319.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-950319.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-950403.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-950403.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-950403.tar.gz
ftp.funet.fi:/pub/OS/Linux/ALPHA/Wine/Wine-950403.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sun Apr 2 18:31:12 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [Configure] [if1632/Imakefile]
Removed new build and short names options.
* [if1632/*.c] [tools/build.c]
Implemented compiled call-back functions for better performance;
all the relay code is now done in assembly code generated by the
build program.
Relay code is no longer dependent on being loaded below 64K.
* [loader/resource.c]
Fixed memory leak in LoadString(). A fix will also be needed for
other resources.
* [memory/global.c]
Implemented global heap arenas, so we can store informations about
global blocks, like lock counts or owner handle.
Implemented FarGetOwner() and FarSetOwner().
Implemented global heap TOOLHELP functions.
* [memory/selector.c]
Bug fix: it was not possible to re-use a free selector.
Sun Apr 2 01:34:52 1995 Constantine Sapuntzakis (csapuntz@mit.edu)
* [controls/listbox.c]
Major work on listbox code
- Many bugs fixed (still many bugs)
- More messages supported
- Code simplified
Fri Mar 31 03:27:16 EST 1995 William Magro (wmagro@tc.cornell.edu)
* [controls/edit.c]
Lots of bug fixes related to diappearing text, lost carets,
highlighting, segmentation faults, occurance of random
characters, insertion of characters over selection, misplaced
caret location, display corruption, end of line behavior, etc.
* [controls/widgets.c]
EDIT class doesn't want to use CS_PARENTDC flag.
Thu Mar 30 20:58:25 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [loader/selector.c]
FixupFunctionPrologs() should also handle multiple data modules.
(this bug only became visible because MakeProcInstance() was fixed
in 950319)
* [misc/dosfs.c]
Simplified DOS_SimplifyPath.
Small fix to DOS_opendir to reuse an entry if an open directory
is opened again, to prevent "too many open directories" messages.
Thu Mar 30 12:05:05 1995 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/compobj.spec][include/compobj.h][misc/compobj.c]
CoDisconnectObject: new stub function
* [include/msdos.h]
fix DOSVERSION
* [loader/ne_image.c]
NE_FixupSegment: Be more generous on additive fixups
* [if1632/user.spec][misc/network.c]
Add more WNet* stubs
Wed Mar 29 11:47:22 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/listbox.c]
DlgDirList(): send segptr instead of linear pointer
in message to static control
* [controls/menu.c]
Tried to implement ownerdrawn menuitems. Doesn't work.
* [if1632/gdi.spec] [include/windows.h] [objects/font.c]
Provide a stub for GetRasterizerCaps()
* [loader/selector.c]
Pass end address instead of length to LocalInit() in
CreateSelectors()
* [memory/local.c]
LocalInit(): If there's already a local heap in the segment, do
nothing and return TRUE
* [objects/linedda.c]
Replaced buggy LineDDA() with a Bresenham algorithm. Should work
now.
* [windows/cursor.c]
LoadCursor()/CreateCursor(): Cleaned up the mess. Needs some
more work still.
Tue Mar 21 17:54:43 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [if1632/relay.c] [if1632/callback.c] [include/dlls.h]
[if1632/winprocs.spec] [if1632/winprocs.c] [include/winprocs.h]
[controls/widgets.c] [misc/shell.c] [misc/commdlg.c]
[windows/nonclient.c] [misc/message.c]
Added a new builtin DLL that provides 16 bit entry points for all
the Def*Procs (DefDlgProc, ButtonProc etc.). OWL programs work
again.
* [misc/shell.c]
RegOpenKey()/RegCreateKey() bugs fixed.
* [loader/ne_image.c]
Skipping the initialization of a DLL when CS == 0 was broken.
----------------------------------------------------------------------
Sun Mar 19 16:30:20 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
......
......@@ -6,9 +6,7 @@
: ${PAGER:=more}
WINELIB=''
SHORTNAMES=''
LANGUAGE=not_matching
NEWBUILD=''
ALLDEFINES=''
# Ask question 'str' and set 'var' to reply (defaulting to 'def' on CR)
......@@ -28,6 +26,7 @@ prompt ()
fi
}
echo
echo Read the RELEASE-NOTES for an explanation of the various flags
echo
......@@ -39,15 +38,6 @@ then
ALLDEFINES="$ALLDEFINES -DWINELIB"
fi
echo
echo -n 'Short filenames (Y/N) [N]? '
read input
if [ "$input" = 'y' -o "$input" = 'Y' ]
then
SHORTNAMES='#define ShortNames -DSHORTNAMES'
ALLDEFINES="$ALLDEFINES -DSHORTNAMES"
fi
LANGS=`echo En rc/sysres_*.rc | sed -e 's/rc\/sysres_//g' -e 's/\.rc//g' -e 's/ /\//g;'`
while expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev/null
do
......@@ -68,18 +58,6 @@ else
MALLOC_DEBUGGING=''
fi
if [ "`(domainname)`" = 'amscons.com' ]
then
echo
echo -n 'New build program (Y/N) [N]? '
read input
if [ "$input" = 'y' -o "$input" = 'Y' ]
then
NEWBUILD='#define NewBuild -DNEWBUILD'
ALLDEFINES="$ALLDEFINES -DNEWBUILD"
fi
fi
prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
if [ -r $WINE_CONFIGFILE ]
......@@ -197,8 +175,6 @@ fi
cat > autoconf.h << EOF
/* autoconf.h generated automatically. Run Configure. */
$WINELIB
$SHORTNAMES
$NEWBUILD
$MALLOC_DEBUGGING
#define WINE_INI_GLOBAL "$WINE_CONFIGFILE"
#define AutoDefines $ALLDEFINES
......
......@@ -58,13 +58,9 @@ COMMONOBJS = \
rc/rc.o \
windows/windows.o
/*
* WARNING: if1632.o must be the first object file because its code must be
* linked at the lowest possible addresses.
*/
EMUOBJS = \
if1632/if1632.o \
debugger/debugger.o \
if1632/if1632.o \
memory/memory.o \
miscemu/miscemu.o
......
......@@ -15,9 +15,6 @@ sure to analyze the problem before you report it to the newsgroup.
Emulator/Library: You need an emulator when you want to run MS-Win
binaries. You need a library when you want to compile the source code
of a Windows program.
Short filenames: Some file systems are limited to 11 characters per
file name. Files generated in if1632 will get gracefully translated
names.
Language: Wine can present the system menu in multiple languages. Select
one of English, German, or Norwegian here.
Malloc debugging: When enabled, the mtrace and mcheck GNU libc functions
......
XCOMM $Id$
INCLUDES = -I$(TOP)/include -I$(TOP)
XCOMM Imake rules go here
XCOMM First, dll description to files etc
#ifndef MakeDllFromSpec
#ifndef NewBuild
#ifndef ShortNames
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat3(dll_,name,_tab.c): name.spec $(TOP)/tools/build @@\
$(TOP)/tools/build name.spec @@\
#else /* ShortNames */
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(dtb_,name.c): name.spec $(TOP)/tools/build @@\
$(TOP)/tools/build name.spec @@\
#endif /* ShortNames */
#else /* NewBuild */
#ifndef ShortNames
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(rly_,name.S) Concat3(dll_,name,_tab.c): name.spec $(TOP)/tools/newbuild @@\
$(TOP)/tools/newbuild name.spec @@\
#else /* ShortNames */
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(rly_,name.S) Concat(dtb_,name.c): name.spec $(TOP)/tools/newbuild @@\
$(TOP)/tools/newbuild name.spec @@\
#endif /* ShortNames */
#endif /* NewBuild */
#endif /* MakeDllFromSpec */
/*
* WineRelocatableTarget - generate rules to produce a relocatable object
* file instead of a library.
......
......@@ -4,6 +4,7 @@
* Copyright David W. Metcalfe, 1994
*
* Release 3, July 1994
* April 1995 bug fixes (William Magro)
static char Copyright[] = "Copyright David W. Metcalfe, 1994";
*/
......@@ -65,6 +66,7 @@ typedef struct
int DeletedCurrCol; /* starting col from which text was deleted */
int NumTabStops; /* number of tab stops in buffer hTabStops */
HANDLE hTabStops; /* handle of tab stops buffer */
BOOL HaveFocus; /* TRUE if this edit has the focus */
} EDITSTATE;
......@@ -147,7 +149,7 @@ void EDIT_DeleteSel(HWND hwnd);
void EDIT_ClearSel(HWND hwnd);
int EDIT_TextLineNumber(HWND hwnd, char *lp);
void EDIT_SetAnchor(HWND hwnd, int row, int col);
void EDIT_ExtendSel(HWND hwnd, int x, int y);
void EDIT_ExtendSel(HWND hwnd, INT x, INT y);
void EDIT_WriteSel(HWND hwnd, int y, int start, int end);
void EDIT_StopMarking(HWND hwnd);
LONG EDIT_GetLineMsg(HWND hwnd, WORD wParam, LONG lParam);
......@@ -380,29 +382,32 @@ LONG EditWndProc(HWND hwnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_KILLFOCUS:
es->HaveFocus = FALSE;
DestroyCaret();
if (SelMarked(es)) EDIT_ClearSel(hwnd);
NOTIFY_PARENT(hwnd, EN_KILLFOCUS);
break;
case WM_LBUTTONDOWN:
HideCaret(hwnd);
SetFocus(hwnd);
SetCapture(hwnd);
EDIT_LButtonDownMsg(hwnd, wParam, lParam);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
break;
case WM_LBUTTONUP:
if (GetCapture() != hwnd) break;
ReleaseCapture();
ButtonDown = FALSE;
if (TextMarking)
EDIT_StopMarking(hwnd);
break;
case WM_MOUSEMOVE:
HideCaret(hwnd);
EDIT_MouseMoveMsg(hwnd, wParam, lParam);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
if (es->HaveFocus)
EDIT_MouseMoveMsg(hwnd, wParam, lParam);
break;
case WM_MOVE:
......@@ -422,6 +427,7 @@ LONG EditWndProc(HWND hwnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_SETFOCUS:
es->HaveFocus = TRUE;
CreateCaret(hwnd, 0, 2, es->txtht);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
......@@ -506,6 +512,8 @@ long EDIT_NCCreateMsg(HWND hwnd, LONG lParam)
es->wlines = 0;
es->textwidth = 0;
EDIT_ClearTextPointers(hwnd);
if(IsMultiLine()) strcpy(text, "\r\n");
EDIT_BuildTextPointers(hwnd);
}
else
{
......@@ -516,14 +524,18 @@ long EDIT_NCCreateMsg(HWND hwnd, LONG lParam)
es->hText = EDIT_HeapAlloc(hwnd, EditBufLen(wndPtr) + 2);
text = EDIT_HeapAddr(hwnd, es->hText);
strcpy(text, windowName);
if(IsMultiLine()) strcat(text, "\r\n");
es->textlen += 2;
*(text + es->textlen) = '\0';
}
else
{
es->hText = EDIT_HeapAlloc(hwnd, strlen(windowName) + 2);
es->hText = EDIT_HeapAlloc(hwnd, strlen(windowName) + 4);
text = EDIT_HeapAddr(hwnd, es->hText);
strcpy(text, windowName);
es->textlen = strlen(windowName) + 1;
if(IsMultiLine()) strcat(text, "\r\n");
es->textlen = strlen(windowName) + 3;
*(text + es->textlen) = '\0';
}
*(text + es->textlen + 1) = '\0';
EDIT_BuildTextPointers(hwnd);
......@@ -727,7 +739,7 @@ void EDIT_PaintMsg(HWND hwnd)
for (y = (rc.top / es->txtht); y <= (rc.bottom / es->txtht); y++)
{
if (y < es->wlines - es->wtop)
if (y < (IsMultiLine() ? es->wlines : 1) - es->wtop)
EDIT_WriteTextLine(hwnd, &rc, y + es->wtop);
}
......@@ -885,17 +897,23 @@ void EDIT_WriteTextLine(HWND hwnd, RECT *rect, int y)
lnlen1 = lnlen;
/* build the line to display */
if (lnlen < es->wleft)
if (lnlen < (es->wleft + rc.left))
{
lnlen = 0;
return;
}
else
{
off += es->wleft;
lnlen -= off;
}
if (lnlen > rc.left)
{
off += rc.left;
lnlen = lnlen1 - off;
len = min(lnlen, rc.right - rc.left);
}
len = min(lnlen, rc.right - rc.left);
if (SelMarked(es))
{
......@@ -1141,7 +1159,7 @@ HANDLE EDIT_GetStr(HWND hwnd, char *lp, int off, int len, int *diff)
str = (char *)EDIT_HeapAddr(hwnd, hStr);
for (i = ch1, j = 0; i < ch; i++, j++)
str[j] = lp[i];
str[++j] = '\0';
str[j] = '\0';
dprintf_edit(stddeb,"EDIT_GetStr: returning %s\n", str);
return hStr;
}
......@@ -1193,7 +1211,7 @@ void EDIT_KeyTyped(HWND hwnd, short ch)
EDITSTATE *es =
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
char *text = EDIT_HeapAddr(hwnd, es->hText);
char *currchar = CurrChar;
char *currchar;
RECT rc;
BOOL FullPaint = FALSE;
......@@ -1203,6 +1221,9 @@ void EDIT_KeyTyped(HWND hwnd, short ch)
if (SelMarked(es))
EDIT_DeleteSel(hwnd);
/* currchar must be assigned after deleting the selection */
currchar = CurrChar;
/* test for typing at end of maximum buffer size */
if (currchar == text + es->MaxTextLen)
{
......@@ -1271,7 +1292,6 @@ void EDIT_KeyTyped(HWND hwnd, short ch)
else
es->textwidth = max(es->textwidth,
EDIT_StrLength(hwnd, text, strlen(text), 0));
EDIT_WriteTextLine(hwnd, NULL, es->wtop + es->WndRow);
if (ch == '\n')
{
......@@ -1306,6 +1326,7 @@ void EDIT_KeyTyped(HWND hwnd, short ch)
}
es->WndCol += EDIT_CharWidth(hwnd, (BYTE)ch, es->WndCol + es->wleft);
es->CurrCol++;
EDIT_WriteTextLine(hwnd, NULL, es->wtop + es->WndRow);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
NOTIFY_PARENT(hwnd, EN_CHANGE);
......@@ -1382,8 +1403,11 @@ void EDIT_Forward(HWND hwnd)
if (*CurrChar == '\r')
{
EDIT_Home(hwnd);
EDIT_Downward(hwnd);
if (es->CurrLine < (es->wlines - 1))
{
EDIT_Home(hwnd);
EDIT_Downward(hwnd);
}
}
else
{
......@@ -1549,7 +1573,7 @@ void EDIT_StickEnd(HWND hwnd)
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
int len = EDIT_LineLength(hwnd, es->CurrLine);
char *cp = EDIT_TextLine(hwnd, es->CurrLine);
char currpel;
int currpel;
es->CurrCol = min(len, es->CurrCol);
es->WndCol = min(EDIT_StrLength(hwnd, cp, len, 0) - es->wleft, es->WndCol);
......@@ -2150,22 +2174,22 @@ void EDIT_LButtonDownMsg(HWND hwnd, WORD wParam, LONG lParam)
EDIT_ClearSel(hwnd);
es->WndRow = HIWORD(lParam) / es->txtht;
if (es->WndRow > es->wlines - es->wtop - 1)
if (!IsMultiLine())
es->WndRow = 0;
else if (es->WndRow > es->wlines - es->wtop - 1)
{
if (es->wlines)
es->WndRow = es->wlines - es->wtop - 1;
else
es->WndRow = 0;
es->WndRow = es->wlines - es->wtop - 1;
end = TRUE;
}
es->CurrLine = es->wtop + es->WndRow;
cp = EDIT_TextLine(hwnd, es->CurrLine);
len = EDIT_LineLength(hwnd, es->CurrLine);
es->WndCol = LOWORD(lParam);
if (es->WndCol > EDIT_StrLength(hwnd, cp, len, 0) - es->wleft || end)
es->WndCol = EDIT_StrLength(hwnd, cp, len, 0) - es->wleft;
es->WndCol = LOWORD(lParam) + es->wleft;
if (es->WndCol > EDIT_StrLength(hwnd, cp, len, 0) || end)
es->WndCol = EDIT_StrLength(hwnd, cp, len, 0);
es->CurrCol = EDIT_PixelToChar(hwnd, es->CurrLine, &(es->WndCol));
es->WndCol -= es->wleft;
ButtonDown = TRUE;
ButtonRow = es->CurrLine;
......@@ -2179,9 +2203,14 @@ void EDIT_LButtonDownMsg(HWND hwnd, WORD wParam, LONG lParam)
void EDIT_MouseMoveMsg(HWND hwnd, WORD wParam, LONG lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
EDITSTATE *es =
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
if (wParam != MK_LBUTTON)
return;
HideCaret(hwnd);
if (ButtonDown)
{
EDIT_SetAnchor(hwnd, ButtonRow, ButtonCol);
......@@ -2190,7 +2219,11 @@ void EDIT_MouseMoveMsg(HWND hwnd, WORD wParam, LONG lParam)
}
if (TextMarking)
{
EDIT_ExtendSel(hwnd, LOWORD(lParam), HIWORD(lParam));
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
}
ShowCaret(hwnd);
}
......@@ -2297,7 +2330,7 @@ void EDIT_ClearText(HWND hwnd)
void EDIT_SetSelMsg(HWND hwnd, WORD wParam, LONG lParam)
{
int so, eo;
INT so, eo;
WND *wndPtr = WIN_FindWndPtr(hwnd);
EDITSTATE *es =
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
......@@ -2313,7 +2346,7 @@ void EDIT_SetSelMsg(HWND hwnd, WORD wParam, LONG lParam)
if (so == eo) /* if so == eo, set caret only */
{
EDIT_GetLineCol(hwnd, so, &(es->CurrLine), &(es->CurrCol));
EDIT_GetLineCol(hwnd, (int) so, &(es->CurrLine), &(es->CurrCol));
es->WndRow = es->CurrLine - es->wtop;
if (!wParam)
......@@ -2340,11 +2373,16 @@ void EDIT_SetSelMsg(HWND hwnd, WORD wParam, LONG lParam)
}
else /* otherwise set selection */
{
if (so > eo)
swap(&so, &eo);
if (eo >= 0 && so > eo) /* eo == -1 flag to extend to end of text */
{
INT tmp;
tmp = so;
so = eo;
eo = tmp;
}
EDIT_GetLineCol(hwnd, so, &(es->SelBegLine), &(es->SelBegCol));
EDIT_GetLineCol(hwnd, eo, &(es->SelEndLine), &(es->SelEndCol));
EDIT_GetLineCol(hwnd, (int) so, &(es->SelBegLine), &(es->SelBegCol));
EDIT_GetLineCol(hwnd, (int) eo, &(es->SelEndLine), &(es->SelEndCol));
es->CurrLine = es->SelEndLine;
es->CurrCol = es->SelEndCol;
es->WndRow = es->SelEndLine - es->wtop;
......@@ -2407,7 +2445,7 @@ void EDIT_GetLineCol(HWND hwnd, int off, int *line, int *col)
return;
}
if (off > strlen(text)) off = strlen(text);
if (off < 0 || off > strlen(text)) off = strlen(text);
cp1 = text;
for (lineno = 0; lineno < es->wlines; lineno++)
{
......@@ -2536,8 +2574,10 @@ void EDIT_SetAnchor(HWND hwnd, int row, int col)
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
if (SelMarked(es))
{
sel = TRUE;
EDIT_ClearSel(hwnd);
EDIT_ClearSel(hwnd);
}
es->SelBegLine = es->SelEndLine = row;
es->SelBegCol = es->SelEndCol = col;
if (sel)
......@@ -2554,12 +2594,11 @@ void EDIT_SetAnchor(HWND hwnd, int row, int col)
* Extend selection to the given screen co-ordinates.
*/
void EDIT_ExtendSel(HWND hwnd, int x, int y)
void EDIT_ExtendSel(HWND hwnd, INT x, INT y)
{
int bbl, bel, bbc, bec;
char *cp;
int len, line;
BOOL end = FALSE;
WND *wndPtr = WIN_FindWndPtr(hwnd);
EDITSTATE *es =
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
......@@ -2568,28 +2607,31 @@ void EDIT_ExtendSel(HWND hwnd, int x, int y)
bbl = es->SelEndLine;
bbc = es->SelEndCol;
line = es->wtop + y / es->txtht;
if (line > es->wlines)
line = es->wlines;
y = max(y,0);
if (IsMultiLine())
{
if ((line = es->wtop + y / es->txtht) >= es->wlines)
line = es->wlines - 1;
}
else
line = 0;
cp = EDIT_TextLine(hwnd, line);
len = EDIT_LineLength(hwnd, line);
es->WndRow = y / es->txtht;
if (es->WndRow > es->wlines - es->wtop - 1)
{
if (es->wlines)
es->WndRow = es->wlines - es->wtop - 1;
else
if (!IsMultiLine())
es->WndRow = 0;
end = TRUE;
}
else if (es->WndRow > es->wlines - es->wtop - 1)
es->WndRow = es->wlines - es->wtop - 1;
es->CurrLine = es->wtop + es->WndRow;
es->SelEndLine = es->CurrLine;
es->WndCol = x;
if (es->WndCol > EDIT_StrLength(hwnd, cp, len, 0) - es->wleft || end)
es->WndCol = EDIT_StrLength(hwnd, cp, len, 0) - es->wleft;
es->WndCol = es->wleft + max(x,0);
if (es->WndCol > EDIT_StrLength(hwnd, cp, len, 0))
es->WndCol = EDIT_StrLength(hwnd, cp, len, 0);
es->CurrCol = EDIT_PixelToChar(hwnd, es->CurrLine, &(es->WndCol));
es->WndCol -= es->wleft;
es->SelEndCol = es->CurrCol;
bel = es->SelEndLine;
......@@ -2631,12 +2673,10 @@ void EDIT_ExtendSel(HWND hwnd, int x, int y)
void EDIT_WriteSel(HWND hwnd, int y, int start, int end)
{
RECT rc;
RECT rc, rcInvert;
int scol, ecol;
char *cp;
HDC hdc;
HBRUSH hbrush, holdbrush;
int olddm;
WND *wndPtr = WIN_FindWndPtr(hwnd);
EDITSTATE *es =
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
......@@ -2660,20 +2700,19 @@ void EDIT_WriteSel(HWND hwnd, int y, int start, int end)
* lines. I have kludged this by adding on two pixels to ecol and
* to the line height in the call to Rectangle.
*/
scol = EDIT_StrLength(hwnd, cp, start, 0);
scol = EDIT_StrLength(hwnd, cp, start, 0) - es->wleft;
if (scol > rc.right) return;
if (scol < rc.left) scol = rc.left;
ecol = EDIT_StrLength(hwnd, cp, end, 0) + 2; /* ??? */
ecol = EDIT_StrLength(hwnd, cp, end, 0) - es->wleft;
if (ecol < rc.left) return;
if (ecol > rc.right) ecol = rc.right;
hdc = GetDC(hwnd);
hbrush = GetStockObject(BLACK_BRUSH);
holdbrush = (HBRUSH)SelectObject(hdc, (HANDLE)hbrush);
olddm = SetROP2(hdc, R2_XORPEN);
Rectangle(hdc, scol, y * es->txtht, ecol, (y + 1) * es->txtht + 2);
SetROP2(hdc, olddm);
SelectObject(hdc, (HANDLE)holdbrush);
rcInvert.left = scol;
rcInvert.top = y * es->txtht;
rcInvert.right = ecol;
rcInvert.bottom = (y + 1) * es->txtht;
InvertRect(hdc, (LPRECT) &rcInvert);
ReleaseDC(hwnd, hdc);
}
......@@ -2931,7 +2970,10 @@ void EDIT_SaveDeletedText(HWND hwnd, char *deltext, int len,
EDITSTATE *es =
(EDITSTATE *)EDIT_HeapAddr(hwnd, (HANDLE)(*(wndPtr->wExtra)));
es->hDeletedText = GlobalReAlloc(es->hDeletedText, len, GMEM_MOVEABLE);
if (!es->hDeletedText)
es->hDeletedText = GlobalAlloc( GMEM_MOVEABLE, len );
else
es->hDeletedText = GlobalReAlloc(es->hDeletedText, len, GMEM_MOVEABLE);
if (!es->hDeletedText) return;
text = (char *)GlobalLock(es->hDeletedText);
memcpy(text, deltext, len);
......
This diff is collapsed.
......@@ -246,6 +246,27 @@ static void MENU_CalcItemSize( HDC hdc, LPMENUITEM lpitem, HWND hwndOwner,
SetRect( &lpitem->rect, orgX, orgY, orgX, orgY );
lpitem->xTab = 0;
if (lpitem->item_flags & MF_OWNERDRAW) {
static HANDLE mistrh = 0;
static SEGPTR mistrsegp = 0;
static LPMEASUREITEMSTRUCT mistruct=NULL;
if (mistruct == NULL) {
mistrh = GlobalAlloc(0,sizeof(MEASUREITEMSTRUCT));
mistrsegp = WIN16_GlobalLock(mistrh);
mistruct = PTR_SEG_TO_LIN(mistrsegp);
}
mistruct->CtlType = ODT_MENU;
mistruct->itemID = lpitem->item_id;
mistruct->itemData = (long int)lpitem->item_text;
mistruct->itemHeight = 16;
mistruct->itemWidth = 30;
SendMessage(hwndOwner,WM_MEASUREITEM,0,mistrsegp);
lpitem->rect.bottom += mistruct->itemHeight;
lpitem->rect.right += mistruct->itemWidth;
dprintf_menu(stddeb,"DrawMenuItem: MeasureItem %04x %d:%d!\n",
lpitem->item_id,mistruct->itemWidth, mistruct->itemHeight);
return;
}
if (lpitem->item_flags & MF_SEPARATOR)
{
......@@ -422,11 +443,35 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect, LPPOPUPMENU lppop,
*
* Draw a single menu item.
*/
static void MENU_DrawMenuItem( HDC hdc, LPMENUITEM lpitem,
static void MENU_DrawMenuItem( HWND hwnd, HDC hdc, LPMENUITEM lpitem,
WORD height, BOOL menuBar )
{
RECT rect;
if (lpitem->item_flags & MF_OWNERDRAW) {
static HANDLE distrh = 0;
static SEGPTR distrsegp = 0;
static LPDRAWITEMSTRUCT distruct=NULL;
if (distruct == NULL) {
distrh = GlobalAlloc(0,sizeof(DRAWITEMSTRUCT));
distrsegp = WIN16_GlobalLock(distrh);
distruct = PTR_SEG_TO_LIN(distrsegp);
}
dprintf_menu(stddeb,"DrawMenuItem: Ownerdraw!\n");
distruct->CtlType = ODT_MENU;
distruct->itemID = lpitem->item_id;
distruct->itemData = (long int)lpitem->item_text;
distruct->itemState = 0;
if (lpitem->item_flags & MF_CHECKED) distruct->itemState |= ODS_CHECKED;
if (lpitem->item_flags & MF_GRAYED) distruct->itemState |= ODS_GRAYED;
if (lpitem->item_flags & MF_HILITE) distruct->itemState |= ODS_SELECTED;
distruct->itemAction = ODA_DRAWENTIRE | ODA_SELECT | ODA_FOCUS;
distruct->hwndItem = hwnd;
distruct->hDC = hdc;
distruct->rcItem = lpitem->rect;
SendMessage(hwnd,WM_DRAWITEM,0,distrsegp);
return;
}
if (menuBar && (lpitem->item_flags & MF_SEPARATOR)) return;
rect = lpitem->rect;
......@@ -566,7 +611,7 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
if (!menu || !menu->nItems) return;
item = (MENUITEM *) USER_HEAP_LIN_ADDR( menu->hItems );
for (i = menu->nItems; i > 0; i--, item++)
MENU_DrawMenuItem( hdc, item, menu->Height, FALSE );
MENU_DrawMenuItem( hwnd, hdc, item, menu->Height, FALSE );
}
......@@ -599,7 +644,7 @@ WORD MENU_DrawMenuBar(HDC hDC, LPRECT lprect, HWND hwnd, BOOL suppress_draw)
lpitem = (MENUITEM *) USER_HEAP_LIN_ADDR( lppop->hItems );
for (i = 0; i < lppop->nItems; i++, lpitem++)
{
MENU_DrawMenuItem( hDC, lpitem, lppop->Height, TRUE );
MENU_DrawMenuItem( hwnd, hDC, lpitem, lppop->Height, TRUE );
}
return lppop->Height;
}
......@@ -677,7 +722,7 @@ static void MENU_SelectItem( HMENU hmenu, WORD wIndex )
else
{
items[lppop->FocusedItem].item_flags &=~(MF_HILITE|MF_MOUSESELECT);
MENU_DrawMenuItem( hdc, &items[lppop->FocusedItem], lppop->Height,
MENU_DrawMenuItem( lppop->hWnd, hdc, &items[lppop->FocusedItem], lppop->Height,
!(lppop->wFlags & MF_POPUP) );
}
}
......@@ -691,7 +736,7 @@ static void MENU_SelectItem( HMENU hmenu, WORD wIndex )
else
{
items[lppop->FocusedItem].item_flags |= MF_HILITE;
MENU_DrawMenuItem( hdc, &items[lppop->FocusedItem], lppop->Height,
MENU_DrawMenuItem( lppop->hWnd, hdc, &items[lppop->FocusedItem], lppop->Height,
!(lppop->wFlags & MF_POPUP) );
SendMessage(lppop->hWnd, WM_MENUSELECT,
items[lppop->FocusedItem].item_id,
......
......@@ -14,37 +14,31 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "mdi.h"
#include "gdi.h"
#include "user.h"
LONG ListBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG ComboBoxWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG EditWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG PopupMenuWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG DesktopWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG MDIClientWndProc ( HWND hwnd, WORD message, WORD wParam, LONG lParam );
#include "selectors.h"
static WNDCLASS WIDGETS_BuiltinClasses[] =
{
{ CS_GLOBALCLASS | CS_PARENTDC, ButtonWndProc, 0, sizeof(BUTTONINFO),
0, 0, 0, 0, NULL, "BUTTON" },
{ CS_GLOBALCLASS | CS_PARENTDC, StaticWndProc, 0, sizeof(STATICINFO),
0, 0, 0, 0, NULL, "STATIC" },
{ CS_GLOBALCLASS | CS_PARENTDC, ScrollBarWndProc, 0, sizeof(SCROLLINFO),
0, 0, 0, 0, NULL, "SCROLLBAR" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, ListBoxWndProc, 0, 8,
0, 0, 0, 0, NULL, "LISTBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, ComboBoxWndProc, 0, 8,
0, 0, 0, 0, NULL, "COMBOBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC, EditWndProc, 0, sizeof(WORD),
0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0, 8,
0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
{ CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProc, 0, DLGWINDOWEXTRA,
0, 0, 0, 0, NULL, DIALOG_CLASS_NAME },
{ CS_GLOBALCLASS, MDIClientWndProc, 0, sizeof(MDICLIENTINFO),
0, 0, 0, STOCK_LTGRAY_BRUSH, NULL, "MDICLIENT" }
{ CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ButtonWndProc", 0,
sizeof(BUTTONINFO), 0, 0, 0, 0, NULL, "BUTTON" },
{ CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"StaticWndProc", 0,
sizeof(STATICINFO), 0, 0, 0, 0, NULL, "STATIC" },
{ CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ScrollBarWndProc", 0,
sizeof(SCROLLINFO), 0, 0, 0, 0, NULL, "SCROLLBAR" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ListBoxWndProc", 0,
8, 0, 0, 0, 0, NULL, "LISTBOX" },
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ComboBoxWndProc", 0,
8, 0, 0, 0, 0, NULL, "COMBOBOX" },
{ CS_GLOBALCLASS, (WNDPROC)"EditWndProc", 0,
sizeof(WORD), 0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0,
8, 0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC)"DesktopWndProc", 0,
sizeof(DESKTOPINFO), 0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"DefDlgProc", 0,
DLGWINDOWEXTRA, 0, 0, 0, 0, NULL, DIALOG_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC)"MDIClientWndProc", 0,
sizeof(MDICLIENTINFO), 0, 0, 0, STOCK_LTGRAY_BRUSH, NULL, "MDICLIENT" }
};
#define NB_BUILTIN_CLASSES \
......@@ -70,6 +64,7 @@ BOOL WIDGETS_Init(void)
strcpy( name, class->lpszClassName );
class->lpszClassName = (LPSTR)USER_HEAP_SEG_ADDR( hName );
class->hCursor = LoadCursor( 0, IDC_ARROW );
class->lpfnWndProc = GetWndProcEntry16( (char *)class->lpfnWndProc );
if (!RegisterClass( class )) return FALSE;
}
USER_HEAP_FREE( hName );
......
......@@ -277,11 +277,12 @@ void dbg_bt(){
while((cs & 3) == 3) {
/* See if in 32 bit mode or not. Assume GDT means 32 bit. */
if ((cs & 7) != 7) {
void CallTo32();
extern int main();
fprintf(stderr,"%d ",frameno++);
print_address(frame->u.win32.saved_ip,stderr,32);
fprintf( stderr, "\n" );
if(frame->u.win32.saved_ip<((unsigned long)CallTo32+1000))break;
if (frame->u.win32.saved_ip >= ((unsigned long)main) &&
frame->u.win32.saved_ip <= ((unsigned long)main+1000)) break;
frame = (struct frame *) frame->u.win32.saved_bp;
} else {
if (frame->u.win16.saved_bp & 1) cs = frame->u.win16.saved_cs;
......
......@@ -9,40 +9,45 @@ SRCS = \
#ifdef WINELIB
CALLOBJS =
DLLOBJS =
DLLS =
#else
CALLOBJS = call.o
DLLOBJS = \
dll_commdlg.o \
dll_compobj.o \
dll_gdi.o \
dll_kernel.o \
dll_keyboard.o \
dll_mmsystem.o \
dll_mouse.o \
dll_ole2.o \
dll_ole2conv.o \
dll_ole2disp.o \
dll_ole2nls.o \
dll_ole2prox.o \
dll_olecli.o \
dll_olesvr.o \
dll_shell.o \
dll_sound.o \
dll_storage.o \
dll_stress.o \
dll_system.o \
dll_toolhelp.o \
dll_user.o \
dll_win87em.o \
dll_winsock.o
CALLOBJS = \
call16.o \
call32.o
DLLS = \
commdlg \
compobj \
gdi \
kernel \
keyboard \
mmsystem \
mouse \
ole2 \
ole2conv \
ole2disp \
ole2nls \
ole2prox \
olecli \
olesvr \
shell \
sound \
storage \
stress \
system \
toolhelp \
user \
win87em \
winprocs \
winsock
#endif
#ifndef NewBuild
OBJS = $(CALLOBJS) $(DLLOBJS) $(SRCS:.c=.o) $(DLLOBJS:.o=_tab.o)
#else
OBJS = $(CALLOBJS) $(DLLOBJS) $(SRCS:.c=.o) $(DLLOBJS:.o=_tab.o) $(DLLOBJS:dll_.rly_)
#endif
OBJS = $(DLLS:%=dll_%.o) $(CALLOBJS) $(SRCS:.c=.o) $(DLLS:%=tab_%.o)
BUILD = $(TOP)/tools/build
#define MakeDllFromSpec(name) @@\
Concat(dll_,name.S) Concat(tab_,name.c): name.spec $(BUILD) @@\
$(BUILD) -spec name.spec @@\
/*
* If you add a new spec file, copy one of these lines
......@@ -69,23 +74,25 @@ MakeDllFromSpec(system)
MakeDllFromSpec(toolhelp)
MakeDllFromSpec(user)
MakeDllFromSpec(win87em)
MakeDllFromSpec(winprocs)
MakeDllFromSpec(winsock)
WineRelocatableTarget($(MODULE),,$(OBJS))
DependTarget()
#ifndef WINELIB
pop.h: $(TOP)/tools/build
$(TOP)/tools/build -p
call.o: call.S pop.h
$(CC) -I. -c -o call.o call.S
#endif
call32.S: $(BUILD) $(DLLS:%=dll_%.S)
$(BUILD) -call32 `cat $(DLLS:%=dll_%.S) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S
call16.S: $(BUILD) $(TOP)/include/callback.h
$(BUILD) -call16 `cat $(TOP)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > call16.S
#endif /* WINELIB */
includes::
touch pop.h
install::
clean::
$(RM) dll* dtb* pop.h call.s
$(RM) dll_* tab_* call32.S call16.S
/*
* Copyright Robert J. Amstadt, 1993
*/
#ifdef linux
#define UDATASEL 0x2b
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__)
#define UDATASEL 0x27
#endif
#ifdef __ELF__
#define A(addr) addr
#else
#define A(addr) _##addr
#endif
.data
jump_target:
return_value:
.long 0
/**********************************************************************
* Places to keep info about the current 32-bit stack frame.
*/
.globl A( IF1632_Saved32_esp), A(IF1632_Saved32_ebp), A(IF1632_Saved32_ss)
A(IF1632_Saved32_esp:)
.long 0
A(IF1632_Saved32_ebp:)
.long 0
A(IF1632_Saved32_ss:)
.word 0
#ifdef __ELF__
A(IF1632_ELF_KLUDGE:)
.long 0
.word 0x0f
#endif
/**********************************************************************
* Places to keep info about the current 16-bit stack frame.
*/
.globl A(IF1632_Saved16_sp),A(IF1632_Saved16_bp),A(IF1632_Saved16_ss)
A(IF1632_Saved16_sp:)
.word 0
A(IF1632_Saved16_bp:)
.word 0
A(IF1632_Saved16_ss:)
.word 0
nbytes:
.word 0
selector:
.word 0
offset:
.word 0
.text
/**********************************************************************
* int CallToInit16(unsigned long csip, unsigned long sssp,
* unsigned short ds)
*
* Stack: 0 ebp
* 4 eip
* 8 target ip
* 10 target cs
* 12 target sp
* 14 target ss
* 16 target ds
*/
.align 4
.globl A(CallToInit16)
A(CallToInit16:)
pushl %ebp
movl %esp,%ebp
/*
* Save our registers
*/
pushal
pushl A(IF1632_Saved32_esp)
pushl A(IF1632_Saved32_ebp)
pushw A(IF1632_Saved32_ss)
#ifdef __ELF__
/* change to the other code segment */
movw $0x0f, %ax
movw %ax, A(IF1632_ELF_KLUDGE)+4
movl $L4, %eax
andl $0x0000ffff, %eax
movl %eax,A(IF1632_ELF_KLUDGE)
ljmp A(IF1632_ELF_KLUDGE)
L4:
#endif
/*
* Get target address.
*/
movl 8(%ebp),%eax
movl %eax,jump_target
lea jump_target,%edx
/*
* Put stack registers where we can get them after stack switch.
*/
movw %ss,A(IF1632_Saved32_ss)
movl %esp,A(IF1632_Saved32_esp)
movl %ebp,A(IF1632_Saved32_ebp)
/*
* Load initial registers
*/
movw A(WIN_StackSize),%bx
movw A(WIN_HeapSize),%cx
movl $0,%esi
xorl %eax,%eax
movw A(PSPSelector),%ax
movw %ax,%es
movw 16(%ebp),%ax
movw %ax,%ds
movl %eax,%edi
xorl %eax,%eax
movw 12(%ebp),%ax
movl %eax,%esp
movw 14(%ebp),%ax
movw %ax,%ss
movl %esp,%eax
movl %eax,%ebp
movw $UDATASEL,%ax
movw %ax,%fs
movw %ax,%gs
movw %ds,%ax
/*
* Call entry point
*/
.byte 0x66
lcall %fs:(%edx)
/*
* Restore old stack and segment registers.
*
* Two choices here:
* 1. Trust that fs or gs hasn't changed.
* 2. Rely on knowledge of Linux use of segments.
*
* I'll opt for choice 2 because who knows what programs we
* going to run. Linux should be fairly stable in terms of
* GDT usage.
*/
pushl %eax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
movw %ax,%fs
movw %ax,%gs
popl %eax
movw A(IF1632_Saved32_ss),%ss
movl A(IF1632_Saved32_esp),%esp
movl A(IF1632_Saved32_ebp),%ebp
/*
* Restore registers, but do not destroy return value.
*/
popw A(IF1632_Saved32_ss)
popl A(IF1632_Saved32_ebp)
popl A(IF1632_Saved32_esp)
movl %eax,return_value
#ifdef __ELF__
/* change back */
movw $0x23, %ax
movw %ax, A(IF1632_ELF_KLUDGE)+4
movl $L5, %eax
movl %eax,A(IF1632_ELF_KLUDGE)
ljmp A(IF1632_ELF_KLUDGE)
L5:
#endif
popal
movl return_value,%eax
.align 2,0x90
leave
ret
/**********************************************************************
* int CallTo16 (unsigned long csip, unsigned short ds)
* int CallTo16cx(unsigned long csip, unsigned long dscx);
*
* Stack: 0 ebp
* 4 eip
* 8 target ip
* 10 target cs
* 12 target ds
* 14 target cx (only CallTo16cx)
* 16 target di
*/
.align 4
.globl A(CallTo16), A(CallTo16cx), A(CallToLibMain)
A(CallToLibMain:)
pushl %ebp
movl %esp,%ebp
movw 16(%ebp),%di
movw 0,%si
movw 0,%es
jmp L1
A(CallTo16:)
A(CallTo16cx:)
pushl %ebp
movl %esp,%ebp
/*
* Get target address and new ds
*/
L1:
#ifdef __ELF__
/* change code segments */
movw $0x0f, %ax
movw %ax, A(IF1632_ELF_KLUDGE)+4
movl $L2, %eax
andl $0x0000ffff, %eax
movl %eax,A(IF1632_ELF_KLUDGE)
ljmp A(IF1632_ELF_KLUDGE)
L2:
#endif
/* At this point we have changed segments. */
movl 8(%ebp),%eax
movl %eax,jump_target
lea jump_target,%edx
movw 12(%ebp),%ax
movw 14(%ebp),%cx
/*
* Switch to 16-bit stack
*/
pushl A(IF1632_Saved32_esp)
pushl A(IF1632_Saved32_ebp)
pushw A(IF1632_Saved32_ss)
movw %ss,A(IF1632_Saved32_ss)
movl %esp,A(IF1632_Saved32_esp)
movl %ebp,A(IF1632_Saved32_ebp)
movw A(IF1632_Saved16_ss),%ss
movw A(IF1632_Saved16_sp),%sp
movw A(IF1632_Saved16_bp),%bp
/*
* Call entry point
*/
movw %ax,%ds
movw %ax,%di
.byte 0x66
lcall %fs:(%edx)
/*
* Restore old stack and segment registers.
*
* Two choices here:
* 1. Trust that fs or gs hasn't changed.
* 2. Rely on knowledge of Linux use of segments.
*
* I'll opt for choice 2 because who knows what programs we
* going to run. Linux should be fairly stable in terms of
* GDT usage.
*/
pushl %eax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
movw %ax,%fs
movw %ax,%gs
popl %eax
movw %ss,A(IF1632_Saved16_ss)
movw %esp,A(IF1632_Saved16_sp)
movw %ebp,A(IF1632_Saved16_bp)
movw A(IF1632_Saved32_ss),%ss
movl A(IF1632_Saved32_esp),%esp
movl A(IF1632_Saved32_ebp),%ebp
popw A(IF1632_Saved32_ss)
popl A(IF1632_Saved32_ebp)
popl A(IF1632_Saved32_esp)
movl %eax,return_value
movw return_value+2,%dx
/* switch segments */
#ifdef __ELF__
movw $0x23, %ax
movw %ax, A(IF1632_ELF_KLUDGE)+4
movl $L3, %eax
movl %eax,A(IF1632_ELF_KLUDGE)
ljmp A(IF1632_ELF_KLUDGE)
L3:
/* back in the regular segment set up. */
/* restore eax */
movl return_value, %eax
#endif
.align 2,0x90
leave
ret
/**********************************************************************
* CallTo32()
*
* This function is called as a relay point to the built function
* handler. KERNEL, USER and GDI calls are dealt with by this
* handler. Calls to these DLLs will be mapped to a call handler
* which will set EAX to a number indicating which DLL and which
* function within that DLL.
*
* This function will pass to the function handler two arguments.
* The first argument will be the contents of EAX, the second
* argument will be a segment:offset pair that points to the
* 16-bit stack.
*/
.align 4
.globl A(CallTo32)
A(CallTo32:)
andl $0x0000ffff,%esp
pushw %bp
movl %esp,%ebp
/*
* Save registers. 286 mode does not have fs or gs.
*/
pushw %ds
/*
* Restore segment registers.
*/
pushl %eax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
popl %eax
/*
* Save old stack save variables, save stack registers, reload
* stack registers.
*/
pushw A(IF1632_Saved16_sp)
pushw A(IF1632_Saved16_bp)
pushw A(IF1632_Saved16_ss)
movw %ss,A(IF1632_Saved16_ss)
movw %sp,A(IF1632_Saved16_sp)
movw %bp,A(IF1632_Saved16_bp)
movw A(IF1632_Saved32_ss),%ss
movl A(IF1632_Saved32_esp),%esp
movl A(IF1632_Saved32_ebp),%ebp
/*
* Call entry point
*/
pushl %edx
pushw A(IF1632_Saved16_ss)
pushw A(IF1632_Saved16_sp)
pushl %eax
call A(DLLRelay)
popl %edx
popl %edx
popl %edx
/*
* Restore registers, but do not destroy return value.
*/
movw A(IF1632_Saved16_ss),%ss
movw A(IF1632_Saved16_sp),%sp
movw A(IF1632_Saved16_bp),%bp
popw A(IF1632_Saved16_ss)
popw A(IF1632_Saved16_bp)
popw A(IF1632_Saved16_sp)
popw %ds
popw %bp
/*
* Now we need to ditch the parameter bytes that were left on the
* stack. We do this by effectively popping the number of bytes,
* and the return address, removing the parameters and then putting
* the return address back on the stack.
* Normally this field is filled in by the relevant function in
* the emulation library, since it should know how many bytes to
* expect.
*/
popw %gs:nbytes
cmpw $0,%gs:nbytes
je noargs
popw %gs:offset
popw %gs:selector
addw %gs:nbytes,%esp
pushw %gs:selector
pushw %gs:offset
noargs:
/*
* Last, but not least we need to move the high word from eax to dx
*/
pushl %eax
popw %dx
popw %dx
.byte 0x66
lret
/**********************************************************************
* CallTo32_16()
*
* This function is same one as CallTo32() except that the high
* word of EAX won't be moved to DX.
*/
.align 4
.globl A(CallTo32_16)
A(CallTo32_16:)
andl $0x0000ffff,%esp
pushw %bp
movl %esp,%ebp
/*
* Save registers. 286 mode does not have fs or gs.
*/
pushw %ds
/*
* Restore segment registers.
*/
pushl %eax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
popl %eax
/*
* Save old stack save variables, save stack registers, reload
* stack registers.
*/
pushw A(IF1632_Saved16_sp)
pushw A(IF1632_Saved16_bp)
pushw A(IF1632_Saved16_ss)
movw %ss,A(IF1632_Saved16_ss)
movw %esp,A(IF1632_Saved16_sp)
movw %ebp,A(IF1632_Saved16_bp)
movw A(IF1632_Saved32_ss),%ss
movl A(IF1632_Saved32_esp),%esp
movl A(IF1632_Saved32_ebp),%ebp
/*
* Call entry point
*/
pushl %edx
pushw A(IF1632_Saved16_ss)
pushw A(IF1632_Saved16_sp)
pushl %eax
call A(DLLRelay)
popl %edx
popl %edx
popl %edx
/*
* Restore registers, but do not destroy return value.
*/
movw A(IF1632_Saved16_ss),%ss
movw A(IF1632_Saved16_sp),%sp
movw A(IF1632_Saved16_bp),%bp
popw A(IF1632_Saved16_ss)
popw A(IF1632_Saved16_bp)
popw A(IF1632_Saved16_sp)
popw %ds
popw %bp
/*
* Now we need to ditch the parameter bytes that were left on the
* stack. We do this by effectively popping the number of bytes,
* and the return address, removing the parameters and then putting
* the return address back on the stack.
* Normally this field is filled in by the relevant function in
* the emulation library, since it should know how many bytes to
* expect.
*/
popw %gs:nbytes
cmpw $0,%gs:nbytes
je noargs2
popw %gs:offset
popw %gs:selector
addw %gs:nbytes,%esp
pushw %gs:selector
pushw %gs:offset
noargs2:
.byte 0x66
lret
/**********************************************************************
* ReturnFromRegisterFunc()
*/
.globl A(ReturnFromRegisterFunc)
A(ReturnFromRegisterFunc:)
/*
* Restore 16-bit stack
*/
movw A(IF1632_Saved16_ss),%ss
movw A(IF1632_Saved16_sp),%sp
movw A(IF1632_Saved16_bp),%bp
popw A(IF1632_Saved16_ss)
popw A(IF1632_Saved16_bp)
popw A(IF1632_Saved16_sp)
popw %ds
popw %bp
/*
* This leaves us with a stack that has number of arguments,
* the return address, the saved registers, and the return
* address again.
*/
add $6,%esp /* argument count, return address */
#include "pop.h" /* restore context */
/*
* Return to original caller.
*/
.byte 0x66
lret
......@@ -7,18 +7,17 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <setjmp.h>
#include "windows.h"
#include "callback.h"
#include "wine.h"
#include <setjmp.h>
#include "ldt.h"
#include "global.h"
#include "stackframe.h"
#include "dlls.h"
#include "stddebug.h"
#include "debug.h"
#include "if1632.h"
extern unsigned short IF1632_Saved32_ss;
extern unsigned long IF1632_Saved32_ebp;
extern unsigned long IF1632_Saved32_esp;
......@@ -30,64 +29,6 @@ struct thunk_s
unsigned char thunk[8];
};
#ifdef __ELF__
#define FIRST_SELECTOR 2
#define IS_16_BIT_ADDRESS(addr) \
(((unsigned int)(addr) < 0x8000000) || ((unsigned int)(addr) >= 0x8400000))
#else
#define FIRST_SELECTOR 8
#define IS_16_BIT_ADDRESS(addr) \
((unsigned int)(addr) >= (((FIRST_SELECTOR << __AHSHIFT) | 7) << 16))
#endif
/**********************************************************************
* PushOn16
*/
static void
PushOn16(int size, unsigned int value)
{
char *p = PTR_SEG_OFF_TO_LIN( IF1632_Saved16_ss, IF1632_Saved16_sp );
if (size)
{
unsigned long *lp = (unsigned long *) p - 1;
*lp = value;
IF1632_Saved16_sp -= 4;
}
else
{
unsigned short *sp = (unsigned short *) p - 1;
*sp = value;
IF1632_Saved16_sp -= 2;
}
}
/**********************************************************************
* CallBack16
*/
int
CallBack16(void *func, int n_args, ...)
{
va_list ap;
int i;
int arg_type, arg_value;
WORD ds = CURRENT_DS;
va_start(ap, n_args);
for (i = 0; i < n_args; i++)
{
arg_type = va_arg(ap, int);
arg_value = va_arg(ap, int);
PushOn16(arg_type, arg_value);
}
va_end(ap);
return CallTo16((unsigned int) func, ds );
}
/**********************************************************************
* MakeProcInstance
......@@ -100,18 +41,8 @@ FARPROC MakeProcInstance( FARPROC func, WORD instance )
if (!ThunkSelector)
{
ldt_entry entry;
/* Allocate a segment for thunks */
ThunkSelector = AllocSelector( 0 );
entry.base = (unsigned long) malloc( 0x10000 );
entry.limit = 0xffff;
entry.seg_32bit = 0;
entry.limit_in_pages = 0;
entry.type = SEGMENT_CODE;
entry.read_only = 0;
memset( (char *)entry.base, 0, 0x10000 );
LDT_SetEntry( SELECTOR_TO_ENTRY(ThunkSelector), &entry );
HGLOBAL handle = GLOBAL_Alloc( GMEM_ZEROINIT, 0x10000, 0, TRUE, FALSE);
ThunkSelector = GlobalHandleToSel(handle);
}
thunks = (char *)PTR_SEG_OFF_TO_LIN( ThunkSelector, 0 );
......@@ -173,110 +104,9 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
WORD wParam, LONG lParam )
{
SpyMessage(hwnd, message, wParam, lParam);
if (HIWORD((LONG)func) == WINE_CODE_SELECTOR)
{
static struct dll_table_entry_s *user_tab = NULL;
void *address = (void *) ((LONG) func & 0xffff);
if (user_tab == NULL)
user_tab = FindDLLTable("USER");
/* DefWindowProc */
if (((LONG)user_tab[107].address &0xffff) == (LONG) address)
return DefWindowProc(hwnd, message, wParam, lParam);
/* DefDlgProc */
else if (((LONG)user_tab[308].address &0xffff) == (LONG)address)
return DefDlgProc(hwnd, message, wParam, lParam);
/* DefMDIChildProc */
else if (((LONG)user_tab[447].address &0xffff) == (LONG)address)
return DefMDIChildProc(hwnd, message, wParam, lParam);
/* default */
else
{
fprintf(stderr, "wine: Unknown wine callback %08x\n",
(unsigned int) func);
exit(1);
}
}
else if (IS_16_BIT_ADDRESS(func))
{
WORD ds = CURRENT_DS;
dprintf_callback(stddeb, "CallWindowProc // 16bit func=%08x ds=%04x!\n",
(unsigned int) func, ds );
PushOn16( CALLBACK_SIZE_WORD, hwnd );
PushOn16( CALLBACK_SIZE_WORD, message );
PushOn16( CALLBACK_SIZE_WORD, wParam );
PushOn16( CALLBACK_SIZE_LONG, lParam );
return CallTo16((unsigned int) func, ds );
}
else
{
dprintf_callback(stddeb, "CallWindowProc // 32bit func=%08X !\n",
(unsigned int) func);
return (*func)(hwnd, message, wParam, lParam);
}
return CallWndProc( (FARPROC)func, hwnd, message, wParam, lParam );
}
/**********************************************************************
* CallLineDDAProc
*/
void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam)
{
WORD ds = CURRENT_DS;
if (IS_16_BIT_ADDRESS(func))
{
PushOn16( CALLBACK_SIZE_WORD, xPos );
PushOn16( CALLBACK_SIZE_WORD, yPos );
PushOn16( CALLBACK_SIZE_LONG, lParam );
CallTo16((unsigned int) func, ds );
}
else
{
(*func)(xPos, yPos, lParam);
}
}
/**********************************************************************
* CallHookProc
*/
DWORD CallHookProc( HOOKPROC func, short code, WPARAM wParam, LPARAM lParam )
{
WORD ds = CURRENT_DS;
if (IS_16_BIT_ADDRESS(func))
{
PushOn16( CALLBACK_SIZE_WORD, code );
PushOn16( CALLBACK_SIZE_WORD, wParam );
PushOn16( CALLBACK_SIZE_LONG, lParam );
return CallTo16((unsigned int) func, ds );
}
else
{
return (*func)( code, wParam, lParam );
}
}
/**********************************************************************
* CallGrayStringProc
*/
BOOL CallGrayStringProc(FARPROC func, HDC hdc, LPARAM lParam, INT cch )
{
WORD ds = CURRENT_DS;
if (IS_16_BIT_ADDRESS(func))
{
PushOn16( CALLBACK_SIZE_WORD, hdc );
PushOn16( CALLBACK_SIZE_LONG, lParam );
PushOn16( CALLBACK_SIZE_WORD, cch );
return CallTo16((unsigned int) func, ds );
}
else
{
return (*func)( hdc, lParam, cch );
}
}
/* ------------------------------------------------------------------------ */
/*
......@@ -295,7 +125,7 @@ BOOL CallGrayStringProc(FARPROC func, HDC hdc, LPARAM lParam, INT cch )
struct special_buffer {
jmp_buf buffer;
long regs [6];
long regs [5];
char stack_part [STACK_DEPTH_16];
} *sb;
......@@ -303,8 +133,6 @@ int Catch (LPCATCHBUF cbuf)
{
WORD retval;
jmp_buf *tmp_jmp;
char *stack16 = (char *) (((unsigned int)IF1632_Saved16_ss << 16) +
IF1632_Saved16_sp);
sb = malloc (sizeof (struct special_buffer));
......@@ -313,8 +141,7 @@ int Catch (LPCATCHBUF cbuf)
sb -> regs [2] = IF1632_Saved16_ss & 0xffff;
sb -> regs [3] = IF1632_Saved32_esp;
sb -> regs [4] = IF1632_Saved32_ebp;
sb -> regs [5] = IF1632_Saved32_ss & 0xffff;
memcpy (sb -> stack_part, stack16, STACK_DEPTH_16);
memcpy (sb -> stack_part, CURRENT_STACK16, STACK_DEPTH_16);
tmp_jmp = &sb -> buffer;
*((struct special_buffer **)cbuf) = sb;
......@@ -325,11 +152,8 @@ int Catch (LPCATCHBUF cbuf)
IF1632_Saved16_ss = sb -> regs [2] & 0xffff;
IF1632_Saved32_esp = sb -> regs [3];
IF1632_Saved32_ebp = sb -> regs [4];
IF1632_Saved32_ss = sb -> regs [5] & 0xffff;
stack16 = (char *) (((unsigned int)IF1632_Saved16_ss << 16) +
IF1632_Saved16_sp);
memcpy (stack16, sb -> stack_part, STACK_DEPTH_16);
memcpy (CURRENT_STACK16, sb -> stack_part, STACK_DEPTH_16);
dprintf_catch (stddeb, "Been thrown here: %d, retval = %d\n",
(int) sb, (int) retval);
free ((void *) sb);
......
......@@ -16,7 +16,7 @@ length 163
#12 COFREEALLLIBRARIES
#13 COCREATEINSTANCE
#14 STRINGFROMIID
#15 CODISCONNECTOBJECT
15 pascal CoDisconnectObject(ptr long) CoDisconnectObject
#16 CORELEASEMARSHALDATA
#17 COFREEUNUSEDLIBRARIES
#18 ISEQUALGUID
......
......@@ -212,7 +212,7 @@ length 490
#310 pascal CREATESCALABLEFONTRESOURCE
#311 pascal GETFONTDATA
#312 pascal CONVERTOUTLINEFONTFILE
#313 pascal GETRASTERIZERCAPS
313 pascal16 GetRasterizerCaps(ptr word) GetRasterizerCaps
#314 pascal ENGINEEXTTEXTOUT
330 pascal16 EnumFontFamilies(word ptr segptr long) EnumFontFamilies
#332 pascal GETKERNINGPAIRS
......
......@@ -207,10 +207,10 @@ length 415
#318 FATALEXITHOOK
#319 FLUSHCACHEDFILEHANDLE
#320 ISTASK
323 pascal IsRomModule() IsRomModule
323 return IsRomModule 2 0
#324 LOGERROR
#325 LOGPARAMERROR
#326 ISROMFILE
326 return IsRomFile 2 0
#327 K327
#328 _DEBUGOUTPUT
#329 K329
......@@ -237,5 +237,5 @@ length 415
#354 GETAPPCOMPATFLAGS
#355 GETWINDEBUGINFO
#356 SETWINDEBUGINFO
#403 K403
#404 K404
403 pascal16 FarSetOwner(word word) FarSetOwner
404 pascal16 FarGetOwner(word) FarGetOwner
name olecli
id 20
length 43
## 954 is too large for now
##length 954
length 954
#1 WEP
#2 OLEDELETE
......
This diff is collapsed.
......@@ -3,11 +3,11 @@ id 12
length 83
50 pascal16 GlobalHandleToSel(word) GlobalHandleToSel
# 51 1 0318 GLOBALFIRST exported, shared data
# 52 1 0399 GLOBALNEXT exported, shared data
# 53 1 02a2 GLOBALINFO exported, shared data
# 54 1 0417 GLOBALENTRYHANDLE exported, shared data
# 55 1 04a9 GLOBALENTRYMODULE exported, shared data
51 pascal16 GlobalFirst(ptr word) GlobalFirst
52 pascal16 GlobalNext(ptr word) GlobalNext
53 pascal16 GlobalInfo(ptr) GlobalInfo
54 pascal16 GlobalEntryHandle(ptr word) GlobalEntryHandle
55 pascal16 GlobalEntryModule(ptr word word) GlobalEntryModule
56 pascal16 LocalInfo(ptr word) LocalInfo
57 pascal16 LocalFirst(ptr word) LocalFirst
58 pascal16 LocalNext(ptr) LocalNext
......@@ -24,7 +24,7 @@ length 83
69 pascal16 ClassFirst(ptr) ClassFirst
70 pascal16 ClassNext(ptr) ClassNext
71 pascal16 SystemHeapInfo(ptr) SystemHeapInfo
#72 pascal16 MemManInfo(ptr) MemManInfo
72 pascal16 MemManInfo(ptr) MemManInfo
# 73 1 1b72 NOTIFYREGISTER exported, shared data
# 74 1 1c29 NOTIFYUNREGISTER exported, shared data
# 75 1 2060 INTERRUPTREGISTER exported, shared data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment