Commit fa68b75b authored by Alexandre Julliard's avatar Alexandre Julliard

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
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.
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -392,36 +392,36 @@ length 540
482 pascal16 EnableScrollBar(word word word) EnableScrollBar
483 pascal SystemParametersInfo(word word ptr word) SystemParametersInfo
#484 __GP
#499 WNETERRORTEXT
#501 WNETOPENJOB
#502 WNETCLOSEJOB
#503 WNETABORTJOB
#504 WNETHOLDJOB
#505 WNETRELEASEJOB
#506 WNETCANCELJOB
#507 WNETSETJOBCOPIES
#508 WNETWATCHQUEUE
#509 WNETUNWATCHQUEUE
#510 WNETLOCKQUEUEDATA
#511 WNETUNLOCKQUEUEDATA
499 pascal WNetErrorText(word ptr word) WNetErrorText
501 pascal WNetOpenJob(ptr ptr word ptr) WNetOpenJob
502 pascal WNetCloseJob(word ptr ptr) WNetCloseJob
503 pascal WNetAbortJob(ptr word) WNetAbortJob
504 pascal WNetHoldJob(ptr word) WNetHoldJob
505 pascal WNetReleaseJob(ptr word) WNetReleaseJob
506 pascal WNetCancelJob(ptr word) WNetCancelJob
507 pascal WNetSetJobCopies(ptr word word) WNetSetJobCopies
508 pascal WNetWatchQueue(word ptr ptr word) WNetWatchQueue
509 pascal WNetUnwatchQueue(word ptr ptr word) WNetUnwatchQueue
510 pascal WNetLockQueueData(ptr ptr ptr) WNetLockQueueData
511 pascal WNetUnlockQueueData(ptr) WNetUnlockQueueData
512 pascal16 WNetGetConnection(ptr ptr ptr) WNetGetConnection
513 pascal WNetGetCaps(word) WNetGetCaps
#514 WNETDEVICEMODE
#515 WNETBROWSEDIALOG
514 pascal WNetDeviceMode(word) WNetDeviceMode
515 pascal WNetBrowseDialog(word word ptr) WNetBrowseDialog
516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser
517 pascal16 WNetAddConnection(ptr ptr ptr) WNetAddConnection
518 pascal16 WNetCancelConnection(ptr word) WNetCancelConnection
#519 WNETGETERROR
#520 WNETGETERRORTEXT
519 pascal WNetGetError(ptr) WNetGetError
520 pascal WNetGetErrorText(word ptr ptr) WNetGetErrorText
#521 WNETENABLE
#522 WNETDISABLE
#523 WNETRESTORECONNECTION
#524 WNETWRITEJOB
#525 WNETCONNECTDIALOG
#526 WNETDISCONNECTDIALOG
#527 WNETCONNECTIONDIALOG
#528 WNETVIEWQUEUEDIALOG
#529 WNETPROPERTYDIALOG
#530 WNETGETDIRECTORYTYPE
#531 WNETDIRECTORYNOTIFY
#532 WNETGETPROPERTYTEXT
523 pascal WNetRestoreConnection(word ptr) WNetRestoreConnection
524 pascal WNetWriteJob(word ptr ptr) WNetWriteJob
525 pascal WnetConnectDialog(word word) WNetConnectDialog
526 pascal WNetDisconnectDialog(word word) WNetDisconnectDialog
527 pascal WNetConnectionDialog(word word) WNetConnectionDialog
528 pascal WNetViewQueueDialog(word ptr) WNetViewQueueDialog
529 pascal WNetPropertyDialog(word word ptr word) WNetPropertyDialog
530 pascal WNetGetDirectoryType(ptr ptr) WNetGetDirectoryType
531 pascal WNetDirectoryNotify(word ptr word) WNetDirectoryNotify
532 pascal WNetGetPropertyText(word word word ptr word) WNetGetPropertyText
name winprocs
id 24
length 23
1 pascal ButtonWndProc(word word word long) ButtonWndProc
2 pascal StaticWndProc(word word word long) StaticWndProc
3 pascal ScrollBarWndProc(word word word long) ScrollBarWndProc
4 pascal ListBoxWndProc(word word word long) ListBoxWndProc
5 pascal ComboBoxWndProc(word word word long) ComboBoxWndProc
6 pascal EditWndProc(word word word long) EditWndProc
7 pascal PopupMenuWndProc(word word word long) PopupMenuWndProc
8 pascal DesktopWndProc(word word word long) DesktopWndProc
9 pascal DefDlgProc(word word word long) DefDlgProc
10 pascal MDIClientWndProc(word word word long) MDIClientWndProc
11 pascal DefWindowProc(word word word long) DefWindowProc
12 pascal DefMDIChildProc(word word word long) DefMDIChildProc
13 pascal SystemMessageBoxProc(word word word long) SystemMessageBoxProc
14 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
15 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
16 pascal ColorDlgProc(word word word long) ColorDlgProc
17 pascal FindTextDlgProc(word word word long) FindTextDlgProc
18 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc
19 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc
20 pascal PrintDlgProc(word word word long) PrintDlgProc
21 pascal AboutDlgProc(word word word long) AboutDlgProc
22 pascal AboutWine_Proc(word word word long) AboutWine_Proc
23 pascal16 CARET_Callback(word word word long) CARET_Callback
/* $Id$
*/
/*
* Copyright Robert J. Amstadt, 1993
* 16-bit mode callback functions
*
* Copyright 1995 Alexandre Julliard
*/
#ifndef CALLBACK_H
#define CALLBACK_H
#ifndef WINE_CALLBACK_H
#define WINE_CALLBACK_H
#include <stdlib.h>
#include <stdarg.h>
#define CALLBACK_SIZE_WORD 0
#define CALLBACK_SIZE_LONG 1
#include "stackframe.h"
#ifndef WINELIB
/* List of the 16-bit callback functions. This list is used */
/* by the build program to generate the file if1632/call16.S */
/* func ds parameters */
extern WORD CallTo16_word_wl ( FARPROC, WORD, WORD, LONG );
extern WORD CallTo16_word_ll ( FARPROC, WORD, LONG, LONG );
extern WORD CallTo16_word_wwl ( FARPROC, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_wlw ( FARPROC, WORD, WORD, LONG, WORD );
extern LONG CallTo16_long_wwl ( FARPROC, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_llwl ( FARPROC, WORD, LONG, LONG, WORD, LONG );
extern LONG CallTo16_long_wwwl ( FARPROC, WORD, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_wllwl( FARPROC, WORD, WORD, LONG, LONG, WORD, LONG );
extern WORD CallTo16_word_wwlll( FARPROC, WORD, WORD, WORD, LONG, LONG, LONG );
extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD ax, WORD bx,
WORD cx, WORD dx, WORD si, WORD di );
#define CallEnumChildProc( func, hwnd, lParam ) \
CallTo16_word_wl( func, CURRENT_DS, hwnd, lParam )
#define CallEnumFontFamProc( func, lpfont, lpmetric, type, lParam ) \
CallTo16_word_llwl( func, CURRENT_DS, lpfont, lpmetric, type, lParam )
#define CallEnumFontsProc( func, lpfont, lpmetric, type, lParam ) \
CallTo16_word_llwl( func, CURRENT_DS, lpfont, lpmetric, type, lParam )
#define CallEnumMetafileProc( func, hdc, lptable, lprecord, objs, lParam ) \
CallTo16_word_wllwl(func, CURRENT_DS, hdc, lptable, lprecord, objs, lParam)
#define CallEnumObjectsProc( func, lpobj, lParam ) \
CallTo16_word_ll( func, CURRENT_DS, lpobj, lParam )
#define CallEnumPropProc( func, hwnd, lpstr, data ) \
CallTo16_word_wlw( func, CURRENT_DS, hwnd, lpstr, data )
#define CallEnumTaskWndProc( func, hwnd, lParam ) \
CallTo16_word_wl( func, CURRENT_DS, hwnd, lParam )
#define CallEnumWindowsProc( func, hwnd, lParam ) \
CallTo16_word_wl( func, CURRENT_DS, hwnd, lParam )
#define CallLineDDAProc( func, xPos, yPos, lParam ) \
CallTo16_word_wwl( func, CURRENT_DS, xPos, yPos, lParam )
#define CallGrayStringProc( func, hdc, lParam, cch ) \
CallTo16_word_wlw( func, CURRENT_DS, hdc, lParam, cch )
#define CallHookProc( func, code, wParam, lParam ) \
CallTo16_long_wwl( func, CURRENT_DS, code, wParam, lParam )
#define CallTimeFuncProc( func, id, msg, dwUser, dw1, dw2 ) \
CallTo16_word_wwlll( func, CURRENT_DS, id, msg, dwUser, dw1, dw2 )
#define CallWndProc( func, hwnd, msg, wParam, lParam ) \
CallTo16_long_wwwl( func, CURRENT_DS, hwnd, msg, wParam, lParam )
#else /* WINELIB */
#define CallEnumChildProc( func, hwnd, lParam ) \
(*func)( hwnd, lParam )
#define CallEnumFontFamProc( func, lpfont, lpmetric, type, lParam ) \
(*func)( lpfont, lpmetric, type, lParam )
#define CallEnumFontsProc( func, lpfont, lpmetric, type, lParam ) \
(*func)( lpfont, lpmetric, type, lParam )
#define CallEnumMetafileProc( func, hdc, lptable, lprecord, objs, lParam ) \
(*func)( hdc, lptable, lprecord, objs, lParam)
#define CallEnumObjectsProc( func, lpobj, lParam ) \
(*func)( lpobj, lParam )
#define CallEnumPropProc( func, hwnd, lpstr, data ) \
(*func)( hwnd, lpstr, data )
#define CallEnumTaskWndProc( func, hwnd, lParam ) \
(*func)( hwnd, lParam )
#define CallEnumWindowsProc( func, hwnd, lParam ) \
(*func)( hwnd, lParam )
#define CallLineDDAProc( func, xPos, yPos, lParam ) \
(*func)( xPos, yPos, lParam )
#define CallGrayStringProc( func, hdc, lParam, cch ) \
(*func)( hdc, lParam, cch )
#define CallHookProc( func, code, wParam, lParam ) \
(*func)( code, wParam, lParam )
#define CallTimeFuncProc( func, id, msg, dwUser, dw1, dw2 ) \
(*func)( id, msg, dwUser, dw1, dw2 )
#define CallWndProc( func, hwnd, msg, wParam, lParam ) \
(*func)( hwnd, msg, wParam, lParam )
extern int CallTo16(unsigned int csip, unsigned short ds);
extern int CallBack16(void *func, int n_args, ...);
#endif /* WINELIB */
extern BOOL CallGrayStringProc(FARPROC func, HDC hdc, LPARAM lParam, INT cch);
#endif /* CALLBACK_H */
#endif /* WINE_CALLBACK_H */
/*
* compobj.h - Declarations for COMPOBJ
*/
typedef LPVOID LPUNKNOWN;
......@@ -69,7 +69,6 @@
#undef DEBUG_SCROLL
#undef DEBUG_SELECTOR
#undef DEBUG_SELECTORS
#undef DEBUG_STACK
#undef DEBUG_STRESS
#undef DEBUG_SYSCOLOR
#undef DEBUG_TASK
......@@ -145,7 +144,6 @@
#define DEBUG_SCROLL
#define DEBUG_SELECTOR
#define DEBUG_SELECTORS
#define DEBUG_STACK
#define DEBUG_STRESS
#define DEBUG_SYSCOLOR
#define DEBUG_TASK
......@@ -475,11 +473,6 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_STACK
1,
#else
0,
#endif
#ifdef DEBUG_STRESS
1,
#else
......@@ -1352,21 +1345,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_stack if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_stack debug_msg_enabled[63]
#else
#ifdef DEBUG_STACK
#define dprintf_stack fprintf
#define debugging_stack 1
#else
#define dprintf_stack while(0) fprintf
#define debugging_stack 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_stress if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_stress debug_msg_enabled[64]
#define dprintf_stress if(!debug_msg_enabled[63]) ; else fprintf
#define debugging_stress debug_msg_enabled[63]
#else
#ifdef DEBUG_STRESS
#define dprintf_stress fprintf
......@@ -1378,8 +1358,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_syscolor if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_syscolor debug_msg_enabled[65]
#define dprintf_syscolor if(!debug_msg_enabled[64]) ; else fprintf
#define debugging_syscolor debug_msg_enabled[64]
#else
#ifdef DEBUG_SYSCOLOR
#define dprintf_syscolor fprintf
......@@ -1391,8 +1371,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_task if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_task debug_msg_enabled[66]
#define dprintf_task if(!debug_msg_enabled[65]) ; else fprintf
#define debugging_task debug_msg_enabled[65]
#else
#ifdef DEBUG_TASK
#define dprintf_task fprintf
......@@ -1404,8 +1384,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_text if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_text debug_msg_enabled[67]
#define dprintf_text if(!debug_msg_enabled[66]) ; else fprintf
#define debugging_text debug_msg_enabled[66]
#else
#ifdef DEBUG_TEXT
#define dprintf_text fprintf
......@@ -1417,8 +1397,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_timer if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_timer debug_msg_enabled[68]
#define dprintf_timer if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_timer debug_msg_enabled[67]
#else
#ifdef DEBUG_TIMER
#define dprintf_timer fprintf
......@@ -1430,8 +1410,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_toolhelp if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[69]
#define dprintf_toolhelp if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[68]
#else
#ifdef DEBUG_TOOLHELP
#define dprintf_toolhelp fprintf
......@@ -1443,8 +1423,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_utility if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_utility debug_msg_enabled[70]
#define dprintf_utility if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_utility debug_msg_enabled[69]
#else
#ifdef DEBUG_UTILITY
#define dprintf_utility fprintf
......@@ -1456,8 +1436,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_win debug_msg_enabled[71]
#define dprintf_win if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_win debug_msg_enabled[70]
#else
#ifdef DEBUG_WIN
#define dprintf_win fprintf
......@@ -1469,8 +1449,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_winsock if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_winsock debug_msg_enabled[72]
#define dprintf_winsock if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_winsock debug_msg_enabled[71]
#else
#ifdef DEBUG_WINSOCK
#define dprintf_winsock fprintf
......@@ -1548,7 +1528,6 @@ static char *debug_msg_name[] = {
"scroll",
"selector",
"selectors",
"stack",
"stress",
"syscolor",
"task",
......
......@@ -7,6 +7,8 @@
#ifndef DLLS_H
#define DLLS_H
#include "wintypes.h"
#define MAX_NAME_LENGTH 64
typedef struct resource_name_table
......@@ -54,119 +56,67 @@ extern struct w_files *wine_files;
#define DLL 0
#define EXE 1
#define DLL_ARGTYPE_SIGNEDWORD 0
#define DLL_ARGTYPE_WORD 1
#define DLL_ARGTYPE_LONG 2
#define DLL_ARGTYPE_FARPTR 3
#define DLL_MAX_ARGS 16
#define DLL_HANDLERTYPE_PASCAL 16
struct dll_table_entry_s
{
/*
* Relocation data
*/
unsigned int selector; /* Selector to access this entry point */
void *address; /* Offset in segment of entry point */
WORD selector; /* Selector of entry point */
WORD offset; /* Offset in segment of entry point */
/*
* 16->32 bit interface data
*/
char *export_name;
void *handler; /* Address of function to process request */
char n_args; /* Number of arguments passed to function */
short conv_reference ; /* reference to Argument conversion data */
#ifdef WINESTAT
int used; /* Number of times this function referenced */
#endif
};
struct dll_name_table_entry_s
struct dll_table_s
{
char *dll_name;
struct dll_table_entry_s *dll_table;
int dll_table_length;
int dll_number;
void *code_start; /* 32-bit address of DLL code */
void *code_end;
void *data_start; /* 32-bit address of DLL data */
void *data_end;
};
struct dll_name_table_entry_s
{
char *dll_name;
struct dll_table_s *table;
int dll_is_used; /* use MS provided if set to zero */
};
extern struct dll_table_entry_s KERNEL_table[];
extern struct dll_table_entry_s USER_table[];
extern struct dll_table_entry_s GDI_table[];
extern struct dll_table_entry_s WIN87EM_table[];
extern struct dll_table_entry_s MMSYSTEM_table[];
extern struct dll_table_entry_s SHELL_table[];
extern struct dll_table_entry_s SOUND_table[];
extern struct dll_table_entry_s KEYBOARD_table[];
extern struct dll_table_entry_s WINSOCK_table[];
extern struct dll_table_entry_s STRESS_table[];
extern struct dll_table_entry_s SYSTEM_table[];
extern struct dll_table_entry_s TOOLHELP_table[];
extern struct dll_table_entry_s MOUSE_table[];
extern struct dll_table_entry_s COMMDLG_table[];
extern struct dll_table_entry_s OLE2_table[];
extern struct dll_table_entry_s OLE2CONV_table[];
extern struct dll_table_entry_s OLE2DISP_table[];
extern struct dll_table_entry_s OLE2NLS_table[];
extern struct dll_table_entry_s OLE2PROX_table[];
extern struct dll_table_entry_s OLECLI_table[];
extern struct dll_table_entry_s OLESVR_table[];
extern struct dll_table_entry_s COMPOBJ_table[];
extern struct dll_table_entry_s STORAGE_table[];
extern unsigned short KERNEL_offsets[];
extern unsigned short USER_offsets[];
extern unsigned short GDI_offsets[];
extern unsigned short WIN87EM_offsets[];
extern unsigned short MMSYSTEM_offsets[];
extern unsigned short SHELL_offsets[];
extern unsigned short SOUND_offsets[];
extern unsigned short KEYBOARD_offsets[];
extern unsigned short WINSOCK_offsets[];
extern unsigned short STRESS_offsets[];
extern unsigned short SYSTEM_offsets[];
extern unsigned short TOOLHELP_offsets[];
extern unsigned short MOUSE_offsets[];
extern unsigned short COMMDLG_offsets[];
extern unsigned short OLE2_offsets[];
extern unsigned short OLE2CONV_offsets[];
extern unsigned short OLE2DISP_offsets[];
extern unsigned short OLE2NLS_offsets[];
extern unsigned short OLE2PROX_offsets[];
extern unsigned short OLECLI_offsets[];
extern unsigned short OLESVR_offsets[];
extern unsigned short COMPOBJ_offsets[];
extern unsigned short STORAGE_offsets[];
extern unsigned char KERNEL_types[];
extern unsigned char USER_types[];
extern unsigned char GDI_types[];
extern unsigned char WIN87EM_types[];
extern unsigned char MMSYSTEM_types[];
extern unsigned char SHELL_types[];
extern unsigned char SOUND_types[];
extern unsigned char KEYBOARD_types[];
extern unsigned char WINSOCK_types[];
extern unsigned char STRESS_types[];
extern unsigned char SYSTEM_types[];
extern unsigned char TOOLHELP_types[];
extern unsigned char MOUSE_types[];
extern unsigned char COMMDLG_types[];
extern unsigned char OLE2_types[];
extern unsigned char OLE2CONV_types[];
extern unsigned char OLE2DISP_types[];
extern unsigned char OLE2NLS_types[];
extern unsigned char OLE2PROX_types[];
extern unsigned char OLECLI_types[];
extern unsigned char OLESVR_types[];
extern unsigned char COMPOBJ_types[];
extern unsigned char STORAGE_types[];
#define N_BUILTINS 23
extern struct dll_table_s KERNEL_table;
extern struct dll_table_s USER_table;
extern struct dll_table_s GDI_table;
extern struct dll_table_s WIN87EM_table;
extern struct dll_table_s MMSYSTEM_table;
extern struct dll_table_s SHELL_table;
extern struct dll_table_s SOUND_table;
extern struct dll_table_s KEYBOARD_table;
extern struct dll_table_s WINSOCK_table;
extern struct dll_table_s STRESS_table;
extern struct dll_table_s SYSTEM_table;
extern struct dll_table_s TOOLHELP_table;
extern struct dll_table_s MOUSE_table;
extern struct dll_table_s COMMDLG_table;
extern struct dll_table_s OLE2_table;
extern struct dll_table_s OLE2CONV_table;
extern struct dll_table_s OLE2DISP_table;
extern struct dll_table_s OLE2NLS_table;
extern struct dll_table_s OLE2PROX_table;
extern struct dll_table_s OLECLI_table;
extern struct dll_table_s OLESVR_table;
extern struct dll_table_s COMPOBJ_table;
extern struct dll_table_s STORAGE_table;
extern struct dll_table_s WINPROCS_table;
#define N_BUILTINS 24
#endif /* DLLS_H */
......
/*
* Global heap declarations
*
* Copyright 1995 Alexandre Julliard
*/
#ifndef __WINE_GLOBAL_H
#define __WINE_GLOBAL_H
#include "wintypes.h"
extern HGLOBAL GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL hOwner,
BOOL isCode, BOOL isReadOnly );
extern WORD GlobalHandleToSel( HGLOBAL handle );
#endif /* __WINE_GLOBAL_H */
......@@ -9,6 +9,7 @@
#include "windows.h"
#include "ldt.h"
#include "callback.h"
/* Hook data (pointed to by a HHOOK) */
typedef struct
......@@ -34,9 +35,6 @@ typedef struct
#define CALL_TASK_HOOK(id,code,wparam,lparam) \
INTERNAL_CALL_HOOK(TASK_HOOK(id),code,wparam,lparam)
extern DWORD CallHookProc( HOOKPROC func, short code,
WPARAM wParam, LPARAM lParam ); /* callback.c */
extern HHOOK systemHooks[];
extern HHOOK taskHooks[];
......
......@@ -7,12 +7,11 @@ extern int CallToInit16(unsigned long csip, unsigned long sssp,
unsigned short ds);
extern int CallTo16cx(unsigned long csip, unsigned long dscx);
extern int CallToDllEntry(unsigned long csip, unsigned long dscx, unsigned short di);
extern int CallBack16(void *func, int n_args, ...);
extern void CallLineDDAProc(FARPROC func, short xPos, short yPos, long lParam);
extern void winestat(void);
extern int DLLRelay(unsigned int func_num, unsigned int seg_off);
extern struct dll_table_entry_s *FindDLLTable(char *dll_name);
extern struct dll_table_s *FindDLLTable(char *dll_name);
extern int FindOrdinalFromName(struct dll_table_entry_s *dll_table, char *func_name);
extern int ReturnArg(int arg);
extern BOOL RELAY_Init(void);
#endif /* __WINE_IF1632_H */
......@@ -8,7 +8,7 @@ typedef struct tagLISTSTRUCT {
HANDLE hMem;
HANDLE hData;
char *itemText;
void *lpNext;
struct tagLISTSTRUCT *lpNext;
} LISTSTRUCT;
typedef LISTSTRUCT FAR* LPLISTSTRUCT;
......@@ -21,15 +21,17 @@ typedef struct tagHEADLIST {
short ItemsPerColumn;
short ItemFocused;
short PrevFocused;
short SelCount;
short StdItemHeight;
short ColumnsWidth;
short DrawCtlType;
void *lpFirst;
void *lpFirst;
DWORD dwStyle;
HWND hWndLogicParent;
HFONT hFont;
BOOL bRedrawFlag;
WORD iNumStops;
LPINT TabStops;
HANDLE hDrawItemStruct;
/* MDESC *Heap; */
} HEADLIST;
typedef HEADLIST FAR* LPHEADLIST;
......
......@@ -4,8 +4,8 @@
* Copyright 1995 Alexandre Julliard
*/
#ifndef __WINE_HEAP_H
#define __WINE_HEAP_H
#ifndef __WINE_LOCAL_H
#define __WINE_LOCAL_H
#include "wintypes.h"
......@@ -21,4 +21,4 @@ extern WORD LOCAL_Size( WORD ds, HLOCAL handle );
extern WORD LOCAL_Flags( WORD ds, HLOCAL handle );
extern WORD LOCAL_HeapSize( WORD ds );
#endif /* __WINE_HEAP_H */
#endif /* __WINE_LOCAL_H */
......@@ -30,7 +30,7 @@ struct fcb {
BYTE dummy2[9];
};
#define DOSVERSION 0x0500; /* Might as well pretend we're DOS 5.0 */
#define DOSVERSION 0x0005; /* Major version in low byte: DOS 5.00 */
#define MAX_DOS_DRIVES 26
extern WORD ExtendedError;
......
......@@ -12,18 +12,19 @@
*/
struct mz_header_s
{
u_char dont_care1[0x18]; /* MZ Header stuff */
u_char must_be_0x40; /* 0x40 for non-MZ program */
u_char dont_care2[0x23]; /* More MZ header stuff */
u_short ne_offset; /* Offset to extended header */
u_short mz_magic; /* MZ Header signature */
u_char dont_care[0x3a]; /* MZ Header stuff */
u_short ne_offset; /* Offset to extended header */
};
#define MZ_SIGNATURE ('M' | ('Z' << 8))
/*
* This is the Windows executable (NE) header.
*/
struct ne_header_s
{
char header_type[2]; /* Must contain 'N' 'E' */
u_short ne_magic; /* NE signature 'NE' */
u_char linker_version; /* Linker version number */
u_char linker_revision; /* Linker revision number */
u_short entry_tab_offset; /* Offset to entry table relative to NE */
......@@ -57,6 +58,9 @@ struct ne_header_s
u_short expect_version; /* Expected Windows version number */
};
#define NE_SIGNATURE ('N' | ('E' << 8))
#define PE_SIGNATURE ('P' | ('E' << 8))
/*
* NE Header FORMAT FLAGS
*/
......
......@@ -5,6 +5,8 @@
#ifndef PROCEMU
#include "wine.h"
#define EAX context->sc_eax
#define EBX context->sc_ebx
#define ECX context->sc_ecx
......
......@@ -20,12 +20,14 @@ extern WORD SELECTOR_ReallocBlock( WORD sel, void *base, DWORD size,
extern WORD *CreateSelectors( struct w_files * wpnt );
extern unsigned int GetEntryDLLName(char *dll_name, char *function, WORD *sel,
int *addr);
extern unsigned int GetEntryDLLOrdinal(char *dll_name, int ordinal, WORD *sel,
int *addr);
extern unsigned int GetEntryPointFromOrdinal(struct w_files * wpnt,
int ordinal);
extern unsigned int GetEntryDLLName(char *dll_name, char *function,
WORD *sel, WORD *offset);
extern unsigned int GetEntryDLLOrdinal(char *dll_name, int ordinal,
WORD *sel, WORD *offset);
extern unsigned int GetEntryPointFromOrdinal(struct w_files * wpnt,
int ordinal);
extern void InitSelectors(void);
extern WNDPROC GetWndProcEntry16( char *name );
#endif /* __WINE_SELECTORS_H */
......@@ -10,19 +10,29 @@
#include <windows.h>
#include "ldt.h"
#ifndef WINELIB
#pragma pack(1)
#endif
typedef struct
{
WORD saved_ss;
WORD saved_ss; /* saved previous 16-bit stack */
WORD saved_bp;
WORD saved_sp;
WORD ds;
WORD bp;
WORD arg_length;
WORD ip;
WORD ds; /* 16-bit ds */
DWORD entry_point WINE_PACKED; /* entry point to call */
WORD ordinal_number; /* ordinal number of entry point */
WORD dll_id; /* DLL id of entry point */
WORD bp; /* 16-bit bp */
WORD ip; /* return address */
WORD cs;
WORD args[1];
WORD args[1]; /* arguments to API function */
} STACK16FRAME;
#ifndef WINELIB
#pragma pack(4)
#endif
extern WORD IF1632_Saved16_ss;
extern WORD IF1632_Saved16_sp;
extern WORD IF1632_Saved16_bp;
......
......@@ -139,7 +139,6 @@
#undef DEBUG_SCROLL
#undef DEBUG_SELECTOR
#undef DEBUG_SELECTORS
#undef DEBUG_STACK
#undef DEBUG_STRESS
#undef DEBUG_SYSCOLOR
#undef DEBUG_TASK
......@@ -215,7 +214,6 @@
#define DEBUG_SCROLL
#define DEBUG_SELECTOR
#define DEBUG_SELECTORS
#define DEBUG_STACK
#define DEBUG_STRESS
#define DEBUG_SYSCOLOR
#define DEBUG_TASK
......
......@@ -10,8 +10,76 @@
/* Global heap */
WORD GlobalHandleToSel( HANDLE handle );
typedef struct
{
DWORD dwSize;
WORD wcItems;
WORD wcItemsFree;
WORD wcItemsLRU;
} GLOBALINFO;
typedef struct
{
DWORD dwSize;
DWORD dwAddress;
DWORD dwBlockSize;
HGLOBAL hBlock;
WORD wcLock;
WORD wcPageLock;
WORD wFlags;
BOOL wHeapPresent;
HGLOBAL hOwner;
WORD wType;
WORD wData;
DWORD dwNext;
DWORD dwNextAlt;
} GLOBALENTRY;
/* GlobalFirst()/GlobalNext() flags */
#define GLOBAL_ALL 0
#define GLOBAL_LRU 1
#define GLOBAL_FREE 2
/* wType values */
#define GT_UNKNOWN 0
#define GT_DGROUP 1
#define GT_DATA 2
#define GT_CODE 3
#define GT_TASK 4
#define GT_RESOURCE 5
#define GT_MODULE 6
#define GT_FREE 7
#define GT_INTERNAL 8
#define GT_SENTINEL 9
#define GT_BURGERMASTER 10
/* wData values */
#define GD_USERDEFINED 0
#define GD_CURSORCOMPONENT 1
#define GD_BITMAP 2
#define GD_ICONCOMPONENT 3
#define GD_MENU 4
#define GD_DIALOG 5
#define GD_STRING 6
#define GD_FONTDIR 7
#define GD_FONT 8
#define GD_ACCELERATORS 9
#define GD_RCDATA 10
#define GD_ERRTABLE 11
#define GD_CURSOR 12
#define GD_ICON 14
#define GD_NAMETABLE 15
#define GD_MAX_RESOURCE 15
/* wFlags values */
#define GF_PDB_OWNER 0x0100 /* Low byte is KERNEL flags */
BOOL GlobalInfo( GLOBALINFO *pInfo );
BOOL GlobalFirst( GLOBALENTRY *pGlobal, WORD wFlags );
BOOL GlobalNext( GLOBALENTRY *pGlobal, WORD wFlags) ;
BOOL GlobalEntryHandle( GLOBALENTRY *pGlobal, HGLOBAL hItem );
BOOL GlobalEntryModule( GLOBALENTRY *pGlobal, HMODULE hModule, WORD wSeg );
WORD GlobalHandleToSel( HGLOBAL handle );
/* Local heap */
......
......@@ -680,6 +680,17 @@ typedef struct tagTEXTMETRIC
#define ETO_OPAQUE 0x02
#define ETO_CLIPPED 0x04
/* Rasterizer status */
typedef struct
{
WORD nSize;
WORD wFlags;
WORD nLanguageID;
} RASTERIZER_STATUS, *LPRASTERIZER_STATUS;
#define TT_AVAILABLE 0x0001
#define TT_ENABLED 0x0002
typedef struct tagPALETTEENTRY
{
BYTE peRed, peGreen, peBlue, peFlags;
......@@ -2469,8 +2480,8 @@ Fa(LPSTR,AnsiLower,LPSTR,a)
Fa(SEGPTR,AnsiNext,SEGPTR,a)
Fa(LPSTR,AnsiUpper,LPSTR,a)
Fa(LPSTR,GlobalLock,HGLOBAL,a)
Fa(LPSTR,GlobalWire,HGLOBAL,a)
Fa(LPSTR,LockResource,HANDLE,a)
Fa(SEGPTR,GlobalWire,HGLOBAL,a)
Fa(SEGPTR,WIN16_GlobalLock,HGLOBAL,a)
Fa(UINT,GDIRealizePalette,HDC,a)
Fa(UINT,RealizePalette,HDC,a)
......
#ifndef WINE_H
#define WINE_H
#if 0
#define __ELF__
#endif
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
......@@ -36,12 +33,8 @@ struct sigcontext_struct {
unsigned long cr2;
};
#define WINE_DATA_SELECTOR 0x2b
#ifdef __ELF__
#define WINE_CODE_SELECTOR 0x0f
#else
#define WINE_CODE_SELECTOR 0x23
#endif
#endif
#endif /* linux */
#if defined(__NetBSD__) || defined(__FreeBSD__)
#include <signal.h>
......
......@@ -25,8 +25,8 @@ void
PrintFileHeader(struct ne_header_s *ne_header)
{
printf("ne_header: %c%c\n",
ne_header->header_type[0],
ne_header->header_type[1]);
ne_header->ne_magic & 0xff,
ne_header->ne_magic >> 8 );
printf("linker version: %d.%d\n", ne_header->linker_version,
ne_header->linker_revision);
printf("format flags: %04x\n", ne_header->format_flags);
......
......@@ -381,6 +381,8 @@ HANDLE LoadLibrary(LPSTR libname)
{
HANDLE h;
dprintf_module(stddeb,"LoadLibrary: (%08x) %s\n",(int)libname,libname);
if ((h = LoadImage(libname, DLL, 0)) < 32)
return h;
......@@ -435,8 +437,8 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
#ifdef WINELIB
WINELIB_UNIMP ("GetProcAddress");
#else
int addr, ret;
WORD sel;
int ret;
WORD sel, addr;
register struct w_files *w = wine_files;
int ordinal, len;
char * cpnt;
......@@ -541,9 +543,9 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
static void
FillModStructBuiltIn(MODULEENTRY *lpModule, struct dll_name_table_entry_s *dll)
{
lpModule->dwSize = dll->dll_table_length * 1024;
lpModule->dwSize = dll->table->dll_table_length * 1024;
strcpy(lpModule->szModule, dll->dll_name);
lpModule->hModule = 0xff00 + dll->dll_number;
lpModule->hModule = 0xff00 + dll->table->dll_number;
lpModule->wcUsage = GetModuleUsage(lpModule->hModule);
GetModuleFileName(lpModule->hModule, lpModule->szExePath, MAX_PATH + 1);
lpModule->wNext = 0;
......
......@@ -18,6 +18,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "library.h"
#include "if1632.h"
#include "selectors.h"
#include "callback.h"
#include "ne_image.h"
#include "prototypes.h"
#include "stddebug.h"
......@@ -146,7 +147,7 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
ordinal = rep->target2;
status = GetEntryDLLOrdinal(dll_name, ordinal, &selector,
&address);
&offset);
if (status)
{
char s[80];
......@@ -157,7 +158,7 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
}
dprintf_fixup(stddeb,"%d: %s.%d: %04x:%04x\n", i + 1,
dll_name, ordinal, selector, address);
dll_name, ordinal, selector, offset);
break;
case NE_RELTYPE_NAME:
......@@ -172,7 +173,7 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
}
status = GetEntryDLLName(dll_name, func_name, &selector,
&address);
&offset);
if (status)
{
char s[80];
......@@ -181,8 +182,8 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
myerror(s);
return -1;
}
/* dprintf_fixup(stddeb,"%d: %s %s.%d: %04x:%04x\n", i + 1,
func_name, dll_name, ordinal, selector, address);*/
dprintf_fixup(stddeb,"%d: %s %s.%d: %04x:%04x\n", i + 1,
func_name, dll_name, ordinal, selector, offset);
break;
case NE_RELTYPE_INTERNAL:
......@@ -190,16 +191,16 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
{
address = GetEntryPointFromOrdinal(wpnt, rep->target2);
selector = (address >> 16) & 0xffff;
address &= 0xffff;
offset = address & 0xffff;
}
else
{
selector = selector_table[rep->target1-1];
address = rep->target2;
offset = rep->target2;
}
dprintf_fixup(stddeb,"%d: %04x:%04x\n",
i + 1, selector, address);
i + 1, selector, offset);
break;
case NE_RELTYPE_OSFIXUP:
......@@ -240,7 +241,8 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
i+1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2);
offset = rep->offset;
address = (unsigned int)offset;
offset = rep->offset;
switch (rep->address_type)
{
......@@ -290,8 +292,9 @@ int NE_FixupSegment(struct w_files *wpnt, int segment_num)
sel, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = (unsigned short) selector;
if(additive)
fprintf(stderr,"Additive selector, please report\n");
/* Borland creates additive records with offset zero. Strange, but OK */
if(additive && offset)
fprintf(stderr,"Additive selector to %4.4x.Please report\n",offset);
}
while (offset != 0xffff && !additive);
break;
......@@ -321,20 +324,39 @@ int NE_unloadImage(struct w_files *wpnt)
int NE_StartProgram(struct w_files *wpnt)
{
int cs_reg, ds_reg, ss_reg, ip_reg, sp_reg;
extern WORD PSPSelector;
int cs_reg, ds_reg, ip_reg;
/* Registers at initialization must be:
* ax zero
* bx stack size in bytes
* cx heap size in bytes
* si previous app instance
* di current app instance
* bp zero
* es selector to the PSP
* ds dgroup of the application
* ss stack selector
* sp top of the stack
*/
/*
* Fixup stack and jump to start.
*/
WIN_StackSize = wpnt->ne->ne_header->stack_length;
WIN_HeapSize = wpnt->ne->ne_header->local_heap_length;
ds_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->auto_data_seg-1];
cs_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->cs-1];
ip_reg = wpnt->ne->ne_header->ip;
ss_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->ss-1];
sp_reg = wpnt->ne->ne_header->sp;
ds_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->auto_data_seg-1];
return CallToInit16(cs_reg << 16 | ip_reg, ss_reg << 16 | sp_reg, ds_reg);
IF1632_Saved16_ss = wpnt->ne->selector_table[wpnt->ne->ne_header->ss-1];
IF1632_Saved16_sp = wpnt->ne->ne_header->sp;
IF1632_Saved16_bp = 0;
return CallTo16_regs_( (FARPROC)(cs_reg << 16 | ip_reg), ds_reg,
PSPSelector /*es*/, 0 /*ax*/, WIN_StackSize /*bx*/,
WIN_HeapSize, 0 /*dx*/, 0 /*si*/, ds_reg /*di*/ );
}
void NE_InitDLL(struct w_files *wpnt)
......@@ -363,7 +385,9 @@ void NE_InitDLL(struct w_files *wpnt)
cx_reg = wpnt->ne->ne_header->local_heap_length;
}
cs_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->cs-1];
dprintf_dll(stddeb,"InitDLL: ne_header->cs = %04x\n",wpnt->ne->ne_header->cs);
if (!wpnt->ne->ne_header->cs) cs_reg = 0;
else cs_reg = wpnt->ne->selector_table[wpnt->ne->ne_header->cs-1];
ip_reg = wpnt->ne->ne_header->ip;
di_reg = wpnt->hinstance;
......@@ -372,7 +396,9 @@ void NE_InitDLL(struct w_files *wpnt)
dprintf_dll(stddeb,"Initializing %s, cs:ip %04x:%04x, ds %04x, cx %04x\n",
wpnt->name, cs_reg, ip_reg, ds_reg, cx_reg);
rv = CallTo16cx(cs_reg << 16 | ip_reg, ds_reg | (cx_reg<<16));
rv = CallTo16_regs_( (FARPROC)(cs_reg << 16 | ip_reg), ds_reg,
0 /*es*/, 0 /*ax*/, 0 /*bx*/, cx_reg,
0 /*dx*/, 0 /*si*/, di_reg );
dprintf_exec(stddeb,"rv = %x\n", rv);
} else
dprintf_exec(stddeb,"%s skipped\n", wpnt->name);
......
......@@ -623,8 +623,7 @@ int TranslateAccelerator(HWND hWnd, HANDLE hAccel, LPMSG msg)
int
LoadString(HANDLE instance, WORD resource_id, LPSTR buffer, int buflen)
{
HANDLE hmem;
int rsc_size;
HANDLE hmem, hrsrc;
unsigned char *p;
int string_num;
int i;
......@@ -632,10 +631,11 @@ LoadString(HANDLE instance, WORD resource_id, LPSTR buffer, int buflen)
dprintf_resource(stddeb, "LoadString: instance = %04x, id = %d, buffer = %08x, "
"length = %d\n", instance, resource_id, (int) buffer, buflen);
hmem = RSC_LoadResource(instance, (SEGPTR)((resource_id >> 4) + 1),
(SEGPTR) NE_RSCTYPE_STRING, &rsc_size );
if (hmem == 0)
return 0;
hrsrc = FindResource( instance, (SEGPTR)((resource_id >> 4) + 1),
(SEGPTR) NE_RSCTYPE_STRING );
if (!hrsrc) return 0;
hmem = LoadResource( instance, hrsrc );
if (!hmem) return 0;
p = GlobalLock(hmem);
string_num = resource_id & 0x000f;
......@@ -655,7 +655,7 @@ LoadString(HANDLE instance, WORD resource_id, LPSTR buffer, int buflen)
fprintf(stderr,"LoadString // I dont know why , but caller give buflen=%d *p=%d !\n", buflen, *p);
fprintf(stderr,"LoadString // and try to obtain string '%s'\n", p + 1);
}
GlobalFree(hmem);
FreeResource( hrsrc );
dprintf_resource(stddeb,"LoadString // '%s' copied !\n", buffer);
return i;
......
......@@ -287,38 +287,4 @@ void init_wine_signals(void)
#endif
}
static sigjmp_buf segv_jmpbuf;
static void
segv_handler()
{
siglongjmp(segv_jmpbuf, 1);
}
int
test_memory( char *p, int write )
{
int ret = FALSE;
struct sigaction new_act;
struct sigaction old_act;
memset(&new_act, 0, sizeof new_act);
new_act.sa_handler = segv_handler;
if (sigsetjmp( segv_jmpbuf, 1 ) == 0) {
char c = 100;
if (sigaction(SIGSEGV, &new_act, &old_act) < 0)
perror("sigaction");
c = *p;
if (write)
*p = c;
ret = TRUE;
}
#ifdef linux
wine_sigaction(SIGSEGV, &old_act, NULL);
#else
sigaction(SIGSEGV, &old_act, NULL);
#endif
return ret;
}
#endif /* ifndef WINELIB */
......@@ -9,7 +9,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <sys/types.h>
#include <unistd.h>
#include "windows.h"
#include "if1632.h"
#include "callback.h"
#include "task.h"
#include "stddebug.h"
#include "debug.h"
......@@ -102,11 +102,7 @@ BOOL EnumTaskWindows(HANDLE hTask, FARPROC lpEnumFunc, LONG lParam)
while ((hWnd = *(wptr++)) != 0) {
if (++count >= MAXWIN_PER_TASK) return FALSE;
dprintf_task(stddeb,"EnumTaskWindows // hWnd=%04X count=%d !\n", hWnd, count);
#ifdef WINELIB
bRet = (*lpEnumFunc)(hWnd, lParam);
#else
bRet = CallBack16(lpEnumFunc, 2, 0, (int)hWnd, 2, (int)lParam);
#endif
bRet = CallEnumTaskWndProc( lpEnumFunc, hWnd, lParam );
if (bRet == 0) break;
}
return TRUE;
......
......@@ -285,11 +285,19 @@ HLOCAL LocalInit( WORD selector, WORD start, WORD end )
/* - large free block (FREE) */
/* - last arena (FREE) */
/* FIXME: What should be done if there's already */
/* a local heap in this segment? */
dprintf_local(stddeb, "LocalInit: %04x %04x-%04x\n", selector, start, end);
if (!selector) selector = CURRENT_DS;
ptr = PTR_SEG_OFF_TO_LIN( selector, 0 );
pHeapInfo = LOCAL_GetHeap(selector);
/* If there's already a local heap in this segment, */
/* we simply return TRUE. Helps some programs, but */
/* does not seem to be 100% correct yet (there are */
/* still some "heap corrupted" messages in LocalAlloc */
if (pHeapInfo) {
dprintf_local(stddeb,"LocalInit: Heap %04x initialized twice.\n",selector);
if (debugging_local) LOCAL_PrintHeap(selector);
return TRUE;
}
start = LALIGN( max( start, sizeof(INSTANCEDATA) ) );
heapInfoArena = LALIGN(start + sizeof(LOCALARENA) );
freeArena = LALIGN( heapInfoArena + ARENA_HEADER_SIZE
......@@ -368,14 +376,20 @@ HLOCAL LOCAL_Alloc( WORD ds, WORD flags, WORD size )
/* Find a suitable free block */
if (!(pInfo = LOCAL_GetHeap( ds ))) return 0;
if (!(pInfo = LOCAL_GetHeap( ds ))) {
LOCAL_PrintHeap(ds);
return 0;
}
size += ARENA_HEADER_SIZE;
size = LALIGN( max( size, sizeof(LOCALARENA) ) );
arena = pInfo->first;
pArena = ARENA_PTR( ptr, arena );
for (;;)
{
if (arena == pArena->free_next) return 0; /* not found */
if (arena == pArena->free_next) {
LOCAL_PrintHeap(ds);
return 0; /* not found */
}
arena = pArena->free_next;
pArena = ARENA_PTR( ptr, arena );
if (pArena->size >= size) break;
......@@ -635,6 +649,7 @@ WORD LocalShrink( HLOCAL handle, WORD newsize )
*/
DWORD GetHeapSpaces( HMODULE module )
{
return MAKELONG( 0x7fff, 0xffff );
}
......
......@@ -4,22 +4,16 @@
* Copyright 1995 Alexandre Julliard
*/
#include <string.h>
#include "windows.h"
#include "ldt.h"
#include "selectors.h"
#include "stddebug.h"
#include "debug.h"
ldt_copy_entry ldt_copy[LDT_SIZE] = { {0,0}, };
#define FIRST_LDT_ENTRY_TO_ALLOC 10
/***********************************************************************
* SELECTOR_Init
*/
void SELECTOR_Init()
{
}
#define FIRST_LDT_ENTRY_TO_ALLOC 4
/***********************************************************************
......@@ -74,7 +68,7 @@ WORD FreeSelector( WORD sel )
dprintf_selector( stddeb, "FreeSelector(%04x)\n", sel );
if (IS_SELECTOR_FREE(sel)) return sel; /* error */
count = (GET_SEL_LIMIT(sel) >> 16) + 1;
entry.base = entry.limit = 0; /* clear the LDT entries */
memset( &entry, 0, sizeof(entry) ); /* clear the LDT entries */
for (i = 0; i < count; i++)
LDT_SetEntry( SELECTOR_TO_ENTRY(sel) + i, &entry );
return 0;
......@@ -129,7 +123,7 @@ static WORD SELECTOR_ReallocArray( WORD sel, WORD newcount )
{
/* Check if the next selectors are free */
for (i = oldcount; i < newcount; i++)
if (!IS_SELECTOR_FREE(sel)) break;
if (!IS_SELECTOR_FREE(sel+i)) break;
if (i < newcount)
{
FreeSelector( sel );
......@@ -138,7 +132,7 @@ static WORD SELECTOR_ReallocArray( WORD sel, WORD newcount )
}
else if (oldcount > newcount) /* We need to remove selectors */
{
entry.base = entry.limit = 0; /* clear the LDT entries */
memset( &entry, 0, sizeof(entry) ); /* clear the LDT entries */
for (i = oldcount; i < newcount; i++)
LDT_SetEntry( SELECTOR_TO_ENTRY(sel) + i, &entry );
}
......
......@@ -7,6 +7,7 @@ SRCS = \
clipboard.c \
comm.c \
commdlg.c \
compobj.c \
dos_fs.c \
driver.c \
exec.c \
......
......@@ -19,6 +19,7 @@
#include "library.h"
#include "commdlg.h"
#include "dlgs.h"
#include "selectors.h"
#define OPENFILEDLG2 11
#define SAVEFILEDLG2 12
......@@ -97,7 +98,8 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
printf("GetOpenFileName // apres LoadResource hDlgTmpl=%04X!\n", hDlgTmpl);
wndPtr = WIN_FindWndPtr(lpofn->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpofn->hwndOwner, (WNDPROC)FileOpenDlgProc, (DWORD)lpofn);
lpofn->hwndOwner, GetWndProcEntry16("FileOpenDlgProc"),
(DWORD)lpofn);
/* strcpy(lpofn->lpstrFile, "SETUP.TXT"); */
/* strcpy(lpofn->lpstrFileTitle, "SETUP.TXT");*/
......@@ -156,7 +158,8 @@ BOOL GetSaveFileName(LPOPENFILENAME lpofn)
}
wndPtr = WIN_FindWndPtr(lpofn->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpofn->hwndOwner, (WNDPROC)FileSaveDlgProc, (DWORD)lpofn);
lpofn->hwndOwner, GetWndProcEntry16("FileSaveDlgProc"),
(DWORD)lpofn);
printf("GetSaveFileName // return lpstrFile='%s' !\n", PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
......@@ -175,7 +178,8 @@ BOOL ChooseColor(LPCHOOSECOLOR lpChCol)
hDlgTmpl = LoadResource(hSysRes, hResInfo);
wndPtr = WIN_FindWndPtr(lpChCol->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpChCol->hwndOwner, (WNDPROC)ColorDlgProc, (DWORD)lpChCol);
lpChCol->hwndOwner, GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol);
return bRet;
}
......@@ -909,7 +913,8 @@ BOOL FindText(LPFINDREPLACE lpFind)
}
wndPtr = WIN_FindWndPtr(lpFind->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpFind->hwndOwner, (WNDPROC)FindTextDlgProc, (DWORD)lpFind);
lpFind->hwndOwner, GetWndProcEntry16("FindTextDlgProc"),
(DWORD)lpFind);
return bRet;
}
......@@ -935,7 +940,8 @@ BOOL ReplaceText(LPFINDREPLACE lpFind)
}
wndPtr = WIN_FindWndPtr(lpFind->hwndOwner);
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpFind->hwndOwner, (WNDPROC)ReplaceTextDlgProc, (DWORD)lpFind);
lpFind->hwndOwner, GetWndProcEntry16("ReplaceTextDlgProc"),
(DWORD)lpFind);
return bRet;
}
......@@ -1018,10 +1024,12 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
wndPtr = WIN_FindWndPtr(lpPrint->hwndOwner);
if (lpPrint->Flags & PD_PRINTSETUP)
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpPrint->hwndOwner, (WNDPROC)PrintSetupDlgProc, (DWORD)lpPrint);
lpPrint->hwndOwner, GetWndProcEntry16("PrintSetupDlgProc"),
(DWORD)lpPrint);
else
bRet = DialogBoxIndirectParam(wndPtr->hInstance, hDlgTmpl,
lpPrint->hwndOwner, (WNDPROC)PrintDlgProc, (DWORD)lpPrint);
lpPrint->hwndOwner, GetWndProcEntry16("PrintDlgProc"),
(DWORD)lpPrint);
return bRet;
}
......
/*
* COMPOBJ library
*
* Copyright 1995 Martin von Loewis
*/
/* At the moment, these are only empty stubs.
*/
#include "windows.h"
#include "compobj.h"
#include "ole.h"
#include "stddebug.h"
#include "debug.h"
/***********************************************************************
* CoDisconnectObject
*/
OLESTATUS WINAPI CoDisconnectObject(
LPUNKNOWN lpUnk,
DWORD reserved)
{
dprintf_ole(stdnimp,"CoDisconnectObject:%x %x\n",lpUnk,reserved);
return OLE_OK;
}
......@@ -334,38 +334,24 @@ int DOS_ValidDirectory(char *name)
".."'s in names like "/usr/bin/../lib/test" */
void DOS_SimplifyPath(char *name)
{
char *p = name, *q = name, *l = NULL;
char *l,*p;
BOOL changed;
start:
p = name;
q = name;
while( *p ) {
*q++ = *p++;
if( ( *p == '/' ) && ( *(p-1) == '/' ) )
p++;
}
*q = 0;
p = name;
q = name;
changed = FALSE;
while( *p ) {
if( (!changed) &&( *p == '/' ) && ( *(p+1) == '.' ) && ( *(p+2) == '.' ) ) {
if( l ) {
q = l;
p += 3;
changed = TRUE;
continue;
}
dprintf_dosfs(stddeb,"SimplifyPath: Before %s\n",name);
do {
changed = FALSE;
while ((l = strstr(name,"//"))) {
strcpy(l,l+1); changed = TRUE;
}
while ((l = strstr(name,"/../"))) {
*l = 0;
p = strrchr(name,'/');
if (p == NULL) p = name;
strcpy(p,l+3);
changed = TRUE;
}
else if( *p == '/' )
l = q;
*q++ = *p++;
}
*q = 0;
if( changed)
goto start;
} while (changed);
dprintf_dosfs(stddeb,"SimplifyPath: After %s\n",name);
}
......@@ -887,14 +873,6 @@ struct dosdirent *DOS_opendir(char *dosdirname)
char *unixdirname;
char temp[256];
for (x=0; x != MAX_OPEN_DIRS && DosDirs[x].inuse; x++)
;
if (x == MAX_OPEN_DIRS) {
fprintf( stderr, "DOS_opendir(): Too many open directories\n");
return NULL;
}
if ((unixdirname = DOS_GetUnixFileName(dosdirname)) == NULL)
return NULL;
......@@ -905,13 +883,23 @@ struct dosdirent *DOS_opendir(char *dosdirname)
if (temp[y] == '/')
{
temp[y++] = '\0';
strcpy(DosDirs[x].filemask, temp +y);
ToDos(DosDirs[x].filemask);
unixdirname += y;
break;
}
}
dprintf_dosfs(stddeb,"DOS_opendir: %s -> %s\n", unixdirname, temp);
for (x=0; x <= MAX_OPEN_DIRS; x++) {
if (x == MAX_OPEN_DIRS) {
fprintf( stderr, "DOS_opendir(): Too many open directories\n");
return NULL;
}
if (!DosDirs[x].inuse) break;
if (strcmp(DosDirs[x].unixpath,temp) == 0) break;
}
strcpy(DosDirs[x].filemask, unixdirname);
ToDos(DosDirs[x].filemask);
dprintf_dosfs(stddeb,"DOS_opendir: %s / %s\n", unixdirname, temp);
DosDirs[x].inuse = 1;
strcpy(DosDirs[x].unixpath, temp);
......
......@@ -85,7 +85,9 @@ void InitializeLoadedNewDLLs(HINSTANCE hInst)
dprintf_exec(stddeb, "Initializing %s, cs:ip %04x:%04x, ds %04x\n",
wpnt->name, cs_reg, ip_reg, ds_reg);
rv = CallTo16(cs_reg << 16 | ip_reg, ds_reg);
rv = CallTo16_regs_( (FARPROC)(cs_reg << 16 | ip_reg), ds_reg,
0 /*es*/, 0 /*ax*/, 0 /*bx*/, 0 /*cx*/,
0 /*dx*/, 0 /*si*/, wpnt->hinstance /*di*/ );
dprintf_exec(stddeb,"rv = %x\n", rv);
}
}
......@@ -123,7 +125,9 @@ void StartNewTask(HINSTANCE hInst)
sp_reg = wpnt->ne->ne_header->sp;
dprintf_exec(stddeb,"StartNewTask() before CallToInit16() !\n");
/*
rv = CallToInit16(cs_reg << 16 | ip_reg, ss_reg << 16 | sp_reg, ds_reg);
*/
dprintf_exec(stddeb,"rv = %x\n", rv);
}
......
......@@ -23,11 +23,8 @@
#include <sys/stat.h>
#include <string.h>
#include "dos_fs.h"
#include "regfunc.h"
#include "windows.h"
#include "wine.h"
#include "msdos.h"
#include "registers.h"
#include "options.h"
#include "stddebug.h"
#include "debug.h"
......@@ -118,11 +115,6 @@ INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
#ifdef WINELIB
dprintf_file(stdnimp, "OpenFile: not implemented\n");
#else
#ifndef PROCEMU
struct sigcontext_struct ccontext;
/* To make macros like EAX happy */
struct sigcontext_struct *context=&ccontext;
#endif
char filename[MAX_PATH+1];
int action;
struct stat s;
......
......@@ -28,8 +28,9 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include "desktop.h"
#include "prototypes.h"
#include "texts.h"
#include "dlls.h"
#include "library.h"
#include "dlls.h"
#include "if1632.h"
#define DEBUG_DEFINE_VARIABLES
#include "stddebug.h"
#include "debug.h"
......@@ -573,6 +574,7 @@ int main( int argc, char *argv[] )
if (Options.desktopGeometry) MAIN_CreateDesktop( argc, argv );
else rootWindow = DefaultRootWindow( display );
RELAY_Init();
MAIN_SaveSetup();
DOS_InitFS();
Comm_Init();
......@@ -863,17 +865,6 @@ BOOL SwapMouseButton(BOOL fSwap)
}
/***********************************************************************
* ISROMMODULE (KERNEL.323)
*/
BOOL IsRomModule(HANDLE x)
{
/* I don't know the prototype, I assume that it returns true
if the dll is located in rom */
return FALSE;
}
/***********************************************************************
* FileCDR (KERNEL.130)
*/
void FileCDR(FARPROC x)
......
......@@ -19,6 +19,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include "win.h"
#include "texts.h"
#include "user.h"
#include "selectors.h"
#include "stddebug.h"
/* #define DEBUG_MSGBOX */
#include "debug.h"
......@@ -83,7 +84,7 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
HINSTANCE hInst;
int nRet;
if (title == NULL)
if (title == NULL)
title = "Error";
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
......@@ -115,7 +116,7 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
lpmb->wType = type;
lpmb->ActiveFlg = TRUE;
wndClass.style = CS_HREDRAW | CS_VREDRAW ;
wndClass.lpfnWndProc = (WNDPROC)SystemMessageBoxProc;
wndClass.lpfnWndProc = GetWndProcEntry16("SystemMessageBoxProc");
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = 4;
wndClass.hInstance = hInst;
......
......@@ -31,6 +31,124 @@
typedef LPSTR LPNETRESOURCE;
/**************************************************************************
* WNetErrorText [USER.499]
*/
int WNetErrorText(WORD nError,LPSTR lpszText,WORD cbText)
{
printf("EMPTY STUB !!! WNetErrorText(%x,%p,%x)\n",
nError,lpszText,cbText);
return FALSE;
}
/**************************************************************************
* WNetOpenJob [USER.501]
*/
int WNetOpenJob(LPSTR szQueue,LPSTR szJobTitle,WORD nCopies,LPWORD pfh)
{
printf("EMPTY STUB !!! WNetOpenJob('%s','%s',%x,%p)\n",
szQueue,szJobTitle,nCopies,pfh);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetCloseJob [USER.502]
*/
int WNetCloseJob(WORD fh,LPWORD pidJob,LPSTR szQueue)
{
printf("EMPTY STUB !!! WNetCloseJob(%x,%p,'%s')\n",
fh,pidJob,szQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetAbortJob [USER.503]
*/
int WNetAbortJob(LPSTR szQueue,WORD wJobId)
{
printf("EMPTY STUB !!! WNetAbortJob('%s',%x)\n",
szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetHoldJob [USER.504]
*/
int WNetHoldJob(LPSTR szQueue,WORD wJobId)
{
printf("EMPTY STUB !!! WNetHoldJob('%s',%x)\n",
szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetReleaseJob [USER.505]
*/
int WNetReleaseJob(LPSTR szQueue,WORD wJobId)
{
printf("EMPTY STUB !!! WNetReleaseJob('%s',%x)\n",
szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetCancelJob [USER.506]
*/
int WNetCancelJob(LPSTR szQueue,WORD wJobId)
{
printf("EMPTY STUB !!! WNetCancelJob('%s',%x)\n",
szQueue,wJobId);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetSetJobCopies [USER.507]
*/
int WNetSetJobCopies(LPSTR szQueue,WORD wJobId,WORD nCopies)
{
printf("EMPTY STUB !!! WNetSetJobCopies('%s',%x,%x)\n",
szQueue,wJobId,nCopies);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetWatchQueue [USER.508]
*/
int WNetWatchQueue(HWND hWnd,LPSTR szLocal,LPSTR szUser,WORD nQueue)
{
printf("EMPTY STUB !!! WNetWatchQueue(%x,'%s','%s',%x)\n",
hWnd,szLocal,szUser,nQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetUnwatchQueue [USER.509]
*/
int WNetUnwatchQueue(LPSTR szQueue)
{
printf("EMPTY STUB !!! WNetUnwatchQueue('%s')\n", szQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetLockQueueData [USER.510]
*/
int WNetLockQueueData(LPSTR szQueue,LPSTR szUser,void *lplpQueueStruct)
{
printf("EMPTY STUB !!! WNetLockQueueData('%s','%s',%p)\n",
szQueue,szUser,lplpQueueStruct);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetUnlockQueueData [USER.511]
*/
int WNetUnlockQueueData(LPSTR szQueue)
{
printf("EMPTY STUB !!! WNetUnlockQueueData('%s')\n",szQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetConnection [USER.512]
*/
int WNetGetConnection(LPSTR lpLocalName,
......@@ -50,6 +168,25 @@ int WNetGetCaps(WORD capability)
}
/**************************************************************************
* WNetDeviceMode [USER.514]
*/
int WNetDeviceMode(HWND hWndOwner)
{
printf("EMPTY STUB !!! WNetDeviceMode(%x)\n",hWndOwner);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetBrowseDialog [USER.515]
*/
int WNetBrowseDialog(HWND hParent,WORD nType,LPSTR szPath)
{
printf("EMPTY STUB !!! WNetBrowseDialog(%x,%x,'%s')\n",
hParent,nType,szPath);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetUser [USER.516]
*/
UINT WNetGetUser(LPSTR lpLocalName, LPSTR lpUserName, DWORD *lpSize)
......@@ -81,6 +218,126 @@ UINT WNetCancelConnection(LPSTR lpName, BOOL bForce)
}
/**************************************************************************
* WNetGetError [USER.519]
*/
int WNetGetError(LPWORD nError)
{
printf("EMPTY STUB !!! WNetGetError(%p)\n",nError);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetErrorText [USER.520]
*/
int WNetGetErrorText(WORD nError, LPSTR lpBuffer, LPWORD nBufferSize)
{
printf("EMPTY STUB !!! WNetGetErrorText(%x,%p,%p)\n",
nError,lpBuffer,nBufferSize);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetRestoreConnection [USER.523]
*/
int WNetRestoreConnection(HWND hwndOwner,LPSTR lpszDevice)
{
printf("EMPTY STUB !!! WNetRestoreConnection(%x,'%s')\n",
hwndOwner,lpszDevice);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetWriteJob [USER.524]
*/
int WNetWriteJob(WORD hJob,void *lpData,LPWORD lpcbData)
{
printf("EMPTY STUB !!! WNetWriteJob(%x,%p,%p)\n",
hJob,lpData,lpcbData);
return WN_NET_ERROR;
}
/**************************************************************************
* WnetConnectDialog [USER.525]
*/
UINT WNetConnectDialog(HWND hWndParent, WORD iType)
{
printf("EMPTY STUB !!! WNetConnectDialog(%4X, %4X)\n", hWndParent, iType);
return WN_SUCCESS;
}
/**************************************************************************
* WNetDisconnectDialog [USER.526]
*/
int WNetDisconnectDialog(HWND hwndOwner, WORD iType)
{
printf("EMPTY STUB !!! WNetDisconnectDialog(%x,%x)\n",
hwndOwner,iType);
return WN_NET_ERROR;
}
/**************************************************************************
* WnetConnectionDialog [USER.527]
*/
UINT WNetConnectionDialog(HWND hWndParent, WORD iType)
{
printf("EMPTY STUB !!! WNetConnectionDialog(%4X, %4X)\n",
hWndParent, iType);
return WN_SUCCESS;
}
/**************************************************************************
* WNetViewQueueDialog [USER.528]
*/
int WNetViewQueueDialog(HWND hwndOwner,LPSTR lpszQueue)
{
printf("EMPTY STUB !!! WNetViewQueueDialog(%x,'%s')\n",
hwndOwner,lpszQueue);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetPropertyDialog [USER.529]
*/
int WNetPropertyDialog(HWND hwndParent,WORD iButton,
WORD nPropSel,LPSTR lpszName,WORD nType)
{
printf("EMPTY STUB !!! WNetPropertyDialog(%x,%x,%x,'%s',%x)\n",
hwndParent,iButton,nPropSel,lpszName,nType);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetDirectoryType [USER.530]
*/
int WNetGetDirectoryType(LPSTR lpName,void *lpType)
{
printf("EMPTY STUB !!! WNetGetDirectoryType('%s',%p)\n",
lpName,lpType);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetDirectoryNotify [USER.531]
*/
int WNetDirectoryNotify(HWND hwndOwner,void *lpDir,WORD wOper)
{
printf("EMPTY STUB !!! WNetDirectoryNotify(%x,%p,%x)\n",
hwndOwner,lpDir,wOper);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetGetPropertyText [USER.532]
*/
int WNetGetPropertyText(HWND hwndParent,WORD iButton,WORD nPropSel,
LPSTR lpszName,WORD nType)
{
printf("EMPTY STUB !!! WNetGetPropertyText(%x,%x,%x,'%s',%x)\n",
hwndParent,iButton,nPropSel,lpszName,nType);
return WN_NET_ERROR;
}
/**************************************************************************
* WNetAddConnection2 [USER.???]
*/
UINT WNetAddConnection2(LPSTR lpNetPath, LPSTR lpPassWord,
......
......@@ -218,15 +218,8 @@ int EnumProps(HWND hWnd, FARPROC lpEnumFunc)
printf("EnumProps // lpProp->PropName='%s' !\n", lpProp->PropName);
str = lpProp->PropName;
}
#ifdef WINELIB
nRet = (*lpEnumFunc)((HWND)hWnd, (WORD)0,
(LPSTR)str, (HANDLE)lpProp->hData);
#else
nRet = CallBack16(lpEnumFunc, 3,
CALLBACK_SIZE_WORD, (HWND)hWnd,
CALLBACK_SIZE_LONG, (LPSTR)str,
CALLBACK_SIZE_WORD, (HANDLE)lpProp->hData);
#endif
nRet = CallEnumPropProc( lpEnumFunc, hWnd,
(LONG)str, lpProp->hData);
if (nRet == 0) break;
if (lpProp->lpNextProp == NULL) break;
lpProp = lpProp->lpNextProp;
......
......@@ -9,6 +9,7 @@
#include "library.h"
#include "shell.h"
#include "neexe.h"
#include "selectors.h"
#include "../rc/sysres.h"
#include "stddebug.h"
/* #define DEBUG_REG */
......@@ -81,6 +82,7 @@ LONG RegOpenKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
dprintf_reg(stddeb,"RegOpenKey // specific key = %08lX !\n", hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
if (!*lpSubKey) { *lphKey = hKey; return ERROR_SUCCESS; }
while(*lpSubKey) {
ptr = strchr(lpSubKey,'\\');
if (!ptr) ptr = lpSubKey + strlen(lpSubKey);
......@@ -128,6 +130,7 @@ LONG RegCreateKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
dprintf_reg(stddeb,"RegCreateKey // specific key = %08lX !\n", hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
if (!*lpSubKey) { *lphKey = hKey; return ERROR_SUCCESS; }
while (*lpSubKey) {
dprintf_reg(stddeb, "RegCreateKey: Looking for subkey %s\n", lpSubKey);
ptr = strchr(lpSubKey,'\\');
......@@ -389,7 +392,7 @@ INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
return DialogBoxIndirectPtr( GetWindowWord(hWnd, GWW_HINSTANCE),
sysres_DIALOG_SHELL_ABOUT_MSGBOX,
hWnd, (WNDPROC)AboutDlgProc);
hWnd, GetWndProcEntry16("AboutDlgProc"));
}
......
#include <stdlib.h>
#include <stdio.h>
#include "regfunc.h"
#include "wine.h"
#include "stddebug.h"
/* #define DEBUG_INT */
#include "debug.h"
......@@ -14,20 +14,21 @@ struct Win87EmInfoStruct {
unsigned short Unused;
};
int
WIN87_fpmath()
void
WIN87_fpmath( struct sigcontext_struct context )
{
dprintf_int(stddeb, "_fpmath: (%x:%lx %x %x)\n",_CONTEXT->sc_cs,
_CONTEXT->sc_eip, _CONTEXT->sc_es, (unsigned int)_BX & 0xffff);
dprintf_int(stddeb, "_fpmath: (%x:%lx %x %x)\n",context.sc_cs,
context.sc_eip, context.sc_es, (int)context.sc_ebx & 0xffff );
switch(_BX & 0xffff)
switch(context.sc_ebx & 0xffff)
{
case 11:
return 1;
context.sc_eax = 1;
break;
default:
return 0;
context.sc_eax = 0;
break;
}
}
void
......
......@@ -16,7 +16,6 @@
#include <utime.h>
#include <ctype.h>
#include "dos_fs.h"
#include "regfunc.h"
#include "windows.h"
#include "msdos.h"
#include "registers.h"
......@@ -1669,10 +1668,9 @@ int do_int21(struct sigcontext_struct * context)
/**********************************************************************
* DOS3Call
*/
void DOS3Call(void)
void DOS3Call( struct sigcontext_struct context )
{
do_int21((struct sigcontext_struct *) _CONTEXT);
ReturnFromRegisterFunc();
do_int21( &context );
}
void INT21_Init(void)
......
......@@ -6,8 +6,8 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdio.h>
#include <stdlib.h>
#include "prototypes.h"
#include "regfunc.h"
#include "options.h"
#include "wine.h"
#include "stddebug.h"
#include "debug.h"
......@@ -16,20 +16,14 @@ extern unsigned short WIN_StackSize;
/**********************************************************************
* KERNEL_InitTask
*/
void KERNEL_InitTask(void)
void KERNEL_InitTask( struct sigcontext_struct context )
{
_BX = 0x81;
_AX = 1;
_CX = WIN_StackSize;
_DX = Options.cmdShow;
_DI = _DS;
/* FIXME: DI should contain the instance handle of the caller, _DS doesn't
always work as the caller might have changed it. */
_SI = 0;
ReturnFromRegisterFunc();
/* Function does not return */
context.sc_eax = 1;
context.sc_ebx = 0x81;
context.sc_ecx = WIN_StackSize;
context.sc_edx = Options.cmdShow;
context.sc_edi = 0;
context.sc_edi = context.sc_ds;
}
/**********************************************************************
......
......@@ -1833,14 +1833,9 @@ WORD FAR PASCAL MMSysTimeCallback(HWND hWnd, WORD wMsg, int nID, DWORD dwTime)
lpTimer->wCurTime = lpTimer->wDelay;
if (lpTimer->lpFunc != NULL) {
dprintf_mmtime(stddeb,"MMSysTimeCallback // before CallBack16 !\n");
#ifdef WINELIB
(*lpTimer->lpFunc)(lpTimer->wTimerID, (WORD)0,
lpTimer->dwUser, (DWORD)0, (DWORD)0);
#else
CallBack16(lpTimer->lpFunc, 5,
0, (int)lpTimer->wTimerID, 0, (int)0,
2, lpTimer->dwUser, 2, 0, 2, 0);
#endif
CallTimeFuncProc( lpTimer->lpFunc,
lpTimer->wTimerID, 0,
lpTimer->dwUser, 0, 0 );
dprintf_mmtime(stddeb, "MMSysTimeCallback // after CallBack16 !\n");
fflush(stdout);
}
......
......@@ -736,14 +736,10 @@ int EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
SelectObject(hDC, hOldFont);
DeleteObject(hFont);
dprintf_font(stddeb,"EnumFonts // i=%d lpLogFont=%p lptm=%p\n", i, lpLogFont, lptm);
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
#else
nRet = CallBack16(lpEnumFunc, 4, 2, GDI_HEAP_SEG_ADDR(hLog),
2, GDI_HEAP_SEG_ADDR(hMet),
0, (int)0, 2, (int)lpData);
#endif
nRet = CallEnumFontsProc( lpEnumFunc,
GDI_HEAP_SEG_ADDR(hLog),
GDI_HEAP_SEG_ADDR(hMet),
0, (LONG)lpData );
if (nRet == 0) {
dprintf_font(stddeb,"EnumFonts // EnumEnd requested by application !\n");
break;
......@@ -823,13 +819,10 @@ int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FARPROC lpEnumFunc, LPSTR lpData
DeleteObject(hFont);
dprintf_font(stddeb, "EnumFontFamilies // i=%d lpLogFont=%p lptm=%p\n", i, lpLogFont, lptm);
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
#else
nRet = CallBack16(lpEnumFunc, 4, 2, GDI_HEAP_SEG_ADDR(hLog),
2, GDI_HEAP_SEG_ADDR(hMet),
0, (int)0, 2, (int)lpData);
#endif
nRet = CallEnumFontFamProc( lpEnumFunc,
GDI_HEAP_SEG_ADDR(hLog),
GDI_HEAP_SEG_ADDR(hMet),
0, (LONG)lpData );
if (nRet == 0) {
dprintf_font(stddeb,"EnumFontFamilies // EnumEnd requested by application !\n");
break;
......@@ -840,5 +833,17 @@ int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FARPROC lpEnumFunc, LPSTR lpData
return 0;
}
/*************************************************************************
* GetRasterizerCaps [GDI.313]
*/
BOOL GetRasterizerCaps(LPRASTERIZER_STATUS lprs, WORD cbNumBytes)
{
/* This is not much more than a dummy */
RASTERIZER_STATUS rs;
rs.nSize = sizeof(rs);
rs.wFlags = 0;
rs.nLanguageID = 0;
return True;
}
......@@ -16,6 +16,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "palette.h"
#include "pen.h"
#include "region.h"
#include "callback.h"
#include "stddebug.h"
/* #define DEBUG_GDI */
#include "debug.h"
......@@ -486,16 +487,10 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnWidth=%d\n", ((LPLOGPEN)lpLog)->lopnWidth.x);
dprintf_gdi(stddeb,"EnumObjects // StockPen lopnColor=%08lX\n", ((LPLOGPEN)lpLog)->lopnColor);
}
nRet = 1;
/*
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLog, lpData);
#else
nRet = CallBack16(lpEnumFunc, 4, 2,
GDI_HEAP_SEG_ADDR(hLog), 2, (int)lpData);
#endif
*/
dprintf_gdi(stddeb,"EnumObjects // after CallBack16 !\n");
nRet = CallEnumObjectsProc( lpEnumFunc,
GDI_HEAP_SEG_ADDR(hLog),
(int)lpData );
dprintf_gdi(stddeb,"EnumObjects // after Callback!\n");
if (nRet == 0) {
GDI_HEAP_FREE(hLog);
dprintf_gdi(stddeb,"EnumObjects // EnumEnd requested by application !\n");
......@@ -524,16 +519,10 @@ int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnWidth=%d\n", ((LPLOGPEN)lpLog)->lopnWidth.x);
dprintf_gdi(stddeb,"EnumObjects // DC_Pen lopnColor=%08lX\n", ((LPLOGPEN)lpLog)->lopnColor);
}
/*
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLog, lpData);
#else
nRet = CallBack16(lpEnumFunc, 4, 2,
GDI_HEAP_SEG_ADDR(hLog), 2, (int)lpData);
#endif
*/
nRet = 1;
dprintf_gdi(stddeb,"EnumObjects // after CallBack16 !\n");
nRet = CallEnumObjectsProc( lpEnumFunc,
GDI_HEAP_SEG_ADDR(hLog),
(int)lpData );
dprintf_gdi(stddeb,"EnumObjects // after Callback!\n");
if (nRet == 0) {
GDI_HEAP_FREE(hLog);
dprintf_gdi(stddeb,"EnumObjects // EnumEnd requested by application !\n");
......
......@@ -8,7 +8,7 @@ static char Copyright[] = "Copyright Bob Amstadt, 1993";
#include <stdlib.h>
#include "windows.h"
#include "if1632.h"
#include "callback.h"
/**********************************************************************
* LineDDA (GDI.100)
......@@ -16,32 +16,41 @@ static char Copyright[] = "Copyright Bob Amstadt, 1993";
void LineDDA(short nXStart, short nYStart, short nXEnd, short nYEnd,
FARPROC callback, long lParam)
{
int x, y;
int b;
int x_diff = nXEnd - nXStart;
int y_diff = nYEnd - nYStart;
int xadd = 1, yadd = 1;
int err,erradd;
int cnt;
int dx = nXEnd - nXStart;
int dy = nYEnd - nYStart;
if (x_diff == 0 && y_diff == 0)
return;
if ((abs(x_diff) < abs(y_diff) && x_diff != 0) || y_diff == 0)
{
b = (nXStart * y_diff) / x_diff - nYStart;
for (x = nXStart; x <= nXEnd; x++)
{
y = (x * y_diff) / x_diff + b;
CallLineDDAProc(callback, x, y, lParam);
}
if (dx < 0) {
dx = -dx; xadd = -1;
}
else
{
b = (nYStart * x_diff) / y_diff - nXStart;
for (y = nYStart; y <= nYEnd; y++)
{
x = (y * x_diff) / y_diff + b;
CallLineDDAProc(callback, x, y, lParam);
if (dy < 0) {
dy = -dy; yadd = -1;
}
if (dx > dy) { /* line is "more horizontal" */
err = 2*dy - dx; erradd = 2*dy - 2*dx;
for(cnt = 0;cnt <= dx; cnt++) {
CallLineDDAProc(callback,nXStart,nYStart,lParam);
if (err > 0) {
nYStart += yadd;
err += erradd;
} else {
err += 2*dy;
}
nXStart += xadd;
}
} else { /* line is "more vertical" */
err = 2*dx - dy; erradd = 2*dx - 2*dy;
for(cnt = 0;cnt <= dy; cnt++) {
CallLineDDAProc(callback,nXStart,nYStart,lParam);
if (err > 0) {
nXStart += xadd;
err += erradd;
} else {
err += 2*dx;
}
nYStart += yadd;
}
}
}
......@@ -13,21 +13,6 @@ LONG CallWindowProc (WNDPROC func, HWND hwnd, WORD message,
return (*func)(hwnd, message, wParam, lParam);
}
CallLineDDAProc (FARPROC back, int x, int y, long lParam)
{
return (*back)(x, y, lParam);
}
DWORD CallHookProc (HOOKPROC func, short code, WPARAM wParam, LPARAM lParam)
{
return (*func)(code, wParam, lParam);
}
BOOL CallGrayStringProc (FARPROC func, HDC hdc, LPARAM lParam, INT cch)
{
return (*func) (hdc, lParam, cch);
}
/*
* Header loading routines for WineLib.
*/
......
......@@ -6,11 +6,7 @@ OBJS = $(SRCS:.c=.o)
AllTarget(build)
#ifndef NewBuild
NormalProgramTarget(build,build.o,$(DEPLIBS),,)
#else
NormalProgramTarget(newbuild,$(OBJS),$(DEPLIBS),,)
#endif
DependTarget()
......
......@@ -4,8 +4,7 @@ length NUMBER_OF_ORDINALS
ORDINAL VARTYPE EXPORTNAME (DATA [DATA [DATA [...]]])
ORDINAL FUNCTYPE EXPORTNAME([ARGTYPE [ARGTYPE [...]]])
HANDLERNAME([ARGNUM [ARGNUM [...]]])
ORDINAL FUNCTYPE EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
ORDINAL equate EXPORTNAME DATA
......@@ -36,34 +35,22 @@ ordinal 2 and containing 4 bytes:
Function ordinals:
This type defines a function entry point. The prototype defined
by "EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available
for dynamic linking and the format of the 16-bit stack. By specifying
"FUNCTYPE", the loader can automatically determine which order the
parameters were pushed by the calling routine. The prototype
specified by "HANDLERNAME([ARGNUM [ARGNUM [...]]])" specifies to
the loader how to call the 32-bit library routine which will handle this
call. Note that specifying "ARGNUM" as 1 means the leftmost argument
given to the function call, and not the first argument on the stack.
For "pascal" functions, "ARGNUM" equal to 1 specifies the last
argument on the stack. If you do not specify any arguments to the
handler function, then address of the 16-bit argument stack is
passed to the handler function.
"ORDINAL" is replaced by the ordinal number corresponding to the
function. "FUNCTYPE" should be "c" or "pascal" ("pascal" may be
shortened to "p"). "EXPORTNAME" will be the name available for
dynamic linking. "ARGTYPE" should be "byte", "word", "long", "ptr",
"s_byte" (signed byte), "s_word" (signed word) or "s_long"
(signed long). "HANDLERNAME" is the name of the actual function
that will process the request in 32-bit mode. "ARGNUM" is the
original argument number. The first argument is numbered "1".
This type defines a function entry point. The prototype defined by
"EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
dynamic linking and the format of the 16-bit stack. "ORDINAL" is replaced
by the ordinal number corresponding to the function. "FUNCTYPE" should be
"pascal16" or "pascal" for 16-bit or 32-bit return values. "ARGTYPE"
should be "byte", "word", "long", "ptr" (linear pointer), "s_byte" (signed
byte), "s_word" (signed word), "s_long" (signed long), or "segptr"
(segmented pointer). "HANDLERNAME" is the name of the actual function that
will process the request in 32-bit mode.
This first example defines an entry point for the CreateWindow()
call (the ordinal 100 is just an example):
100 pascal CreateWindow(ptr ptr long s_word s_word s_word s_word
word word word ptr)
WIN_CreateWindow(1 2 3 4 5 6 7 8 9 10 11)
WIN_CreateWindow
This second example defines an entry point for the GetFocus()
call (the ordinal 100 is just an example):
......
......@@ -7,6 +7,7 @@ static char Copyright[] = "Copyright David Metcalfe, 1993";
*/
#include "windows.h"
#include "selectors.h"
#include "stddebug.h"
/* #define DEBUG_CARET */
#include "debug.h"
......@@ -30,15 +31,13 @@ typedef struct
static CARET Caret;
static BOOL LockCaret;
static WORD CARET_Callback(HWND hwnd, WORD msg, WORD timerid, LONG ctime);
static void CARET_HideCaret();
/*****************************************************************
* CARET_Callback
*/
static WORD CARET_Callback(HWND hwnd, WORD msg, WORD timerid, LONG ctime)
WORD CARET_Callback(HWND hwnd, WORD msg, WORD timerid, LONG ctime)
{
HDC hdc;
HBRUSH hBrush;
......@@ -134,7 +133,8 @@ void CreateCaret(HWND hwnd, HBITMAP bitmap, short width, short height)
Caret.timeout = 750;
LockCaret = FALSE;
Caret.timerid = SetSystemTimer((HWND)0, 0, Caret.timeout, (FARPROC)CARET_Callback);
Caret.timerid = SetSystemTimer( (HWND)0, 0, Caret.timeout,
(FARPROC)GetWndProcEntry16("CARET_Callback"));
dprintf_caret(stddeb,"CreateCaret: hwnd=%d, timerid=%d\n",
hwnd, Caret.timerid);
......@@ -222,7 +222,8 @@ void SetCaretBlinkTime(WORD msecs)
KillSystemTimer( (HWND)0, Caret.timerid);
Caret.timeout = msecs;
Caret.timerid = SetSystemTimer((HWND)0, 0, Caret.timeout, (FARPROC)CARET_Callback);
Caret.timerid = SetSystemTimer( (HWND)0, 0, Caret.timeout,
(FARPROC)GetWndProcEntry16("CARET_Callback"));
}
......
......@@ -23,6 +23,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1993";
/* #define DEBUG_CURSOR */
/* #define DEBUG_RESOURCE */
#include "debug.h"
#include "arch.h"
static int ShowCursCount = 0;
static HCURSOR hActiveCursor;
......@@ -52,16 +53,15 @@ static struct { SEGPTR name; HCURSOR cursor; } system_cursor[] =
*/
HCURSOR LoadCursor(HANDLE instance, SEGPTR cursor_name)
{
XColor bkcolor;
XColor fgcolor;
HCURSOR hCursor;
HANDLE rsc_mem;
WORD *lp;
LONG *lpl,size;
CURSORDESCRIP *lpcurdesc;
CURSORALLOC *lpcur;
HDC hdc;
int i, j, image_size;
int i, image_size;
unsigned char *cp1,*cp2;
dprintf_resource(stddeb,"LoadCursor: instance = %04x, name = %08lx\n",
instance, cursor_name);
if (!instance)
......@@ -117,27 +117,29 @@ HCURSOR LoadCursor(HANDLE instance, SEGPTR cursor_name)
}
}
#if 1
#if 0
/* this code replaces all bitmap cursors with the default cursor */
lpcur->xcursor = XCreateFontCursor(display, XC_top_left_arrow);
GlobalUnlock(hCursor);
return hCursor;
#endif
if (!(hdc = GetDC(GetDesktopWindow()))) return 0;
if (!(hdc = GetDC(0))) return 0;
rsc_mem = RSC_LoadResource(instance, cursor_name, NE_RSCTYPE_GROUP_CURSOR,
&image_size);
if (rsc_mem == (HANDLE)NULL) {
fprintf(stderr,"LoadCursor / Cursor %08lx not Found !\n", cursor_name);
ReleaseDC(GetDesktopWindow(), hdc);
ReleaseDC(0, hdc);
return 0;
}
lp = (WORD *)GlobalLock(rsc_mem);
if (lp == NULL) {
GlobalFree(rsc_mem);
ReleaseDC(GetDesktopWindow(), hdc);
ReleaseDC(0, hdc);
return 0;
}
lpcurdesc = (CURSORDESCRIP *)(lp + 3);
#if 0
dprintf_cursor(stddeb,"LoadCursor / image_size=%d\n", image_size);
dprintf_cursor(stddeb,"LoadCursor / curReserved=%X\n", *lp);
dprintf_cursor(stddeb,"LoadCursor / curResourceType=%X\n", *(lp + 1));
......@@ -154,6 +156,7 @@ HCURSOR LoadCursor(HANDLE instance, SEGPTR cursor_name)
(DWORD)lpcurdesc->curDIBSize);
dprintf_cursor(stddeb,"LoadCursor / cursor curDIBOffset=%lX\n",
(DWORD)lpcurdesc->curDIBOffset);
#endif
lpcur->descriptor = *lpcurdesc;
GlobalUnlock(rsc_mem);
GlobalFree(rsc_mem);
......@@ -163,63 +166,64 @@ HCURSOR LoadCursor(HANDLE instance, SEGPTR cursor_name)
if (rsc_mem == (HANDLE)NULL) {
fprintf(stderr,
"LoadCursor / Cursor %08lx Bitmap not Found !\n", cursor_name);
ReleaseDC(GetDesktopWindow(), hdc);
ReleaseDC(0, hdc);
return 0;
}
lp = (WORD *)GlobalLock(rsc_mem);
lpl = (LONG *)GlobalLock(rsc_mem);
if (lp == NULL) {
GlobalFree(rsc_mem);
ReleaseDC(GetDesktopWindow(), hdc);
ReleaseDC(0, hdc);
return 0;
}
lp++;
for (j = 0; j < 16; j++)
dprintf_cursor(stddeb,"%04X ", *(lp + j));
/*
if (*lp == sizeof(BITMAPINFOHEADER))
lpcur->hBitmap = ConvertInfoBitmap(hdc, (BITMAPINFO *)lp);
else
*/
lpcur->hBitmap = 0;
/* lp += sizeof(BITMAP); */
for (i = 0; i < 81; i++) {
char temp = *((char *)lp + 162 + i);
*((char *)lp + 162 + i) = *((char *)lp + 324 - i);
*((char *)lp + 324 - i) = temp;
}
lpcur->pixshape = XCreatePixmapFromBitmapData(
display, DefaultRootWindow(display),
((char *)lp + 211), 32, 32,
/*
lpcurdesc->Width / 2, lpcurdesc->Height / 4,
*/
WhitePixel(display, DefaultScreen(display)),
BlackPixel(display, DefaultScreen(display)), 1);
lpcur->pixmask = XCreatePixmapFromBitmapData(
display, DefaultRootWindow(display),
((char *)lp + 211), 32, 32,
WhitePixel(display, DefaultScreen(display)),
BlackPixel(display, DefaultScreen(display)), 1);
memset(&bkcolor, 0, sizeof(XColor));
memset(&fgcolor, 0, sizeof(XColor));
bkcolor.pixel = WhitePixel(display, DefaultScreen(display));
fgcolor.pixel = BlackPixel(display, DefaultScreen(display));
dprintf_cursor(stddeb,"LoadCursor / before XCreatePixmapCursor !\n");
lpcur->xcursor = XCreatePixmapCursor(display,
lpcur->pixshape, lpcur->pixmask,
&fgcolor, &bkcolor, lpcur->descriptor.curXHotspot,
lpcur->descriptor.curYHotspot);
}
lpl++;
size = CONV_LONG (*lpl);
if (size == sizeof(BITMAPCOREHEADER)){
CONV_BITMAPCOREHEADER (lpl);
((BITMAPINFOHEADER *)lpl)->biHeight /= 2;
lpcur->hBitmap = ConvertCoreBitmap( hdc, (BITMAPCOREHEADER *) lpl );
} else if (size == sizeof(BITMAPINFOHEADER)){
CONV_BITMAPINFO (lpl);
((BITMAPINFOHEADER *)lpl)->biHeight /= 2;
lpcur->hBitmap = ConvertInfoBitmap( hdc, (BITMAPINFO *) lpl );
} else {
fprintf(stderr,"No bitmap for cursor?\n");
lpcur->hBitmap = 0;
}
lpl = (char *)lpl + size + 8;
/* This is rather strange! The data is stored *BACKWARDS* and */
/* mirrored! But why?? FIXME: the image must be flipped at the Y */
/* axis, either here or in CreateCusor(); */
size = lpcur->descriptor.Height/2 * ((lpcur->descriptor.Width+7)/8);
#if 0
dprintf_cursor(stddeb,"Before:\n");
for(i=0;i<2*size;i++) {
dprintf_cursor(stddeb,"%02x ",((unsigned char *)lpl)[i]);
if ((i & 7) == 7) dprintf_cursor(stddeb,"\n");
}
#endif
cp1 = (char *)lpl;
cp2 = cp1+2*size;
for(i = 0; i < size; i++) {
char tmp=*--cp2;
*cp2 = *cp1;
*cp1++ = tmp;
}
#if 0
dprintf_cursor(stddeb,"After:\n");
for(i=0;i<2*size;i++) {
dprintf_cursor(stddeb,"%02x ",((unsigned char *)lpl)[i]);
if ((i & 7) == 7) dprintf_cursor(stddeb,"\n");
}
#endif
hCursor = CreateCursor(instance, lpcur->descriptor.curXHotspot,
lpcur->descriptor.curYHotspot, lpcur->descriptor.Width,
lpcur->descriptor.Height/2,
(LPSTR)lpl, ((LPSTR)lpl)+size);
GlobalUnlock(rsc_mem);
GlobalFree(rsc_mem);
/*
hCursor = CreateCursor(instance, lpcur->descriptor.curXHotspot,
lpcur->descriptor.curYHotspot, 32, 32,
(LPSTR)lp + 211, , (LPSTR)lp + 211);
*/
XFreePixmap(display, lpcur->pixshape);
XFreePixmap(display, lpcur->pixmask);
ReleaseDC(GetDesktopWindow(), hdc);
GlobalUnlock(hCursor);
ReleaseDC(0,hdc);
return hCursor;
}
......@@ -231,12 +235,16 @@ HCURSOR LoadCursor(HANDLE instance, SEGPTR cursor_name)
HCURSOR CreateCursor(HANDLE instance, short nXhotspot, short nYhotspot,
short nWidth, short nHeight, LPSTR lpANDbitPlane, LPSTR lpXORbitPlane)
{
XColor bkcolor;
XColor fgcolor;
HCURSOR hCursor;
CURSORALLOC *lpcur;
HDC hdc;
int bpllen = (nWidth + 7)/8 * nHeight;
char *tmpbpl = malloc(bpllen);
int i;
XColor bkcolor,fgcolor;
Colormap cmap = XDefaultColormap(display,XDefaultScreen(display));
dprintf_resource(stddeb,"CreateCursor: inst=%04x nXhotspot=%d nYhotspot=%d nWidth=%d nHeight=%d\n",
instance, nXhotspot, nYhotspot, nWidth, nHeight);
dprintf_resource(stddeb,"CreateCursor: inst=%04x lpANDbitPlane=%p lpXORbitPlane=%p\n",
......@@ -253,24 +261,21 @@ HCURSOR CreateCursor(HANDLE instance, short nXhotspot, short nYhotspot,
memset(lpcur, 0, sizeof(CURSORALLOC));
lpcur->descriptor.curXHotspot = nXhotspot;
lpcur->descriptor.curYHotspot = nYhotspot;
lpcur->pixshape = XCreatePixmapFromBitmapData(
display, DefaultRootWindow(display),
lpXORbitPlane, nWidth, nHeight,
WhitePixel(display, DefaultScreen(display)),
BlackPixel(display, DefaultScreen(display)), 1);
for(i=0; i<bpllen; i++) tmpbpl[i] = ~lpANDbitPlane[i];
lpcur->pixmask = XCreatePixmapFromBitmapData(
display, DefaultRootWindow(display),
lpANDbitPlane, nWidth, nHeight,
WhitePixel(display, DefaultScreen(display)),
BlackPixel(display, DefaultScreen(display)), 1);
memset(&bkcolor, 0, sizeof(XColor));
memset(&fgcolor, 0, sizeof(XColor));
bkcolor.pixel = WhitePixel(display, DefaultScreen(display));
fgcolor.pixel = BlackPixel(display, DefaultScreen(display));
tmpbpl, nWidth, nHeight, 1, 0, 1);
for(i=0; i<bpllen; i++) tmpbpl[i] ^= lpXORbitPlane[i];
lpcur->pixshape = XCreatePixmapFromBitmapData(
display, DefaultRootWindow(display),
tmpbpl, nWidth, nHeight, 1, 0, 1);
XParseColor(display,cmap,"#000000",&fgcolor);
XParseColor(display,cmap,"#ffffff",&bkcolor);
lpcur->xcursor = XCreatePixmapCursor(display,
lpcur->pixshape, lpcur->pixmask,
&fgcolor, &bkcolor, lpcur->descriptor.curXHotspot,
lpcur->descriptor.curYHotspot);
free(tmpbpl);
XFreePixmap(display, lpcur->pixshape);
XFreePixmap(display, lpcur->pixmask);
ReleaseDC(GetDesktopWindow(), hdc);
......
......@@ -882,10 +882,14 @@ BOOL PostMessage( HWND hwnd, WORD message, WORD wParam, LONG lParam )
LONG SendMessage( HWND hwnd, WORD msg, WORD wParam, LONG lParam )
{
WND * wndPtr;
LONG ret;
wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
return CallWindowProc( wndPtr->lpfnWndProc, hwnd, msg, wParam, lParam );
ret = CallWindowProc( wndPtr->lpfnWndProc, hwnd, msg, wParam, lParam );
dprintf_msg( stddeb,"SendMessage(%4.4x,%x,%x,%lx) -> %lx\n",
hwnd, msg, wParam, lParam, ret );
return ret;
}
......
......@@ -18,6 +18,7 @@
#include "scroll.h"
#include "nonclient.h"
#include "graphics.h"
#include "selectors.h"
#include "stddebug.h"
/* #define DEBUG_NONCLIENT */
#include "debug.h"
......@@ -1321,7 +1322,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WORD wParam, POINT pt )
if (wParam == SC_ABOUTWINE)
{ extern char sysres_DIALOG_2[];
DialogBoxIndirectPtr( wndPtr->hInstance, sysres_DIALOG_2,
hwnd, (WNDPROC)AboutWine_Proc );
hwnd, GetWndProcEntry16("AboutWine_Proc") );
}
break;
}
......
......@@ -14,6 +14,7 @@
#include <stdlib.h>
#include "windows.h"
#include "ldt.h"
#include "stackframe.h"
#include "stddebug.h"
/* #define DEBUG_UTILITY */
#include "debug.h"
......@@ -56,7 +57,7 @@ void UTILITY_strip015(char *dest) {
int
DebugPrintString(char *str)
{
fprintf(stderr, "%s", str);
fprintf(stderr, "%s\n", str);
return 0;
}
......@@ -268,12 +269,14 @@ char *UTILITY_convertArgs(char *format, char *winarg)
};
#ifndef WINELIB
INT windows_wsprintf(BYTE *win_stack)
INT windows_wsprintf(void)
{
LPSTR lpOutput, lpFormat, ptr;
BYTE new_stack[1024], *stack_ptr;
BOOL fLarge;
BYTE *win_stack = (BYTE *)CURRENT_STACK16->args;
lpOutput = (LPSTR) PTR_SEG_TO_LIN(*(DWORD*)win_stack);
win_stack += sizeof(DWORD);
lpFormat = (LPSTR) PTR_SEG_TO_LIN(*(DWORD*)win_stack);
......
......@@ -21,8 +21,8 @@
#include "nonclient.h"
#include "winpos.h"
#include "color.h"
#include "stddebug.h"
#include "callback.h"
#include "stddebug.h"
/* #define DEBUG_WIN */
/* #define DEBUG_MENU */
#include "debug.h"
......@@ -318,9 +318,15 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
if (parent)
{
/* Make sure parent is valid */
if (!IsWindow( parent )) return 0;
if (!IsWindow( parent )) {
dprintf_win(stddeb,"CreateWindowEx: Parent %x is not a windows\n", parent);
return 0;
}
}
else if (style & WS_CHILD) return 0; /* WS_CHILD needs a parent */
else if (style & WS_CHILD) {
dprintf_win(stddeb,"CreateWindowEx: no parent\n");
return 0; /* WS_CHILD needs a parent */
}
if (!(class = CLASS_FindClassByName( className, instance, &classPtr ))) {
fprintf(stderr,"CreateWindow BAD CLASSNAME '%s' !\n", className);
......@@ -336,7 +342,10 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
/* Create the window structure */
hwnd = USER_HEAP_ALLOC( sizeof(WND)+classPtr->wc.cbWndExtra );
if (!hwnd) return 0;
if (!hwnd) {
dprintf_win(stddeb,"CreateWindowEx: Out of memory\n");
return 0;
}
/* Fill the structure */
......@@ -480,7 +489,10 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
wmcreate = SendMessage( hwnd, WM_NCCREATE, 0,
USER_HEAP_SEG_ADDR(hcreateStruct) );
if (!wmcreate) wmcreate = -1;
if (!wmcreate) {
dprintf_win(stddeb,"CreateWindowEx: WM_NCCREATE return 0\n");
wmcreate = -1;
}
else
{
WINPOS_SendNCCalcSize( hwnd, FALSE, &wndPtr->rectWindow,
......@@ -496,6 +508,7 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
if (wmcreate == -1)
{
/* Abort window creation */
dprintf_win(stddeb,"CreateWindowEx: wmcreate==-1, aborting\n");
WIN_DestroyWindow( hwnd );
return 0;
}
......@@ -991,8 +1004,6 @@ HWND GetLastActivePopup(HWND hwnd)
* pointers
*
* o call wndenumprc for every child window the desktop has
* (parameters to Callback16 passed backwards so they are
* put in in pascal calling order)
*
* o if wndenumprc returns 0 exit
*
......@@ -1009,13 +1020,7 @@ BOOL EnumWindows(FARPROC wndenumprc, LPARAM lParam)
if ( !(wndPtr=WIN_FindWndPtr(hwnd)) ) {
return 0;
}
#ifdef WINELIB
(*wndenumprc)(hwnd, lParam);
#else
result = CallBack16(wndenumprc, 2,
CALLBACK_SIZE_WORD, (int) hwnd,
CALLBACK_SIZE_LONG, lParam);
#endif
result = CallEnumWindowsProc( wndenumprc, hwnd, lParam );
if ( ! result ) {
return 0;
}
......@@ -1030,7 +1035,7 @@ BOOL EnumWindows(FARPROC wndenumprc, LPARAM lParam)
* o hwnd is the first child to use, loop until all next windows
* are processed
*
* o call wdnenumprc with parameters in inverse order (pascal)
* o call wdnenumprc
*
* o call ourselves with the next child window
*
......@@ -1039,22 +1044,11 @@ static BOOL WIN_EnumChildWin(HWND hwnd, FARPROC wndenumprc, LPARAM lParam)
{
WND *wndPtr;
while (hwnd) {
if ( !(wndPtr=WIN_FindWndPtr(hwnd)) ) {
return 0;
}
#ifdef WINELIB
if (!(*wndenumprc)( 2, lParam, (int) hwnd)) {
#else
if (!CallBack16(wndenumprc, 2,
CALLBACK_SIZE_WORD, (int) hwnd,
CALLBACK_SIZE_LONG, lParam)) {
#endif
return 0;
}
if (!WIN_EnumChildWin(wndPtr->hwndChild, wndenumprc, lParam)) {
return 0;
}
while (hwnd)
{
if (!(wndPtr=WIN_FindWndPtr(hwnd))) return 0;
if (!CallEnumWindowsProc( wndenumprc, hwnd, lParam )) return 0;
if (!WIN_EnumChildWin(wndPtr->hwndChild, wndenumprc, lParam)) return 0;
hwnd=wndPtr->hwndNext;
}
return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment