Release 971116

Sun Nov 16 07:42:44 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [windows/dce.c] [windows/clipboard.c] [windows/nonclient.c]
	Bug fixes.

	* [misc/shell.c] [resources/*]
	New "About" dialog.

Sat Nov 15 17:30:18 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [configure.in] [Makefile.in]
	Replaced --with-library option by --disable-emulator. The default
 	is now to build both the library and the emulator.
	Renamed --with options to --enable to follow autoconf guidelines.

	* [loader/main.c] [miscemu/main.c] (New file)
	Split initialization in WinelibInit/EmulatorInit.

	* [loader/*.c]
	Removed all remaining #ifdef's WINELIB.

	* [controls/widgets.c] [windows/mdi.c]
	Converted MDIClientWndProc to 32-bit.

	* [debugger/break.c] [if1632/signal.c] [include/selectors.h]
	  [scheduler/thread.c]
	Code and data selector values are now computed at run-time.

	* [library/libres.c]
	Moved to loader/ directory.

	* [misc/main.c] [misc/version.c] (New file)
	Moved all version stuff to version.c. Cleaned up a bit.

	* [msdos/dpmi.c]
	Update the REALMODECALL structure on return from real-mode
	interrupt.

	* [windows/event.c] [windows/keyboard.c]
	Changed the way event coordinates are determined. Don't rely on
	the ConfigureNotify event values. This should fix all problems
	with cursor position in -desktop and -managed modes.

Sat Nov 15 16:09:36 1997  Slaven Rezic  <eserte@cs.tu-berlin.de>

	* [controls/button.c]
	(BUTTON_CheckAutoRadioButton): Prevent possible endless loop.

Wed Nov 12 03:42:45 1997  Chris Faherty <chrisf@america.com>

	* [misc/ver.c]
	Changed VerInstall32A to assume srcdir as destination if destdir
	is blank.  This was causing alot of DLL installation into SYSTEM
	directory to fail.

	* [loader/ne_image.c]
	NE_LoadSegment buffer[100] was too small and getting overruns.
	Changed it to buffer[200].

Sat Nov  8 06:09:57 1997  Len White <phreak@cgocable.net>

	* [misc/ddeml.c] [include/ddeml.h] [if1632/ddeml.spec]
	Added stub functions DdeConnectList(), DdeQueryNextServer(),
	DdeDisconnectList(), DdeSetUserHandle(), DdeAbandonTransaction(),
	DdePostAdvise(), DdeCreateDataHandle(), DdeAddData(), DdeGetData(),
	DdeAccessData(), DdeUnaccessData(), DdeEnableCallback(),
	DdeCmpStringHandles().

Fri Nov  7 19:44:26 1997  Olaf Flebbe  <o.flebbe@science-computing.de>

	* [files/directory.c]
	Fix typo in directory.c [broke loading of cdplayer on nt40]

	* [misc/main.c]
	Implemented -winver nt40.

	* [loader/resource.c] [user32.spec]
	Stubs for CopyAcceleratorTable, Destroy AcceleratorTable.

Thu Nov  6 22:37:04 1997  Morten Welinder  <welinder@rentec.com>

	* [files/drive.c]
	(GetDiskFreeSpace32A): Cap at 2GB.

	* [include/windows.h]
	Prototype DrawIconEx and CreateDIBSection32.
	Define OBM_RADIOCHECK.
	Add DI_* macros.

	* [objects/dib.c] [if1632/gdi.spec]
	CreateDIBSection is a WINAPI.  Renamed to CreateDIBSection32.
	Implement CreateDIBSection16.

	* [if1632/user.spec] [if1632/user32.spec]
	Add DrawIconEx.

	* [objects/cursoricon.c]
	(CopyIcon32): Fix bogus implementation.

	* [objects/bitmap.c]
	(CopyBitmap32): New function.
	(CopyImage32): Do bitmaps.

	* [graphics/x11drv/text.c]
	(X11DRV_ExtTextOut): Change ascent and descent default to avoid
	zero-thinkness overstrike line.

	* [include/debugstr.h] [misc/debugstr.c]
	New files.

	* [msdos/dpmi.c]
	Don't prototype do_mscdex. In INT_Int31Handler, handle real-mode
	int 0x21, ah=0x52.

	* [msdos/int2f.c]
	Add dummys for 0x1681 and 0x1682.

	* [misc/registry.c]
	Fix memory leaks in RegDeleteKey32W.

	* [objects/text.c]
	In TEXT_NextLine, fix another off-by-one bug.

	* [include/bitmaps/obm_radiocheck]
	New file.  (It a small circle used to radio-button menu items
	when selected.)
	
	* [objects/oembitmap.c]
	Add obm_radiocheck.

	* [include/windows.h] [if1632/user32.spec] [controls/menu.c]
	  [if1632/user.spec]
	Define CheckMenuRadioItem{16,32}.  Define GetMenuItemRect{16,32}.

Wed Nov  5 11:30:14 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
	* [misc/main.c]
	Auto adjust versions depending on binary.

Tue Nov  4 15:21:00 1997  Kristian Nielsen  <kristian.nielsen@risoe.dk>

	* [controls/listbox.c]
	Paint full background in listbox items with tab stops enabled.

	* [if1632/thunk.c]
	Copy some more message parameter structures (DRAWITEMSTRUCT16,
	COMPAREITEMSTRUCT16) to the stack segment to fix broken programs
	that need this.

	* [windows/dce.c]
	Only clip sibling windows when the parent has the WS_CLIPSIBLINGS
	style set.

	* [windows/focus.c]
	Make order of events in FOCUS_SwitchFocus() reflect API docs.

	* [windows/defdlg.c]
	Fix problem with loss of focus in some dialogs.

	* [win32/code_page.c]
	Fix return value for MultiByteToWideChar().

	* [BUGS]
	BCW now works.
This commit is contained in:
Alexandre Julliard 1997-11-16 17:38:29 +00:00
parent 491502b951
commit a0b2b1d0f6
152 changed files with 3911 additions and 2534 deletions

View File

@ -1,14 +1,14 @@
This is release 971101 of Wine, the MS Windows emulator. This is still a
This is release 971116 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-971101: (see ChangeLog for details)
- Win32 version of multimedia functions.
- ASPI support.
- Better DCE handling (in progress).
WHAT'S NEW with Wine-971116: (see ChangeLog for details)
- Emulator and library unification.
- New About dialog.
- Menus improvements.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-971101.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-971101.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-971101.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-971101.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-971116.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-971116.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-971116.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-971116.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

6
BUGS
View File

@ -5,7 +5,7 @@ done something for one of the problems. You are encouraged to
add new entries and, more importantly, remove those for the
bugs you fixed ;-)
------------------------------------------------------------
As of Oct 1997 -
As of Nov 1997 -
General:
@ -36,9 +36,7 @@ General:
Miscellaneous:
* Missing menu separators in BCW, other programs.
* BCW fails with "bad class 'MessageWindow'" message.
* Invisible controls in BCW dialogs.
* MIRC is unable to show 'Options' dialog.

167
ChangeLog
View File

@ -1,3 +1,168 @@
----------------------------------------------------------------------
Sun Nov 16 07:42:44 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [windows/dce.c] [windows/clipboard.c] [windows/nonclient.c]
Bug fixes.
* [misc/shell.c] [resources/*]
New "About" dialog.
Sat Nov 15 17:30:18 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure.in] [Makefile.in]
Replaced --with-library option by --disable-emulator. The default
is now to build both the library and the emulator.
Renamed --with options to --enable to follow autoconf guidelines.
* [loader/main.c] [miscemu/main.c] (New file)
Split initialization in WinelibInit/EmulatorInit.
* [loader/*.c]
Removed all remaining #ifdef's WINELIB.
* [controls/widgets.c] [windows/mdi.c]
Converted MDIClientWndProc to 32-bit.
* [debugger/break.c] [if1632/signal.c] [include/selectors.h]
[scheduler/thread.c]
Code and data selector values are now computed at run-time.
* [library/libres.c]
Moved to loader/ directory.
* [misc/main.c] [misc/version.c] (New file)
Moved all version stuff to version.c. Cleaned up a bit.
* [msdos/dpmi.c]
Update the REALMODECALL structure on return from real-mode
interrupt.
* [windows/event.c] [windows/keyboard.c]
Changed the way event coordinates are determined. Don't rely on
the ConfigureNotify event values. This should fix all problems
with cursor position in -desktop and -managed modes.
Sat Nov 15 16:09:36 1997 Slaven Rezic <eserte@cs.tu-berlin.de>
* [controls/button.c]
(BUTTON_CheckAutoRadioButton): Prevent possible endless loop.
Wed Nov 12 03:42:45 1997 Chris Faherty <chrisf@america.com>
* [misc/ver.c]
Changed VerInstall32A to assume srcdir as destination if destdir
is blank. This was causing alot of DLL installation into SYSTEM
directory to fail.
* [loader/ne_image.c]
NE_LoadSegment buffer[100] was too small and getting overruns.
Changed it to buffer[200].
Sat Nov 8 06:09:57 1997 Len White <phreak@cgocable.net>
* [misc/ddeml.c] [include/ddeml.h] [if1632/ddeml.spec]
Added stub functions DdeConnectList(), DdeQueryNextServer(),
DdeDisconnectList(), DdeSetUserHandle(), DdeAbandonTransaction(),
DdePostAdvise(), DdeCreateDataHandle(), DdeAddData(), DdeGetData(),
DdeAccessData(), DdeUnaccessData(), DdeEnableCallback(),
DdeCmpStringHandles().
Fri Nov 7 19:44:26 1997 Olaf Flebbe <o.flebbe@science-computing.de>
* [files/directory.c]
Fix typo in directory.c [broke loading of cdplayer on nt40]
* [misc/main.c]
Implemented -winver nt40.
* [loader/resource.c] [user32.spec]
Stubs for CopyAcceleratorTable, Destroy AcceleratorTable.
Thu Nov 6 22:37:04 1997 Morten Welinder <welinder@rentec.com>
* [files/drive.c]
(GetDiskFreeSpace32A): Cap at 2GB.
* [include/windows.h]
Prototype DrawIconEx and CreateDIBSection32.
Define OBM_RADIOCHECK.
Add DI_* macros.
* [objects/dib.c] [if1632/gdi.spec]
CreateDIBSection is a WINAPI. Renamed to CreateDIBSection32.
Implement CreateDIBSection16.
* [if1632/user.spec] [if1632/user32.spec]
Add DrawIconEx.
* [objects/cursoricon.c]
(CopyIcon32): Fix bogus implementation.
* [objects/bitmap.c]
(CopyBitmap32): New function.
(CopyImage32): Do bitmaps.
* [graphics/x11drv/text.c]
(X11DRV_ExtTextOut): Change ascent and descent default to avoid
zero-thinkness overstrike line.
* [include/debugstr.h] [misc/debugstr.c]
New files.
* [msdos/dpmi.c]
Don't prototype do_mscdex. In INT_Int31Handler, handle real-mode
int 0x21, ah=0x52.
* [msdos/int2f.c]
Add dummys for 0x1681 and 0x1682.
* [misc/registry.c]
Fix memory leaks in RegDeleteKey32W.
* [objects/text.c]
In TEXT_NextLine, fix another off-by-one bug.
* [include/bitmaps/obm_radiocheck]
New file. (It a small circle used to radio-button menu items
when selected.)
* [objects/oembitmap.c]
Add obm_radiocheck.
* [include/windows.h] [if1632/user32.spec] [controls/menu.c]
[if1632/user.spec]
Define CheckMenuRadioItem{16,32}. Define GetMenuItemRect{16,32}.
Wed Nov 5 11:30:14 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/main.c]
Auto adjust versions depending on binary.
Tue Nov 4 15:21:00 1997 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [controls/listbox.c]
Paint full background in listbox items with tab stops enabled.
* [if1632/thunk.c]
Copy some more message parameter structures (DRAWITEMSTRUCT16,
COMPAREITEMSTRUCT16) to the stack segment to fix broken programs
that need this.
* [windows/dce.c]
Only clip sibling windows when the parent has the WS_CLIPSIBLINGS
style set.
* [windows/focus.c]
Make order of events in FOCUS_SwitchFocus() reflect API docs.
* [windows/defdlg.c]
Fix problem with loss of focus in some dialogs.
* [win32/code_page.c]
Fix return value for MultiByteToWideChar().
* [BUGS]
BCW now works.
----------------------------------------------------------------------
Thu Oct 30 21:52:23 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
@ -108,7 +273,7 @@ Sun Oct 26 14:25:00 1997 Nikita V. Youshchenko <yoush@cs.msu.su>
* [include/drive.h] [files/drive.c] [msdos/int21.c]
Partially implemented DOS drive mapping (int21 AX=440F).
Sat Oct 25 13:03:29 1997 Alexandre Julliard <Alexandre.Julliard@urbanet.ch>
Sat Oct 25 13:03:29 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/debug.l]
Support '.' in identifiers. Use "x . y" to access structure

View File

@ -23,7 +23,7 @@ X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
XPM_LIB = -lXpm
XLIB = @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
WINELIB = $(WINESTUB) $(TOPOBJDIR)/@MAIN_TARGET@
WINELIB = $(WINESTUB) $(TOPOBJDIR)/@LIB_TARGET@
LDLIBS = @LDLIBS@
YACC = @YACC@
LEX = @LEX@

View File

@ -1,6 +1,7 @@
# This Makefile understands the following targets:
#
# all (default): build wine
# lib: build libwine
# clean: remove all intermediate files
# distclean: also remove all files created by configure
# install: install everything
@ -11,6 +12,7 @@
# Main target to build
MAIN_TARGET = @MAIN_TARGET@
LIB_TARGET = @LIB_TARGET@
# Directories
@ -20,7 +22,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = none
COMMONSUBDIRS = \
LIBSUBDIRS = \
rc \
controls \
files \
@ -28,6 +30,7 @@ COMMONSUBDIRS = \
graphics/metafiledrv \
graphics/x11drv \
ipc \
library \
loader \
memory \
misc \
@ -46,27 +49,24 @@ EMUSUBDIRS = \
if1632 \
miscemu
LIBSUBDIRS = library
PROGSUBDIRS = libtest programs
DOCSUBDIRS = documentation
# All sub-directories
ALLSUBDIRS = \
$(COMMONSUBDIRS) \
$(EMUSUBDIRS) \
$(LIBSUBDIRS) \
$(EMUSUBDIRS) \
$(PROGSUBDIRS) \
$(DOCSUBDIRS)
# Sub-directories to run make depend into
DEPENDSUBDIRS = $(COMMONSUBDIRS) $(LIBSUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
DEPENDSUBDIRS = $(LIBSUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
# Sub-directories to run make install into
INSTALLSUBDIRS = $(DOCSUBDIRS)
COMMONOBJS = \
LIBOBJS = \
controls/controls.o \
files/files.o \
graphics/graphics.o \
@ -90,34 +90,33 @@ EMUOBJS = \
if1632/if1632.o \
miscemu/miscemu.o
LIBOBJS = library/library.o
all: $(MAIN_TARGET)
@MAKE_RULES@
install:: install_$(MAIN_TARGET)
wine wine.sym: $(COMMONSUBDIRS) $(EMUSUBDIRS) dummy
$(CC) -o wine $(COMMONOBJS) $(EMUOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
emu: wine
lib: $(LIB_TARGET)
wine wine.sym: $(LIB_TARGET) $(EMUSUBDIRS) dummy
$(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
nm -n wine | grep -v _compiled >wine.sym
install_wine: dummy
$(INSTALL_PROGRAM) wine $(bindir)/wine
libwine.a: $(COMMONSUBDIRS) $(LIBSUBDIRS) dummy
libwine.a: $(LIBSUBDIRS) dummy
$(RM) $@
$(AR) $@ $(COMMONOBJS) $(LIBOBJS)
$(AR) $@ $(LIBOBJS)
$(RANLIB) $@
install_libwine.a: install_includes
$(INSTALL_DATA) libwine.a $(libdir)
libwine.so.1.0: $(LIBSUBDIRS) dummy
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
libwine.so.1.0: $(COMMONSUBDIRS) $(LIBSUBDIRS) dummy
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(COMMONOBJS) $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
install_emu: dummy
$(INSTALL_PROGRAM) wine $(bindir)/wine
install_libwine.so.1.0: install_includes
$(INSTALL_DATA) libwine.so.1.0 $(libdir)
install_lib: install_includes
$(INSTALL_DATA) $(LIB_TARGET) $(libdir)
install_includes: dummy
if [ -d $(includedir) ]; then : ; else $(MKDIR) $(includedir); fi

11
README
View File

@ -23,13 +23,12 @@ it are probably available on the ftp site where you got Wine. They can
also be found on ftp.x.org and all its mirror sites.
To build Wine, first do a "./configure" and then a "make depend; make".
The executable "wine" will be built. "wine" will load and run 16-bit
Windows executables.
This will build the library "libwine.a" and the program "wine".
To build Winelib, do a "./configure --with-library", and then a "make
depend; make". The library "winelib.a" will be built, allowing to
compile Windows source code under Unix. If you have an ELF compiler,
you can use "./configure --with-dll" instead to build a shared library.
The program "wine" will load and run Windows executables.
The library "libwine.a" can be used to compile and link Windows source
code under Unix. If you have an ELF compiler, you can use
"./configure --enable-dll" to build a shared library instead.
To upgrade to a new release by using a patch file, first cd to the
top-level directory of the release (the one containing this README

230
configure vendored
View File

@ -13,11 +13,11 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--with-library build Wine as a library instead of an emulator"
--disable-emulator build only the Wine library, not the emulator"
ac_help="$ac_help
--with-dll build Wine as a DLL instead of an emulator"
--enable-dll build the Wine library as a DLL"
ac_help="$ac_help
--with-ipc use inter-process communication for DDE"
--enable-ipc use inter-process communication for DDE"
ac_help="$ac_help
--with-x use the X Window System"
@ -553,26 +553,27 @@ test -z "$LDLIBS" && LDLIBS=-lm
test -z "$PROGEXT" && PROGEXT=""
# Check whether --with-library or --without-library was given.
if test "${with_library+set}" = set; then
withval="$with_library"
OPTIONS="-DWINELIB" MAIN_TARGET="libwine.a"
else
OPTIONS="" MAIN_TARGET="wine"
MAIN_TARGET=emu
LIB_TARGET=libwine.a
# Check whether --enable-emulator or --disable-emulator was given.
if test "${enable_emulator+set}" = set; then
enableval="$enable_emulator"
if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi
fi
# Check whether --with-dll or --without-dll was given.
if test "${with_dll+set}" = set; then
withval="$with_dll"
OPTIONS="-DWINELIB" MAIN_TARGET="libwine.so.1.0"
# Check whether --enable-dll or --disable-dll was given.
if test "${enable_dll+set}" = set; then
enableval="$enable_dll"
if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi
fi
# Check whether --with-ipc or --without-ipc was given.
if test "${with_ipc+set}" = set; then
withval="$with_ipc"
OPTIONS="$OPTIONS -DCONFIG_IPC"
if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi
fi
@ -580,8 +581,9 @@ fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:585: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo "configure:587: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -610,7 +612,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:614: checking for $ac_word" >&5
echo "configure:616: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -639,7 +641,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:643: checking for $ac_word" >&5
echo "configure:645: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -687,7 +689,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
echo "configure:693: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -697,11 +699,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
#line 701 "configure"
#line 703 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@ -721,12 +723,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "configure:727: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:730: checking whether we are using GNU C" >&5
echo "configure:732: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -735,7 +737,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@ -750,7 +752,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:754: checking whether ${CC-cc} accepts -g" >&5
echo "configure:756: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -778,7 +780,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:782: checking how to run the C preprocessor" >&5
echo "configure:784: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -793,13 +795,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 797 "configure"
#line 799 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -810,13 +812,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 814 "configure"
#line 816 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -843,7 +845,7 @@ echo "$ac_t""$CPP" 1>&6
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:847: checking for X" >&5
echo "configure:849: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@ -905,12 +907,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 909 "configure"
#line 911 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -979,14 +981,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 983 "configure"
#line 985 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@ -1092,17 +1094,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
echo "configure:1096: checking whether -R must be followed by a space" >&5
echo "configure:1098: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
#line 1099 "configure"
#line 1101 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:1106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_nospace=yes
else
@ -1118,14 +1120,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
#line 1122 "configure"
#line 1124 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_space=yes
else
@ -1157,7 +1159,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
echo "configure:1161: checking for dnet_ntoa in -ldnet" >&5
echo "configure:1163: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1165,7 +1167,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1169 "configure"
#line 1171 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1176,7 +1178,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1198,7 +1200,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
echo "configure:1202: checking for dnet_ntoa in -ldnet_stub" >&5
echo "configure:1204: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1206,7 +1208,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1210 "configure"
#line 1212 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1217,7 +1219,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1246,12 +1248,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:1250: checking for gethostbyname" >&5
echo "configure:1252: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1255 "configure"
#line 1257 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@ -1274,7 +1276,7 @@ gethostbyname();
; return 0; }
EOF
if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@ -1295,7 +1297,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:1299: checking for gethostbyname in -lnsl" >&5
echo "configure:1301: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1303,7 +1305,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1307 "configure"
#line 1309 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1314,7 +1316,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1344,12 +1346,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:1348: checking for connect" >&5
echo "configure:1350: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1353 "configure"
#line 1355 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@ -1372,7 +1374,7 @@ connect();
; return 0; }
EOF
if { (eval echo configure:1376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@ -1393,7 +1395,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:1397: checking for connect in -lsocket" >&5
echo "configure:1399: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1401,7 +1403,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1405 "configure"
#line 1407 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1412,7 +1414,7 @@ int main() {
connect()
; return 0; }
EOF
if { (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1436,12 +1438,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
echo "configure:1440: checking for remove" >&5
echo "configure:1442: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1445 "configure"
#line 1447 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@ -1464,7 +1466,7 @@ remove();
; return 0; }
EOF
if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@ -1485,7 +1487,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
echo "configure:1489: checking for remove in -lposix" >&5
echo "configure:1491: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1493,7 +1495,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1497 "configure"
#line 1499 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1504,7 +1506,7 @@ int main() {
remove()
; return 0; }
EOF
if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1528,12 +1530,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
echo "configure:1532: checking for shmat" >&5
echo "configure:1534: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1537 "configure"
#line 1539 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@ -1556,7 +1558,7 @@ shmat();
; return 0; }
EOF
if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@ -1577,7 +1579,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
echo "configure:1581: checking for shmat in -lipc" >&5
echo "configure:1583: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1585,7 +1587,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1589 "configure"
#line 1591 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1596,7 +1598,7 @@ int main() {
shmat()
; return 0; }
EOF
if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1629,7 +1631,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
echo "configure:1633: checking for IceConnectionNumber in -lICE" >&5
echo "configure:1635: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1637,7 +1639,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1641 "configure"
#line 1643 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1648,7 +1650,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
if { (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1677,7 +1679,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1681: checking for $ac_word" >&5
echo "configure:1683: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1709,7 +1711,7 @@ test -n "$YACC" || YACC="yacc"
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1713: checking for $ac_word" >&5
echo "configure:1715: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1742,7 +1744,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:1746: checking for yywrap in -l$ac_lib" >&5
echo "configure:1748: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1750,7 +1752,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1754 "configure"
#line 1756 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1761,7 +1763,7 @@ int main() {
yywrap()
; return 0; }
EOF
if { (eval echo configure:1765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1786,7 +1788,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1790: checking for $ac_word" >&5
echo "configure:1792: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1823,7 +1825,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1827: checking for a BSD compatible install" >&5
echo "configure:1829: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1873,7 +1875,7 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:1877: checking whether ln -s works" >&5
echo "configure:1879: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1894,7 +1896,7 @@ else
fi
echo $ac_n "checking for i386_set_ldt in -li386""... $ac_c" 1>&6
echo "configure:1898: checking for i386_set_ldt in -li386" >&5
echo "configure:1900: checking for i386_set_ldt in -li386" >&5
ac_lib_var=`echo i386'_'i386_set_ldt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1902,7 +1904,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li386 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1906 "configure"
#line 1908 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1913,7 +1915,7 @@ int main() {
i386_set_ldt()
; return 0; }
EOF
if { (eval echo configure:1917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1941,7 +1943,7 @@ if test "x${GCC}" = "xyes"
then
CFLAGS="$CFLAGS -Wall"
echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
echo "configure:1945: checking "for gcc strength-reduce bug"" >&5
echo "configure:1947: checking "for gcc strength-reduce bug"" >&5
if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1949,7 +1951,7 @@ else
ac_cv_c_gcc_strength_bug="yes"
else
cat > conftest.$ac_ext <<EOF
#line 1953 "configure"
#line 1955 "configure"
#include "confdefs.h"
int main(void) {
@ -1960,7 +1962,7 @@ int main(void) {
exit( Array[1] != -2 );
}
EOF
if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_gcc_strength_bug="no"
else
@ -1983,7 +1985,7 @@ fi
echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
echo "configure:1987: checking "whether external symbols need an underscore prefix"" >&5
echo "configure:1989: checking "whether external symbols need an underscore prefix"" >&5
if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1995,14 +1997,14 @@ _ac_test:
.long 0
EOF
cat > conftest.$ac_ext <<EOF
#line 1999 "configure"
#line 2001 "configure"
#include "confdefs.h"
extern int ac_test;
int main() {
if (ac_test) return 1
; return 0; }
EOF
if { (eval echo configure:2006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_extern_prefix="yes"
else
@ -2025,24 +2027,25 @@ EOF
fi
if test "$MAIN_TARGET" = "libwine.so.1.0"
DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0"
then
echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
echo "configure:2032: checking "whether we can build a dll"" >&5
echo "configure:2035: checking "whether we can build a dll"" >&5
if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
cat > conftest.$ac_ext <<EOF
#line 2039 "configure"
#line 2042 "configure"
#include "confdefs.h"
int main() {
return 1
; return 0; }
EOF
if { (eval echo configure:2046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_dll="yes"
else
@ -2059,22 +2062,23 @@ fi
echo "$ac_t""$ac_cv_c_dll" 1>&6
if test "$ac_cv_c_dll" = "yes"
then
CFLAGS="$CFLAGS -fPIC"
DLLFLAGS="-fPIC"
else
MAIN_TARGET="libwine.a"
LIB_TARGET="libwine.a"
fi
fi
for ac_func in memmove tcgetattr usleep wait4 waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2073: checking for $ac_func" >&5
echo "configure:2077: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2078 "configure"
#line 2082 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -2097,7 +2101,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2122,12 +2126,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:2126: checking whether stat file-mode macros are broken" >&5
echo "configure:2130: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2131 "configure"
#line 2135 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -2178,12 +2182,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2182: checking for working const" >&5
echo "configure:2186: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2187 "configure"
#line 2191 "configure"
#include "confdefs.h"
int main() {
@ -2232,7 +2236,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:2236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@ -2253,12 +2257,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2257: checking for ANSI C header files" >&5
echo "configure:2261: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2262 "configure"
#line 2266 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -2266,7 +2270,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2283,7 +2287,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2287 "configure"
#line 2291 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@ -2301,7 +2305,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2305 "configure"
#line 2309 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -2322,7 +2326,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 2326 "configure"
#line 2330 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -2333,7 +2337,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@ -2357,12 +2361,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2361: checking for size_t" >&5
echo "configure:2365: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2366 "configure"
#line 2370 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@ -2558,6 +2562,7 @@ s%@mandir@%$mandir%g
s%@LDLIBS@%$LDLIBS%g
s%@PROGEXT@%$PROGEXT%g
s%@MAIN_TARGET@%$MAIN_TARGET%g
s%@LIB_TARGET@%$LIB_TARGET%g
s%@OPTIONS@%$OPTIONS%g
s%@SET_MAKE@%$SET_MAKE%g
s%@CC@%$CC%g
@ -2573,6 +2578,7 @@ s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@DLLFLAGS@%$DLLFLAGS%g
/@MAKE_RULES@/r $MAKE_RULES
s%@MAKE_RULES@%%g

View File

@ -12,20 +12,24 @@ test -z "$PROGEXT" && PROGEXT="" AC_SUBST(PROGEXT)
dnl **** Command-line arguments ****
AC_ARG_WITH(library,
[ --with-library build Wine as a library instead of an emulator],
[OPTIONS="-DWINELIB" MAIN_TARGET="libwine.a"],
[OPTIONS="" MAIN_TARGET="wine"])
dnl Default values
MAIN_TARGET=emu
LIB_TARGET=libwine.a
AC_ARG_WITH(dll,
[ --with-dll build Wine as a DLL instead of an emulator],
[OPTIONS="-DWINELIB" MAIN_TARGET="libwine.so.1.0"])
AC_ARG_ENABLE(emulator,
[ --disable-emulator build only the Wine library, not the emulator],
[if test "$enableval" = "no"; then MAIN_TARGET="lib"; fi])
AC_ARG_ENABLE(dll,
[ --enable-dll build the Wine library as a DLL],
[if test "$enableval" = "no"; then : ; else LIB_TARGET="libwine.so.1.0"; fi])
AC_ARG_WITH(ipc,
[ --with-ipc use inter-process communication for DDE],
[OPTIONS="$OPTIONS -DCONFIG_IPC"])
[ --enable-ipc use inter-process communication for DDE],
[if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
AC_SUBST(MAIN_TARGET)
AC_SUBST(LIB_TARGET)
AC_SUBST(OPTIONS)
dnl **** Check for some programs and libraries ****
@ -89,7 +93,8 @@ fi
dnl **** Check for working dll ****
if test "$MAIN_TARGET" = "libwine.so.1.0"
DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0"
then
AC_CACHE_CHECK("whether we can build a dll",
ac_cv_c_dll,
@ -100,11 +105,12 @@ then
])
if test "$ac_cv_c_dll" = "yes"
then
CFLAGS="$CFLAGS -fPIC"
DLLFLAGS="-fPIC"
else
MAIN_TARGET="libwine.a"
LIB_TARGET="libwine.a"
fi
fi
AC_SUBST(DLLFLAGS)
dnl **** Check for functions and header files ****

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -110,15 +110,16 @@ LRESULT WINAPI ButtonWndProc( HWND32 hWnd, UINT32 uMsg,
return 0;
case WM_ERASEBKGND:
break;
return 1;
case WM_PAINT:
if (btnPaintFunc[style])
{
PAINTSTRUCT32 ps;
HDC32 hdc = BeginPaint32( hWnd, &ps );
HDC32 hdc = wParam ? (HDC32)wParam : BeginPaint32( hWnd, &ps );
SetBkMode32( hdc, OPAQUE );
(btnPaintFunc[style])( wndPtr, hdc, ODA_DRAWENTIRE );
EndPaint32( hWnd, &ps );
if( !wParam ) EndPaint32( hWnd, &ps );
}
break;
@ -384,7 +385,15 @@ static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
rbox = rtext = client;
if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
/* Something is still not right, checkboxes (and edit controls)
* in wsping32 have white backgrounds instead of dark grey.
* BUTTON_SEND_CTLCOLOR() is even worse since it returns 0 in this
* particular case and the background is not painted at all.
*/
hBrush = GetControlBrush( wndPtr->hwndSelf, hDC, CTLCOLOR_BTN );
if (wndPtr->dwStyle & BS_LEFTTEXT)
{
/* magic +4 is what CTL3D expects */
@ -423,6 +432,7 @@ static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
SetTextColor32( hDC, GetSysColor32(COLOR_GRAYTEXT) );
DrawText16( hDC, wndPtr->text, textlen, &rtext,
DT_SINGLELINE | DT_VCENTER );
textlen = 0; /* skip DrawText() below */
}
}
@ -453,14 +463,19 @@ static void CB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
*/
static void BUTTON_CheckAutoRadioButton( WND *wndPtr )
{
HWND32 parent, sibling;
HWND32 parent, sibling, start;
if (!(wndPtr->dwStyle & WS_CHILD)) return;
parent = wndPtr->parent->hwndSelf;
for(sibling = GetNextDlgGroupItem32( parent, wndPtr->hwndSelf, FALSE );
sibling != wndPtr->hwndSelf && sibling != 0;
sibling = GetNextDlgGroupItem32( parent, sibling, FALSE ))
if((WIN_FindWndPtr(sibling)->dwStyle & 0x0f) == BS_AUTORADIOBUTTON)
SendMessage32A( sibling, BM_SETCHECK32, BUTTON_UNCHECKED, 0 );
/* assure that starting control is not disabled or invisible */
start = sibling = GetNextDlgGroupItem32( parent, wndPtr->hwndSelf, TRUE );
do
{
if (!sibling) break;
if ((wndPtr->hwndSelf != sibling) &&
((WIN_FindWndPtr(sibling)->dwStyle & 0x0f) == BS_AUTORADIOBUTTON))
SendMessage32A( sibling, BM_SETCHECK32, BUTTON_UNCHECKED, 0 );
sibling = GetNextDlgGroupItem32( parent, sibling, FALSE );
} while (sibling != start);
}
@ -506,9 +521,9 @@ static void UB_Paint( WND *wndPtr, HDC32 hDC, WORD action )
GetClientRect16( wndPtr->hwndSelf, &rc);
if (infoPtr->hFont) SelectObject32( hDC, infoPtr->hFont );
hBrush = BUTTON_SEND_CTLCOLOR( wndPtr, hDC );
FillRect16( hDC, &rc, hBrush );
hBrush = GetControlBrush( wndPtr->hwndSelf, hDC, CTLCOLOR_BTN );
FillRect16( hDC, &rc, hBrush );
if ((action == ODA_FOCUS) ||
((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS)))
DrawFocusRect16( hDC, &rc );

View File

@ -1055,24 +1055,33 @@ static INT32 EDIT_CharFromPos(WND *wnd, EDITSTATE *es, INT32 x, INT32 y, LPBOOL3
dc = GetDC32(wnd->hwndSelf);
if (es->font)
old_font = SelectObject32(dc, es->font);
if (x < 0) {
x = -x;
/* FIXME: inefficient algorithm */
for (index = es->x_offset ; index ; index--) {
GetTextExtentPoint32A(dc, text + index,
es->x_offset - index, &size);
if (size.cx > x)
break;
}
} else {
INT32 len = lstrlen32A(es->text);
/* FIXME: inefficient algorithm */
for (index = es->x_offset ; index < len ; index++) {
GetTextExtentPoint32A(dc, text + es->x_offset,
index - es->x_offset, &size);
if (size.cx >= x)
break;
}
if (x < 0)
{
INT32 low = 0;
INT32 high = es->x_offset;
while (low < high - 1)
{
INT32 mid = (low + high) / 2;
GetTextExtentPoint32A( dc, text + mid,
es->x_offset - mid, &size );
if (size.cx > -x) low = mid;
else high = mid;
}
index = low;
}
else
{
INT32 low = es->x_offset;
INT32 high = lstrlen32A(es->text) + 1;
while (low < high - 1)
{
INT32 mid = (low + high) / 2;
GetTextExtentPoint32A( dc, text + es->x_offset,
mid - es->x_offset, &size );
if (size.cx > x) high = mid;
else low = mid;
}
index = low;
}
if (es->style & ES_PASSWORD)
HeapFree(es->heap, 0 ,text);

View File

@ -492,9 +492,14 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc,
ETO_OPAQUE | ETO_CLIPPED, rect, item->str,
strlen(item->str), NULL );
else
{
/* Output empty string to paint background in the full width. */
ExtTextOut32A( hdc, rect->left + 1, rect->top + 1,
ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL );
TabbedTextOut32A( hdc, rect->left + 1 , rect->top + 1,
item->str, strlen(item->str),
descr->nb_tabs, descr->tabs, 0);
}
if (item && item->selected)
{
SetBkColor32( hdc, oldBk );

View File

@ -3,6 +3,7 @@
*
* Copyright 1993 Martin Ayotte
* Copyright 1994 Alexandre Julliard
* Copyright 1997 Morten Welinder
*/
/*
@ -142,6 +143,7 @@ typedef struct
static WORD check_bitmap_width = 0, check_bitmap_height = 0;
static WORD arrow_bitmap_width = 0, arrow_bitmap_height = 0;
static HBITMAP32 hStdRadioCheck = 0;
static HBITMAP32 hStdCheck = 0;
static HBITMAP32 hStdMnArrow = 0;
static HBRUSH32 hShadeBrush = 0;
@ -316,38 +318,50 @@ HMENU32 MENU_GetSysMenu( HWND32 hWnd, HMENU32 hPopupMenu )
*/
BOOL32 MENU_Init()
{
/* Load menu bitmaps */
HBITMAP32 hBitmap;
static unsigned char shade_bits[16] = { 0x55, 0, 0xAA, 0,
0x55, 0, 0xAA, 0,
0x55, 0, 0xAA, 0,
0x55, 0, 0xAA, 0 };
if ((hStdCheck = LoadBitmap32A( 0, (LPSTR)MAKEINTRESOURCE(OBM_CHECK) )))
/* Load menu bitmaps */
hStdCheck = LoadBitmap32A(0, (LPSTR)MAKEINTRESOURCE(OBM_CHECK));
hStdRadioCheck = LoadBitmap32A(0, (LPSTR)MAKEINTRESOURCE(OBM_RADIOCHECK));
hStdMnArrow = LoadBitmap32A(0, (LPSTR)MAKEINTRESOURCE(OBM_MNARROW));
if (hStdCheck)
{
BITMAP32 bm;
GetObject32A( hStdCheck, sizeof(bm), &bm );
check_bitmap_width = bm.bmWidth;
check_bitmap_height = bm.bmHeight;
} else
return FALSE;
if ((hStdMnArrow = LoadBitmap32A(0,(LPSTR)MAKEINTRESOURCE(OBM_MNARROW))))
/* Assume that radio checks have the same size as regular check. */
if (!hStdRadioCheck)
return FALSE;
if (hStdMnArrow)
{
HBITMAP32 hBitmap;
static unsigned char shade_bits[16] = { 0x55, 0, 0xAA, 0,
0x55, 0, 0xAA, 0,
0x55, 0, 0xAA, 0,
0x55, 0, 0xAA, 0 };
BITMAP32 bm;
GetObject32A( hStdMnArrow, sizeof(bm), &bm );
arrow_bitmap_width = bm.bmWidth;
arrow_bitmap_height = bm.bmHeight;
} else
return FALSE;
if((hBitmap = CreateBitmap32( 8, 8, 1, 1, shade_bits)))
if ((hBitmap = CreateBitmap32( 8, 8, 1, 1, shade_bits)))
{
if((hShadeBrush = CreatePatternBrush32( hBitmap )))
{
DeleteObject32( hBitmap );
if((MENU_DefSysPopup = MENU_CopySysPopup())) return TRUE;
}
}
if ((MENU_DefSysPopup = MENU_CopySysPopup()))
return TRUE;
}
}
return FALSE; /* failure */
return FALSE;
}
/***********************************************************************
@ -720,7 +734,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND32 hwndOwner )
/***********************************************************************
* MENU_MenuBarCalcSize
*
* FIXME: Word 6 implements it's own MDI and it's 'close window' bitmap
* FIXME: Word 6 implements its own MDI and its own 'close window' bitmap
* height is off by 1 pixel which causes lengthy window relocations when
* active document window is maximized/restored.
*
@ -936,10 +950,16 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
*/
if (lpitem->fState & MF_CHECKED)
GRAPH_DrawBitmap( hdc, lpitem->hCheckBit ? lpitem->hCheckBit
: hStdCheck, rect.left, (y - check_bitmap_height) / 2,
0, 0, check_bitmap_width, check_bitmap_height, TRUE );
else if (lpitem->hUnCheckBit)
{
HBITMAP32 bm =
lpitem->hCheckBit ? lpitem->hCheckBit :
((lpitem->fType & MFT_RADIOCHECK)
? hStdRadioCheck : hStdCheck);
GRAPH_DrawBitmap( hdc, bm, rect.left,
(y - check_bitmap_height) / 2,
0, 0, check_bitmap_width,
check_bitmap_height, TRUE );
} else if (lpitem->hUnCheckBit)
GRAPH_DrawBitmap( hdc, lpitem->hUnCheckBit, rect.left,
(y - check_bitmap_height) / 2, 0, 0,
check_bitmap_width, check_bitmap_height, TRUE );
@ -3872,3 +3892,105 @@ BOOL32 WINAPI InsertMenuItem32W(HMENU32 hMenu, UINT32 uItem, BOOL32 bypos,
MENUITEM *item = MENU_InsertItem(hMenu, uItem, bypos);
return SetMenuItemInfo32_common(item, (const MENUITEMINFO32A*)lpmii, TRUE);
}
/**********************************************************************
* CheckMenuRadioItem32 (USER32.47)
*/
BOOL32 WINAPI CheckMenuRadioItem32(HMENU32 hMenu,
UINT32 first, UINT32 last, UINT32 check,
BOOL32 bypos)
{
MENUITEM *mifirst, *milast, *micheck;
HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu;
dprintf_menu (stddeb,
"CheckMenuRadioItem32: ox%x: %d-%d, check %d, bypos=%d\n",
hMenu, first, last, check, bypos);
mifirst = MENU_FindItem (&mfirst, &first, bypos);
milast = MENU_FindItem (&mlast, &last, bypos);
micheck = MENU_FindItem (&mcheck, &check, bypos);
if (mifirst == NULL || milast == NULL || micheck == NULL ||
mifirst > milast || mfirst != mlast || mfirst != mcheck ||
micheck > milast || micheck < mifirst)
return FALSE;
while (mifirst <= milast)
{
if (mifirst == micheck)
{
mifirst->fType |= MFT_RADIOCHECK;
mifirst->fState |= MFS_CHECKED;
} else {
mifirst->fType &= ~MFT_RADIOCHECK;
mifirst->fState &= ~MFS_CHECKED;
}
mifirst++;
}
return TRUE;
}
/**********************************************************************
* CheckMenuRadioItem16 (not a Windows API)
*/
BOOL16 WINAPI CheckMenuRadioItem16(HMENU16 hMenu,
UINT16 first, UINT16 last, UINT16 check,
BOOL16 bypos)
{
return CheckMenuRadioItem32 (hMenu, first, last, check, bypos);
}
/**********************************************************************
* GetMenuItemRect32 (USER32.266)
*/
BOOL32 WINAPI GetMenuItemRect32 (HWND32 hwnd, HMENU32 hMenu, UINT32 uItem,
LPRECT32 rect)
{
RECT32 saverect, clientrect;
BOOL32 barp;
HDC32 hdc;
WND *wndPtr;
MENUITEM *item;
HMENU32 orghMenu = hMenu;
dprintf_menu (stddeb, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n",
hwnd, hMenu, uItem, rect);
item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION);
wndPtr = WIN_FindWndPtr (hwnd);
if (!rect || !item || !wndPtr) return FALSE;
GetClientRect32( hwnd, &clientrect );
hdc = GetDCEx32( hwnd, 0, DCX_CACHE | DCX_WINDOW );
barp = (hMenu == orghMenu);
saverect = item->rect;
MENU_CalcItemSize (hdc, item, hwnd,
clientrect.left, clientrect.top, barp);
*rect = item->rect;
item->rect = saverect;
ReleaseDC32( hwnd, hdc );
return TRUE;
}
/**********************************************************************
* GetMenuItemRect16 (USER.665)
*/
BOOL16 WINAPI GetMenuItemRect16 (HWND16 hwnd, HMENU16 hMenu, UINT16 uItem,
LPRECT16 rect)
{
RECT32 r32;
BOOL32 res;
if (!rect) return FALSE;
res = GetMenuItemRect32 (hwnd, hMenu, uItem, &r32);
CONV_RECT32TO16 (&r32, rect);
return res;
}

View File

@ -84,7 +84,7 @@ static HICON16 STATIC_SetBitmap( WND *wndPtr, HICON16 hicon )
{
HICON16 prevIcon;
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
BITMAPOBJ *info = GDI_HEAP_LOCK(hicon);
BITMAPOBJ *info = (BITMAPOBJ *)GDI_HEAP_LOCK(hicon);
if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0;
if (hicon && !info) {

View File

@ -32,31 +32,9 @@ extern LRESULT WINAPI PopupMenuWndProc( HWND32 hwnd, UINT32 msg,
extern LRESULT WINAPI IconTitleWndProc( HWND32 hwnd, UINT32 msg,
WPARAM32 wParam, LPARAM lParam );
/* Win16 class info */
/* Built-in classes */
typedef struct
{
UINT16 style;
INT16 wndExtra;
HBRUSH16 background;
LPCSTR procName;
LPCSTR className;
} BUILTIN_CLASS_INFO16;
/* Win16 built-in classes */
static const BUILTIN_CLASS_INFO16 WIDGETS_BuiltinClasses16[] =
{
{ CS_GLOBALCLASS, sizeof(MDICLIENTINFO),
STOCK_LTGRAY_BRUSH, "MDIClientWndProc", "MDIClient" }
};
#define NB_BUILTIN_CLASSES16 \
(sizeof(WIDGETS_BuiltinClasses16)/sizeof(WIDGETS_BuiltinClasses16[0]))
/* Win32 built-in classes */
static WNDCLASS32A WIDGETS_BuiltinClasses32[BIC32_NB_CLASSES] =
static WNDCLASS32A WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
{
/* BIC32_BUTTON */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
@ -82,6 +60,9 @@ static WNDCLASS32A WIDGETS_BuiltinClasses32[BIC32_NB_CLASSES] =
/* BIC32_SCROLL */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, IDC_ARROW, 0, 0, "ScrollBar"},
/* BIC32_MDICLIENT */
{ CS_GLOBALCLASS, MDIClientWndProc,
0, sizeof(MDICLIENTINFO), 0, 0, 0, STOCK_LTGRAY_BRUSH, 0, "MDIClient" },
/* BIC32_DESKTOP */
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, IDC_ARROW, 0, 0, DESKTOP_CLASS_NAME },
@ -103,45 +84,22 @@ static ATOM bicAtomTable[BIC32_NB_CLASSES];
BOOL32 WIDGETS_Init(void)
{
int i;
char *name;
const BUILTIN_CLASS_INFO16 *info16 = WIDGETS_BuiltinClasses16;
WNDCLASS16 class16;
WNDCLASS32A *class32 = WIDGETS_BuiltinClasses32;
WNDCLASS32A *cls = WIDGETS_BuiltinClasses;
if (!(name = SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE;
/* Create builtin classes */
/* Create 16-bit classes */
class16.cbClsExtra = 0;
class16.hInstance = 0;
class16.hIcon = 0;
class16.hCursor = LoadCursor16( 0, IDC_ARROW );
class16.lpszMenuName = (SEGPTR)0;
class16.lpszClassName = SEGPTR_GET(name);
for (i = 0; i < NB_BUILTIN_CLASSES16; i++, info16++)
{
class16.style = info16->style;
class16.lpfnWndProc = (WNDPROC16)MODULE_GetWndProcEntry16( info16->procName );
class16.cbWndExtra = info16->wndExtra;
class16.hbrBackground = info16->background;
strcpy( name, info16->className );
if (!RegisterClass16( &class16 )) return FALSE;
}
/* Create 32-bit classes */
for (i = 0; i < BIC32_NB_CLASSES; i++, class32++)
for (i = 0; i < BIC32_NB_CLASSES; i++, cls++)
{
char name[20];
/* Just to make sure the string is > 0x10000 */
strcpy( name, (char *)class32->lpszClassName );
class32->lpszClassName = name;
class32->hCursor = LoadCursor16( 0, class32->hCursor );
if (!(bicAtomTable[i] = RegisterClass32A( class32 ))) return FALSE;
strcpy( name, (char *)cls->lpszClassName );
cls->lpszClassName = name;
cls->hCursor = LoadCursor16( 0, cls->hCursor );
if (!(bicAtomTable[i] = RegisterClass32A( cls ))) return FALSE;
}
/* FIXME: hack to enable using built-in controls with Windows COMCTL32 */
InitCommonControls();
SEGPTR_FREE(name);
return TRUE;
}

View File

@ -388,12 +388,13 @@ BOOL32 DEBUG_ShouldContinue( enum exec_mode mode, int * count )
DBG_ADDR cond_addr;
int bpnum;
struct list_id list;
WORD cs;
/* If not single-stepping, back up over the int3 instruction */
if (!(EFL_reg(&DEBUG_context) & STEP_FLAG)) EIP_reg(&DEBUG_context)--;
addr.seg = (CS_reg(&DEBUG_context) == WINE_CODE_SELECTOR) ?
0 : CS_reg(&DEBUG_context);
GET_CS(cs);
addr.seg = (CS_reg(&DEBUG_context) == cs) ? 0 : CS_reg(&DEBUG_context);
addr.off = EIP_reg(&DEBUG_context);
bpnum = DEBUG_FindBreakpoint( &addr );
@ -512,9 +513,10 @@ enum exec_mode DEBUG_RestartExecution( enum exec_mode mode, int count )
unsigned int * value;
enum exec_mode ret_mode;
BYTE *instr;
WORD cs;
addr.seg = (CS_reg(&DEBUG_context) == WINE_CODE_SELECTOR) ?
0 : CS_reg(&DEBUG_context);
GET_CS(cs);
addr.seg = (CS_reg(&DEBUG_context) == cs) ? 0 : CS_reg(&DEBUG_context);
addr.off = EIP_reg(&DEBUG_context);
/*

View File

@ -441,13 +441,8 @@ static void DEBUG_Main( int signal )
DEBUG_ReadSymbolTable( SymbolTableFile );
}
/*
* Read COFF, MSC, etc debug information that we noted when we
* started up the executable.
*/
DEBUG_ProcessDeferredDebug();
DEBUG_LoadEntryPoints();
DEBUG_ProcessDeferredDebug();
fprintf(stderr,"\n");
}

View File

@ -633,21 +633,19 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
* Try and find the nearest line number to the current offset.
*/
if( nearest->linetab != NULL )
{
/*
* FIXME - this is an inefficient linear search. A binary
* search would be better if this gets to be a performance
* bottleneck.
*/
for(i=0; i < nearest->n_lines; i++)
{
if( addr->off < nearest->linetab[i].pc_offset.off )
{
break;
}
lineno = nearest->linetab[i].line_number;
}
}
{
low = 0;
high = nearest->n_lines;
while ((high - low) > 1)
{
mid = (high + low) / 2;
if (addr->off < nearest->linetab[mid].pc_offset.off)
high = mid;
else
low = mid;
}
lineno = nearest->linetab[low].line_number;
}
if( lineno != -1 )
{
@ -799,6 +797,7 @@ static void DEBUG_LoadEntryPoints32( PE_MODULE *pe, const char *name )
char buffer[256];
int i, j;
IMAGE_EXPORT_DIRECTORY *exports;
IMAGE_DATA_DIRECTORY *debug_dir;
DWORD load_addr;
WORD *ordinals;
void **functions;
@ -859,6 +858,11 @@ static void DEBUG_LoadEntryPoints32( PE_MODULE *pe, const char *name )
addr.off = (DWORD)RVA( functions[i] );
DEBUG_AddSymbol( buffer, &addr, NULL, SYM_WIN32 | SYM_FUNC );
}
debug_dir = &pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG];
if (debug_dir->Size)
DEBUG_RegisterDebugInfo( pe, load_addr, name,
debug_dir->VirtualAddress, debug_dir->Size );
#undef RVA
}
@ -976,7 +980,6 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr)
{
struct name_hash * nearest = NULL;
int mid, high, low;
int i;
if( sortlist_valid == FALSE )
{
@ -1100,24 +1103,18 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr)
if( (nearest->sourcefile != NULL)
&& (addr->off - nearest->addr.off < 0x100000) )
{
/*
* FIXME - this is an inefficient linear search. A binary
* search would be better if this gets to be a performance
* bottleneck.
*/
for(i=0; i < nearest->n_lines; i++)
{
if( addr->off == nearest->linetab[i].pc_offset.off )
{
return AT_LINENUMBER;
}
if( addr->off < nearest->linetab[i].pc_offset.off )
{
break;
}
}
return NOT_ON_LINENUMBER;
low = 0;
high = nearest->n_lines;
while ((high - low) > 1)
{
mid = (high + low) / 2;
if (addr->off < nearest->linetab[mid].pc_offset.off) high = mid;
else low = mid;
}
if (addr->off == nearest->linetab[low].pc_offset.off)
return AT_LINENUMBER;
else
return NOT_ON_LINENUMBER;
}
return FUNC_HAS_NO_LINES;

View File

@ -34,11 +34,6 @@
#include "peexe.h"
#include "xmalloc.h"
/*
* This is used so that we have some idea of what we are in fact loading
* at any given time.
*/
char * DEBUG_curr_module = NULL;
/*
* This is an index we use to keep track of the debug information
@ -886,7 +881,8 @@ DEBUG_InitCVDataTypes()
* We don't fully process it here for performance reasons.
*/
int
DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr, u_long v_addr, u_long size)
DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr,
const char *module_name, u_long v_addr, u_long size)
{
int has_codeview = FALSE;
int rtn = FALSE;
@ -956,13 +952,13 @@ DEBUG_RegisterDebugInfo(struct pe_data * pe,int load_addr, u_long v_addr, u_long
* to proceed if we know what we need to do next.
*/
deefer->dbg_size = dbgptr->SizeOfData;
deefer->dbg_info = pe->mappeddll+dbgptr->PointerToRawData;
deefer->dbg_info = (char *)(pe->mappeddll+dbgptr->PointerToRawData);
deefer->load_addr = (char *) load_addr;
deefer->dbgdir = dbgptr;
deefer->next = dbglist;
deefer->loaded = FALSE;
deefer->dbg_index = DEBUG_next_index;
deefer->module_name = xstrdup(DEBUG_curr_module);
deefer->module_name = xstrdup(module_name);
deefer->sectp = pe->pe_seg;
deefer->nsect = pe->pe_header->FileHeader.NumberOfSections;

View File

@ -147,13 +147,13 @@ void DEBUG_SetSigContext( const SIGCONTEXT *sigcontext )
#ifdef FS_sig
FS_reg(&DEBUG_context) = LOWORD(FS_sig(sigcontext));
#else
__asm__("movw %%fs,%w0":"=r" (FS_reg(&DEBUG_context)));
GET_FS( FS_reg(&DEBUG_context) );
FS_reg(&DEBUG_context) &= 0xffff;
#endif
#ifdef GS_sig
GS_reg(&DEBUG_context) = LOWORD(GS_sig(sigcontext));
#else
__asm__("movw %%gs,%w0":"=r" (GS_reg(&DEBUG_context)));
GET_GS( GS_reg(&DEBUG_context) );
GS_reg(&DEBUG_context) &= 0xffff;
#endif
}
@ -183,12 +183,12 @@ void DEBUG_GetSigContext( SIGCONTEXT *sigcontext )
#ifdef FS_sig
FS_sig(sigcontext) = FS_reg(&DEBUG_context);
#else
__asm__("movw %w0,%%fs"::"r" (FS_reg(&DEBUG_context)));
SET_FS( FS_reg(&DEBUG_context) );
#endif
#ifdef GS_sig
GS_sig(sigcontext) = GS_reg(&DEBUG_context);
#else
__asm__("movw %w0,%%gs"::"r" (GS_reg(&DEBUG_context)));
SET_GS( GS_reg(&DEBUG_context) );
#endif
}
@ -239,6 +239,8 @@ void DEBUG_InfoRegisters(void)
*/
BOOL32 DEBUG_ValidateRegisters(void)
{
WORD cs, ds;
/* Check that a selector is a valid ring-3 LDT selector, or a NULL selector */
#define CHECK_SEG(seg,name) \
if (((seg) & ~3) && \
@ -249,18 +251,14 @@ BOOL32 DEBUG_ValidateRegisters(void)
return FALSE; \
}
if (CS_reg(&DEBUG_context) != WINE_CODE_SELECTOR)
CHECK_SEG( CS_reg(&DEBUG_context), "CS" );
if (SS_reg(&DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( SS_reg(&DEBUG_context), "SS" );
if (DS_reg(&DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( DS_reg(&DEBUG_context), "DS" );
if (ES_reg(&DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( ES_reg(&DEBUG_context), "ES" );
if (FS_reg(&DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( FS_reg(&DEBUG_context), "FS" );
if (GS_reg(&DEBUG_context) != WINE_DATA_SELECTOR)
CHECK_SEG( GS_reg(&DEBUG_context), "GS" );
GET_CS(cs);
GET_DS(ds);
if (CS_reg(&DEBUG_context) != cs) CHECK_SEG(CS_reg(&DEBUG_context), "CS");
if (SS_reg(&DEBUG_context) != ds) CHECK_SEG(SS_reg(&DEBUG_context), "SS");
if (DS_reg(&DEBUG_context) != ds) CHECK_SEG(DS_reg(&DEBUG_context), "DS");
if (ES_reg(&DEBUG_context) != ds) CHECK_SEG(ES_reg(&DEBUG_context), "ES");
if (FS_reg(&DEBUG_context) != ds) CHECK_SEG(FS_reg(&DEBUG_context), "FS");
if (GS_reg(&DEBUG_context) != ds) CHECK_SEG(GS_reg(&DEBUG_context), "GS");
/* Check that CS and SS are not NULL */

View File

@ -480,7 +480,6 @@ DEBUG_Disassemble(const DBG_ADDR *xstart,const DBG_ADDR *xend,int offset)
DBG_ADDR last;
DBG_ADDR end,start;
if (xstart) {
start=*xstart;
_disassemble_fixaddr(&start);
@ -491,9 +490,12 @@ DEBUG_Disassemble(const DBG_ADDR *xstart,const DBG_ADDR *xend,int offset)
}
if (!xstart && !xend) {
last = DEBUG_LastDisassemble;
if (!last.seg && !last.off) {
last.seg = (CS_reg(&DEBUG_context)==WINE_CODE_SELECTOR)?0:CS_reg(&DEBUG_context);
last.off = EIP_reg(&DEBUG_context);
if (!last.seg && !last.off)
{
WORD cs;
GET_CS(cs);
last.seg = (CS_reg(&DEBUG_context) == cs) ? 0 : CS_reg(&DEBUG_context);
last.off = EIP_reg(&DEBUG_context);
}
for (i=0;i<offset;i++)
if (!_disassemble(&last)) break;

View File

@ -52,9 +52,11 @@ typedef struct
void DEBUG_InfoStack(void)
{
DBG_ADDR addr;
WORD ss;
fprintf(stderr,"Stack dump:\n");
if ((SS_reg(&DEBUG_context) == WINE_DATA_SELECTOR) ||
GET_SS(ss);
if ((SS_reg(&DEBUG_context) == ss) ||
(GET_SEL_FLAGS(SS_reg(&DEBUG_context)) & LDT_FLAGS_32BIT))
{ /* 32-bit mode */
addr.seg = 0;
@ -82,9 +84,11 @@ void DEBUG_BackTrace(void)
{
DBG_ADDR addr;
int frameno = 0;
WORD ss;
fprintf(stderr,"Backtrace:\n");
if (SS_reg(&DEBUG_context) == WINE_DATA_SELECTOR) /* 32-bit mode */
GET_SS(ss);
if (SS_reg(&DEBUG_context) == ss) /* 32-bit mode */
{
nframe = 1;
if (frames) free( frames );
@ -158,14 +162,15 @@ void DEBUG_BackTrace(void)
*/
void DEBUG_SilentBackTrace(void)
{
WORD ss;
DBG_ADDR addr;
int frameno = 0;
nframe = 1;
if (frames) free( frames );
frames = (struct bt_info *) xmalloc( sizeof(struct bt_info) );
if (SS_reg(&DEBUG_context) == WINE_DATA_SELECTOR) /* 32-bit mode */
GET_SS(ss);
if (SS_reg(&DEBUG_context) == ss) /* 32-bit mode */
{
addr.seg = 0;
addr.off = EIP_reg(&DEBUG_context);

View File

@ -101,7 +101,9 @@ Program hangs, nothing happens
Switch to UNIX shell, get the process-ID using "ps -a|grep wine", and do a
"kill -HUP <pid>" (without " and <>). Wine will then enter its internal
debugger and you can proceed as explained above.
debugger and you can proceed as explained above. Also, you can use -debug
switch and then you can get into internal debugger by pressing Ctrl-C in
the terminal where you run Wine.
Program reports an error with a Messagebox
==========================================

View File

@ -17,6 +17,7 @@ stuff (rectangles, clipboard, WNet, etc). Wine USER code is
located in windows/, controls/, and misc/ directories.
1. Windowing subsystem
----------------------
windows/win.c
windows/winpos.c
@ -58,15 +59,17 @@ located in windows/, controls/, and misc/ directories.
active window ("foreground window" in Win32) is moved to the front
of z-order unless its top-level ancestor owns popup windows.
All these issues are dealt with (or supposed to be) in
windows/winpos.c
All these issues are dealt with (or supposed to be) in windows/winpos.c
with SetWindowPos() being the primary interface to the window manager.
Wine specifics: in default and managed mode each top-level window
gets its own X counterpart with desktop window being basically a
fake stub. In desktop mode, however, only desktop window has an X
window associated with it.
window associated with it. Also, SetWindowPos() should eventually be
implemented via Begin/End/DeferWindowPos() calls and not the other way
around.
2. Visible region, clipping region and update region
1.1 Visible region, clipping region and update region
windows/dce.c
windows/winpos.c
@ -143,9 +146,12 @@ located in windows/, controls/, and misc/ directories.
the DC cache to recalculate visible regions for entries whose windows
were involved in the operation. DC entries (DCE) can be either private
to the window, or private to the window class, or shared between all
windows. Windows 3.1 limits the number of shared DCEs to 5.
windows (Windows 3.1 limits the number of shared DCEs to 5).
3. Messaging subsystem
1.2
2. Messaging subsystem
----------------------
windows/queue.c
windows/message.c

View File

@ -1,6 +1,6 @@
prefix = @prefix@
sysconfdir = @sysconfdir@
DEFS = -D__WINE__ -DETCDIR=\"$(sysconfdir)\"
DEFS = @DLLFLAGS@ -D__WINE__ -DETCDIR=\"$(sysconfdir)\"
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -631,7 +631,7 @@ DWORD WINAPI SearchPath32W( LPCWSTR path, LPCWSTR name, LPCWSTR ext,
while (*res == '/') res++;
if (buflen)
{
if (buflen > 3) lstrcpynAtoW( buffer + 3, res + 1, buflen - 3 );
if (buflen > 3) lstrcpynAtoW( buffer + 3, res, buflen - 3 );
for (p = buffer; *p; p++) if (*p == '/') *p = '\\';
if (lastpart)
{

View File

@ -314,6 +314,7 @@ int DRIVE_FindDriveRoot( const char **path )
while (!IS_END_OF_NAME(*p)) *next++ = *p++;
*next = 0;
}
*next = 0;
if (rootdrive != -1)
dprintf_dosfs( stddeb, "DRIVE_FindDriveRoot: %s -> drive %c:, root='%s', name='%s'\n",
@ -618,6 +619,10 @@ BOOL32 WINAPI GetDiskFreeSpace32A( LPCSTR root, LPDWORD cluster_sectors,
}
if (!DRIVE_GetFreeSpace(drive, &size, &available)) return FALSE;
/* Cap the size and available at 2GB as per specs. */
if (size > 0x7fffffff) size = 0x7fffffff;
if (available > 0x7fffffff) available = 0x7fffffff;
*sector_bytes = 512;
size /= 512;
available /= 512;

View File

@ -1286,8 +1286,8 @@ LPVOID FILE_dommap( FILE_OBJECT *file, LPVOID start,
}
/* printf( "FILE_mmap: mmap failed (%d), faking it\n", errno );*/
/* Reserve the memory with an anonymous mmap */
ret = FILE_mmap( NULL, start, size_high, size_low, 0, 0,
PROT_READ | PROT_WRITE, flags );
ret = FILE_dommap( NULL, start, size_high, size_low, 0, 0,
PROT_READ | PROT_WRITE, flags );
if (ret == (LPVOID)-1) return ret;
/* Now read in the file */
if ((pos = lseek( fd, offset_low, SEEK_SET )) == -1)

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@

View File

@ -21,12 +21,12 @@ HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
lBrush16.lbStyle = brush->logbrush.lbStyle;
lBrush16.lbColor = brush->logbrush.lbColor;
lBrush16.lbHatch = brush->logbrush.lbHatch;
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, OBJ_BRUSH,
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
&lBrush16, NULL,
0);
/* may need to realloc segptrFOntInfo*/
physDev->segptrBrushInfo = WIN16_GlobalLock16(GlobalAlloc16(GHND, nSize));
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, OBJ_BRUSH,
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
&lBrush16,
(LPVOID)physDev->segptrBrushInfo,
win16drv_SegPtr_TextXForm);

View File

@ -354,13 +354,13 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
/* TTD should calculate this */
/* First get the size of the realized font */
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, OBJ_FONT,
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_FONT,
&pLPD->paPrinterFonts[0], NULL,
0);
physDev->segptrFontInfo = WIN16_GlobalLock16(GlobalAlloc16(GHND, nSize));
/* Realize the font */
PRTDRV_RealizeObject(physDev->segptrPDEVICE, OBJ_FONT,
PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_FONT,
&pLPD->paPrinterFonts[0],
(LPVOID)physDev->segptrFontInfo,
win16drv_SegPtr_TextXForm);

View File

@ -25,12 +25,12 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
lPen16.lopnWidth.x = pen->logpen.lopnWidth.x;
lPen16.lopnWidth.y = pen->logpen.lopnWidth.y;
lPen16.lopnColor = pen->logpen.lopnColor;
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, OBJ_PEN,
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN,
&lPen16, NULL,
0);
/* may need to realloc segptrFOntInfo*/
physDev->segptrPenInfo = WIN16_GlobalLock16(GlobalAlloc16(GHND, nSize));
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, OBJ_PEN,
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
&lPen16,
(LPVOID)physDev->segptrPenInfo,
0);

View File

@ -428,16 +428,16 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
switch (wStyle)
{
case OBJ_BRUSH:
case DRVOBJ_BRUSH:
nSize = sizeof (LOGBRUSH16);
break;
case OBJ_FONT:
case DRVOBJ_FONT:
nSize = sizeof(LOGFONT16);
break;
case OBJ_PEN:
case DRVOBJ_PEN:
nSize = sizeof(LOGPEN16);
break;
case OBJ_PBITMAP:
case DRVOBJ_PBITMAP:
default:
fprintf(stderr, "PRTDRV_RealizeObject: Object type %d not supported\n", wStyle);
nSize = 0;

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@

View File

@ -266,9 +266,9 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
{
long lineAscent, lineDescent;
if (!XGetFontProperty( font, XA_STRIKEOUT_ASCENT, &lineAscent ))
lineAscent = font->ascent / 3;
lineAscent = font->ascent / 2;
if (!XGetFontProperty( font, XA_STRIKEOUT_DESCENT, &lineDescent ))
lineDescent = -lineAscent;
lineDescent = -lineAscent * 2 / 3;
XSetLineAttributes( display, dc->u.x.gc, lineAscent + lineDescent,
LineSolid, CapRound, JoinBevel );
XDrawLine( display, dc->u.x.drawable, dc->u.x.gc,

View File

@ -99,6 +99,7 @@ static const char* INIFontMetrics = "/.cachedmetrics";
static const char* INIFontSection = "fonts";
static const char* INISubSection = "Alias";
static const char* INIDefault = "Default";
static const char* INIDefaultFixed = "DefaultFixed";
static const char* INIResolution = "Resolution";
static const char* INIGlobalMetrics = "FontMetrics";
@ -782,6 +783,7 @@ static void XFONT_WindowsNames( char* buffer )
char* lpstr, *lpch;
int i, up;
BYTE bFamilyStyle;
const char* relocTable[] = { INIDefaultFixed, INIDefault, NULL };
for( fr = fontList; fr ; fr = fr->next )
{
@ -828,8 +830,9 @@ static void XFONT_WindowsNames( char* buffer )
fr->fr_flags |= FR_NAMESET;
}
if( PROFILE_GetWineIniString( INIFontSection, INIDefault, "", buffer, 128 ) )
{
for( up = 0; relocTable[up]; up++ )
if( PROFILE_GetWineIniString( INIFontSection, relocTable[up], "", buffer, 128 ) )
{
while( *buffer && isspace(*buffer) ) buffer++;
for( fr = NULL, pfr = fontList; pfr; pfr = pfr->next )
{
@ -846,7 +849,7 @@ static void XFONT_WindowsNames( char* buffer )
}
fr = pfr;
}
}
}
}
/***********************************************************************

View File

@ -601,6 +601,8 @@ void BUILTIN_PrintDLLs(void)
int i;
BUILTIN_DLL *dll;
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs:\n");
for (i = 0, dll = BuiltinDLLs; dll->descr; dll++)
{
if (!(dll->flags & DLL_FLAG_ALWAYS_USED))
@ -608,5 +610,4 @@ void BUILTIN_PrintDLLs(void)
((++i) % 8) ? ' ' : '\n' );
}
fprintf(stderr,"\n");
exit(1);
}

View File

@ -3,22 +3,22 @@ type win16
2 pascal16 DdeInitialize(ptr segptr long long) DdeInitialize16
3 pascal16 DdeUninitialize(long) DdeUninitialize16
4 stub DdeConnectList #(long word word word ptr) DdeConnectList
5 stub DdeQueryNextServer #(word word) DdeQueryNextServer
6 stub DdeDisconnectList #(word) DdeDisconnectList
4 pascal DdeConnectList(long word word word ptr) DdeConnectList
5 pascal DdeQueryNextServer(word word) DdeQueryNextServer
6 pascal DdeDisconnectList(word) DdeDisconnectList
7 pascal DdeConnect(long long long ptr) DdeConnect16
8 pascal16 DdeDisconnect(long) DdeDisconnect16
9 stub DdeQueryConvInfo #(word long ptr) DdeQueryConvInfo
10 stub DdeSetUserHandle #(word long long) DdeSetUserHandle
10 pascal DdeSetUserHandle(word long long) DdeSetUserHandle
11 pascal DdeClientTransaction(ptr long long long s_word s_word long ptr)
DdeClientTransaction16
12 stub DdeAbandonTransaction #(long word long) DdeAbandonTransaction
13 stub DdePostAdvise #(long word word) DdePostAdvise
14 stub DdeCreateDataHandle #(long ptr long long word word word) DdeCreateDataHandle
15 stub DdeAddData #(word ptr long long) DdeAddData
16 stub DdeGetData #(word ptr long long) DdeGetData
17 stub DdeAccessData #(word ptr) DdeAccessData
18 stub DdeUnaccessData #(word) DdeUnaccessData
12 pascal DdeAbandonTransaction(long word long) DdeAbandonTransaction
13 pascal DdePostAdvise(long word word) DdePostAdvise
14 pascal DdeCreateDataHandle(long ptr long long word word word) DdeCreateDataHandle
15 pascal DdeAddData(word ptr long long) DdeAddData
16 pascal DdeGetData(word ptr long long) DdeGetData
17 pascal DdeAccessData(word ptr) DdeAccessData
18 pascal DdeUnaccessData(word) DdeUnaccessData
19 pascal16 DdeFreeDataHandle(long) DdeFreeDataHandle16
20 pascal16 DdeGetLastError(long) DdeGetLastError16
21 pascal DdeCreateStringHandle(long str s_word) DdeCreateStringHandle16
@ -26,8 +26,8 @@ type win16
23 stub DdeQueryString #(long word ptr long word) DdeQueryString
24 pascal16 DdeKeepStringHandle(long long) DdeKeepStringHandle16
26 stub DdeEnableCallback #(long word word) DdeEnableCallback
26 pascal DdeEnableCallback(long word word) DdeEnableCallback
27 pascal DdeNameService(long long long s_word) DdeNameService16
36 stub DdeCmpStringHandles #(word word) DdeCmpStringHandles
36 pascal DdeCmpStringHandles(word word) DdeCmpStringHandles
37 pascal DdeReconnect(long) DdeReconnect

View File

@ -315,7 +315,7 @@ file gdi.exe
485 pascal16 ScaleWindowExtEx(word s_word s_word s_word s_word ptr)
ScaleWindowExtEx16
486 pascal16 GetAspectRatioFilterEx(word ptr) GetAspectRatioFilterEx16
489 stub CreateDIBSection
489 pascal16 CreateDIBSection(word ptr word ptr word long) CreateDIBSection16
490 stub CloseEnhMetafile
491 stub CopyEnhMetafile
492 stub CreateEnhMetafile

View File

@ -37,7 +37,7 @@ type win32
33 stdcall CreateDCW(wstr wstr wstr ptr) CreateDC32W
34 stdcall CreateDIBPatternBrush(long long) CreateDIBPatternBrush32
35 stub CreateDIBPatternBrushPt
36 stdcall CreateDIBSection(long ptr long ptr long long) CreateDIBSection
36 stdcall CreateDIBSection(long ptr long ptr long long) CreateDIBSection32
37 stdcall CreateDIBitmap(long ptr long ptr ptr long) CreateDIBitmap32
38 stdcall CreateDiscardableBitmap(long long long) CreateDiscardableBitmap32
39 stdcall CreateEllipticRgn(long long long long) CreateEllipticRgn32
@ -234,10 +234,10 @@ type win32
227 stdcall GetTextColor(long) GetTextColor32
228 stdcall GetTextExtentExPointA(long str long long ptr ptr ptr) GetTextExtentExPoint32A
229 stdcall GetTextExtentExPointW(long wstr long long ptr ptr ptr) GetTextExtentExPoint32W
230 stdcall GetTextExtentPoint32A(long str long ptr) GetTextExtentPoint32A
231 stdcall GetTextExtentPoint32W(long wstr long ptr) GetTextExtentPoint32W
232 stdcall GetTextExtentPointA(long str long ptr) GetTextExtentPoint32ABuggy
233 stdcall GetTextExtentPointW(long wstr long ptr) GetTextExtentPoint32WBuggy
230 stdcall GetTextExtentPoint32A(long ptr long ptr) GetTextExtentPoint32A
231 stdcall GetTextExtentPoint32W(long ptr long ptr) GetTextExtentPoint32W
232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint32ABuggy
233 stdcall GetTextExtentPointW(long ptr long ptr) GetTextExtentPoint32WBuggy
234 stdcall GetTextFaceA(long long ptr) GetTextFace32A
235 stdcall GetTextFaceW(long long ptr) GetTextFace32W
236 stdcall GetTextMetricsA(long ptr) GetTextMetrics32A

View File

@ -5,12 +5,13 @@ type win32
# (these need to have these exact ordinals, for some win95 dlls
# import shell32.dll by ordinal)
2 stub SHELL32_2
3 stub CheckEscapesA
6 stub CheckEscapesW
7 stdcall CommandLineToArgvW(ptr ptr) CommandLineToArgvW
8 stub Control_FillCache_RunDLL
12 stdcall Control_RunDLL(long long long long) Control_RunDLL
14 stub DllGetClassObject
14 stdcall DllGetClassObject(long long ptr) SHELL32_DllGetClassObject
22 stub DoEnvironmentSubstA
33 stub SHELL32_33
34 stub SHELL32_34

View File

@ -32,18 +32,6 @@
#include "miscemu.h"
#include "thread.h"
/* Signal handler declaration */
#ifdef linux
# define HANDLER_DEF(name) void name (int signal, SIGCONTEXT context)
# define HANDLER_CONTEXT (&context)
#elif defined(__svr4__) || defined(_SCO_DS)
# define HANDLER_DEF(name) void name(int signal, void *siginfo, SIGCONTEXT *context)
# define HANDLER_CONTEXT context
#else
# define HANDLER_DEF(name) void name(int signal, int code, SIGCONTEXT *context)
# define HANDLER_CONTEXT context
#endif
extern void SIGNAL_SetHandler( int sig, void (*func)(), int flags );
extern BOOL32 INSTR_EmulateInstruction( SIGCONTEXT *context );
@ -80,7 +68,9 @@ static HANDLER_DEF(SIGNAL_trap)
*/
static HANDLER_DEF(SIGNAL_fault)
{
if (CS_sig(HANDLER_CONTEXT) == WINE_CODE_SELECTOR)
WORD cs;
GET_CS(cs);
if (CS_sig(HANDLER_CONTEXT) == cs)
{
fprintf( stderr, "Segmentation fault in 32-bit code (0x%08lx).\n",
EIP_sig(HANDLER_CONTEXT) );
@ -120,13 +110,13 @@ static void SIGNAL_SetSigContext( const SIGCONTEXT *sigcontext,
#ifdef FS_sig
FS_reg(context) = LOWORD(FS_sig(sigcontext));
#else
__asm__("movw %%fs,%w0":"=r" (FS_reg(&DEBUG_context)));
GET_FS( FS_reg(&DEBUG_context) );
FS_reg(context) &= 0xffff;
#endif
#ifdef GS_sig
GS_reg(context) = LOWORD(GS_sig(sigcontext));
#else
__asm__("movw %%gs,%w0":"=r" (GS_reg(&DEBUG_context)));
GET_GS( GS_reg(&DEBUG_context) );
GS_reg(context) &= 0xffff;
#endif
}
@ -157,12 +147,12 @@ static void SIGNAL_GetSigContext( SIGCONTEXT *sigcontext,
#ifdef FS_sig
FS_sig(sigcontext) = FS_reg(context);
#else
__asm__("movw %w0,%%fs"::"r" (FS_reg(context)));
SET_FS( FS_reg(&DEBUG_context) );
#endif
#ifdef GS_sig
GS_sig(sigcontext) = GS_reg(context);
#else
__asm__("movw %w0,%%gs"::"r" (GS_reg(context)));
SET_GS( GS_reg(&DEBUG_context) );
#endif
}

View File

@ -93,11 +93,14 @@ static void WINAPI THUNK_CallTaskReschedule(void);
/* TASK_Reschedule() 16-bit entry point */
static FARPROC16 TASK_RescheduleProc;
extern void CallFrom16_long_wwwll(void);
/* Callbacks function table for the emulator */
static const CALLBACKS_TABLE CALLBACK_EmulatorTable =
{
(void *)CallTo16_regs_short, /* CallRegisterProc */
THUNK_CallTaskReschedule, /* CallTaskRescheduleProc */
CallFrom16_long_wwwll, /* CallFrom16WndProc */
THUNK_CallWndProc16, /* CallWndProc */
(void *)CallTo16_long_lwwll, /* CallDriverProc */
(void *)CallTo16_word_wwlll, /* CallDriverCallback */
@ -209,16 +212,32 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
EBP_reg(&context) = OFFSETOF(IF1632_Saved16_ss_sp)
+ (WORD)&((STACK16FRAME*)0)->bp;
if (((msg == WM_CREATE) || (msg == WM_NCCREATE)) && lParam)
if (lParam)
{
/* Build the CREATESTRUCT on the 16-bit stack. */
/* This is really ugly, but some programs (notably the */
/* "Undocumented Windows" examples) want it that way. */
CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
offset = sizeof(*cs);
lParam = STACK16_PUSH( offset );
memcpy( PTR_SEG_TO_LIN(lParam), cs, offset );
/* Some programs (eg. the "Undocumented Windows" examples, JWP) only
work if structures passed in lParam are placed in the stack/data
segment. Programmers easily make the mistake of converting lParam
to a near rather than a far pointer, since Windows apparently
allows this. We copy the structures to the 16 bit stack; this is
ugly but makes these programs work. */
switch (msg)
{
case WM_CREATE:
case WM_NCCREATE:
offset = sizeof(CREATESTRUCT16); break;
case WM_DRAWITEM:
offset = sizeof(DRAWITEMSTRUCT16); break;
case WM_COMPAREITEM:
offset = sizeof(COMPAREITEMSTRUCT16); break;
}
if (offset)
{
void *s = PTR_SEG_TO_LIN(lParam);
lParam = STACK16_PUSH( offset );
memcpy( PTR_SEG_TO_LIN(lParam), s, offset );
}
}
args = (WORD *)CURRENT_STACK16 - 7;
args[0] = LOWORD(lParam);
args[1] = HIWORD(lParam);

View File

@ -348,7 +348,7 @@ file user.exe
389 stub LoadImage
390 stub CopyImage
391 stub SignalProc32
394 stub DrawIconEx
394 pascal16 DrawIconEx(word word word word word word word word word) DrawIconEx16
395 stub GetIconInfo
397 pascal16 RegisterClassEx(ptr) RegisterClassEx16
398 pascal16 GetClassInfoEx(word segstr ptr) GetClassInfoEx16
@ -491,7 +491,7 @@ file user.exe
662 stub DrawMenubarTemp
663 stub GetMenuDefaultItem
664 stub SetMenuDefaultItem
665 stub GetMenuItemRect
665 pascal16 GetMenuItemRect(word word word ptr) GetMenuItemRect16
666 stub CheckMenuRadioItem
667 stub TrackPopupMenuEx
668 stub SetWindowRgn

View File

@ -47,7 +47,7 @@ type win32
44 stdcall CharUpperW(wstr) CharUpper32W
45 stdcall CheckDlgButton(long long long) CheckDlgButton32
46 stdcall CheckMenuItem(long long long) CheckMenuItem32
47 stub CheckMenuRadioItem
47 stdcall CheckMenuRadioItem(long long long long long) CheckMenuRadioItem32
48 stdcall CheckRadioButton(long long long long) CheckRadioButton32
49 stdcall ChildWindowFromPoint(long long long) ChildWindowFromPoint32
50 stub ChildWindowFromPointEx
@ -58,8 +58,8 @@ type win32
55 stub CloseDesktop
56 stdcall CloseWindow(long) CloseWindow32
57 stub CloseWindowStation
58 stub CopyAcceleratorTableA
59 stub CopyAcceleratorTableW
58 stdcall CopyAcceleratorTableA(long ptr long) CopyAcceleratorTable32A
59 stdcall CopyAcceleratorTableW(long ptr long) CopyAcceleratorTable32W
60 stdcall CopyIcon(long) CopyIcon32
61 stdcall CopyImage(long long long long long) CopyImage32
62 stdcall CopyRect(ptr ptr) CopyRect32
@ -132,7 +132,7 @@ type win32
127 stdcall DefWindowProcW(long long long long) DefWindowProc32W
128 stdcall DeferWindowPos(long long long long long long long long) DeferWindowPos32
129 stdcall DeleteMenu(long long long) DeleteMenu32
130 stub DestroyAcceleratorTable
130 stdcall DestroyAcceleratorTable(long) DestroyAcceleratorTable
131 stdcall DestroyCaret() DestroyCaret32
132 stdcall DestroyCursor(long) DestroyCursor32
133 stdcall DestroyIcon(long) DestroyIcon32
@ -162,7 +162,7 @@ type win32
157 stub DrawFrame
158 stdcall DrawFrameControl(long ptr long long) DrawFrameControl32
159 stdcall DrawIcon(long long long long) DrawIcon32
160 stub DrawIconEx
160 stdcall DrawIconEx(long long long long long long long long long) DrawIconEx32
161 stdcall DrawMenuBar(long) DrawMenuBar32
162 stdcall DrawStateA(long long ptr long long long long long long long) DrawState32A
163 stub DrawStateW
@ -268,7 +268,7 @@ type win32
263 stdcall GetMenuItemID(long long) GetMenuItemID32
264 stdcall GetMenuItemInfoA(long long long ptr) GetMenuItemInfo32A
265 stdcall GetMenuItemInfoW(long long long ptr) GetMenuItemInfo32W
266 stub GetMenuItemRect
266 stdcall GetMenuItemRect(long long long ptr) GetMenuItemRect32
267 stdcall GetMenuState(long long long) GetMenuState32
268 stdcall GetMenuStringA(long long ptr long long) GetMenuString32A
269 stdcall GetMenuStringW(long long ptr long long) GetMenuString32W

View File

@ -1,7 +1,6 @@
name wprocs
type win16
10 pascal MDIClientWndProc(word word word long) MDIClientWndProc
14 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
15 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
16 pascal ColorDlgProc(word word word long) ColorDlgProc

View File

@ -1,36 +0,0 @@
/*
* structure definitions for ACCELERATORS
*
* taken straight from Win32 SDK includes
*/
#ifndef __WINE_ACCEL_H
#define __WINE_ACCEL_H
#include "windows.h"
#pragma pack(1)
#define FVIRTKEY TRUE /* Assumed to be == TRUE */
#define FNOINVERT 0x02
#define FSHIFT 0x04
#define FCONTROL 0x08
#define FALT 0x10
typedef struct tagACCEL16 {
BYTE fVirt; /* Also called the flags field */
WORD key;
WORD cmd;
} ACCEL16, *LPACCEL16;
typedef struct tagACCEL32 {
BYTE fVirt; /* Also called the flags field */
BYTE pad0;
WORD key;
WORD cmd;
WORD pad1;
} ACCEL32, *LPACCEL32;
#pragma pack(4)
#endif /* __WINE_ACCEL_H */

View File

@ -0,0 +1,23 @@
/* XPM */
static char *obm_radiocheck[] = {
/* size */
"14 14 2 1",
/* colors */
". s white c white",
"# s black c black",
/* pixels */
"..............",
"..............",
"..............",
".....####.....",
"....######....",
"...########...",
"...########...",
"...########...",
"...########...",
"....######....",
".....####.....",
"..............",
"..............",
".............."
};

View File

@ -1,6 +1,6 @@
/* XPM */
static char * ocr_ibeam[] = {
"32 32 2 1 0 8",
"32 32 2 1 3 8",
" s black c black",
". s None c None",
" . .........................",

View File

@ -21,6 +21,7 @@ typedef struct
{
VOID (CALLBACK *CallRegisterProc)( CONTEXT *, INT32 );
VOID (CALLBACK *CallTaskRescheduleProc)(void);
VOID (CALLBACK *CallFrom16WndProc)(void);
LRESULT (CALLBACK *CallWndProc)( WNDPROC16, HWND16, UINT16,
WPARAM16, LPARAM );
LRESULT (CALLBACK *CallDriverProc)( DRIVERPROC16, DWORD, HDRVR16,

View File

@ -1,9 +1,10 @@
#ifndef __WINE_CLIPBOARD_H
#define __WINE_CLIPBOARD_H
void CLIPBOARD_ReadSelection(Window w,Atom prop);
void CLIPBOARD_ReleaseSelection(Window w,HWND32 hwnd);
void CLIPBOARD_DisOwn(WND* pWnd);
void CLIPBOARD_ResetLock(HQUEUE16 hqRef, HQUEUE16 hqNew);
void CLIPBOARD_ResetOwner(WND* pWnd);
void CLIPBOARD_ReadSelection(Window w, Atom prop);
void CLIPBOARD_ReleaseSelection(Window w, HWND32 hwnd);
BOOL32 CLIPBOARD_IsPresent(WORD wFormat);
#endif /* __WINE_CLIPBOARD_H */

View File

@ -52,6 +52,6 @@ extern DCE* DCE_FreeDCE( DCE *dce );
extern void DCE_FreeWindowDCE( WND* );
extern INT16 DCE_ExcludeRgn( HDC32, WND*, HRGN32 );
extern HRGN32 DCE_GetVisRgn( HWND32, WORD );
extern BOOL32 DCE_InvalidateDCE( WND*, RECT32* );
extern BOOL32 DCE_InvalidateDCE( WND*, const RECT32* );
#endif /* __WINE_DCE_H */

View File

@ -2,6 +2,7 @@
* DDEML library definitions
*
* Copyright 1997 Alexandre Julliard
* Copyright 1997 Len White
*/
#ifndef __WINE__DDEML_H
@ -50,12 +51,17 @@ UINT32 WINAPI DdeInitialize32W(LPDWORD,PFNCALLBACK32,DWORD,DWORD);
BOOL16 WINAPI DdeUninitialize16(DWORD);
BOOL32 WINAPI DdeUninitialize32(DWORD);
#define DdeUninitialize WINELIB_NAME(DdeUninitialize)
HCONVLIST WINAPI DdeConnectList(DWORD,HSZ,HSZ,HCONVLIST,LPCONVCONTEXT16);
HCONV WINAPI DdeQueryNextServer(HCONVLIST, HCONV);
BOOL16 WINAPI DdeDisconnectList(HCONVLIST);
HCONV WINAPI DdeConnect16(DWORD,HSZ,HSZ,LPCONVCONTEXT16);
HCONV WINAPI DdeConnect32(DWORD,HSZ,HSZ,LPCONVCONTEXT32);
#define DdeConnect WINELIB_NAME(DdeConnect)
BOOL16 WINAPI DdeDisconnect16(HCONV);
BOOL32 WINAPI DdeDisconnect32(HCONV);
#define DdeDisconnect WINELIB_NAME(DdeDisconnect)
BOOL16 WINAPI DdeSetUserHandle(HCONV,DWORD,DWORD);
HDDEDATA WINAPI DdeCreateHandleData(DWORD,LPBYTE,DWORD,DWORD,HSZ,UINT16,UINT16);
HCONV WINAPI DdeReconnect(HCONV);
HSZ WINAPI DdeCreateStringHandle16(DWORD,LPCSTR,INT16);
HSZ WINAPI DdeCreateStringHandle32A(DWORD,LPCSTR,INT32);
@ -75,6 +81,16 @@ HDDEDATA WINAPI DdeClientTransaction16(LPVOID,DWORD,HCONV,HSZ,UINT16,
HDDEDATA WINAPI DdeClientTransaction32(LPBYTE,DWORD,HCONV,HSZ,UINT32,
UINT32,DWORD,LPDWORD);
#define DdeClientTransaction WINELIB_NAME(DdeClientTransaction)
BOOL16 WINAPI DdeAbandonTransaction(DWORD,HCONV,DWORD);
BOOL16 WINAPI DdePostAdvise(DWORD,HSZ,HSZ);
HDDEDATA WINAPI DdeAddData(HDDEDATA,LPBYTE,DWORD,DWORD);
DWORD WINAPI DdeGetData(HDDEDATA,LPBYTE,DWORD,DWORD);
LPBYTE WINAPI DdeAccessData(HDDEDATA,LPDWORD);
BOOL16 WINAPI DdeUnaccessData(HDDEDATA);
BOOL16 WINAPI DdeEnableCallback(DWORD,HCONV,UINT16);
int WINAPI DdeCmpStringHandles(HSZ,HSZ);
HDDEDATA WINAPI DdeNameService16(DWORD,HSZ,HSZ,UINT16);
HDDEDATA WINAPI DdeNameService32(DWORD,HSZ,HSZ,UINT32);
#define DdeNameService WINELIB_NAME(DdeNameService)

View File

@ -86,9 +86,9 @@ typedef struct wine_locals WineLocals;
#define DBG_FIX_ADDR_SEG(addr,default) \
{ if ((addr)->seg == 0xffffffff) (addr)->seg = (default); \
if (((addr)->seg == WINE_CODE_SELECTOR) || \
(addr)->seg == WINE_DATA_SELECTOR) (addr)->seg = 0; }
{ WORD cs, ds; GET_CS(cs); GET_DS(ds); \
if ((addr)->seg == 0xffffffff) (addr)->seg = (default); \
if (((addr)->seg == cs) || (addr)->seg == ds) (addr)->seg = 0; }
#define DBG_ADDR_TO_LIN(addr) \
((addr)->seg ? (char *)PTR_SEG_OFF_TO_LIN((addr)->seg,(addr)->off) \
@ -266,8 +266,8 @@ extern int DEBUG_GetCurrentFrame(struct name_hash ** name,
extern int DEBUG_ReadExecutableDbgInfo(void);
/* debugger/msc.c */
extern int DEBUG_RegisterDebugInfo(struct pe_data *pe,
int, unsigned long, unsigned long);
extern int DEBUG_RegisterDebugInfo(struct pe_data *pe, int, const char *,
unsigned long, unsigned long);
extern int DEBUG_ProcessDeferredDebug(void);
extern int DEBUG_RegisterELFDebugInfo(int load_addr, u_long size, char * name);
extern void DEBUG_InfoShare(void);

15
include/debugstr.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef __WINE_DEBUGSTR_H
#define __WINE_DEBUGSTR_H
#include "wintypes.h"
/* These function return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
as strings are re-used. */
LPSTR debugstr_an (LPCSTR s, int n);
LPSTR debugstr_a (LPCSTR s);
LPSTR debugstr_wn (LPCWSTR s, int n);
LPSTR debugstr_w (LPCWSTR s);
#endif /* __WINE_DEBUGSTR_H */

View File

@ -318,6 +318,5 @@ extern Display * display;
extern Screen * screen;
extern Window rootWindow;
extern int screenWidth, screenHeight, screenDepth;
extern int desktopX, desktopY; /* misc/main.c */
#endif /* __WINE_GDI_H */

View File

@ -14,6 +14,6 @@ extern BYTE QueueKeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
extern BOOL32 KEYBOARD_Init(void);
extern void KEYBOARD_HandleEvent( XKeyEvent *event );
extern void KEYBOARD_HandleEvent( WND *pWnd, XKeyEvent *event );
#endif /* __WINE_KEYBOARD_H */

View File

@ -20,21 +20,21 @@
#define WM_MDICALCCHILDSCROLL 0x10AC /* this is exactly what Windows uses */
extern LRESULT WINAPI MDIClientWndProc(HWND16 hwnd, UINT16 message,
WPARAM16 wParam, LPARAM lParam);
extern LRESULT WINAPI MDIClientWndProc( HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam );
typedef struct
{
UINT16 nActiveChildren;
HWND16 hwndChildMaximized;
HWND16 hwndActiveChild;
HMENU16 hWindowMenu;
UINT32 idFirstChild;
LPSTR frameTitle;
UINT16 nTotalCreated;
UINT16 mdiFlags;
UINT16 sbRecalc; /* SB_xxx flags for scrollbar fixup */
HWND16 self;
UINT32 nActiveChildren;
HWND32 hwndChildMaximized;
HWND32 hwndActiveChild;
HMENU32 hWindowMenu;
UINT32 idFirstChild;
LPSTR frameTitle;
UINT32 nTotalCreated;
UINT32 mdiFlags;
UINT32 sbRecalc; /* SB_xxx flags for scrollbar fixup */
HWND32 self;
} MDICLIENTINFO;
#endif /* __WINE_MDI_H */

View File

@ -26,7 +26,7 @@ typedef UINT32 MMVERSION32;
DECL_WINELIB_TYPE(MMVERSION);
typedef UINT16 MCIDEVICEID16;
typedef UINT32 MCIDEVICEID32;
DECL_WINELIB_TYPE(MCIDEVICE);
DECL_WINELIB_TYPE(MCIDEVICEID);
typedef struct {
UINT16 wType; /* indicates the contents of the union */
@ -257,8 +257,8 @@ typedef struct {
WORD wReserved1; /* padding */
DWORD dwSupport; /* functionality supported by driver */
} WAVEOUTCAPS32W, *LPWAVEOUTCAPS32W;
DECL_WINELIB_TYPE(WAVEOUTCAPS);
DECL_WINELIB_TYPE(LPWAVEOUTCAPS);
DECL_WINELIB_TYPE_AW(WAVEOUTCAPS);
DECL_WINELIB_TYPE_AW(LPWAVEOUTCAPS);
#define WAVECAPS_PITCH 0x0001 /* supports pitch control */
#define WAVECAPS_PLAYBACKRATE 0x0002 /* supports playback rate control */
@ -293,8 +293,8 @@ typedef struct {
WORD wChannels; /* number of channels supported */
WORD wReserved1;
} WAVEINCAPS32W, *LPWAVEINCAPS32W;
DECL_WINELIB_TYPE(WAVEINCAPS);
DECL_WINELIB_TYPE(LPWAVEINCAPS);
DECL_WINELIB_TYPE_AW(WAVEINCAPS);
DECL_WINELIB_TYPE_AW(LPWAVEINCAPS);
#define WAVE_INVALIDFORMAT 0x00000000 /* invalid format */
#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */
@ -1181,8 +1181,8 @@ typedef struct {
WCHAR szName[MIXER_LONG_NAME_CHARS];
} MIXERCONTROLDETAILS_LISTTEXT32W,*LPMIXERCONTROLDETAILS_LISTTEXT32W;
DECL_WINELIB_TYPE_AW(MIXERCONTROLDETAILS);
DECL_WINELIB_TYPE_AW(LPMIXERCONTROLDETAILS);
DECL_WINELIB_TYPE_AW(MIXERCONTROLDETAILS_LISTTEXT);
DECL_WINELIB_TYPE_AW(LPMIXERCONTROLDETAILS_LISTTEXT);
/* MIXER_GETCONTROLDETAILSF_VALUE */
typedef struct {
@ -1773,8 +1773,8 @@ typedef struct {
DWORD dwRetSize;
} MCI_INFO_PARMS32W, *LPMCI_INFO_PARMS32W;
DECL_WINELIB_TYPE(MCI_INFO_PARMS);
DECL_WINELIB_TYPE(LPMCI_INFO_PARMS);
DECL_WINELIB_TYPE_AW(MCI_INFO_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_INFO_PARMS);
typedef struct {
DWORD dwCallback;
@ -1858,8 +1858,8 @@ typedef struct {
LPCWSTR lpfilename;
} MCI_LOAD_PARMS32W, *LPMCI_LOAD_PARMS32W;
DECL_WINELIB_TYPE(MCI_LOAD_PARMS);
DECL_WINELIB_TYPE(LPMCI_LOAD_PARMS);
DECL_WINELIB_TYPE_AW(MCI_LOAD_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_LOAD_PARMS);
typedef struct {
DWORD dwCallback;
@ -1932,8 +1932,8 @@ typedef struct {
LPCWSTR lpstrCommand;
} MCI_VD_ESCAPE_PARMS32W, *LPMCI_VD_ESCAPE_PARMS32W;
DECL_WINELIB_TYPE(MCI_VD_ESCAPE_PARMS);
DECL_WINELIB_TYPE(LPMCI_VD_ESCAPE_PARMS);
DECL_WINELIB_TYPE_AW(MCI_VD_ESCAPE_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_VD_ESCAPE_PARMS);
#define MCI_WAVE_OPEN_BUFFER 0x00010000L
@ -2190,8 +2190,8 @@ typedef struct {
LPCWSTR lpstrText;
} MCI_ANIM_WINDOW_PARMS32W, *LPMCI_ANIM_WINDOW_PARMS32W;
DECL_WINELIB_TYPE(MCI_ANIM_WINDOW_PARMS);
DECL_WINELIB_TYPE(LPMCI_ANIM_WINDOW_PARMS);
DECL_WINELIB_TYPE_AW(MCI_ANIM_WINDOW_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_ANIM_WINDOW_PARMS);
typedef struct {
DWORD dwCallback;
@ -2320,8 +2320,8 @@ typedef struct {
LPCWSTR lpstrText;
} MCI_OVLY_WINDOW_PARMS32W, *LPMCI_OVLY_WINDOW_PARMS32W;
DECL_WINELIB_TYPE_AW(MCI_OVLY_OPEN_WINDOW_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_OVLY_OPEN_WINDOW_PARMS);
DECL_WINELIB_TYPE_AW(MCI_OVLY_WINDOW_PARMS);
DECL_WINELIB_TYPE_AW(LPMCI_OVLY_WINDOW_PARMS);
typedef struct {
DWORD dwCallback;

View File

@ -142,7 +142,9 @@ extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
extern void BUILTIN_PrintDLLs(void);
/* ne_image.c */
extern BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum );
extern BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum );
extern BOOL32 NE_LoadAllSegments( NE_MODULE *pModule );
extern BOOL32 NE_LoadDLLs( NE_MODULE *pModule );
extern void NE_FixupPrologs( NE_MODULE *pModule );
extern void NE_InitializeDLLs( HMODULE16 hModule );

View File

@ -5,6 +5,7 @@
#include <dirent.h>
#include "windows.h"
#include "comm.h"
#include "winnt.h"
struct fcb {
BYTE drive;
@ -55,8 +56,6 @@ typedef struct
DWORD filesize; /* 1c file size */
} DOS_DIRENTRY_LAYOUT;
#define WINVERSION 0x0a03 /* Windows version 3.10 */
#define MAX_DOS_DRIVES 26
extern struct DosDeviceStruct COM[MAX_PORTS];
@ -157,4 +156,7 @@ extern BYTE DOS_ErrorClass, DOS_ErrorAction, DOS_ErrorLocus;
#define EL_Serial 0x04
#define EL_Memory 0x05
void WINAPI DOS3Call( CONTEXT *context );
void do_mscdex( CONTEXT *context );
#endif /* __WINE_MSDOS_H */

View File

@ -13,8 +13,7 @@ extern LONG NC_HandleNCPaint( HWND32 hwnd , HRGN32 clip);
extern LONG NC_HandleNCActivate( WND *pwnd, WPARAM16 wParam );
extern LONG NC_HandleNCCalcSize( WND *pWnd, RECT32 *winRect );
extern LONG NC_HandleNCHitTest( HWND32 hwnd, POINT16 pt );
extern LONG NC_HandleNCLButtonDown( HWND32 hwnd, WPARAM16 wParam,
LPARAM lParam );
extern LONG NC_HandleNCLButtonDown( WND* pWnd, WPARAM16 wParam, LPARAM lParam );
extern LONG NC_HandleNCLButtonDblClk( WND *pWnd, WPARAM16 wParam, LPARAM lParam);
extern LONG NC_HandleSysCommand( HWND32 hwnd, WPARAM16 wParam, POINT16 pt );
extern LONG NC_HandleSetCursor( HWND32 hwnd, WPARAM16 wParam, LPARAM lParam );

View File

@ -48,6 +48,7 @@ struct options
char * desktopGeometry; /* NULL when no desktop */
char * programName; /* To use when loading resources */
char * argv0; /* argv[0] of Wine process */
char *dllFlags; /* -dll flags (hack for Winelib support) */
int usePrivateMap;
int useFixedMap;
int synchronous; /* X synchronous mode */
@ -81,4 +82,7 @@ extern int PROFILE_GetWineIniBool( char const *section, char const *key_name,
int def );
extern char* PROFILE_GetStringItem( char* );
/* Version functions */
extern void VERSION_ParseVersion( char *arg );
#endif /* __WINE_OPTIONS_H */

View File

@ -7,7 +7,7 @@
#ifndef __WINE_SELECTORS_H
#define __WINE_SELECTORS_H
#include "windows.h"
#include "wintypes.h"
#include "ldt.h"
extern WORD SELECTOR_AllocBlock( const void *base, DWORD size,
@ -18,24 +18,26 @@ extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size,
BOOL32 readonly );
extern void SELECTOR_FreeBlock( WORD sel, WORD count );
#if defined(linux)
# define WINE_DATA_SELECTOR 0x2b
# define WINE_CODE_SELECTOR 0x23
#elif defined(__NetBSD__) || defined(__OpenBSD__)
# define WINE_DATA_SELECTOR 0x1f
# define WINE_CODE_SELECTOR 0x17
#elif defined(__FreeBSD__)
# define WINE_DATA_SELECTOR 0x27
# define WINE_CODE_SELECTOR 0x1f
#elif defined(__svr4__) || defined(_SCO_DS)
# define WINE_DATA_SELECTOR 0x1f
# define WINE_CODE_SELECTOR 0x17
#elif defined(__EMX__)
# define WINE_DATA_SELECTOR 0x53 /* Is this always true? */
# define WINE_CODE_SELECTOR 0x5b
#else
# define WINE_DATA_SELECTOR 0x00
# define WINE_CODE_SELECTOR 0x00
#endif
#ifdef __i386__
# define __GET_SEG(seg,res) __asm__( "movw %%" seg ",%w0" : "=r" (res) )
# define __SET_SEG(seg,val) __asm__( "movw %w0,%%" seg : : "r" (val) )
#else /* __i386__ */
# define __GET_SEG(seg,res) ((res) = 0)
# define __SET_SEG(seg,val) /* nothing */
#endif /* __i386__ */
#define GET_CS(cs) __GET_SEG("cs",cs)
#define GET_DS(ds) __GET_SEG("ds",ds)
#define GET_ES(es) __GET_SEG("es",es)
#define GET_FS(fs) __GET_SEG("fs",fs)
#define GET_GS(gs) __GET_SEG("gs",gs)
#define GET_SS(ss) __GET_SEG("ss",ss)
#define SET_CS(cs) __SET_SEG("cs",cs)
#define SET_DS(ds) __SET_SEG("ds",ds)
#define SET_ES(es) __SET_SEG("es",es)
#define SET_FS(fs) __SET_SEG("fs",fs)
#define SET_GS(gs) __SET_SEG("gs",gs)
#define SET_SS(ss) __SET_SEG("ss",ss)
#endif /* __WINE_SELECTORS_H */

View File

@ -7,9 +7,7 @@
#ifndef __WINE_SIG_CONTEXT_H
#define __WINE_SIG_CONTEXT_H
#ifdef WINELIB
#error This file must not be used in Winelib
#endif
#ifdef __i386__
#ifdef linux
typedef struct
@ -37,20 +35,34 @@ typedef struct
unsigned long oldmask;
unsigned long cr2;
} SIGCONTEXT;
#define HANDLER_DEF(name) void name (int signal, SIGCONTEXT context)
#define HANDLER_CONTEXT (&context)
#endif /* linux */
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <signal.h>
typedef struct sigcontext SIGCONTEXT;
#define HANDLER_DEF(name) void name(int signal, int code, SIGCONTEXT *context)
#define HANDLER_CONTEXT context
#endif /* FreeBSD */
#if defined(__svr4__) || defined(_SCO_DS)
#include <signal.h>
#ifdef _SCO_DS
#include <sys/regset.h>
#endif
#include <sys/ucontext.h>
typedef struct ucontext SIGCONTEXT;
#define HANDLER_DEF(name) void name(int signal, void *siginfo, SIGCONTEXT *context)
#define HANDLER_CONTEXT context
#endif /* svr4 || SCO_DS */
#ifdef __EMX__
@ -202,4 +214,6 @@ typedef struct _CONTEXT /* Note 1 */
#define FL_sig(context) (*(WORD*)&EFL_sig(context))
#endif /* __i386__ */
#endif /* __WINE_SIG_CONTEXT_H */

1
include/version.h Normal file
View File

@ -0,0 +1 @@
#define WINE_RELEASE_INFO "Wine release 971116"

View File

@ -39,6 +39,7 @@ typedef enum
BIC32_POPUPMENU,
BIC32_STATIC,
BIC32_SCROLL,
BIC32_MDICLIENT,
BIC32_DESKTOP,
BIC32_DIALOG,
BIC32_ICONTITLE,
@ -127,7 +128,8 @@ extern BOOL32 WIN_IsWindowDrawable(WND*, BOOL32 );
extern HINSTANCE32 WIN_GetWindowInstance( HWND32 hwnd );
extern WND** WIN_BuildWinArray( WND *wndPtr, UINT32 bwa, UINT32* pnum );
extern void DEFWND_SetText( WND *wndPtr, LPCSTR text ); /* windows/defwnd.c */
extern void DEFWND_SetText( WND *wndPtr, LPCSTR text );
extern HBRUSH32 DEFWND_ControlColor( HDC32 hDC, UINT16 ctlType ); /* windows/defwnd.c */
extern void PROPERTY_RemoveWindowProps( WND *pWnd ); /* windows/property.c */

View File

@ -149,10 +149,10 @@ typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
LOADED_PRINTER_DRIVER *pLPD; /* Printer driver info */
} WEPFC;
#define OBJ_PEN 1
#define OBJ_BRUSH 2
#define OBJ_FONT 3
#define OBJ_PBITMAP 5
#define DRVOBJ_PEN 1
#define DRVOBJ_BRUSH 2
#define DRVOBJ_FONT 3
#define DRVOBJ_PBITMAP 5
/* Win16 printer driver physical DC */
typedef struct

View File

@ -1947,6 +1947,40 @@ typedef struct {
HBITMAP32 hbmColor;
} ICONINFO,*LPICONINFO;
#define FVIRTKEY TRUE /* Assumed to be == TRUE */
#define FNOINVERT 0x02
#define FSHIFT 0x04
#define FCONTROL 0x08
#define FALT 0x10
typedef struct
{
BYTE fVirt;
WORD key;
WORD cmd;
} ACCEL16, *LPACCEL16;
typedef struct
{
BYTE fVirt;
BYTE pad0;
WORD key;
WORD cmd;
WORD pad1;
} ACCEL32, *LPACCEL32;
DECL_WINELIB_TYPE(ACCEL);
DECL_WINELIB_TYPE(LPACCEL);
/* Flags for DrawIconEx. */
#define DI_MASK 1
#define DI_IMAGE 2
#define DI_NORMAL (DI_MASK | DI_IMAGE)
#define DI_COMPAT 4
#define DI_DEFAULTSIZE 8
typedef struct {
BYTE i; /* much more .... */
} KANJISTRUCT;
@ -2452,6 +2486,9 @@ typedef struct tagCOMSTAT
#define OBM_CDROM 32729
#define OBM_TRTYPE 32728
/* Wine extension, I think. */
#define OBM_RADIOCHECK 32727
#define OBM_OLD_CLOSE 32767
#define OBM_SIZE 32766
#define OBM_OLD_UPARROW 32765
@ -5450,6 +5487,9 @@ BOOL32 WINAPI AreFileApisANSI(void);
BOOL32 WINAPI Beep(DWORD,DWORD);
BOOL32 WINAPI ClearCommError(INT32,LPDWORD,LPCOMSTAT);
BOOL32 WINAPI CloseHandle(HANDLE32);
INT32 WINAPI CopyAcceleratorTable32A(HACCEL32,LPACCEL32,INT32);
INT32 WINAPI CopyAcceleratorTable32W(HACCEL32,LPACCEL32,INT32);
#define CopyAcceleratorTable WINELIB_NAME_AW(CopyAcceleratorTable)
BOOL32 WINAPI CopyFile32A(LPCSTR,LPCSTR,BOOL32);
BOOL32 WINAPI CopyFile32W(LPCWSTR,LPCWSTR,BOOL32);
#define CopyFile WINELIB_NAME_AW(CopyFile)
@ -5474,6 +5514,7 @@ HANDLE32 WINAPI CreateMutex32W(LPSECURITY_ATTRIBUTES,BOOL32,LPCWSTR);
HANDLE32 WINAPI CreateSemaphore32A(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
HANDLE32 WINAPI CreateSemaphore32W(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
#define CreateSemaphore WINELIB_NAME_AW(CreateSemaphore)
BOOL32 WINAPI DestroyAcceleratorTable(HACCEL32);
BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32);
BOOL32 WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
INT32 WINAPI EnumPropsEx32A(HWND32,PROPENUMPROCEX32A,LPARAM);
@ -5874,6 +5915,9 @@ BOOL32 WINAPI CheckDlgButton32(HWND32,INT32,UINT32);
BOOL16 WINAPI CheckMenuItem16(HMENU16,UINT16,UINT16);
DWORD WINAPI CheckMenuItem32(HMENU32,UINT32,UINT32);
#define CheckMenuItem WINELIB_NAME(CheckMenuItem)
BOOL16 WINAPI CheckMenuRadioButton16(HMENU16,UINT16,UINT16,UINT16,BOOL16);
BOOL32 WINAPI CheckMenuRadioButton32(HMENU32,UINT32,UINT32,UINT32,BOOL32);
#define CheckMenuRadioButton WINELIB_NAME(CheckMenuRadioButton)
BOOL16 WINAPI CheckRadioButton16(HWND16,UINT16,UINT16,UINT16);
BOOL32 WINAPI CheckRadioButton32(HWND32,UINT32,UINT32,UINT32);
#define CheckRadioButton WINELIB_NAME(CheckRadioButton)
@ -5986,6 +6030,11 @@ HBITMAP32 WINAPI CreateDIBitmap32(HDC32,const BITMAPINFOHEADER*,DWORD,
HBRUSH16 WINAPI CreateDIBPatternBrush16(HGLOBAL16,UINT16);
HBRUSH32 WINAPI CreateDIBPatternBrush32(HGLOBAL32,UINT32);
#define CreateDIBPatternBrush WINELIB_NAME(CreateDIBPatternBrush)
HBITMAP16 WINAPI CreateDIBSection16 (HDC16, BITMAPINFO *, UINT16,
LPVOID **, HANDLE16, DWORD offset);
HBITMAP32 WINAPI CreateDIBSection32 (HDC32, BITMAPINFO *, UINT32,
LPVOID **, HANDLE32, DWORD offset);
#define CreateDIBSection WINELIB_NAME(CreateDIBSection)
BOOL16 WINAPI CreateDirectory16(LPCSTR,LPVOID);
BOOL32 WINAPI CreateDirectory32A(LPCSTR,LPSECURITY_ATTRIBUTES);
BOOL32 WINAPI CreateDirectory32W(LPCWSTR,LPSECURITY_ATTRIBUTES);
@ -6206,6 +6255,11 @@ BOOL32 WINAPI DrawFrameControl32(HDC32,LPRECT32,UINT32,UINT32);
BOOL16 WINAPI DrawIcon16(HDC16,INT16,INT16,HICON16);
BOOL32 WINAPI DrawIcon32(HDC32,INT32,INT32,HICON32);
#define DrawIcon WINELIB_NAME(DrawIcon)
BOOL16 WINAPI DrawIconEx16(HDC16,INT16,INT16,HICON16,INT16,INT16,
UINT16,HBRUSH16,UINT16);
BOOL32 WINAPI DrawIconEx32(HDC32,INT32,INT32,HICON32,INT32,INT32,
UINT32,HBRUSH32,UINT32);
#define DrawIconEx WINELIB_NAME(DrawIconEx)
VOID WINAPI DrawMenuBar16(HWND16);
BOOL32 WINAPI DrawMenuBar32(HWND32);
#define DrawMenuBar WINELIB_NAME(DrawMenuBar)
@ -6596,6 +6650,9 @@ INT32 WINAPI GetMenuItemCount32(HMENU32);
UINT16 WINAPI GetMenuItemID16(HMENU16,INT16);
UINT32 WINAPI GetMenuItemID32(HMENU32,INT32);
#define GetMenuItemID WINELIB_NAME(GetMenuItemID)
BOOL16 WINAPI GetMenuItemRect16(HWND16,HMENU16,UINT16,LPRECT16);
BOOL32 WINAPI GetMenuItemRect32(HWND32,HMENU32,UINT32,LPRECT32);
#define GetMenuItemRect WINELIB_NAME(GetMenuItemRect)
UINT16 WINAPI GetMenuState16(HMENU16,UINT16,UINT16);
UINT32 WINAPI GetMenuState32(HMENU32,UINT32,UINT32);
#define GetMenuState WINELIB_NAME(GetMenuState)

View File

@ -8,32 +8,21 @@
#define __WINE_WINTYPES_H
#ifdef __WINE__
#include "config.h"
#endif
#if !defined(__WINE__) && !defined(WINELIB)
/* If we are not compiling Wine, then we should be using Winelib */
#error You must use 'configure --with-library' to build Winelib programs
#define WINELIB
#endif
#ifdef WINELIB
# include "config.h"
# undef WINELIB
# undef WINELIB16
# undef WINELIB32
# undef UNICODE
#else /* __WINE__ */
# ifndef WINELIB
# define WINELIB
# endif
# ifdef WINELIB16
# undef WINELIB32
# else
# ifndef WINELIB32
# define WINELIB32
# endif
# define WINELIB32
# endif
#else
# ifdef WINELIB32
# undef WINELIB16
# define WINELIB
# endif
# ifdef WINELIB16
# define WINELIB
# endif
#endif
#endif /* __WINE__ */
/* Macros to map Winelib names to the correct implementation name */
/* depending on WINELIB16, WINELIB32 and UNICODE macros. */

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -4,23 +4,10 @@ TOPOBJDIR = ..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = none
LIBMODULE = library
LIB_SRCS = \
libres.c \
miscstubs.c
C_SRCS = winestub.c
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
all: $(C_SRCS:.c=.o)
@MAKE_RULES@

View File

@ -1,44 +0,0 @@
/*
* JBP (Jim Peterson <jspeter@birch.ee.vt.edu>): Lots of stubs needed for
* libwine.a.
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "wintypes.h"
/* for windows/winproc.c */
void CallFrom16_long_wwwll(void) {}
extern LRESULT ColorDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileOpenDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileSaveDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FindTextDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT MDIClientWndProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintSetupDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT ReplaceTextDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
/***********************************************************************
* MODULE_GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WPROCS dll.
*/
FARPROC16 MODULE_GetWndProcEntry16( char *name )
{
#define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return (FARPROC16)proc
MAP_STR_TO_PROC("ColorDlgProc",ColorDlgProc);
MAP_STR_TO_PROC("FileOpenDlgProc",FileOpenDlgProc);
MAP_STR_TO_PROC("FileSaveDlgProc",FileSaveDlgProc);
MAP_STR_TO_PROC("FindTextDlgProc",FindTextDlgProc);
MAP_STR_TO_PROC("MDIClientWndProc",MDIClientWndProc);
MAP_STR_TO_PROC("PrintDlgProc",PrintDlgProc);
MAP_STR_TO_PROC("PrintSetupDlgProc",PrintSetupDlgProc);
MAP_STR_TO_PROC("ReplaceTextDlgProc",ReplaceTextDlgProc);
fprintf(stderr,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name);
assert( FALSE );
return NULL;
}

View File

@ -4,8 +4,14 @@
#include "windows.h"
#include "xmalloc.h"
/* Stubs needed for linking with Winelib */
/* FIXME: this should not be necessary */
FARPROC32 BUILTIN_GetProcAddress32( void *mod, LPCSTR func ) { return 0; }
HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ) { return 0; }
extern int PASCAL WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int);
extern int MAIN_Init(void);
extern int MAIN_WinelibInit(void);
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
extern void TASK_Reschedule(void);
@ -32,7 +38,7 @@ int main( int argc, char *argv [] )
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. */
if(!MAIN_WinelibInit()) return 0;
hInstance = WinExec32( *argv, SW_SHOWNORMAL );
TASK_Reschedule();
InitApp( hInstance );

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
@ -6,6 +6,7 @@ VPATH = @srcdir@
MODULE = loader
C_SRCS = \
libres.c \
main.c \
module.c \
ne_image.c \

View File

@ -1,7 +1,7 @@
/*
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
*/
* Main initialization code
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@ -23,7 +23,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "queue.h"
#include "syscolor.h"
#include "sysmetrics.h"
#include "callback.h"
#include "file.h"
#include "gdi.h"
#include "heap.h"
@ -41,78 +40,48 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "stddebug.h"
#include "debug.h"
#ifndef WINELIB
#include "debugger.h"
#endif
int __winelib = 1; /* Winelib run-time flag */
HANDLE32 SystemHeap = 0;
HANDLE32 SegptrHeap = 0;
/***********************************************************************
* Main initialisation routine
* Kernel initialisation routine
*/
int MAIN_Init(void)
BOOL32 MAIN_KernelInit(void)
{
extern BOOL32 EVENT_Init(void);
extern BOOL32 RELAY_Init(void);
extern BOOL32 WIN16DRV_Init(void);
extern BOOL32 VIRTUAL_Init(void);
extern BOOL32 WIDGETS_Init(void);
int queueSize;
/* Initialize virtual memory management */
if (!VIRTUAL_Init()) return 0;
if (!VIRTUAL_Init()) return FALSE;
/* Create the system and SEGPTR heaps */
if (!(SystemHeap = HeapCreate( HEAP_GROWABLE, 0x10000, 0 ))) return 0;
if (!(SegptrHeap = HeapCreate( HEAP_WINE_SEGPTR, 0, 0 ))) return 0;
if (!(SystemHeap = HeapCreate( HEAP_GROWABLE, 0x10000, 0 ))) return FALSE;
if (!(SegptrHeap = HeapCreate( HEAP_WINE_SEGPTR, 0, 0 ))) return FALSE;
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return 0;
if (!PROFILE_LoadWineIni()) return FALSE;
/* Initialize DOS memory */
if (!DOSMEM_Init()) return 0;
if (!DOSMEM_Init()) return FALSE;
/* Initialize signal handling */
if (!SIGNAL_Init()) return 0;
/* Initialize event handling */
if (!EVENT_Init()) return 0;
#ifdef WINELIB
/* Create USER and GDI heap */
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 0x10000 );
LocalInit( USER_HeapSel, 0, 0xffff );
GDI_HeapSel = GlobalAlloc16( GMEM_FIXED, GDI_HEAP_SIZE );
LocalInit( GDI_HeapSel, 0, GDI_HEAP_SIZE-1 );
#else
/* Initialize relay code */
if (!RELAY_Init()) return 0;
/* Initialize signal handling */
if (!SIGNAL_InitEmulator()) return 0;
/* Create the Win16 printer driver */
if (!WIN16DRV_Init()) return 0;
#endif /* WINELIB */
/* Initialize Wine tweaks */
if (!TWEAK_Init()) return 0;
/* Initialize OEM Bitmaps */
if (!OBM_Init()) return 0;
if (!SIGNAL_Init()) return FALSE;
/* Initialise DOS drives */
if (!DRIVE_Init()) return 0;
if (!DRIVE_Init()) return FALSE;
/* Initialise DOS directories */
if (!DIR_Init()) return 0;
if (!DIR_Init()) return FALSE;
/* Initialize tasks */
if (!TASK_Init()) return 0;
if (!TASK_Init()) return FALSE;
/* Initialize event handling */
if (!EVENT_Init()) return FALSE;
/* Initialize communications */
COMM_Init();
@ -120,14 +89,45 @@ int MAIN_Init(void)
/* Initialize IO-port permissions */
IO_port_init();
return TRUE;
}
/***********************************************************************
* USER (and GDI) initialisation routine
*/
BOOL32 MAIN_UserInit(void)
{
extern BOOL32 WIDGETS_Init(void);
int queueSize;
/* Create USER and GDI heap */
if (!USER_HeapSel)
{
USER_HeapSel = GlobalAlloc16( GMEM_FIXED, 0x10000 );
LocalInit( USER_HeapSel, 0, 0xffff );
}
if (!GDI_HeapSel)
{
GDI_HeapSel = GlobalAlloc16( GMEM_FIXED, GDI_HEAP_SIZE );
LocalInit( GDI_HeapSel, 0, GDI_HEAP_SIZE-1 );
}
/* Initialize Wine tweaks */
if (!TWEAK_Init()) return FALSE;
/* Initialize OEM Bitmaps */
if (!OBM_Init()) return FALSE;
/* registry initialisation */
SHELL_LoadRegistry();
/* Global atom table initialisation */
if (!ATOM_Init()) return 0;
if (!ATOM_Init()) return FALSE;
/* GDI initialisation */
if (!GDI_Init()) return 0;
if (!GDI_Init()) return FALSE;
/* Initialize system colors and metrics*/
SYSMETRICS_Init();
@ -137,103 +137,49 @@ int MAIN_Init(void)
DCE_Init();
/* Initialize keyboard */
if (!KEYBOARD_Init()) return 0;
if (!KEYBOARD_Init()) return FALSE;
/* Initialize window procedures */
if (!WINPROC_Init()) return 0;
if (!WINPROC_Init()) return FALSE;
/* Initialize built-in window classes */
if (!WIDGETS_Init()) return 0;
if (!WIDGETS_Init()) return FALSE;
/* Initialize dialog manager */
if (!DIALOG_Init()) return 0;
if (!DIALOG_Init()) return FALSE;
/* Initialize menus */
if (!MENU_Init()) return 0;
if (!MENU_Init()) return FALSE;
/* Create desktop window */
if (!WIN_CreateDesktopWindow()) return 0;
if (!WIN_CreateDesktopWindow()) return FALSE;
/* Initialize message spying */
if (!SPY_Init()) return 0;
if (!SPY_Init()) return FALSE;
/* Check wine.conf for old/bad entries */
if (!TWEAK_CheckConfiguration()) return 0;
if (!TWEAK_CheckConfiguration()) return FALSE;
/* Create system message queue */
queueSize = GetProfileInt32A( "windows", "TypeAhead", 120 );
if (!QUEUE_CreateSysMsgQueue( queueSize )) return 0;
if (!QUEUE_CreateSysMsgQueue( queueSize )) return FALSE;
/* Set double click time */
SetDoubleClickTime32( GetProfileInt32A("windows","DoubleClickSpeed",452) );
return TRUE;
}
/***********************************************************************
* Winelib initialisation routine
*/
int MAIN_WinelibInit(void)
{
/* Initialize the kernel */
if (!MAIN_KernelInit()) return 0;
/* Initialize all the USER stuff */
if (!MAIN_UserInit()) return 0;
return 1;
}
#ifndef WINELIB
/**********************************************************************
* main
*/
int main(int argc, char *argv[] )
{
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
extern void *CALL32_Init(void);
extern char * DEBUG_argv0;
int i,loaded;
HINSTANCE32 handle;
__winelib = 0; /* First of all, clear the Winelib flag */
/*
* Save this so that the internal debugger can get a hold of it if
* it needs to.
*/
DEBUG_argv0 = argv[0];
if (!MAIN_WineInit( &argc, argv )) return 1;
if (!MAIN_Init()) return 1;
/* Initialize CALL32 routines */
/* This needs to be done just before task-switching starts */
IF1632_CallLargeStack = (int (*)(int (*func)(), void *arg))CALL32_Init();
loaded=0;
for (i = 1; i < argc; i++)
{
if ((handle = WinExec32( argv[i], SW_SHOWNORMAL )) < 32)
{
fprintf(stderr, "wine: can't exec '%s': ", argv[i]);
switch (handle)
{
case 2: fprintf( stderr, "file not found\n" ); break;
case 11: fprintf( stderr, "invalid exe file\n" ); break;
case 21: fprintf( stderr, "win32 executable\n" ); break;
default: fprintf( stderr, "error=%d\n", handle ); break;
}
return 1;
}
loaded++;
}
if (!loaded) { /* nothing loaded */
extern void MAIN_Usage(char*);
MAIN_Usage(argv[0]);
return 1;
}
if (!GetNumTasks())
{
fprintf( stderr, "wine: no executable file found.\n" );
return 0;
}
if (Options.debug) DEBUG_AddModuleBreakpoints();
Yield(); /* Start the first task */
fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
return 0;
}
#endif /* #ifndef WINELIB */

View File

@ -4,6 +4,7 @@
* Copyright 1995 Alexandre Julliard
*/
#include <assert.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
@ -918,20 +919,54 @@ BOOL16 MODULE_SetEntryPoint( HMODULE32 hModule, WORD ordinal, WORD offset )
*
* Return an entry point from the WPROCS dll.
*/
#ifndef WINELIB
FARPROC16 MODULE_GetWndProcEntry16( const char *name )
FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
{
WORD ordinal;
FARPROC16 ret;
static HMODULE32 hModule = 0;
FARPROC16 ret = NULL;
if (!hModule) hModule = GetModuleHandle16( "WPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
if (!(ret = MODULE_GetEntryPoint( hModule, ordinal )))
fprintf( stderr, "GetWndProc16: %s not found, please report\n", name );
if (__winelib)
{
/* FIXME: hack for Winelib */
extern LRESULT ColorDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileOpenDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileSaveDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FindTextDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintSetupDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT ReplaceTextDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
if (!strcmp(name,"ColorDlgProc"))
return (FARPROC16)ColorDlgProc;
if (!strcmp(name,"FileOpenDlgProc"))
return (FARPROC16)FileOpenDlgProc;
if (!strcmp(name,"FileSaveDlgProc"))
return (FARPROC16)FileSaveDlgProc;
if (!strcmp(name,"FindTextDlgProc"))
return (FARPROC16)FindTextDlgProc;
if (!strcmp(name,"PrintDlgProc"))
return (FARPROC16)PrintDlgProc;
if (!strcmp(name,"PrintSetupDlgProc"))
return (FARPROC16)PrintSetupDlgProc;
if (!strcmp(name,"ReplaceTextDlgProc"))
return (FARPROC16)ReplaceTextDlgProc;
fprintf(stderr,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name);
assert( FALSE );
return NULL;
}
else
{
WORD ordinal;
static HMODULE32 hModule = 0;
if (!hModule) hModule = GetModuleHandle16( "WPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
if (!(ret = MODULE_GetEntryPoint( hModule, ordinal )))
{
fprintf( stderr, "GetWndProc16: %s not found\n", name );
assert( FALSE );
}
}
return ret;
}
#endif
/***********************************************************************
@ -1109,203 +1144,97 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
NE_MODULE *pModule;
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
OFSTRUCT ofs;
#ifndef WINELIB
WORD *pModRef, *pDLLs;
HFILE32 hFile;
int i;
extern const char * DEBUG_curr_module;
hModule = MODULE_FindModule( name );
if (!hModule) /* We have to load the module */
if (__winelib)
{
/* Try to load the built-in first if not disabled */
if ((hModule = BUILTIN_LoadModule( name, FALSE ))) return hModule;
lstrcpyn32A( ofs.szPathName, name, sizeof(ofs.szPathName) );
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return hModule;
pModule = (NE_MODULE *)GlobalLock16( hModule );
hPrevInstance = 0;
hInstance = MODULE_CreateInstance( hModule, params );
}
else
{
hModule = MODULE_FindModule( name );
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
if (!hModule) /* We have to load the module */
{
/* Now try the built-in even if disabled */
if ((hModule = BUILTIN_LoadModule( name, TRUE )))
/* Try to load the built-in first if not disabled */
if ((hModule = BUILTIN_LoadModule( name, FALSE ))) return hModule;
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
{
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
/* Now try the built-in even if disabled */
if ((hModule = BUILTIN_LoadModule( name, TRUE )))
{
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return hModule;
}
return 2; /* File not found */
}
/* Create the module structure */
hModule = MODULE_LoadExeHeader( hFile, &ofs );
if (hModule < 32)
{
if (hModule == 21)
hModule = PE_LoadModule( hFile, &ofs, paramBlock );
else _lclose32( hFile );
if (hModule < 32)
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
name, hModule );
return hModule;
}
return 2; /* File not found */
_lclose32( hFile );
pModule = MODULE_GetPtr( hModule );
pModule->flags |= uFlags; /* stamp implicitly loaded modules */
/* Allocate the segments for this module */
MODULE_CreateSegments( hModule );
hPrevInstance = 0;
hInstance = MODULE_CreateInstance(hModule,(LOADPARAMS*)paramBlock);
/* Load the referenced DLLs */
if (!NE_LoadDLLs( pModule )) return 2; /* File not found */
/* Load the segments */
NE_LoadAllSegments( pModule );
/* Fixup the functions prologs */
NE_FixupPrologs( pModule );
/* Make sure the usage count is 1 on the first loading of */
/* the module, even if it contains circular DLL references */
pModule->count = 1;
/* Call initialization rountines for all loaded DLLs. Note that
* when we load implicitly linked DLLs this will be done by InitTask().
*/
if ((pModule->flags & (NE_FFLAGS_LIBMODULE | NE_FFLAGS_IMPLICIT)) ==
NE_FFLAGS_LIBMODULE )
NE_InitializeDLLs( hModule );
}
/*
* Record this so that the internal debugger gets some
* record of what it is that we are working with.
*/
DEBUG_curr_module = name;
/* Create the module structure */
hModule = MODULE_LoadExeHeader( hFile, &ofs );
if (hModule < 32)
else /* module is already loaded, just create a new data segment if it's a task */
{
if (hModule == 21)
hModule = PE_LoadModule( hFile, &ofs, paramBlock );
else _lclose32( hFile );
if (hModule < 32)
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
name, hModule );
return hModule;
pModule = MODULE_GetPtr( hModule );
hPrevInstance = MODULE_GetInstance( hModule );
hInstance = MODULE_CreateInstance( hModule, params );
if (hInstance != hPrevInstance) /* not a library */
NE_LoadSegment( pModule, pModule->dgroup );
pModule->count++;
}
_lclose32( hFile );
pModule = MODULE_GetPtr( hModule );
pModule->flags |= uFlags; /* stamp implicitly loaded modules */
} /* !winelib */
/* Allocate the segments for this module */
MODULE_CreateSegments( hModule );
hPrevInstance = 0;
hInstance = MODULE_CreateInstance( hModule, (LOADPARAMS*)paramBlock );
/* Load the referenced DLLs */
pModRef = (WORD *)((char *)pModule + pModule->modref_table);
pDLLs = (WORD *)GlobalLock16( pModule->dlls_to_init );
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
char buffer[256];
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" );
dprintf_module( stddeb, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
/* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT )) == 2)
{
/* file not found */
char *p;
/* Try with prepending the path of the current module */
GetModuleFileName16( hModule, buffer, sizeof(buffer) );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT );
}
if (hDLL < 32)
{
/* FIXME: cleanup what was done */
fprintf( stderr, "Could not load '%s' required by '%s', error = %d\n",
buffer, name, hDLL );
return 2; /* file not found */
}
*pModRef = MODULE_HANDLEtoHMODULE16( hDLL );
*pDLLs++ = *pModRef;
}
else /* Increment the reference count of the DLL */
{
NE_MODULE *pOldDLL = MODULE_GetPtr( *pModRef );
if (pOldDLL) pOldDLL->count++;
}
}
/* Load the segments */
if (pModule->flags & NE_FFLAGS_SELFLOAD)
{
HFILE32 hf;
/* Handle self loading modules */
SEGTABLEENTRY * pSegTable = (SEGTABLEENTRY *) NE_SEG_TABLE(pModule);
SELFLOADHEADER *selfloadheader;
STACK16FRAME *stack16Top;
HMODULE16 hselfload = GetModuleHandle16("WPROCS");
DWORD oldstack;
WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
dprintf_module(stddeb, "MODULE_Load: %*.*s is a self-loading module!\n",
*((BYTE*)pModule + pModule->name_table),
*((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1);
NE_LoadSegment( hModule, 1 );
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(pSegTable->selector, 0);
selfloadheader->EntryAddrProc =
MODULE_GetEntryPoint(hselfload,27);
selfloadheader->MyAlloc = MODULE_GetEntryPoint(hselfload,28);
selfloadheader->SetOwner = MODULE_GetEntryPoint(GetModuleHandle16("KERNEL"),403);
pModule->self_loading_sel = GlobalHandleToSel(
GLOBAL_Alloc (GMEM_ZEROINIT,
0xFF00, hModule, FALSE, FALSE, FALSE)
);
oldstack = IF1632_Saved16_ss_sp;
IF1632_Saved16_ss_sp =
PTR_SEG_OFF_TO_SEGPTR( pModule->self_loading_sel,
0xff00 - sizeof(*stack16Top) );
stack16Top = CURRENT_STACK16;
stack16Top->saved_ss_sp = 0;
stack16Top->ebp = 0;
stack16Top->ds = stack16Top->es = pModule->self_loading_sel;
stack16Top->entry_point = 0;
stack16Top->entry_ip = 0;
stack16Top->entry_cs = 0;
stack16Top->bp = 0;
stack16Top->ip = 0;
stack16Top->cs = 0;
hf = FILE_DupUnixHandle( MODULE_OpenFile( hModule ) );
Callbacks->CallBootAppProc( selfloadheader->BootApp,
hModule, hf );
_lclose32(hf);
/* some BootApp procs overwrite the selector of dgroup */
pSegTable[pModule->dgroup - 1].selector = saved_dgroup;
IF1632_Saved16_ss_sp = oldstack;
for (i = 2; i <= pModule->seg_count; i++)
NE_LoadSegment( hModule, i );
}
else
{
for (i = 1; i <= pModule->seg_count; i++)
NE_LoadSegment( hModule, i );
}
/* Fixup the functions prologs */
NE_FixupPrologs( pModule );
/* Make sure the usage count is 1 on the first loading of */
/* the module, even if it contains circular DLL references */
pModule->count = 1;
/* Call initialization rountines for all loaded DLLs. Note that
* when we load implicitly linked DLLs this will be done by the InitTask().
*/
if ((pModule->flags & (NE_FFLAGS_LIBMODULE | NE_FFLAGS_IMPLICIT)) ==
NE_FFLAGS_LIBMODULE ) NE_InitializeDLLs( hModule );
}
else /* module is already loaded, just create a new data segment if it's a task */
{
pModule = MODULE_GetPtr( hModule );
hPrevInstance = MODULE_GetInstance( hModule );
hInstance = MODULE_CreateInstance( hModule, params );
if (hInstance != hPrevInstance) /* not a library */
NE_LoadSegment( hModule, pModule->dgroup );
pModule->count++;
}
#else
lstrcpyn32A( ofs.szPathName, name, sizeof(ofs.szPathName) );
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return hModule;
pModule = (NE_MODULE *)GlobalLock16( hModule );
hPrevInstance = 0;
hInstance = MODULE_CreateInstance( hModule, params );
#endif /* WINELIB */
/* Create a task for this instance */
/* Create a task for this instance */
if (!(pModule->flags & NE_FFLAGS_LIBMODULE) && (paramBlock != (LPVOID)-1))
{
@ -1675,13 +1604,9 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
if (use_load_module)
{
#ifdef WINELIB
/* WINELIB: Use LoadModule() only for the program itself */
use_load_module = 0;
params.hEnvironment = (HGLOBAL16)GetDOSEnvironment();
#else
/* Winelib: Use LoadModule() only for the program itself */
if (__winelib) use_load_module = 0;
params.hEnvironment = (HGLOBAL16)SELECTOROF( GetDOSEnvironment() );
#endif /* WINELIB */
params.cmdLine = (SEGPTR)WIN16_GlobalLock16( cmdLineHandle );
params.showCmd = (SEGPTR)WIN16_GlobalLock16( cmdShowHandle );
params.reserved = 0;
@ -1840,7 +1765,6 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name )
*/
FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
{
#ifndef WINELIB
NE_MODULE *pModule;
if (HIWORD(function))
@ -1858,9 +1782,6 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
return (FARPROC32)0;
}
return PE_FindExportedFunction( pModule->pe_module, function );
#else
return NULL;
#endif
}
/***********************************************************************

View File

@ -16,6 +16,7 @@
#include <errno.h>
#include "neexe.h"
#include "windows.h"
#include "global.h"
#include "task.h"
#include "selectors.h"
#include "callback.h"
@ -30,9 +31,8 @@
/***********************************************************************
* NE_LoadSegment
*/
BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
{
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable, *pSeg;
WORD *pModuleTable;
WORD count, i, offset;
@ -44,18 +44,17 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
int size;
char* mem;
char buffer[100];
char buffer[256];
int ordinal, additive;
unsigned short *sp;
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
pSegTable = NE_SEG_TABLE( pModule );
pSeg = pSegTable + segnum - 1;
pModuleTable = NE_MODULE_TABLE( pModule );
if (!pSeg->filepos) return TRUE; /* No file image, just return */
fd = MODULE_OpenFile( hModule );
fd = MODULE_OpenFile( pModule->self );
dprintf_module( stddeb, "Loading segment %d, selector=%04x\n",
segnum, pSeg->selector );
lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
@ -88,7 +87,7 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
stack16Top->ip = 0;
stack16Top->cs = 0;
newselector = Callbacks->CallLoadAppSegProc(selfloadheader->LoadAppSeg,
hModule, hf, segnum );
pModule->self, hf, segnum );
_lclose32( hf );
if (newselector != oldselector) {
/* Self loaders like creating their own selectors;
@ -218,16 +217,14 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
if (!address)
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
fprintf( stderr, "Warning: no handler for %*.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
fprintf( stderr, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
}
if (debugging_fixup)
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
fprintf( stddeb,"%d: %*.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
fprintf( stddeb,"%d: %.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address) );
@ -237,7 +234,7 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
case NE_RELTYPE_INTERNAL:
if ((rep->target1 & 0xff) == 0xff)
{
address = MODULE_GetEntryPoint( hModule, rep->target2 );
address = MODULE_GetEntryPoint( pModule->self, rep->target2 );
}
else
{
@ -282,7 +279,7 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
/* we ignore it for now */
if (rep->address_type > NE_RADDR_OFFSET32)
fprintf( stderr, "WARNING: module %s: unknown reloc addr type = 0x%02x. Please report.\n",
MODULE_GetModuleName(hModule), rep->address_type );
MODULE_GetModuleName(pModule->self), rep->address_type );
switch (rep->address_type & 0x7f)
{
@ -357,6 +354,122 @@ BOOL32 NE_LoadSegment( HMODULE16 hModule, WORD segnum )
}
/***********************************************************************
* NE_LoadAllSegments
*/
BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
{
int i;
if (pModule->flags & NE_FFLAGS_SELFLOAD)
{
HFILE32 hf;
/* Handle self loading modules */
SEGTABLEENTRY * pSegTable = (SEGTABLEENTRY *) NE_SEG_TABLE(pModule);
SELFLOADHEADER *selfloadheader;
STACK16FRAME *stack16Top;
HMODULE16 hselfload = GetModuleHandle16("WPROCS");
DWORD oldstack;
WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
dprintf_module(stddeb, "MODULE_Load: %.*s is a self-loading module!\n",
*((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1);
if (!NE_LoadSegment( pModule, 1 )) return FALSE;
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(pSegTable->selector, 0);
selfloadheader->EntryAddrProc = MODULE_GetEntryPoint(hselfload,27);
selfloadheader->MyAlloc = MODULE_GetEntryPoint(hselfload,28);
selfloadheader->SetOwner = MODULE_GetEntryPoint(GetModuleHandle16("KERNEL"),403);
pModule->self_loading_sel = GlobalHandleToSel(GLOBAL_Alloc(GMEM_ZEROINIT, 0xFF00, pModule->self, FALSE, FALSE, FALSE));
oldstack = IF1632_Saved16_ss_sp;
IF1632_Saved16_ss_sp = PTR_SEG_OFF_TO_SEGPTR(pModule->self_loading_sel,
0xff00 - sizeof(*stack16Top) );
stack16Top = CURRENT_STACK16;
stack16Top->saved_ss_sp = 0;
stack16Top->ebp = 0;
stack16Top->ds = stack16Top->es = pModule->self_loading_sel;
stack16Top->entry_point = 0;
stack16Top->entry_ip = 0;
stack16Top->entry_cs = 0;
stack16Top->bp = 0;
stack16Top->ip = 0;
stack16Top->cs = 0;
hf = FILE_DupUnixHandle( MODULE_OpenFile( pModule->self ) );
Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self, hf);
_lclose32(hf);
/* some BootApp procs overwrite the selector of dgroup */
pSegTable[pModule->dgroup - 1].selector = saved_dgroup;
IF1632_Saved16_ss_sp = oldstack;
for (i = 2; i <= pModule->seg_count; i++)
if (!NE_LoadSegment( pModule, i )) return FALSE;
}
else
{
for (i = 1; i <= pModule->seg_count; i++)
if (!NE_LoadSegment( pModule, i )) return FALSE;
}
return TRUE;
}
/***********************************************************************
* NE_LoadDLLs
*/
BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
{
int i;
WORD *pModRef = (WORD *)((char *)pModule + pModule->modref_table);
WORD *pDLLs = (WORD *)GlobalLock16( pModule->dlls_to_init );
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
char buffer[256];
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" );
dprintf_module( stddeb, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
/* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT )) == 2)
{
/* file not found */
char *p;
/* Try with prepending the path of the current module */
GetModuleFileName16( pModule->self, buffer, sizeof(buffer) );
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT );
}
if (hDLL < 32)
{
/* FIXME: cleanup what was done */
fprintf( stderr, "Could not load '%s' required by '%.*s', error = %d\n",
buffer, *((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, hDLL );
return FALSE;
}
*pModRef = MODULE_HANDLEtoHMODULE16( hDLL );
*pDLLs++ = *pModRef;
}
else /* Increment the reference count of the DLL */
{
NE_MODULE *pOldDLL = MODULE_GetPtr( *pModRef );
if (pOldDLL) pOldDLL->count++;
}
}
return TRUE;
}
/***********************************************************************
* NE_FixupPrologs
*

View File

@ -34,9 +34,6 @@
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#ifndef WINELIB
#include "debugger.h"
#endif
static void PE_InitDLL(PE_MODREF* modref, DWORD type, LPVOID lpReserved);
@ -49,7 +46,7 @@ void dump_exports(IMAGE_EXPORT_DIRECTORY * pe_exports, unsigned int load_addr)
int i, j;
u_short *ordinal;
u_long *function,*functions;
u_char **name,*ename;
u_char **name;
Module = (char*)RVA(pe_exports->Name);
dprintf_win32(stddeb,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n",
@ -65,7 +62,7 @@ void dump_exports(IMAGE_EXPORT_DIRECTORY * pe_exports, unsigned int load_addr)
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
{
if (!*function) continue; /* No such function */
dprintf_win32( stddeb,"%4d %08lx", i + pe_exports->Base, *function );
dprintf_win32( stddeb,"%4ld %08lx", i + pe_exports->Base, *function );
/* Check if we have a name for it */
for (j = 0; j < pe_exports->NumberOfNames; j++)
if (ordinal[j] == i)
@ -584,16 +581,6 @@ PE_MapImage(PE_MODULE *pe,PDB32 *process, OFSTRUCT *ofs, DWORD flags) {
pem->pe_reloc = (void *) RVA(dir.VirtualAddress);
}
#ifndef WINELIB
if(pe->pe_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_DEBUG].Size)
{
DEBUG_RegisterDebugInfo(pe, load_addr,
pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress,
pe->pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].Size);
}
#endif
if(pe->pe_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
dprintf_win32(stdnimp,"Copyright string ignored\n");
@ -667,20 +654,17 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
pModule = MODULE_GetPtr(hModule);
} else {
#ifndef WINELIB
/* try to load builtin, enabled modules first */
if ((hModule = BUILTIN_LoadModule( name, FALSE )))
return hModule;
#endif
/* try to open the specified file */
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
#ifndef WINELIB
/* Now try the built-in even if disabled */
if ((hModule = BUILTIN_LoadModule( name, TRUE ))) {
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return hModule;
}
#endif
return 1;
}
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) {

View File

@ -18,7 +18,6 @@
#include "heap.h"
#include "neexe.h"
#include "task.h"
#include "accel.h"
#include "module.h"
#include "resource.h"
#include "stddebug.h"
@ -63,14 +62,16 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
if ((pModule = MODULE_GetPtr( hModule )))
{
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"FindResource16: %s", NEWin32FailureString);
else
return NE_FindResource( hModule, type, name );
#else
return LIBRES_FindResource16( hModule, name, type );
#endif
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"FindResource16: %s", NEWin32FailureString);
else
return NE_FindResource( hModule, type, name );
}
else return LIBRES_FindResource16( hModule,
(LPCSTR)PTR_SEG_TO_LIN(name),
(LPCSTR)PTR_SEG_TO_LIN(type) );
}
return 0;
}
@ -114,28 +115,29 @@ HANDLE32 WINAPI FindResourceEx32A( HINSTANCE32 hModule, LPCSTR name,
HRSRC32 WINAPI FindResourceEx32W( HINSTANCE32 hModule, LPCWSTR name,
LPCWSTR type, WORD lang )
{
#ifndef WINELIB
NE_MODULE *pModule;
if (!__winelib)
{
NE_MODULE *pModule;
if (!hModule) hModule = GetTaskDS();
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "FindResource32W: module=%08x type=", hModule );
if (HIWORD(type))
dprintf_resource(stddeb,"%p",type);
else
dprintf_resource(stddeb,"#%p",type);
dprintf_resource( stddeb, " name=" );
if (HIWORD(name))
dprintf_resource(stddeb,"%p",name);
else
dprintf_resource(stddeb,"#%p",name);
dprintf_resource( stddeb, "\n" );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0;
return PE_FindResourceEx32W(hModule,name,type,lang);
#else
return LIBRES_FindResource32( hModule, name, type );
#endif
if (!hModule) hModule = GetTaskDS();
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "FindResource32W: module=%08x type=",
hModule );
if (HIWORD(type))
dprintf_resource(stddeb,"%p",type);
else
dprintf_resource(stddeb,"#%p",type);
dprintf_resource( stddeb, " name=" );
if (HIWORD(name))
dprintf_resource(stddeb,"%p",name);
else
dprintf_resource(stddeb,"#%p",name);
dprintf_resource( stddeb, "\n" );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0;
return PE_FindResourceEx32W(hModule,name,type,lang);
}
else return LIBRES_FindResource32( hModule, name, type );
}
/**********************************************************************
@ -160,14 +162,14 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
if (!hRsrc) return 0;
if ((pModule = MODULE_GetPtr( hModule )))
{
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"LoadResource16: %s", NEWin32FailureString);
else
return NE_LoadResource( hModule, hRsrc );
#else
return LIBRES_LoadResource( hModule, hRsrc );
#endif
if (!__winelib)
{
if (pModule->flags & NE_FFLAGS_WIN32)
fprintf(stderr,"LoadResource16: %s", NEWin32FailureString);
else
return NE_LoadResource( hModule, hRsrc );
}
else return LIBRES_LoadResource( hModule, hRsrc );
}
return 0;
}
@ -177,25 +179,25 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
*/
HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{
#ifndef WINELIB
NE_MODULE *pModule;
if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "LoadResource32: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32))
if (!__winelib)
{
fprintf(stderr,"LoadResource32: %s", PEWin16FailureString );
return 0; /* FIXME? */
NE_MODULE *pModule;
if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "LoadResource32: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!(pModule->flags & NE_FFLAGS_WIN32))
{
fprintf(stderr,"LoadResource32: %s", PEWin16FailureString );
return 0; /* FIXME? */
}
return PE_LoadResource32(hModule,hRsrc);
}
return PE_LoadResource32(hModule,hRsrc);
#else
return LIBRES_LoadResource( hModule, hRsrc );
#endif
else return LIBRES_LoadResource( hModule, hRsrc );
}
@ -205,7 +207,6 @@ HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
/* 16-bit version */
SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16 handle)
{
#ifndef WINELIB
HMODULE16 hModule;
NE_MODULE *pModule;
@ -219,31 +220,28 @@ SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16 handle)
return 0;
}
return NE_LockResource( hModule, handle );
#else
return LIBRES_LockResource( handle );
#endif
}
/* WINELIB 16-bit version */
/* Winelib 16-bit version */
LPVOID WINAPI LockResource16( HGLOBAL16 handle )
{
#ifndef WINELIB
HMODULE16 hModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle );
if (!handle) return NULL;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
if (!__winelib)
{
fprintf(stderr,"LockResource16: %s", NEWin32FailureString);
return 0;
HMODULE16 hModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle );
if (!handle) return NULL;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"LockResource16: %s", NEWin32FailureString);
return 0;
}
return (LPSTR)PTR_SEG_TO_LIN( NE_LockResource( hModule, handle ) );
}
return (LPSTR)PTR_SEG_TO_LIN( NE_LockResource( hModule, handle ) );
#else
return LIBRES_LockResource( handle );
#endif
else return LIBRES_LockResource( handle );
}
@ -261,23 +259,23 @@ LPVOID WINAPI LockResource32( HGLOBAL32 handle )
*/
BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
{
#ifndef WINELIB
HMODULE16 hModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "FreeResource16: handle=%04x\n", handle );
if (!handle) return FALSE;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
if (!__winelib)
{
fprintf(stderr,"FreeResource16: %s", NEWin32FailureString);
return 0;
HMODULE16 hModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "FreeResource16: handle=%04x\n", handle );
if (!handle) return FALSE;
hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"FreeResource16: %s", NEWin32FailureString);
return 0;
}
return NE_FreeResource( hModule, handle );
}
return NE_FreeResource( hModule, handle );
#else
return LIBRES_FreeResource( handle );
#endif
else return LIBRES_FreeResource( handle );
}
/**********************************************************************
@ -302,16 +300,16 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
if (!__winelib)
{
fprintf(stderr,"AccessResource16: %s", NEWin32FailureString);
return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"AccessResource16: %s", NEWin32FailureString);
return 0;
}
return NE_AccessResource( hModule, hRsrc );
}
return NE_AccessResource( hModule, hRsrc );
#else
return LIBRES_AccessResource( hModule, hRsrc );
#endif
else return LIBRES_AccessResource( hModule, hRsrc );
}
@ -340,16 +338,16 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
dprintf_resource(stddeb, "SizeofResource16: module=%04x res=%04x\n",
hModule, hRsrc );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
if (!__winelib)
{
fprintf(stderr,"SizeOfResource16: %s", NEWin32FailureString);
return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"SizeOfResource16: %s", NEWin32FailureString);
return 0;
}
return NE_SizeofResource( hModule, hRsrc );
}
return NE_SizeofResource( hModule, hRsrc );
#else
return LIBRES_SizeofResource( hModule, hRsrc );
#endif
else return LIBRES_SizeofResource( hModule, hRsrc );
}
@ -361,12 +359,12 @@ DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_resource(stddeb, "SizeofResource32: module=%04x res=%04x\n",
hModule, hRsrc );
#ifndef WINELIB
return PE_SizeofResource32(hModule,hRsrc);
#else
fprintf(stderr,"SizeofResource32: not implemented\n");
return 0;
#endif
if (!__winelib) return PE_SizeofResource32(hModule,hRsrc);
else
{
fprintf(stderr,"SizeofResource32: not implemented\n");
return 0;
}
}
@ -382,16 +380,16 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
hModule, hRsrc, size );
if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
#ifndef WINELIB
if (pModule->flags & NE_FFLAGS_WIN32)
if (!__winelib)
{
fprintf(stderr,"AllocResource16: %s", NEWin32FailureString);
return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
fprintf(stderr,"AllocResource16: %s", NEWin32FailureString);
return 0;
}
return NE_AllocResource( hModule, hRsrc, size );
}
return NE_AllocResource( hModule, hRsrc, size );
#else
return LIBRES_AllocResource( hModule, hRsrc, size );
#endif
else return LIBRES_AllocResource( hModule, hRsrc, size );
}
/**********************************************************************
@ -471,7 +469,33 @@ HACCEL32 WINAPI LoadAccelerators32A(HINSTANCE32 instance,LPCSTR lpTableName)
return result;
}
/**********************************************************************
* CopyAcceleratorTable32A (USER32.58)
*/
INT32 WINAPI CopyAcceleratorTable32A(HACCEL32 src, LPACCEL32 dst, INT32 entries)
{
fprintf(stderr,"CopyAcceleratorTable32A: not implemented: %d\n", entries);
return 0;
}
/**********************************************************************
* CopyAcceleratorTable32W (USER32.59)
*/
INT32 WINAPI CopyAcceleratorTable32W(HACCEL32 src, LPACCEL32 dst, INT32 entries)
{
fprintf(stderr,"CopyAcceleratorTable32W: not implemented: %d\n", entries);
return 0;
}
/**********************************************************************
* DestroyAcceleratorTable (USER32.130)
*/
BOOL32 WINAPI DestroyAcceleratorTable( HACCEL32 handle )
{
fprintf(stderr,"DestroyAcceleratorTable: not implemented\n");
return TRUE;
}
/**********************************************************************
* LoadString16
*/

View File

@ -65,9 +65,7 @@ BOOL32 TASK_Init(void)
if (!(hDOSEnvironment = TASK_CreateDOSEnvironment()))
fprintf( stderr, "Not enough memory for DOS Environment\n" );
TASK_SystemTHDB.teb_sel = SELECTOR_AllocBlock( &TASK_SystemTHDB, 0x1000, SEGMENT_DATA, TRUE, FALSE );
#ifdef __i386__
__asm__ __volatile__("movw %w0,%%fs"::"r"(TASK_SystemTHDB.teb_sel));
#endif
SET_FS( TASK_SystemTHDB.teb_sel );
return (hDOSEnvironment != 0);
}
@ -334,7 +332,6 @@ static BOOL32 TASK_FreeThunk( HTASK16 hTask, SEGPTR thunk )
* 32-bit entry point for a new task. This function is responsible for
* setting up the registers and jumping to the 16-bit entry point.
*/
#ifndef WINELIB
static void TASK_CallToStart(void)
{
int exit_code = 1;
@ -354,9 +351,7 @@ static void TASK_CallToStart(void)
InitTask( NULL );
InitApp( pTask->hModule );
#ifdef __i386__
__asm__ __volatile__("movw %w0,%%fs"::"r" (pCurrentThread->teb_sel));
#endif
SET_FS( pCurrentThread->teb_sel );
PE_InitializeDLLs( pCurrentProcess, DLL_PROCESS_ATTACH, (LPVOID)-1 );
dprintf_relay( stddeb, "CallTo32(entryproc=%p)\n", entry );
exit_code = entry();
@ -398,7 +393,6 @@ static void TASK_CallToStart(void)
TASK_KillCurrentTask( 1 );
}
}
#endif
/***********************************************************************
@ -415,13 +409,10 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
LPSTR name;
WORD sp;
char *stack32Top;
STACK16FRAME *frame16;
STACK32FRAME *frame32;
#ifndef WINELIB
extern DWORD CALLTO16_RetAddr_regs;
extern void CALLTO16_Restore();
#endif
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
pSegTable = NE_SEG_TABLE( pModule );
@ -489,10 +480,8 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
pTask->pdb.int20 = 0x20cd;
pTask->pdb.dispatcher[0] = 0x9a; /* ljmp */
#ifndef WINELIB
*(FARPROC16 *)&pTask->pdb.dispatcher[1] = MODULE_GetEntryPoint(
GetModuleHandle16("KERNEL"), 102 ); /* KERNEL.102 is DOS3Call() */
#endif
PUT_DWORD(&pTask->pdb.dispatcher[1], (DWORD)MODULE_GetEntryPoint(
GetModuleHandle16("KERNEL"), 102 )); /* KERNEL.102 is DOS3Call() */
pTask->pdb.savedint22 = INT_GetHandler( 0x22 );
pTask->pdb.savedint23 = INT_GetHandler( 0x23 );
pTask->pdb.savedint24 = INT_GetHandler( 0x24 );
@ -538,11 +527,9 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
*/
pTask->thdb = THREAD_Create( pdb32, 0, 0 );
#ifndef WINELIB
/* FIXME: should not be done here */
pCurrentThread = pTask->thdb;
PE_InitTls( pdb32 );
#endif
}
else
pTask->thdb = THREAD_Create( pdb32, 0, NULL );
@ -558,32 +545,26 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
frame32->edx = 0;
frame32->ecx = 0;
frame32->ebx = 0;
frame32->ebp = 0;
#ifndef WINELIB
frame32->restore_addr = (DWORD)CALLTO16_Restore;
frame32->retaddr = (DWORD)TASK_CallToStart;
frame32->codeselector = WINE_CODE_SELECTOR;
#endif
/* The remaining fields will be initialized in TASK_Reschedule */
/* Create the 16-bit stack frame */
pTask->ss_sp = PTR_SEG_OFF_TO_SEGPTR( hInstance,
((pModule->sp != 0) ? pModule->sp :
pSegTable[pModule->ss-1].minsize + pModule->stack_size) & ~1 );
pTask->ss_sp -= sizeof(STACK16FRAME) - sizeof(DWORD) /* for saved %esp */;
if (!(sp = pModule->sp))
sp = pSegTable[pModule->ss-1].minsize + pModule->stack_size;
sp &= ~1;
pTask->ss_sp = PTR_SEG_OFF_TO_SEGPTR( hInstance, sp );
pTask->ss_sp -= sizeof(STACK16FRAME) + sizeof(DWORD) /* for saved %esp */;
frame16 = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->ss_sp );
frame16->saved_ss_sp = 0;
frame16->ebp = 0;
frame16->ebp = sp + (int)&((STACK16FRAME *)0)->bp;
frame16->bp = LOWORD(frame16->ebp);
frame16->ds = frame16->es = pTask->hInstance;
frame16->entry_point = 0;
frame16->entry_ip = 0;
frame16->entry_cs = 0;
frame16->bp = 0;
/* The remaining fields will be initialized in TASK_Reschedule */
*(STACK32FRAME **)(frame16 + 1) = frame32; /* Store the 32-bit %esp */
#ifndef WINELIB
frame16->ip = LOWORD( CALLTO16_RetAddr_regs );
frame16->cs = HIWORD( CALLTO16_RetAddr_regs );
#endif /* WINELIB */
/* If there's no 16-bit stack yet, use a part of the new task stack */
/* This is only needed to have a stack to switch from on the first */
@ -717,6 +698,7 @@ void TASK_Reschedule(void)
{
TDB *pOldTask = NULL, *pNewTask;
HTASK16 hTask = 0;
STACK16FRAME *newframe16;
#ifdef CONFIG_IPC
dde_reschedule();
@ -788,6 +770,23 @@ void TASK_Reschedule(void)
TASK_LinkTask( hTask );
pNewTask->priority--;
/* Finish initializing the new task stack if necessary */
newframe16 = (STACK16FRAME *)PTR_SEG_TO_LIN( pNewTask->ss_sp );
if (!newframe16->entry_cs)
{
STACK16FRAME *oldframe16 = CURRENT_STACK16;
STACK32FRAME *oldframe32 = *(STACK32FRAME **)(oldframe16 + 1);
STACK32FRAME *newframe32 = *(STACK32FRAME **)(newframe16 + 1);
newframe16->entry_ip = oldframe16->entry_ip;
newframe16->entry_cs = oldframe16->entry_cs;
newframe16->ip = oldframe16->ip;
newframe16->cs = oldframe16->cs;
newframe32->ebp = oldframe32->ebp;
newframe32->restore_addr = oldframe32->restore_addr;
newframe32->codeselector = oldframe32->codeselector;
}
/* Switch to the new stack */
hCurrentTask = hTask;

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -144,16 +144,14 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
/* Check if we are freeing current %fs or %gs selector */
WORD fs, gs;
__asm__("movw %%fs,%w0":"=r" (fs));
GET_FS(fs);
if ((fs >= sel) && (fs < nextsel))
{
fprintf( stderr, "SELECTOR_FreeBlock: freeing %%fs selector (%04x), not good.\n", fs );
__asm__("movw %w0,%%fs"::"r" (0));
SET_FS( 0 );
}
__asm__("movw %%gs,%w0":"=r" (gs));
if ((gs >= sel) && (gs < nextsel))
__asm__("movw %w0,%%gs"::"r" (0));
GET_GS(gs);
if ((gs >= sel) && (gs < nextsel)) SET_GS( 0 );
}
#endif /* __i386__ */

View File

@ -12,6 +12,7 @@
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
#include "debugstr.h"
static const BYTE STRING_Oem2Ansi[256] =
"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\244"
@ -77,8 +78,8 @@ SEGPTR WINAPI lstrcat16( SEGPTR dst, LPCSTR src )
*/
LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src )
{
dprintf_string(stddeb,"strcat: Append '%s' to '%s'\n",
(src)?src:"NULL",(dst)?dst:"NULL");
dprintf_string(stddeb,"strcat: Append %s to %s\n",
debugstr_a (src), debugstr_a (dst));
strcat( dst, src );
return dst;
}
@ -90,6 +91,8 @@ LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src )
LPWSTR WINAPI lstrcat32W( LPWSTR dst, LPCWSTR src )
{
register LPWSTR p = dst;
dprintf_string(stddeb,"strcat: Append L%s to L%s\n",
debugstr_w (src), debugstr_w (dst));
while (*p) p++;
while ((*p++ = *src++));
return dst;
@ -112,8 +115,8 @@ SEGPTR WINAPI lstrcatn16( SEGPTR dst, LPCSTR src, INT16 n )
LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
{
register LPSTR p = dst;
dprintf_string(stddeb,"strcatn add %d chars from '%s' to '%s'\n",
n,(src)?src:"NULL",(dst)?dst:"NULL");
dprintf_string(stddeb,"strcatn add %d chars from %s to %s\n",
n, debugstr_an (src, n), debugstr_a (dst));
while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst;
lstrcpyn32A( p, src, n );
@ -127,6 +130,8 @@ LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
LPWSTR WINAPI lstrcatn32W( LPWSTR dst, LPCWSTR src, INT32 n )
{
register LPWSTR p = dst;
dprintf_string(stddeb,"strcatn add %d chars from L%s to L%s\n",
n, debugstr_wn (src, n), debugstr_w (dst));
while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst;
lstrcpyn32W( p, src, n );
@ -148,14 +153,13 @@ INT16 WINAPI lstrcmp16( LPCSTR str1, LPCSTR str2 )
*/
INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
{
dprintf_string(stddeb,"strcmp: %s and %s\n",
debugstr_a (str1), debugstr_a (str2));
/* Win95 KERNEL32.DLL does it that way. Hands off! */
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
dprintf_string(stddeb,"strcmp: '%s' and '%s'\n",
(str1)?str1:"NULL",(str2)?str2:"NULL");
return (INT32)strcmp( str1, str2 );
}
@ -165,6 +169,8 @@ INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
*/
INT32 WINAPI lstrcmp32W( LPCWSTR str1, LPCWSTR str2 )
{
dprintf_string(stddeb,"strcmp: L%s and L%s\n",
debugstr_w (str1), debugstr_w (str2));
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
@ -190,12 +196,12 @@ INT32 WINAPI lstrcmpi32A( LPCSTR str1, LPCSTR str2 )
{
INT32 res;
dprintf_string(stddeb,"strcmpi %s and %s\n",
debugstr_a (str1), debugstr_a (str2));
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
dprintf_string(stddeb,"strcmpi '%s' and '%s'\n",
(str1)?str1:"NULL",(str2)?str2:"NULL");
while (*str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
@ -213,6 +219,11 @@ INT32 WINAPI lstrcmpi32W( LPCWSTR str1, LPCWSTR str2 )
{
INT32 res;
#if 0
/* Too much! (From registry loading.) */
dprintf_string(stddeb,"strcmpi L%s and L%s\n",
debugstr_w (str1), debugstr_w (str2));
#endif
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
@ -243,8 +254,7 @@ SEGPTR WINAPI lstrcpy16( SEGPTR dst, LPCSTR src )
*/
LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src )
{
dprintf_string(stddeb,"strcpy '%s'\n",
(src)?src:"NULL");
dprintf_string(stddeb,"strcpy %s\n", debugstr_a (src));
if (!src || !dst) return NULL;
strcpy( dst, src );
return dst;
@ -257,6 +267,7 @@ LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src )
LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src )
{
register LPWSTR p = dst;
dprintf_string(stddeb,"strcpy L%s\n", debugstr_w (src));
while ((*p++ = *src++));
return dst;
}
@ -278,8 +289,8 @@ SEGPTR WINAPI lstrcpyn16( SEGPTR dst, LPCSTR src, INT16 n )
LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
{
LPSTR p = dst;
dprintf_string(stddeb,"strcpyn '%s' for %d chars\n",
(src)?src:"NULL",n);
dprintf_string(stddeb,"strcpyn %s for %d chars\n",
debugstr_an (src,n), n);
while ((n-- > 1) && *src) *p++ = *src++;
if (n >= 0) *p = 0;
return dst;
@ -292,6 +303,8 @@ LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n )
{
LPWSTR p = dst;
dprintf_string(stddeb,"strcpyn L%s for %d chars\n",
debugstr_wn (src,n), n);
while ((n-- > 1) && *src) *p++ = *src++;
if (n >= 0) *p = 0;
return dst;
@ -316,7 +329,7 @@ INT32 WINAPI lstrlen32A( LPCSTR str )
* in lstrlen() ... we check only for NULL pointer reference.
* - Marcus Meissner
*/
dprintf_string(stddeb,"strlen '%s'\n", (str)?str:"NULL");
dprintf_string(stddeb,"strlen %s\n", debugstr_a (str));
if (!str) return 0;
return (INT32)strlen(str);
}
@ -328,6 +341,7 @@ INT32 WINAPI lstrlen32A( LPCSTR str )
INT32 WINAPI lstrlen32W( LPCWSTR str )
{
INT32 len = 0;
dprintf_string(stddeb,"strlen L%s\n", debugstr_w (str));
if (!str) return 0;
while (*str++) len++;
return len;
@ -339,8 +353,8 @@ INT32 WINAPI lstrlen32W( LPCWSTR str )
*/
INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
{
dprintf_string(stddeb,"strncmp '%s' and '%s' for %d chars\n",
(str1)?str1:"NULL",(str2)?str2:"NULL",n);
dprintf_string(stddeb,"strncmp %s and %s for %d chars\n",
debugstr_an (str1, n), debugstr_an (str2, n), n);
return (INT32)strncmp( str1, str2, n );
}
@ -350,6 +364,8 @@ INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
*/
INT32 WINAPI lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
{
dprintf_string(stddeb,"strncmp L%s and L%s for %d chars\n",
debugstr_wn (str1, n), debugstr_wn (str2, n), n);
if (!n) return 0;
while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
return (INT32)(*str1 - *str2);
@ -363,8 +379,8 @@ INT32 WINAPI lstrncmpi32A( LPCSTR str1, LPCSTR str2, INT32 n )
{
INT32 res;
dprintf_string(stddeb,"strncmpi '%s' and '%s' for %d chars\n",
(str1)?str1:"NULL",(str2)?str2:"NULL",n);
dprintf_string(stddeb,"strncmpi %s and %s for %d chars\n",
debugstr_an (str1, n), debugstr_an (str2, n), n);
if (!n) return 0;
while ((--n > 0) && *str1)
if ( (res = toupper(*str1++) - toupper(*str2++)) ) return res;
@ -380,6 +396,8 @@ INT32 WINAPI lstrncmpi32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
{
INT32 res;
dprintf_string(stddeb,"strncmpi L%s and L%s for %d chars\n",
debugstr_wn (str1, n), debugstr_wn (str2, n), n);
if (!n) return 0;
while ((--n > 0) && *str1)
{
@ -517,10 +535,11 @@ void WINAPI OemToAnsiBuff16( LPCSTR s, LPSTR d, UINT16 len )
*/
BOOL32 WINAPI CharToOem32A( LPCSTR s, LPSTR d )
{
LPSTR oldd = d;
if (!s || !d) return TRUE;
dprintf_string(stddeb,"CharToOem '%s'\n", (s)?s:"NULL");
dprintf_string (stddeb,"CharToOem %s\n", debugstr_a (s));
while ((*d++ = ANSI_TO_OEM(*s++)));
dprintf_string(stddeb," to '%s'\n", (d)?d:"NULL");
dprintf_string (stddeb," to %s\n", debugstr_a (oldd));
return TRUE;
}
@ -550,7 +569,11 @@ BOOL32 WINAPI CharToOemBuff32W( LPCWSTR s, LPSTR d, DWORD len )
*/
BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d )
{
LPSTR oldd = d;
if (!s || !d) return TRUE;
dprintf_string (stddeb,"CharToOem L%s\n", debugstr_w (s));
while ((*d++ = ANSI_TO_OEM(*s++)));
dprintf_string (stddeb," to %s\n", debugstr_a (oldd));
return TRUE;
}
@ -561,9 +584,9 @@ BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d )
BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
{
LPSTR oldd = d;
dprintf_string(stddeb,"OemToChar '%s'\n", (s)?s:"NULL");
dprintf_string(stddeb,"OemToChar %s\n", debugstr_a (s));
while ((*d++ = OEM_TO_ANSI(*s++)));
dprintf_string(stddeb," to '%s'\n", oldd);
dprintf_string(stddeb," to %s\n", debugstr_a (oldd));
return TRUE;
}
@ -573,7 +596,7 @@ BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
*/
BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
{
dprintf_string(stddeb,"OemToCharBuff '%s' for %ld chars\n", (s)?s:"NULL",len);
dprintf_string(stddeb,"OemToCharBuff %s\n", debugstr_an (s, len));
while (len--) *d++ = OEM_TO_ANSI(*s++);
return TRUE;
}
@ -584,6 +607,7 @@ BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
*/
BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len )
{
dprintf_string(stddeb,"OemToCharBuff %s\n", debugstr_an (s, len));
while (len--) *d++ = (WCHAR)OEM_TO_ANSI(*s++);
return TRUE;
}

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
@ -14,6 +14,7 @@ C_SRCS = \
crtdll.c \
cpu.c \
ddeml.c \
debugstr.c \
error.c \
lstr.c \
lzexpand.c \
@ -37,6 +38,7 @@ C_SRCS = \
toolhelp.c \
tweak.c \
ver.c \
version.c \
w32sys.c \
winsock.c \
winsock_dns.c \

View File

@ -132,6 +132,7 @@ static const CALLBACKS_TABLE CALLBACK_WinelibTable =
{
CALLBACK_CallRegisterProc, /* CallRegisterProc */
TASK_Reschedule, /* CallTaskRescheduleProc */
NULL, /* CallFrom16WndProc */
CALLBACK_CallWndProc, /* CallWndProc */
CALLBACK_CallDriverProc, /* CallDriverProc */
CALLBACK_CallDriverCallback, /* CallDriverCallback */

View File

@ -2,6 +2,7 @@
* DDEML library
*
* Copyright 1997 Alexandre Julliard
* Copyright 1997 Len White
*/
/* Only empty stubs for now */
@ -63,6 +64,33 @@ BOOL32 WINAPI DdeUninitialize32( DWORD idInst )
return TRUE;
}
/*****************************************************************
* DdeConnectList (DDEML.4)
*/
HCONVLIST WINAPI DdeConnectList( DWORD idInst, HSZ hszService, HSZ hszTopic,
HCONVLIST hConvList, LPCONVCONTEXT16 pCC )
{
fprintf( stdnimp, "DdeConnectList: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeQueryNextServer (DDEML.5)
*/
HCONV WINAPI DdeQueryNextServer( HCONVLIST hConvList, HCONV hConvPrev )
{
fprintf( stdnimp, "DdeQueryNextServer: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeDisconnectList (DDEML.6)
*/
BOOL16 WINAPI DdeDisconnectList( HCONVLIST hConvList )
{
fprintf( stdnimp, "DdeDisconnectList: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeConnect16 (DDEML.7)
@ -94,6 +122,23 @@ BOOL16 WINAPI DdeDisconnect16( HCONV hConv )
return (BOOL16)DdeDisconnect32( hConv );
}
/*****************************************************************
* DdeSetUserHandle (DDEML.10)
*/
BOOL16 WINAPI DdeSetUserHandle( HCONV hConv, DWORD id, DWORD hUser )
{
fprintf( stdnimp, "DdeSetUserHandle: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeCreateDataHandle (DDEML.14)
*/
HDDEDATA WINAPI DdeCreateDataHandle( DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD cbOff, HSZ hszItem, UINT16 wFmt, UINT16 afCmd )
{
fprintf( stdnimp, "DdeCreateDataHandle: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeDisconnect32 (USER32.97)
@ -226,6 +271,71 @@ HDDEDATA WINAPI DdeClientTransaction32( LPBYTE pData, DWORD cbData,
return 0;
}
/*****************************************************************
* DdeAbandonTransaction (DDEML.12)
*/
BOOL16 WINAPI DdeAbandonTransaction( DWORD idInst, HCONV hConv,
DWORD idTransaction )
{
fprintf( stdnimp, "DdeAbandonTransaction: empty stub\n" );
return 0;
}
/*****************************************************************
* DdePostAdvise (DDEML.13)
*/
BOOL16 WINAPI DdePostAdvise( DWORD idInst, HSZ hszTopic, HSZ hszItem )
{
fprintf( stdnimp, "DdePostAdvise: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeAddData (DDEML.15)
*/
HDDEDATA WINAPI DdeAddData( HDDEDATA hData, LPBYTE pSrc, DWORD cb,
DWORD cbOff )
{
fprintf( stdnimp, "DdeAddData: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeGetData (DDEML.16)
*/
DWORD WINAPI DdeGetData( HDDEDATA hData, LPBYTE pDst, DWORD cbMax,
DWORD cbOff )
{
fprintf( stdnimp, "DdeGetData: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeAccessData (DDEML.17)
*/
LPBYTE WINAPI DdeAccessData( HDDEDATA hData, LPDWORD pcbDataSize )
{
fprintf( stdnimp, "DdeAccessData: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeUnaccessData (DDEML.18)
*/
BOOL16 WINAPI DdeUnaccessData( HDDEDATA hData )
{
fprintf( stdnimp, "DdeUnaccessData: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeEnableCallback (DDEML.26)
*/
BOOL16 WINAPI DdeEnableCallback( DWORD idInst, HCONV hConv, UINT16 wCmd )
{
fprintf( stdnimp, "DdeEnableCallback: empty stub\n" );
return 0;
}
/*****************************************************************
* DdeNameService16 (DDEML.27)
@ -266,3 +376,14 @@ UINT32 WINAPI DdeGetLastError32( DWORD idInst )
return 0;
}
/*****************************************************************
* DdeCmpStringHandles (DDEML.36)
*/
int WINAPI DdeCmpStringHandles( HSZ hsz1, HSZ hsz2 )
{
fprintf( stdnimp, "DdeCmpStringHandles: empty stub\n" );
return 0;
}

127
misc/debugstr.c Normal file
View File

@ -0,0 +1,127 @@
#include "debugstr.h"
#include "xmalloc.h"
#include <stdlib.h>
/* ---------------------------------------------------------------------- */
#define SAVE_STRING_COUNT 50
static void *strings[SAVE_STRING_COUNT];
static int nextstring;
/* ---------------------------------------------------------------------- */
static void *
gimme1 (int n)
{
void *res;
if (strings[nextstring]) free (strings[nextstring]);
res = strings[nextstring] = xmalloc (n);
if (++nextstring == SAVE_STRING_COUNT) nextstring = 0;
return res;
}
/* ---------------------------------------------------------------------- */
LPSTR
debugstr_an (LPCSTR src, int n)
{
LPSTR dst, res;
if (!src) return "(null)";
if (n < 0) n = 0;
dst = res = gimme1 (n * 4 + 10);
*dst++ = '"';
while (n-- > 0 && *src)
{
BYTE c = *src++;
switch (c)
{
case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
case '\t': *dst++ = '\\'; *dst++ = 't'; break;
case '"': *dst++ = '\\'; *dst++ = '"'; break;
case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
default:
if (c >= ' ' && c <= 126)
*dst++ = c;
else
{
*dst++ = '\\';
*dst++ = '0' + ((c >> 6) & 7);
*dst++ = '0' + ((c >> 3) & 7);
*dst++ = '0' + ((c >> 0) & 7);
}
}
}
if (*src)
{
*dst++ = '.';
*dst++ = '.';
*dst++ = '.';
}
*dst++ = '"';
*dst = 0;
return res;
}
/* ---------------------------------------------------------------------- */
LPSTR
debugstr_a (LPCSTR s)
{
return debugstr_an (s, 80);
}
/* ---------------------------------------------------------------------- */
LPSTR
debugstr_wn (LPCWSTR src, int n)
{
LPSTR dst, res;
if (!src) return "(null)";
if (n < 0) n = 0;
dst = res = gimme1 (n * 4 + 10);
*dst++ = '"';
while (n-- > 0 && *src)
{
WORD c = *src++;
switch (c)
{
case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
case '\t': *dst++ = '\\'; *dst++ = 't'; break;
case '"': *dst++ = '\\'; *dst++ = '"'; break;
case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
default:
if (c >= ' ' && c <= 126)
*dst++ = c;
else
{
*dst++ = '\\';
*dst++ = '0' + ((c >> 6) & 7);
*dst++ = '0' + ((c >> 3) & 7);
*dst++ = '0' + ((c >> 0) & 7);
}
}
}
if (*src)
{
*dst++ = '.';
*dst++ = '.';
*dst++ = '.';
}
*dst++ = '"';
*dst = 0;
return res;
}
/* ---------------------------------------------------------------------- */
LPSTR
debugstr_w (LPCWSTR s)
{
return debugstr_wn (s, 80);
}
/* ---------------------------------------------------------------------- */

View File

@ -20,138 +20,21 @@
#include <X11/cursorfont.h>
#include "heap.h"
#include "message.h"
#include "module.h"
#include "msdos.h"
#include "windows.h"
#include "color.h"
#include "winsock.h"
#include "options.h"
#include "desktop.h"
#include "process.h"
#include "shell.h"
#include "winbase.h"
#define DEBUG_DEFINE_VARIABLES
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "version.h"
const char people[] = "Wine is available thanks to the work of "
"Bob Amstadt, "
"Dag Asheim, "
"Martin Ayotte, "
"Peter Bajusz, "
"Georg Beyerle, "
"Ross Biro, "
"Uwe Bonnes, "
"Erik Bos, "
"Fons Botman, "
"John Brezak, "
"Andrew Bulhak, "
"John Burton, "
"Niels de Carpentier, "
"Jimen Ching, "
"David A. Cuthbert, "
"Huw D. M. Davies, "
"Roman Dolejsi, "
"Frans van Dorsselaer, "
"Chris Faherty, "
"Paul Falstad, "
"David Faure, "
"Claus Fischer, "
"Olaf Flebbe, "
"Chad Fraleigh, "
"Peter Galbavy, "
"Ramon Garcia, "
"Matthew Ghio, "
"Jody Goldberg, "
"Hans de Graaff, "
"Charles M. Hannum, "
"Adrian Harvey, "
"John Harvey, "
"Cameron Heide, "
"Jochen Hoenicke, "
"Onno Hovers, "
"Jeffrey Hsu, "
"Miguel de Icaza, "
"Jukka Iivonen, "
"Lee Jaekil, "
"Alexandre Julliard, "
"Bang Jun-Young, "
"Pavel Kankovsky, "
"Jochen Karrer, "
"Andreas Kirschbaum, "
"Albrecht Kleine, "
"Jon Konrath, "
"Alex Korobka, "
"Greg Kreider, "
"Anand Kumria, "
"Scott A. Laird, "
"Andrew Lewycky, "
"Martin von Loewis, "
"Michiel van Loon, "
"Kenneth MacDonald, "
"Peter MacDonald, "
"William Magro, "
"Juergen Marquardt, "
"Ricardo Massaro, "
"Marcus Meissner, "
"Graham Menhennitt, "
"David Metcalfe, "
"Bruce Milner, "
"Steffen Moeller, "
"Andreas Mohr, "
"Philippe De Muyter, "
"Itai Nahshon, "
"Henrik Olsen, "
"Michael Patra, "
"Dimitrie O. Paun, "
"Jim Peterson, "
"Robert Pouliot, "
"Keith Reynolds, "
"Slaven Rezic, "
"John Richardson, "
"Rick Richardson, "
"Doug Ridgway, "
"Bernhard Rosenkraenzer, "
"Johannes Ruscheinski, "
"Thomas Sandford, "
"Constantine Sapuntzakis, "
"Pablo Saratxaga, "
"Daniel Schepler, "
"Peter Schlaile, "
"Ulrich Schmid, "
"Bernd Schmidt, "
"Ingo Schneider, "
"Victor Schneider, "
"Yngvi Sigurjonsson, "
"Stephen Simmons, "
"Rick Sladkey, "
"William Smith, "
"Dominik Strasser, "
"Vadim Strizhevsky, "
"Erik Svendsen, "
"Tristan Tarrant, "
"Andrew Taylor, "
"Duncan C Thomson, "
"Goran Thyni, "
"Jimmy Tirtawangsa, "
"Jon Tombs, "
"Linus Torvalds, "
"Gregory Trubetskoy, "
"Petri Tuomola, "
"Michael Veksler, "
"Sven Verdoolaege, "
"Ronan Waide, "
"Eric Warnke, "
"Manfred Weichel, "
"Morten Welinder, "
"Lawson Whitney, "
"Jan Willamowius, "
"Carl Williams, "
"Karl Guenter Wuensch, "
"Eric Youngdale, "
"James Youngman, "
"Mikolaj Zalewski, "
"and John Zero.";
const WINE_LANGUAGE_DEF Languages[] =
{
@ -183,19 +66,13 @@ Screen *screen;
Window rootWindow;
int screenWidth = 0, screenHeight = 0; /* Desktop window dimensions */
int screenDepth = 0; /* Screen depth to use */
int desktopX = 0, desktopY = 0; /* Desktop window position (if any) */
/* Default version is the same as -winver win31 */
static LONG getVersion16 = MAKELONG( WINVERSION, 0x0616 ); /* DOS 6.22 */
static LONG getVersion32 = MAKELONG( WINVERSION, 0x8000 );
static OSVERSIONINFO32A getVersionEx = { sizeof(OSVERSIONINFO32A), 3, 10, 0,
VER_PLATFORM_WIN32s, "Win32s 1.3" };
struct options Options =
{ /* default options */
NULL, /* desktopGeometry */
NULL, /* programName */
NULL, /* argv0 */
NULL, /* dllFlags */
FALSE, /* usePrivateMap */
FALSE, /* useFixedMap */
FALSE, /* synchronous */
@ -262,20 +139,19 @@ static XrmOptionDescRec optionsTable[] =
" -perfect Favor correctness over speed for graphical operations\n" \
" -privatemap Use a private color map\n" \
" -synchronous Turn on synchronous display mode\n" \
" -winver Version to imitate (one of win31,win95,nt351)\n"
" -version Display the Wine version\n" \
" -winver Version to imitate (one of win31,win95,nt351,nt40)\n"
/***********************************************************************
* MAIN_Usage
*/
#ifndef WINELIB32
void MAIN_Usage( char *name )
{
fprintf( stderr, USAGE, name );
exit(1);
}
#endif
/***********************************************************************
@ -375,7 +251,6 @@ BOOL32 ParseDebugOptions(char *options)
#endif
/***********************************************************************
* MAIN_ParseLanguageOption
*
@ -419,48 +294,6 @@ static void MAIN_ParseModeOption( char *arg )
}
}
/**********************************************************************
* MAIN_ParseVersion
*/
static void MAIN_ParseVersion( char *arg )
{
/* If you add any other options,
verify the values you return on the real thing */
if(strcmp(arg,"win31")==0)
{
getVersion16 = 0x06160A03;
/* FIXME: My Win32s installation failed to execute the
MSVC 4 test program. So check these values */
getVersion32 = 0x80000A03;
getVersionEx.dwMajorVersion=3;
getVersionEx.dwMinorVersion=10;
getVersionEx.dwBuildNumber=0;
getVersionEx.dwPlatformId=VER_PLATFORM_WIN32s;
strcpy(getVersionEx.szCSDVersion,"Win32s 1.3");
}
else if(strcmp(arg, "win95")==0)
{
getVersion16 = 0x07005F03;
getVersion32 = 0xC0000004;
getVersionEx.dwMajorVersion=4;
getVersionEx.dwMinorVersion=0;
getVersionEx.dwBuildNumber=0x40003B6;
getVersionEx.dwPlatformId=VER_PLATFORM_WIN32_WINDOWS;
strcpy(getVersionEx.szCSDVersion,"");
}
else if(strcmp(arg, "nt351")==0)
{
getVersion16 = 0x05000A03;
getVersion32 = 0x04213303;
getVersionEx.dwMajorVersion=3;
getVersionEx.dwMinorVersion=51;
getVersionEx.dwBuildNumber=0x421;
getVersionEx.dwPlatformId=VER_PLATFORM_WIN32_NT;
strcpy(getVersionEx.szCSDVersion,"Service Pack 2");
}
else fprintf(stderr, "Unknown winver system code - ignored\n");
}
/***********************************************************************
* MAIN_ParseOptions
*
@ -478,19 +311,15 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
Options.argv0 = argv[0];
/* Get display name from command line */
for (i = 1; i < *argc - 1; i++)
if (!strcmp( argv[i], "-display" ))
{
display_name = argv[i+1];
break;
for (i = 1; i < *argc; i++)
{
if (!strcmp( argv[i], "-display" )) display_name = argv[i+1];
if (!strcmp( argv[i], "-v" ) || !strcmp( argv[i], "-version" ))
{
printf( "%s\n", WINE_RELEASE_INFO );
exit(0);
}
#ifdef WINELIB
/* Need to assemble command line and pass it to WinMain */
#else
if (*argc < 2 || lstrcmpi32A(argv[1], "-h") == 0)
MAIN_Usage( argv[0] );
#endif
}
/* Open display */
@ -574,24 +403,20 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
#endif
}
if(MAIN_GetResource( db, ".dll", &value))
if (MAIN_GetResource( db, ".dll", &value))
{
#ifndef WINELIB
if (!BUILTIN_ParseDLLOptions( (char*)value.addr ))
/* Hack: store option value in Options to be retrieved */
/* later on inside the emulator code. */
if (!__winelib) Options.dllFlags = xstrdup((char *)value.addr);
else
{
fprintf(stderr,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv[0]);
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs:\n");
BUILTIN_PrintDLLs();
fprintf( stderr, "-dll not supported in Winelib\n" );
exit(1);
}
#else
fprintf(stderr,"-dll not supported in libwine\n");
#endif
}
if(MAIN_GetResource( db, ".winver", &value))
MAIN_ParseVersion( (char*)value.addr );
if (MAIN_GetResource( db, ".winver", &value))
VERSION_ParseVersion( (char*)value.addr );
}
@ -600,7 +425,7 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
*/
static void MAIN_CreateDesktop( int argc, char *argv[] )
{
int flags;
int x, y, flags;
unsigned int width = 640, height = 480; /* Default size = 640x480 */
char *name = "Wine desktop";
XSizeHints *size_hints;
@ -610,8 +435,7 @@ static void MAIN_CreateDesktop( int argc, char *argv[] )
XTextProperty window_name;
Atom XA_WM_DELETE_WINDOW;
flags = XParseGeometry( Options.desktopGeometry,
&desktopX, &desktopY, &width, &height );
flags = XParseGeometry( Options.desktopGeometry, &x, &y, &width, &height );
screenWidth = width;
screenHeight = height;
@ -619,12 +443,11 @@ static void MAIN_CreateDesktop( int argc, char *argv[] )
win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
PointerMotionMask | ButtonPressMask |
ButtonReleaseMask | EnterWindowMask |
StructureNotifyMask;
ButtonReleaseMask | EnterWindowMask;
win_attr.cursor = XCreateFontCursor( display, XC_top_left_arrow );
rootWindow = XCreateWindow( display, DefaultRootWindow(display),
desktopX, desktopY, width, height, 0,
x, y, width, height, 0,
CopyFromParent, InputOutput, CopyFromParent,
CWEventMask | CWCursor, &win_attr );
@ -806,99 +629,6 @@ BOOL32 WINAPI Beep( DWORD dwFreq, DWORD dwDur )
}
/***********************************************************************
* GetVersion16 (KERNEL.3)
*/
LONG WINAPI GetVersion16(void)
{
return getVersion16;
}
/***********************************************************************
* GetVersion32 (KERNEL32.427)
*/
LONG WINAPI GetVersion32(void)
{
return getVersion32;
}
/***********************************************************************
* GetVersionExA
*/
BOOL32 WINAPI GetVersionEx32A(OSVERSIONINFO32A *v)
{
if(v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFO32A))
{
fprintf(stddeb,"wrong OSVERSIONINFO size from app");
return FALSE;
}
v->dwMajorVersion = getVersionEx.dwMajorVersion;
v->dwMinorVersion = getVersionEx.dwMinorVersion;
v->dwBuildNumber = getVersionEx.dwBuildNumber;
v->dwPlatformId = getVersionEx.dwPlatformId;
strcpy(v->szCSDVersion, getVersionEx.szCSDVersion);
return TRUE;
}
/***********************************************************************
* GetVersionExW
*/
BOOL32 WINAPI GetVersionEx32W(OSVERSIONINFO32W *v)
{
OSVERSIONINFO32A v1;
if(v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFO32W))
{
fprintf(stddeb,"wrong OSVERSIONINFO size from app");
return FALSE;
}
v1.dwOSVersionInfoSize=sizeof(v1);
GetVersionEx32A(&v1);
v->dwMajorVersion = v1.dwMajorVersion;
v->dwMinorVersion = v1.dwMinorVersion;
v->dwBuildNumber = v1.dwBuildNumber;
v->dwPlatformId = v1.dwPlatformId;
lstrcpyAtoW( v->szCSDVersion, v1.szCSDVersion );
return TRUE;
}
/***********************************************************************
* GetWinFlags (KERNEL.132)
*/
DWORD WINAPI GetWinFlags(void)
{
static const long cpuflags[5] =
{ WF_CPU086, WF_CPU186, WF_CPU286, WF_CPU386, WF_CPU486 };
SYSTEM_INFO si;
long result = 0,cpuflag;
GetSystemInfo(&si);
/* There doesn't seem to be any Pentium flag. */
cpuflag = cpuflags[MIN (si.wProcessorLevel, 4)];
switch(Options.mode) {
case MODE_STANDARD:
result = (WF_STANDARD | cpuflag | WF_PMODE | WF_80x87);
break;
case MODE_ENHANCED:
result = (WF_ENHANCED | cpuflag | WF_PMODE | WF_80x87 | WF_PAGING);
break;
default:
fprintf(stderr, "Unknown mode set? This shouldn't happen. Check GetWinFlags()!\n");
break;
}
if (si.wProcessorLevel>=4)
result |= WF_HASCPUID;
if( getVersionEx.dwPlatformId == VER_PLATFORM_WIN32_NT )
result |= WF_WIN32WOW; /* undocumented WF_WINNT */
return result;
}
/***********************************************************************
* GetTimerResolution (USER.14)
*/
@ -1302,27 +1032,3 @@ void WINAPI FileCDR(FARPROC16 x)
{
printf("FileCDR(%8x)\n", (int) x);
}
/***********************************************************************
* GetWinDebugInfo (KERNEL.355)
*/
BOOL16 WINAPI GetWinDebugInfo(WINDEBUGINFO *lpwdi, UINT16 flags)
{
printf("GetWinDebugInfo(%8lx,%d) stub returning 0\n", (unsigned long)lpwdi, flags);
/* 0 means not in debugging mode/version */
/* Can this type of debugging be used in wine ? */
/* Constants: WDI_OPTIONS WDI_FILTER WDI_ALLOCBREAK */
return 0;
}
/***********************************************************************
* GetWinDebugInfo (KERNEL.355)
*/
BOOL16 WINAPI SetWinDebugInfo(WINDEBUGINFO *lpwdi)
{
printf("SetWinDebugInfo(%8lx) stub returning 0\n", (unsigned long)lpwdi);
/* 0 means not in debugging mode/version */
/* Can this type of debugging be used in wine ? */
/* Constants: WDI_OPTIONS WDI_FILTER WDI_ALLOCBREAK */
return 0;
}

View File

@ -2112,7 +2112,7 @@ INT32 WINAPI LCMapString32W(
INT32 WINAPI GetDateFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime,
LPCSTR format, LPSTR date,INT32 datelen
) {
fprintf(stderr,"GetDateFormat(0x%04x,0x%08lx,%p,%s,%p,%d), stub\n",
fprintf(stderr,"GetDateFormat(0x%04lx,0x%08lx,%p,%s,%p,%d), stub\n",
locale,flags,xtime,format,date,datelen
);
lstrcpyn32A(date,"1.4.1997",datelen);
@ -2122,7 +2122,7 @@ INT32 WINAPI GetDateFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime,
INT32 WINAPI GetTimeFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime,
LPCSTR format, LPSTR timestr,INT32 timelen
) {
fprintf(stderr,"GetDateFormat(0x%04x,0x%08lx,%p,%s,%p,%d), stub\n",
fprintf(stderr,"GetDateFormat(0x%04lx,0x%08lx,%p,%s,%p,%d), stub\n",
locale,flags,xtime,format,timestr,timelen
);
lstrcpyn32A(timestr,"00:00:42",timelen);

View File

@ -1054,17 +1054,27 @@ _w95dkecomp(struct _w95nr2da *a,struct _w95nr2da *b){return a->dkeaddr-b->dkeadd
static struct _w95key*
_w95dkelookup(unsigned long dkeaddr,int n,struct _w95nr2da *nr2da,struct _w95key *keys) {
int i,off;
int i;
int left, right;
if (dkeaddr == 0xFFFFFFFF)
return NULL;
if (dkeaddr<0x20)
return NULL;
dkeaddr=_w95_adj_da(dkeaddr+0x1c);
off = (dkeaddr-0x3c)/0x1c;
for (i=0;i<n;i++)
if (nr2da[(i+off)%n].dkeaddr == dkeaddr)
return keys+nr2da[(i+off)%n].nr;
left=0;
right=n-1;
while(left<=right)
{
i=(left+right)/2;
if(nr2da[i].dkeaddr == dkeaddr)
return keys+nr2da[i].nr;
else if(nr2da[i].dkeaddr < dkeaddr)
left=i+1;
else
right=i-1;
}
/* 0x3C happens often, just report unusual values */
if (dkeaddr!=0x3c)
dprintf_reg(stddeb,"search hasn't found dkeaddr %lx?\n",dkeaddr);
@ -2759,23 +2769,30 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) {
hkey,W2C(lpszSubKey,0)
);
lpNextKey = lookup_hkey(hkey);
if (!lpNextKey)
if (!lpNextKey) {
dprintf_reg (stddeb, " Badkey[1].\n");
return SHELL_ERROR_BADKEY;
}
/* we need to know the previous key in the hier. */
if (!lpszSubKey || !*lpszSubKey)
if (!lpszSubKey || !*lpszSubKey) {
dprintf_reg (stddeb, " Badkey[2].\n");
return SHELL_ERROR_BADKEY;
}
split_keypath(lpszSubKey,&wps,&wpc);
i = 0;
lpxkey = lpNextKey;
while (i<wpc-1) {
lpxkey=lpNextKey->nextsub;
while (lpxkey) {
dprintf_reg (stddeb, " Scanning [%s]\n",
W2C (lpxkey->keyname, 0));
if (!lstrcmpi32W(wps[i],lpxkey->keyname))
break;
lpxkey=lpxkey->next;
}
if (!lpxkey) {
FREE_KEY_PATH;
dprintf_reg (stddeb, " Not found.\n");
/* not found is success */
return SHELL_ERROR_SUCCESS;
}
@ -2785,15 +2802,24 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) {
lpxkey = lpNextKey->nextsub;
lplpPrevKey = &(lpNextKey->nextsub);
while (lpxkey) {
dprintf_reg (stddeb, " Scanning [%s]\n",
W2C (lpxkey->keyname, 0));
if (!lstrcmpi32W(wps[i],lpxkey->keyname))
break;
lplpPrevKey = &(lpxkey->next);
lpxkey = lpxkey->next;
}
if (!lpxkey)
if (!lpxkey) {
FREE_KEY_PATH;
dprintf_reg (stddeb, " Not found.\n");
return SHELL_ERROR_BADKEY;
return SHELL_ERROR_SUCCESS;
if (lpxkey->nextsub)
}
if (lpxkey->nextsub) {
FREE_KEY_PATH;
dprintf_reg (stddeb, " Not empty.\n");
return SHELL_ERROR_CANTWRITE;
}
*lplpPrevKey = lpxkey->next;
free(lpxkey->keyname);
if (lpxkey->class)
@ -2802,6 +2828,7 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) {
free(lpxkey->values);
free(lpxkey);
FREE_KEY_PATH;
dprintf_reg (stddeb, " Done.\n");
return SHELL_ERROR_SUCCESS;
}

View File

@ -15,11 +15,135 @@
#include "resource.h"
#include "dlgs.h"
#include "win.h"
#include "graphics.h"
#include "cursoricon.h"
#include "stddebug.h"
#include "debug.h"
#include "winreg.h"
static const char * const SHELL_People[] =
{
"Bob Amstadt",
"Dag Asheim",
"Martin Ayotte",
"Peter Bajusz",
"Georg Beyerle",
"Ross Biro",
"Uwe Bonnes",
"Erik Bos",
"Fons Botman",
"John Brezak",
"Andrew Bulhak",
"John Burton",
"Niels de Carpentier",
"Jimen Ching",
"David A. Cuthbert",
"Huw D. M. Davies",
"Roman Dolejsi",
"Frans van Dorsselaer",
"Chris Faherty",
"Paul Falstad",
"David Faure",
"Claus Fischer",
"Olaf Flebbe",
"Chad Fraleigh",
"Peter Galbavy",
"Ramon Garcia",
"Matthew Ghio",
"Jody Goldberg",
"Hans de Graaff",
"Charles M. Hannum",
"Adrian Harvey",
"John Harvey",
"Cameron Heide",
"Jochen Hoenicke",
"Onno Hovers",
"Jeffrey Hsu",
"Miguel de Icaza",
"Jukka Iivonen",
"Lee Jaekil",
"Alexandre Julliard",
"Bang Jun-Young",
"Pavel Kankovsky",
"Jochen Karrer",
"Andreas Kirschbaum",
"Albrecht Kleine",
"Jon Konrath",
"Alex Korobka",
"Greg Kreider",
"Anand Kumria",
"Scott A. Laird",
"Andrew Lewycky",
"Martin von Loewis",
"Michiel van Loon",
"Kenneth MacDonald",
"Peter MacDonald",
"William Magro",
"Juergen Marquardt",
"Ricardo Massaro",
"Marcus Meissner",
"Graham Menhennitt",
"David Metcalfe",
"Bruce Milner",
"Steffen Moeller",
"Andreas Mohr",
"Philippe De Muyter",
"Itai Nahshon",
"Henrik Olsen",
"Michael Patra",
"Dimitrie O. Paun",
"Jim Peterson",
"Robert Pouliot",
"Keith Reynolds",
"Slaven Rezic",
"John Richardson",
"Rick Richardson",
"Doug Ridgway",
"Bernhard Rosenkraenzer",
"Johannes Ruscheinski",
"Thomas Sandford",
"Constantine Sapuntzakis",
"Pablo Saratxaga",
"Daniel Schepler",
"Peter Schlaile",
"Ulrich Schmid",
"Bernd Schmidt",
"Ingo Schneider",
"Victor Schneider",
"Yngvi Sigurjonsson",
"Stephen Simmons",
"Rick Sladkey",
"William Smith",
"Dominik Strasser",
"Vadim Strizhevsky",
"Erik Svendsen",
"Tristan Tarrant",
"Andrew Taylor",
"Duncan C Thomson",
"Goran Thyni",
"Jimmy Tirtawangsa",
"Jon Tombs",
"Linus Torvalds",
"Gregory Trubetskoy",
"Petri Tuomola",
"Michael Veksler",
"Sven Verdoolaege",
"Ronan Waide",
"Eric Warnke",
"Manfred Weichel",
"Morten Welinder",
"Lawson Whitney",
"Jan Willamowius",
"Carl Williams",
"Karl Guenter Wuensch",
"Eric Youngdale",
"James Youngman",
"Mikolaj Zalewski",
"John Zero",
NULL
};
/* .ICO file ICONDIR definitions */
#pragma pack(1)
@ -395,6 +519,27 @@ typedef struct
HICON32 hIcon;
} ABOUT_INFO;
#define IDC_STATIC_TEXT 100
#define IDC_LISTBOX 99
#define IDC_WINE_TEXT 98
#define DROP_FIELD_TOP (-15)
#define DROP_FIELD_HEIGHT 15
extern HICON32 hIconTitleFont;
static BOOL32 __get_dropline( HWND32 hWnd, LPRECT32 lprect )
{
HWND32 hWndCtl = GetDlgItem32(hWnd, IDC_WINE_TEXT);
if( hWndCtl )
{
GetWindowRect32( hWndCtl, lprect );
MapWindowPoints32( 0, hWnd, (LPPOINT32)lprect, 2 );
lprect->bottom = (lprect->top += DROP_FIELD_TOP);
return TRUE;
}
return FALSE;
}
/*************************************************************************
* AboutDlgProc32 (not an exported API function)
@ -402,6 +547,7 @@ typedef struct
LRESULT WINAPI AboutDlgProc32( HWND32 hWnd, UINT32 msg, WPARAM32 wParam,
LPARAM lParam )
{
HWND32 hWndCtl;
char Template[512], AppTitle[512];
switch(msg)
@ -411,15 +557,123 @@ LRESULT WINAPI AboutDlgProc32( HWND32 hWnd, UINT32 msg, WPARAM32 wParam,
ABOUT_INFO *info = (ABOUT_INFO *)lParam;
if (info)
{
const char* const *pstr = SHELL_People;
SendDlgItemMessage32A(hWnd, stc1, STM_SETICON32,info->hIcon, 0);
GetWindowText32A( hWnd, Template, sizeof(Template) );
sprintf( AppTitle, Template, info->szApp );
SetWindowText32A( hWnd, AppTitle );
SetWindowText32A( GetDlgItem32(hWnd,100), info->szOtherStuff );
SetWindowText32A( GetDlgItem32(hWnd, IDC_STATIC_TEXT),
info->szOtherStuff );
hWndCtl = GetDlgItem32(hWnd, IDC_LISTBOX);
SendMessage32A( hWndCtl, WM_SETREDRAW, 0, 0 );
SendMessage32A( hWndCtl, WM_SETFONT, hIconTitleFont, 0 );
while (*pstr)
{
SendMessage32A( hWndCtl, LB_ADDSTRING32,
(WPARAM32)-1, (LPARAM)*pstr );
pstr++;
}
SendMessage32A( hWndCtl, WM_SETREDRAW, 1, 0 );
}
}
return 1;
case WM_PAINT:
{
RECT32 rect;
PAINTSTRUCT32 ps;
HDC32 hDC = BeginPaint32( hWnd, &ps );
if( __get_dropline( hWnd, &rect ) )
GRAPH_DrawLines( hDC, (LPPOINT32)&rect, 1, GetStockObject32( BLACK_PEN ) );
EndPaint32( hWnd, &ps );
}
break;
case WM_LBTRACKPOINT:
hWndCtl = GetDlgItem32(hWnd, IDC_LISTBOX);
if( (INT16)GetKeyState16( VK_CONTROL ) < 0 )
{
if( DragDetect32( hWndCtl, *((LPPOINT32)&lParam) ) )
{
INT32 idx = SendMessage32A( hWndCtl, LB_GETCURSEL32, 0, 0 );
if( idx != -1 )
{
INT32 length = SendMessage32A( hWndCtl, LB_GETTEXTLEN32, (WPARAM32)idx, 0 );
HGLOBAL16 hMemObj = GlobalAlloc16( GMEM_MOVEABLE, length + 1 );
char* pstr = (char*)GlobalLock16( hMemObj );
if( pstr )
{
HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE(OCR_DRAGOBJECT) );
SendMessage32A( hWndCtl, LB_GETTEXT32, (WPARAM32)idx, (LPARAM)pstr );
SendMessage32A( hWndCtl, LB_DELETESTRING32, (WPARAM32)idx, 0 );
UpdateWindow32( hWndCtl );
if( !DragObject16((HWND16)hWnd, (HWND16)hWnd, DRAGOBJ_DATA, 0, (WORD)hMemObj, hCursor) )
SendMessage32A( hWndCtl, LB_ADDSTRING32, (WPARAM32)-1, (LPARAM)pstr );
}
if( hMemObj ) GlobalFree16( hMemObj );
}
}
}
break;
case WM_QUERYDROPOBJECT:
if( wParam == 0 )
{
LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA )
{
RECT32 rect;
if( __get_dropline( hWnd, &rect ) )
{
POINT32 pt = { lpDragInfo->pt.x, lpDragInfo->pt.y };
rect.bottom += DROP_FIELD_HEIGHT;
if( PtInRect32( &rect, pt ) )
{
SetWindowLong32A( hWnd, DWL_MSGRESULT, 1 );
return TRUE;
}
}
}
}
break;
case WM_DROPOBJECT:
if( wParam == hWnd )
{
LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA && lpDragInfo->hList )
{
char* pstr = (char*)GlobalLock16( (HGLOBAL16)(lpDragInfo->hList) );
if( pstr )
{
static char __appendix_str[] = " with";
hWndCtl = GetDlgItem32( hWnd, IDC_WINE_TEXT );
SendMessage32A( hWndCtl, WM_GETTEXT, 512, (LPARAM)Template );
if( !lstrncmp32A( Template, "WINE", 4 ) )
SetWindowText32A( GetDlgItem32(hWnd, IDC_STATIC_TEXT), Template );
else
{
char* pch = Template + strlen(Template) - strlen(__appendix_str);
*pch = '\0';
SendMessage32A( GetDlgItem32(hWnd, IDC_LISTBOX), LB_ADDSTRING32,
(WPARAM32)-1, (LPARAM)Template );
}
lstrcpy32A( Template, pstr );
lstrcat32A( Template, __appendix_str );
SetWindowText32A( hWndCtl, Template );
SetWindowLong32A( hWnd, DWL_MSGRESULT, 1 );
return TRUE;
}
}
}
break;
case WM_COMMAND:
if (wParam == IDOK)
{
@ -1067,3 +1321,28 @@ void WINAPI FreeIconList( DWORD dw )
{
fprintf( stdnimp, "FreeIconList: empty stub\n" );
}
/*************************************************************************
* SHELL32_DllGetClassObject [SHELL32.14]
*
* http://premium.microsoft.com/msdn/library/sdkdoc/api2_48fo.htm
*/
/* This is the wrong place, but where is the right one? */
typedef UINT32 REFCLSID32;
typedef UINT32 REFIID32;
typedef UINT32 HRESULT32;
#define E_OUTOFMEMORY 0x8007000EL
HRESULT32 WINAPI SHELL32_DllGetClassObject (REFCLSID32 clsid,
REFIID32 riid,
LPVOID *ppv)
{
HRESULT32 hres = E_OUTOFMEMORY;
*ppv = NULL;
fprintf (stdnimp, "SHELL32_DllGetClassObject (0x%x,0x%x,%p) -- STUB\n",
clsid, riid, ppv);
return hres;
}

View File

@ -166,8 +166,7 @@ static int testFileExclusiveExistence(
}
int
read_xx_header(HFILE32 lzfd) {
static int read_xx_header(HFILE32 lzfd) {
IMAGE_DOS_HEADER mzh;
char magic[2];
@ -189,8 +188,7 @@ read_xx_header(HFILE32 lzfd) {
}
int
find_ne_resource(
static int find_ne_resource(
HFILE32 lzfd,SEGPTR typeid,SEGPTR resid,
BYTE **resdata,int *reslen,DWORD *off
) {
@ -319,7 +317,7 @@ extern LPIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(
/* Loads the specified PE resource.
* FIXME: shouldn't load the whole image
*/
int
static int
find_pe_resource(
HFILE32 lzfd,LPWSTR typeid,LPWSTR resid,
BYTE **resdata,int *reslen,DWORD *off
@ -471,7 +469,7 @@ DWORD WINAPI GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
res= find_ne_resource(lzfd,restype,resid,&resdata,&reslen,&off);
break;
case IMAGE_NT_SIGNATURE:
res= find_pe_resource(lzfd,restype,resid,&resdata,&reslen,&off);
res= find_pe_resource(lzfd,(LPWSTR)restype,(LPWSTR)resid,&resdata,&reslen,&off);
break;
}
LZClose32(lzfd);
@ -938,10 +936,14 @@ _error2vif(DWORD error) {
}
}
/* VerInstallFile32A
*/
DWORD WINAPI VerInstallFile32A(
UINT32 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPCSTR curdir,LPSTR tmpfile,UINT32 *tmpfilelen )
{
LPCSTR pdest;
char destfn[260],tmpfn[260],srcfn[260];
HFILE32 hfsrc,hfdst;
DWORD attr,ret,xret,tmplast;
@ -953,12 +955,14 @@ DWORD WINAPI VerInstallFile32A(
);
xret = 0;
sprintf(srcfn,"%s\\%s",srcdir,srcfilename);
sprintf(destfn,"%s\\%s",destdir,destfilename);
if (!destdir || !*destdir) pdest = srcdir;
else pdest = destdir;
sprintf(destfn,"%s\\%s",pdest,destfilename);
hfsrc=LZOpenFile32A(srcfn,&ofs,OF_READ);
if (hfsrc==HFILE_ERROR32)
return VIF_CANNOTREADSRC;
sprintf(tmpfn,"%s\\%s",destdir,destfilename);
tmplast=strlen(destdir)+1;
sprintf(tmpfn,"%s\\%s",pdest,destfilename);
tmplast=strlen(pdest)+1;
attr = GetFileAttributes32A(tmpfn);
if (attr!=-1) {
if (attr & FILE_ATTRIBUTE_READONLY) {
@ -970,8 +974,8 @@ DWORD WINAPI VerInstallFile32A(
attr = -1;
if (flags & VIFF_FORCEINSTALL) {
if (tmpfile[0]) {
sprintf(tmpfn,"%s\\%s",destdir,tmpfile);
tmplast = strlen(destdir)+1;
sprintf(tmpfn,"%s\\%s",pdest,tmpfile);
tmplast = strlen(pdest)+1;
attr = GetFileAttributes32A(tmpfn);
/* if it exists, it has been copied by the call before.
* we jump over the copy part...
@ -981,7 +985,7 @@ DWORD WINAPI VerInstallFile32A(
if (attr == -1) {
char *s;
GetTempFileName32A(destdir,"ver",0,tmpfn); /* should not fail ... */
GetTempFileName32A(pdest,"ver",0,tmpfn); /* should not fail ... */
s=strrchr(tmpfn,'\\');
if (s)
tmplast = s-tmpfn;
@ -1078,7 +1082,7 @@ DWORD WINAPI VerInstallFile32A(
if ((!(flags & VIFF_DONTDELETEOLD)) &&
curdir &&
*curdir &&
lstrcmpi32A(curdir,destdir)
lstrcmpi32A(curdir,pdest)
) {
char curfn[260];

262
misc/version.c Normal file
View File

@ -0,0 +1,262 @@
/*
* Windows version functions
*
* Copyright 1997 Alexandre Julliard
* Copyright 1997 Marcus Meissner
*/
#include <stdio.h>
#include "windows.h"
#include "winbase.h"
#include "process.h"
#include "options.h"
typedef enum
{
WIN31, /* Windows 3.1 */
WIN95, /* Windows 95 */
NT351, /* Windows NT 3.51 */
NT40, /* Windows NT 4.0 */
NB_VERSIONS
} VERSION;
typedef struct
{
LONG getVersion16;
LONG getVersion32;
OSVERSIONINFO32A getVersionEx;
} VERSION_DATA;
/* FIXME: compare values below with original and fix */
static const VERSION_DATA VersionData[NB_VERSIONS] =
{
/* WIN31 */
{
MAKELONG( 0x0a03, 0x0616 ), /* DOS 6.22 */
MAKELONG( 0x0a03, 0x8000 ),
{
sizeof(OSVERSIONINFO32A), 3, 10, 0,
VER_PLATFORM_WIN32s, "Win32s 1.3"
}
},
/* WIN95 */
{
0x07005F03,
0xC0000004,
{
sizeof(OSVERSIONINFO32A), 4, 0, 0x40003B6,
VER_PLATFORM_WIN32_WINDOWS, "Win95"
}
},
/* NT351 */
{
0x05000A03,
0x04213303,
{
sizeof(OSVERSIONINFO32A), 3, 51, 0x421,
VER_PLATFORM_WIN32_NT, "Service Pack 2"
}
},
/* NT40 */
{
0x05000A03,
0x05650004,
{
sizeof(OSVERSIONINFO32A), 4, 0, 0x565,
VER_PLATFORM_WIN32_NT, "Service Pack 3"
}
}
};
static const char *VersionNames[NB_VERSIONS] =
{
"win31",
"win95",
"nt351",
"nt40"
};
/* the current version has not been autodetected but forced via cmdline */
static BOOL32 versionForced = FALSE;
static VERSION defaultVersion = WIN31;
/**********************************************************************
* VERSION_ParseVersion
*/
void VERSION_ParseVersion( char *arg )
{
int i;
for (i = 0; i < NB_VERSIONS; i++)
{
if (!strcmp( VersionNames[i], arg ))
{
defaultVersion = (VERSION)i;
versionForced = TRUE;
return;
}
}
fprintf( stderr, "Invalid winver value '%s' specified.\n", arg );
fprintf( stderr, "Valid versions are:" );
for (i = 0; i < NB_VERSIONS; i++)
fprintf( stderr, " '%s'%c", VersionNames[i],
(i == NB_VERSIONS - 1) ? '\n' : ',' );
}
/**********************************************************************
* VERSION_get_version
*/
static VERSION VERSION_GetVersion(void)
{
LPIMAGE_NT_HEADERS peheader;
if (versionForced) /* user has overridden any sensible checks */
return defaultVersion;
if (!pCurrentProcess) /* at startuptime probably */
return defaultVersion;
if (!pCurrentProcess->exe_modref)
return WIN31; /* FIXME: hmm, look at DDB.version ? */
peheader = pCurrentProcess->exe_modref->pe_module->pe_header;
if (peheader->OptionalHeader.MajorSubsystemVersion == 4)
/* FIXME: NT4 has the same majorversion; add a check here for it. */
return WIN95;
if (peheader->OptionalHeader.MajorSubsystemVersion == 3)
{
/* Win3.10 */
if (peheader->OptionalHeader.MinorSubsystemVersion <= 11) return WIN31;
/* NT 3.51 */
if (peheader->OptionalHeader.MinorSubsystemVersion == 51) return NT351;
}
fprintf(stderr,"VERSION_GetVersion: unknown subsystem version: %04x.%04x, please report.\n",
peheader->OptionalHeader.MajorSubsystemVersion,
peheader->OptionalHeader.MinorSubsystemVersion );
return defaultVersion;
}
/***********************************************************************
* GetVersion16 (KERNEL.3)
*/
LONG WINAPI GetVersion16(void)
{
VERSION ver = VERSION_GetVersion();
return VersionData[ver].getVersion16;
}
/***********************************************************************
* GetVersion32 (KERNEL32.427)
*/
LONG WINAPI GetVersion32(void)
{
VERSION ver = VERSION_GetVersion();
return VersionData[ver].getVersion32;
}
/***********************************************************************
* GetVersionEx32A (KERNEL32.428)
*/
BOOL32 WINAPI GetVersionEx32A(OSVERSIONINFO32A *v)
{
VERSION ver = VERSION_GetVersion();
if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFO32A))
{
fprintf(stderr,"wrong OSVERSIONINFO size from app");
return FALSE;
}
v->dwMajorVersion = VersionData[ver].getVersionEx.dwMajorVersion;
v->dwMinorVersion = VersionData[ver].getVersionEx.dwMinorVersion;
v->dwBuildNumber = VersionData[ver].getVersionEx.dwBuildNumber;
v->dwPlatformId = VersionData[ver].getVersionEx.dwPlatformId;
strcpy( v->szCSDVersion, VersionData[ver].getVersionEx.szCSDVersion );
return TRUE;
}
/***********************************************************************
* GetVersionEx32W (KERNEL32.429)
*/
BOOL32 WINAPI GetVersionEx32W(OSVERSIONINFO32W *v)
{
VERSION ver = VERSION_GetVersion();
if (v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFO32W))
{
fprintf(stderr,"wrong OSVERSIONINFO size from app");
return FALSE;
}
v->dwMajorVersion = VersionData[ver].getVersionEx.dwMajorVersion;
v->dwMinorVersion = VersionData[ver].getVersionEx.dwMinorVersion;
v->dwBuildNumber = VersionData[ver].getVersionEx.dwBuildNumber;
v->dwPlatformId = VersionData[ver].getVersionEx.dwPlatformId;
lstrcpyAtoW( v->szCSDVersion, VersionData[ver].getVersionEx.szCSDVersion );
return TRUE;
}
/***********************************************************************
* GetWinFlags (KERNEL.132)
*/
DWORD WINAPI GetWinFlags(void)
{
static const long cpuflags[5] =
{ WF_CPU086, WF_CPU186, WF_CPU286, WF_CPU386, WF_CPU486 };
SYSTEM_INFO si;
OSVERSIONINFO32A ovi;
DWORD result;
GetSystemInfo(&si);
/* There doesn't seem to be any Pentium flag. */
result = cpuflags[MIN (si.wProcessorLevel, 4)];
switch(Options.mode)
{
case MODE_STANDARD:
result |= WF_STANDARD | WF_PMODE | WF_80x87;
break;
case MODE_ENHANCED:
result |= WF_ENHANCED | WF_PMODE | WF_80x87 | WF_PAGING;
break;
default:
fprintf(stderr, "Unknown mode set? This shouldn't happen. Check GetWinFlags()!\n");
break;
}
if (si.wProcessorLevel >= 4) result |= WF_HASCPUID;
ovi.dwOSVersionInfoSize = sizeof(ovi);
GetVersionEx32A(&ovi);
if (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT)
result |= WF_WIN32WOW; /* undocumented WF_WINNT */
return result;
}
/***********************************************************************
* GetWinDebugInfo (KERNEL.355)
*/
BOOL16 WINAPI GetWinDebugInfo(WINDEBUGINFO *lpwdi, UINT16 flags)
{
printf("GetWinDebugInfo(%8lx,%d) stub returning 0\n",
(unsigned long)lpwdi, flags);
/* 0 means not in debugging mode/version */
/* Can this type of debugging be used in wine ? */
/* Constants: WDI_OPTIONS WDI_FILTER WDI_ALLOCBREAK */
return 0;
}
/***********************************************************************
* SetWinDebugInfo (KERNEL.356)
*/
BOOL16 WINAPI SetWinDebugInfo(WINDEBUGINFO *lpwdi)
{
printf("SetWinDebugInfo(%8lx) stub returning 0\n", (unsigned long)lpwdi);
/* 0 means not in debugging mode/version */
/* Can this type of debugging be used in wine ? */
/* Constants: WDI_OPTIONS WDI_FILTER WDI_ALLOCBREAK */
return 0;
}

View File

@ -7,7 +7,8 @@ MODULE = miscemu
C_SRCS = \
emulate.c \
instr.c
instr.c \
main.c
all: $(MODULE).o

120
miscemu/main.c Normal file
View File

@ -0,0 +1,120 @@
/*
* Emulator initialisation code
*
*/
#include <stdio.h>
#include "windows.h"
#include "callback.h"
#include "debugger.h"
#include "miscemu.h"
#include "module.h"
#include "options.h"
/***********************************************************************
* Emulator initialisation
*/
BOOL32 MAIN_EmulatorInit(void)
{
extern BOOL32 MAIN_KernelInit(void);
extern BOOL32 MAIN_UserInit(void);
extern BOOL32 WIN16DRV_Init(void);
extern BOOL32 RELAY_Init(void);
/* Initialize the kernel */
if (!MAIN_KernelInit()) return FALSE;
/* Initialize relay code */
if (!RELAY_Init()) return FALSE;
/* Initialize signal handling */
if (!SIGNAL_InitEmulator()) return FALSE;
/* Create the Win16 printer driver */
if (!WIN16DRV_Init()) return FALSE;
/* Initialize all the USER stuff */
return MAIN_UserInit();
}
/**********************************************************************
* main
*/
int main( int argc, char *argv[] )
{
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
extern void *CALL32_Init(void);
extern char * DEBUG_argv0;
int i,loaded;
HINSTANCE32 handle;
__winelib = 0; /* First of all, clear the Winelib flag */
/*
* Save this so that the internal debugger can get a hold of it if
* it needs to.
*/
DEBUG_argv0 = argv[0];
if (!MAIN_WineInit( &argc, argv )) return 1;
/* Handle -dll option (hack) */
if (Options.dllFlags)
{
if (!BUILTIN_ParseDLLOptions( Options.dllFlags ))
{
fprintf( stderr, "%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",
argv[0] );
BUILTIN_PrintDLLs();
exit(1);
}
}
/* Initialize everything */
if (!MAIN_EmulatorInit()) return 1;
/* Initialize CALL32 routines */
/* This needs to be done just before task-switching starts */
IF1632_CallLargeStack = (int (*)(int (*func)(), void *arg))CALL32_Init();
loaded=0;
for (i = 1; i < argc; i++)
{
if ((handle = WinExec32( argv[i], SW_SHOWNORMAL )) < 32)
{
fprintf(stderr, "wine: can't exec '%s': ", argv[i]);
switch (handle)
{
case 2: fprintf( stderr, "file not found\n" ); break;
case 11: fprintf( stderr, "invalid exe file\n" ); break;
case 21: fprintf( stderr, "win32 executable\n" ); break;
default: fprintf( stderr, "error=%d\n", handle ); break;
}
return 1;
}
loaded++;
}
if (!loaded) { /* nothing loaded */
extern void MAIN_Usage(char*);
MAIN_Usage(argv[0]);
return 1;
}
if (!GetNumTasks())
{
fprintf( stderr, "wine: no executable file found.\n" );
return 0;
}
if (Options.debug) DEBUG_AddModuleBreakpoints();
Yield(); /* Start the first task */
fprintf( stderr, "WinMain: Should never happen: returned from Yield()\n" );
return 0;
}

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -34,7 +34,7 @@ typedef struct
DWORD edx;
DWORD ecx;
DWORD eax;
WORD flags;
WORD fl;
WORD es;
WORD ds;
WORD fs;
@ -45,7 +45,186 @@ typedef struct
WORD ss;
} REALMODECALL;
extern void do_mscdex( CONTEXT *context );
/**********************************************************************
* INT_GetRealModeContext
*/
static void INT_GetRealModeContext( REALMODECALL *call, CONTEXT *context )
{
EAX_reg(context) = call->eax;
EBX_reg(context) = call->ebx;
ECX_reg(context) = call->ecx;
EDX_reg(context) = call->edx;
ESI_reg(context) = call->esi;
EDI_reg(context) = call->edi;
EBP_reg(context) = call->ebp;
EFL_reg(context) = call->fl;
EIP_reg(context) = call->ip;
ESP_reg(context) = call->sp;
CS_reg(context) = call->cs;
DS_reg(context) = call->ds;
ES_reg(context) = call->es;
FS_reg(context) = call->fs;
GS_reg(context) = call->gs;
}
/**********************************************************************
* INT_SetRealModeContext
*/
static void INT_SetRealModeContext( REALMODECALL *call, CONTEXT *context )
{
call->eax = EAX_reg(context);
call->ebx = EBX_reg(context);
call->ecx = ECX_reg(context);
call->edx = EDX_reg(context);
call->esi = ESI_reg(context);
call->edi = EDI_reg(context);
call->ebp = EBP_reg(context);
call->fl = FL_reg(context);
call->ip = IP_reg(context);
call->sp = SP_reg(context);
call->cs = CS_reg(context);
call->ds = DS_reg(context);
call->es = ES_reg(context);
call->fs = FS_reg(context);
call->gs = GS_reg(context);
}
/**********************************************************************
* INT_DoRealModeInt
*/
static void INT_DoRealModeInt( CONTEXT *context )
{
CONTEXT realmode_ctx;
REALMODECALL *call = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context),
DI_reg(context) );
INT_GetRealModeContext( call, &realmode_ctx );
RESET_CFLAG(context);
switch (BL_reg(context))
{
case 0x2f: /* int2f */
switch (AH_reg(&realmode_ctx))
{
case 0x15:
/* MSCDEX hook */
do_mscdex( &realmode_ctx );
break;
default:
SET_CFLAG(context);
break;
}
break;
case 0x21: /* int21 */
switch (AH_reg(&realmode_ctx))
{
case 0x52:
ES_reg(&realmode_ctx) = 0;
EBX_reg(&realmode_ctx) = 0;
break;
case 0x65:
switch (AL_reg(&realmode_ctx))
{
case 0x06:
{/* get collate table */
/* ES:DI is a REALMODE pointer to 5 byte dosmem
* we fill that with 0x6, realmode pointer to collateTB
*/
char *table = DOSMEM_MapRealToLinear(
MAKELONG(EDI_reg(&realmode_ctx),ES_reg(&realmode_ctx)));
*(BYTE*)table = 0x06;
*(DWORD*)(table+1) = DOSMEM_CollateTable;
CX_reg(&realmode_ctx) = 258;/*FIXME: size of table?*/
break;
}
default:
SET_CFLAG(context);
break;
}
break;
case 0x44:
switch (AL_reg(&realmode_ctx))
{
case 0x0D:
{/* generic block device request */
BYTE *dataptr = DOSMEM_MapRealToLinear(
MAKELONG(EDX_reg(&realmode_ctx),DS_reg(&realmode_ctx)));
int drive = DOS_GET_DRIVE(BL_reg(&realmode_ctx));
if (CH_reg(&realmode_ctx) != 0x08)
{
SET_CFLAG(context);
break;
}
switch (CL_reg(&realmode_ctx))
{
case 0x66:
{
char label[12],fsname[9],path[4];
DWORD serial;
strcpy(path,"x:\\");path[0]=drive+'A';
GetVolumeInformation32A(path,label,12,&serial,NULL,NULL,fsname,9);
*(WORD*)dataptr = 0;
memcpy(dataptr+2,&serial,4);
memcpy(dataptr+6,label ,11);
memcpy(dataptr+17,fsname,8);
break;
}
case 0x60: /* get device parameters */
/* used by defrag.exe of win95 */
memset(dataptr, 0, 0x26);
dataptr[0] = 0x04;
dataptr[6] = 0; /* media type */
if (drive > 1)
{
dataptr[1] = 0x05; /* fixed disk */
setword(&dataptr[2], 0x01); /* non removable */
setword(&dataptr[4], 0x300); /* # of cylinders */
}
else
{
dataptr[1] = 0x07; /* block dev, floppy */
setword(&dataptr[2], 0x02); /* removable */
setword(&dataptr[4], 80); /* # of cylinders */
}
CreateBPB(drive, &dataptr[7]);
break;
default:
SET_CFLAG(context);
break;
}
}
break;
default:
SET_CFLAG(context);
break;
}
break;
default:
SET_CFLAG(context);
break;
}
break;
default:
SET_CFLAG(context);
break;
}
if (EFL_reg(context)&1)
fprintf(stdnimp,
"RealModeInt %02x: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n"
" ESI=%08lx EDI=%08lx DS=%04lx ES=%04lx\n",
BL_reg(context), EAX_reg(&realmode_ctx),
EBX_reg(&realmode_ctx), ECX_reg(&realmode_ctx),
EDX_reg(&realmode_ctx), ESI_reg(&realmode_ctx),
EDI_reg(&realmode_ctx), DS_reg(&realmode_ctx),
ES_reg(&realmode_ctx) );
INT_SetRealModeContext( call, &realmode_ctx );
}
/**********************************************************************
* INT_Int31Handler
@ -206,118 +385,10 @@ void WINAPI INT_Int31Handler( CONTEXT *context )
DX_reg(context) ));
break;
case 0x0300: /* Simulate real mode interrupt
* Interrupt number is in BL, flags are in BH
* ES:DI points to real-mode call structure
* Currently we just print it out and return error.
*/
RESET_CFLAG(context);
{
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );
switch (BL_reg(context)) {
case 0x2f: /* int2f */
switch ((p->eax & 0xFF00)>>8) {
case 0x15:
/* MSCDEX hook */
AX_reg(context) = p->eax & 0xFFFF;
do_mscdex( context );
break;
default:
SET_CFLAG(context);
break;
}
break;
case 0x21: /* int21 */
switch ((p->eax & 0xFF00)>>8) {
case 0x65:
switch (p->eax & 0xFF) {
case 06:{/* get collate table */
char *table;
/* ES:DI is a REALMODE pointer to 5 byte dosmem
* we fill that with 0x6, realmode pointer to collateTB
*/
table = DOSMEM_MapRealToLinear(MAKELONG(p->edi,p->es));
*(BYTE*)table = 0x06;
*(DWORD*)(table+1) = DOSMEM_CollateTable;
CX_reg(context) = 258;/*FIXME: size of table?*/
break;
}
default:
SET_CFLAG(context);
}
break;
case 0x44:
switch (p->eax & 0xFF) {
case 0x0D:{/* generic block device request */
BYTE *dataptr = DOSMEM_MapRealToLinear((p->ds)*0x1000+(p->edx & 0xFFFF));
int drive = DOS_GET_DRIVE(p->ebx&0xFF);
if ((p->ecx & 0xFF00) != 0x0800) {
SET_CFLAG(context);
break;
}
switch (p->ecx & 0xFF) {
case 0x66:{
char label[12],fsname[9],path[4];
DWORD serial;
strcpy(path,"x:\\");path[0]=drive+'A';
GetVolumeInformation32A(path,label,12,&serial,NULL,NULL,fsname,9);
*(WORD*)dataptr = 0;
memcpy(dataptr+2,&serial,4);
memcpy(dataptr+6,label ,11);
memcpy(dataptr+17,fsname,8);
break;
}
case 0x60: /* get device parameters */
/* used by defrag.exe of win95 */
memset(dataptr, 0, 0x26);
dataptr[0] = 0x04;
dataptr[6] = 0; /* media type */
if (drive > 1) {
dataptr[1] = 0x05; /* fixed disk */
setword(&dataptr[2], 0x01); /* non removable */
setword(&dataptr[4], 0x300); /* # of cylinders */
} else {
dataptr[1] = 0x07; /* block dev, floppy */
setword(&dataptr[2], 0x02); /* removable */
setword(&dataptr[4], 80); /* # of cylinders */
}
CreateBPB(drive, &dataptr[7]);
break;
default:
SET_CFLAG(context);
break;
}
}
break;
default:
SET_CFLAG(context);
break;
}
break;
default:
SET_CFLAG(context);
break;
}
break;
default:
SET_CFLAG(context);
break;
}
if (EFL_reg(context)&1) {
fprintf(stdnimp,
"RealModeInt %02x: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n"
" ESI=%08lx EDI=%08lx ES=%04x DS=%04x\n",
BL_reg(context), p->eax, p->ebx, p->ecx, p->edx,
p->esi, p->edi, p->es, p->ds
);
}
}
case 0x0300: /* Simulate real mode interrupt */
INT_DoRealModeInt( context );
break;
case 0x0301: /* Call real mode procedure with far return */
{
REALMODECALL *p = (REALMODECALL *)PTR_SEG_OFF_TO_LIN( ES_reg(context), DI_reg(context) );

Some files were not shown because too many files have changed in this diff Show More