Release 980301

Sun Mar  1 10:45:23 1998  Andreas Mohr <100.30936@germany.net>

	* [loader/ne_image.c]
	Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).

	* [msdos/dosmem.c]
	Export address for __0000H, too.

	* [msdos/dpmi.c]
	Changed MemAlloc functions to return less fragmented addresses.

Sat Feb 28 18:50:12 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [scheduler/process.c] [scheduler/sysdeps.c]
	Don't use %fs register before threading initialization.

Sat Feb 28 14:04:56 1998  Kristian Nielsen  <kristian.nielsen@risoe.dk>

	* [configure.in] [include/acconfig.h]
	Autoconf macro to check for non-reentrant X libraries.

	* [windows/winpos.c]
	In SetWindowPos32(), do not cause WM_SIZE messages when the
	SWP_NOSIZE flag is specified. This fixes the division-by-zero in
	Borland C++ 4.0 "Open Project" menu item.

Sat Feb 28 13:11:26 1998  James Moody  <013263m@dragon.acadiau.ca>

	* [ole/ole2nls.c]
	Changed "English" values from German to English.

	* [files/dos_fs.c]
	Fixed off-by-one month bug.

Fri Feb 27 22:12:01 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [windows/win.c]
	Fix winelib class menu loading bug.

	* [include/module.h] [loader/module.c]
	LoadModule32 should be implemented in terms of CreateProcess.

	* [programs/view/*]
	Metafile viewer sample program.

	* [documentation/wine.texinfo] [documentation/Makefile.in]
	Improvements and additions, HTML target.

Fri Feb 27 04:27:48 1998  Dimitrie O. Paun <dimi@cs.toronto.edu>

	* [*/*]
	Switched to the new debug messages interface. For more information
	please refer to documentation/debug-msgs. Because the new scheme
	introduces a new semantic level, I had to manually do through
	about 530 dprintf_xxx!  The rest of about 2400 where transformed
	via a script.  Because of the large number of changes that I had
	to do, some may have not come out as nicely as I wanted them.  If
	this is the case, please let me know. There is a lot of work left
	to do: -- a few hundred printf's to be converted -- about 2300
	fprintf's to be converted -- about 600 FIXME's to be transformed
	The problem is that in the above mentioned cases, a lot of manual
	intervention is required because a lot of the information is
	missing.  There are also a lot of other things to be done to the
	interface and so forth. I have now ideas for a at least a month
	worth of full time work :) I will proceed with many changes in the
	next few releases, so please do not start modifing things because
	there will be a hell of a lot of conflicts. If you have ideas that
	you want to integrate or you want to work on different things,
	please coordinate with me.

Thu Feb 26 13:04:29 1998  David Lee Lambert <lamber45@egr.msu.edu>

	* [ole/ole2nls.c] [include/windows.h]
	First try at OLE date- and time-formatting functions.

Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [files/*.c]
	Changed dos device handling, added 'CON' devicehandling.

	* [graphics/ddraw.c]
	Bug fixes, some additions.

	* [if1632/builtin.c][loader/module.c][library/winestub.c]
	Small hack so we don't need a dummy BUILTIN_LoadModule
	in winestub.c.

	* [ole/*][relay32/ole32.spec][if1632/storage.spec]
	storage.dll started. winword loads documents (saving
	doesn't work yet, dunno why).
	Several ole additions, some cleanups and bugfixes.
	IMalloc16 implemented.

	* [loader/pe_image.c]
	Added some comments, fixed circular dll references,
	fixed modref ordering, fixed tls allocation.

	* [memory/global.c]
	Added validity checks before every GET_ARENA_PTR.
	(several functions rely on Global* return values
	 on invalid handles, like IsTask).
	Implemented GlobalUnlockFree16.

	* [memory/virtual.c]
	Replaced dprintf_virtual by fprintf, so we can
	do 'info map' again in the debugger. Increase read
	linesize for Linux2.1 cases.

	* [misc/cpu.c][misc/registry.c]
	Moved cpu registry initialization to misc/cpu.c.

	* [multimedia/dsound.c]
	Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.

	* [relay32/crtdll.spec][relay32/ntdll.spec]
	Replaced some ptr by respective 'str' and 'wstr' arguments
	for libc functions.

	* [scheduler/thread.c]
	Added some sanity checks to stackallocation, tlshandling fixed.

	* [tools/build.c]
	Fixed cdecl argumenttype order (was reversed).

	* [win32/ordinals.c]
	Implemented KERNEL_449.

	* [windows/dinput.c]
	Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)

Tue Feb 24 20:46:37 1998  James Juran   <jrj120@psu.edu>

	* [windows/win.c]
	Fixed USER32 ordinal numbers in documentation.

Sat Feb 21 12:30:38 1998  John Richardson <jrichard@zko.dec.com>

	* [files/file.c] [include/k32obj.h] [memory/virtual.c]
	[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
	[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
	[scheduler/semaphore.c] [scheduler/thread.c]
	Added generic k32obj read and write routines for k32objs that
	support I/O.

	* [documentation/console]
	Updated console docs.

	* [win32/console.c]
	Make console work like a k32obj that supports I/O.

	* [include/windows.h]
	Make WriteFile and ReadFile take HANDLE32 for handle.

Sun Feb 15 14:07:07 1998  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
	  [multimedia/joystick.c] [windows/dialog.c]
	Modified some dprintf_xxx's to prepare them for a new
	dprintf_ scheme. Basically, I changed the dprintf's that
	outputed a line with many dprintf calls to do just one
	dprintf call.
This commit is contained in:
Alexandre Julliard 1998-03-01 20:05:02 +00:00
parent 03468f7d4b
commit a11d7b1a68
289 changed files with 10584 additions and 6833 deletions

View File

@ -1,13 +1,13 @@
This is release 980215 of Wine, the MS Windows emulator. This is still a
This is release 980301 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-980215: (see ChangeLog for details)
- Preliminary console allocation support.
- Hopefully no more Xlib errno problems.
WHAT'S NEW with Wine-980301: (see ChangeLog for details)
- New debugging printfs scheme.
- Better DOS device handling.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -16,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
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980215.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980215.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980215.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980215.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980301.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980301.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980301.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980301.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

View File

@ -10,6 +10,7 @@ Dag Asheim,
Martin Ayotte,
Karl Backström,
Peter Bajusz,
Marcel Baur,
Georg Beyerle,
Ross Biro,
Martin Boehme,

163
ChangeLog
View File

@ -1,4 +1,167 @@
----------------------------------------------------------------------
Sun Feb 29 10:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).
* [msdos/dosmem.c]
Export address for __0000H, too.
* [msdos/dpmi.c]
Changed MemAlloc functions to return less fragmented addresses.
Sat Feb 28 18:50:12 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [scheduler/process.c] [scheduler/sysdeps.c]
Don't use %fs register before threading initialization.
Sat Feb 28 14:04:56 1998 Kristian Nielsen <kristian.nielsen@risoe.dk>
* [configure.in] [include/acconfig.h]
Autoconf macro to check for non-reentrant X libraries.
* [windows/winpos.c]
In SetWindowPos32(), do not cause WM_SIZE messages when the
SWP_NOSIZE flag is specified. This fixes the division-by-zero in
Borland C++ 4.0 "Open Project" menu item.
Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca>
* [ole/ole2nls.c]
Changed "English" values from German to English.
* [files/dos_fs.c]
Fixed off-by-one month bug.
Fri Feb 27 22:12:01 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/win.c]
Fix winelib class menu loading bug.
* [include/module.h] [loader/module.c]
LoadModule32 should be implemented in terms of CreateProcess.
* [programs/view/*]
Metafile viewer sample program.
* [documentation/wine.texinfo] [documentation/Makefile.in]
Improvements and additions, HTML target.
Fri Feb 27 04:27:48 1998 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [*/*]
Switched to the new debug messages interface. For more information
please refer to documentation/debug-msgs. Because the new scheme
introduces a new semantic level, I had to manually do through
about 530 dprintf_xxx! The rest of about 2400 where transformed
via a script. Because of the large number of changes that I had
to do, some may have not come out as nicely as I wanted them. If
this is the case, please let me know. There is a lot of work left
to do: -- a few hundred printf's to be converted -- about 2300
fprintf's to be converted -- about 600 FIXME's to be transformed
The problem is that in the above mentioned cases, a lot of manual
intervention is required because a lot of the information is
missing. There are also a lot of other things to be done to the
interface and so forth. I have now ideas for a at least a month
worth of full time work :) I will proceed with many changes in the
next few releases, so please do not start modifing things because
there will be a hell of a lot of conflicts. If you have ideas that
you want to integrate or you want to work on different things,
please coordinate with me.
Thu Feb 26 13:04:29 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [include/windows.h]
First try at OLE date- and time-formatting functions.
Wed Feb 25 11:20:35 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/*.c]
Changed dos device handling, added 'CON' devicehandling.
* [graphics/ddraw.c]
Bug fixes, some additions.
* [if1632/builtin.c][loader/module.c][library/winestub.c]
Small hack so we don't need a dummy BUILTIN_LoadModule
in winestub.c.
* [ole/*][relay32/ole32.spec][if1632/storage.spec]
storage.dll started. winword loads documents (saving
doesn't work yet, dunno why).
Several ole additions, some cleanups and bugfixes.
IMalloc16 implemented.
* [loader/pe_image.c]
Added some comments, fixed circular dll references,
fixed modref ordering, fixed tls allocation.
* [memory/global.c]
Added validity checks before every GET_ARENA_PTR.
(several functions rely on Global* return values
on invalid handles, like IsTask).
Implemented GlobalUnlockFree16.
* [memory/virtual.c]
Replaced dprintf_virtual by fprintf, so we can
do 'info map' again in the debugger. Increase read
linesize for Linux2.1 cases.
* [misc/cpu.c][misc/registry.c]
Moved cpu registry initialization to misc/cpu.c.
* [multimedia/dsound.c]
Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT.
* [relay32/crtdll.spec][relay32/ntdll.spec]
Replaced some ptr by respective 'str' and 'wstr' arguments
for libc functions.
* [scheduler/thread.c]
Added some sanity checks to stackallocation, tlshandling fixed.
* [tools/build.c]
Fixed cdecl argumenttype order (was reversed).
* [win32/ordinals.c]
Implemented KERNEL_449.
* [windows/dinput.c]
Some fixes, needs much more work. Tomb Raider2 works with keyboard ;)
Tue Feb 24 20:46:37 1998 James Juran <jrj120@psu.edu>
* [windows/win.c]
Fixed USER32 ordinal numbers in documentation.
Sat Feb 21 12:30:38 1998 John Richardson <jrichard@zko.dec.com>
* [files/file.c] [include/k32obj.h] [memory/virtual.c]
[scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c]
[scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c]
[scheduler/semaphore.c] [scheduler/thread.c]
Added generic k32obj read and write routines for k32objs that
support I/O.
* [documentation/console]
Updated console docs.
* [win32/console.c]
Make console work like a k32obj that supports I/O.
* [include/windows.h]
Make WriteFile and ReadFile take HANDLE32 for handle.
----------------------------------------------------------------------
Sun Feb 15 14:07:07 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [controls/menu.c] [misc/ver.c] [multimedia/dsound.c]
[multimedia/joystick.c] [windows/dialog.c]
Modified some dprintf_xxx's to prepare them for a new
dprintf_ scheme. Basically, I changed the dprintf's that
outputed a line with many dprintf calls to do just one
dprintf call.
Sun Feb 15 12:02:59 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [graphics/x11drv/*.c] [objects/*.c]

281
configure vendored
View File

@ -16,6 +16,8 @@ ac_help="$ac_help
--disable-emulator build only the Wine library, not the emulator"
ac_help="$ac_help
--enable-dll build the Wine library as a DLL"
ac_help="$ac_help
--without-reentrant-x Compile for use with non-reentrant X libraries"
ac_help="$ac_help
--with-x use the X Window System"
@ -569,13 +571,20 @@ fi
# Check whether --with-reentrant-x or --without-reentrant-x was given.
if test "${with_reentrant_x+set}" = set; then
withval="$with_reentrant_x"
:
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:579: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo "configure:588: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -604,7 +613,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:608: checking for $ac_word" >&5
echo "configure:617: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -633,7 +642,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:637: checking for $ac_word" >&5
echo "configure:646: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -681,7 +690,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
echo "configure:694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -691,11 +700,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
#line 695 "configure"
#line 704 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@ -715,12 +724,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:719: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:724: checking whether we are using GNU C" >&5
echo "configure:733: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -729,7 +738,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@ -744,7 +753,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:748: checking whether ${CC-cc} accepts -g" >&5
echo "configure:757: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -772,7 +781,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:776: checking how to run the C preprocessor" >&5
echo "configure:785: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -787,13 +796,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 791 "configure"
#line 800 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -804,13 +813,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 808 "configure"
#line 817 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -837,7 +846,7 @@ echo "$ac_t""$CPP" 1>&6
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:841: checking for X" >&5
echo "configure:850: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@ -899,12 +908,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 903 "configure"
#line 912 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -973,14 +982,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 977 "configure"
#line 986 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@ -1086,17 +1095,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
echo "configure:1090: checking whether -R must be followed by a space" >&5
echo "configure:1099: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
#line 1093 "configure"
#line 1102 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:1100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_nospace=yes
else
@ -1112,14 +1121,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
#line 1116 "configure"
#line 1125 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:1123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_space=yes
else
@ -1151,7 +1160,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
echo "configure:1155: checking for dnet_ntoa in -ldnet" >&5
echo "configure:1164: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1159,7 +1168,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1163 "configure"
#line 1172 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1170,7 +1179,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1192,7 +1201,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
echo "configure:1196: checking for dnet_ntoa in -ldnet_stub" >&5
echo "configure:1205: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1200,7 +1209,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1204 "configure"
#line 1213 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1211,7 +1220,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1240,12 +1249,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:1244: checking for gethostbyname" >&5
echo "configure:1253: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1249 "configure"
#line 1258 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@ -1268,7 +1277,7 @@ gethostbyname();
; return 0; }
EOF
if { (eval echo configure:1272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@ -1289,7 +1298,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:1293: checking for gethostbyname in -lnsl" >&5
echo "configure:1302: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1297,7 +1306,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1301 "configure"
#line 1310 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1308,7 +1317,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:1312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1338,12 +1347,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:1342: checking for connect" >&5
echo "configure:1351: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1347 "configure"
#line 1356 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@ -1366,7 +1375,7 @@ connect();
; return 0; }
EOF
if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@ -1387,7 +1396,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:1391: checking for connect in -lsocket" >&5
echo "configure:1400: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1395,7 +1404,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1399 "configure"
#line 1408 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1406,7 +1415,7 @@ int main() {
connect()
; return 0; }
EOF
if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1430,12 +1439,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
echo "configure:1434: checking for remove" >&5
echo "configure:1443: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1439 "configure"
#line 1448 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@ -1458,7 +1467,7 @@ remove();
; return 0; }
EOF
if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@ -1479,7 +1488,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
echo "configure:1483: checking for remove in -lposix" >&5
echo "configure:1492: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1487,7 +1496,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1491 "configure"
#line 1500 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1498,7 +1507,7 @@ int main() {
remove()
; return 0; }
EOF
if { (eval echo configure:1502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1522,12 +1531,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
echo "configure:1526: checking for shmat" >&5
echo "configure:1535: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1531 "configure"
#line 1540 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@ -1550,7 +1559,7 @@ shmat();
; return 0; }
EOF
if { (eval echo configure:1554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@ -1571,7 +1580,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
echo "configure:1575: checking for shmat in -lipc" >&5
echo "configure:1584: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1579,7 +1588,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1583 "configure"
#line 1592 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1590,7 +1599,7 @@ int main() {
shmat()
; return 0; }
EOF
if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1623,7 +1632,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
echo "configure:1627: checking for IceConnectionNumber in -lICE" >&5
echo "configure:1636: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1631,7 +1640,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1635 "configure"
#line 1644 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1642,7 +1651,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
if { (eval echo configure:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1671,7 +1680,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1675: checking for $ac_word" >&5
echo "configure:1684: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1703,7 +1712,7 @@ test -n "$YACC" || YACC="yacc"
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1707: checking for $ac_word" >&5
echo "configure:1716: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1736,7 +1745,7 @@ then
*) ac_lib=l ;;
esac
echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:1740: checking for yywrap in -l$ac_lib" >&5
echo "configure:1749: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1744,7 +1753,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1748 "configure"
#line 1757 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1755,7 +1764,7 @@ int main() {
yywrap()
; return 0; }
EOF
if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1780,7 +1789,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1784: checking for $ac_word" >&5
echo "configure:1793: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1817,7 +1826,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1821: checking for a BSD compatible install" >&5
echo "configure:1830: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1867,7 +1876,7 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:1871: checking whether ln -s works" >&5
echo "configure:1880: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1890,7 +1899,7 @@ fi
echo $ac_n "checking for i386_set_ldt in -li386""... $ac_c" 1>&6
echo "configure:1894: checking for i386_set_ldt in -li386" >&5
echo "configure:1903: checking for i386_set_ldt in -li386" >&5
ac_lib_var=`echo i386'_'i386_set_ldt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1898,7 +1907,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li386 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1902 "configure"
#line 1911 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1909,7 +1918,7 @@ int main() {
i386_set_ldt()
; return 0; }
EOF
if { (eval echo configure:1913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1937,7 +1946,7 @@ else
fi
echo $ac_n "checking for iswalnum in -lw""... $ac_c" 1>&6
echo "configure:1941: checking for iswalnum in -lw" >&5
echo "configure:1950: checking for iswalnum in -lw" >&5
ac_lib_var=`echo w'_'iswalnum | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1945,7 +1954,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1949 "configure"
#line 1958 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1956,7 +1965,7 @@ int main() {
iswalnum()
; return 0; }
EOF
if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1984,7 +1993,7 @@ else
fi
echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6
echo "configure:1988: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
echo "configure:1997: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1992,7 +2001,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXxf86dga $X_LIBS -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1996 "configure"
#line 2005 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2003,7 +2012,7 @@ int main() {
XF86DGAQueryExtension()
; return 0; }
EOF
if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2029,12 +2038,12 @@ fi
echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6
echo "configure:2033: checking "for Open Sound System"" >&5
echo "configure:2042: checking "for Open Sound System"" >&5
if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2038 "configure"
#line 2047 "configure"
#include "confdefs.h"
#include <sys/soundcard.h>
int main() {
@ -2046,7 +2055,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_opensoundsystem="yes"
else
@ -2070,12 +2079,12 @@ fi
echo $ac_n "checking "for union semun"""... $ac_c" 1>&6
echo "configure:2074: checking "for union semun"" >&5
echo "configure:2083: checking "for union semun"" >&5
if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2079 "configure"
#line 2088 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/sem.h>
@ -2083,7 +2092,7 @@ int main() {
union semun foo
; return 0; }
EOF
if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_union_semun="yes"
else
@ -2111,7 +2120,7 @@ if test "x${GCC}" = "xyes"
then
CFLAGS="$CFLAGS -Wall"
echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
echo "configure:2115: checking "for gcc strength-reduce bug"" >&5
echo "configure:2124: checking "for gcc strength-reduce bug"" >&5
if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2119,7 +2128,7 @@ else
ac_cv_c_gcc_strength_bug="yes"
else
cat > conftest.$ac_ext <<EOF
#line 2123 "configure"
#line 2132 "configure"
#include "confdefs.h"
int main(void) {
@ -2130,7 +2139,7 @@ int main(void) {
exit( Array[1] != -2 );
}
EOF
if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_gcc_strength_bug="no"
else
@ -2153,7 +2162,7 @@ fi
echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
echo "configure:2157: checking "whether external symbols need an underscore prefix"" >&5
echo "configure:2166: checking "whether external symbols need an underscore prefix"" >&5
if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2165,14 +2174,14 @@ _ac_test:
.long 0
EOF
cat > conftest.$ac_ext <<EOF
#line 2169 "configure"
#line 2178 "configure"
#include "confdefs.h"
extern int ac_test;
int main() {
if (ac_test) return 1
; return 0; }
EOF
if { (eval echo configure:2176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_extern_prefix="yes"
else
@ -2196,7 +2205,7 @@ fi
echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6
echo "configure:2200: checking "whether assembler accepts .string"" >&5
echo "configure:2209: checking "whether assembler accepts .string"" >&5
if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2206,14 +2215,14 @@ cat > conftest_asm.s <<EOF
.string "test"
EOF
cat > conftest.$ac_ext <<EOF
#line 2210 "configure"
#line 2219 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_asm_string="yes"
else
@ -2240,21 +2249,21 @@ DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0"
then
echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
echo "configure:2244: checking "whether we can build a dll"" >&5
echo "configure:2253: checking "whether we can build a dll"" >&5
if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
cat > conftest.$ac_ext <<EOF
#line 2251 "configure"
#line 2260 "configure"
#include "confdefs.h"
int main() {
return 1
; return 0; }
EOF
if { (eval echo configure:2258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_dll="yes"
else
@ -2279,15 +2288,57 @@ fi
echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6
echo "configure:2293: checking "for reentrant X libraries"" >&5
if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$with_reentrant_x" = "xno"
then
wine_cv_x_reentrant=no
else
libX11_ckeck=none
for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
if test -e $dir/libX11.so; then
libX11_check="-D $dir/libX11.so"
break 1
fi
if test -e $dir/libX11.a; then
libX11_check="$dir/libX11.a"
break 1
fi
done
if test "$libX11_check" != "none"; then
if nm $libX11_check | grep -q __errno_location; then
wine_cv_x_reentrant=yes
else
wine_cv_x_reentrant=no
fi
else
wine_cv_x_reentrant=unknown
fi
fi
fi
echo "$ac_t""$wine_cv_x_reentrant" 1>&6
if test "$wine_cv_x_reentrant" = "no"
then
cat >> confdefs.h <<\EOF
#define NO_REENTRANT_X11 1
EOF
fi
for ac_func in clone memmove strerror tcgetattr usleep wait4 waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2286: checking for $ac_func" >&5
echo "configure:2337: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2291 "configure"
#line 2342 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -2310,7 +2361,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2338,17 +2389,17 @@ for ac_hdr in wctype.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2342: checking for $ac_hdr" >&5
echo "configure:2393: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2347 "configure"
#line 2398 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2375,12 +2426,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:2379: checking whether stat file-mode macros are broken" >&5
echo "configure:2430: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2384 "configure"
#line 2435 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -2431,12 +2482,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2435: checking for working const" >&5
echo "configure:2486: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2440 "configure"
#line 2491 "configure"
#include "confdefs.h"
int main() {
@ -2485,7 +2536,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:2489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@ -2506,12 +2557,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2510: checking for ANSI C header files" >&5
echo "configure:2561: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2515 "configure"
#line 2566 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -2519,7 +2570,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2536,7 +2587,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2540 "configure"
#line 2591 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@ -2554,7 +2605,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2558 "configure"
#line 2609 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -2575,7 +2626,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 2579 "configure"
#line 2630 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -2586,7 +2637,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@ -2610,12 +2661,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2614: checking for size_t" >&5
echo "configure:2665: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2619 "configure"
#line 2670 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@ -2772,8 +2823,10 @@ multimedia/Makefile
objects/Makefile
ole/Makefile
programs/Makefile
programs/clock/Makefile
programs/notepad/Makefile
programs/progman/Makefile
programs/view/Makefile
programs/winhelp/Makefile
programs/winver/Makefile
rc/Makefile
@ -2898,8 +2951,10 @@ multimedia/Makefile
objects/Makefile
ole/Makefile
programs/Makefile
programs/clock/Makefile
programs/notepad/Makefile
programs/progman/Makefile
programs/view/Makefile
programs/winhelp/Makefile
programs/winver/Makefile
rc/Makefile

View File

@ -28,6 +28,9 @@ dnl AC_ARG_WITH(ipc,
dnl [ --enable-ipc use inter-process communication for DDE],
dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi])
AC_ARG_WITH(reentrant-x,
[ --without-reentrant-x Compile for use with non-reentrant X libraries])
AC_SUBST(MAIN_TARGET)
AC_SUBST(LIB_TARGET)
AC_SUBST(OPTIONS)
@ -162,6 +165,43 @@ then
fi
AC_SUBST(DLLFLAGS)
dnl **** Check for reentrant X libraries ****
dnl
dnl This may fail to determine whether X libraries are reentrant if
dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
dnl is possible with the --without-reentrant-x option.
AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant,
[ if test "x$with_reentrant_x" = "xno"
then
wine_cv_x_reentrant=no
else
libX11_ckeck=none
for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
if test -e $dir/libX11.so; then
libX11_check="-D $dir/libX11.so"
break 1
fi
if test -e $dir/libX11.a; then
libX11_check="$dir/libX11.a"
break 1
fi
done
if test "$libX11_check" != "none"; then
if nm $libX11_check | grep -q __errno_location; then
wine_cv_x_reentrant=yes
else
wine_cv_x_reentrant=no
fi
else
wine_cv_x_reentrant=unknown
fi
fi ] )
if test "$wine_cv_x_reentrant" = "no"
then
AC_DEFINE(NO_REENTRANT_X11)
fi
dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid)
@ -199,8 +239,10 @@ multimedia/Makefile
objects/Makefile
ole/Makefile
programs/Makefile
programs/clock/Makefile
programs/notepad/Makefile
programs/progman/Makefile
programs/view/Makefile
programs/winhelp/Makefile
programs/winver/Makefile
rc/Makefile

View File

@ -18,7 +18,6 @@
#include "heap.h"
#include "combo.h"
#include "drive.h"
#include "stddebug.h"
#include "debug.h"
/* bits in the dwKeyData */
@ -63,7 +62,7 @@ static BOOL32 COMBO_Init()
CBitHeight = bm.bmHeight;
CBitWidth = bm.bmWidth;
dprintf_combo(stddeb, "combo bitmap [%i,%i]\n", CBitWidth, CBitHeight );
dprintf_info(combo, "combo bitmap [%i,%i]\n", CBitWidth, CBitHeight );
hPrevB = SelectObject16( hDC, hComboBmp);
SetRect16( &r, 0, 0, CBitWidth, CBitHeight );
@ -102,7 +101,7 @@ static LRESULT COMBO_NCCreate(WND* wnd, LPARAM lParam)
if( !(wnd->dwExStyle & WS_EX_NOPARENTNOTIFY) )
lphc->wState |= CBF_NOTIFY;
dprintf_combo(stddeb, "COMBO_NCCreate: [0x%08x], style = %08x\n",
dprintf_info(combo, "COMBO_NCCreate: [0x%08x], style = %08x\n",
(UINT32)lphc, lphc->dwStyle );
return (LRESULT)(UINT32)wnd->hwndSelf;
@ -120,7 +119,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc )
{
WND* wnd = lphc->self;
dprintf_combo(stddeb,"Combo [%04x]: freeing storage\n", CB_HWND(lphc));
dprintf_info(combo,"Combo [%04x]: freeing storage\n", CB_HWND(lphc));
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox )
DestroyWindow32( lphc->hWndLBox );
@ -219,7 +218,7 @@ static void CBCalcPlacement( LPHEADCOMBO lphc,
if( lphc->droppedWidth > (lprLB->right - lprLB->left) )
lprLB->right = lprLB->left + (INT16)lphc->droppedWidth;
dprintf_combo(stddeb,"Combo [%04x]: (%i,%i-%i,%i) placement\n\ttext\t= (%i,%i-%i,%i)\
dprintf_info(combo,"Combo [%04x]: (%i,%i-%i,%i) placement\n\ttext\t= (%i,%i-%i,%i)\
\n\tbutton\t= (%i,%i-%i,%i)\n\tlbox\t= (%i,%i-%i,%i)\n", CB_HWND(lphc),
lphc->RectCombo.left, lphc->RectCombo.top, lphc->RectCombo.right, lphc->RectCombo.bottom,
lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom,
@ -338,12 +337,12 @@ static LRESULT COMBO_Create( LPHEADCOMBO lphc, WND* wnd, LPARAM lParam)
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
lphc->wState &= ~CBF_NORESIZE;
}
dprintf_combo(stddeb,"COMBO_Create: init done\n");
dprintf_info(combo,"COMBO_Create: init done\n");
return wnd->hwndSelf;
}
dprintf_combo(stderr, "COMBO_Create: edit control failure.\n");
} else dprintf_combo(stderr, "COMBO_Create: listbox failure.\n");
} else dprintf_combo(stderr, "COMBO_Create: no owner for visible combo.\n");
dprintf_err(combo, "COMBO_Create: edit control failure.\n");
} else dprintf_err(combo, "COMBO_Create: listbox failure.\n");
} else dprintf_err(combo, "COMBO_Create: no owner for visible combo.\n");
/* CreateWindow() will send WM_NCDESTROY to cleanup */
@ -562,7 +561,7 @@ static INT32 CBUpdateLBox( LPHEADCOMBO lphc )
if( length > 0 )
pText = (LPSTR) HeapAlloc( GetProcessHeap(), 0, length + 1);
dprintf_combo(stddeb,"\tCBUpdateLBox: edit text length %i\n", length );
dprintf_info(combo,"\tCBUpdateLBox: edit text length %i\n", length );
if( pText )
{
@ -598,7 +597,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT32 index )
INT32 length;
LPSTR pText = NULL;
dprintf_combo(stddeb,"\tCBUpdateEdit: %i\n", index );
dprintf_info(combo,"\tCBUpdateEdit: %i\n", index );
if( index == -1 )
{
@ -643,7 +642,7 @@ static void CBDropDown( LPHEADCOMBO lphc )
RECT16 rect;
LPRECT16 pRect = NULL;
dprintf_combo(stddeb,"Combo [%04x]: drop down\n", CB_HWND(lphc));
dprintf_info(combo,"Combo [%04x]: drop down\n", CB_HWND(lphc));
CB_NOTIFY( lphc, CBN_DROPDOWN );
@ -699,7 +698,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL32 ok, BOOL32 bButton )
if( IsWindow32( hWnd ) && CB_GETTYPE(lphc) != CBS_SIMPLE )
{
dprintf_combo(stddeb,"Combo [%04x]: roll up [%i]\n", CB_HWND(lphc), (INT32)ok );
dprintf_info(combo,"Combo [%04x]: roll up [%i]\n", CB_HWND(lphc), (INT32)ok );
/* always send WM_LBUTTONUP? */
SendMessage32A( lphc->hWndLBox, WM_LBUTTONUP, 0, (LPARAM)(-1) );
@ -840,7 +839,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM32 wParam, HWND32 hWnd )
{
case (EN_SETFOCUS >> 8):
dprintf_combo(stddeb,"Combo [%04x]: edit [%04x] got focus\n",
dprintf_info(combo,"Combo [%04x]: edit [%04x] got focus\n",
CB_HWND(lphc), (HWND16)lphc->hWndEdit );
if( !(lphc->wState & CBF_FOCUSED) ) COMBO_SetFocus( lphc );
@ -848,7 +847,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM32 wParam, HWND32 hWnd )
case (EN_KILLFOCUS >> 8):
dprintf_combo(stddeb,"Combo [%04x]: edit [%04x] lost focus\n",
dprintf_info(combo,"Combo [%04x]: edit [%04x] lost focus\n",
CB_HWND(lphc), (HWND16)lphc->hWndEdit );
/* NOTE: it seems that Windows' edit control sends an
@ -889,7 +888,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM32 wParam, HWND32 hWnd )
case LBN_SELCHANGE:
case LBN_SELCANCEL:
dprintf_combo(stddeb,"Combo [%04x]: lbox selection change [%04x]\n",
dprintf_info(combo,"Combo [%04x]: lbox selection change [%04x]\n",
CB_HWND(lphc), lphc->wState );
/* do not roll up if selection is being tracked
@ -923,7 +922,7 @@ static LRESULT COMBO_ItemOp32( LPHEADCOMBO lphc, UINT32 msg,
{
HWND32 hWnd = lphc->self->hwndSelf;
dprintf_combo(stddeb,"Combo [%04x]: ownerdraw op %04x\n",
dprintf_info(combo,"Combo [%04x]: ownerdraw op %04x\n",
CB_HWND(lphc), (UINT16)msg );
#define lpIS ((LPDELETEITEMSTRUCT32)lParam)
@ -1061,7 +1060,7 @@ static void COMBO_Size( LPHEADCOMBO lphc )
GetWindowRect16( lphc->self->hwndSelf, &rect );
w = rect.right - rect.left; h = rect.bottom - rect.top;
dprintf_combo(stddeb,"COMBO_Size: w = %i, h = %i\n", w, h );
dprintf_info(combo,"COMBO_Size: w = %i, h = %i\n", w, h );
/* CreateWindow() may send a bogus WM_SIZE, ignore it */
@ -1258,7 +1257,7 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message,
{
LPHEADCOMBO lphc = CB_GETPTR(pWnd);
dprintf_combo( stddeb, "Combo [%04x]: msg %s wp %08x lp %08lx\n",
dprintf_info(combo, "Combo [%04x]: msg %s wp %08x lp %08lx\n",
pWnd->hwndSelf, SPY_GetMsgName(message), wParam, lParam );
if( lphc || message == WM_NCCREATE )
@ -1560,7 +1559,7 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message,
return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
case (WM_USER + 0x1B):
dprintf_combo(stddeb,"Combo [%04x]: undocumented msg!\n", (HWND16)hwnd );
dprintf_warn(combo, "Combo [%04x]: undocumented msg!\n", (HWND16)hwnd );
}
return DefWindowProc32A(hwnd, message, wParam, lParam);
}

View File

@ -18,7 +18,6 @@
#include "combo.h"
#include "local.h"
#include "resource.h"
#include "stddebug.h"
#include "debug.h"
#include "callback.h"
@ -110,7 +109,7 @@ typedef struct
#define ORDER_UINT32(x,y) do { if ((UINT32)(y) < (UINT32)(x)) SWAP_UINT32((x),(y)); } while(0)
#define DPRINTF_EDIT_NOTIFY(hwnd, str) \
({dprintf_edit(stddeb, \
({dprintf_info(edit, \
"edit: notification " str " sent to hwnd=%08x\n", \
(UINT32)(hwnd));})
@ -123,11 +122,11 @@ typedef struct
MAKEWPARAM((wnd)->wIDmenu, wNotifyCode), \
(LPARAM)(wnd)->hwndSelf))
#define DPRINTF_EDIT_MSG16(str) \
dprintf_edit(stddeb, \
dprintf_info(edit, \
"edit: 16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
#define DPRINTF_EDIT_MSG32(str) \
dprintf_edit(stddeb, \
dprintf_info(edit, \
"edit: 32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
@ -987,7 +986,7 @@ static INT32 EDIT_CallWordBreakProc(WND *wnd, EDITSTATE *es, INT32 start, INT32
}
else if (es->word_break_proc32A)
{
dprintf_relay( stddeb, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n",
dprintf_info(relay, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n",
es->word_break_proc32A, es->text + start, index,
count, action );
return (INT32)es->word_break_proc32A( es->text + start, index,
@ -1319,7 +1318,7 @@ static BOOL32 EDIT_MakeFit(WND *wnd, EDITSTATE *es, INT32 size)
if (size > es->buffer_limit)
size = es->buffer_limit;
dprintf_edit(stddeb, "edit: EDIT_MakeFit: trying to ReAlloc to %d+1\n", size);
dprintf_info(edit, "edit: EDIT_MakeFit: trying to ReAlloc to %d+1\n", size);
EDIT_UnlockBuffer(wnd, es, TRUE);
if (es->text) {
@ -1329,25 +1328,25 @@ static BOOL32 EDIT_MakeFit(WND *wnd, EDITSTATE *es, INT32 size)
es->buffer_size = 0;
} else if (es->hloc32) {
if ((hNew32 = LocalReAlloc32(es->hloc32, size + 1, 0))) {
dprintf_edit(stddeb, "edit: EDIT_MakeFit: Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
dprintf_info(edit, "edit: EDIT_MakeFit: Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
es->hloc32 = hNew32;
es->buffer_size = MIN(LocalSize32(es->hloc32) - 1, es->buffer_limit);
}
} else if (es->hloc16) {
if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) {
dprintf_edit(stddeb, "edit: EDIT_MakeFit: Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
dprintf_info(edit, "edit: EDIT_MakeFit: Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
es->hloc16 = hNew16;
es->buffer_size = MIN(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit);
}
}
if (es->buffer_size < size) {
EDIT_LockBuffer(wnd, es);
dprintf_edit(stddeb, "edit: EDIT_MakeFit: FAILED ! We now have %d+1\n", es->buffer_size);
dprintf_warn(edit, "edit: EDIT_MakeFit: FAILED ! We now have %d+1\n", es->buffer_size);
EDIT_NOTIFY_PARENT(wnd, EN_ERRSPACE, "EN_ERRSPACE");
return FALSE;
} else {
EDIT_LockBuffer(wnd, es);
dprintf_edit(stddeb, "edit: EDIT_MakeFit: We now have %d+1\n", es->buffer_size);
dprintf_info(edit, "edit: EDIT_MakeFit: We now have %d+1\n", es->buffer_size);
return TRUE;
}
}
@ -1366,12 +1365,12 @@ static BOOL32 EDIT_MakeUndoFit(WND *wnd, EDITSTATE *es, INT32 size)
return TRUE;
size = ((size / GROWLENGTH) + 1) * GROWLENGTH;
dprintf_edit(stddeb, "edit: EDIT_MakeUndoFit: trying to ReAlloc to %d+1\n", size);
dprintf_info(edit, "edit: EDIT_MakeUndoFit: trying to ReAlloc to %d+1\n", size);
if ((es->undo_text = HeapReAlloc(es->heap, 0, es->undo_text, size + 1))) {
es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1;
if (es->undo_buffer_size < size) {
dprintf_edit(stddeb, "edit: EDIT_MakeUndoFit: FAILED ! We now have %d+1\n", es->undo_buffer_size);
dprintf_warn(edit, "edit: EDIT_MakeUndoFit: FAILED ! We now have %d+1\n", es->undo_buffer_size);
return FALSE;
}
return TRUE;
@ -1659,7 +1658,7 @@ static void EDIT_PaintLine(WND *wnd, EDITSTATE *es, HDC32 dc, INT32 line, BOOL32
} else if (line)
return;
dprintf_edit(stddeb, "edit: EDIT_PaintLine: line=%d\n", line);
dprintf_info(edit, "edit: EDIT_PaintLine: line=%d\n", line);
pos = EDIT_EM_PosFromChar(wnd, es, EDIT_EM_LineIndex(wnd, es, line), FALSE);
x = SLOWORD(pos);
@ -1868,7 +1867,7 @@ static INT32 EDIT_WordBreakProc(LPSTR s, INT32 index, INT32 count, INT32 action)
{
INT32 ret = 0;
dprintf_edit(stddeb, "edit: EDIT_WordBreakProc: s=%p, index=%u"
dprintf_info(edit, "edit: EDIT_WordBreakProc: s=%p, index=%u"
", count=%u, action=%d\n", s, index, count, action);
switch (action) {
@ -2008,7 +2007,7 @@ static HLOCAL32 EDIT_EM_GetHandle(WND *wnd, EDITSTATE *es)
es->buffer_size = newSize;
es->text = newText;
EDIT_LockBuffer(wnd, es);
dprintf_edit(stddeb, "edit: EM_GETHANDLE: switched to 32 bit local heap\n");
dprintf_info(edit, "edit: EM_GETHANDLE: switched to 32 bit local heap\n");
return es->hloc32;
}
@ -2047,7 +2046,7 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es)
fprintf(stderr, "edit: EM_GETHANDLE: could not initialize local heap\n");
return 0;
}
dprintf_edit(stddeb, "edit: EM_GETHANDLE: local heap initialized\n");
dprintf_info(edit, "edit: EM_GETHANDLE: local heap initialized\n");
}
if (!(newBuf = LOCAL_Alloc(wnd->hInstance, LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) {
fprintf(stderr, "edit: EM_GETHANDLE: could not allocate new 16 bit buffer\n");
@ -2072,7 +2071,7 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es)
es->buffer_size = newSize;
es->text = newText;
EDIT_LockBuffer(wnd, es);
dprintf_edit(stddeb, "edit: EM_GETHANDLE: switched to 16 bit buffer\n");
dprintf_info(edit, "edit: EM_GETHANDLE: switched to 16 bit buffer\n");
return es->hloc16;
}
@ -2624,7 +2623,7 @@ static void EDIT_EM_SetMargins(WND *wnd, EDITSTATE *es, INT32 action, INT32 left
if (action & EC_RIGHTMARGIN)
es->right_margin = right;
}
dprintf_edit(stddeb, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin);
dprintf_info(edit, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin);
}
@ -2810,7 +2809,7 @@ static BOOL32 EDIT_EM_Undo(WND *wnd, EDITSTATE *es)
lstrcpy32A(utext, es->undo_text);
dprintf_edit(stddeb, "edit: before UNDO:insertion length = %d, deletion buffer = %s\n",
dprintf_info(edit, "edit: before UNDO:insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, utext);
EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
@ -2819,7 +2818,7 @@ static BOOL32 EDIT_EM_Undo(WND *wnd, EDITSTATE *es)
EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
HeapFree(es->heap, 0, utext);
dprintf_edit(stddeb, "edit: after UNDO: insertion length = %d, deletion buffer = %s\n",
dprintf_info(edit, "edit: after UNDO: insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, es->undo_text);
return TRUE;
@ -2891,7 +2890,7 @@ static void EDIT_WM_Command(WND *wnd, EDITSTATE *es, INT32 code, INT32 id, HWND3
EDIT_EM_ScrollCaret(wnd, es);
break;
default:
dprintf_edit(stddeb, "edit: unknown menu item, please report\n");
dprintf_err(edit, "edit: unknown menu item, please report\n");
break;
}
}
@ -3193,7 +3192,7 @@ static LRESULT EDIT_HScroll_Hack(WND *wnd, EDITSTATE *es, INT32 action, INT32 po
break;
default:
dprintf_edit(stddeb, "edit: undocumented (hacked) WM_HSCROLL parameter, please report\n");
dprintf_err(edit, "edit: undocumented (hacked) WM_HSCROLL parameter, please report\n");
return 0;
}
if (dx)
@ -3286,7 +3285,7 @@ static BOOL32 EDIT_CheckCombo(WND *wnd, UINT32 msg, INT32 key, DWORD key_data)
HWND32 hCombo = wnd->parent->hwndSelf;
BOOL32 bUIFlip = TRUE;
dprintf_combo(stddeb, "EDIT_CheckCombo [%04x]: handling msg %04x (%04x)\n",
dprintf_info(combo, "EDIT_CheckCombo [%04x]: handling msg %04x (%04x)\n",
wnd->hwndSelf, (UINT16)msg, (UINT16)key);
switch (msg) {
@ -3719,7 +3718,7 @@ static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPCSTR text)
{
EDIT_EM_SetSel(wnd, es, 0, -1, FALSE);
if (text) {
dprintf_edit(stddeb, "\t'%s'\n", text);
dprintf_info(edit, "\t'%s'\n", text);
EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
es->x_offset = 0;
}

View File

@ -13,7 +13,6 @@
#include "spy.h"
#include "win.h"
#include "combo.h"
#include "stddebug.h"
#include "debug.h"
/* Unimplemented yet:
@ -309,7 +308,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
if ((descr->height > descr->item_height) &&
(descr->height % descr->item_height))
{
dprintf_listbox(stddeb, "Listbox %04x: changing height %d -> %d\n",
dprintf_info(listbox, "Listbox %04x: changing height %d -> %d\n",
wnd->hwndSelf, descr->height,
descr->height - descr->height%descr->item_height );
SetWindowPos32( wnd->hwndSelf, 0, 0, 0,
@ -320,7 +319,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
return;
}
}
dprintf_listbox( stddeb, "Listbox %04x: new size = %d,%d\n",
dprintf_info(listbox, "Listbox %04x: new size = %d,%d\n",
wnd->hwndSelf, descr->width, descr->height );
LISTBOX_UpdatePage( wnd, descr );
LISTBOX_UpdateScroll( wnd, descr );
@ -458,7 +457,7 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc,
if (wnd->dwStyle & WS_DISABLED) dis.itemState |= ODS_DISABLED;
dis.itemData = item ? item->data : 0;
dis.rcItem = *rect;
dprintf_listbox( stddeb, "Listbox %04x: drawitem %d (%s) action=%02x "
dprintf_info(listbox, "Listbox %04x: drawitem %d (%s) action=%02x "
"state=%02x rect=%d,%d-%d,%d\n",
wnd->hwndSelf, index, item ? item->str : "", action,
dis.itemState, rect->left, rect->top,
@ -480,7 +479,7 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc,
oldText = SetTextColor32( hdc, GetSysColor32(COLOR_HIGHLIGHTTEXT));
}
dprintf_listbox( stddeb, "Listbox %04x: painting %d (%s) action=%02x "
dprintf_info(listbox, "Listbox %04x: painting %d (%s) action=%02x "
"rect=%d,%d-%d,%d\n",
wnd->hwndSelf, index, item ? item->str : "", action,
rect->left, rect->top, rect->right, rect->bottom );
@ -603,12 +602,15 @@ static BOOL32 LISTBOX_SetTabStops( WND *wnd, LB_DESCR *descr, INT32 count,
{
INT32 i;
LPINT16 p = (LPINT16)tabs;
dprintf_listbox( stddeb, "Listbox %04x: settabstops ", wnd->hwndSelf);
dbg_decl_str(listbox, 256);
for (i = 0; i < descr->nb_tabs; i++) {
descr->tabs[i] = *p++<<1; /* FIXME */
dprintf_listbox( stddeb, "%hd ", descr->tabs[i]);
if(debugging_info(listbox))
dsprintf(listbox, "%hd ", descr->tabs[i]);
}
dprintf_listbox( stddeb, "\n");
dprintf_info(listbox, "Listbox %04x: settabstops %s\n",
wnd->hwndSelf, dbg_str(listbox));
}
else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT32) );
/* FIXME: repaint the window? */
@ -986,7 +988,7 @@ static LRESULT LISTBOX_SetItemHeight( WND *wnd, LB_DESCR *descr, INT32 index,
if (descr->style & LBS_OWNERDRAWVARIABLE)
{
if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
dprintf_listbox( stddeb, "Listbox %04x: item %d height = %d\n",
dprintf_info(listbox, "Listbox %04x: item %d height = %d\n",
wnd->hwndSelf, index, height );
descr->items[index].height = height;
LISTBOX_UpdateScroll( wnd, descr );
@ -994,7 +996,7 @@ static LRESULT LISTBOX_SetItemHeight( WND *wnd, LB_DESCR *descr, INT32 index,
}
else if (height != descr->item_height)
{
dprintf_listbox( stddeb, "Listbox %04x: new height = %d\n",
dprintf_info(listbox, "Listbox %04x: new height = %d\n",
wnd->hwndSelf, height );
descr->item_height = height;
LISTBOX_UpdatePage( wnd, descr );
@ -1016,7 +1018,7 @@ static void LISTBOX_SetHorizontalPos( WND *wnd, LB_DESCR *descr, INT32 pos )
pos = descr->horz_extent - descr->width;
if (pos < 0) pos = 0;
if (!(diff = descr->horz_pos - pos)) return;
dprintf_listbox( stddeb, "Listbox %04x: new horz pos = %d\n",
dprintf_info(listbox, "Listbox %04x: new horz pos = %d\n",
wnd->hwndSelf, pos );
descr->horz_pos = pos;
LISTBOX_UpdateScroll( wnd, descr );
@ -1038,7 +1040,7 @@ static LRESULT LISTBOX_SetHorizontalExtent( WND *wnd, LB_DESCR *descr,
return LB_OKAY;
if (extent <= 0) extent = 1;
if (extent == descr->horz_extent) return LB_OKAY;
dprintf_listbox( stddeb, "Listbox %04x: new horz extent = %d\n",
dprintf_info(listbox, "Listbox %04x: new horz extent = %d\n",
wnd->hwndSelf, extent );
descr->horz_extent = extent;
if (descr->horz_pos > extent - descr->width)
@ -1056,7 +1058,7 @@ static LRESULT LISTBOX_SetColumnWidth( WND *wnd, LB_DESCR *descr, UINT32 width)
{
width += 2; /* For left and right margin */
if (width == descr->column_width) return LB_OKAY;
dprintf_listbox( stddeb, "Listbox %04x: new column width = %d\n",
dprintf_info(listbox, "Listbox %04x: new column width = %d\n",
wnd->hwndSelf, width );
descr->column_width = width;
LISTBOX_UpdatePage( wnd, descr );
@ -1305,7 +1307,7 @@ static LRESULT LISTBOX_InsertItem( WND *wnd, LB_DESCR *descr, INT32 index,
mis.itemHeight = descr->item_height;
SendMessage32A( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis );
item->height = mis.itemHeight ? mis.itemHeight : 1;
dprintf_listbox( stddeb, "Listbox %04x: measure item %d (%s) = %d\n",
dprintf_info(listbox, "Listbox %04x: measure item %d (%s) = %d\n",
wnd->hwndSelf, index, str ? str : "", item->height );
}
@ -1357,7 +1359,7 @@ static LRESULT LISTBOX_InsertString( WND *wnd, LB_DESCR *descr, INT32 index,
return ret;
}
dprintf_listbox( stddeb, "Listbox %04x: added item %d '%s'\n",
dprintf_info(listbox, "Listbox %04x: added item %d '%s'\n",
wnd->hwndSelf, index, HAS_STRINGS(descr) ? new_str : "" );
return index;
}
@ -1694,7 +1696,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
WPARAM32 wParam, INT32 x, INT32 y )
{
INT32 index = LISTBOX_GetItemFromPoint( wnd, descr, x, y );
dprintf_listbox( stddeb, "Listbox %04x: lbuttondown %d,%d item %d\n",
dprintf_info(listbox, "Listbox %04x: lbuttondown %d,%d item %d\n",
wnd->hwndSelf, x, y, index );
if (!descr->caret_on && (GetFocus32() == wnd->hwndSelf)) return 0;
if (index != -1)
@ -2029,7 +2031,7 @@ static BOOL32 LISTBOX_Create( WND *wnd, LPHEADCOMBO lphc )
if( lphc )
{
dprintf_combo(stddeb,"ComboLBox [%04x]: resetting owner %04x -> %04x\n",
dprintf_info(combo,"ComboLBox [%04x]: resetting owner %04x -> %04x\n",
wnd->hwndSelf, descr->owner, lphc->self->hwndSelf );
descr->owner = lphc->self->hwndSelf;
}
@ -2098,7 +2100,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
if (msg == WM_CREATE)
{
if (!LISTBOX_Create( wnd, NULL )) return -1;
dprintf_listbox( stddeb, "Listbox: creating wnd=%04x descr=%p\n",
dprintf_info(listbox, "Listbox: creating wnd=%04x descr=%p\n",
hwnd, *(LB_DESCR **)wnd->wExtra );
return 0;
}
@ -2106,7 +2108,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
return DefWindowProc32A( hwnd, msg, wParam, lParam );
}
dprintf_listbox( stddeb, "Listbox %04x: msg %s wp %08x lp %08lx\n",
dprintf_info(listbox, "Listbox %04x: msg %s wp %08x lp %08lx\n",
wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
switch(msg)
{
@ -2476,7 +2478,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
default:
if ((msg >= WM_USER) && (msg < 0xc000))
dprintf_listbox(stddeb,"Listbox %04x: unknown msg %04x wp %08x lp %08lx\n",
dprintf_warn(listbox, "Listbox %04x: unknown msg %04x wp %08x lp %08lx\n",
hwnd, msg, wParam, lParam );
return DefWindowProc32A( hwnd, msg, wParam, lParam );
}
@ -2521,7 +2523,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
{
LB_DESCR *descr = *(LB_DESCR **)wnd->wExtra;
dprintf_combo( stddeb, "ComboLBox [%04x]: msg %s wp %08x lp %08lx\n",
dprintf_info(combo, "ComboLBox [%04x]: msg %s wp %08x lp %08lx\n",
wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
if( descr || msg == WM_CREATE )
@ -2532,7 +2534,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
{
case WM_CREATE:
#define lpcs ((LPCREATESTRUCT32A)lParam)
dprintf_combo(stddeb, "\tpassed parent handle = 0x%08x\n",
dprintf_info(combo, "\tpassed parent handle = 0x%08x\n",
(UINT32)lpcs->lpCreateParams);
lphc = (LPHEADCOMBO)(lpcs->lpCreateParams);
@ -2578,7 +2580,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
}
lRet = DefWindowProc32A( hwnd, msg, wParam, lParam );
dprintf_combo(stddeb,"\tComboLBox: default on msg [%04x]\n", (UINT16)msg );
dprintf_info(combo,"\tComboLBox: default on msg [%04x]\n", (UINT16)msg );
}
return lRet;

View File

@ -32,7 +32,6 @@
#include "message.h"
#include "graphics.h"
#include "resource.h"
#include "stddebug.h"
#include "tweak.h"
#include "debug.h"
@ -165,10 +164,10 @@ static BOOL32 fEndMenu = FALSE;
*/
#define debug_print_menuitem(pre, mp, post) \
if(debugging_menu) do_debug_print_menuitem(pre, mp, post)
if(!debugging_info(menu)) ; else do_debug_print_menuitem(pre, mp, post)
#define MENUOUT(text) \
p+=sprintf(p, "%s%s", (count++ ? "," : ""), (text))
dsprintf(menu, "%s%s", (count++ ? "," : ""), (text))
#define MENUFLAG(bit,text) \
do { \
@ -178,19 +177,17 @@ static BOOL32 fEndMenu = FALSE;
static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
const char *postfix)
{
char buff[256];
char *p;
dbg_decl_str(menu, 256);
p = buff;
if (mp) {
UINT32 flags = mp->fType;
int typ = MENU_ITEM_TYPE(flags);
p+=sprintf(p, "{ ID=0x%x", mp->wID);
dsprintf(menu, "{ ID=0x%x", mp->wID);
if (flags & MF_POPUP)
p+=sprintf(p, ", Sub=0x%x", mp->hSubMenu);
dsprintf(menu, ", Sub=0x%x", mp->hSubMenu);
if (flags) {
int count = 0;
p+=sprintf(p, ", Typ=");
dsprintf(menu, ", Typ=");
if (typ == MFT_STRING)
/* Nothing */ ;
else if (typ == MFT_SEPARATOR)
@ -212,12 +209,12 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
MENUFLAG(MFT_RIGHTJUSTIFY, "right");
if (flags)
p+=sprintf(p, "+0x%x", flags);
dsprintf(menu, "+0x%x", flags);
}
flags = mp->fState;
if (flags) {
int count = 0;
p+=sprintf(p, ", State=");
dsprintf(menu, ", State=");
MENUFLAG(MFS_GRAYED, "grey");
MENUFLAG(MFS_DISABLED, "dis");
MENUFLAG(MFS_CHECKED, "check");
@ -225,28 +222,28 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
MENUFLAG(MF_USECHECKBITMAPS, "usebit");
MENUFLAG(MF_MOUSESELECT, "mouse");
if (flags)
p+=sprintf(p, "+0x%x", flags);
dsprintf(menu, "+0x%x", flags);
}
if (mp->hCheckBit)
p+=sprintf(p, ", Chk=0x%x", mp->hCheckBit);
dsprintf(menu, ", Chk=0x%x", mp->hCheckBit);
if (mp->hUnCheckBit)
p+=sprintf(p, ", Unc=0x%x", mp->hUnCheckBit);
dsprintf(menu, ", Unc=0x%x", mp->hUnCheckBit);
if (typ == MFT_STRING) {
if (mp->text)
p+=sprintf(p, ", Text=\"%s\"", mp->text);
dsprintf(menu, ", Text=\"%s\"", mp->text);
else
p+=sprintf(p, ", Text=Null");
dsprintf(menu, ", Text=Null");
} else if (mp->text == NULL)
/* Nothing */ ;
else
p+=sprintf(p, ", Text=%p", mp->text);
p+=sprintf(p, " }");
dsprintf(menu, ", Text=%p", mp->text);
dsprintf(menu, " }");
} else {
p+=sprintf(p, "NULL");
dsprintf(menu, "NULL");
}
dprintf_menu(stddeb, "%s %s %s\n", prefix, buff, postfix);
dprintf_info(menu, "%s %s %s\n", prefix, dbg_str(menu), postfix);
}
#undef MENUOUT
@ -270,7 +267,7 @@ static HMENU32 MENU_CopySysPopup(void)
fprintf( stderr, "Unable to load default system menu\n" );
}
dprintf_menu( stddeb, "MENU_CopySysPopup: returning %x.\n", hMenu );
dprintf_info(menu, "MENU_CopySysPopup: returning %x.\n", hMenu );
return hMenu;
}
@ -308,7 +305,7 @@ HMENU32 MENU_GetSysMenu( HWND32 hWnd, HMENU32 hPopupMenu )
menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hPopupMenu);
menu->wFlags |= MF_SYSMENU;
dprintf_menu(stddeb,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu );
dprintf_info(menu,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu );
return hMenu;
}
DestroyMenu32( hMenu );
@ -456,7 +453,7 @@ static UINT32 MENU_GetStartOfPrevColumn(
break;
}
dprintf_menu( stddeb, "MENU_GetStartOfPrevColumn: ret %d.\n", i );
dprintf_info(menu, "MENU_GetStartOfPrevColumn: ret %d.\n", i );
return i;
}
@ -555,7 +552,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu,
UINT32 key, BOOL32 forceMenuChar )
{
dprintf_menu(stddeb,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu );
dprintf_info(menu,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu );
if (!IsMenu32( hmenu ))
{
@ -576,7 +573,7 @@ static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu,
key = toupper(key);
for (i = 0; i < menu->nItems; i++, item++)
{
if (IS_STRING_ITEM(item->fType))
if (item->text && (IS_STRING_ITEM(item->fType)))
{
char *p = strchr( item->text, '&' );
if (p && (p[1] != '&') && (toupper(p[1]) == key)) return i;
@ -603,7 +600,7 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner,
DWORD dwSize;
char *p;
dprintf_menu(stddeb, "MENU_CalcItemSize: HDC 0x%x at (%d,%d)\n",
dprintf_info(menu, "MENU_CalcItemSize: HDC 0x%x at (%d,%d)\n",
hdc, orgX, orgY);
debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem,
(menuBar ? " (MenuBar)" : ""));
@ -621,7 +618,7 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner,
SendMessage32A( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis );
lpitem->rect.bottom += mis.itemHeight;
lpitem->rect.right += mis.itemWidth;
dprintf_menu(stddeb, "MENU_CalcItemSize: %08x %dx%d\n",
dprintf_info(menu, "MENU_CalcItemSize: %08x %dx%d\n",
lpitem->wID, mis.itemWidth, mis.itemHeight);
return;
}
@ -756,7 +753,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
if ((lprect == NULL) || (lppop == NULL)) return;
if (lppop->nItems == 0) return;
dprintf_menu(stddeb,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n",
dprintf_info(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n",
lprect->left, lprect->top, lprect->right, lprect->bottom);
lppop->Width = lprect->right - lprect->left;
lppop->Height = 0;
@ -776,7 +773,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
if ((i != start) &&
(lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
dprintf_menu( stddeb,
dprintf_info(menu,
"MENU_MenuBarCalcSize: calling MENU_CalcItemSize"
" org=(%d, %d)\n", orgX, orgY );
debug_print_menuitem (" item: ", lpitem, "");
@ -847,7 +844,7 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
{
DRAWITEMSTRUCT32 dis;
dprintf_menu( stddeb, "DrawMenuItem: Ownerdraw!\n" );
dprintf_info(menu, "DrawMenuItem: Ownerdraw!\n" );
dis.CtlType = ODT_MENU;
dis.itemID = lpitem->wID;
dis.itemData = (DWORD)lpitem->text;
@ -1140,7 +1137,7 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( (HMENU16)wndPtr->wIDmenu );
if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU;
dprintf_menu(stddeb,"MENU_DrawMenuBar(%04x, %p, %p); !\n",
dprintf_info(menu,"MENU_DrawMenuBar(%04x, %p, %p); !\n",
hDC, lprect, lppop);
if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
lprect->bottom = lprect->top + lppop->Height;
@ -1175,7 +1172,7 @@ BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
{
HTASK16 hTask = 0;
dprintf_menu(stddeb,"patching resident popup: %04x %04x [%04x %04x]\n",
dprintf_info(menu,"patching resident popup: %04x %04x [%04x %04x]\n",
checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ,
pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0);
@ -1213,7 +1210,7 @@ BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
pTopPopupWnd->hmemTaskQ = task->hQueue;
return TRUE;
}
else dprintf_menu(stddeb,"failed to patch resident popup.\n");
else dprintf_warn(menu,"failed to patch resident popup.\n");
}
}
return FALSE;
@ -1491,7 +1488,7 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags )
if (!(menu = (POPUPMENU *)USER_HEAP_LIN_ADDR(hMenu)))
{
dprintf_menu( stddeb, "MENU_InsertItem: %04x not a menu handle\n",
dprintf_warn(menu, "MENU_InsertItem: %04x not a menu handle\n",
hMenu );
return NULL;
}
@ -1509,13 +1506,13 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags )
{
if (!MENU_FindItem( &hMenu, &pos, flags ))
{
dprintf_menu( stddeb, "MENU_InsertItem: item %x not found\n",
dprintf_warn(menu, "MENU_InsertItem: item %x not found\n",
pos );
return NULL;
}
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu)))
{
dprintf_menu(stddeb,"MENU_InsertItem: %04x not a menu handle\n",
dprintf_warn(menu,"MENU_InsertItem: %04x not a menu handle\n",
hMenu);
return NULL;
}
@ -1526,7 +1523,7 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags )
newItems = HeapAlloc( SystemHeap, 0, sizeof(MENUITEM) * (menu->nItems+1) );
if (!newItems)
{
dprintf_menu( stddeb, "MENU_InsertItem: allocation failed\n" );
dprintf_warn(menu, "MENU_InsertItem: allocation failed\n" );
return NULL;
}
if (menu->nItems > 0)
@ -1623,7 +1620,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU32 hMenu)
{
LPSTR newstr = HEAP_strdupWtoA(GetProcessHeap(),
0, mii.dwTypeData);
dprintf_menu(stddeb, "Menu item: [%08x,%08x,%04x,%04x,%s]\n",
dprintf_info(menu, "Menu item: [%08x,%08x,%04x,%04x,%s]\n",
mii.fType, mii.fState, mii.wID, resinfo, newstr);
HeapFree( GetProcessHeap(), 0, newstr );
}
@ -1837,7 +1834,7 @@ static BOOL32 MENU_ExecFocusedItem( MTRACKER* pmt, HMENU32 hMenu )
item = &menu->items[menu->FocusedItem];
dprintf_menu(stddeb, "MENU_ExecFocusedItem: %08x %08x %08x\n",
dprintf_info(menu, "MENU_ExecFocusedItem: %08x %08x %08x\n",
hMenu, item->wID, item->hSubMenu);
if (!(item->fType & MF_POPUP))
@ -1932,7 +1929,7 @@ static BOOL32 MENU_ButtonDown( MTRACKER* pmt, HMENU32 hPtMenu )
pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE );
return TRUE;
}
else dprintf_menu(stddeb,"\tunable to find clicked item!\n");
else dprintf_warn(menu, "\tunable to find clicked item!\n");
}
return FALSE;
}
@ -2026,7 +2023,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT32 vk )
LRESULT l = SendMessage16( pmt->hOwnerWnd, WM_NEXTMENU, (WPARAM16)vk,
(IS_SYSTEM_MENU(menu)) ? GetSubMenu16(pmt->hTopMenu,0) : pmt->hTopMenu );
dprintf_menu(stddeb,"NextMenu: %04x [%04x] -> %04x [%04x]\n",
dprintf_info(menu,"NextMenu: %04x [%04x] -> %04x [%04x]\n",
(UINT16)pmt->hCurrentMenu, (UINT16)pmt->hOwnerWnd, LOWORD(l), HIWORD(l) );
if( l == 0 )
@ -2074,7 +2071,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT32 vk )
/* FIXME: Not sure what to do here, perhaps,
* try to track hNewMenu as a popup? */
dprintf_menu(stddeb,"MENU_DoNextMenu() got confused.\n");
dprintf_info(menu,"MENU_DoNextMenu() got confused.\n");
return FALSE;
}
}
@ -2205,7 +2202,7 @@ static void MENU_KeyRight( MTRACKER* pmt )
POPUPMENU *menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( pmt->hTopMenu );
UINT32 nextcol;
dprintf_menu( stddeb, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n",
dprintf_info(menu, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n",
pmt->hCurrentMenu,
((POPUPMENU *)USER_HEAP_LIN_ADDR(pmt->hCurrentMenu))->
items[0].text,
@ -2225,7 +2222,7 @@ static void MENU_KeyRight( MTRACKER* pmt )
/* Check to see if there's another column */
if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) !=
NO_SELECTED_ITEM ) {
dprintf_menu( stddeb, "KeyRight: Going to %d.\n", nextcol );
dprintf_info(menu, "KeyRight: Going to %d.\n", nextcol );
MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
nextcol, TRUE );
return;
@ -2614,7 +2611,7 @@ LRESULT WINAPI PopupMenuWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if( hwnd == pTopPopupWnd->hwndSelf )
{
dprintf_menu(stddeb,"resident popup destroyed!\n");
dprintf_err(menu, "resident popup destroyed!\n");
pTopPopupWnd = NULL;
uSubPWndLevel = 0;
@ -2663,7 +2660,7 @@ UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
WND *wndPtr;
LPPOPUPMENU lppop;
dprintf_menu( stddeb, "MENU_GetMenuBarHeight: HWND 0x%x, width %d, "
dprintf_info(menu, "MENU_GetMenuBarHeight: HWND 0x%x, width %d, "
"at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY );
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
@ -2683,7 +2680,7 @@ UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,
UINT16 id, UINT16 flags )
{
dprintf_menu( stddeb,"ChangeMenu16: menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n",
dprintf_info(menu,"ChangeMenu16: menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n",
hMenu, pos, (DWORD)data, id, flags );
if (flags & MF_APPEND) return AppendMenu16( hMenu, flags & ~MF_APPEND,
id, data );
@ -2709,7 +2706,7 @@ BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,
BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
UINT32 id, UINT32 flags )
{
dprintf_menu( stddeb,"ChangeMenu32A: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
dprintf_info(menu,"ChangeMenu32A: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
hMenu, pos, (DWORD)data, id, flags );
if (flags & MF_APPEND) return AppendMenu32A( hMenu, flags & ~MF_APPEND,
id, data );
@ -2730,7 +2727,7 @@ BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
BOOL32 WINAPI ChangeMenu32W( HMENU32 hMenu, UINT32 pos, LPCWSTR data,
UINT32 id, UINT32 flags )
{
dprintf_menu( stddeb,"ChangeMenu32W: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
dprintf_info(menu,"ChangeMenu32W: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
hMenu, pos, (DWORD)data, id, flags );
if (flags & MF_APPEND) return AppendMenu32W( hMenu, flags & ~MF_APPEND,
id, data );
@ -2762,7 +2759,7 @@ DWORD WINAPI CheckMenuItem32( HMENU32 hMenu, UINT32 id, UINT32 flags )
MENUITEM *item;
DWORD ret;
dprintf_menu( stddeb,"CheckMenuItem: %04x %04x %04x\n", hMenu, id, flags );
dprintf_info(menu,"CheckMenuItem: %04x %04x %04x\n", hMenu, id, flags );
if (!(item = MENU_FindItem( &hMenu, &id, flags ))) return -1;
ret = item->fState & MF_CHECKED;
if (flags & MF_CHECKED) item->fState |= MF_CHECKED;
@ -2788,7 +2785,7 @@ BOOL32 WINAPI EnableMenuItem32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
BOOL32 bRet = FALSE;
MENUITEM *item, *first = NULL;
dprintf_menu(stddeb,"EnableMenuItem (%04x, %04X, %04X) !\n",
dprintf_info(menu,"EnableMenuItem (%04x, %04X, %04X) !\n",
hMenu, wItemID, wFlags);
while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) )
@ -2836,14 +2833,14 @@ INT32 WINAPI GetMenuString32A( HMENU32 hMenu, UINT32 wItemID,
{
MENUITEM *item;
dprintf_menu( stddeb, "GetMenuString32A: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
dprintf_info(menu, "GetMenuString32A: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
hMenu, wItemID, str, nMaxSiz, wFlags );
if (!str || !nMaxSiz) return 0;
str[0] = '\0';
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
if (!IS_STRING_ITEM(item->fType)) return 0;
lstrcpyn32A( str, item->text, nMaxSiz );
dprintf_menu( stddeb, "GetMenuString32A: returning '%s'\n", str );
dprintf_info(menu, "GetMenuString32A: returning '%s'\n", str );
return strlen(str);
}
@ -2856,7 +2853,7 @@ INT32 WINAPI GetMenuString32W( HMENU32 hMenu, UINT32 wItemID,
{
MENUITEM *item;
dprintf_menu( stddeb, "GetMenuString32W: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
dprintf_info(menu, "GetMenuString32W: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
hMenu, wItemID, str, nMaxSiz, wFlags );
if (!str || !nMaxSiz) return 0;
str[0] = '\0';
@ -2884,7 +2881,7 @@ BOOL32 WINAPI HiliteMenuItem32( HWND32 hWnd, HMENU32 hMenu, UINT32 wItemID,
UINT32 wHilite )
{
LPPOPUPMENU menu;
dprintf_menu(stddeb,"HiliteMenuItem(%04x, %04x, %04x, %04x);\n",
dprintf_info(menu,"HiliteMenuItem(%04x, %04x, %04x, %04x);\n",
hWnd, hMenu, wItemID, wHilite);
if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE;
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@ -2910,7 +2907,7 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )
UINT32 WINAPI GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
{
MENUITEM *item;
dprintf_menu(stddeb,"GetMenuState(%04x, %04x, %04x);\n",
dprintf_info(menu,"GetMenuState(%04x, %04x, %04x);\n",
hMenu, wItemID, wFlags);
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1;
debug_print_menuitem (" item: ", item, "");
@ -2937,7 +2934,7 @@ INT16 WINAPI GetMenuItemCount16( HMENU16 hMenu )
{
LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (!IS_A_MENU(menu)) return -1;
dprintf_menu( stddeb,"GetMenuItemCount16(%04x) returning %d\n",
dprintf_info(menu,"GetMenuItemCount16(%04x) returning %d\n",
hMenu, menu->nItems );
return menu->nItems;
}
@ -2950,7 +2947,7 @@ INT32 WINAPI GetMenuItemCount32( HMENU32 hMenu )
{
LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (!IS_A_MENU(menu)) return -1;
dprintf_menu( stddeb,"GetMenuItemCount32(%04x) returning %d\n",
dprintf_info(menu,"GetMenuItemCount32(%04x) returning %d\n",
hMenu, menu->nItems );
return menu->nItems;
}
@ -3007,10 +3004,10 @@ BOOL32 WINAPI InsertMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
MENUITEM *item;
if (IS_STRING_ITEM(flags) && str)
dprintf_menu( stddeb, "InsertMenu: hMenu %04x, pos %d, flags %08x, "
dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, "
"id %04x, str '%s'\n",
hMenu, pos, flags, id, str );
else dprintf_menu( stddeb, "InsertMenu: hMenu %04x, pos %d, flags %08x, "
else dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, "
"id %04x, str %08lx (not a string)\n",
hMenu, pos, flags, id, (DWORD)str );
@ -3096,7 +3093,7 @@ BOOL32 WINAPI RemoveMenu32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags )
LPPOPUPMENU menu;
MENUITEM *item;
dprintf_menu(stddeb,"RemoveMenu (%04x, %04x, %04x)\n",hMenu, nPos, wFlags);
dprintf_info(menu,"RemoveMenu (%04x, %04x, %04x)\n",hMenu, nPos, wFlags);
if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@ -3170,13 +3167,13 @@ BOOL32 WINAPI ModifyMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
if (IS_STRING_ITEM(flags))
{
dprintf_menu( stddeb, "ModifyMenu: %04x %d %04x %04x '%s'\n",
dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x '%s'\n",
hMenu, pos, flags, id, str ? str : "#NULL#" );
if (!str) return FALSE;
}
else
{
dprintf_menu( stddeb, "ModifyMenu: %04x %d %04x %04x %08lx\n",
dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x %08lx\n",
hMenu, pos, flags, id, (DWORD)str );
}
@ -3254,7 +3251,7 @@ BOOL32 WINAPI SetMenuItemBitmaps32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags,
HBITMAP32 hNewUnCheck, HBITMAP32 hNewCheck)
{
MENUITEM *item;
dprintf_menu(stddeb,"SetMenuItemBitmaps(%04x, %04x, %04x, %04x, %04x)\n",
dprintf_info(menu,"SetMenuItemBitmaps(%04x, %04x, %04x, %04x, %04x)\n",
hMenu, nPos, wFlags, hNewCheck, hNewUnCheck);
if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
@ -3299,7 +3296,7 @@ HMENU32 WINAPI CreateMenu32(void)
menu->hWnd = 0;
menu->items = NULL;
menu->FocusedItem = NO_SELECTED_ITEM;
dprintf_menu( stddeb, "CreateMenu: return %04x\n", hMenu );
dprintf_info(menu, "CreateMenu: return %04x\n", hMenu );
return hMenu;
}
@ -3318,7 +3315,7 @@ BOOL16 WINAPI DestroyMenu16( HMENU16 hMenu )
*/
BOOL32 WINAPI DestroyMenu32( HMENU32 hMenu )
{
dprintf_menu(stddeb,"DestroyMenu(%04x)\n", hMenu);
dprintf_info(menu,"DestroyMenu(%04x)\n", hMenu);
/* Silently ignore attempts to destroy default system popup */
@ -3466,7 +3463,7 @@ BOOL32 WINAPI SetMenu32( HWND32 hWnd, HMENU32 hMenu )
{
WND * wndPtr = WIN_FindWndPtr(hWnd);
dprintf_menu(stddeb,"SetMenu(%04x, %04x);\n", hWnd, hMenu);
dprintf_info(menu,"SetMenu(%04x, %04x);\n", hWnd, hMenu);
if (wndPtr && !(wndPtr->dwStyle & WS_CHILD))
{
@ -3578,11 +3575,11 @@ HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name )
if (HIWORD(name))
{
char *str = (char *)PTR_SEG_TO_LIN( name );
dprintf_menu( stddeb, "LoadMenu(%04x,'%s')\n", instance, str );
dprintf_info(menu, "LoadMenu(%04x,'%s')\n", instance, str );
if (str[0] == '#') name = (SEGPTR)atoi( str + 1 );
}
else
dprintf_resource(stddeb,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name));
dprintf_info(resource,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name));
if (!name) return 0;
@ -3630,7 +3627,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
WORD version, offset;
LPCSTR p = (LPCSTR)template;
dprintf_menu(stddeb,"LoadMenuIndirect16: %p\n", template );
dprintf_info(menu,"LoadMenuIndirect16: %p\n", template );
version = GET_WORD(p);
p += sizeof(WORD);
if (version)
@ -3659,7 +3656,7 @@ HMENU32 WINAPI LoadMenuIndirect32A( LPCVOID template )
WORD version, offset;
LPCSTR p = (LPCSTR)template;
dprintf_menu(stddeb,"LoadMenuIndirect32A: %p\n", template );
dprintf_info(menu,"LoadMenuIndirect32A: %p\n", template );
version = GET_WORD(p);
p += sizeof(WORD);
switch (version)
@ -3934,7 +3931,7 @@ BOOL32 WINAPI CheckMenuRadioItem32(HMENU32 hMenu,
MENUITEM *mifirst, *milast, *micheck;
HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu;
dprintf_menu (stddeb,
dprintf_info(menu,
"CheckMenuRadioItem32: ox%x: %d-%d, check %d, bypos=%d\n",
hMenu, first, last, check, bypos);
@ -3988,7 +3985,7 @@ BOOL32 WINAPI GetMenuItemRect32 (HWND32 hwnd, HMENU32 hMenu, UINT32 uItem,
MENUITEM *item;
HMENU32 orghMenu = hMenu;
dprintf_menu (stddeb, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n",
dprintf_info(menu, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n",
hwnd, hMenu, uItem, rect);
item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION);

View File

@ -17,7 +17,6 @@
#include "graphics.h"
#include "heap.h"
#include "win.h"
#include "stddebug.h"
#include "debug.h"
/* Control configuration constants */
@ -27,7 +26,7 @@
/* Work constants */
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_progress(stddeb, \
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(progress, \
"Progress Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
@ -48,7 +47,7 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
RECT32 rect;
HDC32 hdc;
dprintf_progress(stddeb, "Progress Bar: paint pos=%d min=%d, max=%d\n",
dprintf_info(progress, "Progress Bar: paint pos=%d min=%d, max=%d\n",
infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
/* get a dc */
@ -115,11 +114,11 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
infoPtr->MaxVal=100;
infoPtr->CurVal=0;
infoPtr->Step=10;
dprintf_updown(stddeb, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
dprintf_info(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
break;
case WM_DESTROY:
dprintf_updown(stddeb, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
dprintf_info(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
break;
case WM_ERASEBKGND:

View File

@ -15,7 +15,6 @@
#include "graphics.h"
#include "heap.h"
#include "win.h"
#include "stddebug.h"
#include "debug.h"
@ -616,7 +615,7 @@ void SCROLL_HandleScrollEvent( HWND32 hwnd, INT32 nBar, UINT32 msg, POINT32 pt)
return; /* Should never happen */
}
dprintf_scroll( stddeb, "ScrollBar Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n",
dprintf_info(scroll, "ScrollBar Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n",
hwnd, nBar, msg, pt.x, pt.y, hittest );
switch(trackHitTest)
@ -795,7 +794,7 @@ LRESULT WINAPI ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
}
}
if (!hUpArrow) SCROLL_LoadBitmaps();
dprintf_scroll( stddeb, "ScrollBar creation, hwnd=%04x\n", hwnd );
dprintf_info(scroll, "ScrollBar creation, hwnd=%04x\n", hwnd );
return 0;
case WM_LBUTTONDOWN:
@ -910,19 +909,18 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
SCROLLBAR_INFO *infoPtr;
UINT32 new_flags;
BOOL32 repaint_arrows = FALSE;
dbg_decl_str(scroll, 256);
if (!(infoPtr = SCROLL_GetScrollInfo(hwnd, nBar))) return 0;
if (info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL)) return 0;
if ((info->cbSize != sizeof(*info)) &&
(info->cbSize != sizeof(*info)-sizeof(info->nTrackPos))) return 0;
dprintf_scroll( stddeb, "SetScrollInfo: hwnd=%04x bar=%d", hwnd, nBar );
/* Set the page size */
if (info->fMask & SIF_PAGE)
{
dprintf_scroll( stddeb, " page=%d", info->nPage );
dsprintf(scroll, " page=%d", info->nPage );
infoPtr->Page = info->nPage;
}
@ -930,7 +928,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
if (info->fMask & SIF_POS)
{
dprintf_scroll( stddeb, " pos=%d", info->nPos );
dsprintf(scroll, " pos=%d", info->nPos );
infoPtr->CurVal = info->nPos;
}
@ -938,7 +936,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
if (info->fMask & SIF_RANGE)
{
dprintf_scroll( stddeb, " min=%d max=%d", info->nMin, info->nMax );
dsprintf(scroll, " min=%d max=%d", info->nMin, info->nMax );
/* Invalid range -> range is set to (0,0) */
if ((info->nMin > info->nMax) ||
@ -954,6 +952,9 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
}
}
dprintf_info(scroll, "SetScrollInfo: hwnd=%04x bar=%d %s\n",
hwnd, nBar, dbg_str(scroll));
/* Make sure the page size is valid */
if (infoPtr->Page < 0) infoPtr->Page = 0;
@ -967,7 +968,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
else if (infoPtr->CurVal > infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 ))
infoPtr->CurVal = infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 );
dprintf_scroll( stddeb, "\n new values: page=%d pos=%d min=%d max=%d\n",
dprintf_info(scroll, "\n new values: page=%d pos=%d min=%d max=%d\n",
infoPtr->Page, infoPtr->CurVal,
infoPtr->MinVal, infoPtr->MaxVal );
@ -1208,7 +1209,7 @@ BOOL32 WINAPI ShowScrollBar32( HWND32 hwnd, INT32 nBar, BOOL32 fShow )
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return FALSE;
dprintf_scroll( stddeb, "ShowScrollBar: hwnd=%04x bar=%d on=%d\n",
dprintf_info(scroll, "ShowScrollBar: hwnd=%04x bar=%d on=%d\n",
hwnd, nBar, fShow );
switch(nBar)
@ -1284,7 +1285,7 @@ BOOL32 WINAPI EnableScrollBar32( HWND32 hwnd, INT32 nBar, UINT32 flags )
SCROLLBAR_INFO *infoPtr;
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
dprintf_scroll( stddeb, "EnableScrollBar: %04x %d %d\n",
dprintf_info(scroll, "EnableScrollBar: %04x %d %d\n",
hwnd, nBar, flags );
flags &= ESB_DISABLE_BOTH;
if (infoPtr->flags == flags) return FALSE;

View File

@ -574,7 +574,7 @@ BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
*/
BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
dprintf_info(graphics, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
hdc, rc->left, rc->top, rc->right, rc->bottom,
edge, flags );

View File

@ -35,8 +35,6 @@
#include "graphics.h"
#include "heap.h"
#include "win.h"
#include "stddebug.h"
/*#define DEBUG_UPDOWN*/
#include "debug.h"
/* Control configuration constants */
@ -62,7 +60,7 @@
static int accelIndex = -1;
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_updown(stddeb, \
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(updown, \
"UpDown Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
@ -209,7 +207,7 @@ static BOOL32 UPDOWN_GetBuddyInt(WND *wndPtr)
if(*src || !UPDOWN_InBounds(wndPtr, newVal))
return FALSE;
dprintf_updown(stddeb, "UpDown Ctrl: new value(%d) read from buddy "
dprintf_info(updown, "UpDown Ctrl: new value(%d) read from buddy "
"(old=%d)\n", newVal, infoPtr->CurVal);
}
@ -234,7 +232,7 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
if (!IsWindow32(infoPtr->Buddy))
return FALSE;
dprintf_updown(stddeb, "UpDown Ctrl: set new value(%d) to buddy.\n",
dprintf_info(updown, "UpDown Ctrl: set new value(%d) to buddy.\n",
infoPtr->CurVal);
/*if the buddy is a list window, we must set curr index */
@ -381,7 +379,7 @@ static void UPDOWN_DoAction(WND *wndPtr, int delta, BOOL32 incr)
int old_val = infoPtr->CurVal;
NM_UPDOWN ni;
dprintf_updown(stddeb, "UpDown Ctrl action: %s by %d\n",
dprintf_info(updown, "UpDown Ctrl action: %s by %d\n",
incr ? "inc" : "dec", delta);
/* check if we can do the modification first */
@ -583,13 +581,13 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if(wndPtr->dwStyle & UDS_AUTOBUDDY)
UPDOWN_SetBuddy(wndPtr, GetWindow32(wndPtr->hwndSelf, GW_HWNDPREV));
dprintf_updown(stddeb, "UpDown Ctrl creation, hwnd=%04x\n", hwnd);
dprintf_info(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd);
break;
case WM_DESTROY:
if(infoPtr->AccelVect)
free(infoPtr->AccelVect);
dprintf_updown(stddeb, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
dprintf_info(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
break;
case WM_ENABLE:
@ -679,7 +677,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
return temp;
case UDM_SETACCEL:
dprintf_updown(stddeb, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd);
dprintf_info(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd);
if(infoPtr->AccelVect){
free(infoPtr->AccelVect);
infoPtr->AccelCount = 0;
@ -699,7 +697,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
return infoPtr->Base;
case UDM_SETBASE:
dprintf_updown(stddeb, "UpDown Ctrl new base(%d), hwnd=%04x\n",
dprintf_info(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n",
wParam, hwnd);
if ( !(wParam==10 || wParam==16) || lParam)
UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam);
@ -721,7 +719,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
temp = infoPtr->Buddy;
infoPtr->Buddy = wParam;
UPDOWN_SetBuddy(wndPtr, wParam);
dprintf_updown(stddeb, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n",
dprintf_info(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n",
infoPtr->Buddy, hwnd);
return temp;
@ -735,7 +733,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if (wParam || HIWORD(lParam))
UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
temp = SLOWORD(lParam);
dprintf_updown(stddeb, "UpDown Ctrl new value(%d), hwnd=%04x\n",
dprintf_info(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n",
temp, hwnd);
if(!UPDOWN_InBounds(wndPtr, temp)){
if(temp < infoPtr->MinVal)
@ -760,7 +758,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
/* |Max-Min| <= UD_MAXVAL */
dprintf_updown(stddeb, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
dprintf_info(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
infoPtr->MinVal, infoPtr->MaxVal, hwnd);
break;

View File

@ -18,14 +18,21 @@ INFOFILES = \
wine.info-1 \
wine.info-2
HTMLFILES = \
wine_toc.html \
wine.html
DVIFILES = wine.dvi
all: $(INFOFILES) $(DVIFILES)
all: $(INFOFILES) $(DVIFILES) $(HTMLFILES)
info: $(INFOFILES)
dvi: $(DVIFILES)
html: $(HTMLFILES)
@MAKE_RULES@
$(INFOFILES): $(SOURCES)
@ -34,6 +41,10 @@ $(INFOFILES): $(SOURCES)
$(DVIFILES): $(SOURCES)
texi2dvi $(SRCDIR)/wine.texinfo
$(HTMLFILES): $(SOURCES)
makeinfo -E wine.texi $(SRCDIR)/wine.texinfo
texi2html wine.texi
$(INCLUDES):
$(RM) $(INCLUDES)
for i in $(INCLUDES); do $(LN_S) $(TOPSRCDIR)/$$i $$i || exit 1; done
@ -48,7 +59,8 @@ install_info: $(INFOFILES)
clean::
$(RM) $(INFOFILES) $(DVIFILES) $(INCLUDES)
$(RM) wine.aux wine.cp wine.cps wine.fn wine.fns wine.ky wine.log \
wine.pg wine.toc wine.tp wine.tps wine.vr wine.vrs
wine.pg wine.toc wine.tp wine.tps wine.vr wine.vrs \
wine.texi
$(RM) -r man3w
### Dependencies:

View File

@ -4,12 +4,17 @@ Console - First Pass
Consoles are just xterms created with the -Sxxn switch.
A pty is opened and the master goes to the xterm side
and the slave is held by the wine side. The slave fd
is changed into a HANDLE32 and this HANDLE32 is set
and the slave is held by the wine side. The console
itself it turned into a few HANDLE32s and is set
to the STD_*_HANDLES.
For now writing/reading to a console just calls FileWrite/FileRead.
It is possible to use the WriteFile and ReadFile commands
to write to a win32 console. To accomplish this, all K32OBJs
that support I/O have a read and write function pointer.
So, WriteFile calls K32OBJ_WriteFile which calls the K32OBJ's
write function pointer, which then finally calls write.
[this paragraph is now out of date]
If the command line console is to be inheirited or
a process inherits it's parents console (-- can that happen???),
the console is created at process init time via PROCESS_InheritConsole.
@ -23,20 +28,55 @@ pdb->console is set to NULL. This helps indicate when
it is possible to create a new console (via AllocConsole).
Like most k32 objects, when the FreeConsole is called, the
ref count is decremented and the console is freed when
it reaches zero. The free kills the xterm and closes
the master/slave fds.
When FreeConsole is called, all handles that the process has
open to the console are closed. Like most k32objs, if the
console's refcount reaches zero, its k32obj destroy function
is called. The destroy kills the xterm if one was open.
Also like most k32 objects, we assume that (K32OBJ) header is the
first field so the casting (from K32OBJ *to CONSOLE *)
works correctly.
FreeConsole is called on process exit (in ExitProcess) if
pdb->console is not NULL.
BUGS
----
Console processes do not inherit their parent's handles. I think
there needs to be two cases, one where they have to inherit
the stdin/stdout/stderr from unix, and one where they have to
inherit from another windows app.
A exit handler needs to be added. If the process exits
without calling FreeConsole, the xterm continues on...
But... there should probably be a generic exit handler in
wine for this kind of stuff (K32OBJs).
================================================================
experimentation with NT4 yields that:
WriteFile
---------
o does not truncate file on 0 length write
o 0 length write or error on write changes numcharswritten to 0
o 0 length write returns TRUE
o works with console handles
_lwrite
-------
o does truncate/expand file at current position on 0 length write
o returns 0 on a zero length write
o works with console handles (typecasted)
WriteConsole
------------
o expects only console handles
SetFilePointer
--------------
o returns -1 (err 6) when used with a console handle
FreeConsole
-----------
o even when all the handles to it are freed, the win32 console
stays visible, the only way I could find to free it
was via the FreeConsole

351
documentation/debug-msgs Normal file
View File

@ -0,0 +1,351 @@
Note: the debugging interface is under development. Please do not make
changes to it yet as I will do major changes in the next few weeks.
To make my life easier, PLEASE follow the guidelines described in
this document. If you have some ideas that you would like to
incorporate, please contact me first.
Please read the document before writing new code.
Also, DO NOT USE fprintf (or printf) to output things. All these
will have to be translated to dprintf_ calls and there are already
about 3000 of them! Also, instead of writing FIXMEs in the source,
output a dprintf_fixme message. But read on...
25 Feb 1998, Dimitrie O. Paun <dimi@cs.toronto.edu>
Debugging classes
-----------------
The debugging messages are divided into 4 classes:
fixme -- Messages in this class relate to behavior of Wine that does
not correspond to standard Windows behavior and that should
be fixed.
Examples: stubs, semi-implemented features, etc.
err -- Messages in this class relate to serious errors in Wine.
This sort of messages are close to asserts -- that is,
you should output a 'err' message when the code detects a
condition which should not happen.
Examples: unexpected change in internal state, etc.
warn -- This are warning messages. You should report a warning when
something unwanted happen but the function behaves properly.
That is, output a warning when you encounter something
unexpected (ex: could not open a file) but the function deals
correctly with the situation (that is, according to the docs).
If you do not deal correctly with it, output a fixme.
Examples: fail to access a resource required by the app, etc.
info -- This are detailed debugging messages that are mainly useful
to debug a component. This are usually turned off.
Examples: everything else that does not fall in one of the
above mentioned categories and the user does not
need to know about it. This sort of messages simply
outputs something about the state of some component
that is of interest mainly to the developer of that
component.
We will refer to a generic class as yyy.
The user has the capability to turn on or off messages in a particular
class. You can expect the following patters of usage (but note that
any combination is possible):
-- when you debug a component, all classes (info,warn,err,fixme)
will be enabled.
-- during the pre-alpha (maybe alpha) stage of Wine, most likely
the info class will be disabled by default, but all others
(warn,err,fixme) will be enabled by default.
-- when Wine will become stable, most likely the info and warn
classes will be disabled by default, but all err and fixme
will be enabled by default.
-- in some installations that want the smallest footprint
and where the debug information is of no interest,
all classes may be disabled by default.
Of course, the user will have the runtime ability to override these
defaults. However, this ability may be turned off and certain classes
of messages may be completely disabled at compile time to reduce the
size of Wine.
Debugging channels
------------------
Also, we divide the debugging messages per component. Each component
is assigned a debugging channel (or type). The identifier of the
channel must be a valid C identifier but note that it may also be a
reserve word like int or static.
Examples of debugging channels/types:
reg, updown, string
We will refer to a generic channel as xxx.
Note: for those who know the old interface, the channel/type is
what followed the _ in the dprintf_xxx statements.
For example, to output a message on the debugging channel
reg in the old interface you would have to write:
dprintf_reg(stddeb, "Could not access key!\n");
In the new interface, we drop the stddeb as it is implicit.
However, we add an orthogonal piece of information to the
message: its class. This is very important as it will allow
us to selectively turn on or off certain messages based on
type of information they report. For this reason it is VERY
important to choose the right class for the message.
Anyhow, suppose we figured that this message should belong
in the warn class, so in the new interface, you write:
dprintf_warn(reg, "Could not access key!\n");
---
How to use it
-------------
So, to output a message (class yyy) on channel xxx, do:
#include "debug.h"
....
dprintf_yyy(xxx, "<message>", ...);
Some examples from the code:
#include "debug.h"
...
dprintf_info(crtdll,
"CRTDLL_setbuf(file %p buf %p)\n",
file, buf);
dprintf_warn(aspi, "Error opening device errno=%d\n", save_error);
If you need to declare a new debugging channel, do:
%tools/make_debug
in the root directory of Wine.
Note that this will result in almost complete recompilation of Wine.
Notes:
1. Please pay attention to which class you assign the message.
It is very, Very, VERY important to get the class right.
There are only 4 classes, so it is not hard. The reason
it is important to get it right is that too much information
is no information. For example, if you put things into the
warn class that should really be in the info class, the
output will be too big and this will force the user to
turn of warnings. But this way he will fail to see the important
ones. Also, if you put warnings into the info class lets say,
he will most likely miss those because usually the info class
is turned off. A similar argument can be made if you mix any
other two classes.
2. ALL LINES MUST END WITH A NEWLINE!!! If you can NOT output
everything that you want in the line with only one dprintf_xxx
statement, then you need to build the string in memory.
Please read the section below "In-memory messages" on the
preferred way to do it. PLEASE USE THAT INTERFACE TO BUILD
MESSAGES IN MEMORY. The reason is that we are not sure that
we like it and having everything in one format will facilitate
the (automatic) translation to a better interface.
Are we debugging?
-----------------
To test whether the debugging output of class yyy on channel xxx is
enabled, do:
debugging_yyy(xxx)
Examples:
if(debugging_info(atom)){
...blah...
}
In-memory messages
------------------
If you NEED to build the message from multiple calls, you need to
build it in memory. To do that, you should use the following
interface:
- declare a string (where you are allowed to declare C variables)
as follows:
dbg_decl_str(name, len);
where name is the name of the string (you should use the channel
name on which you are going to output it)
- print in it with:
dsprintf(name, "<message>", ...);
which is just like a sprintf function but instead of a C string as
first parameter it takes the name you used to declare it.
- obtain a pointer to the string with:
dbg_str(name)
- reset the string (if you want to reuse it with):
dbg_reset_str(name);
Example (modified from the code):
void some_func(tabs)
{
INT32 i;
LPINT16 p = (LPINT16)tabs;
dbg_decl_str(listbox, 256); /* declare the string */
for (i = 0; i < descr->nb_tabs; i++) {
descr->tabs[i] = *p++<<1;
if(debugging_info(listbox)) /* write in it only if
dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */
}
dprintf_info(listbox, "Listbox %04x: settabstops %s\n",
wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
}
If you need to use it two times in the same scope do like this:
void some_func(tabs)
{
INT32 i;
LPINT16 p = (LPINT16)tabs;
dbg_decl_str(listbox, 256); /* declare the string */
for (i = 0; i < descr->nb_tabs; i++) {
descr->tabs[i] = *p++<<1;
if(debugging_info(listbox)) /* write in it only if
dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */
}
dprintf_info(listbox, "Listbox %04x: settabstops %s\n",
wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
dbg_reset_str(listbox); /* !!!reset the string!!! */
for (i = 0; i < descr->extrainfo_nr; i++) {
descr->extrainfo = *p+1;
if(debugging_info(listbox)) /* write in it only if
dsprintf(listbox,"%3d ",descr->extrainfo); /* we are gonna output it */
}
dprintf_info(listbox, "Listbox %04x: extrainfo %s\n",
wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
}
IMPORTANT NOTE:
As I already stated, I do not think this will be the ultimate interface
for building in-memory debugging messages. In fact, I do have better ideas
which I hope to have time to implement for the next release. For this
reason, please try not to use it. However, if you need to output a line
in more than one dprintf_xxx calls, then USE THIS INTERFACE. DO NOT use
other methods. This way, I will easily translate everything to the new
interface (when it will become available). So, if you need to use if,
then follow the following guidelines:
-- wrap calls to dsprintf with a
if(debugging_yyy(xxx))
dsprintf(xxx,...);
Of course, if the call to dsprintf is made from within a function
which you know is called only if debugging_yyy(xxx) is true
(say you call it only like this:
if(debugging_yyy(xxx))
print_some_debug_info();
)
then you need not (and should not) wrap calls to dsprintf with
the before mentioned if.
-- name the string EXACTLY like the debugging channel on which
is going to be output. Please see the above example.
Resource identifiers
--------------------
Resource identifiers can be either strings or numbers. To make life a bit
easier for outputting this beasts (and to help you avoid the need to build
the message in memory), I introduced a new function called:
debugres
The function is defined in debugstr.h
and has the following prototype:
LPSTR debugres(const void *id);
It takes a pointer to the resource id and returns a nicely formatted
string of the identifier.
It the high word of the pointer is 0, then it assumes that the
identifier is a number and thus returns a string of the form:
#xxxx
where xxxx are 4 hex-digits representing the low word of id.
It the high word of the pointer is not 0, then it assumes that the
identifier is a string and thus returns a string of the form:
'<identifier>'
Thus, to use it, do something on the following lines:
#include "debugstr.h"
...
dprintf_yyy(xxx, "resource is %s", debugres(myresource));
The -debugmsg command line option
---------------------------------
So, the -debugmsg command line option has been changed as follows:
- the new syntax is: -debugmsg [yyy]#xxx[,[yyy1]#xxx1]*
where # is either + or -
- when the optional class argument (yyy) is not present,
then the statement will enable(+)/disable(-) all messages for
the given channel (xxx) on all classes. For example:
-debugmsg +reg,-file
enables all messages on the reg channel and disables all
messages on the file channel.
This is very close (actually identical) to the old semantics.
- when the optional class argument (yyy) is present,
then the statement will enable(+)/disable(-) messages for
the given channel (xxx) only on the given class. For example:
-debugmsg info+reg,warn-file
enables info messages on the reg channel and disables warning
messages on the file channel.
- also, the pseudo-channel all is also supported and it has the
intuitive semantics:
-debugmsg +all -- enables all debug messages
-debugmsg -all -- disables all debug messages
-debugmsg yyy+all -- enables debug messages for class yyy on all
channels.
-debugmsg yyy-all -- disables debug messages for class yyy on all
channels.
So, for example:
-debugmsg warn-all -- disables all warning messages.
Also, note that at the moment:
- the fixme, err, warn classes are all enabled by default
- the info class is disabled by default
- there is no way to compile out the messages. All are
runtime configurable. This will come next release.

View File

@ -51,18 +51,19 @@ relevant developer as feasonable.
the reason is located in the last call(s). Those lines usually look like
this:
|Call KERNEL.90: LSTRLEN(0227:0692) ret=01e7:2ce7 ds=0227
^^^^^^^^^ ^ ^^^^^^^^^ ^^^^^^^^^ ^^^^
| | | | |Datasegment on entry
| | | |Return address.
|Call KERNEL.90: LSTRLEN(0227:0692 "text") ret=01e7:2ce7 ds=0227
^^^^^^^^^ ^ ^^^^^^^^^ ^^^^^^ ^^^^^^^^^ ^^^^
| | | | | |Datasegment
| | | | |Return address
| | | |textual parameter
| | |
| | |Argument(s). This one is a win16 segmented pointer.
| |Function called.
|The module, the function is called in. In this case it is KERNEL.
|Ret KERNEL.90: LSTRLEN() retval=0x0007 ret=01e7:2ce7 ds=0227
|Ret KERNEL.90: LSTRLEN() retval=0x0004 ret=01e7:2ce7 ds=0227
^^^^^^
|Returnvalue is 16 bit and has the value 7.
|Returnvalue is 16 bit and has the value 4.
3. If you have found a misbehaving function, try to find out why it
@ -119,18 +120,28 @@ Program reports an error with a Messagebox
"continue". With "-debugmsg +all" Wine will now stop directly directly
before setting up the Messagebox. Proceed as explained above.
You can also run wine using "wine -debugmsg +relay program.exe 2>&1|less -i"
and in less search for messagebox.
Disassembling programs:
=======================
You may also try to disassemble the offending program to check for
undocumented features and/or use of them.
The best, freely available, disassembler for win16 programs is
The best, freely available, disassembler for Win16 programs is
Windows Codeback, archivename wcbxxx.zip, which usually can be found
in the Cica-Mirror subdirectory on the WINE ftpsites. (See ANNOUNCE).
Disassembling win32 programs is currenty only possible using
Windows Disassembler 32, archivename something like wdasm32x.zip on
ftp.winsite.com and mirrors.
Disassembling win32 programs is possible using the Windows Disassembler 32,
archivename something like w32dasm.zip on ftp.winsite.com and mirrors.
The shareware version does not allow saving of disassembly listings.
[It also has a bug, it disassembles the dll and immediately after that
crashes, leaving a very large file caled 'winsys' in the directory of the
disassembled file. This file contains nothing of value (just the disassembly)
and can be safely deleted.]
Understanding disassembled code is just a question of exercise.
Most code out there uses standard C function entries (for it is usually
written in C). Win16 function entries usually look like that:
| push bp
@ -157,7 +168,6 @@ Disassembling programs:
| call KERNEL.LSTRLEN
Here first the selector and then the offset to the passed string are pushed.
Sample debugging session:
=========================
@ -171,88 +181,78 @@ Sample debugging session:
|marcus@jet $ wine winword.exe -debugmsg +relay -debug
|CallTo32(func=08007e00,000001c4,00000081,00000000,00000000)
|CallTo32(func=08007e00,000001c4,00000014,000006d0,00000000)
|Win16 task 'winword': Breakpoint 1 at 0x0157:0x001a
|CallTo16(func=0097:0130,ds=0000)
|Call WPROCS.24: TASK_RESCHEDULE() ret=003f:0759 ds=0000
|Ret WPROCS.24: TASK_RESCHEDULE() retval=0x0000 ret=003f:0759 ds=08a7
|CallTo16(func=0157:001a,ds=08a7,0x11d7,0x0000,0x0000,0x3cb4,0x1f40,0x0000,0x0000,0x08a7)
|Loading symbols from ELF file /home/marcus/wine/wine...
|...more Loading symbols ...
|Stopped on breakpoint 1 at 0x0157:0x001a (WPROCS_VXD_PAGEFILE+0xffffeeea)
|CallTo32(wndproc=0x40065bc0,hwnd=000001ac,msg=00000081,wp=00000000,lp=00000000)
|Win16 task 'winword': Breakpoint 1 at 0x01d7:0x001a
|CallTo16(func=0127:0070,ds=0927)
|Call WPROCS.24: TASK_RESCHEDULE() ret=00b7:1456 ds=0927
|Ret WPROCS.24: TASK_RESCHEDULE() retval=0x8672 ret=00b7:1456 ds=0927
|CallTo16(func=01d7:001a,ds=0927)
| AX=0000 BX=3cb4 CX=1f40 DX=0000 SI=0000 DI=0927 BP=0000 ES=11f7
|Loading symbols: /home/marcus/wine/wine...
|Stopped on breakpoint 1 at 0x01d7:0x001a
|In 16 bit mode.
|Wine-dbg>break MessageBox32A <---- Set Breakpoint
|Breakpoint 2 at 0x080e792c (MessageBox32A [msgbox.c:198])
|Breakpoint 2 at 0x40189100 (MessageBox32A [msgbox.c:190])
|Wine-dbg>c <---- Continue
|Call KERNEL.91: INITTASK() ret=0157:0022 ds=08a7
| AX=0000 BX=3cb4 CX=1f40 DX=0000 SI=0000 DI=08a7 ES=11d7 EFL=00000286
|CallTo16(func=090f:085c,ds=0dcf,0x0000,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0dcf)
|... <----- Much debugoutput
|Call KERNEL.97: GETTEMPFILENAME(0x00c3,08a7:8350,0x0000,08a7:8234) ret=058f:09b1 ds=08a7
^ ^ ^ ^
| | | |LPSTR buffer
| | |UINT16 unique
| |LPCSTR prefix
|BYTE drive
|Call KERNEL.136: GETDRIVETYPE(0x0000) ret=060f:097b ds=0927
^^^^^^ Drive 0 (A:)
|Ret KERNEL.136: GETDRIVETYPE() retval=0x0002 ret=060f:097b ds=0927
^^^^^^ DRIVE_REMOVEABLE
(It is a floppy diskdrive.)
|Ret KERNEL.97: GETTEMPFILENAME() retval=0xce3f ret=058f:09b1 ds=08a7
^
|new unique number
|Call KERNEL.136: GETDRIVETYPE(0x0001) ret=060f:097b ds=0927
^^^^^^ Drive 1 (B:)
|Ret KERNEL.136: GETDRIVETYPE() retval=0x0000 ret=060f:097b ds=0927
^^^^^^ DRIVE_CANNOTDETERMINE
(I don't have drive B: assigned)
|Call KERNEL.74: OPENFILE(08a7:8234,08a7:82c6,0x1012) ret=058f:09d8 ds=08a7
^ ^ ^
| | |UINT32 mode
| |OFSTRUCT *ofs
|LPCSTR name
|Call KERNEL.136: GETDRIVETYPE(0x0002) ret=060f:097b ds=0927
^^^^^^^ Drive 2 (C:)
|Ret KERNEL.136: GETDRIVETYPE() retval=0x0003 ret=060f:097b ds=0927
^^^^^^ DRIVE_FIXED
(specified as a harddisk)
|Ret KERNEL.74: OPENFILE() retval=0xffff ret=058f:09d8 ds=08a7
^
| -1 aka. HFILE_ERROR
|Call KERNEL.97: GETTEMPFILENAME(0x00c3,0x09278364"doc",0x0000,0927:8248) ret=060f:09b1 ds=0927
^^^^^^ ^^^^^ ^^^^^^^^^
| | |buffer for fname
| |temporary name ~docXXXX.tmp
|Force use of Drive C:.
|Call USER.1: MESSAGEBOX(0x0000,08ef:8362,0000:0000,0x1030) ret=05d7:084f ds=08efStopped on breakpoint 2 at 0x080e792c (MessageBox32A [msgbox.c:198])
|198 {
|In 32 bit mode.
|Wine-dbg> _
Now, we see that OPENFILE seem to have returned 0xFFFF (or -1). Checking
the implementation of OpenFile in files/file.c, this signals an error.
The mode flags (OF_READWRITE|OF_SHARE_EXCLUSIVE|OF_CREATE) seems to
indicate, that WinWord wants to open the file for writing, so we check
the filename. Since we don't see the filename in this debugoutput, we use
the dprintf_file() in OpenFile to print out more information by adding
"-debugmsg +relay" to the commandline.
(In fact, we see that the filename has been returned by the GetTempFileName
function above, but we check it anyway.)
|marcus@jet $ wine winword.exe -debugmsg +relay,+file -debug
|.....much more debugoutput .....
|
|Call KERNEL.97: GETTEMPFILENAME(0x00c3,08ef:8350,0x0000,08ef:8234) ret=05d7:09b1 ds=08ef
|FILE_Create: 'C:\~doc8b93.tmp' 01b6 1
|FILE_SetDosError: errno = 13
|Warning: GetTempFileName returns 'C:\~doc8b93.tmp', which doesn't seem to be writeable.
|Warning: GetTempFileName returns 'C:~doc9281.tmp', which doesn't seem to be writeable.
|Please check your configuration file if this generates a failure.
^ Warning message
|GetTempFileName: returning C:\~doc8b93.tmp
|Ret KERNEL.97: GETTEMPFILENAME() retval=0x8b93 ret=05d7:09b1 ds=08ef
|Call KERNEL.74: OPENFILE(08ef:8234,08ef:82c6,0x1012) ret=05d7:09d8 ds=08ef
|OpenFile: C:\~doc8b93.tmp 1012
|FILE_Create: 'C:\~doc8b93.tmp' 01b6 0
|FILE_SetDosError: errno = 13
|OpenFile(C:\~doc8b93.tmp): return = HFILE_ERROR
|Ret KERNEL.74: OPENFILE() retval=0xffff ret=05d7:09d8 ds=08ef
Whoops, it even detects that something is wrong!
|Ret KERNEL.97: GETTEMPFILENAME() retval=0x9281 ret=060f:09b1 ds=0927
^^^^^^ Temporary storage ID
The filename is "C:\~docd03d.tmp". Of course, C:\ is writeable for the
superuser only, so the open fails for a normal user and OpenFile returns
-1, which in turn generates this messagebox. (As said by the warning
message.)
|Call KERNEL.74: OPENFILE(0x09278248"C:~doc9281.tmp",0927:82da,0x1012) ret=060f:09d8 ds=0927
^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^
|filename |OFSTRUCT |open mode:
OF_CREATE|OF_SHARE_EXCLUSIVE|OF_READWRITE
This fails, since my C: drive is in this case mounted readonly.
|Ret KERNEL.74: OPENFILE() retval=0xffff ret=060f:09d8 ds=0927
^^^^^^ HFILE_ERROR16, yes, it failed.
|Call USER.1: MESSAGEBOX(0x0000,0x09278376"Sie müssen Windows verlassen und SHARE.EXE laden bevor Sie Word starten.",0x00000000,0x1030) ret=060f:084f ds=0927
And MessageBox'ed.
|Stopped on breakpoint 2 at 0x40189100 (MessageBox32A [msgbox.c:190])
|190 { <- the sourceline
In 32 bit mode.
Wine-dbg>
The code seems to find a writeable harddisk and tries to create a file
there. To work around this bug, you can define C: as a networkdrive,
which is ignored by the code above.
Written by Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>,
additions welcome.

View File

@ -23,7 +23,7 @@ END-INFO-DIR-ENTRY
This file documents Wine, the Windows Emulator.
@c
Copyright @copyright{} 1997 The Wine authors. @*
Copyright @copyright{} 1997,1998 The Wine authors. @*
@xref{Authors, The Wine Authors, The Wine Authors},
for a list of the copyright holders.
@ -44,8 +44,8 @@ versions of this manual under the conditions stated in
the section entitled ``License, Warranty, and Authors of Wine''.
@sp 4
FIXME: UNIX and POSIX trademarks. @*
X11 @*
FIXME: X11 and POSIX trademarks. @*
UNIX is a registered trademark of the Open Group.
Microsoft, Windows, MS-Windows, Windows-NT, Windows 95, and MS-DOS are
registered trademarks of Microsoft Corporation.
NT is a trademark of Northern Telecom Limited.
@ -59,17 +59,16 @@ be registered in certain jurisdictions.
@setchapternewpage odd
@titlepage
@sp 10
@center @titlefont{The Wine Reference Manual}
@center Edition 0.0.3, 14 August 1997
@title{The Wine Reference Manual}
@subtitle{Edition 0.0.5, February 1998}
@author{The Wine Team}
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1997 The Wine authors. @*
Copyright @copyright{} 1997, 1998 The Wine authors. @*
@xref{Authors, The Wine Authors, The Wine Authors},
for a list of the copyright holders.
@ -101,12 +100,12 @@ be registered in certain jurisdictions.
@c Edit this macro manually in the above parts of the document
@macro winemanualversion
0.0.3
0.0.4
@end macro
@c Edit this macro manually in the above parts of the document
@macro winemanualdate
14 August 1997
February 1998
@end macro
@c Edit this macro manually into the TeX titlepage
@ -122,12 +121,12 @@ Winelib
@c MICROSOFT
@c
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@macro mswindows
MS-Windows
@end macro
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@c spell it always the same
@macro WIN32
WIN32
@ -136,17 +135,17 @@ WIN32
WIN16
@end macro
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@macro WINNT
Windows NT
@end macro
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@macro WINNT40
Windows NT 4.0
@end macro
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@macro WIN95
Windows 95
@end macro
@ -155,12 +154,12 @@ Windows 95
@c
@c THE OTHERS
@c
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@macro unix
UNIX
@end macro
@c FIXME: automatical trademark reference
@c FIXME: automatic trademark reference
@macro posix
POSIX
@end macro
@ -1203,7 +1202,14 @@ FIXME: write installation guide
@section Applying patches
@xref{Creating patches}, for instructions on creating patches.
FIXME: write patch instructions
@kbd{cd} to the top source directory for Wine, and run
@code{patch -p1 < @var{patchfile}}.
What needs to be done next depends to some extent on what the
patch touches. For small patches which only alter C source, it can be
enough to rerun @code{make}. In general, the sequence @code{configure},
@code{make depend}, @code{make} is sufficient, unless the patch alters
@code{[config.in]}, in which case you must regenerate @code{configure}
via @code{make configure} (which just runs @code{autoconf}).
@node The Wine Project, , Installation, Top
@ -1842,7 +1848,7 @@ compiled as a library, they will be defined; if Wine is compiled as an
emulator, they won't.
You therefore have to access all functions and data types by their full
names, with the proper suffix explicitely appended. In Wine, the 16 bit
names, with the proper suffix explicitly appended. In Wine, the 16 bit
and 32 bit versions of the functions are distinct entities, which might
(theoretically) show a completely different behaviour. They may even
call each other (and they will quite frequently).
@ -1858,7 +1864,20 @@ The 16-to-32 bit mapping is done on exporting the DLL functions.
@section Creating patches
@xref{Applying patches}, for instructions on applying patches.
FIXME: how to create patches
Patches are created with the program @code{diff}. You need a copy
of clean source tree to diff against. The @samp{-u} option, to create
unified diffs, is popular but not obligatory.
For changes to a single file,
@code{diff -u wine990101/windows/win.c mywine/windows/win.c > win_patch}
is sufficient.
To generate a complete diff between your tree and the distribution,
use @code{diff -uR wine990101 mywine}.
This assumes that the original distribution and your personal tree
have the same parent directory, from which you make the diff.
This ensures a consistent format for the diffs, which in turn
is necessary so that they can be applied consistently as described in
@xref{Applying patches}.
@node Adding Documentation, File names, Creating patches, The Wine Project
@section Adding Documentation

View File

@ -18,7 +18,6 @@
#include "heap.h"
#include "msdos.h"
#include "options.h"
#include "stddebug.h"
#include "debug.h"
#define MAX_PATH_ELEMENTS 20
@ -97,10 +96,10 @@ void DIR_ParseWindowsPath( char *path )
DIR_PathElements++;
}
if (debugging_dosfs)
if (debugging_info(dosfs))
for (i = 0; i < DIR_PathElements; i++)
{
dprintf_dosfs( stddeb, "Path[%d]: %s = %s\n",
dprintf_info(dosfs, "Path[%d]: %s = %s\n",
i, DIR_DosPath[i], DIR_UnixPath[i] );
}
}
@ -156,9 +155,9 @@ int DIR_Init(void)
path, sizeof(path) );
DIR_ParseWindowsPath( path );
dprintf_dosfs( stddeb, "WindowsDir = %s\nSystemDir = %s\n",
dprintf_info(dosfs, "WindowsDir = %s\nSystemDir = %s\n",
DIR_WindowsDosDir, DIR_SystemDosDir );
dprintf_dosfs( stddeb, "TempDir = %s\nCwd = %c:\\%s\n",
dprintf_info(dosfs, "TempDir = %s\nCwd = %c:\\%s\n",
DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) );
/* Put the temp and Windows and system directories into the environment */
@ -328,7 +327,7 @@ UINT32 WINAPI GetSystemDirectory32W( LPWSTR path, UINT32 count )
*/
BOOL16 WINAPI CreateDirectory16( LPCSTR path, LPVOID dummy )
{
dprintf_file( stddeb,"CreateDirectory16(%s,%p)\n", path, dummy );
dprintf_info(file,"CreateDirectory16(%s,%p)\n", path, dummy );
return (BOOL16)CreateDirectory32A( path, NULL );
}
@ -340,12 +339,11 @@ BOOL32 WINAPI CreateDirectory32A( LPCSTR path,
LPSECURITY_ATTRIBUTES lpsecattribs )
{
DOS_FULL_NAME full_name;
LPCSTR unixName;
dprintf_file( stddeb, "CreateDirectory32A(%s,%p)\n", path, lpsecattribs );
if ((unixName = DOSFS_IsDevice( path )) != NULL)
dprintf_info(file, "CreateDirectory32A(%s,%p)\n", path, lpsecattribs );
if (DOSFS_IsDevice( path ))
{
dprintf_file(stddeb, "CreateDirectory: device '%s'!\n", unixName);
dprintf_info(file, "CreateDirectory: cannot use device '%s'!\n",path);
DOS_ERROR( ER_AccessDenied, EC_AccessDenied, SA_Abort, EL_Disk );
return FALSE;
}
@ -407,13 +405,12 @@ BOOL16 WINAPI RemoveDirectory16( LPCSTR path )
BOOL32 WINAPI RemoveDirectory32A( LPCSTR path )
{
DOS_FULL_NAME full_name;
LPCSTR unixName;
dprintf_file(stddeb, "RemoveDirectory: '%s'\n", path );
dprintf_info(file, "RemoveDirectory: '%s'\n", path );
if ((unixName = DOSFS_IsDevice( path )) != NULL)
if (DOSFS_IsDevice( path ))
{
dprintf_file(stddeb, "RemoveDirectory: device '%s'!\n", unixName);
dprintf_info(file, "RemoveDirectory: cannot remove device '%s'!\n", path);
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
return FALSE;
}

View File

@ -27,7 +27,6 @@
#include "file.h"
#include "heap.h"
#include "msdos.h"
#include "stddebug.h"
#include "debug.h"
/* Define the VFAT ioctl to get both short and long file names */
@ -50,20 +49,8 @@ typedef struct
/* Chars we don't want to see in DOS file names */
#define INVALID_DOS_CHARS "*?<>|\"+=,;[] \345"
static const char *DOSFS_Devices[][2] =
{
{ "CON", "" },
{ "PRN", "" },
{ "NUL", "/dev/null" },
{ "AUX", "" },
{ "LPT1", "" },
{ "LPT2", "" },
{ "LPT3", "" },
{ "LPT4", "" },
{ "COM1", "" },
{ "COM2", "" },
{ "COM3", "" },
{ "COM4", "" }
static const char *DOSFS_Devices[] = {
"CON","PRN","NUL","AUX","LPT1","LPT2","LPT3","LPT4","COM1","COM2","COM3","COM4",
};
@ -513,13 +500,13 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
if ((p = strchr( name, '\\' ))) len = MIN( (int)(p - name), len );
if (long_len < len + 1) return FALSE;
dprintf_dosfs( stddeb, "DOSFS_FindUnixName: %s,%s\n", path, name );
dprintf_info(dosfs, "DOSFS_FindUnixName: %s,%s\n", path, name );
if (!DOSFS_ToDosFCBFormat( name, dos_name )) dos_name[0] = '\0';
if (!(dir = DOSFS_OpenDir( path )))
{
dprintf_dosfs( stddeb, "DOSFS_FindUnixName(%s,%s): can't open dir: %s\n",
dprintf_warn(dosfs, "DOSFS_FindUnixName(%s,%s): can't open dir: %s\n",
path, name, strerror(errno) );
return FALSE;
}
@ -559,12 +546,11 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
else
DOSFS_Hash( long_name, short_buf, FALSE, ignore_case );
}
dprintf_dosfs( stddeb, "DOSFS_FindUnixName(%s,%s) -> %s (%s)\n",
dprintf_info(dosfs, "(%s,%s) -> %s (%s)\n",
path, name, long_name, short_buf ? short_buf : "***");
}
else
dprintf_dosfs(stddeb,"DOSFS_FindUnixName(%s,%s) -> ** Not found **\n",
path, name );
dprintf_warn(dosfs, "file: '%s' NOT FOUND in dir: '%s'\n", name, path);
DOSFS_CloseDir( dir );
return ret;
}
@ -573,10 +559,9 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
/***********************************************************************
* DOSFS_IsDevice
*
* Check if a DOS file name represents a DOS device. Returns the name
* of the associated Unix device, or NULL if not found.
* Check if a DOS file name represents a DOS device.
*/
const char *DOSFS_IsDevice( const char *name )
BOOL32 DOSFS_IsDevice( const char *name )
{
int i;
const char *p;
@ -586,16 +571,62 @@ const char *DOSFS_IsDevice( const char *name )
if ((p = strrchr( name, '\\' ))) name = p + 1;
for (i = 0; i < sizeof(DOSFS_Devices)/sizeof(DOSFS_Devices[0]); i++)
{
const char *dev = DOSFS_Devices[i][0];
const char *dev = DOSFS_Devices[i];
if (!lstrncmpi32A( dev, name, strlen(dev) ))
{
p = name + strlen( dev );
if (!*p || (*p == '.')) return DOSFS_Devices[i][1];
if (!*p || (*p == '.')) return TRUE;
}
}
return NULL;
return FALSE;
}
/***********************************************************************
* DOSFS_OpenDevice
*
* Open a DOS device. This might not map 1:1 into the UNIX device concept.
*/
HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
{
int i;
const char *p;
if (name[0] && (name[1] == ':')) name += 2;
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;
for (i = 0; i < sizeof(DOSFS_Devices)/sizeof(DOSFS_Devices[0]); i++)
{
const char *dev = DOSFS_Devices[i];
if (!lstrncmpi32A( dev, name, strlen(dev) ))
{
p = name + strlen( dev );
if (!*p || (*p == '.')) {
/* got it */
if (!strcmp(DOSFS_Devices[i],"NUL"))
return FILE_OpenUnixFile("/dev/null",unixmode);
if (!strcmp(DOSFS_Devices[i],"CON")) {
switch (unixmode) {
case O_RDONLY:
return GetStdHandle( STD_INPUT_HANDLE );
break;
case O_WRONLY:
return GetStdHandle( STD_OUTPUT_HANDLE );
break;
default:
fprintf(stderr,"DOSFS_OpenDevice: CON cannot be opened read/write currently, FIXME.\n");
return HFILE_ERROR32;
break;
}
}
/* FIXME: the rest of the devices ... lptX, comX et.al. */
return HFILE_ERROR32;
}
}
}
return HFILE_ERROR32;
}
/***********************************************************************
* DOSFS_GetPathDrive
*
@ -648,7 +679,7 @@ BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last, DOS_FULL_NAME *full )
UINT32 flags;
char *p_l, *p_s, *root;
dprintf_dosfs( stddeb, "DOSFS_GetFullName: %s (last=%d)\n",
dprintf_info(dosfs, "DOSFS_GetFullName: %s (last=%d)\n",
name, check_last );
if ((full->drive = DOSFS_GetPathDrive( &name )) == -1) return FALSE;
@ -756,7 +787,7 @@ BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last, DOS_FULL_NAME *full )
}
if (!full->long_name[0]) strcpy( full->long_name, "/" );
if (!full->short_name[2]) strcpy( full->short_name + 2, "\\" );
dprintf_dosfs( stddeb, "DOSFS_GetFullName: returning %s = %s\n",
dprintf_info(dosfs, "DOSFS_GetFullName: returning %s = %s\n",
full->long_name, full->short_name );
return TRUE;
}
@ -846,7 +877,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
int drive;
char *p;
dprintf_dosfs( stddeb, "GetFullPathName: converting %s\n", name );
dprintf_info(dosfs, "GetFullPathName: converting %s\n", name );
if (!name || !result) return 0;
@ -910,7 +941,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
if (unicode) lstrcpynAtoW( (LPWSTR)result, buffer, len );
else lstrcpyn32A( result, buffer, len );
dprintf_dosfs( stddeb, "GetFullPathName: returning %s\n", buffer );
dprintf_info(dosfs, "GetFullPathName: returning %s\n", buffer );
return strlen(buffer);
}
@ -995,7 +1026,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
else /* Not in the cache, open it anew */
{
const char *drive_path;
dprintf_dosfs( stddeb, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n",
dprintf_info(dosfs, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n",
path, skip, buffer, cur_pos );
cur_pos = skip;
if (dir) DOSFS_CloseDir(dir);
@ -1004,7 +1035,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
drive_path = path + strlen(DRIVE_GetRoot(drive));
while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++;
drive_root = !*drive_path;
dprintf_dosfs(stddeb, "DOSFS_FindNext: drive_root = %d\n", drive_root);
dprintf_info(dosfs, "DOSFS_FindNext: drive_root = %d\n", drive_root);
lstrcpyn32A( buffer, path, sizeof(buffer) - 1 );
}
strcat( buffer, "/" );
@ -1070,7 +1101,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
lstrcpyn32A( entry->cFileName, long_name, sizeof(entry->cFileName) );
if (!(flags & DRIVE_CASE_PRESERVING)) CharLower32A( entry->cFileName );
dprintf_dosfs( stddeb, "DOSFS_FindNext: returning %s (%s) %02lx %ld\n",
dprintf_info(dosfs, "DOSFS_FindNext: returning %s (%s) %02lx %ld\n",
entry->cFileName, entry->cAlternateFileName,
entry->dwFileAttributes, entry->nFileSizeLow );
cur_pos += count;
@ -1537,7 +1568,7 @@ BOOL32 WINAPI FileTimeToSystemTime( const FILETIME *ft, LPSYSTEMTIME syst )
time_t xtime = DOSFS_FileTimeToUnixTime( ft, &remainder );
xtm = gmtime(&xtime);
syst->wYear = xtm->tm_year;
syst->wMonth = xtm->tm_mon;
syst->wMonth = xtm->tm_mon + 1;
syst->wDayOfWeek = xtm->tm_wday;
syst->wDay = xtm->tm_mday;
syst->wHour = xtm->tm_hour;
@ -1557,7 +1588,7 @@ DWORD WINAPI QueryDosDevice32A(LPCSTR devname,LPSTR target,DWORD bufsize)
LPSTR s;
char buffer[200];
dprintf_dosfs(stddeb,"QueryDosDevice(%s,...)\n",devname?devname:"<null>");
dprintf_info(dosfs,"QueryDosDevice(%s,...)\n",devname?devname:"<null>");
if (!devname) {
/* return known MSDOS devices */
lstrcpy32A(buffer,"CON COM1 COM2 LPT1 NUL ");
@ -1601,7 +1632,7 @@ BOOL32 WINAPI SystemTimeToFileTime( const SYSTEMTIME *syst, LPFILETIME ft )
struct tm xtm;
xtm.tm_year = syst->wYear;
xtm.tm_mon = syst->wMonth;
xtm.tm_mon = syst->wMonth - 1;
xtm.tm_wday = syst->wDayOfWeek;
xtm.tm_mday = syst->wDay;
xtm.tm_hour = syst->wHour;

View File

@ -33,7 +33,6 @@
#include "msdos.h"
#include "options.h"
#include "task.h"
#include "stddebug.h"
#include "debug.h"
typedef struct
@ -194,12 +193,12 @@ int DRIVE_Init(void)
DRIVE_CurDrive = i;
count++;
dprintf_dosfs( stddeb, "%s: path=%s type=%s label='%s' serial=%08lx flags=%08x dev=%x ino=%x\n",
dprintf_info(dosfs, "%s: path=%s type=%s label='%s' serial=%08lx flags=%08x dev=%x ino=%x\n",
name, path, DRIVE_Types[drive->type],
drive->label, drive->serial, drive->flags,
(int)drive->dev, (int)drive->ino );
}
else dprintf_dosfs( stddeb, "%s: not defined\n", name );
else dprintf_warn(dosfs, "%s: not defined\n", name );
}
if (!count)
@ -266,7 +265,7 @@ int DRIVE_SetCurrentDrive( int drive )
DOS_ERROR( ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk );
return 0;
}
dprintf_dosfs( stddeb, "DRIVE_SetCurrentDrive: %c:\n", 'A' + drive );
dprintf_info(dosfs, "DRIVE_SetCurrentDrive: %c:\n", 'A' + drive );
DRIVE_CurDrive = drive;
if (pTask) pTask->curdrive = drive | 0x80;
return 1;
@ -326,7 +325,7 @@ int DRIVE_FindDriveRoot( const char **path )
*next = 0;
if (rootdrive != -1)
dprintf_dosfs( stddeb, "DRIVE_FindDriveRoot: %s -> drive %c:, root='%s', name='%s'\n",
dprintf_info(dosfs, "DRIVE_FindDriveRoot: %s -> drive %c:, root='%s', name='%s'\n",
buffer, 'A' + rootdrive,
DOSDrives[rootdrive].root, *path );
return rootdrive;
@ -447,7 +446,7 @@ int DRIVE_Chdir( int drive, const char *path )
BY_HANDLE_FILE_INFORMATION info;
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
dprintf_dosfs( stddeb, "DRIVE_Chdir(%c:,%s)\n", 'A' + drive, path );
dprintf_info(dosfs, "DRIVE_Chdir(%c:,%s)\n", 'A' + drive, path );
strcpy( buffer, "A:" );
buffer[0] += drive;
lstrcpyn32A( buffer + 2, path, sizeof(buffer) - 2 );
@ -462,7 +461,7 @@ int DRIVE_Chdir( int drive, const char *path )
unix_cwd = full_name.long_name + strlen( DOSDrives[drive].root );
while (*unix_cwd == '/') unix_cwd++;
dprintf_dosfs( stddeb, "DRIVE_Chdir(%c:): unix_cwd=%s dos_cwd=%s\n",
dprintf_info(dosfs, "DRIVE_Chdir(%c:): unix_cwd=%s dos_cwd=%s\n",
'A' + drive, unix_cwd, full_name.short_name + 3 );
HeapFree( SystemHeap, 0, DOSDrives[drive].dos_cwd );
@ -535,7 +534,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
if ( new->root )
{
dprintf_dosfs ( stddeb, "Can\'t map drive %c to drive %c - "
dprintf_info(dosfs, "Can\'t map drive %c to drive %c - "
"drive %c already exists\n",
'A' + existing_drive, 'A' + new_drive,
'A' + new_drive );
@ -552,7 +551,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
new->dev = old->dev;
new->ino = old->ino;
dprintf_dosfs ( stddeb, "Drive %c is now equal to drive %c\n",
dprintf_info(dosfs, "Drive %c is now equal to drive %c\n",
'A' + new_drive, 'A' + existing_drive );
return 1;
@ -566,7 +565,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive )
*/
int DRIVE_OpenDevice( int drive, int flags )
{
if (!DRIVE_IsValid( drive )) return NULL;
if (!DRIVE_IsValid( drive )) return -1;
return open( DOSDrives[drive].device, flags );
}
@ -735,7 +734,7 @@ BOOL32 WINAPI GetDiskFreeSpaceEx32W( LPCWSTR root, LPULARGE_INTEGER avail,
*/
UINT16 WINAPI GetDriveType16( UINT16 drive )
{
dprintf_dosfs( stddeb, "GetDriveType16(%c:)\n", 'A' + drive );
dprintf_info(dosfs, "GetDriveType16(%c:)\n", 'A' + drive );
switch(DRIVE_GetType(drive))
{
case TYPE_FLOPPY: return DRIVE_REMOVABLE;
@ -753,7 +752,7 @@ UINT16 WINAPI GetDriveType16( UINT16 drive )
*/
UINT32 WINAPI GetDriveType32A( LPCSTR root )
{
dprintf_dosfs( stddeb, "GetDriveType32A(%s)\n", root );
dprintf_info(dosfs, "GetDriveType32A(%s)\n", root );
if ((root[1]) && (root[1] != ':'))
{
fprintf( stderr, "GetDriveType32A: invalid root '%s'\n", root );

View File

@ -31,13 +31,16 @@
#include "ldt.h"
#include "process.h"
#include "task.h"
#include "stddebug.h"
#include "debug.h"
#if defined(MAP_ANONYMOUS) && !defined(MAP_ANON)
#define MAP_ANON MAP_ANONYMOUS
#endif
static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars,
LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped);
static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars,
LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped);
static void FILE_Destroy( K32OBJ *obj );
const K32OBJ_OPS FILE_Ops =
@ -47,6 +50,8 @@ const K32OBJ_OPS FILE_Ops =
NULL, /* satisfied */
NULL, /* add_wait */
NULL, /* remove_wait */
FILE_Read, /* read */
FILE_Write, /* write */
FILE_Destroy /* destroy */
};
@ -92,6 +97,70 @@ static HFILE32 FILE_Alloc( FILE_OBJECT **file )
}
/* FIXME: lpOverlapped is ignored */
static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars,
LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped)
{
FILE_OBJECT *file = (FILE_OBJECT *)ptr;
int result;
dprintf_info(file, "FILE_Read: %p %p %ld\n", ptr, lpBuffer,
nNumberOfChars);
if (nNumberOfChars == 0) {
*lpNumberOfChars = 0; /* FIXME: does this change */
return TRUE;
}
if ((result = read(file->unix_handle, lpBuffer, nNumberOfChars)) == -1)
{
FILE_SetDosError();
return FALSE;
}
*lpNumberOfChars = result;
return TRUE;
}
/**
* experimentation yields that WriteFile:
* o does not truncate on write of 0
* o always changes the *lpNumberOfChars to actual number of
* characters written
* o write of 0 nNumberOfChars returns TRUE
*/
static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars,
LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped)
{
FILE_OBJECT *file = (FILE_OBJECT *)ptr;
int result;
dprintf_info(file, "FILE_Write: %p %p %ld\n", ptr, lpBuffer,
nNumberOfChars);
*lpNumberOfChars = 0;
/* FIXME: there was a loop here before that
* retried writes after EAGAIN, why??? -- I assume
* it is because win32 doesn't have interrupted
* system calls
*/
for (;;)
{
result = write(file->unix_handle, lpBuffer, nNumberOfChars);
if (result != -1) {
*lpNumberOfChars = result;
return TRUE;
}
if (errno != EINTR) {
FILE_SetDosError();
return FALSE;
}
}
}
/***********************************************************************
* FILE_Destroy
*
@ -160,8 +229,7 @@ void FILE_SetDosError(void)
{
int save_errno = errno; /* errno gets overwritten by printf */
dprintf_file(stddeb, "FILE_SetDosError: errno = %d %s\n", errno,
strerror(errno) );
dprintf_info(file, "FILE_SetDosError: errno = %d %s\n", errno, strerror(errno));
switch (save_errno)
{
case EAGAIN:
@ -235,7 +303,7 @@ HFILE32 FILE_DupUnixHandle( int fd )
/***********************************************************************
* FILE_OpenUnixFile
*/
static HFILE32 FILE_OpenUnixFile( const char *name, int mode )
HFILE32 FILE_OpenUnixFile( const char *name, int mode )
{
HFILE32 handle;
FILE_OBJECT *file;
@ -277,19 +345,24 @@ HFILE32 FILE_Open( LPCSTR path, INT32 mode )
DOS_FULL_NAME full_name;
const char *unixName;
dprintf_file(stddeb, "FILE_Open: '%s' %04x\n", path, mode );
dprintf_info(file, "FILE_Open: '%s' %04x\n", path, mode );
if (!path) return HFILE_ERROR32;
if ((unixName = DOSFS_IsDevice( path )) != NULL)
if (DOSFS_IsDevice( path ))
{
dprintf_file( stddeb, "FILE_Open: opening device '%s'\n", unixName );
if (!unixName[0]) /* Non-existing device */
{
dprintf_file(stddeb, "FILE_Open: Non-existing device\n");
HFILE32 ret;
dprintf_info(file, "FILE_Open: opening device '%s'\n", path );
if (HFILE_ERROR32!=(ret=DOSFS_OpenDevice( path, mode )))
return ret;
/* Do not silence this please. It is a critical error. -MM */
fprintf(stderr, "FILE_Open: Couldn't open device '%s'!\n",path);
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
return HFILE_ERROR32;
}
}
else /* check for filename, don't check for last entry if creating */
{
@ -308,16 +381,15 @@ static HFILE32 FILE_Create( LPCSTR path, int mode, int unique )
{
HFILE32 handle;
FILE_OBJECT *file;
const char *unixName;
DOS_FULL_NAME full_name;
dprintf_file(stddeb, "FILE_Create: '%s' %04x %d\n", path, mode, unique );
dprintf_info(file, "FILE_Create: '%s' %04x %d\n", path, mode, unique );
if (!path) return INVALID_HANDLE_VALUE32;
if ((unixName = DOSFS_IsDevice( path )) != NULL)
if (DOSFS_IsDevice( path ))
{
dprintf_file(stddeb, "FILE_Create: creating device '%s'!\n", unixName);
fprintf(stderr, "FILE_Create: cannot create DOS device '%s'!\n", path);
DOS_ERROR( ER_AccessDenied, EC_NotFound, SA_Abort, EL_Disk );
return INVALID_HANDLE_VALUE32;
}
@ -510,11 +582,11 @@ HFILE32 FILE_Dup( HFILE32 hFile )
FILE_OBJECT *file;
HFILE32 handle;
dprintf_file( stddeb, "FILE_Dup for handle %d\n", hFile );
dprintf_info(file, "FILE_Dup for handle %d\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32;
handle = HANDLE_Alloc( &file->header, FILE_ALL_ACCESS /*FIXME*/, FALSE );
FILE_ReleaseFile( file );
dprintf_file( stddeb, "FILE_Dup return handle %d\n", handle );
dprintf_info(file, "FILE_Dup return handle %d\n", handle );
return handle;
}
@ -528,7 +600,7 @@ HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 )
{
FILE_OBJECT *file;
dprintf_file( stddeb, "FILE_Dup2 for handle %d\n", hFile1 );
dprintf_info(file, "FILE_Dup2 for handle %d\n", hFile1 );
/* FIXME: should use DuplicateHandle */
if (!(file = FILE_GetFile( hFile1 ))) return HFILE_ERROR32;
if (!HANDLE_SetObjPtr( hFile2, &file->header, 0 )) hFile2 = HFILE_ERROR32;
@ -600,7 +672,7 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
HFILE32 handle = FILE_Create( buffer, 0666, TRUE );
if (handle != INVALID_HANDLE_VALUE32)
{ /* We created it */
dprintf_file( stddeb, "GetTempFileName32A: created %s\n",
dprintf_info(file, "GetTempFileName32A: created %s\n",
buffer);
CloseHandle( handle );
break;
@ -624,7 +696,7 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
"Please check your configuration file if this generates a failure.\n",
buffer);
}
dprintf_file( stddeb, "GetTempFileName32A: returning %s\n", buffer );
dprintf_info(file, "GetTempFileName32A: returning %s\n", buffer );
return unique ? unique : num;
}
@ -678,7 +750,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
return HFILE_ERROR32;
}
dprintf_file( stddeb, "OpenFile: %s %04x\n", name, mode );
dprintf_info(file, "OpenFile: %s %04x\n", name, mode );
/* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName
Are there any cases where getting the path here is wrong?
@ -692,7 +764,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
{
ofs->fFixedDisk = (GetDriveType16( ofs->szPathName[0]-'A' )
!= DRIVE_REMOVABLE);
dprintf_file( stddeb, "OpenFile(%s): OF_PARSE, res = '%s'\n",
dprintf_info(file, "OpenFile(%s): OF_PARSE, res = '%s'\n",
name, ofs->szPathName );
return 0;
}
@ -725,7 +797,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
if (!DIR_SearchPath( NULL, name, NULL, &full_name, win32 )) goto not_found;
found:
dprintf_file( stddeb, "OpenFile: found %s = %s\n",
dprintf_info(file, "OpenFile: found %s = %s\n",
full_name.long_name, full_name.short_name );
lstrcpyn32A( ofs->szPathName, full_name.short_name,
sizeof(ofs->szPathName) );
@ -733,7 +805,7 @@ found:
if (mode & OF_DELETE)
{
if (unlink( full_name.long_name ) == -1) goto not_found;
dprintf_file( stddeb, "OpenFile(%s): OF_DELETE return = OK\n", name);
dprintf_info(file, "OpenFile(%s): OF_DELETE return = OK\n", name);
return 1;
}
@ -757,7 +829,7 @@ found:
if (memcmp( ofs->reserved, filedatetime, sizeof(ofs->reserved) ))
{
CloseHandle( hFileRet );
dprintf_file( stddeb, "OpenFile(%s): OF_VERIFY failed\n", name );
dprintf_warn(file, "OpenFile(%s): OF_VERIFY failed\n", name );
/* FIXME: what error here? */
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
goto error;
@ -766,19 +838,19 @@ found:
memcpy( ofs->reserved, filedatetime, sizeof(ofs->reserved) );
success: /* We get here if the open was successful */
dprintf_file( stddeb, "OpenFile(%s): OK, return = %d\n", name, hFileRet );
dprintf_info(file, "OpenFile(%s): OK, return = %d\n", name, hFileRet );
if (mode & OF_EXIST) /* Return the handle, but close it first */
CloseHandle( hFileRet );
return hFileRet;
not_found: /* We get here if the file does not exist */
dprintf_file( stddeb, "OpenFile: '%s' not found\n", name );
dprintf_warn(file, "OpenFile: '%s' not found\n", name );
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
/* fall through */
error: /* We get here if there was an error opening the file */
ofs->nErrCode = DOS_ExtendedError;
dprintf_file( stddeb, "OpenFile(%s): return = HFILE_ERROR error= %d\n",
dprintf_warn(file, "OpenFile(%s): return = HFILE_ERROR error= %d\n",
name,ofs->nErrCode );
return HFILE_ERROR32;
}
@ -807,7 +879,7 @@ HFILE32 WINAPI OpenFile32( LPCSTR name, OFSTRUCT *ofs, UINT32 mode )
*/
HFILE16 WINAPI _lclose16( HFILE16 hFile )
{
dprintf_file( stddeb, "_lclose16: handle %d\n", hFile );
dprintf_info(file, "_lclose16: handle %d\n", hFile );
return CloseHandle( hFile ) ? 0 : HFILE_ERROR16;
}
@ -817,7 +889,7 @@ HFILE16 WINAPI _lclose16( HFILE16 hFile )
*/
HFILE32 WINAPI _lclose32( HFILE32 hFile )
{
dprintf_file( stddeb, "_lclose32: handle %d\n", hFile );
dprintf_info(file, "_lclose32: handle %d\n", hFile );
return CloseHandle( hFile ) ? 0 : HFILE_ERROR32;
}
@ -829,7 +901,7 @@ LONG WINAPI WIN16_hread( HFILE16 hFile, SEGPTR buffer, LONG count )
{
LONG maxlen;
dprintf_file( stddeb, "WIN16_hread: %d %08lx %ld\n",
dprintf_info(file, "WIN16_hread: %d %08lx %ld\n",
hFile, (DWORD)buffer, count );
/* Some programs pass a count larger than the allocated buffer */
@ -851,18 +923,19 @@ UINT16 WINAPI WIN16_lread( HFILE16 hFile, SEGPTR buffer, UINT16 count )
/***********************************************************************
* _lread32 (KERNEL32.596)
*/
UINT32 WINAPI _lread32( HFILE32 hFile, LPVOID buffer, UINT32 count )
UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count )
{
FILE_OBJECT *file;
UINT32 result;
K32OBJ *ptr;
DWORD numWritten;
BOOL32 result = FALSE;
dprintf_file( stddeb, "_lread32: %d %p %d\n", hFile, buffer, count );
if (!(file = FILE_GetFile( hFile ))) return -1;
if (!count) result = 0;
else if ((result = read( file->unix_handle, buffer, count )) == -1)
FILE_SetDosError();
FILE_ReleaseFile( file );
return result;
dprintf_info( file, "_lread32: %d %p %d\n", handle, buffer, count);
if (!(ptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0))) return -1;
if (K32OBJ_OPS(ptr)->read)
result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL);
K32OBJ_DecCount( ptr );
if (!result) return -1;
return (UINT32)numWritten;
}
@ -881,7 +954,7 @@ UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count )
HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
{
int mode = (attr & 1) ? 0444 : 0666;
dprintf_file( stddeb, "_lcreat16: %s %02x\n", path, attr );
dprintf_info(file, "_lcreat16: %s %02x\n", path, attr );
return (HFILE16)FILE_Create( path, mode, FALSE );
}
@ -892,7 +965,7 @@ HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr )
{
int mode = (attr & 1) ? 0444 : 0666;
dprintf_file( stddeb, "_lcreat32: %s %02x\n", path, attr );
dprintf_info(file, "_lcreat32: %s %02x\n", path, attr );
return FILE_Create( path, mode, FALSE );
}
@ -903,7 +976,7 @@ HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr )
HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr )
{
int mode = (attr & 1) ? 0444 : 0666;
dprintf_file( stddeb, "_lcreat_uniq: %s %02x\n", path, attr );
dprintf_info(file, "_lcreat_uniq: %s %02x\n", path, attr );
return FILE_Create( path, mode, TRUE );
}
@ -923,7 +996,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
SetLastError( ERROR_INVALID_PARAMETER );
return 0xffffffff;
}
dprintf_file( stddeb, "SetFilePointer: handle %d offset %ld origin %ld\n",
dprintf_info(file, "SetFilePointer: handle %d offset %ld origin %ld\n",
hFile, distance, method );
if (!(file = FILE_GetFile( hFile ))) return 0xffffffff;
@ -975,7 +1048,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode )
{
INT32 unixMode;
dprintf_file(stddeb, "_lopen32('%s',%04x)\n", path, mode );
dprintf_info(file, "_lopen32('%s',%04x)\n", path, mode );
switch(mode & 3)
{
@ -1040,30 +1113,42 @@ LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count )
/***********************************************************************
* _hwrite32 (KERNEL32.591)
*
* experimenation yields that _lwrite:
* o truncates the file at the current position with
* a 0 len write
* o returns 0 on a 0 length write
* o works with console handles
*
*/
LONG WINAPI _hwrite32( HFILE32 hFile, LPCSTR buffer, LONG count )
LONG WINAPI _hwrite32( HFILE32 handle, LPCSTR buffer, LONG count )
{
FILE_OBJECT *file;
LONG result;
K32OBJ *ioptr;
DWORD result;
BOOL32 status = FALSE;
dprintf_file( stddeb, "_hwrite32: %d %p %ld\n", hFile, buffer, count );
dprintf_info(file, "_hwrite32: %d %p %ld\n", handle, buffer, count );
if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32;
if (count == 0) /* Expand or truncate at current position */
result = ftruncate( file->unix_handle,
lseek( file->unix_handle, 0, SEEK_CUR ) );
else for (;;)
{
result = write( file->unix_handle, buffer, count );
if (result != -1) break;
if (errno != EINTR)
{
if (count == 0) { /* Expand or truncate at current position */
FILE_OBJECT *file = FILE_GetFile(handle);
if ( ftruncate(file->unix_handle,
lseek( file->unix_handle, 0, SEEK_CUR)) == 0 ) {
FILE_ReleaseFile(file);
return 0;
} else {
FILE_SetDosError();
break;
FILE_ReleaseFile(file);
return HFILE_ERROR32;
}
}
FILE_ReleaseFile( file );
if (!(ioptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0 )))
return HFILE_ERROR32;
if (K32OBJ_OPS(ioptr)->write)
status = K32OBJ_OPS(ioptr)->write(ioptr, buffer, count, &result, NULL);
K32OBJ_DecCount( ioptr );
if (!status) result = HFILE_ERROR32;
return result;
}
@ -1077,7 +1162,7 @@ UINT16 WINAPI SetHandleCount16( UINT16 count )
PDB *pdb = (PDB *)GlobalLock16( hPDB );
BYTE *files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
dprintf_file( stddeb, "SetHandleCount16(%d)\n", count );
dprintf_info(file, "SetHandleCount16(%d)\n", count );
if (count < 20) count = 20; /* No point in going below 20 */
else if (count > 254) count = 254;
@ -1137,7 +1222,7 @@ BOOL32 WINAPI FlushFileBuffers( HFILE32 hFile )
FILE_OBJECT *file;
BOOL32 ret;
dprintf_file( stddeb, "FlushFileBuffers(%d)\n", hFile );
dprintf_info(file, "FlushFileBuffers(%d)\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return FALSE;
if (fsync( file->unix_handle ) != -1) ret = TRUE;
else
@ -1158,7 +1243,7 @@ BOOL32 WINAPI SetEndOfFile( HFILE32 hFile )
FILE_OBJECT *file;
BOOL32 ret = TRUE;
dprintf_file( stddeb, "SetEndOfFile(%d)\n", hFile );
dprintf_info(file, "SetEndOfFile(%d)\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return FALSE;
if (ftruncate( file->unix_handle,
lseek( file->unix_handle, 0, SEEK_CUR ) ))
@ -1186,13 +1271,12 @@ BOOL16 WINAPI DeleteFile16( LPCSTR path )
BOOL32 WINAPI DeleteFile32A( LPCSTR path )
{
DOS_FULL_NAME full_name;
const char *unixName;
dprintf_file(stddeb, "DeleteFile: '%s'\n", path );
dprintf_info(file, "DeleteFile: '%s'\n", path );
if ((unixName = DOSFS_IsDevice( path )) != NULL)
if (DOSFS_IsDevice( path ))
{
dprintf_file(stddeb, "DeleteFile: removing device '%s'!\n", unixName);
fprintf(stderr, "DeleteFile: cannot remove DOS device '%s'!\n", path);
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
return FALSE;
}
@ -1361,7 +1445,7 @@ BOOL32 WINAPI MoveFileEx32A( LPCSTR fn1, LPCSTR fn2, DWORD flag )
DOS_FULL_NAME full_name1, full_name2;
int mode=0; /* mode == 1: use copy */
dprintf_file( stddeb, "MoveFileEx32A(%s,%s,%04lx)\n", fn1, fn2, flag);
dprintf_info(file, "MoveFileEx32A(%s,%s,%04lx)\n", fn1, fn2, flag);
if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE;
if (fn2) { /* !fn2 means delete fn1 */
@ -1461,7 +1545,7 @@ BOOL32 WINAPI MoveFile32A( LPCSTR fn1, LPCSTR fn2 )
DOS_FULL_NAME full_name1, full_name2;
struct stat fstat;
dprintf_file( stddeb, "MoveFile32A(%s,%s)\n", fn1, fn2 );
dprintf_info(file, "MoveFile32A(%s,%s)\n", fn1, fn2 );
if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE;
if (DOSFS_GetFullName( fn2, TRUE, &full_name2 ))
@ -1479,7 +1563,7 @@ BOOL32 WINAPI MoveFile32A( LPCSTR fn1, LPCSTR fn2 )
else /*copy */ {
if (stat( full_name1.long_name, &fstat ))
{
dprintf_file( stddeb, "Invalid source file %s\n",
dprintf_warn(file, "Invalid source file %s\n",
full_name1.long_name);
FILE_SetDosError();
return FALSE;
@ -1580,7 +1664,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile,
struct utimbuf utimbuf;
if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */
dprintf_file(stddeb,"SetFileTime(%s,%p,%p,%p)\n",
dprintf_info(file,"SetFileTime(%s,%p,%p,%p)\n",
file->unix_name,
lpCreationTime,
lpLastAccessTime,
@ -1697,12 +1781,12 @@ BOOL32 WINAPI LockFile(
struct flock f;
FILE_OBJECT *file;
dprintf_file(stddeb, "LockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
dprintf_info(file, "LockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
hFile, dwFileOffsetLow, dwFileOffsetHigh,
nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh);
if (dwFileOffsetHigh || nNumberOfBytesToLockHigh) {
dprintf_file(stddeb, "LockFile32: Unimplemented bytes > 32bits\n");
dprintf_fixme(file, "LockFile32: Unimplemented bytes > 32bits\n");
return FALSE;
}
@ -1748,12 +1832,12 @@ BOOL32 WINAPI UnlockFile(
FILE_OBJECT *file;
struct flock f;
dprintf_file(stddeb, "UnlockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
dprintf_info(file, "UnlockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
hFile, dwFileOffsetLow, dwFileOffsetHigh,
nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh);
if (dwFileOffsetHigh || nNumberOfBytesToUnlockHigh) {
dprintf_file(stddeb, "UnlockFile32: Unimplemented bytes > 32bits\n");
dprintf_warn(file, "UnlockFile32: Unimplemented bytes > 32bits\n");
return FALSE;
}

View File

@ -13,7 +13,6 @@
#include "windows.h"
#include "file.h"
#include "heap.h"
#include "stddebug.h"
#include "debug.h"
typedef struct tagPROFILEKEY
@ -216,11 +215,12 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
*prev_key = key;
prev_key = &key->next;
}
if (debugging_profile)
if (debugging_info(profile))
{
fprintf( stddeb, "PROFILE_Load:\n" );
PROFILE_Save( stddeb, first_section );
fprintf( stddeb, "PROFILE_Load finished.\n" );
dprintf_info(profile, "PROFILE_Load:\n" );
/* FIXME: improper use of stddeb! */
PROFILE_Save(stddeb, first_section );
dprintf_info(profile, "PROFILE_Load finished.\n" );
}
return first_section;
}
@ -357,7 +357,7 @@ static BOOL32 PROFILE_FlushFile(void)
return FALSE;
}
dprintf_profile( stddeb, "Saving '%s' into '%s'\n",
dprintf_info(profile, "Saving '%s' into '%s'\n",
CurProfile.dos_name, unix_name );
PROFILE_Save( file, CurProfile.section );
fclose( file );
@ -380,7 +380,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename )
if (CurProfile.filename && !strcmp( filename, CurProfile.filename ))
{
dprintf_profile( stddeb, "PROFILE_Open(%s): already opened\n",
dprintf_info(profile, "PROFILE_Open(%s): already opened\n",
filename );
return TRUE;
}
@ -400,7 +400,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename )
if (CurProfile.dos_name &&
!strcmp( full_name.short_name, CurProfile.dos_name ))
{
dprintf_profile( stddeb, "PROFILE_Open(%s): already opened\n",
dprintf_info(profile, "PROFILE_Open(%s): already opened\n",
filename );
return TRUE;
}
@ -429,7 +429,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename )
CharLower32A( p );
if ((file = fopen( buffer, "r" )))
{
dprintf_profile( stddeb, "PROFILE_Open(%s): found it in %s\n",
dprintf_info(profile, "PROFILE_Open(%s): found it in %s\n",
filename, buffer );
CurProfile.unix_name = HEAP_strdupA( SystemHeap, 0, buffer );
}
@ -440,7 +440,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename )
CurProfile.unix_name = HEAP_strdupA( SystemHeap, 0,
full_name.long_name );
if ((file = fopen( full_name.long_name, "r" )))
dprintf_profile( stddeb, "PROFILE_Open(%s): found it in %s\n",
dprintf_info(profile, "PROFILE_Open(%s): found it in %s\n",
filename, full_name.long_name );
}
@ -506,7 +506,7 @@ static INT32 PROFILE_GetString( LPCSTR section, LPCSTR key_name,
key = PROFILE_Find( &CurProfile.section, section, key_name, FALSE );
PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val,
len, FALSE );
dprintf_profile( stddeb, "PROFILE_GetString('%s','%s','%s'): returning '%s'\n",
dprintf_info(profile, "PROFILE_GetString('%s','%s','%s'): returning '%s'\n",
section, key_name, def_val, buffer );
return strlen( buffer );
}
@ -524,7 +524,7 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
{
if (!key_name) /* Delete a whole section */
{
dprintf_profile(stddeb, "PROFILE_DeleteSection('%s')\n", section_name);
dprintf_info(profile, "PROFILE_DeleteSection('%s')\n", section_name);
CurProfile.changed |= PROFILE_DeleteSection( &CurProfile.section,
section_name );
return TRUE; /* Even if PROFILE_DeleteSection() has failed,
@ -532,7 +532,7 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
}
else if (!value) /* Delete a key */
{
dprintf_profile( stddeb, "PROFILE_DeleteKey('%s','%s')\n",
dprintf_info(profile, "PROFILE_DeleteKey('%s','%s')\n",
section_name, key_name );
CurProfile.changed |= PROFILE_DeleteKey( &CurProfile.section,
section_name, key_name );
@ -542,20 +542,20 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name,
{
PROFILEKEY *key = PROFILE_Find( &CurProfile.section, section_name,
key_name, TRUE );
dprintf_profile( stddeb, "PROFILE_SetString('%s','%s','%s'): ",
dprintf_info(profile, "PROFILE_SetString('%s','%s','%s'): \n",
section_name, key_name, value );
if (!key) return FALSE;
if (key->value)
{
if (!strcmp( key->value, value ))
{
dprintf_profile( stddeb, "no change needed\n" );
dprintf_info(profile, " no change needed\n" );
return TRUE; /* No change needed */
}
dprintf_profile( stddeb, "replacing '%s'\n", key->value );
dprintf_info(profile, " replacing '%s'\n", key->value );
HeapFree( SystemHeap, 0, key->value );
}
else dprintf_profile( stddeb, "creating key\n" );
else dprintf_info(profile, " creating key\n" );
key->value = HEAP_strdupA( SystemHeap, 0, value );
CurProfile.changed = TRUE;
}
@ -576,7 +576,7 @@ int PROFILE_GetWineIniString( const char *section, const char *key_name,
PROFILEKEY *key = PROFILE_Find(&WineProfile, section, key_name, FALSE);
PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def,
len, TRUE );
dprintf_profile( stddeb, "PROFILE_GetWineIniString('%s','%s','%s'): returning '%s'\n",
dprintf_info(profile, "PROFILE_GetWineIniString('%s','%s','%s'): returning '%s'\n",
section, key_name, def, buffer );
return strlen( buffer );
}
@ -707,7 +707,7 @@ int PROFILE_GetWineIniBool(
retval = def;
}
dprintf_profile(stddeb, "PROFILE_GetWineIniBool(\"%s\", \"%s\", %s), "
dprintf_info(profile, "PROFILE_GetWineIniBool(\"%s\", \"%s\", %s), "
"[%c], ret %s.\n", section, key_name,
def ? "TRUE" : "FALSE", key_value[0],
retval ? "TRUE" : "FALSE");
@ -1031,11 +1031,11 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
{
char *p =(char*)string;
fprintf( stdnimp,"WritePrivateProfileSection32A empty stup\n");
if (debugging_profile) {
fprintf(stddeb,"file(%s) => [%s]\n", filename,section);
dprintf_fixme(profile, "WritePrivateProfileSection32A empty stup\n");
if (debugging_info(profile)) {
dprintf_info(profile, "file(%s) => [%s]\n", filename, section);
while (*(p+1)) {
fprintf(stddeb,"%s\n",p);
dprintf_info(profile, "%s\n", p);
p += strlen(p);
p += 1;
}

View File

@ -5,7 +5,6 @@
*/
#include "dc.h"
#include "stddebug.h"
#include "debug.h"
@ -18,7 +17,7 @@ BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top,
DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pPatBlt) return FALSE;
dprintf_bitblt( stddeb, "PatBlt16: %04x %d,%d %dx%d %06lx\n",
dprintf_info(bitblt, "PatBlt16: %04x %d,%d %dx%d %06lx\n",
hdc, left, top, width, height, rop );
return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
}
@ -33,7 +32,7 @@ BOOL32 WINAPI PatBlt32( HDC32 hdc, INT32 left, INT32 top,
DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pPatBlt) return FALSE;
dprintf_bitblt( stddeb, "PatBlt32: %04x %d,%d %dx%d %06lx\n",
dprintf_info(bitblt, "PatBlt32: %04x %d,%d %dx%d %06lx\n",
hdc, left, top, width, height, rop );
return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
}
@ -52,7 +51,7 @@ BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
if (!dcDst->funcs->pBitBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_bitblt(stddeb,
dprintf_info(bitblt,
"BitBlt16: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
@ -74,7 +73,7 @@ BOOL32 WINAPI BitBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst, INT32 width,
if (!dcDst->funcs->pBitBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_bitblt(stddeb,
dprintf_info(bitblt,
"BitBlt32: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
@ -97,7 +96,7 @@ BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
if (!dcDst->funcs->pStretchBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_bitblt(stddeb,
dprintf_info(bitblt,
"StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
@ -122,7 +121,7 @@ BOOL32 WINAPI StretchBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst,
if (!dcDst->funcs->pStretchBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_bitblt(stddeb,
dprintf_info(bitblt,
"StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,

View File

@ -1,4 +1,4 @@
/* DirectDraw
/* DirectDraw using DGA
*
* Copyright 1997,1998 Marcus Meissner
*/
@ -14,7 +14,8 @@
/* Progress on following programs:
*
* - Diablo [640x480x8]:
* The movies play. The game doesn't work yet.
* The movies play. The game doesn't work, it somehow tries to write
* into 2 lines _BEFORE_ the start of the surface. Don't know why.
*
* - WingCommander 4 / Win95 Patch [640x480x8]:
* The intromovie plays, in 8 bit mode (to reconfigure wc4, run wine
@ -22,22 +23,26 @@
* my Matrox Mystique which uses 565 (rgb) colorweight instead of the usual
* 555. Specifying it in DDPIXELFORMAT didn't help.
* Requires to be run in 640x480xdepth mode (doesn't seem to heed
* DDSURFACEDESC.lPitch).
* DDSURFACEDESC.lPitch). You can fly the first mission with Maniac, but
* it crashes as soon as you arrive at Blue Point Station...
*
* - Monkey Island 3 [640x480x8]:
* Goes to the easy/hard selection screen, then hangs due to not MT safe
* XLibs.
* Goes to the easy/hard selection screen, then hangs due to MT problems.
*
* - DiscWorld 2 [640x480x8]:
* Plays through nearly all intro movies. Sound and animation a bit broken.
* [Crashes with 'cli' in released version. Yes. Privileged instructions
* in 32bit code. Will they ever learn...]
* Plays through nearly all intro movies. Sound and animation skip a lot of
* stuff (possible DirectSound problem).
*
* - XvT [640x480x16]:
* Shows the splash screen, then fails with missing Joystick.
*
* - Tomb Raider 2 Demo (using 8 bit renderer) [640x480x8]:
* Shows selection screen, but keyboard input doesn't work.
* Playable. Sound is weird.
*
* - WingCommander Prophecy Demo (using software renderer) [640x480x16]:
* [Crashes with an invalid opcode (outb) in the release version.]
* Plays intromovie, hangs in selection screen (no keyboard input, probably
* DirectInput problem).
*/
@ -58,10 +63,8 @@
#include "dc.h"
#include "win.h"
#include "miscemu.h"
#include "mmsystem.h"
#include "ddraw.h"
#include "d3d.h"
#include "stddebug.h"
#include "debug.h"
#ifdef HAVE_LIBXXF86DGA
@ -301,15 +304,16 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) {
int nitems;
if (!vi)
vi = XGetVisualInfo(display,VisualNoMask,&vt,&nitems);
vi = TSXGetVisualInfo(display,VisualNoMask,&vt,&nitems);
pf->dwFourCC = mmioFOURCC('R','G','B',' ');
pf->dwFourCC = 0;
if (ddraw->d.depth==8) {
pf->dwFlags = DDPF_RGB|DDPF_PALETTEINDEXED8;
pf->x.dwRGBBitCount = 8;
pf->y.dwRBitMask = 0;
pf->z.dwGBitMask = 0;
pf->xx.dwBBitMask = 0;
pf->xy.dwRGBAlphaBitMask= 0;
return 0;
}
if (ddraw->d.depth==16) {
@ -318,6 +322,7 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) {
pf->y.dwRBitMask = vi[0].red_mask;
pf->z.dwGBitMask = vi[0].green_mask;
pf->xx.dwBBitMask = vi[0].blue_mask;
pf->xy.dwRGBAlphaBitMask= 0;
return 0;
}
fprintf(stderr,"_getpixelformat:oops?\n");
@ -331,22 +336,22 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) {
static HRESULT WINAPI IDirectDrawSurface_Lock(
LPDIRECTDRAWSURFACE this,LPRECT32 lprect,LPDDSURFACEDESC lpddsd,DWORD flags, HANDLE32 hnd
) {
if (debugging_ddraw || (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY)))
fprintf(stderr,"IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n",
this,lprect,lpddsd,flags,(DWORD)hnd
);
dprintf_info(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n",
this,lprect,lpddsd,flags,(DWORD)hnd);
if (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY))
dprintf_warn(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n",
this,lprect,lpddsd,flags,(DWORD)hnd);
if (lprect) {
/*
fprintf(stderr," lprect: %dx%d-%dx%d\n",
dprintf_info(ddraw," lprect: %dx%d-%dx%d\n",
lprect->top,lprect->left,lprect->bottom,lprect->right
);
*/
lpddsd->y.lpSurface = this->s.surface+
(lprect->top*this->s.lpitch)+
(lprect->left*(this->s.ddraw->d.depth/8));
} else
lpddsd->y.lpSurface = this->s.surface;
lpddsd->dwFlags = DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT|DDSD_PITCH|DDSD_LPSURFACE;
lpddsd->dwWidth = this->s.width;
lpddsd->dwHeight = this->s.height;
lpddsd->lPitch = this->s.lpitch;
@ -357,14 +362,14 @@ static HRESULT WINAPI IDirectDrawSurface_Lock(
static HRESULT WINAPI IDirectDrawSurface_Unlock(
LPDIRECTDRAWSURFACE this,LPVOID surface
) {
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->Unlock(%p)\n",this,surface);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->Unlock(%p)\n",this,surface);
return 0;
}
static HRESULT WINAPI IDirectDrawSurface_Flip(
LPDIRECTDRAWSURFACE this,LPDIRECTDRAWSURFACE flipto,DWORD dwFlags
) {
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags);
if (!flipto) {
if (this->s.backbuffer)
flipto = this->s.backbuffer;
@ -394,7 +399,7 @@ static HRESULT WINAPI IDirectDrawSurface_Flip(
static HRESULT WINAPI IDirectDrawSurface_SetPalette(
LPDIRECTDRAWSURFACE this,LPDIRECTDRAWPALETTE pal
) {
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->SetPalette(%p)\n",this,pal);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->SetPalette(%p)\n",this,pal);
this->s.palette = pal; /* probably addref it too */
return 0;
}
@ -470,11 +475,13 @@ static HRESULT WINAPI IDirectDrawSurface_BltFast(
LPDIRECTDRAWSURFACE this,DWORD dstx,DWORD dsty,LPDIRECTDRAWSURFACE src,LPRECT32 rsrc,DWORD trans
) {
int i,bpp;
if (debugging_info(ddraw)) {
fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n",
this,dstx,dsty,src,rsrc,trans
);
fprintf(stderr," trans:");_dump_DDBLTFAST(trans);fprintf(stderr,"\n");
fprintf(stderr," srcrect: %dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom);
}
bpp = this->s.ddraw->d.depth/8;
for (i=0;i<rsrc->bottom-rsrc->top;i++) {
memcpy( this->s.surface+((i+dsty)*this->s.width*bpp)+dstx*bpp,
@ -497,7 +504,7 @@ static HRESULT WINAPI IDirectDrawSurface_BltBatch(
static HRESULT WINAPI IDirectDrawSurface_GetCaps(
LPDIRECTDRAWSURFACE this,LPDDSCAPS caps
) {
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->GetCaps(%p)\n",this,caps);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->GetCaps(%p)\n",this,caps);
caps->dwCaps = DDCAPS_PALETTE; /* probably more */
return 0;
}
@ -505,8 +512,9 @@ static HRESULT WINAPI IDirectDrawSurface_GetCaps(
static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc(
LPDIRECTDRAWSURFACE this,LPDDSURFACEDESC ddsd
) {
if (debugging_ddraw) {
fprintf(stderr,"IDirectDrawSurface(%p)->GetSurfaceDesc(%p)\n",this,ddsd);
if (debugging_info(ddraw)) {
dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetSurfaceDesc(%p)\n",
this,ddsd);
fprintf(stderr," flags: ");
_dump_DDSD(ddsd->dwFlags);
fprintf(stderr,"\n");
@ -526,16 +534,20 @@ static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc(
}
static ULONG WINAPI IDirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE this) {
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->AddRef()\n",this);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->AddRef()\n",this);
return ++(this->ref);
}
static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) {
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->Release()\n",this);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->Release()\n",this);
if (!--(this->ref)) {
this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
/* clear out of surface list */
if (this->s.fb_height == -1) {
HeapFree(GetProcessHeap(),0,this->s.surface);
} else {
this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height));
}
HeapFree(GetProcessHeap(),0,this);
return 0;
}
@ -545,9 +557,12 @@ static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) {
static HRESULT WINAPI IDirectDrawSurface_GetAttachedSurface(
LPDIRECTDRAWSURFACE this,LPDDSCAPS lpddsd,LPDIRECTDRAWSURFACE *lpdsf
) {
if (debugging_ddraw) {
fprintf(stderr,"IDirectDrawSurface(%p)->GetAttachedSurface(%p,%p)\n",this,lpddsd,lpdsf);
fprintf(stderr," caps ");_dump_DDSCAPS(lpddsd->dwCaps);fprintf(stderr,"\n");
dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetAttachedSurface(%p,%p)\n",
this, lpddsd, lpdsf);
if (debugging_info(ddraw)) {
fprintf(stderr," caps ");
_dump_DDSCAPS(lpddsd->dwCaps);
fprintf(stderr,"\n");
}
if (!(lpddsd->dwCaps & DDSCAPS_BACKBUFFER)) {
fprintf(stderr,"IDirectDrawSurface::GetAttachedSurface():whoops, can only handle backbuffers for now\n");
@ -609,8 +624,8 @@ static HRESULT WINAPI IDirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE this,HDC32* l
static HRESULT WINAPI IDirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE this,REFIID refiid,LPVOID *obj) {
char xrefiid[50];
StringFromCLSID((LPCLSID)refiid,xrefiid);
dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
/* thats version 3 (DirectX 5) */
if ( !memcmp(&IID_IDirectDrawSurface3,refiid,sizeof(IID_IDirectDrawSurface3))) {
@ -693,7 +708,7 @@ static HRESULT WINAPI IDirectDrawSurface2_Lock(
static HRESULT WINAPI IDirectDrawSurface2_Unlock(
LPDIRECTDRAWSURFACE2 this,LPVOID surface
) {
dprintf_ddraw(stderr,"IDirectDrawSurface2(%p)->Unlock(%p)\n",this,surface);
dprintf_info(ddraw,"IDirectDrawSurface2(%p)->Unlock(%p)\n",this,surface);
return 0;
}
@ -704,19 +719,12 @@ static HRESULT WINAPI IDirectDrawSurface2_SetPalette(
}
static ULONG WINAPI IDirectDrawSurface2_AddRef(LPDIRECTDRAWSURFACE2 this) {
dprintf_ddraw(stderr,"IDirectDrawSurface2(%p)->AddRef()\n",this);
dprintf_info(ddraw,"IDirectDrawSurface2(%p)->AddRef()\n",this);
return ++(this->ref);
}
static ULONG WINAPI IDirectDrawSurface2_Release(LPDIRECTDRAWSURFACE2 this) {
dprintf_ddraw(stderr,"IDirectDrawSurface2(%p)->Release()\n",this);
if (!--(this->ref)) {
this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height));
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
return IDirectDrawSurface_Release((LPDIRECTDRAWSURFACE)this);
}
static HRESULT WINAPI IDirectDrawSurface2_GetAttachedSurface(
@ -813,12 +821,12 @@ static HRESULT WINAPI IDirectDrawSurface3_GetAttachedSurface(
}
static ULONG WINAPI IDirectDrawSurface3_AddRef(LPDIRECTDRAWSURFACE3 this) {
dprintf_ddraw(stderr,"IDirectDrawSurface3(%p)->AddRef()\n",this);
dprintf_info(ddraw,"IDirectDrawSurface3(%p)->AddRef()\n",this);
return ++(this->ref);
}
static ULONG WINAPI IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) {
dprintf_ddraw(stderr,"IDirectDrawSurface3(%p)->Release()\n",this);
dprintf_info(ddraw,"IDirectDrawSurface3(%p)->Release()\n",this);
if (!--(this->ref)) {
this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height));
@ -962,11 +970,18 @@ static struct IDirectDrawClipper_VTable ddclipvt = {
* IDirectDrawPalette
*/
static HRESULT WINAPI IDirectDrawPalette_GetEntries(
LPDIRECTDRAWPALETTE this,DWORD x,DWORD y,DWORD z,LPPALETTEENTRY palent
LPDIRECTDRAWPALETTE this,DWORD x,DWORD start,DWORD end,LPPALETTEENTRY palent
) {
fprintf(stderr,"IDirectDrawPalette(%p)->GetEntries(%08lx,%08lx,%08lx,%p),stub!\n",
this,x,y,z,palent
int i;
fprintf(stderr,"IDirectDrawPalette(%p)->GetEntries(%08lx,%ld,%ld,%p),stub!\n",
this,x,start,end,palent
);
for (i=start;i<end;i++) {
palent[i-start].peRed = i;
palent[i-start].peGreen = i;
palent[i-start].peBlue = i;
}
return 0;
}
@ -976,7 +991,7 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
XColor xc;
int i;
dprintf_ddraw(stderr,"IDirectDrawPalette(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",
dprintf_info(ddraw,"IDirectDrawPalette(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",
this,x,start,end,palent
);
if (!this->cm) /* should not happen */ {
@ -984,13 +999,19 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
return DDERR_GENERIC;
}
/* FIXME: free colorcells instead of freeing whole map */
XFreeColormap(display,this->cm);
TSXFreeColormap(display,this->cm);
this->cm = TSXCreateColormap(display,DefaultRootWindow(display),DefaultVisualOfScreen(screen),AllocAll);
if (start>0) {
xc.red = xc.blue = xc.green = 0; xc.flags = DoRed|DoGreen|DoBlue; xc.pixel = 0; TSXStoreColor(display,this->cm,&xc);
this->palents[0].peRed = 0;
this->palents[0].peBlue = 0;
this->palents[0].peGreen = 0;
}
if (end<256) {
xc.red = xc.blue = xc.green = 0xffff; xc.flags = DoRed|DoGreen|DoBlue; xc.pixel = 255; TSXStoreColor(display,this->cm,&xc);
this->palents[255].peRed = 255;
this->palents[255].peBlue = 255;
this->palents[255].peGreen = 255;
}
for (i=start;i<end;i++) {
xc.red = palent[i-start].peRed<<8;
@ -999,6 +1020,9 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
xc.flags = DoRed|DoBlue|DoGreen;
xc.pixel = i;
TSXStoreColor(display,this->cm,&xc);
this->palents[i].peRed = palent[i-start].peRed;
this->palents[i].peBlue = palent[i-start].peBlue;
this->palents[i].peGreen = palent[i-start].peGreen;
}
XF86DGAInstallColormap(display,DefaultScreen(display),this->cm);
return 0;
@ -1007,7 +1031,7 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
static ULONG WINAPI IDirectDrawPalette_Release(LPDIRECTDRAWPALETTE this) {
if (!--(this->ref)) {
if (this->cm) {
XFreeColormap(display,this->cm);
TSXFreeColormap(display,this->cm);
this->cm = 0;
}
HeapFree(GetProcessHeap(),0,this);
@ -1099,9 +1123,10 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
) {
int i;
if (debugging_ddraw) {
fprintf(stderr,"IDirectDraw(%p)->CreateSurface(%p,%p,%p)\n",this,lpddsd,lpdsf,lpunk);
fprintf(stderr," [w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight);
dprintf_info(ddraw, "IDirectDraw(%p)->CreateSurface(%p,%p,%p)\n",
this,lpddsd,lpdsf,lpunk);
if (debugging_info(ddraw)) {
fprintf(stderr,"[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight);
_dump_DDSD(lpddsd->dwFlags);
fprintf(stderr,"caps ");
_dump_DDSCAPS(lpddsd->ddsCaps.dwCaps);
@ -1112,19 +1137,34 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
this->lpvtbl->fnAddRef(this);
(*lpdsf)->ref = 1;
(*lpdsf)->lpvtbl = &ddsvt;
if ( (lpddsd->dwFlags & DDSD_CAPS) &&
(lpddsd->ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN)
) {
if (!(lpddsd->dwFlags & DDSD_WIDTH))
lpddsd->dwWidth = this->d.fb_width;
if (!(lpddsd->dwFlags & DDSD_HEIGHT))
lpddsd->dwWidth = this->d.fb_height;
(*lpdsf)->s.surface = (LPBYTE)HeapAlloc(GetProcessHeap(),0,lpddsd->dwWidth*lpddsd->dwHeight*this->d.depth/8);
(*lpdsf)->s.fb_height = -1;
(*lpdsf)->s.lpitch = lpddsd->dwWidth*this->d.depth/8;
dprintf_info(ddraw,"using system memory for a primary surface\n");
} else {
for (i=0;i<32;i++)
if (!(this->d.vpmask & (1<<i)))
break;
dprintf_ddraw(stderr,"using viewport %d for a primary surface\n",i);
dprintf_info(ddraw,"using viewport %d for a primary surface\n",i);
/* if i == 32 or maximum ... return error */
this->d.vpmask|=(1<<i);
(*lpdsf)->s.surface = this->d.fb_addr+((i*this->d.vp_height)*this->d.fb_width*this->d.depth/8);
(*lpdsf)->s.surface = this->d.fb_addr+((i*this->d.fb_height)*this->d.fb_width*this->d.depth/8);
(*lpdsf)->s.fb_height = i*this->d.fb_height;
(*lpdsf)->s.lpitch = this->d.fb_width*this->d.depth/8;
}
lpddsd->lPitch = (*lpdsf)->s.lpitch;
(*lpdsf)->s.width = this->d.width;
(*lpdsf)->s.height = this->d.height;
(*lpdsf)->s.ddraw = this;
(*lpdsf)->s.lpitch = this->d.fb_width*this->d.depth/8;
(*lpdsf)->s.backbuffer = NULL;
if (lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) {
LPDIRECTDRAWSURFACE back;
@ -1139,10 +1179,10 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
for (i=0;i<32;i++)
if (!(this->d.vpmask & (1<<i)))
break;
dprintf_ddraw(stderr,"using viewport %d for backbuffer\n",i);
dprintf_info(ddraw,"using viewport %d for backbuffer\n",i);
/* if i == 32 or maximum ... return error */
this->d.vpmask|=(1<<i);
back->s.surface = this->d.fb_addr+((i*this->d.vp_height)*this->d.fb_width*this->d.depth/8);
back->s.surface = this->d.fb_addr+((i*this->d.fb_height)*this->d.fb_width*this->d.depth/8);
back->s.fb_height = i*this->d.fb_height;
back->s.width = this->d.width;
@ -1182,14 +1222,16 @@ static HRESULT WINAPI IDirectDraw_SetCooperativeLevel(
FE(DDSCL_CREATEDEVICEWINDOW)
};
dprintf_ddraw(stderr,"IDirectDraw(%p)->SetCooperativeLevel(%08lx,%08lx)\n",
dprintf_info(ddraw,"IDirectDraw(%p)->SetCooperativeLevel(%08lx,%08lx)\n",
this,(DWORD)hwnd,cooplevel
);
dprintf_ddraw(stderr," cooperative level ");
if(debugging_info(ddraw)){
dbg_decl_str(ddraw, 512);
for (i=0;i<sizeof(flagmap)/sizeof(flagmap[0]);i++)
if (flagmap[i].mask & cooplevel)
dprintf_ddraw(stderr,"%s ",flagmap[i].name);
dprintf_ddraw(stderr,"\n");
dsprintf(ddraw, "%s ", flagmap[i].name);
dprintf_info(ddraw," cooperative level %s\n", dbg_str(ddraw));
}
this->d.mainwindow = hwnd;
return 0;
}
@ -1201,7 +1243,8 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
int i,*depths,depcount;
char buf[200];
dprintf_ddraw(stderr,"IDirectDraw(%p)->SetDisplayMode(%ld,%ld,%ld),stub!\n",this,width,height,depth);
dprintf_fixme(ddraw, "IDirectDraw(%p)->SetDisplayMode(%ld,%ld,%ld),stub!\n",
this, width, height, depth);
depths = TSXListDepths(display,DefaultScreen(display),&depcount);
for (i=0;i<depcount;i++)
@ -1230,6 +1273,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
* it works for the library too?
*/
XF86DGADirectVideo(display,DefaultScreen(display),XF86DGADirectGraphics);
XF86DGASetViewPort(display,DefaultScreen(display),0,this->d.fb_height);
#ifdef RESTORE_SIGNALS
SIGNAL_InitEmulator();
#endif
@ -1239,7 +1283,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
static HRESULT WINAPI IDirectDraw_GetCaps(
LPDIRECTDRAW this,LPDDCAPS caps1,LPDDCAPS caps2
) {
dprintf_ddraw(stderr,"IDirectDraw(%p)->GetCaps(%p,%p)\n",this,caps1,caps2);
dprintf_info(ddraw,"IDirectDraw(%p)->GetCaps(%p,%p)\n",this,caps1,caps2);
caps1->dwVidMemTotal = this->d.fb_memsize;
caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED); /* we can do anything */
caps1->ddsCaps.dwCaps = 0xffffffff; /* we can do anything */
@ -1266,7 +1310,7 @@ static HRESULT WINAPI IDirectDraw_CreateClipper(
static HRESULT WINAPI IDirectDraw_CreatePalette(
LPDIRECTDRAW this,DWORD x,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk
) {
dprintf_ddraw(stderr,"IDirectDraw(%p)->CreatePalette(%08lx,%p,%p,%p)\n",
dprintf_info(ddraw,"IDirectDraw(%p)->CreatePalette(%08lx,%p,%p,%p)\n",
this,x,palent,lpddpal,lpunk
);
*lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette));
@ -1282,7 +1326,8 @@ static HRESULT WINAPI IDirectDraw_CreatePalette(
}
static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
dprintf_ddraw(stderr,"IDirectDraw(%p)->RestoreDisplayMode(),stub!\n",this);
dprintf_fixme(ddraw, "IDirectDraw(%p)->RestoreDisplayMode(),stub!\n",
this);
Sleep(1000);
XF86DGADirectVideo(display,DefaultScreen(display),0);
#ifdef RESTORE_SIGNALS
@ -1295,7 +1340,7 @@ static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
static HRESULT WINAPI IDirectDraw_WaitForVerticalBlank(
LPDIRECTDRAW this,DWORD x,HANDLE32 h
) {
fprintf(stderr,"IDirectDraw(%p)->WaitForVerticalBlank(0x%08lx,0x%08x),stub!\n",this,x,h);
dprintf_info(ddraw,"IDirectDraw(%p)->WaitForVerticalBlank(0x%08lx,0x%08x),stub!\n",this,x,h);
return 0;
}
@ -1320,8 +1365,8 @@ static HRESULT WINAPI IDirectDraw_QueryInterface(
) {
char xrefiid[50];
StringFromCLSID((LPCLSID)refiid,xrefiid);
dprintf_ddraw(stderr,"IDirectDraw(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
dprintf_info(ddraw,"IDirectDraw(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
*obj = this;
this->lpvtbl->fnAddRef(this);
@ -1367,7 +1412,7 @@ static HRESULT WINAPI IDirectDraw_QueryInterface(
static HRESULT WINAPI IDirectDraw_GetVerticalBlankStatus(
LPDIRECTDRAW this,BOOL32 *status
) {
fprintf(stderr,"IDirectDraw(%p)->GetVerticalBlankSatus(%p)\n",this,status);
dprintf_info(ddraw,"IDirectDraw(%p)->GetVerticalBlankSatus(%p)\n",this,status);
*status = TRUE;
return 0;
}
@ -1377,7 +1422,7 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes(
) {
DDSURFACEDESC ddsfd;
dprintf_ddraw(stderr,"IDirectDraw(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
dprintf_info(ddraw,"IDirectDraw(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
_getpixelformat(this,&(ddsfd.ddpfPixelFormat));
@ -1412,10 +1457,10 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes(
static HRESULT WINAPI IDirectDraw_GetDisplayMode(
LPDIRECTDRAW this,LPDDSURFACEDESC lpddsfd
) {
dprintf_ddraw(stderr,"IDirectDraw(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
dprintf_info(ddraw,"IDirectDraw(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS;
lpddsfd->dwHeight = this->d.vp_height;
lpddsfd->dwWidth = this->d.vp_width;
lpddsfd->dwHeight = screenHeight;
lpddsfd->dwWidth = screenWidth;
lpddsfd->lPitch = this->d.fb_width*this->d.depth/8;
lpddsfd->dwBackBufferCount = 1;
lpddsfd->x.dwRefreshRate = 60;
@ -1429,6 +1474,13 @@ static HRESULT WINAPI IDirectDraw_FlipToGDISurface(LPDIRECTDRAW this) {
return DD_OK;
}
static HRESULT WINAPI IDirectDraw_GetMonitorFrequency(
LPDIRECTDRAW this,LPDWORD freq
) {
fprintf(stderr,"IDirectDraw(%p)->GetMonitorFrequency(%p)\n",this,freq);
*freq = 60*100; /* 60 Hz */
return 0;
}
static IDirectDraw_VTable ddvt = {
IDirectDraw_QueryInterface,
@ -1446,7 +1498,7 @@ static IDirectDraw_VTable ddvt = {
IDirectDraw_GetDisplayMode,
(void*)14,
(void*)15,
(void*)16,
IDirectDraw_GetMonitorFrequency,
(void*)17,
IDirectDraw_GetVerticalBlankStatus,
(void*)19,
@ -1508,7 +1560,8 @@ static HRESULT WINAPI IDirectDraw2_CreatePalette(
static HRESULT WINAPI IDirectDraw2_SetDisplayMode(
LPDIRECTDRAW2 this,DWORD width,DWORD height,DWORD depth,DWORD xx,DWORD yy
) {
dprintf_ddraw(stderr,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx),stub!\n",this,width,height,depth,xx,yy);
dprintf_fixme(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx),stub!\n",
this, width, height, depth, xx, yy);
return IDirectDraw_SetDisplayMode((LPDIRECTDRAW)this,width,height,depth);
}
@ -1539,7 +1592,7 @@ static HRESULT WINAPI IDirectDraw2_GetDisplayMode(
static HRESULT WINAPI IDirectDraw2_GetAvailableVidMem(
LPDIRECTDRAW2 this,LPDDSCAPS ddscaps,LPDWORD total,LPDWORD free
) {
fprintf(stderr,"IDirectDraw2(%p)->GetAvailableVidMem(%p,%p,%p),stub!\n",
fprintf(stderr,"IDirectDraw2(%p)->GetAvailableVidMem(%p,%p,%p)\n",
this,ddscaps,total,free
);
if (total) *total = this->d.fb_memsize * 1024;
@ -1550,9 +1603,19 @@ static HRESULT WINAPI IDirectDraw2_GetAvailableVidMem(
static HRESULT WINAPI IDirectDraw2_GetMonitorFrequency(
LPDIRECTDRAW2 this,LPDWORD freq
) {
fprintf(stderr,"IDirectDraw2(%p)->GetMonitorFrequency(%p)\n",this,freq);
*freq = 60;
return 0;
return IDirectDraw_GetMonitorFrequency((LPDIRECTDRAW)this,freq);
}
static HRESULT WINAPI IDirectDraw2_GetVerticalBlankStatus(
LPDIRECTDRAW2 this,BOOL32 *status
) {
return IDirectDraw_GetVerticalBlankStatus((LPDIRECTDRAW)this,status);
}
static HRESULT WINAPI IDirectDraw2_WaitForVerticalBlank(
LPDIRECTDRAW2 this,DWORD x,HANDLE32 h
) {
return IDirectDraw_WaitForVerticalBlank((LPDIRECTDRAW)this,x,h);
}
static IDirectDraw2_VTable dd2vt = {
@ -1573,12 +1636,12 @@ static IDirectDraw2_VTable dd2vt = {
(void*)15,
IDirectDraw2_GetMonitorFrequency,
(void*)17,
(void*)18,
IDirectDraw2_GetVerticalBlankStatus,
(void*)19,
IDirectDraw2_RestoreDisplayMode,
IDirectDraw2_SetCooperativeLevel,
IDirectDraw2_SetDisplayMode,
(void*)23/*IDirectDraw_WaitForVerticalBlank*/,
IDirectDraw2_WaitForVerticalBlank,
IDirectDraw2_GetAvailableVidMem
};
@ -1594,11 +1657,11 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
char *addr;
if (lpGUID)
StringFromCLSID(lpGUID,xclsid);
WINE_StringFromCLSID(lpGUID,xclsid);
else
strcpy(xclsid,"<null>");
dprintf_ddraw(stderr,"DirectDrawCreate(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter);
dprintf_info(ddraw,"DirectDrawCreate(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter);
if (getuid()) {
MessageBox32A(0,"Using the XF86DGA extension requires the program to be run using UID 0.","WINE DirectDraw",MB_OK|MB_ICONSTOP);
return E_UNEXPECTED;
@ -1611,12 +1674,12 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
return 0;
}
XF86DGAQueryVersion(display,&major,&minor);
dprintf_ddraw(stderr,"XF86DGA is version %d.%d\n",major,minor);
dprintf_info(ddraw,"XF86DGA is version %d.%d\n",major,minor);
XF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags);
if (!(flags & XF86DGADirectPresent))
fprintf(stderr,"direct video is NOT ENABLED.\n");
XF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize);
dprintf_ddraw(stderr,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n",
dprintf_info(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n",
addr,width,banksize,memsize
);
(*lplpDD)->d.fb_width = width;
@ -1624,12 +1687,12 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
(*lplpDD)->d.fb_memsize = memsize;
(*lplpDD)->d.fb_banksize = banksize;
XF86DGASetViewPort(display,DefaultScreen(display),0,0);
XF86DGAGetViewPortSize(display,DefaultScreen(display),&width,&height);
XF86DGASetViewPort(display,DefaultScreen(display),0,0);
(*lplpDD)->d.vp_width = width;
(*lplpDD)->d.vp_height = height;
(*lplpDD)->d.fb_height = height;
(*lplpDD)->d.vpmask = 0;
(*lplpDD)->d.fb_height = screenHeight;
(*lplpDD)->d.vpmask = 1;
/* just assume the default depth is the DGA depth too */
(*lplpDD)->d.depth = DefaultDepthOfScreen(screen);

View File

@ -9,7 +9,6 @@
#include "windows.h"
#include "gdi.h"
#include "debug.h"
#include "stddebug.h"
/***********************************************************************
* GetEnvironment (GDI.134)

View File

@ -6,7 +6,6 @@
#include <math.h>
#include "dc.h"
#include "stddebug.h"
#include "debug.h"
@ -164,7 +163,7 @@ INT32 WINAPI SetMapMode32( HDC32 hdc, INT32 mode )
if (!dc) return 0;
if (dc->funcs->pSetMapMode) return dc->funcs->pSetMapMode( dc, mode );
dprintf_gdi(stddeb, "SetMapMode: %04x %d\n", hdc, mode );
dprintf_info(gdi, "SetMapMode: %04x %d\n", hdc, mode );
prevMode = dc->w.MapMode;
switch(mode)

View File

@ -12,7 +12,6 @@
#include "region.h"
#include "xmalloc.h"
#include "metafiledrv.h"
#include "stddebug.h"
#include "debug.h"
/**********************************************************************

View File

@ -9,7 +9,6 @@
#include "heap.h"
#include "global.h"
#include "metafile.h"
#include "stddebug.h"
#include "debug.h"
static const DC_FUNCTIONS MFDRV_Funcs =
@ -151,7 +150,7 @@ HDC16 WINAPI CreateMetaFile16(
METAFILEDRV_PDEVICE *physDev;
HFILE32 hFile;
dprintf_metafile( stddeb, "CreateMetaFile16: '%s'\n", filename );
dprintf_info(metafile, "CreateMetaFile16: '%s'\n", filename );
if (!(dc = MFDRV_AllocMetaFile())) return 0;
physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
@ -176,7 +175,7 @@ HDC16 WINAPI CreateMetaFile16(
else /* memory based metafile */
physDev->mh->mtType = METAFILE_MEMORY;
dprintf_metafile( stddeb, "CreateMetaFile16: returning %04x\n", dc->hSelf);
dprintf_info(metafile, "CreateMetaFile16: returning %04x\n", dc->hSelf);
return dc->hSelf;
}
@ -199,7 +198,7 @@ HMETAFILE16 WINAPI CloseMetaFile16(
HFILE32 hFile;
METAFILEDRV_PDEVICE *physDev;
dprintf_metafile( stddeb, "CloseMetaFile(%04x)\n", hdc );
dprintf_info(metafile, "CloseMetaFile(%04x)\n", hdc );
if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0;
physDev = (METAFILEDRV_PDEVICE *)dc->physDev;

View File

@ -12,7 +12,6 @@
#include "metafile.h"
#include "metafiledrv.h"
#include "pen.h"
#include "stddebug.h"
#include "debug.h"
@ -86,7 +85,7 @@ HGDIOBJ32 MFDRV_SelectObject( DC *dc, HGDIOBJ32 handle )
HGDIOBJ32 ret = 0;
if (!ptr) return 0;
dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic)
{

View File

@ -13,7 +13,6 @@
#include "heap.h"
#include "metafile.h"
#include "metafiledrv.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"

View File

@ -24,7 +24,6 @@
#include "color.h"
#include "region.h"
#include "path.h"
#include "stddebug.h"
#include "debug.h"
/***********************************************************************

View File

@ -8,7 +8,6 @@
#include "brush.h"
#include "win16drv.h"
#include "heap.h"
#include "stddebug.h"
#include "debug.h"
HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
@ -26,7 +25,7 @@ HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
if ( physDev->BrushInfo )
{
dprintf_win16drv(stddeb, "UnRealizing BrushInfo\n");
dprintf_info(win16drv, "UnRealizing BrushInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
physDev->BrushInfo,
physDev->BrushInfo, 0);

View File

@ -12,7 +12,6 @@
#include "module.h"
#include "font.h"
#include "heap.h"
#include "stddebug.h"
#include "debug.h"
@ -25,7 +24,7 @@ BOOL32 WIN16DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
DWORD dwRet;
dprintf_win16drv(stddeb, "WIN16DRV_GetTextExtPoint: %04x %s %d %p\n",
dprintf_info(win16drv, "WIN16DRV_GetTextExtPoint: %04x %s %d %p\n",
dc->hSelf, str, count, size);
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
@ -35,7 +34,7 @@ BOOL32 WIN16DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
win16drv_SegPtr_TextXForm, NULL, NULL, 0);
size->cx = XDSTOLS(dc,LOWORD(dwRet));
size->cy = YDSTOLS(dc,HIWORD(dwRet));
dprintf_win16drv(stddeb, "WIN16DRV_GetTextExtPoint: cx=0x%x, cy=0x%x\n",
dprintf_info(win16drv, "WIN16DRV_GetTextExtPoint: cx=0x%x, cy=0x%x\n",
size->cx, size->cy );
return TRUE;
}
@ -48,11 +47,11 @@ BOOL32 WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
dprintf_win16drv(stddeb, "WIN16DRV_GetTextMetrics: %04x \n", dc->hSelf);
dprintf_info(win16drv, "WIN16DRV_GetTextMetrics: %04x \n", dc->hSelf);
FONT_TextMetric16to32A( &physDev->tm, metrics );
dprintf_win16drv(stddeb,
dprintf_info(win16drv,
"H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n",
metrics->tmHeight,
metrics->tmAscent,
@ -74,13 +73,13 @@ HFONT32 WIN16DRV_FONT_SelectObject( DC * dc, HFONT32 hfont, FONTOBJ * font)
dc->w.hFont = hfont;
dprintf_win16drv(stddeb, "WIN16DRV_FONT_SelectObject '%s' h=%d\n",
dprintf_info(win16drv, "WIN16DRV_FONT_SelectObject '%s' h=%d\n",
font->logfont.lfFaceName, font->logfont.lfHeight);
if( physDev->FontInfo )
{
dprintf_win16drv(stddeb, "UnRealizing FontInfo\n");
dprintf_info(win16drv, "UnRealizing FontInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_FONT,
physDev->FontInfo,
physDev->FontInfo, 0);
@ -130,7 +129,7 @@ HFONT32 WIN16DRV_FONT_SelectObject( DC * dc, HFONT32 hfont, FONTOBJ * font)
physDev->tm.tmCharSet = fi->dfCharSet;
#undef fi
dprintf_win16drv(stddeb,
dprintf_info(win16drv,
"H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n",
physDev->tm.tmHeight,
physDev->tm.tmAscent,
@ -155,17 +154,18 @@ BOOL32 WIN16DRV_GetCharWidth( DC *dc, UINT32 firstChar, UINT32 lastChar,
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
dprintf_win16drv( stddeb, "WIN16DRV_GetCharWidth: %d - %d into %p\n",
dprintf_info(win16drv, "WIN16DRV_GetCharWidth: %d - %d into %p\n",
firstChar, lastChar, buffer );
wRet = PRTDRV_GetCharWidth( physDev->segptrPDEVICE, buffer, firstChar,
lastChar, physDev->FontInfo,
win16drv_SegPtr_DrawMode,
win16drv_SegPtr_TextXForm );
if( debugging_win16drv )
if( debugging_info(win16drv) ){
for(i = 0; i <= lastChar - firstChar; i++)
dprintf_win16drv(stddeb, "Char %x: width %d\n", i + firstChar,
dprintf_info(win16drv, "Char %x: width %d\n", i + firstChar,
buffer[i]);
}
return wRet;
}
@ -207,7 +207,7 @@ WORD WINAPI WineEnumDFontCallback(LPLOGFONT16 lpLogFont,
LPTEXTMETRIC16 lpTextMetrics,
WORD wFontType, LONG lpClientData)
{
dprintf_win16drv(stddeb, "In WineEnumDFontCallback plf=%p\n", lpLogFont);
dprintf_info(win16drv, "In WineEnumDFontCallback plf=%p\n", lpLogFont);
return (*(((WEPFC *)lpClientData)->proc))( lpLogFont, lpTextMetrics,
wFontType, ((WEPFC *)lpClientData)->lp );
}

View File

@ -7,7 +7,6 @@
#include <stdio.h>
#include "heap.h"
#include "win16drv.h"
#include "stddebug.h"
#include "debug.h"
/**********************************************************************
@ -61,9 +60,9 @@ WIN16DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
BOOL32 bRet = 0;
POINT16 points[2];
dprintf_win16drv(stddeb, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n",
dprintf_info(win16drv, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n",
left, top, dc->w.DCOrgX, dc->w.DCOrgY);
dprintf_win16drv(stddeb, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
dprintf_info(win16drv, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY);
points[0].x = XLPTODP(dc, left);
points[0].y = YLPTODP(dc, top);
@ -153,9 +152,9 @@ WIN16DRV_Ellipse(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
BOOL32 bRet = 0;
POINT16 points[2];
dprintf_win16drv(stddeb, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
dprintf_info(win16drv, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
left, top, dc->w.DCOrgX, dc->w.DCOrgY);
dprintf_win16drv(stddeb, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
dprintf_info(win16drv, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY);
points[0].x = XLPTODP(dc, left);
points[0].y = YLPTODP(dc, top);

View File

@ -21,7 +21,6 @@
#include "font.h"
#include "callback.h"
#include "options.h"
#include "stddebug.h"
#include "debug.h"
#define SUPPORT_REALIZED_FONTS 1
@ -178,7 +177,7 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
return FALSE;
}
dprintf_win16drv(stddeb, "In creatdc for (%s,%s,%s) initData 0x%p\n",driver, device, output, initData);
dprintf_info(win16drv, "In creatdc for (%s,%s,%s) initData 0x%p\n",driver, device, output, initData);
physDev = (WIN16DRV_PDEVICE *)HeapAlloc( SystemHeap, 0, sizeof(*physDev) );
if (!physDev) return FALSE;
@ -187,11 +186,11 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
pLPD = LoadPrinterDriver(driver);
if (pLPD == NULL)
{
dprintf_win16drv(stddeb, "LPGDI_CreateDC: Failed to find printer driver\n");
dprintf_warn(win16drv, "LPGDI_CreateDC: Failed to find printer driver\n");
HeapFree( SystemHeap, 0, physDev );
return FALSE;
}
dprintf_win16drv(stddeb, "windevCreateDC pLPD 0x%p\n", pLPD);
dprintf_info(win16drv, "windevCreateDC pLPD 0x%p\n", pLPD);
/* Now Get the device capabilities from the printer driver */
@ -227,7 +226,7 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
pPDH = (PDEVICE_HEADER *)((BYTE*)PTR_SEG_TO_LIN(physDev->segptrPDEVICE) - sizeof(PDEVICE_HEADER));
pPDH->pLPD = pLPD;
dprintf_win16drv(stddeb, "PRTDRV_Enable: PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE));
dprintf_info(win16drv, "PRTDRV_Enable: PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE));
/* Now get the printer driver to initialise this data */
wRet = PRTDRV_Enable((LPVOID)physDev->segptrPDEVICE, INITPDEVICE, device, driver, output, NULL);
@ -539,7 +538,7 @@ HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC)
HANDLE16 hHandle = (HANDLE16)SP_ERROR;
PPRINTJOB pPrintJob;
dprintf_win16drv(stddeb, "OpenJob: \"%s\" \"%s\" %04x\n", lpOutput, lpTitle, hDC);
dprintf_info(win16drv, "OpenJob: \"%s\" \"%s\" %04x\n", lpOutput, lpTitle, hDC);
pPrintJob = gPrintJobsTable[0];
if (pPrintJob == NULL)
@ -564,7 +563,7 @@ HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC)
gPrintJobsTable[pPrintJob->nIndex] = pPrintJob;
}
}
dprintf_win16drv(stddeb, "OpenJob: return %04x\n", hHandle);
dprintf_info(win16drv, "OpenJob: return %04x\n", hHandle);
return hHandle;
}
@ -573,7 +572,7 @@ int WINAPI CloseJob(HANDLE16 hJob)
int nRet = SP_ERROR;
PPRINTJOB pPrintJob = NULL;
dprintf_win16drv(stddeb, "CloseJob: %04x\n", hJob);
dprintf_info(win16drv, "CloseJob: %04x\n", hJob);
pPrintJob = FindPrintJobFromHandle(hJob);
if (pPrintJob != NULL)
@ -591,7 +590,7 @@ int WINAPI WriteSpool(HANDLE16 hJob, LPSTR lpData, WORD cch)
int nRet = SP_ERROR;
PPRINTJOB pPrintJob = NULL;
dprintf_win16drv(stddeb, "WriteSpool: %04x %08lx %04x\n", hJob, (DWORD)lpData, cch);
dprintf_info(win16drv, "WriteSpool: %04x %08lx %04x\n", hJob, (DWORD)lpData, cch);
pPrintJob = FindPrintJobFromHandle(hJob);
if (pPrintJob != NULL && pPrintJob->fd >= 0 && cch)
@ -608,7 +607,7 @@ int WINAPI WriteDialog(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg)
{
int nRet = 0;
dprintf_win16drv(stddeb, "WriteDialog: %04x %04x \"%s\"\n", hJob, cchMsg, lpMsg);
dprintf_info(win16drv, "WriteDialog: %04x %04x \"%s\"\n", hJob, cchMsg, lpMsg);
nRet = MessageBox16(0, lpMsg, "Printing Error", MB_OKCANCEL);
return nRet;
@ -618,7 +617,7 @@ int WINAPI DeleteJob(HANDLE16 hJob, WORD wNotUsed)
{
int nRet;
dprintf_win16drv(stddeb, "DeleteJob: %04x\n", hJob);
dprintf_info(win16drv, "DeleteJob: %04x\n", hJob);
nRet = FreePrintJob(hJob);
return nRet;
@ -631,13 +630,13 @@ int WINAPI DeleteJob(HANDLE16 hJob, WORD wNotUsed)
*/
int WINAPI StartSpoolPage(HANDLE16 hJob)
{
dprintf_win16drv(stddeb, "StartSpoolPage GDI.246 unimplemented\n");
dprintf_fixme(win16drv, "StartSpoolPage GDI.246 unimplemented\n");
return 1;
}
int WINAPI EndSpoolPage(HANDLE16 hJob)
{
dprintf_win16drv(stddeb, "EndSpoolPage GDI.247 unimplemented\n");
dprintf_fixme(win16drv, "EndSpoolPage GDI.247 unimplemented\n");
return 1;
}
@ -645,6 +644,6 @@ int WINAPI EndSpoolPage(HANDLE16 hJob)
DWORD WINAPI GetSpoolJob(int nOption, LONG param)
{
DWORD retval = 0;
dprintf_win16drv(stddeb, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption);
dprintf_info(win16drv, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption);
return retval;
}

View File

@ -10,7 +10,6 @@
#include "brush.h"
#include "font.h"
#include "pen.h"
#include "stddebug.h"
#include "debug.h"
@ -32,7 +31,7 @@ HGDIOBJ32 WIN16DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
HGDIOBJ32 ret = 0;
if (!ptr) return 0;
dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic)
{

View File

@ -8,7 +8,6 @@
#include "color.h"
#include "win16drv.h"
#include "heap.h"
#include "stddebug.h"
#include "debug.h"
/***********************************************************************
@ -21,7 +20,7 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
int nSize;
LOGPEN16 lPen16;
dc->w.hPen = hpen;
dprintf_win16drv(stddeb, "In WIN16DRV_PEN_SelectObject\n");
dprintf_info(win16drv, "In WIN16DRV_PEN_SelectObject\n");
lPen16.lopnStyle = pen->logpen.lopnStyle;
lPen16.lopnWidth.x = pen->logpen.lopnWidth.x;
lPen16.lopnWidth.y = pen->logpen.lopnWidth.y;
@ -29,7 +28,7 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
if ( physDev->PenInfo )
{
dprintf_win16drv(stddeb, "UnRealizing PenInfo\n");
dprintf_info(win16drv, "UnRealizing PenInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
physDev->PenInfo,
physDev->PenInfo, 0);

View File

@ -15,7 +15,6 @@
#include "heap.h"
#include "brush.h"
#include "callback.h"
#include "stddebug.h"
#include "debug.h"
#include "bitmap.h"
#include "pen.h"
@ -56,7 +55,7 @@ static void GetPrinterDriverFunctions(HINSTANCE16 hInst, LOADED_PRINTER_DRIVER *
LoadPrinterDrvFunc(ADVANCEDSETUPDIALOG);
LoadPrinterDrvFunc(DIALOGFN);
LoadPrinterDrvFunc(PSEUDOEDIT);
dprintf_win16drv (stddeb,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n",
dprintf_info(win16drv,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n",
pLPD->fn[FUNC_CONTROL],
pLPD->fn[FUNC_ENABLE],
pLPD->fn[FUNC_ENUMDFONTS],
@ -79,7 +78,7 @@ static LOADED_PRINTER_DRIVER *FindPrinterDriverFromName(const char *pszDriver)
ptmpLPD = gapLoadedPrinterDrivers[nDriverSlot++];
if (ptmpLPD != NULL)
{
dprintf_win16drv(stddeb, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver);
dprintf_info(win16drv, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver);
/* Found driver store info, exit loop */
if (lstrcmpi32A(ptmpLPD->szDriver, pszDriver) == 0)
pLPD = ptmpLPD;
@ -151,7 +150,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
/* Failed to load driver */
fprintf(stderr, "Failed to load printer driver %s\n", pszDriver);
} else {
dprintf_win16drv(stddeb, "Loaded the library\n");
dprintf_info(win16drv, "Loaded the library\n");
/* Allocate some memory for printer driver info */
pLPD = malloc(sizeof(LOADED_PRINTER_DRIVER));
memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER));
@ -162,7 +161,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
/* Get DS for the printer module */
pLPD->ds_reg = hInst;
dprintf_win16drv(stddeb, "DS for %s is %x\n", pszDriver, pLPD->ds_reg);
dprintf_info(win16drv, "DS for %s is %x\n", pszDriver, pLPD->ds_reg);
/* Get address of printer driver functions */
GetPrinterDriverFunctions(hInst, pLPD);
@ -189,20 +188,20 @@ INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPT
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_Control: %08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData);
dprintf_info(win16drv, "PRTDRV_Control: %08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData);
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{
if (pLPD->fn[FUNC_CONTROL] == NULL)
{
dprintf_win16drv(stddeb, "PRTDRV_Control: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_Control: Not supported by driver\n");
return 0;
}
wRet = Callbacks->CallDrvControlProc( pLPD->fn[FUNC_CONTROL],
(SEGPTR)lpDestDev, wfunction,
lpInData, lpOutData );
}
dprintf_win16drv(stddeb, "PRTDRV_Control: return %x\n", wRet);
dprintf_info(win16drv, "PRTDRV_Control: return %x\n", wRet);
return wRet;
}
@ -215,7 +214,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_Enable: %s %s\n",lpDestDevType, lpOutputFile);
dprintf_info(win16drv, "PRTDRV_Enable: %s %s\n",lpDestDevType, lpOutputFile);
/* Get the printer driver info */
if (wStyle == INITPDEVICE)
@ -229,7 +228,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
WORD wP2;
if (!pLPD->fn[FUNC_ENABLE]) {
dprintf_win16drv(stddeb, "PRTDRV_Enable: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_Enable: Not supported by driver\n");
return 0;
}
@ -260,7 +259,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
SEGPTR_FREE(lP1);
}
}
dprintf_win16drv(stddeb, "PRTDRV_Enable: return %x\n", wRet);
dprintf_info(win16drv, "PRTDRV_Enable: return %x\n", wRet);
return wRet;
}
@ -274,7 +273,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: %08lx %s %p %p\n",
dprintf_info(win16drv, "PRTDRV_EnumDFonts: %08lx %s %p %p\n",
lpDestDev, lpFaceName, lpCallbackFunc, lpClientData);
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
@ -283,7 +282,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
LPBYTE lP2;
if (pLPD->fn[FUNC_ENUMDFONTS] == NULL) {
dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_EnumDFonts: Not supported by driver\n");
return 0;
}
@ -300,7 +299,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
} else
fprintf(stderr,"Failed to find device\n");
dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: return %x\n", wRet);
dprintf_info(win16drv, "PRTDRV_EnumDFonts: return %x\n", wRet);
return wRet;
}
/*
@ -312,7 +311,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_EnumObj:\n");
dprintf_info(win16drv, "PRTDRV_EnumObj:\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{
@ -322,7 +321,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
if (pLPD->fn[FUNC_ENUMOBJ] == NULL)
{
dprintf_win16drv(stddeb, "PRTDRV_EnumObj: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_EnumObj: Not supported by driver\n");
return 0;
}
@ -343,7 +342,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
else
fprintf(stderr,"Failed to find device\n");
dprintf_win16drv(stddeb, "PRTDRV_EnumObj: return %x\n", wRet);
dprintf_info(win16drv, "PRTDRV_EnumObj: return %x\n", wRet);
return wRet;
}
@ -362,7 +361,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_OUTPUT %d\n", wStyle );
dprintf_info(win16drv, "PRTDRV_OUTPUT %d\n", wStyle );
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{
@ -373,7 +372,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
int nSize;
if (pLPD->fn[FUNC_OUTPUT] == NULL)
{
dprintf_win16drv(stddeb, "PRTDRV_Output: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_Output: Not supported by driver\n");
return 0;
}
@ -416,7 +415,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
{
CONV_RECT32TO16( pRect, lP8 );
dprintf_win16drv(stddeb, "rect = %d,%d - %d,%d\n",
dprintf_info(win16drv, "rect = %d,%d - %d,%d\n",
lP8->left, lP8->top, lP8->right, lP8->bottom );
wRet = Callbacks->CallDrvOutputProc(pLPD->fn[FUNC_OUTPUT],
lP1, wP2, wP3, SEGPTR_GET(lP4),
@ -434,7 +433,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
}
SEGPTR_FREE(lP4);
}
dprintf_win16drv(stddeb, "PRTDRV_Output return %d\n", wRet);
dprintf_info(win16drv, "PRTDRV_Output return %d\n", wRet);
return wRet;
}
@ -448,7 +447,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
WORD dwRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb,
dprintf_info(win16drv,
"PRTDRV_RealizeObject: %08lx %04x %p %p %08lx\n",
lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm);
@ -461,7 +460,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL)
{
dprintf_win16drv(stddeb,
dprintf_warn(win16drv,
"PRTDRV_RealizeObject: Not supported by driver\n");
return 0;
}
@ -507,7 +506,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
lP4 = SEGPTR_GET( lpOutObj );
lP5 = lpTextXForm;
dprintf_win16drv(stddeb,
dprintf_info(win16drv,
"Calling Realize %08lx %04x %08lx %08lx %08lx\n",
lP1, wP2, lP3, lP4, lP5);
dwRet = Callbacks->CallDrvRealizeProc(pLPD->fn[FUNC_REALIZEOBJECT],
@ -516,7 +515,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
SEGPTR_FREE(lpBuf);
}
dprintf_win16drv(stddeb, "PRTDRV_RealizeObject: return %x\n", dwRet);
dprintf_info(win16drv, "PRTDRV_RealizeObject: return %x\n", dwRet);
return dwRet;
}
@ -537,7 +536,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_StretchBlt:\n");
dprintf_info(win16drv, "PRTDRV_StretchBlt:\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{
@ -547,7 +546,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
if (pLPD->fn[FUNC_STRETCHBLT] == NULL)
{
dprintf_win16drv(stddeb, "PRTDRV_StretchBlt: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_StretchBlt: Not supported by driver\n");
return 0;
}
lP1 = lpDestDev;
@ -591,7 +590,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
DWORD dwRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut:\n");
dprintf_info(win16drv, "PRTDRV_ExtTextOut:\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{
@ -604,7 +603,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
if (pLPD->fn[FUNC_EXTTEXTOUT] == NULL)
{
dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut: Not supported by driver\n");
dprintf_warn(win16drv, "PRTDRV_ExtTextOut: Not supported by driver\n");
return 0;
}
@ -614,7 +613,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
if (lpClipRect != NULL) {
lP4 = SEGPTR_NEW(RECT16);
dprintf_win16drv(stddeb, "Adding lpClipRect\n");
dprintf_info(win16drv, "Adding lpClipRect\n");
memcpy(lP4,lpClipRect,sizeof(RECT16));
} else
lP4 = 0L;
@ -624,7 +623,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
if (nSize>abs(wCount))
nSize = abs(wCount);
lP5 = SEGPTR_ALLOC(nSize+1);
dprintf_win16drv(stddeb, "Adding lpString (nSize is %d)\n",nSize);
dprintf_info(win16drv, "Adding lpString (nSize is %d)\n",nSize);
memcpy(lP5,lpString,nSize);
*((char *)lP5 + nSize) = '\0';
} else
@ -638,18 +637,18 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
lP9 = lpTextXForm;
if (lpCharWidths != NULL)
dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut: Char widths not supported\n");
dprintf_fixme(win16drv, "PRTDRV_ExtTextOut: Char widths not supported\n");
lP10 = 0;
if (lpOpaqueRect != NULL) {
lP11 = SEGPTR_NEW(RECT16);
dprintf_win16drv(stddeb, "Adding lpOpaqueRect\n");
dprintf_info(win16drv, "Adding lpOpaqueRect\n");
memcpy(lP11,lpOpaqueRect,sizeof(RECT16));
} else
lP11 = 0L;
wP12 = wOptions;
dprintf_win16drv(stddeb, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n%*s 0x%x 0x%lx 0x%lx\n"
dprintf_info(win16drv, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n%*s 0x%x 0x%lx 0x%lx\n"
"0x%lx 0x%lx %p 0x%x\n",lP1, wP2, wP3, lP4,
nSize,lP5, iP6, lP7, lP8, lP9, lP10,
lP11, wP12);
@ -660,7 +659,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
lP8, lP9, lP10,
SEGPTR_GET(lP11), wP12);
}
dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut: return %lx\n", dwRet);
dprintf_info(win16drv, "PRTDRV_ExtTextOut: return %lx\n", dwRet);
return dwRet;
}
@ -757,7 +756,7 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT32 lpBuffer,
WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_win16drv(stddeb, "PRTDRV_GetCharWidth:\n");
dprintf_info(win16drv, "PRTDRV_GetCharWidth:\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{
@ -767,7 +766,7 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT32 lpBuffer,
if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL)
{
dprintf_win16drv(stddeb,
dprintf_warn(win16drv,
"PRTDRV_GetCharWidth: Not supported by driver\n");
return 0;
}

View File

@ -10,7 +10,6 @@
#include "win16drv.h"
#include "dc.h"
#include "gdi.h"
#include "stddebug.h"
#include "debug.h"
/***********************************************************************
@ -32,7 +31,7 @@ BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
if (count == 0)
return FALSE;
dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n",
dprintf_info(win16drv, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n",
dc->hSelf, x, y, flags, lprect, count > 0 ? count : 8, str, lpDx);
@ -55,7 +54,7 @@ BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
}
dprintf_win16drv(stddeb, "textalign = %d\n", dc->w.textAlign);
dprintf_info(win16drv, "textalign = %d\n", dc->w.textAlign);
if (dc->w.textAlign & TA_UPDATECP)
{

View File

@ -17,7 +17,6 @@
#include "dc.h"
#include "gdi.h"
#include "xmalloc.h"
#include "stddebug.h"
#include "debug.h"
extern void CLIPPING_UpdateGCRegion(DC* );

View File

@ -16,7 +16,6 @@
#include "metafile.h"
#include "options.h"
#include "x11drv.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
@ -1120,12 +1119,12 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
widthDst = widthDst * dcDst->vportExtX / dcDst->wndExtX;
heightDst = heightDst * dcDst->vportExtY / dcDst->wndExtY;
dprintf_bitblt( stddeb, " vportdst=%d,%d-%d,%d wnddst=%d,%d-%d,%d\n",
dprintf_info(bitblt, " vportdst=%d,%d-%d,%d wnddst=%d,%d-%d,%d\n",
dcDst->vportOrgX, dcDst->vportOrgY,
dcDst->vportExtX, dcDst->vportExtY,
dcDst->wndOrgX, dcDst->wndOrgY,
dcDst->wndExtX, dcDst->wndExtY );
dprintf_bitblt( stddeb, " rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
dprintf_info(bitblt, " rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
xDst, yDst, widthDst, heightDst,
dcDst->w.DCOrgX, dcDst->w.DCOrgY );
@ -1136,19 +1135,19 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
widthSrc = widthSrc * dcSrc->vportExtX / dcSrc->wndExtX;
heightSrc = heightSrc * dcSrc->vportExtY / dcSrc->wndExtY;
fStretch = (widthSrc != widthDst) || (heightSrc != heightDst);
dprintf_bitblt( stddeb," vportsrc=%d,%d-%d,%d wndsrc=%d,%d-%d,%d\n",
dprintf_info(bitblt," vportsrc=%d,%d-%d,%d wndsrc=%d,%d-%d,%d\n",
dcSrc->vportOrgX, dcSrc->vportOrgY,
dcSrc->vportExtX, dcSrc->vportExtY,
dcSrc->wndOrgX, dcSrc->wndOrgY,
dcSrc->wndExtX, dcSrc->wndExtY );
dprintf_bitblt( stddeb, " rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
dprintf_info(bitblt, " rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
xSrc, ySrc, widthSrc, heightSrc,
dcSrc->w.DCOrgX, dcSrc->w.DCOrgY );
if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst,
dcSrc, xSrc, ySrc, widthSrc, heightSrc,
&visRectSrc, &visRectDst ))
return TRUE;
dprintf_bitblt( stddeb, " vissrc=%d,%d-%d,%d visdst=%d,%d-%d,%d\n",
dprintf_info(bitblt, " vissrc=%d,%d-%d,%d visdst=%d,%d-%d,%d\n",
visRectSrc.left, visRectSrc.top,
visRectSrc.right, visRectSrc.bottom,
visRectDst.left, visRectDst.top,
@ -1160,7 +1159,7 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst,
NULL, 0, 0, 0, 0, NULL, &visRectDst ))
return TRUE;
dprintf_bitblt( stddeb, " vissrc=none visdst=%d,%d-%d,%d\n",
dprintf_info(bitblt, " vissrc=none visdst=%d,%d-%d,%d\n",
visRectDst.left, visRectDst.top,
visRectDst.right, visRectDst.bottom );
}

View File

@ -13,7 +13,6 @@
#include "dc.h"
#include "bitmap.h"
#include "heap.h"
#include "stddebug.h"
#include "debug.h"
extern void CLIPPING_UpdateGCRegion(DC* );

View File

@ -9,7 +9,6 @@
#include "bitmap.h"
#include "color.h"
#include "x11drv.h"
#include "stddebug.h"
#include "debug.h"
static const char HatchBrushes[NB_HATCH_STYLES + 1][8] =
@ -209,7 +208,7 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
BITMAPINFO * bmpInfo;
HBRUSH16 prevHandle = dc->w.hBrush;
dprintf_gdi(stddeb, "Brush_SelectObject: hdc=%04x hbrush=%04x\n",
dprintf_info(gdi, "Brush_SelectObject: hdc=%04x hbrush=%04x\n",
dc->hSelf,hbrush);
#ifdef NOTDEF
if (dc->header.wMagic == METAFILE_DC_MAGIC)
@ -244,16 +243,16 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
switch(brush->logbrush.lbStyle)
{
case BS_NULL:
dprintf_gdi( stddeb,"BS_NULL\n" );
dprintf_info(gdi,"BS_NULL\n" );
break;
case BS_SOLID:
dprintf_gdi( stddeb,"BS_SOLID\n" );
dprintf_info(gdi,"BS_SOLID\n" );
BRUSH_SelectSolidBrush( dc, brush->logbrush.lbColor );
break;
case BS_HATCHED:
dprintf_gdi( stddeb, "BS_HATCHED\n" );
dprintf_info(gdi, "BS_HATCHED\n" );
dc->u.x.brush.pixel = COLOR_ToPhysical( dc, brush->logbrush.lbColor );
dc->u.x.brush.pixmap = TSXCreateBitmapFromData( display, rootWindow,
HatchBrushes[brush->logbrush.lbHatch], 8, 8 );
@ -261,12 +260,12 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush )
break;
case BS_PATTERN:
dprintf_gdi( stddeb, "BS_PATTERN\n");
dprintf_info(gdi, "BS_PATTERN\n");
BRUSH_SelectPatternBrush( dc, (HBRUSH16)brush->logbrush.lbHatch );
break;
case BS_DIBPATTERN:
dprintf_gdi( stddeb, "BS_DIBPATTERN\n");
dprintf_info(gdi, "BS_DIBPATTERN\n");
if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)brush->logbrush.lbHatch )))
{
int size = DIB_BitmapInfoSize( bmpInfo, brush->logbrush.lbColor );

View File

@ -8,7 +8,6 @@
#include "dc.h"
#include "x11drv.h"
#include "region.h"
#include "stddebug.h"
#include "debug.h"
#include "heap.h"

View File

@ -25,7 +25,6 @@
#include "bitmap.h"
#include "callback.h"
#include "metafile.h"
#include "stddebug.h"
#include "palette.h"
#include "color.h"
#include "region.h"
@ -271,7 +270,7 @@ BOOL32
X11DRV_RoundRect( DC *dc, INT32 left, INT32 top, INT32 right,
INT32 bottom, INT32 ell_width, INT32 ell_height )
{
dprintf_graphics(stddeb, "X11DRV_RoundRect(%d %d %d %d %d %d\n",
dprintf_info(graphics, "X11DRV_RoundRect(%d %d %d %d %d %d\n",
left, top, right, bottom, ell_width, ell_height);
left = XLPTODP( dc, left );
@ -695,7 +694,7 @@ X11DRV_ExtFloodFill( DC *dc, INT32 x, INT32 y, COLORREF color,
BOOL32 result;
struct FloodFill_params params = { dc, x, y, color, fillType };
dprintf_graphics( stddeb, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
dprintf_info(graphics, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
x, y, color, fillType );
if (!PtVisible32( dc->hSelf, x, y )) return FALSE;

View File

@ -10,7 +10,6 @@
#include "brush.h"
#include "font.h"
#include "pen.h"
#include "stddebug.h"
#include "debug.h"
@ -32,7 +31,7 @@ HGDIOBJ32 X11DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
HGDIOBJ32 ret = 0;
if (!ptr) return 0;
dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic)
{

View File

@ -6,7 +6,6 @@
#include "pen.h"
#include "color.h"
#include "stddebug.h"
#include "debug.h"
static const char PEN_dash[] = { 5,3 }; /* ----- ----- ----- */

View File

@ -13,8 +13,6 @@
/*#include "callback.h"*/
#include "heap.h"
#include "x11font.h"
#include "stddebug.h"
/* #define DEBUG_TEXT */
#include "debug.h"
#define SWAP_INT(a,b) { int t = a; a = b; b = t; }
@ -45,10 +43,10 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
lfUnderline = (pfo->fo_flags & FO_SYNTH_UNDERLINE) ? 1 : 0;
lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0;
dprintf_text(stddeb,"ExtTextOut: hdc=%04x df=%04x %d,%d '%.*s', %d flags=%d\n",
dprintf_info(text,"ExtTextOut: hdc=%04x df=%04x %d,%d '%.*s', %d flags=%d\n",
dc->hSelf, (UINT16)(dc->u.x.font), x, y, (int)count, str, count, flags);
if (lprect != NULL) dprintf_text(stddeb, "\trect=(%d,%d- %d,%d)\n",
if (lprect != NULL) dprintf_info(text, "\trect=(%d,%d- %d,%d)\n",
lprect->left, lprect->top,
lprect->right, lprect->bottom );
/* Setup coordinates */
@ -87,7 +85,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
x = XLPTODP( dc, x );
y = YLPTODP( dc, y );
dprintf_text(stddeb,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
dprintf_info(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
x, y, rect.left, rect.top, rect.right, rect.bottom);
/* Draw the rectangle */

View File

@ -22,7 +22,6 @@
#include "options.h"
#include "x11font.h"
#include "font.h"
#include "stddebug.h"
#include "debug.h"
#define DEBUG_FONT_INIT 1
@ -524,7 +523,7 @@ static BOOL32 LFD_ComposeLFD( fontObject* fo,
sprintf( lpch, "%i-*-*-*-*-*-%s*", fo->fi->lfd_height, lpEncoding );
}
dprintf_font(stddeb,"\tLFD: %s\n", lpLFD );
dprintf_info(font,"\tLFD: %s\n", lpLFD );
return TRUE;
}
@ -826,7 +825,7 @@ static void XFONT_WindowsNames( char* buffer )
}
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb,"typeface \'%s\'\n", fr->lfFaceName);
dprintf_info(font,"typeface \'%s\'\n", fr->lfFaceName);
#endif
fr->fr_flags |= FR_NAMESET;
}
@ -867,7 +866,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias )
if( !lstrcmpi32A( pfa->faTypeFace, lpAlias ) )
{
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb,"\tredundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace );
dprintf_info(font,"\tredundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace );
#endif
return NULL;
}
@ -887,7 +886,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias )
lstrcpy32A( pfa->faAlias, lpAlias );
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb, "\tadded alias '%s' for %s\n", lpAlias, lpTypeFace );
dprintf_info(font, "\tadded alias '%s' for %s\n", lpAlias, lpTypeFace );
#endif
return pfa;
}
@ -989,7 +988,7 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
}
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb, "\tsubstituted '%s' with %s\n",
dprintf_info(font, "\tsubstituted '%s' with %s\n",
frMatch->lfFaceName, lpAlias );
#endif
lstrcpyn32A( frMatch->lfFaceName, lpAlias, LF_FACESIZE );
@ -1063,7 +1062,7 @@ static BOOL32 XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int
fontResource* pfr = fontList;
fontInfo* pfi = NULL;
dprintf_font(stddeb,"Reading cached font metrics:\n");
dprintf_info(font,"Reading cached font metrics:\n");
read( fd, fontList, i); /* read all metrics at once */
while( offset < length )
@ -1103,7 +1102,7 @@ static BOOL32 XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int
offset += sizeof(int);
for( pfr = fontList; pfr; pfr = pfr->next )
{
dprintf_font(stddeb,"\t%s, %i instances\n", lpch, pfr->count );
dprintf_info(font,"\t%s, %i instances\n", lpch, pfr->count );
pfr->resource = lpch;
while( TRUE )
{
@ -1159,13 +1158,13 @@ static BOOL32 XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count
i += n_ff * sizeof(fontResource) + j * sizeof(fontInfo) + sizeof(int);
write( fd, &i, sizeof(int) );
dprintf_font(stddeb,"Writing font cache:\n");
dprintf_info(font,"Writing font cache:\n");
for( pfr = fontList; pfr; pfr = pfr->next )
{
fontInfo fi;
dprintf_font(stddeb,"\t%s, %i instances\n", pfr->resource, pfr->count );
dprintf_info(font,"\t%s, %i instances\n", pfr->resource, pfr->count );
i = write( fd, pfr, sizeof(fontResource) );
if( i == sizeof(fontResource) )
@ -1324,7 +1323,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
x_pattern = TSXListFonts(display, "*", MAX_FONT_FAMILIES * 16, &x_count );
dprintf_font(stddeb,"Font Mapper: initializing %i fonts [LPY=%i, XDR=%i, DR=%i]\n",
dprintf_info(font,"Font Mapper: initializing %i fonts [LPY=%i, XDR=%i, DR=%i]\n",
x_count, pDevCaps->logPixelsY, DefResolution, res);
for( i = x_checksum = 0; i < x_count; i++ )
{
@ -1397,7 +1396,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
lstrcpyn32A( fr->resource, typeface, j + 1 );
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb," family: %s\n", fr->resource );
dprintf_info(font," family: %s\n", fr->resource );
#endif
if( pfr ) pfr->next = fr;
@ -1441,7 +1440,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
TSXFreeFont( display, x_fs );
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb,"\t[% 2ipt] '%s'\n", fi->df.dfPoints, typeface );
dprintf_info(font,"\t[% 2ipt] '%s'\n", fi->df.dfPoints, typeface );
#endif
XFONT_CheckFIList( fr, fi, REMOVE_SUBSETS );
fi = NULL; /* preventing reuse */
@ -1486,7 +1485,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
XFONT_GrowFreeList(0, fontCacheSize - 1);
#ifdef DEBUG_FONT_INIT
dprintf_font(stddeb,"done!\n");
dprintf_info(font,"done!\n");
#endif
/* update text caps parameter */
@ -1550,7 +1549,7 @@ static UINT32 XFONT_Match( fontMatch* pfm )
BOOL32 bScale = pfi->fi_flags & FI_SCALABLE;
INT32 d, h;
dprintf_font( stddeb,"\t[ %-2ipt h=%-3i w=%-3i %s%s]", pfi->df.dfPoints,
dprintf_info(font,"\t[ %-2ipt h=%-3i w=%-3i %s%s]\n", pfi->df.dfPoints,
pfi->df.dfPixHeight, pfi->df.dfAvgWidth,
(pfi->df.dfWeight > 400) ? "Bold " : "Normal ",
(pfi->df.dfItalic) ? "Italic" : "" );
@ -1640,7 +1639,7 @@ static UINT32 XFONT_Match( fontMatch* pfm )
if( penalty && pfi->lfd_resolution != DefResolution )
penalty++;
dprintf_font(stddeb,"-> %i\n", penalty );
dprintf_info(font," returning %i\n", penalty );
return penalty;
}
@ -1718,7 +1717,7 @@ static void XFONT_CheckFIList( fontResource* fr, fontInfo* fi, int action)
}
#ifdef DEBUG_FONT_INIT
if( i ) dprintf_font(stddeb,"\t purged %i subsets [%i]\n", i , fr->count);
if( i ) dprintf_info(font,"\t purged %i subsets [%i]\n", i , fr->count);
#endif
}
@ -1761,7 +1760,7 @@ static BOOL32 XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm )
if( fm.pfr ) /* match family */
{
dprintf_font(stddeb, "%s\n", fm.pfr->lfFaceName );
dprintf_info(font, "%s\n", fm.pfr->lfFaceName );
XFONT_MatchFIList( &fm );
*pfm = fm;
@ -1775,7 +1774,7 @@ static BOOL32 XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm )
for( start = fontList; start && score; start = start->next )
{
fm.pfr = start;
dprintf_font(stddeb, "%s\n", fm.pfr->lfFaceName );
dprintf_info(font, "%s\n", fm.pfr->lfFaceName );
current_score = XFONT_MatchFIList( &fm );
if( current_score < score )
@ -1850,7 +1849,7 @@ static fontObject* XFONT_GetCacheEntry()
{
int prev_i, prev_j, j;
dprintf_font(stddeb,"font cache is full\n");
dprintf_info(font,"font cache is full\n");
/* lookup the least recently used font */
@ -1869,7 +1868,7 @@ static fontObject* XFONT_GetCacheEntry()
{
/* detach from the lru list */
dprintf_font(stddeb,"\tfreeing entry %i\n", j );
dprintf_info(font,"\tfreeing entry %i\n", j );
if( prev_j >= 0 )
fontCache[prev_j].lru = fontCache[j].lru;
@ -1887,7 +1886,7 @@ static fontObject* XFONT_GetCacheEntry()
prev_i = fontCacheSize + FONTCACHE;
dprintf_font(stddeb,"\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i );
dprintf_info(font,"\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i );
if( (newCache = (fontObject*)HeapReAlloc(SystemHeap, 0,
fontCache, prev_i)) )
@ -1942,7 +1941,7 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf )
{
UINT32 uRelaxLevel = 0;
dprintf_font(stddeb,"XRealizeFont: (%u) '%s' h=%i weight=%i %s\n",
dprintf_info(font,"XRealizeFont: (%u) '%s' h=%i weight=%i %s\n",
plf->lfCharSet, plf->lfFaceName, plf->lfHeight,
plf->lfWeight, (plf->lfItalic) ? "Italic" : "" );
@ -2020,7 +2019,7 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf )
pfo->lru = fontMRU;
fontMRU = (pfo - fontCache);
dprintf_font(stddeb,"physfont %i\n", fontMRU);
dprintf_info(font,"physfont %i\n", fontMRU);
return (X_PHYSFONT)(X_PFONT_MAGIC | fontMRU);
}

View File

@ -18,7 +18,6 @@
#include "stackframe.h"
#include "user.h"
#include "process.h"
#include "stddebug.h"
#include "debug.h"
/* Built-in modules descriptors */
@ -142,7 +141,7 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
if (!hModule) return 0;
FarSetOwner( hModule, hModule );
dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n",
dprintf_info(module, "Built-in %s: hmodule=%04x\n",
descr->name, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->self = hModule;
@ -186,6 +185,8 @@ BOOL32 BUILTIN_Init(void)
WORD vector;
HMODULE16 hModule;
fnBUILTIN_LoadModule = BUILTIN_LoadModule;
for (dll = BuiltinDLLs; dll->descr; dll++)
{
if (dll->flags & DLL_FLAG_ALWAYS_USED)

View File

@ -2,10 +2,10 @@ name compobj
type win16
1 pascal CoBuildVersion() CoBuildVersion
2 pascal CoInitialize(long) CoInitialize
2 pascal CoInitialize(long) CoInitialize16
3 pascal CoUninitialize() CoUnitialize
4 pascal CoGetMalloc(long ptr) CoGetMalloc
5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject
4 pascal CoGetMalloc(long ptr) CoGetMalloc16
5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16
6 stub COREVOKECLASSOBJECT
7 stub COGETCLASSOBJECT
8 stub COMARSHALINTERFACE
@ -19,8 +19,8 @@ type win16
16 stub CORELEASEMARSHALDATA
17 pascal16 COFREEUNUSEDLIBRARIES() CoFreeUnusedLibraries
18 pascal16 IsEqualGUID(ptr ptr) IsEqualGUID
19 pascal StringFromCLSID(ptr ptr) StringFromCLSID
20 pascal CLSIDFromString(str ptr) CLSIDFromString
19 pascal StringFromCLSID(ptr ptr) StringFromCLSID16
20 pascal CLSIDFromString(str ptr) CLSIDFromString16
21 stub ISVALIDPTRIN
22 stub ISVALIDPTROUT
23 stub ISVALIDINTERFACE
@ -61,7 +61,7 @@ type win16
58 stub _IID_IDFRESERVED2
59 stub _IID_IDFRESERVED3
60 stub _IID_IMESSAGEFILTER
61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID
61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16
62 stub PROGIDFROMCLSID
63 stub COLOCKOBJECTEXTERNAL
64 stub _CLSID_STDMARSHAL
@ -147,3 +147,14 @@ type win16
201 pascal CALLOBJECTINWOW(ptr ptr) CallObjectInWOW
204 stub COMPOBJ_204
207 stub COMPOBJ_207
# WINE internal relays (for Win16 interfaces)
500 cdecl IMalloc16_QueryInterface(ptr ptr ptr) IMalloc16_QueryInterface
501 cdecl IMalloc16_AddRef(ptr) IMalloc16_AddRef
502 cdecl IMalloc16_Release(ptr) IMalloc16_Release
503 cdecl IMalloc16_Alloc(ptr long) IMalloc16_Alloc
504 cdecl IMalloc16_Realloc(ptr segptr long) IMalloc16_Realloc
505 cdecl IMalloc16_Free(ptr segptr) IMalloc16_Free
506 cdecl IMalloc16_GetSize(ptr segptr) IMalloc16_GetSize
507 cdecl IMalloc16_DidAlloc(ptr segptr) IMalloc16_DidAlloc
508 cdecl IMalloc16_HeapMinimize(ptr) IMalloc16_HeapMinimize

View File

@ -2,7 +2,7 @@
#include "wintypes.h"
long WINAPI stub_GDI_379(void) { fprintf(stderr, "Warning: GDI_379:STARTPAGE unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_380(void) { fprintf(stderr, "Warning: GDI_380:ENDPAGE unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_381(void) { fprintf(stderr, "Warning: GDI_381:SETABORTPROC unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_381(HDC16 hdc, SEGPTR proc) { fprintf(stderr, "Warning: GDI_381:SETABORTPROC unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_382(void) { fprintf(stderr, "Warning: GDI_382:ABORTPROC unimplemented stub\n"); return 1; }
long WINAPI stub_GDI_530(void) { fprintf(stderr, "Warning: GDI_530: unimplemented stub\n"); return 0; }
long WINAPI stub_GDI_531(void) { fprintf(stderr, "Warning: GDI_531: unimplemented stub\n"); return 0; }
@ -46,4 +46,3 @@ long WINAPI stub_USER_920(void) { fprintf(stderr, "Warning: USER_920: unimplemen
long WINAPI stub_USER_922(void) { fprintf(stderr, "Warning: USER_922: unimplemented stub\n"); return 0; }
long WINAPI stub_USER_923(void) { fprintf(stderr, "Warning: USER_923: unimplemented stub\n"); return 0; }
long WINAPI stub_KERNEL_700(void) { fprintf(stderr, "Warning: KERNEL_700: unimplemented stub\n"); return 1; }
long WINAPI stub_KERNEL_449(void) { fprintf(stderr, "Warning: KERNEL_449: unimplemented stub\n"); return 0; }

View File

@ -260,7 +260,7 @@ file gdi.exe
378 pascal16 EndDoc(word) EndDoc16
379 pascal16 StartPage() stub_GDI_379
380 pascal16 EndPage() stub_GDI_380
381 pascal16 SetAbortProc() stub_GDI_381
381 pascal16 SetAbortProc(word segptr) stub_GDI_381
382 pascal16 AbortDoc() stub_GDI_382
400 pascal16 FastWindowFrame(word ptr s_word s_word long) FastWindowFrame
401 stub GDIMOVEBITMAP

View File

@ -260,7 +260,7 @@ file krnl386.exe
337 pascal16 IsBadStringPtr(segptr word) IsBadStringPtr16
338 stub HasGPHandler
339 pascal16 DiagQuery() DiagQuery
340 pascal16 DiagOutput() DiagOutput
340 pascal16 DiagOutput(str) DiagOutput
341 pascal ToolHelpHook(ptr) ToolHelpHook
342 stub __GP
343 stub RegisterWinOldApHook
@ -308,14 +308,16 @@ file krnl386.exe
445 stub KERNEL_445
446 stub KERNEL_446
447 stub KERNEL_447
449 pascal KERNEL_449() stub_KERNEL_449
449 pascal KERNEL_449() KERNEL_449
450 pascal16 KERNEL_450() stub_KERNEL_450
454 stub KERNEL_454
455 stub KERNEL_455
471 stub KERNEL_471
471 pascal KERNEL_471() _KERNEL_471
472 register KERNEL_472() _KERNEL_472
473 stub KERNEL_473
475 stub KERNEL_475
480 stub KERNEL_480
481 stub KERNEL_481
482 stub KERNEL_482
485 stub KERNEL_485
491 stub RegisterServiceProcess

View File

@ -13,13 +13,11 @@
#include "module.h"
#include "stackframe.h"
#include "task.h"
#include "stddebug.h"
/* #define DEBUG_RELAY */
#include "debug.h"
#if 0
/* Make make_debug think these were really used */
dprintf_relay
dprintf_info(relay, "test - dummy");
#endif
@ -83,7 +81,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
char *args16;
int i;
if (!debugging_relay) return;
if (!debugging_info(relay)) return;
frame = CURRENT_STACK16;
printf( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs,
@ -201,7 +199,7 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT *context)
STACK16FRAME *frame;
WORD ordinal;
if (!debugging_relay) return;
if (!debugging_info(relay)) return;
frame = CURRENT_STACK16;
printf( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
@ -259,7 +257,7 @@ void RELAY_DebugCallTo16( int* stack, int nb_args )
{
THDB *thdb;
if (!debugging_relay) return;
if (!debugging_info(relay)) return;
thdb = THREAD_Current();
if (nb_args == -1) /* Register function */
@ -385,7 +383,7 @@ void WINAPI Throw( CONTEXT *context )
if (lpbuf[8] != SS_reg(context))
fprintf( stderr, "Switching stack segment with Throw() not supported; expect crash now\n" );
if (debugging_relay) /* Make sure we have a valid entry point address */
if (debugging_info(relay)) /* Make sure we have a valid entry point address */
{
static FARPROC16 entryPoint = NULL;
@ -410,12 +408,13 @@ static DWORD RELAY_CallProc32W(int Ex)
DWORD *args, ret;
VA_LIST16 valist;
int i;
dbg_decl_str(relay, 1024);
VA_START16( valist );
nrofargs = VA_ARG16( valist, DWORD );
argconvmask = VA_ARG16( valist, DWORD );
proc32 = VA_ARG16( valist, FARPROC32 );
dprintf_relay(stddeb,"CallProc32W(%ld,%ld,%p, Ex%d args[",nrofargs,argconvmask,proc32,Ex);
dsprintf(relay, "CallProc32W(%ld,%ld,%p, Ex%d args[",nrofargs,argconvmask,proc32,Ex);
args = (DWORD*)HEAP_xalloc( GetProcessHeap(), 0,
sizeof(DWORD)*nrofargs );
for (i=0;i<nrofargs;i++) {
@ -423,15 +422,15 @@ static DWORD RELAY_CallProc32W(int Ex)
{
SEGPTR ptr = VA_ARG16( valist, SEGPTR );
args[nrofargs-i-1] = (DWORD)PTR_SEG_TO_LIN(ptr);
dprintf_relay(stddeb,"%08lx(%p),",ptr,PTR_SEG_TO_LIN(ptr));
dsprintf(relay,"%08lx(%p),",ptr,PTR_SEG_TO_LIN(ptr));
}
else
{
args[nrofargs-i-1] = VA_ARG16( valist, DWORD );
dprintf_relay(stddeb,"%ld,",args[nrofargs-i-1]);
dsprintf(relay,"%ld,",args[nrofargs-i-1]);
}
}
dprintf_relay(stddeb,"]) - ");
dsprintf(relay,"])");
VA_END16( valist );
switch (nrofargs) {
@ -469,7 +468,7 @@ static DWORD RELAY_CallProc32W(int Ex)
if (!Ex) STACK16_POP( THREAD_Current(),
(3 + nrofargs) * sizeof(DWORD) );
dprintf_relay(stddeb,"returns %08lx\n",ret);
dprintf_info(relay,"%s - returns %08lx\n",dbg_str(relay),ret);
HeapFree( GetProcessHeap(), 0, args );
return ret;
}

View File

@ -1,13 +1,60 @@
# Compound Storage DLL.
# (FIXME: some methods are commented out. Commenting them in _WILL_
# result in dataloss. Do it at your own risk.)
name storage
type win16
1 stub StgCreateDocFile
1 pascal StgCreateDocFileA(str long long ptr) StgCreateDocFile16
2 stub StgCreateDocFileOnILockBytes
3 stub StgOpenStorage
3 pascal StgOpenStorage(str ptr long ptr long ptr) StgOpenStorage16
4 stub StgOpenStorageOnILockBytes
5 stub StgIsStorageFile
5 pascal StgIsStorageFile(str) StgIsStorageFile16
6 stub StgIsStorageILockBytes
7 stub StgSetTimes
#8 WEP
#9 ___EXPORTEDSTUB
103 stub DllGetClassObject
# Storage Interface functions. Starting at 500
# these are not exported in the real storage.dll, we use them
# as 16->32 relays. They use the cdecl calling convention.
# IStorage
500 cdecl IStorage16_QueryInterface(ptr ptr ptr) IStorage16_QueryInterface
501 cdecl IStorage16_AddRef(ptr) IStorage16_AddRef
502 cdecl IStorage16_Release(ptr) IStorage16_Release
#503 cdecl IStorage16_CreateStream(ptr str long long long ptr) IStorage16_CreateStream
503 stub IStorage16_CreateStream
504 cdecl IStorage16_OpenStream(ptr str ptr long long ptr) IStorage16_OpenStream
#505 cdecl IStorage16_CreateStorage(ptr str long long long ptr) IStorage16_CreateStorage
505 stub IStorage16_CreateStorage
506 cdecl IStorage16_OpenStorage(ptr str ptr long ptr long ptr) IStorage16_OpenStorage
507 cdecl IStorage16_CopyTo(ptr long ptr ptr ptr) IStorage16_CopyTo
508 stub IStorage16_MoveElementTo
509 cdecl IStorage16_Commit(ptr long) IStorage16_Commit
510 stub IStorage16_Revert
511 stub IStorage16_EnumElements
512 stub IStorage16_DestroyElement
513 stub IStorage16_RenameElement
514 stub IStorage16_SetElementTimes
515 stub IStorage16_SetClass
516 stub IStorage16_SetStateBits
517 cdecl IStorage16_Stat(ptr ptr long) IStorage16_Stat
# IStream
518 cdecl IStream16_QueryInterface(ptr ptr ptr) IStream16_QueryInterface
519 cdecl IStream16_AddRef(ptr) IStream16_AddRef
520 cdecl IStream16_Release(ptr) IStream16_Release
521 cdecl IStream16_Read(ptr ptr long ptr) IStream16_Read
#522 cdecl IStream16_Write(ptr ptr long ptr) IStream16_Write
522 stub IStream16_Write
523 cdecl IStream16_Seek(ptr long long long ptr) IStream16_Seek
524 stub IStream16_SetSize
525 stub IStream16_CopyTo
526 stub IStream16_Commit
527 stub IStream16_Revert
528 stub IStream16_LockRegion
529 stub IStream16_UnlockRegion
530 stub IStream16_Stat
531 stub IStream16_Clone

View File

@ -18,7 +18,6 @@
#include "task.h"
#include "except.h"
#include "win.h"
#include "stddebug.h"
#include "debug.h"
@ -227,7 +226,7 @@ static void THUNK_Free( THUNK *thunk )
return;
}
}
dprintf_thunk( stddeb, "THUNK_Free: invalid thunk addr %p\n", thunk );
dprintf_err(thunk, "THUNK_Free: invalid thunk addr %p\n", thunk );
}
@ -626,7 +625,7 @@ static BOOL32 WINAPI THUNK_WOWCallback16Ex(
LPDWORD args = (LPDWORD)xargs;
DWORD ret,i;
dprintf_relay(stddeb,"WOWCallback16Ex(%p,0x%08lx,%ld,%p,%p)\n",
dprintf_info(relay,"WOWCallback16Ex(%p,0x%08lx,%ld,%p,%p)\n",
proc,dwFlags,cbArgs,xargs,pdwret
);
if (dwFlags == WCB16_CDECL) {

View File

@ -5,7 +5,7 @@ type win16
2 stub ISPEFORMAT
3 stub EXECPE
4 stub GETPEEXEINFO
5 stub GETW32SYSVERSION
5 return GETW32SYSVERSION 0 0x100
6 stub LOADPERESOURCE
7 stub GETPERESOURCETABLE
8 stub EXECPEEX

View File

@ -17,3 +17,6 @@
/* Define if you have the Open Sound system. */
#undef HAVE_OSS
/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */
#undef NO_REENTRANT_X11

View File

@ -1,4 +1,4 @@
#if !defined(COMPOBJ_H)
#ifndef COMPOBJ_H
#define COMPOBJ_H
#include "ole.h"
@ -15,9 +15,14 @@ typedef struct tagGUID GUID,*LPGUID,*REFGUID;
typedef struct tagGUID CLSID,*LPCLSID,*REFCLSID;
typedef struct tagGUID IID,*REFIID,*LPIID;
OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR);
OLESTATUS WINAPI CLSIDFromString(const LPCSTR, CLSID *);
OLESTATUS WINAPI StringFromCLSID16(const CLSID *id, LPOLESTR16*);
OLESTATUS WINAPI StringFromCLSID32(const CLSID *id, LPOLESTR32*);
#define StringFromCLSID WINELIB_NAME(StringFromCLSID)
OLESTATUS WINAPI CLSIDFromString16(LPCOLESTR16, CLSID *);
OLESTATUS WINAPI CLSIDFromString32(LPCOLESTR32, CLSID *);
#define CLSIDFromString WINELIB_NAME(CLSIDFromString)
OLESTATUS WINAPI WINE_StringFromCLSID(const CLSID *id, LPSTR);
#ifdef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \

View File

@ -30,6 +30,9 @@
/* Define if you have the Open Sound system. */
#undef HAVE_OSS
/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */
#undef NO_REENTRANT_X11
/* Define if you have the clone function. */
#undef HAVE_CLONE

View File

@ -813,6 +813,7 @@ struct IDirectDrawPalette {
DWORD ref;
LPDIRECTDRAW ddraw;
Colormap cm;
PALETTEENTRY palents[256];
};
#undef THIS

File diff suppressed because it is too large Load Diff

197
include/debugdefs.h Normal file
View File

@ -0,0 +1,197 @@
/* Do not modify this file -- it is automatically generated! */
#ifndef __DEBUGTOOLS_H
#include "debugtools.h"
#endif
#define DEBUG_CHANNEL_COUNT 89
#ifdef DEBUG_RUNTIME
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},
{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},
{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},
{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},
{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},
{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},
{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},
{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},
{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},
{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[] = {
"accel",
"aspi",
"atom",
"bitblt",
"bitmap",
"caret",
"cdaudio",
"class",
"clipboard",
"clipping",
"combo",
"comm",
"commdlg",
"console",
"crtdll",
"cursor",
"dc",
"dde",
"ddraw",
"dialog",
"dll",
"dosfs",
"driver",
"dsound",
"edit",
"event",
"exec",
"file",
"fixup",
"font",
"gdi",
"global",
"graphics",
"heap",
"hook",
"icon",
"int",
"key",
"keyboard",
"ldt",
"listbox",
"local",
"mci",
"mcianim",
"mciwave",
"mdi",
"menu",
"message",
"metafile",
"midi",
"mmaux",
"mmio",
"mmsys",
"mmtime",
"module",
"msg",
"nonclient",
"ole",
"palette",
"profile",
"progress",
"prop",
"reg",
"region",
"relay",
"resource",
"scroll",
"selector",
"sem",
"sendmsg",
"shm",
"stddeb",
"stress",
"string",
"task",
"text",
"thunk",
"timer",
"toolhelp",
"tweak",
"updown",
"ver",
"virtual",
"vxd",
"win",
"win16drv",
"win32",
"winsock",
"x11",
};
const char* debug_cl_name[] =
{ "fixme", "err", "warn", "info" };
#endif /*DEBUG_RUNTIME*/
/* end of automatically generated debug.h */

View File

@ -11,5 +11,8 @@ LPSTR debugstr_an (LPCSTR s, int n);
LPSTR debugstr_a (LPCSTR s);
LPSTR debugstr_wn (LPCWSTR s, int n);
LPSTR debugstr_w (LPCWSTR s);
LPSTR debugres (const void *res);
#endif /* __WINE_DEBUGSTR_H */

66
include/debugtools.h Normal file
View File

@ -0,0 +1,66 @@
#ifndef __DEBUGTOOLS_H
#define __DEBUGTOOLS_H
#include <stdio.h>
#define DEBUG_RUNTIME
#define stddeb stdout
#define stdnimp stdout
#define DEBUG_CLASS_COUNT 4
extern short debug_msg_enabled[][DEBUG_CLASS_COUNT];
extern const char* debug_ch_name[];
extern const char* debug_cl_name[];
#define dbg_str(name) debug_str_##name
#define dbg_buf(name) debug_buf_##name
#define dbg_decl_str(name, size) \
char dbg_str(name)[size], *dbg_buf(name)=dbg_str(name)
#define dbg_reset_str(name) \
dbg_buf(name)=dbg_str(name)
#define dsprintf(name, format, args...) \
dbg_buf(name)+=sprintf(dbg_buf(name), format, ## args)
#define dbg_ch_index(ch) (dbch_##ch)
#define dbg_cl_index(cl) (dbcl_##cl)
#define debugging_(cl, ch) \
(dbg_ch_index(ch) >=0 && dbg_cl_index(cl) >= 0 && \
debug_msg_enabled[dbg_ch_index(ch)][dbg_cl_index(cl)])
#define dprintf(format, args...) \
fprintf(stddeb, format, ## args)
#define dprintf_(cl, ch, format, args...) \
if(!debugging_(cl, ch)) ; \
else dprintf("%s:%s:%s:%d:%s: "format, \
debug_cl_name[dbg_cl_index(cl)], \
debug_ch_name[dbg_ch_index(ch)], \
__FILE__, __LINE__, __FUNCTION__ , ## args)
#define debugging_fixme(ch) debugging_(fixme, ch)
#define debugging_err(ch) debugging_(err, ch)
#define debugging_warn(ch) debugging_(warn, ch)
#define debugging_info(ch) debugging_(info, ch)
#define dprintf_fixme(ch, format, args...) dprintf_(fixme, ch, format, ## args)
#define dprintf_err(ch, format, args...) dprintf_(err, ch, format, ## args)
#define dprintf_warn(ch, format, args...) dprintf_(warn, ch, format, ## args)
#define dprintf_info(ch, format, args...) dprintf_(info, ch, format, ## args)
#define dbcl_fixme 0
#define dbcl_err 1
#define dbcl_warn 2
#define dbcl_info 3
#endif

View File

@ -58,6 +58,63 @@ DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,
typedef struct IDirectInput32A IDirectInput32A,*LPDIRECTINPUT32A;
typedef struct IDirectInputDevice32A IDirectInputDevice32A,*LPDIRECTINPUTDEVICE32A;
typedef struct SysKeyboard32A SysKeyboard32A,*LPSYSKEYBOARD32A;
#define DI_OK S_OK
#define DI_NOTATTACHED S_FALSE
#define DI_BUFFEROVERFLOW S_FALSE
#define DI_PROPNOEFFECT S_FALSE
#define DI_NOEFFECT S_FALSE
#define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
#define DI_TRUNCATED ((HRESULT)0x00000008L)
#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
#define DIERR_OLDDIRECTINPUTVERSION \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
#define DIERR_BETADIRECTINPUTVERSION \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
#define DIERR_BADDRIVERVER \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
#define DIERR_NOTFOUND \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
#define DIERR_OBJECTNOTFOUND \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
#define DIERR_INVALIDPARAM E_INVALIDARG
#define DIERR_NOINTERFACE E_NOINTERFACE
#define DIERR_GENERIC E_FAIL
#define DIERR_OUTOFMEMORY E_OUTOFMEMORY
#define DIERR_UNSUPPORTED E_NOTIMPL
#define DIERR_NOTINITIALIZED \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
#define DIERR_ALREADYINITIALIZED \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
#define DIERR_INPUTLOST \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
#define DIERR_ACQUIRED \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
#define DIERR_NOTACQUIRED \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
#define DIERR_READONLY E_ACCESSDENIED
#define DIERR_HANDLEEXISTS E_ACCESSDENIED
#ifndef E_PENDING
#define E_PENDING 0x8000000AL
#endif
#define DIERR_INSUFFICIENTPRIVS 0x80040200L
#define DIERR_DEVICEFULL 0x80040201L
#define DIERR_MOREDATA 0x80040202L
#define DIERR_NOTDOWNLOADED 0x80040203L
#define DIERR_HASEFFECTS 0x80040204L
#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
#define DIERR_INCOMPLETEEFFECT 0x80040206L
#define DIERR_NOTBUFFERED 0x80040207L
#define DIERR_EFFECTPLAYING 0x80040208L
#define DIERR_UNPLUGGED 0x80040209L
#define DIERR_REPORTFULL 0x8004020AL
typedef struct {
DWORD dwSize;
@ -303,6 +360,8 @@ DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK);
#define DIDF_ABSAXIS 0x00000001
#define DIDF_RELAXIS 0x00000002
#define DIGDD_PEEK 0x00000001
typedef struct {
DWORD dwOfs;
DWORD dwData;
@ -338,6 +397,66 @@ typedef struct {
#define DIPH_BYID 2
#define DIPH_BYUSAGE 3
#define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
typedef struct DIPROPDWORD {
DIPROPHEADER diph;
DWORD dwData;
} DIPROPDWORD, *LPDIPROPDWORD;
typedef const DIPROPDWORD *LPCDIPROPDWORD;
typedef struct DIPROPRANGE {
DIPROPHEADER diph;
LONG lMin;
LONG lMax;
} DIPROPRANGE, *LPDIPROPRANGE;
typedef const DIPROPRANGE *LPCDIPROPRANGE;
#define DIPROPRANGE_NOMIN ((LONG)0x80000000)
#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
typedef struct DIPROPCAL {
DIPROPHEADER diph;
LONG lMin;
LONG lCenter;
LONG lMax;
} DIPROPCAL, *LPDIPROPCAL;
typedef const DIPROPCAL *LPCDIPROPCAL;
typedef struct DIPROPGUIDANDPATH {
DIPROPHEADER diph;
GUID guidClass;
WCHAR wszPath[MAX_PATH];
} DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH,*LPCDIPROPGUIDANDPATH;
/* special property GUIDs */
#define MAKEDIPROP(prop) ((REFGUID)(prop))
#define DIPROP_BUFFERSIZE MAKEDIPROP(1)
#define DIPROP_AXISMODE MAKEDIPROP(2)
#define DIPROPAXISMODE_ABS 0
#define DIPROPAXISMODE_REL 1
#define DIPROP_GRANULARITY MAKEDIPROP(3)
#define DIPROP_RANGE MAKEDIPROP(4)
#define DIPROP_DEADZONE MAKEDIPROP(5)
#define DIPROP_SATURATION MAKEDIPROP(6)
#define DIPROP_FFGAIN MAKEDIPROP(7)
#define DIPROP_FFLOAD MAKEDIPROP(8)
#define DIPROP_AUTOCENTER MAKEDIPROP(9)
#define DIPROPAUTOCENTER_OFF 0
#define DIPROPAUTOCENTER_ON 1
#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
#define DIPROPCALIBRATIONMODE_COOKED 0
#define DIPROPCALIBRATIONMODE_RAW 1
#define DIPROP_CALIBRATION MAKEDIPROP(11)
#define DIPROP_GUIDANDPATH MAKEDIPROP(12)
typedef struct DIDEVCAPS {
DWORD dwSize;
DWORD dwFlags;
@ -402,6 +521,13 @@ struct IDirectInputDevice32A {
DWORD ref;
GUID guid;
};
struct SysKeyboard32A {
LPDIRECTINPUTDEVICEA_VTABLE lpvtbl;
DWORD ref;
GUID guid;
BYTE keystate[256];
};
#undef THIS
#define THIS LPDIRECTINPUT32A this

View File

@ -225,6 +225,7 @@ struct IDirectSoundBuffer {
DSBUFFERDESC dsbd;
LPDSBPOSITIONNOTIFY notifies;
int nrofnotifies;
double volfac;
};
#undef THIS

View File

@ -41,6 +41,7 @@ extern BOOL32 FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
extern HFILE32 FILE_Dup( HFILE32 hFile );
extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 );
extern HFILE32 FILE_Open( LPCSTR path, INT32 mode );
extern HFILE32 FILE_OpenUnixFile( LPCSTR path, INT32 mode );
extern BOOL32 FILE_SetFileType( HFILE32 hFile, DWORD type );
extern LPVOID FILE_mmap( HFILE32 hFile, LPVOID start,
DWORD size_high, DWORD size_low,
@ -68,7 +69,8 @@ extern void DOSFS_UnixTimeToFileTime( time_t unixtime, LPFILETIME ft,
DWORD remainder );
extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder );
extern BOOL32 DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer );
extern const char *DOSFS_IsDevice( const char *name );
extern BOOL32 DOSFS_IsDevice( const char *name );
extern HFILE32 DOSFS_OpenDevice( const char *name, INT32 mode );
extern BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
INT32 long_len, LPSTR short_buf,
BOOL32 ignore_case );

View File

@ -54,8 +54,8 @@ struct IClassFactory {
};
#undef THIS
#define THIS LPMALLOC this
typedef struct IMalloc *LPMALLOC,IMalloc;
#define THIS LPMALLOC32 this
typedef struct IMalloc32 *LPMALLOC32,IMalloc32;
typedef struct {
STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
@ -65,20 +65,46 @@ typedef struct {
STDMETHOD_(LPVOID,Realloc) ( THIS_ LPVOID pv,DWORD cb);
STDMETHOD_(VOID,Free) ( THIS_ LPVOID pv);
STDMETHOD_(DWORD,GetSize) ( THIS_ LPVOID pv);
STDMETHOD_(LPINT32,DidAlloc) ( THIS_ LPVOID pv);
STDMETHOD_(INT32,DidAlloc) ( THIS_ LPVOID pv);
STDMETHOD_(LPVOID,HeapMinimize) ( THIS );
} *LPMALLOC_VTABLE,IMalloc_VTable;
} *LPMALLOC32_VTABLE,IMalloc32_VTable;
struct IMalloc {
LPMALLOC_VTABLE lpvtbl;
struct IMalloc32 {
LPMALLOC32_VTABLE lpvtbl;
DWORD ref;
};
#undef THIS
#define THIS LPMALLOC16 this
typedef struct IMalloc16 *LPMALLOC16,IMalloc16;
typedef struct {
STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
STDMETHOD_(LPVOID,Alloc) ( THIS_ DWORD cb);
STDMETHOD_(LPVOID,Realloc) ( THIS_ LPVOID pv,DWORD cb);
STDMETHOD_(VOID,Free) ( THIS_ LPVOID pv);
STDMETHOD_(DWORD,GetSize) ( THIS_ LPVOID pv);
STDMETHOD_(INT16,DidAlloc) ( THIS_ LPVOID pv);
STDMETHOD_(LPVOID,HeapMinimize) ( THIS );
} *LPMALLOC16_VTABLE,IMalloc16_VTable;
struct IMalloc16 {
LPMALLOC16_VTABLE lpvtbl;
DWORD ref;
/* Gmm, I think one is not enough, we should probably manage a list of
* heaps
*/
HGLOBAL16 heap;
};
#undef THIS
/* private prototypes for the constructors */
#ifdef __WINE__
LPUNKNOWN IUnknown_Constructor();
LPMALLOC IMalloc_Constructor();
LPMALLOC16 IMalloc16_Constructor();
LPMALLOC32 IMalloc32_Constructor();
#endif
#undef STDMETHOD

View File

@ -8,6 +8,7 @@
#define __WINE_K32OBJ_H
#include "wintypes.h"
#include "windows.h"
/* Object types */
typedef enum
@ -47,6 +48,8 @@ typedef struct
BOOL32 (*satisfied)(K32OBJ*,DWORD); /* Wait on object is satisfied */
void (*add_wait)(K32OBJ*,DWORD); /* Add thread to wait queue */
void (*remove_wait)(K32OBJ*,DWORD); /* Remove thread from wait queue */
BOOL32 (*read)(K32OBJ*,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
BOOL32 (*write)(K32OBJ*,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
void (*destroy)(K32OBJ *); /* Destroy object on refcount==0 */
} K32OBJ_OPS;

View File

@ -782,6 +782,7 @@ MMRESULT32 WINAPI timeEndPeriod32(UINT32);
#define JOYERR_NOCANDO (JOYERR_BASE+6) /* request not completed */
#define JOYERR_UNPLUGGED (JOYERR_BASE+7) /* joystick is unplugged */
/* JOYINFO, JOYINFOEX, MM_JOY* */
#define JOY_BUTTON1 0x0001
#define JOY_BUTTON2 0x0002
#define JOY_BUTTON3 0x0004
@ -794,6 +795,50 @@ MMRESULT32 WINAPI timeEndPeriod32(UINT32);
#define JOYSTICKID1 0
#define JOYSTICKID2 1
/* JOYCAPS.wCaps */
#define JOYCAPS_HASZ 0x0001
#define JOYCAPS_HASR 0x0002
#define JOYCAPS_HASU 0x0004
#define JOYCAPS_HASV 0x0008
#define JOYCAPS_HASPOV 0x0010
#define JOYCAPS_POV4DIR 0x0020
#define JOYCAPS_POVCTS 0x0040
/* JOYINFOEX stuff */
#define JOY_POVCENTERED (WORD) -1
#define JOY_POVFORWARD 0
#define JOY_POVRIGHT 9000
#define JOY_POVBACKWARD 18000
#define JOY_POVLEFT 27000
#define JOY_RETURNX 0x00000001
#define JOY_RETURNY 0x00000002
#define JOY_RETURNZ 0x00000004
#define JOY_RETURNR 0x00000008
#define JOY_RETURNU 0x00000010
#define JOY_RETURNV 0x00000020
#define JOY_RETURNPOV 0x00000040
#define JOY_RETURNBUTTONS 0x00000080
#define JOY_RETURNRAWDATA 0x00000100
#define JOY_RETURNPOVCTS 0x00000200
#define JOY_RETURNCENTERED 0x00000400
#define JOY_USEDEADZONE 0x00000800
#define JOY_RETURNALL (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \
JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \
JOY_RETURNPOV | JOY_RETURNBUTTONS)
#define JOY_CAL_READALWAYS 0x00010000
#define JOY_CAL_READXYONLY 0x00020000
#define JOY_CAL_READ3 0x00040000
#define JOY_CAL_READ4 0x00080000
#define JOY_CAL_READXONLY 0x00100000
#define JOY_CAL_READYONLY 0x00200000
#define JOY_CAL_READ5 0x00400000
#define JOY_CAL_READ6 0x00800000
#define JOY_CAL_READZONLY 0x01000000
#define JOY_CAL_READRONLY 0x02000000
#define JOY_CAL_READUONLY 0x04000000
#define JOY_CAL_READVONLY 0x08000000
typedef struct {
WORD wMid; /* manufacturer ID */
WORD wPid; /* product ID */
@ -892,6 +937,22 @@ typedef struct {
UINT32 wButtons;
} JOYINFO32, *LPJOYINFO32;
typedef struct {
DWORD dwSize; /* size of structure */
DWORD dwFlags; /* flags to indicate what to return */
DWORD dwXpos; /* x position */
DWORD dwYpos; /* y position */
DWORD dwZpos; /* z position */
DWORD dwRpos; /* rudder/4th axis position */
DWORD dwUpos; /* 5th axis position */
DWORD dwVpos; /* 6th axis position */
DWORD dwButtons; /* button states */
DWORD dwButtonNumber; /* current button number pressed */
DWORD dwPOV; /* point of view state */
DWORD dwReserved1; /* reserved for communication between winmm & driver */
DWORD dwReserved2; /* reserved for future expansion */
} JOYINFOEX,*LPJOYINFOEX;
DECL_WINELIB_TYPE(JOYINFO);
DECL_WINELIB_TYPE(LPJOYINFO);
@ -905,6 +966,7 @@ UINT32 WINAPI joyGetNumDevs32(void);
MMRESULT16 WINAPI joyGetPos16(UINT16,LPJOYINFO16);
MMRESULT32 WINAPI joyGetPos32(UINT32,LPJOYINFO32);
#define joyGetPos WINELIB_NAME(joyGetPos)
MMRESULT32 WINAPI joyGetPosEx(UINT32,LPJOYINFOEX);
MMRESULT16 WINAPI joyGetThreshold16(UINT16,UINT16*);
MMRESULT32 WINAPI joyGetThreshold32(UINT32,UINT32*);
#define joyGetThreshold WINELIB_NAME(joyGetThreshold)

View File

@ -91,6 +91,14 @@ typedef struct
SEGPTR reserved WINE_PACKED;
} LOADPARAMS;
typedef struct
{
LPSTR lpEnvAddress;
LPSTR lpCmdLine;
LPSTR lpCmdShow;
DWORD dwReserved;
} LOADPARAMS32;
#pragma pack(4)
/* Resource types */
@ -151,4 +159,7 @@ extern void NE_InitializeDLLs( HMODULE16 hModule );
extern HMODULE32 BUILTIN32_LoadModule( LPCSTR name, BOOL32 force,
struct _PDB32 *process );
/* if1632/builtin.c */
extern HMODULE32 (*fnBUILTIN_LoadModule)(LPCSTR name, BOOL32 force);
#endif /* __WINE_MODULE_H */

View File

@ -7,10 +7,19 @@
#include "windows.h"
typedef CHAR OLE_CHAR,OLECHAR;
typedef LPCSTR OLE_LPCSTR;
typedef LPSTR LPOLESTR;
typedef LPCSTR LPCOLESTR;
typedef CHAR OLECHAR16;
typedef LPSTR LPOLESTR16;
typedef LPCSTR LPCOLESTR16;
typedef WCHAR OLECHAR32;
typedef LPWSTR LPOLESTR32;
typedef LPCWSTR LPCOLESTR32;
DECL_WINELIB_TYPE(OLECHAR);
DECL_WINELIB_TYPE(LPOLESTR);
DECL_WINELIB_TYPE(LPCOLESTR);
#define OLESTR16(x) x
#define OLESTR32(x) L##x
#define OLESTR WINELIB_NAME(OLESTR)
typedef unsigned short VARTYPE;
typedef LONG DISPID;
@ -170,10 +179,10 @@ typedef struct _OLECLIENT* LPOLECLIENT;
typedef struct _OLESERVERDOCVTBL {
OLESTATUS (CALLBACK *Save)(LPOLESERVERDOC);
OLESTATUS (CALLBACK *Close)(LPOLESERVERDOC);
OLESTATUS (CALLBACK *SetHostNames)(LPOLESERVERDOC,OLE_LPCSTR,OLE_LPCSTR);
OLESTATUS (CALLBACK *SetHostNames)(LPOLESERVERDOC,LPCOLESTR16,LPCOLESTR16);
OLESTATUS (CALLBACK *SetDocDimensions)(LPOLESERVERDOC,LPRECT16);
#undef GetObject /* FIXME */
OLESTATUS (CALLBACK *GetObject)(LPOLESERVERDOC,OLE_LPCSTR,LPOLEOBJECT*,LPOLECLIENT);
OLESTATUS (CALLBACK *GetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT);
OLESTATUS (CALLBACK *Release)(LPOLESERVERDOC);
OLESTATUS (CALLBACK *SetColorScheme)(LPOLESERVERDOC,LPLOGPALETTE);
OLESTATUS (CALLBACK *Execute)(LPOLESERVERDOC,HGLOBAL16);
@ -186,10 +195,10 @@ typedef struct _OLESERVERDOC {
typedef struct _OLESERVER* LPOLESERVER;
typedef struct _OLESERVERVTBL {
OLESTATUS (CALLBACK *Open)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,LPOLESERVERDOC *);
OLESTATUS (CALLBACK *Create)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC*);
OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC *);
OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC *);
OLESTATUS (CALLBACK *Open)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPOLESERVERDOC *);
OLESTATUS (CALLBACK *Create)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC*);
OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *);
OLESTATUS (CALLBACK *Exit)(LPOLESERVER);
OLESTATUS (CALLBACK *Release)(LPOLESERVER);
OLESTATUS (CALLBACK *Execute)(LPOLESERVER);
@ -210,7 +219,7 @@ typedef struct _OLECLIENT {
} OLECLIENT;
typedef struct _OLEOBJECTVTBL {
void * (CALLBACK *QueryProtocol)(LPOLEOBJECT,OLE_LPCSTR);
void * (CALLBACK *QueryProtocol)(LPOLEOBJECT,LPCOLESTR16);
OLESTATUS (CALLBACK *Release)(LPOLEOBJECT);
OLESTATUS (CALLBACK *Show)(LPOLEOBJECT,BOOL16);
OLESTATUS (CALLBACK *DoVerb)(LPOLEOBJECT,UINT16,BOOL16,BOOL16);
@ -221,10 +230,10 @@ typedef struct _OLEOBJECTVTBL {
OLESTATUS (CALLBACK *EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
OLESTATUS (CALLBACK *SetColorScheme)(LPOLEOBJECT,LPLOGPALETTE);
OLESTATUS (CALLBACK *Delete)(LPOLEOBJECT);
OLESTATUS (CALLBACK *SetHostNames)(LPOLEOBJECT,OLE_LPCSTR,OLE_LPCSTR);
OLESTATUS (CALLBACK *SetHostNames)(LPOLEOBJECT,LPCOLESTR16,LPCOLESTR16);
OLESTATUS (CALLBACK *SaveToStream)(LPOLEOBJECT,LPOLESTREAM);
OLESTATUS (CALLBACK *Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT *);
OLESTATUS (CALLBACK *CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT *);
OLESTATUS (CALLBACK *Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
OLESTATUS (CALLBACK *CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
OLESTATUS (CALLBACK *Equal)(LPOLEOBJECT,LPOLEOBJECT);
OLESTATUS (CALLBACK *CopyToClipBoard)(LPOLEOBJECT);
OLESTATUS (CALLBACK *Draw)(LPOLEOBJECT,HDC16,LPRECT16,LPRECT16,HDC16);
@ -233,10 +242,10 @@ typedef struct _OLEOBJECTVTBL {
OLESTATUS (CALLBACK *Close)(LPOLEOBJECT);
OLESTATUS (CALLBACK *Update)(LPOLEOBJECT);
OLESTATUS (CALLBACK *Reconnect)(LPOLEOBJECT);
OLESTATUS (CALLBACK *ObjectConvert)(LPOLEOBJECT,OLE_LPCSTR,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT*);
OLESTATUS (CALLBACK *ObjectConvert)(LPOLEOBJECT,LPCOLESTR16,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT*);
OLESTATUS (CALLBACK *GetLinkUpdateOptions)(LPOLEOBJECT,LPOLEOPT_UPDATE);
OLESTATUS (CALLBACK *SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE);
OLESTATUS (CALLBACK *Rename)(LPOLEOBJECT,OLE_LPCSTR);
OLESTATUS (CALLBACK *Rename)(LPOLEOBJECT,LPCOLESTR16);
OLESTATUS (CALLBACK *QueryName)(LPOLEOBJECT,LPSTR,LPUINT16);
OLESTATUS (CALLBACK *QueryType)(LPOLEOBJECT,LPLONG);
OLESTATUS (CALLBACK *QueryBounds)(LPOLEOBJECT,LPRECT16);
@ -279,12 +288,12 @@ typedef enum tagCALLCONV {
} CALLCONV;
typedef struct tagPARAMDATA {
OLECHAR * szName; /* parameter name */
OLECHAR16 * szName; /* parameter name */
VARTYPE vt; /* parameter type */
} PARAMDATA, * LPPARAMDATA;
typedef struct tagMETHODDATA {
OLECHAR * szName; /* method name */
OLECHAR16 * szName; /* method name */
PARAMDATA * ppdata; /* pointer to an array of PARAMDATAs */
DISPID dispid; /* method ID */
UINT16 iMeth; /* method index */

View File

@ -115,5 +115,5 @@ extern PDB32 *PROCESS_Current(void);
extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access );
extern PDB32 *PROCESS_IdToPDB( DWORD id );
extern PDB32 *PROCESS_Create( TDB *pTask, LPCSTR cmd_line );
extern void PROCESS_CloseObjHandles(PDB32 *pdb, K32OBJ *ptr);
#endif /* __WINE_PROCESS_H */

View File

@ -146,7 +146,7 @@ typedef struct IShellFolder_VTable {
/* *** IShellFolder methods *** */
STDMETHOD(ParseDisplayName) (THIS_ HWND32 hwndOwner,
LPBC pbcReserved, LPOLESTR lpszDisplayName,
LPBC pbcReserved, LPOLESTR32 lpszDisplayName,
ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
STDMETHOD(EnumObjects) ( THIS_ HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST
* ppenumIDList) PURE;
@ -163,7 +163,7 @@ typedef struct IShellFolder_VTable {
REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut) PURE;
STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
STDMETHOD(SetNameOf) (THIS_ HWND32 hwndOwner, LPCITEMIDLIST pidl,
LPCOLESTR lpszName, DWORD uFlags,
LPCOLESTR32 lpszName, DWORD uFlags,
LPITEMIDLIST * ppidlOut) PURE;
} *LPSHELLFOLDER_VTABLE,IShellFolder_VTable;

View File

@ -1,256 +0,0 @@
/* If you define this you can enable or disable specific debugging- */
/* messages at run-time by supplying the "-debugmsg" option to Wine */
#define DEBUG_RUNTIME /* */
/* Define this if you want to enable all debugging-messages, except */
/* the ones explicitly disabled in a specific *.c-file. */
/* #define DEBUG_ALL */
/* Define this if you want to enable all debugging-messages, even */
/* the ones explicitly disabled in specific *.c-files. */
/* #define DEBUG_ALL_EXT */
/* Define this if you want to disable all debugging-messages, except */
/* the ones explicitly enabled in a specifiy *.c-file. */
/* #define DEBUG_NONE */
/* Define this if you want to disable all debugging-messages, even */
/* the ones explicitly enabled in specific *.c-files. */
/* #define DEBUG_NONE_EXT */
/* You can enable or disable specific debugging-messages here. */
/* However, this can be overridden in the individual *.c-files */
/* between #include <stddebug.h> and #include <debug.h> */
/* #define DEBUG_EDIT */
/* #define DEBUG_MENU */
/* #define DEBUG_MENUCALC */
/* #define DEBUG_SCROLL */
/* #define DEBUG_COMBO */
/* #define DEBUG_LISTBOX */
/* #define DEBUG_TASK */
/* #define DEBUG_SELECTORS */
/* #define DEBUG_RESOURCE */
/* #define DEBUG_ACCEL */
/* #define DEBUG_FIXUP */
/* #define DEBUG_MODULE */
/* #define DEBUG_LDT */
/* #define DEBUG_HEAP */
/* #define DEBUG_MCIANIM */
/* #define DEBUG_MCIWAVE */
/* #define DEBUG_MIDI */
/* #define DEBUG_INT */
/* #define DEBUG_METAFILE */
/* #define DEBUG_GDI */
/* #define DEBUG_BITMAP */
/* #define DEBUG_FONT */
/* #define DEBUG_PALETTE */
/* #define DEBUG_ICON */
/* #define DEBUG_REGION */
/* #define DEBUG_TEXT */
/* #define DEBUG_CLIPPING */
/* #define DEBUG_CARET */
/* #define DEBUG_CLASS */
/* #define DEBUG_DC */
/* #define DEBUG_DIALOG */
/* #define DEBUG_MESSAGE */
/* #define DEBUG_EVENT */
/* #define DEBUG_KEY */
/* #define DEBUG_GRAPHICS */
/* #define DEBUG_MDI */
/* #define DEBUG_MSG */
/* #define DEBUG_NONCLIENT */
/* #define DEBUG_SYSCOLOR */
/* #define DEBUG_TIMER */
/* #define DEBUG_UTILITY */
/* #define DEBUG_WIN */
/* #define DEBUG_ENUM */
/* #define DEBUG_DLL */
/* #define DEBUG_MSGBOX */
/* #define DEBUG_CATCH */
/* Do not remove this line or change anything below this line */
#ifdef DEBUG_NONE
#undef DEBUG_ACCEL
#undef DEBUG_ASPI
#undef DEBUG_ATOM
#undef DEBUG_BITBLT
#undef DEBUG_BITMAP
#undef DEBUG_CARET
#undef DEBUG_CDAUDIO
#undef DEBUG_CLASS
#undef DEBUG_CLIPBOARD
#undef DEBUG_CLIPPING
#undef DEBUG_COMBO
#undef DEBUG_COMM
#undef DEBUG_COMMDLG
#undef DEBUG_CRTDLL
#undef DEBUG_CURSOR
#undef DEBUG_DC
#undef DEBUG_DDE
#undef DEBUG_DDRAW
#undef DEBUG_DIALOG
#undef DEBUG_DLL
#undef DEBUG_DOSFS
#undef DEBUG_DRIVER
#undef DEBUG_DSOUND
#undef DEBUG_EDIT
#undef DEBUG_EVENT
#undef DEBUG_EXEC
#undef DEBUG_FILE
#undef DEBUG_FIXUP
#undef DEBUG_FONT
#undef DEBUG_GDI
#undef DEBUG_GLOBAL
#undef DEBUG_GRAPHICS
#undef DEBUG_HEAP
#undef DEBUG_HOOK
#undef DEBUG_ICON
#undef DEBUG_INT
#undef DEBUG_KEY
#undef DEBUG_KEYBOARD
#undef DEBUG_LDT
#undef DEBUG_LISTBOX
#undef DEBUG_LOCAL
#undef DEBUG_MCI
#undef DEBUG_MCIANIM
#undef DEBUG_MCIWAVE
#undef DEBUG_MDI
#undef DEBUG_MENU
#undef DEBUG_MESSAGE
#undef DEBUG_METAFILE
#undef DEBUG_MIDI
#undef DEBUG_MMAUX
#undef DEBUG_MMIO
#undef DEBUG_MMSYS
#undef DEBUG_MMTIME
#undef DEBUG_MODULE
#undef DEBUG_MSG
#undef DEBUG_NONCLIENT
#undef DEBUG_OLE
#undef DEBUG_PALETTE
#undef DEBUG_PROFILE
#undef DEBUG_PROGRESS
#undef DEBUG_PROP
#undef DEBUG_REG
#undef DEBUG_REGION
#undef DEBUG_RELAY
#undef DEBUG_RESOURCE
#undef DEBUG_SCROLL
#undef DEBUG_SELECTOR
#undef DEBUG_SEM
#undef DEBUG_SENDMSG
#undef DEBUG_SHM
#undef DEBUG_STRESS
#undef DEBUG_STRING
#undef DEBUG_TASK
#undef DEBUG_TEXT
#undef DEBUG_THUNK
#undef DEBUG_TIMER
#undef DEBUG_TOOLHELP
#undef DEBUG_TWEAK
#undef DEBUG_UPDOWN
#undef DEBUG_VER
#undef DEBUG_VIRTUAL
#undef DEBUG_VXD
#undef DEBUG_WIN
#undef DEBUG_WIN16DRV
#undef DEBUG_WIN32
#undef DEBUG_WINSOCK
#undef DEBUG_X11
#endif
#ifdef DEBUG_ALL
#define DEBUG_ACCEL
#define DEBUG_ASPI
#define DEBUG_ATOM
#define DEBUG_BITBLT
#define DEBUG_BITMAP
#define DEBUG_CARET
#define DEBUG_CDAUDIO
#define DEBUG_CLASS
#define DEBUG_CLIPBOARD
#define DEBUG_CLIPPING
#define DEBUG_COMBO
#define DEBUG_COMM
#define DEBUG_COMMDLG
#define DEBUG_CRTDLL
#define DEBUG_CURSOR
#define DEBUG_DC
#define DEBUG_DDE
#define DEBUG_DDRAW
#define DEBUG_DIALOG
#define DEBUG_DLL
#define DEBUG_DOSFS
#define DEBUG_DRIVER
#define DEBUG_DSOUND
#define DEBUG_EDIT
#define DEBUG_EVENT
#define DEBUG_EXEC
#define DEBUG_FILE
#define DEBUG_FIXUP
#define DEBUG_FONT
#define DEBUG_GDI
#define DEBUG_GLOBAL
#define DEBUG_GRAPHICS
#define DEBUG_HEAP
#define DEBUG_HOOK
#define DEBUG_ICON
#define DEBUG_INT
#define DEBUG_KEY
#define DEBUG_KEYBOARD
#define DEBUG_LDT
#define DEBUG_LISTBOX
#define DEBUG_LOCAL
#define DEBUG_MCI
#define DEBUG_MCIANIM
#define DEBUG_MCIWAVE
#define DEBUG_MDI
#define DEBUG_MENU
#define DEBUG_MESSAGE
#define DEBUG_METAFILE
#define DEBUG_MIDI
#define DEBUG_MMAUX
#define DEBUG_MMIO
#define DEBUG_MMSYS
#define DEBUG_MMTIME
#define DEBUG_MODULE
#define DEBUG_MSG
#define DEBUG_NONCLIENT
#define DEBUG_OLE
#define DEBUG_PALETTE
#define DEBUG_PROFILE
#define DEBUG_PROGRESS
#define DEBUG_PROP
#define DEBUG_REG
#define DEBUG_REGION
#define DEBUG_RELAY
#define DEBUG_RESOURCE
#define DEBUG_SCROLL
#define DEBUG_SELECTOR
#define DEBUG_SEM
#define DEBUG_SENDMSG
#define DEBUG_SHM
#define DEBUG_STRESS
#define DEBUG_STRING
#define DEBUG_TASK
#define DEBUG_TEXT
#define DEBUG_THUNK
#define DEBUG_TIMER
#define DEBUG_TOOLHELP
#define DEBUG_TWEAK
#define DEBUG_UPDOWN
#define DEBUG_VER
#define DEBUG_VIRTUAL
#define DEBUG_VXD
#define DEBUG_WIN
#define DEBUG_WIN16DRV
#define DEBUG_WIN32
#define DEBUG_WINSOCK
#define DEBUG_X11
#endif

212
include/storage.h Normal file
View File

@ -0,0 +1,212 @@
#ifndef _WINE_STORAGE_H
#define _WINE_STORAGE_H
/* Does this look like a cellar to you? */
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)
#define PURE
#define FAR
#define THIS_ THIS,
struct storage_header {
BYTE magic[8]; /* 00: magic */
BYTE unknown1[36]; /* 08: unknown */
DWORD num_of_bbd_blocks;/* 2C: length of big datablocks */
DWORD root_startblock;/* 30: root storage first big block */
DWORD unknown2[2]; /* 34: unknown */
DWORD sbd_startblock; /* 3C: small block depot first big block */
DWORD unknown3[3]; /* 40: unknown */
DWORD bbd_list[109]; /* 4C: big data block list (up to end of sector)*/
};
struct storage_pps_entry {
WCHAR pps_rawname[32];/* 00: \0 terminated widechar name */
WORD pps_sizeofname; /* 40: namelength in bytes */
BYTE pps_type; /* 42: flags, 1 storage/dir, 2 stream, 5 root */
BYTE pps_unknown0; /* 43: unknown */
DWORD pps_prev; /* 44: previous pps */
DWORD pps_next; /* 48: next pps */
DWORD pps_dir; /* 4C: directory pps */
GUID pps_guid; /* 50: class ID */
DWORD pps_unknown1; /* 60: unknown */
FILETIME pps_ft1; /* 64: filetime1 */
FILETIME pps_ft2; /* 70: filetime2 */
DWORD pps_sb; /* 74: data startblock */
DWORD pps_size; /* 78: datalength. (<0x1000)?small:big blocks*/
DWORD pps_unknown2; /* 7C: unknown */
};
#define STORAGE_CHAINENTRY_FAT 0xfffffffd
#define STORAGE_CHAINENTRY_ENDOFCHAIN 0xfffffffe
#define STORAGE_CHAINENTRY_FREE 0xffffffff
typedef LPOLESTR16 *SNB16;
typedef LPOLESTR32 *SNB32;
DECL_WINELIB_TYPE(SNB);
typedef struct IStorage16 IStorage16,*LPSTORAGE16;
typedef struct IStorage32 IStorage32,*LPSTORAGE32;
typedef struct IStream16 IStream16,*LPSTREAM16;
typedef struct IStream32 IStream32,*LPSTREAM32;
typedef struct IEnumSTATSTG IEnumSTATSTG,*LPENUMSTATSTG;
typedef struct {
LPOLESTR16 pwcsName;
DWORD type;
ULARGE_INTEGER cbSize;
FILETIME mtime;
FILETIME ctime;
FILETIME atime;
DWORD grfMode;
DWORD grfLocksSupported;
CLSID clsid;
DWORD grfStateBits;
DWORD reserved;
} STATSTG;
#define STGM_DIRECT 0x00000000
#define STGM_TRANSACTED 0x00010000
#define STGM_SIMPLE 0x08000000
#define STGM_READ 0x00000000
#define STGM_WRITE 0x00000001
#define STGM_READWRITE 0x00000002
#define STGM_SHARE_DENY_NONE 0x00000040
#define STGM_SHARE_DENY_READ 0x00000030
#define STGM_SHARE_DENY_WRITE 0x00000020
#define STGM_SHARE_EXCLUSIVE 0x00000010
#define STGM_PRIORITY 0x00040000
#define STGM_DELETEONRELEASE 0x04000000
#define STGM_NOSCRATCH 0x00100000
#define STGM_CREATE 0x00001000
#define STGM_CONVERT 0x00020000
#define STGM_FAILIFTHERE 0x00000000
#define THIS LPSTORAGE16 this
typedef struct IStorage16_VTable {
/* IUnknown methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj);
STDMETHOD_(ULONG,AddRef) (THIS);
STDMETHOD_(ULONG,Release) (THIS);
/* IStorage methods */
STDMETHOD(CreateStream)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream16 **ppstm);
STDMETHOD(OpenStream)(THIS_ LPCOLESTR16 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream16 **ppstm);
STDMETHOD(CreateStorage)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage16 **ppstg);
STDMETHOD(OpenStorage)(THIS_ LPCOLESTR16 pwcsName,IStorage16 *pstgPriority, DWORD grfMode, SNB16 SNB16Exclude, DWORD reserved, IStorage16 **ppstg);
STDMETHOD(CopyTo)(THIS_ DWORD ciidExclude, const IID *rgiidExclude, SNB16 SNB16Exclude, IStorage16 *pstgDest);
STDMETHOD(MoveElementTo)(THIS_ LPCOLESTR16 pwcsName, IStorage16 *pstgDest, LPCOLESTR16 pwcsNewName, DWORD grfFlags);
STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags);
STDMETHOD(Revert)(THIS);
STDMETHOD(EnumElements)(THIS_ DWORD reserved1,void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum);
STDMETHOD(DestroyElement)(THIS_ LPCOLESTR16 pwcsName);
STDMETHOD(RenameElement)(THIS_ LPCOLESTR16 pwcsOldName, LPCOLESTR16 pwcsNewName);
STDMETHOD(SetElementTimes)(THIS_ LPCOLESTR16 pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime);
STDMETHOD(SetClass)(THIS_ REFCLSID clsid);
STDMETHOD(SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask);
STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag);
} IStorage16_VTable,*LPSTORAGE16_VTABLE;
struct IStorage16 {
LPSTORAGE16_VTABLE lpvtbl;
DWORD ref;
SEGPTR thisptr; /* pointer to this struct as segmented */
struct storage_pps_entry stde;
int ppsent;
HFILE32 hf;
};
#undef THIS
#define THIS LPSTORAGE32 this
typedef struct IStorage32_VTable {
/* IUnknown methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj);
STDMETHOD_(ULONG,AddRef) (THIS);
STDMETHOD_(ULONG,Release) (THIS);
/* IStorage methods */
STDMETHOD(CreateStream)(THIS_ LPCOLESTR32 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream32 **ppstm);
STDMETHOD(OpenStream)(THIS_ LPCOLESTR32 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream32 **ppstm);
STDMETHOD(CreateStorage)(THIS_ LPCOLESTR32 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage32 **ppstg);
STDMETHOD(OpenStorage)(THIS_ LPCOLESTR32 pwcsName,IStorage32 *pstgPriority, DWORD grfMode, SNB32 SNB16Exclude, DWORD reserved, IStorage32 **ppstg);
STDMETHOD(CopyTo)(THIS_ DWORD ciidExclude, const IID *rgiidExclude, SNB32 SNB16Exclude, IStorage32 *pstgDest);
STDMETHOD(MoveElementTo)(THIS_ LPCOLESTR32 pwcsName, IStorage32 *pstgDest, LPCOLESTR32 pwcsNewName, DWORD grfFlags);
STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags);
STDMETHOD(Revert)(THIS);
STDMETHOD(EnumElements)(THIS_ DWORD reserved1,void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum);
STDMETHOD(DestroyElement)(THIS_ LPCOLESTR32 pwcsName);
STDMETHOD(RenameElement)(THIS_ LPCOLESTR32 pwcsOldName, LPCOLESTR32 pwcsNewName);
STDMETHOD(SetElementTimes)(THIS_ LPCOLESTR32 pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime);
STDMETHOD(SetClass)(THIS_ REFCLSID clsid);
STDMETHOD(SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask);
STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag);
} IStorage32_VTable,*LPSTORAGE32_VTABLE;
struct IStorage32 {
LPSTORAGE32_VTABLE lpvtbl;
DWORD ref;
struct storage_pps_entry stde;
int ppsent;
HFILE32 hf;
};
#undef THIS
#define THIS LPSTREAM16 this
typedef struct IStream16_VTable {
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void * *ppvObject);
STDMETHOD_(ULONG,AddRef)(THIS);
STDMETHOD_(ULONG,Release)(THIS);
STDMETHOD(Read)(THIS_ void *pv, ULONG cb, ULONG *pcbRead);
STDMETHOD(Write)(THIS_ const void *pv,ULONG cb,ULONG *pcbWritten);
STDMETHOD(Seek)(THIS_ LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition);
STDMETHOD(SetSize)(THIS_ ULARGE_INTEGER libNewSize);
STDMETHOD(CopyTo)(THIS_ IStream16 *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten);
STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags);
STDMETHOD(Revert)(THIS);
STDMETHOD(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb,DWORD dwLockType);
STDMETHOD(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag);
STDMETHOD(Clone)(THIS_ IStream16 **ppstm);
} IStream16_VTable,*LPSTREAM16_VTABLE;
struct IStream16 {
LPSTREAM16_VTABLE lpvtbl;
DWORD ref;
SEGPTR thisptr; /* pointer to this struct as segmented */
struct storage_pps_entry stde;
int ppsent;
HFILE32 hf;
ULARGE_INTEGER offset;
};
#undef THIS
#define THIS LPSTREAM32 this
typedef struct IStream32_VTable {
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void * *ppvObject);
STDMETHOD_(ULONG,AddRef)(THIS);
STDMETHOD_(ULONG,Release)(THIS);
STDMETHOD(Read)(THIS_ void *pv, ULONG cb, ULONG *pcbRead);
STDMETHOD(Write)(THIS_ const void *pv,ULONG cb,ULONG *pcbWritten);
STDMETHOD(Seek)(THIS_ LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition);
STDMETHOD(SetSize)(THIS_ ULARGE_INTEGER libNewSize);
STDMETHOD(CopyTo)(THIS_ IStream32 *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten);
STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags);
STDMETHOD(Revert)(THIS);
STDMETHOD(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb,DWORD dwLockType);
STDMETHOD(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag);
STDMETHOD(Clone)(THIS_ IStream32 **ppstm);
} IStream32_VTable,*LPSTREAM32_VTABLE;
struct IStream32 {
LPSTREAM32_VTABLE lpvtbl;
DWORD ref;
struct storage_pps_entry stde;
int ppsent;
HFILE32 hf;
ULARGE_INTEGER offset;
};
#undef THIS
#undef STDMETHOD
#undef STDMETHOD_
#undef PURE
#undef FAR
#undef THIS_
#endif

View File

@ -12,6 +12,8 @@
#include "winnt.h"
#include "selectors.h" /* for SET_FS */
struct _PDB32;
/* Thread exception block */
typedef struct _TEB
{
@ -30,6 +32,7 @@ typedef struct _TEB
HQUEUE16 queue; /* 28 Message queue */
WORD pad1; /* 2a */
LPVOID *tls_ptr; /* 2c Pointer to TLS array */
struct _PDB32 *process; /* 30 owning process (used by NT3.51 applets)*/
} TEB;
/* Event waiting structure */
@ -41,8 +44,6 @@ typedef struct
K32OBJ *objs[MAXIMUM_WAIT_OBJECTS]; /* Object pointers */
} WAIT_STRUCT;
struct _PDB32;
/* Thread database */
typedef struct _THDB
{
@ -50,7 +51,6 @@ typedef struct _THDB
struct _PDB32 *process; /* 08 Process owning this thread */
K32OBJ *event; /* 0c Thread event */
TEB teb; /* 10 Thread exception block */
DWORD cur_stack; /* 40 Current stack (was: process2) */
DWORD flags; /* 44 Flags */
DWORD exit_code; /* 48 Termination status */
WORD teb_sel; /* 4c Selector to TEB */
@ -67,7 +67,8 @@ typedef struct _THDB
void *debugger_CB; /* 74 Debugger context block */
DWORD debug_thread; /* 78 Thread debugging this one (?) */
void *pcontext; /* 7c Thread register context */
DWORD unknown3[3]; /* 80 Unknown */
DWORD cur_stack; /* 80 Current stack (was: unknown) */
DWORD unknown3[2]; /* 84 Unknown */
WORD current_ss; /* 8c Another 16-bit stack selector */
WORD pad2; /* 8e */
void *ss_table; /* 90 Pointer to info about 16-bit stack */
@ -125,6 +126,7 @@ extern THDB *THREAD_Current(void);
extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access );
extern void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread );
extern void THREAD_RemoveQueue( THREAD_QUEUE *queue, THDB *thread );
extern DWORD THREAD_TlsAlloc( THDB *thread );
/* scheduler/event.c */
extern void EVENT_Set( K32OBJ *obj );

View File

@ -1 +1 @@
#define WINE_RELEASE_INFO "Wine release 980215"
#define WINE_RELEASE_INFO "Wine release 980301"

View File

@ -5767,6 +5767,9 @@ HANDLE32 WINAPI GetCurrentProcess(void);
DWORD WINAPI GetCurrentProcessId(void);
HANDLE32 WINAPI GetCurrentThread(void);
DWORD WINAPI GetCurrentThreadId(void);
INT32 WINAPI GetDateFormat32A(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT32);
INT32 WINAPI GetDateFormat32W(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT32);
#define GetDateFormat WINELIB_NAME_AW(GetDateFormat)
BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32);
LPSTR WINAPI GetEnvironmentStrings32A(void);
LPWSTR WINAPI GetEnvironmentStrings32W(void);
@ -5856,6 +5859,8 @@ BOOL32 WINAPI MoveFileEx32A(LPCSTR,LPCSTR,DWORD);
BOOL32 WINAPI MoveFileEx32W(LPCWSTR,LPCWSTR,DWORD);
#define MoveFileEx WINELIB_NAME_AW(MoveFileEx)
DWORD WINAPI MsgWaitForMultipleObjects(DWORD,HANDLE32*,BOOL32,DWORD,DWORD);
INT32 WINAPI MultiByteToWideChar(UINT32,DWORD,LPCSTR,INT32,LPWSTR,INT32);
INT32 WINAPI WideCharToMultiByte(UINT32,DWORD,LPCWSTR,INT32,LPSTR,INT32,LPCSTR,BOOL32*);
HANDLE32 WINAPI OpenEvent32A(DWORD,BOOL32,LPCSTR);
HANDLE32 WINAPI OpenEvent32W(DWORD,BOOL32,LPCWSTR);
#define OpenEvent WINELIB_NAME_AW(OpenEvent)
@ -5877,7 +5882,7 @@ BOOL32 WINAPI QueryPerformanceCounter(LPLARGE_INTEGER);
BOOL32 WINAPI ReadConsole32A(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID);
BOOL32 WINAPI ReadConsole32W(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID);
#define ReadConsole WINELIB_NAME_AW(ReadConsole)
BOOL32 WINAPI ReadFile(HFILE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
BOOL32 WINAPI ReadFile(HANDLE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
DWORD WINAPI RegCreateKeyEx32A(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,
LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD);
DWORD WINAPI RegCreateKeyEx32W(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,
@ -5967,7 +5972,7 @@ WORD WINAPI WOWHandle16(HANDLE32,WOW_HANDLE_TYPE);
BOOL32 WINAPI WriteConsole32A(HANDLE32,LPCVOID,DWORD,LPDWORD,LPVOID);
BOOL32 WINAPI WriteConsole32W(HANDLE32,LPCVOID,DWORD,LPDWORD,LPVOID);
#define WriteConsole WINELIB_NAME_AW(WriteConsole)
BOOL32 WINAPI WriteFile(HFILE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
BOOL32 WINAPI WriteFile(HANDLE32,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
/* Declarations for functions that are the same in Win16 and Win32 */

View File

@ -4,6 +4,11 @@
extern int WIN32_LastError;
#define FACILITY_WIN32 7
#define SEVERITY_ERROR 1
#define MAKE_HRESULT(sev,fac,code) \
((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
#define MAKE_SCODE(sev,fac,code) \
@ -52,6 +57,7 @@ extern int WIN32_LastError;
#define ERROR_POSSIBLE_DEADLOCK 1131
#define ERROR_BAD_DEVICE 1200
#define ERROR_NO_NETWORK 1222
#define ERROR_ALREADY_INITIALIZED 1247
#define ERROR_COMMITMENT_LIMIT 1455
/* HRESULT values for OLE, SHELL and other Interface stuff */
@ -66,4 +72,38 @@ extern int WIN32_LastError;
#define E_OUTOFMEMORY 0x8007000E
#define E_INVALIDARG 0x80070057
#define STG_E_INVALIDFUNCTION 0x80030001
#define STG_E_FILENOTFOUND 0x80030002
#define STG_E_PATHNOTFOUND 0x80030003
#define STG_E_TOOMANYOPENFILES 0x80030004
#define STG_E_ACCESSDENIED 0x80030005
#define STG_E_INVALIDHANDLE 0x80030006
#define STG_E_INSUFFICIENTMEMORY 0x80030008
#define STG_E_INVALIDPOINTER 0x80030009
#define STG_E_NOMOREFILES 0x80030012
#define STG_E_DISKISWRITEPROTECTED 0x80030013
#define STG_E_SEEKERROR 0x80030019
#define STG_E_WRITEFAULT 0x8003001D
#define STG_E_READFAULT 0x8003001E
#define STG_E_SHAREVIOLATION 0x80030020
#define STG_E_LOCKVIOLATION 0x80030021
#define STG_E_FILEALREADYEXISTS 0x80030050
#define STG_E_INVALIDPARAMETER 0x80030057
#define STG_E_MEDIUMFULL 0x80030070
#define STG_E_ABNORMALAPIEXIT 0x800300FA
#define STG_E_INVALIDHEADER 0x800300FB
#define STG_E_INVALIDNAME 0x800300FC
#define STG_E_UNKNOWN 0x800300FD
#define STG_E_UNIMPLEMENTEDFUNCTION 0x800300FE
#define STG_E_INVALIDFLAG 0x800300FF
#define STG_E_INUSE 0x80030100
#define STG_E_NOTCURRENT 0x80030101
#define STG_E_REVERTED 0x80030102
#define STG_E_CANTSAVE 0x80030103
#define STG_E_OLDFORMAT 0x80030104
#define STG_E_OLDDLL 0x80030105
#define STG_E_SHAREREQUIRED 0x80030106
#define STG_E_NOTFILEBASEDSTORAGE 0x80030107
#define STG_E_EXTANTMARSHALLINGS 0x80030108
#endif /* __WINE_WINERROR_H */

View File

@ -16,7 +16,6 @@
#include "shm_main_blk.h"
#include "shm_fragment.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
typedef struct
@ -130,7 +129,7 @@ ATOM DDE_GlobalAddAtom( SEGPTR name )
return (atom<MIN_STR_ATOM) ? atom : 0;
}
dprintf_atom(stddeb,"GlobalAddAtom(\"%s\")\n",str);
dprintf_info(atom,"GlobalAddAtom(\"%s\")\n",str);
DDE_IPC_init(); /* will initialize only if needed */
@ -175,7 +174,7 @@ ATOM DDE_GlobalDeleteAtom( ATOM atom )
AtomData_ptr atom_ptr;
ATOM retval=(ATOM) 0;
dprintf_atom(stddeb,"GlobalDeleteAtom(\"%d\")\n",(int)atom);
dprintf_info(atom,"GlobalDeleteAtom(\"%d\")\n",(int)atom);
atom_idx=(int)atom - MIN_STR_ATOM;
if (atom_idx < 0 )
@ -212,7 +211,7 @@ ATOM DDE_GlobalFindAtom( SEGPTR name )
int atom_ofs;
char *str;
dprintf_atom(stddeb,"GlobalFindAtom(%08lx)\n", name );
dprintf_info(atom,"GlobalFindAtom(%08lx)\n", name );
/* First check for integer atom */
@ -224,7 +223,7 @@ ATOM DDE_GlobalFindAtom( SEGPTR name )
ATOM atom= (ATOM) atoi(&str[1]);
return (atom<MIN_STR_ATOM) ? atom : 0;
}
dprintf_atom(stddeb,"GlobalFindAtom(\"%s\")\n",str);
dprintf_info(atom,"GlobalFindAtom(\"%s\")\n",str);
DDE_IPC_init(); /* will initialize only if needed */

View File

@ -12,7 +12,6 @@
#include <win.h>
#include "dde_atom.h"
#include "shm_main_blk.h"
#include <stddebug.h>
#include <debug.h>
#define TOGETHER (DDE_ATOMS/5)
@ -25,9 +24,9 @@ int main()
int i,j,atom_n;
int atom_len[TOGETHER];
debugging_shm=1;
debugging_atom=0;
debugging_sem=0;
debugging_info(shm)=1;
debugging_info(atom)=0;
debugging_info(sem)=0;
for (i=0 ; i<=10000/TOGETHER ; i++) {
for (atom_n=0 ; atom_n<TOGETHER ; atom_n++) {

View File

@ -10,9 +10,8 @@
#ifdef CONFIG_IPC
#include <stdio.h>
#include <stddebug.h>
#include <debug.h>
#include <assert.h>
#include "debug.h"
#include "ldt.h"
#include "shm_main_blk.h"
#include "shm_fragment.h"
@ -59,18 +58,18 @@ static struct handle_info *locate_handle(HGLOBAL16 h, struct local_shm_map *map)
{
struct shm_block *block;
dprintf_global(stddeb,"shm:locate_handle(0x%04x)\n", h);
dprintf_info(global,"shm:locate_handle(0x%04x)\n", h);
if (SampleBit( &free_handles, DDE_MEM_IDX(h)) == 0) {
dprintf_global(stddeb, "shm:locate_handle: return NULL\n");
dprintf_info(global, "shm:locate_handle: return NULL\n");
return NULL; /* free!!! */
}
block= shm_locate_block(DDE_MEM_INFO(h).shmid, map);
if (block == NULL) {
/* nothing found */
dprintf_global(stddeb, "shm:locate_handle: return NULL\n");
dprintf_info(global, "shm:locate_handle: return NULL\n");
return NULL;
}
@ -88,7 +87,7 @@ static HGLOBAL16 dde_alloc_handle()
if (bit_nr != -1)
return DDE_MEM_HANDLE(bit_nr);
dprintf_global(stddeb,"dde_alloc_handle: no free DDE handle found\n");
dprintf_info(global,"dde_alloc_handle: no free DDE handle found\n");
return 0;
}
/**********************************************************************
@ -103,7 +102,7 @@ DDE_malloc(unsigned int flags, unsigned long size, SHMDATA *shmdata)
struct local_shm_map *curr;
HGLOBAL16 handle;
dprintf_global(stddeb,"DDE_malloc flags %4X, size %ld\n", flags, size);
dprintf_info(global,"DDE_malloc flags %4X, size %ld\n", flags, size);
DDE_IPC_init(); /* make sure main shm block allocated */
shm_write_wait(main_block->proc[curr_proc_idx].sem);
@ -152,14 +151,14 @@ DDE_malloc(unsigned int flags, unsigned long size, SHMDATA *shmdata)
handle= dde_alloc_handle();
if (handle) {
dprintf_global(stddeb,
dprintf_info(global,
"DDE_malloc returning handle=0x%4x, ptr=0x%08lx\n",
(int)handle, (long) HINFO2DATAPTR(h_info));
DDE_MEM_INFO(handle).rel= PTR2REL(block, h_info);
DDE_MEM_INFO(handle).shmid= shmid;
}
else
dprintf_global(stddeb,"DDE_malloc failed\n");
dprintf_warn(global, "DDE_malloc failed\n");
shm_write_signal(main_block->proc[curr_proc_idx].sem);
@ -173,7 +172,7 @@ HGLOBAL16 DDE_GlobalFree(HGLOBAL16 h)
int handle_index= h & 0x7fff;
struct local_shm_map map;
dprintf_global(stddeb,"DDE_GlobalFree(0x%04x)\n",h);
dprintf_info(global,"DDE_GlobalFree(0x%04x)\n",h);
if (h==0)
return 0;
@ -239,7 +238,7 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr)
if (segptr != NULL)
*segptr=0;
dprintf_global(stddeb,"DDE_AttachHandle(%04x)\n",handle);
dprintf_info(global,"DDE_AttachHandle(%04x)\n",handle);
h_info=locate_handle(handle, NULL);
if (h_info == NULL)
@ -250,7 +249,7 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr)
return NULL;
}
dprintf_global(stddeb,"DDE_AttachHandle: h_info=%06lx\n",(long)h_info);
dprintf_info(global,"DDE_AttachHandle: h_info=%06lx\n",(long)h_info);
shmdata.handle= handle;
shmdata.shmid= DDE_MEM_INFO(handle).shmid;
@ -264,10 +263,10 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr)
if (segptr != NULL)
*segptr= (SEGPTR)MAKELONG( 0, shmdata.sel);
if (debugging_dde)
if (debugging_info(dde))
debug_last_handle_size= h_info->size;
dprintf_global(stddeb,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr);
dprintf_info(global,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr);
return (LPSTR)ptr;

View File

@ -26,7 +26,6 @@
#include "dde_proc.h"
#include "dde_mem.h"
#include "dde.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
@ -48,9 +47,7 @@ sigjmp_buf env_wait_x;
#define DDE_MSG_SIZE sizeof(MSG16)
#define FREE_WND (WORD)(-2)
#define DELETED_WND (WORD)(-3)
#if defined(DEBUG_MSG) || defined(DEBUG_RUNTIME)
static char *msg_type[4]={"********", "DDE_SEND", "DDE_POST", "DDE_ACK"};
#endif
struct msg_dat {
struct msgbuf dat;
@ -126,7 +123,7 @@ void dde_proc_add(dde_proc procs)
{
dde_proc proc;
int proc_idx;
dprintf_dde(stddeb,"dde_proc_add(..)\n");
dprintf_info(dde,"dde_proc_add(..)\n");
shm_write_wait(main_block->sem);
/* find free proc_idx and allocate it */
@ -167,7 +164,7 @@ static BOOL32 get_ack()
size= msgrcv( main_block->proc[curr_proc_idx].msg , &ack_buff.dat,
1, DDE_ACK, IPC_NOWAIT);
if (size>=0) {
dprintf_msg(stddeb,"get_ack: received DDE_ACK message\n");
dprintf_info(msg,"get_ack: received DDE_ACK message\n");
return TRUE;
}
if (DDE_GetRemoteMessage()) {
@ -200,7 +197,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
return FALSE;
}
if (debugging_dde) {
if (debugging_info(dde) || debugging_warn_dde) {
MSG16 *msg=(MSG16*) &msgbuf->mtext;
char *title;
if (msgbuf->mtype==DDE_SEND)
@ -212,13 +209,13 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
if (title)
print_dde_message(title, msg);
else
fprintf(stddeb,"Unknown message type=0x%lx\n",msgbuf->mtype);
dprintf_warn(dde, "Unknown message type=0x%lx\n", msgbuf->mtype);
}
dprintf_msg(stddeb,
dprintf_info(msg,
"DDE_DoOneMessage: to proc_idx=%d (pid=%d), queue=%u\n",
proc_idx, proc->pid, (unsigned)proc->msg);
if ( proc->msg != -1) {
dprintf_msg(stddeb, "DDE_DoOneMessage: doing...(type=%s)\n",
dprintf_info(msg, "DDE_DoOneMessage: doing...(type=%s)\n",
msg_type[msgbuf->mtype]);
size=msgsnd (proc->msg, msgbuf, size, 0);
@ -228,7 +225,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
}
kill(proc->pid,SIGUSR2); /* tell the process there is a message */
dprintf_msg(stddeb,"DDE_DoOneMessage: "
dprintf_info(msg,"DDE_DoOneMessage: "
"Trying to get acknowledgment from msg queue=%d\n",
proc->msg);
Yield16(); /* force task switch, and */
@ -242,7 +239,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
}
}
else {
dprintf_msg(stddeb,"DDE_DoOneMessage: message not sent, "
dprintf_warn(msg, "DDE_DoOneMessage: message not sent, "
"target has no message queue\n");
return FALSE;
}
@ -315,11 +312,11 @@ static BOOL32 DDE_DoMessage( MSG16 *msg, int type )
if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND16)-1)
return FALSE;
dprintf_msg(stddeb, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n",
dprintf_info(msg, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n",
msg_type[type], (int)msg->hwnd,(int)msg->message);
dprintf_msg(stddeb,
dprintf_info(msg,
"DDE_DoMessage(hwnd=0x%x,msg=0x%x,..) // HWND_BROADCAST !\n",
(int)msg->hwnd,(int)msg->message);
remote_message=(void*)&msg_dat.dat.mtext;
@ -364,7 +361,7 @@ void dde_proc_send_ack(HWND16 wnd, BOOL32 val) {
proc=DDE_WIN2PROC(wnd);
msg=main_block->proc[proc].msg;
dprintf_msg(stddeb,"DDE_GetRemoteMessage: sending ACK "
dprintf_info(msg,"DDE_GetRemoteMessage: sending ACK "
"to wnd=%4x, proc=%d,msg=%d, pid=%d\n",wnd,proc,msg,
main_block->proc[proc].pid
);
@ -405,7 +402,7 @@ int DDE_GetRemoteMessage()
if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/
was_sent=TRUE;
dprintf_msg(stddeb,
dprintf_info(msg,
"DDE:receive sent message. msg=%04x wPar=%04x"
" lPar=%08lx\n",
remote_message->message, remote_message->wParam,
@ -416,7 +413,7 @@ int DDE_GetRemoteMessage()
if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/
was_sent=FALSE;
dprintf_msg(stddeb,
dprintf_info(msg,
"DDE:receive posted message. "
"msg=%04x wPar=%04x lPar=%08lx\n",
remote_message->message, remote_message->wParam,
@ -432,7 +429,7 @@ int DDE_GetRemoteMessage()
nesting++;
if (debugging_dde) {
if (debugging_info(dde)) {
char *title;
if (was_sent)
title="receive sent dde:";
@ -445,7 +442,7 @@ int DDE_GetRemoteMessage()
HWND16 dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd;
/* we should know exactly where to send the message (locally)*/
if (was_sent) {
dprintf_dde(stddeb,
dprintf_info(dde,
"SendMessage(wnd=0x%04x, msg=0x%04x, wPar=0x%04x,"
"lPar=0x%08x\n",
dde_window, remote_message->message,
@ -527,7 +524,7 @@ void DDE_TestDDE(HWND16 hwnd)
in_test--;
return;
}
dprintf_msg(stddeb,"DDE_TestDDE(0x%04x)\n", hwnd);
dprintf_info(msg,"DDE_TestDDE(0x%04x)\n", hwnd);
if (hwnd==0)
hwnd=-1;
/* just send a message to see how things are going */
@ -565,6 +562,7 @@ static void print_dde_message(char *desc, MSG16 *msg)
DDEADVISE *ddeadvise;
DDEDATA *ddedata;
DDEPOKE *ddepoke;
dbg_decl_str(dde, 2048);
if (is_dde_handle(msg->lParam & 0xffff) )
ptr=DDE_AttachHandle(msg->lParam&0xffff, NULL);
@ -573,8 +571,8 @@ static void print_dde_message(char *desc, MSG16 *msg)
wStatus=LOWORD(msg->lParam);
hWord=HIWORD(msg->lParam);
fprintf(stddeb,"%s", desc);
fprintf(stddeb,"%04x %04x==%s %04x %08lx ",
dsprintf(dde,"%s", desc);
dsprintf(dde,"%04x %04x==%s %04x %08lx ",
msg->hwnd, msg->message,"",/*MessageTypeNames[msg->message],*/
msg->wParam, msg->lParam);
switch(msg->message) {
@ -588,52 +586,52 @@ static void print_dde_message(char *desc, MSG16 *msg)
/* DDEADVISE: hOptions in WM_DDE_ADVISE message */
if (ptr) {
ddeadvise=ptr;
fprintf(stddeb,"fDeferUpd=%d,fAckReq=%d,cfFormat=0x%x",
dsprintf(dde,"fDeferUpd=%d,fAckReq=%d,cfFormat=0x%x",
ddeadvise->fDeferUpd, ddeadvise->fAckReq,
ddeadvise->cfFormat);
} else
fprintf(stddeb,"NO-DATA");
fprintf(stddeb," atom=0x%x",hWord);
dsprintf(dde,"NO-DATA");
dsprintf(dde," atom=0x%x",hWord);
break;
case WM_DDE_UNADVISE:
fprintf(stddeb,"format=0x%x, atom=0x%x",wStatus,hWord);
dsprintf(dde,"format=0x%x, atom=0x%x",wStatus,hWord);
break;
case WM_DDE_ACK:
ddeack=(DDEACK*)&wStatus;
fprintf(stddeb,"bAppReturnCode=%d,fBusy=%d,fAck=%d",
dsprintf(dde,"bAppReturnCode=%d,fBusy=%d,fAck=%d",
ddeack->bAppReturnCode, ddeack->fBusy, ddeack->fAck);
if (ddeack->fAck)
fprintf(stddeb,"(True)");
dsprintf(dde,"(True)");
else
fprintf(stddeb,"(False)");
dsprintf(dde,"(False)");
break;
case WM_DDE_DATA:
if (ptr) {
ddedata=ptr;
fprintf(stddeb,"fResponse=%d,fRelease=%d,"
dsprintf(dde,"fResponse=%d,fRelease=%d,"
"fAckReq=%d,cfFormat=0x%x,value=\"%.*s\"",
ddedata->fResponse, ddedata->fRelease,
ddedata->fAckReq, ddedata->cfFormat,
debug_last_handle_size- (int)sizeof(*ddedata)+1,
ddedata->Value);
} else
fprintf(stddeb,"NO-DATA");
fprintf(stddeb," atom=0x%04x",hWord);
dsprintf(dde,"NO-DATA");
dsprintf(dde," atom=0x%04x",hWord);
break;
case WM_DDE_POKE:
if (ptr) {
ddepoke=ptr;
fprintf(stddeb,"fRelease=%d,cfFormat=0x%x,value[0]='%c'",
dsprintf(dde,"fRelease=%d,cfFormat=0x%x,value[0]='%c'",
ddepoke->fRelease, ddepoke->cfFormat, ddepoke->Value[0]);
} else
fprintf(stddeb,"NO-DATA");
fprintf(stddeb," atom=0x%04x",hWord);
dsprintf(dde,"NO-DATA");
dsprintf(dde," atom=0x%04x",hWord);
break;
}
fprintf(stddeb,"\n");
dprintf_info(dde,"%s\n", dbg_str(dde));
}
void dde_proc_done(dde_proc proc)

View File

@ -16,9 +16,8 @@
#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
#include <stddebug.h>
#include <debug.h>
#include <global.h>
#include "debug.h"
#include "global.h"
#include "selectors.h"
#include "shm_fragment.h"
#include "shm_block.h"
@ -38,7 +37,7 @@ struct local_shm_map *shm_map=NULL;
*/
void shm_setup_block(struct shm_block *block, int first, int size)
{
dprintf_shm(stddeb,"Setting up shm block at 0x%08x\n",(int )block);
dprintf_info(shm,"Setting up shm block at 0x%08x\n",(int )block);
/* setup block internal data structure */
if (first <= 0) {
first=sizeof(*block);
@ -54,7 +53,7 @@ void shm_setup_block(struct shm_block *block, int first, int size)
/* block->size is initialized in shm_FragmentInit */
shm_FragmentInit(block, first, size); /* first item in the free list */
dprintf_shm(stddeb,
dprintf_info(shm,
"block was set up at 0x%08x, size=0x%04xKB, 1st usable=%02x\n",
(int )block,size/1024,first);
}

View File

@ -10,7 +10,6 @@
#ifdef CONFIG_IPC
#include <stdio.h> /* for debugging only */
#include <stddebug.h>
#include <debug.h> /* for "stddeb" */
#include "shm_fragment.h"

View File

@ -9,7 +9,6 @@
*/
#include <assert.h>
#include <stdio.h>
#include <stddebug.h>
#define DEBUG_DEFINE_VARIABLES /* just avoid dumb errors */
#include <debug.h> /* for "stddeb" */
#include <stdlib.h>

View File

@ -18,8 +18,7 @@
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <stddebug.h>
#include <debug.h>
#include "debug.h"
#include "shm_fragment.h"
#include "shm_block.h"
#include "shm_main_blk.h"
@ -80,7 +79,7 @@ int proc_exist(pid_t pid)
/* setup a new main shm block (only construct a shm block object). */
static void shm_setup_main_block()
{
dprintf_shm(stddeb,"creating data structure\n");
dprintf_info(shm,"creating data structure\n");
main_block->build_lock=1;
strcpy(main_block->magic, shm_header);
@ -134,29 +133,29 @@ static int attach_MainBlock(int shm_id)
/* Make sure we don't work on somebody else's block */
if (shm_info.shm_perm.cuid != getuid()) { /* creator is not me */
dprintf_shm(stddeb,"Creator is not me!\n");
dprintf_warn(shm, "Creator is not me!\n");
return 0;
}
dprintf_shm(stddeb,"shared memory exist, attaching anywhere\n");
dprintf_info(shm,"shared memory exist, attaching anywhere\n");
main_block=(struct shm_main_block *)shmat(shm_id, 0, 0);
if ( (int)main_block==-1) {
dprintf_shm(stddeb,"Attach failed\n");
dprintf_warn(shm, "Attach failed\n");
return 0;
}
if (strcmp(main_block->magic, shm_header) != 0) {
dprintf_shm(stddeb,"Detaching, wrong magic\n");
dprintf_info(shm,"Detaching, wrong magic\n");
shmdt((void *)main_block);
return 0;
}
if (debugging_shm)
if (debugging_info(shm))
print_shm_info(shm_id);
/* Is it an old unused block ? */
if (shm_info.shm_nattch == 0) {
dprintf_shm(stddeb,"No attaches, deleting old data\n");
dprintf_info(shm,"No attaches, deleting old data\n");
shm_delete_all(shm_id);
return 0;
}
@ -181,10 +180,10 @@ static int shm_locate_MainBlock(key_t shm_key)
int shm_id; /* Descriptor to this shared memory */
int i;
dprintf_shm(stddeb,"shm_locate_MainBlock: trying to attach, key=0x%x\n",
dprintf_info(shm,"shm_locate_MainBlock: trying to attach, key=0x%x\n",
shm_key);
for (i=0 ; i < SHM_KEY_RANGE ; i++) {
dprintf_shm(stddeb,"iteration=%d\n", i);
dprintf_info(shm,"iteration=%d\n", i);
shm_id= shmget ( shm_key+i, SHM_MINBLOCK ,0700);
@ -203,7 +202,7 @@ static int shm_locate_MainBlock(key_t shm_key)
case ENOMEM: /* no free memory */
case ENOENT: /* this key does not exist */
default :
dprintf_shm(stddeb,"shmget failed, errno=%d, %s\n",
dprintf_warn(shm,"shmget failed, errno=%d, %s\n",
errno, strerror(errno) );
return 0; /* Failed */
}
@ -223,7 +222,7 @@ static int shm_create_MainBlock(key_t MainShmKey)
int flags= 0700 | IPC_CREAT | IPC_EXCL;
int i;
dprintf_shm(stddeb,"creating shared memory\n");
dprintf_info(shm,"creating shared memory\n");
/* try to allocate shared memory with key="Wine", size=SHM_MINBLOCK, */
/* complete user permission */
@ -233,12 +232,12 @@ static int shm_create_MainBlock(key_t MainShmKey)
break;
}
if (shm_id == -1) {
dprintf_shm(stddeb,"failed to create shared memory\n");
dprintf_warn(shm, "failed to create shared memory\n");
return 0;
}
dprintf_shm(stddeb,"shared memory created, attaching\n");
dprintf_info(shm,"shared memory created, attaching\n");
main_block=(struct shm_main_block*) shmat(shm_id, 0,0);
if (debugging_shm)
if (debugging_info(shm))
print_shm_info(shm_id);
main_shm_id= shm_id;
shm_setup_main_block();

View File

@ -15,8 +15,7 @@
#include <sys/sem.h>
#include <stdio.h>
#include <errno.h>
#include <stddebug.h>
#include <debug.h>
#include "debug.h"
#include "shm_semaph.h"
#define SEM_READ 0
#define SEM_WRITE 1
@ -29,7 +28,7 @@ void shm_read_wait(shm_sem semid)
struct sembuf sop[2];
int ret;
dprintf_sem(stddeb,"shm_read_wait(%d)\n",semid);
dprintf_info(sem,"shm_read_wait(%d)\n",semid);
sop[0].sem_num=SEM_READ;
sop[0].sem_op=1; /* add this read instance */
sop[0].sem_flg=SEM_UNDO; /* undo in case process dies */
@ -51,7 +50,7 @@ void shm_write_wait(shm_sem semid)
struct sembuf sop[3];
int ret;
dprintf_sem(stddeb,"shm_write_wait(%d)\n",semid);
dprintf_info(sem,"shm_write_wait(%d)\n",semid);
sop[0].sem_num=SEM_READ;
sop[0].sem_op=0; /* wait until no reading instance exist */
sop[0].sem_flg=SEM_UNDO;
@ -77,7 +76,7 @@ void shm_write_signal(shm_sem semid)
struct sembuf sop[2];
int ret;
dprintf_sem(stddeb,"shm_write_signal(%d)\n",semid);
dprintf_info(sem,"shm_write_signal(%d)\n",semid);
sop[0].sem_num=SEM_READ;
sop[0].sem_op=-1;
sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */
@ -100,7 +99,7 @@ void shm_read_signal(shm_sem semid)
struct sembuf sop[2];
int ret;
dprintf_sem(stddeb,"shm_read_signal(%d)\n",semid);
dprintf_info(sem,"shm_read_signal(%d)\n",semid);
sop[0].sem_num=SEM_READ;
sop[0].sem_op=-1;
sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */

View File

@ -16,7 +16,6 @@
#include "shm_semaph.h"
#include <sys/shm.h>
#define DEBUG_DEFINE_VARIABLES
#include <stddebug.h>
#include <debug.h>
static volatile int * volatile data;

View File

@ -5,7 +5,6 @@
#include <win.h>
#define DEBUG_DEFINE_VARIABLES
#define DEBUG_ALL
#include <stddebug.h>
#include <debug.h>
#define DDE_PROC2WIN(proc_idx) ( (HWND) ~( (proc_idx)+1) )

View File

@ -1,17 +1,9 @@
/* Sample winestub.c file for compiling programs with libwine.so. */
#include <string.h>
#include <stdio.h>
#include "windows.h"
#include "xmalloc.h"
/* Stub needed for linking with Winelib */
/* FIXME: this should not be necessary */
HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ) {
fprintf(stderr,"BUILTIN_LoadModule(%s,%d) called in a library!\n",name,force);
return 0;
}
extern int PASCAL WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int);
extern BOOL32 MAIN_WinelibInit( int *argc, char *argv[] );
extern void TASK_Reschedule(void);
@ -23,7 +15,7 @@ char **_ARGV;
int main( int argc, char *argv [] )
{
HINSTANCE16 hInstance;
HINSTANCE32 hInstance;
LPSTR lpszCmdParam;
int i, len = 0;
_ARGC = argc;

View File

@ -11,8 +11,6 @@
#include <string.h>
#include <errno.h>
#include "windows.h"
#include "module.h"
#include "selectors.h"
#include "bitmap.h"
#include "comm.h"
#include "win.h"
@ -27,7 +25,6 @@
#include "heap.h"
#include "keyboard.h"
#include "miscemu.h"
#include "neexe.h"
#include "options.h"
#include "spy.h"
#include "task.h"
@ -36,7 +33,6 @@
#include "dce.h"
#include "shell.h"
#include "winproc.h"
#include "stddebug.h"
#include "debug.h"

View File

@ -16,7 +16,6 @@
#include "file.h"
#include "global.h"
#include "heap.h"
#include "hook.h"
#include "module.h"
#include "neexe.h"
#include "process.h"
@ -25,7 +24,6 @@
#include "stackframe.h"
#include "task.h"
#include "toolhelp.h"
#include "stddebug.h"
#include "debug.h"
#include "callback.h"
@ -34,6 +32,9 @@ extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params
static HMODULE16 hFirstModule = 0;
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;
/***********************************************************************
* MODULE_GetPtr
@ -268,7 +269,7 @@ int MODULE_OpenFile( HMODULE32 hModule )
static int cachedfd = -1;
hModule = MODULE_HANDLEtoHMODULE16(hModule);
dprintf_module( stddeb, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n",
dprintf_info(module, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n",
hModule, hCachedModule, cachedfd );
if (!(pModule = MODULE_GetPtr( hModule ))) return -1;
if (hCachedModule == hModule) return cachedfd;
@ -279,7 +280,7 @@ int MODULE_OpenFile( HMODULE32 hModule )
(cachedfd = open( full_name.long_name, O_RDONLY )) == -1)
fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module %04x\n",
name, hModule );
dprintf_module( stddeb, "MODULE_OpenFile: opened '%s' -> %d\n",
dprintf_info(module, "MODULE_OpenFile: opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
}
@ -568,7 +569,7 @@ static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{
fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count;
fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
dprintf_module( stddeb, "Using fast-load area offset=%x len=%d\n",
dprintf_info(module, "Using fast-load area offset=%x len=%d\n",
fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
{
@ -755,7 +756,7 @@ WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
dprintf_module( stddeb, "MODULE_GetOrdinal(%04x,'%s')\n",
dprintf_info(module, "MODULE_GetOrdinal(%04x,'%s')\n",
hModule, name );
/* First handle names of the form '#xxxx' */
@ -778,7 +779,7 @@ WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
dprintf_module( stddeb, " Found: ordinal=%d\n",
dprintf_info(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
@ -796,7 +797,7 @@ WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
{
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
dprintf_module( stddeb, " Found: ordinal=%d\n",
dprintf_info(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1);
}
@ -1043,7 +1044,7 @@ static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
if (ordinal) WEP = MODULE_GetEntryPoint( hModule, ordinal );
if (!WEP)
{
dprintf_module( stddeb, "module %04x doesn't have a WEP\n", hModule );
dprintf_warn(module, "module %04x doesn't have a WEP\n", hModule );
return FALSE;
}
return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
@ -1157,13 +1158,13 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
if (!hModule) /* We have to load the module */
{
/* Try to load the built-in first if not disabled */
if ((hModule = BUILTIN_LoadModule( name, FALSE )))
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 = BUILTIN_LoadModule( name, TRUE )))
if ((hModule = fnBUILTIN_LoadModule( name, TRUE )))
{
fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name );
return MODULE_HANDLEtoHMODULE16( hModule );
@ -1267,12 +1268,34 @@ HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
}
/**********************************************************************
* LoadModule32 (KERNEL32)
* FIXME: check this function
* LoadModule32 (KERNEL32.499)
*
* FIXME
*
* This should get implemented via CreateProcess -- MODULE_Load
* is resolutely 16-bit.
*/
DWORD LoadModule32( LPCSTR name, LPVOID paramBlock )
{
#ifdef 0
LOADPARAMS32 *p = paramBlock;
STARTUPINFO st;
PROCESSINFORMATION pi;
st.cb = sizeof(STARTUPINFO);
st.wShowWindow = p->lpCmdShow[2] ; WRONG
BOOL32 ret = CreateProcess32A( name, p->lpCmdLine,
NULL, NULL, FALSE, 0, p->lpEnvAddress,
NULL, &st, &pi);
if (!ret) {
/* handle errors appropriately */
}
CloseHandle32(pi.hProcess);
CloseHandle32(pi.hThread);
#else
return MODULE_Load( name, paramBlock, 0 );
#endif
}
@ -1284,7 +1307,7 @@ BOOL16 WINAPI FreeModule16( HMODULE16 hModule )
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
dprintf_module( stddeb, "FreeModule16: %s count %d\n",
dprintf_info(module, "FreeModule16: %s count %d\n",
MODULE_GetModuleName(hModule), pModule->count );
return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) );
@ -1312,7 +1335,7 @@ HMODULE32 WINAPI GetModuleHandle32A(LPCSTR module)
{
HMODULE32 hModule;
dprintf_win32(stddeb, "GetModuleHandleA: %s\n", module ? module : "NULL");
dprintf_info(win32, "GetModuleHandleA: %s\n", module ? module : "NULL");
/* Freecell uses the result of GetModuleHandleA(0) as the hInstance in
all calls to e.g. CreateWindowEx. */
if (module == NULL) {
@ -1341,7 +1364,7 @@ INT16 WINAPI GetModuleUsage( HINSTANCE16 hModule )
NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
dprintf_module( stddeb, "GetModuleUsage(%04x): returning %d\n",
dprintf_info(module, "GetModuleUsage(%04x): returning %d\n",
hModule, pModule->count );
return pModule->count;
}
@ -1358,7 +1381,7 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
if (!hModule) hModule = GetCurrentTask();
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
dprintf_module( stddeb, "GetModuleFileName16: %s\n", lpFileName );
dprintf_info(module, "GetModuleFileName16: %s\n", lpFileName );
return strlen(lpFileName);
}
@ -1378,7 +1401,7 @@ DWORD WINAPI GetModuleFileName32A( HMODULE32 hModule, LPSTR lpFileName,
}
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size );
dprintf_module( stddeb, "GetModuleFileName32A: %s\n", lpFileName );
dprintf_info(module, "GetModuleFileName32A: %s\n", lpFileName );
return strlen(lpFileName);
}
@ -1473,7 +1496,7 @@ HMODULE32 WINAPI LoadLibraryEx32W(LPCWSTR libnameW,HFILE32 hfile,DWORD flags)
*/
BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule)
{
dprintf_module(stddeb,"FreeLibrary: hLibModule: %08x\n", hLibModule);
dprintf_info(module,"FreeLibrary: hLibModule: %08x\n", hLibModule);
return MODULE_FreeModule(hLibModule,
GlobalLock16(GetCurrentTask()) );
}
@ -1491,7 +1514,7 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
fprintf( stderr, "LoadLibrary not supported in Winelib\n" );
return 0;
}
dprintf_module( stddeb, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
dprintf_info(module, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
handle = MODULE_Load( libname, (LPVOID)-1, 0 );
if (handle == (HINSTANCE16)2) /* file not found */
@ -1521,7 +1544,7 @@ HINSTANCE32 WINAPI PrivateLoadLibrary(LPCSTR libname)
*/
void WINAPI FreeLibrary16( HINSTANCE16 handle )
{
dprintf_module( stddeb,"FreeLibrary: %04x\n", handle );
dprintf_info(module,"FreeLibrary: %04x\n", handle );
FreeModule16( handle );
}
@ -1553,7 +1576,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
{
LOADPARAMS params;
HGLOBAL16 cmdShowHandle, cmdLineHandle;
HINSTANCE16 handle = 2;
HINSTANCE32 handle = 2;
WORD *cmdShowPtr;
char *p, *cmdline, filename[256];
static int use_load_module = 1;
@ -1630,7 +1653,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
params.cmdLine = (SEGPTR)WIN16_GlobalLock16( cmdLineHandle );
params.showCmd = (SEGPTR)WIN16_GlobalLock16( cmdShowHandle );
params.reserved = 0;
handle = LoadModule16( filename, &params );
handle = LoadModule32( filename, &params );
if (handle == 2) /* file not found */
{
/* Check that the original file name did not have a suffix */
@ -1735,16 +1758,16 @@ FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPSTR name )
hModule = MODULE_HANDLEtoHMODULE16(hModule);
if (HIWORD(name)) {
ordinal = MODULE_GetOrdinal( hModule, name );
dprintf_module( stddeb, "WIN32_GetProcAddress16: %04x '%s'\n",
dprintf_info(module, "WIN32_GetProcAddress16: %04x '%s'\n",
hModule, name );
} else {
ordinal = LOWORD(name);
dprintf_module( stddeb, "GetProcAddress: %04x %04x\n",
dprintf_info(module, "GetProcAddress: %04x %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
dprintf_module(stddeb,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret);
dprintf_info(module,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret);
return ret;
}
@ -1762,20 +1785,20 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name )
if (HIWORD(name) != 0)
{
ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
dprintf_module( stddeb, "GetProcAddress: %04x '%s'\n",
dprintf_info(module, "GetProcAddress: %04x '%s'\n",
hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
}
else
{
ordinal = LOWORD(name);
dprintf_module( stddeb, "GetProcAddress: %04x %04x\n",
dprintf_info(module, "GetProcAddress: %04x %04x\n",
hModule, ordinal );
}
if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal );
dprintf_module( stddeb, "GetProcAddress: returning %08x\n", (UINT32)ret );
dprintf_info(module, "GetProcAddress: returning %08x\n", (UINT32)ret );
return ret;
}
@ -1788,9 +1811,9 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
NE_MODULE *pModule;
if (HIWORD(function))
dprintf_win32(stddeb,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function);
dprintf_info(win32,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function);
else
dprintf_win32(stddeb,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
dprintf_info(win32,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function);
if (!(pModule = MODULE_GetPtr( hModule )))
return (FARPROC32)0;
if (!pModule->module32)

View File

@ -23,7 +23,6 @@
#include "file.h"
#include "module.h"
#include "stackframe.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
@ -55,7 +54,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (!pSeg->filepos) return TRUE; /* No file image, just return */
fd = MODULE_OpenFile( pModule->self );
dprintf_module( stddeb, "Loading segment %d, selector=%04x, flags=%04x\n",
dprintf_info(module, "Loading segment %d, selector=%04x, flags=%04x\n",
segnum, pSeg->selector, pSeg->flags );
lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
if (pSeg->size) size = pSeg->size;
@ -143,7 +142,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
read( fd, &count, sizeof(count) );
if (!count) return TRUE;
dprintf_fixup( stddeb, "Fixups for %*.*s, segment %d, selector %04x\n",
dprintf_info(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
*((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
@ -153,7 +152,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) !=
count * sizeof(struct relocation_entry_s))
{
dprintf_fixup( stddeb, "Unable to read relocation information\n" );
dprintf_warn(fixup, "Unable to read relocation information\n" );
return FALSE;
}
@ -194,10 +193,10 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
(char *)pTarget + pTarget->name_table + 1,
ordinal );
}
if (debugging_fixup)
if (debugging_info(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
fprintf( stddeb,"%d: %*.*s.%d=%04x:%04x\n", i + 1,
dprintf_info(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
@ -215,17 +214,17 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
address = MODULE_GetEntryPoint( module, ordinal );
if (!address)
if (debugging_err(fixup) && !address)
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
fprintf( stderr, "Warning: no handler for %.*s.%s, setting to 0:0\n",
dprintf_err(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
}
if (debugging_fixup)
if (debugging_info(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
fprintf( stddeb,"%d: %.*s.%s=%04x:%04x\n", i + 1,
dprintf_info(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address) );
@ -242,7 +241,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
}
dprintf_fixup(stddeb,"%d: %04x:%04x\n",
dprintf_info(fixup,"%d: %04x:%04x\n",
i + 1, HIWORD(address), LOWORD(address) );
break;
@ -255,21 +254,17 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
* successfully emulate the coprocessor if it doesn't
* exist.
*/
dprintf_fixup(stddeb,
"%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, ",
dprintf_info(fixup,
"%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
dprintf_fixup(stddeb,"TARGET %04x %04x\n",
rep->target1, rep->target2);
rep->offset, rep->target1, rep->target2);
continue;
default:
dprintf_fixup(stddeb,
"WARNING: %d: ADDR TYPE %d, unknown TYPE %d, OFFSET %04x, ",
dprintf_warn(fixup, "WARNING: %d: ADDR TYPE %d, "
"unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
dprintf_fixup(stddeb,"TARGET %04x %04x\n",
rep->target1, rep->target2);
rep->offset, rep->target1, rep->target2);
free(reloc_entries);
return FALSE;
}
@ -287,7 +282,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_LOWBYTE:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x BYTE%s\n",
dprintf_info(fixup," %04x:%04x:%04x BYTE%s\n",
pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp;
if(additive)
@ -301,7 +296,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_OFFSET16:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x OFFSET16%s\n",
dprintf_info(fixup," %04x:%04x:%04x OFFSET16%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
@ -313,7 +308,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_POINTER32:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x POINTER32%s\n",
dprintf_info(fixup," %04x:%04x:%04x POINTER32%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
@ -326,7 +321,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_SELECTOR:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_fixup(stddeb," %04x:%04x:%04x SELECTOR%s\n",
dprintf_info(fixup," %04x:%04x:%04x SELECTOR%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = HIWORD(address);
@ -339,12 +334,10 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
break;
default:
dprintf_fixup(stddeb,
"WARNING: %d: unknown ADDR TYPE %d, TYPE %d, OFFSET %04x, ",
dprintf_warn(fixup, "WARNING: %d: unknown ADDR TYPE %d, "
"TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset);
dprintf_fixup(stddeb,
"TARGET %04x %04x\n", rep->target1, rep->target2);
rep->offset, rep->target1, rep->target2);
free(reloc_entries);
return FALSE;
}
@ -374,7 +367,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
DWORD oldstack;
WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
dprintf_module(stddeb, "MODULE_Load: %.*s is a self-loading module!\n",
dprintf_info(module, "NE_LoadAllSegments: %.*s is a self-loading module!\n",
*((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1);
if (!NE_LoadSegment( pModule, 1 )) return FALSE;
@ -431,7 +424,7 @@ BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" );
dprintf_module( stddeb, "Loading '%s'\n", buffer );
dprintf_info(module, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule( buffer )))
{
/* If the DLL is not loaded yet, load it and store */
@ -483,12 +476,13 @@ void NE_FixupPrologs( NE_MODULE *pModule )
WORD dgroup = 0;
WORD sel;
BYTE *p, *fixup_ptr, count;
dbg_decl_str(module, 512);
pSegTable = NE_SEG_TABLE(pModule);
if (pModule->flags & NE_FFLAGS_SINGLEDATA)
dgroup = pSegTable[pModule->dgroup-1].selector;
dprintf_module( stddeb, "MODULE_FixupPrologs(%04x)\n", pModule->self );
dprintf_info(module, "MODULE_FixupPrologs(%04x)\n", pModule->self );
p = (BYTE *)pModule + pModule->entry_table;
while (*p)
{
@ -509,21 +503,23 @@ void NE_FixupPrologs( NE_MODULE *pModule )
p += 2;
while (count-- > 0)
{
dprintf_module( stddeb,"Flags: %04x, sel %02x ", *p, sel);
dbg_reset_str(module);
dsprintf(module,"Flags: %04x, sel %02x ", *p, sel);
/* According to the output generated by TDUMP, the flags mean:
* 0x0001 function is exported
* 0x0002 Single data (seems to occur only in DLLs)
*/
if (sel == 0xff) { /* moveable */
dprintf_module( stddeb, "(%02x) o %04x ", p[3], *(WORD *)(p+4) );
dsprintf(module, "(%02x) o %04x", p[3], *(WORD *)(p+4) );
fixup_ptr = (char *)GET_SEL_BASE(pSegTable[p[3]-1].selector) + *(WORD *)(p + 4);
} else { /* fixed */
dprintf_module( stddeb, "offset %04x ", *(WORD *)(p+1) );
fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) + *(WORD *)(p + 1);
dsprintf(module, "offset %04x", *(WORD *)(p+1) );
fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) +
*(WORD *)(p + 1);
}
dprintf_module( stddeb, "Signature: %02x %02x %02x,ff %x\n",
fixup_ptr[0], fixup_ptr[1], fixup_ptr[2],
pModule->flags );
dprintf_info(module, "%s Signature: %02x %02x %02x,ff %x\n",
dbg_str(module), fixup_ptr[0], fixup_ptr[1],
fixup_ptr[2], pModule->flags );
if (*p & 0x0001)
{
/* Verify the signature */
@ -553,11 +549,11 @@ void NE_FixupPrologs( NE_MODULE *pModule )
}
}
} else {
dprintf_fixup( stddeb, "Unknown signature\n" );
dprintf_warn(fixup, "Unknown signature\n" );
}
}
else
dprintf_module( stddeb,"\n");
dprintf_info(module,"\n");
p += (sel == 0xff) ? 6 : 3;
}
}
@ -618,9 +614,18 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
}
else /* DATA SINGLE DLL */
{
if (pModule->dgroup) {
DS_reg(&context) = pSegTable[pModule->dgroup-1].selector;
ECX_reg(&context) = pModule->heap_size;
}
else /* hmm, DLL has no dgroup,
but why has it NE_FFLAGS_SINGLEDATA set ?
Buggy DLL compiler ? */
{
DS_reg(&context) = 0;
ECX_reg(&context) = 0;
}
}
CS_reg(&context) = pSegTable[pModule->cs-1].selector;
EIP_reg(&context) = pModule->ip;
@ -630,7 +635,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
pModule->cs = 0; /* Don't initialize it twice */
dprintf_dll( stddeb, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n",
dprintf_info(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n",
CS_reg(&context), IP_reg(&context), DS_reg(&context),
DI_reg(&context), CX_reg(&context) );
Callbacks->CallRegisterShortProc( &context, 0 );

View File

@ -18,7 +18,6 @@
#include "module.h"
#include "neexe.h"
#include "resource.h"
#include "stddebug.h"
#include "debug.h"
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
@ -47,13 +46,13 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, SEGPTR typeId, SEGPTR resId
pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1);
for (count = pTypeInfo->count; count > 0; count--, pNameInfo++)
{
dprintf_resource( stddeb, "NameTable entry: type=%04x id=%04x\n",
dprintf_info(resource, "NameTable entry: type=%04x id=%04x\n",
pTypeInfo->type_id, pNameInfo->id );
handle = LoadResource16( pModule->self,
(HRSRC16)((int)pNameInfo - (int)pModule) );
for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p))
{
dprintf_resource( stddeb," type=%04x '%s' id=%04x '%s'\n",
dprintf_info(resource," type=%04x '%s' id=%04x '%s'\n",
p[1], (char *)(p+3), p[2],
(char *)(p+3)+strlen((char *)(p+3))+1 );
/* Check for correct type */
@ -81,7 +80,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, SEGPTR typeId, SEGPTR resId
/* If we get here, we've found the entry */
dprintf_resource( stddeb, " Found!\n" );
dprintf_info(resource, " Found!\n" );
ret = MAKELONG( p[1], p[2] );
break;
}
@ -113,11 +112,11 @@ static NE_TYPEINFO* NE_FindTypeSection( NE_MODULE *pModule,
BYTE *p = (BYTE*)pModule + pModule->res_table + pTypeInfo->type_id;
if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
{
dprintf_resource( stddeb, " Found type '%s'\n", str );
dprintf_info(resource, " Found type '%s'\n", str );
return pTypeInfo;
}
}
dprintf_resource( stddeb, " Skipping type %04x\n", pTypeInfo->type_id );
dprintf_info(resource, " Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
@ -128,10 +127,10 @@ static NE_TYPEINFO* NE_FindTypeSection( NE_MODULE *pModule,
{
if (pTypeInfo->type_id == id)
{
dprintf_resource( stddeb, " Found type %04x\n", id );
dprintf_info(resource, " Found type %04x\n", id );
return pTypeInfo;
}
dprintf_resource( stddeb, " Skipping type %04x\n", pTypeInfo->type_id );
dprintf_info(resource, " Skipping type %04x\n", pTypeInfo->type_id );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
}
@ -189,7 +188,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
dprintf_resource( stddeb, "NEResourceHandler: loading, pos=%d, len=%d\n",
dprintf_info(resource, "NEResourceHandler: loading, pos=%d, len=%d\n",
(int)pNameInfo->offset << sizeShift,
(int)pNameInfo->length << sizeShift );
if( hMemObj )
@ -217,7 +216,7 @@ BOOL32 NE_InitResourceHandler( HMODULE16 hModule )
NE_MODULE *pModule = MODULE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
dprintf_resource(stddeb,"InitResourceHandler[%04x]\n", hModule );
dprintf_info(resource,"InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
@ -280,15 +279,15 @@ HRSRC16 NE_FindResource( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId )
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
if( hRsrc )
{
dprintf_resource( stddeb, " Found id %08lx\n", resId );
dprintf_info(resource, " Found id %08lx\n", resId );
return hRsrc;
}
dprintf_resource( stddeb, " Not found, going on\n" );
dprintf_info(resource, " Not found, going on\n" );
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
} while( pTypeInfo );
dprintf_resource( stddeb, "failed!\n");
dprintf_warn(resource, "failed!\n");
return 0;
}
@ -389,7 +388,7 @@ HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc )
&& !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
{
pNameInfo->usage++;
dprintf_resource( stddeb, " Already loaded, new count=%d\n",
dprintf_info(resource, " Already loaded, new count=%d\n",
pNameInfo->usage );
}
else
@ -460,7 +459,7 @@ BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle )
pTypeInfo = (NE_TYPEINFO *)pNameInfo;
}
dprintf_resource(stddeb, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n",
dprintf_info(resource, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n",
hModule, handle );
GlobalFree16( handle ); /* it could have been DirectResAlloc()'ed */
return handle;

View File

@ -1,7 +1,7 @@
/*
* Copyright 1994 Eric Youndale & Erik Bos
* Copyright 1995 Martin von Löwis
* Copyright 1996 Marcus Meissner
* Copyright 1996-98 Marcus Meissner
*
* based on Eric Youndale's pe-test and:
*
@ -9,8 +9,26 @@
* make that:
* ftp.microsoft.com:/developr/MSDN/OctCD/PEFILE.ZIP
*/
/* Notes:
* Before you start changing something in this file be aware of the following:
*
* - There are several functions called recursively. In a very subtle and
* obscure way. DLLs can reference each other recursively etc.
* - If you want to enhance, speed up or clean up something in here, think
* twice WHY it is implemented in that strange way. There is usually a reason.
* Though sometimes it might just be lazyness ;)
* - In PE_MapImage, right before fixup_imports() all external and internal
* state MUST be correct since this function can be called with the SAME image
* AGAIN. (Thats recursion for you.) That means MODREF.module and
* NE_MODULE.module32.
* - No, you cannot use Linux mmap() to mmap() the images directly. Linux aligns
* them at pagesize (4096), Win32 requires 512 byte alignment.
* - All those function map things into a new addresspace. From the wrong
* process and the wrong thread. So calling other API functions will mess
* things up badly sometimes.
*/
#include <ctype.h>
/*#include <ctype.h>*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@ -32,7 +50,6 @@
#include "global.h"
#include "task.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
@ -57,7 +74,7 @@ void dump_exports( HMODULE32 hModule )
IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
Module = (char*)RVA(pe_exports->Name);
dprintf_win32(stddeb,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n",
dprintf_info(win32,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n",
Module,
pe_exports->NumberOfFunctions,
pe_exports->NumberOfNames);
@ -66,19 +83,23 @@ void dump_exports( HMODULE32 hModule )
functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
name=(u_char**) RVA(pe_exports->AddressOfNames);
dprintf_win32(stddeb," Ord RVA Addr Name\n" );
dprintf_info(win32," Ord RVA Addr Name\n" );
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
{
if (!*function) continue; /* No such function */
dprintf_win32( stddeb,"%4ld %08lx %08x",
if (debugging_info(win32)){
dbg_decl_str(win32, 1024);
dsprintf(win32,"%4ld %08lx %08x",
i + pe_exports->Base, *function, RVA(*function) );
/* Check if we have a name for it */
for (j = 0; j < pe_exports->NumberOfNames; j++)
if (ordinal[j] == i)
dprintf_win32( stddeb, " %s", (char*)RVA(name[j]) );
dsprintf(win32, " %s", (char*)RVA(name[j]) );
if ((*function >= rva_start) && (*function <= rva_end))
dprintf_win32(stddeb, " (forwarded -> %s)", (char *)RVA(*function));
dprintf_win32( stddeb,"\n" );
dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function));
dprintf_info(win32,"%s\n", dbg_str(win32));
}
}
}
@ -114,9 +135,9 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
exports = pem->pe_export;
if (HIWORD(funcName))
dprintf_win32(stddeb,"PE_FindExportedFunction(%s)\n",funcName);
dprintf_info(win32,"PE_FindExportedFunction(%s)\n",funcName);
else
dprintf_win32(stddeb,"PE_FindExportedFunction(%d)\n",(int)funcName);
dprintf_info(win32,"PE_FindExportedFunction(%d)\n",(int)funcName);
if (!exports) {
fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem);
return NULL;
@ -136,6 +157,7 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
if(!strcmp(ename,funcName))
{
addr = function[*ordinal];
if (!addr) return NULL;
if ((addr < rva_start) || (addr >= rva_end))
return (FARPROC32)RVA(addr);
forward = (char *)RVA(addr);
@ -146,11 +168,12 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
}
} else {
if (LOWORD(funcName)-exports->Base > exports->NumberOfFunctions) {
dprintf_win32(stddeb," ordinal %d out of range!\n",
dprintf_info(win32," ordinal %d out of range!\n",
LOWORD(funcName));
return NULL;
}
addr = function[(int)funcName-exports->Base];
if (!addr) return NULL;
if ((addr < rva_start) || (addr >= rva_end))
return (FARPROC32)RVA(addr);
forward = (char *)RVA(addr);
@ -183,7 +206,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
modname = "<unknown>";
/* OK, now dump the import list */
dprintf_win32 (stddeb, "\nDumping imports list\n");
dprintf_info(win32, "\nDumping imports list\n");
/* first, count the number of imported non-internal modules */
pe_imp = pem->pe_import;
@ -230,27 +253,24 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
xpem = xpem->next;
}
if (xpem) {
/* it has been loaded *BEFORE* us, so we have to init
* it before us. we just swap the two modules which should
* work.
/* It has been loaded *BEFORE* us, so we have to initialize
* it before us. We cannot just link in the xpem before pem,
* since xpem might reference more dlls which would be in the
* wrong order after that.
* Instead we link in pem right AFTER xpem, which should keep
* the correct order. (I am not 100% sure about that.)
*/
/* unlink xpem from chain */
ypem = &(process->modref_list);
while (*ypem) {
if ((*ypem)==xpem)
break;
ypem = &((*ypem)->next);
}
*ypem = xpem->next;
/* link it directly before pem */
/* unlink pem from chain */
ypem = &(process->modref_list);
while (*ypem) {
if ((*ypem)==pem)
break;
ypem = &((*ypem)->next);
}
*ypem = xpem;
*ypem = pem->next;
/* link pem directly AFTER xpem */
pem->next = xpem->next;
xpem->next = pem;
}
@ -265,12 +285,12 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
Module = (char *) RVA(pe_imp->Name);
hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) );
dprintf_win32 (stddeb, "%s\n", Module);
dprintf_info(win32, "%s\n", Module);
/* FIXME: forwarder entries ... */
if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */
dprintf_win32 (stddeb, "Microsoft style imports used\n");
dprintf_info(win32, "Microsoft style imports used\n");
import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
@ -278,7 +298,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
dprintf_win32 (stddeb, "--- Ordinal %s,%d\n", Module, ordinal);
dprintf_info(win32, "--- Ordinal %s,%d\n", Module, ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR)ordinal);
if (!thunk_list->u1.Function) {
@ -288,7 +308,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
}
} else { /* import by name */
pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
dprintf_win32 (stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
dprintf_info(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name);
if (!thunk_list->u1.Function) {
@ -301,14 +321,14 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
thunk_list++;
}
} else { /* Borland style */
dprintf_win32 (stddeb, "Borland style imports used\n");
dprintf_info(win32, "Borland style imports used\n");
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
while (thunk_list->u1.Ordinal) {
if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
/* not sure about this branch, but it seems to work */
int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal);
dprintf_win32(stddeb,"--- Ordinal %s.%d\n",Module,ordinal);
dprintf_info(win32,"--- Ordinal %s.%d\n",Module,ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR) ordinal);
if (!thunk_list->u1.Function) {
@ -318,7 +338,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
}
} else {
pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
dprintf_win32(stddeb,"--- %s %s.%d\n",
dprintf_info(win32,"--- %s %s.%d\n",
pe_name->Name,Module,pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name );
@ -342,11 +362,11 @@ static int calc_vma_size( HMODULE32 hModule )
int i,vma_size = 0;
IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule);
dprintf_win32(stddeb, "Dump of segment table\n");
dprintf_win32(stddeb, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
dprintf_info(win32, "Dump of segment table\n");
dprintf_info(win32, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
{
dprintf_win32(stddeb, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n",
dprintf_info(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n",
pe_seg->Name,
pe_seg->Misc.VirtualSize,
pe_seg->VirtualAddress,
@ -381,14 +401,14 @@ static void do_relocations(PE_MODREF *pem)
char *page = (char*) RVA(r->VirtualAddress);
int count = (r->SizeOfBlock - 8)/2;
int i;
dprintf_fixup(stddeb, "%x relocations for page %lx\n",
dprintf_info(fixup, "%x relocations for page %lx\n",
count, r->VirtualAddress);
/* patching in reverse order */
for(i=0;i<count;i++)
{
int offset = r->TypeOffset[i] & 0xFFF;
int type = r->TypeOffset[i] >> 12;
dprintf_fixup(stddeb,"patching %x type %x\n", offset, type);
dprintf_info(fixup,"patching %x type %x\n", offset, type);
switch(type)
{
case IMAGE_REL_BASED_ABSOLUTE: break;
@ -495,7 +515,7 @@ error:
/**********************************************************************
* This maps a loaded PE dll into the address space of the specified process.
*/
static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
OFSTRUCT *ofs, DWORD flags )
{
PE_MODREF *pem;
@ -504,6 +524,7 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
IMAGE_DATA_DIRECTORY dir;
char *modname;
int vma_size;
HMODULE32 hModule = *phModule;
IMAGE_SECTION_HEADER *pe_seg;
IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hModule;
@ -524,7 +545,7 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
load_addr = nt_header->OptionalHeader.ImageBase;
vma_size = calc_vma_size( hModule );
dprintf_win32(stddeb, "Load addr is %lx\n",load_addr);
dprintf_info(win32, "Load addr is %lx\n",load_addr);
load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size,
MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE );
@ -533,9 +554,12 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE );
}
pem->module = (HMODULE32)load_addr;
/* *phModule is the module32 entry in the NE_MODULE. We need to
* change it here, since it can get referenced by fixup_imports()
*/
pem->module = *phModule = (HMODULE32)load_addr;
dprintf_win32(stddeb, "Load addr is really %lx, range %x\n",
dprintf_info(win32, "Load addr is really %lx, range %x\n",
load_addr, vma_size);
/* Store the NT header at the load addr
@ -611,10 +635,10 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
}
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
dprintf_win32(stdnimp,"Exception directory ignored\n");
dprintf_fixme(win32,"Exception directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size)
dprintf_win32(stdnimp,"Security directory ignored\n");
dprintf_fixme(win32,"Security directory ignored\n");
@ -628,29 +652,29 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
dprintf_win32(stdnimp,"Copyright string ignored\n");
dprintf_fixme(win32,"Copyright string ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size)
dprintf_win32(stdnimp,"Global Pointer (MIPS) ignored\n");
dprintf_fixme(win32,"Global Pointer (MIPS) ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size)
dprintf_win32(stdnimp,"Load Configuration directory ignored\n");
dprintf_fixme(win32,"Load Configuration directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size)
dprintf_win32(stdnimp,"Bound Import directory ignored\n");
dprintf_fixme(win32,"Bound Import directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_IAT].Size)
dprintf_win32(stdnimp,"Import Address Table directory ignored\n");
dprintf_fixme(win32,"Import Address Table directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory[13].Size)
dprintf_win32(stdnimp,"Unknown directory 13 ignored\n");
dprintf_fixme(win32,"Unknown directory 13 ignored\n");
if(nt_header->OptionalHeader.DataDirectory[14].Size)
dprintf_win32(stdnimp,"Unknown directory 14 ignored\n");
dprintf_fixme(win32,"Unknown directory 14 ignored\n");
if(nt_header->OptionalHeader.DataDirectory[15].Size)
dprintf_win32(stdnimp,"Unknown directory 15 ignored\n");
dprintf_fixme(win32,"Unknown directory 15 ignored\n");
if(pem->pe_reloc) do_relocations(pem);
if(pem->pe_export) dump_exports(pem->module);
@ -691,7 +715,7 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process,
/* Now that we got everything at the right address,
* we can unmap the previous module */
UnmapViewOfFile( (LPVOID)hModule );
return (HMODULE32)load_addr;
return 1;
}
HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params);
@ -705,7 +729,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
HFILE32 hFile, DWORD flags)
{
OFSTRUCT ofs;
HMODULE32 hModule,ret;
HMODULE32 hModule;
NE_MODULE *pModule;
PE_MODREF *pem;
@ -767,13 +791,11 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
if (pModule->module32 < 32) return 21;
}
/* recurse */
ret = PE_MapImage( pModule->module32, process, &ofs,flags);
if (!ret) {
if (!PE_MapImage( &(pModule->module32), process, &ofs,flags)) {
/* should free this module and the already referenced ones */
return 0;
}
pModule->module32 = ret;
return ret;
return pModule->module32;
}
/*****************************************************************************
@ -784,7 +806,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
{
HMODULE16 hModule16;
HMODULE32 hModule32, ret;
HMODULE32 hModule32;
HINSTANCE16 hInstance;
NE_MODULE *pModule;
THDB *thdb = THREAD_Current();
@ -807,20 +829,19 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
TDB *pTask = (TDB *)GlobalLock16( hTask );
thdb = pTask->thdb;
}
if (!(ret = PE_MapImage( hModule32, thdb->process, ofs, 0 )))
if (!PE_MapImage( &(pModule->module32), thdb->process, ofs, 0 ))
{
/* FIXME: should destroy the task created ... */
/* FIXME: should destroy the task created and free referenced stuff */
return 0;
}
pModule->module32 = ret;
/* yuck. but there is no other good place to do that... */
/* FIXME: Yuck. Is there no other good place to do that? */
PE_InitTls( thdb );
return hInstance;
}
int PE_UnloadImage( HMODULE32 hModule )
{
printf("PEunloadImage() called!\n");
fprintf(stderr,"PEunloadImage() called!\n");
/* free resources, image, unmap */
return 1;
}
@ -848,7 +869,7 @@ static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
) {
FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module,
OptionalHeader.AddressOfEntryPoint );
dprintf_relay( stddeb, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
dprintf_info(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
entry, pem->module, type, lpReserved );
entry( pem->module, type, lpReserved );
}
@ -899,7 +920,7 @@ void PE_InitTls(THDB *thdb)
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);
if (!(pem->flags & PE_MODREF_TLS_ALLOCED)) {
pem->tlsindex = TlsAlloc();
pem->tlsindex = THREAD_TlsAlloc(thdb);
*(pdir->AddressOfIndex)=pem->tlsindex;
}
pem->flags |= PE_MODREF_TLS_ALLOCED;
@ -929,4 +950,3 @@ BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32 hModule)
}
return TRUE;
}

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