1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

Release 980517

Sun May 17 16:23:56 1998  Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [file/profile.c]
	Fix the return value of PROFILE_GetSection

	* [misc/crtdll.c]
	Do _getdrive, fix _chdrive.

	* [misc/commdlg.c]
	First cut at ChooseColor[WA].

	* [misc/network.c]
	Do something sensible for WNetGetDirectoryType16.

Sun May 17 10:21:35 1998  Andreas Mohr <100.30936@germany.net>

	* [controls/menu.c]
	Fixed disabled sub menus with MF_BYPOSITION that were not disabled.

	* [misc/crtdll.c] [relay32/crtdll.spec] [include/winerror.h]
	Implemented fscanf, fsetpos, _access, _fpreset (thanks to Uwe Bonnes),
	and _ltoa. 

	* [loader/task.c]
	MakeProcInstance: must use CURRENT_DS if hInst == NULL.

	* [misc/shell.c]
	SHELL_GetResourceTable, InternalExtractIcon: fixed broken .ICO handling

	* [windows/winpos.c]
	DeferWindowPos: removed "same parent" requirement.
	Which doc states that this is required ?

Sat May 16 20:08:11 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [loader/module.c] [loader/ne/module.c]
	More NE module cleanups.

	* [loader/task.c]
	Fixed SwitchStackBack().

Fri May 15 10:04:27 1998  Marcus Meissner <marcus@jet.franken.de>

	* [configure.in][inlcude/acconfig.h]
	Fixed broken OSS check, added check for working sigaltstack,
	fixed broken statfs checks on some linux systems.

	* [files/directory.c][loader/pe_image.c][relay32/builtin.c]
	  [loader/module.c]
	Added handling of win32 module pathnames.

	* [relay32/wnaspi32.spec]
	New file.

	* [misc/lzexpand.c]
	LZCopy auto-decompresses LZ compressed files, even if they are not
	specially flagged. Fixes some InstallShield problems.

	* [misc/registry.c]
	Some fixes for RegQueryInfoKey (reference program monkey.exe
	from Win32 SDK works now better). Probably still has faults.

Fri May 15 08:58:58 1998  Martin Boehme <boehme@informatik.mu-luebeck.de>

	* [graphics/mapping.c] [include/dc.h] [include/gdi.h] [objects/dc.c]
	Reworked the way world transformations and mapping modes are handled
	so that both of these transformations can be computed in a single
	step.

	* [graphics/painting.c] [graphics/path.c] [include/path.h]
	More GDI path support.

	* [graphics/x11drv/graphics.c]
	Fixed the return value of GRAPH_DrawArc for the zero height /
	zero width case to reflect Windows' behaviour.

	* [include/windows.h] [relay32/gdi32.spec] [objects/dc.c]
	Implemented ModifyWorldTransform and CombineTransform.

Tue May 14 18:03:46 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [controls/commctrl.c][relay32/comctl32.spec]
	  [controls/*.c][include/*.h]
	Implemented InitCommonControlsEx (dll version 4.72 compatible).
	InitCommonControls calls ImageCommonControlsEx.
	Registering code of the common controls had to be changed
	(see XXXX_Register functions).

	* [controls/status.c][include/commctrl.h][include/status.h]
	Implemented most new features and fixed the look and feel.

	* [contols/commctrl.c][include/commctrl.h][relay32/comctl32.spec]
	Implemented MenuHelp (incomplete).

	* [controls/status.c][controls/progress.c]
	Changed allocation strategy for control specific memory.

	* [controls/header.c][include/header.h][include/commctrl.h]
	First implementation of header control.

	* [windows/defwnd.c][windows/syscolors.c]
	Fixed default control colors for Win95 look.

	* [windows/nonclient.c]
	Fixed off by one error for Win95 look. Top border of child windows
	should be visible.

	* [misc/imagelist.h]
	Improved documentation and fixed some bugs.

Thu May 14 15:42:21 1998  Robert Wilhelm  <robert@physiol.med.tu-muenchen.de>

	* [relay32/crtdll.spec]
	Added hypot,j0,j1,jn and ceil.

Wed May 13 19:10:10 1998  Pascal Cuoq <pcuoq@ens-lyon.fr>

	* [controls/listbox.c]
	Item height is now exactly font height.
	Wine listboxes now behave like Windows' when they are 
	created without WS_VSCROLL but the program subsequently 
	calls ShowScrollBar or SetScrollInfo.

Wed May 13 18:33:01 1998  Ulrich Weigand <weigand@informatik.uni-erlangen.de>

	* [relay32/relay386.c]
	Restore ES also in the non-debug case.

	* [windows/event.c]
	Bugfix: Blocking TSXNextEvent could deadlock Wine.

	* [win32/process.c] [windows/message.c]
	Silly stubs for MsgWaitForMultipleObjects / PostThreadMessage
	that make some programs run better.

	* [windows/winproc.c]
	WINPROC_MapMsg32Ato16/16To32A: added WM_NOTIFY.  

        * [win32/kernel32.c]
	Added 16->32 thunking and improved 32->16 thunking functions.

	* [tools/build.c]
	Added new variant of CallFrom16 stub for use with Win95 thunks.

	* [if1632/kernel.spec] [if1632/builtin.c] [win32/kernel32.c]
	Added a few undocumented KERNEL functions.

	* [loader/ne/module.c] [loader/ne/segment.c]
	Call DllEntryPoint for 16-bit DLLs with subsystem >= 4.0.

	* [win32/kernel32.spec] [win32/wow32.spec] [win32/ordinals.c]
	Use names from the Oct 94 beta release for undoc. functions.

Wed May 13 14:18:26 1998  Matthew Becker <mbecker@glasscity.net>

	* [misc/registry.c]
	Code cleanup.

	* [misc/cpu.c]
	Commented out the registry puts temporarily.

	* [programs/regtest/*]
	New registry testing program.

Tue May 12 22:54:03 1998  Michael Mess <michael@kawo2.rwth-aachen.de>

	* [multimedia/audio.c]
	ioctl's do not commute in /dev/dsp initialization.

Tue May 12 20:11:42 1998  Karl Garrison <karlos@eznet.net>

	* [win32/console.c]
	Implemented SetConsoleTextAttribute, FillConsoleOutputCharacter.
	Improved cursor positioning.
	This allows for text colors in an xterm, rxvt, or console.

Tue May 12 17:57:52 1998  Petter Reinholdtsen <pere@td.org.uit.no>

	* [Makefile.in]
	Create prefix/{bin|lib} directories if missing during install.

Sun May 10 19:37:51 1998  Jan Willamowius <jan@janhh.shnet.org>

	* [multimedia/mmio.c]
	Have mmioSetBuffer return success (0), so Corel Draw 4
	keeps working. (IO is still unbuffered)

Wed May  6 16:57:55 1998  James Juran <jrj120@psu.edu>

        * [Makefile.in] [Make.rules.in]
	Changed "make clean" to remove `textedit` backup files (*%)

	* [controls/menu.c][graphics/x11drv/xfont.c][include/libres.h]
	  [loader/main.c][loader/ne/module.c][scheduler/synchro.c]
	  [win32/time.c][windows/winpos.c][include/windows.h]
	Fixed miscellaneous compilation warnings.

	* [misc/main.c][miscemu/main.c][include/main.h]
	Moved prototypes to new include file main.h, various cleanups.

Tue May  5 21:05:06 1998  Morten Welinder  <terra@diku.dk>

	* [misc/winsock.c]
	Don't refer to __FreeBSD__ when HAVE_STRERROR is meant.

	* [misc/debugstr.c]
	For debug_dumpstrSend, send strings to stderr.

Tue May  5 21:47:40 1998  Huw D M Davies <h.davies1@physics.oxford.ac.uk>

	* [objects/region.c]
	Fix for REGION_RegionOp() if newReg is one of the source regions.

Tue May  5 18:27:32 1998  Jim Peterson <jspeter@roanoke.infi.net>

	* [misc/main.c]
	Add '-h/-help' option and print WINE_RELEASE_INFO with usage message.

	* [misc/spy.c]
	Realign trace messages.

Tue May  5 15:46:47 1998  Donnie V. Savage <dsavage@cisco.com>

	* [graphics/ddraw.c]
	Fixed compile warnings

	* [misc/winsock.c]
	Warnings should not be errors.

Tue May  5 13:40:42 1998  Jim Peterson <jspeter@roanoke.infi.net>

	* [*/*]
	Remove many warnings through explicit casts, added #include's,
	and corrected printf formats.

Tue May  5 05:18:12 1998  Insomnia (Stea Greene) <insomnia@core.binghamton.edu>

	* [graphics/ddraw.c]
	Kept unchanged portion of old palette when changing only a few
	palette entries.  Really should only deallocate the changed cells.
	This make StarCraft work almost perfectly (sound overflows still
	cause static).

Mon May  4 15:04:57 1998  Alexander V. Lukyanov <lav@long.yar.ru>

	* [misc/lstr.c]
	FormatMessage: terminate string on %0, undo linefeed strip.
This commit is contained in:
Alexandre Julliard 1998-05-17 17:13:43 +00:00
parent 46ea8b3f73
commit dadf78ffa9
156 changed files with 8788 additions and 3118 deletions

View file

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

249
ChangeLog
View file

@ -1,3 +1,252 @@
----------------------------------------------------------------------
Sun May 17 16:23:56 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/profile.c]
Fix the return value of PROFILE_GetSection
* [misc/crtdll.c]
Do _getdrive, fix _chdrive.
* [misc/commdlg.c]
First cut at ChooseColor[WA].
* [misc/network.c]
Do something sensible for WNetGetDirectoryType16.
Sun May 17 10:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [controls/menu.c]
Fixed disabled sub menus with MF_BYPOSITION that were not disabled.
* [misc/crtdll.c] [relay32/crtdll.spec] [include/winerror.h]
Implemented fscanf, fsetpos, _access, _fpreset (thanks to Uwe Bonnes),
and _ltoa.
* [loader/task.c]
MakeProcInstance: must use CURRENT_DS if hInst == NULL.
* [misc/shell.c]
SHELL_GetResourceTable, InternalExtractIcon: fixed broken .ICO handling
* [windows/winpos.c]
DeferWindowPos: removed "same parent" requirement.
Which doc states that this is required ?
Sat May 16 20:08:11 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/module.c] [loader/ne/module.c]
More NE module cleanups.
* [loader/task.c]
Fixed SwitchStackBack().
Fri May 15 10:04:27 1998 Marcus Meissner <marcus@jet.franken.de>
* [configure.in][inlcude/acconfig.h]
Fixed broken OSS check, added check for working sigaltstack,
fixed broken statfs checks on some linux systems.
* [files/directory.c][loader/pe_image.c][relay32/builtin.c]
[loader/module.c]
Added handling of win32 module pathnames.
* [relay32/wnaspi32.spec]
New file.
* [misc/lzexpand.c]
LZCopy auto-decompresses LZ compressed files, even if they are not
specially flagged. Fixes some InstallShield problems.
* [misc/registry.c]
Some fixes for RegQueryInfoKey (reference program monkey.exe
from Win32 SDK works now better). Probably still has faults.
Fri May 15 08:58:58 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c] [include/dc.h] [include/gdi.h] [objects/dc.c]
Reworked the way world transformations and mapping modes are handled
so that both of these transformations can be computed in a single
step.
* [graphics/painting.c] [graphics/path.c] [include/path.h]
More GDI path support.
* [graphics/x11drv/graphics.c]
Fixed the return value of GRAPH_DrawArc for the zero height /
zero width case to reflect Windows' behaviour.
* [include/windows.h] [relay32/gdi32.spec] [objects/dc.c]
Implemented ModifyWorldTransform and CombineTransform.
Tue May 14 18:03:46 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/commctrl.c][relay32/comctl32.spec]
[controls/*.c][include/*.h]
Implemented InitCommonControlsEx (dll version 4.72 compatible).
InitCommonControls calls ImageCommonControlsEx.
Registering code of the common controls had to be changed
(see XXXX_Register functions).
* [controls/status.c][include/commctrl.h][include/status.h]
Implemented most new features and fixed the look and feel.
* [contols/commctrl.c][include/commctrl.h][relay32/comctl32.spec]
Implemented MenuHelp (incomplete).
* [controls/status.c][controls/progress.c]
Changed allocation strategy for control specific memory.
* [controls/header.c][include/header.h][include/commctrl.h]
First implementation of header control.
* [windows/defwnd.c][windows/syscolors.c]
Fixed default control colors for Win95 look.
* [windows/nonclient.c]
Fixed off by one error for Win95 look. Top border of child windows
should be visible.
* [misc/imagelist.h]
Improved documentation and fixed some bugs.
Thu May 14 15:42:21 1998 Robert Wilhelm <robert@physiol.med.tu-muenchen.de>
* [relay32/crtdll.spec]
Added hypot,j0,j1,jn and ceil.
Wed May 13 19:10:10 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [controls/listbox.c]
Item height is now exactly font height.
Wine listboxes now behave like Windows' when they are
created without WS_VSCROLL but the program subsequently
calls ShowScrollBar or SetScrollInfo.
Wed May 13 18:33:01 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [relay32/relay386.c]
Restore ES also in the non-debug case.
* [windows/event.c]
Bugfix: Blocking TSXNextEvent could deadlock Wine.
* [win32/process.c] [windows/message.c]
Silly stubs for MsgWaitForMultipleObjects / PostThreadMessage
that make some programs run better.
* [windows/winproc.c]
WINPROC_MapMsg32Ato16/16To32A: added WM_NOTIFY.
* [win32/kernel32.c]
Added 16->32 thunking and improved 32->16 thunking functions.
* [tools/build.c]
Added new variant of CallFrom16 stub for use with Win95 thunks.
* [if1632/kernel.spec] [if1632/builtin.c] [win32/kernel32.c]
Added a few undocumented KERNEL functions.
* [loader/ne/module.c] [loader/ne/segment.c]
Call DllEntryPoint for 16-bit DLLs with subsystem >= 4.0.
* [win32/kernel32.spec] [win32/wow32.spec] [win32/ordinals.c]
Use names from the Oct 94 beta release for undoc. functions.
Wed May 13 14:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [misc/registry.c]
Code cleanup.
* [misc/cpu.c]
Commented out the registry puts temporarily.
* [programs/regtest/*]
New registry testing program.
Tue May 12 22:54:03 1998 Michael Mess <michael@kawo2.rwth-aachen.de>
* [multimedia/audio.c]
ioctl's do not commute in /dev/dsp initialization.
Tue May 12 20:11:42 1998 Karl Garrison <karlos@eznet.net>
* [win32/console.c]
Implemented SetConsoleTextAttribute, FillConsoleOutputCharacter.
Improved cursor positioning.
This allows for text colors in an xterm, rxvt, or console.
Tue May 12 17:57:52 1998 Petter Reinholdtsen <pere@td.org.uit.no>
* [Makefile.in]
Create prefix/{bin|lib} directories if missing during install.
Sun May 10 19:37:51 1998 Jan Willamowius <jan@janhh.shnet.org>
* [multimedia/mmio.c]
Have mmioSetBuffer return success (0), so Corel Draw 4
keeps working. (IO is still unbuffered)
Wed May 6 16:57:55 1998 James Juran <jrj120@psu.edu>
* [Makefile.in] [Make.rules.in]
Changed "make clean" to remove `textedit` backup files (*%)
* [controls/menu.c][graphics/x11drv/xfont.c][include/libres.h]
[loader/main.c][loader/ne/module.c][scheduler/synchro.c]
[win32/time.c][windows/winpos.c][include/windows.h]
Fixed miscellaneous compilation warnings.
* [misc/main.c][miscemu/main.c][include/main.h]
Moved prototypes to new include file main.h, various cleanups.
Tue May 5 21:05:06 1998 Morten Welinder <terra@diku.dk>
* [misc/winsock.c]
Don't refer to __FreeBSD__ when HAVE_STRERROR is meant.
* [misc/debugstr.c]
For debug_dumpstrSend, send strings to stderr.
Tue May 5 21:47:40 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [objects/region.c]
Fix for REGION_RegionOp() if newReg is one of the source regions.
Tue May 5 18:27:32 1998 Jim Peterson <jspeter@roanoke.infi.net>
* [misc/main.c]
Add '-h/-help' option and print WINE_RELEASE_INFO with usage message.
* [misc/spy.c]
Realign trace messages.
Tue May 5 15:46:47 1998 Donnie V. Savage <dsavage@cisco.com>
* [graphics/ddraw.c]
Fixed compile warnings
* [misc/winsock.c]
Warnings should not be errors.
Tue May 5 13:40:42 1998 Jim Peterson <jspeter@roanoke.infi.net>
* [*/*]
Remove many warnings through explicit casts, added #include's,
and corrected printf formats.
Tue May 5 05:18:12 1998 Insomnia (Stea Greene) <insomnia@core.binghamton.edu>
* [graphics/ddraw.c]
Kept unchanged portion of old palette when changing only a few
palette entries. Really should only deallocate the changed cells.
This make StarCraft work almost perfectly (sound overflows still
cause static).
Mon May 4 15:04:57 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/lstr.c]
FormatMessage: terminate string on %0, undo linefeed strip.
---------------------------------------------------------------------- ----------------------------------------------------------------------
Thu Apr 30 16:28:12 1998 James Juran <jrj120@psu.edu> Thu Apr 30 16:28:12 1998 James Juran <jrj120@psu.edu>

View file

@ -132,7 +132,7 @@ depend:: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS) $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
clean:: clean::
$(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc *-tmp.c y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.c) $(RC_SRCS:.rc=.h) $(PROGRAMS) $(RM) *.o \#*\# *~ *% *.bak *.orig *.rej *.flc *-tmp.c y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.c) $(RC_SRCS:.rc=.h) $(PROGRAMS)
dummy: dummy:

View file

@ -122,6 +122,8 @@ libwine.so.1.0: $(LIBOBJS)
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS) $(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS)
install_emu: install_lib install_emu: install_lib
-mkdirhier $(bindir)
-mkdirhier $(libdir)
$(INSTALL_PROGRAM) wine $(bindir)/wine $(INSTALL_PROGRAM) wine $(bindir)/wine
$(INSTALL_DATA) wine.sym $(libdir)/wine.sym $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
@ -157,7 +159,7 @@ htmlpages:
clean:: clean::
for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
for i in include; do (cd $$i; $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc); done for i in include; do (cd $$i; $(RM) *.o \#*\# *~ *% *.bak *.orig *.rej *.flc); done
$(RM) wine wine.sym libwine.a libwine.so.1.0 TAGS $(RM) wine wine.sym libwine.a libwine.so.1.0 TAGS
distclean: clean distclean: clean

401
configure vendored
View file

@ -2135,30 +2135,33 @@ EOF
if { (eval echo configure:2136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_opensoundsystem="yes" ac_cv_c_opensoundsystem="yes"
cat >> confdefs.h <<\EOF
#define HAVE_OSS 1
EOF
else else
echo "configure: failed program was:" >&5 echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5 cat conftest.$ac_ext >&5
rm -rf conftest* rm -rf conftest*
ac_cv_c_opensoundsystem="no" ac_cv_c_opensoundsystem="no"
fi fi
rm -f conftest* rm -f conftest*
fi fi
echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6 echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6
if test "$ac_cv_c_opensoundsystem" = "yes"
then
cat >> confdefs.h <<\EOF
#define HAVE_OSS 1
EOF
fi
echo $ac_n "checking "for union semun"""... $ac_c" 1>&6 echo $ac_n "checking "for union semun"""... $ac_c" 1>&6
echo "configure:2157: checking "for union semun"" >&5 echo "configure:2160: checking "for union semun"" >&5
if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2162 "configure" #line 2165 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/sem.h> #include <sys/sem.h>
@ -2166,7 +2169,7 @@ int main() {
union semun foo union semun foo
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_union_semun="yes" ac_cv_c_union_semun="yes"
else else
@ -2194,7 +2197,7 @@ if test "x${GCC}" = "xyes"
then then
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall"
echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6 echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
echo "configure:2198: checking "for gcc strength-reduce bug"" >&5 echo "configure:2201: checking "for gcc strength-reduce bug"" >&5
if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2202,7 +2205,7 @@ else
ac_cv_c_gcc_strength_bug="yes" ac_cv_c_gcc_strength_bug="yes"
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2206 "configure" #line 2209 "configure"
#include "confdefs.h" #include "confdefs.h"
int main(void) { int main(void) {
@ -2213,7 +2216,7 @@ int main(void) {
exit( Array[1] != -2 ); exit( Array[1] != -2 );
} }
EOF EOF
if { (eval echo configure:2217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
ac_cv_c_gcc_strength_bug="no" ac_cv_c_gcc_strength_bug="no"
else else
@ -2236,7 +2239,7 @@ fi
echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6 echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
echo "configure:2240: checking "whether external symbols need an underscore prefix"" >&5 echo "configure:2243: checking "whether external symbols need an underscore prefix"" >&5
if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2248,14 +2251,14 @@ _ac_test:
.long 0 .long 0
EOF EOF
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2252 "configure" #line 2255 "configure"
#include "confdefs.h" #include "confdefs.h"
extern int ac_test; extern int ac_test;
int main() { int main() {
if (ac_test) return 1 if (ac_test) return 1
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_extern_prefix="yes" ac_cv_c_extern_prefix="yes"
else else
@ -2279,7 +2282,7 @@ fi
echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6 echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6
echo "configure:2283: checking "whether assembler accepts .string"" >&5 echo "configure:2286: checking "whether assembler accepts .string"" >&5
if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2289,14 +2292,14 @@ cat > conftest_asm.s <<EOF
.string "test" .string "test"
EOF EOF
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2293 "configure" #line 2296 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_asm_string="yes" ac_cv_c_asm_string="yes"
else else
@ -2323,21 +2326,21 @@ DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0" if test "$LIB_TARGET" = "libwine.so.1.0"
then then
echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6 echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
echo "configure:2327: checking "whether we can build a dll"" >&5 echo "configure:2330: checking "whether we can build a dll"" >&5
if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
saved_cflags=$CFLAGS saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0" CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2334 "configure" #line 2337 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
return 1 return 1
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_dll="yes" ac_cv_c_dll="yes"
else else
@ -2363,7 +2366,7 @@ fi
echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6
echo "configure:2367: checking "for reentrant X libraries"" >&5 echo "configure:2370: checking "for reentrant X libraries"" >&5
if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2407,12 +2410,12 @@ fi
for ac_func in clone getpagesize memmove sigaltstack strerror tcgetattr timegm usleep wait4 waitpid for ac_func in clone getpagesize memmove sigaltstack strerror tcgetattr timegm usleep wait4 waitpid
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2411: checking for $ac_func" >&5 echo "configure:2414: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2416 "configure" #line 2419 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -2435,7 +2438,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -2463,17 +2466,17 @@ for ac_hdr in wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2467: checking for $ac_hdr" >&5 echo "configure:2470: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2472 "configure" #line 2475 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2500,12 +2503,12 @@ fi
done done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:2504: checking whether stat file-mode macros are broken" >&5 echo "configure:2507: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2509 "configure" #line 2512 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -2556,12 +2559,12 @@ EOF
fi fi
echo $ac_n "checking for working const""... $ac_c" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2560: checking for working const" >&5 echo "configure:2563: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2565 "configure" #line 2568 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
@ -2610,7 +2613,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
@ -2631,12 +2634,12 @@ EOF
fi fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2635: checking for ANSI C header files" >&5 echo "configure:2638: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2640 "configure" #line 2643 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -2644,7 +2647,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2661,7 +2664,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2665 "configure" #line 2668 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
@ -2679,7 +2682,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2683 "configure" #line 2686 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
@ -2700,7 +2703,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2704 "configure" #line 2707 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -2711,7 +2714,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF EOF
if { (eval echo configure:2715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:2718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
: :
else else
@ -2735,12 +2738,12 @@ EOF
fi fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2739: checking for size_t" >&5 echo "configure:2742: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2744 "configure" #line 2747 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#if STDC_HEADERS #if STDC_HEADERS
@ -2768,7 +2771,7 @@ EOF
fi fi
echo $ac_n "checking size of long long""... $ac_c" 1>&6 echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:2772: checking size of long long" >&5 echo "configure:2775: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2776,7 +2779,7 @@ else
ac_cv_sizeof_long_long=0 ac_cv_sizeof_long_long=0
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2780 "configure" #line 2783 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdio.h> #include <stdio.h>
main() main()
@ -2787,7 +2790,7 @@ main()
exit(0); exit(0);
} }
EOF EOF
if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
ac_cv_sizeof_long_long=`cat conftestval` ac_cv_sizeof_long_long=`cat conftestval`
else else
@ -2807,8 +2810,213 @@ EOF
if test "$ac_cv_header_sys_vfs_h" = "yes"
then
echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6
echo "configure:2818: checking "whether sys/vfs.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2823 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/vfs.h>
int main() {
struct statfs stfs;
memset(&stfs,0,sizeof(stfs));
; return 0; }
EOF
if { (eval echo configure:2840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_sys_vfs_has_statfs=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
wine_cv_sys_vfs_has_statfs=no
fi
rm -f conftest*
fi
echo "$ac_t""$wine_cv_sys_vfs_has_statfs" 1>&6
if test "$wine_cv_sys_vfs_has_statfs" = "yes"
then
cat >> confdefs.h <<\EOF
#define STATFS_DEFINED_BY_SYS_VFS 1
EOF
fi
fi
if test "$ac_cv_header_sys_statfs_h" = "yes"
then
echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6
echo "configure:2867: checking "whether sys/statfs.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2872 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/statfs.h>
int main() {
struct statfs stfs;
; return 0; }
EOF
if { (eval echo configure:2887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_sys_statfs_has_statfs=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
wine_cv_sys_statfs_has_statfs=no
fi
rm -f conftest*
fi
echo "$ac_t""$wine_cv_sys_statfs_has_statfs" 1>&6
if test "$wine_cv_sys_statfs_has_statfs" = "yes"
then
cat >> confdefs.h <<\EOF
#define STATFS_DEFINED_BY_SYS_STATFS 1
EOF
fi
fi
if test "$ac_cv_header_sys_mount_h" = "yes"
then
echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6
echo "configure:2914: checking "whether sys/mount.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2919 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/mount.h>
int main() {
struct statfs stfs;
; return 0; }
EOF
if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_sys_mount_has_statfs=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
wine_cv_sys_mount_has_statfs=no
fi
rm -f conftest*
fi
echo "$ac_t""$wine_cv_sys_mount_has_statfs" 1>&6
if test "$wine_cv_sys_mount_has_statfs" = "yes"
then
cat >> confdefs.h <<\EOF
#define STATFS_DEFINED_BY_SYS_MOUNT 1
EOF
fi
fi
echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
echo "configure:2960: checking "for statfs.f_bfree"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$statfs_bfree" = "xno"
then
wine_cv_statfs_bfree=no
else
cat > conftest.$ac_ext <<EOF
#line 2969 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif
int main() {
struct statfs stfs;
stfs.f_bfree++;
; return 0; }
EOF
if { (eval echo configure:2996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bfree=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
wine_cv_statfs_bfree=no
fi
rm -f conftest*
fi
fi
echo "$ac_t""$wine_cv_statfs_bfree" 1>&6
if test "$wine_cv_statfs_bfree" = "yes"
then
cat >> confdefs.h <<\EOF
#define STATFS_HAS_BFREE 1
EOF
fi
echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6
echo "configure:2812: checking "for statfs.f_bavail"" >&5 echo "configure:3020: checking "for statfs.f_bavail"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2817,21 +3025,23 @@ else
wine_cv_statfs_bavail=no wine_cv_statfs_bavail=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2821 "configure" #line 3029 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_STATFS_H #ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h> # include <sys/mount.h>
#endif #else
#ifdef HAVE_SYS_VFS_H # ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h> # include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif #endif
int main() { int main() {
@ -2842,7 +3052,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
wine_cv_statfs_bavail=yes wine_cv_statfs_bavail=yes
else else
@ -2865,60 +3075,75 @@ EOF
fi fi
echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
echo "configure:2870: checking "for statfs.f_bfree"" >&5 echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6
if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then echo "configure:3081: checking "for working sigaltstack"" >&5
if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
if test "x$statfs_bfree" = "xno" if test "$cross_compiling" = yes; then
then ac_cv_c_working_sigaltstack="no"
wine_cv_statfs_bfree=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2879 "configure" #line 3090 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdio.h>
#include <time.h> /* <sys/time.h> ? bad magic without end */
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h>
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_STATFS_H #ifdef HAVE_SYSCALL_H
# include <sys/statfs.h> # include <syscall.h>
#endif #else
#ifdef HAVE_SYS_MOUNT_H # ifdef HAVE_SYS_SYSCALL_H
# include <sys/mount.h> # include <sys/syscall.h>
#endif # endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif #endif
int main() { unsigned char *xaltstack;
struct statfs stfs; int
main(int argc,char **argv) {
struct sigaltstack ss;
stfs.f_bfree++; xaltstack = malloc(16384);
ss.ss_sp = xaltstack;
ss.ss_size = 16384;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
/* this catches the glibc case */
perror("sigaltstack");
return (1); /* aka exit(1) aka fail */
}
/* assume it works. */
return 0; /* OK */
}
; return 0; }
EOF EOF
if { (eval echo configure:2904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:3128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
rm -rf conftest* then
wine_cv_statfs_bfree=yes ac_cv_c_working_sigaltstack="yes"
else else
echo "configure: failed program was:" >&5 echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5 cat conftest.$ac_ext >&5
rm -rf conftest* rm -fr conftest*
wine_cv_statfs_bfree=no ac_cv_c_working_sigaltstack="no"
fi fi
rm -f conftest* rm -fr conftest*
fi
fi fi
echo "$ac_t""$wine_cv_statfs_bfree" 1>&6 fi
if test "$wine_cv_statfs_bfree" = "yes"
echo "$ac_t""$ac_cv_c_working_sigaltstack" 1>&6
if test "$ac_cv_c_working_sigaltstack" = "yes"
then then
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define STATFS_HAS_BFREE 1 #define HAVE_WORKING_SIGALTSTACK 1
EOF EOF
fi fi
@ -3057,6 +3282,7 @@ programs/Makefile
programs/clock/Makefile programs/clock/Makefile
programs/notepad/Makefile programs/notepad/Makefile
programs/progman/Makefile programs/progman/Makefile
programs/regtest/Makefile
programs/view/Makefile programs/view/Makefile
programs/winhelp/Makefile programs/winhelp/Makefile
programs/winver/Makefile programs/winver/Makefile
@ -3187,6 +3413,7 @@ programs/Makefile
programs/clock/Makefile programs/clock/Makefile
programs/notepad/Makefile programs/notepad/Makefile
programs/progman/Makefile programs/progman/Makefile
programs/regtest/Makefile
programs/view/Makefile programs/view/Makefile
programs/winhelp/Makefile programs/winhelp/Makefile
programs/winver/Makefile programs/winver/Makefile

View file

@ -75,11 +75,12 @@ AC_CACHE_CHECK("for Open Sound System",
#if !defined(SNDCTL_DSP_STEREO) #if !defined(SNDCTL_DSP_STEREO)
#error No open sound system #error No open sound system
#endif #endif
], ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
ac_cv_c_opensoundsystem="yes"
AC_DEFINE(HAVE_OSS), if test "$ac_cv_c_opensoundsystem" = "yes"
ac_cv_c_opensoundsystem="no" then
)) AC_DEFINE(HAVE_OSS)
fi
dnl **** Check for union semun **** dnl **** Check for union semun ****
@ -220,7 +221,108 @@ AC_C_CONST()
AC_TYPE_SIZE_T() AC_TYPE_SIZE_T()
AC_CHECK_SIZEOF(long long,0) AC_CHECK_SIZEOF(long long,0)
dnl **** Dependent checks **** dnl **** statfs checks ****
if test "$ac_cv_header_sys_vfs_h" = "yes"
then
AC_CACHE_CHECK( "whether sys/vfs.h defines statfs",
wine_cv_sys_vfs_has_statfs,
AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/vfs.h>
],[
struct statfs stfs;
memset(&stfs,0,sizeof(stfs));
],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
)
)
if test "$wine_cv_sys_vfs_has_statfs" = "yes"
then
AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS)
fi
fi
if test "$ac_cv_header_sys_statfs_h" = "yes"
then
AC_CACHE_CHECK( "whether sys/statfs.h defines statfs",
wine_cv_sys_statfs_has_statfs,
AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/statfs.h>
],[
struct statfs stfs;
],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
)
)
if test "$wine_cv_sys_statfs_has_statfs" = "yes"
then
AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS)
fi
fi
if test "$ac_cv_header_sys_mount_h" = "yes"
then
AC_CACHE_CHECK( "whether sys/mount.h defines statfs",
wine_cv_sys_mount_has_statfs,
AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/mount.h>
],[
struct statfs stfs;
],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
)
)
if test "$wine_cv_sys_mount_has_statfs" = "yes"
then
AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT)
fi
fi
dnl **** FIXME: what about mixed cases, where we need two of them? ***
AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
[ if test "x$statfs_bfree" = "xno"
then
wine_cv_statfs_bfree=no
else
AC_TRY_COMPILE([
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif
],[
struct statfs stfs;
stfs.f_bfree++;
],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
)
fi ] )
if test "$wine_cv_statfs_bfree" = "yes"
then
AC_DEFINE(STATFS_HAS_BFREE)
fi
AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail, AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
[ if test "x$statfs_bavail" = "xno" [ if test "x$statfs_bavail" = "xno"
then then
@ -231,14 +333,16 @@ AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_STATFS_H #ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h> # include <sys/mount.h>
#endif #else
#ifdef HAVE_SYS_VFS_H # ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h> # include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif #endif
],[ ],[
struct statfs stfs; struct statfs stfs;
@ -252,35 +356,54 @@ then
AC_DEFINE(STATFS_HAS_BAVAIL) AC_DEFINE(STATFS_HAS_BAVAIL)
fi fi
AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree, dnl *** check for working sigaltstack
[ if test "x$statfs_bfree" = "xno" dnl glibc 2.0x defines it, but it always fails... so it is useless for us.
then
wine_cv_statfs_bfree=no AC_CACHE_CHECK("for working sigaltstack",
else ac_cv_c_working_sigaltstack,
AC_TRY_COMPILE([ AC_TRY_RUN([
#include <stdio.h>
#include <time.h> /* <sys/time.h> ? bad magic without end */
#include <sys/types.h> #include <sys/types.h>
#include <sys/signal.h>
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_STATFS_H #ifdef HAVE_SYSCALL_H
# include <sys/statfs.h> # include <syscall.h>
#else
# ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
# endif
#endif #endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h> unsigned char *xaltstack;
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
],[
struct statfs stfs;
stfs.f_bfree++; int
],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no main(int argc,char **argv) {
) struct sigaltstack ss;
fi ] )
if test "$wine_cv_statfs_bfree" = "yes" xaltstack = malloc(16384);
ss.ss_sp = xaltstack;
ss.ss_size = 16384;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
/* this catches the glibc case */
perror("sigaltstack");
return (1); /* aka exit(1) aka fail */
}
/* assume it works. */
return 0; /* OK */
}
],
ac_cv_c_working_sigaltstack="yes",
ac_cv_c_working_sigaltstack="no",
ac_cv_c_working_sigaltstack="no"
))
if test "$ac_cv_c_working_sigaltstack" = "yes"
then then
AC_DEFINE(STATFS_HAS_BFREE) AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
fi fi
@ -317,6 +440,7 @@ programs/Makefile
programs/clock/Makefile programs/clock/Makefile
programs/notepad/Makefile programs/notepad/Makefile
programs/progman/Makefile programs/progman/Makefile
programs/regtest/Makefile
programs/view/Makefile programs/view/Makefile
programs/winhelp/Makefile programs/winhelp/Makefile
programs/winver/Makefile programs/winver/Makefile

View file

@ -11,6 +11,7 @@ C_SRCS = \
commctrl.c \ commctrl.c \
desktop.c \ desktop.c \
edit.c \ edit.c \
header.c \
icontitle.c \ icontitle.c \
listbox.c \ listbox.c \
menu.c \ menu.c \

View file

@ -8,24 +8,11 @@
#include "win.h" #include "win.h"
#include "heap.h" #include "heap.h"
#include "commctrl.h" #include "commctrl.h"
#include "header.h"
#include "progress.h" #include "progress.h"
#include "status.h" #include "status.h"
#include "updown.h" #include "updown.h"
#include "debug.h"
/* Win32 common controls */
static WNDCLASS32A WIDGETS_CommonControls32[] =
{
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, StatusWindowProc, 0,
sizeof(STATUSWINDOWINFO), 0, 0, 0, 0, 0, STATUSCLASSNAME32A },
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, UpDownWindowProc, 0,
sizeof(UPDOWN_INFO), 0, 0, 0, 0, 0, UPDOWN_CLASS32A },
{ CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW, ProgressWindowProc, 0,
sizeof(PROGRESS_INFO), 0, 0, 0, 0, 0, PROGRESS_CLASS32A }
};
#define NB_COMMON_CONTROLS32 \
(sizeof(WIDGETS_CommonControls32)/sizeof(WIDGETS_CommonControls32[0]))
/*********************************************************************** /***********************************************************************
@ -37,8 +24,6 @@ void WINAPI DrawStatusText32A( HDC32 hdc, LPRECT32 lprc, LPCSTR text,
RECT32 r = *lprc; RECT32 r = *lprc;
UINT32 border = BDR_SUNKENOUTER; UINT32 border = BDR_SUNKENOUTER;
DrawEdge32(hdc, &r, BDR_RAISEDINNER, BF_RECT|BF_ADJUST|BF_FLAT);
if(style==SBT_POPOUT) if(style==SBT_POPOUT)
border = BDR_RAISEDOUTER; border = BDR_RAISEDOUTER;
else if(style==SBT_NOBORDERS) else if(style==SBT_NOBORDERS)
@ -59,7 +44,7 @@ void WINAPI DrawStatusText32A( HDC32 hdc, LPRECT32 lprc, LPCSTR text,
} }
/*********************************************************************** /***********************************************************************
* DrawStatusText32W (COMCTL32.24) * DrawStatusText32W (COMCTL32.28)
*/ */
void WINAPI DrawStatusText32W( HDC32 hdc, LPRECT32 lprc, LPCWSTR text, void WINAPI DrawStatusText32W( HDC32 hdc, LPRECT32 lprc, LPCWSTR text,
UINT32 style ) UINT32 style )
@ -70,7 +55,7 @@ void WINAPI DrawStatusText32W( HDC32 hdc, LPRECT32 lprc, LPCWSTR text,
} }
/*********************************************************************** /***********************************************************************
* DrawStatusText16 (COMCTL32.23) * DrawStatusText16 (COMCTL32.27)
*/ */
void WINAPI DrawStatusText16( HDC16 hdc, LPRECT16 lprc, LPCSTR text, void WINAPI DrawStatusText16( HDC16 hdc, LPRECT16 lprc, LPCSTR text,
UINT16 style ) UINT16 style )
@ -97,7 +82,7 @@ HWND32 WINAPI CreateStatusWindow32A( INT32 style, LPCSTR text, HWND32 parent,
} }
/*********************************************************************** /***********************************************************************
* CreateStatusWindow16 (COMCTL32.18) * CreateStatusWindow16 (COMCTL32.21)
*/ */
HWND16 WINAPI CreateStatusWindow16( INT16 style, LPCSTR text, HWND16 parent, HWND16 WINAPI CreateStatusWindow16( INT16 style, LPCSTR text, HWND16 parent,
UINT16 wid ) UINT16 wid )
@ -109,7 +94,7 @@ HWND16 WINAPI CreateStatusWindow16( INT16 style, LPCSTR text, HWND16 parent,
} }
/*********************************************************************** /***********************************************************************
* CreateStatusWindow32W (COMCTL32.19) * CreateStatusWindow32W (COMCTL32.22)
*/ */
HWND32 WINAPI CreateStatusWindow32W( INT32 style, LPCWSTR text, HWND32 parent, HWND32 WINAPI CreateStatusWindow32W( INT32 style, LPCWSTR text, HWND32 parent,
UINT32 wid ) UINT32 wid )
@ -141,24 +126,165 @@ HWND32 WINAPI CreateUpDownControl( DWORD style, INT32 x, INT32 y,
/*********************************************************************** /***********************************************************************
* InitCommonControls (COMCTL32.17) * InitCommonControls [COMCTL32.17]
*
*
*
*/ */
void WINAPI InitCommonControls(void)
{
int i;
char name[30];
const char *old_name;
WNDCLASS32A *class32 = WIDGETS_CommonControls32;
for (i = 0; i < NB_COMMON_CONTROLS32; i++, class32++) VOID WINAPI
{ InitCommonControls (VOID)
/* Just to make sure the string is > 0x10000 */ {
old_name = class32->lpszClassName; INITCOMMONCONTROLSEX icc;
strcpy( name, (char *)class32->lpszClassName );
class32->lpszClassName = name; icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
class32->hCursor = LoadCursor32A( 0, IDC_ARROW32A ); icc.dwICC = ICC_WIN95_CLASSES;
RegisterClass32A( class32 );
class32->lpszClassName = old_name; InitCommonControlsEx (&icc);
}
} }
/***********************************************************************
* InitCommonControlsEx [COMCTL32.81]
*
*
*
*/
BOOL32 WINAPI
InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
{
INT32 cCount;
DWORD dwMask;
if (lpInitCtrls == NULL) return (FALSE);
if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return (FALSE);
for (cCount = 0; cCount <= 31; cCount++) {
dwMask = 1 << cCount;
if (!(lpInitCtrls->dwICC & dwMask))
continue;
switch (lpInitCtrls->dwICC & dwMask) {
case ICC_LISTVIEW_CLASSES:
TRACE (commctrl, "No listview class implemented!\n");
HEADER_Register();
break;
case ICC_TREEVIEW_CLASSES:
TRACE (commctrl, "No treeview class implemented!\n");
TRACE (commctrl, "No tooltip class implemented!\n");
break;
case ICC_BAR_CLASSES:
TRACE (commctrl, "No toolbar class implemented!\n");
STATUS_Register ();
TRACE (commctrl, "No trackbar class implemented!\n");
TRACE (commctrl, "No tooltip class implemented!\n");
break;
case ICC_TAB_CLASSES:
TRACE (commctrl, "No tab class implemented!\n");
TRACE (commctrl, "No tooltip class implemented!\n");
break;
case ICC_UPDOWN_CLASS:
UPDOWN_Register ();
break;
case ICC_PROGRESS_CLASS:
PROGRESS_Register ();
break;
case ICC_HOTKEY_CLASS:
TRACE (commctrl, "No hotkey class implemented!\n");
break;
case ICC_ANIMATE_CLASS:
TRACE (commctrl, "No animation class implemented!\n");
break;
case ICC_DATE_CLASSES:
TRACE (commctrl, "No month calendar class implemented!\n");
TRACE (commctrl, "No date picker class implemented!\n");
TRACE (commctrl, "No time picker class implemented!\n");
break;
case ICC_USEREX_CLASSES:
TRACE (commctrl, "No comboex class implemented!\n");
break;
case ICC_COOL_CLASSES:
TRACE (commctrl, "No rebar class implemented!\n");
break;
case ICC_INTERNET_CLASSES:
TRACE (commctrl, "No internet classes implemented!\n");
break;
case ICC_PAGESCROLLER_CLASS:
TRACE (commctrl, "No page scroller class implemented!\n");
break;
case ICC_NATIVEFNTCTL_CLASS:
TRACE (commctrl, "No native font class implemented!\n");
break;
default:
WARN (commctrl, "Unknown class! dwICC=0x%lX\n", dwMask);
break;
}
}
return (TRUE);
}
/***********************************************************************
* MenuHelp (COMCTL32.2)
*
*
*
*
*/
VOID WINAPI
MenuHelp (UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, HMENU32 hMainMenu,
HINSTANCE32 hInst, HWND32 hwndStatus, LPUINT32 lpwIDs)
{
char szStatusText[128];
if (!IsWindow32 (hwndStatus)) return;
switch (uMsg) {
case WM_MENUSELECT:
TRACE (commctrl, "WM_MENUSELECT wParam=0x%X lParam=0x%lX\n",
wParam, lParam);
if ((HIWORD(wParam) == 0xFFFF) && (lParam == 0)) {
/* menu was closed */
SendMessage32A (hwndStatus, SB_SIMPLE, FALSE, 0);
}
else {
if (HIWORD(wParam) & MF_POPUP) {
TRACE (commctrl, "Popup menu selected!\n");
FIXME (commctrl, "No popup menu texts!\n");
szStatusText[0] = 0;
}
else {
TRACE (commctrl, "Menu item selected!\n");
if (!LoadString32A (hInst, LOWORD(wParam), szStatusText, 128))
szStatusText[0] = 0;
}
SendMessage32A (hwndStatus, SB_SETTEXT32A, 255 | SBT_NOBORDERS,
(LPARAM)szStatusText);
SendMessage32A (hwndStatus, SB_SIMPLE, TRUE, 0);
}
break;
default:
WARN (commctrl, "Invalid Message!\n");
break;
}
}

1278
controls/header.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -171,6 +171,15 @@ static void LISTBOX_UpdateScroll( WND *wnd, LB_DESCR *descr )
{ {
SCROLLINFO info; SCROLLINFO info;
if (!(descr->style & WS_VSCROLL)) return;
/* It is important that we check descr->style, and not wnd->dwStyle,
for WS_VSCROLL, as the former is exactly the one passed in
argument to CreateWindow.
In Windows (and from now on in Wine :) a listbox created
with such a style (no WS_SCROLL) does not update
the scrollbar with listbox-related data, thus letting
the programmer use it for his/her own purposes. */
if (descr->style & LBS_NOREDRAW) return; if (descr->style & LBS_NOREDRAW) return;
info.cbSize = sizeof(info); info.cbSize = sizeof(info);
@ -1089,8 +1098,8 @@ static INT32 LISTBOX_SetFont( WND *wnd, LB_DESCR *descr, HFONT32 font )
if (oldFont) SelectObject32( hdc, oldFont ); if (oldFont) SelectObject32( hdc, oldFont );
ReleaseDC32( wnd->hwndSelf, hdc ); ReleaseDC32( wnd->hwndSelf, hdc );
if (!IS_OWNERDRAW(descr)) if (!IS_OWNERDRAW(descr))
LISTBOX_SetItemHeight( wnd, descr, 0, tm.tmHeight + 2 ); LISTBOX_SetItemHeight( wnd, descr, 0, tm.tmHeight );
return tm.tmHeight + 2; return tm.tmHeight ;
} }

View file

@ -855,10 +855,10 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
dis.hDC = hdc; dis.hDC = hdc;
dis.rcItem = lpitem->rect; dis.rcItem = lpitem->rect;
TRACE(menu, "Ownerdraw: itemID=%d, itemState=%d, itemAction=%d, " TRACE(menu, "Ownerdraw: itemID=%d, itemState=%d, itemAction=%d, "
"hwndItem=%04x, hdc=%04x, rcItem={%d,%d,%d,%d}, rcItem=%p\n",dis.itemID, "hwndItem=%04x, hdc=%04x, rcItem={%d,%d,%d,%d}\n",dis.itemID,
dis.itemState, dis.itemAction, dis.hwndItem, dis.hDC, dis.itemState, dis.itemAction, dis.hwndItem, dis.hDC,
dis.rcItem.left, dis.rcItem.top, dis.rcItem.right, dis.rcItem.left, dis.rcItem.top, dis.rcItem.right,
dis.rcItem.bottom, dis.rcItem ); dis.rcItem.bottom );
SendMessage32A( GetWindow32(hwnd,GW_OWNER), WM_DRAWITEM, 0, (LPARAM)&dis ); SendMessage32A( GetWindow32(hwnd,GW_OWNER), WM_DRAWITEM, 0, (LPARAM)&dis );
return; return;
} }
@ -2799,7 +2799,7 @@ BOOL32 WINAPI EnableMenuItem32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) ) while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) )
{ {
if( !(item->fType & MF_POPUP) ) if( (wFlags & MF_BYPOSITION) || !(item->fType & MF_POPUP) )
{ {
/* We can't have MF_GRAYED and MF_DISABLED together */ /* We can't have MF_GRAYED and MF_DISABLED together */
if (wFlags & MF_GRAYED) if (wFlags & MF_GRAYED)

View file

@ -7,16 +7,14 @@
* - I do not know what to to on WM_[SG]ET_FONT * - I do not know what to to on WM_[SG]ET_FONT
*/ */
#include <stdlib.h>
#include <stdio.h>
#include "windows.h" #include "windows.h"
#include "sysmetrics.h"
#include "progress.h" #include "progress.h"
#include "graphics.h" #include "commctrl.h"
#include "heap.h" #include "heap.h"
#include "win.h" #include "win.h"
#include "debug.h" #include "debug.h"
/* Control configuration constants */ /* Control configuration constants */
#define LED_GAP 2 #define LED_GAP 2
@ -27,7 +25,7 @@
"Unknown parameter(s) for message " #msg \ "Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
#define PROGRESS_GetInfoPtr(wndPtr) ((PROGRESS_INFO *)wndPtr->wExtra) #define PROGRESS_GetInfoPtr(wndPtr) ((PROGRESS_INFO *)wndPtr->wExtra[0])
/*********************************************************************** /***********************************************************************
@ -57,25 +55,18 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
hbrBar = CreateSolidBrush32 (infoPtr->ColorBar); hbrBar = CreateSolidBrush32 (infoPtr->ColorBar);
/* get the required background brush */ /* get the required background brush */
if (infoPtr->ColorBk != CLR_DEFAULT) if (infoPtr->ColorBk == CLR_DEFAULT)
hbrBk = CreateSolidBrush32 (infoPtr->ColorBk); hbrBk = GetSysColorBrush32 (COLOR_3DFACE);
else else
hbrBk = 0; /* to keep the compiler happy ;-) */ hbrBk = CreateSolidBrush32 (infoPtr->ColorBk);
/* get rect for the bar, adjusted for the border */ /* get rect for the bar, adjusted for the border */
GetClientRect32 (wndPtr->hwndSelf, &rect); GetClientRect32 (wndPtr->hwndSelf, &rect);
/* Hack because of missing top border */
rect.top++;
/* draw the border */ /* draw the border */
if (infoPtr->ColorBk == CLR_DEFAULT) DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST);
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST|BF_MIDDLE); FillRect32(hdc, &rect, hbrBk);
else
{
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST);
FillRect32(hdc, &rect, hbrBk);
}
rect.left++; rect.right--; rect.top++; rect.bottom--; rect.left++; rect.right--; rect.top++; rect.bottom--;
/* compute extent of progress bar */ /* compute extent of progress bar */
@ -167,6 +158,10 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
switch(message) switch(message)
{ {
case WM_CREATE: case WM_CREATE:
/* allocate memory for info struct */
wndPtr->wExtra[0] = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
sizeof(PROGRESS_INFO));
infoPtr = (PROGRESS_INFO *)wndPtr->wExtra[0];
/* initialize the info struct */ /* initialize the info struct */
infoPtr->MinVal=0; infoPtr->MinVal=0;
infoPtr->MaxVal=100; infoPtr->MaxVal=100;
@ -179,6 +174,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
case WM_DESTROY: case WM_DESTROY:
TRACE(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd); TRACE(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
HeapFree (SystemHeap, 0, infoPtr);
break; break;
case WM_ERASEBKGND: case WM_ERASEBKGND:
@ -207,7 +203,6 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
PROGRESS_CoercePos(wndPtr); PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE); InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd); UpdateWindow32 (hwnd);
// PROGRESS_Paint(wndPtr, 0);
} }
return temp; return temp;
@ -311,3 +306,27 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
return 0; return 0;
} }
/***********************************************************************
* PROGRESS_Register [Internal]
*
* Registers the progress bar window class.
*
*/
void PROGRESS_Register(void)
{
WNDCLASS32A wndClass;
if( GlobalFindAtom32A( PROGRESS_CLASS32A ) ) return;
ZeroMemory( &wndClass, sizeof( WNDCLASS32A ) );
wndClass.style = CS_GLOBALCLASS | CS_VREDRAW | CS_HREDRAW;
wndClass.lpfnWndProc = (WNDPROC32)ProgressWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(PROGRESS_INFO *);
wndClass.hCursor = LoadCursor32A( 0, IDC_ARROW32A );
wndClass.lpszClassName = PROGRESS_CLASS32A;
RegisterClass32A( &wndClass );
}

View file

@ -2,10 +2,11 @@
* Interface code to StatusWindow widget/control * Interface code to StatusWindow widget/control
* *
* Copyright 1996 Bruce Milner * Copyright 1996 Bruce Milner
* Copyright 1998 Eric Kohl
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "windows.h" #include "windows.h"
#include "status.h" #include "status.h"
#include "commctrl.h" #include "commctrl.h"
@ -20,44 +21,206 @@
/* /*
* Fixme/Todo * Fixme/Todo
* 1) Add size grip to status bar - SBARS_SIZEGRIP * 1) Don't hard code bar to bottom of window, allow CCS_TOP also
* 2) Don't hard code bar to bottom of window, allow CCS_TOP also * 2) Add 'non hack' version of icon drawing code
* 3) Fix SBT_OWNERDRAW
* 4) Add DrawStatusText32A funtion
*/ */
#define __GET_ICON_INFO_HACK__
#ifdef __GET_ICON_INFO_HACK__
#include "bitmap.h"
#endif
#define _MAX(a,b) (((a)>(b))?(a):(b))
#define _MIN(a,b) (((a)>(b))?(b):(a))
#define HORZ_BORDER 0
#define VERT_BORDER 2
#define HORZ_GAP 2
static STATUSWINDOWINFO *GetStatusInfo(HWND32 hwnd) static STATUSWINDOWINFO *GetStatusInfo(HWND32 hwnd)
{ {
WND *wndPtr; WND *wndPtr;
wndPtr = WIN_FindWndPtr(hwnd); wndPtr = WIN_FindWndPtr(hwnd);
return ((STATUSWINDOWINFO *) &wndPtr->wExtra[0]); return ((STATUSWINDOWINFO *) wndPtr->wExtra[0]);
} }
static BOOL32 SW_Refresh( HWND32 hwnd, HDC32 hdc, STATUSWINDOWINFO *self )
static void
STATUS_DrawSizeGrip (HDC32 hdc, LPRECT32 lpRect)
{ {
int i; HPEN32 hOldPen;
POINT32 pt;
INT32 i;
if (!IsWindowVisible32(hwnd)) { pt.x = lpRect->right - 1;
return (TRUE); pt.y = lpRect->bottom - 1;
}
if (self->simple) { hOldPen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DFACE));
DrawStatusText32A(hdc, MoveToEx32 (hdc, pt.x - 12, pt.y, NULL);
&self->part0.bound, LineTo32 (hdc, pt.x, pt.y);
self->part0.text, LineTo32 (hdc, pt.x, pt.y - 12);
self->part0.style);
pt.x--;
pt.y--;
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
for (i = 1; i < 11; i += 4) {
MoveToEx32 (hdc, pt.x - i, pt.y, NULL);
LineTo32 (hdc, pt.x, pt.y - i);
MoveToEx32 (hdc, pt.x - i-1, pt.y, NULL);
LineTo32 (hdc, pt.x, pt.y - i-1);
}
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
for (i = 3; i < 13; i += 4) {
MoveToEx32 (hdc, pt.x - i, pt.y, NULL);
LineTo32 (hdc, pt.x, pt.y - i);
}
SelectObject32 (hdc, hOldPen);
}
static void
SB_DrawPart( HDC32 hdc, LPRECT32 lprc, HICON32 hIcon,
LPCSTR text, UINT32 style )
{
RECT32 r = *lprc;
UINT32 border = BDR_SUNKENOUTER;
if(style==SBT_POPOUT)
border = BDR_RAISEDOUTER;
else if(style==SBT_NOBORDERS)
border = 0;
DrawEdge32(hdc, &r, border, BF_RECT|BF_ADJUST);
/* draw the icon */
if (hIcon) {
#ifdef __GET_ICON_INFO_HACK__
HBITMAP32 hbmImage;
HBITMAP32 hbmMask;
CURSORICONINFO *ptr;
HDC32 hdcSrc;
INT32 y, cy, ry, ty;
if (ptr = (CURSORICONINFO *)GlobalLock16(hIcon)) {
hbmMask = CreateBitmap32 (ptr->nWidth, ptr->nHeight, 1, 1,
(char *)(ptr + 1));
hbmImage = CreateBitmap32 (ptr->nWidth, ptr->nHeight, ptr->bPlanes,
ptr->bBitsPerPixel,
(char *)(ptr + 1) + ptr->nHeight *
BITMAP_WIDTH_BYTES(ptr->nWidth, 1));
r.left += 2;
ry = r.bottom - r.top;
if (ry >= ptr->nHeight) {
/* full view of icon */
y = 0;
cy = ptr->nHeight;
ty = r.top + (ry - ptr->nHeight) / 2;
} }
else { else {
for (i = 0; i < self->numParts; i++) { /* partial view of icon */
DrawStatusText32A(hdc, y = (ptr->nHeight - ry) / 2;
&self->parts[i].bound, cy = ry;
self->parts[i].text, ty = r.top;
self->parts[i].style);
}
} }
return TRUE; hdcSrc = CreateCompatibleDC32 (hdc);
SelectObject32 (hdcSrc, hbmMask);
BitBlt32 (hdc, r.left, r.top, ptr->nWidth, cy,
hdcSrc, 0, y, SRCAND);
SelectObject32 (hdcSrc, hbmImage);
BitBlt32 (hdc, r.left, r.top, ptr->nWidth, cy,
hdcSrc, 0, y, SRCPAINT);
DeleteDC32 (hdcSrc);
r.left += ptr->nWidth;
DeleteObject32 (hbmImage);
DeleteObject32 (hbmMask);
GlobalUnlock16 (hIcon);
}
#else
/* FIXME: no "non hack" version available!!! */
#endif
}
/* now draw text */
if (text) {
int oldbkmode = SetBkMode32(hdc, TRANSPARENT);
r.left += 3;
DrawText32A(hdc, text, lstrlen32A(text),
&r, DT_LEFT|DT_VCENTER|DT_SINGLELINE);
if (oldbkmode != TRANSPARENT)
SetBkMode32(hdc, oldbkmode);
}
}
static BOOL32
SW_Refresh( HWND32 hwnd, HDC32 hdc, STATUSWINDOWINFO *self )
{
int i;
RECT32 rect;
HBRUSH32 hbrBk;
WND *wndPtr;
wndPtr = WIN_FindWndPtr(hwnd);
if (!IsWindowVisible32(hwnd)) {
return (TRUE);
}
GetClientRect32 (hwnd, &rect);
if (self->clrBk != CLR_DEFAULT)
hbrBk = CreateSolidBrush32 (self->clrBk);
else
hbrBk = GetSysColorBrush32 (COLOR_3DFACE);
FillRect32(hdc, &rect, hbrBk);
if (self->simple) {
SB_DrawPart (hdc,
&self->part0.bound,
self->part0.hIcon,
self->part0.text,
self->part0.style);
}
else {
for (i = 0; i < self->numParts; i++) {
if (self->parts[i].style == SBT_OWNERDRAW) {
DRAWITEMSTRUCT32 dis;
WND *wndPtr = WIN_FindWndPtr(hwnd);
dis.CtlID = wndPtr->wIDmenu;
dis.itemID = -1;
dis.hwndItem = hwnd;
dis.hDC = hdc;
dis.rcItem = self->part0.bound;
dis.itemData = (INT32)self->part0.text;
SendMessage32A (GetParent32 (hwnd), WM_DRAWITEM,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&dis);
}
else
SB_DrawPart (hdc,
&self->parts[i].bound,
self->parts[i].hIcon,
self->parts[i].text,
self->parts[i].style);
}
}
if (self->clrBk != CLR_DEFAULT)
DeleteObject32 (hbrBk);
if (wndPtr->dwStyle & SBARS_SIZEGRIP)
STATUS_DrawSizeGrip (hdc, &rect);
return TRUE;
} }
@ -66,11 +229,10 @@ SW_GetBorders(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lPara
{ {
LPINT32 out; LPINT32 out;
/* FIXME for sizegrips */
out = (LPINT32) lParam; out = (LPINT32) lParam;
out[0] = 1; /* vertical border width */ out[0] = HORZ_BORDER; /* horizontal border width */
out[1] = 1; /* horizontal border width */ out[1] = VERT_BORDER; /* vertical border width */
out[2] = 1; /* width of border between rectangles */ out[2] = HORZ_GAP; /* width of border between rectangles */
return TRUE; return TRUE;
} }
@ -80,11 +242,12 @@ SW_SetPartBounds(HWND32 hwnd, STATUSWINDOWINFO *self)
int i; int i;
RECT32 rect, *r; RECT32 rect, *r;
STATUSWINDOWPART *part; STATUSWINDOWPART *part;
int sep = 1;
/* get our window size */ /* get our window size */
GetClientRect32(hwnd, &rect); GetClientRect32(hwnd, &rect);
rect.top += VERT_BORDER;
/* set bounds for simple rectangle */ /* set bounds for simple rectangle */
self->part0.bound = rect; self->part0.bound = rect;
@ -97,7 +260,7 @@ SW_SetPartBounds(HWND32 hwnd, STATUSWINDOWINFO *self)
if (i == 0) if (i == 0)
r->left = 0; r->left = 0;
else else
r->left = self->parts[i-1].bound.right+sep; r->left = self->parts[i-1].bound.right + HORZ_GAP;
if (part->x == -1) if (part->x == -1)
r->right = rect.right; r->right = rect.right;
else else
@ -204,17 +367,26 @@ SW_GetParts(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
} }
static LRESULT static LRESULT
SW_Create(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam) SW_Create(HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{ {
RECT32 rect; RECT32 rect;
LPCREATESTRUCT32A lpCreate = (LPCREATESTRUCT32A) lParam; LPCREATESTRUCT32A lpCreate = (LPCREATESTRUCT32A) lParam;
int height, width; int height, width, len;
HDC32 hdc; HDC32 hdc;
HWND32 parent; HWND32 parent;
WND *wndPtr;
STATUSWINDOWINFO *self;
self->numParts = 0; wndPtr = WIN_FindWndPtr(hwnd);
wndPtr->wExtra[0] = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
sizeof(STATUSWINDOWINFO));
self = (STATUSWINDOWINFO*)wndPtr->wExtra[0];
self->numParts = 1;
self->parts = 0; self->parts = 0;
self->simple = TRUE; self->simple = FALSE;
self->clrBk = CLR_DEFAULT;
self->hFont = 0;
GetClientRect32(hwnd, &rect); GetClientRect32(hwnd, &rect);
/* initialize simple case */ /* initialize simple case */
@ -222,8 +394,23 @@ SW_Create(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
self->part0.text = 0; self->part0.text = 0;
self->part0.x = 0; self->part0.x = 0;
self->part0.style = 0; self->part0.style = 0;
self->part0.hIcon = 0;
height = 40; /* initialize first part */
self->parts = HeapAlloc(SystemHeap, HEAP_ZERO_MEMORY,
sizeof(STATUSWINDOWPART));
self->parts[0].bound = rect;
self->parts[0].text = 0;
self->parts[0].x = -1;
self->parts[0].style = 0;
self->parts[0].hIcon = 0;
if (len = lstrlen32A( lpCreate->lpszName ) ) {
self->parts[0].text = HeapAlloc( SystemHeap, 0, len + 1 );
lstrcpy32A( self->parts[0].text, lpCreate->lpszName );
}
height = 20;
if ((hdc = GetDC32(0))) { if ((hdc = GetDC32(0))) {
TEXTMETRIC32A tm; TEXTMETRIC32A tm;
GetTextMetrics32A(hdc, &tm); GetTextMetrics32A(hdc, &tm);
@ -234,8 +421,8 @@ SW_Create(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
parent = GetParent32(hwnd); parent = GetParent32(hwnd);
GetClientRect32(parent, &rect); GetClientRect32(parent, &rect);
width = rect.right - rect.left; width = rect.right - rect.left;
height = (self->textHeight * 3)/2; self->height = self->textHeight + 4 + VERT_BORDER;
MoveWindow32(hwnd, lpCreate->x, lpCreate->y-1, width, height, FALSE); MoveWindow32(hwnd, lpCreate->x, lpCreate->y-1, width, self->height, FALSE);
SW_SetPartBounds(hwnd, self); SW_SetPartBounds(hwnd, self);
return 0; return 0;
} }
@ -308,25 +495,242 @@ SW_GetTextLength(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lP
static LRESULT static LRESULT
SW_SetMinHeight(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam) SW_SetMinHeight(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{ {
/* FIXME */ INT32 width, height, x, y;
/* size is wParam | 2*pixels_of_horz_border */ RECT32 parent_rect;
HWND32 parent;
if (IsWindowVisible32 (hwnd)) {
/* width and height don't apply */
parent = GetParent32(hwnd);
GetClientRect32(parent, &parent_rect);
self->height = (INT32)wParam + VERT_BORDER;
width = parent_rect.right - parent_rect.left;
x = parent_rect.left;
y = parent_rect.bottom - self->height;
MoveWindow32(hwnd, parent_rect.left, parent_rect.bottom - self->height,
width, self->height, TRUE);
SW_SetPartBounds(hwnd, self);
}
return TRUE; return TRUE;
} }
static LRESULT
SW_SetBkColor(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
COLORREF oldBkColor;
HDC32 hdc;
oldBkColor = self->clrBk;
self->clrBk = (COLORREF)lParam;
hdc = GetDC32(hwnd);
SW_Refresh(hwnd, hdc, self);
ReleaseDC32(hwnd, hdc);
return oldBkColor;
}
static LRESULT
SW_SetIcon(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
HDC32 hdc;
INT32 nPart;
nPart = (INT32)wParam & 0x00ff;
if ((nPart < -1) || (nPart >= self->numParts)) return FALSE;
if (nPart == -1) {
self->part0.hIcon = (HICON32)lParam;
if (self->simple)
InvalidateRect32(hwnd, &self->part0.bound, FALSE);
}
else {
self->parts[nPart].hIcon = (HICON32)lParam;
if (!(self->simple))
InvalidateRect32(hwnd, &self->parts[nPart].bound, FALSE);
}
return TRUE;
}
static LRESULT
SW_GetIcon(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
INT32 nPart;
nPart = (INT32)wParam & 0x00ff;
if ((nPart < -1) || (nPart >= self->numParts)) return NULL;
if (nPart == -1)
return (self->part0.hIcon);
else
return (self->parts[nPart].hIcon);
}
static LRESULT static LRESULT
SW_Simple(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam) SW_Simple(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{ {
WND *wndPtr;
BOOL32 simple; BOOL32 simple;
HDC32 hdc; HDC32 hdc;
NMHDR nmhdr;
wndPtr = WIN_FindWndPtr(hwnd);
simple = (BOOL32) wParam; simple = (BOOL32) wParam;
self->simple = simple; self->simple = simple;
/* send notification */
nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = wndPtr->wIDmenu;
nmhdr.code = SBN_SIMPLEMODECHANGE;
SendMessage32A (GetParent32 (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);
hdc = GetDC32(hwnd); hdc = GetDC32(hwnd);
SW_Refresh(hwnd, hdc, self); SW_Refresh(hwnd, hdc, self);
ReleaseDC32(hwnd, hdc); ReleaseDC32(hwnd, hdc);
return TRUE; return TRUE;
} }
static LRESULT
SW_Destroy(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
int i;
for (i = 0; i < self->numParts; i++) {
if (self->parts[i].text && (self->parts[i].style != SBT_OWNERDRAW))
HeapFree(SystemHeap, 0, self->parts[i].text);
}
if (self->part0.text && (self->part0.style != SBT_OWNERDRAW))
HeapFree(SystemHeap, 0, self->part0.text);
HeapFree(SystemHeap, 0, self->parts);
HeapFree(SystemHeap, 0, self);
return 0;
}
static LRESULT
SW_WMGetText (STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
INT32 len;
if (!(self->parts[0].text))
return 0;
len = lstrlen32A (self->parts[0].text);
if (wParam > len) {
lstrcpy32A ((LPSTR)lParam, self->parts[0].text);
return len;
}
else
return -1;
}
static LRESULT
SW_WMGetTextLength (STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
if (!(self->parts[0].text))
return 0;
return (lstrlen32A (self->parts[0].text));
}
static LRESULT
SW_NcHitTest (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
RECT32 rect;
POINT32 pt;
if (wndPtr->dwStyle & SBARS_SIZEGRIP) {
GetClientRect32 (wndPtr->hwndSelf, &rect);
pt.x = (INT32)LOWORD(lParam);
pt.y = (INT32)HIWORD(lParam);
ScreenToClient32 (wndPtr->hwndSelf, &pt);
rect.left = rect.right - 13;
rect.top += 2;
if (PtInRect32 (&rect, pt))
return HTBOTTOMRIGHT;
}
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCHITTEST, wParam, lParam);
}
static LRESULT
SW_NcLButtonDown (HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
// TRACE (status, "WM_NCLBUTTONDOWN\n");
PostMessage32A (GetParent32 (hwnd), WM_NCLBUTTONDOWN,
wParam, lParam);
return 0;
}
static LRESULT
SW_NcLButtonUp (HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
// TRACE (status, "WM_NCLBUTTONUP\n");
PostMessage32A (GetParent32 (hwnd), WM_NCLBUTTONUP,
wParam, lParam);
return 0;
}
static LRESULT
SW_Paint(STATUSWINDOWINFO *self, HWND32 hwnd)
{
HDC32 hdc;
PAINTSTRUCT32 ps;
hdc = BeginPaint32(hwnd, &ps);
SW_Refresh(hwnd, hdc, self);
EndPaint32(hwnd, &ps);
return 0;
}
static LRESULT
SW_WMSetFont (STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
HDC32 hdc;
self->hFont = (HFONT32)wParam;
if (LOWORD(lParam) == TRUE) {
hdc = GetDC32(hwnd);
SW_Refresh(hwnd, hdc, self);
ReleaseDC32(hwnd, hdc);
}
return 0;
}
static LRESULT
SW_WMSetText (STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
int len;
STATUSWINDOWPART *part;
if (self->numParts == 0) return FALSE;
part = &self->parts[0];
/* duplicate string */
if (part->text)
HeapFree(SystemHeap, 0, part->text);
part->text = 0;
if (lParam && (len = lstrlen32A((LPCSTR)lParam))) {
part->text = HeapAlloc(SystemHeap, 0, len+1);
lstrcpy32A(part->text, (LPCSTR)lParam);
}
InvalidateRect32(hwnd, &part->bound, FALSE);
return TRUE;
}
static LRESULT static LRESULT
SW_Size(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam) SW_Size(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{ {
@ -347,56 +751,48 @@ SW_Size(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
/* width and height don't apply */ /* width and height don't apply */
parent = GetParent32(hwnd); parent = GetParent32(hwnd);
GetClientRect32(parent, &parent_rect); GetClientRect32(parent, &parent_rect);
height = (self->textHeight * 3)/2;
width = parent_rect.right - parent_rect.left; width = parent_rect.right - parent_rect.left;
x = parent_rect.left; x = parent_rect.left;
y = parent_rect.bottom - height; y = parent_rect.bottom - self->height;
MoveWindow32(hwnd, parent_rect.left, parent_rect.bottom - height - 1, MoveWindow32(hwnd, parent_rect.left, parent_rect.bottom - self->height,
width, height, TRUE); width, self->height, TRUE);
SW_SetPartBounds(hwnd, self); SW_SetPartBounds(hwnd, self);
} }
return 0; return 0;
} }
static LRESULT
SW_Destroy(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
{
int i;
for (i = 0; i < self->numParts; i++) { static LRESULT
if (self->parts[i].text && (self->parts[i].style != SBT_OWNERDRAW)) SW_SendNotify (HWND32 hwnd, UINT32 code)
HeapFree(SystemHeap, 0, self->parts[i].text); {
} WND *wndPtr;
if (self->part0.text && (self->part0.style != SBT_OWNERDRAW)) NMHDR nmhdr;
HeapFree(SystemHeap, 0, self->part0.text);
HeapFree(SystemHeap, 0, self->parts); wndPtr = WIN_FindWndPtr(hwnd);
nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = wndPtr->wIDmenu;
nmhdr.code = code;
SendMessage32A (GetParent32 (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);
return 0; return 0;
} }
static LRESULT LRESULT WINAPI
SW_Paint(STATUSWINDOWINFO *self, HWND32 hwnd) StatusWindowProc (HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam)
{
HDC32 hdc;
PAINTSTRUCT32 ps;
hdc = BeginPaint32(hwnd, &ps);
SW_Refresh(hwnd, hdc, self);
EndPaint32(hwnd, &ps);
return 0;
}
LRESULT WINAPI StatusWindowProc( HWND32 hwnd, UINT32 msg,
WPARAM32 wParam, LPARAM lParam )
{ {
STATUSWINDOWINFO *self; STATUSWINDOWINFO *self;
WND *wndPtr;
wndPtr = WIN_FindWndPtr(hwnd);
self = GetStatusInfo(hwnd); self = GetStatusInfo(hwnd);
switch (msg) { switch (msg) {
case SB_GETBORDERS: case SB_GETBORDERS:
return SW_GetBorders(self, hwnd, wParam, lParam); return SW_GetBorders(self, hwnd, wParam, lParam);
case SB_GETICON:
return SW_GetIcon(self, hwnd, wParam, lParam);
case SB_GETPARTS: case SB_GETPARTS:
return SW_GetParts(self, hwnd, wParam, lParam); return SW_GetParts(self, hwnd, wParam, lParam);
case SB_GETRECT: case SB_GETRECT:
@ -405,6 +801,12 @@ LRESULT WINAPI StatusWindowProc( HWND32 hwnd, UINT32 msg,
return SW_GetText(self, hwnd, wParam, lParam); return SW_GetText(self, hwnd, wParam, lParam);
case SB_GETTEXTLENGTH32A: case SB_GETTEXTLENGTH32A:
return SW_GetTextLength(self, hwnd, wParam, lParam); return SW_GetTextLength(self, hwnd, wParam, lParam);
case SB_ISSIMPLE:
return self->simple;
case SB_SETBKCOLOR:
return SW_SetBkColor(self, hwnd, wParam, lParam);
case SB_SETICON:
return SW_SetIcon(self, hwnd, wParam, lParam);
case SB_SETMINHEIGHT: case SB_SETMINHEIGHT:
return SW_SetMinHeight(self, hwnd, wParam, lParam); return SW_SetMinHeight(self, hwnd, wParam, lParam);
case SB_SETPARTS: case SB_SETPARTS:
@ -415,18 +817,70 @@ LRESULT WINAPI StatusWindowProc( HWND32 hwnd, UINT32 msg,
return SW_Simple(self, hwnd, wParam, lParam); return SW_Simple(self, hwnd, wParam, lParam);
case WM_CREATE: case WM_CREATE:
return SW_Create(self, hwnd, wParam, lParam); return SW_Create(hwnd, wParam, lParam);
case WM_DESTROY: case WM_DESTROY:
return SW_Destroy(self, hwnd, wParam, lParam); return SW_Destroy(self, hwnd, wParam, lParam);
case WM_GETFONT:
return self->hFont;
case WM_GETTEXT:
return SW_WMGetText(self, hwnd, wParam, lParam);
case WM_GETTEXTLENGTH:
return SW_WMGetTextLength(self, hwnd, wParam, lParam);
case WM_LBUTTONDBLCLK:
return SW_SendNotify (hwnd, NM_DBLCLK);
case WM_LBUTTONUP:
return SW_SendNotify (hwnd, NM_CLICK);
case WM_NCHITTEST:
return SW_NcHitTest (wndPtr, wParam, lParam);
case WM_NCLBUTTONDOWN:
return SW_NcLButtonDown (hwnd, wParam, lParam);
case WM_NCLBUTTONUP:
return SW_NcLButtonUp (hwnd, wParam, lParam);
case WM_PAINT: case WM_PAINT:
return SW_Paint(self, hwnd); return SW_Paint(self, hwnd);
case WM_RBUTTONDBLCLK:
return SW_SendNotify (hwnd, NM_RDBLCLK);
case WM_RBUTTONUP:
return SW_SendNotify (hwnd, NM_RCLICK);
case WM_SETFONT:
return SW_WMSetFont(self, hwnd, wParam, lParam);
case WM_SETTEXT:
return SW_WMSetText(self, hwnd, wParam, lParam);
case WM_SIZE: case WM_SIZE:
return SW_Size(self, hwnd, wParam, lParam); return SW_Size(self, hwnd, wParam, lParam);
default: default:
return DefWindowProc32A(hwnd, msg, wParam, lParam); return DefWindowProc32A (hwnd, msg, wParam, lParam);
} }
return 0; return 0;
} }
/***********************************************************************
* STATUS_Register [Internal]
*
* Registers the status window class.
*/
void STATUS_Register(void)
{
WNDCLASS32A wndClass;
if( GlobalFindAtom32A( STATUSCLASSNAME32A ) ) return;
ZeroMemory( &wndClass, sizeof( WNDCLASS32A ) );
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
wndClass.lpfnWndProc = (WNDPROC32)StatusWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(STATUSWINDOWINFO *);
wndClass.hCursor = LoadCursor32A( 0, IDC_ARROW32A );
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
wndClass.lpszClassName = STATUSCLASSNAME32A;
RegisterClass32A( &wndClass );
}

View file

@ -785,3 +785,26 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
return 0; return 0;
} }
/***********************************************************************
* UPDOWN_Register [Internal]
*
* Registers the updown window class.
*/
void UPDOWN_Register(void)
{
WNDCLASS32A wndClass;
if( GlobalFindAtom32A( UPDOWN_CLASS32A ) ) return;
ZeroMemory( &wndClass, sizeof( WNDCLASS32A ) );
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
wndClass.lpfnWndProc = (WNDPROC32)UpDownWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(UPDOWN_INFO);
wndClass.hCursor = LoadCursor32A( 0, IDC_ARROW32A );
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
wndClass.lpszClassName = UPDOWN_CLASS32A;
RegisterClass32A( &wndClass );
}

View file

@ -343,7 +343,7 @@ void DEBUG_AddModuleBreakpoints(void)
for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry)) for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry))
{ {
if (!(pModule = MODULE_GetPtr16( entry.hModule ))) continue; if (!(pModule = NE_GetPtr( entry.hModule ))) continue;
if (pModule->flags & NE_FFLAGS_LIBMODULE) continue; /* Library */ if (pModule->flags & NE_FFLAGS_LIBMODULE) continue; /* Library */
if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */ if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */

View file

@ -548,24 +548,16 @@ static void DEBUG_Main( int signal )
} }
/***********************************************************************
* DebugBreak32 (KERNEL32)
*/
void DebugBreak32( CONTEXT *regs )
{
const char *module = MODULE_GetModuleName( GetCurrentTask() );
fprintf( stderr, "%s called DebugBreak\n", module ? module : "???" );
DEBUG_context = *regs;
DEBUG_Main( SIGTRAP );
}
/*********************************************************************** /***********************************************************************
* DebugBreak16 (KERNEL.203) * DebugBreak (KERNEL.203) (KERNEL32.181)
*/ */
void DebugBreak16( CONTEXT *regs ) void DebugBreak( CONTEXT *regs )
{ {
const char *module = MODULE_GetModuleName( GetCurrentTask() ); char module[10];
fprintf( stderr, "%s called DebugBreak\n", module ? module : "???" ); if (!GetModuleName( GetCurrentTask(), module, sizeof(module) ))
strcpy( module, "???" );
fprintf( stderr, "%s called DebugBreak\n", module );
DEBUG_context = *regs; DEBUG_context = *regs;
DEBUG_Main( SIGTRAP ); DEBUG_Main( SIGTRAP );
} }

View file

@ -50,11 +50,6 @@ HMODULE16 GetExePtr(HANDLE16 h)
exit(0); exit(0);
} }
LPSTR MODULE_GetModuleName( HMODULE16 hModule )
{
exit(0);
}
int PROFILE_GetWineIniString( const char *section, const char *key_name, int PROFILE_GetWineIniString( const char *section, const char *key_name,
const char *def, char *buffer, int len ) const char *def, char *buffer, int len )
{ {
@ -103,7 +98,7 @@ void WIN_WalkWindows( HWND32 hwnd, int indent )
exit(0); exit(0);
} }
NE_MODULE *MODULE_GetPtr16( HMODULE16 hModule ) NE_MODULE *NE_GetPtr( HMODULE16 hModule )
{ {
exit(0); exit(0);
} }

View file

@ -877,7 +877,7 @@ void DEBUG_LoadEntryPoints(void)
for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry)) for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry))
{ {
if (!(pModule = MODULE_GetPtr16( entry.hModule ))) continue; if (!(pModule = NE_GetPtr( entry.hModule ))) continue;
fprintf( stderr, " %s", entry.szModule ); fprintf( stderr, " %s", entry.szModule );
if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */ if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */

View file

@ -1144,7 +1144,7 @@ DEBUG_ProcessElfObject(char * filename, unsigned int load_offset)
*/ */
ehptr = (Elf32_Ehdr *) addr; ehptr = (Elf32_Ehdr *) addr;
if( load_offset == NULL ) if( load_offset == 0 )
{ {
DEBUG_RegisterELFDebugInfo(ehptr->e_entry, statbuf.st_size, filename); DEBUG_RegisterELFDebugInfo(ehptr->e_entry, statbuf.st_size, filename);
} }
@ -1271,7 +1271,7 @@ DEBUG_ReadExecutableDbgInfo(void)
} }
if( (dynpnt->d_tag != DT_DEBUG) if( (dynpnt->d_tag != DT_DEBUG)
|| (dynpnt->d_un.d_ptr == NULL) ) || (dynpnt->d_un.d_ptr == 0) )
{ {
goto leave; goto leave;
} }
@ -1296,7 +1296,7 @@ DEBUG_ReadExecutableDbgInfo(void)
* shared libraries which may be loaded. * shared libraries which may be loaded.
*/ */
ehdr = (Elf32_Ehdr *) lpnt->l_addr; ehdr = (Elf32_Ehdr *) lpnt->l_addr;
if( (lpnt->l_addr == NULL) || (ehdr->e_type != ET_DYN) ) if( (lpnt->l_addr == 0) || (ehdr->e_type != ET_DYN) )
{ {
continue; continue;
} }

12
documentation/programs Normal file
View file

@ -0,0 +1,12 @@
May, 1998 Matthew Becker (mbecker@glasscity.net
Help, this does not work! What am I missing?
How to add a new test program
- create the directory under .../programs
- add the directory to WINEROOT/programs/Makefile.in
- add the directory to WINEROOT/configure.in
- when creating the diff, use -N to force the entire text to be included in
the diff

View file

@ -14,6 +14,7 @@
#include "windows.h" #include "windows.h"
#include "winerror.h" #include "winerror.h"
#include "process.h"
#include "drive.h" #include "drive.h"
#include "file.h" #include "file.h"
#include "heap.h" #include "heap.h"
@ -454,13 +455,20 @@ done:
*/ */
static BOOL32 DIR_TryModulePath( LPCSTR name, DOS_FULL_NAME *full_name ) static BOOL32 DIR_TryModulePath( LPCSTR name, DOS_FULL_NAME *full_name )
{ {
PDB32 *pdb = PROCESS_Current();
/* FIXME: for now, GetModuleFileName32A can't return more */ /* FIXME: for now, GetModuleFileName32A can't return more */
/* than OFS_MAXPATHNAME. This may change with Win32. */ /* than OFS_MAXPATHNAME. This may change with Win32. */
char buffer[OFS_MAXPATHNAME]; char buffer[OFS_MAXPATHNAME];
LPSTR p; LPSTR p;
if (!GetCurrentTask()) return FALSE; if (pdb->flags & PDB32_WIN16_PROC) {
GetModuleFileName32A( GetCurrentTask(), buffer, sizeof(buffer) ); if (!GetCurrentTask()) return FALSE;
GetModuleFileName16( GetCurrentTask(), buffer, sizeof(buffer) );
} else {
GetModuleFileName32A( 0, buffer, sizeof(buffer) );
}
if (!(p = strrchr( buffer, '\\' ))) return FALSE; if (!(p = strrchr( buffer, '\\' ))) return FALSE;
if (sizeof(buffer) - (++p - buffer) <= strlen(name)) return FALSE; if (sizeof(buffer) - (++p - buffer) <= strlen(name)) return FALSE;
strcpy( p, name ); strcpy( p, name );

View file

@ -18,9 +18,6 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#include "windows.h" #include "windows.h"
#include "winerror.h" #include "winerror.h"
@ -619,7 +616,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
break; break;
} }
} }
/* FIXME: the rest of the devices ... lptX, comX et.al. */ FIXME(dosfs,"device open %s not supported (yet)\n",DOSFS_Devices[i]);
return HFILE_ERROR32; return HFILE_ERROR32;
} }
} }
@ -837,7 +834,7 @@ DWORD WINAPI GetLongPathName32A( LPCSTR shortpath, LPSTR longpath,
{ {
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
/* FIXME: is it correct to always return a fully qualified short path? */ /* FIXME: Is it correct to return a UNIX style path here? */
if (!DOSFS_GetFullName( shortpath, TRUE, &full_name )) return 0; if (!DOSFS_GetFullName( shortpath, TRUE, &full_name )) return 0;
lstrcpyn32A( longpath, full_name.long_name, longlen ); lstrcpyn32A( longpath, full_name.long_name, longlen );
return strlen( full_name.long_name ); return strlen( full_name.long_name );

View file

@ -16,17 +16,19 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_MOUNT_H #ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/mount.h> # include <sys/vfs.h>
#endif #else
#ifdef HAVE_SYS_STATFS_H # ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/statfs.h> # include <sys/mount.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif #endif
#include "windows.h" #include "windows.h"

View file

@ -494,7 +494,7 @@ static INT32 PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name,
section = section->next; section = section->next;
} }
buffer[0] = buffer[1] = '\0'; buffer[0] = buffer[1] = '\0';
return 2; return 0;
} }

View file

@ -144,7 +144,7 @@ static void _dump_DDBLTFAST(DWORD flagmask) {
}; };
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++) for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask) if (flags[i].mask & flagmask)
DUMP("%s ",i,flags[i].name); DUMP("%s ",flags[i].name);
DUMP("\n"); DUMP("\n");
} }
@ -184,7 +184,7 @@ static void _dump_DDBLT(DWORD flagmask) {
}; };
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++) for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask) if (flags[i].mask & flagmask)
DUMP("%s ",i,flags[i].name); DUMP("%s ",flags[i].name);
} }
static void _dump_DDSCAPS(DWORD flagmask) { static void _dump_DDSCAPS(DWORD flagmask) {
@ -231,7 +231,7 @@ static void _dump_DDSCAPS(DWORD flagmask) {
DUMP("\n"); DUMP("\n");
} }
static void _dump_DDCAPS(DWORD flagmask) { void _dump_DDCAPS(DWORD flagmask) {
int i; int i;
const struct { const struct {
DWORD mask; DWORD mask;
@ -302,7 +302,7 @@ static void _dump_DDSD(DWORD flagmask) {
}; };
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++) for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
if (flags[i].mask & flagmask) if (flags[i].mask & flagmask)
DUMP("%s ",i,flags[i].name); DUMP("%s ",flags[i].name);
DUMP("\n"); DUMP("\n");
} }
@ -1031,6 +1031,29 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
this->palents[i].peBlue = palent[i-start].peBlue; this->palents[i].peBlue = palent[i-start].peBlue;
this->palents[i].peGreen = palent[i-start].peGreen; this->palents[i].peGreen = palent[i-start].peGreen;
} }
/* Insomnia's (Stea Greene's) Mods Start Here */
/* FIXME: Still should free individual cells, but this fixes loss of */
/* unchange sections of old palette */
for (i=0;i<start;i++) {
xc.red = this->palents[i].peRed<<8;
xc.blue = this->palents[i].peBlue<<8;
xc.green = this->palents[i].peGreen<<8;
xc.flags = DoRed|DoBlue|DoGreen;
xc.pixel = i;
TSXStoreColor(display,this->cm,&xc);
}
for (i=end;i<256;i++) {
xc.red = this->palents[i].peRed<<8;
xc.blue = this->palents[i].peBlue<<8;
xc.green = this->palents[i].peGreen<<8;
xc.flags = DoRed|DoBlue|DoGreen;
xc.pixel = i;
TSXStoreColor(display,this->cm,&xc);
}
/* End Insomnia's Mods */
XF86DGAInstallColormap(display,DefaultScreen(display),this->cm); XF86DGAInstallColormap(display,DefaultScreen(display),this->cm);
return 0; return 0;
} }
@ -1248,7 +1271,6 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
LPDIRECTDRAW this,DWORD width,DWORD height,DWORD depth LPDIRECTDRAW this,DWORD width,DWORD height,DWORD depth
) { ) {
int i,*depths,depcount; int i,*depths,depcount;
char buf[200];
TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n", TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n",
this, width, height, depth); this, width, height, depth);

View file

@ -56,35 +56,13 @@ BOOL16 WINAPI DPtoLP16( HDC16 hdc, LPPOINT16 points, INT16 count )
*/ */
BOOL32 WINAPI DPtoLP32( HDC32 hdc, LPPOINT32 points, INT32 count ) BOOL32 WINAPI DPtoLP32( HDC32 hdc, LPPOINT32 points, INT32 count )
{ {
FLOAT determinant=1.0, x, y;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE; if (!dc) return FALSE;
if (dc->w.UseWorldXform)
{
determinant = dc->w.WorldXform.eM11*dc->w.WorldXform.eM22 -
dc->w.WorldXform.eM12*dc->w.WorldXform.eM21;
if (determinant > -1e-12 && determinant < 1e-12)
return FALSE;
}
while (count--) while (count--)
{ {
if (dc->w.UseWorldXform) if (!INTERNAL_DPTOLP( dc, points ))
{ return FALSE;
x = (FLOAT)XDPTOLP( dc, points->x ) - dc->w.WorldXform.eDx;
y = (FLOAT)YDPTOLP( dc, points->y ) - dc->w.WorldXform.eDy;
points->x = (INT32)( (x*dc->w.WorldXform.eM22 -
y*dc->w.WorldXform.eM21) / determinant );
points->y = (INT32)( (-x*dc->w.WorldXform.eM12 +
y*dc->w.WorldXform.eM11) / determinant );
}
else
{
points->x = XDPTOLP( dc, points->x );
points->y = YDPTOLP( dc, points->y );
}
points++; points++;
} }
return TRUE; return TRUE;
@ -114,30 +92,12 @@ BOOL16 WINAPI LPtoDP16( HDC16 hdc, LPPOINT16 points, INT16 count )
*/ */
BOOL32 WINAPI LPtoDP32( HDC32 hdc, LPPOINT32 points, INT32 count ) BOOL32 WINAPI LPtoDP32( HDC32 hdc, LPPOINT32 points, INT32 count )
{ {
FLOAT x, y;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE; if (!dc) return FALSE;
while (count--) while (count--)
{ {
if (dc->w.UseWorldXform) INTERNAL_LPTODP( dc, points );
{
x = (FLOAT)points->x * dc->w.WorldXform.eM11 +
(FLOAT)points->y * dc->w.WorldXform.eM21 +
dc->w.WorldXform.eDx;
y = (FLOAT)points->x * dc->w.WorldXform.eM12 +
(FLOAT)points->y * dc->w.WorldXform.eM22 +
dc->w.WorldXform.eDy;
points->x = XLPTODP( dc, (INT32)x );
points->y = YLPTODP( dc, (INT32)y );
}
else
{
points->x = XLPTODP( dc, points->x );
points->y = YLPTODP( dc, points->y );
}
points++; points++;
} }
return TRUE; return TRUE;
@ -230,6 +190,7 @@ INT32 WINAPI SetMapMode32( HDC32 hdc, INT32 mode )
return prevMode; return prevMode;
} }
dc->w.MapMode = mode; dc->w.MapMode = mode;
DC_UpdateXforms( dc );
return prevMode; return prevMode;
} }
@ -277,6 +238,7 @@ BOOL32 WINAPI SetViewportExtEx32( HDC32 hdc, INT32 x, INT32 y, LPSIZE32 size )
dc->vportExtX = x; dc->vportExtX = x;
dc->vportExtY = y; dc->vportExtY = y;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc ); if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -320,6 +282,7 @@ BOOL32 WINAPI SetViewportOrgEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt )
} }
dc->vportOrgX = x; dc->vportOrgX = x;
dc->vportOrgY = y; dc->vportOrgY = y;
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -366,6 +329,7 @@ BOOL32 WINAPI SetWindowExtEx32( HDC32 hdc, INT32 x, INT32 y, LPSIZE32 size )
dc->wndExtX = x; dc->wndExtX = x;
dc->wndExtY = y; dc->wndExtY = y;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc ); if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -408,6 +372,7 @@ BOOL32 WINAPI SetWindowOrgEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt )
} }
dc->wndOrgX = x; dc->wndOrgX = x;
dc->wndOrgY = y; dc->wndOrgY = y;
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -451,6 +416,7 @@ BOOL32 WINAPI OffsetViewportOrgEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt)
} }
dc->vportOrgX += x; dc->vportOrgX += x;
dc->vportOrgY += y; dc->vportOrgY += y;
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -494,6 +460,7 @@ BOOL32 WINAPI OffsetWindowOrgEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt )
} }
dc->wndOrgX += x; dc->wndOrgX += x;
dc->wndOrgY += y; dc->wndOrgY += y;
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -548,6 +515,7 @@ BOOL32 WINAPI ScaleViewportExtEx32( HDC32 hdc, INT32 xNum, INT32 xDenom,
if (dc->vportExtX == 0) dc->vportExtX = 1; if (dc->vportExtX == 0) dc->vportExtX = 1;
if (dc->vportExtY == 0) dc->vportExtY = 1; if (dc->vportExtY == 0) dc->vportExtY = 1;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc ); if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }
@ -602,5 +570,6 @@ BOOL32 WINAPI ScaleWindowExtEx32( HDC32 hdc, INT32 xNum, INT32 xDenom,
if (dc->wndExtX == 0) dc->wndExtX = 1; if (dc->wndExtX == 0) dc->wndExtX = 1;
if (dc->wndExtY == 0) dc->wndExtY = 1; if (dc->wndExtY == 0) dc->wndExtY = 1;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc ); if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
DC_UpdateXforms( dc );
return TRUE; return TRUE;
} }

View file

@ -270,7 +270,7 @@ HMETAFILE32 WINAPI CloseMetaFile32(
HDC32 hdc /* Metafile DC to close */ HDC32 hdc /* Metafile DC to close */
) )
{ {
return CloseMetaFile32(hdc); return CloseMetaFile16(hdc);
} }

View file

@ -219,6 +219,10 @@ BOOL32 WINAPI Rectangle32( HDC32 hdc, INT32 left, INT32 top,
{ {
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if(dc && PATH_IsPathOpen(dc->w.path))
if(!PATH_Rectangle(hdc, left, top, right, bottom))
return FALSE;
return dc && dc->funcs->pRectangle && return dc && dc->funcs->pRectangle &&
dc->funcs->pRectangle(dc,left,top,right,bottom); dc->funcs->pRectangle(dc,left,top,right,bottom);
} }
@ -959,7 +963,8 @@ static BOOL32 PAINTING_DrawState32(HDC32 hdc, HBRUSH32 hbr,
/* before it is displayed */ /* before it is displayed */
fg = SetTextColor32(hdc, RGB(0, 0, 0)); fg = SetTextColor32(hdc, RGB(0, 0, 0));
bg = SetBkColor32(hdc, RGB(255, 255, 255)); bg = SetBkColor32(hdc, RGB(255, 255, 255));
hbm = NULL; hbmsave = NULL; memdc = NULL; memdc = NULL; hbsave = NULL; hbm = (HBITMAP32)NULL; hbmsave = (HBITMAP32)NULL;
memdc = (HDC32)NULL; hbsave = (HBRUSH32)NULL;
retval = FALSE; /* assume failure */ retval = FALSE; /* assume failure */
/* From here on we must use "goto cleanup" when something goes wrong */ /* From here on we must use "goto cleanup" when something goes wrong */

View file

@ -62,15 +62,16 @@
static BOOL32 PATH_PathToRegion(const GdiPath *pPath, INT32 nPolyFillMode, static BOOL32 PATH_PathToRegion(const GdiPath *pPath, INT32 nPolyFillMode,
HRGN32 *pHrgn); HRGN32 *pHrgn);
static void PATH_EmptyPath(GdiPath *pPath); static void PATH_EmptyPath(GdiPath *pPath);
static BOOL32 PATH_AddEntry(GdiPath *pPath, POINT32 point, BYTE flags); static BOOL32 PATH_AddEntry(GdiPath *pPath, const POINT32 *pPoint,
BYTE flags);
static BOOL32 PATH_ReserveEntries(GdiPath *pPath, INT32 numEntries); static BOOL32 PATH_ReserveEntries(GdiPath *pPath, INT32 numEntries);
static BOOL32 PATH_GetPathFromHDC(HDC32 hdc, GdiPath **ppPath); static BOOL32 PATH_GetPathFromHDC(HDC32 hdc, GdiPath **ppPath);
static BOOL32 PATH_DoArcPart(GdiPath *pPath, POINT32 corners[], static BOOL32 PATH_DoArcPart(GdiPath *pPath, FLOAT_POINT corners[],
double angleStart, double angleEnd, BOOL32 addMoveTo); double angleStart, double angleEnd, BOOL32 addMoveTo);
static void PATH_ScaleNormalizedPoint(POINT32 corners[], double x, double y, static void PATH_ScaleNormalizedPoint(FLOAT_POINT corners[], double x,
POINT32 *pPoint); double y, POINT32 *pPoint);
static void PATH_NormalizePoint(POINT32 corners[], const POINT32 *pPoint, static void PATH_NormalizePoint(FLOAT_POINT corners[], const FLOAT_POINT
double *pX, double *pY); *pPoint, double *pX, double *pY);
/*********************************************************************** /***********************************************************************
@ -218,6 +219,8 @@ BOOL32 WINAPI CloseFigure32(HDC32 hdc)
return FALSE; return FALSE;
} }
/* FIXME: Shouldn't we draw a line to the beginning of the figure? */
/* Set PT_CLOSEFIGURE on the last entry and start a new stroke */ /* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
if(pPath->numEntriesUsed) if(pPath->numEntriesUsed)
{ {
@ -436,7 +439,7 @@ BOOL32 WINAPI SelectClipPath32(HDC32 hdc, INT32 iMode)
if(PATH_PathToRegion(pPath, GetPolyFillMode32(hdc), &hrgnPath)) if(PATH_PathToRegion(pPath, GetPolyFillMode32(hdc), &hrgnPath))
{ {
hrgnClip=CreateRectRgn32(0, 0, 0, 0); hrgnClip=CreateRectRgn32(0, 0, 0, 0);
if(hrgnClip==NULL) if(hrgnClip==(HRGN32)0)
success=FALSE; success=FALSE;
else else
{ {
@ -564,7 +567,6 @@ BOOL32 PATH_LineTo(HDC32 hdc, INT32 x, INT32 y)
/* Check that path is open */ /* Check that path is open */
if(pPath->state!=PATH_Open) if(pPath->state!=PATH_Open)
/* FIXME: Do we have to call SetLastError? */
return FALSE; return FALSE;
/* Convert point to device coordinates */ /* Convert point to device coordinates */
@ -580,12 +582,93 @@ BOOL32 PATH_LineTo(HDC32 hdc, INT32 x, INT32 y)
if(!GetCurrentPositionEx32(hdc, &pointCurPos) || if(!GetCurrentPositionEx32(hdc, &pointCurPos) ||
!LPtoDP32(hdc, &pointCurPos, 1)) !LPtoDP32(hdc, &pointCurPos, 1))
return FALSE; return FALSE;
if(!PATH_AddEntry(pPath, pointCurPos, PT_MOVETO)) if(!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO))
return FALSE; return FALSE;
} }
/* Add a PT_LINETO entry */ /* Add a PT_LINETO entry */
return PATH_AddEntry(pPath, point, PT_LINETO); return PATH_AddEntry(pPath, &point, PT_LINETO);
}
/* PATH_Rectangle
*
* Should be called when a call to Rectangle is performed on a DC that has
* an open path. Returns TRUE if successful, else FALSE.
*/
BOOL32 PATH_Rectangle(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2)
{
GdiPath *pPath;
POINT32 corners[2], pointTemp;
INT32 temp;
/* Get pointer to path */
if(!PATH_GetPathFromHDC(hdc, &pPath))
return FALSE;
/* Check that path is open */
if(pPath->state!=PATH_Open)
return FALSE;
/* Convert points to device coordinates */
corners[0].x=x1;
corners[0].y=y1;
corners[1].x=x2;
corners[1].y=y2;
if(!LPtoDP32(hdc, corners, 2))
return FALSE;
/* Make sure first corner is top left and second corner is bottom right */
if(corners[0].x>corners[1].x)
{
temp=corners[0].x;
corners[0].x=corners[1].x;
corners[1].x=temp;
}
if(corners[0].y>corners[1].y)
{
temp=corners[0].y;
corners[0].y=corners[1].y;
corners[1].y=temp;
}
/* In GM_COMPATIBLE, don't include bottom and right edges */
if(GetGraphicsMode(hdc)==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
}
/* Close any previous figure */
if(!CloseFigure32(hdc))
{
/* The CloseFigure call shouldn't have failed */
assert(FALSE);
return FALSE;
}
/* Add four points to the path */
pointTemp.x=corners[1].x;
pointTemp.y=corners[0].y;
if(!PATH_AddEntry(pPath, &pointTemp, PT_MOVETO))
return FALSE;
if(!PATH_AddEntry(pPath, corners, PT_LINETO))
return FALSE;
pointTemp.x=corners[0].x;
pointTemp.y=corners[1].y;
if(!PATH_AddEntry(pPath, &pointTemp, PT_LINETO))
return FALSE;
if(!PATH_AddEntry(pPath, corners+1, PT_LINETO))
return FALSE;
/* Close the rectangle figure */
if(!CloseFigure32(hdc))
{
/* The CloseFigure call shouldn't have failed */
assert(FALSE);
return FALSE;
}
return TRUE;
} }
/* PATH_Ellipse /* PATH_Ellipse
@ -596,7 +679,9 @@ BOOL32 PATH_LineTo(HDC32 hdc, INT32 x, INT32 y)
*/ */
BOOL32 PATH_Ellipse(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2) BOOL32 PATH_Ellipse(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2)
{ {
return PATH_Arc(hdc, x1, y1, x2, y2, x1, 0, x1, 0); // TODO: This should probably be revised to call PATH_AngleArc
// (once it exists)
return PATH_Arc(hdc, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2);
} }
/* PATH_Arc /* PATH_Arc
@ -608,16 +693,23 @@ BOOL32 PATH_Ellipse(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2)
BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2, BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2,
INT32 xStart, INT32 yStart, INT32 xEnd, INT32 yEnd) INT32 xStart, INT32 yStart, INT32 xEnd, INT32 yEnd)
{ {
GdiPath *pPath; GdiPath *pPath;
double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant=0.0; DC *pDC;
/* Initialize angleEndQuadrant to silence gcc's warning */ double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant=0.0;
double x, y; /* Initialize angleEndQuadrant to silence gcc's warning */
POINT32 corners[2], pointStart, pointEnd; double x, y;
BOOL32 start, end; FLOAT_POINT corners[2], pointStart, pointEnd;
INT32 temp; BOOL32 start, end;
INT32 temp;
/* FIXME: This function should check for all possible error returns */ /* FIXME: This function should check for all possible error returns */
/* FIXME: Do we have to respect newStroke? */
/* Get pointer to DC */
pDC=DC_GetDCPtr(hdc);
if(pDC==NULL)
return FALSE;
/* Get pointer to path */ /* Get pointer to path */
if(!PATH_GetPathFromHDC(hdc, &pPath)) if(!PATH_GetPathFromHDC(hdc, &pPath))
return FALSE; return FALSE;
@ -626,34 +718,28 @@ BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2,
if(pPath->state!=PATH_Open) if(pPath->state!=PATH_Open)
return FALSE; return FALSE;
/* FIXME: Do we have to close the current figure? */
/* Check for zero height / width */ /* Check for zero height / width */
/* FIXME: Should we do this before or after LPtoDP? */ /* FIXME: Only in GM_COMPATIBLE? */
if(x1==x2 || y1==y2) if(x1==x2 || y1==y2)
return TRUE; return TRUE;
/* In GM_COMPATIBLE, don't include bottom and right edges */
if(GetGraphicsMode(hdc)==GM_COMPATIBLE)
{
/* FIXME: Should we do this before or after LPtoDP? */
x2--;
y2--;
}
/* Convert points to device coordinates */ /* Convert points to device coordinates */
corners[0].x=x1; corners[0].x=(FLOAT)x1;
corners[0].y=y1; corners[0].y=(FLOAT)y1;
corners[1].x=x2; corners[1].x=(FLOAT)x2;
corners[1].y=y2; corners[1].y=(FLOAT)y2;
pointStart.x=xStart; pointStart.x=(FLOAT)xStart;
pointStart.y=yStart; pointStart.y=(FLOAT)yStart;
pointEnd.x=xEnd; pointEnd.x=(FLOAT)xEnd;
pointEnd.y=yEnd; pointEnd.y=(FLOAT)yEnd;
if(!LPtoDP32(hdc, corners, 2) || !LPtoDP32(hdc, &pointStart, 1) || INTERNAL_LPTODP_FLOAT(pDC, corners);
!LPtoDP32(hdc, &pointEnd, 1)) INTERNAL_LPTODP_FLOAT(pDC, corners+1);
return FALSE; INTERNAL_LPTODP_FLOAT(pDC, &pointStart);
INTERNAL_LPTODP_FLOAT(pDC, &pointEnd);
/* Make sure first corner is top left and right corner is bottom right */ /* Make sure first corner is top left and second corner is bottom right */
/* FIXME: Should we do this before or after LPtoDP? */
if(corners[0].x>corners[1].x) if(corners[0].x>corners[1].x)
{ {
temp=corners[0].x; temp=corners[0].x;
@ -691,6 +777,13 @@ BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2,
} }
} }
/* In GM_COMPATIBLE, don't include bottom and right edges */
if(GetGraphicsMode(hdc)==GM_COMPATIBLE)
{
corners[1].x--;
corners[1].y--;
}
/* Add the arc to the path with one Bezier spline per quadrant that the /* Add the arc to the path with one Bezier spline per quadrant that the
* arc spans */ * arc spans */
start=TRUE; start=TRUE;
@ -717,9 +810,9 @@ BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2,
/* Have we reached the last part of the arc? */ /* Have we reached the last part of the arc? */
if((GetArcDirection32(hdc)==AD_CLOCKWISE && if((GetArcDirection32(hdc)==AD_CLOCKWISE &&
angleEnd<=angleEndQuadrant) || angleEnd<angleEndQuadrant) ||
(GetArcDirection32(hdc)==AD_COUNTERCLOCKWISE && (GetArcDirection32(hdc)==AD_COUNTERCLOCKWISE &&
angleEnd>=angleEndQuadrant)) angleEnd>angleEndQuadrant))
{ {
/* Adjust the end angle for this quadrant */ /* Adjust the end angle for this quadrant */
angleEndQuadrant=angleEnd; angleEndQuadrant=angleEnd;
@ -791,7 +884,7 @@ static BOOL32 PATH_PathToRegion(const GdiPath *pPath, INT32 nPolyFillMode,
/* Create a region from the strokes */ /* Create a region from the strokes */
hrgn=CreatePolyPolygonRgn32(pPath->pPoints, pNumPointsInStroke, hrgn=CreatePolyPolygonRgn32(pPath->pPoints, pNumPointsInStroke,
numStrokes, nPolyFillMode); numStrokes, nPolyFillMode);
if(hrgn==NULL) if(hrgn==(HRGN32)0)
{ {
SetLastError(ERROR_NOT_ENOUGH_MEMORY); SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE; return FALSE;
@ -823,10 +916,14 @@ static void PATH_EmptyPath(GdiPath *pPath)
* or PT_BEZIERTO, optionally ORed with PT_CLOSEFIGURE. Returns TRUE if * or PT_BEZIERTO, optionally ORed with PT_CLOSEFIGURE. Returns TRUE if
* successful, FALSE otherwise (e.g. if not enough memory was available). * successful, FALSE otherwise (e.g. if not enough memory was available).
*/ */
BOOL32 PATH_AddEntry(GdiPath *pPath, POINT32 point, BYTE flags) BOOL32 PATH_AddEntry(GdiPath *pPath, const POINT32 *pPoint, BYTE flags)
{ {
assert(pPath!=NULL); assert(pPath!=NULL);
/* FIXME: If newStroke is true, perhaps we want to check that we're
* getting a PT_MOVETO
*/
/* Check that path is open */ /* Check that path is open */
if(pPath->state!=PATH_Open) if(pPath->state!=PATH_Open)
return FALSE; return FALSE;
@ -836,9 +933,13 @@ BOOL32 PATH_AddEntry(GdiPath *pPath, POINT32 point, BYTE flags)
return FALSE; return FALSE;
/* Store information in path entry */ /* Store information in path entry */
pPath->pPoints[pPath->numEntriesUsed]=point; pPath->pPoints[pPath->numEntriesUsed]=*pPoint;
pPath->pFlags[pPath->numEntriesUsed]=flags; pPath->pFlags[pPath->numEntriesUsed]=flags;
/* If this is PT_CLOSEFIGURE, we have to start a new stroke next time */
if((flags & PT_CLOSEFIGURE) == PT_CLOSEFIGURE)
pPath->newStroke=TRUE;
/* Increment entry count */ /* Increment entry count */
pPath->numEntriesUsed++; pPath->numEntriesUsed++;
@ -936,7 +1037,7 @@ static BOOL32 PATH_GetPathFromHDC(HDC32 hdc, GdiPath **ppPath)
* point is added to the path; otherwise, it is assumed that the current * point is added to the path; otherwise, it is assumed that the current
* position is equal to the first control point. * position is equal to the first control point.
*/ */
static BOOL32 PATH_DoArcPart(GdiPath *pPath, POINT32 corners[], static BOOL32 PATH_DoArcPart(GdiPath *pPath, FLOAT_POINT corners[],
double angleStart, double angleEnd, BOOL32 addMoveTo) double angleStart, double angleEnd, BOOL32 addMoveTo)
{ {
double halfAngle, a; double halfAngle, a;
@ -950,21 +1051,30 @@ static BOOL32 PATH_DoArcPart(GdiPath *pPath, POINT32 corners[],
/* Compute control points */ /* Compute control points */
halfAngle=(angleEnd-angleStart)/2.0; halfAngle=(angleEnd-angleStart)/2.0;
a=4.0/3.0*(1-cos(halfAngle))/sin(halfAngle); if(fabs(halfAngle)>1e-8)
xNorm[0]=cos(angleStart); {
yNorm[0]=sin(angleStart); a=4.0/3.0*(1-cos(halfAngle))/sin(halfAngle);
xNorm[1]=xNorm[0] - a*yNorm[0]; xNorm[0]=cos(angleStart);
yNorm[1]=yNorm[0] + a*xNorm[0]; yNorm[0]=sin(angleStart);
xNorm[3]=cos(angleEnd); xNorm[1]=xNorm[0] - a*yNorm[0];
yNorm[3]=sin(angleEnd); yNorm[1]=yNorm[0] + a*xNorm[0];
xNorm[2]=xNorm[3] + a*yNorm[3]; xNorm[3]=cos(angleEnd);
yNorm[2]=yNorm[3] - a*xNorm[3]; yNorm[3]=sin(angleEnd);
xNorm[2]=xNorm[3] + a*yNorm[3];
yNorm[2]=yNorm[3] - a*xNorm[3];
}
else
for(i=0; i<4; i++)
{
xNorm[i]=cos(angleStart);
yNorm[i]=sin(angleStart);
}
/* Add starting point to path if desired */ /* Add starting point to path if desired */
if(addMoveTo) if(addMoveTo)
{ {
PATH_ScaleNormalizedPoint(corners, xNorm[0], yNorm[0], &point); PATH_ScaleNormalizedPoint(corners, xNorm[0], yNorm[0], &point);
if(!PATH_AddEntry(pPath, point, PT_MOVETO)) if(!PATH_AddEntry(pPath, &point, PT_MOVETO))
return FALSE; return FALSE;
} }
@ -972,7 +1082,7 @@ static BOOL32 PATH_DoArcPart(GdiPath *pPath, POINT32 corners[],
for(i=1; i<4; i++) for(i=1; i<4; i++)
{ {
PATH_ScaleNormalizedPoint(corners, xNorm[i], yNorm[i], &point); PATH_ScaleNormalizedPoint(corners, xNorm[i], yNorm[i], &point);
if(!PATH_AddEntry(pPath, point, PT_BEZIERTO)) if(!PATH_AddEntry(pPath, &point, PT_BEZIERTO))
return FALSE; return FALSE;
} }
@ -986,12 +1096,12 @@ static BOOL32 PATH_DoArcPart(GdiPath *pPath, POINT32 corners[],
* coordinates (-1.0, -1.0) correspond to corners[0], the coordinates * coordinates (-1.0, -1.0) correspond to corners[0], the coordinates
* (1.0, 1.0) correspond to corners[1]. * (1.0, 1.0) correspond to corners[1].
*/ */
static void PATH_ScaleNormalizedPoint(POINT32 corners[], double x, double y, static void PATH_ScaleNormalizedPoint(FLOAT_POINT corners[], double x,
POINT32 *pPoint) double y, POINT32 *pPoint)
{ {
pPoint->x=(INT32)floor( (double)corners[0].x + pPoint->x=GDI_ROUND( (double)corners[0].x +
(double)(corners[1].x-corners[0].x)*0.5*(x+1.0) ); (double)(corners[1].x-corners[0].x)*0.5*(x+1.0) );
pPoint->y=(INT32)floor( (double)corners[0].y + pPoint->y=GDI_ROUND( (double)corners[0].y +
(double)(corners[1].y-corners[0].y)*0.5*(y+1.0) ); (double)(corners[1].y-corners[0].y)*0.5*(y+1.0) );
} }
@ -1000,7 +1110,8 @@ static void PATH_ScaleNormalizedPoint(POINT32 corners[], double x, double y,
* Normalizes a point with respect to the box whose corners are passed in * Normalizes a point with respect to the box whose corners are passed in
* "corners". The normalized coordinates are stored in "*pX" and "*pY". * "corners". The normalized coordinates are stored in "*pX" and "*pY".
*/ */
static void PATH_NormalizePoint(POINT32 corners[], const POINT32 *pPoint, static void PATH_NormalizePoint(FLOAT_POINT corners[],
const FLOAT_POINT *pPoint,
double *pX, double *pY) double *pX, double *pY)
{ {
*pX=(double)(pPoint->x-corners[0].x)/(double)(corners[1].x-corners[0].x) * *pX=(double)(pPoint->x-corners[0].x)/(double)(corners[1].x-corners[0].x) *

View file

@ -200,8 +200,8 @@ BOOL32 WIN16DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
*/ */
WORD WINAPI WineEnumDFontCallback(LPLOGFONT16 lpLogFont, WORD WINAPI WineEnumDFontCallback(LPENUMLOGFONT16 lpLogFont,
LPTEXTMETRIC16 lpTextMetrics, LPNEWTEXTMETRIC16 lpTextMetrics,
WORD wFontType, LONG lpClientData) WORD wFontType, LONG lpClientData)
{ {
TRACE(win16drv, "In WineEnumDFontCallback plf=%p\n", lpLogFont); TRACE(win16drv, "In WineEnumDFontCallback plf=%p\n", lpLogFont);

View file

@ -674,7 +674,7 @@ int WINAPI dmRealizeObject(LPPDEVICE lpDestDev, INT16 wStyle, LPSTR lpInObj, LPS
if (wStyle < 0) { /* Free extra memory of given object's structure */ if (wStyle < 0) { /* Free extra memory of given object's structure */
switch ( -wStyle ) { switch ( -wStyle ) {
case DRVOBJ_PEN: { case DRVOBJ_PEN: {
LPLOGPEN16 DeletePen = (LPLOGPEN16)lpInObj; /* LPLOGPEN16 DeletePen = (LPLOGPEN16)lpInObj; */
fprintf(stderr, "DRVOBJ_PEN_delete\n"); fprintf(stderr, "DRVOBJ_PEN_delete\n");
break; break;
@ -684,8 +684,8 @@ int WINAPI dmRealizeObject(LPPDEVICE lpDestDev, INT16 wStyle, LPSTR lpInObj, LPS
break; break;
} }
case DRVOBJ_FONT: { case DRVOBJ_FONT: {
LPTEXTXFORM16 TextXForm /* LPTEXTXFORM16 TextXForm
= (LPTEXTXFORM16)lpTextXForm; = (LPTEXTXFORM16)lpTextXForm; */
fprintf(stderr, "DRVOBJ_FONT_delete\n"); fprintf(stderr, "DRVOBJ_FONT_delete\n");
break; break;
} }
@ -720,7 +720,7 @@ int WINAPI dmRealizeObject(LPPDEVICE lpDestDev, INT16 wStyle, LPSTR lpInObj, LPS
case DRVOBJ_BRUSH: { case DRVOBJ_BRUSH: {
LPLOGBRUSH16 InBrush = (LPLOGBRUSH16)lpInObj; LPLOGBRUSH16 InBrush = (LPLOGBRUSH16)lpInObj;
LPLOGBRUSH16 OutBrush = (LPLOGBRUSH16)lpOutObj; LPLOGBRUSH16 OutBrush = (LPLOGBRUSH16)lpOutObj;
LPPOINT16 Point = (LPPOINT16)lpTextXForm; /* LPPOINT16 Point = (LPPOINT16)lpTextXForm; */
fprintf(stderr, "DRVOBJ_BRUSH\n"); fprintf(stderr, "DRVOBJ_BRUSH\n");
if (!lpOutObj) return sizeof(LOGBRUSH16); if (!lpOutObj) return sizeof(LOGBRUSH16);
@ -734,8 +734,8 @@ int WINAPI dmRealizeObject(LPPDEVICE lpDestDev, INT16 wStyle, LPSTR lpInObj, LPS
} }
} }
case DRVOBJ_FONT: { case DRVOBJ_FONT: {
LPTEXTXFORM16 TextXForm /* LPTEXTXFORM16 TextXForm
= (LPTEXTXFORM16)lpTextXForm; = (LPTEXTXFORM16)lpTextXForm; */
fprintf(stderr, "DRVOBJ_FONT\n"); fprintf(stderr, "DRVOBJ_FONT\n");
return 0;/* DISPLAY.DRV doesn't realize fonts */ return 0;/* DISPLAY.DRV doesn't realize fonts */
} }

View file

@ -70,7 +70,7 @@ HDC16 WINAPI WinGCreateDC16(void)
__initWinG(); __initWinG();
if( __WinGOK > 0 ) if( __WinGOK > 0 )
return CreateCompatibleDC16(NULL); return CreateCompatibleDC16(0);
return (HDC16)NULL; return (HDC16)NULL;
} }

View file

@ -91,7 +91,7 @@ X11DRV_DrawArc( DC *dc, INT32 left, INT32 top, INT32 right,
xend = XLPTODP( dc, xend ); xend = XLPTODP( dc, xend );
yend = YLPTODP( dc, yend ); yend = YLPTODP( dc, yend );
if ((left == right) || (top == bottom)) return FALSE; if ((left == right) || (top == bottom)) return TRUE;
if (left > right) { tmp=left; left=right; right=tmp; } if (left > right) { tmp=left; left=right; right=tmp; }
if (top > bottom) { tmp=top; top=bottom; bottom=tmp; } if (top > bottom) { tmp=top; top=bottom; bottom=tmp; }

View file

@ -460,8 +460,8 @@ static BOOL32 LFD_ComposeLFD( fontObject* fo,
char *s; char *s;
sprintf(h_string, "[%+f%+f%+f%+f]", h_matrix[0], h_matrix[1], h_matrix[2], h_matrix[3]); sprintf(h_string, "[%+f%+f%+f%+f]", h_matrix[0], h_matrix[1], h_matrix[2], h_matrix[3]);
sprintf(point_string, "[%+f%+f%+f%+f]", point_matrix[0], point_matrix[1], point_matrix[2], point_matrix[3]); sprintf(point_string, "[%+f%+f%+f%+f]", point_matrix[0], point_matrix[1], point_matrix[2], point_matrix[3]);
while (s = strchr(h_string, '-')) *s='~'; while ((s = strchr(h_string, '-'))) *s='~';
while (s = strchr(point_string, '-')) *s='~'; while ((s = strchr(point_string, '-'))) *s='~';
} else { } else {
sprintf(h_string, "%d", h); sprintf(h_string, "%d", h);
sprintf(point_string, "%d", point); sprintf(point_string, "%d", point);

View file

@ -186,6 +186,7 @@ BOOL32 BUILTIN_Init(void)
NE_MODULE *pModule; NE_MODULE *pModule;
WORD vector; WORD vector;
HMODULE16 hModule; HMODULE16 hModule;
WORD cs, ds;
fnBUILTIN_LoadModule = BUILTIN_LoadModule; fnBUILTIN_LoadModule = BUILTIN_LoadModule;
@ -197,9 +198,9 @@ BOOL32 BUILTIN_Init(void)
/* Set the USER and GDI heap selectors */ /* Set the USER and GDI heap selectors */
pModule = MODULE_GetPtr16( GetModuleHandle16( "USER" )); pModule = NE_GetPtr( GetModuleHandle16( "USER" ));
USER_HeapSel = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector; USER_HeapSel = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
pModule = MODULE_GetPtr16( GetModuleHandle16( "GDI" )); pModule = NE_GetPtr( GetModuleHandle16( "GDI" ));
GDI_HeapSel = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector; GDI_HeapSel = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */ /* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
@ -207,6 +208,12 @@ BOOL32 BUILTIN_Init(void)
hModule = GetModuleHandle16( "KERNEL" ); hModule = GetModuleHandle16( "KERNEL" );
NE_SetEntryPoint( hModule, 178, GetWinFlags() ); NE_SetEntryPoint( hModule, 178, GetWinFlags() );
/* Initialize KERNEL.454/455 (__FLATCS/__FLATDS) */
GET_CS(cs); GET_DS(ds);
NE_SetEntryPoint( hModule, 454, cs );
NE_SetEntryPoint( hModule, 455, ds );
/* Initialize the real-mode selector entry points */ /* Initialize the real-mode selector entry points */
#define SET_ENTRY_POINT( num, addr ) \ #define SET_ENTRY_POINT( num, addr ) \
@ -247,7 +254,7 @@ BOOL32 BUILTIN_Init(void)
* Load a built-in module. If the 'force' parameter is FALSE, we only * Load a built-in module. If the 'force' parameter is FALSE, we only
* load the module if it has not been disabled via the -dll option. * load the module if it has not been disabled via the -dll option.
*/ */
HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ) HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL32 force )
{ {
BUILTIN16_DLL *table; BUILTIN16_DLL *table;
char dllname[16], *p; char dllname[16], *p;
@ -260,8 +267,7 @@ HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force )
for (table = BuiltinDLLs; table->descr; table++) for (table = BuiltinDLLs; table->descr; table++)
if (!lstrcmpi32A( table->descr->name, dllname )) break; if (!lstrcmpi32A( table->descr->name, dllname )) break;
if (!table->descr) return BUILTIN32_LoadModule( name, force, if (!table->descr) return 0;
PROCESS_Current() );
if ((table->flags & DLL_FLAG_NOT_USED) && !force) return 0; if ((table->flags & DLL_FLAG_NOT_USED) && !force) return 0;
return BUILTIN_DoLoadModule16( table->descr ); return BUILTIN_DoLoadModule16( table->descr );
@ -281,7 +287,7 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
register BYTE *p; register BYTE *p;
NE_MODULE *pModule; NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( FarGetOwner( GlobalHandle16(cs) )))) if (!(pModule = NE_GetPtr( FarGetOwner( GlobalHandle16(cs) ))))
return NULL; return NULL;
/* Search for the ordinal */ /* Search for the ordinal */

View file

@ -3,7 +3,7 @@ type win16
1 pascal16 GetOpenFileName(segptr) GetOpenFileName16 1 pascal16 GetOpenFileName(segptr) GetOpenFileName16
2 pascal16 GetSaveFileName(segptr) GetSaveFileName16 2 pascal16 GetSaveFileName(segptr) GetSaveFileName16
5 pascal16 ChooseColor(ptr) ChooseColor 5 pascal16 ChooseColor(ptr) ChooseColor16
6 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc 6 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
7 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc 7 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
8 pascal ColorDlgProc(word word word long) ColorDlgProc 8 pascal ColorDlgProc(word word word long) ColorDlgProc

View file

@ -4,7 +4,7 @@ type win16
2 pascal16 DdeInitialize(ptr segptr long long) DdeInitialize16 2 pascal16 DdeInitialize(ptr segptr long long) DdeInitialize16
3 pascal16 DdeUninitialize(long) DdeUninitialize16 3 pascal16 DdeUninitialize(long) DdeUninitialize16
4 pascal DdeConnectList(long word word word ptr) DdeConnectList16 4 pascal DdeConnectList(long word word word ptr) DdeConnectList16
5 pascal DdeQueryNextServer(word word) DdeQueryNextServer 5 pascal DdeQueryNextServer(word word) DdeQueryNextServer16
6 pascal DdeDisconnectList(word) DdeDisconnectList16 6 pascal DdeDisconnectList(word) DdeDisconnectList16
7 pascal DdeConnect(long long long ptr) DdeConnect16 7 pascal DdeConnect(long long long ptr) DdeConnect16
8 pascal16 DdeDisconnect(long) DdeDisconnect16 8 pascal16 DdeDisconnect(long) DdeDisconnect16

View file

@ -202,7 +202,7 @@ file krnl386.exe
200 return ValidateFreeSpaces 0 0 200 return ValidateFreeSpaces 0 0
201 stub ReplaceInst 201 stub ReplaceInst
202 stub RegisterPtrace 202 stub RegisterPtrace
203 register DebugBreak() DebugBreak16 203 register DebugBreak() DebugBreak
204 stub SwapRecording 204 stub SwapRecording
205 stub CVWBreak 205 stub CVWBreak
206 pascal16 AllocSelectorArray(word) AllocSelectorArray 206 pascal16 AllocSelectorArray(word) AllocSelectorArray
@ -277,9 +277,9 @@ file krnl386.exe
354 pascal GetAppCompatFlags(word) GetAppCompatFlags16 354 pascal GetAppCompatFlags(word) GetAppCompatFlags16
355 pascal16 GetWinDebugInfo(ptr word) GetWinDebugInfo 355 pascal16 GetWinDebugInfo(ptr word) GetWinDebugInfo
356 pascal16 SetWinDebugInfo(ptr) SetWinDebugInfo 356 pascal16 SetWinDebugInfo(ptr) SetWinDebugInfo
357 stub KERNEL_357 357 pascal MapSL(segptr) MapSL
358 pascal MapLS(long) MapLS 358 pascal MapLS(long) MapLS
359 pascal UnMapLS(ptr) UnMapLS 359 pascal UnMapLS(segptr) UnMapLS
360 stub OpenFileEx 360 stub OpenFileEx
#361 PIGLET_361 #361 PIGLET_361
365 stub KERNEL_365 365 stub KERNEL_365
@ -311,15 +311,15 @@ file krnl386.exe
447 stub KERNEL_447 447 stub KERNEL_447
449 pascal KERNEL_449() KERNEL_449 449 pascal KERNEL_449() KERNEL_449
450 pascal16 KERNEL_450() stub_KERNEL_450 450 pascal16 KERNEL_450() stub_KERNEL_450
454 stub KERNEL_454 454 equate __FLATCS 0 # initialized by BUILTIN_Init()
455 stub KERNEL_455 455 equate __FLATDS 0 # initialized by BUILTIN_Init()
471 pascal KERNEL_471() _KERNEL_471 471 pascal KERNEL_471() _KERNEL_471
472 register KERNEL_472() _KERNEL_472 472 register KERNEL_472() _KERNEL_472
473 stub KERNEL_473 473 stub KERNEL_473
475 stub KERNEL_475 475 return KERNEL_475 0 0
480 stub KERNEL_480 480 stub KERNEL_480
481 stub KERNEL_481 481 stub KERNEL_481
482 stub KERNEL_482 482 pascal LoadLibrary32(str) LoadLibrary32A
485 stub KERNEL_485 485 stub KERNEL_485
491 stub RegisterServiceProcess 491 stub RegisterServiceProcess
500 stub KERNEL_500 500 stub KERNEL_500
@ -346,16 +346,16 @@ file krnl386.exe
604 stub KERNEL_604 604 stub KERNEL_604
605 stub KERNEL_605 605 stub KERNEL_605
606 stub KERNEL_606 606 stub KERNEL_606
607 stub KERNEL_607 607 pascal KERNEL_607(long long long) _KERNEL_607
608 stub KERNEL_608 608 pascal KERNEL_608(long long long) _KERNEL_608
611 stub KERNEL_611 611 pascal KERNEL_611(long long) _KERNEL_611
612 stub KERNEL_612 612 stub KERNEL_612
613 stub KERNEL_613 613 stub KERNEL_613
614 stub KERNEL_614 614 stub KERNEL_614
619 pascal KERNEL_619(word long long) _KERNEL_619 619 pascal KERNEL_619(word long long) _KERNEL_619
621 stub KERNEL_621 621 stub KERNEL_621
627 stub IsBadFlatReadWritePtr 627 stub IsBadFlatReadWritePtr
630 stub KERNEL_630 630 register C16ThkSL() C16ThkSL
631 register FUNC004(word word word) FUNC004 #C16ThkSl01? 631 register C16ThkSL01() C16ThkSL01
651 stub KERNEL_651 #ThunkConnect16? 651 pascal ThunkConnect16(str str word long ptr str word) ThunkConnect16
700 pascal KERNEL_700() stub_KERNEL_700 700 pascal KERNEL_700() stub_KERNEL_700

View file

@ -86,6 +86,7 @@ static HANDLER_DEF(SIGNAL_fault)
* *
* Set the register values from a sigcontext. * Set the register values from a sigcontext.
*/ */
#ifdef UNUSED_FUNCTIONS
static void SIGNAL_SetSigContext( const SIGCONTEXT *sigcontext, static void SIGNAL_SetSigContext( const SIGCONTEXT *sigcontext,
CONTEXT *context ) CONTEXT *context )
{ {
@ -116,6 +117,7 @@ static void SIGNAL_SetSigContext( const SIGCONTEXT *sigcontext,
GS_reg(context) &= 0xffff; GS_reg(context) &= 0xffff;
#endif #endif
} }
#endif
/*********************************************************************** /***********************************************************************
@ -123,6 +125,7 @@ static void SIGNAL_SetSigContext( const SIGCONTEXT *sigcontext,
* *
* Build a sigcontext from the register values. * Build a sigcontext from the register values.
*/ */
#ifdef UNUSED_FUNCTIONS
static void SIGNAL_GetSigContext( SIGCONTEXT *sigcontext, static void SIGNAL_GetSigContext( SIGCONTEXT *sigcontext,
const CONTEXT *context ) const CONTEXT *context )
{ {
@ -151,6 +154,7 @@ static void SIGNAL_GetSigContext( SIGCONTEXT *sigcontext,
SET_GS( GS_reg(&DEBUG_context) ); SET_GS( GS_reg(&DEBUG_context) );
#endif #endif
} }
#endif
/*********************************************************************** /***********************************************************************

View file

@ -26,3 +26,15 @@
/* Define if the struct statfs has the member bfree */ /* Define if the struct statfs has the member bfree */
#undef STATFS_HAS_BFREE #undef STATFS_HAS_BFREE
/* Define if we have a working sigaltstack */
#undef HAVE_WORKING_SIGALTSTACK
/* Define if the struct statfs is defined by <sys/vfs.h> */
#undef STATFS_DEFINED_BY_SYS_VFS
/* Define if the struct statfs is defined by <sys/statfs.h> */
#undef STATFS_DEFINED_BY_SYS_STATFS
/* Define if the struct statfs is defined by <sys/mount.h> */
#undef STATFS_DEFINED_BY_SYS_MOUNT

View file

@ -9,6 +9,30 @@
void WINAPI InitCommonControls(void); void WINAPI InitCommonControls(void);
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
BOOL32 WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
#define ICC_LISTVIEW_CLASSES 0x00000001 /* listview, header */
#define ICC_TREEVIEW_CLASSES 0x00000002 /* treeview, tooltips */
#define ICC_BAR_CLASSES 0x00000004 /* toolbar, statusbar, trackbar, tooltips */
#define ICC_TAB_CLASSES 0x00000008 /* tab, tooltips */
#define ICC_UPDOWN_CLASS 0x00000010 /* updown */
#define ICC_PROGRESS_CLASS 0x00000020 /* progress */
#define ICC_HOTKEY_CLASS 0x00000040 /* hotkey */
#define ICC_ANIMATE_CLASS 0x00000080 /* animate */
#define ICC_WIN95_CLASSES 0x000000FF
#define ICC_DATE_CLASSES 0x00000100 /* month picker, date picker, time picker, updown */
#define ICC_USEREX_CLASSES 0x00000200 /* comboex */
#define ICC_COOL_CLASSES 0x00000400 /* rebar (coolbar) */
#define ICC_INTERNET_CLASSES 0x00000800 /* IP address, ... */
#define ICC_PAGESCROLLER_CLASS 0x00001000 /* page scroller */
#define ICC_NATIVEFNTCTL_CLASS 0x00002000 /* native font control ???*/
/* common control styles */ /* common control styles */
#define CCS_TOP 0x00000001L #define CCS_TOP 0x00000001L
@ -25,10 +49,31 @@ void WINAPI InitCommonControls(void);
/* common control shared messages */ /* common control shared messages */
#define CCM_FIRST 0x2000 #define CCM_FIRST 0x2000
#define CCM_SETBKCOLOR (CCM_FIRST+1) // lParam = bkColor #define CCM_SETBKCOLOR (CCM_FIRST+1) /* lParam = bkColor */
/* common notification codes */
#define NM_FIRST (0U-0U)
#define NM_LAST (0U-99U)
#define NM_OUTOFMEMORY (NM_FIRST-1)
#define NM_CLICK (NM_FIRST-2)
#define NM_DBLCLK (NM_FIRST-3)
#define NM_RETURN (NM_FIRST-4)
#define NM_RCLICK (NM_FIRST-5)
#define NM_RDBLCLK (NM_FIRST-6)
#define NM_SETFOCUS (NM_FIRST-7)
#define NM_KILLFOCUS (NM_FIRST-8)
#define NM_CUSTOMDRAW (NM_FIRST-12)
#define NM_HOVER (NM_FIRST-13)
#define NM_NCHITTEST (NM_FIRST-14)
#define NM_KEYDOWN (NM_FIRST-15)
#define NM_RELEASEDCAPTURE (NM_FIRST-16)
#define NM_SETCURSOR (NM_FIRST-17)
#define NM_CHAR (NM_FIRST-18)
#define NM_TOOLTIPSCREATED (NM_FIRST-19)
/* StatusWindow */ /* StatusWindow */
@ -54,14 +99,26 @@ void WINAPI InitCommonControls(void);
#define SB_SETMINHEIGHT (WM_USER+8) #define SB_SETMINHEIGHT (WM_USER+8)
#define SB_SIMPLE (WM_USER+9) #define SB_SIMPLE (WM_USER+9)
#define SB_GETRECT (WM_USER+10) #define SB_GETRECT (WM_USER+10)
#define SB_ISSIMPLE (WM_USER+14)
#define SB_SETICON (WM_USER+15)
#define SB_GETICON (WM_USER+20)
#define SB_SETBKCOLOR CCM_SETBKCOLOR /* lParam = bkColor */
#define SBT_NOBORDERS 0x0100 #define SBT_NOBORDERS 0x0100
#define SBT_POPOUT 0x0200 #define SBT_POPOUT 0x0200
#define SBT_RTLREADING 0x0400 #define SBT_RTLREADING 0x0400 /* not supported */
#define SBT_OWNERDRAW 0x1000 #define SBT_OWNERDRAW 0x1000
#define SBARS_SIZEGRIP 0x0100 #define SBARS_SIZEGRIP 0x0100
#define SBN_FIRST (0U-880U)
#define SBN_LAST (0U-899U)
#define SBN_SIMPLEMODECHANGE (SBN_FIRST-0)
void WINAPI MenuHelp (UINT32, WPARAM32, LPARAM, HMENU32,
HINSTANCE32, HWND32, LPUINT32);
/* UpDown */ /* UpDown */
#define UPDOWN_CLASS16 "msctls_updown" #define UPDOWN_CLASS16 "msctls_updown"
@ -200,22 +257,22 @@ typedef struct _IMAGEINFO
typedef struct _IMAGELISTDRAWPARAMS typedef struct _IMAGELISTDRAWPARAMS
{ {
DWORD cbSize; DWORD cbSize;
HIMAGELIST himl; HIMAGELIST himl;
INT32 i; INT32 i;
HDC32 hdcDst; HDC32 hdcDst;
INT32 x; INT32 x;
INT32 y; INT32 y;
INT32 cx; INT32 cx;
INT32 cy; INT32 cy;
INT32 xBitmap; // x offest from the upperleft of bitmap INT32 xBitmap; /* x offest from the upperleft of bitmap */
INT32 yBitmap; // y offset from the upperleft of bitmap INT32 yBitmap; /* y offset from the upperleft of bitmap */
COLORREF rgbBk; COLORREF rgbBk;
COLORREF rgbFg; COLORREF rgbFg;
UINT32 fStyle; UINT32 fStyle;
DWORD dwRop; DWORD dwRop;
} IMAGELISTDRAWPARAMS, *LPIMAGELISTDRAWPARAMS; } IMAGELISTDRAWPARAMS, *LPIMAGELISTDRAWPARAMS;
INT32 WINAPI ImageList_Add(HIMAGELIST,HBITMAP32,HBITMAP32); INT32 WINAPI ImageList_Add(HIMAGELIST,HBITMAP32,HBITMAP32);
@ -265,4 +322,144 @@ BOOL32 WINAPI ImageList_SetOverlayImage(HIMAGELIST,INT32,INT32);
#define ImageList_RemoveAll(himl) ImageList_Remove(himl,-1) #define ImageList_RemoveAll(himl) ImageList_Remove(himl,-1)
/* Header control */
#define WC_HEADER16 "SysHeader"
#define WC_HEADER32A "SysHeader32"
#define WC_HEADER32W L"SysHeader32"
#define WC_HEADER WINELIB_NAME_AW(WC_HEADER)
#define HDS_HORZ 0x0000
#define HDS_BUTTONS 0x0002
#define HDS_HOTTRACK 0x0004
#define HDS_HIDDEN 0x0008
#define HDS_DRAGDROP 0x0040
#define HDS_FULLDRAG 0x0080
#define HDI_WIDTH 0x0001
#define HDI_HEIGHT HDI_WIDTH
#define HDI_TEXT 0x0002
#define HDI_FORMAT 0x0004
#define HDI_LPARAM 0x0008
#define HDI_BITMAP 0x0010
#define HDI_IMAGE 0x0020
#define HDI_DI_SETITEM 0x0040
#define HDI_ORDER 0x0080
#define HDF_LEFT 0x0000
#define HDF_RIGHT 0x0001
#define HDF_CENTER 0x0002
#define HDF_JUSTIFYMASK 0x0003
#define HDF_IMAGE 0x0800
#define HDF_BITMAP_ON_RIGHT 0x1000
#define HDF_BITMAP 0x2000
#define HDF_STRING 0x4000
#define HDF_OWNERDRAW 0x8000
#define HHT_NOWHERE 0x0001
#define HHT_ONHEADER 0x0002
#define HHT_ONDIVIDER 0x0004
#define HHT_ONDIVOPEN 0x0008
#define HHT_ABOVE 0x0100
#define HHT_BELOW 0x0200
#define HHT_TORIGHT 0x0400
#define HHT_TOLEFT 0x0800
#define HDM_FIRST 0x1200
#define HDM_GETITEMCOUNT (HDM_FIRST+0)
#define HDM_INSERTITEM32A (HDM_FIRST+1)
#define HDM_INSERTITEM32W (HDM_FIRST+10)
#define HDM_INSERTITEM WINELIB_NAME_AW(HDM_INSERTITEM)
#define HDM_DELETEITEM (HDM_FIRST+2)
#define HDM_GETITEM32A (HDM_FIRST+3)
#define HDM_GETITEM32W (HDM_FIRST+11)
#define HDM_GETITEM WINELIB_NAME_AW(HDM_GETITEM)
#define HDM_SETITEM32A (HDM_FIRST+4)
#define HDM_SETITEM32W (HDM_FIRST+12)
#define HDM_SETITEM WINELIB_NAME_AW(HDM_SETITEM)
#define HDM_LAYOUT (HDM_FIRST+5)
#define HDM_HITTEST (HDM_FIRST+6)
#define HDM_GETITEMRECT (HDM_FIRST+7)
#define HDM_SETIMAGELIST (HDM_FIRST+8)
#define HDM_GETIMAGELIST (HDM_FIRST+9)
#define HDM_ORDERTOINDEX (HDM_FIRST+15)
#define HDM_CREATEDRAGIMAGE (HDM_FIRST+16)
#define HDM_GETORDERARRAY (HDM_FIRST+17)
#define HDM_SETORDERARRAY (HDM_FIRST+18)
#define HDM_SETHOTDIVIDER (HDM_FIRST+19)
#define HDN_FIRST (0U-300U)
#define HDN_LAST (0U-399U)
#define HDN_ITEMCHANGING32A (HDN_FIRST-0)
#define HDN_ITEMCHANGING32W (HDN_FIRST-20)
#define HDN_ITEMCHANGED32A (HDN_FIRST-1)
#define HDN_ITEMCHANGED32W (HDN_FIRST-21)
#define HDN_ITEMCLICK32A (HDN_FIRST-2)
#define HDN_ITEMCLICK32W (HDN_FIRST-22)
#define HDN_ITEMDBLCLICK32A (HDN_FIRST-3)
#define HDN_ITEMDBLCLICK32W (HDN_FIRST-23)
#define HDN_DIVIDERDBLCLICK32A (HDN_FIRST-5)
#define HDN_DIVIDERDBLCLICK32W (HDN_FIRST-25)
#define HDN_BEGINTRACK32A (HDN_FIRST-6)
#define HDN_BEGINTRACK32W (HDN_FIRST-26)
#define HDN_ENDTRACK32A (HDN_FIRST-7)
#define HDN_ENDTRACK32W (HDN_FIRST-27)
#define HDN_TRACK32A (HDN_FIRST-8)
#define HDN_TRACK32W (HDN_FIRST-28)
#define HDN_GETDISPINFO32A (HDN_FIRST-9)
#define HDN_GETDISPINFO32W (HDN_FIRST-29)
#define HDN_BEGINDRACK (HDN_FIRST-10)
#define HDN_ENDDRACK (HDN_FIRST-11)
#define Header_Layout(hwndHD,playout) \
(BOOL32)SendMessage32A((hwndHD),HDM_LAYOUT,0,(LPARAM)(LPHDLAYOUT)(playout))
typedef struct _HD_LAYOUT
{
RECT32 *prc;
WINDOWPOS32 *pwpos;
} HDLAYOUT, *LPHDLAYOUT;
#define HD_LAYOUT HDLAYOUT
typedef struct _HD_ITEMA
{
UINT32 mask;
INT32 cxy;
LPSTR pszText;
HBITMAP32 hbm;
INT32 cchTextMax;
INT32 fmt;
LPARAM lParam;
INT32 iImage;
INT32 iOrder;
} HD_ITEMA;
typedef struct _HD_HITTESTINFO
{
POINT32 pt;
UINT32 flags;
INT32 iItem;
} HDHITTESTINFO, *LPHDHITTESTINFO;
#define HD_HITTESTINFO HDHITTESTINFO
typedef struct tagNMHEADERA
{
NMHDR hdr;
INT32 iItem;
INT32 iButton;
HD_ITEMA *pitem;
} NMHEADERA, *LPNMHEADERA;
#endif /* __WINE_COMMCTRL_H */ #endif /* __WINE_COMMCTRL_H */

View file

@ -116,6 +116,8 @@ typedef struct {
DECL_WINELIB_TYPE_AW(OPENFILENAME); DECL_WINELIB_TYPE_AW(OPENFILENAME);
DECL_WINELIB_TYPE_AW(LPOPENFILENAME); DECL_WINELIB_TYPE_AW(LPOPENFILENAME);
typedef UINT32 (CALLBACK *LPCCHOOKPROC) (HWND32, UINT32, WPARAM32, LPARAM);
typedef struct { typedef struct {
DWORD lStructSize; DWORD lStructSize;
HWND16 hwndOwner; HWND16 hwndOwner;
@ -126,8 +128,38 @@ typedef struct {
LPARAM lCustData; LPARAM lCustData;
WNDPROC16 lpfnHook; WNDPROC16 lpfnHook;
SEGPTR lpTemplateName; SEGPTR lpTemplateName;
} CHOOSECOLOR; } CHOOSECOLOR16;
typedef CHOOSECOLOR *LPCHOOSECOLOR; typedef CHOOSECOLOR16 *LPCHOOSECOLOR16;
typedef struct {
DWORD lStructSize;
HWND32 hwndOwner;
HWND32 hInstance;
DWORD rgbResult;
LPDWORD lpCustColors;
DWORD Flags;
DWORD lCustData;
LPCCHOOKPROC lpfnHook;
LPCSTR lpTemplateName;
} CHOOSECOLOR32A;
typedef CHOOSECOLOR32A *LPCHOOSECOLOR32A;
typedef struct {
DWORD lStructSize;
HWND32 hwndOwner;
HWND32 hInstance;
DWORD rgbResult;
LPDWORD *lpCustColors;
DWORD Flags;
DWORD lCustData;
LPCCHOOKPROC lpfnHook;
LPCWSTR lpTemplateName;
} CHOOSECOLOR32W;
typedef CHOOSECOLOR32W *LPCHOOSECOLOR32W;
DECL_WINELIB_TYPE_AW(CHOOSECOLOR);
DECL_WINELIB_TYPE_AW(LPCHOOSECOLOR);
#define CC_RGBINIT 0x00000001 #define CC_RGBINIT 0x00000001
#define CC_FULLOPEN 0x00000002 #define CC_FULLOPEN 0x00000002
@ -230,6 +262,7 @@ typedef struct
/* CF_LIMITSIZE is used */ /* CF_LIMITSIZE is used */
} CHOOSEFONT16, *LPCHOOSEFONT16; } CHOOSEFONT16, *LPCHOOSEFONT16;
typedef struct typedef struct
{ {
UINT32 lStructSize; UINT32 lStructSize;
@ -452,7 +485,10 @@ typedef DEVNAMES * LPDEVNAMES;
#define CDERR_NOHOOK 0x000B #define CDERR_NOHOOK 0x000B
#define CDERR_REGISTERMSGFAIL 0x000C #define CDERR_REGISTERMSGFAIL 0x000C
BOOL16 WINAPI ChooseColor(LPCHOOSECOLOR lpChCol); BOOL16 WINAPI ChooseColor16(LPCHOOSECOLOR16 lpChCol);
BOOL32 WINAPI ChooseColor32A(LPCHOOSECOLOR32A lpChCol);
BOOL32 WINAPI ChooseColor32W(LPCHOOSECOLOR32W lpChCol);
#define ChooseColor WINELIB_NAME_AW(ChooseColor)
DWORD WINAPI CommDlgExtendedError(void); DWORD WINAPI CommDlgExtendedError(void);
HWND16 WINAPI FindText16( SEGPTR find); HWND16 WINAPI FindText16( SEGPTR find);
HWND32 WINAPI FindText32A(LPFINDREPLACE32A lpFind); HWND32 WINAPI FindText32A(LPFINDREPLACE32A lpFind);

View file

@ -39,6 +39,18 @@
/* Define if the struct statfs has the member bfree */ /* Define if the struct statfs has the member bfree */
#undef STATFS_HAS_BFREE #undef STATFS_HAS_BFREE
/* Define if we have a working sigaltstack */
#undef HAVE_WORKING_SIGALTSTACK
/* Define if the struct statfs is defined by <sys/vfs.h> */
#undef STATFS_DEFINED_BY_SYS_VFS
/* Define if the struct statfs is defined by <sys/statfs.h> */
#undef STATFS_DEFINED_BY_SYS_STATFS
/* Define if the struct statfs is defined by <sys/mount.h> */
#undef STATFS_DEFINED_BY_SYS_MOUNT
/* The number of bytes in a long long. */ /* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG #undef SIZEOF_LONG_LONG

View file

@ -21,6 +21,7 @@ extern BOOL32 DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL32 fMapColors );
extern BOOL32 DC_SetupGCForBrush( DC * dc ); extern BOOL32 DC_SetupGCForBrush( DC * dc );
extern BOOL32 DC_SetupGCForPen( DC * dc ); extern BOOL32 DC_SetupGCForPen( DC * dc );
extern BOOL32 DC_SetupGCForText( DC * dc ); extern BOOL32 DC_SetupGCForText( DC * dc );
extern void DC_UpdateXforms( DC * dc );
extern const int DC_XROPfunction[]; extern const int DC_XROPfunction[];

View file

@ -19,102 +19,105 @@
#define dbch_clipping 11 #define dbch_clipping 11
#define dbch_combo 12 #define dbch_combo 12
#define dbch_comm 13 #define dbch_comm 13
#define dbch_commdlg 14 #define dbch_commctrl 14
#define dbch_console 15 #define dbch_commdlg 15
#define dbch_crtdll 16 #define dbch_console 16
#define dbch_cursor 17 #define dbch_crtdll 17
#define dbch_dc 18 #define dbch_cursor 18
#define dbch_dde 19 #define dbch_dc 19
#define dbch_ddeml 20 #define dbch_dde 20
#define dbch_ddraw 21 #define dbch_ddeml 21
#define dbch_debug 22 #define dbch_ddraw 22
#define dbch_dialog 23 #define dbch_debug 23
#define dbch_dll 24 #define dbch_dialog 24
#define dbch_dosfs 25 #define dbch_dll 25
#define dbch_dosmem 26 #define dbch_dosfs 26
#define dbch_driver 27 #define dbch_dosmem 27
#define dbch_dsound 28 #define dbch_driver 28
#define dbch_edit 29 #define dbch_dsound 29
#define dbch_event 30 #define dbch_edit 30
#define dbch_exec 31 #define dbch_event 31
#define dbch_file 32 #define dbch_exec 32
#define dbch_fixup 33 #define dbch_file 33
#define dbch_font 34 #define dbch_fixup 34
#define dbch_gdi 35 #define dbch_font 35
#define dbch_global 36 #define dbch_gdi 36
#define dbch_graphics 37 #define dbch_global 37
#define dbch_heap 38 #define dbch_graphics 38
#define dbch_hook 39 #define dbch_header 39
#define dbch_icon 40 #define dbch_heap 40
#define dbch_imagelist 41 #define dbch_hook 41
#define dbch_int 42 #define dbch_icon 42
#define dbch_int21 43 #define dbch_imagelist 43
#define dbch_int31 44 #define dbch_int 44
#define dbch_key 45 #define dbch_int21 45
#define dbch_keyboard 46 #define dbch_int31 46
#define dbch_ldt 47 #define dbch_key 47
#define dbch_listbox 48 #define dbch_keyboard 48
#define dbch_local 49 #define dbch_ldt 49
#define dbch_mci 50 #define dbch_listbox 50
#define dbch_mcianim 51 #define dbch_local 51
#define dbch_mciwave 52 #define dbch_mci 52
#define dbch_mdi 53 #define dbch_mcianim 53
#define dbch_menu 54 #define dbch_mciwave 54
#define dbch_message 55 #define dbch_mdi 55
#define dbch_metafile 56 #define dbch_menu 56
#define dbch_midi 57 #define dbch_message 57
#define dbch_mmaux 58 #define dbch_metafile 58
#define dbch_mmio 59 #define dbch_midi 59
#define dbch_mmsys 60 #define dbch_mmaux 60
#define dbch_mmtime 61 #define dbch_mmio 61
#define dbch_module 62 #define dbch_mmsys 62
#define dbch_mpr 63 #define dbch_mmtime 63
#define dbch_msg 64 #define dbch_module 64
#define dbch_nonclient 65 #define dbch_mpr 65
#define dbch_ntdll 66 #define dbch_msg 66
#define dbch_ole 67 #define dbch_nonclient 67
#define dbch_palette 68 #define dbch_ntdll 68
#define dbch_print 69 #define dbch_ole 69
#define dbch_profile 70 #define dbch_palette 70
#define dbch_progress 71 #define dbch_print 71
#define dbch_prop 72 #define dbch_profile 72
#define dbch_reg 73 #define dbch_progress 73
#define dbch_region 74 #define dbch_prop 74
#define dbch_relay 75 #define dbch_reg 75
#define dbch_resource 76 #define dbch_region 76
#define dbch_scroll 77 #define dbch_relay 77
#define dbch_security 78 #define dbch_resource 78
#define dbch_segment 79 #define dbch_scroll 79
#define dbch_selector 80 #define dbch_security 80
#define dbch_sem 81 #define dbch_segment 81
#define dbch_sendmsg 82 #define dbch_selector 82
#define dbch_shell 83 #define dbch_sem 83
#define dbch_shm 84 #define dbch_sendmsg 84
#define dbch_sound 85 #define dbch_shell 85
#define dbch_static 86 #define dbch_shm 86
#define dbch_stress 87 #define dbch_sound 87
#define dbch_string 88 #define dbch_static 88
#define dbch_system 89 #define dbch_status 89
#define dbch_task 90 #define dbch_stress 90
#define dbch_text 91 #define dbch_string 91
#define dbch_thread 92 #define dbch_system 92
#define dbch_thunk 93 #define dbch_task 93
#define dbch_timer 94 #define dbch_text 94
#define dbch_toolhelp 95 #define dbch_thread 95
#define dbch_tweak 96 #define dbch_thunk 96
#define dbch_uitools 97 #define dbch_timer 97
#define dbch_updown 98 #define dbch_toolhelp 98
#define dbch_ver 99 #define dbch_tweak 99
#define dbch_virtual 100 #define dbch_uitools 100
#define dbch_vxd 101 #define dbch_updown 101
#define dbch_win 102 #define dbch_ver 102
#define dbch_win16drv 103 #define dbch_virtual 103
#define dbch_win32 104 #define dbch_vxd 104
#define dbch_wing 105 #define dbch_win 105
#define dbch_winsock 106 #define dbch_win16drv 106
#define dbch_wnet 107 #define dbch_win32 107
#define dbch_x11 108 #define dbch_wing 108
#define dbch_x11drv 109 #define dbch_winsock 109
#define dbch_wnet 110
#define dbch_x11 111
#define dbch_x11drv 112
/* Definitions for classes identifiers */ /* Definitions for classes identifiers */
#define dbcl_fixme 0 #define dbcl_fixme 0
#define dbcl_err 1 #define dbcl_err 1

View file

@ -4,7 +4,7 @@
#include "debugtools.h" #include "debugtools.h"
#endif #endif
#define DEBUG_CHANNEL_COUNT 110 #define DEBUG_CHANNEL_COUNT 113
#ifdef DEBUG_RUNTIME #ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = { short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0}, {1, 1, 0, 0},
@ -117,6 +117,9 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0}, {1, 1, 0, 0},
{1, 1, 0, 0}, {1, 1, 0, 0},
{1, 1, 0, 0}, {1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
}; };
const char* debug_ch_name[] = { const char* debug_ch_name[] = {
"accel", "accel",
@ -133,6 +136,7 @@ const char* debug_ch_name[] = {
"clipping", "clipping",
"combo", "combo",
"comm", "comm",
"commctrl",
"commdlg", "commdlg",
"console", "console",
"crtdll", "crtdll",
@ -157,6 +161,7 @@ const char* debug_ch_name[] = {
"gdi", "gdi",
"global", "global",
"graphics", "graphics",
"header",
"heap", "heap",
"hook", "hook",
"icon", "icon",
@ -206,6 +211,7 @@ const char* debug_ch_name[] = {
"shm", "shm",
"sound", "sound",
"static", "static",
"status",
"stress", "stress",
"string", "string",
"system", "system",

View file

@ -12,6 +12,7 @@
#include "local.h" #include "local.h"
#include "x11drv.h" #include "x11drv.h"
#include "path.h" #include "path.h"
#include <math.h>
/* GDI objects magic numbers */ /* GDI objects magic numbers */
#define PEN_MAGIC 0x4f47 #define PEN_MAGIC 0x4f47
@ -132,10 +133,10 @@ typedef struct
INT32 CursPosX; /* Current position */ INT32 CursPosX; /* Current position */
INT32 CursPosY; INT32 CursPosY;
INT32 ArcDirection; INT32 ArcDirection;
BOOL32 UseWorldXform; /* Should we use the world transform? */ XFORM xformWorld2Wnd; /* World-to-window transformation */
/* (i.e. is it not equal to the */ XFORM xformWorld2Vport; /* World-to-viewport transformation */
/* identity transformation?) */ XFORM xformVport2World; /* Inverse of the above transformation */
XFORM WorldXform; /* World transform */ BOOL32 vport2WorldValid; /* Is xformVport2World valid? */
} WIN_DC_INFO; } WIN_DC_INFO;
typedef X11DRV_PDEVICE X_DC_INFO; /* Temporary */ typedef X11DRV_PDEVICE X_DC_INFO; /* Temporary */
@ -283,6 +284,100 @@ typedef struct tagDC_FUNCS
/* Device <-> logical coords conversion */ /* Device <-> logical coords conversion */
/* A floating point version of the POINT structure */
typedef struct tagFLOAT_POINT
{
FLOAT x, y;
} FLOAT_POINT;
/* Rounds a floating point number to integer. The world-to-viewport
* transformation process is done in floating point internally. This function
* is then used to round these coordinates to integer values.
*/
static __inline__ INT32 GDI_ROUND(FLOAT val)
{
return (int)floor(val + 0.5);
}
/* Performs a viewport-to-world transformation on the specified point (which
* is in floating point format). Returns TRUE if successful, else FALSE.
*/
static __inline__ BOOL32 INTERNAL_DPTOLP_FLOAT(DC *dc, FLOAT_POINT *point)
{
FLOAT x, y;
/* Check that the viewport-to-world transformation is valid */
if (!dc->w.vport2WorldValid)
return FALSE;
/* Perform the transformation */
x = point->x;
y = point->y;
point->x = x * dc->w.xformVport2World.eM11 +
y * dc->w.xformVport2World.eM21 +
dc->w.xformVport2World.eDx;
point->y = x * dc->w.xformVport2World.eM12 +
y * dc->w.xformVport2World.eM22 +
dc->w.xformVport2World.eDy;
return TRUE;
}
/* Performs a viewport-to-world transformation on the specified point (which
* is in integer format). Returns TRUE if successful, else FALSE.
*/
static __inline__ BOOL32 INTERNAL_DPTOLP(DC *dc, LPPOINT32 point)
{
FLOAT_POINT floatPoint;
/* Perform operation with floating point */
floatPoint.x=(FLOAT)point->x;
floatPoint.y=(FLOAT)point->y;
if (!INTERNAL_DPTOLP_FLOAT(dc, &floatPoint))
return FALSE;
/* Round to integers */
point->x = GDI_ROUND(floatPoint.x);
point->y = GDI_ROUND(floatPoint.y);
return TRUE;
}
/* Performs a world-to-viewport transformation on the specified point (which
* is in floating point format).
*/
static __inline__ void INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point)
{
FLOAT x, y;
/* Perform the transformation */
x = point->x;
y = point->y;
point->x = x * dc->w.xformWorld2Vport.eM11 +
y * dc->w.xformWorld2Vport.eM21 +
dc->w.xformWorld2Vport.eDx;
point->y = x * dc->w.xformWorld2Vport.eM12 +
y * dc->w.xformWorld2Vport.eM22 +
dc->w.xformWorld2Vport.eDy;
}
/* Performs a world-to-viewport transformation on the specified point (which
* is in integer format).
*/
static __inline__ void INTERNAL_LPTODP(DC *dc, LPPOINT32 point)
{
FLOAT_POINT floatPoint;
/* Perform operation with floating point */
floatPoint.x=(FLOAT)point->x;
floatPoint.y=(FLOAT)point->y;
INTERNAL_LPTODP_FLOAT(dc, &floatPoint);
/* Round to integers */
point->x = GDI_ROUND(floatPoint.x);
point->y = GDI_ROUND(floatPoint.y);
}
#define XDPTOLP(dc,x) \ #define XDPTOLP(dc,x) \
(((x)-(dc)->vportOrgX) * (dc)->wndExtX / (dc)->vportExtX+(dc)->wndOrgX) (((x)-(dc)->vportOrgX) * (dc)->wndExtX / (dc)->vportExtX+(dc)->wndOrgX)
#define YDPTOLP(dc,y) \ #define YDPTOLP(dc,y) \

52
include/header.h Normal file
View file

@ -0,0 +1,52 @@
/*
* Header window definitions
*
* Copyright 1998 Eric Kohl
*
*/
#ifndef __WINE_HEADER_H_
#define __WINE_HEADER_H_
typedef struct
{
UINT32 mask;
INT32 cxy;
HBITMAP32 hbm;
LPSTR pszText;
INT32 cchTextMax;
INT32 fmt;
LPARAM lParam;
INT32 iImage;
INT32 iOrder;
BOOL32 bDown;
RECT32 rect;
} HEADER_ITEM;
typedef struct
{
UINT32 uNumItem;
INT32 nHeight;
HFONT32 hFont;
HCURSOR32 hcurArrow;
HCURSOR32 hcurDivider;
HCURSOR32 hcurDivopen;
BOOL32 bCaptured;
BOOL32 bPressed;
BOOL32 bTracking;
INT32 iMoveItem;
INT32 xTrackOffset;
INT32 xOldTrack;
INT32 nOldWidth;
INT32 iHotItem;
HIMAGELIST himl;
HEADER_ITEM *items;
} HEADER_INFO;
void HEADER_Register( void );
#endif /* __WINE_HEADER_H_ */

View file

@ -7,13 +7,8 @@
#include "wintypes.h" #include "wintypes.h"
#include "resource.h" #include "resource.h"
extern INT32 LIBRES_AccessResource( HINSTANCE32 hModule, HRSRC32 hRsrc ); extern HRSRC32 LIBRES_FindResource( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type );
extern HGLOBAL32 LIBRES_AllocResource( HINSTANCE32 hModule, HRSRC32 hRsrc, DWORD size );
extern HRSRC32 LIBRES_FindResource16( HINSTANCE32 hModule, LPCSTR name, LPCSTR type );
extern HRSRC32 LIBRES_FindResource32( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type );
extern BOOL32 LIBRES_FreeResource( HGLOBAL32 handle );
extern HGLOBAL32 LIBRES_LoadResource( HINSTANCE32 hModule, HRSRC32 hRsrc ); extern HGLOBAL32 LIBRES_LoadResource( HINSTANCE32 hModule, HRSRC32 hRsrc );
extern LPVOID LIBRES_LockResource( HGLOBAL32 handle );
extern DWORD LIBRES_SizeofResource( HINSTANCE32 hModule, HRSRC32 hRsrc ); extern DWORD LIBRES_SizeofResource( HINSTANCE32 hModule, HRSRC32 hRsrc );
#endif #endif /* __WINE_LIBRES_H */

View file

@ -6,13 +6,13 @@
#ifndef __WINE_LZEXPAND_H #ifndef __WINE_LZEXPAND_H
#define __WINE_LZEXPAND_H #define __WINE_LZEXPAND_H
#define LZERROR_BADINHANDLE 0xFFFF /* -1 */ #define LZERROR_BADINHANDLE -1 /* -1 */
#define LZERROR_BADOUTHANDLE 0xFFFE /* -2 */ #define LZERROR_BADOUTHANDLE -2 /* -2 */
#define LZERROR_READ 0xFFFD /* -3 */ #define LZERROR_READ -3 /* -3 */
#define LZERROR_WRITE 0xFFFC /* -4 */ #define LZERROR_WRITE -4 /* -4 */
#define LZERROR_GLOBALLOC 0xFFFB /* -5 */ #define LZERROR_GLOBALLOC -5 /* -5 */
#define LZERROR_GLOBLOCK 0xFFFA /* -6 */ #define LZERROR_GLOBLOCK -6 /* -6 */
#define LZERROR_BADVALUE 0xFFF9 /* -7 */ #define LZERROR_BADVALUE -7 /* -7 */
#define LZERROR_UNKNOWNALG 0xFFF8 /* -8 */ #define LZERROR_UNKNOWNALG -8 /* -8 */
#endif /* __WINE_LZEXPAND_H */ #endif /* __WINE_LZEXPAND_H */

13
include/main.h Normal file
View file

@ -0,0 +1,13 @@
/*
* Wine initialization definitions
*/
#ifndef __WINE_MAIN_H
#define __WINE_MAIN_H
extern BOOL32 MAIN_KernelInit(void);
extern void MAIN_Usage(char*);
extern BOOL32 MAIN_UserInit(void);
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
#endif /* __WINE_MAIN_H */

View file

@ -115,9 +115,8 @@ typedef struct _wine_modref
HMODULE32 module; HMODULE32 module;
char *modname; char *modname;
char *fullname;
char *shortname; char *shortname;
char *unixname; char *longname;
} WINE_MODREF; } WINE_MODREF;
/* Resource types */ /* Resource types */
@ -134,35 +133,28 @@ typedef struct resource_nameinfo_s NE_NAMEINFO;
(((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName) (((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
/* module.c */ /* module.c */
extern NE_MODULE *MODULE_GetPtr16( HMODULE16 hModule );
extern NE_MODULE *MODULE_GetPtr32( HMODULE32 hModule );
extern HMODULE16 MODULE_HANDLEtoHMODULE16( HANDLE32 handle );
extern int MODULE_OpenFile( HMODULE32 hModule );
extern LPSTR MODULE_GetModuleName( HMODULE32 hModule );
extern FARPROC32 MODULE_GetProcAddress32( struct _PDB32*pdb,HMODULE32 hModule,LPCSTR function ); extern FARPROC32 MODULE_GetProcAddress32( struct _PDB32*pdb,HMODULE32 hModule,LPCSTR function );
extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule ); extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule );
extern HMODULE32 MODULE_FindModule16( LPCSTR path );
extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path ); extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path );
extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, HINSTANCE16 *prev,
BOOL32 lib_only );
extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs ); extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, UINT16 uFlags, LPCSTR cmd_line, extern HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit, LPCSTR cmd_line,
LPCSTR env, UINT32 show_cmd ); LPCSTR env, UINT32 show_cmd );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name ); extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPSTR name ); extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name );
typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16,HMODULE16,HRSRC16); typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16,HMODULE16,HRSRC16);
/* loader/ne/module.c */ /* loader/ne/module.c */
extern NE_MODULE *NE_GetPtr( HMODULE16 hModule );
extern void NE_DumpModule( HMODULE16 hModule ); extern void NE_DumpModule( HMODULE16 hModule );
extern void NE_WalkModules(void); extern void NE_WalkModules(void);
extern void NE_RegisterModule( NE_MODULE *pModule ); extern void NE_RegisterModule( NE_MODULE *pModule );
extern WORD NE_GetOrdinal( HMODULE16 hModule, const char *name ); extern WORD NE_GetOrdinal( HMODULE16 hModule, const char *name );
extern FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal ); extern FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
extern BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset ); extern BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset );
extern HINSTANCE16 NE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, UINT16 flags, extern int NE_OpenFile( NE_MODULE *pModule );
LPCSTR cmd_line, LPCSTR env, extern HINSTANCE16 NE_LoadModule( LPCSTR name, HINSTANCE16 *hPrevInstance,
UINT32 show_cmd ); BOOL32 implicit, BOOL32 lib_only );
/* loader/ne/resource.c */ /* loader/ne/resource.c */
extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16); extern HGLOBAL16 WINAPI NE_DefResourceHandler(HGLOBAL16,HMODULE16,HRSRC16);
@ -173,14 +165,14 @@ extern BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum );
extern BOOL32 NE_LoadAllSegments( NE_MODULE *pModule ); extern BOOL32 NE_LoadAllSegments( NE_MODULE *pModule );
extern void NE_FixupPrologs( NE_MODULE *pModule ); extern void NE_FixupPrologs( NE_MODULE *pModule );
extern void NE_InitializeDLLs( HMODULE16 hModule ); extern void NE_InitializeDLLs( HMODULE16 hModule );
extern BOOL32 NE_CreateSegments( HMODULE16 hModule ); extern BOOL32 NE_CreateSegments( NE_MODULE *pModule );
extern HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
BOOL32 lib_only );
/* builtin.c */ /* if1632/builtin.c */
extern BOOL32 BUILTIN_Init(void); extern BOOL32 BUILTIN_Init(void);
extern HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ); extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL32 force );
extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd ); extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay,
DWORD *typemask );
extern BOOL32 BUILTIN_ParseDLLOptions( const char *str ); extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
extern void BUILTIN_PrintDLLs(void); extern void BUILTIN_PrintDLLs(void);
@ -189,6 +181,6 @@ extern HMODULE32 BUILTIN32_LoadModule( LPCSTR name, BOOL32 force,
struct _PDB32 *process ); struct _PDB32 *process );
/* if1632/builtin.c */ /* if1632/builtin.c */
extern HMODULE32 (*fnBUILTIN_LoadModule)(LPCSTR name, BOOL32 force); extern HMODULE16 (*fnBUILTIN_LoadModule)(LPCSTR name, BOOL32 force);
#endif /* __WINE_MODULE_H */ #endif /* __WINE_MODULE_H */

View file

@ -88,7 +88,6 @@ typedef struct
#define NE_FFLAGS_MULTIPLEDATA 0x0002 #define NE_FFLAGS_MULTIPLEDATA 0x0002
#define NE_FFLAGS_WIN32 0x0010 #define NE_FFLAGS_WIN32 0x0010
#define NE_FFLAGS_BUILTIN 0x0020 /* Wine built-in module */ #define NE_FFLAGS_BUILTIN 0x0020 /* Wine built-in module */
#define NE_FFLAGS_IMPLICIT 0x0040
#define NE_FFLAGS_FRAMEBUF 0x0100 /* OS/2 fullscreen app */ #define NE_FFLAGS_FRAMEBUF 0x0100 /* OS/2 fullscreen app */
#define NE_FFLAGS_CONSOLE 0x0200 /* OS/2 console app */ #define NE_FFLAGS_CONSOLE 0x0200 /* OS/2 console app */
#define NE_FFLAGS_GUI 0x0300 /* right, (NE_FFLAGS_FRAMEBUF | NE_FFLAGS_CONSOLE) */ #define NE_FFLAGS_GUI 0x0300 /* right, (NE_FFLAGS_FRAMEBUF | NE_FFLAGS_CONSOLE) */

View file

@ -15,16 +15,20 @@ extern "C" {
/* Security Ids of NT */ /* Security Ids of NT */
/* Moved to windows.h
typedef struct { typedef struct {
BYTE Value[6]; BYTE Value[6];
} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY; } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
*/
/* Moved to windows.h
typedef struct _SID { typedef struct _SID {
BYTE Revision; BYTE Revision;
BYTE SubAuthorityCount; BYTE SubAuthorityCount;
SID_IDENTIFIER_AUTHORITY IdentifierAuthority; SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
DWORD SubAuthority[1]; /* more than one */ DWORD SubAuthority[1];
} SID,*PSID,*LPSID; } SID,*PSID,*LPSID;
*/
#define SID_REVISION (1) /* Current revision */ #define SID_REVISION (1) /* Current revision */
#define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */ #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
@ -37,6 +41,7 @@ typedef struct _SID {
#define ACL_REVISION1 1 #define ACL_REVISION1 1
#define ACL_REVISION2 2 #define ACL_REVISION2 2
/* Moved to windows.h
typedef struct _ACL { typedef struct _ACL {
BYTE AclRevision; BYTE AclRevision;
BYTE Sbz1; BYTE Sbz1;
@ -44,6 +49,7 @@ typedef struct _ACL {
WORD AceCount; WORD AceCount;
WORD Sbz2; WORD Sbz2;
} ACL,*LPACL; } ACL,*LPACL;
*/
/* ACEs, directly starting after an ACL */ /* ACEs, directly starting after an ACL */
typedef struct _ACE_HEADER { typedef struct _ACE_HEADER {
@ -103,7 +109,9 @@ typedef struct _SYSTEM_ALARM_ACE {
#define SECURITY_DESCRIPTOR_REVISION 1 #define SECURITY_DESCRIPTOR_REVISION 1
#define SECURITY_DESCRIPTOR_REVISION1 1 #define SECURITY_DESCRIPTOR_REVISION1 1
/*
typedef WORD SECURITY_DESCRIPTOR_CONTROL; typedef WORD SECURITY_DESCRIPTOR_CONTROL;
*/
#define SE_OWNER_DEFAULTED 0x0001 #define SE_OWNER_DEFAULTED 0x0001
#define SE_GROUP_DEFAULTED 0x0002 #define SE_GROUP_DEFAULTED 0x0002
@ -113,6 +121,7 @@ typedef WORD SECURITY_DESCRIPTOR_CONTROL;
#define SE_SACL_DEFAULTED 0x0020 #define SE_SACL_DEFAULTED 0x0020
#define SE_SELF_RELATIVE 0x8000 #define SE_SELF_RELATIVE 0x8000
/* This was moved to windows.h
typedef struct { typedef struct {
BYTE Revision; BYTE Revision;
BYTE Sbz1; BYTE Sbz1;
@ -122,6 +131,7 @@ typedef struct {
LPACL Sacl; LPACL Sacl;
LPACL Dacl; LPACL Dacl;
} SECURITY_DESCRIPTOR,*PSECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR; } SECURITY_DESCRIPTOR,*PSECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR;
*/
typedef enum tagSID_NAME_USE { typedef enum tagSID_NAME_USE {
SidTypeUser = 1, SidTypeUser = 1,

View file

@ -5,8 +5,6 @@
#ifndef __WINE_OLE2_H #ifndef __WINE_OLE2_H
#define __WINE_OLE2_H #define __WINE_OLE2_H
typedef LONG HRESULT;
/* to be implemented */ /* to be implemented */
typedef LPVOID LPMESSAGEFILTER; typedef LPVOID LPMESSAGEFILTER;
typedef LPVOID LPDROPTARGET; typedef LPVOID LPDROPTARGET;

View file

@ -42,6 +42,8 @@ extern BOOL32 PATH_AssignGdiPath(GdiPath *pPathDest,
extern BOOL32 PATH_MoveTo(HDC32 hdc); extern BOOL32 PATH_MoveTo(HDC32 hdc);
extern BOOL32 PATH_LineTo(HDC32 hdc, INT32 x, INT32 y); extern BOOL32 PATH_LineTo(HDC32 hdc, INT32 x, INT32 y);
extern BOOL32 PATH_Rectangle(HDC32 hdc, INT32 x1, INT32 y1,
INT32 x2, INT32 y2);
extern BOOL32 PATH_Ellipse(HDC32 hdc, INT32 x1, INT32 y1, extern BOOL32 PATH_Ellipse(HDC32 hdc, INT32 x1, INT32 y1,
INT32 x2, INT32 y2); INT32 x2, INT32 y2);
extern BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2, extern BOOL32 PATH_Arc(HDC32 hdc, INT32 x1, INT32 y1, INT32 x2, INT32 y2,

View file

@ -40,8 +40,8 @@ extern HRSRC32 PE_FindResourceEx32W(struct _wine_modref*,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource32(HMODULE32,HRSRC32); extern DWORD PE_SizeofResource32(HMODULE32,HRSRC32);
extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,struct _PDB32*,HFILE32,DWORD); extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,struct _PDB32*,HFILE32,DWORD);
extern HGLOBAL32 PE_LoadResource32(struct _wine_modref *wm,HRSRC32); extern HGLOBAL32 PE_LoadResource32(struct _wine_modref *wm,HRSRC32);
extern HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, extern HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line,
LPCSTR cmd_line, LPCSTR env, UINT16 showCmd); LPCSTR env, UINT16 showCmd );
struct _PDB32; /* forward definition */ struct _PDB32; /* forward definition */
struct _THDB; /* forward definition */ struct _THDB; /* forward definition */

View file

@ -20,6 +20,6 @@ typedef struct
COLORREF ColorBk; /* Background color */ COLORREF ColorBk; /* Background color */
} PROGRESS_INFO; } PROGRESS_INFO;
LRESULT WINAPI ProgressWindowProc(HWND32, UINT32, WPARAM32, LPARAM); extern void PROGRESS_Register (void);
#endif /* __WINE_PROGRESS_H */ #endif /* __WINE_PROGRESS_H */

View file

@ -7,8 +7,7 @@
#ifndef __WINE_STATUS_H #ifndef __WINE_STATUS_H
#define __WINE_STATUS_H #define __WINE_STATUS_H
LRESULT WINAPI StatusWindowProc( HWND32 hwnd, UINT32 msg, extern void STATUS_Register(void);
WPARAM32 wParam, LPARAM lParam );
typedef struct typedef struct
{ {
@ -16,13 +15,17 @@ typedef struct
INT32 style; INT32 style;
RECT32 bound; RECT32 bound;
LPSTR text; LPSTR text;
HICON32 hIcon;
} STATUSWINDOWPART; } STATUSWINDOWPART;
typedef struct typedef struct
{ {
UINT16 numParts; UINT16 numParts;
UINT16 textHeight; UINT16 textHeight;
UINT32 height;
BOOL32 simple; BOOL32 simple;
HFONT32 hFont;
COLORREF clrBk; /* background color */
STATUSWINDOWPART part0; /* simple window */ STATUSWINDOWPART part0; /* simple window */
STATUSWINDOWPART *parts; STATUSWINDOWPART *parts;
} STATUSWINDOWINFO; } STATUSWINDOWINFO;

View file

@ -29,7 +29,6 @@ typedef struct tagNM_UPDOWN
int iDelta; int iDelta;
} NM_UPDOWN; } NM_UPDOWN;
LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, extern void UPDOWN_Register (void);
LPARAM lParam);
#endif /* __WINE_UPDOWN_H */ #endif /* __WINE_UPDOWN_H */

View file

@ -1 +1 @@
#define WINE_RELEASE_INFO "Wine release 980503" #define WINE_RELEASE_INFO "Wine release 980517"

View file

@ -1259,6 +1259,11 @@ typedef struct
FONTSIGNATURE fs; FONTSIGNATURE fs;
} CHARSETINFO,*LPCHARSETINFO; } CHARSETINFO,*LPCHARSETINFO;
/* Flags for ModifyWorldTransform */
#define MWT_IDENTITY 1
#define MWT_LEFTMULTIPLY 2
#define MWT_RIGHTMULTIPLY 3
typedef struct typedef struct
{ {
FLOAT eM11; FLOAT eM11;
@ -2212,8 +2217,26 @@ typedef struct
#define DDL_DRIVES 0x4000 #define DDL_DRIVES 0x4000
#define DDL_EXCLUSIVE 0x8000 #define DDL_EXCLUSIVE 0x8000
/* The security attributes structure typedef struct _ACL {
*/ BYTE AclRevision;
BYTE Sbz1;
WORD AclSize;
WORD AceCount;
WORD Sbz2;
} ACL, *LPACL;
typedef struct {
BYTE Value[6];
} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
typedef struct _SID {
BYTE Revision;
BYTE SubAuthorityCount;
SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
DWORD SubAuthority[1];
} SID,*PSID,*LPSID;
/* The security attributes structure */
typedef struct typedef struct
{ {
DWORD nLength; DWORD nLength;
@ -2221,6 +2244,19 @@ typedef struct
BOOL32 bInheritHandle; BOOL32 bInheritHandle;
} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; } SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef WORD SECURITY_DESCRIPTOR_CONTROL;
/* The security descriptor structure */
typedef struct {
BYTE Revision;
BYTE Sbz1;
SECURITY_DESCRIPTOR_CONTROL Control;
LPSID Owner;
LPSID Group;
LPACL Sacl;
LPACL Dacl;
} SECURITY_DESCRIPTOR, *LPSECURITY_DESCRIPTOR;
typedef DWORD SECURITY_INFORMATION; typedef DWORD SECURITY_INFORMATION;
@ -6064,7 +6100,6 @@ DWORD WINAPI SetViewportOrg(HDC16,INT16,INT16);
BOOL16 WINAPI SetWinDebugInfo(LPWINDEBUGINFO); BOOL16 WINAPI SetWinDebugInfo(LPWINDEBUGINFO);
DWORD WINAPI SetWindowExt(HDC16,INT16,INT16); DWORD WINAPI SetWindowExt(HDC16,INT16,INT16);
DWORD WINAPI SetWindowOrg(HDC16,INT16,INT16); DWORD WINAPI SetWindowOrg(HDC16,INT16,INT16);
VOID WINAPI SwitchStackBack(void);
VOID WINAPI SwitchStackTo(WORD,WORD,WORD); VOID WINAPI SwitchStackTo(WORD,WORD,WORD);
VOID WINAPI TileChildWindows(HWND16,WORD); VOID WINAPI TileChildWindows(HWND16,WORD);
INT16 WINAPI UngetCommChar(INT16,CHAR); INT16 WINAPI UngetCommChar(INT16,CHAR);
@ -6083,6 +6118,7 @@ BOOL32 WINAPI Beep(DWORD,DWORD);
BOOL32 WINAPI ClearCommError(INT32,LPDWORD,LPCOMSTAT); BOOL32 WINAPI ClearCommError(INT32,LPDWORD,LPCOMSTAT);
BOOL32 WINAPI CloseHandle(HANDLE32); BOOL32 WINAPI CloseHandle(HANDLE32);
BOOL32 WINAPI CloseServiceHandle(HANDLE32); BOOL32 WINAPI CloseServiceHandle(HANDLE32);
BOOL32 WINAPI CombineTransform(LPXFORM,const XFORM *,const XFORM *);
INT32 WINAPI CopyAcceleratorTable32A(HACCEL32,LPACCEL32,INT32); INT32 WINAPI CopyAcceleratorTable32A(HACCEL32,LPACCEL32,INT32);
INT32 WINAPI CopyAcceleratorTable32W(HACCEL32,LPACCEL32,INT32); INT32 WINAPI CopyAcceleratorTable32W(HACCEL32,LPACCEL32,INT32);
#define CopyAcceleratorTable WINELIB_NAME_AW(CopyAcceleratorTable) #define CopyAcceleratorTable WINELIB_NAME_AW(CopyAcceleratorTable)
@ -6215,6 +6251,9 @@ BOOL32 WINAPI GetHandleInformation(HANDLE32,LPDWORD);
DWORD WINAPI GetLargestConsoleWindowSize(HANDLE32); DWORD WINAPI GetLargestConsoleWindowSize(HANDLE32);
VOID WINAPI GetLocalTime(LPSYSTEMTIME); VOID WINAPI GetLocalTime(LPSYSTEMTIME);
DWORD WINAPI GetLogicalDrives(void); DWORD WINAPI GetLogicalDrives(void);
DWORD WINAPI GetLongPathName32A(LPCSTR,LPSTR,DWORD);
DWORD WINAPI GetLongPathName32W(LPCWSTR,LPWSTR,DWORD);
#define GetLongPathName WINELIB_NAME_AW(GetLongPathName)
BOOL32 WINAPI GetMenuItemInfo32A(HMENU32,UINT32,BOOL32,MENUITEMINFO32A*); BOOL32 WINAPI GetMenuItemInfo32A(HMENU32,UINT32,BOOL32,MENUITEMINFO32A*);
BOOL32 WINAPI GetMenuItemInfo32W(HMENU32,UINT32,BOOL32,MENUITEMINFO32W*); BOOL32 WINAPI GetMenuItemInfo32W(HMENU32,UINT32,BOOL32,MENUITEMINFO32W*);
#define GetMenuItemInfo WINELIB_NAME_AW(GetMenuItemInfo) #define GetMenuItemInfo WINELIB_NAME_AW(GetMenuItemInfo)
@ -6239,6 +6278,7 @@ BOOL32 WINAPI GetStringTypeEx32W(LCID,DWORD,LPCWSTR,INT32,LPWORD);
VOID WINAPI GetSystemInfo(LPSYSTEM_INFO); VOID WINAPI GetSystemInfo(LPSYSTEM_INFO);
BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS); BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
VOID WINAPI GetSystemTime(LPSYSTEMTIME); VOID WINAPI GetSystemTime(LPSYSTEMTIME);
INT32 WINAPI GetTextCharsetInfo(HDC32,LPCHARSETINFO,DWORD);
BOOL32 WINAPI GetTextExtentExPoint32A(HDC32,LPCSTR,INT32,INT32, BOOL32 WINAPI GetTextExtentExPoint32A(HDC32,LPCSTR,INT32,INT32,
LPINT32,LPINT32,LPSIZE32); LPINT32,LPINT32,LPSIZE32);
BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32, BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32,
@ -6286,6 +6326,7 @@ LPVOID WINAPI MapViewOfFileEx(HANDLE32,DWORD,DWORD,DWORD,DWORD,LPVOID);
INT32 WINAPI MessageBoxEx32A(HWND32,LPCSTR,LPCSTR,UINT32,WORD); INT32 WINAPI MessageBoxEx32A(HWND32,LPCSTR,LPCSTR,UINT32,WORD);
INT32 WINAPI MessageBoxEx32W(HWND32,LPCWSTR,LPCWSTR,UINT32,WORD); INT32 WINAPI MessageBoxEx32W(HWND32,LPCWSTR,LPCWSTR,UINT32,WORD);
#define MessageBoxEx WINELIB_NAME_AW(MessageBoxEx) #define MessageBoxEx WINELIB_NAME_AW(MessageBoxEx)
BOOL32 WINAPI ModifyWorldTransform(HDC32,const XFORM *, DWORD);
BOOL32 WINAPI MoveFile32A(LPCSTR,LPCSTR); BOOL32 WINAPI MoveFile32A(LPCSTR,LPCSTR);
BOOL32 WINAPI MoveFile32W(LPCWSTR,LPCWSTR); BOOL32 WINAPI MoveFile32W(LPCWSTR,LPCWSTR);
#define MoveFile WINELIB_NAME_AW(MoveFile) #define MoveFile WINELIB_NAME_AW(MoveFile)
@ -6326,6 +6367,9 @@ BOOL32 WINAPI ReadConsole32A(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID);
BOOL32 WINAPI ReadConsole32W(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID); BOOL32 WINAPI ReadConsole32W(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID);
#define ReadConsole WINELIB_NAME_AW(ReadConsole) #define ReadConsole WINELIB_NAME_AW(ReadConsole)
BOOL32 WINAPI ReadFile(HANDLE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED); BOOL32 WINAPI ReadFile(HANDLE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
LONG WINAPI RegConnectRegistry32A(LPCSTR,HKEY,LPHKEY);
LONG WINAPI RegConnectRegistry32W(LPCWSTR,HKEY,LPHKEY);
#define RegConnectRegistry WINELIB_NAME_AW(RegConnectRegistry)
DWORD WINAPI RegCreateKeyEx32A(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM, DWORD WINAPI RegCreateKeyEx32A(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,
LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD); LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD);
DWORD WINAPI RegCreateKeyEx32W(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM, DWORD WINAPI RegCreateKeyEx32W(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,
@ -6336,10 +6380,14 @@ DWORD WINAPI RegEnumKeyEx32A(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPSTR,
DWORD WINAPI RegEnumKeyEx32W(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPWSTR, DWORD WINAPI RegEnumKeyEx32W(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPWSTR,
LPDWORD,LPFILETIME); LPDWORD,LPFILETIME);
#define RegEnumKeyEx WINELIB_NAME_AW(RegEnumKeyEx) #define RegEnumKeyEx WINELIB_NAME_AW(RegEnumKeyEx)
LONG WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,LPVOID,LPDWORD); LONG WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,LPSECURITY_DESCRIPTOR,LPDWORD);
HANDLE32 WINAPI RegisterEventSource32A(LPCSTR,LPCSTR); HANDLE32 WINAPI RegisterEventSource32A(LPCSTR,LPCSTR);
HANDLE32 WINAPI RegisterEventSource32W(LPCWSTR,LPCWSTR); HANDLE32 WINAPI RegisterEventSource32W(LPCWSTR,LPCWSTR);
#define RegisterEventSource WINELIB_NAME_AW(RegisterEventSource) #define RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
LONG WINAPI RegLoadKey32A(HKEY,LPCSTR,LPCSTR);
LONG WINAPI RegLoadKey32W(HKEY,LPCWSTR,LPCWSTR);
#define RegLoadKey WINELIB_NAME_AW(RegLoadKey)
LONG WINAPI RegNotifyChangeKeyValue(HKEY,BOOL32,DWORD,HANDLE32,BOOL32);
DWORD WINAPI RegOpenKeyEx32W(HKEY,LPCWSTR,DWORD,REGSAM,LPHKEY); DWORD WINAPI RegOpenKeyEx32W(HKEY,LPCWSTR,DWORD,REGSAM,LPHKEY);
DWORD WINAPI RegOpenKeyEx32A(HKEY,LPCSTR,DWORD,REGSAM,LPHKEY); DWORD WINAPI RegOpenKeyEx32A(HKEY,LPCSTR,DWORD,REGSAM,LPHKEY);
#define RegOpenKeyEx WINELIB_NAME_AW(RegOpenKeyEx) #define RegOpenKeyEx WINELIB_NAME_AW(RegOpenKeyEx)
@ -7553,6 +7601,9 @@ UINT32 WINAPI GetTextAlign32(HDC32);
INT16 WINAPI GetTextCharacterExtra16(HDC16); INT16 WINAPI GetTextCharacterExtra16(HDC16);
INT32 WINAPI GetTextCharacterExtra32(HDC32); INT32 WINAPI GetTextCharacterExtra32(HDC32);
#define GetTextCharacterExtra WINELIB_NAME(GetTextCharacterExtra) #define GetTextCharacterExtra WINELIB_NAME(GetTextCharacterExtra)
INT16 WINAPI GetTextCharset16(HDC16);
INT32 WINAPI GetTextCharset32(HDC32);
#define GetTextCharset WINELIB_NAME(GetTextCharset)
COLORREF WINAPI GetTextColor16(HDC16); COLORREF WINAPI GetTextColor16(HDC16);
COLORREF WINAPI GetTextColor32(HDC32); COLORREF WINAPI GetTextColor32(HDC32);
#define GetTextColor WINELIB_NAME(GetTextColor) #define GetTextColor WINELIB_NAME(GetTextColor)
@ -8738,7 +8789,7 @@ HPEN32 WINAPI GetSysColorPen32(INT32);
INT32 WINAPI LoadMessage32A(HMODULE32,UINT32,WORD,LPSTR,INT32); INT32 WINAPI LoadMessage32A(HMODULE32,UINT32,WORD,LPSTR,INT32);
INT32 WINAPI LoadMessage32W(HMODULE32,UINT32,WORD,LPWSTR,INT32); INT32 WINAPI LoadMessage32W(HMODULE32,UINT32,WORD,LPWSTR,INT32);
SEGPTR WINAPI WIN16_GlobalLock16(HGLOBAL16); SEGPTR WINAPI WIN16_GlobalLock16(HGLOBAL16);
SEGPTR WINAPI WIN16_LockResource(HGLOBAL16); SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16);
LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG); LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG);
INT32 WINAPI lstrncmp32A(LPCSTR,LPCSTR,INT32); INT32 WINAPI lstrncmp32A(LPCSTR,LPCSTR,INT32);
INT32 WINAPI lstrncmp32W(LPCWSTR,LPCWSTR,INT32); INT32 WINAPI lstrncmp32W(LPCWSTR,LPCWSTR,INT32);

View file

@ -30,11 +30,13 @@ extern int WIN32_LastError;
#define ERROR_INVALID_HANDLE 6 #define ERROR_INVALID_HANDLE 6
#define ERROR_NOT_ENOUGH_MEMORY 8 #define ERROR_NOT_ENOUGH_MEMORY 8
#define ERROR_BAD_FORMAT 11 #define ERROR_BAD_FORMAT 11
#define ERROR_INVALID_ACCESS 12
#define ERROR_OUTOFMEMORY 14 #define ERROR_OUTOFMEMORY 14
#define ERROR_NO_MORE_FILES 18 #define ERROR_NO_MORE_FILES 18
#define ERROR_SHARING_VIOLATION 32 #define ERROR_SHARING_VIOLATION 32
#define ERROR_LOCK_VIOLATION 33 #define ERROR_LOCK_VIOLATION 33
#define ERROR_DUP_NAME 52 #define ERROR_DUP_NAME 52
#define ERROR_BAD_NETPATH 53
#define ERROR_FILE_EXISTS 80 #define ERROR_FILE_EXISTS 80
#define ERROR_CANNOT_MAKE 82 #define ERROR_CANNOT_MAKE 82
#define ERROR_INVALID_PARAMETER 87 #define ERROR_INVALID_PARAMETER 87
@ -44,6 +46,7 @@ extern int WIN32_LastError;
#define ERROR_INSUFFICIENT_BUFFER 122 #define ERROR_INSUFFICIENT_BUFFER 122
#define ERROR_SEEK_ON_DEVICE 132 #define ERROR_SEEK_ON_DEVICE 132
#define ERROR_DIR_NOT_EMPTY 145 #define ERROR_DIR_NOT_EMPTY 145
#define ERROR_BAD_PATHNAME 161
#define ERROR_BUSY 170 #define ERROR_BUSY 170
#define ERROR_ALREADY_EXISTS 183 #define ERROR_ALREADY_EXISTS 183
#define ERROR_FILENAME_EXCED_RANGE 206 #define ERROR_FILENAME_EXCED_RANGE 206
@ -53,11 +56,14 @@ extern int WIN32_LastError;
#define ERROR_TOO_MANY_POSTS 298 #define ERROR_TOO_MANY_POSTS 298
#define ERROR_INVALID_ADDRESS 487 #define ERROR_INVALID_ADDRESS 487
#define ERROR_CAN_NOT_COMPLETE 1003 #define ERROR_CAN_NOT_COMPLETE 1003
#define ERROR_BADKEY 1010 /* Config reg key invalid */
#define ERROR_CANTWRITE 1013 /* Config reg key couldn't be written */
#define ERROR_IO_DEVICE 1117 #define ERROR_IO_DEVICE 1117
#define ERROR_POSSIBLE_DEADLOCK 1131 #define ERROR_POSSIBLE_DEADLOCK 1131
#define ERROR_BAD_DEVICE 1200 #define ERROR_BAD_DEVICE 1200
#define ERROR_NO_NETWORK 1222 #define ERROR_NO_NETWORK 1222
#define ERROR_ALREADY_INITIALIZED 1247 #define ERROR_ALREADY_INITIALIZED 1247
#define ERROR_PRIVILEGE_NOT_HELD 1314
#define ERROR_COMMITMENT_LIMIT 1455 #define ERROR_COMMITMENT_LIMIT 1455
/* HRESULT values for OLE, SHELL and other Interface stuff */ /* HRESULT values for OLE, SHELL and other Interface stuff */

View file

@ -62,6 +62,9 @@
#define REG_CREATED_NEW_KEY 0x00000001 #define REG_CREATED_NEW_KEY 0x00000001
#define REG_OPENED_EXISTING_KEY 0x00000002 #define REG_OPENED_EXISTING_KEY 0x00000002
/* For RegNotifyChangeKeyValue */
#define REG_NOTIFY_CHANGE_NAME 0x1
#define KEY_QUERY_VALUE 0x00000001 #define KEY_QUERY_VALUE 0x00000001
#define KEY_SET_VALUE 0x00000002 #define KEY_SET_VALUE 0x00000002
#define KEY_CREATE_SUB_KEY 0x00000004 #define KEY_CREATE_SUB_KEY 0x00000004

View file

@ -88,6 +88,7 @@ typedef UINT32 HANDLE32;
typedef UINT16 WPARAM16; typedef UINT16 WPARAM16;
typedef UINT32 WPARAM32; typedef UINT32 WPARAM32;
typedef LONG LPARAM; typedef LONG LPARAM;
typedef LONG HRESULT;
typedef LONG LRESULT; typedef LONG LRESULT;
typedef WORD ATOM; typedef WORD ATOM;
typedef WORD CATCHBUF[9]; typedef WORD CATCHBUF[9];

View file

@ -107,6 +107,9 @@
#define WNNC_ERR_GetError 0x0001 #define WNNC_ERR_GetError 0x0001
#define WNNC_ERR_GetErrorText 0x0002 #define WNNC_ERR_GetErrorText 0x0002
#define WNDT_NORMAL 0x0
#define WNDT_NETWORK 0x1
#define WIN30X 0x0 #define WIN30X 0x0
#define WIN31X 0x1 #define WIN31X 0x1
#define WIN311X 0x2 #define WIN311X 0x2

View file

@ -76,7 +76,7 @@ HRSRC32 LIBRES_FindResource( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type )
for(Res=ResBlock->Resources; *Res; Res++) for(Res=ResBlock->Resources; *Res; Res++)
if(name) if(name)
{ {
if((*Res)->type==typeid && !lstrcmpi32W((*Res)->name,name)) if((*Res)->type==typeid && !lstrcmpi32W((LPCWSTR)(*Res)->name,name))
return (HRSRC32)*Res; return (HRSRC32)*Res;
} }
else else

View file

@ -14,6 +14,7 @@
#include "bitmap.h" #include "bitmap.h"
#include "comm.h" #include "comm.h"
#include "win.h" #include "win.h"
#include "main.h"
#include "menu.h" #include "menu.h"
#include "atom.h" #include "atom.h"
#include "dialog.h" #include "dialog.h"

View file

@ -25,18 +25,11 @@
#include "selectors.h" #include "selectors.h"
#include "stackframe.h" #include "stackframe.h"
#include "task.h" #include "task.h"
#include "toolhelp.h"
#include "debug.h" #include "debug.h"
#include "callback.h" #include "callback.h"
extern BOOL32 THREAD_InitDone; extern BOOL32 THREAD_InitDone;
extern HMODULE16 hFirstModule; /* FIXME */
static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */
static HMODULE32 MODULE_LoadModule(LPCSTR name,BOOL32 force) { return 0; }
HMODULE32 (*fnBUILTIN_LoadModule)(LPCSTR name,BOOL32 force) = MODULE_LoadModule;
/************************************************************************* /*************************************************************************
* MODULE32_LookupHMODULE * MODULE32_LookupHMODULE
@ -58,116 +51,6 @@ MODULE32_LookupHMODULE(PDB32 *process,HMODULE32 hmod) {
return NULL; return NULL;
} }
/***********************************************************************
* MODULE_GetPtr16
*/
NE_MODULE *MODULE_GetPtr16( HMODULE16 hModule )
{
return (NE_MODULE*)GlobalLock16( GetExePtr(hModule) );
}
/***********************************************************************
* MODULE_GetPtr32
*/
NE_MODULE *MODULE_GetPtr32( HMODULE32 hModule )
{
return (NE_MODULE*)GlobalLock16( MODULE_HANDLEtoHMODULE16(hModule) );
}
/***********************************************************************
* MODULE_HANDLEtoHMODULE16
*/
HMODULE16
MODULE_HANDLEtoHMODULE16(HANDLE32 handle) {
NE_MODULE *pModule;
if (HIWORD(handle))
{
WARN(module,"looking up 0x%08x in win16 function!\n",handle);
/* this is a HMODULE32 */
/* walk the list looking for the correct startaddress */
pModule = (NE_MODULE *)GlobalLock16( hFirstModule );
while (pModule)
{
if (pModule->module32 == handle) return pModule->self;
pModule = (NE_MODULE*)GlobalLock16(pModule->next);
}
return 0;
}
return GetExePtr(handle);
}
/***********************************************************************
* MODULE_OpenFile
*/
int MODULE_OpenFile( HMODULE32 hModule )
{
NE_MODULE *pModule;
DOS_FULL_NAME full_name;
char *name;
static int cachedfd = -1;
hModule = MODULE_HANDLEtoHMODULE16(hModule);
TRACE(module, "(%04x) cache: mod=%04x fd=%d\n",
hModule, hCachedModule, cachedfd );
if (!(pModule = MODULE_GetPtr32( hModule ))) return -1;
if (hCachedModule == hModule) return cachedfd;
close( cachedfd );
hCachedModule = hModule;
name = NE_MODULE_NAME( pModule );
if (!DOSFS_GetFullName( name, TRUE, &full_name ) ||
(cachedfd = open( full_name.long_name, O_RDONLY )) == -1)
WARN( module, "Can't open file '%s' for module %04x\n",
name, hModule );
TRACE(module, "opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
}
/***********************************************************************
* MODULE_CreateInstance
*
* If lib_only is TRUE, handle the module like a library even if it is a .EXE
*/
HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, HINSTANCE16 *prev,
BOOL32 lib_only )
{
SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
int minsize;
HINSTANCE16 hNewInstance;
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0;
if (pModule->dgroup == 0)
{
if (prev) *prev = hModule;
return hModule;
}
pSegment = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1;
if (prev) *prev = pSegment->selector;
/* if it's a library, create a new instance only the first time */
if (pSegment->selector)
{
if (pModule->flags & NE_FFLAGS_LIBMODULE) return pSegment->selector;
if (lib_only) return pSegment->selector;
}
minsize = pSegment->minsize ? pSegment->minsize : 0x10000;
if (pModule->ss == pModule->dgroup) minsize += pModule->stack_size;
minsize += pModule->heap_size;
hNewInstance = GLOBAL_Alloc( GMEM_ZEROINIT | GMEM_FIXED,
minsize, hModule, FALSE, FALSE, FALSE );
if (!hNewInstance) return 0;
pSegment->selector = hNewInstance;
return hNewInstance;
}
/*********************************************************************** /***********************************************************************
* MODULE_CreateDummyModule * MODULE_CreateDummyModule
@ -312,63 +195,6 @@ FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
} }
/***********************************************************************
* MODULE_GetModuleName
*/
LPSTR MODULE_GetModuleName( HMODULE32 hModule )
{
NE_MODULE *pModule;
BYTE *p, len;
static char buffer[10];
if (!(pModule = MODULE_GetPtr32( hModule ))) return NULL;
p = (BYTE *)pModule + pModule->name_table;
len = MIN( *p, 8 );
memcpy( buffer, p + 1, len );
buffer[len] = '\0';
return buffer;
}
/**********************************************************************
* MODULE_FindModule
*
* Find a module from a path name.
* RETURNS
* the win16 module handle if found
* 0 if not
*/
HMODULE32 MODULE_FindModule16(
LPCSTR path /* [in] path of the module to be found */
) {
HMODULE32 hModule = hFirstModule;
LPCSTR filename, dotptr, modulepath, modulename;
BYTE len, *name_table;
if (!(filename = strrchr( path, '\\' ))) filename = path;
else filename++;
if ((dotptr = strrchr( filename, '.' )) != NULL)
len = (BYTE)(dotptr - filename);
else len = strlen( filename );
while(hModule)
{
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!pModule) break;
modulepath = NE_MODULE_NAME(pModule);
if (!(modulename = strrchr( modulepath, '\\' )))
modulename = modulepath;
else modulename++;
if (!lstrcmpi32A( modulename, filename )) return hModule;
name_table = (BYTE *)pModule + pModule->name_table;
if ((*name_table == len) && !lstrncmpi32A(filename, name_table+1, len))
return hModule;
hModule = pModule->next;
}
return 0;
}
/********************************************************************** /**********************************************************************
* MODULE_FindModule32 * MODULE_FindModule32
* *
@ -426,105 +252,6 @@ HMODULE32 MODULE_FindModule32(
/**********************************************************************
* MODULE_CallWEP
*
* Call a DLL's WEP, allowing it to shut down.
* FIXME: we always pass the WEP WEP_FREE_DLL, never WEP_SYSTEM_EXIT
*/
static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
{
FARPROC16 WEP = (FARPROC16)0;
WORD ordinal = NE_GetOrdinal( hModule, "WEP" );
if (ordinal) WEP = NE_GetEntryPoint( hModule, ordinal );
if (!WEP)
{
WARN(module, "module %04x doesn't have a WEP\n", hModule );
return FALSE;
}
return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
}
/**********************************************************************
* MODULE_FreeModule
*
* Remove a module from memory.
*/
BOOL16 MODULE_FreeModule( HMODULE32 hModule, TDB* pTaskContext )
{
HMODULE16 *hPrevModule;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegment;
HMODULE16 *pModRef;
int i;
if (!(pModule = MODULE_GetPtr32( hModule ))) return FALSE;
hModule = pModule->self;
if (((INT16)(--pModule->count)) > 0 ) return TRUE;
else pModule->count = 0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return FALSE; /* Can't free built-in module */
if (pModule->flags & NE_FFLAGS_LIBMODULE)
{
MODULE_CallWEP( hModule );
/* Free the objects owned by the DLL module */
if( pTaskContext && pTaskContext->userhandler )
{
pTaskContext->userhandler( hModule, USIG_DLL_UNLOAD, 0,
pTaskContext->hInstance,
pTaskContext->hQueue );
}
}
/* Clear magic number just in case */
pModule->magic = pModule->self = 0;
/* Remove it from the linked list */
hPrevModule = &hFirstModule;
while (*hPrevModule && (*hPrevModule != hModule))
{
hPrevModule = &(MODULE_GetPtr16( *hPrevModule ))->next;
}
if (*hPrevModule) *hPrevModule = pModule->next;
/* Free all the segments */
pSegment = NE_SEG_TABLE( pModule );
for (i = 1; i <= pModule->seg_count; i++, pSegment++)
{
GlobalFree16( pSegment->selector );
}
/* Free the referenced modules */
pModRef = (HMODULE16*)NE_MODULE_TABLE( pModule );
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
FreeModule16( *pModRef );
}
/* Free the module storage */
if (pModule->nrname_handle) GlobalFree16( pModule->nrname_handle );
if (pModule->dlls_to_init) GlobalFree16( pModule->dlls_to_init );
GlobalFree16( hModule );
/* Remove module from cache */
if (hCachedModule == hModule) hCachedModule = 0;
return TRUE;
}
/********************************************************************** /**********************************************************************
* MODULE_Load * MODULE_Load
* *
@ -534,74 +261,34 @@ BOOL16 MODULE_FreeModule( HMODULE32 hModule, TDB* pTaskContext )
* without a preceding length byte). * without a preceding length byte).
* If cmd_line is NULL, the module is loaded as a library even if it is a .exe * If cmd_line is NULL, the module is loaded as a library even if it is a .exe
*/ */
HINSTANCE16 MODULE_Load( LPCSTR name, UINT16 uFlags, HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit,
LPCSTR cmd_line, LPCSTR env, UINT32 show_cmd ) LPCSTR cmd_line, LPCSTR env, UINT32 show_cmd )
{ {
HMODULE32 hModule; HMODULE16 hModule;
HINSTANCE16 hInstance, hPrevInstance; HINSTANCE16 hInstance, hPrevInstance;
NE_MODULE *pModule; NE_MODULE *pModule;
OFSTRUCT ofs;
HFILE32 hFile;
if (__winelib) if (__winelib)
{ {
OFSTRUCT ofs;
lstrcpyn32A( ofs.szPathName, name, sizeof(ofs.szPathName) ); lstrcpyn32A( ofs.szPathName, name, sizeof(ofs.szPathName) );
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return hModule; if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return hModule;
pModule = (NE_MODULE *)GlobalLock16( hModule ); pModule = (NE_MODULE *)GlobalLock16( hModule );
hInstance = MODULE_CreateInstance( hModule, &hPrevInstance, hInstance = NE_CreateInstance( pModule, &hPrevInstance,
(cmd_line == NULL) ); (cmd_line == NULL) );
} }
else else
{ {
hModule = MODULE_FindModule16( name ); hInstance = NE_LoadModule( name, &hPrevInstance, implicit,
(cmd_line == NULL) );
if (!hModule) /* We have to load the module */ if ((hInstance == 21) && cmd_line)
{ return PE_LoadModule( name, cmd_line, env, show_cmd );
/* Try to load the built-in first if not disabled */ }
if ((hModule = fnBUILTIN_LoadModule( name, FALSE )))
return MODULE_HANDLEtoHMODULE16( hModule );
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
{
/* Now try the built-in even if disabled */
if ((hModule = fnBUILTIN_LoadModule( name, TRUE )))
{
WARN(module, "Could not load Windows DLL '%s', using built-in module.\n", name );
return MODULE_HANDLEtoHMODULE16( hModule );
}
return 2; /* File not found */
}
/* Create the module structure */
hModule = NE_LoadModule( hFile, &ofs, uFlags, cmd_line,
env, show_cmd );
if (hModule < 32)
{
if ((hModule == 21) && cmd_line)
hModule = PE_LoadModule( hFile, &ofs, cmd_line,
env, show_cmd );
}
if (hModule < 32)
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
name, hModule );
_lclose32( hFile );
return hModule;
}
else /* module is already loaded, just create a new data segment if it's a task */
{
pModule = MODULE_GetPtr32( hModule );
hInstance = MODULE_CreateInstance( hModule, &hPrevInstance,
(cmd_line == NULL) );
if (hInstance != hPrevInstance) /* not a library */
NE_LoadSegment( pModule, pModule->dgroup );
pModule->count++;
}
} /* !winelib */
/* Create a task for this instance */ /* Create a task for this instance */
if (hInstance < 32) return hInstance;
pModule = NE_GetPtr( hInstance );
if (cmd_line && !(pModule->flags & NE_FFLAGS_LIBMODULE)) if (cmd_line && !(pModule->flags & NE_FFLAGS_LIBMODULE))
{ {
PDB32 *pdb; PDB32 *pdb;
@ -622,9 +309,8 @@ HINSTANCE16 MODULE_Load( LPCSTR name, UINT16 uFlags,
*/ */
HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock ) HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
{ {
LOADPARAMS *params = (LOADPARAMS *)paramBlock; LOADPARAMS *params;
LPSTR cmd_line = (LPSTR)PTR_SEG_TO_LIN( params->cmdLine ); LPSTR cmd_line, new_cmd_line;
LPSTR new_cmd_line;
UINT16 show_cmd = 0; UINT16 show_cmd = 0;
LPCVOID env = NULL; LPCVOID env = NULL;
HINSTANCE16 hInstance; HINSTANCE16 hInstance;
@ -649,7 +335,7 @@ HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
strcat( new_cmd_line, cmd_line ); strcat( new_cmd_line, cmd_line );
if (params->hEnvironment) env = GlobalLock16( params->hEnvironment ); if (params->hEnvironment) env = GlobalLock16( params->hEnvironment );
hInstance = MODULE_Load( name, 0, new_cmd_line, env, show_cmd ); hInstance = MODULE_Load( name, FALSE, new_cmd_line, env, show_cmd );
if (params->hEnvironment) GlobalUnlock16( params->hEnvironment ); if (params->hEnvironment) GlobalUnlock16( params->hEnvironment );
HeapFree( GetProcessHeap(), 0, new_cmd_line ); HeapFree( GetProcessHeap(), 0, new_cmd_line );
return hInstance; return hInstance;
@ -682,41 +368,12 @@ DWORD LoadModule32( LPCSTR name, LPVOID paramBlock )
CloseHandle32(pi.hThread); CloseHandle32(pi.hThread);
#else #else
return MODULE_Load( name, 0, params->lpCmdLine, params->lpEnvAddress, return MODULE_Load( name, FALSE, params->lpCmdLine, params->lpEnvAddress,
*((UINT16 *)params->lpCmdShow + 1) ); *((UINT16 *)params->lpCmdShow + 1) );
#endif #endif
} }
/**********************************************************************
* FreeModule16 (KERNEL.46)
*/
BOOL16 WINAPI FreeModule16( HMODULE16 hModule )
{
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE;
TRACE(module, "%s count %d\n",
MODULE_GetModuleName(hModule), pModule->count );
return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) );
}
/**********************************************************************
* GetModuleHandle16 (KERNEL.47)
*/
HMODULE16 WINAPI WIN16_GetModuleHandle( SEGPTR name )
{
if (HIWORD(name) == 0) return GetExePtr( (HINSTANCE16)name );
return MODULE_FindModule16( PTR_SEG_TO_LIN(name) );
}
HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )
{
return MODULE_FindModule16( name );
}
/*********************************************************************** /***********************************************************************
* GetModuleHandle (KERNEL32.237) * GetModuleHandle (KERNEL32.237)
*/ */
@ -740,52 +397,23 @@ HMODULE32 WINAPI GetModuleHandle32W(LPCWSTR module)
} }
/**********************************************************************
* GetModuleUsage (KERNEL.48)
*/
INT16 WINAPI GetModuleUsage( HINSTANCE16 hModule )
{
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0;
TRACE(module, "(%04x): returning %d\n",
hModule, pModule->count );
return pModule->count;
}
/**********************************************************************
* GetModuleFileName16 (KERNEL.49)
*/
INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
INT16 nSize )
{
NE_MODULE *pModule;
if (!hModule) hModule = GetCurrentTask();
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName);
}
/*********************************************************************** /***********************************************************************
* GetModuleFileName32A (KERNEL32.235) * GetModuleFileName32A (KERNEL32.235)
* FIXME FIXME
*/ */
DWORD WINAPI GetModuleFileName32A( HMODULE32 hModule, LPSTR lpFileName, DWORD WINAPI GetModuleFileName32A(
DWORD size ) HMODULE32 hModule, /* [in] module handle (32bit) */
{ LPSTR lpFileName, /* [out] filenamebuffer */
NE_MODULE *pModule; DWORD size /* [in] size of filenamebuffer */
) {
if (!hModule) WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule);
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() ); if (!wm) /* can happen on start up or the like */
hModule = pTask->hInstance; return 0;
}
if (!(pModule = MODULE_GetPtr32( hModule ))) return 0; /* FIXME: we should probably get a real long name, but wm->longname
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size ); * is currently a UNIX filename!
*/
lstrcpyn32A( lpFileName, wm->shortname, size );
TRACE(module, "%s\n", lpFileName ); TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName); return strlen(lpFileName);
} }
@ -805,19 +433,6 @@ DWORD WINAPI GetModuleFileName32W( HMODULE32 hModule, LPWSTR lpFileName,
} }
/**********************************************************************
* GetModuleName (KERNEL.27)
*/
BOOL16 WINAPI GetModuleName( HINSTANCE16 hinst, LPSTR buf, INT16 nSize )
{
LPSTR name = MODULE_GetModuleName(hinst);
if (!name) return FALSE;
lstrcpyn32A( buf, name, nSize );
return TRUE;
}
/*********************************************************************** /***********************************************************************
* LoadLibraryEx32W (KERNEL.513) * LoadLibraryEx32W (KERNEL.513)
* FIXME * FIXME
@ -882,29 +497,8 @@ HMODULE32 WINAPI LoadLibraryEx32W(LPCWSTR libnameW,HFILE32 hfile,DWORD flags)
*/ */
BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule) BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule)
{ {
TRACE(module,"hLibModule=%08x\n", hLibModule); WARN(module,"(%08x): stub\n", hLibModule);
return MODULE_FreeModule(hLibModule,GlobalLock16(GetCurrentTask()) ); return TRUE; /* FIXME */
}
/***********************************************************************
* LoadLibrary (KERNEL.95)
*/
HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
{
HINSTANCE16 handle;
TRACE(module, "(%08x) %s\n", (int)libname, libname);
handle = MODULE_Load( libname, 0, NULL, NULL, 0 );
if (handle == (HINSTANCE16)2) /* file not found */
{
char buffer[256];
lstrcpyn32A( buffer, libname, 252 );
strcat( buffer, ".dll" );
handle = MODULE_Load( buffer, 0, NULL, NULL, 0 );
}
return handle;
} }
@ -919,15 +513,6 @@ HINSTANCE32 WINAPI PrivateLoadLibrary(LPCSTR libname)
} }
/***********************************************************************
* FreeLibrary16 (KERNEL.96)
*/
void WINAPI FreeLibrary16( HINSTANCE16 handle )
{
TRACE(module,"%04x\n", handle );
FreeModule16( handle );
}
/*********************************************************************** /***********************************************************************
* PrivateFreeLibrary (KERNEL32) * PrivateFreeLibrary (KERNEL32)
@ -1001,7 +586,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
{ {
/* Winelib: Use LoadModule() only for the program itself */ /* Winelib: Use LoadModule() only for the program itself */
if (__winelib) use_load_module = 0; if (__winelib) use_load_module = 0;
handle = MODULE_Load( filename, 0, lpCmdLine, NULL, nCmdShow ); handle = MODULE_Load( filename, FALSE, lpCmdLine, NULL, nCmdShow );
if (handle == 2) /* file not found */ if (handle == 2) /* file not found */
{ {
/* Check that the original file name did not have a suffix */ /* Check that the original file name did not have a suffix */
@ -1011,7 +596,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
{ {
p = filename + strlen(filename); p = filename + strlen(filename);
strcpy( p, ".exe" ); strcpy( p, ".exe" );
handle = MODULE_Load( filename, 0, lpCmdLine, handle = MODULE_Load( filename, FALSE, lpCmdLine,
NULL, nCmdShow ); NULL, nCmdShow );
*p = '\0'; /* Remove extension */ *p = '\0'; /* Remove extension */
} }
@ -1094,7 +679,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
* WIN32_GetProcAddress16 (KERNEL32.36) * WIN32_GetProcAddress16 (KERNEL32.36)
* Get procaddress in 16bit module from win32... (kernel32 undoc. ordinal func) * Get procaddress in 16bit module from win32... (kernel32 undoc. ordinal func)
*/ */
FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPSTR name ) FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPCSTR name )
{ {
WORD ordinal; WORD ordinal;
FARPROC16 ret; FARPROC16 ret;
@ -1103,7 +688,12 @@ FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPSTR name )
WARN(module,"hModule may not be 0!\n"); WARN(module,"hModule may not be 0!\n");
return (FARPROC16)0; return (FARPROC16)0;
} }
hModule = MODULE_HANDLEtoHMODULE16(hModule); if (HIWORD(hModule))
{
WARN( module, "hModule is Win32 handle (%08x)\n", hModule );
return (FARPROC16)0;
}
hModule = GetExePtr( hModule );
if (HIWORD(name)) { if (HIWORD(name)) {
ordinal = NE_GetOrdinal( hModule, name ); ordinal = NE_GetOrdinal( hModule, name );
TRACE(module, "%04x '%s'\n", TRACE(module, "%04x '%s'\n",
@ -1201,78 +791,3 @@ LPIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE32 hModule)
if (!wm || (wm->type != MODULE32_PE)) return (LPIMAGE_NT_HEADERS)0; if (!wm || (wm->type != MODULE32_PE)) return (LPIMAGE_NT_HEADERS)0;
return PE_HEADER(wm->module); return PE_HEADER(wm->module);
} }
/**********************************************************************
* GetExpWinVer (KERNEL.167)
*/
WORD WINAPI GetExpWinVer( HMODULE16 hModule )
{
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
return pModule ? pModule->expected_version : 0;
}
/**********************************************************************
* IsSharedSelector (KERNEL.345)
*/
BOOL16 WINAPI IsSharedSelector( HANDLE16 selector )
{
/* Check whether the selector belongs to a DLL */
NE_MODULE *pModule = MODULE_GetPtr16( selector );
if (!pModule) return FALSE;
return (pModule->flags & NE_FFLAGS_LIBMODULE) != 0;
}
/**********************************************************************
* ModuleFirst (TOOLHELP.59)
*/
BOOL16 WINAPI ModuleFirst( MODULEENTRY *lpme )
{
lpme->wNext = hFirstModule;
return ModuleNext( lpme );
}
/**********************************************************************
* ModuleNext (TOOLHELP.60)
*/
BOOL16 WINAPI ModuleNext( MODULEENTRY *lpme )
{
NE_MODULE *pModule;
char *name;
if (!lpme->wNext) return FALSE;
if (!(pModule = MODULE_GetPtr16( lpme->wNext ))) return FALSE;
name = (char *)pModule + pModule->name_table;
memcpy( lpme->szModule, name + 1, *name );
lpme->szModule[(BYTE)*name] = '\0';
lpme->hModule = lpme->wNext;
lpme->wcUsage = pModule->count;
strncpy( lpme->szExePath, NE_MODULE_NAME(pModule), MAX_PATH );
lpme->szExePath[MAX_PATH] = '\0';
lpme->wNext = pModule->next;
return TRUE;
}
/**********************************************************************
* ModuleFindName (TOOLHELP.61)
*/
BOOL16 WINAPI ModuleFindName( MODULEENTRY *lpme, LPCSTR name )
{
lpme->wNext = GetModuleHandle16( name );
return ModuleNext( lpme );
}
/**********************************************************************
* ModuleFindHandle (TOOLHELP.62)
*/
BOOL16 WINAPI ModuleFindHandle( MODULEENTRY *lpme, HMODULE16 hModule )
{
hModule = GetExePtr( hModule );
lpme->wNext = hModule;
return ModuleNext( lpme );
}

View file

@ -5,15 +5,36 @@
*/ */
#include <assert.h> #include <assert.h>
#include <fcntl.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "module.h" #include "module.h"
#include "file.h"
#include "ldt.h" #include "ldt.h"
#include "callback.h"
#include "heap.h" #include "heap.h"
#include "task.h"
#include "global.h" #include "global.h"
#include "process.h" #include "process.h"
#include "toolhelp.h"
#include "debug.h" #include "debug.h"
HMODULE16 hFirstModule = 0; static HMODULE16 hFirstModule = 0;
static NE_MODULE *pCachedModule = 0; /* Module cached by NE_OpenFile */
static HMODULE16 NE_LoadBuiltin(LPCSTR name,BOOL32 force) { return 0; }
HMODULE16 (*fnBUILTIN_LoadModule)(LPCSTR name,BOOL32 force) = NE_LoadBuiltin;
/***********************************************************************
* NE_GetPtr
*/
NE_MODULE *NE_GetPtr( HMODULE16 hModule )
{
return (NE_MODULE *)GlobalLock16( GetExePtr(hModule) );
}
/*********************************************************************** /***********************************************************************
* NE_DumpModule * NE_DumpModule
@ -26,7 +47,7 @@ void NE_DumpModule( HMODULE16 hModule )
WORD *pword; WORD *pword;
NE_MODULE *pModule; NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( hModule ))) if (!(pModule = NE_GetPtr( hModule )))
{ {
fprintf( stderr, "**** %04x is not a module handle\n", hModule ); fprintf( stderr, "**** %04x is not a module handle\n", hModule );
return; return;
@ -99,8 +120,9 @@ void NE_DumpModule( HMODULE16 hModule )
pword = (WORD *)((BYTE *)pModule + pModule->modref_table); pword = (WORD *)((BYTE *)pModule + pModule->modref_table);
for (i = 0; i < pModule->modref_count; i++, pword++) for (i = 0; i < pModule->modref_count; i++, pword++)
{ {
DUMP( "%d: %04x -> '%s'\n", i, *pword, char name[10];
MODULE_GetModuleName(*pword)); GetModuleName( *pword, name, sizeof(name) );
DUMP( "%d: %04x -> '%s'\n", i, *pword, name );
} }
} }
else DUMP( "None\n" ); else DUMP( "None\n" );
@ -170,7 +192,7 @@ void NE_WalkModules(void)
fprintf( stderr, "Module Flags Name\n" ); fprintf( stderr, "Module Flags Name\n" );
while (hModule) while (hModule)
{ {
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule) if (!pModule)
{ {
fprintf( stderr, "**** Bad module %04x in list\n", hModule ); fprintf( stderr, "**** Bad module %04x in list\n", hModule );
@ -205,7 +227,7 @@ WORD NE_GetOrdinal( HMODULE16 hModule, const char *name )
BYTE len; BYTE len;
NE_MODULE *pModule; NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0; if (!(pModule = NE_GetPtr( hModule ))) return 0;
assert( !(pModule->flags & NE_FFLAGS_WIN32) ); assert( !(pModule->flags & NE_FFLAGS_WIN32) );
TRACE( module, "(%04x,'%s')\n", hModule, name ); TRACE( module, "(%04x,'%s')\n", hModule, name );
@ -270,7 +292,7 @@ FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
BYTE *p; BYTE *p;
WORD sel, offset; WORD sel, offset;
if (!(pModule = MODULE_GetPtr16( hModule ))) return 0; if (!(pModule = NE_GetPtr( hModule ))) return 0;
assert( !(pModule->flags & NE_FFLAGS_WIN32) ); assert( !(pModule->flags & NE_FFLAGS_WIN32) );
p = (BYTE *)pModule + pModule->entry_table; p = (BYTE *)pModule + pModule->entry_table;
@ -321,7 +343,7 @@ BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset )
WORD curOrdinal = 1; WORD curOrdinal = 1;
BYTE *p; BYTE *p;
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE; if (!(pModule = NE_GetPtr( hModule ))) return FALSE;
assert( !(pModule->flags & NE_FFLAGS_WIN32) ); assert( !(pModule->flags & NE_FFLAGS_WIN32) );
p = (BYTE *)pModule + pModule->entry_table; p = (BYTE *)pModule + pModule->entry_table;
@ -355,10 +377,36 @@ BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset )
} }
/***********************************************************************
* NE_OpenFile
*/
int NE_OpenFile( NE_MODULE *pModule )
{
DOS_FULL_NAME full_name;
char *name;
static int cachedfd = -1;
TRACE( module, "(%p) cache: mod=%p fd=%d\n",
pModule, pCachedModule, cachedfd );
if (pCachedModule == pModule) return cachedfd;
close( cachedfd );
pCachedModule = pModule;
name = NE_MODULE_NAME( pModule );
if (!DOSFS_GetFullName( name, TRUE, &full_name ) ||
(cachedfd = open( full_name.long_name, O_RDONLY )) == -1)
WARN( module, "Can't open file '%s' for module %04x\n",
name, pModule->self );
TRACE(module, "opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
}
/*********************************************************************** /***********************************************************************
* NE_LoadExeHeader * NE_LoadExeHeader
*/ */
static HMODULE16 NE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs ) static HMODULE16 NE_LoadExeHeader( HFILE16 hFile, OFSTRUCT *ofs )
{ {
IMAGE_DOS_HEADER mz_header; IMAGE_DOS_HEADER mz_header;
IMAGE_OS2_HEADER ne_header; IMAGE_OS2_HEADER ne_header;
@ -374,23 +422,23 @@ static HMODULE16 NE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
((fastload && ((offset) >= fastload_offset) && \ ((fastload && ((offset) >= fastload_offset) && \
((offset)+(size) <= fastload_offset+fastload_length)) ? \ ((offset)+(size) <= fastload_offset+fastload_length)) ? \
(memcpy( buffer, fastload+(offset)-fastload_offset, (size) ), TRUE) : \ (memcpy( buffer, fastload+(offset)-fastload_offset, (size) ), TRUE) : \
(_llseek32( hFile, (offset), SEEK_SET), \ (_llseek16( hFile, (offset), SEEK_SET), \
_lread32( hFile, (buffer), (size) ) == (size))) _hread16( hFile, (buffer), (size) ) == (size)))
_llseek32( hFile, 0, SEEK_SET ); _llseek16( hFile, 0, SEEK_SET );
if ((_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) || if ((_hread16(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
(mz_header.e_magic != IMAGE_DOS_SIGNATURE)) (mz_header.e_magic != IMAGE_DOS_SIGNATURE))
return (HMODULE16)11; /* invalid exe */ return (HMODULE16)11; /* invalid exe */
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET ); _llseek16( hFile, mz_header.e_lfanew, SEEK_SET );
if (_lread32( hFile, &ne_header, sizeof(ne_header) ) != sizeof(ne_header)) if (_hread16( hFile, &ne_header, sizeof(ne_header) ) != sizeof(ne_header))
return (HMODULE16)11; /* invalid exe */ return (HMODULE16)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_NT_SIGNATURE) return (HMODULE16)21; /* win32 exe */ if (ne_header.ne_magic == IMAGE_NT_SIGNATURE) return (HMODULE16)21; /* win32 exe */
if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return (HMODULE16)11; /* invalid exe */ if (ne_header.ne_magic != IMAGE_OS2_SIGNATURE) return (HMODULE16)11; /* invalid exe */
if (ne_header.ne_magic == IMAGE_OS2_SIGNATURE_LX) { if (ne_header.ne_magic == IMAGE_OS2_SIGNATURE_LX) {
fprintf(stderr, "Sorry, this is an OS/2 linear executable (LX) file !\n"); MSG("Sorry, this is an OS/2 linear executable (LX) file !\n");
return (HMODULE16)12; return (HMODULE16)12;
} }
@ -425,7 +473,7 @@ static HMODULE16 NE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
/* Clear internal Wine flags in case they are set in the EXE file */ /* Clear internal Wine flags in case they are set in the EXE file */
pModule->flags &= ~(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32|NE_FFLAGS_IMPLICIT); pModule->flags &= ~(NE_FFLAGS_BUILTIN | NE_FFLAGS_WIN32);
/* Read the fast-load area */ /* Read the fast-load area */
@ -437,11 +485,11 @@ static HMODULE16 NE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
fastload_offset, fastload_length ); fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL) if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
{ {
_llseek32( hFile, fastload_offset, SEEK_SET); _llseek16( hFile, fastload_offset, SEEK_SET);
if (_lread32(hFile, fastload, fastload_length) != fastload_length) if (_hread16(hFile, fastload, fastload_length) != fastload_length)
{ {
HeapFree( SystemHeap, 0, fastload ); HeapFree( SystemHeap, 0, fastload );
fprintf(stderr, "Error reading fast-load area !\n"); WARN( module, "Error reading fast-load area!\n");
fastload = NULL; fastload = NULL;
} }
} }
@ -575,8 +623,8 @@ static HMODULE16 NE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
return (HMODULE16)11; /* invalid exe */ return (HMODULE16)11; /* invalid exe */
} }
buffer = GlobalLock16( pModule->nrname_handle ); buffer = GlobalLock16( pModule->nrname_handle );
_llseek32( hFile, ne_header.nrname_tab_offset, SEEK_SET ); _llseek16( hFile, ne_header.nrname_tab_offset, SEEK_SET );
if (_lread32( hFile, buffer, ne_header.nrname_tab_length ) if (_hread16( hFile, buffer, ne_header.nrname_tab_length )
!= ne_header.nrname_tab_length) != ne_header.nrname_tab_length)
{ {
GlobalFree16( pModule->nrname_handle ); GlobalFree16( pModule->nrname_handle );
@ -620,19 +668,18 @@ static BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
for (i = 0; i < pModule->modref_count; i++, pModRef++) for (i = 0; i < pModule->modref_count; i++, pModRef++)
{ {
char buffer[256]; char buffer[260];
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef; BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr ); memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" ); strcpy( buffer + *pstr, ".dll" );
TRACE(module, "Loading '%s'\n", buffer ); TRACE(module, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule16( buffer ))) if (!(*pModRef = GetModuleHandle16( buffer )))
{ {
/* If the DLL is not loaded yet, load it and store */ /* If the DLL is not loaded yet, load it and store */
/* its handle in the list of DLLs to initialize. */ /* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL; HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT, if ((hDLL = NE_LoadModule( buffer, NULL, TRUE, TRUE )) == 2)
NULL, NULL, 0 )) == 2)
{ {
/* file not found */ /* file not found */
char *p; char *p;
@ -642,13 +689,13 @@ static BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
if (!(p = strrchr( buffer, '\\' ))) p = buffer; if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr ); memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" ); strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT, NULL, NULL, 0); hDLL = NE_LoadModule( buffer, NULL, TRUE, TRUE );
} }
if (hDLL < 32) if (hDLL < 32)
{ {
/* FIXME: cleanup what was done */ /* FIXME: cleanup what was done */
fprintf( stderr, "Could not load '%s' required by '%.*s', error = %d\n", WARN( module, "Could not load '%s' required by '%.*s', error=%d\n",
buffer, *((BYTE*)pModule + pModule->name_table), buffer, *((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, hDLL ); (char *)pModule + pModule->name_table + 1, hDLL );
return FALSE; return FALSE;
@ -658,7 +705,7 @@ static BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
} }
else /* Increment the reference count of the DLL */ else /* Increment the reference count of the DLL */
{ {
NE_MODULE *pOldDLL = MODULE_GetPtr16( *pModRef ); NE_MODULE *pOldDLL = NE_GetPtr( *pModRef );
if (pOldDLL) pOldDLL->count++; if (pOldDLL) pOldDLL->count++;
} }
} }
@ -675,24 +722,60 @@ static BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
* without a preceding length byte). * without a preceding length byte).
* If cmd_line is NULL, the module is loaded as a library even if it is a .exe * If cmd_line is NULL, the module is loaded as a library even if it is a .exe
*/ */
HINSTANCE16 NE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, UINT16 flags, HINSTANCE16 NE_LoadModule( LPCSTR name, HINSTANCE16 *hPrevInstance,
LPCSTR cmd_line, LPCSTR env, UINT32 show_cmd ) BOOL32 implicit, BOOL32 lib_only )
{ {
HMODULE16 hModule; HMODULE16 hModule;
HINSTANCE16 hInstance; HINSTANCE16 hInstance;
NE_MODULE *pModule; NE_MODULE *pModule;
HFILE16 hFile;
OFSTRUCT ofs;
/* Check if the module is already loaded */
if ((hModule = GetModuleHandle16( name )) != 0)
{
HINSTANCE16 prev;
pModule = NE_GetPtr( hModule );
hInstance = NE_CreateInstance( pModule, &prev, lib_only );
if (hInstance != prev) /* not a library */
NE_LoadSegment( pModule, pModule->dgroup );
pModule->count++;
if (hPrevInstance) *hPrevInstance = prev;
return hInstance;
}
if (hPrevInstance) *hPrevInstance = 0;
/* Try to load the built-in first if not disabled */
if ((hModule = fnBUILTIN_LoadModule( name, FALSE ))) return hModule;
if ((hFile = OpenFile16( name, &ofs, OF_READ )) == HFILE_ERROR16)
{
/* Now try the built-in even if disabled */
if ((hModule = fnBUILTIN_LoadModule( name, TRUE )))
{
WARN(module, "Could not load Windows DLL '%s', using built-in module.\n", name );
return hModule;
}
return 2; /* File not found */
}
/* Create the module structure */ /* Create the module structure */
if ((hModule = NE_LoadExeHeader( hFile, ofs )) < 32) return hModule; hModule = NE_LoadExeHeader( hFile, &ofs );
_lclose16( hFile );
pModule = MODULE_GetPtr16( hModule ); if (hModule < 32) return hModule;
pModule->flags |= flags; /* stamp implicitly loaded modules */ pModule = NE_GetPtr( hModule );
/* Allocate the segments for this module */ /* Allocate the segments for this module */
NE_CreateSegments( hModule ); if (!NE_CreateSegments( pModule ) ||
hInstance = MODULE_CreateInstance( hModule, NULL, (cmd_line == NULL) ); !(hInstance = NE_CreateInstance( pModule, NULL, lib_only )))
{
GlobalFreeAll( hModule );
return 8; /* Insufficient memory */
}
/* Load the referenced DLLs */ /* Load the referenced DLLs */
@ -716,21 +799,307 @@ HINSTANCE16 NE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, UINT16 flags,
* when we load implicitly linked DLLs this will be done by InitTask(). * when we load implicitly linked DLLs this will be done by InitTask().
*/ */
if ((pModule->flags & (NE_FFLAGS_LIBMODULE | NE_FFLAGS_IMPLICIT)) == if (!implicit && (pModule->flags & NE_FFLAGS_LIBMODULE))
NE_FFLAGS_LIBMODULE)
NE_InitializeDLLs( hModule ); NE_InitializeDLLs( hModule );
/* Create a task for this instance */
if (cmd_line && !(pModule->flags & NE_FFLAGS_LIBMODULE))
{
PDB32 *pdb;
pModule->flags |= NE_FFLAGS_GUI;
pdb = PROCESS_Create( pModule, cmd_line, env, hInstance, 0, show_cmd );
if (pdb && (GetNumTasks() > 1)) Yield16();
}
return hInstance; return hInstance;
} }
/***********************************************************************
* LoadLibrary (KERNEL.95)
*/
HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
{
HINSTANCE16 handle;
LPCSTR p;
char *new_name;
TRACE(module, "(%08x) %s\n", (int)libname, libname);
/* Check for an extension */
if ((p = strrchr( libname, '.')) && !strchr( p, '/' ) && !strchr( p, '\\'))
{
/* An extension is present -> use the name as is */
return NE_LoadModule( libname, NULL, FALSE, TRUE );
}
/* Now append .dll before loading */
if (!(new_name = HeapAlloc( GetProcessHeap(), 0, strlen(libname) + 4 )))
return 0;
strcpy( new_name, libname );
strcat( new_name, ".dll" );
handle = NE_LoadModule( new_name, NULL, FALSE, TRUE );
HeapFree( GetProcessHeap(), 0, new_name );
return handle;
}
/**********************************************************************
* MODULE_CallWEP
*
* Call a DLL's WEP, allowing it to shut down.
* FIXME: we always pass the WEP WEP_FREE_DLL, never WEP_SYSTEM_EXIT
*/
static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
{
FARPROC16 WEP = (FARPROC16)0;
WORD ordinal = NE_GetOrdinal( hModule, "WEP" );
if (ordinal) WEP = NE_GetEntryPoint( hModule, ordinal );
if (!WEP)
{
WARN(module, "module %04x doesn't have a WEP\n", hModule );
return FALSE;
}
return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
}
/**********************************************************************
* NE_FreeModule
*
* Implementation of FreeModule16().
*/
static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL32 call_wep )
{
HMODULE16 *hPrevModule;
NE_MODULE *pModule;
HMODULE16 *pModRef;
int i;
if (!(pModule = NE_GetPtr( hModule ))) return FALSE;
hModule = pModule->self;
TRACE( module, "%04x count %d\n", hModule, pModule->count );
if (((INT16)(--pModule->count)) > 0 ) return TRUE;
else pModule->count = 0;
if (pModule->flags & NE_FFLAGS_BUILTIN)
return FALSE; /* Can't free built-in module */
if (call_wep)
{
if (pModule->flags & NE_FFLAGS_LIBMODULE)
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
MODULE_CallWEP( hModule );
/* Free the objects owned by the DLL module */
if (pTask && pTask->userhandler)
pTask->userhandler( hModule, USIG_DLL_UNLOAD, 0,
pTask->hInstance, pTask->hQueue );
}
else
call_wep = FALSE; /* We are freeing a task -> no more WEPs */
}
/* Clear magic number just in case */
pModule->magic = pModule->self = 0;
/* Remove it from the linked list */
hPrevModule = &hFirstModule;
while (*hPrevModule && (*hPrevModule != hModule))
{
hPrevModule = &(NE_GetPtr( *hPrevModule ))->next;
}
if (*hPrevModule) *hPrevModule = pModule->next;
/* Free the referenced modules */
pModRef = (HMODULE16*)NE_MODULE_TABLE( pModule );
for (i = 0; i < pModule->modref_count; i++, pModRef++)
{
NE_FreeModule( *pModRef, call_wep );
}
/* Free the module storage */
GlobalFreeAll( hModule );
/* Remove module from cache */
if (pCachedModule == pModule) pCachedModule = NULL;
return TRUE;
}
/**********************************************************************
* FreeModule16 (KERNEL.46)
*/
BOOL16 WINAPI FreeModule16( HMODULE16 hModule )
{
return NE_FreeModule( hModule, TRUE );
}
/***********************************************************************
* FreeLibrary16 (KERNEL.96)
*/
void WINAPI FreeLibrary16( HINSTANCE16 handle )
{
TRACE(module,"%04x\n", handle );
FreeModule16( handle );
}
/**********************************************************************
* GetModuleName (KERNEL.27)
*/
BOOL16 WINAPI GetModuleName( HINSTANCE16 hinst, LPSTR buf, INT16 count )
{
NE_MODULE *pModule;
BYTE *p;
if (!(pModule = NE_GetPtr( hinst ))) return FALSE;
p = (BYTE *)pModule + pModule->name_table;
if (count > *p) count = *p + 1;
if (count > 0)
{
memcpy( buf, p + 1, count - 1 );
buf[count-1] = '\0';
}
return TRUE;
}
/**********************************************************************
* GetModuleUsage (KERNEL.48)
*/
INT16 WINAPI GetModuleUsage( HINSTANCE16 hModule )
{
NE_MODULE *pModule = NE_GetPtr( hModule );
return pModule ? pModule->count : 0;
}
/**********************************************************************
* GetExpWinVer (KERNEL.167)
*/
WORD WINAPI GetExpWinVer( HMODULE16 hModule )
{
NE_MODULE *pModule = NE_GetPtr( hModule );
return pModule ? pModule->expected_version : 0;
}
/**********************************************************************
* GetModuleFileName16 (KERNEL.49)
*/
INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
INT16 nSize )
{
NE_MODULE *pModule;
if (!hModule) hModule = GetCurrentTask();
if (!(pModule = NE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName);
}
/**********************************************************************
* GetModuleHandle16 (KERNEL.47)
*
* Find a module from a path name.
*
* RETURNS
* the win16 module handle if found
* 0 if not
*/
HMODULE16 WINAPI WIN16_GetModuleHandle( SEGPTR name )
{
if (HIWORD(name) == 0) return GetExePtr( (HINSTANCE16)name );
return GetModuleHandle16( PTR_SEG_TO_LIN(name) );
}
HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )
{
HMODULE16 hModule = hFirstModule;
LPCSTR filename, dotptr, modulepath, modulename;
BYTE len, *name_table;
if (!(filename = strrchr( name, '\\' ))) filename = name;
else filename++;
if ((dotptr = strrchr( filename, '.' )) != NULL)
len = (BYTE)(dotptr - filename);
else len = strlen( filename );
while (hModule)
{
NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule) break;
modulepath = NE_MODULE_NAME(pModule);
if (!(modulename = strrchr( modulepath, '\\' )))
modulename = modulepath;
else modulename++;
if (!lstrcmpi32A( modulename, filename )) return hModule;
name_table = (BYTE *)pModule + pModule->name_table;
if ((*name_table == len) && !lstrncmpi32A(filename, name_table+1, len))
return hModule;
hModule = pModule->next;
}
return 0;
}
/**********************************************************************
* ModuleFirst (TOOLHELP.59)
*/
BOOL16 WINAPI ModuleFirst( MODULEENTRY *lpme )
{
lpme->wNext = hFirstModule;
return ModuleNext( lpme );
}
/**********************************************************************
* ModuleNext (TOOLHELP.60)
*/
BOOL16 WINAPI ModuleNext( MODULEENTRY *lpme )
{
NE_MODULE *pModule;
char *name;
if (!lpme->wNext) return FALSE;
if (!(pModule = NE_GetPtr( lpme->wNext ))) return FALSE;
name = (char *)pModule + pModule->name_table;
memcpy( lpme->szModule, name + 1, *name );
lpme->szModule[(BYTE)*name] = '\0';
lpme->hModule = lpme->wNext;
lpme->wcUsage = pModule->count;
strncpy( lpme->szExePath, NE_MODULE_NAME(pModule), MAX_PATH );
lpme->szExePath[MAX_PATH] = '\0';
lpme->wNext = pModule->next;
return TRUE;
}
/**********************************************************************
* ModuleFindName (TOOLHELP.61)
*/
BOOL16 WINAPI ModuleFindName( MODULEENTRY *lpme, LPCSTR name )
{
lpme->wNext = GetModuleHandle16( name );
return ModuleNext( lpme );
}
/**********************************************************************
* ModuleFindHandle (TOOLHELP.62)
*/
BOOL16 WINAPI ModuleFindHandle( MODULEENTRY *lpme, HMODULE16 hModule )
{
hModule = GetExePtr( hModule );
lpme->wNext = hModule;
return ModuleNext( lpme );
}

View file

@ -183,8 +183,8 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
HRSRC16 hRsrc ) HRSRC16 hRsrc )
{ {
int fd; int fd;
NE_MODULE* pModule = MODULE_GetPtr16( hModule ); NE_MODULE* pModule = NE_GetPtr( hModule );
if ( pModule && (fd = MODULE_OpenFile( hModule )) >= 0) if (pModule && (fd = NE_OpenFile( pModule )) >= 0)
{ {
HGLOBAL16 handle; HGLOBAL16 handle;
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table); WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
@ -215,7 +215,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
*/ */
BOOL32 NE_InitResourceHandler( HMODULE16 hModule ) BOOL32 NE_InitResourceHandler( HMODULE16 hModule )
{ {
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2); NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
TRACE(resource,"InitResourceHandler[%04x]\n", hModule ); TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
@ -236,7 +236,7 @@ FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR typeId,
FARPROC16 resourceHandler ) FARPROC16 resourceHandler )
{ {
FARPROC16 prevHandler = NULL; FARPROC16 prevHandler = NULL;
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2); NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
if (!pModule || !pModule->res_table) return NULL; if (!pModule || !pModule->res_table) return NULL;
@ -264,7 +264,7 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
NE_TYPEINFO *pTypeInfo; NE_TYPEINFO *pTypeInfo;
HRSRC16 hRsrc; HRSRC16 hRsrc;
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table) return 0; if (!pModule || !pModule->res_table) return 0;
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */ assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
@ -333,7 +333,7 @@ HGLOBAL16 WINAPI AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
NE_NAMEINFO *pNameInfo=NULL; NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift; WORD sizeShift;
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return 0; if (!pModule || !pModule->res_table || !hRsrc) return 0;
TRACE( resource, "module=%04x res=%04x size=%ld\n", hModule, hRsrc, size ); TRACE( resource, "module=%04x res=%04x size=%ld\n", hModule, hRsrc, size );
@ -361,7 +361,7 @@ HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
if (!(hInstance = GetExePtr( hInstance ))) return 0; if (!(hInstance = GetExePtr( hInstance ))) return 0;
if(wType != 0x10) /* 0x10 is the only observed value, passed from if(wType != 0x10) /* 0x10 is the only observed value, passed from
CreateCursorIndirect. */ CreateCursorIndirect. */
fprintf(stderr, "DirectResAlloc: wType = %x\n", wType); TRACE(resource, "(wType=%x)\n", wType);
return GLOBAL_Alloc(GMEM_MOVEABLE, wSize, hInstance, FALSE, FALSE, FALSE); return GLOBAL_Alloc(GMEM_MOVEABLE, wSize, hInstance, FALSE, FALSE, FALSE);
} }
@ -373,7 +373,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{ {
HFILE32 fd; HFILE32 fd;
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return -1; if (!pModule || !pModule->res_table || !hRsrc) return -1;
TRACE(resource, "module=%04x res=%04x\n", hModule, hRsrc ); TRACE(resource, "module=%04x res=%04x\n", hModule, hRsrc );
@ -398,7 +398,7 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
NE_NAMEINFO *pNameInfo=NULL; NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift; WORD sizeShift;
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table) return 0; if (!pModule || !pModule->res_table) return 0;
TRACE(resource, "module=%04x res=%04x\n", hModule, hRsrc ); TRACE(resource, "module=%04x res=%04x\n", hModule, hRsrc );
@ -418,7 +418,7 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
{ {
NE_TYPEINFO *pTypeInfo; NE_TYPEINFO *pTypeInfo;
NE_NAMEINFO *pNameInfo = NULL; NE_NAMEINFO *pNameInfo = NULL;
NE_MODULE *pModule = MODULE_GetPtr16( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
int d; int d;
TRACE( resource, "module=%04x res=%04x\n", hModule, hRsrc ); TRACE( resource, "module=%04x res=%04x\n", hModule, hRsrc );
@ -464,7 +464,7 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
loader = (RESOURCEHANDLER16)pTypeInfo->resloader; loader = (RESOURCEHANDLER16)pTypeInfo->resloader;
else /* this is really bad */ else /* this is really bad */
{ {
fprintf( stderr, "[%04x]: Missing resource handler!!!...\n", hModule); ERR(resource, "[%04x]: Missing resource handler!\n", hModule);
loader = NE_DefResourceHandler; loader = NE_DefResourceHandler;
} }
@ -513,8 +513,7 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
NE_TYPEINFO *pTypeInfo; NE_TYPEINFO *pTypeInfo;
NE_NAMEINFO *pNameInfo; NE_NAMEINFO *pNameInfo;
WORD count; WORD count;
HMODULE16 hModule = GetExePtr( handle ); NE_MODULE *pModule = NE_GetPtr( GetExePtr(handle) );
NE_MODULE *pModule = MODULE_GetPtr16( hModule );
if (!handle || !pModule || !pModule->res_table) return handle; if (!handle || !pModule || !pModule->res_table) return handle;
@ -545,7 +544,7 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
} }
TRACE(resource, "[%04x]: no intrinsic resource for %04x, assuming DirectResAlloc()!\n", TRACE(resource, "[%04x]: no intrinsic resource for %04x, assuming DirectResAlloc()!\n",
hModule, handle ); pModule->self, handle );
GlobalFree16( handle ); GlobalFree16( handle );
return handle; return handle;
} }

View file

@ -72,7 +72,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (!pSeg->filepos) return TRUE; /* No file image, just return */ if (!pSeg->filepos) return TRUE; /* No file image, just return */
fd = MODULE_OpenFile( pModule->self ); fd = NE_OpenFile( pModule );
TRACE(module, "Loading segment %d, selector=%04x, flags=%04x\n", TRACE(module, "Loading segment %d, selector=%04x, flags=%04x\n",
segnum, pSeg->selector, pSeg->flags ); segnum, pSeg->selector, pSeg->flags );
lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET ); lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
@ -118,8 +118,8 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
pSeg->minsize ? pSeg->minsize : 0x10000); pSeg->minsize ? pSeg->minsize : 0x10000);
FreeSelector(newselector); FreeSelector(newselector);
pSeg->selector = oldselector; pSeg->selector = oldselector;
fprintf(stderr, "A new selector was allocated for the dgroup segment\n" TRACE(module, "New selector allocated for dgroup segment:Old=%d,New=%d\n",
"Old selector is %d, new one is %d", oldselector, newselector); oldselector, newselector);
} else { } else {
FreeSelector(pSeg->selector); FreeSelector(pSeg->selector);
pSeg->selector = newselector; pSeg->selector = newselector;
@ -201,22 +201,22 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
address = NE_GetEntryPoint( module, ordinal ); address = NE_GetEntryPoint( module, ordinal );
if (!address) if (!address)
{ {
NE_MODULE *pTarget = MODULE_GetPtr16( module ); NE_MODULE *pTarget = NE_GetPtr( module );
if (!pTarget) if (!pTarget)
fprintf( stderr, "Module not found: %04x, reference %d of module %*.*s\n", WARN(module, "Module not found: %04x, reference %d of module %*.*s\n",
module, rep->target1, module, rep->target1,
*((BYTE *)pModule + pModule->name_table), *((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table), *((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1 ); (char *)pModule + pModule->name_table + 1 );
else else
fprintf( stderr, "Warning: no handler for %.*s.%d, setting to 0:0\n", WARN(module, "No handler for %.*s.%d, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, (char *)pTarget + pTarget->name_table + 1,
ordinal ); ordinal );
} }
if (TRACE_ON(fixup)) if (TRACE_ON(fixup))
{ {
NE_MODULE *pTarget = MODULE_GetPtr16( module ); NE_MODULE *pTarget = NE_GetPtr( module );
TRACE( fixup, "%d: %.*s.%d=%04x:%04x %s\n", i + 1, TRACE( fixup, "%d: %.*s.%d=%04x:%04x %s\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, (char *)pTarget + pTarget->name_table + 1,
@ -236,14 +236,14 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (ERR_ON(fixup) && !address) if (ERR_ON(fixup) && !address)
{ {
NE_MODULE *pTarget = MODULE_GetPtr16( module ); NE_MODULE *pTarget = NE_GetPtr( module );
ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n", ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name ); (char *)pTarget + pTarget->name_table + 1, func_name );
} }
if (TRACE_ON(fixup)) if (TRACE_ON(fixup))
{ {
NE_MODULE *pTarget = MODULE_GetPtr16( module ); NE_MODULE *pTarget = NE_GetPtr( module );
TRACE( fixup, "%d: %.*s.%s=%04x:%04x %s\n", i + 1, TRACE( fixup, "%d: %.*s.%s=%04x:%04x %s\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, (char *)pTarget + pTarget->name_table + 1,
@ -288,8 +288,12 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
/* Apparently, high bit of address_type is sometimes set; */ /* Apparently, high bit of address_type is sometimes set; */
/* we ignore it for now */ /* we ignore it for now */
if (rep->address_type > NE_RADDR_OFFSET32) if (rep->address_type > NE_RADDR_OFFSET32)
{
char module[10];
GetModuleName( pModule->self, module, sizeof(module) );
ERR( fixup, "WARNING: module %s: unknown reloc addr type = 0x%02x. Please report.\n", ERR( fixup, "WARNING: module %s: unknown reloc addr type = 0x%02x. Please report.\n",
MODULE_GetModuleName(pModule->self), rep->address_type ); module, rep->address_type );
}
if (additive) if (additive)
{ {
@ -405,7 +409,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
stack16Top->ip = 0; stack16Top->ip = 0;
stack16Top->cs = 0; stack16Top->cs = 0;
hf = FILE_DupUnixHandle( MODULE_OpenFile( pModule->self ) ); hf = FILE_DupUnixHandle( NE_OpenFile( pModule ) );
Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self, hf); Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self, hf);
_lclose32(hf); _lclose32(hf);
/* some BootApp procs overwrite the selector of dgroup */ /* some BootApp procs overwrite the selector of dgroup */
@ -490,7 +494,7 @@ void NE_FixupPrologs( NE_MODULE *pModule )
if (pModule->flags & NE_FFLAGS_MULTIPLEDATA) if (pModule->flags & NE_FFLAGS_MULTIPLEDATA)
{ {
/* can this happen? */ /* can this happen? */
fprintf( stderr, "FixupPrologs got confused\n" ); ERR(fixup, "FixupPrologs got confused\n" );
} }
else if (pModule->flags & NE_FFLAGS_SINGLEDATA) else if (pModule->flags & NE_FFLAGS_SINGLEDATA)
{ {
@ -523,9 +527,8 @@ void NE_FixupPrologs( NE_MODULE *pModule )
* *
* Call the DLL initialization code * Call the DLL initialization code
*/ */
static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule ) static BOOL32 NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
{ {
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable; SEGTABLEENTRY *pSegTable;
CONTEXT context; CONTEXT context;
@ -536,7 +539,6 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
* es:si command line (always 0) * es:si command line (always 0)
*/ */
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE;
pSegTable = NE_SEG_TABLE( pModule ); pSegTable = NE_SEG_TABLE( pModule );
if (!(pModule->flags & NE_FFLAGS_LIBMODULE) || if (!(pModule->flags & NE_FFLAGS_LIBMODULE) ||
@ -548,7 +550,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
if (pTask && pTask->userhandler) if (pTask && pTask->userhandler)
{ {
pTask->userhandler( hModule, USIG_DLL_LOAD, 0, pTask->hInstance, pTask->userhandler( pModule->self, USIG_DLL_LOAD, 0, pTask->hInstance,
pTask->hQueue ); pTask->hQueue );
} }
@ -561,7 +563,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
if (pModule->flags & NE_FFLAGS_MULTIPLEDATA || pModule->dgroup) if (pModule->flags & NE_FFLAGS_MULTIPLEDATA || pModule->dgroup)
{ {
/* Not SINGLEDATA */ /* Not SINGLEDATA */
fprintf(stderr, "Library is not marked SINGLEDATA\n"); ERR(dll, "Library is not marked SINGLEDATA\n");
exit(1); exit(1);
} }
else /* DATA NONE DLL */ else /* DATA NONE DLL */
@ -589,7 +591,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
EIP_reg(&context) = pModule->ip; EIP_reg(&context) = pModule->ip;
EBP_reg(&context) = OFFSETOF(THREAD_Current()->cur_stack) EBP_reg(&context) = OFFSETOF(THREAD_Current()->cur_stack)
+ (WORD)&((STACK16FRAME*)0)->bp; + (WORD)&((STACK16FRAME*)0)->bp;
EDI_reg(&context) = DS_reg(&context) ? DS_reg(&context) : hModule; EDI_reg(&context) = DS_reg(&context) ? DS_reg(&context) : pModule->self;
pModule->cs = 0; /* Don't initialize it twice */ pModule->cs = 0; /* Don't initialize it twice */
@ -600,6 +602,44 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
return TRUE; return TRUE;
} }
/***********************************************************************
* NE_CallDllEntryPoint
*
* Call the DllEntryPoint of DLLs with subsystem >= 4.0
*/
static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
{
FARPROC16 entryPoint;
WORD ordinal;
CONTEXT context;
THDB *thdb = THREAD_Current();
LPBYTE stack = (LPBYTE)THREAD_STACK16(thdb);
if (pModule->expected_version < 0x0400) return;
if (!(ordinal = NE_GetOrdinal( pModule->self, "DllEntryPoint" ))) return;
if (!(entryPoint = NE_GetEntryPoint( pModule->self, ordinal ))) return;
memset( &context, 0, sizeof(context) );
CS_reg(&context) = HIWORD(entryPoint);
IP_reg(&context) = LOWORD(entryPoint);
EBP_reg(&context) = OFFSETOF( thdb->cur_stack )
+ (WORD)&((STACK16FRAME*)0)->bp;
*(DWORD *)(stack - 4) = dwReason; /* dwReason */
*(WORD *) (stack - 6) = pModule->self; /* hInst */
*(WORD *) (stack - 8) = 0; /* wDS */
*(WORD *) (stack - 10) = 0; /* wHeapSize */
*(DWORD *)(stack - 14) = 0; /* dwReserved1 */
*(WORD *) (stack - 16) = 0; /* wReserved2 */
TRACE(dll, "Calling DllEntryPoint, cs:ip=%04lx:%04x\n",
CS_reg(&context), IP_reg(&context));
Callbacks->CallRegisterShortProc( &context, 16 );
}
/*********************************************************************** /***********************************************************************
* NE_InitializeDLLs * NE_InitializeDLLs
@ -613,8 +653,8 @@ void NE_InitializeDLLs( HMODULE16 hModule )
NE_MODULE *pModule; NE_MODULE *pModule;
HMODULE16 *pDLL; HMODULE16 *pDLL;
if (!(pModule = MODULE_GetPtr16( hModule ))) return; if (!(pModule = NE_GetPtr( hModule ))) return;
if (pModule->flags & NE_FFLAGS_WIN32) return; assert( !(pModule->flags & NE_FFLAGS_WIN32) );
if (pModule->dlls_to_init) if (pModule->dlls_to_init)
{ {
@ -626,7 +666,47 @@ void NE_InitializeDLLs( HMODULE16 hModule )
} }
GlobalFree16( to_init ); GlobalFree16( to_init );
} }
NE_InitDLL( pTask, hModule ); NE_InitDLL( pTask, pModule );
NE_CallDllEntryPoint( pModule, DLL_PROCESS_ATTACH );
}
/***********************************************************************
* NE_CreateInstance
*
* If lib_only is TRUE, handle the module like a library even if it is a .EXE
*/
HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
BOOL32 lib_only )
{
SEGTABLEENTRY *pSegment;
int minsize;
HINSTANCE16 hNewInstance;
if (pModule->dgroup == 0)
{
if (prev) *prev = pModule->self;
return pModule->self;
}
pSegment = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1;
if (prev) *prev = pSegment->selector;
/* if it's a library, create a new instance only the first time */
if (pSegment->selector)
{
if (pModule->flags & NE_FFLAGS_LIBMODULE) return pSegment->selector;
if (lib_only) return pSegment->selector;
}
minsize = pSegment->minsize ? pSegment->minsize : 0x10000;
if (pModule->ss == pModule->dgroup) minsize += pModule->stack_size;
minsize += pModule->heap_size;
hNewInstance = GLOBAL_Alloc( GMEM_ZEROINIT | GMEM_FIXED, minsize,
pModule->self, FALSE, FALSE, FALSE );
if (!hNewInstance) return 0;
pSegment->selector = hNewInstance;
return hNewInstance;
} }
@ -639,7 +719,7 @@ void NE_InitializeDLLs( HMODULE16 hModule )
/* It does nothing */ /* It does nothing */
void WINAPI PatchCodeHandle(HANDLE16 hSel) void WINAPI PatchCodeHandle(HANDLE16 hSel)
{ {
fprintf(stderr,"PatchCodeHandle(%04x),stub!\n",hSel); FIXME(module,"(%04x): stub.\n",hSel);
} }
@ -682,13 +762,11 @@ DWORD WINAPI NE_AllocateSegment( WORD wFlags, WORD wSize, WORD wElem )
/*********************************************************************** /***********************************************************************
* NE_CreateSegments * NE_CreateSegments
*/ */
BOOL32 NE_CreateSegments( HMODULE16 hModule ) BOOL32 NE_CreateSegments( NE_MODULE *pModule )
{ {
SEGTABLEENTRY *pSegment; SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
int i, minsize; int i, minsize;
if (!(pModule = MODULE_GetPtr16( hModule ))) return FALSE;
assert( !(pModule->flags & NE_FFLAGS_WIN32) ); assert( !(pModule->flags & NE_FFLAGS_WIN32) );
pSegment = NE_SEG_TABLE( pModule ); pSegment = NE_SEG_TABLE( pModule );
@ -696,10 +774,10 @@ BOOL32 NE_CreateSegments( HMODULE16 hModule )
{ {
minsize = pSegment->minsize ? pSegment->minsize : 0x10000; minsize = pSegment->minsize ? pSegment->minsize : 0x10000;
if (i == pModule->ss) minsize += pModule->stack_size; if (i == pModule->ss) minsize += pModule->stack_size;
/* The DGROUP is allocated by MODULE_CreateInstance */ /* The DGROUP is allocated by NE_CreateInstance */
if (i == pModule->dgroup) continue; if (i == pModule->dgroup) continue;
pSegment->selector = GLOBAL_Alloc( NE_Ne2MemFlags(pSegment->flags), pSegment->selector = GLOBAL_Alloc( NE_Ne2MemFlags(pSegment->flags),
minsize, hModule, minsize, pModule->self,
!(pSegment->flags & NE_SEGFLAGS_DATA), !(pSegment->flags & NE_SEGFLAGS_DATA),
FALSE, FALSE,
FALSE /*pSegment->flags & NE_SEGFLAGS_READONLY*/ ); FALSE /*pSegment->flags & NE_SEGFLAGS_READONLY*/ );
@ -710,3 +788,15 @@ BOOL32 NE_CreateSegments( HMODULE16 hModule )
(pModule->dgroup - 1) * sizeof(SEGTABLEENTRY) : 0; (pModule->dgroup - 1) * sizeof(SEGTABLEENTRY) : 0;
return TRUE; return TRUE;
} }
/**********************************************************************
* IsSharedSelector (KERNEL.345)
*/
BOOL16 WINAPI IsSharedSelector( HANDLE16 selector )
{
/* Check whether the selector belongs to a DLL */
NE_MODULE *pModule = NE_GetPtr( selector );
if (!pModule) return FALSE;
return (pModule->flags & NE_FFLAGS_LIBMODULE) != 0;
}

View file

@ -241,18 +241,14 @@ DWORD fixup_imports (PDB32 *process,WINE_MODREF *wm)
/* don't use MODULE_Load, Win32 creates new task differently */ /* don't use MODULE_Load, Win32 creates new task differently */
res = PE_LoadLibraryEx32A( name, process, 0, 0 ); res = PE_LoadLibraryEx32A( name, process, 0, 0 );
if (res <= (HMODULE32) 32) { if (res <= (HMODULE32) 32) {
char buffer[1024]; char *p,buffer[2000];
/* Try with prepending the path of the current module */ /* GetModuleFileName would use the wrong process, so don't use it */
if (GetModuleFileName32A( wm->module, buffer, sizeof (buffer))) { strcpy(buffer,wm->shortname);
char *p; if (!(p = strrchr (buffer, '\\')))
p = buffer;
if (!(p = strrchr (buffer, '\\'))) strcpy (p + 1, name);
p = buffer; res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
strcpy (p + 1, name);
res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
} else
ERR(win32,"cannot find the module just loaded!\n");
} }
if (res <= (HMODULE32) 32) { if (res <= (HMODULE32) 32) {
WARN (module, "Module %s not found\n", name); WARN (module, "Module %s not found\n", name);
@ -533,36 +529,32 @@ error:
/********************************************************************** /**********************************************************************
* This maps a loaded PE dll into the address space of the specified process. * This maps a loaded PE dll into the address space of the specified process.
*/ */
static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process, static BOOL32 PE_MapImage( PDB32 *process,WINE_MODREF *wm, OFSTRUCT *ofs, DWORD flags )
OFSTRUCT *ofs, DWORD flags )
{ {
WINE_MODREF *wm;
PE_MODREF *pem; PE_MODREF *pem;
int i, result; int i, result;
DWORD load_addr; DWORD load_addr;
IMAGE_DATA_DIRECTORY dir; IMAGE_DATA_DIRECTORY dir;
char *modname; char *modname;
int vma_size; int vma_size;
HMODULE32 hModule = *phModule; HMODULE32 hModule = wm->module;
IMAGE_SECTION_HEADER *pe_seg; IMAGE_SECTION_HEADER *pe_seg;
IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hModule; IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hModule;
IMAGE_NT_HEADERS *nt_header = PE_HEADER(hModule); IMAGE_NT_HEADERS *nt_header = PE_HEADER(hModule);
wm = (WINE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,
sizeof(*wm));
wm->type= MODULE32_PE;
pem = &(wm->binfmt.pe); pem = &(wm->binfmt.pe);
/* NOTE: fixup_imports takes care of the correct order */ result = GetLongPathName32A(ofs->szPathName,NULL,0);
wm->next = process->modref_list; wm->longname = (char*)HeapAlloc(process->heap,0,result+1);
process->modref_list = wm; GetLongPathName32A(ofs->szPathName,wm->longname,result+1);
wm->shortname = HEAP_strdupA(process->heap,0,ofs->szPathName);
if (!(nt_header->FileHeader.Characteristics & IMAGE_FILE_DLL)) if (!(nt_header->FileHeader.Characteristics & IMAGE_FILE_DLL))
{ {
if (process->exe_modref) if (process->exe_modref)
WARN(win32,"overwriting old exe_modref... arrgh\n"); FIXME(win32,"overwriting old exe_modref... arrgh\n");
process->exe_modref = wm; process->exe_modref = wm;
} }
@ -577,10 +569,10 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
MEM_RESERVE | MEM_COMMIT, MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE ); PAGE_EXECUTE_READWRITE );
} }
/* *phModule is the module32 entry in the NE_MODULE. We need to /* NOTE: this changes a value in the process modref chain, which can
* change it here, since it can get referenced by fixup_imports() * be accessed independently from this function
*/ */
wm->module = *phModule = (HMODULE32)load_addr; wm->module = (HMODULE32)load_addr;
TRACE(win32, "Load addr is really %lx, range %x\n", TRACE(win32, "Load addr is really %lx, range %x\n",
load_addr, vma_size); load_addr, vma_size);
@ -713,8 +705,6 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
modname = s = ofs->szPathName; modname = s = ofs->szPathName;
while ((s=strchr(modname,'\\'))) while ((s=strchr(modname,'\\')))
modname = s+1; modname = s+1;
if ((s=strchr(modname,'.')))
*s='\0';
wm->modname = HEAP_strdupA(process->heap,0,modname); wm->modname = HEAP_strdupA(process->heap,0,modname);
} }
if(pem->pe_import) { if(pem->pe_import) {
@ -760,13 +750,9 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
WINE_MODREF *wm; WINE_MODREF *wm;
if ((hModule = MODULE_FindModule32( process, name ))) { if ((hModule = MODULE_FindModule32( process, name ))) {
pModule = MODULE_GetPtr32(hModule);
for (wm= process->modref_list;wm;wm=wm->next) for (wm= process->modref_list;wm;wm=wm->next)
if (wm->module == hModule) { if (wm->module == hModule)
pModule->count++;
return hModule; return hModule;
}
/* Since MODULE_FindModule32 uses the modref chain too, the /* Since MODULE_FindModule32 uses the modref chain too, the
* module MUST have been found above. If not, something has gone * module MUST have been found above. If not, something has gone
* terribly wrong. * terribly wrong.
@ -781,31 +767,55 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) { if (HFILE_ERROR32==(hFile=OpenFile32(name,&ofs,OF_READ))) {
/* Now try the built-in even if disabled */ /* Now try the built-in even if disabled */
if ((hModule = BUILTIN32_LoadModule( name, TRUE, process ))) { if ((hModule = BUILTIN32_LoadModule( name, TRUE, process ))) {
fprintf( stderr, "Warning: could not load external DLL '%s', using built-in module.\n", name ); WARN( module, "Could not load external DLL '%s', using built-in module.\n", name );
return hModule; return hModule;
} }
return 1; return 1;
} }
/* will go away ... */
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) { if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) {
_lclose32(hFile); _lclose32(hFile);
return hModule; return hModule;
} }
pModule = (NE_MODULE *)GlobalLock16( hModule ); pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32; pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = PE_LoadImage( hFile ); /* .. */
wm=(WINE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,sizeof(*wm));
wm->type = MODULE32_PE;
/* NOTE: fixup_imports takes care of the correct order */
wm->next = process->modref_list;
process->modref_list = wm;
wm->module = pModule->module32 = PE_LoadImage( hFile );
CloseHandle( hFile ); CloseHandle( hFile );
if (pModule->module32 < 32) if (wm->module < 32)
{ {
FreeLibrary32( hModule); process->modref_list = wm->next;
HeapFree(process->heap,0,wm);
ERR(win32,"can't load %s\n",ofs.szPathName);
return 21; /* FIXME: probably 0 */ return 21; /* FIXME: probably 0 */
} }
/* (possible) recursion */ /* (possible) recursion */
if (!PE_MapImage( &(pModule->module32), process, &ofs,flags)) { if (!PE_MapImage(process,wm,&ofs,flags)) {
/* FIXME: should free this module and its referenced ones */ /* ERROR cleanup ... */
return 0; WINE_MODREF **xwm;
ERR(win32,"couldn't load %s\n",ofs.szPathName);
/* unlink from process modref chain */
for ( xwm=&(process->modref_list);
*xwm && (*xwm!=wm);
xwm=&((*xwm)->next)
) /* EMPTY */;
if (*xwm)
*xwm=(*xwm)->next;
return 0;
} }
return pModule->module32; pModule->module32 = wm->module;
return wm->module;
} }
/***************************************************************************** /*****************************************************************************
@ -813,23 +823,30 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
* FIXME: this function should use PE_LoadLibraryEx32A, but currently can't * FIXME: this function should use PE_LoadLibraryEx32A, but currently can't
* due to the PROCESS_Create stuff. * due to the PROCESS_Create stuff.
*/ */
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LPCSTR cmd_line, HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line,
LPCSTR env, UINT16 show_cmd ) LPCSTR env, UINT16 show_cmd )
{ {
HMODULE16 hModule16; HMODULE16 hModule16;
HMODULE32 hModule32; HMODULE32 hModule32;
HINSTANCE16 hInstance; HINSTANCE16 hInstance;
NE_MODULE *pModule; NE_MODULE *pModule;
HFILE32 hFile;
OFSTRUCT ofs;
THDB *thdb = THREAD_Current(); THDB *thdb = THREAD_Current();
PDB32 *process;
if ((hModule16 = MODULE_CreateDummyModule( ofs )) < 32) return hModule16; WINE_MODREF *wm;
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
return 2; /* File not found */
if ((hModule16 = MODULE_CreateDummyModule( &ofs )) < 32) return hModule16;
pModule = (NE_MODULE *)GlobalLock16( hModule16 ); pModule = (NE_MODULE *)GlobalLock16( hModule16 );
pModule->flags = NE_FFLAGS_WIN32; pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = hModule32 = PE_LoadImage( hFile ); pModule->module32 = hModule32 = PE_LoadImage( hFile );
if (hModule32 < 32) return 21; if (hModule32 < 32) return 21;
hInstance = MODULE_CreateInstance( hModule16, NULL, (cmd_line == NULL) ); hInstance = NE_CreateInstance( pModule, NULL, (cmd_line == NULL) );
if (cmd_line && if (cmd_line &&
!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL)) !(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
{ {
@ -838,11 +855,21 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LPCSTR cmd_line,
TDB *pTask = (TDB *)GlobalLock16( pdb->task ); TDB *pTask = (TDB *)GlobalLock16( pdb->task );
thdb = pTask->thdb; thdb = pTask->thdb;
} }
if (!PE_MapImage( &(pModule->module32), thdb->process, ofs, 0 ))
process = thdb->process;
wm=(WINE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,sizeof(*wm));
wm->type = MODULE32_PE;
/* NOTE: fixup_imports takes care of the correct order */
wm->next = process->modref_list;
wm->module = hModule32;
process->modref_list = wm;
if (!PE_MapImage( process, wm, &ofs, 0 ))
{ {
/* FIXME: should destroy the task created and free referenced stuff */ /* FIXME: should destroy the task created and free referenced stuff */
return 0; return 0;
} }
pModule->module32 = wm->module;
/* FIXME: Yuck. Is there no other good place to do that? */ /* FIXME: Yuck. Is there no other good place to do that? */
PE_InitTls( thdb ); PE_InitTls( thdb );
return hInstance; return hInstance;

View file

@ -187,7 +187,7 @@ DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
break; break;
} }
if (__winelib) if (__winelib)
fprintf(stderr,"SizeofResource32: not implemented for WINELIB\n"); FIXME(module,"Not implemented for WINELIB\n");
return 0; return 0;
} }

View file

@ -158,7 +158,7 @@ BOOL32 SIGNAL_Init(void)
{ {
extern void SYNC_SetupSignals(void); extern void SYNC_SetupSignals(void);
#ifdef HAVE_SIGALTSTACK #ifdef HAVE_WORKING_SIGALTSTACK
struct sigaltstack ss; struct sigaltstack ss;
ss.ss_sp = SIGNAL_Stack; ss.ss_sp = SIGNAL_Stack;
ss.ss_size = sizeof(SIGNAL_Stack); ss.ss_size = sizeof(SIGNAL_Stack);

View file

@ -37,7 +37,6 @@
#define MIN_THUNKS 32 #define MIN_THUNKS 32
extern INT32 WINSOCK_DeleteTaskWSI( TDB* pTask, struct _WSINFO* ); extern INT32 WINSOCK_DeleteTaskWSI( TDB* pTask, struct _WSINFO* );
extern BOOL32 MODULE_FreeModule( HMODULE16 hModule, TDB* ptaskContext );
/* Pointer to function to switch to a larger stack */ /* Pointer to function to switch to a larger stack */
int (*IF1632_CallLargeStack)( int (*func)(), void *arg ) = NULL; int (*IF1632_CallLargeStack)( int (*func)(), void *arg ) = NULL;
@ -208,7 +207,7 @@ static void TASK_CallToStart(void)
{ {
int exit_code = 1; int exit_code = 1;
TDB *pTask = (TDB *)GlobalLock16( hCurrentTask ); TDB *pTask = (TDB *)GlobalLock16( hCurrentTask );
NE_MODULE *pModule = MODULE_GetPtr16( pTask->hModule ); NE_MODULE *pModule = NE_GetPtr( pTask->hModule );
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule ); SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
SET_CUR_THREAD( pTask->thdb ); SET_CUR_THREAD( pTask->thdb );
@ -276,9 +275,10 @@ HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
{ {
HTASK16 hTask; HTASK16 hTask;
TDB *pTask; TDB *pTask;
LPSTR name, cmd_line; LPSTR cmd_line;
WORD sp; WORD sp;
char *stack32Top; char *stack32Top;
char name[10];
STACK16FRAME *frame16; STACK16FRAME *frame16;
STACK32FRAME *frame32; STACK32FRAME *frame32;
PDB32 *pdb32 = thdb->process; PDB32 *pdb32 = thdb->process;
@ -319,7 +319,7 @@ HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
/* Copy the module name */ /* Copy the module name */
name = MODULE_GetModuleName( pModule->self ); GetModuleName( pModule->self, name, sizeof(name) );
strncpy( pTask->module_name, name, sizeof(pTask->module_name) ); strncpy( pTask->module_name, name, sizeof(pTask->module_name) );
/* Allocate a selector for the PDB */ /* Allocate a selector for the PDB */
@ -432,7 +432,7 @@ static void TASK_DeleteTask( HTASK16 hTask )
/* Free the task module */ /* Free the task module */
MODULE_FreeModule( pTask->hModule, pTask ); FreeModule16( pTask->hModule );
/* Free the selector aliases */ /* Free the selector aliases */
@ -660,7 +660,7 @@ void WINAPI InitTask( CONTEXT *context )
if (context) EAX_reg(context) = 0; if (context) EAX_reg(context) = 0;
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return; if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pModule = MODULE_GetPtr16( pTask->hModule ))) return; if (!(pModule = NE_GetPtr( pTask->hModule ))) return;
/* This is a hack to install task USER signal handler before /* This is a hack to install task USER signal handler before
* implicitly loaded DLLs are initialized (see windows/user.c) */ * implicitly loaded DLLs are initialized (see windows/user.c) */
@ -855,7 +855,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
BYTE *thunk,*lfunc; BYTE *thunk,*lfunc;
SEGPTR thunkaddr; SEGPTR thunkaddr;
if (!hInstance) return 0; if (!hInstance) hInstance = CURRENT_DS;
thunkaddr = TASK_AllocThunk( hCurrentTask ); thunkaddr = TASK_AllocThunk( hCurrentTask );
if (!thunkaddr) return (FARPROC16)0; if (!thunkaddr) return (FARPROC16)0;
thunk = PTR_SEG_TO_LIN( thunkaddr ); thunk = PTR_SEG_TO_LIN( thunkaddr );
@ -995,12 +995,8 @@ void WINAPI SwitchStackTo( WORD seg, WORD ptr, WORD top )
/*********************************************************************** /***********************************************************************
* SwitchStackBack (KERNEL.109) * SwitchStackBack (KERNEL.109)
*
* Note: the function is declared as 'register' in the spec file in order
* to make sure all registers are preserved, but we don't use them in any
* way, so we don't need a CONTEXT* argument.
*/ */
void WINAPI SwitchStackBack(void) void WINAPI SwitchStackBack( CONTEXT *context )
{ {
TDB *pTask; TDB *pTask;
STACK16FRAME *oldFrame, *newFrame; STACK16FRAME *oldFrame, *newFrame;
@ -1022,6 +1018,8 @@ void WINAPI SwitchStackBack(void)
/* Switch back to the old stack */ /* Switch back to the old stack */
pTask->thdb->cur_stack = pData->old_ss_sp; pTask->thdb->cur_stack = pData->old_ss_sp;
SS_reg(context) = SELECTOROF(pData->old_ss_sp);
ESP_reg(context) = OFFSETOF(pData->old_ss_sp);
pData->old_ss_sp = 0; pData->old_ss_sp = 0;
/* Build a stack frame for the return */ /* Build a stack frame for the return */

View file

@ -342,7 +342,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
if (start == 0) { if (start == 0) {
/* Check if the segment is the DGROUP of a module */ /* Check if the segment is the DGROUP of a module */
if ((pModule = MODULE_GetPtr16( selector ))) if ((pModule = NE_GetPtr( selector )))
{ {
SEGTABLEENTRY *pSeg = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1; SEGTABLEENTRY *pSeg = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1;
if (pModule->dgroup && (pSeg->selector == selector)) { if (pModule->dgroup && (pSeg->selector == selector)) {
@ -1601,7 +1601,7 @@ DWORD WINAPI GetHeapSpaces( HMODULE16 module )
NE_MODULE *pModule; NE_MODULE *pModule;
WORD ds; WORD ds;
if (!(pModule = MODULE_GetPtr16( module ))) return 0; if (!(pModule = NE_GetPtr( module ))) return 0;
ds = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector; ds = (NE_SEG_TABLE( pModule ) + pModule->dgroup - 1)->selector;
return MAKELONG( LOCAL_CountFree( ds ), LOCAL_HeapSize( ds ) ); return MAKELONG( LOCAL_CountFree( ds ), LOCAL_HeapSize( ds ) );
} }

View file

@ -193,11 +193,10 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
/* Clear the saved 16-bit selector */ /* Clear the saved 16-bit selector */
frame = CURRENT_STACK16; frame = CURRENT_STACK16;
while (frame) while (frame && frame->frame32)
{ {
if ((frame->ds >= sel) && (frame->ds < nextsel)) frame->ds = 0; if ((frame->ds >= sel) && (frame->ds < nextsel)) frame->ds = 0;
if ((frame->es >= sel) && (frame->es < nextsel)) frame->es = 0; if ((frame->es >= sel) && (frame->es < nextsel)) frame->es = 0;
if (!frame->frame32) break;
frame = PTR_SEG_TO_LIN( frame->frame32->frame16 ); frame = PTR_SEG_TO_LIN( frame->frame32->frame16 );
} }
} }

View file

@ -823,7 +823,7 @@ SEGPTR WINAPI SetCommEventMask(INT16 fd,UINT16 fuEvtMask)
if ((act = GetCommPort(fd)) == -1) { if ((act = GetCommPort(fd)) == -1) {
WARN(comm," fd %d not comm port\n",act); WARN(comm," fd %d not comm port\n",act);
return NULL;} return NULL;}
stol = unknown[act]; stol = (unsigned char *)unknown[act];
stol += msr; stol += msr;
repid = ioctl(fd,TIOCMGET,&mstat); repid = ioctl(fd,TIOCMGET,&mstat);
TRACE(comm, " ioctl %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]); TRACE(comm, " ioctl %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]);

View file

@ -1589,7 +1589,7 @@ short WINAPI GetFileTitle16(LPCSTR lpFile, LPSTR lpTitle, UINT16 cbBuf)
/*********************************************************************** /***********************************************************************
* ChooseColor (COMMDLG.5) * ChooseColor (COMMDLG.5)
*/ */
BOOL16 WINAPI ChooseColor(LPCHOOSECOLOR lpChCol) BOOL16 WINAPI ChooseColor16(LPCHOOSECOLOR16 lpChCol)
{ {
HINSTANCE16 hInst; HINSTANCE16 hInst;
HANDLE16 hDlgTmpl = 0; HANDLE16 hDlgTmpl = 0;
@ -1662,7 +1662,7 @@ static const COLORREF predefcolors[6][8]=
struct CCPRIVATE struct CCPRIVATE
{ {
LPCHOOSECOLOR lpcc; /* points to public known data structure */ LPCHOOSECOLOR16 lpcc; /* points to public known data structure */
int nextuserdef; /* next free place in user defined color array */ int nextuserdef; /* next free place in user defined color array */
HDC16 hdcMem; /* color graph used for BitBlt() */ HDC16 hdcMem; /* color graph used for BitBlt() */
HBITMAP16 hbmMem; /* color graph bitmap */ HBITMAP16 hbmMem; /* color graph bitmap */
@ -2342,7 +2342,7 @@ static void CC_PaintUserColorArray(HWND16 hDlg,int rows,int cols,COLORREF* lpcr)
/*********************************************************************** /***********************************************************************
* CC_HookCallChk [internal] * CC_HookCallChk [internal]
*/ */
static BOOL32 CC_HookCallChk(LPCHOOSECOLOR lpcc) static BOOL32 CC_HookCallChk(LPCHOOSECOLOR16 lpcc)
{ {
if (lpcc) if (lpcc)
if(lpcc->Flags & CC_ENABLEHOOK) if(lpcc->Flags & CC_ENABLEHOOK)
@ -2364,8 +2364,8 @@ static LONG CC_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam)
TRACE(commdlg,"WM_INITDIALOG lParam=%08lX\n", lParam); TRACE(commdlg,"WM_INITDIALOG lParam=%08lX\n", lParam);
lpp=calloc(1,sizeof(struct CCPRIVATE)); lpp=calloc(1,sizeof(struct CCPRIVATE));
lpp->lpcc=(LPCHOOSECOLOR)lParam; lpp->lpcc=(LPCHOOSECOLOR16)lParam;
if (lpp->lpcc->lStructSize != sizeof(CHOOSECOLOR)) if (lpp->lpcc->lStructSize != sizeof(CHOOSECOLOR16))
{ {
EndDialog32 (hDlg, 0) ; EndDialog32 (hDlg, 0) ;
return FALSE; return FALSE;
@ -3642,7 +3642,7 @@ static BOOL32 Commdlg_GetFileName32A( BOOL16 (*dofunction)(),
ofn16->lStructSize = sizeof(*ofn16); ofn16->lStructSize = sizeof(*ofn16);
ofn16->hwndOwner = ofn->hwndOwner; ofn16->hwndOwner = ofn->hwndOwner;
/* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */ /* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */
ofn16->hInstance = MODULE_HANDLEtoHMODULE16(ofn->hInstance); ofn16->hInstance = 0;
if (ofn->lpstrFilter) { if (ofn->lpstrFilter) {
LPSTR s,x; LPSTR s,x;
@ -3732,7 +3732,7 @@ static BOOL32 Commdlg_GetFileName32W( BOOL16 (*dofunction)(),
ofn16->lStructSize = sizeof(*ofn16); ofn16->lStructSize = sizeof(*ofn16);
ofn16->hwndOwner = ofn->hwndOwner; ofn16->hwndOwner = ofn->hwndOwner;
/* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */ /* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */
ofn16->hInstance = MODULE_HANDLEtoHMODULE16(ofn->hInstance); ofn16->hInstance = 0;
if (ofn->lpstrFilter) { if (ofn->lpstrFilter) {
LPWSTR s; LPWSTR s;
LPSTR x,y; LPSTR x,y;
@ -3861,3 +3861,71 @@ BOOL32 WINAPI GetSaveFileName32W( LPOPENFILENAME32W ofn )
BOOL16 (WINAPI * dofunction)(SEGPTR ofn16) = GetSaveFileName16; BOOL16 (WINAPI * dofunction)(SEGPTR ofn16) = GetSaveFileName16;
return Commdlg_GetFileName32W(dofunction,ofn); return Commdlg_GetFileName32W(dofunction,ofn);
} }
/***********************************************************************
* ChooseColorA (COMDLG32.1)
*/
BOOL32 WINAPI ChooseColor32A(LPCHOOSECOLOR32A lpChCol )
{
BOOL16 ret;
char *str = NULL;
COLORREF* ccref=SEGPTR_ALLOC(64);
LPCHOOSECOLOR16 lpcc16=SEGPTR_ALLOC(sizeof(CHOOSECOLOR16));
memset(lpcc16,'\0',sizeof(*lpcc16));
lpcc16->lStructSize=sizeof(*lpcc16);
lpcc16->hwndOwner=lpChCol->hwndOwner;
lpcc16->hInstance=0; /* FIXME:MODULE_HANDLEtoHMODULE16(lpChCol->hInstance)*/
lpcc16->rgbResult=lpChCol->rgbResult;
memcpy(ccref,lpChCol->lpCustColors,64);
lpcc16->lpCustColors=(COLORREF*)SEGPTR_GET(ccref);
lpcc16->Flags=lpChCol->Flags;
lpcc16->lCustData=lpChCol->lCustData;
lpcc16->lpfnHook=(WNDPROC16)lpChCol->lpfnHook;
if (lpChCol->lpTemplateName)
str = SEGPTR_STRDUP(lpChCol->lpTemplateName );
lpcc16->lpTemplateName=SEGPTR_GET(str);
ret = ChooseColor16(lpcc16);
if(str)
SEGPTR_FREE(str);
memcpy(lpChCol->lpCustColors,ccref,64);
SEGPTR_FREE(ccref);
SEGPTR_FREE(lpcc16);
return (BOOL32)ret;
}
/***********************************************************************
* ChooseColorW (COMDLG32.2)
*/
BOOL32 WINAPI ChooseColor32W(LPCHOOSECOLOR32W lpChCol )
{
BOOL16 ret;
char *str = NULL;
COLORREF* ccref=SEGPTR_ALLOC(64);
LPCHOOSECOLOR16 lpcc16=SEGPTR_ALLOC(sizeof(CHOOSECOLOR16));
memset(lpcc16,'\0',sizeof(*lpcc16));
lpcc16->lStructSize=sizeof(*lpcc16);
lpcc16->hwndOwner=lpChCol->hwndOwner;
lpcc16->hInstance=0; /*FIXME:MODULE_HANDLEtoHMODULE16(lpChCol->hInstance)*/
lpcc16->rgbResult=lpChCol->rgbResult;
memcpy(ccref,lpChCol->lpCustColors,64);
lpcc16->lpCustColors=(COLORREF*)SEGPTR_GET(ccref);
lpcc16->Flags=lpChCol->Flags;
lpcc16->lCustData=lpChCol->lCustData;
lpcc16->lpfnHook=(WNDPROC16)lpChCol->lpfnHook;
if (lpChCol->lpTemplateName)
str = SEGPTR_STRDUP_WtoA(lpChCol->lpTemplateName );
lpcc16->lpTemplateName=SEGPTR_GET(str);
ret = ChooseColor16(lpcc16);
if(str)
SEGPTR_FREE(str);
memcpy(lpChCol->lpCustColors,ccref,64);
SEGPTR_FREE(ccref);
SEGPTR_FREE(lpcc16);
return (BOOL32)ret;
}

View file

@ -11,7 +11,12 @@
#include "global.h" #include "global.h"
#include "windows.h" #include "windows.h"
#include "winnt.h" #include "winnt.h"
#include "winerror.h"
#include "winreg.h" #include "winreg.h"
#include "debug.h"
/* Should this write to the registry? */
#define DO_REG FALSE
static BYTE PF[64] = {0,}; static BYTE PF[64] = {0,};
@ -22,7 +27,7 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
{ {
static int cache = 0; static int cache = 0;
static SYSTEM_INFO cachedsi; static SYSTEM_INFO cachedsi;
HKEY xhkey=0,hkey; HKEY hkey;
char buf[20]; char buf[20];
if (cache) { if (cache) {
@ -52,6 +57,16 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
/* hmm, reasonable processor feature defaults? */ /* hmm, reasonable processor feature defaults? */
/* The registry calls were removed because they were being called
before the registries were loaded, and they were giving errors */
/* Create this registry key for all systems */
#if DO_REG
if (RegCreateKey16(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey)!=ERROR_SUCCESS) {
WARN(reg,"Unable to register CPU information\n");
}
#endif
#ifdef linux #ifdef linux
{ {
char line[200]; char line[200];
@ -59,8 +74,7 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
if (!f) if (!f)
return; return;
xhkey = 0; /*xhkey = 0;*/
RegCreateKey16(HKEY_LOCAL_MACHINE,"\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey);
while (fgets(line,200,f)!=NULL) { while (fgets(line,200,f)!=NULL) {
char *s,*value; char *s,*value;
@ -94,10 +108,12 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
break; break;
} }
} }
#if DO_REG
/* set the CPU type of the current processor */ /* set the CPU type of the current processor */
sprintf(buf,"CPU %ld",cachedsi.dwProcessorType); sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
if (xhkey) if (hkey)
RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf)); RegSetValueEx32A(hkey,"Identifier",0,REG_SZ,buf,strlen(buf));
#endif
continue; continue;
} }
/* old 2.0 method */ /* old 2.0 method */
@ -122,10 +138,12 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
break; break;
} }
} }
#if DO_REG
/* set the CPU type of the current processor */ /* set the CPU type of the current processor */
sprintf(buf,"CPU %ld",cachedsi.dwProcessorType); sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
if (xhkey) if (hkey)
RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf)); RegSetValueEx32A(hkey,"Identifier",0,REG_SZ,buf,strlen(buf));
#endif
continue; continue;
} }
if (!lstrncmpi32A(line,"fdiv_bug",strlen("fdiv_bug"))) { if (!lstrncmpi32A(line,"fdiv_bug",strlen("fdiv_bug"))) {
@ -148,11 +166,14 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
if (x+1>cachedsi.dwNumberOfProcessors) if (x+1>cachedsi.dwNumberOfProcessors)
cachedsi.dwNumberOfProcessors=x+1; cachedsi.dwNumberOfProcessors=x+1;
#if 0
/* create a new processor subkey */ /* create a new processor subkey */
/* What exactly is trying to be done here? */
sprintf(buf,"%d",x); sprintf(buf,"%d",x);
if (xhkey) if (xhkey)
RegCloseKey(xhkey); RegCloseKey(xhkey);
RegCreateKey16(hkey,buf,&xhkey); RegCreateKey16(hkey,buf,&xhkey);
#endif
} }
if (!lstrncmpi32A(line,"stepping",strlen("stepping"))) { if (!lstrncmpi32A(line,"stepping",strlen("stepping"))) {
int x; int x;
@ -174,14 +195,24 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
#else /* linux */ #else /* linux */
/* FIXME: how do we do this on other systems? */ /* FIXME: how do we do this on other systems? */
RegCreateKey16(hkey,"0",&xhkey); #if 0
RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,"CPU 386",strlen("CPU 386")); RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,"CPU 386",strlen("CPU 386"));
#endif
#endif /* !linux */ #endif /* !linux */
if (xhkey)
#if 0
(xhkey)
RegCloseKey(xhkey); RegCloseKey(xhkey);
RegCloseKey(hkey); #endif
#if DO_REG
if (hkey)
RegCloseKey(hkey);
#endif
} }
/*********************************************************************** /***********************************************************************
* IsProcessorFeaturePresent [KERNELL32.880] * IsProcessorFeaturePresent [KERNELL32.880]
*/ */

View file

@ -20,6 +20,7 @@ Unresolved issues Uwe Bonnes 970904:
/* FIXME: all the file handling is hopelessly broken -- AJ */ /* FIXME: all the file handling is hopelessly broken -- AJ */
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -34,6 +35,7 @@ Unresolved issues Uwe Bonnes 970904:
#include <setjmp.h> #include <setjmp.h>
#include "win.h" #include "win.h"
#include "windows.h" #include "windows.h"
#include "winerror.h"
#include "debug.h" #include "debug.h"
#include "module.h" #include "module.h"
#include "heap.h" #include "heap.h"
@ -304,6 +306,20 @@ DWORD __cdecl CRTDLL_fread(LPVOID ptr, INT32 size, INT32 nmemb, LPVOID vfile)
#endif #endif
} }
/*********************************************************************
* fscanf (CRTDLL.381)
*/
INT32 __cdecl CRTDLL_fscanf( LPVOID stream, LPSTR format, ... )
{
va_list valist;
INT32 res;
va_start( valist, format );
res = vfscanf( xlat_file_ptr(stream), format, valist );
va_end( valist );
return res;
}
/********************************************************************* /*********************************************************************
* fseek (CRTDLL.382) * fseek (CRTDLL.382)
*/ */
@ -322,6 +338,15 @@ LONG __cdecl CRTDLL_fseek(LPVOID stream, LONG offset, INT32 whence)
return ret; return ret;
} }
/*********************************************************************
* fsetpos (CRTDLL.383)
*/
INT32 __cdecl CRTDLL_fsetpos(LPVOID stream, fpos_t *pos)
{
TRACE(crtdll, "file %p\n", stream);
return fseek(xlat_file_ptr(stream), *pos, SEEK_SET);
}
/********************************************************************* /*********************************************************************
* ftell (CRTDLL.384) * ftell (CRTDLL.384)
*/ */
@ -514,7 +539,7 @@ void __cdecl CRTDLL_exit(DWORD ret)
/********************************************************************* /*********************************************************************
* _abnormal_termination (CRTDLL.36 ) * _abnormal_termination (CRTDLL.36)
*/ */
INT32 __cdecl CRTDLL__abnormal_termination(void) INT32 __cdecl CRTDLL__abnormal_termination(void)
{ {
@ -523,6 +548,32 @@ INT32 __cdecl CRTDLL__abnormal_termination(void)
} }
/*********************************************************************
* _access (CRTDLL.37)
*/
INT32 __cdecl CRTDLL__access(LPCSTR filename, INT32 mode)
{
DWORD attr = GetFileAttributes32A(filename);
if (attr == -1)
{
if (GetLastError() == ERROR_INVALID_ACCESS)
errno = EACCES;
else
errno = ENOENT;
return -1;
}
if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & W_OK))
{
errno = EACCES;
return -1;
}
else
return 0;
}
/********************************************************************* /*********************************************************************
* fflush (CRTDLL.365) * fflush (CRTDLL.365)
*/ */
@ -1365,6 +1416,14 @@ INT32 __cdecl CRTDLL__setmode( INT32 fh,INT32 mode)
return -1; return -1;
} }
/*********************************************************************
* _fpreset (CRTDLL.107)
*/
VOID __cdecl CRTDLL__fpreset(void)
{
FIXME(crtdll," STUB.\n");
}
/********************************************************************* /*********************************************************************
* atexit (CRTDLL.345) * atexit (CRTDLL.345)
*/ */
@ -1475,11 +1534,14 @@ BOOL32 __cdecl CRTDLL__isctype(CHAR x,CHAR type)
/********************************************************************* /*********************************************************************
* _chdrive (CRTDLL.52) * _chdrive (CRTDLL.52)
*
* newdir [I] drive to change to, A=1
*
*/ */
BOOL32 __cdecl CRTDLL__chdrive(INT32 newdrive) BOOL32 __cdecl CRTDLL__chdrive(INT32 newdrive)
{ {
/* FIXME: generates errnos */ /* FIXME: generates errnos */
return DRIVE_SetCurrentDrive(newdrive); return DRIVE_SetCurrentDrive(newdrive-1);
} }
/********************************************************************* /*********************************************************************
@ -1488,7 +1550,7 @@ BOOL32 __cdecl CRTDLL__chdrive(INT32 newdrive)
INT32 __cdecl CRTDLL__chdir(LPCSTR newdir) INT32 __cdecl CRTDLL__chdir(LPCSTR newdir)
{ {
if (!SetCurrentDirectory32A(newdir)) if (!SetCurrentDirectory32A(newdir))
return -1; return 1;
return 0; return 0;
} }
@ -1603,6 +1665,16 @@ CHAR* __cdecl CRTDLL__getcwd(LPSTR buf, INT32 size)
} }
/*********************************************************************
* _getdrive (CRTDLL.124)
*
* Return current drive, 1 for A, 2 for B
*/
INT32 __cdecl CRTDLL__getdrive(VOID)
{
return DRIVE_GetCurrentDrive() + 1;
}
/********************************************************************* /*********************************************************************
* _mkdir (CRTDLL.234) * _mkdir (CRTDLL.234)
*/ */
@ -1701,6 +1773,25 @@ LPSTR __cdecl CRTDLL__itoa(INT32 x,LPSTR buf,INT32 buflen)
return buf; return buf;
} }
/*********************************************************************
* _ltoa (CRTDLL.180)
*/
LPSTR __cdecl CRTDLL__ltoa(long x,LPSTR buf,INT32 radix)
{
switch(radix) {
case 2: FIXME(crtdll, "binary format not implemented !\n");
break;
case 8: wsnprintf32A(buf,0x80,"%o",x);
break;
case 10: wsnprintf32A(buf,0x80,"%d",x);
break;
case 16: wsnprintf32A(buf,0x80,"%x",x);
break;
default: FIXME(crtdll, "radix %d not implemented !\n", radix);
}
return buf;
}
typedef VOID (*sig_handler_type)(VOID); typedef VOID (*sig_handler_type)(VOID);
/********************************************************************* /*********************************************************************
@ -1725,6 +1816,7 @@ VOID __cdecl CRTDLL__sleep(unsigned long timeout)
TRACE(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout); TRACE(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout);
Sleep((timeout)?timeout:1); Sleep((timeout)?timeout:1);
} }
/********************************************************************* /*********************************************************************
* getenv (CRTDLL.437) * getenv (CRTDLL.437)
*/ */
@ -1751,3 +1843,11 @@ LPSTR __cdecl CRTDLL_getenv(const char *name)
FreeEnvironmentStrings32A( environ ); FreeEnvironmentStrings32A( environ );
return pp; return pp;
} }
/*********************************************************************
* _mbsrchr (CRTDLL.223)
*/
LPSTR __cdecl CRTDLL__mbsrchr(LPSTR s,CHAR x) {
/* FIXME: handle multibyte strings */
return strrchr(s,x);
}

View file

@ -121,14 +121,24 @@ HCONVLIST WINAPI DdeConnectList32( DWORD idInst, HSZ hszService, HSZ hszTopic,
/***************************************************************** /*****************************************************************
* DdeQueryNextServer (DDEML.5) * DdeQueryNextServer16 [DDEML.5]
*/ */
HCONV WINAPI DdeQueryNextServer( HCONVLIST hConvList, HCONV hConvPrev ) HCONV WINAPI DdeQueryNextServer16( HCONVLIST hConvList, HCONV hConvPrev )
{ {
FIXME( ddeml, "empty stub\n" ); return DdeQueryNextServer32(hConvList, hConvPrev);
}
/*****************************************************************
* DdeQueryNextServer32 [USER32.112]
*/
HCONV WINAPI DdeQueryNextServer32( HCONVLIST hConvList, HCONV hConvPrev )
{
FIXME(ddeml, "(%ld,%ld): stub\n",hConvList,hConvPrev);
return 0; return 0;
} }
/***************************************************************** /*****************************************************************
* DdeDisconnectList (DDEML.6) * DdeDisconnectList (DDEML.6)
*/ */
@ -273,7 +283,7 @@ BOOL16 WINAPI DdeFreeStringHandle16( DWORD idInst, HSZ hsz )
*/ */
BOOL32 WINAPI DdeFreeStringHandle32( DWORD idInst, HSZ hsz ) BOOL32 WINAPI DdeFreeStringHandle32( DWORD idInst, HSZ hsz )
{ {
FIXME( ddeml, "empty stub\n" ); FIXME( ddeml, "(%d,%d): stub\n",idInst, hsz );
return TRUE; return TRUE;
} }
@ -511,5 +521,3 @@ int WINAPI DdeCmpStringHandles( HSZ hsz1, HSZ hsz2 )
return 0; return 0;
} }

View file

@ -173,7 +173,7 @@ void debug_dumpstr (LPCSTR s)
break; break;
default: default:
if (*s<' ') if (*s<' ')
printf ("\\0x%02x", *s); fprintf (stderr, "\\0x%02x", *s);
else else
fputc (*s, stderr); fputc (*s, stderr);
} }

File diff suppressed because it is too large Load diff

View file

@ -152,15 +152,15 @@ SEGPTR WINAPI AnsiPrev16( SEGPTR start, SEGPTR current )
*/ */
void WINAPI OutputDebugString16( LPCSTR str ) void WINAPI OutputDebugString16( LPCSTR str )
{ {
char *module; char module[10];
char *p, *buffer = HeapAlloc( GetProcessHeap(), 0, strlen(str)+2 ); char *p, *buffer = HeapAlloc( GetProcessHeap(), 0, strlen(str)+2 );
/* Remove CRs */ /* Remove CRs */
for (p = buffer; *str; str++) if (*str != '\r') *p++ = *str; for (p = buffer; *str; str++) if (*str != '\r') *p++ = *str;
*p = '\0'; *p = '\0';
if ((p > buffer) && (p[-1] == '\n')) p[1] = '\0'; /* Remove trailing \n */ if ((p > buffer) && (p[-1] == '\n')) p[1] = '\0'; /* Remove trailing \n */
module = MODULE_GetModuleName( GetCurrentTask() ); if (!GetModuleName( GetCurrentTask(), module, sizeof(module) ))
TRACE(resource, "%s says '%s'\n", strcpy( module, "???" );
module ? module : "???", buffer ); TRACE(resource, "%s says '%s'\n", module, buffer );
HeapFree( GetProcessHeap(), 0, buffer ); HeapFree( GetProcessHeap(), 0, buffer );
} }
@ -553,7 +553,7 @@ DWORD WINAPI FormatMessage32A(
if (from) { if (from) {
f=from; f=from;
while (*f) { while (*f && !nolinefeed) {
if (*f=='%') { if (*f=='%') {
int insertnr; int insertnr;
char *fmtstr,*sprintfbuf,*x,*lastf; char *fmtstr,*sprintfbuf,*x,*lastf;
@ -646,14 +646,7 @@ DWORD WINAPI FormatMessage32A(
} }
*t='\0'; *t='\0';
} }
if (nolinefeed) { if (!nolinefeed) {
/* remove linefeed */
if(t>target && t[-1]=='\n') {
*--t=0;
if(t>target && t[-1]=='\r')
*--t=0;
}
} else {
/* add linefeed */ /* add linefeed */
if(t==target || t[-1]!='\n') if(t==target || t[-1]!='\n')
ADD_TO_T('\n'); /* FIXME: perhaps add \r too? */ ADD_TO_T('\n'); /* FIXME: perhaps add \r too? */
@ -732,7 +725,7 @@ DWORD WINAPI FormatMessage32W(
if (from) { if (from) {
f=from; f=from;
while (*f) { while (*f && !nolinefeed) {
if (*f=='%') { if (*f=='%') {
int insertnr; int insertnr;
char *fmtstr,*sprintfbuf,*x; char *fmtstr,*sprintfbuf,*x;
@ -826,14 +819,7 @@ DWORD WINAPI FormatMessage32W(
} }
*t='\0'; *t='\0';
} }
if (nolinefeed) { if (!nolinefeed) {
/* remove linefeed */
if(t>target && t[-1]=='\n') {
*--t=0;
if(t>target && t[-1]=='\r')
*--t=0;
}
} else {
/* add linefeed */ /* add linefeed */
if(t==target || t[-1]!='\n') if(t==target || t[-1]!='\n')
ADD_TO_T('\n'); /* FIXME: perhaps add \r too? */ ADD_TO_T('\n'); /* FIXME: perhaps add \r too? */

View file

@ -473,17 +473,25 @@ LONG WINAPI LZCopy16( HFILE16 src, HFILE16 dest )
*/ */
LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest ) LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
{ {
int i,ret,wret; int usedlzinit=0,i,ret,wret;
LONG len; LONG len;
HFILE32 oldsrc = src;
#define BUFLEN 1000 #define BUFLEN 1000
BYTE buf[BUFLEN]; BYTE buf[BUFLEN];
INT32 WINAPI (*xread)(HFILE32,LPVOID,UINT32); INT32 WINAPI (*xread)(HFILE32,LPVOID,UINT32);
TRACE(file,"(%d,%d)\n",src,dest); TRACE(file,"(%d,%d)\n",src,dest);
if (src<0x400) {
src = LZInit32(src);
if (src!=oldsrc)
usedlzinit=1;
if (src>0xfff0)
return 0;
}
for (i=0;i<nroflzstates;i++) for (i=0;i<nroflzstates;i++)
if (src==lzstates[i].lzfd) if (src==lzstates[i].lzfd)
break; break;
/* not compressed? just copy */ /* not compressed? just copy */
if (i==nroflzstates) if (i==nroflzstates)
xread=(INT32(*)(HFILE32,LPVOID,UINT32))_lread32; xread=(INT32(*)(HFILE32,LPVOID,UINT32))_lread32;
@ -504,6 +512,8 @@ LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
if (wret!=ret) if (wret!=ret)
return LZERROR_WRITE; return LZERROR_WRITE;
} }
if (usedlzinit)
LZClose32(src);
return len; return len;
#undef BUFLEN #undef BUFLEN
} }

View file

@ -116,6 +116,7 @@ static XrmOptionDescRec optionsTable[] =
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0])) #define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
#define USAGE \ #define USAGE \
"%s\n" \
"Usage: %s [options] \"program_name [arguments]\"\n" \ "Usage: %s [options] \"program_name [arguments]\"\n" \
"\n" \ "\n" \
"Options:\n" \ "Options:\n" \
@ -128,6 +129,7 @@ static XrmOptionDescRec optionsTable[] =
" -dll name Enable or disable built-in DLLs\n" \ " -dll name Enable or disable built-in DLLs\n" \
" -failreadonly Read only files may not be opened in write mode\n" \ " -failreadonly Read only files may not be opened in write mode\n" \
" -fixedmap Use a \"standard\" color map\n" \ " -fixedmap Use a \"standard\" color map\n" \
" -help Show this help message\n" \
" -iconic Start as an icon\n" \ " -iconic Start as an icon\n" \
" -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo,It,Ko,\n Hu,Pl,Po,Sw,Ca)\n" \ " -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo,It,Ko,\n Hu,Pl,Po,Sw,Ca)\n" \
" -managed Allow the window manager to manage created windows\n" \ " -managed Allow the window manager to manage created windows\n" \
@ -146,7 +148,7 @@ static XrmOptionDescRec optionsTable[] =
*/ */
void MAIN_Usage( char *name ) void MAIN_Usage( char *name )
{ {
MSG( USAGE, name ); MSG( USAGE, WINE_RELEASE_INFO, name );
exit(1); exit(1);
} }
@ -199,12 +201,14 @@ static int MAIN_GetResource( XrmDatabase db, char *name, XrmValue *value )
/*********************************************************************** /***********************************************************************
* ParseDebugOptions * MAIN_ParseDebugOptions
* *
* Turns specific debug messages on or off, according to "options". * Turns specific debug messages on or off, according to "options".
* Returns TRUE if parsing was successful *
* RETURNS
* TRUE if parsing was successful
*/ */
BOOL32 ParseDebugOptions(char *options) static BOOL32 MAIN_ParseDebugOptions(char *options)
{ {
int l, cls; int l, cls;
if (strlen(options)<3) if (strlen(options)<3)
@ -330,6 +334,11 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
MSG( "%s\n", WINE_RELEASE_INFO ); MSG( "%s\n", WINE_RELEASE_INFO );
exit(0); exit(0);
} }
if (!strcmp( argv[i], "-h" ) || !strcmp( argv[i], "-help" ))
{
MAIN_Usage(argv[0]);
exit(0);
}
} }
/* Open display */ /* Open display */
@ -383,7 +392,7 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
if (MAIN_GetResource( db, ".mode", &value)) if (MAIN_GetResource( db, ".mode", &value))
MAIN_ParseModeOption( (char *)value.addr ); MAIN_ParseModeOption( (char *)value.addr );
if (MAIN_GetResource( db, ".debugoptions", &value)) if (MAIN_GetResource( db, ".debugoptions", &value))
ParseDebugOptions((char*)value.addr); MAIN_ParseDebugOptions((char*)value.addr);
if (MAIN_GetResource( db, ".debugmsg", &value)) if (MAIN_GetResource( db, ".debugmsg", &value))
{ {
#ifndef DEBUG_RUNTIME #ifndef DEBUG_RUNTIME
@ -392,7 +401,7 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
argv[0]); argv[0]);
exit(1); exit(1);
#else #else
if (ParseDebugOptions((char*)value.addr)==FALSE) if (MAIN_ParseDebugOptions((char*)value.addr)==FALSE)
{ {
int i; int i;
MSG("%s: Syntax: -debugmsg [class]+xxx,... or " MSG("%s: Syntax: -debugmsg [class]+xxx,... or "
@ -531,6 +540,9 @@ static void MAIN_RestoreSetup(void)
} }
/***********************************************************************
* called_at_exit
*/
static void called_at_exit(void) static void called_at_exit(void)
{ {
MAIN_RestoreSetup(); MAIN_RestoreSetup();

View file

@ -478,9 +478,14 @@ int WINAPI WNetPropertyDialog(HWND16 hwndParent,WORD iButton,
*/ */
int WINAPI WNetGetDirectoryType16(LPSTR lpName, LPINT16 lpType) int WINAPI WNetGetDirectoryType16(LPSTR lpName, LPINT16 lpType)
{ {
FIXME(wnet, "('%s',%p): stub\n",lpName,lpType); UINT32 type = GetDriveType32A(lpName);
*lpType = 0;
return WN_NO_NETWORK; if (type == DRIVE_DOESNOTEXIST)
type = GetDriveType32A(NULL);
*lpType = (type==DRIVE_REMOTE)?WNDT_NETWORK:WNDT_NORMAL;
TRACE(wnet,"%s is %s\n",lpName,(*lpType==WNDT_NETWORK)?
"WNDT_NETWORK":"WNDT_NORMAL");
return WN_SUCCESS;
} }
/***************************************************************** /*****************************************************************

File diff suppressed because it is too large Load diff

View file

@ -794,9 +794,14 @@ static DWORD SHELL_GetResourceTable(HFILE32 hFile,LPBYTE *retptr)
_llseek32( hFile, 0, SEEK_SET ); _llseek32( hFile, 0, SEEK_SET );
if ( (_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) || if ( (_lread32(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
(mz_header.e_magic != IMAGE_DOS_SIGNATURE) (mz_header.e_magic != IMAGE_DOS_SIGNATURE)
) ) { /* .ICO file ? */
return 0; if (mz_header.e_cblp == 1) { /* ICONHEADER.idType, must be 1 */
*retptr = (LPBYTE)-1;
return 1;
}
else
return 0; /* failed */
}
_llseek32( hFile, mz_header.e_lfanew, SEEK_SET ); _llseek32( hFile, mz_header.e_lfanew, SEEK_SET );
if (_lread32( hFile, magic, sizeof(magic) ) != sizeof(magic)) if (_lread32( hFile, magic, sizeof(magic) ) != sizeof(magic))
return 0; return 0;
@ -825,10 +830,9 @@ static DWORD SHELL_GetResourceTable(HFILE32 hFile,LPBYTE *retptr)
} }
} }
*retptr = pTypeInfo; *retptr = pTypeInfo;
return IMAGE_OS2_SIGNATURE;
} else } else
*retptr = (LPBYTE)-1; return 0; /* failed */
return IMAGE_OS2_SIGNATURE; /* handles .ICO too */
} }
/************************************************************************* /*************************************************************************
@ -945,7 +949,8 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
sig = SHELL_GetResourceTable(hFile,&pData); sig = SHELL_GetResourceTable(hFile,&pData);
if(sig == IMAGE_OS2_SIGNATURE) if((sig == IMAGE_OS2_SIGNATURE)
|| (sig == 1)) /* .ICO file */
{ {
HICON16 hIcon = 0; HICON16 hIcon = 0;
NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(pData + 2); NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(pData + 2);

View file

@ -521,7 +521,7 @@ void __cdecl SHELL32_183(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,
strcpy(buf,"Desktop"); strcpy(buf,"Desktop");
LoadString32A(hmod,id,buf2,100); LoadString32A(hmod,id,buf2,100);
/* FIXME: the varargs handling doesn't. */ /* FIXME: the varargs handling doesn't. */
FormatMessage32A(0x500,buf2,0,0,&buf3,256,&args); FormatMessage32A(0x500,buf2,0,0,(LPSTR)&buf3,256,(LPDWORD)&args);
FIXME(shell,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n", FIXME(shell,"(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p):stub.\n",
(DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist (DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist
@ -660,3 +660,14 @@ DWORD WINAPI SHELL32_155(LPVOID x) {
return SHELL32_195(x); return SHELL32_195(x);
} }
/*************************************************************************
* SHELL32_85 [SHELL32.85]
* unknown
*/
DWORD WINAPI SHELL32_85(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
x1,x2,x3,x4
);
return 0;
}

View file

@ -669,8 +669,11 @@ void SPY_EnterMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg,
if (hTask == GetCurrentTask()) strcpy( taskName, "self" ); if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
else if (!hTask) strcpy( taskName, "Wine" ); else if (!hTask) strcpy( taskName, "Wine" );
else sprintf( taskName, "task %04x %s", else
hTask, MODULE_GetModuleName(hTask) ); {
sprintf( taskName, "task %04x ???", hTask );
GetModuleName( hTask, taskName + 10, sizeof(taskName) - 10 );
}
pname = SPY_GetWndName(hWnd); pname = SPY_GetWndName(hWnd);
if (iFlag == SPY_SENDMESSAGE16) if (iFlag == SPY_SENDMESSAGE16)
@ -718,39 +721,39 @@ void SPY_ExitMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, LRESULT lReturn )
switch(iFlag) switch(iFlag)
{ {
case SPY_RESULT_DEFWND16: case SPY_RESULT_DEFWND16:
TRACE(message,"%*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n", TRACE(message," %*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn ); SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
break; break;
case SPY_RESULT_DEFWND32: case SPY_RESULT_DEFWND32:
TRACE(message,"%*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n", TRACE(message," %*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n",
SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn ); SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn );
break; break;
case SPY_RESULT_OK16: case SPY_RESULT_OK16:
pname = SPY_GetWndName(hWnd); pname = SPY_GetWndName(hWnd);
TRACE(message,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n", TRACE(message," %*s(%04x) %-16s message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ), lReturn ); SPY_GetMsgName( msg ), lReturn );
break; break;
case SPY_RESULT_OK32: case SPY_RESULT_OK32:
pname = SPY_GetWndName(hWnd); pname = SPY_GetWndName(hWnd);
TRACE(message,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n", TRACE(message," %*s(%08x) %-16s message [%04x] %s returned %08lx\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ), lReturn ); SPY_GetMsgName( msg ), lReturn );
break; break;
case SPY_RESULT_INVALIDHWND16: case SPY_RESULT_INVALIDHWND16:
pname = SPY_GetWndName(hWnd); pname = SPY_GetWndName(hWnd);
WARN(message, "%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n", WARN(message, " %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ) ); SPY_GetMsgName( msg ) );
break; break;
case SPY_RESULT_INVALIDHWND32: case SPY_RESULT_INVALIDHWND32:
pname = SPY_GetWndName(hWnd); pname = SPY_GetWndName(hWnd);
WARN(message, "%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n", WARN(message, " %*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n",
SPY_IndentLevel, "", hWnd, pname, msg, SPY_IndentLevel, "", hWnd, pname, msg,
SPY_GetMsgName( msg ) ); SPY_GetMsgName( msg ) );
break; break;

View file

@ -2581,11 +2581,10 @@ int WS_dup_se(LPWSINFO pwsi, struct servent* p_se, int flag)
UINT16 wsaErrno(void) UINT16 wsaErrno(void)
{ {
int loc_errno = errno; int loc_errno = errno;
#if defined(__FreeBSD__) #ifdef HAVE_STRERROR
ERR(winsock, "errno %d, (%s).\n", WARN(winsock, "errno %d, (%s).\n", errno, strerror(errno));
errno, strerror(errno));
#else #else
ERR(winsock, "errno %d\n", errno); WARN(winsock, "errno %d\n", errno);
#endif #endif
switch(loc_errno) switch(loc_errno)
@ -2657,11 +2656,10 @@ UINT16 wsaHerrno(void)
{ {
int loc_errno = h_errno; int loc_errno = h_errno;
#if defined(__FreeBSD__) #ifdef HAVE_STRERROR
ERR(winsock, "h_errno %d, (%s).\n", WARN(winsock, "h_errno %d, (%s).\n", h_errno, strerror(h_errno));
h_errno, strerror(h_errno));
#else #else
ERR(winsock, "h_errno %d.\n", h_errno); WARN(winsock, "h_errno %d.\n", h_errno);
#endif #endif
switch(loc_errno) switch(loc_errno)

View file

@ -3,10 +3,10 @@
* *
*/ */
#include <stdio.h>
#include "windows.h" #include "windows.h"
#include "callback.h" #include "callback.h"
#include "debugger.h" #include "debugger.h"
#include "main.h"
#include "miscemu.h" #include "miscemu.h"
#include "module.h" #include "module.h"
#include "options.h" #include "options.h"
@ -18,8 +18,6 @@
*/ */
BOOL32 MAIN_EmulatorInit(void) BOOL32 MAIN_EmulatorInit(void)
{ {
extern BOOL32 MAIN_KernelInit(void);
extern BOOL32 MAIN_UserInit(void);
extern BOOL32 WIN16DRV_Init(void); extern BOOL32 WIN16DRV_Init(void);
extern BOOL32 RELAY_Init(void); extern BOOL32 RELAY_Init(void);
@ -46,7 +44,6 @@ BOOL32 MAIN_EmulatorInit(void)
int main( int argc, char *argv[] ) int main( int argc, char *argv[] )
{ {
extern BOOL32 PROCESS_Init(void); extern BOOL32 PROCESS_Init(void);
extern BOOL32 MAIN_WineInit( int *argc, char *argv[] );
extern void *CALL32_Init(void); extern void *CALL32_Init(void);
extern char * DEBUG_argv0; extern char * DEBUG_argv0;
@ -107,7 +104,6 @@ int main( int argc, char *argv[] )
} }
if (!loaded) { /* nothing loaded */ if (!loaded) { /* nothing loaded */
extern void MAIN_Usage(char*);
MAIN_Usage(argv[0]); MAIN_Usage(argv[0]);
return 1; return 1;
} }

View file

@ -224,13 +224,14 @@ static void INT_DoRealModeInt( CONTEXT *context )
break; break;
} }
if (EFL_reg(context)&1) if (EFL_reg(context)&1) {
FIXME(int31,"%02x: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n", FIXME(int31,"%02x: EAX=%08lx EBX=%08lx ECX=%08lx EDX=%08lx\n",
BL_reg(context), EAX_reg(&realmode_ctx), EBX_reg(&realmode_ctx), BL_reg(context), EAX_reg(&realmode_ctx), EBX_reg(&realmode_ctx),
ECX_reg(&realmode_ctx), EDX_reg(&realmode_ctx)); ECX_reg(&realmode_ctx), EDX_reg(&realmode_ctx));
FIXME(int31," ESI=%08lx EDI=%08lx DS=%04lx ES=%04lx\n", FIXME(int31," ESI=%08lx EDI=%08lx DS=%04lx ES=%04lx\n",
ESI_reg(&realmode_ctx), EDI_reg(&realmode_ctx), ESI_reg(&realmode_ctx), EDI_reg(&realmode_ctx),
DS_reg(&realmode_ctx), ES_reg(&realmode_ctx) ); DS_reg(&realmode_ctx), ES_reg(&realmode_ctx) );
}
INT_SetRealModeContext( call, &realmode_ctx ); INT_SetRealModeContext( call, &realmode_ctx );
} }

View file

@ -1318,7 +1318,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x01: case 0x01:
break; break;
case 0x05:{ /* IOCTL - WRITE TO BLOCK DEVICE CONTROL CHANNEL */ case 0x05:{ /* IOCTL - WRITE TO BLOCK DEVICE CONTROL CHANNEL */
BYTE *dataptr = PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context)); /*BYTE *dataptr = PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context));*/
int drive = DOS_GET_DRIVE(BL_reg(context)); int drive = DOS_GET_DRIVE(BL_reg(context));
FIXME(int21,"program tried to write to block device control channel of drive %d:\n",drive); FIXME(int21,"program tried to write to block device control channel of drive %d:\n",drive);

View file

@ -72,6 +72,16 @@ void WINAPI INT_Int2fHandler( CONTEXT *context )
INT_BARF( context, 0x2f ); INT_BARF( context, 0x2f );
} }
break; break;
case 0x56: /* INTERLNK */
switch(AL_reg(context))
{
case 0x01: /* check if redirected drive */
AL_reg(context) = 0; /* not redirected */
break;
default:
INT_BARF( context, 0x2f );
}
break;
case 0xb7: /* append */ case 0xb7: /* append */
AL_reg(context) = 0; /* not installed */ AL_reg(context) = 0; /* not installed */
break; break;
@ -217,7 +227,7 @@ void do_mscdex( CONTEXT *context )
break; break;
default: default:
FIXME(int, "Unimplemented MSCDEX function 0x%02.2X.\n", AL_reg(context)); FIXME(int, "Unimplemented MSCDEX function 0x%02X.\n", AL_reg(context));
break; break;
} }
} }

View file

@ -780,9 +780,13 @@ static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS16 lpCaps, DWORD dwSize)
lpCaps->vDriverVersion = 0x0100; lpCaps->vDriverVersion = 0x0100;
lpCaps->dwFormats = 0x00000000; lpCaps->dwFormats = 0x00000000;
lpCaps->dwSupport = WAVECAPS_VOLUME; lpCaps->dwSupport = WAVECAPS_VOLUME;
/* First bytespersampl, then stereo */
bytespersmpl = (IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize) != 0) ? 1 : 2;
lpCaps->wChannels = (IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo) != 0) ? 1 : 2; lpCaps->wChannels = (IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo) != 0) ? 1 : 2;
if (lpCaps->wChannels > 1) lpCaps->dwSupport |= WAVECAPS_LRVOLUME; if (lpCaps->wChannels > 1) lpCaps->dwSupport |= WAVECAPS_LRVOLUME;
bytespersmpl = (IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize) != 0) ? 1 : 2;
smplrate = 44100; smplrate = 44100;
if (IOCTL(audio, SNDCTL_DSP_SPEED, smplrate) == 0) { if (IOCTL(audio, SNDCTL_DSP_SPEED, smplrate) == 0) {
lpCaps->dwFormats |= WAVE_FORMAT_4M08; lpCaps->dwFormats |= WAVE_FORMAT_4M08;
@ -901,9 +905,12 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
samplesize = WOutDev[wDevID].Format.wBitsPerSample; samplesize = WOutDev[wDevID].Format.wBitsPerSample;
smplrate = WOutDev[wDevID].Format.wf.nSamplesPerSec; smplrate = WOutDev[wDevID].Format.wf.nSamplesPerSec;
dsp_stereo = (WOutDev[wDevID].Format.wf.nChannels > 1) ? TRUE : FALSE; dsp_stereo = (WOutDev[wDevID].Format.wf.nChannels > 1) ? TRUE : FALSE;
IOCTL(audio, SNDCTL_DSP_SPEED, smplrate);
/* First size and stereo then samplerate */
IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize); IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize);
IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo); IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo);
IOCTL(audio, SNDCTL_DSP_SPEED, smplrate);
TRACE(mciwave,"wBitsPerSample=%u !\n", TRACE(mciwave,"wBitsPerSample=%u !\n",
WOutDev[wDevID].Format.wBitsPerSample); WOutDev[wDevID].Format.wBitsPerSample);
TRACE(mciwave,"nAvgBytesPerSec=%lu !\n", TRACE(mciwave,"nAvgBytesPerSec=%lu !\n",

View file

@ -375,9 +375,12 @@ UINT16 WINAPI mmioSetInfo(HMMIO16 hmmio, const MMIOINFO16 * lpmmioinfo, UINT16 u
UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer, UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer,
LONG cchBuffer, UINT16 uFlags) LONG cchBuffer, UINT16 uFlags)
{ {
FIXME(mmio, "(hmmio=%d, pchBuf=%p, cchBuf=%d, uFlags=%#08x): stub\n", FIXME(mmio, "(hmmio=%d, pchBuf=%p, cchBuf=%ld, uFlags=%#08x): stub\n",
hmmio, pchBuffer, cchBuffer, uFlags); hmmio, pchBuffer, cchBuffer, uFlags);
return (UINT16) 0;
/* stops Corel Draw 4 (16 bit) from working
return MMIOERR_OUTOFMEMORY; return MMIOERR_OUTOFMEMORY;
*/
} }
/************************************************************************** /**************************************************************************

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