Release 980315

Sun Mar 15 03:46:50 1998  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [*/*]
	Fixed some dprintf_ such that there is one and only one
	new line for each dprintf and that new line occurs at the end.
	Transformed some fprintfs into proper debug statements.
	Removed much redundancy from most of the debug statements. The
	redundancy appeared because now the component and function
	name is output automatically. Most debug statements also used to
	output the name of the function.
	All these changes prepared the source to switch completely to
	the new debugging interface.
	For more info, refer to ./documentation/debug-msg

Sat Mar 14 19:45:23 1997  Andreas Mohr <100.30936@germany.net>

	* [misc/shell.c] [if1632/kernel.spec]
	Changed parameters of FUNC004() to fix a crash.
	Not sure if this fix is correct (doc wanted).

	* [windows/user.c] [if1632/user.spec] [include/user.h]
	Implemented UserSeeUserDo.

	* [msdos/int21.c] [include/msdos.h]
	Added "GET LIST OF LISTS" (INT 21/52h).

Sat Mar 14 15:48:02 1998  Douglas Ridgway <ridgway@gmcl.com>

	* [include/windows.h] [relay32/gdi32.spec] [objects/enhmetafile.c]
	Beginnings of enhanced metafile support.

Fri Mar 13 20:53:09 1998  John Richardson <jrichard@zko.dec.com>

	* [win32/console.c]
	Restart interrupted console writes.

Fri Mar 13 18:59:24 1998  Matthew Becker <mbecker@glasscity.net>

	* [*/*.c]
	Updated documentation for API manpages.

	* [windows/dce.c]
	ReleaseDC16: Fixed cast.

	* [include/windows.h] [memory/virtual.c]
	VirtualQuery{Ex} should return DWORD instead of BOOL32.

Fri Mar 13 13:03:06 1998  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [README][documentation/status/]
	README updated, added lzexpand,version and multimedia
	status notes to new documentation/status directory.

	* [ole/*.c][if1632/typelib.spec]
	Added typelib stubs, several small additions and fixes.

	* [loader/pe_image.c]
	Fixed a small bug (fixup_imports got passed the wrong hModule in a
	remapcase).

	* [loader/signal.c][if1632/signal.c][misc/winsock_dns.c]
	  [loader/module.c]
	Fixed some recursive debugger crashes (caused by invalid FS).

	* [misc/registry.c]
	Two bugs fixed.

Fri Mar 13 04:55:01 1998  David Lee Lambert <lamber45@egr.msu.edu>

	* [include/winnt.h] [include/winnls.h]
	Moved LANG_xxx flags to winnls.h

	* [include/winnls.h]
	Added flags for GetDateFormat(); fixed validity of
	LOCALE_SYSTEM_DEFAULT.

	* [include/windows.h] 
	Added GetTimeFormat() prototypes.

	* [ole/ole2nls.c]
	Implemented ASCII date- and time-functions,  using an
	optimized common core;  added stubs for Unicode versions;  
	started work on a Unicode core.

	* [AUTHORS]
	Added my name.

Mon Mar  9 20:10:15 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [relay32/comctl32.spec] [include/imagelist.h]
	  [include/commctrl.h] [misc/imagelist.c] [misc/Makefile.in]
	First attempt at implementing ImageLists.

Sun Mar  8 20:19:49 1998  Uwe Bonnes  <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [files/dos_fs.c] [configure.in]
	Try to get FileTimeToLocalFileTime,FileTimeToSystemTime and
	SystemTimeToFileTime right.
	Use timegm() where available.

	* [misc/lstr.c]
	Fix an off by one error in FormatMessage and handle the case 
	when args = NULL (used by programs to get the length of the 
	string).

	* [win32/console.c]
	Actual display a per-process Title string, better working
	attempt for WriteConsole32W and ReadConsole32W.

Fri Mar  6 20:33:45 1998  Slaven Rezic  <eserte@cs.tu-berlin.de>

	* [include/config.h.in][configure.in][multimedia/audio.c]
	  [multimedia/dsound.c]
	Added check for FreeBSD sound system.

Sun Mar  1 17:40:10 1998  Jason Schonberg <schon@mti.sgi.com>

	* [controls/edit.c] [include/ole.h] [include/shlobj.h]
	Removed final commas in enum types.

Mon Feb 23 07:52:18 1998  Luiz Otavio L. Zorzella  <zorzella@nr.conexware.com>

	* [multimedia/time.c]
	Workaround to avoid infinite recursion inside timeGetTime.

	* [multimedia/audio.c]
	WODM_GETNUMDEVS and WIDM_GETNUMDEVS only return 1 now if the
	SOUND_DEV can be opened, or if it's busy.
oldstable wine-980315
Alexandre Julliard 1998-03-15 20:29:56 +00:00
parent a11d7b1a68
commit a69b88b2f2
243 changed files with 6936 additions and 4492 deletions

View File

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

View File

@ -55,11 +55,13 @@ Pavel Kankovsky,
Jochen Karrer, Jochen Karrer,
Andreas Kirschbaum, Andreas Kirschbaum,
Albrecht Kleine, Albrecht Kleine,
Eric Kohl,
Jon Konrath, Jon Konrath,
Alex Korobka, Alex Korobka,
Greg Kreider, Greg Kreider,
Anand Kumria, Anand Kumria,
Scott A. Laird, Scott A. Laird,
David Lee Lambert,
Andrew Lewycky, Andrew Lewycky,
Martin von Loewis, Martin von Loewis,
Michiel van Loon, Michiel van Loon,
@ -131,4 +133,5 @@ Eric Youngdale,
James Youngman, James Youngman,
Nikita V. Youshchenko, Nikita V. Youshchenko,
Mikolaj Zalewski, Mikolaj Zalewski,
and John Zero. John Zero,
and Luiz Otavio L. Zorzella.

132
ChangeLog
View File

@ -1,5 +1,135 @@
---------------------------------------------------------------------- ----------------------------------------------------------------------
Sun Feb 29 10:45:23 1997 Andreas Mohr <100.30936@germany.net> Sun Mar 15 03:46:50 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [*/*]
Fixed some dprintf_ such that there is one and only one
new line for each dprintf and that new line occurs at the end.
Transformed some fprintfs into proper debug statements.
Removed much redundancy from most of the debug statements. The
redundancy appeared because now the component and function
name is output automatically. Most debug statements also used to
output the name of the function.
All these changes prepared the source to switch completely to
the new debugging interface.
For more info, refer to ./documentation/debug-msg
Sat Mar 14 19:45:23 1997 Andreas Mohr <100.30936@germany.net>
* [misc/shell.c] [if1632/kernel.spec]
Changed parameters of FUNC004() to fix a crash.
Not sure if this fix is correct (doc wanted).
* [windows/user.c] [if1632/user.spec] [include/user.h]
Implemented UserSeeUserDo.
* [msdos/int21.c] [include/msdos.h]
Added "GET LIST OF LISTS" (INT 21/52h).
Sat Mar 14 15:48:02 1998 Douglas Ridgway <ridgway@gmcl.com>
* [include/windows.h] [relay32/gdi32.spec] [objects/enhmetafile.c]
Beginnings of enhanced metafile support.
Fri Mar 13 20:53:09 1998 John Richardson <jrichard@zko.dec.com>
* [win32/console.c]
Restart interrupted console writes.
Fri Mar 13 18:59:24 1998 Matthew Becker <mbecker@glasscity.net>
* [*/*.c]
Updated documentation for API manpages.
* [windows/dce.c]
ReleaseDC16: Fixed cast.
* [include/windows.h] [memory/virtual.c]
VirtualQuery{Ex} should return DWORD instead of BOOL32.
Fri Mar 13 13:03:06 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [README][documentation/status/]
README updated, added lzexpand,version and multimedia
status notes to new documentation/status directory.
* [ole/*.c][if1632/typelib.spec]
Added typelib stubs, several small additions and fixes.
* [loader/pe_image.c]
Fixed a small bug (fixup_imports got passed the wrong hModule in a
remapcase).
* [loader/signal.c][if1632/signal.c][misc/winsock_dns.c]
[loader/module.c]
Fixed some recursive debugger crashes (caused by invalid FS).
* [misc/registry.c]
Two bugs fixed.
Fri Mar 13 04:55:01 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [include/winnt.h] [include/winnls.h]
Moved LANG_xxx flags to winnls.h
* [include/winnls.h]
Added flags for GetDateFormat(); fixed validity of
LOCALE_SYSTEM_DEFAULT.
* [include/windows.h]
Added GetTimeFormat() prototypes.
* [ole/ole2nls.c]
Implemented ASCII date- and time-functions, using an
optimized common core; added stubs for Unicode versions;
started work on a Unicode core.
* [AUTHORS]
Added my name.
Mon Mar 9 20:10:15 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [relay32/comctl32.spec] [include/imagelist.h]
[include/commctrl.h] [misc/imagelist.c] [misc/Makefile.in]
First attempt at implementing ImageLists.
Sun Mar 8 20:19:49 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [files/dos_fs.c] [configure.in]
Try to get FileTimeToLocalFileTime,FileTimeToSystemTime and
SystemTimeToFileTime right.
Use timegm() where available.
* [misc/lstr.c]
Fix an off by one error in FormatMessage and handle the case
when args = NULL (used by programs to get the length of the
string).
* [win32/console.c]
Actual display a per-process Title string, better working
attempt for WriteConsole32W and ReadConsole32W.
Fri Mar 6 20:33:45 1998 Slaven Rezic <eserte@cs.tu-berlin.de>
* [include/config.h.in][configure.in][multimedia/audio.c]
[multimedia/dsound.c]
Added check for FreeBSD sound system.
Sun Mar 1 17:40:10 1998 Jason Schonberg <schon@mti.sgi.com>
* [controls/edit.c] [include/ole.h] [include/shlobj.h]
Removed final commas in enum types.
Mon Feb 23 07:52:18 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com>
* [multimedia/time.c]
Workaround to avoid infinite recursion inside timeGetTime.
* [multimedia/audio.c]
WODM_GETNUMDEVS and WIDM_GETNUMDEVS only return 1 now if the
SOUND_DEV can be opened, or if it's busy.
----------------------------------------------------------------------
Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne_image.c] * [loader/ne_image.c]
Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0). Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0).

5
README
View File

@ -11,17 +11,20 @@ Basically, you can do anything with it, except claim that you wrote it.
2. COMPILATION 2. COMPILATION
You must have one of: To compile the emulator, you must have one of:
Linux version 0.99.13 or above Linux version 0.99.13 or above
NetBSD-current NetBSD-current
FreeBSD-current or FreeBSD 1.1 FreeBSD-current or FreeBSD 1.1
OpenBSD/i386 2.1 or later OpenBSD/i386 2.1 or later
Solaris x86 2.5 or later
You also need to have libXpm installed on your system. The sources for You also need to have libXpm installed on your system. The sources for
it are probably available on the ftp site where you got Wine. They can it are probably available on the ftp site where you got Wine. They can
also be found on ftp.x.org and all its mirror sites. also be found on ftp.x.org and all its mirror sites.
On x86 Systems gcc >= 2.7.0 is required. You will probably need flex too.
To build Wine, first do a "./configure" and then a "make depend; make". To build Wine, first do a "./configure" and then a "make depend; make".
This will build the library "libwine.a" and the program "wine". This will build the library "libwine.a" and the program "wine".

115
configure vendored
View File

@ -2069,22 +2069,61 @@ fi
echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6 echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6
if test "$ac_cv_c_opensoundsystem" = "yes" echo $ac_n "checking "for Open Sound System on *BSD"""... $ac_c" 1>&6
echo "configure:2074: checking "for Open Sound System on *BSD"" >&5
if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem_bsd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2079 "configure"
#include "confdefs.h"
#include <machine/soundcard.h>
int main() {
/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
; return 0; }
EOF
if { (eval echo configure:2091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_opensoundsystem_bsd="yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_opensoundsystem_bsd="no"
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_c_opensoundsystem_bsd" 1>&6
if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
then then
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define HAVE_OSS 1 #define HAVE_OSS 1
EOF EOF
if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
then
cat >> confdefs.h <<\EOF
#define HAVE_MACHINE_SOUNDCARD_H 1
EOF
fi
fi fi
echo $ac_n "checking "for union semun"""... $ac_c" 1>&6 echo $ac_n "checking "for union semun"""... $ac_c" 1>&6
echo "configure:2083: checking "for union semun"" >&5 echo "configure:2122: checking "for union semun"" >&5
if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2088 "configure" #line 2127 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/sem.h> #include <sys/sem.h>
@ -2092,7 +2131,7 @@ int main() {
union semun foo union semun foo
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_union_semun="yes" ac_cv_c_union_semun="yes"
else else
@ -2120,7 +2159,7 @@ if test "x${GCC}" = "xyes"
then then
CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Wall"
echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6 echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
echo "configure:2124: checking "for gcc strength-reduce bug"" >&5 echo "configure:2163: checking "for gcc strength-reduce bug"" >&5
if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2128,7 +2167,7 @@ else
ac_cv_c_gcc_strength_bug="yes" ac_cv_c_gcc_strength_bug="yes"
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2132 "configure" #line 2171 "configure"
#include "confdefs.h" #include "confdefs.h"
int main(void) { int main(void) {
@ -2139,7 +2178,7 @@ int main(void) {
exit( Array[1] != -2 ); exit( Array[1] != -2 );
} }
EOF EOF
if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
ac_cv_c_gcc_strength_bug="no" ac_cv_c_gcc_strength_bug="no"
else else
@ -2162,7 +2201,7 @@ fi
echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6 echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
echo "configure:2166: checking "whether external symbols need an underscore prefix"" >&5 echo "configure:2205: checking "whether external symbols need an underscore prefix"" >&5
if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2174,14 +2213,14 @@ _ac_test:
.long 0 .long 0
EOF EOF
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2178 "configure" #line 2217 "configure"
#include "confdefs.h" #include "confdefs.h"
extern int ac_test; extern int ac_test;
int main() { int main() {
if (ac_test) return 1 if (ac_test) return 1
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_extern_prefix="yes" ac_cv_c_extern_prefix="yes"
else else
@ -2205,7 +2244,7 @@ fi
echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6 echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6
echo "configure:2209: checking "whether assembler accepts .string"" >&5 echo "configure:2248: checking "whether assembler accepts .string"" >&5
if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2215,14 +2254,14 @@ cat > conftest_asm.s <<EOF
.string "test" .string "test"
EOF EOF
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2219 "configure" #line 2258 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_asm_string="yes" ac_cv_c_asm_string="yes"
else else
@ -2249,21 +2288,21 @@ DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0" if test "$LIB_TARGET" = "libwine.so.1.0"
then then
echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6 echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
echo "configure:2253: checking "whether we can build a dll"" >&5 echo "configure:2292: checking "whether we can build a dll"" >&5
if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
saved_cflags=$CFLAGS saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0" CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2260 "configure" #line 2299 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
return 1 return 1
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_dll="yes" ac_cv_c_dll="yes"
else else
@ -2289,7 +2328,7 @@ fi
echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6
echo "configure:2293: checking "for reentrant X libraries"" >&5 echo "configure:2332: checking "for reentrant X libraries"" >&5
if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -2330,15 +2369,15 @@ EOF
fi fi
for ac_func in clone memmove strerror tcgetattr usleep wait4 waitpid for ac_func in clone memmove strerror tcgetattr timegm usleep wait4 waitpid
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2337: checking for $ac_func" >&5 echo "configure:2376: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2342 "configure" #line 2381 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -2361,7 +2400,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -2389,17 +2428,17 @@ for ac_hdr in wctype.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2393: checking for $ac_hdr" >&5 echo "configure:2432: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2398 "configure" #line 2437 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2426,12 +2465,12 @@ fi
done done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:2430: checking whether stat file-mode macros are broken" >&5 echo "configure:2469: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2435 "configure" #line 2474 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -2482,12 +2521,12 @@ EOF
fi fi
echo $ac_n "checking for working const""... $ac_c" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2486: checking for working const" >&5 echo "configure:2525: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2491 "configure" #line 2530 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
@ -2536,7 +2575,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:2540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:2579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
@ -2557,12 +2596,12 @@ EOF
fi fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2561: checking for ANSI C header files" >&5 echo "configure:2600: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2566 "configure" #line 2605 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -2570,7 +2609,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -2587,7 +2626,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2591 "configure" #line 2630 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
@ -2605,7 +2644,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2609 "configure" #line 2648 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
@ -2626,7 +2665,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2630 "configure" #line 2669 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -2637,7 +2676,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF EOF
if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then then
: :
else else
@ -2661,12 +2700,12 @@ EOF
fi fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2665: checking for size_t" >&5 echo "configure:2704: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2670 "configure" #line 2709 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#if STDC_HEADERS #if STDC_HEADERS

View File

@ -67,9 +67,22 @@ AC_CACHE_CHECK("for Open Sound System",
#endif #endif
],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no")) ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
if test "$ac_cv_c_opensoundsystem" = "yes" AC_CACHE_CHECK("for Open Sound System on *BSD",
ac_cv_c_opensoundsystem_bsd,
AC_TRY_COMPILE([#include <machine/soundcard.h>],[
/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
],ac_cv_c_opensoundsystem_bsd="yes",ac_cv_c_opensoundsystem_bsd="no"))
if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
then then
AC_DEFINE(HAVE_OSS) AC_DEFINE(HAVE_OSS)
if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
then
AC_DEFINE(HAVE_MACHINE_SOUNDCARD_H)
fi
fi fi
dnl **** Check for union semun **** dnl **** Check for union semun ****
@ -204,7 +217,7 @@ fi
dnl **** Check for functions and header files **** dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid) AC_CHECK_FUNCS(clone memmove strerror tcgetattr timegm usleep wait4 waitpid)
AC_CHECK_HEADERS(wctype.h) AC_CHECK_HEADERS(wctype.h)
AC_HEADER_STAT() AC_HEADER_STAT()
AC_C_CONST() AC_C_CONST()

View File

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

View File

@ -49,7 +49,7 @@ typedef enum
END_0 = 0, /* line ends with terminating '\0' character */ END_0 = 0, /* line ends with terminating '\0' character */
END_WRAP, /* line is wrapped */ END_WRAP, /* line is wrapped */
END_HARD, /* line ends with a hard return '\r\n' */ END_HARD, /* line ends with a hard return '\r\n' */
END_SOFT, /* line ends with a soft return '\r\r\n' */ END_SOFT /* line ends with a soft return '\r\r\n' */
} LINE_END; } LINE_END;
typedef struct tagLINEDEF { typedef struct tagLINEDEF {
@ -109,8 +109,7 @@ typedef struct
#define ORDER_UINT32(x,y) do { if ((UINT32)(y) < (UINT32)(x)) SWAP_UINT32((x),(y)); } while(0) #define ORDER_UINT32(x,y) do { if ((UINT32)(y) < (UINT32)(x)) SWAP_UINT32((x),(y)); } while(0)
#define DPRINTF_EDIT_NOTIFY(hwnd, str) \ #define DPRINTF_EDIT_NOTIFY(hwnd, str) \
({dprintf_info(edit, \ ({TRACE(edit, "notification " str " sent to hwnd=%08x\n", \
"edit: notification " str " sent to hwnd=%08x\n", \
(UINT32)(hwnd));}) (UINT32)(hwnd));})
#define EDIT_SEND_CTLCOLOR(wnd,hdc) \ #define EDIT_SEND_CTLCOLOR(wnd,hdc) \
@ -122,15 +121,14 @@ typedef struct
MAKEWPARAM((wnd)->wIDmenu, wNotifyCode), \ MAKEWPARAM((wnd)->wIDmenu, wNotifyCode), \
(LPARAM)(wnd)->hwndSelf)) (LPARAM)(wnd)->hwndSelf))
#define DPRINTF_EDIT_MSG16(str) \ #define DPRINTF_EDIT_MSG16(str) \
dprintf_info(edit, \ TRACE(edit, \
"edit: 16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \ "16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam) (UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
#define DPRINTF_EDIT_MSG32(str) \ #define DPRINTF_EDIT_MSG32(str) \
dprintf_info(edit, \ TRACE(edit, \
"edit: 32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \ "32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
(UINT32)hwnd, (UINT32)wParam, (UINT32)lParam) (UINT32)hwnd, (UINT32)wParam, (UINT32)lParam)
/********************************************************************* /*********************************************************************
* *
* Declarations * Declarations
@ -986,7 +984,7 @@ static INT32 EDIT_CallWordBreakProc(WND *wnd, EDITSTATE *es, INT32 start, INT32
} }
else if (es->word_break_proc32A) else if (es->word_break_proc32A)
{ {
dprintf_info(relay, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n", TRACE(relay, "(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n",
es->word_break_proc32A, es->text + start, index, es->word_break_proc32A, es->text + start, index,
count, action ); count, action );
return (INT32)es->word_break_proc32A( es->text + start, index, return (INT32)es->word_break_proc32A( es->text + start, index,
@ -1168,7 +1166,7 @@ static LPSTR EDIT_GetPasswordPointer_SL(WND *wnd, EDITSTATE *es)
static void EDIT_LockBuffer(WND *wnd, EDITSTATE *es) static void EDIT_LockBuffer(WND *wnd, EDITSTATE *es)
{ {
if (!es) { if (!es) {
fprintf(stderr, "edit: LockBuffer() without an EDITSTATE ... please report\n"); ERR(edit, "no EDITSTATE ... please report\n");
return; return;
} }
if (!(es->style & ES_MULTILINE)) if (!(es->style & ES_MULTILINE))
@ -1179,7 +1177,7 @@ static void EDIT_LockBuffer(WND *wnd, EDITSTATE *es)
else if (es->hloc16) else if (es->hloc16)
es->text = LOCAL_Lock(wnd->hInstance, es->hloc16); es->text = LOCAL_Lock(wnd->hInstance, es->hloc16);
else { else {
fprintf(stderr, "edit: LockBuffer() without a buffer ... please report\n"); ERR(edit, "no buffer ... please report\n");
return; return;
} }
} }
@ -1318,7 +1316,7 @@ static BOOL32 EDIT_MakeFit(WND *wnd, EDITSTATE *es, INT32 size)
if (size > es->buffer_limit) if (size > es->buffer_limit)
size = es->buffer_limit; size = es->buffer_limit;
dprintf_info(edit, "edit: EDIT_MakeFit: trying to ReAlloc to %d+1\n", size); TRACE(edit, "trying to ReAlloc to %d+1\n", size);
EDIT_UnlockBuffer(wnd, es, TRUE); EDIT_UnlockBuffer(wnd, es, TRUE);
if (es->text) { if (es->text) {
@ -1328,25 +1326,25 @@ static BOOL32 EDIT_MakeFit(WND *wnd, EDITSTATE *es, INT32 size)
es->buffer_size = 0; es->buffer_size = 0;
} else if (es->hloc32) { } else if (es->hloc32) {
if ((hNew32 = LocalReAlloc32(es->hloc32, size + 1, 0))) { if ((hNew32 = LocalReAlloc32(es->hloc32, size + 1, 0))) {
dprintf_info(edit, "edit: EDIT_MakeFit: Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32); TRACE(edit, "Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
es->hloc32 = hNew32; es->hloc32 = hNew32;
es->buffer_size = MIN(LocalSize32(es->hloc32) - 1, es->buffer_limit); es->buffer_size = MIN(LocalSize32(es->hloc32) - 1, es->buffer_limit);
} }
} else if (es->hloc16) { } else if (es->hloc16) {
if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) { if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) {
dprintf_info(edit, "edit: EDIT_MakeFit: Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16); TRACE(edit, "Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
es->hloc16 = hNew16; es->hloc16 = hNew16;
es->buffer_size = MIN(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit); es->buffer_size = MIN(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit);
} }
} }
if (es->buffer_size < size) { if (es->buffer_size < size) {
EDIT_LockBuffer(wnd, es); EDIT_LockBuffer(wnd, es);
dprintf_warn(edit, "edit: EDIT_MakeFit: FAILED ! We now have %d+1\n", es->buffer_size); WARN(edit, "FAILED ! We now have %d+1\n", es->buffer_size);
EDIT_NOTIFY_PARENT(wnd, EN_ERRSPACE, "EN_ERRSPACE"); EDIT_NOTIFY_PARENT(wnd, EN_ERRSPACE, "EN_ERRSPACE");
return FALSE; return FALSE;
} else { } else {
EDIT_LockBuffer(wnd, es); EDIT_LockBuffer(wnd, es);
dprintf_info(edit, "edit: EDIT_MakeFit: We now have %d+1\n", es->buffer_size); TRACE(edit, "We now have %d+1\n", es->buffer_size);
return TRUE; return TRUE;
} }
} }
@ -1365,12 +1363,12 @@ static BOOL32 EDIT_MakeUndoFit(WND *wnd, EDITSTATE *es, INT32 size)
return TRUE; return TRUE;
size = ((size / GROWLENGTH) + 1) * GROWLENGTH; size = ((size / GROWLENGTH) + 1) * GROWLENGTH;
dprintf_info(edit, "edit: EDIT_MakeUndoFit: trying to ReAlloc to %d+1\n", size); TRACE(edit, "trying to ReAlloc to %d+1\n", size);
if ((es->undo_text = HeapReAlloc(es->heap, 0, es->undo_text, size + 1))) { 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; es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1;
if (es->undo_buffer_size < size) { if (es->undo_buffer_size < size) {
dprintf_warn(edit, "edit: EDIT_MakeUndoFit: FAILED ! We now have %d+1\n", es->undo_buffer_size); WARN(edit, "FAILED ! We now have %d+1\n", es->undo_buffer_size);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@ -1658,7 +1656,7 @@ static void EDIT_PaintLine(WND *wnd, EDITSTATE *es, HDC32 dc, INT32 line, BOOL32
} else if (line) } else if (line)
return; return;
dprintf_info(edit, "edit: EDIT_PaintLine: line=%d\n", line); TRACE(edit, "line=%d\n", line);
pos = EDIT_EM_PosFromChar(wnd, es, EDIT_EM_LineIndex(wnd, es, line), FALSE); pos = EDIT_EM_PosFromChar(wnd, es, EDIT_EM_LineIndex(wnd, es, line), FALSE);
x = SLOWORD(pos); x = SLOWORD(pos);
@ -1826,17 +1824,17 @@ static void EDIT_SetRectNP(WND *wnd, EDITSTATE *es, LPRECT32 rc)
static void EDIT_UnlockBuffer(WND *wnd, EDITSTATE *es, BOOL32 force) static void EDIT_UnlockBuffer(WND *wnd, EDITSTATE *es, BOOL32 force)
{ {
if (!es) { if (!es) {
fprintf(stderr, "edit: UnlockBuffer() without an EDITSTATE ... please report\n"); ERR(edit, "no EDITSTATE ... please report\n");
return; return;
} }
if (!(es->style & ES_MULTILINE)) if (!(es->style & ES_MULTILINE))
return; return;
if (!es->lock_count) { if (!es->lock_count) {
fprintf(stderr, "edit: UnlockBuffer() with lock_count == 0 ... please report\n"); ERR(edit, "lock_count == 0 ... please report\n");
return; return;
} }
if (!es->text) { if (!es->text) {
fprintf(stderr, "edit: UnlockBuffer() with es->text == 0 ... please report\n"); ERR(edit, "es->text == 0 ... please report\n");
return; return;
} }
if (force || (es->lock_count == 1)) { if (force || (es->lock_count == 1)) {
@ -1867,8 +1865,8 @@ static INT32 EDIT_WordBreakProc(LPSTR s, INT32 index, INT32 count, INT32 action)
{ {
INT32 ret = 0; INT32 ret = 0;
dprintf_info(edit, "edit: EDIT_WordBreakProc: s=%p, index=%u" TRACE(edit, "s=%p, index=%u, count=%u, action=%d\n",
", count=%u, action=%d\n", s, index, count, action); s, index, count, action);
switch (action) { switch (action) {
case WB_LEFT: case WB_LEFT:
@ -1911,7 +1909,7 @@ static INT32 EDIT_WordBreakProc(LPSTR s, INT32 index, INT32 count, INT32 action)
ret = (s[index] == ' '); ret = (s[index] == ' ');
break; break;
default: default:
fprintf(stderr, "edit: EDIT_WordBreakProc: unknown action code, please report !\n"); ERR(edit, "unknown action code, please report !\n");
break; break;
} }
return ret; return ret;
@ -1953,7 +1951,7 @@ static LRESULT EDIT_EM_CharFromPos(WND *wnd, EDITSTATE *es, INT32 x, INT32 y)
*/ */
static BOOL32 EDIT_EM_FmtLines(WND *wnd, EDITSTATE *es, BOOL32 add_eol) static BOOL32 EDIT_EM_FmtLines(WND *wnd, EDITSTATE *es, BOOL32 add_eol)
{ {
fprintf(stdnimp, "edit: EM_FMTLINES: message not implemented\n"); FIXME(edit, "message not implemented\n");
return add_eol; return add_eol;
} }
@ -1989,12 +1987,12 @@ static HLOCAL32 EDIT_EM_GetHandle(WND *wnd, EDITSTATE *es)
return (HLOCAL32)es->hloc16; return (HLOCAL32)es->hloc16;
if (!(newBuf = LocalAlloc32(LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) { if (!(newBuf = LocalAlloc32(LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) {
fprintf(stderr, "edit: EM_GETHANDLE: could not allocate new 32 bit buffer\n"); ERR(edit, "could not allocate new 32 bit buffer\n");
return 0; return 0;
} }
newSize = MIN(LocalSize32(newBuf) - 1, es->buffer_limit); newSize = MIN(LocalSize32(newBuf) - 1, es->buffer_limit);
if (!(newText = LocalLock32(newBuf))) { if (!(newText = LocalLock32(newBuf))) {
fprintf(stderr, "edit: EM_GETHANDLE: could not lock new 32 bit buffer\n"); ERR(edit, "could not lock new 32 bit buffer\n");
LocalFree32(newBuf); LocalFree32(newBuf);
return 0; return 0;
} }
@ -2007,7 +2005,7 @@ static HLOCAL32 EDIT_EM_GetHandle(WND *wnd, EDITSTATE *es)
es->buffer_size = newSize; es->buffer_size = newSize;
es->text = newText; es->text = newText;
EDIT_LockBuffer(wnd, es); EDIT_LockBuffer(wnd, es);
dprintf_info(edit, "edit: EM_GETHANDLE: switched to 32 bit local heap\n"); TRACE(edit, "switched to 32 bit local heap\n");
return es->hloc32; return es->hloc32;
} }
@ -2043,18 +2041,18 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es)
if (!LOCAL_HeapSize(wnd->hInstance)) { if (!LOCAL_HeapSize(wnd->hInstance)) {
if (!LocalInit(wnd->hInstance, 0, if (!LocalInit(wnd->hInstance, 0,
GlobalSize16(wnd->hInstance))) { GlobalSize16(wnd->hInstance))) {
fprintf(stderr, "edit: EM_GETHANDLE: could not initialize local heap\n"); ERR(edit, "could not initialize local heap\n");
return 0; return 0;
} }
dprintf_info(edit, "edit: EM_GETHANDLE: local heap initialized\n"); TRACE(edit, "local heap initialized\n");
} }
if (!(newBuf = LOCAL_Alloc(wnd->hInstance, LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) { 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"); ERR(edit, "could not allocate new 16 bit buffer\n");
return 0; return 0;
} }
newSize = MIN(LOCAL_Size(wnd->hInstance, newBuf) - 1, es->buffer_limit); newSize = MIN(LOCAL_Size(wnd->hInstance, newBuf) - 1, es->buffer_limit);
if (!(newText = LOCAL_Lock(wnd->hInstance, newBuf))) { if (!(newText = LOCAL_Lock(wnd->hInstance, newBuf))) {
fprintf(stderr, "edit: EM_GETHANDLE: could not lock new 16 bit buffer\n"); ERR(edit, "could not lock new 16 bit buffer\n");
LOCAL_Free(wnd->hInstance, newBuf); LOCAL_Free(wnd->hInstance, newBuf);
return 0; return 0;
} }
@ -2071,7 +2069,7 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es)
es->buffer_size = newSize; es->buffer_size = newSize;
es->text = newText; es->text = newText;
EDIT_LockBuffer(wnd, es); EDIT_LockBuffer(wnd, es);
dprintf_info(edit, "edit: EM_GETHANDLE: switched to 16 bit buffer\n"); TRACE(edit, "switched to 16 bit buffer\n");
return es->hloc16; return es->hloc16;
} }
@ -2504,7 +2502,7 @@ static void EDIT_EM_SetHandle(WND *wnd, EDITSTATE *es, HLOCAL32 hloc)
return; return;
if (!hloc) { if (!hloc) {
fprintf(stderr, "edit: EM_SETHANDLE called with NULL handle\n"); WARN(edit, "called with NULL handle\n");
return; return;
} }
@ -2547,7 +2545,7 @@ static void EDIT_EM_SetHandle16(WND *wnd, EDITSTATE *es, HLOCAL16 hloc)
return; return;
if (!hloc) { if (!hloc) {
fprintf(stderr, "edit: EM_SETHANDLE called with NULL handle\n"); WARN(edit, "called with NULL handle\n");
return; return;
} }
@ -2623,7 +2621,7 @@ static void EDIT_EM_SetMargins(WND *wnd, EDITSTATE *es, INT32 action, INT32 left
if (action & EC_RIGHTMARGIN) if (action & EC_RIGHTMARGIN)
es->right_margin = right; es->right_margin = right;
} }
dprintf_info(edit, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin); TRACE(edit, "left=%d, right=%d\n", es->left_margin, es->right_margin);
} }
@ -2809,7 +2807,7 @@ static BOOL32 EDIT_EM_Undo(WND *wnd, EDITSTATE *es)
lstrcpy32A(utext, es->undo_text); lstrcpy32A(utext, es->undo_text);
dprintf_info(edit, "edit: before UNDO:insertion length = %d, deletion buffer = %s\n", TRACE(edit, "before UNDO:insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, utext); es->undo_insert_count, utext);
EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE); EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
@ -2818,7 +2816,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); EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
HeapFree(es->heap, 0, utext); HeapFree(es->heap, 0, utext);
dprintf_info(edit, "edit: after UNDO: insertion length = %d, deletion buffer = %s\n", TRACE(edit, "after UNDO:insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, es->undo_text); es->undo_insert_count, es->undo_text);
return TRUE; return TRUE;
@ -2890,7 +2888,7 @@ static void EDIT_WM_Command(WND *wnd, EDITSTATE *es, INT32 code, INT32 id, HWND3
EDIT_EM_ScrollCaret(wnd, es); EDIT_EM_ScrollCaret(wnd, es);
break; break;
default: default:
dprintf_err(edit, "edit: unknown menu item, please report\n"); ERR(edit, "unknown menu item, please report\n");
break; break;
} }
} }
@ -3135,9 +3133,9 @@ static LRESULT EDIT_HScroll_Hack(WND *wnd, EDITSTATE *es, INT32 action, INT32 po
LRESULT ret = 0; LRESULT ret = 0;
if (!(es->flags & EF_HSCROLL_HACK)) { if (!(es->flags & EF_HSCROLL_HACK)) {
fprintf(stderr, "edit: hacked WM_HSCROLL handler invoked\n"); ERR(edit, "hacked WM_HSCROLL handler invoked\n");
fprintf(stderr, " if you are _not_ running 16 bit notepad, please report\n"); ERR(edit, " if you are _not_ running 16 bit notepad, please report\n");
fprintf(stderr, " (this message is only displayed once per edit control)\n"); ERR(edit, " (this message is only displayed once per edit control)\n");
es->flags |= EF_HSCROLL_HACK; es->flags |= EF_HSCROLL_HACK;
} }
@ -3192,7 +3190,7 @@ static LRESULT EDIT_HScroll_Hack(WND *wnd, EDITSTATE *es, INT32 action, INT32 po
break; break;
default: default:
dprintf_err(edit, "edit: undocumented (hacked) WM_HSCROLL parameter, please report\n"); ERR(edit, "undocumented (hacked) WM_HSCROLL parameter, please report\n");
return 0; return 0;
} }
if (dx) if (dx)
@ -3262,7 +3260,7 @@ static LRESULT EDIT_WM_HScroll(WND *wnd, EDITSTATE *es, INT32 action, INT32 pos,
break; break;
default: default:
fprintf(stderr, "edit: undocumented WM_HSCROLL parameter, please report\n"); ERR(edit, "undocumented WM_HSCROLL parameter, please report\n");
return 0; return 0;
} }
if (dx) if (dx)
@ -3285,7 +3283,7 @@ static BOOL32 EDIT_CheckCombo(WND *wnd, UINT32 msg, INT32 key, DWORD key_data)
HWND32 hCombo = wnd->parent->hwndSelf; HWND32 hCombo = wnd->parent->hwndSelf;
BOOL32 bUIFlip = TRUE; BOOL32 bUIFlip = TRUE;
dprintf_info(combo, "EDIT_CheckCombo [%04x]: handling msg %04x (%04x)\n", TRACE(combo, "[%04x]: handling msg %04x (%04x)\n",
wnd->hwndSelf, (UINT16)msg, (UINT16)key); wnd->hwndSelf, (UINT16)msg, (UINT16)key);
switch (msg) { switch (msg) {
@ -3718,7 +3716,7 @@ static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPCSTR text)
{ {
EDIT_EM_SetSel(wnd, es, 0, -1, FALSE); EDIT_EM_SetSel(wnd, es, 0, -1, FALSE);
if (text) { if (text) {
dprintf_info(edit, "\t'%s'\n", text); TRACE(edit, "\t'%s'\n", text);
EDIT_EM_ReplaceSel(wnd, es, FALSE, text); EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
es->x_offset = 0; es->x_offset = 0;
} }
@ -3796,9 +3794,9 @@ static LRESULT EDIT_VScroll_Hack(WND *wnd, EDITSTATE *es, INT32 action, INT32 po
LRESULT ret = 0; LRESULT ret = 0;
if (!(es->flags & EF_VSCROLL_HACK)) { if (!(es->flags & EF_VSCROLL_HACK)) {
fprintf(stderr, "edit: hacked WM_VSCROLL handler invoked\n"); ERR(edit, "hacked WM_VSCROLL handler invoked\n");
fprintf(stderr, " if you are _not_ running 16 bit notepad, please report\n"); ERR(edit, " if you are _not_ running 16 bit notepad, please report\n");
fprintf(stderr, " (this message is only displayed once per edit control)\n"); ERR(edit, " (this message is only displayed once per edit control)\n");
es->flags |= EF_VSCROLL_HACK; es->flags |= EF_VSCROLL_HACK;
} }
@ -3841,7 +3839,7 @@ static LRESULT EDIT_VScroll_Hack(WND *wnd, EDITSTATE *es, INT32 action, INT32 po
break; break;
default: default:
fprintf(stderr, "edit: undocumented (hacked) WM_VSCROLL parameter, please report\n"); ERR(edit, "undocumented (hacked) WM_VSCROLL parameter, please report\n");
return 0; return 0;
} }
if (dy) if (dy)
@ -3898,7 +3896,7 @@ static LRESULT EDIT_WM_VScroll(WND *wnd, EDITSTATE *es, INT32 action, INT32 pos,
break; break;
default: default:
fprintf(stderr, "edit: undocumented WM_VSCROLL parameter, please report\n"); ERR(edit, "undocumented WM_VSCROLL parameter, please report\n");
return 0; return 0;
} }
if (dy) if (dy)

View File

@ -308,7 +308,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
if ((descr->height > descr->item_height) && if ((descr->height > descr->item_height) &&
(descr->height % descr->item_height)) (descr->height % descr->item_height))
{ {
dprintf_info(listbox, "Listbox %04x: changing height %d -> %d\n", TRACE(listbox, "[%04x]: changing height %d -> %d\n",
wnd->hwndSelf, descr->height, wnd->hwndSelf, descr->height,
descr->height - descr->height%descr->item_height ); descr->height - descr->height%descr->item_height );
SetWindowPos32( wnd->hwndSelf, 0, 0, 0, SetWindowPos32( wnd->hwndSelf, 0, 0, 0,
@ -319,7 +319,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr )
return; return;
} }
} }
dprintf_info(listbox, "Listbox %04x: new size = %d,%d\n", TRACE(listbox, "[%04x]: new size = %d,%d\n",
wnd->hwndSelf, descr->width, descr->height ); wnd->hwndSelf, descr->width, descr->height );
LISTBOX_UpdatePage( wnd, descr ); LISTBOX_UpdatePage( wnd, descr );
LISTBOX_UpdateScroll( wnd, descr ); LISTBOX_UpdateScroll( wnd, descr );
@ -457,7 +457,7 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc,
if (wnd->dwStyle & WS_DISABLED) dis.itemState |= ODS_DISABLED; if (wnd->dwStyle & WS_DISABLED) dis.itemState |= ODS_DISABLED;
dis.itemData = item ? item->data : 0; dis.itemData = item ? item->data : 0;
dis.rcItem = *rect; dis.rcItem = *rect;
dprintf_info(listbox, "Listbox %04x: drawitem %d (%s) action=%02x " TRACE(listbox, "[%04x]: drawitem %d (%s) action=%02x "
"state=%02x rect=%d,%d-%d,%d\n", "state=%02x rect=%d,%d-%d,%d\n",
wnd->hwndSelf, index, item ? item->str : "", action, wnd->hwndSelf, index, item ? item->str : "", action,
dis.itemState, rect->left, rect->top, dis.itemState, rect->left, rect->top,
@ -479,7 +479,7 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc,
oldText = SetTextColor32( hdc, GetSysColor32(COLOR_HIGHLIGHTTEXT)); oldText = SetTextColor32( hdc, GetSysColor32(COLOR_HIGHLIGHTTEXT));
} }
dprintf_info(listbox, "Listbox %04x: painting %d (%s) action=%02x " TRACE(listbox, "[%04x]: painting %d (%s) action=%02x "
"rect=%d,%d-%d,%d\n", "rect=%d,%d-%d,%d\n",
wnd->hwndSelf, index, item ? item->str : "", action, wnd->hwndSelf, index, item ? item->str : "", action,
rect->left, rect->top, rect->right, rect->bottom ); rect->left, rect->top, rect->right, rect->bottom );
@ -606,10 +606,10 @@ static BOOL32 LISTBOX_SetTabStops( WND *wnd, LB_DESCR *descr, INT32 count,
for (i = 0; i < descr->nb_tabs; i++) { for (i = 0; i < descr->nb_tabs; i++) {
descr->tabs[i] = *p++<<1; /* FIXME */ descr->tabs[i] = *p++<<1; /* FIXME */
if(debugging_info(listbox)) if(TRACE_ON(listbox))
dsprintf(listbox, "%hd ", descr->tabs[i]); dsprintf(listbox, "%hd ", descr->tabs[i]);
} }
dprintf_info(listbox, "Listbox %04x: settabstops %s\n", TRACE(listbox, "[%04x]: settabstops %s\n",
wnd->hwndSelf, dbg_str(listbox)); wnd->hwndSelf, dbg_str(listbox));
} }
else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT32) ); else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT32) );
@ -988,7 +988,7 @@ static LRESULT LISTBOX_SetItemHeight( WND *wnd, LB_DESCR *descr, INT32 index,
if (descr->style & LBS_OWNERDRAWVARIABLE) if (descr->style & LBS_OWNERDRAWVARIABLE)
{ {
if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; if ((index < 0) || (index >= descr->nb_items)) return LB_ERR;
dprintf_info(listbox, "Listbox %04x: item %d height = %d\n", TRACE(listbox, "[%04x]: item %d height = %d\n",
wnd->hwndSelf, index, height ); wnd->hwndSelf, index, height );
descr->items[index].height = height; descr->items[index].height = height;
LISTBOX_UpdateScroll( wnd, descr ); LISTBOX_UpdateScroll( wnd, descr );
@ -996,7 +996,7 @@ static LRESULT LISTBOX_SetItemHeight( WND *wnd, LB_DESCR *descr, INT32 index,
} }
else if (height != descr->item_height) else if (height != descr->item_height)
{ {
dprintf_info(listbox, "Listbox %04x: new height = %d\n", TRACE(listbox, "[%04x]: new height = %d\n",
wnd->hwndSelf, height ); wnd->hwndSelf, height );
descr->item_height = height; descr->item_height = height;
LISTBOX_UpdatePage( wnd, descr ); LISTBOX_UpdatePage( wnd, descr );
@ -1018,7 +1018,7 @@ static void LISTBOX_SetHorizontalPos( WND *wnd, LB_DESCR *descr, INT32 pos )
pos = descr->horz_extent - descr->width; pos = descr->horz_extent - descr->width;
if (pos < 0) pos = 0; if (pos < 0) pos = 0;
if (!(diff = descr->horz_pos - pos)) return; if (!(diff = descr->horz_pos - pos)) return;
dprintf_info(listbox, "Listbox %04x: new horz pos = %d\n", TRACE(listbox, "[%04x]: new horz pos = %d\n",
wnd->hwndSelf, pos ); wnd->hwndSelf, pos );
descr->horz_pos = pos; descr->horz_pos = pos;
LISTBOX_UpdateScroll( wnd, descr ); LISTBOX_UpdateScroll( wnd, descr );
@ -1040,7 +1040,7 @@ static LRESULT LISTBOX_SetHorizontalExtent( WND *wnd, LB_DESCR *descr,
return LB_OKAY; return LB_OKAY;
if (extent <= 0) extent = 1; if (extent <= 0) extent = 1;
if (extent == descr->horz_extent) return LB_OKAY; if (extent == descr->horz_extent) return LB_OKAY;
dprintf_info(listbox, "Listbox %04x: new horz extent = %d\n", TRACE(listbox, "[%04x]: new horz extent = %d\n",
wnd->hwndSelf, extent ); wnd->hwndSelf, extent );
descr->horz_extent = extent; descr->horz_extent = extent;
if (descr->horz_pos > extent - descr->width) if (descr->horz_pos > extent - descr->width)
@ -1058,7 +1058,7 @@ static LRESULT LISTBOX_SetColumnWidth( WND *wnd, LB_DESCR *descr, UINT32 width)
{ {
width += 2; /* For left and right margin */ width += 2; /* For left and right margin */
if (width == descr->column_width) return LB_OKAY; if (width == descr->column_width) return LB_OKAY;
dprintf_info(listbox, "Listbox %04x: new column width = %d\n", TRACE(listbox, "[%04x]: new column width = %d\n",
wnd->hwndSelf, width ); wnd->hwndSelf, width );
descr->column_width = width; descr->column_width = width;
LISTBOX_UpdatePage( wnd, descr ); LISTBOX_UpdatePage( wnd, descr );
@ -1081,7 +1081,7 @@ static INT32 LISTBOX_SetFont( WND *wnd, LB_DESCR *descr, HFONT32 font )
if (!(hdc = GetDCEx32( wnd->hwndSelf, 0, DCX_CACHE ))) if (!(hdc = GetDCEx32( wnd->hwndSelf, 0, DCX_CACHE )))
{ {
fprintf( stderr, "LISTBOX_SetFont: unable to get DC\n" ); ERR(listbox, "unable to get DC.\n" );
return 16; return 16;
} }
if (font) oldFont = SelectObject32( hdc, font ); if (font) oldFont = SelectObject32( hdc, font );
@ -1307,7 +1307,7 @@ static LRESULT LISTBOX_InsertItem( WND *wnd, LB_DESCR *descr, INT32 index,
mis.itemHeight = descr->item_height; mis.itemHeight = descr->item_height;
SendMessage32A( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis ); SendMessage32A( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis );
item->height = mis.itemHeight ? mis.itemHeight : 1; item->height = mis.itemHeight ? mis.itemHeight : 1;
dprintf_info(listbox, "Listbox %04x: measure item %d (%s) = %d\n", TRACE(listbox, "[%04x]: measure item %d (%s) = %d\n",
wnd->hwndSelf, index, str ? str : "", item->height ); wnd->hwndSelf, index, str ? str : "", item->height );
} }
@ -1359,7 +1359,7 @@ static LRESULT LISTBOX_InsertString( WND *wnd, LB_DESCR *descr, INT32 index,
return ret; return ret;
} }
dprintf_info(listbox, "Listbox %04x: added item %d '%s'\n", TRACE(listbox, "[%04x]: added item %d '%s'\n",
wnd->hwndSelf, index, HAS_STRINGS(descr) ? new_str : "" ); wnd->hwndSelf, index, HAS_STRINGS(descr) ? new_str : "" );
return index; return index;
} }
@ -1696,7 +1696,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
WPARAM32 wParam, INT32 x, INT32 y ) WPARAM32 wParam, INT32 x, INT32 y )
{ {
INT32 index = LISTBOX_GetItemFromPoint( wnd, descr, x, y ); INT32 index = LISTBOX_GetItemFromPoint( wnd, descr, x, y );
dprintf_info(listbox, "Listbox %04x: lbuttondown %d,%d item %d\n", TRACE(listbox, "[%04x]: lbuttondown %d,%d item %d\n",
wnd->hwndSelf, x, y, index ); wnd->hwndSelf, x, y, index );
if (!descr->caret_on && (GetFocus32() == wnd->hwndSelf)) return 0; if (!descr->caret_on && (GetFocus32() == wnd->hwndSelf)) return 0;
if (index != -1) if (index != -1)
@ -2031,7 +2031,7 @@ static BOOL32 LISTBOX_Create( WND *wnd, LPHEADCOMBO lphc )
if( lphc ) if( lphc )
{ {
dprintf_info(combo,"ComboLBox [%04x]: resetting owner %04x -> %04x\n", TRACE(combo,"[%04x]: resetting owner %04x -> %04x\n",
wnd->hwndSelf, descr->owner, lphc->self->hwndSelf ); wnd->hwndSelf, descr->owner, lphc->self->hwndSelf );
descr->owner = lphc->self->hwndSelf; descr->owner = lphc->self->hwndSelf;
} }
@ -2100,7 +2100,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
if (msg == WM_CREATE) if (msg == WM_CREATE)
{ {
if (!LISTBOX_Create( wnd, NULL )) return -1; if (!LISTBOX_Create( wnd, NULL )) return -1;
dprintf_info(listbox, "Listbox: creating wnd=%04x descr=%p\n", TRACE(listbox, "creating wnd=%04x descr=%p\n",
hwnd, *(LB_DESCR **)wnd->wExtra ); hwnd, *(LB_DESCR **)wnd->wExtra );
return 0; return 0;
} }
@ -2108,7 +2108,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
return DefWindowProc32A( hwnd, msg, wParam, lParam ); return DefWindowProc32A( hwnd, msg, wParam, lParam );
} }
dprintf_info(listbox, "Listbox %04x: msg %s wp %08x lp %08lx\n", TRACE(listbox, "[%04x]: msg %s wp %08x lp %08lx\n",
wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam ); wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
switch(msg) switch(msg)
{ {
@ -2478,7 +2478,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
default: default:
if ((msg >= WM_USER) && (msg < 0xc000)) if ((msg >= WM_USER) && (msg < 0xc000))
dprintf_warn(listbox, "Listbox %04x: unknown msg %04x wp %08x lp %08lx\n", WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",
hwnd, msg, wParam, lParam ); hwnd, msg, wParam, lParam );
return DefWindowProc32A( hwnd, msg, wParam, lParam ); return DefWindowProc32A( hwnd, msg, wParam, lParam );
} }
@ -2523,7 +2523,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
{ {
LB_DESCR *descr = *(LB_DESCR **)wnd->wExtra; LB_DESCR *descr = *(LB_DESCR **)wnd->wExtra;
dprintf_info(combo, "ComboLBox [%04x]: msg %s wp %08x lp %08lx\n", TRACE(combo, "[%04x]: msg %s wp %08x lp %08lx\n",
wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam ); wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam );
if( descr || msg == WM_CREATE ) if( descr || msg == WM_CREATE )
@ -2534,7 +2534,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
{ {
case WM_CREATE: case WM_CREATE:
#define lpcs ((LPCREATESTRUCT32A)lParam) #define lpcs ((LPCREATESTRUCT32A)lParam)
dprintf_info(combo, "\tpassed parent handle = 0x%08x\n", TRACE(combo, "\tpassed parent handle = 0x%08x\n",
(UINT32)lpcs->lpCreateParams); (UINT32)lpcs->lpCreateParams);
lphc = (LPHEADCOMBO)(lpcs->lpCreateParams); lphc = (LPHEADCOMBO)(lpcs->lpCreateParams);
@ -2580,7 +2580,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg,
} }
lRet = DefWindowProc32A( hwnd, msg, wParam, lParam ); lRet = DefWindowProc32A( hwnd, msg, wParam, lParam );
dprintf_info(combo,"\tComboLBox: default on msg [%04x]\n", (UINT16)msg ); TRACE(combo,"\t default on msg [%04x]\n", (UINT16)msg );
} }
return lRet; return lRet;

View File

@ -164,7 +164,7 @@ static BOOL32 fEndMenu = FALSE;
*/ */
#define debug_print_menuitem(pre, mp, post) \ #define debug_print_menuitem(pre, mp, post) \
if(!debugging_info(menu)) ; else do_debug_print_menuitem(pre, mp, post) if(!TRACE_ON(menu)) ; else do_debug_print_menuitem(pre, mp, post)
#define MENUOUT(text) \ #define MENUOUT(text) \
dsprintf(menu, "%s%s", (count++ ? "," : ""), (text)) dsprintf(menu, "%s%s", (count++ ? "," : ""), (text))
@ -243,7 +243,7 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
dsprintf(menu, "NULL"); dsprintf(menu, "NULL");
} }
dprintf_info(menu, "%s %s %s\n", prefix, dbg_str(menu), postfix); TRACE(menu, "%s %s %s\n", prefix, dbg_str(menu), postfix);
} }
#undef MENUOUT #undef MENUOUT
@ -264,10 +264,10 @@ static HMENU32 MENU_CopySysPopup(void)
} }
else { else {
hMenu = 0; hMenu = 0;
fprintf( stderr, "Unable to load default system menu\n" ); ERR(menu, "Unable to load default system menu\n" );
} }
dprintf_info(menu, "MENU_CopySysPopup: returning %x.\n", hMenu ); TRACE(menu, "returning %x.\n", hMenu );
return hMenu; return hMenu;
} }
@ -305,12 +305,12 @@ HMENU32 MENU_GetSysMenu( HWND32 hWnd, HMENU32 hPopupMenu )
menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hPopupMenu); menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hPopupMenu);
menu->wFlags |= MF_SYSMENU; menu->wFlags |= MF_SYSMENU;
dprintf_info(menu,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu ); TRACE(menu,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu );
return hMenu; return hMenu;
} }
DestroyMenu32( hMenu ); DestroyMenu32( hMenu );
} }
fprintf(stderr, "failed to load system menu!\n"); ERR(menu, "failed to load system menu!\n");
return 0; return 0;
} }
@ -453,7 +453,7 @@ static UINT32 MENU_GetStartOfPrevColumn(
break; break;
} }
dprintf_info(menu, "MENU_GetStartOfPrevColumn: ret %d.\n", i ); TRACE(menu, "ret %d.\n", i );
return i; return i;
} }
@ -552,7 +552,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu, static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu,
UINT32 key, BOOL32 forceMenuChar ) UINT32 key, BOOL32 forceMenuChar )
{ {
dprintf_info(menu,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu ); TRACE(menu,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu );
if (!IsMenu32( hmenu )) if (!IsMenu32( hmenu ))
{ {
@ -600,7 +600,7 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner,
DWORD dwSize; DWORD dwSize;
char *p; char *p;
dprintf_info(menu, "MENU_CalcItemSize: HDC 0x%x at (%d,%d)\n", TRACE(menu, "HDC 0x%x at (%d,%d)\n",
hdc, orgX, orgY); hdc, orgX, orgY);
debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem, debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem,
(menuBar ? " (MenuBar)" : "")); (menuBar ? " (MenuBar)" : ""));
@ -618,7 +618,7 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner,
SendMessage32A( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis ); SendMessage32A( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis );
lpitem->rect.bottom += mis.itemHeight; lpitem->rect.bottom += mis.itemHeight;
lpitem->rect.right += mis.itemWidth; lpitem->rect.right += mis.itemWidth;
dprintf_info(menu, "MENU_CalcItemSize: %08x %dx%d\n", TRACE(menu, "%08x %dx%d\n",
lpitem->wID, mis.itemWidth, mis.itemHeight); lpitem->wID, mis.itemWidth, mis.itemHeight);
return; return;
} }
@ -753,7 +753,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
if ((lprect == NULL) || (lppop == NULL)) return; if ((lprect == NULL) || (lppop == NULL)) return;
if (lppop->nItems == 0) return; if (lppop->nItems == 0) return;
dprintf_info(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n", TRACE(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n",
lprect->left, lprect->top, lprect->right, lprect->bottom); lprect->left, lprect->top, lprect->right, lprect->bottom);
lppop->Width = lprect->right - lprect->left; lppop->Width = lprect->right - lprect->left;
lppop->Height = 0; lppop->Height = 0;
@ -773,9 +773,8 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect,
if ((i != start) && if ((i != start) &&
(lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break; (lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
dprintf_info(menu, TRACE(menu, "calling MENU_CalcItemSize org=(%d, %d)\n",
"MENU_MenuBarCalcSize: calling MENU_CalcItemSize" orgX, orgY );
" org=(%d, %d)\n", orgX, orgY );
debug_print_menuitem (" item: ", lpitem, ""); debug_print_menuitem (" item: ", lpitem, "");
MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, TRUE ); MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, TRUE );
if (lpitem->rect.right > lprect->right) if (lpitem->rect.right > lprect->right)
@ -844,7 +843,7 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
{ {
DRAWITEMSTRUCT32 dis; DRAWITEMSTRUCT32 dis;
dprintf_info(menu, "DrawMenuItem: Ownerdraw!\n" ); TRACE(menu, "Ownerdraw!\n" );
dis.CtlType = ODT_MENU; dis.CtlType = ODT_MENU;
dis.itemID = lpitem->wID; dis.itemID = lpitem->wID;
dis.itemData = (DWORD)lpitem->text; dis.itemData = (DWORD)lpitem->text;
@ -1137,7 +1136,7 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( (HMENU16)wndPtr->wIDmenu ); lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( (HMENU16)wndPtr->wIDmenu );
if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU; if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU;
dprintf_info(menu,"MENU_DrawMenuBar(%04x, %p, %p); !\n", TRACE(menu,"(%04x, %p, %p); !\n",
hDC, lprect, lppop); hDC, lprect, lppop);
if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd); if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
lprect->bottom = lprect->top + lppop->Height; lprect->bottom = lprect->top + lppop->Height;
@ -1172,7 +1171,7 @@ BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
{ {
HTASK16 hTask = 0; HTASK16 hTask = 0;
dprintf_info(menu,"patching resident popup: %04x %04x [%04x %04x]\n", TRACE(menu,"patching resident popup: %04x %04x [%04x %04x]\n",
checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ, checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ,
pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0); pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0);
@ -1210,7 +1209,7 @@ BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
pTopPopupWnd->hmemTaskQ = task->hQueue; pTopPopupWnd->hmemTaskQ = task->hQueue;
return TRUE; return TRUE;
} }
else dprintf_warn(menu,"failed to patch resident popup.\n"); else WARN(menu,"failed to patch resident popup.\n");
} }
} }
return FALSE; return FALSE;
@ -1488,7 +1487,7 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags )
if (!(menu = (POPUPMENU *)USER_HEAP_LIN_ADDR(hMenu))) if (!(menu = (POPUPMENU *)USER_HEAP_LIN_ADDR(hMenu)))
{ {
dprintf_warn(menu, "MENU_InsertItem: %04x not a menu handle\n", WARN(menu, "%04x not a menu handle\n",
hMenu ); hMenu );
return NULL; return NULL;
} }
@ -1506,13 +1505,13 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags )
{ {
if (!MENU_FindItem( &hMenu, &pos, flags )) if (!MENU_FindItem( &hMenu, &pos, flags ))
{ {
dprintf_warn(menu, "MENU_InsertItem: item %x not found\n", WARN(menu, "item %x not found\n",
pos ); pos );
return NULL; return NULL;
} }
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu)))
{ {
dprintf_warn(menu,"MENU_InsertItem: %04x not a menu handle\n", WARN(menu,"%04x not a menu handle\n",
hMenu); hMenu);
return NULL; return NULL;
} }
@ -1523,7 +1522,7 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags )
newItems = HeapAlloc( SystemHeap, 0, sizeof(MENUITEM) * (menu->nItems+1) ); newItems = HeapAlloc( SystemHeap, 0, sizeof(MENUITEM) * (menu->nItems+1) );
if (!newItems) if (!newItems)
{ {
dprintf_warn(menu, "MENU_InsertItem: allocation failed\n" ); WARN(menu, "allocation failed\n" );
return NULL; return NULL;
} }
if (menu->nItems > 0) if (menu->nItems > 0)
@ -1562,8 +1561,7 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU32 hMenu, BOOL32 unicode )
res += sizeof(WORD); res += sizeof(WORD);
} }
if (!IS_STRING_ITEM(flags)) if (!IS_STRING_ITEM(flags))
fprintf( stderr, "MENU_ParseResource: not a string item %04x\n", ERR(menu, "not a string item %04x\n", flags );
flags );
str = res; str = res;
if (!unicode) res += strlen(str) + 1; if (!unicode) res += strlen(str) + 1;
else res += (lstrlen32W((LPCWSTR)str) + 1) * sizeof(WCHAR); else res += (lstrlen32W((LPCWSTR)str) + 1) * sizeof(WCHAR);
@ -1620,7 +1618,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU32 hMenu)
{ {
LPSTR newstr = HEAP_strdupWtoA(GetProcessHeap(), LPSTR newstr = HEAP_strdupWtoA(GetProcessHeap(),
0, mii.dwTypeData); 0, mii.dwTypeData);
dprintf_info(menu, "Menu item: [%08x,%08x,%04x,%04x,%s]\n", TRACE(menu, "Menu item: [%08x,%08x,%04x,%04x,%s]\n",
mii.fType, mii.fState, mii.wID, resinfo, newstr); mii.fType, mii.fState, mii.wID, resinfo, newstr);
HeapFree( GetProcessHeap(), 0, newstr ); HeapFree( GetProcessHeap(), 0, newstr );
} }
@ -1834,7 +1832,7 @@ static BOOL32 MENU_ExecFocusedItem( MTRACKER* pmt, HMENU32 hMenu )
item = &menu->items[menu->FocusedItem]; item = &menu->items[menu->FocusedItem];
dprintf_info(menu, "MENU_ExecFocusedItem: %08x %08x %08x\n", TRACE(menu, "%08x %08x %08x\n",
hMenu, item->wID, item->hSubMenu); hMenu, item->wID, item->hSubMenu);
if (!(item->fType & MF_POPUP)) if (!(item->fType & MF_POPUP))
@ -1929,7 +1927,7 @@ static BOOL32 MENU_ButtonDown( MTRACKER* pmt, HMENU32 hPtMenu )
pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE ); pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE );
return TRUE; return TRUE;
} }
else dprintf_warn(menu, "\tunable to find clicked item!\n"); else WARN(menu, "\tunable to find clicked item!\n");
} }
return FALSE; return FALSE;
} }
@ -2023,7 +2021,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT32 vk )
LRESULT l = SendMessage16( pmt->hOwnerWnd, WM_NEXTMENU, (WPARAM16)vk, LRESULT l = SendMessage16( pmt->hOwnerWnd, WM_NEXTMENU, (WPARAM16)vk,
(IS_SYSTEM_MENU(menu)) ? GetSubMenu16(pmt->hTopMenu,0) : pmt->hTopMenu ); (IS_SYSTEM_MENU(menu)) ? GetSubMenu16(pmt->hTopMenu,0) : pmt->hTopMenu );
dprintf_info(menu,"NextMenu: %04x [%04x] -> %04x [%04x]\n", TRACE(menu,"%04x [%04x] -> %04x [%04x]\n",
(UINT16)pmt->hCurrentMenu, (UINT16)pmt->hOwnerWnd, LOWORD(l), HIWORD(l) ); (UINT16)pmt->hCurrentMenu, (UINT16)pmt->hOwnerWnd, LOWORD(l), HIWORD(l) );
if( l == 0 ) if( l == 0 )
@ -2071,7 +2069,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT32 vk )
/* FIXME: Not sure what to do here, perhaps, /* FIXME: Not sure what to do here, perhaps,
* try to track hNewMenu as a popup? */ * try to track hNewMenu as a popup? */
dprintf_info(menu,"MENU_DoNextMenu() got confused.\n"); TRACE(menu," -- got confused.\n");
return FALSE; return FALSE;
} }
} }
@ -2202,7 +2200,7 @@ static void MENU_KeyRight( MTRACKER* pmt )
POPUPMENU *menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( pmt->hTopMenu ); POPUPMENU *menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( pmt->hTopMenu );
UINT32 nextcol; UINT32 nextcol;
dprintf_info(menu, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n", TRACE(menu, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n",
pmt->hCurrentMenu, pmt->hCurrentMenu,
((POPUPMENU *)USER_HEAP_LIN_ADDR(pmt->hCurrentMenu))-> ((POPUPMENU *)USER_HEAP_LIN_ADDR(pmt->hCurrentMenu))->
items[0].text, items[0].text,
@ -2222,7 +2220,7 @@ static void MENU_KeyRight( MTRACKER* pmt )
/* Check to see if there's another column */ /* Check to see if there's another column */
if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) != if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) !=
NO_SELECTED_ITEM ) { NO_SELECTED_ITEM ) {
dprintf_info(menu, "KeyRight: Going to %d.\n", nextcol ); TRACE(menu, "Going to %d.\n", nextcol );
MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu, MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu,
nextcol, TRUE ); nextcol, TRUE );
return; return;
@ -2565,7 +2563,7 @@ BOOL32 WINAPI TrackPopupMenu32( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
BOOL32 WINAPI TrackPopupMenuEx( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y, BOOL32 WINAPI TrackPopupMenuEx( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
HWND32 hWnd, LPTPMPARAMS lpTpm ) HWND32 hWnd, LPTPMPARAMS lpTpm )
{ {
fprintf( stderr, "TrackPopupMenuEx: not fully implemented\n" ); FIXME(menu, "not fully implemented\n" );
return TrackPopupMenu32( hMenu, wFlags, x, y, 0, hWnd, return TrackPopupMenu32( hMenu, wFlags, x, y, 0, hWnd,
lpTpm ? &lpTpm->rcExclude : NULL ); lpTpm ? &lpTpm->rcExclude : NULL );
} }
@ -2611,7 +2609,7 @@ LRESULT WINAPI PopupMenuWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if( hwnd == pTopPopupWnd->hwndSelf ) if( hwnd == pTopPopupWnd->hwndSelf )
{ {
dprintf_err(menu, "resident popup destroyed!\n"); ERR(menu, "resident popup destroyed!\n");
pTopPopupWnd = NULL; pTopPopupWnd = NULL;
uSubPWndLevel = 0; uSubPWndLevel = 0;
@ -2625,7 +2623,7 @@ LRESULT WINAPI PopupMenuWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if( wParam ) if( wParam )
{ {
if( !(*(HMENU32*)wndPtr->wExtra) ) if( !(*(HMENU32*)wndPtr->wExtra) )
fprintf(stderr,"MenuWndProc: no menu to display\n"); ERR(menu,"no menu to display\n");
} }
else else
*(HMENU32*)wndPtr->wExtra = 0; *(HMENU32*)wndPtr->wExtra = 0;
@ -2660,7 +2658,7 @@ UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
WND *wndPtr; WND *wndPtr;
LPPOPUPMENU lppop; LPPOPUPMENU lppop;
dprintf_info(menu, "MENU_GetMenuBarHeight: HWND 0x%x, width %d, " TRACE(menu, "HWND 0x%x, width %d, "
"at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY ); "at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY );
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
@ -2680,7 +2678,7 @@ UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data, BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,
UINT16 id, UINT16 flags ) UINT16 id, UINT16 flags )
{ {
dprintf_info(menu,"ChangeMenu16: menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n", TRACE(menu,"menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n",
hMenu, pos, (DWORD)data, id, flags ); hMenu, pos, (DWORD)data, id, flags );
if (flags & MF_APPEND) return AppendMenu16( hMenu, flags & ~MF_APPEND, if (flags & MF_APPEND) return AppendMenu16( hMenu, flags & ~MF_APPEND,
id, data ); id, data );
@ -2706,7 +2704,7 @@ BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,
BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data, BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
UINT32 id, UINT32 flags ) UINT32 id, UINT32 flags )
{ {
dprintf_info(menu,"ChangeMenu32A: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n", TRACE(menu,"menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
hMenu, pos, (DWORD)data, id, flags ); hMenu, pos, (DWORD)data, id, flags );
if (flags & MF_APPEND) return AppendMenu32A( hMenu, flags & ~MF_APPEND, if (flags & MF_APPEND) return AppendMenu32A( hMenu, flags & ~MF_APPEND,
id, data ); id, data );
@ -2727,7 +2725,7 @@ BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
BOOL32 WINAPI ChangeMenu32W( HMENU32 hMenu, UINT32 pos, LPCWSTR data, BOOL32 WINAPI ChangeMenu32W( HMENU32 hMenu, UINT32 pos, LPCWSTR data,
UINT32 id, UINT32 flags ) UINT32 id, UINT32 flags )
{ {
dprintf_info(menu,"ChangeMenu32W: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n", TRACE(menu,"menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n",
hMenu, pos, (DWORD)data, id, flags ); hMenu, pos, (DWORD)data, id, flags );
if (flags & MF_APPEND) return AppendMenu32W( hMenu, flags & ~MF_APPEND, if (flags & MF_APPEND) return AppendMenu32W( hMenu, flags & ~MF_APPEND,
id, data ); id, data );
@ -2759,7 +2757,7 @@ DWORD WINAPI CheckMenuItem32( HMENU32 hMenu, UINT32 id, UINT32 flags )
MENUITEM *item; MENUITEM *item;
DWORD ret; DWORD ret;
dprintf_info(menu,"CheckMenuItem: %04x %04x %04x\n", hMenu, id, flags ); TRACE(menu,"%04x %04x %04x\n", hMenu, id, flags );
if (!(item = MENU_FindItem( &hMenu, &id, flags ))) return -1; if (!(item = MENU_FindItem( &hMenu, &id, flags ))) return -1;
ret = item->fState & MF_CHECKED; ret = item->fState & MF_CHECKED;
if (flags & MF_CHECKED) item->fState |= MF_CHECKED; if (flags & MF_CHECKED) item->fState |= MF_CHECKED;
@ -2785,7 +2783,7 @@ BOOL32 WINAPI EnableMenuItem32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
BOOL32 bRet = FALSE; BOOL32 bRet = FALSE;
MENUITEM *item, *first = NULL; MENUITEM *item, *first = NULL;
dprintf_info(menu,"EnableMenuItem (%04x, %04X, %04X) !\n", TRACE(menu,"(%04x, %04X, %04X) !\n",
hMenu, wItemID, wFlags); hMenu, wItemID, wFlags);
while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) ) while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) )
@ -2833,14 +2831,14 @@ INT32 WINAPI GetMenuString32A( HMENU32 hMenu, UINT32 wItemID,
{ {
MENUITEM *item; MENUITEM *item;
dprintf_info(menu, "GetMenuString32A: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", TRACE(menu, "menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
hMenu, wItemID, str, nMaxSiz, wFlags ); hMenu, wItemID, str, nMaxSiz, wFlags );
if (!str || !nMaxSiz) return 0; if (!str || !nMaxSiz) return 0;
str[0] = '\0'; str[0] = '\0';
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0; if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
if (!IS_STRING_ITEM(item->fType)) return 0; if (!IS_STRING_ITEM(item->fType)) return 0;
lstrcpyn32A( str, item->text, nMaxSiz ); lstrcpyn32A( str, item->text, nMaxSiz );
dprintf_info(menu, "GetMenuString32A: returning '%s'\n", str ); TRACE(menu, "returning '%s'\n", str );
return strlen(str); return strlen(str);
} }
@ -2853,7 +2851,7 @@ INT32 WINAPI GetMenuString32W( HMENU32 hMenu, UINT32 wItemID,
{ {
MENUITEM *item; MENUITEM *item;
dprintf_info(menu, "GetMenuString32W: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", TRACE(menu, "menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
hMenu, wItemID, str, nMaxSiz, wFlags ); hMenu, wItemID, str, nMaxSiz, wFlags );
if (!str || !nMaxSiz) return 0; if (!str || !nMaxSiz) return 0;
str[0] = '\0'; str[0] = '\0';
@ -2881,7 +2879,7 @@ BOOL32 WINAPI HiliteMenuItem32( HWND32 hWnd, HMENU32 hMenu, UINT32 wItemID,
UINT32 wHilite ) UINT32 wHilite )
{ {
LPPOPUPMENU menu; LPPOPUPMENU menu;
dprintf_info(menu,"HiliteMenuItem(%04x, %04x, %04x, %04x);\n", TRACE(menu,"(%04x, %04x, %04x, %04x);\n",
hWnd, hMenu, wItemID, wHilite); hWnd, hMenu, wItemID, wHilite);
if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE; if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE;
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE; if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@ -2907,7 +2905,7 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )
UINT32 WINAPI GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags ) UINT32 WINAPI GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
{ {
MENUITEM *item; MENUITEM *item;
dprintf_info(menu,"GetMenuState(%04x, %04x, %04x);\n", TRACE(menu,"(%04x, %04x, %04x);\n",
hMenu, wItemID, wFlags); hMenu, wItemID, wFlags);
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1; if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1;
debug_print_menuitem (" item: ", item, ""); debug_print_menuitem (" item: ", item, "");
@ -2934,7 +2932,7 @@ INT16 WINAPI GetMenuItemCount16( HMENU16 hMenu )
{ {
LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu); LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (!IS_A_MENU(menu)) return -1; if (!IS_A_MENU(menu)) return -1;
dprintf_info(menu,"GetMenuItemCount16(%04x) returning %d\n", TRACE(menu,"(%04x) returning %d\n",
hMenu, menu->nItems ); hMenu, menu->nItems );
return menu->nItems; return menu->nItems;
} }
@ -2947,7 +2945,7 @@ INT32 WINAPI GetMenuItemCount32( HMENU32 hMenu )
{ {
LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu); LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
if (!IS_A_MENU(menu)) return -1; if (!IS_A_MENU(menu)) return -1;
dprintf_info(menu,"GetMenuItemCount32(%04x) returning %d\n", TRACE(menu,"(%04x) returning %d\n",
hMenu, menu->nItems ); hMenu, menu->nItems );
return menu->nItems; return menu->nItems;
} }
@ -3004,10 +3002,10 @@ BOOL32 WINAPI InsertMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
MENUITEM *item; MENUITEM *item;
if (IS_STRING_ITEM(flags) && str) if (IS_STRING_ITEM(flags) && str)
dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, " TRACE(menu, "hMenu %04x, pos %d, flags %08x, "
"id %04x, str '%s'\n", "id %04x, str '%s'\n",
hMenu, pos, flags, id, str ); hMenu, pos, flags, id, str );
else dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, " else TRACE(menu, "hMenu %04x, pos %d, flags %08x, "
"id %04x, str %08lx (not a string)\n", "id %04x, str %08lx (not a string)\n",
hMenu, pos, flags, id, (DWORD)str ); hMenu, pos, flags, id, (DWORD)str );
@ -3093,7 +3091,7 @@ BOOL32 WINAPI RemoveMenu32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags )
LPPOPUPMENU menu; LPPOPUPMENU menu;
MENUITEM *item; MENUITEM *item;
dprintf_info(menu,"RemoveMenu (%04x, %04x, %04x)\n",hMenu, nPos, wFlags); TRACE(menu,"(%04x, %04x, %04x)\n",hMenu, nPos, wFlags);
if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE; if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE; if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
@ -3167,13 +3165,13 @@ BOOL32 WINAPI ModifyMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
if (IS_STRING_ITEM(flags)) if (IS_STRING_ITEM(flags))
{ {
dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x '%s'\n", TRACE(menu, "%04x %d %04x %04x '%s'\n",
hMenu, pos, flags, id, str ? str : "#NULL#" ); hMenu, pos, flags, id, str ? str : "#NULL#" );
if (!str) return FALSE; if (!str) return FALSE;
} }
else else
{ {
dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x %08lx\n", TRACE(menu, "%04x %d %04x %04x %08lx\n",
hMenu, pos, flags, id, (DWORD)str ); hMenu, pos, flags, id, (DWORD)str );
} }
@ -3251,7 +3249,7 @@ BOOL32 WINAPI SetMenuItemBitmaps32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags,
HBITMAP32 hNewUnCheck, HBITMAP32 hNewCheck) HBITMAP32 hNewUnCheck, HBITMAP32 hNewCheck)
{ {
MENUITEM *item; MENUITEM *item;
dprintf_info(menu,"SetMenuItemBitmaps(%04x, %04x, %04x, %04x, %04x)\n", TRACE(menu,"(%04x, %04x, %04x, %04x, %04x)\n",
hMenu, nPos, wFlags, hNewCheck, hNewUnCheck); hMenu, nPos, wFlags, hNewCheck, hNewUnCheck);
if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE; if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE;
@ -3296,7 +3294,7 @@ HMENU32 WINAPI CreateMenu32(void)
menu->hWnd = 0; menu->hWnd = 0;
menu->items = NULL; menu->items = NULL;
menu->FocusedItem = NO_SELECTED_ITEM; menu->FocusedItem = NO_SELECTED_ITEM;
dprintf_info(menu, "CreateMenu: return %04x\n", hMenu ); TRACE(menu, "return %04x\n", hMenu );
return hMenu; return hMenu;
} }
@ -3315,7 +3313,7 @@ BOOL16 WINAPI DestroyMenu16( HMENU16 hMenu )
*/ */
BOOL32 WINAPI DestroyMenu32( HMENU32 hMenu ) BOOL32 WINAPI DestroyMenu32( HMENU32 hMenu )
{ {
dprintf_info(menu,"DestroyMenu(%04x)\n", hMenu); TRACE(menu,"(%04x)\n", hMenu);
/* Silently ignore attempts to destroy default system popup */ /* Silently ignore attempts to destroy default system popup */
@ -3463,7 +3461,7 @@ BOOL32 WINAPI SetMenu32( HWND32 hWnd, HMENU32 hMenu )
{ {
WND * wndPtr = WIN_FindWndPtr(hWnd); WND * wndPtr = WIN_FindWndPtr(hWnd);
dprintf_info(menu,"SetMenu(%04x, %04x);\n", hWnd, hMenu); TRACE(menu,"(%04x, %04x);\n", hWnd, hMenu);
if (wndPtr && !(wndPtr->dwStyle & WS_CHILD)) if (wndPtr && !(wndPtr->dwStyle & WS_CHILD))
{ {
@ -3575,11 +3573,11 @@ HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name )
if (HIWORD(name)) if (HIWORD(name))
{ {
char *str = (char *)PTR_SEG_TO_LIN( name ); char *str = (char *)PTR_SEG_TO_LIN( name );
dprintf_info(menu, "LoadMenu(%04x,'%s')\n", instance, str ); TRACE(menu, "(%04x,'%s')\n", instance, str );
if (str[0] == '#') name = (SEGPTR)atoi( str + 1 ); if (str[0] == '#') name = (SEGPTR)atoi( str + 1 );
} }
else else
dprintf_info(resource,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name)); TRACE(resource,"(%04x,%04x)\n",instance,LOWORD(name));
if (!name) return 0; if (!name) return 0;
@ -3627,12 +3625,12 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
WORD version, offset; WORD version, offset;
LPCSTR p = (LPCSTR)template; LPCSTR p = (LPCSTR)template;
dprintf_info(menu,"LoadMenuIndirect16: %p\n", template ); TRACE(menu,"(%p)\n", template );
version = GET_WORD(p); version = GET_WORD(p);
p += sizeof(WORD); p += sizeof(WORD);
if (version) if (version)
{ {
fprintf( stderr, "LoadMenuIndirect16: version must be 0 for Win16\n" ); WARN(menu, "version must be 0 for Win16\n" );
return 0; return 0;
} }
offset = GET_WORD(p); offset = GET_WORD(p);
@ -3656,7 +3654,7 @@ HMENU32 WINAPI LoadMenuIndirect32A( LPCVOID template )
WORD version, offset; WORD version, offset;
LPCSTR p = (LPCSTR)template; LPCSTR p = (LPCSTR)template;
dprintf_info(menu,"LoadMenuIndirect32A: %p\n", template ); TRACE(menu,"%p\n", template );
version = GET_WORD(p); version = GET_WORD(p);
p += sizeof(WORD); p += sizeof(WORD);
switch (version) switch (version)
@ -3682,8 +3680,7 @@ HMENU32 WINAPI LoadMenuIndirect32A( LPCVOID template )
} }
return hMenu; return hMenu;
default: default:
fprintf( stderr, "LoadMenuIndirect32A: version %d not supported.\n", ERR(menu, "version %d not supported.\n", version);
version );
return 0; return 0;
} }
} }
@ -3867,7 +3864,7 @@ BOOL32 WINAPI SetMenuDefaultItem32(HMENU32 hmenu, UINT32 item, BOOL32 bypos)
MENUITEM *menu = MENU_FindItem(&hmenu, &item, bypos); MENUITEM *menu = MENU_FindItem(&hmenu, &item, bypos);
if (!menu) return FALSE; if (!menu) return FALSE;
debug_print_menuitem("SetMenuDefaultItem32: ", menu, ""); debug_print_menuitem("SetMenuDefaultItem32: ", menu, "");
fprintf(stdnimp, "SetMenuDefaultItem32 (0x%x,%d,%d), empty stub!\n", FIXME(menu, "(0x%x,%d,%d), empty stub!\n",
hmenu, item, bypos); hmenu, item, bypos);
return TRUE; return TRUE;
} }
@ -3931,8 +3928,7 @@ BOOL32 WINAPI CheckMenuRadioItem32(HMENU32 hMenu,
MENUITEM *mifirst, *milast, *micheck; MENUITEM *mifirst, *milast, *micheck;
HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu; HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu;
dprintf_info(menu, TRACE(menu, "ox%x: %d-%d, check %d, bypos=%d\n",
"CheckMenuRadioItem32: ox%x: %d-%d, check %d, bypos=%d\n",
hMenu, first, last, check, bypos); hMenu, first, last, check, bypos);
mifirst = MENU_FindItem (&mfirst, &first, bypos); mifirst = MENU_FindItem (&mfirst, &first, bypos);
@ -3985,7 +3981,7 @@ BOOL32 WINAPI GetMenuItemRect32 (HWND32 hwnd, HMENU32 hMenu, UINT32 uItem,
MENUITEM *item; MENUITEM *item;
HMENU32 orghMenu = hMenu; HMENU32 orghMenu = hMenu;
dprintf_info(menu, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n", TRACE(menu, "(0x%x,0x%x,%d,%p)\n",
hwnd, hMenu, uItem, rect); hwnd, hMenu, uItem, rect);
item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION); item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION);

View File

@ -26,8 +26,8 @@
/* Work constants */ /* Work constants */
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(progress, \ #define UNKNOWN_PARAM(msg, wParam, lParam) WARN(progress, \
"Progress Ctrl: Unknown parameter(s) for message " #msg \ "Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
#define PROGRESS_GetInfoPtr(wndPtr) ((PROGRESS_INFO *)wndPtr->wExtra) #define PROGRESS_GetInfoPtr(wndPtr) ((PROGRESS_INFO *)wndPtr->wExtra)
@ -47,7 +47,7 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
RECT32 rect; RECT32 rect;
HDC32 hdc; HDC32 hdc;
dprintf_info(progress, "Progress Bar: paint pos=%d min=%d, max=%d\n", TRACE(progress, "paint pos=%d min=%d, max=%d\n",
infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal); infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
/* get a dc */ /* get a dc */
@ -114,11 +114,11 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
infoPtr->MaxVal=100; infoPtr->MaxVal=100;
infoPtr->CurVal=0; infoPtr->CurVal=0;
infoPtr->Step=10; infoPtr->Step=10;
dprintf_info(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd); TRACE(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
break; break;
case WM_DESTROY: case WM_DESTROY:
dprintf_info(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd); TRACE(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
break; break;
case WM_ERASEBKGND: case WM_ERASEBKGND:
@ -194,7 +194,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
default: default:
if (message >= WM_USER) if (message >= WM_USER)
fprintf( stderr, "Progress Ctrl: unknown msg %04x wp=%04x lp=%08lx\n", ERR(progress, "unknown msg %04x wp=%04x lp=%08lx\n",
message, wParam, lParam ); message, wParam, lParam );
return DefWindowProc32A( hwnd, message, wParam, lParam ); return DefWindowProc32A( hwnd, message, wParam, lParam );
} }

View File

@ -615,7 +615,7 @@ void SCROLL_HandleScrollEvent( HWND32 hwnd, INT32 nBar, UINT32 msg, POINT32 pt)
return; /* Should never happen */ return; /* Should never happen */
} }
dprintf_info(scroll, "ScrollBar Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n", TRACE(scroll, "Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n",
hwnd, nBar, msg, pt.x, pt.y, hittest ); hwnd, nBar, msg, pt.x, pt.y, hittest );
switch(trackHitTest) switch(trackHitTest)
@ -766,8 +766,8 @@ LRESULT WINAPI ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
CREATESTRUCT32A *lpCreat = (CREATESTRUCT32A *)lParam; CREATESTRUCT32A *lpCreat = (CREATESTRUCT32A *)lParam;
if (lpCreat->style & SBS_SIZEBOX) if (lpCreat->style & SBS_SIZEBOX)
{ {
fprintf( stdnimp, "Unimplemented style SBS_SIZEBOX.\n" ); FIXME(scroll, "Unimplemented style SBS_SIZEBOX.\n" );
return 0; /* FIXME */ return 0;
} }
if (lpCreat->style & SBS_VERT) if (lpCreat->style & SBS_VERT)
@ -794,7 +794,7 @@ LRESULT WINAPI ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
} }
} }
if (!hUpArrow) SCROLL_LoadBitmaps(); if (!hUpArrow) SCROLL_LoadBitmaps();
dprintf_info(scroll, "ScrollBar creation, hwnd=%04x\n", hwnd ); TRACE(scroll, "ScrollBar creation, hwnd=%04x\n", hwnd );
return 0; return 0;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
@ -845,9 +845,7 @@ LRESULT WINAPI ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
return 0; /* FIXME: return previous position */ return 0; /* FIXME: return previous position */
case SBM_GETRANGE16: case SBM_GETRANGE16:
/* FIXME */ FIXME(scroll, "don't know how to handle SBM_GETRANGE16 (wp=%04x,lp=%08lx)\n", wParam, lParam );
fprintf( stderr, "ScrollBar: don't know how to handle SBM_GETRANGE16 (wp=%04x,lp=%08lx)\n",
wParam, lParam );
return 0; return 0;
case SBM_GETRANGE32: case SBM_GETRANGE32:
@ -876,13 +874,13 @@ LRESULT WINAPI ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
case 0x00ed: case 0x00ed:
case 0x00ee: case 0x00ee:
case 0x00ef: case 0x00ef:
fprintf(stderr, "ScrollBar: unknown Win32 msg %04x wp=%08x lp=%08lx\n", ERR(scroll, "unknown Win32 msg %04x wp=%08x lp=%08lx\n",
message, wParam, lParam ); message, wParam, lParam );
break; break;
default: default:
if (message >= WM_USER) if (message >= WM_USER)
fprintf( stderr, "ScrollBar: unknown msg %04x wp=%04x lp=%08lx\n", WARN(scroll, "unknown msg %04x wp=%04x lp=%08lx\n",
message, wParam, lParam ); message, wParam, lParam );
return DefWindowProc32A( hwnd, message, wParam, lParam ); return DefWindowProc32A( hwnd, message, wParam, lParam );
} }
@ -952,7 +950,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
} }
} }
dprintf_info(scroll, "SetScrollInfo: hwnd=%04x bar=%d %s\n", TRACE(scroll, "hwnd=%04x bar=%d %s\n",
hwnd, nBar, dbg_str(scroll)); hwnd, nBar, dbg_str(scroll));
/* Make sure the page size is valid */ /* Make sure the page size is valid */
@ -968,7 +966,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info,
else if (infoPtr->CurVal > infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 )) else if (infoPtr->CurVal > infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 ))
infoPtr->CurVal = infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 ); infoPtr->CurVal = infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 );
dprintf_info(scroll, "\n new values: page=%d pos=%d min=%d max=%d\n", TRACE(scroll, " new values: page=%d pos=%d min=%d max=%d\n",
infoPtr->Page, infoPtr->CurVal, infoPtr->Page, infoPtr->CurVal,
infoPtr->MinVal, infoPtr->MaxVal ); infoPtr->MinVal, infoPtr->MaxVal );
@ -1209,7 +1207,7 @@ BOOL32 WINAPI ShowScrollBar32( HWND32 hwnd, INT32 nBar, BOOL32 fShow )
WND *wndPtr = WIN_FindWndPtr( hwnd ); WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return FALSE; if (!wndPtr) return FALSE;
dprintf_info(scroll, "ShowScrollBar: hwnd=%04x bar=%d on=%d\n", TRACE(scroll, "hwnd=%04x bar=%d on=%d\n",
hwnd, nBar, fShow ); hwnd, nBar, fShow );
switch(nBar) switch(nBar)
@ -1285,7 +1283,7 @@ BOOL32 WINAPI EnableScrollBar32( HWND32 hwnd, INT32 nBar, UINT32 flags )
SCROLLBAR_INFO *infoPtr; SCROLLBAR_INFO *infoPtr;
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE; if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE;
dprintf_info(scroll, "EnableScrollBar: %04x %d %d\n", TRACE(scroll, "%04x %d %d\n",
hwnd, nBar, flags ); hwnd, nBar, flags );
flags &= ESB_DISABLE_BOTH; flags &= ESB_DISABLE_BOTH;
if (infoPtr->flags == flags) return FALSE; if (infoPtr->flags == flags) return FALSE;

View File

@ -12,6 +12,7 @@
#include "cursoricon.h" #include "cursoricon.h"
#include "static.h" #include "static.h"
#include "heap.h" #include "heap.h"
#include "debug.h"
static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc ); static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc ); static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc );
@ -61,7 +62,7 @@ static HICON16 STATIC_SetIcon( WND *wndPtr, HICON16 hicon )
if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_ICON) return 0; if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_ICON) return 0;
if (hicon && !info) { if (hicon && !info) {
fprintf(stderr,"STATIC_SetIcon: huh? hicon!=0, but info=0???\n"); ERR(static, "huh? hicon!=0, but info=0???\n");
return 0; return 0;
} }
prevIcon = infoPtr->hIcon; prevIcon = infoPtr->hIcon;
@ -88,7 +89,7 @@ static HICON16 STATIC_SetBitmap( WND *wndPtr, HICON16 hicon )
if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0; if ((wndPtr->dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0;
if (hicon && !info) { if (hicon && !info) {
fprintf(stderr,"STATIC_SetBitmap: huh? hicon!=0, but info=0???\n"); ERR(static, "huh? hicon!=0, but info=0???\n");
return 0; return 0;
} }
prevIcon = infoPtr->hIcon; prevIcon = infoPtr->hIcon;
@ -184,7 +185,8 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
if (cs->lpszName) if (cs->lpszName)
STATIC_SetBitmap( wndPtr, STATIC_SetBitmap( wndPtr,
STATIC_LoadBitmap( wndPtr, cs->lpszName )); STATIC_LoadBitmap( wndPtr, cs->lpszName ));
fprintf(stderr,"STATIC:style SS_BITMAP, dwStyle is 0x%08lx\n",wndPtr->dwStyle); WARN(static, "style SS_BITMAP, dwStyle is 0x%08lx\n",
wndPtr->dwStyle);
return 1; return 1;
} }
return DefWindowProc32A( hWnd, uMsg, wParam, lParam ); return DefWindowProc32A( hWnd, uMsg, wParam, lParam );
@ -192,7 +194,7 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
case WM_CREATE: case WM_CREATE:
if (style < 0L || style > SS_TYPEMASK) if (style < 0L || style > SS_TYPEMASK)
{ {
fprintf( stderr, "STATIC: Unknown style 0x%02lx\n", style ); ERR(static, "Unknown style 0x%02lx\n", style );
lResult = -1L; lResult = -1L;
break; break;
} }

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 ) BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{ {
dprintf_info(graphics, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n", TRACE(graphics, "%04x %d,%d-%d,%d %04x %04x\n",
hdc, rc->left, rc->top, rc->right, rc->bottom, hdc, rc->left, rc->top, rc->right, rc->bottom,
edge, flags ); edge, flags );
@ -941,7 +941,7 @@ static BOOL32 UITOOLS_DrawFrameButton(HDC32 hdc, LPRECT32 rc, UINT32 uState)
return UITOOLS_DFC_ButtonRadio(hdc, rc, uState); return UITOOLS_DFC_ButtonRadio(hdc, rc, uState);
default: default:
fprintf(stdnimp, "UITOOLS_DrawFrameButton: Report this: Invalid button state: 0x%04x\n", uState); WARN(uitools, "Invalid button state: 0x%04x\n", uState);
} }
return FALSE; return FALSE;
@ -1077,7 +1077,7 @@ static BOOL32 UITOOLS_DrawFrameCaption(HDC32 dc, LPRECT32 r, UINT32 uFlags)
break; break;
default: default:
fprintf(stdnimp, "UITOOLS_DrawFrameCaption: Report this: Invalid caption; flags: 0x%04x\n", uFlags); WARN(uitools, "Invalid caption; flags: 0x%04x\n", uFlags);
return FALSE; return FALSE;
} }
@ -1247,7 +1247,7 @@ static BOOL32 UITOOLS_DrawFrameScroll(HDC32 dc, LPRECT32 r, UINT32 uFlags)
return TRUE; return TRUE;
default: default:
fprintf(stdnimp, "UITOOLS_DrawFrameScroll: Report this: Invalid scroll; flags: 0x%04x\n", uFlags); WARN(uitools, "Invalid scroll; flags: 0x%04x\n", uFlags);
return FALSE; return FALSE;
} }
@ -1349,7 +1349,7 @@ static BOOL32 UITOOLS_DrawFrameMenu(HDC32 dc, LPRECT32 r, UINT32 uFlags)
break; break;
default: default:
fprintf(stdnimp, "UITOOLS_DrawFrameMenu: Report this: Invalid menu; flags: 0x%04x\n", uFlags); WARN(uitools, "Invalid menu; flags: 0x%04x\n", uFlags);
retval = FALSE; retval = FALSE;
break; break;
} }
@ -1397,7 +1397,7 @@ BOOL32 WINAPI DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 uType,
case DFC_SCROLL: case DFC_SCROLL:
return UITOOLS_DrawFrameScroll(hdc, rc, uState); return UITOOLS_DrawFrameScroll(hdc, rc, uState);
default: default:
fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), bad type!\n", WARN(uitools, "(%x,%p,%d,%x), bad type!\n",
hdc,rc,uType,uState ); hdc,rc,uType,uState );
} }
return FALSE; return FALSE;

View File

@ -60,7 +60,7 @@
static int accelIndex = -1; static int accelIndex = -1;
#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(updown, \ #define UNKNOWN_PARAM(msg, wParam, lParam) WARN(updown, \
"UpDown Ctrl: Unknown parameter(s) for message " #msg \ "UpDown Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
@ -207,8 +207,8 @@ static BOOL32 UPDOWN_GetBuddyInt(WND *wndPtr)
if(*src || !UPDOWN_InBounds(wndPtr, newVal)) if(*src || !UPDOWN_InBounds(wndPtr, newVal))
return FALSE; return FALSE;
dprintf_info(updown, "UpDown Ctrl: new value(%d) read from buddy " TRACE(updown, "new value(%d) read from buddy (old=%d)\n",
"(old=%d)\n", newVal, infoPtr->CurVal); newVal, infoPtr->CurVal);
} }
infoPtr->CurVal = newVal; infoPtr->CurVal = newVal;
@ -232,7 +232,7 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
if (!IsWindow32(infoPtr->Buddy)) if (!IsWindow32(infoPtr->Buddy))
return FALSE; return FALSE;
dprintf_info(updown, "UpDown Ctrl: set new value(%d) to buddy.\n", TRACE(updown, "set new value(%d) to buddy.\n",
infoPtr->CurVal); infoPtr->CurVal);
/*if the buddy is a list window, we must set curr index */ /*if the buddy is a list window, we must set curr index */
@ -326,8 +326,7 @@ static BOOL32 UPDOWN_SetBuddy(WND *wndPtr, HWND32 hwndBud)
return FALSE; return FALSE;
if(wndPtr->dwStyle & UDS_ARROWKEYS){ if(wndPtr->dwStyle & UDS_ARROWKEYS){
/* FIXME: we need to subclass the buddy to process the arrow keys. */ FIXME(updown, "we need to subclass the buddy to process the arrow keys.\n");
fprintf(stderr, "UpDown Ctrl: we should subclass the buddy window!\n");
} }
/* do we need to do any adjustments? */ /* do we need to do any adjustments? */
@ -379,8 +378,7 @@ static void UPDOWN_DoAction(WND *wndPtr, int delta, BOOL32 incr)
int old_val = infoPtr->CurVal; int old_val = infoPtr->CurVal;
NM_UPDOWN ni; NM_UPDOWN ni;
dprintf_info(updown, "UpDown Ctrl action: %s by %d\n", TRACE(updown, "%s by %d\n", incr ? "inc" : "dec", delta);
incr ? "inc" : "dec", delta);
/* check if we can do the modification first */ /* check if we can do the modification first */
delta *= (incr ? 1 : -1) * (infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1); delta *= (incr ? 1 : -1) * (infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1);
@ -548,8 +546,7 @@ static void UPDOWN_HandleMouseEvent(WND *wndPtr, UINT32 msg, POINT32 pt)
break; break;
default: default:
fprintf(stderr, "UpDown: Impossible case in proc " ERR(updown, "Impossible case!\n");
"UPDOWN_HandleMouseEvent");
} }
} }
@ -581,13 +578,13 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if(wndPtr->dwStyle & UDS_AUTOBUDDY) if(wndPtr->dwStyle & UDS_AUTOBUDDY)
UPDOWN_SetBuddy(wndPtr, GetWindow32(wndPtr->hwndSelf, GW_HWNDPREV)); UPDOWN_SetBuddy(wndPtr, GetWindow32(wndPtr->hwndSelf, GW_HWNDPREV));
dprintf_info(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd); TRACE(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd);
break; break;
case WM_DESTROY: case WM_DESTROY:
if(infoPtr->AccelVect) if(infoPtr->AccelVect)
free(infoPtr->AccelVect); free(infoPtr->AccelVect);
dprintf_info(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd); TRACE(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
break; break;
case WM_ENABLE: case WM_ENABLE:
@ -677,7 +674,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
return temp; return temp;
case UDM_SETACCEL: case UDM_SETACCEL:
dprintf_info(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd); TRACE(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd);
if(infoPtr->AccelVect){ if(infoPtr->AccelVect){
free(infoPtr->AccelVect); free(infoPtr->AccelVect);
infoPtr->AccelCount = 0; infoPtr->AccelCount = 0;
@ -697,7 +694,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
return infoPtr->Base; return infoPtr->Base;
case UDM_SETBASE: case UDM_SETBASE:
dprintf_info(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n", TRACE(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n",
wParam, hwnd); wParam, hwnd);
if ( !(wParam==10 || wParam==16) || lParam) if ( !(wParam==10 || wParam==16) || lParam)
UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam); UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam);
@ -719,7 +716,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
temp = infoPtr->Buddy; temp = infoPtr->Buddy;
infoPtr->Buddy = wParam; infoPtr->Buddy = wParam;
UPDOWN_SetBuddy(wndPtr, wParam); UPDOWN_SetBuddy(wndPtr, wParam);
dprintf_info(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", TRACE(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n",
infoPtr->Buddy, hwnd); infoPtr->Buddy, hwnd);
return temp; return temp;
@ -733,7 +730,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
if (wParam || HIWORD(lParam)) if (wParam || HIWORD(lParam))
UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam); UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
temp = SLOWORD(lParam); temp = SLOWORD(lParam);
dprintf_info(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n", TRACE(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n",
temp, hwnd); temp, hwnd);
if(!UPDOWN_InBounds(wndPtr, temp)){ if(!UPDOWN_InBounds(wndPtr, temp)){
if(temp < infoPtr->MinVal) if(temp < infoPtr->MinVal)
@ -758,13 +755,13 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */ infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */ infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
/* |Max-Min| <= UD_MAXVAL */ /* |Max-Min| <= UD_MAXVAL */
dprintf_info(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
infoPtr->MinVal, infoPtr->MaxVal, hwnd); infoPtr->MinVal, infoPtr->MaxVal, hwnd);
break; break;
default: default:
if (message >= WM_USER) if (message >= WM_USER)
fprintf( stderr, "UpDown Ctrl: unknown msg %04x wp=%04x lp=%08lx\n", WARN(updown, "unknown msg %04x wp=%04x lp=%08lx\n",
message, wParam, lParam ); message, wParam, lParam );
return DefWindowProc32A( hwnd, message, wParam, lParam ); return DefWindowProc32A( hwnd, message, wParam, lParam );
} }

View File

@ -40,6 +40,7 @@ works correctly.
FreeConsole is called on process exit (in ExitProcess) if FreeConsole is called on process exit (in ExitProcess) if
pdb->console is not NULL. pdb->console is not NULL.
BUGS BUGS
---- ----
Console processes do not inherit their parent's handles. I think Console processes do not inherit their parent's handles. I think
@ -47,6 +48,13 @@ there needs to be two cases, one where they have to inherit
the stdin/stdout/stderr from unix, and one where they have to the stdin/stdout/stderr from unix, and one where they have to
inherit from another windows app. inherit from another windows app.
SetConsoleMode -- UNIX only has ICANON and various ECHOs
to play around with for processing input. Win32 has
line-at-a-time processing, character processing, and
echo. I'm putting together an intermediate driver
that will handle this (and hopefully won't be any more
buggy then the NT4 console implementation).
================================================================ ================================================================
@ -80,3 +88,7 @@ FreeConsole
o even when all the handles to it are freed, the win32 console o even when all the handles to it are freed, the win32 console
stays visible, the only way I could find to free it stays visible, the only way I could find to free it
was via the FreeConsole was via the FreeConsole
Is it possible to interrupt win32's FileWrite? I'm not sure.
It may not be possible to interrupt any system calls.

View File

@ -1,33 +1,35 @@
Note: the debugging interface is under development. Please do not make Note: The new debugging interface is starting to take shape.
changes to it yet as I will do major changes in the next few weeks. In general, I think it can be considered to be stable,
To make my life easier, PLEASE follow the guidelines described in with the exception of the in-memory message construction functions.
this document. If you have some ideas that you would like to However, there is still a lot of work to be done to polish
incorporate, please contact me first. things up and to convert the remaining fprintf. To make my life
Please read the document before writing new code. easier, please follow the guidelines described in this document.
Read this document before writing new code.
Also, DO NOT USE fprintf (or printf) to output things. All these Also, DO NOT USE fprintf (or printf) to output things. All these
will have to be translated to dprintf_ calls and there are already will have to be translated to the new interface and there are already
about 3000 of them! Also, instead of writing FIXMEs in the source, about 3000 of them! Also, instead of writing FIXMEs in the source,
output a dprintf_fixme message. But read on... output a FIXME message if you can. But read on...
25 Feb 1998, Dimitrie O. Paun <dimi@cs.toronto.edu> 14 Mar 1998, Dimitrie O. Paun <dimi@cs.toronto.edu>
Debugging classes Debugging classes
----------------- -----------------
The debugging messages are divided into 4 classes: There are 4 types (or classes) of debugging messages:
fixme -- Messages in this class relate to behavior of Wine that does FIXME -- Messages in this class relate to behavior of Wine that does
not correspond to standard Windows behavior and that should not correspond to standard Windows behavior and that should
be fixed. be fixed.
Examples: stubs, semi-implemented features, etc. Examples: stubs, semi-implemented features, etc.
err -- Messages in this class relate to serious errors in Wine. ERR -- Messages in this class relate to serious errors in Wine.
This sort of messages are close to asserts -- that is, This sort of messages are close to asserts -- that is,
you should output a 'err' message when the code detects a you should output a error message when the code detects a
condition which should not happen. condition which should not happen.
Examples: unexpected change in internal state, etc. Examples: unexpected change in internal state, etc.
warn -- This are warning messages. You should report a warning when WARN -- These are warning messages. You should report a warning when
something unwanted happen but the function behaves properly. something unwanted happen but the function behaves properly.
That is, output a warning when you encounter something That is, output a warning when you encounter something
unexpected (ex: could not open a file) but the function deals unexpected (ex: could not open a file) but the function deals
@ -35,28 +37,24 @@ warn -- This are warning messages. You should report a warning when
If you do not deal correctly with it, output a fixme. If you do not deal correctly with it, output a fixme.
Examples: fail to access a resource required by the app, etc. Examples: fail to access a resource required by the app, etc.
info -- This are detailed debugging messages that are mainly useful TRACE -- These are detailed debugging messages that are mainly useful
to debug a component. This are usually turned off. to debug a component. These are usually turned off.
Examples: everything else that does not fall in one of the Examples: everything else that does not fall in one of the
above mentioned categories and the user does not above mentioned categories and the user does not
need to know about it. This sort of messages simply need to know about it.
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 The user has the capability to turn on or off messages of a particular
class. You can expect the following patters of usage (but note that type. You can expect the following patterns of usage (but note that
any combination is possible): any combination is possible):
-- when you debug a component, all classes (info,warn,err,fixme) -- when you debug a component, all types (TRACE,WARN,ERR,FIXME)
will be enabled. will be enabled.
-- during the pre-alpha (maybe alpha) stage of Wine, most likely -- during the pre-alpha (maybe alpha) stage of Wine, most likely
the info class will be disabled by default, but all others the TRACE class will be disabled by default, but all others
(warn,err,fixme) will be enabled by default. (WARN,ERR,FIXME) will be enabled by default.
-- when Wine will become stable, most likely the info and warn -- when Wine will become stable, most likely the TRACE and WARN
classes will be disabled by default, but all err and fixme classes will be disabled by default, but all ERRs and FIXMEs
will be enabled by default. will be enabled.
-- in some installations that want the smallest footprint -- in some installations that want the smallest footprint
and where the debug information is of no interest, and where the debug information is of no interest,
all classes may be disabled by default. all classes may be disabled by default.
@ -70,11 +68,11 @@ Debugging channels
------------------ ------------------
Also, we divide the debugging messages per component. Each component Also, we divide the debugging messages per component. Each component
is assigned a debugging channel (or type). The identifier of the is assigned a debugging channel. The identifier of the
channel must be a valid C identifier but note that it may also be a channel must be a valid C identifier but note that it may also be a
reserve word like int or static. reserve word like int or static.
Examples of debugging channels/types: Examples of debugging channels:
reg, updown, string reg, updown, string
We will refer to a generic channel as xxx. We will refer to a generic channel as xxx.
@ -89,26 +87,28 @@ Note: for those who know the old interface, the channel/type is
In the new interface, we drop the stddeb as it is implicit. In the new interface, we drop the stddeb as it is implicit.
However, we add an orthogonal piece of information to the However, we add an orthogonal piece of information to the
message: its class. This is very important as it will allow message: its class. This is very important as it will allow
us to selectively turn on or off certain messages based on us to selectively turn on or off certain messages based on the
type of information they report. For this reason it is VERY type of information they report. For this reason it is VERY
important to choose the right class for the message. important to choose the right class for the message.
Anyhow, suppose we figured that this message should belong Anyhow, suppose we figured that this message should belong
in the warn class, so in the new interface, you write: in the WARN class, so in the new interface, you write:
dprintf_warn(reg, "Could not access key!\n"); WARN(reg, "Could not access key!");
Notice the \n is no longer required.
--- ---
How to use it How to use it
------------- -------------
So, to output a message (class yyy) on channel xxx, do: So, to output a message (class YYY) on channel xxx, do:
#include "debug.h" #include "debug.h"
.... ....
dprintf_yyy(xxx, "<message>", ...); YYY(xxx, "<message>", ...);
Some examples from the code: Some examples from the code:
@ -117,14 +117,14 @@ Some examples from the code:
... ...
dprintf_info(crtdll, TRACE(crtdll, "CRTDLL_setbuf(file %p buf %p)",
"CRTDLL_setbuf(file %p buf %p)\n",
file, buf); file, buf);
dprintf_warn(aspi, "Error opening device errno=%d\n", save_error); WARN(aspi, "Error opening device errno=%d", save_error);
If you need to declare a new debugging channel, do: If you need to declare a new debugging channel, use it in your code
and then do:
%tools/make_debug %tools/make_debug
in the root directory of Wine. in the root directory of Wine.
@ -132,20 +132,20 @@ Note that this will result in almost complete recompilation of Wine.
Notes: Notes:
1. Please pay attention to which class you assign the message. 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 There are only 4 classes, so it is not hard. The reason
it is important to get it right is that too much information it is important to get it right is that too much information
is no information. For example, if you put things into the is no information. For example, if you put things into the
warn class that should really be in the info class, the WARN class that should really be in the TRACE class, the
output will be too big and this will force the user to 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 turn warnings off. But this way he will fail to see the important
ones. Also, if you put warnings into the info class lets say, ones. Also, if you put warnings into the TRACE class lets say,
he will most likely miss those because usually the info class he will most likely miss those because usually the TRACE class
is turned off. A similar argument can be made if you mix any is turned off. A similar argument can be made if you mix any
other two classes. other two classes.
2. ALL LINES MUST END WITH A NEWLINE!!! If you can NOT output 2. All lines end by default with a newline. So you should not
everything that you want in the line with only one dprintf_xxx add one more. If you can NOT output everything that you want in
statement, then you need to build the string in memory. the line with only one statement, then you need to build the string
in memory.
Please read the section below "In-memory messages" on the Please read the section below "In-memory messages" on the
preferred way to do it. PLEASE USE THAT INTERFACE TO BUILD preferred way to do it. PLEASE USE THAT INTERFACE TO BUILD
MESSAGES IN MEMORY. The reason is that we are not sure that MESSAGES IN MEMORY. The reason is that we are not sure that
@ -158,17 +158,22 @@ Are we debugging?
----------------- -----------------
To test whether the debugging output of class yyy on channel xxx is To test whether the debugging output of class yyy on channel xxx is
enabled, do: enabled, use:
debugging_yyy(xxx) TRACING to test if TRACE is enabled
WARNING to test if WARN is enabled
FIXMING to test if FIXME is enabled
ERRING to test if ERR is enabled
Examples: Examples:
if(debugging_info(atom)){ if(TRACING(atom)){
...blah... ...blah...
} }
Note that you should normaly need to test only if TRACING. At present,
none of the other 3 tests (except for ERRING which is used only once!)
are used in Wine.
In-memory messages In-memory messages
------------------ ------------------
@ -204,10 +209,10 @@ void some_func(tabs)
for (i = 0; i < descr->nb_tabs; i++) { for (i = 0; i < descr->nb_tabs; i++) {
descr->tabs[i] = *p++<<1; descr->tabs[i] = *p++<<1;
if(debugging_info(listbox)) /* write in it only if if(TRACING(listbox)) /* write in it only if
dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */ dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */
} }
dprintf_info(listbox, "Listbox %04x: settabstops %s\n", TRACE(listbox, "Listbox %04x: settabstops %s",
wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */ wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
} }
@ -221,20 +226,20 @@ void some_func(tabs)
for (i = 0; i < descr->nb_tabs; i++) { for (i = 0; i < descr->nb_tabs; i++) {
descr->tabs[i] = *p++<<1; descr->tabs[i] = *p++<<1;
if(debugging_info(listbox)) /* write in it only if if(TRACING(listbox)) /* write in it only if
dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */ dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */
} }
dprintf_info(listbox, "Listbox %04x: settabstops %s\n", TRACE(listbox, "Listbox %04x: settabstops %s\n",
wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */ wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
dbg_reset_str(listbox); /* !!!reset the string!!! */ dbg_reset_str(listbox); /* !!!reset the string!!! */
for (i = 0; i < descr->extrainfo_nr; i++) { for (i = 0; i < descr->extrainfo_nr; i++) {
descr->extrainfo = *p+1; descr->extrainfo = *p+1;
if(debugging_info(listbox)) /* write in it only if if(TRACING(listbox)) /* write in it only if
dsprintf(listbox,"%3d ",descr->extrainfo); /* we are gonna output it */ dsprintf(listbox,"%3d ",descr->extrainfo); /* we are gonna output it */
} }
dprintf_info(listbox, "Listbox %04x: extrainfo %s\n", TRACE(listbox, "Listbox %04x: extrainfo %s\n",
wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */ wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */
} }
@ -249,12 +254,12 @@ IMPORTANT NOTE:
interface (when it will become available). So, if you need to use if, interface (when it will become available). So, if you need to use if,
then follow the following guidelines: then follow the following guidelines:
-- wrap calls to dsprintf with a -- wrap calls to dsprintf with a
if(debugging_yyy(xxx)) if(YYY(xxx))
dsprintf(xxx,...); dsprintf(xxx,...);
Of course, if the call to dsprintf is made from within a function 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 which you know is called only if YYY(xxx) is true
(say you call it only like this: (say you call it only like this:
if(debugging_yyy(xxx)) if(YYY(xxx))
print_some_debug_info(); print_some_debug_info();
) )
then you need not (and should not) wrap calls to dsprintf with then you need not (and should not) wrap calls to dsprintf with
@ -298,7 +303,7 @@ Thus, to use it, do something on the following lines:
... ...
dprintf_yyy(xxx, "resource is %s", debugres(myresource)); YYY(xxx, "resource is %s", debugres(myresource));
The -debugmsg command line option The -debugmsg command line option
@ -316,15 +321,15 @@ So, the -debugmsg command line option has been changed as follows:
enables all messages on the reg channel and disables all enables all messages on the reg channel and disables all
messages on the file channel. messages on the file channel.
This is very close (actually identical) to the old semantics. This is same as the old semantics.
- when the optional class argument (yyy) is present, - when the optional class argument (yyy) is present,
then the statement will enable(+)/disable(-) messages for then the statement will enable(+)/disable(-) messages for
the given channel (xxx) only on the given class. For example: the given channel (xxx) only on the given class. For example:
-debugmsg info+reg,warn-file -debugmsg trace+reg,warn-file
enables info messages on the reg channel and disables warning enables trace messages on the reg channel and disables warning
messages on the file channel. messages on the file channel.
- also, the pseudo-channel all is also supported and it has the - also, the pseudo-channel all is also supported and it has the
@ -343,8 +348,8 @@ So, the -debugmsg command line option has been changed as follows:
Also, note that at the moment: Also, note that at the moment:
- the fixme, err, warn classes are all enabled by default - the fixme and err classes are enabled by default
- the info class is disabled by default - the trace and warn classes are disabled by default
- there is no way to compile out the messages. All are - there is no way to compile out the messages. All are
runtime configurable. This will come next release. runtime configurable. This will come next release.

View File

@ -0,0 +1,20 @@
This file contains information about the LZ file decompression libraries.
The LZ (Lempel Ziv) decompression was used in win16 installation programs.
(Win32 installation programs now use mostly CAB or WINZIP selfextractors
or something similair.)
It is a simple tabledriven decompression engine, the algorithm is not
documented as far as I know. WINE does not contain a compressor for
this format.
The libraries consist of LZEXPAND.DLL (win16) and LZ32.DLL (win32), the
implementation can be found in misc/lzexpand.c and there is a small
example program in libtest/expand.c.
The implementation is complete and there have been no reports of failures
for some time.
FIXMEs:
- Check for correct include files
- Check whether the return values are correct
- Write a compressor for this format.

View File

@ -0,0 +1,176 @@
This file contains information about the implementation of the multimedia
layer of WINE.
The libraries consist of MMSYSTEM.DLL (win16), WINMM.DLL (win32) and some
(abstracted, not Windows compatible) lowlevel drivers. The implementation
can be found in the multimedia/ subdirectory.
The multimedia stuff is split into 3 layers. The lowlevel (device drivers),
midlevel (MCI commands) and highlevel abstraction layers.
1. Lowlevel layers
Following lowlevel layers are implemented:
1.1 (Waveform) Audio
The API consists of the waveIn*/waveOut* functions found in
multimedia/mmsystem.c. They call the real lowlevel audiodriver using
the wodMessage/widMessage function in multimedia/audio.c, which handles
the different requests.
The lowlevel audio driver is currently only implemented for the
OpenSoundSystem (OSS) as supplied in the Linux and FreeBSD kernels by
4Front Technologies (http://www.4front-tech.com/). The presence of this
driver is checked by configure (depends on the <sys/soundcard.h> file).
The implementation contains all features commonly used, but has several
problems. For instance:
Writes and reads are not done asynchronously as they are supposed to
be done. This breaks some programs (soundrec.exe from the Windows applets),
but doesn't worry other programs. Some callbacks are probably done
incorrectly (there are reports of some broken multimedia applications,
but I haven't found one yet.)
TODO:
- add asynchronous writes and reads (must use threads)
- check the callback functions
- verify all functions for correctness
- add drivers for other soundsystems (Sun Audio, remote audio systems
(using X extensions, ...)
1.2 Mixer
The API consists of the mixer* functions found in multimedia/mmsystem.c.
They call the lowlevel driver functions in multimedia/mixer.c using the
mixMessage function.
The current implementation tries to use the OpenSoundSystem mixer, but is
missing nearly everything. There is no report of a working application.
TODO:
- implement mixing functionality for OSS correctly.
- implement mixing lowlevel drivers for other mixers.
1.3 MIDI
The API consists of the midi* functions found in multimedia/mmsystem.c.
They call the lowlevel driver functions in multimedia/midi.c using the
midMessage and the modMessage functions.
The current implementation is completely broken. (I think open(), read()
and write() of the /dev/midi device would make this implementation nearly
complete...)
TODO:
- Implement correct MIDI output
- Do not implement a software synthesizer. This should be done
using MIDI loopback devices in an external program (like timidity).
1.4 Timers
The API consists of the timer* functions found in multimedia/timer.c.
There is currently only one implementation, which uses normal windows timers.
The implementation works for most cases found. The only problem is that
it doesn't support asynchronous timer events (as it is supposed to do).
There is a workaround for this lack in timeGetTime() to make Diablo work
and 'Pinball! SpaceCadet' at least start up.
TODO:
- Implemented asynchronous timers (using a thread probably)
1.5 MMIO
The API consists of the mmio* functions found in multimedia/mmio.c.
FIXME: I am not sure about the status of this implementation.
TODO:
- add win32 support.
- ...
1.6 AUX
The API consists of the aux* functions found in multimedia/mmsystem.c.
They call auxMessage in multimedia/mmaux.c.
The aux* functions are the predecessor of the mixer* functions.
The implementation uses the OSS mixer API, and is incomplete.
TODO:
- verify the implementation
1.7 JOYSTICK
The API consists of the joy* functions found in multimedia/joystick.c.
The implementation currently uses the Linux joystick device driver API.
It is lacking support for enhanced joysticks and has not been extensively
tested.
TODO:
- better support of enhanced joysticks
- support more joystick drivers (like the XInput extension)
2. Midlevel drivers (MCI)
The midlevel drivers are represented by some common API functions,
mostly mciSendCommand and mciSendString. The mciSendString function
uses commandstrings, which are translated into normal MCI commands as
used by mciSendCommand. The API can be found in multimedia/mmsystem.c
and multimedia/mcistring.c.
The functions there (mciOpen,mciSysInfo) handle midlevel driver
allocation and calls.
The implementation is not complete, but works for most cases.
Win32 support for mciSendCommand is missing (mciSendString works
in the Win32 case, since the use of strings doesn't differ between
win16 and win32).
TODO:
- Win32 support
- support windows MCI drivers (should be possible for they usually
do not use lowlevel calls)
- MCI command loading support
- implement other stuff as yet unknown
WINE implements several MCI midlevel drivers:
2.1 CDAUDIO
The currently best implementation is the MCI CDAUDIO driver that can
be found in multimedia/mcicda.c. The implementation is mostly complete,
there have been no reports of errors.
The implementation currently uses only the Linux /dev/cdrom controlling
functions. (Sun and BSD like should be similair, but are not implemented.)
A very small example of a cdplayer consists just of the line
mciSendString("play cdaudio",NULL,0,0);
TODO:
- add support for other cdaudio drivers
2.2 MCIWAVE
The implementation is rather complete and can be found in multimedia/audio.c.
It uses the lowlevel audio API (although not abstracted correctly).
FIXME: The MCI_STATUS command is broken.
TODO: - check for correctness
2.3 MIDI/SEQUENCER
The implementation can be found in multimedia/midi.c. I am not sure
about the completeness.
It uses the lowlevel midi driver and is probably broken too.
TODO:
- implement it correctly
2.4 MCIANIM
The implementation consists of stubs and is in multimedia/mcianim.c.
TODO:
- implement it, probably using xanim or something similair. Could
also be implemented by using the Windows MCI video drivers.

View File

@ -0,0 +1,20 @@
This file contains information about the versioning libraries.
They consist of VER.DLL (win16) and VERSION.DLL (win32).
The implementation can be found in misc/ver.c.
The purpose of this library is to:
- Extract resource information from possibly compressed files
- Install dlls including versionchecking
- Query version dependend variables.
The resource extraction is almost complete. There have been no reports of
missing functionality, but I am not sure about absolute completeness.
The DLL installation APIs do work, but is probably not correct.
The API to query version dependend variables (VerQueryValue) works for
both win16/win32 resources, but is probably not correct for some cases.
FIXME:
- Check the installation functions.
- Verify VerQueryValue.

View File

@ -96,10 +96,10 @@ void DIR_ParseWindowsPath( char *path )
DIR_PathElements++; DIR_PathElements++;
} }
if (debugging_info(dosfs)) if (TRACE_ON(dosfs))
for (i = 0; i < DIR_PathElements; i++) for (i = 0; i < DIR_PathElements; i++)
{ {
dprintf_info(dosfs, "Path[%d]: %s = %s\n", TRACE(dosfs, "Path[%d]: %s = %s\n",
i, DIR_DosPath[i], DIR_UnixPath[i] ); i, DIR_DosPath[i], DIR_UnixPath[i] );
} }
} }
@ -155,10 +155,11 @@ int DIR_Init(void)
path, sizeof(path) ); path, sizeof(path) );
DIR_ParseWindowsPath( path ); DIR_ParseWindowsPath( path );
dprintf_info(dosfs, "WindowsDir = %s\nSystemDir = %s\n", TRACE(dosfs, "WindowsDir = %s\n", DIR_WindowsDosDir);
DIR_WindowsDosDir, DIR_SystemDosDir ); TRACE(dosfs, "SystemDir = %s\n", DIR_SystemDosDir);
dprintf_info(dosfs, "TempDir = %s\nCwd = %c:\\%s\n", TRACE(dosfs, "TempDir = %s\n", DIR_TempDosDir);
DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) ); TRACE(dosfs, "Cwd = %c:\\%s\n",
'A' + drive, DRIVE_GetDosCwd( drive ) );
/* Put the temp and Windows and system directories into the environment */ /* Put the temp and Windows and system directories into the environment */
@ -327,7 +328,7 @@ UINT32 WINAPI GetSystemDirectory32W( LPWSTR path, UINT32 count )
*/ */
BOOL16 WINAPI CreateDirectory16( LPCSTR path, LPVOID dummy ) BOOL16 WINAPI CreateDirectory16( LPCSTR path, LPVOID dummy )
{ {
dprintf_info(file,"CreateDirectory16(%s,%p)\n", path, dummy ); TRACE(file,"(%s,%p)\n", path, dummy );
return (BOOL16)CreateDirectory32A( path, NULL ); return (BOOL16)CreateDirectory32A( path, NULL );
} }
@ -340,10 +341,10 @@ BOOL32 WINAPI CreateDirectory32A( LPCSTR path,
{ {
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
dprintf_info(file, "CreateDirectory32A(%s,%p)\n", path, lpsecattribs ); TRACE(file, "(%s,%p)\n", path, lpsecattribs );
if (DOSFS_IsDevice( path )) if (DOSFS_IsDevice( path ))
{ {
dprintf_info(file, "CreateDirectory: cannot use device '%s'!\n",path); TRACE(file, "cannot use device '%s'!\n",path);
DOS_ERROR( ER_AccessDenied, EC_AccessDenied, SA_Abort, EL_Disk ); DOS_ERROR( ER_AccessDenied, EC_AccessDenied, SA_Abort, EL_Disk );
return FALSE; return FALSE;
} }
@ -406,11 +407,11 @@ BOOL32 WINAPI RemoveDirectory32A( LPCSTR path )
{ {
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
dprintf_info(file, "RemoveDirectory: '%s'\n", path ); TRACE(file, "'%s'\n", path );
if (DOSFS_IsDevice( path )) if (DOSFS_IsDevice( path ))
{ {
dprintf_info(file, "RemoveDirectory: cannot remove device '%s'!\n", path); TRACE(file, "cannot remove device '%s'!\n", path);
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
return FALSE; return FALSE;
} }

View File

@ -500,13 +500,13 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
if ((p = strchr( name, '\\' ))) len = MIN( (int)(p - name), len ); if ((p = strchr( name, '\\' ))) len = MIN( (int)(p - name), len );
if (long_len < len + 1) return FALSE; if (long_len < len + 1) return FALSE;
dprintf_info(dosfs, "DOSFS_FindUnixName: %s,%s\n", path, name ); TRACE(dosfs, "%s,%s\n", path, name );
if (!DOSFS_ToDosFCBFormat( name, dos_name )) dos_name[0] = '\0'; if (!DOSFS_ToDosFCBFormat( name, dos_name )) dos_name[0] = '\0';
if (!(dir = DOSFS_OpenDir( path ))) if (!(dir = DOSFS_OpenDir( path )))
{ {
dprintf_warn(dosfs, "DOSFS_FindUnixName(%s,%s): can't open dir: %s\n", WARN(dosfs, "(%s,%s): can't open dir: %s\n",
path, name, strerror(errno) ); path, name, strerror(errno) );
return FALSE; return FALSE;
} }
@ -546,11 +546,11 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
else else
DOSFS_Hash( long_name, short_buf, FALSE, ignore_case ); DOSFS_Hash( long_name, short_buf, FALSE, ignore_case );
} }
dprintf_info(dosfs, "(%s,%s) -> %s (%s)\n", TRACE(dosfs, "(%s,%s) -> %s (%s)\n",
path, name, long_name, short_buf ? short_buf : "***"); path, name, long_name, short_buf ? short_buf : "***");
} }
else else
dprintf_warn(dosfs, "file: '%s' NOT FOUND in dir: '%s'\n", name, path); WARN(dosfs, "'%s' not found in '%s'\n", name, path);
DOSFS_CloseDir( dir ); DOSFS_CloseDir( dir );
return ret; return ret;
} }
@ -613,7 +613,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
return GetStdHandle( STD_OUTPUT_HANDLE ); return GetStdHandle( STD_OUTPUT_HANDLE );
break; break;
default: default:
fprintf(stderr,"DOSFS_OpenDevice: CON cannot be opened read/write currently, FIXME.\n"); FIXME(dosfs,"can't open CON read/write\n");
return HFILE_ERROR32; return HFILE_ERROR32;
break; break;
} }
@ -679,7 +679,7 @@ BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last, DOS_FULL_NAME *full )
UINT32 flags; UINT32 flags;
char *p_l, *p_s, *root; char *p_l, *p_s, *root;
dprintf_info(dosfs, "DOSFS_GetFullName: %s (last=%d)\n", TRACE(dosfs, "%s (last=%d)\n",
name, check_last ); name, check_last );
if ((full->drive = DOSFS_GetPathDrive( &name )) == -1) return FALSE; if ((full->drive = DOSFS_GetPathDrive( &name )) == -1) return FALSE;
@ -787,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->long_name[0]) strcpy( full->long_name, "/" );
if (!full->short_name[2]) strcpy( full->short_name + 2, "\\" ); if (!full->short_name[2]) strcpy( full->short_name + 2, "\\" );
dprintf_info(dosfs, "DOSFS_GetFullName: returning %s = %s\n", TRACE(dosfs, "returning %s = %s\n",
full->long_name, full->short_name ); full->long_name, full->short_name );
return TRUE; return TRUE;
} }
@ -877,7 +877,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
int drive; int drive;
char *p; char *p;
dprintf_info(dosfs, "GetFullPathName: converting %s\n", name ); TRACE(dosfs, "converting %s\n", name );
if (!name || !result) return 0; if (!name || !result) return 0;
@ -941,7 +941,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
if (unicode) lstrcpynAtoW( (LPWSTR)result, buffer, len ); if (unicode) lstrcpynAtoW( (LPWSTR)result, buffer, len );
else lstrcpyn32A( result, buffer, len ); else lstrcpyn32A( result, buffer, len );
dprintf_info(dosfs, "GetFullPathName: returning %s\n", buffer ); TRACE(dosfs, "returning %s\n", buffer );
return strlen(buffer); return strlen(buffer);
} }
@ -1026,7 +1026,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
else /* Not in the cache, open it anew */ else /* Not in the cache, open it anew */
{ {
const char *drive_path; const char *drive_path;
dprintf_info(dosfs, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n", TRACE(dosfs, "cache miss, path=%s skip=%d buf=%s cur=%d\n",
path, skip, buffer, cur_pos ); path, skip, buffer, cur_pos );
cur_pos = skip; cur_pos = skip;
if (dir) DOSFS_CloseDir(dir); if (dir) DOSFS_CloseDir(dir);
@ -1035,7 +1035,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
drive_path = path + strlen(DRIVE_GetRoot(drive)); drive_path = path + strlen(DRIVE_GetRoot(drive));
while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++; while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++;
drive_root = !*drive_path; drive_root = !*drive_path;
dprintf_info(dosfs, "DOSFS_FindNext: drive_root = %d\n", drive_root); TRACE(dosfs, "drive_root = %d\n", drive_root);
lstrcpyn32A( buffer, path, sizeof(buffer) - 1 ); lstrcpyn32A( buffer, path, sizeof(buffer) - 1 );
} }
strcat( buffer, "/" ); strcat( buffer, "/" );
@ -1079,7 +1079,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
lstrcpyn32A( p, long_name, sizeof(buffer) - (int)(p - buffer) ); lstrcpyn32A( p, long_name, sizeof(buffer) - (int)(p - buffer) );
if (!FILE_Stat( buffer, &info )) if (!FILE_Stat( buffer, &info ))
{ {
fprintf( stderr, "DOSFS_FindNext: can't stat %s\n", buffer ); WARN(dosfs, "can't stat %s\n", buffer);
continue; continue;
} }
if (info.dwFileAttributes & ~attr) continue; if (info.dwFileAttributes & ~attr) continue;
@ -1101,7 +1101,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
lstrcpyn32A( entry->cFileName, long_name, sizeof(entry->cFileName) ); lstrcpyn32A( entry->cFileName, long_name, sizeof(entry->cFileName) );
if (!(flags & DRIVE_CASE_PRESERVING)) CharLower32A( entry->cFileName ); if (!(flags & DRIVE_CASE_PRESERVING)) CharLower32A( entry->cFileName );
dprintf_info(dosfs, "DOSFS_FindNext: returning %s (%s) %02lx %ld\n", TRACE(dosfs, "returning %s (%s) %02lx %ld\n",
entry->cFileName, entry->cAlternateFileName, entry->cFileName, entry->cAlternateFileName,
entry->dwFileAttributes, entry->nFileSizeLow ); entry->dwFileAttributes, entry->nFileSizeLow );
cur_pos += count; cur_pos += count;
@ -1547,13 +1547,26 @@ BOOL32 WINAPI LocalFileTimeToFileTime( const FILETIME *localft,
BOOL32 WINAPI FileTimeToLocalFileTime( const FILETIME *utcft, BOOL32 WINAPI FileTimeToLocalFileTime( const FILETIME *utcft,
LPFILETIME localft ) LPFILETIME localft )
{ {
struct tm *xtm;
DWORD remainder; DWORD remainder;
/* convert from UTC to local. Perhaps not correct. FIXME */ /* convert from UTC to local. Perhaps not correct. FIXME */
time_t unixtime = DOSFS_FileTimeToUnixTime( utcft, &remainder ); time_t unixtime = DOSFS_FileTimeToUnixTime( utcft, &remainder );
#ifdef HAVE_TIMEGM
struct tm *xtm = localtime( &unixtime );
time_t localtime;
localtime = timegm(xtm);
DOSFS_UnixTimeToFileTime( localtime, localft, remainder );
#else
struct tm *xtm,*gtm;
time_t time1,time2;
xtm = localtime( &unixtime ); xtm = localtime( &unixtime );
DOSFS_UnixTimeToFileTime( mktime(xtm), localft, remainder ); gtm = gmtime( &unixtime );
time1 = mktime(xtm);
time2 = mktime(gtm);
DOSFS_UnixTimeToFileTime( 2*time1-time2, localft, remainder );
#endif
return TRUE; return TRUE;
} }
@ -1567,7 +1580,7 @@ BOOL32 WINAPI FileTimeToSystemTime( const FILETIME *ft, LPSYSTEMTIME syst )
DWORD remainder; DWORD remainder;
time_t xtime = DOSFS_FileTimeToUnixTime( ft, &remainder ); time_t xtime = DOSFS_FileTimeToUnixTime( ft, &remainder );
xtm = gmtime(&xtime); xtm = gmtime(&xtime);
syst->wYear = xtm->tm_year; syst->wYear = xtm->tm_year+1900;
syst->wMonth = xtm->tm_mon + 1; syst->wMonth = xtm->tm_mon + 1;
syst->wDayOfWeek = xtm->tm_wday; syst->wDayOfWeek = xtm->tm_wday;
syst->wDay = xtm->tm_mday; syst->wDay = xtm->tm_mday;
@ -1588,7 +1601,7 @@ DWORD WINAPI QueryDosDevice32A(LPCSTR devname,LPSTR target,DWORD bufsize)
LPSTR s; LPSTR s;
char buffer[200]; char buffer[200];
dprintf_info(dosfs,"QueryDosDevice(%s,...)\n",devname?devname:"<null>"); TRACE(dosfs,"(%s,...)\n",devname?devname:"<null>");
if (!devname) { if (!devname) {
/* return known MSDOS devices */ /* return known MSDOS devices */
lstrcpy32A(buffer,"CON COM1 COM2 LPT1 NUL "); lstrcpy32A(buffer,"CON COM1 COM2 LPT1 NUL ");
@ -1629,15 +1642,33 @@ DWORD WINAPI QueryDosDevice32W(LPCWSTR devname,LPWSTR target,DWORD bufsize)
*/ */
BOOL32 WINAPI SystemTimeToFileTime( const SYSTEMTIME *syst, LPFILETIME ft ) BOOL32 WINAPI SystemTimeToFileTime( const SYSTEMTIME *syst, LPFILETIME ft )
{ {
#ifdef HAVE_TIMEGM
struct tm xtm; struct tm xtm;
time_t utctime;
#else
struct tm xtm,*local_tm,*utc_tm;
time_t localtim,utctime;
#endif
xtm.tm_year = syst->wYear; xtm.tm_year = syst->wYear-1900;
xtm.tm_mon = syst->wMonth - 1; xtm.tm_mon = syst->wMonth - 1;
xtm.tm_wday = syst->wDayOfWeek; xtm.tm_wday = syst->wDayOfWeek;
xtm.tm_mday = syst->wDay; xtm.tm_mday = syst->wDay;
xtm.tm_hour = syst->wHour; xtm.tm_hour = syst->wHour;
xtm.tm_min = syst->wMinute; xtm.tm_min = syst->wMinute;
xtm.tm_sec = syst->wSecond; xtm.tm_sec = syst->wSecond; /* this is UTC */
DOSFS_UnixTimeToFileTime( mktime(&xtm), ft, syst->wMilliseconds * 10000 ); xtm.tm_isdst = -1;
#ifdef HAVE_TIMEGM
utctime = timegm(&xtm);
DOSFS_UnixTimeToFileTime( utctime, ft,
syst->wMilliseconds * 10000 );
#else
localtim = mktime(&xtm); /* now we've got local time */
local_tm = localtime(&localtim);
utc_tm = gmtime(&localtim);
utctime = mktime(utc_tm);
DOSFS_UnixTimeToFileTime( 2*localtim -utctime, ft,
syst->wMilliseconds * 10000 );
#endif
return TRUE; return TRUE;
} }

View File

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

View File

@ -104,7 +104,7 @@ static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars,
FILE_OBJECT *file = (FILE_OBJECT *)ptr; FILE_OBJECT *file = (FILE_OBJECT *)ptr;
int result; int result;
dprintf_info(file, "FILE_Read: %p %p %ld\n", ptr, lpBuffer, TRACE(file, "%p %p %ld\n", ptr, lpBuffer,
nNumberOfChars); nNumberOfChars);
if (nNumberOfChars == 0) { if (nNumberOfChars == 0) {
@ -134,15 +134,14 @@ static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars,
FILE_OBJECT *file = (FILE_OBJECT *)ptr; FILE_OBJECT *file = (FILE_OBJECT *)ptr;
int result; int result;
dprintf_info(file, "FILE_Write: %p %p %ld\n", ptr, lpBuffer, TRACE(file, "%p %p %ld\n", ptr, lpBuffer,
nNumberOfChars); nNumberOfChars);
*lpNumberOfChars = 0; *lpNumberOfChars = 0;
/* FIXME: there was a loop here before that /*
* retried writes after EAGAIN, why??? -- I assume * I assume this loop around EAGAIN is here because
* it is because win32 doesn't have interrupted * win32 doesn't have interrupted system calls
* system calls
*/ */
for (;;) for (;;)
@ -229,7 +228,7 @@ void FILE_SetDosError(void)
{ {
int save_errno = errno; /* errno gets overwritten by printf */ int save_errno = errno; /* errno gets overwritten by printf */
dprintf_info(file, "FILE_SetDosError: errno = %d %s\n", errno, strerror(errno)); TRACE(file, "errno = %d %s\n", errno, strerror(errno));
switch (save_errno) switch (save_errno)
{ {
case EAGAIN: case EAGAIN:
@ -263,6 +262,7 @@ void FILE_SetDosError(void)
DOS_ERROR( ER_FileExists, EC_Exists, SA_Abort, EL_Disk ); DOS_ERROR( ER_FileExists, EC_Exists, SA_Abort, EL_Disk );
break; break;
case EINVAL: case EINVAL:
case ESPIPE:
DOS_ERROR( ER_SeekError, EC_NotFound, SA_Ignore, EL_Disk ); DOS_ERROR( ER_SeekError, EC_NotFound, SA_Ignore, EL_Disk );
break; break;
case ENOTEMPTY: case ENOTEMPTY:
@ -345,7 +345,7 @@ HFILE32 FILE_Open( LPCSTR path, INT32 mode )
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
const char *unixName; const char *unixName;
dprintf_info(file, "FILE_Open: '%s' %04x\n", path, mode ); TRACE(file, "'%s' %04x\n", path, mode );
if (!path) return HFILE_ERROR32; if (!path) return HFILE_ERROR32;
@ -353,7 +353,7 @@ HFILE32 FILE_Open( LPCSTR path, INT32 mode )
{ {
HFILE32 ret; HFILE32 ret;
dprintf_info(file, "FILE_Open: opening device '%s'\n", path ); TRACE(file, "opening device '%s'\n", path );
if (HFILE_ERROR32!=(ret=DOSFS_OpenDevice( path, mode ))) if (HFILE_ERROR32!=(ret=DOSFS_OpenDevice( path, mode )))
return ret; return ret;
@ -383,7 +383,7 @@ static HFILE32 FILE_Create( LPCSTR path, int mode, int unique )
FILE_OBJECT *file; FILE_OBJECT *file;
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
dprintf_info(file, "FILE_Create: '%s' %04x %d\n", path, mode, unique ); TRACE(file, "'%s' %04x %d\n", path, mode, unique );
if (!path) return INVALID_HANDLE_VALUE32; if (!path) return INVALID_HANDLE_VALUE32;
@ -582,11 +582,11 @@ HFILE32 FILE_Dup( HFILE32 hFile )
FILE_OBJECT *file; FILE_OBJECT *file;
HFILE32 handle; HFILE32 handle;
dprintf_info(file, "FILE_Dup for handle %d\n", hFile ); TRACE(file, "FILE_Dup for handle %d\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32; if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32;
handle = HANDLE_Alloc( &file->header, FILE_ALL_ACCESS /*FIXME*/, FALSE ); handle = HANDLE_Alloc( &file->header, FILE_ALL_ACCESS /*FIXME*/, FALSE );
FILE_ReleaseFile( file ); FILE_ReleaseFile( file );
dprintf_info(file, "FILE_Dup return handle %d\n", handle ); TRACE(file, "FILE_Dup return handle %d\n", handle );
return handle; return handle;
} }
@ -600,7 +600,7 @@ HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 )
{ {
FILE_OBJECT *file; FILE_OBJECT *file;
dprintf_info(file, "FILE_Dup2 for handle %d\n", hFile1 ); TRACE(file, "FILE_Dup2 for handle %d\n", hFile1 );
/* FIXME: should use DuplicateHandle */ /* FIXME: should use DuplicateHandle */
if (!(file = FILE_GetFile( hFile1 ))) return HFILE_ERROR32; if (!(file = FILE_GetFile( hFile1 ))) return HFILE_ERROR32;
if (!HANDLE_SetObjPtr( hFile2, &file->header, 0 )) hFile2 = HFILE_ERROR32; if (!HANDLE_SetObjPtr( hFile2, &file->header, 0 )) hFile2 = HFILE_ERROR32;
@ -672,7 +672,7 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
HFILE32 handle = FILE_Create( buffer, 0666, TRUE ); HFILE32 handle = FILE_Create( buffer, 0666, TRUE );
if (handle != INVALID_HANDLE_VALUE32) if (handle != INVALID_HANDLE_VALUE32)
{ /* We created it */ { /* We created it */
dprintf_info(file, "GetTempFileName32A: created %s\n", TRACE(file, "created %s\n",
buffer); buffer);
CloseHandle( handle ); CloseHandle( handle );
break; break;
@ -696,7 +696,7 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
"Please check your configuration file if this generates a failure.\n", "Please check your configuration file if this generates a failure.\n",
buffer); buffer);
} }
dprintf_info(file, "GetTempFileName32A: returning %s\n", buffer ); TRACE(file, "returning %s\n", buffer );
return unique ? unique : num; return unique ? unique : num;
} }
@ -750,7 +750,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
return HFILE_ERROR32; return HFILE_ERROR32;
} }
dprintf_info(file, "OpenFile: %s %04x\n", name, mode ); TRACE(file, "%s %04x\n", name, mode );
/* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName /* 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? Are there any cases where getting the path here is wrong?
@ -764,7 +764,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
{ {
ofs->fFixedDisk = (GetDriveType16( ofs->szPathName[0]-'A' ) ofs->fFixedDisk = (GetDriveType16( ofs->szPathName[0]-'A' )
!= DRIVE_REMOVABLE); != DRIVE_REMOVABLE);
dprintf_info(file, "OpenFile(%s): OF_PARSE, res = '%s'\n", TRACE(file, "(%s): OF_PARSE, res = '%s'\n",
name, ofs->szPathName ); name, ofs->szPathName );
return 0; return 0;
} }
@ -797,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; if (!DIR_SearchPath( NULL, name, NULL, &full_name, win32 )) goto not_found;
found: found:
dprintf_info(file, "OpenFile: found %s = %s\n", TRACE(file, "found %s = %s\n",
full_name.long_name, full_name.short_name ); full_name.long_name, full_name.short_name );
lstrcpyn32A( ofs->szPathName, full_name.short_name, lstrcpyn32A( ofs->szPathName, full_name.short_name,
sizeof(ofs->szPathName) ); sizeof(ofs->szPathName) );
@ -805,7 +805,7 @@ found:
if (mode & OF_DELETE) if (mode & OF_DELETE)
{ {
if (unlink( full_name.long_name ) == -1) goto not_found; if (unlink( full_name.long_name ) == -1) goto not_found;
dprintf_info(file, "OpenFile(%s): OF_DELETE return = OK\n", name); TRACE(file, "(%s): OF_DELETE return = OK\n", name);
return 1; return 1;
} }
@ -829,7 +829,7 @@ found:
if (memcmp( ofs->reserved, filedatetime, sizeof(ofs->reserved) )) if (memcmp( ofs->reserved, filedatetime, sizeof(ofs->reserved) ))
{ {
CloseHandle( hFileRet ); CloseHandle( hFileRet );
dprintf_warn(file, "OpenFile(%s): OF_VERIFY failed\n", name ); WARN(file, "(%s): OF_VERIFY failed\n", name );
/* FIXME: what error here? */ /* FIXME: what error here? */
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
goto error; goto error;
@ -838,19 +838,19 @@ found:
memcpy( ofs->reserved, filedatetime, sizeof(ofs->reserved) ); memcpy( ofs->reserved, filedatetime, sizeof(ofs->reserved) );
success: /* We get here if the open was successful */ success: /* We get here if the open was successful */
dprintf_info(file, "OpenFile(%s): OK, return = %d\n", name, hFileRet ); TRACE(file, "(%s): OK, return = %d\n", name, hFileRet );
if (mode & OF_EXIST) /* Return the handle, but close it first */ if (mode & OF_EXIST) /* Return the handle, but close it first */
CloseHandle( hFileRet ); CloseHandle( hFileRet );
return hFileRet; return hFileRet;
not_found: /* We get here if the file does not exist */ not_found: /* We get here if the file does not exist */
dprintf_warn(file, "OpenFile: '%s' not found\n", name ); WARN(file, "'%s' not found\n", name );
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
/* fall through */ /* fall through */
error: /* We get here if there was an error opening the file */ error: /* We get here if there was an error opening the file */
ofs->nErrCode = DOS_ExtendedError; ofs->nErrCode = DOS_ExtendedError;
dprintf_warn(file, "OpenFile(%s): return = HFILE_ERROR error= %d\n", WARN(file, "(%s): return = HFILE_ERROR error= %d\n",
name,ofs->nErrCode ); name,ofs->nErrCode );
return HFILE_ERROR32; return HFILE_ERROR32;
} }
@ -879,7 +879,7 @@ HFILE32 WINAPI OpenFile32( LPCSTR name, OFSTRUCT *ofs, UINT32 mode )
*/ */
HFILE16 WINAPI _lclose16( HFILE16 hFile ) HFILE16 WINAPI _lclose16( HFILE16 hFile )
{ {
dprintf_info(file, "_lclose16: handle %d\n", hFile ); TRACE(file, "handle %d\n", hFile );
return CloseHandle( hFile ) ? 0 : HFILE_ERROR16; return CloseHandle( hFile ) ? 0 : HFILE_ERROR16;
} }
@ -889,7 +889,7 @@ HFILE16 WINAPI _lclose16( HFILE16 hFile )
*/ */
HFILE32 WINAPI _lclose32( HFILE32 hFile ) HFILE32 WINAPI _lclose32( HFILE32 hFile )
{ {
dprintf_info(file, "_lclose32: handle %d\n", hFile ); TRACE(file, "handle %d\n", hFile );
return CloseHandle( hFile ) ? 0 : HFILE_ERROR32; return CloseHandle( hFile ) ? 0 : HFILE_ERROR32;
} }
@ -901,7 +901,7 @@ LONG WINAPI WIN16_hread( HFILE16 hFile, SEGPTR buffer, LONG count )
{ {
LONG maxlen; LONG maxlen;
dprintf_info(file, "WIN16_hread: %d %08lx %ld\n", TRACE(file, "%d %08lx %ld\n",
hFile, (DWORD)buffer, count ); hFile, (DWORD)buffer, count );
/* Some programs pass a count larger than the allocated buffer */ /* Some programs pass a count larger than the allocated buffer */
@ -929,7 +929,7 @@ UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count )
DWORD numWritten; DWORD numWritten;
BOOL32 result = FALSE; BOOL32 result = FALSE;
dprintf_info( file, "_lread32: %d %p %d\n", handle, buffer, count); TRACE( file, "%d %p %d\n", handle, buffer, count);
if (!(ptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0))) return -1; if (!(ptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0))) return -1;
if (K32OBJ_OPS(ptr)->read) if (K32OBJ_OPS(ptr)->read)
result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL); result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL);
@ -954,7 +954,7 @@ UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count )
HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr ) HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
{ {
int mode = (attr & 1) ? 0444 : 0666; int mode = (attr & 1) ? 0444 : 0666;
dprintf_info(file, "_lcreat16: %s %02x\n", path, attr ); TRACE(file, "%s %02x\n", path, attr );
return (HFILE16)FILE_Create( path, mode, FALSE ); return (HFILE16)FILE_Create( path, mode, FALSE );
} }
@ -965,7 +965,7 @@ HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr ) HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr )
{ {
int mode = (attr & 1) ? 0444 : 0666; int mode = (attr & 1) ? 0444 : 0666;
dprintf_info(file, "_lcreat32: %s %02x\n", path, attr ); TRACE(file, "%s %02x\n", path, attr );
return FILE_Create( path, mode, FALSE ); return FILE_Create( path, mode, FALSE );
} }
@ -976,7 +976,7 @@ HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr )
HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr ) HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr )
{ {
int mode = (attr & 1) ? 0444 : 0666; int mode = (attr & 1) ? 0444 : 0666;
dprintf_info(file, "_lcreat_uniq: %s %02x\n", path, attr ); TRACE(file, "%s %02x\n", path, attr );
return FILE_Create( path, mode, TRUE ); return FILE_Create( path, mode, TRUE );
} }
@ -996,7 +996,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
return 0xffffffff; return 0xffffffff;
} }
dprintf_info(file, "SetFilePointer: handle %d offset %ld origin %ld\n", TRACE(file, "handle %d offset %ld origin %ld\n",
hFile, distance, method ); hFile, distance, method );
if (!(file = FILE_GetFile( hFile ))) return 0xffffffff; if (!(file = FILE_GetFile( hFile ))) return 0xffffffff;
@ -1048,7 +1048,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode )
{ {
INT32 unixMode; INT32 unixMode;
dprintf_info(file, "_lopen32('%s',%04x)\n", path, mode ); TRACE(file, "('%s',%04x)\n", path, mode );
switch(mode & 3) switch(mode & 3)
{ {
@ -1127,7 +1127,7 @@ LONG WINAPI _hwrite32( HFILE32 handle, LPCSTR buffer, LONG count )
DWORD result; DWORD result;
BOOL32 status = FALSE; BOOL32 status = FALSE;
dprintf_info(file, "_hwrite32: %d %p %ld\n", handle, buffer, count ); TRACE(file, "%d %p %ld\n", handle, buffer, count );
if (count == 0) { /* Expand or truncate at current position */ if (count == 0) { /* Expand or truncate at current position */
FILE_OBJECT *file = FILE_GetFile(handle); FILE_OBJECT *file = FILE_GetFile(handle);
@ -1162,7 +1162,7 @@ UINT16 WINAPI SetHandleCount16( UINT16 count )
PDB *pdb = (PDB *)GlobalLock16( hPDB ); PDB *pdb = (PDB *)GlobalLock16( hPDB );
BYTE *files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr ); BYTE *files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
dprintf_info(file, "SetHandleCount16(%d)\n", count ); TRACE(file, "(%d)\n", count );
if (count < 20) count = 20; /* No point in going below 20 */ if (count < 20) count = 20; /* No point in going below 20 */
else if (count > 254) count = 254; else if (count > 254) count = 254;
@ -1222,7 +1222,7 @@ BOOL32 WINAPI FlushFileBuffers( HFILE32 hFile )
FILE_OBJECT *file; FILE_OBJECT *file;
BOOL32 ret; BOOL32 ret;
dprintf_info(file, "FlushFileBuffers(%d)\n", hFile ); TRACE(file, "(%d)\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return FALSE; if (!(file = FILE_GetFile( hFile ))) return FALSE;
if (fsync( file->unix_handle ) != -1) ret = TRUE; if (fsync( file->unix_handle ) != -1) ret = TRUE;
else else
@ -1243,7 +1243,7 @@ BOOL32 WINAPI SetEndOfFile( HFILE32 hFile )
FILE_OBJECT *file; FILE_OBJECT *file;
BOOL32 ret = TRUE; BOOL32 ret = TRUE;
dprintf_info(file, "SetEndOfFile(%d)\n", hFile ); TRACE(file, "(%d)\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return FALSE; if (!(file = FILE_GetFile( hFile ))) return FALSE;
if (ftruncate( file->unix_handle, if (ftruncate( file->unix_handle,
lseek( file->unix_handle, 0, SEEK_CUR ) )) lseek( file->unix_handle, 0, SEEK_CUR ) ))
@ -1272,7 +1272,7 @@ BOOL32 WINAPI DeleteFile32A( LPCSTR path )
{ {
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
dprintf_info(file, "DeleteFile: '%s'\n", path ); TRACE(file, "'%s'\n", path );
if (DOSFS_IsDevice( path )) if (DOSFS_IsDevice( path ))
{ {
@ -1445,7 +1445,7 @@ BOOL32 WINAPI MoveFileEx32A( LPCSTR fn1, LPCSTR fn2, DWORD flag )
DOS_FULL_NAME full_name1, full_name2; DOS_FULL_NAME full_name1, full_name2;
int mode=0; /* mode == 1: use copy */ int mode=0; /* mode == 1: use copy */
dprintf_info(file, "MoveFileEx32A(%s,%s,%04lx)\n", fn1, fn2, flag); TRACE(file, "(%s,%s,%04lx)\n", fn1, fn2, flag);
if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE; if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE;
if (fn2) { /* !fn2 means delete fn1 */ if (fn2) { /* !fn2 means delete fn1 */
@ -1545,7 +1545,7 @@ BOOL32 WINAPI MoveFile32A( LPCSTR fn1, LPCSTR fn2 )
DOS_FULL_NAME full_name1, full_name2; DOS_FULL_NAME full_name1, full_name2;
struct stat fstat; struct stat fstat;
dprintf_info(file, "MoveFile32A(%s,%s)\n", fn1, fn2 ); TRACE(file, "(%s,%s)\n", fn1, fn2 );
if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE; if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE;
if (DOSFS_GetFullName( fn2, TRUE, &full_name2 )) if (DOSFS_GetFullName( fn2, TRUE, &full_name2 ))
@ -1563,7 +1563,7 @@ BOOL32 WINAPI MoveFile32A( LPCSTR fn1, LPCSTR fn2 )
else /*copy */ { else /*copy */ {
if (stat( full_name1.long_name, &fstat )) if (stat( full_name1.long_name, &fstat ))
{ {
dprintf_warn(file, "Invalid source file %s\n", WARN(file, "Invalid source file %s\n",
full_name1.long_name); full_name1.long_name);
FILE_SetDosError(); FILE_SetDosError();
return FALSE; return FALSE;
@ -1664,7 +1664,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile,
struct utimbuf utimbuf; struct utimbuf utimbuf;
if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */ if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */
dprintf_info(file,"SetFileTime(%s,%p,%p,%p)\n", TRACE(file,"(%s,%p,%p,%p)\n",
file->unix_name, file->unix_name,
lpCreationTime, lpCreationTime,
lpLastAccessTime, lpLastAccessTime,
@ -1781,12 +1781,12 @@ BOOL32 WINAPI LockFile(
struct flock f; struct flock f;
FILE_OBJECT *file; FILE_OBJECT *file;
dprintf_info(file, "LockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n", TRACE(file, "handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
hFile, dwFileOffsetLow, dwFileOffsetHigh, hFile, dwFileOffsetLow, dwFileOffsetHigh,
nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh); nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh);
if (dwFileOffsetHigh || nNumberOfBytesToLockHigh) { if (dwFileOffsetHigh || nNumberOfBytesToLockHigh) {
dprintf_fixme(file, "LockFile32: Unimplemented bytes > 32bits\n"); FIXME(file, "Unimplemented bytes > 32bits\n");
return FALSE; return FALSE;
} }
@ -1832,12 +1832,12 @@ BOOL32 WINAPI UnlockFile(
FILE_OBJECT *file; FILE_OBJECT *file;
struct flock f; struct flock f;
dprintf_info(file, "UnlockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n", TRACE(file, "handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n",
hFile, dwFileOffsetLow, dwFileOffsetHigh, hFile, dwFileOffsetLow, dwFileOffsetHigh,
nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh); nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh);
if (dwFileOffsetHigh || nNumberOfBytesToUnlockHigh) { if (dwFileOffsetHigh || nNumberOfBytesToUnlockHigh) {
dprintf_warn(file, "UnlockFile32: Unimplemented bytes > 32bits\n"); WARN(file, "Unimplemented bytes > 32bits\n");
return FALSE; return FALSE;
} }

View File

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

View File

@ -17,7 +17,7 @@ BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top,
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pPatBlt) return FALSE; if (!dc || !dc->funcs->pPatBlt) return FALSE;
dprintf_info(bitblt, "PatBlt16: %04x %d,%d %dx%d %06lx\n", TRACE(bitblt, "%04x %d,%d %dx%d %06lx\n",
hdc, left, top, width, height, rop ); hdc, left, top, width, height, rop );
return dc->funcs->pPatBlt( dc, left, top, width, height, rop ); return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
} }
@ -32,7 +32,7 @@ BOOL32 WINAPI PatBlt32( HDC32 hdc, INT32 left, INT32 top,
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pPatBlt) return FALSE; if (!dc || !dc->funcs->pPatBlt) return FALSE;
dprintf_info(bitblt, "PatBlt32: %04x %d,%d %dx%d %06lx\n", TRACE(bitblt, "%04x %d,%d %dx%d %06lx\n",
hdc, left, top, width, height, rop ); hdc, left, top, width, height, rop );
return dc->funcs->pPatBlt( dc, left, top, width, height, rop ); return dc->funcs->pPatBlt( dc, left, top, width, height, rop );
} }
@ -51,8 +51,7 @@ BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width,
if (!dcDst->funcs->pBitBlt) return FALSE; if (!dcDst->funcs->pBitBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc ); dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_info(bitblt, TRACE(bitblt, "hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
"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, hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop); hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height, return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
@ -73,8 +72,7 @@ BOOL32 WINAPI BitBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst, INT32 width,
if (!dcDst->funcs->pBitBlt) return FALSE; if (!dcDst->funcs->pBitBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc ); dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_info(bitblt, TRACE(bitblt, "hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n",
"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, hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0,
hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop); hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop);
return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height, return dcDst->funcs->pBitBlt( dcDst, xDst, yDst, width, height,
@ -96,8 +94,7 @@ BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst,
if (!dcDst->funcs->pStretchBlt) return FALSE; if (!dcDst->funcs->pStretchBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc ); dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_info(bitblt, TRACE(bitblt, "%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
"StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, widthSrc, heightSrc, hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst, dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
widthDst, heightDst, dcDst->w.bitsPerPixel, rop ); widthDst, heightDst, dcDst->w.bitsPerPixel, rop );
@ -121,8 +118,7 @@ BOOL32 WINAPI StretchBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst,
if (!dcDst->funcs->pStretchBlt) return FALSE; if (!dcDst->funcs->pStretchBlt) return FALSE;
dcSrc = DC_GetDCPtr( hdcSrc ); dcSrc = DC_GetDCPtr( hdcSrc );
dprintf_info(bitblt, TRACE(bitblt, "%04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
"StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n",
hdcSrc, xSrc, ySrc, widthSrc, heightSrc, hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst, dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst,
widthDst, heightDst, dcDst->w.bitsPerPixel, rop ); widthDst, heightDst, dcDst->w.bitsPerPixel, rop );

View File

@ -336,14 +336,14 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) {
static HRESULT WINAPI IDirectDrawSurface_Lock( static HRESULT WINAPI IDirectDrawSurface_Lock(
LPDIRECTDRAWSURFACE this,LPRECT32 lprect,LPDDSURFACEDESC lpddsd,DWORD flags, HANDLE32 hnd LPDIRECTDRAWSURFACE this,LPRECT32 lprect,LPDDSURFACEDESC lpddsd,DWORD flags, HANDLE32 hnd
) { ) {
dprintf_info(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n", TRACE(ddraw, "(%p)->Lock(%p,%p,%08lx,%08lx)\n",
this,lprect,lpddsd,flags,(DWORD)hnd); this,lprect,lpddsd,flags,(DWORD)hnd);
if (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY)) if (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY))
dprintf_warn(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n", WARN(ddraw, "(%p)->Lock(%p,%p,%08lx,%08lx)\n",
this,lprect,lpddsd,flags,(DWORD)hnd); this,lprect,lpddsd,flags,(DWORD)hnd);
if (lprect) { if (lprect) {
dprintf_info(ddraw," lprect: %dx%d-%dx%d\n", TRACE(ddraw," lprect: %dx%d-%dx%d\n",
lprect->top,lprect->left,lprect->bottom,lprect->right lprect->top,lprect->left,lprect->bottom,lprect->right
); );
lpddsd->y.lpSurface = this->s.surface+ lpddsd->y.lpSurface = this->s.surface+
@ -362,14 +362,14 @@ static HRESULT WINAPI IDirectDrawSurface_Lock(
static HRESULT WINAPI IDirectDrawSurface_Unlock( static HRESULT WINAPI IDirectDrawSurface_Unlock(
LPDIRECTDRAWSURFACE this,LPVOID surface LPDIRECTDRAWSURFACE this,LPVOID surface
) { ) {
dprintf_info(ddraw,"IDirectDrawSurface(%p)->Unlock(%p)\n",this,surface); TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface);
return 0; return 0;
} }
static HRESULT WINAPI IDirectDrawSurface_Flip( static HRESULT WINAPI IDirectDrawSurface_Flip(
LPDIRECTDRAWSURFACE this,LPDIRECTDRAWSURFACE flipto,DWORD dwFlags LPDIRECTDRAWSURFACE this,LPDIRECTDRAWSURFACE flipto,DWORD dwFlags
) { ) {
dprintf_info(ddraw,"IDirectDrawSurface(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags); TRACE(ddraw,"(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags);
if (!flipto) { if (!flipto) {
if (this->s.backbuffer) if (this->s.backbuffer)
flipto = this->s.backbuffer; flipto = this->s.backbuffer;
@ -399,7 +399,7 @@ static HRESULT WINAPI IDirectDrawSurface_Flip(
static HRESULT WINAPI IDirectDrawSurface_SetPalette( static HRESULT WINAPI IDirectDrawSurface_SetPalette(
LPDIRECTDRAWSURFACE this,LPDIRECTDRAWPALETTE pal LPDIRECTDRAWSURFACE this,LPDIRECTDRAWPALETTE pal
) { ) {
dprintf_info(ddraw,"IDirectDrawSurface(%p)->SetPalette(%p)\n",this,pal); TRACE(ddraw,"(%p)->SetPalette(%p)\n",this,pal);
this->s.palette = pal; /* probably addref it too */ this->s.palette = pal; /* probably addref it too */
return 0; return 0;
} }
@ -475,7 +475,7 @@ static HRESULT WINAPI IDirectDrawSurface_BltFast(
LPDIRECTDRAWSURFACE this,DWORD dstx,DWORD dsty,LPDIRECTDRAWSURFACE src,LPRECT32 rsrc,DWORD trans LPDIRECTDRAWSURFACE this,DWORD dstx,DWORD dsty,LPDIRECTDRAWSURFACE src,LPRECT32 rsrc,DWORD trans
) { ) {
int i,bpp; int i,bpp;
if (debugging_info(ddraw)) { if (TRACE_ON(ddraw)) {
fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n", fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n",
this,dstx,dsty,src,rsrc,trans this,dstx,dsty,src,rsrc,trans
); );
@ -504,7 +504,7 @@ static HRESULT WINAPI IDirectDrawSurface_BltBatch(
static HRESULT WINAPI IDirectDrawSurface_GetCaps( static HRESULT WINAPI IDirectDrawSurface_GetCaps(
LPDIRECTDRAWSURFACE this,LPDDSCAPS caps LPDIRECTDRAWSURFACE this,LPDDSCAPS caps
) { ) {
dprintf_info(ddraw,"IDirectDrawSurface(%p)->GetCaps(%p)\n",this,caps); TRACE(ddraw,"(%p)->GetCaps(%p)\n",this,caps);
caps->dwCaps = DDCAPS_PALETTE; /* probably more */ caps->dwCaps = DDCAPS_PALETTE; /* probably more */
return 0; return 0;
} }
@ -512,8 +512,8 @@ static HRESULT WINAPI IDirectDrawSurface_GetCaps(
static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc( static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc(
LPDIRECTDRAWSURFACE this,LPDDSURFACEDESC ddsd LPDIRECTDRAWSURFACE this,LPDDSURFACEDESC ddsd
) { ) {
if (debugging_info(ddraw)) { if (TRACE_ON(ddraw)) {
dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetSurfaceDesc(%p)\n", TRACE(ddraw, "(%p)->GetSurfaceDesc(%p)\n",
this,ddsd); this,ddsd);
fprintf(stderr," flags: "); fprintf(stderr," flags: ");
_dump_DDSD(ddsd->dwFlags); _dump_DDSD(ddsd->dwFlags);
@ -534,12 +534,12 @@ static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc(
} }
static ULONG WINAPI IDirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE this) { static ULONG WINAPI IDirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE this) {
dprintf_info(ddraw,"IDirectDrawSurface(%p)->AddRef()\n",this); TRACE(ddraw,"(%p)->AddRef()\n",this);
return ++(this->ref); return ++(this->ref);
} }
static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) { static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) {
dprintf_info(ddraw,"IDirectDrawSurface(%p)->Release()\n",this); TRACE(ddraw,"(%p)->Release()\n",this);
if (!--(this->ref)) { if (!--(this->ref)) {
this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw); this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
/* clear out of surface list */ /* clear out of surface list */
@ -557,9 +557,9 @@ static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) {
static HRESULT WINAPI IDirectDrawSurface_GetAttachedSurface( static HRESULT WINAPI IDirectDrawSurface_GetAttachedSurface(
LPDIRECTDRAWSURFACE this,LPDDSCAPS lpddsd,LPDIRECTDRAWSURFACE *lpdsf LPDIRECTDRAWSURFACE this,LPDDSCAPS lpddsd,LPDIRECTDRAWSURFACE *lpdsf
) { ) {
dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetAttachedSurface(%p,%p)\n", TRACE(ddraw, "(%p)->GetAttachedSurface(%p,%p)\n",
this, lpddsd, lpdsf); this, lpddsd, lpdsf);
if (debugging_info(ddraw)) { if (TRACE_ON(ddraw)) {
fprintf(stderr," caps "); fprintf(stderr," caps ");
_dump_DDSCAPS(lpddsd->dwCaps); _dump_DDSCAPS(lpddsd->dwCaps);
fprintf(stderr,"\n"); fprintf(stderr,"\n");
@ -625,7 +625,7 @@ static HRESULT WINAPI IDirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE this
char xrefiid[50]; char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
dprintf_info(ddraw,"IDirectDrawSurface(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); TRACE(ddraw,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
/* thats version 3 (DirectX 5) */ /* thats version 3 (DirectX 5) */
if ( !memcmp(&IID_IDirectDrawSurface3,refiid,sizeof(IID_IDirectDrawSurface3))) { if ( !memcmp(&IID_IDirectDrawSurface3,refiid,sizeof(IID_IDirectDrawSurface3))) {
@ -708,7 +708,7 @@ static HRESULT WINAPI IDirectDrawSurface2_Lock(
static HRESULT WINAPI IDirectDrawSurface2_Unlock( static HRESULT WINAPI IDirectDrawSurface2_Unlock(
LPDIRECTDRAWSURFACE2 this,LPVOID surface LPDIRECTDRAWSURFACE2 this,LPVOID surface
) { ) {
dprintf_info(ddraw,"IDirectDrawSurface2(%p)->Unlock(%p)\n",this,surface); TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface);
return 0; return 0;
} }
@ -719,7 +719,7 @@ static HRESULT WINAPI IDirectDrawSurface2_SetPalette(
} }
static ULONG WINAPI IDirectDrawSurface2_AddRef(LPDIRECTDRAWSURFACE2 this) { static ULONG WINAPI IDirectDrawSurface2_AddRef(LPDIRECTDRAWSURFACE2 this) {
dprintf_info(ddraw,"IDirectDrawSurface2(%p)->AddRef()\n",this); TRACE(ddraw,"(%p)->AddRef()\n",this);
return ++(this->ref); return ++(this->ref);
} }
@ -821,12 +821,12 @@ static HRESULT WINAPI IDirectDrawSurface3_GetAttachedSurface(
} }
static ULONG WINAPI IDirectDrawSurface3_AddRef(LPDIRECTDRAWSURFACE3 this) { static ULONG WINAPI IDirectDrawSurface3_AddRef(LPDIRECTDRAWSURFACE3 this) {
dprintf_info(ddraw,"IDirectDrawSurface3(%p)->AddRef()\n",this); TRACE(ddraw,"(%p)->AddRef()\n",this);
return ++(this->ref); return ++(this->ref);
} }
static ULONG WINAPI IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) { static ULONG WINAPI IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) {
dprintf_info(ddraw,"IDirectDrawSurface3(%p)->Release()\n",this); TRACE(ddraw,"(%p)->Release()\n",this);
if (!--(this->ref)) { if (!--(this->ref)) {
this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw); this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw);
this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height)); this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height));
@ -991,7 +991,7 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries(
XColor xc; XColor xc;
int i; int i;
dprintf_info(ddraw,"IDirectDrawPalette(%p)->SetEntries(%08lx,%ld,%ld,%p)\n", TRACE(ddraw,"(%p)->SetEntries(%08lx,%ld,%ld,%p)\n",
this,x,start,end,palent this,x,start,end,palent
); );
if (!this->cm) /* should not happen */ { if (!this->cm) /* should not happen */ {
@ -1123,9 +1123,9 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
) { ) {
int i; int i;
dprintf_info(ddraw, "IDirectDraw(%p)->CreateSurface(%p,%p,%p)\n", TRACE(ddraw, "(%p)->CreateSurface(%p,%p,%p)\n",
this,lpddsd,lpdsf,lpunk); this,lpddsd,lpdsf,lpunk);
if (debugging_info(ddraw)) { if (TRACE_ON(ddraw)) {
fprintf(stderr,"[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight); fprintf(stderr,"[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight);
_dump_DDSD(lpddsd->dwFlags); _dump_DDSD(lpddsd->dwFlags);
fprintf(stderr,"caps "); fprintf(stderr,"caps ");
@ -1147,12 +1147,12 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
(*lpdsf)->s.surface = (LPBYTE)HeapAlloc(GetProcessHeap(),0,lpddsd->dwWidth*lpddsd->dwHeight*this->d.depth/8); (*lpdsf)->s.surface = (LPBYTE)HeapAlloc(GetProcessHeap(),0,lpddsd->dwWidth*lpddsd->dwHeight*this->d.depth/8);
(*lpdsf)->s.fb_height = -1; (*lpdsf)->s.fb_height = -1;
(*lpdsf)->s.lpitch = lpddsd->dwWidth*this->d.depth/8; (*lpdsf)->s.lpitch = lpddsd->dwWidth*this->d.depth/8;
dprintf_info(ddraw,"using system memory for a primary surface\n"); TRACE(ddraw,"using system memory for a primary surface\n");
} else { } else {
for (i=0;i<32;i++) for (i=0;i<32;i++)
if (!(this->d.vpmask & (1<<i))) if (!(this->d.vpmask & (1<<i)))
break; break;
dprintf_info(ddraw,"using viewport %d for a primary surface\n",i); TRACE(ddraw,"using viewport %d for a primary surface\n",i);
/* if i == 32 or maximum ... return error */ /* if i == 32 or maximum ... return error */
this->d.vpmask|=(1<<i); this->d.vpmask|=(1<<i);
(*lpdsf)->s.surface = this->d.fb_addr+((i*this->d.fb_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);
@ -1179,7 +1179,7 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
for (i=0;i<32;i++) for (i=0;i<32;i++)
if (!(this->d.vpmask & (1<<i))) if (!(this->d.vpmask & (1<<i)))
break; break;
dprintf_info(ddraw,"using viewport %d for backbuffer\n",i); TRACE(ddraw,"using viewport %d for backbuffer\n",i);
/* if i == 32 or maximum ... return error */ /* if i == 32 or maximum ... return error */
this->d.vpmask|=(1<<i); this->d.vpmask|=(1<<i);
back->s.surface = this->d.fb_addr+((i*this->d.fb_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);
@ -1198,7 +1198,7 @@ static HRESULT WINAPI IDirectDraw_CreateSurface(
static HRESULT WINAPI IDirectDraw_DuplicateSurface( static HRESULT WINAPI IDirectDraw_DuplicateSurface(
LPDIRECTDRAW this,LPDIRECTDRAWSURFACE src,LPDIRECTDRAWSURFACE *dst LPDIRECTDRAW this,LPDIRECTDRAWSURFACE src,LPDIRECTDRAWSURFACE *dst
) { ) {
fprintf(stderr,"IDirectDraw(%p)->DuplicateSurface(%p,%p)\n",this,src,dst); fprintf(stderr,"(%p)->DuplicateSurface(%p,%p)\n",this,src,dst);
*dst = src; /* FIXME */ *dst = src; /* FIXME */
return 0; return 0;
} }
@ -1222,15 +1222,15 @@ static HRESULT WINAPI IDirectDraw_SetCooperativeLevel(
FE(DDSCL_CREATEDEVICEWINDOW) FE(DDSCL_CREATEDEVICEWINDOW)
}; };
dprintf_info(ddraw,"IDirectDraw(%p)->SetCooperativeLevel(%08lx,%08lx)\n", TRACE(ddraw,"(%p)->SetCooperativeLevel(%08lx,%08lx)\n",
this,(DWORD)hwnd,cooplevel this,(DWORD)hwnd,cooplevel
); );
if(debugging_info(ddraw)){ if(TRACE_ON(ddraw)){
dbg_decl_str(ddraw, 512); dbg_decl_str(ddraw, 512);
for (i=0;i<sizeof(flagmap)/sizeof(flagmap[0]);i++) for (i=0;i<sizeof(flagmap)/sizeof(flagmap[0]);i++)
if (flagmap[i].mask & cooplevel) if (flagmap[i].mask & cooplevel)
dsprintf(ddraw, "%s ", flagmap[i].name); dsprintf(ddraw, "%s ", flagmap[i].name);
dprintf_info(ddraw," cooperative level %s\n", dbg_str(ddraw)); TRACE(ddraw," cooperative level %s\n", dbg_str(ddraw));
} }
this->d.mainwindow = hwnd; this->d.mainwindow = hwnd;
return 0; return 0;
@ -1243,7 +1243,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
int i,*depths,depcount; int i,*depths,depcount;
char buf[200]; char buf[200];
dprintf_fixme(ddraw, "IDirectDraw(%p)->SetDisplayMode(%ld,%ld,%ld),stub!\n", TRACE(ddraw, "(%p)->SetDisplayMode(%ld,%ld,%ld)\n",
this, width, height, depth); this, width, height, depth);
depths = TSXListDepths(display,DefaultScreen(display),&depcount); depths = TSXListDepths(display,DefaultScreen(display),&depcount);
@ -1273,7 +1273,10 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
* it works for the library too? * it works for the library too?
*/ */
XF86DGADirectVideo(display,DefaultScreen(display),XF86DGADirectGraphics); XF86DGADirectVideo(display,DefaultScreen(display),XF86DGADirectGraphics);
/*
XF86DGASetViewPort(display,DefaultScreen(display),0,this->d.fb_height); XF86DGASetViewPort(display,DefaultScreen(display),0,this->d.fb_height);
*/
#ifdef RESTORE_SIGNALS #ifdef RESTORE_SIGNALS
SIGNAL_InitEmulator(); SIGNAL_InitEmulator();
#endif #endif
@ -1283,7 +1286,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode(
static HRESULT WINAPI IDirectDraw_GetCaps( static HRESULT WINAPI IDirectDraw_GetCaps(
LPDIRECTDRAW this,LPDDCAPS caps1,LPDDCAPS caps2 LPDIRECTDRAW this,LPDDCAPS caps1,LPDDCAPS caps2
) { ) {
dprintf_info(ddraw,"IDirectDraw(%p)->GetCaps(%p,%p)\n",this,caps1,caps2); TRACE(ddraw,"(%p)->GetCaps(%p,%p)\n",this,caps1,caps2);
caps1->dwVidMemTotal = this->d.fb_memsize; caps1->dwVidMemTotal = this->d.fb_memsize;
caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED); /* we can do anything */ caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED); /* we can do anything */
caps1->ddsCaps.dwCaps = 0xffffffff; /* we can do anything */ caps1->ddsCaps.dwCaps = 0xffffffff; /* we can do anything */
@ -1298,7 +1301,7 @@ static HRESULT WINAPI IDirectDraw_GetCaps(
static HRESULT WINAPI IDirectDraw_CreateClipper( static HRESULT WINAPI IDirectDraw_CreateClipper(
LPDIRECTDRAW this,DWORD x,LPDIRECTDRAWCLIPPER *lpddclip,LPUNKNOWN lpunk LPDIRECTDRAW this,DWORD x,LPDIRECTDRAWCLIPPER *lpddclip,LPUNKNOWN lpunk
) { ) {
fprintf(stderr,"IDirectDraw(%p)->CreateClipper(%08lx,%p,%p),stub!\n", fprintf(stderr,"(%p)->CreateClipper(%08lx,%p,%p),stub!\n",
this,x,lpddclip,lpunk this,x,lpddclip,lpunk
); );
*lpddclip = (LPDIRECTDRAWCLIPPER)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawClipper)); *lpddclip = (LPDIRECTDRAWCLIPPER)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawClipper));
@ -1310,7 +1313,7 @@ static HRESULT WINAPI IDirectDraw_CreateClipper(
static HRESULT WINAPI IDirectDraw_CreatePalette( static HRESULT WINAPI IDirectDraw_CreatePalette(
LPDIRECTDRAW this,DWORD x,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk LPDIRECTDRAW this,DWORD x,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk
) { ) {
dprintf_info(ddraw,"IDirectDraw(%p)->CreatePalette(%08lx,%p,%p,%p)\n", TRACE(ddraw,"(%p)->CreatePalette(%08lx,%p,%p,%p)\n",
this,x,palent,lpddpal,lpunk this,x,palent,lpddpal,lpunk
); );
*lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette)); *lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette));
@ -1326,7 +1329,7 @@ static HRESULT WINAPI IDirectDraw_CreatePalette(
} }
static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) { static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
dprintf_fixme(ddraw, "IDirectDraw(%p)->RestoreDisplayMode(),stub!\n", TRACE(ddraw, "(%p)->RestoreDisplayMode()\n",
this); this);
Sleep(1000); Sleep(1000);
XF86DGADirectVideo(display,DefaultScreen(display),0); XF86DGADirectVideo(display,DefaultScreen(display),0);
@ -1340,7 +1343,7 @@ static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) {
static HRESULT WINAPI IDirectDraw_WaitForVerticalBlank( static HRESULT WINAPI IDirectDraw_WaitForVerticalBlank(
LPDIRECTDRAW this,DWORD x,HANDLE32 h LPDIRECTDRAW this,DWORD x,HANDLE32 h
) { ) {
dprintf_info(ddraw,"IDirectDraw(%p)->WaitForVerticalBlank(0x%08lx,0x%08x),stub!\n",this,x,h); TRACE(ddraw,"(%p)->WaitForVerticalBlank(0x%08lx,0x%08x)\n",this,x,h);
return 0; return 0;
} }
@ -1366,7 +1369,7 @@ static HRESULT WINAPI IDirectDraw_QueryInterface(
char xrefiid[50]; char xrefiid[50];
WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); WINE_StringFromCLSID((LPCLSID)refiid,xrefiid);
dprintf_info(ddraw,"IDirectDraw(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); TRACE(ddraw,"(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj);
if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) {
*obj = this; *obj = this;
this->lpvtbl->fnAddRef(this); this->lpvtbl->fnAddRef(this);
@ -1405,14 +1408,14 @@ static HRESULT WINAPI IDirectDraw_QueryInterface(
*obj = d3d; *obj = d3d;
return 0; return 0;
} }
fprintf(stderr,"IDirectDraw(%p):interface for IID %s _NOT_ found!\n",this,xrefiid); fprintf(stderr,"(%p):interface for IID %s _NOT_ found!\n",this,xrefiid);
return OLE_E_ENUM_NOMORE; return OLE_E_ENUM_NOMORE;
} }
static HRESULT WINAPI IDirectDraw_GetVerticalBlankStatus( static HRESULT WINAPI IDirectDraw_GetVerticalBlankStatus(
LPDIRECTDRAW this,BOOL32 *status LPDIRECTDRAW this,BOOL32 *status
) { ) {
dprintf_info(ddraw,"IDirectDraw(%p)->GetVerticalBlankSatus(%p)\n",this,status); TRACE(ddraw,"(%p)->GetVerticalBlankSatus(%p)\n",this,status);
*status = TRUE; *status = TRUE;
return 0; return 0;
} }
@ -1422,7 +1425,7 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes(
) { ) {
DDSURFACEDESC ddsfd; DDSURFACEDESC ddsfd;
dprintf_info(ddraw,"IDirectDraw(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb); TRACE(ddraw,"(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb);
_getpixelformat(this,&(ddsfd.ddpfPixelFormat)); _getpixelformat(this,&(ddsfd.ddpfPixelFormat));
@ -1457,7 +1460,7 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes(
static HRESULT WINAPI IDirectDraw_GetDisplayMode( static HRESULT WINAPI IDirectDraw_GetDisplayMode(
LPDIRECTDRAW this,LPDDSURFACEDESC lpddsfd LPDIRECTDRAW this,LPDDSURFACEDESC lpddsfd
) { ) {
dprintf_info(ddraw,"IDirectDraw(%p)->GetDisplayMode(%p)\n",this,lpddsfd); TRACE(ddraw,"(%p)->GetDisplayMode(%p)\n",this,lpddsfd);
lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS; lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS;
lpddsfd->dwHeight = screenHeight; lpddsfd->dwHeight = screenHeight;
lpddsfd->dwWidth = screenWidth; lpddsfd->dwWidth = screenWidth;
@ -1470,14 +1473,14 @@ static HRESULT WINAPI IDirectDraw_GetDisplayMode(
} }
static HRESULT WINAPI IDirectDraw_FlipToGDISurface(LPDIRECTDRAW this) { static HRESULT WINAPI IDirectDraw_FlipToGDISurface(LPDIRECTDRAW this) {
fprintf(stderr,"IDirectDraw(%p)->FlipToGDISurface(),stub!\n",this); fprintf(stderr,"(%p)->FlipToGDISurface()\n",this);
return DD_OK; return DD_OK;
} }
static HRESULT WINAPI IDirectDraw_GetMonitorFrequency( static HRESULT WINAPI IDirectDraw_GetMonitorFrequency(
LPDIRECTDRAW this,LPDWORD freq LPDIRECTDRAW this,LPDWORD freq
) { ) {
fprintf(stderr,"IDirectDraw(%p)->GetMonitorFrequency(%p)\n",this,freq); fprintf(stderr,"(%p)->GetMonitorFrequency(%p)\n",this,freq);
*freq = 60*100; /* 60 Hz */ *freq = 60*100; /* 60 Hz */
return 0; return 0;
} }
@ -1560,7 +1563,7 @@ static HRESULT WINAPI IDirectDraw2_CreatePalette(
static HRESULT WINAPI IDirectDraw2_SetDisplayMode( static HRESULT WINAPI IDirectDraw2_SetDisplayMode(
LPDIRECTDRAW2 this,DWORD width,DWORD height,DWORD depth,DWORD xx,DWORD yy LPDIRECTDRAW2 this,DWORD width,DWORD height,DWORD depth,DWORD xx,DWORD yy
) { ) {
dprintf_fixme(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx),stub!\n", TRACE(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx)\n",
this, width, height, depth, xx, yy); this, width, height, depth, xx, yy);
return IDirectDraw_SetDisplayMode((LPDIRECTDRAW)this,width,height,depth); return IDirectDraw_SetDisplayMode((LPDIRECTDRAW)this,width,height,depth);
@ -1661,7 +1664,7 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
else else
strcpy(xclsid,"<null>"); strcpy(xclsid,"<null>");
dprintf_info(ddraw,"DirectDrawCreate(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter); TRACE(ddraw,"(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter);
if (getuid()) { if (getuid()) {
MessageBox32A(0,"Using the XF86DGA extension requires the program to be run using UID 0.","WINE DirectDraw",MB_OK|MB_ICONSTOP); MessageBox32A(0,"Using the XF86DGA extension requires the program to be run using UID 0.","WINE DirectDraw",MB_OK|MB_ICONSTOP);
return E_UNEXPECTED; return E_UNEXPECTED;
@ -1674,12 +1677,12 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
return 0; return 0;
} }
XF86DGAQueryVersion(display,&major,&minor); XF86DGAQueryVersion(display,&major,&minor);
dprintf_info(ddraw,"XF86DGA is version %d.%d\n",major,minor); TRACE(ddraw,"XF86DGA is version %d.%d\n",major,minor);
XF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags); XF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags);
if (!(flags & XF86DGADirectPresent)) if (!(flags & XF86DGADirectPresent))
fprintf(stderr,"direct video is NOT ENABLED.\n"); fprintf(stderr,"direct video is NOT ENABLED.\n");
XF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize); XF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize);
dprintf_info(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n", TRACE(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n",
addr,width,banksize,memsize addr,width,banksize,memsize
); );
(*lplpDD)->d.fb_width = width; (*lplpDD)->d.fb_width = width;
@ -1692,7 +1695,7 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
(*lplpDD)->d.vp_width = width; (*lplpDD)->d.vp_width = width;
(*lplpDD)->d.vp_height = height; (*lplpDD)->d.vp_height = height;
(*lplpDD)->d.fb_height = screenHeight; (*lplpDD)->d.fb_height = screenHeight;
(*lplpDD)->d.vpmask = 1; (*lplpDD)->d.vpmask = 0;
/* just assume the default depth is the DGA depth too */ /* just assume the default depth is the DGA depth too */
(*lplpDD)->d.depth = DefaultDepthOfScreen(screen); (*lplpDD)->d.depth = DefaultDepthOfScreen(screen);

View File

@ -163,7 +163,7 @@ INT32 WINAPI SetMapMode32( HDC32 hdc, INT32 mode )
if (!dc) return 0; if (!dc) return 0;
if (dc->funcs->pSetMapMode) return dc->funcs->pSetMapMode( dc, mode ); if (dc->funcs->pSetMapMode) return dc->funcs->pSetMapMode( dc, mode );
dprintf_info(gdi, "SetMapMode: %04x %d\n", hdc, mode ); TRACE(gdi, "%04x %d\n", hdc, mode );
prevMode = dc->w.MapMode; prevMode = dc->w.MapMode;
switch(mode) switch(mode)

View File

@ -150,7 +150,7 @@ HDC16 WINAPI CreateMetaFile16(
METAFILEDRV_PDEVICE *physDev; METAFILEDRV_PDEVICE *physDev;
HFILE32 hFile; HFILE32 hFile;
dprintf_info(metafile, "CreateMetaFile16: '%s'\n", filename ); TRACE(metafile, "'%s'\n", filename );
if (!(dc = MFDRV_AllocMetaFile())) return 0; if (!(dc = MFDRV_AllocMetaFile())) return 0;
physDev = (METAFILEDRV_PDEVICE *)dc->physDev; physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
@ -175,7 +175,7 @@ HDC16 WINAPI CreateMetaFile16(
else /* memory based metafile */ else /* memory based metafile */
physDev->mh->mtType = METAFILE_MEMORY; physDev->mh->mtType = METAFILE_MEMORY;
dprintf_info(metafile, "CreateMetaFile16: returning %04x\n", dc->hSelf); TRACE(metafile, "returning %04x\n", dc->hSelf);
return dc->hSelf; return dc->hSelf;
} }
@ -198,7 +198,7 @@ HMETAFILE16 WINAPI CloseMetaFile16(
HFILE32 hFile; HFILE32 hFile;
METAFILEDRV_PDEVICE *physDev; METAFILEDRV_PDEVICE *physDev;
dprintf_info(metafile, "CloseMetaFile(%04x)\n", hdc ); TRACE(metafile, "(%04x)\n", hdc );
if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0; if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0;
physDev = (METAFILEDRV_PDEVICE *)dc->physDev; physDev = (METAFILEDRV_PDEVICE *)dc->physDev;

View File

@ -85,7 +85,7 @@ HGDIOBJ32 MFDRV_SelectObject( DC *dc, HGDIOBJ32 handle )
HGDIOBJ32 ret = 0; HGDIOBJ32 ret = 0;
if (!ptr) return 0; if (!ptr) return 0;
dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic) switch(ptr->wMagic)
{ {

View File

@ -227,8 +227,7 @@ BOOL32 WINAPI CloseFigure32(HDC32 hdc)
INT16 WINAPI GetPath16(HDC16 hdc, LPPOINT16 pPoints, LPBYTE pTypes, INT16 WINAPI GetPath16(HDC16 hdc, LPPOINT16 pPoints, LPBYTE pTypes,
INT16 nSize) INT16 nSize)
{ {
/* FIXME: Not implemented */ FIXME(gdi, "Unimplemented stub\n");
fprintf(stdnimp, "GetPath16: Unimplemented stub\n");
return 0; return 0;
} }

View File

@ -25,7 +25,7 @@ HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
if ( physDev->BrushInfo ) if ( physDev->BrushInfo )
{ {
dprintf_info(win16drv, "UnRealizing BrushInfo\n"); TRACE(win16drv, "UnRealizing BrushInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH, nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
physDev->BrushInfo, physDev->BrushInfo,
physDev->BrushInfo, 0); physDev->BrushInfo, 0);

View File

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

View File

@ -60,9 +60,9 @@ WIN16DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
BOOL32 bRet = 0; BOOL32 bRet = 0;
POINT16 points[2]; POINT16 points[2];
dprintf_info(win16drv, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n", TRACE(win16drv, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n",
left, top, dc->w.DCOrgX, dc->w.DCOrgY); left, top, dc->w.DCOrgX, dc->w.DCOrgY);
dprintf_info(win16drv, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n", TRACE(win16drv, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY); dc->vportOrgX, dc->vportOrgY);
points[0].x = XLPTODP(dc, left); points[0].x = XLPTODP(dc, left);
points[0].y = YLPTODP(dc, top); points[0].y = YLPTODP(dc, top);
@ -152,9 +152,9 @@ WIN16DRV_Ellipse(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev; WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
BOOL32 bRet = 0; BOOL32 bRet = 0;
POINT16 points[2]; POINT16 points[2];
dprintf_info(win16drv, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n", TRACE(win16drv, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n",
left, top, dc->w.DCOrgX, dc->w.DCOrgY); left, top, dc->w.DCOrgX, dc->w.DCOrgY);
dprintf_info(win16drv, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n", TRACE(win16drv, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY); dc->vportOrgX, dc->vportOrgY);
points[0].x = XLPTODP(dc, left); points[0].x = XLPTODP(dc, left);
points[0].y = YLPTODP(dc, top); points[0].y = YLPTODP(dc, top);

View File

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

View File

@ -31,7 +31,7 @@ HGDIOBJ32 WIN16DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
HGDIOBJ32 ret = 0; HGDIOBJ32 ret = 0;
if (!ptr) return 0; if (!ptr) return 0;
dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic) switch(ptr->wMagic)
{ {

View File

@ -20,7 +20,7 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
int nSize; int nSize;
LOGPEN16 lPen16; LOGPEN16 lPen16;
dc->w.hPen = hpen; dc->w.hPen = hpen;
dprintf_info(win16drv, "In WIN16DRV_PEN_SelectObject\n"); TRACE(win16drv, "In WIN16DRV_PEN_SelectObject\n");
lPen16.lopnStyle = pen->logpen.lopnStyle; lPen16.lopnStyle = pen->logpen.lopnStyle;
lPen16.lopnWidth.x = pen->logpen.lopnWidth.x; lPen16.lopnWidth.x = pen->logpen.lopnWidth.x;
lPen16.lopnWidth.y = pen->logpen.lopnWidth.y; lPen16.lopnWidth.y = pen->logpen.lopnWidth.y;
@ -28,7 +28,7 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
if ( physDev->PenInfo ) if ( physDev->PenInfo )
{ {
dprintf_info(win16drv, "UnRealizing PenInfo\n"); TRACE(win16drv, "UnRealizing PenInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN, nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
physDev->PenInfo, physDev->PenInfo,
physDev->PenInfo, 0); physDev->PenInfo, 0);

View File

@ -55,7 +55,7 @@ static void GetPrinterDriverFunctions(HINSTANCE16 hInst, LOADED_PRINTER_DRIVER *
LoadPrinterDrvFunc(ADVANCEDSETUPDIALOG); LoadPrinterDrvFunc(ADVANCEDSETUPDIALOG);
LoadPrinterDrvFunc(DIALOGFN); LoadPrinterDrvFunc(DIALOGFN);
LoadPrinterDrvFunc(PSEUDOEDIT); LoadPrinterDrvFunc(PSEUDOEDIT);
dprintf_info(win16drv,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n", TRACE(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_CONTROL],
pLPD->fn[FUNC_ENABLE], pLPD->fn[FUNC_ENABLE],
pLPD->fn[FUNC_ENUMDFONTS], pLPD->fn[FUNC_ENUMDFONTS],
@ -78,7 +78,7 @@ static LOADED_PRINTER_DRIVER *FindPrinterDriverFromName(const char *pszDriver)
ptmpLPD = gapLoadedPrinterDrivers[nDriverSlot++]; ptmpLPD = gapLoadedPrinterDrivers[nDriverSlot++];
if (ptmpLPD != NULL) if (ptmpLPD != NULL)
{ {
dprintf_info(win16drv, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver); TRACE(win16drv, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver);
/* Found driver store info, exit loop */ /* Found driver store info, exit loop */
if (lstrcmpi32A(ptmpLPD->szDriver, pszDriver) == 0) if (lstrcmpi32A(ptmpLPD->szDriver, pszDriver) == 0)
pLPD = ptmpLPD; pLPD = ptmpLPD;
@ -150,7 +150,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
/* Failed to load driver */ /* Failed to load driver */
fprintf(stderr, "Failed to load printer driver %s\n", pszDriver); fprintf(stderr, "Failed to load printer driver %s\n", pszDriver);
} else { } else {
dprintf_info(win16drv, "Loaded the library\n"); TRACE(win16drv, "Loaded the library\n");
/* Allocate some memory for printer driver info */ /* Allocate some memory for printer driver info */
pLPD = malloc(sizeof(LOADED_PRINTER_DRIVER)); pLPD = malloc(sizeof(LOADED_PRINTER_DRIVER));
memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER)); memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER));
@ -161,7 +161,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
/* Get DS for the printer module */ /* Get DS for the printer module */
pLPD->ds_reg = hInst; pLPD->ds_reg = hInst;
dprintf_info(win16drv, "DS for %s is %x\n", pszDriver, pLPD->ds_reg); TRACE(win16drv, "DS for %s is %x\n", pszDriver, pLPD->ds_reg);
/* Get address of printer driver functions */ /* Get address of printer driver functions */
GetPrinterDriverFunctions(hInst, pLPD); GetPrinterDriverFunctions(hInst, pLPD);
@ -188,20 +188,20 @@ INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPT
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_Control: %08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData); TRACE(win16drv, "%08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData);
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{ {
if (pLPD->fn[FUNC_CONTROL] == NULL) if (pLPD->fn[FUNC_CONTROL] == NULL)
{ {
dprintf_warn(win16drv, "PRTDRV_Control: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
wRet = Callbacks->CallDrvControlProc( pLPD->fn[FUNC_CONTROL], wRet = Callbacks->CallDrvControlProc( pLPD->fn[FUNC_CONTROL],
(SEGPTR)lpDestDev, wfunction, (SEGPTR)lpDestDev, wfunction,
lpInData, lpOutData ); lpInData, lpOutData );
} }
dprintf_info(win16drv, "PRTDRV_Control: return %x\n", wRet); TRACE(win16drv, "return %x\n", wRet);
return wRet; return wRet;
} }
@ -214,7 +214,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_Enable: %s %s\n",lpDestDevType, lpOutputFile); TRACE(win16drv, "%s %s\n",lpDestDevType, lpOutputFile);
/* Get the printer driver info */ /* Get the printer driver info */
if (wStyle == INITPDEVICE) if (wStyle == INITPDEVICE)
@ -228,7 +228,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
WORD wP2; WORD wP2;
if (!pLPD->fn[FUNC_ENABLE]) { if (!pLPD->fn[FUNC_ENABLE]) {
dprintf_warn(win16drv, "PRTDRV_Enable: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
@ -259,7 +259,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
SEGPTR_FREE(lP1); SEGPTR_FREE(lP1);
} }
} }
dprintf_info(win16drv, "PRTDRV_Enable: return %x\n", wRet); TRACE(win16drv, "return %x\n", wRet);
return wRet; return wRet;
} }
@ -273,7 +273,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_EnumDFonts: %08lx %s %p %p\n", TRACE(win16drv, "%08lx %s %p %p\n",
lpDestDev, lpFaceName, lpCallbackFunc, lpClientData); lpDestDev, lpFaceName, lpCallbackFunc, lpClientData);
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
@ -282,7 +282,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
LPBYTE lP2; LPBYTE lP2;
if (pLPD->fn[FUNC_ENUMDFONTS] == NULL) { if (pLPD->fn[FUNC_ENUMDFONTS] == NULL) {
dprintf_warn(win16drv, "PRTDRV_EnumDFonts: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
@ -299,7 +299,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
} else } else
fprintf(stderr,"Failed to find device\n"); fprintf(stderr,"Failed to find device\n");
dprintf_info(win16drv, "PRTDRV_EnumDFonts: return %x\n", wRet); TRACE(win16drv, "return %x\n", wRet);
return wRet; return wRet;
} }
/* /*
@ -311,7 +311,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_EnumObj:\n"); TRACE(win16drv, "(some params - fixme)\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{ {
@ -321,7 +321,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
if (pLPD->fn[FUNC_ENUMOBJ] == NULL) if (pLPD->fn[FUNC_ENUMOBJ] == NULL)
{ {
dprintf_warn(win16drv, "PRTDRV_EnumObj: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
@ -342,7 +342,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle,
else else
fprintf(stderr,"Failed to find device\n"); fprintf(stderr,"Failed to find device\n");
dprintf_info(win16drv, "PRTDRV_EnumObj: return %x\n", wRet); TRACE(win16drv, "return %x\n", wRet);
return wRet; return wRet;
} }
@ -361,7 +361,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_OUTPUT %d\n", wStyle ); TRACE(win16drv, "PRTDRV_OUTPUT %d\n", wStyle );
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{ {
@ -372,7 +372,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
int nSize; int nSize;
if (pLPD->fn[FUNC_OUTPUT] == NULL) if (pLPD->fn[FUNC_OUTPUT] == NULL)
{ {
dprintf_warn(win16drv, "PRTDRV_Output: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
@ -415,7 +415,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
{ {
CONV_RECT32TO16( pRect, lP8 ); CONV_RECT32TO16( pRect, lP8 );
dprintf_info(win16drv, "rect = %d,%d - %d,%d\n", TRACE(win16drv, "rect = %d,%d - %d,%d\n",
lP8->left, lP8->top, lP8->right, lP8->bottom ); lP8->left, lP8->top, lP8->right, lP8->bottom );
wRet = Callbacks->CallDrvOutputProc(pLPD->fn[FUNC_OUTPUT], wRet = Callbacks->CallDrvOutputProc(pLPD->fn[FUNC_OUTPUT],
lP1, wP2, wP3, SEGPTR_GET(lP4), lP1, wP2, wP3, SEGPTR_GET(lP4),
@ -433,7 +433,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
} }
SEGPTR_FREE(lP4); SEGPTR_FREE(lP4);
} }
dprintf_info(win16drv, "PRTDRV_Output return %d\n", wRet); TRACE(win16drv, "PRTDRV_Output return %d\n", wRet);
return wRet; return wRet;
} }
@ -447,8 +447,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
WORD dwRet = 0; WORD dwRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, TRACE(win16drv, "%08lx %04x %p %p %08lx\n",
"PRTDRV_RealizeObject: %08lx %04x %p %p %08lx\n",
lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm); lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm);
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
@ -460,8 +459,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL) if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL)
{ {
dprintf_warn(win16drv, WARN(win16drv, "Not supported by driver\n");
"PRTDRV_RealizeObject: Not supported by driver\n");
return 0; return 0;
} }
@ -506,8 +504,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
lP4 = SEGPTR_GET( lpOutObj ); lP4 = SEGPTR_GET( lpOutObj );
lP5 = lpTextXForm; lP5 = lpTextXForm;
dprintf_info(win16drv, TRACE(win16drv, "Calling Realize %08lx %04x %08lx %08lx %08lx\n",
"Calling Realize %08lx %04x %08lx %08lx %08lx\n",
lP1, wP2, lP3, lP4, lP5); lP1, wP2, lP3, lP4, lP5);
dwRet = Callbacks->CallDrvRealizeProc(pLPD->fn[FUNC_REALIZEOBJECT], dwRet = Callbacks->CallDrvRealizeProc(pLPD->fn[FUNC_REALIZEOBJECT],
lP1, wP2, lP3, lP4, lP5); lP1, wP2, lP3, lP4, lP5);
@ -515,7 +512,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
SEGPTR_FREE(lpBuf); SEGPTR_FREE(lpBuf);
} }
dprintf_info(win16drv, "PRTDRV_RealizeObject: return %x\n", dwRet); TRACE(win16drv, "return %x\n", dwRet);
return dwRet; return dwRet;
} }
@ -536,7 +533,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_StretchBlt:\n"); TRACE(win16drv, "(lots of params - fixme)\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{ {
@ -546,7 +543,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
if (pLPD->fn[FUNC_STRETCHBLT] == NULL) if (pLPD->fn[FUNC_STRETCHBLT] == NULL)
{ {
dprintf_warn(win16drv, "PRTDRV_StretchBlt: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
lP1 = lpDestDev; lP1 = lpDestDev;
@ -590,7 +587,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
DWORD dwRet = 0; DWORD dwRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_ExtTextOut:\n"); TRACE(win16drv, "(lots of params - fixme)\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{ {
@ -603,7 +600,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
if (pLPD->fn[FUNC_EXTTEXTOUT] == NULL) if (pLPD->fn[FUNC_EXTTEXTOUT] == NULL)
{ {
dprintf_warn(win16drv, "PRTDRV_ExtTextOut: Not supported by driver\n"); WARN(win16drv, "Not supported by driver\n");
return 0; return 0;
} }
@ -613,7 +610,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
if (lpClipRect != NULL) { if (lpClipRect != NULL) {
lP4 = SEGPTR_NEW(RECT16); lP4 = SEGPTR_NEW(RECT16);
dprintf_info(win16drv, "Adding lpClipRect\n"); TRACE(win16drv, "Adding lpClipRect\n");
memcpy(lP4,lpClipRect,sizeof(RECT16)); memcpy(lP4,lpClipRect,sizeof(RECT16));
} else } else
lP4 = 0L; lP4 = 0L;
@ -623,7 +620,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
if (nSize>abs(wCount)) if (nSize>abs(wCount))
nSize = abs(wCount); nSize = abs(wCount);
lP5 = SEGPTR_ALLOC(nSize+1); lP5 = SEGPTR_ALLOC(nSize+1);
dprintf_info(win16drv, "Adding lpString (nSize is %d)\n",nSize); TRACE(win16drv, "Adding lpString (nSize is %d)\n",nSize);
memcpy(lP5,lpString,nSize); memcpy(lP5,lpString,nSize);
*((char *)lP5 + nSize) = '\0'; *((char *)lP5 + nSize) = '\0';
} else } else
@ -637,21 +634,23 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
lP9 = lpTextXForm; lP9 = lpTextXForm;
if (lpCharWidths != NULL) if (lpCharWidths != NULL)
dprintf_fixme(win16drv, "PRTDRV_ExtTextOut: Char widths not supported\n"); FIXME(win16drv, "Char widths not supported\n");
lP10 = 0; lP10 = 0;
if (lpOpaqueRect != NULL) { if (lpOpaqueRect != NULL) {
lP11 = SEGPTR_NEW(RECT16); lP11 = SEGPTR_NEW(RECT16);
dprintf_info(win16drv, "Adding lpOpaqueRect\n"); TRACE(win16drv, "Adding lpOpaqueRect\n");
memcpy(lP11,lpOpaqueRect,sizeof(RECT16)); memcpy(lP11,lpOpaqueRect,sizeof(RECT16));
} else } else
lP11 = 0L; lP11 = 0L;
wP12 = wOptions; wP12 = wOptions;
dprintf_info(win16drv, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n%*s 0x%x 0x%lx 0x%lx\n" TRACE(win16drv, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n",
"0x%lx 0x%lx %p 0x%x\n",lP1, wP2, wP3, lP4, lP1, wP2, wP3, lP4);
nSize,lP5, iP6, lP7, lP8, lP9, lP10, TRACE(win16drv, "%*s 0x%x 0x%lx 0x%lx\n",
lP11, wP12); nSize,lP5, iP6, lP7, lP8);
TRACE(win16drv, "0x%lx 0x%lx %p 0x%x\n",
lP9, lP10, lP11, wP12);
dwRet = Callbacks->CallDrvExtTextOutProc(pLPD->fn[FUNC_EXTTEXTOUT], dwRet = Callbacks->CallDrvExtTextOutProc(pLPD->fn[FUNC_EXTTEXTOUT],
lP1, wP2, wP3, lP1, wP2, wP3,
SEGPTR_GET(lP4), SEGPTR_GET(lP4),
@ -659,7 +658,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
lP8, lP9, lP10, lP8, lP9, lP10,
SEGPTR_GET(lP11), wP12); SEGPTR_GET(lP11), wP12);
} }
dprintf_info(win16drv, "PRTDRV_ExtTextOut: return %lx\n", dwRet); TRACE(win16drv, "return %lx\n", dwRet);
return dwRet; return dwRet;
} }
@ -756,7 +755,7 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT32 lpBuffer,
WORD wRet = 0; WORD wRet = 0;
LOADED_PRINTER_DRIVER *pLPD = NULL; LOADED_PRINTER_DRIVER *pLPD = NULL;
dprintf_info(win16drv, "PRTDRV_GetCharWidth:\n"); TRACE(win16drv, "(lots of params - fixme)\n");
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
{ {
@ -766,8 +765,7 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT32 lpBuffer,
if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL) if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL)
{ {
dprintf_warn(win16drv, WARN(win16drv, "Not supported by driver\n");
"PRTDRV_GetCharWidth: Not supported by driver\n");
return 0; return 0;
} }

View File

@ -31,7 +31,7 @@ BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
if (count == 0) if (count == 0)
return FALSE; return FALSE;
dprintf_info(win16drv, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n", TRACE(win16drv, "%04x %d %d %x %p %*s %p\n",
dc->hSelf, x, y, flags, lprect, count > 0 ? count : 8, str, lpDx); dc->hSelf, x, y, flags, lprect, count > 0 ? count : 8, str, lpDx);
@ -54,7 +54,7 @@ BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
} }
dprintf_info(win16drv, "textalign = %d\n", dc->w.textAlign); TRACE(win16drv, "textalign = %d\n", dc->w.textAlign);
if (dc->w.textAlign & TA_UPDATECP) if (dc->w.textAlign & TA_UPDATECP)
{ {

View File

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

View File

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

View File

@ -270,7 +270,7 @@ BOOL32
X11DRV_RoundRect( DC *dc, INT32 left, INT32 top, INT32 right, X11DRV_RoundRect( DC *dc, INT32 left, INT32 top, INT32 right,
INT32 bottom, INT32 ell_width, INT32 ell_height ) INT32 bottom, INT32 ell_width, INT32 ell_height )
{ {
dprintf_info(graphics, "X11DRV_RoundRect(%d %d %d %d %d %d\n", TRACE(graphics, "(%d %d %d %d %d %d\n",
left, top, right, bottom, ell_width, ell_height); left, top, right, bottom, ell_width, ell_height);
left = XLPTODP( dc, left ); left = XLPTODP( dc, left );
@ -694,7 +694,7 @@ X11DRV_ExtFloodFill( DC *dc, INT32 x, INT32 y, COLORREF color,
BOOL32 result; BOOL32 result;
struct FloodFill_params params = { dc, x, y, color, fillType }; struct FloodFill_params params = { dc, x, y, color, fillType };
dprintf_info(graphics, "X11DRV_ExtFloodFill %d,%d %06lx %d\n", TRACE(graphics, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
x, y, color, fillType ); x, y, color, fillType );
if (!PtVisible32( dc->hSelf, x, y )) return FALSE; if (!PtVisible32( dc->hSelf, x, y )) return FALSE;

View File

@ -31,7 +31,7 @@ HGDIOBJ32 X11DRV_SelectObject( DC *dc, HGDIOBJ32 handle )
HGDIOBJ32 ret = 0; HGDIOBJ32 ret = 0;
if (!ptr) return 0; if (!ptr) return 0;
dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); TRACE(gdi, "hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic) switch(ptr->wMagic)
{ {

View File

@ -43,10 +43,10 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
lfUnderline = (pfo->fo_flags & FO_SYNTH_UNDERLINE) ? 1 : 0; lfUnderline = (pfo->fo_flags & FO_SYNTH_UNDERLINE) ? 1 : 0;
lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0; lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0;
dprintf_info(text,"ExtTextOut: hdc=%04x df=%04x %d,%d '%.*s', %d flags=%d\n", TRACE(text,"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); dc->hSelf, (UINT16)(dc->u.x.font), x, y, (int)count, str, count, flags);
if (lprect != NULL) dprintf_info(text, "\trect=(%d,%d- %d,%d)\n", if (lprect != NULL) TRACE(text, "\trect=(%d,%d- %d,%d)\n",
lprect->left, lprect->top, lprect->left, lprect->top,
lprect->right, lprect->bottom ); lprect->right, lprect->bottom );
/* Setup coordinates */ /* Setup coordinates */
@ -85,7 +85,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
x = XLPTODP( dc, x ); x = XLPTODP( dc, x );
y = YLPTODP( dc, y ); y = YLPTODP( dc, y );
dprintf_info(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n", TRACE(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
x, y, rect.left, rect.top, rect.right, rect.bottom); x, y, rect.left, rect.top, rect.right, rect.bottom);
/* Draw the rectangle */ /* Draw the rectangle */

View File

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

View File

@ -29,6 +29,7 @@ DLLS = \
stress.spec \ stress.spec \
system.spec \ system.spec \
toolhelp.spec \ toolhelp.spec \
typelib.spec \
user.spec \ user.spec \
ver.spec \ ver.spec \
w32sys.spec \ w32sys.spec \

View File

@ -67,6 +67,7 @@ extern const WIN16_DESCRIPTOR STORAGE_Descriptor;
extern const WIN16_DESCRIPTOR STRESS_Descriptor; extern const WIN16_DESCRIPTOR STRESS_Descriptor;
extern const WIN16_DESCRIPTOR SYSTEM_Descriptor; extern const WIN16_DESCRIPTOR SYSTEM_Descriptor;
extern const WIN16_DESCRIPTOR TOOLHELP_Descriptor; extern const WIN16_DESCRIPTOR TOOLHELP_Descriptor;
extern const WIN16_DESCRIPTOR TYPELIB_Descriptor;
extern const WIN16_DESCRIPTOR USER_Descriptor; extern const WIN16_DESCRIPTOR USER_Descriptor;
extern const WIN16_DESCRIPTOR VER_Descriptor; extern const WIN16_DESCRIPTOR VER_Descriptor;
extern const WIN16_DESCRIPTOR W32SYS_Descriptor; extern const WIN16_DESCRIPTOR W32SYS_Descriptor;
@ -108,6 +109,7 @@ static BUILTIN16_DLL BuiltinDLLs[] =
{ &STORAGE_Descriptor, DLL_FLAG_NOT_USED }, { &STORAGE_Descriptor, DLL_FLAG_NOT_USED },
{ &STRESS_Descriptor, 0 }, { &STRESS_Descriptor, 0 },
{ &TOOLHELP_Descriptor, 0 }, { &TOOLHELP_Descriptor, 0 },
{ &TYPELIB_Descriptor, 0 },
{ &VER_Descriptor, 0 }, { &VER_Descriptor, 0 },
{ &W32SYS_Descriptor, 0 }, { &W32SYS_Descriptor, 0 },
{ &WIN32S16_Descriptor, 0 }, { &WIN32S16_Descriptor, 0 },
@ -141,7 +143,7 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr )
if (!hModule) return 0; if (!hModule) return 0;
FarSetOwner( hModule, hModule ); FarSetOwner( hModule, hModule );
dprintf_info(module, "Built-in %s: hmodule=%04x\n", TRACE(module, "Built-in %s: hmodule=%04x\n",
descr->name, hModule ); descr->name, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule ); pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->self = hModule; pModule->self = hModule;

View File

@ -34,7 +34,7 @@ type win16
31 pascal CoDosDateTimeToFileTime(word word ptr) DosDateTimeToFileTime 31 pascal CoDosDateTimeToFileTime(word word ptr) DosDateTimeToFileTime
32 stub COMARSHALHRESULT 32 stub COMARSHALHRESULT
33 stub COUNMARSHALHRESULT 33 stub COUNMARSHALHRESULT
34 stub COGETCURRENTPROCESS 34 pascal CoGetCurrentProcess() CoGetCurrentProcess
#35 ___EXPORTEDSTUB #35 ___EXPORTEDSTUB
36 stub COISOLE1CLASS 36 stub COISOLE1CLASS
37 stub _GUID_NULL 37 stub _GUID_NULL
@ -63,7 +63,7 @@ type win16
60 stub _IID_IMESSAGEFILTER 60 stub _IID_IMESSAGEFILTER
61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16 61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16
62 stub PROGIDFROMCLSID 62 stub PROGIDFROMCLSID
63 stub COLOCKOBJECTEXTERNAL 63 pascal CoLockObjectExternal(segptr word word) CoLockObjectExternal16
64 stub _CLSID_STDMARSHAL 64 stub _CLSID_STDMARSHAL
65 stub COGETTREATASCLASS 65 stub COGETTREATASCLASS
66 stub COTREATASCLASS 66 stub COTREATASCLASS
@ -75,7 +75,7 @@ type win16
72 stub _IID_IEXTERNALCONNECTION 72 stub _IID_IEXTERNALCONNECTION
73 stub COCREATEGUID 73 stub COCREATEGUID
75 stub FNASSERT 75 stub FNASSERT
76 stub STRINGFROMGUID2 76 pascal STRINGFROMGUID2(ptr ptr word) StringFromGUID2
77 stub COGETCLASSEXT 77 stub COGETCLASSEXT
78 stub OLE1CLASSFROMCLSID2 78 stub OLE1CLASSFROMCLSID2
79 stub CLSIDFROMOLE1CLASS 79 stub CLSIDFROMOLE1CLASS

View File

@ -301,6 +301,7 @@ file krnl386.exe
422 pascal16 GetDiskFreeSpace(ptr ptr ptr ptr ptr) GetDiskFreeSpace16 422 pascal16 GetDiskFreeSpace(ptr ptr ptr ptr ptr) GetDiskFreeSpace16
431 pascal16 KERNEL_431(str word) KERNEL_431 431 pascal16 KERNEL_431(str word) KERNEL_431
432 stub FileTimeToLocalFileTime 432 stub FileTimeToLocalFileTime
434 stub KERNEL_434
435 stub KERNEL_435 435 stub KERNEL_435
439 stub KERNEL_439 439 stub KERNEL_439
440 stub KERNEL_440 440 stub KERNEL_440
@ -355,6 +356,6 @@ file krnl386.exe
621 stub KERNEL_621 621 stub KERNEL_621
627 stub IsBadFlatReadWritePtr 627 stub IsBadFlatReadWritePtr
630 stub KERNEL_630 630 stub KERNEL_630
631 pascal FUNC004(word word long) FUNC004 #C16ThkSl01? 631 pascal FUNC004(word word word) FUNC004 #C16ThkSl01?
651 stub KERNEL_651 #ThunkConnect16? 651 stub KERNEL_651 #ThunkConnect16?
700 pascal KERNEL_700() stub_KERNEL_700 700 pascal KERNEL_700() stub_KERNEL_700

View File

@ -28,14 +28,14 @@ type win16
25 stub OLELOADFROMSTREAM 25 stub OLELOADFROMSTREAM
26 stub CREATEBINDCTX 26 stub CREATEBINDCTX
27 stub CREATEITEMMONIKER 27 stub CREATEITEMMONIKER
28 stub CREATEFILEMONIKER 28 pascal CreateFileMoniker(str ptr) CreateFileMoniker16
29 stub CREATEGENERICCOMPOSITE 29 stub CREATEGENERICCOMPOSITE
30 stub GETRUNNINGOBJECTTABLE 30 pascal GetRunningObjectTable(long ptr) GetRunningObjectTable16
31 stub OLEGETMALLOC 31 stub OLEGETMALLOC
32 stub RELEASESTGMEDIUM 32 stub RELEASESTGMEDIUM
33 stub READSTRINGSTREAM 33 stub READSTRINGSTREAM
34 stub WRITESTRINGSTREAM 34 stub WRITESTRINGSTREAM
35 stub REGISTERDRAGDROP 35 pascal RegisterDragDrop(word segptr) RegisterDragDrop16
36 stub REVOKEDRAGDROP 36 stub REVOKEDRAGDROP
37 stub DODRAGDROP 37 stub DODRAGDROP
38 stub CREATEOLEADVISEHOLDER 38 stub CREATEOLEADVISEHOLDER

View File

@ -2,12 +2,12 @@ name ole2disp
type win16 type win16
1 stub DLLGETCLASSOBJECT 1 stub DLLGETCLASSOBJECT
2 pascal SysAllocString(ptr) SysAllocString 2 pascal SysAllocString(str) SysAllocString
3 pascal SysReallocString(ptr ptr) SysReAllocString 3 pascal SysReallocString(ptr str) SysReAllocString
4 pascal SysAllocStringLen(ptr word) SysAllocStringLen 4 pascal SysAllocStringLen(str word) SysAllocStringLen
5 pascal SysReAllocStringLen(ptr ptr word) SysReAllocStringLen 5 pascal SysReAllocStringLen(ptr str word) SysReAllocStringLen
6 pascal SysFreeString(long) SysFreeString 6 pascal SysFreeString(segstr) SysFreeString
7 pascal SysStringLen(long) SysStringLen 7 pascal SysStringLen(segstr) SysStringLen
8 stub VARIANTINIT 8 stub VARIANTINIT
9 stub VARIANTCLEAR 9 stub VARIANTCLEAR
10 stub VARIANTCOPY 10 stub VARIANTCOPY

View File

@ -7,8 +7,8 @@ type win16
4 pascal GetSystemDefaultLangID() GetSystemDefaultLangID 4 pascal GetSystemDefaultLangID() GetSystemDefaultLangID
5 pascal GetLocaleInfoA(long long ptr word) GetLocaleInfo16 5 pascal GetLocaleInfoA(long long ptr word) GetLocaleInfo16
6 stub LCMAPSTRINGA 6 stub LCMAPSTRINGA
7 pascal16 GetStringTypeA(long long ptr word ptr) GetStringType16 7 pascal16 GetStringTypeA(long long str word ptr) GetStringType16
8 pascal16 CompareStringA(long long ptr word ptr word) CompareString16 8 pascal16 CompareStringA(long long str word str word) CompareString16
#9 WEP #9 WEP
10 stub LIBMAIN 10 stub LIBMAIN
11 stub NOTIFYWINDOWPROC 11 stub NOTIFYWINDOWPROC

View File

@ -56,7 +56,7 @@ type win16
57 stub OLEEXECUTE 57 stub OLEEXECUTE
58 stub OLECREATEINVISIBLE 58 stub OLECREATEINVISIBLE
59 stub OLEQUERYCLIENTVERSION 59 stub OLEQUERYCLIENTVERSION
60 pascal16 OleIsDcMeta(word) OleIsDcMeta 60 pascal16 OleIsDcMeta(word) OleIsDcMeta16
100 stub DOCWNDPROC 100 stub DOCWNDPROC
101 stub SRVRWNDPROC 101 stub SRVRWNDPROC
102 stub MFCALLBACKFUNC 102 stub MFCALLBACKFUNC

View File

@ -17,7 +17,7 @@
#if 0 #if 0
/* Make make_debug think these were really used */ /* Make make_debug think these were really used */
dprintf_info(relay, "test - dummy"); TRACE(relay, "test - dummy");
#endif #endif
@ -81,7 +81,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
char *args16; char *args16;
int i; int i;
if (!debugging_info(relay)) return; if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16; frame = CURRENT_STACK16;
printf( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs, printf( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs,
@ -199,7 +199,7 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT *context)
STACK16FRAME *frame; STACK16FRAME *frame;
WORD ordinal; WORD ordinal;
if (!debugging_info(relay)) return; if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16; frame = CURRENT_STACK16;
printf( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs, printf( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip, frame->entry_ip,
@ -257,7 +257,7 @@ void RELAY_DebugCallTo16( int* stack, int nb_args )
{ {
THDB *thdb; THDB *thdb;
if (!debugging_info(relay)) return; if (!TRACE_ON(relay)) return;
thdb = THREAD_Current(); thdb = THREAD_Current();
if (nb_args == -1) /* Register function */ if (nb_args == -1) /* Register function */
@ -383,7 +383,7 @@ void WINAPI Throw( CONTEXT *context )
if (lpbuf[8] != SS_reg(context)) if (lpbuf[8] != SS_reg(context))
fprintf( stderr, "Switching stack segment with Throw() not supported; expect crash now\n" ); fprintf( stderr, "Switching stack segment with Throw() not supported; expect crash now\n" );
if (debugging_info(relay)) /* Make sure we have a valid entry point address */ if (TRACE_ON(relay)) /* Make sure we have a valid entry point address */
{ {
static FARPROC16 entryPoint = NULL; static FARPROC16 entryPoint = NULL;
@ -468,7 +468,7 @@ static DWORD RELAY_CallProc32W(int Ex)
if (!Ex) STACK16_POP( THREAD_Current(), if (!Ex) STACK16_POP( THREAD_Current(),
(3 + nrofargs) * sizeof(DWORD) ); (3 + nrofargs) * sizeof(DWORD) );
dprintf_info(relay,"%s - returns %08lx\n",dbg_str(relay),ret); TRACE(relay,"%s - returns %08lx\n",dbg_str(relay),ret);
HeapFree( GetProcessHeap(), 0, args ); HeapFree( GetProcessHeap(), 0, args );
return ret; return ret;
} }

View File

@ -44,6 +44,7 @@ extern BOOL32 INSTR_EmulateInstruction( SIGCONTEXT *context );
*/ */
static HANDLER_DEF(SIGNAL_break) static HANDLER_DEF(SIGNAL_break)
{ {
HANDLER_INIT();
if (Options.debug) if (Options.debug)
wine_debug( signal, HANDLER_CONTEXT ); /* Enter our debugger */ wine_debug( signal, HANDLER_CONTEXT ); /* Enter our debugger */
else exit(0); else exit(0);
@ -57,6 +58,7 @@ static HANDLER_DEF(SIGNAL_break)
*/ */
static HANDLER_DEF(SIGNAL_trap) static HANDLER_DEF(SIGNAL_trap)
{ {
HANDLER_INIT();
wine_debug( signal, HANDLER_CONTEXT ); /* Enter our debugger */ wine_debug( signal, HANDLER_CONTEXT ); /* Enter our debugger */
} }
@ -70,6 +72,7 @@ static HANDLER_DEF(SIGNAL_fault)
{ {
WORD cs; WORD cs;
GET_CS(cs); GET_CS(cs);
HANDLER_INIT();
if (CS_sig(HANDLER_CONTEXT) == cs) if (CS_sig(HANDLER_CONTEXT) == cs)
{ {
fprintf( stderr, "Segmentation fault in 32-bit code (0x%08lx).\n", fprintf( stderr, "Segmentation fault in 32-bit code (0x%08lx).\n",

View File

@ -14,4 +14,6 @@ type win16
13 pascal freeallusermem() FreeAllUserMem 13 pascal freeallusermem() FreeAllUserMem
14 pascal allocgdimem(word) AllocGDIMem 14 pascal allocgdimem(word) AllocGDIMem
15 pascal freeallgdimem() FreeAllGDIMem 15 pascal freeallgdimem() FreeAllGDIMem
16 stub GETFREEHEAP32SPACE
17 stub ALLOCHEAP32MEM
18 stub FREEALLHEAP32MEM

View File

@ -226,7 +226,7 @@ static void THUNK_Free( THUNK *thunk )
return; return;
} }
} }
dprintf_err(thunk, "THUNK_Free: invalid thunk addr %p\n", thunk ); ERR(thunk, "invalid thunk addr %p\n", thunk );
} }
@ -625,7 +625,7 @@ static BOOL32 WINAPI THUNK_WOWCallback16Ex(
LPDWORD args = (LPDWORD)xargs; LPDWORD args = (LPDWORD)xargs;
DWORD ret,i; DWORD ret,i;
dprintf_info(relay,"WOWCallback16Ex(%p,0x%08lx,%ld,%p,%p)\n", TRACE(relay,"(%p,0x%08lx,%ld,%p,%p)\n",
proc,dwFlags,cbArgs,xargs,pdwret proc,dwFlags,cbArgs,xargs,pdwret
); );
if (dwFlags == WCB16_CDECL) { if (dwFlags == WCB16_CDECL) {

View File

@ -35,3 +35,6 @@ type win16
81 stub TASKSETCSIP 81 stub TASKSETCSIP
82 stub TASKGETCSIP 82 stub TASKGETCSIP
83 stub TASKSWITCH 83 stub TASKSWITCH
84 stub LOCAL32INFO
85 stub LOCAL32FIRST
86 stub LOCAL32NEXT

View File

@ -0,0 +1,15 @@
name typelib
type win16
2 stub CREATETYPELIB
3 stub LOADTYPELIB
4 stub LHASHVALOFNAMESYS
5 stub _IID_ICREATETYPEINFO
6 stub _IID_ICREATETYPELIB
7 stub _IID_ITYPECOMP
8 stub _IID_ITYPEINFO
9 stub _IID_ITYPELIB
10 stub REGISTERTYPELIB
11 stub LOADREGTYPELIB
14 pascal QueryPathOfRegTypeLib(ptr word word word ptr) QueryPathOfRegTypeLib
15 stub OABUILDVERSION

View File

@ -218,7 +218,7 @@ file user.exe
213 pascal16 BuildCommDCB(ptr ptr) BuildCommDCB16 213 pascal16 BuildCommDCB(ptr ptr) BuildCommDCB16
214 pascal EscapeCommFunction(word word) EscapeCommFunction16 214 pascal EscapeCommFunction(word word) EscapeCommFunction16
215 pascal16 FlushComm(word word) FlushComm 215 pascal16 FlushComm(word word) FlushComm
216 stub USERSEEUSERDO 216 pascal UserSeeUserDo(word word word word) UserSeeUserDo
217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle 217 pascal16 LookupMenuHandle(word s_word) LookupMenuHandle
218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect16 218 pascal16 DialogBoxIndirect(word word word segptr) DialogBoxIndirect16
219 pascal16 CreateDialogIndirect(word ptr word segptr) CreateDialogIndirect16 219 pascal16 CreateDialogIndirect(word ptr word segptr) CreateDialogIndirect16

View File

@ -20,3 +20,6 @@
/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */ /* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */
#undef NO_REENTRANT_X11 #undef NO_REENTRANT_X11
/* Define if you have machine/soundcard.h instead of sys/soundcard.h. */
#undef HAVE_MACHINE_SOUNDCARD_H

View File

@ -108,4 +108,84 @@ VOID WINAPI DrawStatusText32A(HDC32,LPRECT32,LPCSTR,UINT32);
VOID WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32); VOID WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32);
#define DrawStatusText WINELIB_NAME_AW(DrawStatusText) #define DrawStatusText WINELIB_NAME_AW(DrawStatusText)
/* ImageList */
#if defined(__WINE__) && defined(__WINE_IMAGELIST_C)
#else
struct _IMAGELIST;
typedef struct _IMAGELIST *HIMAGELIST;
#endif /* __WINE__ */
#define CLR_NONE 0xFFFFFFFF
#define CLR_DEFAULT 0x00000000
#define CLR_HILIGHT CLR_DEFAULT
#define ILC_MASK 0x0001
#define ILC_COLOR 0x0000
#define ILC_COLORDDB 0x00FE
#define ILC_COLOR4 0x0004
#define ILC_COLOR8 0x0008
#define ILC_COLOR16 0x0010
#define ILC_COLOR24 0x0018
#define ILC_COLOR32 0x0020
#define ILC_PALETTE 0x0800
#define ILD_NORMAL 0x0000
#define ILD_TRANSPARENT 0x0001
#define ILD_BLEND25 0x0002
#define ILD_BLEND50 0x0004
#define ILD_MASK 0x0010
#define ILD_IMAGE 0x0020
#define ILD_ROP 0x0040
#define ILD_OVERLAYMASK 0x0F00
#define ILD_SELECTED ILD_BLEND50
#define ILD_FOCUS ILD_BLEND25
#define ILD_BLEND ILD_BLEND50
#define INDEXTOOVERLAYMASK(i) ((i)<<8)
typedef struct _IMAGEINFO
{
HBITMAP32 hbmImage;
HBITMAP32 hbmMask;
INT32 Unused1;
INT32 Unused2;
RECT32 rcImage;
} IMAGEINFO;
INT32 WINAPI ImageList_Add(HIMAGELIST,HBITMAP32,HBITMAP32);
INT32 WINAPI ImageList_AddMasked(HIMAGELIST,HBITMAP32,COLORREF);
HIMAGELIST WINAPI ImageList_Create(INT32,INT32,UINT32,INT32,INT32);
BOOL32 WINAPI ImageList_Destroy(HIMAGELIST);
BOOL32 WINAPI ImageList_Draw(HIMAGELIST,INT32,HDC32,INT32,INT32,UINT32);
COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST);
BOOL32 WINAPI ImageList_GetIconSize(HIMAGELIST,INT32*,INT32*);
INT32 WINAPI ImageList_GetImageCount(HIMAGELIST);
BOOL32 WINAPI ImageList_GetImageInfo(HIMAGELIST,INT32,IMAGEINFO*);
HIMAGELIST WINAPI ImageList_LoadImage32A(HINSTANCE32,LPCSTR,INT32,INT32,
COLORREF,UINT32,UINT32);
HIMAGELIST WINAPI ImageList_LoadImage32W(HINSTANCE32,LPCWSTR,INT32,INT32,
COLORREF,UINT32,UINT32);
#define ImageList_LoadImage WINELIB_NAME_AW(ImageList_LoadImage)
HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST,INT32,HIMAGELIST,INT32,INT32,INT32);
BOOL32 WINAPI ImageList_Replace(HIMAGELIST,INT32,HBITMAP32,HBITMAP32);
INT32 WINAPI ImageList_ReplaceIcon(HIMAGELIST,INT32,HICON32);
COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST,COLORREF);
BOOL32 WINAPI ImageList_SetOverlayImage(HIMAGELIST,INT32,INT32);
#define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon)
#define ImageList_LoadBitmap(hi,lpbmp,cx,cGrow,crMask) \
ImageList_LoadImage(hi,lpbmp,cx,cGrow,crMask,IMAGE_BITMAP,0)
#endif /* __WINE_COMMCTRL_H */ #endif /* __WINE_COMMCTRL_H */

View File

@ -33,6 +33,9 @@
/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */ /* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */
#undef NO_REENTRANT_X11 #undef NO_REENTRANT_X11
/* Define if you have machine/soundcard.h instead of sys/soundcard.h. */
#undef HAVE_MACHINE_SOUNDCARD_H
/* Define if you have the clone function. */ /* Define if you have the clone function. */
#undef HAVE_CLONE #undef HAVE_CLONE
@ -45,6 +48,9 @@
/* Define if you have the tcgetattr function. */ /* Define if you have the tcgetattr function. */
#undef HAVE_TCGETATTR #undef HAVE_TCGETATTR
/* Define if you have the timegm function. */
#undef HAVE_TIMEGM
/* Define if you have the usleep function. */ /* Define if you have the usleep function. */
#undef HAVE_USLEEP #undef HAVE_USLEEP

View File

@ -1,9 +1,10 @@
/* Do not modify this file -- it is automatically generated! */ /* Do not modify this file -- it is automatically generated! */
#ifndef __DEBUGTOOLS_H #ifndef __WINE_DEBUGTOOLS_H
#include "debugtools.h" #include "debugtools.h"
#endif #endif
/* Definitions for channels identifiers */
#define dbch_accel 0 #define dbch_accel 0
#define dbch_aspi 1 #define dbch_aspi 1
#define dbch_atom 2 #define dbch_atom 2
@ -22,74 +23,82 @@
#define dbch_cursor 15 #define dbch_cursor 15
#define dbch_dc 16 #define dbch_dc 16
#define dbch_dde 17 #define dbch_dde 17
#define dbch_ddraw 18 #define dbch_ddeml 18
#define dbch_dialog 19 #define dbch_ddraw 19
#define dbch_dll 20 #define dbch_dialog 20
#define dbch_dosfs 21 #define dbch_dll 21
#define dbch_driver 22 #define dbch_dosfs 22
#define dbch_dsound 23 #define dbch_driver 23
#define dbch_edit 24 #define dbch_dsound 24
#define dbch_event 25 #define dbch_edit 25
#define dbch_exec 26 #define dbch_event 26
#define dbch_file 27 #define dbch_exec 27
#define dbch_fixup 28 #define dbch_file 28
#define dbch_font 29 #define dbch_fixup 29
#define dbch_gdi 30 #define dbch_font 30
#define dbch_global 31 #define dbch_gdi 31
#define dbch_graphics 32 #define dbch_global 32
#define dbch_heap 33 #define dbch_graphics 33
#define dbch_hook 34 #define dbch_heap 34
#define dbch_icon 35 #define dbch_hook 35
#define dbch_int 36 #define dbch_icon 36
#define dbch_key 37 #define dbch_int 37
#define dbch_keyboard 38 #define dbch_int21 38
#define dbch_ldt 39 #define dbch_key 39
#define dbch_listbox 40 #define dbch_keyboard 40
#define dbch_local 41 #define dbch_ldt 41
#define dbch_mci 42 #define dbch_listbox 42
#define dbch_mcianim 43 #define dbch_local 43
#define dbch_mciwave 44 #define dbch_mci 44
#define dbch_mdi 45 #define dbch_mcianim 45
#define dbch_menu 46 #define dbch_mciwave 46
#define dbch_message 47 #define dbch_mdi 47
#define dbch_metafile 48 #define dbch_menu 48
#define dbch_midi 49 #define dbch_message 49
#define dbch_mmaux 50 #define dbch_metafile 50
#define dbch_mmio 51 #define dbch_midi 51
#define dbch_mmsys 52 #define dbch_mmaux 52
#define dbch_mmtime 53 #define dbch_mmio 53
#define dbch_module 54 #define dbch_mmsys 54
#define dbch_msg 55 #define dbch_mmtime 55
#define dbch_nonclient 56 #define dbch_module 56
#define dbch_ole 57 #define dbch_msg 57
#define dbch_palette 58 #define dbch_nonclient 58
#define dbch_profile 59 #define dbch_ole 59
#define dbch_progress 60 #define dbch_palette 60
#define dbch_prop 61 #define dbch_profile 61
#define dbch_reg 62 #define dbch_progress 62
#define dbch_region 63 #define dbch_prop 63
#define dbch_relay 64 #define dbch_reg 64
#define dbch_resource 65 #define dbch_region 65
#define dbch_scroll 66 #define dbch_relay 66
#define dbch_selector 67 #define dbch_resource 67
#define dbch_sem 68 #define dbch_scroll 68
#define dbch_sendmsg 69 #define dbch_selector 69
#define dbch_shm 70 #define dbch_sem 70
#define dbch_stddeb 71 #define dbch_sendmsg 71
#define dbch_stress 72 #define dbch_shm 72
#define dbch_string 73 #define dbch_static 73
#define dbch_task 74 #define dbch_stress 74
#define dbch_text 75 #define dbch_string 75
#define dbch_thunk 76 #define dbch_task 76
#define dbch_timer 77 #define dbch_text 77
#define dbch_toolhelp 78 #define dbch_thunk 78
#define dbch_tweak 79 #define dbch_timer 79
#define dbch_updown 80 #define dbch_toolhelp 80
#define dbch_ver 81 #define dbch_tweak 81
#define dbch_virtual 82 #define dbch_uitools 82
#define dbch_vxd 83 #define dbch_updown 83
#define dbch_win 84 #define dbch_ver 84
#define dbch_win16drv 85 #define dbch_virtual 85
#define dbch_win32 86 #define dbch_vxd 86
#define dbch_winsock 87 #define dbch_win 87
#define dbch_x11 88 #define dbch_win16drv 88
#define dbch_win32 89
#define dbch_winsock 90
#define dbch_x11 91
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_err 1
#define dbcl_warn 2
#define dbcl_trace 3

View File

@ -1,10 +1,10 @@
/* Do not modify this file -- it is automatically generated! */ /* Do not modify this file -- it is automatically generated! */
#ifndef __DEBUGTOOLS_H #ifndef __WINE_DEBUGTOOLS_H
#include "debugtools.h" #include "debugtools.h"
#endif #endif
#define DEBUG_CHANNEL_COUNT 89 #define DEBUG_CHANNEL_COUNT 92
#ifdef DEBUG_RUNTIME #ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = { short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0}, {1, 1, 0, 0},
@ -96,6 +96,9 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0}, {1, 1, 0, 0},
{1, 1, 0, 0}, {1, 1, 0, 0},
{1, 1, 0, 0}, {1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
}; };
const char* debug_ch_name[] = { const char* debug_ch_name[] = {
"accel", "accel",
@ -116,6 +119,7 @@ const char* debug_ch_name[] = {
"cursor", "cursor",
"dc", "dc",
"dde", "dde",
"ddeml",
"ddraw", "ddraw",
"dialog", "dialog",
"dll", "dll",
@ -135,6 +139,7 @@ const char* debug_ch_name[] = {
"hook", "hook",
"icon", "icon",
"int", "int",
"int21",
"key", "key",
"keyboard", "keyboard",
"ldt", "ldt",
@ -169,7 +174,7 @@ const char* debug_ch_name[] = {
"sem", "sem",
"sendmsg", "sendmsg",
"shm", "shm",
"stddeb", "static",
"stress", "stress",
"string", "string",
"task", "task",
@ -178,6 +183,7 @@ const char* debug_ch_name[] = {
"timer", "timer",
"toolhelp", "toolhelp",
"tweak", "tweak",
"uitools",
"updown", "updown",
"ver", "ver",
"virtual", "virtual",
@ -188,9 +194,12 @@ const char* debug_ch_name[] = {
"winsock", "winsock",
"x11", "x11",
}; };
const char* debug_cl_name[] = {
const char* debug_cl_name[] = "fixme",
{ "fixme", "err", "warn", "info" }; "err",
"warn",
"trace",
};
#endif /*DEBUG_RUNTIME*/ #endif /*DEBUG_RUNTIME*/

View File

@ -1,6 +1,6 @@
#ifndef __DEBUGTOOLS_H #ifndef __WINE_DEBUGTOOLS_H
#define __DEBUGTOOLS_H #define __WINE_DEBUGTOOLS_H
#include <stdio.h> #include <stdio.h>
@ -11,8 +11,6 @@
#define DEBUG_CLASS_COUNT 4 #define DEBUG_CLASS_COUNT 4
extern short debug_msg_enabled[][DEBUG_CLASS_COUNT]; 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_str(name) debug_str_##name
#define dbg_buf(name) debug_buf_##name #define dbg_buf(name) debug_buf_##name
@ -29,38 +27,25 @@ extern const char* debug_cl_name[];
#define dbg_ch_index(ch) (dbch_##ch) #define dbg_ch_index(ch) (dbch_##ch)
#define dbg_cl_index(cl) (dbcl_##cl) #define dbg_cl_index(cl) (dbcl_##cl)
#define debugging_(cl, ch) \ #define DEBUGGING(cl, ch) \
(dbg_ch_index(ch) >=0 && dbg_cl_index(cl) >= 0 && \ (dbg_ch_index(ch) >=0 && dbg_cl_index(cl) >= 0 && \
debug_msg_enabled[dbg_ch_index(ch)][dbg_cl_index(cl)]) debug_msg_enabled[dbg_ch_index(ch)][dbg_cl_index(cl)])
#define dprintf(format, args...) \ #define DPRINTF(format, args...) \
fprintf(stddeb, format, ## args) fprintf(stddeb, format, ## args)
#define dprintf_(cl, ch, format, args...) \ #define DPRINTF_(cl, ch, format, args...) \
if(!debugging_(cl, ch)) ; \ if(!DEBUGGING(cl, ch)) ; \
else dprintf("%s:%s:%s:%d:%s: "format, \ else DPRINTF(# cl ":" # ch ":%s " format, __FUNCTION__ , ## args)
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
#define TRACE(ch, fmt, args...) DPRINTF_(trace, ch, fmt, ## args)
#define WARN(ch, fmt, args...) DPRINTF_(warn, ch, fmt, ## args)
#define FIXME(ch, fmt, args...) DPRINTF_(fixme, ch, fmt, ## args)
#define ERR(ch, fmt, args...) DPRINTF_(err, ch, fmt, ## args)
#define FIXME_ON(ch) DEBUGGING(fixme, ch)
#define ERR_ON(ch) DEBUGGING(err, ch)
#define WARN_ON(ch) DEBUGGING(warn, ch)
#define TRACE_ON(ch) DEBUGGING(trace, ch)
#endif /* __WINE_DEBUGTOOLS_H */

View File

@ -0,0 +1,28 @@
/*
* ImageList definitions
*
* Copyright 1998 Eric Kohl
*/
#ifndef __WINE_IMAGELIST_H
#define __WINE_IMAGELIST_H
struct _IMAGELIST
{
HANDLE32 hHeap;
HBITMAP32 hbmImage;
HBITMAP32 hbmMask;
COLORREF clrBk;
INT32 cGrow;
INT32 cMaxImage;
INT32 cCurImage;
INT32 cx;
INT32 cy;
UINT32 flags;
INT32 nOvlIdx[4];
};
typedef struct _IMAGELIST *HIMAGELIST;
#endif /* __WINE_IMAGELIST_H */

View File

@ -56,6 +56,42 @@ typedef struct
DWORD filesize; /* 1c file size */ DWORD filesize; /* 1c file size */
} DOS_DIRENTRY_LAYOUT; } DOS_DIRENTRY_LAYOUT;
typedef struct
{
WORD CX_Int21_5e01; /* contents of CX from INT 21/AX=5E01h */
WORD LRU_count_FCB_cache;
WORD LRU_count_FCB_open;
DWORD OEM_func_handler WINE_PACKED; /* OEM function of INT 21/AH=F8h */
WORD INT21_offset;/* offset in DOS CS of code to return from INT 21 call */
WORD sharing_retry_count;
WORD sharing_retry_delay;
DWORD ptr_disk_buf; /* ptr to current disk buf */
WORD offs_unread_CON; /* pointer in DOS data segment of unread CON input */
WORD seg_first_MCB;
DWORD ptr_first_DPB;
DWORD ptr_first_SysFileTable;
DWORD ptr_clock_dev_hdr;
DWORD ptr_CON_dev_hdr;
WORD max_byte_per_sec; /* maximum bytes per sector of any block device */
DWORD ptr_disk_buf_info WINE_PACKED;
DWORD ptr_array_CDS WINE_PACKED; /* current directory structure */
DWORD ptr_sys_FCB WINE_PACKED;
WORD nr_protect_FCB;
BYTE nr_block_dev;
BYTE nr_avail_drive_letters;
BYTE NUL_dev_header[18];
BYTE nr_drives_JOINed;
WORD ptr_spec_prg_names WINE_PACKED;
DWORD ptr_SETVER_prg_list WINE_PACKED;
WORD DOS_HIGH_A20_func_offs WINE_PACKED;
WORD PSP_last_exec WINE_PACKED; /* if DOS in HMA: PSP of program executed last; if DOS low: 0000h */
WORD BUFFERS_val WINE_PACKED;
WORD BUFFERS_nr_lookahead WINE_PACKED;
BYTE boot_drive WINE_PACKED;
BYTE flag_DWORD_moves WINE_PACKED; /* 01h for 386+, 00h otherwise */
WORD size_extended_mem WINE_PACKED; /* size of extended mem in KB */
} DOS_LISTOFLISTS;
#define MAX_DOS_DRIVES 26 #define MAX_DOS_DRIVES 26
extern struct DosDeviceStruct COM[MAX_PORTS]; extern struct DosDeviceStruct COM[MAX_PORTS];

View File

@ -13,25 +13,27 @@
*/ */
typedef struct typedef struct
{ {
WORD e_magic; /* MZ Header signature */ WORD e_magic; /* 00: MZ Header signature */
WORD e_cblp; /* Bytes on last page of file */ WORD e_cblp; /* 02: Bytes on last page of file */
WORD e_cp; /* Pages in file */ WORD e_cp; /* 04: Pages in file */
WORD e_crlc; /* Relocations */ WORD e_crlc; /* 06: Relocations */
WORD e_cparhdr; /* Size of header in paragraphs */ WORD e_cparhdr; /* 08: Size of header in paragraphs */
WORD e_minalloc; /* Minimum extra paragraphs needed */ WORD e_minalloc; /* 0a: Minimum extra paragraphs needed */
WORD e_maxalloc; /* Maximum extra paragraphs needed */ WORD e_maxalloc; /* 0c: Maximum extra paragraphs needed */
WORD e_ss; /* Initial (relative) SS value */ WORD e_ss; /* 0e: Initial (relative) SS value */
WORD e_sp; /* Initial SP value */ WORD e_sp; /* 10: Initial SP value */
WORD e_csum; /* Checksum */ WORD e_csum; /* 12: Checksum */
WORD e_ip; /* Initial IP value */ WORD e_ip; /* 14: Initial IP value */
WORD e_cs; /* Initial (relative) CS value */ WORD e_cs; /* 16: Initial (relative) CS value */
WORD e_lfarlc; /* File address of relocation table */ WORD e_lfarlc; /* 18: File address of relocation table */
WORD e_ovno; /* Overlay number */ WORD e_ovno; /* 1a: Overlay number */
WORD e_res[4]; /* Reserved words */ WORD e_res[4]; /* 1c: Reserved words */
WORD e_oemid; /* OEM identifier (for e_oeminfo) */ WORD e_oemid; /* 24: OEM identifier (for e_oeminfo) */
WORD e_oeminfo; /* OEM information; e_oemid specific */ WORD e_oeminfo; /* 26: OEM information; e_oemid specific */
WORD e_res2[10]; /* Reserved words */ WORD e_res2[10]; /* 28: Reserved words */
WORD e_lfanew; /* Offset to extended header */ WORD e_lfanew; /* 3c: Offset to extended header */
WORD e_xxx; /* 3e: Wine internal pad (some programs expect
* this to be 0) */
} IMAGE_DOS_HEADER,*LPIMAGE_DOS_HEADER; } IMAGE_DOS_HEADER,*LPIMAGE_DOS_HEADER;
#define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */ #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */

View File

@ -119,7 +119,7 @@ typedef enum {
oleupdate_always, oleupdate_always,
oleupdate_onsave, oleupdate_onsave,
oleupdate_oncall, oleupdate_oncall,
oleupdate_onclose, oleupdate_onclose
} OLEOPT_UPDATE; } OLEOPT_UPDATE;
typedef LONG LHSERVER; typedef LONG LHSERVER;

View File

@ -7,7 +7,10 @@
typedef LONG HRESULT; typedef LONG HRESULT;
/* to be implemented */
typedef LPVOID LPMESSAGEFILTER; typedef LPVOID LPMESSAGEFILTER;
typedef LPVOID LPDROPTARGET;
typedef LPVOID LPMONIKER;
#define S_OK 0 #define S_OK 0
#define S_FALSE 1 #define S_FALSE 1

View File

@ -96,7 +96,7 @@ typedef enum
{ {
SHGDN_NORMAL = 0, /* default (display purpose) */ SHGDN_NORMAL = 0, /* default (display purpose) */
SHGDN_INFOLDER = 1, /* displayed under a folder (relative)*/ SHGDN_INFOLDER = 1, /* displayed under a folder (relative)*/
SHGDN_FORPARSING = 0x8000, /* for ParseDisplayName or path */ SHGDN_FORPARSING = 0x8000 /* for ParseDisplayName or path */
} SHGNO; } SHGNO;
/* IShellFolder::EnumObjects */ /* IShellFolder::EnumObjects */
@ -104,7 +104,7 @@ typedef enum tagSHCONTF
{ {
SHCONTF_FOLDERS = 32, /* for shell browser */ SHCONTF_FOLDERS = 32, /* for shell browser */
SHCONTF_NONFOLDERS = 64, /* for default view */ SHCONTF_NONFOLDERS = 64, /* for default view */
SHCONTF_INCLUDEHIDDEN = 128, /* for hidden/system objects */ SHCONTF_INCLUDEHIDDEN = 128 /* for hidden/system objects */
} SHCONTF; } SHCONTF;
/* from oleidl.h */ /* from oleidl.h */
@ -183,13 +183,13 @@ struct tagSHELLFOLDER {
typedef enum { typedef enum {
SLR_NO_UI = 0x0001, SLR_NO_UI = 0x0001,
SLR_ANY_MATCH = 0x0002, SLR_ANY_MATCH = 0x0002,
SLR_UPDATE = 0x0004, SLR_UPDATE = 0x0004
} SLR_FLAGS; } SLR_FLAGS;
/* IShellLink::GetPath fFlags */ /* IShellLink::GetPath fFlags */
typedef enum { typedef enum {
SLGP_SHORTPATH = 0x0001, SLGP_SHORTPATH = 0x0001,
SLGP_UNCPRIORITY = 0x0002, SLGP_UNCPRIORITY = 0x0002
} SLGP_FLAGS; } SLGP_FLAGS;

View File

@ -214,6 +214,17 @@ typedef struct _CONTEXT /* Note 1 */
#define FL_sig(context) (*(WORD*)&EFL_sig(context)) #define FL_sig(context) (*(WORD*)&EFL_sig(context))
#ifdef FS_sig
#define HANDLER_INIT() SET_FS(FS_sig(HANDLER_CONTEXT))
#else FS_sig
#define HANDLER_INIT() /* nothing */
#endif
#else /* __i386__ */
#define HANDLER_DEF(name) void name (int signal)
#define HANDLER_INIT() /* nothing */
#endif /* __i386__ */ #endif /* __i386__ */
#endif /* __WINE_SIG_CONTEXT_H */ #endif /* __WINE_SIG_CONTEXT_H */

View File

@ -23,6 +23,12 @@ extern WORD USER_HeapSel;
#define USER_HEAP_SEG_ADDR(handle) \ #define USER_HEAP_SEG_ADDR(handle) \
((handle) ? PTR_SEG_OFF_TO_SEGPTR(USER_HeapSel, (handle)) : (SEGPTR)0) ((handle) ? PTR_SEG_OFF_TO_SEGPTR(USER_HeapSel, (handle)) : (SEGPTR)0)
#define USUD_LOCALALLOC 0x0001
#define USUD_LOCALFREE 0x0002
#define USUD_LOCALCOMPACT 0x0003
#define USUD_LOCALHEAP 0x0004
#define USUD_FIRSTCLASS 0x0005
void USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16); void USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
void USER_ExitWindows(void); void USER_ExitWindows(void);
HGLOBAL16 USER_CallDefaultRsrcHandler( HGLOBAL16 hMemObj, HMODULE16 hModule, HGLOBAL16 USER_CallDefaultRsrcHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,

View File

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

View File

@ -2101,8 +2101,8 @@ typedef struct
/* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */ /* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
typedef struct typedef struct
{ {
INT32 dwLowDateTime; DWORD dwLowDateTime;
INT32 dwHighDateTime; DWORD dwHighDateTime;
} FILETIME, *LPFILETIME; } FILETIME, *LPFILETIME;
/* Find* structures */ /* Find* structures */
@ -4429,6 +4429,147 @@ typedef INT32 (CALLBACK *MFENUMPROC32)(HDC32,HANDLETABLE32*,METARECORD*,
INT32,LPARAM); INT32,LPARAM);
DECL_WINELIB_TYPE(MFENUMPROC); DECL_WINELIB_TYPE(MFENUMPROC);
/* enhanced metafile structures and functions */
/* note that ENHMETAHEADER is just a particular kind of ENHMETARECORD,
ie. the header is just the first record in the metafile */
typedef struct {
DWORD iType;
DWORD nSize;
RECT32 rclBounds;
RECT32 rclFrame;
DWORD dSignature;
DWORD nVersion;
DWORD nBytes;
DWORD nRecords;
WORD nHandles;
WORD sReserved;
DWORD nDescription;
DWORD offDescription;
DWORD nPalEntries;
SIZE32 szlDevice;
SIZE32 szlMillimeters;
DWORD cbPixelFormat;
DWORD offPixelFormat;
DWORD bOpenGL;
} ENHMETAHEADER, *LPENHMETAHEADER;
typedef struct {
DWORD iType;
DWORD nSize;
DWORD dParm[1];
} ENHMETARECORD, *LPENHMETARECORD;
typedef INT32 (CALLBACK *ENHMFENUMPROC32)(HDC32, LPHANDLETABLE32,
LPENHMETARECORD, INT32, LPVOID);
#define EMR_HEADER 1
#define EMR_POLYBEZIER 2
#define EMR_POLYGON 3
#define EMR_POLYLINE 4
#define EMR_POLYBEZIERTO 5
#define EMR_POLYLINETO 6
#define EMR_POLYPOLYLINE 7
#define EMR_POLYPOLYGON 8
#define EMR_SETWINDOWEXTEX 9
#define EMR_SETWINDOWORGEX 10
#define EMR_SETVIEWPORTEXTEX 11
#define EMR_SETVIEWPORTORGEX 12
#define EMR_SETBRUSHORGEX 13
#define EMR_EOF 14
#define EMR_SETPIXELV 15
#define EMR_SETMAPPERFLAGS 16
#define EMR_SETMAPMODE 17
#define EMR_SETBKMODE 18
#define EMR_SETPOLYFILLMODE 19
#define EMR_SETROP2 20
#define EMR_SETSTRETCHBLTMODE 21
#define EMR_SETTEXTALIGN 22
#define EMR_SETCOLORADJUSTMENT 23
#define EMR_SETTEXTCOLOR 24
#define EMR_SETBKCOLOR 25
#define EMR_OFFSETCLIPRGN 26
#define EMR_MOVETOEX 27
#define EMR_SETMETARGN 28
#define EMR_EXCLUDECLIPRECT 29
#define EMR_INTERSECTCLIPRECT 30
#define EMR_SCALEVIEWPORTEXTEX 31
#define EMR_SCALEWINDOWEXTEX 32
#define EMR_SAVEDC 33
#define EMR_RESTOREDC 34
#define EMR_SETWORLDTRANSFORM 35
#define EMR_MODIFYWORLDTRANSFORM 36
#define EMR_SELECTOBJECT 37
#define EMR_CREATEPEN 38
#define EMR_CREATEBRUSHINDIRECT 39
#define EMR_DELETEOBJECT 40
#define EMR_ANGLEARC 41
#define EMR_ELLIPSE 42
#define EMR_RECTANGLE 43
#define EMR_ROUNDRECT 44
#define EMR_ARC 45
#define EMR_CHORD 46
#define EMR_PIE 47
#define EMR_SELECTPALETTE 48
#define EMR_CREATEPALETTE 49
#define EMR_SETPALETTEENTRIES 50
#define EMR_RESIZEPALETTE 51
#define EMR_REALIZEPALETTE 52
#define EMR_EXTFLOODFILL 53
#define EMR_LINETO 54
#define EMR_ARCTO 55
#define EMR_POLYDRAW 56
#define EMR_SETARCDIRECTION 57
#define EMR_SETMITERLIMIT 58
#define EMR_BEGINPATH 59
#define EMR_ENDPATH 60
#define EMR_CLOSEFIGURE 61
#define EMR_FILLPATH 62
#define EMR_STROKEANDFILLPATH 63
#define EMR_STROKEPATH 64
#define EMR_FLATTENPATH 65
#define EMR_WIDENPATH 66
#define EMR_SELECTCLIPPATH 67
#define EMR_ABORTPATH 68
#define EMR_GDICOMMENT 70
#define EMR_FILLRGN 71
#define EMR_FRAMERGN 72
#define EMR_INVERTRGN 73
#define EMR_PAINTRGN 74
#define EMR_EXTSELECTCLIPRGN 75
#define EMR_BITBLT 76
#define EMR_STRETCHBLT 77
#define EMR_MASKBLT 78
#define EMR_PLGBLT 79
#define EMR_SETDIBITSTODEVICE 80
#define EMR_STRETCHDIBITS 81
#define EMR_EXTCREATEFONTINDIRECTW 82
#define EMR_EXTTEXTOUTA 83
#define EMR_EXTTEXTOUTW 84
#define EMR_POLYBEZIER16 85
#define EMR_POLYGON16 86
#define EMR_POLYLINE16 87
#define EMR_POLYBEZIERTO16 88
#define EMR_POLYLINETO16 89
#define EMR_POLYPOLYLINE16 90
#define EMR_POLYPOLYGON16 91
#define EMR_POLYDRAW16 92
#define EMR_CREATEMONOBRUSH 93
#define EMR_CREATEDIBPATTERNBRUSHPT 94
#define EMR_EXTCREATEPEN 95
#define EMR_POLYTEXTOUTA 96
#define EMR_POLYTEXTOUTW 97
#define EMR_SETICMMODE 98
#define EMR_CREATECOLORSPACE 99
#define EMR_SETCOLORSPACE 100
#define EMR_DELETECOLORSPACE 101
#define EMR_GLSRECORD 102
#define EMR_GLSBOUNDEDRECORD 103
#define EMR_PIXELFORMAT 104
#define ENHMETA_SIGNATURE 1179469088
#ifndef NOLOGERROR #ifndef NOLOGERROR
/* LogParamError and LogError values */ /* LogParamError and LogError values */
@ -4935,6 +5076,7 @@ typedef struct _PRINTER_DEFAULTS32W {
} PRINTER_DEFAULTS32W, *LPPRINTER_DEFAULTS32W; } PRINTER_DEFAULTS32W, *LPPRINTER_DEFAULTS32W;
DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS); DECL_WINELIB_TYPE_AW(PRINTER_DEFAULTS);
DECL_WINELIB_TYPE_AW(LPPRINTER_DEFAULTS);
typedef struct _SYSTEM_POWER_STATUS typedef struct _SYSTEM_POWER_STATUS
{ {
@ -5817,6 +5959,9 @@ BOOL32 WINAPI GetTextExtentExPoint32A(HDC32,LPCSTR,INT32,INT32,
BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32, BOOL32 WINAPI GetTextExtentExPoint32W(HDC32,LPCWSTR,INT32,INT32,
LPINT32,LPINT32,LPSIZE32); LPINT32,LPINT32,LPSIZE32);
#define GetTextExtentExPoint WINELIB_NAME_AW(GetTextExtentExPoint) #define GetTextExtentExPoint WINELIB_NAME_AW(GetTextExtentExPoint)
INT32 WINAPI GetTimeFormat32A(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT32);
INT32 WINAPI GetTimeFormat32W(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT32);
#define GetTimeFormat WINELIB_NAME_AW(GetTimeFormat)
LCID WINAPI GetThreadLocale(); LCID WINAPI GetThreadLocale();
INT32 WINAPI GetThreadPriority(HANDLE32); INT32 WINAPI GetThreadPriority(HANDLE32);
BOOL32 WINAPI GetThreadSelectorEntry(HANDLE32,DWORD,LPLDT_ENTRY); BOOL32 WINAPI GetThreadSelectorEntry(HANDLE32,DWORD,LPLDT_ENTRY);
@ -5957,8 +6102,8 @@ BOOL32 WINAPI VirtualFree(LPVOID,DWORD,DWORD);
BOOL32 WINAPI VirtualLock(LPVOID,DWORD); BOOL32 WINAPI VirtualLock(LPVOID,DWORD);
BOOL32 WINAPI VirtualProtect(LPVOID,DWORD,DWORD,LPDWORD); BOOL32 WINAPI VirtualProtect(LPVOID,DWORD,DWORD,LPDWORD);
BOOL32 WINAPI VirtualProtectEx(HANDLE32,LPVOID,DWORD,DWORD,LPDWORD); BOOL32 WINAPI VirtualProtectEx(HANDLE32,LPVOID,DWORD,DWORD,LPDWORD);
BOOL32 WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD); DWORD WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
BOOL32 WINAPI VirtualQueryEx(HANDLE32,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD); DWORD WINAPI VirtualQueryEx(HANDLE32,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
BOOL32 WINAPI VirtualUnlock(LPVOID,DWORD); BOOL32 WINAPI VirtualUnlock(LPVOID,DWORD);
DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE32*,BOOL32,DWORD); DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE32*,BOOL32,DWORD);
DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE32*,BOOL32,DWORD,BOOL32); DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE32*,BOOL32,DWORD,BOOL32);

View File

@ -127,8 +127,61 @@
#define MAKELCID(l, s) (MAKELONG(l, s)) #define MAKELCID(l, s) (MAKELONG(l, s))
#define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p)) #define MAKELANGID(p, s) ((((WORD)(s))<<10) | (WORD)(p))
/* Language IDs (were in winnt.h, for some reason) */
/* Language IDs */
#define LANG_NEUTRAL 0x00
#define LANG_ARABIC 0x01
#define LANG_AFRIKAANS 0x36
#define LANG_ALBANIAN 0x1c
#define LANG_BASQUE 0x2d
#define LANG_BULGARIAN 0x02
#define LANG_BYELORUSSIAN 0x23
#define LANG_CATALAN 0x03
#define LANG_CHINESE 0x04
#define LANG_CROATIAN 0x1a
#define LANG_CZECH 0x05
#define LANG_DANISH 0x06
#define LANG_DUTCH 0x13
#define LANG_ENGLISH 0x09
#define LANG_ESTONIAN 0x25
#define LANG_FAEROESE 0x38
#define LANG_FARSI 0x29
#define LANG_FINNISH 0x0b
#define LANG_FRENCH 0x0c
#define LANG_GERMAN 0x07
#define LANG_GREEK 0x08
#define LANG_HEBREW 0x0D
#define LANG_HUNGARIAN 0x0e
#define LANG_ICELANDIC 0x0f
#define LANG_INDONESIAN 0x21
#define LANG_ITALIAN 0x10
#define LANG_JAPANESE 0x11
#define LANG_KOREAN 0x12
#define LANG_LATVIAN 0x26
#define LANG_LITHUANIAN 0x27
#define LANG_NORWEGIAN 0x14
#define LANG_POLISH 0x15
#define LANG_PORTUGUESE 0x16
#define LANG_ROMANIAN 0x18
#define LANG_RUSSIAN 0x19
#define LANG_SLOVAK 0x1b
#define LANG_SLOVENIAN 0x24
#define LANG_SORBIAN 0x2e
#define LANG_SPANISH 0x0a
#define LANG_SWEDISH 0x1d
#define LANG_THAI 0x1e
#define LANG_TURKISH 0x1f
#define LANG_UKRAINIAN 0x22
/* "default"ish values */
#define SORT_DEFAULT 0 #define SORT_DEFAULT 0
#define SUBLANG_DEFAULT 1 #define SUBLANG_DEFAULT 1
#define SUBLANG_SYS_DEFAULT 1 /* FIXME: I don't know if this is right */
#define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
#define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
@ -146,4 +199,12 @@
#define LCMAP_HALFWIDTH 0x00400000 /* map double byte to single byte */ #define LCMAP_HALFWIDTH 0x00400000 /* map double byte to single byte */
#define LCMAP_FULLWIDTH 0x00800000 /* map single byte to double byte */ #define LCMAP_FULLWIDTH 0x00800000 /* map single byte to double byte */
/* Date Flags for GetDateFormat. */
#define DATE_SHORTDATE 0x00000001 /* use short date picture */
#define DATE_LONGDATE 0x00000002 /* use long date picture */
#define DATE_USE_ALT_CALENDAR 0x00000004 /* use alternate calendar */
/* alt. calendar support is broken anyway */
#endif /* __WINE_WINNLS_H */ #endif /* __WINE_WINNLS_H */

View File

@ -272,51 +272,7 @@ DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
LPTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter ); WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
/* Language IDs */ /* I moved the Language IDs to winnls.h (David Lee Lambert) */
#define LANG_NEUTRAL 0x00
#define LANG_ARABIC 0x01
#define LANG_AFRIKAANS 0x36
#define LANG_ALBANIAN 0x1c
#define LANG_BASQUE 0x2d
#define LANG_BULGARIAN 0x02
#define LANG_BYELORUSSIAN 0x23
#define LANG_CATALAN 0x03
#define LANG_CHINESE 0x04
#define LANG_CROATIAN 0x1a
#define LANG_CZECH 0x05
#define LANG_DANISH 0x06
#define LANG_DUTCH 0x13
#define LANG_ENGLISH 0x09
#define LANG_ESTONIAN 0x25
#define LANG_FAEROESE 0x38
#define LANG_FARSI 0x29
#define LANG_FINNISH 0x0b
#define LANG_FRENCH 0x0c
#define LANG_GERMAN 0x07
#define LANG_GREEK 0x08
#define LANG_HEBREW 0x0D
#define LANG_HUNGARIAN 0x0e
#define LANG_ICELANDIC 0x0f
#define LANG_INDONESIAN 0x21
#define LANG_ITALIAN 0x10
#define LANG_JAPANESE 0x11
#define LANG_KOREAN 0x12
#define LANG_LATVIAN 0x26
#define LANG_LITHUANIAN 0x27
#define LANG_NORWEGIAN 0x14
#define LANG_POLISH 0x15
#define LANG_PORTUGUESE 0x16
#define LANG_ROMANIAN 0x18
#define LANG_RUSSIAN 0x19
#define LANG_SLOVAK 0x1b
#define LANG_SLOVENIAN 0x24
#define LANG_SORBIAN 0x2e
#define LANG_SPANISH 0x0a
#define LANG_SWEDISH 0x1d
#define LANG_THAI 0x1e
#define LANG_TURKISH 0x1f
#define LANG_UKRAINIAN 0x22
/* Access rights */ /* Access rights */

View File

@ -155,6 +155,7 @@ DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HDROP); DECLARE_HANDLE(HDROP);
DECLARE_HANDLE(HDRVR); DECLARE_HANDLE(HDRVR);
DECLARE_HANDLE(HDWP); DECLARE_HANDLE(HDWP);
DECLARE_HANDLE(HENHMETAFILE);
DECLARE_HANDLE(HFILE); DECLARE_HANDLE(HFILE);
DECLARE_HANDLE(HFONT); DECLARE_HANDLE(HFONT);
DECLARE_HANDLE(HGDIOBJ); DECLARE_HANDLE(HGDIOBJ);
@ -262,6 +263,7 @@ DECL_WINELIB_TYPE(HDC);
DECL_WINELIB_TYPE(HDROP); DECL_WINELIB_TYPE(HDROP);
DECL_WINELIB_TYPE(HDRVR); DECL_WINELIB_TYPE(HDRVR);
DECL_WINELIB_TYPE(HDWP); DECL_WINELIB_TYPE(HDWP);
DECL_WINELIB_TYPE(HENHMETAFILE);
DECL_WINELIB_TYPE(HFILE); DECL_WINELIB_TYPE(HFILE);
DECL_WINELIB_TYPE(HFONT); DECL_WINELIB_TYPE(HFONT);
DECL_WINELIB_TYPE(HGDIOBJ); DECL_WINELIB_TYPE(HGDIOBJ);

View File

@ -129,7 +129,7 @@ ATOM DDE_GlobalAddAtom( SEGPTR name )
return (atom<MIN_STR_ATOM) ? atom : 0; return (atom<MIN_STR_ATOM) ? atom : 0;
} }
dprintf_info(atom,"GlobalAddAtom(\"%s\")\n",str); TRACE(atom,"(\"%s\")\n",str);
DDE_IPC_init(); /* will initialize only if needed */ DDE_IPC_init(); /* will initialize only if needed */
@ -174,7 +174,7 @@ ATOM DDE_GlobalDeleteAtom( ATOM atom )
AtomData_ptr atom_ptr; AtomData_ptr atom_ptr;
ATOM retval=(ATOM) 0; ATOM retval=(ATOM) 0;
dprintf_info(atom,"GlobalDeleteAtom(\"%d\")\n",(int)atom); TRACE(atom,"(\"%d\")\n",(int)atom);
atom_idx=(int)atom - MIN_STR_ATOM; atom_idx=(int)atom - MIN_STR_ATOM;
if (atom_idx < 0 ) if (atom_idx < 0 )
@ -211,7 +211,7 @@ ATOM DDE_GlobalFindAtom( SEGPTR name )
int atom_ofs; int atom_ofs;
char *str; char *str;
dprintf_info(atom,"GlobalFindAtom(%08lx)\n", name ); TRACE(atom,"(%08lx)\n", name );
/* First check for integer atom */ /* First check for integer atom */
@ -223,7 +223,7 @@ ATOM DDE_GlobalFindAtom( SEGPTR name )
ATOM atom= (ATOM) atoi(&str[1]); ATOM atom= (ATOM) atoi(&str[1]);
return (atom<MIN_STR_ATOM) ? atom : 0; return (atom<MIN_STR_ATOM) ? atom : 0;
} }
dprintf_info(atom,"GlobalFindAtom(\"%s\")\n",str); TRACE(atom,"(\"%s\")\n",str);
DDE_IPC_init(); /* will initialize only if needed */ DDE_IPC_init(); /* will initialize only if needed */

View File

@ -24,9 +24,9 @@ int main()
int i,j,atom_n; int i,j,atom_n;
int atom_len[TOGETHER]; int atom_len[TOGETHER];
debugging_info(shm)=1; TRACE_ON(shm)=1;
debugging_info(atom)=0; TRACE_ON(atom)=0;
debugging_info(sem)=0; TRACE_ON(sem)=0;
for (i=0 ; i<=10000/TOGETHER ; i++) { for (i=0 ; i<=10000/TOGETHER ; i++) {
for (atom_n=0 ; atom_n<TOGETHER ; atom_n++) { for (atom_n=0 ; atom_n<TOGETHER ; atom_n++) {

View File

@ -58,18 +58,18 @@ static struct handle_info *locate_handle(HGLOBAL16 h, struct local_shm_map *map)
{ {
struct shm_block *block; struct shm_block *block;
dprintf_info(global,"shm:locate_handle(0x%04x)\n", h); TRACE(global,"shm: (0x%04x)\n", h);
if (SampleBit( &free_handles, DDE_MEM_IDX(h)) == 0) { if (SampleBit( &free_handles, DDE_MEM_IDX(h)) == 0) {
dprintf_info(global, "shm:locate_handle: return NULL\n"); TRACE(global, "shm: return NULL\n");
return NULL; /* free!!! */ return NULL; /* free!!! */
} }
block= shm_locate_block(DDE_MEM_INFO(h).shmid, map); block= shm_locate_block(DDE_MEM_INFO(h).shmid, map);
if (block == NULL) { if (block == NULL) {
/* nothing found */ /* nothing found */
dprintf_info(global, "shm:locate_handle: return NULL\n"); TRACE(global, "shm: return NULL\n");
return NULL; return NULL;
} }
@ -87,7 +87,7 @@ static HGLOBAL16 dde_alloc_handle()
if (bit_nr != -1) if (bit_nr != -1)
return DDE_MEM_HANDLE(bit_nr); return DDE_MEM_HANDLE(bit_nr);
dprintf_info(global,"dde_alloc_handle: no free DDE handle found\n"); TRACE(global,"dde_alloc_handle: no free DDE handle found\n");
return 0; return 0;
} }
/********************************************************************** /**********************************************************************
@ -102,7 +102,7 @@ DDE_malloc(unsigned int flags, unsigned long size, SHMDATA *shmdata)
struct local_shm_map *curr; struct local_shm_map *curr;
HGLOBAL16 handle; HGLOBAL16 handle;
dprintf_info(global,"DDE_malloc flags %4X, size %ld\n", flags, size); TRACE(global,"DDE_malloc flags %4X, size %ld\n", flags, size);
DDE_IPC_init(); /* make sure main shm block allocated */ DDE_IPC_init(); /* make sure main shm block allocated */
shm_write_wait(main_block->proc[curr_proc_idx].sem); shm_write_wait(main_block->proc[curr_proc_idx].sem);
@ -151,14 +151,13 @@ DDE_malloc(unsigned int flags, unsigned long size, SHMDATA *shmdata)
handle= dde_alloc_handle(); handle= dde_alloc_handle();
if (handle) { if (handle) {
dprintf_info(global, TRACE(global, "returning handle=0x%4x, ptr=0x%08lx\n",
"DDE_malloc returning handle=0x%4x, ptr=0x%08lx\n",
(int)handle, (long) HINFO2DATAPTR(h_info)); (int)handle, (long) HINFO2DATAPTR(h_info));
DDE_MEM_INFO(handle).rel= PTR2REL(block, h_info); DDE_MEM_INFO(handle).rel= PTR2REL(block, h_info);
DDE_MEM_INFO(handle).shmid= shmid; DDE_MEM_INFO(handle).shmid= shmid;
} }
else else
dprintf_warn(global, "DDE_malloc failed\n"); WARN(global, "failed\n");
shm_write_signal(main_block->proc[curr_proc_idx].sem); shm_write_signal(main_block->proc[curr_proc_idx].sem);
@ -172,7 +171,7 @@ HGLOBAL16 DDE_GlobalFree(HGLOBAL16 h)
int handle_index= h & 0x7fff; int handle_index= h & 0x7fff;
struct local_shm_map map; struct local_shm_map map;
dprintf_info(global,"DDE_GlobalFree(0x%04x)\n",h); TRACE(global,"(0x%04x)\n",h);
if (h==0) if (h==0)
return 0; return 0;
@ -238,18 +237,18 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr)
if (segptr != NULL) if (segptr != NULL)
*segptr=0; *segptr=0;
dprintf_info(global,"DDE_AttachHandle(%04x)\n",handle); TRACE(global,"(%04x)\n",handle);
h_info=locate_handle(handle, NULL); h_info=locate_handle(handle, NULL);
if (h_info == NULL) if (h_info == NULL)
return NULL; return NULL;
if ( !(h_info->flags & GMEM_DDESHARE) ) { if ( !(h_info->flags & GMEM_DDESHARE) ) {
fprintf(stderr,"DDE_AttachHandle: Corrupted memory handle info\n"); ERR(global,"Corrupted memory handle info\n");
return NULL; return NULL;
} }
dprintf_info(global,"DDE_AttachHandle: h_info=%06lx\n",(long)h_info); TRACE(global,"h_info=%06lx\n",(long)h_info);
shmdata.handle= handle; shmdata.handle= handle;
shmdata.shmid= DDE_MEM_INFO(handle).shmid; shmdata.shmid= DDE_MEM_INFO(handle).shmid;
@ -263,10 +262,10 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr)
if (segptr != NULL) if (segptr != NULL)
*segptr= (SEGPTR)MAKELONG( 0, shmdata.sel); *segptr= (SEGPTR)MAKELONG( 0, shmdata.sel);
if (debugging_info(dde)) if (TRACE_ON(dde))
debug_last_handle_size= h_info->size; debug_last_handle_size= h_info->size;
dprintf_info(global,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr); TRACE(global,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr);
return (LPSTR)ptr; return (LPSTR)ptr;

View File

@ -123,7 +123,7 @@ void dde_proc_add(dde_proc procs)
{ {
dde_proc proc; dde_proc proc;
int proc_idx; int proc_idx;
dprintf_info(dde,"dde_proc_add(..)\n"); TRACE(dde,"(..)\n");
shm_write_wait(main_block->sem); shm_write_wait(main_block->sem);
/* find free proc_idx and allocate it */ /* find free proc_idx and allocate it */
@ -164,7 +164,7 @@ static BOOL32 get_ack()
size= msgrcv( main_block->proc[curr_proc_idx].msg , &ack_buff.dat, size= msgrcv( main_block->proc[curr_proc_idx].msg , &ack_buff.dat,
1, DDE_ACK, IPC_NOWAIT); 1, DDE_ACK, IPC_NOWAIT);
if (size>=0) { if (size>=0) {
dprintf_info(msg,"get_ack: received DDE_ACK message\n"); TRACE(msg,"get_ack: received DDE_ACK message\n");
return TRUE; return TRUE;
} }
if (DDE_GetRemoteMessage()) { if (DDE_GetRemoteMessage()) {
@ -197,7 +197,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
return FALSE; return FALSE;
} }
if (debugging_info(dde) || debugging_warn_dde) { if (TRACE_ON(dde) || WARN_ON_dde) {
MSG16 *msg=(MSG16*) &msgbuf->mtext; MSG16 *msg=(MSG16*) &msgbuf->mtext;
char *title; char *title;
if (msgbuf->mtype==DDE_SEND) if (msgbuf->mtype==DDE_SEND)
@ -209,14 +209,12 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
if (title) if (title)
print_dde_message(title, msg); print_dde_message(title, msg);
else else
dprintf_warn(dde, "Unknown message type=0x%lx\n", msgbuf->mtype); WARN(dde, "Unknown message type=0x%lx\n", msgbuf->mtype);
} }
dprintf_info(msg, TRACE(msg, "to proc_idx=%d (pid=%d), queue=%u\n",
"DDE_DoOneMessage: to proc_idx=%d (pid=%d), queue=%u\n",
proc_idx, proc->pid, (unsigned)proc->msg); proc_idx, proc->pid, (unsigned)proc->msg);
if ( proc->msg != -1) { if ( proc->msg != -1) {
dprintf_info(msg, "DDE_DoOneMessage: doing...(type=%s)\n", TRACE(msg, "doing...(type=%s)\n", msg_type[msgbuf->mtype]);
msg_type[msgbuf->mtype]);
size=msgsnd (proc->msg, msgbuf, size, 0); size=msgsnd (proc->msg, msgbuf, size, 0);
if (size<0) { if (size<0) {
@ -225,8 +223,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
} }
kill(proc->pid,SIGUSR2); /* tell the process there is a message */ kill(proc->pid,SIGUSR2); /* tell the process there is a message */
dprintf_info(msg,"DDE_DoOneMessage: " TRACE(msg, "Trying to get acknowledgment from msg queue=%d\n",
"Trying to get acknowledgment from msg queue=%d\n",
proc->msg); proc->msg);
Yield16(); /* force task switch, and */ Yield16(); /* force task switch, and */
/* acknowledgment sending */ /* acknowledgment sending */
@ -239,8 +236,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
} }
} }
else { else {
dprintf_warn(msg, "DDE_DoOneMessage: message not sent, " WARN(msg, "message not sent, target has no message queue\n");
"target has no message queue\n");
return FALSE; return FALSE;
} }
} }
@ -312,12 +308,11 @@ static BOOL32 DDE_DoMessage( MSG16 *msg, int type )
if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND16)-1) if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND16)-1)
return FALSE; return FALSE;
dprintf_info(msg, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n", TRACE(msg, "(hwnd=0x%x,msg=0x%x,..) - %s\n",
msg_type[type], (int)msg->hwnd,(int)msg->message); (int)msg->hwnd,(int)msg->message,msg_type[type]);
dprintf_info(msg, TRACE(msg, "(hwnd=0x%x,msg=0x%x,..) -- HWND_BROADCAST !\n",
"DDE_DoMessage(hwnd=0x%x,msg=0x%x,..) // HWND_BROADCAST !\n",
(int)msg->hwnd,(int)msg->message); (int)msg->hwnd,(int)msg->message);
remote_message=(void*)&msg_dat.dat.mtext; remote_message=(void*)&msg_dat.dat.mtext;
@ -361,10 +356,8 @@ void dde_proc_send_ack(HWND16 wnd, BOOL32 val) {
proc=DDE_WIN2PROC(wnd); proc=DDE_WIN2PROC(wnd);
msg=main_block->proc[proc].msg; msg=main_block->proc[proc].msg;
dprintf_info(msg,"DDE_GetRemoteMessage: sending ACK " TRACE(msg,"sending ACK to wnd=%4x, proc=%d,msg=%d, pid=%d\n",
"to wnd=%4x, proc=%d,msg=%d, pid=%d\n",wnd,proc,msg, wnd,proc,msg,main_block->proc[proc].pid);
main_block->proc[proc].pid
);
msg_ack.mtext[0]=val; msg_ack.mtext[0]=val;
msgsnd (msg, &msg_ack, 1, 0); msgsnd (msg, &msg_ack, 1, 0);
@ -390,7 +383,7 @@ int DDE_GetRemoteMessage()
if (nesting>10) { if (nesting>10) {
fflush(stdout); fflush(stdout);
fprintf(stderr,"DDE_GetRemoteMessage: suspecting infinite recursion, exiting"); ERR(msg, "suspecting infinite recursion, exiting");
return 0; return 0;
} }
@ -402,8 +395,7 @@ int DDE_GetRemoteMessage()
if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/ if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/
was_sent=TRUE; was_sent=TRUE;
dprintf_info(msg, TRACE(msg, "DDE:receive sent message. msg=%04x wPar=%04x"
"DDE:receive sent message. msg=%04x wPar=%04x"
" lPar=%08lx\n", " lPar=%08lx\n",
remote_message->message, remote_message->wParam, remote_message->message, remote_message->wParam,
remote_message->lParam); remote_message->lParam);
@ -413,8 +405,7 @@ int DDE_GetRemoteMessage()
if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/ if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/
was_sent=FALSE; was_sent=FALSE;
dprintf_info(msg, TRACE(msg, "DDE:receive posted message. "
"DDE:receive posted message. "
"msg=%04x wPar=%04x lPar=%08lx\n", "msg=%04x wPar=%04x lPar=%08lx\n",
remote_message->message, remote_message->wParam, remote_message->message, remote_message->wParam,
remote_message->lParam); remote_message->lParam);
@ -429,7 +420,7 @@ int DDE_GetRemoteMessage()
nesting++; nesting++;
if (debugging_info(dde)) { if (TRACE_ON(dde)) {
char *title; char *title;
if (was_sent) if (was_sent)
title="receive sent dde:"; title="receive sent dde:";
@ -442,10 +433,8 @@ int DDE_GetRemoteMessage()
HWND16 dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd; HWND16 dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd;
/* we should know exactly where to send the message (locally)*/ /* we should know exactly where to send the message (locally)*/
if (was_sent) { if (was_sent) {
dprintf_info(dde, TRACE(dde, "SendMessage(wnd=0x%04x, msg=0x%04x, wPar=0x%04x,"
"SendMessage(wnd=0x%04x, msg=0x%04x, wPar=0x%04x," "lPar=0x%08x\n", dde_window, remote_message->message,
"lPar=0x%08x\n",
dde_window, remote_message->message,
remote_message->wParam, (int)remote_message->lParam); remote_message->wParam, (int)remote_message->lParam);
/* execute the recieved message */ /* execute the recieved message */
@ -524,7 +513,7 @@ void DDE_TestDDE(HWND16 hwnd)
in_test--; in_test--;
return; return;
} }
dprintf_info(msg,"DDE_TestDDE(0x%04x)\n", hwnd); TRACE(msg,"(0x%04x)\n", hwnd);
if (hwnd==0) if (hwnd==0)
hwnd=-1; hwnd=-1;
/* just send a message to see how things are going */ /* just send a message to see how things are going */
@ -631,7 +620,7 @@ static void print_dde_message(char *desc, MSG16 *msg)
dsprintf(dde," atom=0x%04x",hWord); dsprintf(dde," atom=0x%04x",hWord);
break; break;
} }
dprintf_info(dde,"%s\n", dbg_str(dde)); TRACE(dde,"%s\n", dbg_str(dde));
} }
void dde_proc_done(dde_proc proc) void dde_proc_done(dde_proc proc)

View File

@ -37,7 +37,7 @@ struct local_shm_map *shm_map=NULL;
*/ */
void shm_setup_block(struct shm_block *block, int first, int size) void shm_setup_block(struct shm_block *block, int first, int size)
{ {
dprintf_info(shm,"Setting up shm block at 0x%08x\n",(int )block); TRACE(shm,"Setting up shm block at 0x%08x\n",(int )block);
/* setup block internal data structure */ /* setup block internal data structure */
if (first <= 0) { if (first <= 0) {
first=sizeof(*block); first=sizeof(*block);
@ -53,8 +53,7 @@ void shm_setup_block(struct shm_block *block, int first, int size)
/* block->size is initialized in shm_FragmentInit */ /* block->size is initialized in shm_FragmentInit */
shm_FragmentInit(block, first, size); /* first item in the free list */ shm_FragmentInit(block, first, size); /* first item in the free list */
dprintf_info(shm, TRACE(shm, "block was set up at 0x%08x, size=0x%04xKB, 1st usable=%02x\n",
"block was set up at 0x%08x, size=0x%04xKB, 1st usable=%02x\n",
(int )block,size/1024,first); (int )block,size/1024,first);
} }

View File

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

View File

@ -28,7 +28,7 @@ void shm_read_wait(shm_sem semid)
struct sembuf sop[2]; struct sembuf sop[2];
int ret; int ret;
dprintf_info(sem,"shm_read_wait(%d)\n",semid); TRACE(sem,"(%d)\n",semid);
sop[0].sem_num=SEM_READ; sop[0].sem_num=SEM_READ;
sop[0].sem_op=1; /* add this read instance */ sop[0].sem_op=1; /* add this read instance */
sop[0].sem_flg=SEM_UNDO; /* undo in case process dies */ sop[0].sem_flg=SEM_UNDO; /* undo in case process dies */
@ -50,7 +50,7 @@ void shm_write_wait(shm_sem semid)
struct sembuf sop[3]; struct sembuf sop[3];
int ret; int ret;
dprintf_info(sem,"shm_write_wait(%d)\n",semid); TRACE(sem,"(%d)\n",semid);
sop[0].sem_num=SEM_READ; sop[0].sem_num=SEM_READ;
sop[0].sem_op=0; /* wait until no reading instance exist */ sop[0].sem_op=0; /* wait until no reading instance exist */
sop[0].sem_flg=SEM_UNDO; sop[0].sem_flg=SEM_UNDO;
@ -76,7 +76,7 @@ void shm_write_signal(shm_sem semid)
struct sembuf sop[2]; struct sembuf sop[2];
int ret; int ret;
dprintf_info(sem,"shm_write_signal(%d)\n",semid); TRACE(sem,"(%d)\n",semid);
sop[0].sem_num=SEM_READ; sop[0].sem_num=SEM_READ;
sop[0].sem_op=-1; sop[0].sem_op=-1;
sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */ sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */
@ -99,7 +99,7 @@ void shm_read_signal(shm_sem semid)
struct sembuf sop[2]; struct sembuf sop[2];
int ret; int ret;
dprintf_info(sem,"shm_read_signal(%d)\n",semid); TRACE(sem,"(%d)\n",semid);
sop[0].sem_num=SEM_READ; sop[0].sem_num=SEM_READ;
sop[0].sem_op=-1; sop[0].sem_op=-1;
sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */ sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */

View File

@ -19,6 +19,7 @@
#include "module.h" #include "module.h"
#include "neexe.h" #include "neexe.h"
#include "process.h" #include "process.h"
#include "thread.h"
#include "resource.h" #include "resource.h"
#include "selectors.h" #include "selectors.h"
#include "stackframe.h" #include "stackframe.h"
@ -29,6 +30,8 @@
extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params ); extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params );
extern BOOL32 THREAD_InitDone;
static HMODULE16 hFirstModule = 0; static HMODULE16 hFirstModule = 0;
static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */ static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */
@ -269,7 +272,7 @@ int MODULE_OpenFile( HMODULE32 hModule )
static int cachedfd = -1; static int cachedfd = -1;
hModule = MODULE_HANDLEtoHMODULE16(hModule); hModule = MODULE_HANDLEtoHMODULE16(hModule);
dprintf_info(module, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n", TRACE(module, "(%04x) cache: mod=%04x fd=%d\n",
hModule, hCachedModule, cachedfd ); hModule, hCachedModule, cachedfd );
if (!(pModule = MODULE_GetPtr( hModule ))) return -1; if (!(pModule = MODULE_GetPtr( hModule ))) return -1;
if (hCachedModule == hModule) return cachedfd; if (hCachedModule == hModule) return cachedfd;
@ -280,7 +283,7 @@ int MODULE_OpenFile( HMODULE32 hModule )
(cachedfd = open( full_name.long_name, O_RDONLY )) == -1) (cachedfd = open( full_name.long_name, O_RDONLY )) == -1)
fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module %04x\n", fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module %04x\n",
name, hModule ); name, hModule );
dprintf_info(module, "MODULE_OpenFile: opened '%s' -> %d\n", TRACE(module, "opened '%s' -> %d\n",
name, cachedfd ); name, cachedfd );
return cachedfd; return cachedfd;
} }
@ -561,7 +564,7 @@ static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
/* Clear internal Wine flags in case they are set in the EXE file */ /* Clear internal Wine flags in case they are set in the EXE file */
pModule->flags &= ~(NE_FFLAGS_BUILTIN | NE_FFLAGS_WIN32); pModule->flags &= ~(NE_FFLAGS_BUILTIN|NE_FFLAGS_WIN32|NE_FFLAGS_IMPLICIT);
/* Read the fast-load area */ /* Read the fast-load area */
@ -569,7 +572,7 @@ static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
{ {
fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count; fastload_offset=ne_header.fastload_offset<<ne_header.align_shift_count;
fastload_length=ne_header.fastload_length<<ne_header.align_shift_count; fastload_length=ne_header.fastload_length<<ne_header.align_shift_count;
dprintf_info(module, "Using fast-load area offset=%x len=%d\n", TRACE(module, "Using fast-load area offset=%x len=%d\n",
fastload_offset, fastload_length ); fastload_offset, fastload_length );
if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL) if ((fastload = HeapAlloc( SystemHeap, 0, fastload_length )) != NULL)
{ {
@ -756,7 +759,7 @@ WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
dprintf_info(module, "MODULE_GetOrdinal(%04x,'%s')\n", TRACE(module, "(%04x,'%s')\n",
hModule, name ); hModule, name );
/* First handle names of the form '#xxxx' */ /* First handle names of the form '#xxxx' */
@ -779,7 +782,7 @@ WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
{ {
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len )) if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{ {
dprintf_info(module, " Found: ordinal=%d\n", TRACE(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) ); *(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1); return *(WORD *)(cpnt + *cpnt + 1);
} }
@ -797,7 +800,7 @@ WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name )
{ {
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len )) if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{ {
dprintf_info(module, " Found: ordinal=%d\n", TRACE(module, " Found: ordinal=%d\n",
*(WORD *)(cpnt + *cpnt + 1) ); *(WORD *)(cpnt + *cpnt + 1) );
return *(WORD *)(cpnt + *cpnt + 1); return *(WORD *)(cpnt + *cpnt + 1);
} }
@ -1044,7 +1047,7 @@ static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
if (ordinal) WEP = MODULE_GetEntryPoint( hModule, ordinal ); if (ordinal) WEP = MODULE_GetEntryPoint( hModule, ordinal );
if (!WEP) if (!WEP)
{ {
dprintf_warn(module, "module %04x doesn't have a WEP\n", hModule ); WARN(module, "module %04x doesn't have a WEP\n", hModule );
return FALSE; return FALSE;
} }
return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL ); return Callbacks->CallWindowsExitProc( WEP, WEP_FREE_DLL );
@ -1307,7 +1310,7 @@ BOOL16 WINAPI FreeModule16( HMODULE16 hModule )
NE_MODULE *pModule; NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE; if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE;
dprintf_info(module, "FreeModule16: %s count %d\n", TRACE(module, "%s count %d\n",
MODULE_GetModuleName(hModule), pModule->count ); MODULE_GetModuleName(hModule), pModule->count );
return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) ); return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) );
@ -1335,7 +1338,7 @@ HMODULE32 WINAPI GetModuleHandle32A(LPCSTR module)
{ {
HMODULE32 hModule; HMODULE32 hModule;
dprintf_info(win32, "GetModuleHandleA: %s\n", module ? module : "NULL"); TRACE(win32, "%s\n", module ? module : "NULL");
/* Freecell uses the result of GetModuleHandleA(0) as the hInstance in /* Freecell uses the result of GetModuleHandleA(0) as the hInstance in
all calls to e.g. CreateWindowEx. */ all calls to e.g. CreateWindowEx. */
if (module == NULL) { if (module == NULL) {
@ -1364,7 +1367,7 @@ INT16 WINAPI GetModuleUsage( HINSTANCE16 hModule )
NE_MODULE *pModule; NE_MODULE *pModule;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
dprintf_info(module, "GetModuleUsage(%04x): returning %d\n", TRACE(module, "(%04x): returning %d\n",
hModule, pModule->count ); hModule, pModule->count );
return pModule->count; return pModule->count;
} }
@ -1381,7 +1384,7 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
if (!hModule) hModule = GetCurrentTask(); if (!hModule) hModule = GetCurrentTask();
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize ); lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
dprintf_info(module, "GetModuleFileName16: %s\n", lpFileName ); TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName); return strlen(lpFileName);
} }
@ -1401,7 +1404,7 @@ DWORD WINAPI GetModuleFileName32A( HMODULE32 hModule, LPSTR lpFileName,
} }
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size ); lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size );
dprintf_info(module, "GetModuleFileName32A: %s\n", lpFileName ); TRACE(module, "%s\n", lpFileName );
return strlen(lpFileName); return strlen(lpFileName);
} }
@ -1496,7 +1499,7 @@ HMODULE32 WINAPI LoadLibraryEx32W(LPCWSTR libnameW,HFILE32 hfile,DWORD flags)
*/ */
BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule) BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule)
{ {
dprintf_info(module,"FreeLibrary: hLibModule: %08x\n", hLibModule); TRACE(module,"hLibModule=%08x\n", hLibModule);
return MODULE_FreeModule(hLibModule, return MODULE_FreeModule(hLibModule,
GlobalLock16(GetCurrentTask()) ); GlobalLock16(GetCurrentTask()) );
} }
@ -1514,7 +1517,7 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
fprintf( stderr, "LoadLibrary not supported in Winelib\n" ); fprintf( stderr, "LoadLibrary not supported in Winelib\n" );
return 0; return 0;
} }
dprintf_info(module, "LoadLibrary: (%08x) %s\n", (int)libname, libname); TRACE(module, "(%08x) %s\n", (int)libname, libname);
handle = MODULE_Load( libname, (LPVOID)-1, 0 ); handle = MODULE_Load( libname, (LPVOID)-1, 0 );
if (handle == (HINSTANCE16)2) /* file not found */ if (handle == (HINSTANCE16)2) /* file not found */
@ -1544,7 +1547,7 @@ HINSTANCE32 WINAPI PrivateLoadLibrary(LPCSTR libname)
*/ */
void WINAPI FreeLibrary16( HINSTANCE16 handle ) void WINAPI FreeLibrary16( HINSTANCE16 handle )
{ {
dprintf_info(module,"FreeLibrary: %04x\n", handle ); TRACE(module,"%04x\n", handle );
FreeModule16( handle ); FreeModule16( handle );
} }
@ -1683,6 +1686,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
int iconic = (nCmdShow == SW_SHOWMINIMIZED || int iconic = (nCmdShow == SW_SHOWMINIMIZED ||
nCmdShow == SW_SHOWMINNOACTIVE); nCmdShow == SW_SHOWMINNOACTIVE);
THREAD_InitDone = FALSE; /* we didn't init this process */
/* get unixfilename */ /* get unixfilename */
if (strchr(filename, '/') || if (strchr(filename, '/') ||
strchr(filename, ':') || strchr(filename, ':') ||
@ -1758,16 +1762,16 @@ FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPSTR name )
hModule = MODULE_HANDLEtoHMODULE16(hModule); hModule = MODULE_HANDLEtoHMODULE16(hModule);
if (HIWORD(name)) { if (HIWORD(name)) {
ordinal = MODULE_GetOrdinal( hModule, name ); ordinal = MODULE_GetOrdinal( hModule, name );
dprintf_info(module, "WIN32_GetProcAddress16: %04x '%s'\n", TRACE(module, "%04x '%s'\n",
hModule, name ); hModule, name );
} else { } else {
ordinal = LOWORD(name); ordinal = LOWORD(name);
dprintf_info(module, "GetProcAddress: %04x %04x\n", TRACE(module, "%04x %04x\n",
hModule, ordinal ); hModule, ordinal );
} }
if (!ordinal) return (FARPROC16)0; if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal ); ret = MODULE_GetEntryPoint( hModule, ordinal );
dprintf_info(module,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret); TRACE(module,"returning %08x\n",(UINT32)ret);
return ret; return ret;
} }
@ -1785,20 +1789,20 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name )
if (HIWORD(name) != 0) if (HIWORD(name) != 0)
{ {
ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) ); ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
dprintf_info(module, "GetProcAddress: %04x '%s'\n", TRACE(module, "%04x '%s'\n",
hModule, (LPSTR)PTR_SEG_TO_LIN(name) ); hModule, (LPSTR)PTR_SEG_TO_LIN(name) );
} }
else else
{ {
ordinal = LOWORD(name); ordinal = LOWORD(name);
dprintf_info(module, "GetProcAddress: %04x %04x\n", TRACE(module, "%04x %04x\n",
hModule, ordinal ); hModule, ordinal );
} }
if (!ordinal) return (FARPROC16)0; if (!ordinal) return (FARPROC16)0;
ret = MODULE_GetEntryPoint( hModule, ordinal ); ret = MODULE_GetEntryPoint( hModule, ordinal );
dprintf_info(module, "GetProcAddress: returning %08x\n", (UINT32)ret ); TRACE(module, "returning %08x\n", (UINT32)ret );
return ret; return ret;
} }
@ -1811,9 +1815,9 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function )
NE_MODULE *pModule; NE_MODULE *pModule;
if (HIWORD(function)) if (HIWORD(function))
dprintf_info(win32,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function); TRACE(win32,"(%08lx,%s)\n",(DWORD)hModule,function);
else else
dprintf_info(win32,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function); TRACE(win32,"(%08lx,%p)\n",(DWORD)hModule,function);
if (!(pModule = MODULE_GetPtr( hModule ))) if (!(pModule = MODULE_GetPtr( hModule )))
return (FARPROC32)0; return (FARPROC32)0;
if (!pModule->module32) if (!pModule->module32)

View File

@ -54,7 +54,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (!pSeg->filepos) return TRUE; /* No file image, just return */ if (!pSeg->filepos) return TRUE; /* No file image, just return */
fd = MODULE_OpenFile( pModule->self ); fd = MODULE_OpenFile( pModule->self );
dprintf_info(module, "Loading segment %d, selector=%04x, flags=%04x\n", TRACE(module, "Loading segment %d, selector=%04x, flags=%04x\n",
segnum, pSeg->selector, pSeg->flags ); segnum, pSeg->selector, pSeg->flags );
lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET ); lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET );
if (pSeg->size) size = pSeg->size; if (pSeg->size) size = pSeg->size;
@ -115,7 +115,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
/* /*
The following bit of code for "iterated segments" was written without The following bit of code for "iterated segments" was written without
any documentation on the format of these segments. It seems to work, any documentation on the format of these segments. It seems to work,
but may be missing something. If you have any doco please either send but may be missing something. If you have any doc please either send
it to me or fix the code yourself. gfm@werple.mira.net.au it to me or fix the code yourself. gfm@werple.mira.net.au
*/ */
char* buff = xmalloc(size); char* buff = xmalloc(size);
@ -142,7 +142,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
read( fd, &count, sizeof(count) ); read( fd, &count, sizeof(count) );
if (!count) return TRUE; if (!count) return TRUE;
dprintf_info(fixup, "Fixups for %*.*s, segment %d, selector %04x\n", TRACE(fixup, "Fixups for %*.*s, segment %d, selector %04x\n",
*((BYTE *)pModule + pModule->name_table), *((BYTE *)pModule + pModule->name_table),
*((BYTE *)pModule + pModule->name_table), *((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1, (char *)pModule + pModule->name_table + 1,
@ -152,12 +152,12 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) != if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) !=
count * sizeof(struct relocation_entry_s)) count * sizeof(struct relocation_entry_s))
{ {
dprintf_warn(fixup, "Unable to read relocation information\n" ); WARN(fixup, "Unable to read relocation information\n" );
return FALSE; return FALSE;
} }
/* /*
* Go through the relocation table on entry at a time. * Go through the relocation table one entry at a time.
*/ */
rep = reloc_entries; rep = reloc_entries;
for (i = 0; i < count; i++, rep++) for (i = 0; i < count; i++, rep++)
@ -193,10 +193,10 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
(char *)pTarget + pTarget->name_table + 1, (char *)pTarget + pTarget->name_table + 1,
ordinal ); ordinal );
} }
if (debugging_info(fixup)) if (TRACE_ON(fixup))
{ {
NE_MODULE *pTarget = MODULE_GetPtr( module ); NE_MODULE *pTarget = MODULE_GetPtr( module );
dprintf_info(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1, TRACE(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, (char *)pTarget + pTarget->name_table + 1,
@ -214,17 +214,17 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
address = MODULE_GetEntryPoint( module, ordinal ); address = MODULE_GetEntryPoint( module, ordinal );
if (debugging_err(fixup) && !address) if (ERR_ON(fixup) && !address)
{ {
NE_MODULE *pTarget = MODULE_GetPtr( module ); NE_MODULE *pTarget = MODULE_GetPtr( module );
dprintf_err(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n", ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name ); (char *)pTarget + pTarget->name_table + 1, func_name );
} }
if (debugging_info(fixup)) if (TRACE_ON(fixup))
{ {
NE_MODULE *pTarget = MODULE_GetPtr( module ); NE_MODULE *pTarget = MODULE_GetPtr( module );
dprintf_info(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1, TRACE(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table), *((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, (char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address) ); func_name, HIWORD(address), LOWORD(address) );
@ -241,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 ); address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
} }
dprintf_info(fixup,"%d: %04x:%04x\n", TRACE(fixup,"%d: %04x:%04x\n",
i + 1, HIWORD(address), LOWORD(address) ); i + 1, HIWORD(address), LOWORD(address) );
break; break;
@ -254,14 +254,13 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
* successfully emulate the coprocessor if it doesn't * successfully emulate the coprocessor if it doesn't
* exist. * exist.
*/ */
dprintf_info(fixup, TRACE(fixup, "%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, "
"%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, TARGET %04x %04x\n", "TARGET %04x %04x\n", i + 1, rep->address_type,
i + 1, rep->address_type, rep->relocation_type, rep->relocation_type, rep->offset, rep->target1, rep->target2);
rep->offset, rep->target1, rep->target2);
continue; continue;
default: default:
dprintf_warn(fixup, "WARNING: %d: ADDR TYPE %d, " WARN(fixup, "WARNING: %d: ADDR TYPE %d, "
"unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n", "unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type, i + 1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2); rep->offset, rep->target1, rep->target2);
@ -282,7 +281,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_LOWBYTE: case NE_RADDR_LOWBYTE:
do { do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_info(fixup," %04x:%04x:%04x BYTE%s\n", TRACE(fixup," %04x:%04x:%04x BYTE%s\n",
pSeg->selector, offset, *sp, additive ? " additive":""); pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp; offset = *sp;
if(additive) if(additive)
@ -296,7 +295,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_OFFSET16: case NE_RADDR_OFFSET16:
do { do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_info(fixup," %04x:%04x:%04x OFFSET16%s\n", TRACE(fixup," %04x:%04x:%04x OFFSET16%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" ); pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp; offset = *sp;
*sp = LOWORD(address); *sp = LOWORD(address);
@ -308,7 +307,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_POINTER32: case NE_RADDR_POINTER32:
do { do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_info(fixup," %04x:%04x:%04x POINTER32%s\n", TRACE(fixup," %04x:%04x:%04x POINTER32%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" ); pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp; offset = *sp;
*sp = LOWORD(address); *sp = LOWORD(address);
@ -321,7 +320,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
case NE_RADDR_SELECTOR: case NE_RADDR_SELECTOR:
do { do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
dprintf_info(fixup," %04x:%04x:%04x SELECTOR%s\n", TRACE(fixup," %04x:%04x:%04x SELECTOR%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" ); pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp; offset = *sp;
*sp = HIWORD(address); *sp = HIWORD(address);
@ -334,7 +333,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
break; break;
default: default:
dprintf_warn(fixup, "WARNING: %d: unknown ADDR TYPE %d, " WARN(fixup, "WARNING: %d: unknown ADDR TYPE %d, "
"TYPE %d, OFFSET %04x, TARGET %04x %04x\n", "TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type, i + 1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2); rep->offset, rep->target1, rep->target2);
@ -367,7 +366,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
DWORD oldstack; DWORD oldstack;
WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector; WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector;
dprintf_info(module, "NE_LoadAllSegments: %.*s is a self-loading module!\n", TRACE(module, "%.*s is a self-loading module!\n",
*((BYTE*)pModule + pModule->name_table), *((BYTE*)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1); (char *)pModule + pModule->name_table + 1);
if (!NE_LoadSegment( pModule, 1 )) return FALSE; if (!NE_LoadSegment( pModule, 1 )) return FALSE;
@ -424,7 +423,7 @@ BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef; BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef;
memcpy( buffer, pstr + 1, *pstr ); memcpy( buffer, pstr + 1, *pstr );
strcpy( buffer + *pstr, ".dll" ); strcpy( buffer + *pstr, ".dll" );
dprintf_info(module, "Loading '%s'\n", buffer ); TRACE(module, "Loading '%s'\n", buffer );
if (!(*pModRef = MODULE_FindModule( buffer ))) if (!(*pModRef = MODULE_FindModule( buffer )))
{ {
/* If the DLL is not loaded yet, load it and store */ /* If the DLL is not loaded yet, load it and store */
@ -482,7 +481,7 @@ void NE_FixupPrologs( NE_MODULE *pModule )
if (pModule->flags & NE_FFLAGS_SINGLEDATA) if (pModule->flags & NE_FFLAGS_SINGLEDATA)
dgroup = pSegTable[pModule->dgroup-1].selector; dgroup = pSegTable[pModule->dgroup-1].selector;
dprintf_info(module, "MODULE_FixupPrologs(%04x)\n", pModule->self ); TRACE(module, "(%04x)\n", pModule->self );
p = (BYTE *)pModule + pModule->entry_table; p = (BYTE *)pModule + pModule->entry_table;
while (*p) while (*p)
{ {
@ -517,7 +516,7 @@ void NE_FixupPrologs( NE_MODULE *pModule )
fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) + fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) +
*(WORD *)(p + 1); *(WORD *)(p + 1);
} }
dprintf_info(module, "%s Signature: %02x %02x %02x,ff %x\n", TRACE(module, "%s Signature: %02x %02x %02x,ff %x\n",
dbg_str(module), fixup_ptr[0], fixup_ptr[1], dbg_str(module), fixup_ptr[0], fixup_ptr[1],
fixup_ptr[2], pModule->flags ); fixup_ptr[2], pModule->flags );
if (*p & 0x0001) if (*p & 0x0001)
@ -549,11 +548,11 @@ void NE_FixupPrologs( NE_MODULE *pModule )
} }
} }
} else { } else {
dprintf_warn(fixup, "Unknown signature\n" ); WARN(fixup, "Unknown signature\n" );
} }
} }
else else
dprintf_info(module,"\n"); TRACE(module,"\n");
p += (sel == 0xff) ? 6 : 3; p += (sel == 0xff) ? 6 : 3;
} }
} }
@ -635,7 +634,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule )
pModule->cs = 0; /* Don't initialize it twice */ pModule->cs = 0; /* Don't initialize it twice */
dprintf_info(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n", TRACE(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n",
CS_reg(&context), IP_reg(&context), DS_reg(&context), CS_reg(&context), IP_reg(&context), DS_reg(&context),
DI_reg(&context), CX_reg(&context) ); DI_reg(&context), CX_reg(&context) );
Callbacks->CallRegisterShortProc( &context, 0 ); Callbacks->CallRegisterShortProc( &context, 0 );

View File

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

View File

@ -74,20 +74,19 @@ void dump_exports( HMODULE32 hModule )
IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start); IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
Module = (char*)RVA(pe_exports->Name); Module = (char*)RVA(pe_exports->Name);
dprintf_info(win32,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n", TRACE(win32,"*******EXPORT DATA*******\n");
Module, TRACE(win32,"Module name is %s, %ld functions, %ld names\n",
pe_exports->NumberOfFunctions, Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames);
pe_exports->NumberOfNames);
ordinal=(u_short*) RVA(pe_exports->AddressOfNameOrdinals); ordinal=(u_short*) RVA(pe_exports->AddressOfNameOrdinals);
functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions); functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
name=(u_char**) RVA(pe_exports->AddressOfNames); name=(u_char**) RVA(pe_exports->AddressOfNames);
dprintf_info(win32," Ord RVA Addr Name\n" ); TRACE(win32," Ord RVA Addr Name\n" );
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++) for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
{ {
if (!*function) continue; /* No such function */ if (!*function) continue; /* No such function */
if (debugging_info(win32)){ if (TRACE_ON(win32)){
dbg_decl_str(win32, 1024); dbg_decl_str(win32, 1024);
dsprintf(win32,"%4ld %08lx %08x", dsprintf(win32,"%4ld %08lx %08x",
@ -98,7 +97,7 @@ void dump_exports( HMODULE32 hModule )
dsprintf(win32, " %s", (char*)RVA(name[j]) ); dsprintf(win32, " %s", (char*)RVA(name[j]) );
if ((*function >= rva_start) && (*function <= rva_end)) if ((*function >= rva_start) && (*function <= rva_end))
dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function)); dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function));
dprintf_info(win32,"%s\n", dbg_str(win32)); TRACE(win32,"%s\n", dbg_str(win32));
} }
} }
} }
@ -135,9 +134,9 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
exports = pem->pe_export; exports = pem->pe_export;
if (HIWORD(funcName)) if (HIWORD(funcName))
dprintf_info(win32,"PE_FindExportedFunction(%s)\n",funcName); TRACE(win32,"(%s)\n",funcName);
else else
dprintf_info(win32,"PE_FindExportedFunction(%d)\n",(int)funcName); TRACE(win32,"(%d)\n",(int)funcName);
if (!exports) { if (!exports) {
fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem); fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem);
return NULL; return NULL;
@ -168,7 +167,7 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
} }
} else { } else {
if (LOWORD(funcName)-exports->Base > exports->NumberOfFunctions) { if (LOWORD(funcName)-exports->Base > exports->NumberOfFunctions) {
dprintf_info(win32," ordinal %d out of range!\n", TRACE(win32," ordinal %d out of range!\n",
LOWORD(funcName)); LOWORD(funcName));
return NULL; return NULL;
} }
@ -192,7 +191,7 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule,
return NULL; return NULL;
} }
DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) DWORD fixup_imports (PDB32 *process,PE_MODREF *pem)
{ {
IMAGE_IMPORT_DESCRIPTOR *pe_imp; IMAGE_IMPORT_DESCRIPTOR *pe_imp;
int fixup_failed = 0; int fixup_failed = 0;
@ -206,12 +205,12 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
modname = "<unknown>"; modname = "<unknown>";
/* OK, now dump the import list */ /* OK, now dump the import list */
dprintf_info(win32, "\nDumping imports list\n"); TRACE(win32, "Dumping imports list\n");
/* first, count the number of imported non-internal modules */ /* first, count the number of imported non-internal modules */
pe_imp = pem->pe_import; pe_imp = pem->pe_import;
if (!pe_imp) if (!pe_imp)
fprintf(stderr,"no import directory????\n"); ERR(win32, "no import directory????\n");
/* FIXME: should terminate on 0 Characteristics */ /* FIXME: should terminate on 0 Characteristics */
for (i = 0; pe_imp->Name; pe_imp++) for (i = 0; pe_imp->Name; pe_imp++)
@ -232,14 +231,18 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
/* don't use MODULE_Load, Win32 creates new task differently */ /* don't use MODULE_Load, Win32 creates new task differently */
res = PE_LoadLibraryEx32A( name, process, 0, 0 ); res = PE_LoadLibraryEx32A( name, process, 0, 0 );
if (res <= (HMODULE32) 32) { if (res <= (HMODULE32) 32) {
char *p, buffer[1024]; char buffer[1024];
/* Try with prepending the path of the current module */ /* Try with prepending the path of the current module */
GetModuleFileName32A( hModule, buffer, sizeof (buffer)); if (GetModuleFileName32A( pem->module, buffer, sizeof (buffer))) {
char *p;
if (!(p = strrchr (buffer, '\\'))) if (!(p = strrchr (buffer, '\\')))
p = buffer; p = buffer;
strcpy (p + 1, name); strcpy (p + 1, name);
res = PE_LoadLibraryEx32A( buffer, process, 0, 0 ); res = PE_LoadLibraryEx32A( buffer, process, 0, 0 );
} else
ERR(win32,"cannot find the module just loaded!\n");
} }
if (res <= (HMODULE32) 32) { if (res <= (HMODULE32) 32) {
fprintf (stderr, "Module %s not found\n", name); fprintf (stderr, "Module %s not found\n", name);
@ -285,12 +288,12 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
Module = (char *) RVA(pe_imp->Name); Module = (char *) RVA(pe_imp->Name);
hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) ); hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) );
dprintf_info(win32, "%s\n", Module); TRACE(win32, "%s\n", Module);
/* FIXME: forwarder entries ... */ /* FIXME: forwarder entries ... */
if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */ if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */
dprintf_info(win32, "Microsoft style imports used\n"); TRACE(win32, "Microsoft style imports used\n");
import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk); import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk); thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
@ -298,7 +301,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) { if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal); int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
dprintf_info(win32, "--- Ordinal %s,%d\n", Module, ordinal); TRACE(win32, "--- Ordinal %s,%d\n", Module, ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR)ordinal); process, hImpModule, (LPCSTR)ordinal);
if (!thunk_list->u1.Function) { if (!thunk_list->u1.Function) {
@ -308,7 +311,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
} }
} else { /* import by name */ } else { /* import by name */
pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData); pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
dprintf_info(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint); TRACE(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name); process, hImpModule, pe_name->Name);
if (!thunk_list->u1.Function) { if (!thunk_list->u1.Function) {
@ -321,14 +324,14 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
thunk_list++; thunk_list++;
} }
} else { /* Borland style */ } else { /* Borland style */
dprintf_info(win32, "Borland style imports used\n"); TRACE(win32, "Borland style imports used\n");
thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk); thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
while (thunk_list->u1.Ordinal) { while (thunk_list->u1.Ordinal) {
if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) { if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
/* not sure about this branch, but it seems to work */ /* not sure about this branch, but it seems to work */
int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal); int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal);
dprintf_info(win32,"--- Ordinal %s.%d\n",Module,ordinal); TRACE(win32,"--- Ordinal %s.%d\n",Module,ordinal);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, (LPCSTR) ordinal); process, hImpModule, (LPCSTR) ordinal);
if (!thunk_list->u1.Function) { if (!thunk_list->u1.Function) {
@ -338,7 +341,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule)
} }
} else { } else {
pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData); pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
dprintf_info(win32,"--- %s %s.%d\n", TRACE(win32,"--- %s %s.%d\n",
pe_name->Name,Module,pe_name->Hint); pe_name->Name,Module,pe_name->Hint);
thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction(
process, hImpModule, pe_name->Name ); process, hImpModule, pe_name->Name );
@ -362,11 +365,11 @@ static int calc_vma_size( HMODULE32 hModule )
int i,vma_size = 0; int i,vma_size = 0;
IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule); IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule);
dprintf_info(win32, "Dump of segment table\n"); TRACE(win32, "Dump of segment table\n");
dprintf_info(win32, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n"); TRACE(win32, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n");
for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++) for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
{ {
dprintf_info(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", TRACE(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->Name,
pe_seg->Misc.VirtualSize, pe_seg->Misc.VirtualSize,
pe_seg->VirtualAddress, pe_seg->VirtualAddress,
@ -401,14 +404,14 @@ static void do_relocations(PE_MODREF *pem)
char *page = (char*) RVA(r->VirtualAddress); char *page = (char*) RVA(r->VirtualAddress);
int count = (r->SizeOfBlock - 8)/2; int count = (r->SizeOfBlock - 8)/2;
int i; int i;
dprintf_info(fixup, "%x relocations for page %lx\n", TRACE(fixup, "%x relocations for page %lx\n",
count, r->VirtualAddress); count, r->VirtualAddress);
/* patching in reverse order */ /* patching in reverse order */
for(i=0;i<count;i++) for(i=0;i<count;i++)
{ {
int offset = r->TypeOffset[i] & 0xFFF; int offset = r->TypeOffset[i] & 0xFFF;
int type = r->TypeOffset[i] >> 12; int type = r->TypeOffset[i] >> 12;
dprintf_info(fixup,"patching %x type %x\n", offset, type); TRACE(fixup,"patching %x type %x\n", offset, type);
switch(type) switch(type)
{ {
case IMAGE_REL_BASED_ABSOLUTE: break; case IMAGE_REL_BASED_ABSOLUTE: break;
@ -545,7 +548,7 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
load_addr = nt_header->OptionalHeader.ImageBase; load_addr = nt_header->OptionalHeader.ImageBase;
vma_size = calc_vma_size( hModule ); vma_size = calc_vma_size( hModule );
dprintf_info(win32, "Load addr is %lx\n",load_addr); TRACE(win32, "Load addr is %lx\n",load_addr);
load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size, load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size,
MEM_RESERVE | MEM_COMMIT, MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE ); PAGE_EXECUTE_READWRITE );
@ -559,7 +562,7 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
*/ */
pem->module = *phModule = (HMODULE32)load_addr; pem->module = *phModule = (HMODULE32)load_addr;
dprintf_info(win32, "Load addr is really %lx, range %x\n", TRACE(win32, "Load addr is really %lx, range %x\n",
load_addr, vma_size); load_addr, vma_size);
/* Store the NT header at the load addr /* Store the NT header at the load addr
@ -635,10 +638,10 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
} }
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size) if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size)
dprintf_fixme(win32,"Exception directory ignored\n"); FIXME(win32,"Exception directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size) if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size)
dprintf_fixme(win32,"Security directory ignored\n"); FIXME(win32,"Security directory ignored\n");
@ -652,34 +655,34 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
if(nt_header->OptionalHeader.DataDirectory if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size) [IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size)
dprintf_fixme(win32,"Copyright string ignored\n"); FIXME(win32,"Copyright string ignored\n");
if(nt_header->OptionalHeader.DataDirectory if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size) [IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size)
dprintf_fixme(win32,"Global Pointer (MIPS) ignored\n"); FIXME(win32,"Global Pointer (MIPS) ignored\n");
if(nt_header->OptionalHeader.DataDirectory if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size) [IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size)
dprintf_fixme(win32,"Load Configuration directory ignored\n"); FIXME(win32,"Load Configuration directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size) [IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size)
dprintf_fixme(win32,"Bound Import directory ignored\n"); FIXME(win32,"Bound Import directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory if(nt_header->OptionalHeader.DataDirectory
[IMAGE_DIRECTORY_ENTRY_IAT].Size) [IMAGE_DIRECTORY_ENTRY_IAT].Size)
dprintf_fixme(win32,"Import Address Table directory ignored\n"); FIXME(win32,"Import Address Table directory ignored\n");
if(nt_header->OptionalHeader.DataDirectory[13].Size) if(nt_header->OptionalHeader.DataDirectory[13].Size)
dprintf_fixme(win32,"Unknown directory 13 ignored\n"); FIXME(win32,"Unknown directory 13 ignored\n");
if(nt_header->OptionalHeader.DataDirectory[14].Size) if(nt_header->OptionalHeader.DataDirectory[14].Size)
dprintf_fixme(win32,"Unknown directory 14 ignored\n"); FIXME(win32,"Unknown directory 14 ignored\n");
if(nt_header->OptionalHeader.DataDirectory[15].Size) if(nt_header->OptionalHeader.DataDirectory[15].Size)
dprintf_fixme(win32,"Unknown directory 15 ignored\n"); FIXME(win32,"Unknown directory 15 ignored\n");
if(pem->pe_reloc) do_relocations(pem); if(pem->pe_reloc) do_relocations(pem);
if(pem->pe_export) dump_exports(pem->module); if(pem->pe_export) dump_exports(pem->module);
if(pem->pe_import) { if(pem->pe_import) {
if (fixup_imports(process,pem,hModule)) { if (fixup_imports(process,pem)) {
PE_MODREF **xpem; PE_MODREF **xpem;
/* remove entry from modref chain */ /* remove entry from modref chain */
@ -869,7 +872,7 @@ static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved)
) { ) {
FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module, FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module,
OptionalHeader.AddressOfEntryPoint ); OptionalHeader.AddressOfEntryPoint );
dprintf_info(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n", TRACE(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
entry, pem->module, type, lpReserved ); entry, pem->module, type, lpReserved );
entry( pem->module, type, lpReserved ); entry( pem->module, type, lpReserved );
} }

View File

@ -45,7 +45,7 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
char *ptr = PTR_SEG_TO_LIN( name ); char *ptr = PTR_SEG_TO_LIN( name );
if (ptr[0] == '#') if (ptr[0] == '#')
if (!(name = (SEGPTR)atoi( ptr + 1 ))) { if (!(name = (SEGPTR)atoi( ptr + 1 ))) {
dprintf_warn(resource, "Incorrect resource name: %s\n", ptr); WARN(resource, "Incorrect resource name: %s\n", ptr);
return 0; return 0;
} }
} }
@ -55,12 +55,12 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
char *ptr = PTR_SEG_TO_LIN( type ); char *ptr = PTR_SEG_TO_LIN( type );
if (ptr[0] == '#') if (ptr[0] == '#')
if (!(type = (SEGPTR)atoi( ptr + 1 ))){ if (!(type = (SEGPTR)atoi( ptr + 1 ))){
dprintf_warn(resource, "Incorrect resource type: %s\n", ptr); WARN(resource, "Incorrect resource type: %s\n", ptr);
return 0; return 0;
} }
} }
dprintf_info(resource, "FindResource16: module=%04x name=%s type=%s\n", TRACE(resource, "module=%04x name=%s type=%s\n",
hModule, debugres(PTR_SEG_TO_LIN(name)), hModule, debugres(PTR_SEG_TO_LIN(name)),
debugres(PTR_SEG_TO_LIN(type)) ); debugres(PTR_SEG_TO_LIN(type)) );
@ -125,7 +125,7 @@ HRSRC32 WINAPI FindResourceEx32W( HINSTANCE32 hModule, LPCWSTR name,
if (!hModule) hModule = GetTaskDS(); if (!hModule) hModule = GetTaskDS();
hModule = MODULE_HANDLEtoHMODULE32( hModule ); hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_info(resource, "FindResource32W: module=%08x " TRACE(resource, "module=%08x "
"type=%s%p name=%s%p\n", hModule, "type=%s%p name=%s%p\n", hModule,
(HIWORD(type))? "" : "#", type, (HIWORD(type))? "" : "#", type,
(HIWORD(name))? "" : "#", name); (HIWORD(name))? "" : "#", name);
@ -154,7 +154,7 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
NE_MODULE *pModule; NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule ); hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_info(resource, "LoadResource16: module=%04x res=%04x\n", TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!hRsrc) return 0; if (!hRsrc) return 0;
if ((pModule = MODULE_GetPtr( hModule ))) if ((pModule = MODULE_GetPtr( hModule )))
@ -182,7 +182,7 @@ HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */ if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */
hModule = MODULE_HANDLEtoHMODULE32( hModule ); hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_info(resource, "LoadResource32: module=%04x res=%04x\n", TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!hRsrc) return 0; if (!hRsrc) return 0;
@ -207,7 +207,7 @@ SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16 handle)
HMODULE16 hModule; HMODULE16 hModule;
NE_MODULE *pModule; NE_MODULE *pModule;
dprintf_info(resource, "LockResource: handle=%04x\n", handle ); TRACE(resource, "handle=%04x\n", handle );
if (!handle) return (SEGPTR)0; if (!handle) return (SEGPTR)0;
hModule = MODULE_HANDLEtoHMODULE16( handle ); hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@ -227,7 +227,7 @@ LPVOID WINAPI LockResource16( HGLOBAL16 handle )
HMODULE16 hModule; HMODULE16 hModule;
NE_MODULE *pModule; NE_MODULE *pModule;
dprintf_info(resource, "LockResource: handle=%04x\n", handle ); TRACE(resource, "handle=%04x\n", handle );
if (!handle) return NULL; if (!handle) return NULL;
hModule = MODULE_HANDLEtoHMODULE16( handle ); hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@ -261,7 +261,7 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle )
HMODULE16 hModule; HMODULE16 hModule;
NE_MODULE *pModule; NE_MODULE *pModule;
dprintf_info(resource, "FreeResource16: handle=%04x\n", handle ); TRACE(resource, "handle=%04x\n", handle );
if (!handle) return FALSE; if (!handle) return FALSE;
hModule = MODULE_HANDLEtoHMODULE16( handle ); hModule = MODULE_HANDLEtoHMODULE16( handle );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@ -293,7 +293,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
NE_MODULE *pModule; NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule ); hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_info(resource, "AccessResource16: module=%04x res=%04x\n", TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!hRsrc) return 0; if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@ -316,7 +316,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc ) INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{ {
hModule = MODULE_HANDLEtoHMODULE32( hModule ); hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_info(resource, "AccessResource: module=%04x res=%04x\n", TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!hRsrc) return 0; if (!hRsrc) return 0;
fprintf(stderr,"AccessResource32: not implemented\n"); fprintf(stderr,"AccessResource32: not implemented\n");
@ -332,7 +332,7 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
NE_MODULE *pModule; NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule ); hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_info(resource, "SizeofResource16: module=%04x res=%04x\n", TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
if (!__winelib) if (!__winelib)
@ -354,7 +354,7 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc )
DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc ) DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc )
{ {
hModule = MODULE_HANDLEtoHMODULE32( hModule ); hModule = MODULE_HANDLEtoHMODULE32( hModule );
dprintf_info(resource, "SizeofResource32: module=%04x res=%04x\n", TRACE(resource, "module=%04x res=%04x\n",
hModule, hRsrc ); hModule, hRsrc );
if (!__winelib) return PE_SizeofResource32(hModule,hRsrc); if (!__winelib) return PE_SizeofResource32(hModule,hRsrc);
else else
@ -373,7 +373,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
NE_MODULE *pModule; NE_MODULE *pModule;
hModule = MODULE_HANDLEtoHMODULE16( hModule ); hModule = MODULE_HANDLEtoHMODULE16( hModule );
dprintf_info(resource, "AllocResource: module=%04x res=%04x size=%ld\n", TRACE(resource, "module=%04x res=%04x size=%ld\n",
hModule, hRsrc, size ); hModule, hRsrc, size );
if (!hRsrc) return 0; if (!hRsrc) return 0;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
@ -397,7 +397,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size)
HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType, HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
UINT16 wSize ) UINT16 wSize )
{ {
dprintf_info(resource,"DirectResAlloc(%04x,%04x,%04x)\n", TRACE(resource,"(%04x,%04x,%04x)\n",
hInstance, wType, wSize ); hInstance, wType, wSize );
hInstance = MODULE_HANDLEtoHMODULE16(hInstance); hInstance = MODULE_HANDLEtoHMODULE16(hInstance);
if(!hInstance)return 0; if(!hInstance)return 0;
@ -416,10 +416,10 @@ HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, SEGPTR lpTableName)
HRSRC16 hRsrc; HRSRC16 hRsrc;
if (HIWORD(lpTableName)) if (HIWORD(lpTableName))
dprintf_info(accel, "LoadAccelerators: %04x '%s'\n", TRACE(accel, "%04x '%s'\n",
instance, (char *)PTR_SEG_TO_LIN( lpTableName ) ); instance, (char *)PTR_SEG_TO_LIN( lpTableName ) );
else else
dprintf_info(accel, "LoadAccelerators: %04x %04x\n", TRACE(accel, "%04x %04x\n",
instance, LOWORD(lpTableName) ); instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR ))) if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR )))
@ -441,10 +441,10 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName)
HRSRC32 hRsrc; HRSRC32 hRsrc;
if (HIWORD(lpTableName)) if (HIWORD(lpTableName))
dprintf_info(accel, "LoadAccelerators: %04x '%s'\n", TRACE(accel, "%04x '%s'\n",
instance, (char *)( lpTableName ) ); instance, (char *)( lpTableName ) );
else else
dprintf_info(accel, "LoadAccelerators: %04x %04x\n", TRACE(accel, "%04x %04x\n",
instance, LOWORD(lpTableName) ); instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource32W( instance, lpTableName, if (!(hRsrc = FindResource32W( instance, lpTableName,
@ -505,7 +505,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
int string_num; int string_num;
int i; int i;
dprintf_info(resource,"LoadString: inst=%04x id=%04x buff=%08x len=%d\n", TRACE(resource,"inst=%04x id=%04x buff=%08x len=%d\n",
instance, resource_id, (int) buffer, buflen); instance, resource_id, (int) buffer, buflen);
hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING ); hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING );
@ -518,7 +518,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
for (i = 0; i < string_num; i++) for (i = 0; i < string_num; i++)
p += *p + 1; p += *p + 1;
dprintf_info(resource, "strlen = %d\n", (int)*p ); TRACE(resource, "strlen = %d\n", (int)*p );
i = MIN(buflen - 1, *p); i = MIN(buflen - 1, *p);
if (buffer == NULL) if (buffer == NULL)
@ -536,7 +536,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
} }
FreeResource16( hmem ); FreeResource16( hmem );
dprintf_info(resource,"LoadString // '%s' copied !\n", buffer); TRACE(resource,"'%s' copied !\n", buffer);
return i; return i;
} }
@ -554,7 +554,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */ if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */
resource_id = (UINT32)(-((INT32)resource_id)); resource_id = (UINT32)(-((INT32)resource_id));
dprintf_info(resource, "LoadString: instance = %04x, id = %04x, buffer = %08x, " TRACE(resource, "instance = %04x, id = %04x, buffer = %08x, "
"length = %d\n", instance, (int)resource_id, (int) buffer, buflen); "length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1), hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1),
@ -568,7 +568,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
for (i = 0; i < string_num; i++) for (i = 0; i < string_num; i++)
p += *p + 1; p += *p + 1;
dprintf_info(resource, "strlen = %d\n", (int)*p ); TRACE(resource, "strlen = %d\n", (int)*p );
i = MIN(buflen - 1, *p); i = MIN(buflen - 1, *p);
if (buffer == NULL) if (buffer == NULL)
@ -587,7 +587,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
#endif #endif
} }
#if 0 #if 0
dprintf_info(resource,"LoadString // '%s' copied !\n", buffer); TRACE(resource,"'%s' copied !\n", buffer);
#endif #endif
return i; return i;
} }
@ -658,7 +658,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
CHAR str[1]; CHAR str[1];
} *stre; } *stre;
dprintf_info(resource, "LoadMessage: instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen); TRACE(resource, "instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
/*FIXME: I am not sure about the '1' ... But I've only seen those entries*/ /*FIXME: I am not sure about the '1' ... But I've only seen those entries*/
hrsrc = FindResourceEx32W(instance,(LPWSTR)1,(LPCWSTR)RT_MESSAGELIST,lang); hrsrc = FindResourceEx32W(instance,(LPWSTR)1,(LPCWSTR)RT_MESSAGELIST,lang);
@ -686,7 +686,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
stre = (struct _stringentry*)(((char*)stre)+slen); stre = (struct _stringentry*)(((char*)stre)+slen);
} }
slen=stre->len; slen=stre->len;
dprintf_info(resource," - strlen=%d\n",slen); TRACE(resource," - strlen=%d\n",slen);
i = MIN(buflen - 1, slen); i = MIN(buflen - 1, slen);
if (buffer == NULL) if (buffer == NULL)
return slen; /* different to LoadString */ return slen; /* different to LoadString */
@ -700,7 +700,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
} }
} }
if (buffer) if (buffer)
dprintf_info(resource,"LoadMessage // '%s' copied !\n", buffer); TRACE(resource,"'%s' copied !\n", buffer);
return i; return i;
} }
@ -737,7 +737,7 @@ FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR s,
hModule = GetExePtr( hModule ); hModule = GetExePtr( hModule );
dprintf_info(resource, "SetResourceHandler: module=%04x type=%s\n", TRACE(resource, "module=%04x type=%s\n",
hModule, debugres(PTR_SEG_TO_LIN(s)) ); hModule, debugres(PTR_SEG_TO_LIN(s)) );
if ((pModule = MODULE_GetPtr( hModule ))) if ((pModule = MODULE_GetPtr( hModule )))

View File

@ -26,6 +26,8 @@
#endif #endif
#include "miscemu.h" #include "miscemu.h"
#include "selectors.h"
#include "sig_context.h"
#include "winsock.h" #include "winsock.h"
@ -83,8 +85,9 @@ static char SIGNAL_Stack[16384];
* *
* wait4 terminated child processes * wait4 terminated child processes
*/ */
static void SIGNAL_child(void) static HANDLER_DEF(SIGNAL_child)
{ {
HANDLER_INIT();
#ifdef HAVE_WAIT4 #ifdef HAVE_WAIT4
wait4( 0, NULL, WNOHANG, NULL); wait4( 0, NULL, WNOHANG, NULL);
#elif defined (HAVE_WAITPID) #elif defined (HAVE_WAITPID)

View File

@ -176,9 +176,9 @@ static HGLOBAL16 TASK_CreateDOSEnvironment(void)
/* Display it */ /* Display it */
p = (char *) GlobalLock16( handle ); p = (char *) GlobalLock16( handle );
dprintf_info(task, "Master DOS environment at %p\n", p); TRACE(task, "Master DOS environment at %p\n", p);
for (; *p; p += strlen(p) + 1) dprintf_info(task, " %s\n", p); for (; *p; p += strlen(p) + 1) TRACE(task, " %s\n", p);
dprintf_info(task, "Progname: %s\n", p+3 ); TRACE(task, "Progname: %s\n", p+3 );
return handle; return handle;
} }
@ -347,7 +347,7 @@ static void TASK_CallToStart(void)
InitApp( pTask->hModule ); InitApp( pTask->hModule );
PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, (LPVOID)-1 ); PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, (LPVOID)-1 );
dprintf_info(relay, "CallTo32(entryproc=%p)\n", entry ); TRACE(relay, "(entryproc=%p)\n", entry );
exit_code = entry(); exit_code = entry();
TASK_KillCurrentTask( exit_code ); TASK_KillCurrentTask( exit_code );
} }
@ -376,7 +376,7 @@ static void TASK_CallToStart(void)
ECX_reg(&context) = pModule->heap_size; ECX_reg(&context) = pModule->heap_size;
EDI_reg(&context) = context.SegDs; EDI_reg(&context) = context.SegDs;
dprintf_info(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n", TRACE(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n",
CS_reg(&context), IP_reg(&context), DS_reg(&context), CS_reg(&context), IP_reg(&context), DS_reg(&context),
SELECTOROF(pTask->thdb->cur_stack), SELECTOROF(pTask->thdb->cur_stack),
OFFSETOF(pTask->thdb->cur_stack) ); OFFSETOF(pTask->thdb->cur_stack) );
@ -563,7 +563,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
TASK_LinkTask( hTask ); TASK_LinkTask( hTask );
dprintf_info(task, "CreateTask: module='%s' cmdline='%s' task=%04x\n", TRACE(task, "module='%s' cmdline='%s' task=%04x\n",
name, cmdLine, hTask ); name, cmdLine, hTask );
return hTask; return hTask;
@ -621,7 +621,7 @@ void TASK_KillCurrentTask( INT16 exitCode )
TDB* pTask = (TDB*) GlobalLock16( hCurrentTask ); TDB* pTask = (TDB*) GlobalLock16( hCurrentTask );
if (!pTask) USER_ExitWindows(); /* No current task yet */ if (!pTask) USER_ExitWindows(); /* No current task yet */
dprintf_info(task, "Killing task %04x\n", hCurrentTask ); TRACE(task, "Killing task %04x\n", hCurrentTask );
/* Delete active sockets */ /* Delete active sockets */
@ -643,7 +643,7 @@ void TASK_KillCurrentTask( INT16 exitCode )
if (nTaskCount <= 1) if (nTaskCount <= 1)
{ {
dprintf_info(task, "\nthis is the last task, exiting\n" ); TRACE(task, "this is the last task, exiting\n" );
USER_ExitWindows(); USER_ExitWindows();
} }
@ -724,7 +724,7 @@ void TASK_Reschedule(void)
{ {
pNewTask = (TDB *)GlobalLock16( hTask ); pNewTask = (TDB *)GlobalLock16( hTask );
dprintf_info(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents); TRACE(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents);
if (pNewTask->nEvents) break; if (pNewTask->nEvents) break;
hTask = pNewTask->hNext; hTask = pNewTask->hNext;
@ -739,11 +739,11 @@ void TASK_Reschedule(void)
if (hTask == hCurrentTask) if (hTask == hCurrentTask)
{ {
dprintf_info(task, "returning to the current task(%04x)\n", hTask ); TRACE(task, "returning to the current task(%04x)\n", hTask );
return; /* Nothing to do */ return; /* Nothing to do */
} }
pNewTask = (TDB *)GlobalLock16( hTask ); pNewTask = (TDB *)GlobalLock16( hTask );
dprintf_info(task, "Switching to task %04x (%.8s)\n", TRACE(task, "Switching to task %04x (%.8s)\n",
hTask, pNewTask->module_name ); hTask, pNewTask->module_name );
/* Make the task the last in the linked list (round-robin scheduling) */ /* Make the task the last in the linked list (round-robin scheduling) */
@ -1012,7 +1012,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
thunk = PTR_SEG_TO_LIN( thunkaddr ); thunk = PTR_SEG_TO_LIN( thunkaddr );
lfunc = PTR_SEG_TO_LIN( func ); lfunc = PTR_SEG_TO_LIN( func );
dprintf_info(task, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n", TRACE(task, "(%08lx,%04x): got thunk %08lx\n",
(DWORD)func, hInstance, (DWORD)thunkaddr ); (DWORD)func, hInstance, (DWORD)thunkaddr );
if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) || if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) ||
((lfunc[0]==0x1e) && (lfunc[1]==0x58)) ((lfunc[0]==0x1e) && (lfunc[1]==0x58))
@ -1036,7 +1036,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
*/ */
void WINAPI FreeProcInstance16( FARPROC16 func ) void WINAPI FreeProcInstance16( FARPROC16 func )
{ {
dprintf_info(task, "FreeProcInstance(%08lx)\n", (DWORD)func ); TRACE(task, "(%08lx)\n", (DWORD)func );
if (!__winelib) TASK_FreeThunk( hCurrentTask, (SEGPTR)func ); if (!__winelib) TASK_FreeThunk( hCurrentTask, (SEGPTR)func );
} }
@ -1118,7 +1118,7 @@ void WINAPI SwitchStackTo( WORD seg, WORD ptr, WORD top )
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return; if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return;
if (!(pData = (INSTANCEDATA *)GlobalLock16( seg ))) return; if (!(pData = (INSTANCEDATA *)GlobalLock16( seg ))) return;
dprintf_info(task, "SwitchStackTo: old=%04x:%04x new=%04x:%04x\n", TRACE(task, "old=%04x:%04x new=%04x:%04x\n",
SELECTOROF( pTask->thdb->cur_stack ), SELECTOROF( pTask->thdb->cur_stack ),
OFFSETOF( pTask->thdb->cur_stack ), seg, ptr ); OFFSETOF( pTask->thdb->cur_stack ), seg, ptr );
@ -1167,7 +1167,7 @@ void WINAPI SwitchStackBack(void)
fprintf( stderr, "SwitchStackBack: no previous SwitchStackTo\n" ); fprintf( stderr, "SwitchStackBack: no previous SwitchStackTo\n" );
return; return;
} }
dprintf_info(task, "SwitchStackBack: restoring stack %04x:%04x\n", TRACE(task, "restoring stack %04x:%04x\n",
SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) ); SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) );
oldFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack ); oldFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
@ -1181,7 +1181,7 @@ void WINAPI SwitchStackBack(void)
newFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack ); newFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
newFrame->frame32 = oldFrame->frame32; newFrame->frame32 = oldFrame->frame32;
if (debugging_info(relay)) if (TRACE_ON(relay))
{ {
newFrame->entry_ip = oldFrame->entry_ip; newFrame->entry_ip = oldFrame->entry_ip;
newFrame->entry_cs = oldFrame->entry_cs; newFrame->entry_cs = oldFrame->entry_cs;
@ -1446,7 +1446,7 @@ BOOL16 WINAPI TaskNext( TASKENTRY *lpte )
TDB *pTask; TDB *pTask;
INSTANCEDATA *pInstData; INSTANCEDATA *pInstData;
dprintf_info(toolhelp, "TaskNext(%p): task=%04x\n", lpte, lpte->hNext ); TRACE(toolhelp, "(%p): task=%04x\n", lpte, lpte->hNext );
if (!lpte->hNext) return FALSE; if (!lpte->hNext) return FALSE;
pTask = (TDB *)GlobalLock16( lpte->hNext ); pTask = (TDB *)GlobalLock16( lpte->hNext );
if (!pTask || pTask->magic != TDB_MAGIC) return FALSE; if (!pTask || pTask->magic != TDB_MAGIC) return FALSE;

View File

@ -186,7 +186,7 @@ HGLOBAL16 GLOBAL_Alloc( UINT16 flags, DWORD size, HGLOBAL16 hOwner,
HGLOBAL16 handle; HGLOBAL16 handle;
SHMDATA shmdata; SHMDATA shmdata;
dprintf_info(global, "GlobalAlloc: %ld flags=%04x\n", size, flags ); TRACE(global, "%ld flags=%04x\n", size, flags );
/* If size is 0, create a discarded block */ /* If size is 0, create a discarded block */
@ -293,7 +293,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags )
GLOBALARENA *pArena, *pNewArena; GLOBALARENA *pArena, *pNewArena;
WORD sel = GlobalHandleToSel( handle ); WORD sel = GlobalHandleToSel( handle );
dprintf_info(global, "GlobalReAlloc16: %04x %ld flags=%04x\n", TRACE(global, "%04x %ld flags=%04x\n",
handle, size, flags ); handle, size, flags );
if (!handle) return 0; if (!handle) return 0;
@ -350,7 +350,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags )
ptr = (void *)pArena->base; ptr = (void *)pArena->base;
oldsize = pArena->size; oldsize = pArena->size;
dprintf_info(global,"oldsize %08lx\n",oldsize); TRACE(global,"oldsize %08lx\n",oldsize);
if (ptr && (size == oldsize)) return handle; /* Nothing to do */ if (ptr && (size == oldsize)) return handle; /* Nothing to do */
ptr = HeapReAlloc( SystemHeap, 0, ptr, size ); ptr = HeapReAlloc( SystemHeap, 0, ptr, size );
@ -409,7 +409,7 @@ HGLOBAL16 WINAPI GlobalFree16( HGLOBAL16 handle )
} }
ptr = (void *)GET_ARENA_PTR(handle)->base; ptr = (void *)GET_ARENA_PTR(handle)->base;
dprintf_info(global, "GlobalFree16: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!GLOBAL_FreeBlock( handle )) return handle; /* failed */ if (!GLOBAL_FreeBlock( handle )) return handle; /* failed */
#ifdef CONFIG_IPC #ifdef CONFIG_IPC
if (is_dde_handle(handle)) return DDE_GlobalFree(handle); if (is_dde_handle(handle)) return DDE_GlobalFree(handle);
@ -426,7 +426,7 @@ HGLOBAL16 WINAPI GlobalFree16( HGLOBAL16 handle )
*/ */
SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle ) SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle )
{ {
dprintf_info(global, "WIN16_GlobalLock16(%04x) -> %08lx\n", TRACE(global, "(%04x) -> %08lx\n",
handle, MAKELONG( 0, GlobalHandleToSel(handle)) ); handle, MAKELONG( 0, GlobalHandleToSel(handle)) );
if (handle) if (handle)
{ {
@ -478,7 +478,7 @@ BOOL16 WINAPI GlobalUnlock16( HGLOBAL16 handle )
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnlock16!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnlock16!\n",handle);
return 0; return 0;
} }
dprintf_info(global, "GlobalUnlock16: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (pArena->lockCount) pArena->lockCount--; if (pArena->lockCount) pArena->lockCount--;
return pArena->lockCount; return pArena->lockCount;
} }
@ -489,7 +489,7 @@ BOOL16 WINAPI GlobalUnlock16( HGLOBAL16 handle )
*/ */
DWORD WINAPI GlobalSize16( HGLOBAL16 handle ) DWORD WINAPI GlobalSize16( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalSize16: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!handle) return 0; if (!handle) return 0;
if (!VALID_HANDLE(handle)) if (!VALID_HANDLE(handle))
return 0; return 0;
@ -502,7 +502,7 @@ DWORD WINAPI GlobalSize16( HGLOBAL16 handle )
*/ */
DWORD WINAPI GlobalHandle16( WORD sel ) DWORD WINAPI GlobalHandle16( WORD sel )
{ {
dprintf_info(global, "GlobalHandle16: %04x\n", sel ); TRACE(global, "%04x\n", sel );
if (!VALID_HANDLE(sel)) { if (!VALID_HANDLE(sel)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandle16!\n",sel); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandle16!\n",sel);
return 0; return 0;
@ -530,7 +530,7 @@ UINT16 WINAPI GlobalFlags16( HGLOBAL16 handle )
{ {
GLOBALARENA *pArena; GLOBALARENA *pArena;
dprintf_info(global, "GlobalFlags16: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFlags16!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFlags16!\n",handle);
return 0; return 0;
@ -547,7 +547,7 @@ UINT16 WINAPI GlobalFlags16( HGLOBAL16 handle )
*/ */
HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle ) HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle )
{ {
dprintf_info(global, "LockSegment: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to LockSegment16!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to LockSegment16!\n",handle);
@ -563,7 +563,7 @@ HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle )
*/ */
void WINAPI UnlockSegment16( HGLOBAL16 handle ) void WINAPI UnlockSegment16( HGLOBAL16 handle )
{ {
dprintf_info(global, "UnlockSegment: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to UnlockSegment16!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to UnlockSegment16!\n",handle);
@ -623,7 +623,7 @@ BOOL16 WINAPI GlobalUnWire16( HGLOBAL16 handle )
*/ */
LONG WINAPI SetSwapAreaSize16( WORD size ) LONG WINAPI SetSwapAreaSize16( WORD size )
{ {
dprintf_fixme(global, "STUB: SetSwapAreaSize(%d)\n", size ); FIXME(global, "(%d) - stub!\n", size );
return MAKELONG( size, 0xffff ); return MAKELONG( size, 0xffff );
} }
@ -633,7 +633,7 @@ LONG WINAPI SetSwapAreaSize16( WORD size )
*/ */
HGLOBAL16 WINAPI GlobalLRUOldest( HGLOBAL16 handle ) HGLOBAL16 WINAPI GlobalLRUOldest( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalLRUOldest: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
return handle; return handle;
} }
@ -644,7 +644,7 @@ HGLOBAL16 WINAPI GlobalLRUOldest( HGLOBAL16 handle )
*/ */
HGLOBAL16 WINAPI GlobalLRUNewest( HGLOBAL16 handle ) HGLOBAL16 WINAPI GlobalLRUNewest( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalLRUNewest: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; if (handle == (HGLOBAL16)-1) handle = CURRENT_DS;
return handle; return handle;
} }
@ -702,7 +702,7 @@ WORD WINAPI GlobalDOSFree(WORD sel)
*/ */
WORD WINAPI GlobalPageLock( HGLOBAL16 handle ) WORD WINAPI GlobalPageLock( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalPageLock: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageLock!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageLock!\n",handle);
return 0; return 0;
@ -716,7 +716,7 @@ WORD WINAPI GlobalPageLock( HGLOBAL16 handle )
*/ */
WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle ) WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalPageUnlock: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageUnlock!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageUnlock!\n",handle);
return 0; return 0;
@ -730,7 +730,7 @@ WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle )
*/ */
void WINAPI GlobalFix16( HGLOBAL16 handle ) void WINAPI GlobalFix16( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalFix16: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFix16!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFix16!\n",handle);
return; return;
@ -744,7 +744,7 @@ void WINAPI GlobalFix16( HGLOBAL16 handle )
*/ */
void WINAPI GlobalUnfix16( HGLOBAL16 handle ) void WINAPI GlobalUnfix16( HGLOBAL16 handle )
{ {
dprintf_info(global, "GlobalUnfix16: %04x\n", handle ); TRACE(global, "%04x\n", handle );
if (!VALID_HANDLE(handle)) { if (!VALID_HANDLE(handle)) {
fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnfix16!\n",handle); fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnfix16!\n",handle);
return; return;
@ -784,7 +784,7 @@ HANDLE16 WINAPI FarGetOwner( HGLOBAL16 handle )
*/ */
WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle ) WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle )
{ {
dprintf_info(toolhelp, "GlobalHandleToSel: %04x\n", handle ); TRACE(toolhelp, "%04x\n", handle );
if (!handle) return 0; if (!handle) return 0;
#ifdef CONFIG_IPC #ifdef CONFIG_IPC
if (is_dde_handle(handle)) return DDE_GlobalHandleToSel(handle); if (is_dde_handle(handle)) return DDE_GlobalHandleToSel(handle);
@ -1029,7 +1029,7 @@ LPVOID WINAPI GlobalLock32(HGLOBAL32 hmem)
} }
else else
{ {
dprintf_warn(global, "GlobalLock32: invalid handle\n"); WARN(global, "invalid handle\n");
palloc=(LPVOID) NULL; palloc=(LPVOID) NULL;
} }
/* HeapUnlock(GetProcessHeap()); */; /* HeapUnlock(GetProcessHeap()); */;
@ -1060,7 +1060,7 @@ BOOL32 WINAPI GlobalUnlock32(HGLOBAL32 hmem)
} }
else else
{ {
dprintf_warn(global, "GlobalUnlock32: invalid handle\n"); WARN(global, "invalid handle\n");
locked=FALSE; locked=FALSE;
} }
/* HeapUnlock(GetProcessHeap()); */ /* HeapUnlock(GetProcessHeap()); */
@ -1233,7 +1233,7 @@ DWORD WINAPI GlobalSize32(HGLOBAL32 hmem)
} }
else else
{ {
dprintf_warn(global, "GlobalSize32: invalid handle\n"); WARN(global, "invalid handle\n");
retval=0; retval=0;
} }
/* HeapUnlock(GetProcessHeap()); */ /* HeapUnlock(GetProcessHeap()); */
@ -1302,7 +1302,7 @@ UINT32 WINAPI GlobalFlags32(HGLOBAL32 hmem)
} }
else else
{ {
dprintf_warn(global,"GlobalFlags32: invalid handle\n"); WARN(global,"invalid handle\n");
retval=0; retval=0;
} }
/* HeapUnlock(GetProcessHeap()); */ /* HeapUnlock(GetProcessHeap()); */

View File

@ -188,7 +188,7 @@ static HEAP *HEAP_GetPtr( HANDLE32 heap )
SetLastError( ERROR_INVALID_HANDLE ); SetLastError( ERROR_INVALID_HANDLE );
return NULL; return NULL;
} }
if (debugging_info(heap) && !HeapValidate( heap, 0, NULL )) if (TRACE_ON(heap) && !HeapValidate( heap, 0, NULL ))
{ {
HEAP_Dump( heapPtr ); HEAP_Dump( heapPtr );
assert( FALSE ); assert( FALSE );
@ -302,7 +302,7 @@ static void HEAP_CreateFreeBlock( SUBHEAP *subheap, void *ptr, DWORD size )
/* If debugging, erase the freed block content */ /* If debugging, erase the freed block content */
if (debugging_info(heap)) if (TRACE_ON(heap))
{ {
char *pEnd = (char *)ptr + size; char *pEnd = (char *)ptr + size;
if (pEnd > (char *)subheap + subheap->commitSize) if (pEnd > (char *)subheap + subheap->commitSize)
@ -321,7 +321,7 @@ static void HEAP_CreateFreeBlock( SUBHEAP *subheap, void *ptr, DWORD size )
pNext->next->prev = pNext->prev; pNext->next->prev = pNext->prev;
pNext->prev->next = pNext->next; pNext->prev->next = pNext->next;
size += (pNext->size & ARENA_SIZE_MASK) + sizeof(*pNext); size += (pNext->size & ARENA_SIZE_MASK) + sizeof(*pNext);
if (debugging_info(heap)) if (TRACE_ON(heap))
memset( pNext, ARENA_FREE_FILLER, sizeof(ARENA_FREE) ); memset( pNext, ARENA_FREE_FILLER, sizeof(ARENA_FREE) );
} }
@ -540,7 +540,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, DWORD size,
subheap->next = heap->subheap.next; subheap->next = heap->subheap.next;
heap->subheap.next = subheap; heap->subheap.next = subheap;
size = subheap->size; size = subheap->size;
dprintf_info(heap, "HEAP_FindFreeBlock: created new sub-heap %08lx of %08lx bytes for heap %08lx\n", TRACE(heap, "created new sub-heap %08lx of %08lx bytes for heap %08lx\n",
(DWORD)subheap, size, (DWORD)heap ); (DWORD)subheap, size, (DWORD)heap );
HEAP_CreateFreeBlock( subheap, subheap + 1, size - sizeof(*subheap) ); HEAP_CreateFreeBlock( subheap, subheap + 1, size - sizeof(*subheap) );
@ -850,7 +850,7 @@ BOOL32 WINAPI HeapDestroy( HANDLE32 heap )
HEAP *heapPtr = HEAP_GetPtr( heap ); HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap; SUBHEAP *subheap;
dprintf_info(heap, "HeapDestroy: %08x\n", heap ); TRACE(heap, "%08x\n", heap );
if (!heapPtr) return FALSE; if (!heapPtr) return FALSE;
DeleteCriticalSection( &heapPtr->critSection ); DeleteCriticalSection( &heapPtr->critSection );
@ -889,7 +889,7 @@ LPVOID WINAPI HeapAlloc( HANDLE32 heap, DWORD flags, DWORD size )
if (!(pArena = HEAP_FindFreeBlock( heapPtr, size, &subheap ))) if (!(pArena = HEAP_FindFreeBlock( heapPtr, size, &subheap )))
{ {
dprintf_info(heap, "HeapAlloc(%08x,%08lx,%08lx): returning NULL\n", TRACE(heap, "(%08x,%08lx,%08lx): returning NULL\n",
heap, flags, size ); heap, flags, size );
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_COMMITMENT_LIMIT ); SetLastError( ERROR_COMMITMENT_LIMIT );
@ -915,11 +915,11 @@ LPVOID WINAPI HeapAlloc( HANDLE32 heap, DWORD flags, DWORD size )
HEAP_ShrinkBlock( subheap, pInUse, size ); HEAP_ShrinkBlock( subheap, pInUse, size );
if (flags & HEAP_ZERO_MEMORY) memset( pInUse + 1, 0, size ); if (flags & HEAP_ZERO_MEMORY) memset( pInUse + 1, 0, size );
else if (debugging_info(heap)) memset( pInUse + 1, ARENA_INUSE_FILLER, size ); else if (TRACE_ON(heap)) memset( pInUse + 1, ARENA_INUSE_FILLER, size );
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
dprintf_info(heap, "HeapAlloc(%08x,%08lx,%08lx): returning %08lx\n", TRACE(heap, "(%08x,%08lx,%08lx): returning %08lx\n",
heap, flags, size, (DWORD)(pInUse + 1) ); heap, flags, size, (DWORD)(pInUse + 1) );
return (LPVOID)(pInUse + 1); return (LPVOID)(pInUse + 1);
} }
@ -944,7 +944,7 @@ BOOL32 WINAPI HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr )
{ {
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
dprintf_info(heap, "HeapFree(%08x,%08lx,%08lx): returning FALSE\n", TRACE(heap, "(%08x,%08lx,%08lx): returning FALSE\n",
heap, flags, (DWORD)ptr ); heap, flags, (DWORD)ptr );
return FALSE; return FALSE;
} }
@ -958,7 +958,7 @@ BOOL32 WINAPI HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr )
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
/* SetLastError( 0 ); */ /* SetLastError( 0 ); */
dprintf_info(heap, "HeapFree(%08x,%08lx,%08lx): returning TRUE\n", TRACE(heap, "(%08x,%08lx,%08lx): returning TRUE\n",
heap, flags, (DWORD)ptr ); heap, flags, (DWORD)ptr );
return TRUE; return TRUE;
} }
@ -990,7 +990,7 @@ LPVOID WINAPI HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
{ {
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
dprintf_info(heap, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning NULL\n", TRACE(heap, "(%08x,%08lx,%08lx,%08lx): returning NULL\n",
heap, flags, (DWORD)ptr, size ); heap, flags, (DWORD)ptr, size );
return NULL; return NULL;
} }
@ -1064,7 +1064,7 @@ LPVOID WINAPI HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
if (flags & HEAP_ZERO_MEMORY) if (flags & HEAP_ZERO_MEMORY)
memset( (char *)(pArena + 1) + oldSize, 0, memset( (char *)(pArena + 1) + oldSize, 0,
(pArena->size & ARENA_SIZE_MASK) - oldSize ); (pArena->size & ARENA_SIZE_MASK) - oldSize );
else if (debugging_info(heap)) else if (TRACE_ON(heap))
memset( (char *)(pArena + 1) + oldSize, ARENA_INUSE_FILLER, memset( (char *)(pArena + 1) + oldSize, ARENA_INUSE_FILLER,
(pArena->size & ARENA_SIZE_MASK) - oldSize ); (pArena->size & ARENA_SIZE_MASK) - oldSize );
} }
@ -1074,7 +1074,7 @@ LPVOID WINAPI HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size )
pArena->callerEIP = *((DWORD *)&heap - 1); /* hack hack */ pArena->callerEIP = *((DWORD *)&heap - 1); /* hack hack */
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
dprintf_info(heap, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning %08lx\n", TRACE(heap, "(%08x,%08lx,%08lx,%08lx): returning %08lx\n",
heap, flags, (DWORD)ptr, size, (DWORD)(pArena + 1) ); heap, flags, (DWORD)ptr, size, (DWORD)(pArena + 1) );
return (LPVOID)(pArena + 1); return (LPVOID)(pArena + 1);
} }
@ -1137,7 +1137,7 @@ DWORD WINAPI HeapSize( HANDLE32 heap, DWORD flags, LPVOID ptr )
} }
if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap );
dprintf_info(heap, "HeapSize(%08x,%08lx,%08lx): returning %08lx\n", TRACE(heap, "(%08x,%08lx,%08lx): returning %08lx\n",
heap, flags, (DWORD)ptr, ret ); heap, flags, (DWORD)ptr, ret );
return ret; return ret;
} }

View File

@ -147,9 +147,8 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
{ {
int ret = 0; int ret = 0;
dprintf_info(ldt, TRACE(ldt, "entry=%04x base=%08lx limit=%05lx %s %d-bit "
"LDT_SetEntry: entry=%04x base=%08lx limit=%05lx %s %d-bit flags=%c%c%c\n", "flags=%c%c%c\n", entry, content->base, content->limit,
entry, content->base, content->limit,
content->limit_in_pages ? "pages" : "bytes", content->limit_in_pages ? "pages" : "bytes",
content->seg_32bit ? 32 : 16, content->seg_32bit ? 32 : 16,
content->read_only && (content->type & SEGMENT_CODE) ? '-' : 'r', content->read_only && (content->type & SEGMENT_CODE) ? '-' : 'r',

View File

@ -125,7 +125,7 @@ static LOCALHEAPINFO *LOCAL_GetHeap( HANDLE16 ds )
{ {
LOCALHEAPINFO *pInfo; LOCALHEAPINFO *pInfo;
INSTANCEDATA *ptr = (INSTANCEDATA *)PTR_SEG_OFF_TO_LIN( ds, 0 ); INSTANCEDATA *ptr = (INSTANCEDATA *)PTR_SEG_OFF_TO_LIN( ds, 0 );
dprintf_info(local, "Heap at %p, %04x\n", ptr, ptr->heap ); TRACE(local, "Heap at %p, %04x\n", ptr, ptr->heap );
if (!ptr || !ptr->heap) return NULL; if (!ptr || !ptr->heap) return NULL;
if (IsBadReadPtr16( (SEGPTR)MAKELONG(ptr->heap,ds), sizeof(LOCALHEAPINFO))) if (IsBadReadPtr16( (SEGPTR)MAKELONG(ptr->heap,ds), sizeof(LOCALHEAPINFO)))
return NULL; return NULL;
@ -163,7 +163,7 @@ static void LOCAL_MakeBlockFree( char *baseptr, WORD block )
next = pNext->next; next = pNext->next;
} }
dprintf_info(local, "Local_MakeBlockFree %04x, next %04x\n", block, next ); TRACE(local, "Local_MakeBlockFree %04x, next %04x\n", block, next );
/* Insert the free block in the free-list */ /* Insert the free block in the free-list */
pArena->free_prev = pNext->free_prev; pArena->free_prev = pNext->free_prev;
@ -228,7 +228,7 @@ static void LOCAL_RemoveBlock( char *baseptr, WORD block )
/* Remove the block from the free-list */ /* Remove the block from the free-list */
dprintf_info(local, "Local_RemoveBlock\n"); TRACE(local, "Local_RemoveBlock\n");
pArena = ARENA_PTR( baseptr, block ); pArena = ARENA_PTR( baseptr, block );
if ((pArena->prev & 3) == LOCAL_ARENA_FREE) if ((pArena->prev & 3) == LOCAL_ARENA_FREE)
LOCAL_RemoveFreeBlock( baseptr, block ); LOCAL_RemoveFreeBlock( baseptr, block );
@ -258,8 +258,8 @@ static void LOCAL_PrintHeap( HANDLE16 ds )
/* FIXME - the test should be done when calling the function! /* FIXME - the test should be done when calling the function!
plus is not clear that we should print this info plus is not clear that we should print this info
only when debugging_info is on! */ only when TRACE_ON is on! */
if(!debugging_info(local)) return; if(!TRACE_ON(local)) return;
ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
pInfo = LOCAL_GetHeap( ds ); pInfo = LOCAL_GetHeap( ds );
@ -327,12 +327,12 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
/* - large free block (FREE) */ /* - large free block (FREE) */
/* - last arena (FREE) */ /* - last arena (FREE) */
dprintf_info(local, "LocalInit: %04x %04x-%04x\n", selector, start, end); TRACE(local, "%04x %04x-%04x\n", selector, start, end);
if (!selector) selector = CURRENT_DS; if (!selector) selector = CURRENT_DS;
if (debugging_info(heap)) if (TRACE_ON(heap))
{ {
/* If debugging_info(heap) is set, the global heap blocks are */ /* If TRACE_ON(heap) is set, the global heap blocks are */
/* cleared before use, so we can test for double initialization. */ /* cleared before use, so we can test for double initialization. */
if (LOCAL_GetHeap(selector)) if (LOCAL_GetHeap(selector))
{ {
@ -355,7 +355,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end )
start = GlobalSize16( GlobalHandle16( selector ) ); start = GlobalSize16( GlobalHandle16( selector ) );
start -= end; start -= end;
end += start; end += start;
dprintf_info(local," new start %04x, minstart: %04x\n", start, pSeg->minsize + pModule->stack_size); TRACE(local," new start %04x, minstart: %04x\n", start, pSeg->minsize + pModule->stack_size);
} }
} }
} }
@ -477,7 +477,7 @@ static void LOCAL_GrowHeap( HANDLE16 ds )
pHeapInfo->items--; pHeapInfo->items--;
} }
dprintf_info(local, "Heap expanded\n" ); TRACE(local, "Heap expanded\n" );
LOCAL_PrintHeap( ds ); LOCAL_PrintHeap( ds );
} }
@ -491,7 +491,7 @@ static HLOCAL16 LOCAL_FreeArena( WORD ds, WORD arena )
LOCALHEAPINFO *pInfo; LOCALHEAPINFO *pInfo;
LOCALARENA *pArena, *pPrev, *pNext; LOCALARENA *pArena, *pPrev, *pNext;
dprintf_info(local, "LocalFreeArena: %04x ds=%04x\n", arena, ds ); TRACE(local, "%04x ds=%04x\n", arena, ds );
if (!(pInfo = LOCAL_GetHeap( ds ))) return arena; if (!(pInfo = LOCAL_GetHeap( ds ))) return arena;
pArena = ARENA_PTR( ptr, arena ); pArena = ARENA_PTR( ptr, arena );
@ -660,16 +660,15 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
LOCAL_PrintHeap(ds); LOCAL_PrintHeap(ds);
return 0; return 0;
} }
dprintf_info(local, TRACE(local, "ds = %04x, minfree = %04x, flags = %04x\n",
"LOCAL_Compact: ds = %04x, minfree = %04x, flags = %04x\n",
ds, minfree, flags); ds, minfree, flags);
freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1); freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1);
if(freespace >= minfree || (flags & LMEM_NOCOMPACT)) if(freespace >= minfree || (flags & LMEM_NOCOMPACT))
{ {
dprintf_info(local, "Returning %04x.\n", freespace); TRACE(local, "Returning %04x.\n", freespace);
return freespace; return freespace;
} }
dprintf_info(local, "Local_Compact: Compacting heap %04x.\n", ds); TRACE(local, "Compacting heap %04x.\n", ds);
table = pInfo->htable; table = pInfo->htable;
while(table) while(table)
{ {
@ -679,8 +678,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
if((pEntry->lock == 0) && (pEntry->flags != (LMEM_DISCARDED >> 8))) if((pEntry->lock == 0) && (pEntry->flags != (LMEM_DISCARDED >> 8)))
{ {
/* OK we can move this one if we want */ /* OK we can move this one if we want */
dprintf_info(local, TRACE(local, "handle %04x (block %04x) can be moved.\n",
"handle %04x (block %04x) can be moved.\n",
(WORD)((char *)pEntry - ptr), pEntry->addr); (WORD)((char *)pEntry - ptr), pEntry->addr);
movearena = ARENA_HEADER(pEntry->addr); movearena = ARENA_HEADER(pEntry->addr);
pMoveArena = ARENA_PTR(ptr, movearena); pMoveArena = ARENA_PTR(ptr, movearena);
@ -707,7 +705,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
} }
if (finalarena) /* Actually got somewhere to move */ if (finalarena) /* Actually got somewhere to move */
{ {
dprintf_info(local, "Moving it to %04x.\n", finalarena); TRACE(local, "Moving it to %04x.\n", finalarena);
pFinalArena = ARENA_PTR(ptr, finalarena); pFinalArena = ARENA_PTR(ptr, finalarena);
size = pFinalArena->size; size = pFinalArena->size;
LOCAL_RemoveFreeBlock(ptr, finalarena); LOCAL_RemoveFreeBlock(ptr, finalarena);
@ -738,7 +736,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1); freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1);
if(freespace >= minfree || (flags & LMEM_NODISCARD)) if(freespace >= minfree || (flags & LMEM_NODISCARD))
{ {
dprintf_info(local, "Returning %04x.\n", freespace); TRACE(local, "Returning %04x.\n", freespace);
return freespace; return freespace;
} }
@ -751,7 +749,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags )
if(pEntry->addr && pEntry->lock == 0 && if(pEntry->addr && pEntry->lock == 0 &&
(pEntry->flags & (LMEM_DISCARDABLE >> 8))) (pEntry->flags & (LMEM_DISCARDABLE >> 8)))
{ {
dprintf_info(local, "Discarding handle %04x (block %04x).\n", TRACE(local, "Discarding handle %04x (block %04x).\n",
(char *)pEntry - ptr, pEntry->addr); (char *)pEntry - ptr, pEntry->addr);
LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr)); LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr));
pEntry->addr = 0; pEntry->addr = 0;
@ -790,7 +788,7 @@ static HLOCAL16 LOCAL_FindFreeBlock( HANDLE16 ds, WORD size )
if (arena == pArena->free_next) break; if (arena == pArena->free_next) break;
if (pArena->size >= size) return arena; if (pArena->size >= size) return arena;
} }
dprintf_warn(local, "Local_FindFreeBlock: not enough space\n" ); WARN(local, "not enough space\n" );
LOCAL_PrintHeap(ds); LOCAL_PrintHeap(ds);
return 0; return 0;
} }
@ -833,24 +831,21 @@ static HLOCAL16 LOCAL_GetBlock( HANDLE16 ds, WORD size, WORD flags )
} }
if (arena == 0) { if (arena == 0) {
if (ds == GDI_HeapSel) { if (ds == GDI_HeapSel) {
dprintf_warn(local, WARN(local, "not enough space in GDI local heap "
"Local_GetBlock: not enough space in GDI local heap (%04x) for %d bytes\n", "(%04x) for %d bytes\n", ds, size );
ds, size );
} else if (ds == USER_HeapSel) { } else if (ds == USER_HeapSel) {
dprintf_warn(local, WARN(local, "not enough space in USER local heap "
"Local_GetBlock: not enough space in USER local heap (%04x) for %d bytes\n", "(%04x) for %d bytes\n", ds, size );
ds, size );
} else { } else {
dprintf_warn(local, WARN(local, "not enough space in local heap "
"Local_GetBlock: not enough space in local heap %04x for %d bytes\n", "%04x for %d bytes\n", ds, size );
ds, size );
} }
return 0; return 0;
} }
/* Make a block out of the free arena */ /* Make a block out of the free arena */
pArena = ARENA_PTR( ptr, arena ); pArena = ARENA_PTR( ptr, arena );
dprintf_info(local, "LOCAL_GetBlock size = %04x, arena %04x size %04x\n", TRACE(local, "LOCAL_GetBlock size = %04x, arena %04x size %04x\n",
size, arena, pArena->size ); size, arena, pArena->size );
LOCAL_RemoveFreeBlock( ptr, arena ); LOCAL_RemoveFreeBlock( ptr, arena );
LOCAL_ShrinkArena( ds, arena, size ); LOCAL_ShrinkArena( ds, arena, size );
@ -872,7 +867,7 @@ static BOOL16 LOCAL_NewHTable( HANDLE16 ds )
HLOCAL16 handle; HLOCAL16 handle;
int i; int i;
dprintf_info(local, "Local_NewHTable\n" ); TRACE(local, "Local_NewHTable\n" );
if (!(pInfo = LOCAL_GetHeap( ds ))) if (!(pInfo = LOCAL_GetHeap( ds )))
{ {
fprintf( stderr, "Local heap not found\n"); fprintf( stderr, "Local heap not found\n");
@ -944,7 +939,7 @@ static HLOCAL16 LOCAL_GetNewHandleEntry( HANDLE16 ds )
pEntry->lock = 0; pEntry->lock = 0;
pEntry->flags = 0; pEntry->flags = 0;
dprintf_info(local, "LOCAL_GetNewHandleEntry(%04x): %04x\n", TRACE(local, "(%04x): %04x\n",
ds, ((char *)pEntry - ptr) ); ds, ((char *)pEntry - ptr) );
return (HLOCAL16)((char *)pEntry - ptr); return (HLOCAL16)((char *)pEntry - ptr);
} }
@ -996,7 +991,7 @@ static void LOCAL_FreeHandleEntry( HANDLE16 ds, HLOCAL16 handle )
/* Remove the table from the linked list and free it */ /* Remove the table from the linked list and free it */
dprintf_info(local, "LOCAL_FreeHandleEntry(%04x): freeing table %04x\n", TRACE(local, "(%04x): freeing table %04x\n",
ds, table); ds, table);
*pTable = *(WORD *)pEntry; *pTable = *(WORD *)pEntry;
LOCAL_FreeArena( ds, ARENA_HEADER( table ) ); LOCAL_FreeArena( ds, ARENA_HEADER( table ) );
@ -1012,7 +1007,7 @@ HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle )
{ {
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
dprintf_info(local, "LocalFree: %04x ds=%04x\n", handle, ds ); TRACE(local, "%04x ds=%04x\n", handle, ds );
if (!handle) { fprintf( stderr, "LOCAL_Free: handle is 0.\n" ); return 0; } if (!handle) { fprintf( stderr, "LOCAL_Free: handle is 0.\n" ); return 0; }
if (HANDLE_FIXED( handle )) if (HANDLE_FIXED( handle ))
@ -1025,7 +1020,7 @@ HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle )
LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
if (pEntry->flags != (LMEM_DISCARDED >> 8)) if (pEntry->flags != (LMEM_DISCARDED >> 8))
{ {
dprintf_info(local, "LocalFree: real block at %04x\n", TRACE(local, "real block at %04x\n",
pEntry->addr ); pEntry->addr );
if (LOCAL_FreeArena( ds, ARENA_HEADER(pEntry->addr) )) if (LOCAL_FreeArena( ds, ARENA_HEADER(pEntry->addr) ))
return handle; /* couldn't free it */ return handle; /* couldn't free it */
@ -1047,7 +1042,7 @@ HLOCAL16 LOCAL_Alloc( HANDLE16 ds, WORD flags, WORD size )
char *ptr; char *ptr;
HLOCAL16 handle; HLOCAL16 handle;
dprintf_info(local, "LocalAlloc: %04x %d ds=%04x\n", flags, size, ds ); TRACE(local, "%04x %d ds=%04x\n", flags, size, ds );
if(size > 0 && size <= 4) size = 5; if(size > 0 && size <= 4) size = 5;
if (flags & LMEM_MOVEABLE) if (flags & LMEM_MOVEABLE)
@ -1114,7 +1109,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
((LOCALHANDLEENTRY *)(ptr + handle))->lock == 0xff) /* An unused handle */ ((LOCALHANDLEENTRY *)(ptr + handle))->lock == 0xff) /* An unused handle */
return 0; return 0;
dprintf_info(local, "LocalReAlloc: %04x %d %04x ds=%04x\n", TRACE(local, "%04x %d %04x ds=%04x\n",
handle, size, flags, ds ); handle, size, flags, ds );
if (!(pInfo = LOCAL_GetHeap( ds ))) return 0; if (!(pInfo = LOCAL_GetHeap( ds ))) return 0;
@ -1129,7 +1124,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
if(pEntry->addr) if(pEntry->addr)
fprintf(stderr, fprintf(stderr,
"LOCAL_ReAlloc: Dicarded block has non-zero addr.\n"); "LOCAL_ReAlloc: Dicarded block has non-zero addr.\n");
dprintf_info(local, "ReAllocating discarded block\n"); TRACE(local, "ReAllocating discarded block\n");
if(size <= 4) size = 5; if(size <= 4) size = 5;
if (!(hl = LOCAL_GetBlock( ds, size + sizeof(HLOCAL16), flags))) if (!(hl = LOCAL_GetBlock( ds, size + sizeof(HLOCAL16), flags)))
return 0; return 0;
@ -1159,7 +1154,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
{ {
pEntry = (LOCALHANDLEENTRY *)(ptr + handle); pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
pEntry->flags = (flags & 0x0f00) >> 8; pEntry->flags = (flags & 0x0f00) >> 8;
dprintf_info(local, "Changing flags to %x.\n", pEntry->flags); TRACE(local, "Changing flags to %x.\n", pEntry->flags);
} }
return handle; return handle;
} }
@ -1170,7 +1165,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
{ {
if (HANDLE_FIXED(handle)) if (HANDLE_FIXED(handle))
{ {
dprintf_info(local, "Freeing fixed block.\n"); TRACE(local, "Freeing fixed block.\n");
return LOCAL_Free( ds, handle ); return LOCAL_Free( ds, handle );
} }
else /* Moveable block */ else /* Moveable block */
@ -1179,7 +1174,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
if (pEntry->lock == 0) if (pEntry->lock == 0)
{ {
/* discards moveable blocks */ /* discards moveable blocks */
dprintf_info(local,"Discarding block\n"); TRACE(local,"Discarding block\n");
LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr)); LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr));
pEntry->addr = 0; pEntry->addr = 0;
pEntry->flags = (LMEM_DISCARDED >> 8); pEntry->flags = (LMEM_DISCARDED >> 8);
@ -1201,7 +1196,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
} }
arena = ARENA_HEADER( blockhandle ); arena = ARENA_HEADER( blockhandle );
dprintf_info(local, "LocalReAlloc: arena is %04x\n", arena ); TRACE(local, "arena is %04x\n", arena );
pArena = ARENA_PTR( ptr, arena ); pArena = ARENA_PTR( ptr, arena );
if(size <= 4) size = 5; if(size <= 4) size = 5;
@ -1212,9 +1207,9 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
if (nextarena <= pArena->next) if (nextarena <= pArena->next)
{ {
dprintf_info(local, "size reduction, making new free block\n"); TRACE(local, "size reduction, making new free block\n");
LOCAL_ShrinkArena(ds, arena, nextarena - arena); LOCAL_ShrinkArena(ds, arena, nextarena - arena);
dprintf_info(local, "LocalReAlloc: returning %04x\n", handle ); TRACE(local, "returning %04x\n", handle );
return handle; return handle;
} }
@ -1224,9 +1219,9 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
if (((pNext->prev & 3) == LOCAL_ARENA_FREE) && if (((pNext->prev & 3) == LOCAL_ARENA_FREE) &&
(nextarena <= pNext->next)) (nextarena <= pNext->next))
{ {
dprintf_info(local, "size increase, making new free block\n"); TRACE(local, "size increase, making new free block\n");
LOCAL_GrowArenaUpward(ds, arena, nextarena - arena); LOCAL_GrowArenaUpward(ds, arena, nextarena - arena);
dprintf_info(local, "LocalReAlloc: returning %04x\n", handle ); TRACE(local, "returning %04x\n", handle );
return handle; return handle;
} }
@ -1237,16 +1232,14 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
{ {
if (HANDLE_FIXED(handle)) if (HANDLE_FIXED(handle))
{ {
dprintf_warn(local, WARN(local, "Needed to move fixed block, but LMEM_MOVEABLE not specified.\n");
"Needed to move fixed block, but LMEM_MOVEABLE not specified.\n");
return 0; return 0;
} }
else else
{ {
if(((LOCALHANDLEENTRY *)(ptr + handle))->lock != 0) if(((LOCALHANDLEENTRY *)(ptr + handle))->lock != 0)
{ {
dprintf_warn(local, WARN(local, "Needed to move locked block, but LMEM_MOVEABLE not specified.\n");
"Needed to move locked block, but LMEM_MOVEABLE not specified.\n");
return 0; return 0;
} }
} }
@ -1282,7 +1275,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
} }
if (HANDLE_MOVEABLE( handle )) if (HANDLE_MOVEABLE( handle ))
{ {
dprintf_info(local, "LocalReAlloc: fixing handle\n"); TRACE(local, "fixing handle\n");
pEntry = (LOCALHANDLEENTRY *)(ptr + handle); pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
pEntry->addr = hmem + sizeof(HLOCAL16); pEntry->addr = hmem + sizeof(HLOCAL16);
/* Back ptr should still be correct */ /* Back ptr should still be correct */
@ -1291,7 +1284,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
hmem = handle; hmem = handle;
} }
if (size == oldsize) hmem = 0; /* Realloc failed */ if (size == oldsize) hmem = 0; /* Realloc failed */
dprintf_info(local, "LocalReAlloc: returning %04x\n", hmem ); TRACE(local, "returning %04x\n", hmem );
return hmem; return hmem;
} }
@ -1310,7 +1303,7 @@ static HLOCAL16 LOCAL_InternalLock( LPSTR heap, HLOCAL16 handle )
if (pEntry->lock < 0xfe) pEntry->lock++; if (pEntry->lock < 0xfe) pEntry->lock++;
handle = pEntry->addr; handle = pEntry->addr;
} }
dprintf_info(local, "LocalLock: %04x returning %04x\n", TRACE(local, "%04x returning %04x\n",
old_handle, handle ); old_handle, handle );
return handle; return handle;
} }
@ -1343,7 +1336,7 @@ BOOL16 LOCAL_Unlock( HANDLE16 ds, HLOCAL16 handle )
{ {
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
dprintf_info(local, "LocalUnlock: %04x\n", handle ); TRACE(local, "%04x\n", handle );
if (HANDLE_MOVEABLE(handle)) if (HANDLE_MOVEABLE(handle))
{ {
LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
@ -1366,7 +1359,7 @@ WORD LOCAL_Size( HANDLE16 ds, HLOCAL16 handle )
char *ptr = PTR_SEG_OFF_TO_LIN( CURRENT_DS, 0 ); char *ptr = PTR_SEG_OFF_TO_LIN( CURRENT_DS, 0 );
LOCALARENA *pArena; LOCALARENA *pArena;
dprintf_info(local, "LocalSize: %04x ds=%04x\n", handle, ds ); TRACE(local, "%04x ds=%04x\n", handle, ds );
if (HANDLE_MOVEABLE( handle )) handle = *(WORD *)(ptr + handle); if (HANDLE_MOVEABLE( handle )) handle = *(WORD *)(ptr + handle);
if (!handle) return 0; if (!handle) return 0;
@ -1387,13 +1380,13 @@ WORD LOCAL_Flags( HANDLE16 ds, HLOCAL16 handle )
if (HANDLE_MOVEABLE(handle)) if (HANDLE_MOVEABLE(handle))
{ {
LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle);
dprintf_info(local, "LOCAL_Flags(%04x,%04x): returning %04x\n", TRACE(local, "(%04x,%04x): returning %04x\n",
ds, handle, pEntry->lock | (pEntry->flags << 8) ); ds, handle, pEntry->lock | (pEntry->flags << 8) );
return pEntry->lock | (pEntry->flags << 8); return pEntry->lock | (pEntry->flags << 8);
} }
else else
{ {
dprintf_info(local, "LOCAL_Flags(%04x,%04x): returning 0\n", TRACE(local, "(%04x,%04x): returning 0\n",
ds, handle ); ds, handle );
return 0; return 0;
} }
@ -1442,7 +1435,7 @@ WORD LOCAL_CountFree( HANDLE16 ds )
if (arena == pArena->free_next) break; if (arena == pArena->free_next) break;
total += pArena->size; total += pArena->size;
} }
dprintf_info(local, "LOCAL_CountFree(%04x): returning %d\n", ds, total); TRACE(local, "(%04x): returning %d\n", ds, total);
return total; return total;
} }
@ -1560,7 +1553,7 @@ UINT16 WINAPI LocalFlags16( HLOCAL16 handle )
*/ */
UINT16 WINAPI LocalCompact16( UINT16 minfree ) UINT16 WINAPI LocalCompact16( UINT16 minfree )
{ {
dprintf_info(local, "LocalCompact: %04x\n", minfree ); TRACE(local, "%04x\n", minfree );
return LOCAL_Compact( CURRENT_DS, minfree, 0 ); return LOCAL_Compact( CURRENT_DS, minfree, 0 );
} }
@ -1580,7 +1573,7 @@ FARPROC16 WINAPI LocalNotify( FARPROC16 func )
LOCAL_PrintHeap( ds ); LOCAL_PrintHeap( ds );
return 0; return 0;
} }
dprintf_info(local, "LocalNotify(%04x): %08lx\n", ds, (DWORD)func ); TRACE(local, "(%04x): %08lx\n", ds, (DWORD)func );
fprintf(stdnimp, "LocalNotify(): Half implemented\n"); fprintf(stdnimp, "LocalNotify(): Half implemented\n");
oldNotify = pInfo->notify; oldNotify = pInfo->notify;
pInfo->notify = func; pInfo->notify = func;
@ -1593,7 +1586,7 @@ FARPROC16 WINAPI LocalNotify( FARPROC16 func )
*/ */
UINT16 WINAPI LocalShrink16( HGLOBAL16 handle, UINT16 newsize ) UINT16 WINAPI LocalShrink16( HGLOBAL16 handle, UINT16 newsize )
{ {
dprintf_info(local, "LocalShrink: %04x %04x\n", handle, newsize ); TRACE(local, "%04x %04x\n", handle, newsize );
return 0; return 0;
} }
@ -1626,7 +1619,7 @@ WORD WINAPI LocalCountFree(void)
*/ */
WORD WINAPI LocalHeapSize(void) WORD WINAPI LocalHeapSize(void)
{ {
dprintf_info(local, "LocalHeapSize:\n" ); TRACE(local, "(void)\n" );
return LOCAL_HeapSize( CURRENT_DS ); return LOCAL_HeapSize( CURRENT_DS );
} }
@ -1645,7 +1638,7 @@ WORD WINAPI LocalHandleDelta( WORD delta )
return 0; return 0;
} }
if (delta) pInfo->hdelta = delta; if (delta) pInfo->hdelta = delta;
dprintf_info(local, "LocalHandleDelta: returning %04x\n", pInfo->hdelta); TRACE(local, "returning %04x\n", pInfo->hdelta);
return pInfo->hdelta; return pInfo->hdelta;
} }

View File

@ -59,7 +59,7 @@ WORD WINAPI AllocSelector( WORD sel )
count = sel ? ((GET_SEL_LIMIT(sel) >> 16) + 1) : 1; count = sel ? ((GET_SEL_LIMIT(sel) >> 16) + 1) : 1;
newsel = AllocSelectorArray( count ); newsel = AllocSelectorArray( count );
dprintf_info(selector, "AllocSelector(%04x): returning %04x\n", TRACE(selector, "(%04x): returning %04x\n",
sel, newsel ); sel, newsel );
if (!newsel) return 0; if (!newsel) return 0;
if (!sel) return newsel; /* nothing to copy */ if (!sel) return newsel; /* nothing to copy */
@ -148,7 +148,7 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
ldt_entry entry; ldt_entry entry;
STACK16FRAME *frame; STACK16FRAME *frame;
dprintf_info(selector, "SELECTOR_FreeBlock(%04x,%d)\n", sel, count ); TRACE(selector, "(%04x,%d)\n", sel, count );
sel &= ~(__AHINCR - 1); /* clear bottom bits of selector */ sel &= ~(__AHINCR - 1); /* clear bottom bits of selector */
nextsel = sel + (count << __AHSHIFT); nextsel = sel + (count << __AHSHIFT);
@ -252,7 +252,7 @@ WORD WINAPI AllocCStoDSAlias( WORD sel )
ldt_entry entry; ldt_entry entry;
newsel = AllocSelectorArray( 1 ); newsel = AllocSelectorArray( 1 );
dprintf_info(selector, "AllocCStoDSAlias(%04x): returning %04x\n", TRACE(selector, "(%04x): returning %04x\n",
sel, newsel ); sel, newsel );
if (!newsel) return 0; if (!newsel) return 0;
LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry ); LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry );
@ -271,7 +271,7 @@ WORD WINAPI AllocDStoCSAlias( WORD sel )
ldt_entry entry; ldt_entry entry;
newsel = AllocSelectorArray( 1 ); newsel = AllocSelectorArray( 1 );
dprintf_info(selector, "AllocDStoCSAlias(%04x): returning %04x\n", TRACE(selector, "(%04x): returning %04x\n",
sel, newsel ); sel, newsel );
if (!newsel) return 0; if (!newsel) return 0;
LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry ); LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry );

View File

@ -77,7 +77,7 @@ SEGPTR WINAPI lstrcat16( SEGPTR dst, LPCSTR src )
*/ */
LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src ) LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src )
{ {
dprintf_info(string,"strcat: Append %s to %s\n", TRACE(string,"Append %s to %s\n",
debugstr_a (src), debugstr_a (dst)); debugstr_a (src), debugstr_a (dst));
/* Windows does not check for NULL pointers here, so we don't either */ /* Windows does not check for NULL pointers here, so we don't either */
strcat( dst, src ); strcat( dst, src );
@ -91,7 +91,7 @@ LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src )
LPWSTR WINAPI lstrcat32W( LPWSTR dst, LPCWSTR src ) LPWSTR WINAPI lstrcat32W( LPWSTR dst, LPCWSTR src )
{ {
register LPWSTR p = dst; register LPWSTR p = dst;
dprintf_info(string,"strcat: Append L%s to L%s\n", TRACE(string,"Append L%s to L%s\n",
debugstr_w (src), debugstr_w (dst)); debugstr_w (src), debugstr_w (dst));
/* Windows does not check for NULL pointers here, so we don't either */ /* Windows does not check for NULL pointers here, so we don't either */
while (*p) p++; while (*p) p++;
@ -116,7 +116,7 @@ SEGPTR WINAPI lstrcatn16( SEGPTR dst, LPCSTR src, INT16 n )
LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n ) LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
{ {
register LPSTR p = dst; register LPSTR p = dst;
dprintf_info(string,"strcatn add %d chars from %s to %s\n", TRACE(string,"strcatn add %d chars from %s to %s\n",
n, debugstr_an (src, n), debugstr_a (dst)); n, debugstr_an (src, n), debugstr_a (dst));
while (*p) p++; while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst; if ((n -= (INT32)(p - dst)) <= 0) return dst;
@ -131,7 +131,7 @@ LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
LPWSTR WINAPI lstrcatn32W( LPWSTR dst, LPCWSTR src, INT32 n ) LPWSTR WINAPI lstrcatn32W( LPWSTR dst, LPCWSTR src, INT32 n )
{ {
register LPWSTR p = dst; register LPWSTR p = dst;
dprintf_info(string,"strcatn add %d chars from L%s to L%s\n", TRACE(string,"strcatn add %d chars from L%s to L%s\n",
n, debugstr_wn (src, n), debugstr_w (dst)); n, debugstr_wn (src, n), debugstr_w (dst));
while (*p) p++; while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst; if ((n -= (INT32)(p - dst)) <= 0) return dst;
@ -154,7 +154,7 @@ INT16 WINAPI lstrcmp16( LPCSTR str1, LPCSTR str2 )
*/ */
INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 ) INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
{ {
dprintf_info(string,"strcmp: %s and %s\n", TRACE(string,"%s and %s\n",
debugstr_a (str1), debugstr_a (str2)); debugstr_a (str1), debugstr_a (str2));
/* Win95 KERNEL32.DLL does it that way. Hands off! */ /* Win95 KERNEL32.DLL does it that way. Hands off! */
if (!str1 || !str2) { if (!str1 || !str2) {
@ -170,7 +170,7 @@ INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 )
*/ */
INT32 WINAPI lstrcmp32W( LPCWSTR str1, LPCWSTR str2 ) INT32 WINAPI lstrcmp32W( LPCWSTR str1, LPCWSTR str2 )
{ {
dprintf_info(string,"strcmp: L%s and L%s\n", TRACE(string,"L%s and L%s\n",
debugstr_w (str1), debugstr_w (str2)); debugstr_w (str1), debugstr_w (str2));
if (!str1 || !str2) { if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
@ -197,7 +197,7 @@ INT32 WINAPI lstrcmpi32A( LPCSTR str1, LPCSTR str2 )
{ {
INT32 res; INT32 res;
dprintf_info(string,"strcmpi %s and %s\n", TRACE(string,"strcmpi %s and %s\n",
debugstr_a (str1), debugstr_a (str2)); debugstr_a (str1), debugstr_a (str2));
if (!str1 || !str2) { if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
@ -222,7 +222,7 @@ INT32 WINAPI lstrcmpi32W( LPCWSTR str1, LPCWSTR str2 )
#if 0 #if 0
/* Too much! (From registry loading.) */ /* Too much! (From registry loading.) */
dprintf_info(string,"strcmpi L%s and L%s\n", TRACE(string,"strcmpi L%s and L%s\n",
debugstr_w (str1), debugstr_w (str2)); debugstr_w (str1), debugstr_w (str2));
#endif #endif
if (!str1 || !str2) { if (!str1 || !str2) {
@ -255,7 +255,7 @@ SEGPTR WINAPI lstrcpy16( SEGPTR dst, LPCSTR src )
*/ */
LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src ) LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src )
{ {
dprintf_info(string,"strcpy %s\n", debugstr_a (src)); TRACE(string,"strcpy %s\n", debugstr_a (src));
/* Windows does not check for NULL pointers here, so we don't either */ /* Windows does not check for NULL pointers here, so we don't either */
strcpy( dst, src ); strcpy( dst, src );
return dst; return dst;
@ -268,7 +268,7 @@ LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src )
LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src ) LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src )
{ {
register LPWSTR p = dst; register LPWSTR p = dst;
dprintf_info(string,"strcpy L%s\n", debugstr_w (src)); TRACE(string,"strcpy L%s\n", debugstr_w (src));
/* Windows does not check for NULL pointers here, so we don't either */ /* Windows does not check for NULL pointers here, so we don't either */
while ((*p++ = *src++)); while ((*p++ = *src++));
return dst; return dst;
@ -287,11 +287,13 @@ SEGPTR WINAPI lstrcpyn16( SEGPTR dst, LPCSTR src, INT16 n )
/*********************************************************************** /***********************************************************************
* lstrcpyn32A (KERNEL32.611) * lstrcpyn32A (KERNEL32.611)
* Note: this function differs from the UNIX strncpy, it _always_ writes
* a terminating \0
*/ */
LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n ) LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
{ {
LPSTR p = dst; LPSTR p = dst;
dprintf_info(string,"strcpyn %s for %d chars\n", TRACE(string,"strcpyn %s for %d chars\n",
debugstr_an (src,n), n); debugstr_an (src,n), n);
/* Windows does not check for NULL pointers here, so we don't either */ /* Windows does not check for NULL pointers here, so we don't either */
while ((n-- > 1) && *src) *p++ = *src++; while ((n-- > 1) && *src) *p++ = *src++;
@ -302,11 +304,13 @@ LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
/*********************************************************************** /***********************************************************************
* lstrcpyn32W (KERNEL32.612) * lstrcpyn32W (KERNEL32.612)
* Note: this function differs from the UNIX strncpy, it _always_ writes
* a terminating \0
*/ */
LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n ) LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n )
{ {
LPWSTR p = dst; LPWSTR p = dst;
dprintf_info(string,"strcpyn L%s for %d chars\n", TRACE(string,"strcpyn L%s for %d chars\n",
debugstr_wn (src,n), n); debugstr_wn (src,n), n);
/* Windows does not check for NULL pointers here, so we don't either */ /* Windows does not check for NULL pointers here, so we don't either */
while ((n-- > 1) && *src) *p++ = *src++; while ((n-- > 1) && *src) *p++ = *src++;
@ -333,7 +337,7 @@ INT32 WINAPI lstrlen32A( LPCSTR str )
* in lstrlen() ... we check only for NULL pointer reference. * in lstrlen() ... we check only for NULL pointer reference.
* - Marcus Meissner * - Marcus Meissner
*/ */
dprintf_info(string,"strlen %s\n", debugstr_a (str)); TRACE(string,"strlen %s\n", debugstr_a (str));
if (!str) return 0; if (!str) return 0;
return (INT32)strlen(str); return (INT32)strlen(str);
} }
@ -345,7 +349,7 @@ INT32 WINAPI lstrlen32A( LPCSTR str )
INT32 WINAPI lstrlen32W( LPCWSTR str ) INT32 WINAPI lstrlen32W( LPCWSTR str )
{ {
INT32 len = 0; INT32 len = 0;
dprintf_info(string,"strlen L%s\n", debugstr_w (str)); TRACE(string,"strlen L%s\n", debugstr_w (str));
if (!str) return 0; if (!str) return 0;
while (*str++) len++; while (*str++) len++;
return len; return len;
@ -357,7 +361,7 @@ INT32 WINAPI lstrlen32W( LPCWSTR str )
*/ */
INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n ) INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
{ {
dprintf_info(string,"strncmp %s and %s for %d chars\n", TRACE(string,"strncmp %s and %s for %d chars\n",
debugstr_an (str1, n), debugstr_an (str2, n), n); debugstr_an (str1, n), debugstr_an (str2, n), n);
return (INT32)strncmp( str1, str2, n ); return (INT32)strncmp( str1, str2, n );
} }
@ -368,7 +372,7 @@ INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
*/ */
INT32 WINAPI lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n ) INT32 WINAPI lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
{ {
dprintf_info(string,"strncmp L%s and L%s for %d chars\n", TRACE(string,"strncmp L%s and L%s for %d chars\n",
debugstr_wn (str1, n), debugstr_wn (str2, n), n); debugstr_wn (str1, n), debugstr_wn (str2, n), n);
if (!n) return 0; if (!n) return 0;
while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; } while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
@ -383,7 +387,7 @@ INT32 WINAPI lstrncmpi32A( LPCSTR str1, LPCSTR str2, INT32 n )
{ {
INT32 res; INT32 res;
dprintf_info(string,"strncmpi %s and %s for %d chars\n", TRACE(string,"strncmpi %s and %s for %d chars\n",
debugstr_an (str1, n), debugstr_an (str2, n), n); debugstr_an (str1, n), debugstr_an (str2, n), n);
if (!n) return 0; if (!n) return 0;
while ((--n > 0) && *str1) while ((--n > 0) && *str1)
@ -400,7 +404,7 @@ INT32 WINAPI lstrncmpi32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
{ {
INT32 res; INT32 res;
dprintf_info(string,"strncmpi L%s and L%s for %d chars\n", TRACE(string,"strncmpi L%s and L%s for %d chars\n",
debugstr_wn (str1, n), debugstr_wn (str2, n), n); debugstr_wn (str1, n), debugstr_wn (str2, n), n);
if (!n) return 0; if (!n) return 0;
while ((--n > 0) && *str1) while ((--n > 0) && *str1)
@ -438,6 +442,8 @@ LPSTR WINAPI lstrcpyWtoA( LPSTR dst, LPCWSTR src )
/*********************************************************************** /***********************************************************************
* lstrcpynAtoW (Not a Windows API) * lstrcpynAtoW (Not a Windows API)
* Note: this function differs from the UNIX strncpy, it _always_ writes
* a terminating \0
*/ */
LPWSTR WINAPI lstrcpynAtoW( LPWSTR dst, LPCSTR src, INT32 n ) LPWSTR WINAPI lstrcpynAtoW( LPWSTR dst, LPCSTR src, INT32 n )
{ {
@ -450,6 +456,8 @@ LPWSTR WINAPI lstrcpynAtoW( LPWSTR dst, LPCSTR src, INT32 n )
/*********************************************************************** /***********************************************************************
* lstrcpynWtoA (Not a Windows API) * lstrcpynWtoA (Not a Windows API)
* Note: this function differs from the UNIX strncpy, it _always_ writes
* a terminating \0
*/ */
LPSTR WINAPI lstrcpynWtoA( LPSTR dst, LPCWSTR src, INT32 n ) LPSTR WINAPI lstrcpynWtoA( LPSTR dst, LPCWSTR src, INT32 n )
{ {
@ -541,9 +549,9 @@ BOOL32 WINAPI CharToOem32A( LPCSTR s, LPSTR d )
{ {
LPSTR oldd = d; LPSTR oldd = d;
if (!s || !d) return TRUE; if (!s || !d) return TRUE;
dprintf_info(string,"CharToOem %s\n", debugstr_a (s)); TRACE(string,"CharToOem %s\n", debugstr_a (s));
while ((*d++ = ANSI_TO_OEM(*s++))); while ((*d++ = ANSI_TO_OEM(*s++)));
dprintf_info(string," to %s\n", debugstr_a (oldd)); TRACE(string," to %s\n", debugstr_a (oldd));
return TRUE; return TRUE;
} }
@ -575,9 +583,9 @@ BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d )
{ {
LPSTR oldd = d; LPSTR oldd = d;
if (!s || !d) return TRUE; if (!s || !d) return TRUE;
dprintf_info(string,"CharToOem L%s\n", debugstr_w (s)); TRACE(string,"CharToOem L%s\n", debugstr_w (s));
while ((*d++ = ANSI_TO_OEM(*s++))); while ((*d++ = ANSI_TO_OEM(*s++)));
dprintf_info(string," to %s\n", debugstr_a (oldd)); TRACE(string," to %s\n", debugstr_a (oldd));
return TRUE; return TRUE;
} }
@ -588,9 +596,9 @@ BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d )
BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d ) BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
{ {
LPSTR oldd = d; LPSTR oldd = d;
dprintf_info(string,"OemToChar %s\n", debugstr_a (s)); TRACE(string,"OemToChar %s\n", debugstr_a (s));
while ((*d++ = OEM_TO_ANSI(*s++))); while ((*d++ = OEM_TO_ANSI(*s++)));
dprintf_info(string," to %s\n", debugstr_a (oldd)); TRACE(string," to %s\n", debugstr_a (oldd));
return TRUE; return TRUE;
} }
@ -600,7 +608,7 @@ BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
*/ */
BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len ) BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
{ {
dprintf_info(string,"OemToCharBuff %s\n", debugstr_an (s, len)); TRACE(string,"OemToCharBuff %s\n", debugstr_an (s, len));
while (len--) *d++ = OEM_TO_ANSI(*s++); while (len--) *d++ = OEM_TO_ANSI(*s++);
return TRUE; return TRUE;
} }
@ -611,7 +619,7 @@ BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
*/ */
BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len ) BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len )
{ {
dprintf_info(string,"OemToCharBuff %s\n", debugstr_an (s, len)); TRACE(string,"OemToCharBuff %s\n", debugstr_an (s, len));
while (len--) *d++ = (WCHAR)OEM_TO_ANSI(*s++); while (len--) *d++ = (WCHAR)OEM_TO_ANSI(*s++);
return TRUE; return TRUE;
} }

View File

@ -109,7 +109,7 @@ const K32OBJ_OPS MEM_MAPPED_FILE_Ops =
}; };
#define VIRTUAL_DEBUG_DUMP_VIEW(view) \ #define VIRTUAL_DEBUG_DUMP_VIEW(view) \
if (!debugging_info(virtual)); else VIRTUAL_DumpView(view) if (!TRACE_ON(virtual)); else VIRTUAL_DumpView(view)
/*********************************************************************** /***********************************************************************
* VIRTUAL_GetProtStr * VIRTUAL_GetProtStr
@ -345,7 +345,7 @@ static BYTE VIRTUAL_GetProt( DWORD protect )
static BOOL32 VIRTUAL_SetProt( FILE_VIEW *view, UINT32 base, static BOOL32 VIRTUAL_SetProt( FILE_VIEW *view, UINT32 base,
UINT32 size, BYTE vprot ) UINT32 size, BYTE vprot )
{ {
dprintf_info(virtual, "VIRTUAL_SetProt: %08x-%08x %s\n", TRACE(virtual, "%08x-%08x %s\n",
base, base + size - 1, VIRTUAL_GetProtStr( vprot ) ); base, base + size - 1, VIRTUAL_GetProtStr( vprot ) );
if (mprotect( (void *)base, size, VIRTUAL_GetUnixProt(vprot) )) if (mprotect( (void *)base, size, VIRTUAL_GetUnixProt(vprot) ))
@ -437,14 +437,23 @@ BOOL32 VIRTUAL_Init(void)
/*********************************************************************** /***********************************************************************
* VirtualAlloc (KERNEL32.548) * VirtualAlloc (KERNEL32.548)
* Reserves or commits a region of pages in virtual address space
*
* RETURNS
* Base address of allocated region of pages
* NULL: Failure
*/ */
LPVOID WINAPI VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect) LPVOID WINAPI VirtualAlloc(
{ LPVOID addr, /* Address of region to reserve or commit */
DWORD size, /* Size of region */
DWORD type, /* Type of allocation */
DWORD protect /* Type of access protection */
) {
FILE_VIEW *view; FILE_VIEW *view;
UINT32 base, ptr, view_size; UINT32 base, ptr, view_size;
BYTE vprot; BYTE vprot;
dprintf_info(virtual, "VirtualAlloc: %08x %08lx %lx %08lx\n", TRACE(virtual, "%08x %08lx %lx %08lx\n",
(UINT32)addr, size, type, protect ); (UINT32)addr, size, type, protect );
/* Round parameters to a page boundary */ /* Round parameters to a page boundary */
@ -552,13 +561,21 @@ LPVOID WINAPI VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect)
/*********************************************************************** /***********************************************************************
* VirtualFree (KERNEL32.550) * VirtualFree (KERNEL32.550)
* Release or decommits a region of pages in virtual address space.
*
* RETURNS
* TRUE: Success
* FALSE: Failure
*/ */
BOOL32 WINAPI VirtualFree( LPVOID addr, DWORD size, DWORD type ) BOOL32 WINAPI VirtualFree(
{ LPVOID addr, /* Address of region of committed pages */
DWORD size, /* Size of region */
DWORD type /* Type of operation */
) {
FILE_VIEW *view; FILE_VIEW *view;
UINT32 base; UINT32 base;
dprintf_info(virtual, "VirtualFree: %08x %08lx %lx\n", TRACE(virtual, "%08x %08lx %lx\n",
(UINT32)addr, size, type ); (UINT32)addr, size, type );
/* Fix the parameters */ /* Fix the parameters */
@ -602,33 +619,61 @@ BOOL32 WINAPI VirtualFree( LPVOID addr, DWORD size, DWORD type )
/*********************************************************************** /***********************************************************************
* VirtualLock (KERNEL32.551) * VirtualLock (KERNEL32.551)
* Locks the specified region of virtual address space
*
* NOTE
* Always returns TRUE
*
* RETURNS
* TRUE: Success
* FALSE: Failure
*/ */
BOOL32 WINAPI VirtualLock( LPVOID addr, DWORD size ) BOOL32 WINAPI VirtualLock(
{ LPVOID addr, /* Address of first byte of range to lock */
DWORD size /* Number of bytes in range to lock */
) {
return TRUE; return TRUE;
} }
/*********************************************************************** /***********************************************************************
* VirtualUnlock (KERNEL32.556) * VirtualUnlock (KERNEL32.556)
* Unlocks a range of pages in the virtual address space
*
* NOTE
* Always returns TRUE
*
* RETURNS
* TRUE: Success
* FALSE: Failure
*/ */
BOOL32 WINAPI VirtualUnlock( LPVOID addr, DWORD size ) BOOL32 WINAPI VirtualUnlock(
{ LPVOID addr, /* Address of first byte of range */
DWORD size /* Number of bytes in range */
) {
return TRUE; return TRUE;
} }
/*********************************************************************** /***********************************************************************
* VirtualProtect (KERNEL32.552) * VirtualProtect (KERNEL32.552)
* Changes the access protection on a region of committed pages
*
* RETURNS
* TRUE: Success
* FALSE: Failure
*/ */
BOOL32 WINAPI VirtualProtect( LPVOID addr, DWORD size, DWORD new_prot, BOOL32 WINAPI VirtualProtect(
LPDWORD old_prot ) LPVOID addr, /* Address of region of committed pages */
{ DWORD size, /* Size of region */
DWORD new_prot, /* Desired access protection */
LPDWORD old_prot /* Address of variable to get old protection */
) {
FILE_VIEW *view; FILE_VIEW *view;
UINT32 base, i; UINT32 base, i;
BYTE vprot, *p; BYTE vprot, *p;
dprintf_info(virtual, "VirtualProtect: %08x %08lx %08lx\n", TRACE(virtual, "%08x %08lx %08lx\n",
(UINT32)addr, size, new_prot ); (UINT32)addr, size, new_prot );
/* Fix the parameters */ /* Fix the parameters */
@ -663,10 +708,20 @@ BOOL32 WINAPI VirtualProtect( LPVOID addr, DWORD size, DWORD new_prot,
/*********************************************************************** /***********************************************************************
* VirtualProtectEx (KERNEL32.553) * VirtualProtectEx (KERNEL32.553)
* Changes the access protection on a region of committed pages in the
* virtual address space of a specified process
*
* RETURNS
* TRUE: Success
* FALSE: Failure
*/ */
BOOL32 WINAPI VirtualProtectEx( HANDLE32 handle, LPVOID addr, DWORD size, BOOL32 WINAPI VirtualProtectEx(
DWORD new_prot, LPDWORD old_prot ) HANDLE32 handle, /* Handle of process */
{ LPVOID addr, /* Address of region of committed pages */
DWORD size, /* Size of region */
DWORD new_prot, /* Desired access protection */
LPDWORD old_prot /* Address of variable to get old protection */
) {
BOOL32 ret = FALSE; BOOL32 ret = FALSE;
PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_VM_OPERATION ); PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_VM_OPERATION );
@ -684,10 +739,16 @@ BOOL32 WINAPI VirtualProtectEx( HANDLE32 handle, LPVOID addr, DWORD size,
/*********************************************************************** /***********************************************************************
* VirtualQuery (KERNEL32.554) * VirtualQuery (KERNEL32.554)
* Provides info about a range of pages in virtual address space
*
* RETURNS
* Number of bytes returned in information buffer
*/ */
BOOL32 WINAPI VirtualQuery( LPCVOID addr, LPMEMORY_BASIC_INFORMATION info, DWORD WINAPI VirtualQuery(
DWORD len ) LPCVOID addr, /* Address of region */
{ LPMEMORY_BASIC_INFORMATION info, /* Address of info buffer */
DWORD len /* Size of buffer */
) {
FILE_VIEW *view = VIRTUAL_FirstView; FILE_VIEW *view = VIRTUAL_FirstView;
UINT32 base = ROUND_ADDR( addr ); UINT32 base = ROUND_ADDR( addr );
UINT32 alloc_base = 0; UINT32 alloc_base = 0;
@ -740,17 +801,25 @@ BOOL32 WINAPI VirtualQuery( LPCVOID addr, LPMEMORY_BASIC_INFORMATION info,
info->BaseAddress = (LPVOID)base; info->BaseAddress = (LPVOID)base;
info->AllocationBase = (LPVOID)alloc_base; info->AllocationBase = (LPVOID)alloc_base;
info->RegionSize = size - (base - alloc_base); info->RegionSize = size - (base - alloc_base);
return TRUE; return sizeof(*info);
} }
/*********************************************************************** /***********************************************************************
* VirtualQueryEx (KERNEL32.555) * VirtualQueryEx (KERNEL32.555)
* Provides info about a range of pages in virtual address space of a
* specified process
*
* RETURNS
* Number of bytes returned in information buffer
*/ */
BOOL32 WINAPI VirtualQueryEx( HANDLE32 handle, LPCVOID addr, DWORD WINAPI VirtualQueryEx(
LPMEMORY_BASIC_INFORMATION info, DWORD len ) HANDLE32 handle, /* Handle of process */
{ LPCVOID addr, /* Address of region */
BOOL32 ret = FALSE; LPMEMORY_BASIC_INFORMATION info, /* Address of info buffer */
DWORD len /* Size of buffer */
) {
DWORD ret = len;
PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_QUERY_INFORMATION ); PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_QUERY_INFORMATION );
if (pdb) if (pdb)
@ -767,9 +836,15 @@ BOOL32 WINAPI VirtualQueryEx( HANDLE32 handle, LPCVOID addr,
/*********************************************************************** /***********************************************************************
* IsBadReadPtr32 (KERNEL32.354) * IsBadReadPtr32 (KERNEL32.354)
*
* RETURNS
* FALSE: Process has read access to entire block
* TRUE: Otherwise
*/ */
BOOL32 WINAPI IsBadReadPtr32( LPCVOID ptr, UINT32 size ) BOOL32 WINAPI IsBadReadPtr32(
{ LPCVOID ptr, /* Address of memory block */
UINT32 size /* Size of block */
) {
return !VIRTUAL_CheckFlags( (UINT32)ptr, size, return !VIRTUAL_CheckFlags( (UINT32)ptr, size,
VPROT_READ | VPROT_COMMITTED ); VPROT_READ | VPROT_COMMITTED );
} }
@ -777,9 +852,15 @@ BOOL32 WINAPI IsBadReadPtr32( LPCVOID ptr, UINT32 size )
/*********************************************************************** /***********************************************************************
* IsBadWritePtr32 (KERNEL32.357) * IsBadWritePtr32 (KERNEL32.357)
*
* RETURNS
* FALSE: Process has write access to entire block
* TRUE: Otherwise
*/ */
BOOL32 WINAPI IsBadWritePtr32( LPVOID ptr, UINT32 size ) BOOL32 WINAPI IsBadWritePtr32(
{ LPVOID ptr, /* address of memory block */
UINT32 size /* size of block */
) {
return !VIRTUAL_CheckFlags( (UINT32)ptr, size, return !VIRTUAL_CheckFlags( (UINT32)ptr, size,
VPROT_WRITE | VPROT_COMMITTED ); VPROT_WRITE | VPROT_COMMITTED );
} }
@ -814,9 +895,15 @@ BOOL32 WINAPI IsBadCodePtr32( FARPROC32 ptr )
/*********************************************************************** /***********************************************************************
* IsBadStringPtr32A (KERNEL32.355) * IsBadStringPtr32A (KERNEL32.355)
*
* RETURNS
* FALSE: Read access to all bytes in string
* TRUE: Else
*/ */
BOOL32 WINAPI IsBadStringPtr32A( LPCSTR str, UINT32 max ) BOOL32 WINAPI IsBadStringPtr32A(
{ LPCSTR str, /* Address of string */
UINT32 max /* Maximum size of string */
) {
FILE_VIEW *view; FILE_VIEW *view;
UINT32 page, count; UINT32 page, count;
@ -842,9 +929,15 @@ BOOL32 WINAPI IsBadStringPtr32A( LPCSTR str, UINT32 max )
/*********************************************************************** /***********************************************************************
* IsBadStringPtr32W (KERNEL32.356) * IsBadStringPtr32W (KERNEL32.356)
*
* RETURNS
* FALSE: Read access to all bytes in string
* TRUE: Else
*/ */
BOOL32 WINAPI IsBadStringPtr32W( LPCWSTR str, UINT32 max ) BOOL32 WINAPI IsBadStringPtr32W(
{ LPCWSTR str, /* Address of string */
UINT32 max /* Maximum size of string */
) {
FILE_VIEW *view; FILE_VIEW *view;
UINT32 page, count; UINT32 page, count;
@ -870,11 +963,21 @@ BOOL32 WINAPI IsBadStringPtr32W( LPCWSTR str, UINT32 max )
/*********************************************************************** /***********************************************************************
* CreateFileMapping32A (KERNEL32.46) * CreateFileMapping32A (KERNEL32.46)
* Creates a named or unnamed file-mapping object for the specified file
*
* RETURNS
* Handle of the file-mapping object
* 0: Mapping object did not exist
* NULL: Failure
*/ */
HANDLE32 WINAPI CreateFileMapping32A(HFILE32 hFile, LPSECURITY_ATTRIBUTES attr, HANDLE32 WINAPI CreateFileMapping32A(
DWORD protect, DWORD size_high, HFILE32 hFile, /* Handle of file to map */
DWORD size_low, LPCSTR name ) LPSECURITY_ATTRIBUTES attr, /* Optional security attributes */
{ DWORD protect, /* Protection for mapping object */
DWORD size_high, /* High-order 32 bits of object size */
DWORD size_low, /* Low-order 32 bits of object size */
LPCSTR name /* Name of file-mapping object */
) {
FILE_MAPPING *mapping = NULL; FILE_MAPPING *mapping = NULL;
HANDLE32 handle; HANDLE32 handle;
BYTE vprot; BYTE vprot;
@ -900,7 +1003,7 @@ HANDLE32 WINAPI CreateFileMapping32A(HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
/* Check parameters */ /* Check parameters */
dprintf_info(virtual,"CreateFileMapping32A(%x,%p,%08lx,%08lx%08lx,%s)\n", TRACE(virtual,"(%x,%p,%08lx,%08lx%08lx,%s)\n",
hFile, attr, protect, size_high, size_low, name ); hFile, attr, protect, size_high, size_low, name );
vprot = VIRTUAL_GetProt( protect ); vprot = VIRTUAL_GetProt( protect );
@ -996,9 +1099,17 @@ HANDLE32 WINAPI CreateFileMapping32W(HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
/*********************************************************************** /***********************************************************************
* OpenFileMapping32A (KERNEL32.397) * OpenFileMapping32A (KERNEL32.397)
* Opens a named file-mapping object
*
* RETURNS
* Open handle to specified file-mapping object
* NULL: Failure
*/ */
HANDLE32 WINAPI OpenFileMapping32A( DWORD access, BOOL32 inherit, LPCSTR name ) HANDLE32 WINAPI OpenFileMapping32A(
{ DWORD access, /* Access mode */
BOOL32 inherit, /* Inherit flag */
LPCSTR name /* Name of file-mapping object */
) {
HANDLE32 handle = 0; HANDLE32 handle = 0;
K32OBJ *obj; K32OBJ *obj;
SYSTEM_LOCK(); SYSTEM_LOCK();
@ -1042,10 +1153,19 @@ static void VIRTUAL_DestroyMapping( K32OBJ *ptr )
/*********************************************************************** /***********************************************************************
* MapViewOfFile (KERNEL32.385) * MapViewOfFile (KERNEL32.385)
* Maps a view of a file into the address space
*
* RETURNS
* Starting address of mapped view
* NULL: Failure
*/ */
LPVOID WINAPI MapViewOfFile( HANDLE32 mapping, DWORD access, DWORD offset_high, LPVOID WINAPI MapViewOfFile(
DWORD offset_low, DWORD count ) HANDLE32 mapping, /* File-mapping object to map */
{ DWORD access, /* Access mode */
DWORD offset_high, /* High-order 32 bits of file offset */
DWORD offset_low, /* Low-order 32 bits of file offset */
DWORD count /* Number of bytes to map */
) {
return MapViewOfFileEx( mapping, access, offset_high, return MapViewOfFileEx( mapping, access, offset_high,
offset_low, count, NULL ); offset_low, count, NULL );
} }
@ -1053,10 +1173,20 @@ LPVOID WINAPI MapViewOfFile( HANDLE32 mapping, DWORD access, DWORD offset_high,
/*********************************************************************** /***********************************************************************
* MapViewOfFileEx (KERNEL32.386) * MapViewOfFileEx (KERNEL32.386)
* Maps a view of a file into the address space
*
* RETURNS
* Starting address of mapped view
* NULL: Failure
*/ */
LPVOID WINAPI MapViewOfFileEx(HANDLE32 handle, DWORD access, DWORD offset_high, LPVOID WINAPI MapViewOfFileEx(
DWORD offset_low, DWORD count, LPVOID addr ) HANDLE32 handle, /* File-mapping object to map */
{ DWORD access, /* Access mode */
DWORD offset_high, /* High-order 32 bits of file offset */
DWORD offset_low, /* Low-order 32 bits of file offset */
DWORD count, /* Number of bytes to map */
LPVOID addr /* Suggested starting address for mapped view */
) {
FILE_MAPPING *mapping; FILE_MAPPING *mapping;
FILE_VIEW *view; FILE_VIEW *view;
UINT32 ptr = (UINT32)-1, size = 0; UINT32 ptr = (UINT32)-1, size = 0;
@ -1112,7 +1242,7 @@ LPVOID WINAPI MapViewOfFileEx(HANDLE32 handle, DWORD access, DWORD offset_high,
/* Map the file */ /* Map the file */
dprintf_info(virtual, "MapViewOfFile: handle=%x size=%x offset=%lx\n", TRACE(virtual, "handle=%x size=%x offset=%lx\n",
handle, size, offset_low ); handle, size, offset_low );
ptr = (UINT32)FILE_dommap( mapping->file, addr, 0, size, 0, offset_low, ptr = (UINT32)FILE_dommap( mapping->file, addr, 0, size, 0, offset_low,
@ -1141,13 +1271,20 @@ error:
/*********************************************************************** /***********************************************************************
* FlushViewOfFile (KERNEL32.262) * FlushViewOfFile (KERNEL32.262)
* Writes to the disk a byte range within a mapped view of a file
*
* RETURNS
* TRUE: Success
* FALSE: Failure
*/ */
BOOL32 WINAPI FlushViewOfFile( LPCVOID base, DWORD cbFlush ) BOOL32 WINAPI FlushViewOfFile(
{ LPCVOID base, /* Start address of byte range to flush */
DWORD cbFlush /* Number of bytes in range */
) {
FILE_VIEW *view; FILE_VIEW *view;
UINT32 addr = ROUND_ADDR( base ); UINT32 addr = ROUND_ADDR( base );
dprintf_info(virtual, "FlushViewOfFile at %p for %ld bytes\n", TRACE(virtual, "FlushViewOfFile at %p for %ld bytes\n",
base, cbFlush ); base, cbFlush );
if (!(view = VIRTUAL_FindView( addr ))) if (!(view = VIRTUAL_FindView( addr )))
@ -1159,8 +1296,8 @@ BOOL32 WINAPI FlushViewOfFile( LPCVOID base, DWORD cbFlush )
if (!msync( (void *)addr, cbFlush, MS_SYNC )) return TRUE; if (!msync( (void *)addr, cbFlush, MS_SYNC )) return TRUE;
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
return FALSE; return FALSE;
} }
/*********************************************************************** /***********************************************************************
* UnmapViewOfFile (KERNEL32.540) * UnmapViewOfFile (KERNEL32.540)
*/ */

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