Release 961208

Sun Dec  8 14:51:57 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [configure.in]
	Added check to see if the compiler supports building a DLL when
	the --with-dll option is used.

	* [controls/listbox.c]
	Don't send LBN_SELCHANGE too often.
	Added WM_CHARTOITEM support.

	* [Make.rules.in] [library/Makefile.in]
	Build winestub.o and link it with Winelib programs.

	* [objects/text.c]
	Added support for '&&' in DrawText().

	* [tools/build.c]
	Added -o option.

Sat Dec 7 12:07:07 1996  Andrew Lewycky <plewycky@oise.utoronto.ca>

	* [win32/thread.c]
	GetCurrentThread(): return -2 (current thread pseudo-handle).
	GetCurrentThreadId(): return GetCurrentTask().

	* [objects/font.c] [if1632/gdi32.spec]
	GetTextExtentPoint32{A,W}Buggy(): for future bug-compatibility.

	* [win32/findfile.c]
	FindClose(): ignore INVALID_HANDLE_VALUE (like Win95).

	* [windows/hook.c] [include/hook.h] [if1632/user.spec]
	  [if1632/user32.spec] [windows/focus.c] [windows/message.c]
	  [windows/nonclient.c] [windows/win.c] [windows/winpos.c]
	Hooks rewritten to support Win32.

	* [misc/winsock.c]
	WINSOCK_select(): need to put sockets with errors into exceptfds.
	WINSOCK_socket(): fix error return.

	* [windows/win.c]
	SetWindowWord(): call SetParent on GWW_HWNDPARENT.

Wed Dec  4 22:03:05 1996  Andrew Taylor <andrew@riscan.com>

	* [files/dos_fs.c]
	Check if buf is NULL before copying string in GetFullPathName32A().

Wed Dec  4 21:40:59 1996  Robert Pouliot <krynos@clic.net>

        * [graphics/wing.c] [if1632/wing.spec]
	Implemented many WinG functions, but some don't seem to
	work correctly (probably due to the one not done).
	
Wed Dec  4 03:38:25 1996  Lee Jaekil <juria@puma.kaitech.re.kr>

	* [misc/main.c]
	Implemented a few more of the SystemParametersInfo() cases.

Sun Dec  1 22:30:00 1996  Alex Korobka <alex@trantor.pharm.sunysb.edu> 

	* [controls/button.c]
	Improved focus rectangle painting.

	* [windows/dialog.c] [windows/defdlg.c]
	Fixed IE3.0 problems with DWL_MSGRESULT.

Sun Dec  1 20:49:32 1996  Albrecht Kleine  <kleine@ak.sax.de>

	* [files/profile.c]
	Changed error handling in PROFILE_SetString().
This commit is contained in:
Alexandre Julliard 1996-12-08 19:25:27 +00:00
parent da0cfb3610
commit 7e6ae4ba5e
52 changed files with 3330 additions and 1284 deletions

View File

@ -1,15 +1,13 @@
This is release 961201 of Wine, the MS Windows emulator. This is still a This is release 961208 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly. features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry. forget to include a ChangeLog entry.
WHAT'S NEW with Wine-961201: (see ChangeLog for details) WHAT'S NEW with Wine-961208: (see ChangeLog for details)
- Better Winsock. - Win32 hooks.
- Rewritten listboxes. - fnt2bdf font conversion tool.
- Windows 3.1 registry loader.
- Improved keyboard support.
- Lots of bug fixes. - Lots of bug fixes.
See the README file in the distribution for installation instructions. See the README file in the distribution for installation instructions.
@ -18,10 +16,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 the release is available at the ftp sites. The sources will be available
from the following locations: from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-961201.tar.gz ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-961208.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-961201.tar.gz ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-961208.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-961201.tar.gz ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-961208.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-961201.tar.gz ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-961208.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite. It should also be available from any site that mirrors tsx-11 or sunsite.

15
BUGS
View File

@ -5,18 +5,13 @@ done something for one of the problems. You are encouraged to
add new entries and, more importantly, remove those for the add new entries and, more importantly, remove those for the
bugs you fixed ;-) bugs you fixed ;-)
------------------------------------------------------------ ------------------------------------------------------------
As of Nov 8 1996 - As of Dec 1 1996 -
General: General:
* Combobox code is very inadequate (no notification messages, * Combobox code is very inadequate (no notification messages,
dropdown listboxes often stay visible, etc... ). dropdown listboxes often stay visible, etc... ).
* Multicolumn and/or LBS_EXTENDEDSEL style listboxes are still
screwed up. [julliard@lrc.epfl.ch]
* Winsock asynchronous functions do not work.
* Font mapping is too generic. No soft font loading, no rotated * Font mapping is too generic. No soft font loading, no rotated
text support. [alex@amadeus.pharm.sunysb.edu] text support. [alex@amadeus.pharm.sunysb.edu]
@ -31,12 +26,16 @@ General:
Miscellaneous: Miscellaneous:
* Simple OLE actions were working in October release, got
broken in November (in Winword "Insert Object" now results in
segfault right after the call to LoadModule()).
* Write and other applications have problems with displaying partially
obscured bitmaps.
* Asynchronous Winsock services sometimes produce zombie processes.
* AllocCSToDSAlias() shouldn't alloc alias for the same segment multiple * AllocCSToDSAlias() shouldn't alloc alias for the same segment multiple
times. times.
* ScrollWindowEx() is outdated. * ScrollWindowEx() is outdated.
* HCBT_CLICKSKIPPED/HCBT_KEYSKIPPED hook actions are not implemented. * HCBT_CLICKSKIPPED/HCBT_KEYSKIPPED hook actions are not implemented.
* Write sometimes segfaults in StretchDIBits() (when inside BITBLT_GetRow)
when only lower part of the resulting image is visible.
Where to look in source files: Where to look in source files:

View File

@ -1,3 +1,76 @@
----------------------------------------------------------------------
Sun Dec 8 14:51:57 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure.in]
Added check to see if the compiler supports building a DLL when
the --with-dll option is used.
* [controls/listbox.c]
Don't send LBN_SELCHANGE too often.
Added WM_CHARTOITEM support.
* [Make.rules.in] [library/Makefile.in]
Build winestub.o and link it with Winelib programs.
* [objects/text.c]
Added support for '&&' in DrawText().
* [tools/build.c]
Added -o option.
Sat Dec 7 12:07:07 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [win32/thread.c]
GetCurrentThread(): return -2 (current thread pseudo-handle).
GetCurrentThreadId(): return GetCurrentTask().
* [objects/font.c] [if1632/gdi32.spec]
GetTextExtentPoint32{A,W}Buggy(): for future bug-compatibility.
* [win32/findfile.c]
FindClose(): ignore INVALID_HANDLE_VALUE (like Win95).
* [windows/hook.c] [include/hook.h] [if1632/user.spec]
[if1632/user32.spec] [windows/focus.c] [windows/message.c]
[windows/nonclient.c] [windows/win.c] [windows/winpos.c]
Hooks rewritten to support Win32.
* [misc/winsock.c]
WINSOCK_select(): need to put sockets with errors into exceptfds.
WINSOCK_socket(): fix error return.
* [windows/win.c]
SetWindowWord(): call SetParent on GWW_HWNDPARENT.
Wed Dec 4 22:03:05 1996 Andrew Taylor <andrew@riscan.com>
* [files/dos_fs.c]
Check if buf is NULL before copying string in GetFullPathName32A().
Wed Dec 4 21:40:59 1996 Robert Pouliot <krynos@clic.net>
* [graphics/wing.c] [if1632/wing.spec]
Implemented many WinG functions, but some don't seem to
work correctly (probably due to the one not done).
Wed Dec 4 03:38:25 1996 Lee Jaekil <juria@puma.kaitech.re.kr>
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Sun Dec 1 22:30:00 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/button.c]
Improved focus rectangle painting.
* [windows/dialog.c] [windows/defdlg.c]
Fixed IE3.0 problems with DWL_MSGRESULT.
Sun Dec 1 20:49:32 1996 Albrecht Kleine <kleine@ak.sax.de>
* [files/profile.c]
Changed error handling in PROFILE_SetString().
---------------------------------------------------------------------- ----------------------------------------------------------------------
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch> Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>

View File

@ -1,14 +1,15 @@
# Global rules shared by all makefiles -*-Makefile-*- # Global rules shared by all makefiles -*-Makefile-*-
# #
# Each individual makefile should define the following variables: # Each individual makefile should define the following variables:
# TOPSRCDIR : top-level source directory # TOPSRCDIR : top-level source directory
# TOPOBJDIR : top-level object directory # TOPOBJDIR : top-level object directory
# SRCDIR : source directory for this module # SRCDIR : source directory for this module
# MODULE : name of the module being built # MODULE : name of the module being built
# C_SRCS : C sources for the module # C_SRCS : C sources for the module
# GEN_C_SRCS : generated C sources (optional) # GEN_C_SRCS : generated C sources (optional)
# ASM_SRCS : assembly sources (optional) # ASM_SRCS : assembly sources (optional)
# EXTRA_OBJS : extra object files (optional) # GEN_ASM_SRCS : generated assembly sources (optional)
# EXTRA_OBJS : extra object files (optional)
# First some useful definitions # First some useful definitions
@ -21,7 +22,7 @@ X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@ X_LIBS = @X_LIBS@
XPM_LIB = -lXpm XPM_LIB = -lXpm
XLIB = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@ XLIB = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
WINELIB = -L$(TOPOBJDIR) -lwine WINELIB = $(WINESTUB) $(TOPOBJDIR)/@MAIN_TARGET@
LDLIBS = @LDLIBS@ LDLIBS = @LDLIBS@
YACC = @YACC@ YACC = @YACC@
LEX = @LEX@ LEX = @LEX@
@ -33,10 +34,12 @@ RM = rm -f
BUILD = $(TOPOBJDIR)/tools/build BUILD = $(TOPOBJDIR)/tools/build
MAKEDEP = $(TOPOBJDIR)/tools/makedep MAKEDEP = $(TOPOBJDIR)/tools/makedep
WINERC = $(TOPOBJDIR)/rc/winerc WINERC = $(TOPOBJDIR)/rc/winerc
WINESTUB = $(TOPOBJDIR)/library/winestub.o
SUBMAKE = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'OPTIONS=$(OPTIONS)' SUBMAKE = $(MAKE) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'OPTIONS=$(OPTIONS)'
@SET_MAKE@ @SET_MAKE@
OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS) OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) \
$(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
# Implicit rules # Implicit rules
@ -45,6 +48,9 @@ OBJS = $(GEN_C_SRCS:.c=.o) $(C_SRCS:.c=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
.c.o: .c.o:
$(CC) -c $(ALLCFLAGS) -o $*.o $< $(CC) -c $(ALLCFLAGS) -o $*.o $<
.s.o:
$(CC) -c -o $*.o $<
.S.o: .S.o:
$(CC) -c -o $*.o $< $(CC) -c -o $*.o $<
@ -85,7 +91,7 @@ depend:: $(MAKEDEP) $(C_SRCS) $(GEN_C_SRCS)
$(MAKEDEP) $(DIVINCL) -C. $(GEN_C_SRCS) -C$(SRCDIR) $(C_SRCS) $(MAKEDEP) $(DIVINCL) -C. $(GEN_C_SRCS) -C$(SRCDIR) $(C_SRCS)
clean:: clean::
$(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc winerctmp.c $(GEN_C_SRCS) $(GEN_C_SRCS:.c=.h) $(PROGRAMS) $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc winerctmp.c $(GEN_C_SRCS) $(GEN_C_SRCS:.c=.h) $(GEN_ASM_SRCS) $(PROGRAMS)
dummy: dummy:

368
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ AC_ARG_WITH(library,
AC_ARG_WITH(dll, AC_ARG_WITH(dll,
[ --with-dll build Wine as a DLL instead of an emulator], [ --with-dll build Wine as a DLL instead of an emulator],
[OPTIONS="-DWINELIB -DWINELIBDLL" MAIN_TARGET="libwine.so.1.0" CFLAGS="$CFLAGS -fPIC"]) [OPTIONS="-DWINELIB" MAIN_TARGET="libwine.so.1.0"])
AC_ARG_WITH(ipc, AC_ARG_WITH(ipc,
[ --with-ipc use inter-process communication for DDE], [ --with-ipc use inter-process communication for DDE],
@ -45,7 +45,6 @@ dnl **** Check for gcc strength-reduce bug ****
if test "x${GCC}" = "xyes" if test "x${GCC}" = "xyes"
then then
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall"
AC_C_CROSS
AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug, AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
AC_TRY_RUN([ AC_TRY_RUN([
int main(void) { int main(void) {
@ -83,6 +82,25 @@ then
AC_DEFINE(NEED_UNDERSCORE_PREFIX) AC_DEFINE(NEED_UNDERSCORE_PREFIX)
fi fi
dnl **** Check for working dll ****
if test "$MAIN_TARGET" = "libwine.so.1.0"
then
AC_CACHE_CHECK("whether we can build a dll",
ac_cv_c_dll,
[saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
AC_TRY_LINK(,[return 1],ac_cv_c_dll="yes",ac_cv_c_dll="no")
CFLAGS=$saved_cflags
])
if test "$ac_cv_c_dll" = "yes"
then
CFLAGS="$CFLAGS -fPIC"
else
MAIN_TARGET="libwine.a"
fi
fi
dnl **** Check for functions and header files **** dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(memmove tcgetattr usleep) AC_CHECK_FUNCS(memmove tcgetattr usleep)

View File

@ -427,11 +427,15 @@ static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
{ {
/* again, this is what CTL3D expects */ /* again, this is what CTL3D expects */
DWORD tm = (textlen) ? GetTextExtent( hDC, wndPtr->text, textlen) : 0x00020002; SetRectEmpty16(&rbox);
delta = (rtext.bottom - rtext.top - HIWORD(tm) - 1)/2; if( textlen )
DrawText16( hDC, wndPtr->text, textlen, &rbox,
rbox.bottom = (rbox.top = rtext.top + delta - 1) + HIWORD(tm) + 2; DT_SINGLELINE | DT_CALCRECT );
rbox.right = (rbox.left = --rtext.left) + LOWORD(tm) + 2; textlen = rbox.bottom - rbox.top;
delta = ((rtext.bottom - rtext.top) - textlen)/2;
rbox.bottom = (rbox.top = rtext.top + delta - 1) + textlen + 2;
textlen = rbox.right - rbox.left;
rbox.right = (rbox.left += --rtext.left) + textlen + 2;
IntersectRect16(&rbox, &rbox, &rtext); IntersectRect16(&rbox, &rbox, &rtext);
DrawFocusRect16( hDC, &rbox ); DrawFocusRect16( hDC, &rbox );
} }

View File

@ -1130,8 +1130,6 @@ static LRESULT LISTBOX_SelectItemRange( WND *wnd, LB_DESCR *descr, INT32 first,
LISTBOX_RepaintItem( wnd, descr, i, ODA_SELECT ); LISTBOX_RepaintItem( wnd, descr, i, ODA_SELECT );
} }
} }
if (descr->style & LBS_NOTIFY)
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
return LB_OKAY; return LB_OKAY;
} }
@ -1180,7 +1178,6 @@ static LRESULT LISTBOX_SetSelection( WND *wnd, LB_DESCR *descr, INT32 index,
if (oldsel != -1) descr->items[oldsel].selected = FALSE; if (oldsel != -1) descr->items[oldsel].selected = FALSE;
if (index != -1) descr->items[index].selected = TRUE; if (index != -1) descr->items[index].selected = TRUE;
descr->selected_item = index; descr->selected_item = index;
/* FIXME if (index != -1) LISTBOX_MakeItemVisible( wnd, descr, index );*/
if (oldsel != -1) LISTBOX_RepaintItem( wnd, descr, oldsel, ODA_SELECT); if (oldsel != -1) LISTBOX_RepaintItem( wnd, descr, oldsel, ODA_SELECT);
if (index != -1) LISTBOX_RepaintItem( wnd, descr, index, ODA_SELECT ); if (index != -1) LISTBOX_RepaintItem( wnd, descr, index, ODA_SELECT );
if (send_notify) SEND_NOTIFICATION( wnd, descr, if (send_notify) SEND_NOTIFICATION( wnd, descr,
@ -1214,8 +1211,7 @@ static void LISTBOX_MoveCaret( WND *wnd, LB_DESCR *descr, INT32 index,
else if (!(descr->style & LBS_MULTIPLESEL) && (descr->selected_item != -1)) else if (!(descr->style & LBS_MULTIPLESEL) && (descr->selected_item != -1))
{ {
/* Set selection to new caret item */ /* Set selection to new caret item */
LISTBOX_SetSelection( wnd, descr, index, TRUE, LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
(descr->style & LBS_NOTIFY) != 0 );
} }
} }
@ -1683,8 +1679,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
{ {
LISTBOX_SetCaretIndex( wnd, descr, index, FALSE ); LISTBOX_SetCaretIndex( wnd, descr, index, FALSE );
LISTBOX_SetSelection( wnd, descr, index, LISTBOX_SetSelection( wnd, descr, index,
!descr->items[index].selected, !descr->items[index].selected, FALSE );
(descr->style & LBS_NOTIFY) != 0 );
} }
else LISTBOX_MoveCaret( wnd, descr, index, FALSE ); else LISTBOX_MoveCaret( wnd, descr, index, FALSE );
} }
@ -1693,8 +1688,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
LISTBOX_MoveCaret( wnd, descr, index, FALSE ); LISTBOX_MoveCaret( wnd, descr, index, FALSE );
LISTBOX_SetSelection( wnd, descr, index, LISTBOX_SetSelection( wnd, descr, index,
(!(descr->style & LBS_MULTIPLESEL) || (!(descr->style & LBS_MULTIPLESEL) ||
!descr->items[index].selected), !descr->items[index].selected), FALSE );
(descr->style & LBS_NOTIFY) != 0 );
} }
} }
SetFocus32( wnd->hwndSelf ); SetFocus32( wnd->hwndSelf );
@ -1715,6 +1709,21 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
} }
/***********************************************************************
* LISTBOX_HandleLButtonUp
*/
static LRESULT LISTBOX_HandleLButtonUp( WND *wnd, LB_DESCR *descr )
{
if (LISTBOX_Timer != LB_TIMER_NONE)
KillSystemTimer32( wnd->hwndSelf, LB_TIMER_ID );
LISTBOX_Timer = LB_TIMER_NONE;
if (GetCapture32() == wnd->hwndSelf) ReleaseCapture();
if (descr->style & LBS_NOTIFY)
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
return 0;
}
/*********************************************************************** /***********************************************************************
* LISTBOX_HandleTimer * LISTBOX_HandleTimer
* *
@ -1883,16 +1892,13 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr,
caret = descr->nb_items - 1; caret = descr->nb_items - 1;
break; break;
case VK_SPACE: case VK_SPACE:
if (descr->style & LBS_EXTENDEDSEL) if (descr->style & LBS_EXTENDEDSEL) caret = descr->focus_item;
{
if (!(GetKeyState(VK_SHIFT) & 0x8000))
descr->anchor_item = descr->focus_item;
LISTBOX_MoveCaret( wnd, descr, descr->focus_item, TRUE );
}
else if (descr->style & LBS_MULTIPLESEL) else if (descr->style & LBS_MULTIPLESEL)
{
LISTBOX_SetSelection( wnd, descr, descr->focus_item, LISTBOX_SetSelection( wnd, descr, descr->focus_item,
!descr->items[descr->focus_item].selected, !descr->items[descr->focus_item].selected,
(descr->style & LBS_NOTIFY) != 0 ); (descr->style & LBS_NOTIFY) != 0 );
}
break; break;
} }
if (caret >= 0) if (caret >= 0)
@ -1901,6 +1907,8 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr,
!(GetKeyState( VK_SHIFT ) & 0x8000)) !(GetKeyState( VK_SHIFT ) & 0x8000))
descr->anchor_item = caret; descr->anchor_item = caret;
LISTBOX_MoveCaret( wnd, descr, caret, TRUE ); LISTBOX_MoveCaret( wnd, descr, caret, TRUE );
if (descr->style & LBS_NOTIFY)
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
} }
return 0; return 0;
} }
@ -1912,11 +1920,24 @@ static LRESULT LISTBOX_HandleKeyDown( WND *wnd, LB_DESCR *descr,
static LRESULT LISTBOX_HandleChar( WND *wnd, LB_DESCR *descr, static LRESULT LISTBOX_HandleChar( WND *wnd, LB_DESCR *descr,
WPARAM32 wParam ) WPARAM32 wParam )
{ {
INT32 index; INT32 caret = -1;
char str[2] = { wParam & 0xff, '\0' }; char str[2] = { wParam & 0xff, '\0' };
index = LISTBOX_FindString( wnd, descr, descr->focus_item, str, FALSE ); if (descr->style & LBS_WANTKEYBOARDINPUT)
if (index != LB_ERR) LISTBOX_MoveCaret( wnd, descr, index, TRUE ); {
caret = SendMessage32A( descr->owner, WM_CHARTOITEM,
MAKEWPARAM(LOWORD(wParam), descr->focus_item),
wnd->hwndSelf );
if (caret == -2) return 0;
}
if (caret == -1)
caret = LISTBOX_FindString( wnd, descr, descr->focus_item, str, FALSE);
if (caret != -1)
{
LISTBOX_MoveCaret( wnd, descr, caret, TRUE );
if (descr->style & LBS_NOTIFY)
SEND_NOTIFICATION( wnd, descr, LBN_SELCHANGE );
}
return 0; return 0;
} }
@ -2159,8 +2180,7 @@ LRESULT ListBoxWndProc(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
INT32 index = LISTBOX_FindString( wnd, descr, wParam, INT32 index = LISTBOX_FindString( wnd, descr, wParam,
(LPCSTR)lParam, FALSE ); (LPCSTR)lParam, FALSE );
if (index == LB_ERR) return LB_ERR; if (index == LB_ERR) return LB_ERR;
LISTBOX_SetSelection( wnd, descr, index, TRUE, LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
(descr->style & LBS_NOTIFY) != 0 );
return index; return index;
} }
@ -2176,13 +2196,13 @@ LRESULT ListBoxWndProc(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
lParam = (INT32)(INT16)lParam; lParam = (INT32)(INT16)lParam;
/* fall through */ /* fall through */
case LB_SETSEL32: case LB_SETSEL32:
return LISTBOX_SetSelection( wnd, descr, lParam, wParam, return LISTBOX_SetSelection( wnd, descr, lParam, wParam, FALSE );
(descr->style & LBS_NOTIFY) != 0 );
case LB_SETCURSEL16: case LB_SETCURSEL16:
wParam = (INT32)(INT16)wParam; wParam = (INT32)(INT16)wParam;
/* fall through */ /* fall through */
case LB_SETCURSEL32: case LB_SETCURSEL32:
if (wParam != -1) LISTBOX_MakeItemVisible( wnd, descr, wParam, TRUE );
return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE ); return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
case LB_GETSELCOUNT16: case LB_GETSELCOUNT16:
@ -2344,11 +2364,7 @@ LRESULT ListBoxWndProc(HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
return 0; return 0;
case WM_LBUTTONUP: case WM_LBUTTONUP:
if (LISTBOX_Timer != LB_TIMER_NONE) return LISTBOX_HandleLButtonUp( wnd, descr );
KillSystemTimer32( hwnd, LB_TIMER_ID );
LISTBOX_Timer = LB_TIMER_NONE;
if (GetCapture32() == hwnd) ReleaseCapture();
return 0;
case WM_KEYDOWN: case WM_KEYDOWN:
return LISTBOX_HandleKeyDown( wnd, descr, wParam ); return LISTBOX_HandleKeyDown( wnd, descr, wParam );

View File

@ -137,7 +137,9 @@ void DEBUG_SetBreakpoints( BOOL32 set )
{ {
if (breakpoints[i].in_use && breakpoints[i].enabled) if (breakpoints[i].in_use && breakpoints[i].enabled)
{ {
if (DEBUG_IsBadWritePtr( &breakpoints[i].addr, 1 )) /* Note: we check for read here, because if reading is allowed */
/* writing permission will be forced in DEBUG_SetOpcode. */
if (DEBUG_IsBadReadPtr( &breakpoints[i].addr, 1 ))
{ {
fprintf( stderr, "Invalid address for breakpoint %d, disabling it\n", i ); fprintf( stderr, "Invalid address for breakpoint %d, disabling it\n", i );
breakpoints[i].enabled = FALSE; breakpoints[i].enabled = FALSE;

View File

@ -888,12 +888,15 @@ DWORD GetShortPathName32W( LPCWSTR longpath, LPWSTR shortpath, DWORD shortlen )
/*********************************************************************** /***********************************************************************
* GetFullPathNameA (KERNEL32.272) * GetFullPathNameA (KERNEL32.272)
*/ */
DWORD GetFullPathName32A( LPCSTR fn, DWORD buflen, LPSTR buf, LPSTR *lastpart) { DWORD GetFullPathName32A( LPCSTR fn, DWORD buflen, LPSTR buf, LPSTR *lastpart)
{
dprintf_file(stddeb,"GetFullPathNameA(%s)\n",fn); dprintf_file(stddeb,"GetFullPathNameA(%s)\n",fn);
/* FIXME */ /* FIXME */
lstrcpyn32A(buf,fn,buflen); if (buf)
if (lastpart) {
*lastpart=strrchr(buf,'\\'); lstrcpyn32A(buf,fn,buflen);
if (lastpart) *lastpart = strrchr(buf,'\\');
}
return strlen(fn); return strlen(fn);
} }

View File

@ -506,22 +506,21 @@ static INT32 PROFILE_GetString( LPCSTR section, LPCSTR key_name,
static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name, static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
LPCSTR value ) LPCSTR value )
{ {
BOOL32 ret;
if (!key_name) /* Delete a whole section */ if (!key_name) /* Delete a whole section */
{ {
dprintf_profile(stddeb, "PROFILE_DeleteSection('%s')\n", section_name); dprintf_profile(stddeb, "PROFILE_DeleteSection('%s')\n", section_name);
ret = PROFILE_DeleteSection( &CurProfile.section, section_name ); CurProfile.changed |= PROFILE_DeleteSection( &CurProfile.section,
CurProfile.changed |= ret; section_name );
return ret; return TRUE; /* Even if PROFILE_DeleteSection() has failed,
this is not an error on application's level.*/
} }
else if (!value) /* Delete a key */ else if (!value) /* Delete a key */
{ {
dprintf_profile( stddeb, "PROFILE_DeleteKey('%s','%s')\n", dprintf_profile( stddeb, "PROFILE_DeleteKey('%s','%s')\n",
section_name, key_name ); section_name, key_name );
ret = PROFILE_DeleteKey( &CurProfile.section, section_name, key_name ); CurProfile.changed |= PROFILE_DeleteKey( &CurProfile.section,
CurProfile.changed |= ret; section_name, key_name );
return ret; return TRUE; /* same error handling as above */
} }
else /* Set the key value */ else /* Set the key value */
{ {
@ -542,8 +541,8 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
else dprintf_profile( stddeb, "creating key\n" ); else dprintf_profile( stddeb, "creating key\n" );
key->value = xstrdup( value ); key->value = xstrdup( value );
CurProfile.changed = TRUE; CurProfile.changed = TRUE;
return TRUE;
} }
return TRUE;
} }

View File

@ -6,9 +6,9 @@ VPATH = @srcdir@
MODULE = graphics MODULE = graphics
C_SRCS = \ C_SRCS = \
wing.c \
bitblt.c \ bitblt.c \
driver.c driver.c \
wing.c
all: $(MODULE).o all: $(MODULE).o

View File

@ -5,19 +5,10 @@
*/ */
#include "gdi.h" #include "gdi.h"
#include "windows.h"
#include "stddebug.h" #include "stddebug.h"
#include "debug.h" #include "debug.h"
/* I dunno if this structure can be put here... Maybe copyright, I'm no lawyer... */
typedef enum WING_DITHER_TYPE
{
WING_DISPERSED_4x4,
WING_DISPERSED_8x8,
WING_CLUSTERED_4x4
} WING_DITHER_TYPE;
/*********************************************************************** /***********************************************************************
* WingCreateDC16 (WING.1001) * WingCreateDC16 (WING.1001)
*/ */
@ -33,8 +24,21 @@ HDC16 WinGCreateDC16(void)
*/ */
BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt) BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt)
{ {
fprintf(stdnimp,"WinGRecommendDIBFormat: empty stub!\n"); HDC16 i=GetDC16(0);
return 0;
fmt->bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
fmt->bmiHeader.biWidth=0;
fmt->bmiHeader.biHeight=1; /* The important part */
fmt->bmiHeader.biPlanes=GetDeviceCaps(i, PLANES);
fmt->bmiHeader.biBitCount=GetDeviceCaps(i, BITSPIXEL);
fmt->bmiHeader.biCompression=BI_RGB;
fmt->bmiHeader.biSizeImage=0;
fmt->bmiHeader.biXPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSX);
fmt->bmiHeader.biYPelsPerMeter=1000/25.4*GetDeviceCaps(i,LOGPIXELSY);
fmt->bmiHeader.biClrUsed=0;
fmt->bmiHeader.biClrImportant=0;
ReleaseDC16(0, i);
return 1;
} }
/*********************************************************************** /***********************************************************************
@ -42,26 +46,82 @@ BOOL16 WinGRecommendDIBFormat16(BITMAPINFO *fmt)
*/ */
HBITMAP16 WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, void **bits) HBITMAP16 WinGCreateBitmap16(HDC16 winDC, BITMAPINFO *header, void **bits)
{ {
fprintf(stdnimp,"WinGCreateBitmap: empty stub! (expect failure)\n"); fprintf(stdnimp,"WinGCreateBitmap: almost empty stub! (expect failure)\n");
*bits=0; /* Assume RGB color */
if(bits==NULL)
return CreateDIBitmap(winDC, header, 0, bits, header, 0);
else
return CreateDIBitmap(winDC, header, 1, bits, header, 0);
return 0; return 0;
} }
/***********************************************************************
* WinGGetDIBPointer16 (WING.1004)
*/
void* WinGGetDIBPointer16(HBITMAP16 bmap, BITMAPINFO *header)
{
fprintf(stdnimp,"WinGGetDIBPointer16: empty stub!\n");
return NULL;
}
/***********************************************************************
* WinGGetDIBColorTable16 (WING.1005)
*/
UINT16 WinGGetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry,
RGBQUAD* colors)
{
return GetPaletteEntries(winDC, start, numentry, colors);
}
/***********************************************************************
* WinGSetDIBColorTable16 (WING.1006)
*/
UINT16 WinGSetDIBColorTable16(HDC16 winDC, UINT16 start, UINT16 numentry,
RGBQUAD* colors)
{
return SetPaletteEntries(winDC, start, numentry, colors);
}
/*********************************************************************** /***********************************************************************
* WinGCreateHalfTonePalette16 (WING.1007) * WinGCreateHalfTonePalette16 (WING.1007)
*/ */
HPALETTE16 WinGCreateHalfTonePalette16(void) HPALETTE16 WinGCreateHalfTonePalette16(void)
{ {
fprintf(stdnimp,"WinGCreateHalfTonePalette: empty stub!\n"); fprintf(stdnimp,"WinGCreateHalfTonePalette16: empty stub!\n");
return 0; return 0;
} }
/*********************************************************************** /***********************************************************************
* WinGCreateHalfToneBrush16 (WING.1008) * WinGCreateHalfToneBrush16 (WING.1008)
*/ */
HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, WING_DITHER_TYPE type) HPALETTE16 WinGCreateHalfToneBrush16(HDC16 winDC, COLORREF col, INT16 dithertype)
{ {
fprintf(stdnimp,"WinGCreateHalfToneBrush: empty stub!\n"); fprintf(stdnimp,"WinGCreateHalfToneBrush16: empty stub!\n");
return 0; return 0;
} }
/***********************************************************************
* WinGStretchBlt16 (WING.1009)
*/
BOOL16 WinGStretchBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest,
INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc,
INT16 widSrc, INT16 heiSrc)
{
return StretchBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, widSrc, heiSrc, SRCCOPY);
/* fprintf(stdnimp,"WinGStretchBlt16: empty stub!\n");*/
/* return 0; */
}
/***********************************************************************
* WinGBitBlt16 (WING.1010)
*/
BOOL16 WinGBitBlt16(HDC16 destDC, INT16 xDest, INT16 yDest, INT16 widDest,
INT16 heiDest, HDC16 srcDC, INT16 xSrc, INT16 ySrc)
{
return BitBlt16(destDC, xDest, yDest, widDest, heiDest, srcDC, xSrc, ySrc, SRCCOPY);
/* fprintf(stdnimp,"WinGBitBlt16: empty stub!\n");*/
/* return 0;*/
}

View File

@ -11,7 +11,7 @@ DLLS = \
comdlg32.spec \ comdlg32.spec \
commdlg.spec \ commdlg.spec \
compobj.spec \ compobj.spec \
crtdll.spec \ crtdll.spec \
ddeml.spec \ ddeml.spec \
gdi.spec \ gdi.spec \
gdi32.spec \ gdi32.spec \
@ -23,7 +23,7 @@ DLLS = \
mmsystem.spec \ mmsystem.spec \
mouse.spec \ mouse.spec \
mpr.spec \ mpr.spec \
ntdll.spec \ ntdll.spec \
ole2.spec \ ole2.spec \
ole2conv.spec \ ole2conv.spec \
ole2disp.spec \ ole2disp.spec \
@ -52,7 +52,7 @@ DLLS = \
wprocs.spec \ wprocs.spec \
wsock32.spec wsock32.spec
SPEC_FILES = $(DLLS:.spec=.S) SPEC_FILES = $(DLLS:.spec=.s)
C_SRCS = \ C_SRCS = \
dummy.c \ dummy.c \
@ -60,17 +60,19 @@ C_SRCS = \
thunk.c thunk.c
ASM_SRCS = \ ASM_SRCS = \
$(SPEC_FILES) \
callfrom16.S \
callfrom32.S \
callto16.S \
callto32.S \
except.S except.S
GEN_ASM_SRCS = \
$(SPEC_FILES) \
callfrom16.s \
callfrom32.s \
callto16.s \
callto32.s \
.SUFFIXES: .spec .SUFFIXES: .spec
.spec.S: .spec.s:
$(BUILD) -spec $< > $*.S $(BUILD) -o $@ -spec $<
all: checkbuild $(MODULE).o all: checkbuild $(MODULE).o
@ -81,22 +83,19 @@ $(SPEC_FILES): $(BUILD)
$(BUILD) checkbuild: $(BUILD) checkbuild:
cd $(TOPOBJDIR)/tools; $(SUBMAKE) build cd $(TOPOBJDIR)/tools; $(SUBMAKE) build
callfrom16.S: $(SPEC_FILES) callfrom16.s: $(SPEC_FILES)
$(BUILD) -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq` > callfrom16.S $(BUILD) -o $@ -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq`
callfrom32.S: $(SPEC_FILES) callfrom32.s: $(SPEC_FILES)
$(BUILD) -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\(.*\)/\1/' | sort | uniq` > callfrom32.S $(BUILD) -o $@ -callfrom32 `cat $(SPEC_FILES) | grep CallFrom32_ | sed 's/.*CallFrom32_\(.*\)/\1/' | sort | uniq`
callto16.S: $(TOPSRCDIR)/include/callback.h $(BUILD) callto16.s: $(TOPSRCDIR)/include/callback.h $(BUILD)
$(BUILD) -callto16 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > callto16.S $(BUILD) -o $@ -callto16 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq`
callto32.S: $(TOPSRCDIR)/include/callback.h $(BUILD) callto32.s: $(TOPSRCDIR)/include/callback.h $(BUILD)
$(BUILD) -callto32 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo32_" | sed 's/.*CallTo32_\(.*\)(.*/\1/' | sort | uniq` > callto32.S $(BUILD) -o $@ -callto32 `cat $(TOPSRCDIR)/include/callback.h | grep "extern.*CallTo32_" | sed 's/.*CallTo32_\(.*\)(.*/\1/' | sort | uniq`
except.o: except.S $(TOPOBJDIR)/include/config.h except.o: except.S $(TOPOBJDIR)/include/config.h
$(CC) -c $(DIVINCL) -o $*.o $(SRCDIR)/except.S $(CC) -c $(DIVINCL) -o $*.o $(SRCDIR)/except.S
clean::
$(RM) $(SPEC_FILES) callfrom16.S callfrom32.S callto16.S callto32.S
### Dependencies: ### Dependencies:

View File

@ -272,8 +272,8 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
410 pascal16 IsValidMetaFile (word) IsValidMetaFile 410 pascal16 IsValidMetaFile (word) IsValidMetaFile
411 pascal16 GetCurLogFont(word) GetCurLogFont 411 pascal16 GetCurLogFont(word) GetCurLogFont
412 pascal16 IsDCCurrentPalette(word) IsDCCurrentPalette 412 pascal16 IsDCCurrentPalette(word) IsDCCurrentPalette
439 pascal16 StretchDIBits (word s_word s_word word word word word 439 pascal16 StretchDIBits (word s_word s_word s_word s_word s_word s_word
word word ptr ptr word long) StretchDIBits s_word s_word ptr ptr word long) StretchDIBits16
440 pascal16 SetDIBits(word word word word ptr ptr word) SetDIBits 440 pascal16 SetDIBits(word word word word ptr ptr word) SetDIBits
441 pascal16 GetDIBits(word word word word ptr ptr word) GetDIBits 441 pascal16 GetDIBits(word word word word ptr ptr word) GetDIBits
442 pascal16 CreateDIBitmap(word ptr long ptr ptr word) CreateDIBitmap 442 pascal16 CreateDIBitmap(word ptr long ptr ptr word) CreateDIBitmap

View File

@ -236,9 +236,9 @@ base 1
0228 stub GetTextExtentExPointA 0228 stub GetTextExtentExPointA
0229 stub GetTextExtentExPointW 0229 stub GetTextExtentExPointW
0230 stdcall GetTextExtentPoint32A(long ptr long ptr) GetTextExtentPoint32A 0230 stdcall GetTextExtentPoint32A(long ptr long ptr) GetTextExtentPoint32A
0231 stub GetTextExtentPoint32W 0231 stdcall GetTextExtentPoint32W(long ptr long ptr) GetTextExtentPoint32W
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32A 0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32ABuggy
0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32W 0233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32WBuggy
0234 stdcall GetTextFaceA(long long ptr) GetTextFace 0234 stdcall GetTextFaceA(long long ptr) GetTextFace
0235 stub GetTextFaceW 0235 stub GetTextFaceW
0236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A 0236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A
@ -358,8 +358,8 @@ base 1
0349 stub StartPage 0349 stub StartPage
0350 stdcall StretchBlt(long long long long long long long long long long long) 0350 stdcall StretchBlt(long long long long long long long long long long long)
StretchBlt32 StretchBlt32
0351 stdcall StretchDIBits(long long long long long long long 0351 stdcall StretchDIBits(long long long long long long long long long
long long long long long long) StretchDIBits ptr ptr long long) StretchDIBits32
0352 stub StrokeAndFillPath 0352 stub StrokeAndFillPath
0353 stub StrokePath 0353 stub StrokePath
0354 stub SwapBuffers 0354 stub SwapBuffers

View File

@ -122,7 +122,7 @@ heap 65520
120 pascal GetMessageTime() GetMessageTime 120 pascal GetMessageTime() GetMessageTime
121 pascal SetWindowsHook(s_word segptr) THUNK_SetWindowsHook16 121 pascal SetWindowsHook(s_word segptr) THUNK_SetWindowsHook16
122 pascal CallWindowProc(segptr word word word long) CallWindowProc16 122 pascal CallWindowProc(segptr word word word long) CallWindowProc16
123 pascal16 CallMsgFilter(segptr s_word) CallMsgFilter 123 pascal16 CallMsgFilter(segptr s_word) CallMsgFilter16
124 pascal16 UpdateWindow(word) UpdateWindow 124 pascal16 UpdateWindow(word) UpdateWindow
125 pascal16 InvalidateRect(word ptr word) InvalidateRect16 125 pascal16 InvalidateRect(word ptr word) InvalidateRect16
126 pascal16 InvalidateRgn(word word word) InvalidateRgn 126 pascal16 InvalidateRgn(word word word) InvalidateRgn
@ -235,7 +235,7 @@ heap 65520
232 pascal16 SetWindowPos(word word word word word word word) SetWindowPos 232 pascal16 SetWindowPos(word word word word word word word) SetWindowPos
233 pascal16 SetParent(word word) SetParent 233 pascal16 SetParent(word word) SetParent
234 pascal16 UnhookWindowsHook(s_word segptr) THUNK_UnhookWindowsHook16 234 pascal16 UnhookWindowsHook(s_word segptr) THUNK_UnhookWindowsHook16
235 pascal DefHookProc(s_word word long ptr) DefHookProc 235 pascal DefHookProc(s_word word long ptr) DefHookProc16
236 pascal16 GetCapture() GetCapture16 236 pascal16 GetCapture() GetCapture16
237 pascal16 GetUpdateRgn(word word word) GetUpdateRgn 237 pascal16 GetUpdateRgn(word word word) GetUpdateRgn
238 pascal16 ExcludeUpdateRgn(word word) ExcludeUpdateRgn 238 pascal16 ExcludeUpdateRgn(word word) ExcludeUpdateRgn
@ -296,7 +296,7 @@ heap 65520
290 pascal16 RedrawWindow(word ptr word word) RedrawWindow16 290 pascal16 RedrawWindow(word ptr word word) RedrawWindow16
291 pascal SetWindowsHookEx(s_word segptr word word) THUNK_SetWindowsHookEx16 291 pascal SetWindowsHookEx(s_word segptr word word) THUNK_SetWindowsHookEx16
292 pascal16 UnhookWindowsHookEx(segptr) THUNK_UnhookWindowsHookEx16 292 pascal16 UnhookWindowsHookEx(segptr) THUNK_UnhookWindowsHookEx16
293 pascal CallNextHookEx(segptr s_word word long) CallNextHookEx 293 pascal CallNextHookEx(segptr s_word word long) CallNextHookEx16
294 stub LockWindowUpdate 294 stub LockWindowUpdate
299 register Mouse_Event() Mouse_Event 299 register Mouse_Event() Mouse_Event
300 stub UnloadInstalledDrivers 300 stub UnloadInstalledDrivers

View File

@ -16,9 +16,9 @@ base 1
0011 stub BroadcastSystemMessage 0011 stub BroadcastSystemMessage
0012 stub CalcChildScroll 0012 stub CalcChildScroll
0013 stub CallMsgFilter 0013 stub CallMsgFilter
0014 stub CallMsgFilterA 0014 stdcall CallMsgFilterA(ptr long) CallMsgFilter32A
0015 stub CallMsgFilterW 0015 stdcall CallMsgFilterW(ptr long) CallMsgFilter32W
0016 stub CallNextHookEx 0016 stdcall CallNextHookEx(long long long long) CallNextHookEx32
0017 stdcall CallWindowProcA(ptr long long long long) CallWindowProc32A 0017 stdcall CallWindowProcA(ptr long long long long) CallWindowProc32A
0018 stdcall CallWindowProcW(ptr long long long long) CallWindowProc32W 0018 stdcall CallWindowProcW(ptr long long long long) CallWindowProc32W
0019 stub CascadeChildWindows 0019 stub CascadeChildWindows
@ -530,8 +530,8 @@ base 1
0523 stdcall SetWindowWord(long long long) SetWindowWord 0523 stdcall SetWindowWord(long long long) SetWindowWord
0524 stdcall SetWindowsHookA(long ptr) SetWindowsHook32A 0524 stdcall SetWindowsHookA(long ptr) SetWindowsHook32A
0525 stdcall SetWindowsHookExA(long long long long) SetWindowsHookEx32A 0525 stdcall SetWindowsHookExA(long long long long) SetWindowsHookEx32A
0526 stub SetWindowsHookExW 0526 stdcall SetWindowsHookExW(long long long long) SetWindowsHookEx32W
0527 stub SetWindowsHookW 0527 stdcall SetWindowsHookW(long long long long) SetWindowsHook32W
0528 stdcall ShowCaret(long) ShowCaret 0528 stdcall ShowCaret(long) ShowCaret
0529 stdcall ShowCursor(long) ShowCursor 0529 stdcall ShowCursor(long) ShowCursor
0530 stub ShowOwnedPopups 0530 stub ShowOwnedPopups
@ -560,7 +560,7 @@ base 1
0553 stub TranslateCharsetInfo 0553 stub TranslateCharsetInfo
0554 stub TranslateMDISysAccel 0554 stub TranslateMDISysAccel
0555 stdcall TranslateMessage(ptr) USER32_TranslateMessage 0555 stdcall TranslateMessage(ptr) USER32_TranslateMessage
0556 stub UnhookWindowsHook 0556 stdcall UnhookWindowsHook(long ptr) UnhookWindowsHook32
0557 stdcall UnhookWindowsHookEx(long) UnhookWindowsHookEx32 0557 stdcall UnhookWindowsHookEx(long) UnhookWindowsHookEx32
0558 stdcall UnionRect(ptr ptr ptr) UnionRect32 0558 stdcall UnionRect(ptr ptr ptr) UnionRect32
0559 stub UnloadKeyboardLayout 0559 stub UnloadKeyboardLayout

View File

@ -1,17 +1,16 @@
name wing name wing
type win16 type win16
1001 pascal16 WinGCreateDC() WinGCreateDC16 1001 pascal16 WINGCREATEDC() WinGCreateDC16
1002 pascal16 WinGRecommendDIBFormat(ptr) WinGRecommendDIBFormat16 1002 pascal16 WINGRECOMMENDDIBFORMAT(ptr) WinGRecommendDIBFormat16
1003 pascal16 WinGCreateBitmap(word ptr ptr) WinGCreateBitmap16 1003 pascal16 WINGCREATEBITMAP(word ptr ptr) WinGCreateBitmap16
1004 stub WINGGETDIBPOINTER 1004 pascal WINGGETDIBPOINTER(word ptr) WinGGetDIBPointer16
1005 stub WINGGETDIBCOLORTABLE 1005 pascal16 WINGGETDIBCOLORTABLE(word word word ptr) WinGGetDIBColorTable16
1006 stub WINGSETDIBCOLORTABLE 1006 pascal16 WINGSETDIBCOLORTABLE(word word word ptr) WinGSetDIBColorTable16
1007 pascal16 WinGCreateHalfTonePalette() WinGCreateHalfTonePalette16 1007 pascal16 WINGCREATEHALFTONEPALETTE() WinGCreateHalfTonePalette16
1008 pascal16 WinGCreateHalfToneBrush(word long word) WinGCreateHalfToneBrush16 1008 pascal16 WINGCREATEHALFTONEBRUSH(word word word) WinGCreateHalfToneBrush16
1009 stub WINGSTRETCHBLT 1009 pascal16 WINGSTRETCHBLT(word word word word word word word word word word) WinGStretchBlt16
# Probably much like BitBlt16... but, without the last field (what value?) 1010 pascal16 WINGBITBLT(word word word word word word word word) WinGBitBlt16
1010 stub WINGBITBLT
# Seem that 1299 is the limit... weird... # Seem that 1299 is the limit... weird...
#1500 stub WINGINITIALIZETHUNK16 #1500 stub WINGINITIALIZETHUNK16

View File

@ -14,20 +14,29 @@
* This structure is stored into the window extra bytes (cbWndExtra). * This structure is stored into the window extra bytes (cbWndExtra).
* sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30). * sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
*/ */
#pragma pack(1)
typedef struct typedef struct
{ {
INT32 msgResult; /* Result of EndDialog() / Default button id */ INT32 msgResult; /* +00 Last message result */
HWINDOWPROC dlgProc; /* Dialog procedure */ HWINDOWPROC dlgProc; /* +04 Dialog procedure */
LONG userInfo; /* User information (for DWL_USER) */ LONG userInfo; /* +08 User information (for DWL_USER) */
/* implementation-dependent part */
HWND16 hwndFocus; /* Current control with focus */ HWND16 hwndFocus; /* Current control with focus */
HFONT16 hUserFont; /* Dialog font */ HFONT16 hUserFont; /* Dialog font */
HMENU16 hMenu; /* Dialog menu */ HMENU16 hMenu; /* Dialog menu */
WORD xBaseUnit; /* Dialog units (depends on the font) */ WORD xBaseUnit; /* Dialog units (depends on the font) */
WORD yBaseUnit; WORD yBaseUnit;
INT32 idResult; /* EndDialog() result / default pushbutton ID */
WORD fEnd; /* EndDialog() called for this dialog */ WORD fEnd; /* EndDialog() called for this dialog */
HGLOBAL16 hDialogHeap; HGLOBAL16 hDialogHeap;
} DIALOGINFO; } DIALOGINFO;
#pragma pack(4)
extern BOOL32 DIALOG_Init(void); extern BOOL32 DIALOG_Init(void);
#endif /* DIALOG_H */ #endif /* DIALOG_H */

View File

@ -9,12 +9,23 @@
#include "windows.h" #include "windows.h"
extern HANDLE16 HOOK_GetHook( INT16 id , HQUEUE16 hQueue ); #define HOOK_WIN16 0x0
extern LRESULT HOOK_CallHooks( INT16 id, INT16 code, #define HOOK_WIN32 0x1
WPARAM16 wParam, LPARAM lParam ); #define HOOK_UNICODE 0x2
extern HOOKPROC16 HOOK_GetProc16( HHOOK hook );
extern void HOOK_ResetQueueHooks( HQUEUE16 hQueue ); #define HOOK_MAPTYPE (HOOK_WIN32 | HOOK_UNICODE)
extern HOOKPROC16 HOOK_GetProc16( HHOOK hhook );
extern BOOL32 HOOK_IsHooked( INT16 id );
extern LRESULT HOOK_CallHooks16( INT16 id, INT16 code, WPARAM16 wParam,
LPARAM lParam );
extern LRESULT HOOK_CallHooks32A( INT32 id, INT32 code, WPARAM32 wParam,
LPARAM lParam );
extern LRESULT HOOK_CallHooks32W( INT32 id, INT32 code, WPARAM32 wParam,
LPARAM lParam );
extern void HOOK_FreeModuleHooks( HMODULE16 hModule ); extern void HOOK_FreeModuleHooks( HMODULE16 hModule );
extern void HOOK_FreeQueueHooks( HQUEUE16 hQueue ); extern void HOOK_FreeQueueHooks( HQUEUE16 hQueue );
extern void HOOK_ResetQueueHooks( HQUEUE16 hQueue );
extern HOOKPROC32 HOOK_GetProc( HHOOK hook );
#endif /* __WINE_HOOK_H */ #endif /* __WINE_HOOK_H */

View File

@ -583,15 +583,16 @@ typedef struct
{ {
BOOL16 fMouse; BOOL16 fMouse;
HWND16 hWndActive; HWND16 hWndActive;
} CBTACTIVATESTRUCT16; } CBTACTIVATESTRUCT16, *LPCBTACTIVATESTRUCT16;
typedef struct typedef struct
{ {
BOOL32 fMouse; BOOL32 fMouse;
HWND32 hWndActive; HWND32 hWndActive;
} CBTACTIVATESTRUCT32; } CBTACTIVATESTRUCT32, *LPCBTACTIVATESTRUCT32;
DECL_WINELIB_TYPE(CBTACTIVATESTRUCT); DECL_WINELIB_TYPE(CBTACTIVATESTRUCT);
DECL_WINELIB_TYPE(LPCBTACTIVATESTRUCT);
/* Shell hook values */ /* Shell hook values */
#define HSHELL_WINDOWCREATED 1 #define HSHELL_WINDOWCREATED 1
@ -977,6 +978,8 @@ typedef struct
#define DEFAULT_CHARSET 1 #define DEFAULT_CHARSET 1
#define SYMBOL_CHARSET 2 #define SYMBOL_CHARSET 2
#define SHIFTJIS_CHARSET 128 #define SHIFTJIS_CHARSET 128
#define HANGEUL_CHARSET 129
#define CHINESEBIG5_CHARSET 136
#define OEM_CHARSET 255 #define OEM_CHARSET 255
/* lfOutPrecision values */ /* lfOutPrecision values */
@ -4063,16 +4066,20 @@ HRSRC32 FindResourceEx32A(HINSTANCE32,LPCSTR,LPCSTR,WORD);
HRSRC32 FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD); HRSRC32 FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
#define FindResourceEx WINELIB_NAME_AW(FindResourceEx) #define FindResourceEx WINELIB_NAME_AW(FindResourceEx)
BOOL32 FlushFileBuffers(HFILE); BOOL32 FlushFileBuffers(HFILE);
UINT32 GetACP(void);
LPCSTR GetCommandLine32A(); LPCSTR GetCommandLine32A();
LPCWSTR GetCommandLine32W(); LPCWSTR GetCommandLine32W();
#define GetCommandLine WINELIB_NAME_AW(GetCommandLine) #define GetCommandLine WINELIB_NAME_AW(GetCommandLine)
BOOL32 GetCommTimeouts(INT32,LPCOMMTIMEOUTS); BOOL32 GetCommTimeouts(INT32,LPCOMMTIMEOUTS);
DWORD GetCurrentThreadId(void);
HANDLE32 GetCurrentThread(void);
BOOL32 GetDCOrgEx(HDC32,LPPOINT32); BOOL32 GetDCOrgEx(HDC32,LPPOINT32);
DWORD GetFileInformationByHandle(HFILE,BY_HANDLE_FILE_INFORMATION*); DWORD GetFileInformationByHandle(HFILE,BY_HANDLE_FILE_INFORMATION*);
DWORD GetFileSize(HFILE,LPDWORD); DWORD GetFileSize(HFILE,LPDWORD);
DWORD GetFileType(HFILE); DWORD GetFileType(HFILE);
VOID GetLocalTime(LPSYSTEMTIME); VOID GetLocalTime(LPSYSTEMTIME);
DWORD GetLogicalDrives(void); DWORD GetLogicalDrives(void);
UINT32 GetOEMCP(void);
HANDLE32 GetProcessHeap(void); HANDLE32 GetProcessHeap(void);
DWORD GetShortPathName32A(LPCSTR,LPSTR,DWORD); DWORD GetShortPathName32A(LPCSTR,LPSTR,DWORD);
DWORD GetShortPathName32W(LPCWSTR,LPWSTR,DWORD); DWORD GetShortPathName32W(LPCWSTR,LPWSTR,DWORD);
@ -4228,6 +4235,9 @@ BOOL32 BuildCommDCB32W(LPCWSTR,LPDCB32);
BOOL32 BuildCommDCBAndTimeouts32A(LPCSTR,LPDCB32,LPCOMMTIMEOUTS); BOOL32 BuildCommDCBAndTimeouts32A(LPCSTR,LPDCB32,LPCOMMTIMEOUTS);
BOOL32 BuildCommDCBAndTimeouts32W(LPCWSTR,LPDCB32,LPCOMMTIMEOUTS); BOOL32 BuildCommDCBAndTimeouts32W(LPCWSTR,LPDCB32,LPCOMMTIMEOUTS);
#define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts) #define BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
LRESULT CallNextHookEx16(HHOOK,INT16,WPARAM16,LPARAM);
LRESULT CallNextHookEx32(HHOOK,INT32,WPARAM32,LPARAM);
#define CallNextHookEx WINELIB_NAME(CallNextHookEx)
LRESULT CallWindowProc16(WNDPROC16,HWND16,UINT16,WPARAM16,LPARAM); LRESULT CallWindowProc16(WNDPROC16,HWND16,UINT16,WPARAM16,LPARAM);
LRESULT CallWindowProc32A(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM); LRESULT CallWindowProc32A(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM);
LRESULT CallWindowProc32W(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM); LRESULT CallWindowProc32W(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM);
@ -4403,6 +4413,10 @@ LRESULT DefFrameProc16(HWND16,HWND16,UINT16,WPARAM16,LPARAM);
LRESULT DefFrameProc32A(HWND32,HWND32,UINT32,WPARAM32,LPARAM); LRESULT DefFrameProc32A(HWND32,HWND32,UINT32,WPARAM32,LPARAM);
LRESULT DefFrameProc32W(HWND32,HWND32,UINT32,WPARAM32,LPARAM); LRESULT DefFrameProc32W(HWND32,HWND32,UINT32,WPARAM32,LPARAM);
#define DefFrameProc WINELIB_NAME_AW(DefFrameProc) #define DefFrameProc WINELIB_NAME_AW(DefFrameProc)
LRESULT DefHookProc16(INT16,WPARAM16,LPARAM,HHOOK*);
#define DefHookProc32(code,wparam,lparam,phhook) \
CallNextHookEx32(*(phhook),code,wparam,lparam)
#define DefHookProc WINELIB_NAME(DefHookProc)
LRESULT DefMDIChildProc16(HWND16,UINT16,WPARAM16,LPARAM); LRESULT DefMDIChildProc16(HWND16,UINT16,WPARAM16,LPARAM);
LRESULT DefMDIChildProc32A(HWND32,UINT32,WPARAM32,LPARAM); LRESULT DefMDIChildProc32A(HWND32,UINT32,WPARAM32,LPARAM);
LRESULT DefMDIChildProc32W(HWND32,UINT32,WPARAM32,LPARAM); LRESULT DefMDIChildProc32W(HWND32,UINT32,WPARAM32,LPARAM);
@ -5294,6 +5308,9 @@ BOOL16 StretchBlt16(HDC16,INT16,INT16,INT16,INT16,HDC16,INT16,INT16,
BOOL32 StretchBlt32(HDC32,INT32,INT32,INT32,INT32,HDC32,INT32,INT32, BOOL32 StretchBlt32(HDC32,INT32,INT32,INT32,INT32,HDC32,INT32,INT32,
INT32,INT32,DWORD); INT32,INT32,DWORD);
#define StretchBlt WINELIB_NAME(StretchBlt) #define StretchBlt WINELIB_NAME(StretchBlt)
INT16 StretchDIBits16(HDC16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,const VOID*,const BITMAPINFO*,UINT16,DWORD);
INT32 StretchDIBits32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,const VOID*,const BITMAPINFO*,UINT32,DWORD);
#define StretchDIBits WINELIB_NAME(StretchDIBits)
BOOL16 SubtractRect16(LPRECT16,const RECT16*,const RECT16*); BOOL16 SubtractRect16(LPRECT16,const RECT16*,const RECT16*);
BOOL32 SubtractRect32(LPRECT32,const RECT32*,const RECT32*); BOOL32 SubtractRect32(LPRECT32,const RECT32*,const RECT32*);
#define SubtractRect WINELIB_NAME(SubtractRect) #define SubtractRect WINELIB_NAME(SubtractRect)
@ -5468,7 +5485,6 @@ HDWP16 BeginDeferWindowPos(INT);
BOOL BringWindowToTop(HWND); BOOL BringWindowToTop(HWND);
void CalcChildScroll(HWND,WORD); void CalcChildScroll(HWND,WORD);
BOOL CallMsgFilter(SEGPTR,INT); BOOL CallMsgFilter(SEGPTR,INT);
LRESULT CallNextHookEx(HHOOK,INT,WPARAM16,LPARAM);
BOOL ChangeClipboardChain(HWND,HWND); BOOL ChangeClipboardChain(HWND,HWND);
INT CheckMenuItem(HMENU16,UINT,UINT); INT CheckMenuItem(HMENU16,UINT,UINT);
BOOL CloseClipboard(void); BOOL CloseClipboard(void);
@ -5488,7 +5504,6 @@ HICON16 CreateIcon(HINSTANCE16,INT,INT,BYTE,BYTE,const BYTE*,const BYTE*);
HMENU16 CreateMenu(void); HMENU16 CreateMenu(void);
HPALETTE16 CreatePalette(const LOGPALETTE*); HPALETTE16 CreatePalette(const LOGPALETTE*);
HMENU16 CreatePopupMenu(void); HMENU16 CreatePopupMenu(void);
DWORD DefHookProc(short,WORD,DWORD,HHOOK*);
HDWP16 DeferWindowPos(HDWP16,HWND,HWND,INT,INT,INT,INT,UINT); HDWP16 DeferWindowPos(HDWP16,HWND,HWND,INT,INT,INT,INT,UINT);
ATOM DeleteAtom(ATOM); ATOM DeleteAtom(ATOM);
BOOL DeleteDC(HDC16); BOOL DeleteDC(HDC16);
@ -5716,7 +5731,6 @@ BOOL ShowWindow(HWND,int);
DWORD SizeofResource(HMODULE16,HRSRC16); DWORD SizeofResource(HMODULE16,HRSRC16);
int StartSound(void); int StartSound(void);
int StopSound(void); int StopSound(void);
int StretchDIBits(HDC16,WORD,WORD,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD,DWORD);
BOOL SwapMouseButton(BOOL); BOOL SwapMouseButton(BOOL);
void SwapRecording(WORD); void SwapRecording(WORD);
int SyncAllVoices(void); int SyncAllVoices(void);

View File

@ -16,9 +16,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include "windows.h" #include "windows.h"
#ifndef WINELIB #pragma pack(1)
#pragma pack(1) /* tight alignment for the emulator */
#endif
/* Win16 socket-related types */ /* Win16 socket-related types */
@ -135,9 +133,7 @@ typedef struct WSAData {
SEGPTR lpVendorInfo; SEGPTR lpVendorInfo;
} WSADATA, *LPWSADATA; } WSADATA, *LPWSADATA;
#ifndef WINELIB
#pragma pack(4) #pragma pack(4)
#endif
/* ----------------------------------- no Win16 structure defs beyond this line! */ /* ----------------------------------- no Win16 structure defs beyond this line! */

View File

@ -3,16 +3,26 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .. TOPOBJDIR = ..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = library MODULE = none
LIBMODULE = library
C_SRCS = \ LIB_SRCS = \
arch.c \ arch.c \
libres.c \ libres.c \
miscstubs.c \ miscstubs.c \
sup.c \ sup.c
winmain.c
all: $(MODULE).o STUB_SRCS = winestub.c
LIB_OBJS = $(LIB_SRCS:.c=.o)
STUB_OBJS = $(STUB_SRCS:.c=.o)
C_SRCS = $(LIB_SRCS) $(STUB_SRCS)
all: $(LIBMODULE).o $(STUB_OBJS)
$(LIBMODULE).o: $(LIB_OBJS)
$(LDCOMBINE) $(LIB_OBJS) -o $(LIBMODULE).o
@MAKE_RULES@ @MAKE_RULES@

View File

@ -1,18 +1,51 @@
/* Sample winestub.c file for compiling programs with libwine.so. */ /* Sample winestub.c file for compiling programs with libwine.so. */
#include <string.h>
#include "windows.h" #include "windows.h"
#ifdef WIN_DEBUG #include "xmalloc.h"
#include <stdio.h>
#endif
extern int PASCAL WinMain(HINSTANCE,HINSTANCE,LPSTR,int); extern int WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int);
extern int MAIN_Init(void);
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
extern void TASK_Reschedule(void);
int main( int argc, char *argv [] )
{
HINSTANCE16 hInstance;
LPSTR lpszCmdParam;
int i, len = 0;
MAIN_WineInit( &argc, argv );
/* Alloc szCmdParam */
for (i = 1; i < argc; i++) len += strlen(argv[i]) + 1;
lpszCmdParam = (LPSTR) xmalloc(len + 1);
/* Concatenate arguments */
if (argc > 1) strcpy(lpszCmdParam, argv[1]);
else lpszCmdParam[0] = '\0';
for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]);
if(!MAIN_Init()) return 0; /* JBP: Needed for DosDrives[] structure, etc. */
hInstance = WinExec( *argv, SW_SHOWNORMAL );
TASK_Reschedule();
InitApp( hInstance );
return WinMain (hInstance, /* hInstance */
0, /* hPrevInstance */
lpszCmdParam, /* lpszCmdParam */
SW_NORMAL); /* nCmdShow */
}
#if 0
extern int WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int);
/* This is the renamed main() subroutine in misc/main.c. */ /* This is the renamed main() subroutine in misc/main.c. */
/* Note that the libdll `init()' won't work: */ /* Note that the libdll `init()' won't work: */
extern HINSTANCE _wine_main(int, char *[]); extern HINSTANCE32 _wine_main(int, char *[]);
int main (int argc, char *argv []) int main (int argc, char *argv [])
{ {
HINSTANCE hInstance; HINSTANCE32 hInstance;
char szCmdParam[256] = {0}; char szCmdParam[256] = {0};
int index, buffer_pos; int index, buffer_pos;
char *arg_holder; char *arg_holder;
@ -22,7 +55,7 @@ int main (int argc, char *argv [])
char *wine_argv[] = {argv[0], ""}; char *wine_argv[] = {argv[0], ""};
/* Initialize the library dll: */ /* Initialize the library dll: */
hInstance = (HINSTANCE)_wine_main((sizeof(wine_argv)/sizeof(char *))-1, wine_argv); hInstance = (HINSTANCE32)_wine_main((sizeof(wine_argv)/sizeof(char *))-1, wine_argv);
#ifdef WIN_DEBUG #ifdef WIN_DEBUG
fprintf(stderr,"In winestub, reporting hInstance = %d\n", hInstance); fprintf(stderr,"In winestub, reporting hInstance = %d\n", hInstance);
@ -49,3 +82,4 @@ int main (int argc, char *argv [])
(LPSTR)szCmdParam, /* lpszCmdParam */ (LPSTR)szCmdParam, /* lpszCmdParam */
SW_NORMAL); /* nCmdShow */ SW_NORMAL); /* nCmdShow */
} }
#endif

View File

@ -1,41 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include "windows.h"
#include "xmalloc.h"
extern int MAIN_Init(void);
extern BOOL WIDGETS_Init(void);
extern BOOL WIN_CreateDesktopWindow(void);
extern int WinMain(HINSTANCE16,HINSTANCE16,LPSTR,int);
extern void TASK_Reschedule(void);
int _WinMain (int argc, char *argv [])
{
HINSTANCE16 hInstance;
LPSTR lpszCmdParam;
int i, len = 0;
/* Alloc szCmdParam */
for (i = 1; i < argc; i++) len += strlen(argv[i]) + 1;
lpszCmdParam = (LPSTR) xmalloc(len + 1);
/* Concatenate arguments */
if (argc > 1) strcpy(lpszCmdParam, argv[1]);
else lpszCmdParam[0] = '\0';
for (i = 2; i < argc; i++) strcat(strcat(lpszCmdParam, " "), argv[i]);
if(!MAIN_Init()) return 0; /* JBP: Needed for DosDrives[] structure, etc. */
hInstance = WinExec( *argv, SW_SHOWNORMAL );
TASK_Reschedule();
InitApp( hInstance );
#ifdef WINELIBDLL
return (int)hInstance;
#else
return WinMain (hInstance, /* hInstance */
0, /* hPrevInstance */
lpszCmdParam, /* lpszCmdParam */
SW_NORMAL); /* nCmdShow */
#endif
}

View File

@ -163,12 +163,15 @@ int MAIN_Init(void)
/********************************************************************** /**********************************************************************
* main * main
*/ */
int _WinMain(int argc, char **argv) int main(int argc, char *argv[] )
{ {
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
int i; int i;
HINSTANCE16 handle; HINSTANCE16 handle;
if (!MAIN_Init()) return 0; if (!MAIN_WineInit( &argc, argv )) return 1;
if (!MAIN_Init()) return 1;
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
@ -182,7 +185,7 @@ int _WinMain(int argc, char **argv)
case 21: fprintf( stderr, "win32 executable\n" ); break; case 21: fprintf( stderr, "win32 executable\n" ); break;
default: fprintf( stderr, "error=%d\n", handle ); break; default: fprintf( stderr, "error=%d\n", handle ); break;
} }
exit(1); return 1;
} }
} }

View File

@ -772,7 +772,7 @@ void TASK_Reschedule(void)
/* extract hardware events only! */ /* extract hardware events only! */
EVENT_WaitXEvent( FALSE, TRUE ); if (!hTask) EVENT_WaitXEvent( FALSE, TRUE );
while (!hTask) while (!hTask)
{ {

View File

@ -606,15 +606,12 @@ static void called_at_exit(void)
} }
/*********************************************************************** /***********************************************************************
* main * MAIN_WineInit
*
* Wine initialisation and command-line parsing
*/ */
#if defined(WINELIB) && defined(WINELIBDLL) BOOL32 MAIN_WineInit( int *argc, char *argv[] )
int _wine_main (int argc, char *argv[])
#else
int main( int argc, char *argv[] )
#endif
{ {
int ret_val;
int depth_count, i; int depth_count, i;
int *depth_list; int *depth_list;
struct timeval tv; struct timeval tv;
@ -645,7 +642,7 @@ int main( int argc, char *argv[] )
XrmInitialize(); XrmInitialize();
MAIN_ParseOptions( &argc, argv ); MAIN_ParseOptions( argc, argv );
if (Options.desktopGeometry && Options.managed) if (Options.desktopGeometry && Options.managed)
{ {
@ -672,15 +669,12 @@ int main( int argc, char *argv[] )
} }
else screenDepth = DefaultDepthOfScreen( screen ); else screenDepth = DefaultDepthOfScreen( screen );
if (Options.synchronous) XSynchronize( display, True ); if (Options.synchronous) XSynchronize( display, True );
if (Options.desktopGeometry) MAIN_CreateDesktop( argc, argv ); if (Options.desktopGeometry) MAIN_CreateDesktop( *argc, argv );
else rootWindow = DefaultRootWindow( display ); else rootWindow = DefaultRootWindow( display );
MAIN_SaveSetup(); MAIN_SaveSetup();
atexit(called_at_exit); atexit(called_at_exit);
return TRUE;
ret_val = _WinMain( argc, argv );
return ret_val;
} }
@ -1063,7 +1057,8 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
XKeyboardControl keyboard_value; XKeyboardControl keyboard_value;
switch (uAction) { switch (uAction)
{
case SPI_GETBEEP: case SPI_GETBEEP:
XGetKeyboardControl(display, &keyboard_state); XGetKeyboardControl(display, &keyboard_state);
if (keyboard_state.bell_percent == 0) if (keyboard_state.bell_percent == 0)
@ -1089,20 +1084,22 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
1 ); 1 );
break; break;
case SPI_GETICONTITLEWRAP: case SPI_GETICONTITLEWRAP:
*(BOOL *) lpvParam = FALSE; *(BOOL *) lpvParam = GetProfileInt32A( "desktop",
/* FIXME GetProfileInt32A( "desktop", "?", True ) */ "IconTitleWrap",
break; TRUE );
break;
case SPI_GETKEYBOARDDELAY: case SPI_GETKEYBOARDDELAY:
*(INT *) lpvParam = 1; *(INT *) lpvParam = GetProfileInt32A( "keyboard",
/* FIXME */ "KeyboardDelay", 1 );
break; break;
case SPI_GETKEYBOARDSPEED: case SPI_GETKEYBOARDSPEED:
*(WORD *) lpvParam = 30; *(WORD *) lpvParam = GetProfileInt32A( "keyboard",
/* FIXME */ "KeyboardSpeed",
break; 30 );
break;
case SPI_GETMENUDROPALIGNMENT: case SPI_GETMENUDROPALIGNMENT:
*(BOOL *) lpvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); /* XXX check this */ *(BOOL *) lpvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); /* XXX check this */
@ -1174,19 +1171,21 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
case SPI_GETICONTITLELOGFONT: case SPI_GETICONTITLELOGFONT:
{ {
/* FIXME GetProfileString32A( "?", "?", "?" ) */ /* FIXME GetProfileString32A( "?", "?", "?" ) */
LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam; LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
lpLogFont->lfHeight = 10; lpLogFont->lfHeight = 10;
lpLogFont->lfWidth = 0; lpLogFont->lfWidth = 0;
lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0; lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
lpLogFont->lfWeight = FW_NORMAL; lpLogFont->lfWeight = FW_NORMAL;
lpLogFont->lfItalic = lpLogFont->lfStrikeOut = lpLogFont->lfUnderline = FALSE; lpLogFont->lfItalic = FALSE;
lpLogFont->lfCharSet = ANSI_CHARSET; lpLogFont->lfStrikeOut = FALSE;
lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS; lpLogFont->lfUnderline = FALSE;
lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS; lpLogFont->lfCharSet = ANSI_CHARSET;
lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS; lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
break; lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
} lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
break;
}
case SPI_LANGDRIVER: case SPI_LANGDRIVER:
case SPI_SETBORDER: case SPI_SETBORDER:

View File

@ -174,24 +174,68 @@ static void fd_set_normalize(fd_set* fds, LPWSINFO pwsi, ws_fd_set* ws, int* hig
} }
} }
static void fd_set_update(LPWSINFO pwsi, fd_set* fds, ws_fd_set* ws) /*
* Note weirdness here: sockets with errors belong in exceptfds, but
* are given to us in readfds or writefds, so move them to exceptfds if
* there is an error. Note that this means that exceptfds may have mysterious
* sockets set in it that the program never asked for.
*/
static int inline sock_error_p(int s)
{ {
if( ws ) unsigned int optval, optlen;
{
int i, j, count = ws->fd_count; optlen = sizeof(optval);
ws_socket* pws; getsockopt(s, SOL_SOCKET, SO_ERROR, &optval, &optlen);
for( i = 0, j = 0; i < count; i++ ) if (optval) dprintf_winsock(stddeb, "error: %d\n", optval);
return optval != 0;
}
static void fd_set_update(LPWSINFO pwsi, fd_set* fds, ws_fd_set* ws,
fd_set *errorfds)
{
if( ws )
{ {
pws = (ws_socket*)WS_HANDLE2PTR(ws->fd_array[i]); int i, j, count = ws->fd_count;
if( _check_ws(pwsi, pws) )
if( FD_ISSET(pws->fd, fds) ) for( i = 0, j = 0; i < count; i++ )
{ {
ws->fd_array[j++] = ws->fd_array[i]; ws_socket *pws = (ws_socket*)WS_HANDLE2PTR(ws->fd_array[i]);
continue; int fd = pws->fd;
}
ws->fd_count--; if( _check_ws(pwsi, pws) && FD_ISSET(fd, fds) )
{
/* if error, move to errorfds */
if (errorfds && (FD_ISSET(fd, errorfds) || sock_error_p(fd)))
FD_SET(fd, errorfds);
else
ws->fd_array[j++] = ws->fd_array[i];
}
}
ws->fd_count = j;
dprintf_winsock(stddeb, "\n");
} }
} return;
}
static void fd_set_update_except(LPWSINFO pwsi, fd_set *fds, ws_fd_set *ws,
fd_set *errorfds)
{
if (ws)
{
int i, j, count = ws->fd_count;
for (i=j=0; i < count; i++)
{
ws_socket *pws = (ws_socket *)WS_HANDLE2PTR(ws->fd_array[i]);
if (_check_ws(pwsi, pws) && (FD_ISSET(pws->fd, fds)
|| FD_ISSET(pws->fd, errorfds)))
ws->fd_array[j++] = ws->fd_array[i];
}
ws->fd_count = j;
}
return;
} }
/* ----------------------------------- API ----- /* ----------------------------------- API -----
@ -512,7 +556,7 @@ INT16 WINSOCK_getsockopt(SOCKET16 s, INT16 level,
ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s);
LPWSINFO pwsi = wsi_find(GetCurrentTask()); LPWSINFO pwsi = wsi_find(GetCurrentTask());
dprintf_winsock(stddeb, "WSA_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n", dprintf_winsock(stddeb, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n",
(unsigned)pwsi, s, level, (int) optval, (int) *optlen); (unsigned)pwsi, s, level, (int) optval, (int) *optlen);
if( _check_ws(pwsi, pws) ) if( _check_ws(pwsi, pws) )
@ -662,19 +706,20 @@ INT16 WINSOCK_select(INT16 nfds, ws_fd_set *ws_readfds,
if( pwsi ) if( pwsi )
{ {
int highfd = 0; int highfd = 0;
fd_set readfds, writefds, exceptfds; fd_set readfds, writefds, exceptfds, errorfds;
fd_set_normalize(&readfds, pwsi, ws_readfds, &highfd); fd_set_normalize(&readfds, pwsi, ws_readfds, &highfd);
fd_set_normalize(&writefds, pwsi, ws_writefds, &highfd); fd_set_normalize(&writefds, pwsi, ws_writefds, &highfd);
fd_set_normalize(&exceptfds, pwsi, ws_exceptfds, &highfd); fd_set_normalize(&exceptfds, pwsi, ws_exceptfds, &highfd);
FD_ZERO(&errorfds);
if( (highfd = select(highfd + 1, &readfds, &writefds, &exceptfds, timeout)) >= 0 ) if( (highfd = select(highfd + 1, &readfds, &writefds, &exceptfds, timeout)) >= 0 )
{ {
if( highfd ) if( highfd )
{ {
fd_set_update(pwsi, &readfds, ws_readfds); fd_set_update(pwsi, &readfds, ws_readfds, &errorfds);
fd_set_update(pwsi, &writefds, ws_writefds); fd_set_update(pwsi, &writefds, ws_writefds, &errorfds);
fd_set_update(pwsi, &exceptfds, ws_exceptfds); fd_set_update_except(pwsi, &exceptfds, ws_exceptfds, &errorfds);
} }
return highfd; return highfd;
} }
@ -820,14 +865,19 @@ SOCKET16 WINSOCK_socket(INT16 af, INT16 type, INT16 protocol)
/* printf("created %04x (%i)\n", sock, (UINT16)WS_PTR2HANDLE(pnew)); /* printf("created %04x (%i)\n", sock, (UINT16)WS_PTR2HANDLE(pnew));
*/ */
if( pnew ) return (SOCKET16)WS_PTR2HANDLE(pnew); if( pnew ) return (SOCKET16)WS_PTR2HANDLE(pnew);
else pwsi->errno = WSAENOBUFS; else
{
close(sock);
pwsi->errno = WSAENOBUFS;
return INVALID_SOCKET;
}
} }
if (errno == EPERM) /* raw socket denied */ if (errno == EPERM) /* raw socket denied */
{ {
fprintf(stderr, "WS_SOCKET: not enough privileges\n"); fprintf(stderr, "WS_SOCKET: not enough privileges\n");
pwsi->errno = WSAESOCKTNOSUPPORT; pwsi->errno = WSAESOCKTNOSUPPORT;
} pwsi->errno = wsaErrno(); } else pwsi->errno = wsaErrno();
} }
dprintf_winsock(stddeb, "\t\tfailed!\n"); dprintf_winsock(stddeb, "\t\tfailed!\n");

View File

@ -619,26 +619,40 @@ static int DIB_SetImageBits( DC *dc, WORD lines, WORD depth, LPSTR bits,
/*********************************************************************** /***********************************************************************
* StretchDIBits (GDI.439) * StretchDIBits16 (GDI.439)
*/ */
int StretchDIBits( HDC16 hdc, INT16 StretchDIBits16( HDC16 hdc, INT16 xDst, INT16 yDst, INT16 widthDst,
WORD xDest, WORD yDest, WORD wDestWidth, WORD wDestHeight, INT16 heightDst, INT16 xSrc, INT16 ySrc, INT16 widthSrc,
WORD xSrc, WORD ySrc, WORD wSrcWidth, WORD wSrcHeight, INT16 heightSrc, const VOID *bits,
LPSTR bits, LPBITMAPINFO info, WORD wUsage, DWORD dwRop ) const BITMAPINFO *info, UINT16 wUsage, DWORD dwRop )
{ {
HBITMAP16 hBitmap, hOldBitmap; return (INT16)StretchDIBits32( hdc, xDst, yDst, widthDst, heightDst,
HDC16 hdcMem; xSrc, ySrc, widthSrc, heightSrc, bits,
info, wUsage, dwRop );
}
/***********************************************************************
* StretchDIBits32 (GDI32.351)
*/
INT32 StretchDIBits32( HDC32 hdc, INT32 xDst, INT32 yDst, INT32 widthDst,
INT32 heightDst, INT32 xSrc, INT32 ySrc, INT32 widthSrc,
INT32 heightSrc, const void *bits,
const BITMAPINFO *info, UINT32 wUsage, DWORD dwRop )
{
HBITMAP32 hBitmap, hOldBitmap;
HDC32 hdcMem;
hBitmap = CreateDIBitmap( hdc, &info->bmiHeader, CBM_INIT, hBitmap = CreateDIBitmap( hdc, &info->bmiHeader, CBM_INIT,
bits, info, wUsage ); bits, info, wUsage );
hdcMem = CreateCompatibleDC( hdc ); hdcMem = CreateCompatibleDC( hdc );
hOldBitmap = SelectObject32( hdcMem, hBitmap ); hOldBitmap = SelectObject32( hdcMem, hBitmap );
StretchBlt32( hdc, xDest, yDest, wDestWidth, wDestHeight, StretchBlt32( hdc, xDst, yDst, widthDst, heightDst,
hdcMem, xSrc, ySrc, wSrcWidth, wSrcHeight, dwRop ); hdcMem, xSrc, ySrc, widthSrc, heightSrc, dwRop );
SelectObject32( hdcMem, hOldBitmap ); SelectObject32( hdcMem, hOldBitmap );
DeleteDC( hdcMem ); DeleteDC( hdcMem );
DeleteObject32( hBitmap ); DeleteObject32( hBitmap );
return wSrcHeight; return heightSrc;
} }

View File

@ -320,7 +320,9 @@ void FONT_GetMetrics( LOGFONT16 * logfont, XFontStruct * xfont,
metrics->tmDigitizedAspectX = 1; metrics->tmDigitizedAspectX = 1;
metrics->tmDigitizedAspectY = 1; metrics->tmDigitizedAspectY = 1;
metrics->tmPitchAndFamily = (logfont->lfPitchAndFamily&0xf0)|TMPF_DEVICE; metrics->tmPitchAndFamily = (logfont->lfPitchAndFamily&0xf0)|TMPF_DEVICE;
if (logfont->lfPitchAndFamily & FIXED_PITCH)
/* TMPF_FIXED_PITCH bit means variable pitch...Don't you love Microsoft? */
if (xfont->min_bounds.width != xfont->max_bounds.width)
metrics->tmPitchAndFamily |= TMPF_FIXED_PITCH; metrics->tmPitchAndFamily |= TMPF_FIXED_PITCH;
if (!xfont->per_char) average = metrics->tmMaxCharWidth; if (!xfont->per_char) average = metrics->tmMaxCharWidth;
@ -827,6 +829,10 @@ DWORD GetTextExtent( HDC16 hdc, LPCSTR str, short count )
/*********************************************************************** /***********************************************************************
* GetTextExtentPoint16 (GDI.471) * GetTextExtentPoint16 (GDI.471)
*
* FIXME: Should this have a bug for compatibility?
* Original Windows versions of GetTextExtentPoint{A,W} have documented
* bugs.
*/ */
BOOL16 GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size) BOOL16 GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size)
{ {
@ -838,7 +844,7 @@ BOOL16 GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, LPSIZE16 size)
/*********************************************************************** /***********************************************************************
* GetTextExtentPoint32A (GDI32.232) * GetTextExtentPoint32A (GDI32.230)
*/ */
BOOL32 GetTextExtentPoint32A( HDC32 hdc, LPCSTR str, INT32 count, BOOL32 GetTextExtentPoint32A( HDC32 hdc, LPCSTR str, INT32 count,
LPSIZE32 size ) LPSIZE32 size )
@ -861,7 +867,7 @@ BOOL32 GetTextExtentPoint32A( HDC32 hdc, LPCSTR str, INT32 count,
/*********************************************************************** /***********************************************************************
* GetTextExtentPoint32W (GDI32.233) * GetTextExtentPoint32W (GDI32.231)
*/ */
BOOL32 GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count, BOOL32 GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count,
LPSIZE32 size ) LPSIZE32 size )
@ -872,6 +878,26 @@ BOOL32 GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count,
return ret; return ret;
} }
/***********************************************************************
* GetTextExtentPoint32ABuggy (GDI32.232)
*/
BOOL32 GetTextExtentPoint32ABuggy( HDC32 hdc, LPCSTR str, INT32 count,
LPSIZE32 size )
{
fprintf( stderr, "GetTextExtentPoint32ABuggy: not bug compatible.\n" );
return GetTextExtentPoint32A( hdc, str, count, size );
}
/***********************************************************************
* GetTextExtentPoint32WBuggy (GDI32.233)
*/
BOOL32 GetTextExtentPoint32WBuggy( HDC32 hdc, LPCWSTR str, INT32 count,
LPSIZE32 size )
{
fprintf( stderr, "GetTextExtentPoint32WBuggy: not bug compatible.\n" );
return GetTextExtentPoint32W( hdc, str, count, size );
}
/*********************************************************************** /***********************************************************************
* GetTextMetrics16 (GDI.93) * GetTextMetrics16 (GDI.93)

View File

@ -677,10 +677,10 @@ void PlayMetaFileRecord(HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[11]); LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[11]);
LPSTR bits = MF_GetDIBitsPointer(info); LPSTR bits = MF_GetDIBitsPointer(info);
if (bits) if (bits)
StretchDIBits(hdc,mr->rdParam[10],mr->rdParam[9],mr->rdParam[8], StretchDIBits16(hdc,mr->rdParam[10],mr->rdParam[9],mr->rdParam[8],
mr->rdParam[7],mr->rdParam[6],mr->rdParam[5], mr->rdParam[7],mr->rdParam[6],mr->rdParam[5],
mr->rdParam[4],mr->rdParam[3],bits,info, mr->rdParam[4],mr->rdParam[3],bits,info,
mr->rdParam[2],MAKELONG(mr->rdParam[0],mr->rdParam[1])); mr->rdParam[2],MAKELONG(mr->rdParam[0],mr->rdParam[1]));
} }
break; break;
@ -689,10 +689,10 @@ void PlayMetaFileRecord(HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[10]); LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[10]);
LPSTR bits = MF_GetDIBitsPointer(info); LPSTR bits = MF_GetDIBitsPointer(info);
if (bits) if (bits)
StretchDIBits(hdc,mr->rdParam[9],mr->rdParam[8],mr->rdParam[7], StretchDIBits16(hdc,mr->rdParam[9],mr->rdParam[8],mr->rdParam[7],
mr->rdParam[6],mr->rdParam[5],mr->rdParam[4], mr->rdParam[6],mr->rdParam[5],mr->rdParam[4],
mr->rdParam[3],mr->rdParam[2],bits,info, mr->rdParam[3],mr->rdParam[2],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1])); DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1]));
} }
break; break;
@ -705,7 +705,7 @@ void PlayMetaFileRecord(HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
mr->rdParam[14], /*BitsPixel*/ mr->rdParam[14], /*BitsPixel*/
(LPSTR)&mr->rdParam[15]); /*bits*/ (LPSTR)&mr->rdParam[15]); /*bits*/
SelectObject32(hdcSrc,hbitmap); SelectObject32(hdcSrc,hbitmap);
StretchBlt32(hdc,mr->rdParam[9],mr->rdParam[8], StretchBlt16(hdc,mr->rdParam[9],mr->rdParam[8],
mr->rdParam[7],mr->rdParam[6], mr->rdParam[7],mr->rdParam[6],
hdcSrc,mr->rdParam[5],mr->rdParam[4], hdcSrc,mr->rdParam[5],mr->rdParam[4],
mr->rdParam[3],mr->rdParam[2], mr->rdParam[3],mr->rdParam[2],

View File

@ -86,19 +86,20 @@ static const char *TEXT_NextLine( HDC16 hdc, const char *str, int *count,
case PREFIX: case PREFIX:
if (!(format & DT_NOPREFIX)) if (!(format & DT_NOPREFIX))
{ {
prefix_offset = j; if (str[++i] != PREFIX)
i++; {
} prefix_offset = j;
else break;
{ }
dest[j++] = str[i++];
if (!(format & DT_NOCLIP) || (format & DT_WORDBREAK))
{
if (!GetTextExtentPoint16(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
} }
dest[j++] = str[i++];
if (!(format & DT_NOCLIP) || !(format & DT_NOPREFIX) ||
(format & DT_WORDBREAK))
{
if (!GetTextExtentPoint16(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
break; break;
case TAB: case TAB:

View File

@ -53,7 +53,6 @@ int main(int argc,char *argv[])
{ {
extern int yydebug; extern int yydebug;
extern char* optarg; extern char* optarg;
char* tmpc;
int optc,lose,ret,binary; int optc,lose,ret,binary;
lose=binary=0; lose=binary=0;
while((optc=getopt(argc,argv,"bcdp:vo:w:"))!=EOF) while((optc=getopt(argc,argv,"bcdp:vo:w:"))!=EOF)
@ -66,12 +65,7 @@ int main(int argc,char *argv[])
setbuf(stdout,0); setbuf(stdout,0);
setbuf(stderr,0); setbuf(stderr,0);
break; break;
case 'p':prefix=strdup(optarg); case 'p':prefix=strdup(optarg); break;
if(!isalpha(*prefix))*prefix='_';
for(tmpc=prefix;*tmpc;tmpc++)
if( !isalnum(*tmpc) && *tmpc!='_')
*tmpc='_';
break;
case 'c':constant=1;break; case 'c':constant=1;break;
case 'v':verbose=1; case 'v':verbose=1;
setbuf(stderr,0); setbuf(stderr,0);

View File

@ -4,10 +4,10 @@ TOPOBJDIR = ..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
PROGRAMS = build makedep PROGRAMS = build makedep fnt2bdf
MODULE = none MODULE = none
C_SRCS = build.c makedep.c C_SRCS = build.c makedep.c fnt2bdf.c
all: $(PROGRAMS) all: $(PROGRAMS)
@ -19,4 +19,7 @@ build: build.o
makedep: makedep.o makedep: makedep.o
$(CC) $(CFLAGS) -o makedep makedep.o $(CC) $(CFLAGS) -o makedep makedep.o
fnt2bdf: fnt2bdf.o
$(CC) $(CFLAGS) -o fnt2bdf fnt2bdf.o
### Dependencies: ### Dependencies:

File diff suppressed because it is too large Load Diff

584
tools/fnt2bdf.c Normal file
View File

@ -0,0 +1,584 @@
/************************************************
*
* Extract fonts from .fnt or Windows DLL files
* and convert them to the .bdf format.
*
* Copyright 1994-1996 Kevin Carothers and Alex Korobka
*
*/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include "windows.h"
#include "fnt2bdf.h"
#include "neexe.h"
#include "module.h"
#define MAP_BEG 118
extern char* g_lpstrFileName;
extern char* g_lpstrCharSet;
#define FILE_ERROR 0
#define FILE_DLL 1
#define FILE_FNT 2
/* global options */
char* g_lpstrFileName = NULL;
char* g_lpstrCharSet = NULL;
char* g_lpstrInputFile = NULL;
static char* errorDLLRead = "Unable to read Windows DLL.\n";
static char* errorFNTRead = "Unable to read .FNT file.\n";
static char* errorOpenFile = "Unable to open file.\n";
static char* errorMemory = "Memory allocation error.\n";
static char* errorFile = "Corrupt or invalid file.\n";
static char* errorFontData = "Unable to parse font data: Error ";
static char* errorEmpty = "No fonts found.\n";
/* info */
void usage()
{
printf("Usage: font2bdf [-c charset] [-o basename] [input file]\n");
printf(" -c charset\tuse this charset name for OEM_CHARSET fonts\n");
printf(" -f basename\tbasic output filename\n");
printf(" input file\tMSWindows .fon, .fnt, .dll, or .exe file.\n");
printf("\nExample:\n fnt2bdf -c winsys vgasys.fnt\n\n");
exit(-1);
}
/* convert big-endian value to the local format */
int return_data_value(enum data_types dtype, void * pChr)
{
int ret_val = 0;
switch(dtype) {
case (dfChar):
ret_val = (int) *(unsigned char *)pChr;
break;
case(dfShort):
ret_val = *(unsigned char *)pChr;
ret_val += (*((unsigned char *)pChr + 1) << 8);
break;
case(dfLong): {
int i;
for(i=3; i >= 0; i--) {
ret_val += *((unsigned char *)pChr + i) << (8*i);
}
break;
}
case(dfString):
}
return ret_val;
}
int make_bdf_filename(char* name, fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
{
int l_nameoffset = return_data_value(dfLong, cpe_font_struct->hdr.dfFace);
char* lpChar;
if( !g_lpstrFileName )
{
if( !l_nameoffset ||
l_nameoffset > return_data_value(dfLong, cpe_font_struct->hdr.dfSize) + 1 )
return ERROR_DATA;
lpChar = (char*)(file_buffer + l_nameoffset);
}
else lpChar = g_lpstrFileName;
strcpy( name, lpChar );
while( (lpChar = strchr( name, ' ')) )
*lpChar = '-';
/* construct a filename from the font typeface, slant, weight, and size */
if( cpe_font_struct->hdr.dfItalic[0] ) strcat(name, "_i" );
else strcat(name, "_r" );
lpChar = name + strlen( name );
sprintf(lpChar, "%d-%d.bdf", return_data_value(dfShort, cpe_font_struct->hdr.dfWeight),
return_data_value(dfShort, cpe_font_struct->hdr.dfPoints) );
return 0;
}
/* parse FONT resource and write .bdf file */
int parse_fnt_data(unsigned char* file_buffer, int length)
{
fnt_fontS cpe_font_struct;
int ic=0, t;
bcopy(file_buffer, (char *) &cpe_font_struct.hdr, sizeof(fnt_hdrS));
/* check font header */
t = return_data_value(dfShort, cpe_font_struct.hdr.dfVersion);
if( t != 0x300 && t != 0x200) return ERROR_VERSION;
t = return_data_value(dfLong, cpe_font_struct.hdr.dfSize);
if( t > length ) return ERROR_SIZE;
else
{
/* set up the charWidth/charOffset structure pairs (dfCharTable)... */
int l_fchar = return_data_value(dfChar, cpe_font_struct.hdr.dfFirstChar),
l_lchar = return_data_value(dfChar, cpe_font_struct.hdr.dfLastChar);
int l_len = l_lchar-l_fchar, l_ptr = MAP_BEG;
/* malloc size = (# chars) * sizeof(WinCharS) */
if((cpe_font_struct.dfCharTable = (WinCharS *) calloc(sizeof(WinCharS), l_len)) == NULL)
return ERROR_MEMORY;
/* NOW, convert them all to UNIX (lton) notation... */
for(ic=0; ic < l_len; ic++) {
cpe_font_struct.dfCharTable[ic].charWidth = return_data_value(dfShort, &file_buffer[l_ptr]);
l_ptr += 2; /* bump by sizeof(short) */
if( return_data_value(dfShort, cpe_font_struct.hdr.dfVersion) == 0x200) {
cpe_font_struct.dfCharTable[ic].charOffset =
return_data_value(dfShort, &file_buffer[l_ptr]);
l_ptr += 2; /* bump by sizeof(long) */
}
else { /* Windows Version 3.0 type font */
cpe_font_struct.dfCharTable[ic].charOffset =
return_data_value(dfLong, &file_buffer[l_ptr]);
l_ptr += 4; /* bump by sizeof(long) */
}
}
t = dump_bdf(&cpe_font_struct, file_buffer);
free( cpe_font_struct.dfCharTable );
}
return t;
}
int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
{
FILE* fp;
int ic;
int l_fchar = return_data_value(dfChar, cpe_font_struct->hdr.dfFirstChar),
l_lchar = return_data_value(dfChar, cpe_font_struct->hdr.dfLastChar);
int l_len = l_lchar-l_fchar,
l_hgt = return_data_value(dfChar, cpe_font_struct->hdr.dfPixHeight);
int l_ascent = return_data_value(dfShort, cpe_font_struct->hdr.dfAscent);
char l_filename[256];
if( (ic = make_bdf_filename(l_filename, cpe_font_struct, file_buffer)) )
return ic;
if((fp = fopen(l_filename, "w")) == (FILE *) 0)
{
fprintf(stderr, "Couldn't open \"%s\" for output.\n", l_filename);
return ERROR_FILE;
}
dump_bdf_hdr(fp, cpe_font_struct, file_buffer);
/* NOW, convert all chars to UNIX (lton) notation... */
for(ic=0; ic < l_len; ic++) {
int rowidx, l_span, /* how many char-cols wide is char? */
l_idx = cpe_font_struct->dfCharTable[ic].charOffset;
l_span = (int) (cpe_font_struct->dfCharTable[ic].charWidth-1)/8;
fprintf(fp, "STARTCHAR %d \n", ic);
fprintf(fp, "ENCODING %d\n", l_fchar);
fprintf(fp, "SWIDTH %d %d \n",
cpe_font_struct->dfCharTable[ic].charWidth*1000,
0);
fprintf(fp, "DWIDTH %d %d \n",
cpe_font_struct->dfCharTable[ic].charWidth, 0);
fprintf(fp, "BBX %d %d %d %d\n",
cpe_font_struct->dfCharTable[ic].charWidth, l_hgt, 0,
l_ascent - l_hgt);
fprintf(fp, "BITMAP\n");
for(rowidx=0; rowidx < l_hgt; rowidx++) {
switch(l_span) {
case(0): /* 1-7 pixels wide font */
{
fprintf(fp, "%02X\n", (int) file_buffer[l_idx+rowidx]);
break;
}
case(1): /* 8-15 pixels wide font */
{
fprintf(fp, "%02X%02X",
(int) file_buffer[l_idx+rowidx], file_buffer[l_idx+l_hgt+rowidx]);
fprintf(fp, "\n");
break;
}
case(2): /* 16-23 pixels wide font */
{
fprintf(fp, "%02X%02X%02X",
file_buffer[l_idx+rowidx],
file_buffer[l_idx+l_hgt+rowidx],
file_buffer[l_idx+(2*l_hgt)+rowidx]);
fprintf(fp, "\n");
break;
}
case(3): /* 24-31 pixels wide font */
{
fprintf(fp, "%02X%02X%02X%02X",
file_buffer[l_idx+rowidx],
file_buffer[l_idx+l_hgt+rowidx],
file_buffer[l_idx+(2*l_hgt)+rowidx],
file_buffer[l_idx+(3*l_hgt)+rowidx]);
fprintf(fp, "\n");
break;
}
case(4): /* 32-39 */
{
fprintf(fp, "%02X%02X%02X%02X%02X",
file_buffer[l_idx+rowidx],
file_buffer[l_idx+l_hgt+rowidx],
file_buffer[l_idx+(2*l_hgt)+rowidx],
file_buffer[l_idx+(3*l_hgt)+rowidx],
file_buffer[l_idx+(4*l_hgt)+rowidx]);
fprintf(fp, "\n");
break;
}
default:
fclose(fp);
unlink(l_filename);
return ERROR_DATA;
}
}
fprintf(fp, "ENDCHAR\n");
l_fchar++; /* Go to next one */
}
fprintf(fp, "ENDFONT\n");
fclose(fp);
return 0;
}
int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
{
int l_fchar = return_data_value(dfChar, cpe_font_struct->hdr.dfFirstChar),
l_lchar = return_data_value(dfChar, cpe_font_struct->hdr.dfLastChar);
int l_len = l_lchar - l_fchar;
int l_nameoffset = return_data_value(dfLong, cpe_font_struct->hdr.dfFace);
int l_cellheight = return_data_value(dfShort, cpe_font_struct->hdr.dfPixHeight);
int l_ascent = return_data_value(dfShort, cpe_font_struct->hdr.dfAscent);
fprintf(fs, "STARTFONT 2.1\n");
/* Compose font name */
if( l_nameoffset &&
l_nameoffset < return_data_value(dfLong, cpe_font_struct->hdr.dfSize) )
{
int dpi, point_size;
char* lpFace = (char*)(file_buffer + l_nameoffset), *lpChar;
short tmWeight = return_data_value(dfShort, cpe_font_struct->hdr.dfWeight);
while((lpChar = strchr(lpFace, '-')) )
*lpChar = ' ';
fprintf(fs, "FONT -windows-%s-", lpFace );
if( tmWeight == 0 ) /* weight */
fputs("medium-", fs);
else if( tmWeight <= FW_LIGHT )
fputs("light-", fs);
else if( tmWeight <= FW_MEDIUM )
fputs("medium-", fs);
else if( tmWeight <= FW_DEMIBOLD )
fputs("demibold-", fs);
else if( tmWeight <= FW_BOLD )
fputs("bold-", fs);
else fputs("black-", fs);
if( cpe_font_struct->hdr.dfItalic[0] ) /* slant */
fputs("i-", fs);
else fputs("r-", fs);
/* style */
if( (cpe_font_struct->hdr.dfPitchAndFamily[0] & 0xF0) == FF_SWISS )
fputs("normal-sans-", fs);
else fputs("normal--", fs); /* still can be -sans */
/* y extents */
point_size = 10 * return_data_value(dfShort, cpe_font_struct->hdr.dfPoints );
dpi = (l_cellheight * 720) / point_size;
fprintf(fs, "%d-%d-%d-%d-", l_cellheight, 10*l_cellheight, 72, 72);
/* point_size, dpi, dpi); */
/* spacing */
if( return_data_value(dfShort, cpe_font_struct->hdr.dfPixWidth) ) fputs("c-", fs);
else fputs("m-", fs);
/* average width */
fprintf( fs, "%d-", 10 * return_data_value(dfShort, cpe_font_struct->hdr.dfAvgWidth) );
/* charset */
switch( cpe_font_struct->hdr.dfCharSet[0] )
{
case ANSI_CHARSET: fputs("ansi-0\n", fs); break;
default:
case DEFAULT_CHARSET: fputs("iso8859-1\n", fs); break;
case SYMBOL_CHARSET: fputs("misc-fontspecific\n", fs); break;
case SHIFTJIS_CHARSET: fputs("jisx0208.1983-0\n", fs); break;
case OEM_CHARSET:
if( !g_lpstrCharSet )
{ fputs("Undefined OEM charset, use -c option.\n", stderr);
return ERROR_DATA; }
fprintf(fs, "%s\n", g_lpstrCharSet);
}
}
else return ERROR_DATA;
fprintf(fs, "SIZE %d %d %d\n",
l_cellheight,
return_data_value(dfShort, cpe_font_struct->hdr.dfHorizRes),
return_data_value(dfShort, cpe_font_struct->hdr.dfVertRes)); /* dfVertRes[2] */
fprintf(fs, "FONTBOUNDINGBOX %d %d %d %d\n",
return_data_value(dfShort, cpe_font_struct->hdr.dfMaxWidth),
return_data_value(dfChar, cpe_font_struct->hdr.dfPixHeight),
0, l_ascent - l_cellheight );
fprintf(fs, "STARTPROPERTIES 4\n");
fprintf(fs, "FONT_ASCENT %d\n", l_ascent ); /* dfAscent[2] */
fprintf(fs, "FONT_DESCENT %d\n", l_cellheight - l_ascent );
fprintf(fs, "CAP_HEIGHT %d\n", l_ascent -
return_data_value(dfShort, cpe_font_struct->hdr.dfInternalLeading));
fprintf(fs, "DEFAULT_CHAR %d\n", return_data_value(dfShort, cpe_font_struct->hdr.dfDefaultChar));
fprintf(fs, "ENDPROPERTIES\n");
fprintf(fs, "CHARS %d\n", l_len);
return 0;
}
void parse_options(int argc, char **argv)
{
int i;
switch( argc )
{
case 2:
g_lpstrInputFile = argv[1];
break;
case 3:
case 4:
case 5:
case 6:
for( i = 1; i < argc - 1; i++ )
{
if( argv[i][0] != '-' ||
strlen(argv[i]) != 2 ) break;
if( argv[i][1] == 'c' ) { g_lpstrCharSet = argv[i+1]; }
else
if( argv[i][1] == 'f' ) { g_lpstrFileName = argv[i+1]; }
else
usage();
i++;
}
if( i == argc - 1 )
{
g_lpstrInputFile = argv[i];
break;
}
default: usage();
}
}
/* read file data and return file type */
int get_resource_table(int fd, unsigned char** lpdata, int fsize)
{
struct mz_header_s mz_header;
struct ne_header_s ne_header;
short s, offset, size, retval;
lseek( fd, 0, SEEK_SET );
if( read(fd, &mz_header, sizeof(mz_header)) != sizeof(mz_header) )
return FILE_ERROR;
s = return_data_value(dfShort, &mz_header.mz_magic);
if( s == MZ_SIGNATURE) /* looks like .dll file so far... */
{
s = return_data_value(dfShort, &mz_header.ne_offset);
lseek( fd, s, SEEK_SET );
if( read(fd, &ne_header, sizeof(ne_header)) != sizeof(ne_header) )
return FILE_ERROR;
s = return_data_value(dfShort, &ne_header.ne_magic);
if( s == PE_SIGNATURE)
{
fprintf( stderr, "Do not know how to handle 32-bit Windows DLLs.\n");
return FILE_ERROR;
}
else if ( s != NE_SIGNATURE) return FILE_ERROR;
s = return_data_value(dfShort, &ne_header.resource_tab_offset);
size = return_data_value(dfShort, &ne_header.rname_tab_offset);
if( size > fsize ) return FILE_ERROR;
size -= s;
offset = s + return_data_value(dfShort, &mz_header.ne_offset);
if( size <= sizeof(NE_TYPEINFO) ) return FILE_ERROR;
retval = FILE_DLL;
}
else if( s == 0x300 || s == 0x200 ) /* maybe .fnt ? */
{
size = return_data_value(dfLong, &mz_header.dont_care);
if( size != fsize ) return FILE_ERROR;
offset = 0;
retval = FILE_FNT;
}
else return FILE_ERROR;
*lpdata = (unsigned char*)malloc(size);
if( *lpdata )
{
lseek( fd, offset, SEEK_SET );
if( read(fd, *lpdata, size) != size )
{ free( *lpdata ); *lpdata = NULL; }
}
return retval;
}
/* entry point */
int main(int argc, char **argv)
{
unsigned char* lpdata = NULL;
int fd;
parse_options( argc, argv);
if( (fd = open( g_lpstrInputFile, O_RDONLY)) )
{
int i;
struct stat file_stat;
fstat( fd, &file_stat);
i = get_resource_table( fd, &lpdata, file_stat.st_size );
switch(i)
{
case FILE_DLL:
if( lpdata )
{
int j, count = 0;
NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(lpdata + 2);
NE_NAMEINFO* pFontStorage = NULL;
while( (i = return_data_value(dfShort, &pTInfo->type_id)) )
{
j = return_data_value(dfShort, &pTInfo->count);
if( i == NE_RSCTYPE_FONT )
{
count = j;
pFontStorage = (NE_NAMEINFO*)(pTInfo + 1);
}
pTInfo = (NE_TYPEINFO *)((char*)(pTInfo+1) + j*sizeof(NE_NAMEINFO));
}
if( pFontStorage && count )
{
unsigned short size_shift = return_data_value(dfShort, lpdata);
unsigned char* lpfont = NULL;
unsigned offset;
unsigned length;
for( j = 0; j < count; j++, pFontStorage++ )
{
length = return_data_value(dfShort, &pFontStorage->length) << size_shift;
offset = return_data_value(dfShort, &pFontStorage->offset) << size_shift;
if( !(lpfont = (unsigned char*) realloc( lpfont, length )) )
{
fprintf(stderr, errorMemory );
free(lpdata);
return -1;
}
lseek( fd, offset, SEEK_SET );
if( read(fd, lpfont, length) != length )
{
fprintf(stderr, errorDLLRead );
free(lpdata); free(lpfont);
return -1;
}
if( (i = parse_fnt_data( lpfont, length )) )
fprintf(stderr, "%s%d\n", errorFontData, i );
}
free(lpfont); free(lpdata);
return 0;
}
else fprintf(stderr, errorEmpty );
free( lpdata );
}
else fprintf(stderr, errorDLLRead);
break;
case FILE_FNT:
if( lpdata )
{
if( (i = parse_fnt_data( lpdata, file_stat.st_size )) )
fprintf(stderr, "%s%d\n", errorFontData, i );
free( lpdata );
}
else fprintf(stderr, errorFNTRead);
break;
case FILE_ERROR:
fprintf(stderr, errorFile );
}
close(fd);
}
else fprintf(stderr, errorOpenFile );
return -1;
}

74
tools/fnt2bdf.h Normal file
View File

@ -0,0 +1,74 @@
#include <stdio.h>
enum data_types {dfChar, dfShort, dfLong, dfString};
#define ERROR_DATA 1
#define ERROR_VERSION 2
#define ERROR_SIZE 3
#define ERROR_MEMORY 4
#define ERROR_FILE 5
typedef struct tagFontHeader
{
unsigned char dfVersion[2]; /* Version (always 0x3000) */
unsigned char dfSize[4]; /* Total File Size */
unsigned char dfCopyright[60]; /* Copyright notice */
unsigned char dfType[2]; /* Vector or bitmap font */
unsigned char dfPoints[2]; /* Nominal point size */
unsigned char dfVertRes[2]; /* Vertical Resolution */
unsigned char dfHorizRes[2]; /* Horizontal Resolutionchar */
unsigned char dfAscent[2]; /* Character ascent in pixels */
unsigned char dfInternalLeading[2]; /* Leading included in character defn */
unsigned char dfExternalLeading[2]; /* Leading to be added by Windows */
unsigned char dfItalic[1]; /* 1=Italic font */
unsigned char dfUnderline[1]; /* 1=underlined font */
unsigned char dfStrikeOut[1]; /* 1=strike-out font */
unsigned char dfWeight[2]; /* Weight: 400=normal */
unsigned char dfCharSet[1]; /* Character Set for this font */
unsigned char dfPixWidth[2]; /* Character width (0 for proportional) */
unsigned char dfPixHeight[2]; /* Character height */
unsigned char dfPitchAndFamily[1]; /* Font Pitch and family */
unsigned char dfAvgWidth[2]; /* Average character width */
unsigned char dfMaxWidth[2]; /* Maximum character width */
unsigned char dfFirstChar[1]; /* Firwst character of the font */
unsigned char dfLastChar[1]; /* Last character of the font */
unsigned char dfDefaultChar[1]; /* Missing character */
unsigned char dfBreakChar[1]; /* Character to indicate word breaks */
unsigned char dfWidthBytes[2]; /* Number of bytes in each row */
unsigned char dfDevice[4]; /* Offset to device name */
unsigned char dfFace[4]; /* Offset to type face name */
unsigned char dfBitsPointer[4];
unsigned char dfBitsOffset[4]; /* Offset to bitmaps */
unsigned char dfReserved[1];
unsigned char dfFlags[4]; /* Bitmapped flags */
unsigned char dfAspace[2];
unsigned char dfBspace[2];
unsigned char dfCspace[2];
unsigned char dfColorTable[2]; /* Offset to Color table */
unsigned char dfReserved1[4];
} fnt_hdrS;
typedef struct WinCharStruct
{
unsigned int charWidth;
unsigned int charOffset;
} WinCharS;
typedef struct fntFontStruct
{
fnt_hdrS hdr;
WinCharS *dfCharTable;
unsigned char *dfDeviceP;
unsigned char *dfFaceP;
unsigned char *dfBitsPointerP;
unsigned char *dfBitsOffsetP;
short *dfColorTableP;
} fnt_fontS;
extern int return_data_value(enum data_types, void *);
extern int dump_bdf(fnt_fontS*, unsigned char* );
extern int dump_bdf_hdr(FILE* fp,fnt_fontS*, unsigned char* );
extern int parse_fnt_data(unsigned char* file_buffer, int length);

View File

@ -17,7 +17,7 @@
/*********************************************************************** /***********************************************************************
* GetACP (KERNEL32.148) * GetACP (KERNEL32.148)
*/ */
UINT GetACP(void) UINT32 GetACP(void)
{ {
return 1252; /* Windows 3.1 ISO Latin */ return 1252; /* Windows 3.1 ISO Latin */
} }
@ -36,7 +36,7 @@ BOOL GetCPInfo(UINT codepage, LPCPINFO cpinfo)
/*********************************************************************** /***********************************************************************
* GetOEMCP (KERNEL32.248) * GetOEMCP (KERNEL32.248)
*/ */
UINT GetOEMCP(void) UINT32 GetOEMCP(void)
{ {
return 437; /* MS-DOS United States */ return 437; /* MS-DOS United States */
} }

View File

@ -5,6 +5,7 @@
#include <malloc.h> #include <malloc.h>
#include "xmalloc.h" #include "xmalloc.h"
#include "windows.h" #include "windows.h"
#include "winerror.h"
#include "dos_fs.h" #include "dos_fs.h"
#include "heap.h" #include "heap.h"
#include "string32.h" #include "string32.h"
@ -188,8 +189,12 @@ BOOL32 FindClose32(HANDLE32 handle)
{ {
FindFileContext32 *context; FindFileContext32 *context;
if (handle==(INVALID_HANDLE_VALUE)) /* Windows95 ignores an invalid handle. */
return TRUE; if (handle == INVALID_HANDLE_VALUE)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
context = (FindFileContext32 *) handle; context = (FindFileContext32 *) handle;
if (context->dir) if (context->dir)
closedir(context->dir); closedir(context->dir);

View File

@ -23,32 +23,6 @@ BOOL WIN32_WinHelpA(HWND hWnd,LPCSTR lpszHelp,UINT uCommand, DWORD dwData)
return WinHelp(hWnd,lpszHelp,uCommand,dwData); return WinHelp(hWnd,lpszHelp,uCommand,dwData);
} }
HHOOK SetWindowsHookEx32A(INT32 id, HOOKPROC32 hookfn, HINSTANCE32 hModule,
DWORD ThreadId)
{
/* Stub for now */
fprintf(stdnimp, "SetWindowsHookEx32A Stub called! (hook Id %d)\n",id);
return (HHOOK) NULL;
}
HHOOK SetWindowsHook32A(INT32 HookId, HOOKPROC32 hookfn)
{
/* Stub for now */
fprintf(stdnimp, "SetWindowsHook32A Stub called! (hook Id %d)\n", HookId);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return (HHOOK) NULL;
}
BOOL32 UnhookWindowsHookEx32(HHOOK hHook)
{
/* Stub for now */
fprintf(stdnimp, "UnhookWindowsHookEx32 Stub called!\n");
return FALSE;
}
/**************************************************************************** /****************************************************************************
* QueryPerformanceCounter (KERNEL32.415) * QueryPerformanceCounter (KERNEL32.415)
*/ */

View File

@ -15,12 +15,13 @@
#include "xmalloc.h" #include "xmalloc.h"
/*********************************************************************** /***********************************************************************
* GetCurrentThreadId (KERNEL32.200) * GetCurrentThreadId (KERNEL32.201)
*/ */
int GetCurrentThreadId(void) DWORD GetCurrentThreadId(void)
{ {
return getpid(); /* Windows 95 returns the address of the thread database (sorta) */
return MAKELONG(GetCurrentTask(), 0);
} }
/*********************************************************************** /***********************************************************************
@ -35,7 +36,7 @@ BOOL GetThreadContext(HANDLE32 hThread, void *lpContext)
*/ */
HANDLE32 GetCurrentThread(void) HANDLE32 GetCurrentThread(void)
{ {
return 0; return 0xFFFFFFFE; /* that's -2 */
} }
/********************************************************************** /**********************************************************************

View File

@ -89,18 +89,18 @@ static BOOL32 DEFDLG_SetDefButton( HWND32 hwndDlg, DIALOGINFO *dlgInfo,
!(SendMessage16(hwndNew, WM_GETDLGCODE, 0, 0 ) & DLGC_UNDEFPUSHBUTTON)) !(SendMessage16(hwndNew, WM_GETDLGCODE, 0, 0 ) & DLGC_UNDEFPUSHBUTTON))
return FALSE; /* Destination is not a push button */ return FALSE; /* Destination is not a push button */
if (dlgInfo->msgResult) /* There's already a default pushbutton */ if (dlgInfo->idResult) /* There's already a default pushbutton */
{ {
HWND32 hwndOld = GetDlgItem( hwndDlg, dlgInfo->msgResult ); HWND32 hwndOld = GetDlgItem( hwndDlg, dlgInfo->idResult );
if (SendMessage32A( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON) if (SendMessage32A( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
SendMessage32A( hwndOld, BM_SETSTYLE32, BS_PUSHBUTTON, TRUE ); SendMessage32A( hwndOld, BM_SETSTYLE32, BS_PUSHBUTTON, TRUE );
} }
if (hwndNew) if (hwndNew)
{ {
SendMessage32A( hwndNew, BM_SETSTYLE32, BS_DEFPUSHBUTTON, TRUE ); SendMessage32A( hwndNew, BM_SETSTYLE32, BS_DEFPUSHBUTTON, TRUE );
dlgInfo->msgResult = GetDlgCtrlID( hwndNew ); dlgInfo->idResult = GetDlgCtrlID( hwndNew );
} }
else dlgInfo->msgResult = 0; else dlgInfo->idResult = 0;
return TRUE; return TRUE;
} }
@ -177,8 +177,8 @@ static LRESULT DEFDLG_Proc( HWND32 hwnd, UINT32 msg, WPARAM32 wParam,
case DM_GETDEFID: case DM_GETDEFID:
if (dlgInfo->fEnd) return 0; if (dlgInfo->fEnd) return 0;
if (dlgInfo->msgResult) if (dlgInfo->idResult)
return MAKELONG( dlgInfo->msgResult, DC_HASDEFID ); return MAKELONG( dlgInfo->idResult, DC_HASDEFID );
hwndDefId = DEFDLG_FindDefButton( hwnd ); hwndDefId = DEFDLG_FindDefButton( hwnd );
if (hwndDefId) if (hwndDefId)
return MAKELONG( GetDlgCtrlID( hwndDefId ), DC_HASDEFID); return MAKELONG( GetDlgCtrlID( hwndDefId ), DC_HASDEFID);
@ -223,7 +223,9 @@ LRESULT DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam )
hwnd, msg, wParam, lParam ); hwnd, msg, wParam, lParam );
/* Check if window was destroyed by dialog procedure */ /* Check if window was destroyed by dialog procedure */
if (result || !IsWindow( hwnd )) return result;
if (!IsWindow( hwnd )) return result;
else if( result ) return dlgInfo->msgResult;
} }
switch(msg) switch(msg)
@ -267,7 +269,9 @@ LRESULT DefDlgProc32A( HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
hwnd, msg, wParam, lParam ); hwnd, msg, wParam, lParam );
/* Check if window was destroyed by dialog procedure */ /* Check if window was destroyed by dialog procedure */
if (result || !IsWindow( hwnd )) return result;
if (!IsWindow( hwnd )) return result;
else if( result ) return dlgInfo->msgResult;
} }
switch(msg) switch(msg)
@ -310,7 +314,9 @@ LRESULT DefDlgProc32W( HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
hwnd, msg, wParam, lParam ); hwnd, msg, wParam, lParam );
/* Check if window was destroyed by dialog procedure */ /* Check if window was destroyed by dialog procedure */
if (result || !IsWindow( hwnd )) return result;
if (!IsWindow( hwnd )) return result;
else if( result ) return dlgInfo->msgResult;
} }
switch(msg) switch(msg)

View File

@ -293,7 +293,7 @@ static BOOL32 DIALOG_CreateControls( WND *pWnd, LPCSTR template, INT32 items,
SendMessage32A( hwndDefButton, BM_SETSTYLE32, SendMessage32A( hwndDefButton, BM_SETSTYLE32,
BS_PUSHBUTTON,FALSE ); BS_PUSHBUTTON,FALSE );
hwndDefButton = hwndCtrl; hwndDefButton = hwndCtrl;
dlgInfo->msgResult = GetWindowWord( hwndCtrl, GWW_ID ); dlgInfo->idResult = GetWindowWord( hwndCtrl, GWW_ID );
} }
} }
dprintf_dialog(stddeb, " END\n" ); dprintf_dialog(stddeb, " END\n" );
@ -583,7 +583,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE32 hInst, LPCSTR dlgTemplate,
dlgInfo->hMenu = hMenu; dlgInfo->hMenu = hMenu;
dlgInfo->xBaseUnit = xUnit; dlgInfo->xBaseUnit = xUnit;
dlgInfo->yBaseUnit = yUnit; dlgInfo->yBaseUnit = yUnit;
dlgInfo->msgResult = 0; /* This is used to store the default button id */ dlgInfo->msgResult = 0;
dlgInfo->idResult = 0;
dlgInfo->hDialogHeap = 0; dlgInfo->hDialogHeap = 0;
if (dlgInfo->hUserFont) if (dlgInfo->hUserFont)
@ -747,7 +748,7 @@ static INT32 DIALOG_DoDialogBox( HWND hwnd, HWND owner )
} }
if (dlgInfo->fEnd) break; if (dlgInfo->fEnd) break;
} }
retval = dlgInfo->msgResult; retval = dlgInfo->idResult;
EnableWindow( owner, TRUE ); EnableWindow( owner, TRUE );
DestroyWindow( hwnd ); DestroyWindow( hwnd );
return retval; return retval;
@ -860,7 +861,7 @@ BOOL16 EndDialog( HWND32 hwnd, INT32 retval )
{ {
WND * wndPtr = WIN_FindWndPtr( hwnd ); WND * wndPtr = WIN_FindWndPtr( hwnd );
DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra; DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
dlgInfo->msgResult = retval; dlgInfo->idResult = retval;
dlgInfo->fEnd = TRUE; dlgInfo->fEnd = TRUE;
dprintf_dialog(stddeb, "EndDialog: %04x %d\n", hwnd, retval ); dprintf_dialog(stddeb, "EndDialog: %04x %d\n", hwnd, retval );
return TRUE; return TRUE;

View File

@ -307,6 +307,8 @@ void EVENT_RegisterWindow( WND *pWnd )
if( dndSelection == None ) if( dndSelection == None )
dndSelection = XInternAtom( display, "DndSelection" , False ); dndSelection = XInternAtom( display, "DndSelection" , False );
XSetWMProtocols( display, pWnd->window, &wmDeleteWindow, 1 );
if (!winContext) winContext = XUniqueContext(); if (!winContext) winContext = XUniqueContext();
XSaveContext( display, pWnd->window, winContext, (char *)pWnd ); XSaveContext( display, pWnd->window, winContext, (char *)pWnd );
} }

View File

@ -101,8 +101,8 @@ HWND32 SetFocus32( HWND32 hwnd )
if( hwnd == hwndFocus ) return hwnd; if( hwnd == hwndFocus ) return hwnd;
/* call hooks */ /* call hooks */
if( HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM16)hwnd, if( HOOK_CallHooks16( WH_CBT, HCBT_SETFOCUS, (WPARAM16)hwnd,
(LPARAM)hwndFocus) ) (LPARAM)hwndFocus) )
return 0; return 0;
/* activate hwndTop if needed. */ /* activate hwndTop if needed. */
@ -113,7 +113,7 @@ HWND32 SetFocus32( HWND32 hwnd )
if (!IsWindow( hwnd )) return 0; /* Abort if window destroyed */ if (!IsWindow( hwnd )) return 0; /* Abort if window destroyed */
} }
} }
else if( HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)hwndFocus ) ) else if( HOOK_CallHooks16( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)hwndFocus ) )
return 0; return 0;
/* Change focus and send messages */ /* Change focus and send messages */

File diff suppressed because it is too large Load Diff

View File

@ -91,15 +91,15 @@ static SYSQ_STATUS MSG_TranslateMouseMsg( MSG16 *msg, BOOL remove )
msg->lParam = MAKELONG( pt.x, pt.y ); msg->lParam = MAKELONG( pt.x, pt.y );
/* No need to further process the message */ /* No need to further process the message */
if (!HOOK_GetHook( WH_MOUSE, GetTaskQueue(0)) || if (!HOOK_IsHooked( WH_MOUSE ) ||
!(hook = SEGPTR_NEW(MOUSEHOOKSTRUCT16))) !(hook = SEGPTR_NEW(MOUSEHOOKSTRUCT16)))
return SYSQ_MSG_ACCEPT; return SYSQ_MSG_ACCEPT;
hook->pt = msg->pt; hook->pt = msg->pt;
hook->hwnd = msg->hwnd; hook->hwnd = msg->hwnd;
hook->wHitTestCode = HTCLIENT; hook->wHitTestCode = HTCLIENT;
hook->dwExtraInfo = 0; hook->dwExtraInfo = 0;
ret = !HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE, ret = !HOOK_CallHooks16( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
msg->message, (LPARAM)SEGPTR_GET(hook)); msg->message, (LPARAM)SEGPTR_GET(hook));
SEGPTR_FREE(hook); SEGPTR_FREE(hook);
return ret ? SYSQ_MSG_ACCEPT : SYSQ_MSG_SKIP ; return ret ? SYSQ_MSG_ACCEPT : SYSQ_MSG_SKIP ;
} }
@ -195,7 +195,7 @@ static SYSQ_STATUS MSG_TranslateMouseMsg( MSG16 *msg, BOOL remove )
/* Call the WH_MOUSE hook */ /* Call the WH_MOUSE hook */
if (!HOOK_GetHook( WH_MOUSE, GetTaskQueue(0)) || if (!HOOK_IsHooked( WH_MOUSE ) ||
!(hook = SEGPTR_NEW(MOUSEHOOKSTRUCT16))) !(hook = SEGPTR_NEW(MOUSEHOOKSTRUCT16)))
return SYSQ_MSG_ACCEPT; return SYSQ_MSG_ACCEPT;
@ -203,8 +203,8 @@ static SYSQ_STATUS MSG_TranslateMouseMsg( MSG16 *msg, BOOL remove )
hook->hwnd = msg->hwnd; hook->hwnd = msg->hwnd;
hook->wHitTestCode = hittest; hook->wHitTestCode = hittest;
hook->dwExtraInfo = 0; hook->dwExtraInfo = 0;
ret = !HOOK_CallHooks( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE, ret = !HOOK_CallHooks16( WH_MOUSE, remove ? HC_ACTION : HC_NOREMOVE,
msg->message, (LPARAM)SEGPTR_GET(hook) ); msg->message, (LPARAM)SEGPTR_GET(hook) );
SEGPTR_FREE(hook); SEGPTR_FREE(hook);
return ret ? SYSQ_MSG_ACCEPT : SYSQ_MSG_SKIP; return ret ? SYSQ_MSG_ACCEPT : SYSQ_MSG_SKIP;
} }
@ -245,9 +245,9 @@ static SYSQ_STATUS MSG_TranslateKeyboardMsg( MSG16 *msg, BOOL remove )
if (queue) QUEUE_SetWakeBit( queue, QS_KEY ); if (queue) QUEUE_SetWakeBit( queue, QS_KEY );
return SYSQ_MSG_ABANDON; return SYSQ_MSG_ABANDON;
} }
return (HOOK_CallHooks( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE, return (HOOK_CallHooks16( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE,
msg->wParam, msg->lParam )) msg->wParam, msg->lParam )
? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT; ? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT);
} }
@ -268,16 +268,16 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
event->paramH = msg->lParam & 0x7FFF; event->paramH = msg->lParam & 0x7FFF;
if (HIWORD(msg->lParam) & 0x0100) if (HIWORD(msg->lParam) & 0x0100)
event->paramH |= 0x8000; /* special_key - bit */ event->paramH |= 0x8000; /* special_key - bit */
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, HOOK_CallHooks16( WH_JOURNALRECORD, HC_ACTION, 0,
(LPARAM)SEGPTR_GET(event) ); (LPARAM)SEGPTR_GET(event) );
} }
else if ((msg->message >= WM_MOUSEFIRST) && (msg->message <= WM_MOUSELAST)) else if ((msg->message >= WM_MOUSEFIRST) && (msg->message <= WM_MOUSELAST))
{ {
event->paramL = LOWORD(msg->lParam); /* X pos */ event->paramL = LOWORD(msg->lParam); /* X pos */
event->paramH = HIWORD(msg->lParam); /* Y pos */ event->paramH = HIWORD(msg->lParam); /* Y pos */
ClientToScreen16( msg->hwnd, (LPPOINT16)&event->paramL ); ClientToScreen16( msg->hwnd, (LPPOINT16)&event->paramL );
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, HOOK_CallHooks16( WH_JOURNALRECORD, HC_ACTION, 0,
(LPARAM)SEGPTR_GET(event) ); (LPARAM)SEGPTR_GET(event) );
} }
else if ((msg->message >= WM_NCMOUSEFIRST) && else if ((msg->message >= WM_NCMOUSEFIRST) &&
(msg->message <= WM_NCMOUSELAST)) (msg->message <= WM_NCMOUSELAST))
@ -285,8 +285,8 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
event->paramL = LOWORD(msg->lParam); /* X pos */ event->paramL = LOWORD(msg->lParam); /* X pos */
event->paramH = HIWORD(msg->lParam); /* Y pos */ event->paramH = HIWORD(msg->lParam); /* Y pos */
event->message += WM_MOUSEMOVE-WM_NCMOUSEMOVE;/* give no info about NC area */ event->message += WM_MOUSEMOVE-WM_NCMOUSEMOVE;/* give no info about NC area */
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, HOOK_CallHooks16( WH_JOURNALRECORD, HC_ACTION, 0,
(LPARAM)SEGPTR_GET(event) ); (LPARAM)SEGPTR_GET(event) );
} }
SEGPTR_FREE(event); SEGPTR_FREE(event);
} }
@ -302,10 +302,11 @@ static int MSG_JournalPlayBackMsg(void)
long wtime,lParam; long wtime,lParam;
WORD keyDown,i,wParam,result=0; WORD keyDown,i,wParam,result=0;
if ( HOOK_GetHook(WH_JOURNALPLAYBACK, 0) ) if ( HOOK_IsHooked( WH_JOURNALPLAYBACK ) )
{ {
tmpMsg = SEGPTR_NEW(EVENTMSG16); tmpMsg = SEGPTR_NEW(EVENTMSG16);
wtime=HOOK_CallHooks( WH_JOURNALPLAYBACK, HC_GETNEXT, 0, (LPARAM)SEGPTR_GET(tmpMsg)); wtime=HOOK_CallHooks16( WH_JOURNALPLAYBACK, HC_GETNEXT, 0,
(LPARAM)SEGPTR_GET(tmpMsg));
/* dprintf_msg(stddeb,"Playback wait time =%ld\n",wtime); */ /* dprintf_msg(stddeb,"Playback wait time =%ld\n",wtime); */
if (wtime<=0) if (wtime<=0)
{ {
@ -360,7 +361,8 @@ static int MSG_JournalPlayBackMsg(void)
tmpMsg->paramL, tmpMsg->paramH, tmpMsg->time, 0 ); tmpMsg->paramL, tmpMsg->paramH, tmpMsg->time, 0 );
} }
} }
HOOK_CallHooks( WH_JOURNALPLAYBACK, HC_SKIP, 0, (LPARAM)SEGPTR_GET(tmpMsg)); HOOK_CallHooks16( WH_JOURNALPLAYBACK, HC_SKIP, 0,
(LPARAM)SEGPTR_GET(tmpMsg));
} }
else else
result= QS_MOUSE | QS_KEY; result= QS_MOUSE | QS_KEY;
@ -412,9 +414,9 @@ static BOOL MSG_PeekHardwareMsg( MSG16 *msg, HWND hwnd, WORD first, WORD last,
hook->wMessage = msg->message; hook->wMessage = msg->message;
hook->wParam = msg->wParam; hook->wParam = msg->wParam;
hook->lParam = msg->lParam; hook->lParam = msg->lParam;
ret = HOOK_CallHooks( WH_HARDWARE, ret = HOOK_CallHooks16( WH_HARDWARE,
remove ? HC_ACTION : HC_NOREMOVE, remove ? HC_ACTION : HC_NOREMOVE,
0, (LPARAM)SEGPTR_GET(hook) ); 0, (LPARAM)SEGPTR_GET(hook) );
SEGPTR_FREE(hook); SEGPTR_FREE(hook);
status = ret ? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT; status = ret ? SYSQ_MSG_SKIP : SYSQ_MSG_ACCEPT;
} }
@ -434,7 +436,7 @@ static BOOL MSG_PeekHardwareMsg( MSG16 *msg, HWND hwnd, WORD first, WORD last,
((msg->message < first) || (msg->message > last))) continue; ((msg->message < first) || (msg->message > last))) continue;
if (remove) if (remove)
{ {
if (HOOK_GetHook( WH_JOURNALRECORD, GetTaskQueue(0) )) if (HOOK_IsHooked( WH_JOURNALRECORD ))
MSG_JournalRecordMsg( msg ); MSG_JournalRecordMsg( msg );
QUEUE_RemoveMsg( sysMsgQueue, pos ); QUEUE_RemoveMsg( sysMsgQueue, pos );
} }
@ -776,18 +778,17 @@ BOOL32 MSG_InternalGetMessage( MSG16 *msg, HWND32 hwnd, HWND32 hwndOwner,
/* Call message filters */ /* Call message filters */
if (HOOK_GetHook( WH_SYSMSGFILTER, GetTaskQueue(0) ) || if (HOOK_IsHooked( WH_SYSMSGFILTER ) || HOOK_IsHooked( WH_MSGFILTER ))
HOOK_GetHook( WH_MSGFILTER, GetTaskQueue(0) ))
{ {
MSG16 *pmsg = SEGPTR_NEW(MSG16); MSG16 *pmsg = SEGPTR_NEW(MSG16);
if (pmsg) if (pmsg)
{ {
BOOL32 ret; BOOL32 ret;
*pmsg = *msg; *pmsg = *msg;
ret = ((BOOL16)HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, ret = ((BOOL16)HOOK_CallHooks16( WH_SYSMSGFILTER, code, 0,
(LPARAM)SEGPTR_GET(pmsg) ) || (LPARAM)SEGPTR_GET(pmsg) ) ||
(BOOL16)HOOK_CallHooks( WH_MSGFILTER, code, 0, (BOOL16)HOOK_CallHooks16( WH_MSGFILTER, code, 0,
(LPARAM)SEGPTR_GET(pmsg) )); (LPARAM)SEGPTR_GET(pmsg) ));
SEGPTR_FREE(pmsg); SEGPTR_FREE(pmsg);
if (ret) if (ret)
{ {
@ -826,7 +827,7 @@ BOOL GetMessage( SEGPTR msg, HWND hwnd, UINT first, UINT last )
dprintf_msg(stddeb,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message, dprintf_msg(stddeb,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message,
hwnd, first, last ); hwnd, first, last );
HOOK_CallHooks( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg ); HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg );
return (lpmsg->message != WM_QUIT); return (lpmsg->message != WM_QUIT);
} }
@ -924,30 +925,30 @@ LRESULT SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPARAM lParam)
return TRUE; return TRUE;
} }
if (HOOK_GetHook( WH_CALLWNDPROC, GetTaskQueue(0) )) if (HOOK_IsHooked( WH_CALLWNDPROC ))
{ {
struct msgstruct struct msgstruct
{ {
LPARAM lParam; LPARAM lParam;
WPARAM16 wParam; WPARAM16 wParam;
UINT16 wMsg; UINT16 wMsg;
HWND16 hWnd; HWND16 hWnd;
} *pmsg; } *pmsg;
if ((pmsg = SEGPTR_NEW(struct msgstruct))) if ((pmsg = SEGPTR_NEW(struct msgstruct)))
{ {
pmsg->hWnd = hwnd; pmsg->hWnd = hwnd;
pmsg->wMsg = msg; pmsg->wMsg = msg;
pmsg->wParam = wParam; pmsg->wParam = wParam;
pmsg->lParam = lParam; pmsg->lParam = lParam;
HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 1, HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1,
(LPARAM)SEGPTR_GET(pmsg) ); (LPARAM)SEGPTR_GET(pmsg) );
hwnd = pmsg->hWnd; hwnd = pmsg->hWnd;
msg = pmsg->wMsg; msg = pmsg->wMsg;
wParam = pmsg->wParam; wParam = pmsg->wParam;
lParam = pmsg->lParam; lParam = pmsg->lParam;
SEGPTR_FREE( pmsg ); SEGPTR_FREE( pmsg );
} }
} }
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) if (!(wndPtr = WIN_FindWndPtr( hwnd )))
@ -1134,7 +1135,7 @@ LONG DispatchMessage( const MSG16* msg )
{ {
if (msg->lParam) if (msg->lParam)
{ {
/* HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */ /* HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
return CallWindowProc16( (WNDPROC16)msg->lParam, msg->hwnd, return CallWindowProc16( (WNDPROC16)msg->lParam, msg->hwnd,
msg->message, msg->wParam, GetTickCount() ); msg->message, msg->wParam, GetTickCount() );
} }
@ -1145,7 +1146,7 @@ LONG DispatchMessage( const MSG16* msg )
if (!wndPtr->winproc) return 0; if (!wndPtr->winproc) return 0;
painting = (msg->message == WM_PAINT); painting = (msg->message == WM_PAINT);
if (painting) wndPtr->flags |= WIN_NEEDS_BEGINPAINT; if (painting) wndPtr->flags |= WIN_NEEDS_BEGINPAINT;
/* HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */ /* HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
SPY_EnterMessage( SPY_DISPATCHMESSAGE16, msg->hwnd, msg->message, SPY_EnterMessage( SPY_DISPATCHMESSAGE16, msg->hwnd, msg->message,
msg->wParam, msg->lParam ); msg->wParam, msg->lParam );

View File

@ -1149,14 +1149,14 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam, POINT16 pt )
if (rootWindow == DefaultRootWindow(display)) XUngrabServer( display ); if (rootWindow == DefaultRootWindow(display)) XUngrabServer( display );
} }
if (HOOK_GetHook( WH_CBT, GetTaskQueue(0) )) if (HOOK_IsHooked( WH_CBT ))
{ {
RECT16* pr = SEGPTR_NEW(RECT16); RECT16* pr = SEGPTR_NEW(RECT16);
if( pr ) if( pr )
{ {
*pr = sizingRect; *pr = sizingRect;
if( HOOK_CallHooks( WH_CBT, HCBT_MOVESIZE, hwnd, if( HOOK_CallHooks16( WH_CBT, HCBT_MOVESIZE, hwnd,
(LPARAM)SEGPTR_GET(pr)) ) (LPARAM)SEGPTR_GET(pr)) )
sizingRect = wndPtr->rectWindow; sizingRect = wndPtr->rectWindow;
else else
sizingRect = *pr; sizingRect = *pr;

View File

@ -579,36 +579,20 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
hwndLinkAfter = (cs->style & WS_CHILD) ? HWND_BOTTOM : HWND_TOP; hwndLinkAfter = (cs->style & WS_CHILD) ? HWND_BOTTOM : HWND_TOP;
if (HOOK_GetHook( WH_CBT, GetTaskQueue(0) )) if (HOOK_IsHooked( WH_CBT ))
{ {
CBT_CREATEWND16* cbtc; CBT_CREATEWND32A cbtc;
if ((cbtc = SEGPTR_NEW(CBT_CREATEWND16))) cbtc.lpcs = cs;
{ cbtc.hwndInsertAfter = hwndLinkAfter;
/* Dummy message params to use WINPROC_MapMsg functions */ wmcreate = !HOOK_CallHooks32A( WH_CBT, HCBT_CREATEWND, hwnd,
UINT16 msg; (LPARAM)&cbtc );
WPARAM16 wparam; if (!wmcreate)
LPARAM lparam; {
dprintf_win(stddeb, "CreateWindowEx: CBT-hook returned 0\n");
/* Map the CREATESTRUCT to 16-bit format */ USER_HEAP_FREE( hwnd );
lparam = (LPARAM)cs; return 0;
if (unicode) }
WINPROC_MapMsg32WTo16( WM_CREATE, 0, &msg, &wparam, &lparam );
else
WINPROC_MapMsg32ATo16( WM_CREATE, 0, &msg, &wparam, &lparam );
cbtc->lpcs = (CREATESTRUCT16 *)lparam;
cbtc->hwndInsertAfter = hwndLinkAfter;
wmcreate = !HOOK_CallHooks( WH_CBT, HCBT_CREATEWND, hwnd,
(LPARAM)SEGPTR_GET(cbtc) );
WINPROC_UnmapMsg32ATo16( WM_CREATE, 0, lparam );
SEGPTR_FREE(cbtc);
if (!wmcreate)
{
dprintf_win(stddeb,"CreateWindowEx: CBT-hook returned 0\n" );
USER_HEAP_FREE( hwnd );
return 0;
}
}
} }
/* Set the window procedure */ /* Set the window procedure */
@ -817,7 +801,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom,
/* Call WH_SHELL hook */ /* Call WH_SHELL hook */
if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner) if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 ); HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
dprintf_win(stddeb, "CreateWindowEx: returning %04x\n", hwnd); dprintf_win(stddeb, "CreateWindowEx: returning %04x\n", hwnd);
return hwnd; return hwnd;
@ -1019,12 +1003,12 @@ BOOL DestroyWindow( HWND hwnd )
/* Call hooks */ /* Call hooks */
if( HOOK_CallHooks( WH_CBT, HCBT_DESTROYWND, hwnd, 0L) ) if( HOOK_CallHooks16( WH_CBT, HCBT_DESTROYWND, hwnd, 0L) )
return FALSE; return FALSE;
if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner) if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner)
{ {
HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWDESTROYED, hwnd, 0L ); HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWDESTROYED, hwnd, 0L );
/* FIXME: clean up palette - see "Internals" p.352 */ /* FIXME: clean up palette - see "Internals" p.352 */
} }
@ -1406,6 +1390,7 @@ WORD SetWindowWord( HWND32 hwnd, INT32 offset, WORD newval )
{ {
case GWW_ID: ptr = (WORD *)&wndPtr->wIDmenu; break; case GWW_ID: ptr = (WORD *)&wndPtr->wIDmenu; break;
case GWW_HINSTANCE: ptr = (WORD *)&wndPtr->hInstance; break; case GWW_HINSTANCE: ptr = (WORD *)&wndPtr->hInstance; break;
case GWW_HWNDPARENT: return SetParent( hwnd, newval );
default: default:
fprintf( stderr, "SetWindowWord: invalid offset %d\n", offset ); fprintf( stderr, "SetWindowWord: invalid offset %d\n", offset );
return 0; return 0;

View File

@ -595,7 +595,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
swpflags |= SWP_FRAMECHANGED; swpflags |= SWP_FRAMECHANGED;
if (!(wndPtr->dwStyle & WS_MINIMIZE)) if (!(wndPtr->dwStyle & WS_MINIMIZE))
{ {
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) ) if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
return 0; return 0;
if (wndPtr->dwStyle & WS_MAXIMIZE) if (wndPtr->dwStyle & WS_MAXIMIZE)
@ -623,7 +623,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
swpflags |= SWP_SHOWWINDOW | SWP_FRAMECHANGED; swpflags |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
if (!(wndPtr->dwStyle & WS_MAXIMIZE)) if (!(wndPtr->dwStyle & WS_MAXIMIZE))
{ {
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) ) if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
return 0; return 0;
/* Store the current position and find the maximized size */ /* Store the current position and find the maximized size */
@ -669,7 +669,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
if (wndPtr->dwStyle & WS_MINIMIZE) if (wndPtr->dwStyle & WS_MINIMIZE)
{ {
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) ) if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
return 0; return 0;
if( !SendMessage16( hwnd, WM_QUERYOPEN, 0, 0L) ) if( !SendMessage16( hwnd, WM_QUERYOPEN, 0, 0L) )
@ -702,7 +702,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
} }
else if (wndPtr->dwStyle & WS_MAXIMIZE) else if (wndPtr->dwStyle & WS_MAXIMIZE)
{ {
if( HOOK_CallHooks( WH_CBT, HCBT_MINMAX, hwnd, cmd) ) if( HOOK_CallHooks16( WH_CBT, HCBT_MINMAX, hwnd, cmd) )
return 0; return 0;
wndPtr->ptMaxPos.x = wndPtr->rectWindow.left; wndPtr->ptMaxPos.x = wndPtr->rectWindow.left;
@ -962,8 +962,8 @@ BOOL32 WINPOS_SetActiveWindow( HWND32 hWnd, BOOL32 fMouse, BOOL32 fChangeFocus)
LRESULT wRet; LRESULT wRet;
cbtStruct->fMouse = fMouse; cbtStruct->fMouse = fMouse;
cbtStruct->hWndActive = hwndActive; cbtStruct->hWndActive = hwndActive;
wRet = HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM16)hWnd, wRet = HOOK_CallHooks16( WH_CBT, HCBT_ACTIVATE, (WPARAM16)hWnd,
(LPARAM)SEGPTR_GET(cbtStruct) ); (LPARAM)SEGPTR_GET(cbtStruct) );
SEGPTR_FREE(cbtStruct); SEGPTR_FREE(cbtStruct);
if (wRet) return wRet; if (wRet) return wRet;
} }