From a11d7b1a6830d9c2802408a6d65e15d4bf57415d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 1 Mar 1998 20:05:02 +0000 Subject: [PATCH] Release 980301 Sun Mar 1 10:45:23 1998 Andreas Mohr <100.30936@germany.net> * [loader/ne_image.c] Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0). * [msdos/dosmem.c] Export address for __0000H, too. * [msdos/dpmi.c] Changed MemAlloc functions to return less fragmented addresses. Sat Feb 28 18:50:12 1998 Alexandre Julliard * [scheduler/process.c] [scheduler/sysdeps.c] Don't use %fs register before threading initialization. Sat Feb 28 14:04:56 1998 Kristian Nielsen * [configure.in] [include/acconfig.h] Autoconf macro to check for non-reentrant X libraries. * [windows/winpos.c] In SetWindowPos32(), do not cause WM_SIZE messages when the SWP_NOSIZE flag is specified. This fixes the division-by-zero in Borland C++ 4.0 "Open Project" menu item. Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca> * [ole/ole2nls.c] Changed "English" values from German to English. * [files/dos_fs.c] Fixed off-by-one month bug. Fri Feb 27 22:12:01 1998 Douglas Ridgway * [windows/win.c] Fix winelib class menu loading bug. * [include/module.h] [loader/module.c] LoadModule32 should be implemented in terms of CreateProcess. * [programs/view/*] Metafile viewer sample program. * [documentation/wine.texinfo] [documentation/Makefile.in] Improvements and additions, HTML target. Fri Feb 27 04:27:48 1998 Dimitrie O. Paun * [*/*] Switched to the new debug messages interface. For more information please refer to documentation/debug-msgs. Because the new scheme introduces a new semantic level, I had to manually do through about 530 dprintf_xxx! The rest of about 2400 where transformed via a script. Because of the large number of changes that I had to do, some may have not come out as nicely as I wanted them. If this is the case, please let me know. There is a lot of work left to do: -- a few hundred printf's to be converted -- about 2300 fprintf's to be converted -- about 600 FIXME's to be transformed The problem is that in the above mentioned cases, a lot of manual intervention is required because a lot of the information is missing. There are also a lot of other things to be done to the interface and so forth. I have now ideas for a at least a month worth of full time work :) I will proceed with many changes in the next few releases, so please do not start modifing things because there will be a hell of a lot of conflicts. If you have ideas that you want to integrate or you want to work on different things, please coordinate with me. Thu Feb 26 13:04:29 1998 David Lee Lambert * [ole/ole2nls.c] [include/windows.h] First try at OLE date- and time-formatting functions. Wed Feb 25 11:20:35 1998 Marcus Meissner * [files/*.c] Changed dos device handling, added 'CON' devicehandling. * [graphics/ddraw.c] Bug fixes, some additions. * [if1632/builtin.c][loader/module.c][library/winestub.c] Small hack so we don't need a dummy BUILTIN_LoadModule in winestub.c. * [ole/*][relay32/ole32.spec][if1632/storage.spec] storage.dll started. winword loads documents (saving doesn't work yet, dunno why). Several ole additions, some cleanups and bugfixes. IMalloc16 implemented. * [loader/pe_image.c] Added some comments, fixed circular dll references, fixed modref ordering, fixed tls allocation. * [memory/global.c] Added validity checks before every GET_ARENA_PTR. (several functions rely on Global* return values on invalid handles, like IsTask). Implemented GlobalUnlockFree16. * [memory/virtual.c] Replaced dprintf_virtual by fprintf, so we can do 'info map' again in the debugger. Increase read linesize for Linux2.1 cases. * [misc/cpu.c][misc/registry.c] Moved cpu registry initialization to misc/cpu.c. * [multimedia/dsound.c] Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT. * [relay32/crtdll.spec][relay32/ntdll.spec] Replaced some ptr by respective 'str' and 'wstr' arguments for libc functions. * [scheduler/thread.c] Added some sanity checks to stackallocation, tlshandling fixed. * [tools/build.c] Fixed cdecl argumenttype order (was reversed). * [win32/ordinals.c] Implemented KERNEL_449. * [windows/dinput.c] Some fixes, needs much more work. Tomb Raider2 works with keyboard ;) Tue Feb 24 20:46:37 1998 James Juran * [windows/win.c] Fixed USER32 ordinal numbers in documentation. Sat Feb 21 12:30:38 1998 John Richardson * [files/file.c] [include/k32obj.h] [memory/virtual.c] [scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c] [scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c] [scheduler/semaphore.c] [scheduler/thread.c] Added generic k32obj read and write routines for k32objs that support I/O. * [documentation/console] Updated console docs. * [win32/console.c] Make console work like a k32obj that supports I/O. * [include/windows.h] Make WriteFile and ReadFile take HANDLE32 for handle. Sun Feb 15 14:07:07 1998 Dimitrie O. Paun * [controls/menu.c] [misc/ver.c] [multimedia/dsound.c] [multimedia/joystick.c] [windows/dialog.c] Modified some dprintf_xxx's to prepare them for a new dprintf_ scheme. Basically, I changed the dprintf's that outputed a line with many dprintf calls to do just one dprintf call. --- ANNOUNCE | 16 +- AUTHORS | 1 + ChangeLog | 163 +++ configure | 281 +++-- configure.in | 42 + controls/combo.c | 39 +- controls/edit.c | 47 +- controls/listbox.c | 50 +- controls/menu.c | 143 ++- controls/progress.c | 9 +- controls/scroll.c | 23 +- controls/uitools.c | 2 +- controls/updown.c | 24 +- documentation/Makefile.in | 16 +- documentation/console | 62 +- documentation/debug-msgs | 351 ++++++ documentation/debugging | 154 +-- documentation/wine.texinfo | 59 +- files/directory.c | 25 +- files/dos_fs.c | 105 +- files/drive.c | 23 +- files/file.c | 252 ++-- files/profile.c | 46 +- graphics/bitblt.c | 13 +- graphics/ddraw.c | 267 +++-- graphics/env.c | 1 - graphics/mapping.c | 3 +- graphics/metafiledrv/graphics.c | 1 - graphics/metafiledrv/init.c | 7 +- graphics/metafiledrv/objects.c | 3 +- graphics/metafiledrv/text.c | 1 - graphics/painting.c | 1 - graphics/win16drv/brush.c | 3 +- graphics/win16drv/font.c | 24 +- graphics/win16drv/graphics.c | 9 +- graphics/win16drv/init.c | 27 +- graphics/win16drv/objects.c | 3 +- graphics/win16drv/pen.c | 5 +- graphics/win16drv/prtdrv.c | 73 +- graphics/win16drv/text.c | 5 +- graphics/wing.c | 1 - graphics/x11drv/bitblt.c | 13 +- graphics/x11drv/bitmap.c | 1 - graphics/x11drv/brush.c | 13 +- graphics/x11drv/clipping.c | 1 - graphics/x11drv/graphics.c | 5 +- graphics/x11drv/objects.c | 3 +- graphics/x11drv/pen.c | 1 - graphics/x11drv/text.c | 8 +- graphics/x11drv/xfont.c | 47 +- if1632/builtin.c | 5 +- if1632/compobj.spec | 23 +- if1632/dummy.c | 3 +- if1632/gdi.spec | 2 +- if1632/kernel.spec | 8 +- if1632/relay.c | 23 +- if1632/storage.spec | 53 +- if1632/thunk.c | 5 +- if1632/w32sys.spec | 2 +- include/acconfig.h | 3 + include/compobj.h | 11 +- include/config.h.in | 3 + include/ddraw.h | 1 + include/debug.h | 1953 ++----------------------------- include/debugdefs.h | 197 ++++ include/debugstr.h | 3 + include/debugtools.h | 66 ++ include/dinput.h | 126 ++ include/dsound.h | 1 + include/file.h | 4 +- include/interfaces.h | 42 +- include/k32obj.h | 3 + include/mmsystem.h | 62 + include/module.h | 11 + include/ole.h | 45 +- include/process.h | 2 +- include/shlobj.h | 4 +- include/stddebug.h | 256 ---- include/storage.h | 212 ++++ include/thread.h | 10 +- include/version.h | 2 +- include/windows.h | 9 +- include/winerror.h | 40 + ipc/dde_atom.c | 9 +- ipc/dde_atom_test.c | 7 +- ipc/dde_mem.c | 27 +- ipc/dde_proc.c | 68 +- ipc/shm_block.c | 9 +- ipc/shm_fragment.c | 1 - ipc/shm_fragment_test.c | 1 - ipc/shm_main_blk.c | 33 +- ipc/shm_semaph.c | 11 +- ipc/shm_semaph_test.c | 1 - ipc/wine_test_stub.c | 1 - library/winestub.c | 10 +- loader/main.c | 4 - loader/module.c | 85 +- loader/ne_image.c | 117 +- loader/ne_resource.c | 29 +- loader/pe_image.c | 166 +-- loader/pe_resource.c | 1 - loader/resource.c | 101 +- loader/signal.c | 1 + loader/task.c | 35 +- memory/global.c | 129 +- memory/heap.c | 29 +- memory/ldt.c | 3 +- memory/local.c | 126 +- memory/selector.c | 9 +- memory/string.c | 53 +- memory/virtual.c | 56 +- misc/aspi.c | 102 +- misc/comm.c | 128 +- misc/commdlg.c | 75 +- misc/cpu.c | 29 +- misc/crtdll.c | 200 ++-- misc/ddeml.c | 1 - misc/debugstr.c | 16 + misc/error.c | 37 +- misc/lstr.c | 13 +- misc/lzexpand.c | 25 +- misc/main.c | 87 +- misc/mpr.c | 1 - misc/ntdll.c | 1 - misc/registry.c | 189 ++- misc/shell.c | 47 +- misc/shellord.c | 7 +- misc/spy.c | 35 +- misc/stress.c | 28 +- misc/toolhelp.c | 5 +- misc/tweak.c | 2 +- misc/ver.c | 180 ++- misc/version.c | 3 +- misc/winsock.c | 181 ++- misc/winsock_dns.c | 12 +- misc/wsprintf.c | 18 +- miscemu/emulate.c | 12 +- msdos/dosmem.c | 5 +- msdos/dpmi.c | 8 +- msdos/int10.c | 1 - msdos/int11.c | 1 - msdos/int13.c | 1 - msdos/int15.c | 1 - msdos/int1a.c | 4 +- msdos/int20.c | 1 - msdos/int21.c | 43 +- msdos/int25.c | 5 +- msdos/int26.c | 4 +- msdos/int2a.c | 1 - msdos/int2f.c | 1 - msdos/int3d.c | 1 - msdos/int5c.c | 1 - msdos/interrupts.c | 3 +- msdos/ioports.c | 7 +- msdos/vxd.c | 28 +- multimedia/audio.c | 412 ++++--- multimedia/dsound.c | 296 +++-- multimedia/joystick.c | 27 +- multimedia/mcianim.c | 99 +- multimedia/mcicda.c | 184 +-- multimedia/mcistring.c | 13 +- multimedia/midi.c | 287 +++-- multimedia/mixer.c | 18 +- multimedia/mmaux.c | 58 +- multimedia/mmio.c | 71 +- multimedia/mmsystem.c | 315 ++--- multimedia/time.c | 51 +- objects/bitmap.c | 29 +- objects/brush.c | 15 +- objects/clipping.c | 25 +- objects/color.c | 35 +- objects/cursoricon.c | 49 +- objects/dc.c | 25 +- objects/dib.c | 7 +- objects/font.c | 24 +- objects/gdiobj.c | 31 +- objects/metafile.c | 35 +- objects/oembitmap.c | 1 - objects/palette.c | 37 +- objects/pen.c | 5 +- objects/region.c | 40 +- objects/text.c | 12 +- ole/Makefile.in | 3 +- ole/compobj.c | 202 +++- ole/folders.c | 9 +- ole/ifs.c | 212 +++- ole/ole2.c | 24 +- ole/ole2disp.c | 3 +- ole/ole2nls.c | 333 +++++- ole/olecli.c | 3 +- ole/olesvr.c | 10 +- ole/storage.c | 1595 +++++++++++++++++++++++++ programs/Makefile.in | 2 + programs/clock/ChangeLog | 14 + programs/clock/De.rc | 33 + programs/clock/En.rc | 34 + programs/clock/License_En.c | 48 + programs/clock/Makefile.in | 47 + programs/clock/README | 18 + programs/clock/Sw.rc | 33 + programs/clock/TODO | 36 + programs/clock/clock.rc | 60 + programs/clock/language.c | 146 +++ programs/clock/language.h | 15 + programs/clock/license.c | 52 + programs/clock/license.h | 48 + programs/clock/main.c | 265 +++++ programs/clock/main.h | 84 ++ programs/clock/winclock.c | 206 ++++ programs/clock/winclock.h | 30 + programs/view/Makefile.in | 32 + programs/view/globals.h | 29 + programs/view/init.c | 84 ++ programs/view/lccmakefile | 19 + programs/view/resource.h | 10 + programs/view/view.c | 193 +++ programs/view/viewrc.rc | 60 + programs/view/winmain.c | 49 + programs/winhelp/macro.lex.l | 180 +-- relay32/advapi32.spec | 64 + relay32/builtin32.c | 19 +- relay32/crtdll.spec | 140 +-- relay32/dinput.spec | 1 - relay32/kernel32.spec | 4 +- relay32/mpr.spec | 5 + relay32/ntdll.spec | 64 +- relay32/ole32.spec | 32 +- relay32/relay386.c | 7 +- relay32/user32.spec | 2 +- relay32/wow32.spec | 2 +- scheduler/critsection.c | 2 + scheduler/event.c | 2 + scheduler/k32obj.c | 2 + scheduler/mutex.c | 2 + scheduler/process.c | 27 +- scheduler/semaphore.c | 2 + scheduler/synchro.c | 7 +- scheduler/sysdeps.c | 14 +- scheduler/thread.c | 40 +- tools/build.c | 18 +- tools/find_debug_channels | 41 + tools/fnt2bdf.c | 3 +- tools/make_X11wrappers | 5 +- tools/make_debug | 197 +--- tsx11/ts_xlib.c | 461 ++++---- tsx11/ts_xpm.c | 9 +- tsx11/ts_xresource.c | 25 +- tsx11/ts_xshm.c | 17 +- tsx11/ts_xutil.c | 129 +- win32/advapi.c | 1 - win32/code_page.c | 16 +- win32/console.c | 147 ++- win32/environment.c | 1 - win32/error.c | 1 - win32/except.c | 13 +- win32/file.c | 63 +- win32/init.c | 2 +- win32/kernel32.c | 63 +- win32/newfns.c | 9 +- win32/ordinals.c | 18 +- win32/process.c | 3 +- win32/security.c | 1 - win32/struct32.c | 1 - win32/thread.c | 1 - win32/time.c | 1 - win32/user32.c | 1 - windows/caret.c | 18 +- windows/class.c | 13 +- windows/clipboard.c | 76 +- windows/dce.c | 39 +- windows/defwnd.c | 5 +- windows/dialog.c | 59 +- windows/dinput.c | 168 ++- windows/driver.c | 33 +- windows/event.c | 19 +- windows/hook.c | 17 +- windows/keyboard.c | 117 +- windows/mdi.c | 40 +- windows/message.c | 63 +- windows/nonclient.c | 17 +- windows/painting.c | 14 +- windows/property.c | 25 +- windows/queue.c | 37 +- windows/scroll.c | 7 +- windows/timer.c | 22 +- windows/user.c | 14 + windows/win.c | 126 +- windows/winpos.c | 38 +- windows/winproc.c | 9 +- 289 files changed, 10584 insertions(+), 6833 deletions(-) create mode 100644 documentation/debug-msgs create mode 100644 include/debugdefs.h create mode 100644 include/debugtools.h delete mode 100644 include/stddebug.h create mode 100644 include/storage.h create mode 100644 ole/storage.c create mode 100644 programs/clock/ChangeLog create mode 100644 programs/clock/De.rc create mode 100644 programs/clock/En.rc create mode 100644 programs/clock/License_En.c create mode 100644 programs/clock/Makefile.in create mode 100644 programs/clock/README create mode 100644 programs/clock/Sw.rc create mode 100644 programs/clock/TODO create mode 100644 programs/clock/clock.rc create mode 100644 programs/clock/language.c create mode 100644 programs/clock/language.h create mode 100644 programs/clock/license.c create mode 100644 programs/clock/license.h create mode 100644 programs/clock/main.c create mode 100644 programs/clock/main.h create mode 100644 programs/clock/winclock.c create mode 100644 programs/clock/winclock.h create mode 100644 programs/view/Makefile.in create mode 100644 programs/view/globals.h create mode 100644 programs/view/init.c create mode 100644 programs/view/lccmakefile create mode 100644 programs/view/resource.h create mode 100644 programs/view/view.c create mode 100644 programs/view/viewrc.rc create mode 100644 programs/view/winmain.c create mode 100644 tools/find_debug_channels diff --git a/ANNOUNCE b/ANNOUNCE index f2e7fac55b3..99387fbafb5 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,13 +1,13 @@ -This is release 980215 of Wine, the MS Windows emulator. This is still a +This is release 980301 of Wine, the MS Windows emulator. This is still a developer's only release. There are many bugs and many unimplemented API features. Most applications still do not work correctly. Patches should be submitted to "julliard@lrc.epfl.ch". Please don't forget to include a ChangeLog entry. -WHAT'S NEW with Wine-980215: (see ChangeLog for details) - - Preliminary console allocation support. - - Hopefully no more Xlib errno problems. +WHAT'S NEW with Wine-980301: (see ChangeLog for details) + - New debugging printfs scheme. + - Better DOS device handling. - Lots of bug fixes. See the README file in the distribution for installation instructions. @@ -16,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before the release is available at the ftp sites. The sources will be available from the following locations: - ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980215.tar.gz - ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980215.tar.gz - ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980215.tar.gz - ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980215.tar.gz + ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980301.tar.gz + ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980301.tar.gz + ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980301.tar.gz + ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980301.tar.gz It should also be available from any site that mirrors tsx-11 or sunsite. diff --git a/AUTHORS b/AUTHORS index 09aad3fee1d..458084578e7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,6 +10,7 @@ Dag Asheim, Martin Ayotte, Karl Backström, Peter Bajusz, +Marcel Baur, Georg Beyerle, Ross Biro, Martin Boehme, diff --git a/ChangeLog b/ChangeLog index 7ee7ad44611..a77cdc3c014 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,167 @@ ---------------------------------------------------------------------- +Sun Feb 29 10:45:23 1997 Andreas Mohr <100.30936@germany.net> + + * [loader/ne_image.c] + Fixed problem with weird DLLs (NE_FFLAGS_SINGLEDATA && DGROUP = 0). + + * [msdos/dosmem.c] + Export address for __0000H, too. + + * [msdos/dpmi.c] + Changed MemAlloc functions to return less fragmented addresses. + +Sat Feb 28 18:50:12 1998 Alexandre Julliard + + * [scheduler/process.c] [scheduler/sysdeps.c] + Don't use %fs register before threading initialization. + +Sat Feb 28 14:04:56 1998 Kristian Nielsen + + * [configure.in] [include/acconfig.h] + Autoconf macro to check for non-reentrant X libraries. + + * [windows/winpos.c] + In SetWindowPos32(), do not cause WM_SIZE messages when the + SWP_NOSIZE flag is specified. This fixes the division-by-zero in + Borland C++ 4.0 "Open Project" menu item. + +Sat Feb 28 13:11:26 1998 James Moody <013263m@dragon.acadiau.ca> + + * [ole/ole2nls.c] + Changed "English" values from German to English. + + * [files/dos_fs.c] + Fixed off-by-one month bug. + +Fri Feb 27 22:12:01 1998 Douglas Ridgway + + * [windows/win.c] + Fix winelib class menu loading bug. + + * [include/module.h] [loader/module.c] + LoadModule32 should be implemented in terms of CreateProcess. + + * [programs/view/*] + Metafile viewer sample program. + + * [documentation/wine.texinfo] [documentation/Makefile.in] + Improvements and additions, HTML target. + +Fri Feb 27 04:27:48 1998 Dimitrie O. Paun + + * [*/*] + Switched to the new debug messages interface. For more information + please refer to documentation/debug-msgs. Because the new scheme + introduces a new semantic level, I had to manually do through + about 530 dprintf_xxx! The rest of about 2400 where transformed + via a script. Because of the large number of changes that I had + to do, some may have not come out as nicely as I wanted them. If + this is the case, please let me know. There is a lot of work left + to do: -- a few hundred printf's to be converted -- about 2300 + fprintf's to be converted -- about 600 FIXME's to be transformed + The problem is that in the above mentioned cases, a lot of manual + intervention is required because a lot of the information is + missing. There are also a lot of other things to be done to the + interface and so forth. I have now ideas for a at least a month + worth of full time work :) I will proceed with many changes in the + next few releases, so please do not start modifing things because + there will be a hell of a lot of conflicts. If you have ideas that + you want to integrate or you want to work on different things, + please coordinate with me. + +Thu Feb 26 13:04:29 1998 David Lee Lambert + + * [ole/ole2nls.c] [include/windows.h] + First try at OLE date- and time-formatting functions. + +Wed Feb 25 11:20:35 1998 Marcus Meissner + + * [files/*.c] + Changed dos device handling, added 'CON' devicehandling. + + * [graphics/ddraw.c] + Bug fixes, some additions. + + * [if1632/builtin.c][loader/module.c][library/winestub.c] + Small hack so we don't need a dummy BUILTIN_LoadModule + in winestub.c. + + * [ole/*][relay32/ole32.spec][if1632/storage.spec] + storage.dll started. winword loads documents (saving + doesn't work yet, dunno why). + Several ole additions, some cleanups and bugfixes. + IMalloc16 implemented. + + * [loader/pe_image.c] + Added some comments, fixed circular dll references, + fixed modref ordering, fixed tls allocation. + + * [memory/global.c] + Added validity checks before every GET_ARENA_PTR. + (several functions rely on Global* return values + on invalid handles, like IsTask). + Implemented GlobalUnlockFree16. + + * [memory/virtual.c] + Replaced dprintf_virtual by fprintf, so we can + do 'info map' again in the debugger. Increase read + linesize for Linux2.1 cases. + + * [misc/cpu.c][misc/registry.c] + Moved cpu registry initialization to misc/cpu.c. + + * [multimedia/dsound.c] + Enhanced, replaced GETOSPACE bufferingcheck by SETFRAGMENT. + + * [relay32/crtdll.spec][relay32/ntdll.spec] + Replaced some ptr by respective 'str' and 'wstr' arguments + for libc functions. + + * [scheduler/thread.c] + Added some sanity checks to stackallocation, tlshandling fixed. + + * [tools/build.c] + Fixed cdecl argumenttype order (was reversed). + + * [win32/ordinals.c] + Implemented KERNEL_449. + + * [windows/dinput.c] + Some fixes, needs much more work. Tomb Raider2 works with keyboard ;) + +Tue Feb 24 20:46:37 1998 James Juran + + * [windows/win.c] + Fixed USER32 ordinal numbers in documentation. + +Sat Feb 21 12:30:38 1998 John Richardson + + * [files/file.c] [include/k32obj.h] [memory/virtual.c] + [scheduler/critsection.c] [scheduler/event.c] [scheduler/handle.c] + [scheduler/k32obj.c] [scheduler/mutex.c] [scheduler/process.c] + [scheduler/semaphore.c] [scheduler/thread.c] + Added generic k32obj read and write routines for k32objs that + support I/O. + + * [documentation/console] + Updated console docs. + + * [win32/console.c] + Make console work like a k32obj that supports I/O. + + * [include/windows.h] + Make WriteFile and ReadFile take HANDLE32 for handle. + +---------------------------------------------------------------------- +Sun Feb 15 14:07:07 1998 Dimitrie O. Paun + + * [controls/menu.c] [misc/ver.c] [multimedia/dsound.c] + [multimedia/joystick.c] [windows/dialog.c] + Modified some dprintf_xxx's to prepare them for a new + dprintf_ scheme. Basically, I changed the dprintf's that + outputed a line with many dprintf calls to do just one + dprintf call. + Sun Feb 15 12:02:59 1998 Alexandre Julliard * [graphics/x11drv/*.c] [objects/*.c] diff --git a/configure b/configure index 44efdaeed6d..0aadfa3f145 100755 --- a/configure +++ b/configure @@ -16,6 +16,8 @@ ac_help="$ac_help --disable-emulator build only the Wine library, not the emulator" ac_help="$ac_help --enable-dll build the Wine library as a DLL" +ac_help="$ac_help + --without-reentrant-x Compile for use with non-reentrant X libraries" ac_help="$ac_help --with-x use the X Window System" @@ -569,13 +571,20 @@ fi +# Check whether --with-reentrant-x or --without-reentrant-x was given. +if test "${with_reentrant_x+set}" = set; then + withval="$with_reentrant_x" + : +fi + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:579: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:588: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -604,7 +613,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:608: checking for $ac_word" >&5 +echo "configure:617: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -633,7 +642,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:637: checking for $ac_word" >&5 +echo "configure:646: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -681,7 +690,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -691,11 +700,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -715,12 +724,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:719: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:724: checking whether we are using GNU C" >&5 +echo "configure:733: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -729,7 +738,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -744,7 +753,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:748: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:757: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -772,7 +781,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:776: checking how to run the C preprocessor" >&5 +echo "configure:785: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -787,13 +796,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -804,13 +813,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -837,7 +846,7 @@ echo "$ac_t""$CPP" 1>&6 # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:841: checking for X" >&5 +echo "configure:850: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -899,12 +908,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -973,14 +982,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1086,17 +1095,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:1090: checking whether -R must be followed by a space" >&5 +echo "configure:1099: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -1112,14 +1121,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -1151,7 +1160,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:1155: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:1164: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1159,7 +1168,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1192,7 +1201,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:1196: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:1205: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1200,7 +1209,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1240,12 +1249,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1244: checking for gethostbyname" >&5 +echo "configure:1253: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1289,7 +1298,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1293: checking for gethostbyname in -lnsl" >&5 +echo "configure:1302: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1297,7 +1306,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1338,12 +1347,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1342: checking for connect" >&5 +echo "configure:1351: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1387,7 +1396,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1391: checking for connect in -lsocket" >&5 +echo "configure:1400: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1395,7 +1404,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1430,12 +1439,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:1434: checking for remove" >&5 +echo "configure:1443: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -1479,7 +1488,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:1483: checking for remove in -lposix" >&5 +echo "configure:1492: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1487,7 +1496,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1522,12 +1531,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:1526: checking for shmat" >&5 +echo "configure:1535: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -1571,7 +1580,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:1575: checking for shmat in -lipc" >&5 +echo "configure:1584: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1579,7 +1588,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1623,7 +1632,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:1627: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:1636: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1631,7 +1640,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1671,7 +1680,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1675: checking for $ac_word" >&5 +echo "configure:1684: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1703,7 +1712,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1707: checking for $ac_word" >&5 +echo "configure:1716: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1736,7 +1745,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1740: checking for yywrap in -l$ac_lib" >&5 +echo "configure:1749: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1744,7 +1753,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1780,7 +1789,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1784: checking for $ac_word" >&5 +echo "configure:1793: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1817,7 +1826,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1821: checking for a BSD compatible install" >&5 +echo "configure:1830: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1867,7 +1876,7 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1871: checking whether ln -s works" >&5 +echo "configure:1880: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1890,7 +1899,7 @@ fi echo $ac_n "checking for i386_set_ldt in -li386""... $ac_c" 1>&6 -echo "configure:1894: checking for i386_set_ldt in -li386" >&5 +echo "configure:1903: checking for i386_set_ldt in -li386" >&5 ac_lib_var=`echo i386'_'i386_set_ldt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1898,7 +1907,7 @@ else ac_save_LIBS="$LIBS" LIBS="-li386 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1937,7 +1946,7 @@ else fi echo $ac_n "checking for iswalnum in -lw""... $ac_c" 1>&6 -echo "configure:1941: checking for iswalnum in -lw" >&5 +echo "configure:1950: checking for iswalnum in -lw" >&5 ac_lib_var=`echo w'_'iswalnum | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1945,7 +1954,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1984,7 +1993,7 @@ else fi echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6 -echo "configure:1988: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 +echo "configure:1997: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1992,7 +2001,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXxf86dga $X_LIBS -lXext -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2029,12 +2038,12 @@ fi echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6 -echo "configure:2033: checking "for Open Sound System"" >&5 +echo "configure:2042: checking "for Open Sound System"" >&5 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -2046,7 +2055,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_opensoundsystem="yes" else @@ -2070,12 +2079,12 @@ fi echo $ac_n "checking "for union semun"""... $ac_c" 1>&6 -echo "configure:2074: checking "for union semun"" >&5 +echo "configure:2083: checking "for union semun"" >&5 if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2083,7 +2092,7 @@ int main() { union semun foo ; return 0; } EOF -if { (eval echo configure:2087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_union_semun="yes" else @@ -2111,7 +2120,7 @@ if test "x${GCC}" = "xyes" then CFLAGS="$CFLAGS -Wall" echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6 -echo "configure:2115: checking "for gcc strength-reduce bug"" >&5 +echo "configure:2124: checking "for gcc strength-reduce bug"" >&5 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2119,7 +2128,7 @@ else ac_cv_c_gcc_strength_bug="yes" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_gcc_strength_bug="no" else @@ -2153,7 +2162,7 @@ fi echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6 -echo "configure:2157: checking "whether external symbols need an underscore prefix"" >&5 +echo "configure:2166: checking "whether external symbols need an underscore prefix"" >&5 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2165,14 +2174,14 @@ _ac_test: .long 0 EOF cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_extern_prefix="yes" else @@ -2196,7 +2205,7 @@ fi echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6 -echo "configure:2200: checking "whether assembler accepts .string"" >&5 +echo "configure:2209: checking "whether assembler accepts .string"" >&5 if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2206,14 +2215,14 @@ cat > conftest_asm.s < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_asm_string="yes" else @@ -2240,21 +2249,21 @@ DLLFLAGS="" if test "$LIB_TARGET" = "libwine.so.1.0" then echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6 -echo "configure:2244: checking "whether we can build a dll"" >&5 +echo "configure:2253: checking "whether we can build a dll"" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_dll="yes" else @@ -2279,15 +2288,57 @@ fi +echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 +echo "configure:2293: checking "for reentrant X libraries"" >&5 +if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "x$with_reentrant_x" = "xno" + then + wine_cv_x_reentrant=no + else + libX11_ckeck=none + for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do + if test -e $dir/libX11.so; then + libX11_check="-D $dir/libX11.so" + break 1 + fi + if test -e $dir/libX11.a; then + libX11_check="$dir/libX11.a" + break 1 + fi + done + if test "$libX11_check" != "none"; then + if nm $libX11_check | grep -q __errno_location; then + wine_cv_x_reentrant=yes + else + wine_cv_x_reentrant=no + fi + else + wine_cv_x_reentrant=unknown + fi + fi +fi + +echo "$ac_t""$wine_cv_x_reentrant" 1>&6 +if test "$wine_cv_x_reentrant" = "no" +then + cat >> confdefs.h <<\EOF +#define NO_REENTRANT_X11 1 +EOF + +fi + + for ac_func in clone memmove strerror tcgetattr usleep wait4 waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2286: checking for $ac_func" >&5 +echo "configure:2337: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2338,17 +2389,17 @@ for ac_hdr in wctype.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2342: checking for $ac_hdr" >&5 +echo "configure:2393: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2375,12 +2426,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:2379: checking whether stat file-mode macros are broken" >&5 +echo "configure:2430: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2431,12 +2482,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2435: checking for working const" >&5 +echo "configure:2486: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2506,12 +2557,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2510: checking for ANSI C header files" >&5 +echo "configure:2561: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2519,7 +2570,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2536,7 +2587,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2554,7 +2605,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2575,7 +2626,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2586,7 +2637,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -2610,12 +2661,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2614: checking for size_t" >&5 +echo "configure:2665: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2772,8 +2823,10 @@ multimedia/Makefile objects/Makefile ole/Makefile programs/Makefile +programs/clock/Makefile programs/notepad/Makefile programs/progman/Makefile +programs/view/Makefile programs/winhelp/Makefile programs/winver/Makefile rc/Makefile @@ -2898,8 +2951,10 @@ multimedia/Makefile objects/Makefile ole/Makefile programs/Makefile +programs/clock/Makefile programs/notepad/Makefile programs/progman/Makefile +programs/view/Makefile programs/winhelp/Makefile programs/winver/Makefile rc/Makefile diff --git a/configure.in b/configure.in index c70d80cd219..f02e30c04ad 100644 --- a/configure.in +++ b/configure.in @@ -28,6 +28,9 @@ dnl AC_ARG_WITH(ipc, dnl [ --enable-ipc use inter-process communication for DDE], dnl [if test "$enableval" = "no"; then : ; else OPTIONS="-DCONFIG_IPC"; fi]) +AC_ARG_WITH(reentrant-x, +[ --without-reentrant-x Compile for use with non-reentrant X libraries]) + AC_SUBST(MAIN_TARGET) AC_SUBST(LIB_TARGET) AC_SUBST(OPTIONS) @@ -162,6 +165,43 @@ then fi AC_SUBST(DLLFLAGS) +dnl **** Check for reentrant X libraries **** +dnl +dnl This may fail to determine whether X libraries are reentrant if +dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration +dnl is possible with the --without-reentrant-x option. + +AC_CACHE_CHECK( "for reentrant X libraries", wine_cv_x_reentrant, + [ if test "x$with_reentrant_x" = "xno" + then + wine_cv_x_reentrant=no + else + libX11_ckeck=none + for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do + if test -e $dir/libX11.so; then + libX11_check="-D $dir/libX11.so" + break 1 + fi + if test -e $dir/libX11.a; then + libX11_check="$dir/libX11.a" + break 1 + fi + done + if test "$libX11_check" != "none"; then + if nm $libX11_check | grep -q __errno_location; then + wine_cv_x_reentrant=yes + else + wine_cv_x_reentrant=no + fi + else + wine_cv_x_reentrant=unknown + fi + fi ] ) +if test "$wine_cv_x_reentrant" = "no" +then + AC_DEFINE(NO_REENTRANT_X11) +fi + dnl **** Check for functions and header files **** AC_CHECK_FUNCS(clone memmove strerror tcgetattr usleep wait4 waitpid) @@ -199,8 +239,10 @@ multimedia/Makefile objects/Makefile ole/Makefile programs/Makefile +programs/clock/Makefile programs/notepad/Makefile programs/progman/Makefile +programs/view/Makefile programs/winhelp/Makefile programs/winver/Makefile rc/Makefile diff --git a/controls/combo.c b/controls/combo.c index af61d6321ed..4cacec7b65b 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -18,7 +18,6 @@ #include "heap.h" #include "combo.h" #include "drive.h" -#include "stddebug.h" #include "debug.h" /* bits in the dwKeyData */ @@ -63,7 +62,7 @@ static BOOL32 COMBO_Init() CBitHeight = bm.bmHeight; CBitWidth = bm.bmWidth; - dprintf_combo(stddeb, "combo bitmap [%i,%i]\n", CBitWidth, CBitHeight ); + dprintf_info(combo, "combo bitmap [%i,%i]\n", CBitWidth, CBitHeight ); hPrevB = SelectObject16( hDC, hComboBmp); SetRect16( &r, 0, 0, CBitWidth, CBitHeight ); @@ -102,7 +101,7 @@ static LRESULT COMBO_NCCreate(WND* wnd, LPARAM lParam) if( !(wnd->dwExStyle & WS_EX_NOPARENTNOTIFY) ) lphc->wState |= CBF_NOTIFY; - dprintf_combo(stddeb, "COMBO_NCCreate: [0x%08x], style = %08x\n", + dprintf_info(combo, "COMBO_NCCreate: [0x%08x], style = %08x\n", (UINT32)lphc, lphc->dwStyle ); return (LRESULT)(UINT32)wnd->hwndSelf; @@ -120,7 +119,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc ) { WND* wnd = lphc->self; - dprintf_combo(stddeb,"Combo [%04x]: freeing storage\n", CB_HWND(lphc)); + dprintf_info(combo,"Combo [%04x]: freeing storage\n", CB_HWND(lphc)); if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox ) DestroyWindow32( lphc->hWndLBox ); @@ -219,7 +218,7 @@ static void CBCalcPlacement( LPHEADCOMBO lphc, if( lphc->droppedWidth > (lprLB->right - lprLB->left) ) lprLB->right = lprLB->left + (INT16)lphc->droppedWidth; -dprintf_combo(stddeb,"Combo [%04x]: (%i,%i-%i,%i) placement\n\ttext\t= (%i,%i-%i,%i)\ +dprintf_info(combo,"Combo [%04x]: (%i,%i-%i,%i) placement\n\ttext\t= (%i,%i-%i,%i)\ \n\tbutton\t= (%i,%i-%i,%i)\n\tlbox\t= (%i,%i-%i,%i)\n", CB_HWND(lphc), lphc->RectCombo.left, lphc->RectCombo.top, lphc->RectCombo.right, lphc->RectCombo.bottom, lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom, @@ -338,12 +337,12 @@ static LRESULT COMBO_Create( LPHEADCOMBO lphc, WND* wnd, LPARAM lParam) SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); lphc->wState &= ~CBF_NORESIZE; } - dprintf_combo(stddeb,"COMBO_Create: init done\n"); + dprintf_info(combo,"COMBO_Create: init done\n"); return wnd->hwndSelf; } - dprintf_combo(stderr, "COMBO_Create: edit control failure.\n"); - } else dprintf_combo(stderr, "COMBO_Create: listbox failure.\n"); - } else dprintf_combo(stderr, "COMBO_Create: no owner for visible combo.\n"); + dprintf_err(combo, "COMBO_Create: edit control failure.\n"); + } else dprintf_err(combo, "COMBO_Create: listbox failure.\n"); + } else dprintf_err(combo, "COMBO_Create: no owner for visible combo.\n"); /* CreateWindow() will send WM_NCDESTROY to cleanup */ @@ -562,7 +561,7 @@ static INT32 CBUpdateLBox( LPHEADCOMBO lphc ) if( length > 0 ) pText = (LPSTR) HeapAlloc( GetProcessHeap(), 0, length + 1); - dprintf_combo(stddeb,"\tCBUpdateLBox: edit text length %i\n", length ); + dprintf_info(combo,"\tCBUpdateLBox: edit text length %i\n", length ); if( pText ) { @@ -598,7 +597,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT32 index ) INT32 length; LPSTR pText = NULL; - dprintf_combo(stddeb,"\tCBUpdateEdit: %i\n", index ); + dprintf_info(combo,"\tCBUpdateEdit: %i\n", index ); if( index == -1 ) { @@ -643,7 +642,7 @@ static void CBDropDown( LPHEADCOMBO lphc ) RECT16 rect; LPRECT16 pRect = NULL; - dprintf_combo(stddeb,"Combo [%04x]: drop down\n", CB_HWND(lphc)); + dprintf_info(combo,"Combo [%04x]: drop down\n", CB_HWND(lphc)); CB_NOTIFY( lphc, CBN_DROPDOWN ); @@ -699,7 +698,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL32 ok, BOOL32 bButton ) if( IsWindow32( hWnd ) && CB_GETTYPE(lphc) != CBS_SIMPLE ) { - dprintf_combo(stddeb,"Combo [%04x]: roll up [%i]\n", CB_HWND(lphc), (INT32)ok ); + dprintf_info(combo,"Combo [%04x]: roll up [%i]\n", CB_HWND(lphc), (INT32)ok ); /* always send WM_LBUTTONUP? */ SendMessage32A( lphc->hWndLBox, WM_LBUTTONUP, 0, (LPARAM)(-1) ); @@ -840,7 +839,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM32 wParam, HWND32 hWnd ) { case (EN_SETFOCUS >> 8): - dprintf_combo(stddeb,"Combo [%04x]: edit [%04x] got focus\n", + dprintf_info(combo,"Combo [%04x]: edit [%04x] got focus\n", CB_HWND(lphc), (HWND16)lphc->hWndEdit ); if( !(lphc->wState & CBF_FOCUSED) ) COMBO_SetFocus( lphc ); @@ -848,7 +847,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM32 wParam, HWND32 hWnd ) case (EN_KILLFOCUS >> 8): - dprintf_combo(stddeb,"Combo [%04x]: edit [%04x] lost focus\n", + dprintf_info(combo,"Combo [%04x]: edit [%04x] lost focus\n", CB_HWND(lphc), (HWND16)lphc->hWndEdit ); /* NOTE: it seems that Windows' edit control sends an @@ -889,7 +888,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM32 wParam, HWND32 hWnd ) case LBN_SELCHANGE: case LBN_SELCANCEL: - dprintf_combo(stddeb,"Combo [%04x]: lbox selection change [%04x]\n", + dprintf_info(combo,"Combo [%04x]: lbox selection change [%04x]\n", CB_HWND(lphc), lphc->wState ); /* do not roll up if selection is being tracked @@ -923,7 +922,7 @@ static LRESULT COMBO_ItemOp32( LPHEADCOMBO lphc, UINT32 msg, { HWND32 hWnd = lphc->self->hwndSelf; - dprintf_combo(stddeb,"Combo [%04x]: ownerdraw op %04x\n", + dprintf_info(combo,"Combo [%04x]: ownerdraw op %04x\n", CB_HWND(lphc), (UINT16)msg ); #define lpIS ((LPDELETEITEMSTRUCT32)lParam) @@ -1061,7 +1060,7 @@ static void COMBO_Size( LPHEADCOMBO lphc ) GetWindowRect16( lphc->self->hwndSelf, &rect ); w = rect.right - rect.left; h = rect.bottom - rect.top; - dprintf_combo(stddeb,"COMBO_Size: w = %i, h = %i\n", w, h ); + dprintf_info(combo,"COMBO_Size: w = %i, h = %i\n", w, h ); /* CreateWindow() may send a bogus WM_SIZE, ignore it */ @@ -1258,7 +1257,7 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message, { LPHEADCOMBO lphc = CB_GETPTR(pWnd); - dprintf_combo( stddeb, "Combo [%04x]: msg %s wp %08x lp %08lx\n", + dprintf_info(combo, "Combo [%04x]: msg %s wp %08x lp %08lx\n", pWnd->hwndSelf, SPY_GetMsgName(message), wParam, lParam ); if( lphc || message == WM_NCCREATE ) @@ -1560,7 +1559,7 @@ LRESULT WINAPI ComboWndProc( HWND32 hwnd, UINT32 message, return (lphc->wState & CBF_EUI) ? TRUE : FALSE; case (WM_USER + 0x1B): - dprintf_combo(stddeb,"Combo [%04x]: undocumented msg!\n", (HWND16)hwnd ); + dprintf_warn(combo, "Combo [%04x]: undocumented msg!\n", (HWND16)hwnd ); } return DefWindowProc32A(hwnd, message, wParam, lParam); } diff --git a/controls/edit.c b/controls/edit.c index 303d2f1f70e..35b774f9ca4 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -18,7 +18,6 @@ #include "combo.h" #include "local.h" #include "resource.h" -#include "stddebug.h" #include "debug.h" #include "callback.h" @@ -110,7 +109,7 @@ typedef struct #define ORDER_UINT32(x,y) do { if ((UINT32)(y) < (UINT32)(x)) SWAP_UINT32((x),(y)); } while(0) #define DPRINTF_EDIT_NOTIFY(hwnd, str) \ - ({dprintf_edit(stddeb, \ + ({dprintf_info(edit, \ "edit: notification " str " sent to hwnd=%08x\n", \ (UINT32)(hwnd));}) @@ -123,11 +122,11 @@ typedef struct MAKEWPARAM((wnd)->wIDmenu, wNotifyCode), \ (LPARAM)(wnd)->hwndSelf)) #define DPRINTF_EDIT_MSG16(str) \ - dprintf_edit(stddeb, \ + dprintf_info(edit, \ "edit: 16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \ (UINT32)hwnd, (UINT32)wParam, (UINT32)lParam) #define DPRINTF_EDIT_MSG32(str) \ - dprintf_edit(stddeb, \ + dprintf_info(edit, \ "edit: 32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \ (UINT32)hwnd, (UINT32)wParam, (UINT32)lParam) @@ -987,7 +986,7 @@ static INT32 EDIT_CallWordBreakProc(WND *wnd, EDITSTATE *es, INT32 start, INT32 } else if (es->word_break_proc32A) { - dprintf_relay( stddeb, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n", + dprintf_info(relay, "CallTo32(wordbrk=%p,str='%s',idx=%d,cnt=%d,act=%d)\n", es->word_break_proc32A, es->text + start, index, count, action ); return (INT32)es->word_break_proc32A( es->text + start, index, @@ -1319,7 +1318,7 @@ static BOOL32 EDIT_MakeFit(WND *wnd, EDITSTATE *es, INT32 size) if (size > es->buffer_limit) size = es->buffer_limit; - dprintf_edit(stddeb, "edit: EDIT_MakeFit: trying to ReAlloc to %d+1\n", size); + dprintf_info(edit, "edit: EDIT_MakeFit: trying to ReAlloc to %d+1\n", size); EDIT_UnlockBuffer(wnd, es, TRUE); if (es->text) { @@ -1329,25 +1328,25 @@ static BOOL32 EDIT_MakeFit(WND *wnd, EDITSTATE *es, INT32 size) es->buffer_size = 0; } else if (es->hloc32) { if ((hNew32 = LocalReAlloc32(es->hloc32, size + 1, 0))) { - dprintf_edit(stddeb, "edit: EDIT_MakeFit: Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32); + dprintf_info(edit, "edit: EDIT_MakeFit: Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32); es->hloc32 = hNew32; es->buffer_size = MIN(LocalSize32(es->hloc32) - 1, es->buffer_limit); } } else if (es->hloc16) { if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) { - dprintf_edit(stddeb, "edit: EDIT_MakeFit: Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16); + dprintf_info(edit, "edit: EDIT_MakeFit: Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16); es->hloc16 = hNew16; es->buffer_size = MIN(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit); } } if (es->buffer_size < size) { EDIT_LockBuffer(wnd, es); - dprintf_edit(stddeb, "edit: EDIT_MakeFit: FAILED ! We now have %d+1\n", es->buffer_size); + dprintf_warn(edit, "edit: EDIT_MakeFit: FAILED ! We now have %d+1\n", es->buffer_size); EDIT_NOTIFY_PARENT(wnd, EN_ERRSPACE, "EN_ERRSPACE"); return FALSE; } else { EDIT_LockBuffer(wnd, es); - dprintf_edit(stddeb, "edit: EDIT_MakeFit: We now have %d+1\n", es->buffer_size); + dprintf_info(edit, "edit: EDIT_MakeFit: We now have %d+1\n", es->buffer_size); return TRUE; } } @@ -1366,12 +1365,12 @@ static BOOL32 EDIT_MakeUndoFit(WND *wnd, EDITSTATE *es, INT32 size) return TRUE; size = ((size / GROWLENGTH) + 1) * GROWLENGTH; - dprintf_edit(stddeb, "edit: EDIT_MakeUndoFit: trying to ReAlloc to %d+1\n", size); + dprintf_info(edit, "edit: EDIT_MakeUndoFit: trying to ReAlloc to %d+1\n", size); if ((es->undo_text = HeapReAlloc(es->heap, 0, es->undo_text, size + 1))) { es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1; if (es->undo_buffer_size < size) { - dprintf_edit(stddeb, "edit: EDIT_MakeUndoFit: FAILED ! We now have %d+1\n", es->undo_buffer_size); + dprintf_warn(edit, "edit: EDIT_MakeUndoFit: FAILED ! We now have %d+1\n", es->undo_buffer_size); return FALSE; } return TRUE; @@ -1659,7 +1658,7 @@ static void EDIT_PaintLine(WND *wnd, EDITSTATE *es, HDC32 dc, INT32 line, BOOL32 } else if (line) return; - dprintf_edit(stddeb, "edit: EDIT_PaintLine: line=%d\n", line); + dprintf_info(edit, "edit: EDIT_PaintLine: line=%d\n", line); pos = EDIT_EM_PosFromChar(wnd, es, EDIT_EM_LineIndex(wnd, es, line), FALSE); x = SLOWORD(pos); @@ -1868,7 +1867,7 @@ static INT32 EDIT_WordBreakProc(LPSTR s, INT32 index, INT32 count, INT32 action) { INT32 ret = 0; - dprintf_edit(stddeb, "edit: EDIT_WordBreakProc: s=%p, index=%u" + dprintf_info(edit, "edit: EDIT_WordBreakProc: s=%p, index=%u" ", count=%u, action=%d\n", s, index, count, action); switch (action) { @@ -2008,7 +2007,7 @@ static HLOCAL32 EDIT_EM_GetHandle(WND *wnd, EDITSTATE *es) es->buffer_size = newSize; es->text = newText; EDIT_LockBuffer(wnd, es); - dprintf_edit(stddeb, "edit: EM_GETHANDLE: switched to 32 bit local heap\n"); + dprintf_info(edit, "edit: EM_GETHANDLE: switched to 32 bit local heap\n"); return es->hloc32; } @@ -2047,7 +2046,7 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es) fprintf(stderr, "edit: EM_GETHANDLE: could not initialize local heap\n"); return 0; } - dprintf_edit(stddeb, "edit: EM_GETHANDLE: local heap initialized\n"); + dprintf_info(edit, "edit: EM_GETHANDLE: local heap initialized\n"); } if (!(newBuf = LOCAL_Alloc(wnd->hInstance, LMEM_MOVEABLE, lstrlen32A(es->text) + 1))) { fprintf(stderr, "edit: EM_GETHANDLE: could not allocate new 16 bit buffer\n"); @@ -2072,7 +2071,7 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es) es->buffer_size = newSize; es->text = newText; EDIT_LockBuffer(wnd, es); - dprintf_edit(stddeb, "edit: EM_GETHANDLE: switched to 16 bit buffer\n"); + dprintf_info(edit, "edit: EM_GETHANDLE: switched to 16 bit buffer\n"); return es->hloc16; } @@ -2624,7 +2623,7 @@ static void EDIT_EM_SetMargins(WND *wnd, EDITSTATE *es, INT32 action, INT32 left if (action & EC_RIGHTMARGIN) es->right_margin = right; } - dprintf_edit(stddeb, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin); + dprintf_info(edit, "EDIT_EM_SetMargins: left=%d, right=%d\n", es->left_margin, es->right_margin); } @@ -2810,7 +2809,7 @@ static BOOL32 EDIT_EM_Undo(WND *wnd, EDITSTATE *es) lstrcpy32A(utext, es->undo_text); - dprintf_edit(stddeb, "edit: before UNDO:insertion length = %d, deletion buffer = %s\n", + dprintf_info(edit, "edit: before UNDO:insertion length = %d, deletion buffer = %s\n", es->undo_insert_count, utext); EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE); @@ -2819,7 +2818,7 @@ static BOOL32 EDIT_EM_Undo(WND *wnd, EDITSTATE *es) EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE); HeapFree(es->heap, 0, utext); - dprintf_edit(stddeb, "edit: after UNDO: insertion length = %d, deletion buffer = %s\n", + dprintf_info(edit, "edit: after UNDO: insertion length = %d, deletion buffer = %s\n", es->undo_insert_count, es->undo_text); return TRUE; @@ -2891,7 +2890,7 @@ static void EDIT_WM_Command(WND *wnd, EDITSTATE *es, INT32 code, INT32 id, HWND3 EDIT_EM_ScrollCaret(wnd, es); break; default: - dprintf_edit(stddeb, "edit: unknown menu item, please report\n"); + dprintf_err(edit, "edit: unknown menu item, please report\n"); break; } } @@ -3193,7 +3192,7 @@ static LRESULT EDIT_HScroll_Hack(WND *wnd, EDITSTATE *es, INT32 action, INT32 po break; default: - dprintf_edit(stddeb, "edit: undocumented (hacked) WM_HSCROLL parameter, please report\n"); + dprintf_err(edit, "edit: undocumented (hacked) WM_HSCROLL parameter, please report\n"); return 0; } if (dx) @@ -3286,7 +3285,7 @@ static BOOL32 EDIT_CheckCombo(WND *wnd, UINT32 msg, INT32 key, DWORD key_data) HWND32 hCombo = wnd->parent->hwndSelf; BOOL32 bUIFlip = TRUE; - dprintf_combo(stddeb, "EDIT_CheckCombo [%04x]: handling msg %04x (%04x)\n", + dprintf_info(combo, "EDIT_CheckCombo [%04x]: handling msg %04x (%04x)\n", wnd->hwndSelf, (UINT16)msg, (UINT16)key); switch (msg) { @@ -3719,7 +3718,7 @@ static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPCSTR text) { EDIT_EM_SetSel(wnd, es, 0, -1, FALSE); if (text) { - dprintf_edit(stddeb, "\t'%s'\n", text); + dprintf_info(edit, "\t'%s'\n", text); EDIT_EM_ReplaceSel(wnd, es, FALSE, text); es->x_offset = 0; } diff --git a/controls/listbox.c b/controls/listbox.c index a8304891367..c1512e7296c 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -13,7 +13,6 @@ #include "spy.h" #include "win.h" #include "combo.h" -#include "stddebug.h" #include "debug.h" /* Unimplemented yet: @@ -309,7 +308,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr ) if ((descr->height > descr->item_height) && (descr->height % descr->item_height)) { - dprintf_listbox(stddeb, "Listbox %04x: changing height %d -> %d\n", + dprintf_info(listbox, "Listbox %04x: changing height %d -> %d\n", wnd->hwndSelf, descr->height, descr->height - descr->height%descr->item_height ); SetWindowPos32( wnd->hwndSelf, 0, 0, 0, @@ -320,7 +319,7 @@ static void LISTBOX_UpdateSize( WND *wnd, LB_DESCR *descr ) return; } } - dprintf_listbox( stddeb, "Listbox %04x: new size = %d,%d\n", + dprintf_info(listbox, "Listbox %04x: new size = %d,%d\n", wnd->hwndSelf, descr->width, descr->height ); LISTBOX_UpdatePage( wnd, descr ); LISTBOX_UpdateScroll( wnd, descr ); @@ -458,7 +457,7 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc, if (wnd->dwStyle & WS_DISABLED) dis.itemState |= ODS_DISABLED; dis.itemData = item ? item->data : 0; dis.rcItem = *rect; - dprintf_listbox( stddeb, "Listbox %04x: drawitem %d (%s) action=%02x " + dprintf_info(listbox, "Listbox %04x: drawitem %d (%s) action=%02x " "state=%02x rect=%d,%d-%d,%d\n", wnd->hwndSelf, index, item ? item->str : "", action, dis.itemState, rect->left, rect->top, @@ -480,7 +479,7 @@ static void LISTBOX_PaintItem( WND *wnd, LB_DESCR *descr, HDC32 hdc, oldText = SetTextColor32( hdc, GetSysColor32(COLOR_HIGHLIGHTTEXT)); } - dprintf_listbox( stddeb, "Listbox %04x: painting %d (%s) action=%02x " + dprintf_info(listbox, "Listbox %04x: painting %d (%s) action=%02x " "rect=%d,%d-%d,%d\n", wnd->hwndSelf, index, item ? item->str : "", action, rect->left, rect->top, rect->right, rect->bottom ); @@ -603,12 +602,15 @@ static BOOL32 LISTBOX_SetTabStops( WND *wnd, LB_DESCR *descr, INT32 count, { INT32 i; LPINT16 p = (LPINT16)tabs; - dprintf_listbox( stddeb, "Listbox %04x: settabstops ", wnd->hwndSelf); + dbg_decl_str(listbox, 256); + for (i = 0; i < descr->nb_tabs; i++) { - descr->tabs[i] = *p++<<1; /* FIXME */ - dprintf_listbox( stddeb, "%hd ", descr->tabs[i]); + descr->tabs[i] = *p++<<1; /* FIXME */ + if(debugging_info(listbox)) + dsprintf(listbox, "%hd ", descr->tabs[i]); } - dprintf_listbox( stddeb, "\n"); + dprintf_info(listbox, "Listbox %04x: settabstops %s\n", + wnd->hwndSelf, dbg_str(listbox)); } else memcpy( descr->tabs, tabs, descr->nb_tabs * sizeof(INT32) ); /* FIXME: repaint the window? */ @@ -986,7 +988,7 @@ static LRESULT LISTBOX_SetItemHeight( WND *wnd, LB_DESCR *descr, INT32 index, if (descr->style & LBS_OWNERDRAWVARIABLE) { if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; - dprintf_listbox( stddeb, "Listbox %04x: item %d height = %d\n", + dprintf_info(listbox, "Listbox %04x: item %d height = %d\n", wnd->hwndSelf, index, height ); descr->items[index].height = height; LISTBOX_UpdateScroll( wnd, descr ); @@ -994,7 +996,7 @@ static LRESULT LISTBOX_SetItemHeight( WND *wnd, LB_DESCR *descr, INT32 index, } else if (height != descr->item_height) { - dprintf_listbox( stddeb, "Listbox %04x: new height = %d\n", + dprintf_info(listbox, "Listbox %04x: new height = %d\n", wnd->hwndSelf, height ); descr->item_height = height; LISTBOX_UpdatePage( wnd, descr ); @@ -1016,7 +1018,7 @@ static void LISTBOX_SetHorizontalPos( WND *wnd, LB_DESCR *descr, INT32 pos ) pos = descr->horz_extent - descr->width; if (pos < 0) pos = 0; if (!(diff = descr->horz_pos - pos)) return; - dprintf_listbox( stddeb, "Listbox %04x: new horz pos = %d\n", + dprintf_info(listbox, "Listbox %04x: new horz pos = %d\n", wnd->hwndSelf, pos ); descr->horz_pos = pos; LISTBOX_UpdateScroll( wnd, descr ); @@ -1038,7 +1040,7 @@ static LRESULT LISTBOX_SetHorizontalExtent( WND *wnd, LB_DESCR *descr, return LB_OKAY; if (extent <= 0) extent = 1; if (extent == descr->horz_extent) return LB_OKAY; - dprintf_listbox( stddeb, "Listbox %04x: new horz extent = %d\n", + dprintf_info(listbox, "Listbox %04x: new horz extent = %d\n", wnd->hwndSelf, extent ); descr->horz_extent = extent; if (descr->horz_pos > extent - descr->width) @@ -1056,7 +1058,7 @@ static LRESULT LISTBOX_SetColumnWidth( WND *wnd, LB_DESCR *descr, UINT32 width) { width += 2; /* For left and right margin */ if (width == descr->column_width) return LB_OKAY; - dprintf_listbox( stddeb, "Listbox %04x: new column width = %d\n", + dprintf_info(listbox, "Listbox %04x: new column width = %d\n", wnd->hwndSelf, width ); descr->column_width = width; LISTBOX_UpdatePage( wnd, descr ); @@ -1305,7 +1307,7 @@ static LRESULT LISTBOX_InsertItem( WND *wnd, LB_DESCR *descr, INT32 index, mis.itemHeight = descr->item_height; SendMessage32A( descr->owner, WM_MEASUREITEM, id, (LPARAM)&mis ); item->height = mis.itemHeight ? mis.itemHeight : 1; - dprintf_listbox( stddeb, "Listbox %04x: measure item %d (%s) = %d\n", + dprintf_info(listbox, "Listbox %04x: measure item %d (%s) = %d\n", wnd->hwndSelf, index, str ? str : "", item->height ); } @@ -1357,7 +1359,7 @@ static LRESULT LISTBOX_InsertString( WND *wnd, LB_DESCR *descr, INT32 index, return ret; } - dprintf_listbox( stddeb, "Listbox %04x: added item %d '%s'\n", + dprintf_info(listbox, "Listbox %04x: added item %d '%s'\n", wnd->hwndSelf, index, HAS_STRINGS(descr) ? new_str : "" ); return index; } @@ -1694,7 +1696,7 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr, WPARAM32 wParam, INT32 x, INT32 y ) { INT32 index = LISTBOX_GetItemFromPoint( wnd, descr, x, y ); - dprintf_listbox( stddeb, "Listbox %04x: lbuttondown %d,%d item %d\n", + dprintf_info(listbox, "Listbox %04x: lbuttondown %d,%d item %d\n", wnd->hwndSelf, x, y, index ); if (!descr->caret_on && (GetFocus32() == wnd->hwndSelf)) return 0; if (index != -1) @@ -2029,7 +2031,7 @@ static BOOL32 LISTBOX_Create( WND *wnd, LPHEADCOMBO lphc ) if( lphc ) { - dprintf_combo(stddeb,"ComboLBox [%04x]: resetting owner %04x -> %04x\n", + dprintf_info(combo,"ComboLBox [%04x]: resetting owner %04x -> %04x\n", wnd->hwndSelf, descr->owner, lphc->self->hwndSelf ); descr->owner = lphc->self->hwndSelf; } @@ -2098,7 +2100,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg, if (msg == WM_CREATE) { if (!LISTBOX_Create( wnd, NULL )) return -1; - dprintf_listbox( stddeb, "Listbox: creating wnd=%04x descr=%p\n", + dprintf_info(listbox, "Listbox: creating wnd=%04x descr=%p\n", hwnd, *(LB_DESCR **)wnd->wExtra ); return 0; } @@ -2106,7 +2108,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg, return DefWindowProc32A( hwnd, msg, wParam, lParam ); } - dprintf_listbox( stddeb, "Listbox %04x: msg %s wp %08x lp %08lx\n", + dprintf_info(listbox, "Listbox %04x: msg %s wp %08x lp %08lx\n", wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam ); switch(msg) { @@ -2476,7 +2478,7 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg, default: if ((msg >= WM_USER) && (msg < 0xc000)) - dprintf_listbox(stddeb,"Listbox %04x: unknown msg %04x wp %08x lp %08lx\n", + dprintf_warn(listbox, "Listbox %04x: unknown msg %04x wp %08x lp %08lx\n", hwnd, msg, wParam, lParam ); return DefWindowProc32A( hwnd, msg, wParam, lParam ); } @@ -2521,7 +2523,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg, { LB_DESCR *descr = *(LB_DESCR **)wnd->wExtra; - dprintf_combo( stddeb, "ComboLBox [%04x]: msg %s wp %08x lp %08lx\n", + dprintf_info(combo, "ComboLBox [%04x]: msg %s wp %08x lp %08lx\n", wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam ); if( descr || msg == WM_CREATE ) @@ -2532,7 +2534,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg, { case WM_CREATE: #define lpcs ((LPCREATESTRUCT32A)lParam) - dprintf_combo(stddeb, "\tpassed parent handle = 0x%08x\n", + dprintf_info(combo, "\tpassed parent handle = 0x%08x\n", (UINT32)lpcs->lpCreateParams); lphc = (LPHEADCOMBO)(lpcs->lpCreateParams); @@ -2578,7 +2580,7 @@ LRESULT WINAPI ComboLBWndProc( HWND32 hwnd, UINT32 msg, } lRet = DefWindowProc32A( hwnd, msg, wParam, lParam ); - dprintf_combo(stddeb,"\tComboLBox: default on msg [%04x]\n", (UINT16)msg ); + dprintf_info(combo,"\tComboLBox: default on msg [%04x]\n", (UINT16)msg ); } return lRet; diff --git a/controls/menu.c b/controls/menu.c index ee9fadffcaf..24aecd44b7d 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -32,7 +32,6 @@ #include "message.h" #include "graphics.h" #include "resource.h" -#include "stddebug.h" #include "tweak.h" #include "debug.h" @@ -165,10 +164,10 @@ static BOOL32 fEndMenu = FALSE; */ #define debug_print_menuitem(pre, mp, post) \ - if(debugging_menu) do_debug_print_menuitem(pre, mp, post) + if(!debugging_info(menu)) ; else do_debug_print_menuitem(pre, mp, post) #define MENUOUT(text) \ - p+=sprintf(p, "%s%s", (count++ ? "," : ""), (text)) + dsprintf(menu, "%s%s", (count++ ? "," : ""), (text)) #define MENUFLAG(bit,text) \ do { \ @@ -178,19 +177,17 @@ static BOOL32 fEndMenu = FALSE; static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, const char *postfix) { - char buff[256]; - char *p; + dbg_decl_str(menu, 256); - p = buff; if (mp) { UINT32 flags = mp->fType; int typ = MENU_ITEM_TYPE(flags); - p+=sprintf(p, "{ ID=0x%x", mp->wID); + dsprintf(menu, "{ ID=0x%x", mp->wID); if (flags & MF_POPUP) - p+=sprintf(p, ", Sub=0x%x", mp->hSubMenu); + dsprintf(menu, ", Sub=0x%x", mp->hSubMenu); if (flags) { int count = 0; - p+=sprintf(p, ", Typ="); + dsprintf(menu, ", Typ="); if (typ == MFT_STRING) /* Nothing */ ; else if (typ == MFT_SEPARATOR) @@ -212,12 +209,12 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, MENUFLAG(MFT_RIGHTJUSTIFY, "right"); if (flags) - p+=sprintf(p, "+0x%x", flags); + dsprintf(menu, "+0x%x", flags); } flags = mp->fState; if (flags) { int count = 0; - p+=sprintf(p, ", State="); + dsprintf(menu, ", State="); MENUFLAG(MFS_GRAYED, "grey"); MENUFLAG(MFS_DISABLED, "dis"); MENUFLAG(MFS_CHECKED, "check"); @@ -225,28 +222,28 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, MENUFLAG(MF_USECHECKBITMAPS, "usebit"); MENUFLAG(MF_MOUSESELECT, "mouse"); if (flags) - p+=sprintf(p, "+0x%x", flags); + dsprintf(menu, "+0x%x", flags); } if (mp->hCheckBit) - p+=sprintf(p, ", Chk=0x%x", mp->hCheckBit); + dsprintf(menu, ", Chk=0x%x", mp->hCheckBit); if (mp->hUnCheckBit) - p+=sprintf(p, ", Unc=0x%x", mp->hUnCheckBit); + dsprintf(menu, ", Unc=0x%x", mp->hUnCheckBit); if (typ == MFT_STRING) { if (mp->text) - p+=sprintf(p, ", Text=\"%s\"", mp->text); + dsprintf(menu, ", Text=\"%s\"", mp->text); else - p+=sprintf(p, ", Text=Null"); + dsprintf(menu, ", Text=Null"); } else if (mp->text == NULL) /* Nothing */ ; else - p+=sprintf(p, ", Text=%p", mp->text); - p+=sprintf(p, " }"); + dsprintf(menu, ", Text=%p", mp->text); + dsprintf(menu, " }"); } else { - p+=sprintf(p, "NULL"); + dsprintf(menu, "NULL"); } - dprintf_menu(stddeb, "%s %s %s\n", prefix, buff, postfix); + dprintf_info(menu, "%s %s %s\n", prefix, dbg_str(menu), postfix); } #undef MENUOUT @@ -270,7 +267,7 @@ static HMENU32 MENU_CopySysPopup(void) fprintf( stderr, "Unable to load default system menu\n" ); } - dprintf_menu( stddeb, "MENU_CopySysPopup: returning %x.\n", hMenu ); + dprintf_info(menu, "MENU_CopySysPopup: returning %x.\n", hMenu ); return hMenu; } @@ -308,7 +305,7 @@ HMENU32 MENU_GetSysMenu( HWND32 hWnd, HMENU32 hPopupMenu ) menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hPopupMenu); menu->wFlags |= MF_SYSMENU; - dprintf_menu(stddeb,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu ); + dprintf_info(menu,"GetSysMenu hMenu=%04x (%04x)\n", hMenu, hPopupMenu ); return hMenu; } DestroyMenu32( hMenu ); @@ -456,7 +453,7 @@ static UINT32 MENU_GetStartOfPrevColumn( break; } - dprintf_menu( stddeb, "MENU_GetStartOfPrevColumn: ret %d.\n", i ); + dprintf_info(menu, "MENU_GetStartOfPrevColumn: ret %d.\n", i ); return i; } @@ -555,7 +552,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu, static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu, UINT32 key, BOOL32 forceMenuChar ) { - dprintf_menu(stddeb,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu ); + dprintf_info(menu,"\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu ); if (!IsMenu32( hmenu )) { @@ -576,7 +573,7 @@ static UINT32 MENU_FindItemByKey( HWND32 hwndOwner, HMENU32 hmenu, key = toupper(key); for (i = 0; i < menu->nItems; i++, item++) { - if (IS_STRING_ITEM(item->fType)) + if (item->text && (IS_STRING_ITEM(item->fType))) { char *p = strchr( item->text, '&' ); if (p && (p[1] != '&') && (toupper(p[1]) == key)) return i; @@ -603,7 +600,7 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner, DWORD dwSize; char *p; - dprintf_menu(stddeb, "MENU_CalcItemSize: HDC 0x%x at (%d,%d)\n", + dprintf_info(menu, "MENU_CalcItemSize: HDC 0x%x at (%d,%d)\n", hdc, orgX, orgY); debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem, (menuBar ? " (MenuBar)" : "")); @@ -621,7 +618,7 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner, SendMessage32A( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis ); lpitem->rect.bottom += mis.itemHeight; lpitem->rect.right += mis.itemWidth; - dprintf_menu(stddeb, "MENU_CalcItemSize: %08x %dx%d\n", + dprintf_info(menu, "MENU_CalcItemSize: %08x %dx%d\n", lpitem->wID, mis.itemWidth, mis.itemHeight); return; } @@ -756,7 +753,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect, if ((lprect == NULL) || (lppop == NULL)) return; if (lppop->nItems == 0) return; - dprintf_menu(stddeb,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n", + dprintf_info(menu,"MENU_MenuBarCalcSize left=%d top=%d right=%d bottom=%d\n", lprect->left, lprect->top, lprect->right, lprect->bottom); lppop->Width = lprect->right - lprect->left; lppop->Height = 0; @@ -776,7 +773,7 @@ static void MENU_MenuBarCalcSize( HDC32 hdc, LPRECT32 lprect, if ((i != start) && (lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break; - dprintf_menu( stddeb, + dprintf_info(menu, "MENU_MenuBarCalcSize: calling MENU_CalcItemSize" " org=(%d, %d)\n", orgX, orgY ); debug_print_menuitem (" item: ", lpitem, ""); @@ -847,7 +844,7 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem, { DRAWITEMSTRUCT32 dis; - dprintf_menu( stddeb, "DrawMenuItem: Ownerdraw!\n" ); + dprintf_info(menu, "DrawMenuItem: Ownerdraw!\n" ); dis.CtlType = ODT_MENU; dis.itemID = lpitem->wID; dis.itemData = (DWORD)lpitem->text; @@ -1140,7 +1137,7 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd, lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( (HMENU16)wndPtr->wIDmenu ); if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU; - dprintf_menu(stddeb,"MENU_DrawMenuBar(%04x, %p, %p); !\n", + dprintf_info(menu,"MENU_DrawMenuBar(%04x, %p, %p); !\n", hDC, lprect, lppop); if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd); lprect->bottom = lprect->top + lppop->Height; @@ -1175,7 +1172,7 @@ BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd ) { HTASK16 hTask = 0; - dprintf_menu(stddeb,"patching resident popup: %04x %04x [%04x %04x]\n", + dprintf_info(menu,"patching resident popup: %04x %04x [%04x %04x]\n", checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ, pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0); @@ -1213,7 +1210,7 @@ BOOL32 MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd ) pTopPopupWnd->hmemTaskQ = task->hQueue; return TRUE; } - else dprintf_menu(stddeb,"failed to patch resident popup.\n"); + else dprintf_warn(menu,"failed to patch resident popup.\n"); } } return FALSE; @@ -1491,7 +1488,7 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags ) if (!(menu = (POPUPMENU *)USER_HEAP_LIN_ADDR(hMenu))) { - dprintf_menu( stddeb, "MENU_InsertItem: %04x not a menu handle\n", + dprintf_warn(menu, "MENU_InsertItem: %04x not a menu handle\n", hMenu ); return NULL; } @@ -1509,13 +1506,13 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags ) { if (!MENU_FindItem( &hMenu, &pos, flags )) { - dprintf_menu( stddeb, "MENU_InsertItem: item %x not found\n", + dprintf_warn(menu, "MENU_InsertItem: item %x not found\n", pos ); return NULL; } if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) { - dprintf_menu(stddeb,"MENU_InsertItem: %04x not a menu handle\n", + dprintf_warn(menu,"MENU_InsertItem: %04x not a menu handle\n", hMenu); return NULL; } @@ -1526,7 +1523,7 @@ static MENUITEM *MENU_InsertItem( HMENU32 hMenu, UINT32 pos, UINT32 flags ) newItems = HeapAlloc( SystemHeap, 0, sizeof(MENUITEM) * (menu->nItems+1) ); if (!newItems) { - dprintf_menu( stddeb, "MENU_InsertItem: allocation failed\n" ); + dprintf_warn(menu, "MENU_InsertItem: allocation failed\n" ); return NULL; } if (menu->nItems > 0) @@ -1623,7 +1620,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU32 hMenu) { LPSTR newstr = HEAP_strdupWtoA(GetProcessHeap(), 0, mii.dwTypeData); - dprintf_menu(stddeb, "Menu item: [%08x,%08x,%04x,%04x,%s]\n", + dprintf_info(menu, "Menu item: [%08x,%08x,%04x,%04x,%s]\n", mii.fType, mii.fState, mii.wID, resinfo, newstr); HeapFree( GetProcessHeap(), 0, newstr ); } @@ -1837,7 +1834,7 @@ static BOOL32 MENU_ExecFocusedItem( MTRACKER* pmt, HMENU32 hMenu ) item = &menu->items[menu->FocusedItem]; - dprintf_menu(stddeb, "MENU_ExecFocusedItem: %08x %08x %08x\n", + dprintf_info(menu, "MENU_ExecFocusedItem: %08x %08x %08x\n", hMenu, item->wID, item->hSubMenu); if (!(item->fType & MF_POPUP)) @@ -1932,7 +1929,7 @@ static BOOL32 MENU_ButtonDown( MTRACKER* pmt, HMENU32 hPtMenu ) pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE ); return TRUE; } - else dprintf_menu(stddeb,"\tunable to find clicked item!\n"); + else dprintf_warn(menu, "\tunable to find clicked item!\n"); } return FALSE; } @@ -2026,7 +2023,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT32 vk ) LRESULT l = SendMessage16( pmt->hOwnerWnd, WM_NEXTMENU, (WPARAM16)vk, (IS_SYSTEM_MENU(menu)) ? GetSubMenu16(pmt->hTopMenu,0) : pmt->hTopMenu ); - dprintf_menu(stddeb,"NextMenu: %04x [%04x] -> %04x [%04x]\n", + dprintf_info(menu,"NextMenu: %04x [%04x] -> %04x [%04x]\n", (UINT16)pmt->hCurrentMenu, (UINT16)pmt->hOwnerWnd, LOWORD(l), HIWORD(l) ); if( l == 0 ) @@ -2074,7 +2071,7 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT32 vk ) /* FIXME: Not sure what to do here, perhaps, * try to track hNewMenu as a popup? */ - dprintf_menu(stddeb,"MENU_DoNextMenu() got confused.\n"); + dprintf_info(menu,"MENU_DoNextMenu() got confused.\n"); return FALSE; } } @@ -2205,7 +2202,7 @@ static void MENU_KeyRight( MTRACKER* pmt ) POPUPMENU *menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( pmt->hTopMenu ); UINT32 nextcol; - dprintf_menu( stddeb, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n", + dprintf_info(menu, "MENU_KeyRight called, cur %x (%s), top %x (%s).\n", pmt->hCurrentMenu, ((POPUPMENU *)USER_HEAP_LIN_ADDR(pmt->hCurrentMenu))-> items[0].text, @@ -2225,7 +2222,7 @@ static void MENU_KeyRight( MTRACKER* pmt ) /* Check to see if there's another column */ if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) != NO_SELECTED_ITEM ) { - dprintf_menu( stddeb, "KeyRight: Going to %d.\n", nextcol ); + dprintf_info(menu, "KeyRight: Going to %d.\n", nextcol ); MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu, nextcol, TRUE ); return; @@ -2614,7 +2611,7 @@ LRESULT WINAPI PopupMenuWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam, if( hwnd == pTopPopupWnd->hwndSelf ) { - dprintf_menu(stddeb,"resident popup destroyed!\n"); + dprintf_err(menu, "resident popup destroyed!\n"); pTopPopupWnd = NULL; uSubPWndLevel = 0; @@ -2663,7 +2660,7 @@ UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth, WND *wndPtr; LPPOPUPMENU lppop; - dprintf_menu( stddeb, "MENU_GetMenuBarHeight: HWND 0x%x, width %d, " + dprintf_info(menu, "MENU_GetMenuBarHeight: HWND 0x%x, width %d, " "at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY ); if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; @@ -2683,7 +2680,7 @@ UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth, BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data, UINT16 id, UINT16 flags ) { - dprintf_menu( stddeb,"ChangeMenu16: menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n", + dprintf_info(menu,"ChangeMenu16: menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n", hMenu, pos, (DWORD)data, id, flags ); if (flags & MF_APPEND) return AppendMenu16( hMenu, flags & ~MF_APPEND, id, data ); @@ -2709,7 +2706,7 @@ BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data, BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data, UINT32 id, UINT32 flags ) { - dprintf_menu( stddeb,"ChangeMenu32A: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n", + dprintf_info(menu,"ChangeMenu32A: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n", hMenu, pos, (DWORD)data, id, flags ); if (flags & MF_APPEND) return AppendMenu32A( hMenu, flags & ~MF_APPEND, id, data ); @@ -2730,7 +2727,7 @@ BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data, BOOL32 WINAPI ChangeMenu32W( HMENU32 hMenu, UINT32 pos, LPCWSTR data, UINT32 id, UINT32 flags ) { - dprintf_menu( stddeb,"ChangeMenu32W: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n", + dprintf_info(menu,"ChangeMenu32W: menu=%08x pos=%d data=%08lx id=%08x flags=%08x\n", hMenu, pos, (DWORD)data, id, flags ); if (flags & MF_APPEND) return AppendMenu32W( hMenu, flags & ~MF_APPEND, id, data ); @@ -2762,7 +2759,7 @@ DWORD WINAPI CheckMenuItem32( HMENU32 hMenu, UINT32 id, UINT32 flags ) MENUITEM *item; DWORD ret; - dprintf_menu( stddeb,"CheckMenuItem: %04x %04x %04x\n", hMenu, id, flags ); + dprintf_info(menu,"CheckMenuItem: %04x %04x %04x\n", hMenu, id, flags ); if (!(item = MENU_FindItem( &hMenu, &id, flags ))) return -1; ret = item->fState & MF_CHECKED; if (flags & MF_CHECKED) item->fState |= MF_CHECKED; @@ -2788,7 +2785,7 @@ BOOL32 WINAPI EnableMenuItem32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags ) BOOL32 bRet = FALSE; MENUITEM *item, *first = NULL; - dprintf_menu(stddeb,"EnableMenuItem (%04x, %04X, %04X) !\n", + dprintf_info(menu,"EnableMenuItem (%04x, %04X, %04X) !\n", hMenu, wItemID, wFlags); while( (item = MENU_FindItem( &hMenu, &wItemID, wFlags )) ) @@ -2836,14 +2833,14 @@ INT32 WINAPI GetMenuString32A( HMENU32 hMenu, UINT32 wItemID, { MENUITEM *item; - dprintf_menu( stddeb, "GetMenuString32A: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", + dprintf_info(menu, "GetMenuString32A: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", hMenu, wItemID, str, nMaxSiz, wFlags ); if (!str || !nMaxSiz) return 0; str[0] = '\0'; if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0; if (!IS_STRING_ITEM(item->fType)) return 0; lstrcpyn32A( str, item->text, nMaxSiz ); - dprintf_menu( stddeb, "GetMenuString32A: returning '%s'\n", str ); + dprintf_info(menu, "GetMenuString32A: returning '%s'\n", str ); return strlen(str); } @@ -2856,7 +2853,7 @@ INT32 WINAPI GetMenuString32W( HMENU32 hMenu, UINT32 wItemID, { MENUITEM *item; - dprintf_menu( stddeb, "GetMenuString32W: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", + dprintf_info(menu, "GetMenuString32W: menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", hMenu, wItemID, str, nMaxSiz, wFlags ); if (!str || !nMaxSiz) return 0; str[0] = '\0'; @@ -2884,7 +2881,7 @@ BOOL32 WINAPI HiliteMenuItem32( HWND32 hWnd, HMENU32 hMenu, UINT32 wItemID, UINT32 wHilite ) { LPPOPUPMENU menu; - dprintf_menu(stddeb,"HiliteMenuItem(%04x, %04x, %04x, %04x);\n", + dprintf_info(menu,"HiliteMenuItem(%04x, %04x, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite); if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE; if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE; @@ -2910,7 +2907,7 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags ) UINT32 WINAPI GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags ) { MENUITEM *item; - dprintf_menu(stddeb,"GetMenuState(%04x, %04x, %04x);\n", + dprintf_info(menu,"GetMenuState(%04x, %04x, %04x);\n", hMenu, wItemID, wFlags); if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1; debug_print_menuitem (" item: ", item, ""); @@ -2937,7 +2934,7 @@ INT16 WINAPI GetMenuItemCount16( HMENU16 hMenu ) { LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu); if (!IS_A_MENU(menu)) return -1; - dprintf_menu( stddeb,"GetMenuItemCount16(%04x) returning %d\n", + dprintf_info(menu,"GetMenuItemCount16(%04x) returning %d\n", hMenu, menu->nItems ); return menu->nItems; } @@ -2950,7 +2947,7 @@ INT32 WINAPI GetMenuItemCount32( HMENU32 hMenu ) { LPPOPUPMENU menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu); if (!IS_A_MENU(menu)) return -1; - dprintf_menu( stddeb,"GetMenuItemCount32(%04x) returning %d\n", + dprintf_info(menu,"GetMenuItemCount32(%04x) returning %d\n", hMenu, menu->nItems ); return menu->nItems; } @@ -3007,10 +3004,10 @@ BOOL32 WINAPI InsertMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags, MENUITEM *item; if (IS_STRING_ITEM(flags) && str) - dprintf_menu( stddeb, "InsertMenu: hMenu %04x, pos %d, flags %08x, " + dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, " "id %04x, str '%s'\n", hMenu, pos, flags, id, str ); - else dprintf_menu( stddeb, "InsertMenu: hMenu %04x, pos %d, flags %08x, " + else dprintf_info(menu, "InsertMenu: hMenu %04x, pos %d, flags %08x, " "id %04x, str %08lx (not a string)\n", hMenu, pos, flags, id, (DWORD)str ); @@ -3096,7 +3093,7 @@ BOOL32 WINAPI RemoveMenu32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags ) LPPOPUPMENU menu; MENUITEM *item; - dprintf_menu(stddeb,"RemoveMenu (%04x, %04x, %04x)\n",hMenu, nPos, wFlags); + dprintf_info(menu,"RemoveMenu (%04x, %04x, %04x)\n",hMenu, nPos, wFlags); if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE; if (!(menu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE; @@ -3170,13 +3167,13 @@ BOOL32 WINAPI ModifyMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags, if (IS_STRING_ITEM(flags)) { - dprintf_menu( stddeb, "ModifyMenu: %04x %d %04x %04x '%s'\n", + dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x '%s'\n", hMenu, pos, flags, id, str ? str : "#NULL#" ); if (!str) return FALSE; } else { - dprintf_menu( stddeb, "ModifyMenu: %04x %d %04x %04x %08lx\n", + dprintf_info(menu, "ModifyMenu: %04x %d %04x %04x %08lx\n", hMenu, pos, flags, id, (DWORD)str ); } @@ -3254,7 +3251,7 @@ BOOL32 WINAPI SetMenuItemBitmaps32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags, HBITMAP32 hNewUnCheck, HBITMAP32 hNewCheck) { MENUITEM *item; - dprintf_menu(stddeb,"SetMenuItemBitmaps(%04x, %04x, %04x, %04x, %04x)\n", + dprintf_info(menu,"SetMenuItemBitmaps(%04x, %04x, %04x, %04x, %04x)\n", hMenu, nPos, wFlags, hNewCheck, hNewUnCheck); if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE; @@ -3299,7 +3296,7 @@ HMENU32 WINAPI CreateMenu32(void) menu->hWnd = 0; menu->items = NULL; menu->FocusedItem = NO_SELECTED_ITEM; - dprintf_menu( stddeb, "CreateMenu: return %04x\n", hMenu ); + dprintf_info(menu, "CreateMenu: return %04x\n", hMenu ); return hMenu; } @@ -3318,7 +3315,7 @@ BOOL16 WINAPI DestroyMenu16( HMENU16 hMenu ) */ BOOL32 WINAPI DestroyMenu32( HMENU32 hMenu ) { - dprintf_menu(stddeb,"DestroyMenu(%04x)\n", hMenu); + dprintf_info(menu,"DestroyMenu(%04x)\n", hMenu); /* Silently ignore attempts to destroy default system popup */ @@ -3466,7 +3463,7 @@ BOOL32 WINAPI SetMenu32( HWND32 hWnd, HMENU32 hMenu ) { WND * wndPtr = WIN_FindWndPtr(hWnd); - dprintf_menu(stddeb,"SetMenu(%04x, %04x);\n", hWnd, hMenu); + dprintf_info(menu,"SetMenu(%04x, %04x);\n", hWnd, hMenu); if (wndPtr && !(wndPtr->dwStyle & WS_CHILD)) { @@ -3578,11 +3575,11 @@ HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name ) if (HIWORD(name)) { char *str = (char *)PTR_SEG_TO_LIN( name ); - dprintf_menu( stddeb, "LoadMenu(%04x,'%s')\n", instance, str ); + dprintf_info(menu, "LoadMenu(%04x,'%s')\n", instance, str ); if (str[0] == '#') name = (SEGPTR)atoi( str + 1 ); } else - dprintf_resource(stddeb,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name)); + dprintf_info(resource,"LoadMenu(%04x,%04x)\n",instance,LOWORD(name)); if (!name) return 0; @@ -3630,7 +3627,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template ) WORD version, offset; LPCSTR p = (LPCSTR)template; - dprintf_menu(stddeb,"LoadMenuIndirect16: %p\n", template ); + dprintf_info(menu,"LoadMenuIndirect16: %p\n", template ); version = GET_WORD(p); p += sizeof(WORD); if (version) @@ -3659,7 +3656,7 @@ HMENU32 WINAPI LoadMenuIndirect32A( LPCVOID template ) WORD version, offset; LPCSTR p = (LPCSTR)template; - dprintf_menu(stddeb,"LoadMenuIndirect32A: %p\n", template ); + dprintf_info(menu,"LoadMenuIndirect32A: %p\n", template ); version = GET_WORD(p); p += sizeof(WORD); switch (version) @@ -3934,7 +3931,7 @@ BOOL32 WINAPI CheckMenuRadioItem32(HMENU32 hMenu, MENUITEM *mifirst, *milast, *micheck; HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu; - dprintf_menu (stddeb, + dprintf_info(menu, "CheckMenuRadioItem32: ox%x: %d-%d, check %d, bypos=%d\n", hMenu, first, last, check, bypos); @@ -3988,7 +3985,7 @@ BOOL32 WINAPI GetMenuItemRect32 (HWND32 hwnd, HMENU32 hMenu, UINT32 uItem, MENUITEM *item; HMENU32 orghMenu = hMenu; - dprintf_menu (stddeb, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n", + dprintf_info(menu, "GetMenuItemRect32 (0x%x,0x%x,%d,%p)\n", hwnd, hMenu, uItem, rect); item = MENU_FindItem (&hMenu, &uItem, MF_BYPOSITION); diff --git a/controls/progress.c b/controls/progress.c index 6a6e388e97a..426c2c41a86 100644 --- a/controls/progress.c +++ b/controls/progress.c @@ -17,7 +17,6 @@ #include "graphics.h" #include "heap.h" #include "win.h" -#include "stddebug.h" #include "debug.h" /* Control configuration constants */ @@ -27,7 +26,7 @@ /* Work constants */ -#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_progress(stddeb, \ +#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(progress, \ "Progress Ctrl: Unknown parameter(s) for message " #msg \ "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); @@ -48,7 +47,7 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc) RECT32 rect; HDC32 hdc; - dprintf_progress(stddeb, "Progress Bar: paint pos=%d min=%d, max=%d\n", + dprintf_info(progress, "Progress Bar: paint pos=%d min=%d, max=%d\n", infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal); /* get a dc */ @@ -115,11 +114,11 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message, infoPtr->MaxVal=100; infoPtr->CurVal=0; infoPtr->Step=10; - dprintf_updown(stddeb, "Progress Ctrl creation, hwnd=%04x\n", hwnd); + dprintf_info(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd); break; case WM_DESTROY: - dprintf_updown(stddeb, "Progress Ctrl destruction, hwnd=%04x\n", hwnd); + dprintf_info(updown, "Progress Ctrl destruction, hwnd=%04x\n", hwnd); break; case WM_ERASEBKGND: diff --git a/controls/scroll.c b/controls/scroll.c index f1f4512b1c6..956f359878d 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -15,7 +15,6 @@ #include "graphics.h" #include "heap.h" #include "win.h" -#include "stddebug.h" #include "debug.h" @@ -616,7 +615,7 @@ void SCROLL_HandleScrollEvent( HWND32 hwnd, INT32 nBar, UINT32 msg, POINT32 pt) return; /* Should never happen */ } - dprintf_scroll( stddeb, "ScrollBar Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n", + dprintf_info(scroll, "ScrollBar Event: hwnd=%04x bar=%d msg=%x pt=%d,%d hit=%d\n", hwnd, nBar, msg, pt.x, pt.y, hittest ); switch(trackHitTest) @@ -795,7 +794,7 @@ LRESULT WINAPI ScrollBarWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam, } } if (!hUpArrow) SCROLL_LoadBitmaps(); - dprintf_scroll( stddeb, "ScrollBar creation, hwnd=%04x\n", hwnd ); + dprintf_info(scroll, "ScrollBar creation, hwnd=%04x\n", hwnd ); return 0; case WM_LBUTTONDOWN: @@ -910,19 +909,18 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info, SCROLLBAR_INFO *infoPtr; UINT32 new_flags; BOOL32 repaint_arrows = FALSE; + dbg_decl_str(scroll, 256); if (!(infoPtr = SCROLL_GetScrollInfo(hwnd, nBar))) return 0; if (info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL)) return 0; if ((info->cbSize != sizeof(*info)) && (info->cbSize != sizeof(*info)-sizeof(info->nTrackPos))) return 0; - dprintf_scroll( stddeb, "SetScrollInfo: hwnd=%04x bar=%d", hwnd, nBar ); - /* Set the page size */ if (info->fMask & SIF_PAGE) { - dprintf_scroll( stddeb, " page=%d", info->nPage ); + dsprintf(scroll, " page=%d", info->nPage ); infoPtr->Page = info->nPage; } @@ -930,7 +928,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info, if (info->fMask & SIF_POS) { - dprintf_scroll( stddeb, " pos=%d", info->nPos ); + dsprintf(scroll, " pos=%d", info->nPos ); infoPtr->CurVal = info->nPos; } @@ -938,7 +936,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info, if (info->fMask & SIF_RANGE) { - dprintf_scroll( stddeb, " min=%d max=%d", info->nMin, info->nMax ); + dsprintf(scroll, " min=%d max=%d", info->nMin, info->nMax ); /* Invalid range -> range is set to (0,0) */ if ((info->nMin > info->nMax) || @@ -954,6 +952,9 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info, } } + dprintf_info(scroll, "SetScrollInfo: hwnd=%04x bar=%d %s\n", + hwnd, nBar, dbg_str(scroll)); + /* Make sure the page size is valid */ if (infoPtr->Page < 0) infoPtr->Page = 0; @@ -967,7 +968,7 @@ INT32 WINAPI SetScrollInfo32( HWND32 hwnd, INT32 nBar, const SCROLLINFO *info, else if (infoPtr->CurVal > infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 )) infoPtr->CurVal = infoPtr->MaxVal - MAX( infoPtr->Page-1, 0 ); - dprintf_scroll( stddeb, "\n new values: page=%d pos=%d min=%d max=%d\n", + dprintf_info(scroll, "\n new values: page=%d pos=%d min=%d max=%d\n", infoPtr->Page, infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal ); @@ -1208,7 +1209,7 @@ BOOL32 WINAPI ShowScrollBar32( HWND32 hwnd, INT32 nBar, BOOL32 fShow ) WND *wndPtr = WIN_FindWndPtr( hwnd ); if (!wndPtr) return FALSE; - dprintf_scroll( stddeb, "ShowScrollBar: hwnd=%04x bar=%d on=%d\n", + dprintf_info(scroll, "ShowScrollBar: hwnd=%04x bar=%d on=%d\n", hwnd, nBar, fShow ); switch(nBar) @@ -1284,7 +1285,7 @@ BOOL32 WINAPI EnableScrollBar32( HWND32 hwnd, INT32 nBar, UINT32 flags ) SCROLLBAR_INFO *infoPtr; if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE; - dprintf_scroll( stddeb, "EnableScrollBar: %04x %d %d\n", + dprintf_info(scroll, "EnableScrollBar: %04x %d %d\n", hwnd, nBar, flags ); flags &= ESB_DISABLE_BOTH; if (infoPtr->flags == flags) return FALSE; diff --git a/controls/uitools.c b/controls/uitools.c index 15779a129bc..8872a1180b0 100644 --- a/controls/uitools.c +++ b/controls/uitools.c @@ -574,7 +574,7 @@ BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags ) */ BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags ) { - dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n", + dprintf_info(graphics, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n", hdc, rc->left, rc->top, rc->right, rc->bottom, edge, flags ); diff --git a/controls/updown.c b/controls/updown.c index c0a2848371d..8a8302a4529 100644 --- a/controls/updown.c +++ b/controls/updown.c @@ -35,8 +35,6 @@ #include "graphics.h" #include "heap.h" #include "win.h" -#include "stddebug.h" -/*#define DEBUG_UPDOWN*/ #include "debug.h" /* Control configuration constants */ @@ -62,7 +60,7 @@ static int accelIndex = -1; -#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_updown(stddeb, \ +#define UNKNOWN_PARAM(msg, wParam, lParam) dprintf_warn(updown, \ "UpDown Ctrl: Unknown parameter(s) for message " #msg \ "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); @@ -209,7 +207,7 @@ static BOOL32 UPDOWN_GetBuddyInt(WND *wndPtr) if(*src || !UPDOWN_InBounds(wndPtr, newVal)) return FALSE; - dprintf_updown(stddeb, "UpDown Ctrl: new value(%d) read from buddy " + dprintf_info(updown, "UpDown Ctrl: new value(%d) read from buddy " "(old=%d)\n", newVal, infoPtr->CurVal); } @@ -234,7 +232,7 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr) if (!IsWindow32(infoPtr->Buddy)) return FALSE; - dprintf_updown(stddeb, "UpDown Ctrl: set new value(%d) to buddy.\n", + dprintf_info(updown, "UpDown Ctrl: set new value(%d) to buddy.\n", infoPtr->CurVal); /*if the buddy is a list window, we must set curr index */ @@ -381,7 +379,7 @@ static void UPDOWN_DoAction(WND *wndPtr, int delta, BOOL32 incr) int old_val = infoPtr->CurVal; NM_UPDOWN ni; - dprintf_updown(stddeb, "UpDown Ctrl action: %s by %d\n", + dprintf_info(updown, "UpDown Ctrl action: %s by %d\n", incr ? "inc" : "dec", delta); /* check if we can do the modification first */ @@ -583,13 +581,13 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, if(wndPtr->dwStyle & UDS_AUTOBUDDY) UPDOWN_SetBuddy(wndPtr, GetWindow32(wndPtr->hwndSelf, GW_HWNDPREV)); - dprintf_updown(stddeb, "UpDown Ctrl creation, hwnd=%04x\n", hwnd); + dprintf_info(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd); break; case WM_DESTROY: if(infoPtr->AccelVect) free(infoPtr->AccelVect); - dprintf_updown(stddeb, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd); + dprintf_info(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd); break; case WM_ENABLE: @@ -679,7 +677,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, return temp; case UDM_SETACCEL: - dprintf_updown(stddeb, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd); + dprintf_info(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd); if(infoPtr->AccelVect){ free(infoPtr->AccelVect); infoPtr->AccelCount = 0; @@ -699,7 +697,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, return infoPtr->Base; case UDM_SETBASE: - dprintf_updown(stddeb, "UpDown Ctrl new base(%d), hwnd=%04x\n", + dprintf_info(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n", wParam, hwnd); if ( !(wParam==10 || wParam==16) || lParam) UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam); @@ -721,7 +719,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, temp = infoPtr->Buddy; infoPtr->Buddy = wParam; UPDOWN_SetBuddy(wndPtr, wParam); - dprintf_updown(stddeb, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", + dprintf_info(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", infoPtr->Buddy, hwnd); return temp; @@ -735,7 +733,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, if (wParam || HIWORD(lParam)) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam); temp = SLOWORD(lParam); - dprintf_updown(stddeb, "UpDown Ctrl new value(%d), hwnd=%04x\n", + dprintf_info(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n", temp, hwnd); if(!UPDOWN_InBounds(wndPtr, temp)){ if(temp < infoPtr->MinVal) @@ -760,7 +758,7 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam, infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */ infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */ /* |Max-Min| <= UD_MAXVAL */ - dprintf_updown(stddeb, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", + dprintf_info(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", infoPtr->MinVal, infoPtr->MaxVal, hwnd); break; diff --git a/documentation/Makefile.in b/documentation/Makefile.in index 602615833be..fdf44b148c7 100644 --- a/documentation/Makefile.in +++ b/documentation/Makefile.in @@ -18,14 +18,21 @@ INFOFILES = \ wine.info-1 \ wine.info-2 +HTMLFILES = \ + wine_toc.html \ + wine.html + DVIFILES = wine.dvi -all: $(INFOFILES) $(DVIFILES) + +all: $(INFOFILES) $(DVIFILES) $(HTMLFILES) info: $(INFOFILES) dvi: $(DVIFILES) +html: $(HTMLFILES) + @MAKE_RULES@ $(INFOFILES): $(SOURCES) @@ -34,6 +41,10 @@ $(INFOFILES): $(SOURCES) $(DVIFILES): $(SOURCES) texi2dvi $(SRCDIR)/wine.texinfo +$(HTMLFILES): $(SOURCES) + makeinfo -E wine.texi $(SRCDIR)/wine.texinfo + texi2html wine.texi + $(INCLUDES): $(RM) $(INCLUDES) for i in $(INCLUDES); do $(LN_S) $(TOPSRCDIR)/$$i $$i || exit 1; done @@ -48,7 +59,8 @@ install_info: $(INFOFILES) clean:: $(RM) $(INFOFILES) $(DVIFILES) $(INCLUDES) $(RM) wine.aux wine.cp wine.cps wine.fn wine.fns wine.ky wine.log \ - wine.pg wine.toc wine.tp wine.tps wine.vr wine.vrs + wine.pg wine.toc wine.tp wine.tps wine.vr wine.vrs \ + wine.texi $(RM) -r man3w ### Dependencies: diff --git a/documentation/console b/documentation/console index a623e351b8c..f6c71c6fb40 100644 --- a/documentation/console +++ b/documentation/console @@ -4,12 +4,17 @@ Console - First Pass Consoles are just xterms created with the -Sxxn switch. A pty is opened and the master goes to the xterm side -and the slave is held by the wine side. The slave fd -is changed into a HANDLE32 and this HANDLE32 is set +and the slave is held by the wine side. The console +itself it turned into a few HANDLE32s and is set to the STD_*_HANDLES. -For now writing/reading to a console just calls FileWrite/FileRead. +It is possible to use the WriteFile and ReadFile commands +to write to a win32 console. To accomplish this, all K32OBJs +that support I/O have a read and write function pointer. +So, WriteFile calls K32OBJ_WriteFile which calls the K32OBJ's +write function pointer, which then finally calls write. +[this paragraph is now out of date] If the command line console is to be inheirited or a process inherits it's parents console (-- can that happen???), the console is created at process init time via PROCESS_InheritConsole. @@ -23,20 +28,55 @@ pdb->console is set to NULL. This helps indicate when it is possible to create a new console (via AllocConsole). -Like most k32 objects, when the FreeConsole is called, the -ref count is decremented and the console is freed when -it reaches zero. The free kills the xterm and closes -the master/slave fds. +When FreeConsole is called, all handles that the process has +open to the console are closed. Like most k32objs, if the +console's refcount reaches zero, its k32obj destroy function +is called. The destroy kills the xterm if one was open. Also like most k32 objects, we assume that (K32OBJ) header is the first field so the casting (from K32OBJ *to CONSOLE *) works correctly. +FreeConsole is called on process exit (in ExitProcess) if +pdb->console is not NULL. + BUGS ---- +Console processes do not inherit their parent's handles. I think +there needs to be two cases, one where they have to inherit +the stdin/stdout/stderr from unix, and one where they have to +inherit from another windows app. -A exit handler needs to be added. If the process exits -without calling FreeConsole, the xterm continues on... -But... there should probably be a generic exit handler in -wine for this kind of stuff (K32OBJs). +================================================================ + +experimentation with NT4 yields that: + +WriteFile +--------- + o does not truncate file on 0 length write + o 0 length write or error on write changes numcharswritten to 0 + o 0 length write returns TRUE + o works with console handles + +_lwrite +------- + o does truncate/expand file at current position on 0 length write + o returns 0 on a zero length write + o works with console handles (typecasted) + +WriteConsole +------------ + o expects only console handles + + +SetFilePointer +-------------- + o returns -1 (err 6) when used with a console handle + + +FreeConsole +----------- + o even when all the handles to it are freed, the win32 console + stays visible, the only way I could find to free it + was via the FreeConsole diff --git a/documentation/debug-msgs b/documentation/debug-msgs new file mode 100644 index 00000000000..3953a68be07 --- /dev/null +++ b/documentation/debug-msgs @@ -0,0 +1,351 @@ +Note: the debugging interface is under development. Please do not make + changes to it yet as I will do major changes in the next few weeks. + To make my life easier, PLEASE follow the guidelines described in + this document. If you have some ideas that you would like to + incorporate, please contact me first. + Please read the document before writing new code. + Also, DO NOT USE fprintf (or printf) to output things. All these + will have to be translated to dprintf_ calls and there are already + about 3000 of them! Also, instead of writing FIXMEs in the source, + output a dprintf_fixme message. But read on... +25 Feb 1998, Dimitrie O. Paun + + +Debugging classes +----------------- + +The debugging messages are divided into 4 classes: + +fixme -- Messages in this class relate to behavior of Wine that does + not correspond to standard Windows behavior and that should + be fixed. + Examples: stubs, semi-implemented features, etc. + +err -- Messages in this class relate to serious errors in Wine. + This sort of messages are close to asserts -- that is, + you should output a 'err' message when the code detects a + condition which should not happen. + Examples: unexpected change in internal state, etc. + +warn -- This are warning messages. You should report a warning when + something unwanted happen but the function behaves properly. + That is, output a warning when you encounter something + unexpected (ex: could not open a file) but the function deals + correctly with the situation (that is, according to the docs). + If you do not deal correctly with it, output a fixme. + Examples: fail to access a resource required by the app, etc. + +info -- This are detailed debugging messages that are mainly useful + to debug a component. This are usually turned off. + Examples: everything else that does not fall in one of the + above mentioned categories and the user does not + need to know about it. This sort of messages simply + outputs something about the state of some component + that is of interest mainly to the developer of that + component. + +We will refer to a generic class as yyy. + +The user has the capability to turn on or off messages in a particular +class. You can expect the following patters of usage (but note that +any combination is possible): + -- when you debug a component, all classes (info,warn,err,fixme) + will be enabled. + -- during the pre-alpha (maybe alpha) stage of Wine, most likely + the info class will be disabled by default, but all others + (warn,err,fixme) will be enabled by default. + -- when Wine will become stable, most likely the info and warn + classes will be disabled by default, but all err and fixme + will be enabled by default. + -- in some installations that want the smallest footprint + and where the debug information is of no interest, + all classes may be disabled by default. + +Of course, the user will have the runtime ability to override these +defaults. However, this ability may be turned off and certain classes +of messages may be completely disabled at compile time to reduce the +size of Wine. + +Debugging channels +------------------ + +Also, we divide the debugging messages per component. Each component +is assigned a debugging channel (or type). The identifier of the +channel must be a valid C identifier but note that it may also be a +reserve word like int or static. + +Examples of debugging channels/types: +reg, updown, string + +We will refer to a generic channel as xxx. + +Note: for those who know the old interface, the channel/type is + what followed the _ in the dprintf_xxx statements. + For example, to output a message on the debugging channel + reg in the old interface you would have to write: + + dprintf_reg(stddeb, "Could not access key!\n"); + + In the new interface, we drop the stddeb as it is implicit. + However, we add an orthogonal piece of information to the + message: its class. This is very important as it will allow + us to selectively turn on or off certain messages based on + type of information they report. For this reason it is VERY + important to choose the right class for the message. + Anyhow, suppose we figured that this message should belong + in the warn class, so in the new interface, you write: + + dprintf_warn(reg, "Could not access key!\n"); + +--- + +How to use it +------------- + +So, to output a message (class yyy) on channel xxx, do: + +#include "debug.h" + +.... + +dprintf_yyy(xxx, "", ...); + + +Some examples from the code: + +#include "debug.h" + +... + + dprintf_info(crtdll, + "CRTDLL_setbuf(file %p buf %p)\n", + file, buf); + + dprintf_warn(aspi, "Error opening device errno=%d\n", save_error); + + +If you need to declare a new debugging channel, do: +%tools/make_debug +in the root directory of Wine. + +Note that this will result in almost complete recompilation of Wine. + +Notes: + 1. Please pay attention to which class you assign the message. + It is very, Very, VERY important to get the class right. + There are only 4 classes, so it is not hard. The reason + it is important to get it right is that too much information + is no information. For example, if you put things into the + warn class that should really be in the info class, the + output will be too big and this will force the user to + turn of warnings. But this way he will fail to see the important + ones. Also, if you put warnings into the info class lets say, + he will most likely miss those because usually the info class + is turned off. A similar argument can be made if you mix any + other two classes. + 2. ALL LINES MUST END WITH A NEWLINE!!! If you can NOT output + everything that you want in the line with only one dprintf_xxx + statement, then you need to build the string in memory. + Please read the section below "In-memory messages" on the + preferred way to do it. PLEASE USE THAT INTERFACE TO BUILD + MESSAGES IN MEMORY. The reason is that we are not sure that + we like it and having everything in one format will facilitate + the (automatic) translation to a better interface. + + + +Are we debugging? +----------------- + +To test whether the debugging output of class yyy on channel xxx is +enabled, do: + +debugging_yyy(xxx) + +Examples: + +if(debugging_info(atom)){ + ...blah... +} + + + +In-memory messages +------------------ + +If you NEED to build the message from multiple calls, you need to +build it in memory. To do that, you should use the following +interface: + + - declare a string (where you are allowed to declare C variables) + as follows: + dbg_decl_str(name, len); + where name is the name of the string (you should use the channel + name on which you are going to output it) + + - print in it with: + dsprintf(name, "", ...); + which is just like a sprintf function but instead of a C string as + first parameter it takes the name you used to declare it. + + - obtain a pointer to the string with: + dbg_str(name) + + - reset the string (if you want to reuse it with): + dbg_reset_str(name); + +Example (modified from the code): + +void some_func(tabs) +{ + INT32 i; + LPINT16 p = (LPINT16)tabs; + dbg_decl_str(listbox, 256); /* declare the string */ + + for (i = 0; i < descr->nb_tabs; i++) { + descr->tabs[i] = *p++<<1; + if(debugging_info(listbox)) /* write in it only if + dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */ + } + dprintf_info(listbox, "Listbox %04x: settabstops %s\n", + wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */ +} + +If you need to use it two times in the same scope do like this: + +void some_func(tabs) +{ + INT32 i; + LPINT16 p = (LPINT16)tabs; + dbg_decl_str(listbox, 256); /* declare the string */ + + for (i = 0; i < descr->nb_tabs; i++) { + descr->tabs[i] = *p++<<1; + if(debugging_info(listbox)) /* write in it only if + dsprintf(listbox, "%hd ", descr->tabs[i]); /* we are gonna output it */ + } + dprintf_info(listbox, "Listbox %04x: settabstops %s\n", + wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */ + + dbg_reset_str(listbox); /* !!!reset the string!!! */ + for (i = 0; i < descr->extrainfo_nr; i++) { + descr->extrainfo = *p+1; + if(debugging_info(listbox)) /* write in it only if + dsprintf(listbox,"%3d ",descr->extrainfo); /* we are gonna output it */ + } + + dprintf_info(listbox, "Listbox %04x: extrainfo %s\n", + wnd->hwndSelf, dbg_str(listbox)); /* output the whole thing */ + +} + +IMPORTANT NOTE: + As I already stated, I do not think this will be the ultimate interface + for building in-memory debugging messages. In fact, I do have better ideas + which I hope to have time to implement for the next release. For this + reason, please try not to use it. However, if you need to output a line + in more than one dprintf_xxx calls, then USE THIS INTERFACE. DO NOT use + other methods. This way, I will easily translate everything to the new + interface (when it will become available). So, if you need to use if, + then follow the following guidelines: + -- wrap calls to dsprintf with a + if(debugging_yyy(xxx)) + dsprintf(xxx,...); + Of course, if the call to dsprintf is made from within a function + which you know is called only if debugging_yyy(xxx) is true + (say you call it only like this: + if(debugging_yyy(xxx)) + print_some_debug_info(); + ) + then you need not (and should not) wrap calls to dsprintf with + the before mentioned if. + -- name the string EXACTLY like the debugging channel on which + is going to be output. Please see the above example. + + +Resource identifiers +-------------------- + +Resource identifiers can be either strings or numbers. To make life a bit +easier for outputting this beasts (and to help you avoid the need to build +the message in memory), I introduced a new function called: + +debugres + +The function is defined in debugstr.h +and has the following prototype: + +LPSTR debugres(const void *id); + +It takes a pointer to the resource id and returns a nicely formatted +string of the identifier. + +It the high word of the pointer is 0, then it assumes that the +identifier is a number and thus returns a string of the form: + +#xxxx + +where xxxx are 4 hex-digits representing the low word of id. + +It the high word of the pointer is not 0, then it assumes that the +identifier is a string and thus returns a string of the form: + +'' + +Thus, to use it, do something on the following lines: + +#include "debugstr.h" + +... + + dprintf_yyy(xxx, "resource is %s", debugres(myresource)); + + +The -debugmsg command line option +--------------------------------- + +So, the -debugmsg command line option has been changed as follows: + - the new syntax is: -debugmsg [yyy]#xxx[,[yyy1]#xxx1]* + where # is either + or - + + - when the optional class argument (yyy) is not present, + then the statement will enable(+)/disable(-) all messages for + the given channel (xxx) on all classes. For example: + + -debugmsg +reg,-file + + enables all messages on the reg channel and disables all + messages on the file channel. + This is very close (actually identical) to the old semantics. + + - when the optional class argument (yyy) is present, + then the statement will enable(+)/disable(-) messages for + the given channel (xxx) only on the given class. For example: + + -debugmsg info+reg,warn-file + + enables info messages on the reg channel and disables warning + messages on the file channel. + + - also, the pseudo-channel all is also supported and it has the + intuitive semantics: + + -debugmsg +all -- enables all debug messages + -debugmsg -all -- disables all debug messages + -debugmsg yyy+all -- enables debug messages for class yyy on all + channels. + -debugmsg yyy-all -- disables debug messages for class yyy on all + channels. + + So, for example: + + -debugmsg warn-all -- disables all warning messages. + + +Also, note that at the moment: + - the fixme, err, warn classes are all enabled by default + - the info class is disabled by default + - there is no way to compile out the messages. All are + runtime configurable. This will come next release. + + diff --git a/documentation/debugging b/documentation/debugging index 1686ae72a9e..71421797ef5 100644 --- a/documentation/debugging +++ b/documentation/debugging @@ -51,18 +51,19 @@ relevant developer as feasonable. the reason is located in the last call(s). Those lines usually look like this: -|Call KERNEL.90: LSTRLEN(0227:0692) ret=01e7:2ce7 ds=0227 - ^^^^^^^^^ ^ ^^^^^^^^^ ^^^^^^^^^ ^^^^ - | | | | |Datasegment on entry - | | | |Return address. +|Call KERNEL.90: LSTRLEN(0227:0692 "text") ret=01e7:2ce7 ds=0227 + ^^^^^^^^^ ^ ^^^^^^^^^ ^^^^^^ ^^^^^^^^^ ^^^^ + | | | | | |Datasegment + | | | | |Return address + | | | |textual parameter | | | | | |Argument(s). This one is a win16 segmented pointer. | |Function called. |The module, the function is called in. In this case it is KERNEL. -|Ret KERNEL.90: LSTRLEN() retval=0x0007 ret=01e7:2ce7 ds=0227 +|Ret KERNEL.90: LSTRLEN() retval=0x0004 ret=01e7:2ce7 ds=0227 ^^^^^^ - |Returnvalue is 16 bit and has the value 7. + |Returnvalue is 16 bit and has the value 4. 3. If you have found a misbehaving function, try to find out why it @@ -119,18 +120,28 @@ Program reports an error with a Messagebox "continue". With "-debugmsg +all" Wine will now stop directly directly before setting up the Messagebox. Proceed as explained above. + You can also run wine using "wine -debugmsg +relay program.exe 2>&1|less -i" + and in less search for messagebox. Disassembling programs: ======================= You may also try to disassemble the offending program to check for undocumented features and/or use of them. - The best, freely available, disassembler for win16 programs is + + The best, freely available, disassembler for Win16 programs is Windows Codeback, archivename wcbxxx.zip, which usually can be found in the Cica-Mirror subdirectory on the WINE ftpsites. (See ANNOUNCE). - Disassembling win32 programs is currenty only possible using - Windows Disassembler 32, archivename something like wdasm32x.zip on - ftp.winsite.com and mirrors. + Disassembling win32 programs is possible using the Windows Disassembler 32, + archivename something like w32dasm.zip on ftp.winsite.com and mirrors. + The shareware version does not allow saving of disassembly listings. + + [It also has a bug, it disassembles the dll and immediately after that + crashes, leaving a very large file caled 'winsys' in the directory of the + disassembled file. This file contains nothing of value (just the disassembly) + and can be safely deleted.] + Understanding disassembled code is just a question of exercise. + Most code out there uses standard C function entries (for it is usually written in C). Win16 function entries usually look like that: | push bp @@ -157,7 +168,6 @@ Disassembling programs: | call KERNEL.LSTRLEN Here first the selector and then the offset to the passed string are pushed. - Sample debugging session: ========================= @@ -171,88 +181,78 @@ Sample debugging session: |marcus@jet $ wine winword.exe -debugmsg +relay -debug -|CallTo32(func=08007e00,000001c4,00000081,00000000,00000000) -|CallTo32(func=08007e00,000001c4,00000014,000006d0,00000000) -|Win16 task 'winword': Breakpoint 1 at 0x0157:0x001a -|CallTo16(func=0097:0130,ds=0000) -|Call WPROCS.24: TASK_RESCHEDULE() ret=003f:0759 ds=0000 -|Ret WPROCS.24: TASK_RESCHEDULE() retval=0x0000 ret=003f:0759 ds=08a7 -|CallTo16(func=0157:001a,ds=08a7,0x11d7,0x0000,0x0000,0x3cb4,0x1f40,0x0000,0x0000,0x08a7) -|Loading symbols from ELF file /home/marcus/wine/wine... -|...more Loading symbols ... -|Stopped on breakpoint 1 at 0x0157:0x001a (WPROCS_VXD_PAGEFILE+0xffffeeea) +|CallTo32(wndproc=0x40065bc0,hwnd=000001ac,msg=00000081,wp=00000000,lp=00000000) +|Win16 task 'winword': Breakpoint 1 at 0x01d7:0x001a +|CallTo16(func=0127:0070,ds=0927) +|Call WPROCS.24: TASK_RESCHEDULE() ret=00b7:1456 ds=0927 +|Ret WPROCS.24: TASK_RESCHEDULE() retval=0x8672 ret=00b7:1456 ds=0927 +|CallTo16(func=01d7:001a,ds=0927) +| AX=0000 BX=3cb4 CX=1f40 DX=0000 SI=0000 DI=0927 BP=0000 ES=11f7 +|Loading symbols: /home/marcus/wine/wine... +|Stopped on breakpoint 1 at 0x01d7:0x001a |In 16 bit mode. |Wine-dbg>break MessageBox32A <---- Set Breakpoint -|Breakpoint 2 at 0x080e792c (MessageBox32A [msgbox.c:198]) +|Breakpoint 2 at 0x40189100 (MessageBox32A [msgbox.c:190]) |Wine-dbg>c <---- Continue |Call KERNEL.91: INITTASK() ret=0157:0022 ds=08a7 | AX=0000 BX=3cb4 CX=1f40 DX=0000 SI=0000 DI=08a7 ES=11d7 EFL=00000286 |CallTo16(func=090f:085c,ds=0dcf,0x0000,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0dcf) |... <----- Much debugoutput -|Call KERNEL.97: GETTEMPFILENAME(0x00c3,08a7:8350,0x0000,08a7:8234) ret=058f:09b1 ds=08a7 - ^ ^ ^ ^ - | | | |LPSTR buffer - | | |UINT16 unique - | |LPCSTR prefix - |BYTE drive +|Call KERNEL.136: GETDRIVETYPE(0x0000) ret=060f:097b ds=0927 + ^^^^^^ Drive 0 (A:) +|Ret KERNEL.136: GETDRIVETYPE() retval=0x0002 ret=060f:097b ds=0927 + ^^^^^^ DRIVE_REMOVEABLE + (It is a floppy diskdrive.) -|Ret KERNEL.97: GETTEMPFILENAME() retval=0xce3f ret=058f:09b1 ds=08a7 - ^ - |new unique number +|Call KERNEL.136: GETDRIVETYPE(0x0001) ret=060f:097b ds=0927 + ^^^^^^ Drive 1 (B:) +|Ret KERNEL.136: GETDRIVETYPE() retval=0x0000 ret=060f:097b ds=0927 + ^^^^^^ DRIVE_CANNOTDETERMINE + (I don't have drive B: assigned) -|Call KERNEL.74: OPENFILE(08a7:8234,08a7:82c6,0x1012) ret=058f:09d8 ds=08a7 - ^ ^ ^ - | | |UINT32 mode - | |OFSTRUCT *ofs - |LPCSTR name +|Call KERNEL.136: GETDRIVETYPE(0x0002) ret=060f:097b ds=0927 + ^^^^^^^ Drive 2 (C:) +|Ret KERNEL.136: GETDRIVETYPE() retval=0x0003 ret=060f:097b ds=0927 + ^^^^^^ DRIVE_FIXED + (specified as a harddisk) -|Ret KERNEL.74: OPENFILE() retval=0xffff ret=058f:09d8 ds=08a7 - ^ - | -1 aka. HFILE_ERROR +|Call KERNEL.97: GETTEMPFILENAME(0x00c3,0x09278364"doc",0x0000,0927:8248) ret=060f:09b1 ds=0927 + ^^^^^^ ^^^^^ ^^^^^^^^^ + | | |buffer for fname + | |temporary name ~docXXXX.tmp + |Force use of Drive C:. -|Call USER.1: MESSAGEBOX(0x0000,08ef:8362,0000:0000,0x1030) ret=05d7:084f ds=08efStopped on breakpoint 2 at 0x080e792c (MessageBox32A [msgbox.c:198]) -|198 { -|In 32 bit mode. -|Wine-dbg> _ - - Now, we see that OPENFILE seem to have returned 0xFFFF (or -1). Checking - the implementation of OpenFile in files/file.c, this signals an error. - The mode flags (OF_READWRITE|OF_SHARE_EXCLUSIVE|OF_CREATE) seems to - indicate, that WinWord wants to open the file for writing, so we check - the filename. Since we don't see the filename in this debugoutput, we use - the dprintf_file() in OpenFile to print out more information by adding - "-debugmsg +relay" to the commandline. - - (In fact, we see that the filename has been returned by the GetTempFileName - function above, but we check it anyway.) - -|marcus@jet $ wine winword.exe -debugmsg +relay,+file -debug -|.....much more debugoutput ..... -| - -|Call KERNEL.97: GETTEMPFILENAME(0x00c3,08ef:8350,0x0000,08ef:8234) ret=05d7:09b1 ds=08ef -|FILE_Create: 'C:\~doc8b93.tmp' 01b6 1 -|FILE_SetDosError: errno = 13 - -|Warning: GetTempFileName returns 'C:\~doc8b93.tmp', which doesn't seem to be writeable. +|Warning: GetTempFileName returns 'C:~doc9281.tmp', which doesn't seem to be writeable. |Please check your configuration file if this generates a failure. - ^ Warning message -|GetTempFileName: returning C:\~doc8b93.tmp -|Ret KERNEL.97: GETTEMPFILENAME() retval=0x8b93 ret=05d7:09b1 ds=08ef -|Call KERNEL.74: OPENFILE(08ef:8234,08ef:82c6,0x1012) ret=05d7:09d8 ds=08ef -|OpenFile: C:\~doc8b93.tmp 1012 -|FILE_Create: 'C:\~doc8b93.tmp' 01b6 0 -|FILE_SetDosError: errno = 13 -|OpenFile(C:\~doc8b93.tmp): return = HFILE_ERROR -|Ret KERNEL.74: OPENFILE() retval=0xffff ret=05d7:09d8 ds=08ef +Whoops, it even detects that something is wrong! +|Ret KERNEL.97: GETTEMPFILENAME() retval=0x9281 ret=060f:09b1 ds=0927 + ^^^^^^ Temporary storage ID - The filename is "C:\~docd03d.tmp". Of course, C:\ is writeable for the - superuser only, so the open fails for a normal user and OpenFile returns - -1, which in turn generates this messagebox. (As said by the warning - message.) +|Call KERNEL.74: OPENFILE(0x09278248"C:~doc9281.tmp",0927:82da,0x1012) ret=060f:09d8 ds=0927 + ^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^ + |filename |OFSTRUCT |open mode: + OF_CREATE|OF_SHARE_EXCLUSIVE|OF_READWRITE + +This fails, since my C: drive is in this case mounted readonly. + +|Ret KERNEL.74: OPENFILE() retval=0xffff ret=060f:09d8 ds=0927 + ^^^^^^ HFILE_ERROR16, yes, it failed. + +|Call USER.1: MESSAGEBOX(0x0000,0x09278376"Sie müssen Windows verlassen und SHARE.EXE laden bevor Sie Word starten.",0x00000000,0x1030) ret=060f:084f ds=0927 + +And MessageBox'ed. + +|Stopped on breakpoint 2 at 0x40189100 (MessageBox32A [msgbox.c:190]) +|190 { <- the sourceline +In 32 bit mode. +Wine-dbg> + + The code seems to find a writeable harddisk and tries to create a file + there. To work around this bug, you can define C: as a networkdrive, + which is ignored by the code above. Written by Marcus Meissner , additions welcome. diff --git a/documentation/wine.texinfo b/documentation/wine.texinfo index 02f88a6155f..1425f84e8df 100644 --- a/documentation/wine.texinfo +++ b/documentation/wine.texinfo @@ -23,7 +23,7 @@ END-INFO-DIR-ENTRY This file documents Wine, the Windows Emulator. @c -Copyright @copyright{} 1997 The Wine authors. @* +Copyright @copyright{} 1997,1998 The Wine authors. @* @xref{Authors, The Wine Authors, The Wine Authors}, for a list of the copyright holders. @@ -44,8 +44,8 @@ versions of this manual under the conditions stated in the section entitled ``License, Warranty, and Authors of Wine''. @sp 4 -FIXME: UNIX and POSIX trademarks. @* -X11 @* +FIXME: X11 and POSIX trademarks. @* +UNIX is a registered trademark of the Open Group. Microsoft, Windows, MS-Windows, Windows-NT, Windows 95, and MS-DOS are registered trademarks of Microsoft Corporation. NT is a trademark of Northern Telecom Limited. @@ -59,17 +59,16 @@ be registered in certain jurisdictions. @setchapternewpage odd @titlepage -@sp 10 - -@center @titlefont{The Wine Reference Manual} -@center Edition 0.0.3, 14 August 1997 +@title{The Wine Reference Manual} +@subtitle{Edition 0.0.5, February 1998} +@author{The Wine Team} @c The following two commands start the copyright page. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1997 The Wine authors. @* +Copyright @copyright{} 1997, 1998 The Wine authors. @* @xref{Authors, The Wine Authors, The Wine Authors}, for a list of the copyright holders. @@ -101,12 +100,12 @@ be registered in certain jurisdictions. @c Edit this macro manually in the above parts of the document @macro winemanualversion -0.0.3 +0.0.4 @end macro @c Edit this macro manually in the above parts of the document @macro winemanualdate -14 August 1997 +February 1998 @end macro @c Edit this macro manually into the TeX titlepage @@ -122,12 +121,12 @@ Winelib @c MICROSOFT @c -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @macro mswindows MS-Windows @end macro -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @c spell it always the same @macro WIN32 WIN32 @@ -136,17 +135,17 @@ WIN32 WIN16 @end macro -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @macro WINNT Windows NT @end macro -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @macro WINNT40 Windows NT 4.0 @end macro -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @macro WIN95 Windows 95 @end macro @@ -155,12 +154,12 @@ Windows 95 @c @c THE OTHERS @c -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @macro unix UNIX @end macro -@c FIXME: automatical trademark reference +@c FIXME: automatic trademark reference @macro posix POSIX @end macro @@ -1203,7 +1202,14 @@ FIXME: write installation guide @section Applying patches @xref{Creating patches}, for instructions on creating patches. -FIXME: write patch instructions +@kbd{cd} to the top source directory for Wine, and run +@code{patch -p1 < @var{patchfile}}. +What needs to be done next depends to some extent on what the +patch touches. For small patches which only alter C source, it can be +enough to rerun @code{make}. In general, the sequence @code{configure}, +@code{make depend}, @code{make} is sufficient, unless the patch alters +@code{[config.in]}, in which case you must regenerate @code{configure} +via @code{make configure} (which just runs @code{autoconf}). @node The Wine Project, , Installation, Top @@ -1842,7 +1848,7 @@ compiled as a library, they will be defined; if Wine is compiled as an emulator, they won't. You therefore have to access all functions and data types by their full -names, with the proper suffix explicitely appended. In Wine, the 16 bit +names, with the proper suffix explicitly appended. In Wine, the 16 bit and 32 bit versions of the functions are distinct entities, which might (theoretically) show a completely different behaviour. They may even call each other (and they will quite frequently). @@ -1858,7 +1864,20 @@ The 16-to-32 bit mapping is done on exporting the DLL functions. @section Creating patches @xref{Applying patches}, for instructions on applying patches. -FIXME: how to create patches +Patches are created with the program @code{diff}. You need a copy +of clean source tree to diff against. The @samp{-u} option, to create +unified diffs, is popular but not obligatory. +For changes to a single file, +@code{diff -u wine990101/windows/win.c mywine/windows/win.c > win_patch} +is sufficient. +To generate a complete diff between your tree and the distribution, +use @code{diff -uR wine990101 mywine}. + +This assumes that the original distribution and your personal tree +have the same parent directory, from which you make the diff. +This ensures a consistent format for the diffs, which in turn +is necessary so that they can be applied consistently as described in +@xref{Applying patches}. @node Adding Documentation, File names, Creating patches, The Wine Project @section Adding Documentation diff --git a/files/directory.c b/files/directory.c index f740f3ebe25..dafec96f1ea 100644 --- a/files/directory.c +++ b/files/directory.c @@ -18,7 +18,6 @@ #include "heap.h" #include "msdos.h" #include "options.h" -#include "stddebug.h" #include "debug.h" #define MAX_PATH_ELEMENTS 20 @@ -97,10 +96,10 @@ void DIR_ParseWindowsPath( char *path ) DIR_PathElements++; } - if (debugging_dosfs) + if (debugging_info(dosfs)) for (i = 0; i < DIR_PathElements; i++) { - dprintf_dosfs( stddeb, "Path[%d]: %s = %s\n", + dprintf_info(dosfs, "Path[%d]: %s = %s\n", i, DIR_DosPath[i], DIR_UnixPath[i] ); } } @@ -156,9 +155,9 @@ int DIR_Init(void) path, sizeof(path) ); DIR_ParseWindowsPath( path ); - dprintf_dosfs( stddeb, "WindowsDir = %s\nSystemDir = %s\n", + dprintf_info(dosfs, "WindowsDir = %s\nSystemDir = %s\n", DIR_WindowsDosDir, DIR_SystemDosDir ); - dprintf_dosfs( stddeb, "TempDir = %s\nCwd = %c:\\%s\n", + dprintf_info(dosfs, "TempDir = %s\nCwd = %c:\\%s\n", DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) ); /* Put the temp and Windows and system directories into the environment */ @@ -328,7 +327,7 @@ UINT32 WINAPI GetSystemDirectory32W( LPWSTR path, UINT32 count ) */ BOOL16 WINAPI CreateDirectory16( LPCSTR path, LPVOID dummy ) { - dprintf_file( stddeb,"CreateDirectory16(%s,%p)\n", path, dummy ); + dprintf_info(file,"CreateDirectory16(%s,%p)\n", path, dummy ); return (BOOL16)CreateDirectory32A( path, NULL ); } @@ -340,12 +339,11 @@ BOOL32 WINAPI CreateDirectory32A( LPCSTR path, LPSECURITY_ATTRIBUTES lpsecattribs ) { DOS_FULL_NAME full_name; - LPCSTR unixName; - dprintf_file( stddeb, "CreateDirectory32A(%s,%p)\n", path, lpsecattribs ); - if ((unixName = DOSFS_IsDevice( path )) != NULL) + dprintf_info(file, "CreateDirectory32A(%s,%p)\n", path, lpsecattribs ); + if (DOSFS_IsDevice( path )) { - dprintf_file(stddeb, "CreateDirectory: device '%s'!\n", unixName); + dprintf_info(file, "CreateDirectory: cannot use device '%s'!\n",path); DOS_ERROR( ER_AccessDenied, EC_AccessDenied, SA_Abort, EL_Disk ); return FALSE; } @@ -407,13 +405,12 @@ BOOL16 WINAPI RemoveDirectory16( LPCSTR path ) BOOL32 WINAPI RemoveDirectory32A( LPCSTR path ) { DOS_FULL_NAME full_name; - LPCSTR unixName; - dprintf_file(stddeb, "RemoveDirectory: '%s'\n", path ); + dprintf_info(file, "RemoveDirectory: '%s'\n", path ); - if ((unixName = DOSFS_IsDevice( path )) != NULL) + if (DOSFS_IsDevice( path )) { - dprintf_file(stddeb, "RemoveDirectory: device '%s'!\n", unixName); + dprintf_info(file, "RemoveDirectory: cannot remove device '%s'!\n", path); DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); return FALSE; } diff --git a/files/dos_fs.c b/files/dos_fs.c index 5cd8e762bf2..416c5c0c69c 100644 --- a/files/dos_fs.c +++ b/files/dos_fs.c @@ -27,7 +27,6 @@ #include "file.h" #include "heap.h" #include "msdos.h" -#include "stddebug.h" #include "debug.h" /* Define the VFAT ioctl to get both short and long file names */ @@ -50,20 +49,8 @@ typedef struct /* Chars we don't want to see in DOS file names */ #define INVALID_DOS_CHARS "*?<>|\"+=,;[] \345" -static const char *DOSFS_Devices[][2] = -{ - { "CON", "" }, - { "PRN", "" }, - { "NUL", "/dev/null" }, - { "AUX", "" }, - { "LPT1", "" }, - { "LPT2", "" }, - { "LPT3", "" }, - { "LPT4", "" }, - { "COM1", "" }, - { "COM2", "" }, - { "COM3", "" }, - { "COM4", "" } +static const char *DOSFS_Devices[] = { +"CON","PRN","NUL","AUX","LPT1","LPT2","LPT3","LPT4","COM1","COM2","COM3","COM4", }; @@ -513,13 +500,13 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, if ((p = strchr( name, '\\' ))) len = MIN( (int)(p - name), len ); if (long_len < len + 1) return FALSE; - dprintf_dosfs( stddeb, "DOSFS_FindUnixName: %s,%s\n", path, name ); + dprintf_info(dosfs, "DOSFS_FindUnixName: %s,%s\n", path, name ); if (!DOSFS_ToDosFCBFormat( name, dos_name )) dos_name[0] = '\0'; if (!(dir = DOSFS_OpenDir( path ))) { - dprintf_dosfs( stddeb, "DOSFS_FindUnixName(%s,%s): can't open dir: %s\n", + dprintf_warn(dosfs, "DOSFS_FindUnixName(%s,%s): can't open dir: %s\n", path, name, strerror(errno) ); return FALSE; } @@ -559,12 +546,11 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, else DOSFS_Hash( long_name, short_buf, FALSE, ignore_case ); } - dprintf_dosfs( stddeb, "DOSFS_FindUnixName(%s,%s) -> %s (%s)\n", - path, name, long_name, short_buf ? short_buf : "***"); + dprintf_info(dosfs, "(%s,%s) -> %s (%s)\n", + path, name, long_name, short_buf ? short_buf : "***"); } else - dprintf_dosfs(stddeb,"DOSFS_FindUnixName(%s,%s) -> ** Not found **\n", - path, name ); + dprintf_warn(dosfs, "file: '%s' NOT FOUND in dir: '%s'\n", name, path); DOSFS_CloseDir( dir ); return ret; } @@ -573,10 +559,34 @@ BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, /*********************************************************************** * DOSFS_IsDevice * - * Check if a DOS file name represents a DOS device. Returns the name - * of the associated Unix device, or NULL if not found. + * Check if a DOS file name represents a DOS device. */ -const char *DOSFS_IsDevice( const char *name ) +BOOL32 DOSFS_IsDevice( const char *name ) +{ + int i; + const char *p; + + if (name[0] && (name[1] == ':')) name += 2; + if ((p = strrchr( name, '/' ))) name = p + 1; + if ((p = strrchr( name, '\\' ))) name = p + 1; + for (i = 0; i < sizeof(DOSFS_Devices)/sizeof(DOSFS_Devices[0]); i++) + { + const char *dev = DOSFS_Devices[i]; + if (!lstrncmpi32A( dev, name, strlen(dev) )) + { + p = name + strlen( dev ); + if (!*p || (*p == '.')) return TRUE; + } + } + return FALSE; +} + +/*********************************************************************** + * DOSFS_OpenDevice + * + * Open a DOS device. This might not map 1:1 into the UNIX device concept. + */ +HFILE32 DOSFS_OpenDevice( const char *name, int unixmode ) { int i; const char *p; @@ -586,16 +596,37 @@ const char *DOSFS_IsDevice( const char *name ) if ((p = strrchr( name, '\\' ))) name = p + 1; for (i = 0; i < sizeof(DOSFS_Devices)/sizeof(DOSFS_Devices[0]); i++) { - const char *dev = DOSFS_Devices[i][0]; + const char *dev = DOSFS_Devices[i]; if (!lstrncmpi32A( dev, name, strlen(dev) )) { p = name + strlen( dev ); - if (!*p || (*p == '.')) return DOSFS_Devices[i][1]; + if (!*p || (*p == '.')) { + /* got it */ + if (!strcmp(DOSFS_Devices[i],"NUL")) + return FILE_OpenUnixFile("/dev/null",unixmode); + if (!strcmp(DOSFS_Devices[i],"CON")) { + switch (unixmode) { + case O_RDONLY: + return GetStdHandle( STD_INPUT_HANDLE ); + break; + case O_WRONLY: + return GetStdHandle( STD_OUTPUT_HANDLE ); + break; + default: + fprintf(stderr,"DOSFS_OpenDevice: CON cannot be opened read/write currently, FIXME.\n"); + return HFILE_ERROR32; + break; + } + } + /* FIXME: the rest of the devices ... lptX, comX et.al. */ + return HFILE_ERROR32; + } } } - return NULL; + return HFILE_ERROR32; } + /*********************************************************************** * DOSFS_GetPathDrive * @@ -648,7 +679,7 @@ BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last, DOS_FULL_NAME *full ) UINT32 flags; char *p_l, *p_s, *root; - dprintf_dosfs( stddeb, "DOSFS_GetFullName: %s (last=%d)\n", + dprintf_info(dosfs, "DOSFS_GetFullName: %s (last=%d)\n", name, check_last ); if ((full->drive = DOSFS_GetPathDrive( &name )) == -1) return FALSE; @@ -756,7 +787,7 @@ BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last, DOS_FULL_NAME *full ) } if (!full->long_name[0]) strcpy( full->long_name, "/" ); if (!full->short_name[2]) strcpy( full->short_name + 2, "\\" ); - dprintf_dosfs( stddeb, "DOSFS_GetFullName: returning %s = %s\n", + dprintf_info(dosfs, "DOSFS_GetFullName: returning %s = %s\n", full->long_name, full->short_name ); return TRUE; } @@ -846,7 +877,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result, int drive; char *p; - dprintf_dosfs( stddeb, "GetFullPathName: converting %s\n", name ); + dprintf_info(dosfs, "GetFullPathName: converting %s\n", name ); if (!name || !result) return 0; @@ -910,7 +941,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result, if (unicode) lstrcpynAtoW( (LPWSTR)result, buffer, len ); else lstrcpyn32A( result, buffer, len ); - dprintf_dosfs( stddeb, "GetFullPathName: returning %s\n", buffer ); + dprintf_info(dosfs, "GetFullPathName: returning %s\n", buffer ); return strlen(buffer); } @@ -995,7 +1026,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask, else /* Not in the cache, open it anew */ { const char *drive_path; - dprintf_dosfs( stddeb, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n", + dprintf_info(dosfs, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n", path, skip, buffer, cur_pos ); cur_pos = skip; if (dir) DOSFS_CloseDir(dir); @@ -1004,7 +1035,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask, drive_path = path + strlen(DRIVE_GetRoot(drive)); while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++; drive_root = !*drive_path; - dprintf_dosfs(stddeb, "DOSFS_FindNext: drive_root = %d\n", drive_root); + dprintf_info(dosfs, "DOSFS_FindNext: drive_root = %d\n", drive_root); lstrcpyn32A( buffer, path, sizeof(buffer) - 1 ); } strcat( buffer, "/" ); @@ -1070,7 +1101,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask, lstrcpyn32A( entry->cFileName, long_name, sizeof(entry->cFileName) ); if (!(flags & DRIVE_CASE_PRESERVING)) CharLower32A( entry->cFileName ); - dprintf_dosfs( stddeb, "DOSFS_FindNext: returning %s (%s) %02lx %ld\n", + dprintf_info(dosfs, "DOSFS_FindNext: returning %s (%s) %02lx %ld\n", entry->cFileName, entry->cAlternateFileName, entry->dwFileAttributes, entry->nFileSizeLow ); cur_pos += count; @@ -1537,7 +1568,7 @@ BOOL32 WINAPI FileTimeToSystemTime( const FILETIME *ft, LPSYSTEMTIME syst ) time_t xtime = DOSFS_FileTimeToUnixTime( ft, &remainder ); xtm = gmtime(&xtime); syst->wYear = xtm->tm_year; - syst->wMonth = xtm->tm_mon; + syst->wMonth = xtm->tm_mon + 1; syst->wDayOfWeek = xtm->tm_wday; syst->wDay = xtm->tm_mday; syst->wHour = xtm->tm_hour; @@ -1557,7 +1588,7 @@ DWORD WINAPI QueryDosDevice32A(LPCSTR devname,LPSTR target,DWORD bufsize) LPSTR s; char buffer[200]; - dprintf_dosfs(stddeb,"QueryDosDevice(%s,...)\n",devname?devname:""); + dprintf_info(dosfs,"QueryDosDevice(%s,...)\n",devname?devname:""); if (!devname) { /* return known MSDOS devices */ lstrcpy32A(buffer,"CON COM1 COM2 LPT1 NUL "); @@ -1601,7 +1632,7 @@ BOOL32 WINAPI SystemTimeToFileTime( const SYSTEMTIME *syst, LPFILETIME ft ) struct tm xtm; xtm.tm_year = syst->wYear; - xtm.tm_mon = syst->wMonth; + xtm.tm_mon = syst->wMonth - 1; xtm.tm_wday = syst->wDayOfWeek; xtm.tm_mday = syst->wDay; xtm.tm_hour = syst->wHour; diff --git a/files/drive.c b/files/drive.c index cdb7d9c5cd2..35266cd3a5d 100644 --- a/files/drive.c +++ b/files/drive.c @@ -33,7 +33,6 @@ #include "msdos.h" #include "options.h" #include "task.h" -#include "stddebug.h" #include "debug.h" typedef struct @@ -194,12 +193,12 @@ int DRIVE_Init(void) DRIVE_CurDrive = i; count++; - dprintf_dosfs( stddeb, "%s: path=%s type=%s label='%s' serial=%08lx flags=%08x dev=%x ino=%x\n", + dprintf_info(dosfs, "%s: path=%s type=%s label='%s' serial=%08lx flags=%08x dev=%x ino=%x\n", name, path, DRIVE_Types[drive->type], drive->label, drive->serial, drive->flags, (int)drive->dev, (int)drive->ino ); } - else dprintf_dosfs( stddeb, "%s: not defined\n", name ); + else dprintf_warn(dosfs, "%s: not defined\n", name ); } if (!count) @@ -266,7 +265,7 @@ int DRIVE_SetCurrentDrive( int drive ) DOS_ERROR( ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk ); return 0; } - dprintf_dosfs( stddeb, "DRIVE_SetCurrentDrive: %c:\n", 'A' + drive ); + dprintf_info(dosfs, "DRIVE_SetCurrentDrive: %c:\n", 'A' + drive ); DRIVE_CurDrive = drive; if (pTask) pTask->curdrive = drive | 0x80; return 1; @@ -326,7 +325,7 @@ int DRIVE_FindDriveRoot( const char **path ) *next = 0; if (rootdrive != -1) - dprintf_dosfs( stddeb, "DRIVE_FindDriveRoot: %s -> drive %c:, root='%s', name='%s'\n", + dprintf_info(dosfs, "DRIVE_FindDriveRoot: %s -> drive %c:, root='%s', name='%s'\n", buffer, 'A' + rootdrive, DOSDrives[rootdrive].root, *path ); return rootdrive; @@ -447,7 +446,7 @@ int DRIVE_Chdir( int drive, const char *path ) BY_HANDLE_FILE_INFORMATION info; TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() ); - dprintf_dosfs( stddeb, "DRIVE_Chdir(%c:,%s)\n", 'A' + drive, path ); + dprintf_info(dosfs, "DRIVE_Chdir(%c:,%s)\n", 'A' + drive, path ); strcpy( buffer, "A:" ); buffer[0] += drive; lstrcpyn32A( buffer + 2, path, sizeof(buffer) - 2 ); @@ -462,7 +461,7 @@ int DRIVE_Chdir( int drive, const char *path ) unix_cwd = full_name.long_name + strlen( DOSDrives[drive].root ); while (*unix_cwd == '/') unix_cwd++; - dprintf_dosfs( stddeb, "DRIVE_Chdir(%c:): unix_cwd=%s dos_cwd=%s\n", + dprintf_info(dosfs, "DRIVE_Chdir(%c:): unix_cwd=%s dos_cwd=%s\n", 'A' + drive, unix_cwd, full_name.short_name + 3 ); HeapFree( SystemHeap, 0, DOSDrives[drive].dos_cwd ); @@ -535,7 +534,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive ) if ( new->root ) { - dprintf_dosfs ( stddeb, "Can\'t map drive %c to drive %c - " + dprintf_info(dosfs, "Can\'t map drive %c to drive %c - " "drive %c already exists\n", 'A' + existing_drive, 'A' + new_drive, 'A' + new_drive ); @@ -552,7 +551,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive ) new->dev = old->dev; new->ino = old->ino; - dprintf_dosfs ( stddeb, "Drive %c is now equal to drive %c\n", + dprintf_info(dosfs, "Drive %c is now equal to drive %c\n", 'A' + new_drive, 'A' + existing_drive ); return 1; @@ -566,7 +565,7 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive ) */ int DRIVE_OpenDevice( int drive, int flags ) { - if (!DRIVE_IsValid( drive )) return NULL; + if (!DRIVE_IsValid( drive )) return -1; return open( DOSDrives[drive].device, flags ); } @@ -735,7 +734,7 @@ BOOL32 WINAPI GetDiskFreeSpaceEx32W( LPCWSTR root, LPULARGE_INTEGER avail, */ UINT16 WINAPI GetDriveType16( UINT16 drive ) { - dprintf_dosfs( stddeb, "GetDriveType16(%c:)\n", 'A' + drive ); + dprintf_info(dosfs, "GetDriveType16(%c:)\n", 'A' + drive ); switch(DRIVE_GetType(drive)) { case TYPE_FLOPPY: return DRIVE_REMOVABLE; @@ -753,7 +752,7 @@ UINT16 WINAPI GetDriveType16( UINT16 drive ) */ UINT32 WINAPI GetDriveType32A( LPCSTR root ) { - dprintf_dosfs( stddeb, "GetDriveType32A(%s)\n", root ); + dprintf_info(dosfs, "GetDriveType32A(%s)\n", root ); if ((root[1]) && (root[1] != ':')) { fprintf( stderr, "GetDriveType32A: invalid root '%s'\n", root ); diff --git a/files/file.c b/files/file.c index 29f9abfbfb7..e1de21814d0 100644 --- a/files/file.c +++ b/files/file.c @@ -31,13 +31,16 @@ #include "ldt.h" #include "process.h" #include "task.h" -#include "stddebug.h" #include "debug.h" #if defined(MAP_ANONYMOUS) && !defined(MAP_ANON) #define MAP_ANON MAP_ANONYMOUS #endif +static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars, + LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped); +static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars, + LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped); static void FILE_Destroy( K32OBJ *obj ); const K32OBJ_OPS FILE_Ops = @@ -47,6 +50,8 @@ const K32OBJ_OPS FILE_Ops = NULL, /* satisfied */ NULL, /* add_wait */ NULL, /* remove_wait */ + FILE_Read, /* read */ + FILE_Write, /* write */ FILE_Destroy /* destroy */ }; @@ -92,6 +97,70 @@ static HFILE32 FILE_Alloc( FILE_OBJECT **file ) } +/* FIXME: lpOverlapped is ignored */ +static BOOL32 FILE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars, + LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped) +{ + FILE_OBJECT *file = (FILE_OBJECT *)ptr; + int result; + + dprintf_info(file, "FILE_Read: %p %p %ld\n", ptr, lpBuffer, + nNumberOfChars); + + if (nNumberOfChars == 0) { + *lpNumberOfChars = 0; /* FIXME: does this change */ + return TRUE; + } + + if ((result = read(file->unix_handle, lpBuffer, nNumberOfChars)) == -1) + { + FILE_SetDosError(); + return FALSE; + } + *lpNumberOfChars = result; + return TRUE; +} + +/** + * experimentation yields that WriteFile: + * o does not truncate on write of 0 + * o always changes the *lpNumberOfChars to actual number of + * characters written + * o write of 0 nNumberOfChars returns TRUE + */ +static BOOL32 FILE_Write(K32OBJ *ptr, LPCVOID lpBuffer, DWORD nNumberOfChars, + LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped) +{ + FILE_OBJECT *file = (FILE_OBJECT *)ptr; + int result; + + dprintf_info(file, "FILE_Write: %p %p %ld\n", ptr, lpBuffer, + nNumberOfChars); + + *lpNumberOfChars = 0; + + /* FIXME: there was a loop here before that + * retried writes after EAGAIN, why??? -- I assume + * it is because win32 doesn't have interrupted + * system calls + */ + + for (;;) + { + result = write(file->unix_handle, lpBuffer, nNumberOfChars); + if (result != -1) { + *lpNumberOfChars = result; + return TRUE; + } + if (errno != EINTR) { + FILE_SetDosError(); + return FALSE; + } + } +} + + + /*********************************************************************** * FILE_Destroy * @@ -160,8 +229,7 @@ void FILE_SetDosError(void) { int save_errno = errno; /* errno gets overwritten by printf */ - dprintf_file(stddeb, "FILE_SetDosError: errno = %d %s\n", errno, - strerror(errno) ); + dprintf_info(file, "FILE_SetDosError: errno = %d %s\n", errno, strerror(errno)); switch (save_errno) { case EAGAIN: @@ -235,7 +303,7 @@ HFILE32 FILE_DupUnixHandle( int fd ) /*********************************************************************** * FILE_OpenUnixFile */ -static HFILE32 FILE_OpenUnixFile( const char *name, int mode ) +HFILE32 FILE_OpenUnixFile( const char *name, int mode ) { HFILE32 handle; FILE_OBJECT *file; @@ -277,19 +345,24 @@ HFILE32 FILE_Open( LPCSTR path, INT32 mode ) DOS_FULL_NAME full_name; const char *unixName; - dprintf_file(stddeb, "FILE_Open: '%s' %04x\n", path, mode ); + dprintf_info(file, "FILE_Open: '%s' %04x\n", path, mode ); if (!path) return HFILE_ERROR32; - if ((unixName = DOSFS_IsDevice( path )) != NULL) + if (DOSFS_IsDevice( path )) { - dprintf_file( stddeb, "FILE_Open: opening device '%s'\n", unixName ); - if (!unixName[0]) /* Non-existing device */ - { - dprintf_file(stddeb, "FILE_Open: Non-existing device\n"); - DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); - return HFILE_ERROR32; - } + HFILE32 ret; + + dprintf_info(file, "FILE_Open: opening device '%s'\n", path ); + + if (HFILE_ERROR32!=(ret=DOSFS_OpenDevice( path, mode ))) + return ret; + + /* Do not silence this please. It is a critical error. -MM */ + fprintf(stderr, "FILE_Open: Couldn't open device '%s'!\n",path); + DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); + return HFILE_ERROR32; + } else /* check for filename, don't check for last entry if creating */ { @@ -308,16 +381,15 @@ static HFILE32 FILE_Create( LPCSTR path, int mode, int unique ) { HFILE32 handle; FILE_OBJECT *file; - const char *unixName; DOS_FULL_NAME full_name; - dprintf_file(stddeb, "FILE_Create: '%s' %04x %d\n", path, mode, unique ); + dprintf_info(file, "FILE_Create: '%s' %04x %d\n", path, mode, unique ); if (!path) return INVALID_HANDLE_VALUE32; - if ((unixName = DOSFS_IsDevice( path )) != NULL) + if (DOSFS_IsDevice( path )) { - dprintf_file(stddeb, "FILE_Create: creating device '%s'!\n", unixName); + fprintf(stderr, "FILE_Create: cannot create DOS device '%s'!\n", path); DOS_ERROR( ER_AccessDenied, EC_NotFound, SA_Abort, EL_Disk ); return INVALID_HANDLE_VALUE32; } @@ -510,11 +582,11 @@ HFILE32 FILE_Dup( HFILE32 hFile ) FILE_OBJECT *file; HFILE32 handle; - dprintf_file( stddeb, "FILE_Dup for handle %d\n", hFile ); + dprintf_info(file, "FILE_Dup for handle %d\n", hFile ); if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32; handle = HANDLE_Alloc( &file->header, FILE_ALL_ACCESS /*FIXME*/, FALSE ); FILE_ReleaseFile( file ); - dprintf_file( stddeb, "FILE_Dup return handle %d\n", handle ); + dprintf_info(file, "FILE_Dup return handle %d\n", handle ); return handle; } @@ -528,7 +600,7 @@ HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 ) { FILE_OBJECT *file; - dprintf_file( stddeb, "FILE_Dup2 for handle %d\n", hFile1 ); + dprintf_info(file, "FILE_Dup2 for handle %d\n", hFile1 ); /* FIXME: should use DuplicateHandle */ if (!(file = FILE_GetFile( hFile1 ))) return HFILE_ERROR32; if (!HANDLE_SetObjPtr( hFile2, &file->header, 0 )) hFile2 = HFILE_ERROR32; @@ -600,7 +672,7 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique, HFILE32 handle = FILE_Create( buffer, 0666, TRUE ); if (handle != INVALID_HANDLE_VALUE32) { /* We created it */ - dprintf_file( stddeb, "GetTempFileName32A: created %s\n", + dprintf_info(file, "GetTempFileName32A: created %s\n", buffer); CloseHandle( handle ); break; @@ -624,7 +696,7 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique, "Please check your configuration file if this generates a failure.\n", buffer); } - dprintf_file( stddeb, "GetTempFileName32A: returning %s\n", buffer ); + dprintf_info(file, "GetTempFileName32A: returning %s\n", buffer ); return unique ? unique : num; } @@ -678,7 +750,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode, return HFILE_ERROR32; } - dprintf_file( stddeb, "OpenFile: %s %04x\n", name, mode ); + dprintf_info(file, "OpenFile: %s %04x\n", name, mode ); /* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName Are there any cases where getting the path here is wrong? @@ -692,7 +764,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode, { ofs->fFixedDisk = (GetDriveType16( ofs->szPathName[0]-'A' ) != DRIVE_REMOVABLE); - dprintf_file( stddeb, "OpenFile(%s): OF_PARSE, res = '%s'\n", + dprintf_info(file, "OpenFile(%s): OF_PARSE, res = '%s'\n", name, ofs->szPathName ); return 0; } @@ -725,7 +797,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode, if (!DIR_SearchPath( NULL, name, NULL, &full_name, win32 )) goto not_found; found: - dprintf_file( stddeb, "OpenFile: found %s = %s\n", + dprintf_info(file, "OpenFile: found %s = %s\n", full_name.long_name, full_name.short_name ); lstrcpyn32A( ofs->szPathName, full_name.short_name, sizeof(ofs->szPathName) ); @@ -733,7 +805,7 @@ found: if (mode & OF_DELETE) { if (unlink( full_name.long_name ) == -1) goto not_found; - dprintf_file( stddeb, "OpenFile(%s): OF_DELETE return = OK\n", name); + dprintf_info(file, "OpenFile(%s): OF_DELETE return = OK\n", name); return 1; } @@ -757,7 +829,7 @@ found: if (memcmp( ofs->reserved, filedatetime, sizeof(ofs->reserved) )) { CloseHandle( hFileRet ); - dprintf_file( stddeb, "OpenFile(%s): OF_VERIFY failed\n", name ); + dprintf_warn(file, "OpenFile(%s): OF_VERIFY failed\n", name ); /* FIXME: what error here? */ DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); goto error; @@ -766,19 +838,19 @@ found: memcpy( ofs->reserved, filedatetime, sizeof(ofs->reserved) ); success: /* We get here if the open was successful */ - dprintf_file( stddeb, "OpenFile(%s): OK, return = %d\n", name, hFileRet ); + dprintf_info(file, "OpenFile(%s): OK, return = %d\n", name, hFileRet ); if (mode & OF_EXIST) /* Return the handle, but close it first */ CloseHandle( hFileRet ); return hFileRet; not_found: /* We get here if the file does not exist */ - dprintf_file( stddeb, "OpenFile: '%s' not found\n", name ); + dprintf_warn(file, "OpenFile: '%s' not found\n", name ); DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); /* fall through */ error: /* We get here if there was an error opening the file */ ofs->nErrCode = DOS_ExtendedError; - dprintf_file( stddeb, "OpenFile(%s): return = HFILE_ERROR error= %d\n", + dprintf_warn(file, "OpenFile(%s): return = HFILE_ERROR error= %d\n", name,ofs->nErrCode ); return HFILE_ERROR32; } @@ -807,7 +879,7 @@ HFILE32 WINAPI OpenFile32( LPCSTR name, OFSTRUCT *ofs, UINT32 mode ) */ HFILE16 WINAPI _lclose16( HFILE16 hFile ) { - dprintf_file( stddeb, "_lclose16: handle %d\n", hFile ); + dprintf_info(file, "_lclose16: handle %d\n", hFile ); return CloseHandle( hFile ) ? 0 : HFILE_ERROR16; } @@ -817,7 +889,7 @@ HFILE16 WINAPI _lclose16( HFILE16 hFile ) */ HFILE32 WINAPI _lclose32( HFILE32 hFile ) { - dprintf_file( stddeb, "_lclose32: handle %d\n", hFile ); + dprintf_info(file, "_lclose32: handle %d\n", hFile ); return CloseHandle( hFile ) ? 0 : HFILE_ERROR32; } @@ -829,7 +901,7 @@ LONG WINAPI WIN16_hread( HFILE16 hFile, SEGPTR buffer, LONG count ) { LONG maxlen; - dprintf_file( stddeb, "WIN16_hread: %d %08lx %ld\n", + dprintf_info(file, "WIN16_hread: %d %08lx %ld\n", hFile, (DWORD)buffer, count ); /* Some programs pass a count larger than the allocated buffer */ @@ -851,18 +923,19 @@ UINT16 WINAPI WIN16_lread( HFILE16 hFile, SEGPTR buffer, UINT16 count ) /*********************************************************************** * _lread32 (KERNEL32.596) */ -UINT32 WINAPI _lread32( HFILE32 hFile, LPVOID buffer, UINT32 count ) +UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count ) { - FILE_OBJECT *file; - UINT32 result; + K32OBJ *ptr; + DWORD numWritten; + BOOL32 result = FALSE; - dprintf_file( stddeb, "_lread32: %d %p %d\n", hFile, buffer, count ); - if (!(file = FILE_GetFile( hFile ))) return -1; - if (!count) result = 0; - else if ((result = read( file->unix_handle, buffer, count )) == -1) - FILE_SetDosError(); - FILE_ReleaseFile( file ); - return result; + dprintf_info( file, "_lread32: %d %p %d\n", handle, buffer, count); + if (!(ptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0))) return -1; + if (K32OBJ_OPS(ptr)->read) + result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL); + K32OBJ_DecCount( ptr ); + if (!result) return -1; + return (UINT32)numWritten; } @@ -881,7 +954,7 @@ UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count ) HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr ) { int mode = (attr & 1) ? 0444 : 0666; - dprintf_file( stddeb, "_lcreat16: %s %02x\n", path, attr ); + dprintf_info(file, "_lcreat16: %s %02x\n", path, attr ); return (HFILE16)FILE_Create( path, mode, FALSE ); } @@ -892,7 +965,7 @@ HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr ) HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr ) { int mode = (attr & 1) ? 0444 : 0666; - dprintf_file( stddeb, "_lcreat32: %s %02x\n", path, attr ); + dprintf_info(file, "_lcreat32: %s %02x\n", path, attr ); return FILE_Create( path, mode, FALSE ); } @@ -903,7 +976,7 @@ HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr ) HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr ) { int mode = (attr & 1) ? 0444 : 0666; - dprintf_file( stddeb, "_lcreat_uniq: %s %02x\n", path, attr ); + dprintf_info(file, "_lcreat_uniq: %s %02x\n", path, attr ); return FILE_Create( path, mode, TRUE ); } @@ -923,7 +996,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword, SetLastError( ERROR_INVALID_PARAMETER ); return 0xffffffff; } - dprintf_file( stddeb, "SetFilePointer: handle %d offset %ld origin %ld\n", + dprintf_info(file, "SetFilePointer: handle %d offset %ld origin %ld\n", hFile, distance, method ); if (!(file = FILE_GetFile( hFile ))) return 0xffffffff; @@ -975,7 +1048,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode ) { INT32 unixMode; - dprintf_file(stddeb, "_lopen32('%s',%04x)\n", path, mode ); + dprintf_info(file, "_lopen32('%s',%04x)\n", path, mode ); switch(mode & 3) { @@ -1040,31 +1113,43 @@ LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count ) /*********************************************************************** * _hwrite32 (KERNEL32.591) + * + * experimenation yields that _lwrite: + * o truncates the file at the current position with + * a 0 len write + * o returns 0 on a 0 length write + * o works with console handles + * */ -LONG WINAPI _hwrite32( HFILE32 hFile, LPCSTR buffer, LONG count ) +LONG WINAPI _hwrite32( HFILE32 handle, LPCSTR buffer, LONG count ) { - FILE_OBJECT *file; - LONG result; + K32OBJ *ioptr; + DWORD result; + BOOL32 status = FALSE; + + dprintf_info(file, "_hwrite32: %d %p %ld\n", handle, buffer, count ); - dprintf_file( stddeb, "_hwrite32: %d %p %ld\n", hFile, buffer, count ); + if (count == 0) { /* Expand or truncate at current position */ + FILE_OBJECT *file = FILE_GetFile(handle); - if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32; - if (count == 0) /* Expand or truncate at current position */ - result = ftruncate( file->unix_handle, - lseek( file->unix_handle, 0, SEEK_CUR ) ); - else for (;;) - { - result = write( file->unix_handle, buffer, count ); - if (result != -1) break; - if (errno != EINTR) - { - FILE_SetDosError(); - break; - } - } - - FILE_ReleaseFile( file ); - return result; + if ( ftruncate(file->unix_handle, + lseek( file->unix_handle, 0, SEEK_CUR)) == 0 ) { + FILE_ReleaseFile(file); + return 0; + } else { + FILE_SetDosError(); + FILE_ReleaseFile(file); + return HFILE_ERROR32; + } + } + + if (!(ioptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0 ))) + return HFILE_ERROR32; + if (K32OBJ_OPS(ioptr)->write) + status = K32OBJ_OPS(ioptr)->write(ioptr, buffer, count, &result, NULL); + K32OBJ_DecCount( ioptr ); + if (!status) result = HFILE_ERROR32; + return result; } @@ -1077,7 +1162,7 @@ UINT16 WINAPI SetHandleCount16( UINT16 count ) PDB *pdb = (PDB *)GlobalLock16( hPDB ); BYTE *files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr ); - dprintf_file( stddeb, "SetHandleCount16(%d)\n", count ); + dprintf_info(file, "SetHandleCount16(%d)\n", count ); if (count < 20) count = 20; /* No point in going below 20 */ else if (count > 254) count = 254; @@ -1137,7 +1222,7 @@ BOOL32 WINAPI FlushFileBuffers( HFILE32 hFile ) FILE_OBJECT *file; BOOL32 ret; - dprintf_file( stddeb, "FlushFileBuffers(%d)\n", hFile ); + dprintf_info(file, "FlushFileBuffers(%d)\n", hFile ); if (!(file = FILE_GetFile( hFile ))) return FALSE; if (fsync( file->unix_handle ) != -1) ret = TRUE; else @@ -1158,7 +1243,7 @@ BOOL32 WINAPI SetEndOfFile( HFILE32 hFile ) FILE_OBJECT *file; BOOL32 ret = TRUE; - dprintf_file( stddeb, "SetEndOfFile(%d)\n", hFile ); + dprintf_info(file, "SetEndOfFile(%d)\n", hFile ); if (!(file = FILE_GetFile( hFile ))) return FALSE; if (ftruncate( file->unix_handle, lseek( file->unix_handle, 0, SEEK_CUR ) )) @@ -1186,13 +1271,12 @@ BOOL16 WINAPI DeleteFile16( LPCSTR path ) BOOL32 WINAPI DeleteFile32A( LPCSTR path ) { DOS_FULL_NAME full_name; - const char *unixName; - dprintf_file(stddeb, "DeleteFile: '%s'\n", path ); + dprintf_info(file, "DeleteFile: '%s'\n", path ); - if ((unixName = DOSFS_IsDevice( path )) != NULL) + if (DOSFS_IsDevice( path )) { - dprintf_file(stddeb, "DeleteFile: removing device '%s'!\n", unixName); + fprintf(stderr, "DeleteFile: cannot remove DOS device '%s'!\n", path); DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk ); return FALSE; } @@ -1361,7 +1445,7 @@ BOOL32 WINAPI MoveFileEx32A( LPCSTR fn1, LPCSTR fn2, DWORD flag ) DOS_FULL_NAME full_name1, full_name2; int mode=0; /* mode == 1: use copy */ - dprintf_file( stddeb, "MoveFileEx32A(%s,%s,%04lx)\n", fn1, fn2, flag); + dprintf_info(file, "MoveFileEx32A(%s,%s,%04lx)\n", fn1, fn2, flag); if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE; if (fn2) { /* !fn2 means delete fn1 */ @@ -1461,7 +1545,7 @@ BOOL32 WINAPI MoveFile32A( LPCSTR fn1, LPCSTR fn2 ) DOS_FULL_NAME full_name1, full_name2; struct stat fstat; - dprintf_file( stddeb, "MoveFile32A(%s,%s)\n", fn1, fn2 ); + dprintf_info(file, "MoveFile32A(%s,%s)\n", fn1, fn2 ); if (!DOSFS_GetFullName( fn1, TRUE, &full_name1 )) return FALSE; if (DOSFS_GetFullName( fn2, TRUE, &full_name2 )) @@ -1479,7 +1563,7 @@ BOOL32 WINAPI MoveFile32A( LPCSTR fn1, LPCSTR fn2 ) else /*copy */ { if (stat( full_name1.long_name, &fstat )) { - dprintf_file( stddeb, "Invalid source file %s\n", + dprintf_warn(file, "Invalid source file %s\n", full_name1.long_name); FILE_SetDosError(); return FALSE; @@ -1580,7 +1664,7 @@ BOOL32 WINAPI SetFileTime( HFILE32 hFile, struct utimbuf utimbuf; if (!file) return FILE_TYPE_UNKNOWN; /* FIXME: correct? */ - dprintf_file(stddeb,"SetFileTime(%s,%p,%p,%p)\n", + dprintf_info(file,"SetFileTime(%s,%p,%p,%p)\n", file->unix_name, lpCreationTime, lpLastAccessTime, @@ -1697,12 +1781,12 @@ BOOL32 WINAPI LockFile( struct flock f; FILE_OBJECT *file; - dprintf_file(stddeb, "LockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n", + dprintf_info(file, "LockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n", hFile, dwFileOffsetLow, dwFileOffsetHigh, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh); if (dwFileOffsetHigh || nNumberOfBytesToLockHigh) { - dprintf_file(stddeb, "LockFile32: Unimplemented bytes > 32bits\n"); + dprintf_fixme(file, "LockFile32: Unimplemented bytes > 32bits\n"); return FALSE; } @@ -1748,12 +1832,12 @@ BOOL32 WINAPI UnlockFile( FILE_OBJECT *file; struct flock f; - dprintf_file(stddeb, "UnlockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n", + dprintf_info(file, "UnlockFile32: handle %d offsetlow=%ld offsethigh=%ld nbyteslow=%ld nbyteshigh=%ld\n", hFile, dwFileOffsetLow, dwFileOffsetHigh, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh); if (dwFileOffsetHigh || nNumberOfBytesToUnlockHigh) { - dprintf_file(stddeb, "UnlockFile32: Unimplemented bytes > 32bits\n"); + dprintf_warn(file, "UnlockFile32: Unimplemented bytes > 32bits\n"); return FALSE; } diff --git a/files/profile.c b/files/profile.c index 545049d3834..2b6f7eb29b7 100644 --- a/files/profile.c +++ b/files/profile.c @@ -13,7 +13,6 @@ #include "windows.h" #include "file.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" typedef struct tagPROFILEKEY @@ -216,11 +215,12 @@ static PROFILESECTION *PROFILE_Load( FILE *file ) *prev_key = key; prev_key = &key->next; } - if (debugging_profile) + if (debugging_info(profile)) { - fprintf( stddeb, "PROFILE_Load:\n" ); - PROFILE_Save( stddeb, first_section ); - fprintf( stddeb, "PROFILE_Load finished.\n" ); + dprintf_info(profile, "PROFILE_Load:\n" ); + /* FIXME: improper use of stddeb! */ + PROFILE_Save(stddeb, first_section ); + dprintf_info(profile, "PROFILE_Load finished.\n" ); } return first_section; } @@ -357,7 +357,7 @@ static BOOL32 PROFILE_FlushFile(void) return FALSE; } - dprintf_profile( stddeb, "Saving '%s' into '%s'\n", + dprintf_info(profile, "Saving '%s' into '%s'\n", CurProfile.dos_name, unix_name ); PROFILE_Save( file, CurProfile.section ); fclose( file ); @@ -380,7 +380,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename ) if (CurProfile.filename && !strcmp( filename, CurProfile.filename )) { - dprintf_profile( stddeb, "PROFILE_Open(%s): already opened\n", + dprintf_info(profile, "PROFILE_Open(%s): already opened\n", filename ); return TRUE; } @@ -400,7 +400,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename ) if (CurProfile.dos_name && !strcmp( full_name.short_name, CurProfile.dos_name )) { - dprintf_profile( stddeb, "PROFILE_Open(%s): already opened\n", + dprintf_info(profile, "PROFILE_Open(%s): already opened\n", filename ); return TRUE; } @@ -429,7 +429,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename ) CharLower32A( p ); if ((file = fopen( buffer, "r" ))) { - dprintf_profile( stddeb, "PROFILE_Open(%s): found it in %s\n", + dprintf_info(profile, "PROFILE_Open(%s): found it in %s\n", filename, buffer ); CurProfile.unix_name = HEAP_strdupA( SystemHeap, 0, buffer ); } @@ -440,7 +440,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename ) CurProfile.unix_name = HEAP_strdupA( SystemHeap, 0, full_name.long_name ); if ((file = fopen( full_name.long_name, "r" ))) - dprintf_profile( stddeb, "PROFILE_Open(%s): found it in %s\n", + dprintf_info(profile, "PROFILE_Open(%s): found it in %s\n", filename, full_name.long_name ); } @@ -506,7 +506,7 @@ static INT32 PROFILE_GetString( LPCSTR section, LPCSTR key_name, key = PROFILE_Find( &CurProfile.section, section, key_name, FALSE ); PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val, len, FALSE ); - dprintf_profile( stddeb, "PROFILE_GetString('%s','%s','%s'): returning '%s'\n", + dprintf_info(profile, "PROFILE_GetString('%s','%s','%s'): returning '%s'\n", section, key_name, def_val, buffer ); return strlen( buffer ); } @@ -524,7 +524,7 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name, { if (!key_name) /* Delete a whole section */ { - dprintf_profile(stddeb, "PROFILE_DeleteSection('%s')\n", section_name); + dprintf_info(profile, "PROFILE_DeleteSection('%s')\n", section_name); CurProfile.changed |= PROFILE_DeleteSection( &CurProfile.section, section_name ); return TRUE; /* Even if PROFILE_DeleteSection() has failed, @@ -532,7 +532,7 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name, } else if (!value) /* Delete a key */ { - dprintf_profile( stddeb, "PROFILE_DeleteKey('%s','%s')\n", + dprintf_info(profile, "PROFILE_DeleteKey('%s','%s')\n", section_name, key_name ); CurProfile.changed |= PROFILE_DeleteKey( &CurProfile.section, section_name, key_name ); @@ -542,20 +542,20 @@ static BOOL32 PROFILE_SetString( LPCSTR section_name, LPCSTR key_name, { PROFILEKEY *key = PROFILE_Find( &CurProfile.section, section_name, key_name, TRUE ); - dprintf_profile( stddeb, "PROFILE_SetString('%s','%s','%s'): ", + dprintf_info(profile, "PROFILE_SetString('%s','%s','%s'): \n", section_name, key_name, value ); if (!key) return FALSE; if (key->value) { if (!strcmp( key->value, value )) { - dprintf_profile( stddeb, "no change needed\n" ); + dprintf_info(profile, " no change needed\n" ); return TRUE; /* No change needed */ } - dprintf_profile( stddeb, "replacing '%s'\n", key->value ); + dprintf_info(profile, " replacing '%s'\n", key->value ); HeapFree( SystemHeap, 0, key->value ); } - else dprintf_profile( stddeb, "creating key\n" ); + else dprintf_info(profile, " creating key\n" ); key->value = HEAP_strdupA( SystemHeap, 0, value ); CurProfile.changed = TRUE; } @@ -576,7 +576,7 @@ int PROFILE_GetWineIniString( const char *section, const char *key_name, PROFILEKEY *key = PROFILE_Find(&WineProfile, section, key_name, FALSE); PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def, len, TRUE ); - dprintf_profile( stddeb, "PROFILE_GetWineIniString('%s','%s','%s'): returning '%s'\n", + dprintf_info(profile, "PROFILE_GetWineIniString('%s','%s','%s'): returning '%s'\n", section, key_name, def, buffer ); return strlen( buffer ); } @@ -707,7 +707,7 @@ int PROFILE_GetWineIniBool( retval = def; } - dprintf_profile(stddeb, "PROFILE_GetWineIniBool(\"%s\", \"%s\", %s), " + dprintf_info(profile, "PROFILE_GetWineIniBool(\"%s\", \"%s\", %s), " "[%c], ret %s.\n", section, key_name, def ? "TRUE" : "FALSE", key_value[0], retval ? "TRUE" : "FALSE"); @@ -1031,11 +1031,11 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section, { char *p =(char*)string; - fprintf( stdnimp,"WritePrivateProfileSection32A empty stup\n"); - if (debugging_profile) { - fprintf(stddeb,"file(%s) => [%s]\n", filename,section); + dprintf_fixme(profile, "WritePrivateProfileSection32A empty stup\n"); + if (debugging_info(profile)) { + dprintf_info(profile, "file(%s) => [%s]\n", filename, section); while (*(p+1)) { - fprintf(stddeb,"%s\n",p); + dprintf_info(profile, "%s\n", p); p += strlen(p); p += 1; } diff --git a/graphics/bitblt.c b/graphics/bitblt.c index 2356de8f150..f779dfdf6d5 100644 --- a/graphics/bitblt.c +++ b/graphics/bitblt.c @@ -5,7 +5,6 @@ */ #include "dc.h" -#include "stddebug.h" #include "debug.h" @@ -18,7 +17,7 @@ BOOL16 WINAPI PatBlt16( HDC16 hdc, INT16 left, INT16 top, DC * dc = DC_GetDCPtr( hdc ); if (!dc || !dc->funcs->pPatBlt) return FALSE; - dprintf_bitblt( stddeb, "PatBlt16: %04x %d,%d %dx%d %06lx\n", + dprintf_info(bitblt, "PatBlt16: %04x %d,%d %dx%d %06lx\n", hdc, left, top, width, height, rop ); return dc->funcs->pPatBlt( dc, left, top, width, height, rop ); } @@ -33,7 +32,7 @@ BOOL32 WINAPI PatBlt32( HDC32 hdc, INT32 left, INT32 top, DC * dc = DC_GetDCPtr( hdc ); if (!dc || !dc->funcs->pPatBlt) return FALSE; - dprintf_bitblt( stddeb, "PatBlt32: %04x %d,%d %dx%d %06lx\n", + dprintf_info(bitblt, "PatBlt32: %04x %d,%d %dx%d %06lx\n", hdc, left, top, width, height, rop ); return dc->funcs->pPatBlt( dc, left, top, width, height, rop ); } @@ -52,7 +51,7 @@ BOOL16 WINAPI BitBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, INT16 width, if (!dcDst->funcs->pBitBlt) return FALSE; dcSrc = DC_GetDCPtr( hdcSrc ); - dprintf_bitblt(stddeb, + dprintf_info(bitblt, "BitBlt16: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n", hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop); @@ -74,7 +73,7 @@ BOOL32 WINAPI BitBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst, INT32 width, if (!dcDst->funcs->pBitBlt) return FALSE; dcSrc = DC_GetDCPtr( hdcSrc ); - dprintf_bitblt(stddeb, + dprintf_info(bitblt, "BitBlt32: hdcSrc=%04x %d,%d %d bpp -> hdcDest=%04x %d,%d %dx%dx%d rop=%06lx\n", hdcSrc, xSrc, ySrc, dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst, width, height, dcDst->w.bitsPerPixel, rop); @@ -97,7 +96,7 @@ BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, if (!dcDst->funcs->pStretchBlt) return FALSE; dcSrc = DC_GetDCPtr( hdcSrc ); - dprintf_bitblt(stddeb, + dprintf_info(bitblt, "StretchBlt16: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n", hdcSrc, xSrc, ySrc, widthSrc, heightSrc, dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst, @@ -122,7 +121,7 @@ BOOL32 WINAPI StretchBlt32( HDC32 hdcDst, INT32 xDst, INT32 yDst, if (!dcDst->funcs->pStretchBlt) return FALSE; dcSrc = DC_GetDCPtr( hdcSrc ); - dprintf_bitblt(stddeb, + dprintf_info(bitblt, "StretchBlt32: %04x %d,%d %dx%dx%d -> %04x %d,%d %dx%dx%d rop=%06lx\n", hdcSrc, xSrc, ySrc, widthSrc, heightSrc, dcSrc ? dcSrc->w.bitsPerPixel : 0, hdcDst, xDst, yDst, diff --git a/graphics/ddraw.c b/graphics/ddraw.c index ce417f756bb..3b13507a3e3 100644 --- a/graphics/ddraw.c +++ b/graphics/ddraw.c @@ -1,4 +1,4 @@ -/* DirectDraw +/* DirectDraw using DGA * * Copyright 1997,1998 Marcus Meissner */ @@ -14,7 +14,8 @@ /* Progress on following programs: * * - Diablo [640x480x8]: - * The movies play. The game doesn't work yet. + * The movies play. The game doesn't work, it somehow tries to write + * into 2 lines _BEFORE_ the start of the surface. Don't know why. * * - WingCommander 4 / Win95 Patch [640x480x8]: * The intromovie plays, in 8 bit mode (to reconfigure wc4, run wine @@ -22,22 +23,26 @@ * my Matrox Mystique which uses 565 (rgb) colorweight instead of the usual * 555. Specifying it in DDPIXELFORMAT didn't help. * Requires to be run in 640x480xdepth mode (doesn't seem to heed - * DDSURFACEDESC.lPitch). + * DDSURFACEDESC.lPitch). You can fly the first mission with Maniac, but + * it crashes as soon as you arrive at Blue Point Station... * * - Monkey Island 3 [640x480x8]: - * Goes to the easy/hard selection screen, then hangs due to not MT safe - * XLibs. + * Goes to the easy/hard selection screen, then hangs due to MT problems. * * - DiscWorld 2 [640x480x8]: - * Plays through nearly all intro movies. Sound and animation a bit broken. + * [Crashes with 'cli' in released version. Yes. Privileged instructions + * in 32bit code. Will they ever learn...] + * Plays through nearly all intro movies. Sound and animation skip a lot of + * stuff (possible DirectSound problem). * * - XvT [640x480x16]: * Shows the splash screen, then fails with missing Joystick. * * - Tomb Raider 2 Demo (using 8 bit renderer) [640x480x8]: - * Shows selection screen, but keyboard input doesn't work. + * Playable. Sound is weird. * * - WingCommander Prophecy Demo (using software renderer) [640x480x16]: + * [Crashes with an invalid opcode (outb) in the release version.] * Plays intromovie, hangs in selection screen (no keyboard input, probably * DirectInput problem). */ @@ -58,10 +63,8 @@ #include "dc.h" #include "win.h" #include "miscemu.h" -#include "mmsystem.h" #include "ddraw.h" #include "d3d.h" -#include "stddebug.h" #include "debug.h" #ifdef HAVE_LIBXXF86DGA @@ -301,15 +304,16 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) { int nitems; if (!vi) - vi = XGetVisualInfo(display,VisualNoMask,&vt,&nitems); + vi = TSXGetVisualInfo(display,VisualNoMask,&vt,&nitems); - pf->dwFourCC = mmioFOURCC('R','G','B',' '); + pf->dwFourCC = 0; if (ddraw->d.depth==8) { pf->dwFlags = DDPF_RGB|DDPF_PALETTEINDEXED8; pf->x.dwRGBBitCount = 8; pf->y.dwRBitMask = 0; pf->z.dwGBitMask = 0; pf->xx.dwBBitMask = 0; + pf->xy.dwRGBAlphaBitMask= 0; return 0; } if (ddraw->d.depth==16) { @@ -318,6 +322,7 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) { pf->y.dwRBitMask = vi[0].red_mask; pf->z.dwGBitMask = vi[0].green_mask; pf->xx.dwBBitMask = vi[0].blue_mask; + pf->xy.dwRGBAlphaBitMask= 0; return 0; } fprintf(stderr,"_getpixelformat:oops?\n"); @@ -331,22 +336,22 @@ static int _getpixelformat(LPDIRECTDRAW ddraw,LPDDPIXELFORMAT pf) { static HRESULT WINAPI IDirectDrawSurface_Lock( LPDIRECTDRAWSURFACE this,LPRECT32 lprect,LPDDSURFACEDESC lpddsd,DWORD flags, HANDLE32 hnd ) { - if (debugging_ddraw || (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY))) - fprintf(stderr,"IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n", - this,lprect,lpddsd,flags,(DWORD)hnd - ); + dprintf_info(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n", + this,lprect,lpddsd,flags,(DWORD)hnd); + if (flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY)) + dprintf_warn(ddraw, "IDirectDrawSurface(%p)->Lock(%p,%p,%08lx,%08lx)\n", + this,lprect,lpddsd,flags,(DWORD)hnd); if (lprect) { - /* - fprintf(stderr," lprect: %dx%d-%dx%d\n", + dprintf_info(ddraw," lprect: %dx%d-%dx%d\n", lprect->top,lprect->left,lprect->bottom,lprect->right ); - */ lpddsd->y.lpSurface = this->s.surface+ (lprect->top*this->s.lpitch)+ (lprect->left*(this->s.ddraw->d.depth/8)); } else lpddsd->y.lpSurface = this->s.surface; + lpddsd->dwFlags = DDSD_WIDTH|DDSD_HEIGHT|DDSD_PIXELFORMAT|DDSD_PITCH|DDSD_LPSURFACE; lpddsd->dwWidth = this->s.width; lpddsd->dwHeight = this->s.height; lpddsd->lPitch = this->s.lpitch; @@ -357,14 +362,14 @@ static HRESULT WINAPI IDirectDrawSurface_Lock( static HRESULT WINAPI IDirectDrawSurface_Unlock( LPDIRECTDRAWSURFACE this,LPVOID surface ) { - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->Unlock(%p)\n",this,surface); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->Unlock(%p)\n",this,surface); return 0; } static HRESULT WINAPI IDirectDrawSurface_Flip( LPDIRECTDRAWSURFACE this,LPDIRECTDRAWSURFACE flipto,DWORD dwFlags ) { - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags); if (!flipto) { if (this->s.backbuffer) flipto = this->s.backbuffer; @@ -394,7 +399,7 @@ static HRESULT WINAPI IDirectDrawSurface_Flip( static HRESULT WINAPI IDirectDrawSurface_SetPalette( LPDIRECTDRAWSURFACE this,LPDIRECTDRAWPALETTE pal ) { - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->SetPalette(%p)\n",this,pal); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->SetPalette(%p)\n",this,pal); this->s.palette = pal; /* probably addref it too */ return 0; } @@ -470,11 +475,13 @@ static HRESULT WINAPI IDirectDrawSurface_BltFast( LPDIRECTDRAWSURFACE this,DWORD dstx,DWORD dsty,LPDIRECTDRAWSURFACE src,LPRECT32 rsrc,DWORD trans ) { int i,bpp; - fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n", - this,dstx,dsty,src,rsrc,trans - ); - fprintf(stderr," trans:");_dump_DDBLTFAST(trans);fprintf(stderr,"\n"); - fprintf(stderr," srcrect: %dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom); + if (debugging_info(ddraw)) { + fprintf(stderr,"IDirectDrawSurface(%p)->BltFast(%ld,%ld,%p,%p,%08lx),stub!\n", + this,dstx,dsty,src,rsrc,trans + ); + fprintf(stderr," trans:");_dump_DDBLTFAST(trans);fprintf(stderr,"\n"); + fprintf(stderr," srcrect: %dx%d-%dx%d\n",rsrc->left,rsrc->top,rsrc->right,rsrc->bottom); + } bpp = this->s.ddraw->d.depth/8; for (i=0;ibottom-rsrc->top;i++) { memcpy( this->s.surface+((i+dsty)*this->s.width*bpp)+dstx*bpp, @@ -497,7 +504,7 @@ static HRESULT WINAPI IDirectDrawSurface_BltBatch( static HRESULT WINAPI IDirectDrawSurface_GetCaps( LPDIRECTDRAWSURFACE this,LPDDSCAPS caps ) { - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->GetCaps(%p)\n",this,caps); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->GetCaps(%p)\n",this,caps); caps->dwCaps = DDCAPS_PALETTE; /* probably more */ return 0; } @@ -505,8 +512,9 @@ static HRESULT WINAPI IDirectDrawSurface_GetCaps( static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc( LPDIRECTDRAWSURFACE this,LPDDSURFACEDESC ddsd ) { - if (debugging_ddraw) { - fprintf(stderr,"IDirectDrawSurface(%p)->GetSurfaceDesc(%p)\n",this,ddsd); + if (debugging_info(ddraw)) { + dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetSurfaceDesc(%p)\n", + this,ddsd); fprintf(stderr," flags: "); _dump_DDSD(ddsd->dwFlags); fprintf(stderr,"\n"); @@ -526,16 +534,20 @@ static HRESULT WINAPI IDirectDrawSurface_GetSurfaceDesc( } static ULONG WINAPI IDirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE this) { - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->AddRef()\n",this); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->AddRef()\n",this); return ++(this->ref); } static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) { - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->Release()\n",this); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->Release()\n",this); if (!--(this->ref)) { this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw); /* clear out of surface list */ - this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height)); + if (this->s.fb_height == -1) { + HeapFree(GetProcessHeap(),0,this->s.surface); + } else { + this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height)); + } HeapFree(GetProcessHeap(),0,this); return 0; } @@ -545,9 +557,12 @@ static ULONG WINAPI IDirectDrawSurface_Release(LPDIRECTDRAWSURFACE this) { static HRESULT WINAPI IDirectDrawSurface_GetAttachedSurface( LPDIRECTDRAWSURFACE this,LPDDSCAPS lpddsd,LPDIRECTDRAWSURFACE *lpdsf ) { - if (debugging_ddraw) { - fprintf(stderr,"IDirectDrawSurface(%p)->GetAttachedSurface(%p,%p)\n",this,lpddsd,lpdsf); - fprintf(stderr," caps ");_dump_DDSCAPS(lpddsd->dwCaps);fprintf(stderr,"\n"); + dprintf_info(ddraw, "IDirectDrawSurface(%p)->GetAttachedSurface(%p,%p)\n", + this, lpddsd, lpdsf); + if (debugging_info(ddraw)) { + fprintf(stderr," caps "); + _dump_DDSCAPS(lpddsd->dwCaps); + fprintf(stderr,"\n"); } if (!(lpddsd->dwCaps & DDSCAPS_BACKBUFFER)) { fprintf(stderr,"IDirectDrawSurface::GetAttachedSurface():whoops, can only handle backbuffers for now\n"); @@ -609,8 +624,8 @@ static HRESULT WINAPI IDirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE this,HDC32* l static HRESULT WINAPI IDirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE this,REFIID refiid,LPVOID *obj) { char xrefiid[50]; - StringFromCLSID((LPCLSID)refiid,xrefiid); - dprintf_ddraw(stderr,"IDirectDrawSurface(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(ddraw,"IDirectDrawSurface(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); /* thats version 3 (DirectX 5) */ if ( !memcmp(&IID_IDirectDrawSurface3,refiid,sizeof(IID_IDirectDrawSurface3))) { @@ -693,7 +708,7 @@ static HRESULT WINAPI IDirectDrawSurface2_Lock( static HRESULT WINAPI IDirectDrawSurface2_Unlock( LPDIRECTDRAWSURFACE2 this,LPVOID surface ) { - dprintf_ddraw(stderr,"IDirectDrawSurface2(%p)->Unlock(%p)\n",this,surface); + dprintf_info(ddraw,"IDirectDrawSurface2(%p)->Unlock(%p)\n",this,surface); return 0; } @@ -704,19 +719,12 @@ static HRESULT WINAPI IDirectDrawSurface2_SetPalette( } static ULONG WINAPI IDirectDrawSurface2_AddRef(LPDIRECTDRAWSURFACE2 this) { - dprintf_ddraw(stderr,"IDirectDrawSurface2(%p)->AddRef()\n",this); + dprintf_info(ddraw,"IDirectDrawSurface2(%p)->AddRef()\n",this); return ++(this->ref); } static ULONG WINAPI IDirectDrawSurface2_Release(LPDIRECTDRAWSURFACE2 this) { - dprintf_ddraw(stderr,"IDirectDrawSurface2(%p)->Release()\n",this); - if (!--(this->ref)) { - this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw); - this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height)); - HeapFree(GetProcessHeap(),0,this); - return 0; - } - return this->ref; + return IDirectDrawSurface_Release((LPDIRECTDRAWSURFACE)this); } static HRESULT WINAPI IDirectDrawSurface2_GetAttachedSurface( @@ -813,12 +821,12 @@ static HRESULT WINAPI IDirectDrawSurface3_GetAttachedSurface( } static ULONG WINAPI IDirectDrawSurface3_AddRef(LPDIRECTDRAWSURFACE3 this) { - dprintf_ddraw(stderr,"IDirectDrawSurface3(%p)->AddRef()\n",this); + dprintf_info(ddraw,"IDirectDrawSurface3(%p)->AddRef()\n",this); return ++(this->ref); } static ULONG WINAPI IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) { - dprintf_ddraw(stderr,"IDirectDrawSurface3(%p)->Release()\n",this); + dprintf_info(ddraw,"IDirectDrawSurface3(%p)->Release()\n",this); if (!--(this->ref)) { this->s.ddraw->lpvtbl->fnRelease(this->s.ddraw); this->s.ddraw->d.vpmask &= ~(1<<(this->s.fb_height/this->s.ddraw->d.fb_height)); @@ -962,11 +970,18 @@ static struct IDirectDrawClipper_VTable ddclipvt = { * IDirectDrawPalette */ static HRESULT WINAPI IDirectDrawPalette_GetEntries( - LPDIRECTDRAWPALETTE this,DWORD x,DWORD y,DWORD z,LPPALETTEENTRY palent + LPDIRECTDRAWPALETTE this,DWORD x,DWORD start,DWORD end,LPPALETTEENTRY palent ) { - fprintf(stderr,"IDirectDrawPalette(%p)->GetEntries(%08lx,%08lx,%08lx,%p),stub!\n", - this,x,y,z,palent + int i; + + fprintf(stderr,"IDirectDrawPalette(%p)->GetEntries(%08lx,%ld,%ld,%p),stub!\n", + this,x,start,end,palent ); + for (i=start;iSetEntries(%08lx,%ld,%ld,%p)\n", + dprintf_info(ddraw,"IDirectDrawPalette(%p)->SetEntries(%08lx,%ld,%ld,%p)\n", this,x,start,end,palent ); if (!this->cm) /* should not happen */ { @@ -984,13 +999,19 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries( return DDERR_GENERIC; } /* FIXME: free colorcells instead of freeing whole map */ - XFreeColormap(display,this->cm); + TSXFreeColormap(display,this->cm); this->cm = TSXCreateColormap(display,DefaultRootWindow(display),DefaultVisualOfScreen(screen),AllocAll); if (start>0) { xc.red = xc.blue = xc.green = 0; xc.flags = DoRed|DoGreen|DoBlue; xc.pixel = 0; TSXStoreColor(display,this->cm,&xc); + this->palents[0].peRed = 0; + this->palents[0].peBlue = 0; + this->palents[0].peGreen = 0; } if (end<256) { xc.red = xc.blue = xc.green = 0xffff; xc.flags = DoRed|DoGreen|DoBlue; xc.pixel = 255; TSXStoreColor(display,this->cm,&xc); + this->palents[255].peRed = 255; + this->palents[255].peBlue = 255; + this->palents[255].peGreen = 255; } for (i=start;icm,&xc); + this->palents[i].peRed = palent[i-start].peRed; + this->palents[i].peBlue = palent[i-start].peBlue; + this->palents[i].peGreen = palent[i-start].peGreen; } XF86DGAInstallColormap(display,DefaultScreen(display),this->cm); return 0; @@ -1007,7 +1031,7 @@ static HRESULT WINAPI IDirectDrawPalette_SetEntries( static ULONG WINAPI IDirectDrawPalette_Release(LPDIRECTDRAWPALETTE this) { if (!--(this->ref)) { if (this->cm) { - XFreeColormap(display,this->cm); + TSXFreeColormap(display,this->cm); this->cm = 0; } HeapFree(GetProcessHeap(),0,this); @@ -1099,9 +1123,10 @@ static HRESULT WINAPI IDirectDraw_CreateSurface( ) { int i; - if (debugging_ddraw) { - fprintf(stderr,"IDirectDraw(%p)->CreateSurface(%p,%p,%p)\n",this,lpddsd,lpdsf,lpunk); - fprintf(stderr," [w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight); + dprintf_info(ddraw, "IDirectDraw(%p)->CreateSurface(%p,%p,%p)\n", + this,lpddsd,lpdsf,lpunk); + if (debugging_info(ddraw)) { + fprintf(stderr,"[w=%ld,h=%ld,flags ",lpddsd->dwWidth,lpddsd->dwHeight); _dump_DDSD(lpddsd->dwFlags); fprintf(stderr,"caps "); _dump_DDSCAPS(lpddsd->ddsCaps.dwCaps); @@ -1112,19 +1137,34 @@ static HRESULT WINAPI IDirectDraw_CreateSurface( this->lpvtbl->fnAddRef(this); (*lpdsf)->ref = 1; (*lpdsf)->lpvtbl = &ddsvt; - for (i=0;i<32;i++) - if (!(this->d.vpmask & (1<d.vpmask|=(1<s.surface = this->d.fb_addr+((i*this->d.vp_height)*this->d.fb_width*this->d.depth/8); - (*lpdsf)->s.fb_height = i*this->d.fb_height; + if ( (lpddsd->dwFlags & DDSD_CAPS) && + (lpddsd->ddsCaps.dwCaps & DDSCAPS_OFFSCREENPLAIN) + ) { + if (!(lpddsd->dwFlags & DDSD_WIDTH)) + lpddsd->dwWidth = this->d.fb_width; + if (!(lpddsd->dwFlags & DDSD_HEIGHT)) + lpddsd->dwWidth = this->d.fb_height; + (*lpdsf)->s.surface = (LPBYTE)HeapAlloc(GetProcessHeap(),0,lpddsd->dwWidth*lpddsd->dwHeight*this->d.depth/8); + (*lpdsf)->s.fb_height = -1; + (*lpdsf)->s.lpitch = lpddsd->dwWidth*this->d.depth/8; + dprintf_info(ddraw,"using system memory for a primary surface\n"); + } else { + for (i=0;i<32;i++) + if (!(this->d.vpmask & (1<d.vpmask|=(1<s.surface = this->d.fb_addr+((i*this->d.fb_height)*this->d.fb_width*this->d.depth/8); + (*lpdsf)->s.fb_height = i*this->d.fb_height; + (*lpdsf)->s.lpitch = this->d.fb_width*this->d.depth/8; + } + + lpddsd->lPitch = (*lpdsf)->s.lpitch; (*lpdsf)->s.width = this->d.width; (*lpdsf)->s.height = this->d.height; (*lpdsf)->s.ddraw = this; - (*lpdsf)->s.lpitch = this->d.fb_width*this->d.depth/8; (*lpdsf)->s.backbuffer = NULL; if (lpddsd->dwFlags & DDSD_BACKBUFFERCOUNT) { LPDIRECTDRAWSURFACE back; @@ -1139,10 +1179,10 @@ static HRESULT WINAPI IDirectDraw_CreateSurface( for (i=0;i<32;i++) if (!(this->d.vpmask & (1<d.vpmask|=(1<s.surface = this->d.fb_addr+((i*this->d.vp_height)*this->d.fb_width*this->d.depth/8); + back->s.surface = this->d.fb_addr+((i*this->d.fb_height)*this->d.fb_width*this->d.depth/8); back->s.fb_height = i*this->d.fb_height; back->s.width = this->d.width; @@ -1182,14 +1222,16 @@ static HRESULT WINAPI IDirectDraw_SetCooperativeLevel( FE(DDSCL_CREATEDEVICEWINDOW) }; - dprintf_ddraw(stderr,"IDirectDraw(%p)->SetCooperativeLevel(%08lx,%08lx)\n", + dprintf_info(ddraw,"IDirectDraw(%p)->SetCooperativeLevel(%08lx,%08lx)\n", this,(DWORD)hwnd,cooplevel ); - dprintf_ddraw(stderr," cooperative level "); - for (i=0;id.mainwindow = hwnd; return 0; } @@ -1201,7 +1243,8 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode( int i,*depths,depcount; char buf[200]; - dprintf_ddraw(stderr,"IDirectDraw(%p)->SetDisplayMode(%ld,%ld,%ld),stub!\n",this,width,height,depth); + dprintf_fixme(ddraw, "IDirectDraw(%p)->SetDisplayMode(%ld,%ld,%ld),stub!\n", + this, width, height, depth); depths = TSXListDepths(display,DefaultScreen(display),&depcount); for (i=0;id.fb_height); #ifdef RESTORE_SIGNALS SIGNAL_InitEmulator(); #endif @@ -1239,7 +1283,7 @@ static HRESULT WINAPI IDirectDraw_SetDisplayMode( static HRESULT WINAPI IDirectDraw_GetCaps( LPDIRECTDRAW this,LPDDCAPS caps1,LPDDCAPS caps2 ) { - dprintf_ddraw(stderr,"IDirectDraw(%p)->GetCaps(%p,%p)\n",this,caps1,caps2); + dprintf_info(ddraw,"IDirectDraw(%p)->GetCaps(%p,%p)\n",this,caps1,caps2); caps1->dwVidMemTotal = this->d.fb_memsize; caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED); /* we can do anything */ caps1->ddsCaps.dwCaps = 0xffffffff; /* we can do anything */ @@ -1266,7 +1310,7 @@ static HRESULT WINAPI IDirectDraw_CreateClipper( static HRESULT WINAPI IDirectDraw_CreatePalette( LPDIRECTDRAW this,DWORD x,LPPALETTEENTRY palent,LPDIRECTDRAWPALETTE *lpddpal,LPUNKNOWN lpunk ) { - dprintf_ddraw(stderr,"IDirectDraw(%p)->CreatePalette(%08lx,%p,%p,%p)\n", + dprintf_info(ddraw,"IDirectDraw(%p)->CreatePalette(%08lx,%p,%p,%p)\n", this,x,palent,lpddpal,lpunk ); *lpddpal = (LPDIRECTDRAWPALETTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawPalette)); @@ -1282,7 +1326,8 @@ static HRESULT WINAPI IDirectDraw_CreatePalette( } static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) { - dprintf_ddraw(stderr,"IDirectDraw(%p)->RestoreDisplayMode(),stub!\n",this); + dprintf_fixme(ddraw, "IDirectDraw(%p)->RestoreDisplayMode(),stub!\n", + this); Sleep(1000); XF86DGADirectVideo(display,DefaultScreen(display),0); #ifdef RESTORE_SIGNALS @@ -1295,7 +1340,7 @@ static HRESULT WINAPI IDirectDraw_RestoreDisplayMode(LPDIRECTDRAW this) { static HRESULT WINAPI IDirectDraw_WaitForVerticalBlank( LPDIRECTDRAW this,DWORD x,HANDLE32 h ) { - fprintf(stderr,"IDirectDraw(%p)->WaitForVerticalBlank(0x%08lx,0x%08x),stub!\n",this,x,h); + dprintf_info(ddraw,"IDirectDraw(%p)->WaitForVerticalBlank(0x%08lx,0x%08x),stub!\n",this,x,h); return 0; } @@ -1320,8 +1365,8 @@ static HRESULT WINAPI IDirectDraw_QueryInterface( ) { char xrefiid[50]; - StringFromCLSID((LPCLSID)refiid,xrefiid); - dprintf_ddraw(stderr,"IDirectDraw(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(ddraw,"IDirectDraw(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { *obj = this; this->lpvtbl->fnAddRef(this); @@ -1367,7 +1412,7 @@ static HRESULT WINAPI IDirectDraw_QueryInterface( static HRESULT WINAPI IDirectDraw_GetVerticalBlankStatus( LPDIRECTDRAW this,BOOL32 *status ) { - fprintf(stderr,"IDirectDraw(%p)->GetVerticalBlankSatus(%p)\n",this,status); + dprintf_info(ddraw,"IDirectDraw(%p)->GetVerticalBlankSatus(%p)\n",this,status); *status = TRUE; return 0; } @@ -1377,7 +1422,7 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes( ) { DDSURFACEDESC ddsfd; - dprintf_ddraw(stderr,"IDirectDraw(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb); + dprintf_info(ddraw,"IDirectDraw(%p)->EnumDisplayModes(0x%08lx,%p,%p,%p)\n",this,dwFlags,lpddsfd,context,modescb); _getpixelformat(this,&(ddsfd.ddpfPixelFormat)); @@ -1412,10 +1457,10 @@ static HRESULT WINAPI IDirectDraw_EnumDisplayModes( static HRESULT WINAPI IDirectDraw_GetDisplayMode( LPDIRECTDRAW this,LPDDSURFACEDESC lpddsfd ) { - dprintf_ddraw(stderr,"IDirectDraw(%p)->GetDisplayMode(%p)\n",this,lpddsfd); + dprintf_info(ddraw,"IDirectDraw(%p)->GetDisplayMode(%p)\n",this,lpddsfd); lpddsfd->dwFlags = DDSD_HEIGHT|DDSD_WIDTH|DDSD_PITCH|DDSD_BACKBUFFERCOUNT|DDSD_PIXELFORMAT|DDSD_CAPS; - lpddsfd->dwHeight = this->d.vp_height; - lpddsfd->dwWidth = this->d.vp_width; + lpddsfd->dwHeight = screenHeight; + lpddsfd->dwWidth = screenWidth; lpddsfd->lPitch = this->d.fb_width*this->d.depth/8; lpddsfd->dwBackBufferCount = 1; lpddsfd->x.dwRefreshRate = 60; @@ -1429,6 +1474,13 @@ static HRESULT WINAPI IDirectDraw_FlipToGDISurface(LPDIRECTDRAW this) { return DD_OK; } +static HRESULT WINAPI IDirectDraw_GetMonitorFrequency( + LPDIRECTDRAW this,LPDWORD freq +) { + fprintf(stderr,"IDirectDraw(%p)->GetMonitorFrequency(%p)\n",this,freq); + *freq = 60*100; /* 60 Hz */ + return 0; +} static IDirectDraw_VTable ddvt = { IDirectDraw_QueryInterface, @@ -1446,7 +1498,7 @@ static IDirectDraw_VTable ddvt = { IDirectDraw_GetDisplayMode, (void*)14, (void*)15, - (void*)16, + IDirectDraw_GetMonitorFrequency, (void*)17, IDirectDraw_GetVerticalBlankStatus, (void*)19, @@ -1508,7 +1560,8 @@ static HRESULT WINAPI IDirectDraw2_CreatePalette( static HRESULT WINAPI IDirectDraw2_SetDisplayMode( LPDIRECTDRAW2 this,DWORD width,DWORD height,DWORD depth,DWORD xx,DWORD yy ) { - dprintf_ddraw(stderr,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx),stub!\n",this,width,height,depth,xx,yy); + dprintf_fixme(ddraw,"IDirectDraw2(%p)->SetDisplayMode(%ld,%ld,%ld,%08lx,%08lx),stub!\n", + this, width, height, depth, xx, yy); return IDirectDraw_SetDisplayMode((LPDIRECTDRAW)this,width,height,depth); } @@ -1539,7 +1592,7 @@ static HRESULT WINAPI IDirectDraw2_GetDisplayMode( static HRESULT WINAPI IDirectDraw2_GetAvailableVidMem( LPDIRECTDRAW2 this,LPDDSCAPS ddscaps,LPDWORD total,LPDWORD free ) { - fprintf(stderr,"IDirectDraw2(%p)->GetAvailableVidMem(%p,%p,%p),stub!\n", + fprintf(stderr,"IDirectDraw2(%p)->GetAvailableVidMem(%p,%p,%p)\n", this,ddscaps,total,free ); if (total) *total = this->d.fb_memsize * 1024; @@ -1550,9 +1603,19 @@ static HRESULT WINAPI IDirectDraw2_GetAvailableVidMem( static HRESULT WINAPI IDirectDraw2_GetMonitorFrequency( LPDIRECTDRAW2 this,LPDWORD freq ) { - fprintf(stderr,"IDirectDraw2(%p)->GetMonitorFrequency(%p)\n",this,freq); - *freq = 60; - return 0; + return IDirectDraw_GetMonitorFrequency((LPDIRECTDRAW)this,freq); +} + +static HRESULT WINAPI IDirectDraw2_GetVerticalBlankStatus( + LPDIRECTDRAW2 this,BOOL32 *status +) { + return IDirectDraw_GetVerticalBlankStatus((LPDIRECTDRAW)this,status); +} + +static HRESULT WINAPI IDirectDraw2_WaitForVerticalBlank( + LPDIRECTDRAW2 this,DWORD x,HANDLE32 h +) { + return IDirectDraw_WaitForVerticalBlank((LPDIRECTDRAW)this,x,h); } static IDirectDraw2_VTable dd2vt = { @@ -1573,12 +1636,12 @@ static IDirectDraw2_VTable dd2vt = { (void*)15, IDirectDraw2_GetMonitorFrequency, (void*)17, - (void*)18, + IDirectDraw2_GetVerticalBlankStatus, (void*)19, IDirectDraw2_RestoreDisplayMode, IDirectDraw2_SetCooperativeLevel, IDirectDraw2_SetDisplayMode, - (void*)23/*IDirectDraw_WaitForVerticalBlank*/, + IDirectDraw2_WaitForVerticalBlank, IDirectDraw2_GetAvailableVidMem }; @@ -1594,11 +1657,11 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN char *addr; if (lpGUID) - StringFromCLSID(lpGUID,xclsid); + WINE_StringFromCLSID(lpGUID,xclsid); else strcpy(xclsid,""); - dprintf_ddraw(stderr,"DirectDrawCreate(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter); + dprintf_info(ddraw,"DirectDrawCreate(%s,%p,%p)\n",xclsid,lplpDD,pUnkOuter); if (getuid()) { MessageBox32A(0,"Using the XF86DGA extension requires the program to be run using UID 0.","WINE DirectDraw",MB_OK|MB_ICONSTOP); return E_UNEXPECTED; @@ -1611,12 +1674,12 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN return 0; } XF86DGAQueryVersion(display,&major,&minor); - dprintf_ddraw(stderr,"XF86DGA is version %d.%d\n",major,minor); + dprintf_info(ddraw,"XF86DGA is version %d.%d\n",major,minor); XF86DGAQueryDirectVideo(display,DefaultScreen(display),&flags); if (!(flags & XF86DGADirectPresent)) fprintf(stderr,"direct video is NOT ENABLED.\n"); XF86DGAGetVideo(display,DefaultScreen(display),&addr,&width,&banksize,&memsize); - dprintf_ddraw(stderr,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n", + dprintf_info(ddraw,"video framebuffer: begin %p, width %d,banksize %d,memsize %d\n", addr,width,banksize,memsize ); (*lplpDD)->d.fb_width = width; @@ -1624,12 +1687,12 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN (*lplpDD)->d.fb_memsize = memsize; (*lplpDD)->d.fb_banksize = banksize; - XF86DGASetViewPort(display,DefaultScreen(display),0,0); XF86DGAGetViewPortSize(display,DefaultScreen(display),&width,&height); + XF86DGASetViewPort(display,DefaultScreen(display),0,0); (*lplpDD)->d.vp_width = width; (*lplpDD)->d.vp_height = height; - (*lplpDD)->d.fb_height = height; - (*lplpDD)->d.vpmask = 0; + (*lplpDD)->d.fb_height = screenHeight; + (*lplpDD)->d.vpmask = 1; /* just assume the default depth is the DGA depth too */ (*lplpDD)->d.depth = DefaultDepthOfScreen(screen); diff --git a/graphics/env.c b/graphics/env.c index 9e284d7b8d6..13aa37f79e8 100644 --- a/graphics/env.c +++ b/graphics/env.c @@ -9,7 +9,6 @@ #include "windows.h" #include "gdi.h" #include "debug.h" -#include "stddebug.h" /*********************************************************************** * GetEnvironment (GDI.134) diff --git a/graphics/mapping.c b/graphics/mapping.c index b810a23c296..8ad198d9467 100644 --- a/graphics/mapping.c +++ b/graphics/mapping.c @@ -6,7 +6,6 @@ #include #include "dc.h" -#include "stddebug.h" #include "debug.h" @@ -164,7 +163,7 @@ INT32 WINAPI SetMapMode32( HDC32 hdc, INT32 mode ) if (!dc) return 0; if (dc->funcs->pSetMapMode) return dc->funcs->pSetMapMode( dc, mode ); - dprintf_gdi(stddeb, "SetMapMode: %04x %d\n", hdc, mode ); + dprintf_info(gdi, "SetMapMode: %04x %d\n", hdc, mode ); prevMode = dc->w.MapMode; switch(mode) diff --git a/graphics/metafiledrv/graphics.c b/graphics/metafiledrv/graphics.c index 1647a66dd62..f6615fff1b1 100644 --- a/graphics/metafiledrv/graphics.c +++ b/graphics/metafiledrv/graphics.c @@ -12,7 +12,6 @@ #include "region.h" #include "xmalloc.h" #include "metafiledrv.h" -#include "stddebug.h" #include "debug.h" /********************************************************************** diff --git a/graphics/metafiledrv/init.c b/graphics/metafiledrv/init.c index 58587f04df0..9d232bcc227 100644 --- a/graphics/metafiledrv/init.c +++ b/graphics/metafiledrv/init.c @@ -9,7 +9,6 @@ #include "heap.h" #include "global.h" #include "metafile.h" -#include "stddebug.h" #include "debug.h" static const DC_FUNCTIONS MFDRV_Funcs = @@ -151,7 +150,7 @@ HDC16 WINAPI CreateMetaFile16( METAFILEDRV_PDEVICE *physDev; HFILE32 hFile; - dprintf_metafile( stddeb, "CreateMetaFile16: '%s'\n", filename ); + dprintf_info(metafile, "CreateMetaFile16: '%s'\n", filename ); if (!(dc = MFDRV_AllocMetaFile())) return 0; physDev = (METAFILEDRV_PDEVICE *)dc->physDev; @@ -176,7 +175,7 @@ HDC16 WINAPI CreateMetaFile16( else /* memory based metafile */ physDev->mh->mtType = METAFILE_MEMORY; - dprintf_metafile( stddeb, "CreateMetaFile16: returning %04x\n", dc->hSelf); + dprintf_info(metafile, "CreateMetaFile16: returning %04x\n", dc->hSelf); return dc->hSelf; } @@ -199,7 +198,7 @@ HMETAFILE16 WINAPI CloseMetaFile16( HFILE32 hFile; METAFILEDRV_PDEVICE *physDev; - dprintf_metafile( stddeb, "CloseMetaFile(%04x)\n", hdc ); + dprintf_info(metafile, "CloseMetaFile(%04x)\n", hdc ); if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0; physDev = (METAFILEDRV_PDEVICE *)dc->physDev; diff --git a/graphics/metafiledrv/objects.c b/graphics/metafiledrv/objects.c index dcb096d41c2..de8bbc6e92a 100644 --- a/graphics/metafiledrv/objects.c +++ b/graphics/metafiledrv/objects.c @@ -12,7 +12,6 @@ #include "metafile.h" #include "metafiledrv.h" #include "pen.h" -#include "stddebug.h" #include "debug.h" @@ -86,7 +85,7 @@ HGDIOBJ32 MFDRV_SelectObject( DC *dc, HGDIOBJ32 handle ) HGDIOBJ32 ret = 0; if (!ptr) return 0; - dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); + dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); switch(ptr->wMagic) { diff --git a/graphics/metafiledrv/text.c b/graphics/metafiledrv/text.c index c4caf1e921e..1a8617a2f69 100644 --- a/graphics/metafiledrv/text.c +++ b/graphics/metafiledrv/text.c @@ -13,7 +13,6 @@ #include "heap.h" #include "metafile.h" #include "metafiledrv.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" diff --git a/graphics/painting.c b/graphics/painting.c index 6756c43552a..2511ec409a5 100644 --- a/graphics/painting.c +++ b/graphics/painting.c @@ -24,7 +24,6 @@ #include "color.h" #include "region.h" #include "path.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** diff --git a/graphics/win16drv/brush.c b/graphics/win16drv/brush.c index 305cde50943..7f397debab5 100644 --- a/graphics/win16drv/brush.c +++ b/graphics/win16drv/brush.c @@ -8,7 +8,6 @@ #include "brush.h" #include "win16drv.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, @@ -26,7 +25,7 @@ HBRUSH32 WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, if ( physDev->BrushInfo ) { - dprintf_win16drv(stddeb, "UnRealizing BrushInfo\n"); + dprintf_info(win16drv, "UnRealizing BrushInfo\n"); nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH, physDev->BrushInfo, physDev->BrushInfo, 0); diff --git a/graphics/win16drv/font.c b/graphics/win16drv/font.c index a669f4c2c88..f0c8dce311a 100644 --- a/graphics/win16drv/font.c +++ b/graphics/win16drv/font.c @@ -12,7 +12,6 @@ #include "module.h" #include "font.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" @@ -25,7 +24,7 @@ BOOL32 WIN16DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count, WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev; DWORD dwRet; - dprintf_win16drv(stddeb, "WIN16DRV_GetTextExtPoint: %04x %s %d %p\n", + dprintf_info(win16drv, "WIN16DRV_GetTextExtPoint: %04x %s %d %p\n", dc->hSelf, str, count, size); dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0, @@ -35,7 +34,7 @@ BOOL32 WIN16DRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count, win16drv_SegPtr_TextXForm, NULL, NULL, 0); size->cx = XDSTOLS(dc,LOWORD(dwRet)); size->cy = YDSTOLS(dc,HIWORD(dwRet)); - dprintf_win16drv(stddeb, "WIN16DRV_GetTextExtPoint: cx=0x%x, cy=0x%x\n", + dprintf_info(win16drv, "WIN16DRV_GetTextExtPoint: cx=0x%x, cy=0x%x\n", size->cx, size->cy ); return TRUE; } @@ -48,11 +47,11 @@ BOOL32 WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics ) { WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev; - dprintf_win16drv(stddeb, "WIN16DRV_GetTextMetrics: %04x \n", dc->hSelf); + dprintf_info(win16drv, "WIN16DRV_GetTextMetrics: %04x \n", dc->hSelf); FONT_TextMetric16to32A( &physDev->tm, metrics ); - dprintf_win16drv(stddeb, + dprintf_info(win16drv, "H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n", metrics->tmHeight, metrics->tmAscent, @@ -74,13 +73,13 @@ HFONT32 WIN16DRV_FONT_SelectObject( DC * dc, HFONT32 hfont, FONTOBJ * font) dc->w.hFont = hfont; - dprintf_win16drv(stddeb, "WIN16DRV_FONT_SelectObject '%s' h=%d\n", + dprintf_info(win16drv, "WIN16DRV_FONT_SelectObject '%s' h=%d\n", font->logfont.lfFaceName, font->logfont.lfHeight); if( physDev->FontInfo ) { - dprintf_win16drv(stddeb, "UnRealizing FontInfo\n"); + dprintf_info(win16drv, "UnRealizing FontInfo\n"); nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_FONT, physDev->FontInfo, physDev->FontInfo, 0); @@ -130,7 +129,7 @@ HFONT32 WIN16DRV_FONT_SelectObject( DC * dc, HFONT32 hfont, FONTOBJ * font) physDev->tm.tmCharSet = fi->dfCharSet; #undef fi - dprintf_win16drv(stddeb, + dprintf_info(win16drv, "H %d, A %d, D %d, Int %d, Ext %d, AW %d, MW %d, W %d\n", physDev->tm.tmHeight, physDev->tm.tmAscent, @@ -155,17 +154,18 @@ BOOL32 WIN16DRV_GetCharWidth( DC *dc, UINT32 firstChar, UINT32 lastChar, WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev; - dprintf_win16drv( stddeb, "WIN16DRV_GetCharWidth: %d - %d into %p\n", + dprintf_info(win16drv, "WIN16DRV_GetCharWidth: %d - %d into %p\n", firstChar, lastChar, buffer ); wRet = PRTDRV_GetCharWidth( physDev->segptrPDEVICE, buffer, firstChar, lastChar, physDev->FontInfo, win16drv_SegPtr_DrawMode, win16drv_SegPtr_TextXForm ); - if( debugging_win16drv ) + if( debugging_info(win16drv) ){ for(i = 0; i <= lastChar - firstChar; i++) - dprintf_win16drv(stddeb, "Char %x: width %d\n", i + firstChar, + dprintf_info(win16drv, "Char %x: width %d\n", i + firstChar, buffer[i]); + } return wRet; } @@ -207,7 +207,7 @@ WORD WINAPI WineEnumDFontCallback(LPLOGFONT16 lpLogFont, LPTEXTMETRIC16 lpTextMetrics, WORD wFontType, LONG lpClientData) { - dprintf_win16drv(stddeb, "In WineEnumDFontCallback plf=%p\n", lpLogFont); + dprintf_info(win16drv, "In WineEnumDFontCallback plf=%p\n", lpLogFont); return (*(((WEPFC *)lpClientData)->proc))( lpLogFont, lpTextMetrics, wFontType, ((WEPFC *)lpClientData)->lp ); } diff --git a/graphics/win16drv/graphics.c b/graphics/win16drv/graphics.c index 7294acbf69b..63f34ab6601 100644 --- a/graphics/win16drv/graphics.c +++ b/graphics/win16drv/graphics.c @@ -7,7 +7,6 @@ #include #include "heap.h" #include "win16drv.h" -#include "stddebug.h" #include "debug.h" /********************************************************************** @@ -61,9 +60,9 @@ WIN16DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom) BOOL32 bRet = 0; POINT16 points[2]; - dprintf_win16drv(stddeb, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n", + dprintf_info(win16drv, "In WIN16DRV_Rectangle, x %d y %d DCOrgX %d y %d\n", left, top, dc->w.DCOrgX, dc->w.DCOrgY); - dprintf_win16drv(stddeb, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n", + dprintf_info(win16drv, "In WIN16DRV_Rectangle, VPortOrgX %d y %d\n", dc->vportOrgX, dc->vportOrgY); points[0].x = XLPTODP(dc, left); points[0].y = YLPTODP(dc, top); @@ -153,9 +152,9 @@ WIN16DRV_Ellipse(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom) WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev; BOOL32 bRet = 0; POINT16 points[2]; - dprintf_win16drv(stddeb, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n", + dprintf_info(win16drv, "In WIN16DRV_Ellipse, x %d y %d DCOrgX %d y %d\n", left, top, dc->w.DCOrgX, dc->w.DCOrgY); - dprintf_win16drv(stddeb, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n", + dprintf_info(win16drv, "In WIN16DRV_Ellipse, VPortOrgX %d y %d\n", dc->vportOrgX, dc->vportOrgY); points[0].x = XLPTODP(dc, left); points[0].y = YLPTODP(dc, top); diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c index 91d0c307553..6703cf5bab9 100644 --- a/graphics/win16drv/init.c +++ b/graphics/win16drv/init.c @@ -21,7 +21,6 @@ #include "font.h" #include "callback.h" #include "options.h" -#include "stddebug.h" #include "debug.h" #define SUPPORT_REALIZED_FONTS 1 @@ -178,7 +177,7 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, return FALSE; } - dprintf_win16drv(stddeb, "In creatdc for (%s,%s,%s) initData 0x%p\n",driver, device, output, initData); + dprintf_info(win16drv, "In creatdc for (%s,%s,%s) initData 0x%p\n",driver, device, output, initData); physDev = (WIN16DRV_PDEVICE *)HeapAlloc( SystemHeap, 0, sizeof(*physDev) ); if (!physDev) return FALSE; @@ -187,11 +186,11 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, pLPD = LoadPrinterDriver(driver); if (pLPD == NULL) { - dprintf_win16drv(stddeb, "LPGDI_CreateDC: Failed to find printer driver\n"); + dprintf_warn(win16drv, "LPGDI_CreateDC: Failed to find printer driver\n"); HeapFree( SystemHeap, 0, physDev ); return FALSE; } - dprintf_win16drv(stddeb, "windevCreateDC pLPD 0x%p\n", pLPD); + dprintf_info(win16drv, "windevCreateDC pLPD 0x%p\n", pLPD); /* Now Get the device capabilities from the printer driver */ @@ -227,7 +226,7 @@ BOOL32 WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, pPDH = (PDEVICE_HEADER *)((BYTE*)PTR_SEG_TO_LIN(physDev->segptrPDEVICE) - sizeof(PDEVICE_HEADER)); pPDH->pLPD = pLPD; - dprintf_win16drv(stddeb, "PRTDRV_Enable: PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE)); + dprintf_info(win16drv, "PRTDRV_Enable: PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE)); /* Now get the printer driver to initialise this data */ wRet = PRTDRV_Enable((LPVOID)physDev->segptrPDEVICE, INITPDEVICE, device, driver, output, NULL); @@ -539,7 +538,7 @@ HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC) HANDLE16 hHandle = (HANDLE16)SP_ERROR; PPRINTJOB pPrintJob; - dprintf_win16drv(stddeb, "OpenJob: \"%s\" \"%s\" %04x\n", lpOutput, lpTitle, hDC); + dprintf_info(win16drv, "OpenJob: \"%s\" \"%s\" %04x\n", lpOutput, lpTitle, hDC); pPrintJob = gPrintJobsTable[0]; if (pPrintJob == NULL) @@ -564,7 +563,7 @@ HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC) gPrintJobsTable[pPrintJob->nIndex] = pPrintJob; } } - dprintf_win16drv(stddeb, "OpenJob: return %04x\n", hHandle); + dprintf_info(win16drv, "OpenJob: return %04x\n", hHandle); return hHandle; } @@ -573,7 +572,7 @@ int WINAPI CloseJob(HANDLE16 hJob) int nRet = SP_ERROR; PPRINTJOB pPrintJob = NULL; - dprintf_win16drv(stddeb, "CloseJob: %04x\n", hJob); + dprintf_info(win16drv, "CloseJob: %04x\n", hJob); pPrintJob = FindPrintJobFromHandle(hJob); if (pPrintJob != NULL) @@ -591,7 +590,7 @@ int WINAPI WriteSpool(HANDLE16 hJob, LPSTR lpData, WORD cch) int nRet = SP_ERROR; PPRINTJOB pPrintJob = NULL; - dprintf_win16drv(stddeb, "WriteSpool: %04x %08lx %04x\n", hJob, (DWORD)lpData, cch); + dprintf_info(win16drv, "WriteSpool: %04x %08lx %04x\n", hJob, (DWORD)lpData, cch); pPrintJob = FindPrintJobFromHandle(hJob); if (pPrintJob != NULL && pPrintJob->fd >= 0 && cch) @@ -608,7 +607,7 @@ int WINAPI WriteDialog(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg) { int nRet = 0; - dprintf_win16drv(stddeb, "WriteDialog: %04x %04x \"%s\"\n", hJob, cchMsg, lpMsg); + dprintf_info(win16drv, "WriteDialog: %04x %04x \"%s\"\n", hJob, cchMsg, lpMsg); nRet = MessageBox16(0, lpMsg, "Printing Error", MB_OKCANCEL); return nRet; @@ -618,7 +617,7 @@ int WINAPI DeleteJob(HANDLE16 hJob, WORD wNotUsed) { int nRet; - dprintf_win16drv(stddeb, "DeleteJob: %04x\n", hJob); + dprintf_info(win16drv, "DeleteJob: %04x\n", hJob); nRet = FreePrintJob(hJob); return nRet; @@ -631,13 +630,13 @@ int WINAPI DeleteJob(HANDLE16 hJob, WORD wNotUsed) */ int WINAPI StartSpoolPage(HANDLE16 hJob) { - dprintf_win16drv(stddeb, "StartSpoolPage GDI.246 unimplemented\n"); + dprintf_fixme(win16drv, "StartSpoolPage GDI.246 unimplemented\n"); return 1; } int WINAPI EndSpoolPage(HANDLE16 hJob) { - dprintf_win16drv(stddeb, "EndSpoolPage GDI.247 unimplemented\n"); + dprintf_fixme(win16drv, "EndSpoolPage GDI.247 unimplemented\n"); return 1; } @@ -645,6 +644,6 @@ int WINAPI EndSpoolPage(HANDLE16 hJob) DWORD WINAPI GetSpoolJob(int nOption, LONG param) { DWORD retval = 0; - dprintf_win16drv(stddeb, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption); + dprintf_info(win16drv, "In GetSpoolJob param 0x%lx noption %d\n",param, nOption); return retval; } diff --git a/graphics/win16drv/objects.c b/graphics/win16drv/objects.c index c2e1f82dbb7..a9a9e6ec7a0 100644 --- a/graphics/win16drv/objects.c +++ b/graphics/win16drv/objects.c @@ -10,7 +10,6 @@ #include "brush.h" #include "font.h" #include "pen.h" -#include "stddebug.h" #include "debug.h" @@ -32,7 +31,7 @@ HGDIOBJ32 WIN16DRV_SelectObject( DC *dc, HGDIOBJ32 handle ) HGDIOBJ32 ret = 0; if (!ptr) return 0; - dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); + dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); switch(ptr->wMagic) { diff --git a/graphics/win16drv/pen.c b/graphics/win16drv/pen.c index c2e54540277..459dcfe0d80 100644 --- a/graphics/win16drv/pen.c +++ b/graphics/win16drv/pen.c @@ -8,7 +8,6 @@ #include "color.h" #include "win16drv.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** @@ -21,7 +20,7 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen ) int nSize; LOGPEN16 lPen16; dc->w.hPen = hpen; - dprintf_win16drv(stddeb, "In WIN16DRV_PEN_SelectObject\n"); + dprintf_info(win16drv, "In WIN16DRV_PEN_SelectObject\n"); lPen16.lopnStyle = pen->logpen.lopnStyle; lPen16.lopnWidth.x = pen->logpen.lopnWidth.x; lPen16.lopnWidth.y = pen->logpen.lopnWidth.y; @@ -29,7 +28,7 @@ HPEN32 WIN16DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen ) if ( physDev->PenInfo ) { - dprintf_win16drv(stddeb, "UnRealizing PenInfo\n"); + dprintf_info(win16drv, "UnRealizing PenInfo\n"); nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN, physDev->PenInfo, physDev->PenInfo, 0); diff --git a/graphics/win16drv/prtdrv.c b/graphics/win16drv/prtdrv.c index fac17572e40..c686a0af79f 100644 --- a/graphics/win16drv/prtdrv.c +++ b/graphics/win16drv/prtdrv.c @@ -15,7 +15,6 @@ #include "heap.h" #include "brush.h" #include "callback.h" -#include "stddebug.h" #include "debug.h" #include "bitmap.h" #include "pen.h" @@ -56,7 +55,7 @@ static void GetPrinterDriverFunctions(HINSTANCE16 hInst, LOADED_PRINTER_DRIVER * LoadPrinterDrvFunc(ADVANCEDSETUPDIALOG); LoadPrinterDrvFunc(DIALOGFN); LoadPrinterDrvFunc(PSEUDOEDIT); - dprintf_win16drv (stddeb,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n", + dprintf_info(win16drv,"got func CONTROL 0x%p enable 0x%p enumDfonts 0x%p realizeobject 0x%p extextout 0x%p\n", pLPD->fn[FUNC_CONTROL], pLPD->fn[FUNC_ENABLE], pLPD->fn[FUNC_ENUMDFONTS], @@ -79,7 +78,7 @@ static LOADED_PRINTER_DRIVER *FindPrinterDriverFromName(const char *pszDriver) ptmpLPD = gapLoadedPrinterDrivers[nDriverSlot++]; if (ptmpLPD != NULL) { - dprintf_win16drv(stddeb, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver); + dprintf_info(win16drv, "Comparing %s,%s\n",ptmpLPD->szDriver,pszDriver); /* Found driver store info, exit loop */ if (lstrcmpi32A(ptmpLPD->szDriver, pszDriver) == 0) pLPD = ptmpLPD; @@ -151,7 +150,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver) /* Failed to load driver */ fprintf(stderr, "Failed to load printer driver %s\n", pszDriver); } else { - dprintf_win16drv(stddeb, "Loaded the library\n"); + dprintf_info(win16drv, "Loaded the library\n"); /* Allocate some memory for printer driver info */ pLPD = malloc(sizeof(LOADED_PRINTER_DRIVER)); memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER)); @@ -162,7 +161,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver) /* Get DS for the printer module */ pLPD->ds_reg = hInst; - dprintf_win16drv(stddeb, "DS for %s is %x\n", pszDriver, pLPD->ds_reg); + dprintf_info(win16drv, "DS for %s is %x\n", pszDriver, pLPD->ds_reg); /* Get address of printer driver functions */ GetPrinterDriverFunctions(hInst, pLPD); @@ -189,20 +188,20 @@ INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPT WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_Control: %08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData); + dprintf_info(win16drv, "PRTDRV_Control: %08x 0x%x %08lx %08lx\n", (unsigned int)lpDestDev, wfunction, lpInData, lpOutData); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { if (pLPD->fn[FUNC_CONTROL] == NULL) { - dprintf_win16drv(stddeb, "PRTDRV_Control: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_Control: Not supported by driver\n"); return 0; } wRet = Callbacks->CallDrvControlProc( pLPD->fn[FUNC_CONTROL], (SEGPTR)lpDestDev, wfunction, lpInData, lpOutData ); } - dprintf_win16drv(stddeb, "PRTDRV_Control: return %x\n", wRet); + dprintf_info(win16drv, "PRTDRV_Control: return %x\n", wRet); return wRet; } @@ -215,7 +214,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_Enable: %s %s\n",lpDestDevType, lpOutputFile); + dprintf_info(win16drv, "PRTDRV_Enable: %s %s\n",lpDestDevType, lpOutputFile); /* Get the printer driver info */ if (wStyle == INITPDEVICE) @@ -229,7 +228,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, WORD wP2; if (!pLPD->fn[FUNC_ENABLE]) { - dprintf_win16drv(stddeb, "PRTDRV_Enable: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_Enable: Not supported by driver\n"); return 0; } @@ -260,7 +259,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, SEGPTR_FREE(lP1); } } - dprintf_win16drv(stddeb, "PRTDRV_Enable: return %x\n", wRet); + dprintf_info(win16drv, "PRTDRV_Enable: return %x\n", wRet); return wRet; } @@ -274,7 +273,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: %08lx %s %p %p\n", + dprintf_info(win16drv, "PRTDRV_EnumDFonts: %08lx %s %p %p\n", lpDestDev, lpFaceName, lpCallbackFunc, lpClientData); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) @@ -283,7 +282,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, LPBYTE lP2; if (pLPD->fn[FUNC_ENUMDFONTS] == NULL) { - dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_EnumDFonts: Not supported by driver\n"); return 0; } @@ -300,7 +299,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, } else fprintf(stderr,"Failed to find device\n"); - dprintf_win16drv(stddeb, "PRTDRV_EnumDFonts: return %x\n", wRet); + dprintf_info(win16drv, "PRTDRV_EnumDFonts: return %x\n", wRet); return wRet; } /* @@ -312,7 +311,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_EnumObj:\n"); + dprintf_info(win16drv, "PRTDRV_EnumObj:\n"); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { @@ -322,7 +321,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, if (pLPD->fn[FUNC_ENUMOBJ] == NULL) { - dprintf_win16drv(stddeb, "PRTDRV_EnumObj: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_EnumObj: Not supported by driver\n"); return 0; } @@ -343,7 +342,7 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, else fprintf(stderr,"Failed to find device\n"); - dprintf_win16drv(stddeb, "PRTDRV_EnumObj: return %x\n", wRet); + dprintf_info(win16drv, "PRTDRV_EnumObj: return %x\n", wRet); return wRet; } @@ -362,7 +361,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_OUTPUT %d\n", wStyle ); + dprintf_info(win16drv, "PRTDRV_OUTPUT %d\n", wStyle ); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { @@ -373,7 +372,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, int nSize; if (pLPD->fn[FUNC_OUTPUT] == NULL) { - dprintf_win16drv(stddeb, "PRTDRV_Output: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_Output: Not supported by driver\n"); return 0; } @@ -416,7 +415,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, { CONV_RECT32TO16( pRect, lP8 ); - dprintf_win16drv(stddeb, "rect = %d,%d - %d,%d\n", + dprintf_info(win16drv, "rect = %d,%d - %d,%d\n", lP8->left, lP8->top, lP8->right, lP8->bottom ); wRet = Callbacks->CallDrvOutputProc(pLPD->fn[FUNC_OUTPUT], lP1, wP2, wP3, SEGPTR_GET(lP4), @@ -434,7 +433,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, } SEGPTR_FREE(lP4); } - dprintf_win16drv(stddeb, "PRTDRV_Output return %d\n", wRet); + dprintf_info(win16drv, "PRTDRV_Output return %d\n", wRet); return wRet; } @@ -448,7 +447,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, WORD dwRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, + dprintf_info(win16drv, "PRTDRV_RealizeObject: %08lx %04x %p %p %08lx\n", lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm); @@ -461,7 +460,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL) { - dprintf_win16drv(stddeb, + dprintf_warn(win16drv, "PRTDRV_RealizeObject: Not supported by driver\n"); return 0; } @@ -507,7 +506,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, lP4 = SEGPTR_GET( lpOutObj ); lP5 = lpTextXForm; - dprintf_win16drv(stddeb, + dprintf_info(win16drv, "Calling Realize %08lx %04x %08lx %08lx %08lx\n", lP1, wP2, lP3, lP4, lP5); dwRet = Callbacks->CallDrvRealizeProc(pLPD->fn[FUNC_REALIZEOBJECT], @@ -516,7 +515,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, SEGPTR_FREE(lpBuf); } - dprintf_win16drv(stddeb, "PRTDRV_RealizeObject: return %x\n", dwRet); + dprintf_info(win16drv, "PRTDRV_RealizeObject: return %x\n", dwRet); return dwRet; } @@ -537,7 +536,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_StretchBlt:\n"); + dprintf_info(win16drv, "PRTDRV_StretchBlt:\n"); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { @@ -547,7 +546,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, if (pLPD->fn[FUNC_STRETCHBLT] == NULL) { - dprintf_win16drv(stddeb, "PRTDRV_StretchBlt: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_StretchBlt: Not supported by driver\n"); return 0; } lP1 = lpDestDev; @@ -591,7 +590,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, DWORD dwRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut:\n"); + dprintf_info(win16drv, "PRTDRV_ExtTextOut:\n"); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { @@ -604,7 +603,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, if (pLPD->fn[FUNC_EXTTEXTOUT] == NULL) { - dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut: Not supported by driver\n"); + dprintf_warn(win16drv, "PRTDRV_ExtTextOut: Not supported by driver\n"); return 0; } @@ -614,7 +613,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, if (lpClipRect != NULL) { lP4 = SEGPTR_NEW(RECT16); - dprintf_win16drv(stddeb, "Adding lpClipRect\n"); + dprintf_info(win16drv, "Adding lpClipRect\n"); memcpy(lP4,lpClipRect,sizeof(RECT16)); } else lP4 = 0L; @@ -624,7 +623,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, if (nSize>abs(wCount)) nSize = abs(wCount); lP5 = SEGPTR_ALLOC(nSize+1); - dprintf_win16drv(stddeb, "Adding lpString (nSize is %d)\n",nSize); + dprintf_info(win16drv, "Adding lpString (nSize is %d)\n",nSize); memcpy(lP5,lpString,nSize); *((char *)lP5 + nSize) = '\0'; } else @@ -638,18 +637,18 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, lP9 = lpTextXForm; if (lpCharWidths != NULL) - dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut: Char widths not supported\n"); + dprintf_fixme(win16drv, "PRTDRV_ExtTextOut: Char widths not supported\n"); lP10 = 0; if (lpOpaqueRect != NULL) { lP11 = SEGPTR_NEW(RECT16); - dprintf_win16drv(stddeb, "Adding lpOpaqueRect\n"); + dprintf_info(win16drv, "Adding lpOpaqueRect\n"); memcpy(lP11,lpOpaqueRect,sizeof(RECT16)); } else lP11 = 0L; wP12 = wOptions; - dprintf_win16drv(stddeb, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n%*s 0x%x 0x%lx 0x%lx\n" + dprintf_info(win16drv, "Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n%*s 0x%x 0x%lx 0x%lx\n" "0x%lx 0x%lx %p 0x%x\n",lP1, wP2, wP3, lP4, nSize,lP5, iP6, lP7, lP8, lP9, lP10, lP11, wP12); @@ -660,7 +659,7 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, lP8, lP9, lP10, SEGPTR_GET(lP11), wP12); } - dprintf_win16drv(stddeb, "PRTDRV_ExtTextOut: return %lx\n", dwRet); + dprintf_info(win16drv, "PRTDRV_ExtTextOut: return %lx\n", dwRet); return dwRet; } @@ -757,7 +756,7 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT32 lpBuffer, WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - dprintf_win16drv(stddeb, "PRTDRV_GetCharWidth:\n"); + dprintf_info(win16drv, "PRTDRV_GetCharWidth:\n"); if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { @@ -767,7 +766,7 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT32 lpBuffer, if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL) { - dprintf_win16drv(stddeb, + dprintf_warn(win16drv, "PRTDRV_GetCharWidth: Not supported by driver\n"); return 0; } diff --git a/graphics/win16drv/text.c b/graphics/win16drv/text.c index 58d771d70e0..2bbd2aa627e 100644 --- a/graphics/win16drv/text.c +++ b/graphics/win16drv/text.c @@ -10,7 +10,6 @@ #include "win16drv.h" #include "dc.h" #include "gdi.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** @@ -32,7 +31,7 @@ BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags, if (count == 0) return FALSE; - dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n", + dprintf_info(win16drv, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n", dc->hSelf, x, y, flags, lprect, count > 0 ? count : 8, str, lpDx); @@ -55,7 +54,7 @@ BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags, } - dprintf_win16drv(stddeb, "textalign = %d\n", dc->w.textAlign); + dprintf_info(win16drv, "textalign = %d\n", dc->w.textAlign); if (dc->w.textAlign & TA_UPDATECP) { diff --git a/graphics/wing.c b/graphics/wing.c index be3c90150dd..f167633e552 100644 --- a/graphics/wing.c +++ b/graphics/wing.c @@ -17,7 +17,6 @@ #include "dc.h" #include "gdi.h" #include "xmalloc.h" -#include "stddebug.h" #include "debug.h" extern void CLIPPING_UpdateGCRegion(DC* ); diff --git a/graphics/x11drv/bitblt.c b/graphics/x11drv/bitblt.c index 100d63e3188..d71cefbf739 100644 --- a/graphics/x11drv/bitblt.c +++ b/graphics/x11drv/bitblt.c @@ -16,7 +16,6 @@ #include "metafile.h" #include "options.h" #include "x11drv.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -1120,12 +1119,12 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst, widthDst = widthDst * dcDst->vportExtX / dcDst->wndExtX; heightDst = heightDst * dcDst->vportExtY / dcDst->wndExtY; - dprintf_bitblt( stddeb, " vportdst=%d,%d-%d,%d wnddst=%d,%d-%d,%d\n", + dprintf_info(bitblt, " vportdst=%d,%d-%d,%d wnddst=%d,%d-%d,%d\n", dcDst->vportOrgX, dcDst->vportOrgY, dcDst->vportExtX, dcDst->vportExtY, dcDst->wndOrgX, dcDst->wndOrgY, dcDst->wndExtX, dcDst->wndExtY ); - dprintf_bitblt( stddeb, " rectdst=%d,%d-%d,%d orgdst=%d,%d\n", + dprintf_info(bitblt, " rectdst=%d,%d-%d,%d orgdst=%d,%d\n", xDst, yDst, widthDst, heightDst, dcDst->w.DCOrgX, dcDst->w.DCOrgY ); @@ -1136,19 +1135,19 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst, widthSrc = widthSrc * dcSrc->vportExtX / dcSrc->wndExtX; heightSrc = heightSrc * dcSrc->vportExtY / dcSrc->wndExtY; fStretch = (widthSrc != widthDst) || (heightSrc != heightDst); - dprintf_bitblt( stddeb," vportsrc=%d,%d-%d,%d wndsrc=%d,%d-%d,%d\n", + dprintf_info(bitblt," vportsrc=%d,%d-%d,%d wndsrc=%d,%d-%d,%d\n", dcSrc->vportOrgX, dcSrc->vportOrgY, dcSrc->vportExtX, dcSrc->vportExtY, dcSrc->wndOrgX, dcSrc->wndOrgY, dcSrc->wndExtX, dcSrc->wndExtY ); - dprintf_bitblt( stddeb, " rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n", + dprintf_info(bitblt, " rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n", xSrc, ySrc, widthSrc, heightSrc, dcSrc->w.DCOrgX, dcSrc->w.DCOrgY ); if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst, dcSrc, xSrc, ySrc, widthSrc, heightSrc, &visRectSrc, &visRectDst )) return TRUE; - dprintf_bitblt( stddeb, " vissrc=%d,%d-%d,%d visdst=%d,%d-%d,%d\n", + dprintf_info(bitblt, " vissrc=%d,%d-%d,%d visdst=%d,%d-%d,%d\n", visRectSrc.left, visRectSrc.top, visRectSrc.right, visRectSrc.bottom, visRectDst.left, visRectDst.top, @@ -1160,7 +1159,7 @@ static BOOL32 BITBLT_InternalStretchBlt( DC *dcDst, INT32 xDst, INT32 yDst, if (!BITBLT_GetVisRectangles( dcDst, xDst, yDst, widthDst, heightDst, NULL, 0, 0, 0, 0, NULL, &visRectDst )) return TRUE; - dprintf_bitblt( stddeb, " vissrc=none visdst=%d,%d-%d,%d\n", + dprintf_info(bitblt, " vissrc=none visdst=%d,%d-%d,%d\n", visRectDst.left, visRectDst.top, visRectDst.right, visRectDst.bottom ); } diff --git a/graphics/x11drv/bitmap.c b/graphics/x11drv/bitmap.c index 1c3cb8b8f53..960c3c7af16 100644 --- a/graphics/x11drv/bitmap.c +++ b/graphics/x11drv/bitmap.c @@ -13,7 +13,6 @@ #include "dc.h" #include "bitmap.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" extern void CLIPPING_UpdateGCRegion(DC* ); diff --git a/graphics/x11drv/brush.c b/graphics/x11drv/brush.c index 5c2fae19ea3..90ff60aacd2 100644 --- a/graphics/x11drv/brush.c +++ b/graphics/x11drv/brush.c @@ -9,7 +9,6 @@ #include "bitmap.h" #include "color.h" #include "x11drv.h" -#include "stddebug.h" #include "debug.h" static const char HatchBrushes[NB_HATCH_STYLES + 1][8] = @@ -209,7 +208,7 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush ) BITMAPINFO * bmpInfo; HBRUSH16 prevHandle = dc->w.hBrush; - dprintf_gdi(stddeb, "Brush_SelectObject: hdc=%04x hbrush=%04x\n", + dprintf_info(gdi, "Brush_SelectObject: hdc=%04x hbrush=%04x\n", dc->hSelf,hbrush); #ifdef NOTDEF if (dc->header.wMagic == METAFILE_DC_MAGIC) @@ -244,16 +243,16 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush ) switch(brush->logbrush.lbStyle) { case BS_NULL: - dprintf_gdi( stddeb,"BS_NULL\n" ); + dprintf_info(gdi,"BS_NULL\n" ); break; case BS_SOLID: - dprintf_gdi( stddeb,"BS_SOLID\n" ); + dprintf_info(gdi,"BS_SOLID\n" ); BRUSH_SelectSolidBrush( dc, brush->logbrush.lbColor ); break; case BS_HATCHED: - dprintf_gdi( stddeb, "BS_HATCHED\n" ); + dprintf_info(gdi, "BS_HATCHED\n" ); dc->u.x.brush.pixel = COLOR_ToPhysical( dc, brush->logbrush.lbColor ); dc->u.x.brush.pixmap = TSXCreateBitmapFromData( display, rootWindow, HatchBrushes[brush->logbrush.lbHatch], 8, 8 ); @@ -261,12 +260,12 @@ HBRUSH32 X11DRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush, BRUSHOBJ * brush ) break; case BS_PATTERN: - dprintf_gdi( stddeb, "BS_PATTERN\n"); + dprintf_info(gdi, "BS_PATTERN\n"); BRUSH_SelectPatternBrush( dc, (HBRUSH16)brush->logbrush.lbHatch ); break; case BS_DIBPATTERN: - dprintf_gdi( stddeb, "BS_DIBPATTERN\n"); + dprintf_info(gdi, "BS_DIBPATTERN\n"); if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)brush->logbrush.lbHatch ))) { int size = DIB_BitmapInfoSize( bmpInfo, brush->logbrush.lbColor ); diff --git a/graphics/x11drv/clipping.c b/graphics/x11drv/clipping.c index a778c1ef591..8e87ce5af77 100644 --- a/graphics/x11drv/clipping.c +++ b/graphics/x11drv/clipping.c @@ -8,7 +8,6 @@ #include "dc.h" #include "x11drv.h" #include "region.h" -#include "stddebug.h" #include "debug.h" #include "heap.h" diff --git a/graphics/x11drv/graphics.c b/graphics/x11drv/graphics.c index da14d481a60..091829ec201 100644 --- a/graphics/x11drv/graphics.c +++ b/graphics/x11drv/graphics.c @@ -25,7 +25,6 @@ #include "bitmap.h" #include "callback.h" #include "metafile.h" -#include "stddebug.h" #include "palette.h" #include "color.h" #include "region.h" @@ -271,7 +270,7 @@ BOOL32 X11DRV_RoundRect( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom, INT32 ell_width, INT32 ell_height ) { - dprintf_graphics(stddeb, "X11DRV_RoundRect(%d %d %d %d %d %d\n", + dprintf_info(graphics, "X11DRV_RoundRect(%d %d %d %d %d %d\n", left, top, right, bottom, ell_width, ell_height); left = XLPTODP( dc, left ); @@ -695,7 +694,7 @@ X11DRV_ExtFloodFill( DC *dc, INT32 x, INT32 y, COLORREF color, BOOL32 result; struct FloodFill_params params = { dc, x, y, color, fillType }; - dprintf_graphics( stddeb, "X11DRV_ExtFloodFill %d,%d %06lx %d\n", + dprintf_info(graphics, "X11DRV_ExtFloodFill %d,%d %06lx %d\n", x, y, color, fillType ); if (!PtVisible32( dc->hSelf, x, y )) return FALSE; diff --git a/graphics/x11drv/objects.c b/graphics/x11drv/objects.c index c665b07842a..1a8fa7e755e 100644 --- a/graphics/x11drv/objects.c +++ b/graphics/x11drv/objects.c @@ -10,7 +10,6 @@ #include "brush.h" #include "font.h" #include "pen.h" -#include "stddebug.h" #include "debug.h" @@ -32,7 +31,7 @@ HGDIOBJ32 X11DRV_SelectObject( DC *dc, HGDIOBJ32 handle ) HGDIOBJ32 ret = 0; if (!ptr) return 0; - dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); + dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", dc->hSelf, handle ); switch(ptr->wMagic) { diff --git a/graphics/x11drv/pen.c b/graphics/x11drv/pen.c index 3a424cf7d16..a918c8511ae 100644 --- a/graphics/x11drv/pen.c +++ b/graphics/x11drv/pen.c @@ -6,7 +6,6 @@ #include "pen.h" #include "color.h" -#include "stddebug.h" #include "debug.h" static const char PEN_dash[] = { 5,3 }; /* ----- ----- ----- */ diff --git a/graphics/x11drv/text.c b/graphics/x11drv/text.c index cd76974603f..a206860065e 100644 --- a/graphics/x11drv/text.c +++ b/graphics/x11drv/text.c @@ -13,8 +13,6 @@ /*#include "callback.h"*/ #include "heap.h" #include "x11font.h" -#include "stddebug.h" -/* #define DEBUG_TEXT */ #include "debug.h" #define SWAP_INT(a,b) { int t = a; a = b; b = t; } @@ -45,10 +43,10 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags, lfUnderline = (pfo->fo_flags & FO_SYNTH_UNDERLINE) ? 1 : 0; lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0; - dprintf_text(stddeb,"ExtTextOut: hdc=%04x df=%04x %d,%d '%.*s', %d flags=%d\n", + dprintf_info(text,"ExtTextOut: hdc=%04x df=%04x %d,%d '%.*s', %d flags=%d\n", dc->hSelf, (UINT16)(dc->u.x.font), x, y, (int)count, str, count, flags); - if (lprect != NULL) dprintf_text(stddeb, "\trect=(%d,%d- %d,%d)\n", + if (lprect != NULL) dprintf_info(text, "\trect=(%d,%d- %d,%d)\n", lprect->left, lprect->top, lprect->right, lprect->bottom ); /* Setup coordinates */ @@ -87,7 +85,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags, x = XLPTODP( dc, x ); y = YLPTODP( dc, y ); - dprintf_text(stddeb,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n", + dprintf_info(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n", x, y, rect.left, rect.top, rect.right, rect.bottom); /* Draw the rectangle */ diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index 1a99b7d1522..756bfc2f8ea 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -22,7 +22,6 @@ #include "options.h" #include "x11font.h" #include "font.h" -#include "stddebug.h" #include "debug.h" #define DEBUG_FONT_INIT 1 @@ -524,7 +523,7 @@ static BOOL32 LFD_ComposeLFD( fontObject* fo, sprintf( lpch, "%i-*-*-*-*-*-%s*", fo->fi->lfd_height, lpEncoding ); } - dprintf_font(stddeb,"\tLFD: %s\n", lpLFD ); + dprintf_info(font,"\tLFD: %s\n", lpLFD ); return TRUE; } @@ -826,7 +825,7 @@ static void XFONT_WindowsNames( char* buffer ) } #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb,"typeface \'%s\'\n", fr->lfFaceName); + dprintf_info(font,"typeface \'%s\'\n", fr->lfFaceName); #endif fr->fr_flags |= FR_NAMESET; } @@ -867,7 +866,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias ) if( !lstrcmpi32A( pfa->faTypeFace, lpAlias ) ) { #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb,"\tredundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace ); + dprintf_info(font,"\tredundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace ); #endif return NULL; } @@ -887,7 +886,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias ) lstrcpy32A( pfa->faAlias, lpAlias ); #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb, "\tadded alias '%s' for %s\n", lpAlias, lpTypeFace ); + dprintf_info(font, "\tadded alias '%s' for %s\n", lpAlias, lpTypeFace ); #endif return pfa; } @@ -989,7 +988,7 @@ static void XFONT_LoadAliases( char** buffer, int buf_size ) } #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb, "\tsubstituted '%s' with %s\n", + dprintf_info(font, "\tsubstituted '%s' with %s\n", frMatch->lfFaceName, lpAlias ); #endif lstrcpyn32A( frMatch->lfFaceName, lpAlias, LF_FACESIZE ); @@ -1063,7 +1062,7 @@ static BOOL32 XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int fontResource* pfr = fontList; fontInfo* pfi = NULL; - dprintf_font(stddeb,"Reading cached font metrics:\n"); + dprintf_info(font,"Reading cached font metrics:\n"); read( fd, fontList, i); /* read all metrics at once */ while( offset < length ) @@ -1103,7 +1102,7 @@ static BOOL32 XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int offset += sizeof(int); for( pfr = fontList; pfr; pfr = pfr->next ) { - dprintf_font(stddeb,"\t%s, %i instances\n", lpch, pfr->count ); + dprintf_info(font,"\t%s, %i instances\n", lpch, pfr->count ); pfr->resource = lpch; while( TRUE ) { @@ -1159,13 +1158,13 @@ static BOOL32 XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count i += n_ff * sizeof(fontResource) + j * sizeof(fontInfo) + sizeof(int); write( fd, &i, sizeof(int) ); - dprintf_font(stddeb,"Writing font cache:\n"); + dprintf_info(font,"Writing font cache:\n"); for( pfr = fontList; pfr; pfr = pfr->next ) { fontInfo fi; - dprintf_font(stddeb,"\t%s, %i instances\n", pfr->resource, pfr->count ); + dprintf_info(font,"\t%s, %i instances\n", pfr->resource, pfr->count ); i = write( fd, pfr, sizeof(fontResource) ); if( i == sizeof(fontResource) ) @@ -1324,7 +1323,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps ) x_pattern = TSXListFonts(display, "*", MAX_FONT_FAMILIES * 16, &x_count ); - dprintf_font(stddeb,"Font Mapper: initializing %i fonts [LPY=%i, XDR=%i, DR=%i]\n", + dprintf_info(font,"Font Mapper: initializing %i fonts [LPY=%i, XDR=%i, DR=%i]\n", x_count, pDevCaps->logPixelsY, DefResolution, res); for( i = x_checksum = 0; i < x_count; i++ ) { @@ -1397,7 +1396,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps ) lstrcpyn32A( fr->resource, typeface, j + 1 ); #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb," family: %s\n", fr->resource ); + dprintf_info(font," family: %s\n", fr->resource ); #endif if( pfr ) pfr->next = fr; @@ -1441,7 +1440,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps ) TSXFreeFont( display, x_fs ); #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb,"\t[% 2ipt] '%s'\n", fi->df.dfPoints, typeface ); + dprintf_info(font,"\t[% 2ipt] '%s'\n", fi->df.dfPoints, typeface ); #endif XFONT_CheckFIList( fr, fi, REMOVE_SUBSETS ); fi = NULL; /* preventing reuse */ @@ -1486,7 +1485,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps ) XFONT_GrowFreeList(0, fontCacheSize - 1); #ifdef DEBUG_FONT_INIT - dprintf_font(stddeb,"done!\n"); + dprintf_info(font,"done!\n"); #endif /* update text caps parameter */ @@ -1550,7 +1549,7 @@ static UINT32 XFONT_Match( fontMatch* pfm ) BOOL32 bScale = pfi->fi_flags & FI_SCALABLE; INT32 d, h; - dprintf_font( stddeb,"\t[ %-2ipt h=%-3i w=%-3i %s%s]", pfi->df.dfPoints, + dprintf_info(font,"\t[ %-2ipt h=%-3i w=%-3i %s%s]\n", pfi->df.dfPoints, pfi->df.dfPixHeight, pfi->df.dfAvgWidth, (pfi->df.dfWeight > 400) ? "Bold " : "Normal ", (pfi->df.dfItalic) ? "Italic" : "" ); @@ -1640,7 +1639,7 @@ static UINT32 XFONT_Match( fontMatch* pfm ) if( penalty && pfi->lfd_resolution != DefResolution ) penalty++; - dprintf_font(stddeb,"-> %i\n", penalty ); + dprintf_info(font," returning %i\n", penalty ); return penalty; } @@ -1718,7 +1717,7 @@ static void XFONT_CheckFIList( fontResource* fr, fontInfo* fi, int action) } #ifdef DEBUG_FONT_INIT - if( i ) dprintf_font(stddeb,"\t purged %i subsets [%i]\n", i , fr->count); + if( i ) dprintf_info(font,"\t purged %i subsets [%i]\n", i , fr->count); #endif } @@ -1761,7 +1760,7 @@ static BOOL32 XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm ) if( fm.pfr ) /* match family */ { - dprintf_font(stddeb, "%s\n", fm.pfr->lfFaceName ); + dprintf_info(font, "%s\n", fm.pfr->lfFaceName ); XFONT_MatchFIList( &fm ); *pfm = fm; @@ -1775,7 +1774,7 @@ static BOOL32 XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm ) for( start = fontList; start && score; start = start->next ) { fm.pfr = start; - dprintf_font(stddeb, "%s\n", fm.pfr->lfFaceName ); + dprintf_info(font, "%s\n", fm.pfr->lfFaceName ); current_score = XFONT_MatchFIList( &fm ); if( current_score < score ) @@ -1850,7 +1849,7 @@ static fontObject* XFONT_GetCacheEntry() { int prev_i, prev_j, j; - dprintf_font(stddeb,"font cache is full\n"); + dprintf_info(font,"font cache is full\n"); /* lookup the least recently used font */ @@ -1869,7 +1868,7 @@ static fontObject* XFONT_GetCacheEntry() { /* detach from the lru list */ - dprintf_font(stddeb,"\tfreeing entry %i\n", j ); + dprintf_info(font,"\tfreeing entry %i\n", j ); if( prev_j >= 0 ) fontCache[prev_j].lru = fontCache[j].lru; @@ -1887,7 +1886,7 @@ static fontObject* XFONT_GetCacheEntry() prev_i = fontCacheSize + FONTCACHE; - dprintf_font(stddeb,"\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i ); + dprintf_info(font,"\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i ); if( (newCache = (fontObject*)HeapReAlloc(SystemHeap, 0, fontCache, prev_i)) ) @@ -1942,7 +1941,7 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf ) { UINT32 uRelaxLevel = 0; - dprintf_font(stddeb,"XRealizeFont: (%u) '%s' h=%i weight=%i %s\n", + dprintf_info(font,"XRealizeFont: (%u) '%s' h=%i weight=%i %s\n", plf->lfCharSet, plf->lfFaceName, plf->lfHeight, plf->lfWeight, (plf->lfItalic) ? "Italic" : "" ); @@ -2020,7 +2019,7 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf ) pfo->lru = fontMRU; fontMRU = (pfo - fontCache); - dprintf_font(stddeb,"physfont %i\n", fontMRU); + dprintf_info(font,"physfont %i\n", fontMRU); return (X_PHYSFONT)(X_PFONT_MAGIC | fontMRU); } diff --git a/if1632/builtin.c b/if1632/builtin.c index 01677506bb5..e56183d0ccf 100644 --- a/if1632/builtin.c +++ b/if1632/builtin.c @@ -18,7 +18,6 @@ #include "stackframe.h" #include "user.h" #include "process.h" -#include "stddebug.h" #include "debug.h" /* Built-in modules descriptors */ @@ -142,7 +141,7 @@ static HMODULE16 BUILTIN_DoLoadModule16( const WIN16_DESCRIPTOR *descr ) if (!hModule) return 0; FarSetOwner( hModule, hModule ); - dprintf_module( stddeb, "Built-in %s: hmodule=%04x\n", + dprintf_info(module, "Built-in %s: hmodule=%04x\n", descr->name, hModule ); pModule = (NE_MODULE *)GlobalLock16( hModule ); pModule->self = hModule; @@ -186,6 +185,8 @@ BOOL32 BUILTIN_Init(void) WORD vector; HMODULE16 hModule; + fnBUILTIN_LoadModule = BUILTIN_LoadModule; + for (dll = BuiltinDLLs; dll->descr; dll++) { if (dll->flags & DLL_FLAG_ALWAYS_USED) diff --git a/if1632/compobj.spec b/if1632/compobj.spec index 55eb7e97e40..f0ce3c9809e 100644 --- a/if1632/compobj.spec +++ b/if1632/compobj.spec @@ -2,10 +2,10 @@ name compobj type win16 1 pascal CoBuildVersion() CoBuildVersion -2 pascal CoInitialize(long) CoInitialize +2 pascal CoInitialize(long) CoInitialize16 3 pascal CoUninitialize() CoUnitialize -4 pascal CoGetMalloc(long ptr) CoGetMalloc -5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject +4 pascal CoGetMalloc(long ptr) CoGetMalloc16 +5 pascal CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject16 6 stub COREVOKECLASSOBJECT 7 stub COGETCLASSOBJECT 8 stub COMARSHALINTERFACE @@ -19,8 +19,8 @@ type win16 16 stub CORELEASEMARSHALDATA 17 pascal16 COFREEUNUSEDLIBRARIES() CoFreeUnusedLibraries 18 pascal16 IsEqualGUID(ptr ptr) IsEqualGUID -19 pascal StringFromCLSID(ptr ptr) StringFromCLSID -20 pascal CLSIDFromString(str ptr) CLSIDFromString +19 pascal StringFromCLSID(ptr ptr) StringFromCLSID16 +20 pascal CLSIDFromString(str ptr) CLSIDFromString16 21 stub ISVALIDPTRIN 22 stub ISVALIDPTROUT 23 stub ISVALIDINTERFACE @@ -61,7 +61,7 @@ type win16 58 stub _IID_IDFRESERVED2 59 stub _IID_IDFRESERVED3 60 stub _IID_IMESSAGEFILTER -61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID +61 pascal CLSIDFromProgID(str ptr) CLSIDFromProgID16 62 stub PROGIDFROMCLSID 63 stub COLOCKOBJECTEXTERNAL 64 stub _CLSID_STDMARSHAL @@ -147,3 +147,14 @@ type win16 201 pascal CALLOBJECTINWOW(ptr ptr) CallObjectInWOW 204 stub COMPOBJ_204 207 stub COMPOBJ_207 + +# WINE internal relays (for Win16 interfaces) +500 cdecl IMalloc16_QueryInterface(ptr ptr ptr) IMalloc16_QueryInterface +501 cdecl IMalloc16_AddRef(ptr) IMalloc16_AddRef +502 cdecl IMalloc16_Release(ptr) IMalloc16_Release +503 cdecl IMalloc16_Alloc(ptr long) IMalloc16_Alloc +504 cdecl IMalloc16_Realloc(ptr segptr long) IMalloc16_Realloc +505 cdecl IMalloc16_Free(ptr segptr) IMalloc16_Free +506 cdecl IMalloc16_GetSize(ptr segptr) IMalloc16_GetSize +507 cdecl IMalloc16_DidAlloc(ptr segptr) IMalloc16_DidAlloc +508 cdecl IMalloc16_HeapMinimize(ptr) IMalloc16_HeapMinimize diff --git a/if1632/dummy.c b/if1632/dummy.c index dbf23c87f85..65c0da8725e 100644 --- a/if1632/dummy.c +++ b/if1632/dummy.c @@ -2,7 +2,7 @@ #include "wintypes.h" long WINAPI stub_GDI_379(void) { fprintf(stderr, "Warning: GDI_379:STARTPAGE unimplemented stub\n"); return 1; } long WINAPI stub_GDI_380(void) { fprintf(stderr, "Warning: GDI_380:ENDPAGE unimplemented stub\n"); return 1; } -long WINAPI stub_GDI_381(void) { fprintf(stderr, "Warning: GDI_381:SETABORTPROC unimplemented stub\n"); return 1; } +long WINAPI stub_GDI_381(HDC16 hdc, SEGPTR proc) { fprintf(stderr, "Warning: GDI_381:SETABORTPROC unimplemented stub\n"); return 1; } long WINAPI stub_GDI_382(void) { fprintf(stderr, "Warning: GDI_382:ABORTPROC unimplemented stub\n"); return 1; } long WINAPI stub_GDI_530(void) { fprintf(stderr, "Warning: GDI_530: unimplemented stub\n"); return 0; } long WINAPI stub_GDI_531(void) { fprintf(stderr, "Warning: GDI_531: unimplemented stub\n"); return 0; } @@ -46,4 +46,3 @@ long WINAPI stub_USER_920(void) { fprintf(stderr, "Warning: USER_920: unimplemen long WINAPI stub_USER_922(void) { fprintf(stderr, "Warning: USER_922: unimplemented stub\n"); return 0; } long WINAPI stub_USER_923(void) { fprintf(stderr, "Warning: USER_923: unimplemented stub\n"); return 0; } long WINAPI stub_KERNEL_700(void) { fprintf(stderr, "Warning: KERNEL_700: unimplemented stub\n"); return 1; } -long WINAPI stub_KERNEL_449(void) { fprintf(stderr, "Warning: KERNEL_449: unimplemented stub\n"); return 0; } diff --git a/if1632/gdi.spec b/if1632/gdi.spec index 8d2ff8cf84a..bf7fd6fe019 100644 --- a/if1632/gdi.spec +++ b/if1632/gdi.spec @@ -260,7 +260,7 @@ file gdi.exe 378 pascal16 EndDoc(word) EndDoc16 379 pascal16 StartPage() stub_GDI_379 380 pascal16 EndPage() stub_GDI_380 -381 pascal16 SetAbortProc() stub_GDI_381 +381 pascal16 SetAbortProc(word segptr) stub_GDI_381 382 pascal16 AbortDoc() stub_GDI_382 400 pascal16 FastWindowFrame(word ptr s_word s_word long) FastWindowFrame 401 stub GDIMOVEBITMAP diff --git a/if1632/kernel.spec b/if1632/kernel.spec index 3c347c7535b..abb0bff9cd1 100644 --- a/if1632/kernel.spec +++ b/if1632/kernel.spec @@ -260,7 +260,7 @@ file krnl386.exe 337 pascal16 IsBadStringPtr(segptr word) IsBadStringPtr16 338 stub HasGPHandler 339 pascal16 DiagQuery() DiagQuery -340 pascal16 DiagOutput() DiagOutput +340 pascal16 DiagOutput(str) DiagOutput 341 pascal ToolHelpHook(ptr) ToolHelpHook 342 stub __GP 343 stub RegisterWinOldApHook @@ -308,14 +308,16 @@ file krnl386.exe 445 stub KERNEL_445 446 stub KERNEL_446 447 stub KERNEL_447 -449 pascal KERNEL_449() stub_KERNEL_449 +449 pascal KERNEL_449() KERNEL_449 450 pascal16 KERNEL_450() stub_KERNEL_450 454 stub KERNEL_454 455 stub KERNEL_455 -471 stub KERNEL_471 +471 pascal KERNEL_471() _KERNEL_471 472 register KERNEL_472() _KERNEL_472 473 stub KERNEL_473 475 stub KERNEL_475 +480 stub KERNEL_480 +481 stub KERNEL_481 482 stub KERNEL_482 485 stub KERNEL_485 491 stub RegisterServiceProcess diff --git a/if1632/relay.c b/if1632/relay.c index 74e7fad555b..3cc5b0dcd2c 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -13,13 +13,11 @@ #include "module.h" #include "stackframe.h" #include "task.h" -#include "stddebug.h" -/* #define DEBUG_RELAY */ #include "debug.h" #if 0 /* Make make_debug think these were really used */ -dprintf_relay +dprintf_info(relay, "test - dummy"); #endif @@ -83,7 +81,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args, char *args16; int i; - if (!debugging_relay) return; + if (!debugging_info(relay)) return; frame = CURRENT_STACK16; printf( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs, @@ -201,7 +199,7 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT *context) STACK16FRAME *frame; WORD ordinal; - if (!debugging_relay) return; + if (!debugging_info(relay)) return; frame = CURRENT_STACK16; printf( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs, frame->entry_ip, @@ -259,7 +257,7 @@ void RELAY_DebugCallTo16( int* stack, int nb_args ) { THDB *thdb; - if (!debugging_relay) return; + if (!debugging_info(relay)) return; thdb = THREAD_Current(); if (nb_args == -1) /* Register function */ @@ -385,7 +383,7 @@ void WINAPI Throw( CONTEXT *context ) if (lpbuf[8] != SS_reg(context)) fprintf( stderr, "Switching stack segment with Throw() not supported; expect crash now\n" ); - if (debugging_relay) /* Make sure we have a valid entry point address */ + if (debugging_info(relay)) /* Make sure we have a valid entry point address */ { static FARPROC16 entryPoint = NULL; @@ -410,12 +408,13 @@ static DWORD RELAY_CallProc32W(int Ex) DWORD *args, ret; VA_LIST16 valist; int i; + dbg_decl_str(relay, 1024); VA_START16( valist ); nrofargs = VA_ARG16( valist, DWORD ); argconvmask = VA_ARG16( valist, DWORD ); proc32 = VA_ARG16( valist, FARPROC32 ); - dprintf_relay(stddeb,"CallProc32W(%ld,%ld,%p, Ex%d args[",nrofargs,argconvmask,proc32,Ex); + dsprintf(relay, "CallProc32W(%ld,%ld,%p, Ex%d args[",nrofargs,argconvmask,proc32,Ex); args = (DWORD*)HEAP_xalloc( GetProcessHeap(), 0, sizeof(DWORD)*nrofargs ); for (i=0;i32 relays. They use the cdecl calling convention. + +# IStorage +500 cdecl IStorage16_QueryInterface(ptr ptr ptr) IStorage16_QueryInterface +501 cdecl IStorage16_AddRef(ptr) IStorage16_AddRef +502 cdecl IStorage16_Release(ptr) IStorage16_Release +#503 cdecl IStorage16_CreateStream(ptr str long long long ptr) IStorage16_CreateStream +503 stub IStorage16_CreateStream + +504 cdecl IStorage16_OpenStream(ptr str ptr long long ptr) IStorage16_OpenStream +#505 cdecl IStorage16_CreateStorage(ptr str long long long ptr) IStorage16_CreateStorage +505 stub IStorage16_CreateStorage +506 cdecl IStorage16_OpenStorage(ptr str ptr long ptr long ptr) IStorage16_OpenStorage +507 cdecl IStorage16_CopyTo(ptr long ptr ptr ptr) IStorage16_CopyTo +508 stub IStorage16_MoveElementTo +509 cdecl IStorage16_Commit(ptr long) IStorage16_Commit +510 stub IStorage16_Revert +511 stub IStorage16_EnumElements +512 stub IStorage16_DestroyElement +513 stub IStorage16_RenameElement +514 stub IStorage16_SetElementTimes +515 stub IStorage16_SetClass +516 stub IStorage16_SetStateBits +517 cdecl IStorage16_Stat(ptr ptr long) IStorage16_Stat + +# IStream +518 cdecl IStream16_QueryInterface(ptr ptr ptr) IStream16_QueryInterface +519 cdecl IStream16_AddRef(ptr) IStream16_AddRef +520 cdecl IStream16_Release(ptr) IStream16_Release +521 cdecl IStream16_Read(ptr ptr long ptr) IStream16_Read +#522 cdecl IStream16_Write(ptr ptr long ptr) IStream16_Write +522 stub IStream16_Write +523 cdecl IStream16_Seek(ptr long long long ptr) IStream16_Seek +524 stub IStream16_SetSize +525 stub IStream16_CopyTo +526 stub IStream16_Commit +527 stub IStream16_Revert +528 stub IStream16_LockRegion +529 stub IStream16_UnlockRegion +530 stub IStream16_Stat +531 stub IStream16_Clone diff --git a/if1632/thunk.c b/if1632/thunk.c index 499ec204e1f..05eaef72c70 100644 --- a/if1632/thunk.c +++ b/if1632/thunk.c @@ -18,7 +18,6 @@ #include "task.h" #include "except.h" #include "win.h" -#include "stddebug.h" #include "debug.h" @@ -227,7 +226,7 @@ static void THUNK_Free( THUNK *thunk ) return; } } - dprintf_thunk( stddeb, "THUNK_Free: invalid thunk addr %p\n", thunk ); + dprintf_err(thunk, "THUNK_Free: invalid thunk addr %p\n", thunk ); } @@ -626,7 +625,7 @@ static BOOL32 WINAPI THUNK_WOWCallback16Ex( LPDWORD args = (LPDWORD)xargs; DWORD ret,i; - dprintf_relay(stddeb,"WOWCallback16Ex(%p,0x%08lx,%ld,%p,%p)\n", + dprintf_info(relay,"WOWCallback16Ex(%p,0x%08lx,%ld,%p,%p)\n", proc,dwFlags,cbArgs,xargs,pdwret ); if (dwFlags == WCB16_CDECL) { diff --git a/if1632/w32sys.spec b/if1632/w32sys.spec index ff5a3dd8499..378c4826552 100644 --- a/if1632/w32sys.spec +++ b/if1632/w32sys.spec @@ -5,7 +5,7 @@ type win16 2 stub ISPEFORMAT 3 stub EXECPE 4 stub GETPEEXEINFO -5 stub GETW32SYSVERSION +5 return GETW32SYSVERSION 0 0x100 6 stub LOADPERESOURCE 7 stub GETPERESOURCETABLE 8 stub EXECPEEX diff --git a/include/acconfig.h b/include/acconfig.h index e7ec75b83c8..dacc345bc56 100644 --- a/include/acconfig.h +++ b/include/acconfig.h @@ -17,3 +17,6 @@ /* Define if you have the Open Sound system. */ #undef HAVE_OSS + +/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */ +#undef NO_REENTRANT_X11 diff --git a/include/compobj.h b/include/compobj.h index 9b74eda5c77..d5f833a9638 100644 --- a/include/compobj.h +++ b/include/compobj.h @@ -1,4 +1,4 @@ -#if !defined(COMPOBJ_H) +#ifndef COMPOBJ_H #define COMPOBJ_H #include "ole.h" @@ -15,9 +15,14 @@ typedef struct tagGUID GUID,*LPGUID,*REFGUID; typedef struct tagGUID CLSID,*LPCLSID,*REFCLSID; typedef struct tagGUID IID,*REFIID,*LPIID; -OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR); -OLESTATUS WINAPI CLSIDFromString(const LPCSTR, CLSID *); +OLESTATUS WINAPI StringFromCLSID16(const CLSID *id, LPOLESTR16*); +OLESTATUS WINAPI StringFromCLSID32(const CLSID *id, LPOLESTR32*); +#define StringFromCLSID WINELIB_NAME(StringFromCLSID) +OLESTATUS WINAPI CLSIDFromString16(LPCOLESTR16, CLSID *); +OLESTATUS WINAPI CLSIDFromString32(LPCOLESTR32, CLSID *); +#define CLSIDFromString WINELIB_NAME(CLSIDFromString) +OLESTATUS WINAPI WINE_StringFromCLSID(const CLSID *id, LPSTR); #ifdef INITGUID #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ diff --git a/include/config.h.in b/include/config.h.in index 0f335ec033a..5bd94d23552 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -30,6 +30,9 @@ /* Define if you have the Open Sound system. */ #undef HAVE_OSS +/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */ +#undef NO_REENTRANT_X11 + /* Define if you have the clone function. */ #undef HAVE_CLONE diff --git a/include/ddraw.h b/include/ddraw.h index 7078757837f..f22fb366800 100644 --- a/include/ddraw.h +++ b/include/ddraw.h @@ -813,6 +813,7 @@ struct IDirectDrawPalette { DWORD ref; LPDIRECTDRAW ddraw; Colormap cm; + PALETTEENTRY palents[256]; }; #undef THIS diff --git a/include/debug.h b/include/debug.h index 2f35c73f3d1..f00ff5762ca 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,1858 +1,95 @@ -#include - -#define stddeb stdout -#define stdnimp stdout - -/* Do not remove this line or change anything below this line */ - -#ifdef DEBUG_NONE_EXT -#undef DEBUG_ACCEL -#undef DEBUG_ASPI -#undef DEBUG_ATOM -#undef DEBUG_BITBLT -#undef DEBUG_BITMAP -#undef DEBUG_CARET -#undef DEBUG_CDAUDIO -#undef DEBUG_CLASS -#undef DEBUG_CLIPBOARD -#undef DEBUG_CLIPPING -#undef DEBUG_COMBO -#undef DEBUG_COMM -#undef DEBUG_COMMDLG -#undef DEBUG_CRTDLL -#undef DEBUG_CURSOR -#undef DEBUG_DC -#undef DEBUG_DDE -#undef DEBUG_DDRAW -#undef DEBUG_DIALOG -#undef DEBUG_DLL -#undef DEBUG_DOSFS -#undef DEBUG_DRIVER -#undef DEBUG_DSOUND -#undef DEBUG_EDIT -#undef DEBUG_EVENT -#undef DEBUG_EXEC -#undef DEBUG_FILE -#undef DEBUG_FIXUP -#undef DEBUG_FONT -#undef DEBUG_GDI -#undef DEBUG_GLOBAL -#undef DEBUG_GRAPHICS -#undef DEBUG_HEAP -#undef DEBUG_HOOK -#undef DEBUG_ICON -#undef DEBUG_INT -#undef DEBUG_KEY -#undef DEBUG_KEYBOARD -#undef DEBUG_LDT -#undef DEBUG_LISTBOX -#undef DEBUG_LOCAL -#undef DEBUG_MCI -#undef DEBUG_MCIANIM -#undef DEBUG_MCIWAVE -#undef DEBUG_MDI -#undef DEBUG_MENU -#undef DEBUG_MESSAGE -#undef DEBUG_METAFILE -#undef DEBUG_MIDI -#undef DEBUG_MMAUX -#undef DEBUG_MMIO -#undef DEBUG_MMSYS -#undef DEBUG_MMTIME -#undef DEBUG_MODULE -#undef DEBUG_MSG -#undef DEBUG_NONCLIENT -#undef DEBUG_OLE -#undef DEBUG_PALETTE -#undef DEBUG_PROFILE -#undef DEBUG_PROGRESS -#undef DEBUG_PROP -#undef DEBUG_REG -#undef DEBUG_REGION -#undef DEBUG_RELAY -#undef DEBUG_RESOURCE -#undef DEBUG_SCROLL -#undef DEBUG_SELECTOR -#undef DEBUG_SEM -#undef DEBUG_SENDMSG -#undef DEBUG_SHM -#undef DEBUG_STRESS -#undef DEBUG_STRING -#undef DEBUG_TASK -#undef DEBUG_TEXT -#undef DEBUG_THUNK -#undef DEBUG_TIMER -#undef DEBUG_TOOLHELP -#undef DEBUG_TWEAK -#undef DEBUG_UPDOWN -#undef DEBUG_VER -#undef DEBUG_VIRTUAL -#undef DEBUG_VXD -#undef DEBUG_WIN -#undef DEBUG_WIN16DRV -#undef DEBUG_WIN32 -#undef DEBUG_WINSOCK -#undef DEBUG_X11 -#endif - -#ifdef DEBUG_ALL_EXT -#define DEBUG_ACCEL -#define DEBUG_ASPI -#define DEBUG_ATOM -#define DEBUG_BITBLT -#define DEBUG_BITMAP -#define DEBUG_CARET -#define DEBUG_CDAUDIO -#define DEBUG_CLASS -#define DEBUG_CLIPBOARD -#define DEBUG_CLIPPING -#define DEBUG_COMBO -#define DEBUG_COMM -#define DEBUG_COMMDLG -#define DEBUG_CRTDLL -#define DEBUG_CURSOR -#define DEBUG_DC -#define DEBUG_DDE -#define DEBUG_DDRAW -#define DEBUG_DIALOG -#define DEBUG_DLL -#define DEBUG_DOSFS -#define DEBUG_DRIVER -#define DEBUG_DSOUND -#define DEBUG_EDIT -#define DEBUG_EVENT -#define DEBUG_EXEC -#define DEBUG_FILE -#define DEBUG_FIXUP -#define DEBUG_FONT -#define DEBUG_GDI -#define DEBUG_GLOBAL -#define DEBUG_GRAPHICS -#define DEBUG_HEAP -#define DEBUG_HOOK -#define DEBUG_ICON -#define DEBUG_INT -#define DEBUG_KEY -#define DEBUG_KEYBOARD -#define DEBUG_LDT -#define DEBUG_LISTBOX -#define DEBUG_LOCAL -#define DEBUG_MCI -#define DEBUG_MCIANIM -#define DEBUG_MCIWAVE -#define DEBUG_MDI -#define DEBUG_MENU -#define DEBUG_MESSAGE -#define DEBUG_METAFILE -#define DEBUG_MIDI -#define DEBUG_MMAUX -#define DEBUG_MMIO -#define DEBUG_MMSYS -#define DEBUG_MMTIME -#define DEBUG_MODULE -#define DEBUG_MSG -#define DEBUG_NONCLIENT -#define DEBUG_OLE -#define DEBUG_PALETTE -#define DEBUG_PROFILE -#define DEBUG_PROGRESS -#define DEBUG_PROP -#define DEBUG_REG -#define DEBUG_REGION -#define DEBUG_RELAY -#define DEBUG_RESOURCE -#define DEBUG_SCROLL -#define DEBUG_SELECTOR -#define DEBUG_SEM -#define DEBUG_SENDMSG -#define DEBUG_SHM -#define DEBUG_STRESS -#define DEBUG_STRING -#define DEBUG_TASK -#define DEBUG_TEXT -#define DEBUG_THUNK -#define DEBUG_TIMER -#define DEBUG_TOOLHELP -#define DEBUG_TWEAK -#define DEBUG_UPDOWN -#define DEBUG_VER -#define DEBUG_VIRTUAL -#define DEBUG_VXD -#define DEBUG_WIN -#define DEBUG_WIN16DRV -#define DEBUG_WIN32 -#define DEBUG_WINSOCK -#define DEBUG_X11 -#endif - -#ifdef DEBUG_RUNTIME -#ifdef DEBUG_DEFINE_VARIABLES -short debug_msg_enabled[]={ -#ifdef DEBUG_ACCEL - 1, -#else - 0, -#endif -#ifdef DEBUG_ASPI - 1, -#else - 0, -#endif -#ifdef DEBUG_ATOM - 1, -#else - 0, -#endif -#ifdef DEBUG_BITBLT - 1, -#else - 0, -#endif -#ifdef DEBUG_BITMAP - 1, -#else - 0, -#endif -#ifdef DEBUG_CARET - 1, -#else - 0, -#endif -#ifdef DEBUG_CDAUDIO - 1, -#else - 0, -#endif -#ifdef DEBUG_CLASS - 1, -#else - 0, -#endif -#ifdef DEBUG_CLIPBOARD - 1, -#else - 0, -#endif -#ifdef DEBUG_CLIPPING - 1, -#else - 0, -#endif -#ifdef DEBUG_COMBO - 1, -#else - 0, -#endif -#ifdef DEBUG_COMM - 1, -#else - 0, -#endif -#ifdef DEBUG_COMMDLG - 1, -#else - 0, -#endif -#ifdef DEBUG_CRTDLL - 1, -#else - 0, -#endif -#ifdef DEBUG_CURSOR - 1, -#else - 0, -#endif -#ifdef DEBUG_DC - 1, -#else - 0, -#endif -#ifdef DEBUG_DDE - 1, -#else - 0, -#endif -#ifdef DEBUG_DDRAW - 1, -#else - 0, -#endif -#ifdef DEBUG_DIALOG - 1, -#else - 0, -#endif -#ifdef DEBUG_DLL - 1, -#else - 0, -#endif -#ifdef DEBUG_DOSFS - 1, -#else - 0, -#endif -#ifdef DEBUG_DRIVER - 1, -#else - 0, -#endif -#ifdef DEBUG_DSOUND - 1, -#else - 0, -#endif -#ifdef DEBUG_EDIT - 1, -#else - 0, -#endif -#ifdef DEBUG_EVENT - 1, -#else - 0, -#endif -#ifdef DEBUG_EXEC - 1, -#else - 0, -#endif -#ifdef DEBUG_FILE - 1, -#else - 0, -#endif -#ifdef DEBUG_FIXUP - 1, -#else - 0, -#endif -#ifdef DEBUG_FONT - 1, -#else - 0, -#endif -#ifdef DEBUG_GDI - 1, -#else - 0, -#endif -#ifdef DEBUG_GLOBAL - 1, -#else - 0, -#endif -#ifdef DEBUG_GRAPHICS - 1, -#else - 0, -#endif -#ifdef DEBUG_HEAP - 1, -#else - 0, -#endif -#ifdef DEBUG_HOOK - 1, -#else - 0, -#endif -#ifdef DEBUG_ICON - 1, -#else - 0, -#endif -#ifdef DEBUG_INT - 1, -#else - 0, -#endif -#ifdef DEBUG_KEY - 1, -#else - 0, -#endif -#ifdef DEBUG_KEYBOARD - 1, -#else - 0, -#endif -#ifdef DEBUG_LDT - 1, -#else - 0, -#endif -#ifdef DEBUG_LISTBOX - 1, -#else - 0, -#endif -#ifdef DEBUG_LOCAL - 1, -#else - 0, -#endif -#ifdef DEBUG_MCI - 1, -#else - 0, -#endif -#ifdef DEBUG_MCIANIM - 1, -#else - 0, -#endif -#ifdef DEBUG_MCIWAVE - 1, -#else - 0, -#endif -#ifdef DEBUG_MDI - 1, -#else - 0, -#endif -#ifdef DEBUG_MENU - 1, -#else - 0, -#endif -#ifdef DEBUG_MESSAGE - 1, -#else - 0, -#endif -#ifdef DEBUG_METAFILE - 1, -#else - 0, -#endif -#ifdef DEBUG_MIDI - 1, -#else - 0, -#endif -#ifdef DEBUG_MMAUX - 1, -#else - 0, -#endif -#ifdef DEBUG_MMIO - 1, -#else - 0, -#endif -#ifdef DEBUG_MMSYS - 1, -#else - 0, -#endif -#ifdef DEBUG_MMTIME - 1, -#else - 0, -#endif -#ifdef DEBUG_MODULE - 1, -#else - 0, -#endif -#ifdef DEBUG_MSG - 1, -#else - 0, -#endif -#ifdef DEBUG_NONCLIENT - 1, -#else - 0, -#endif -#ifdef DEBUG_OLE - 1, -#else - 0, -#endif -#ifdef DEBUG_PALETTE - 1, -#else - 0, -#endif -#ifdef DEBUG_PROFILE - 1, -#else - 0, -#endif -#ifdef DEBUG_PROGRESS - 1, -#else - 0, -#endif -#ifdef DEBUG_PROP - 1, -#else - 0, -#endif -#ifdef DEBUG_REG - 1, -#else - 0, -#endif -#ifdef DEBUG_REGION - 1, -#else - 0, -#endif -#ifdef DEBUG_RELAY - 1, -#else - 0, -#endif -#ifdef DEBUG_RESOURCE - 1, -#else - 0, -#endif -#ifdef DEBUG_SCROLL - 1, -#else - 0, -#endif -#ifdef DEBUG_SELECTOR - 1, -#else - 0, -#endif -#ifdef DEBUG_SEM - 1, -#else - 0, -#endif -#ifdef DEBUG_SENDMSG - 1, -#else - 0, -#endif -#ifdef DEBUG_SHM - 1, -#else - 0, -#endif -#ifdef DEBUG_STRESS - 1, -#else - 0, -#endif -#ifdef DEBUG_STRING - 1, -#else - 0, -#endif -#ifdef DEBUG_TASK - 1, -#else - 0, -#endif -#ifdef DEBUG_TEXT - 1, -#else - 0, -#endif -#ifdef DEBUG_THUNK - 1, -#else - 0, -#endif -#ifdef DEBUG_TIMER - 1, -#else - 0, -#endif -#ifdef DEBUG_TOOLHELP - 1, -#else - 0, -#endif -#ifdef DEBUG_TWEAK - 1, -#else - 0, -#endif -#ifdef DEBUG_UPDOWN - 1, -#else - 0, -#endif -#ifdef DEBUG_VER - 1, -#else - 0, -#endif -#ifdef DEBUG_VIRTUAL - 1, -#else - 0, -#endif -#ifdef DEBUG_VXD - 1, -#else - 0, -#endif -#ifdef DEBUG_WIN - 1, -#else - 0, -#endif -#ifdef DEBUG_WIN16DRV - 1, -#else - 0, -#endif -#ifdef DEBUG_WIN32 - 1, -#else - 0, -#endif -#ifdef DEBUG_WINSOCK - 1, -#else - 0, -#endif -#ifdef DEBUG_X11 - 1, -#else - 0, -#endif - 0 -}; -#else -extern short debug_msg_enabled[]; -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_accel if(!debug_msg_enabled[0]) ; else fprintf -#define debugging_accel debug_msg_enabled[0] -#else -#ifdef DEBUG_ACCEL -#define dprintf_accel fprintf -#define debugging_accel 1 -#else -#define dprintf_accel while(0) fprintf -#define debugging_accel 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_aspi if(!debug_msg_enabled[1]) ; else fprintf -#define debugging_aspi debug_msg_enabled[1] -#else -#ifdef DEBUG_ASPI -#define dprintf_aspi fprintf -#define debugging_aspi 1 -#else -#define dprintf_aspi while(0) fprintf -#define debugging_aspi 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_atom if(!debug_msg_enabled[2]) ; else fprintf -#define debugging_atom debug_msg_enabled[2] -#else -#ifdef DEBUG_ATOM -#define dprintf_atom fprintf -#define debugging_atom 1 -#else -#define dprintf_atom while(0) fprintf -#define debugging_atom 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_bitblt if(!debug_msg_enabled[3]) ; else fprintf -#define debugging_bitblt debug_msg_enabled[3] -#else -#ifdef DEBUG_BITBLT -#define dprintf_bitblt fprintf -#define debugging_bitblt 1 -#else -#define dprintf_bitblt while(0) fprintf -#define debugging_bitblt 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_bitmap if(!debug_msg_enabled[4]) ; else fprintf -#define debugging_bitmap debug_msg_enabled[4] -#else -#ifdef DEBUG_BITMAP -#define dprintf_bitmap fprintf -#define debugging_bitmap 1 -#else -#define dprintf_bitmap while(0) fprintf -#define debugging_bitmap 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_caret if(!debug_msg_enabled[5]) ; else fprintf -#define debugging_caret debug_msg_enabled[5] -#else -#ifdef DEBUG_CARET -#define dprintf_caret fprintf -#define debugging_caret 1 -#else -#define dprintf_caret while(0) fprintf -#define debugging_caret 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_cdaudio if(!debug_msg_enabled[6]) ; else fprintf -#define debugging_cdaudio debug_msg_enabled[6] -#else -#ifdef DEBUG_CDAUDIO -#define dprintf_cdaudio fprintf -#define debugging_cdaudio 1 -#else -#define dprintf_cdaudio while(0) fprintf -#define debugging_cdaudio 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_class if(!debug_msg_enabled[7]) ; else fprintf -#define debugging_class debug_msg_enabled[7] -#else -#ifdef DEBUG_CLASS -#define dprintf_class fprintf -#define debugging_class 1 -#else -#define dprintf_class while(0) fprintf -#define debugging_class 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_clipboard if(!debug_msg_enabled[8]) ; else fprintf -#define debugging_clipboard debug_msg_enabled[8] -#else -#ifdef DEBUG_CLIPBOARD -#define dprintf_clipboard fprintf -#define debugging_clipboard 1 -#else -#define dprintf_clipboard while(0) fprintf -#define debugging_clipboard 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_clipping if(!debug_msg_enabled[9]) ; else fprintf -#define debugging_clipping debug_msg_enabled[9] -#else -#ifdef DEBUG_CLIPPING -#define dprintf_clipping fprintf -#define debugging_clipping 1 -#else -#define dprintf_clipping while(0) fprintf -#define debugging_clipping 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_combo if(!debug_msg_enabled[10]) ; else fprintf -#define debugging_combo debug_msg_enabled[10] -#else -#ifdef DEBUG_COMBO -#define dprintf_combo fprintf -#define debugging_combo 1 -#else -#define dprintf_combo while(0) fprintf -#define debugging_combo 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_comm if(!debug_msg_enabled[11]) ; else fprintf -#define debugging_comm debug_msg_enabled[11] -#else -#ifdef DEBUG_COMM -#define dprintf_comm fprintf -#define debugging_comm 1 -#else -#define dprintf_comm while(0) fprintf -#define debugging_comm 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_commdlg if(!debug_msg_enabled[12]) ; else fprintf -#define debugging_commdlg debug_msg_enabled[12] -#else -#ifdef DEBUG_COMMDLG -#define dprintf_commdlg fprintf -#define debugging_commdlg 1 -#else -#define dprintf_commdlg while(0) fprintf -#define debugging_commdlg 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_crtdll if(!debug_msg_enabled[13]) ; else fprintf -#define debugging_crtdll debug_msg_enabled[13] -#else -#ifdef DEBUG_CRTDLL -#define dprintf_crtdll fprintf -#define debugging_crtdll 1 -#else -#define dprintf_crtdll while(0) fprintf -#define debugging_crtdll 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_cursor if(!debug_msg_enabled[14]) ; else fprintf -#define debugging_cursor debug_msg_enabled[14] -#else -#ifdef DEBUG_CURSOR -#define dprintf_cursor fprintf -#define debugging_cursor 1 -#else -#define dprintf_cursor while(0) fprintf -#define debugging_cursor 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_dc if(!debug_msg_enabled[15]) ; else fprintf -#define debugging_dc debug_msg_enabled[15] -#else -#ifdef DEBUG_DC -#define dprintf_dc fprintf -#define debugging_dc 1 -#else -#define dprintf_dc while(0) fprintf -#define debugging_dc 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_dde if(!debug_msg_enabled[16]) ; else fprintf -#define debugging_dde debug_msg_enabled[16] -#else -#ifdef DEBUG_DDE -#define dprintf_dde fprintf -#define debugging_dde 1 -#else -#define dprintf_dde while(0) fprintf -#define debugging_dde 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_ddraw if(!debug_msg_enabled[17]) ; else fprintf -#define debugging_ddraw debug_msg_enabled[17] -#else -#ifdef DEBUG_DDRAW -#define dprintf_ddraw fprintf -#define debugging_ddraw 1 -#else -#define dprintf_ddraw while(0) fprintf -#define debugging_ddraw 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_dialog if(!debug_msg_enabled[18]) ; else fprintf -#define debugging_dialog debug_msg_enabled[18] -#else -#ifdef DEBUG_DIALOG -#define dprintf_dialog fprintf -#define debugging_dialog 1 -#else -#define dprintf_dialog while(0) fprintf -#define debugging_dialog 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_dll if(!debug_msg_enabled[19]) ; else fprintf -#define debugging_dll debug_msg_enabled[19] -#else -#ifdef DEBUG_DLL -#define dprintf_dll fprintf -#define debugging_dll 1 -#else -#define dprintf_dll while(0) fprintf -#define debugging_dll 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_dosfs if(!debug_msg_enabled[20]) ; else fprintf -#define debugging_dosfs debug_msg_enabled[20] -#else -#ifdef DEBUG_DOSFS -#define dprintf_dosfs fprintf -#define debugging_dosfs 1 -#else -#define dprintf_dosfs while(0) fprintf -#define debugging_dosfs 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_driver if(!debug_msg_enabled[21]) ; else fprintf -#define debugging_driver debug_msg_enabled[21] -#else -#ifdef DEBUG_DRIVER -#define dprintf_driver fprintf -#define debugging_driver 1 -#else -#define dprintf_driver while(0) fprintf -#define debugging_driver 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_dsound if(!debug_msg_enabled[22]) ; else fprintf -#define debugging_dsound debug_msg_enabled[22] -#else -#ifdef DEBUG_DSOUND -#define dprintf_dsound fprintf -#define debugging_dsound 1 -#else -#define dprintf_dsound while(0) fprintf -#define debugging_dsound 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_edit if(!debug_msg_enabled[23]) ; else fprintf -#define debugging_edit debug_msg_enabled[23] -#else -#ifdef DEBUG_EDIT -#define dprintf_edit fprintf -#define debugging_edit 1 -#else -#define dprintf_edit while(0) fprintf -#define debugging_edit 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_event if(!debug_msg_enabled[24]) ; else fprintf -#define debugging_event debug_msg_enabled[24] -#else -#ifdef DEBUG_EVENT -#define dprintf_event fprintf -#define debugging_event 1 -#else -#define dprintf_event while(0) fprintf -#define debugging_event 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_exec if(!debug_msg_enabled[25]) ; else fprintf -#define debugging_exec debug_msg_enabled[25] -#else -#ifdef DEBUG_EXEC -#define dprintf_exec fprintf -#define debugging_exec 1 -#else -#define dprintf_exec while(0) fprintf -#define debugging_exec 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_file if(!debug_msg_enabled[26]) ; else fprintf -#define debugging_file debug_msg_enabled[26] -#else -#ifdef DEBUG_FILE -#define dprintf_file fprintf -#define debugging_file 1 -#else -#define dprintf_file while(0) fprintf -#define debugging_file 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_fixup if(!debug_msg_enabled[27]) ; else fprintf -#define debugging_fixup debug_msg_enabled[27] -#else -#ifdef DEBUG_FIXUP -#define dprintf_fixup fprintf -#define debugging_fixup 1 -#else -#define dprintf_fixup while(0) fprintf -#define debugging_fixup 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_font if(!debug_msg_enabled[28]) ; else fprintf -#define debugging_font debug_msg_enabled[28] -#else -#ifdef DEBUG_FONT -#define dprintf_font fprintf -#define debugging_font 1 -#else -#define dprintf_font while(0) fprintf -#define debugging_font 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_gdi if(!debug_msg_enabled[29]) ; else fprintf -#define debugging_gdi debug_msg_enabled[29] -#else -#ifdef DEBUG_GDI -#define dprintf_gdi fprintf -#define debugging_gdi 1 -#else -#define dprintf_gdi while(0) fprintf -#define debugging_gdi 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_global if(!debug_msg_enabled[30]) ; else fprintf -#define debugging_global debug_msg_enabled[30] -#else -#ifdef DEBUG_GLOBAL -#define dprintf_global fprintf -#define debugging_global 1 -#else -#define dprintf_global while(0) fprintf -#define debugging_global 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_graphics if(!debug_msg_enabled[31]) ; else fprintf -#define debugging_graphics debug_msg_enabled[31] -#else -#ifdef DEBUG_GRAPHICS -#define dprintf_graphics fprintf -#define debugging_graphics 1 -#else -#define dprintf_graphics while(0) fprintf -#define debugging_graphics 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_heap if(!debug_msg_enabled[32]) ; else fprintf -#define debugging_heap debug_msg_enabled[32] -#else -#ifdef DEBUG_HEAP -#define dprintf_heap fprintf -#define debugging_heap 1 -#else -#define dprintf_heap while(0) fprintf -#define debugging_heap 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_hook if(!debug_msg_enabled[33]) ; else fprintf -#define debugging_hook debug_msg_enabled[33] -#else -#ifdef DEBUG_HOOK -#define dprintf_hook fprintf -#define debugging_hook 1 -#else -#define dprintf_hook while(0) fprintf -#define debugging_hook 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_icon if(!debug_msg_enabled[34]) ; else fprintf -#define debugging_icon debug_msg_enabled[34] -#else -#ifdef DEBUG_ICON -#define dprintf_icon fprintf -#define debugging_icon 1 -#else -#define dprintf_icon while(0) fprintf -#define debugging_icon 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_int if(!debug_msg_enabled[35]) ; else fprintf -#define debugging_int debug_msg_enabled[35] -#else -#ifdef DEBUG_INT -#define dprintf_int fprintf -#define debugging_int 1 -#else -#define dprintf_int while(0) fprintf -#define debugging_int 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_key if(!debug_msg_enabled[36]) ; else fprintf -#define debugging_key debug_msg_enabled[36] -#else -#ifdef DEBUG_KEY -#define dprintf_key fprintf -#define debugging_key 1 -#else -#define dprintf_key while(0) fprintf -#define debugging_key 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_keyboard if(!debug_msg_enabled[37]) ; else fprintf -#define debugging_keyboard debug_msg_enabled[37] -#else -#ifdef DEBUG_KEYBOARD -#define dprintf_keyboard fprintf -#define debugging_keyboard 1 -#else -#define dprintf_keyboard while(0) fprintf -#define debugging_keyboard 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_ldt if(!debug_msg_enabled[38]) ; else fprintf -#define debugging_ldt debug_msg_enabled[38] -#else -#ifdef DEBUG_LDT -#define dprintf_ldt fprintf -#define debugging_ldt 1 -#else -#define dprintf_ldt while(0) fprintf -#define debugging_ldt 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_listbox if(!debug_msg_enabled[39]) ; else fprintf -#define debugging_listbox debug_msg_enabled[39] -#else -#ifdef DEBUG_LISTBOX -#define dprintf_listbox fprintf -#define debugging_listbox 1 -#else -#define dprintf_listbox while(0) fprintf -#define debugging_listbox 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_local if(!debug_msg_enabled[40]) ; else fprintf -#define debugging_local debug_msg_enabled[40] -#else -#ifdef DEBUG_LOCAL -#define dprintf_local fprintf -#define debugging_local 1 -#else -#define dprintf_local while(0) fprintf -#define debugging_local 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mci if(!debug_msg_enabled[41]) ; else fprintf -#define debugging_mci debug_msg_enabled[41] -#else -#ifdef DEBUG_MCI -#define dprintf_mci fprintf -#define debugging_mci 1 -#else -#define dprintf_mci while(0) fprintf -#define debugging_mci 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mcianim if(!debug_msg_enabled[42]) ; else fprintf -#define debugging_mcianim debug_msg_enabled[42] -#else -#ifdef DEBUG_MCIANIM -#define dprintf_mcianim fprintf -#define debugging_mcianim 1 -#else -#define dprintf_mcianim while(0) fprintf -#define debugging_mcianim 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mciwave if(!debug_msg_enabled[43]) ; else fprintf -#define debugging_mciwave debug_msg_enabled[43] -#else -#ifdef DEBUG_MCIWAVE -#define dprintf_mciwave fprintf -#define debugging_mciwave 1 -#else -#define dprintf_mciwave while(0) fprintf -#define debugging_mciwave 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mdi if(!debug_msg_enabled[44]) ; else fprintf -#define debugging_mdi debug_msg_enabled[44] -#else -#ifdef DEBUG_MDI -#define dprintf_mdi fprintf -#define debugging_mdi 1 -#else -#define dprintf_mdi while(0) fprintf -#define debugging_mdi 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_menu if(!debug_msg_enabled[45]) ; else fprintf -#define debugging_menu debug_msg_enabled[45] -#else -#ifdef DEBUG_MENU -#define dprintf_menu fprintf -#define debugging_menu 1 -#else -#define dprintf_menu while(0) fprintf -#define debugging_menu 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_message if(!debug_msg_enabled[46]) ; else fprintf -#define debugging_message debug_msg_enabled[46] -#else -#ifdef DEBUG_MESSAGE -#define dprintf_message fprintf -#define debugging_message 1 -#else -#define dprintf_message while(0) fprintf -#define debugging_message 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_metafile if(!debug_msg_enabled[47]) ; else fprintf -#define debugging_metafile debug_msg_enabled[47] -#else -#ifdef DEBUG_METAFILE -#define dprintf_metafile fprintf -#define debugging_metafile 1 -#else -#define dprintf_metafile while(0) fprintf -#define debugging_metafile 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_midi if(!debug_msg_enabled[48]) ; else fprintf -#define debugging_midi debug_msg_enabled[48] -#else -#ifdef DEBUG_MIDI -#define dprintf_midi fprintf -#define debugging_midi 1 -#else -#define dprintf_midi while(0) fprintf -#define debugging_midi 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mmaux if(!debug_msg_enabled[49]) ; else fprintf -#define debugging_mmaux debug_msg_enabled[49] -#else -#ifdef DEBUG_MMAUX -#define dprintf_mmaux fprintf -#define debugging_mmaux 1 -#else -#define dprintf_mmaux while(0) fprintf -#define debugging_mmaux 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mmio if(!debug_msg_enabled[50]) ; else fprintf -#define debugging_mmio debug_msg_enabled[50] -#else -#ifdef DEBUG_MMIO -#define dprintf_mmio fprintf -#define debugging_mmio 1 -#else -#define dprintf_mmio while(0) fprintf -#define debugging_mmio 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mmsys if(!debug_msg_enabled[51]) ; else fprintf -#define debugging_mmsys debug_msg_enabled[51] -#else -#ifdef DEBUG_MMSYS -#define dprintf_mmsys fprintf -#define debugging_mmsys 1 -#else -#define dprintf_mmsys while(0) fprintf -#define debugging_mmsys 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_mmtime if(!debug_msg_enabled[52]) ; else fprintf -#define debugging_mmtime debug_msg_enabled[52] -#else -#ifdef DEBUG_MMTIME -#define dprintf_mmtime fprintf -#define debugging_mmtime 1 -#else -#define dprintf_mmtime while(0) fprintf -#define debugging_mmtime 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_module if(!debug_msg_enabled[53]) ; else fprintf -#define debugging_module debug_msg_enabled[53] -#else -#ifdef DEBUG_MODULE -#define dprintf_module fprintf -#define debugging_module 1 -#else -#define dprintf_module while(0) fprintf -#define debugging_module 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_msg if(!debug_msg_enabled[54]) ; else fprintf -#define debugging_msg debug_msg_enabled[54] -#else -#ifdef DEBUG_MSG -#define dprintf_msg fprintf -#define debugging_msg 1 -#else -#define dprintf_msg while(0) fprintf -#define debugging_msg 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_nonclient if(!debug_msg_enabled[55]) ; else fprintf -#define debugging_nonclient debug_msg_enabled[55] -#else -#ifdef DEBUG_NONCLIENT -#define dprintf_nonclient fprintf -#define debugging_nonclient 1 -#else -#define dprintf_nonclient while(0) fprintf -#define debugging_nonclient 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_ole if(!debug_msg_enabled[56]) ; else fprintf -#define debugging_ole debug_msg_enabled[56] -#else -#ifdef DEBUG_OLE -#define dprintf_ole fprintf -#define debugging_ole 1 -#else -#define dprintf_ole while(0) fprintf -#define debugging_ole 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_palette if(!debug_msg_enabled[57]) ; else fprintf -#define debugging_palette debug_msg_enabled[57] -#else -#ifdef DEBUG_PALETTE -#define dprintf_palette fprintf -#define debugging_palette 1 -#else -#define dprintf_palette while(0) fprintf -#define debugging_palette 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_profile if(!debug_msg_enabled[58]) ; else fprintf -#define debugging_profile debug_msg_enabled[58] -#else -#ifdef DEBUG_PROFILE -#define dprintf_profile fprintf -#define debugging_profile 1 -#else -#define dprintf_profile while(0) fprintf -#define debugging_profile 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_progress if(!debug_msg_enabled[59]) ; else fprintf -#define debugging_progress debug_msg_enabled[59] -#else -#ifdef DEBUG_PROGRESS -#define dprintf_progress fprintf -#define debugging_progress 1 -#else -#define dprintf_progress while(0) fprintf -#define debugging_progress 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_prop if(!debug_msg_enabled[60]) ; else fprintf -#define debugging_prop debug_msg_enabled[60] -#else -#ifdef DEBUG_PROP -#define dprintf_prop fprintf -#define debugging_prop 1 -#else -#define dprintf_prop while(0) fprintf -#define debugging_prop 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_reg if(!debug_msg_enabled[61]) ; else fprintf -#define debugging_reg debug_msg_enabled[61] -#else -#ifdef DEBUG_REG -#define dprintf_reg fprintf -#define debugging_reg 1 -#else -#define dprintf_reg while(0) fprintf -#define debugging_reg 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_region if(!debug_msg_enabled[62]) ; else fprintf -#define debugging_region debug_msg_enabled[62] -#else -#ifdef DEBUG_REGION -#define dprintf_region fprintf -#define debugging_region 1 -#else -#define dprintf_region while(0) fprintf -#define debugging_region 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_relay if(!debug_msg_enabled[63]) ; else fprintf -#define debugging_relay debug_msg_enabled[63] -#else -#ifdef DEBUG_RELAY -#define dprintf_relay fprintf -#define debugging_relay 1 -#else -#define dprintf_relay while(0) fprintf -#define debugging_relay 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_resource if(!debug_msg_enabled[64]) ; else fprintf -#define debugging_resource debug_msg_enabled[64] -#else -#ifdef DEBUG_RESOURCE -#define dprintf_resource fprintf -#define debugging_resource 1 -#else -#define dprintf_resource while(0) fprintf -#define debugging_resource 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_scroll if(!debug_msg_enabled[65]) ; else fprintf -#define debugging_scroll debug_msg_enabled[65] -#else -#ifdef DEBUG_SCROLL -#define dprintf_scroll fprintf -#define debugging_scroll 1 -#else -#define dprintf_scroll while(0) fprintf -#define debugging_scroll 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_selector if(!debug_msg_enabled[66]) ; else fprintf -#define debugging_selector debug_msg_enabled[66] -#else -#ifdef DEBUG_SELECTOR -#define dprintf_selector fprintf -#define debugging_selector 1 -#else -#define dprintf_selector while(0) fprintf -#define debugging_selector 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_sem if(!debug_msg_enabled[67]) ; else fprintf -#define debugging_sem debug_msg_enabled[67] -#else -#ifdef DEBUG_SEM -#define dprintf_sem fprintf -#define debugging_sem 1 -#else -#define dprintf_sem while(0) fprintf -#define debugging_sem 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_sendmsg if(!debug_msg_enabled[68]) ; else fprintf -#define debugging_sendmsg debug_msg_enabled[68] -#else -#ifdef DEBUG_SENDMSG -#define dprintf_sendmsg fprintf -#define debugging_sendmsg 1 -#else -#define dprintf_sendmsg while(0) fprintf -#define debugging_sendmsg 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_shm if(!debug_msg_enabled[69]) ; else fprintf -#define debugging_shm debug_msg_enabled[69] -#else -#ifdef DEBUG_SHM -#define dprintf_shm fprintf -#define debugging_shm 1 -#else -#define dprintf_shm while(0) fprintf -#define debugging_shm 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_stress if(!debug_msg_enabled[70]) ; else fprintf -#define debugging_stress debug_msg_enabled[70] -#else -#ifdef DEBUG_STRESS -#define dprintf_stress fprintf -#define debugging_stress 1 -#else -#define dprintf_stress while(0) fprintf -#define debugging_stress 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_string if(!debug_msg_enabled[71]) ; else fprintf -#define debugging_string debug_msg_enabled[71] -#else -#ifdef DEBUG_STRING -#define dprintf_string fprintf -#define debugging_string 1 -#else -#define dprintf_string while(0) fprintf -#define debugging_string 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_task if(!debug_msg_enabled[72]) ; else fprintf -#define debugging_task debug_msg_enabled[72] -#else -#ifdef DEBUG_TASK -#define dprintf_task fprintf -#define debugging_task 1 -#else -#define dprintf_task while(0) fprintf -#define debugging_task 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_text if(!debug_msg_enabled[73]) ; else fprintf -#define debugging_text debug_msg_enabled[73] -#else -#ifdef DEBUG_TEXT -#define dprintf_text fprintf -#define debugging_text 1 -#else -#define dprintf_text while(0) fprintf -#define debugging_text 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_thunk if(!debug_msg_enabled[74]) ; else fprintf -#define debugging_thunk debug_msg_enabled[74] -#else -#ifdef DEBUG_THUNK -#define dprintf_thunk fprintf -#define debugging_thunk 1 -#else -#define dprintf_thunk while(0) fprintf -#define debugging_thunk 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_timer if(!debug_msg_enabled[75]) ; else fprintf -#define debugging_timer debug_msg_enabled[75] -#else -#ifdef DEBUG_TIMER -#define dprintf_timer fprintf -#define debugging_timer 1 -#else -#define dprintf_timer while(0) fprintf -#define debugging_timer 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_toolhelp if(!debug_msg_enabled[76]) ; else fprintf -#define debugging_toolhelp debug_msg_enabled[76] -#else -#ifdef DEBUG_TOOLHELP -#define dprintf_toolhelp fprintf -#define debugging_toolhelp 1 -#else -#define dprintf_toolhelp while(0) fprintf -#define debugging_toolhelp 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_tweak if(!debug_msg_enabled[77]) ; else fprintf -#define debugging_tweak debug_msg_enabled[77] -#else -#ifdef DEBUG_TWEAK -#define dprintf_tweak fprintf -#define debugging_tweak 1 -#else -#define dprintf_tweak while(0) fprintf -#define debugging_tweak 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_updown if(!debug_msg_enabled[78]) ; else fprintf -#define debugging_updown debug_msg_enabled[78] -#else -#ifdef DEBUG_UPDOWN -#define dprintf_updown fprintf -#define debugging_updown 1 -#else -#define dprintf_updown while(0) fprintf -#define debugging_updown 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_ver if(!debug_msg_enabled[79]) ; else fprintf -#define debugging_ver debug_msg_enabled[79] -#else -#ifdef DEBUG_VER -#define dprintf_ver fprintf -#define debugging_ver 1 -#else -#define dprintf_ver while(0) fprintf -#define debugging_ver 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_virtual if(!debug_msg_enabled[80]) ; else fprintf -#define debugging_virtual debug_msg_enabled[80] -#else -#ifdef DEBUG_VIRTUAL -#define dprintf_virtual fprintf -#define debugging_virtual 1 -#else -#define dprintf_virtual while(0) fprintf -#define debugging_virtual 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_vxd if(!debug_msg_enabled[81]) ; else fprintf -#define debugging_vxd debug_msg_enabled[81] -#else -#ifdef DEBUG_VXD -#define dprintf_vxd fprintf -#define debugging_vxd 1 -#else -#define dprintf_vxd while(0) fprintf -#define debugging_vxd 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_win if(!debug_msg_enabled[82]) ; else fprintf -#define debugging_win debug_msg_enabled[82] -#else -#ifdef DEBUG_WIN -#define dprintf_win fprintf -#define debugging_win 1 -#else -#define dprintf_win while(0) fprintf -#define debugging_win 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_win16drv if(!debug_msg_enabled[83]) ; else fprintf -#define debugging_win16drv debug_msg_enabled[83] -#else -#ifdef DEBUG_WIN16DRV -#define dprintf_win16drv fprintf -#define debugging_win16drv 1 -#else -#define dprintf_win16drv while(0) fprintf -#define debugging_win16drv 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_win32 if(!debug_msg_enabled[84]) ; else fprintf -#define debugging_win32 debug_msg_enabled[84] -#else -#ifdef DEBUG_WIN32 -#define dprintf_win32 fprintf -#define debugging_win32 1 -#else -#define dprintf_win32 while(0) fprintf -#define debugging_win32 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_winsock if(!debug_msg_enabled[85]) ; else fprintf -#define debugging_winsock debug_msg_enabled[85] -#else -#ifdef DEBUG_WINSOCK -#define dprintf_winsock fprintf -#define debugging_winsock 1 -#else -#define dprintf_winsock while(0) fprintf -#define debugging_winsock 0 -#endif -#endif - -#ifdef DEBUG_RUNTIME -#define dprintf_x11 if(!debug_msg_enabled[86]) ; else fprintf -#define debugging_x11 debug_msg_enabled[86] -#else -#ifdef DEBUG_X11 -#define dprintf_x11 fprintf -#define debugging_x11 1 -#else -#define dprintf_x11 while(0) fprintf -#define debugging_x11 0 -#endif -#endif - - -#ifdef DEBUG_RUNTIME -#ifdef DEBUG_DEFINE_VARIABLES -static char *debug_msg_name[] = { - "accel", - "aspi", - "atom", - "bitblt", - "bitmap", - "caret", - "cdaudio", - "class", - "clipboard", - "clipping", - "combo", - "comm", - "commdlg", - "crtdll", - "cursor", - "dc", - "dde", - "ddraw", - "dialog", - "dll", - "dosfs", - "driver", - "dsound", - "edit", - "event", - "exec", - "file", - "fixup", - "font", - "gdi", - "global", - "graphics", - "heap", - "hook", - "icon", - "int", - "key", - "keyboard", - "ldt", - "listbox", - "local", - "mci", - "mcianim", - "mciwave", - "mdi", - "menu", - "message", - "metafile", - "midi", - "mmaux", - "mmio", - "mmsys", - "mmtime", - "module", - "msg", - "nonclient", - "ole", - "palette", - "profile", - "progress", - "prop", - "reg", - "region", - "relay", - "resource", - "scroll", - "selector", - "sem", - "sendmsg", - "shm", - "stress", - "string", - "task", - "text", - "thunk", - "timer", - "toolhelp", - "tweak", - "updown", - "ver", - "virtual", - "vxd", - "win", - "win16drv", - "win32", - "winsock", - "x11", - "" -}; -#endif -#endif +/* Do not modify this file -- it is automatically generated! */ + +#ifndef __DEBUGTOOLS_H +#include "debugtools.h" +#endif + +#define dbch_accel 0 +#define dbch_aspi 1 +#define dbch_atom 2 +#define dbch_bitblt 3 +#define dbch_bitmap 4 +#define dbch_caret 5 +#define dbch_cdaudio 6 +#define dbch_class 7 +#define dbch_clipboard 8 +#define dbch_clipping 9 +#define dbch_combo 10 +#define dbch_comm 11 +#define dbch_commdlg 12 +#define dbch_console 13 +#define dbch_crtdll 14 +#define dbch_cursor 15 +#define dbch_dc 16 +#define dbch_dde 17 +#define dbch_ddraw 18 +#define dbch_dialog 19 +#define dbch_dll 20 +#define dbch_dosfs 21 +#define dbch_driver 22 +#define dbch_dsound 23 +#define dbch_edit 24 +#define dbch_event 25 +#define dbch_exec 26 +#define dbch_file 27 +#define dbch_fixup 28 +#define dbch_font 29 +#define dbch_gdi 30 +#define dbch_global 31 +#define dbch_graphics 32 +#define dbch_heap 33 +#define dbch_hook 34 +#define dbch_icon 35 +#define dbch_int 36 +#define dbch_key 37 +#define dbch_keyboard 38 +#define dbch_ldt 39 +#define dbch_listbox 40 +#define dbch_local 41 +#define dbch_mci 42 +#define dbch_mcianim 43 +#define dbch_mciwave 44 +#define dbch_mdi 45 +#define dbch_menu 46 +#define dbch_message 47 +#define dbch_metafile 48 +#define dbch_midi 49 +#define dbch_mmaux 50 +#define dbch_mmio 51 +#define dbch_mmsys 52 +#define dbch_mmtime 53 +#define dbch_module 54 +#define dbch_msg 55 +#define dbch_nonclient 56 +#define dbch_ole 57 +#define dbch_palette 58 +#define dbch_profile 59 +#define dbch_progress 60 +#define dbch_prop 61 +#define dbch_reg 62 +#define dbch_region 63 +#define dbch_relay 64 +#define dbch_resource 65 +#define dbch_scroll 66 +#define dbch_selector 67 +#define dbch_sem 68 +#define dbch_sendmsg 69 +#define dbch_shm 70 +#define dbch_stddeb 71 +#define dbch_stress 72 +#define dbch_string 73 +#define dbch_task 74 +#define dbch_text 75 +#define dbch_thunk 76 +#define dbch_timer 77 +#define dbch_toolhelp 78 +#define dbch_tweak 79 +#define dbch_updown 80 +#define dbch_ver 81 +#define dbch_virtual 82 +#define dbch_vxd 83 +#define dbch_win 84 +#define dbch_win16drv 85 +#define dbch_win32 86 +#define dbch_winsock 87 +#define dbch_x11 88 diff --git a/include/debugdefs.h b/include/debugdefs.h new file mode 100644 index 00000000000..efa63718702 --- /dev/null +++ b/include/debugdefs.h @@ -0,0 +1,197 @@ +/* Do not modify this file -- it is automatically generated! */ + +#ifndef __DEBUGTOOLS_H +#include "debugtools.h" +#endif + +#define DEBUG_CHANNEL_COUNT 89 +#ifdef DEBUG_RUNTIME +short debug_msg_enabled[][DEBUG_CLASS_COUNT] = { +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +{1, 1, 0, 0}, +}; +const char* debug_ch_name[] = { +"accel", +"aspi", +"atom", +"bitblt", +"bitmap", +"caret", +"cdaudio", +"class", +"clipboard", +"clipping", +"combo", +"comm", +"commdlg", +"console", +"crtdll", +"cursor", +"dc", +"dde", +"ddraw", +"dialog", +"dll", +"dosfs", +"driver", +"dsound", +"edit", +"event", +"exec", +"file", +"fixup", +"font", +"gdi", +"global", +"graphics", +"heap", +"hook", +"icon", +"int", +"key", +"keyboard", +"ldt", +"listbox", +"local", +"mci", +"mcianim", +"mciwave", +"mdi", +"menu", +"message", +"metafile", +"midi", +"mmaux", +"mmio", +"mmsys", +"mmtime", +"module", +"msg", +"nonclient", +"ole", +"palette", +"profile", +"progress", +"prop", +"reg", +"region", +"relay", +"resource", +"scroll", +"selector", +"sem", +"sendmsg", +"shm", +"stddeb", +"stress", +"string", +"task", +"text", +"thunk", +"timer", +"toolhelp", +"tweak", +"updown", +"ver", +"virtual", +"vxd", +"win", +"win16drv", +"win32", +"winsock", +"x11", +}; + +const char* debug_cl_name[] = +{ "fixme", "err", "warn", "info" }; + +#endif /*DEBUG_RUNTIME*/ + +/* end of automatically generated debug.h */ diff --git a/include/debugstr.h b/include/debugstr.h index 20ac865c48a..7bb39967772 100644 --- a/include/debugstr.h +++ b/include/debugstr.h @@ -11,5 +11,8 @@ LPSTR debugstr_an (LPCSTR s, int n); LPSTR debugstr_a (LPCSTR s); LPSTR debugstr_wn (LPCWSTR s, int n); LPSTR debugstr_w (LPCWSTR s); +LPSTR debugres (const void *res); #endif /* __WINE_DEBUGSTR_H */ + + diff --git a/include/debugtools.h b/include/debugtools.h new file mode 100644 index 00000000000..393dd254a81 --- /dev/null +++ b/include/debugtools.h @@ -0,0 +1,66 @@ + +#ifndef __DEBUGTOOLS_H +#define __DEBUGTOOLS_H + +#include + +#define DEBUG_RUNTIME +#define stddeb stdout +#define stdnimp stdout + +#define DEBUG_CLASS_COUNT 4 + +extern short debug_msg_enabled[][DEBUG_CLASS_COUNT]; +extern const char* debug_ch_name[]; +extern const char* debug_cl_name[]; + +#define dbg_str(name) debug_str_##name +#define dbg_buf(name) debug_buf_##name + +#define dbg_decl_str(name, size) \ + char dbg_str(name)[size], *dbg_buf(name)=dbg_str(name) + +#define dbg_reset_str(name) \ + dbg_buf(name)=dbg_str(name) + +#define dsprintf(name, format, args...) \ + dbg_buf(name)+=sprintf(dbg_buf(name), format, ## args) + +#define dbg_ch_index(ch) (dbch_##ch) +#define dbg_cl_index(cl) (dbcl_##cl) + +#define debugging_(cl, ch) \ + (dbg_ch_index(ch) >=0 && dbg_cl_index(cl) >= 0 && \ + debug_msg_enabled[dbg_ch_index(ch)][dbg_cl_index(cl)]) + +#define dprintf(format, args...) \ + fprintf(stddeb, format, ## args) + +#define dprintf_(cl, ch, format, args...) \ + if(!debugging_(cl, ch)) ; \ + else dprintf("%s:%s:%s:%d:%s: "format, \ + debug_cl_name[dbg_cl_index(cl)], \ + debug_ch_name[dbg_ch_index(ch)], \ + __FILE__, __LINE__, __FUNCTION__ , ## args) + + + +#define debugging_fixme(ch) debugging_(fixme, ch) +#define debugging_err(ch) debugging_(err, ch) +#define debugging_warn(ch) debugging_(warn, ch) +#define debugging_info(ch) debugging_(info, ch) + +#define dprintf_fixme(ch, format, args...) dprintf_(fixme, ch, format, ## args) +#define dprintf_err(ch, format, args...) dprintf_(err, ch, format, ## args) +#define dprintf_warn(ch, format, args...) dprintf_(warn, ch, format, ## args) +#define dprintf_info(ch, format, args...) dprintf_(info, ch, format, ## args) + +#define dbcl_fixme 0 +#define dbcl_err 1 +#define dbcl_warn 2 +#define dbcl_info 3 + +#endif + + + diff --git a/include/dinput.h b/include/dinput.h index 563c7e1e286..d103e7b8c4e 100644 --- a/include/dinput.h +++ b/include/dinput.h @@ -58,6 +58,63 @@ DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9, typedef struct IDirectInput32A IDirectInput32A,*LPDIRECTINPUT32A; typedef struct IDirectInputDevice32A IDirectInputDevice32A,*LPDIRECTINPUTDEVICE32A; +typedef struct SysKeyboard32A SysKeyboard32A,*LPSYSKEYBOARD32A; + +#define DI_OK S_OK +#define DI_NOTATTACHED S_FALSE +#define DI_BUFFEROVERFLOW S_FALSE +#define DI_PROPNOEFFECT S_FALSE +#define DI_NOEFFECT S_FALSE +#define DI_POLLEDDEVICE ((HRESULT)0x00000002L) +#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L) +#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L) +#define DI_TRUNCATED ((HRESULT)0x00000008L) +#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL) + +#define DIERR_OLDDIRECTINPUTVERSION \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION) +#define DIERR_BETADIRECTINPUTVERSION \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP) +#define DIERR_BADDRIVERVER \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL) +#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG +#define DIERR_NOTFOUND \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) +#define DIERR_OBJECTNOTFOUND \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) +#define DIERR_INVALIDPARAM E_INVALIDARG +#define DIERR_NOINTERFACE E_NOINTERFACE +#define DIERR_GENERIC E_FAIL +#define DIERR_OUTOFMEMORY E_OUTOFMEMORY +#define DIERR_UNSUPPORTED E_NOTIMPL +#define DIERR_NOTINITIALIZED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY) +#define DIERR_ALREADYINITIALIZED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED) +#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION +#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED +#define DIERR_INPUTLOST \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT) +#define DIERR_ACQUIRED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY) +#define DIERR_NOTACQUIRED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS) +#define DIERR_READONLY E_ACCESSDENIED +#define DIERR_HANDLEEXISTS E_ACCESSDENIED +#ifndef E_PENDING +#define E_PENDING 0x8000000AL +#endif +#define DIERR_INSUFFICIENTPRIVS 0x80040200L +#define DIERR_DEVICEFULL 0x80040201L +#define DIERR_MOREDATA 0x80040202L +#define DIERR_NOTDOWNLOADED 0x80040203L +#define DIERR_HASEFFECTS 0x80040204L +#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L +#define DIERR_INCOMPLETEEFFECT 0x80040206L +#define DIERR_NOTBUFFERED 0x80040207L +#define DIERR_EFFECTPLAYING 0x80040208L +#define DIERR_UNPLUGGED 0x80040209L +#define DIERR_REPORTFULL 0x8004020AL typedef struct { DWORD dwSize; @@ -303,6 +360,8 @@ DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK); #define DIDF_ABSAXIS 0x00000001 #define DIDF_RELAXIS 0x00000002 +#define DIGDD_PEEK 0x00000001 + typedef struct { DWORD dwOfs; DWORD dwData; @@ -338,6 +397,66 @@ typedef struct { #define DIPH_BYID 2 #define DIPH_BYUSAGE 3 +#define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage) + +typedef struct DIPROPDWORD { + DIPROPHEADER diph; + DWORD dwData; +} DIPROPDWORD, *LPDIPROPDWORD; +typedef const DIPROPDWORD *LPCDIPROPDWORD; + +typedef struct DIPROPRANGE { + DIPROPHEADER diph; + LONG lMin; + LONG lMax; +} DIPROPRANGE, *LPDIPROPRANGE; +typedef const DIPROPRANGE *LPCDIPROPRANGE; + +#define DIPROPRANGE_NOMIN ((LONG)0x80000000) +#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF) + +typedef struct DIPROPCAL { + DIPROPHEADER diph; + LONG lMin; + LONG lCenter; + LONG lMax; +} DIPROPCAL, *LPDIPROPCAL; +typedef const DIPROPCAL *LPCDIPROPCAL; + +typedef struct DIPROPGUIDANDPATH { + DIPROPHEADER diph; + GUID guidClass; + WCHAR wszPath[MAX_PATH]; +} DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH,*LPCDIPROPGUIDANDPATH; + +/* special property GUIDs */ +#define MAKEDIPROP(prop) ((REFGUID)(prop)) +#define DIPROP_BUFFERSIZE MAKEDIPROP(1) +#define DIPROP_AXISMODE MAKEDIPROP(2) + +#define DIPROPAXISMODE_ABS 0 +#define DIPROPAXISMODE_REL 1 + +#define DIPROP_GRANULARITY MAKEDIPROP(3) +#define DIPROP_RANGE MAKEDIPROP(4) +#define DIPROP_DEADZONE MAKEDIPROP(5) +#define DIPROP_SATURATION MAKEDIPROP(6) +#define DIPROP_FFGAIN MAKEDIPROP(7) +#define DIPROP_FFLOAD MAKEDIPROP(8) +#define DIPROP_AUTOCENTER MAKEDIPROP(9) + +#define DIPROPAUTOCENTER_OFF 0 +#define DIPROPAUTOCENTER_ON 1 + +#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10) + +#define DIPROPCALIBRATIONMODE_COOKED 0 +#define DIPROPCALIBRATIONMODE_RAW 1 + +#define DIPROP_CALIBRATION MAKEDIPROP(11) +#define DIPROP_GUIDANDPATH MAKEDIPROP(12) + + typedef struct DIDEVCAPS { DWORD dwSize; DWORD dwFlags; @@ -402,6 +521,13 @@ struct IDirectInputDevice32A { DWORD ref; GUID guid; }; + +struct SysKeyboard32A { + LPDIRECTINPUTDEVICEA_VTABLE lpvtbl; + DWORD ref; + GUID guid; + BYTE keystate[256]; +}; #undef THIS #define THIS LPDIRECTINPUT32A this diff --git a/include/dsound.h b/include/dsound.h index 013f0359d6e..081696b6f42 100644 --- a/include/dsound.h +++ b/include/dsound.h @@ -225,6 +225,7 @@ struct IDirectSoundBuffer { DSBUFFERDESC dsbd; LPDSBPOSITIONNOTIFY notifies; int nrofnotifies; + double volfac; }; #undef THIS diff --git a/include/file.h b/include/file.h index de43e1b542e..7b9c6e4c117 100644 --- a/include/file.h +++ b/include/file.h @@ -41,6 +41,7 @@ extern BOOL32 FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info ); extern HFILE32 FILE_Dup( HFILE32 hFile ); extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 ); extern HFILE32 FILE_Open( LPCSTR path, INT32 mode ); +extern HFILE32 FILE_OpenUnixFile( LPCSTR path, INT32 mode ); extern BOOL32 FILE_SetFileType( HFILE32 hFile, DWORD type ); extern LPVOID FILE_mmap( HFILE32 hFile, LPVOID start, DWORD size_high, DWORD size_low, @@ -68,7 +69,8 @@ extern void DOSFS_UnixTimeToFileTime( time_t unixtime, LPFILETIME ft, DWORD remainder ); extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder ); extern BOOL32 DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer ); -extern const char *DOSFS_IsDevice( const char *name ); +extern BOOL32 DOSFS_IsDevice( const char *name ); +extern HFILE32 DOSFS_OpenDevice( const char *name, INT32 mode ); extern BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf, INT32 long_len, LPSTR short_buf, BOOL32 ignore_case ); diff --git a/include/interfaces.h b/include/interfaces.h index ef70a22ae48..e8f2993d954 100644 --- a/include/interfaces.h +++ b/include/interfaces.h @@ -54,8 +54,8 @@ struct IClassFactory { }; #undef THIS -#define THIS LPMALLOC this -typedef struct IMalloc *LPMALLOC,IMalloc; +#define THIS LPMALLOC32 this +typedef struct IMalloc32 *LPMALLOC32,IMalloc32; typedef struct { STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; @@ -65,20 +65,46 @@ typedef struct { STDMETHOD_(LPVOID,Realloc) ( THIS_ LPVOID pv,DWORD cb); STDMETHOD_(VOID,Free) ( THIS_ LPVOID pv); STDMETHOD_(DWORD,GetSize) ( THIS_ LPVOID pv); - STDMETHOD_(LPINT32,DidAlloc) ( THIS_ LPVOID pv); + STDMETHOD_(INT32,DidAlloc) ( THIS_ LPVOID pv); STDMETHOD_(LPVOID,HeapMinimize) ( THIS ); -} *LPMALLOC_VTABLE,IMalloc_VTable; +} *LPMALLOC32_VTABLE,IMalloc32_VTable; -struct IMalloc { - LPMALLOC_VTABLE lpvtbl; - DWORD ref; +struct IMalloc32 { + LPMALLOC32_VTABLE lpvtbl; + DWORD ref; +}; +#undef THIS + +#define THIS LPMALLOC16 this +typedef struct IMalloc16 *LPMALLOC16,IMalloc16; +typedef struct { + STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + STDMETHOD_(LPVOID,Alloc) ( THIS_ DWORD cb); + STDMETHOD_(LPVOID,Realloc) ( THIS_ LPVOID pv,DWORD cb); + STDMETHOD_(VOID,Free) ( THIS_ LPVOID pv); + STDMETHOD_(DWORD,GetSize) ( THIS_ LPVOID pv); + STDMETHOD_(INT16,DidAlloc) ( THIS_ LPVOID pv); + STDMETHOD_(LPVOID,HeapMinimize) ( THIS ); +} *LPMALLOC16_VTABLE,IMalloc16_VTable; + +struct IMalloc16 { + LPMALLOC16_VTABLE lpvtbl; + DWORD ref; + /* Gmm, I think one is not enough, we should probably manage a list of + * heaps + */ + HGLOBAL16 heap; }; #undef THIS /* private prototypes for the constructors */ #ifdef __WINE__ LPUNKNOWN IUnknown_Constructor(); -LPMALLOC IMalloc_Constructor(); +LPMALLOC16 IMalloc16_Constructor(); +LPMALLOC32 IMalloc32_Constructor(); #endif #undef STDMETHOD diff --git a/include/k32obj.h b/include/k32obj.h index f117ce8ccba..3e4dc2828fd 100644 --- a/include/k32obj.h +++ b/include/k32obj.h @@ -8,6 +8,7 @@ #define __WINE_K32OBJ_H #include "wintypes.h" +#include "windows.h" /* Object types */ typedef enum @@ -47,6 +48,8 @@ typedef struct BOOL32 (*satisfied)(K32OBJ*,DWORD); /* Wait on object is satisfied */ void (*add_wait)(K32OBJ*,DWORD); /* Add thread to wait queue */ void (*remove_wait)(K32OBJ*,DWORD); /* Remove thread from wait queue */ + BOOL32 (*read)(K32OBJ*,LPVOID,DWORD,LPDWORD,LPOVERLAPPED); + BOOL32 (*write)(K32OBJ*,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED); void (*destroy)(K32OBJ *); /* Destroy object on refcount==0 */ } K32OBJ_OPS; diff --git a/include/mmsystem.h b/include/mmsystem.h index 493b7ac0d39..be29f5f0292 100644 --- a/include/mmsystem.h +++ b/include/mmsystem.h @@ -782,6 +782,7 @@ MMRESULT32 WINAPI timeEndPeriod32(UINT32); #define JOYERR_NOCANDO (JOYERR_BASE+6) /* request not completed */ #define JOYERR_UNPLUGGED (JOYERR_BASE+7) /* joystick is unplugged */ +/* JOYINFO, JOYINFOEX, MM_JOY* */ #define JOY_BUTTON1 0x0001 #define JOY_BUTTON2 0x0002 #define JOY_BUTTON3 0x0004 @@ -794,6 +795,50 @@ MMRESULT32 WINAPI timeEndPeriod32(UINT32); #define JOYSTICKID1 0 #define JOYSTICKID2 1 +/* JOYCAPS.wCaps */ +#define JOYCAPS_HASZ 0x0001 +#define JOYCAPS_HASR 0x0002 +#define JOYCAPS_HASU 0x0004 +#define JOYCAPS_HASV 0x0008 +#define JOYCAPS_HASPOV 0x0010 +#define JOYCAPS_POV4DIR 0x0020 +#define JOYCAPS_POVCTS 0x0040 + +/* JOYINFOEX stuff */ +#define JOY_POVCENTERED (WORD) -1 +#define JOY_POVFORWARD 0 +#define JOY_POVRIGHT 9000 +#define JOY_POVBACKWARD 18000 +#define JOY_POVLEFT 27000 + +#define JOY_RETURNX 0x00000001 +#define JOY_RETURNY 0x00000002 +#define JOY_RETURNZ 0x00000004 +#define JOY_RETURNR 0x00000008 +#define JOY_RETURNU 0x00000010 +#define JOY_RETURNV 0x00000020 +#define JOY_RETURNPOV 0x00000040 +#define JOY_RETURNBUTTONS 0x00000080 +#define JOY_RETURNRAWDATA 0x00000100 +#define JOY_RETURNPOVCTS 0x00000200 +#define JOY_RETURNCENTERED 0x00000400 +#define JOY_USEDEADZONE 0x00000800 +#define JOY_RETURNALL (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \ + JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \ + JOY_RETURNPOV | JOY_RETURNBUTTONS) +#define JOY_CAL_READALWAYS 0x00010000 +#define JOY_CAL_READXYONLY 0x00020000 +#define JOY_CAL_READ3 0x00040000 +#define JOY_CAL_READ4 0x00080000 +#define JOY_CAL_READXONLY 0x00100000 +#define JOY_CAL_READYONLY 0x00200000 +#define JOY_CAL_READ5 0x00400000 +#define JOY_CAL_READ6 0x00800000 +#define JOY_CAL_READZONLY 0x01000000 +#define JOY_CAL_READRONLY 0x02000000 +#define JOY_CAL_READUONLY 0x04000000 +#define JOY_CAL_READVONLY 0x08000000 + typedef struct { WORD wMid; /* manufacturer ID */ WORD wPid; /* product ID */ @@ -892,6 +937,22 @@ typedef struct { UINT32 wButtons; } JOYINFO32, *LPJOYINFO32; +typedef struct { + DWORD dwSize; /* size of structure */ + DWORD dwFlags; /* flags to indicate what to return */ + DWORD dwXpos; /* x position */ + DWORD dwYpos; /* y position */ + DWORD dwZpos; /* z position */ + DWORD dwRpos; /* rudder/4th axis position */ + DWORD dwUpos; /* 5th axis position */ + DWORD dwVpos; /* 6th axis position */ + DWORD dwButtons; /* button states */ + DWORD dwButtonNumber; /* current button number pressed */ + DWORD dwPOV; /* point of view state */ + DWORD dwReserved1; /* reserved for communication between winmm & driver */ + DWORD dwReserved2; /* reserved for future expansion */ +} JOYINFOEX,*LPJOYINFOEX; + DECL_WINELIB_TYPE(JOYINFO); DECL_WINELIB_TYPE(LPJOYINFO); @@ -905,6 +966,7 @@ UINT32 WINAPI joyGetNumDevs32(void); MMRESULT16 WINAPI joyGetPos16(UINT16,LPJOYINFO16); MMRESULT32 WINAPI joyGetPos32(UINT32,LPJOYINFO32); #define joyGetPos WINELIB_NAME(joyGetPos) +MMRESULT32 WINAPI joyGetPosEx(UINT32,LPJOYINFOEX); MMRESULT16 WINAPI joyGetThreshold16(UINT16,UINT16*); MMRESULT32 WINAPI joyGetThreshold32(UINT32,UINT32*); #define joyGetThreshold WINELIB_NAME(joyGetThreshold) diff --git a/include/module.h b/include/module.h index ea988db594a..e79aa470834 100644 --- a/include/module.h +++ b/include/module.h @@ -91,6 +91,14 @@ typedef struct SEGPTR reserved WINE_PACKED; } LOADPARAMS; +typedef struct +{ + LPSTR lpEnvAddress; + LPSTR lpCmdLine; + LPSTR lpCmdShow; + DWORD dwReserved; +} LOADPARAMS32; + #pragma pack(4) /* Resource types */ @@ -151,4 +159,7 @@ extern void NE_InitializeDLLs( HMODULE16 hModule ); extern HMODULE32 BUILTIN32_LoadModule( LPCSTR name, BOOL32 force, struct _PDB32 *process ); +/* if1632/builtin.c */ +extern HMODULE32 (*fnBUILTIN_LoadModule)(LPCSTR name, BOOL32 force); + #endif /* __WINE_MODULE_H */ diff --git a/include/ole.h b/include/ole.h index 71c1659c251..cf0519010ae 100644 --- a/include/ole.h +++ b/include/ole.h @@ -7,10 +7,19 @@ #include "windows.h" -typedef CHAR OLE_CHAR,OLECHAR; -typedef LPCSTR OLE_LPCSTR; -typedef LPSTR LPOLESTR; -typedef LPCSTR LPCOLESTR; +typedef CHAR OLECHAR16; +typedef LPSTR LPOLESTR16; +typedef LPCSTR LPCOLESTR16; +typedef WCHAR OLECHAR32; +typedef LPWSTR LPOLESTR32; +typedef LPCWSTR LPCOLESTR32; +DECL_WINELIB_TYPE(OLECHAR); +DECL_WINELIB_TYPE(LPOLESTR); +DECL_WINELIB_TYPE(LPCOLESTR); + +#define OLESTR16(x) x +#define OLESTR32(x) L##x +#define OLESTR WINELIB_NAME(OLESTR) typedef unsigned short VARTYPE; typedef LONG DISPID; @@ -170,10 +179,10 @@ typedef struct _OLECLIENT* LPOLECLIENT; typedef struct _OLESERVERDOCVTBL { OLESTATUS (CALLBACK *Save)(LPOLESERVERDOC); OLESTATUS (CALLBACK *Close)(LPOLESERVERDOC); - OLESTATUS (CALLBACK *SetHostNames)(LPOLESERVERDOC,OLE_LPCSTR,OLE_LPCSTR); + OLESTATUS (CALLBACK *SetHostNames)(LPOLESERVERDOC,LPCOLESTR16,LPCOLESTR16); OLESTATUS (CALLBACK *SetDocDimensions)(LPOLESERVERDOC,LPRECT16); #undef GetObject /* FIXME */ - OLESTATUS (CALLBACK *GetObject)(LPOLESERVERDOC,OLE_LPCSTR,LPOLEOBJECT*,LPOLECLIENT); + OLESTATUS (CALLBACK *GetObject)(LPOLESERVERDOC,LPCOLESTR16,LPOLEOBJECT*,LPOLECLIENT); OLESTATUS (CALLBACK *Release)(LPOLESERVERDOC); OLESTATUS (CALLBACK *SetColorScheme)(LPOLESERVERDOC,LPLOGPALETTE); OLESTATUS (CALLBACK *Execute)(LPOLESERVERDOC,HGLOBAL16); @@ -186,10 +195,10 @@ typedef struct _OLESERVERDOC { typedef struct _OLESERVER* LPOLESERVER; typedef struct _OLESERVERVTBL { - OLESTATUS (CALLBACK *Open)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,LPOLESERVERDOC *); - OLESTATUS (CALLBACK *Create)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC*); - OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC *); - OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,OLE_LPCSTR,OLE_LPCSTR,LPOLESERVERDOC *); + OLESTATUS (CALLBACK *Open)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPOLESERVERDOC *); + OLESTATUS (CALLBACK *Create)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC*); + OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *); + OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *); OLESTATUS (CALLBACK *Exit)(LPOLESERVER); OLESTATUS (CALLBACK *Release)(LPOLESERVER); OLESTATUS (CALLBACK *Execute)(LPOLESERVER); @@ -210,7 +219,7 @@ typedef struct _OLECLIENT { } OLECLIENT; typedef struct _OLEOBJECTVTBL { - void * (CALLBACK *QueryProtocol)(LPOLEOBJECT,OLE_LPCSTR); + void * (CALLBACK *QueryProtocol)(LPOLEOBJECT,LPCOLESTR16); OLESTATUS (CALLBACK *Release)(LPOLEOBJECT); OLESTATUS (CALLBACK *Show)(LPOLEOBJECT,BOOL16); OLESTATUS (CALLBACK *DoVerb)(LPOLEOBJECT,UINT16,BOOL16,BOOL16); @@ -221,10 +230,10 @@ typedef struct _OLEOBJECTVTBL { OLESTATUS (CALLBACK *EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT); OLESTATUS (CALLBACK *SetColorScheme)(LPOLEOBJECT,LPLOGPALETTE); OLESTATUS (CALLBACK *Delete)(LPOLEOBJECT); - OLESTATUS (CALLBACK *SetHostNames)(LPOLEOBJECT,OLE_LPCSTR,OLE_LPCSTR); + OLESTATUS (CALLBACK *SetHostNames)(LPOLEOBJECT,LPCOLESTR16,LPCOLESTR16); OLESTATUS (CALLBACK *SaveToStream)(LPOLEOBJECT,LPOLESTREAM); - OLESTATUS (CALLBACK *Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT *); - OLESTATUS (CALLBACK *CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT *); + OLESTATUS (CALLBACK *Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *); + OLESTATUS (CALLBACK *CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *); OLESTATUS (CALLBACK *Equal)(LPOLEOBJECT,LPOLEOBJECT); OLESTATUS (CALLBACK *CopyToClipBoard)(LPOLEOBJECT); OLESTATUS (CALLBACK *Draw)(LPOLEOBJECT,HDC16,LPRECT16,LPRECT16,HDC16); @@ -233,10 +242,10 @@ typedef struct _OLEOBJECTVTBL { OLESTATUS (CALLBACK *Close)(LPOLEOBJECT); OLESTATUS (CALLBACK *Update)(LPOLEOBJECT); OLESTATUS (CALLBACK *Reconnect)(LPOLEOBJECT); - OLESTATUS (CALLBACK *ObjectConvert)(LPOLEOBJECT,OLE_LPCSTR,LPOLECLIENT,LHCLIENTDOC,OLE_LPCSTR,LPOLEOBJECT*); + OLESTATUS (CALLBACK *ObjectConvert)(LPOLEOBJECT,LPCOLESTR16,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT*); OLESTATUS (CALLBACK *GetLinkUpdateOptions)(LPOLEOBJECT,LPOLEOPT_UPDATE); OLESTATUS (CALLBACK *SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE); - OLESTATUS (CALLBACK *Rename)(LPOLEOBJECT,OLE_LPCSTR); + OLESTATUS (CALLBACK *Rename)(LPOLEOBJECT,LPCOLESTR16); OLESTATUS (CALLBACK *QueryName)(LPOLEOBJECT,LPSTR,LPUINT16); OLESTATUS (CALLBACK *QueryType)(LPOLEOBJECT,LPLONG); OLESTATUS (CALLBACK *QueryBounds)(LPOLEOBJECT,LPRECT16); @@ -279,12 +288,12 @@ typedef enum tagCALLCONV { } CALLCONV; typedef struct tagPARAMDATA { - OLECHAR * szName; /* parameter name */ + OLECHAR16 * szName; /* parameter name */ VARTYPE vt; /* parameter type */ } PARAMDATA, * LPPARAMDATA; typedef struct tagMETHODDATA { - OLECHAR * szName; /* method name */ + OLECHAR16 * szName; /* method name */ PARAMDATA * ppdata; /* pointer to an array of PARAMDATAs */ DISPID dispid; /* method ID */ UINT16 iMeth; /* method index */ diff --git a/include/process.h b/include/process.h index dbce014f6ec..0323a984b1d 100644 --- a/include/process.h +++ b/include/process.h @@ -115,5 +115,5 @@ extern PDB32 *PROCESS_Current(void); extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access ); extern PDB32 *PROCESS_IdToPDB( DWORD id ); extern PDB32 *PROCESS_Create( TDB *pTask, LPCSTR cmd_line ); - +extern void PROCESS_CloseObjHandles(PDB32 *pdb, K32OBJ *ptr); #endif /* __WINE_PROCESS_H */ diff --git a/include/shlobj.h b/include/shlobj.h index 35b23cc9c94..f3cff0a8be0 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -146,7 +146,7 @@ typedef struct IShellFolder_VTable { /* *** IShellFolder methods *** */ STDMETHOD(ParseDisplayName) (THIS_ HWND32 hwndOwner, - LPBC pbcReserved, LPOLESTR lpszDisplayName, + LPBC pbcReserved, LPOLESTR32 lpszDisplayName, ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE; STDMETHOD(EnumObjects) ( THIS_ HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST * ppenumIDList) PURE; @@ -163,7 +163,7 @@ typedef struct IShellFolder_VTable { REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut) PURE; STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE; STDMETHOD(SetNameOf) (THIS_ HWND32 hwndOwner, LPCITEMIDLIST pidl, - LPCOLESTR lpszName, DWORD uFlags, + LPCOLESTR32 lpszName, DWORD uFlags, LPITEMIDLIST * ppidlOut) PURE; } *LPSHELLFOLDER_VTABLE,IShellFolder_VTable; diff --git a/include/stddebug.h b/include/stddebug.h deleted file mode 100644 index 71c6092b2e4..00000000000 --- a/include/stddebug.h +++ /dev/null @@ -1,256 +0,0 @@ -/* If you define this you can enable or disable specific debugging- */ -/* messages at run-time by supplying the "-debugmsg" option to Wine */ -#define DEBUG_RUNTIME /* */ - - -/* Define this if you want to enable all debugging-messages, except */ -/* the ones explicitly disabled in a specific *.c-file. */ -/* #define DEBUG_ALL */ - -/* Define this if you want to enable all debugging-messages, even */ -/* the ones explicitly disabled in specific *.c-files. */ -/* #define DEBUG_ALL_EXT */ - -/* Define this if you want to disable all debugging-messages, except */ -/* the ones explicitly enabled in a specifiy *.c-file. */ -/* #define DEBUG_NONE */ - -/* Define this if you want to disable all debugging-messages, even */ -/* the ones explicitly enabled in specific *.c-files. */ -/* #define DEBUG_NONE_EXT */ - - -/* You can enable or disable specific debugging-messages here. */ -/* However, this can be overridden in the individual *.c-files */ -/* between #include and #include */ - - -/* #define DEBUG_EDIT */ -/* #define DEBUG_MENU */ -/* #define DEBUG_MENUCALC */ -/* #define DEBUG_SCROLL */ -/* #define DEBUG_COMBO */ -/* #define DEBUG_LISTBOX */ -/* #define DEBUG_TASK */ -/* #define DEBUG_SELECTORS */ -/* #define DEBUG_RESOURCE */ -/* #define DEBUG_ACCEL */ -/* #define DEBUG_FIXUP */ -/* #define DEBUG_MODULE */ -/* #define DEBUG_LDT */ -/* #define DEBUG_HEAP */ -/* #define DEBUG_MCIANIM */ -/* #define DEBUG_MCIWAVE */ -/* #define DEBUG_MIDI */ -/* #define DEBUG_INT */ -/* #define DEBUG_METAFILE */ -/* #define DEBUG_GDI */ -/* #define DEBUG_BITMAP */ -/* #define DEBUG_FONT */ -/* #define DEBUG_PALETTE */ -/* #define DEBUG_ICON */ -/* #define DEBUG_REGION */ -/* #define DEBUG_TEXT */ -/* #define DEBUG_CLIPPING */ -/* #define DEBUG_CARET */ -/* #define DEBUG_CLASS */ -/* #define DEBUG_DC */ -/* #define DEBUG_DIALOG */ -/* #define DEBUG_MESSAGE */ -/* #define DEBUG_EVENT */ -/* #define DEBUG_KEY */ -/* #define DEBUG_GRAPHICS */ -/* #define DEBUG_MDI */ -/* #define DEBUG_MSG */ -/* #define DEBUG_NONCLIENT */ -/* #define DEBUG_SYSCOLOR */ -/* #define DEBUG_TIMER */ -/* #define DEBUG_UTILITY */ -/* #define DEBUG_WIN */ -/* #define DEBUG_ENUM */ -/* #define DEBUG_DLL */ -/* #define DEBUG_MSGBOX */ -/* #define DEBUG_CATCH */ - - -/* Do not remove this line or change anything below this line */ - -#ifdef DEBUG_NONE -#undef DEBUG_ACCEL -#undef DEBUG_ASPI -#undef DEBUG_ATOM -#undef DEBUG_BITBLT -#undef DEBUG_BITMAP -#undef DEBUG_CARET -#undef DEBUG_CDAUDIO -#undef DEBUG_CLASS -#undef DEBUG_CLIPBOARD -#undef DEBUG_CLIPPING -#undef DEBUG_COMBO -#undef DEBUG_COMM -#undef DEBUG_COMMDLG -#undef DEBUG_CRTDLL -#undef DEBUG_CURSOR -#undef DEBUG_DC -#undef DEBUG_DDE -#undef DEBUG_DDRAW -#undef DEBUG_DIALOG -#undef DEBUG_DLL -#undef DEBUG_DOSFS -#undef DEBUG_DRIVER -#undef DEBUG_DSOUND -#undef DEBUG_EDIT -#undef DEBUG_EVENT -#undef DEBUG_EXEC -#undef DEBUG_FILE -#undef DEBUG_FIXUP -#undef DEBUG_FONT -#undef DEBUG_GDI -#undef DEBUG_GLOBAL -#undef DEBUG_GRAPHICS -#undef DEBUG_HEAP -#undef DEBUG_HOOK -#undef DEBUG_ICON -#undef DEBUG_INT -#undef DEBUG_KEY -#undef DEBUG_KEYBOARD -#undef DEBUG_LDT -#undef DEBUG_LISTBOX -#undef DEBUG_LOCAL -#undef DEBUG_MCI -#undef DEBUG_MCIANIM -#undef DEBUG_MCIWAVE -#undef DEBUG_MDI -#undef DEBUG_MENU -#undef DEBUG_MESSAGE -#undef DEBUG_METAFILE -#undef DEBUG_MIDI -#undef DEBUG_MMAUX -#undef DEBUG_MMIO -#undef DEBUG_MMSYS -#undef DEBUG_MMTIME -#undef DEBUG_MODULE -#undef DEBUG_MSG -#undef DEBUG_NONCLIENT -#undef DEBUG_OLE -#undef DEBUG_PALETTE -#undef DEBUG_PROFILE -#undef DEBUG_PROGRESS -#undef DEBUG_PROP -#undef DEBUG_REG -#undef DEBUG_REGION -#undef DEBUG_RELAY -#undef DEBUG_RESOURCE -#undef DEBUG_SCROLL -#undef DEBUG_SELECTOR -#undef DEBUG_SEM -#undef DEBUG_SENDMSG -#undef DEBUG_SHM -#undef DEBUG_STRESS -#undef DEBUG_STRING -#undef DEBUG_TASK -#undef DEBUG_TEXT -#undef DEBUG_THUNK -#undef DEBUG_TIMER -#undef DEBUG_TOOLHELP -#undef DEBUG_TWEAK -#undef DEBUG_UPDOWN -#undef DEBUG_VER -#undef DEBUG_VIRTUAL -#undef DEBUG_VXD -#undef DEBUG_WIN -#undef DEBUG_WIN16DRV -#undef DEBUG_WIN32 -#undef DEBUG_WINSOCK -#undef DEBUG_X11 -#endif - -#ifdef DEBUG_ALL -#define DEBUG_ACCEL -#define DEBUG_ASPI -#define DEBUG_ATOM -#define DEBUG_BITBLT -#define DEBUG_BITMAP -#define DEBUG_CARET -#define DEBUG_CDAUDIO -#define DEBUG_CLASS -#define DEBUG_CLIPBOARD -#define DEBUG_CLIPPING -#define DEBUG_COMBO -#define DEBUG_COMM -#define DEBUG_COMMDLG -#define DEBUG_CRTDLL -#define DEBUG_CURSOR -#define DEBUG_DC -#define DEBUG_DDE -#define DEBUG_DDRAW -#define DEBUG_DIALOG -#define DEBUG_DLL -#define DEBUG_DOSFS -#define DEBUG_DRIVER -#define DEBUG_DSOUND -#define DEBUG_EDIT -#define DEBUG_EVENT -#define DEBUG_EXEC -#define DEBUG_FILE -#define DEBUG_FIXUP -#define DEBUG_FONT -#define DEBUG_GDI -#define DEBUG_GLOBAL -#define DEBUG_GRAPHICS -#define DEBUG_HEAP -#define DEBUG_HOOK -#define DEBUG_ICON -#define DEBUG_INT -#define DEBUG_KEY -#define DEBUG_KEYBOARD -#define DEBUG_LDT -#define DEBUG_LISTBOX -#define DEBUG_LOCAL -#define DEBUG_MCI -#define DEBUG_MCIANIM -#define DEBUG_MCIWAVE -#define DEBUG_MDI -#define DEBUG_MENU -#define DEBUG_MESSAGE -#define DEBUG_METAFILE -#define DEBUG_MIDI -#define DEBUG_MMAUX -#define DEBUG_MMIO -#define DEBUG_MMSYS -#define DEBUG_MMTIME -#define DEBUG_MODULE -#define DEBUG_MSG -#define DEBUG_NONCLIENT -#define DEBUG_OLE -#define DEBUG_PALETTE -#define DEBUG_PROFILE -#define DEBUG_PROGRESS -#define DEBUG_PROP -#define DEBUG_REG -#define DEBUG_REGION -#define DEBUG_RELAY -#define DEBUG_RESOURCE -#define DEBUG_SCROLL -#define DEBUG_SELECTOR -#define DEBUG_SEM -#define DEBUG_SENDMSG -#define DEBUG_SHM -#define DEBUG_STRESS -#define DEBUG_STRING -#define DEBUG_TASK -#define DEBUG_TEXT -#define DEBUG_THUNK -#define DEBUG_TIMER -#define DEBUG_TOOLHELP -#define DEBUG_TWEAK -#define DEBUG_UPDOWN -#define DEBUG_VER -#define DEBUG_VIRTUAL -#define DEBUG_VXD -#define DEBUG_WIN -#define DEBUG_WIN16DRV -#define DEBUG_WIN32 -#define DEBUG_WINSOCK -#define DEBUG_X11 -#endif diff --git a/include/storage.h b/include/storage.h new file mode 100644 index 00000000000..dce219ba7cc --- /dev/null +++ b/include/storage.h @@ -0,0 +1,212 @@ +#ifndef _WINE_STORAGE_H +#define _WINE_STORAGE_H + +/* Does this look like a cellar to you? */ + +#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn) +#define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn) +#define PURE +#define FAR +#define THIS_ THIS, + +struct storage_header { + BYTE magic[8]; /* 00: magic */ + BYTE unknown1[36]; /* 08: unknown */ + DWORD num_of_bbd_blocks;/* 2C: length of big datablocks */ + DWORD root_startblock;/* 30: root storage first big block */ + DWORD unknown2[2]; /* 34: unknown */ + DWORD sbd_startblock; /* 3C: small block depot first big block */ + DWORD unknown3[3]; /* 40: unknown */ + DWORD bbd_list[109]; /* 4C: big data block list (up to end of sector)*/ +}; +struct storage_pps_entry { + WCHAR pps_rawname[32];/* 00: \0 terminated widechar name */ + WORD pps_sizeofname; /* 40: namelength in bytes */ + BYTE pps_type; /* 42: flags, 1 storage/dir, 2 stream, 5 root */ + BYTE pps_unknown0; /* 43: unknown */ + DWORD pps_prev; /* 44: previous pps */ + DWORD pps_next; /* 48: next pps */ + DWORD pps_dir; /* 4C: directory pps */ + GUID pps_guid; /* 50: class ID */ + DWORD pps_unknown1; /* 60: unknown */ + FILETIME pps_ft1; /* 64: filetime1 */ + FILETIME pps_ft2; /* 70: filetime2 */ + DWORD pps_sb; /* 74: data startblock */ + DWORD pps_size; /* 78: datalength. (<0x1000)?small:big blocks*/ + DWORD pps_unknown2; /* 7C: unknown */ +}; + +#define STORAGE_CHAINENTRY_FAT 0xfffffffd +#define STORAGE_CHAINENTRY_ENDOFCHAIN 0xfffffffe +#define STORAGE_CHAINENTRY_FREE 0xffffffff + +typedef LPOLESTR16 *SNB16; +typedef LPOLESTR32 *SNB32; +DECL_WINELIB_TYPE(SNB); + +typedef struct IStorage16 IStorage16,*LPSTORAGE16; +typedef struct IStorage32 IStorage32,*LPSTORAGE32; +typedef struct IStream16 IStream16,*LPSTREAM16; +typedef struct IStream32 IStream32,*LPSTREAM32; + +typedef struct IEnumSTATSTG IEnumSTATSTG,*LPENUMSTATSTG; + +typedef struct { + LPOLESTR16 pwcsName; + DWORD type; + ULARGE_INTEGER cbSize; + FILETIME mtime; + FILETIME ctime; + FILETIME atime; + DWORD grfMode; + DWORD grfLocksSupported; + CLSID clsid; + DWORD grfStateBits; + DWORD reserved; +} STATSTG; + +#define STGM_DIRECT 0x00000000 +#define STGM_TRANSACTED 0x00010000 +#define STGM_SIMPLE 0x08000000 +#define STGM_READ 0x00000000 +#define STGM_WRITE 0x00000001 +#define STGM_READWRITE 0x00000002 +#define STGM_SHARE_DENY_NONE 0x00000040 +#define STGM_SHARE_DENY_READ 0x00000030 +#define STGM_SHARE_DENY_WRITE 0x00000020 +#define STGM_SHARE_EXCLUSIVE 0x00000010 +#define STGM_PRIORITY 0x00040000 +#define STGM_DELETEONRELEASE 0x04000000 +#define STGM_NOSCRATCH 0x00100000 +#define STGM_CREATE 0x00001000 +#define STGM_CONVERT 0x00020000 +#define STGM_FAILIFTHERE 0x00000000 + +#define THIS LPSTORAGE16 this +typedef struct IStorage16_VTable { + /* IUnknown methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj); + STDMETHOD_(ULONG,AddRef) (THIS); + STDMETHOD_(ULONG,Release) (THIS); + /* IStorage methods */ + STDMETHOD(CreateStream)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream16 **ppstm); + STDMETHOD(OpenStream)(THIS_ LPCOLESTR16 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream16 **ppstm); + STDMETHOD(CreateStorage)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage16 **ppstg); + STDMETHOD(OpenStorage)(THIS_ LPCOLESTR16 pwcsName,IStorage16 *pstgPriority, DWORD grfMode, SNB16 SNB16Exclude, DWORD reserved, IStorage16 **ppstg); + STDMETHOD(CopyTo)(THIS_ DWORD ciidExclude, const IID *rgiidExclude, SNB16 SNB16Exclude, IStorage16 *pstgDest); + STDMETHOD(MoveElementTo)(THIS_ LPCOLESTR16 pwcsName, IStorage16 *pstgDest, LPCOLESTR16 pwcsNewName, DWORD grfFlags); + STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags); + STDMETHOD(Revert)(THIS); + STDMETHOD(EnumElements)(THIS_ DWORD reserved1,void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum); + STDMETHOD(DestroyElement)(THIS_ LPCOLESTR16 pwcsName); + STDMETHOD(RenameElement)(THIS_ LPCOLESTR16 pwcsOldName, LPCOLESTR16 pwcsNewName); + STDMETHOD(SetElementTimes)(THIS_ LPCOLESTR16 pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime); + STDMETHOD(SetClass)(THIS_ REFCLSID clsid); + STDMETHOD(SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask); + STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag); +} IStorage16_VTable,*LPSTORAGE16_VTABLE; + +struct IStorage16 { + LPSTORAGE16_VTABLE lpvtbl; + DWORD ref; + SEGPTR thisptr; /* pointer to this struct as segmented */ + struct storage_pps_entry stde; + int ppsent; + HFILE32 hf; +}; +#undef THIS +#define THIS LPSTORAGE32 this +typedef struct IStorage32_VTable { + /* IUnknown methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj); + STDMETHOD_(ULONG,AddRef) (THIS); + STDMETHOD_(ULONG,Release) (THIS); + /* IStorage methods */ + STDMETHOD(CreateStream)(THIS_ LPCOLESTR32 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream32 **ppstm); + STDMETHOD(OpenStream)(THIS_ LPCOLESTR32 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream32 **ppstm); + STDMETHOD(CreateStorage)(THIS_ LPCOLESTR32 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage32 **ppstg); + STDMETHOD(OpenStorage)(THIS_ LPCOLESTR32 pwcsName,IStorage32 *pstgPriority, DWORD grfMode, SNB32 SNB16Exclude, DWORD reserved, IStorage32 **ppstg); + STDMETHOD(CopyTo)(THIS_ DWORD ciidExclude, const IID *rgiidExclude, SNB32 SNB16Exclude, IStorage32 *pstgDest); + STDMETHOD(MoveElementTo)(THIS_ LPCOLESTR32 pwcsName, IStorage32 *pstgDest, LPCOLESTR32 pwcsNewName, DWORD grfFlags); + STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags); + STDMETHOD(Revert)(THIS); + STDMETHOD(EnumElements)(THIS_ DWORD reserved1,void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum); + STDMETHOD(DestroyElement)(THIS_ LPCOLESTR32 pwcsName); + STDMETHOD(RenameElement)(THIS_ LPCOLESTR32 pwcsOldName, LPCOLESTR32 pwcsNewName); + STDMETHOD(SetElementTimes)(THIS_ LPCOLESTR32 pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime); + STDMETHOD(SetClass)(THIS_ REFCLSID clsid); + STDMETHOD(SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask); + STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag); +} IStorage32_VTable,*LPSTORAGE32_VTABLE; + +struct IStorage32 { + LPSTORAGE32_VTABLE lpvtbl; + DWORD ref; + struct storage_pps_entry stde; + int ppsent; + HFILE32 hf; +}; +#undef THIS + +#define THIS LPSTREAM16 this +typedef struct IStream16_VTable { + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void * *ppvObject); + STDMETHOD_(ULONG,AddRef)(THIS); + STDMETHOD_(ULONG,Release)(THIS); + STDMETHOD(Read)(THIS_ void *pv, ULONG cb, ULONG *pcbRead); + STDMETHOD(Write)(THIS_ const void *pv,ULONG cb,ULONG *pcbWritten); + STDMETHOD(Seek)(THIS_ LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition); + STDMETHOD(SetSize)(THIS_ ULARGE_INTEGER libNewSize); + STDMETHOD(CopyTo)(THIS_ IStream16 *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten); + STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags); + STDMETHOD(Revert)(THIS); + STDMETHOD(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb,DWORD dwLockType); + STDMETHOD(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType); + STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag); + STDMETHOD(Clone)(THIS_ IStream16 **ppstm); +} IStream16_VTable,*LPSTREAM16_VTABLE; + +struct IStream16 { + LPSTREAM16_VTABLE lpvtbl; + DWORD ref; + SEGPTR thisptr; /* pointer to this struct as segmented */ + struct storage_pps_entry stde; + int ppsent; + HFILE32 hf; + ULARGE_INTEGER offset; +}; +#undef THIS +#define THIS LPSTREAM32 this +typedef struct IStream32_VTable { + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void * *ppvObject); + STDMETHOD_(ULONG,AddRef)(THIS); + STDMETHOD_(ULONG,Release)(THIS); + STDMETHOD(Read)(THIS_ void *pv, ULONG cb, ULONG *pcbRead); + STDMETHOD(Write)(THIS_ const void *pv,ULONG cb,ULONG *pcbWritten); + STDMETHOD(Seek)(THIS_ LARGE_INTEGER dlibMove,DWORD dwOrigin,ULARGE_INTEGER *plibNewPosition); + STDMETHOD(SetSize)(THIS_ ULARGE_INTEGER libNewSize); + STDMETHOD(CopyTo)(THIS_ IStream32 *pstm,ULARGE_INTEGER cb,ULARGE_INTEGER *pcbRead,ULARGE_INTEGER *pcbWritten); + STDMETHOD(Commit)(THIS_ DWORD grfCommitFlags); + STDMETHOD(Revert)(THIS); + STDMETHOD(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb,DWORD dwLockType); + STDMETHOD(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType); + STDMETHOD(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag); + STDMETHOD(Clone)(THIS_ IStream32 **ppstm); +} IStream32_VTable,*LPSTREAM32_VTABLE; + +struct IStream32 { + LPSTREAM32_VTABLE lpvtbl; + DWORD ref; + struct storage_pps_entry stde; + int ppsent; + HFILE32 hf; + ULARGE_INTEGER offset; +}; +#undef THIS + +#undef STDMETHOD +#undef STDMETHOD_ +#undef PURE +#undef FAR +#undef THIS_ +#endif diff --git a/include/thread.h b/include/thread.h index 8ffe9800ac4..84d5dae99e4 100644 --- a/include/thread.h +++ b/include/thread.h @@ -12,6 +12,8 @@ #include "winnt.h" #include "selectors.h" /* for SET_FS */ +struct _PDB32; + /* Thread exception block */ typedef struct _TEB { @@ -30,6 +32,7 @@ typedef struct _TEB HQUEUE16 queue; /* 28 Message queue */ WORD pad1; /* 2a */ LPVOID *tls_ptr; /* 2c Pointer to TLS array */ + struct _PDB32 *process; /* 30 owning process (used by NT3.51 applets)*/ } TEB; /* Event waiting structure */ @@ -41,8 +44,6 @@ typedef struct K32OBJ *objs[MAXIMUM_WAIT_OBJECTS]; /* Object pointers */ } WAIT_STRUCT; -struct _PDB32; - /* Thread database */ typedef struct _THDB { @@ -50,7 +51,6 @@ typedef struct _THDB struct _PDB32 *process; /* 08 Process owning this thread */ K32OBJ *event; /* 0c Thread event */ TEB teb; /* 10 Thread exception block */ - DWORD cur_stack; /* 40 Current stack (was: process2) */ DWORD flags; /* 44 Flags */ DWORD exit_code; /* 48 Termination status */ WORD teb_sel; /* 4c Selector to TEB */ @@ -67,7 +67,8 @@ typedef struct _THDB void *debugger_CB; /* 74 Debugger context block */ DWORD debug_thread; /* 78 Thread debugging this one (?) */ void *pcontext; /* 7c Thread register context */ - DWORD unknown3[3]; /* 80 Unknown */ + DWORD cur_stack; /* 80 Current stack (was: unknown) */ + DWORD unknown3[2]; /* 84 Unknown */ WORD current_ss; /* 8c Another 16-bit stack selector */ WORD pad2; /* 8e */ void *ss_table; /* 90 Pointer to info about 16-bit stack */ @@ -125,6 +126,7 @@ extern THDB *THREAD_Current(void); extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access ); extern void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread ); extern void THREAD_RemoveQueue( THREAD_QUEUE *queue, THDB *thread ); +extern DWORD THREAD_TlsAlloc( THDB *thread ); /* scheduler/event.c */ extern void EVENT_Set( K32OBJ *obj ); diff --git a/include/version.h b/include/version.h index 7c96165b7d5..c224a7aba7a 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -#define WINE_RELEASE_INFO "Wine release 980215" +#define WINE_RELEASE_INFO "Wine release 980301" diff --git a/include/windows.h b/include/windows.h index a983aa5aca8..b4393deafbd 100644 --- a/include/windows.h +++ b/include/windows.h @@ -5767,6 +5767,9 @@ HANDLE32 WINAPI GetCurrentProcess(void); DWORD WINAPI GetCurrentProcessId(void); HANDLE32 WINAPI GetCurrentThread(void); DWORD WINAPI GetCurrentThreadId(void); +INT32 WINAPI GetDateFormat32A(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT32); +INT32 WINAPI GetDateFormat32W(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT32); +#define GetDateFormat WINELIB_NAME_AW(GetDateFormat) BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32); LPSTR WINAPI GetEnvironmentStrings32A(void); LPWSTR WINAPI GetEnvironmentStrings32W(void); @@ -5856,6 +5859,8 @@ BOOL32 WINAPI MoveFileEx32A(LPCSTR,LPCSTR,DWORD); BOOL32 WINAPI MoveFileEx32W(LPCWSTR,LPCWSTR,DWORD); #define MoveFileEx WINELIB_NAME_AW(MoveFileEx) DWORD WINAPI MsgWaitForMultipleObjects(DWORD,HANDLE32*,BOOL32,DWORD,DWORD); +INT32 WINAPI MultiByteToWideChar(UINT32,DWORD,LPCSTR,INT32,LPWSTR,INT32); +INT32 WINAPI WideCharToMultiByte(UINT32,DWORD,LPCWSTR,INT32,LPSTR,INT32,LPCSTR,BOOL32*); HANDLE32 WINAPI OpenEvent32A(DWORD,BOOL32,LPCSTR); HANDLE32 WINAPI OpenEvent32W(DWORD,BOOL32,LPCWSTR); #define OpenEvent WINELIB_NAME_AW(OpenEvent) @@ -5877,7 +5882,7 @@ BOOL32 WINAPI QueryPerformanceCounter(LPLARGE_INTEGER); BOOL32 WINAPI ReadConsole32A(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID); BOOL32 WINAPI ReadConsole32W(HANDLE32,LPVOID,DWORD,LPDWORD,LPVOID); #define ReadConsole WINELIB_NAME_AW(ReadConsole) -BOOL32 WINAPI ReadFile(HFILE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED); +BOOL32 WINAPI ReadFile(HANDLE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED); DWORD WINAPI RegCreateKeyEx32A(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM, LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD); DWORD WINAPI RegCreateKeyEx32W(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM, @@ -5967,7 +5972,7 @@ WORD WINAPI WOWHandle16(HANDLE32,WOW_HANDLE_TYPE); BOOL32 WINAPI WriteConsole32A(HANDLE32,LPCVOID,DWORD,LPDWORD,LPVOID); BOOL32 WINAPI WriteConsole32W(HANDLE32,LPCVOID,DWORD,LPDWORD,LPVOID); #define WriteConsole WINELIB_NAME_AW(WriteConsole) -BOOL32 WINAPI WriteFile(HFILE32,LPVOID,DWORD,LPDWORD,LPOVERLAPPED); +BOOL32 WINAPI WriteFile(HANDLE32,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED); /* Declarations for functions that are the same in Win16 and Win32 */ diff --git a/include/winerror.h b/include/winerror.h index e0c9ddabb58..763a124a9e0 100644 --- a/include/winerror.h +++ b/include/winerror.h @@ -4,6 +4,11 @@ extern int WIN32_LastError; +#define FACILITY_WIN32 7 + +#define SEVERITY_ERROR 1 + + #define MAKE_HRESULT(sev,fac,code) \ ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) ) #define MAKE_SCODE(sev,fac,code) \ @@ -52,6 +57,7 @@ extern int WIN32_LastError; #define ERROR_POSSIBLE_DEADLOCK 1131 #define ERROR_BAD_DEVICE 1200 #define ERROR_NO_NETWORK 1222 +#define ERROR_ALREADY_INITIALIZED 1247 #define ERROR_COMMITMENT_LIMIT 1455 /* HRESULT values for OLE, SHELL and other Interface stuff */ @@ -66,4 +72,38 @@ extern int WIN32_LastError; #define E_OUTOFMEMORY 0x8007000E #define E_INVALIDARG 0x80070057 +#define STG_E_INVALIDFUNCTION 0x80030001 +#define STG_E_FILENOTFOUND 0x80030002 +#define STG_E_PATHNOTFOUND 0x80030003 +#define STG_E_TOOMANYOPENFILES 0x80030004 +#define STG_E_ACCESSDENIED 0x80030005 +#define STG_E_INVALIDHANDLE 0x80030006 +#define STG_E_INSUFFICIENTMEMORY 0x80030008 +#define STG_E_INVALIDPOINTER 0x80030009 +#define STG_E_NOMOREFILES 0x80030012 +#define STG_E_DISKISWRITEPROTECTED 0x80030013 +#define STG_E_SEEKERROR 0x80030019 +#define STG_E_WRITEFAULT 0x8003001D +#define STG_E_READFAULT 0x8003001E +#define STG_E_SHAREVIOLATION 0x80030020 +#define STG_E_LOCKVIOLATION 0x80030021 +#define STG_E_FILEALREADYEXISTS 0x80030050 +#define STG_E_INVALIDPARAMETER 0x80030057 +#define STG_E_MEDIUMFULL 0x80030070 +#define STG_E_ABNORMALAPIEXIT 0x800300FA +#define STG_E_INVALIDHEADER 0x800300FB +#define STG_E_INVALIDNAME 0x800300FC +#define STG_E_UNKNOWN 0x800300FD +#define STG_E_UNIMPLEMENTEDFUNCTION 0x800300FE +#define STG_E_INVALIDFLAG 0x800300FF +#define STG_E_INUSE 0x80030100 +#define STG_E_NOTCURRENT 0x80030101 +#define STG_E_REVERTED 0x80030102 +#define STG_E_CANTSAVE 0x80030103 +#define STG_E_OLDFORMAT 0x80030104 +#define STG_E_OLDDLL 0x80030105 +#define STG_E_SHAREREQUIRED 0x80030106 +#define STG_E_NOTFILEBASEDSTORAGE 0x80030107 +#define STG_E_EXTANTMARSHALLINGS 0x80030108 + #endif /* __WINE_WINERROR_H */ diff --git a/ipc/dde_atom.c b/ipc/dde_atom.c index 1aef654069f..458565ab7ba 100644 --- a/ipc/dde_atom.c +++ b/ipc/dde_atom.c @@ -16,7 +16,6 @@ #include "shm_main_blk.h" #include "shm_fragment.h" #include "ldt.h" -#include "stddebug.h" #include "debug.h" typedef struct @@ -130,7 +129,7 @@ ATOM DDE_GlobalAddAtom( SEGPTR name ) return (atom #include "dde_atom.h" #include "shm_main_blk.h" -#include #include #define TOGETHER (DDE_ATOMS/5) @@ -25,9 +24,9 @@ int main() int i,j,atom_n; int atom_len[TOGETHER]; - debugging_shm=1; - debugging_atom=0; - debugging_sem=0; + debugging_info(shm)=1; + debugging_info(atom)=0; + debugging_info(sem)=0; for (i=0 ; i<=10000/TOGETHER ; i++) { for (atom_n=0 ; atom_n -#include -#include #include +#include "debug.h" #include "ldt.h" #include "shm_main_blk.h" #include "shm_fragment.h" @@ -59,18 +58,18 @@ static struct handle_info *locate_handle(HGLOBAL16 h, struct local_shm_map *map) { struct shm_block *block; - dprintf_global(stddeb,"shm:locate_handle(0x%04x)\n", h); + dprintf_info(global,"shm:locate_handle(0x%04x)\n", h); if (SampleBit( &free_handles, DDE_MEM_IDX(h)) == 0) { - dprintf_global(stddeb, "shm:locate_handle: return NULL\n"); + dprintf_info(global, "shm:locate_handle: return NULL\n"); return NULL; /* free!!! */ } block= shm_locate_block(DDE_MEM_INFO(h).shmid, map); if (block == NULL) { /* nothing found */ - dprintf_global(stddeb, "shm:locate_handle: return NULL\n"); + dprintf_info(global, "shm:locate_handle: return NULL\n"); return NULL; } @@ -88,7 +87,7 @@ static HGLOBAL16 dde_alloc_handle() if (bit_nr != -1) return DDE_MEM_HANDLE(bit_nr); - dprintf_global(stddeb,"dde_alloc_handle: no free DDE handle found\n"); + dprintf_info(global,"dde_alloc_handle: no free DDE handle found\n"); return 0; } /********************************************************************** @@ -103,7 +102,7 @@ DDE_malloc(unsigned int flags, unsigned long size, SHMDATA *shmdata) struct local_shm_map *curr; HGLOBAL16 handle; - dprintf_global(stddeb,"DDE_malloc flags %4X, size %ld\n", flags, size); + dprintf_info(global,"DDE_malloc flags %4X, size %ld\n", flags, size); DDE_IPC_init(); /* make sure main shm block allocated */ shm_write_wait(main_block->proc[curr_proc_idx].sem); @@ -152,14 +151,14 @@ DDE_malloc(unsigned int flags, unsigned long size, SHMDATA *shmdata) handle= dde_alloc_handle(); if (handle) { - dprintf_global(stddeb, + dprintf_info(global, "DDE_malloc returning handle=0x%4x, ptr=0x%08lx\n", (int)handle, (long) HINFO2DATAPTR(h_info)); DDE_MEM_INFO(handle).rel= PTR2REL(block, h_info); DDE_MEM_INFO(handle).shmid= shmid; } else - dprintf_global(stddeb,"DDE_malloc failed\n"); + dprintf_warn(global, "DDE_malloc failed\n"); shm_write_signal(main_block->proc[curr_proc_idx].sem); @@ -173,7 +172,7 @@ HGLOBAL16 DDE_GlobalFree(HGLOBAL16 h) int handle_index= h & 0x7fff; struct local_shm_map map; - dprintf_global(stddeb,"DDE_GlobalFree(0x%04x)\n",h); + dprintf_info(global,"DDE_GlobalFree(0x%04x)\n",h); if (h==0) return 0; @@ -239,7 +238,7 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr) if (segptr != NULL) *segptr=0; - dprintf_global(stddeb,"DDE_AttachHandle(%04x)\n",handle); + dprintf_info(global,"DDE_AttachHandle(%04x)\n",handle); h_info=locate_handle(handle, NULL); if (h_info == NULL) @@ -250,7 +249,7 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr) return NULL; } - dprintf_global(stddeb,"DDE_AttachHandle: h_info=%06lx\n",(long)h_info); + dprintf_info(global,"DDE_AttachHandle: h_info=%06lx\n",(long)h_info); shmdata.handle= handle; shmdata.shmid= DDE_MEM_INFO(handle).shmid; @@ -264,10 +263,10 @@ void *DDE_AttachHandle(HGLOBAL16 handle, SEGPTR *segptr) if (segptr != NULL) *segptr= (SEGPTR)MAKELONG( 0, shmdata.sel); - if (debugging_dde) + if (debugging_info(dde)) debug_last_handle_size= h_info->size; - dprintf_global(stddeb,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr); + dprintf_info(global,"DDE_AttachHandle returns ptr=0x%08lx\n", (long)ptr); return (LPSTR)ptr; diff --git a/ipc/dde_proc.c b/ipc/dde_proc.c index 57142b116c6..a08b0696bce 100644 --- a/ipc/dde_proc.c +++ b/ipc/dde_proc.c @@ -26,7 +26,6 @@ #include "dde_proc.h" #include "dde_mem.h" #include "dde.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -48,9 +47,7 @@ sigjmp_buf env_wait_x; #define DDE_MSG_SIZE sizeof(MSG16) #define FREE_WND (WORD)(-2) #define DELETED_WND (WORD)(-3) -#if defined(DEBUG_MSG) || defined(DEBUG_RUNTIME) static char *msg_type[4]={"********", "DDE_SEND", "DDE_POST", "DDE_ACK"}; -#endif struct msg_dat { struct msgbuf dat; @@ -126,7 +123,7 @@ void dde_proc_add(dde_proc procs) { dde_proc proc; int proc_idx; - dprintf_dde(stddeb,"dde_proc_add(..)\n"); + dprintf_info(dde,"dde_proc_add(..)\n"); shm_write_wait(main_block->sem); /* find free proc_idx and allocate it */ @@ -167,7 +164,7 @@ static BOOL32 get_ack() size= msgrcv( main_block->proc[curr_proc_idx].msg , &ack_buff.dat, 1, DDE_ACK, IPC_NOWAIT); if (size>=0) { - dprintf_msg(stddeb,"get_ack: received DDE_ACK message\n"); + dprintf_info(msg,"get_ack: received DDE_ACK message\n"); return TRUE; } if (DDE_GetRemoteMessage()) { @@ -200,7 +197,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf) return FALSE; } - if (debugging_dde) { + if (debugging_info(dde) || debugging_warn_dde) { MSG16 *msg=(MSG16*) &msgbuf->mtext; char *title; if (msgbuf->mtype==DDE_SEND) @@ -212,13 +209,13 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf) if (title) print_dde_message(title, msg); else - fprintf(stddeb,"Unknown message type=0x%lx\n",msgbuf->mtype); + dprintf_warn(dde, "Unknown message type=0x%lx\n", msgbuf->mtype); } - dprintf_msg(stddeb, + dprintf_info(msg, "DDE_DoOneMessage: to proc_idx=%d (pid=%d), queue=%u\n", proc_idx, proc->pid, (unsigned)proc->msg); if ( proc->msg != -1) { - dprintf_msg(stddeb, "DDE_DoOneMessage: doing...(type=%s)\n", + dprintf_info(msg, "DDE_DoOneMessage: doing...(type=%s)\n", msg_type[msgbuf->mtype]); size=msgsnd (proc->msg, msgbuf, size, 0); @@ -228,7 +225,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf) } kill(proc->pid,SIGUSR2); /* tell the process there is a message */ - dprintf_msg(stddeb,"DDE_DoOneMessage: " + dprintf_info(msg,"DDE_DoOneMessage: " "Trying to get acknowledgment from msg queue=%d\n", proc->msg); Yield16(); /* force task switch, and */ @@ -242,7 +239,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf) } } else { - dprintf_msg(stddeb,"DDE_DoOneMessage: message not sent, " + dprintf_warn(msg, "DDE_DoOneMessage: message not sent, " "target has no message queue\n"); return FALSE; } @@ -315,11 +312,11 @@ static BOOL32 DDE_DoMessage( MSG16 *msg, int type ) if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND16)-1) return FALSE; - dprintf_msg(stddeb, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n", + dprintf_info(msg, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n", msg_type[type], (int)msg->hwnd,(int)msg->message); - dprintf_msg(stddeb, + dprintf_info(msg, "DDE_DoMessage(hwnd=0x%x,msg=0x%x,..) // HWND_BROADCAST !\n", (int)msg->hwnd,(int)msg->message); remote_message=(void*)&msg_dat.dat.mtext; @@ -364,7 +361,7 @@ void dde_proc_send_ack(HWND16 wnd, BOOL32 val) { proc=DDE_WIN2PROC(wnd); msg=main_block->proc[proc].msg; - dprintf_msg(stddeb,"DDE_GetRemoteMessage: sending ACK " + dprintf_info(msg,"DDE_GetRemoteMessage: sending ACK " "to wnd=%4x, proc=%d,msg=%d, pid=%d\n",wnd,proc,msg, main_block->proc[proc].pid ); @@ -405,7 +402,7 @@ int DDE_GetRemoteMessage() if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/ was_sent=TRUE; - dprintf_msg(stddeb, + dprintf_info(msg, "DDE:receive sent message. msg=%04x wPar=%04x" " lPar=%08lx\n", remote_message->message, remote_message->wParam, @@ -416,7 +413,7 @@ int DDE_GetRemoteMessage() if (size==DDE_MSG_SIZE) { /* is this a correct message (if any) ?*/ was_sent=FALSE; - dprintf_msg(stddeb, + dprintf_info(msg, "DDE:receive posted message. " "msg=%04x wPar=%04x lPar=%08lx\n", remote_message->message, remote_message->wParam, @@ -432,7 +429,7 @@ int DDE_GetRemoteMessage() nesting++; - if (debugging_dde) { + if (debugging_info(dde)) { char *title; if (was_sent) title="receive sent dde:"; @@ -445,7 +442,7 @@ int DDE_GetRemoteMessage() HWND16 dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd; /* we should know exactly where to send the message (locally)*/ if (was_sent) { - dprintf_dde(stddeb, + dprintf_info(dde, "SendMessage(wnd=0x%04x, msg=0x%04x, wPar=0x%04x," "lPar=0x%08x\n", dde_window, remote_message->message, @@ -527,7 +524,7 @@ void DDE_TestDDE(HWND16 hwnd) in_test--; return; } - dprintf_msg(stddeb,"DDE_TestDDE(0x%04x)\n", hwnd); + dprintf_info(msg,"DDE_TestDDE(0x%04x)\n", hwnd); if (hwnd==0) hwnd=-1; /* just send a message to see how things are going */ @@ -565,6 +562,7 @@ static void print_dde_message(char *desc, MSG16 *msg) DDEADVISE *ddeadvise; DDEDATA *ddedata; DDEPOKE *ddepoke; + dbg_decl_str(dde, 2048); if (is_dde_handle(msg->lParam & 0xffff) ) ptr=DDE_AttachHandle(msg->lParam&0xffff, NULL); @@ -573,8 +571,8 @@ static void print_dde_message(char *desc, MSG16 *msg) wStatus=LOWORD(msg->lParam); hWord=HIWORD(msg->lParam); - fprintf(stddeb,"%s", desc); - fprintf(stddeb,"%04x %04x==%s %04x %08lx ", + dsprintf(dde,"%s", desc); + dsprintf(dde,"%04x %04x==%s %04x %08lx ", msg->hwnd, msg->message,"",/*MessageTypeNames[msg->message],*/ msg->wParam, msg->lParam); switch(msg->message) { @@ -588,52 +586,52 @@ static void print_dde_message(char *desc, MSG16 *msg) /* DDEADVISE: hOptions in WM_DDE_ADVISE message */ if (ptr) { ddeadvise=ptr; - fprintf(stddeb,"fDeferUpd=%d,fAckReq=%d,cfFormat=0x%x", + dsprintf(dde,"fDeferUpd=%d,fAckReq=%d,cfFormat=0x%x", ddeadvise->fDeferUpd, ddeadvise->fAckReq, ddeadvise->cfFormat); } else - fprintf(stddeb,"NO-DATA"); - fprintf(stddeb," atom=0x%x",hWord); + dsprintf(dde,"NO-DATA"); + dsprintf(dde," atom=0x%x",hWord); break; case WM_DDE_UNADVISE: - fprintf(stddeb,"format=0x%x, atom=0x%x",wStatus,hWord); + dsprintf(dde,"format=0x%x, atom=0x%x",wStatus,hWord); break; case WM_DDE_ACK: ddeack=(DDEACK*)&wStatus; - fprintf(stddeb,"bAppReturnCode=%d,fBusy=%d,fAck=%d", + dsprintf(dde,"bAppReturnCode=%d,fBusy=%d,fAck=%d", ddeack->bAppReturnCode, ddeack->fBusy, ddeack->fAck); if (ddeack->fAck) - fprintf(stddeb,"(True)"); + dsprintf(dde,"(True)"); else - fprintf(stddeb,"(False)"); + dsprintf(dde,"(False)"); break; case WM_DDE_DATA: if (ptr) { ddedata=ptr; - fprintf(stddeb,"fResponse=%d,fRelease=%d," + dsprintf(dde,"fResponse=%d,fRelease=%d," "fAckReq=%d,cfFormat=0x%x,value=\"%.*s\"", ddedata->fResponse, ddedata->fRelease, ddedata->fAckReq, ddedata->cfFormat, debug_last_handle_size- (int)sizeof(*ddedata)+1, ddedata->Value); } else - fprintf(stddeb,"NO-DATA"); - fprintf(stddeb," atom=0x%04x",hWord); + dsprintf(dde,"NO-DATA"); + dsprintf(dde," atom=0x%04x",hWord); break; case WM_DDE_POKE: if (ptr) { ddepoke=ptr; - fprintf(stddeb,"fRelease=%d,cfFormat=0x%x,value[0]='%c'", + dsprintf(dde,"fRelease=%d,cfFormat=0x%x,value[0]='%c'", ddepoke->fRelease, ddepoke->cfFormat, ddepoke->Value[0]); } else - fprintf(stddeb,"NO-DATA"); - fprintf(stddeb," atom=0x%04x",hWord); + dsprintf(dde,"NO-DATA"); + dsprintf(dde," atom=0x%04x",hWord); break; } - fprintf(stddeb,"\n"); + dprintf_info(dde,"%s\n", dbg_str(dde)); } void dde_proc_done(dde_proc proc) diff --git a/ipc/shm_block.c b/ipc/shm_block.c index 6a5106b024a..5f5570f8775 100644 --- a/ipc/shm_block.c +++ b/ipc/shm_block.c @@ -16,9 +16,8 @@ #include #include #include -#include -#include -#include +#include "debug.h" +#include "global.h" #include "selectors.h" #include "shm_fragment.h" #include "shm_block.h" @@ -38,7 +37,7 @@ struct local_shm_map *shm_map=NULL; */ void shm_setup_block(struct shm_block *block, int first, int size) { - dprintf_shm(stddeb,"Setting up shm block at 0x%08x\n",(int )block); + dprintf_info(shm,"Setting up shm block at 0x%08x\n",(int )block); /* setup block internal data structure */ if (first <= 0) { first=sizeof(*block); @@ -54,7 +53,7 @@ void shm_setup_block(struct shm_block *block, int first, int size) /* block->size is initialized in shm_FragmentInit */ shm_FragmentInit(block, first, size); /* first item in the free list */ - dprintf_shm(stddeb, + dprintf_info(shm, "block was set up at 0x%08x, size=0x%04xKB, 1st usable=%02x\n", (int )block,size/1024,first); } diff --git a/ipc/shm_fragment.c b/ipc/shm_fragment.c index 15c51feec4b..f5ec7bfbdc9 100644 --- a/ipc/shm_fragment.c +++ b/ipc/shm_fragment.c @@ -10,7 +10,6 @@ #ifdef CONFIG_IPC #include /* for debugging only */ -#include #include /* for "stddeb" */ #include "shm_fragment.h" diff --git a/ipc/shm_fragment_test.c b/ipc/shm_fragment_test.c index c27061bf2e9..054ab631bb3 100644 --- a/ipc/shm_fragment_test.c +++ b/ipc/shm_fragment_test.c @@ -9,7 +9,6 @@ */ #include #include -#include #define DEBUG_DEFINE_VARIABLES /* just avoid dumb errors */ #include /* for "stddeb" */ #include diff --git a/ipc/shm_main_blk.c b/ipc/shm_main_blk.c index 09a91b20b22..74024756501 100644 --- a/ipc/shm_main_blk.c +++ b/ipc/shm_main_blk.c @@ -18,8 +18,7 @@ #include #include #include -#include -#include +#include "debug.h" #include "shm_fragment.h" #include "shm_block.h" #include "shm_main_blk.h" @@ -80,7 +79,7 @@ int proc_exist(pid_t pid) /* setup a new main shm block (only construct a shm block object). */ static void shm_setup_main_block() { - dprintf_shm(stddeb,"creating data structure\n"); + dprintf_info(shm,"creating data structure\n"); main_block->build_lock=1; strcpy(main_block->magic, shm_header); @@ -134,29 +133,29 @@ static int attach_MainBlock(int shm_id) /* Make sure we don't work on somebody else's block */ if (shm_info.shm_perm.cuid != getuid()) { /* creator is not me */ - dprintf_shm(stddeb,"Creator is not me!\n"); + dprintf_warn(shm, "Creator is not me!\n"); return 0; } - dprintf_shm(stddeb,"shared memory exist, attaching anywhere\n"); + dprintf_info(shm,"shared memory exist, attaching anywhere\n"); main_block=(struct shm_main_block *)shmat(shm_id, 0, 0); if ( (int)main_block==-1) { - dprintf_shm(stddeb,"Attach failed\n"); + dprintf_warn(shm, "Attach failed\n"); return 0; } if (strcmp(main_block->magic, shm_header) != 0) { - dprintf_shm(stddeb,"Detaching, wrong magic\n"); + dprintf_info(shm,"Detaching, wrong magic\n"); shmdt((void *)main_block); return 0; } - if (debugging_shm) + if (debugging_info(shm)) print_shm_info(shm_id); /* Is it an old unused block ? */ if (shm_info.shm_nattch == 0) { - dprintf_shm(stddeb,"No attaches, deleting old data\n"); + dprintf_info(shm,"No attaches, deleting old data\n"); shm_delete_all(shm_id); return 0; } @@ -181,10 +180,10 @@ static int shm_locate_MainBlock(key_t shm_key) int shm_id; /* Descriptor to this shared memory */ int i; - dprintf_shm(stddeb,"shm_locate_MainBlock: trying to attach, key=0x%x\n", + dprintf_info(shm,"shm_locate_MainBlock: trying to attach, key=0x%x\n", shm_key); for (i=0 ; i < SHM_KEY_RANGE ; i++) { - dprintf_shm(stddeb,"iteration=%d\n", i); + dprintf_info(shm,"iteration=%d\n", i); shm_id= shmget ( shm_key+i, SHM_MINBLOCK ,0700); @@ -203,8 +202,8 @@ static int shm_locate_MainBlock(key_t shm_key) case ENOMEM: /* no free memory */ case ENOENT: /* this key does not exist */ default : - dprintf_shm(stddeb,"shmget failed, errno=%d, %s\n", - errno, strerror(errno) ); + dprintf_warn(shm,"shmget failed, errno=%d, %s\n", + errno, strerror(errno) ); return 0; /* Failed */ } } /* if .. else */ @@ -223,7 +222,7 @@ static int shm_create_MainBlock(key_t MainShmKey) int flags= 0700 | IPC_CREAT | IPC_EXCL; int i; - dprintf_shm(stddeb,"creating shared memory\n"); + dprintf_info(shm,"creating shared memory\n"); /* try to allocate shared memory with key="Wine", size=SHM_MINBLOCK, */ /* complete user permission */ @@ -233,12 +232,12 @@ static int shm_create_MainBlock(key_t MainShmKey) break; } if (shm_id == -1) { - dprintf_shm(stddeb,"failed to create shared memory\n"); + dprintf_warn(shm, "failed to create shared memory\n"); return 0; } - dprintf_shm(stddeb,"shared memory created, attaching\n"); + dprintf_info(shm,"shared memory created, attaching\n"); main_block=(struct shm_main_block*) shmat(shm_id, 0,0); - if (debugging_shm) + if (debugging_info(shm)) print_shm_info(shm_id); main_shm_id= shm_id; shm_setup_main_block(); diff --git a/ipc/shm_semaph.c b/ipc/shm_semaph.c index f730154c3ea..6d021bbe01b 100644 --- a/ipc/shm_semaph.c +++ b/ipc/shm_semaph.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include "debug.h" #include "shm_semaph.h" #define SEM_READ 0 #define SEM_WRITE 1 @@ -29,7 +28,7 @@ void shm_read_wait(shm_sem semid) struct sembuf sop[2]; int ret; - dprintf_sem(stddeb,"shm_read_wait(%d)\n",semid); + dprintf_info(sem,"shm_read_wait(%d)\n",semid); sop[0].sem_num=SEM_READ; sop[0].sem_op=1; /* add this read instance */ sop[0].sem_flg=SEM_UNDO; /* undo in case process dies */ @@ -51,7 +50,7 @@ void shm_write_wait(shm_sem semid) struct sembuf sop[3]; int ret; - dprintf_sem(stddeb,"shm_write_wait(%d)\n",semid); + dprintf_info(sem,"shm_write_wait(%d)\n",semid); sop[0].sem_num=SEM_READ; sop[0].sem_op=0; /* wait until no reading instance exist */ sop[0].sem_flg=SEM_UNDO; @@ -77,7 +76,7 @@ void shm_write_signal(shm_sem semid) struct sembuf sop[2]; int ret; - dprintf_sem(stddeb,"shm_write_signal(%d)\n",semid); + dprintf_info(sem,"shm_write_signal(%d)\n",semid); sop[0].sem_num=SEM_READ; sop[0].sem_op=-1; sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */ @@ -100,7 +99,7 @@ void shm_read_signal(shm_sem semid) struct sembuf sop[2]; int ret; - dprintf_sem(stddeb,"shm_read_signal(%d)\n",semid); + dprintf_info(sem,"shm_read_signal(%d)\n",semid); sop[0].sem_num=SEM_READ; sop[0].sem_op=-1; sop[0].sem_flg=IPC_NOWAIT | SEM_UNDO; /* no reason to wait */ diff --git a/ipc/shm_semaph_test.c b/ipc/shm_semaph_test.c index fdceeb58f1d..6132861666b 100644 --- a/ipc/shm_semaph_test.c +++ b/ipc/shm_semaph_test.c @@ -16,7 +16,6 @@ #include "shm_semaph.h" #include #define DEBUG_DEFINE_VARIABLES -#include #include static volatile int * volatile data; diff --git a/ipc/wine_test_stub.c b/ipc/wine_test_stub.c index 0fdb599520f..2229351561e 100644 --- a/ipc/wine_test_stub.c +++ b/ipc/wine_test_stub.c @@ -5,7 +5,6 @@ #include #define DEBUG_DEFINE_VARIABLES #define DEBUG_ALL -#include #include #define DDE_PROC2WIN(proc_idx) ( (HWND) ~( (proc_idx)+1) ) diff --git a/library/winestub.c b/library/winestub.c index c23e0759832..f81eda60add 100644 --- a/library/winestub.c +++ b/library/winestub.c @@ -1,17 +1,9 @@ /* Sample winestub.c file for compiling programs with libwine.so. */ #include -#include #include "windows.h" #include "xmalloc.h" -/* Stub needed for linking with Winelib */ -/* FIXME: this should not be necessary */ -HMODULE32 BUILTIN_LoadModule( LPCSTR name, BOOL32 force ) { - fprintf(stderr,"BUILTIN_LoadModule(%s,%d) called in a library!\n",name,force); - return 0; -} - extern int PASCAL WinMain(HINSTANCE32,HINSTANCE32,LPSTR,int); extern BOOL32 MAIN_WinelibInit( int *argc, char *argv[] ); extern void TASK_Reschedule(void); @@ -23,7 +15,7 @@ char **_ARGV; int main( int argc, char *argv [] ) { - HINSTANCE16 hInstance; + HINSTANCE32 hInstance; LPSTR lpszCmdParam; int i, len = 0; _ARGC = argc; diff --git a/loader/main.c b/loader/main.c index e255cc76cc2..d2a6423528d 100644 --- a/loader/main.c +++ b/loader/main.c @@ -11,8 +11,6 @@ #include #include #include "windows.h" -#include "module.h" -#include "selectors.h" #include "bitmap.h" #include "comm.h" #include "win.h" @@ -27,7 +25,6 @@ #include "heap.h" #include "keyboard.h" #include "miscemu.h" -#include "neexe.h" #include "options.h" #include "spy.h" #include "task.h" @@ -36,7 +33,6 @@ #include "dce.h" #include "shell.h" #include "winproc.h" -#include "stddebug.h" #include "debug.h" diff --git a/loader/module.c b/loader/module.c index c7216e61983..8bc07837496 100644 --- a/loader/module.c +++ b/loader/module.c @@ -16,7 +16,6 @@ #include "file.h" #include "global.h" #include "heap.h" -#include "hook.h" #include "module.h" #include "neexe.h" #include "process.h" @@ -25,7 +24,6 @@ #include "stackframe.h" #include "task.h" #include "toolhelp.h" -#include "stddebug.h" #include "debug.h" #include "callback.h" @@ -34,6 +32,9 @@ extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params static HMODULE16 hFirstModule = 0; static HMODULE16 hCachedModule = 0; /* Module cached by MODULE_OpenFile */ +static HMODULE32 MODULE_LoadModule(LPCSTR name,BOOL32 force) { return 0; } +HMODULE32 (*fnBUILTIN_LoadModule)(LPCSTR name,BOOL32 force) = MODULE_LoadModule; + /*********************************************************************** * MODULE_GetPtr @@ -268,7 +269,7 @@ int MODULE_OpenFile( HMODULE32 hModule ) static int cachedfd = -1; hModule = MODULE_HANDLEtoHMODULE16(hModule); - dprintf_module( stddeb, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n", + dprintf_info(module, "MODULE_OpenFile(%04x) cache: mod=%04x fd=%d\n", hModule, hCachedModule, cachedfd ); if (!(pModule = MODULE_GetPtr( hModule ))) return -1; if (hCachedModule == hModule) return cachedfd; @@ -279,7 +280,7 @@ int MODULE_OpenFile( HMODULE32 hModule ) (cachedfd = open( full_name.long_name, O_RDONLY )) == -1) fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module %04x\n", name, hModule ); - dprintf_module( stddeb, "MODULE_OpenFile: opened '%s' -> %d\n", + dprintf_info(module, "MODULE_OpenFile: opened '%s' -> %d\n", name, cachedfd ); return cachedfd; } @@ -568,7 +569,7 @@ static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs ) { fastload_offset=ne_header.fastload_offset<CallWindowsExitProc( WEP, WEP_FREE_DLL ); @@ -1157,13 +1158,13 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags) if (!hModule) /* We have to load the module */ { /* Try to load the built-in first if not disabled */ - if ((hModule = BUILTIN_LoadModule( name, FALSE ))) + if ((hModule = fnBUILTIN_LoadModule( name, FALSE ))) return MODULE_HANDLEtoHMODULE16( hModule ); if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32) { /* Now try the built-in even if disabled */ - if ((hModule = BUILTIN_LoadModule( name, TRUE ))) + if ((hModule = fnBUILTIN_LoadModule( name, TRUE ))) { fprintf( stderr, "Warning: could not load Windows DLL '%s', using built-in module.\n", name ); return MODULE_HANDLEtoHMODULE16( hModule ); @@ -1267,12 +1268,34 @@ HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock ) } /********************************************************************** - * LoadModule32 (KERNEL32) - * FIXME: check this function + * LoadModule32 (KERNEL32.499) + * + * FIXME + * + * This should get implemented via CreateProcess -- MODULE_Load + * is resolutely 16-bit. */ DWORD LoadModule32( LPCSTR name, LPVOID paramBlock ) { +#ifdef 0 + LOADPARAMS32 *p = paramBlock; + STARTUPINFO st; + PROCESSINFORMATION pi; + st.cb = sizeof(STARTUPINFO); + st.wShowWindow = p->lpCmdShow[2] ; WRONG + + BOOL32 ret = CreateProcess32A( name, p->lpCmdLine, + NULL, NULL, FALSE, 0, p->lpEnvAddress, + NULL, &st, &pi); + if (!ret) { + /* handle errors appropriately */ + } + CloseHandle32(pi.hProcess); + CloseHandle32(pi.hThread); + +#else return MODULE_Load( name, paramBlock, 0 ); +#endif } @@ -1284,7 +1307,7 @@ BOOL16 WINAPI FreeModule16( HMODULE16 hModule ) NE_MODULE *pModule; if (!(pModule = MODULE_GetPtr( hModule ))) return FALSE; - dprintf_module( stddeb, "FreeModule16: %s count %d\n", + dprintf_info(module, "FreeModule16: %s count %d\n", MODULE_GetModuleName(hModule), pModule->count ); return MODULE_FreeModule( hModule, GlobalLock16(GetCurrentTask()) ); @@ -1312,7 +1335,7 @@ HMODULE32 WINAPI GetModuleHandle32A(LPCSTR module) { HMODULE32 hModule; - dprintf_win32(stddeb, "GetModuleHandleA: %s\n", module ? module : "NULL"); + dprintf_info(win32, "GetModuleHandleA: %s\n", module ? module : "NULL"); /* Freecell uses the result of GetModuleHandleA(0) as the hInstance in all calls to e.g. CreateWindowEx. */ if (module == NULL) { @@ -1341,7 +1364,7 @@ INT16 WINAPI GetModuleUsage( HINSTANCE16 hModule ) NE_MODULE *pModule; if (!(pModule = MODULE_GetPtr( hModule ))) return 0; - dprintf_module( stddeb, "GetModuleUsage(%04x): returning %d\n", + dprintf_info(module, "GetModuleUsage(%04x): returning %d\n", hModule, pModule->count ); return pModule->count; } @@ -1358,7 +1381,7 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName, if (!hModule) hModule = GetCurrentTask(); if (!(pModule = MODULE_GetPtr( hModule ))) return 0; lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize ); - dprintf_module( stddeb, "GetModuleFileName16: %s\n", lpFileName ); + dprintf_info(module, "GetModuleFileName16: %s\n", lpFileName ); return strlen(lpFileName); } @@ -1378,7 +1401,7 @@ DWORD WINAPI GetModuleFileName32A( HMODULE32 hModule, LPSTR lpFileName, } if (!(pModule = MODULE_GetPtr( hModule ))) return 0; lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), size ); - dprintf_module( stddeb, "GetModuleFileName32A: %s\n", lpFileName ); + dprintf_info(module, "GetModuleFileName32A: %s\n", lpFileName ); return strlen(lpFileName); } @@ -1473,7 +1496,7 @@ HMODULE32 WINAPI LoadLibraryEx32W(LPCWSTR libnameW,HFILE32 hfile,DWORD flags) */ BOOL32 WINAPI FreeLibrary32(HINSTANCE32 hLibModule) { - dprintf_module(stddeb,"FreeLibrary: hLibModule: %08x\n", hLibModule); + dprintf_info(module,"FreeLibrary: hLibModule: %08x\n", hLibModule); return MODULE_FreeModule(hLibModule, GlobalLock16(GetCurrentTask()) ); } @@ -1491,7 +1514,7 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname ) fprintf( stderr, "LoadLibrary not supported in Winelib\n" ); return 0; } - dprintf_module( stddeb, "LoadLibrary: (%08x) %s\n", (int)libname, libname); + dprintf_info(module, "LoadLibrary: (%08x) %s\n", (int)libname, libname); handle = MODULE_Load( libname, (LPVOID)-1, 0 ); if (handle == (HINSTANCE16)2) /* file not found */ @@ -1521,7 +1544,7 @@ HINSTANCE32 WINAPI PrivateLoadLibrary(LPCSTR libname) */ void WINAPI FreeLibrary16( HINSTANCE16 handle ) { - dprintf_module( stddeb,"FreeLibrary: %04x\n", handle ); + dprintf_info(module,"FreeLibrary: %04x\n", handle ); FreeModule16( handle ); } @@ -1553,7 +1576,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow ) { LOADPARAMS params; HGLOBAL16 cmdShowHandle, cmdLineHandle; - HINSTANCE16 handle = 2; + HINSTANCE32 handle = 2; WORD *cmdShowPtr; char *p, *cmdline, filename[256]; static int use_load_module = 1; @@ -1630,7 +1653,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow ) params.cmdLine = (SEGPTR)WIN16_GlobalLock16( cmdLineHandle ); params.showCmd = (SEGPTR)WIN16_GlobalLock16( cmdShowHandle ); params.reserved = 0; - handle = LoadModule16( filename, ¶ms ); + handle = LoadModule32( filename, ¶ms ); if (handle == 2) /* file not found */ { /* Check that the original file name did not have a suffix */ @@ -1735,16 +1758,16 @@ FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hModule, LPSTR name ) hModule = MODULE_HANDLEtoHMODULE16(hModule); if (HIWORD(name)) { ordinal = MODULE_GetOrdinal( hModule, name ); - dprintf_module( stddeb, "WIN32_GetProcAddress16: %04x '%s'\n", + dprintf_info(module, "WIN32_GetProcAddress16: %04x '%s'\n", hModule, name ); } else { ordinal = LOWORD(name); - dprintf_module( stddeb, "GetProcAddress: %04x %04x\n", + dprintf_info(module, "GetProcAddress: %04x %04x\n", hModule, ordinal ); } if (!ordinal) return (FARPROC16)0; ret = MODULE_GetEntryPoint( hModule, ordinal ); - dprintf_module(stddeb,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret); + dprintf_info(module,"WIN32_GetProcAddress16: returning %08x\n",(UINT32)ret); return ret; } @@ -1762,20 +1785,20 @@ FARPROC16 WINAPI GetProcAddress16( HMODULE16 hModule, SEGPTR name ) if (HIWORD(name) != 0) { ordinal = MODULE_GetOrdinal( hModule, (LPSTR)PTR_SEG_TO_LIN(name) ); - dprintf_module( stddeb, "GetProcAddress: %04x '%s'\n", + dprintf_info(module, "GetProcAddress: %04x '%s'\n", hModule, (LPSTR)PTR_SEG_TO_LIN(name) ); } else { ordinal = LOWORD(name); - dprintf_module( stddeb, "GetProcAddress: %04x %04x\n", + dprintf_info(module, "GetProcAddress: %04x %04x\n", hModule, ordinal ); } if (!ordinal) return (FARPROC16)0; ret = MODULE_GetEntryPoint( hModule, ordinal ); - dprintf_module( stddeb, "GetProcAddress: returning %08x\n", (UINT32)ret ); + dprintf_info(module, "GetProcAddress: returning %08x\n", (UINT32)ret ); return ret; } @@ -1788,9 +1811,9 @@ FARPROC32 WINAPI GetProcAddress32( HMODULE32 hModule, LPCSTR function ) NE_MODULE *pModule; if (HIWORD(function)) - dprintf_win32(stddeb,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function); + dprintf_info(win32,"GetProcAddress32(%08lx,%s)\n",(DWORD)hModule,function); else - dprintf_win32(stddeb,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function); + dprintf_info(win32,"GetProcAddress32(%08lx,%p)\n",(DWORD)hModule,function); if (!(pModule = MODULE_GetPtr( hModule ))) return (FARPROC32)0; if (!pModule->module32) diff --git a/loader/ne_image.c b/loader/ne_image.c index d092b3d8574..7b13baba25e 100644 --- a/loader/ne_image.c +++ b/loader/ne_image.c @@ -23,7 +23,6 @@ #include "file.h" #include "module.h" #include "stackframe.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -55,7 +54,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) if (!pSeg->filepos) return TRUE; /* No file image, just return */ fd = MODULE_OpenFile( pModule->self ); - dprintf_module( stddeb, "Loading segment %d, selector=%04x, flags=%04x\n", + dprintf_info(module, "Loading segment %d, selector=%04x, flags=%04x\n", segnum, pSeg->selector, pSeg->flags ); lseek( fd, pSeg->filepos << pModule->alignment, SEEK_SET ); if (pSeg->size) size = pSeg->size; @@ -143,7 +142,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) read( fd, &count, sizeof(count) ); if (!count) return TRUE; - dprintf_fixup( stddeb, "Fixups for %*.*s, segment %d, selector %04x\n", + dprintf_info(fixup, "Fixups for %*.*s, segment %d, selector %04x\n", *((BYTE *)pModule + pModule->name_table), *((BYTE *)pModule + pModule->name_table), (char *)pModule + pModule->name_table + 1, @@ -153,7 +152,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) if (read( fd, reloc_entries, count * sizeof(struct relocation_entry_s)) != count * sizeof(struct relocation_entry_s)) { - dprintf_fixup( stddeb, "Unable to read relocation information\n" ); + dprintf_warn(fixup, "Unable to read relocation information\n" ); return FALSE; } @@ -194,14 +193,14 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) (char *)pTarget + pTarget->name_table + 1, ordinal ); } - if (debugging_fixup) + if (debugging_info(fixup)) { NE_MODULE *pTarget = MODULE_GetPtr( module ); - fprintf( stddeb,"%d: %*.*s.%d=%04x:%04x\n", i + 1, - *((BYTE *)pTarget + pTarget->name_table), - *((BYTE *)pTarget + pTarget->name_table), - (char *)pTarget + pTarget->name_table + 1, - ordinal, HIWORD(address), LOWORD(address) ); + dprintf_info(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1, + *((BYTE *)pTarget + pTarget->name_table), + *((BYTE *)pTarget + pTarget->name_table), + (char *)pTarget + pTarget->name_table + 1, + ordinal, HIWORD(address), LOWORD(address) ); } break; @@ -215,20 +214,20 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) address = MODULE_GetEntryPoint( module, ordinal ); - if (!address) + if (debugging_err(fixup) && !address) { NE_MODULE *pTarget = MODULE_GetPtr( module ); - fprintf( stderr, "Warning: no handler for %.*s.%s, setting to 0:0\n", - *((BYTE *)pTarget + pTarget->name_table), - (char *)pTarget + pTarget->name_table + 1, func_name ); + dprintf_err(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n", + *((BYTE *)pTarget + pTarget->name_table), + (char *)pTarget + pTarget->name_table + 1, func_name ); } - if (debugging_fixup) + if (debugging_info(fixup)) { - NE_MODULE *pTarget = MODULE_GetPtr( module ); - fprintf( stddeb,"%d: %.*s.%s=%04x:%04x\n", i + 1, - *((BYTE *)pTarget + pTarget->name_table), - (char *)pTarget + pTarget->name_table + 1, - func_name, HIWORD(address), LOWORD(address) ); + NE_MODULE *pTarget = MODULE_GetPtr( module ); + dprintf_info(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1, + *((BYTE *)pTarget + pTarget->name_table), + (char *)pTarget + pTarget->name_table + 1, + func_name, HIWORD(address), LOWORD(address) ); } break; @@ -242,7 +241,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 ); } - dprintf_fixup(stddeb,"%d: %04x:%04x\n", + dprintf_info(fixup,"%d: %04x:%04x\n", i + 1, HIWORD(address), LOWORD(address) ); break; @@ -255,21 +254,17 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) * successfully emulate the coprocessor if it doesn't * exist. */ - dprintf_fixup(stddeb, - "%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, ", + dprintf_info(fixup, + "%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, TARGET %04x %04x\n", i + 1, rep->address_type, rep->relocation_type, - rep->offset); - dprintf_fixup(stddeb,"TARGET %04x %04x\n", - rep->target1, rep->target2); + rep->offset, rep->target1, rep->target2); continue; default: - dprintf_fixup(stddeb, - "WARNING: %d: ADDR TYPE %d, unknown TYPE %d, OFFSET %04x, ", - i + 1, rep->address_type, rep->relocation_type, - rep->offset); - dprintf_fixup(stddeb,"TARGET %04x %04x\n", - rep->target1, rep->target2); + dprintf_warn(fixup, "WARNING: %d: ADDR TYPE %d, " + "unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n", + i + 1, rep->address_type, rep->relocation_type, + rep->offset, rep->target1, rep->target2); free(reloc_entries); return FALSE; } @@ -287,7 +282,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) case NE_RADDR_LOWBYTE: do { sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); - dprintf_fixup(stddeb," %04x:%04x:%04x BYTE%s\n", + dprintf_info(fixup," %04x:%04x:%04x BYTE%s\n", pSeg->selector, offset, *sp, additive ? " additive":""); offset = *sp; if(additive) @@ -301,7 +296,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) case NE_RADDR_OFFSET16: do { sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); - dprintf_fixup(stddeb," %04x:%04x:%04x OFFSET16%s\n", + dprintf_info(fixup," %04x:%04x:%04x OFFSET16%s\n", pSeg->selector, offset, *sp, additive ? " additive" : "" ); offset = *sp; *sp = LOWORD(address); @@ -313,7 +308,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) case NE_RADDR_POINTER32: do { sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); - dprintf_fixup(stddeb," %04x:%04x:%04x POINTER32%s\n", + dprintf_info(fixup," %04x:%04x:%04x POINTER32%s\n", pSeg->selector, offset, *sp, additive ? " additive" : "" ); offset = *sp; *sp = LOWORD(address); @@ -326,7 +321,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) case NE_RADDR_SELECTOR: do { sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset ); - dprintf_fixup(stddeb," %04x:%04x:%04x SELECTOR%s\n", + dprintf_info(fixup," %04x:%04x:%04x SELECTOR%s\n", pSeg->selector, offset, *sp, additive ? " additive" : "" ); offset = *sp; *sp = HIWORD(address); @@ -339,12 +334,10 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) break; default: - dprintf_fixup(stddeb, - "WARNING: %d: unknown ADDR TYPE %d, TYPE %d, OFFSET %04x, ", + dprintf_warn(fixup, "WARNING: %d: unknown ADDR TYPE %d, " + "TYPE %d, OFFSET %04x, TARGET %04x %04x\n", i + 1, rep->address_type, rep->relocation_type, - rep->offset); - dprintf_fixup(stddeb, - "TARGET %04x %04x\n", rep->target1, rep->target2); + rep->offset, rep->target1, rep->target2); free(reloc_entries); return FALSE; } @@ -374,7 +367,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule ) DWORD oldstack; WORD saved_dgroup = pSegTable[pModule->dgroup - 1].selector; - dprintf_module(stddeb, "MODULE_Load: %.*s is a self-loading module!\n", + dprintf_info(module, "NE_LoadAllSegments: %.*s is a self-loading module!\n", *((BYTE*)pModule + pModule->name_table), (char *)pModule + pModule->name_table + 1); if (!NE_LoadSegment( pModule, 1 )) return FALSE; @@ -431,7 +424,7 @@ BOOL32 NE_LoadDLLs( NE_MODULE *pModule ) BYTE *pstr = (BYTE *)pModule + pModule->import_table + *pModRef; memcpy( buffer, pstr + 1, *pstr ); strcpy( buffer + *pstr, ".dll" ); - dprintf_module( stddeb, "Loading '%s'\n", buffer ); + dprintf_info(module, "Loading '%s'\n", buffer ); if (!(*pModRef = MODULE_FindModule( buffer ))) { /* If the DLL is not loaded yet, load it and store */ @@ -483,12 +476,13 @@ void NE_FixupPrologs( NE_MODULE *pModule ) WORD dgroup = 0; WORD sel; BYTE *p, *fixup_ptr, count; + dbg_decl_str(module, 512); pSegTable = NE_SEG_TABLE(pModule); if (pModule->flags & NE_FFLAGS_SINGLEDATA) dgroup = pSegTable[pModule->dgroup-1].selector; - dprintf_module( stddeb, "MODULE_FixupPrologs(%04x)\n", pModule->self ); + dprintf_info(module, "MODULE_FixupPrologs(%04x)\n", pModule->self ); p = (BYTE *)pModule + pModule->entry_table; while (*p) { @@ -509,21 +503,23 @@ void NE_FixupPrologs( NE_MODULE *pModule ) p += 2; while (count-- > 0) { - dprintf_module( stddeb,"Flags: %04x, sel %02x ", *p, sel); + dbg_reset_str(module); + dsprintf(module,"Flags: %04x, sel %02x ", *p, sel); /* According to the output generated by TDUMP, the flags mean: * 0x0001 function is exported * 0x0002 Single data (seems to occur only in DLLs) */ if (sel == 0xff) { /* moveable */ - dprintf_module( stddeb, "(%02x) o %04x ", p[3], *(WORD *)(p+4) ); + dsprintf(module, "(%02x) o %04x", p[3], *(WORD *)(p+4) ); fixup_ptr = (char *)GET_SEL_BASE(pSegTable[p[3]-1].selector) + *(WORD *)(p + 4); } else { /* fixed */ - dprintf_module( stddeb, "offset %04x ", *(WORD *)(p+1) ); - fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) + *(WORD *)(p + 1); + dsprintf(module, "offset %04x", *(WORD *)(p+1) ); + fixup_ptr = (char *)GET_SEL_BASE(pSegTable[sel-1].selector) + + *(WORD *)(p + 1); } - dprintf_module( stddeb, "Signature: %02x %02x %02x,ff %x\n", - fixup_ptr[0], fixup_ptr[1], fixup_ptr[2], - pModule->flags ); + dprintf_info(module, "%s Signature: %02x %02x %02x,ff %x\n", + dbg_str(module), fixup_ptr[0], fixup_ptr[1], + fixup_ptr[2], pModule->flags ); if (*p & 0x0001) { /* Verify the signature */ @@ -553,11 +549,11 @@ void NE_FixupPrologs( NE_MODULE *pModule ) } } } else { - dprintf_fixup( stddeb, "Unknown signature\n" ); + dprintf_warn(fixup, "Unknown signature\n" ); } } else - dprintf_module( stddeb,"\n"); + dprintf_info(module,"\n"); p += (sel == 0xff) ? 6 : 3; } } @@ -618,8 +614,17 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule ) } else /* DATA SINGLE DLL */ { - DS_reg(&context) = pSegTable[pModule->dgroup-1].selector; - ECX_reg(&context) = pModule->heap_size; + if (pModule->dgroup) { + DS_reg(&context) = pSegTable[pModule->dgroup-1].selector; + ECX_reg(&context) = pModule->heap_size; + } + else /* hmm, DLL has no dgroup, + but why has it NE_FFLAGS_SINGLEDATA set ? + Buggy DLL compiler ? */ + { + DS_reg(&context) = 0; + ECX_reg(&context) = 0; + } } CS_reg(&context) = pSegTable[pModule->cs-1].selector; @@ -630,7 +635,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, HMODULE16 hModule ) pModule->cs = 0; /* Don't initialize it twice */ - dprintf_dll( stddeb, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n", + dprintf_info(dll, "Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n", CS_reg(&context), IP_reg(&context), DS_reg(&context), DI_reg(&context), CX_reg(&context) ); Callbacks->CallRegisterShortProc( &context, 0 ); diff --git a/loader/ne_resource.c b/loader/ne_resource.c index 0e340bd0a45..b0914119492 100644 --- a/loader/ne_resource.c +++ b/loader/ne_resource.c @@ -18,7 +18,6 @@ #include "module.h" #include "neexe.h" #include "resource.h" -#include "stddebug.h" #include "debug.h" #define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \ @@ -47,13 +46,13 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, SEGPTR typeId, SEGPTR resId pNameInfo = (NE_NAMEINFO *)(pTypeInfo + 1); for (count = pTypeInfo->count; count > 0; count--, pNameInfo++) { - dprintf_resource( stddeb, "NameTable entry: type=%04x id=%04x\n", + dprintf_info(resource, "NameTable entry: type=%04x id=%04x\n", pTypeInfo->type_id, pNameInfo->id ); handle = LoadResource16( pModule->self, (HRSRC16)((int)pNameInfo - (int)pModule) ); for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p)) { - dprintf_resource( stddeb," type=%04x '%s' id=%04x '%s'\n", + dprintf_info(resource," type=%04x '%s' id=%04x '%s'\n", p[1], (char *)(p+3), p[2], (char *)(p+3)+strlen((char *)(p+3))+1 ); /* Check for correct type */ @@ -81,7 +80,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, SEGPTR typeId, SEGPTR resId /* If we get here, we've found the entry */ - dprintf_resource( stddeb, " Found!\n" ); + dprintf_info(resource, " Found!\n" ); ret = MAKELONG( p[1], p[2] ); break; } @@ -113,11 +112,11 @@ static NE_TYPEINFO* NE_FindTypeSection( NE_MODULE *pModule, BYTE *p = (BYTE*)pModule + pModule->res_table + pTypeInfo->type_id; if ((*p == len) && !lstrncmpi32A( p+1, str, len )) { - dprintf_resource( stddeb, " Found type '%s'\n", str ); + dprintf_info(resource, " Found type '%s'\n", str ); return pTypeInfo; } } - dprintf_resource( stddeb, " Skipping type %04x\n", pTypeInfo->type_id ); + dprintf_info(resource, " Skipping type %04x\n", pTypeInfo->type_id ); pTypeInfo = NEXT_TYPEINFO(pTypeInfo); } } @@ -128,10 +127,10 @@ static NE_TYPEINFO* NE_FindTypeSection( NE_MODULE *pModule, { if (pTypeInfo->type_id == id) { - dprintf_resource( stddeb, " Found type %04x\n", id ); + dprintf_info(resource, " Found type %04x\n", id ); return pTypeInfo; } - dprintf_resource( stddeb, " Skipping type %04x\n", pTypeInfo->type_id ); + dprintf_info(resource, " Skipping type %04x\n", pTypeInfo->type_id ); pTypeInfo = NEXT_TYPEINFO(pTypeInfo); } } @@ -189,7 +188,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule, WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table); NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc); - dprintf_resource( stddeb, "NEResourceHandler: loading, pos=%d, len=%d\n", + dprintf_info(resource, "NEResourceHandler: loading, pos=%d, len=%d\n", (int)pNameInfo->offset << sizeShift, (int)pNameInfo->length << sizeShift ); if( hMemObj ) @@ -217,7 +216,7 @@ BOOL32 NE_InitResourceHandler( HMODULE16 hModule ) NE_MODULE *pModule = MODULE_GetPtr( hModule ); NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2); - dprintf_resource(stddeb,"InitResourceHandler[%04x]\n", hModule ); + dprintf_info(resource,"InitResourceHandler[%04x]\n", hModule ); while(pTypeInfo->type_id) { @@ -280,15 +279,15 @@ HRSRC16 NE_FindResource( HMODULE16 hModule, SEGPTR typeId, SEGPTR resId ) hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId); if( hRsrc ) { - dprintf_resource( stddeb, " Found id %08lx\n", resId ); + dprintf_info(resource, " Found id %08lx\n", resId ); return hRsrc; } - dprintf_resource( stddeb, " Not found, going on\n" ); + dprintf_info(resource, " Not found, going on\n" ); pTypeInfo = NEXT_TYPEINFO(pTypeInfo); } } while( pTypeInfo ); - dprintf_resource( stddeb, "failed!\n"); + dprintf_warn(resource, "failed!\n"); return 0; } @@ -389,7 +388,7 @@ HGLOBAL16 NE_LoadResource( HMODULE16 hModule, HRSRC16 hRsrc ) && !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED)) { pNameInfo->usage++; - dprintf_resource( stddeb, " Already loaded, new count=%d\n", + dprintf_info(resource, " Already loaded, new count=%d\n", pNameInfo->usage ); } else @@ -460,7 +459,7 @@ BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle ) pTypeInfo = (NE_TYPEINFO *)pNameInfo; } - dprintf_resource(stddeb, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n", + dprintf_info(resource, "NE_FreeResource[%04x]: no intrinsic resource for %04x\n", hModule, handle ); GlobalFree16( handle ); /* it could have been DirectResAlloc()'ed */ return handle; diff --git a/loader/pe_image.c b/loader/pe_image.c index 96a9b1569d0..842c7f7611d 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -1,7 +1,7 @@ /* * Copyright 1994 Eric Youndale & Erik Bos * Copyright 1995 Martin von Löwis - * Copyright 1996 Marcus Meissner + * Copyright 1996-98 Marcus Meissner * * based on Eric Youndale's pe-test and: * @@ -9,8 +9,26 @@ * make that: * ftp.microsoft.com:/developr/MSDN/OctCD/PEFILE.ZIP */ +/* Notes: + * Before you start changing something in this file be aware of the following: + * + * - There are several functions called recursively. In a very subtle and + * obscure way. DLLs can reference each other recursively etc. + * - If you want to enhance, speed up or clean up something in here, think + * twice WHY it is implemented in that strange way. There is usually a reason. + * Though sometimes it might just be lazyness ;) + * - In PE_MapImage, right before fixup_imports() all external and internal + * state MUST be correct since this function can be called with the SAME image + * AGAIN. (Thats recursion for you.) That means MODREF.module and + * NE_MODULE.module32. + * - No, you cannot use Linux mmap() to mmap() the images directly. Linux aligns + * them at pagesize (4096), Win32 requires 512 byte alignment. + * - All those function map things into a new addresspace. From the wrong + * process and the wrong thread. So calling other API functions will mess + * things up badly sometimes. + */ -#include +/*#include */ #include #include #include @@ -32,7 +50,6 @@ #include "global.h" #include "task.h" #include "ldt.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -57,7 +74,7 @@ void dump_exports( HMODULE32 hModule ) IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start); Module = (char*)RVA(pe_exports->Name); - dprintf_win32(stddeb,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n", + dprintf_info(win32,"\n*******EXPORT DATA*******\nModule name is %s, %ld functions, %ld names\n", Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames); @@ -66,19 +83,23 @@ void dump_exports( HMODULE32 hModule ) functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions); name=(u_char**) RVA(pe_exports->AddressOfNames); - dprintf_win32(stddeb," Ord RVA Addr Name\n" ); + dprintf_info(win32," Ord RVA Addr Name\n" ); for (i=0;iNumberOfFunctions;i++, function++) { if (!*function) continue; /* No such function */ - dprintf_win32( stddeb,"%4ld %08lx %08x", - i + pe_exports->Base, *function, RVA(*function) ); - /* Check if we have a name for it */ - for (j = 0; j < pe_exports->NumberOfNames; j++) + if (debugging_info(win32)){ + dbg_decl_str(win32, 1024); + + dsprintf(win32,"%4ld %08lx %08x", + i + pe_exports->Base, *function, RVA(*function) ); + /* Check if we have a name for it */ + for (j = 0; j < pe_exports->NumberOfNames; j++) if (ordinal[j] == i) - dprintf_win32( stddeb, " %s", (char*)RVA(name[j]) ); - if ((*function >= rva_start) && (*function <= rva_end)) - dprintf_win32(stddeb, " (forwarded -> %s)", (char *)RVA(*function)); - dprintf_win32( stddeb,"\n" ); + dsprintf(win32, " %s", (char*)RVA(name[j]) ); + if ((*function >= rva_start) && (*function <= rva_end)) + dsprintf(win32, " (forwarded -> %s)", (char *)RVA(*function)); + dprintf_info(win32,"%s\n", dbg_str(win32)); + } } } @@ -114,9 +135,9 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule, exports = pem->pe_export; if (HIWORD(funcName)) - dprintf_win32(stddeb,"PE_FindExportedFunction(%s)\n",funcName); + dprintf_info(win32,"PE_FindExportedFunction(%s)\n",funcName); else - dprintf_win32(stddeb,"PE_FindExportedFunction(%d)\n",(int)funcName); + dprintf_info(win32,"PE_FindExportedFunction(%d)\n",(int)funcName); if (!exports) { fprintf(stderr,"Module %08x/MODREF %p doesn't have a exports table.\n",hModule,pem); return NULL; @@ -136,6 +157,7 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule, if(!strcmp(ename,funcName)) { addr = function[*ordinal]; + if (!addr) return NULL; if ((addr < rva_start) || (addr >= rva_end)) return (FARPROC32)RVA(addr); forward = (char *)RVA(addr); @@ -146,11 +168,12 @@ FARPROC32 PE_FindExportedFunction( PDB32 *process, HMODULE32 hModule, } } else { if (LOWORD(funcName)-exports->Base > exports->NumberOfFunctions) { - dprintf_win32(stddeb," ordinal %d out of range!\n", + dprintf_info(win32," ordinal %d out of range!\n", LOWORD(funcName)); return NULL; } addr = function[(int)funcName-exports->Base]; + if (!addr) return NULL; if ((addr < rva_start) || (addr >= rva_end)) return (FARPROC32)RVA(addr); forward = (char *)RVA(addr); @@ -183,7 +206,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) modname = ""; /* OK, now dump the import list */ - dprintf_win32 (stddeb, "\nDumping imports list\n"); + dprintf_info(win32, "\nDumping imports list\n"); /* first, count the number of imported non-internal modules */ pe_imp = pem->pe_import; @@ -230,27 +253,24 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) xpem = xpem->next; } if (xpem) { - /* it has been loaded *BEFORE* us, so we have to init - * it before us. we just swap the two modules which should - * work. + /* It has been loaded *BEFORE* us, so we have to initialize + * it before us. We cannot just link in the xpem before pem, + * since xpem might reference more dlls which would be in the + * wrong order after that. + * Instead we link in pem right AFTER xpem, which should keep + * the correct order. (I am not 100% sure about that.) */ - /* unlink xpem from chain */ + /* unlink pem from chain */ ypem = &(process->modref_list); - while (*ypem) { - if ((*ypem)==xpem) - break; - ypem = &((*ypem)->next); - } - *ypem = xpem->next; - - /* link it directly before pem */ - ypem = &(process->modref_list); while (*ypem) { if ((*ypem)==pem) break; ypem = &((*ypem)->next); } - *ypem = xpem; + *ypem = pem->next; + + /* link pem directly AFTER xpem */ + pem->next = xpem->next; xpem->next = pem; } @@ -265,12 +285,12 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) Module = (char *) RVA(pe_imp->Name); hImpModule = MODULE_HANDLEtoHMODULE32( MODULE_FindModule(Module) ); - dprintf_win32 (stddeb, "%s\n", Module); + dprintf_info(win32, "%s\n", Module); /* FIXME: forwarder entries ... */ if (pe_imp->u.OriginalFirstThunk != 0) { /* original MS style */ - dprintf_win32 (stddeb, "Microsoft style imports used\n"); + dprintf_info(win32, "Microsoft style imports used\n"); import_list =(LPIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk); thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk); @@ -278,7 +298,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) { int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal); - dprintf_win32 (stddeb, "--- Ordinal %s,%d\n", Module, ordinal); + dprintf_info(win32, "--- Ordinal %s,%d\n", Module, ordinal); thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( process, hImpModule, (LPCSTR)ordinal); if (!thunk_list->u1.Function) { @@ -288,7 +308,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) } } else { /* import by name */ pe_name = (LPIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData); - dprintf_win32 (stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint); + dprintf_info(win32, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint); thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( process, hImpModule, pe_name->Name); if (!thunk_list->u1.Function) { @@ -301,14 +321,14 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) thunk_list++; } } else { /* Borland style */ - dprintf_win32 (stddeb, "Borland style imports used\n"); + dprintf_info(win32, "Borland style imports used\n"); thunk_list = (LPIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk); while (thunk_list->u1.Ordinal) { if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) { /* not sure about this branch, but it seems to work */ int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal); - dprintf_win32(stddeb,"--- Ordinal %s.%d\n",Module,ordinal); + dprintf_info(win32,"--- Ordinal %s.%d\n",Module,ordinal); thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( process, hImpModule, (LPCSTR) ordinal); if (!thunk_list->u1.Function) { @@ -318,7 +338,7 @@ DWORD fixup_imports (PDB32 *process,PE_MODREF *pem,HMODULE32 hModule) } } else { pe_name=(LPIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData); - dprintf_win32(stddeb,"--- %s %s.%d\n", + dprintf_info(win32,"--- %s %s.%d\n", pe_name->Name,Module,pe_name->Hint); thunk_list->u1.Function=(LPDWORD)PE_FindExportedFunction( process, hImpModule, pe_name->Name ); @@ -342,11 +362,11 @@ static int calc_vma_size( HMODULE32 hModule ) int i,vma_size = 0; IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule); - dprintf_win32(stddeb, "Dump of segment table\n"); - dprintf_win32(stddeb, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n"); + dprintf_info(win32, "Dump of segment table\n"); + dprintf_info(win32, " Name VSz Vaddr SzRaw Fileadr *Reloc *Lineum #Reloc #Linum Char\n"); for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++) { - dprintf_win32(stddeb, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", + dprintf_info(win32, "%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", pe_seg->Name, pe_seg->Misc.VirtualSize, pe_seg->VirtualAddress, @@ -381,14 +401,14 @@ static void do_relocations(PE_MODREF *pem) char *page = (char*) RVA(r->VirtualAddress); int count = (r->SizeOfBlock - 8)/2; int i; - dprintf_fixup(stddeb, "%x relocations for page %lx\n", + dprintf_info(fixup, "%x relocations for page %lx\n", count, r->VirtualAddress); /* patching in reverse order */ for(i=0;iTypeOffset[i] & 0xFFF; int type = r->TypeOffset[i] >> 12; - dprintf_fixup(stddeb,"patching %x type %x\n", offset, type); + dprintf_info(fixup,"patching %x type %x\n", offset, type); switch(type) { case IMAGE_REL_BASED_ABSOLUTE: break; @@ -495,8 +515,8 @@ error: /********************************************************************** * This maps a loaded PE dll into the address space of the specified process. */ -static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, - OFSTRUCT *ofs, DWORD flags ) +static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process, + OFSTRUCT *ofs, DWORD flags ) { PE_MODREF *pem; int i, result; @@ -504,6 +524,7 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, IMAGE_DATA_DIRECTORY dir; char *modname; int vma_size; + HMODULE32 hModule = *phModule; IMAGE_SECTION_HEADER *pe_seg; IMAGE_DOS_HEADER *dos_header = (IMAGE_DOS_HEADER *)hModule; @@ -524,7 +545,7 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, load_addr = nt_header->OptionalHeader.ImageBase; vma_size = calc_vma_size( hModule ); - dprintf_win32(stddeb, "Load addr is %lx\n",load_addr); + dprintf_info(win32, "Load addr is %lx\n",load_addr); load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); @@ -533,9 +554,12 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); } - pem->module = (HMODULE32)load_addr; + /* *phModule is the module32 entry in the NE_MODULE. We need to + * change it here, since it can get referenced by fixup_imports() + */ + pem->module = *phModule = (HMODULE32)load_addr; - dprintf_win32(stddeb, "Load addr is really %lx, range %x\n", + dprintf_info(win32, "Load addr is really %lx, range %x\n", load_addr, vma_size); /* Store the NT header at the load addr @@ -611,10 +635,10 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, } if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size) - dprintf_win32(stdnimp,"Exception directory ignored\n"); + dprintf_fixme(win32,"Exception directory ignored\n"); if(nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY].Size) - dprintf_win32(stdnimp,"Security directory ignored\n"); + dprintf_fixme(win32,"Security directory ignored\n"); @@ -628,29 +652,29 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, if(nt_header->OptionalHeader.DataDirectory [IMAGE_DIRECTORY_ENTRY_COPYRIGHT].Size) - dprintf_win32(stdnimp,"Copyright string ignored\n"); + dprintf_fixme(win32,"Copyright string ignored\n"); if(nt_header->OptionalHeader.DataDirectory [IMAGE_DIRECTORY_ENTRY_GLOBALPTR].Size) - dprintf_win32(stdnimp,"Global Pointer (MIPS) ignored\n"); + dprintf_fixme(win32,"Global Pointer (MIPS) ignored\n"); if(nt_header->OptionalHeader.DataDirectory [IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG].Size) - dprintf_win32(stdnimp,"Load Configuration directory ignored\n"); + dprintf_fixme(win32,"Load Configuration directory ignored\n"); if(nt_header->OptionalHeader.DataDirectory [IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT].Size) - dprintf_win32(stdnimp,"Bound Import directory ignored\n"); + dprintf_fixme(win32,"Bound Import directory ignored\n"); if(nt_header->OptionalHeader.DataDirectory [IMAGE_DIRECTORY_ENTRY_IAT].Size) - dprintf_win32(stdnimp,"Import Address Table directory ignored\n"); + dprintf_fixme(win32,"Import Address Table directory ignored\n"); if(nt_header->OptionalHeader.DataDirectory[13].Size) - dprintf_win32(stdnimp,"Unknown directory 13 ignored\n"); + dprintf_fixme(win32,"Unknown directory 13 ignored\n"); if(nt_header->OptionalHeader.DataDirectory[14].Size) - dprintf_win32(stdnimp,"Unknown directory 14 ignored\n"); + dprintf_fixme(win32,"Unknown directory 14 ignored\n"); if(nt_header->OptionalHeader.DataDirectory[15].Size) - dprintf_win32(stdnimp,"Unknown directory 15 ignored\n"); + dprintf_fixme(win32,"Unknown directory 15 ignored\n"); if(pem->pe_reloc) do_relocations(pem); if(pem->pe_export) dump_exports(pem->module); @@ -691,7 +715,7 @@ static HMODULE32 PE_MapImage( HMODULE32 hModule, PDB32 *process, /* Now that we got everything at the right address, * we can unmap the previous module */ UnmapViewOfFile( (LPVOID)hModule ); - return (HMODULE32)load_addr; + return 1; } HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params); @@ -705,7 +729,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process, HFILE32 hFile, DWORD flags) { OFSTRUCT ofs; - HMODULE32 hModule,ret; + HMODULE32 hModule; NE_MODULE *pModule; PE_MODREF *pem; @@ -767,13 +791,11 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process, if (pModule->module32 < 32) return 21; } /* recurse */ - ret = PE_MapImage( pModule->module32, process, &ofs,flags); - if (!ret) { + if (!PE_MapImage( &(pModule->module32), process, &ofs,flags)) { /* should free this module and the already referenced ones */ return 0; } - pModule->module32 = ret; - return ret; + return pModule->module32; } /***************************************************************************** @@ -784,7 +806,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process, HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params ) { HMODULE16 hModule16; - HMODULE32 hModule32, ret; + HMODULE32 hModule32; HINSTANCE16 hInstance; NE_MODULE *pModule; THDB *thdb = THREAD_Current(); @@ -807,20 +829,19 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params ) TDB *pTask = (TDB *)GlobalLock16( hTask ); thdb = pTask->thdb; } - if (!(ret = PE_MapImage( hModule32, thdb->process, ofs, 0 ))) + if (!PE_MapImage( &(pModule->module32), thdb->process, ofs, 0 )) { - /* FIXME: should destroy the task created ... */ + /* FIXME: should destroy the task created and free referenced stuff */ return 0; } - pModule->module32 = ret; - /* yuck. but there is no other good place to do that... */ + /* FIXME: Yuck. Is there no other good place to do that? */ PE_InitTls( thdb ); return hInstance; } int PE_UnloadImage( HMODULE32 hModule ) { - printf("PEunloadImage() called!\n"); + fprintf(stderr,"PEunloadImage() called!\n"); /* free resources, image, unmap */ return 1; } @@ -848,7 +869,7 @@ static void PE_InitDLL(PE_MODREF *pem, DWORD type,LPVOID lpReserved) ) { FARPROC32 entry = (FARPROC32)RVA_PTR( pem->module, OptionalHeader.AddressOfEntryPoint ); - dprintf_relay( stddeb, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n", + dprintf_info(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n", entry, pem->module, type, lpReserved ); entry( pem->module, type, lpReserved ); } @@ -899,7 +920,7 @@ void PE_InitTls(THDB *thdb) DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress); if (!(pem->flags & PE_MODREF_TLS_ALLOCED)) { - pem->tlsindex = TlsAlloc(); + pem->tlsindex = THREAD_TlsAlloc(thdb); *(pdir->AddressOfIndex)=pem->tlsindex; } pem->flags |= PE_MODREF_TLS_ALLOCED; @@ -929,4 +950,3 @@ BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32 hModule) } return TRUE; } - diff --git a/loader/pe_resource.c b/loader/pe_resource.c index 60fa5b8b874..da06142d72e 100644 --- a/loader/pe_resource.c +++ b/loader/pe_resource.c @@ -22,7 +22,6 @@ #include "libres.h" #include "stackframe.h" #include "neexe.h" -#include "stddebug.h" #include "debug.h" /********************************************************************** diff --git a/loader/resource.c b/loader/resource.c index 5e98fb5d279..8d7ad812f1f 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -20,16 +20,10 @@ #include "task.h" #include "module.h" #include "resource.h" -#include "stddebug.h" +#include "debugstr.h" #include "debug.h" #include "libres.h" -#define PrintId(name) \ - if (HIWORD((DWORD)name)) \ - dprintf_resource( stddeb, "'%s'", (char *)PTR_SEG_TO_LIN(name)); \ - else \ - dprintf_resource( stddeb, "#%04x", LOWORD(name)); - extern WORD WINE_LanguageId; /* error message when 16-bit resource function is called for Win32 module */ @@ -45,28 +39,30 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type ) NE_MODULE *pModule; hModule = MODULE_HANDLEtoHMODULE16( hModule ); - dprintf_resource(stddeb, "FindResource16: module=%04x", hModule ); if (HIWORD(name)) /* Check for '#xxx' name */ { char *ptr = PTR_SEG_TO_LIN( name ); if (ptr[0] == '#') - if (!(name = (SEGPTR)atoi( ptr + 1 ))) return 0; + if (!(name = (SEGPTR)atoi( ptr + 1 ))) { + dprintf_warn(resource, "Incorrect resource name: %s\n", ptr); + return 0; + } } - dprintf_resource( stddeb, " name=" ); - PrintId( name ); - if (HIWORD(type)) /* Check for '#xxx' type */ { char *ptr = PTR_SEG_TO_LIN( type ); if (ptr[0] == '#') - if (!(type = (SEGPTR)atoi( ptr + 1 ))) return 0; + if (!(type = (SEGPTR)atoi( ptr + 1 ))){ + dprintf_warn(resource, "Incorrect resource type: %s\n", ptr); + return 0; + } } - dprintf_resource( stddeb, " type=" ); - PrintId( type ); - dprintf_resource( stddeb, "\n" ); + dprintf_info(resource, "FindResource16: module=%04x name=%s type=%s\n", + hModule, debugres(PTR_SEG_TO_LIN(name)), + debugres(PTR_SEG_TO_LIN(type)) ); if ((pModule = MODULE_GetPtr( hModule ))) { @@ -129,18 +125,11 @@ HRSRC32 WINAPI FindResourceEx32W( HINSTANCE32 hModule, LPCWSTR name, if (!hModule) hModule = GetTaskDS(); hModule = MODULE_HANDLEtoHMODULE32( hModule ); - dprintf_resource(stddeb, "FindResource32W: module=%08x type=", - hModule ); - if (HIWORD(type)) - dprintf_resource(stddeb,"%p",type); - else - dprintf_resource(stddeb,"#%p",type); - dprintf_resource( stddeb, " name=" ); - if (HIWORD(name)) - dprintf_resource(stddeb,"%p",name); - else - dprintf_resource(stddeb,"#%p",name); - dprintf_resource( stddeb, "\n" ); + dprintf_info(resource, "FindResource32W: module=%08x " + "type=%s%p name=%s%p\n", hModule, + (HIWORD(type))? "" : "#", type, + (HIWORD(name))? "" : "#", name); + if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!(pModule->flags & NE_FFLAGS_WIN32)) return 0; return PE_FindResourceEx32W(hModule,name,type,lang); @@ -165,7 +154,7 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc ) NE_MODULE *pModule; hModule = MODULE_HANDLEtoHMODULE16( hModule ); - dprintf_resource(stddeb, "LoadResource16: module=%04x res=%04x\n", + dprintf_info(resource, "LoadResource16: module=%04x res=%04x\n", hModule, hRsrc ); if (!hRsrc) return 0; if ((pModule = MODULE_GetPtr( hModule ))) @@ -193,7 +182,7 @@ HGLOBAL32 WINAPI LoadResource32( HINSTANCE32 hModule, HRSRC32 hRsrc ) if (!hModule) hModule = GetTaskDS(); /* FIXME: see FindResource32W */ hModule = MODULE_HANDLEtoHMODULE32( hModule ); - dprintf_resource(stddeb, "LoadResource32: module=%04x res=%04x\n", + dprintf_info(resource, "LoadResource32: module=%04x res=%04x\n", hModule, hRsrc ); if (!hRsrc) return 0; @@ -218,7 +207,7 @@ SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16 handle) HMODULE16 hModule; NE_MODULE *pModule; - dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle ); + dprintf_info(resource, "LockResource: handle=%04x\n", handle ); if (!handle) return (SEGPTR)0; hModule = MODULE_HANDLEtoHMODULE16( handle ); if (!(pModule = MODULE_GetPtr( hModule ))) return 0; @@ -238,7 +227,7 @@ LPVOID WINAPI LockResource16( HGLOBAL16 handle ) HMODULE16 hModule; NE_MODULE *pModule; - dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle ); + dprintf_info(resource, "LockResource: handle=%04x\n", handle ); if (!handle) return NULL; hModule = MODULE_HANDLEtoHMODULE16( handle ); if (!(pModule = MODULE_GetPtr( hModule ))) return 0; @@ -272,7 +261,7 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle ) HMODULE16 hModule; NE_MODULE *pModule; - dprintf_resource(stddeb, "FreeResource16: handle=%04x\n", handle ); + dprintf_info(resource, "FreeResource16: handle=%04x\n", handle ); if (!handle) return FALSE; hModule = MODULE_HANDLEtoHMODULE16( handle ); if (!(pModule = MODULE_GetPtr( hModule ))) return 0; @@ -304,7 +293,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc ) NE_MODULE *pModule; hModule = MODULE_HANDLEtoHMODULE16( hModule ); - dprintf_resource(stddeb, "AccessResource16: module=%04x res=%04x\n", + dprintf_info(resource, "AccessResource16: module=%04x res=%04x\n", hModule, hRsrc ); if (!hRsrc) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0; @@ -327,7 +316,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc ) INT32 WINAPI AccessResource32( HINSTANCE32 hModule, HRSRC32 hRsrc ) { hModule = MODULE_HANDLEtoHMODULE32( hModule ); - dprintf_resource(stddeb, "AccessResource: module=%04x res=%04x\n", + dprintf_info(resource, "AccessResource: module=%04x res=%04x\n", hModule, hRsrc ); if (!hRsrc) return 0; fprintf(stderr,"AccessResource32: not implemented\n"); @@ -343,7 +332,7 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc ) NE_MODULE *pModule; hModule = MODULE_HANDLEtoHMODULE16( hModule ); - dprintf_resource(stddeb, "SizeofResource16: module=%04x res=%04x\n", + dprintf_info(resource, "SizeofResource16: module=%04x res=%04x\n", hModule, hRsrc ); if (!(pModule = MODULE_GetPtr( hModule ))) return 0; if (!__winelib) @@ -365,7 +354,7 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc ) DWORD WINAPI SizeofResource32( HINSTANCE32 hModule, HRSRC32 hRsrc ) { hModule = MODULE_HANDLEtoHMODULE32( hModule ); - dprintf_resource(stddeb, "SizeofResource32: module=%04x res=%04x\n", + dprintf_info(resource, "SizeofResource32: module=%04x res=%04x\n", hModule, hRsrc ); if (!__winelib) return PE_SizeofResource32(hModule,hRsrc); else @@ -384,7 +373,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size) NE_MODULE *pModule; hModule = MODULE_HANDLEtoHMODULE16( hModule ); - dprintf_resource(stddeb, "AllocResource: module=%04x res=%04x size=%ld\n", + dprintf_info(resource, "AllocResource: module=%04x res=%04x size=%ld\n", hModule, hRsrc, size ); if (!hRsrc) return 0; if (!(pModule = MODULE_GetPtr( hModule ))) return 0; @@ -408,7 +397,7 @@ HGLOBAL16 WINAPI AllocResource16( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size) HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType, UINT16 wSize ) { - dprintf_resource(stddeb,"DirectResAlloc(%04x,%04x,%04x)\n", + dprintf_info(resource,"DirectResAlloc(%04x,%04x,%04x)\n", hInstance, wType, wSize ); hInstance = MODULE_HANDLEtoHMODULE16(hInstance); if(!hInstance)return 0; @@ -427,10 +416,10 @@ HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, SEGPTR lpTableName) HRSRC16 hRsrc; if (HIWORD(lpTableName)) - dprintf_accel( stddeb, "LoadAccelerators: %04x '%s'\n", + dprintf_info(accel, "LoadAccelerators: %04x '%s'\n", instance, (char *)PTR_SEG_TO_LIN( lpTableName ) ); else - dprintf_accel( stddeb, "LoadAccelerators: %04x %04x\n", + dprintf_info(accel, "LoadAccelerators: %04x %04x\n", instance, LOWORD(lpTableName) ); if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR ))) @@ -452,10 +441,10 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName) HRSRC32 hRsrc; if (HIWORD(lpTableName)) - dprintf_accel( stddeb, "LoadAccelerators: %04x '%s'\n", + dprintf_info(accel, "LoadAccelerators: %04x '%s'\n", instance, (char *)( lpTableName ) ); else - dprintf_accel( stddeb, "LoadAccelerators: %04x %04x\n", + dprintf_info(accel, "LoadAccelerators: %04x %04x\n", instance, LOWORD(lpTableName) ); if (!(hRsrc = FindResource32W( instance, lpTableName, @@ -516,7 +505,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id, int string_num; int i; - dprintf_resource(stddeb,"LoadString: inst=%04x id=%04x buff=%08x len=%d\n", + dprintf_info(resource,"LoadString: inst=%04x id=%04x buff=%08x len=%d\n", instance, resource_id, (int) buffer, buflen); hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING ); @@ -529,7 +518,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id, for (i = 0; i < string_num; i++) p += *p + 1; - dprintf_resource( stddeb, "strlen = %d\n", (int)*p ); + dprintf_info(resource, "strlen = %d\n", (int)*p ); i = MIN(buflen - 1, *p); if (buffer == NULL) @@ -547,7 +536,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id, } FreeResource16( hmem ); - dprintf_resource(stddeb,"LoadString // '%s' copied !\n", buffer); + dprintf_info(resource,"LoadString // '%s' copied !\n", buffer); return i; } @@ -565,7 +554,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id, if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */ resource_id = (UINT32)(-((INT32)resource_id)); - dprintf_resource(stddeb, "LoadString: instance = %04x, id = %04x, buffer = %08x, " + dprintf_info(resource, "LoadString: instance = %04x, id = %04x, buffer = %08x, " "length = %d\n", instance, (int)resource_id, (int) buffer, buflen); hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1), @@ -579,7 +568,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id, for (i = 0; i < string_num; i++) p += *p + 1; - dprintf_resource( stddeb, "strlen = %d\n", (int)*p ); + dprintf_info(resource, "strlen = %d\n", (int)*p ); i = MIN(buflen - 1, *p); if (buffer == NULL) @@ -598,7 +587,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id, #endif } #if 0 - dprintf_resource(stddeb,"LoadString // '%s' copied !\n", buffer); + dprintf_info(resource,"LoadString // '%s' copied !\n", buffer); #endif return i; } @@ -669,8 +658,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang, CHAR str[1]; } *stre; - dprintf_resource(stddeb, "LoadMessage: instance = %04x, id = %04x, buffer = %08x, " - "length = %d\n", instance, (int)id, (int) buffer, buflen); + dprintf_info(resource, "LoadMessage: 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*/ hrsrc = FindResourceEx32W(instance,(LPWSTR)1,(LPCWSTR)RT_MESSAGELIST,lang); @@ -698,7 +686,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang, stre = (struct _stringentry*)(((char*)stre)+slen); } slen=stre->len; - dprintf_resource(stddeb," - strlen=%d\n",slen); + dprintf_info(resource," - strlen=%d\n",slen); i = MIN(buflen - 1, slen); if (buffer == NULL) return slen; /* different to LoadString */ @@ -712,7 +700,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang, } } if (buffer) - dprintf_resource(stddeb,"LoadMessage // '%s' copied !\n", buffer); + dprintf_info(resource,"LoadMessage // '%s' copied !\n", buffer); return i; } @@ -749,14 +737,13 @@ FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR s, hModule = GetExePtr( hModule ); - dprintf_resource(stddeb, "SetResourceHandler: module=%04x type=", hModule ); - PrintId( s ); - dprintf_resource( stddeb, "\n" ); + dprintf_info(resource, "SetResourceHandler: module=%04x type=%s\n", + hModule, debugres(PTR_SEG_TO_LIN(s)) ); if ((pModule = MODULE_GetPtr( hModule ))) { if (pModule->flags & NE_FFLAGS_WIN32) - fprintf(stderr,"SetResourceHandler: %s", NEWin32FailureString); + fprintf(stderr,"SetResourceHandler: %s\n", NEWin32FailureString); else if (pModule->res_table) return NE_SetResourceHandler( hModule, s, resourceHandler ); } diff --git a/loader/signal.c b/loader/signal.c index 66def5d1f27..0092b22902b 100644 --- a/loader/signal.c +++ b/loader/signal.c @@ -33,6 +33,7 @@ #if defined(linux) && defined(__i386__) /* This is the sigaction structure from the Linux 2.1.20 kernel. */ +#undef sa_handler struct kernel_sigaction { void (*sa_handler)(); diff --git a/loader/task.c b/loader/task.c index eeeaeb0edc3..ce56b0ae6d1 100644 --- a/loader/task.c +++ b/loader/task.c @@ -29,7 +29,6 @@ #include "toolhelp.h" #include "winnt.h" #include "thread.h" -#include "stddebug.h" #include "debug.h" #include "dde_proc.h" @@ -177,9 +176,9 @@ static HGLOBAL16 TASK_CreateDOSEnvironment(void) /* Display it */ p = (char *) GlobalLock16( handle ); - dprintf_task(stddeb, "Master DOS environment at %p\n", p); - for (; *p; p += strlen(p) + 1) dprintf_task(stddeb, " %s\n", p); - dprintf_task( stddeb, "Progname: %s\n", p+3 ); + dprintf_info(task, "Master DOS environment at %p\n", p); + for (; *p; p += strlen(p) + 1) dprintf_info(task, " %s\n", p); + dprintf_info(task, "Progname: %s\n", p+3 ); return handle; } @@ -348,7 +347,7 @@ static void TASK_CallToStart(void) InitApp( pTask->hModule ); PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, (LPVOID)-1 ); - dprintf_relay( stddeb, "CallTo32(entryproc=%p)\n", entry ); + dprintf_info(relay, "CallTo32(entryproc=%p)\n", entry ); exit_code = entry(); TASK_KillCurrentTask( exit_code ); } @@ -377,7 +376,7 @@ static void TASK_CallToStart(void) ECX_reg(&context) = pModule->heap_size; EDI_reg(&context) = context.SegDs; - dprintf_task( stddeb, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n", + dprintf_info(task, "Starting main program: cs:ip=%04lx:%04x ds=%04lx ss:sp=%04x:%04x\n", CS_reg(&context), IP_reg(&context), DS_reg(&context), SELECTOROF(pTask->thdb->cur_stack), OFFSETOF(pTask->thdb->cur_stack) ); @@ -564,7 +563,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance, TASK_LinkTask( hTask ); - dprintf_task( stddeb, "CreateTask: module='%s' cmdline='%s' task=%04x\n", + dprintf_info(task, "CreateTask: module='%s' cmdline='%s' task=%04x\n", name, cmdLine, hTask ); return hTask; @@ -622,7 +621,7 @@ void TASK_KillCurrentTask( INT16 exitCode ) TDB* pTask = (TDB*) GlobalLock16( hCurrentTask ); if (!pTask) USER_ExitWindows(); /* No current task yet */ - dprintf_task(stddeb, "Killing task %04x\n", hCurrentTask ); + dprintf_info(task, "Killing task %04x\n", hCurrentTask ); /* Delete active sockets */ @@ -644,7 +643,7 @@ void TASK_KillCurrentTask( INT16 exitCode ) if (nTaskCount <= 1) { - dprintf_task( stddeb, "\nthis is the last task, exiting\n" ); + dprintf_info(task, "\nthis is the last task, exiting\n" ); USER_ExitWindows(); } @@ -725,7 +724,7 @@ void TASK_Reschedule(void) { pNewTask = (TDB *)GlobalLock16( hTask ); - dprintf_task( stddeb, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents); + dprintf_info(task, "\ttask = %04x, events = %i\n", hTask, pNewTask->nEvents); if (pNewTask->nEvents) break; hTask = pNewTask->hNext; @@ -740,11 +739,11 @@ void TASK_Reschedule(void) if (hTask == hCurrentTask) { - dprintf_task( stddeb, "returning to the current task(%04x)\n", hTask ); + dprintf_info(task, "returning to the current task(%04x)\n", hTask ); return; /* Nothing to do */ } pNewTask = (TDB *)GlobalLock16( hTask ); - dprintf_task( stddeb, "Switching to task %04x (%.8s)\n", + dprintf_info(task, "Switching to task %04x (%.8s)\n", hTask, pNewTask->module_name ); /* Make the task the last in the linked list (round-robin scheduling) */ @@ -1013,7 +1012,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance ) thunk = PTR_SEG_TO_LIN( thunkaddr ); lfunc = PTR_SEG_TO_LIN( func ); - dprintf_task( stddeb, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n", + dprintf_info(task, "MakeProcInstance(%08lx,%04x): got thunk %08lx\n", (DWORD)func, hInstance, (DWORD)thunkaddr ); if (((lfunc[0]==0x8c) && (lfunc[1]==0xd8)) || ((lfunc[0]==0x1e) && (lfunc[1]==0x58)) @@ -1037,7 +1036,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance ) */ void WINAPI FreeProcInstance16( FARPROC16 func ) { - dprintf_task( stddeb, "FreeProcInstance(%08lx)\n", (DWORD)func ); + dprintf_info(task, "FreeProcInstance(%08lx)\n", (DWORD)func ); if (!__winelib) TASK_FreeThunk( hCurrentTask, (SEGPTR)func ); } @@ -1119,7 +1118,7 @@ void WINAPI SwitchStackTo( WORD seg, WORD ptr, WORD top ) if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return; if (!(pData = (INSTANCEDATA *)GlobalLock16( seg ))) return; - dprintf_task( stddeb, "SwitchStackTo: old=%04x:%04x new=%04x:%04x\n", + dprintf_info(task, "SwitchStackTo: old=%04x:%04x new=%04x:%04x\n", SELECTOROF( pTask->thdb->cur_stack ), OFFSETOF( pTask->thdb->cur_stack ), seg, ptr ); @@ -1168,7 +1167,7 @@ void WINAPI SwitchStackBack(void) fprintf( stderr, "SwitchStackBack: no previous SwitchStackTo\n" ); return; } - dprintf_task( stddeb, "SwitchStackBack: restoring stack %04x:%04x\n", + dprintf_info(task, "SwitchStackBack: restoring stack %04x:%04x\n", SELECTOROF(pData->old_ss_sp), OFFSETOF(pData->old_ss_sp) ); oldFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack ); @@ -1182,7 +1181,7 @@ void WINAPI SwitchStackBack(void) newFrame = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack ); newFrame->frame32 = oldFrame->frame32; - if (debugging_relay) + if (debugging_info(relay)) { newFrame->entry_ip = oldFrame->entry_ip; newFrame->entry_cs = oldFrame->entry_cs; @@ -1447,7 +1446,7 @@ BOOL16 WINAPI TaskNext( TASKENTRY *lpte ) TDB *pTask; INSTANCEDATA *pInstData; - dprintf_toolhelp( stddeb, "TaskNext(%p): task=%04x\n", lpte, lpte->hNext ); + dprintf_info(toolhelp, "TaskNext(%p): task=%04x\n", lpte, lpte->hNext ); if (!lpte->hNext) return FALSE; pTask = (TDB *)GlobalLock16( lpte->hNext ); if (!pTask || pTask->magic != TDB_MAGIC) return FALSE; diff --git a/memory/global.c b/memory/global.c index 8dafd4747eb..af33ce0df31 100644 --- a/memory/global.c +++ b/memory/global.c @@ -18,7 +18,6 @@ #include "dde_mem.h" #include "stackframe.h" #include "module.h" -#include "stddebug.h" #include "debug.h" #include "winerror.h" @@ -50,6 +49,7 @@ static int globalArenaSize = 0; #define GLOBAL_MAX_ALLOC_SIZE 0x00ff0000 /* Largest allocation is 16M - 64K */ +#define VALID_HANDLE(handle) (((handle)>>__AHSHIFT)> __AHSHIFT)) /*********************************************************************** @@ -165,6 +165,8 @@ BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle ) if (!handle) return TRUE; sel = GlobalHandleToSel( handle ); + if (!VALID_HANDLE(sel)) + return FALSE; pArena = GET_ARENA_PTR(sel); SELECTOR_FreeBlock( sel, (pArena->size + 0xffff) / 0x10000 ); memset( pArena, 0, sizeof(GLOBALARENA) ); @@ -184,7 +186,7 @@ HGLOBAL16 GLOBAL_Alloc( UINT16 flags, DWORD size, HGLOBAL16 hOwner, HGLOBAL16 handle; SHMDATA shmdata; - dprintf_global( stddeb, "GlobalAlloc: %ld flags=%04x\n", size, flags ); + dprintf_info(global, "GlobalAlloc: %ld flags=%04x\n", size, flags ); /* If size is 0, create a discarded block */ @@ -291,7 +293,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags ) GLOBALARENA *pArena, *pNewArena; WORD sel = GlobalHandleToSel( handle ); - dprintf_global( stddeb, "GlobalReAlloc16: %04x %ld flags=%04x\n", + dprintf_info(global, "GlobalReAlloc16: %04x %ld flags=%04x\n", handle, size, flags ); if (!handle) return 0; @@ -304,6 +306,10 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags ) } #endif /* CONFIG_IPC */ + if (!VALID_HANDLE(handle)) { + fprintf(stderr," Invalid handle 0x%04x passed to GlobalReAlloc16!\n",handle); + return 0; + } pArena = GET_ARENA_PTR( handle ); /* Discard the block if requested */ @@ -344,7 +350,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags ) ptr = (void *)pArena->base; oldsize = pArena->size; - dprintf_global(stddeb,"oldsize %08lx\n",oldsize); + dprintf_info(global,"oldsize %08lx\n",oldsize); if (ptr && (size == oldsize)) return handle; /* Nothing to do */ ptr = HeapReAlloc( SystemHeap, 0, ptr, size ); @@ -395,9 +401,15 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags ) */ HGLOBAL16 WINAPI GlobalFree16( HGLOBAL16 handle ) { - void *ptr = (void *)GET_ARENA_PTR(handle)->base; + void *ptr; - dprintf_global( stddeb, "GlobalFree16: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr," Invalid handle 0x%04x passed to GlobalFree16!\n",handle); + return 0; + } + ptr = (void *)GET_ARENA_PTR(handle)->base; + + dprintf_info(global, "GlobalFree16: %04x\n", handle ); if (!GLOBAL_FreeBlock( handle )) return handle; /* failed */ #ifdef CONFIG_IPC if (is_dde_handle(handle)) return DDE_GlobalFree(handle); @@ -414,7 +426,7 @@ HGLOBAL16 WINAPI GlobalFree16( HGLOBAL16 handle ) */ SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle ) { - dprintf_global( stddeb, "WIN16_GlobalLock16(%04x) -> %08lx\n", + dprintf_info(global, "WIN16_GlobalLock16(%04x) -> %08lx\n", handle, MAKELONG( 0, GlobalHandleToSel(handle)) ); if (handle) { @@ -425,6 +437,10 @@ SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle ) return PTR_SEG_OFF_TO_SEGPTR( DDE_GlobalHandleToSel(handle), 0 ); #endif /* CONFIG_IPC */ + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to WIN16_GlobalLock16!\n",handle); + return (SEGPTR)0; + } if (!GET_ARENA_PTR(handle)->base) return (SEGPTR)0; GET_ARENA_PTR(handle)->lockCount++; return PTR_SEG_OFF_TO_SEGPTR( GlobalHandleToSel(handle), 0 ); @@ -442,6 +458,8 @@ SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle ) LPVOID WINAPI GlobalLock16( HGLOBAL16 handle ) { if (!handle) return 0; + if (!VALID_HANDLE(handle)) + return (LPVOID)0; GET_ARENA_PTR(handle)->lockCount++; #ifdef CONFIG_IPC if (is_dde_handle(handle)) return DDE_AttachHandle(handle, NULL); @@ -456,7 +474,11 @@ LPVOID WINAPI GlobalLock16( HGLOBAL16 handle ) BOOL16 WINAPI GlobalUnlock16( HGLOBAL16 handle ) { GLOBALARENA *pArena = GET_ARENA_PTR(handle); - dprintf_global( stddeb, "GlobalUnlock16: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnlock16!\n",handle); + return 0; + } + dprintf_info(global, "GlobalUnlock16: %04x\n", handle ); if (pArena->lockCount) pArena->lockCount--; return pArena->lockCount; } @@ -467,8 +489,10 @@ BOOL16 WINAPI GlobalUnlock16( HGLOBAL16 handle ) */ DWORD WINAPI GlobalSize16( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalSize16: %04x\n", handle ); + dprintf_info(global, "GlobalSize16: %04x\n", handle ); if (!handle) return 0; + if (!VALID_HANDLE(handle)) + return 0; return GET_ARENA_PTR(handle)->size; } @@ -478,7 +502,11 @@ DWORD WINAPI GlobalSize16( HGLOBAL16 handle ) */ DWORD WINAPI GlobalHandle16( WORD sel ) { - dprintf_global( stddeb, "GlobalHandle16: %04x\n", sel ); + dprintf_info(global, "GlobalHandle16: %04x\n", sel ); + if (!VALID_HANDLE(sel)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandle16!\n",sel); + return 0; + } return MAKELONG( GET_ARENA_PTR(sel)->handle, GlobalHandleToSel(sel) ); } @@ -502,7 +530,11 @@ UINT16 WINAPI GlobalFlags16( HGLOBAL16 handle ) { GLOBALARENA *pArena; - dprintf_global( stddeb, "GlobalFlags16: %04x\n", handle ); + dprintf_info(global, "GlobalFlags16: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFlags16!\n",handle); + return 0; + } pArena = GET_ARENA_PTR(handle); return pArena->lockCount | ((pArena->flags & GA_DISCARDABLE) ? GMEM_DISCARDABLE : 0) | @@ -515,8 +547,12 @@ UINT16 WINAPI GlobalFlags16( HGLOBAL16 handle ) */ HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle ) { - dprintf_global( stddeb, "LockSegment: %04x\n", handle ); + dprintf_info(global, "LockSegment: %04x\n", handle ); if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to LockSegment16!\n",handle); + return 0; + } GET_ARENA_PTR(handle)->lockCount++; return handle; } @@ -527,8 +563,12 @@ HGLOBAL16 WINAPI LockSegment16( HGLOBAL16 handle ) */ void WINAPI UnlockSegment16( HGLOBAL16 handle ) { - dprintf_global( stddeb, "UnlockSegment: %04x\n", handle ); + dprintf_info(global, "UnlockSegment: %04x\n", handle ); if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to UnlockSegment16!\n",handle); + return; + } GET_ARENA_PTR(handle)->lockCount--; /* FIXME: this ought to return the lock count in CX (go figure...) */ } @@ -583,7 +623,7 @@ BOOL16 WINAPI GlobalUnWire16( HGLOBAL16 handle ) */ LONG WINAPI SetSwapAreaSize16( WORD size ) { - dprintf_global(stdnimp, "STUB: SetSwapAreaSize(%d)\n", size ); + dprintf_fixme(global, "STUB: SetSwapAreaSize(%d)\n", size ); return MAKELONG( size, 0xffff ); } @@ -593,7 +633,7 @@ LONG WINAPI SetSwapAreaSize16( WORD size ) */ HGLOBAL16 WINAPI GlobalLRUOldest( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalLRUOldest: %04x\n", handle ); + dprintf_info(global, "GlobalLRUOldest: %04x\n", handle ); if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; return handle; } @@ -604,7 +644,7 @@ HGLOBAL16 WINAPI GlobalLRUOldest( HGLOBAL16 handle ) */ HGLOBAL16 WINAPI GlobalLRUNewest( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalLRUNewest: %04x\n", handle ); + dprintf_info(global, "GlobalLRUNewest: %04x\n", handle ); if (handle == (HGLOBAL16)-1) handle = CURRENT_DS; return handle; } @@ -662,7 +702,11 @@ WORD WINAPI GlobalDOSFree(WORD sel) */ WORD WINAPI GlobalPageLock( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalPageLock: %04x\n", handle ); + dprintf_info(global, "GlobalPageLock: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageLock!\n",handle); + return 0; + } return ++(GET_ARENA_PTR(handle)->pageLockCount); } @@ -672,7 +716,11 @@ WORD WINAPI GlobalPageLock( HGLOBAL16 handle ) */ WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalPageUnlock: %04x\n", handle ); + dprintf_info(global, "GlobalPageUnlock: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalPageUnlock!\n",handle); + return 0; + } return --(GET_ARENA_PTR(handle)->pageLockCount); } @@ -682,7 +730,11 @@ WORD WINAPI GlobalPageUnlock( HGLOBAL16 handle ) */ void WINAPI GlobalFix16( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalFix16: %04x\n", handle ); + dprintf_info(global, "GlobalFix16: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalFix16!\n",handle); + return; + } GET_ARENA_PTR(handle)->lockCount++; } @@ -692,7 +744,11 @@ void WINAPI GlobalFix16( HGLOBAL16 handle ) */ void WINAPI GlobalUnfix16( HGLOBAL16 handle ) { - dprintf_global( stddeb, "GlobalUnfix16: %04x\n", handle ); + dprintf_info(global, "GlobalUnfix16: %04x\n", handle ); + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalUnfix16!\n",handle); + return; + } GET_ARENA_PTR(handle)->lockCount--; } @@ -702,6 +758,10 @@ void WINAPI GlobalUnfix16( HGLOBAL16 handle ) */ void WINAPI FarSetOwner( HGLOBAL16 handle, HANDLE16 hOwner ) { + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to FarSetOwner!\n",handle); + return; + } GET_ARENA_PTR(handle)->hOwner = hOwner; } @@ -711,6 +771,10 @@ void WINAPI FarSetOwner( HGLOBAL16 handle, HANDLE16 hOwner ) */ HANDLE16 WINAPI FarGetOwner( HGLOBAL16 handle ) { + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to FarGetOwner!\n",handle); + return 0; + } return GET_ARENA_PTR(handle)->hOwner; } @@ -720,11 +784,15 @@ HANDLE16 WINAPI FarGetOwner( HGLOBAL16 handle ) */ WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle ) { - dprintf_toolhelp( stddeb, "GlobalHandleToSel: %04x\n", handle ); + dprintf_info(toolhelp, "GlobalHandleToSel: %04x\n", handle ); if (!handle) return 0; #ifdef CONFIG_IPC if (is_dde_handle(handle)) return DDE_GlobalHandleToSel(handle); #endif + if (!VALID_HANDLE(handle)) { + fprintf(stderr,"Invalid handle 0x%04x passed to GlobalHandleToSel!\n",handle); + return 0; + } if (!(handle & 7)) { fprintf( stderr, "Program attempted invalid selector conversion\n" ); @@ -961,7 +1029,7 @@ LPVOID WINAPI GlobalLock32(HGLOBAL32 hmem) } else { - dprintf_global(stddeb, "GlobalLock32: invalid handle\n"); + dprintf_warn(global, "GlobalLock32: invalid handle\n"); palloc=(LPVOID) NULL; } /* HeapUnlock(GetProcessHeap()); */; @@ -992,7 +1060,7 @@ BOOL32 WINAPI GlobalUnlock32(HGLOBAL32 hmem) } else { - dprintf_global(stddeb, "GlobalUnlock32: invalid handle\n"); + dprintf_warn(global, "GlobalUnlock32: invalid handle\n"); locked=FALSE; } /* HeapUnlock(GetProcessHeap()); */ @@ -1165,7 +1233,7 @@ DWORD WINAPI GlobalSize32(HGLOBAL32 hmem) } else { - dprintf_global(stddeb, "GlobalSize32: invalid handle\n"); + dprintf_warn(global, "GlobalSize32: invalid handle\n"); retval=0; } /* HeapUnlock(GetProcessHeap()); */ @@ -1234,7 +1302,7 @@ UINT32 WINAPI GlobalFlags32(HGLOBAL32 hmem) } else { - dprintf_global(stddeb,"GlobalFlags32: invalid handle\n"); + dprintf_warn(global,"GlobalFlags32: invalid handle\n"); retval=0; } /* HeapUnlock(GetProcessHeap()); */ @@ -1324,3 +1392,14 @@ SEGPTR WINAPI WOWGlobalAllocLock16(DWORD flags,DWORD cb,HGLOBAL16 *hmem) if (hmem) *hmem = xhmem; return WIN16_GlobalLock16(xhmem); } + +/********************************************************************** + * WOWGlobalUnlockFree (KERNEL32.64) + * + * Combined GlobalUnlock and GlobalFree. + */ +WORD WOWGlobalUnlockFree16(DWORD vpmem) { + if (!GlobalUnlock16(HIWORD(vpmem))) + return 0; + return GlobalFree16(HIWORD(vpmem)); +} diff --git a/memory/heap.c b/memory/heap.c index 9904b3da86e..64991721796 100644 --- a/memory/heap.c +++ b/memory/heap.c @@ -14,7 +14,6 @@ #include "winerror.h" #include "winnt.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" /* Note: the heap data structures are based on what Pietrek describes in his @@ -189,7 +188,7 @@ static HEAP *HEAP_GetPtr( HANDLE32 heap ) SetLastError( ERROR_INVALID_HANDLE ); return NULL; } - if (debugging_heap && !HeapValidate( heap, 0, NULL )) + if (debugging_info(heap) && !HeapValidate( heap, 0, NULL )) { HEAP_Dump( heapPtr ); assert( FALSE ); @@ -303,7 +302,7 @@ static void HEAP_CreateFreeBlock( SUBHEAP *subheap, void *ptr, DWORD size ) /* If debugging, erase the freed block content */ - if (debugging_heap) + if (debugging_info(heap)) { char *pEnd = (char *)ptr + size; if (pEnd > (char *)subheap + subheap->commitSize) @@ -322,7 +321,7 @@ static void HEAP_CreateFreeBlock( SUBHEAP *subheap, void *ptr, DWORD size ) pNext->next->prev = pNext->prev; pNext->prev->next = pNext->next; size += (pNext->size & ARENA_SIZE_MASK) + sizeof(*pNext); - if (debugging_heap) + if (debugging_info(heap)) memset( pNext, ARENA_FREE_FILLER, sizeof(ARENA_FREE) ); } @@ -541,7 +540,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, DWORD size, subheap->next = heap->subheap.next; heap->subheap.next = subheap; size = subheap->size; - dprintf_heap( stddeb, "HEAP_FindFreeBlock: created new sub-heap %08lx of %08lx bytes for heap %08lx\n", + dprintf_info(heap, "HEAP_FindFreeBlock: created new sub-heap %08lx of %08lx bytes for heap %08lx\n", (DWORD)subheap, size, (DWORD)heap ); HEAP_CreateFreeBlock( subheap, subheap + 1, size - sizeof(*subheap) ); @@ -851,7 +850,7 @@ BOOL32 WINAPI HeapDestroy( HANDLE32 heap ) HEAP *heapPtr = HEAP_GetPtr( heap ); SUBHEAP *subheap; - dprintf_heap( stddeb, "HeapDestroy: %08x\n", heap ); + dprintf_info(heap, "HeapDestroy: %08x\n", heap ); if (!heapPtr) return FALSE; DeleteCriticalSection( &heapPtr->critSection ); @@ -890,7 +889,7 @@ LPVOID WINAPI HeapAlloc( HANDLE32 heap, DWORD flags, DWORD size ) if (!(pArena = HEAP_FindFreeBlock( heapPtr, size, &subheap ))) { - dprintf_heap( stddeb, "HeapAlloc(%08x,%08lx,%08lx): returning NULL\n", + dprintf_info(heap, "HeapAlloc(%08x,%08lx,%08lx): returning NULL\n", heap, flags, size ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); SetLastError( ERROR_COMMITMENT_LIMIT ); @@ -916,11 +915,11 @@ LPVOID WINAPI HeapAlloc( HANDLE32 heap, DWORD flags, DWORD size ) HEAP_ShrinkBlock( subheap, pInUse, size ); if (flags & HEAP_ZERO_MEMORY) memset( pInUse + 1, 0, size ); - else if (debugging_heap) memset( pInUse + 1, ARENA_INUSE_FILLER, size ); + else if (debugging_info(heap)) memset( pInUse + 1, ARENA_INUSE_FILLER, size ); if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); - dprintf_heap( stddeb, "HeapAlloc(%08x,%08lx,%08lx): returning %08lx\n", + dprintf_info(heap, "HeapAlloc(%08x,%08lx,%08lx): returning %08lx\n", heap, flags, size, (DWORD)(pInUse + 1) ); return (LPVOID)(pInUse + 1); } @@ -945,7 +944,7 @@ BOOL32 WINAPI HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr ) { if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); SetLastError( ERROR_INVALID_PARAMETER ); - dprintf_heap( stddeb, "HeapFree(%08x,%08lx,%08lx): returning FALSE\n", + dprintf_info(heap, "HeapFree(%08x,%08lx,%08lx): returning FALSE\n", heap, flags, (DWORD)ptr ); return FALSE; } @@ -959,7 +958,7 @@ BOOL32 WINAPI HeapFree( HANDLE32 heap, DWORD flags, LPVOID ptr ) if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); /* SetLastError( 0 ); */ - dprintf_heap( stddeb, "HeapFree(%08x,%08lx,%08lx): returning TRUE\n", + dprintf_info(heap, "HeapFree(%08x,%08lx,%08lx): returning TRUE\n", heap, flags, (DWORD)ptr ); return TRUE; } @@ -991,7 +990,7 @@ LPVOID WINAPI HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size ) { if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); SetLastError( ERROR_INVALID_PARAMETER ); - dprintf_heap( stddeb, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning NULL\n", + dprintf_info(heap, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning NULL\n", heap, flags, (DWORD)ptr, size ); return NULL; } @@ -1065,7 +1064,7 @@ LPVOID WINAPI HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size ) if (flags & HEAP_ZERO_MEMORY) memset( (char *)(pArena + 1) + oldSize, 0, (pArena->size & ARENA_SIZE_MASK) - oldSize ); - else if (debugging_heap) + else if (debugging_info(heap)) memset( (char *)(pArena + 1) + oldSize, ARENA_INUSE_FILLER, (pArena->size & ARENA_SIZE_MASK) - oldSize ); } @@ -1075,7 +1074,7 @@ LPVOID WINAPI HeapReAlloc( HANDLE32 heap, DWORD flags, LPVOID ptr, DWORD size ) pArena->callerEIP = *((DWORD *)&heap - 1); /* hack hack */ if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); - dprintf_heap( stddeb, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning %08lx\n", + dprintf_info(heap, "HeapReAlloc(%08x,%08lx,%08lx,%08lx): returning %08lx\n", heap, flags, (DWORD)ptr, size, (DWORD)(pArena + 1) ); return (LPVOID)(pArena + 1); } @@ -1138,7 +1137,7 @@ DWORD WINAPI HeapSize( HANDLE32 heap, DWORD flags, LPVOID ptr ) } if (!(flags & HEAP_NO_SERIALIZE)) HeapUnlock( heap ); - dprintf_heap( stddeb, "HeapSize(%08x,%08lx,%08lx): returning %08lx\n", + dprintf_info(heap, "HeapSize(%08x,%08lx,%08lx): returning %08lx\n", heap, flags, (DWORD)ptr, ret ); return ret; } diff --git a/memory/ldt.c b/memory/ldt.c index 50171b09507..55a2875dd6f 100644 --- a/memory/ldt.c +++ b/memory/ldt.c @@ -10,7 +10,6 @@ #include #include #include "ldt.h" -#include "stddebug.h" #include "debug.h" #ifdef __i386__ @@ -148,7 +147,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content ) { int ret = 0; - dprintf_ldt(stddeb, + dprintf_info(ldt, "LDT_SetEntry: entry=%04x base=%08lx limit=%05lx %s %d-bit flags=%c%c%c\n", entry, content->base, content->limit, content->limit_in_pages ? "pages" : "bytes", diff --git a/memory/local.c b/memory/local.c index cb572e8561b..2ebca306761 100644 --- a/memory/local.c +++ b/memory/local.c @@ -24,7 +24,6 @@ #include "module.h" #include "stackframe.h" #include "toolhelp.h" -#include "stddebug.h" #include "debug.h" /* needed only for GDI_HeapSel and USER_HeapSel */ @@ -126,7 +125,7 @@ static LOCALHEAPINFO *LOCAL_GetHeap( HANDLE16 ds ) { LOCALHEAPINFO *pInfo; INSTANCEDATA *ptr = (INSTANCEDATA *)PTR_SEG_OFF_TO_LIN( ds, 0 ); - dprintf_local( stddeb, "Heap at %p, %04x\n", ptr, ptr->heap ); + dprintf_info(local, "Heap at %p, %04x\n", ptr, ptr->heap ); if (!ptr || !ptr->heap) return NULL; if (IsBadReadPtr16( (SEGPTR)MAKELONG(ptr->heap,ds), sizeof(LOCALHEAPINFO))) return NULL; @@ -164,7 +163,7 @@ static void LOCAL_MakeBlockFree( char *baseptr, WORD block ) next = pNext->next; } - dprintf_local( stddeb, "Local_MakeBlockFree %04x, next %04x\n", block, next ); + dprintf_info(local, "Local_MakeBlockFree %04x, next %04x\n", block, next ); /* Insert the free block in the free-list */ pArena->free_prev = pNext->free_prev; @@ -229,7 +228,7 @@ static void LOCAL_RemoveBlock( char *baseptr, WORD block ) /* Remove the block from the free-list */ - dprintf_local( stddeb, "Local_RemoveBlock\n"); + dprintf_info(local, "Local_RemoveBlock\n"); pArena = ARENA_PTR( baseptr, block ); if ((pArena->prev & 3) == LOCAL_ARENA_FREE) LOCAL_RemoveFreeBlock( baseptr, block ); @@ -253,11 +252,18 @@ static void LOCAL_RemoveBlock( char *baseptr, WORD block ) */ static void LOCAL_PrintHeap( HANDLE16 ds ) { - char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); - LOCALHEAPINFO *pInfo = LOCAL_GetHeap( ds ); + char *ptr; + LOCALHEAPINFO *pInfo; WORD arena; - if (!debugging_local) return; + /* FIXME - the test should be done when calling the function! + plus is not clear that we should print this info + only when debugging_info is on! */ + if(!debugging_info(local)) return; + + ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); + pInfo = LOCAL_GetHeap( ds ); + if (!pInfo) { printf( "Local Heap corrupted! ds=%04x\n", ds ); @@ -321,13 +327,13 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end ) /* - large free block (FREE) */ /* - last arena (FREE) */ - dprintf_local(stddeb, "LocalInit: %04x %04x-%04x\n", selector, start, end); + dprintf_info(local, "LocalInit: %04x %04x-%04x\n", selector, start, end); if (!selector) selector = CURRENT_DS; - if (debugging_heap) + if (debugging_info(heap)) { - /* If debugging_heap is set, the global heap blocks are cleared */ - /* before use, so we can test for double initialization. */ + /* If debugging_info(heap) is set, the global heap blocks are */ + /* cleared before use, so we can test for double initialization. */ if (LOCAL_GetHeap(selector)) { fprintf( stderr, "LocalInit: Heap %04x initialized twice.\n", selector); @@ -349,7 +355,7 @@ BOOL16 WINAPI LocalInit( HANDLE16 selector, WORD start, WORD end ) start = GlobalSize16( GlobalHandle16( selector ) ); start -= end; end += start; - dprintf_local( stddeb," new start %04x, minstart: %04x\n", start, pSeg->minsize + pModule->stack_size); + dprintf_info(local," new start %04x, minstart: %04x\n", start, pSeg->minsize + pModule->stack_size); } } } @@ -471,7 +477,7 @@ static void LOCAL_GrowHeap( HANDLE16 ds ) pHeapInfo->items--; } - dprintf_local( stddeb, "Heap expanded\n" ); + dprintf_info(local, "Heap expanded\n" ); LOCAL_PrintHeap( ds ); } @@ -485,7 +491,7 @@ static HLOCAL16 LOCAL_FreeArena( WORD ds, WORD arena ) LOCALHEAPINFO *pInfo; LOCALARENA *pArena, *pPrev, *pNext; - dprintf_local( stddeb, "LocalFreeArena: %04x ds=%04x\n", arena, ds ); + dprintf_info(local, "LocalFreeArena: %04x ds=%04x\n", arena, ds ); if (!(pInfo = LOCAL_GetHeap( ds ))) return arena; pArena = ARENA_PTR( ptr, arena ); @@ -654,16 +660,16 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags ) LOCAL_PrintHeap(ds); return 0; } - dprintf_local(stddeb, + dprintf_info(local, "LOCAL_Compact: ds = %04x, minfree = %04x, flags = %04x\n", ds, minfree, flags); freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1); if(freespace >= minfree || (flags & LMEM_NOCOMPACT)) { - dprintf_local(stddeb, "Returning %04x.\n", freespace); + dprintf_info(local, "Returning %04x.\n", freespace); return freespace; } - dprintf_local(stddeb, "Local_Compact: Compacting heap %04x.\n", ds); + dprintf_info(local, "Local_Compact: Compacting heap %04x.\n", ds); table = pInfo->htable; while(table) { @@ -673,7 +679,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags ) if((pEntry->lock == 0) && (pEntry->flags != (LMEM_DISCARDED >> 8))) { /* OK we can move this one if we want */ - dprintf_local(stddeb, + dprintf_info(local, "handle %04x (block %04x) can be moved.\n", (WORD)((char *)pEntry - ptr), pEntry->addr); movearena = ARENA_HEADER(pEntry->addr); @@ -701,7 +707,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags ) } if (finalarena) /* Actually got somewhere to move */ { - dprintf_local(stddeb, "Moving it to %04x.\n", finalarena); + dprintf_info(local, "Moving it to %04x.\n", finalarena); pFinalArena = ARENA_PTR(ptr, finalarena); size = pFinalArena->size; LOCAL_RemoveFreeBlock(ptr, finalarena); @@ -732,7 +738,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags ) freespace = LOCAL_GetFreeSpace(ds, minfree ? 0 : 1); if(freespace >= minfree || (flags & LMEM_NODISCARD)) { - dprintf_local(stddeb, "Returning %04x.\n", freespace); + dprintf_info(local, "Returning %04x.\n", freespace); return freespace; } @@ -745,7 +751,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags ) if(pEntry->addr && pEntry->lock == 0 && (pEntry->flags & (LMEM_DISCARDABLE >> 8))) { - dprintf_local(stddeb, "Discarding handle %04x (block %04x).\n", + dprintf_info(local, "Discarding handle %04x (block %04x).\n", (char *)pEntry - ptr, pEntry->addr); LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr)); pEntry->addr = 0; @@ -784,7 +790,7 @@ static HLOCAL16 LOCAL_FindFreeBlock( HANDLE16 ds, WORD size ) if (arena == pArena->free_next) break; if (pArena->size >= size) return arena; } - dprintf_local( stddeb, "Local_FindFreeBlock: not enough space\n" ); + dprintf_warn(local, "Local_FindFreeBlock: not enough space\n" ); LOCAL_PrintHeap(ds); return 0; } @@ -827,15 +833,15 @@ static HLOCAL16 LOCAL_GetBlock( HANDLE16 ds, WORD size, WORD flags ) } if (arena == 0) { if (ds == GDI_HeapSel) { - fprintf( stderr, + dprintf_warn(local, "Local_GetBlock: not enough space in GDI local heap (%04x) for %d bytes\n", ds, size ); } else if (ds == USER_HeapSel) { - fprintf( stderr, + dprintf_warn(local, "Local_GetBlock: not enough space in USER local heap (%04x) for %d bytes\n", ds, size ); } else { - dprintf_local( stddeb, + dprintf_warn(local, "Local_GetBlock: not enough space in local heap %04x for %d bytes\n", ds, size ); } @@ -844,7 +850,7 @@ static HLOCAL16 LOCAL_GetBlock( HANDLE16 ds, WORD size, WORD flags ) /* Make a block out of the free arena */ pArena = ARENA_PTR( ptr, arena ); - dprintf_local(stddeb, "LOCAL_GetBlock size = %04x, arena %04x size %04x\n", + dprintf_info(local, "LOCAL_GetBlock size = %04x, arena %04x size %04x\n", size, arena, pArena->size ); LOCAL_RemoveFreeBlock( ptr, arena ); LOCAL_ShrinkArena( ds, arena, size ); @@ -866,7 +872,7 @@ static BOOL16 LOCAL_NewHTable( HANDLE16 ds ) HLOCAL16 handle; int i; - dprintf_local( stddeb, "Local_NewHTable\n" ); + dprintf_info(local, "Local_NewHTable\n" ); if (!(pInfo = LOCAL_GetHeap( ds ))) { fprintf( stderr, "Local heap not found\n"); @@ -938,7 +944,7 @@ static HLOCAL16 LOCAL_GetNewHandleEntry( HANDLE16 ds ) pEntry->lock = 0; pEntry->flags = 0; - dprintf_local( stddeb, "LOCAL_GetNewHandleEntry(%04x): %04x\n", + dprintf_info(local, "LOCAL_GetNewHandleEntry(%04x): %04x\n", ds, ((char *)pEntry - ptr) ); return (HLOCAL16)((char *)pEntry - ptr); } @@ -990,7 +996,7 @@ static void LOCAL_FreeHandleEntry( HANDLE16 ds, HLOCAL16 handle ) /* Remove the table from the linked list and free it */ - dprintf_local( stddeb, "LOCAL_FreeHandleEntry(%04x): freeing table %04x\n", + dprintf_info(local, "LOCAL_FreeHandleEntry(%04x): freeing table %04x\n", ds, table); *pTable = *(WORD *)pEntry; LOCAL_FreeArena( ds, ARENA_HEADER( table ) ); @@ -1006,7 +1012,7 @@ HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle ) { char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); - dprintf_local( stddeb, "LocalFree: %04x ds=%04x\n", handle, ds ); + dprintf_info(local, "LocalFree: %04x ds=%04x\n", handle, ds ); if (!handle) { fprintf( stderr, "LOCAL_Free: handle is 0.\n" ); return 0; } if (HANDLE_FIXED( handle )) @@ -1019,7 +1025,7 @@ HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle ) LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); if (pEntry->flags != (LMEM_DISCARDED >> 8)) { - dprintf_local( stddeb, "LocalFree: real block at %04x\n", + dprintf_info(local, "LocalFree: real block at %04x\n", pEntry->addr ); if (LOCAL_FreeArena( ds, ARENA_HEADER(pEntry->addr) )) return handle; /* couldn't free it */ @@ -1041,7 +1047,7 @@ HLOCAL16 LOCAL_Alloc( HANDLE16 ds, WORD flags, WORD size ) char *ptr; HLOCAL16 handle; - dprintf_local( stddeb, "LocalAlloc: %04x %d ds=%04x\n", flags, size, ds ); + dprintf_info(local, "LocalAlloc: %04x %d ds=%04x\n", flags, size, ds ); if(size > 0 && size <= 4) size = 5; if (flags & LMEM_MOVEABLE) @@ -1108,7 +1114,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) ((LOCALHANDLEENTRY *)(ptr + handle))->lock == 0xff) /* An unused handle */ return 0; - dprintf_local( stddeb, "LocalReAlloc: %04x %d %04x ds=%04x\n", + dprintf_info(local, "LocalReAlloc: %04x %d %04x ds=%04x\n", handle, size, flags, ds ); if (!(pInfo = LOCAL_GetHeap( ds ))) return 0; @@ -1123,7 +1129,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) if(pEntry->addr) fprintf(stderr, "LOCAL_ReAlloc: Dicarded block has non-zero addr.\n"); - dprintf_local(stddeb, "ReAllocating discarded block\n"); + dprintf_info(local, "ReAllocating discarded block\n"); if(size <= 4) size = 5; if (!(hl = LOCAL_GetBlock( ds, size + sizeof(HLOCAL16), flags))) return 0; @@ -1153,7 +1159,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) { pEntry = (LOCALHANDLEENTRY *)(ptr + handle); pEntry->flags = (flags & 0x0f00) >> 8; - dprintf_local(stddeb, "Changing flags to %x.\n", pEntry->flags); + dprintf_info(local, "Changing flags to %x.\n", pEntry->flags); } return handle; } @@ -1164,7 +1170,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) { if (HANDLE_FIXED(handle)) { - dprintf_local(stddeb, "Freeing fixed block.\n"); + dprintf_info(local, "Freeing fixed block.\n"); return LOCAL_Free( ds, handle ); } else /* Moveable block */ @@ -1173,7 +1179,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) if (pEntry->lock == 0) { /* discards moveable blocks */ - dprintf_local(stddeb,"Discarding block\n"); + dprintf_info(local,"Discarding block\n"); LOCAL_FreeArena(ds, ARENA_HEADER(pEntry->addr)); pEntry->addr = 0; pEntry->flags = (LMEM_DISCARDED >> 8); @@ -1195,7 +1201,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) } arena = ARENA_HEADER( blockhandle ); - dprintf_local( stddeb, "LocalReAlloc: arena is %04x\n", arena ); + dprintf_info(local, "LocalReAlloc: arena is %04x\n", arena ); pArena = ARENA_PTR( ptr, arena ); if(size <= 4) size = 5; @@ -1206,9 +1212,9 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) if (nextarena <= pArena->next) { - dprintf_local( stddeb, "size reduction, making new free block\n"); + dprintf_info(local, "size reduction, making new free block\n"); LOCAL_ShrinkArena(ds, arena, nextarena - arena); - dprintf_local( stddeb, "LocalReAlloc: returning %04x\n", handle ); + dprintf_info(local, "LocalReAlloc: returning %04x\n", handle ); return handle; } @@ -1218,9 +1224,9 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) if (((pNext->prev & 3) == LOCAL_ARENA_FREE) && (nextarena <= pNext->next)) { - dprintf_local( stddeb, "size increase, making new free block\n"); + dprintf_info(local, "size increase, making new free block\n"); LOCAL_GrowArenaUpward(ds, arena, nextarena - arena); - dprintf_local( stddeb, "LocalReAlloc: returning %04x\n", handle ); + dprintf_info(local, "LocalReAlloc: returning %04x\n", handle ); return handle; } @@ -1231,7 +1237,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) { if (HANDLE_FIXED(handle)) { - dprintf_local(stddeb, + dprintf_warn(local, "Needed to move fixed block, but LMEM_MOVEABLE not specified.\n"); return 0; } @@ -1239,8 +1245,8 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) { if(((LOCALHANDLEENTRY *)(ptr + handle))->lock != 0) { - dprintf_local(stddeb, - "Needed to move locked block, but LMEM_MOVEABLE not specified.\n"); + dprintf_warn(local, + "Needed to move locked block, but LMEM_MOVEABLE not specified.\n"); return 0; } } @@ -1276,7 +1282,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) } if (HANDLE_MOVEABLE( handle )) { - dprintf_local( stddeb, "LocalReAlloc: fixing handle\n"); + dprintf_info(local, "LocalReAlloc: fixing handle\n"); pEntry = (LOCALHANDLEENTRY *)(ptr + handle); pEntry->addr = hmem + sizeof(HLOCAL16); /* Back ptr should still be correct */ @@ -1285,7 +1291,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) hmem = handle; } if (size == oldsize) hmem = 0; /* Realloc failed */ - dprintf_local( stddeb, "LocalReAlloc: returning %04x\n", hmem ); + dprintf_info(local, "LocalReAlloc: returning %04x\n", hmem ); return hmem; } @@ -1295,7 +1301,8 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) */ static HLOCAL16 LOCAL_InternalLock( LPSTR heap, HLOCAL16 handle ) { - dprintf_local( stddeb, "LocalLock: %04x ", handle ); + HLOCAL16 old_handle = handle; + if (HANDLE_MOVEABLE(handle)) { LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(heap + handle); @@ -1303,7 +1310,8 @@ static HLOCAL16 LOCAL_InternalLock( LPSTR heap, HLOCAL16 handle ) if (pEntry->lock < 0xfe) pEntry->lock++; handle = pEntry->addr; } - dprintf_local( stddeb, "returning %04x\n", handle ); + dprintf_info(local, "LocalLock: %04x returning %04x\n", + old_handle, handle ); return handle; } @@ -1335,7 +1343,7 @@ BOOL16 LOCAL_Unlock( HANDLE16 ds, HLOCAL16 handle ) { char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 ); - dprintf_local( stddeb, "LocalUnlock: %04x\n", handle ); + dprintf_info(local, "LocalUnlock: %04x\n", handle ); if (HANDLE_MOVEABLE(handle)) { LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); @@ -1358,7 +1366,7 @@ WORD LOCAL_Size( HANDLE16 ds, HLOCAL16 handle ) char *ptr = PTR_SEG_OFF_TO_LIN( CURRENT_DS, 0 ); LOCALARENA *pArena; - dprintf_local( stddeb, "LocalSize: %04x ds=%04x\n", handle, ds ); + dprintf_info(local, "LocalSize: %04x ds=%04x\n", handle, ds ); if (HANDLE_MOVEABLE( handle )) handle = *(WORD *)(ptr + handle); if (!handle) return 0; @@ -1379,13 +1387,13 @@ WORD LOCAL_Flags( HANDLE16 ds, HLOCAL16 handle ) if (HANDLE_MOVEABLE(handle)) { LOCALHANDLEENTRY *pEntry = (LOCALHANDLEENTRY *)(ptr + handle); - dprintf_local( stddeb, "LOCAL_Flags(%04x,%04x): returning %04x\n", + dprintf_info(local, "LOCAL_Flags(%04x,%04x): returning %04x\n", ds, handle, pEntry->lock | (pEntry->flags << 8) ); return pEntry->lock | (pEntry->flags << 8); } else { - dprintf_local( stddeb, "LOCAL_Flags(%04x,%04x): returning 0\n", + dprintf_info(local, "LOCAL_Flags(%04x,%04x): returning 0\n", ds, handle ); return 0; } @@ -1434,7 +1442,7 @@ WORD LOCAL_CountFree( HANDLE16 ds ) if (arena == pArena->free_next) break; total += pArena->size; } - dprintf_local( stddeb, "LOCAL_CountFree(%04x): returning %d\n", ds, total); + dprintf_info(local, "LOCAL_CountFree(%04x): returning %d\n", ds, total); return total; } @@ -1552,7 +1560,7 @@ UINT16 WINAPI LocalFlags16( HLOCAL16 handle ) */ UINT16 WINAPI LocalCompact16( UINT16 minfree ) { - dprintf_local( stddeb, "LocalCompact: %04x\n", minfree ); + dprintf_info(local, "LocalCompact: %04x\n", minfree ); return LOCAL_Compact( CURRENT_DS, minfree, 0 ); } @@ -1572,7 +1580,7 @@ FARPROC16 WINAPI LocalNotify( FARPROC16 func ) LOCAL_PrintHeap( ds ); return 0; } - dprintf_local( stddeb, "LocalNotify(%04x): %08lx\n", ds, (DWORD)func ); + dprintf_info(local, "LocalNotify(%04x): %08lx\n", ds, (DWORD)func ); fprintf(stdnimp, "LocalNotify(): Half implemented\n"); oldNotify = pInfo->notify; pInfo->notify = func; @@ -1585,7 +1593,7 @@ FARPROC16 WINAPI LocalNotify( FARPROC16 func ) */ UINT16 WINAPI LocalShrink16( HGLOBAL16 handle, UINT16 newsize ) { - dprintf_local( stddeb, "LocalShrink: %04x %04x\n", handle, newsize ); + dprintf_info(local, "LocalShrink: %04x %04x\n", handle, newsize ); return 0; } @@ -1618,7 +1626,7 @@ WORD WINAPI LocalCountFree(void) */ WORD WINAPI LocalHeapSize(void) { - dprintf_local( stddeb, "LocalHeapSize:\n" ); + dprintf_info(local, "LocalHeapSize:\n" ); return LOCAL_HeapSize( CURRENT_DS ); } @@ -1637,7 +1645,7 @@ WORD WINAPI LocalHandleDelta( WORD delta ) return 0; } if (delta) pInfo->hdelta = delta; - dprintf_local(stddeb, "LocalHandleDelta: returning %04x\n", pInfo->hdelta); + dprintf_info(local, "LocalHandleDelta: returning %04x\n", pInfo->hdelta); return pInfo->hdelta; } diff --git a/memory/selector.c b/memory/selector.c index db7ca70a2f5..9188f5501f1 100644 --- a/memory/selector.c +++ b/memory/selector.c @@ -10,7 +10,6 @@ #include "miscemu.h" #include "selectors.h" #include "stackframe.h" -#include "stddebug.h" #include "debug.h" @@ -60,7 +59,7 @@ WORD WINAPI AllocSelector( WORD sel ) count = sel ? ((GET_SEL_LIMIT(sel) >> 16) + 1) : 1; newsel = AllocSelectorArray( count ); - dprintf_selector( stddeb, "AllocSelector(%04x): returning %04x\n", + dprintf_info(selector, "AllocSelector(%04x): returning %04x\n", sel, newsel ); if (!newsel) return 0; if (!sel) return newsel; /* nothing to copy */ @@ -149,7 +148,7 @@ void SELECTOR_FreeBlock( WORD sel, WORD count ) ldt_entry entry; STACK16FRAME *frame; - dprintf_selector( stddeb, "SELECTOR_FreeBlock(%04x,%d)\n", sel, count ); + dprintf_info(selector, "SELECTOR_FreeBlock(%04x,%d)\n", sel, count ); sel &= ~(__AHINCR - 1); /* clear bottom bits of selector */ nextsel = sel + (count << __AHSHIFT); @@ -253,7 +252,7 @@ WORD WINAPI AllocCStoDSAlias( WORD sel ) ldt_entry entry; newsel = AllocSelectorArray( 1 ); - dprintf_selector( stddeb, "AllocCStoDSAlias(%04x): returning %04x\n", + dprintf_info(selector, "AllocCStoDSAlias(%04x): returning %04x\n", sel, newsel ); if (!newsel) return 0; LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry ); @@ -272,7 +271,7 @@ WORD WINAPI AllocDStoCSAlias( WORD sel ) ldt_entry entry; newsel = AllocSelectorArray( 1 ); - dprintf_selector( stddeb, "AllocDStoCSAlias(%04x): returning %04x\n", + dprintf_info(selector, "AllocDStoCSAlias(%04x): returning %04x\n", sel, newsel ); if (!newsel) return 0; LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry ); diff --git a/memory/string.c b/memory/string.c index fb948598d80..8a4a18a2697 100644 --- a/memory/string.c +++ b/memory/string.c @@ -10,7 +10,6 @@ #include "windows.h" #include "winerror.h" #include "ldt.h" -#include "stddebug.h" #include "debug.h" #include "debugstr.h" @@ -78,7 +77,7 @@ SEGPTR WINAPI lstrcat16( SEGPTR dst, LPCSTR src ) */ LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src ) { - dprintf_string(stddeb,"strcat: Append %s to %s\n", + dprintf_info(string,"strcat: Append %s to %s\n", debugstr_a (src), debugstr_a (dst)); /* Windows does not check for NULL pointers here, so we don't either */ strcat( dst, src ); @@ -92,7 +91,7 @@ LPSTR WINAPI lstrcat32A( LPSTR dst, LPCSTR src ) LPWSTR WINAPI lstrcat32W( LPWSTR dst, LPCWSTR src ) { register LPWSTR p = dst; - dprintf_string(stddeb,"strcat: Append L%s to L%s\n", + dprintf_info(string,"strcat: Append L%s to L%s\n", debugstr_w (src), debugstr_w (dst)); /* Windows does not check for NULL pointers here, so we don't either */ while (*p) p++; @@ -117,7 +116,7 @@ SEGPTR WINAPI lstrcatn16( SEGPTR dst, LPCSTR src, INT16 n ) LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n ) { register LPSTR p = dst; - dprintf_string(stddeb,"strcatn add %d chars from %s to %s\n", + dprintf_info(string,"strcatn add %d chars from %s to %s\n", n, debugstr_an (src, n), debugstr_a (dst)); while (*p) p++; if ((n -= (INT32)(p - dst)) <= 0) return dst; @@ -132,7 +131,7 @@ LPSTR WINAPI lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n ) LPWSTR WINAPI lstrcatn32W( LPWSTR dst, LPCWSTR src, INT32 n ) { register LPWSTR p = dst; - dprintf_string(stddeb,"strcatn add %d chars from L%s to L%s\n", + dprintf_info(string,"strcatn add %d chars from L%s to L%s\n", n, debugstr_wn (src, n), debugstr_w (dst)); while (*p) p++; if ((n -= (INT32)(p - dst)) <= 0) return dst; @@ -155,7 +154,7 @@ INT16 WINAPI lstrcmp16( LPCSTR str1, LPCSTR str2 ) */ INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 ) { - dprintf_string(stddeb,"strcmp: %s and %s\n", + dprintf_info(string,"strcmp: %s and %s\n", debugstr_a (str1), debugstr_a (str2)); /* Win95 KERNEL32.DLL does it that way. Hands off! */ if (!str1 || !str2) { @@ -171,7 +170,7 @@ INT32 WINAPI lstrcmp32A( LPCSTR str1, LPCSTR str2 ) */ INT32 WINAPI lstrcmp32W( LPCWSTR str1, LPCWSTR str2 ) { - dprintf_string(stddeb,"strcmp: L%s and L%s\n", + dprintf_info(string,"strcmp: L%s and L%s\n", debugstr_w (str1), debugstr_w (str2)); if (!str1 || !str2) { SetLastError(ERROR_INVALID_PARAMETER); @@ -198,7 +197,7 @@ INT32 WINAPI lstrcmpi32A( LPCSTR str1, LPCSTR str2 ) { INT32 res; - dprintf_string(stddeb,"strcmpi %s and %s\n", + dprintf_info(string,"strcmpi %s and %s\n", debugstr_a (str1), debugstr_a (str2)); if (!str1 || !str2) { SetLastError(ERROR_INVALID_PARAMETER); @@ -223,7 +222,7 @@ INT32 WINAPI lstrcmpi32W( LPCWSTR str1, LPCWSTR str2 ) #if 0 /* Too much! (From registry loading.) */ - dprintf_string(stddeb,"strcmpi L%s and L%s\n", + dprintf_info(string,"strcmpi L%s and L%s\n", debugstr_w (str1), debugstr_w (str2)); #endif if (!str1 || !str2) { @@ -256,7 +255,7 @@ SEGPTR WINAPI lstrcpy16( SEGPTR dst, LPCSTR src ) */ LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src ) { - dprintf_string(stddeb,"strcpy %s\n", debugstr_a (src)); + dprintf_info(string,"strcpy %s\n", debugstr_a (src)); /* Windows does not check for NULL pointers here, so we don't either */ strcpy( dst, src ); return dst; @@ -269,7 +268,7 @@ LPSTR WINAPI lstrcpy32A( LPSTR dst, LPCSTR src ) LPWSTR WINAPI lstrcpy32W( LPWSTR dst, LPCWSTR src ) { register LPWSTR p = dst; - dprintf_string(stddeb,"strcpy L%s\n", debugstr_w (src)); + dprintf_info(string,"strcpy L%s\n", debugstr_w (src)); /* Windows does not check for NULL pointers here, so we don't either */ while ((*p++ = *src++)); return dst; @@ -292,7 +291,7 @@ SEGPTR WINAPI lstrcpyn16( SEGPTR dst, LPCSTR src, INT16 n ) LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n ) { LPSTR p = dst; - dprintf_string(stddeb,"strcpyn %s for %d chars\n", + dprintf_info(string,"strcpyn %s for %d chars\n", debugstr_an (src,n), n); /* Windows does not check for NULL pointers here, so we don't either */ while ((n-- > 1) && *src) *p++ = *src++; @@ -307,7 +306,7 @@ LPSTR WINAPI lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n ) LPWSTR WINAPI lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n ) { LPWSTR p = dst; - dprintf_string(stddeb,"strcpyn L%s for %d chars\n", + dprintf_info(string,"strcpyn L%s for %d chars\n", debugstr_wn (src,n), n); /* Windows does not check for NULL pointers here, so we don't either */ while ((n-- > 1) && *src) *p++ = *src++; @@ -334,7 +333,7 @@ INT32 WINAPI lstrlen32A( LPCSTR str ) * in lstrlen() ... we check only for NULL pointer reference. * - Marcus Meissner */ - dprintf_string(stddeb,"strlen %s\n", debugstr_a (str)); + dprintf_info(string,"strlen %s\n", debugstr_a (str)); if (!str) return 0; return (INT32)strlen(str); } @@ -346,7 +345,7 @@ INT32 WINAPI lstrlen32A( LPCSTR str ) INT32 WINAPI lstrlen32W( LPCWSTR str ) { INT32 len = 0; - dprintf_string(stddeb,"strlen L%s\n", debugstr_w (str)); + dprintf_info(string,"strlen L%s\n", debugstr_w (str)); if (!str) return 0; while (*str++) len++; return len; @@ -358,7 +357,7 @@ INT32 WINAPI lstrlen32W( LPCWSTR str ) */ INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n ) { - dprintf_string(stddeb,"strncmp %s and %s for %d chars\n", + dprintf_info(string,"strncmp %s and %s for %d chars\n", debugstr_an (str1, n), debugstr_an (str2, n), n); return (INT32)strncmp( str1, str2, n ); } @@ -369,7 +368,7 @@ INT32 WINAPI lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n ) */ INT32 WINAPI lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n ) { - dprintf_string(stddeb,"strncmp L%s and L%s for %d chars\n", + dprintf_info(string,"strncmp L%s and L%s for %d chars\n", debugstr_wn (str1, n), debugstr_wn (str2, n), n); if (!n) return 0; while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; } @@ -384,7 +383,7 @@ INT32 WINAPI lstrncmpi32A( LPCSTR str1, LPCSTR str2, INT32 n ) { INT32 res; - dprintf_string(stddeb,"strncmpi %s and %s for %d chars\n", + dprintf_info(string,"strncmpi %s and %s for %d chars\n", debugstr_an (str1, n), debugstr_an (str2, n), n); if (!n) return 0; while ((--n > 0) && *str1) @@ -401,7 +400,7 @@ INT32 WINAPI lstrncmpi32W( LPCWSTR str1, LPCWSTR str2, INT32 n ) { INT32 res; - dprintf_string(stddeb,"strncmpi L%s and L%s for %d chars\n", + dprintf_info(string,"strncmpi L%s and L%s for %d chars\n", debugstr_wn (str1, n), debugstr_wn (str2, n), n); if (!n) return 0; while ((--n > 0) && *str1) @@ -542,9 +541,9 @@ BOOL32 WINAPI CharToOem32A( LPCSTR s, LPSTR d ) { LPSTR oldd = d; if (!s || !d) return TRUE; - dprintf_string (stddeb,"CharToOem %s\n", debugstr_a (s)); + dprintf_info(string,"CharToOem %s\n", debugstr_a (s)); while ((*d++ = ANSI_TO_OEM(*s++))); - dprintf_string (stddeb," to %s\n", debugstr_a (oldd)); + dprintf_info(string," to %s\n", debugstr_a (oldd)); return TRUE; } @@ -576,9 +575,9 @@ BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d ) { LPSTR oldd = d; if (!s || !d) return TRUE; - dprintf_string (stddeb,"CharToOem L%s\n", debugstr_w (s)); + dprintf_info(string,"CharToOem L%s\n", debugstr_w (s)); while ((*d++ = ANSI_TO_OEM(*s++))); - dprintf_string (stddeb," to %s\n", debugstr_a (oldd)); + dprintf_info(string," to %s\n", debugstr_a (oldd)); return TRUE; } @@ -589,9 +588,9 @@ BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d ) BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d ) { LPSTR oldd = d; - dprintf_string(stddeb,"OemToChar %s\n", debugstr_a (s)); + dprintf_info(string,"OemToChar %s\n", debugstr_a (s)); while ((*d++ = OEM_TO_ANSI(*s++))); - dprintf_string(stddeb," to %s\n", debugstr_a (oldd)); + dprintf_info(string," to %s\n", debugstr_a (oldd)); return TRUE; } @@ -601,7 +600,7 @@ BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d ) */ BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len ) { - dprintf_string(stddeb,"OemToCharBuff %s\n", debugstr_an (s, len)); + dprintf_info(string,"OemToCharBuff %s\n", debugstr_an (s, len)); while (len--) *d++ = OEM_TO_ANSI(*s++); return TRUE; } @@ -612,7 +611,7 @@ BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len ) */ BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len ) { - dprintf_string(stddeb,"OemToCharBuff %s\n", debugstr_an (s, len)); + dprintf_info(string,"OemToCharBuff %s\n", debugstr_an (s, len)); while (len--) *d++ = (WCHAR)OEM_TO_ANSI(*s++); return TRUE; } diff --git a/memory/virtual.c b/memory/virtual.c index 442ccd589c1..0ee4f21301d 100644 --- a/memory/virtual.c +++ b/memory/virtual.c @@ -18,7 +18,6 @@ #include "heap.h" #include "process.h" #include "xmalloc.h" -#include "stddebug.h" #include "debug.h" #ifndef MS_SYNC @@ -104,9 +103,14 @@ const K32OBJ_OPS MEM_MAPPED_FILE_Ops = NULL, /* satisfied */ NULL, /* add_wait */ NULL, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ VIRTUAL_DestroyMapping /* destroy */ }; +#define VIRTUAL_DEBUG_DUMP_VIEW(view) \ + if (!debugging_info(virtual)); else VIRTUAL_DumpView(view) + /*********************************************************************** * VIRTUAL_GetProtStr */ @@ -133,29 +137,28 @@ static void VIRTUAL_DumpView( FILE_VIEW *view ) UINT32 addr = view->base; BYTE prot = view->prot[0]; - dprintf_virtual( stddeb, "View: %08x - %08x%s", + printf( "View: %08x - %08x%s", view->base, view->base + view->size - 1, (view->flags & VFLAG_SYSTEM) ? " (system)" : "" ); if (view->mapping && view->mapping->file) - dprintf_virtual( stddeb, " %s @ %08x\n", - view->mapping->file->unix_name, view->offset ); + printf( " %s @ %08x\n", view->mapping->file->unix_name, view->offset ); else - dprintf_virtual( stddeb, " (anonymous)\n"); + printf( " (anonymous)\n"); for (count = i = 1; i < view->size >> page_shift; i++, count++) { if (view->prot[i] == prot) continue; - dprintf_virtual( stddeb, " %08x - %08x %s\n", - addr, addr + (count << page_shift) - 1, - VIRTUAL_GetProtStr(prot) ); + printf( " %08x - %08x %s\n", + addr, addr + (count << page_shift) - 1, + VIRTUAL_GetProtStr(prot) ); addr += (count << page_shift); prot = view->prot[i]; count = 0; } if (count) - dprintf_virtual( stddeb, " %08x - %08x %s\n", - addr, addr + (count << page_shift) - 1, - VIRTUAL_GetProtStr(prot) ); + printf( " %08x - %08x %s\n", + addr, addr + (count << page_shift) - 1, + VIRTUAL_GetProtStr(prot) ); } @@ -165,7 +168,7 @@ static void VIRTUAL_DumpView( FILE_VIEW *view ) void VIRTUAL_Dump(void) { FILE_VIEW *view = VIRTUAL_FirstView; - dprintf_virtual( stddeb, "\nDump of all virtual memory views:\n\n" ); + printf( "\nDump of all virtual memory views:\n\n" ); while (view) { VIRTUAL_DumpView( view ); @@ -235,7 +238,7 @@ static FILE_VIEW *VIRTUAL_CreateView( UINT32 base, UINT32 size, UINT32 offset, if (view->next) view->next->prev = view; prev->next = view; } - if (debugging_virtual) VIRTUAL_DumpView( view ); + VIRTUAL_DEBUG_DUMP_VIEW( view ); return view; } @@ -342,7 +345,7 @@ static BYTE VIRTUAL_GetProt( DWORD protect ) static BOOL32 VIRTUAL_SetProt( FILE_VIEW *view, UINT32 base, UINT32 size, BYTE vprot ) { - dprintf_virtual( stddeb, "VIRTUAL_SetProt: %08x-%08x %s\n", + dprintf_info(virtual, "VIRTUAL_SetProt: %08x-%08x %s\n", base, base + size - 1, VIRTUAL_GetProtStr( vprot ) ); if (mprotect( (void *)base, size, VIRTUAL_GetUnixProt(vprot) )) @@ -350,7 +353,7 @@ static BOOL32 VIRTUAL_SetProt( FILE_VIEW *view, UINT32 base, memset( view->prot + ((base - view->base) >> page_shift), vprot, size >> page_shift ); - if (debugging_virtual) VIRTUAL_DumpView( view ); + VIRTUAL_DEBUG_DUMP_VIEW( view ); return TRUE; } @@ -399,7 +402,7 @@ BOOL32 VIRTUAL_Init(void) int fd = open ("/proc/self/maps", O_RDONLY); if (fd >= 0) { - char buffer[80]; + char buffer[512]; /* line might be rather long in 2.1 */ for (;;) { @@ -441,7 +444,7 @@ LPVOID WINAPI VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect) UINT32 base, ptr, view_size; BYTE vprot; - dprintf_virtual( stddeb, "VirtualAlloc: %08x %08lx %lx %08lx\n", + dprintf_info(virtual, "VirtualAlloc: %08x %08lx %lx %08lx\n", (UINT32)addr, size, type, protect ); /* Round parameters to a page boundary */ @@ -470,6 +473,13 @@ LPVOID WINAPI VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect) size = (size + page_mask) & ~page_mask; } + if (type & MEM_TOP_DOWN) { + /* FIXME: MEM_TOP_DOWN allocates the largest possible address. + * Is there _ANY_ way to do it with UNIX mmap()? + */ + fprintf(stderr,"VirtualAlloc:MEM_TOP_DOWN ignored\n"); + type &= ~MEM_TOP_DOWN; + } /* Compute the protection flags */ if (!(type & (MEM_COMMIT | MEM_RESERVE)) || @@ -522,7 +532,7 @@ LPVOID WINAPI VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect) SetLastError( ERROR_OUTOFMEMORY ); return NULL; } - if (debugging_virtual) VIRTUAL_DumpView( view ); + VIRTUAL_DEBUG_DUMP_VIEW( view ); return (LPVOID)ptr; } @@ -548,7 +558,7 @@ BOOL32 WINAPI VirtualFree( LPVOID addr, DWORD size, DWORD type ) FILE_VIEW *view; UINT32 base; - dprintf_virtual( stddeb, "VirtualFree: %08x %08lx %lx\n", + dprintf_info(virtual, "VirtualFree: %08x %08lx %lx\n", (UINT32)addr, size, type ); /* Fix the parameters */ @@ -618,7 +628,7 @@ BOOL32 WINAPI VirtualProtect( LPVOID addr, DWORD size, DWORD new_prot, UINT32 base, i; BYTE vprot, *p; - dprintf_virtual( stddeb, "VirtualProtect: %08x %08lx %08lx\n", + dprintf_info(virtual, "VirtualProtect: %08x %08lx %08lx\n", (UINT32)addr, size, new_prot ); /* Fix the parameters */ @@ -890,7 +900,7 @@ HANDLE32 WINAPI CreateFileMapping32A(HFILE32 hFile, LPSECURITY_ATTRIBUTES attr, /* Check parameters */ - dprintf_virtual(stddeb,"CreateFileMapping32A(%x,%p,%08lx,%08lx%08lx,%s)\n", + dprintf_info(virtual,"CreateFileMapping32A(%x,%p,%08lx,%08lx%08lx,%s)\n", hFile, attr, protect, size_high, size_low, name ); vprot = VIRTUAL_GetProt( protect ); @@ -1102,7 +1112,7 @@ LPVOID WINAPI MapViewOfFileEx(HANDLE32 handle, DWORD access, DWORD offset_high, /* Map the file */ - dprintf_virtual( stddeb, "MapViewOfFile: handle=%x size=%x offset=%lx\n", + dprintf_info(virtual, "MapViewOfFile: handle=%x size=%x offset=%lx\n", handle, size, offset_low ); ptr = (UINT32)FILE_dommap( mapping->file, addr, 0, size, 0, offset_low, @@ -1137,7 +1147,7 @@ BOOL32 WINAPI FlushViewOfFile( LPCVOID base, DWORD cbFlush ) FILE_VIEW *view; UINT32 addr = ROUND_ADDR( base ); - dprintf_virtual( stddeb, "FlushViewOfFile at %p for %ld bytes\n", + dprintf_info(virtual, "FlushViewOfFile at %p for %ld bytes\n", base, cbFlush ); if (!(view = VIRTUAL_FindView( addr ))) diff --git a/misc/aspi.c b/misc/aspi.c index 993cd4ad3fe..363c4247f6a 100644 --- a/misc/aspi.c +++ b/misc/aspi.c @@ -13,7 +13,7 @@ #include "options.h" #include "heap.h" #include "debug.h" -#include "stddebug.h" + /* FIXME! * 1) Residual byte length reporting not handled @@ -122,16 +122,16 @@ ASPI_OpenDevice16(SRB_ExecSCSICmd16 *prb) sprintf(idstr, "scsi c%1dt%1dd%1d", prb->SRB_HaId, prb->SRB_Target, prb->SRB_Lun); if (!PROFILE_GetWineIniString(idstr, "Device", "", device_str, sizeof(device_str))) { - dprintf_aspi(stddeb, "Trying to open unlisted scsi device %s\n", idstr); + dprintf_info(aspi, "Trying to open unlisted scsi device %s\n", idstr); return -1; } - dprintf_aspi(stddeb, "Opening device %s=%s\n", idstr, device_str); + dprintf_info(aspi, "Opening device %s=%s\n", idstr, device_str); fd = open(device_str, O_RDWR); if (fd == -1) { int save_error = errno; - dprintf_aspi(stddeb, "Error opening device errno=%d\n", save_error); + dprintf_warn(aspi, "Error opening device errno=%d\n", save_error); return -1; } @@ -156,59 +156,58 @@ ASPI_DebugPrintCmd16(SRB_ExecSCSICmd16 *prb) int i; BYTE *cdb; BYTE *lpBuf; + dbg_decl_str(aspi, 512); lpBuf = PTR_SEG_TO_LIN(prb->SRB_BufPointer); switch (prb->CDBByte[0]) { case CMD_INQUIRY: - dprintf_aspi(stddeb, "{\n"); - dprintf_aspi(stddeb, "\tEVPD: %d\n", prb->CDBByte[1] & 1); - dprintf_aspi(stddeb, "\tLUN: %d\n", (prb->CDBByte[1] & 0xc) >> 1); - dprintf_aspi(stddeb, "\tPAGE CODE: %d\n", prb->CDBByte[2]); - dprintf_aspi(stddeb, "\tALLOCATION LENGTH: %d\n", prb->CDBByte[4]); - dprintf_aspi(stddeb, "\tCONTROL: %d\n", prb->CDBByte[5]); - dprintf_aspi(stddeb, "}\n"); + dprintf_info(aspi, "{\n"); + dprintf_info(aspi, "\tEVPD: %d\n", prb->CDBByte[1] & 1); + dprintf_info(aspi, "\tLUN: %d\n", (prb->CDBByte[1] & 0xc) >> 1); + dprintf_info(aspi, "\tPAGE CODE: %d\n", prb->CDBByte[2]); + dprintf_info(aspi, "\tALLOCATION LENGTH: %d\n", prb->CDBByte[4]); + dprintf_info(aspi, "\tCONTROL: %d\n", prb->CDBByte[5]); + dprintf_info(aspi, "}\n"); break; case CMD_SCAN_SCAN: - dprintf_aspi(stddeb, "Transfer Length: %d\n", prb->CDBByte[4]); + dprintf_info(aspi, "Transfer Length: %d\n", prb->CDBByte[4]); break; } - dprintf_aspi(stddeb, "Host Adapter: %d\n", prb->SRB_HaId); - dprintf_aspi(stddeb, "Flags: %d\n", prb->SRB_Flags); + dprintf_info(aspi, "Host Adapter: %d\n", prb->SRB_HaId); + dprintf_info(aspi, "Flags: %d\n", prb->SRB_Flags); if (TARGET_TO_HOST(prb)) { - dprintf_aspi(stddeb, "\tData transfer: Target to host. Length checked.\n"); + dprintf_info(aspi, "\tData transfer: Target to host. Length checked.\n"); } else if (HOST_TO_TARGET(prb)) { - dprintf_aspi(stddeb, "\tData transfer: Host to target. Length checked.\n"); + dprintf_info(aspi, "\tData transfer: Host to target. Length checked.\n"); } else if (NO_DATA_TRANSFERED(prb)) { - dprintf_aspi(stddeb, "\tData transfer: none\n"); + dprintf_info(aspi, "\tData transfer: none\n"); } else { - dprintf_aspi(stddeb, "\tTransfer by scsi cmd. Length not checked\n"); + dprintf_warn(aspi, "\tTransfer by scsi cmd. Length not checked\n"); } - dprintf_aspi(stddeb, "\tResidual byte length reporting %s\n", prb->SRB_Flags & 0x4 ? "enabled" : "disabled"); - dprintf_aspi(stddeb, "\tLinking %s\n", prb->SRB_Flags & 0x2 ? "enabled" : "disabled"); - dprintf_aspi(stddeb, "\tPosting %s\n", prb->SRB_Flags & 0x1 ? "enabled" : "disabled"); - dprintf_aspi(stddeb, "Target: %d\n", prb->SRB_Target); - dprintf_aspi(stddeb, "Lun: %d\n", prb->SRB_Lun); - dprintf_aspi(stddeb, "BufLen: %ld\n", prb->SRB_BufLen); - dprintf_aspi(stddeb, "SenseLen: %d\n", prb->SRB_SenseLen); - dprintf_aspi(stddeb, "BufPtr: %lx (%p)\n", prb->SRB_BufPointer, lpBuf); - dprintf_aspi(stddeb, "LinkPointer %lx\n", prb->SRB_Rsvd1); - dprintf_aspi(stddeb, "CDB Length: %d\n", prb->SRB_CDBLen); - dprintf_aspi(stddeb, "POST Proc: %lx\n", (DWORD) prb->SRB_PostProc); + dprintf_info(aspi, "\tResidual byte length reporting %s\n", prb->SRB_Flags & 0x4 ? "enabled" : "disabled"); + dprintf_info(aspi, "\tLinking %s\n", prb->SRB_Flags & 0x2 ? "enabled" : "disabled"); + dprintf_info(aspi, "\tPosting %s\n", prb->SRB_Flags & 0x1 ? "enabled" : "disabled"); + dprintf_info(aspi, "Target: %d\n", prb->SRB_Target); + dprintf_info(aspi, "Lun: %d\n", prb->SRB_Lun); + dprintf_info(aspi, "BufLen: %ld\n", prb->SRB_BufLen); + dprintf_info(aspi, "SenseLen: %d\n", prb->SRB_SenseLen); + dprintf_info(aspi, "BufPtr: %lx (%p)\n", prb->SRB_BufPointer, lpBuf); + dprintf_info(aspi, "LinkPointer %lx\n", prb->SRB_Rsvd1); + dprintf_info(aspi, "CDB Length: %d\n", prb->SRB_CDBLen); + dprintf_info(aspi, "POST Proc: %lx\n", (DWORD) prb->SRB_PostProc); cdb = &prb->CDBByte[0]; - dprintf_aspi(stddeb, "CDB buffer["); cmd = prb->CDBByte[0]; for (i = 0; i < prb->SRB_CDBLen; i++) { - if (i != 0) - dprintf_aspi(stddeb, ","); - dprintf_aspi(stddeb, "%02x", *cdb++); + if (i != 0) dsprintf(aspi, ","); + dsprintf(aspi, "%02x", *cdb++); } - dprintf_aspi(stddeb, "]\n"); + dprintf_info(aspi, "CDB buffer[%s]\n", dbg_str(aspi)); } static void @@ -216,15 +215,14 @@ PrintSenseArea16(SRB_ExecSCSICmd16 *prb) { int i; BYTE *cdb; + dbg_decl_str(aspi, 512); cdb = &prb->CDBByte[0]; - dprintf_aspi(stddeb, "SenseArea["); for (i = 0; i < prb->SRB_SenseLen; i++) { - if (i) - dprintf_aspi(stddeb, ","); - dprintf_aspi(stddeb, "%02x", *cdb++); + if (i) dsprintf(aspi, ","); + dsprintf(aspi, "%02x", *cdb++); } - dprintf_aspi(stddeb, "]\n"); + dprintf_info(aspi, "SenseArea[%s]\n", dbg_str(aspi)); } static void @@ -236,7 +234,7 @@ ASPI_DebugPrintResult16(SRB_ExecSCSICmd16 *prb) switch (prb->CDBByte[0]) { case CMD_INQUIRY: - dprintf_aspi(stddeb, "Vendor: %s\n", lpBuf + INQUIRY_VENDOR); + dprintf_info(aspi, "Vendor: %s\n", lpBuf + INQUIRY_VENDOR); break; case CMD_TEST_UNIT_READY: PrintSenseArea16(prb); @@ -314,20 +312,20 @@ ASPI_ExecScsiCmd16(SRB_ExecSCSICmd16 *prb, SEGPTR segptr_prb) if (myerror == ENOMEM) { fprintf(stderr, "ASPI: Linux generic scsi driver\n You probably need to re-compile your kernel with a larger SG_BIG_BUFF value (sg.h)\n Suggest 130560\n"); } - dprintf_aspi(stddeb, "errno: = %d\n", myerror); + dprintf_warn(aspi, "errno: = %d\n", myerror); } goto error_exit; } status = read(fd, sg_reply_hdr, out_len); if (status < 0 || status != out_len) { - dprintf_aspi(stddeb, "not enough bytes read from scsi device%d\n", status); + dprintf_warn(aspi, "not enough bytes read from scsi device%d\n", status); goto error_exit; } if (sg_reply_hdr->result != 0) { error_code = sg_reply_hdr->result; - dprintf_aspi(stddeb, "reply header error (%d)\n", sg_reply_hdr->result); + dprintf_warn(aspi, "reply header error (%d)\n", sg_reply_hdr->result); goto error_exit; } @@ -351,7 +349,7 @@ ASPI_ExecScsiCmd16(SRB_ExecSCSICmd16 *prb, SEGPTR segptr_prb) /* now do posting */ if (ASPI_POSTING(prb) && prb->SRB_PostProc) { - dprintf_aspi(stddeb, "ASPI: Post Routine (%lx) called\n", (DWORD) prb->SRB_PostProc); + dprintf_info(aspi, "ASPI: Post Routine (%lx) called\n", (DWORD) prb->SRB_PostProc); Callbacks->CallASPIPostProc(prb->SRB_PostProc, segptr_prb); } @@ -363,17 +361,17 @@ ASPI_ExecScsiCmd16(SRB_ExecSCSICmd16 *prb, SEGPTR segptr_prb) error_exit: if (error_code == EBUSY) { prb->SRB_Status = SS_ASPI_IS_BUSY; - dprintf_aspi(stddeb, "ASPI: Device busy\n"); + dprintf_info(aspi, "ASPI: Device busy\n"); } else { - dprintf_aspi(stddeb, "ASPI_GenericHandleScsiCmd failed\n"); + dprintf_warn(aspi, "ASPI_GenericHandleScsiCmd failed\n"); prb->SRB_Status = SS_ERR; } /* I'm not sure exactly error codes work here * We probably should set prb->SRB_TargStat, SRB_HaStat ? */ - dprintf_aspi(stddeb, "ASPI_GenericHandleScsiCmd: error_exit\n"); + dprintf_warn(aspi, "ASPI_GenericHandleScsiCmd: error_exit\n"); free(sg_reply_hdr); free(sg_hd); return prb->SRB_Status; @@ -387,7 +385,7 @@ error_exit: WORD WINAPI GetASPISupportInfo16() { #ifdef linux - dprintf_aspi(stddeb, "GETASPISupportInfo\n"); + dprintf_info(aspi, "GETASPISupportInfo\n"); /* high byte SS_COMP - low byte number of host adapters. * FIXME!!! The number of host adapters is incorrect. * I'm not sure how to determine this under linux etc. @@ -409,19 +407,19 @@ WORD WINAPI SendASPICommand16(SEGPTR segptr_srb) switch (lpSRB->common.SRB_cmd) { case SC_HA_INQUIRY: - dprintf_aspi(stddeb, "ASPI: Not implemented SC_HA_INQUIRY\n"); + dprintf_fixme(aspi, "ASPI: Not implemented SC_HA_INQUIRY\n"); break; case SC_GET_DEV_TYPE: - dprintf_aspi(stddeb, "ASPI: Not implemented SC_GET_DEV_TYPE\n"); + dprintf_fixme(aspi, "ASPI: Not implemented SC_GET_DEV_TYPE\n"); break; case SC_EXEC_SCSI_CMD: return ASPI_ExecScsiCmd16(&lpSRB->cmd, segptr_srb); break; case SC_RESET_DEV: - dprintf_aspi(stddeb, "ASPI: Not implemented SC_RESET_DEV\n"); + dprintf_fixme(aspi, "ASPI: Not implemented SC_RESET_DEV\n"); break; default: - dprintf_aspi(stddeb, "ASPI: Unknown command %d\n", lpSRB->common.SRB_cmd); + dprintf_warn(aspi, "ASPI: Unknown command %d\n", lpSRB->common.SRB_cmd); } return SS_INVALID_SRB; #else diff --git a/misc/comm.c b/misc/comm.c index 73681d94e91..d41899478f0 100644 --- a/misc/comm.c +++ b/misc/comm.c @@ -34,7 +34,6 @@ #include "comm.h" #include "heap.h" #include "options.h" -#include "stddebug.h" #include "debug.h" #ifndef TIOCINQ @@ -84,7 +83,7 @@ void COMM_Init(void) COM[x].fd = 0; strcpy(COM[x].devicename, temp); } - dprintf_comm(stddeb, + dprintf_info(comm, "Comm_Init: %s = %s\n", option, COM[x].devicename); } @@ -107,7 +106,7 @@ void COMM_Init(void) LPT[x].fd = 0; strcpy(LPT[x].devicename, temp); } - dprintf_comm(stddeb, + dprintf_info(comm, "Comm_Init: %s = %s\n", option, LPT[x].devicename); } @@ -153,7 +152,7 @@ int ValidLPTPort(int x) int WinError(void) { - dprintf_comm(stddeb, "WinError: errno = %d\n", errno); + dprintf_info(comm, "WinError: errno = %d\n", errno); switch (errno) { default: return CE_IOE; @@ -170,7 +169,7 @@ BOOL16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb) int port; char *ptr, temp[256]; - dprintf_comm(stddeb, + dprintf_info(comm, "BuildCommDCB: (%s), ptr %p\n", device, lpdcb); commerror = 0; @@ -208,13 +207,13 @@ BOOL16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb) lpdcb->BaudRate = COM[port].baudrate; else lpdcb->BaudRate = atoi(ptr); - dprintf_comm(stddeb,"BuildCommDCB: baudrate (%d)\n", lpdcb->BaudRate); + dprintf_info(comm,"BuildCommDCB: baudrate (%d)\n", lpdcb->BaudRate); ptr = strtok(NULL, ", "); if (islower(*ptr)) *ptr = toupper(*ptr); - dprintf_comm(stddeb,"BuildCommDCB: parity (%c)\n", *ptr); + dprintf_info(comm,"BuildCommDCB: parity (%c)\n", *ptr); lpdcb->fParity = 1; switch (*ptr) { case 'N': @@ -236,11 +235,11 @@ BOOL16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb) } ptr = strtok(NULL, ", "); - dprintf_comm(stddeb, "BuildCommDCB: charsize (%c)\n", *ptr); + dprintf_info(comm, "BuildCommDCB: charsize (%c)\n", *ptr); lpdcb->ByteSize = *ptr - '0'; ptr = strtok(NULL, ", "); - dprintf_comm(stddeb, "BuildCommDCB: stopbits (%c)\n", *ptr); + dprintf_info(comm, "BuildCommDCB: stopbits (%c)\n", *ptr); switch (*ptr) { case '1': lpdcb->StopBits = ONESTOPBIT; @@ -274,7 +273,7 @@ BOOL32 WINAPI BuildCommDCBAndTimeouts32A(LPCSTR device, LPDCB32 lpdcb, int port; char *ptr,*temp; - dprintf_comm(stddeb,"BuildCommDCBAndTimeouts32A(%s,%p,%p)\n",device,lpdcb,lptimeouts); + dprintf_info(comm,"BuildCommDCBAndTimeouts32A(%s,%p,%p)\n",device,lpdcb,lptimeouts); commerror = 0; if (!lstrncmpi32A(device,"COM",3)) { @@ -401,7 +400,7 @@ BOOL32 WINAPI BuildCommDCBAndTimeouts32W( LPCWSTR devid, LPDCB32 lpdcb, LPSTR devidA; BOOL32 ret; - dprintf_comm(stddeb,"BuildCommDCBAndTimeouts32W(%p,%p,%p)\n",devid,lpdcb,lptimeouts); + dprintf_info(comm,"BuildCommDCBAndTimeouts32W(%p,%p,%p)\n",devid,lpdcb,lptimeouts); devidA = HEAP_strdupWtoA( GetProcessHeap(), 0, devid ); ret=BuildCommDCBAndTimeouts32A(devidA,lpdcb,lptimeouts); HeapFree( GetProcessHeap(), 0, devidA ); @@ -423,7 +422,7 @@ INT16 WINAPI OpenComm(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) { int port,fd; - dprintf_comm(stddeb, + dprintf_info(comm, "OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue); commerror = 0; @@ -435,7 +434,7 @@ INT16 WINAPI OpenComm(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) commerror = IE_BADID; } - dprintf_comm(stddeb, + dprintf_info(comm, "OpenComm: %s = %s\n", device, COM[port].devicename); if (!ValidCOMPort(port)) { @@ -488,7 +487,7 @@ INT16 WINAPI OpenComm(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) INT16 WINAPI CloseComm(INT16 fd) { int port; - dprintf_comm(stddeb,"CloseComm: fd %d\n", fd); + dprintf_info(comm,"CloseComm: fd %d\n", fd); if ((port = GetCommPort(fd)) !=-1) { /* [LW] */ SEGPTR_FREE(unknown[port]); COM[port].fd = 0; /* my adaptation of RER's fix */ @@ -513,7 +512,7 @@ INT16 WINAPI SetCommBreak16(INT16 fd) { struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"SetCommBreak: fd: %d\n", fd); + dprintf_info(comm,"SetCommBreak: fd: %d\n", fd); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return -1; @@ -532,7 +531,7 @@ BOOL32 WINAPI SetCommBreak32(INT32 fd) struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"SetCommBreak: fd: %d\n", fd); + dprintf_info(comm,"SetCommBreak: fd: %d\n", fd); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return FALSE; @@ -550,7 +549,7 @@ INT16 WINAPI ClearCommBreak16(INT16 fd) { struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"ClearCommBreak: fd: %d\n", fd); + dprintf_info(comm,"ClearCommBreak: fd: %d\n", fd); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return -1; @@ -568,7 +567,7 @@ BOOL32 WINAPI ClearCommBreak32(INT32 fd) { struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"ClearCommBreak: fd: %d\n", fd); + dprintf_info(comm,"ClearCommBreak: fd: %d\n", fd); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return FALSE; @@ -587,7 +586,7 @@ LONG WINAPI EscapeCommFunction16(UINT16 fd,UINT16 nFunction) int max; struct termios port; - dprintf_comm(stddeb,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction); + dprintf_info(comm,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction); if (tcgetattr(fd,&port) == -1) { commerror=WinError(); return -1; @@ -663,7 +662,7 @@ BOOL32 WINAPI EscapeCommFunction32(INT32 fd,UINT32 nFunction) struct termios port; struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction); + dprintf_info(comm,"EscapeCommFunction fd: %d, function: %d\n", fd, nFunction); if (tcgetattr(fd,&port) == -1) { commerror=WinError(); return FALSE; @@ -735,7 +734,7 @@ INT16 WINAPI FlushComm(INT16 fd,INT16 fnQueue) { int queue; - dprintf_comm(stddeb,"FlushComm fd: %d, queue: %d\n", fd, fnQueue); + dprintf_info(comm,"FlushComm fd: %d, queue: %d\n", fd, fnQueue); switch (fnQueue) { case 0: queue = TCOFLUSH; break; @@ -760,7 +759,7 @@ INT16 WINAPI FlushComm(INT16 fd,INT16 fnQueue) */ BOOL32 WINAPI PurgeComm( HANDLE32 hFile, DWORD flags) { - dprintf_comm(stdnimp, "PurgeComm(%08x %08lx) unimplemented stub\n", + dprintf_fixme(comm, "PurgeComm(%08x %08lx) unimplemented stub\n", hFile, flags); return 0; } @@ -785,15 +784,15 @@ INT16 WINAPI GetCommError(INT16 fd,LPCOMSTAT lpStat) if (rc) fprintf(stderr, "Error !\n"); lpStat->cbInQue = cnt; - dprintf_comm(stddeb, - "GetCommError: fd %d, error %d, lpStat %d %d %d\n", - fd, commerror, - lpStat->status, lpStat->cbInQue, lpStat->cbOutQue); + dprintf_info(comm, + "GetCommError: fd %d, error %d, lpStat %d %d %d\n", + fd, commerror, lpStat->status, lpStat->cbInQue, + lpStat->cbOutQue); } else - dprintf_comm(stddeb, - "GetCommError: fd %d, error %d, lpStat NULL\n", - fd, commerror); + dprintf_info(comm, + "GetCommError: fd %d, error %d, lpStat NULL\n", + fd, commerror); /* * [RER] I have no idea what the following is trying to accomplish. @@ -811,8 +810,8 @@ BOOL32 WINAPI ClearCommError(INT32 fd,LPDWORD errors,LPCOMSTAT lpStat) { int temperror; - dprintf_comm(stddeb, - "ClearCommError: fd %d (current error %d)\n", fd, commerror); + dprintf_info(comm, "ClearCommError: fd %d (current error %d)\n", + fd, commerror); temperror = commerror; commerror = 0; return TRUE; @@ -827,19 +826,18 @@ SEGPTR WINAPI SetCommEventMask(INT16 fd,UINT16 fuEvtMask) int act; int repid; unsigned int mstat; - dprintf_comm(stddeb,"SetCommEventMask:fd %d,mask %d\n",fd,fuEvtMask); + dprintf_info(comm,"SetCommEventMask:fd %d,mask %d\n",fd,fuEvtMask); eventmask |= fuEvtMask; if ((act = GetCommPort(fd)) == -1) { - dprintf_comm(stddeb," fd %d not comm port\n",act); + dprintf_warn(comm," fd %d not comm port\n",act); return NULL;} stol = unknown[act]; stol += msr; repid = ioctl(fd,TIOCMGET,&mstat); - dprintf_comm(stddeb, - " ioctl %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]); + dprintf_info(comm, " ioctl %d, msr %x at %p %p\n",repid,mstat,stol,unknown[act]); if ((mstat&TIOCM_CAR)) {*stol |= 0x80;} else {*stol &=0x7f;} - dprintf_comm(stddeb," modem dcd construct %x\n",*stol); + dprintf_info(comm," modem dcd construct %x\n",*stol); return SEGPTR_GET(unknown[act]); } @@ -850,7 +848,7 @@ UINT16 WINAPI GetCommEventMask(INT16 fd,UINT16 fnEvtClear) { int events = 0; - dprintf_comm(stddeb, + dprintf_info(comm, "GetCommEventMask: fd %d, mask %d\n", fd, fnEvtClear); /* @@ -864,7 +862,7 @@ UINT16 WINAPI GetCommEventMask(INT16 fd,UINT16 fnEvtClear) rc = ioctl(fd, TIOCINQ, &cnt); if (cnt) events |= EV_RXCHAR; - dprintf_comm(stddeb, + dprintf_info(comm, "GetCommEventMask: rxchar %ld\n", cnt); } @@ -873,7 +871,7 @@ UINT16 WINAPI GetCommEventMask(INT16 fd,UINT16 fnEvtClear) */ /* TODO */ - dprintf_comm(stddeb, + dprintf_info(comm, "GetCommEventMask: return events %d\n", events); return events; @@ -892,7 +890,7 @@ UINT16 WINAPI GetCommEventMask(INT16 fd,UINT16 fnEvtClear) */ BOOL32 WINAPI SetupComm( HANDLE32 hFile, DWORD insize, DWORD outsize) { - dprintf_comm(stdnimp, "SetupComm: insize %ld outsize %ld unimplemented stub\n", insize, outsize); + dprintf_fixme(comm, "SetupComm: insize %ld outsize %ld unimplemented stub\n", insize, outsize); return FALSE; } @@ -901,7 +899,7 @@ BOOL32 WINAPI SetupComm( HANDLE32 hFile, DWORD insize, DWORD outsize) */ BOOL32 WINAPI GetCommMask(INT32 fd,LPDWORD evtmask) { - dprintf_comm(stddeb, + dprintf_info(comm, "GetCommMask: fd %d, mask %p\n", fd, evtmask); *evtmask = eventmask; return TRUE; @@ -912,7 +910,7 @@ BOOL32 WINAPI GetCommMask(INT32 fd,LPDWORD evtmask) */ BOOL32 WINAPI SetCommMask(INT32 fd,DWORD evtmask) { - dprintf_comm(stddeb, + dprintf_info(comm, "SetCommMask: fd %d, mask %lx\n", fd, evtmask); eventmask = evtmask; return TRUE; @@ -926,7 +924,7 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) struct termios port; struct DosDeviceStruct *ptr; - dprintf_comm(stddeb, + dprintf_info(comm, "SetCommState16: fd %d, ptr %p\n", lpdcb->Id, lpdcb); if (tcgetattr(lpdcb->Id, &port) == -1) { commerror = WinError(); @@ -957,7 +955,7 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) } if (ptr->baudrate > 0) lpdcb->BaudRate = ptr->baudrate; - dprintf_comm(stddeb,"SetCommState: baudrate %d\n",lpdcb->BaudRate); + dprintf_info(comm,"SetCommState: baudrate %d\n",lpdcb->BaudRate); #ifdef CBAUD port.c_cflag &= ~CBAUD; switch (lpdcb->BaudRate) { @@ -1051,7 +1049,7 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) } port.c_ispeed = port.c_ospeed; #endif - dprintf_comm(stddeb,"SetCommState: bytesize %d\n",lpdcb->ByteSize); + dprintf_info(comm,"SetCommState: bytesize %d\n",lpdcb->ByteSize); port.c_cflag &= ~CSIZE; switch (lpdcb->ByteSize) { case 5: @@ -1071,7 +1069,7 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) return -1; } - dprintf_comm(stddeb,"SetCommState: parity %d\n",lpdcb->Parity); + dprintf_info(comm,"SetCommState: parity %d\n",lpdcb->Parity); port.c_cflag &= ~(PARENB | PARODD); if (lpdcb->fParity) switch (lpdcb->Parity) { @@ -1092,7 +1090,7 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) } - dprintf_comm(stddeb,"SetCommState: stopbits %d\n",lpdcb->StopBits); + dprintf_info(comm,"SetCommState: stopbits %d\n",lpdcb->StopBits); switch (lpdcb->StopBits) { case ONESTOPBIT: @@ -1139,7 +1137,7 @@ BOOL32 WINAPI SetCommState32(INT32 fd,LPDCB32 lpdcb) struct termios port; struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"SetCommState32: fd %d, ptr %p\n",fd,lpdcb); + dprintf_info(comm,"SetCommState32: fd %d, ptr %p\n",fd,lpdcb); if (tcgetattr(fd,&port) == -1) { commerror = WinError(); return FALSE; @@ -1169,7 +1167,7 @@ BOOL32 WINAPI SetCommState32(INT32 fd,LPDCB32 lpdcb) } if (ptr->baudrate > 0) lpdcb->BaudRate = ptr->baudrate; - dprintf_comm(stddeb,"SetCommState: baudrate %ld\n",lpdcb->BaudRate); + dprintf_info(comm,"SetCommState: baudrate %ld\n",lpdcb->BaudRate); #ifdef CBAUD port.c_cflag &= ~CBAUD; switch (lpdcb->BaudRate) { @@ -1257,7 +1255,7 @@ BOOL32 WINAPI SetCommState32(INT32 fd,LPDCB32 lpdcb) } port.c_ispeed = port.c_ospeed; #endif - dprintf_comm(stddeb,"SetCommState: bytesize %d\n",lpdcb->ByteSize); + dprintf_info(comm,"SetCommState: bytesize %d\n",lpdcb->ByteSize); port.c_cflag &= ~CSIZE; switch (lpdcb->ByteSize) { case 5: @@ -1277,7 +1275,7 @@ BOOL32 WINAPI SetCommState32(INT32 fd,LPDCB32 lpdcb) return FALSE; } - dprintf_comm(stddeb,"SetCommState: parity %d\n",lpdcb->Parity); + dprintf_info(comm,"SetCommState: parity %d\n",lpdcb->Parity); port.c_cflag &= ~(PARENB | PARODD); if (lpdcb->fParity) switch (lpdcb->Parity) { @@ -1298,7 +1296,7 @@ BOOL32 WINAPI SetCommState32(INT32 fd,LPDCB32 lpdcb) } - dprintf_comm(stddeb,"SetCommState: stopbits %d\n",lpdcb->StopBits); + dprintf_info(comm,"SetCommState: stopbits %d\n",lpdcb->StopBits); switch (lpdcb->StopBits) { case ONESTOPBIT: port.c_cflag &= ~CSTOPB; @@ -1346,7 +1344,7 @@ INT16 WINAPI GetCommState16(INT16 fd, LPDCB16 lpdcb) { struct termios port; - dprintf_comm(stddeb,"GetCommState16: fd %d, ptr %p\n", fd, lpdcb); + dprintf_info(comm,"GetCommState16: fd %d, ptr %p\n", fd, lpdcb); if (tcgetattr(fd, &port) == -1) { commerror = WinError(); return -1; @@ -1471,7 +1469,7 @@ BOOL32 WINAPI GetCommState32(INT32 fd, LPDCB32 lpdcb) { struct termios port; - dprintf_comm(stddeb,"GetCommState32: fd %d, ptr %p\n", fd, lpdcb); + dprintf_info(comm,"GetCommState32: fd %d, ptr %p\n", fd, lpdcb); if (GetDeviceStruct(fd) == NULL) return FALSE; if (tcgetattr(fd, &port) == -1) { commerror = WinError(); @@ -1587,7 +1585,7 @@ INT16 WINAPI TransmitCommChar16(INT16 fd,CHAR chTransmit) { struct DosDeviceStruct *ptr; - dprintf_comm(stddeb, + dprintf_info(comm, "TransmitCommChar: fd %d, data %d \n", fd, chTransmit); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; @@ -1615,7 +1613,7 @@ BOOL32 WINAPI TransmitCommChar32(INT32 fd,CHAR chTransmit) { struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"TransmitCommChar32(%d,'%c')\n",fd,chTransmit); + dprintf_info(comm,"TransmitCommChar32(%d,'%c')\n",fd,chTransmit); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return FALSE; @@ -1641,7 +1639,7 @@ INT16 WINAPI UngetCommChar(INT16 fd,CHAR chUnget) { struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"UngetCommChar: fd %d (char %d)\n", fd, chUnget); + dprintf_info(comm,"UngetCommChar: fd %d (char %d)\n", fd, chUnget); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; return -1; @@ -1663,10 +1661,10 @@ INT16 WINAPI UngetCommChar(INT16 fd,CHAR chUnget) */ INT16 WINAPI ReadComm(INT16 fd,LPSTR lpvBuf,INT16 cbRead) { - int status, x, length; + int status, length; struct DosDeviceStruct *ptr; - dprintf_comm(stddeb, + dprintf_info(comm, "ReadComm: fd %d, ptr %p, length %d\n", fd, lpvBuf, cbRead); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; @@ -1698,9 +1696,7 @@ INT16 WINAPI ReadComm(INT16 fd,LPSTR lpvBuf,INT16 cbRead) return length; } } else { - for (x=0; x < length+status; x++) - dprintf_comm(stddeb,"%c",*(lpvBuf+x)); - dprintf_comm(stddeb,"\nthus endeth\n"); + dprintf_info(comm,"%*s\n", length+status, lpvBuf); commerror = 0; return length + status; } @@ -1711,10 +1707,10 @@ INT16 WINAPI ReadComm(INT16 fd,LPSTR lpvBuf,INT16 cbRead) */ INT16 WINAPI WriteComm(INT16 fd, LPSTR lpvBuf, INT16 cbWrite) { - int x, length; + int length; struct DosDeviceStruct *ptr; - dprintf_comm(stddeb,"WriteComm: fd %d, ptr %p, length %d\n", + dprintf_info(comm,"WriteComm: fd %d, ptr %p, length %d\n", fd, lpvBuf, cbWrite); if ((ptr = GetDeviceStruct(fd)) == NULL) { commerror = IE_BADID; @@ -1726,9 +1722,7 @@ INT16 WINAPI WriteComm(INT16 fd, LPSTR lpvBuf, INT16 cbWrite) return -1; } - for (x=0; x != cbWrite ; x++) - dprintf_comm(stddeb,"%c", *(lpvBuf + x) ); - dprintf_comm(stddeb,"\n"); + dprintf_info(comm,"%*s\n", cbWrite, lpvBuf ); length = write(fd, (void *) lpvBuf, cbWrite); if (length == -1) { diff --git a/misc/commdlg.c b/misc/commdlg.c index f81c7b140e5..c0f2a124084 100644 --- a/misc/commdlg.c +++ b/misc/commdlg.c @@ -17,7 +17,6 @@ #include "module.h" #include "resource.h" #include "drive.h" -#include "stddebug.h" #include "debug.h" static DWORD CommDlgLastError = 0; @@ -138,7 +137,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn ) FreeResource16( hDlgTmpl ); } - dprintf_commdlg(stddeb,"GetOpenFileName // return lpstrFile='%s' !\n", + dprintf_info(commdlg,"GetOpenFileName // return lpstrFile='%s' !\n", (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile)); return bRet; } @@ -232,7 +231,7 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn) FreeResource16( hDlgTmpl ); } - dprintf_commdlg(stddeb, "GetSaveFileName // return lpstrFile='%s' !\n", + dprintf_info(commdlg, "GetSaveFileName // return lpstrFile='%s' !\n", (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile)); return bRet; } @@ -475,7 +474,7 @@ static LONG FILEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) int i, n; LPOPENFILENAME16 lpofn; char tmpstr[512]; - LPSTR pstr; + LPSTR pstr, old_pstr; SetWindowLong32A(hWnd, DWL_USER, lParam); lpofn = (LPOPENFILENAME16)PTR_SEG_TO_LIN(lParam); if (lpofn->lpstrTitle) SetWindowText16( hWnd, lpofn->lpstrTitle ); @@ -484,15 +483,16 @@ static LONG FILEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) { pstr = (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter); n = 0; - dprintf_commdlg(stddeb,"lpstrCustomFilter = %p\n", pstr); + dprintf_info(commdlg,"lpstrCustomFilter = %p\n", pstr); while(*pstr) { - dprintf_commdlg(stddeb,"lpstrCustomFilter // add str='%s' ",pstr); + old_pstr = pstr; i = SendDlgItemMessage16(hWnd, cmb1, CB_ADDSTRING16, 0, (LPARAM)lpofn->lpstrCustomFilter + n ); n += strlen(pstr) + 1; pstr += strlen(pstr) + 1; - dprintf_commdlg(stddeb,"associated to '%s'\n", pstr); + dprintf_info(commdlg,"lpstrCustomFilter // add str='%s' " + "associated to '%s'\n", old_pstr, pstr); SendDlgItemMessage16(hWnd, cmb1, CB_SETITEMDATA16, i, (LPARAM)pstr); n += strlen(pstr) + 1; pstr += strlen(pstr) + 1; @@ -503,12 +503,13 @@ static LONG FILEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) pstr = (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFilter); n = 0; while(*pstr) { - dprintf_commdlg(stddeb,"lpstrFilter // add str='%s' ", pstr); + old_pstr = pstr; i = SendDlgItemMessage16(hWnd, cmb1, CB_ADDSTRING16, 0, (LPARAM)lpofn->lpstrFilter + n ); n += strlen(pstr) + 1; pstr += strlen(pstr) + 1; - dprintf_commdlg(stddeb,"associated to '%s'\n", pstr); + dprintf_info(commdlg,"lpstrFilter // add str='%s' " + "associated to '%s'\n", old_pstr, pstr); SendDlgItemMessage16(hWnd, cmb1, CB_SETITEMDATA16, i, (LPARAM)pstr); n += strlen(pstr) + 1; pstr += strlen(pstr) + 1; @@ -521,7 +522,7 @@ static LONG FILEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) strncpy(tmpstr, FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter), PTR_SEG_TO_LIN(lpofn->lpstrFilter), lpofn->nFilterIndex - 1),511); tmpstr[511]=0; - dprintf_commdlg(stddeb,"nFilterIndex = %ld // SetText of edt1 to '%s'\n", + dprintf_info(commdlg,"nFilterIndex = %ld // SetText of edt1 to '%s'\n", lpofn->nFilterIndex, tmpstr); SetDlgItemText32A( hWnd, edt1, tmpstr ); /* get drive list */ @@ -636,7 +637,7 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) if (lRet == LB_ERR) return TRUE; pstr = (LPSTR)SendDlgItemMessage16(hWnd, cmb1, CB_GETITEMDATA16, lRet, 0); - dprintf_commdlg(stddeb,"Selected filter : %s\n", pstr); + dprintf_info(commdlg,"Selected filter : %s\n", pstr); SetDlgItemText32A( hWnd, edt1, pstr ); FILEDLG_ScanDir(hWnd, tmpstr); return TRUE; @@ -664,7 +665,7 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) strcpy(tmpstr2, tmpstr); *tmpstr=0; } - dprintf_commdlg(stddeb,"commdlg: %s, %s\n", tmpstr, tmpstr2); + dprintf_info(commdlg,"commdlg: %s, %s\n", tmpstr, tmpstr2); SetDlgItemText32A( hWnd, edt1, tmpstr2 ); FILEDLG_ScanDir(hWnd, tmpstr); return TRUE; @@ -677,7 +678,7 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) lRet = SendDlgItemMessage16(hWnd, cmb1, CB_GETCURSEL16, 0, 0); if (lRet == LB_ERR) return TRUE; lpofn->nFilterIndex = lRet + 1; - dprintf_commdlg(stddeb,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex); + dprintf_info(commdlg,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex); lstrcpyn32A(tmpstr2, FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter), PTR_SEG_TO_LIN(lpofn->lpstrFilter), @@ -1127,7 +1128,7 @@ BOOL16 WINAPI PrintDlg16( SEGPTR printdlg ) HWND32 hwndDialog; LPPRINTDLG16 lpPrint = (LPPRINTDLG16)PTR_SEG_TO_LIN(printdlg); - dprintf_commdlg(stddeb,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags ); + dprintf_info(commdlg,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags ); if (lpPrint->Flags & PD_RETURNDEFAULT) /* FIXME: should fill lpPrint->hDevMode and lpPrint->hDevNames here */ @@ -1179,7 +1180,7 @@ LRESULT WINAPI PrintDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, switch (wMsg) { case WM_INITDIALOG: - dprintf_commdlg(stddeb,"PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); + dprintf_info(commdlg,"PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); ShowWindow16(hWnd, SW_SHOWNORMAL); return (TRUE); case WM_COMMAND: @@ -1207,7 +1208,7 @@ LRESULT WINAPI PrintSetupDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, switch (wMsg) { case WM_INITDIALOG: - dprintf_commdlg(stddeb,"PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); + dprintf_info(commdlg,"PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); ShowWindow16(hWnd, SW_SHOWNORMAL); return (TRUE); case WM_COMMAND: @@ -1239,7 +1240,7 @@ DWORD WINAPI CommDlgExtendedError(void) short WINAPI GetFileTitle32A(LPCSTR lpFile, LPSTR lpTitle, UINT32 cbBuf) { int i, len; - dprintf_commdlg(stddeb,"GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf); + dprintf_info(commdlg,"GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf); if (lpFile == NULL || lpTitle == NULL) return -1; len = strlen(lpFile); @@ -1256,7 +1257,7 @@ short WINAPI GetFileTitle32A(LPCSTR lpFile, LPSTR lpTitle, UINT32 cbBuf) i++; break; } - dprintf_commdlg(stddeb,"\n---> '%s' ", &lpFile[i]); + dprintf_info(commdlg,"---> '%s' \n", &lpFile[i]); len = strlen(lpFile+i)+1; if (cbBuf < len) @@ -1305,7 +1306,7 @@ BOOL16 WINAPI ChooseColor(LPCHOOSECOLOR lpChCol) LPCVOID template; HWND32 hwndDialog; - dprintf_commdlg(stddeb,"ChooseColor\n"); + dprintf_info(commdlg,"ChooseColor\n"); if (!lpChCol) return FALSE; if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE) @@ -2069,7 +2070,7 @@ static LONG CC_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) POINT16 point; struct CCPRIVATE * lpp; - dprintf_commdlg(stddeb,"ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); + dprintf_info(commdlg,"ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); lpp=calloc(1,sizeof(struct CCPRIVATE)); lpp->lpcc=(LPCHOOSECOLOR)lParam; if (lpp->lpcc->lStructSize != sizeof(CHOOSECOLOR)) @@ -2138,7 +2139,7 @@ static LRESULT CC_WMCommand(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) HDC32 hdc; COLORREF *cr; struct CCPRIVATE * lpp=(struct CCPRIVATE *)GetWindowLong32A(hDlg, DWL_USER); - dprintf_commdlg(stddeb,"CC_WMCommand wParam=%x lParam=%lx\n",wParam,lParam); + dprintf_info(commdlg,"CC_WMCommand wParam=%x lParam=%lx\n",wParam,lParam); switch (wParam) { case 0x2c2: /* edit notify RGB */ @@ -2400,7 +2401,7 @@ BOOL16 WINAPI ChooseFont(LPCHOOSEFONT lpChFont) LPCVOID template; HWND32 hwndDialog; - dprintf_commdlg(stddeb,"ChooseFont\n"); + dprintf_info(commdlg,"ChooseFont\n"); if (!lpChFont) return FALSE; if (lpChFont->Flags & CF_ENABLETEMPLATEHANDLE) @@ -2482,7 +2483,7 @@ INT16 WINAPI FontFamilyEnumProc( SEGPTR logfont, SEGPTR metrics, LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER); LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN( logfont ); - dprintf_commdlg(stddeb,"FontFamilyEnumProc: font=%s (nFontType=%d)\n", + dprintf_info(commdlg,"FontFamilyEnumProc: font=%s (nFontType=%d)\n", lplf->lfFaceName,nFontType); if (lpcf->Flags & CF_FIXEDPITCHONLY) @@ -2601,8 +2602,8 @@ INT16 WINAPI FontStyleEnumProc( SEGPTR logfont, SEGPTR metrics, TEXTMETRIC16 *lptm = (TEXTMETRIC16 *)PTR_SEG_TO_LIN(metrics); int i; - dprintf_commdlg(stddeb,"FontStyleEnumProc: (nFontType=%d)\n",nFontType); - dprintf_commdlg(stddeb," %s h=%d w=%d e=%d o=%d wg=%d i=%d u=%d s=%d ch=%d op=%d cp=%d q=%d pf=%xh\n", + dprintf_info(commdlg,"FontStyleEnumProc: (nFontType=%d)\n",nFontType); + dprintf_info(commdlg," %s h=%d w=%d e=%d o=%d wg=%d i=%d u=%d s=%d ch=%d op=%d cp=%d q=%d pf=%xh\n", lplf->lfFaceName,lplf->lfHeight,lplf->lfWidth,lplf->lfEscapement,lplf->lfOrientation, lplf->lfWeight,lplf->lfItalic,lplf->lfUnderline,lplf->lfStrikeOut,lplf->lfCharSet, lplf->lfOutPrecision,lplf->lfClipPrecision,lplf->lfQuality,lplf->lfPitchAndFamily); @@ -2638,11 +2639,11 @@ LRESULT CFn_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) SetWindowLong32A(hDlg, DWL_USER, lParam); lpcf=(LPCHOOSEFONT)lParam; lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont); - dprintf_commdlg(stddeb,"FormatCharDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); + dprintf_info(commdlg,"FormatCharDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam); if (lpcf->lStructSize != sizeof(CHOOSEFONT)) { - dprintf_commdlg(stddeb,"WM_INITDIALOG: structure size failure !!!\n"); + dprintf_err(commdlg,"WM_INITDIALOG: structure size failure !!!\n"); EndDialog32 (hDlg, 0); return FALSE; } @@ -2681,7 +2682,7 @@ LRESULT CFn_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) { if (!EnumFontFamilies16(hdc, NULL,FontFamilyEnumProc, (LPARAM)GetDlgItem32(hDlg,cmb1))) - dprintf_commdlg(stddeb,"WM_INITDIALOG: EnumFontFamilies returns 0\n"); + dprintf_info(commdlg,"WM_INITDIALOG: EnumFontFamilies returns 0\n"); if (lpcf->Flags & CF_INITTOLOGFONTSTRUCT) { /* look for fitting font name in combobox1 */ @@ -2728,7 +2729,7 @@ LRESULT CFn_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) } else { - dprintf_commdlg(stddeb,"WM_INITDIALOG: HDC failure !!!\n"); + dprintf_warn(commdlg,"WM_INITDIALOG: HDC failure !!!\n"); EndDialog32 (hDlg, 0); return FALSE; } @@ -2793,7 +2794,7 @@ LRESULT CFn_WMDrawItem(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) buffer = SEGPTR_ALLOC(40); switch (lpdi->CtlID) { - case cmb1: /* dprintf_commdlg(stddeb,"WM_Drawitem cmb1\n"); */ + case cmb1: /* dprintf_info(commdlg,"WM_Drawitem cmb1\n"); */ SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID, (LPARAM)SEGPTR_GET(buffer)); GetObject16( hBitmapTT, sizeof(bm), &bm ); @@ -2814,14 +2815,14 @@ LRESULT CFn_WMDrawItem(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) #endif break; case cmb2: - case cmb3: /* dprintf_commdlg(stddeb,"WM_DRAWITEN cmb2,cmb3\n"); */ + case cmb3: /* dprintf_info(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */ SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID, (LPARAM)SEGPTR_GET(buffer)); TextOut16(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, buffer, lstrlen16(buffer)); break; - case cmb4: /* dprintf_commdlg(stddeb,"WM_DRAWITEM cmb4 (=COLOR)\n"); */ + case cmb4: /* dprintf_info(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */ SendMessage16(lpdi->hwndItem, CB_GETLBTEXT16, lpdi->itemID, (LPARAM)SEGPTR_GET(buffer)); TextOut16(lpdi->hDC, lpdi->rcItem.left + 25+5, @@ -2880,7 +2881,7 @@ LRESULT CFn_WMCommand(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER); LPLOGFONT16 lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont); - dprintf_commdlg(stddeb,"FormatCharDlgProc // WM_COMMAND lParam=%08lX\n", lParam); + dprintf_info(commdlg,"FormatCharDlgProc // WM_COMMAND lParam=%08lX\n", lParam); switch (wParam) { case cmb1:if (HIWORD(lParam)==CBN_SELCHANGE) @@ -2897,7 +2898,7 @@ LRESULT CFn_WMCommand(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) char *str = SEGPTR_ALLOC(256); SendDlgItemMessage16(hDlg,cmb1,CB_GETLBTEXT16,i, (LPARAM)SEGPTR_GET(str)); - dprintf_commdlg(stddeb,"WM_COMMAND/cmb1 =>%s\n",str); + dprintf_info(commdlg,"WM_COMMAND/cmb1 =>%s\n",str); EnumFontFamilies16(hdc,str,FontStyleEnumProc, MAKELONG(GetDlgItem32(hDlg,cmb2),GetDlgItem32(hDlg,cmb3))); SetCursor16(hcursor); @@ -2908,7 +2909,7 @@ LRESULT CFn_WMCommand(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) } else { - dprintf_commdlg(stddeb,"WM_COMMAND: HDC failure !!!\n"); + dprintf_warn(commdlg,"WM_COMMAND: HDC failure !!!\n"); EndDialog32 (hDlg, 0); return TRUE; } @@ -2919,7 +2920,7 @@ LRESULT CFn_WMCommand(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam) case cmb3:if (HIWORD(lParam)==CBN_SELCHANGE || HIWORD(lParam)== BN_CLICKED ) { char *str = SEGPTR_ALLOC(256); - dprintf_commdlg(stddeb,"WM_COMMAND/cmb2,3 =%08lX\n", lParam); + dprintf_info(commdlg,"WM_COMMAND/cmb2,3 =%08lX\n", lParam); i=SendDlgItemMessage16(hDlg,cmb1,CB_GETCURSEL16,0,0); if (i==CB_ERR) i=GetDlgItemText32A( hDlg, cmb1, str, 256 ); @@ -3035,7 +3036,7 @@ LRESULT WINAPI FormatCharDlgProc(HWND16 hDlg, UINT16 message, WPARAM16 wParam, case WM_COMMAND: return CFn_WMCommand(hDlg,wParam,lParam); case WM_CHOOSEFONT_GETLOGFONT: - dprintf_commdlg(stddeb, + dprintf_info(commdlg, "FormatCharDlgProc // WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam); /* FIXME: current logfont back to caller */ break; diff --git a/misc/cpu.c b/misc/cpu.c index 9265986dd0f..65e9ac4e1a8 100644 --- a/misc/cpu.c +++ b/misc/cpu.c @@ -10,6 +10,7 @@ #include #include "windows.h" #include "winnt.h" +#include "winreg.h" static BYTE PF[64] = {0,}; @@ -20,6 +21,8 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) { static int cache = 0; static SYSTEM_INFO cachedsi; + HKEY xhkey=0,hkey; + char buf[20]; if (cache) { memcpy(si,&cachedsi,sizeof(*si)); @@ -55,6 +58,8 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) if (!f) return; + xhkey = 0; + RegCreateKey16(HKEY_LOCAL_MACHINE,"\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey); while (fgets(line,200,f)!=NULL) { char *s,*value; @@ -88,6 +93,10 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) break; } } + /* set the CPU type of the current processor */ + sprintf(buf,"CPU %ld",cachedsi.dwProcessorType); + if (xhkey) + RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf)); continue; } /* old 2.0 method */ @@ -112,6 +121,10 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) break; } } + /* set the CPU type of the current processor */ + sprintf(buf,"CPU %ld",cachedsi.dwProcessorType); + if (xhkey) + RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,buf,strlen(buf)); continue; } if (!lstrncmpi32A(line,"fdiv_bug",strlen("fdiv_bug"))) { @@ -133,6 +146,12 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) if (sscanf(value,"%d",&x)) if (x+1>cachedsi.dwNumberOfProcessors) cachedsi.dwNumberOfProcessors=x+1; + + /* create a new processor subkey */ + sprintf(buf,"%d",x); + if (xhkey) + RegCloseKey(xhkey); + RegCreateKey16(hkey,buf,&xhkey); } if (!lstrncmpi32A(line,"stepping",strlen("stepping"))) { int x; @@ -151,11 +170,15 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) fclose (f); } memcpy(si,&cachedsi,sizeof(*si)); - return; #else /* linux */ /* FIXME: how do we do this on other systems? */ - return; -#endif /* linux */ + + RegCreateKey16(hkey,"0",&xhkey); + RegSetValueEx32A(xhkey,"Identifier",0,REG_SZ,"CPU 386",strlen("CPU 386")); +#endif /* !linux */ + if (xhkey) + RegCloseKey(xhkey); + RegCloseKey(hkey); } /*********************************************************************** diff --git a/misc/crtdll.c b/misc/crtdll.c index dac9b30a6f5..7ca8fb9f770 100644 --- a/misc/crtdll.c +++ b/misc/crtdll.c @@ -34,7 +34,6 @@ Unresolved issues Uwe Bonnes 970904: #include #include "win.h" #include "windows.h" -#include "stddebug.h" #include "debug.h" #include "module.h" #include "heap.h" @@ -83,12 +82,12 @@ DWORD __cdecl CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv, int xargc,i,afterlastspace; DWORD version; - dprintf_crtdll(stddeb,"CRTDLL__GetMainArgs(%p,%p,%p,%ld).\n", + dprintf_info(crtdll,"CRTDLL__GetMainArgs(%p,%p,%p,%ld).\n", argc,argv,environ,flag ); CRTDLL_acmdln_dll = cmdline = HEAP_strdupA( GetProcessHeap(), 0, GetCommandLine32A() ); - dprintf_crtdll(stddeb,"CRTDLL__GetMainArgs got \"%s\"\n", + dprintf_info(crtdll,"CRTDLL__GetMainArgs got \"%s\"\n", cmdline); version = GetVersion32(); @@ -131,7 +130,7 @@ DWORD __cdecl CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv, CRTDLL_argv_dll = xargv; *argv = xargv; - dprintf_crtdll(stddeb,"CRTDLL__GetMainArgs found %d arguments\n", + dprintf_info(crtdll,"CRTDLL__GetMainArgs found %d arguments\n", CRTDLL_argc_dll); CRTDLL_environ_dll = *environ = GetEnvironmentStrings32A(); return 0; @@ -147,7 +146,7 @@ DWORD __cdecl CRTDLL__initterm(_INITTERMFUN *start,_INITTERMFUN *end) { _INITTERMFUN *current; - dprintf_crtdll(stddeb,"_initterm(%p,%p)\n",start,end); + dprintf_info(crtdll,"_initterm(%p,%p)\n",start,end); current=start; while (current> shift)|( x >>((sizeof(x))-shift)); - dprintf_crtdll(stddeb, + dprintf_info(crtdll, "CRTDLL_rotl got 0x%08x rot %d ret 0x%08x\n", x,shift,ret); return ret; @@ -638,7 +651,7 @@ DWORD __cdecl CRTDLL__lrotl(DWORD x,INT32 shift) { unsigned long ret = (x >> shift)|( x >>((sizeof(x))-shift)); - dprintf_crtdll(stddeb, + dprintf_info(crtdll, "CRTDLL_lrotl got 0x%08lx rot %d ret 0x%08lx\n", x,shift,ret); return ret; @@ -663,9 +676,12 @@ CHAR* __cdecl CRTDLL_fgets(LPSTR s,INT32 size, LPVOID stream) *control_M='\n'; *(control_M+1)=0; } - dprintf_crtdll(stddeb, - "CRTDLL_fgets got %s for %d chars from file %p%s\n", - s,size,stream,(ret)?"":" failed"); + dprintf_info(crtdll, + "CRTDLL_fgets got %s for %d chars from file %p\n", + s,size,stream); + if(ret) + dprintf_warn(crtdll, " Failed!\n"); + return ret; } @@ -720,7 +736,7 @@ INT32 __cdecl CRTDLL_vswprintf( LPWSTR buffer, LPCWSTR spec, va_list args ) */ unsigned char* __cdecl CRTDLL__mbscpy(unsigned char *x,unsigned char *y) { - dprintf_crtdll(stddeb,"CRTDLL_mbscpy %s and %s\n",x,y); + dprintf_info(crtdll,"CRTDLL_mbscpy %s and %s\n",x,y); return strcpy(x,y); } @@ -761,14 +777,13 @@ LPSTR CRTDLL__strlwr(LPSTR x) { unsigned char *y =x; - dprintf_crtdll(stddeb, - "CRTDLL_strlwr got %s",x); + dprintf_info(crtdll, "CRTDLL_strlwr got %s\n", x); while (*y) { if ((*y > 0x40) && (*y< 0x5b)) *y = *y + 0x20; y++; } - dprintf_crtdll(stddeb," returned %s\n",x); + dprintf_info(crtdll, " returned %s\n", x); return x; } @@ -795,7 +810,7 @@ INT32 CRTDLL_system(LPSTR x) } /* If buffer too short, exit. */ if (i > SYSBUF_LENGTH) { - dprintf_crtdll(stddeb,"_system buffer to small\n"); + dprintf_info(crtdll,"_system buffer to small\n"); return 127; } @@ -812,7 +827,7 @@ INT32 CRTDLL_system(LPSTR x) } *bp++ = '"'; *bp = 0; - dprintf_crtdll(stddeb, + dprintf_info(crtdll, "_system got \"%s\", executing \"%s\"\n",x,buffer); return system(buffer); @@ -866,8 +881,7 @@ LPWSTR __cdecl CRTDLL__wcslwr(LPWSTR x) */ VOID __cdecl CRTDLL_longjmp(jmp_buf env, int val) { - dprintf_crtdll(stdnimp,"CRTDLL_longjmp semistup, expect crash\n"); - dprintf_crtdll(stddeb, "CRTDLL_longjmp semistup, expect crash\n"); + dprintf_fixme(crtdll,"CRTDLL_longjmp semistup, expect crash\n"); return longjmp(env, val); } @@ -956,8 +970,12 @@ INT32 __cdecl CRTDLL_fclose( FILE *stream ) fclose(stream); ret = _lclose32( dos_handle); } - dprintf_crtdll(stddeb,"CRTDLL_fclose(%p) ufh %d dfh %d%s\n", - stream,unix_handle,dos_handle,(ret)?" failed":""); + dprintf_info(crtdll,"CRTDLL_fclose(%p) ufh %d dfh %d\n", + stream,unix_handle,dos_handle); + + if(ret) + dprintf_warn(crtdll, " Failed!\n"); + return ret; } @@ -970,13 +988,16 @@ INT32 __cdecl CRTDLL__unlink(LPCSTR pathname) DOS_FULL_NAME full_name; if (!DOSFS_GetFullName( pathname, FALSE, &full_name )) { - dprintf_crtdll(stddeb,"CRTDLL_unlink file %s bad name\n",pathname); + dprintf_warn(crtdll, "CRTDLL_unlink file %s bad name\n",pathname); return EOF; } ret=unlink(full_name.long_name); - dprintf_crtdll(stddeb,"CRTDLL_unlink(%s unix %s)%s\n", - pathname,full_name.long_name, (ret)?" failed":""); + dprintf_info(crtdll,"CRTDLL_unlink(%s unix %s)\n", + pathname,full_name.long_name); + if(ret) + dprintf_warn(crtdll, " Failed!\n"); + return ret; } @@ -1017,12 +1038,13 @@ int __cdecl CRTDLL__stat(const char * filename, struct win_stat * buf) if (!DOSFS_GetFullName( filename, TRUE, &full_name )) { - dprintf_crtdll(stddeb,"CRTDLL__stat filename %s bad name\n",filename); + dprintf_warn(crtdll, "CRTDLL__stat filename %s bad name\n",filename); return -1; } ret=stat(full_name.long_name,&mystat); - dprintf_crtdll(stddeb,"CRTDLL__stat %s%s\n", - filename, (ret)?" failed":""); + dprintf_info(crtdll,"CRTDLL__stat %s\n", filename); + if(ret) + dprintf_warn(crtdll, " Failed!\n"); /* FIXME: should check what Windows returns */ @@ -1061,11 +1083,11 @@ HFILE32 __cdecl CRTDLL__open(LPCSTR path,INT32 flags) if (flags & 0x0200 ) wineflags |= O_TRUNC; if (flags & 0x0400 ) wineflags |= O_EXCL; if (flags & 0xf0f4 ) - dprintf_crtdll(stddeb,"CRTDLL_open file unsupported flags 0x%04x\n",flags); + dprintf_info(crtdll,"CRTDLL_open file unsupported flags 0x%04x\n",flags); /* End Fixme */ ret = FILE_Open(path,wineflags); - dprintf_crtdll(stddeb,"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d\n", + dprintf_info(crtdll,"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d\n", path,wineflags,flags,ret); return ret; } @@ -1077,7 +1099,10 @@ INT32 __cdecl CRTDLL__close(HFILE32 fd) { int ret=_lclose32(fd); - dprintf_crtdll(stddeb,"CRTDLL_close(%d)%s\n",fd,(ret)?" failed":""); + dprintf_info(crtdll,"CRTDLL_close(%d)\n",fd); + if(ret) + dprintf_warn(crtdll, " Failed!\n"); + return ret; } @@ -1089,7 +1114,7 @@ INT32 __cdecl CRTDLL_feof( FILE *stream ) int ret; ret=feof(stream); - dprintf_crtdll(stddeb,"CRTDLL_feof(%p) %s\n",stream,(ret)?"true":"false"); + dprintf_info(crtdll,"CRTDLL_feof(%p) %s\n",stream,(ret)?"true":"false"); return ret; } @@ -1335,10 +1360,9 @@ INT32 __cdecl CRTDLL__setmode( INT32 fh,INT32 mode) #define O_TEXT 0x4000 #define O_BINARY 0x8000 - dprintf_crtdll(stddeb, - "CRTDLL._setmode on fhandle %d mode %s, STUB.\n", - fh,(mode=O_TEXT)?"O_TEXT": - (mode=O_BINARY)?"O_BINARY":"UNKNOWN"); + dprintf_fixme(crtdll, "CRTDLL._setmode on fhandle %d mode %s, STUB.\n", + fh,(mode=O_TEXT)?"O_TEXT": + (mode=O_BINARY)?"O_BINARY":"UNKNOWN"); return -1; } @@ -1368,7 +1392,7 @@ WCHAR __cdecl CRTDLL_mblen(CHAR *mb,INT32 size) else if (!(*mb)) ret =0; - dprintf_crtdll(stderr,"CRTDLL_mlen %s for max %d bytes ret %d\n",mb,size,ret); + dprintf_info(crtdll,"CRTDLL_mlen %s for max %d bytes ret %d\n",mb,size,ret); return ret; } @@ -1395,7 +1419,7 @@ INT32 __cdecl CRTDLL_mbstowcs(LPWSTR wcs, LPCSTR mbs, INT32 size) p++; ret = (p -wcs); - dprintf_crtdll(stddeb,"CRTDLL_mbstowcs %s for %d chars put %d wchars\n", + dprintf_info(crtdll,"CRTDLL_mbstowcs %s for %d chars put %d wchars\n", mbs,size,ret); return ret; } @@ -1423,7 +1447,7 @@ WCHAR __cdecl CRTDLL_mbtowc(WCHAR* wc,CHAR* mb,INT32 size) else ret = -1; - dprintf_crtdll(stderr,"CRTDLL_mbtowc %s for %d chars\n",mb,size); + dprintf_info(crtdll,"CRTDLL_mbtowc %s for %d chars\n",mb,size); return ret; } @@ -1484,7 +1508,7 @@ LPSTR __cdecl CRTDLL__fullpath(LPSTR buf, LPCSTR name, INT32 size) } if (!DOSFS_GetFullName( name, FALSE, &full_name )) return NULL; lstrcpyn32A(buf,full_name.short_name,size); - dprintf_crtdll(stderr,"CRTDLL_fullpath got %s\n",buf); + dprintf_info(crtdll,"CRTDLL_fullpath got %s\n",buf); return buf; } @@ -1500,7 +1524,7 @@ VOID __cdecl CRTDLL__splitpath(LPCSTR path, LPSTR drive, LPSTR directory, LPSTR */ char * drivechar,*dirchar,*namechar; - dprintf_crtdll(stddeb,"CRTDLL__splitpath got %s\n",path); + dprintf_info(crtdll,"CRTDLL__splitpath got %s\n",path); drivechar = strchr(path,':'); dirchar = strrchr(path,'/'); @@ -1544,7 +1568,7 @@ VOID __cdecl CRTDLL__splitpath(LPCSTR path, LPSTR drive, LPSTR directory, LPSTR } } - dprintf_crtdll(stddeb,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension); + dprintf_info(crtdll,"CRTDLL__splitpath found %s %s %s %s\n",drive,directory,filename,extension); } @@ -1574,7 +1598,7 @@ CHAR* __cdecl CRTDLL__getcwd(LPSTR buf, INT32 size) if (len > size) { /* set error to ERANGE */ - dprintf_crtdll(stddeb,"CRTDLL_getcwd buffer to small\n"); + dprintf_info(crtdll,"CRTDLL_getcwd buffer to small\n"); return NULL; } return buf; @@ -1616,29 +1640,28 @@ LPSTR __cdecl CRTDLL__tempnam(LPCSTR dir, LPCSTR prefix) DOS_FULL_NAME tempname; if ((ret = tempnam(dir,prefix))==NULL) { - dprintf_crtdll(stddeb, - "CRTDLL_tempnam Unable to get unique filename\n"); + dprintf_warn(crtdll, "Unable to get unique filename\n"); return NULL; } if (!DOSFS_GetFullName(ret,FALSE,&tempname)) { - dprintf_crtdll(stddeb, + dprintf_info(crtdll, "CRTDLL_tempnam Wrong path?\n"); return NULL; } free(ret); if ((ret = CRTDLL_malloc(strlen(tempname.short_name)+1)) == NULL) { - dprintf_crtdll(stddeb, + dprintf_warn(crtdll, "CRTDLL_tempnam CRTDL_malloc for shortname failed\n"); return NULL; } if ((ret = strcpy(ret,tempname.short_name)) == NULL) { - dprintf_crtdll(stddeb, + dprintf_warn(crtdll, "CRTDLL_tempnam Malloc for shortname failed\n"); return NULL; } - dprintf_crtdll(stddeb,"CRTDLL_tempnam dir %s prefix %s got %s\n", + dprintf_info(crtdll,"CRTDLL_tempnam dir %s prefix %s got %s\n", dir,prefix,ret); return ret; @@ -1654,20 +1677,19 @@ LPSTR __cdecl CRTDLL_tmpnam(LPSTR s) char *ret; if ((ret =tmpnam(s))== NULL) { - dprintf_crtdll(stddeb, - "CRTDLL_tmpnam Unable to get unique filename\n"); + dprintf_warn(crtdll, "Unable to get unique filename\n"); return NULL; } if (!DOSFS_GetFullName(ret,FALSE,&CRTDLL_tmpname)) { - dprintf_crtdll(stddeb, + dprintf_info(crtdll, "CRTDLL_tmpnam Wrong path?\n"); return NULL; } strcat(CRTDLL_tmpname.short_name,"."); - dprintf_crtdll(stddeb,"CRTDLL_tmpnam for buf %p got %s\n", + dprintf_info(crtdll,"CRTDLL_tmpnam for buf %p got %s\n", s,CRTDLL_tmpname.short_name); - dprintf_crtdll(stddeb,"CRTDLL_tmpnam long got %s\n", + dprintf_info(crtdll,"CRTDLL_tmpnam long got %s\n", CRTDLL_tmpname.long_name); if ( s != NULL) return strcpy(s,CRTDLL_tmpname.short_name); @@ -1692,7 +1714,7 @@ typedef VOID (*sig_handler_type)(VOID); */ VOID __cdecl CRTDLL_signal(int sig, sig_handler_type ptr) { - dprintf_crtdll(stddeb,"CRTDLL_signal %d %p: STUB!\n",sig,ptr); + dprintf_fixme(crtdll, "CRTDLL_signal %d %p: STUB!\n", sig, ptr); } /********************************************************************* @@ -1706,6 +1728,6 @@ LONG __cdecl CRTDLL__ftol(double fl) { */ VOID __cdecl CRTDLL__sleep(unsigned long timeout) { - dprintf_crtdll(stddeb,"CRTDLL__sleep for %ld milliseconds\n",timeout); + dprintf_info(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout); Sleep((timeout)?timeout:1); } diff --git a/misc/ddeml.c b/misc/ddeml.c index b430475dcfe..4367c5331e3 100644 --- a/misc/ddeml.c +++ b/misc/ddeml.c @@ -9,7 +9,6 @@ #include #include "ddeml.h" -#include "stddebug.h" #include "debug.h" diff --git a/misc/debugstr.c b/misc/debugstr.c index 2ef4649b0d5..e720a33ae63 100644 --- a/misc/debugstr.c +++ b/misc/debugstr.c @@ -1,6 +1,7 @@ #include "debugstr.h" #include "xmalloc.h" #include +#include /* ---------------------------------------------------------------------- */ @@ -125,3 +126,18 @@ debugstr_w (LPCWSTR s) } /* ---------------------------------------------------------------------- */ +/* This routine returns a nicely formated name of the resource res + If the resource name is a string, it will return '' + If it is a number, it will return #<4-digit-hex-number> */ +LPSTR +debugres (const void *res) +{ + if (HIWORD((DWORD)res)) + return debugstr_a((LPCSTR)res); + else{ + char resname[10]; + sprintf(resname, "#%04x", LOWORD(res)); + return debugstr_a (resname); + } +} + diff --git a/misc/error.c b/misc/error.c index fc2e12483c8..3a36237d8a8 100644 --- a/misc/error.c +++ b/misc/error.c @@ -9,14 +9,11 @@ #include #include "windows.h" -#include "stddebug.h" #include "debug.h" -#ifdef DEBUG_RUNTIME - #define ErrorString(manifest) { manifest, # manifest } -const struct { +static const struct { int constant; const char *name; } ErrorStrings[] = { @@ -47,9 +44,7 @@ const struct { ErrorString(ERR_SELBITMAP) }; -#define ErrorStringCount (sizeof(ErrorStrings) / sizeof(ErrorStrings[0])) - -const struct { +static const struct { int constant; const char *name; } ParamErrorStrings[] = { @@ -90,27 +85,25 @@ const struct { ErrorString(ERR_BAD_HMETAFILE) }; +#undef ErrorString +#define ErrorStringCount (sizeof(ErrorStrings) / sizeof(ErrorStrings[0])) #define ParamErrorStringCount (sizeof(ParamErrorStrings) / sizeof(ParamErrorStrings[0])) -#endif /* DEBUG_RUNTIME */ - /*********************************************************************** * GetErrorString (internal) */ -static const char *GetErrorString(UINT16 uErr) { - static char buffer[80]; +static const char *GetErrorString(UINT16 uErr) +{ + static char buffer[80]; + int i; -#ifdef DEBUG_RUNTIME - int i; + for (i = 0; i < ErrorStringCount; i++) { + if (uErr == ErrorStrings[i].constant) + return ErrorStrings[i].name; + } - for (i = 0; i < ErrorStringCount; i++) { - if (uErr == ErrorStrings[i].constant) - return ErrorStrings[i].name; - } -#endif - - sprintf(buffer, "%x", uErr); - return buffer; + sprintf(buffer, "%x", uErr); + return buffer; } @@ -126,7 +119,6 @@ static const char *GetParamErrorString(UINT16 uErr) { } else buffer[0] = '\0'; -#ifdef DEBUG_RUNTIME { int i; @@ -137,7 +129,6 @@ static const char *GetParamErrorString(UINT16 uErr) { } } } -#endif sprintf(buffer + strlen(buffer), "%x", uErr); return buffer; diff --git a/misc/lstr.c b/misc/lstr.c index 1e5452727a2..252d081e39a 100644 --- a/misc/lstr.c +++ b/misc/lstr.c @@ -31,7 +31,6 @@ #include "ldt.h" #include "stackframe.h" #include "module.h" -#include "stddebug.h" #include "debug.h" /* Funny to divide them between user and kernel. */ @@ -518,7 +517,7 @@ DWORD WINAPI FormatMessage32A( DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK; DWORD nolinefeed = 0; - dprintf_resource(stddeb, + dprintf_info(resource, "FormatMessage32A(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n", dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args ); @@ -535,10 +534,10 @@ DWORD WINAPI FormatMessage32A( INT32 bufsize; dwMessageId &= 0xFFFF; - bufsize=LoadMessage32A(0,dwMessageId,dwLanguageId,NULL,100); + bufsize=LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,NULL,100); if (bufsize) { from = HeapAlloc( GetProcessHeap(), 0, bufsize + 1 ); - LoadMessage32A(0,dwMessageId,dwLanguageId,from,bufsize+1); + LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,from,bufsize+1); } } target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100); @@ -684,7 +683,7 @@ DWORD WINAPI FormatMessage32W( DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK; DWORD nolinefeed = 0; - dprintf_resource(stddeb, + dprintf_info(resource, "FormatMessage32A(0x%lx,%p,%ld,0x%lx,%p,%ld,%p)\n", dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args ); @@ -702,11 +701,11 @@ DWORD WINAPI FormatMessage32W( INT32 bufsize; dwMessageId &= 0xFFFF; - bufsize=LoadMessage32A(0,dwMessageId,dwLanguageId,NULL,100); + bufsize=LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,NULL,100); if (bufsize) { from = HeapAlloc( GetProcessHeap(), 0, bufsize + 1 ); - LoadMessage32A(0,dwMessageId,dwLanguageId,from,bufsize+1); + LoadMessage32A((HMODULE32)lpSource,dwMessageId,dwLanguageId,from,bufsize+1); } } target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100 ); diff --git a/misc/lzexpand.c b/misc/lzexpand.c index 90c23231530..f9defebe473 100644 --- a/misc/lzexpand.c +++ b/misc/lzexpand.c @@ -19,7 +19,6 @@ #include "heap.h" #include "ldt.h" #include "lzexpand.h" -#include "stddebug.h" #include "debug.h" @@ -119,7 +118,7 @@ static INT32 read_header(HFILE32 fd,struct lzfileheader *head) */ INT16 WINAPI LZStart16(void) { - dprintf_file(stddeb,"LZStart16(void)\n"); + dprintf_info(file,"LZStart16(void)\n"); return 1; } @@ -129,7 +128,7 @@ INT16 WINAPI LZStart16(void) */ INT32 WINAPI LZStart32(void) { - dprintf_file(stddeb,"LZStart32(void)\n"); + dprintf_info(file,"LZStart32(void)\n"); return 1; } @@ -162,7 +161,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc ) struct lzstate *lzs; DWORD ret; - dprintf_file(stddeb,"LZInit(%d)\n",hfSrc); + dprintf_info(file,"LZInit(%d)\n",hfSrc); ret=read_header(hfSrc,&head); if (ret<=0) { _llseek32(hfSrc,0,SEEK_SET); @@ -195,7 +194,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc ) */ void WINAPI LZDone(void) { - dprintf_file(stddeb,"LZDone()\n"); + dprintf_info(file,"LZDone()\n"); } @@ -227,7 +226,7 @@ INT32 WINAPI GetExpandedName32A( LPCSTR in, LPSTR out ) INT32 fnislowercased,ret,len; LPSTR s,t; - dprintf_file(stddeb,"GetExpandedName(%s)\n",in); + dprintf_info(file,"GetExpandedName(%s)\n",in); fd=OpenFile32(in,&ofs,OF_READ); if (fd==HFILE_ERROR32) return (INT32)(INT16)LZERROR_BADINHANDLE; @@ -323,7 +322,7 @@ INT32 WINAPI LZRead32( HFILE32 fd, LPVOID vbuf, UINT32 toread ) struct lzstate *lzs; buf=(LPBYTE)vbuf; - dprintf_file(stddeb,"LZRead32(%d,%p,%d)\n",fd,buf,toread); + dprintf_info(file,"LZRead32(%d,%p,%d)\n",fd,buf,toread); howmuch=toread; for (i=0;i #include "win.h" -#include "stddebug.h" #include "debug.h" DWORD WINAPI WNetGetCachedPassword( diff --git a/misc/ntdll.c b/misc/ntdll.c index 933ae14dbba..f48f3705134 100644 --- a/misc/ntdll.c +++ b/misc/ntdll.c @@ -14,7 +14,6 @@ #include "windows.h" #include "ntdll.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" #include "module.h" #include "heap.h" diff --git a/misc/registry.c b/misc/registry.c index 1343fb4a8a7..3e47851760c 100644 --- a/misc/registry.c +++ b/misc/registry.c @@ -25,7 +25,6 @@ #include "winerror.h" #include "file.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" #include "winreg.h" @@ -118,10 +117,10 @@ add_handle(HKEY hkey,LPKEYSTRUCT lpkey,REGSAM accessmask) { for (i=0;inextsub); lpxkey = *lplpkey; while (lpxkey) { @@ -833,7 +806,7 @@ _wine_loadsubreg(FILE *F,LPKEYSTRUCT lpkey,int optflag) { return 0; } if (ver!=REGISTRY_SAVE_VERSION) { - dprintf_reg(stddeb,__FILE__":_wine_loadsubreg:Old format (%d) registry found, ignoring it. (buf was %s).\n",ver,buf); + dprintf_info(reg,__FILE__":_wine_loadsubreg:Old format (%d) registry found, ignoring it. (buf was %s).\n",ver,buf); free(buf); return 0; } @@ -855,8 +828,8 @@ _wine_loadreg(LPKEYSTRUCT lpkey,char *fn,int optflag) { F=fopen(fn,"rb"); if (F==NULL) { - dprintf_reg(stddeb,__FILE__":Couldn't open %s for reading: %s\n", - fn,strerror(errno) + dprintf_warn(reg,"Couldn't open %s for reading: %s\n", + fn,strerror(errno) ); return; } @@ -885,7 +858,7 @@ _copy_registry(LPKEYSTRUCT from,LPKEYSTRUCT to) { valfrom = from->values+j; name=valfrom->name; if (name) name=strdupW(name); - data=(LPBYTE)malloc(valfrom->len); + data=(LPBYTE)xmalloc(valfrom->len); memcpy(data,valfrom->data,valfrom->len); _find_or_add_value( @@ -1033,7 +1006,7 @@ static LPKEYSTRUCT _w95_processKey ( LPKEYSTRUCT lpkey, { /* Disk Key Header structure (RGDB part) */ - struct dkh { + struct dkh { unsigned long nextkeyoff; unsigned short nrLS; unsigned short nrMS; @@ -1098,6 +1071,7 @@ static LPKEYSTRUCT _w95_processKey ( LPKEYSTRUCT lpkey, return (NULL); } + assert((dkh.keynamelen<2) || curdata[0]); lpxkey=_find_or_add_key(lpkey,strcvtA2W(curdata, dkh.keynamelen)); curdata += dkh.keynamelen; @@ -1194,7 +1168,7 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) { OFSTRUCT ofs; BY_HANDLE_FILE_INFORMATION hfdinfo; - dprintf_reg(stddeb,"Loading Win95 registry database '%s'\n",fn); + dprintf_info(reg,"Loading Win95 registry database '%s'\n",fn); hfd=OpenFile32(fn,&ofs,OF_READ); if (hfd==HFILE_ERROR32) return; @@ -1214,7 +1188,7 @@ _w95_loadreg(char* fn,LPKEYSTRUCT lpkey) { if (4!=_lread32(hfd,magic,4)) return; if (strcmp(magic,"RGKN")) { - dprintf_reg(stddeb,"second IFF header not RGKN, but %s\n",magic); + dprintf_warn(reg, "second IFF header not RGKN, but %s\n", magic); return; } @@ -1379,7 +1353,7 @@ __w31_dumptree( unsigned short idx, } } } else { - dprintf_reg(stddeb,"__w31_dumptree:strange: no directory key name, idx=%04x\n", idx); + dprintf_info(reg,"__w31_dumptree:strange: no directory key name, idx=%04x\n", idx); } __w31_dumptree(dir->child_idx,txt,tab,head,xlpkey,lastmodified,level+1); idx=dir->sibling_idx; @@ -1405,12 +1379,12 @@ _w31_loadreg() { /* read & dump header */ if (sizeof(head)!=_lread32(hf,&head,sizeof(head))) { - dprintf_reg(stddeb,"_w31_loadreg:reg.dat is too short.\n"); + dprintf_err(reg, "_w31_loadreg:reg.dat is too short.\n"); _lclose32(hf); return; } if (memcmp(head.cookie, "SHCC3.10", sizeof(head.cookie))!=0) { - dprintf_reg(stddeb,"_w31_loadreg:reg.dat has bad signature.\n"); + dprintf_err(reg, "_w31_loadreg:reg.dat has bad signature.\n"); _lclose32(hf); return; } @@ -1419,7 +1393,7 @@ _w31_loadreg() { /* read and dump index table */ tab = xmalloc(len); if (len!=_lread32(hf,tab,len)) { - dprintf_reg(stderr,"_w31_loadreg:couldn't read %d bytes.\n",len); + dprintf_err(reg,"_w31_loadreg:couldn't read %d bytes.\n",len); free(tab); _lclose32(hf); return; @@ -1428,14 +1402,14 @@ _w31_loadreg() { /* read text */ txt = xmalloc(head.textsize); if (-1==_llseek32(hf,head.textoff,SEEK_SET)) { - dprintf_reg(stderr,"_w31_loadreg:couldn't seek to textblock.\n"); + dprintf_err(reg,"_w31_loadreg:couldn't seek to textblock.\n"); free(tab); free(txt); _lclose32(hf); return; } if (head.textsize!=_lread32(hf,txt,head.textsize)) { - dprintf_reg(stderr,"_w31_loadreg:textblock too short (%d instead of %ld).\n",len,head.textsize); + dprintf_err(reg,"_w31_loadreg:textblock too short (%d instead of %ld).\n",len,head.textsize); free(tab); free(txt); _lclose32(hf); @@ -1443,7 +1417,7 @@ _w31_loadreg() { } if (!GetFileInformationByHandle(hf,&hfinfo)) { - dprintf_reg(stderr,"_w31_loadreg:GetFileInformationByHandle failed?.\n"); + dprintf_err(reg,"_w31_loadreg:GetFileInformationByHandle failed?.\n"); free(tab); free(txt); _lclose32(hf); @@ -1555,7 +1529,7 @@ DWORD WINAPI RegOpenKeyEx32W( LPKEYSTRUCT lpNextKey,lpxkey; LPWSTR *wps; int wpc,i; - dprintf_reg(stddeb,"RegOpenKeyEx32W(%lx,%s,%ld,%lx,%p)\n", + dprintf_info(reg,"RegOpenKeyEx32W(%lx,%s,%ld,%lx,%p)\n", (LONG)hkey,W2C(lpszSubKey,0),dwReserved,samDesired,retkey ); @@ -1597,7 +1571,7 @@ DWORD WINAPI RegOpenKey32W( LPCWSTR lpszSubKey, LPHKEY retkey ) { - dprintf_reg(stddeb,"RegOpenKey32W(%lx,%s,%p)\n", + dprintf_info(reg,"RegOpenKey32W(%lx,%s,%p)\n", (LONG)hkey,W2C(lpszSubKey,0),retkey ); return RegOpenKeyEx32W(hkey,lpszSubKey,0,KEY_ALL_ACCESS,retkey); @@ -1615,7 +1589,7 @@ DWORD WINAPI RegOpenKeyEx32A( LPWSTR lpszSubKeyW; DWORD ret; - dprintf_reg(stddeb,"RegOpenKeyEx32A(%lx,%s,%ld,%lx,%p)\n", + dprintf_info(reg,"RegOpenKeyEx32A(%lx,%s,%ld,%lx,%p)\n", (LONG)hkey,lpszSubKey,dwReserved,samDesired,retkey ); if (lpszSubKey) @@ -1634,7 +1608,7 @@ DWORD WINAPI RegOpenKey32A( LPCSTR lpszSubKey, LPHKEY retkey ) { - dprintf_reg(stddeb,"RegOpenKey32A(%lx,%s,%p)\n", + dprintf_info(reg,"RegOpenKey32A(%lx,%s,%p)\n", (LONG)hkey,lpszSubKey,retkey ); return RegOpenKeyEx32A(hkey,lpszSubKey,0,KEY_ALL_ACCESS,retkey); @@ -1646,7 +1620,7 @@ DWORD WINAPI RegOpenKey16( LPCSTR lpszSubKey, LPHKEY retkey ) { - dprintf_reg(stddeb,"RegOpenKey16(%lx,%s,%p)\n", + dprintf_info(reg,"RegOpenKey16(%lx,%s,%p)\n", (LONG)hkey,lpszSubKey,retkey ); return RegOpenKey32A(hkey,lpszSubKey,retkey); @@ -1682,7 +1656,7 @@ DWORD WINAPI RegCreateKeyEx32W( int wpc,i; /*FIXME: handle security/access/whatever */ - dprintf_reg(stddeb,"RegCreateKeyEx32W(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n", + dprintf_info(reg,"RegCreateKeyEx32W(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n", (LONG)hkey, W2C(lpszSubKey,0), dwReserved, @@ -1778,7 +1752,7 @@ DWORD WINAPI RegCreateKey32W( ) { DWORD junk,ret; - dprintf_reg(stddeb,"RegCreateKey32W(%lx,%s,%p)\n", + dprintf_info(reg,"RegCreateKey32W(%lx,%s,%p)\n", (LONG)hkey,W2C(lpszSubKey,0),retkey ); ret=RegCreateKeyEx32W( @@ -1810,7 +1784,7 @@ DWORD WINAPI RegCreateKeyEx32A( LPWSTR lpszSubKeyW,lpszClassW; DWORD ret; - dprintf_reg(stddeb,"RegCreateKeyEx32A(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n", + dprintf_info(reg,"RegCreateKeyEx32A(%lx,%s,%ld,%s,%lx,%lx,%p,%p,%p)\n", (LONG)hkey, lpszSubKey, dwReserved, @@ -1855,7 +1829,7 @@ DWORD WINAPI RegCreateKey32A( ) { DWORD junk; - dprintf_reg(stddeb,"RegCreateKey32A(%lx,%s,%p)\n", + dprintf_info(reg,"RegCreateKey32A(%lx,%s,%p)\n", (LONG)hkey,lpszSubKey,retkey ); return RegCreateKeyEx32A( @@ -1877,7 +1851,7 @@ DWORD WINAPI RegCreateKey16( LPCSTR lpszSubKey, LPHKEY retkey ) { - dprintf_reg(stddeb,"RegCreateKey16(%lx,%s,%p)\n", + dprintf_info(reg,"RegCreateKey16(%lx,%s,%p)\n", (LONG)hkey,lpszSubKey,retkey ); return RegCreateKey32A(hkey,lpszSubKey,retkey); @@ -1907,7 +1881,7 @@ DWORD WINAPI RegQueryValueEx32W( LPKEYSTRUCT lpkey; int i; - dprintf_reg(stddeb,"RegQueryValueEx32W(%x,%s,%p,%p,%p,%ld)\n", + dprintf_info(reg,"RegQueryValueEx32W(%x,%s,%p,%p,%p,%ld)\n", hkey,W2C(lpszValueName,0),lpdwReserved,lpdwType,lpbData, lpcbData?*lpcbData:0 ); @@ -1969,7 +1943,7 @@ DWORD WINAPI RegQueryValue32W( HKEY xhkey; DWORD ret,lpdwType; - dprintf_reg(stddeb,"RegQueryValue32W(%x,%s,%p,%ld)\n->", + dprintf_info(reg,"RegQueryValue32W(%x,%s,%p,%ld)\n", hkey,W2C(lpszSubKey,0),lpszData, lpcbData?*lpcbData:0 ); @@ -2011,7 +1985,7 @@ DWORD WINAPI RegQueryValueEx32A( DWORD *mylen; DWORD type; - dprintf_reg(stddeb,"RegQueryValueEx32A(%x,%s,%p,%p,%p,%ld)\n->", + dprintf_info(reg,"RegQueryValueEx32A(%x,%s,%p,%p,%p,%ld)\n", hkey,lpszValueName,lpdwReserved,lpdwType,lpbData, lpcbData?*lpcbData:0 ); @@ -2096,7 +2070,7 @@ DWORD WINAPI RegQueryValueEx16( LPBYTE lpbData, LPDWORD lpcbData ) { - dprintf_reg(stddeb,"RegQueryValueEx16(%x,%s,%p,%p,%p,%ld)\n", + dprintf_info(reg,"RegQueryValueEx16(%x,%s,%p,%p,%p,%ld)\n", hkey,lpszValueName,lpdwReserved,lpdwType,lpbData, lpcbData?*lpcbData:0 ); @@ -2120,7 +2094,7 @@ DWORD WINAPI RegQueryValue32A( HKEY xhkey; DWORD ret,lpdwType; - dprintf_reg(stddeb,"RegQueryValue32A(%x,%s,%p,%ld)\n", + dprintf_info(reg,"RegQueryValue32A(%x,%s,%p,%ld)\n", hkey,lpszSubKey,lpszData, lpcbData?*lpcbData:0 ); @@ -2154,7 +2128,7 @@ DWORD WINAPI RegQueryValue16( LPSTR lpszData, LPDWORD lpcbData ) { - dprintf_reg(stddeb,"RegQueryValue16(%x,%s,%p,%ld)\n", + dprintf_info(reg,"RegQueryValue16(%x,%s,%p,%ld)\n", hkey,lpszSubKey,lpszData,lpcbData?*lpcbData:0 ); /* HACK: the 16bit RegQueryValue doesn't handle selectorblocks @@ -2186,7 +2160,7 @@ DWORD WINAPI RegSetValueEx32W( LPKEYSTRUCT lpkey; int i; - dprintf_reg(stddeb,"RegSetValueEx32W(%x,%s,%ld,%ld,%p,%ld)\n", + dprintf_info(reg,"RegSetValueEx32W(%x,%s,%ld,%ld,%p,%ld)\n", hkey,W2C(lpszValueName,0),dwReserved,dwType,lpbData,cbData ); /* we no longer care about the lpbData type here... */ @@ -2243,7 +2217,7 @@ DWORD WINAPI RegSetValueEx32A( LPWSTR lpszValueNameW; DWORD ret; - dprintf_reg(stddeb,"RegSetValueEx32A(%x,%s,%ld,%ld,%p,%ld)\n->", + dprintf_info(reg,"RegSetValueEx32A(%x,%s,%ld,%ld,%p,%ld)\n", hkey,lpszValueName,dwReserved,dwType,lpbData,cbData ); if ((1<", + dprintf_info(reg,"RegSetValueEx16(%x,%s,%ld,%ld,%p,%ld)\n", hkey,lpszValueName,dwReserved,dwType,lpbData,cbData ); return RegSetValueEx32A(hkey,lpszValueName,dwReserved,dwType,lpbData,cbData); @@ -2289,7 +2263,7 @@ DWORD WINAPI RegSetValue32W( HKEY xhkey; DWORD ret; - dprintf_reg(stddeb,"RegSetValue32W(%x,%s,%ld,%s,%ld)\n->", + dprintf_info(reg,"RegSetValue32W(%x,%s,%ld,%s,%ld)\n", hkey,W2C(lpszSubKey,0),dwType,W2C(lpszData,0),cbData ); if (lpszSubKey && *lpszSubKey) { @@ -2303,7 +2277,7 @@ DWORD WINAPI RegSetValue32W( dwType=REG_SZ; } if (cbData!=2*lstrlen32W(lpszData)+2) { - dprintf_reg(stddeb,"RegSetValueX called with len=%ld != strlen(%s)+1=%d!\n", + dprintf_info(reg,"RegSetValueX called with len=%ld != strlen(%s)+1=%d!\n", cbData,W2C(lpszData,0),2*lstrlen32W(lpszData)+2 ); cbData=2*lstrlen32W(lpszData)+2; @@ -2325,7 +2299,7 @@ DWORD WINAPI RegSetValue32A( DWORD ret; HKEY xhkey; - dprintf_reg(stddeb,"RegSetValue32A(%x,%s,%ld,%s,%ld)\n->", + dprintf_info(reg,"RegSetValue32A(%x,%s,%ld,%s,%ld)\n", hkey,lpszSubKey,dwType,lpszData,cbData ); if (lpszSubKey && *lpszSubKey) { @@ -2336,7 +2310,7 @@ DWORD WINAPI RegSetValue32A( xhkey=hkey; if (dwType!=REG_SZ) { - dprintf_reg(stddeb,"RegSetValueA called with dwType=%ld!\n",dwType); + dprintf_info(reg,"RegSetValueA called with dwType=%ld!\n",dwType); dwType=REG_SZ; } if (cbData!=strlen(lpszData)+1) @@ -2356,7 +2330,7 @@ DWORD WINAPI RegSetValue16( DWORD cbData ) { DWORD ret; - dprintf_reg(stddeb,"RegSetValue16(%x,%s,%ld,%s,%ld)\n->", + dprintf_info(reg,"RegSetValue16(%x,%s,%ld,%s,%ld)\n", hkey,lpszSubKey,dwType,lpszData,cbData ); ret=RegSetValue32A(hkey,lpszSubKey,dwType,lpszData,cbData); @@ -2384,7 +2358,7 @@ DWORD WINAPI RegEnumKeyEx32W( ) { LPKEYSTRUCT lpkey,lpxkey; - dprintf_reg(stddeb,"RegEnumKeyEx32W(%x,%ld,%p,%ld,%p,%p,%p,%p)\n", + dprintf_info(reg,"RegEnumKeyEx32W(%x,%ld,%p,%ld,%p,%p,%p,%p)\n", hkey,iSubkey,lpszName,*lpcchName,lpdwReserved,lpszClass,lpcchClass,ft ); lpkey=lookup_hkey(hkey); @@ -2420,7 +2394,7 @@ DWORD WINAPI RegEnumKey32W( ) { FILETIME ft; - dprintf_reg(stddeb,"RegEnumKey32W(%x,%ld,%p,%ld)\n->", + dprintf_info(reg,"RegEnumKey32W(%x,%ld,%p,%ld)\n", hkey,iSubkey,lpszName,lpcchName ); return RegEnumKeyEx32W(hkey,iSubkey,lpszName,&lpcchName,NULL,NULL,NULL,&ft); @@ -2440,7 +2414,7 @@ DWORD WINAPI RegEnumKeyEx32A( LPWSTR lpszNameW,lpszClassW; - dprintf_reg(stddeb,"RegEnumKeyEx32A(%x,%ld,%p,%ld,%p,%p,%p,%p)\n->", + dprintf_info(reg,"RegEnumKeyEx32A(%x,%ld,%p,%ld,%p,%p,%p,%p)\n", hkey,iSubkey,lpszName,*lpcchName,lpdwReserved,lpszClass,lpcchClass,ft ); if (lpszName) { @@ -2491,7 +2465,7 @@ DWORD WINAPI RegEnumKey32A( ) { FILETIME ft; - dprintf_reg(stddeb,"RegEnumKey32A(%x,%ld,%p,%ld)\n->", + dprintf_info(reg,"RegEnumKey32A(%x,%ld,%p,%ld)\n", hkey,iSubkey,lpszName,lpcchName ); return RegEnumKeyEx32A( @@ -2513,7 +2487,7 @@ DWORD WINAPI RegEnumKey16( LPSTR lpszName, DWORD lpcchName ) { - dprintf_reg(stddeb,"RegEnumKey16(%x,%ld,%p,%ld)\n->", + dprintf_info(reg,"RegEnumKey16(%x,%ld,%p,%ld)\n", hkey,iSubkey,lpszName,lpcchName ); return RegEnumKey32A(hkey,iSubkey,lpszName,lpcchName); @@ -2540,7 +2514,7 @@ DWORD WINAPI RegEnumValue32W( LPKEYSTRUCT lpkey; LPKEYVALUE val; - dprintf_reg(stddeb,"RegEnumValue32W(%x,%ld,%p,%p,%p,%p,%p,%p)\n", + dprintf_info(reg,"RegEnumValue32W(%x,%ld,%p,%p,%p,%p,%p,%p)\n", hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData ); lpkey = lookup_hkey(hkey); @@ -2587,7 +2561,7 @@ DWORD WINAPI RegEnumValue32A( LPBYTE lpbDataW; DWORD ret,lpcbDataW; - dprintf_reg(stddeb,"RegEnumValue32A(%x,%ld,%p,%p,%p,%p,%p,%p)\n", + dprintf_info(reg,"RegEnumValue32A(%x,%ld,%p,%p,%p,%p,%p,%p)\n", hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData ); @@ -2640,7 +2614,7 @@ DWORD WINAPI RegEnumValue16( LPBYTE lpbData, LPDWORD lpcbData ) { - dprintf_reg(stddeb,"RegEnumValue(%x,%ld,%p,%p,%p,%p,%p,%p)\n", + dprintf_info(reg,"RegEnumValue(%x,%ld,%p,%p,%p,%p,%p,%p)\n", hkey,iValue,lpszValue,lpcchValue,lpdReserved,lpdwType,lpbData,lpcbData ); return RegEnumValue32A( @@ -2660,7 +2634,7 @@ DWORD WINAPI RegEnumValue16( */ /* RegCloseKey [SHELL.3] [KERNEL.220] [ADVAPI32.126] */ DWORD WINAPI RegCloseKey(HKEY hkey) { - dprintf_reg(stddeb,"RegCloseKey(%x)\n",hkey); + dprintf_info(reg,"RegCloseKey(%x)\n",hkey); remove_handle(hkey); return ERROR_SUCCESS; } @@ -2676,17 +2650,17 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) { LPWSTR *wps; int wpc,i; - dprintf_reg(stddeb,"RegDeleteKey32W(%x,%s)\n", + dprintf_info(reg,"RegDeleteKey32W(%x,%s)\n", hkey,W2C(lpszSubKey,0) ); lpNextKey = lookup_hkey(hkey); if (!lpNextKey) { - dprintf_reg (stddeb, " Badkey[1].\n"); + dprintf_info(reg, " Badkey[1].\n"); return SHELL_ERROR_BADKEY; } /* we need to know the previous key in the hier. */ if (!lpszSubKey || !*lpszSubKey) { - dprintf_reg (stddeb, " Badkey[2].\n"); + dprintf_info(reg, " Badkey[2].\n"); return SHELL_ERROR_BADKEY; } split_keypath(lpszSubKey,&wps,&wpc); @@ -2695,7 +2669,7 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) { while (inextsub; while (lpxkey) { - dprintf_reg (stddeb, " Scanning [%s]\n", + dprintf_info(reg, " Scanning [%s]\n", W2C (lpxkey->keyname, 0)); if (!lstrcmpi32W(wps[i],lpxkey->keyname)) break; @@ -2703,7 +2677,7 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) { } if (!lpxkey) { FREE_KEY_PATH; - dprintf_reg (stddeb, " Not found.\n"); + dprintf_info(reg, " Not found.\n"); /* not found is success */ return SHELL_ERROR_SUCCESS; } @@ -2713,7 +2687,7 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) { lpxkey = lpNextKey->nextsub; lplpPrevKey = &(lpNextKey->nextsub); while (lpxkey) { - dprintf_reg (stddeb, " Scanning [%s]\n", + dprintf_info(reg, " Scanning [%s]\n", W2C (lpxkey->keyname, 0)); if (!lstrcmpi32W(wps[i],lpxkey->keyname)) break; @@ -2722,13 +2696,12 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) { } if (!lpxkey) { FREE_KEY_PATH; - dprintf_reg (stddeb, " Not found.\n"); + dprintf_warn(reg , " Not found.\n"); return SHELL_ERROR_BADKEY; - return SHELL_ERROR_SUCCESS; } if (lpxkey->nextsub) { FREE_KEY_PATH; - dprintf_reg (stddeb, " Not empty.\n"); + dprintf_warn(reg , " Not empty.\n"); return SHELL_ERROR_CANTWRITE; } *lplpPrevKey = lpxkey->next; @@ -2739,7 +2712,7 @@ DWORD WINAPI RegDeleteKey32W(HKEY hkey,LPWSTR lpszSubKey) { free(lpxkey->values); free(lpxkey); FREE_KEY_PATH; - dprintf_reg (stddeb, " Done.\n"); + dprintf_info(reg, " Done.\n"); return SHELL_ERROR_SUCCESS; } @@ -2748,7 +2721,7 @@ DWORD WINAPI RegDeleteKey32A(HKEY hkey,LPCSTR lpszSubKey) { LPWSTR lpszSubKeyW; DWORD ret; - dprintf_reg(stddeb,"RegDeleteKey32A(%x,%s)\n", + dprintf_info(reg,"RegDeleteKey32A(%x,%s)\n", hkey,lpszSubKey ); lpszSubKeyW=HEAP_strdupAtoW(GetProcessHeap(),0,lpszSubKey); @@ -2759,7 +2732,7 @@ DWORD WINAPI RegDeleteKey32A(HKEY hkey,LPCSTR lpszSubKey) { /* RegDeleteKey [SHELL.4] [KERNEL.219] */ DWORD WINAPI RegDeleteKey16(HKEY hkey,LPCSTR lpszSubKey) { - dprintf_reg(stddeb,"RegDeleteKey16(%x,%s)\n", + dprintf_info(reg,"RegDeleteKey16(%x,%s)\n", hkey,lpszSubKey ); return RegDeleteKey32A(hkey,lpszSubKey); @@ -2778,7 +2751,7 @@ DWORD WINAPI RegDeleteValue32W(HKEY hkey,LPWSTR lpszValue) LPKEYSTRUCT lpkey; LPKEYVALUE val; - dprintf_reg(stddeb,"RegDeleteValue32W(%x,%s)\n", + dprintf_info(reg,"RegDeleteValue32W(%x,%s)\n", hkey,W2C(lpszValue,0) ); lpkey=lookup_hkey(hkey); @@ -2819,7 +2792,7 @@ DWORD WINAPI RegDeleteValue32A(HKEY hkey,LPSTR lpszValue) LPWSTR lpszValueW; DWORD ret; - dprintf_reg( stddeb, "RegDeleteValue32A(%x,%s)\n", hkey,lpszValue ); + dprintf_info(reg, "RegDeleteValue32A(%x,%s)\n", hkey,lpszValue ); lpszValueW=HEAP_strdupAtoW(GetProcessHeap(),0,lpszValue); ret=RegDeleteValue32W(hkey,lpszValueW); HeapFree(GetProcessHeap(),0,lpszValueW); @@ -2829,14 +2802,14 @@ DWORD WINAPI RegDeleteValue32A(HKEY hkey,LPSTR lpszValue) /* RegDeleteValue [KERNEL.222] */ DWORD WINAPI RegDeleteValue16(HKEY hkey,LPSTR lpszValue) { - dprintf_reg( stddeb,"RegDeleteValue16(%x,%s)\n", hkey,lpszValue ); + dprintf_info(reg,"RegDeleteValue16(%x,%s)\n", hkey,lpszValue ); return RegDeleteValue32A(hkey,lpszValue); } /* RegFlushKey [ADVAPI32.143] [KERNEL.227] */ DWORD WINAPI RegFlushKey(HKEY hkey) { - dprintf_reg(stddeb,"RegFlushKey(%x), STUB.\n",hkey); + dprintf_fixme(reg, "RegFlushKey(%x), STUB.\n", hkey); return SHELL_ERROR_SUCCESS; } @@ -2861,7 +2834,7 @@ DWORD WINAPI RegQueryInfoKey32W( int nrofkeys,maxsubkey,maxclass,maxvalues,maxvname,maxvdata; int i; - dprintf_reg(stddeb,"RegQueryInfoKey32W(%x,......)\n",hkey); + dprintf_info(reg,"RegQueryInfoKey32W(%x,......)\n",hkey); lpkey=lookup_hkey(hkey); if (!lpkey) return SHELL_ERROR_BADKEY; @@ -2936,7 +2909,7 @@ DWORD WINAPI RegQueryInfoKey32A( LPWSTR lpszClassW; DWORD ret; - dprintf_reg(stddeb,"RegQueryInfoKey32A(%x,......)\n",hkey); + dprintf_info(reg,"RegQueryInfoKey32A(%x,......)\n",hkey); if (lpszClass) { *lpcchClass*= 2; lpszClassW = (LPWSTR)xmalloc(*lpcchClass); diff --git a/misc/shell.c b/misc/shell.c index 7007c23dfb7..69f12aa893f 100644 --- a/misc/shell.c +++ b/misc/shell.c @@ -22,7 +22,6 @@ #include "interfaces.h" #include "sysmetrics.h" #include "shlobj.h" -#include "stddebug.h" #include "debug.h" #include "debugstr.h" #include "winreg.h" @@ -34,6 +33,7 @@ static const char * const SHELL_People[] = "Martin Ayotte", "Karl Backstr\366m", "Peter Bajusz", + "Marcel Baur", "Georg Beyerle", "Ross Biro", "Martin Boehme", @@ -222,7 +222,7 @@ UINT16 WINAPI DragQueryFile(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, LPSTR lpCurrent; WORD i; - dprintf_reg(stddeb,"DragQueryFile(%04x, %i, %p, %u)\n", + dprintf_info(reg,"DragQueryFile(%04x, %i, %p, %u)\n", hDrop,wFile,lpszFile,wLength); lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock16(hDrop); @@ -296,7 +296,7 @@ static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile, int i; /* random counter */ char xlpFile[256]; /* result of SearchPath */ - dprintf_exec(stddeb, "SHELL_FindExecutable: %s\n", + dprintf_info(exec, "SHELL_FindExecutable: %s\n", (lpFile != NULL?lpFile:"-") ); lpResult[0]='\0'; /* Start off with an empty return string */ @@ -322,7 +322,7 @@ static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile, /* Make local copy & lowercase it for reg & 'programs=' lookup */ lstrcpyn32A( tmpext, extension, 5 ); CharLower32A( tmpext ); - dprintf_exec(stddeb, "SHELL_FindExecutable: %s file\n", tmpext); + dprintf_info(exec, "SHELL_FindExecutable: %s file\n", tmpext); /* Three places to check: */ /* 1. win.ini, [windows], programs (NB no leading '.') */ @@ -348,7 +348,7 @@ static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile, strcpy(lpResult, xlpFile); /* Need to perhaps check that the file has a path * attached */ - dprintf_exec(stddeb, "SHELL_FindExecutable: found %s\n", + dprintf_info(exec, "SHELL_FindExecutable: found %s\n", lpResult); return 33; @@ -366,7 +366,7 @@ static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile, &filetypelen ) == SHELL_ERROR_SUCCESS ) { filetype[filetypelen]='\0'; - dprintf_exec(stddeb, "SHELL_FindExecutable: File type: %s\n", + dprintf_info(exec, "SHELL_FindExecutable: File type: %s\n", filetype); /* Looking for ...buffer\shell\lpOperation\command */ @@ -420,7 +420,7 @@ static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile, } } - dprintf_exec(stddeb, "SHELL_FindExecutable: returning %s\n", lpResult); + dprintf_info(exec, "SHELL_FindExecutable: returning %s\n", lpResult); return retval; } @@ -435,7 +435,7 @@ HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation, char old_dir[1024]; char cmd[256]; - dprintf_exec(stddeb, "ShellExecute(%04x,'%s','%s','%s','%s',%x)\n", + dprintf_info(exec, "ShellExecute(%04x,'%s','%s','%s','%s',%x)\n", hWnd, lpOperation ? lpOperation:"", lpFile ? lpFile:"", lpParameters ? lpParameters : "", lpDirectory ? lpDirectory : "", iShowCmd); @@ -460,7 +460,7 @@ HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation, strcat(cmd,lpParameters); } - dprintf_exec(stddeb,"ShellExecute:starting %s\n",cmd); + dprintf_info(exec,"ShellExecute:starting %s\n",cmd); retval = WinExec32( cmd, iShowCmd ); } if (lpDirectory) SetCurrentDirectory32A( old_dir ); @@ -498,7 +498,7 @@ HINSTANCE32 WINAPI FindExecutable32A( LPCSTR lpFile, LPCSTR lpDirectory, HINSTANCE32 retval=31; /* default - 'No association was found' */ char old_dir[1024]; - dprintf_exec(stddeb, "FindExecutable: File %s, Dir %s\n", + dprintf_info(exec, "FindExecutable: File %s, Dir %s\n", (lpFile != NULL?lpFile:"-"), (lpDirectory != NULL?lpDirectory:"-")); @@ -519,7 +519,7 @@ HINSTANCE32 WINAPI FindExecutable32A( LPCSTR lpFile, LPCSTR lpDirectory, retval = SHELL_FindExecutable( lpFile, "open", lpResult ); - dprintf_exec(stddeb, "FindExecutable: returning %s\n", lpResult); + dprintf_info(exec, "FindExecutable: returning %s\n", lpResult); if (lpDirectory) SetCurrentDirectory32A( old_dir ); return retval; } @@ -931,7 +931,7 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance, HFILE32 hFile = OpenFile32( lpszExeFileName, &ofs, OF_READ ); UINT16 iconDirCount = 0,iconCount = 0; - dprintf_reg(stddeb,"InternalExtractIcon(%04x,file %s,start %d,extract %d\n", + dprintf_info(reg,"InternalExtractIcon(%04x,file %s,start %d,extract %d\n", hInstance, lpszExeFileName, nIconIndex, n); if( hFile == HFILE_ERROR32 || !n ) return 0; @@ -966,13 +966,13 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance, { iconDirCount = pTInfo->count; pIconDir = ((NE_NAMEINFO*)(pTInfo + 1)); - dprintf_reg(stddeb,"\tfound directory - %i icon families\n", iconDirCount); + dprintf_info(reg,"\tfound directory - %i icon families\n", iconDirCount); } if( pTInfo->type_id == NE_RSCTYPE_ICON ) { iconCount = pTInfo->count; pIconStorage = ((NE_NAMEINFO*)(pTInfo + 1)); - dprintf_reg(stddeb,"\ttotal icons - %i\n", iconCount); + dprintf_info(reg,"\ttotal icons - %i\n", iconCount); } pTInfo = (NE_TYPEINFO *)((char*)(pTInfo+1)+pTInfo->count*sizeof(NE_NAMEINFO)); } @@ -1323,7 +1323,7 @@ DWORD WINAPI DoEnvironmentSubst(LPSTR str,WORD length) CharToOem32A(str,str); - dprintf_reg(stddeb,"DoEnvSubst: accept %s", str); + dprintf_info(reg,"DoEnvSubst: accept %s\n", str); while( *lpstr && lpbstr - lpBuffer < length ) { @@ -1372,7 +1372,7 @@ DWORD WINAPI DoEnvironmentSubst(LPSTR str,WORD length) else length = 0; - dprintf_reg(stddeb," return %s\n", str); + dprintf_info(reg," return %s\n", str); OemToChar32A(str,str); HeapFree( GetProcessHeap(), 0, lpBuffer); @@ -1389,7 +1389,7 @@ DWORD WINAPI DoEnvironmentSubst(LPSTR str,WORD length) */ LRESULT WINAPI ShellHookProc(INT16 code, WPARAM16 wParam, LPARAM lParam) { - dprintf_reg(stddeb,"ShellHookProc: %i, %04x, %08x\n", code, wParam, + dprintf_info(reg,"ShellHookProc: %i, %04x, %08x\n", code, wParam, (unsigned)lParam ); if( SHELL_hHook && SHELL_hWnd ) { @@ -1416,7 +1416,7 @@ LRESULT WINAPI FUNC004(INT16 code, WPARAM16 wParam, LPARAM lParam) */ BOOL32 WINAPI RegisterShellHook(HWND16 hWnd, UINT16 uAction) { - dprintf_reg(stddeb,"RegisterShellHook: %04x [%u]\n", hWnd, uAction ); + dprintf_info(reg,"RegisterShellHook: %04x [%u]\n", hWnd, uAction ); switch( uAction ) { @@ -1547,7 +1547,7 @@ LPWSTR* WINAPI CommandLineToArgvW(LPWSTR cmdline,LPDWORD numargs) void WINAPI Control_RunDLL (HWND32 hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4) { - dprintf_exec (stddeb, "Control_RunDLL (%08x, %p, \"%s\", %08lx)\n", + dprintf_info(exec, "Control_RunDLL (%08x, %p, \"%s\", %08lx)\n", hwnd, code ? code : "(null)", cmd ? cmd : "(null)", @@ -1573,8 +1573,8 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv) HRESULT hres = E_OUTOFMEMORY; - StringFromCLSID((LPCLSID)rclsid,xclsid); - StringFromCLSID((LPCLSID)iid,xiid); + WINE_StringFromCLSID((LPCLSID)rclsid,xclsid); + WINE_StringFromCLSID((LPCLSID)iid,xiid); fprintf(stderr,"SHELL32_DllGetClassObject(%s,%s,%p)\n",xclsid,xiid,ppv); *ppv = NULL; @@ -1633,10 +1633,9 @@ DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *shellfolder) { * What we are currently doing is not very wrong, since we always use the same * heap (ProcessHeap). */ -DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) { +DWORD WINAPI SHGetMalloc(LPMALLOC32 *lpmal) { fprintf(stderr,"SHGetMalloc()\n"); - *lpmal = IMalloc_Constructor(); - return NOERROR; + return CoGetMalloc32(0,lpmal); } /************************************************************************* diff --git a/misc/shellord.c b/misc/shellord.c index 1d4f857ebb6..9eda43342cb 100644 --- a/misc/shellord.c +++ b/misc/shellord.c @@ -27,7 +27,6 @@ #include "cursoricon.h" #include "interfaces.h" #include "shlobj.h" -#include "stddebug.h" #include "debug.h" #include "winreg.h" @@ -470,10 +469,10 @@ LRESULT WINAPI SHELL32_102( DWORD pathlen,type,tmodellen; DWORD hres; - StringFromCLSID(refiid,xiid); + WINE_StringFromCLSID(refiid,xiid); if (clsid) - StringFromCLSID(clsid,xclsid); + WINE_StringFromCLSID(clsid,xclsid); else { if (!aclsid) return 0x80040154; @@ -524,7 +523,7 @@ void __cdecl SHELL32_183(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type, fprintf(stderr,"SHELL32_183(%08lx,%08lx,%08lx(%s),%08lx(%s),%08lx,%p),stub!\n", (DWORD)hmod,(DWORD)hwnd,id,buf2,x,buf,type,arglist ); - MessageBox32A(hwnd,buf3,buf,id|0x10000); + /*MessageBox32A(hwnd,buf3,buf,id|0x10000);*/ } diff --git a/misc/spy.c b/misc/spy.c index 45f368b05b9..9a6b3fb056c 100644 --- a/misc/spy.c +++ b/misc/spy.c @@ -12,7 +12,6 @@ #include "win.h" #include "module.h" #include "options.h" -#include "stddebug.h" #include "debug.h" #include "spy.h" @@ -643,21 +642,21 @@ void SPY_EnterMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, { LPCSTR pname; - if (!debugging_message || SPY_EXCLUDE(msg)) return; + if (!debugging_info(message) || SPY_EXCLUDE(msg)) return; /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */ switch(iFlag) { case SPY_DISPATCHMESSAGE16: pname = SPY_GetWndName(hWnd); - dprintf_message(stddeb,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n", + dprintf_info(message,"%*s(%04x) %-16s message [%04x] %s dispatched wp=%04x lp=%08lx\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), wParam, lParam); break; case SPY_DISPATCHMESSAGE32: pname = SPY_GetWndName(hWnd); - dprintf_message(stddeb,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n", + dprintf_info(message,"%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), wParam, lParam); break; @@ -675,12 +674,12 @@ void SPY_EnterMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, pname = SPY_GetWndName(hWnd); if (iFlag == SPY_SENDMESSAGE16) - dprintf_message(stddeb, + dprintf_info(message, "%*s(%04x) %-16s message [%04x] %s sent from %s wp=%04x lp=%08lx\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), taskName, wParam, lParam ); else - dprintf_message(stddeb, + dprintf_info(message, "%*s(%08x) %-16s message [%04x] %s sent from %s wp=%08x lp=%08lx\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), taskName, wParam, lParam ); @@ -689,14 +688,14 @@ void SPY_EnterMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, case SPY_DEFWNDPROC16: if( SPY_ExcludeDWP ) return; - dprintf_message(stddeb, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n", + dprintf_info(message, "%*s(%04x) DefWindowProc16: %s [%04x] wp=%04x lp=%08lx\n", SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, wParam, lParam ); break; case SPY_DEFWNDPROC32: if( SPY_ExcludeDWP ) return; - dprintf_message(stddeb, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n", + dprintf_info(message, "%*s(%08x) DefWindowProc32: %s [%04x] wp=%08x lp=%08lx\n", SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, wParam, lParam ); break; @@ -712,7 +711,7 @@ void SPY_ExitMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, LRESULT lReturn ) { LPCSTR pname; - if (!debugging_message || SPY_EXCLUDE(msg) || + if (!debugging_info(message) || SPY_EXCLUDE(msg) || (SPY_ExcludeDWP && (iFlag == SPY_RESULT_DEFWND16 || iFlag == SPY_RESULT_DEFWND32)) ) return; @@ -721,39 +720,39 @@ void SPY_ExitMessage( INT32 iFlag, HWND32 hWnd, UINT32 msg, LRESULT lReturn ) switch(iFlag) { case SPY_RESULT_DEFWND16: - dprintf_message(stddeb,"%*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n", + dprintf_info(message,"%*s(%04x) DefWindowProc16: %s [%04x] returned %08lx\n", SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn ); break; case SPY_RESULT_DEFWND32: - dprintf_message(stddeb,"%*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n", + dprintf_info(message,"%*s(%08x) DefWindowProc32: %s [%04x] returned %08lx\n", SPY_IndentLevel, "", hWnd, SPY_GetMsgName( msg ), msg, lReturn ); break; case SPY_RESULT_OK16: pname = SPY_GetWndName(hWnd); - dprintf_message(stddeb,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n", + dprintf_info(message,"%*s(%04x) %-16s message [%04x] %s returned %08lx\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), lReturn ); break; case SPY_RESULT_OK32: pname = SPY_GetWndName(hWnd); - dprintf_message(stddeb,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n", + dprintf_info(message,"%*s(%08x) %-16s message [%04x] %s returned %08lx\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ), lReturn ); break; case SPY_RESULT_INVALIDHWND16: pname = SPY_GetWndName(hWnd); - dprintf_message(stddeb,"%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n", + dprintf_warn(message, "%*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ) ); break; case SPY_RESULT_INVALIDHWND32: pname = SPY_GetWndName(hWnd); - dprintf_message(stddeb,"%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n", + dprintf_warn(message, "%*s(%08x) %-16s message [%04x] %s HAS INVALID HWND\n", SPY_IndentLevel, "", hWnd, pname, msg, SPY_GetMsgName( msg ) ); break; @@ -769,12 +768,12 @@ int SPY_Init(void) int i; char buffer[1024]; - if (!debugging_message) return TRUE; + if (!debugging_info(message)) return TRUE; PROFILE_GetWineIniString( "Spy", "Include", "", buffer, sizeof(buffer) ); if (buffer[0] && strcmp( buffer, "INCLUDEALL" )) { - dprintf_message( stddeb, "SpyInit: Include=%s\n", buffer ); + dprintf_info(message, "SpyInit: Include=%s\n", buffer ); for (i = 0; i <= SPY_MAX_MSGNUM; i++) SPY_Exclude[i] = (MessageTypeNames[i] && !strstr(buffer,MessageTypeNames[i])); } @@ -782,7 +781,7 @@ int SPY_Init(void) PROFILE_GetWineIniString( "Spy", "Exclude", "", buffer, sizeof(buffer) ); if (buffer[0]) { - dprintf_message( stddeb, "SpyInit: Exclude=%s\n", buffer ); + dprintf_info(message, "SpyInit: Exclude=%s\n", buffer ); if (!strcmp( buffer, "EXCLUDEALL" )) for (i = 0; i <= SPY_MAX_MSGNUM; i++) SPY_Exclude[i] = TRUE; else diff --git a/misc/stress.c b/misc/stress.c index 6b4e2feb4fa..57145529a4f 100644 --- a/misc/stress.c +++ b/misc/stress.c @@ -2,22 +2,20 @@ #include #include "windows.h" #include "stress.h" -#include "stddebug.h" -/* #define DEBUG_STRESS */ -/* #undef DEBUG_STRESS */ #include "debug.h" int WINAPI AllocDiskSpace(long lLeft, UINT16 uDrive) { - dprintf_stress(stdnimp, "stress.dll: AllocDiskSpace %d, %ld\n", uDrive, lLeft); + dprintf_fixme(stress, "stress.dll: AllocDiskSpace(%d, %ld) - stub\n", + uDrive, lLeft); return 1; } int WINAPI AllocFileHandles(int Left) { - dprintf_stress(stddeb, "stress.dll: AllocFileHandles %d\n", Left); + dprintf_info(stress, "stress.dll: AllocFileHandles(%d) - stub\n", Left); if (Left < 0) return -1; @@ -27,48 +25,48 @@ int WINAPI AllocFileHandles(int Left) BOOL16 WINAPI AllocGDIMem(UINT16 uLeft) { - dprintf_stress(stddeb, "stress.dll: AllocGDIMem %d\n", uLeft); + dprintf_info(stress, "stress.dll: AllocGDIMem(%d) - stub\n", uLeft); return 1; } BOOL16 WINAPI AllocMem(DWORD dwLeft) { - dprintf_stress(stdnimp, "stress.dll: AllocMem %ld\n", dwLeft); + dprintf_fixme(stress, "stress.dll: AllocMem(%ld) - stub\n", dwLeft); return 1; } BOOL16 WINAPI AllocUserMem(UINT16 uContig) { - dprintf_stress(stddeb, "stress.dll: AllocUserMem %d\n", uContig); + dprintf_info(stress, "stress.dll: AllocUserMem %d\n", uContig); return 1; } void WINAPI FreeAllMem(void) { - dprintf_stress(stddeb, "stress.dll: FreeAllMem\n"); + dprintf_info(stress, "stress.dll: FreeAllMem\n"); } void WINAPI FreeAllGDIMem(void) { - dprintf_stress(stddeb, "stress.dll: FreeAllGDIMem\n"); + dprintf_info(stress, "stress.dll: FreeAllGDIMem\n"); } void WINAPI FreeAllUserMem(void) { - dprintf_stress(stddeb, "stress.dll: FreeAllUserMem\n"); + dprintf_info(stress, "stress.dll: FreeAllUserMem\n"); } void WINAPI GetFreeAllUserMem(void) { - dprintf_stress(stddeb, "stress.dll: GetFreeAllUserMem\n"); + dprintf_info(stress, "stress.dll: GetFreeAllUserMem\n"); } int WINAPI GetFreeFileHandles(void) { - dprintf_stress(stddeb, "stress.dll: GetFreeFileHandles\n"); + dprintf_info(stress, "stress.dll: GetFreeFileHandles\n"); #ifndef OPEN_MAX return _POSIX_OPEN_MAX; @@ -79,10 +77,10 @@ int WINAPI GetFreeFileHandles(void) void WINAPI UnAllocDiskSpace(UINT16 drive) { - dprintf_stress(stddeb, "stress.dll: UnAllocDiskSpace %d\n", drive); + dprintf_info(stress, "stress.dll: UnAllocDiskSpace %d\n", drive); } void WINAPI UnAllocFileHandles(void) { - dprintf_stress(stddeb, "stress.dll: GetFreeAllUserMem\n"); + dprintf_info(stress, "stress.dll: GetFreeAllUserMem\n"); } diff --git a/misc/toolhelp.c b/misc/toolhelp.c index 2e485aec703..9ec8c6fb420 100644 --- a/misc/toolhelp.c +++ b/misc/toolhelp.c @@ -12,7 +12,6 @@ #include "windows.h" #include "win.h" #include "toolhelp.h" -#include "stddebug.h" #include "debug.h" #include "heap.h" @@ -36,7 +35,7 @@ BOOL16 WINAPI NotifyRegister( HTASK16 htask, FARPROC16 lpfnCallback, { int i; - dprintf_toolhelp( stddeb, "NotifyRegister(%x,%lx,%x) called.\n", + dprintf_info(toolhelp, "NotifyRegister(%x,%lx,%x) called.\n", htask, (DWORD)lpfnCallback, wFlags ); if (!htask) htask = GetCurrentTask(); for (i=0;idwStrucVersion>>16),vffi->dwStrucVersion&0xFFFF, vffi->dwFileVersionMS,vffi->dwFileVersionLS, vffi->dwProductVersionMS,vffi->dwProductVersionLS, @@ -87,98 +85,96 @@ static void print_vffi_debug(VS_FIXEDFILEINFO *vffi) (vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : "" ); - p = buff; - p+=sprintf(p," OS=0x%lx.0x%lx (", + dsprintf(ver," OS=0x%lx.0x%lx ", (vffi->dwFileOS&0xFFFF0000)>>16, vffi->dwFileOS&0x0000FFFF ); switch (vffi->dwFileOS&0xFFFF0000) { - case VOS_DOS:p+=sprintf(p,"DOS,");break; - case VOS_OS216:p+=sprintf(p,"OS/2-16,");break; - case VOS_OS232:p+=sprintf(p,"OS/2-32,");break; - case VOS_NT:p+=sprintf(p,"NT,");break; + case VOS_DOS:dsprintf(ver,"DOS,");break; + case VOS_OS216:dsprintf(ver,"OS/2-16,");break; + case VOS_OS232:dsprintf(ver,"OS/2-32,");break; + case VOS_NT:dsprintf(ver,"NT,");break; case VOS_UNKNOWN: default: - p+=sprintf(p,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break; + dsprintf(ver,"UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break; } switch (vffi->dwFileOS & 0xFFFF) { - case VOS__BASE:p+=sprintf(p,"BASE");break; - case VOS__WINDOWS16:p+=sprintf(p,"WIN16");break; - case VOS__WINDOWS32:p+=sprintf(p,"WIN32");break; - case VOS__PM16:p+=sprintf(p,"PM16");break; - case VOS__PM32:p+=sprintf(p,"PM32");break; - default:p+=sprintf(p,"UNKNOWN(0x%lx)",vffi->dwFileOS&0xFFFF);break; + case VOS__BASE:dsprintf(ver,"BASE");break; + case VOS__WINDOWS16:dsprintf(ver,"WIN16");break; + case VOS__WINDOWS32:dsprintf(ver,"WIN32");break; + case VOS__PM16:dsprintf(ver,"PM16");break; + case VOS__PM32:dsprintf(ver,"PM32");break; + default:dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileOS&0xFFFF);break; } - p+=sprintf(p,")"); - dprintf_ver(stddeb, "%s\n", buff); + dprintf_info(ver, "(%s)\n", dbg_str(ver)); - p = buff; + dbg_reset_str(ver); switch (vffi->dwFileType) { default: case VFT_UNKNOWN: - p+=sprintf(p,"filetype=Unknown(0x%lx)",vffi->dwFileType); + dsprintf(ver,"filetype=Unknown(0x%lx)",vffi->dwFileType); break; - case VFT_APP:p+=sprintf(p,"filetype=APP,");break; - case VFT_DLL:p+=sprintf(p,"filetype=DLL,");break; + case VFT_APP:dsprintf(ver,"filetype=APP,");break; + case VFT_DLL:dsprintf(ver,"filetype=DLL,");break; case VFT_DRV: - p+=sprintf(p,"filetype=DRV,"); + dsprintf(ver,"filetype=DRV,"); switch(vffi->dwFileSubtype) { default: case VFT2_UNKNOWN: - p+=sprintf(p,"UNKNOWN(0x%lx)",vffi->dwFileSubtype); + dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileSubtype); break; case VFT2_DRV_PRINTER: - p+=sprintf(p,"PRINTER"); + dsprintf(ver,"PRINTER"); break; case VFT2_DRV_KEYBOARD: - p+=sprintf(p,"KEYBOARD"); + dsprintf(ver,"KEYBOARD"); break; case VFT2_DRV_LANGUAGE: - p+=sprintf(p,"LANGUAGE"); + dsprintf(ver,"LANGUAGE"); break; case VFT2_DRV_DISPLAY: - p+=sprintf(p,"DISPLAY"); + dsprintf(ver,"DISPLAY"); break; case VFT2_DRV_MOUSE: - p+=sprintf(p,"MOUSE"); + dsprintf(ver,"MOUSE"); break; case VFT2_DRV_NETWORK: - p+=sprintf(p,"NETWORK"); + dsprintf(ver,"NETWORK"); break; case VFT2_DRV_SYSTEM: - p+=sprintf(p,"SYSTEM"); + dsprintf(ver,"SYSTEM"); break; case VFT2_DRV_INSTALLABLE: - p+=sprintf(p,"INSTALLABLE"); + dsprintf(ver,"INSTALLABLE"); break; case VFT2_DRV_SOUND: - p+=sprintf(p,"SOUND"); + dsprintf(ver,"SOUND"); break; case VFT2_DRV_COMM: - p+=sprintf(p,"COMM"); + dsprintf(ver,"COMM"); break; case VFT2_DRV_INPUTMETHOD: - p+=sprintf(p,"INPUTMETHOD"); + dsprintf(ver,"INPUTMETHOD"); break; } break; case VFT_FONT: - p+=sprintf(p,"filetype=FONT."); + dsprintf(ver,"filetype=FONT."); switch (vffi->dwFileSubtype) { default: - p+=sprintf(p,"UNKNOWN(0x%lx)",vffi->dwFileSubtype); + dsprintf(ver,"UNKNOWN(0x%lx)",vffi->dwFileSubtype); break; - case VFT2_FONT_RASTER:p+=sprintf(p,"RASTER");break; - case VFT2_FONT_VECTOR:p+=sprintf(p,"VECTOR");break; - case VFT2_FONT_TRUETYPE:p+=sprintf(p,"TRUETYPE");break; + case VFT2_FONT_RASTER:dsprintf(ver,"RASTER");break; + case VFT2_FONT_VECTOR:dsprintf(ver,"VECTOR");break; + case VFT2_FONT_TRUETYPE:dsprintf(ver,"TRUETYPE");break; } break; - case VFT_VXD:p+=sprintf(p,"filetype=VXD");break; - case VFT_STATIC_LIB:p+=sprintf(p,"filetype=STATIC_LIB");break; + case VFT_VXD:dsprintf(ver,"filetype=VXD");break; + case VFT_STATIC_LIB:dsprintf(ver,"filetype=STATIC_LIB");break; } - dprintf_ver(stddeb, "%s\n", buff); + dprintf_info(ver, "%s\n", dbg_str(ver)); - dprintf_ver(stddeb, " filedata=0x%lx.0x%lx\n", + dprintf_info(ver, " filedata=0x%lx.0x%lx\n", vffi->dwFileDateMS,vffi->dwFileDateLS); } @@ -320,13 +316,13 @@ static int find_ne_resource( nehdoffset = LZTELL(lzfd); LZREAD(&nehd); if (nehd.resource_tab_offset==nehd.rname_tab_offset) { - dprintf_ver(stddeb,"no resources in NE dll\n"); + dprintf_info(ver,"no resources in NE dll\n"); return 0; } LZSeek32(lzfd,nehd.resource_tab_offset+nehdoffset,SEEK_SET); LZREAD(&shiftcount); - dprintf_ver(stddeb,"shiftcount is %d\n",shiftcount); - dprintf_ver(stddeb,"reading resource typeinfo dir.\n"); + dprintf_info(ver,"shiftcount is %d\n",shiftcount); + dprintf_info(ver,"reading resource typeinfo dir.\n"); if (!HIWORD(typeid)) typeid = (SEGPTR)(LOWORD(typeid) | 0x8000); if (!HIWORD(resid)) resid = (SEGPTR)(LOWORD(resid) | 0x8000); @@ -336,7 +332,7 @@ static int find_ne_resource( LZREAD(&ti); if (!ti.type_id) return 0; - dprintf_ver(stddeb," ti.typeid =%04x,count=%d\n",ti.type_id,ti.count); + dprintf_info(ver," ti.typeid =%04x,count=%d\n",ti.type_id,ti.count); skipflag=0; if (!HIWORD(typeid)) { @@ -360,7 +356,7 @@ static int find_ne_resource( str=xmalloc(len); if (len!=LZRead32(lzfd,str,len)) return 0; - dprintf_ver(stddeb,"read %s to compare it with %s\n", + dprintf_info(ver,"read %s to compare it with %s\n", str,(char*)PTR_SEG_TO_LIN(typeid) ); if (lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid))) @@ -378,7 +374,7 @@ static int find_ne_resource( int len; LZREAD(&ni); - dprintf_ver(stddeb," ni.id=%4x,offset=%d,length=%d\n", + dprintf_info(ver," ni.id=%4x,offset=%d,length=%d\n", ni.id,ni.offset,ni.length ); skipflag=1; @@ -401,7 +397,7 @@ static int find_ne_resource( str=xmalloc(len); if (len!=LZRead32(lzfd,str,len)) return 0; - dprintf_ver(stddeb,"read %s to compare it with %s\n", + dprintf_info(ver,"read %s to compare it with %s\n", str,(char*)PTR_SEG_TO_LIN(typeid) ); if (!lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid))) @@ -420,7 +416,7 @@ static int find_ne_resource( free(rdata); return 0; } - dprintf_ver(stddeb,"resource found.\n"); + dprintf_info(ver,"resource found.\n"); *resdata= (BYTE*)rdata; *reslen = len; return 1; @@ -449,7 +445,7 @@ find_pe_resource( pehdoffset = LZTELL(lzfd); LZREAD(&pehd); resdir = pehd.OptionalHeader.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY]; - dprintf_ver(stddeb,"find_pe_resource(.,%p,%p,....)\n",typeid,resid); + dprintf_info(ver,"find_pe_resource(.,%p,%p,....)\n",typeid,resid); if (!resdir.Size) { fprintf(stderr,"misc/ver.c:find_pe_resource() no resource directory found in PE file.\n"); return 0; @@ -484,20 +480,20 @@ find_pe_resource( resourcedir = (LPIMAGE_RESOURCE_DIRECTORY)(image+resdir.VirtualAddress); xresdir = GetResDirEntryW(resourcedir,typeid,(DWORD)resourcedir,FALSE); if (!xresdir) { - dprintf_ver(stddeb,"...no typeid entry found for %p\n",typeid); + dprintf_info(ver,"...no typeid entry found for %p\n",typeid); HeapFree(GetProcessHeap(),0,image); return 0; } xresdir = GetResDirEntryW(xresdir,resid,(DWORD)resourcedir,FALSE); if (!xresdir) { - dprintf_ver(stddeb,"...no resid entry found for %p\n",resid); + dprintf_info(ver,"...no resid entry found for %p\n",resid); HeapFree(GetProcessHeap(),0,image); return 0; } xresdir = GetResDirEntryW(xresdir,0,(DWORD)resourcedir,TRUE); if (!xresdir) { - dprintf_ver(stddeb,"...no 0 (default language) entry found for %p\n",resid); + dprintf_info(ver,"...no 0 (default language) entry found for %p\n",resid); HeapFree(GetProcessHeap(),0,image); return 0; } @@ -531,7 +527,7 @@ DWORD WINAPI GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid, int reslen=0; int res=0; - dprintf_ver(stddeb,"GetFileResourceSize(%s,%lx,%lx,%p)\n", + dprintf_info(ver,"GetFileResourceSize(%s,%lx,%lx,%p)\n", filename,(LONG)restype,(LONG)resid,off ); lzfd=LZOpenFile32A(filename,&ofs,OF_READ); @@ -568,7 +564,7 @@ DWORD WINAPI GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid, int res=0; int reslen=datalen; - dprintf_ver(stddeb,"GetFileResource(%s,%lx,%lx,%ld,%ld,%p)\n", + dprintf_info(ver,"GetFileResource(%s,%lx,%lx,%ld,%ld,%p)\n", filename,(LONG)restype,(LONG)resid,off,datalen,data ); @@ -607,7 +603,7 @@ DWORD WINAPI GetFileVersionInfoSize16(LPCSTR filename,LPDWORD handle) BYTE buf[144]; VS_FIXEDFILEINFO *vffi; - dprintf_ver(stddeb,"GetFileVersionInfoSize16(%s,%p)\n",filename,handle); + dprintf_info(ver,"GetFileVersionInfoSize16(%s,%p)\n",filename,handle); len=GetFileResourceSize(filename,VS_FILE_INFO,VS_VERSION_INFO,handle); if (!len) return 0; @@ -633,7 +629,7 @@ DWORD WINAPI GetFileVersionInfoSize16(LPCSTR filename,LPDWORD handle) if (*(WORD*)buf < len) len = *(WORD*)buf; - if(debugging_ver) + if(debugging_info(ver)) print_vffi_debug(vffi); return len; @@ -642,7 +638,7 @@ DWORD WINAPI GetFileVersionInfoSize16(LPCSTR filename,LPDWORD handle) /* GetFileVersionInfoSize32A [VERSION.1] */ DWORD WINAPI GetFileVersionInfoSize32A(LPCSTR filename,LPDWORD handle) { - dprintf_ver(stddeb,"GetFileVersionInfoSize32A(%s,%p)\n",filename,handle); + dprintf_info(ver,"GetFileVersionInfoSize32A(%s,%p)\n",filename,handle); return GetFileVersionInfoSize16(filename,handle); } @@ -659,7 +655,7 @@ DWORD WINAPI GetFileVersionInfoSize32W( LPCWSTR filename, LPDWORD handle ) DWORD WINAPI GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize, LPVOID data) { - dprintf_ver(stddeb,"GetFileVersionInfo16(%s,%ld,%ld,%p)\n->", + dprintf_info(ver,"GetFileVersionInfo16(%s,%ld,%ld,%p)\n", filename,handle,datasize,data ); return GetFileResource( @@ -716,27 +712,27 @@ DWORD WINAPI VerFindFile16( retval = 0; /* Print out debugging information */ - dprintf_ver(stddeb, "VerFindFile() called with parameters:\n" + dprintf_info(ver, "VerFindFile() called with parameters:\n" "\tflags = %x", flags); if(flags & VFFF_ISSHAREDFILE) - dprintf_ver(stddeb, " (VFFF_ISSHAREDFILE)\n"); + dprintf_info(ver, " (VFFF_ISSHAREDFILE)\n"); else - dprintf_ver(stddeb, "\n"); + dprintf_info(ver, "\n"); ver_dstring("\tlpszFilename = ", lpszFilename, ""); ver_dstring("\tlpszWinDir = ", lpszWinDir, ""); ver_dstring("\tlpszAppDir = ", lpszAppDir, ""); - dprintf_ver(stddeb, "\tlpszCurDir = %p\n", lpszCurDir); + dprintf_info(ver, "\tlpszCurDir = %p\n", lpszCurDir); if(lpuCurDirLen) - dprintf_ver(stddeb, "\tlpuCurDirLen = %p (%u)\n", + dprintf_info(ver, "\tlpuCurDirLen = %p (%u)\n", lpuCurDirLen, *lpuCurDirLen); else - dprintf_ver(stddeb, "\tlpuCurDirLen = (null)\n"); + dprintf_info(ver, "\tlpuCurDirLen = (null)\n"); - dprintf_ver(stddeb, "\tlpszDestDir = %p\n", lpszDestDir); + dprintf_info(ver, "\tlpszDestDir = %p\n", lpszDestDir); if(lpuDestDirLen) - dprintf_ver(stddeb, "\tlpuDestDirLen = %p (%u)\n", + dprintf_info(ver, "\tlpuDestDirLen = %p (%u)\n", lpuDestDirLen, *lpuDestDirLen); /* Figure out where the file should go; shared files default to the @@ -824,21 +820,21 @@ DWORD WINAPI VerFindFile16( *lpuCurDirLen = curDirSizeReq; } - dprintf_ver(stddeb, "VerFindFile() ret = %lu (%s%s%s)\n", retval, + dprintf_info(ver, "VerFindFile() ret = %lu (%s%s%s)\n", retval, (retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "", (retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "", (retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : ""); ver_dstring("\t(Exit) lpszCurDir = ", lpszCurDir, ""); if(lpuCurDirLen) - dprintf_ver(stddeb, "\t(Exit) lpuCurDirLen = %p (%u)\n", + dprintf_info(ver, "\t(Exit) lpuCurDirLen = %p (%u)\n", lpuCurDirLen, *lpuCurDirLen); else - dprintf_ver(stddeb, "\t(Exit) lpuCurDirLen = (null)\n"); + dprintf_info(ver, "\t(Exit) lpuCurDirLen = (null)\n"); ver_dstring("\t(Exit) lpszDestDir = ", lpszDestDir, ""); if(lpuDestDirLen) - dprintf_ver(stddeb, "\t(Exit) lpuDestDirLen = %p (%u)\n", + dprintf_info(ver, "\t(Exit) lpuDestDirLen = %p (%u)\n", lpuDestDirLen, *lpuDestDirLen); return retval; @@ -1195,13 +1191,13 @@ _find_dataA(BYTE *block,LPCSTR str, int buff_remain) { while (1) { db=(struct dbA*)block; - dprintf_ver(stddeb,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s\n", + dprintf_info(ver,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s\n", db,db->nextoff,db->datalen,db->name ); if ((!db->nextoff) || (buff_remain<=0)) /* no more entries ? */ return NULL; - dprintf_ver(stddeb,"comparing with %s\n",db->name); + dprintf_info(ver,"comparing with %s\n",db->name); if (!lstrncmpi32A(db->name,str,substrlen)) { if (nextslash) { inc_size=DATA_OFFSET_A(db)+((db->datalen+3)&~3); @@ -1252,7 +1248,7 @@ _find_dataW(BYTE *block,LPCWSTR str, int buff_remain) { } else vs = HEAP_strdupA(GetProcessHeap(),0,"no data"); - dprintf_ver(stddeb,"db->nextoff=%d,db->name=%s,db->data=\"%s\"\n", + dprintf_info(ver,"db->nextoff=%d,db->name=%s,db->data=\"%s\"\n", db->nextoff,xs,vs ); HeapFree(GetProcessHeap(),0,vs); @@ -1288,7 +1284,7 @@ DWORD WINAPI VerQueryValue16(SEGPTR segblock,LPCSTR subblock,SEGPTR *buffer, LPSTR s; BYTE *block=PTR_SEG_TO_LIN(segblock),*b; - dprintf_ver(stddeb,"VerQueryValue16(%p,%s,%p,%d)\n", + dprintf_info(ver,"VerQueryValue16(%p,%s,%p,%d)\n", block,subblock,buffer,*buflen ); @@ -1316,10 +1312,10 @@ DWORD WINAPI VerQueryValue16(SEGPTR segblock,LPCSTR subblock,SEGPTR *buffer, *buflen = db->datalen; if (db->btext) { xs = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b); - dprintf_ver(stderr,"->%s\n",xs); + dprintf_info(ver,"->%s\n",xs); HeapFree(GetProcessHeap(),0,xs); } else - dprintf_ver(stderr,"->%p\n",b); + dprintf_info(ver,"->%p\n",b); } else { struct dbA *db; b=_find_dataA(block,s,*(WORD*)block); @@ -1334,9 +1330,9 @@ DWORD WINAPI VerQueryValue16(SEGPTR segblock,LPCSTR subblock,SEGPTR *buffer, *buflen = db->datalen; /* the string is only printable, if it is below \\StringFileInfo*/ if (!lstrncmpi32A("VS_VERSION_INFO\\StringFileInfo\\",s,strlen("VS_VERSION_INFO\\StringFileInfo\\"))) - dprintf_ver(stddeb," -> %s=%s\n",subblock,b); + dprintf_info(ver," -> %s=%s\n",subblock,b); else - dprintf_ver(stddeb," -> %s=%p\n",subblock,b); + dprintf_info(ver," -> %s=%p\n",subblock,b); } *buffer = (b-block)+segblock; free(s); @@ -1349,7 +1345,7 @@ DWORD WINAPI VerQueryValue32A(LPVOID vblock,LPCSTR subblock, BYTE *b,*block=(LPBYTE)vblock,**buffer=(LPBYTE*)vbuffer; LPSTR s; - dprintf_ver(stddeb,"VerQueryValue32A(%p,%s,%p,%d)\n", + dprintf_info(ver,"VerQueryValue32A(%p,%s,%p,%d)\n", block,subblock,buffer,*buflen ); @@ -1378,10 +1374,10 @@ DWORD WINAPI VerQueryValue32A(LPVOID vblock,LPCSTR subblock, b = b+DATA_OFFSET_W(db); if (db->btext) { xs = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b); - dprintf_ver(stderr,"->%s\n",xs); + dprintf_info(ver,"->%s\n",xs); HeapFree(GetProcessHeap(),0,xs); } else - dprintf_ver(stderr,"->%p\n",b); + dprintf_info(ver,"->%p\n",b); /* This is a leak. */ b = HEAP_strdupWtoA(GetProcessHeap(),0,(WCHAR*)b); } else { @@ -1399,9 +1395,9 @@ DWORD WINAPI VerQueryValue32A(LPVOID vblock,LPCSTR subblock, /* the string is only printable, if it is below \\StringFileInfo*/ if (!lstrncmpi32A("VS_VERSION_INFO\\StringFileInfo\\",s,strlen("VS_VERSION_INFO\\StringFileInfo\\"))) - dprintf_ver(stddeb," -> %s=%s\n",subblock,b); + dprintf_info(ver," -> %s=%s\n",subblock,b); else - dprintf_ver(stddeb," -> %s=%p\n",subblock,b); + dprintf_info(ver," -> %s=%p\n",subblock,b); } *buffer = b; free(s); diff --git a/misc/version.c b/misc/version.c index b694a787632..971e758a925 100644 --- a/misc/version.c +++ b/misc/version.c @@ -294,6 +294,7 @@ BOOL16 WINAPI DiagQuery() * * writes a debug string into \bootlog.txt */ -void WINAPI DiagOutput() +void WINAPI DiagOutput(LPCSTR str) { + fprintf(stderr,"DIAGOUTPUT:%s\n",str); } diff --git a/misc/winsock.c b/misc/winsock.c index 835151d15f6..239c45600b5 100644 --- a/misc/winsock.c +++ b/misc/winsock.c @@ -44,7 +44,6 @@ #include "task.h" #include "message.h" #include "miscemu.h" -#include "stddebug.h" #include "debug.h" #define DEBUG_SOCKADDR 0 @@ -206,7 +205,7 @@ __inline__ static int sock_error_p(int s) optlen = sizeof(optval); getsockopt(s, SOL_SOCKET, SO_ERROR, &optval, &optlen); - if (optval) dprintf_winsock(stddeb, "\t[%i] error: %d\n", s, optval); + if (optval) dprintf_warn(winsock, "\t[%i] error: %d\n", s, optval); return optval != 0; } @@ -249,7 +248,7 @@ static int fd_set_export( LPWSINFO pwsi, fd_set* fds, fd_set* exceptfds, void* w if( b32 ) wsfds32->fd_count = j; else wsfds16->fd_count = j; - dprintf_winsock(stddeb, "\n"); + dprintf_info(winsock, "\n"); #undef wsfds32 #undef wsfds16 } @@ -304,7 +303,7 @@ INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA lpWSAData) HTASK16 tid = GetCurrentTask(); LPWSINFO pwsi; - dprintf_winsock(stddeb, "WSAStartup: verReq=%x\n", wVersionRequested); + dprintf_info(winsock, "WSAStartup: verReq=%x\n", wVersionRequested); if (LOBYTE(wVersionRequested) < 1 || (LOBYTE(wVersionRequested) == 1 && HIBYTE(wVersionRequested) < 1)) return WSAVERNOTSUPPORTED; @@ -359,7 +358,7 @@ INT16 WINAPI WSAStartup16(UINT16 wVersionRequested, LPWSADATA lpWSAData) memcpy(lpWSAData, &WINSOCK_data, sizeof(WINSOCK_data)); - dprintf_winsock(stddeb, "WSAStartup: succeeded\n"); + dprintf_info(winsock, "WSAStartup: succeeded\n"); return 0; } @@ -411,12 +410,12 @@ INT32 WINSOCK_DeleteTaskWSI( TDB* pTask, LPWSINFO pwsi ) WINSOCK_Shutdown(); /* just in case */ if( pwsi->flags & WSI_BLOCKINGCALL ) - dprintf_winsock(stddeb,"\tinside blocking call!\n"); + dprintf_info(winsock,"\tinside blocking call!\n"); /* FIXME: aop_control() doesn't decrement pwsi->num_async_rq * * if( pwsi->num_async_rq ) - * dprintf_winsock(stddeb,"\thave %i outstanding async ops!\n", pwsi->num_async_rq ); + * dprintf_warn(winsock,"\thave %i outstanding async ops!\n", pwsi->num_async_rq ); */ for(i = 0, j = 0, n = 0; i < WS_MAX_SOCKETS_PER_PROCESS; i++) @@ -430,7 +429,7 @@ INT32 WINSOCK_DeleteTaskWSI( TDB* pTask, LPWSINFO pwsi ) close(pwsi->sock[i].fd); j++; } if( j ) - dprintf_winsock(stddeb,"\tclosed %i sockets, killed %i async selects!\n", j, n); + dprintf_info(winsock,"\tclosed %i sockets, killed %i async selects!\n", j, n); /* delete scratch buffers */ @@ -448,7 +447,7 @@ INT32 WINAPI WSACleanup(void) { HTASK16 hTask = GetCurrentTask(); - dprintf_winsock(stddeb, "WSACleanup(%04x)\n", hTask ); + dprintf_info(winsock, "WSACleanup(%04x)\n", hTask ); if( hTask ) { LPWSINFO pwsi = wsi_find(hTask); @@ -467,14 +466,11 @@ INT32 WINAPI WSACleanup(void) */ INT32 WINAPI WSAGetLastError(void) { - LPWSINFO pwsi = wsi_find(GetCurrentTask()); - INT16 ret; + LPWSINFO pwsi = wsi_find(GetCurrentTask()); + INT16 ret = (pwsi) ? pwsi->err : WSANOTINITIALISED; - dprintf_winsock(stddeb, "WSAGetLastError(%08x)", (unsigned)pwsi); - - ret = (pwsi) ? pwsi->err : WSANOTINITIALISED; - - dprintf_winsock(stddeb, " = %i\n", (int)ret); + dprintf_info(winsock, "WSAGetLastError(%08x) = %i\n", + (unsigned)pwsi, (int)ret); return ret; } @@ -485,7 +481,7 @@ void WINAPI WSASetLastError32(INT32 iError) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WSASetLastError(%08x): %d\n", (unsigned)pwsi, (int)iError); + dprintf_info(winsock, "WSASetLastError(%08x): %d\n", (unsigned)pwsi, (int)iError); if( pwsi ) pwsi->err = iError; } @@ -526,7 +522,7 @@ SOCKET32 WINAPI WINSOCK_accept32(SOCKET32 s, struct sockaddr *addr, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR((SOCKET16)s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_ACCEPT(%08x): socket %04x\n", + dprintf_info(winsock, "WS_ACCEPT(%08x): socket %04x\n", (unsigned)pwsi, (UINT16)s ); if( _check_ws(pwsi, pws) ) { @@ -577,7 +573,7 @@ INT32 WINAPI WINSOCK_bind32(SOCKET32 s, struct sockaddr *name, INT32 namelen) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_BIND(%08x): socket %04x, ptr %8x, length %d\n", + dprintf_info(winsock, "WS_BIND(%08x): socket %04x, ptr %8x, length %d\n", (unsigned)pwsi, s, (int) name, namelen); #if DEBUG_SOCKADDR dump_sockaddr(name); @@ -589,7 +585,7 @@ INT32 WINAPI WINSOCK_bind32(SOCKET32 s, struct sockaddr *name, INT32 namelen) if ( bind(pws->fd, name, namelen) < 0 ) { int loc_errno = errno; - dprintf_winsock(stddeb,"\tfailure - errno = %i\n", errno); + dprintf_warn(winsock, "\tfailure - errno = %i\n", errno); errno = loc_errno; switch(errno) { @@ -620,7 +616,7 @@ INT32 WINAPI WINSOCK_closesocket32(SOCKET32 s) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_CLOSE(%08x): socket %08x\n", (unsigned)pwsi, s); + dprintf_info(winsock, "WS_CLOSE(%08x): socket %08x\n", (unsigned)pwsi, s); if( _check_ws(pwsi, pws) ) { @@ -655,7 +651,7 @@ INT32 WINAPI WINSOCK_connect32(SOCKET32 s, struct sockaddr *name, INT32 namelen) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_CONNECT(%08x): socket %04x, ptr %8x, length %d\n", + dprintf_info(winsock, "WS_CONNECT(%08x): socket %04x, ptr %8x, length %d\n", (unsigned)pwsi, s, (int) name, namelen); #if DEBUG_SOCKADDR dump_sockaddr(name); @@ -713,7 +709,7 @@ INT32 WINAPI WINSOCK_getpeername32(SOCKET32 s, struct sockaddr *name, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_GETPEERNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n", + dprintf_info(winsock, "WS_GETPEERNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n", (unsigned)pwsi, s, (int) name, *namelen); if( _check_ws(pwsi, pws) ) { @@ -750,7 +746,7 @@ INT32 WINAPI WINSOCK_getsockname32(SOCKET32 s, struct sockaddr *name, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_GETSOCKNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n", + dprintf_info(winsock, "WS_GETSOCKNAME(%08x): socket: %04x, ptr %8x, ptr %8x\n", (unsigned)pwsi, s, (int) name, (int) *namelen); if( _check_ws(pwsi, pws) ) { @@ -794,7 +790,7 @@ INT32 WINAPI WINSOCK_getsockopt32(SOCKET32 s, INT32 level, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n", + dprintf_info(winsock, "WS_GETSOCKOPT(%08x): socket: %04x, opt %d, ptr %8x, ptr %8x\n", (unsigned)pwsi, s, level, (int) optval, (int) *optlen); if( _check_ws(pwsi, pws) ) { @@ -887,7 +883,7 @@ INT32 WINAPI WINSOCK_ioctlsocket32(SOCKET32 s, UINT32 cmd, UINT32 *argp) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_IOCTL(%08x): socket %04x, cmd %08x, ptr %8x\n", + dprintf_info(winsock, "WS_IOCTL(%08x): socket %04x, cmd %08x, ptr %8x\n", (unsigned)pwsi, s, cmd, (unsigned) argp); if( _check_ws(pwsi, pws) ) { @@ -920,7 +916,7 @@ INT32 WINAPI WINSOCK_ioctlsocket32(SOCKET32 s, UINT32 cmd, UINT32 *argp) default: /* Netscape tries hard to use bogus ioctl 0x667e */ - dprintf_winsock(stddeb,"\tunknown WS_IOCTL cmd (%08x)\n", cmd); + dprintf_warn(winsock, "\tunknown WS_IOCTL cmd (%08x)\n", cmd); } if( ioctl(pws->fd, newcmd, (char*)argp ) == 0 ) return 0; pwsi->err = (errno == EBADF) ? WSAENOTSOCK : wsaErrno(); @@ -945,7 +941,7 @@ INT32 WINAPI WINSOCK_listen32(SOCKET32 s, INT32 backlog) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_LISTEN(%08x): socket %04x, backlog %d\n", + dprintf_info(winsock, "WS_LISTEN(%08x): socket %04x, backlog %d\n", (unsigned)pwsi, s, backlog); if( _check_ws(pwsi, pws) ) { @@ -983,14 +979,15 @@ INT32 WINAPI WINSOCK_recv32(SOCKET32 s, char *buf, INT32 len, INT32 flags) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_RECV(%08x): socket %04x, buf %8x, len %d, flags %d", - (unsigned)pwsi, s, (unsigned)buf, len, flags); + dprintf_info(winsock, "WS_RECV(%08x): socket %04x, buf %8x, len %d, " + "flags %d\n", (unsigned)pwsi, s, (unsigned)buf, + len, flags); if( _check_ws(pwsi, pws) ) { INT32 length; if ((length = recv(pws->fd, buf, len, flags)) >= 0) { - dprintf_winsock(stddeb, " -> %i bytes\n", length); + dprintf_info(winsock, " -> %i bytes\n", length); if( pws->psop && (pws->flags & (WS_FD_READ | WS_FD_CLOSE)) ) EVENT_AddIO( pws->fd, EVENT_IO_READ ); /* reenabler */ @@ -1000,7 +997,7 @@ INT32 WINAPI WINSOCK_recv32(SOCKET32 s, char *buf, INT32 len, INT32 flags) pwsi->err = wsaErrno(); } else if( pwsi ) pwsi->err = WSAENOTSOCK; - dprintf_winsock(stddeb, " -> ERROR\n"); + dprintf_warn(winsock, " -> ERROR\n"); return SOCKET_ERROR; } @@ -1022,8 +1019,9 @@ INT32 WINAPI WINSOCK_recvfrom32(SOCKET32 s, char *buf, INT32 len, INT32 flags, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_RECVFROM(%08x): socket %04x, ptr %08x, len %d, flags %d", - (unsigned)pwsi, s, (unsigned)buf, len, flags); + dprintf_info(winsock, "WS_RECVFROM(%08x): socket %04x, ptr %08x, " + "len %d, flags %d\n", (unsigned)pwsi, s, (unsigned)buf, + len, flags); #if DEBUG_SOCKADDR if( from ) dump_sockaddr(from); else fprintf(stderr, "\tfrom = NULL\n"); @@ -1035,7 +1033,7 @@ INT32 WINAPI WINSOCK_recvfrom32(SOCKET32 s, char *buf, INT32 len, INT32 flags, if ((length = recvfrom(pws->fd, buf, len, flags, from, fromlen32)) >= 0) { - dprintf_winsock(stddeb, " -> %i bytes\n", length); + dprintf_info(winsock, " -> %i bytes\n", length); if( pws->psop && (pws->flags & (WS_FD_READ | WS_FD_CLOSE)) ) EVENT_AddIO( pws->fd, EVENT_IO_READ ); /* reenabler */ @@ -1045,7 +1043,7 @@ INT32 WINAPI WINSOCK_recvfrom32(SOCKET32 s, char *buf, INT32 len, INT32 flags, pwsi->err = wsaErrno(); } else if( pwsi ) pwsi->err = WSAENOTSOCK; - dprintf_winsock(stddeb, " -> ERROR\n"); + dprintf_warn(winsock, " -> ERROR\n"); return SOCKET_ERROR; } @@ -1073,7 +1071,7 @@ static INT32 __ws_select( BOOL32 b32, void *ws_readfds, void *ws_writefds, void { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SELECT(%08x): read %8x, write %8x, excp %8x\n", + dprintf_info(winsock, "WS_SELECT(%08x): read %8x, write %8x, excp %8x\n", (unsigned) pwsi, (unsigned) ws_readfds, (unsigned) ws_writefds, (unsigned) ws_exceptfds); if( pwsi ) @@ -1152,7 +1150,7 @@ INT32 WINAPI WINSOCK_send32(SOCKET32 s, char *buf, INT32 len, INT32 flags) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SEND(%08x): socket %04x, ptr %08x, length %d, flags %d\n", + dprintf_info(winsock, "WS_SEND(%08x): socket %04x, ptr %08x, length %d, flags %d\n", (unsigned)pwsi, s, (unsigned) buf, len, flags); if( _check_ws(pwsi, pws) ) { @@ -1188,7 +1186,7 @@ INT32 WINAPI WINSOCK_sendto32(SOCKET32 s, char *buf, INT32 len, INT32 flags, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SENDTO(%08x): socket %04x, ptr %08x, length %d, flags %d\n", + dprintf_info(winsock, "WS_SENDTO(%08x): socket %04x, ptr %08x, length %d, flags %d\n", (unsigned)pwsi, s, (unsigned) buf, len, flags); if( _check_ws(pwsi, pws) ) { @@ -1225,7 +1223,7 @@ INT32 WINAPI WINSOCK_setsockopt32(SOCKET16 s, INT32 level, INT32 optname, ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SETSOCKOPT(%08x): socket %04x, lev %d, opt %d, ptr %08x, len %d\n", + dprintf_info(winsock, "WS_SETSOCKOPT(%08x): socket %04x, lev %d, opt %d, ptr %08x, len %d\n", (unsigned)pwsi, s, level, optname, (int) optval, optlen); if( _check_ws(pwsi, pws) ) { @@ -1265,7 +1263,7 @@ INT32 WINAPI WINSOCK_shutdown32(SOCKET32 s, INT32 how) ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SHUTDOWN(%08x): socket %04x, how %i\n", + dprintf_info(winsock, "WS_SHUTDOWN(%08x): socket %04x, how %i\n", (unsigned)pwsi, s, how ); if( _check_ws(pwsi, pws) ) { @@ -1330,7 +1328,7 @@ SOCKET32 WINAPI WINSOCK_socket32(INT32 af, INT32 type, INT32 protocol) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SOCKET(%08x): af=%d type=%d protocol=%d\n", + dprintf_info(winsock, "WS_SOCKET(%08x): af=%d type=%d protocol=%d\n", (unsigned)pwsi, af, type, protocol); if( pwsi ) @@ -1374,7 +1372,7 @@ SOCKET32 WINAPI WINSOCK_socket32(INT32 af, INT32 type, INT32 protocol) { ws_socket* pnew = wsi_alloc_socket(pwsi, sock); - dprintf_winsock(stddeb,"\tcreated %i (handle %04x)\n", sock, (UINT16)WS_PTR2HANDLE(pnew)); + dprintf_info(winsock,"\tcreated %i (handle %04x)\n", sock, (UINT16)WS_PTR2HANDLE(pnew)); if( pnew ) { @@ -1394,7 +1392,7 @@ SOCKET32 WINAPI WINSOCK_socket32(INT32 af, INT32 type, INT32 protocol) } else pwsi->err = wsaErrno(); } - dprintf_winsock(stddeb, "\t\tfailed!\n"); + dprintf_warn(winsock, "\t\tfailed!\n"); return INVALID_SOCKET32; } @@ -1441,7 +1439,7 @@ static struct WIN_hostent* __ws_gethostbyaddr(const char *addr, int len, int typ SEGPTR WINAPI WINSOCK_gethostbyaddr16(const char *addr, INT16 len, INT16 type) { struct WIN_hostent* retval; - dprintf_winsock(stddeb, "WS_GetHostByAddr16: ptr %08x, len %d, type %d\n", + dprintf_info(winsock, "WS_GetHostByAddr16: ptr %08x, len %d, type %d\n", (unsigned) addr, len, type); retval = __ws_gethostbyaddr( addr, len, type, WS_DUP_SEGPTR ); return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL); @@ -1450,7 +1448,7 @@ SEGPTR WINAPI WINSOCK_gethostbyaddr16(const char *addr, INT16 len, INT16 type) struct WIN_hostent* WINAPI WINSOCK_gethostbyaddr32(const char *addr, INT32 len, INT32 type) { - dprintf_winsock(stddeb, "WS_GetHostByAddr32: ptr %08x, len %d, type %d\n", + dprintf_info(winsock, "WS_GetHostByAddr32: ptr %08x, len %d, type %d\n", (unsigned) addr, len, type); return __ws_gethostbyaddr(addr, len, type, WS_DUP_LINEAR); } @@ -1477,14 +1475,14 @@ static struct WIN_hostent * __ws_gethostbyname(const char *name, int dup_flag) SEGPTR WINAPI WINSOCK_gethostbyname16(const char *name) { struct WIN_hostent* retval; - dprintf_winsock(stddeb, "WS_GetHostByName16: %s\n", (name)?name:NULL_STRING); + dprintf_info(winsock, "WS_GetHostByName16: %s\n", (name)?name:NULL_STRING); retval = __ws_gethostbyname( name, WS_DUP_SEGPTR ); return (retval)? SEGPTR_GET(retval) : ((SEGPTR)NULL) ; } struct WIN_hostent* WINAPI WINSOCK_gethostbyname32(const char* name) { - dprintf_winsock(stddeb, "WS_GetHostByName32: %s\n", (name)?name:NULL_STRING); + dprintf_info(winsock, "WS_GetHostByName32: %s\n", (name)?name:NULL_STRING); return __ws_gethostbyname( name, WS_DUP_LINEAR ); } @@ -1511,14 +1509,14 @@ static struct WIN_protoent* __ws_getprotobyname(const char *name, int dup_flag) SEGPTR WINAPI WINSOCK_getprotobyname16(const char *name) { struct WIN_protoent* retval; - dprintf_winsock(stddeb, "WS_GetProtoByName16: %s\n", (name)?name:NULL_STRING); + dprintf_info(winsock, "WS_GetProtoByName16: %s\n", (name)?name:NULL_STRING); retval = __ws_getprotobyname(name, WS_DUP_SEGPTR); return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL); } struct WIN_protoent* WINAPI WINSOCK_getprotobyname32(const char* name) { - dprintf_winsock(stddeb, "WS_GetProtoByName32: %s\n", (name)?name:NULL_STRING); + dprintf_info(winsock, "WS_GetProtoByName32: %s\n", (name)?name:NULL_STRING); return __ws_getprotobyname(name, WS_DUP_LINEAR); } @@ -1545,14 +1543,14 @@ static struct WIN_protoent* __ws_getprotobynumber(int number, int dup_flag) SEGPTR WINAPI WINSOCK_getprotobynumber16(INT16 number) { struct WIN_protoent* retval; - dprintf_winsock(stddeb, "WS_GetProtoByNumber16: %i\n", number); + dprintf_info(winsock, "WS_GetProtoByNumber16: %i\n", number); retval = __ws_getprotobynumber(number, WS_DUP_SEGPTR); return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL); } struct WIN_protoent* WINAPI WINSOCK_getprotobynumber32(INT32 number) { - dprintf_winsock(stddeb, "WS_GetProtoByNumber32: %i\n", number); + dprintf_info(winsock, "WS_GetProtoByNumber32: %i\n", number); return __ws_getprotobynumber(number, WS_DUP_LINEAR); } @@ -1583,7 +1581,7 @@ struct WIN_servent* __ws_getservbyname(const char *name, const char *proto, int SEGPTR WINAPI WINSOCK_getservbyname16(const char *name, const char *proto) { struct WIN_servent* retval; - dprintf_winsock(stddeb, "WS_GetServByName16: '%s', '%s'\n", + dprintf_info(winsock, "WS_GetServByName16: '%s', '%s'\n", (name)?name:NULL_STRING, (proto)?proto:NULL_STRING); retval = __ws_getservbyname(name, proto, WS_DUP_SEGPTR); return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL); @@ -1591,7 +1589,7 @@ SEGPTR WINAPI WINSOCK_getservbyname16(const char *name, const char *proto) struct WIN_servent* WINAPI WINSOCK_getservbyname32(const char *name, const char *proto) { - dprintf_winsock(stddeb, "WS_GetServByName32: '%s', '%s'\n", + dprintf_info(winsock, "WS_GetServByName32: '%s', '%s'\n", (name)?name:NULL_STRING, (proto)?proto:NULL_STRING); return __ws_getservbyname(name, proto, WS_DUP_LINEAR); } @@ -1623,7 +1621,7 @@ static struct WIN_servent* __ws_getservbyport(int port, const char* proto, int d SEGPTR WINAPI WINSOCK_getservbyport16(INT16 port, const char *proto) { struct WIN_servent* retval; - dprintf_winsock(stddeb, "WS_GetServByPort16: %i, '%s'\n", + dprintf_info(winsock, "WS_GetServByPort16: %i, '%s'\n", (int)port, (proto)?proto:NULL_STRING); retval = __ws_getservbyport(port, proto, WS_DUP_SEGPTR); return retval ? SEGPTR_GET(retval) : ((SEGPTR)NULL); @@ -1631,7 +1629,7 @@ SEGPTR WINAPI WINSOCK_getservbyport16(INT16 port, const char *proto) struct WIN_servent* WINAPI WINSOCK_getservbyport32(INT32 port, const char *proto) { - dprintf_winsock(stddeb, "WS_GetServByPort32: %i, '%s'\n", + dprintf_info(winsock, "WS_GetServByPort32: %i, '%s'\n", (int)port, (proto)?proto:NULL_STRING); return __ws_getservbyport(port, proto, WS_DUP_LINEAR); } @@ -1644,7 +1642,7 @@ INT32 WINAPI WINSOCK_gethostname32(char *name, INT32 namelen) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_GetHostName(%08x): name %s, len %d\n", + dprintf_info(winsock, "WS_GetHostName(%08x): name %s, len %d\n", (unsigned)pwsi, (name)?name:NULL_STRING, namelen); if( pwsi ) { @@ -1684,7 +1682,7 @@ HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 uMsg, LPCSTR addr, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetHostByAddr16(%08x): hwnd %04x, msg %04x, addr %08x[%i]\n", + dprintf_info(winsock, "WS_AsyncGetHostByAddr16(%08x): hwnd %04x, msg %04x, addr %08x[%i]\n", (unsigned)pwsi, hWnd, uMsg, (unsigned)addr , len ); if( pwsi ) @@ -1701,7 +1699,7 @@ HANDLE32 WINAPI WSAAsyncGetHostByAddr32(HWND32 hWnd, UINT32 uMsg, LPCSTR addr, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetHostByAddr32(%08x): hwnd %04x, msg %08x, addr %08x[%i]\n", + dprintf_info(winsock, "WS_AsyncGetHostByAddr32(%08x): hwnd %04x, msg %08x, addr %08x[%i]\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (unsigned)addr , len ); if( pwsi ) @@ -1719,7 +1717,7 @@ HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetHostByName16(%08x): hwnd %04x, msg %04x, host %s, + dprintf_info(winsock, "WS_AsyncGetHostByName16(%08x): hwnd %04x, msg %04x, host %s, buffer %i\n", (unsigned)pwsi, hWnd, uMsg, (name)?name:NULL_STRING, (int)buflen ); if( pwsi ) @@ -1735,7 +1733,7 @@ HANDLE32 WINAPI WSAAsyncGetHostByName32(HWND32 hWnd, UINT32 uMsg, LPCSTR name, LPSTR sbuf, INT32 buflen) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetHostByName32(%08x): hwnd %04x, msg %08x, host %s, + dprintf_info(winsock, "WS_AsyncGetHostByName32(%08x): hwnd %04x, msg %08x, host %s, buffer %i\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING, (int)buflen ); if( pwsi ) return __WSAsyncDBQuery(pwsi, hWnd, uMsg, 0, name, 0, @@ -1752,7 +1750,7 @@ HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetProtoByName16(%08x): hwnd %04x, msg %08x, protocol %s\n", + dprintf_info(winsock, "WS_AsyncGetProtoByName16(%08x): hwnd %04x, msg %08x, protocol %s\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING ); if( pwsi ) @@ -1769,7 +1767,7 @@ HANDLE32 WINAPI WSAAsyncGetProtoByName32(HWND32 hWnd, UINT32 uMsg, LPCSTR name, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetProtoByName32(%08x): hwnd %04x, msg %08x, protocol %s\n", + dprintf_info(winsock, "WS_AsyncGetProtoByName32(%08x): hwnd %04x, msg %08x, protocol %s\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING ); if( pwsi ) @@ -1787,7 +1785,7 @@ HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd, UINT16 uMsg, INT16 numbe { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetProtoByNumber16(%08x): hwnd %04x, msg %04x, num %i\n", + dprintf_info(winsock, "WS_AsyncGetProtoByNumber16(%08x): hwnd %04x, msg %04x, num %i\n", (unsigned)pwsi, hWnd, uMsg, number ); if( pwsi ) @@ -1804,7 +1802,7 @@ HANDLE32 WINAPI WSAAsyncGetProtoByNumber32(HWND32 hWnd, UINT32 uMsg, INT32 numbe { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetProtoByNumber32(%08x): hwnd %04x, msg %08x, num %i\n", + dprintf_info(winsock, "WS_AsyncGetProtoByNumber32(%08x): hwnd %04x, msg %08x, num %i\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, number ); if( pwsi ) @@ -1822,7 +1820,7 @@ HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetServByName16(%08x): hwnd %04x, msg %04x, name %s, proto %s\n", + dprintf_info(winsock, "WS_AsyncGetServByName16(%08x): hwnd %04x, msg %04x, name %s, proto %s\n", (unsigned)pwsi, hWnd, uMsg, (name)?name:NULL_STRING, (proto)?proto:NULL_STRING ); if( pwsi ) @@ -1844,7 +1842,7 @@ HANDLE32 WINAPI WSAAsyncGetServByName32(HWND32 hWnd, UINT32 uMsg, LPCSTR name, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetServByName32(%08x): hwnd %04x, msg %08x, name %s, proto %s\n", + dprintf_info(winsock, "WS_AsyncGetServByName32(%08x): hwnd %04x, msg %08x, name %s, proto %s\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, (name)?name:NULL_STRING, (proto)?proto:NULL_STRING ); if( pwsi ) { @@ -1866,7 +1864,7 @@ HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 uMsg, INT16 port, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetServByPort16(%08x): hwnd %04x, msg %04x, port %i, proto %s\n", + dprintf_info(winsock, "WS_AsyncGetServByPort16(%08x): hwnd %04x, msg %04x, port %i, proto %s\n", (unsigned)pwsi, hWnd, uMsg, port, (proto)?proto:NULL_STRING ); if( pwsi ) @@ -1888,7 +1886,7 @@ HANDLE32 WINAPI WSAAsyncGetServByPort32(HWND32 hWnd, UINT32 uMsg, INT32 port, { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncGetServByPort32(%08x): hwnd %04x, msg %08x, port %i, proto %s\n", + dprintf_info(winsock, "WS_AsyncGetServByPort32(%08x): hwnd %04x, msg %08x, port %i, proto %s\n", (unsigned)pwsi, (HWND16)hWnd, uMsg, port, (proto)?proto:NULL_STRING ); if( pwsi ) @@ -1912,7 +1910,7 @@ INT32 WINAPI WSACancelAsyncRequest32(HANDLE32 hAsyncTaskHandle) LPWSINFO pwsi = wsi_find(GetCurrentTask()); ws_async_op* p_aop = (ws_async_op*)WS_HANDLE2PTR(hAsyncTaskHandle); - dprintf_winsock(stddeb, "WS_CancelAsyncRequest(%08x): handle %08x\n", + dprintf_info(winsock, "WS_CancelAsyncRequest(%08x): handle %08x\n", (unsigned)pwsi, hAsyncTaskHandle); if( pwsi ) { @@ -1952,7 +1950,7 @@ BOOL32 WINSOCK_HandleIO( int* max_fd, int num_pending, DWORD dwEvent, dwErrBytes; int num_posted; - dprintf_winsock(stddeb,"WINSOCK_HandleIO: %i pending descriptors\n", num_pending ); + dprintf_info(winsock,"WINSOCK_HandleIO: %i pending descriptors\n", num_pending ); for( num_posted = dwEvent = 0 ; psop; psop = psop->next ) { @@ -1970,7 +1968,7 @@ BOOL32 WINSOCK_HandleIO( int* max_fd, int num_pending, * Reenabling calls turn them back on. */ - dprintf_winsock(stddeb,"\tchecking psop = 0x%08x\n", (unsigned) psop ); + dprintf_info(winsock,"\tchecking psop = 0x%08x\n", (unsigned) psop ); num_pending--; @@ -2046,7 +2044,7 @@ BOOL32 WINSOCK_HandleIO( int* max_fd, int num_pending, if( PostMessage32A( psop->hWnd, psop->uMsg, (WPARAM32)WS_PTR2HANDLE(psop->pws), (LPARAM)WSAMAKESELECTREPLY( WS_FD_WRITE, 0 ) ) ) { - dprintf_winsock(stddeb, "\t hwnd %04x - %04x, %08x\n", + dprintf_info(winsock, "\t hwnd %04x - %04x, %08x\n", psop->hWnd, psop->uMsg, (unsigned)MAKELONG(WS_FD_WRITE, 0) ); FD_CLR( fd, &event_set[EVENT_IO_WRITE] ); num_posted++; @@ -2108,7 +2106,7 @@ BOOL32 WINSOCK_HandleIO( int* max_fd, int num_pending, if( bPost ) { - dprintf_winsock(stddeb, "\t hwnd %04x - %04x, %08x\n", + dprintf_info(winsock, "\t hwnd %04x - %04x, %08x\n", psop->hWnd, psop->uMsg, (unsigned)dwEvent ); PostMessage32A( psop->hWnd, psop->uMsg, (WPARAM32)WS_PTR2HANDLE(psop->pws), (LPARAM)dwEvent ); @@ -2119,7 +2117,7 @@ BOOL32 WINSOCK_HandleIO( int* max_fd, int num_pending, if( num_pending <= 0 ) break; } - dprintf_winsock(stddeb, "\tdone, %i posted events\n", num_posted ); + dprintf_info(winsock, "\tdone, %i posted events\n", num_posted ); return ( num_posted ) ? TRUE : FALSE; } @@ -2128,7 +2126,7 @@ INT32 WINAPI WSAAsyncSelect32(SOCKET32 s, HWND32 hWnd, UINT32 uMsg, UINT32 lEven ws_socket* pws = (ws_socket*)WS_HANDLE2PTR(s); LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_AsyncSelect(%08x): %04x, hWnd %04x, uMsg %08x, event %08x\n", + dprintf_info(winsock, "WS_AsyncSelect(%08x): %04x, hWnd %04x, uMsg %08x, event %08x\n", (unsigned)pwsi, (SOCKET16)s, (HWND16)hWnd, uMsg, (unsigned)lEvent ); if( _check_ws(pwsi, pws) ) { @@ -2149,7 +2147,7 @@ INT32 WINAPI WSAAsyncSelect32(SOCKET32 s, HWND32 hWnd, UINT32 uMsg, UINT32 lEven if( pws->flags & (WS_FD_CONNECT | WS_FD_WRITE) ) EVENT_DeleteIO( pws->fd, EVENT_IO_WRITE ); - dprintf_winsock(stddeb,"\tremoving psop = 0x%08x\n", (unsigned) psop ); + dprintf_info(winsock,"\tremoving psop = 0x%08x\n", (unsigned) psop ); WS_FREE( pws->psop ); pws->flags &= ~(WS_FD_RAW | WS_FD_ACCEPT | WS_FD_CONNECT | @@ -2188,7 +2186,7 @@ INT32 WINAPI WSAAsyncSelect32(SOCKET32 s, HWND32 hWnd, UINT32 uMsg, UINT32 lEven /* TODO: handle WS_FD_ACCEPT right away if the socket is readable */ - dprintf_winsock(stddeb,"\tcreating psop = 0x%08x\n", (unsigned)psop ); + dprintf_info(winsock,"\tcreating psop = 0x%08x\n", (unsigned)psop ); return 0; /* success */ } @@ -2213,7 +2211,7 @@ INT16 WINAPI __WSAFDIsSet16(SOCKET16 s, ws_fd_set16 *set) { int i = set->fd_count; - dprintf_winsock(stddeb, "__WSAFDIsSet16(%d,%8lx(%i))\n", s,(unsigned long)set, i); + dprintf_info(winsock, "__WSAFDIsSet16(%d,%8lx(%i))\n", s,(unsigned long)set, i); while (i--) if (set->fd_array[i] == s) return 1; @@ -2227,7 +2225,7 @@ INT32 WINAPI __WSAFDIsSet32(SOCKET32 s, ws_fd_set32 *set) { int i = set->fd_count; - dprintf_winsock(stddeb, "__WSAFDIsSet32(%d,%8lx(%i))\n", s,(unsigned long)set, i); + dprintf_info(winsock, "__WSAFDIsSet32(%d,%8lx(%i))\n", s,(unsigned long)set, i); while (i--) if (set->fd_array[i] == s) return 1; @@ -2247,7 +2245,7 @@ BOOL32 WINAPI WSAIsBlocking(void) * Note: It is allowed to call this function without prior WSAStartup(). */ - dprintf_winsock(stddeb, "WS_IsBlocking()\n"); + dprintf_info(winsock, "WS_IsBlocking()\n"); return FALSE; } @@ -2258,7 +2256,7 @@ INT32 WINAPI WSACancelBlockingCall(void) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_CancelBlockingCall(%08x)\n", (unsigned)pwsi); + dprintf_info(winsock, "WS_CancelBlockingCall(%08x)\n", (unsigned)pwsi); if( pwsi ) return 0; return SOCKET_ERROR; @@ -2273,7 +2271,7 @@ FARPROC16 WINAPI WSASetBlockingHook16(FARPROC16 lpBlockFunc) FARPROC16 prev; LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SetBlockingHook16(%08x): hook %08x\n", + dprintf_info(winsock, "WS_SetBlockingHook16(%08x): hook %08x\n", (unsigned)pwsi, (unsigned) lpBlockFunc); if( pwsi ) { @@ -2294,7 +2292,7 @@ FARPROC32 WINAPI WSASetBlockingHook32(FARPROC32 lpBlockFunc) FARPROC32 prev; LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_SetBlockingHook32(%08x): hook %08x\n", + dprintf_info(winsock, "WS_SetBlockingHook32(%08x): hook %08x\n", (unsigned)pwsi, (unsigned) lpBlockFunc); if( pwsi ) { prev = (FARPROC32)pwsi->blocking_hook; @@ -2313,7 +2311,7 @@ INT16 WINAPI WSAUnhookBlockingHook16(void) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_UnhookBlockingHook16(%08x)\n", (unsigned)pwsi); + dprintf_info(winsock, "WS_UnhookBlockingHook16(%08x)\n", (unsigned)pwsi); if( pwsi ) return (INT16)(pwsi->blocking_hook = 0); return SOCKET_ERROR; } @@ -2326,7 +2324,7 @@ INT32 WINAPI WSAUnhookBlockingHook32(void) { LPWSINFO pwsi = wsi_find(GetCurrentTask()); - dprintf_winsock(stddeb, "WS_UnhookBlockingHook32(%08x)\n", (unsigned)pwsi); + dprintf_info(winsock, "WS_UnhookBlockingHook32(%08x)\n", (unsigned)pwsi); if( pwsi ) { pwsi->blocking_hook = 0; @@ -2573,10 +2571,10 @@ UINT16 wsaErrno(void) { int loc_errno = errno; #if defined(__FreeBSD__) - dprintf_winsock(stderr, "winsock: errno %d, (%s).\n", + dprintf_err(winsock, "winsock: errno %d, (%s).\n", errno, strerror(errno)); #else - dprintf_winsock(stderr, "winsock: errno %d\n", errno); + dprintf_err(winsock, "winsock: errno %d\n", errno); #endif switch(loc_errno) @@ -2648,13 +2646,10 @@ UINT16 wsaHerrno(void) int loc_errno = h_errno; #if defined(__FreeBSD__) - dprintf_winsock(stderr, "winsock: h_errno %d, (%s).\n", + dprintf_err(winsock, "winsock: h_errno %d, (%s).\n", h_errno, strerror(h_errno)); #else - dprintf_winsock(stderr, "winsock: h_errno %d.\n", h_errno); -#ifndef sun - if( debugging_winsock ) herror("wine: winsock: wsaherrno"); -#endif + dprintf_err(winsock, "winsock: h_errno %d.\n", h_errno); #endif switch(loc_errno) diff --git a/misc/winsock_dns.c b/misc/winsock_dns.c index 4150b9c2e8d..029d973311c 100644 --- a/misc/winsock_dns.c +++ b/misc/winsock_dns.c @@ -136,7 +136,7 @@ void WINSOCK_cancel_task_aops(HTASK16 hTask, void (*__opfree)(void*)) int num = 0; ws_async_op* p, *next; - dprintf_winsock(stddeb,"\tcancelling async DNS requests... "); + dprintf_info(winsock," cancelling async DNS requests... \n"); SIGNAL_MaskAsyncEvents( TRUE ); next = __async_op_list; @@ -153,7 +153,7 @@ void WINSOCK_cancel_task_aops(HTASK16 hTask, void (*__opfree)(void*)) } } SIGNAL_MaskAsyncEvents( FALSE ); - dprintf_winsock(stddeb,"%i total\n", num ); + dprintf_info(winsock," -> %i total\n", num ); } void WINSOCK_link_async_op(ws_async_op* p_aop) @@ -176,7 +176,7 @@ void WINSOCK_link_async_op(ws_async_op* p_aop) { ws_async_op* dead = p; - dprintf_winsock(stddeb,"\treaping dead aop [%08x]\n", (unsigned)p ); + dprintf_info(winsock,"\treaping dead aop [%08x]\n", (unsigned)p ); p = p->next; WINSOCK_unlink_async_op( dead ); @@ -343,7 +343,7 @@ HANDLE16 __WSAsyncDBQuery(LPWSINFO pwsi, HWND32 hWnd, UINT32 uMsg, INT32 type, L async_ctl.ws_aop->pid = fork(); if( async_ctl.ws_aop->pid ) { - dprintf_winsock(stddeb, "\tasync_op = %04x (child %i)\n", + dprintf_info(winsock, "\tasync_op = %04x (child %i)\n", handle, async_ctl.ws_aop->pid); close(async_ctl.ws_aop->fd[1]); /* write endpoint */ @@ -452,7 +452,7 @@ void WS_do_async_gethost(LPWSINFO pwsi, unsigned flag ) : gethostbyaddr(async_ctl.rq.name, async_ctl.ilength, async_ctl.type); - dprintf_winsock(stddeb,"DNS: got hostent for [%s]\n", async_ctl.rq.name ); + dprintf_info(winsock,"DNS: got hostent for [%s]\n", async_ctl.rq.name ); if( p_he ) /* convert to the Winsock format with internal pointers as offsets */ size = WS_dup_he(pwsi, p_he, WS_DUP_OFFSET | @@ -476,7 +476,7 @@ void WS_do_async_getproto(LPWSINFO pwsi, unsigned flag ) ? getprotobyname(async_ctl.rq.name) : getprotobynumber(async_ctl.type); - dprintf_winsock(stddeb,"DNS: got protoent for [%s]\n", async_ctl.rq.name ); + dprintf_info(winsock,"DNS: got protoent for [%s]\n", async_ctl.rq.name ); if( p_pe ) /* convert to the Winsock format with internal pointers as offsets */ size = WS_dup_pe(pwsi, p_pe, WS_DUP_OFFSET | diff --git a/misc/wsprintf.c b/misc/wsprintf.c index 936afd0b129..043f5e96821 100644 --- a/misc/wsprintf.c +++ b/misc/wsprintf.c @@ -11,7 +11,7 @@ #include "ldt.h" #include "stackframe.h" #include "debug.h" -#include "stddebug.h" + #define WPRINTF_LEFTALIGN 0x0001 /* Align output on the left ('-' prefix) */ #define WPRINTF_PREFIX_HEX 0x0002 /* Prefix hex with 0x ('#' prefix) */ @@ -396,7 +396,7 @@ INT32 WINAPI wvsnprintf32A( LPSTR buffer, UINT32 maxlen, LPCSTR spec, maxlen -= len; } *p = 0; - dprintf_string(stddeb,"%s\n",buffer); + dprintf_info(string,"%s\n",buffer); return (maxlen > 1) ? (INT32)(p - buffer) : -1; } @@ -477,7 +477,7 @@ INT32 WINAPI wvsnprintf32W( LPWSTR buffer, UINT32 maxlen, LPCWSTR spec, */ INT16 WINAPI wvsprintf16( LPSTR buffer, LPCSTR spec, LPCVOID args ) { - dprintf_string(stddeb,"wvsprintf16 for %p got ",buffer); + dprintf_info(string,"wvsprintf16 for %p got:\n",buffer); return wvsnprintf16( buffer, 0xffff, spec, args ); } @@ -487,7 +487,7 @@ INT16 WINAPI wvsprintf16( LPSTR buffer, LPCSTR spec, LPCVOID args ) */ INT32 WINAPI wvsprintf32A( LPSTR buffer, LPCSTR spec, va_list args ) { - dprintf_string(stddeb,"wvsprintf32A for %p got ",buffer); + dprintf_info(string,"wvsprintf32A for %p got:\n",buffer); return wvsnprintf32A( buffer, 0xffffffff, spec, args ); } @@ -497,7 +497,7 @@ INT32 WINAPI wvsprintf32A( LPSTR buffer, LPCSTR spec, va_list args ) */ INT32 WINAPI wvsprintf32W( LPWSTR buffer, LPCWSTR spec, va_list args ) { - dprintf_string(stddeb,"wvsprintf32W for %p got ",buffer); + dprintf_info(string,"wvsprintf32W for %p got:\n",buffer); return wvsnprintf32W( buffer, 0xffffffff, spec, args ); } @@ -511,7 +511,7 @@ INT16 WINAPIV wsprintf16( LPSTR buffer, LPCSTR spec, ... ) va_list valist; INT16 res; - dprintf_string(stddeb,"wsprintf16 for %p got ",buffer); + dprintf_info(string,"wsprintf16 for %p got:\n",buffer); va_start( valist, spec ); /* Note: we call the 32-bit version, because the args are 32-bit */ res = (INT16)wvsnprintf32A( buffer, 0xffffffff, spec, valist ); @@ -529,7 +529,7 @@ INT16 WINAPIV WIN16_wsprintf16(void) VA_START16( valist ); buffer = VA_ARG16( valist, SEGPTR ); spec = VA_ARG16( valist, SEGPTR ); - dprintf_string(stddeb,"WIN16_wsprintf16 got "); + dprintf_info(string,"WIN16_wsprintf16 got:\n"); res = wvsnprintf16( (LPSTR)PTR_SEG_TO_LIN(buffer), 0xffff, (LPCSTR)PTR_SEG_TO_LIN(spec), valist ); VA_END16( valist ); @@ -545,7 +545,7 @@ INT32 WINAPIV wsprintf32A( LPSTR buffer, LPCSTR spec, ... ) va_list valist; INT32 res; - dprintf_string(stddeb,"wsprintf32A for %p got ",buffer); + dprintf_info(string,"wsprintf32A for %p got:\n",buffer); va_start( valist, spec ); res = wvsnprintf32A( buffer, 0xffffffff, spec, valist ); va_end( valist ); @@ -561,7 +561,7 @@ INT32 WINAPIV wsprintf32W( LPWSTR buffer, LPCWSTR spec, ... ) va_list valist; INT32 res; - dprintf_string(stddeb,"wsprintf32W for %p\n",buffer); + dprintf_info(string,"wsprintf32W for %p\n",buffer); va_start( valist, spec ); res = wvsnprintf32W( buffer, 0xffffffff, spec, valist ); va_end( valist ); diff --git a/miscemu/emulate.c b/miscemu/emulate.c index 6e5ec585be1..9261eaad679 100644 --- a/miscemu/emulate.c +++ b/miscemu/emulate.c @@ -1,8 +1,6 @@ #include #include #include "miscemu.h" -#include "stddebug.h" -/* #define DEBUG_INT */ #include "debug.h" struct Win87EmInfoStruct @@ -30,7 +28,7 @@ struct Win87EmInfoStruct void WINAPI WIN87_fpmath( CONTEXT *context ) { - dprintf_int(stddeb, "_fpmath: (cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx==%04x)\n", + dprintf_info(int, "_fpmath: (cs:eip=%x:%lx es=%x bx=%04x ax=%04x dx==%04x)\n", (WORD)CS_reg(context), EIP_reg(context), (WORD)ES_reg(context), BX_reg(context), AX_reg(context), DX_reg(context) ); @@ -76,7 +74,7 @@ void WINAPI WIN87_fpmath( CONTEXT *context ) */ /* FIXME: could someone who really understands asm() fix this please? --AJ */ /* __asm__("fistp %0;wait" : "=m" (dw) : : "memory"); */ - dprintf_int(stddeb,"emulate.c:On top of stack was %ld\n",dw); + dprintf_info(int,"emulate.c:On top of stack was %ld\n",dw); AX_reg(context) = LOWORD(dw); DX_reg(context) = HIWORD(dw); } @@ -110,18 +108,18 @@ void WINAPI WIN87_fpmath( CONTEXT *context ) void WINAPI WIN87_WinEm87Info(struct Win87EmInfoStruct *pWIS, int cbWin87EmInfoStruct) { - dprintf_int(stddeb, "__WinEm87Info(%p,%d)\n",pWIS,cbWin87EmInfoStruct); + dprintf_info(int, "__WinEm87Info(%p,%d)\n",pWIS,cbWin87EmInfoStruct); } void WINAPI WIN87_WinEm87Restore(void *pWin87EmSaveArea, int cbWin87EmSaveArea) { - dprintf_int(stddeb, "__WinEm87Restore(%p,%d)\n", + dprintf_info(int, "__WinEm87Restore(%p,%d)\n", pWin87EmSaveArea,cbWin87EmSaveArea); } void WINAPI WIN87_WinEm87Save(void *pWin87EmSaveArea, int cbWin87EmSaveArea) { - dprintf_int(stddeb, "__WinEm87Save(%p,%d)\n", + dprintf_info(int, "__WinEm87Save(%p,%d)\n", pWin87EmSaveArea,cbWin87EmSaveArea); } diff --git a/msdos/dosmem.c b/msdos/dosmem.c index ba866a44256..8c326dbf03d 100644 --- a/msdos/dosmem.c +++ b/msdos/dosmem.c @@ -226,6 +226,7 @@ void DOSMEM_InitExports(HMODULE16 hKernel) DOSMEM_dosmem+(addr), 0x10000, hKernel, \ FALSE, FALSE, FALSE, NULL )) + SET_ENTRY_POINT( 183, 0x00000 ); /* KERNEL.183: __0000H */ SET_ENTRY_POINT( 174, 0xa0000 ); /* KERNEL.174: __A000H */ SET_ENTRY_POINT( 181, 0xb0000 ); /* KERNEL.181: __B000H */ SET_ENTRY_POINT( 182, 0xb8000 ); /* KERNEL.182: __B800H */ @@ -386,7 +387,7 @@ LPVOID DOSMEM_MapRealToLinear(DWORD x) LPVOID lin; lin=DOSMEM_dosmem+(x&0xffff)+(((x&0xffff0000)>>16)*16); - dprintf_selector(stddeb,"DOSMEM_MapR2L(0x%08lx) returns 0x%p.\n", + dprintf_info(selector,"DOSMEM_MapR2L(0x%08lx) returns 0x%p.\n", x,lin ); return lin; } @@ -405,7 +406,7 @@ WORD DOSMEM_AllocSelector(WORD realsel) GMEM_FIXED,DOSMEM_dosmem+realsel*16,0x10000, hModule,FALSE,FALSE,FALSE,NULL ); - dprintf_selector(stddeb,"DOSMEM_AllocSelector(0x%04x) returns 0x%04x.\n", + dprintf_info(selector,"DOSMEM_AllocSelector(0x%04x) returns 0x%04x.\n", realsel,sel ); return sel; diff --git a/msdos/dpmi.c b/msdos/dpmi.c index 907f0818bd4..d4648c6376f 100644 --- a/msdos/dpmi.c +++ b/msdos/dpmi.c @@ -15,7 +15,6 @@ #include "drive.h" #include "msdos.h" #include "toolhelp.h" -#include "stddebug.h" #include "debug.h" #define DOS_GET_DRIVE(reg) ((reg) ? (reg) - 1 : DRIVE_GetCurrentDrive()) @@ -461,9 +460,7 @@ void WINAPI INT_Int31Handler( CONTEXT *context ) break; } case 0x0501: /* Allocate memory block */ - if (!(ptr = (BYTE *)HeapAlloc( GetProcessHeap(), 0, - MAKELONG( CX_reg(context), - BX_reg(context) )))) + if (!(ptr = (BYTE *)VirtualAlloc(NULL, MAKELONG(CX_reg(context), BX_reg(context)), MEM_COMMIT, PAGE_EXECUTE_READWRITE))) { AX_reg(context) = 0x8012; /* linear memory not available */ SET_CFLAG(context); @@ -476,8 +473,7 @@ void WINAPI INT_Int31Handler( CONTEXT *context ) break; case 0x0502: /* Free memory block */ - HeapFree( GetProcessHeap(), 0, - (void *)MAKELONG( DI_reg(context), SI_reg(context) ) ); + VirtualFree((void *)MAKELONG(DI_reg(context), SI_reg(context)), 0, MEM_RELEASE); break; case 0x0503: /* Resize memory block */ diff --git a/msdos/int10.c b/msdos/int10.c index e73d5bd7d89..2f37107da4f 100644 --- a/msdos/int10.c +++ b/msdos/int10.c @@ -5,7 +5,6 @@ #include #include #include "miscemu.h" -#include "stddebug.h" /* #define DEBUG_INT */ #include "debug.h" diff --git a/msdos/int11.c b/msdos/int11.c index c66f20c13f8..4de3d41e508 100644 --- a/msdos/int11.c +++ b/msdos/int11.c @@ -7,7 +7,6 @@ #include "miscemu.h" #include "msdos.h" #include "drive.h" -#include "stddebug.h" #include "debug.h" /********************************************************************** diff --git a/msdos/int13.c b/msdos/int13.c index b46b6a255aa..8fa70ab1947 100644 --- a/msdos/int13.c +++ b/msdos/int13.c @@ -13,7 +13,6 @@ #include #endif #include "miscemu.h" -#include "stddebug.h" /* #define DEBUG_INT */ #include "debug.h" #include "drive.h" diff --git a/msdos/int15.c b/msdos/int15.c index 5d3ad57ec87..7bc9c6a6d42 100644 --- a/msdos/int15.c +++ b/msdos/int15.c @@ -5,7 +5,6 @@ #include #include #include "miscemu.h" -#include "stddebug.h" #include "debug.h" diff --git a/msdos/int1a.c b/msdos/int1a.c index 1e8157aa74e..90c03c59ea2 100644 --- a/msdos/int1a.c +++ b/msdos/int1a.c @@ -8,8 +8,6 @@ #include #include "options.h" #include "miscemu.h" -#include "stddebug.h" -/* #define DEBUG_INT */ #include "debug.h" #define BCD_TO_BIN(x) ((x&15) + (x>>4)*10) @@ -57,7 +55,7 @@ void WINAPI INT_Int1aHandler( CONTEXT *context ) CX_reg(context) = HIWORD(ticks); DX_reg(context) = LOWORD(ticks); AX_reg(context) = 0; /* No midnight rollover */ - dprintf_int(stddeb,"int1a_00 // ticks=%ld\n", ticks); + dprintf_info(int,"int1a_00 // ticks=%ld\n", ticks); break; case 2: diff --git a/msdos/int20.c b/msdos/int20.c index a84a4d729bc..8ed6684d139 100644 --- a/msdos/int20.c +++ b/msdos/int20.c @@ -5,7 +5,6 @@ #include #include #include "miscemu.h" -#include "stddebug.h" /* #define DEBUG_INT */ #include "debug.h" #include "task.h" diff --git a/msdos/int21.c b/msdos/int21.c index 0fa7a21f975..04df4e1e734 100644 --- a/msdos/int21.c +++ b/msdos/int21.c @@ -24,7 +24,6 @@ #include "task.h" #include "options.h" #include "miscemu.h" -#include "stddebug.h" #include "debug.h" #if defined(__svr4__) || defined(_SCO_DS) /* SVR4 DOESNT do locking the same way must implement properly */ @@ -170,7 +169,7 @@ static void GetDrivePB( CONTEXT *context, int drive ) } else if (heap || INT21_CreateHeap()) { - dprintf_int(stddeb, "int21: GetDrivePB not fully implemented.\n"); + dprintf_fixme(int, "int21: GetDrivePB not fully implemented.\n"); /* FIXME: I have no idea what a lot of this information should * say or whether it even really matters since we're not allowing @@ -207,7 +206,7 @@ static void GetDrivePB( CONTEXT *context, int drive ) static void ioctlGetDeviceInfo( CONTEXT *context ) { int curr_drive; - dprintf_int (stddeb, "int21: ioctl (%d, GetDeviceInfo)\n", BX_reg(context)); + dprintf_info(int, "int21: ioctl (%d, GetDeviceInfo)\n", BX_reg(context)); curr_drive = DRIVE_GetCurrentDrive(); DX_reg(context) = 0x0140 + curr_drive + ((curr_drive > 1) ? 0x0800 : 0); /* no floppy */ @@ -239,7 +238,7 @@ static BOOL32 ioctlGenericBlkDevReq( CONTEXT *context ) switch (CL_reg(context)) { case 0x4a: /* lock logical volume */ - dprintf_int(stddeb,"int21: lock logical volume (%d) level %d mode %d\n",drive,BH_reg(context),DX_reg(context)); + dprintf_info(int,"int21: lock logical volume (%d) level %d mode %d\n",drive,BH_reg(context),DX_reg(context)); break; case 0x60: /* get device parameters */ @@ -280,7 +279,7 @@ static BOOL32 ioctlGenericBlkDevReq( CONTEXT *context ) break; case 0x6a: - dprintf_int(stddeb,"int21: logical volume %d unlocked.\n",drive); + dprintf_info(int,"int21: logical volume %d unlocked.\n",drive); break; default: @@ -337,7 +336,7 @@ static void OpenExistingFile( CONTEXT *context ) break; case 0x30: /* DENYREAD */ - dprintf_int(stddeb, + dprintf_info(int, "OpenExistingFile (%s): DENYREAD changed to DENYALL\n", (char *)PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context))); case 0x10: /* DENYALL */ @@ -425,7 +424,7 @@ static BOOL32 INT21_ExtendedOpenCreateFile(CONTEXT *context ) CloseFile(context); AX_reg(context) = 0x0050; /*File exists*/ SET_CFLAG(context); - dprintf_int(stddeb, "int21: extended open/create: failed because file exists \n"); + dprintf_warn(int, "int21: extended open/create: failed because file exists \n"); } else if ((action & 0x07) == 2) { @@ -434,7 +433,7 @@ static BOOL32 INT21_ExtendedOpenCreateFile(CONTEXT *context ) { BX_reg(context) = AX_reg(context); CloseFile(context); - dprintf_int(stddeb, "int21: extended open/create: failed, trunc on ro file"); + dprintf_warn(int, "int21: extended open/create: failed, trunc on ro file\n"); AX_reg(context) = 0x000C; /*Access code invalid*/ SET_CFLAG(context); } @@ -443,19 +442,19 @@ static BOOL32 INT21_ExtendedOpenCreateFile(CONTEXT *context ) /* Shuffle arguments to call CloseFile while * preserving BX and DX */ - dprintf_int(stddeb, "int21: extended open/create: Closing before truncate\n"); + dprintf_info(int, "int21: extended open/create: Closing before truncate\n"); BX_reg(context) = AX_reg(context); CloseFile(context); if (EFL_reg(context) & 0x0001) { - dprintf_int(stddeb, "int21: extended open/create: close before trunc failed"); + dprintf_warn(int, "int21: extended open/create: close before trunc failed\n"); AX_reg(context) = 0x0019; /*Seek Error*/ CX_reg(context) = 0; SET_CFLAG(context); } /* Shuffle arguments to call CreateFile */ - dprintf_int(stddeb, "int21: extended open/create: Truncating\n"); + dprintf_info(int, "int21: extended open/create: Truncating\n"); AL_reg(context) = BL_reg(context); /* CX is still the same */ DX_reg(context) = SI_reg(context); @@ -463,7 +462,7 @@ static BOOL32 INT21_ExtendedOpenCreateFile(CONTEXT *context ) if (EFL_reg(context) & 0x0001) /*no file open, flags set */ { - dprintf_int(stddeb, "int21: extended open/create: trunc failed"); + dprintf_warn(int, "int21: extended open/create: trunc failed\n"); return bExtendedError; } uReturnCX = 0x3; @@ -480,19 +479,19 @@ static BOOL32 INT21_ExtendedOpenCreateFile(CONTEXT *context ) { CX_reg(context) = 0; SET_CFLAG(context); - dprintf_int(stddeb, "int21: extended open/create: failed, file dosen't exist\n"); + dprintf_warn(int, "int21: extended open/create: failed, file dosen't exist\n"); } else { /* Shuffle arguments to call CreateFile */ - dprintf_int(stddeb, "int21: extended open/create: Creating\n"); + dprintf_info(int, "int21: extended open/create: Creating\n"); AL_reg(context) = BL_reg(context); /* CX should still be the same */ DX_reg(context) = SI_reg(context); bExtendedError = INT21_CreateFile(context); if (EFL_reg(context) & 0x0001) /*no file open, flags set */ { - dprintf_int(stddeb, "int21: extended open/create: create failed\n"); + dprintf_warn(int, "int21: extended open/create: create failed\n"); return bExtendedError; } CX_reg(context) = 2; @@ -508,7 +507,7 @@ static BOOL32 INT21_ChangeDir( CONTEXT *context ) int drive; char *dirname = PTR_SEG_OFF_TO_LIN(DS_reg(context),DX_reg(context)); - dprintf_int(stddeb,"int21: changedir %s\n", dirname); + dprintf_info(int,"int21: changedir %s\n", dirname); if (dirname[0] && (dirname[1] == ':')) { drive = toupper(dirname[0]) - 'A'; @@ -606,7 +605,7 @@ static BOOL32 INT21_CreateTempFile( CONTEXT *context ) if ((AX_reg(context) = _lcreat_uniq( name, 0 )) != (WORD)HFILE_ERROR16) { - dprintf_int( stddeb, "INT21_CreateTempFile: created %s\n", name ); + dprintf_info(int, "INT21_CreateTempFile: created %s\n", name ); return TRUE; } if (DOS_ExtendedError != ER_FileExists) return FALSE; @@ -811,7 +810,7 @@ void WINAPI DOS3Call( CONTEXT *context ) { BOOL32 bSetDOSExtendedError = FALSE; - dprintf_int( stddeb, "int21: AX=%04x BX=%04x CX=%04x DX=%04x " + dprintf_info(int, "int21: AX=%04x BX=%04x CX=%04x DX=%04x " "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n", AX_reg(context), BX_reg(context), CX_reg(context), DX_reg(context), SI_reg(context), DI_reg(context), @@ -920,7 +919,7 @@ void WINAPI DOS3Call( CONTEXT *context ) { TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() ); pTask->dta = PTR_SEG_OFF_TO_SEGPTR(DS_reg(context),DX_reg(context)); - dprintf_int(stddeb, "int21: Set DTA: %08lx\n", pTask->dta); + dprintf_info(int, "int21: Set DTA: %08lx\n", pTask->dta); } break; @@ -1584,9 +1583,9 @@ void WINAPI DOS3Call( CONTEXT *context ) case 0x70: /* MS-DOS 7 (Windows95) - ??? (country-specific?)*/ case 0x72: /* MS-DOS 7 (Windows95) - ??? */ case 0x73: /* MS-DOS 7 (Windows95) - DRIVE LOCKING ??? */ - dprintf_int(stddeb,"int21: windows95 function AX %04x\n", + dprintf_info(int,"int21: windows95 function AX %04x\n", AX_reg(context)); - dprintf_int(stddeb, " returning unimplemented\n"); + dprintf_warn(int, " returning unimplemented\n"); SET_CFLAG(context); AL_reg(context) = 0; break; @@ -1607,7 +1606,7 @@ void WINAPI DOS3Call( CONTEXT *context ) SET_CFLAG(context); } - dprintf_int( stddeb, "ret21: AX=%04x BX=%04x CX=%04x DX=%04x " + dprintf_info(int, "ret21: AX=%04x BX=%04x CX=%04x DX=%04x " "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n", AX_reg(context), BX_reg(context), CX_reg(context), DX_reg(context), SI_reg(context), DI_reg(context), diff --git a/msdos/int25.c b/msdos/int25.c index 2fd6d737c3e..d9273944e77 100644 --- a/msdos/int25.c +++ b/msdos/int25.c @@ -11,8 +11,6 @@ #include "ldt.h" #include "miscemu.h" #include "drive.h" -#include "stddebug.h" -/* #define DEBUG_INT */ #include "debug.h" /********************************************************************** @@ -44,7 +42,7 @@ void WINAPI INT_Int25Handler( CONTEXT *context ) begin = DX_reg(context); length = CX_reg(context); } - dprintf_int( stdnimp, "int25: abs diskread, drive %d, sector %ld, " + dprintf_info(int, "int25: abs diskread, drive %d, sector %ld, " "count %ld, buffer %d\n", AL_reg(context), begin, length, (int) dataptr); @@ -63,3 +61,4 @@ void WINAPI INT_Int25Handler( CONTEXT *context ) } RESET_CFLAG(context); } + diff --git a/msdos/int26.c b/msdos/int26.c index c24f1a9e1db..b5ffe164c8f 100644 --- a/msdos/int26.c +++ b/msdos/int26.c @@ -10,8 +10,6 @@ #include "ldt.h" #include "miscemu.h" #include "drive.h" -#include "stddebug.h" -/* #define DEBUG_INT */ #include "debug.h" /********************************************************************** @@ -44,7 +42,7 @@ void WINAPI INT_Int26Handler( CONTEXT *context ) length = CX_reg(context); } - dprintf_int( stdnimp,"int26: abs diskwrite, drive %d, sector %ld, " + dprintf_info(int,"int26: abs diskwrite, drive %d, sector %ld, " "count %ld, buffer %d\n", AL_reg(context), begin, length, (int) dataptr ); diff --git a/msdos/int2a.c b/msdos/int2a.c index 35b6c2283ed..dcad173e9dd 100644 --- a/msdos/int2a.c +++ b/msdos/int2a.c @@ -6,7 +6,6 @@ #include #include "msdos.h" #include "miscemu.h" -#include "stddebug.h" /* #define DEBUG_INT */ #include "debug.h" diff --git a/msdos/int2f.c b/msdos/int2f.c index c8efcab1059..f31ad61e412 100644 --- a/msdos/int2f.c +++ b/msdos/int2f.c @@ -11,7 +11,6 @@ #include "msdos.h" #include "miscemu.h" #include "module.h" -#include "stddebug.h" /* #define DEBUG_INT */ #include "debug.h" diff --git a/msdos/int3d.c b/msdos/int3d.c index 8e517d49f08..57b99959ea5 100644 --- a/msdos/int3d.c +++ b/msdos/int3d.c @@ -7,7 +7,6 @@ #include #include "msdos.h" #include "miscemu.h" -#include "stddebug.h" /* #define DEBUG_INT */ #include "debug.h" diff --git a/msdos/int5c.c b/msdos/int5c.c index 6a17e8af37a..e5cce5791a7 100644 --- a/msdos/int5c.c +++ b/msdos/int5c.c @@ -6,7 +6,6 @@ #include "ldt.h" #include "miscemu.h" -#include "stddebug.h" #include "debug.h" diff --git a/msdos/interrupts.c b/msdos/interrupts.c index 31710fdd637..6058be76082 100644 --- a/msdos/interrupts.c +++ b/msdos/interrupts.c @@ -12,7 +12,6 @@ #include "msdos.h" #include "module.h" #include "stackframe.h" -#include "stddebug.h" #include "debug.h" static FARPROC16 INT_Vectors[256]; @@ -36,7 +35,7 @@ FARPROC16 INT_GetHandler( BYTE intnum ) */ void INT_SetHandler( BYTE intnum, FARPROC16 handler ) { - dprintf_int( stddeb, "Set interrupt vector %02x <- %04x:%04x\n", + dprintf_info(int, "Set interrupt vector %02x <- %04x:%04x\n", intnum, HIWORD(handler), LOWORD(handler) ); INT_Vectors[intnum] = handler; } diff --git a/msdos/ioports.c b/msdos/ioports.c index c357c370403..a63d3051b84 100644 --- a/msdos/ioports.c +++ b/msdos/ioports.c @@ -18,7 +18,6 @@ #include #include "windows.h" #include "options.h" -#include "stddebug.h" #include "debug.h" static BYTE cmosaddress; @@ -224,7 +223,7 @@ DWORD IO_inport( int port, int count ) } #endif - dprintf_int(stddeb, "IO: %d bytes from port 0x%02x ", count, port ); + dprintf_info(int, "IO: %d bytes from port 0x%02x\n", count, port ); while (count-- > 0) { @@ -244,7 +243,7 @@ DWORD IO_inport( int port, int count ) port++; res = (res << 8) | b; } - dprintf_int(stddeb, "( 0x%lx )\n", res ); + dprintf_info(int, " returning ( 0x%lx )\n", res ); return res; } @@ -256,7 +255,7 @@ void IO_outport( int port, int count, DWORD value ) { BYTE b; - dprintf_int( stddeb, "IO: 0x%lx (%d bytes) to port 0x%02x\n", + dprintf_info(int, "IO: 0x%lx (%d bytes) to port 0x%02x\n", value, count, port ); #ifdef DIRECT_IO_ACCESS diff --git a/msdos/vxd.c b/msdos/vxd.c index 643967fb96c..8a3b77a54ff 100644 --- a/msdos/vxd.c +++ b/msdos/vxd.c @@ -8,8 +8,6 @@ #include "windows.h" #include "msdos.h" #include "miscemu.h" -#include "stddebug.h" -/* #define DEBUG_VXD */ #include "debug.h" @@ -37,18 +35,18 @@ void WINAPI VXD_PageFile( CONTEXT *context ) /* taken from Ralf Brown's Interrupt List */ - dprintf_vxd(stddeb,"VxD: [%04x] PageFile\n", (UINT16)service ); + dprintf_info(vxd,"VxD: [%04x] PageFile\n", (UINT16)service ); switch(service) { case 0x00: /* get version, is this windows version? */ - dprintf_vxd(stddeb,"VxD PageFile: returning version\n"); + dprintf_info(vxd,"VxD PageFile: returning version\n"); AX_reg(context) = VXD_WinVersion(); RESET_CFLAG(context); break; case 0x01: /* get swap file info */ - dprintf_vxd(stddeb,"VxD PageFile: returning swap file info\n"); + dprintf_info(vxd,"VxD PageFile: returning swap file info\n"); AX_reg(context) = 0x00; /* paging disabled */ ECX_reg(context) = 0; /* maximum size of paging file */ /* FIXME: do I touch DS:SI or DS:DI? */ @@ -56,12 +54,12 @@ void WINAPI VXD_PageFile( CONTEXT *context ) break; case 0x02: /* delete permanent swap on exit */ - dprintf_vxd(stddeb,"VxD PageFile: supposed to delete swap\n"); + dprintf_info(vxd,"VxD PageFile: supposed to delete swap\n"); RESET_CFLAG(context); break; case 0x03: /* current temporary swap file size */ - dprintf_vxd(stddeb,"VxD PageFile: what is current temp. swap size\n"); + dprintf_info(vxd,"VxD PageFile: what is current temp. swap size\n"); RESET_CFLAG(context); break; @@ -82,12 +80,12 @@ void WINAPI VXD_Shell( CONTEXT *context ) { unsigned service = DX_reg(context); - dprintf_vxd(stddeb,"VxD: [%04x] Shell\n", (UINT16)service); + dprintf_info(vxd,"VxD: [%04x] Shell\n", (UINT16)service); switch (service) /* Ralf Brown says EDX, but I use DX instead */ { case 0x0000: - dprintf_vxd(stddeb,"VxD Shell: returning version\n"); + dprintf_info(vxd,"VxD Shell: returning version\n"); AX_reg(context) = VXD_WinVersion(); EBX_reg(context) = 1; /* system VM Handle */ break; @@ -97,12 +95,12 @@ void WINAPI VXD_Shell( CONTEXT *context ) case 0x0003: case 0x0004: case 0x0005: - dprintf_vxd(stddeb,"VxD Shell: EDX = %08lx\n",EDX_reg(context)); + dprintf_info(vxd,"VxD Shell: EDX = %08lx\n",EDX_reg(context)); VXD_BARF( context, "shell" ); break; case 0x0006: /* SHELL_Get_VM_State */ - dprintf_vxd(stddeb,"VxD Shell: returning VM state\n"); + dprintf_info(vxd,"VxD Shell: returning VM state\n"); /* Actually we don't, not yet. We have to return a structure * and I am not to sure how to set it up and return it yet, * so for now let's do nothing. I can (hopefully) get this @@ -128,7 +126,7 @@ void WINAPI VXD_Shell( CONTEXT *context ) case 0x0015: case 0x0016: default: - dprintf_vxd(stddeb,"VxD Shell: EDX = %08lx\n",EDX_reg(context)); + dprintf_info(vxd,"VxD Shell: EDX = %08lx\n",EDX_reg(context)); VXD_BARF( context, "shell"); break; } @@ -142,12 +140,12 @@ void WINAPI VXD_Comm( CONTEXT *context ) { unsigned service = AX_reg(context); - dprintf_vxd(stddeb,"VxD: [%04x] Comm\n", (UINT16)service); + dprintf_info(vxd,"VxD: [%04x] Comm\n", (UINT16)service); switch (service) { case 0x0000: /* get version */ - dprintf_vxd(stddeb,"VxD Comm: returning version\n"); + dprintf_info(vxd,"VxD Comm: returning version\n"); AX_reg(context) = VXD_WinVersion(); RESET_CFLAG(context); break; @@ -167,7 +165,7 @@ void VXD_Timer( CONTEXT *context ) { unsigned service = AX_reg(context); - dprintf_vxd(stddeb,"VxD: [%04x] Virtual Timer\n", (UINT16)service); + dprintf_info(vxd,"VxD: [%04x] Virtual Timer\n", (UINT16)service); switch(service) { diff --git a/multimedia/audio.c b/multimedia/audio.c index 8abae8c570e..768180f8a36 100644 --- a/multimedia/audio.c +++ b/multimedia/audio.c @@ -24,7 +24,6 @@ #include "mmsystem.h" #include "heap.h" #include "ldt.h" -#include "stddebug.h" #include "debug.h" #ifdef HAVE_OSS @@ -88,7 +87,7 @@ static LINUX_MCIWAVE MCIWavDev[MAX_MCIWAVDRV]; static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { - dprintf_mciwave(stddeb,"WAVE_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2); + dprintf_info(mciwave,"WAVE_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2); switch (wMsg) { case WOM_OPEN: @@ -104,7 +103,7 @@ static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg, WOutDev[wDevID].waveDesc.dwInstance, dwParam1, dwParam2)) { - dprintf_mciwave(stddeb,"WAVE_NotifyClient // can't notify client !\n"); + dprintf_warn(mciwave, "WAVE_NotifyClient // can't notify client !\n"); return MMSYSERR_NOERROR; } break; @@ -118,7 +117,7 @@ static DWORD WAVE_NotifyClient(UINT16 wDevID, WORD wMsg, WInDev[wDevID].waveDesc.dwCallBack, WInDev[wDevID].wFlags, WInDev[wDevID].waveDesc.hWave, wMsg, WInDev[wDevID].waveDesc.dwInstance, dwParam1, dwParam2)) { - dprintf_mciwave(stddeb,"WAVE_NotifyClient // can't notify client !\n"); + dprintf_warn(mciwave, "WAVE_NotifyClient // can't notify client !\n"); return MMSYSERR_NOERROR; } break; @@ -138,7 +137,7 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS16 DWORD dwRet; char str[128]; - dprintf_mciwave(stddeb,"WAVE_mciOpen(%04X, %08lX, %p)\n", + dprintf_info(mciwave,"WAVE_mciOpen(%04X, %08lX, %p)\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; @@ -157,11 +156,11 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS16 MCIWavDev[wDevID].fInput = FALSE; - dprintf_mciwave(stddeb,"WAVE_mciOpen // wDevID=%04X\n", wDevID); - dprintf_mciwave(stddeb,"WAVE_mciOpen // before OPEN_ELEMENT\n"); + dprintf_info(mciwave,"WAVE_mciOpen // wDevID=%04X\n", wDevID); + dprintf_info(mciwave,"WAVE_mciOpen // before OPEN_ELEMENT\n"); if (dwFlags & MCI_OPEN_ELEMENT) { lpstrElementName = (LPSTR)PTR_SEG_TO_LIN(lpParms->lpstrElementName); - dprintf_mciwave(stddeb,"WAVE_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", + dprintf_info(mciwave,"WAVE_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName); if ( lpstrElementName && (strlen(lpstrElementName) > 0)) { strcpy(str, lpstrElementName); @@ -169,14 +168,14 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS16 MCIWavDev[wDevID].hFile = mmioOpen16(str, NULL, MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE); if (MCIWavDev[wDevID].hFile == 0) { - dprintf_mciwave(stddeb,"WAVE_mciOpen // can't find file='%s' !\n", str); + dprintf_warn(mciwave, "WAVE_mciOpen // can't find file='%s' !\n", str); return MCIERR_FILE_NOT_FOUND; } } else MCIWavDev[wDevID].hFile = 0; } - dprintf_mciwave(stddeb,"WAVE_mciOpen // hFile=%u\n", MCIWavDev[wDevID].hFile); + dprintf_info(mciwave,"WAVE_mciOpen // hFile=%u\n", MCIWavDev[wDevID].hFile); memcpy(&MCIWavDev[wDevID].openParms, lpParms, sizeof(MCI_WAVE_OPEN_PARMS16)); MCIWavDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID; lpWaveFormat = &MCIWavDev[wDevID].WaveFormat; @@ -195,7 +194,7 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS16 MMCKINFO ckMainRIFF; if (mmioDescend(MCIWavDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0) return MCIERR_INTERNAL; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize); @@ -205,7 +204,7 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS16 mmckInfo.ckid = mmioFOURCC('f', 'm', 't', ' '); if (mmioDescend(MCIWavDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) return MCIERR_INTERNAL; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); @@ -215,11 +214,11 @@ static DWORD WAVE_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS16 mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a'); if (mmioDescend(MCIWavDev[wDevID].hFile, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) != 0) return MCIERR_INTERNAL; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciOpen // nChannels=%d nSamplesPerSec=%ld\n", lpWaveFormat->wf.nChannels, lpWaveFormat->wf.nSamplesPerSec); lpWaveFormat->wBitsPerSample = 0; @@ -257,7 +256,7 @@ static DWORD WAVE_mciCue(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpPar DWORD dwRet; WAVEOPENDESC waveDesc; - dprintf_mciwave(stddeb,"WAVE_mciCue(%u, %08lX, %p);\n", wDevID, dwParam, lpParms); + dprintf_info(mciwave,"WAVE_mciCue(%u, %08lX, %p);\n", wDevID, dwParam, lpParms); /* always close elements ? */ @@ -295,7 +294,7 @@ static DWORD WAVE_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpP { DWORD dwRet; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciClose(%u, %08lX, %p);\n", wDevID, dwParam, lpParms); MCIWavDev[wDevID].nUseCount--; if (MCIWavDev[wDevID].nUseCount == 0) { @@ -325,42 +324,41 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms LPWAVEHDR lpWaveHdr; DWORD dwRet; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciPlay(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (MCIWavDev[wDevID].fInput) { - dprintf_mciwave(stddeb,"WAVE_mciPlay // cannot play on input device\n"); + dprintf_warn(mciwave, "WAVE_mciPlay // cannot play on input device\n"); return MCIERR_NONAPPLICABLE_FUNCTION; } if (MCIWavDev[wDevID].hFile == 0) { - dprintf_mciwave(stddeb,"WAVE_mciPlay // can't find file='%08lx' !\n", + dprintf_warn(mciwave, "WAVE_mciPlay // can't find file='%08lx' !\n", MCIWavDev[wDevID].openParms.lpstrElementName); return MCIERR_FILE_NOT_FOUND; } start = 1; end = 99999; if (dwFlags & MCI_FROM) { start = lpParms->dwFrom; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciPlay // MCI_FROM=%d \n", start); } if (dwFlags & MCI_TO) { end = lpParms->dwTo; - dprintf_mciwave(stddeb,"WAVE_mciPlay // MCI_TO=%d \n", end); + dprintf_info(mciwave,"WAVE_mciPlay // MCI_TO=%d \n", end); } #if 0 if (dwFlags & MCI_NOTIFY) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciPlay // MCI_NOTIFY %08lX !\n", lpParms->dwCallback); switch(fork()) { case -1: - dprintf_mciwave(stddeb, - "WAVE_mciPlay // Can't 'fork' process !\n"); + dprintf_warn(mciwave, "WAVE_mciPlay // Can't 'fork' process !\n"); break; case 0: break; default: - dprintf_mciwave(stddeb,"WAVE_mciPlay // process started ! return to caller...\n"); + dprintf_info(mciwave,"WAVE_mciPlay // process started ! return to caller...\n"); return 0; } } @@ -375,11 +373,11 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms dwRet=wodMessage(wDevID,WODM_PREPARE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR)); while(TRUE) { count = mmioRead(MCIWavDev[wDevID].hFile, lpWaveHdr->lpData, bufsize); - dprintf_mciwave(stddeb,"WAVE_mciPlay // mmioRead bufsize=%ld count=%ld\n", bufsize, count); + dprintf_info(mciwave,"WAVE_mciPlay // mmioRead bufsize=%ld count=%ld\n", bufsize, count); if (count < 1) break; lpWaveHdr->dwBufferLength = count; /* lpWaveHdr->dwBytesRecorded = count; */ - dprintf_mciwave(stddeb,"WAVE_mciPlay // before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n", + dprintf_info(mciwave,"WAVE_mciPlay // before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n", lpWaveHdr, lpWaveHdr->dwBufferLength, lpWaveHdr->dwBytesRecorded); dwRet=wodMessage(wDevID,WODM_WRITE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR)); } @@ -390,7 +388,7 @@ static DWORD WAVE_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms lpWaveHdr->lpData = NULL; } if (dwFlags & MCI_NOTIFY) { - dprintf_mciwave(stddeb,"WAVE_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); + dprintf_info(mciwave,"WAVE_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -409,28 +407,28 @@ static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP LPWAVEHDR lpWaveHdr; DWORD dwRet; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciRecord(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (!MCIWavDev[wDevID].fInput) { - dprintf_mciwave(stddeb,"WAVE_mciPlay // cannot record on output device\n"); + dprintf_warn(mciwave, "WAVE_mciPlay // cannot record on output device\n"); return MCIERR_NONAPPLICABLE_FUNCTION; } if (MCIWavDev[wDevID].hFile == 0) { - dprintf_mciwave(stddeb,"WAVE_mciRecord // can't find file='%08lx' !\n", + dprintf_warn(mciwave, "WAVE_mciRecord // can't find file='%08lx' !\n", MCIWavDev[wDevID].openParms.lpstrElementName); return MCIERR_FILE_NOT_FOUND; } start = 1; end = 99999; if (dwFlags & MCI_FROM) { start = lpParms->dwFrom; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciRecord // MCI_FROM=%d \n", start); } if (dwFlags & MCI_TO) { end = lpParms->dwTo; - dprintf_mciwave(stddeb,"WAVE_mciRecord // MCI_TO=%d \n", end); + dprintf_info(mciwave,"WAVE_mciRecord // MCI_TO=%d \n", end); } bufsize = 64000; lpWaveHdr = &MCIWavDev[wDevID].WaveHdr; @@ -441,25 +439,25 @@ static DWORD WAVE_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP lpWaveHdr->dwFlags = 0L; lpWaveHdr->dwLoops = 0L; dwRet=widMessage(wDevID,WIDM_PREPARE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR)); - dprintf_mciwave(stddeb,"WAVE_mciRecord // after WIDM_PREPARE \n"); + dprintf_info(mciwave,"WAVE_mciRecord // after WIDM_PREPARE \n"); while(TRUE) { lpWaveHdr->dwBytesRecorded = 0; dwRet = widMessage(wDevID, WIDM_START, 0, 0L, 0L); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciRecord // after WIDM_START lpWaveHdr=%p dwBytesRecorded=%lu\n", lpWaveHdr, lpWaveHdr->dwBytesRecorded); if (lpWaveHdr->dwBytesRecorded == 0) break; } - dprintf_mciwave(stddeb,"WAVE_mciRecord // before WIDM_UNPREPARE \n"); + dprintf_info(mciwave,"WAVE_mciRecord // before WIDM_UNPREPARE \n"); dwRet = widMessage(wDevID,WIDM_UNPREPARE,0,(DWORD)lpWaveHdr,sizeof(WAVEHDR)); - dprintf_mciwave(stddeb,"WAVE_mciRecord // after WIDM_UNPREPARE \n"); + dprintf_info(mciwave,"WAVE_mciRecord // after WIDM_UNPREPARE \n"); if (lpWaveHdr->lpData != NULL) { GlobalUnlock16(hData); GlobalFree16(hData); lpWaveHdr->lpData = NULL; } if (dwFlags & MCI_NOTIFY) { - dprintf_mciwave(stddeb,"WAVE_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); + dprintf_info(mciwave,"WAVE_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -474,7 +472,7 @@ static DWORD WAVE_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa { DWORD dwRet; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciStop(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (MCIWavDev[wDevID].fInput) @@ -493,7 +491,7 @@ static DWORD WAVE_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP { DWORD dwRet; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciPause(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (MCIWavDev[wDevID].fInput) @@ -510,7 +508,7 @@ static DWORD WAVE_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP */ static DWORD WAVE_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciResume(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; return 0; @@ -522,26 +520,26 @@ static DWORD WAVE_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp */ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciSet(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciSet // dwAudio=%08lX\n", lpParms->dwAudio); if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: - dprintf_mciwave(stddeb, "WAVE_mciSet // MCI_FORMAT_MILLISECONDS !\n"); + dprintf_info(mciwave, "WAVE_mciSet // MCI_FORMAT_MILLISECONDS !\n"); break; case MCI_FORMAT_BYTES: - dprintf_mciwave(stddeb, "WAVE_mciSet // MCI_FORMAT_BYTES !\n"); + dprintf_info(mciwave, "WAVE_mciSet // MCI_FORMAT_BYTES !\n"); break; case MCI_FORMAT_SAMPLES: - dprintf_mciwave(stddeb, "WAVE_mciSet // MCI_FORMAT_SAMPLES !\n"); + dprintf_info(mciwave, "WAVE_mciSet // MCI_FORMAT_SAMPLES !\n"); break; default: - dprintf_mciwave(stddeb, "WAVE_mciSet // bad time format !\n"); + dprintf_warn(mciwave, "WAVE_mciSet // bad time format !\n"); return MCIERR_BAD_TIME_FORMAT; } } @@ -549,38 +547,38 @@ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (dwFlags & MCI_SET_DOOR_OPEN) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_DOOR_CLOSED) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_AUDIO) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_SET_AUDIO !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_AUDIO !\n"); if (dwFlags && MCI_SET_ON) { - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_SET_ON !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_ON !\n"); if (dwFlags && MCI_SET_AUDIO_LEFT) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_SET_AUDIO_LEFT !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_AUDIO_LEFT !\n"); if (dwFlags && MCI_SET_AUDIO_RIGHT) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_SET_AUDIO_RIGHT !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_AUDIO_RIGHT !\n"); } if (dwFlags & MCI_SET_OFF) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_SET_OFF !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_SET_OFF !\n"); if (dwFlags & MCI_WAVE_INPUT) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_INPUT !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_INPUT !\n"); if (dwFlags & MCI_WAVE_OUTPUT) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_OUTPUT !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_OUTPUT !\n"); if (dwFlags & MCI_WAVE_SET_ANYINPUT) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_SET_ANYINPUT !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_ANYINPUT !\n"); if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_SET_ANYOUTPUT !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_ANYOUTPUT !\n"); if (dwFlags & MCI_WAVE_SET_AVGBYTESPERSEC) - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciSet // MCI_WAVE_SET_AVGBYTESPERSEC !\n"); if (dwFlags & MCI_WAVE_SET_BITSPERSAMPLE) - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciSet // MCI_WAVE_SET_BITSPERSAMPLE !\n"); if (dwFlags & MCI_WAVE_SET_BLOCKALIGN) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_SET_BLOCKALIGN !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_BLOCKALIGN !\n"); if (dwFlags & MCI_WAVE_SET_CHANNELS) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_SET_CHANNELS !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_CHANNELS !\n"); if (dwFlags & MCI_WAVE_SET_FORMATTAG) - dprintf_mciwave(stddeb,"WAVE_mciSet // MCI_WAVE_SET_FORMATTAG !\n"); + dprintf_info(mciwave,"WAVE_mciSet // MCI_WAVE_SET_FORMATTAG !\n"); if (dwFlags & MCI_WAVE_SET_SAMPLESPERSEC) - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciSet // MCI_WAVE_SET_SAMPLESPERSEC !\n"); return 0; } @@ -591,7 +589,7 @@ static DWORD WAVE_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) */ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciStatus(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_STATUS_ITEM) { @@ -610,7 +608,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP lpParms->dwReturn = MCI_MODE_STOP; break; case MCI_STATUS_MEDIA_PRESENT: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); lpParms->dwReturn = TRUE; break; case MCI_STATUS_NUMBER_OF_TRACKS: @@ -626,56 +624,56 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP } break; case MCI_STATUS_READY: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_STATUS_READY !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_STATUS_READY !\n"); lpParms->dwReturn = TRUE; break; case MCI_STATUS_TIME_FORMAT: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); lpParms->dwReturn = MCI_FORMAT_MILLISECONDS; break; case MCI_WAVE_INPUT: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_INPUT !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_INPUT !\n"); lpParms->dwReturn = 0; break; case MCI_WAVE_OUTPUT: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_OUTPUT !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_OUTPUT !\n"); lpParms->dwReturn = 0; break; case MCI_WAVE_STATUS_AVGBYTESPERSEC: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_STATUS_AVGBYTESPERSEC !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_AVGBYTESPERSEC !\n"); lpParms->dwReturn = 22050; break; case MCI_WAVE_STATUS_BITSPERSAMPLE: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_STATUS_BITSPERSAMPLE !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_BITSPERSAMPLE !\n"); lpParms->dwReturn = 8; break; case MCI_WAVE_STATUS_BLOCKALIGN: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_STATUS_BLOCKALIGN !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_BLOCKALIGN !\n"); lpParms->dwReturn = 1; break; case MCI_WAVE_STATUS_CHANNELS: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_STATUS_CHANNELS !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_CHANNELS !\n"); lpParms->dwReturn = 1; break; case MCI_WAVE_STATUS_FORMATTAG: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_FORMATTAG !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_FORMATTAG !\n"); lpParms->dwReturn = WAVE_FORMAT_PCM; break; case MCI_WAVE_STATUS_LEVEL: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_STATUS_LEVEL !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_LEVEL !\n"); lpParms->dwReturn = 0xAAAA5555; break; case MCI_WAVE_STATUS_SAMPLESPERSEC: - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_WAVE_STATUS_SAMPLESPERSEC !\n"); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_WAVE_STATUS_SAMPLESPERSEC !\n"); lpParms->dwReturn = 22050; break; default: - dprintf_mciwave(stddeb,"WAVE_mciStatus // unknown command %08lX !\n", lpParms->dwItem); + dprintf_warn(mciwave,"WAVE_mciStatus // unknown command %08lX !\n", lpParms->dwItem); return MCIERR_UNRECOGNIZED_COMMAND; } } if (dwFlags & MCI_NOTIFY) { - dprintf_mciwave(stddeb,"WAVE_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); + dprintf_info(mciwave,"WAVE_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -688,7 +686,7 @@ static DWORD WAVE_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciGetDevCaps(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_GETDEVCAPS_ITEM) { @@ -738,7 +736,7 @@ static DWORD WAVE_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, */ static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "WAVE_mciInfo(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; lpParms->lpstrReturn = NULL; @@ -781,7 +779,7 @@ static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS16 lpCaps, DWORD dwSize) int dsp_stereo = 1; int bytespersmpl; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize); if (lpCaps == NULL) return MMSYSERR_NOTENABLED; if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED; @@ -836,7 +834,7 @@ static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS16 lpCaps, DWORD dwSize) } } close(audio); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodGetDevCaps // dwFormats = %08lX\n", lpCaps->dwFormats); return MMSYSERR_NOERROR; } @@ -850,44 +848,44 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) int audio,abuf_size,smplrate,samplesize,dsp_stereo; LPWAVEFORMAT lpFormat; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { - dprintf_mciwave(stddeb,"Linux 'wodOpen' // Invalid Parameter !\n"); + dprintf_warn(mciwave, "Linux 'wodOpen' // Invalid Parameter !\n"); return MMSYSERR_INVALPARAM; } if (wDevID >= MAX_WAVOUTDRV) { - dprintf_mciwave(stddeb,"Linux 'wodOpen' // MAX_WAVOUTDRV reached !\n"); + dprintf_info(mciwave,"Linux 'wodOpen' // MAX_WAVOUTDRV reached !\n"); return MMSYSERR_ALLOCATED; } WOutDev[wDevID].unixdev = 0; if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED; audio = open (SOUND_DEV, O_WRONLY, 0); if (audio == -1) { - dprintf_mciwave(stddeb,"Linux 'wodOpen' // can't open !\n"); + dprintf_warn(mciwave, "Linux 'wodOpen' // can't open !\n"); return MMSYSERR_ALLOCATED ; } IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size); if (abuf_size < 1024 || abuf_size > 65536) { if (abuf_size == -1) - dprintf_mciwave(stddeb,"Linux 'wodOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n"); + dprintf_warn(mciwave, "Linux 'wodOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n"); else - dprintf_mciwave(stddeb,"Linux 'wodOpen' // SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n"); + dprintf_warn(mciwave, "Linux 'wodOpen' // SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n"); return MMSYSERR_NOTENABLED; } WOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); switch(WOutDev[wDevID].wFlags) { case DCB_NULL: - dprintf_mciwave(stddeb, "Linux 'wodOpen' // CALLBACK_NULL !\n"); + dprintf_info(mciwave, "Linux 'wodOpen' // CALLBACK_NULL !\n"); break; case DCB_WINDOW: - dprintf_mciwave(stddeb, "Linux 'wodOpen' // CALLBACK_WINDOW !\n"); + dprintf_info(mciwave, "Linux 'wodOpen' // CALLBACK_WINDOW !\n"); break; case DCB_TASK: - dprintf_mciwave(stddeb, "Linux 'wodOpen' // CALLBACK_TASK !\n"); + dprintf_info(mciwave, "Linux 'wodOpen' // CALLBACK_TASK !\n"); break; case DCB_FUNCTION: - dprintf_mciwave(stddeb, "Linux 'wodOpen' // CALLBACK_FUNCTION !\n"); + dprintf_info(mciwave, "Linux 'wodOpen' // CALLBACK_FUNCTION !\n"); break; } WOutDev[wDevID].lpQueueHdr = NULL; @@ -896,22 +894,22 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) WOutDev[wDevID].bufsize = abuf_size; /* FIXME: copy lpFormat too? */ memcpy(&WOutDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC)); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // lpDesc->lpFormat = %p\n",lpDesc->lpFormat); + dprintf_info(mciwave,"Linux 'wodOpen' // lpDesc->lpFormat = %p\n",lpDesc->lpFormat); lpFormat = lpDesc->lpFormat; - dprintf_mciwave(stddeb,"Linux 'wodOpen' // lpFormat = %p\n",lpFormat); + dprintf_info(mciwave,"Linux 'wodOpen' // lpFormat = %p\n",lpFormat); if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) { - dprintf_mciwave(stddeb,"Linux 'wodOpen' // Bad format %04X !\n", + dprintf_warn(mciwave,"Linux 'wodOpen' // Bad format %04X !\n", lpFormat->wFormatTag); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // Bad nChannels %d !\n", + dprintf_warn(mciwave,"Linux 'wodOpen' // Bad nChannels %d !\n", lpFormat->nChannels); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // Bad nSamplesPerSec %ld !\n", + dprintf_warn(mciwave,"Linux 'wodOpen' // Bad nSamplesPerSec %ld !\n", lpFormat->nSamplesPerSec); return WAVERR_BADFORMAT; } memcpy(&WOutDev[wDevID].Format, lpFormat, sizeof(PCMWAVEFORMAT)); if (WOutDev[wDevID].Format.wf.nChannels == 0) return WAVERR_BADFORMAT; if (WOutDev[wDevID].Format.wf.nSamplesPerSec == 0) return WAVERR_BADFORMAT; - dprintf_mciwave(stddeb,"Linux 'wodOpen' // wBitsPerSample=%u !\n", + dprintf_info(mciwave,"Linux 'wodOpen' // wBitsPerSample=%u !\n", WOutDev[wDevID].Format.wBitsPerSample); if (WOutDev[wDevID].Format.wBitsPerSample == 0) { WOutDev[wDevID].Format.wBitsPerSample = 8 * @@ -925,16 +923,16 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) IOCTL(audio, SNDCTL_DSP_SPEED, smplrate); IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize); IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // wBitsPerSample=%u !\n", + dprintf_info(mciwave,"Linux 'wodOpen' // wBitsPerSample=%u !\n", WOutDev[wDevID].Format.wBitsPerSample); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // nAvgBytesPerSec=%lu !\n", + dprintf_info(mciwave,"Linux 'wodOpen' // nAvgBytesPerSec=%lu !\n", WOutDev[wDevID].Format.wf.nAvgBytesPerSec); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // nSamplesPerSec=%lu !\n", + dprintf_info(mciwave,"Linux 'wodOpen' // nSamplesPerSec=%lu !\n", WOutDev[wDevID].Format.wf.nSamplesPerSec); - dprintf_mciwave(stddeb,"Linux 'wodOpen' // nChannels=%u !\n", + dprintf_info(mciwave,"Linux 'wodOpen' // nChannels=%u !\n", WOutDev[wDevID].Format.wf.nChannels); if (WAVE_NotifyClient(wDevID, WOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'wodOpen' // can't notify client !\n"); + dprintf_warn(mciwave, "Linux 'wodOpen' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -945,14 +943,14 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) */ static DWORD wodClose(WORD wDevID) { - dprintf_mciwave(stddeb,"wodClose(%u);\n", wDevID); + dprintf_info(mciwave,"wodClose(%u);\n", wDevID); if (wDevID > MAX_WAVOUTDRV) return MMSYSERR_INVALPARAM; if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodClose' // can't close !\n"); + dprintf_warn(mciwave, "Linux 'wodClose' // can't close !\n"); return MMSYSERR_NOTENABLED; } if (WOutDev[wDevID].lpQueueHdr != NULL) { - dprintf_mciwave(stddeb,"linux 'wodclose' // still buffers open !\n"); + dprintf_warn(mciwave, "linux 'wodclose' // still buffers open !\n"); /* Don't care. Who needs those buffers anyway */ /*return WAVERR_STILLPLAYING; */ } @@ -961,7 +959,7 @@ static DWORD wodClose(WORD wDevID) WOutDev[wDevID].bufsize = 0; WOutDev[wDevID].lpQueueHdr = NULL; if (WAVE_NotifyClient(wDevID, WOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'wodClose' // can't notify client !\n"); + dprintf_warn(mciwave, "Linux 'wodClose' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -978,9 +976,9 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) LPSTR lpData; LPWAVEHDR xwavehdr; - dprintf_mciwave(stddeb,"wodWrite(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); + dprintf_info(mciwave,"wodWrite(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodWrite' // can't play !\n"); + dprintf_warn(mciwave, "Linux 'wodWrite' // can't play !\n"); return MMSYSERR_NOTENABLED; } if (lpWaveHdr->lpData == NULL) return WAVERR_UNPREPARED; @@ -988,15 +986,15 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING; lpWaveHdr->dwFlags &= ~WHDR_DONE; lpWaveHdr->dwFlags |= WHDR_INQUEUE; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodWrite() // dwBufferLength %lu !\n", lpWaveHdr->dwBufferLength); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodWrite() // WOutDev[%u].unixdev %u !\n", wDevID, WOutDev[wDevID].unixdev); lpData = lpWaveHdr->lpData; count = write (WOutDev[wDevID].unixdev, lpData, lpWaveHdr->dwBufferLength); - dprintf_mciwave(stddeb,"wodWrite()//write returned count %u !\n",count); + dprintf_info(mciwave,"wodWrite()//write returned count %u !\n",count); if (count != lpWaveHdr->dwBufferLength) { - dprintf_mciwave(stddeb,"Linux 'wodWrite' // error writting !\n"); + dprintf_warn(mciwave, "Linux 'wodWrite' // error writting !\n"); return MMSYSERR_NOTENABLED; } WOutDev[wDevID].dwTotalPlayed += count; @@ -1008,14 +1006,14 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) memcpy(xwavehdr,lpWaveHdr,sizeof(WAVEHDR)); xwavehdr->lpData = (LPBYTE)xwavehdr->reserved; if (WAVE_NotifyClient(wDevID, WOM_DONE, (DWORD)SEGPTR_GET(xwavehdr), count) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'wodWrite' // can't notify client !\n"); + dprintf_warn(mciwave, "Linux 'wodWrite' // can't notify client !\n"); SEGPTR_FREE(xwavehdr); return MMSYSERR_INVALPARAM; } SEGPTR_FREE(xwavehdr); } else { if (WAVE_NotifyClient(wDevID, WOM_DONE, (DWORD)lpWaveHdr, count) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'wodWrite' // can't notify client !\n"); + dprintf_warn(mciwave, "Linux 'wodWrite' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } } @@ -1027,10 +1025,10 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) */ static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodPrepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodPrepare' // can't prepare !\n"); + dprintf_warn(mciwave, "Linux 'wodPrepare' // can't prepare !\n"); return MMSYSERR_NOTENABLED; } /* don't append to queue, wodWrite does that */ @@ -1047,10 +1045,10 @@ static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) */ static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodUnprepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodUnprepare' // can't unprepare !\n"); + dprintf_warn(mciwave, "Linux 'wodUnprepare' // can't unprepare !\n"); return MMSYSERR_NOTENABLED; } if (lpWaveHdr->dwFlags & WHDR_INQUEUE) @@ -1058,7 +1056,7 @@ static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwFlags &= ~WHDR_PREPARED; lpWaveHdr->dwFlags |= WHDR_DONE; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "Linux 'wodUnprepare' // all headers unprepared !\n"); return MMSYSERR_NOERROR; } @@ -1068,14 +1066,14 @@ static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) */ static DWORD wodRestart(WORD wDevID) { - dprintf_mciwave(stddeb,"wodRestart(%u);\n", wDevID); + dprintf_info(mciwave,"wodRestart(%u);\n", wDevID); if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodRestart' // can't restart !\n"); + dprintf_warn(mciwave, "Linux 'wodRestart' // can't restart !\n"); return MMSYSERR_NOTENABLED; } /* FIXME: is NotifyClient with WOM_DONE right ? (Comet Busters 1.3.3 needs this notification) */ if (WAVE_NotifyClient(wDevID, WOM_DONE, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'wodRestart' // can't notify client !\n"); + dprintf_warn(mciwave, "Linux 'wodRestart' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } @@ -1087,9 +1085,9 @@ static DWORD wodRestart(WORD wDevID) */ static DWORD wodReset(WORD wDevID) { - dprintf_mciwave(stddeb,"wodReset(%u);\n", wDevID); + dprintf_info(mciwave,"wodReset(%u);\n", wDevID); if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodReset' // can't reset !\n"); + dprintf_warn(mciwave, "Linux 'wodReset' // can't reset !\n"); return MMSYSERR_NOTENABLED; } return MMSYSERR_NOERROR; @@ -1102,35 +1100,35 @@ static DWORD wodReset(WORD wDevID) static DWORD wodGetPosition(WORD wDevID, LPMMTIME16 lpTime, DWORD uSize) { int time; - dprintf_mciwave(stddeb,"wodGetPosition(%u, %p, %lu);\n", wDevID, lpTime, uSize); + dprintf_info(mciwave,"wodGetPosition(%u, %p, %lu);\n", wDevID, lpTime, uSize); if (WOutDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'wodGetPosition' // can't get pos !\n"); + dprintf_warn(mciwave, "Linux 'wodGetPosition' // can't get pos !\n"); return MMSYSERR_NOTENABLED; } if (lpTime == NULL) return MMSYSERR_INVALPARAM; - dprintf_mciwave(stddeb,"wodGetPosition // wType=%04X !\n", + dprintf_info(mciwave,"wodGetPosition // wType=%04X !\n", lpTime->wType); - dprintf_mciwave(stddeb,"wodGetPosition // wBitsPerSample=%u\n", + dprintf_info(mciwave,"wodGetPosition // wBitsPerSample=%u\n", WOutDev[wDevID].Format.wBitsPerSample); - dprintf_mciwave(stddeb,"wodGetPosition // nSamplesPerSec=%lu\n", + dprintf_info(mciwave,"wodGetPosition // nSamplesPerSec=%lu\n", WOutDev[wDevID].Format.wf.nSamplesPerSec); - dprintf_mciwave(stddeb,"wodGetPosition // nChannels=%u\n", + dprintf_info(mciwave,"wodGetPosition // nChannels=%u\n", WOutDev[wDevID].Format.wf.nChannels); - dprintf_mciwave(stddeb,"wodGetPosition // nAvgBytesPerSec=%lu\n", + dprintf_info(mciwave,"wodGetPosition // nAvgBytesPerSec=%lu\n", WOutDev[wDevID].Format.wf.nAvgBytesPerSec); switch(lpTime->wType) { case TIME_BYTES: lpTime->u.cb = WOutDev[wDevID].dwTotalPlayed; - dprintf_mciwave(stddeb,"wodGetPosition // TIME_BYTES=%lu\n", lpTime->u.cb); + dprintf_info(mciwave,"wodGetPosition // TIME_BYTES=%lu\n", lpTime->u.cb); break; case TIME_SAMPLES: - dprintf_mciwave(stddeb,"wodGetPosition // dwTotalPlayed=%lu\n", + dprintf_info(mciwave,"wodGetPosition // dwTotalPlayed=%lu\n", WOutDev[wDevID].dwTotalPlayed); - dprintf_mciwave(stddeb,"wodGetPosition // wBitsPerSample=%u\n", + dprintf_info(mciwave,"wodGetPosition // wBitsPerSample=%u\n", WOutDev[wDevID].Format.wBitsPerSample); lpTime->u.sample = WOutDev[wDevID].dwTotalPlayed * 8 / WOutDev[wDevID].Format.wBitsPerSample; - dprintf_mciwave(stddeb,"wodGetPosition // TIME_SAMPLES=%lu\n", lpTime->u.sample); + dprintf_info(mciwave,"wodGetPosition // TIME_SAMPLES=%lu\n", lpTime->u.sample); break; case TIME_SMPTE: time = WOutDev[wDevID].dwTotalPlayed / @@ -1143,18 +1141,18 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME16 lpTime, DWORD uSize) time -= lpTime->u.smpte.sec * 30; lpTime->u.smpte.frame = time; lpTime->u.smpte.fps = 30; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "wodGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n", lpTime->u.smpte.hour, lpTime->u.smpte.min, lpTime->u.smpte.sec, lpTime->u.smpte.frame); break; default: - dprintf_mciwave(stddeb,"wodGetPosition() format not supported ! use TIME_MS !\n"); + dprintf_fixme(mciwave, "wodGetPosition() format not supported ! use TIME_MS !\n"); lpTime->wType = TIME_MS; case TIME_MS: lpTime->u.ms = WOutDev[wDevID].dwTotalPlayed / (WOutDev[wDevID].Format.wf.nAvgBytesPerSec / 1000); - dprintf_mciwave(stddeb,"wodGetPosition // TIME_MS=%lu\n", lpTime->u.ms); + dprintf_info(mciwave,"wodGetPosition // TIME_MS=%lu\n", lpTime->u.ms); break; } return MMSYSERR_NOERROR; @@ -1167,20 +1165,20 @@ static DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol) { int mixer; int volume, left, right; - dprintf_mciwave(stddeb,"wodGetVolume(%u, %p);\n", wDevID, lpdwVol); + dprintf_info(mciwave,"wodGetVolume(%u, %p);\n", wDevID, lpdwVol); if (lpdwVol == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDONLY)) < 0) { - dprintf_mciwave(stddeb, "Linux 'wodGetVolume' // mixer device not available !\n"); + dprintf_warn(mciwave, "Linux 'wodGetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } if (ioctl(mixer, SOUND_MIXER_READ_PCM, &volume) == -1) { - dprintf_mciwave(stddeb,"Linux 'wodGetVolume' // unable read mixer !\n"); + dprintf_warn(mciwave, "Linux 'wodGetVolume' // unable read mixer !\n"); return MMSYSERR_NOTENABLED; } close(mixer); left = volume & 0x7F; right = (volume >> 8) & 0x7F; - dprintf_mciwave(stddeb,"Linux 'wodGetVolume' // left=%d right=%d !\n", left, right); + dprintf_info(mciwave,"Linux 'wodGetVolume' // left=%d right=%d !\n", left, right); *lpdwVol = MAKELONG(left << 9, right << 9); return MMSYSERR_NOERROR; } @@ -1193,15 +1191,15 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam) { int mixer; int volume; - dprintf_mciwave(stddeb,"wodSetVolume(%u, %08lX);\n", wDevID, dwParam); + dprintf_info(mciwave,"wodSetVolume(%u, %08lX);\n", wDevID, dwParam); volume = (LOWORD(dwParam) >> 9 & 0x7F) + ((HIWORD(dwParam) >> 9 & 0x7F) << 8); if ((mixer = open(MIXER_DEV, O_WRONLY)) < 0) { - dprintf_mciwave(stddeb, "Linux 'wodSetVolume' // mixer device not available !\n"); + dprintf_warn(mciwave, "Linux 'wodSetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } if (ioctl(mixer, SOUND_MIXER_WRITE_PCM, &volume) == -1) { - dprintf_mciwave(stddeb,"Linux 'wodSetVolume' // unable set mixer !\n"); + dprintf_warn(mciwave, "Linux 'wodSetVolume' // unable set mixer !\n"); return MMSYSERR_NOTENABLED; } close(mixer); @@ -1214,7 +1212,7 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam) DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - dprintf_mciwave(stddeb,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n", + dprintf_info(mciwave,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch(wMsg) { case WODM_OPEN: @@ -1256,7 +1254,7 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case WODM_RESET: return wodReset(wDevID); default: - dprintf_mciwave(stddeb,"wodMessage // unknown message !\n"); + dprintf_warn(mciwave,"wodMessage // unknown message !\n"); } return MMSYSERR_NOTSUPPORTED; } @@ -1271,7 +1269,7 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS16 lpCaps, DWORD dwSize) { int audio,smplrate,samplesize=16,dsp_stereo=1,bytespersmpl; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widGetDevCaps(%u, %p, %lu);\n", wDevID, lpCaps, dwSize); if (lpCaps == NULL) return MMSYSERR_NOTENABLED; if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED; @@ -1323,7 +1321,7 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS16 lpCaps, DWORD dwSize) } } close(audio); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widGetDevCaps // dwFormats = %08lX\n", lpCaps->dwFormats); return MMSYSERR_NOERROR; } @@ -1337,43 +1335,43 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) int audio,abuf_size,smplrate,samplesize,dsp_stereo; LPWAVEFORMAT lpFormat; - dprintf_mciwave(stddeb, "widOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags); + dprintf_info(mciwave, "widOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { - dprintf_mciwave(stddeb,"Linux 'widOpen' // Invalid Parameter !\n"); + dprintf_warn(mciwave, "Linux 'widOpen' // Invalid Parameter !\n"); return MMSYSERR_INVALPARAM; } if (wDevID >= MAX_WAVINDRV) { - dprintf_mciwave(stddeb,"Linux 'widOpen' // MAX_WAVINDRV reached !\n"); + dprintf_info(mciwave,"Linux 'widOpen' // MAX_WAVINDRV reached !\n"); return MMSYSERR_ALLOCATED; } WInDev[wDevID].unixdev = 0; if (access(SOUND_DEV,0) != 0) return MMSYSERR_NOTENABLED; audio = open (SOUND_DEV, O_RDONLY, 0); if (audio == -1) { - dprintf_mciwave(stddeb,"Linux 'widOpen' // can't open !\n"); + dprintf_warn(mciwave,"Linux 'widOpen' // can't open !\n"); return MMSYSERR_ALLOCATED; } IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size); if (abuf_size < 1024 || abuf_size > 65536) { if (abuf_size == -1) - dprintf_mciwave(stddeb,"Linux 'widOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n"); + dprintf_warn(mciwave, "Linux 'widOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n"); else - dprintf_mciwave(stddeb,"Linux 'widOpen' // SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n"); + dprintf_warn(mciwave, "Linux 'widOpen' // SNDCTL_DSP_GETBLKSIZE Invalid bufsize !\n"); return MMSYSERR_NOTENABLED; } WInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); switch(WInDev[wDevID].wFlags) { case DCB_NULL: - dprintf_mciwave(stddeb,"Linux 'widOpen' // CALLBACK_NULL!\n"); + dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_NULL!\n"); break; case DCB_WINDOW: - dprintf_mciwave(stddeb,"Linux 'widOpen' // CALLBACK_WINDOW!\n"); + dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_WINDOW!\n"); break; case DCB_TASK: - dprintf_mciwave(stddeb,"Linux 'widOpen' // CALLBACK_TASK!\n"); + dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_TASK!\n"); break; case DCB_FUNCTION: - dprintf_mciwave(stddeb,"Linux 'widOpen' // CALLBACK_FUNCTION!\n"); + dprintf_info(mciwave,"Linux 'widOpen' // CALLBACK_FUNCTION!\n"); break; } if (WInDev[wDevID].lpQueueHdr) { @@ -1386,7 +1384,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) memcpy(&WInDev[wDevID].waveDesc, lpDesc, sizeof(WAVEOPENDESC)); lpFormat = (LPWAVEFORMAT) lpDesc->lpFormat; if (lpFormat->wFormatTag != WAVE_FORMAT_PCM) { - dprintf_mciwave(stddeb,"Linux 'widOpen' // Bad format %04X !\n", + dprintf_warn(mciwave, "Linux 'widOpen' // Bad format %04X !\n", lpFormat->wFormatTag); return WAVERR_BADFORMAT; } @@ -1406,16 +1404,16 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) IOCTL(audio, SNDCTL_DSP_SPEED, smplrate); IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize); IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo); - dprintf_mciwave(stddeb,"Linux 'widOpen' // wBitsPerSample=%u !\n", + dprintf_info(mciwave,"Linux 'widOpen' // wBitsPerSample=%u !\n", WInDev[wDevID].Format.wBitsPerSample); - dprintf_mciwave(stddeb,"Linux 'widOpen' // nSamplesPerSec=%lu !\n", + dprintf_info(mciwave,"Linux 'widOpen' // nSamplesPerSec=%lu !\n", WInDev[wDevID].Format.wf.nSamplesPerSec); - dprintf_mciwave(stddeb,"Linux 'widOpen' // nChannels=%u !\n", + dprintf_info(mciwave,"Linux 'widOpen' // nChannels=%u !\n", WInDev[wDevID].Format.wf.nChannels); - dprintf_mciwave(stddeb,"Linux 'widOpen' // nAvgBytesPerSec=%lu\n", + dprintf_info(mciwave,"Linux 'widOpen' // nAvgBytesPerSec=%lu\n", WInDev[wDevID].Format.wf.nAvgBytesPerSec); if (WAVE_NotifyClient(wDevID, WIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'widOpen' // can't notify client !\n"); + dprintf_warn(mciwave,"Linux 'widOpen' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -1426,21 +1424,21 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) */ static DWORD widClose(WORD wDevID) { - dprintf_mciwave(stddeb,"widClose(%u);\n", wDevID); + dprintf_info(mciwave,"widClose(%u);\n", wDevID); if (wDevID > MAX_WAVINDRV) return MMSYSERR_INVALPARAM; if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widClose' // can't close !\n"); + dprintf_warn(mciwave,"Linux 'widClose' // can't close !\n"); return MMSYSERR_NOTENABLED; } if (WInDev[wDevID].lpQueueHdr != NULL) { - dprintf_mciwave(stddeb,"linux 'widclose' // still buffers open !\n"); + dprintf_warn(mciwave, "linux 'widclose' // still buffers open !\n"); return WAVERR_STILLPLAYING; } close(WInDev[wDevID].unixdev); WInDev[wDevID].unixdev = 0; WInDev[wDevID].bufsize = 0; if (WAVE_NotifyClient(wDevID, WIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb,"Linux 'widClose' // can't notify client !\n"); + dprintf_warn(mciwave,"Linux 'widClose' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -1454,18 +1452,18 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) int count = 1; LPWAVEHDR lpWIHdr; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widAddBuffer(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widAddBuffer' // can't do it !\n"); + dprintf_warn(mciwave,"Linux 'widAddBuffer' // can't do it !\n"); return MMSYSERR_NOTENABLED; } if (!(lpWaveHdr->dwFlags & WHDR_PREPARED)) { - dprintf_mciwave(stddeb, "Linux 'widAddBuffer' // never been prepared !\n"); + dprintf_info(mciwave, "Linux 'widAddBuffer' // never been prepared !\n"); return WAVERR_UNPREPARED; } if (lpWaveHdr->dwFlags & WHDR_INQUEUE) { - dprintf_mciwave(stddeb, "Linux 'widAddBuffer' // header already in use !\n"); + dprintf_info(mciwave, "Linux 'widAddBuffer' // header already in use !\n"); return WAVERR_STILLPLAYING; } lpWaveHdr->dwFlags |= WHDR_PREPARED; @@ -1484,7 +1482,7 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->lpNext = NULL; count++; } - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widAddBuffer // buffer added ! (now %u in queue)\n", count); return MMSYSERR_NOERROR; } @@ -1494,10 +1492,10 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) */ static DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widPrepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widPrepare' // can't prepare !\n"); + dprintf_warn(mciwave,"Linux 'widPrepare' // can't prepare !\n"); return MMSYSERR_NOTENABLED; } if (lpWaveHdr->dwFlags & WHDR_INQUEUE) @@ -1506,7 +1504,7 @@ static DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags &= ~WHDR_DONE; lpWaveHdr->dwBytesRecorded = 0; - dprintf_mciwave(stddeb,"Linux 'widPrepare' // header prepared !\n"); + dprintf_info(mciwave,"Linux 'widPrepare' // header prepared !\n"); return MMSYSERR_NOERROR; } @@ -1515,17 +1513,17 @@ static DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) */ static DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widUnprepare(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widUnprepare' // can't unprepare !\n"); + dprintf_warn(mciwave,"Linux 'widUnprepare' // can't unprepare !\n"); return MMSYSERR_NOTENABLED; } lpWaveHdr->dwFlags &= ~WHDR_PREPARED; lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; - dprintf_mciwave(stddeb, "Linux 'widUnprepare' // all headers unprepared !\n"); + dprintf_info(mciwave, "Linux 'widUnprepare' // all headers unprepared !\n"); return MMSYSERR_NOERROR; } @@ -1539,22 +1537,22 @@ static DWORD widStart(WORD wDevID) LPWAVEHDR lpWIHdr; LPWAVEHDR *lpWaveHdr; - dprintf_mciwave(stddeb,"widStart(%u);\n", wDevID); + dprintf_info(mciwave,"widStart(%u);\n", wDevID); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb, "Linux 'widStart' // can't start recording !\n"); + dprintf_warn(mciwave, "Linux 'widStart' // can't start recording !\n"); return MMSYSERR_NOTENABLED; } lpWaveHdr = &(WInDev[wDevID].lpQueueHdr); - dprintf_mciwave(stddeb,"Linux 'widstart'// lpWaveHdr = %08lx\n",(DWORD)lpWaveHdr); + dprintf_info(mciwave,"Linux 'widstart'// lpWaveHdr = %08lx\n",(DWORD)lpWaveHdr); if (!*lpWaveHdr || !(*lpWaveHdr)->lpData) { - dprintf_mciwave(stddeb,"Linux 'widStart' // never been prepared !\n"); + dprintf_info(mciwave,"Linux 'widStart' // never been prepared !\n"); return WAVERR_UNPREPARED; } while(*lpWaveHdr != NULL) { lpWIHdr = *lpWaveHdr; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widStart // recording buf#%u=%p size=%lu \n", count, lpWIHdr->lpData, lpWIHdr->dwBufferLength); fflush(stddeb); @@ -1571,14 +1569,14 @@ static DWORD widStart(WORD wDevID) /* FIXME: should pass segmented pointer here, do we need that?*/ if (WAVE_NotifyClient(wDevID, WIM_DATA, (DWORD)lpWaveHdr, lpWIHdr->dwBytesRecorded) != MMSYSERR_NOERROR) { - dprintf_mciwave(stddeb, "Linux 'widStart' // can't notify client !\n"); + dprintf_warn(mciwave, "Linux 'widStart' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } /* removes the current block from the queue */ *lpWaveHdr = lpWIHdr->lpNext; count++; } - dprintf_mciwave(stddeb,"widStart // end of recording !\n"); + dprintf_info(mciwave,"widStart // end of recording !\n"); fflush(stddeb); return MMSYSERR_NOERROR; } @@ -1588,9 +1586,9 @@ static DWORD widStart(WORD wDevID) */ static DWORD widStop(WORD wDevID) { - dprintf_mciwave(stddeb,"widStop(%u);\n", wDevID); + dprintf_info(mciwave,"widStop(%u);\n", wDevID); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widStop' // can't stop !\n"); + dprintf_warn(mciwave,"Linux 'widStop' // can't stop !\n"); return MMSYSERR_NOTENABLED; } return MMSYSERR_NOERROR; @@ -1601,9 +1599,9 @@ static DWORD widStop(WORD wDevID) */ static DWORD widReset(WORD wDevID) { - dprintf_mciwave(stddeb,"widReset(%u);\n", wDevID); + dprintf_info(mciwave,"widReset(%u);\n", wDevID); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widReset' // can't reset !\n"); + dprintf_warn(mciwave,"Linux 'widReset' // can't reset !\n"); return MMSYSERR_NOTENABLED; } return MMSYSERR_NOERROR; @@ -1616,34 +1614,34 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME16 lpTime, DWORD uSize) { int time; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widGetPosition(%u, %p, %lu);\n", wDevID, lpTime, uSize); if (WInDev[wDevID].unixdev == 0) { - dprintf_mciwave(stddeb,"Linux 'widGetPosition' // can't get pos !\n"); + dprintf_warn(mciwave,"Linux 'widGetPosition' // can't get pos !\n"); return MMSYSERR_NOTENABLED; } if (lpTime == NULL) return MMSYSERR_INVALPARAM; - dprintf_mciwave(stddeb,"widGetPosition // wType=%04X !\n", + dprintf_info(mciwave,"widGetPosition // wType=%04X !\n", lpTime->wType); - dprintf_mciwave(stddeb,"widGetPosition // wBitsPerSample=%u\n", + dprintf_info(mciwave,"widGetPosition // wBitsPerSample=%u\n", WInDev[wDevID].Format.wBitsPerSample); - dprintf_mciwave(stddeb,"widGetPosition // nSamplesPerSec=%lu\n", + dprintf_info(mciwave,"widGetPosition // nSamplesPerSec=%lu\n", WInDev[wDevID].Format.wf.nSamplesPerSec); - dprintf_mciwave(stddeb,"widGetPosition // nChannels=%u\n", + dprintf_info(mciwave,"widGetPosition // nChannels=%u\n", WInDev[wDevID].Format.wf.nChannels); - dprintf_mciwave(stddeb,"widGetPosition // nAvgBytesPerSec=%lu\n", + dprintf_info(mciwave,"widGetPosition // nAvgBytesPerSec=%lu\n", WInDev[wDevID].Format.wf.nAvgBytesPerSec); fflush(stddeb); switch(lpTime->wType) { case TIME_BYTES: lpTime->u.cb = WInDev[wDevID].dwTotalRecorded; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widGetPosition // TIME_BYTES=%lu\n", lpTime->u.cb); break; case TIME_SAMPLES: lpTime->u.sample = WInDev[wDevID].dwTotalRecorded * 8 / WInDev[wDevID].Format.wBitsPerSample; - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widGetPosition // TIME_SAMPLES=%lu\n", lpTime->u.sample); break; @@ -1658,17 +1656,17 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME16 lpTime, DWORD uSize) time -= lpTime->u.smpte.sec * 30; lpTime->u.smpte.frame = time; lpTime->u.smpte.fps = 30; -dprintf_mciwave(stddeb,"widGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n", +dprintf_info(mciwave,"widGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n", lpTime->u.smpte.hour, lpTime->u.smpte.min, lpTime->u.smpte.sec, lpTime->u.smpte.frame); break; default: - dprintf_mciwave(stddeb,"widGetPosition() format not supported ! use TIME_MS !\n"); + dprintf_fixme(mciwave, "widGetPosition() format not supported ! use TIME_MS !\n"); lpTime->wType = TIME_MS; case TIME_MS: lpTime->u.ms = WInDev[wDevID].dwTotalRecorded / (WInDev[wDevID].Format.wf.nAvgBytesPerSec / 1000); - dprintf_mciwave(stddeb, + dprintf_info(mciwave, "widGetPosition // TIME_MS=%lu\n", lpTime->u.ms); break; } @@ -1681,7 +1679,7 @@ dprintf_mciwave(stddeb,"widGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n", DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - dprintf_mciwave(stddeb,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n", + dprintf_info(mciwave,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch(wMsg) { case WIDM_OPEN: @@ -1709,7 +1707,7 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case WIDM_STOP: return widStop(wDevID); default: - dprintf_mciwave(stddeb,"widMessage // unknown message !\n"); + dprintf_warn(mciwave,"widMessage // unknown message !\n"); } return MMSYSERR_NOTSUPPORTED; } @@ -1721,7 +1719,7 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { - dprintf_mciwave(stddeb,"WAVE_DriverProc(%08lX, %04X, %04X, %08lX, %08lX)\n", + dprintf_info(mciwave,"WAVE_DriverProc(%08lX, %04X, %04X, %08lX, %08lX)\n", dwDevID, hDriv, wMsg, dwParam1, dwParam2); switch(wMsg) { case DRV_LOAD: diff --git a/multimedia/dsound.c b/multimedia/dsound.c index e931f78c6ad..a719048fe46 100644 --- a/multimedia/dsound.c +++ b/multimedia/dsound.c @@ -42,7 +42,6 @@ #include "mmsystem.h" #include "dsound.h" #include "thread.h" -#include "stddebug.h" #include "debug.h" #ifdef HAVE_OSS @@ -50,7 +49,6 @@ #include static int audiofd = -1; -static int current_buffered_frags = 4; static LPDIRECTSOUND dsound = NULL; static short playbuf[2048]; @@ -98,7 +96,7 @@ static HRESULT WINAPI IDirectSoundNotify_QueryInterface( ) { char xbuf[50]; - StringFromCLSID(riid,xbuf); + WINE_StringFromCLSID(riid,xbuf); fprintf(stderr,"IDirectSound(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj); return E_FAIL; } @@ -129,9 +127,11 @@ static HRESULT WINAPI IDirectSoundNotify_SetNotificationPositions( ) { int i; - fprintf(stderr,"IDirectSoundNotify(%p)->SetNotificationPositions(0x%08lx,%p),stub!\n",this,howmuch,notify); - for (i=0;iSetNotificationPositions(0x%08lx,%p)\n",this,howmuch,notify); + for (i=0;idsb->notifies = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,this->dsb->notifies,(this->dsb->nrofnotifies+howmuch)*sizeof(DSBPOSITIONNOTIFY)); memcpy( this->dsb->notifies+this->dsb->nrofnotifies, notify, @@ -139,8 +139,6 @@ static HRESULT WINAPI IDirectSoundNotify_SetNotificationPositions( ); this->dsb->nrofnotifies+=howmuch; qsort(this->dsb->notifies,this->dsb->nrofnotifies,sizeof(DSBPOSITIONNOTIFY),_sort_notifies); - for (i=0;idsb->nrofnotifies;i++) - fprintf(stderr," notify at %ld to 0x%08lx\n",this->dsb->notifies[i].dwOffset,this->dsb->notifies[i].hEventNotify); return 0; } @@ -159,9 +157,9 @@ static HRESULT WINAPI IDirectSoundBuffer_SetFormat( ) { memcpy(&(this->wfx),wfex,sizeof(this->wfx)); - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->SetFormat(%p),stub!\n", + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->SetFormat(%p)\n", this,wfex); - dprintf_dsound(stderr," [formattag=0x%04x,chans=%d,samplerate=%ld" + dprintf_info(dsound," [formattag=0x%04x,chans=%d,samplerate=%ld" "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d]\n", wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec, wfex->nAvgBytesPerSec, wfex->nBlockAlign, @@ -173,15 +171,16 @@ static HRESULT WINAPI IDirectSoundBuffer_SetFormat( static HRESULT WINAPI IDirectSoundBuffer_SetVolume( LPDIRECTSOUNDBUFFER this,LONG vol ) { - fprintf(stderr,"IDirectSoundBuffer(%p)->SetVolume(%ld),stub!\n",this,vol); + fprintf(stderr,"IDirectSoundBuffer(%p)->SetVolume(%ld)\n",this,vol); this->volume = vol; + this->volfac = ((double)vol+10000.0)/10000.0; return 0; } static HRESULT WINAPI IDirectSoundBuffer_GetVolume( LPDIRECTSOUNDBUFFER this,LPLONG vol ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->GetVolume(%p),stub!\n",this,vol); + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->GetVolume(%p)\n",this,vol); *vol = this->volume; return 0; } @@ -189,14 +188,16 @@ static HRESULT WINAPI IDirectSoundBuffer_GetVolume( static HRESULT WINAPI IDirectSoundBuffer_SetFrequency( LPDIRECTSOUNDBUFFER this,DWORD freq ) { - fprintf(stderr,"IDirectSoundBuffer(%p)->SetFrequency(%08lx),stub!\n",this,freq); + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->SetFrequency(%ld)\n",this,freq); + this->wfx.nSamplesPerSec = freq; + this->wfx.nAvgBytesPerSec = freq*this->wfx.nChannels*(this->wfx.wBitsPerSample/8); return 0; } static HRESULT WINAPI IDirectSoundBuffer_Play( LPDIRECTSOUNDBUFFER this,DWORD reserved1,DWORD reserved2,DWORD flags ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->Play(%08lx,%08lx,%08lx),stub!\n", + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->Play(%08lx,%08lx,%08lx)\n", this,reserved1,reserved2,flags ); this->playpos = 0; @@ -206,7 +207,7 @@ static HRESULT WINAPI IDirectSoundBuffer_Play( } static HRESULT WINAPI IDirectSoundBuffer_Stop(LPDIRECTSOUNDBUFFER this) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->Stop()\n",this); + dprintf_info(dsound,"IDirectSoundBuffer(%p)->Stop()\n",this); this->playing = 0; this->writepos = 0; /* hmm */ return 0; @@ -240,7 +241,7 @@ static DWORD WINAPI IDirectSoundBuffer_Release(LPDIRECTSOUNDBUFFER this) { static HRESULT WINAPI IDirectSoundBuffer_GetCurrentPosition( LPDIRECTSOUNDBUFFER this,LPDWORD playpos,LPDWORD writepos ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->GetCurrentPosition(%p,%p),stub!\n",this,playpos,writepos); + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->GetCurrentPosition(%p,%p)\n",this,playpos,writepos); if (playpos) *playpos = this->playpos; if (writepos) *writepos = this->writepos; return 0; @@ -249,7 +250,7 @@ static HRESULT WINAPI IDirectSoundBuffer_GetCurrentPosition( static HRESULT WINAPI IDirectSoundBuffer_GetStatus( LPDIRECTSOUNDBUFFER this,LPDWORD status ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->GetStatus(%p)\n",this,status); + dprintf_info(dsound,"IDirectSoundBuffer(%p)->GetStatus(%p)\n",this,status); *status = 0; if (this->playing) *status |= DSBSTATUS_PLAYING; @@ -261,7 +262,7 @@ static HRESULT WINAPI IDirectSoundBuffer_GetStatus( static HRESULT WINAPI IDirectSoundBuffer_GetFormat( LPDIRECTSOUNDBUFFER this,LPWAVEFORMATEX lpwf,DWORD wfsize,LPDWORD wfwritten ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->GetFormat(%p,%ld,%p)\n",this,lpwf,wfsize,wfwritten); + dprintf_info(dsound,"IDirectSoundBuffer(%p)->GetFormat(%p,%ld,%p)\n",this,lpwf,wfsize,wfwritten); if (wfsize>sizeof(this->wfx)) wfsize = sizeof(this->wfx); memcpy(lpwf,&(this->wfx),wfsize); if (wfwritten) *wfwritten = wfsize; @@ -272,7 +273,7 @@ static HRESULT WINAPI IDirectSoundBuffer_Lock( LPDIRECTSOUNDBUFFER this,DWORD writecursor,DWORD writebytes,LPVOID lplpaudioptr1,LPDWORD audiobytes1,LPVOID lplpaudioptr2,LPDWORD audiobytes2,DWORD flags ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->Lock(%ld,%ld,%p,%p,%p,%p,0x%08lx)\n", + dprintf_info(dsound,"IDirectSoundBuffer(%p)->Lock(%ld,%ld,%p,%p,%p,%p,0x%08lx)\n", this, writecursor, writebytes, @@ -293,7 +294,7 @@ static HRESULT WINAPI IDirectSoundBuffer_Lock( *(LPBYTE*)lplpaudioptr2 = NULL; if (audiobytes2) *audiobytes2 = 0; - dprintf_dsound(stderr,"->%ld.0\n",writebytes); + dprintf_info(dsound,"->%ld.0\n",writebytes); } else { *(LPBYTE*)lplpaudioptr1 = this->buffer+writecursor; *audiobytes1 = this->buflen-writecursor; @@ -301,7 +302,7 @@ static HRESULT WINAPI IDirectSoundBuffer_Lock( *(LPBYTE*)lplpaudioptr2 = this->buffer; if (audiobytes2) *audiobytes2 = writebytes-(this->buflen-writecursor); - dprintf_dsound(stderr,"->%ld.%ld\n",*audiobytes1,audiobytes2?*audiobytes2:0); + dprintf_info(dsound,"->%ld.%ld\n",*audiobytes1,audiobytes2?*audiobytes2:0); } this->writepos=(writecursor+writebytes)%this->buflen; return 0; @@ -310,7 +311,7 @@ static HRESULT WINAPI IDirectSoundBuffer_Lock( static HRESULT WINAPI IDirectSoundBuffer_SetCurrentPosition( LPDIRECTSOUNDBUFFER this,DWORD newpos ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->SetCurrentPosition(%ld)\n",this,newpos); + dprintf_info(dsound,"IDirectSoundBuffer(%p)->SetCurrentPosition(%ld)\n",this,newpos); this->playpos = newpos; return 0; } @@ -318,7 +319,7 @@ static HRESULT WINAPI IDirectSoundBuffer_SetCurrentPosition( static HRESULT WINAPI IDirectSoundBuffer_SetPan( LPDIRECTSOUNDBUFFER this,LONG newpan ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->SetPan(%ld),stub!\n",this,newpan); + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->SetPan(%ld)\n",this,newpan); this->pan = newpan; return 0; } @@ -326,7 +327,7 @@ static HRESULT WINAPI IDirectSoundBuffer_SetPan( static HRESULT WINAPI IDirectSoundBuffer_GetPan( LPDIRECTSOUNDBUFFER this,LPLONG pan ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->GetPan(%p),stub!\n",this,pan); + dprintf_fixme(dsound,"IDirectSoundBuffer(%p)->GetPan(%p)\n",this,pan); *pan = this->pan; return 0; } @@ -334,7 +335,7 @@ static HRESULT WINAPI IDirectSoundBuffer_GetPan( static HRESULT WINAPI IDirectSoundBuffer_Unlock( LPDIRECTSOUNDBUFFER this,LPVOID p1,DWORD x1,LPVOID p2,DWORD x2 ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->Unlock(%p,%ld,%p,%ld)\n", + dprintf_info(dsound,"IDirectSoundBuffer(%p)->Unlock(%p,%ld,%p,%ld)\n", this,p1,x1,p2,x2 ); return 0; @@ -343,7 +344,7 @@ static HRESULT WINAPI IDirectSoundBuffer_Unlock( static HRESULT WINAPI IDirectSoundBuffer_GetFrequency( LPDIRECTSOUNDBUFFER this,LPDWORD freq ) { - dprintf_dsound(stderr,"IDirectSoundBuffer(%p)->GetFrequency(%p)\n", + dprintf_info(dsound,"IDirectSoundBuffer(%p)->GetFrequency(%p)\n", this,freq ); *freq = this->wfx.nSamplesPerSec; @@ -353,7 +354,7 @@ static HRESULT WINAPI IDirectSoundBuffer_GetFrequency( static HRESULT WINAPI IDirectSoundBuffer_Initialize( LPDIRECTSOUNDBUFFER this,LPDIRECTSOUND dsound,LPDSBUFFERDESC dbsd ) { - fprintf(stderr,"IDirectSoundBuffer(%p)->Initialize(%p,%p),stub!\n",this,dsound,dbsd); + fprintf(stderr,"IDirectSoundBuffer(%p)->Initialize(%p,%p)\n",this,dsound,dbsd); return DSERR_ALREADYINITIALIZED; } @@ -384,7 +385,7 @@ static HRESULT WINAPI IDirectSoundBuffer_QueryInterface( *ppobj = (LPVOID)dsn; return 0; } - StringFromCLSID(riid,xbuf); + WINE_StringFromCLSID(riid,xbuf); fprintf(stderr,"IDirectSoundBuffer(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj); return E_FAIL; } @@ -419,7 +420,7 @@ static struct tagLPDIRECTSOUNDBUFFER_VTABLE dsbvt = { static HRESULT WINAPI IDirectSound_SetCooperativeLevel( LPDIRECTSOUND this,HWND32 hwnd,DWORD level ) { - dprintf_dsound(stderr,"IDirectSound(%p)->SetCooperativeLevel(%08lx,%ld)\n", + dprintf_info(dsound,"IDirectSound(%p)->SetCooperativeLevel(%08lx,%ld)\n", this,(DWORD)hwnd,level ); return 0; @@ -429,8 +430,8 @@ static HRESULT WINAPI IDirectSound_SetCooperativeLevel( static HRESULT WINAPI IDirectSound_CreateSoundBuffer( LPDIRECTSOUND this,LPDSBUFFERDESC dsbd,LPLPDIRECTSOUNDBUFFER ppdsb,LPUNKNOWN lpunk ) { - if (debugging_dsound) { - fprintf(stderr,"IDirectSound(%p)->CreateSoundBuffer(%p,%p,%p),stub!\n",this,dsbd,ppdsb,lpunk); + if (debugging_info(dsound)) { + fprintf(stderr,"IDirectSound(%p)->CreateSoundBuffer(%p,%p,%p)\n",this,dsbd,ppdsb,lpunk); fprintf(stderr,"[size=%ld,",dsbd->dwSize); fprintf(stderr,"flags = 0x%08lx,",dsbd->dwFlags); _dump_DSBCAPS(dsbd->dwFlags); @@ -446,6 +447,7 @@ static HRESULT WINAPI IDirectSound_CreateSoundBuffer( (*ppdsb)->lpvtbl = &dsbvt; (*ppdsb)->dsound = this; (*ppdsb)->playing = 0; + (*ppdsb)->volfac = 1.0; memcpy(&((*ppdsb)->dsbd),dsbd,sizeof(*dsbd)); /* register buffer */ @@ -461,7 +463,7 @@ static HRESULT WINAPI IDirectSound_CreateSoundBuffer( static HRESULT WINAPI IDirectSound_DuplicateSoundBuffer( LPDIRECTSOUND this,LPDIRECTSOUNDBUFFER pdsb,LPLPDIRECTSOUNDBUFFER ppdsb ) { - fprintf(stderr,"IDirectSound(%p)->DuplicateSoundBuffer(%p,%p),stub!\n",this,pdsb,ppdsb); + dprintf_fixme(dsound,"IDirectSound(%p)->DuplicateSoundBuffer(%p,%p)\n",this,pdsb,ppdsb); *ppdsb = (LPDIRECTSOUNDBUFFER)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundBuffer)); (*ppdsb)->ref =1; @@ -483,8 +485,8 @@ static HRESULT WINAPI IDirectSound_DuplicateSoundBuffer( static HRESULT WINAPI IDirectSound_GetCaps(LPDIRECTSOUND this,LPDSCAPS caps) { - fprintf(stderr,"IDirectSound(%p)->GetCaps(%p),stub!\n",this,caps); - fprintf(stderr," flags = 0x%08lx\n",caps->dwFlags); + dprintf_fixme(dsound,"IDirectSound(%p)->GetCaps(%p)\n",this,caps); + dprintf_fixme(dsound," flags = 0x%08lx\n",caps->dwFlags); caps->dwSize = sizeof(*caps); caps->dwFlags = DSCAPS_PRIMARYSTEREO|DSCAPS_PRIMARY16BIT|DSCAPS_EMULDRIVER|DSCAPS_SECONDARYSTEREO|DSCAPS_SECONDARY16BIT; @@ -522,7 +524,7 @@ static HRESULT WINAPI IDirectSound_QueryInterface( ) { char xbuf[50]; - StringFromCLSID(riid,xbuf); + WINE_StringFromCLSID(riid,xbuf); fprintf(stderr,"IDirectSound(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj); return E_FAIL; } @@ -545,14 +547,19 @@ static int DSOUND_setformat(LPWAVEFORMATEX wfex) { int xx,channels,speed,format,nformat; + switch (wfex->wFormatTag) { default: fprintf(stderr,"unknown WAVE_FORMAT tag %d\n",wfex->wFormatTag); return DSERR_BADFORMAT; case WAVE_FORMAT_PCM: - format = AFMT_S16_LE; break; } + if (wfex->wBitsPerSample==8) + format = AFMT_U8; + else + format = AFMT_S16_LE; + if (-1==ioctl(audiofd,SNDCTL_DSP_GETFMTS,&xx)) { perror("ioctl SNDCTL_DSP_GETFMTS"); return -1; @@ -581,6 +588,9 @@ DSOUND_setformat(LPWAVEFORMATEX wfex) { perror("ioctl SNDCTL_DSP_SPEED"); return -1; } + fprintf(stderr,"freq %ld channels %d bits %d\n", + wfex->nSamplesPerSec,wfex->nChannels,wfex->wBitsPerSample + ); return 0; } @@ -610,68 +620,137 @@ DSOUND_nextevent(IDirectSoundBuffer *dsb) { static void DSOUND_MixInBuffer(IDirectSoundBuffer *dsb) { - int i,j,buflen = dsb->buflen; + int j,buflen = dsb->buflen; LPDSBPOSITIONNOTIFY nextevent; + int xdiff = dsb->wfx.nSamplesPerSec-dsound->wfx.nSamplesPerSec; + double volfac = dsb->volfac; - if (dsb->wfx.nSamplesPerSec != dsound->wfx.nSamplesPerSec) { - fprintf(stderr,"mixing in buffer of different frequency, argh!\n"); + if (xdiff<0) xdiff=-xdiff; + if (xdiff>1500) { + fprintf(stderr,"mixing in buffer of different frequency (%ld vs %ld), argh!\n",dsb->wfx.nSamplesPerSec,dsound->wfx.nSamplesPerSec); } nextevent = DSOUND_nextevent(dsb); +/* fprintf(stderr,"%d.%d.%d.%d\n",dsound->wfx.wBitsPerSample,dsb->wfx.wBitsPerSample,dsound->wfx.nChannels,dsb->wfx.nChannels);*/ - if (dsb->wfx.wBitsPerSample == 8) { - unsigned char *xbuf = (unsigned char*)(dsb->buffer); - if (dsb->wfx.nChannels == 1) { - for (j=0;jplaypos=(dsb->playpos+1)%buflen; - if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { - dsb->playing = 0; - dsb->playpos = buflen; - return; + if (dsound->wfx.wBitsPerSample == 8) { + char *playbuf8 = (char*)playbuf; + + if (dsb->wfx.wBitsPerSample == 8) { + unsigned char *xbuf = (unsigned char*)(dsb->buffer); + if (dsb->wfx.nChannels == 1) { + for (j=0;jplaypos=(dsb->playpos+1)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + playbuf8[(j<<1) ]+=xbuf[dsb->playpos]*volfac; + playbuf8[(j<<1)+1]+=xbuf[dsb->playpos]*volfac; + CHECK_EVENT + } + } else { + for (j=0;jplaypos=(dsb->playpos+1)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + playbuf8[j]+=xbuf[dsb->playpos]*volfac; + CHECK_EVENT } - /* FIXME: pan,volume */ - playbuf[(j<<1) ]+=xbuf[dsb->playpos]<<8; - playbuf[(j<<1)+1]+=xbuf[dsb->playpos]<<8; - CHECK_EVENT } - } else { - for (j=0;jplaypos=(dsb->playpos+1)%buflen; - if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { - dsb->playing = 0; - dsb->playpos = buflen; - return; + } else { /* 16 */ + short *xbuf = (short*)(dsb->buffer); + if (dsb->wfx.nChannels == 1) { + for (j=0;jplaypos=(dsb->playpos+2)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + playbuf8[(j<<1) ]+=(xbuf[dsb->playpos>>1]>>8)*volfac; + playbuf8[(j<<1)+1]+=(xbuf[dsb->playpos>>1]>>8)*volfac; + CHECK_EVENT + } + } else { + for (j=0;jplaypos=(dsb->playpos+2)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + playbuf8[j]+=(xbuf[dsb->playpos>>1]>>8)*volfac; + CHECK_EVENT } - /* FIXME: pan,volume */ - playbuf[j]+=xbuf[dsb->playpos]<<8; - CHECK_EVENT } } - } else { /* 16 */ - short *xbuf = (short*)(dsb->buffer); - if (dsb->wfx.nChannels == 1) { - for (j=0;jplaypos=(dsb->playpos+2)%buflen; - if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { - dsb->playing = 0; - dsb->playpos = buflen; - return; + } else { /* 16 bit */ + if (dsb->wfx.wBitsPerSample == 8) { + unsigned char *xbuf = (unsigned char*)(dsb->buffer); + if (dsb->wfx.nChannels == 1) { + for (j=0;jplaypos=(dsb->playpos+1)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + /* FIXME: should be *256 */ + playbuf[(j<<1) ]+=(xbuf[dsb->playpos]<<7)*volfac; + playbuf[(j<<1)+1]+=(xbuf[dsb->playpos]<<7)*volfac; + CHECK_EVENT + } + } else { + for (j=0;jplaypos=(dsb->playpos+1)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + /* FIXME: should be *256 */ + playbuf[j]+=(xbuf[dsb->playpos]<<7)*volfac; + CHECK_EVENT } - /* FIXME: pan,volume */ - playbuf[(j<<1) ]+=xbuf[dsb->playpos>>1]; - playbuf[(j<<1)+1]+=xbuf[dsb->playpos>>1]; - CHECK_EVENT } - } else { - for (j=0;jplaypos=(dsb->playpos+2)%buflen; - if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { - dsb->playing = 0; - dsb->playpos = buflen; - return; + } else { /* 16 */ + short *xbuf = (short*)(dsb->buffer); + if (dsb->wfx.nChannels == 1) { + for (j=0;jplaypos=(dsb->playpos+2)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + playbuf[(j<<1) ]+=(xbuf[dsb->playpos>>1]*volfac); + playbuf[(j<<1)+1]+=(xbuf[dsb->playpos>>1]*volfac); + CHECK_EVENT + } + } else { + for (j=0;jplaypos=(dsb->playpos+2)%buflen; + if (!dsb->playpos && !(dsb->playflags&DSBPLAY_LOOPING)) { + dsb->playing = 0; + dsb->playpos = buflen; + return; + } + /* FIXME: pan,volume */ + playbuf[j]+=xbuf[dsb->playpos>>1]*volfac; + CHECK_EVENT } - /* FIXME: pan,volume */ - playbuf[j]+=xbuf[dsb->playpos>>1]; - CHECK_EVENT } } } @@ -679,17 +758,20 @@ DSOUND_MixInBuffer(IDirectSoundBuffer *dsb) { static DWORD DSOUND_thread(LPVOID arg) { - int fragsdiff,res,i,curleft,playing; + int res,i,curleft,playing,haveprimary = 0; struct audio_buf_info abi; fprintf(stderr,"dsound is at pid %d\n",getpid()); ioctl(audiofd,SNDCTL_DSP_GETOSPACE,&abi); - fragsdiff = abi.fragstotal-abi.fragments; while (1) { if (!dsound) { fprintf(stderr,"DSOUND thread giving up.\n"); ExitThread(0); } + if (getppid()==1) { + fprintf(stderr,"DSOUND father died? Giving up.\n"); + ExitThread(0); + } /* RACE: dsound could be deleted */ dsound->lpvtbl->fnAddRef(dsound); if (!dsound->nrofbuffers) { @@ -698,20 +780,17 @@ DSOUND_thread(LPVOID arg) { continue; } memset(playbuf,0,sizeof(playbuf)); - /* empty in memory soundbuffers */ - while (1) { - ioctl(audiofd,SNDCTL_DSP_GETOSPACE,&abi); - if (abi.fragstotal-abi.fragments<=fragsdiff+current_buffered_frags) - break; - Sleep(1); - } playing = 0; dsound->lpvtbl->fnAddRef(dsound); + haveprimary = 0; for (i=dsound->nrofbuffers;i--;) { IDirectSoundBuffer *dsb = dsound->buffers[i]; dsb->lpvtbl->fnAddRef(dsb); + if (dsb->playing && dsb->buflen) + playing++; if (dsb->dsbd.dwFlags & DSBCAPS_PRIMARYBUFFER) { + haveprimary = 1; if (memcmp(&dsound->wfx,&(dsb->wfx),sizeof(dsound->wfx))) { DSOUND_setformat(&(dsb->wfx)); memcpy(&dsound->wfx,&(dsb->wfx),sizeof(dsb->wfx)); @@ -719,6 +798,21 @@ DSOUND_thread(LPVOID arg) { } dsb->lpvtbl->fnRelease(dsb); } + /* We have just one playbuffer, so use its format */ + if ((playing==1) && !haveprimary) { + for (i=dsound->nrofbuffers;i--;) { + IDirectSoundBuffer *dsb = dsound->buffers[i]; + + dsb->lpvtbl->fnAddRef(dsb); + if (dsb->playing && dsb->buflen) { + if (memcmp(&dsound->wfx,&(dsb->wfx),sizeof(dsound->wfx))) { + DSOUND_setformat(&(dsb->wfx)); + memcpy(&dsound->wfx,&(dsb->wfx),sizeof(dsb->wfx)); + } + } + dsb->lpvtbl->fnRelease(dsb); + } + } for (i=dsound->nrofbuffers;i--;) { IDirectSoundBuffer *dsb = dsound->buffers[i]; @@ -733,12 +827,6 @@ DSOUND_thread(LPVOID arg) { /*fputc('0'+playing,stderr);*/ curleft = 0; - ioctl(audiofd,SNDCTL_DSP_GETOSPACE,&abi); - if ((abi.fragstotal-abi.fragments)<=1+fragsdiff) { - current_buffered_frags++; - } else if ((abi.fragstotal-abi.fragments)>2+fragsdiff) { - current_buffered_frags--; - } while (curleft < sizeof(playbuf)) { res = write(audiofd,(LPBYTE)playbuf+curleft,sizeof(playbuf)-curleft); if (res==-1) { @@ -755,6 +843,7 @@ DSOUND_thread(LPVOID arg) { #endif /* HAVE_OSS */ HRESULT WINAPI DirectSoundCreate(LPGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pUnkOuter ) { + int xx; if (lpGUID) fprintf(stderr,"DirectSoundCreate(%p,%p,%p)\n",lpGUID,ppDS,pUnkOuter); #ifdef HAVE_OSS @@ -766,11 +855,12 @@ HRESULT WINAPI DirectSoundCreate(LPGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pUn audiofd=0; return DSERR_NODRIVER; } - /* - xx=0x0004000c; + xx=0x0002000c; if (-1==ioctl(audiofd,SNDCTL_DSP_SETFRAGMENT,&xx)) perror("ioctl SETFRAGMENT"); - */ + fprintf(stderr,"SETFRAGMENT. count is now %d, fragsize is %d\n", + (xx>>16)+1,xx&0xffff + ); *ppDS = (LPDIRECTSOUND)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectSound)); (*ppDS)->ref = 1; diff --git a/multimedia/joystick.c b/multimedia/joystick.c index 15dd0fa6e5c..ae1c5686bba 100644 --- a/multimedia/joystick.c +++ b/multimedia/joystick.c @@ -25,7 +25,6 @@ #include "user.h" #include "driver.h" #include "mmsystem.h" -#include "stddebug.h" #include "debug.h" #define MAXJOYDRIVERS 4 @@ -95,7 +94,7 @@ void joySendMessages(void) } else return; if (joyCaptured == FALSE) return; - dprintf_mmsys(stddeb, "JoySendMessages()\n"); + dprintf_info(mmsys, "JoySendMessages()\n"); for (joy=0; joy < MAXJOYDRIVERS; joy++) { if (joyOpenDriver(joy) == FALSE) continue; dev_stat = read(joy_dev[joy], &js, sizeof(js)); @@ -138,14 +137,16 @@ UINT16 WINAPI joyGetNumDevs16(void) int joy; UINT16 joy_cnt = 0; - dprintf_mmsys(stddeb, "JoyGetNumDevs: "); for (joy=0; joy= 2.1.45 to be able to use joysticks.\n"); + dprintf_info(mmsys, "returning %d\n", joy_cnt); + if (!joy_cnt) fprintf(stderr, "No joystick found - " + "perhaps get joystick-0.8.0.tar.gz and load" + "it as module or use Linux >= 2.1.45 to be " + "able to use joysticks.\n"); return joy_cnt; } @@ -225,7 +226,7 @@ MMRESULT32 WINAPI joyGetDevCaps32W(UINT32 wID, LPJOYCAPS32W lpCaps,UINT32 wSize) */ MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) { - dprintf_mmsys(stderr, "JoyGetDevCaps(%04X, %p, %d);\n", + dprintf_info(mmsys, "JoyGetDevCaps(%04X, %p, %d);\n", wID, lpCaps, wSize); if (joyOpenDriver(wID) == TRUE) { lpCaps->wMid = MM_MICROSOFT; @@ -265,7 +266,7 @@ MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) /************************************************************************** * JoyGetPosEx [WINMM.31] */ -MMRESULT32 WINAPI joyGetPosEx(UINT32 wID, LPJOYINFO32 lpInfo) +MMRESULT32 WINAPI joyGetPosEx(UINT32 wID, LPJOYINFOEX lpInfo) { /* FIXME: implement it */ return MMSYSERR_NODRIVER; @@ -293,7 +294,7 @@ MMRESULT16 WINAPI joyGetPos16(UINT16 wID, LPJOYINFO16 lpInfo) { struct js_status js; - dprintf_mmsys(stderr, "JoyGetPos(%04X, %p)\n", wID, lpInfo); + dprintf_info(mmsys, "JoyGetPos(%04X, %p)\n", wID, lpInfo); if (joyOpenDriver(wID) == FALSE) return MMSYSERR_NODRIVER; dev_stat = read(joy_dev[wID], &js, sizeof(js)); if (dev_stat != sizeof(js)) { @@ -307,7 +308,7 @@ MMRESULT16 WINAPI joyGetPos16(UINT16 wID, LPJOYINFO16 lpInfo) lpInfo->wYpos = js.y; lpInfo->wZpos = 0; /* FIXME: Don't know what to do with this value as joystick driver doesn't provide a Z value */ lpInfo->wButtons = js.buttons; - dprintf_mmsys(stderr, "JoyGetPos: x: %d, y: %d, buttons: %d\n", js.x, js.y, js.buttons); + dprintf_info(mmsys, "JoyGetPos: x: %d, y: %d, buttons: %d\n", js.x, js.y, js.buttons); return JOYERR_NOERROR; } @@ -328,7 +329,7 @@ MMRESULT32 WINAPI joyGetThreshold32(UINT32 wID, LPUINT32 lpThreshold) */ MMRESULT16 WINAPI joyGetThreshold16(UINT16 wID, LPUINT16 lpThreshold) { - dprintf_mmsys(stderr, "JoyGetThreshold(%04X, %p);\n", wID, lpThreshold); + dprintf_info(mmsys, "JoyGetThreshold(%04X, %p);\n", wID, lpThreshold); if (wID >= MAXJOYDRIVERS) return JOYERR_PARMS; *lpThreshold = joy_threshold[wID]; return JOYERR_NOERROR; @@ -347,7 +348,7 @@ MMRESULT32 WINAPI joyReleaseCapture32(UINT32 wID) */ MMRESULT16 WINAPI joyReleaseCapture16(UINT16 wID) { - dprintf_mmsys(stderr, "JoyReleaseCapture(%04X);\n", wID); + dprintf_info(mmsys, "JoyReleaseCapture(%04X);\n", wID); joyCaptured = FALSE; joyCloseDriver(wID); joy_dev[wID] = -1; @@ -369,7 +370,7 @@ MMRESULT32 WINAPI joySetCapture32(HWND32 hWnd,UINT32 wID,UINT32 wPeriod,BOOL32 b MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd,UINT16 wID,UINT16 wPeriod,BOOL16 bChanged) { - dprintf_mmsys(stderr, "JoySetCapture(%04X, %04X, %d, %d);\n", + dprintf_info(mmsys, "JoySetCapture(%04X, %04X, %d, %d);\n", hWnd, wID, wPeriod, bChanged); if (!CaptureWnd[wID]) { @@ -394,7 +395,7 @@ MMRESULT32 WINAPI joySetThreshold32(UINT32 wID, UINT32 wThreshold) */ MMRESULT16 WINAPI joySetThreshold16(UINT16 wID, UINT16 wThreshold) { - dprintf_mmsys(stderr, "JoySetThreshold(%04X, %d);\n", wID, wThreshold); + dprintf_info(mmsys, "JoySetThreshold(%04X, %d);\n", wID, wThreshold); if (wID > 3) return JOYERR_PARMS; joy_threshold[wID] = wThreshold; diff --git a/multimedia/mcianim.c b/multimedia/mcianim.c index 39fcdf1c93f..aa545a540db 100644 --- a/multimedia/mcianim.c +++ b/multimedia/mcianim.c @@ -14,7 +14,6 @@ #include "user.h" #include "driver.h" #include "mmsystem.h" -#include "stddebug.h" #include "debug.h" #define MAX_ANIMDRV 2 @@ -55,7 +54,7 @@ static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar LPSTR lpstrElementName; char str[128]; - dprintf_mcianim(stddeb,"ANIM_mciOpen(%04X, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciOpen(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (AnimDev[wDevID].nUseCount > 0) { @@ -71,12 +70,12 @@ static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar AnimDev[wDevID].nUseCount = 1; AnimDev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE; } - dprintf_mcianim(stddeb,"ANIM_mciOpen // wDevID=%04X\n", wDevID); + dprintf_info(mcianim,"ANIM_mciOpen // wDevID=%04X\n", wDevID); lpParms->wDeviceID = wDevID; - dprintf_mcianim(stddeb,"ANIM_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID); + dprintf_info(mcianim,"ANIM_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID); if (dwFlags & MCI_OPEN_ELEMENT) { lpstrElementName = (LPSTR)PTR_SEG_TO_LIN(lpParms->lpstrElementName); - dprintf_mcianim(stddeb,"ANIM_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", + dprintf_info(mcianim,"ANIM_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName); if (strlen(lpstrElementName) > 0) { strcpy(str, lpstrElementName); @@ -96,7 +95,7 @@ static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar Moved to mmsystem.c mciOpen routine if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -115,7 +114,7 @@ static DWORD ANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar static DWORD ANIM_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciClose(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciClose(%u, %08lX, %p);\n", wDevID, dwParam, lpParms); if (AnimDev[wDevID].lpdwTrackLen != NULL) free(AnimDev[wDevID].lpdwTrackLen); if (AnimDev[wDevID].lpdwTrackPos != NULL) free(AnimDev[wDevID].lpdwTrackPos); @@ -130,11 +129,11 @@ static DWORD ANIM_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciGetDevCaps(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciGetDevCaps(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_GETDEVCAPS_ITEM) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciGetDevCaps // MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n", lpParms->dwItem); switch(lpParms->dwItem) { @@ -169,7 +168,7 @@ static DWORD ANIM_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, return MCIERR_UNRECOGNIZED_COMMAND; } } - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciGetDevCaps // lpParms->dwReturn=%08lX;\n", lpParms->dwReturn); return 0; @@ -190,13 +189,13 @@ static DWORD ANIM_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) UINT16 wMinutes; UINT16 wSeconds; UINT16 wFrames; - dprintf_mcianim(stddeb,"ANIM_CalcTime(%u, %08lX, %lu);\n", + dprintf_info(mcianim,"ANIM_CalcTime(%u, %08lX, %lu);\n", wDevID, dwFormatType, dwFrame); switch (dwFormatType) { case MCI_FORMAT_MILLISECONDS: dwTime = dwFrame / ANIMFRAMES_PERSEC * 1000; - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_CalcTime // MILLISECONDS %lu\n", dwTime); break; case MCI_FORMAT_MSF: @@ -205,7 +204,7 @@ static DWORD ANIM_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - ANIMFRAMES_PERSEC * wSeconds; dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames); - dprintf_mcianim(stddeb,"ANIM_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n", + dprintf_info(mcianim,"ANIM_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n", wMinutes, wSeconds, wFrames, dwTime); break; default: @@ -223,7 +222,7 @@ static DWORD ANIM_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - ANIMFRAMES_PERSEC * wSeconds; dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames); - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_CalcTime // %02u-%02u:%02u:%02u\n", wTrack, wMinutes, wSeconds, wFrames); break; @@ -241,17 +240,17 @@ static DWORD ANIM_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime) DWORD dwFrame = 0; #if defined(linux) || defined(__FreeBSD__) UINT16 wTrack; - dprintf_mcianim(stddeb,"ANIM_CalcFrame(%u, %08lX, %lu);\n", + dprintf_info(mcianim,"ANIM_CalcFrame(%u, %08lX, %lu);\n", wDevID, dwFormatType, dwTime); switch (dwFormatType) { case MCI_FORMAT_MILLISECONDS: dwFrame = dwTime * ANIMFRAMES_PERSEC / 1000; - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_CalcFrame // MILLISECONDS %lu\n", dwFrame); break; case MCI_FORMAT_MSF: - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_CalcFrame // MSF %02u:%02u:%02u\n", MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), MCI_MSF_FRAME(dwTime)); @@ -264,11 +263,11 @@ static DWORD ANIM_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime) dwFormatType = MCI_FORMAT_TMSF; case MCI_FORMAT_TMSF: wTrack = MCI_TMSF_TRACK(dwTime); - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_CalcFrame // TMSF %02u-%02u:%02u:%02u\n", MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime)); - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_CalcFrame // TMSF trackpos[%u]=%lu\n", wTrack, AnimDev[wDevID].lpdwTrackPos[wTrack - 1]); dwFrame = AnimDev[wDevID].lpdwTrackPos[wTrack - 1]; @@ -288,7 +287,7 @@ static DWORD ANIM_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime) static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciInfo(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciInfo(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; lpParms->lpstrReturn = NULL; @@ -322,11 +321,11 @@ static DWORD ANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciStatus(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciStatus(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -336,11 +335,11 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP switch(lpParms->dwItem) { case MCI_STATUS_CURRENT_TRACK: lpParms->dwReturn = AnimDev[wDevID].nCurTrack; - dprintf_mcianim(stddeb,"ANIM_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn); + dprintf_info(mcianim,"ANIM_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn); return 0; case MCI_STATUS_LENGTH: if (dwFlags & MCI_TRACK) { - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n", + dprintf_info(mcianim,"ANIM_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n", lpParms->dwTrack); if (lpParms->dwTrack > AnimDev[wDevID].nTracks) return MCIERR_OUTOFRANGE; @@ -350,20 +349,20 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP lpParms->dwReturn = AnimDev[wDevID].dwTotalLen; lpParms->dwReturn = ANIM_CalcTime(wDevID, AnimDev[wDevID].dwTimeFormat, lpParms->dwReturn); - dprintf_mcianim(stddeb,"ANIM_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn); + dprintf_info(mcianim,"ANIM_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn); return 0; case MCI_STATUS_MODE: lpParms->dwReturn = AnimDev[wDevID].mode; - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_MODE=%08lX !\n", + dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_MODE=%08lX !\n", lpParms->dwReturn); return 0; case MCI_STATUS_MEDIA_PRESENT: lpParms->dwReturn = TRUE; - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); + dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); return 0; case MCI_STATUS_NUMBER_OF_TRACKS: lpParms->dwReturn = 1; - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n", + dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n", lpParms->dwReturn); if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL; return 0; @@ -371,25 +370,25 @@ static DWORD ANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP lpParms->dwReturn = AnimDev[wDevID].dwCurFrame; if (dwFlags & MCI_STATUS_START) { lpParms->dwReturn = 0; - dprintf_mcianim(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n"); + dprintf_info(mcianim,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n"); } if (dwFlags & MCI_TRACK) { if (lpParms->dwTrack > AnimDev[wDevID].nTracks) return MCIERR_OUTOFRANGE; lpParms->dwReturn = AnimDev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1]; - dprintf_mcianim(stddeb,"ANIM_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack); + dprintf_info(mcianim,"ANIM_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack); } lpParms->dwReturn = ANIM_CalcTime(wDevID, AnimDev[wDevID].dwTimeFormat, lpParms->dwReturn); - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_POSITION=%08lX !\n", + dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_POSITION=%08lX !\n", lpParms->dwReturn); return 0; case MCI_STATUS_READY: - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_READY !\n"); + dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_READY !\n"); lpParms->dwReturn = TRUE; return 0; case MCI_STATUS_TIME_FORMAT: - dprintf_mcianim(stddeb,"ANIM_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); + dprintf_info(mcianim,"ANIM_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); lpParms->dwReturn = MCI_FORMAT_MILLISECONDS; return 0; default: @@ -412,7 +411,7 @@ static DWORD ANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms { #if defined(linux) || defined(__FreeBSD__) int start, end; - dprintf_mcianim(stddeb,"ANIM_mciPlay(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciPlay(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; start = 0; end = AnimDev[wDevID].dwTotalLen; @@ -420,19 +419,19 @@ static DWORD ANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms if (dwFlags & MCI_FROM) { start = ANIM_CalcFrame(wDevID, AnimDev[wDevID].dwTimeFormat, lpParms->dwFrom); - dprintf_mcianim(stddeb,"ANIM_mciPlay // MCI_FROM=%08lX -> %u \n", + dprintf_info(mcianim,"ANIM_mciPlay // MCI_FROM=%08lX -> %u \n", lpParms->dwFrom, start); } if (dwFlags & MCI_TO) { end = ANIM_CalcFrame(wDevID, AnimDev[wDevID].dwTimeFormat, lpParms->dwTo); - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciPlay // MCI_TO=%08lX -> %u \n", lpParms->dwTo, end); } AnimDev[wDevID].mode = MCI_MODE_PLAY; if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -450,12 +449,12 @@ static DWORD ANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciStop(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciStop(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; AnimDev[wDevID].mode = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -473,12 +472,12 @@ static DWORD ANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciPause(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciPause(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; AnimDev[wDevID].mode = MCI_MODE_PAUSE; if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -496,12 +495,12 @@ static DWORD ANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP static DWORD ANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciResume(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciResume(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; AnimDev[wDevID].mode = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -521,7 +520,7 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms #if defined(linux) || defined(__FreeBSD__) DWORD dwRet; MCI_PLAY_PARMS PlayParms; - dprintf_mcianim(stddeb,"ANIM_mciSeek(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciSeek(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; AnimDev[wDevID].mode = MCI_MODE_SEEK; @@ -540,7 +539,7 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms if (dwRet != 0) return dwRet; dwRet = ANIM_mciStop(wDevID, MCI_WAIT, (LPMCI_GENERIC_PARMS)&PlayParms); if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -559,7 +558,7 @@ static DWORD ANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_mcianim(stddeb,"ANIM_mciSet(%u, %08lX, %p);\n", + dprintf_info(mcianim,"ANIM_mciSet(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; /* @@ -569,14 +568,14 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciSet // MCI_FORMAT_MILLISECONDS !\n"); break; case MCI_FORMAT_MSF: - dprintf_mcianim(stddeb,"ANIM_mciSet // MCI_FORMAT_MSF !\n"); + dprintf_info(mcianim,"ANIM_mciSet // MCI_FORMAT_MSF !\n"); break; case MCI_FORMAT_TMSF: - dprintf_mcianim(stddeb,"ANIM_mciSet // MCI_FORMAT_TMSF !\n"); + dprintf_info(mcianim,"ANIM_mciSet // MCI_FORMAT_TMSF !\n"); break; default: fprintf(stderr,"ANIM_mciSet // bad time format !\n"); @@ -588,7 +587,7 @@ static DWORD ANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_NOTIFY) { - dprintf_mcianim(stddeb, + dprintf_info(mcianim, "ANIM_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), diff --git a/multimedia/mcicda.c b/multimedia/mcicda.c index 65a337556e3..7c43b7dfbac 100644 --- a/multimedia/mcicda.c +++ b/multimedia/mcicda.c @@ -14,7 +14,6 @@ #include "user.h" #include "driver.h" #include "mmsystem.h" -#include "stddebug.h" #include "debug.h" #ifdef linux @@ -96,7 +95,7 @@ static UINT16 CDAUDIO_GetNumberOfTracks(UINT16 wDevID) CDIOREADTOCHEADER #endif , &hdr)) { - dprintf_cdaudio(stddeb, + dprintf_warn(cdaudio, "GetNumberOfTracks(%04X) // Error occured !\n", wDevID); return (WORD)-1; @@ -133,7 +132,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID) if (CDADev[wDevID].nTracks == 0) { if (CDAUDIO_GetNumberOfTracks(wDevID) == (WORD)-1) return FALSE; } - dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // nTracks=%u\n", + dprintf_info(cdaudio,"CDAUDIO_GetTracksInfo // nTracks=%u\n", CDADev[wDevID].nTracks); if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen); @@ -145,7 +144,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID) (CDADev[wDevID].nTracks + 1) * sizeof(DWORD)); if (CDADev[wDevID].lpdwTrackLen == NULL || CDADev[wDevID].lpdwTrackPos == NULL) { - dprintf_cdaudio(stddeb, + dprintf_warn(cdaudio, "CDAUDIO_GetTracksInfo // error allocating track table !\n"); return FALSE; } @@ -182,7 +181,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID) CDIOREADTOCENTRYS #endif , &entry)) { - dprintf_cdaudio(stddeb, + dprintf_warn(cdaudio, "CDAUDIO_GetTracksInfo // error read entry\n"); return FALSE; } @@ -198,7 +197,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID) if (i == 0) { last_start = start; CDADev[wDevID].dwFirstOffset = start; - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_GetTracksInfo // dwFirstOffset=%u\n", start); } @@ -209,13 +208,13 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID) total_length += length; CDADev[wDevID].lpdwTrackLen[i - 1] = length; CDADev[wDevID].lpdwTrackPos[i - 1] = start; - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_GetTracksInfo // track #%u start=%u len=%u\n", i, start, length); } } CDADev[wDevID].dwTotalLen = total_length; - dprintf_cdaudio(stddeb,"CDAUDIO_GetTracksInfo // total_len=%u\n", + dprintf_info(cdaudio,"CDAUDIO_GetTracksInfo // total_len=%u\n", total_length); return TRUE; #else @@ -230,7 +229,7 @@ static BOOL32 CDAUDIO_GetTracksInfo(UINT16 wDevID) static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciOpen(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; @@ -248,14 +247,14 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lp CDADev[wDevID].fShareable = dwFlags & MCI_OPEN_SHAREABLE; } if (dwFlags & MCI_OPEN_ELEMENT) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // MCI_OPEN_ELEMENT !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciOpen // MCI_OPEN_ELEMENT !\n"); /* return MCIERR_NO_ELEMENT_ALLOWED; */ } memcpy(&CDADev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS16)); CDADev[wDevID].wNotifyDeviceID = lpParms->wDeviceID; CDADev[wDevID].unixdev = open (CDAUDIO_DEV, O_RDONLY, 0); if (CDADev[wDevID].unixdev == -1) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // can't open '%s' !\n", CDAUDIO_DEV); + dprintf_warn(cdaudio,"CDAUDIO_mciOpen // can't open '%s' !\n", CDAUDIO_DEV); return MCIERR_HARDWARE; } CDADev[wDevID].mode = 0; @@ -267,7 +266,7 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lp CDADev[wDevID].lpdwTrackLen = NULL; CDADev[wDevID].lpdwTrackPos = NULL; if (!CDAUDIO_GetTracksInfo(wDevID)) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen // error reading TracksInfo !\n"); + dprintf_warn(cdaudio,"CDAUDIO_mciOpen // error reading TracksInfo !\n"); /* return MCIERR_INTERNAL; */ } @@ -275,7 +274,7 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lp Moved to mmsystem.c mciOpen routine if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciOpen // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -294,7 +293,7 @@ static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lp static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciClose(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciClose(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms); if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen); if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos); @@ -310,11 +309,11 @@ static DWORD CDAUDIO_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciGetDevCaps(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciGetDevCaps(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_GETDEVCAPS_ITEM) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciGetDevCaps // MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n", lpParms->dwItem); switch(lpParms->dwItem) { @@ -349,7 +348,7 @@ static DWORD CDAUDIO_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, return MCIERR_UNRECOGNIZED_COMMAND; } } - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciGetDevCaps // lpParms->dwReturn=%08lX;\n", lpParms->dwReturn); return 0; @@ -364,7 +363,7 @@ static DWORD CDAUDIO_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, static DWORD CDAUDIO_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciInfo(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciInfo(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; lpParms->lpstrReturn = NULL; @@ -395,18 +394,18 @@ static DWORD CDAUDIO_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime) #if defined(linux) || defined(__FreeBSD__) UINT16 wTrack; - dprintf_cdaudio(stddeb,"CDAUDIO_CalcFrame(%04X, %08lX, %lu);\n", + dprintf_info(cdaudio,"CDAUDIO_CalcFrame(%04X, %08lX, %lu);\n", wDevID, dwFormatType, dwTime); switch (dwFormatType) { case MCI_FORMAT_MILLISECONDS: dwFrame = dwTime * CDFRAMES_PERSEC / 1000; - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_CalcFrame // MILLISECONDS %lu\n", dwFrame); break; case MCI_FORMAT_MSF: - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_CalcFrame // MSF %02u:%02u:%02u\n", MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), MCI_MSF_FRAME(dwTime)); @@ -419,11 +418,11 @@ static DWORD CDAUDIO_CalcFrame(UINT16 wDevID, DWORD dwFormatType, DWORD dwTime) dwFormatType = MCI_FORMAT_TMSF; case MCI_FORMAT_TMSF: wTrack = MCI_TMSF_TRACK(dwTime); - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_CalcFrame // TMSF %02u-%02u:%02u:%02u\n", MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime)); - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_CalcFrame // TMSF trackpos[%u]=%lu\n", wTrack, CDADev[wDevID].lpdwTrackPos[wTrack - 1]); dwFrame = CDADev[wDevID].lpdwTrackPos[wTrack - 1]; @@ -462,7 +461,7 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID) CDIOCREADSUBCHANNEL, &read_sc #endif )) { - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // opened or no_media !\n"); + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // opened or no_media !\n"); CDADev[wDevID].mode = MCI_MODE_NOT_READY; return TRUE; } @@ -478,7 +477,7 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID) #elif __FreeBSD__ case CD_AS_AUDIO_INVALID: #endif - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // device doesn't support status, returning NOT_READY.\n"); + dprintf_warn(cdaudio, "CDAUDIO_GetCDStatus // device doesn't support status, returning NOT_READY.\n"); #ifdef linux CDADev[wDevID].mode = MCI_MODE_NOT_READY; #elif __FreeBSD__ @@ -491,7 +490,7 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID) case CD_AS_NO_STATUS: #endif CDADev[wDevID].mode = MCI_MODE_STOP; - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n"); + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n"); break; #ifdef linux case CDROM_AUDIO_PLAY: @@ -499,7 +498,7 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID) case CD_AS_PLAY_IN_PROGRESS: #endif CDADev[wDevID].mode = MCI_MODE_PLAY; - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n"); + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n"); break; #ifdef linux case CDROM_AUDIO_PAUSED: @@ -507,16 +506,16 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID) case CD_AS_PLAY_PAUSED: #endif CDADev[wDevID].mode = MCI_MODE_PAUSE; - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n"); + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n"); break; default: - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // status=%02X !\n", #ifdef linux - CDADev[wDevID].sc.cdsc_audiostatus + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // status=%02X !\n", + CDADev[wDevID].sc.cdsc_audiostatus); #elif __FreeBSD__ - CDADev[wDevID].sc.header.audio_status + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // status=%02X !\n", + CDADev[wDevID].sc.header.audio_status); #endif - ); } #ifdef linux CDADev[wDevID].nCurTrack = CDADev[wDevID].sc.cdsc_trk; @@ -531,22 +530,23 @@ static BOOL32 CDAUDIO_GetCDStatus(UINT16 wDevID) CDFRAMES_PERSEC * CDADev[wDevID].sc.what.position.absaddr.msf.second + CDADev[wDevID].sc.what.position.absaddr.msf.frame; #endif - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n", #ifdef linux - CDADev[wDevID].sc.cdsc_trk, - CDADev[wDevID].sc.cdsc_absaddr.msf.minute, - CDADev[wDevID].sc.cdsc_absaddr.msf.second, - CDADev[wDevID].sc.cdsc_absaddr.msf.frame + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n", + CDADev[wDevID].sc.cdsc_trk, + CDADev[wDevID].sc.cdsc_absaddr.msf.minute, + CDADev[wDevID].sc.cdsc_absaddr.msf.second, + CDADev[wDevID].sc.cdsc_absaddr.msf.frame); #elif __FreeBSD__ - CDADev[wDevID].sc.what.position.track_number, - CDADev[wDevID].sc.what.position.absaddr.msf.minute, - CDADev[wDevID].sc.what.position.absaddr.msf.second, - CDADev[wDevID].sc.what.position.absaddr.msf.frame + dprintf_info(cdaudio,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n", + CDADev[wDevID].sc.what.position.track_number, + CDADev[wDevID].sc.what.position.absaddr.msf.minute, + CDADev[wDevID].sc.what.position.absaddr.msf.second, + CDADev[wDevID].sc.what.position.absaddr.msf.frame); #endif - ); + if (oldmode != CDADev[wDevID].mode && oldmode == MCI_MODE_OPEN) { if (!CDAUDIO_GetTracksInfo(wDevID)) { - dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // error updating TracksInfo !\n"); + dprintf_warn(cdaudio, "CDAUDIO_GetCDStatus // error updating TracksInfo !\n"); return MCIERR_INTERNAL; } } @@ -569,13 +569,13 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) UINT16 wSeconds; UINT16 wFrames; - dprintf_cdaudio(stddeb,"CDAUDIO_CalcTime(%04X, %08lX, %lu);\n", + dprintf_info(cdaudio,"CDAUDIO_CalcTime(%04X, %08lX, %lu);\n", wDevID, dwFormatType, dwFrame); switch (dwFormatType) { case MCI_FORMAT_MILLISECONDS: dwTime = dwFrame / CDFRAMES_PERSEC * 1000; - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_CalcTime // MILLISECONDS %lu\n", dwTime); break; @@ -585,7 +585,7 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes - CDFRAMES_PERSEC * wSeconds; dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames); - dprintf_cdaudio(stddeb,"CDAUDIO_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n", + dprintf_info(cdaudio,"CDAUDIO_CalcTime // MSF %02u:%02u:%02u -> dwTime=%lu\n", wMinutes, wSeconds, wFrames, dwTime); break; default: @@ -603,7 +603,7 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes - CDFRAMES_PERSEC * wSeconds; dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames); - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_CalcTime // %02u-%02u:%02u:%02u\n", wTrack, wMinutes, wSeconds, wFrames); break; @@ -619,12 +619,12 @@ static DWORD CDAUDIO_CalcTime(UINT16 wDevID, DWORD dwFormatType, DWORD dwFrame) static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciStatus(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED; if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -635,17 +635,17 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS case MCI_STATUS_CURRENT_TRACK: if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL; lpParms->dwReturn = CDADev[wDevID].nCurTrack; - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // CURRENT_TRACK=%lu!\n", lpParms->dwReturn); return 0; case MCI_STATUS_LENGTH: if (CDADev[wDevID].nTracks == 0) { if (!CDAUDIO_GetTracksInfo(wDevID)) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // error reading TracksInfo !\n"); + dprintf_warn(cdaudio, "CDAUDIO_mciStatus // error reading TracksInfo !\n"); return MCIERR_INTERNAL; } } if (dwFlags & MCI_TRACK) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n", + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_TRACK #%lu LENGTH=??? !\n", lpParms->dwTrack); if (lpParms->dwTrack > CDADev[wDevID].nTracks) return MCIERR_OUTOFRANGE; @@ -655,24 +655,24 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms->dwReturn = CDADev[wDevID].dwTotalLen; lpParms->dwReturn = CDAUDIO_CalcTime(wDevID, CDADev[wDevID].dwTimeFormat, lpParms->dwReturn); - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // LENGTH=%lu !\n", lpParms->dwReturn); return 0; case MCI_STATUS_MODE: if (!CDAUDIO_GetCDStatus(wDevID)) return MCIERR_INTERNAL; lpParms->dwReturn = CDADev[wDevID].mode; - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_MODE=%08lX !\n", + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_MODE=%08lX !\n", lpParms->dwReturn); return 0; case MCI_STATUS_MEDIA_PRESENT: lpParms->dwReturn = (CDADev[wDevID].nTracks > 0) ? TRUE : FALSE; if (lpParms->dwReturn == FALSE) - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MEDIA_NOT_PRESENT !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MEDIA_NOT_PRESENT !\n"); else - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); return 0; case MCI_STATUS_NUMBER_OF_TRACKS: lpParms->dwReturn = CDAUDIO_GetNumberOfTracks(wDevID); - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n", + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n", lpParms->dwReturn); if (lpParms->dwReturn == (WORD)-1) return MCIERR_INTERNAL; return 0; @@ -681,33 +681,33 @@ static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms->dwReturn = CDADev[wDevID].dwCurFrame; if (dwFlags & MCI_STATUS_START) { lpParms->dwReturn = CDADev[wDevID].dwFirstOffset; - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // get MCI_STATUS_START !\n"); } if (dwFlags & MCI_TRACK) { if (lpParms->dwTrack > CDADev[wDevID].nTracks) return MCIERR_OUTOFRANGE; lpParms->dwReturn = CDADev[wDevID].lpdwTrackPos[lpParms->dwTrack - 1]; - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // get MCI_TRACK #%lu !\n", lpParms->dwTrack); } lpParms->dwReturn = CDAUDIO_CalcTime(wDevID, CDADev[wDevID].dwTimeFormat, lpParms->dwReturn); - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_POSITION=%08lX !\n", + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_POSITION=%08lX !\n", lpParms->dwReturn); return 0; case MCI_STATUS_READY: - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_READY !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_READY !\n"); lpParms->dwReturn = TRUE; return 0; case MCI_STATUS_TIME_FORMAT: - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); lpParms->dwReturn = CDADev[wDevID].dwTimeFormat; return 0; default: - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // unknown command %08lX !\n", lpParms->dwItem); + dprintf_warn(cdaudio, "CDAUDIO_mciStatus // unknown command %08lX !\n", lpParms->dwItem); return MCIERR_UNRECOGNIZED_COMMAND; } } - dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n"); + dprintf_warn(cdaudio, "CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n"); return 0; #else return MMSYSERR_NOTENABLED; @@ -728,7 +728,7 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa struct ioc_play_msf msf; #endif - dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciPlay(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (CDADev[wDevID].unixdev == 0) return MMSYSERR_NOTENABLED; @@ -737,13 +737,13 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa if (dwFlags & MCI_FROM) { start = CDAUDIO_CalcFrame(wDevID, CDADev[wDevID].dwTimeFormat, lpParms->dwFrom); - dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // MCI_FROM=%08lX -> %u \n", + dprintf_info(cdaudio,"CDAUDIO_mciPlay // MCI_FROM=%08lX -> %u \n", lpParms->dwFrom, start); } if (dwFlags & MCI_TO) { end = CDAUDIO_CalcFrame(wDevID, CDADev[wDevID].dwTimeFormat, lpParms->dwTo); - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciPlay // MCI_TO=%08lX -> %u \n", lpParms->dwTo, end); } @@ -771,7 +771,7 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa CDIOCSTART #endif )) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // motor doesn't start !\n"); + dprintf_warn(cdaudio, "CDAUDIO_mciPlay // motor doesn't start !\n"); return MCIERR_HARDWARE; } if (ioctl(CDADev[wDevID].unixdev, @@ -781,21 +781,21 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa CDIOCPLAYMSF #endif , &msf)) { - dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // device doesn't play !\n"); + dprintf_warn(cdaudio, "CDAUDIO_mciPlay // device doesn't play !\n"); return MCIERR_HARDWARE; } - dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n", #ifdef linux + dprintf_info(cdaudio,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n", msf.cdmsf_min0, msf.cdmsf_sec0, msf.cdmsf_frame0, - msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1 + msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1); #elif __FreeBSD__ + dprintf_info(cdaudio,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n", msf.start_m, msf.start_s, msf.start_f, - msf.end_m, msf.end_s, msf.end_f + msf.end_m, msf.end_s, msf.end_f); #endif - ); CDADev[wDevID].mode = MCI_MODE_PLAY; if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); /* @@ -815,7 +815,7 @@ static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciStop(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciStop(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (ioctl(CDADev[wDevID].unixdev, @@ -827,7 +827,7 @@ static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l )) return MCIERR_HARDWARE; CDADev[wDevID].mode = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciStop // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -845,7 +845,7 @@ static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciPause(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciPause(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (ioctl(CDADev[wDevID].unixdev, @@ -857,7 +857,7 @@ static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS )) return MCIERR_HARDWARE; CDADev[wDevID].mode = MCI_MODE_PAUSE; if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciPause // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -875,7 +875,7 @@ static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciResume(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciResume(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (ioctl(CDADev[wDevID].unixdev, @@ -887,7 +887,7 @@ static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS )) return MCIERR_HARDWARE; CDADev[wDevID].mode = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciResume // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -907,7 +907,7 @@ static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa #if defined(linux) || defined(__FreeBSD__) DWORD dwRet; MCI_PLAY_PARMS PlayParms; - dprintf_cdaudio(stddeb,"CDAUDIO_mciSeek(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciSeek(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (ioctl(CDADev[wDevID].unixdev, @@ -936,7 +936,7 @@ static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa if (dwRet != 0) return dwRet; dwRet = CDAUDIO_mciStop(wDevID, MCI_WAIT, (LPMCI_GENERIC_PARMS)&PlayParms); if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciSeek // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -955,7 +955,7 @@ static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_cdaudio(stddeb,"CDAUDIO_mciSet(%04X, %08lX, %p);\n", + dprintf_info(cdaudio,"CDAUDIO_mciSet(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; /* @@ -965,23 +965,23 @@ static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParm if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciSet // MCI_FORMAT_MILLISECONDS !\n"); break; case MCI_FORMAT_MSF: - dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // MCI_FORMAT_MSF !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciSet // MCI_FORMAT_MSF !\n"); break; case MCI_FORMAT_TMSF: - dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // MCI_FORMAT_TMSF !\n"); + dprintf_info(cdaudio,"CDAUDIO_mciSet // MCI_FORMAT_TMSF !\n"); break; default: - dprintf_cdaudio(stddeb,"CDAUDIO_mciSet // bad time format !\n"); + dprintf_warn(cdaudio, "CDAUDIO_mciSet // bad time format !\n"); return MCIERR_BAD_TIME_FORMAT; } CDADev[wDevID].dwTimeFormat = lpParms->dwTimeFormat; } if (dwFlags & MCI_SET_DOOR_OPEN) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciSet // MCI_SET_DOOR_OPEN !\n"); #ifdef __FreeBSD__ if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE; @@ -993,7 +993,7 @@ static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParm CDADev[wDevID].nTracks = 0; } if (dwFlags & MCI_SET_DOOR_CLOSED) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciSet // MCI_SET_DOOR_CLOSED !\n"); #ifdef __FreeBSD__ if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE; @@ -1009,7 +1009,7 @@ static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParm if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_NOTIFY) { - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_mciSet // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), @@ -1084,7 +1084,7 @@ LONG CDAUDIO_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg, return CDAUDIO_mciSeek(dwDevID, dwParam1, (LPMCI_SEEK_PARMS)PTR_SEG_TO_LIN(dwParam2)); case MCI_SET_DOOR_OPEN: - dprintf_cdaudio(stddeb, + dprintf_info(cdaudio, "CDAUDIO_DriverProc // MCI_SET_DOOR_OPEN !\n"); #ifdef __FreeBSD__ if (ioctl(CDADev[dwDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE; @@ -1096,7 +1096,7 @@ LONG CDAUDIO_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg, CDADev[dwDevID].nTracks = 0; return 0; case MCI_SET_DOOR_CLOSED: - dprintf_cdaudio(stddeb,"CDAUDIO_DriverProc // MCI_SET_DOOR_CLOSED !\n"); + dprintf_info(cdaudio,"CDAUDIO_DriverProc // MCI_SET_DOOR_CLOSED !\n"); #ifdef __FreeBSD__ if (ioctl(CDADev[dwDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE; if (ioctl(CDADev[dwDevID].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE; diff --git a/multimedia/mcistring.c b/multimedia/mcistring.c index 88cf60aef62..bdd28872632 100644 --- a/multimedia/mcistring.c +++ b/multimedia/mcistring.c @@ -24,7 +24,6 @@ #include "driver.h" #include "mmsystem.h" #include "callback.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -66,10 +65,10 @@ LONG ANIM_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg, * for use in mciSendString() */ #define _MCI_STR(s) do {\ - dprintf_mci(stddeb,"->returns \"%s\"",s);\ + dprintf_info(mci,"->returns \"%s\"",s);\ if (lpstrReturnString) {\ lstrcpyn32A(lpstrReturnString,s,uReturnLength);\ - dprintf_mci(stddeb,"-->\"%s\"\n",lpstrReturnString);\ + dprintf_info(mci,"-->\"%s\"\n",lpstrReturnString);\ }\ } while(0) @@ -89,7 +88,7 @@ LONG ANIM_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg, res=ANIM_DriverProc(GetDrv(wDevID)->modp.wDeviceID,0,cmd,dwFlags,(DWORD)(params));\ break;\ case MCI_DEVTYPE_DIGITAL_VIDEO:\ - dprintf_mci(stddeb,"_MCI_CALL_DRIVER //No DIGITAL_VIDEO yet !\n");\ + dprintf_fixme(mci,"_MCI_CALL_DRIVER //No DIGITAL_VIDEO yet !\n");\ res=MCIERR_DEVICE_NOT_INSTALLED;\ break;\ default:\ @@ -336,7 +335,7 @@ MCISTR_Open(_MCISTR_PROTO_) { while(GetDrv(wDevID)->modp.wType) { wDevID = MMSYSTEM_NextDevID(wDevID); if (!MMSYSTEM_DevIDValid(wDevID)) { - dprintf_mci(stddeb, __FILE__":MCISTR_Open:MAXMCIDRIVERS reached (%x) !\n", wDevID); + dprintf_info(mci, __FILE__":MCISTR_Open:MAXMCIDRIVERS reached (%x) !\n", wDevID); SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrElementName)); SEGPTR_FREE(pU); return MCIERR_INTERNAL; @@ -2113,7 +2112,7 @@ DWORD WINAPI mciSendString (LPCSTR lpstrCommand, LPSTR lpstrReturnString, DWORD dwFlags; int res=0,i,nrofkeywords; - dprintf_mci(stddeb,"mciSendString('%s', %p, %d, %X)\n", lpstrCommand, + dprintf_info(mci,"mciSendString('%s', %p, %d, %X)\n", lpstrCommand, lpstrReturnString, uReturnLength, hwndCallback ); /* format is */ @@ -2183,7 +2182,7 @@ DWORD WINAPI mciSendString (LPCSTR lpstrCommand, LPSTR lpstrReturnString, break; wDevID = MMSYSTEM_NextDevID(wDevID); if (!MMSYSTEM_DevIDValid(wDevID)) { - dprintf_mci(stddeb, __FILE__":mciSendString:MAXMCIDRIVERS reached!\n"); + dprintf_info(mci, __FILE__":mciSendString:MAXMCIDRIVERS reached!\n"); free(keywords);free(cmd); return MCIERR_INVALID_DEVICE_NAME; } diff --git a/multimedia/midi.c b/multimedia/midi.c index f38d5dddba6..6a5b94afc98 100644 --- a/multimedia/midi.c +++ b/multimedia/midi.c @@ -18,8 +18,6 @@ #include "driver.h" #include "mmsystem.h" #include "xmalloc.h" - -#include "stddebug.h" #include "debug.h" #ifdef linux @@ -91,7 +89,7 @@ static LINUX_MCIMIDI MCIMidiDev[MAX_MCIMIDIDRV]; static DWORD MIDI_NotifyClient(UINT16 wDevID, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { - dprintf_midi(stddeb,"MIDI_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2); + dprintf_info(midi,"MIDI_NotifyClient // wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n",wDevID, wMsg, dwParam1, dwParam2); #if defined(linux) || defined(__FreeBSD__) @@ -109,7 +107,7 @@ static DWORD MIDI_NotifyClient(UINT16 wDevID, WORD wMsg, MidiOutDev[wDevID].midiDesc.dwInstance, dwParam1, dwParam2)) { - dprintf_midi(stddeb,"MIDI_NotifyClient // can't notify client !\n"); + dprintf_warn(midi,"MIDI_NotifyClient // can't notify client !\n"); return MMSYSERR_NOERROR; } break; @@ -122,7 +120,7 @@ static DWORD MIDI_NotifyClient(UINT16 wDevID, WORD wMsg, MidiInDev[wDevID].midiDesc.dwCallback, MidiInDev[wDevID].wFlags, MidiInDev[wDevID].midiDesc.hMidi, wMsg, MidiInDev[wDevID].midiDesc.dwInstance, dwParam1, dwParam2)) { - dprintf_mciwave(stddeb,"MIDI_NotifyClient // can't notify client !\n"); + dprintf_warn(mciwave,"MIDI_NotifyClient // can't notify client !\n"); return MMSYSERR_NOERROR; } break; @@ -146,7 +144,7 @@ static DWORD MIDI_ReadByte(UINT16 wDevID, BYTE *lpbyt) return 0; } } - dprintf_midi(stddeb, "MIDI_ReadByte // error reading wDevID=%04X\n", wDevID); + dprintf_warn(midi, "MIDI_ReadByte // error reading wDevID=%04X\n", wDevID); return MCIERR_INTERNAL; #else @@ -169,7 +167,7 @@ static DWORD MIDI_ReadWord(UINT16 wDevID, LPWORD lpw) } } } - dprintf_midi(stddeb, "MIDI_ReadWord // error reading wDevID=%04X\n", wDevID); + dprintf_warn(midi, "MIDI_ReadWord // error reading wDevID=%04X\n", wDevID); return MCIERR_INTERNAL; } @@ -188,7 +186,7 @@ static DWORD MIDI_ReadLong(UINT16 wDevID, LPDWORD lpdw) } } } - dprintf_midi(stddeb, "MIDI_ReadLong // error reading wDevID=%04X\n", wDevID); + dprintf_warn(midi, "MIDI_ReadLong // error reading wDevID=%04X\n", wDevID); return MCIERR_INTERNAL; } @@ -202,20 +200,20 @@ static DWORD MIDI_ReadVaryLen(UINT16 wDevID, LPDWORD lpdw) DWORD value; if (lpdw == NULL) return MCIERR_INTERNAL; if (MIDI_ReadByte(wDevID, &byte) != 0) { - dprintf_midi(stddeb, "MIDI_ReadVaryLen // error reading wDevID=%04X\n", wDevID); + dprintf_warn(midi, "MIDI_ReadVaryLen // error reading wDevID=%04X\n", wDevID); return MCIERR_INTERNAL; } value = (DWORD)(byte & 0x7F); while (byte & 0x80) { if (MIDI_ReadByte(wDevID, &byte) != 0) { - dprintf_midi(stddeb, "MIDI_ReadVaryLen // error reading wDevID=%04X\n", wDevID); + dprintf_warn(midi, "MIDI_ReadVaryLen // error reading wDevID=%04X\n", wDevID); return MCIERR_INTERNAL; } value = (value << 7) + (byte & 0x7F); } *lpdw = value; /* - dprintf_midi(stddeb, "MIDI_ReadVaryLen // val=%08lX \n", value); + dprintf_info(midi, "MIDI_ReadVaryLen // val=%08lX \n", value); */ return 0; } @@ -229,9 +227,9 @@ static DWORD MIDI_ReadMThd(UINT16 wDevID, DWORD dwOffset) #if defined(linux) || defined(__FreeBSD__) DWORD toberead; FOURCC fourcc; - dprintf_midi(stddeb, "MIDI_ReadMThd(%04X, %08lX);\n", wDevID, dwOffset); + dprintf_info(midi, "MIDI_ReadMThd(%04X, %08lX);\n", wDevID, dwOffset); if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) { - dprintf_midi(stddeb, "MIDI_ReadMThd // can't seek at %08lX begin of 'MThd' \n", dwOffset); + dprintf_warn(midi, "MIDI_ReadMThd // can't seek at %08lX begin of 'MThd' \n", dwOffset); return MCIERR_INTERNAL; } if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc, @@ -245,7 +243,7 @@ static DWORD MIDI_ReadMThd(UINT16 wDevID, DWORD dwOffset) return MCIERR_INTERNAL; if (MIDI_ReadWord(wDevID, &MCIMidiDev[wDevID].nTempo) != 0) return MCIERR_INTERNAL; - dprintf_midi(stddeb, "MIDI_ReadMThd // toberead=%08lX, wFormat=%04X nTracks=%04X nTempo=%04X\n", + dprintf_info(midi, "MIDI_ReadMThd // toberead=%08lX, wFormat=%04X nTracks=%04X nTempo=%04X\n", toberead, MCIMidiDev[wDevID].wFormat, MCIMidiDev[wDevID].nTracks, MCIMidiDev[wDevID].nTempo); @@ -267,7 +265,7 @@ static DWORD MIDI_ReadMTrk(UINT16 wDevID, DWORD dwOffset) DWORD toberead; FOURCC fourcc; if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) { - dprintf_midi(stddeb, "MIDI_ReadMTrk // can't seek at %08lX begin of 'MThd' \n", dwOffset); + dprintf_warn(midi, "MIDI_ReadMTrk // can't seek at %08lX begin of 'MThd' \n", dwOffset); } if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)&fourcc, (long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) { @@ -276,7 +274,7 @@ static DWORD MIDI_ReadMTrk(UINT16 wDevID, DWORD dwOffset) if (MIDI_ReadLong(wDevID, &toberead) != 0) { return MCIERR_INTERNAL; } - dprintf_midi(stddeb, "MIDI_ReadMTrk // toberead=%08lX\n", toberead); + dprintf_info(midi, "MIDI_ReadMTrk // toberead=%08lX\n", toberead); toberead -= 3 * sizeof(WORD); MCIMidiDev[wDevID].dwTotalLen = toberead; return 0; @@ -298,7 +296,7 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar LPSTR lpstrElementName; char str[128]; - dprintf_midi(stddeb, "MIDI_mciOpen(%08lX, %p)\n", dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciOpen(%08lX, %p)\n", dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (MCIMidiDev[wDevID].nUseCount > 0) { @@ -315,26 +313,26 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar MCIMidiDev[wDevID].hMidiHdr = USER_HEAP_ALLOC(sizeof(MIDIHDR)); } - dprintf_midi(stddeb, "MIDI_mciOpen // wDevID=%04X\n", wDevID); + dprintf_info(midi, "MIDI_mciOpen // wDevID=%04X\n", wDevID); /* lpParms->wDeviceID = wDevID;*/ - dprintf_midi(stddeb, "MIDI_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID); - dprintf_midi(stddeb, "MIDI_mciOpen // before OPEN_ELEMENT\n"); + dprintf_info(midi, "MIDI_mciOpen // lpParms->wDevID=%04X\n", lpParms->wDeviceID); + dprintf_info(midi, "MIDI_mciOpen // before OPEN_ELEMENT\n"); if (dwFlags & MCI_OPEN_ELEMENT) { lpstrElementName = (LPSTR)PTR_SEG_TO_LIN(lpParms->lpstrElementName); - dprintf_midi(stddeb, "MIDI_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName); + dprintf_info(midi, "MIDI_mciOpen // MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName); if (strlen(lpstrElementName) > 0) { strcpy(str, lpstrElementName); CharUpper32A(str); MCIMidiDev[wDevID].hFile = mmioOpen16(str, NULL, MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_EXCLUSIVE); if (MCIMidiDev[wDevID].hFile == 0) { - dprintf_midi(stddeb, "MIDI_mciOpen // can't find file='%s' !\n", str); + dprintf_warn(midi, "MIDI_mciOpen // can't find file='%s' !\n", str); return MCIERR_FILE_NOT_FOUND; } } else MCIMidiDev[wDevID].hFile = 0; } - dprintf_midi(stddeb, "MIDI_mciOpen // hFile=%u\n", MCIMidiDev[wDevID].hFile); + dprintf_info(midi, "MIDI_mciOpen // hFile=%u\n", MCIMidiDev[wDevID].hFile); memcpy(&MCIMidiDev[wDevID].openParms, lpParms, sizeof(MCI_OPEN_PARMS16)); MCIMidiDev[wDevID].wNotifyDeviceID = lpParms->wDeviceID; MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; @@ -346,30 +344,30 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar if (mmioDescend(MCIMidiDev[wDevID].hFile, &ckMainRIFF, NULL, 0) != 0) { return MCIERR_INTERNAL; } - dprintf_midi(stddeb,"MIDI_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", + dprintf_info(midi,"MIDI_mciOpen // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize); dwOffset = 0; if (ckMainRIFF.ckid == mmioFOURCC('R', 'M', 'I', 'D')) { - dprintf_midi(stddeb, "MIDI_mciOpen // is a 'RMID' file \n"); + dprintf_info(midi, "MIDI_mciOpen // is a 'RMID' file \n"); dwOffset = ckMainRIFF.dwDataOffset; } if (ckMainRIFF.ckid != mmioFOURCC('M', 'T', 'h', 'd')) { - dprintf_midi(stddeb, "MIDI_mciOpen // unknown format !\n"); + dprintf_warn(midi, "MIDI_mciOpen // unknown format !\n"); return MCIERR_INTERNAL; } if (MIDI_ReadMThd(wDevID, dwOffset) != 0) { - dprintf_midi(stddeb, "MIDI_mciOpen // can't read 'MThd' header \n"); + dprintf_warn(midi, "MIDI_mciOpen // can't read 'MThd' header \n"); return MCIERR_INTERNAL; } dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR); if (MIDI_ReadMTrk(wDevID, dwOffset) != 0) { - dprintf_midi(stddeb, "MIDI_mciOpen // can't read 'MTrk' header \n"); + dprintf_warn(midi, "MIDI_mciOpen // can't read 'MTrk' header \n"); return MCIERR_INTERNAL; } dwOffset = mmioSeek(MCIMidiDev[wDevID].hFile, 0, SEEK_CUR); MCIMidiDev[wDevID].dwBeginData = dwOffset; - dprintf_midi(stddeb, "MIDI_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", + dprintf_info(midi, "MIDI_mciOpen // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize); } @@ -389,10 +387,10 @@ static DWORD MIDI_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS16 lpPar static DWORD MIDI_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciStop(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciStop(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; - dprintf_midi(stddeb, "MIDI_mciStop // MCIMidiDev[wDevID].dwStatus=%p %d\n", + dprintf_info(midi, "MIDI_mciStop // MCIMidiDev[wDevID].dwStatus=%p %d\n", &MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus); return 0; #else @@ -409,7 +407,7 @@ static DWORD MIDI_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpP #if defined(linux) || defined(__FreeBSD__) DWORD dwRet; - dprintf_midi(stddeb, "MIDI_mciClose(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms); + dprintf_info(midi, "MIDI_mciClose(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms); if (MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) { MIDI_mciStop(wDevID, MCI_WAIT, lpParms); } @@ -419,7 +417,7 @@ static DWORD MIDI_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpP if (MCIMidiDev[wDevID].hFile != 0) { mmioClose(MCIMidiDev[wDevID].hFile, 0); MCIMidiDev[wDevID].hFile = 0; - dprintf_midi(stddeb, "MIDI_mciClose // hFile closed !\n"); + dprintf_info(midi, "MIDI_mciClose // hFile closed !\n"); } USER_HEAP_FREE(MCIMidiDev[wDevID].hMidiHdr); dwRet = modMessage(wDevID, MODM_CLOSE, 0, 0L, 0L); @@ -447,33 +445,33 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms DWORD dwData,dwRet; LPWORD ptr; - dprintf_midi(stddeb, "MIDI_mciPlay(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciPlay(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (MCIMidiDev[wDevID].hFile == 0) { - dprintf_midi(stddeb, "MIDI_mciPlay // can't find file='%08lx' !\n", + dprintf_warn(midi, "MIDI_mciPlay // can't find file='%08lx' !\n", (DWORD)MCIMidiDev[wDevID].openParms.lpstrElementName); return MCIERR_FILE_NOT_FOUND; } start = 1; end = 99999; if (dwFlags & MCI_FROM) { start = lpParms->dwFrom; - dprintf_midi(stddeb, "MIDI_mciPlay // MCI_FROM=%d \n", start); + dprintf_info(midi, "MIDI_mciPlay // MCI_FROM=%d \n", start); } if (dwFlags & MCI_TO) { end = lpParms->dwTo; - dprintf_midi(stddeb, "MIDI_mciPlay // MCI_TO=%d \n", end); + dprintf_info(midi, "MIDI_mciPlay // MCI_TO=%d \n", end); } #if 0 if (dwFlags & MCI_NOTIFY) { - dprintf_midi(stddeb, "MIDI_mciPlay // MCI_NOTIFY %08lX !\n", lpParms->dwCallback); + dprintf_info(midi, "MIDI_mciPlay // MCI_NOTIFY %08lX !\n", lpParms->dwCallback); switch(fork()) { case -1: - dprintf_midi(stddeb, "MIDI_mciPlay // Can't 'fork' process !\n"); + dprintf_warn(midi, "MIDI_mciPlay // Can't 'fork' process !\n"); break; case 0: - dprintf_midi(stddeb, "MIDI_mciPlay // process started ! play in background ...\n"); + dprintf_info(midi, "MIDI_mciPlay // process started ! play in background ...\n"); break; default: - dprintf_midi(stddeb, "MIDI_mciPlay // process started ! return to caller...\n"); + dprintf_info(midi, "MIDI_mciPlay // process started ! return to caller...\n"); return 0; } } @@ -488,11 +486,11 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms lpMidiHdr->dwFlags = 0L; dwRet = modMessage(wDevID, MODM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); -/* dprintf_midi(stddeb, "MIDI_mciPlay // after MODM_PREPARE \n"); */ +/* dprintf_info(midi, "MIDI_mciPlay // after MODM_PREPARE \n"); */ MCIMidiDev[wDevID].dwStatus = MCI_MODE_PLAY; while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) { - dprintf_midi(stddeb, "MIDI_mciPlay // MCIMidiDev[wDevID].dwStatus=%p %d\n", + dprintf_info(midi, "MIDI_mciPlay // MCIMidiDev[wDevID].dwStatus=%p %d\n", &MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus); ptr = (LPWORD)lpMidiHdr->lpData; @@ -503,11 +501,11 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms /* count = mmioRead(MCIMidiDev[wDevID].hFile, lpMidiHdr->lpData, lpMidiHdr->dwBufferLength); */ - dprintf_midi(stddeb, "MIDI_mciPlay // after read count = %d\n",count); + dprintf_info(midi, "MIDI_mciPlay // after read count = %d\n",count); if (count < 1) break; lpMidiHdr->dwBytesRecorded = count; - dprintf_midi(stddeb, "MIDI_mciPlay // before MODM_LONGDATA lpMidiHdr=%p dwBytesRecorded=%lu\n", + dprintf_info(midi, "MIDI_mciPlay // before MODM_LONGDATA lpMidiHdr=%p dwBytesRecorded=%lu\n", lpMidiHdr, lpMidiHdr->dwBytesRecorded); dwRet = modMessage(wDevID, MODM_LONGDATA, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); if (dwRet != MMSYSERR_NOERROR) { @@ -539,7 +537,7 @@ static DWORD MIDI_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms } MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { - dprintf_midi(stddeb, "MIDI_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); + dprintf_info(midi, "MIDI_mciPlay // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); #if 0 @@ -563,20 +561,20 @@ static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP LPMIDIHDR lpMidiHdr; DWORD dwRet; - dprintf_midi(stddeb, "MIDI_mciRecord(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciRecord(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (MCIMidiDev[wDevID].hFile == 0) { - dprintf_midi(stddeb, "MIDI_mciRecord // can't find file='%08lx' !\n", + dprintf_warn(midi, "MIDI_mciRecord // can't find file='%08lx' !\n", (DWORD)MCIMidiDev[wDevID].openParms.lpstrElementName); return MCIERR_FILE_NOT_FOUND; } start = 1; end = 99999; if (dwFlags & MCI_FROM) { start = lpParms->dwFrom; - dprintf_midi(stddeb, "MIDI_mciRecord // MCI_FROM=%d \n", start); + dprintf_info(midi, "MIDI_mciRecord // MCI_FROM=%d \n", start); } if (dwFlags & MCI_TO) { end = lpParms->dwTo; - dprintf_midi(stddeb, "MIDI_mciRecord // MCI_TO=%d \n", end); + dprintf_info(midi, "MIDI_mciRecord // MCI_TO=%d \n", end); } lpMidiHdr = USER_HEAP_LIN_ADDR(MCIMidiDev[wDevID].hMidiHdr); lpMidiHdr->lpData = (LPSTR) xmalloc(1200); @@ -584,27 +582,27 @@ static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP lpMidiHdr->dwUser = 0L; lpMidiHdr->dwFlags = 0L; dwRet = midMessage(wDevID, MIDM_PREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); - dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_PREPARE \n"); + dprintf_info(midi, "MIDI_mciRecord // after MIDM_PREPARE \n"); MCIMidiDev[wDevID].dwStatus = MCI_MODE_RECORD; while(MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) { - dprintf_midi(stddeb, "MIDI_mciRecord // MCIMidiDev[wDevID].dwStatus=%p %d\n", + dprintf_info(midi, "MIDI_mciRecord // MCIMidiDev[wDevID].dwStatus=%p %d\n", &MCIMidiDev[wDevID].dwStatus, MCIMidiDev[wDevID].dwStatus); lpMidiHdr->dwBytesRecorded = 0; dwRet = midMessage(wDevID, MIDM_START, 0, 0L, 0L); - dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_START lpMidiHdr=%p dwBytesRecorded=%lu\n", + dprintf_info(midi, "MIDI_mciRecord // after MIDM_START lpMidiHdr=%p dwBytesRecorded=%lu\n", lpMidiHdr, lpMidiHdr->dwBytesRecorded); if (lpMidiHdr->dwBytesRecorded == 0) break; } - dprintf_midi(stddeb, "MIDI_mciRecord // before MIDM_UNPREPARE \n"); + dprintf_info(midi, "MIDI_mciRecord // before MIDM_UNPREPARE \n"); dwRet = midMessage(wDevID, MIDM_UNPREPARE, 0, (DWORD)lpMidiHdr, sizeof(MIDIHDR)); - dprintf_midi(stddeb, "MIDI_mciRecord // after MIDM_UNPREPARE \n"); + dprintf_info(midi, "MIDI_mciRecord // after MIDM_UNPREPARE \n"); if (lpMidiHdr->lpData != NULL) { free(lpMidiHdr->lpData); lpMidiHdr->lpData = NULL; } MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { - dprintf_midi(stddeb, "MIDI_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); + dprintf_info(midi, "MIDI_mciRecord // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -621,7 +619,7 @@ static DWORD MIDI_mciRecord(UINT16 wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpP static DWORD MIDI_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciPause(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciPause(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; return 0; #else @@ -636,7 +634,7 @@ static DWORD MIDI_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP static DWORD MIDI_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciResume(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciResume(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; return 0; #else @@ -651,23 +649,23 @@ static DWORD MIDI_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp static DWORD MIDI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciSet(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciSet(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; - dprintf_midi(stddeb, "MIDI_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat); - dprintf_midi(stddeb, "MIDI_mciSet // dwAudio=%08lX\n", lpParms->dwAudio); + dprintf_info(midi, "MIDI_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat); + dprintf_info(midi, "MIDI_mciSet // dwAudio=%08lX\n", lpParms->dwAudio); if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: - dprintf_midi(stddeb, "MIDI_mciSet // MCI_FORMAT_MILLISECONDS !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_FORMAT_MILLISECONDS !\n"); break; case MCI_FORMAT_BYTES: - dprintf_midi(stddeb, "MIDI_mciSet // MCI_FORMAT_BYTES !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_FORMAT_BYTES !\n"); break; case MCI_FORMAT_SAMPLES: - dprintf_midi(stddeb, "MIDI_mciSet // MCI_FORMAT_SAMPLES !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_FORMAT_SAMPLES !\n"); break; default: - dprintf_midi(stddeb, "MIDI_mciSet // bad time format !\n"); + dprintf_warn(midi, "MIDI_mciSet // bad time format !\n"); return MCIERR_BAD_TIME_FORMAT; } } @@ -675,26 +673,26 @@ static DWORD MIDI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (dwFlags & MCI_SET_DOOR_OPEN) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_DOOR_CLOSED) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_AUDIO) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SET_AUDIO !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SET_AUDIO !\n"); if (dwFlags && MCI_SET_ON) { - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SET_ON !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SET_ON !\n"); if (dwFlags && MCI_SET_AUDIO_LEFT) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SET_AUDIO_LEFT !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SET_AUDIO_LEFT !\n"); if (dwFlags && MCI_SET_AUDIO_RIGHT) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SET_AUDIO_RIGHT !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SET_AUDIO_RIGHT !\n"); } if (dwFlags & MCI_SET_OFF) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SET_OFF !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SET_OFF !\n"); if (dwFlags & MCI_SEQ_SET_MASTER) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SEQ_SET_MASTER !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_MASTER !\n"); if (dwFlags & MCI_SEQ_SET_SLAVE) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SEQ_SET_SLAVE !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_SLAVE !\n"); if (dwFlags & MCI_SEQ_SET_OFFSET) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SEQ_SET_OFFSET !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_OFFSET !\n"); if (dwFlags & MCI_SEQ_SET_PORT) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SEQ_SET_PORT !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_PORT !\n"); if (dwFlags & MCI_SEQ_SET_TEMPO) - dprintf_midi(stddeb, "MIDI_mciSet // MCI_SEQ_SET_TEMPO !\n"); + dprintf_info(midi, "MIDI_mciSet // MCI_SEQ_SET_TEMPO !\n"); return 0; #else return MCIERR_INTERNAL; @@ -708,7 +706,7 @@ static DWORD MIDI_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciStatus(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciStatus(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_STATUS_ITEM) { switch(lpParms->dwItem) { @@ -726,7 +724,7 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP lpParms->dwReturn = MCI_MODE_STOP; break; case MCI_STATUS_MEDIA_PRESENT: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_STATUS_MEDIA_PRESENT !\n"); lpParms->dwReturn = TRUE; break; case MCI_STATUS_NUMBER_OF_TRACKS: @@ -742,44 +740,44 @@ static DWORD MIDI_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpP } break; case MCI_STATUS_READY: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_STATUS_READY !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_STATUS_READY !\n"); lpParms->dwReturn = TRUE; break; case MCI_STATUS_TIME_FORMAT: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_STATUS_TIME_FORMAT !\n"); lpParms->dwReturn = MCI_FORMAT_MILLISECONDS; break; case MCI_SEQ_STATUS_DIVTYPE: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_SEQ_STATUS_DIVTYPE !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_DIVTYPE !\n"); lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_MASTER: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_SEQ_STATUS_MASTER !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_MASTER !\n"); lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_SLAVE: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_SEQ_STATUS_SLAVE !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_SLAVE !\n"); lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_OFFSET: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_SEQ_STATUS_OFFSET !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_OFFSET !\n"); lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_PORT: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_SEQ_STATUS_PORT !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_PORT !\n"); lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_TEMPO: - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_SEQ_STATUS_TEMPO !\n"); + dprintf_info(midi, "MIDI_mciStatus // MCI_SEQ_STATUS_TEMPO !\n"); lpParms->dwReturn = 0; break; default: - dprintf_midi(stddeb, "MIDI_mciStatus // unknowm command %08lX !\n", lpParms->dwItem); + dprintf_warn(midi, "MIDI_mciStatus // unknowm command %08lX !\n", lpParms->dwItem); return MCIERR_UNRECOGNIZED_COMMAND; } } if (dwFlags & MCI_NOTIFY) { - dprintf_midi(stddeb, "MIDI_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); + dprintf_info(midi, "MIDI_mciStatus // MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), MCIMidiDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -796,7 +794,7 @@ static DWORD MIDI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciGetDevCaps(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciGetDevCaps(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; if (dwFlags & MCI_GETDEVCAPS_ITEM) { switch(lpParms->dwItem) { @@ -843,7 +841,7 @@ static DWORD MIDI_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, static DWORD MIDI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "MIDI_mciInfo(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); + dprintf_info(midi, "MIDI_mciInfo(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; lpParms->lpstrReturn = NULL; switch(dwFlags) { @@ -875,7 +873,7 @@ static DWORD MIDI_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar */ static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPS16 lpCaps, DWORD dwSize) { - dprintf_midi(stddeb, "midGetDevCaps(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize); + dprintf_info(midi, "midGetDevCaps(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize); lpCaps->wMid = 0x00FF; /* Manufac ID */ lpCaps->wPid = 0x0001; /* Product ID */ lpCaps->vDriverVersion = 0x001; /* Product Version */ @@ -891,37 +889,37 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) { #if defined(linux) || defined(__FreeBSD__) int midi; - dprintf_midi(stddeb, + dprintf_info(midi, "midOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { - dprintf_midi(stddeb,"Linux 'midOpen' // Invalid Parameter !\n"); + dprintf_warn(midi, "Linux 'midOpen' // Invalid Parameter !\n"); return MMSYSERR_INVALPARAM; } if (wDevID >= MAX_MIDIINDRV) { - dprintf_midi(stddeb,"Linux 'midOpen' // MAX_MIDIINDRV reached !\n"); + dprintf_info(midi,"Linux 'midOpen' // MAX_MIDIINDRV reached !\n"); return MMSYSERR_ALLOCATED; } MidiInDev[wDevID].unixdev = 0; midi = open (MIDI_DEV, O_RDONLY, 0); if (midi == -1) { - dprintf_midi(stddeb,"Linux 'midOpen' // can't open !\n"); + dprintf_warn(midi,"Linux 'midOpen' // can't open !\n"); return MMSYSERR_NOTENABLED; } MidiInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); switch(MidiInDev[wDevID].wFlags) { case DCB_NULL: - dprintf_midi(stddeb,"Linux 'midOpen' // CALLBACK_NULL !\n"); + dprintf_info(midi,"Linux 'midOpen' // CALLBACK_NULL !\n"); break; case DCB_WINDOW: - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'midOpen' // CALLBACK_WINDOW !\n"); break; case DCB_TASK: - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'midOpen' // CALLBACK_TASK !\n"); break; case DCB_FUNCTION: - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'midOpen' // CALLBACK_FUNCTION !\n"); break; } @@ -930,7 +928,7 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) MidiInDev[wDevID].dwTotalPlayed = 0; MidiInDev[wDevID].bufsize = 0x3FFF; if (MIDI_NotifyClient(wDevID, MIM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_midi(stddeb,"Linux 'midOpen' // can't notify client !\n"); + dprintf_warn(midi,"Linux 'midOpen' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -945,16 +943,16 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) static DWORD midClose(WORD wDevID) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "midClose(%04X);\n", wDevID); + dprintf_info(midi, "midClose(%04X);\n", wDevID); if (MidiInDev[wDevID].unixdev == 0) { - dprintf_midi(stddeb,"Linux 'midClose' // can't close !\n"); + dprintf_warn(midi,"Linux 'midClose' // can't close !\n"); return MMSYSERR_NOTENABLED; } close(MidiInDev[wDevID].unixdev); MidiInDev[wDevID].unixdev = 0; MidiInDev[wDevID].bufsize = 0; if (MIDI_NotifyClient(wDevID, MIM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_midi(stddeb,"Linux 'midClose' // can't notify client !\n"); + dprintf_warn(midi,"Linux 'midClose' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -968,7 +966,7 @@ static DWORD midClose(WORD wDevID) */ static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { - dprintf_midi(stddeb, "midAddBuffer(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); + dprintf_info(midi, "midAddBuffer(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); return MMSYSERR_NOTENABLED; } @@ -977,7 +975,7 @@ static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { - dprintf_midi(stddeb, "midPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); + dprintf_info(midi, "midPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); return MMSYSERR_NOTENABLED; } @@ -986,7 +984,7 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { - dprintf_midi(stddeb, "midUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); + dprintf_info(midi, "midUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); return MMSYSERR_NOTENABLED; } @@ -995,7 +993,7 @@ static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ static DWORD midReset(WORD wDevID) { - dprintf_midi(stddeb, "midReset(%04X);\n", wDevID); + dprintf_info(midi, "midReset(%04X);\n", wDevID); return MMSYSERR_NOTENABLED; } @@ -1005,7 +1003,7 @@ static DWORD midReset(WORD wDevID) */ static DWORD midStart(WORD wDevID) { - dprintf_midi(stddeb, "midStart(%04X);\n", wDevID); + dprintf_info(midi, "midStart(%04X);\n", wDevID); return MMSYSERR_NOTENABLED; } @@ -1015,7 +1013,7 @@ static DWORD midStart(WORD wDevID) */ static DWORD midStop(WORD wDevID) { - dprintf_midi(stddeb, "midStop(%04X);\n", wDevID); + dprintf_info(midi, "midStop(%04X);\n", wDevID); return MMSYSERR_NOTENABLED; } @@ -1026,7 +1024,7 @@ static DWORD midStop(WORD wDevID) DWORD midMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - dprintf_midi(stddeb, "midMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", + dprintf_info(midi, "midMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch(wMsg) { case MIDM_OPEN: @@ -1063,7 +1061,7 @@ DWORD midMessage(WORD wDevID, WORD wMsg, DWORD dwUser, */ static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS16 lpCaps, DWORD dwSize) { - dprintf_midi(stddeb, "modGetDevCaps(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize); + dprintf_info(midi, "modGetDevCaps(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize); lpCaps->wMid = 0x00FF; /* Manufac ID */ lpCaps->wPid = 0x0001; /* Product ID */ lpCaps->vDriverVersion = 0x001; /* Product Version */ @@ -1076,7 +1074,7 @@ static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS16 lpCaps, DWORD dwSize) lpCaps->wVoices = 14; /* make it ioctl */ lpCaps->wNotes = 14; /* make it ioctl */ lpCaps->dwSupport = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME; - dprintf_midi(stddeb,"Linux modGetDevCaps // techn = %d voices=%d notes = %d support = %ld\n",lpCaps->wTechnology,lpCaps->wVoices,lpCaps->wNotes,lpCaps->dwSupport); + dprintf_info(midi,"Linux modGetDevCaps // techn = %d voices=%d notes = %d support = %ld\n",lpCaps->wTechnology,lpCaps->wVoices,lpCaps->wNotes,lpCaps->dwSupport); return MMSYSERR_NOERROR; } @@ -1090,37 +1088,37 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) #if defined(linux) || defined(__FreeBSD__) int midi; - dprintf_midi(stddeb, + dprintf_info(midi, "modOpen(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { - dprintf_midi(stddeb,"Linux 'modOpen' // Invalid Parameter !\n"); + dprintf_warn(midi, "Linux 'modOpen' // Invalid Parameter !\n"); return MMSYSERR_INVALPARAM; } if (wDevID>= MAX_MIDIOUTDRV) { - dprintf_midi(stddeb,"Linux 'modOpen' // MAX_MIDIOUTDRV reached !\n"); + dprintf_info(midi,"Linux 'modOpen' // MAX_MIDIOUTDRV reached !\n"); return MMSYSERR_ALLOCATED; } MidiOutDev[wDevID].unixdev = 0; midi = open (MIDI_DEV, O_WRONLY, 0); if (midi == -1) { - dprintf_midi(stddeb,"Linux 'modOpen' // can't open !\n"); + dprintf_warn(midi,"Linux 'modOpen' // can't open !\n"); return MMSYSERR_NOTENABLED; } MidiOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); switch(MidiOutDev[wDevID].wFlags) { case DCB_NULL: - dprintf_midi(stddeb,"Linux 'modOpen' // CALLBACK_NULL !\n"); + dprintf_info(midi,"Linux 'modOpen' // CALLBACK_NULL !\n"); break; case DCB_WINDOW: - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'modOpen' // CALLBACK_WINDOW !\n"); break; case DCB_TASK: - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'modOpen' // CALLBACK_TASK !\n"); break; case DCB_FUNCTION: - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'modOpen' // CALLBACK_FUNCTION !\n"); break; } @@ -1129,10 +1127,10 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) MidiOutDev[wDevID].dwTotalPlayed = 0; MidiOutDev[wDevID].bufsize = 0x3FFF; if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_midi(stddeb,"Linux 'modOpen' // can't notify client !\n"); + dprintf_warn(midi,"Linux 'modOpen' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } - dprintf_midi(stddeb, + dprintf_info(midi, "Linux 'modOpen' // Succesful unixdev=%d !\n", midi); return MMSYSERR_NOERROR; #else @@ -1147,16 +1145,16 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) static DWORD modClose(WORD wDevID) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, "modClose(%04X);\n", wDevID); + dprintf_info(midi, "modClose(%04X);\n", wDevID); if (MidiOutDev[wDevID].unixdev == 0) { - dprintf_midi(stddeb,"Linux 'modClose' // can't close !\n"); + dprintf_warn(midi,"Linux 'modClose' // can't close !\n"); return MMSYSERR_NOTENABLED; } close(MidiOutDev[wDevID].unixdev); MidiOutDev[wDevID].unixdev = 0; MidiOutDev[wDevID].bufsize = 0; if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_midi(stddeb,"Linux 'modClose' // can't notify client !\n"); + dprintf_warn(midi,"Linux 'modClose' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -1173,17 +1171,16 @@ static DWORD modData(WORD wDevID, DWORD dwParam) #if defined(linux) || defined(__FreeBSD__) WORD event; - dprintf_midi(stddeb, + dprintf_info(midi, "modData(%04X, %08lX);\n", wDevID, dwParam); if (MidiOutDev[wDevID].unixdev == 0) { - dprintf_midi(stddeb,"Linux 'modData' // can't play !\n"); + dprintf_warn(midi,"Linux 'modData' // can't play !\n"); return MIDIERR_NODEVICE; } event = LOWORD(dwParam); if (write (MidiOutDev[wDevID].unixdev, &event, sizeof(WORD)) != sizeof(WORD)) { - dprintf_midi(stddeb, - "modData() // error writting unixdev !\n"); + dprintf_warn(midi, "modData() // error writting unixdev !\n"); } return MMSYSERR_NOTENABLED; #else @@ -1201,10 +1198,10 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) LPWORD ptr; int en; - dprintf_midi(stddeb, + dprintf_info(midi, "modLongData(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); if (MidiOutDev[wDevID].unixdev == 0) { - dprintf_midi(stddeb,"Linux 'modLongData' // can't play !\n"); + dprintf_warn(midi,"Linux 'modLongData' // can't play !\n"); return MIDIERR_NODEVICE; } if (lpMidiHdr->lpData == NULL) return MIDIERR_UNPREPARED; @@ -1212,9 +1209,9 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING; lpMidiHdr->dwFlags &= ~MHDR_DONE; lpMidiHdr->dwFlags |= MHDR_INQUEUE; - dprintf_midi(stddeb, + dprintf_info(midi, "modLongData() // dwBytesRecorded %lu !\n", lpMidiHdr->dwBytesRecorded); - dprintf_midi(stddeb, + dprintf_info(midi, " %02X %02X %02X %02X\n",lpMidiHdr->lpData[0], lpMidiHdr->lpData[1], lpMidiHdr->lpData[2], @@ -1231,19 +1228,19 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) } en = errno; - dprintf_midi(stddeb, "Linux 'modLongData' // after write count = %d\n",count); + dprintf_info(midi, "Linux 'modLongData' // after write count = %d\n",count); if (count != lpMidiHdr->dwBytesRecorded) { - dprintf_midi(stddeb, - "modLongData() // error writting unixdev #%d ! (%d != %ld)\n", + dprintf_warn(midi, + "modLongData() // error writting unixdev #%d ! (%d != %ld)\n", MidiOutDev[wDevID].unixdev, count, lpMidiHdr->dwBytesRecorded); - dprintf_midi(stddeb, - " errno = %d error = %s\n",en,strerror(en)); + dprintf_info(midi, + "\terrno = %d error = %s\n",en,strerror(en)); return MMSYSERR_NOTENABLED; } lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags |= MHDR_DONE; if (MIDI_NotifyClient(wDevID, MOM_DONE, 0L, 0L) != MMSYSERR_NOERROR) { - dprintf_midi(stddeb,"Linux 'modLongData' // can't notify client !\n"); + dprintf_warn(midi,"Linux 'modLongData' // can't notify client !\n"); return MMSYSERR_INVALPARAM; } return MMSYSERR_NOERROR; @@ -1258,14 +1255,14 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, + dprintf_info(midi, "modPrepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); if (MidiOutDev[wDevID].unixdev == 0) { - dprintf_midi(stddeb,"Linux 'modPrepare' // can't prepare !\n"); + dprintf_warn(midi,"Linux 'modPrepare' // can't prepare !\n"); return MMSYSERR_NOTENABLED; } if (MidiOutDev[wDevID].lpQueueHdr != NULL) { - dprintf_midi(stddeb,"Linux 'modPrepare' // already prepare !\n"); + dprintf_info(midi,"Linux 'modPrepare' // already prepare !\n"); return MMSYSERR_NOTENABLED; } MidiOutDev[wDevID].dwTotalPlayed = 0; @@ -1285,10 +1282,10 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { #if defined(linux) || defined(__FreeBSD__) - dprintf_midi(stddeb, + dprintf_info(midi, "modUnprepare(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); if (MidiOutDev[wDevID].unixdev == 0) { - dprintf_midi(stddeb,"Linux 'modUnprepare' // can't unprepare !\n"); + dprintf_warn(midi,"Linux 'modUnprepare' // can't unprepare !\n"); return MMSYSERR_NOTENABLED; } return MMSYSERR_NOERROR; @@ -1302,7 +1299,7 @@ static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) */ static DWORD modReset(WORD wDevID) { - dprintf_midi(stddeb, "modReset(%04X);\n", wDevID); + dprintf_info(midi, "modReset(%04X);\n", wDevID); return MMSYSERR_NOTENABLED; } @@ -1313,7 +1310,7 @@ static DWORD modReset(WORD wDevID) DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - dprintf_midi(stddeb, "modMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", + dprintf_info(midi, "modMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch(wMsg) { case MODM_OPEN: diff --git a/multimedia/mixer.c b/multimedia/mixer.c index 89f939453c0..9bcb24d23f4 100644 --- a/multimedia/mixer.c +++ b/multimedia/mixer.c @@ -13,6 +13,7 @@ #include "user.h" #include "driver.h" #include "mmsystem.h" +#include "debug.h" #ifdef linux #include @@ -20,9 +21,6 @@ #include #endif -#include "stddebug.h" -#include "debug.h" - #define MIXER_DEV "/dev/mixer" #ifdef SOUND_VERSION @@ -40,10 +38,10 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPS16 lpCaps, DWORD dwSize) #ifdef linux int mixer,mask; - dprintf_mmaux(stddeb,"MIX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); + dprintf_info(mmaux,"MIX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); if (lpCaps == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { - dprintf_mmaux(stddeb,"MIX_GetDevCaps // mixer device not available !\n"); + dprintf_warn(mmaux, "MIX_GetDevCaps // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } lpCaps->wMid = 0xAA; @@ -79,7 +77,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINE16 lpml, DWORD fdwInfo) #ifdef linux int mixer,i,j,devmask,recsrc,recmask; - dprintf_mmaux(stddeb,"MIX_GetDevLineInfo(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo); + dprintf_info(mmaux,"MIX_GetDevLineInfo(%04X, %p, %lu);\n", wDevID, lpml, fdwInfo); if (lpml == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) return MMSYSERR_NOTENABLED; @@ -180,7 +178,7 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpmod, DWORD flags) { #ifdef linux - dprintf_mmaux(stddeb,"MIX_Open(%04X, %p, %lu);\n",wDevID,lpmod,flags); + dprintf_info(mmaux,"MIX_Open(%04X, %p, %lu);\n",wDevID,lpmod,flags); if (lpmod == NULL) return MMSYSERR_NOTENABLED; /* hmm. We don't keep the mixer device open. So just pretend it works */ return MMSYSERR_NOERROR; @@ -195,7 +193,7 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpmod, DWORD flags) DWORD mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - dprintf_mmaux(stddeb,"mixMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", + dprintf_info(mmaux,"mixMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch(wMsg) { case MXDM_GETDEVCAPS: @@ -203,12 +201,12 @@ DWORD mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser, case MXDM_GETLINEINFO: return MIX_GetLineInfo(wDevID,(LPMIXERLINE16)dwParam1,dwParam2); case MXDM_GETNUMDEVS: - dprintf_mmsys(stddeb,"MIX_GetNumDevs() return 1;\n"); + dprintf_info(mmsys,"MIX_GetNumDevs() return 1;\n"); return 1; case MXDM_OPEN: return MIX_Open(wDevID,(LPMIXEROPENDESC)dwParam1,dwParam2); default: - dprintf_mmaux(stddeb,"mixMessage // unknown message %d!\n",wMsg); + dprintf_warn(mmaux,"mixMessage // unknown message %d!\n",wMsg); } return MMSYSERR_NOTSUPPORTED; } diff --git a/multimedia/mmaux.c b/multimedia/mmaux.c index de34c4f1fa1..14598b9bcf1 100644 --- a/multimedia/mmaux.c +++ b/multimedia/mmaux.c @@ -15,6 +15,7 @@ #include "user.h" #include "driver.h" #include "mmsystem.h" +#include "debug.h" #ifdef linux #include @@ -22,9 +23,6 @@ #include #endif -#include "stddebug.h" -#include "debug.h" - #define SOUND_DEV "/dev/dsp" #define MIXER_DEV "/dev/mixer" @@ -48,15 +46,15 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS16 lpCaps, DWORD dwSize) #ifdef linux int mixer,volume; - dprintf_mmaux(stddeb,"AUX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); + dprintf_info(mmaux,"AUX_GetDevCaps(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); if (lpCaps == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { - dprintf_mmaux(stddeb,"AUX_GetDevCaps // mixer device not available !\n"); + dprintf_warn(mmaux, "AUX_GetDevCaps // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } if (ioctl(mixer, SOUND_MIXER_READ_LINE, &volume) == -1) { close(mixer); - dprintf_mmaux(stddeb,"AUX_GetDevCaps // unable read mixer !\n"); + dprintf_warn(mmaux, "AUX_GetDevCaps // unable read mixer !\n"); return MMSYSERR_NOTENABLED; } close(mixer); @@ -119,49 +117,49 @@ static DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol) #ifdef linux int mixer,volume,left,right,cmd; - dprintf_mmaux(stddeb,"AUX_GetVolume(%04X, %p);\n", wDevID, lpdwVol); + dprintf_info(mmaux,"AUX_GetVolume(%04X, %p);\n", wDevID, lpdwVol); if (lpdwVol == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // mixer device not available !\n"); + dprintf_warn(mmaux, "Linux 'AUX_GetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } switch(wDevID) { case 0: - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n"); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_PCM !\n"); cmd = SOUND_MIXER_READ_PCM; break; case 1: - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n"); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_SYNTH !\n"); cmd = SOUND_MIXER_READ_SYNTH; break; case 2: - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n"); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_CD !\n"); cmd = SOUND_MIXER_READ_CD; break; case 3: - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n"); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_LINE !\n"); cmd = SOUND_MIXER_READ_LINE; break; case 4: - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n"); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_MIC !\n"); cmd = SOUND_MIXER_READ_MIC; break; case 5: - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n"); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // SOUND_MIXER_READ_VOLUME !\n"); cmd = SOUND_MIXER_READ_VOLUME; break; default: - dprintf_mmaux(stddeb, "Linux 'AUX_GetVolume' // invalid device id=%04X !\n", wDevID); + dprintf_warn(mmaux, "Linux 'AUX_GetVolume' // invalid device id=%04X !\n", wDevID); return MMSYSERR_NOTENABLED; } if (ioctl(mixer, cmd, &volume) == -1) { - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // unable read mixer !\n"); + dprintf_warn(mmaux, "Linux 'AUX_GetVolume' // unable read mixer !\n"); return MMSYSERR_NOTENABLED; } close(mixer); left = volume & 0x7F; right = (volume >> 8) & 0x7F; - dprintf_mmaux(stddeb,"Linux 'AUX_GetVolume' // left=%d right=%d !\n", left, right); + dprintf_info(mmaux,"Linux 'AUX_GetVolume' // left=%d right=%d !\n", left, right); *lpdwVol = MAKELONG(left << 9, right << 9); return MMSYSERR_NOERROR; #else @@ -178,44 +176,44 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) int mixer; int volume; int cmd; - dprintf_mmaux(stddeb,"AUX_SetVolume(%04X, %08lX);\n", wDevID, dwParam); + dprintf_info(mmaux,"AUX_SetVolume(%04X, %08lX);\n", wDevID, dwParam); volume = (LOWORD(dwParam) >> 9 & 0x7F) + ((HIWORD(dwParam) >> 9 & 0x7F) << 8); if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // mixer device not available !\n"); + dprintf_warn(mmaux, "Linux 'AUX_SetVolume' // mixer device not available !\n"); return MMSYSERR_NOTENABLED; } switch(wDevID) { case 0: - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n"); + dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_PCM !\n"); cmd = SOUND_MIXER_WRITE_PCM; break; case 1: - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n"); + dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_SYNTH !\n"); cmd = SOUND_MIXER_WRITE_SYNTH; break; case 2: - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n"); + dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_CD !\n"); cmd = SOUND_MIXER_WRITE_CD; break; case 3: - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n"); + dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_LINE !\n"); cmd = SOUND_MIXER_WRITE_LINE; break; case 4: - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n"); + dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_MIC !\n"); cmd = SOUND_MIXER_WRITE_MIC; break; case 5: - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n"); + dprintf_info(mmaux,"Linux 'AUX_SetVolume' // SOUND_MIXER_WRITE_VOLUME !\n"); cmd = SOUND_MIXER_WRITE_VOLUME; break; default: - dprintf_mmaux(stddeb, "Linux 'AUX_SetVolume' // invalid device id=%04X !\n", wDevID); + dprintf_warn(mmaux, "Linux 'AUX_SetVolume' // invalid device id=%04X !\n", wDevID); return MMSYSERR_NOTENABLED; } if (ioctl(mixer, cmd, &volume) == -1) { - dprintf_mmaux(stddeb,"Linux 'AUX_SetVolume' // unable set mixer !\n"); + dprintf_warn(mmaux, "Linux 'AUX_SetVolume' // unable set mixer !\n"); return MMSYSERR_NOTENABLED; } close(mixer); @@ -232,20 +230,20 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - dprintf_mmaux(stddeb,"auxMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", + dprintf_info(mmaux,"auxMessage(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch(wMsg) { case AUXDM_GETDEVCAPS: return AUX_GetDevCaps(wDevID,(LPAUXCAPS16)dwParam1,dwParam2); case AUXDM_GETNUMDEVS: - dprintf_mmaux(stddeb,"AUX_GetNumDevs() return %d;\n", NumDev); + dprintf_info(mmaux,"AUX_GetNumDevs() return %d;\n", NumDev); return NumDev; case AUXDM_GETVOLUME: return AUX_GetVolume(wDevID,(LPDWORD)dwParam1); case AUXDM_SETVOLUME: return AUX_SetVolume(wDevID,dwParam1); default: - dprintf_mmaux(stddeb,"auxMessage // unknown message !\n"); + dprintf_warn(mmaux, "auxMessage // unknown message !\n"); } return MMSYSERR_NOTSUPPORTED; } diff --git a/multimedia/mmio.c b/multimedia/mmio.c index d140fe1c706..597350aad4a 100644 --- a/multimedia/mmio.c +++ b/multimedia/mmio.c @@ -19,7 +19,6 @@ #include "user.h" #include "file.h" #include "mmsystem.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -27,7 +26,7 @@ * mmioDosIOProc [internal] */ static LRESULT mmioDosIOProc(LPMMIOINFO16 lpmmioinfo, UINT16 uMessage, LPARAM lParam1, LPARAM lParam2) { - dprintf_mmio(stddeb, "mmioDosIOProc(%p, %X, %ld, %ld);\n", lpmmioinfo, uMessage, lParam1, lParam2); + dprintf_info(mmio, "mmioDosIOProc(%p, %X, %ld, %ld);\n", lpmmioinfo, uMessage, lParam1, lParam2); switch (uMessage) { @@ -43,7 +42,7 @@ static LRESULT mmioDosIOProc(LPMMIOINFO16 lpmmioinfo, UINT16 uMessage, LPARAM lP LPSTR szFileName = (LPSTR) lParam1; if (lpmmioinfo->dwFlags & MMIO_GETTEMP) { - dprintf_mmio(stdnimp, "mmioDosIOProc // MMIO_GETTEMP not implemented\n"); + dprintf_fixme(mmio, "mmioDosIOProc // MMIO_GETTEMP not implemented\n"); return MMIOERR_CANNOTOPEN; } @@ -145,12 +144,12 @@ static LRESULT mmioDosIOProc(LPMMIOINFO16 lpmmioinfo, UINT16 uMessage, LPARAM lP * Returns: zero on success, non-zero on failure */ - dprintf_mmio(stddeb, "mmioDosIOProc: MMIOM_RENAME unimplemented\n"); + dprintf_fixme(mmio, "mmioDosIOProc: MMIOM_RENAME unimplemented\n"); return MMIOERR_FILENOTFOUND; } default: - dprintf_mmio(stddeb, "mmioDosIOProc: unexpected message %u\n", uMessage); + dprintf_warn(mmio, "mmioDosIOProc: unexpected message %u\n", uMessage); return 0; } @@ -196,7 +195,7 @@ HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16 * lpmmioinfo, HMMIO16 hmmio; UINT16 result; - dprintf_mmio(stddeb, "mmioOpen('%s', %p, %08lX);\n", szFileName, lpmmioinfo, dwOpenFlags); + dprintf_info(mmio, "mmioOpen('%s', %p, %08lX);\n", szFileName, lpmmioinfo, dwOpenFlags); hmmio = GlobalAlloc16(GHND, sizeof(MMIOINFO16)); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); @@ -257,7 +256,7 @@ UINT16 WINAPI mmioClose(HMMIO16 hmmio, UINT16 uFlags) LPMMIOINFO16 lpmminfo; UINT16 result; - dprintf_mmio(stddeb, "mmioClose(%04X, %04X);\n", hmmio, uFlags); + dprintf_info(mmio, "mmioClose(%04X, %04X);\n", hmmio, uFlags); lpmminfo = (LPMMIOINFO16) GlobalLock16(hmmio); if (lpmminfo == NULL) @@ -287,7 +286,7 @@ LONG WINAPI mmioRead(HMMIO16 hmmio, HPSTR pch, LONG cch) LONG count; LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioRead(%04X, %p, %ld);\n", hmmio, pch, cch); + dprintf_info(mmio, "mmioRead(%04X, %p, %ld);\n", hmmio, pch, cch); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) @@ -296,7 +295,7 @@ LONG WINAPI mmioRead(HMMIO16 hmmio, HPSTR pch, LONG cch) count = mmioSendMessage(hmmio, MMIOM_READ, (LPARAM) pch, (LPARAM) cch); GlobalUnlock16(hmmio); - dprintf_mmio(stddeb, "mmioRead // count=%ld\n", count); + dprintf_info(mmio, "mmioRead // count=%ld\n", count); return count; } @@ -310,7 +309,7 @@ LONG WINAPI mmioWrite(HMMIO16 hmmio, HPCSTR pch, LONG cch) LONG count; LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioWrite(%04X, %p, %ld);\n", hmmio, pch, cch); + dprintf_info(mmio, "mmioWrite(%04X, %p, %ld);\n", hmmio, pch, cch); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) @@ -319,7 +318,7 @@ LONG WINAPI mmioWrite(HMMIO16 hmmio, HPCSTR pch, LONG cch) count = mmioSendMessage(hmmio, MMIOM_WRITE, (LPARAM) pch, (LPARAM) cch); GlobalUnlock16(hmmio); - dprintf_mmio(stddeb, "mmioWrite // count=%ld\n", count); + dprintf_info(mmio, "mmioWrite // count=%ld\n", count); return count; } @@ -331,7 +330,7 @@ LONG WINAPI mmioSeek(HMMIO16 hmmio, LONG lOffset, int iOrigin) int offset; LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioSeek(%04X, %08lX, %d);\n", hmmio, lOffset, iOrigin); + dprintf_info(mmio, "mmioSeek(%04X, %08lX, %d);\n", hmmio, lOffset, iOrigin); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) @@ -349,7 +348,7 @@ LONG WINAPI mmioSeek(HMMIO16 hmmio, LONG lOffset, int iOrigin) UINT16 WINAPI mmioGetInfo(HMMIO16 hmmio, MMIOINFO16 * lpmmioinfo, UINT16 uFlags) { LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioGetInfo\n"); + dprintf_info(mmio, "mmioGetInfo\n"); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) return 0; memcpy(lpmmioinfo, lpmminfo, sizeof(MMIOINFO16)); @@ -363,7 +362,7 @@ UINT16 WINAPI mmioGetInfo(HMMIO16 hmmio, MMIOINFO16 * lpmmioinfo, UINT16 uFlags) UINT16 WINAPI mmioSetInfo(HMMIO16 hmmio, const MMIOINFO16 * lpmmioinfo, UINT16 uFlags) { LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioSetInfo\n"); + dprintf_info(mmio, "mmioSetInfo\n"); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) return 0; GlobalUnlock16(hmmio); @@ -376,7 +375,7 @@ UINT16 WINAPI mmioSetInfo(HMMIO16 hmmio, const MMIOINFO16 * lpmmioinfo, UINT16 u UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT16 uFlags) { - dprintf_mmio(stddeb, "mmioSetBuffer // empty stub \n"); + dprintf_fixme(mmio, "mmioSetBuffer // empty stub \n"); return 0; } @@ -386,7 +385,7 @@ UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer, UINT16 WINAPI mmioFlush(HMMIO16 hmmio, UINT16 uFlags) { LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioFlush(%04X, %04X)\n", hmmio, uFlags); + dprintf_info(mmio, "mmioFlush(%04X, %04X)\n", hmmio, uFlags); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) return 0; GlobalUnlock16(hmmio); @@ -400,7 +399,7 @@ UINT16 WINAPI mmioAdvance(HMMIO16 hmmio, MMIOINFO16 * lpmmioinfo, UINT16 uFlags) { int count = 0; LPMMIOINFO16 lpmminfo; - dprintf_mmio(stddeb, "mmioAdvance\n"); + dprintf_info(mmio, "mmioAdvance\n"); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); if (lpmminfo == NULL) return 0; if (uFlags == MMIO_READ) { @@ -442,7 +441,7 @@ FOURCC WINAPI mmioStringToFOURCC32W(LPCWSTR sz, UINT32 uFlags) */ FOURCC WINAPI mmioStringToFOURCC16(LPCSTR sz, UINT16 uFlags) { - dprintf_mmio(stddeb, "mmioStringToFOURCC // empty stub \n"); + dprintf_fixme(mmio, "mmioStringToFOURCC // empty stub \n"); return 0; } @@ -452,7 +451,7 @@ FOURCC WINAPI mmioStringToFOURCC16(LPCSTR sz, UINT16 uFlags) LPMMIOPROC16 WINAPI mmioInstallIOProc16(FOURCC fccIOProc, LPMMIOPROC16 pIOProc, DWORD dwFlags) { - dprintf_mmio(stddeb, "mmioInstallIOProc(%ld, %p, %08lX)\n", + dprintf_info(mmio, "mmioInstallIOProc(%ld, %p, %08lX)\n", fccIOProc, pIOProc, dwFlags); if (dwFlags & MMIO_GLOBALPROC) { @@ -484,7 +483,7 @@ LPMMIOPROC16 WINAPI mmioInstallIOProc16(FOURCC fccIOProc, LPMMIOPROC32 WINAPI mmioInstallIOProc32A(FOURCC fccIOProc, LPMMIOPROC32 pIOProc, DWORD dwFlags) { - dprintf_mmio(stddeb, "mmioInstallIOProcA (%c%c%c%c,%p,0x%08lx)// empty stub \n", + dprintf_fixme(mmio, "mmioInstallIOProcA (%c%c%c%c,%p,0x%08lx)// empty stub \n", (char)((fccIOProc&0xff000000)>>24), (char)((fccIOProc&0x00ff0000)>>16), (char)((fccIOProc&0x0000ff00)>> 8), @@ -518,10 +517,10 @@ LRESULT WINAPI mmioSendMessage(HMMIO16 hmmio, UINT16 uMessage, #endif if (msg) - dprintf_mmio(stddeb, "mmioSendMessage(%04X, %s, %ld, %ld)\n", + dprintf_info(mmio, "mmioSendMessage(%04X, %s, %ld, %ld)\n", hmmio, msg, lParam1, lParam2); else - dprintf_mmio(stddeb, "mmioSendMessage(%04X, %u, %ld, %ld)\n", + dprintf_info(mmio, "mmioSendMessage(%04X, %u, %ld, %ld)\n", hmmio, uMessage, lParam1, lParam2); lpmminfo = (LPMMIOINFO16)GlobalLock16(hmmio); @@ -544,20 +543,20 @@ UINT16 WINAPI mmioDescend(HMMIO16 hmmio, MMCKINFO * lpck, { DWORD dwfcc, dwOldPos; - dprintf_mmio(stddeb, "mmioDescend(%04X, %p, %p, %04X);\n", + dprintf_info(mmio, "mmioDescend(%04X, %p, %p, %04X);\n", hmmio, lpck, lpckParent, uFlags); if (lpck == NULL) return 0; dwfcc = lpck->ckid; - dprintf_mmio(stddeb, "mmioDescend // dwfcc=%08lX\n", dwfcc); + dprintf_info(mmio, "mmioDescend // dwfcc=%08lX\n", dwfcc); dwOldPos = mmioSeek(hmmio, 0, SEEK_CUR); - dprintf_mmio(stddeb, "mmioDescend // dwOldPos=%ld\n", dwOldPos); + dprintf_info(mmio, "mmioDescend // dwOldPos=%ld\n", dwOldPos); if (lpckParent != NULL) { - dprintf_mmio(stddeb, "mmioDescend // seek inside parent at %ld !\n", lpckParent->dwDataOffset); + dprintf_info(mmio, "mmioDescend // seek inside parent at %ld !\n", lpckParent->dwDataOffset); dwOldPos = mmioSeek(hmmio, lpckParent->dwDataOffset, SEEK_SET); } /* @@ -569,19 +568,19 @@ UINT16 WINAPI mmioDescend(HMMIO16 hmmio, MMCKINFO * lpck, (uFlags & MMIO_FINDLIST)) { */ if ((uFlags & MMIO_FINDCHUNK) || (uFlags & MMIO_FINDLIST)) { - dprintf_mmio(stddeb, "mmioDescend // MMIO_FINDxxxx dwfcc=%08lX !\n", dwfcc); + dprintf_info(mmio, "mmioDescend // MMIO_FINDxxxx dwfcc=%08lX !\n", dwfcc); while (TRUE) { LONG ix; ix = mmioRead(hmmio, (LPSTR)lpck, sizeof(MMCKINFO)); - dprintf_mmio(stddeb, "mmioDescend // after _lread32 ix = %ld req = %d, errno = %d\n",ix,sizeof(MMCKINFO),errno); + dprintf_info(mmio, "mmioDescend // after _lread32 ix = %ld req = %d, errno = %d\n",ix,sizeof(MMCKINFO),errno); if (ix < sizeof(MMCKINFO)) { mmioSeek(hmmio, dwOldPos, SEEK_SET); - dprintf_mmio(stddeb, "mmioDescend // return ChunkNotFound\n"); + dprintf_warn(mmio, "mmioDescend // return ChunkNotFound\n"); return MMIOERR_CHUNKNOTFOUND; } - dprintf_mmio(stddeb, "mmioDescend // dwfcc=%08lX ckid=%08lX cksize=%08lX !\n", + dprintf_info(mmio, "mmioDescend // dwfcc=%08lX ckid=%08lX cksize=%08lX !\n", dwfcc, lpck->ckid, lpck->cksize); if (dwfcc == lpck->ckid) break; @@ -595,7 +594,7 @@ UINT16 WINAPI mmioDescend(HMMIO16 hmmio, MMCKINFO * lpck, else { if (mmioRead(hmmio, (LPSTR)lpck, sizeof(MMCKINFO)) < sizeof(MMCKINFO)) { mmioSeek(hmmio, dwOldPos, SEEK_SET); - dprintf_mmio(stddeb, "mmioDescend // return ChunkNotFound 2nd\n"); + dprintf_warn(mmio, "mmioDescend // return ChunkNotFound 2nd\n"); return MMIOERR_CHUNKNOTFOUND; } } @@ -604,9 +603,9 @@ UINT16 WINAPI mmioDescend(HMMIO16 hmmio, MMCKINFO * lpck, lpck->dwDataOffset += sizeof(DWORD); mmioSeek(hmmio, lpck->dwDataOffset, SEEK_SET); - dprintf_mmio(stddeb, "mmioDescend // lpck->ckid=%08lX lpck->cksize=%ld !\n", + dprintf_info(mmio, "mmioDescend // lpck->ckid=%08lX lpck->cksize=%ld !\n", lpck->ckid, lpck->cksize); - dprintf_mmio(stddeb, "mmioDescend // lpck->fccType=%08lX !\n", lpck->fccType); + dprintf_info(mmio, "mmioDescend // lpck->fccType=%08lX !\n", lpck->fccType); return 0; } @@ -616,7 +615,7 @@ UINT16 WINAPI mmioDescend(HMMIO16 hmmio, MMCKINFO * lpck, */ UINT16 WINAPI mmioAscend(HMMIO16 hmmio, MMCKINFO * lpck, UINT16 uFlags) { - dprintf_mmio(stddeb, "mmioAscend // empty stub !\n"); + dprintf_fixme(mmio, "mmioAscend // empty stub !\n"); return 0; } @@ -625,7 +624,7 @@ UINT16 WINAPI mmioAscend(HMMIO16 hmmio, MMCKINFO * lpck, UINT16 uFlags) */ UINT16 WINAPI mmioCreateChunk(HMMIO16 hmmio, MMCKINFO * lpck, UINT16 uFlags) { - dprintf_mmio(stddeb, "mmioCreateChunk // empty stub \n"); + dprintf_fixme(mmio, "mmioCreateChunk // empty stub \n"); return 0; } @@ -640,7 +639,7 @@ UINT16 WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName, LPMMIOINFO16 lpmminfo; HMMIO16 hmmio; - dprintf_mmio(stddeb, "mmioRename('%s', '%s', %p, %08lX);\n", + dprintf_info(mmio, "mmioRename('%s', '%s', %p, %08lX);\n", szFileName, szNewFileName, lpmmioinfo, dwRenameFlags); hmmio = GlobalAlloc16(GHND, sizeof(MMIOINFO16)); diff --git a/multimedia/mmsystem.c b/multimedia/mmsystem.c index 1ee00232bfe..35e94e7a65e 100644 --- a/multimedia/mmsystem.c +++ b/multimedia/mmsystem.c @@ -22,8 +22,6 @@ #include "driver.h" #include "file.h" #include "mmsystem.h" -#include "stddebug.h" -/* #define DEBUG_MMSYS */ #include "debug.h" #include "xmalloc.h" #include "callback.h" @@ -123,7 +121,7 @@ MMSYSTEM_MMTIME16to32(LPMMTIME32 mmt32,LPMMTIME16 mmt16) { */ BOOL32 WINAPI PlaySound32A(LPCSTR pszSound, HMODULE32 hmod, DWORD fdwSound) { - dprintf_mmsys(stddeb, "PlaySoundA: pszSound='%p' hmod=%04X fdwSound=%08lX\n", + dprintf_info(mmsys, "PlaySoundA: pszSound='%p' hmod=%04X fdwSound=%08lX\n", pszSound, hmod, fdwSound); if(hmod != 0 || !(fdwSound & SND_FILENAME)) { fprintf(stderr, "PlaySoundA: only disk sound files are supported\n"); @@ -156,37 +154,37 @@ BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags) char str[128]; LPSTR ptr; - dprintf_mmsys(stddeb, "sndPlaySound // SoundName='%s' uFlags=%04X !\n", + dprintf_info(mmsys, "sndPlaySound // SoundName='%s' uFlags=%04X !\n", lpszSoundName, uFlags); if (lpszSoundName == NULL) { - dprintf_mmsys(stddeb, "sndPlaySound // Stop !\n"); + dprintf_info(mmsys, "sndPlaySound // Stop !\n"); return FALSE; } hmmio = mmioOpen16((LPSTR)lpszSoundName, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE); if (uFlags & SND_MEMORY) { - dprintf_mmsys(stddeb, "sndPlaySound // SND_MEMORY flag not implemented!\n"); + dprintf_fixme(mmsys, "sndPlaySound // SND_MEMORY flag not implemented!\n"); return FALSE; } if (hmmio == 0) { - dprintf_mmsys(stddeb, "sndPlaySound // searching in SystemSound List !\n"); + dprintf_info(mmsys, "sndPlaySound // searching in SystemSound List !\n"); GetProfileString32A("Sounds", (LPSTR)lpszSoundName, "", str, sizeof(str)); if (strlen(str) == 0) return FALSE; if ( (ptr = (LPSTR)strchr(str, ',')) != NULL) *ptr = '\0'; hmmio = mmioOpen16(str, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE); if (hmmio == 0) { - dprintf_mmsys(stddeb, "sndPlaySound // can't find SystemSound='%s' !\n", str); + dprintf_warn(mmsys, "sndPlaySound // can't find SystemSound='%s' !\n", str); return FALSE; } } if (mmioDescend(hmmio, &ckMainRIFF, NULL, 0) == 0) { - dprintf_mmsys(stddeb, "sndPlaySound // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", + dprintf_info(mmsys, "sndPlaySound // ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize); if ((ckMainRIFF.ckid == FOURCC_RIFF) && @@ -200,19 +198,19 @@ BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags) { PCMWAVEFORMAT pcmWaveFormat; - dprintf_mmsys(stddeb, "sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", + dprintf_info(mmsys, "sndPlaySound // Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); if (mmioRead(hmmio, (HPSTR) &pcmWaveFormat, (long) sizeof(PCMWAVEFORMAT)) == (long) sizeof(PCMWAVEFORMAT)) { - dprintf_mmsys(stddeb, "sndPlaySound // wFormatTag=%04X !\n", pcmWaveFormat.wf.wFormatTag); - dprintf_mmsys(stddeb, "sndPlaySound // nChannels=%d \n", pcmWaveFormat.wf.nChannels); - dprintf_mmsys(stddeb, "sndPlaySound // nSamplesPerSec=%ld\n", pcmWaveFormat.wf.nSamplesPerSec); - dprintf_mmsys(stddeb, "sndPlaySound // nAvgBytesPerSec=%ld\n", pcmWaveFormat.wf.nAvgBytesPerSec); - dprintf_mmsys(stddeb, "sndPlaySound // nBlockAlign=%d \n", pcmWaveFormat.wf.nBlockAlign); - dprintf_mmsys(stddeb, "sndPlaySound // wBitsPerSample=%u !\n", pcmWaveFormat.wBitsPerSample); + dprintf_info(mmsys, "sndPlaySound // wFormatTag=%04X !\n", pcmWaveFormat.wf.wFormatTag); + dprintf_info(mmsys, "sndPlaySound // nChannels=%d \n", pcmWaveFormat.wf.nChannels); + dprintf_info(mmsys, "sndPlaySound // nSamplesPerSec=%ld\n", pcmWaveFormat.wf.nSamplesPerSec); + dprintf_info(mmsys, "sndPlaySound // nAvgBytesPerSec=%ld\n", pcmWaveFormat.wf.nAvgBytesPerSec); + dprintf_info(mmsys, "sndPlaySound // nBlockAlign=%d \n", pcmWaveFormat.wf.nBlockAlign); + dprintf_info(mmsys, "sndPlaySound // wBitsPerSample=%u !\n", pcmWaveFormat.wBitsPerSample); mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a'); if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK) == 0) @@ -220,7 +218,7 @@ BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags) WAVEOPENDESC waveDesc; DWORD dwRet; - dprintf_mmsys(stddeb, "sndPlaySound // Chunk Found \ + dprintf_info(mmsys, "sndPlaySound // Chunk Found \ ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); pcmWaveFormat.wf.nAvgBytesPerSec = pcmWaveFormat.wf.nSamplesPerSec * @@ -260,7 +258,7 @@ BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags) bRet = TRUE; } - else dprintf_mmsys(stddeb, "sndPlaySound // can't prepare WaveOut device !\n"); + else dprintf_warn(mmsys, "sndPlaySound // can't prepare WaveOut device !\n"); GlobalUnlock16(hData); GlobalFree16(hData); @@ -289,7 +287,7 @@ UINT32 WINAPI mmsystemGetVersion32() */ UINT16 WINAPI mmsystemGetVersion16() { - dprintf_mmsys(stddeb, "mmsystemGetVersion // 3.10 (Win95?)\n"); + dprintf_info(mmsys, "mmsystemGetVersion // 3.10 (Win95?)\n"); return 0x030a; } @@ -310,14 +308,14 @@ BOOL16 WINAPI DriverCallback(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "DriverCallback(%08lX, %04X, %04X, %04X, %08lX, %08lX, %08lX); !\n", + dprintf_info(mmsys, "DriverCallback(%08lX, %04X, %04X, %04X, %08lX, %08lX, %08lX); !\n", dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2); switch(uFlags & DCB_TYPEMASK) { case DCB_NULL: - dprintf_mmsys(stddeb, "DriverCallback() // CALLBACK_NULL !\n"); + dprintf_info(mmsys, "DriverCallback() // CALLBACK_NULL !\n"); break; case DCB_WINDOW: - dprintf_mmsys(stddeb, "DriverCallback() // CALLBACK_WINDOW = %04lX handle = %04X!\n",dwCallBack,hDev); + dprintf_info(mmsys, "DriverCallback() // CALLBACK_WINDOW = %04lX handle = %04X!\n",dwCallBack,hDev); if (!IsWindow32(dwCallBack)) return FALSE; lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hDev); if (lpDesc == NULL) return FALSE; @@ -325,10 +323,10 @@ BOOL16 WINAPI DriverCallback(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev, PostMessage16((HWND16)dwCallBack, wMsg, hDev, dwParam1); break; case DCB_TASK: - dprintf_mmsys(stddeb, "DriverCallback() // CALLBACK_TASK !\n"); + dprintf_info(mmsys, "DriverCallback() // CALLBACK_TASK !\n"); return FALSE; case DCB_FUNCTION: - dprintf_mmsys(stddeb, "DriverCallback() // CALLBACK_FUNCTION !\n"); + dprintf_info(mmsys, "DriverCallback() // CALLBACK_FUNCTION !\n"); Callbacks->CallDriverCallback( (FARPROC16)dwCallBack, hDev, wMsg, dwUser, dwParam1, dwParam2 ); @@ -366,7 +364,7 @@ UINT16 WINAPI mixerGetNumDevs16() UINT16 count; count = mixMessage(0,MXDM_GETNUMDEVS,0L,0L,0L); - dprintf_mmaux(stddeb,"mixerGetNumDevs returns %d\n",count); + dprintf_info(mmaux,"mixerGetNumDevs returns %d\n",count); return count; } @@ -700,9 +698,9 @@ UINT32 WINAPI auxGetNumDevs32() UINT16 WINAPI auxGetNumDevs16() { UINT16 count = 0; - dprintf_mmsys(stddeb, "auxGetNumDevs !\n"); + dprintf_info(mmsys, "auxGetNumDevs !\n"); count += auxMessage(0, AUXDM_GETNUMDEVS, 0L, 0L, 0L); - dprintf_mmsys(stddeb, "auxGetNumDevs return %u \n", count); + dprintf_info(mmsys, "auxGetNumDevs return %u \n", count); return count; } @@ -745,7 +743,7 @@ UINT32 WINAPI auxGetDevCaps32A(UINT32 uDeviceID,LPAUXCAPS32A lpCaps,UINT32 uSize */ UINT16 WINAPI auxGetDevCaps16(UINT16 uDeviceID,LPAUXCAPS16 lpCaps, UINT16 uSize) { - dprintf_mmsys(stddeb, "auxGetDevCaps(%04X, %p, %d) !\n", + dprintf_info(mmsys, "auxGetDevCaps(%04X, %p, %d) !\n", uDeviceID, lpCaps, uSize); return auxMessage(uDeviceID, AUXDM_GETDEVCAPS, 0L, (DWORD)lpCaps, (DWORD)uSize); @@ -764,7 +762,7 @@ UINT32 WINAPI auxGetVolume32(UINT32 uDeviceID, DWORD * lpdwVolume) */ UINT16 WINAPI auxGetVolume16(UINT16 uDeviceID, DWORD * lpdwVolume) { - dprintf_mmsys(stddeb, "auxGetVolume(%04X, %p) !\n", uDeviceID, lpdwVolume); + dprintf_info(mmsys, "auxGetVolume(%04X, %p) !\n", uDeviceID, lpdwVolume); return auxMessage(uDeviceID, AUXDM_GETVOLUME, 0L, (DWORD)lpdwVolume, 0L); } @@ -781,7 +779,7 @@ UINT32 WINAPI auxSetVolume32(UINT32 uDeviceID, DWORD dwVolume) */ UINT16 WINAPI auxSetVolume16(UINT16 uDeviceID, DWORD dwVolume) { - dprintf_mmsys(stddeb, "auxSetVolume(%04X, %08lX) !\n", uDeviceID, dwVolume); + dprintf_info(mmsys, "auxSetVolume(%04X, %08lX) !\n", uDeviceID, dwVolume); return auxMessage(uDeviceID, AUXDM_SETVOLUME, 0L, dwVolume, 0L); } @@ -812,7 +810,7 @@ DWORD WINAPI auxOutMessage32(UINT32 uDeviceID,UINT32 uMessage,DWORD dw1,DWORD dw */ DWORD WINAPI auxOutMessage16(UINT16 uDeviceID, UINT16 uMessage, DWORD dw1, DWORD dw2) { - dprintf_mmsys(stddeb, "auxOutMessage(%04X, %04X, %08lX, %08lX)\n", + dprintf_info(mmsys, "auxOutMessage(%04X, %04X, %08lX, %08lX)\n", uDeviceID, uMessage, dw1, dw2); switch (uMessage) { case AUXDM_GETNUMDEVS: @@ -859,7 +857,8 @@ BOOL32 WINAPI mciGetErrorString32A(DWORD wError,LPSTR lpstrBuffer,UINT32 uLength BOOL16 WINAPI mciGetErrorString16(DWORD wError,LPSTR lpstrBuffer,UINT16 uLength) { LPSTR msgptr; - dprintf_mmsys(stddeb, "mciGetErrorString(%08lX, %p, %d);\n", wError, lpstrBuffer, uLength); + dprintf_info(mmsys, "mciGetErrorString(%08lX, %p, %d);\n", + wError, lpstrBuffer, uLength); if ((lpstrBuffer == NULL) || (uLength < 1)) return(FALSE); lpstrBuffer[0] = '\0'; switch(wError) { @@ -1124,7 +1123,7 @@ msg# 543 : tmsf break; } lstrcpyn32A(lpstrBuffer, msgptr, uLength); - dprintf_mmsys(stddeb, "mciGetErrorString // msg = %s;\n", msgptr); + dprintf_info(mmsys, "mciGetErrorString // msg = %s;\n", msgptr); return TRUE; } @@ -1134,9 +1133,9 @@ msg# 543 : tmsf */ BOOL16 WINAPI mciDriverNotify(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus) { - dprintf_mmsys(stddeb, "mciDriverNotify(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus); + dprintf_info(mmsys, "mciDriverNotify(%04X, %u, %04X)\n", hWndCallBack, wDevID, wStatus); if (!IsWindow32(hWndCallBack)) return FALSE; - dprintf_mmsys(stddeb, "mciDriverNotify // before PostMessage\n"); + dprintf_info(mmsys, "mciDriverNotify // before PostMessage\n"); PostMessage16( hWndCallBack, MM_MCINOTIFY, wStatus, MAKELONG(wDevID, 0)); return TRUE; @@ -1155,23 +1154,23 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) DWORD dwret; lpParms = PTR_SEG_TO_LIN(lp16Parms); - dprintf_mmsys(stddeb, "mciOpen(%08lX, %p (%p))\n", dwParam, lp16Parms, lpParms); + dprintf_info(mmsys, "mciOpen(%08lX, %p (%p))\n", dwParam, lp16Parms, lpParms); if (lp16Parms == NULL) return MCIERR_INTERNAL; while(GetDrv(wDevID)->modp.wType != 0) { wDevID = MMSYSTEM_NextDevID(wDevID); if (!MMSYSTEM_DevIDValid(wDevID)) { - dprintf_mmsys(stddeb, "MCI_OPEN // MAXMCIDRIVERS reached !\n"); + dprintf_info(mmsys, "MCI_OPEN // MAXMCIDRIVERS reached !\n"); return MCIERR_INTERNAL; } } - dprintf_mmsys(stddeb, "mciOpen // wDevID=%04X \n", wDevID); + dprintf_info(mmsys, "mciOpen // wDevID=%04X \n", wDevID); memcpy(GetOpenDrv(wDevID),lpParms,sizeof(*lpParms)); if (dwParam & MCI_OPEN_ELEMENT) { char *s,*t; - dprintf_mmsys(stddeb,"mciOpen // lpstrElementName='%s'\n", + dprintf_info(mmsys,"mciOpen // lpstrElementName='%s'\n", (char*)PTR_SEG_TO_LIN(lpParms->lpstrElementName) ); s=(char*)PTR_SEG_TO_LIN(lpParms->lpstrElementName); @@ -1179,7 +1178,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) if (t) { GetProfileString32A("mci extensions",t+1,"*",str,sizeof(str)); CharUpper32A(str); - dprintf_mmsys(stddeb, "mciOpen // str = %s \n", str); + dprintf_info(mmsys, "mciOpen // str = %s \n", str); if (strcmp(str, "CDAUDIO") == 0) { uDevTyp = MCI_DEVTYPE_CD_AUDIO; } else @@ -1196,7 +1195,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) uDevTyp = MCI_DEVTYPE_DIGITAL_VIDEO; } else if (strcmp(str,"*") == 0) { - dprintf_mmsys(stddeb,"No [mci extensions] entry for %s found.\n",t); + dprintf_info(mmsys,"No [mci extensions] entry for %s found.\n",t); return MCIERR_EXTENSION_NOT_FOUND; #if testing16 } else { @@ -1209,7 +1208,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) GetDrv(wDevID)->driverproc = GetProcAddress16(hmod,SEGPTR_GET(SEGPTR_STRDUP("DRIVERPROC"))); uDevTyp = MCI_DEVTYPE_OTHER; } else { - dprintf_mmsys(stddeb,"[mci extensions] entry %s for %s not supported.\n",str,t); + dprintf_fixme(mmsys, "[mci extensions] entry %s for %s not supported.\n",str,t); return MCIERR_DEVICE_NOT_INSTALLED; } #endif @@ -1219,7 +1218,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) } if (dwParam & MCI_OPEN_ALIAS) { - dprintf_mmsys(stddeb, "MCI_OPEN // Alias='%s' !\n", + dprintf_info(mmsys, "MCI_OPEN // Alias='%s' !\n", (char*)PTR_SEG_TO_LIN(lpParms->lpstrAlias)); GetOpenDrv(wDevID)->lpstrAlias = (LPSTR)SEGPTR_GET( SEGPTR_STRDUP((char*)PTR_SEG_TO_LIN(lpParms->lpstrAlias))); @@ -1227,12 +1226,12 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) } if (dwParam & MCI_OPEN_TYPE) { if (dwParam & MCI_OPEN_TYPE_ID) { - dprintf_mmsys(stddeb, "MCI_OPEN // Dev=%08lx!\n", (DWORD)lpParms->lpstrDeviceType); + dprintf_info(mmsys, "MCI_OPEN // Dev=%08lx!\n", (DWORD)lpParms->lpstrDeviceType); uDevTyp = LOWORD((DWORD)lpParms->lpstrDeviceType); GetOpenDrv(wDevID)->lpstrDeviceType=(LPSTR)lpParms->lpstrDeviceType; } else { if (lpParms->lpstrDeviceType == NULL) return MCIERR_INTERNAL; - dprintf_mmsys(stddeb, "MCI_OPEN // Dev='%s' !\n", + dprintf_info(mmsys, "MCI_OPEN // Dev='%s' !\n", (char*)PTR_SEG_TO_LIN(lpParms->lpstrDeviceType)); GetOpenDrv(wDevID)->lpstrDeviceType=(LPSTR)SEGPTR_GET( SEGPTR_STRDUP((char*)PTR_SEG_TO_LIN(lpParms->lpstrDeviceType))); @@ -1273,7 +1272,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) GetDrv(wDevID)->modp.wType = uDevTyp; GetDrv(wDevID)->modp.wDeviceID = 0; /* FIXME? for multiple devices */ lpParms->wDeviceID = wDevID; - dprintf_mmsys(stddeb, "MCI_OPEN // mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n", + dprintf_info(mmsys, "MCI_OPEN // mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n", wDevID, uDevTyp, lpParms->wDeviceID); switch(uDevTyp) { @@ -1294,12 +1293,12 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) dwParam, (DWORD)lp16Parms); break; case MCI_DEVTYPE_DIGITAL_VIDEO: - dprintf_mmsys(stddeb, "MCI_OPEN // No DIGITAL_VIDEO yet !\n"); + dprintf_info(mmsys, "MCI_OPEN // No DIGITAL_VIDEO yet !\n"); return MCIERR_DEVICE_NOT_INSTALLED; default: #if testing16 dwret = Callbacks->CallDriverProc(GetDrv(wDevID)->driverproc,0,GetDrv(wDevID)->hdrv,MCI_OPEN_DRIVER,dwParam,(DWORD)lp16Parms); - dprintf_mmsys(stddeb, "MCI_OPEN // Invalid Device Name '%08lx' !\n", (DWORD)lpParms->lpstrDeviceType); + dprintf_warn(mmsys, "MCI_OPEN // Invalid Device Name '%08lx' !\n", (DWORD)lpParms->lpstrDeviceType); #endif return MCIERR_INVALID_DEVICE_NAME; } @@ -1310,7 +1309,7 @@ DWORD mciOpen(DWORD dwParam, LPMCI_OPEN_PARMS16 lp16Parms) (dwret==0?MCI_NOTIFY_SUCCESSFUL:MCI_NOTIFY_FAILURE)); /* only handled devices fall through */ - dprintf_mmsys(stddeb, "MCI_OPEN // wDevID = %04X wDeviceID = %d dwret = %ld\n",wDevID, lpParms->wDeviceID, dwret); + dprintf_info(mmsys, "MCI_OPEN // wDevID = %04X wDeviceID = %d dwret = %ld\n",wDevID, lpParms->wDeviceID, dwret); return dwret; } @@ -1337,7 +1336,7 @@ DWORD mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) { DWORD dwRet = MCIERR_INTERNAL; - dprintf_mmsys(stddeb, "mciClose(%04x, %08lX, %p)\n", wDevID, dwParam, lpParms); + dprintf_info(mmsys, "mciClose(%04x, %08lX, %p)\n", wDevID, dwParam, lpParms); switch(GetDrv(wDevID)->modp.wType) { case MCI_DEVTYPE_CD_AUDIO: dwRet = CDAUDIO_DriverProc(GetDrv(wDevID)->modp.wDeviceID,0, @@ -1369,7 +1368,7 @@ DWORD mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) mciDriverNotify(lpParms->dwCallback,wDevID, (dwRet==0?MCI_NOTIFY_SUCCESSFUL:MCI_NOTIFY_FAILURE)); - dprintf_mmsys(stddeb, "mciClose() // returns %ld\n",dwRet); + dprintf_info(mmsys, "mciClose() // returns %ld\n",dwRet); return dwRet; } @@ -1384,23 +1383,23 @@ DWORD mciSysInfo(DWORD dwFlags, LPMCI_SYSINFO_PARMS16 lpParms) LPSTR lpstrReturn; DWORD *lpdwRet; LPSTR SysFile = "SYSTEM.INI"; - dprintf_mci(stddeb, "mciSysInfo(%08lX, %08lX)\n", dwFlags, (DWORD)lpParms); + dprintf_info(mci, "mciSysInfo(%08lX, %08lX)\n", dwFlags, (DWORD)lpParms); lpstrReturn = PTR_SEG_TO_LIN(lpParms->lpstrReturn); switch(dwFlags) { case MCI_SYSINFO_QUANTITY: - dprintf_mci(stddeb, "mciSysInfo // MCI_SYSINFO_QUANTITY \n"); + dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_QUANTITY \n"); lpdwRet = (DWORD *)lpstrReturn; *(lpdwRet) = InstalledCount; return 0; case MCI_SYSINFO_INSTALLNAME: - dprintf_mci(stddeb, "mciSysInfo // MCI_SYSINFO_INSTALLNAME \n"); + dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_INSTALLNAME \n"); if (lpInstallNames == NULL) { InstalledCount = 0; InstalledListLen = 0; ptr = lpInstallNames = xmalloc(2048); GetPrivateProfileString32A("mci", NULL, "", lpInstallNames, 2000, SysFile); while(strlen(ptr) > 0) { - dprintf_mci(stddeb, "---> '%s' \n", ptr); + dprintf_info(mci, "---> '%s' \n", ptr); len = strlen(ptr) + 1; ptr += len; InstalledListLen += len; @@ -1413,10 +1412,10 @@ DWORD mciSysInfo(DWORD dwFlags, LPMCI_SYSINFO_PARMS16 lpParms) strcpy(lpstrReturn, lpInstallNames); return 0; case MCI_SYSINFO_NAME: - dprintf_mci(stddeb, "mciSysInfo // MCI_SYSINFO_NAME \n"); + dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_NAME \n"); return 0; case MCI_SYSINFO_OPEN: - dprintf_mci(stddeb, "mciSysInfo // MCI_SYSINFO_OPEN \n"); + dprintf_info(mci, "mciSysInfo // MCI_SYSINFO_OPEN \n"); return 0; } return MMSYSERR_INVALPARAM; @@ -1487,7 +1486,7 @@ DWORD mciSound(UINT16 wDevID, DWORD dwParam, LPMCI_SOUND_PARMS lpParms) { if (lpParms == NULL) return MCIERR_INTERNAL; if (dwParam & MCI_SOUND_NAME) - dprintf_mci(stddeb, "MCI_SOUND // file='%s' !\n", lpParms->lpstrSoundName); + dprintf_info(mci, "MCI_SOUND // file='%s' !\n", lpParms->lpstrSoundName); return MCIERR_INVALID_DEVICE_ID; } * @@ -1552,7 +1551,7 @@ DWORD WINAPI mciSendCommand32A(UINT32 wDevID, UINT32 wMsg, DWORD dwParam1, LPMCI_OPEN_PARMS32A lpmop = (LPMCI_OPEN_PARMS32A)dwParam2; fprintf(stderr," MCI_OPEN(%s,%s,%s)\n", (dwParam1&MCI_OPEN_TYPE) ?lpmop->lpstrDeviceType:"", - (dwParam1&MCI_OPEN_ELEMENT)?lpmop->lpstrElementName:"", + (dwParam1&MCI_OPEN_ELEMENT)?(HIWORD(lpmop->lpstrElementName)?lpmop->lpstrElementName:""):"", (dwParam1&MCI_OPEN_ALIAS) ?lpmop->lpstrAlias:"" ); break; @@ -1567,7 +1566,7 @@ DWORD WINAPI mciSendCommand(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2) { HDRVR16 hDrv = 0; - dprintf_mci(stddeb, "mciSendCommand(%04X, %s, %08lX, %08lX)\n", + dprintf_info(mci, "mciSendCommand(%04X, %s, %08lX, %08lX)\n", wDevID, _mciCommandToString(wMsg), dwParam1, dwParam2); switch(wMsg) { @@ -1599,7 +1598,7 @@ DWORD WINAPI mciSendCommand(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, default: return Callbacks->CallDriverProc(GetDrv(wDevID)->driverproc,GetDrv(wDevID)->modp.wDeviceID,GetDrv(wDevID)->hdrv,MCI_CLOSE,dwParam1,dwParam2); - dprintf_mci(stddeb, + dprintf_warn(mci, "mciSendCommand() // unknown device type=%04X !\n", GetDrv(wDevID)->modp.wType); } @@ -1614,7 +1613,7 @@ UINT16 WINAPI mciGetDeviceID (LPCSTR lpstrName) { UINT16 wDevID; - dprintf_mci(stddeb, "mciGetDeviceID(\"%s\")\n", lpstrName); + dprintf_info(mci, "mciGetDeviceID(\"%s\")\n", lpstrName); if (lpstrName && !lstrcmpi32A(lpstrName, "ALL")) return MCI_ALL_DEVICE_ID; @@ -1683,9 +1682,9 @@ UINT32 WINAPI midiOutGetNumDevs32(void) UINT16 WINAPI midiOutGetNumDevs16(void) { UINT16 count = 0; - dprintf_mmsys(stddeb, "midiOutGetNumDevs\n"); + dprintf_info(mmsys, "midiOutGetNumDevs\n"); count += modMessage(0, MODM_GETNUMDEVS, 0L, 0L, 0L); - dprintf_mmsys(stddeb, "midiOutGetNumDevs return %u \n", count); + dprintf_info(mmsys, "midiOutGetNumDevs return %u \n", count); return count; } @@ -1735,7 +1734,7 @@ UINT32 WINAPI midiOutGetDevCaps32A(UINT32 uDeviceID,LPMIDIOUTCAPS32A lpCaps, UIN */ UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID,LPMIDIOUTCAPS16 lpCaps, UINT16 uSize) { - dprintf_mmsys(stddeb, "midiOutGetDevCaps\n"); + dprintf_info(mmsys, "midiOutGetDevCaps\n"); return modMessage(uDeviceID,MODM_GETDEVCAPS,0,(DWORD)lpCaps,uSize); } @@ -1744,7 +1743,7 @@ UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID,LPMIDIOUTCAPS16 lpCaps, UINT1 */ UINT32 WINAPI midiOutGetErrorText32A(UINT32 uError, LPSTR lpText, UINT32 uSize) { - dprintf_mmsys(stddeb, "midiOutGetErrorText\n"); + dprintf_info(mmsys, "midiOutGetErrorText\n"); return midiGetErrorText(uError, lpText, uSize); } @@ -1755,7 +1754,8 @@ UINT32 WINAPI midiOutGetErrorText32W(UINT32 uError, LPWSTR lpText, UINT32 uSize) { LPSTR xstr = HeapAlloc(GetProcessHeap(),0,uSize); UINT32 ret; - dprintf_mmsys(stddeb, "midiOutGetErrorText\n"); + + dprintf_info(mmsys, "midiOutGetErrorText\n"); ret = midiGetErrorText(uError, xstr, uSize); lstrcpyAtoW(lpText,xstr); HeapFree(GetProcessHeap(),0,xstr); @@ -1766,7 +1766,7 @@ UINT32 WINAPI midiOutGetErrorText32W(UINT32 uError, LPWSTR lpText, UINT32 uSize) */ UINT16 WINAPI midiOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) { - dprintf_mmsys(stddeb, "midiOutGetErrorText\n"); + dprintf_info(mmsys, "midiOutGetErrorText\n"); return midiGetErrorText(uError, lpText, uSize); } @@ -1839,10 +1839,10 @@ UINT16 WINAPI midiOutOpen16(HMIDIOUT16 * lphMidiOut, UINT16 uDeviceID, DWORD dwRet = 0; BOOL32 bMapperFlg = FALSE; if (lphMidiOut != NULL) *lphMidiOut = 0; - dprintf_mmsys(stddeb, "midiOutOpen(%p, %d, %08lX, %08lX, %08lX);\n", + dprintf_info(mmsys, "midiOutOpen(%p, %d, %08lX, %08lX, %08lX);\n", lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags); if (uDeviceID == (UINT16)MIDI_MAPPER) { - dprintf_mmsys(stddeb, "midiOutOpen // MIDI_MAPPER mode requested !\n"); + dprintf_info(mmsys, "midiOutOpen // MIDI_MAPPER mode requested !\n"); bMapperFlg = TRUE; uDeviceID = 0; } @@ -1860,7 +1860,7 @@ UINT16 WINAPI midiOutOpen16(HMIDIOUT16 * lphMidiOut, UINT16 uDeviceID, if (dwRet == MMSYSERR_NOERROR) break; if (!bMapperFlg) break; uDeviceID++; - dprintf_mmsys(stddeb, "midiOutOpen // MIDI_MAPPER mode ! try next driver...\n"); + dprintf_info(mmsys, "midiOutOpen // MIDI_MAPPER mode ! try next driver...\n"); } return dwRet; } @@ -1879,7 +1879,7 @@ UINT32 WINAPI midiOutClose32(HMIDIOUT32 hMidiOut) UINT16 WINAPI midiOutClose16(HMIDIOUT16 hMidiOut) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutClose(%04X)\n", hMidiOut); + dprintf_info(mmsys, "midiOutClose(%04X)\n", hMidiOut); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return modMessage(0, MODM_CLOSE, lpDesc->dwInstance, 0L, 0L); @@ -1901,7 +1901,7 @@ UINT16 WINAPI midiOutPrepareHeader16(HMIDIOUT16 hMidiOut, MIDIHDR * lpMidiOutHdr, UINT16 uSize) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutPrepareHeader(%04X, %p, %d)\n", + dprintf_info(mmsys, "midiOutPrepareHeader(%04X, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -1924,7 +1924,7 @@ UINT16 WINAPI midiOutUnprepareHeader16(HMIDIOUT16 hMidiOut, MIDIHDR * lpMidiOutHdr, UINT16 uSize) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutUnprepareHeader(%04X, %p, %d)\n", + dprintf_info(mmsys, "midiOutUnprepareHeader(%04X, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -1945,7 +1945,7 @@ UINT32 WINAPI midiOutShortMsg32(HMIDIOUT32 hMidiOut, DWORD dwMsg) UINT16 WINAPI midiOutShortMsg16(HMIDIOUT16 hMidiOut, DWORD dwMsg) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutShortMsg(%04X, %08lX)\n", hMidiOut, dwMsg); + dprintf_info(mmsys, "midiOutShortMsg(%04X, %08lX)\n", hMidiOut, dwMsg); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return modMessage(0, MODM_DATA, lpDesc->dwInstance, dwMsg, 0L); @@ -1967,7 +1967,7 @@ UINT16 WINAPI midiOutLongMsg16(HMIDIOUT16 hMidiOut, MIDIHDR * lpMidiOutHdr, UINT16 uSize) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutLongMsg(%04X, %p, %d)\n", + dprintf_info(mmsys, "midiOutLongMsg(%04X, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -1989,7 +1989,7 @@ UINT32 WINAPI midiOutReset32(HMIDIOUT32 hMidiOut) UINT16 WINAPI midiOutReset16(HMIDIOUT16 hMidiOut) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutReset(%04X)\n", hMidiOut); + dprintf_info(mmsys, "midiOutReset(%04X)\n", hMidiOut); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return modMessage(0, MODM_RESET, lpDesc->dwInstance, 0L, 0L); @@ -2007,7 +2007,7 @@ UINT32 WINAPI midiOutGetVolume32(UINT32 uDeviceID, DWORD * lpdwVolume) */ UINT16 WINAPI midiOutGetVolume16(UINT16 uDeviceID, DWORD * lpdwVolume) { - dprintf_mmsys(stddeb, "midiOutGetVolume(%04X, %p);\n", uDeviceID, lpdwVolume); + dprintf_info(mmsys, "midiOutGetVolume(%04X, %p);\n", uDeviceID, lpdwVolume); return modMessage(uDeviceID, MODM_GETVOLUME, 0L, (DWORD)lpdwVolume, 0L); } @@ -2024,7 +2024,7 @@ UINT32 WINAPI midiOutSetVolume32(UINT32 uDeviceID, DWORD dwVolume) */ UINT16 WINAPI midiOutSetVolume16(UINT16 uDeviceID, DWORD dwVolume) { - dprintf_mmsys(stddeb, "midiOutSetVolume(%04X, %08lX);\n", uDeviceID, dwVolume); + dprintf_info(mmsys, "midiOutSetVolume(%04X, %08lX);\n", uDeviceID, dwVolume); return modMessage(uDeviceID, MODM_SETVOLUME, 0L, dwVolume, 0L); } @@ -2085,7 +2085,7 @@ UINT32 WINAPI midiOutGetID32(HMIDIOUT32 hMidiOut, UINT32 * lpuDeviceID) */ UINT16 WINAPI midiOutGetID16(HMIDIOUT16 hMidiOut, UINT16 * lpuDeviceID) { - dprintf_mmsys(stddeb, "midiOutGetID\n"); + dprintf_info(mmsys, "midiOutGetID\n"); return 0; } @@ -2097,7 +2097,7 @@ DWORD WINAPI midiOutMessage32(HMIDIOUT32 hMidiOut, UINT32 uMessage, { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutMessage(%04X, %04X, %08lX, %08lX)\n", + dprintf_info(mmsys, "midiOutMessage(%04X, %04X, %08lX, %08lX)\n", hMidiOut, uMessage, dwParam1, dwParam2); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2134,7 +2134,7 @@ DWORD WINAPI midiOutMessage16(HMIDIOUT16 hMidiOut, UINT16 uMessage, { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiOutMessage(%04X, %04X, %08lX, %08lX)\n", + dprintf_info(mmsys, "midiOutMessage(%04X, %04X, %08lX, %08lX)\n", hMidiOut, uMessage, dwParam1, dwParam2); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2179,9 +2179,9 @@ UINT32 WINAPI midiInGetNumDevs32(void) UINT16 WINAPI midiInGetNumDevs16(void) { UINT16 count = 0; - dprintf_mmsys(stddeb, "midiInGetNumDevs\n"); + dprintf_info(mmsys, "midiInGetNumDevs\n"); count += midMessage(0, MIDM_GETNUMDEVS, 0L, 0L, 0L); - dprintf_mmsys(stddeb, "midiInGetNumDevs return %u \n", count); + dprintf_info(mmsys, "midiInGetNumDevs return %u \n", count); return count; } @@ -2225,7 +2225,7 @@ UINT32 WINAPI midiInGetDevCaps32A(UINT32 uDeviceID, UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID, LPMIDIINCAPS16 lpCaps, UINT16 uSize) { - dprintf_mmsys(stddeb, "midiInGetDevCaps\n"); + dprintf_info(mmsys, "midiInGetDevCaps\n"); return midMessage(uDeviceID,MIDM_GETDEVCAPS,0,(DWORD)lpCaps,uSize);; } @@ -2253,7 +2253,7 @@ UINT32 WINAPI midiInGetErrorText32A(UINT32 uError, LPSTR lpText, UINT32 uSize) */ UINT16 WINAPI midiInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) { - dprintf_mmsys(stddeb, "midiInGetErrorText\n"); + dprintf_info(mmsys, "midiInGetErrorText\n"); return (midiGetErrorText(uError, lpText, uSize)); } @@ -2281,10 +2281,10 @@ UINT16 WINAPI midiInOpen16(HMIDIIN16 * lphMidiIn, UINT16 uDeviceID, BOOL32 bMapperFlg = FALSE; if (lphMidiIn != NULL) *lphMidiIn = 0; - dprintf_mmsys(stddeb, "midiInOpen(%p, %d, %08lX, %08lX, %08lX);\n", + dprintf_info(mmsys, "midiInOpen(%p, %d, %08lX, %08lX, %08lX);\n", lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags); if (uDeviceID == (UINT16)MIDI_MAPPER) { - dprintf_mmsys(stddeb, "midiInOpen // MIDI_MAPPER mode requested !\n"); + dprintf_info(mmsys, "midiInOpen // MIDI_MAPPER mode requested !\n"); bMapperFlg = TRUE; uDeviceID = 0; } @@ -2301,7 +2301,7 @@ UINT16 WINAPI midiInOpen16(HMIDIIN16 * lphMidiIn, UINT16 uDeviceID, if (dwRet == MMSYSERR_NOERROR) break; if (!bMapperFlg) break; uDeviceID++; - dprintf_mmsys(stddeb, "midiInOpen // MIDI_MAPPER mode ! try next driver...\n"); + dprintf_info(mmsys, "midiInOpen // MIDI_MAPPER mode ! try next driver...\n"); } return dwRet; } @@ -2320,7 +2320,7 @@ UINT32 WINAPI midiInClose32(HMIDIIN32 hMidiIn) UINT16 WINAPI midiInClose16(HMIDIIN16 hMidiIn) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiInClose(%04X)\n", hMidiIn); + dprintf_info(mmsys, "midiInClose(%04X)\n", hMidiIn); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return midMessage(0, MIDM_CLOSE, lpDesc->dwInstance, 0L, 0L); @@ -2342,7 +2342,7 @@ UINT16 WINAPI midiInPrepareHeader16(HMIDIIN16 hMidiIn, MIDIHDR * lpMidiInHdr, UINT16 uSize) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiInPrepareHeader(%04X, %p, %d)\n", + dprintf_info(mmsys, "midiInPrepareHeader(%04X, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2366,7 +2366,7 @@ UINT16 WINAPI midiInUnprepareHeader16(HMIDIIN16 hMidiIn, MIDIHDR * lpMidiInHdr, UINT16 uSize) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiInUnprepareHeader(%04X, %p, %d)\n", + dprintf_info(mmsys, "midiInUnprepareHeader(%04X, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2389,7 +2389,7 @@ UINT32 WINAPI midiInAddBuffer32(HMIDIIN32 hMidiIn, UINT16 WINAPI midiInAddBuffer16(HMIDIIN16 hMidiIn, MIDIHDR * lpMidiInHdr, UINT16 uSize) { - dprintf_mmsys(stddeb, "midiInAddBuffer\n"); + dprintf_info(mmsys, "midiInAddBuffer\n"); return 0; } @@ -2406,7 +2406,7 @@ UINT32 WINAPI midiInStart32(HMIDIIN32 hMidiIn) */ UINT16 WINAPI midiInStart16(HMIDIIN16 hMidiIn) { - dprintf_mmsys(stddeb, "midiInStart\n"); + dprintf_info(mmsys, "midiInStart\n"); return 0; } @@ -2423,7 +2423,7 @@ UINT32 WINAPI midiInStop32(HMIDIIN32 hMidiIn) */ UINT16 WINAPI midiInStop16(HMIDIIN16 hMidiIn) { - dprintf_mmsys(stddeb, "midiInStop\n"); + dprintf_info(mmsys, "midiInStop\n"); return 0; } @@ -2440,7 +2440,7 @@ UINT32 WINAPI midiInReset32(HMIDIIN32 hMidiIn) */ UINT16 WINAPI midiInReset16(HMIDIIN16 hMidiIn) { - dprintf_mmsys(stddeb, "midiInReset\n"); + dprintf_info(mmsys, "midiInReset\n"); return 0; } @@ -2449,7 +2449,7 @@ UINT16 WINAPI midiInReset16(HMIDIIN16 hMidiIn) */ UINT32 WINAPI midiInGetID32(HMIDIIN32 hMidiIn, UINT32 * lpuDeviceID) { - dprintf_mmsys(stddeb, "midiInGetID\n"); + dprintf_info(mmsys, "midiInGetID\n"); return 0; } @@ -2458,7 +2458,7 @@ UINT32 WINAPI midiInGetID32(HMIDIIN32 hMidiIn, UINT32 * lpuDeviceID) */ UINT16 WINAPI midiInGetID16(HMIDIIN16 hMidiIn, UINT16 * lpuDeviceID) { - dprintf_mmsys(stddeb, "midiInGetID\n"); + dprintf_info(mmsys, "midiInGetID\n"); return 0; } @@ -2469,7 +2469,7 @@ DWORD WINAPI midiInMessage32(HMIDIIN32 hMidiIn, UINT32 uMessage, DWORD dwParam1, DWORD dwParam2) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiInMessage(%04X, %04X, %08lX, %08lX)\n", + dprintf_info(mmsys, "midiInMessage(%04X, %04X, %08lX, %08lX)\n", hMidiIn, uMessage, dwParam1, dwParam2); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2508,7 +2508,7 @@ DWORD WINAPI midiInMessage16(HMIDIIN16 hMidiIn, UINT16 uMessage, DWORD dwParam1, DWORD dwParam2) { LPMIDIOPENDESC lpDesc; - dprintf_mmsys(stddeb, "midiInMessage(%04X, %04X, %08lX, %08lX)\n", + dprintf_info(mmsys, "midiInMessage(%04X, %04X, %08lX, %08lX)\n", hMidiIn, uMessage, dwParam1, dwParam2); lpDesc = (LPMIDIOPENDESC) USER_HEAP_LIN_ADDR(hMidiIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2554,9 +2554,9 @@ UINT32 WINAPI waveOutGetNumDevs32() { UINT16 WINAPI waveOutGetNumDevs16() { UINT16 count = 0; - dprintf_mmsys(stddeb, "waveOutGetNumDevs\n"); + dprintf_info(mmsys, "waveOutGetNumDevs\n"); count += wodMessage( MMSYSTEM_FirstDevID(), WODM_GETNUMDEVS, 0L, 0L, 0L); - dprintf_mmsys(stddeb, "waveOutGetNumDevs return %u \n", count); + dprintf_info(mmsys, "waveOutGetNumDevs return %u \n", count); return count; } @@ -2568,7 +2568,7 @@ UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID, WAVEOUTCAPS16 * lpCaps, { if (uDeviceID > waveOutGetNumDevs16() - 1) return MMSYSERR_BADDEVICEID; if (uDeviceID == (UINT16)WAVE_MAPPER) return MMSYSERR_BADDEVICEID; /* FIXME: do we have a wave mapper ? */ - dprintf_mmsys(stddeb, "waveOutGetDevCaps\n"); + dprintf_info(mmsys, "waveOutGetDevCaps\n"); return wodMessage(uDeviceID, WODM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize); } @@ -2615,7 +2615,7 @@ UINT32 WINAPI waveOutGetDevCaps32W(UINT32 uDeviceID, LPWAVEOUTCAPS32W lpCaps, */ UINT16 WINAPI waveOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) { - dprintf_mmsys(stddeb, "waveOutGetErrorText\n"); + dprintf_info(mmsys, "waveOutGetErrorText\n"); return(waveGetErrorText(uError, lpText, uSize)); } @@ -2647,7 +2647,8 @@ UINT32 WINAPI waveOutGetErrorText32W(UINT32 uError, LPWSTR lpText, UINT32 uSize) static UINT16 waveGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize) { LPSTR msgptr; - dprintf_mmsys(stddeb, "waveGetErrorText(%04X, %p, %d);\n", uError, lpText, uSize); + dprintf_info(mmsys, "waveGetErrorText(%04X, %p, %d);\n", + uError, lpText, uSize); if ((lpText == NULL) || (uSize < 1)) return(FALSE); lpText[0] = '\0'; switch(uError) { @@ -2732,12 +2733,12 @@ UINT16 WINAPI waveOutOpen16(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID, DWORD dwRet = 0; BOOL32 bMapperFlg = FALSE; - dprintf_mmsys(stddeb, "waveOutOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n", + dprintf_info(mmsys, "waveOutOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n", lphWaveOut, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags); if (dwFlags & WAVE_FORMAT_QUERY) - dprintf_mmsys(stddeb, "waveOutOpen // WAVE_FORMAT_QUERY requested !\n"); + dprintf_info(mmsys, "waveOutOpen // WAVE_FORMAT_QUERY requested !\n"); if (uDeviceID == (UINT16)WAVE_MAPPER) { - dprintf_mmsys(stddeb, "waveOutOpen // WAVE_MAPPER mode requested !\n"); + dprintf_info(mmsys, "waveOutOpen // WAVE_MAPPER mode requested !\n"); bMapperFlg = TRUE; uDeviceID = 0; } @@ -2759,11 +2760,11 @@ UINT16 WINAPI waveOutOpen16(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID, if (dwRet == MMSYSERR_NOERROR) break; if (!bMapperFlg) break; uDeviceID++; - dprintf_mmsys(stddeb, "waveOutOpen // WAVE_MAPPER mode ! try next driver...\n"); + dprintf_info(mmsys, "waveOutOpen // WAVE_MAPPER mode ! try next driver...\n"); } lpDesc->uDeviceID = uDeviceID; /* save physical Device ID */ if (dwFlags & WAVE_FORMAT_QUERY) { - dprintf_mmsys(stddeb, "waveOutOpen // End of WAVE_FORMAT_QUERY !\n"); + dprintf_info(mmsys, "waveOutOpen // End of WAVE_FORMAT_QUERY !\n"); dwRet = waveOutClose32(hWaveOut); } return dwRet; @@ -2783,7 +2784,7 @@ UINT16 WINAPI waveOutClose16(HWAVEOUT16 hWaveOut) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutClose(%04X)\n", hWaveOut); + dprintf_info(mmsys, "waveOutClose(%04X)\n", hWaveOut); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return wodMessage( lpDesc->uDeviceID, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L); @@ -2797,7 +2798,7 @@ UINT32 WINAPI waveOutPrepareHeader32(HWAVEOUT32 hWaveOut, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutPrepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveOutPrepareHeader(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2814,7 +2815,7 @@ UINT16 WINAPI waveOutPrepareHeader16(HWAVEOUT16 hWaveOut, LPBYTE saveddata = lpWaveOutHdr->lpData; UINT16 ret; - dprintf_mmsys(stddeb, "waveOutPrepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveOutPrepareHeader(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2833,7 +2834,7 @@ UINT32 WINAPI waveOutUnprepareHeader32(HWAVEOUT32 hWaveOut, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutUnprepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveOutUnprepareHeader(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2850,7 +2851,7 @@ UINT16 WINAPI waveOutUnprepareHeader16(HWAVEOUT16 hWaveOut, LPBYTE saveddata = lpWaveOutHdr->lpData; UINT16 ret; - dprintf_mmsys(stddeb, "waveOutUnprepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveOutUnprepareHeader(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -2868,7 +2869,7 @@ UINT32 WINAPI waveOutWrite32(HWAVEOUT32 hWaveOut, WAVEHDR * lpWaveOutHdr, UINT32 uSize) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); + dprintf_info(mmsys, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; lpWaveOutHdr->reserved = (DWORD)lpWaveOutHdr->lpData; @@ -2883,7 +2884,7 @@ UINT16 WINAPI waveOutWrite16(HWAVEOUT16 hWaveOut, WAVEHDR * lpWaveOutHdr, LPWAVEOPENDESC lpDesc; UINT16 ret; - dprintf_mmsys(stddeb, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); + dprintf_info(mmsys, "waveOutWrite(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; lpWaveOutHdr->reserved=(DWORD)lpWaveOutHdr->lpData;/*save original ptr*/ @@ -2908,7 +2909,7 @@ UINT16 WINAPI waveOutPause16(HWAVEOUT16 hWaveOut) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutPause(%04X)\n", hWaveOut); + dprintf_info(mmsys, "waveOutPause(%04X)\n", hWaveOut); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return wodMessage( lpDesc->uDeviceID, WODM_PAUSE, lpDesc->dwInstance, 0L, 0L); @@ -2928,7 +2929,7 @@ UINT16 WINAPI waveOutRestart16(HWAVEOUT16 hWaveOut) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutRestart(%04X)\n", hWaveOut); + dprintf_info(mmsys, "waveOutRestart(%04X)\n", hWaveOut); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return wodMessage( lpDesc->uDeviceID, WODM_RESTART, lpDesc->dwInstance, 0L, 0L); @@ -2948,7 +2949,7 @@ UINT32 WINAPI waveOutReset32(HWAVEOUT32 hWaveOut) UINT16 WINAPI waveOutReset16(HWAVEOUT16 hWaveOut) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutReset(%04X)\n", hWaveOut); + dprintf_info(mmsys, "waveOutReset(%04X)\n", hWaveOut); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return wodMessage( lpDesc->uDeviceID, WODM_RESET, lpDesc->dwInstance, 0L, 0L); @@ -2972,7 +2973,7 @@ UINT16 WINAPI waveOutGetPosition16(HWAVEOUT16 hWaveOut,LPMMTIME16 lpTime, UINT16 uSize) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutGetPosition(%04X, %p, %u);\n", hWaveOut, lpTime, uSize); + dprintf_info(mmsys, "waveOutGetPosition(%04X, %p, %u);\n", hWaveOut, lpTime, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return wodMessage( lpDesc->uDeviceID, WODM_GETPOS, lpDesc->dwInstance, @@ -2987,7 +2988,7 @@ UINT16 WINAPI waveOutGetPosition16(HWAVEOUT16 hWaveOut,LPMMTIME16 lpTime, UINT16 WINAPI waveOut##xx##16(HWAVEOUT16 hWaveOut, atype x) \ { \ LPWAVEOPENDESC lpDesc; \ - dprintf_mmsys(stddeb, "waveOut"#xx"(%04X, %08lx);\n", hWaveOut,(DWORD)x);\ + dprintf_info(mmsys, "waveOut"#xx"(%04X, %08lx);\n", hWaveOut,(DWORD)x);\ lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); \ if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; \ return wodMessage(lpDesc->uDeviceID, WODM_##XX, lpDesc->dwInstance,\ @@ -3006,7 +3007,7 @@ WAVEOUT_SHORTCUT_1(SetPlaybackRate,SETPLAYBACKRATE,DWORD) } \ UINT16 WINAPI waveOut##xx##16(UINT16 devid, atype x) \ { \ - dprintf_mmsys(stddeb, "waveOut"#xx"(%04X, %08lx);\n", devid,(DWORD)x); \ + dprintf_info(mmsys, "waveOut"#xx"(%04X, %08lx);\n", devid,(DWORD)x); \ return wodMessage(devid, WODM_##XX, 0L, (DWORD)x, 0L); \ } @@ -3027,7 +3028,7 @@ UINT32 WINAPI waveOutBreakLoop32(HWAVEOUT32 hWaveOut) */ UINT16 WINAPI waveOutBreakLoop16(HWAVEOUT16 hWaveOut) { - dprintf_mmsys(stddeb, "waveOutBreakLoop(%04X)\n", hWaveOut); + dprintf_info(mmsys, "waveOutBreakLoop(%04X)\n", hWaveOut); return MMSYSERR_INVALHANDLE; } @@ -3037,7 +3038,7 @@ UINT16 WINAPI waveOutBreakLoop16(HWAVEOUT16 hWaveOut) UINT32 WINAPI waveOutGetID32(HWAVEOUT32 hWaveOut, UINT32 * lpuDeviceID) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutGetID(%04X, %p);\n", hWaveOut, lpuDeviceID); + dprintf_info(mmsys, "waveOutGetID(%04X, %p);\n", hWaveOut, lpuDeviceID); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; @@ -3050,7 +3051,7 @@ UINT32 WINAPI waveOutGetID32(HWAVEOUT32 hWaveOut, UINT32 * lpuDeviceID) UINT16 WINAPI waveOutGetID16(HWAVEOUT16 hWaveOut, UINT16 * lpuDeviceID) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveOutGetID(%04X, %p);\n", hWaveOut, lpuDeviceID); + dprintf_info(mmsys, "waveOutGetID(%04X, %p);\n", hWaveOut, lpuDeviceID); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; @@ -3164,9 +3165,9 @@ UINT32 WINAPI waveInGetNumDevs32() UINT16 WINAPI waveInGetNumDevs16() { UINT16 count = 0; - dprintf_mmsys(stddeb, "waveInGetNumDevs\n"); + dprintf_info(mmsys, "waveInGetNumDevs\n"); count += widMessage(0, WIDM_GETNUMDEVS, 0L, 0L, 0L); - dprintf_mmsys(stddeb, "waveInGetNumDevs return %u \n", count); + dprintf_info(mmsys, "waveInGetNumDevs return %u \n", count); return count; } @@ -3208,7 +3209,7 @@ UINT32 WINAPI waveInGetDevCaps32A(UINT32 uDeviceID, LPWAVEINCAPS32A lpCaps, UINT */ UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, UINT16 uSize) { - dprintf_mmsys(stddeb, "waveInGetDevCaps\n"); + dprintf_info(mmsys, "waveInGetDevCaps\n"); return widMessage(uDeviceID, WIDM_GETDEVCAPS, 0L, (DWORD)lpCaps, uSize); } @@ -3217,7 +3218,7 @@ UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, UINT16 */ UINT32 WINAPI waveInGetErrorText32A(UINT32 uError, LPSTR lpText, UINT32 uSize) { - dprintf_mmsys(stddeb, "waveInGetErrorText\n"); + dprintf_info(mmsys, "waveInGetErrorText\n"); return(waveGetErrorText(uError, lpText, uSize)); } @@ -3239,7 +3240,7 @@ UINT32 WINAPI waveInGetErrorText32W(UINT32 uError, LPWSTR lpText, UINT32 uSize) */ UINT16 WINAPI waveInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) { - dprintf_mmsys(stddeb, "waveInGetErrorText\n"); + dprintf_info(mmsys, "waveInGetErrorText\n"); return(waveGetErrorText(uError, lpText, uSize)); } @@ -3268,12 +3269,12 @@ UINT16 WINAPI waveInOpen16(HWAVEIN16 * lphWaveIn, UINT16 uDeviceID, LPWAVEOPENDESC lpDesc; DWORD dwRet = 0; BOOL32 bMapperFlg = FALSE; - dprintf_mmsys(stddeb, "waveInOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n", + dprintf_info(mmsys, "waveInOpen(%p, %d, %p, %08lX, %08lX, %08lX);\n", lphWaveIn, uDeviceID, lpFormat, dwCallback, dwInstance, dwFlags); if (dwFlags & WAVE_FORMAT_QUERY) - dprintf_mmsys(stddeb, "waveInOpen // WAVE_FORMAT_QUERY requested !\n"); + dprintf_info(mmsys, "waveInOpen // WAVE_FORMAT_QUERY requested !\n"); if (uDeviceID == (UINT16)WAVE_MAPPER) { - dprintf_mmsys(stddeb, "waveInOpen // WAVE_MAPPER mode requested !\n"); + dprintf_info(mmsys, "waveInOpen // WAVE_MAPPER mode requested !\n"); bMapperFlg = TRUE; uDeviceID = 0; } @@ -3292,11 +3293,11 @@ UINT16 WINAPI waveInOpen16(HWAVEIN16 * lphWaveIn, UINT16 uDeviceID, if (dwRet == MMSYSERR_NOERROR) break; if (!bMapperFlg) break; uDeviceID++; - dprintf_mmsys(stddeb, "waveInOpen // WAVE_MAPPER mode ! try next driver...\n"); + dprintf_info(mmsys, "waveInOpen // WAVE_MAPPER mode ! try next driver...\n"); } lpDesc->uDeviceID = uDeviceID; if (dwFlags & WAVE_FORMAT_QUERY) { - dprintf_mmsys(stddeb, "waveInOpen // End of WAVE_FORMAT_QUERY !\n"); + dprintf_info(mmsys, "waveInOpen // End of WAVE_FORMAT_QUERY !\n"); dwRet = waveInClose16(hWaveIn); } return dwRet; @@ -3316,7 +3317,7 @@ UINT16 WINAPI waveInClose16(HWAVEIN16 hWaveIn) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInClose(%04X)\n", hWaveIn); + dprintf_info(mmsys, "waveInClose(%04X)\n", hWaveIn); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return widMessage(lpDesc->uDeviceID, WIDM_CLOSE, lpDesc->dwInstance, 0L, 0L); @@ -3330,7 +3331,7 @@ UINT32 WINAPI waveInPrepareHeader32(HWAVEIN32 hWaveIn, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInPrepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveInPrepareHeader(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -3338,7 +3339,7 @@ UINT32 WINAPI waveInPrepareHeader32(HWAVEIN32 hWaveIn, lpWaveInHdr = lpWaveInHdr; lpWaveInHdr->lpNext = NULL; lpWaveInHdr->dwBytesRecorded = 0; - dprintf_mmsys(stddeb, "waveInPrepareHeader // lpData=%p size=%lu \n", + dprintf_info(mmsys, "waveInPrepareHeader // lpData=%p size=%lu \n", lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength); return widMessage(lpDesc->uDeviceID,WIDM_PREPARE,lpDesc->dwInstance, (DWORD)lpWaveInHdr, uSize); @@ -3353,7 +3354,7 @@ UINT16 WINAPI waveInPrepareHeader16(HWAVEIN16 hWaveIn, LPBYTE saveddata = lpWaveInHdr->lpData; UINT16 ret; - dprintf_mmsys(stddeb, "waveInPrepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveInPrepareHeader(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -3362,7 +3363,7 @@ UINT16 WINAPI waveInPrepareHeader16(HWAVEIN16 hWaveIn, lpWaveInHdr->lpNext = NULL; lpWaveInHdr->dwBytesRecorded = 0; - dprintf_mmsys(stddeb, "waveInPrepareHeader // lpData=%p size=%lu \n", + dprintf_info(mmsys, "waveInPrepareHeader // lpData=%p size=%lu \n", lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength); lpWaveInHdr->lpData = PTR_SEG_TO_LIN(lpWaveInHdr->lpData); ret = widMessage(lpDesc->uDeviceID,WIDM_PREPARE,lpDesc->dwInstance, @@ -3380,7 +3381,7 @@ UINT32 WINAPI waveInUnprepareHeader32(HWAVEIN32 hWaveIn, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInUnprepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveInUnprepareHeader(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -3399,7 +3400,7 @@ UINT16 WINAPI waveInUnprepareHeader16(HWAVEIN16 hWaveIn, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInUnprepareHeader(%04X, %p, %u);\n", + dprintf_info(mmsys, "waveInUnprepareHeader(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -3419,13 +3420,13 @@ UINT32 WINAPI waveInAddBuffer32(HWAVEIN32 hWaveIn, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); + dprintf_info(mmsys, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE; lpWaveInHdr->lpNext = NULL; lpWaveInHdr->dwBytesRecorded = 0; - dprintf_mmsys(stddeb, "waveInAddBuffer // lpData=%p size=%lu \n", + dprintf_info(mmsys, "waveInAddBuffer // lpData=%p size=%lu \n", lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength); return widMessage(lpDesc->uDeviceID, WIDM_ADDBUFFER, lpDesc->dwInstance, (DWORD)lpWaveInHdr, uSize); @@ -3441,14 +3442,14 @@ UINT16 WINAPI waveInAddBuffer16(HWAVEIN16 hWaveIn, LPWAVEOPENDESC lpDesc; UINT16 ret; - dprintf_mmsys(stddeb, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); + dprintf_info(mmsys, "waveInAddBuffer(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE; lpWaveInHdr->lpNext = NULL; lpWaveInHdr->dwBytesRecorded = 0; lpWaveInHdr->lpData = PTR_SEG_TO_LIN(lpWaveInHdr->lpData); - dprintf_mmsys(stddeb, "waveInAddBuffer // lpData=%p size=%lu \n", + dprintf_info(mmsys, "waveInAddBuffer // lpData=%p size=%lu \n", lpWaveInHdr->lpData, lpWaveInHdr->dwBufferLength); ret = widMessage(lpDesc->uDeviceID, WIDM_ADDBUFFER, lpDesc->dwInstance, (DWORD)lpWaveInHdr, uSize); @@ -3471,7 +3472,7 @@ UINT16 WINAPI waveInStart16(HWAVEIN16 hWaveIn) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInStart(%04X)\n", hWaveIn); + dprintf_info(mmsys, "waveInStart(%04X)\n", hWaveIn); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return widMessage(lpDesc->uDeviceID,WIDM_START,lpDesc->dwInstance,0,0); @@ -3492,7 +3493,7 @@ UINT16 WINAPI waveInStop16(HWAVEIN16 hWaveIn) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInStop(%04X)\n", hWaveIn); + dprintf_info(mmsys, "waveInStop(%04X)\n", hWaveIn); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return widMessage(lpDesc->uDeviceID, WIDM_STOP, lpDesc->dwInstance, 0L, 0L); @@ -3513,7 +3514,7 @@ UINT16 WINAPI waveInReset16(HWAVEIN16 hWaveIn) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInReset(%04X)\n", hWaveIn); + dprintf_info(mmsys, "waveInReset(%04X)\n", hWaveIn); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return widMessage(lpDesc->uDeviceID,WIDM_RESET,lpDesc->dwInstance,0,0); @@ -3540,7 +3541,7 @@ UINT16 WINAPI waveInGetPosition16(HWAVEIN16 hWaveIn,LPMMTIME16 lpTime, { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInGetPosition(%04X, %p, %u);\n", hWaveIn, lpTime, uSize); + dprintf_info(mmsys, "waveInGetPosition(%04X, %p, %u);\n", hWaveIn, lpTime, uSize); lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; return widMessage(lpDesc->uDeviceID, WIDM_GETPOS, lpDesc->dwInstance, @@ -3554,7 +3555,7 @@ UINT32 WINAPI waveInGetID32(HWAVEIN32 hWaveIn, UINT32 * lpuDeviceID) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInGetID\n"); + dprintf_info(mmsys, "waveInGetID\n"); if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -3570,7 +3571,7 @@ UINT16 WINAPI waveInGetID16(HWAVEIN16 hWaveIn, UINT16 * lpuDeviceID) { LPWAVEOPENDESC lpDesc; - dprintf_mmsys(stddeb, "waveInGetID\n"); + dprintf_info(mmsys, "waveInGetID\n"); if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveIn); if (lpDesc == NULL) return MMSYSERR_INVALHANDLE; @@ -3662,7 +3663,7 @@ DWORD WINAPI waveInMessage16(HWAVEIN16 hWaveIn, UINT16 uMessage, */ HDRVR16 WINAPI DrvOpen(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam) { - dprintf_mmsys(stddeb, "DrvOpen('%s', '%s', %08lX);\n", + dprintf_info(mmsys, "DrvOpen('%s', '%s', %08lX);\n", lpDriverName, lpSectionName, lParam); return OpenDriver(lpDriverName, lpSectionName, lParam); } @@ -3673,7 +3674,7 @@ HDRVR16 WINAPI DrvOpen(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam) */ LRESULT WINAPI DrvClose(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2) { - dprintf_mmsys(stddeb, "DrvClose(%04X, %08lX, %08lX);\n", hDrvr, lParam1, lParam2); + dprintf_info(mmsys, "DrvClose(%04X, %08lX, %08lX);\n", hDrvr, lParam1, lParam2); return CloseDriver(hDrvr, lParam1, lParam2); } @@ -3685,7 +3686,7 @@ LRESULT WINAPI DrvSendMessage(HDRVR16 hDriver, WORD msg, LPARAM lParam1, LPARAM lParam2) { DWORD dwDriverID = 0; - dprintf_mmsys(stddeb, "DrvSendMessage(%04X, %04X, %08lX, %08lX);\n", + dprintf_info(mmsys, "DrvSendMessage(%04X, %04X, %08lX, %08lX);\n", hDriver, msg, lParam1, lParam2); return CDAUDIO_DriverProc(dwDriverID, hDriver, msg, lParam1, lParam2); } @@ -3695,7 +3696,7 @@ LRESULT WINAPI DrvSendMessage(HDRVR16 hDriver, WORD msg, LPARAM lParam1, */ HANDLE16 WINAPI DrvGetModuleHandle(HDRVR16 hDrvr) { - dprintf_mmsys(stddeb, "DrvGetModuleHandle(%04X);\n", hDrvr); + dprintf_info(mmsys, "DrvGetModuleHandle(%04X);\n", hDrvr); return 0; } diff --git a/multimedia/time.c b/multimedia/time.c index 5a6d267aeae..0e60234297c 100644 --- a/multimedia/time.c +++ b/multimedia/time.c @@ -15,7 +15,6 @@ #include "user.h" #include "driver.h" #include "mmsystem.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -61,10 +60,10 @@ static VOID check_MMtimers() lpTimer->wCurTime = lpTimer->wDelay; if (lpTimer->lpFunc != (FARPROC16) NULL) { - dprintf_mmtime(stddeb, "MMSysTimeCallback // before CallBack16 !\n"); - dprintf_mmtime(stddeb, "MMSysTimeCallback // lpFunc=%p wTimerID=%04X dwUser=%08lX !\n", + dprintf_info(mmtime, "MMSysTimeCallback // before CallBack16 !\n"); + dprintf_info(mmtime, "MMSysTimeCallback // lpFunc=%p wTimerID=%04X dwUser=%08lX !\n", lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser); - dprintf_mmtime(stddeb, "MMSysTimeCallback // hInstance=%04X !\n", lpTimer->hInstance); + dprintf_info(mmtime, "MMSysTimeCallback // hInstance=%04X !\n", lpTimer->hInstance); /* - TimeProc callback that is called here is something strange, under Windows 3.1x it is called @@ -80,7 +79,7 @@ static VOID check_MMtimers() lpTimer->dwUser,0,0 ); - dprintf_mmtime(stddeb, "MMSysTimeCallback // after CallBack16 !\n"); + dprintf_info(mmtime, "MMSysTimeCallback // after CallBack16 !\n"); } if (lpTimer->wFlags & TIME_ONESHOT) timeKillEvent32(lpTimer->wTimerID); @@ -104,16 +103,16 @@ static VOID TIME_MMSysTimeCallback( HWND32 hwnd, UINT32 msg, lpTimer->wCurTime = lpTimer->wDelay; if (lpTimer->lpFunc != (FARPROC16) NULL) { - dprintf_mmtime(stddeb, "MMSysTimeCallback // before CallBack16 !\n"); - dprintf_mmtime(stddeb, "MMSysTimeCallback // lpFunc=%p wTimerID=%04X dwUser=%08lX !\n", + dprintf_info(mmtime, "MMSysTimeCallback // before CallBack16 !\n"); + dprintf_info(mmtime, "MMSysTimeCallback // lpFunc=%p wTimerID=%04X dwUser=%08lX !\n", lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser); - dprintf_mmtime(stddeb, "MMSysTimeCallback // hInstance=%04X !\n", lpTimer->hInstance); + dprintf_info(mmtime, "MMSysTimeCallback // hInstance=%04X !\n", lpTimer->hInstance); /* This is wrong (lpFunc is NULL all the time) lpFunc = MODULE_GetEntryPoint( lpTimer->hInstance, MODULE_GetOrdinal(lpTimer->hInstance,"TimerCallBack" )); - dprintf_mmtime(stddeb, "MMSysTimeCallback // lpFunc=%08lx !\n", lpFunc); + dprintf_info(mmtime, "MMSysTimeCallback // lpFunc=%08lx !\n", lpFunc); */ @@ -130,7 +129,7 @@ static VOID TIME_MMSysTimeCallback( HWND32 hwnd, UINT32 msg, lpTimer->dwUser,0,0 ); - dprintf_mmtime(stddeb, "MMSysTimeCallback // after CallBack16 !\n"); + dprintf_info(mmtime, "MMSysTimeCallback // after CallBack16 !\n"); fflush(stdout); } if (lpTimer->wFlags & TIME_ONESHOT) @@ -165,7 +164,7 @@ static void StartMMTime() */ MMRESULT32 WINAPI timeGetSystemTime32(LPMMTIME32 lpTime, UINT32 wSize) { - dprintf_mmsys(stddeb, "timeGetSystemTime32(%p, %u);\n", lpTime, wSize); + dprintf_info(mmsys, "timeGetSystemTime32(%p, %u);\n", lpTime, wSize); if (!mmTimeStarted) StartMMTime(); lpTime->wType = TIME_MS; @@ -178,7 +177,7 @@ MMRESULT32 WINAPI timeGetSystemTime32(LPMMTIME32 lpTime, UINT32 wSize) */ MMRESULT16 WINAPI timeGetSystemTime16(LPMMTIME16 lpTime, UINT16 wSize) { - dprintf_mmsys(stddeb, "timeGetSystemTime16(%p, %u);\n", lpTime, wSize); + dprintf_info(mmsys, "timeGetSystemTime16(%p, %u);\n", lpTime, wSize); if (!mmTimeStarted) StartMMTime(); lpTime->wType = TIME_MS; @@ -197,7 +196,7 @@ MMRESULT32 WINAPI timeSetEvent32(UINT32 wDelay,UINT32 wResol, LPTIMERENTRY lpNewTimer; LPTIMERENTRY lpTimer = lpTimerList; - dprintf_mmtime(stddeb, "timeSetEvent32(%u, %u, %p, %08lX, %04X);\n", + dprintf_info(mmtime, "timeSetEvent32(%u, %u, %p, %08lX, %04X);\n", wDelay, wResol, lpFunc, dwUser, wFlags); if (!mmTimeStarted) StartMMTime(); @@ -219,8 +218,8 @@ MMRESULT32 WINAPI timeSetEvent32(UINT32 wDelay,UINT32 wResol, lpNewTimer->lpFunc = (FARPROC16) lpFunc; lpNewTimer->iswin32 = 1; lpNewTimer->hInstance = GetTaskDS(); - dprintf_mmtime(stddeb, "timeSetEvent // hInstance=%04X !\n", lpNewTimer->hInstance); - dprintf_mmtime(stddeb, "timeSetEvent // lpFunc=%p !\n", + dprintf_info(mmtime, "timeSetEvent // hInstance=%04X !\n", lpNewTimer->hInstance); + dprintf_info(mmtime, "timeSetEvent // lpFunc=%p !\n", lpFunc); lpNewTimer->dwUser = dwUser; lpNewTimer->wFlags = wFlags; @@ -237,7 +236,7 @@ MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, WORD wNewID = 0; LPTIMERENTRY lpNewTimer; LPTIMERENTRY lpTimer = lpTimerList; - dprintf_mmtime(stddeb, "timeSetEvent(%u, %u, %p, %08lX, %04X);\n", + dprintf_info(mmtime, "timeSetEvent(%u, %u, %p, %08lX, %04X);\n", wDelay, wResol, lpFunc, dwUser, wFlags); if (!mmTimeStarted) StartMMTime(); @@ -259,8 +258,8 @@ MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, lpNewTimer->lpFunc = (FARPROC16) lpFunc; lpNewTimer->iswin32 = 0; lpNewTimer->hInstance = GetTaskDS(); - dprintf_mmtime(stddeb, "timeSetEvent // hInstance=%04X !\n", lpNewTimer->hInstance); - dprintf_mmtime(stddeb, "timeSetEvent // PTR_SEG_TO_LIN(lpFunc)=%p !\n", + dprintf_info(mmtime, "timeSetEvent // hInstance=%04X !\n", lpNewTimer->hInstance); + dprintf_info(mmtime, "timeSetEvent // PTR_SEG_TO_LIN(lpFunc)=%p !\n", PTR_SEG_TO_LIN(lpFunc)); lpNewTimer->dwUser = dwUser; lpNewTimer->wFlags = wFlags; @@ -298,7 +297,7 @@ MMRESULT16 WINAPI timeKillEvent16(UINT16 wID) */ MMRESULT32 WINAPI timeGetDevCaps32(LPTIMECAPS32 lpCaps,UINT32 wSize) { - dprintf_mmtime(stddeb, "timeGetDevCaps(%p, %u) !\n", lpCaps, wSize); + dprintf_info(mmtime, "timeGetDevCaps(%p, %u) !\n", lpCaps, wSize); if (!mmTimeStarted) StartMMTime(); lpCaps->wPeriodMin = MMSYSTIME_MININTERVAL; @@ -311,7 +310,7 @@ MMRESULT32 WINAPI timeGetDevCaps32(LPTIMECAPS32 lpCaps,UINT32 wSize) */ MMRESULT16 WINAPI timeGetDevCaps16(LPTIMECAPS16 lpCaps, UINT16 wSize) { - dprintf_mmtime(stddeb, "timeGetDevCaps(%p, %u) !\n", lpCaps, wSize); + dprintf_info(mmtime, "timeGetDevCaps(%p, %u) !\n", lpCaps, wSize); if (!mmTimeStarted) StartMMTime(); lpCaps->wPeriodMin = MMSYSTIME_MININTERVAL; @@ -324,7 +323,7 @@ MMRESULT16 WINAPI timeGetDevCaps16(LPTIMECAPS16 lpCaps, UINT16 wSize) */ MMRESULT32 WINAPI timeBeginPeriod32(UINT32 wPeriod) { - dprintf_mmtime(stddeb, "timeBeginPeriod32(%u) !\n", wPeriod); + dprintf_info(mmtime, "timeBeginPeriod32(%u) !\n", wPeriod); if (!mmTimeStarted) StartMMTime(); if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) @@ -336,7 +335,7 @@ MMRESULT32 WINAPI timeBeginPeriod32(UINT32 wPeriod) */ MMRESULT16 WINAPI timeBeginPeriod16(UINT16 wPeriod) { - dprintf_mmtime(stddeb, "timeBeginPeriod(%u) !\n", wPeriod); + dprintf_info(mmtime, "timeBeginPeriod(%u) !\n", wPeriod); if (!mmTimeStarted) StartMMTime(); if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) @@ -349,7 +348,7 @@ MMRESULT16 WINAPI timeBeginPeriod16(UINT16 wPeriod) */ MMRESULT32 WINAPI timeEndPeriod32(UINT32 wPeriod) { - dprintf_mmtime(stddeb, "timeEndPeriod(%u) !\n", wPeriod); + dprintf_info(mmtime, "timeEndPeriod(%u) !\n", wPeriod); if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) return TIMERR_NOCANDO; return 0; @@ -360,7 +359,7 @@ MMRESULT32 WINAPI timeEndPeriod32(UINT32 wPeriod) */ MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod) { - dprintf_mmtime(stddeb, "timeEndPeriod(%u) !\n", wPeriod); + dprintf_info(mmtime, "timeEndPeriod(%u) !\n", wPeriod); if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) return TIMERR_NOCANDO; return 0; @@ -374,7 +373,7 @@ DWORD WINAPI timeGetTime() static DWORD lasttick=0; DWORD newtick; - dprintf_mmtime(stddeb, "timeGetTime(); !\n"); + dprintf_info(mmtime, "timeGetTime(); !\n"); if (!mmTimeStarted) StartMMTime(); newtick = GetTickCount(); @@ -382,7 +381,7 @@ DWORD WINAPI timeGetTime() if (newtick!=lasttick) check_MMtimers(); lasttick = newtick; - dprintf_mmtime(stddeb, "timeGetTime() // Time = %ld\n",mmSysTimeMS.u.ms); + dprintf_info(mmtime, "timeGetTime() // Time = %ld\n",mmSysTimeMS.u.ms); return mmSysTimeMS.u.ms; diff --git a/objects/bitmap.c b/objects/bitmap.c index 7d8a36d923b..df9bd2adf9c 100644 --- a/objects/bitmap.c +++ b/objects/bitmap.c @@ -14,7 +14,6 @@ #include "dc.h" #include "bitmap.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" #ifdef PRELIMINARY_WING16_SUPPORT @@ -143,7 +142,7 @@ HBITMAP32 WINAPI CreateBitmap32( INT32 width, INT32 height, UINT32 planes, planes = (BYTE)planes; bpp = (BYTE)bpp; - dprintf_gdi( stddeb, "CreateBitmap: %dx%d, %d colors\n", + dprintf_info(gdi, "CreateBitmap: %dx%d, %d colors\n", width, height, 1 << (planes*bpp) ); /* Check parameters */ @@ -199,11 +198,11 @@ HBITMAP32 WINAPI CreateCompatibleBitmap32(HDC32 hdc, INT32 width, INT32 height) HBITMAP32 hbmpRet = 0; DC *dc; - dprintf_gdi( stddeb, "CreateCompatibleBitmap(%04x,%d,%d) = \n", + dprintf_info(gdi, "CreateCompatibleBitmap(%04x,%d,%d) = \n", hdc, width, height ); if (!(dc = DC_GetDCPtr( hdc ))) return 0; hbmpRet = CreateBitmap32( width, height, 1, dc->w.bitsPerPixel, NULL ); - dprintf_gdi(stddeb,"\t\t%04x\n", hbmpRet); + dprintf_info(gdi,"\t\t%04x\n", hbmpRet); return hbmpRet; } @@ -272,7 +271,7 @@ LONG WINAPI GetBitmapBits32( HBITMAP32 hbitmap, LONG count, LPVOID buffer ) height = count / bmp->bitmap.bmWidthBytes; if (height > bmp->bitmap.bmHeight) height = bmp->bitmap.bmHeight; - dprintf_bitmap(stddeb, "GetBitmapBits: %dx%d %d colors %p fetched height: %ld\n", + dprintf_info(bitmap, "GetBitmapBits: %dx%d %d colors %p fetched height: %ld\n", bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, 1 << bmp->bitmap.bmBitsPixel, buffer, height ); @@ -395,7 +394,7 @@ LONG WINAPI SetBitmapBits32( HBITMAP32 hbitmap, LONG count, LPCVOID buffer ) bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); if (!bmp) return 0; - dprintf_bitmap(stddeb, "SetBitmapBits: %dx%d %d colors %p\n", + dprintf_info(bitmap, "SetBitmapBits: %dx%d %d colors %p\n", bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, 1 << bmp->bitmap.bmBitsPixel, buffer ); @@ -506,11 +505,11 @@ HANDLE16 WINAPI LoadImage16( HINSTANCE16 hinst, LPCSTR name, UINT16 type, } switch (type) { case IMAGE_BITMAP: - return LoadBitmap16(hinst,name); + return LoadBitmap16(hinst,(SEGPTR)name); case IMAGE_ICON: - return LoadIcon16(hinst,name); + return LoadIcon16(hinst,(SEGPTR)name); case IMAGE_CURSOR: - return LoadCursor16(hinst,name); + return LoadCursor16(hinst,(SEGPTR)name); } return 0; @@ -525,11 +524,11 @@ HANDLE32 WINAPI LoadImage32A( HINSTANCE32 hinst, LPCSTR name, UINT32 type, INT32 desiredx, INT32 desiredy, UINT32 loadflags) { if (HIWORD(name)) { - dprintf_resource(stddeb,"LoadImage32A(0x%04x,%s,%d,%d,%d,0x%08x)\n", + dprintf_info(resource,"LoadImage32A(0x%04x,%s,%d,%d,%d,0x%08x)\n", hinst,name,type,desiredx,desiredy,loadflags ); } else { - dprintf_resource(stddeb,"LoadImage32A(0x%04x,%p,%d,%d,%d,0x%08x)\n", + dprintf_info(resource,"LoadImage32A(0x%04x,%p,%d,%d,%d,0x%08x)\n", hinst,name,type,desiredx,desiredy,loadflags ); } @@ -548,11 +547,11 @@ HANDLE32 WINAPI LoadImage32W( HINSTANCE32 hinst, LPCWSTR name, UINT32 type, INT32 desiredx, INT32 desiredy, UINT32 loadflags) { if (HIWORD(name)) { - dprintf_resource(stddeb,"LoadImage32W(0x%04x,%p,%d,%d,%d,0x%08x)\n", + dprintf_info(resource,"LoadImage32W(0x%04x,%p,%d,%d,%d,0x%08x)\n", hinst,name,type,desiredx,desiredy,loadflags ); } else { - dprintf_resource(stddeb,"LoadImage32W(0x%04x,%p,%d,%d,%d,0x%08x)\n", + dprintf_info(resource,"LoadImage32W(0x%04x,%p,%d,%d,%d,0x%08x)\n", hinst,name,type,desiredx,desiredy,loadflags ); } @@ -620,11 +619,11 @@ HBITMAP16 WINAPI LoadBitmap16( HINSTANCE16 instance, SEGPTR name ) if (HIWORD(name)) { char *str = (char *)PTR_SEG_TO_LIN( name ); - dprintf_bitmap( stddeb, "LoadBitmap16(%04x,'%s')\n", instance, str ); + dprintf_info(bitmap, "LoadBitmap16(%04x,'%s')\n", instance, str ); if (str[0] == '#') name = (SEGPTR)(DWORD)(WORD)atoi( str + 1 ); } else - dprintf_bitmap( stddeb, "LoadBitmap16(%04x,%04x)\n", + dprintf_info(bitmap, "LoadBitmap16(%04x,%04x)\n", instance, LOWORD(name) ); if (!instance) /* OEM bitmap */ diff --git a/objects/brush.c b/objects/brush.c index 88a232b4715..af68d4c0d21 100644 --- a/objects/brush.c +++ b/objects/brush.c @@ -9,7 +9,6 @@ #include "bitmap.h" #include "metafile.h" #include "color.h" -#include "stddebug.h" #include "debug.h" @@ -53,7 +52,7 @@ HBRUSH32 WINAPI CreateBrushIndirect32( const LOGBRUSH32 * brush ) HBRUSH16 WINAPI CreateHatchBrush16( INT16 style, COLORREF color ) { LOGBRUSH32 logbrush = { BS_HATCHED, color, style }; - dprintf_gdi(stddeb, "CreateHatchBrush16: %d %06lx\n", style, color ); + dprintf_info(gdi, "CreateHatchBrush16: %d %06lx\n", style, color ); if ((style < 0) || (style >= NB_HATCH_STYLES)) return 0; return CreateBrushIndirect32( &logbrush ); } @@ -65,7 +64,7 @@ HBRUSH16 WINAPI CreateHatchBrush16( INT16 style, COLORREF color ) HBRUSH32 WINAPI CreateHatchBrush32( INT32 style, COLORREF color ) { LOGBRUSH32 logbrush = { BS_HATCHED, color, style }; - dprintf_gdi(stddeb, "CreateHatchBrush32: %d %06lx\n", style, color ); + dprintf_info(gdi, "CreateHatchBrush32: %d %06lx\n", style, color ); if ((style < 0) || (style >= NB_HATCH_STYLES)) return 0; return CreateBrushIndirect32( &logbrush ); } @@ -88,7 +87,7 @@ HBRUSH32 WINAPI CreatePatternBrush32( HBITMAP32 hbitmap ) LOGBRUSH32 logbrush = { BS_PATTERN, 0, 0 }; BITMAPOBJ *bmp, *newbmp; - dprintf_gdi(stddeb, "CreatePatternBrush: %04x\n", hbitmap ); + dprintf_info(gdi, "CreatePatternBrush: %04x\n", hbitmap ); /* Make a copy of the bitmap */ @@ -119,7 +118,7 @@ HBRUSH16 WINAPI CreateDIBPatternBrush16( HGLOBAL16 hbitmap, UINT16 coloruse ) BITMAPINFO *info, *newInfo; INT32 size; - dprintf_gdi(stddeb, "CreateDIBPatternBrush: %04x\n", hbitmap ); + dprintf_info(gdi, "CreateDIBPatternBrush: %04x\n", hbitmap ); /* Make a copy of the bitmap */ @@ -154,7 +153,7 @@ HBRUSH32 WINAPI CreateDIBPatternBrush32( HGLOBAL32 hbitmap, UINT32 coloruse ) BITMAPINFO *info, *newInfo; INT32 size; - dprintf_gdi(stddeb, "CreateDIBPatternBrush: %04x\n", hbitmap ); + dprintf_info(gdi, "CreateDIBPatternBrush: %04x\n", hbitmap ); /* Make a copy of the bitmap */ @@ -186,7 +185,7 @@ HBRUSH32 WINAPI CreateDIBPatternBrush32( HGLOBAL32 hbitmap, UINT32 coloruse ) HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color ) { LOGBRUSH32 logbrush = { BS_SOLID, color, 0 }; - dprintf_gdi(stddeb, "CreateSolidBrush16: %06lx\n", color ); + dprintf_info(gdi, "CreateSolidBrush16: %06lx\n", color ); return CreateBrushIndirect32( &logbrush ); } @@ -197,7 +196,7 @@ HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color ) HBRUSH32 WINAPI CreateSolidBrush32( COLORREF color ) { LOGBRUSH32 logbrush = { BS_SOLID, color, 0 }; - dprintf_gdi(stddeb, "CreateSolidBrush32: %06lx\n", color ); + dprintf_info(gdi, "CreateSolidBrush32: %06lx\n", color ); return CreateBrushIndirect32( &logbrush ); } diff --git a/objects/clipping.c b/objects/clipping.c index 7f9acb2e91d..c4357119ec8 100644 --- a/objects/clipping.c +++ b/objects/clipping.c @@ -8,7 +8,6 @@ #include "dc.h" #include "metafile.h" #include "region.h" -#include "stddebug.h" #include "debug.h" #define UPDATE_DIRTY_DC(dc) \ @@ -66,7 +65,7 @@ INT32 WINAPI SelectClipRgn32( HDC32 hdc, HRGN32 hrgn ) DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return ERROR; - dprintf_clipping(stddeb, "SelectClipRgn: %04x %04x\n", hdc, hrgn ); + dprintf_info(clipping, "SelectClipRgn: %04x %04x\n", hdc, hrgn ); if (hrgn) { @@ -95,7 +94,7 @@ INT16 WINAPI SelectVisRgn( HDC16 hdc, HRGN16 hrgn ) DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc || !hrgn) return ERROR; - dprintf_clipping(stddeb, "SelectVisRgn: %04x %04x\n", hdc, hrgn ); + dprintf_info(clipping, "SelectVisRgn: %04x %04x\n", hdc, hrgn ); dc->w.flags &= ~DC_DIRTY; @@ -130,7 +129,7 @@ INT32 WINAPI OffsetClipRgn32( HDC32 hdc, INT32 x, INT32 y ) return NULLREGION; /* ?? */ } - dprintf_clipping(stddeb, "OffsetClipRgn: %04x %d,%d\n", hdc, x, y ); + dprintf_info(clipping, "OffsetClipRgn: %04x %d,%d\n", hdc, x, y ); if (dc->w.hClipRgn) { @@ -152,7 +151,7 @@ INT16 WINAPI OffsetVisRgn( HDC16 hdc, INT16 x, INT16 y ) INT16 retval; DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return ERROR; - dprintf_clipping(stddeb, "OffsetVisRgn: %04x %d,%d\n", hdc, x, y ); + dprintf_info(clipping, "OffsetVisRgn: %04x %d,%d\n", hdc, x, y ); retval = OffsetRgn32( dc->w.hVisRgn, x, y ); CLIPPING_UpdateGCRegion( dc ); GDI_HEAP_UNLOCK( hdc ); @@ -229,7 +228,7 @@ INT32 WINAPI ExcludeClipRect32( HDC32 hdc, INT32 left, INT32 top, top = YLPTODP( dc, top ); bottom = YLPTODP( dc, bottom ); - dprintf_clipping(stddeb, "ExcludeClipRect: %04x %dx%d,%dx%d\n", + dprintf_info(clipping, "ExcludeClipRect: %04x %dx%d,%dx%d\n", hdc, left, top, right, bottom ); ret = CLIPPING_IntersectClipRect( dc, left, top, right, bottom, CLIP_EXCLUDE ); GDI_HEAP_UNLOCK( hdc ); @@ -269,7 +268,7 @@ INT32 WINAPI IntersectClipRect32( HDC32 hdc, INT32 left, INT32 top, top = YLPTODP( dc, top ); bottom = YLPTODP( dc, bottom ); - dprintf_clipping(stddeb, "IntersectClipRect: %04x %dx%d,%dx%d\n", + dprintf_info(clipping, "IntersectClipRect: %04x %dx%d,%dx%d\n", hdc, left, top, right, bottom ); ret = CLIPPING_IntersectClipRect( dc, left, top, right, bottom, CLIP_INTERSECT ); GDI_HEAP_UNLOCK( hdc ); @@ -327,7 +326,7 @@ INT16 WINAPI ExcludeVisRect( HDC16 hdc, INT16 left, INT16 top, { DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return ERROR; - dprintf_clipping(stddeb, "ExcludeVisRect: %04x %dx%d,%dx%d\n", + dprintf_info(clipping, "ExcludeVisRect: %04x %dx%d,%dx%d\n", hdc, left, top, right, bottom ); return CLIPPING_IntersectVisRect( dc, left, top, right, bottom, TRUE ); @@ -342,7 +341,7 @@ INT16 WINAPI IntersectVisRect( HDC16 hdc, INT16 left, INT16 top, { DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return ERROR; - dprintf_clipping(stddeb, "IntersectVisRect: %04x %dx%d,%dx%d\n", + dprintf_info(clipping, "IntersectVisRect: %04x %dx%d,%dx%d\n", hdc, left, top, right, bottom ); return CLIPPING_IntersectVisRect( dc, left, top, right, bottom, FALSE ); @@ -366,7 +365,7 @@ BOOL32 WINAPI PtVisible32( HDC32 hdc, INT32 x, INT32 y ) DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return ERROR; - dprintf_clipping(stddeb, "PtVisible: %04x %d,%d\n", hdc, x, y ); + dprintf_info(clipping, "PtVisible: %04x %d,%d\n", hdc, x, y ); if (!dc->w.hGCClipRgn) return FALSE; if( dc->w.flags & DC_DIRTY ) UPDATE_DIRTY_DC(dc); @@ -384,7 +383,7 @@ BOOL16 WINAPI RectVisible16( HDC16 hdc, LPRECT16 rect ) RECT16 tmpRect; DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return FALSE; - dprintf_clipping(stddeb,"RectVisible: %04x %d,%dx%d,%d\n", + dprintf_info(clipping,"RectVisible: %04x %d,%dx%d,%d\n", hdc, rect->left, rect->top, rect->right, rect->bottom ); if (!dc->w.hGCClipRgn) return FALSE; /* copy rectangle to avoid overwriting by LPtoDP */ @@ -461,7 +460,7 @@ HRGN16 WINAPI SaveVisRgn( HDC16 hdc ) RGNOBJ *obj, *copyObj; DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return 0; - dprintf_clipping(stddeb, "SaveVisRgn: %04x\n", hdc ); + dprintf_info(clipping, "SaveVisRgn: %04x\n", hdc ); if (!dc->w.hVisRgn) { fprintf( stderr, "SaveVisRgn: hVisRgn is zero. Please report this.\n" ); @@ -513,7 +512,7 @@ INT16 WINAPI RestoreVisRgn( HDC16 hdc ) GDI_HEAP_UNLOCK( hdc ); return ERROR; } - dprintf_clipping(stddeb, "RestoreVisRgn: %04x\n", hdc ); + dprintf_info(clipping, "RestoreVisRgn: %04x\n", hdc ); if (!(obj = (RGNOBJ *) GDI_GetObjPtr( dc->w.hVisRgn, REGION_MAGIC ))) { GDI_HEAP_UNLOCK( hdc ); diff --git a/objects/color.c b/objects/color.c index 5476a755b8c..6399d39c3b4 100644 --- a/objects/color.c +++ b/objects/color.c @@ -13,7 +13,6 @@ #include "options.h" #include "gdi.h" #include "color.h" -#include "stddebug.h" #include "debug.h" #include "xmalloc.h" @@ -289,7 +288,7 @@ static BOOL32 COLOR_BuildPrivateMap(CSPACE* cs) COLOR_sysPal = (PALETTEENTRY*)xmalloc(sizeof(PALETTEENTRY)*cs->size); - dprintf_palette(stddeb,"\tbuilding private map - %i palette entries\n", cs->size); + dprintf_info(palette,"\tbuilding private map - %i palette entries\n", cs->size); /* Allocate system palette colors */ @@ -346,9 +345,9 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) COLOR_max = PROFILE_GetWineIniInt( "options", "AllocSystemColors", 256); if (COLOR_max > 256) COLOR_max = 256; else if (COLOR_max < 20) COLOR_max = 20; - dprintf_palette(stddeb,"COLOR_Init: %d colors configured.\n", COLOR_max); + dprintf_info(palette,"COLOR_Init: %d colors configured.\n", COLOR_max); - dprintf_palette(stddeb,"\tbuilding shared map - %i palette entries\n", cs->size); + dprintf_info(palette,"\tbuilding shared map - %i palette entries\n", cs->size); /* Be nice and allocate system colors as read-only */ @@ -365,7 +364,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) if( !warn++ ) { - dprintf_palette(stddeb, "Not enough colors for the full system palette.\n"); + dprintf_warn(palette, "Not enough colors for the full system palette.\n"); bp = BlackPixel(display, DefaultScreen(display)); wp = WhitePixel(display, DefaultScreen(display)); @@ -403,7 +402,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) sysPixel[i] = color.pixel; - dprintf_palette(stddeb,"\tsyscolor(%lx) -> pixel %i\n", + dprintf_info(palette,"\tsyscolor(%lx) -> pixel %i\n", *(COLORREF*)(__sysPalTemplate+i), (int)color.pixel); /* Set EGA mapping if color in the first or last eight */ @@ -420,7 +419,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) { int c_min = 0, c_max = cs->size, c_val; - dprintf_palette(stddeb,"\tdynamic colormap... "); + dprintf_info(palette,"\tdynamic colormap... \n"); /* comment this out if you want to debug palette init */ @@ -462,7 +461,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) TSXUngrabServer(display); - dprintf_palette(stddeb,"adjusted size %i colorcells\n", cs->size); + dprintf_info(palette,"adjusted size %i colorcells\n", cs->size); } else if( cSpace.flags & COLOR_VIRTUAL ) { @@ -471,12 +470,12 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) * to maintain compatibility */ cs->size = 256; - dprintf_palette(stddeb,"\tvirtual colorspace - screendepth %i\n", screenDepth); + dprintf_info(palette,"\tvirtual colorspace - screendepth %i\n", screenDepth); } else cs->size = NB_RESERVED_COLORS; /* system palette only - however we can alloc a bunch * of colors and map to them */ - dprintf_palette(stddeb,"Shared system palette uses %i colors.\n", cs->size); + dprintf_info(palette,"Shared system palette uses %i colors.\n", cs->size); /* set gap to account for pixel shortage. It has to be right in the center * of the system palette because otherwise raster ops get screwed. */ @@ -530,7 +529,7 @@ static BOOL32 COLOR_BuildSharedMap(CSPACE* cs) else COLOR_PaletteToPixel[i] = i; - dprintf_palette(stddeb,"\tindex %i -> pixel %i\n", i, COLOR_PaletteToPixel[i]); + dprintf_info(palette,"\tindex %i -> pixel %i\n", i, COLOR_PaletteToPixel[i]); if( COLOR_PixelToPalette ) COLOR_PixelToPalette[COLOR_PaletteToPixel[i]] = i; @@ -575,7 +574,7 @@ BOOL32 COLOR_Init(void) visual = DefaultVisual( display, DefaultScreen(display) ); - dprintf_palette(stddeb,"COLOR_Init: initializing palette manager..."); + dprintf_info(palette,"COLOR_Init: initializing palette manager...\n"); white = WhitePixelOfScreen( screen ); black = BlackPixelOfScreen( screen ); @@ -650,7 +649,7 @@ BOOL32 COLOR_Init(void) } } - dprintf_palette(stddeb," visual class %i (%i)\n", + dprintf_info(palette," visual class %i (%i)\n", visual->class, cSpace.monoPlane); memset(COLOR_freeList, 0, 256*sizeof(unsigned char)); @@ -942,7 +941,7 @@ int COLOR_ToPhysical( DC *dc, COLORREF color ) if( !palPtr ) return 0; else if( !palPtr->mapping ) - dprintf_palette(stddeb,"\tpalette %04x is not realized\n", dc->w.hPalette); + dprintf_warn(palette, "\tpalette %04x is not realized\n", dc->w.hPalette); switch(spec_type) /* we have to peruse DC and system palette */ { @@ -961,7 +960,7 @@ int COLOR_ToPhysical( DC *dc, COLORREF color ) index = COLOR_PaletteLookupPixel( COLOR_sysPal, 256, COLOR_PaletteToPixel, color, FALSE); - /* dprintf_palette(stddeb,"\tRGB(%lx) -> pixel %i\n", color, index); + /* dprintf_info(palette,"\tRGB(%lx) -> pixel %i\n", color, index); */ break; case 1: /* PALETTEINDEX */ @@ -971,14 +970,14 @@ int COLOR_ToPhysical( DC *dc, COLORREF color ) fprintf(stderr, "\tRGB(%lx) : index %i is out of bounds\n", color, index); else if( palPtr->mapping ) index = palPtr->mapping[index]; - /* dprintf_palette(stddeb,"\tPALETTEINDEX(%04x) -> pixel %i\n", (WORD)color, index); + /* dprintf_info(palette,"\tPALETTEINDEX(%04x) -> pixel %i\n", (WORD)color, index); */ break; case 2: /* PALETTERGB */ index = COLOR_PaletteLookupPixel( palPtr->logpalette.palPalEntry, palPtr->logpalette.palNumEntries, palPtr->mapping, color, FALSE); - /* dprintf_palette(stddeb,"\tPALETTERGB(%lx) -> pixel %i\n", color, index); + /* dprintf_info(palette,"\tPALETTERGB(%lx) -> pixel %i\n", color, index); */ break; } @@ -1078,7 +1077,7 @@ int COLOR_SetMapping( PALETTEOBJ* palPtr, UINT32 uStart, UINT32 uNum, BOOL32 map if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++; palPtr->mapping[uStart] = index; - dprintf_palette(stddeb,"\tentry %i (%lx) -> pixel %i\n", uStart, + dprintf_info(palette,"\tentry %i (%lx) -> pixel %i\n", uStart, *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), index); } diff --git a/objects/cursoricon.c b/objects/cursoricon.c index 888e95eb981..db235746e65 100644 --- a/objects/cursoricon.c +++ b/objects/cursoricon.c @@ -38,7 +38,6 @@ #include "sysmetrics.h" #include "module.h" #include "win.h" -#include "stddebug.h" #include "debug.h" #include "task.h" #include "user.h" @@ -290,7 +289,7 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE32 hInstance, HGLOBAL16 BITMAPINFO *bmi; HDC32 hdc; - dprintf_cursor(stddeb,"CreateFromResource: %08x (%u bytes), ver %08x, %ix%i %s %s\n", + dprintf_info(cursor,"CreateFromResource: %08x (%u bytes), ver %08x, %ix%i %s %s\n", (unsigned)bits, cbSize, (unsigned)dwVersion, width, height, bIcon ? "icon" : "cursor", cFlag ? "mono" : "" ); if (dwVersion == 0x00020000) @@ -455,7 +454,7 @@ HICON32 WINAPI CreateIconFromResource32( LPBYTE bits, UINT32 cbSize, HICON32 ret; ret = CreateIconFromResourceEx16( bits, cbSize, bIcon, dwVersion, 0,0,0); fprintf(stdnimp,"CreateIconFromResource3 probably only a stub\n"); - dprintf_icon(stddeb, + dprintf_info(icon, "CreateIconFromResource32 %s at %p size %d winver %d return 0x%04x\n", (bIcon)?"Icon":"Cursor",bits,cbSize,bIcon,ret); return ret; @@ -638,7 +637,7 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL32 bSemiTransparent) COLORREF col; CURSORICONINFO cI; - dprintf_icon(stddeb, "IconToCursor:[%04x] %ix%i %ibpp (bogus %ibps)\n", + dprintf_info(icon, "IconToCursor:[%04x] %ix%i %ibpp (bogus %ibps)\n", hIcon, pIcon->nWidth, pIcon->nHeight, pIcon->bBitsPerPixel, pIcon->nWidthBytes ); xor_width = BITMAP_GetBitsWidth( pIcon->nWidth, bpp ); @@ -705,10 +704,10 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL32 bSemiTransparent) HCURSOR16 WINAPI LoadCursor16( HINSTANCE16 hInstance, SEGPTR name ) { if (HIWORD(name)) - dprintf_cursor( stddeb, "LoadCursor16: %04x '%s'\n", + dprintf_info(cursor, "LoadCursor16: %04x '%s'\n", hInstance, (char *)PTR_SEG_TO_LIN( name ) ); else - dprintf_cursor( stddeb, "LoadCursor16: %04x %04x\n", + dprintf_info(cursor, "LoadCursor16: %04x %04x\n", hInstance, LOWORD(name) ); return CURSORICON_Load16( hInstance, name, @@ -722,10 +721,10 @@ HCURSOR16 WINAPI LoadCursor16( HINSTANCE16 hInstance, SEGPTR name ) HICON16 WINAPI LoadIcon16( HINSTANCE16 hInstance, SEGPTR name ) { if (HIWORD(name)) - dprintf_icon( stddeb, "LoadIcon: %04x '%s'\n", + dprintf_info(icon, "LoadIcon: %04x '%s'\n", hInstance, (char *)PTR_SEG_TO_LIN( name ) ); else - dprintf_icon( stddeb, "LoadIcon: %04x %04x\n", + dprintf_info(icon, "LoadIcon: %04x %04x\n", hInstance, LOWORD(name) ); return CURSORICON_Load16( hInstance, name, @@ -744,7 +743,7 @@ HCURSOR16 WINAPI CreateCursor16( HINSTANCE16 hInstance, { CURSORICONINFO info = { { xHotSpot, yHotSpot }, nWidth, nHeight, 0, 1, 1 }; - dprintf_cursor( stddeb, "CreateCursor: %dx%d spot=%d,%d xor=%p and=%p\n", + dprintf_info(cursor, "CreateCursor: %dx%d spot=%d,%d xor=%p and=%p\n", nWidth, nHeight, xHotSpot, yHotSpot, lpXORbits, lpANDbits); return CreateCursorIconIndirect( hInstance, &info, lpANDbits, lpXORbits ); } @@ -760,7 +759,7 @@ HCURSOR32 WINAPI CreateCursor32( HINSTANCE32 hInstance, { CURSORICONINFO info = { { xHotSpot, yHotSpot }, nWidth, nHeight, 0, 1, 1 }; - dprintf_cursor( stddeb, "CreateCursor: %dx%d spot=%d,%d xor=%p and=%p\n", + dprintf_info(cursor, "CreateCursor: %dx%d spot=%d,%d xor=%p and=%p\n", nWidth, nHeight, xHotSpot, yHotSpot, lpXORbits, lpANDbits); return CreateCursorIconIndirect( MODULE_HANDLEtoHMODULE16( hInstance ), &info, lpANDbits, lpXORbits ); @@ -776,7 +775,7 @@ HICON16 WINAPI CreateIcon16( HINSTANCE16 hInstance, INT16 nWidth, { CURSORICONINFO info = { { 0, 0 }, nWidth, nHeight, 0, bPlanes, bBitsPixel}; - dprintf_icon( stddeb, "CreateIcon: %dx%dx%d, xor=%p, and=%p\n", + dprintf_info(icon, "CreateIcon: %dx%dx%d, xor=%p, and=%p\n", nWidth, nHeight, bPlanes * bBitsPixel, lpXORbits, lpANDbits); return CreateCursorIconIndirect( hInstance, &info, lpANDbits, lpXORbits ); } @@ -791,7 +790,7 @@ HICON32 WINAPI CreateIcon32( HINSTANCE32 hInstance, INT32 nWidth, { CURSORICONINFO info = { { 0, 0 }, nWidth, nHeight, 0, bPlanes, bBitsPixel}; - dprintf_icon( stddeb, "CreateIcon: %dx%dx%d, xor=%p, and=%p\n", + dprintf_info(icon, "CreateIcon: %dx%dx%d, xor=%p, and=%p\n", nWidth, nHeight, bPlanes * bBitsPixel, lpXORbits, lpANDbits); return CreateCursorIconIndirect( MODULE_HANDLEtoHMODULE16( hInstance ), &info, lpANDbits, lpXORbits ); @@ -832,7 +831,7 @@ HGLOBAL16 WINAPI CreateCursorIconIndirect( HINSTANCE16 hInstance, */ HICON16 WINAPI CopyIcon16( HINSTANCE16 hInstance, HICON16 hIcon ) { - dprintf_icon( stddeb, "CopyIcon16: %04x %04x\n", hInstance, hIcon ); + dprintf_info(icon, "CopyIcon16: %04x %04x\n", hInstance, hIcon ); return CURSORICON_Copy( hInstance, hIcon ); } @@ -844,7 +843,7 @@ HICON32 WINAPI CopyIcon32( HICON32 hIcon ) { HTASK16 hTask = GetCurrentTask (); TDB* pTask = (TDB *) GlobalLock16 (hTask); - dprintf_icon( stddeb, "CopyIcon32: %04x\n", hIcon ); + dprintf_info(icon, "CopyIcon32: %04x\n", hIcon ); return CURSORICON_Copy( pTask->hInstance, hIcon ); } @@ -854,7 +853,7 @@ HICON32 WINAPI CopyIcon32( HICON32 hIcon ) */ HCURSOR16 WINAPI CopyCursor16( HINSTANCE16 hInstance, HCURSOR16 hCursor ) { - dprintf_cursor( stddeb, "CopyCursor16: %04x %04x\n", hInstance, hCursor ); + dprintf_info(cursor, "CopyCursor16: %04x %04x\n", hInstance, hCursor ); return CURSORICON_Copy( hInstance, hCursor ); } @@ -873,7 +872,7 @@ BOOL16 WINAPI DestroyIcon16( HICON16 hIcon ) */ BOOL32 WINAPI DestroyIcon32( HICON32 hIcon ) { - dprintf_icon( stddeb, "DestroyIcon: %04x\n", hIcon ); + dprintf_info(icon, "DestroyIcon: %04x\n", hIcon ); /* FIXME: should check for OEM icon here */ return (FreeResource16( hIcon ) == 0); } @@ -893,7 +892,7 @@ BOOL16 WINAPI DestroyCursor16( HCURSOR16 hCursor ) */ BOOL32 WINAPI DestroyCursor32( HCURSOR32 hCursor ) { - dprintf_cursor( stddeb, "DestroyCursor: %04x\n", hCursor ); + dprintf_info(cursor, "DestroyCursor: %04x\n", hCursor ); /* FIXME: should check for OEM cursor here */ return (FreeResource16( hCursor ) == 0); } @@ -1126,7 +1125,7 @@ HCURSOR32 WINAPI SetCursor32( HCURSOR32 hCursor ) HCURSOR32 hOldCursor; if (hCursor == hActiveCursor) return hActiveCursor; /* No change */ - dprintf_cursor( stddeb, "SetCursor: %04x\n", hCursor ); + dprintf_info(cursor, "SetCursor: %04x\n", hCursor ); hOldCursor = hActiveCursor; hActiveCursor = hCursor; /* Change the cursor shape only if it is visible */ @@ -1154,7 +1153,7 @@ void WINAPI SetCursorPos16( INT16 x, INT16 y ) */ BOOL32 WINAPI SetCursorPos32( INT32 x, INT32 y ) { - dprintf_cursor( stddeb, "SetCursorPos: x=%d y=%d\n", x, y ); + dprintf_info(cursor, "SetCursorPos: x=%d y=%d\n", x, y ); TSXWarpPointer( display, rootWindow, rootWindow, 0, 0, 0, 0, x, y ); return TRUE; } @@ -1174,7 +1173,7 @@ INT16 WINAPI ShowCursor16( BOOL16 bShow ) */ INT32 WINAPI ShowCursor32( BOOL32 bShow ) { - dprintf_cursor( stddeb, "ShowCursor: %d, count=%d\n", + dprintf_info(cursor, "ShowCursor: %d, count=%d\n", bShow, CURSOR_ShowCount ); EnterCriticalSection( &X11DRV_CritSection ); @@ -1263,7 +1262,7 @@ void WINAPI GetCursorPos16( POINT16 *pt ) else MouseButtonsStates[2] = FALSE; } - dprintf_cursor(stddeb, "GetCursorPos: ret=%d,%d\n", pt->x, pt->y ); + dprintf_info(cursor, "GetCursorPos: ret=%d,%d\n", pt->x, pt->y ); } @@ -1321,7 +1320,7 @@ INT16 WINAPI LookupIconIdFromDirectoryEx16( LPBYTE xdir, BOOL16 bIcon, if( entry ) retVal = entry->wResId; } } - else dprintf_cursor(stddeb,"IconId: invalid resource directory\n"); + else dprintf_warn(cursor, "IconId: invalid resource directory\n"); return retVal; } @@ -1361,7 +1360,7 @@ WORD WINAPI GetIconID( HGLOBAL16 hResource, DWORD resType ) { LPBYTE lpDir = (LPBYTE)GlobalLock16(hResource); - dprintf_cursor( stddeb, "GetIconID: hRes=%04x, entries=%i\n", + dprintf_info(cursor, "GetIconID: hRes=%04x, entries=%i\n", hResource, lpDir ? ((CURSORICONDIR*)lpDir)->idCount : 0); switch(resType) @@ -1439,7 +1438,7 @@ HICON16 WINAPI LoadIconHandler( HGLOBAL16 hResource, BOOL16 bNew ) { LPBYTE bits = (LPBYTE)LockResource16( hResource ); - dprintf_cursor(stddeb,"LoadIconHandler: hRes=%04x\n",hResource); + dprintf_info(cursor,"LoadIconHandler: hRes=%04x\n",hResource); return CURSORICON_CreateFromResource( 0, 0, bits, 0, TRUE, bNew ? 0x00030000 : 0x00020000, 0, 0, LR_DEFAULTCOLOR ); @@ -1577,7 +1576,7 @@ BOOL32 WINAPI DrawIconEx32 (HDC32 hdc, INT32 x0, INT32 y0, HICON32 hIcon, HDC32 hMemDC = CreateCompatibleDC32 (hdc); BOOL32 result = FALSE; - dprintf_icon (stddeb, "DrawIconEx32: part stub.\n"); + dprintf_fixme(icon, "DrawIconEx32: part stub.\n"); if (hMemDC && ptr) { diff --git a/objects/dc.c b/objects/dc.c index a0ccb3f5a04..70a65c7d306 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -10,7 +10,6 @@ #include "gdi.h" #include "heap.h" #include "metafile.h" -#include "stddebug.h" #include "color.h" #include "debug.h" #include "font.h" @@ -450,7 +449,7 @@ HDC16 WINAPI GetDCState( HDC16 hdc ) } newdc = (DC *) GDI_HEAP_LOCK( handle ); - dprintf_dc(stddeb, "GetDCState(%04x): returning %04x\n", hdc, handle ); + dprintf_info(dc, "GetDCState(%04x): returning %04x\n", hdc, handle ); memset( &newdc->u.x, 0, sizeof(newdc->u.x) ); newdc->w.flags = dc->w.flags | DC_SAVED; @@ -538,7 +537,7 @@ void WINAPI SetDCState( HDC16 hdc, HDC16 hdcs ) GDI_HEAP_UNLOCK( hdcs ); return; } - dprintf_dc(stddeb, "SetDCState: %04x %04x\n", hdc, hdcs ); + dprintf_info(dc, "SetDCState: %04x %04x\n", hdc, hdcs ); dc->w.flags = dcs->w.flags & ~DC_SAVED; dc->w.devCaps = dcs->w.devCaps; @@ -643,7 +642,7 @@ INT32 WINAPI SaveDC32( HDC32 hdc ) dcs->header.hNext = dc->header.hNext; dc->header.hNext = hdcs; - dprintf_dc(stddeb, "SaveDC(%04x): returning %d\n", hdc, dc->saveLevel+1 ); + dprintf_info(dc, "SaveDC(%04x): returning %d\n", hdc, dc->saveLevel+1 ); ret = ++dc->saveLevel; GDI_HEAP_UNLOCK( hdcs ); GDI_HEAP_UNLOCK( hdc ); @@ -668,7 +667,7 @@ BOOL32 WINAPI RestoreDC32( HDC32 hdc, INT32 level ) DC * dc, * dcs; BOOL32 success; - dprintf_dc(stddeb, "RestoreDC: %04x %d\n", hdc, level ); + dprintf_info(dc, "RestoreDC: %04x %d\n", hdc, level ); dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) { @@ -728,13 +727,13 @@ HDC16 WINAPI CreateDC16( LPCSTR driver, LPCSTR device, LPCSTR output, if (!(dc = DC_AllocDC( funcs ))) return 0; dc->w.flags = 0; - dprintf_dc(stddeb, "CreateDC(%s %s %s): returning %04x\n", + dprintf_info(dc, "CreateDC(%s %s %s): returning %04x\n", driver, device, output, dc->hSelf ); if (dc->funcs->pCreateDC && !dc->funcs->pCreateDC( dc, driver, device, output, initData )) { - dprintf_dc( stddeb, "CreateDC: creation aborted by device\n" ); + dprintf_warn(dc, "CreateDC: creation aborted by device\n" ); GDI_HEAP_FREE( dc->hSelf ); return 0; } @@ -830,7 +829,7 @@ HDC32 WINAPI CreateCompatibleDC32( HDC32 hdc ) if (!(dc = DC_AllocDC( funcs ))) return 0; - dprintf_dc(stddeb, "CreateCompatibleDC(%04x): returning %04x\n", + dprintf_info(dc, "CreateCompatibleDC(%04x): returning %04x\n", hdc, dc->hSelf ); /* Create default bitmap */ @@ -847,7 +846,7 @@ HDC32 WINAPI CreateCompatibleDC32( HDC32 hdc ) if (dc->funcs->pCreateDC && !dc->funcs->pCreateDC( dc, NULL, NULL, NULL, NULL )) { - dprintf_dc(stddeb, "CreateCompatibleDC: creation aborted by device\n"); + dprintf_warn(dc, "CreateCompatibleDC: creation aborted by device\n"); DeleteObject32( hbitmap ); GDI_HEAP_FREE( dc->hSelf ); return 0; @@ -876,7 +875,7 @@ BOOL32 WINAPI DeleteDC32( HDC32 hdc ) DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) return FALSE; - dprintf_dc(stddeb, "DeleteDC: %04x\n", hdc ); + dprintf_info(dc, "DeleteDC: %04x\n", hdc ); while (dc->saveLevel) { @@ -962,7 +961,7 @@ INT32 WINAPI GetDeviceCaps32( HDC32 hdc, INT32 cap ) return 0; } - dprintf_dc(stddeb, "GetDeviceCaps(%04x,%d): returning %d\n", + dprintf_info(dc, "GetDeviceCaps(%04x,%d): returning %d\n", hdc, cap, *(WORD *)(((char *)dc->w.devCaps) + cap) ); ret = *(WORD *)(((char *)dc->w.devCaps) + cap); GDI_HEAP_UNLOCK( hdc ); @@ -1269,7 +1268,7 @@ BOOL16 WINAPI SetDCHook( HDC16 hdc, FARPROC16 hookProc, DWORD dwHookData ) { DC *dc = (DC *)GDI_GetObjPtr( hdc, DC_MAGIC ); - dprintf_dc( stddeb, "SetDCHook: hookProc %08x, default is %08x\n", + dprintf_info(dc, "SetDCHook: hookProc %08x, default is %08x\n", (UINT32)hookProc, (UINT32)DCHook ); if (!dc) return FALSE; @@ -1307,7 +1306,7 @@ WORD WINAPI SetHookFlags(HDC16 hDC, WORD flags) /* "Undocumented Windows" info is slightly confusing. */ - dprintf_dc(stddeb,"SetHookFlags: hDC %04x, flags %04x\n",hDC,flags); + dprintf_info(dc,"SetHookFlags: hDC %04x, flags %04x\n",hDC,flags); if( flags & DCHF_INVALIDATEVISRGN ) dc->w.flags |= DC_DIRTY; diff --git a/objects/dib.c b/objects/dib.c index c4227ef0ddb..1622d173da6 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -12,7 +12,6 @@ #include "bitmap.h" #include "callback.h" #include "palette.h" -#include "stddebug.h" #include "color.h" #include "debug.h" @@ -578,7 +577,7 @@ static void DIB_SetImageBits_RLE8( int lines, const BYTE *bits, DWORD width, line -= (*pIn++); if (line == 0) { - dprintf_bitmap(stddeb, + dprintf_info(bitmap, "DIB_SetImageBits_RLE8(): " "Delta to last line of bitmap " "(wrongly?) causes loop exit\n"); @@ -625,7 +624,7 @@ static void DIB_SetImageBits_RLE8( int lines, const BYTE *bits, DWORD width, */ if ( (*(pIn-2) != 0/*escape*/) || (*(pIn-1)!= RleEnd) ) { - dprintf_bitmap(stddeb, "DIB_SetImageBits_RLE8(): End-of-bitmap " + dprintf_info(bitmap, "DIB_SetImageBits_RLE8(): End-of-bitmap " "without (strictly) proper escape code. Last two " "bytes were: %02X %02X.\n", (int)*(pIn-2), @@ -1180,7 +1179,7 @@ INT32 WINAPI GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan, BYTE* bbits = bits; int pad, yend, xend = bmp->bitmap.bmWidth; - dprintf_bitmap(stddeb, "GetDIBits: %u scanlines of (%i,%i) -> (%i,%i) starting from %u\n", + dprintf_info(bitmap, "GetDIBits: %u scanlines of (%i,%i) -> (%i,%i) starting from %u\n", lines, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, (int)info->bmiHeader.biWidth, (int)info->bmiHeader.biHeight, startscan ); diff --git a/objects/font.c b/objects/font.c index b1ac08d5638..04fe1312ebf 100644 --- a/objects/font.c +++ b/objects/font.c @@ -12,7 +12,6 @@ #include "heap.h" #include "metafile.h" #include "options.h" -#include "stddebug.h" #include "debug.h" #include "debugstr.h" @@ -223,7 +222,7 @@ HFONT16 WINAPI CreateFontIndirect16( const LOGFONT16 *font ) fontPtr = (FONTOBJ *) GDI_HEAP_LOCK( hFont ); memcpy( &fontPtr->logfont, font, sizeof(LOGFONT16) ); - dprintf_font(stddeb,"CreateFontIndirect(%i %i) '%s' %s %s => %04x\n", + dprintf_info(font,"CreateFontIndirect(%i %i) '%s' %s %s => %04x\n", font->lfHeight, font->lfWidth, font->lfFaceName ? font->lfFaceName : "NULL", font->lfWeight > 400 ? "Bold" : "", @@ -271,7 +270,7 @@ HFONT16 WINAPI CreateFont16(INT16 height, INT16 width, INT16 esc, INT16 orient, LOGFONT16 logfont = { height, width, esc, orient, weight, italic, underline, strikeout, charset, outpres, clippres, quality, pitch, }; - dprintf_font(stddeb,"CreateFont16('%s',%d,%d)\n", + dprintf_info(font,"CreateFont16('%s',%d,%d)\n", (name ? name : "(null)") , height, width); if (name) lstrcpyn32A(logfont.lfFaceName,name,sizeof(logfont.lfFaceName)); @@ -716,7 +715,7 @@ BOOL32 WINAPI GetTextExtentPoint32A( HDC32 hdc, LPCSTR str, INT32 count, !dc->funcs->pGetTextExtentPoint( dc, str, count, size )) return FALSE; - dprintf_font(stddeb,"GetTextExtentPoint(%08x %s %d %p): returning %d,%d\n", + dprintf_info(font,"GetTextExtentPoint(%08x %s %d %p): returning %d,%d\n", hdc, debugstr_an (str, count), count, size, size->cx, size->cy ); return TRUE; @@ -742,7 +741,7 @@ BOOL32 WINAPI GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count, BOOL32 WINAPI GetTextExtentPoint32ABuggy( HDC32 hdc, LPCSTR str, INT32 count, LPSIZE32 size ) { - dprintf_font( stddeb, "GetTextExtentPoint32ABuggy: not bug compatible.\n"); + dprintf_info(font, "GetTextExtentPoint32ABuggy: not bug compatible.\n"); return GetTextExtentPoint32A( hdc, str, count, size ); } @@ -752,7 +751,7 @@ BOOL32 WINAPI GetTextExtentPoint32ABuggy( HDC32 hdc, LPCSTR str, INT32 count, BOOL32 WINAPI GetTextExtentPoint32WBuggy( HDC32 hdc, LPCWSTR str, INT32 count, LPSIZE32 size ) { - dprintf_font( stddeb, "GetTextExtentPoint32WBuggy: not bug compatible.\n"); + dprintf_info(font, "GetTextExtentPoint32WBuggy: not bug compatible.\n"); return GetTextExtentPoint32W( hdc, str, count, size ); } @@ -792,7 +791,7 @@ BOOL32 WINAPI GetTextExtentExPoint32A( HDC32 hdc, LPCSTR str, INT32 count, size->cx = extent; *lpnFit = nFit; - dprintf_font(stddeb,"GetTextExtentExPoint32A(%08x '%.*s' %d) returning %d %d %d\n", + dprintf_info(font,"GetTextExtentExPoint32A(%08x '%.*s' %d) returning %d %d %d\n", hdc,count,str,maxExt,nFit, size->cx,size->cy); return TRUE; } @@ -861,7 +860,7 @@ BOOL32 WINAPI GetTextMetrics32A( HDC32 hdc, TEXTMETRIC32A *metrics ) metrics->tmMaxCharWidth = WDPTOLP(metrics->tmMaxCharWidth); metrics->tmOverhang = WDPTOLP(metrics->tmOverhang); - dprintf_font(stddeb,"text metrics: + dprintf_info(font,"text metrics: Weight = %03i\t FirstChar = %03i\t AveCharWidth = %i Italic = % 3i\t LastChar = %03i\t\t MaxCharWidth = %i UnderLined = %01i\t DefaultChar = %03i\t Overhang = %i @@ -988,8 +987,8 @@ DWORD WINAPI SetMapperFlags16( HDC16 hDC, DWORD dwFlag ) */ DWORD WINAPI SetMapperFlags32( HDC32 hDC, DWORD dwFlag ) { - dprintf_font(stdnimp,"SetMapperFlags(%04x, %08lX) // Empty Stub !\n", - hDC, dwFlag); + dprintf_fixme(font, "SetMapperFlags(%04x, %08lX) // Empty Stub !\n", + hDC, dwFlag); return 0L; } @@ -998,9 +997,8 @@ DWORD WINAPI SetMapperFlags32( HDC32 hDC, DWORD dwFlag ) */ BOOL16 GetAspectRatioFilterEx16( HDC16 hdc, LPVOID pAspectRatio ) { - dprintf_font(stdnimp, - "GetAspectRatioFilterEx(%04x, %p): // Empty Stub !\n", - hdc, pAspectRatio); + dprintf_fixme(font, "GetAspectRatioFilterEx(%04x, %p): // Empty Stub !\n", + hdc, pAspectRatio); return FALSE; } diff --git a/objects/gdiobj.c b/objects/gdiobj.c index 0557012f146..d19aad38641 100644 --- a/objects/gdiobj.c +++ b/objects/gdiobj.c @@ -16,7 +16,6 @@ #include "palette.h" #include "pen.h" #include "region.h" -#include "stddebug.h" #include "debug.h" #include "gdi.h" @@ -361,7 +360,7 @@ BOOL32 WINAPI DeleteObject32( HGDIOBJ32 obj ) return TRUE; if (!(header = (GDIOBJHDR *) GDI_HEAP_LOCK( obj ))) return FALSE; - dprintf_gdi(stddeb, "DeleteObject: %04x\n", obj ); + dprintf_info(gdi, "DeleteObject: %04x\n", obj ); /* Delete object */ @@ -394,7 +393,7 @@ HGDIOBJ32 WINAPI GetStockObject32( INT32 obj ) { if ((obj < 0) || (obj >= NB_STOCK_OBJECTS)) return 0; if (!StockObjects[obj]) return 0; - dprintf_gdi(stddeb, "GetStockObject: returning %d\n", + dprintf_info(gdi, "GetStockObject: returning %d\n", FIRST_STOCK_HANDLE + obj ); return (HGDIOBJ16)(FIRST_STOCK_HANDLE + obj); } @@ -407,7 +406,7 @@ INT16 WINAPI GetObject16( HANDLE16 handle, INT16 count, LPVOID buffer ) { GDIOBJHDR * ptr = NULL; INT16 result = 0; - dprintf_gdi(stddeb, "GetObject16: %04x %d %p\n", handle, count, buffer ); + dprintf_info(gdi, "GetObject16: %04x %d %p\n", handle, count, buffer ); if (!count) return 0; if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE)) @@ -446,7 +445,7 @@ INT32 WINAPI GetObject32A( HANDLE32 handle, INT32 count, LPVOID buffer ) { GDIOBJHDR * ptr = NULL; INT32 result = 0; - dprintf_gdi(stddeb, "GetObject32A: %08x %d %p\n", handle, count, buffer ); + dprintf_info(gdi, "GetObject32A: %08x %d %p\n", handle, count, buffer ); if (!count) return 0; if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE)) @@ -485,7 +484,7 @@ DWORD WINAPI GetObjectType( HANDLE32 handle ) { GDIOBJHDR * ptr = NULL; INT32 result = 0; - dprintf_gdi(stddeb, "GetObjectType: %08x\n", handle ); + dprintf_info(gdi, "GetObjectType: %08x\n", handle ); if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE)) ptr = StockObjects[handle - FIRST_STOCK_HANDLE]; @@ -582,7 +581,7 @@ HGDIOBJ32 WINAPI SelectObject32( HDC32 hdc, HGDIOBJ32 handle ) { DC * dc = DC_GetDCPtr( hdc ); if (!dc || !dc->funcs->pSelectObject) return 0; - dprintf_gdi(stddeb, "SelectObject: hdc=%04x %04x\n", hdc, handle ); + dprintf_info(gdi, "SelectObject: hdc=%04x %04x\n", hdc, handle ); return dc->funcs->pSelectObject( dc, handle ); } @@ -607,7 +606,7 @@ BOOL32 WINAPI UnrealizeObject32( HGDIOBJ32 obj ) GDIOBJHDR * header = (GDIOBJHDR *) GDI_HEAP_LOCK( obj ); if (!header) return FALSE; - dprintf_gdi( stddeb, "UnrealizeObject: %04x\n", obj ); + dprintf_info(gdi, "UnrealizeObject: %04x\n", obj ); /* Unrealize object */ @@ -648,7 +647,7 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType, LOGPEN16 *pen; LOGBRUSH16 *brush = NULL; - dprintf_gdi( stddeb, "EnumObjects16: %04x %d %08lx %08lx\n", + dprintf_info(gdi, "EnumObjects16: %04x %d %08lx %08lx\n", hdc, nObjType, (DWORD)lpEnumFunc, lParam ); switch(nObjType) { @@ -662,7 +661,7 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType, pen->lopnWidth.y = 0; pen->lopnColor = solid_colors[i]; retval = lpEnumFunc( SEGPTR_GET(pen), lParam ); - dprintf_gdi( stddeb, "EnumObjects16: solid pen %08lx, ret=%d\n", + dprintf_info(gdi, "EnumObjects16: solid pen %08lx, ret=%d\n", solid_colors[i], retval); if (!retval) break; } @@ -678,7 +677,7 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType, brush->lbColor = solid_colors[i]; brush->lbHatch = 0; retval = lpEnumFunc( SEGPTR_GET(brush), lParam ); - dprintf_gdi( stddeb, "EnumObjects16: solid brush %08lx, ret=%d\n", + dprintf_info(gdi, "EnumObjects16: solid brush %08lx, ret=%d\n", solid_colors[i], retval); if (!retval) break; } @@ -690,7 +689,7 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType, brush->lbColor = RGB(0,0,0); brush->lbHatch = i; retval = lpEnumFunc( SEGPTR_GET(brush), lParam ); - dprintf_gdi( stddeb, "EnumObjects16: hatched brush %d, ret=%d\n", + dprintf_info(gdi, "EnumObjects16: hatched brush %d, ret=%d\n", i, retval); if (!retval) break; } @@ -727,7 +726,7 @@ INT32 WINAPI EnumObjects32( HDC32 hdc, INT32 nObjType, LOGPEN32 pen; LOGBRUSH32 brush; - dprintf_gdi( stddeb, "EnumObjects32: %04x %d %08lx %08lx\n", + dprintf_info(gdi, "EnumObjects32: %04x %d %08lx %08lx\n", hdc, nObjType, (DWORD)lpEnumFunc, lParam ); switch(nObjType) { @@ -740,7 +739,7 @@ INT32 WINAPI EnumObjects32( HDC32 hdc, INT32 nObjType, pen.lopnWidth.y = 0; pen.lopnColor = solid_colors[i]; retval = lpEnumFunc( &pen, lParam ); - dprintf_gdi( stddeb, "EnumObjects32: solid pen %08lx, ret=%d\n", + dprintf_info(gdi, "EnumObjects32: solid pen %08lx, ret=%d\n", solid_colors[i], retval); if (!retval) break; } @@ -754,7 +753,7 @@ INT32 WINAPI EnumObjects32( HDC32 hdc, INT32 nObjType, brush.lbColor = solid_colors[i]; brush.lbHatch = 0; retval = lpEnumFunc( &brush, lParam ); - dprintf_gdi( stddeb, "EnumObjects32: solid brush %08lx, ret=%d\n", + dprintf_info(gdi, "EnumObjects32: solid brush %08lx, ret=%d\n", solid_colors[i], retval); if (!retval) break; } @@ -766,7 +765,7 @@ INT32 WINAPI EnumObjects32( HDC32 hdc, INT32 nObjType, brush.lbColor = RGB(0,0,0); brush.lbHatch = i; retval = lpEnumFunc( &brush, lParam ); - dprintf_gdi( stddeb, "EnumObjects32: hatched brush %d, ret=%d\n", + dprintf_info(gdi, "EnumObjects32: hatched brush %d, ret=%d\n", i, retval); if (!retval) break; } diff --git a/objects/metafile.c b/objects/metafile.c index 4d426d71269..1d58af01b55 100644 --- a/objects/metafile.c +++ b/objects/metafile.c @@ -16,7 +16,6 @@ #include "metafile.h" #include "metafiledrv.h" #include "toolhelp.h" -#include "stddebug.h" #include "debug.h" /****************************************************************** @@ -80,7 +79,7 @@ HMETAFILE32 WINAPI GetMetaFile32A( HFILE32 hFile; DWORD size; - dprintf_metafile(stddeb,"GetMetaFile: %s\n", lpFilename); + dprintf_info(metafile,"GetMetaFile: %s\n", lpFilename); if (!lpFilename) return 0; @@ -190,7 +189,7 @@ HMETAFILE32 WINAPI CopyMetaFile32A( METAHEADER *mh2; HFILE32 hFile; - dprintf_metafile(stddeb,"CopyMetaFile: %s\n", lpFilename); + dprintf_info(metafile,"CopyMetaFile: %s\n", lpFilename); mh = (METAHEADER *)GlobalLock16(hSrcMetaFile); @@ -261,7 +260,7 @@ BOOL16 WINAPI IsValidMetaFile(HMETAFILE16 hmf) resu=TRUE; GlobalUnlock16(hmf); } - dprintf_metafile(stddeb,"IsValidMetaFile %x => %d\n",hmf,resu); + dprintf_info(metafile,"IsValidMetaFile %x => %d\n",hmf,resu); return resu; } @@ -297,7 +296,7 @@ BOOL32 WINAPI PlayMetaFile32( HFONT32 hFont; DC *dc; - dprintf_metafile(stddeb,"PlayMetaFile(%04x %04x)\n",hdc,hmf); + dprintf_info(metafile,"PlayMetaFile(%04x %04x)\n",hdc,hmf); if (!mh) return FALSE; if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0; hPen = dc->w.hPen; @@ -315,7 +314,7 @@ BOOL32 WINAPI PlayMetaFile32( while (offset < mh->mtSize * 2) { mr = (METARECORD *)((char *)mh + offset); - dprintf_metafile(stddeb,"offset = %04x size = %08lx\n", + dprintf_info(metafile,"offset = %04x size = %08lx\n", offset, mr->rdSize); if (!mr->rdSize) { fprintf(stderr,"METAFILE entry got size 0 at offset %d, total mf length is %ld\n",offset,mh->mtSize*2); @@ -375,7 +374,7 @@ BOOL16 WINAPI EnumMetaFile16( DC *dc; BOOL16 result = TRUE; - dprintf_metafile(stddeb,"EnumMetaFile(%04x, %04x, %08lx, %08lx)\n", + dprintf_info(metafile,"EnumMetaFile(%04x, %04x, %08lx, %08lx)\n", hdc, hmf, (DWORD)lpEnumFunc, lpData); if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0; @@ -461,7 +460,7 @@ void WINAPI PlayMetaFileRecord16( char *ptr; BITMAPINFOHEADER *infohdr; - dprintf_metafile(stddeb, + dprintf_info(metafile, "PlayMetaFileRecord(%04x %08lx %08lx %04x) function %04x\n", hdc,(LONG)ht, (LONG)mr, nHandles, mr->rdFunction); @@ -712,7 +711,7 @@ void WINAPI PlayMetaFileRecord16( break; case META_ESCAPE: - dprintf_metafile(stddeb,"PlayMetaFileRecord: META_ESCAPE unimplemented.\n"); + dprintf_fixme(metafile, "PlayMetaFileRecord: META_ESCAPE unimplemented.\n"); break; /* --- Begin of fixed or new metafile operations. July 1996 ----*/ @@ -737,7 +736,7 @@ void WINAPI PlayMetaFileRecord16( dxx = (LPINT16)(sot+(((s1+1)>>1)*2)); else { - dprintf_metafile(stddeb,"EXTTEXTOUT: %s len: %ld\n", + dprintf_info(metafile,"EXTTEXTOUT: %s len: %ld\n", sot,mr->rdSize); fprintf(stderr, "Please report: PlayMetaFile/ExtTextOut len=%ld slen=%d rdSize=%ld opt=%04x\n", @@ -751,7 +750,7 @@ void WINAPI PlayMetaFileRecord16( sot, /* string */ s1, dxx); /* length, dx array */ if (dxx) - dprintf_metafile(stddeb,"EXTTEXTOUT: %s len: %ld dx0: %d\n", + dprintf_info(metafile,"EXTTEXTOUT: %s len: %ld dx0: %d\n", sot,mr->rdSize,dxx[0]); } break; @@ -842,7 +841,7 @@ void WINAPI PlayMetaFileRecord16( case META_DIBCREATEPATTERNBRUSH: /* *(mr->rdParam) may be BS_PATTERN or BS_DIBPATTERN: but there's no difference */ - dprintf_metafile(stddeb,"META_DIBCREATEPATTERNBRUSH: %d\n",*(mr->rdParam)); + dprintf_info(metafile,"META_DIBCREATEPATTERNBRUSH: %d\n",*(mr->rdParam)); s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2; hndl = GlobalAlloc16(GMEM_MOVEABLE, s1); ptr = GlobalLock16(hndl); @@ -908,7 +907,7 @@ HGLOBAL16 WINAPI GetMetaFileBits( HMETAFILE16 hmf /* metafile handle */ ) { - dprintf_metafile(stddeb,"GetMetaFileBits: hMem out: %04x\n", hmf); + dprintf_info(metafile,"GetMetaFileBits: hMem out: %04x\n", hmf); return hmf; } @@ -925,7 +924,7 @@ HMETAFILE16 WINAPI SetMetaFileBits( /* handle to a memory region holding a metafile */ ) { - dprintf_metafile(stddeb,"SetMetaFileBits: hmf out: %04x\n", hMem); + dprintf_info(metafile,"SetMetaFileBits: hmf out: %04x\n", hMem); return hMem; } @@ -1043,7 +1042,7 @@ static BOOL32 MF_WriteRecord( DC *dc, METARECORD *mr, DWORD rlen) memcpy((WORD *)physDev->mh + physDev->mh->mtSize, mr, rlen); break; case METAFILE_DISK: - dprintf_metafile(stddeb,"Writing record to disk\n"); + dprintf_info(metafile,"Writing record to disk\n"); if (_lwrite32(physDev->mh->mtNoParameters, (char *)mr, rlen) == -1) return FALSE; break; @@ -1443,7 +1442,7 @@ BOOL32 MF_BitBlt(DC *dcDest, short xDest, short yDest, short width, *(mr->rdParam + 9) = BM.bmWidthBytes; *(mr->rdParam +10) = BM.bmPlanes; *(mr->rdParam +11) = BM.bmBitsPixel; - dprintf_metafile(stddeb,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop); + dprintf_info(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop); if (GetBitmapBits32(dcSrc->w.hBitmap,BM.bmWidthBytes * BM.bmHeight, mr->rdParam +12)) { @@ -1508,7 +1507,7 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest, lpBMI->biYPelsPerMeter = MulDiv32(GetDeviceCaps(dcSrc->hSelf,LOGPIXELSY),3937,100); lpBMI->biClrImportant = 0; /* 1 meter = 39.37 inch */ - dprintf_metafile(stddeb,"MF_StretchBltViaDIB->len = %ld rop=%lx PixYPM=%ld Caps=%d\n", + dprintf_info(metafile,"MF_StretchBltViaDIB->len = %ld rop=%lx PixYPM=%ld Caps=%d\n", len,rop,lpBMI->biYPelsPerMeter,GetDeviceCaps(hdcSrc,LOGPIXELSY)); if (GetDIBits(hdcSrc,dcSrc->w.hBitmap,0,(UINT32)lpBMI->biHeight, (LPSTR)lpBMI + DIB_BitmapInfoSize( (BITMAPINFO *)lpBMI, @@ -1525,7 +1524,7 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest, *(mr->rdParam +12) = BM.bmWidthBytes; *(mr->rdParam +13) = BM.bmPlanes; *(mr->rdParam +14) = BM.bmBitsPixel; - dprintf_metafile(stddeb,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop); + dprintf_info(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop); if (GetBitmapBits32( dcSrc->w.hBitmap, BM.bmWidthBytes * BM.bmHeight, mr->rdParam +15)) #endif diff --git a/objects/oembitmap.c b/objects/oembitmap.c index 700e9fece54..d362f7795dc 100644 --- a/objects/oembitmap.c +++ b/objects/oembitmap.c @@ -16,7 +16,6 @@ #include "color.h" #include "cursoricon.h" #include "heap.h" -#include "stddebug.h" #include "tweak.h" #include "debug.h" diff --git a/objects/palette.c b/objects/palette.c index 67f4411017e..d11c2cd4359 100644 --- a/objects/palette.c +++ b/objects/palette.c @@ -16,8 +16,6 @@ #include "color.h" #include "palette.h" #include "xmalloc.h" -#include "stddebug.h" -/* #define DEBUG_PALETTE */ #include "debug.h" static UINT32 SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */ @@ -95,7 +93,7 @@ HPALETTE32 WINAPI CreatePalette32( const LOGPALETTE* palette ) HPALETTE32 hpalette; int size = sizeof(LOGPALETTE) + (palette->palNumEntries - 1) * sizeof(PALETTEENTRY); - dprintf_palette(stddeb,"CreatePalette: %i entries, ", + dprintf_info(palette,"CreatePalette: %i entries \n", palette->palNumEntries); hpalette = GDI_AllocObject( size + sizeof(int*) +sizeof(GDIOBJHDR) , PALETTE_MAGIC ); @@ -108,7 +106,7 @@ HPALETTE32 WINAPI CreatePalette32( const LOGPALETTE* palette ) palettePtr->mapping = NULL; GDI_HEAP_UNLOCK( hpalette ); - dprintf_palette(stddeb,"returning %04x\n", hpalette); + dprintf_info(palette," returning %04x\n", hpalette); return hpalette; } @@ -140,7 +138,7 @@ UINT32 WINAPI GetPaletteEntries32( HPALETTE32 hpalette, UINT32 start, PALETTEOBJ * palPtr; INT32 numEntries; - dprintf_palette( stddeb,"GetPaletteEntries: hpal = %04x, %i entries\n", + dprintf_info(palette,"GetPaletteEntries: hpal = %04x, %i entries\n", hpalette, count ); palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); @@ -182,7 +180,7 @@ UINT32 WINAPI SetPaletteEntries32( HPALETTE32 hpalette, UINT32 start, PALETTEOBJ * palPtr; INT32 numEntries; - dprintf_palette( stddeb,"SetPaletteEntries: hpal = %04x, %i entries\n", + dprintf_info(palette,"SetPaletteEntries: hpal = %04x, %i entries\n", hpalette, count ); palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); @@ -225,7 +223,7 @@ BOOL32 WINAPI ResizePalette32( HPALETTE32 hPal, UINT32 cEntries ) int prevsize, size = sizeof(LOGPALETTE) + (cEntries - 1) * sizeof(PALETTEENTRY); int* mapping = NULL; - dprintf_palette(stddeb,"ResizePalette: hpal = %04x, prev = %i, new = %i\n", + dprintf_info(palette,"ResizePalette: hpal = %04x, prev = %i, new = %i\n", hPal, palPtr ? palPtr->logpalette.palNumEntries : -1, cEntries ); if( !palPtr ) return FALSE; @@ -277,7 +275,7 @@ void WINAPI AnimatePalette16( HPALETTE16 hPal, UINT16 StartIndex, BOOL32 WINAPI AnimatePalette32( HPALETTE32 hPal, UINT32 StartIndex, UINT32 NumEntries, LPPALETTEENTRY PaletteColors) { - dprintf_palette(stddeb, "AnimatePalette: %04x (%i - %i)", hPal, + dprintf_info(palette, "AnimatePalette: %04x (%i - %i)\n", hPal, StartIndex, StartIndex + NumEntries ); if( hPal != STOCK_DEFAULT_PALETTE ) @@ -358,7 +356,8 @@ UINT32 WINAPI GetSystemPaletteEntries32( HDC32 hdc, UINT32 start, UINT32 count, UINT32 i; DC *dc; - dprintf_palette(stddeb,"GetSystemPaletteEntries: hdc = %04x, cound = %i", hdc, count ); + dprintf_info(palette, "GetSystemPaletteEntries: hdc = %04x, " + "cound = %i\n", hdc, count ); if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0; if (start >= dc->w.devCaps->sizePalette) @@ -372,7 +371,7 @@ UINT32 WINAPI GetSystemPaletteEntries32( HDC32 hdc, UINT32 start, UINT32 count, { *(COLORREF*)(entries + i) = COLOR_GetSystemPaletteEntry( start + i ); - dprintf_palette( stddeb,"\tidx(%02x) -> RGB(%08lx)\n", + dprintf_info(palette,"\tidx(%02x) -> RGB(%08lx)\n", start + i, *(COLORREF*)(entries + i) ); } GDI_HEAP_UNLOCK( hdc ); @@ -402,7 +401,7 @@ UINT32 WINAPI GetNearestPaletteIndex32( HPALETTE32 hpalette, COLORREF color ) palObj->logpalette.palNumEntries, NULL, color, FALSE ); - dprintf_palette(stddeb,"GetNearestPaletteIndex(%04x,%06lx): returning %d\n", + dprintf_info(palette,"GetNearestPaletteIndex(%04x,%06lx): returning %d\n", hpalette, color, index ); GDI_HEAP_UNLOCK( hpalette ); return index; @@ -438,7 +437,7 @@ COLORREF WINAPI GetNearestColor32( HDC32 hdc, COLORREF color ) GDI_HEAP_UNLOCK( dc->w.hPalette ); } - dprintf_palette(stddeb,"GetNearestColor(%06lx): returning %06lx\n", + dprintf_info(palette,"GetNearestColor(%06lx): returning %06lx\n", color, nearest ); GDI_HEAP_UNLOCK( hdc ); return nearest; @@ -490,7 +489,7 @@ HPALETTE16 WINAPI GDISelectPalette( HDC16 hdc, HPALETTE16 hpal, WORD wBkg) HPALETTE16 prev; DC *dc; - dprintf_palette(stddeb, "GDISelectPalette: %04x %04x\n", hdc, hpal ); + dprintf_info(palette, "GDISelectPalette: %04x %04x\n", hdc, hpal ); dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) @@ -520,7 +519,7 @@ UINT16 WINAPI GDIRealizePalette( HDC16 hdc ) if (!dc) return 0; } - dprintf_palette(stddeb, "GDIRealizePalette: %04x...", hdc ); + dprintf_info(palette, "GDIRealizePalette: %04x...\n", hdc ); if( dc && dc->w.hPalette != hLastRealizedPalette ) { @@ -535,11 +534,11 @@ UINT16 WINAPI GDIRealizePalette( HDC16 hdc ) GDI_HEAP_UNLOCK( dc->w.hPalette ); hLastRealizedPalette = dc->w.hPalette; } - else dprintf_palette(stddeb, " skipping (hLastRealizedPalette = %04x) ", + else dprintf_info(palette, " skipping (hLastRealizedPalette = %04x)\n", hLastRealizedPalette); GDI_HEAP_UNLOCK( hdc ); - dprintf_palette(stdnimp, " realized %i colors\n", realized ); + dprintf_fixme(palette, " realized %i colors - not impmenented?\n", realized ); return (UINT16)realized; } @@ -553,7 +552,7 @@ UINT16 WINAPI RealizeDefaultPalette( HDC16 hdc ) PALETTEOBJ* palPtr; int i, index, realized = 0; - dprintf_palette(stddeb,"RealizeDefaultPalette: %04x\n", hdc ); + dprintf_info(palette,"RealizeDefaultPalette: %04x\n", hdc ); dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); if (!dc) @@ -620,11 +619,11 @@ HPALETTE32 WINAPI SelectPalette32( HDC32 hDC, HPALETTE32 hPal, WORD wBkgPalette = 1; PALETTEOBJ* lpt = (PALETTEOBJ*) GDI_GetObjPtr( hPal, PALETTE_MAGIC ); - dprintf_palette(stddeb,"SelectPalette: dc %04x pal %04x, force=%i ", + dprintf_info(palette,"SelectPalette: dc %04x pal %04x, force=%i \n", hDC, hPal, bForceBackground); if( !lpt ) return 0; - dprintf_palette(stddeb," entries = %d\n", + dprintf_info(palette," entries = %d\n", lpt->logpalette.palNumEntries); GDI_HEAP_UNLOCK( hPal ); diff --git a/objects/pen.c b/objects/pen.c index ca3a1912f48..e1f44a9dbab 100644 --- a/objects/pen.c +++ b/objects/pen.c @@ -7,7 +7,6 @@ #include "pen.h" #include "metafile.h" #include "color.h" -#include "stddebug.h" #include "debug.h" @@ -18,7 +17,7 @@ HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color ) { LOGPEN32 logpen = { style, { width, 0 }, color }; - dprintf_gdi(stddeb, "CreatePen16: %d %d %06lx\n", style, width, color ); + dprintf_info(gdi, "CreatePen16: %d %d %06lx\n", style, width, color ); return CreatePenIndirect32( &logpen ); } @@ -29,7 +28,7 @@ HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color ) HPEN32 WINAPI CreatePen32( INT32 style, INT32 width, COLORREF color ) { LOGPEN32 logpen = { style, { width, 0 }, color }; - dprintf_gdi(stddeb, "CreatePen32: %d %d %06lx\n", style, width, color ); + dprintf_info(gdi, "CreatePen32: %d %d %06lx\n", style, width, color ); return CreatePenIndirect32( &logpen ); } diff --git a/objects/region.c b/objects/region.c index f3adee4d339..ef798dd799e 100644 --- a/objects/region.c +++ b/objects/region.c @@ -82,7 +82,6 @@ SOFTWARE. #include #include "region.h" -#include "stddebug.h" #include "debug.h" #include "heap.h" #include "dc.h" @@ -107,11 +106,11 @@ static void REGION_DumpRegion(WINEREGION *pReg) { RECT32 *pRect, *pRectEnd = pReg->rects + pReg->numRects; - dprintf_region(stddeb, "Region %p: %d,%d - %d,%d %d rects\n", pReg, + dprintf_info(region, "Region %p: %d,%d - %d,%d %d rects\n", pReg, pReg->extents.left, pReg->extents.top, pReg->extents.right, pReg->extents.bottom, pReg->numRects); for(pRect = pReg->rects; pRect < pRectEnd; pRect++) - dprintf_region(stddeb, "\t%d,%d - %d,%d\n", pRect->left, pRect->top, + dprintf_info(region, "\t%d,%d - %d,%d\n", pRect->left, pRect->top, pRect->right, pRect->bottom); return; } @@ -171,7 +170,7 @@ static void REGION_DestroyWineRegion( WINEREGION* pReg ) */ BOOL32 REGION_DeleteObject( HRGN32 hrgn, RGNOBJ * obj ) { - dprintf_region(stddeb, "DeleteRegion: %04x\n", hrgn ); + dprintf_info(region, "DeleteRegion: %04x\n", hrgn ); REGION_DestroyWineRegion( obj->rgn ); return GDI_FreeObject( hrgn ); @@ -198,7 +197,7 @@ INT32 WINAPI OffsetRgn32( HRGN32 hrgn, INT32 x, INT32 y ) int nbox = obj->rgn->numRects; RECT32 *pbox = obj->rgn->rects; - dprintf_region(stddeb, "OffsetRgn: %04x %d,%d\n", hrgn, x, y ); + dprintf_info(region, "OffsetRgn: %04x %d,%d\n", hrgn, x, y ); if(nbox && (x || y)) { while(nbox--) { pbox->left += x; @@ -240,7 +239,7 @@ INT32 WINAPI GetRgnBox32( HRGN32 hrgn, LPRECT32 rect ) if (obj) { INT32 ret; - dprintf_region(stddeb, "GetRgnBox: %04x\n", hrgn ); + dprintf_info(region, "GetRgnBox: %04x\n", hrgn ); rect->left = obj->rgn->extents.left; rect->top = obj->rgn->extents.top; rect->right = obj->rgn->extents.right; @@ -271,7 +270,7 @@ HRGN32 WINAPI CreateRectRgn32(INT32 left, INT32 top, INT32 right, INT32 bottom) if (!(hrgn = REGION_CreateRegion())) return 0; - dprintf_region(stddeb, "CreateRectRgn: "); + dprintf_info(region, "CreateRectRgn: \n"); SetRectRgn32(hrgn, left, top, right, bottom); return hrgn; } @@ -312,7 +311,7 @@ VOID WINAPI SetRectRgn32( HRGN32 hrgn, INT32 left, INT32 top, { RGNOBJ * obj; - dprintf_region(stddeb, "SetRectRgn: %04x %d,%d-%d,%d\n", + dprintf_info(region, "SetRectRgn: %04x %d,%d-%d,%d\n", hrgn, left, top, right, bottom ); if (!(obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) return; @@ -365,7 +364,7 @@ HRGN32 WINAPI CreateRoundRectRgn32( INT32 left, INT32 top, if (!(hrgn = REGION_CreateRegion())) return 0; obj = (RGNOBJ *) GDI_HEAP_LOCK( hrgn ); - dprintf_region(stddeb,"CreateRoundRectRgn(%d,%d-%d,%d %dx%d): ret=%04x\n", + dprintf_info(region,"CreateRoundRectRgn(%d,%d-%d,%d %dx%d): ret=%04x\n", left, top, right, bottom, ellipse_width, ellipse_height, hrgn ); /* Check parameters */ @@ -496,7 +495,7 @@ DWORD WINAPI GetRegionData(HRGN32 hrgn, DWORD count, LPRGNDATA rgndata) DWORD size; RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); - dprintf_region(stddeb, "GetRegionData: %04x count = %ld, rgndata = %p\n", + dprintf_info(region, "GetRegionData: %04x count = %ld, rgndata = %p\n", hrgn, count, rgndata); if(!obj) return 0; @@ -533,7 +532,7 @@ HRGN32 WINAPI ExtCreateRegion( XFORM *lpXform, DWORD dwCount, RGNDATA *rgndata) RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); RECT32 *pCurRect, *pEndRect; - dprintf_region(stddeb, "ExtCreateRegion: %p %ld %p. Returning %04x\n", + dprintf_info(region, "ExtCreateRegion: %p %ld %p. Returning %04x\n", lpXform, dwCount, rgndata, hrgn); if(!hrgn) { @@ -774,7 +773,7 @@ BOOL32 REGION_LPTODP( HDC32 hdc, HRGN32 hDest, HRGN32 hSrc ) DC * dc = DC_GetDCPtr( hdc ); RECT32 tmpRect; - dprintf_region( stddeb, "REGION_LPTODP: hdc=%04x dest=%04x src=%04x\n", + dprintf_info(region, "REGION_LPTODP: hdc=%04x dest=%04x src=%04x\n", hdc, hDest, hSrc) ; if (dc->w.MapMode == MM_TEXT) /* Requires only a translation */ @@ -829,7 +828,7 @@ INT32 WINAPI CombineRgn32(HRGN32 hDest, HRGN32 hSrc1, HRGN32 hSrc2, INT32 mode) RGNOBJ *destObj = (RGNOBJ *) GDI_GetObjPtr( hDest, REGION_MAGIC); INT32 result = ERROR; - dprintf_region(stddeb, "CombineRgn: %04x,%04x -> %04x mode=%x\n", + dprintf_info(region, "CombineRgn: %04x,%04x -> %04x mode=%x\n", hSrc1, hSrc2, hDest, mode ); if (destObj) { @@ -837,8 +836,9 @@ INT32 WINAPI CombineRgn32(HRGN32 hDest, HRGN32 hSrc1, HRGN32 hSrc2, INT32 mode) if (src1Obj) { - dprintf_region(stddeb, "src1:\n"); - if(debugging_region) REGION_DumpRegion(src1Obj->rgn); + dprintf_info(region, "src1:\n"); + if(debugging_info(region)) + REGION_DumpRegion(src1Obj->rgn); if (mode == RGN_COPY) { REGION_CopyRegion( destObj->rgn, src1Obj->rgn ); @@ -850,8 +850,9 @@ INT32 WINAPI CombineRgn32(HRGN32 hDest, HRGN32 hSrc1, HRGN32 hSrc2, INT32 mode) if (src2Obj) { - dprintf_region(stddeb, "src2:\n"); - if(debugging_region) REGION_DumpRegion(src2Obj->rgn); + dprintf_info(region, "src2:\n"); + if(debugging_info(region)) + REGION_DumpRegion(src2Obj->rgn); switch (mode) { case RGN_AND: @@ -873,8 +874,9 @@ INT32 WINAPI CombineRgn32(HRGN32 hDest, HRGN32 hSrc1, HRGN32 hSrc2, INT32 mode) } GDI_HEAP_UNLOCK( hSrc1 ); } - dprintf_region(stddeb, "dest:\n"); - if(debugging_region) REGION_DumpRegion(destObj->rgn); + dprintf_info(region, "dest:\n"); + if(debugging_info(region)) + REGION_DumpRegion(destObj->rgn); GDI_HEAP_UNLOCK( hDest ); } diff --git a/objects/text.c b/objects/text.c index 60ec10cbd9c..87cab6d6ca1 100644 --- a/objects/text.c +++ b/objects/text.c @@ -10,8 +10,6 @@ #include "dc.h" #include "gdi.h" #include "heap.h" -#include "stddebug.h" -/* #define DEBUG_TEXT */ #include "debug.h" #include "cache.h" @@ -200,7 +198,7 @@ INT16 WINAPI DrawText16( HDC16 hdc, LPCSTR str, INT16 i_count, int width = rect->right - rect->left; int max_width = 0; - dprintf_text(stddeb,"DrawText: '%s', %d , [(%d,%d),(%d,%d)]\n", str, + dprintf_info(text,"DrawText: '%s', %d , [(%d,%d),(%d,%d)]\n", str, count, rect->left, rect->top, rect->right, rect->bottom); if (count == -1) count = strlen(str); @@ -638,7 +636,7 @@ LONG WINAPI TabbedTextOut16( HDC16 hdc, INT16 x, INT16 y, LPCSTR lpstr, INT16 count, INT16 cTabStops, const INT16 *lpTabPos, INT16 nTabOrg ) { - dprintf_text( stddeb, "TabbedTextOut16: %04x %d,%d '%.*s' %d\n", + dprintf_info(text, "TabbedTextOut16: %04x %d,%d '%.*s' %d\n", hdc, x, y, count, lpstr, count ); return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops, lpTabPos, NULL, nTabOrg, TRUE ); @@ -652,7 +650,7 @@ LONG WINAPI TabbedTextOut32A( HDC32 hdc, INT32 x, INT32 y, LPCSTR lpstr, INT32 count, INT32 cTabStops, const INT32 *lpTabPos, INT32 nTabOrg ) { - dprintf_text( stddeb, "TabbedTextOut32A: %04x %d,%d '%.*s' %d\n", + dprintf_info(text, "TabbedTextOut32A: %04x %d,%d '%.*s' %d\n", hdc, x, y, count, lpstr, count ); return TEXT_TabbedTextOut( hdc, x, y, lpstr, count, cTabStops, NULL, lpTabPos, nTabOrg, TRUE ); @@ -682,7 +680,7 @@ LONG WINAPI TabbedTextOut32W( HDC32 hdc, INT32 x, INT32 y, LPCWSTR str, DWORD WINAPI GetTabbedTextExtent16( HDC16 hdc, LPCSTR lpstr, INT16 count, INT16 cTabStops, const INT16 *lpTabPos ) { - dprintf_text( stddeb, "GetTabbedTextExtent: %04x '%.*s' %d\n", + dprintf_info(text, "GetTabbedTextExtent: %04x '%.*s' %d\n", hdc, count, lpstr, count ); return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops, lpTabPos, NULL, 0, FALSE ); @@ -695,7 +693,7 @@ DWORD WINAPI GetTabbedTextExtent16( HDC16 hdc, LPCSTR lpstr, INT16 count, DWORD WINAPI GetTabbedTextExtent32A( HDC32 hdc, LPCSTR lpstr, INT32 count, INT32 cTabStops, const INT32 *lpTabPos ) { - dprintf_text( stddeb, "GetTabbedTextExtent: %04x '%.*s' %d\n", + dprintf_info(text, "GetTabbedTextExtent: %04x '%.*s' %d\n", hdc, count, lpstr, count ); return TEXT_TabbedTextOut( hdc, 0, 0, lpstr, count, cTabStops, NULL, lpTabPos, 0, FALSE ); diff --git a/ole/Makefile.in b/ole/Makefile.in index 1d923733de9..85e981a0993 100644 --- a/ole/Makefile.in +++ b/ole/Makefile.in @@ -13,7 +13,8 @@ C_SRCS = \ ole2disp.c \ ole2nls.c \ olecli.c \ - olesvr.c + olesvr.c \ + storage.c all: $(MODULE).o diff --git a/ole/compobj.c b/ole/compobj.c index ef476a962ae..0484f78f4fe 100644 --- a/ole/compobj.c +++ b/ole/compobj.c @@ -12,10 +12,12 @@ #include #include "ole.h" #include "ole2.h" -#include "stddebug.h" +#include "winerror.h" #include "debug.h" #include "file.h" #include "compobj.h" +#include "heap.h" +#include "ldt.h" #include "interfaces.h" #include "shlobj.h" #include "ddraw.h" @@ -23,27 +25,36 @@ #include "dinput.h" #include "d3d.h" -DWORD currentMalloc=0; +LPMALLOC16 currentMalloc16=NULL; +LPMALLOC32 currentMalloc32=NULL; /*********************************************************************** * CoBuildVersion [COMPOBJ.1] */ DWORD WINAPI CoBuildVersion() { - dprintf_ole(stddeb,"CoBuildVersion()\n"); - return (rmm<<16)+rup; + dprintf_info(ole,"CoBuildVersion()\n"); + return (rmm<<16)+rup; } /*********************************************************************** * CoInitialize [COMPOBJ.2] - * lpReserved is an IMalloc pointer in 16bit OLE. We just stored it as-is. + * lpReserved is an IMalloc pointer in 16bit OLE. */ -HRESULT WINAPI CoInitialize(DWORD lpReserved) +HRESULT WINAPI CoInitialize16(LPMALLOC16 lpReserved) { - dprintf_ole(stdnimp,"CoInitialize\n"); - /* remember the LPMALLOC, maybe somebody wants to read it later on */ - currentMalloc = lpReserved; - return S_OK; + currentMalloc16 = lpReserved; + return S_OK; +} + +/*********************************************************************** + * CoInitialize (OLE32.26) + * lpReserved is an IMalloc pointer in 32bit OLE. + */ +HRESULT WINAPI CoInitialize32(LPMALLOC32 lpReserved) +{ + currentMalloc32 = lpReserved; + return S_OK; } /*********************************************************************** @@ -51,22 +62,29 @@ HRESULT WINAPI CoInitialize(DWORD lpReserved) */ void WINAPI CoUnitialize() { - dprintf_ole(stdnimp,"CoUnitialize()\n"); + dprintf_info(ole,"CoUnitialize()\n"); } /*********************************************************************** * CoGetMalloc [COMPOBJ.4] */ -HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, DWORD * lpMalloc) +HRESULT WINAPI CoGetMalloc16(DWORD dwMemContext, LPMALLOC16 * lpMalloc) { - if(currentMalloc) - { - *lpMalloc = currentMalloc; - return S_OK; - } - *lpMalloc = 0; - /* 16-bit E_NOTIMPL */ - return 0x80000001L; + if(!currentMalloc16) + currentMalloc16 = IMalloc16_Constructor(); + *lpMalloc = currentMalloc16; + return S_OK; +} + +/*********************************************************************** + * CoGetMalloc (OLE32.4] + */ +HRESULT WINAPI CoGetMalloc32(DWORD dwMemContext, LPMALLOC32 *lpMalloc) +{ + if(!currentMalloc32) + currentMalloc32 = IMalloc32_Constructor(); + *lpMalloc = currentMalloc32; + return S_OK; } /*********************************************************************** @@ -74,8 +92,8 @@ HRESULT WINAPI CoGetMalloc(DWORD dwMemContext, DWORD * lpMalloc) */ OLESTATUS WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved ) { - dprintf_ole(stdnimp,"CoDisconnectObject:%p %lx\n",lpUnk,reserved); - return OLE_OK; + dprintf_info(ole,"CoDisconnectObject:%p %lx\n",lpUnk,reserved); + return S_OK; } /*********************************************************************** @@ -92,14 +110,14 @@ BOOL16 WINAPI IsEqualGUID(GUID* g1, GUID* g2) /* Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] */ -OLESTATUS WINAPI CLSIDFromString(const LPCSTR idstr, CLSID *id) +OLESTATUS WINAPI CLSIDFromString16(const LPCOLESTR16 idstr, CLSID *id) { BYTE *s = (BYTE *) idstr; BYTE *p; int i; BYTE table[256]; - dprintf_ole(stddeb,"ClsIDFromString() %s -> %p\n", idstr, id); + dprintf_info(ole,"ClsIDFromString() %s -> %p\n", idstr, id); /* quick lookup table */ memset(table, 0, 256); @@ -153,13 +171,25 @@ OLESTATUS WINAPI CLSIDFromString(const LPCSTR idstr, CLSID *id) s += 2; } - return OLE_OK; + return S_OK; +} + +/*********************************************************************** + * CLSIDFromString (OLE32.3) + */ +OLESTATUS WINAPI CLSIDFromString32(const LPCOLESTR32 idstr, CLSID *id) +{ + LPOLESTR16 xid = HEAP_strdupWtoA(GetProcessHeap(),0,idstr); + OLESTATUS ret = CLSIDFromString16(xid,id); + + HeapFree(GetProcessHeap(),0,xid); + return ret; } /*********************************************************************** * StringFromCLSID [COMPOBJ.19] */ -OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR idstr) +OLESTATUS WINAPI WINE_StringFromCLSID(const CLSID *id, LPSTR idstr) { static const char *hex = "0123456789ABCDEF"; char *s; @@ -183,16 +213,64 @@ OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR idstr) idstr[i] = toupper(idstr[i]); } - dprintf_ole(stddeb,"StringFromClsID: %p->%s\n", id, idstr); + dprintf_info(ole,"StringFromClsID: %p->%s\n", id, idstr); return OLE_OK; } +OLESTATUS WINAPI StringFromCLSID16(const CLSID *id, LPOLESTR16 *idstr) +{ + LPMALLOC16 mllc; + OLESTATUS ret; + DWORD args[2]; + + ret = CoGetMalloc16(0,&mllc); + if (ret) return ret; + + args[0] = (DWORD)mllc; + args[1] = 40; + + /* No need for a Callback entry, we have WOWCallback16Ex which does + * everything we need. + */ + if (!WOWCallback16Ex( + (FARPROC16)((LPMALLOC16_VTABLE)PTR_SEG_TO_LIN( + ((LPMALLOC16)PTR_SEG_TO_LIN(mllc))->lpvtbl) + )->fnAlloc, + WCB16_CDECL, + 2, + (LPVOID)args, + (LPDWORD)idstr + )) { + fprintf(stderr,"CallTo16 IMalloc16 failed\n"); + return E_FAIL; + } + return WINE_StringFromCLSID(id,PTR_SEG_TO_LIN(*idstr)); +} + +OLESTATUS WINAPI StringFromCLSID32(const CLSID *id, LPOLESTR32 *idstr) +{ + char buf[80]; + OLESTATUS ret; + LPMALLOC32 mllc; + + if ((ret=CoGetMalloc32(0,&mllc))) + return ret; + + ret=WINE_StringFromCLSID(id,buf); + if (!ret) { + *idstr = mllc->lpvtbl->fnAlloc(mllc,strlen(buf)*2+2); + lstrcpyAtoW(*idstr,buf); + } + return ret; +} + + /*********************************************************************** * CLSIDFromProgID [COMPOBJ.61] */ -OLESTATUS WINAPI CLSIDFromProgID(LPCSTR progid,LPCLSID riid) +OLESTATUS WINAPI CLSIDFromProgID16(LPCSTR progid,LPCLSID riid) { char *buf,buf2[80]; DWORD buf2len; @@ -212,7 +290,19 @@ OLESTATUS WINAPI CLSIDFromProgID(LPCSTR progid,LPCLSID riid) return OLE_ERROR_GENERIC; } RegCloseKey(xhkey); - return CLSIDFromString(buf2,riid); + return CLSIDFromString16(buf2,riid); +} + +/*********************************************************************** + * CLSIDFromProgID (OLE32.2) + */ +OLESTATUS WINAPI CLSIDFromProgID32(LPCOLESTR32 progid,LPCLSID riid) +{ + LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid); + OLESTATUS ret = CLSIDFromProgID16(pid,riid); + + HeapFree(GetProcessHeap(),0,pid); + return ret; } OLESTATUS WINAPI LookupETask(LPVOID p1,LPVOID p2) { @@ -228,13 +318,13 @@ OLESTATUS WINAPI CallObjectInWOW(LPVOID p1,LPVOID p2) { /*********************************************************************** * CoRegisterClassObject [COMPOBJ.5] */ -OLESTATUS WINAPI CoRegisterClassObject( +OLESTATUS WINAPI CoRegisterClassObject16( REFCLSID rclsid, LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags, LPDWORD lpdwRegister ) { char buf[80]; - StringFromCLSID(rclsid,buf); + WINE_StringFromCLSID(rclsid,buf); fprintf(stderr,"CoRegisterClassObject(%s,%p,0x%08lx,0x%08lx,%p),stub\n", buf,pUnk,dwClsContext,flags,lpdwRegister @@ -243,7 +333,24 @@ OLESTATUS WINAPI CoRegisterClassObject( } /*********************************************************************** - * CoRegisterClassObject [COMPOBJ.27] + * CoRegisterClassObject (OLE32.36) + */ +OLESTATUS WINAPI CoRegisterClassObject32( + REFCLSID rclsid, LPUNKNOWN pUnk,DWORD dwClsContext,DWORD flags, + LPDWORD lpdwRegister +) { + char buf[80]; + + WINE_StringFromCLSID(rclsid,buf); + + fprintf(stderr,"CoRegisterClassObject(%s,%p,0x%08lx,0x%08lx,%p),stub\n", + buf,pUnk,dwClsContext,flags,lpdwRegister + ); + return 0; +} + +/*********************************************************************** + * CoRegisterMessageFilter [COMPOBJ.27] */ OLESTATUS WINAPI CoRegisterMessageFilter16( LPMESSAGEFILTER lpMessageFilter,LPMESSAGEFILTER *lplpMessageFilter @@ -283,3 +390,34 @@ HRESULT WINAPI CoFileTimeNow(FILETIME *lpFileTime) DOSFS_UnixTimeToFileTime(time(NULL), lpFileTime, 0); return S_OK; } + +/*********************************************************************** + * CoTaskMemAlloc (OLE32.43) + */ +LPVOID WINAPI CoTaskMemAlloc(ULONG size) { + LPMALLOC32 lpmalloc; + HRESULT ret = CoGetMalloc32(0,&lpmalloc); + + if (ret) + return NULL; + return lpmalloc->lpvtbl->fnAlloc(lpmalloc,size); +} + +/*********************************************************************** + * CoTaskMemFree (OLE32.44) + */ +VOID WINAPI CoTaskMemFree(LPVOID ptr) { + LPMALLOC32 lpmalloc; + HRESULT ret = CoGetMalloc32(0,&lpmalloc); + + if (ret) return; + return lpmalloc->lpvtbl->fnFree(lpmalloc,ptr); +} + +/*********************************************************************** + * CoInitializeWOW (OLE32.27) + */ +HRESULT WINAPI CoInitializeWOW(DWORD x,DWORD y) { + fprintf(stderr,"CoInitializeWOW(0x%08lx,0x%08lx),stub!\n",x,y); + return 0; +} diff --git a/ole/folders.c b/ole/folders.c index 45d54662f71..7903e899f1d 100644 --- a/ole/folders.c +++ b/ole/folders.c @@ -9,7 +9,6 @@ #include #include "ole.h" #include "ole2.h" -#include "stddebug.h" #include "debug.h" #include "compobj.h" #include "interfaces.h" @@ -95,7 +94,7 @@ static HRESULT WINAPI IShellFolder_BindToObject( ) { char xclsid[50]; - StringFromCLSID(riid,xclsid); + WINE_StringFromCLSID(riid,xclsid); fprintf(stderr,"IShellFolder(%p)->BindToObject(%p,%p,%s,%p),stub!\n", this,pidl,pbcReserved,xclsid,ppvOut ); @@ -105,10 +104,10 @@ static HRESULT WINAPI IShellFolder_BindToObject( static HRESULT WINAPI IShellFolder_ParseDisplayName( LPSHELLFOLDER this,HWND32 hwndOwner,LPBC pbcReserved, - LPOLESTR lpszDisplayName,DWORD *pchEaten,LPITEMIDLIST *ppidl, + LPOLESTR32 lpszDisplayName,DWORD *pchEaten,LPITEMIDLIST *ppidl, DWORD *pdwAttributes ) { - fprintf(stderr,"IShellFolder(%p)->ParseDisplayName(%08x,%p,%s,%p,%p,%p),stub!\n", + fprintf(stderr,"IShellFolder(%p)->ParseDisplayName(%08x,%p,%p,%p,%p,%p),stub!\n", this,hwndOwner,pbcReserved,lpszDisplayName,pchEaten,ppidl,pdwAttributes ); *(DWORD*)pbcReserved = 0; @@ -131,7 +130,7 @@ static HRESULT WINAPI IShellFolder_CreateViewObject( ) { char xclsid[50]; - StringFromCLSID(riid,xclsid); + WINE_StringFromCLSID(riid,xclsid); fprintf(stderr,"IShellFolder(%p)->CreateViewObject(0x%04x,%s,%p),stub!\n", this,hwndOwner,xclsid,ppv ); diff --git a/ole/ifs.c b/ole/ifs.c index 958a0ae8e69..8e6147b1e8f 100644 --- a/ole/ifs.c +++ b/ole/ifs.c @@ -7,21 +7,28 @@ #include #include #include +#include #include "winerror.h" #include "ole.h" #include "ole2.h" +#include "ldt.h" +#include "heap.h" #include "compobj.h" #include "interfaces.h" #include "shlobj.h" -#include "stddebug.h" +#include "local.h" +#include "module.h" #include "debug.h" +/**************************************************************************** + * IUnknown + */ static ULONG WINAPI IUnknown_AddRef(LPUNKNOWN this) { - dprintf_relay(stddeb,"IUnknown(%p)->AddRef()\n",this); + dprintf_info(relay,"IUnknown(%p)->AddRef()\n",this); return ++(this->ref); } static ULONG WINAPI IUnknown_Release(LPUNKNOWN this) { - dprintf_relay(stddeb,"IUnknown(%p)->Release()\n",this); + dprintf_info(relay,"IUnknown(%p)->Release()\n",this); if (!--(this->ref)) { HeapFree(GetProcessHeap(),0,this); return 0; @@ -32,8 +39,8 @@ static ULONG WINAPI IUnknown_Release(LPUNKNOWN this) { static HRESULT WINAPI IUnknown_QueryInterface(LPUNKNOWN this,REFIID refiid,LPVOID *obj) { char xrefiid[50]; - StringFromCLSID((LPCLSID)refiid,xrefiid); - dprintf_relay(stddeb,"IUnknown(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IUnknown(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { *obj = this; @@ -53,28 +60,30 @@ LPUNKNOWN IUnknown_Constructor() { LPUNKNOWN unk; - fprintf(stderr,"cloning IUnknown.\n"); unk = (LPUNKNOWN)HeapAlloc(GetProcessHeap(),0,sizeof(IUnknown)); unk->lpvtbl = &uvt; unk->ref = 1; return unk; } -static ULONG WINAPI IMalloc_AddRef(LPMALLOC this) { - dprintf_relay(stddeb,"IMalloc(%p)->AddRef()\n",this); +/**************************************************************************** + * IMalloc16 + */ +ULONG WINAPI IMalloc16_AddRef(LPMALLOC16 this) { + dprintf_info(relay,"IMalloc16(%p)->AddRef()\n",this); return 1; /* cannot be freed */ } -static ULONG WINAPI IMalloc_Release(LPMALLOC this) { - dprintf_relay(stddeb,"IMalloc(%p)->Release()\n",this); +ULONG WINAPI IMalloc16_Release(LPMALLOC16 this) { + dprintf_info(relay,"IMalloc16(%p)->Release()\n",this); return 1; /* cannot be freed */ } -static HRESULT WINAPI IMalloc_QueryInterface(LPMALLOC this,REFIID refiid,LPVOID *obj) { +HRESULT WINAPI IMalloc16_QueryInterface(LPMALLOC16 this,REFIID refiid,LPVOID *obj) { char xrefiid[50]; - StringFromCLSID((LPCLSID)refiid,xrefiid); - dprintf_relay(stddeb,"IMalloc(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IMalloc16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) || !memcmp(&IID_IMalloc,refiid,sizeof(IID_IMalloc)) ) { @@ -84,53 +93,164 @@ static HRESULT WINAPI IMalloc_QueryInterface(LPMALLOC this,REFIID refiid,LPVOID return OLE_E_ENUM_NOMORE; } -static LPVOID WINAPI IMalloc_Alloc(LPMALLOC this,DWORD cb) { - dprintf_relay(stddeb,"IMalloc(%p)->Alloc(%ld)\n",this,cb); - return HeapAlloc(GetProcessHeap(),0,cb); +LPVOID WINAPI IMalloc16_Alloc(LPMALLOC16 this,DWORD cb) { + dprintf_info(relay,"IMalloc16(%p)->Alloc(%ld)\n",this,cb); + return (LPVOID)PTR_SEG_OFF_TO_SEGPTR(this->heap,LOCAL_Alloc(this->heap,0,cb)); } -static LPVOID WINAPI IMalloc_Realloc(LPMALLOC this,LPVOID pv,DWORD cb) { - dprintf_relay(stddeb,"IMalloc(%p)->Realloc(%p,%ld)\n",this,pv,cb); - return HeapReAlloc(GetProcessHeap(),0,pv,cb); +LPVOID WINAPI IMalloc16_Realloc(LPMALLOC16 this,LPVOID pv,DWORD cb) { + dprintf_info(relay,"IMalloc16(%p)->Realloc(%p,%ld)\n",this,pv,cb); + return (LPVOID)PTR_SEG_OFF_TO_SEGPTR(this->heap,LOCAL_ReAlloc(this->heap,0,LOWORD(pv),cb)); } -static VOID WINAPI IMalloc_Free(LPMALLOC this,LPVOID pv) { - dprintf_relay(stddeb,"IMalloc(%p)->Free(%p)\n",this,pv); - HeapFree(GetProcessHeap(),0,pv); +VOID WINAPI IMalloc16_Free(LPMALLOC16 this,LPVOID pv) { + dprintf_info(relay,"IMalloc16(%p)->Free(%p)\n",this,pv); + LOCAL_Free(this->heap,LOWORD(pv)); } -static DWORD WINAPI IMalloc_GetSize(LPMALLOC this,LPVOID pv) { - dprintf_relay(stddeb,"IMalloc(%p)->GetSize(%p)\n",this,pv); - return HeapSize(GetProcessHeap(),0,pv); +DWORD WINAPI IMalloc16_GetSize(LPMALLOC16 this,LPVOID pv) { + dprintf_info(relay,"IMalloc16(%p)->GetSize(%p)\n",this,pv); + return LOCAL_Size(this->heap,LOWORD(pv)); } -static LPINT32 WINAPI IMalloc_DidAlloc(LPMALLOC this,LPVOID pv) { - dprintf_relay(stddeb,"IMalloc(%p)->DidAlloc(%p)\n",this,pv); - return (LPINT32)0xffffffff; +INT16 WINAPI IMalloc16_DidAlloc(LPMALLOC16 this,LPVOID pv) { + dprintf_info(relay,"IMalloc16(%p)->DidAlloc(%p)\n",this,pv); + return (INT16)-1; } -static LPVOID WINAPI IMalloc_HeapMinimize(LPMALLOC this) { - dprintf_relay(stddeb,"IMalloc(%p)->HeapMinimize()\n",this); +LPVOID WINAPI IMalloc16_HeapMinimize(LPMALLOC16 this) { + dprintf_info(relay,"IMalloc16(%p)->HeapMinimize()\n",this); return NULL; } -static IMalloc_VTable VT_IMalloc = { - IMalloc_QueryInterface, - IMalloc_AddRef, - IMalloc_Release, - IMalloc_Alloc, - IMalloc_Realloc, - IMalloc_Free, - IMalloc_GetSize, - IMalloc_DidAlloc, - IMalloc_HeapMinimize, +static IMalloc16_VTable mvt16 = { + IMalloc16_QueryInterface, + IMalloc16_AddRef, + IMalloc16_Release, + IMalloc16_Alloc, + IMalloc16_Realloc, + IMalloc16_Free, + IMalloc16_GetSize, + IMalloc16_DidAlloc, + IMalloc16_HeapMinimize, +}; +static IMalloc16_VTable *msegvt16 = NULL; + +LPMALLOC16 +IMalloc16_Constructor() { + LPMALLOC16 this; + + this = (LPMALLOC16)SEGPTR_NEW(IMalloc16); + if (__winelib) { + this->lpvtbl = &mvt16; + } else { + HMODULE16 hcomp = GetModuleHandle16("COMPOBJ"); + if (!msegvt16) { + msegvt16 = SEGPTR_NEW(IMalloc16_VTable); +#define FN(x) this->lpvtbl->fn##x = (void*)WIN32_GetProcAddress16(hcomp,"IMalloc16_"#x);assert(this->lpvtbl->fn##x); + FN(QueryInterface) + FN(AddRef) + FN(Release) + FN(Alloc) + FN(Realloc) + FN(Free) + FN(GetSize) + FN(DidAlloc) + FN(HeapMinimize) + msegvt16 = (LPMALLOC16_VTABLE)SEGPTR_GET(msegvt16); +#undef FN + } + this->lpvtbl = msegvt16; + } + this->ref = 1; + /* FIXME: implement multiple heaps */ + this->heap = GlobalAlloc16(GMEM_MOVEABLE,64000); + LocalInit(this->heap,0,64000); + return (LPMALLOC16)SEGPTR_GET(this); +} + +/**************************************************************************** + * IMalloc32 + */ +static ULONG WINAPI IMalloc32_AddRef(LPMALLOC32 this) { + dprintf_info(relay,"IMalloc32(%p)->AddRef()\n",this); + return 1; /* cannot be freed */ +} + +static ULONG WINAPI IMalloc32_Release(LPMALLOC32 this) { + dprintf_info(relay,"IMalloc32(%p)->Release()\n",this); + return 1; /* cannot be freed */ +} + +static HRESULT WINAPI IMalloc32_QueryInterface(LPMALLOC32 this,REFIID refiid,LPVOID *obj) { + char xrefiid[50]; + + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IMalloc32(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) || + !memcmp(&IID_IMalloc,refiid,sizeof(IID_IMalloc)) + ) { + *obj = this; + return 0; + } + return OLE_E_ENUM_NOMORE; +} + +static LPVOID WINAPI IMalloc32_Alloc(LPMALLOC32 this,DWORD cb) { + dprintf_info(relay,"IMalloc32(%p)->Alloc(%ld)\n",this,cb); + return HeapAlloc(GetProcessHeap(),0,cb); +} + +static LPVOID WINAPI IMalloc32_Realloc(LPMALLOC32 this,LPVOID pv,DWORD cb) { + dprintf_info(relay,"IMalloc32(%p)->Realloc(%p,%ld)\n",this,pv,cb); + return HeapReAlloc(GetProcessHeap(),0,pv,cb); +} +static VOID WINAPI IMalloc32_Free(LPMALLOC32 this,LPVOID pv) { + dprintf_info(relay,"IMalloc32(%p)->Free(%p)\n",this,pv); + HeapFree(GetProcessHeap(),0,pv); +} + +static DWORD WINAPI IMalloc32_GetSize(LPMALLOC32 this,LPVOID pv) { + dprintf_info(relay,"IMalloc32(%p)->GetSize(%p)\n",this,pv); + return HeapSize(GetProcessHeap(),0,pv); +} + +static INT32 WINAPI IMalloc32_DidAlloc(LPMALLOC32 this,LPVOID pv) { + dprintf_info(relay,"IMalloc32(%p)->DidAlloc(%p)\n",this,pv); + return -1; +} +static LPVOID WINAPI IMalloc32_HeapMinimize(LPMALLOC32 this) { + dprintf_info(relay,"IMalloc32(%p)->HeapMinimize()\n",this); + return NULL; +} + +static IMalloc32_VTable VT_IMalloc32 = { + IMalloc32_QueryInterface, + IMalloc32_AddRef, + IMalloc32_Release, + IMalloc32_Alloc, + IMalloc32_Realloc, + IMalloc32_Free, + IMalloc32_GetSize, + IMalloc32_DidAlloc, + IMalloc32_HeapMinimize, }; -LPMALLOC -IMalloc_Constructor() { - LPMALLOC this; +LPMALLOC32 +IMalloc32_Constructor() { + LPMALLOC32 this; - fprintf(stderr,"cloning IMalloc\n"); - this = (LPMALLOC)HeapAlloc(GetProcessHeap(),0,sizeof(IMalloc)); - this->lpvtbl = &VT_IMalloc; + this = (LPMALLOC32)HeapAlloc(GetProcessHeap(),0,sizeof(IMalloc32)); + this->lpvtbl = &VT_IMalloc32; this->ref = 1; return this; } +/**************************************************************************** + * API Functions + */ +BOOL32 WINAPI IsValidInterface32(LPUNKNOWN punk) { + return !( + IsBadReadPtr32(punk,4) || + IsBadReadPtr32(punk->lpvtbl,4) || + IsBadReadPtr32(punk->lpvtbl->fnQueryInterface,9) || + IsBadCodePtr32(punk->lpvtbl->fnQueryInterface) + ); +} diff --git a/ole/ole2.c b/ole/ole2.c index 565b0a6bf43..8171ac4a7bf 100644 --- a/ole/ole2.c +++ b/ole/ole2.c @@ -9,7 +9,7 @@ #include "windows.h" #include "ole2.h" -#include "stddebug.h" +#include "process.h" #include "debug.h" /*********************************************************************** @@ -17,7 +17,7 @@ */ DWORD WINAPI OleBuildVersion() { - dprintf_ole(stddeb,"OleBuildVersion()\n"); + dprintf_info(ole,"OleBuildVersion()\n"); return (rmm<<16)+rup; } @@ -26,8 +26,12 @@ DWORD WINAPI OleBuildVersion() */ HRESULT WINAPI OleInitialize(LPVOID reserved) { - dprintf_ole(stdnimp,"OleInitialize\n"); - return S_OK; + dprintf_fixme(ole,"OleInitialize - stub\n"); + return S_OK; +} + +DWORD WINAPI CoGetCurrentProcess() { + return PROCESS_Current(); } /*********************************************************************** @@ -35,7 +39,7 @@ HRESULT WINAPI OleInitialize(LPVOID reserved) */ void WINAPI OleUninitialize(void) { - dprintf_ole(stdnimp,"OleUninitialize()\n"); + dprintf_fixme(ole,"OleUninitialize() - stub\n"); } /*********************************************************************** @@ -53,9 +57,17 @@ HRESULT WINAPI CoRegisterMessageFilter32( LPMESSAGEFILTER lpMessageFilter, /* Pointer to interface */ LPMESSAGEFILTER *lplpMessageFilter /* Indirect pointer to prior instance if non-NULL */ ) { - dprintf_ole(stdnimp,"CoRegisterMessageFilter()\n"); + dprintf_fixme(ole,"CoRegisterMessageFilter() - stub\n"); if (lplpMessageFilter) { *lplpMessageFilter = NULL; } return S_OK; } + +/*********************************************************************** + * OleInitializeWOW (OLE32.27) + */ +HRESULT WINAPI OleInitializeWOW(DWORD x) { + fprintf(stderr,"OleInitializeWOW(0x%08lx),stub!\n",x); + return 0; +} diff --git a/ole/ole2disp.c b/ole/ole2disp.c index 405ce660857..e07538f80c4 100644 --- a/ole/ole2disp.c +++ b/ole/ole2disp.c @@ -10,7 +10,6 @@ #include "interfaces.h" #include "heap.h" #include "ldt.h" -#include "stddebug.h" #include "debug.h" /* This implementation of the BSTR API is 16-bit only. It @@ -104,7 +103,7 @@ OLESTATUS WINAPI RegisterActiveObject( IUnknown * punk,REFCLSID rclsid,DWORD dwFlags, DWORD * pdwRegister ) { char buf[80]; - StringFromCLSID(rclsid,buf); + WINE_StringFromCLSID(rclsid,buf); fprintf(stderr,"RegisterActiveObject(%p,%s,0x%08lx,%p),stub\n",punk,buf,dwFlags,pdwRegister); return 0; } diff --git a/ole/ole2nls.c b/ole/ole2nls.c index 477927bb9e0..b61c78ddd69 100644 --- a/ole/ole2nls.c +++ b/ole/ole2nls.c @@ -2,10 +2,12 @@ * OLE2NLS library * * Copyright 1995 Martin von Loewis + * Copyright 1998 David Lee Lambert */ #include #include +#include #include #include "windows.h" #include "heap.h" @@ -14,7 +16,6 @@ #include "winnls.h" #include "winreg.h" #include "winerror.h" -#include "stddebug.h" #include "debug.h" /* Locale name to id map. used by EnumSystemLocales, GetLocalInfoA @@ -261,7 +262,7 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len) char *retString; int found,i; - dprintf_ole(stddeb,"GetLocaleInfo32A(%8lX,%8lX,%p,%4X)\n", + dprintf_info(ole,"GetLocaleInfo32A(%8lX,%8lX,%p,%4X)\n", lcid,LCType,buf,len); LCType &= ~(LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP); @@ -530,13 +531,13 @@ LOCVAL(LOCALE_INEGSEPBYSPACE, "0") LOCVAL(LOCALE_ILANGUAGE,"9") LOCVAL(LOCALE_SLANGUAGE,"English") LOCVAL(LOCALE_SENGLANGUAGE,"English") -LOCVAL(LOCALE_SABBREVLANGNAME,"enu") +LOCVAL(LOCALE_SABBREVLANGNAME,"en") LOCVAL(LOCALE_SNATIVELANGNAME,"English") LOCVAL(LOCALE_ICOUNTRY,"11") -LOCVAL(LOCALE_SCOUNTRY,"Deutschland") -LOCVAL(LOCALE_SENGCOUNTRY,"Deutschland") -LOCVAL(LOCALE_SABBREVCTRYNAME,"De") -LOCVAL(LOCALE_SNATIVECTRYNAME,"Deutschland") +LOCVAL(LOCALE_SCOUNTRY,"United States") +LOCVAL(LOCALE_SENGCOUNTRY,"United States") +LOCVAL(LOCALE_SABBREVCTRYNAME,"US") +LOCVAL(LOCALE_SNATIVECTRYNAME,"United States") LOCVAL(LOCALE_IDEFAULTLANGUAGE,"9") LOCVAL(LOCALE_IDEFAULTCOUNTRY,"49") LOCVAL(LOCALE_IDEFAULTCODEPAGE,"437") @@ -545,8 +546,8 @@ LOCVAL(LOCALE_IDEFAULTANSICODEPAGE) */ LOCVAL(LOCALE_SLIST,";") LOCVAL(LOCALE_IMEASURE,"0") -LOCVAL(LOCALE_SDECIMAL,",") -LOCVAL(LOCALE_STHOUSAND,".") +LOCVAL(LOCALE_SDECIMAL,".") +LOCVAL(LOCALE_STHOUSAND,",") LOCVAL(LOCALE_SGROUPING, "3;0") LOCVAL(LOCALE_IDIGITS,"2") LOCVAL(LOCALE_ILZERO,"1") @@ -566,7 +567,7 @@ LOCVAL(LOCALE_ICURRENCY,"3") LOCVAL(LOCALE_INEGCURR,"8") LOCVAL(LOCALE_SDATE,".") LOCVAL(LOCALE_STIME,":") -LOCVAL(LOCALE_SSHORTDATE,"dd.MM.yyyy") +LOCVAL(LOCALE_SSHORTDATE,"MM/dd/yy") LOCVAL(LOCALE_SLONGDATE,"ddd, d. MMMM yyyy") LOCVAL(LOCALE_STIMEFORMAT, "h:mm:ss tt") LOCVAL(LOCALE_IDATE,"1") @@ -591,49 +592,49 @@ LOCVAL(LOCALE_IOPTIONALCALENDAR) LOCVAL(LOCALE_IFIRSTDAYOFWEEK) LOCVAL(LOCALE_IFIRSTWEEKOFYEAR) */ -LOCVAL(LOCALE_SDAYNAME1,"Montag") -LOCVAL(LOCALE_SDAYNAME2,"Dienstag") -LOCVAL(LOCALE_SDAYNAME3,"Mittwoch") -LOCVAL(LOCALE_SDAYNAME4,"Donnerstag") -LOCVAL(LOCALE_SDAYNAME5,"Freitag") -LOCVAL(LOCALE_SDAYNAME6,"Sonnabend") -LOCVAL(LOCALE_SDAYNAME7,"Sonntag") -LOCVAL(LOCALE_SABBREVDAYNAME1,"Mo") -LOCVAL(LOCALE_SABBREVDAYNAME2,"Di") -LOCVAL(LOCALE_SABBREVDAYNAME3,"Mi") -LOCVAL(LOCALE_SABBREVDAYNAME4,"Do") -LOCVAL(LOCALE_SABBREVDAYNAME5,"Fr") -LOCVAL(LOCALE_SABBREVDAYNAME6,"Sa") -LOCVAL(LOCALE_SABBREVDAYNAME7,"So") -LOCVAL(LOCALE_SMONTHNAME1,"Januar") -LOCVAL(LOCALE_SMONTHNAME2,"Februar") -LOCVAL(LOCALE_SMONTHNAME3,"März") +LOCVAL(LOCALE_SDAYNAME1,"Monday") +LOCVAL(LOCALE_SDAYNAME2,"Tuesday") +LOCVAL(LOCALE_SDAYNAME3,"Wednesday") +LOCVAL(LOCALE_SDAYNAME4,"Thursday") +LOCVAL(LOCALE_SDAYNAME5,"Friday") +LOCVAL(LOCALE_SDAYNAME6,"Saturday") +LOCVAL(LOCALE_SDAYNAME7,"Sunday") +LOCVAL(LOCALE_SABBREVDAYNAME1,"Mon") +LOCVAL(LOCALE_SABBREVDAYNAME2,"Tue") +LOCVAL(LOCALE_SABBREVDAYNAME3,"Wed") +LOCVAL(LOCALE_SABBREVDAYNAME4,"Thu") +LOCVAL(LOCALE_SABBREVDAYNAME5,"Fri") +LOCVAL(LOCALE_SABBREVDAYNAME6,"Sat") +LOCVAL(LOCALE_SABBREVDAYNAME7,"Sun") +LOCVAL(LOCALE_SMONTHNAME1,"January") +LOCVAL(LOCALE_SMONTHNAME2,"February") +LOCVAL(LOCALE_SMONTHNAME3,"March") LOCVAL(LOCALE_SMONTHNAME4,"April") -LOCVAL(LOCALE_SMONTHNAME5,"Mai") -LOCVAL(LOCALE_SMONTHNAME6,"Juni") -LOCVAL(LOCALE_SMONTHNAME7,"Juli") +LOCVAL(LOCALE_SMONTHNAME5,"May") +LOCVAL(LOCALE_SMONTHNAME6,"June") +LOCVAL(LOCALE_SMONTHNAME7,"July") LOCVAL(LOCALE_SMONTHNAME8,"August") LOCVAL(LOCALE_SMONTHNAME9,"September") -LOCVAL(LOCALE_SMONTHNAME10,"Oktober") +LOCVAL(LOCALE_SMONTHNAME10,"October") LOCVAL(LOCALE_SMONTHNAME11,"November") -LOCVAL(LOCALE_SMONTHNAME12,"Dezember") +LOCVAL(LOCALE_SMONTHNAME12,"December") LOCVAL(LOCALE_SMONTHNAME13,"") LOCVAL(LOCALE_SABBREVMONTHNAME1,"Jan") LOCVAL(LOCALE_SABBREVMONTHNAME2,"Feb") -LOCVAL(LOCALE_SABBREVMONTHNAME3,"Mär") +LOCVAL(LOCALE_SABBREVMONTHNAME3,"Mar") LOCVAL(LOCALE_SABBREVMONTHNAME4,"Apr") -LOCVAL(LOCALE_SABBREVMONTHNAME5,"Mai") +LOCVAL(LOCALE_SABBREVMONTHNAME5,"May") LOCVAL(LOCALE_SABBREVMONTHNAME6,"Jun") LOCVAL(LOCALE_SABBREVMONTHNAME7,"Jul") LOCVAL(LOCALE_SABBREVMONTHNAME8,"Aug") LOCVAL(LOCALE_SABBREVMONTHNAME9,"Sep") -LOCVAL(LOCALE_SABBREVMONTHNAME10,"Okt") +LOCVAL(LOCALE_SABBREVMONTHNAME10,"Oct") LOCVAL(LOCALE_SABBREVMONTHNAME11,"Nov") -LOCVAL(LOCALE_SABBREVMONTHNAME12,"Dez") +LOCVAL(LOCALE_SABBREVMONTHNAME12,"Dec") LOCVAL(LOCALE_SABBREVMONTHNAME13,"") +LOCVAL(LOCALE_SPOSITIVESIGN,"") +LOCVAL(LOCALE_SNEGATIVESIGN,"-") /* -LOCVAL(LOCALE_SPOSITIVESIGN) -LOCVAL(LOCALE_SNEGATIVESIGN) LOCVAL(LOCALE_IPOSSIGNPOSN) LOCVAL(LOCALE_INEGSIGNPOSN) LOCVAL(LOCALE_IPOSSYMPRECEDES) @@ -1908,7 +1909,7 @@ BOOL32 WINAPI EnumSystemLocales32W( LOCALE_ENUMPROC32W lpfnLocaleEnum, WCHAR buffer[200]; HKEY xhkey; - dprintf_win32(stddeb,"EnumSystemLocales32W(%p,%08lx)\n", + dprintf_info(win32,"EnumSystemLocales32W(%p,%08lx)\n", lpfnLocaleEnum,flags ); /* see if we can reuse the Win95 registry entries.... */ if (ERROR_SUCCESS==RegOpenKey32A(HKEY_LOCAL_MACHINE,"\\System\\CurrentControlSet\\control\\Nls\\Locale\\",&xhkey)) { @@ -1951,7 +1952,7 @@ BOOL32 WINAPI EnumSystemLocales32A(LOCALE_ENUMPROC32A lpfnLocaleEnum, CHAR buffer[200]; HKEY xhkey; - dprintf_win32(stddeb,"EnumSystemLocales32A(%p,%08lx)\n", + dprintf_info(win32,"EnumSystemLocales32A(%p,%08lx)\n", lpfnLocaleEnum,flags ); if (ERROR_SUCCESS==RegOpenKey32A(HKEY_LOCAL_MACHINE,"\\System\\CurrentControlSet\\control\\Nls\\Locale\\",&xhkey)) { @@ -2081,7 +2082,7 @@ DWORD WINAPI VerLanguageName16(UINT16 langid,LPSTR langname,UINT16 langnamelen) int i; char *buf; - dprintf_ver(stddeb,"VerLanguageName(%d,%p,%d)\n",langid,langname,langnamelen); + dprintf_info(ver,"VerLanguageName(%d,%p,%d)\n",langid,langname,langnamelen); /* First, check \System\CurrentControlSet\control\Nls\Locale\ * from the registry. */ @@ -2140,7 +2141,7 @@ INT32 WINAPI LCMapString32A( ) { int i,len; - dprintf_string(stderr,"LCMapStringA(0x%04lx,0x%08lx,%s,%d,%p,%d)\n", + dprintf_info(string,"LCMapStringA(0x%04lx,0x%08lx,%s,%d,%p,%d)\n", lcid,mapflags,srcstr,srclen,dststr,dstlen); if (!dstlen || !dststr) { dststr = (LPSTR)srcstr; @@ -2178,7 +2179,7 @@ INT32 WINAPI LCMapString32W( ) { int i,len; - dprintf_string(stderr,"LCMapStringW(0x%04lx,0x%08lx,%p,%d,%p,%d)\n", + dprintf_info(string,"LCMapStringW(0x%04lx,0x%08lx,%p,%d,%p,%d)\n", lcid,mapflags,srcstr,srclen,dststr,dstlen ); if (!dstlen || !dststr) { @@ -2209,23 +2210,253 @@ INT32 WINAPI LCMapString32W( return len; } +/* FIXME: these shouldn't be needed */ + +static char *any_locale_days[] = +{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; + +static char *any_locale_months[] = +{"zero", "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + +typedef struct { + int inpos; /* place in the input buffer */ + int outpos; /* place in the output buffer */ + int count; + int inquote; + char type; + } PARSING_STATE; + +/***************************************************************** + * + * GetDateFormat() + + This function uses format to format the date, or, if format + is NULL, uses the default for the locale. format is a string + of literal fields and characters as follows: + + d single-digit (no leading zero) day (of month) + dd two-digit day (of month) + ddd short day-of-week name + dddd long day-of-week name + M single-digit month + MM two-digit month + MMM short month name + MMMM full month name + y two-digit year, no leading 0 + yy two-digit year + yyyy four-digit year + gg era string + + * ***********************/ INT32 WINAPI GetDateFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime, - LPCSTR format, LPSTR date,INT32 datelen -) { - fprintf(stderr,"GetDateFormat(0x%04lx,0x%08lx,%p,%s,%p,%d), stub\n", - locale,flags,xtime,format,date,datelen - ); - lstrcpyn32A(date,"1.4.1997",datelen); - return strlen("1.4.1997"); + LPCSTR format, LPSTR date,INT32 datelen) +{ + PARSING_STATE state; + char buf[40]; + int buflen; + LPCSTR thisformat; + + dprintf_info(ole,"GetDateFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n", + locale,flags,xtime,format,date,datelen); + + /* FIXME: Get the default for this locale */ + if (format) { + thisformat = format; + } else { + thisformat = "yyyy-MM-dd (ddd) "; + }; + + + /* initialize state variables */ + state.inpos = state.outpos = 0; + state.count = state.inquote = 0; + state.type = '\0'; + /* initialise output buffer */ + date[0] = '\0'; + + for (state.inpos = 0; thisformat[state.inpos] ; state.inpos++) { + if (state.inquote) { + if (thisformat[state.inpos] == '\'') { + state.inquote = 0; + continue; + } else { + date[state.outpos++] = thisformat[state.inpos]; + }; + } else if ( (state.count && (thisformat[state.inpos] != state.type)) + || state.count == 4 + || (state.count == 2 && state.type == 'g' ) ) + { + /* end of a format-type string */ + if (state.type == 'd') { + if (state.count == 1) { + sprintf(buf, "%d", xtime->wDay); + } else if (state.count == 2) { + sprintf(buf, "%02d", xtime->wDay); + } else if (state.count == 3) { + /* day of week, short */ + /* FIXME: This is the way to do it everywhere */ + if (locale) { + + GetLocaleInfo32A(locale, + LOCALE_SABBREVDAYNAME1 + + xtime->wDayOfWeek - 1, + buf, sizeof(buf)); + } else { + strcpy(buf, + any_locale_days[xtime->wDayOfWeek -1]); + }; + } else if (state.count == 4) { + /* day of week, long */ + + /* FIXME: get the days from the locale */ + /* FIXME: these should be long days */ + sprintf(buf, "%.*s", (int) sizeof(buf), + any_locale_days[xtime->wDayOfWeek]); + } else { + dprintf_info(ole, + "GetDateFormat(): unbekannt format, \ +c=%c, n=%d\n", + state.type, state.count); + }; + } else if (state.type == 'M') { + if (state.count == 1) { + sprintf(buf, "%d", xtime->wMonth); + } else if (state.count == 2) { + sprintf(buf, "%02d", xtime->wMonth); + } else if (state.count == 3) { + /* FIXME: get the month-name from the locale */ + sprintf(buf, "%.*s", (int) sizeof(buf), + any_locale_months[xtime->wMonth]); + } else if (state.count == 4) { + /* FIXME: get the month-name from the locale */ + /* FIXME: should return a long month */ + sprintf(buf, "%.*s", (int) sizeof(buf), + any_locale_months[xtime->wMonth]); + } else { + dprintf_info(ole, + "GetDateFormat(): unbekannt format, c=%c, n=%d\n", + state.type, state.count); + }; + } else if (state.type == 'y') { + if (state.count == 1) { + sprintf(buf, "%d", xtime->wYear % 100); + } else if (state.count == 2) { + sprintf(buf, "02%d", xtime->wYear % 100); + } else if (state.count == 4) { + sprintf(buf, "%d", xtime->wYear); + } else { + dprintf_info(ole, + "GetDateFormat(): unbekannt format, c=%c, n=%d\n", + state.type, state.count); + }; + } else if (state.type == 'g') { + if (state.count == 2) { + /* FIXME: Get era from the locale */ + strcpy(buf, "AD (CE)"); + } else { + dprintf_info(ole, + "GetDateFormat(): unbekannt format, c=%c, n=%d", + state.type, state.count); + }; + } else { + dprintf_info(ole, + "GetDateFormat(): unbekannt format, c=%c, n=%d\n", + state.type, state.count); + }; + buflen = strlen(buf); + + /* we need to check the next char again, one + way or another */ + state.inpos--; + + /* now, add buf to the output buffer */ + if (state.outpos + buflen < datelen) { + date[state.outpos] = '\0'; /* for strcat to hook on */ + strcat(date, buf); + state.outpos += buflen; + } else { + date[state.outpos] = '\0'; + strncat(date, buf, datelen - state.outpos - 1); + date[datelen - 1] = '\0'; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + }; + + /* reset other variables */ + state.count = 0; + state.type = '\0'; + + /* end of code for printing format-strings */ + } else if (state.count) { + /* and char is of same type (see above) */ + state.count += 1;; + } else if (strchr("yMdg", thisformat[state.inpos])) { + state.type = thisformat[state.inpos]; + state.count = 1; + } else if (thisformat[state.inpos] == '\'') { + state.inquote = 1; + } else { + date[state.outpos++] = thisformat[state.inpos]; + }; + if (state.outpos >= datelen) { + date[datelen - 1] = '\0'; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + }; + }; + + state.outpos++; + if (state.outpos >= datelen - 1) { + state.outpos = datelen - 1; + }; + + date[state.outpos] = '\0'; + + dprintf_info(ole, + "GetDateFormat32A() returning %d, with data=%s\n", + state.outpos, date); + return state.outpos; } +/***************************************************************** + * + * GetTimeFormat() + + Formats date according to format, or locale default if format is NULL. + The format consists of literal characters and fields as follows: + + h hours with no leading zero (12-hour) + hh hours with full two digits + H hours with no leading zero (24-hour) + HH hours with full two digits + m minutes with no leading zero + mm minutes with full two digits + s seconds with no leading zero + ss seconds with full two digits + t time marker (A or P) + tt time marker (AM, PM) + + */ + INT32 WINAPI GetTimeFormat32A(LCID locale,DWORD flags,LPSYSTEMTIME xtime, LPCSTR format, LPSTR timestr,INT32 timelen ) { - fprintf(stderr,"GetDateFormat(0x%04lx,0x%08lx,%p,%s,%p,%d), stub\n", + dprintf_info(ole,"GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d), stub\n", locale,flags,xtime,format,timestr,timelen ); + + /* FIXME: implement this one. Perhaps a common codebase? */ + + + + + lstrcpyn32A(timestr,"00:00:42",timelen); return strlen("00:00:42"); } + + + + diff --git a/ole/olecli.c b/ole/olecli.c index a2182133dc9..bc63ef1f6aa 100644 --- a/ole/olecli.c +++ b/ole/olecli.c @@ -10,7 +10,6 @@ #include "windows.h" #include "ole.h" #include "gdi.h" -#include "stddebug.h" #include "debug.h" extern LONG OLE_current_handle; @@ -111,7 +110,7 @@ OLESTATUS WINAPI OleQueryCreateFromClip32(LPCSTR name,OLEOPT_RENDER render,OLECL */ BOOL16 WINAPI OleIsDcMeta(HDC16 hdc) { - dprintf_ole(stddeb,"OleIsDCMeta(%04x)\n",hdc); + dprintf_info(ole,"OleIsDCMeta(%04x)\n",hdc); return GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ) != 0; } diff --git a/ole/olesvr.c b/ole/olesvr.c index ad68eb1628f..186475e6da8 100644 --- a/ole/olesvr.c +++ b/ole/olesvr.c @@ -9,7 +9,6 @@ #include "windows.h" #include "ole.h" -#include "stddebug.h" #include "debug.h" LONG OLE_current_handle; @@ -21,7 +20,7 @@ OLESTATUS WINAPI OleRegisterServer16( LPCSTR name, LPOLESERVER serverStruct, LHSERVER *hRet, HINSTANCE16 hServer, OLE_SERVER_USE use ) { - dprintf_ole(stdnimp,"OleRegisterServer:%s\n",name); + dprintf_fixme(ole,"OleRegisterServer:%s - stub\n",name); *hRet=++OLE_current_handle; /* return OLE_ERROR_MEMORY, OLE_ERROR_PROTECT_ONLY if you want it fail*/ return OLE_OK; @@ -74,7 +73,8 @@ OLESTATUS WINAPI OleRegisterServerDoc16( LHSERVER hServer, LPCSTR docname, LPOLESERVERDOC document, LHSERVERDOC *hRet) { - dprintf_ole(stdnimp,"OleRegisterServerDoc:%ld,%s\n", hServer, docname); + dprintf_fixme(ole,"OleRegisterServerDoc:%ld,%s - stub\n", + hServer, docname); *hRet=++OLE_current_handle; return OLE_OK; } @@ -84,7 +84,7 @@ OLESTATUS WINAPI OleRegisterServerDoc16( LHSERVER hServer, LPCSTR docname, */ OLESTATUS WINAPI OleRevokeServerDoc16(LHSERVERDOC hServerDoc) { - dprintf_ole(stdnimp,"OleRevokeServerDoc:%ld\n",hServerDoc); + dprintf_fixme(ole,"OleRevokeServerDoc:%ld - stub\n",hServerDoc); return OLE_OK; } @@ -102,7 +102,7 @@ OLESTATUS WINAPI OleRevokeServerDoc32(LHSERVERDOC hServerDoc) */ OLESTATUS WINAPI OleRevokeServer(LHSERVER hServer) { - dprintf_ole(stdnimp,"OleRevokeServer:%ld\n",hServer); + dprintf_fixme(ole,"OleRevokeServer:%ld - stub\n",hServer); return OLE_OK; } diff --git a/ole/storage.c b/ole/storage.c new file mode 100644 index 00000000000..06d67a8ff12 --- /dev/null +++ b/ole/storage.c @@ -0,0 +1,1595 @@ +/* Compound Storage + * + * Implemented using the documentation of the LAOLA project at + * + * (Thanks to Martin Schwartz ) + * + * Copyright 1998 Marcus Meissner + */ + +#include +#include +#include +#include +#include "windows.h" +#include "winerror.h" +#include "file.h" +#include "ole.h" +#include "ole2.h" +#include "compobj.h" +#include "interfaces.h" +#include "storage.h" +#include "heap.h" +#include "module.h" +#include "ldt.h" +#include "debug.h" +#include "debugstr.h" + +static const BYTE STORAGE_magic[8] ={0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1}; +static const BYTE STORAGE_notmagic[8]={0x0e,0x11,0xfc,0x0d,0xd0,0xcf,0x11,0xe0}; +static const BYTE STORAGE_oldmagic[8]={0xd0,0xcf,0x11,0xe0,0x0e,0x11,0xfc,0x0d}; + +#define BIGSIZE 512 +#define SMALLSIZE 64 + +#define SMALLBLOCKS_PER_BIGBLOCK (BIGSIZE/SMALLSIZE) + +#define READ_HEADER assert(STORAGE_get_big_block(hf,-1,(LPBYTE)&sth));assert(!memcmp(STORAGE_magic,sth.magic,sizeof(STORAGE_magic))); +static IStorage16_VTable stvt16; +static IStorage16_VTable *segstvt16 = NULL; +static IStorage32_VTable stvt32; +static IStream16_VTable strvt16; +static IStream16_VTable *segstrvt16 = NULL; +static IStream32_VTable strvt32; + +ULONG WINAPI IStorage16_AddRef(LPSTORAGE16 this); +static void _create_istorage16(LPSTORAGE16 *stg); +static void _create_istream16(LPSTREAM16 *str); + +#define IMPLEMENTED 1 + +/****************************************************************************** + * Reading OLE compound storage + */ +static BOOL32 +STORAGE_get_big_block(HFILE32 hf,int n,BYTE *block) { + assert(n>=-1); + if (-1==_llseek32(hf,(n+1)*BIGSIZE,SEEK_SET)) { + fprintf(stderr,"STORAGE_get_big_block: seek failed (%ld)\n",GetLastError()); + return FALSE; + } + assert((n+1)*BIGSIZE==_llseek32(hf,0,SEEK_CUR)); + if (BIGSIZE!=_lread32(hf,block,BIGSIZE)) { + fprintf(stderr,"STORAGE_get_big_block(%d): read didn't (%ld)\n",n,GetLastError()); + assert(0); + return FALSE; + } + return TRUE; +} + +static BOOL32 +STORAGE_put_big_block(HFILE32 hf,int n,BYTE *block) { + assert(n>=-1); + if (-1==_llseek32(hf,(n+1)*BIGSIZE,SEEK_SET)) { + fprintf(stderr,"STORAGE_put_big_block: seek failed (%ld)\n",GetLastError()); + return FALSE; + } + assert((n+1)*BIGSIZE==_llseek32(hf,0,SEEK_CUR)); + if (BIGSIZE!=_lwrite32(hf,block,BIGSIZE)) { + fprintf(stderr,"STORAGE_put_big_block: write failed (%ld)\n",GetLastError()); + return FALSE; + } + return TRUE; +} + +static int +STORAGE_get_next_big_blocknr(HFILE32 hf,int blocknr) { + INT32 bbs[BIGSIZE/sizeof(INT32)]; + struct storage_header sth; + + READ_HEADER; + + assert(blocknr>>7>7]==0xffffffff) + return -5; + if (!STORAGE_get_big_block(hf,sth.bbd_list[blocknr>>7],(LPBYTE)bbs)) + return -5; + assert(bbs[blocknr&0x7f]!=STORAGE_CHAINENTRY_FREE); + return bbs[blocknr&0x7f]; +} + +static int +STORAGE_get_nth_next_big_blocknr(HFILE32 hf,int blocknr,int nr) { + INT32 bbs[BIGSIZE/sizeof(INT32)]; + int lastblock = -1; + struct storage_header sth; + + READ_HEADER; + + assert(blocknr>=0); + while (nr--) { + assert((blocknr>>7)>7]!=0xffffffff); + + /* simple caching... */ + if (lastblock!=sth.bbd_list[blocknr>>7]) { + assert(STORAGE_get_big_block(hf,sth.bbd_list[blocknr>>7],(LPBYTE)bbs)); + lastblock = sth.bbd_list[blocknr>>7]; + } + blocknr = bbs[blocknr&0x7f]; + } + return blocknr; +} + + +static BOOL32 +STORAGE_get_root_pps_entry(HFILE32 hf,struct storage_pps_entry *pstde) { + int blocknr,i; + BYTE block[BIGSIZE]; + struct storage_pps_entry *stde=(struct storage_pps_entry*)block; + struct storage_header sth; + + READ_HEADER; + blocknr = sth.root_startblock; + while (blocknr>=0) { + assert(STORAGE_get_big_block(hf,blocknr,block)); + for (i=0;i<4;i++) { + if (!stde[i].pps_sizeofname) + continue; + if (stde[i].pps_type==5) { + *pstde=stde[i]; + return TRUE; + } + } + blocknr=STORAGE_get_next_big_blocknr(hf,blocknr); + } + return FALSE; +} + +static BOOL32 +STORAGE_get_small_block(HFILE32 hf,int blocknr,BYTE *sblock) { + BYTE block[BIGSIZE]; + int bigblocknr; + struct storage_pps_entry root; + + assert(blocknr>=0); + assert(STORAGE_get_root_pps_entry(hf,&root)); + bigblocknr = STORAGE_get_nth_next_big_blocknr(hf,root.pps_sb,blocknr/SMALLBLOCKS_PER_BIGBLOCK); + assert(bigblocknr>=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + + memcpy(sblock,((LPBYTE)block)+SMALLSIZE*(blocknr&(SMALLBLOCKS_PER_BIGBLOCK-1)),SMALLSIZE); + return TRUE; +} + +static BOOL32 +STORAGE_put_small_block(HFILE32 hf,int blocknr,BYTE *sblock) { + BYTE block[BIGSIZE]; + int bigblocknr; + struct storage_pps_entry root; + + assert(blocknr>=0); + + assert(STORAGE_get_root_pps_entry(hf,&root)); + bigblocknr = STORAGE_get_nth_next_big_blocknr(hf,root.pps_sb,blocknr/SMALLBLOCKS_PER_BIGBLOCK); + assert(bigblocknr>=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + + memcpy(((LPBYTE)block)+SMALLSIZE*(blocknr&(SMALLBLOCKS_PER_BIGBLOCK-1)),sblock,SMALLSIZE); + assert(STORAGE_put_big_block(hf,bigblocknr,block)); + return TRUE; +} + + +static int +STORAGE_get_next_small_blocknr(HFILE32 hf,int blocknr) { + BYTE block[BIGSIZE]; + LPINT32 sbd = (LPINT32)block; + int bigblocknr; + struct storage_header sth; + + READ_HEADER; + assert(blocknr>=0); + bigblocknr = STORAGE_get_nth_next_big_blocknr(hf,sth.sbd_startblock,blocknr/128); + assert(bigblocknr>=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + assert(sbd[blocknr & 127]!=STORAGE_CHAINENTRY_FREE); + return sbd[blocknr & (128-1)]; +} + +static int +STORAGE_get_nth_next_small_blocknr(HFILE32 hf,int blocknr,int nr) { + int lastblocknr; + BYTE block[BIGSIZE]; + LPINT32 sbd = (LPINT32)block; + struct storage_header sth; + + READ_HEADER; + lastblocknr=-1; + assert(blocknr>=0); + while ((nr--) && (blocknr>=0)) { + if (lastblocknr/128!=blocknr/128) { + int bigblocknr; + bigblocknr = STORAGE_get_nth_next_big_blocknr(hf,sth.sbd_startblock,blocknr/128); + assert(bigblocknr>=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + lastblocknr = blocknr; + } + assert(lastblocknr>=0); + lastblocknr=blocknr; + blocknr=sbd[blocknr & (128-1)]; + assert(blocknr!=STORAGE_CHAINENTRY_FREE); + } + return blocknr; +} + +static int +STORAGE_get_pps_entry(HFILE32 hf,int n,struct storage_pps_entry *pstde) { + int blocknr; + BYTE block[BIGSIZE]; + struct storage_pps_entry *stde = (struct storage_pps_entry*)(((LPBYTE)block)+128*(n&3)); + struct storage_header sth; + + READ_HEADER; + /* we have 4 pps entries per big block */ + blocknr = STORAGE_get_nth_next_big_blocknr(hf,sth.root_startblock,n/4); + assert(blocknr>=0); + assert(STORAGE_get_big_block(hf,blocknr,block)); + + *pstde=*stde; + return 1; +} + +static int +STORAGE_put_pps_entry(HFILE32 hf,int n,struct storage_pps_entry *pstde) { + int blocknr; + BYTE block[BIGSIZE]; + struct storage_pps_entry *stde = (struct storage_pps_entry*)(((LPBYTE)block)+128*(n&3)); + struct storage_header sth; + + READ_HEADER; + + /* we have 4 pps entries per big block */ + blocknr = STORAGE_get_nth_next_big_blocknr(hf,sth.root_startblock,n/4); + assert(blocknr>=0); + assert(STORAGE_get_big_block(hf,blocknr,block)); + *stde=*pstde; + assert(STORAGE_put_big_block(hf,blocknr,block)); + return 1; +} + +static int +STORAGE_look_for_named_pps(HFILE32 hf,int n,LPOLESTR32 name) { + struct storage_pps_entry stde; + int ret; + + if (n==-1) + return -1; + if (1!=STORAGE_get_pps_entry(hf,n,&stde)) + return -1; + + if (!lstrcmp32W(name,stde.pps_rawname)) + return n; + if (stde.pps_prev != -1) { + ret=STORAGE_look_for_named_pps(hf,stde.pps_prev,name); + if (ret!=-1) + return ret; + } + if (stde.pps_next != -1) { + ret=STORAGE_look_for_named_pps(hf,stde.pps_next,name); + if (ret!=-1) + return ret; + } + return -1; +} + +static void +STORAGE_dump_pps_entry(struct storage_pps_entry *stde) { + char name[33],xguid[50]; + + WINE_StringFromCLSID(&(stde->pps_guid),xguid); + + lstrcpyWtoA(name,stde->pps_rawname); + if (!stde->pps_sizeofname) + return; + fprintf(stderr,"name: %s\n",name); + fprintf(stderr,"type: %d\n",stde->pps_type); + fprintf(stderr,"prev pps: %ld\n",stde->pps_prev); + fprintf(stderr,"next pps: %ld\n",stde->pps_next); + fprintf(stderr,"dir pps: %ld\n",stde->pps_dir); + fprintf(stderr,"guid: %s\n",xguid); + if (stde->pps_type !=2) { + time_t t; + + t = DOSFS_FileTimeToUnixTime(&(stde->pps_ft1),NULL); + fprintf(stderr,"ts1: %s\n",ctime(&t)); + t = DOSFS_FileTimeToUnixTime(&(stde->pps_ft2),NULL); + fprintf(stderr,"ts2: %s\n",ctime(&t)); + } + fprintf(stderr,"startblock: %ld\n",stde->pps_sb); + fprintf(stderr,"size: %ld\n",stde->pps_size); +} + +static BOOL32 +STORAGE_init_storage(HFILE32 hf) { + BYTE block[BIGSIZE]; + LPDWORD bbs; + struct storage_header *sth; + struct storage_pps_entry *stde; + + assert(-1!=_llseek32(hf,0,SEEK_SET)); + /* block -1 is the storage header */ + sth = (struct storage_header*)block; + memcpy(sth->magic,STORAGE_magic,8); + memset(sth->unknown1,0,sizeof(sth->unknown1)); + memset(sth->unknown2,0,sizeof(sth->unknown2)); + memset(sth->unknown3,0,sizeof(sth->unknown3)); + sth->num_of_bbd_blocks = 1; + sth->root_startblock = 1; + sth->sbd_startblock = 0xffffffff; + memset(sth->bbd_list,0xff,sizeof(sth->bbd_list)); + sth->bbd_list[0] = 0; + assert(BIGSIZE==_lwrite32(hf,block,BIGSIZE)); + /* block 0 is the big block directory */ + bbs=(LPDWORD)block; + memset(block,0xff,sizeof(block)); /* mark all blocks as free */ + bbs[0]=STORAGE_CHAINENTRY_ENDOFCHAIN; /* for this block */ + bbs[1]=STORAGE_CHAINENTRY_ENDOFCHAIN; /* for directory entry */ + assert(BIGSIZE==_lwrite32(hf,block,BIGSIZE)); + /* block 1 is the root directory entry */ + memset(block,0x00,sizeof(block)); + stde = (struct storage_pps_entry*)block; + lstrcpyAtoW(stde->pps_rawname,"RootEntry"); + stde->pps_sizeofname = lstrlen32W(stde->pps_rawname)*2+2; + stde->pps_type = 5; + stde->pps_dir = -1; + stde->pps_next = -1; + stde->pps_prev = -1; + stde->pps_sb = 0xffffffff; + stde->pps_size = 0; + assert(BIGSIZE==_lwrite32(hf,block,BIGSIZE)); + return TRUE; +} + +static BOOL32 +STORAGE_set_big_chain(HFILE32 hf,int blocknr,INT32 type) { + BYTE block[BIGSIZE]; + LPINT32 bbd = (LPINT32)block; + int nextblocknr,bigblocknr; + struct storage_header sth; + + READ_HEADER; + assert(blocknr!=type); + while (blocknr>=0) { + bigblocknr = sth.bbd_list[blocknr/128]; + assert(bigblocknr>=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + + nextblocknr = bbd[blocknr&(128-1)]; + bbd[blocknr&(128-1)] = type; + if (type>=0) + return TRUE; + assert(STORAGE_put_big_block(hf,bigblocknr,block)); + type = STORAGE_CHAINENTRY_FREE; + blocknr = nextblocknr; + } + return TRUE; +} + +static BOOL32 +STORAGE_set_small_chain(HFILE32 hf,int blocknr,INT32 type) { + BYTE block[BIGSIZE]; + LPINT32 sbd = (LPINT32)block; + int lastblocknr,nextsmallblocknr,bigblocknr; + struct storage_header sth; + + READ_HEADER; + + assert(blocknr!=type); + lastblocknr=-129;bigblocknr=-2; + while (blocknr>=0) { + /* cache block ... */ + if (lastblocknr/128!=blocknr/128) { + bigblocknr = STORAGE_get_nth_next_big_blocknr(hf,sth.sbd_startblock,blocknr/128); + assert(bigblocknr>=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + } + lastblocknr = blocknr; + nextsmallblocknr = sbd[blocknr&(128-1)]; + sbd[blocknr&(128-1)] = type; + assert(STORAGE_put_big_block(hf,bigblocknr,block)); + if (type>=0) + return TRUE; + type = STORAGE_CHAINENTRY_FREE; + blocknr = nextsmallblocknr; + } + return TRUE; +} + +static int +STORAGE_get_free_big_blocknr(HFILE32 hf) { + BYTE block[BIGSIZE]; + LPINT32 sbd = (LPINT32)block; + int lastbigblocknr,i,curblock,bigblocknr; + struct storage_header sth; + + READ_HEADER; + curblock = 0; + lastbigblocknr = -1; + bigblocknr = sth.bbd_list[curblock]; + while (curblock=0); + assert(STORAGE_get_big_block(hf,bigblocknr,block)); + for (i=0;i<128;i++) + if (sbd[i]==STORAGE_CHAINENTRY_FREE) { + sbd[i] = STORAGE_CHAINENTRY_ENDOFCHAIN; + assert(STORAGE_put_big_block(hf,bigblocknr,block)); + memset(block,0x42,sizeof(block)); + assert(STORAGE_put_big_block(hf,i+curblock*128,block)); + return i+curblock*128; + } + lastbigblocknr = bigblocknr; + bigblocknr = sth.bbd_list[++curblock]; + } + bigblocknr = curblock*128; + /* since we have marked all blocks from 0 up to curblock*128-1 + * the next free one is curblock*128, where we happily put our + * next large block depot. + */ + memset(block,0xff,sizeof(block)); + /* mark the block allocated and returned by this function */ + sbd[1] = STORAGE_CHAINENTRY_ENDOFCHAIN; + assert(STORAGE_put_big_block(hf,bigblocknr,block)); + + /* if we had a bbd block already (mostlikely) we need + * to link the new one into the chain + */ + if (lastbigblocknr!=-1) + assert(STORAGE_set_big_chain(hf,lastbigblocknr,bigblocknr)); + sth.bbd_list[curblock]=bigblocknr; + sth.num_of_bbd_blocks++; + assert(sth.num_of_bbd_blocks==curblock+1); + assert(STORAGE_put_big_block(hf,-1,(LPBYTE)&sth)); + + /* Set the end of the chain for the bigblockdepots */ + assert(STORAGE_set_big_chain(hf,bigblocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)); + /* add 1, for the first entry is used for the additional big block + * depot. (means we already used bigblocknr) */ + memset(block,0x42,sizeof(block)); + /* allocate this block (filled with 0x42) */ + assert(STORAGE_put_big_block(hf,bigblocknr+1,block)); + return bigblocknr+1; +} + + +static int +STORAGE_get_free_small_blocknr(HFILE32 hf) { + BYTE block[BIGSIZE]; + LPINT32 sbd = (LPINT32)block; + int lastbigblocknr,newblocknr,i,curblock,bigblocknr; + struct storage_pps_entry root; + struct storage_header sth; + + READ_HEADER; + bigblocknr = sth.sbd_startblock; + curblock = 0; + lastbigblocknr = -1; + newblocknr = -1; + while (bigblocknr>=0) { + if (!STORAGE_get_big_block(hf,bigblocknr,block)) + return -1; + for (i=0;i<128;i++) + if (sbd[i]==STORAGE_CHAINENTRY_FREE) { + sbd[i]=STORAGE_CHAINENTRY_ENDOFCHAIN; + newblocknr = i+curblock*128; + break; + } + if (i!=128) + break; + lastbigblocknr = bigblocknr; + bigblocknr = STORAGE_get_next_big_blocknr(hf,bigblocknr); + curblock++; + } + if (newblocknr==-1) { + bigblocknr = STORAGE_get_free_big_blocknr(hf); + if (bigblocknr<0) + return -1; + READ_HEADER; + memset(block,0xff,sizeof(block)); + sbd[0]=STORAGE_CHAINENTRY_ENDOFCHAIN; + if (!STORAGE_put_big_block(hf,bigblocknr,block)) + return -1; + if (lastbigblocknr==-1) { + sth.sbd_startblock = bigblocknr; + if (!STORAGE_put_big_block(hf,-1,(LPBYTE)&sth)) /* need to write it */ + return -1; + } else { + if (!STORAGE_set_big_chain(hf,lastbigblocknr,bigblocknr)) + return -1; + } + if (!STORAGE_set_big_chain(hf,bigblocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return -1; + newblocknr = curblock*128; + } + /* allocate enough big blocks for storing the allocated small block */ + if (!STORAGE_get_root_pps_entry(hf,&root)) + return -1; + if (root.pps_sb==-1) + lastbigblocknr = -1; + else + lastbigblocknr = STORAGE_get_nth_next_big_blocknr(hf,root.pps_sb,(root.pps_size-1)/BIGSIZE); + while (root.pps_size < (newblocknr*SMALLSIZE+SMALLSIZE-1)) { + /* we need to allocate more stuff */ + bigblocknr = STORAGE_get_free_big_blocknr(hf); + if (bigblocknr<0) + return -1; + READ_HEADER; + if (root.pps_sb==-1) { + root.pps_sb = bigblocknr; + root.pps_size += BIGSIZE; + } else { + if (!STORAGE_set_big_chain(hf,lastbigblocknr,bigblocknr)) + return -1; + root.pps_size += BIGSIZE; + } + lastbigblocknr = bigblocknr; + } + if (!STORAGE_set_big_chain(hf,lastbigblocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return -1; + if (!STORAGE_put_pps_entry(hf,0,&root)) + return -1; + return newblocknr; +} + +static int +STORAGE_get_free_pps_entry(HFILE32 hf) { + int blocknr,i,curblock,lastblocknr; + BYTE block[BIGSIZE]; + struct storage_pps_entry *stde = (struct storage_pps_entry*)block; + struct storage_header sth; + + READ_HEADER; + blocknr = sth.root_startblock; + assert(blocknr>=0); + curblock=0; + while (blocknr>=0) { + if (!STORAGE_get_big_block(hf,blocknr,block)) + return -1; + for (i=0;i<4;i++) + if (stde[i].pps_sizeofname==0) /* free */ + return curblock*4+i; + lastblocknr = blocknr; + blocknr = STORAGE_get_next_big_blocknr(hf,blocknr); + curblock++; + } + assert(blocknr==STORAGE_CHAINENTRY_ENDOFCHAIN); + blocknr = STORAGE_get_free_big_blocknr(hf); + /* sth invalidated */ + if (blocknr<0) + return -1; + + if (!STORAGE_set_big_chain(hf,lastblocknr,blocknr)) + return -1; + if (!STORAGE_set_big_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return -1; + memset(block,0,sizeof(block)); + STORAGE_put_big_block(hf,blocknr,block); + return curblock*4; +} + +/****************************************************************************** + * IStream + */ +HRESULT WINAPI IStream16_QueryInterface( + LPSTREAM16 this,REFIID refiid,LPVOID *obj +) { + char xrefiid[50]; + + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IStream16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { + *obj = this; + return 0; + } + return OLE_E_ENUM_NOMORE; + +} + +ULONG WINAPI IStream16_AddRef(LPSTREAM16 this) { + return ++(this->ref); +} + +ULONG WINAPI IStream16_Release(LPSTREAM16 this) { + FlushFileBuffers(this->hf); + this->ref--; + if (!this->ref) { + CloseHandle(this->hf); + SEGPTR_FREE(this); + return 0; + } + return this->ref; +} + +/* FIXME: not handling 64 bit */ +HRESULT WINAPI IStream16_Seek( + LPSTREAM16 this,LARGE_INTEGER offset,DWORD whence,ULARGE_INTEGER *newpos +) { + dprintf_info(relay,"IStream16(%p)->Seek([%ld.%ld],%ld,%p)\n",this,offset.HighPart,offset.LowPart,whence,newpos); + + switch (whence) { + /* unix SEEK_xx should be the same as win95 ones */ + case SEEK_SET: + /* offset must be ==0 (<0 is invalid, and >0 cannot be handled + * right now. + */ + assert(offset.HighPart==0); + this->offset.HighPart = offset.HighPart; + this->offset.LowPart = offset.LowPart; + break; + case SEEK_CUR: + if (offset.HighPart < 0) { + /* FIXME: is this negation correct ? */ + offset.HighPart = -offset.HighPart; + offset.LowPart = (0xffffffff ^ offset.LowPart)+1; + + assert(offset.HighPart==0); + assert(this->offset.LowPart >= offset.LowPart); + this->offset.LowPart -= offset.LowPart; + } else { + assert(offset.HighPart==0); + this->offset.LowPart+= offset.LowPart; + } + break; + case SEEK_END: + assert(offset.HighPart==0); + this->offset.LowPart = this->stde.pps_size-offset.LowPart; + break; + } + if (this->offset.LowPart>this->stde.pps_size) + this->offset.LowPart=this->stde.pps_size; + if (newpos) *newpos = this->offset; + return OLE_OK; +} + +HRESULT WINAPI IStream16_Read( + LPSTREAM16 this,void *pv,ULONG cb,ULONG *pcbRead +) { + BYTE block[BIGSIZE]; + ULONG *bytesread=pcbRead,xxread; + int blocknr; + + dprintf_info(relay,"IStream16(%p)->Read(%p,%ld,%p)\n",this,pv,cb,pcbRead); + if (!pcbRead) bytesread=&xxread; + *bytesread = 0; + + if (cb>this->stde.pps_size-this->offset.LowPart) + cb=this->stde.pps_size-this->offset.LowPart; + if (this->stde.pps_size < 0x1000) { + /* use small block reader */ + blocknr = STORAGE_get_nth_next_small_blocknr(this->hf,this->stde.pps_sb,this->offset.LowPart/SMALLSIZE); + while (cb) { + int cc; + + if (!STORAGE_get_small_block(this->hf,blocknr,block)) { + fprintf(stderr,"small block read failed!!!!\n"); + return E_FAIL; + } + cc = cb; + if (cc>SMALLSIZE-(this->offset.LowPart&(SMALLSIZE-1))) + cc=SMALLSIZE-(this->offset.LowPart&(SMALLSIZE-1)); + memcpy((LPBYTE)pv,block+(this->offset.LowPart&(SMALLSIZE-1)),cc); + this->offset.LowPart+=cc; + (LPBYTE)pv+=cc; + *bytesread+=cc; + cb-=cc; + blocknr = STORAGE_get_next_small_blocknr(this->hf,blocknr); + } + } else { + /* use big block reader */ + blocknr = STORAGE_get_nth_next_big_blocknr(this->hf,this->stde.pps_sb,this->offset.LowPart/BIGSIZE); + while (cb) { + int cc; + + if (!STORAGE_get_big_block(this->hf,blocknr,block)) { + fprintf(stderr,"big block read failed!!!!\n"); + return E_FAIL; + } + cc = cb; + if (cc>BIGSIZE-(this->offset.LowPart&(BIGSIZE-1))) + cc=BIGSIZE-(this->offset.LowPart&(BIGSIZE-1)); + memcpy((LPBYTE)pv,block+(this->offset.LowPart&(BIGSIZE-1)),cc); + this->offset.LowPart+=cc; + (LPBYTE)pv+=cc; + *bytesread+=cc; + cb-=cc; + blocknr=STORAGE_get_next_big_blocknr(this->hf,blocknr); + } + } + return OLE_OK; +} + +HRESULT WINAPI IStream16_Write( + LPSTREAM16 this,const void *pv,ULONG cb,ULONG *pcbWrite +) { + BYTE block[BIGSIZE]; + ULONG *byteswritten=pcbWrite,xxwritten; + int oldsize,newsize,i,curoffset=0,lastblocknr,blocknr,cc; + HFILE32 hf = this->hf; + + if (!pcbWrite) byteswritten=&xxwritten; + *byteswritten = 0; + + dprintf_info(relay,"IStream16(%p)->Write(%p,%ld,%p)\n",this,pv,cb,pcbWrite); + /* do we need to junk some blocks? */ + newsize = this->offset.LowPart+cb; + oldsize = this->stde.pps_size; + if (newsize < oldsize) { + if (oldsize < 0x1000) { + /* only small blocks */ + blocknr=STORAGE_get_nth_next_small_blocknr(hf,this->stde.pps_sb,newsize/SMALLSIZE); + + assert(blocknr>=0); + + /* will set the rest of the chain to 'free' */ + if (!STORAGE_set_small_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return E_FAIL; + } else { + if (newsize >= 0x1000) { + blocknr=STORAGE_get_nth_next_big_blocknr(hf,this->stde.pps_sb,newsize/BIGSIZE); + assert(blocknr>=0); + + /* will set the rest of the chain to 'free' */ + if (!STORAGE_set_big_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return E_FAIL; + } else { + /* Migrate large blocks to small blocks + * (we just migrate newsize bytes) + */ + LPBYTE curdata,data = HeapAlloc(GetProcessHeap(),0,newsize+BIGSIZE); + cc = newsize; + blocknr = this->stde.pps_sb; + curdata = data; + while (cc>0) { + if (!STORAGE_get_big_block(hf,blocknr,curdata)) { + HeapFree(GetProcessHeap(),0,data); + return E_FAIL; + } + curdata += BIGSIZE; + cc -= BIGSIZE; + blocknr = STORAGE_get_next_big_blocknr(hf,blocknr); + } + /* frees complete chain for this stream */ + if (!STORAGE_set_big_chain(hf,this->stde.pps_sb,STORAGE_CHAINENTRY_FREE)) + return E_FAIL; + curdata = data; + blocknr = this->stde.pps_sb = STORAGE_get_free_small_blocknr(hf); + if (blocknr<0) + return E_FAIL; + cc = newsize; + while (cc>0) { + if (!STORAGE_put_small_block(hf,blocknr,curdata)) + return E_FAIL; + cc -= SMALLSIZE; + if (cc<=0) { + if (!STORAGE_set_small_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return E_FAIL; + break; + } else { + int newblocknr = STORAGE_get_free_small_blocknr(hf); + if (newblocknr<0) + return E_FAIL; + if (!STORAGE_set_small_chain(hf,blocknr,newblocknr)) + return E_FAIL; + blocknr = newblocknr; + } + curdata += SMALLSIZE; + } + HeapFree(GetProcessHeap(),0,data); + } + } + this->stde.pps_size = newsize; + } + + if (newsize > oldsize) { + if (oldsize >= 0x1000) { + /* should return the block right before the 'endofchain' */ + blocknr = STORAGE_get_nth_next_big_blocknr(hf,this->stde.pps_sb,this->stde.pps_size/BIGSIZE); + assert(blocknr>=0); + lastblocknr = blocknr; + for (i=oldsize/BIGSIZE;istde.pps_sb = blocknr = STORAGE_get_free_small_blocknr(hf); + else + blocknr = STORAGE_get_nth_next_small_blocknr(hf,this->stde.pps_sb,this->stde.pps_size/SMALLSIZE); + if (blocknr<0) + return E_FAIL; + + /* allocate required new small blocks */ + lastblocknr = blocknr; + for (i=oldsize/SMALLSIZE;istde.pps_sb = blocknr; + } else { + /* Migrate small blocks to big blocks */ + LPBYTE curdata,data = HeapAlloc(GetProcessHeap(),0,oldsize+BIGSIZE); + cc = oldsize; + blocknr = this->stde.pps_sb; + curdata = data; + /* slurp in */ + while (cc>0) { + if (!STORAGE_get_small_block(hf,blocknr,curdata)) { + HeapFree(GetProcessHeap(),0,data); + return E_FAIL; + } + curdata += SMALLSIZE; + cc -= SMALLSIZE; + blocknr = STORAGE_get_next_small_blocknr(hf,blocknr); + } + /* free small block chain */ + if (!STORAGE_set_small_chain(hf,this->stde.pps_sb,STORAGE_CHAINENTRY_FREE)) + return E_FAIL; + curdata = data; + blocknr = this->stde.pps_sb = STORAGE_get_free_big_blocknr(hf); + if (blocknr<0) + return E_FAIL; + /* put the data into the big blocks */ + cc = this->stde.pps_size; + while (cc>0) { + if (!STORAGE_put_big_block(hf,blocknr,curdata)) + return E_FAIL; + cc -= BIGSIZE; + if (cc<=0) { + if (!STORAGE_set_big_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) + return E_FAIL; + break; + } else { + int newblocknr = STORAGE_get_free_big_blocknr(hf); + if (newblocknr<0) + return E_FAIL; + if (!STORAGE_set_big_chain(hf,blocknr,newblocknr)) + return E_FAIL; + blocknr = newblocknr; + } + curdata += BIGSIZE; + } + HeapFree(GetProcessHeap(),0,data); + } + /* generate big blocks to fit the new data */ + lastblocknr = blocknr; + for (i=oldsize/BIGSIZE;istde.pps_size = newsize; + } + + /* There are just some cases where we didn't modify it, we write it out + * everytime + */ + if (!STORAGE_put_pps_entry(hf,this->ppsent,&(this->stde))) + return E_FAIL; + + /* finally the write pass */ + if (this->stde.pps_size < 0x1000) { + blocknr = STORAGE_get_nth_next_small_blocknr(hf,this->stde.pps_sb,this->offset.LowPart/SMALLSIZE); + assert(blocknr>=0); + while (cb>0) { + /* we ensured that it is allocated above */ + assert(blocknr>=0); + /* Read old block everytime, since we can have + * overlapping data at START and END of the write + */ + if (!STORAGE_get_small_block(hf,blocknr,block)) + return E_FAIL; + + cc = SMALLSIZE-(this->offset.LowPart&(SMALLSIZE-1)); + if (cc>cb) + cc=cb; + memcpy( ((LPBYTE)block)+(this->offset.LowPart&(SMALLSIZE-1)), + (LPBYTE)(pv+curoffset), + cc + ); + if (!STORAGE_put_small_block(hf,blocknr,block)) + return E_FAIL; + cb -= cc; + curoffset += cc; + (LPBYTE)pv += cc; + this->offset.LowPart += cc; + *byteswritten += cc; + blocknr = STORAGE_get_next_small_blocknr(hf,blocknr); + } + } else { + blocknr = STORAGE_get_nth_next_big_blocknr(hf,this->stde.pps_sb,this->offset.LowPart/BIGSIZE); + assert(blocknr>=0); + while (cb>0) { + /* we ensured that it is allocated above, so it better is */ + assert(blocknr>=0); + /* read old block everytime, since we can have + * overlapping data at START and END of the write + */ + if (!STORAGE_get_big_block(hf,blocknr,block)) + return E_FAIL; + + cc = BIGSIZE-(this->offset.LowPart&(BIGSIZE-1)); + if (cc>cb) + cc=cb; + memcpy( ((LPBYTE)block)+(this->offset.LowPart&(BIGSIZE-1)), + (LPBYTE)(pv+curoffset), + cc + ); + if (!STORAGE_put_big_block(hf,blocknr,block)) + return E_FAIL; + cb -= cc; + curoffset += cc; + (LPBYTE)pv += cc; + this->offset.LowPart += cc; + *byteswritten += cc; + blocknr = STORAGE_get_next_big_blocknr(hf,blocknr); + } + } + return OLE_OK; +} + +static void _create_istream16(LPSTREAM16 *str) { + LPSTREAM16 lpst; + + if (!strvt16.fnQueryInterface) { + HMODULE16 wp = GetModuleHandle16("STORAGE"); + if (wp>=32) { +#define VTENT(x) strvt16.fn##x = (void*)WIN32_GetProcAddress16(wp,"IStream16_"#x); + VTENT(QueryInterface) + VTENT(AddRef) + VTENT(Release) + VTENT(Read) + VTENT(Write) + VTENT(Seek) + VTENT(SetSize) + VTENT(CopyTo) + VTENT(Commit) + VTENT(Revert) + VTENT(LockRegion) + VTENT(UnlockRegion) + VTENT(Stat) + VTENT(Clone) +#undef VTENT + segstrvt16 = SEGPTR_NEW(IStream16_VTable); + memcpy(segstrvt16,&strvt16,sizeof(strvt16)); + segstrvt16 = (LPSTREAM16_VTABLE)SEGPTR_GET(segstrvt16); + } else { +#define VTENT(x) strvt16.fn##x = IStream16_##x; + VTENT(QueryInterface) + VTENT(AddRef) + VTENT(Release) + VTENT(Read) + VTENT(Write) + VTENT(Seek) + /* + VTENT(CopyTo) + VTENT(Commit) + VTENT(SetSize) + VTENT(Revert) + VTENT(LockRegion) + VTENT(UnlockRegion) + VTENT(Stat) + VTENT(Clone) + */ +#undef VTENT + segstrvt16 = &strvt16; + } + } + lpst = SEGPTR_NEW(IStream16); + lpst->lpvtbl = segstrvt16; + lpst->ref = 1; + lpst->thisptr = SEGPTR_GET(lpst); + *str = (void*)lpst->thisptr; +} + +/***************************************************************************** + * IStream32 + */ +HRESULT WINAPI IStream32_QueryInterface( + LPSTREAM32 this,REFIID refiid,LPVOID *obj +) { + char xrefiid[50]; + + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IStream16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { + *obj = this; + return 0; + } + return OLE_E_ENUM_NOMORE; + +} + +ULONG WINAPI IStream32_AddRef(LPSTREAM32 this) { + return ++(this->ref); +} + +ULONG WINAPI IStream32_Release(LPSTREAM32 this) { + FlushFileBuffers(this->hf); + this->ref--; + if (!this->ref) { + CloseHandle(this->hf); + SEGPTR_FREE(this); + return 0; + } + return this->ref; +} + +static IStream32_VTable strvt32 = { + IStream32_QueryInterface, + IStream32_AddRef, + IStream32_Release, + (void*)4, + (void*)5, + (void*)6, + (void*)7, + (void*)8, + (void*)9, + (void*)10, + (void*)11, +}; + +/****************************************************************************** + * IStorage + */ +HRESULT WINAPI IStorage16_QueryInterface( + LPSTORAGE16 this,REFIID refiid,LPVOID *obj +) { + char xrefiid[50]; + + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IStorage16(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + + if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { + *obj = this; + return 0; + } + return OLE_E_ENUM_NOMORE; +} + +ULONG WINAPI IStorage16_AddRef(LPSTORAGE16 this) { + return ++(this->ref); +} + +ULONG WINAPI IStorage16_Release(LPSTORAGE16 this) { + this->ref--; + if (this->ref) + return this->ref; + SEGPTR_FREE(this); + return 0; +} + +HRESULT WINAPI IStorage16_Stat( + LPSTORAGE16 this,STATSTG *pstatstg, DWORD grfStatFlag +) { + fprintf(stderr,"IStorage16(%p)->Stat(%p,0x%08lx)\n", + this,pstatstg,grfStatFlag + ); + pstatstg->pwcsName=SEGPTR_GET(SEGPTR_STRDUP_WtoA(this->stde.pps_rawname)); + pstatstg->type = this->stde.pps_type; + pstatstg->cbSize.LowPart = this->stde.pps_size; + pstatstg->mtime = this->stde.pps_ft1; /* FIXME */ + pstatstg->atime = this->stde.pps_ft2; /* FIXME */ + pstatstg->ctime = this->stde.pps_ft2; /* FIXME */ + pstatstg->grfMode = 0; /* FIXME */ + pstatstg->grfLocksSupported = 0; /* FIXME */ + pstatstg->clsid = this->stde.pps_guid; + pstatstg->grfStateBits = 0; /* FIXME */ + pstatstg->reserved = 0; + return OLE_OK; +} + +HRESULT WINAPI IStorage16_Commit( + LPSTORAGE16 this,DWORD commitflags +) { + fprintf(stderr,"IStorage16(%p)->Commit(0x%08lx),STUB!\n", + this,commitflags + ); + return OLE_OK; +} + +HRESULT WINAPI IStorage16_CopyTo(LPSTORAGE16 this,DWORD ciidExclude,const IID *rgiidExclude,SNB16 SNB16Exclude,IStorage16 *pstgDest) { + char xguid[50]; + + if (rgiidExclude) + WINE_StringFromCLSID(rgiidExclude,xguid); + else + strcpy(xguid,""); + fprintf(stderr,"IStorage16(%p)->CopyTo(0x%08lx,%s,%p,%p),stub!\n", + this,ciidExclude,xguid,SNB16Exclude,pstgDest + ); + return OLE_OK; +} + + + +HRESULT WINAPI IStorage16_CreateStorage( + LPSTORAGE16 this,LPCOLESTR16 pwcsName,DWORD grfMode,DWORD dwStgFormat,DWORD reserved2, IStorage16 **ppstg +) { + LPSTORAGE16 lpstg; + int ppsent,x; + struct storage_pps_entry stde; + struct storage_header sth; + HFILE32 hf=this->hf; + + READ_HEADER; + + fprintf(stderr,"IStorage16(%p)->CreateStorage(%s,0x%08lx,0x%08lx,0x%08lx,%p)\n", + this,pwcsName,grfMode,dwStgFormat,reserved2,ppstg + ); + if (grfMode & STGM_TRANSACTED) + fprintf(stderr,"IStorage::CreateStorage:We do not support transacted Compound Storage. Using direct mode.\n"); + _create_istorage16(ppstg); + lpstg = (LPSTORAGE16)PTR_SEG_TO_LIN(*ppstg); + lpstg->hf = this->hf; + + ppsent=STORAGE_get_free_pps_entry(lpstg->hf); + if (ppsent<0) + return E_FAIL; + stde=this->stde; + if (stde.pps_dir==-1) { + stde.pps_dir = ppsent; + x = this->ppsent; + } else { + /* FIXME: use prev chain too ? */ + x=stde.pps_dir; + if (1!=STORAGE_get_pps_entry(lpstg->hf,x,&stde)) + return E_FAIL; + while (stde.pps_next!=-1) { + x=stde.pps_next; + if (1!=STORAGE_get_pps_entry(lpstg->hf,x,&stde)) + return E_FAIL; + } + stde.pps_next = ppsent; + } + assert(STORAGE_put_pps_entry(lpstg->hf,x,&stde)); + assert(1==STORAGE_get_pps_entry(lpstg->hf,ppsent,&(lpstg->stde))); + lstrcpyAtoW(lpstg->stde.pps_rawname,pwcsName); + lpstg->stde.pps_sizeofname = lstrlen32A(pwcsName)*2+2; + lpstg->stde.pps_next = -1; + lpstg->stde.pps_prev = -1; + lpstg->stde.pps_dir = -1; + lpstg->stde.pps_sb = -1; + lpstg->stde.pps_size = 0; + lpstg->stde.pps_type = 1; + lpstg->ppsent = ppsent; + /* FIXME: timestamps? */ + if (!STORAGE_put_pps_entry(lpstg->hf,ppsent,&(lpstg->stde))) + return E_FAIL; + return OLE_OK; +} + +HRESULT WINAPI IStorage16_CreateStream( + LPSTORAGE16 this,LPCOLESTR16 pwcsName,DWORD grfMode,DWORD reserved1,DWORD reserved2, IStream16 **ppstm +) { + LPSTREAM16 lpstr; + int ppsent,x; + struct storage_pps_entry stde; + + fprintf(stderr,"IStorage16(%p)->CreateStream(%s,0x%08lx,0x%08lx,0x%08lx,%p)\n", + this,pwcsName,grfMode,reserved1,reserved2,ppstm + ); + if (grfMode & STGM_TRANSACTED) + fprintf(stderr,"IStorage::CreateStream:We do not support transacted Compound Storage. Using direct mode.\n"); + _create_istream16(ppstm); + lpstr = (LPSTREAM16)PTR_SEG_TO_LIN(*ppstm); + lpstr->hf = FILE_Dup(this->hf); + lpstr->offset.LowPart = 0; + lpstr->offset.HighPart = 0; + + ppsent=STORAGE_get_free_pps_entry(lpstr->hf); + if (ppsent<0) + return E_FAIL; + stde=this->stde; + if (stde.pps_next==-1) + x=this->ppsent; + else + while (stde.pps_next!=-1) { + x=stde.pps_next; + if (1!=STORAGE_get_pps_entry(lpstr->hf,x,&stde)) + return E_FAIL; + } + stde.pps_next = ppsent; + assert(STORAGE_put_pps_entry(lpstr->hf,x,&stde)); + assert(1==STORAGE_get_pps_entry(lpstr->hf,ppsent,&(lpstr->stde))); + lstrcpyAtoW(lpstr->stde.pps_rawname,pwcsName); + lpstr->stde.pps_sizeofname = lstrlen32A(pwcsName)*2+2; + lpstr->stde.pps_next = -1; + lpstr->stde.pps_prev = -1; + lpstr->stde.pps_dir = -1; + lpstr->stde.pps_sb = -1; + lpstr->stde.pps_size = 0; + lpstr->stde.pps_type = 2; + lpstr->ppsent = ppsent; + /* FIXME: timestamps? */ + if (!STORAGE_put_pps_entry(lpstr->hf,ppsent,&(lpstr->stde))) + return E_FAIL; + return OLE_OK; +} + +HRESULT WINAPI IStorage16_OpenStorage( + LPSTORAGE16 this,LPCOLESTR16 pwcsName, IStorage16 *pstgPrio, DWORD grfMode, SNB16 snbExclude, DWORD reserved, IStorage16 **ppstg +) { + LPSTREAM16 lpstg; + WCHAR name[33]; + int newpps; + + dprintf_info(relay,"IStorage16(%p)->OpenStorage(%s,%p,0x%08lx,%p,0x%08lx,%p)\n", + this,pwcsName,pstgPrio,grfMode,snbExclude,reserved,ppstg + ); + if (grfMode & STGM_TRANSACTED) + fprintf(stderr,"IStorage::OpenStorage:We do not support transacted Compound Storage. Using direct mode.\n"); + _create_istorage16(ppstg); + lpstg = (LPSTREAM16)PTR_SEG_TO_LIN(*ppstg); + lpstg->hf = FILE_Dup(this->hf); + lstrcpyAtoW(name,pwcsName); + newpps = STORAGE_look_for_named_pps(lpstg->hf,this->stde.pps_dir,name); + if (newpps==-1) { + IStream16_Release(lpstg); + return E_FAIL; + } + + if (1!=STORAGE_get_pps_entry(lpstg->hf,newpps,&(lpstg->stde))) { + IStream16_Release(lpstg); + return E_FAIL; + } + lpstg->ppsent = newpps; + return OLE_OK; +} + +HRESULT WINAPI IStorage16_OpenStream( + LPSTORAGE16 this,LPCOLESTR16 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream16 **ppstm +) { + LPSTREAM16 lpstr; + WCHAR name[33]; + int newpps; + + dprintf_info(relay,"IStorage16(%p)->OpenStream(%s,%p,0x%08lx,0x%08lx,%p)\n", + this,pwcsName,reserved1,grfMode,reserved2,ppstm + ); + if (grfMode & STGM_TRANSACTED) + fprintf(stderr,"IStorage::OpenStream:We do not support transacted Compound Storage. Using direct mode.\n"); + _create_istream16(ppstm); + lpstr = (LPSTREAM16)PTR_SEG_TO_LIN(*ppstm); + lpstr->hf = FILE_Dup(this->hf); + lstrcpyAtoW(name,pwcsName); + newpps = STORAGE_look_for_named_pps(lpstr->hf,this->stde.pps_dir,name); + if (newpps==-1) { + IStream16_Release(lpstr); + return E_FAIL; + } + + if (1!=STORAGE_get_pps_entry(lpstr->hf,newpps,&(lpstr->stde))) { + IStream16_Release(lpstr); + return E_FAIL; + } + lpstr->offset.LowPart = 0; + lpstr->offset.HighPart = 0; + lpstr->ppsent = newpps; + return OLE_OK; +} + +static void _create_istorage16(LPSTORAGE16 *stg) { + LPSTORAGE16 lpst; + + if (!stvt16.fnQueryInterface) { + HMODULE16 wp = GetModuleHandle16("STORAGE"); + if (wp>=32) { +#define VTENT(x) stvt16.fn##x = (void*)WIN32_GetProcAddress16(wp,"IStorage16_"#x); + VTENT(QueryInterface) + VTENT(AddRef) + VTENT(Release) + VTENT(CreateStream) + VTENT(OpenStream) + VTENT(CreateStorage) + VTENT(OpenStorage) + VTENT(CopyTo) + VTENT(MoveElementTo) + VTENT(Commit) + VTENT(Revert) + VTENT(EnumElements) + VTENT(DestroyElement) + VTENT(RenameElement) + VTENT(SetElementTimes) + VTENT(SetClass) + VTENT(SetStateBits) + VTENT(Stat) +#undef VTENT + segstvt16 = SEGPTR_NEW(IStorage16_VTable); + memcpy(segstvt16,&stvt16,sizeof(stvt16)); + segstvt16 = (LPSTORAGE16_VTABLE)SEGPTR_GET(segstvt16); + } else { +#define VTENT(x) stvt16.fn##x = IStorage16_##x; + VTENT(QueryInterface) + VTENT(AddRef) + VTENT(Release) + VTENT(CreateStream) + VTENT(OpenStream) + VTENT(CreateStorage) + VTENT(OpenStorage) + VTENT(CopyTo) + VTENT(Commit) + /* not (yet) implemented ... + VTENT(MoveElementTo) + VTENT(Revert) + VTENT(EnumElements) + VTENT(DestroyElement) + VTENT(RenameElement) + VTENT(SetElementTimes) + VTENT(SetClass) + VTENT(SetStateBits) + VTENT(Stat) + */ +#undef VTENT + segstvt16 = &stvt16; + } + } + lpst = SEGPTR_NEW(IStorage16); + lpst->lpvtbl = segstvt16; + lpst->ref = 1; + lpst->thisptr = SEGPTR_GET(lpst); + *stg = (void*)lpst->thisptr; +} + +/****************************************************************************** + * IStorage32 + */ +HRESULT WINAPI IStorage32_QueryInterface( + LPSTORAGE32 this,REFIID refiid,LPVOID *obj +) { + char xrefiid[50]; + + WINE_StringFromCLSID((LPCLSID)refiid,xrefiid); + dprintf_info(relay,"IStorage32(%p)->QueryInterface(%s,%p)\n",this,xrefiid,obj); + + if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { + *obj = this; + return 0; + } + return OLE_E_ENUM_NOMORE; +} + +ULONG WINAPI IStorage32_AddRef(LPSTORAGE32 this) { + return ++(this->ref); +} + +ULONG WINAPI IStorage32_Release(LPSTORAGE32 this) { + this->ref--; + if (this->ref) + return this->ref; + HeapFree(GetProcessHeap(),0,this); + return 0; +} + +HRESULT WINAPI IStorage32_CreateStream( + LPSTORAGE32 this,LPCOLESTR32 pwcsName,DWORD grfMode,DWORD reserved1,DWORD reserved2, IStream32 **ppstm +) { + fprintf(stderr,"IStorage32(%p)->CreateStream(%p,0x%08lx,0x%08lx,0x%08lx,%p)\n", + this,pwcsName,grfMode,reserved1,reserved2,ppstm + ); + *ppstm = (IStream32*)HeapAlloc(GetProcessHeap(),0,sizeof(IStream32)); + (*ppstm)->lpvtbl= &strvt32; + (*ppstm)->ref = 1; + + return OLE_OK; +} + +HRESULT WINAPI IStorage32_OpenStream( + LPSTORAGE32 this,LPCOLESTR32 pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream32 **ppstm +) { + fprintf(stderr,"IStorage32(%p)->OpenStream(%p,%p,0x%08lx,0x%08lx,%p)\n", + this,pwcsName,reserved1,grfMode,reserved2,ppstm + ); + *ppstm = (IStream32*)HeapAlloc(GetProcessHeap(),0,sizeof(IStream32)); + (*ppstm)->lpvtbl= &strvt32; + (*ppstm)->ref = 1; + return OLE_OK; +} + +static IStorage32_VTable stvt32 = { + IStorage32_QueryInterface, + IStorage32_AddRef, + IStorage32_Release, + IStorage32_CreateStream, + IStorage32_OpenStream, + (void*)6, + (void*)7, + (void*)8, + (void*)9, + (void*)10, + (void*)11, + (void*)12, + (void*)13, + (void*)14, + (void*)15, +}; + +/****************************************************************************** + * Storage API functions + */ + +OLESTATUS WINAPI StgCreateDocFile16( + LPCOLESTR16 pwcsName,DWORD grfMode,DWORD reserved,IStorage16 **ppstgOpen +) { + HFILE32 hf; + int i,ret; + LPSTORAGE16 lpstg; + struct storage_pps_entry stde; + + fprintf(stderr,"StgCreateDocfile(%s,0x%08lx,0x%08lx,%p)\n", + pwcsName,grfMode,reserved,ppstgOpen + ); + _create_istorage16(ppstgOpen); + hf = CreateFile32A(pwcsName,GENERIC_READ|GENERIC_WRITE,0,NULL,CREATE_NEW,0,0); + if (hf==INVALID_HANDLE_VALUE32) { + fprintf(stderr,"couldn't open file for storage:%ld\n",GetLastError()); + return E_FAIL; + } + lpstg = (LPSTORAGE16)PTR_SEG_TO_LIN(*ppstgOpen); + lpstg->hf = hf; + /* FIXME: check for existance before overwriting? */ + if (!STORAGE_init_storage(hf)) { + CloseHandle(hf); + return E_FAIL; + } + i=0;ret=0; + while (!ret) { /* neither 1 nor <0 */ + ret=STORAGE_get_pps_entry(hf,i,&stde); + if ((ret==1) && (stde.pps_type==5)) { + lpstg->stde = stde; + lpstg->ppsent = i; + break; + } + i++; + } + if (ret!=1) { + IStorage16_Release(lpstg); /* will remove it */ + return E_FAIL; + } + return OLE_OK; +} + +OLESTATUS WINAPI StgCreateDocFile32( + LPCOLESTR32 pwcsName,DWORD grfMode,DWORD reserved,IStorage32 **ppstgOpen +) { + fprintf(stderr,"StgCreateDocfile(%p,0x%08lx,0x%08lx,%p)\n", + pwcsName,grfMode,reserved,ppstgOpen + ); + *ppstgOpen = (IStorage32*)HeapAlloc(GetProcessHeap(),0,sizeof(IStorage32)); + (*ppstgOpen)->ref = 1; + (*ppstgOpen)->lpvtbl = &stvt32; + return OLE_OK; +} + +OLESTATUS WINAPI StgIsStorageFile16(LPCOLESTR16 fn) { + HFILE32 hf; + OFSTRUCT ofs; + BYTE magic[24]; + + fprintf(stderr,"StgIsStorageFile(%s)",fn); + hf = OpenFile32(fn,&ofs,OF_SHARE_DENY_NONE); + if (hf==HFILE_ERROR32) + return STG_E_FILENOTFOUND; + if (24!=_lread32(hf,magic,24)) { + fprintf(stderr," too short\n"); + _lclose32(hf); + return S_FALSE; + } + if (!memcmp(magic,STORAGE_magic,8)) { + fprintf(stderr," -> YES\n"); + _lclose32(hf); + return S_OK; + } + if (!memcmp(magic,STORAGE_notmagic,8)) { + fprintf(stderr," -> NO\n"); + _lclose32(hf); + return S_FALSE; + } + if (!memcmp(magic,STORAGE_oldmagic,8)) { + fprintf(stderr," -> old format\n"); + _lclose32(hf); + return STG_E_OLDFORMAT; + } + fprintf(stderr," -> Invalid header.\n"); + _lclose32(hf); + return STG_E_INVALIDHEADER; +} + +OLESTATUS WINAPI StgIsStorageFile32(LPCOLESTR32 fn) { + LPOLESTR16 xfn = HEAP_strdupWtoA(GetProcessHeap(),0,fn); + OLESTATUS ret = StgIsStorageFile16(xfn); + + HeapFree(GetProcessHeap(),0,xfn); + return ret; +} + + + +OLESTATUS WINAPI StgOpenStorage16( + const OLECHAR16 * pwcsName,IStorage16 *pstgPriority,DWORD grfMode, + SNB16 snbExclude,DWORD reserved, IStorage16 **ppstgOpen +) { + HFILE32 hf; + int ret,i; + LPSTORAGE16 lpstg; + struct storage_pps_entry stde; + + fprintf(stderr,"StgOpenStorage(%s,%p,0x%08lx,%p,%ld,%p)\n", + pwcsName,pstgPriority,grfMode,snbExclude,reserved,ppstgOpen + ); + _create_istorage16(ppstgOpen); + hf = CreateFile32A(pwcsName,GENERIC_READ,0,NULL,0,0,0); + if (hf==INVALID_HANDLE_VALUE32) { + fprintf(stderr,"couldn't open file for storage\n"); + return E_FAIL; + } + lpstg = (LPSTORAGE16)PTR_SEG_TO_LIN(*ppstgOpen); + lpstg->hf = hf; + + i=0;ret=0; + while (!ret) { /* neither 1 nor <0 */ + ret=STORAGE_get_pps_entry(hf,i,&stde); + if ((ret==1) && (stde.pps_type==5)) { + lpstg->stde=stde; + break; + } + i++; + } + if (ret!=1) { + IStorage16_Release(lpstg); /* will remove it */ + return E_FAIL; + } + return OLE_OK; + +} + +OLESTATUS WINAPI StgOpenStorage32( + const OLECHAR32 * pwcsName,IStorage32 *pstgPriority,DWORD grfMode, + SNB32 snbExclude,DWORD reserved, IStorage32 **ppstgOpen +) { + fprintf(stderr,"StgOpenStorage32(%p,%p,0x%08lx,%p,%ld,%p),stub!\n", + pwcsName,pstgPriority,grfMode,snbExclude,reserved,ppstgOpen + ); + *ppstgOpen = (IStorage32*)HeapAlloc(GetProcessHeap(),0,sizeof(IStorage32)); + (*ppstgOpen)->ref = 1; + (*ppstgOpen)->lpvtbl = &stvt32; + return OLE_OK; +} diff --git a/programs/Makefile.in b/programs/Makefile.in index 2f2e8390309..653c7f376f0 100644 --- a/programs/Makefile.in +++ b/programs/Makefile.in @@ -1,6 +1,8 @@ SUBDIRS = \ + clock \ notepad \ progman \ + view \ winhelp \ winver diff --git a/programs/clock/ChangeLog b/programs/clock/ChangeLog new file mode 100644 index 00000000000..ce10b4fb76b --- /dev/null +++ b/programs/clock/ChangeLog @@ -0,0 +1,14 @@ +Tue Feb 24 23:26:40 1998 Karl Backström + * [language.c] [language.h] NEW + Moved language stuff here. + * [main.c] [winclock.c] [clock.rc] + Made the clock appear in the center. + Fixed problems with menues. + +Mon Feb 23 19:59:27 1998 Marcel Baur + * [ChangeLog] [De.rc] [En.rc] [Sw.rc] [clock.rc] + [license.c] [license.h] [License_En.c] + [README] [TODO] + [main.c] [main.h] [winclock.c] [winclock.h] + + Originals by Marcel Baur diff --git a/programs/clock/De.rc b/programs/clock/De.rc new file mode 100644 index 00000000000..ab1371e4880 --- /dev/null +++ b/programs/clock/De.rc @@ -0,0 +1,33 @@ +/* + * Clock (German resources) + * + * Copyright 1997 Marcel Baur + * + */ + +#define LANGUAGE_ID De +#define LANGUAGE_NUMBER 2 +#define LANGUAGE_MENU_ITEM "&Deutsch" + +/* Menu */ + +#define MENU_PROPERTIES "&Einstellungen" +#define MENU_ANALOG "Ana&log" +#define MENU_DIGITAL "Digi&tal" +#define MENU_FONT "Schrift&art..." +#define MENU_WITHOUT_TITLE "&Ohne Titelleiste" +#define MENU_ON_TOP "&Immer im Vordergrund" +#define MENU_SECONDS "&Sekunden" +#define MENU_DATE "&Datum" + +#define MENU_LANGUAGE "&Sprache" + +#define MENU_INFO "Inf&o..." +#define MENU_INFO_LICENSE "&Lizenz" +#define MENU_INFO_NO_WARRANTY "&KEINE GARANTIE" +#define MENU_INFO_ABOUT_WINE "&Über Uhr..." + +/* Strings */ +#define STRING_CLOCK "Uhr" + +#include "clock.rc" diff --git a/programs/clock/En.rc b/programs/clock/En.rc new file mode 100644 index 00000000000..3330cf7bb34 --- /dev/null +++ b/programs/clock/En.rc @@ -0,0 +1,34 @@ +/* + * Clock (English resources) + * + * Copyright 1998 Marcel Baur + * FIXME: Weak translation ! + */ + +#define LANGUAGE_ID En +#define LANGUAGE_NUMBER 0 +#define LANGUAGE_MENU_ITEM "&English" + +/* Menu */ + +#define MENU_PROPERTIES "&Properties" +#define MENU_ANALOG "Ana&log" +#define MENU_DIGITAL "Digi&tal" +#define MENU_FONT "&Font..." +#define MENU_WITHOUT_TITLE "&Without Titlebar" +#define MENU_ON_TOP "&Always on Top" +#define MENU_SECONDS "&Seconds" +#define MENU_DATE "&Date" + +#define MENU_LANGUAGE "&Language" + +#define MENU_INFO "Inf&o..." +#define MENU_INFO_LICENSE "&License" +#define MENU_INFO_NO_WARRANTY "&NO WARRANTY" +#define MENU_INFO_ABOUT_WINE "&About Clock..." + +/* Strings */ +#define STRING_CLOCK "Clock" + + +#include "clock.rc" diff --git a/programs/clock/License_En.c b/programs/clock/License_En.c new file mode 100644 index 00000000000..bec66d995eb --- /dev/null +++ b/programs/clock/License_En.c @@ -0,0 +1,48 @@ +#include "windows.h" +#include "license.h" + +static CHAR LicenseCaption_En[] = "LICENSE"; +static CHAR License_En[] = "\ +You may without charge, royalty or other payment, copy and\ + distribute copies of this work and derivative works of this work\ + in source or binary form provided that: (1)\ + you appropriately publish on each copy an appropriate copyright\ + notice; (2) faithfully reproduce all prior copyright notices\ + included in the original work (you may also add your own\ + copyright notice); and (3) agree to indemnify and hold all prior\ + authors, copyright holders and licensors of the work harmless\ + from and against all damages arising from use of the work.\ +\n\ +You may distribute sources of derivative works of the work\ + provided that (1) (a) all source files of the original work that\ + have been modified, (b) all source files of the derivative work\ + that contain any party of the original work, and (c) all source\ + files of the derivative work that are necessary to compile, link\ + and run the derivative work without unresolved external calls and\ + with the same functionality of the original work (\"Necessary\ + Sources\") carry a prominent notice explaining the nature and date\ + of the modification and/or creation. You are encouraged to make\ + the Necessary Sources available under this license in order to\ + further the development and acceptance of the work.\ +\n\ +EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED\ + WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING\ + BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A\ + PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS\ + OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR\ + LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF\ + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES."; + +static CHAR NoWarrantyCaption_En[] = "NO WARRANTY"; +static CHAR NoWarranty_En[] = "\ +EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED\ + WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING\ + BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A\ + PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS\ + OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR\ + LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF\ + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES."; + +LICENSE WineLicense_En = {License_En, LicenseCaption_En, + NoWarranty_En, NoWarrantyCaption_En}; + diff --git a/programs/clock/Makefile.in b/programs/clock/Makefile.in new file mode 100644 index 00000000000..06b37d1e1a8 --- /dev/null +++ b/programs/clock/Makefile.in @@ -0,0 +1,47 @@ +DEFS = -DWINELIB +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = none +PROGRAMS = clock +ALL_LIBS = $(WINELIB) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS) +RCFLAGS = -w32 -h + +LANGUAGES = En De Sw +LICENSELANG = En + +MOSTSRCS = \ + language.c \ + license.c \ + winclock.c \ + main.c + +# Some strings need addresses >= 0x10000 +STRINGSRCS = \ + $(LICENSELANG:%=License_%.c) + +RC_SRCS = $(LANGUAGES:%=%.rc) + +C_SRCS = $(MOSTSRCS) $(STRINGSRCS) + +MOSTOBJS = $(MOSTSRCS:.c=.o) +STRINGOBJS = $(STRINGSRCS:.c=.o) $(RC_SRCS:.rc=.o) + +all: check_winerc $(PROGRAMS) + +depend:: $(RC_SRCS:.rc=.h) + +@MAKE_RULES@ + +clock: $(MOSTOBJS) $(STRINGOBJS) + $(CC) -o clock $(MOSTOBJS) $(LDOPTIONS) $(ALL_LIBS) $(STRINGOBJS) + +install: dummy + $(INSTALL_PROGRAM) clock $(bindir)/clock + +$(RC_SRCS:.rc=.c) $(RC_SRCS:.rc=.h): $(WINERC) + +dummy: + +### Dependencies: diff --git a/programs/clock/README b/programs/clock/README new file mode 100644 index 00000000000..40cc048c2b0 --- /dev/null +++ b/programs/clock/README @@ -0,0 +1,18 @@ + + Clock for Wine + ============== + + This is a first attempt to realize a desktop clock for Wine as done in + Windows. It'a an early release and most of the code is still broken. + + Please see file TODO for things to do and keep the file ChangeLog + up to date. + + Code is currently under heavy construction. Nearly all files will + change until next release. You can speed up development of clock + if you send patches and additions directly to my personal email + address . + + I also try to read news:comp.emulators.ms-windows.wine frequently, + so I can also integrate patches posted via usenet. + diff --git a/programs/clock/Sw.rc b/programs/clock/Sw.rc new file mode 100644 index 00000000000..9e58cc9fc17 --- /dev/null +++ b/programs/clock/Sw.rc @@ -0,0 +1,33 @@ +/* + * Clock (Swedish resources) + * + * Copyright 1998 Marcel Baur + * Translated into swedish by Karl Backström + */ + +#define LANGUAGE_ID Sw +#define LANGUAGE_NUMBER 1d +#define LANGUAGE_MENU_ITEM "&Svenska" + +/* Menu */ + +#define MENU_PROPERTIES "&Egenskaper" +#define MENU_ANALOG "Ana&log" +#define MENU_DIGITAL "Digi&tal" +#define MENU_FONT "&Font..." +#define MENU_WITHOUT_TITLE "&Utan Titlebar" +#define MENU_ON_TOP "&Alltid överst" +#define MENU_SECONDS "&Sekunder" +#define MENU_DATE "&Datum" + +#define MENU_LANGUAGE "&Språk" + +#define MENU_INFO "Inf&o..." +#define MENU_INFO_LICENSE "&Licens" +#define MENU_INFO_NO_WARRANTY "&INGEN GARANTI" +#define MENU_INFO_ABOUT_WINE "&Om Klockan..." + +/* Strings */ +#define STRING_CLOCK "Klockan" + +#include "clock.rc" diff --git a/programs/clock/TODO b/programs/clock/TODO new file mode 100644 index 00000000000..7d15d1a233a --- /dev/null +++ b/programs/clock/TODO @@ -0,0 +1,36 @@ + +Some ideas for improvements: +============================ + +- Add Font Selection Dialog (should be CommDlg). + +- Make "Without Titlebar", Double-clicking the clock should reveal the caption + again. + +- Move the "Without Titlebar" into the System Menu (as in Windows) + +- Implement a "digital clock" + +- Font Handling of Digital Clock. + +- Make distinction between analog clock and digital clock according to + Globals.bAnalog setting / CL_ANALOG menu event. + +- Implement Date (Window caption), but mind the different languages. + +- Make distinction between Date / no Date according to + Globals.bDate setting / CL_DATE menu event. + +- Implement Timer Mechanism instead Polling. + Clock does not run if menu is being selected (?). + +- Fix Clock Background (sometimes destroyed). + ( This is because the old "Hands" are removed one more time ) + +- Fix English translation by comparing strings from an original English + Windows Clock application (I only have a German version). + +- Add new .rc resources for all languages you know. + + +Please don't forget a ChangeLog entry. diff --git a/programs/clock/clock.rc b/programs/clock/clock.rc new file mode 100644 index 00000000000..2d79ea5bc03 --- /dev/null +++ b/programs/clock/clock.rc @@ -0,0 +1,60 @@ +/* + * Clock (clock.rc) + * + * Copyright 1998 Marcel Baur + */ + +#include "main.h" + +#define CONCAT(a, b) CONCAT1(a, b) +#define CONCAT1(a, b) a##b + +/* Main Menu */ + +CONCAT(MENU_, LANGUAGE_ID) MENU +{ + POPUP MENU_PROPERTIES { + MENUITEM MENU_ANALOG, CL_ANALOG + MENUITEM MENU_DIGITAL, CL_DIGITAL + MENUITEM SEPARATOR + MENUITEM MENU_FONT, CL_FONT + MENUITEM SEPARATOR + MENUITEM MENU_WITHOUT_TITLE, CL_WITHOUT_TITLE + MENUITEM SEPARATOR + MENUITEM MENU_SECONDS, CL_SECONDS + MENUITEM MENU_DATE, CL_DATE + MENUITEM SEPARATOR + MENUITEM MENU_ON_TOP, CL_ON_TOP + } + POPUP MENU_LANGUAGE { + /* Dummy item, will be removed */ + MENUITEM SEPARATOR + } + + POPUP MENU_INFO { + MENUITEM MENU_INFO_LICENSE, CL_INFO_LICENSE + MENUITEM MENU_INFO_NO_WARRANTY, CL_INFO_NO_WARRANTY + MENUITEM MENU_INFO_ABOUT_WINE, CL_INFO_ABOUT_WINE + } + +} + +/* Strings */ + +#define ADDSTRING(str) ADDSTRING1(LANGUAGE_NUMBER, IDS_ ## str) STRING_ ## str +#define ADDSTRING1(langnum, ids) ADDSTRING2(langnum, ids) +#define ADDSTRING2(langnum, ids) 0x ## langnum ## ids + +#define STRINGIFY(str) STRINGIFY1(str) +#define STRINGIFY1(str) #str + +#define STRING_LANGUAGE_ID STRINGIFY(LANGUAGE_ID) +#define STRING_LANGUAGE_MENU_ITEM LANGUAGE_MENU_ITEM + + +STRINGTABLE +{ +ADDSTRING(LANGUAGE_ID) +ADDSTRING(LANGUAGE_MENU_ITEM) +ADDSTRING(CLOCK) +} diff --git a/programs/clock/language.c b/programs/clock/language.c new file mode 100644 index 00000000000..3074f0d8f1b --- /dev/null +++ b/programs/clock/language.c @@ -0,0 +1,146 @@ +/* + * Clock + * + * Copyright 1998 Marcel Baur + * Copyright 1998 Karl Backström + */ + +#include +#include "windows.h" +#include "main.h" +#include "language.h" +#ifdef WINELIB +#include "options.h" +#endif + +CHAR STRING_MENU_Xx[] = "MENU_Xx"; + +static BOOL LANGUAGE_LoadStringOtherLanguage(UINT num, UINT ids, LPSTR str, UINT len) +{ + ids -= Globals.wStringTableOffset; + ids += num * 0x100; + return(LoadString(Globals.hInstance, ids, str, len)); +}; + +VOID LANGUAGE_SelectLanguageByName(LPCSTR lang) +{ + INT i; + CHAR newlang[3]; + + for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++) + if (LANGUAGE_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang)) && + !lstrcmp(lang, newlang)) + { + LANGUAGE_SelectLanguageByNumber(i); + return; + } + + /* Fallback */ + for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++) + if (LANGUAGE_LoadStringOtherLanguage(i, IDS_LANGUAGE_ID, newlang, sizeof(newlang))) + { + LANGUAGE_SelectLanguageByNumber(i); + return; + } + + MessageBox(Globals.hMainWnd, "No language found", "FATAL ERROR", MB_OK); + PostQuitMessage(1); +} + +VOID LANGUAGE_SelectLanguageByNumber(UINT num) +{ + INT i; + CHAR lang[3]; + CHAR caption[MAX_STRING_LEN]; + CHAR item[MAX_STRING_LEN]; + HMENU hMainMenu; + + /* Select string table */ + Globals.wStringTableOffset = num * 0x100; + + /* Get Language id */ + LoadString(Globals.hInstance, IDS_LANGUAGE_ID, lang, sizeof(lang)); + Globals.lpszLanguage = lang; + printf(" Globals.lpszLanguage: %s\n", Globals.lpszLanguage); + + /* Set frame caption */ + LoadString(Globals.hInstance, IDS_CLOCK, caption, sizeof(caption)); + SetWindowText(Globals.hMainWnd, caption); + + /* Change Resource names */ + lstrcpyn(STRING_MENU_Xx + sizeof(STRING_MENU_Xx) - 3, lang, 3); + + /* Create menu */ + hMainMenu = LoadMenu(Globals.hInstance, STRING_MENU_Xx); + Globals.hPropertiesMenu = GetSubMenu(hMainMenu, 0); + Globals.hLanguageMenu = GetSubMenu(hMainMenu, 1); + Globals.hInfoMenu = GetSubMenu(hMainMenu, 2); + + /* Remove dummy item */ + RemoveMenu(Globals.hLanguageMenu, 0, MF_BYPOSITION); + /* Add language items */ + for (i = 0; i <= MAX_LANGUAGE_NUMBER; i++) + if (LANGUAGE_LoadStringOtherLanguage(i, IDS_LANGUAGE_MENU_ITEM, item, sizeof(item))) + AppendMenu(Globals.hLanguageMenu, MF_STRING | MF_BYCOMMAND, + CL_FIRST_LANGUAGE + i, item); + + SetMenu(Globals.hMainWnd, hMainMenu); + + /* Destroy old menu */ + if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu); + Globals.hMainMenu = hMainMenu; + +#ifdef WINELIB + /* Update system menus */ + for (i = 0; Languages[i].name && lstrcmp(lang, Languages[i].name);) i++; + if (Languages[i].name) Options.language = i; + +#endif + +/* Specific for clock */ +if(Globals.bAnalog == TRUE) { + CheckMenuItem(Globals.hPropertiesMenu, CL_ANALOG, \ + MF_BYCOMMAND | MF_CHECKED); + CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \ + MF_BYCOMMAND | MF_UNCHECKED); +} +else { + CheckMenuItem(Globals.hPropertiesMenu, CL_ANALOG, \ + MF_BYCOMMAND | MF_UNCHECKED); + CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \ + MF_BYCOMMAND | MF_CHECKED); +} + CheckMenuItem(Globals.hPropertiesMenu, CL_WITHOUT_TITLE, MF_BYCOMMAND | \ + (Globals.bWithoutTitle ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(Globals.hPropertiesMenu, CL_ON_TOP, MF_BYCOMMAND | \ + (Globals.bAlwaysOnTop ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(Globals.hPropertiesMenu, CL_SECONDS, MF_BYCOMMAND | \ + (Globals.bSeconds ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(Globals.hPropertiesMenu, CL_DATE, MF_BYCOMMAND | \ + (Globals.bDate ? MF_CHECKED : MF_UNCHECKED)); +} + +VOID LANGUAGE_DefaultLanguageHandle(WPARAM wParam) +{ + if ((wParam >=CL_FIRST_LANGUAGE) && (wParam<=CL_LAST_LANGUAGE)) + LANGUAGE_SelectLanguageByNumber(wParam - CL_FIRST_LANGUAGE); + else printf("Unimplemented menu command %i\n", wParam); +} + +VOID LANGUAGE_InitLanguage(VOID) +{ + #ifdef WINELIB + Globals.lpszLanguage = Languages[Options.language].name; + #else + CHAR buffer[MAX_PATHNAME_LEN], *p; + + PROFILE_GetWineIniString("programs", "language", "language", + buffer, sizeof(buffer)); + Globals.lpszLanguage = p = LocalLock(LocalAlloc(LMEM_FIXED, lstrlen(buffer))); + hmemcpy(p, buffer, 1 + lstrlen(buffer)); + #endif +} + +/* Local Variables: */ +/* c-file-style: "GNU" */ +/* End: */ diff --git a/programs/clock/language.h b/programs/clock/language.h new file mode 100644 index 00000000000..70a7452913a --- /dev/null +++ b/programs/clock/language.h @@ -0,0 +1,15 @@ +/* + * Clock + * + * Copyright 1998 Marcel Baur + * Copyright 1998 Karl Backström + */ + +VOID LANGUAGE_SelectLanguageByNumber(UINT num); +VOID LANGUAGE_SelectLanguageByName(LPCSTR lang); +VOID LANGUAGE_DefaultLanguageHandle(WPARAM wParam); +VOID LANGUAGE_InitLanguage(VOID); + +/* Local Variables: */ +/* c-file-style: "GNU" */ +/* End: */ diff --git a/programs/clock/license.c b/programs/clock/license.c new file mode 100644 index 00000000000..095da576812 --- /dev/null +++ b/programs/clock/license.c @@ -0,0 +1,52 @@ +/* + * Clock (license.c) + * + * Copyright 1998 by Marcel Baur + * Adapted from Program Manager (Original by Ulrich Schmied) + */ + +#include "windows.h" +#include "license.h" + +static LICENSE* SelectLanguage(LPCSTR Language) +{ +/* + if (!lstrcmp(Language, "Ca")) return(&WineLicense_Ca); + if (!lstrcmp(Language, "Cz")) return(&WineLicense_Cz); + if (!lstrcmp(Language, "Da")) return(&WineLicense_Da); + if (!lstrcmp(Language, "De")) return(&WineLicense_De); + if (!lstrcmp(Language, "En")) return(&WineLicense_En); + if (!lstrcmp(Language, "Eo")) return(&WineLicense_Eo); + if (!lstrcmp(Language, "Es")) return(&WineLicense_Es); + if (!lstrcmp(Language, "Fi")) return(&WineLicense_Fi); + if (!lstrcmp(Language, "Fr")) return(&WineLicense_Fr); + if (!lstrcmp(Language, "Hu")) return(&WineLicense_Hu); + if (!lstrcmp(Language, "It")) return(&WineLicense_It); + if (!lstrcmp(Langauge, "Ko")) return(&WineLicense_Ko); + if (!lstrcmp(Language, "No")) return(&WineLicense_No); + if (!lstrcmp(Language, "Pl")) return(&WineLicense_Pl); + if (!lstrcmp(Language, "Po")) return(&WineLicense_Po); + if (!lstrcmp(Language, "Sw")) return(&WineLicense_Sw); + if (!lstrcmp(Language, "Va")) return(&WineLicense_Va); +*/ + return(&WineLicense_En); +} + + +VOID WineLicense(HWND Wnd, LPCSTR Language) +{ + LICENSE *License = SelectLanguage(Language); + + MessageBox(Wnd, License->License, License->LicenseCaption, + MB_ICONINFORMATION | MB_OK); +} + + +VOID WineWarranty(HWND Wnd, LPCSTR Language) +{ + LICENSE *License = SelectLanguage(Language); + + MessageBox(Wnd, License->Warranty, License->WarrantyCaption, + MB_ICONEXCLAMATION | MB_OK); +} + diff --git a/programs/clock/license.h b/programs/clock/license.h new file mode 100644 index 00000000000..de1d403c30e --- /dev/null +++ b/programs/clock/license.h @@ -0,0 +1,48 @@ +/* + * Clock (license.h) + * + * Copyright 1998 by Marcel Baur + * Adapted from Program Manager (Original by Ulrich Schmied) + */ + + +/* function prototypes */ + +VOID WineLicense(HWND hWnd, LPCSTR lpszLanguage); +VOID WineWarranty(HWND hWnd, LPCSTR language); + + +/* typedefs */ + +typedef struct +{ + LPCSTR License, LicenseCaption; + LPCSTR Warranty, WarrantyCaption; +} LICENSE; + + +/* external references */ + +/* +extern LICENSE WineLicense_Ca; +extern LICENSE WineLicense_Cz; +extern LICENSE WineLicense_Da; +extern LICENSE WineLicense_De; +*/ + +extern LICENSE WineLicense_En; + +/* +extern LICENSE WineLicense_Eo; +extern LICENSE WineLicense_Es; +extern LICENSE WineLicense_Fi; +extern LICENSE WineLicense_Fr; +extern LICENSE WineLicense_Hu; +extern LICENSE WineLicense_It; +extern LICENSE WineLicense_Ko; +extern LICENSE WineLicense_No; +extern LICENSE WineLicense_Pl; +extern LICENSE WineLicense_Po; +extern LICENSE WineLicense_Sw; +extern LICENSE WineLicense_Va; +*/ diff --git a/programs/clock/main.c b/programs/clock/main.c new file mode 100644 index 00000000000..33ba6431af2 --- /dev/null +++ b/programs/clock/main.c @@ -0,0 +1,265 @@ +/* + * Clock + * + * Copyright 1998 Marcel Baur + * + * Clock is partially based on + * - Program Manager by Ulrich Schmied + * - rolex.c by Jim Peterson + * + */ + +#include +#include "windows.h" +#include "main.h" +#include "license.h" +#include "version.h" +#include "language.h" +#include "winclock.h" +// #include "commdlg.h" + +#ifdef WINELIB + #include "options.h" + #include "resource.h" + #include "shell.h" + void LIBWINE_Register_De(); + void LIBWINE_Register_En(); + void LIBWINE_Register_Sw(); +#endif + +CLOCK_GLOBALS Globals; + +/*********************************************************************** + * + * CLOCK_MenuCommand + * + * All handling of main menu events + */ + +int CLOCK_MenuCommand (WPARAM wParam) +{ + switch (wParam) { + case CL_ANALOG: { + Globals.bAnalog = TRUE; + CheckMenuItem(Globals.hPropertiesMenu, CL_ANALOG, \ + MF_BYCOMMAND | MF_CHECKED); + CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \ + MF_BYCOMMAND | MF_UNCHECKED); + break; + } + case CL_DIGITAL: { + Globals.bAnalog = FALSE; + CheckMenuItem(Globals.hPropertiesMenu, CL_ANALOG, \ + MF_BYCOMMAND | MF_UNCHECKED); + CheckMenuItem(Globals.hPropertiesMenu, CL_DIGITAL, \ + MF_BYCOMMAND | MF_CHECKED); + break; + } + case CL_FONT: + printf("FONT:"); +/* CHOOSEFONT fontl; + fontl.lStructSize = 0; + fontl.hwndOwner = Globals.hMainWnd; + fontl.hDC = NULL; + fontl.lpLogFont = 0; + fontl.iPointSize = 0; + fontl.Flags = 0; + fontl.rgbColors = 0; + fontl.lCustData = 0; + fontl.lpfnHook = 0; + fontl.lpTemplateName = 0; + fontl.hInstance = Globals.hInstance; + fontl.lpszStyle = 0; + fontl.nFontType = 0; + fontl.nSizeMin = 0; + fontl.nSizeMax = 100; + + if (ChooseFont(&font)); +*/ + break; + case CL_WITHOUT_TITLE: + Globals.bWithoutTitle = !Globals.bWithoutTitle; + CheckMenuItem(Globals.hPropertiesMenu, CL_WITHOUT_TITLE, MF_BYCOMMAND | \ + (Globals.bWithoutTitle ? MF_CHECKED : MF_UNCHECKED)); + printf("NO TITLE:"); + break; + case CL_ON_TOP: + Globals.bAlwaysOnTop = !Globals.bAlwaysOnTop; + CheckMenuItem(Globals.hPropertiesMenu, CL_ON_TOP, MF_BYCOMMAND | \ + (Globals.bAlwaysOnTop ? MF_CHECKED : MF_UNCHECKED)); + break; + case CL_SECONDS: + Globals.bSeconds = !Globals.bSeconds; + CheckMenuItem(Globals.hPropertiesMenu, CL_SECONDS, MF_BYCOMMAND | \ + (Globals.bSeconds ? MF_CHECKED : MF_UNCHECKED)); + break; + case CL_DATE: + Globals.bDate = !Globals.bDate; + CheckMenuItem(Globals.hPropertiesMenu, CL_DATE, MF_BYCOMMAND | \ + (Globals.bDate ? MF_CHECKED : MF_UNCHECKED)); + break; + case CL_INFO_LICENSE: + WineLicense(Globals.hMainWnd, Globals.lpszLanguage); + break; + case CL_INFO_NO_WARRANTY: + WineWarranty(Globals.hMainWnd, Globals.lpszLanguage); + break; + case CL_INFO_ABOUT_WINE: + ShellAbout(Globals.hMainWnd, "Clock", "Clock\n" WINE_RELEASE_INFO, 0); + break; + // Handle languages + default: + LANGUAGE_DefaultLanguageHandle(wParam); + } + return 0; +} + + + +/*********************************************************************** + * + * CLOCK_WndProc + */ + +LRESULT CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + PAINTSTRUCT ps; + HDC context; + + switch (msg) { + + case WM_CREATE: + printf("WM_CREATE\n"); + break; + + case WM_RBUTTONUP: + printf("WM_RBUTTONUP\n"); + break; + + case WM_PAINT: + printf("WM_PAINT\n"); + context = BeginPaint(hWnd, &ps); + if(Globals.bAnalog) { + DrawFace(context); + Idle(context); + } + else { + + } + EndPaint(hWnd, &ps); + break; + + case WM_SIZE: + printf("WM_SIZE\n"); + Globals.MaxX = LOWORD(lParam); + Globals.MaxY = HIWORD(lParam); + break; + + case WM_COMMAND: + CLOCK_MenuCommand(wParam); + break; + + case WM_DESTROY: + printf("WM_DESTROY\n"); + PostQuitMessage (0); + break; + + default: + return DefWindowProc (hWnd, msg, wParam, lParam); + } + return 0l; +} + + + +/*********************************************************************** + * + * WinMain + */ + +void DumpGlobals(void) { + + printf("DumpGlobals()\n"); + printf(" Globals.lpszIniFile: %s\n", Globals.lpszIniFile); + printf(" Globals.lpszIcoFile: %s\n", Globals.lpszIcoFile); + printf("Globals.lpszLanguage: %s\n", Globals.lpszLanguage); + printf(" Globals.hInstance: %i\n", Globals.hInstance); + printf(" Globals.hMainMenu: %i\n", Globals.hMainMenu); + +} + +int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show) +{ + MSG msg; + WNDCLASS class; + char className[] = "CLClass"; /* To make sure className >= 0x10000 */ + char winName[] = "Clock"; + + #if defined(WINELIB) && !defined(HAVE_WINE_CONSTRUCTOR) + /* Register resources */ + LIBWINE_Register_De(); + LIBWINE_Register_En(); + LIBWINE_Register_Sw(); + #endif + + printf("WinMain()\n"); + + /* Setup Globals */ + + Globals.bAnalog = TRUE; + Globals.bSeconds = TRUE; + Globals.lpszIniFile = "clock.ini"; + Globals.lpszIcoFile = "clock.ico"; + + /* Select Language */ + LANGUAGE_InitLanguage(); + + Globals.hInstance = hInstance; + Globals.hMainIcon = ExtractIcon(Globals.hInstance, + Globals.lpszIcoFile, 0); + if (!Globals.hMainIcon) Globals.hMainIcon = + LoadIcon(0, MAKEINTRESOURCE(DEFAULTICON)); + + DumpGlobals(); + + if (!prev){ + class.style = CS_HREDRAW | CS_VREDRAW; + class.lpfnWndProc = CLOCK_WndProc; + class.cbClsExtra = 0; + class.cbWndExtra = 0; + class.hInstance = Globals.hInstance; + class.hIcon = LoadIcon (0, IDI_APPLICATION); + class.hCursor = LoadCursor (0, IDC_ARROW); + class.hbrBackground = GetStockObject (GRAY_BRUSH); + class.lpszMenuName = "\0"; + class.lpszClassName = (SEGPTR)className; + } + if (!RegisterClass (&class)) + return FALSE; + + Globals.hMainWnd = CreateWindow (className, winName, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, CW_USEDEFAULT, Globals.MaxX, Globals.MaxY, + LoadMenu(Globals.hInstance, STRING_MENU_Xx), + Globals.hInstance, 0); + + LANGUAGE_SelectLanguageByName(Globals.lpszLanguage); + SetMenu(Globals.hMainWnd, Globals.hMainMenu); + ShowWindow (Globals.hMainWnd, show); + UpdateWindow (Globals.hMainWnd); + + while (TRUE) { + Sleep(1); + if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { + if (msg.message == WM_QUIT) return msg.wParam; + TranslateMessage(&msg); + DispatchMessage(&msg); + Idle(NULL); + } + else Idle(NULL); + } + + // We will never reach the following statement ! + return 0; +} + + diff --git a/programs/clock/main.h b/programs/clock/main.h new file mode 100644 index 00000000000..63741c9a805 --- /dev/null +++ b/programs/clock/main.h @@ -0,0 +1,84 @@ +/* + * Clock (main.h) + * + * Copyright 1998 Marcel Baur + */ + +#define MAX_STRING_LEN 255 +#define MAX_PATHNAME_LEN 1024 +#define MAX_LANGUAGE_NUMBER (CL_LAST_LANGUAGE - CL_FIRST_LANGUAGE) + +#define HELPFILE "clock.hlp" +#define DEFAULTICON OIC_WINEICON + +/* hide the following from winerc */ +#ifndef RC_INVOKED + +typedef struct +{ + HANDLE hInstance; + HWND hMainWnd; + HICON hMainIcon; + HICON hDefaultIcon; + HMENU hMainMenu; + HMENU hPropertiesMenu; + HMENU hLanguageMenu; + HMENU hInfoMenu; + LPCSTR lpszIniFile; + LPCSTR lpszIcoFile; + LPCSTR lpszLanguage; + UINT wStringTableOffset; + + BOOL bAnalog; + BOOL bAlwaysOnTop; + BOOL bWithoutTitle; + BOOL bSeconds; + BOOL bDate; + + int MaxX; + int MaxY; +} CLOCK_GLOBALS; + +extern CLOCK_GLOBALS Globals; + +/* function prototypes */ +VOID MAIN_SelectLanguageByName(LPCSTR); +VOID MAIN_SelectLanguageByNumber(UINT); + +/* class names */ + +/* Resource names */ +extern CHAR STRING_MENU_Xx[]; + + #define STRINGID(id) (0x##id + Globals.wStringTableOffset) + +#else /* RC_INVOKED */ + + #define STRINGID(id) id + +#endif + +/* string table index */ +#define IDS_LANGUAGE_ID STRINGID(00) +#define IDS_LANGUAGE_MENU_ITEM STRINGID(01) +#define IDS_CLOCK STRINGID(02) + +/* main menu */ + +#define CL_ANALOG 100 +#define CL_DIGITAL 101 +#define CL_FONT 102 +#define CL_WITHOUT_TITLE 103 +#define CL_ON_TOP 104 +#define CL_SECONDS 105 +#define CL_DATE 106 + +#define CL_LANGUAGE 108 + +#define CL_INFO 186 +#define CL_INFO_LICENSE 187 +#define CL_INFO_NO_WARRANTY 188 +#define CL_INFO_ABOUT_WINE 189 + +#define CL_FIRST_LANGUAGE 109 +#define CL_LAST_LANGUAGE 185 diff --git a/programs/clock/winclock.c b/programs/clock/winclock.c new file mode 100644 index 00000000000..4e7af5fd6af --- /dev/null +++ b/programs/clock/winclock.c @@ -0,0 +1,206 @@ +/* + * Clock (winclock.c) + * + * Copyright 1998 by Marcel Baur + * + * This file is based on rolex.c by Jim Peterson. + * + * I just managed to move the relevant parts into the Clock application + * and made it look like the original Windows one. You can find the original + * rolex.c in the wine /libtest directory. + * + * Original file header: + * > + * > rolex.c: Windows clock application for WINE (by Jim Peterson) + * > + * > This is a translation of a Turbo Pascal OWL application I made + * > once, so it's a little flaky (tons of globals, functions that + * > could have been in-lined, etc.). The source code should easily + * > compile with a standard Win32 C compiler. + * > + * > To try it out, type 'make rolex'. + * > + * + */ + +#include +#include +#include "winclock.h" +#include "windows.h" +#include "main.h" + +COLORREF FaceColor = RGB(192,192,192); +COLORREF HandColor = RGB(0,0,0); +COLORREF EtchColor = RGB(0,0,0); + +float Pi=3.1415926; + +HandData OldSecond,OldHour,OldMinute; + +int MiddleX(void) { + int X, diff; + + X = (Globals.MaxX/2); + diff = (Globals.MaxX-Globals.MaxY); + if (diff>0) { X = (X-(diff/2)); } + return X; +} + +int MiddleY(void) { + int Y, diff; + + Y = (Globals.MaxY/2); + diff = (Globals.MaxX-Globals.MaxY); + if (diff<0) { Y = Y+(diff/2); } + return Y; +} + +void DrawFace(HDC dc) +{ + int MidX, MidY, t, DiffX, DiffY; + + MidX = MiddleX(); + MidY = MiddleY(); + DiffX = (Globals.MaxX-MidX*2)/2; + DiffY = (Globals.MaxY-MidY*2)/2; + + SelectObject(dc,CreateSolidBrush(FaceColor)); + SelectObject(dc,CreatePen(PS_SOLID,1,EtchColor)); + Ellipse(dc,DiffX,DiffY,2*MidX+DiffX,2*MidY+DiffY); + + for(t=0; t<12; t++) + { + MoveToEx(dc,(MidX+DiffX)+sin(t*Pi/6)*0.9*MidX,(MidY+DiffY)-cos(t*Pi/6)*0.9*MidY,NULL); + LineTo(dc,(MidY+DiffX)+sin(t*Pi/6)*0.8*MidX,(MidY+DiffY)-cos(t*Pi/6)*0.8*MidY); + } + if(Globals.MaxX>64 && Globals.MaxY>64) + for(t=0; t<60; t++) + SetPixel(dc,(MidX+DiffX)+sin(t*Pi/30)*0.9*MidX,(MidY+DiffY)-cos(t*Pi/30)*0.9*MidY + ,EtchColor); + DeleteObject(SelectObject(dc,GetStockObject(NULL_BRUSH))); + DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); + memset(&OldSecond,0,sizeof(OldSecond)); + memset(&OldMinute,0,sizeof(OldMinute)); + memset(&OldHour,0,sizeof(OldHour)); +} + +void DrawHourHand(HDC dc) +{ + MoveToEx(dc, OldHour.StartX, OldHour.StartY, NULL); + LineTo(dc, OldHour.EndX, OldHour.EndY); +} + +void DrawMinuteHand(HDC dc) +{ + MoveToEx(dc, OldMinute.StartX, OldMinute.StartY, NULL); + LineTo(dc, OldMinute.EndX, OldMinute.EndY); +} + +void DrawSecondHand(HDC dc) +{ + MoveToEx(dc, OldSecond.StartX, OldSecond.StartY, NULL); + LineTo(dc, OldSecond.EndX, OldSecond.EndY); +} + +BOOL UpdateHourHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos) +{ + int Sx, Sy, Ex, Ey; + BOOL rv; + + rv = FALSE; + Sx = MidX; Sy = MidY; + Ex = MidX+sin(Pos*Pi/6000)*XExt; + Ey = MidY-cos(Pos*Pi/6000)*YExt; + rv = ( Sx!=OldHour.StartX || Ex!=OldHour.EndX || + Sy!=OldHour.StartY || Ey!=OldHour.EndY ); + if (Globals.bAnalog && rv)DrawHourHand(dc); + OldHour.StartX = Sx; OldHour.EndX = Ex; + OldHour.StartY = Sy; OldHour.EndY = Ey; + return rv; +} + +BOOL UpdateMinuteHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos) +{ + int Sx, Sy, Ex, Ey; + BOOL rv; + + rv = FALSE; + Sx = MidX; Sy = MidY; + Ex = MidX+sin(Pos*Pi/30000)*XExt; + Ey = MidY-cos(Pos*Pi/30000)*YExt; + rv = ( Sx!=OldMinute.StartX || Ex!=OldMinute.EndX || + Sy!=OldMinute.StartY || Ey!=OldMinute.EndY ); + if (Globals.bAnalog && rv)DrawMinuteHand(dc); + OldMinute.StartX = Sx; OldMinute.EndX = Ex; + OldMinute.StartY = Sy; OldMinute.EndY = Ey; + return rv; +} + +BOOL UpdateSecondHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos) +{ + int Sx, Sy, Ex, Ey; + BOOL rv; + + rv = FALSE; + + if (Globals.bSeconds) { + Sx = MidX; Sy = MidY; + Ex = MidX+sin(Pos*Pi/3000)*XExt; + Ey = MidY-cos(Pos*Pi/3000)*YExt; + rv = ( Sx!=OldSecond.StartX || Ex!=OldSecond.EndX || + Sy!=OldSecond.StartY || Ey!=OldSecond.EndY ); + if (Globals.bAnalog && rv)DrawSecondHand(dc); + OldSecond.StartX = Sx; OldSecond.EndX = Ex; + OldSecond.StartY = Sy; OldSecond.EndY = Ey; + } + + return rv; +} + +void Idle(HDC idc) +{ + SYSTEMTIME st; + WORD H, M, S, F; + int MidX, MidY, DiffX, DiffY; + HDC dc; + BOOL Redraw; + + if(idc) + dc=idc; + else + dc=GetDC(Globals.hMainWnd); + if(!dc)return; + + GetLocalTime(&st); + H = st.wHour; + M = st.wMinute; + S = st.wSecond; + F = st.wMilliseconds / 10; + F = F + S*100; + M = M*1000+F/6; + H = H*1000+M/60; + MidX = MiddleX(); + MidY = MiddleY(); + DiffX = (Globals.MaxX-MidX*2)/2; + DiffY = (Globals.MaxY-MidY*2)/2; + + SelectObject(dc,CreatePen(PS_SOLID,1,FaceColor)); + Redraw = FALSE; + if(UpdateHourHand(dc,MidX+DiffX,MidY+DiffY,MidX*0.5,MidY*0.5,H)) Redraw = TRUE; + if(UpdateMinuteHand(dc,MidX+DiffX,MidY+DiffY,MidX*0.65,MidY*0.65,M)) Redraw = TRUE; + if(UpdateSecondHand(dc,MidX+DiffX,MidY+DiffY,MidX*0.79,MidY*0.79,F)) Redraw = TRUE; + if (Globals.bAnalog) + { + DeleteObject(SelectObject(dc,CreatePen(PS_SOLID,1,HandColor))); + if(Redraw) + { + DrawSecondHand(dc); + DrawMinuteHand(dc); + DrawHourHand(dc); + } + DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); + } + if(!idc) ReleaseDC(Globals.hMainWnd,dc); +} + +// class.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1); diff --git a/programs/clock/winclock.h b/programs/clock/winclock.h new file mode 100644 index 00000000000..bbeb73da494 --- /dev/null +++ b/programs/clock/winclock.h @@ -0,0 +1,30 @@ +/* + * Clock (winclock.h) + * + * Copyright 1998 by Marcel Baur + * This file is essentially rolex.c by Jim Peterson. + * Please see my winclock.c and/or his rolex.c for references. + * + */ + + #include + +typedef struct +{ + int StartX,StartY,EndX,EndY; +} HandData; + +/* function prototypes */ + + +void DrawFace(HDC dc); + + +void DrawHourHand(HDC dc); +void DrawMinuteHand(HDC dc); +void DrawSecondHand(HDC dc); +BOOL UpdateHourHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos); +BOOL UpdateMinuteHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos); +BOOL UpdateSecondHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos); +void Idle(HDC idc); + diff --git a/programs/view/Makefile.in b/programs/view/Makefile.in new file mode 100644 index 00000000000..5efd9f91fec --- /dev/null +++ b/programs/view/Makefile.in @@ -0,0 +1,32 @@ +DEFS = -DWINELIB +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = none +PROGRAMS = view +ALL_LIBS = $(WINELIB) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS) +RCFLAGS = -w32 -h + +C_SRCS = \ + init.c \ + view.c \ + winmain.c + +all: check_winerc $(PROGRAMS) + +depend:: $(RC_SRCS:.rc=.h) + +@MAKE_RULES@ + +view: $(OBJS) + $(CC) -o view $(OBJS) $(LDOPTIONS) $(ALL_LIBS) + +install: dummy + $(INSTALL_PROGRAM) view $(bindir)/view + +$(RC_SRCS:.rc=.c) $(RC_SRCS:.rc=.h): $(WINERC) + +dummy: + +### Dependencies: diff --git a/programs/view/globals.h b/programs/view/globals.h new file mode 100644 index 00000000000..40a27c1ffdb --- /dev/null +++ b/programs/view/globals.h @@ -0,0 +1,29 @@ +/* Add global function prototypes here */ + +BOOL InitApplication(HINSTANCE); +BOOL InitInstance(HINSTANCE, int); +BOOL CenterWindow(HWND, HWND); + +/* Add new callback function prototypes here */ + +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); + +/* Global variable declarations */ + +extern HINSTANCE hInst; /* The current instance handle */ +extern char szAppName[]; /* The name of this application */ +extern char szTitle[]; /* The title bar text */ + +typedef struct +{ + DWORD key; + HANDLE hmf; + RECT bbox; + WORD inch; + DWORD reserved; + WORD checksum; +} APMFILEHEADER; + +#define APMHEADER_KEY 0x9AC6CDD7l + + diff --git a/programs/view/init.c b/programs/view/init.c new file mode 100644 index 00000000000..eeaa149022c --- /dev/null +++ b/programs/view/init.c @@ -0,0 +1,84 @@ +#include +#include "globals.h" +#include "resource.h" + +/* global variables */ + +HINSTANCE hInst; +char szAppName[9]; +char szTitle[40]; + +BOOL InitApplication(HINSTANCE hInstance) +{ + WNDCLASSEX wc; + + /* Load the application name and description strings */ + + LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName)); + LoadString(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle)); + + /* Fill in window class structure with parameters that describe the + main window */ + + wc.cbSize = sizeof(WNDCLASSEX); + + /* Load small icon image */ + wc.hIconSm = LoadImage(hInstance, + MAKEINTRESOURCE(IDI_APPICON), + IMAGE_ICON, + 16, 16, + 0); + + wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s) */ + wc.lpfnWndProc = (WNDPROC)WndProc; /* Window Procedure */ + wc.cbClsExtra = 0; /* No per-class extra data */ + wc.cbWndExtra = 0; /* No per-window extra data */ + wc.hInstance = hInstance; /* Owner of this class */ + wc.hIcon = LoadIcon(hInstance, szAppName); /* Icon name from .rc */ + wc.hCursor = LoadCursor(NULL, IDC_ARROW); /* Cursor */ + wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); /* Default color */ + wc.lpszMenuName = szAppName; /* Menu name from .rc */ + wc.lpszClassName = szAppName; /* Name to register as */ + + /* Register the window class and return FALSE if unsuccesful */ + + if (!RegisterClassEx(&wc)) + { + if (!RegisterClass((LPWNDCLASS)&wc.style)) + return FALSE; + } + + /* Call module specific initialization functions here */ + + return TRUE; +} + +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + HWND hwnd; + + /* Save the instance handle in a global variable for later use */ + hInst = hInstance; + + /* Create main window */ + hwnd = CreateWindow(szAppName, /* See RegisterClass() call */ + szTitle, /* window title */ + WS_OVERLAPPEDWINDOW, /* Window style */ + CW_USEDEFAULT, 0, /* positioning */ + CW_USEDEFAULT, 0, /* size */ + NULL, /* Overlapped has no parent */ + NULL, /* Use the window class menu */ + hInstance, + NULL); + + if (!hwnd) + return FALSE; + + /* Call module specific instance initialization functions here */ + + /* show the window, and paint it for the first time */ + ShowWindow(hwnd, nCmdShow); + UpdateWindow(hwnd); + + return TRUE; +} diff --git a/programs/view/lccmakefile b/programs/view/lccmakefile new file mode 100644 index 00000000000..dbd19aee363 --- /dev/null +++ b/programs/view/lccmakefile @@ -0,0 +1,19 @@ + +WINE = ../../wine +LCCINC = c:\\lcc\\include +OBJS = view.obj init.obj winmain.obj +RES = viewrc.res + +.SUFFIXES: .rc .obj .res + +.c.obj: + $(WINE) "lcc -I$(LCCINC) $<" + +.rc.res: + $(WINE) "lrc $<" + +view.exe: $(OBJS) $(RES) + $(WINE) "lcclnk $(OBJS) $(RES)" + +clean: + rm *.exe *.obj *.res diff --git a/programs/view/resource.h b/programs/view/resource.h new file mode 100644 index 00000000000..0ff2b5c40d3 --- /dev/null +++ b/programs/view/resource.h @@ -0,0 +1,10 @@ +#define IDS_APPNAME 1 +#define IDS_DESCRIPTION 2 +#define IDI_APPICON 101 +#define IDM_EXIT 1000 +#define IDM_HELLO 501 +#define IDM_OPEN 502 +#define IDM_LEFT 601 +#define IDM_RIGHT 602 +#define IDM_UP 603 +#define IDM_DOWN 604 diff --git a/programs/view/view.c b/programs/view/view.c new file mode 100644 index 00000000000..52fb99a5294 --- /dev/null +++ b/programs/view/view.c @@ -0,0 +1,193 @@ +#include + +/* +#include + Wine doesn't have windowsx.h, so we use this +*/ +#define GET_WM_COMMAND_ID(wp,lp) LOWORD(wp) + +/* Wine seems to need this */ +#include + +#include "globals.h" +#include "resource.h" + +BOOL FileIsPlaceable( LPCSTR szFileName ); +HMETAFILE GetPlaceableMetaFile( LPCSTR szFileName ); + +#define FN_LENGTH 80 + +HMETAFILE hmf; +int deltax = 0, deltay = 0; +int width = 0, height = 0; +BOOL isAldus; + +BOOL FileOpen(HWND hWnd, char *fn) +{ + OPENFILENAME ofn = { sizeof(OPENFILENAME), + 0, NULL, "Metafiles\0*.wmf\0", NULL, 0, 0, NULL, + FN_LENGTH, NULL, 0, NULL, NULL, OFN_CREATEPROMPT | + OFN_SHOWHELP, 0, 0, NULL, 0, NULL }; + ofn.hwndOwner = hWnd; + ofn.lpstrFile = fn; + return GetOpenFileName(&ofn); +} + + +LRESULT CALLBACK WndProc(HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + switch (uMessage) + { + case WM_PAINT: + { + PAINTSTRUCT ps; + BeginPaint(hwnd, &ps); + SetMapMode(ps.hdc, MM_ANISOTROPIC); + SetViewportExt(ps.hdc, width, height); + SetViewportOrgEx(ps.hdc, deltax, deltay, NULL); + if(hmf) PlayMetaFile(ps.hdc, hmf); + EndPaint(hwnd, &ps); + + } + break; + + case WM_COMMAND: /* message: command from application menu */ + switch (GET_WM_COMMAND_ID(wparam,lparam)) + { + case IDM_HELLO: + MessageBox( hwnd , "Hello there world!", "Hello", MB_OK); + break; + + case IDM_OPEN: + { + char filename[FN_LENGTH]; + if (FileOpen(hwnd, filename)) { + isAldus = FileIsPlaceable(filename); + if (isAldus) { +#if 0 + hmf = GetPlaceableMetaFile(filename); +#else + MessageBox(hwnd, "This is an Aldus placeable metafile: I can't deal with those!", + "Aldus", MB_OK); +#endif + } else { + RECT r; + hmf = GetMetaFile(filename); + GetClientRect(hwnd, &r); + width = r.right - r.left; + height = r.bottom - r.top; + } + InvalidateRect( hwnd, NULL, TRUE ); + } + } + break; + + case IDM_LEFT: + deltax += 100; + InvalidateRect( hwnd, NULL, TRUE ); + break; + case IDM_RIGHT: + deltax -= 100; + InvalidateRect( hwnd, NULL, TRUE ); + break; + case IDM_UP: + deltay += 100; + InvalidateRect( hwnd, NULL, TRUE ); + break; + case IDM_DOWN: + deltay -= 100; + InvalidateRect( hwnd, NULL, TRUE ); + break; + + case IDM_EXIT: + DestroyWindow(hwnd); + break; + + default: + return DefWindowProc(hwnd, uMessage, wparam, lparam); + } + break; + + case WM_DESTROY: /* message: window being destroyed */ + PostQuitMessage(0); + break; + + default: /* Passes it on if unproccessed */ + return DefWindowProc(hwnd, uMessage, wparam, lparam); + } + return 0; +} + +BOOL FileIsPlaceable( LPCSTR szFileName ) +{ + HFILE hInFile; + OFSTRUCT inof; + APMFILEHEADER apmh; + + if( (hInFile = OpenFile( szFileName, &inof, OF_READ ) ) == HFILE_ERROR ) + return FALSE; + + if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) ) + != sizeof(APMFILEHEADER) ) + { + _lclose( hInFile ); + return FALSE; + } + _lclose( hInFile ); + + /* Is it placeable? */ + return (apmh.key == APMHEADER_KEY); +} + +/* this code doesn't work */ +HMETAFILE GetPlaceableMetaFile( LPCSTR szFileName ) +{ + HANDLE hData; + LPSTR lpData; + METAHEADER mfHeader; + APMFILEHEADER APMHeader; + HMETAFILE hmf = NULL; + HFILE fh; + OFSTRUCT inof; + + if( (fh = OpenFile( szFileName, &inof, OF_READ ) ) == HFILE_ERROR ) return NULL; + _llseek(fh, 0, 0); + if (!_lread(fh, (LPSTR)&APMHeader, sizeof(APMFILEHEADER))) return NULL; + _llseek(fh, sizeof(APMFILEHEADER), 0); + if (!_lread(fh, (LPSTR)&mfHeader, sizeof(METAHEADER))) return NULL; + + /* somehow mtSize is being swapped */ + + if (!(hData = GlobalAlloc(GHND, (mfHeader.mtSize * 2L)))) return NULL; + + if (!(lpData = GlobalLock(hData))) + { + GlobalFree(hData); + return NULL; + } + + _llseek(fh, sizeof(APMFILEHEADER), 0); + if (!_lread(fh, lpData, (UINT)(mfHeader.mtSize * 2L))) + { + GlobalUnlock(hData); + GlobalFree(hData); + return NULL; + } + _lclose(fh); + GlobalUnlock(hData); + + if (!(hmf = (HMETAFILE) SetMetaFileBits(hData))) return NULL; + + + width = APMHeader.bbox.right - APMHeader.bbox.left; + height = APMHeader.bbox.bottom - APMHeader.bbox.top; + deltax = 0; + deltay = 0 ; + return hmf; +} + + + diff --git a/programs/view/viewrc.rc b/programs/view/viewrc.rc new file mode 100644 index 00000000000..c493950abec --- /dev/null +++ b/programs/view/viewrc.rc @@ -0,0 +1,60 @@ +#include "resource.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +/*IDI_APPICON ICON DISCARDABLE "view.ico"*/ + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +VIEW MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Open", IDM_OPEN + MENUITEM "E&xit", IDM_EXIT + END + POPUP "&Pan" + BEGIN + MENUITEM "&Left", IDM_LEFT + MENUITEM "&Right", IDM_RIGHT + MENUITEM "&Up", IDM_UP + MENUITEM "&Down", IDM_DOWN + END + POPUP "&Info" + BEGIN + MENUITEM "&Hello", IDM_HELLO + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +VIEW ACCELERATORS +BEGIN + "Q", IDM_EXIT, CONTROL +END + + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME "View" + IDS_DESCRIPTION "Regular Metafile Viewer" +END + + + diff --git a/programs/view/winmain.c b/programs/view/winmain.c new file mode 100644 index 00000000000..70e4b8cb408 --- /dev/null +++ b/programs/view/winmain.c @@ -0,0 +1,49 @@ +#include /* required for all Windows applications */ +#include "globals.h" /* prototypes specific to this application */ + + +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + HANDLE hAccelTable; + + /* Other instances of app running? */ + if (!hPrevInstance) + { + /* stuff to be done once */ + if (!InitApplication(hInstance)) + { + return FALSE; /* exit */ + } + } + + /* stuff to be done every time */ + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + hAccelTable = LoadAccelerators(hInstance, szAppName); + + /* Main loop */ + /* Acquire and dispatch messages until a WM_QUIT message is received */ + while (GetMessage(&msg, NULL, 0, 0)) + { + /* Add other Translation functions (for modeless dialogs + and/or MDI windows) here. */ + + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + /* Add module specific instance free/delete functions here */ + + /* Returns the value from PostQuitMessage */ + return msg.wParam; +} diff --git a/programs/winhelp/macro.lex.l b/programs/winhelp/macro.lex.l index f0d14981317..0e6823d12f5 100644 --- a/programs/winhelp/macro.lex.l +++ b/programs/winhelp/macro.lex.l @@ -21,98 +21,98 @@ static INT nested_quotes = 0; #define YY_NO_UNPUT %} %% -About yylval = MACRO_About; return VOID_FUNCTION_VOID; -AddAccelerator|AA yylval = MACRO_AddAccelerator; return VOID_FUNCTION_2UINT_STRING; -ALink|AL yylval = MACRO_ALink; return VOID_FUNCTION_STRING_UINT_STRING; -Annotate yylval = MACRO_Annotate; return VOID_FUNCTION_VOID; -AppendItem yylval = MACRO_AppendItem; return VOID_FUNCTION_4STRING; -Back yylval = MACRO_Back; return VOID_FUNCTION_VOID; -BackFlush|BF yylval = MACRO_BackFlush; return VOID_FUNCTION_VOID; -BookmarkDefine yylval = MACRO_BookmarkDefine; return VOID_FUNCTION_VOID; -BookmarkMore yylval = MACRO_BookmarkMore; return VOID_FUNCTION_VOID; -BrowseButtons yylval = MACRO_BrowseButtons; return VOID_FUNCTION_VOID; -ChangeButtonBinding|CBB yylval = MACRO_ChangeButtonBinding; return VOID_FUNCTION_2STRING; -ChangeEnable|CE yylval = MACRO_ChangeEnable; return VOID_FUNCTION_2STRING; -ChangeItemBinding|CIB yylval = MACRO_ChangeItemBinding; return VOID_FUNCTION_2STRING; -CheckItem|CI yylval = MACRO_CheckItem; return VOID_FUNCTION_STRING; -CloseSecondarys|CS yylval = MACRO_CloseSecondarys; return VOID_FUNCTION_VOID; -CloseWindow|CW yylval = MACRO_CloseWindow; return VOID_FUNCTION_STRING; -Compare yylval = MACRO_Compare; return VOID_FUNCTION_STRING; -Contents yylval = MACRO_Contents; return VOID_FUNCTION_VOID; -ControlPanel yylval = MACRO_ControlPanel; return VOID_FUNCTION_2STRING_UINT; -CopyDialog yylval = MACRO_CopyDialog; return VOID_FUNCTION_VOID; -CopyTopic|CT yylval = MACRO_CopyTopic; return VOID_FUNCTION_VOID; -CreateButton|CB yylval = MACRO_CreateButton; return VOID_FUNCTION_3STRING; -DeleteItem yylval = MACRO_DeleteItem; return VOID_FUNCTION_STRING; -DeleteMark yylval = MACRO_DeleteMark; return VOID_FUNCTION_STRING; -DestroyButton yylval = MACRO_DestroyButton; return VOID_FUNCTION_STRING; -DisableButton|DB yylval = MACRO_DisableButton; return VOID_FUNCTION_STRING; -DisableItem|DI yylval = MACRO_DisableItem; return VOID_FUNCTION_STRING; -EnableButton|EB yylval = MACRO_EnableButton; return VOID_FUNCTION_STRING; -EnableItem|EI yylval = MACRO_EnableItem; return VOID_FUNCTION_STRING; -EndMPrint yylval = MACRO_EndMPrint; return VOID_FUNCTION_VOID; -ExecFile|EF yylval = MACRO_ExecFile; return VOID_FUNCTION_2STRING_UINT_STRING; -ExecProgram|EP yylval = MACRO_ExecProgram; return VOID_FUNCTION_STRING_UINT; -Exit yylval = MACRO_Exit; return VOID_FUNCTION_VOID; -ExtAbleItem yylval = MACRO_ExtAbleItem; return VOID_FUNCTION_STRING_UINT; -ExtInsertItem yylval = MACRO_ExtInsertItem; return VOID_FUNCTION_4STRING_2UINT; -ExtInsertMenu yylval = MACRO_ExtInsertMenu; return VOID_FUNCTION_3STRING_2UINT; -FileExist|FE yylval = MACRO_FileExist; return BOOL_FUNCTION_STRING; -FileOpen|FO yylval = MACRO_FileOpen; return VOID_FUNCTION_VOID; -Find yylval = MACRO_Find; return VOID_FUNCTION_VOID; -Finder|FD yylval = MACRO_Finder; return VOID_FUNCTION_VOID; -FloatingMenu yylval = MACRO_FloatingMenu; return VOID_FUNCTION_VOID; -Flush|FH yylval = MACRO_Flush; return VOID_FUNCTION_VOID; -FocusWindow yylval = MACRO_FocusWindow; return VOID_FUNCTION_STRING; -Generate yylval = MACRO_Generate; return VOID_FUNCTION_STRING_WPARAM_LPARAM; -GotoMark yylval = MACRO_GotoMark; return VOID_FUNCTION_STRING; -HelpOn yylval = MACRO_HelpOn; return VOID_FUNCTION_VOID; -HelpOnTop yylval = MACRO_HelpOnTop; return VOID_FUNCTION_VOID; -History yylval = MACRO_History; return VOID_FUNCTION_VOID; +About yylval = (YYSTYPE)MACRO_About; return VOID_FUNCTION_VOID; +AddAccelerator|AA yylval = (YYSTYPE)MACRO_AddAccelerator; return VOID_FUNCTION_2UINT_STRING; +ALink|AL yylval = (YYSTYPE)MACRO_ALink; return VOID_FUNCTION_STRING_UINT_STRING; +Annotate yylval = (YYSTYPE)MACRO_Annotate; return VOID_FUNCTION_VOID; +AppendItem yylval = (YYSTYPE)MACRO_AppendItem; return VOID_FUNCTION_4STRING; +Back yylval = (YYSTYPE)MACRO_Back; return VOID_FUNCTION_VOID; +BackFlush|BF yylval = (YYSTYPE)MACRO_BackFlush; return VOID_FUNCTION_VOID; +BookmarkDefine yylval = (YYSTYPE)MACRO_BookmarkDefine; return VOID_FUNCTION_VOID; +BookmarkMore yylval = (YYSTYPE)MACRO_BookmarkMore; return VOID_FUNCTION_VOID; +BrowseButtons yylval = (YYSTYPE)MACRO_BrowseButtons; return VOID_FUNCTION_VOID; +ChangeButtonBinding|CBB yylval = (YYSTYPE)MACRO_ChangeButtonBinding; return VOID_FUNCTION_2STRING; +ChangeEnable|CE yylval = (YYSTYPE)MACRO_ChangeEnable; return VOID_FUNCTION_2STRING; +ChangeItemBinding|CIB yylval = (YYSTYPE)MACRO_ChangeItemBinding; return VOID_FUNCTION_2STRING; +CheckItem|CI yylval = (YYSTYPE)MACRO_CheckItem; return VOID_FUNCTION_STRING; +CloseSecondarys|CS yylval = (YYSTYPE)MACRO_CloseSecondarys; return VOID_FUNCTION_VOID; +CloseWindow|CW yylval = (YYSTYPE)MACRO_CloseWindow; return VOID_FUNCTION_STRING; +Compare yylval = (YYSTYPE)MACRO_Compare; return VOID_FUNCTION_STRING; +Contents yylval = (YYSTYPE)MACRO_Contents; return VOID_FUNCTION_VOID; +ControlPanel yylval = (YYSTYPE)MACRO_ControlPanel; return VOID_FUNCTION_2STRING_UINT; +CopyDialog yylval = (YYSTYPE)MACRO_CopyDialog; return VOID_FUNCTION_VOID; +CopyTopic|CT yylval = (YYSTYPE)MACRO_CopyTopic; return VOID_FUNCTION_VOID; +CreateButton|CB yylval = (YYSTYPE)MACRO_CreateButton; return VOID_FUNCTION_3STRING; +DeleteItem yylval = (YYSTYPE)MACRO_DeleteItem; return VOID_FUNCTION_STRING; +DeleteMark yylval = (YYSTYPE)MACRO_DeleteMark; return VOID_FUNCTION_STRING; +DestroyButton yylval = (YYSTYPE)MACRO_DestroyButton; return VOID_FUNCTION_STRING; +DisableButton|DB yylval = (YYSTYPE)MACRO_DisableButton; return VOID_FUNCTION_STRING; +DisableItem|DI yylval = (YYSTYPE)MACRO_DisableItem; return VOID_FUNCTION_STRING; +EnableButton|EB yylval = (YYSTYPE)MACRO_EnableButton; return VOID_FUNCTION_STRING; +EnableItem|EI yylval = (YYSTYPE)MACRO_EnableItem; return VOID_FUNCTION_STRING; +EndMPrint yylval = (YYSTYPE)MACRO_EndMPrint; return VOID_FUNCTION_VOID; +ExecFile|EF yylval = (YYSTYPE)MACRO_ExecFile; return VOID_FUNCTION_2STRING_UINT_STRING; +ExecProgram|EP yylval = (YYSTYPE)MACRO_ExecProgram; return VOID_FUNCTION_STRING_UINT; +Exit yylval = (YYSTYPE)MACRO_Exit; return VOID_FUNCTION_VOID; +ExtAbleItem yylval = (YYSTYPE)MACRO_ExtAbleItem; return VOID_FUNCTION_STRING_UINT; +ExtInsertItem yylval = (YYSTYPE)MACRO_ExtInsertItem; return VOID_FUNCTION_4STRING_2UINT; +ExtInsertMenu yylval = (YYSTYPE)MACRO_ExtInsertMenu; return VOID_FUNCTION_3STRING_2UINT; +FileExist|FE yylval = (YYSTYPE)MACRO_FileExist; return BOOL_FUNCTION_STRING; +FileOpen|FO yylval = (YYSTYPE)MACRO_FileOpen; return VOID_FUNCTION_VOID; +Find yylval = (YYSTYPE)MACRO_Find; return VOID_FUNCTION_VOID; +Finder|FD yylval = (YYSTYPE)MACRO_Finder; return VOID_FUNCTION_VOID; +FloatingMenu yylval = (YYSTYPE)MACRO_FloatingMenu; return VOID_FUNCTION_VOID; +Flush|FH yylval = (YYSTYPE)MACRO_Flush; return VOID_FUNCTION_VOID; +FocusWindow yylval = (YYSTYPE)MACRO_FocusWindow; return VOID_FUNCTION_STRING; +Generate yylval = (YYSTYPE)MACRO_Generate; return VOID_FUNCTION_STRING_WPARAM_LPARAM; +GotoMark yylval = (YYSTYPE)MACRO_GotoMark; return VOID_FUNCTION_STRING; +HelpOn yylval = (YYSTYPE)MACRO_HelpOn; return VOID_FUNCTION_VOID; +HelpOnTop yylval = (YYSTYPE)MACRO_HelpOnTop; return VOID_FUNCTION_VOID; +History yylval = (YYSTYPE)MACRO_History; return VOID_FUNCTION_VOID; IfThen|IF return IF_THEN; IfThenElse|IE return IF_THEN_ELSE; -InitMPrint yylval = MACRO_InitMPrint; return BOOL_FUNCTION_VOID; -InsertItem yylval = MACRO_InsertItem; return VOID_FUNCTION_4STRING_UINT; -InsertMenu yylval = MACRO_InsertMenu; return VOID_FUNCTION_2STRING_UINT; -IsBook yylval = MACRO_IsBook; return BOOL_FUNCTION_VOID; -IsMark yylval = MACRO_IsMark; return BOOL_FUNCTION_STRING; -IsNotMark|NM yylval = MACRO_IsNotMark; return BOOL_FUNCTION_STRING; -JumpContents yylval = MACRO_JumpContents; return VOID_FUNCTION_FILE_WIN; -JumpContext|JC yylval = MACRO_JumpContext; return VOID_FUNCTION_FILE_WIN_UINT; -JumpHash|JH yylval = MACRO_JumpHash; return VOID_FUNCTION_FILE_WIN_UINT; -JumpHelpOn yylval = MACRO_JumpHelpOn; return VOID_FUNCTION_VOID; -JumpID|JI yylval = MACRO_JumpID; return VOID_FUNCTION_FILE_WIN_STRING; -JumpKeyword|JK yylval = MACRO_JumpKeyword; return VOID_FUNCTION_FILE_WIN_STRING; -KLink|KL yylval = MACRO_KLink; return VOID_FUNCTION_STRING_UINT_2STRING; -Menu|MU yylval = MACRO_Menu; return VOID_FUNCTION_VOID; -MPrintHash yylval = MACRO_MPrintHash; return VOID_FUNCTION_UINT; -MPrintID yylval = MACRO_MPrintID; return VOID_FUNCTION_STRING; -Next yylval = MACRO_Next; return VOID_FUNCTION_VOID; -NoShow yylval = MACRO_NoShow; return VOID_FUNCTION_VOID; +InitMPrint yylval = (YYSTYPE)MACRO_InitMPrint; return BOOL_FUNCTION_VOID; +InsertItem yylval = (YYSTYPE)MACRO_InsertItem; return VOID_FUNCTION_4STRING_UINT; +InsertMenu yylval = (YYSTYPE)MACRO_InsertMenu; return VOID_FUNCTION_2STRING_UINT; +IsBook yylval = (YYSTYPE)MACRO_IsBook; return BOOL_FUNCTION_VOID; +IsMark yylval = (YYSTYPE)MACRO_IsMark; return BOOL_FUNCTION_STRING; +IsNotMark|NM yylval = (YYSTYPE)MACRO_IsNotMark; return BOOL_FUNCTION_STRING; +JumpContents yylval = (YYSTYPE)MACRO_JumpContents; return VOID_FUNCTION_FILE_WIN; +JumpContext|JC yylval = (YYSTYPE)MACRO_JumpContext; return VOID_FUNCTION_FILE_WIN_UINT; +JumpHash|JH yylval = (YYSTYPE)MACRO_JumpHash; return VOID_FUNCTION_FILE_WIN_UINT; +JumpHelpOn yylval = (YYSTYPE)MACRO_JumpHelpOn; return VOID_FUNCTION_VOID; +JumpID|JI yylval = (YYSTYPE)MACRO_JumpID; return VOID_FUNCTION_FILE_WIN_STRING; +JumpKeyword|JK yylval = (YYSTYPE)MACRO_JumpKeyword; return VOID_FUNCTION_FILE_WIN_STRING; +KLink|KL yylval = (YYSTYPE)MACRO_KLink; return VOID_FUNCTION_STRING_UINT_2STRING; +Menu|MU yylval = (YYSTYPE)MACRO_Menu; return VOID_FUNCTION_VOID; +MPrintHash yylval = (YYSTYPE)MACRO_MPrintHash; return VOID_FUNCTION_UINT; +MPrintID yylval = (YYSTYPE)MACRO_MPrintID; return VOID_FUNCTION_STRING; +Next yylval = (YYSTYPE)MACRO_Next; return VOID_FUNCTION_VOID; +NoShow yylval = (YYSTYPE)MACRO_NoShow; return VOID_FUNCTION_VOID; Not return NOT; -PopupContext|PC yylval = MACRO_PopupContext; return VOID_FUNCTION_STRING_UINT; -PopupHash yylval = MACRO_PopupHash; return VOID_FUNCTION_STRING_UINT; -PopupId|PI yylval = MACRO_PopupId; return VOID_FUNCTION_2STRING; -PositionWindow|PW yylval = MACRO_PositionWindow; return VOID_FUNCTION_2INT_3UINT_STRING; -Prev yylval = MACRO_Prev; return VOID_FUNCTION_VOID; -Print yylval = MACRO_Print; return VOID_FUNCTION_VOID; -PrinterSetup yylval = MACRO_PrinterSetup; return VOID_FUNCTION_VOID; -RegisterRoutine|RR yylval = MACRO_RegisterRoutine; return VOID_FUNCTION_3STRING; -RemoveAccelerator|RA yylval = MACRO_RemoveAccelerator; return VOID_FUNCTION_2UINT; -ResetMenu yylval = MACRO_ResetMenu; return VOID_FUNCTION_VOID; -SaveMark yylval = MACRO_SaveMark; return VOID_FUNCTION_STRING; -Search yylval = MACRO_Search; return VOID_FUNCTION_VOID; -SetContents yylval = MACRO_SetContents; return VOID_FUNCTION_STRING_UINT; -SetHelpOnFile yylval = MACRO_SetHelpOnFile; return VOID_FUNCTION_STRING; -SetPopupColor|SPC yylval = MACRO_SetPopupColor; return VOID_FUNCTION_3UINT; -ShellExecute|SE yylval = MACRO_ShellExecute; return VOID_FUNCTION_2STRING_2UINT_2STRING; -ShortCut|SH yylval = MACRO_ShortCut; return VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING; -TCard yylval = MACRO_TCard; return VOID_FUNCTION_UINT; -Test yylval = MACRO_Test; return VOID_FUNCTION_UINT; -TestALink yylval = MACRO_TestALink; return BOOL_FUNCTION_STRING; -TestKLink yylval = MACRO_TestKLink; return BOOL_FUNCTION_STRING; -UncheckItem|UI yylval = MACRO_UncheckItem; return VOID_FUNCTION_STRING; -UpdateWindow|UW yylval = MACRO_UpdateWindow; return VOID_FUNCTION_2STRING; +PopupContext|PC yylval = (YYSTYPE)MACRO_PopupContext; return VOID_FUNCTION_STRING_UINT; +PopupHash yylval = (YYSTYPE)MACRO_PopupHash; return VOID_FUNCTION_STRING_UINT; +PopupId|PI yylval = (YYSTYPE)MACRO_PopupId; return VOID_FUNCTION_2STRING; +PositionWindow|PW yylval = (YYSTYPE)MACRO_PositionWindow; return VOID_FUNCTION_2INT_3UINT_STRING; +Prev yylval = (YYSTYPE)MACRO_Prev; return VOID_FUNCTION_VOID; +Print yylval = (YYSTYPE)MACRO_Print; return VOID_FUNCTION_VOID; +PrinterSetup yylval = (YYSTYPE)MACRO_PrinterSetup; return VOID_FUNCTION_VOID; +RegisterRoutine|RR yylval = (YYSTYPE)MACRO_RegisterRoutine; return VOID_FUNCTION_3STRING; +RemoveAccelerator|RA yylval = (YYSTYPE)MACRO_RemoveAccelerator; return VOID_FUNCTION_2UINT; +ResetMenu yylval = (YYSTYPE)MACRO_ResetMenu; return VOID_FUNCTION_VOID; +SaveMark yylval = (YYSTYPE)MACRO_SaveMark; return VOID_FUNCTION_STRING; +Search yylval = (YYSTYPE)MACRO_Search; return VOID_FUNCTION_VOID; +SetContents yylval = (YYSTYPE)MACRO_SetContents; return VOID_FUNCTION_STRING_UINT; +SetHelpOnFile yylval = (YYSTYPE)MACRO_SetHelpOnFile; return VOID_FUNCTION_STRING; +SetPopupColor|SPC yylval = (YYSTYPE)MACRO_SetPopupColor; return VOID_FUNCTION_3UINT; +ShellExecute|SE yylval = (YYSTYPE)MACRO_ShellExecute; return VOID_FUNCTION_2STRING_2UINT_2STRING; +ShortCut|SH yylval = (YYSTYPE)MACRO_ShortCut; return VOID_FUNCTION_2STRING_WPARAM_LPARAM_STRING; +TCard yylval = (YYSTYPE)MACRO_TCard; return VOID_FUNCTION_UINT; +Test yylval = (YYSTYPE)MACRO_Test; return VOID_FUNCTION_UINT; +TestALink yylval = (YYSTYPE)MACRO_TestALink; return BOOL_FUNCTION_STRING; +TestKLink yylval = (YYSTYPE)MACRO_TestKLink; return BOOL_FUNCTION_STRING; +UncheckItem|UI yylval = (YYSTYPE)MACRO_UncheckItem; return VOID_FUNCTION_STRING; +UpdateWindow|UW yylval = (YYSTYPE)MACRO_UpdateWindow; return VOID_FUNCTION_2STRING; [-+]?[0-9]+ yylval.integer = strtol(yytext, NULL, 10); return INTEGER; [-+]?0[xX][0-9a-f]+ yylval.integer = strtol(yytext, NULL, 16); return INTEGER; @@ -124,7 +124,7 @@ UpdateWindow|UW yylval = MACRO_UpdateWindow; return VOID_FUNCTION_2STRING; hStringBuffer = GlobalAlloc(GMEM_FIXED, strlen(macroptr)); strptr = GlobalLock(hStringBuffer); } - yylval = strptr; + yylval = (YYSTYPE)strptr; BEGIN (yytext[0] == '`' ? quote : dquote); } diff --git a/relay32/advapi32.spec b/relay32/advapi32.spec index a53a955aa48..7c2edcc7d49 100644 --- a/relay32/advapi32.spec +++ b/relay32/advapi32.spec @@ -201,3 +201,67 @@ type win32 0197 stdcall StartServiceCtrlDispatcherW(ptr) StartServiceCtrlDispatcher32W 0198 stub StartServiceW 0199 stub UnlockServiceDatabase +0200 stub LsaOpenPolicy +0201 stub LsaLookupSids +0202 stub LsaFreeMemory +0203 stub LsaQueryInformationPolicy +0204 stub LsaClose +0205 stub LsaSetInformationPolicy +0206 stub LsaLookupNames +0207 stub SystemFunction001 +0208 stub SystemFunction002 +0209 stub SystemFunction003 +0210 stub SystemFunction004 +0211 stub SystemFunction005 +0212 stub SystemFunction006 +0213 stub SystemFunction007 +0214 stub SystemFunction008 +0215 stub SystemFunction009 +0216 stub SystemFunction010 +0217 stub SystemFunction011 +0218 stub SystemFunction012 +0219 stub SystemFunction013 +0220 stub SystemFunction014 +0221 stub SystemFunction015 +0222 stub SystemFunction016 +0223 stub SystemFunction017 +0224 stub SystemFunction018 +0225 stub SystemFunction019 +0226 stub SystemFunction020 +0227 stub SystemFunction021 +0228 stub SystemFunction022 +0229 stub SystemFunction023 +0230 stub SystemFunction024 +0231 stub SystemFunction025 +0232 stub SystemFunction026 +0233 stub SystemFunction027 +0234 stub SystemFunction028 +0235 stub SystemFunction029 +0236 stub SystemFunction030 +0237 stub LsaQueryInfoTrustedDomain +0238 stub LsaQuerySecret +0239 stub LsaCreateSecret +0240 stub LsaOpenSecret +0241 stub LsaCreateTrustedDomain +0242 stub LsaOpenTrustedDomain +0243 stub LsaSetSecret +0244 stub LsaQuerySecret +0245 stub LsaCreateAccount +0246 stub LsaAddPrivilegesToAccount +0247 stub LsaRemovePrivilegesFromAccount +0248 stub LsaDelete +0249 stub LsaSetSystemAccessAccount +0250 stub LsaEnumeratePrivilegesOfAccount +0251 stub LsaEnumerateAccounts +0252 stub LsaOpenTrustedDomain +0253 stub LsaGetSystemAccessAccount +0254 stub LsaSetInformationTrustedDomain +0255 stub LsaEnumerateTrustedDomains +0256 stub LsaOpenAccount +0257 stub LsaEnumeratePrivileges +0258 stub LsaLookupPrivilegeDisplayName +0259 stub LsaICLookupNames +0260 stub ElfRegisterEventSourceW +0261 stub ElfReportEventW +0262 stub ElfDeregisterEventSource +0263 stub ElfDeregisterEventSourceW diff --git a/relay32/builtin32.c b/relay32/builtin32.c index c1c780326a3..d124093a194 100644 --- a/relay32/builtin32.c +++ b/relay32/builtin32.c @@ -11,7 +11,6 @@ #include "module.h" #include "task.h" #include "process.h" -#include "stddebug.h" #include "debug.h" typedef struct @@ -73,7 +72,7 @@ static BUILTIN32_DLL BuiltinDLLs[] = { &COMCTL32_Descriptor, NULL, FALSE }, { &COMDLG32_Descriptor, NULL, TRUE }, { &CRTDLL_Descriptor, NULL, TRUE }, - { &DCIMAN32_Descriptor, NULL, TRUE }, + { &DCIMAN32_Descriptor, NULL, FALSE }, { &DDRAW_Descriptor, NULL, TRUE }, { &DINPUT_Descriptor, NULL, TRUE }, { &DPLAY_Descriptor, NULL, TRUE }, @@ -82,19 +81,19 @@ static BUILTIN32_DLL BuiltinDLLs[] = { &KERNEL32_Descriptor, NULL, TRUE }, { &LZ32_Descriptor, NULL, TRUE }, { &MPR_Descriptor, NULL, TRUE }, - { &MSVFW32_Descriptor, NULL, TRUE }, + { &MSVFW32_Descriptor, NULL, FALSE }, { &NTDLL_Descriptor, NULL, TRUE }, { &OLE32_Descriptor, NULL, FALSE }, { &OLECLI32_Descriptor, NULL, FALSE }, { &OLESVR32_Descriptor, NULL, FALSE }, { &SHELL32_Descriptor, NULL, TRUE }, - { &TAPI32_Descriptor, NULL, TRUE }, + { &TAPI32_Descriptor, NULL, FALSE }, { &USER32_Descriptor, NULL, TRUE }, { &VERSION_Descriptor, NULL, TRUE }, { &W32SKRNL_Descriptor, NULL, TRUE }, { &WINMM_Descriptor, NULL, TRUE }, { &WINSPOOL_Descriptor, NULL, TRUE }, - { &WOW32_Descriptor, NULL, TRUE }, + { &WOW32_Descriptor, NULL, FALSE }, { &WSOCK32_Descriptor, NULL, TRUE }, /* Last entry */ { NULL, NULL, FALSE } @@ -137,7 +136,7 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll, PDB32 *pdb ) + dll->descr->nb_names * sizeof(LPSTR) + dll->descr->nb_reg_funcs * sizeof(REG_ENTRY_POINT)); #ifdef __i386__ - if (debugging_relay) + if (debugging_info(relay)) size += dll->descr->nb_funcs * sizeof(DEBUG_ENTRY_POINT); #endif addr = VirtualAlloc( NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE ); @@ -202,7 +201,7 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll, PDB32 *pdb ) strcpy( sec->Name, ".code" ); sec->SizeOfRawData = dll->descr->nb_reg_funcs * sizeof(REG_ENTRY_POINT); #ifdef __i386__ - if (debugging_relay) + if (debugging_info(relay)) sec->SizeOfRawData += dll->descr->nb_funcs * sizeof(DEBUG_ENTRY_POINT); #endif sec->Misc.VirtualSize = sec->SizeOfRawData; @@ -223,7 +222,7 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll, PDB32 *pdb ) /* Build the funcs table */ - if (debugging_relay) dll->dbg_funcs = debug; + if (debugging_info(relay)) dll->dbg_funcs = debug; for (i = 0; i < dll->descr->nb_funcs; i++, funcs++, debug++) { BYTE args = dll->descr->args[i]; @@ -237,7 +236,7 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll, PDB32 *pdb ) regs->jmp = 0xe9; regs->call32_regs = (DWORD)CALL32_Regs - (DWORD)®s->nop; regs->nop = 0x9090; - if (debugging_relay) + if (debugging_info(relay)) { debug->call = 0xe8; debug->callfrom32 = (DWORD)regs - (DWORD)&debug->ret; @@ -252,7 +251,7 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll, PDB32 *pdb ) *funcs = (LPVOID)((BYTE *)dll->descr->functions[i] - addr); break; default: /* normal function (stdcall or cdecl) */ - if (debugging_relay) + if (debugging_info(relay)) { debug->call = 0xe8; debug->callfrom32 = (DWORD)RELAY_CallFrom32 - diff --git a/relay32/crtdll.spec b/relay32/crtdll.spec index f1c89723aec..b80e9fcbaa1 100644 --- a/relay32/crtdll.spec +++ b/relay32/crtdll.spec @@ -52,7 +52,7 @@ type win32 48 stub _cabs 49 cdecl _cexit(long) CRTDLL__cexit 50 stub _cgets - 51 cdecl _chdir(ptr) CRTDLL__chdir + 51 cdecl _chdir(str) CRTDLL__chdir 52 cdecl _chdrive(long) CRTDLL__chdrive 53 stub _chgsign 54 stub _chmod @@ -115,7 +115,7 @@ type win32 111 stub _fstat 112 stub _ftime 113 cdecl _ftol(double) CRTDLL__ftol -114 cdecl _fullpath(ptr ptr long) CRTDLL__fullpath +114 cdecl _fullpath(ptr str long) CRTDLL__fullpath 115 stub _futime 116 stub _gcvt 117 stub _get_osfhandle @@ -198,15 +198,15 @@ type win32 194 stub _mbctoupper 195 stub _mbctype 196 stub _mbsbtype -197 cdecl _mbscat(ptr ptr) CRTDLL__mbscat +197 cdecl _mbscat(str str) CRTDLL__mbscat 198 stub _mbschr 199 stub _mbscmp -200 cdecl _mbscpy(ptr ptr) CRTDLL__mbscpy +200 cdecl _mbscpy(ptr str) CRTDLL__mbscpy 201 stub _mbscspn 202 stub _mbsdec 203 stub _mbsdup -204 cdecl _mbsicmp(ptr ptr) CRTDLL__mbsicmp -205 cdecl _mbsinc(ptr) CRTDLL__mbsinc +204 cdecl _mbsicmp(str str) CRTDLL__mbsicmp +205 cdecl _mbsinc(str) CRTDLL__mbsinc 206 stub _mbslen 207 stub _mbslwr 208 stub _mbsnbcat @@ -235,12 +235,12 @@ type win32 231 stub _mbsupr 232 stub _memccpy 233 stub _memicmp -234 cdecl _mkdir(ptr) CRTDLL__mkdir +234 cdecl _mkdir(str) CRTDLL__mkdir 235 stub _mktemp 236 stub _msize 237 stub _nextafter 238 stub _onexit -239 cdecl _open(ptr long) CRTDLL__open +239 cdecl _open(str long) CRTDLL__open 240 cdecl _open_osfhandle(long long) CRTDLL__open_osfhandle 241 extern _osmajor_dll CRTDLL_osmajor_dll 242 extern _osminor_dll CRTDLL_osminor_dll @@ -280,33 +280,33 @@ type win32 276 stub _spawnve 277 stub _spawnvp 278 stub _spawnvpe -279 cdecl _splitpath (ptr ptr ptr ptr ptr) CRTDLL__splitpath -280 cdecl _stat (ptr ptr) CRTDLL__stat +279 cdecl _splitpath (str ptr ptr ptr ptr) CRTDLL__splitpath +280 cdecl _stat (str ptr) CRTDLL__stat 281 stub _statusfp -282 cdecl _strcmpi(ptr ptr) CRTDLL__strcmpi +282 cdecl _strcmpi(str str) CRTDLL__strcmpi 283 stub _strdate 284 stub _strdec -285 cdecl _strdup(ptr) CRTDLL__strdup +285 cdecl _strdup(str) CRTDLL__strdup 286 stub _strerror -287 cdecl _stricmp(ptr ptr) CRTDLL__strcmpi +287 cdecl _stricmp(str str) CRTDLL__strcmpi 288 stub _stricoll 289 stub _strinc -290 cdecl _strlwr(ptr) CRTDLL__strlwr +290 cdecl _strlwr(str) CRTDLL__strlwr 291 stub _strncnt 292 stub _strnextc -293 cdecl _strnicmp(ptr ptr long) CRTDLL__strnicmp +293 cdecl _strnicmp(str str long) CRTDLL__strnicmp 294 stub _strninc 295 stub _strnset 296 stub _strrev 297 stub _strset 298 stub _strspnp 299 stub _strtime -300 cdecl _strupr(ptr) CRTDLL__strupr +300 cdecl _strupr(str) CRTDLL__strupr 301 stub _swab 302 stub _sys_errlist 303 stub _sys_nerr_dll 304 stub _tell -305 cdecl _tempnam(ptr ptr) CRTDLL__tempnam +305 cdecl _tempnam(str ptr) CRTDLL__tempnam 306 stub _timezone_dll 307 stub _tolower 308 stub _toupper @@ -316,20 +316,20 @@ type win32 312 stub _ultow 313 stub _umask 314 stub _ungetch -315 cdecl _unlink(ptr) CRTDLL__unlink +315 cdecl _unlink(str) CRTDLL__unlink 316 stub _unloaddll 317 stub _utime 318 stub _vsnprintf 319 stub _vsnwprintf 320 stub _wcsdup -321 cdecl _wcsicmp(ptr ptr) CRTDLL__wcsicmp -322 cdecl _wcsicoll(ptr ptr) CRTDLL__wcsicoll -323 cdecl _wcslwr(ptr) CRTDLL__wcslwr -324 cdecl _wcsnicmp(ptr ptr long) CRTDLL__wcsnicmp +321 cdecl _wcsicmp(wstr wstr) CRTDLL__wcsicmp +322 cdecl _wcsicoll(wstr wstr) CRTDLL__wcsicoll +323 cdecl _wcslwr(wstr) CRTDLL__wcslwr +324 cdecl _wcsnicmp(wstr wstr long) CRTDLL__wcsnicmp 325 stub _wcsnset -326 cdecl _wcsrev(ptr) CRTDLL__wcsrev +326 cdecl _wcsrev(wstr) CRTDLL__wcsrev 327 stub _wcsset -328 cdecl _wcsupr(ptr) CRTDLL__wcsupr +328 cdecl _wcsupr(wstr) CRTDLL__wcsupr 329 extern _winmajor_dll CRTDLL_winmajor_dll 330 extern _winminor_dll CRTDLL_winminor_dll 331 extern _winver_dll CRTDLL_winver_dll @@ -347,9 +347,9 @@ type win32 343 cdecl atan(double) atan 344 cdecl atan2(double double) atan2 345 cdecl atexit(ptr) CRTDLL_atexit -346 cdecl atof(ptr) atof -347 cdecl atoi(ptr) atoi -348 cdecl atol(ptr) atol +346 cdecl atof(str) atof +347 cdecl atoi(str) atoi +348 cdecl atol(str) atol 349 stub bsearch 350 cdecl calloc(long long) CRTDLL_calloc 351 stub ceil @@ -373,10 +373,10 @@ type win32 369 stub fgetwc 370 cdecl floor(double) floor 371 cdecl fmod(double double) fmod -372 cdecl fopen(ptr ptr) CRTDLL_fopen +372 cdecl fopen(str str) CRTDLL_fopen 373 varargs fprintf() CRTDLL_fprintf 374 cdecl fputc(long ptr) CRTDLL_fputc -375 cdecl fputs(ptr ptr) CRTDLL_fputs +375 cdecl fputs(str ptr) CRTDLL_fputs 376 stub fputwc 377 cdecl fread(ptr long long ptr) CRTDLL_fread 378 cdecl free(ptr) CRTDLL_free @@ -429,8 +429,8 @@ type win32 425 cdecl log10(double) log10 426 cdecl longjmp(ptr long) CRTDLL_longjmp 427 cdecl malloc(ptr) CRTDLL_malloc -428 cdecl mblen(ptr long) CRTDLL_mblen -429 cdecl mbstowcs(ptr ptr long) CRTDLL_mbstowcs +428 cdecl mblen(str long) CRTDLL_mblen +429 cdecl mbstowcs(ptr str long) CRTDLL_mbstowcs 430 cdecl mbtowc(ptr ptr long) CRTDLL_mbtowc 431 cdecl memchr(ptr long long) memchr 432 cdecl memcmp(ptr ptr long) memcmp @@ -444,7 +444,7 @@ type win32 440 varargs printf() printf 441 cdecl putc(long ptr) CRTDLL_putc 442 cdecl putchar(long) CRTDLL_putchar -443 cdecl puts(ptr) CRTDLL_puts +443 cdecl puts(str) CRTDLL_puts 444 cdecl qsort(ptr long long ptr) qsort 445 stub raise 446 cdecl rand() CRTDLL_rand @@ -463,62 +463,62 @@ type win32 459 cdecl sqrt(double) sqrt 460 cdecl srand(long) CRTDLL_srand 461 varargs sscanf() sscanf -462 cdecl strcat(ptr ptr) strcat -463 cdecl strchr(ptr long) strchr -464 cdecl strcmp(ptr ptr) strcmp -465 cdecl strcoll(ptr ptr) strcoll -466 cdecl strcpy(ptr ptr) strcpy -467 cdecl strcspn(ptr ptr) strcspn +462 cdecl strcat(str str) strcat +463 cdecl strchr(str long) strchr +464 cdecl strcmp(str str) strcmp +465 cdecl strcoll(str str) strcoll +466 cdecl strcpy(ptr str) strcpy +467 cdecl strcspn(str str) strcspn 468 stub strerror -469 cdecl strftime(ptr long ptr ptr) strftime -470 cdecl strlen(ptr) strlen -471 cdecl strncat(ptr ptr long) strncat -472 cdecl strncmp(ptr ptr long) strncmp -473 cdecl strncpy(ptr ptr long) strncpy -474 cdecl strpbrk(ptr ptr) strpbrk -475 cdecl strrchr(ptr long) strrchr -476 cdecl strspn(ptr ptr) strspn -477 cdecl strstr(ptr ptr) strstr -478 cdecl strtod(ptr ptr) strtod -479 cdecl strtok(ptr ptr) strtok -480 cdecl strtol(ptr ptr long) strtol -481 cdecl strtoul(ptr ptr long) strtoul -482 cdecl strxfrm(ptr ptr long) strxfrm +469 cdecl strftime(ptr long str ptr) strftime +470 cdecl strlen(str) strlen +471 cdecl strncat(str str long) strncat +472 cdecl strncmp(str str long) strncmp +473 cdecl strncpy(ptr str long) strncpy +474 cdecl strpbrk(str str) strpbrk +475 cdecl strrchr(str long) strrchr +476 cdecl strspn(str str) strspn +477 cdecl strstr(str str) strstr +478 cdecl strtod(str ptr) strtod +479 cdecl strtok(str str) strtok +480 cdecl strtol(str ptr long) strtol +481 cdecl strtoul(str ptr long) strtoul +482 cdecl strxfrm(ptr str long) strxfrm 483 varargs swprintf() wsprintf32W 484 stub swscanf -485 cdecl system(ptr) CRTDLL_system +485 cdecl system(str) CRTDLL_system 486 cdecl tan(double) tan 487 cdecl tanh(double) tanh 488 cdecl time(ptr) CRTDLL_time 489 stub tmpfile -490 cdecl tmpnam(ptr) CRTDLL_tmpnam +490 cdecl tmpnam(str) CRTDLL_tmpnam 491 cdecl tolower(long) tolower 492 cdecl toupper(long) toupper 493 stub towlower 494 cdecl towupper(long) CRTDLL_towupper 495 stub ungetc 496 stub ungetwc -497 cdecl vfprintf(ptr ptr ptr) CRTDLL_vfprintf +497 cdecl vfprintf(ptr str ptr) CRTDLL_vfprintf 498 stub vfwprintf 499 stub vprintf -500 cdecl vsprintf(ptr ptr ptr) CRTDLL_vsprintf -501 cdecl vswprintf(ptr ptr ptr) CRTDLL_vswprintf +500 cdecl vsprintf(ptr str ptr) CRTDLL_vsprintf +501 cdecl vswprintf(ptr wstr ptr) CRTDLL_vswprintf 502 stub vwprintf -503 cdecl wcscat(ptr ptr) CRTDLL_wcscat -504 cdecl wcschr(ptr long) CRTDLL_wcschr -505 cdecl wcscmp(ptr ptr) CRTDLL_wcscmp -506 cdecl wcscoll(ptr ptr) CRTDLL_wcscoll -507 cdecl wcscpy(ptr ptr) CRTDLL_wcscpy -508 cdecl wcscspn(ptr ptr) CRTDLL_wcscspn +503 cdecl wcscat(wstr wstr) CRTDLL_wcscat +504 cdecl wcschr(wstr long) CRTDLL_wcschr +505 cdecl wcscmp(wstr wstr) CRTDLL_wcscmp +506 cdecl wcscoll(wstr wstr) CRTDLL_wcscoll +507 cdecl wcscpy(ptr wstr) CRTDLL_wcscpy +508 cdecl wcscspn(wstr wstr) CRTDLL_wcscspn 509 stub wcsftime -510 cdecl wcslen(ptr) CRTDLL_wcslen -511 cdecl wcsncat(ptr ptr long) CRTDLL_wcsncat -512 cdecl wcsncmp(ptr ptr long) CRTDLL_wcsncmp -513 cdecl wcsncpy(ptr ptr long) CRTDLL_wcsncpy +510 cdecl wcslen(wstr) CRTDLL_wcslen +511 cdecl wcsncat(wstr wstr long) CRTDLL_wcsncat +512 cdecl wcsncmp(wstr wstr long) CRTDLL_wcsncmp +513 cdecl wcsncpy(ptr wstr long) CRTDLL_wcsncpy 514 stub wcspbrk -515 cdecl wcsrchr(ptr long) CRTDLL_wcsrchr -516 cdecl wcsspn(ptr ptr) CRTDLL_wcsspn -517 cdecl wcsstr(ptr ptr) CRTDLL_wcsstr +515 cdecl wcsrchr(wstr long) CRTDLL_wcsrchr +516 cdecl wcsspn(wstr wstr) CRTDLL_wcsspn +517 cdecl wcsstr(wstr wstr) CRTDLL_wcsstr 518 stub wcstod 519 stub wcstok 520 stub wcstol diff --git a/relay32/dinput.spec b/relay32/dinput.spec index 23ba6e9dd0b..5d2e9e13267 100644 --- a/relay32/dinput.spec +++ b/relay32/dinput.spec @@ -7,4 +7,3 @@ type win32 3 stub DllGetClassObject 4 stub DllRegisterServer 5 stub DllUnregisterServer - diff --git a/relay32/kernel32.spec b/relay32/kernel32.spec index 0b10e0e769b..5da486cb11a 100644 --- a/relay32/kernel32.spec +++ b/relay32/kernel32.spec @@ -53,7 +53,7 @@ type win32 61 stdcall WOWGlobalUnlock16(long) GlobalUnlock16 62 stdcall WOWGlobalFree16(long) GlobalFree16 63 stdcall WOWGlobalAllocLock16(long long ptr) WOWGlobalAllocLock16 - 64 stub WOWGlobalUnlockFree16 + 64 stdcall WOWGlobalUnlockFree16(long) WOWGlobalUnlockFree16 65 stub WOWGlobalLockSize16 66 stub WOWYield16 67 stub WOWDirectedYield16 @@ -249,7 +249,7 @@ type win32 258 stdcall FindResourceW(long wstr wstr) FindResource32W 259 stdcall FlushConsoleInputBuffer(long) FlushConsoleInputBuffer 260 stdcall FlushFileBuffers(long) FlushFileBuffers -261 stub FlushInstructionCache +261 stdcall FlushInstructionCache(long long long) FlushInstructionCache 262 stdcall FlushViewOfFile(ptr long) FlushViewOfFile 263 stub FoldStringA 264 stub FoldStringW diff --git a/relay32/mpr.spec b/relay32/mpr.spec index c1977b4c251..c7f0fd1a5c2 100644 --- a/relay32/mpr.spec +++ b/relay32/mpr.spec @@ -83,3 +83,8 @@ type win32 0102 stub WNetVerifyPasswordW #additions 0103 stub WNetRestoreConnection +0104 stub WNetLogonNotify +0105 stub WNetPasswordChangeNotify +0106 stub WNetGetPropertyTextA +0107 stub WNetPropertyDialogA +0108 stub WNetGetDirectoryTypeA diff --git a/relay32/ntdll.spec b/relay32/ntdll.spec index 531ef80883f..4e6bad67981 100644 --- a/relay32/ntdll.spec +++ b/relay32/ntdll.spec @@ -872,21 +872,21 @@ type win32 869 stub _snprintf 870 stub _snwprintf 871 stub _splitpath -872 cdecl _strcmpi(ptr ptr) CRTDLL__strcmpi -873 cdecl _stricmp(ptr ptr) CRTDLL__strcmpi +872 cdecl _strcmpi(str str) CRTDLL__strcmpi +873 cdecl _stricmp(str str) CRTDLL__strcmpi 874 stub _strlwr -875 cdecl _strnicmp(ptr ptr long) CRTDLL__strnicmp -876 cdecl _strupr(ptr) CRTDLL__strupr +875 cdecl _strnicmp(str str long) CRTDLL__strnicmp +876 cdecl _strupr(str) CRTDLL__strupr 877 stub _ultoa 878 stub _vsnprintf -879 cdecl _wcsicmp(ptr ptr) CRTDLL__wcsicmp -880 cdecl _wcslwr(ptr) CRTDLL__wcslwr -881 cdecl _wcsnicmp(ptr ptr long) CRTDLL__wcsnicmp -882 cdecl _wcsupr(ptr) CRTDLL__wcsupr +879 cdecl _wcsicmp(wstr wstr) CRTDLL__wcsicmp +880 cdecl _wcslwr(wstr) CRTDLL__wcslwr +881 cdecl _wcsnicmp(wstr wstr long) CRTDLL__wcsnicmp +882 cdecl _wcsupr(wstr) CRTDLL__wcsupr 883 stub abs 884 stub atan -885 cdecl atoi(ptr) atoi -886 cdecl atol(ptr) atol +885 cdecl atoi(str) atoi +886 cdecl atol(str) atol 887 stub ceil 888 stub cos 889 stub fabs @@ -914,39 +914,39 @@ type win32 911 varargs sprintf() wsprintf32A 912 stub sqrt 913 varargs sscanf() sscanf -914 cdecl strcat(ptr ptr) strcat -915 cdecl strchr(ptr long) strchr -916 cdecl strcmp(ptr ptr) strcmp -917 cdecl strcpy(ptr ptr) strcpy -918 cdecl strcspn(ptr ptr) strcspn -919 cdecl strlen(ptr) strlen -920 cdecl strncat(ptr ptr long) strncat -921 cdecl strncmp(ptr ptr long) strncmp -922 cdecl strncpy(ptr ptr long) strncpy -923 cdecl strpbrk(ptr ptr long) strpbrk -924 cdecl strrchr(ptr long) strrchr -925 cdecl strspn(ptr ptr) strspn -926 cdecl strstr(ptr ptr) strstr +914 cdecl strcat(str str) strcat +915 cdecl strchr(str long) strchr +916 cdecl strcmp(str str) strcmp +917 cdecl strcpy(ptr str) strcpy +918 cdecl strcspn(str str) strcspn +919 cdecl strlen(str) strlen +920 cdecl strncat(str str long) strncat +921 cdecl strncmp(str str long) strncmp +922 cdecl strncpy(ptr str long) strncpy +923 cdecl strpbrk(str str long) strpbrk +924 cdecl strrchr(str long) strrchr +925 cdecl strspn(str str) strspn +926 cdecl strstr(str str) strstr 927 varargs swprintf() wsprintf32W 928 stub tan 929 cdecl tolower(long) tolower 930 cdecl toupper(long) toupper 931 stub towlower 932 stub towupper -933 cdecl vsprintf(ptr ptr ptr) CRTDLL_vsprintf -934 cdecl wcscat(ptr ptr) CRTDLL_wcscat -935 cdecl wcschr(ptr long) CRTDLL_wcschr +933 cdecl vsprintf(ptr str ptr) CRTDLL_vsprintf +934 cdecl wcscat(wstr wstr) CRTDLL_wcscat +935 cdecl wcschr(wstr long) CRTDLL_wcschr 936 stub wcscmp -937 cdecl wcscpy(ptr ptr) CRTDLL_wcscpy +937 cdecl wcscpy(ptr wstr) CRTDLL_wcscpy 938 stub wcscspn -939 cdecl wcslen(ptr) CRTDLL_wcslen +939 cdecl wcslen(wstr) CRTDLL_wcslen 940 stub wcsncat 941 stub wcsncmp -942 cdecl wcsncpy(ptr ptr long) CRTDLL_wcsncpy +942 cdecl wcsncpy(ptr wstr long) CRTDLL_wcsncpy 943 stub wcspbrk -944 cdecl wcsrchr(ptr long) CRTDLL_wcsrchr -945 stub wcsspn -946 cdecl wcsstr(ptr ptr) CRTDLL_wcsstr +944 cdecl wcsrchr(wstr long) CRTDLL_wcsrchr +945 cdecl wcsspn(wstr wstr) CRTDLL_wcsspn +946 cdecl wcsstr(wstr wstr) CRTDLL_wcsstr 947 stub wcstok 948 stub wcstol 949 cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs diff --git a/relay32/ole32.spec b/relay32/ole32.spec index 1547f4ccc0c..9fcd3b3e307 100644 --- a/relay32/ole32.spec +++ b/relay32/ole32.spec @@ -2,8 +2,8 @@ name ole32 type win32 1 stub BindMoniker - 2 stub CLSIDFromProgID - 3 stdcall CLSIDFromString(str ptr) CLSIDFromString + 2 stdcall CLSIDFromProgID(wstr ptr) CLSIDFromProgID32 + 3 stdcall CLSIDFromString(wstr ptr) CLSIDFromString32 4 stdcall CoBuildVersion() CoBuildVersion 5 stub CoCreateFreeThreadedMarshaler 6 stub CoCreateGuid @@ -18,16 +18,16 @@ type win32 15 stub CoGetCallerTID 16 stub CoGetClassObject 17 stub CoGetCurrentLogicalThreadId - 18 stub CoGetCurrentProcess + 18 stdcall CoGetCurrentProcess() CoGetCurrentProcess 19 stub CoGetInterfaceAndReleaseStream - 20 stdcall CoGetMalloc(long ptr) CoGetMalloc + 20 stdcall CoGetMalloc(long ptr) CoGetMalloc32 21 stub CoGetMarshalSizeMax 22 stub CoGetPSClsid 23 stub CoGetStandardMarshal 24 stub CoGetState 25 stub CoGetTreatAsClass - 26 stdcall CoInitialize(long) CoInitialize - 27 stub CoInitializeWOW + 26 stdcall CoInitialize(long) CoInitialize32 + 27 stdcall CoInitializeWOW(long long) CoInitializeWOW 28 stub CoIsHandlerConnected 29 stub CoIsOle1Class 30 stub CoLoadLibrary @@ -36,15 +36,15 @@ type win32 33 stub CoMarshalInterThreadInterfaceInStream 34 stub CoMarshalInterface 35 stub CoQueryReleaseObject - 36 stub CoRegisterClassObject + 36 stdcall CoRegisterClassObject(ptr ptr long long ptr) CoRegisterClassObject32 37 stub CoRegisterMallocSpy 38 stdcall CoRegisterMessageFilter(ptr ptr) CoRegisterMessageFilter32 39 stub CoReleaseMarshalData 40 stub CoRevokeClassObject 41 stub CoRevokeMallocSpy 42 stub CoSetState - 43 stub CoTaskMemAlloc - 44 stub CoTaskMemFree + 43 stdcall CoTaskMemAlloc(long) CoTaskMemAlloc + 44 stdcall CoTaskMemFree(ptr) CoTaskMemFree 45 stub CoTaskMemRealloc 46 stub CoTreatAsClass 47 stdcall CoUninitialize() CoUnitialize @@ -78,13 +78,13 @@ type win32 75 stub IsAccelerator 76 stub IsEqualGUID 77 stub IsValidIid - 78 stub IsValidInterface + 78 stdcall IsValidInterface(ptr) IsValidInterface32 79 stub IsValidPtrIn 80 stub IsValidPtrOut 81 stub MkParseDisplayName 82 stub MonikerCommonPrefixWith 83 stub MonikerRelativePathTo - 84 stub OleBuildVersion + 84 stdcall OleBuildVersion() OleBuildVersion 85 stub OleConvertIStorageToOLESTREAM 86 stub OleConvertIStorageToOLESTREAMEx 87 stub OleConvertOLESTREAMToIStorage @@ -109,7 +109,7 @@ type win32 106 stub OleGetIconOfClass 107 stub OleGetIconOfFile 108 stdcall OleInitialize(ptr) OleInitialize -109 stub OleInitializeWOW +109 stdcall OleInitializeWOW(long) OleInitializeWOW 110 stub OleIsCurrentClipboard 111 stub OleIsRunning 112 stub OleLoad @@ -144,14 +144,14 @@ type win32 141 stub RevokeDragDrop 142 stub SetConvertStg 143 stub SetDocumentBitStg -144 stub StgCreateDocfile +144 stdcall StgCreateDocfile(wstr long long ptr) StgCreateDocFile32 145 stub StgCreateDocfileOnILockBytes -146 stub StgIsStorageFile +146 stdcall StgIsStorageFile(wstr) StgIsStorageFile32 147 stub StgIsStorageILockBytes -148 stub StgOpenStorage +148 stdcall StgOpenStorage(wstr ptr long ptr long ptr) StgOpenStorage32 149 stub StgOpenStorageOnILockBytes 150 stub StgSetTimes -151 stdcall StringFromCLSID(ptr ptr) StringFromCLSID +151 stdcall StringFromCLSID(ptr ptr) StringFromCLSID32 152 stub StringFromGUID2 153 stub StringFromIID 154 stub UtConvertDvtd16toDvtd32 diff --git a/relay32/relay386.c b/relay32/relay386.c index 1b5f706daf0..734c2a53783 100644 --- a/relay32/relay386.c +++ b/relay32/relay386.c @@ -11,7 +11,6 @@ #include "windows.h" #include "builtin32.h" #include "selectors.h" -#include "stddebug.h" #include "debug.h" static void _dumpstr(unsigned char *s) { @@ -54,7 +53,7 @@ int RELAY_CallFrom32( int ret_addr, ... ) BYTE *relay_addr = (BYTE *)args[-1]; WORD nb_args = *(WORD *)(relay_addr + 1) / sizeof(int); - assert(debugging_relay); + assert(debugging_info(relay)); func = (FARPROC32)BUILTIN32_GetEntryPoint( buffer, relay_addr - 5, &typemask ); printf( "Call %s(", buffer ); @@ -175,7 +174,7 @@ int RELAY_CallFrom32( int ret_addr, ... ) * Stack layout: * ... ... * (esp+216) ret_addr - * (esp+212) return to relay debugging code (only when debugging_relay) + * (esp+212) return to relay debugging code (only when debugging(relay)) * (esp+208) entry point to call * (esp+4) CONTEXT * (esp) return addr to relay code @@ -184,7 +183,7 @@ void RELAY_CallFrom32Regs( CONTEXT context, void (CALLBACK *entry_point)(CONTEXT *), BYTE *relay_addr, int ret_addr ) { - if (!debugging_relay) + if (!debugging_info(relay)) { /* Simply call the entry point */ entry_point( &context ); diff --git a/relay32/user32.spec b/relay32/user32.spec index dc4f01a88fd..ac39942f8a8 100644 --- a/relay32/user32.spec +++ b/relay32/user32.spec @@ -595,7 +595,7 @@ type win32 589 stub ChangeDisplaySettingsA 590 stub ChangeDisplaySettingsW 591 stub EnumDesktopWindows -592 stub EnumDisplaySettingsA +592 stdcall EnumDisplaySettingsA(str long ptr) EnumDisplaySettings32A 593 stub EnumDisplaySettingsW 594 stub GetWindowRgn 595 stub MapVirtualKeyExW diff --git a/relay32/wow32.spec b/relay32/wow32.spec index 5ff4692417f..9b5bace00ce 100644 --- a/relay32/wow32.spec +++ b/relay32/wow32.spec @@ -14,7 +14,7 @@ type win32 11 stub WOWGlobalLock16 12 stub WOWGlobalLockSize16 13 stub WOWGlobalUnlock16 - 14 stub WOWGlobalUnlockFree16 + 14 stdcall WOWGlobalUnlockFree16(long) WOWGlobalUnlockFree16 15 stub WOWHandle16 16 stdcall WOWHandle32(long long) WOWHandle32 17 stub WOWYield16 diff --git a/scheduler/critsection.c b/scheduler/critsection.c index c97c295a3b9..9c92351acca 100644 --- a/scheduler/critsection.c +++ b/scheduler/critsection.c @@ -50,6 +50,8 @@ const K32OBJ_OPS CRITICAL_SECTION_Ops = CRIT_SECTION_Satisfied, /* satisfied */ CRIT_SECTION_AddWait, /* add_wait */ CRIT_SECTION_RemoveWait, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ CRIT_SECTION_Destroy /* destroy */ }; diff --git a/scheduler/event.c b/scheduler/event.c index fdebbe8701d..9cf505cc777 100644 --- a/scheduler/event.c +++ b/scheduler/event.c @@ -32,6 +32,8 @@ const K32OBJ_OPS EVENT_Ops = EVENT_Satisfied, /* satisfied */ EVENT_AddWait, /* add_wait */ EVENT_RemoveWait, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ EVENT_Destroy /* destroy */ }; diff --git a/scheduler/k32obj.c b/scheduler/k32obj.c index c9fad71ce5c..30717fbbafd 100644 --- a/scheduler/k32obj.c +++ b/scheduler/k32obj.c @@ -28,6 +28,8 @@ static const K32OBJ_OPS K32OBJ_NullOps = NULL, /* satisfied */ NULL, /* add_wait */ NULL, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ NULL /* destroy */ }; diff --git a/scheduler/mutex.c b/scheduler/mutex.c index b0829767311..ae69498cdaa 100644 --- a/scheduler/mutex.c +++ b/scheduler/mutex.c @@ -35,6 +35,8 @@ const K32OBJ_OPS MUTEX_Ops = MUTEX_Satisfied, /* satisfied */ MUTEX_AddWait, /* add_wait */ MUTEX_RemoveWait, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ MUTEX_Destroy /* destroy */ }; diff --git a/scheduler/process.c b/scheduler/process.c index 84a6bf244af..27d8765f01e 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -33,6 +33,8 @@ const K32OBJ_OPS PROCESS_Ops = PROCESS_Satisfied, /* satisfied */ PROCESS_AddWait, /* add_wait */ PROCESS_RemoveWait, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ PROCESS_Destroy /* destroy */ }; @@ -203,6 +205,7 @@ error: BOOL32 PROCESS_Init(void) { extern BOOL32 VIRTUAL_Init(void); + extern BOOL32 THREAD_InitDone; PDB32 *pdb; THDB *thdb; @@ -217,6 +220,7 @@ BOOL32 PROCESS_Init(void) if (!(pdb = PROCESS_CreatePDB( NULL ))) return FALSE; if (!(thdb = THREAD_Create( pdb, 0, NULL, NULL ))) return FALSE; SET_CUR_THREAD( thdb ); + THREAD_InitDone = TRUE; return TRUE; } @@ -311,9 +315,29 @@ static void PROCESS_RemoveWait( K32OBJ *obj, DWORD thread_id ) return K32OBJ_OPS( pdb->event )->remove_wait( pdb->event, thread_id ); } +/*********************************************************************** + * PROCESS_CloseObjHandles + * + * closes all handles that reference "ptr" + * note: need to add 1 to the array entry to get to what + * CloseHandle expects (there is no zero handle) + */ +void PROCESS_CloseObjHandles(PDB32 *pdb, K32OBJ *ptr) +{ + HANDLE32 handle; + + assert( pdb->header.type == K32OBJ_PROCESS ); + + /* Close all handles that have a pointer to ptr */ + for (handle = 0; handle < pdb->handle_table->count; handle++) + if (pdb->handle_table->entries[handle].ptr == ptr) + CloseHandle( handle+1 ); +} /*********************************************************************** * PROCESS_Destroy + * note: need to add 1 to the array entry to get to what + * CloseHandle expects (there is no zero handle) */ static void PROCESS_Destroy( K32OBJ *ptr ) { @@ -323,7 +347,7 @@ static void PROCESS_Destroy( K32OBJ *ptr ) /* Close all handles */ for (handle = 0; handle < pdb->handle_table->count; handle++) - if (pdb->handle_table->entries[handle].ptr) CloseHandle( handle ); + if (pdb->handle_table->entries[handle].ptr) CloseHandle( handle+1 ); /* Free everything */ @@ -343,6 +367,7 @@ void WINAPI ExitProcess( DWORD status ) /* FIXME: should kill all running threads of this process */ pdb->exit_code = status; EVENT_Set( pdb->event ); + if (pdb->console) FreeConsole(); SYSTEM_UNLOCK(); __RESTORE_ES; /* Necessary for Pietrek's showseh example program */ diff --git a/scheduler/semaphore.c b/scheduler/semaphore.c index 19160fdefc6..361bf1feb9d 100644 --- a/scheduler/semaphore.c +++ b/scheduler/semaphore.c @@ -32,6 +32,8 @@ const K32OBJ_OPS SEMAPHORE_Ops = SEMAPHORE_Satisfied, /* satisfied */ SEMAPHORE_AddWait, /* add_wait */ SEMAPHORE_RemoveWait, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ SEMAPHORE_Destroy /* destroy */ }; diff --git a/scheduler/synchro.c b/scheduler/synchro.c index 4195fc2011f..8056c4a0e7a 100644 --- a/scheduler/synchro.c +++ b/scheduler/synchro.c @@ -14,7 +14,6 @@ #include "process.h" #include "thread.h" #include "winerror.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** @@ -146,7 +145,7 @@ void SYNC_WaitForCondition( WAIT_STRUCT *wait, DWORD timeout ) /* Now wait for it */ - dprintf_win32( stddeb, "SYNC: starting wait (%p %04x)\n", + dprintf_info(win32, "SYNC: starting wait (%p %04x)\n", THREAD_Current(), THREAD_Current()->teb_sel ); sigprocmask( SIG_SETMASK, NULL, &set ); @@ -182,7 +181,7 @@ void SYNC_WaitForCondition( WAIT_STRUCT *wait, DWORD timeout ) /* Grab the system lock again */ while (count--) SYSTEM_LOCK(); - dprintf_win32( stddeb, "SYNC: wait finished (%p %04x)\n", + dprintf_info(win32, "SYNC: wait finished (%p %04x)\n", THREAD_Current(), THREAD_Current()->teb_sel ); /* Remove ourselves from the lists */ @@ -245,7 +244,7 @@ void SYNC_WakeUp( THREAD_QUEUE *wait_queue, DWORD max ) THDB *thdb = entry->thread; if (SYNC_CheckCondition( &thdb->wait_struct, THDB_TO_THREAD_ID(thdb) )) { - dprintf_win32( stddeb, "SYNC: waking up %04x\n", thdb->teb_sel ); + dprintf_info(win32, "SYNC: waking up %04x\n", thdb->teb_sel ); kill( thdb->unix_pid, SIGUSR1 ); if (!--max) break; } diff --git a/scheduler/sysdeps.c b/scheduler/sysdeps.c index e020953e002..b1a7c56e8d2 100644 --- a/scheduler/sysdeps.c +++ b/scheduler/sysdeps.c @@ -17,13 +17,8 @@ static int *ph_errno = &h_errno; #include "thread.h" #include "winbase.h" -/* FIXME: X libs compiled w/o -D_REENTRANT should be detected by autoconf. */ -#define NO_REENTRANT_X11 - -#ifdef NO_REENTRANT_X11 /* Xlib critical section (FIXME: does not belong here) */ CRITICAL_SECTION X11DRV_CritSection = { 0, }; -#endif #ifdef __linux__ # ifdef HAVE_SCHED_H @@ -123,24 +118,19 @@ void SYSDEPS_ExitThread(void) /********************************************************************** * NtCurrentTeb (NTDLL.89) + * + * This will crash and burn if called before threading is initialized */ TEB * WINAPI NtCurrentTeb(void) { #ifdef __i386__ TEB *teb; - WORD ds, fs; - /* Check if we have a current thread */ - GET_FS( fs ); - if (!fs) return NULL; - GET_DS( ds ); - if (fs == ds) return NULL; /* FIXME: should be an assert */ /* Get the TEB self-pointer */ __asm__( ".byte 0x64\n\tmovl (%1),%0" : "=r" (teb) : "r" (&((TEB *)0)->self) ); return teb; #else - if (!pCurrentThread) return NULL; return &pCurrentThread->teb; #endif /* __i386__ */ } diff --git a/scheduler/thread.c b/scheduler/thread.c index 023f93d0683..fdfb34b2a83 100644 --- a/scheduler/thread.c +++ b/scheduler/thread.c @@ -16,7 +16,6 @@ #include "miscemu.h" #include "winnt.h" #include "debug.h" -#include "stddebug.h" #ifndef __i386__ THDB *pCurrentThread; @@ -34,11 +33,16 @@ const K32OBJ_OPS THREAD_Ops = THREAD_Satisfied, /* satisfied */ THREAD_AddWait, /* add_wait */ THREAD_RemoveWait, /* remove_wait */ + NULL, /* read */ + NULL, /* write */ THREAD_Destroy /* destroy */ }; -/*********************************************************************** +/* Is threading code initialized? */ +BOOL32 THREAD_InitDone = FALSE; + +/********************************************************************** * THREAD_GetPtr * * Return a pointer to a thread object. The object count must be decremented @@ -65,9 +69,8 @@ THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access ) */ THDB *THREAD_Current(void) { - TEB *teb = NtCurrentTeb(); - if (!teb) return NULL; - return (THDB *)((char *)teb - (int)&((THDB *)0)->teb); + if (!THREAD_InitDone) return NULL; + return (THDB *)((char *)NtCurrentTeb() - (int)&((THDB *)0)->teb); } @@ -143,6 +146,7 @@ THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size, thdb->teb.stack_sel = 0; /* FIXME */ thdb->teb.self = &thdb->teb; thdb->teb.tls_ptr = thdb->tls_array; + thdb->teb.process = pdb; thdb->wait_list = &thdb->wait_struct; thdb->exit_code = 0x103; /* STILL_ACTIVE */ thdb->entry_point = start_addr; @@ -150,7 +154,18 @@ THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size, /* Allocate the stack */ - if (!stack_size) stack_size = 1024 * 1024; /* default size = 1Mb */ + /* FIXME: + * If stacksize smaller than 1 MB, allocate 1MB + * (one program wanted only 10 kB, which is recommendable, but some WINE + * functions, noteably in the files subdir, push HUGE structures and + * arrays on the stack. They probably shouldn't.) + * If stacksize larger than 16 MB, warn the user. (We could shrink the stack + * but this could give more or less unexplainable crashes.) + */ + if (stack_size<1024*1024) + stack_size = 1024 * 1024; + if (stack_size >= 16*1024*1024) + fprintf(stderr,"Warning:Thread stack size is %ld MB.\n",stack_size/1024/1024); thdb->stack_base = VirtualAlloc( NULL, stack_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE ); if (!thdb->stack_base) goto error; @@ -377,12 +392,11 @@ void WINAPI SetLastErrorEx( DWORD error, DWORD type ) /********************************************************************** - * TlsAlloc (KERNEL32.530) + * THREAD_TlsAlloc */ -DWORD WINAPI TlsAlloc(void) +DWORD THREAD_TlsAlloc(THDB *thread) { DWORD i, mask, ret = 0; - THDB *thread = THREAD_Current(); DWORD *bits = thread->process->tls_bits; EnterCriticalSection( &thread->process->crit_section ); if (*bits == 0xffffffff) @@ -402,6 +416,14 @@ DWORD WINAPI TlsAlloc(void) return ret + i; } +/********************************************************************** + * TlsAlloc (KERNEL32.530) + */ +DWORD WINAPI TlsAlloc(void) +{ + return THREAD_TlsAlloc(THREAD_Current()); +} + /********************************************************************** * TlsFree (KERNEL32.531) diff --git a/tools/build.c b/tools/build.c index 34995d24f4d..154f6793347 100644 --- a/tools/build.c +++ b/tools/build.c @@ -1308,16 +1308,21 @@ static int BuildSpecFile( FILE *outfile, char *specname ) static int TransferArgs16To32( FILE *outfile, char *args, int usecdecl ) { int i, pos16, pos32; + char *xargs; /* Copy the arguments */ pos16 = 6; /* skip bp and return address */ pos32 = usecdecl ? -(strlen(args) * 4) : 0; + xargs = usecdecl ? args:args+strlen(args); for (i = strlen(args); i > 0; i--) { - if (!usecdecl) pos32 -= 4; - switch(args[i-1]) + if (!usecdecl) { + pos32 -= 4; + xargs--; + } + switch(*xargs) { case 'w': /* word */ fprintf( outfile, "\tmovzwl %d(%%ebp),%%eax\n", pos16 ); @@ -1353,9 +1358,12 @@ static int TransferArgs16To32( FILE *outfile, char *args, int usecdecl ) break; default: - fprintf( stderr, "Unknown arg type '%c'\n", args[i-1] ); + fprintf( stderr, "Unknown arg type '%c'\n", *xargs ); + } + if (usecdecl) { + pos32 += 4; + xargs++; } - if (usecdecl) pos32 += 4; } return pos16 - 6; /* Return the size of the 16-bit args */ @@ -2087,7 +2095,7 @@ static void BuildCallTo32LargeStack( FILE *outfile ) * * Stack layout: * ... ... - * (esp+208) ret addr (or relay addr when debugging_relay is on) + * (esp+208) ret addr (or relay addr when debugging(relay) is on) * (esp+204) entry point * (esp+0) CONTEXT struct */ diff --git a/tools/find_debug_channels b/tools/find_debug_channels new file mode 100644 index 00000000000..39c5666f269 --- /dev/null +++ b/tools/find_debug_channels @@ -0,0 +1,41 @@ +#!/bin/bash +# +# This script scans the whole source code for symbols of the form +# 'dprintf_xxx(yyy' where yyy is a C identifier and outputs, on the +# standard output a sorted list of the identifiers found in the .c +# files. Each identifier is reported once. Header files are not +# scanned. +# +# The script can be given an argument that specify the files to be +# searched according to the following scheme: +# - if the argument does not contain a slash (/), the script +# will search the tree rooted in the current directory for +# files that match that description. You can also pass +# wildcard arguments, but remember to quote them to prevent +# expansion by the shell +# - if the argument does contain a slash, only that file is +# searched +# - if no argument is given, the argument defaults to "*.c" +# that is, all C files are searched. +# - if more than a argument is given, only the listed files are +# searched. Note that in this case, the script will not +# attempt to find them in some subdirectories, but rather +# it will try to open them in the current directory. +# Thus, if you want to disable the automatic searching when the file +# name does not contain a /, either prefix the filename with ./ +# or add /dev/null as another argument. +# +# Dimitrie O. Paun +# + +case "$#" in + 0 | 1) files=${1:-'*.c'} + if [ ${files#*/} = "$files" ]; then + files=$(find . -name "$files" -print) + fi;; + * ) files="$@";; +esac + +grep -h dprintf_ $files /dev/null | \ + sed 's/.*dprintf_[A-Za-z0-9_]\+ *( *\([A-Za-z0-9_]*\).*/\1/g' | \ + sort | uniq diff --git a/tools/fnt2bdf.c b/tools/fnt2bdf.c index 80537be43eb..f678e85648c 100644 --- a/tools/fnt2bdf.c +++ b/tools/fnt2bdf.c @@ -81,7 +81,8 @@ int ret_val = 0; } break; } - case(dfString): + case(dfString): + break; } return ret_val; } diff --git a/tools/make_X11wrappers b/tools/make_X11wrappers index 0f2db0b0bef..08b470cc7df 100755 --- a/tools/make_X11wrappers +++ b/tools/make_X11wrappers @@ -78,7 +78,6 @@ END $x11_incl#include #include "x11drv.h" -#include "stddebug.h" #include "debug.h" END @@ -212,13 +211,13 @@ sub raw_output_fn { # print OUTH "#define $fn_name TS$fn_name\n"; print OUTC "{\n"; print OUTC " $resultdecl;\n" if $resultdecl; - print OUTC " dprintf_x11(stddeb, \"Call $fn_name\\n\");\n"; + print OUTC " dprintf_info(x11, \"Call $fn_name\\n\");\n"; print OUTC " EnterCriticalSection( &X11DRV_CritSection );\n"; print OUTC " "; print OUTC "r = " if $resultdecl; print OUTC "$fn_name($actuals);\n"; print OUTC " LeaveCriticalSection( &X11DRV_CritSection );\n"; - print OUTC " dprintf_x11(stddeb, \"Ret $fn_name\\n\");\n"; + print OUTC " dprintf_info(x11, \"Ret $fn_name\\n\");\n"; print OUTC " return r;\n" if $resultdecl; print OUTC "}\n"; $want{$fn_name} = 2; diff --git a/tools/make_debug b/tools/make_debug index d836f3b0a67..67451f6e210 100755 --- a/tools/make_debug +++ b/tools/make_debug @@ -1,164 +1,75 @@ -#!/bin/sh +#!/bin/bash # -# This script scans the whole source code for symbols of the form dprintf_xxx, -# generates the necessary macro definitions and puts them into the files -# include/stddebug.h and include/debug.h . This script must be started with -# cwd = rootdir of the Wine-distribution. +# This script generates the required files for supporting the debug +# channels used throught the code. +# The generated files are +# include/debugdefs.h +# include/debug.h +# The script must be run in the root directory of the project. # -# Michael Patra +# Dimitrie O. Paun # -DEBUG_H=include/debug.h -STDDEBUG_H=include/stddebug.h +DEBUG_H="include/debug.h" +DEBUG_DEFS_H="include/debugdefs.h" -mv $DEBUG_H $DEBUG_H.old -mv $STDDEBUG_H $STDDEBUG_H.old +DEBUG_CHANNELS="$( tools/find_debug_channels )" -# Build the list of debug identifiers -grep -h dprintf_ `find . -name '*.c' -print` | \ - sed 's/.*dprintf_\([A-Za-z0-9_]*\).*/\1/g' | sort | uniq > temp.$$ - -# Build debug.h - -sed '/^\/\* Do not remove this line or change anything below this line \*\//q'\ - <$DEBUG_H.old >$DEBUG_H -cat <<++EOF++ >> $DEBUG_H - -#ifdef DEBUG_NONE_EXT -++EOF++ - -cat temp.$$ | tr a-z A-Z | { -while read x -do - echo "#undef DEBUG_$x" >> $DEBUG_H -done -} + cat <>$DEBUG_H +#ifndef __DEBUGTOOLS_H +#include "debugtools.h" #endif -#ifdef DEBUG_ALL_EXT -++EOF++ - -cat temp.$$ | tr a-z A-Z | -{ -while read x -do - echo "#define DEBUG_$x" >> $DEBUG_H -done -} - -cat <<++EOF++ >>$DEBUG_H -#endif - -#ifdef DEBUG_RUNTIME -#ifdef DEBUG_DEFINE_VARIABLES -short debug_msg_enabled[]={ -++EOF++ - -cat temp.$$ | tr a-z A-Z | -{ -while read x -do - cat <<++EOF++ >>$DEBUG_H -#ifdef DEBUG_$x - 1, -#else - 0, -#endif -++EOF++ - -done -} - -cat <<++EOF++ >>$DEBUG_H - 0 -}; -#else -extern short debug_msg_enabled[]; -#endif -#endif - -++EOF++ - -i=0 -cat temp.$$ | -{ -while read x -do - y=`echo $x | tr a-z A-Z` - cat <<++EOF++ >>$DEBUG_H -#ifdef DEBUG_RUNTIME -#define dprintf_$x if(!debug_msg_enabled[$i]) ; else fprintf -#define debugging_$x debug_msg_enabled[$i] -#else -#ifdef DEBUG_$y -#define dprintf_$x fprintf -#define debugging_$x 1 -#else -#define dprintf_$x while(0) fprintf -#define debugging_$x 0 -#endif -#endif - -++EOF++ +EOF + i=0 + for ch in $DEBUG_CHANNELS + do + echo "#define dbch_${ch} $i" let i=$i+1 -done -} + done +} > $DEBUG_H -cat <<++EOF++ >>$DEBUG_H +# Now, on the last step, we proceed to construct +# the definitions to be used by the main function. +# These will be stored in include/debugdefs.h +{ + cat <> $DEBUG_H -done -} + for ch in $DEBUG_CHANNELS + do + echo "{1, 1, 0, 0}," + done + echo '};' -cat <<++EOF++ >>$DEBUG_H - "" -}; -#endif -#endif -++EOF++ + echo 'const char* debug_ch_name[] = {' + for ch in $DEBUG_CHANNELS + do + echo "\"${ch}\"," + done + echo '};' + + cat <$STDDEBUG_H +#endif /*DEBUG_RUNTIME*/ -cat <<++EOF++ >>$STDDEBUG_H +/* end of automatically generated debug.h */ +EOF -#ifdef DEBUG_NONE -++EOF++ +} > $DEBUG_DEFS_H -cat temp.$$ | tr a-z A-Z | -{ -while read x -do - echo "#undef DEBUG_$x" >> $STDDEBUG_H -done -} -cat <<++EOF++ >>$STDDEBUG_H -#endif - -#ifdef DEBUG_ALL -++EOF++ - -cat temp.$$ | tr a-z A-Z | -{ -while read x -do - echo "#define DEBUG_$x" >> $STDDEBUG_H -done -} -echo "#endif" >> $STDDEBUG_H - -rm temp.$$ $DEBUG_H.old $STDDEBUG_H.old diff --git a/tsx11/ts_xlib.c b/tsx11/ts_xlib.c index 765e52d1b40..d81cbdff818 100644 --- a/tsx11/ts_xlib.c +++ b/tsx11/ts_xlib.c @@ -6,1258 +6,1257 @@ #include #include "x11drv.h" -#include "stddebug.h" #include "debug.h" XFontStruct * TSXLoadQueryFont(Display* a0, const char* a1) { XFontStruct * r; - dprintf_x11(stddeb, "Call XLoadQueryFont\n"); + dprintf_info(x11, "Call XLoadQueryFont\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XLoadQueryFont(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XLoadQueryFont\n"); + dprintf_info(x11, "Ret XLoadQueryFont\n"); return r; } XModifierKeymap * TSXGetModifierMapping(Display* a0) { XModifierKeymap * r; - dprintf_x11(stddeb, "Call XGetModifierMapping\n"); + dprintf_info(x11, "Call XGetModifierMapping\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetModifierMapping(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetModifierMapping\n"); + dprintf_info(x11, "Ret XGetModifierMapping\n"); return r; } XImage * TSXCreateImage(Display* a0, Visual* a1, unsigned int a2, int a3, int a4, char* a5, unsigned int a6, unsigned int a7, int a8, int a9) { XImage * r; - dprintf_x11(stddeb, "Call XCreateImage\n"); + dprintf_info(x11, "Call XCreateImage\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateImage(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateImage\n"); + dprintf_info(x11, "Ret XCreateImage\n"); return r; } XImage * TSXGetImage(Display* a0, Drawable a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned long a6, int a7) { XImage * r; - dprintf_x11(stddeb, "Call XGetImage\n"); + dprintf_info(x11, "Call XGetImage\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetImage(a0, a1, a2, a3, a4, a5, a6, a7); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetImage\n"); + dprintf_info(x11, "Ret XGetImage\n"); return r; } Display * TSXOpenDisplay(const char* a0) { Display * r; - dprintf_x11(stddeb, "Call XOpenDisplay\n"); + dprintf_info(x11, "Call XOpenDisplay\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XOpenDisplay(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XOpenDisplay\n"); + dprintf_info(x11, "Ret XOpenDisplay\n"); return r; } void TSXrmInitialize(void) { - dprintf_x11(stddeb, "Call XrmInitialize\n"); + dprintf_info(x11, "Call XrmInitialize\n"); EnterCriticalSection( &X11DRV_CritSection ); XrmInitialize(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmInitialize\n"); + dprintf_info(x11, "Ret XrmInitialize\n"); } char * TSXGetAtomName(Display* a0, Atom a1) { char * r; - dprintf_x11(stddeb, "Call XGetAtomName\n"); + dprintf_info(x11, "Call XGetAtomName\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetAtomName(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetAtomName\n"); + dprintf_info(x11, "Ret XGetAtomName\n"); return r; } char * TSXKeysymToString(KeySym a0) { char * r; - dprintf_x11(stddeb, "Call XKeysymToString\n"); + dprintf_info(x11, "Call XKeysymToString\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XKeysymToString(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XKeysymToString\n"); + dprintf_info(x11, "Ret XKeysymToString\n"); return r; } Atom TSXInternAtom(Display* a0, const char* a1, int a2) { Atom r; - dprintf_x11(stddeb, "Call XInternAtom\n"); + dprintf_info(x11, "Call XInternAtom\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XInternAtom(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XInternAtom\n"); + dprintf_info(x11, "Ret XInternAtom\n"); return r; } Colormap TSXCreateColormap(Display* a0, Window a1, Visual* a2, int a3) { Colormap r; - dprintf_x11(stddeb, "Call XCreateColormap\n"); + dprintf_info(x11, "Call XCreateColormap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateColormap(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateColormap\n"); + dprintf_info(x11, "Ret XCreateColormap\n"); return r; } Cursor TSXCreatePixmapCursor(Display* a0, Pixmap a1, Pixmap a2, XColor* a3, XColor* a4, unsigned int a5, unsigned int a6) { Cursor r; - dprintf_x11(stddeb, "Call XCreatePixmapCursor\n"); + dprintf_info(x11, "Call XCreatePixmapCursor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreatePixmapCursor(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreatePixmapCursor\n"); + dprintf_info(x11, "Ret XCreatePixmapCursor\n"); return r; } Cursor TSXCreateFontCursor(Display* a0, unsigned int a1) { Cursor r; - dprintf_x11(stddeb, "Call XCreateFontCursor\n"); + dprintf_info(x11, "Call XCreateFontCursor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateFontCursor(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateFontCursor\n"); + dprintf_info(x11, "Ret XCreateFontCursor\n"); return r; } GC TSXCreateGC(Display* a0, Drawable a1, unsigned long a2, XGCValues* a3) { GC r; - dprintf_x11(stddeb, "Call XCreateGC\n"); + dprintf_info(x11, "Call XCreateGC\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateGC(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateGC\n"); + dprintf_info(x11, "Ret XCreateGC\n"); return r; } Pixmap TSXCreatePixmap(Display* a0, Drawable a1, unsigned int a2, unsigned int a3, unsigned int a4) { Pixmap r; - dprintf_x11(stddeb, "Call XCreatePixmap\n"); + dprintf_info(x11, "Call XCreatePixmap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreatePixmap(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreatePixmap\n"); + dprintf_info(x11, "Ret XCreatePixmap\n"); return r; } Pixmap TSXCreateBitmapFromData(Display* a0, Drawable a1, const char* a2, unsigned int a3, unsigned int a4) { Pixmap r; - dprintf_x11(stddeb, "Call XCreateBitmapFromData\n"); + dprintf_info(x11, "Call XCreateBitmapFromData\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateBitmapFromData(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateBitmapFromData\n"); + dprintf_info(x11, "Ret XCreateBitmapFromData\n"); return r; } Window TSXGetSelectionOwner(Display* a0, Atom a1) { Window r; - dprintf_x11(stddeb, "Call XGetSelectionOwner\n"); + dprintf_info(x11, "Call XGetSelectionOwner\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetSelectionOwner(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetSelectionOwner\n"); + dprintf_info(x11, "Ret XGetSelectionOwner\n"); return r; } Window TSXCreateWindow(Display* a0, Window a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned int a6, int a7, unsigned int a8, Visual* a9, unsigned long a10, XSetWindowAttributes* a11) { Window r; - dprintf_x11(stddeb, "Call XCreateWindow\n"); + dprintf_info(x11, "Call XCreateWindow\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateWindow(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateWindow\n"); + dprintf_info(x11, "Ret XCreateWindow\n"); return r; } char ** TSXListFonts(Display* a0, const char* a1, int a2, int* a3) { char ** r; - dprintf_x11(stddeb, "Call XListFonts\n"); + dprintf_info(x11, "Call XListFonts\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XListFonts(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XListFonts\n"); + dprintf_info(x11, "Ret XListFonts\n"); return r; } KeySym TSXKeycodeToKeysym(Display* a0, unsigned int a1, int a2) { KeySym r; - dprintf_x11(stddeb, "Call XKeycodeToKeysym\n"); + dprintf_info(x11, "Call XKeycodeToKeysym\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XKeycodeToKeysym(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XKeycodeToKeysym\n"); + dprintf_info(x11, "Ret XKeycodeToKeysym\n"); return r; } KeySym TSXLookupKeysym(XKeyEvent* a0, int a1) { KeySym r; - dprintf_x11(stddeb, "Call XLookupKeysym\n"); + dprintf_info(x11, "Call XLookupKeysym\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XLookupKeysym(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XLookupKeysym\n"); + dprintf_info(x11, "Ret XLookupKeysym\n"); return r; } KeySym * TSXGetKeyboardMapping(Display* a0, unsigned int a1, int a2, int* a3) { KeySym * r; - dprintf_x11(stddeb, "Call XGetKeyboardMapping\n"); + dprintf_info(x11, "Call XGetKeyboardMapping\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetKeyboardMapping(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetKeyboardMapping\n"); + dprintf_info(x11, "Ret XGetKeyboardMapping\n"); return r; } char * TSXResourceManagerString(Display* a0) { char * r; - dprintf_x11(stddeb, "Call XResourceManagerString\n"); + dprintf_info(x11, "Call XResourceManagerString\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XResourceManagerString(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XResourceManagerString\n"); + dprintf_info(x11, "Ret XResourceManagerString\n"); return r; } int TSXInitThreads(void) { int r; - dprintf_x11(stddeb, "Call XInitThreads\n"); + dprintf_info(x11, "Call XInitThreads\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XInitThreads(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XInitThreads\n"); + dprintf_info(x11, "Ret XInitThreads\n"); return r; } int * TSXListDepths(Display* a0, int a1, int* a2) { int * r; - dprintf_x11(stddeb, "Call XListDepths\n"); + dprintf_info(x11, "Call XListDepths\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XListDepths(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XListDepths\n"); + dprintf_info(x11, "Ret XListDepths\n"); return r; } int TSXReconfigureWMWindow(Display* a0, Window a1, int a2, unsigned int a3, XWindowChanges* a4) { int r; - dprintf_x11(stddeb, "Call XReconfigureWMWindow\n"); + dprintf_info(x11, "Call XReconfigureWMWindow\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XReconfigureWMWindow(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XReconfigureWMWindow\n"); + dprintf_info(x11, "Ret XReconfigureWMWindow\n"); return r; } int TSXSetWMProtocols(Display* a0, Window a1, Atom* a2, int a3) { int r; - dprintf_x11(stddeb, "Call XSetWMProtocols\n"); + dprintf_info(x11, "Call XSetWMProtocols\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetWMProtocols(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetWMProtocols\n"); + dprintf_info(x11, "Ret XSetWMProtocols\n"); return r; } int TSXSetTransientForHint(Display* a0, Window a1, Window a2) { int r; - dprintf_x11(stddeb, "Call XSetTransientForHint\n"); + dprintf_info(x11, "Call XSetTransientForHint\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetTransientForHint(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetTransientForHint\n"); + dprintf_info(x11, "Ret XSetTransientForHint\n"); return r; } int TSXActivateScreenSaver(Display* a0) { int r; - dprintf_x11(stddeb, "Call XActivateScreenSaver\n"); + dprintf_info(x11, "Call XActivateScreenSaver\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XActivateScreenSaver(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XActivateScreenSaver\n"); + dprintf_info(x11, "Ret XActivateScreenSaver\n"); return r; } int TSXAllocColor(Display* a0, Colormap a1, XColor* a2) { int r; - dprintf_x11(stddeb, "Call XAllocColor\n"); + dprintf_info(x11, "Call XAllocColor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XAllocColor(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XAllocColor\n"); + dprintf_info(x11, "Ret XAllocColor\n"); return r; } int TSXAllocColorCells(Display* a0, Colormap a1, int a2, unsigned long* a3, unsigned int a4, unsigned long* a5, unsigned int a6) { int r; - dprintf_x11(stddeb, "Call XAllocColorCells\n"); + dprintf_info(x11, "Call XAllocColorCells\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XAllocColorCells(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XAllocColorCells\n"); + dprintf_info(x11, "Ret XAllocColorCells\n"); return r; } int TSXBell(Display* a0, int a1) { int r; - dprintf_x11(stddeb, "Call XBell\n"); + dprintf_info(x11, "Call XBell\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XBell(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XBell\n"); + dprintf_info(x11, "Ret XBell\n"); return r; } int TSXChangeGC(Display* a0, GC a1, unsigned long a2, XGCValues* a3) { int r; - dprintf_x11(stddeb, "Call XChangeGC\n"); + dprintf_info(x11, "Call XChangeGC\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XChangeGC(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XChangeGC\n"); + dprintf_info(x11, "Ret XChangeGC\n"); return r; } int TSXChangeKeyboardControl(Display* a0, unsigned long a1, XKeyboardControl* a2) { int r; - dprintf_x11(stddeb, "Call XChangeKeyboardControl\n"); + dprintf_info(x11, "Call XChangeKeyboardControl\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XChangeKeyboardControl(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XChangeKeyboardControl\n"); + dprintf_info(x11, "Ret XChangeKeyboardControl\n"); return r; } int TSXChangeProperty(Display* a0, Window a1, Atom a2, Atom a3, int a4, int a5, const unsigned char* a6, int a7) { int r; - dprintf_x11(stddeb, "Call XChangeProperty\n"); + dprintf_info(x11, "Call XChangeProperty\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XChangeProperty(a0, a1, a2, a3, a4, a5, a6, a7); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XChangeProperty\n"); + dprintf_info(x11, "Ret XChangeProperty\n"); return r; } int TSXChangeWindowAttributes(Display* a0, Window a1, unsigned long a2, XSetWindowAttributes* a3) { int r; - dprintf_x11(stddeb, "Call XChangeWindowAttributes\n"); + dprintf_info(x11, "Call XChangeWindowAttributes\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XChangeWindowAttributes(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XChangeWindowAttributes\n"); + dprintf_info(x11, "Ret XChangeWindowAttributes\n"); return r; } int TSXCheckTypedWindowEvent(Display* a0, Window a1, int a2, XEvent* a3) { int r; - dprintf_x11(stddeb, "Call XCheckTypedWindowEvent\n"); + dprintf_info(x11, "Call XCheckTypedWindowEvent\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCheckTypedWindowEvent(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCheckTypedWindowEvent\n"); + dprintf_info(x11, "Ret XCheckTypedWindowEvent\n"); return r; } int TSXCheckWindowEvent(Display* a0, Window a1, long a2, XEvent* a3) { int r; - dprintf_x11(stddeb, "Call XCheckWindowEvent\n"); + dprintf_info(x11, "Call XCheckWindowEvent\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCheckWindowEvent(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCheckWindowEvent\n"); + dprintf_info(x11, "Ret XCheckWindowEvent\n"); return r; } int TSXConvertSelection(Display* a0, Atom a1, Atom a2, Atom a3, Window a4, Time a5) { int r; - dprintf_x11(stddeb, "Call XConvertSelection\n"); + dprintf_info(x11, "Call XConvertSelection\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XConvertSelection(a0, a1, a2, a3, a4, a5); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XConvertSelection\n"); + dprintf_info(x11, "Ret XConvertSelection\n"); return r; } int TSXCopyArea(Display* a0, Drawable a1, Drawable a2, GC a3, int a4, int a5, unsigned int a6, unsigned int a7, int a8, int a9) { int r; - dprintf_x11(stddeb, "Call XCopyArea\n"); + dprintf_info(x11, "Call XCopyArea\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCopyArea(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCopyArea\n"); + dprintf_info(x11, "Ret XCopyArea\n"); return r; } int TSXCopyPlane(Display* a0, Drawable a1, Drawable a2, GC a3, int a4, int a5, unsigned int a6, unsigned int a7, int a8, int a9, unsigned long a10) { int r; - dprintf_x11(stddeb, "Call XCopyPlane\n"); + dprintf_info(x11, "Call XCopyPlane\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCopyPlane(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCopyPlane\n"); + dprintf_info(x11, "Ret XCopyPlane\n"); return r; } int TSXDefineCursor(Display* a0, Window a1, Cursor a2) { int r; - dprintf_x11(stddeb, "Call XDefineCursor\n"); + dprintf_info(x11, "Call XDefineCursor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDefineCursor(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDefineCursor\n"); + dprintf_info(x11, "Ret XDefineCursor\n"); return r; } int TSXDestroyWindow(Display* a0, Window a1) { int r; - dprintf_x11(stddeb, "Call XDestroyWindow\n"); + dprintf_info(x11, "Call XDestroyWindow\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDestroyWindow(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDestroyWindow\n"); + dprintf_info(x11, "Ret XDestroyWindow\n"); return r; } int TSXDisplayKeycodes(Display* a0, int* a1, int* a2) { int r; - dprintf_x11(stddeb, "Call XDisplayKeycodes\n"); + dprintf_info(x11, "Call XDisplayKeycodes\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDisplayKeycodes(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDisplayKeycodes\n"); + dprintf_info(x11, "Ret XDisplayKeycodes\n"); return r; } int TSXDrawArc(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8) { int r; - dprintf_x11(stddeb, "Call XDrawArc\n"); + dprintf_info(x11, "Call XDrawArc\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawArc(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawArc\n"); + dprintf_info(x11, "Ret XDrawArc\n"); return r; } int TSXDrawLine(Display* a0, Drawable a1, GC a2, int a3, int a4, int a5, int a6) { int r; - dprintf_x11(stddeb, "Call XDrawLine\n"); + dprintf_info(x11, "Call XDrawLine\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawLine(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawLine\n"); + dprintf_info(x11, "Ret XDrawLine\n"); return r; } int TSXDrawLines(Display* a0, Drawable a1, GC a2, XPoint* a3, int a4, int a5) { int r; - dprintf_x11(stddeb, "Call XDrawLines\n"); + dprintf_info(x11, "Call XDrawLines\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawLines(a0, a1, a2, a3, a4, a5); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawLines\n"); + dprintf_info(x11, "Ret XDrawLines\n"); return r; } int TSXDrawPoint(Display* a0, Drawable a1, GC a2, int a3, int a4) { int r; - dprintf_x11(stddeb, "Call XDrawPoint\n"); + dprintf_info(x11, "Call XDrawPoint\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawPoint(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawPoint\n"); + dprintf_info(x11, "Ret XDrawPoint\n"); return r; } int TSXDrawRectangle(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6) { int r; - dprintf_x11(stddeb, "Call XDrawRectangle\n"); + dprintf_info(x11, "Call XDrawRectangle\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawRectangle(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawRectangle\n"); + dprintf_info(x11, "Ret XDrawRectangle\n"); return r; } int TSXDrawSegments(Display* a0, Drawable a1, GC a2, XSegment* a3, int a4) { int r; - dprintf_x11(stddeb, "Call XDrawSegments\n"); + dprintf_info(x11, "Call XDrawSegments\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawSegments(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawSegments\n"); + dprintf_info(x11, "Ret XDrawSegments\n"); return r; } int TSXDrawString(Display* a0, Drawable a1, GC a2, int a3, int a4, const char* a5, int a6) { int r; - dprintf_x11(stddeb, "Call XDrawString\n"); + dprintf_info(x11, "Call XDrawString\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawString(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawString\n"); + dprintf_info(x11, "Ret XDrawString\n"); return r; } int TSXDrawText(Display* a0, Drawable a1, GC a2, int a3, int a4, XTextItem* a5, int a6) { int r; - dprintf_x11(stddeb, "Call XDrawText\n"); + dprintf_info(x11, "Call XDrawText\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDrawText(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDrawText\n"); + dprintf_info(x11, "Ret XDrawText\n"); return r; } int TSXFillArc(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8) { int r; - dprintf_x11(stddeb, "Call XFillArc\n"); + dprintf_info(x11, "Call XFillArc\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFillArc(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFillArc\n"); + dprintf_info(x11, "Ret XFillArc\n"); return r; } int TSXFillPolygon(Display* a0, Drawable a1, GC a2, XPoint* a3, int a4, int a5, int a6) { int r; - dprintf_x11(stddeb, "Call XFillPolygon\n"); + dprintf_info(x11, "Call XFillPolygon\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFillPolygon(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFillPolygon\n"); + dprintf_info(x11, "Ret XFillPolygon\n"); return r; } int TSXFillRectangle(Display* a0, Drawable a1, GC a2, int a3, int a4, unsigned int a5, unsigned int a6) { int r; - dprintf_x11(stddeb, "Call XFillRectangle\n"); + dprintf_info(x11, "Call XFillRectangle\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFillRectangle(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFillRectangle\n"); + dprintf_info(x11, "Ret XFillRectangle\n"); return r; } int TSXFlush(Display* a0) { int r; - dprintf_x11(stddeb, "Call XFlush\n"); + dprintf_info(x11, "Call XFlush\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFlush(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFlush\n"); + dprintf_info(x11, "Ret XFlush\n"); return r; } int TSXFree(void* a0) { int r; - dprintf_x11(stddeb, "Call XFree\n"); + dprintf_info(x11, "Call XFree\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFree(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFree\n"); + dprintf_info(x11, "Ret XFree\n"); return r; } int TSXFreeColormap(Display* a0, Colormap a1) { int r; - dprintf_x11(stddeb, "Call XFreeColormap\n"); + dprintf_info(x11, "Call XFreeColormap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeColormap(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeColormap\n"); + dprintf_info(x11, "Ret XFreeColormap\n"); return r; } int TSXFreeColors(Display* a0, Colormap a1, unsigned long* a2, int a3, unsigned long a4) { int r; - dprintf_x11(stddeb, "Call XFreeColors\n"); + dprintf_info(x11, "Call XFreeColors\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeColors(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeColors\n"); + dprintf_info(x11, "Ret XFreeColors\n"); return r; } int TSXFreeCursor(Display* a0, Cursor a1) { int r; - dprintf_x11(stddeb, "Call XFreeCursor\n"); + dprintf_info(x11, "Call XFreeCursor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeCursor(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeCursor\n"); + dprintf_info(x11, "Ret XFreeCursor\n"); return r; } int TSXFreeFont(Display* a0, XFontStruct* a1) { int r; - dprintf_x11(stddeb, "Call XFreeFont\n"); + dprintf_info(x11, "Call XFreeFont\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeFont(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeFont\n"); + dprintf_info(x11, "Ret XFreeFont\n"); return r; } int TSXFreeFontNames(char** a0) { int r; - dprintf_x11(stddeb, "Call XFreeFontNames\n"); + dprintf_info(x11, "Call XFreeFontNames\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeFontNames(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeFontNames\n"); + dprintf_info(x11, "Ret XFreeFontNames\n"); return r; } int TSXFreeGC(Display* a0, GC a1) { int r; - dprintf_x11(stddeb, "Call XFreeGC\n"); + dprintf_info(x11, "Call XFreeGC\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeGC(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeGC\n"); + dprintf_info(x11, "Ret XFreeGC\n"); return r; } int TSXFreeModifiermap(XModifierKeymap* a0) { int r; - dprintf_x11(stddeb, "Call XFreeModifiermap\n"); + dprintf_info(x11, "Call XFreeModifiermap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreeModifiermap(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreeModifiermap\n"); + dprintf_info(x11, "Ret XFreeModifiermap\n"); return r; } int TSXFreePixmap(Display* a0, Pixmap a1) { int r; - dprintf_x11(stddeb, "Call XFreePixmap\n"); + dprintf_info(x11, "Call XFreePixmap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFreePixmap(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFreePixmap\n"); + dprintf_info(x11, "Ret XFreePixmap\n"); return r; } int TSXGetFontProperty(XFontStruct* a0, Atom a1, unsigned long* a2) { int r; - dprintf_x11(stddeb, "Call XGetFontProperty\n"); + dprintf_info(x11, "Call XGetFontProperty\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetFontProperty(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetFontProperty\n"); + dprintf_info(x11, "Ret XGetFontProperty\n"); return r; } int TSXGetGeometry(Display* a0, Drawable a1, Window* a2, int* a3, int* a4, unsigned int* a5, unsigned int* a6, unsigned int* a7, unsigned int* a8) { int r; - dprintf_x11(stddeb, "Call XGetGeometry\n"); + dprintf_info(x11, "Call XGetGeometry\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetGeometry(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetGeometry\n"); + dprintf_info(x11, "Ret XGetGeometry\n"); return r; } int TSXGetInputFocus(Display* a0, Window* a1, int* a2) { int r; - dprintf_x11(stddeb, "Call XGetInputFocus\n"); + dprintf_info(x11, "Call XGetInputFocus\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetInputFocus(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetInputFocus\n"); + dprintf_info(x11, "Ret XGetInputFocus\n"); return r; } int TSXGetKeyboardControl(Display* a0, XKeyboardState* a1) { int r; - dprintf_x11(stddeb, "Call XGetKeyboardControl\n"); + dprintf_info(x11, "Call XGetKeyboardControl\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetKeyboardControl(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetKeyboardControl\n"); + dprintf_info(x11, "Ret XGetKeyboardControl\n"); return r; } int TSXGetScreenSaver(Display* a0, int* a1, int* a2, int* a3, int* a4) { int r; - dprintf_x11(stddeb, "Call XGetScreenSaver\n"); + dprintf_info(x11, "Call XGetScreenSaver\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetScreenSaver(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetScreenSaver\n"); + dprintf_info(x11, "Ret XGetScreenSaver\n"); return r; } int TSXGetWindowProperty(Display* a0, Window a1, Atom a2, long a3, long a4, int a5, Atom a6, Atom* a7, int* a8, unsigned long* a9, unsigned long* a10, unsigned char** a11) { int r; - dprintf_x11(stddeb, "Call XGetWindowProperty\n"); + dprintf_info(x11, "Call XGetWindowProperty\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetWindowProperty(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetWindowProperty\n"); + dprintf_info(x11, "Ret XGetWindowProperty\n"); return r; } int TSXGetWindowAttributes(Display* a0, Window a1, XWindowAttributes* a2) { int r; - dprintf_x11(stddeb, "Call XGetWindowAttributes\n"); + dprintf_info(x11, "Call XGetWindowAttributes\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetWindowAttributes(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetWindowAttributes\n"); + dprintf_info(x11, "Ret XGetWindowAttributes\n"); return r; } int TSXGrabPointer(Display* a0, Window a1, int a2, unsigned int a3, int a4, int a5, Window a6, Cursor a7, Time a8) { int r; - dprintf_x11(stddeb, "Call XGrabPointer\n"); + dprintf_info(x11, "Call XGrabPointer\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGrabPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGrabPointer\n"); + dprintf_info(x11, "Ret XGrabPointer\n"); return r; } int TSXGrabServer(Display* a0) { int r; - dprintf_x11(stddeb, "Call XGrabServer\n"); + dprintf_info(x11, "Call XGrabServer\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGrabServer(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGrabServer\n"); + dprintf_info(x11, "Ret XGrabServer\n"); return r; } int TSXInstallColormap(Display* a0, Colormap a1) { int r; - dprintf_x11(stddeb, "Call XInstallColormap\n"); + dprintf_info(x11, "Call XInstallColormap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XInstallColormap(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XInstallColormap\n"); + dprintf_info(x11, "Ret XInstallColormap\n"); return r; } KeyCode TSXKeysymToKeycode(Display* a0, KeySym a1) { KeyCode r; - dprintf_x11(stddeb, "Call XKeysymToKeycode\n"); + dprintf_info(x11, "Call XKeysymToKeycode\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XKeysymToKeycode(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XKeysymToKeycode\n"); + dprintf_info(x11, "Ret XKeysymToKeycode\n"); return r; } int TSXMapWindow(Display* a0, Window a1) { int r; - dprintf_x11(stddeb, "Call XMapWindow\n"); + dprintf_info(x11, "Call XMapWindow\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XMapWindow(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XMapWindow\n"); + dprintf_info(x11, "Ret XMapWindow\n"); return r; } int TSXNextEvent(Display* a0, XEvent* a1) { int r; - dprintf_x11(stddeb, "Call XNextEvent\n"); + dprintf_info(x11, "Call XNextEvent\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XNextEvent(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XNextEvent\n"); + dprintf_info(x11, "Ret XNextEvent\n"); return r; } int TSXParseGeometry(const char* a0, int* a1, int* a2, unsigned int* a3, unsigned int* a4) { int r; - dprintf_x11(stddeb, "Call XParseGeometry\n"); + dprintf_info(x11, "Call XParseGeometry\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XParseGeometry(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XParseGeometry\n"); + dprintf_info(x11, "Ret XParseGeometry\n"); return r; } int TSXPending(Display* a0) { int r; - dprintf_x11(stddeb, "Call XPending\n"); + dprintf_info(x11, "Call XPending\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XPending(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XPending\n"); + dprintf_info(x11, "Ret XPending\n"); return r; } int TSXPutBackEvent(Display* a0, XEvent* a1) { int r; - dprintf_x11(stddeb, "Call XPutBackEvent\n"); + dprintf_info(x11, "Call XPutBackEvent\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XPutBackEvent(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XPutBackEvent\n"); + dprintf_info(x11, "Ret XPutBackEvent\n"); return r; } int TSXPutImage(Display* a0, Drawable a1, GC a2, XImage* a3, int a4, int a5, int a6, int a7, unsigned int a8, unsigned int a9) { int r; - dprintf_x11(stddeb, "Call XPutImage\n"); + dprintf_info(x11, "Call XPutImage\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XPutImage(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XPutImage\n"); + dprintf_info(x11, "Ret XPutImage\n"); return r; } int TSXQueryColor(Display* a0, Colormap a1, XColor* a2) { int r; - dprintf_x11(stddeb, "Call XQueryColor\n"); + dprintf_info(x11, "Call XQueryColor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XQueryColor(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XQueryColor\n"); + dprintf_info(x11, "Ret XQueryColor\n"); return r; } int TSXQueryPointer(Display* a0, Window a1, Window* a2, Window* a3, int* a4, int* a5, int* a6, int* a7, unsigned int* a8) { int r; - dprintf_x11(stddeb, "Call XQueryPointer\n"); + dprintf_info(x11, "Call XQueryPointer\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XQueryPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XQueryPointer\n"); + dprintf_info(x11, "Ret XQueryPointer\n"); return r; } int TSXQueryTree(Display* a0, Window a1, Window* a2, Window* a3, Window** a4, unsigned int* a5) { int r; - dprintf_x11(stddeb, "Call XQueryTree\n"); + dprintf_info(x11, "Call XQueryTree\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XQueryTree(a0, a1, a2, a3, a4, a5); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XQueryTree\n"); + dprintf_info(x11, "Ret XQueryTree\n"); return r; } int TSXResetScreenSaver(Display* a0) { int r; - dprintf_x11(stddeb, "Call XResetScreenSaver\n"); + dprintf_info(x11, "Call XResetScreenSaver\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XResetScreenSaver(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XResetScreenSaver\n"); + dprintf_info(x11, "Ret XResetScreenSaver\n"); return r; } int TSXRestackWindows(Display* a0, Window* a1, int a2) { int r; - dprintf_x11(stddeb, "Call XRestackWindows\n"); + dprintf_info(x11, "Call XRestackWindows\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XRestackWindows(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XRestackWindows\n"); + dprintf_info(x11, "Ret XRestackWindows\n"); return r; } int TSXSendEvent(Display* a0, Window a1, int a2, long a3, XEvent* a4) { int r; - dprintf_x11(stddeb, "Call XSendEvent\n"); + dprintf_info(x11, "Call XSendEvent\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSendEvent(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSendEvent\n"); + dprintf_info(x11, "Ret XSendEvent\n"); return r; } int TSXSetArcMode(Display* a0, GC a1, int a2) { int r; - dprintf_x11(stddeb, "Call XSetArcMode\n"); + dprintf_info(x11, "Call XSetArcMode\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetArcMode(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetArcMode\n"); + dprintf_info(x11, "Ret XSetArcMode\n"); return r; } int TSXSetBackground(Display* a0, GC a1, unsigned long a2) { int r; - dprintf_x11(stddeb, "Call XSetBackground\n"); + dprintf_info(x11, "Call XSetBackground\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetBackground(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetBackground\n"); + dprintf_info(x11, "Ret XSetBackground\n"); return r; } int TSXSetClipMask(Display* a0, GC a1, Pixmap a2) { int r; - dprintf_x11(stddeb, "Call XSetClipMask\n"); + dprintf_info(x11, "Call XSetClipMask\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetClipMask(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetClipMask\n"); + dprintf_info(x11, "Ret XSetClipMask\n"); return r; } int TSXSetClipOrigin(Display* a0, GC a1, int a2, int a3) { int r; - dprintf_x11(stddeb, "Call XSetClipOrigin\n"); + dprintf_info(x11, "Call XSetClipOrigin\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetClipOrigin(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetClipOrigin\n"); + dprintf_info(x11, "Ret XSetClipOrigin\n"); return r; } int TSXSetClipRectangles(Display* a0, GC a1, int a2, int a3, XRectangle* a4, int a5, int a6) { int r; - dprintf_x11(stddeb, "Call XSetClipRectangles\n"); + dprintf_info(x11, "Call XSetClipRectangles\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetClipRectangles(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetClipRectangles\n"); + dprintf_info(x11, "Ret XSetClipRectangles\n"); return r; } int TSXSetDashes(Display* a0, GC a1, int a2, const char* a3, int a4) { int r; - dprintf_x11(stddeb, "Call XSetDashes\n"); + dprintf_info(x11, "Call XSetDashes\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetDashes(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetDashes\n"); + dprintf_info(x11, "Ret XSetDashes\n"); return r; } int TSXSetFillStyle(Display* a0, GC a1, int a2) { int r; - dprintf_x11(stddeb, "Call XSetFillStyle\n"); + dprintf_info(x11, "Call XSetFillStyle\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetFillStyle(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetFillStyle\n"); + dprintf_info(x11, "Ret XSetFillStyle\n"); return r; } int TSXSetForeground(Display* a0, GC a1, unsigned long a2) { int r; - dprintf_x11(stddeb, "Call XSetForeground\n"); + dprintf_info(x11, "Call XSetForeground\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetForeground(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetForeground\n"); + dprintf_info(x11, "Ret XSetForeground\n"); return r; } int TSXSetFunction(Display* a0, GC a1, int a2) { int r; - dprintf_x11(stddeb, "Call XSetFunction\n"); + dprintf_info(x11, "Call XSetFunction\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetFunction(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetFunction\n"); + dprintf_info(x11, "Ret XSetFunction\n"); return r; } int TSXSetGraphicsExposures(Display* a0, GC a1, int a2) { int r; - dprintf_x11(stddeb, "Call XSetGraphicsExposures\n"); + dprintf_info(x11, "Call XSetGraphicsExposures\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetGraphicsExposures(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetGraphicsExposures\n"); + dprintf_info(x11, "Ret XSetGraphicsExposures\n"); return r; } int TSXSetIconName(Display* a0, Window a1, const char* a2) { int r; - dprintf_x11(stddeb, "Call XSetIconName\n"); + dprintf_info(x11, "Call XSetIconName\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetIconName(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetIconName\n"); + dprintf_info(x11, "Ret XSetIconName\n"); return r; } int TSXSetInputFocus(Display* a0, Window a1, int a2, Time a3) { int r; - dprintf_x11(stddeb, "Call XSetInputFocus\n"); + dprintf_info(x11, "Call XSetInputFocus\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetInputFocus(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetInputFocus\n"); + dprintf_info(x11, "Ret XSetInputFocus\n"); return r; } int TSXSetLineAttributes(Display* a0, GC a1, unsigned int a2, int a3, int a4, int a5) { int r; - dprintf_x11(stddeb, "Call XSetLineAttributes\n"); + dprintf_info(x11, "Call XSetLineAttributes\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetLineAttributes(a0, a1, a2, a3, a4, a5); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetLineAttributes\n"); + dprintf_info(x11, "Ret XSetLineAttributes\n"); return r; } int TSXSetScreenSaver(Display* a0, int a1, int a2, int a3, int a4) { int r; - dprintf_x11(stddeb, "Call XSetScreenSaver\n"); + dprintf_info(x11, "Call XSetScreenSaver\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetScreenSaver(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetScreenSaver\n"); + dprintf_info(x11, "Ret XSetScreenSaver\n"); return r; } int TSXSetSelectionOwner(Display* a0, Atom a1, Window a2, Time a3) { int r; - dprintf_x11(stddeb, "Call XSetSelectionOwner\n"); + dprintf_info(x11, "Call XSetSelectionOwner\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetSelectionOwner(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetSelectionOwner\n"); + dprintf_info(x11, "Ret XSetSelectionOwner\n"); return r; } int TSXSetSubwindowMode(Display* a0, GC a1, int a2) { int r; - dprintf_x11(stddeb, "Call XSetSubwindowMode\n"); + dprintf_info(x11, "Call XSetSubwindowMode\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetSubwindowMode(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetSubwindowMode\n"); + dprintf_info(x11, "Ret XSetSubwindowMode\n"); return r; } int TSXStoreColor(Display* a0, Colormap a1, XColor* a2) { int r; - dprintf_x11(stddeb, "Call XStoreColor\n"); + dprintf_info(x11, "Call XStoreColor\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XStoreColor(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XStoreColor\n"); + dprintf_info(x11, "Ret XStoreColor\n"); return r; } int TSXStoreName(Display* a0, Window a1, const char* a2) { int r; - dprintf_x11(stddeb, "Call XStoreName\n"); + dprintf_info(x11, "Call XStoreName\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XStoreName(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XStoreName\n"); + dprintf_info(x11, "Ret XStoreName\n"); return r; } int TSXSync(Display* a0, int a1) { int r; - dprintf_x11(stddeb, "Call XSync\n"); + dprintf_info(x11, "Call XSync\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSync(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSync\n"); + dprintf_info(x11, "Ret XSync\n"); return r; } int TSXTextExtents(XFontStruct* a0, const char* a1, int a2, int* a3, int* a4, int* a5, XCharStruct* a6) { int r; - dprintf_x11(stddeb, "Call XTextExtents\n"); + dprintf_info(x11, "Call XTextExtents\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XTextExtents(a0, a1, a2, a3, a4, a5, a6); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XTextExtents\n"); + dprintf_info(x11, "Ret XTextExtents\n"); return r; } int TSXTextWidth(XFontStruct* a0, const char* a1, int a2) { int r; - dprintf_x11(stddeb, "Call XTextWidth\n"); + dprintf_info(x11, "Call XTextWidth\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XTextWidth(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XTextWidth\n"); + dprintf_info(x11, "Ret XTextWidth\n"); return r; } int TSXUngrabPointer(Display* a0, Time a1) { int r; - dprintf_x11(stddeb, "Call XUngrabPointer\n"); + dprintf_info(x11, "Call XUngrabPointer\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUngrabPointer(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUngrabPointer\n"); + dprintf_info(x11, "Ret XUngrabPointer\n"); return r; } int TSXUngrabServer(Display* a0) { int r; - dprintf_x11(stddeb, "Call XUngrabServer\n"); + dprintf_info(x11, "Call XUngrabServer\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUngrabServer(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUngrabServer\n"); + dprintf_info(x11, "Ret XUngrabServer\n"); return r; } int TSXUninstallColormap(Display* a0, Colormap a1) { int r; - dprintf_x11(stddeb, "Call XUninstallColormap\n"); + dprintf_info(x11, "Call XUninstallColormap\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUninstallColormap(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUninstallColormap\n"); + dprintf_info(x11, "Ret XUninstallColormap\n"); return r; } int TSXUnmapWindow(Display* a0, Window a1) { int r; - dprintf_x11(stddeb, "Call XUnmapWindow\n"); + dprintf_info(x11, "Call XUnmapWindow\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUnmapWindow(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUnmapWindow\n"); + dprintf_info(x11, "Ret XUnmapWindow\n"); return r; } int TSXWarpPointer(Display* a0, Window a1, Window a2, int a3, int a4, unsigned int a5, unsigned int a6, int a7, int a8) { int r; - dprintf_x11(stddeb, "Call XWarpPointer\n"); + dprintf_info(x11, "Call XWarpPointer\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XWarpPointer(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XWarpPointer\n"); + dprintf_info(x11, "Ret XWarpPointer\n"); return r; } int (*TSXSynchronize(Display *a0, Bool a1))(Display *) { int (*r)(Display *); - dprintf_x11(stddeb, "Call XSynchronize\n"); + dprintf_info(x11, "Call XSynchronize\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSynchronize(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSynchronize\n"); + dprintf_info(x11, "Ret XSynchronize\n"); return r; } @@ -1265,9 +1264,9 @@ extern void _XInitImageFuncPtrs(XImage *); void TS_XInitImageFuncPtrs(XImage *a0) { - dprintf_x11(stddeb, "Call _XInitImageFuncPtrs\n"); + dprintf_info(x11, "Call _XInitImageFuncPtrs\n"); EnterCriticalSection( &X11DRV_CritSection ); _XInitImageFuncPtrs(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret _XInitImageFuncPtrs\n"); + dprintf_info(x11, "Ret _XInitImageFuncPtrs\n"); } diff --git a/tsx11/ts_xpm.c b/tsx11/ts_xpm.c index 26b2dc9fb91..9ef6d9ce8a0 100644 --- a/tsx11/ts_xpm.c +++ b/tsx11/ts_xpm.c @@ -6,27 +6,26 @@ #include #include "x11drv.h" -#include "stddebug.h" #include "debug.h" int TSXpmCreatePixmapFromData(Display *a0, Drawable a1, char **a2, Pixmap *a3, Pixmap *a4, XpmAttributes *a5) { int r; - dprintf_x11(stddeb, "Call XpmCreatePixmapFromData\n"); + dprintf_info(x11, "Call XpmCreatePixmapFromData\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XpmCreatePixmapFromData(a0, a1, a2, a3, a4, a5); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XpmCreatePixmapFromData\n"); + dprintf_info(x11, "Ret XpmCreatePixmapFromData\n"); return r; } int TSXpmAttributesSize(void) { int r; - dprintf_x11(stddeb, "Call XpmAttributesSize\n"); + dprintf_info(x11, "Call XpmAttributesSize\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XpmAttributesSize(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XpmAttributesSize\n"); + dprintf_info(x11, "Ret XpmAttributesSize\n"); return r; } diff --git a/tsx11/ts_xresource.c b/tsx11/ts_xresource.c index 4eda899200a..b272b1e783e 100644 --- a/tsx11/ts_xresource.c +++ b/tsx11/ts_xresource.c @@ -7,67 +7,66 @@ #include #include #include "x11drv.h" -#include "stddebug.h" #include "debug.h" XrmQuark TSXrmUniqueQuark(void) { XrmQuark r; - dprintf_x11(stddeb, "Call XrmUniqueQuark\n"); + dprintf_info(x11, "Call XrmUniqueQuark\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XrmUniqueQuark(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmUniqueQuark\n"); + dprintf_info(x11, "Ret XrmUniqueQuark\n"); return r; } int TSXrmGetResource(XrmDatabase a0, const char* a1, const char* a2, char** a3, XrmValue* a4) { int r; - dprintf_x11(stddeb, "Call XrmGetResource\n"); + dprintf_info(x11, "Call XrmGetResource\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XrmGetResource(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmGetResource\n"); + dprintf_info(x11, "Ret XrmGetResource\n"); return r; } XrmDatabase TSXrmGetFileDatabase(const char* a0) { XrmDatabase r; - dprintf_x11(stddeb, "Call XrmGetFileDatabase\n"); + dprintf_info(x11, "Call XrmGetFileDatabase\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XrmGetFileDatabase(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmGetFileDatabase\n"); + dprintf_info(x11, "Ret XrmGetFileDatabase\n"); return r; } XrmDatabase TSXrmGetStringDatabase(const char* a0) { XrmDatabase r; - dprintf_x11(stddeb, "Call XrmGetStringDatabase\n"); + dprintf_info(x11, "Call XrmGetStringDatabase\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XrmGetStringDatabase(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmGetStringDatabase\n"); + dprintf_info(x11, "Ret XrmGetStringDatabase\n"); return r; } void TSXrmMergeDatabases(XrmDatabase a0, XrmDatabase* a1) { - dprintf_x11(stddeb, "Call XrmMergeDatabases\n"); + dprintf_info(x11, "Call XrmMergeDatabases\n"); EnterCriticalSection( &X11DRV_CritSection ); XrmMergeDatabases(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmMergeDatabases\n"); + dprintf_info(x11, "Ret XrmMergeDatabases\n"); } void TSXrmParseCommand(XrmDatabase* a0, XrmOptionDescList a1, int a2, const char* a3, int* a4, char** a5) { - dprintf_x11(stddeb, "Call XrmParseCommand\n"); + dprintf_info(x11, "Call XrmParseCommand\n"); EnterCriticalSection( &X11DRV_CritSection ); XrmParseCommand(a0, a1, a2, a3, a4, a5); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XrmParseCommand\n"); + dprintf_info(x11, "Ret XrmParseCommand\n"); } diff --git a/tsx11/ts_xshm.c b/tsx11/ts_xshm.c index ff5ee605b9e..9892f8f394e 100644 --- a/tsx11/ts_xshm.c +++ b/tsx11/ts_xshm.c @@ -7,49 +7,48 @@ #include #include #include "x11drv.h" -#include "stddebug.h" #include "debug.h" Bool TSXShmQueryExtension(Display *a0) { Bool r; - dprintf_x11(stddeb, "Call XShmQueryExtension\n"); + dprintf_info(x11, "Call XShmQueryExtension\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XShmQueryExtension(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XShmQueryExtension\n"); + dprintf_info(x11, "Ret XShmQueryExtension\n"); return r; } int TSXShmPixmapFormat(Display *a0) { int r; - dprintf_x11(stddeb, "Call XShmPixmapFormat\n"); + dprintf_info(x11, "Call XShmPixmapFormat\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XShmPixmapFormat(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XShmPixmapFormat\n"); + dprintf_info(x11, "Ret XShmPixmapFormat\n"); return r; } Status TSXShmDetach(Display *a0, XShmSegmentInfo *a1) { Status r; - dprintf_x11(stddeb, "Call XShmDetach\n"); + dprintf_info(x11, "Call XShmDetach\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XShmDetach(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XShmDetach\n"); + dprintf_info(x11, "Ret XShmDetach\n"); return r; } Status TSXShmAttach(Display *a0, XShmSegmentInfo *a1) { Status r; - dprintf_x11(stddeb, "Call XShmAttach\n"); + dprintf_info(x11, "Call XShmAttach\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XShmAttach(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XShmAttach\n"); + dprintf_info(x11, "Ret XShmAttach\n"); return r; } diff --git a/tsx11/ts_xutil.c b/tsx11/ts_xutil.c index cd499bb241f..ab447517711 100644 --- a/tsx11/ts_xutil.c +++ b/tsx11/ts_xutil.c @@ -8,353 +8,352 @@ #include #include #include "x11drv.h" -#include "stddebug.h" #include "debug.h" XClassHint * TSXAllocClassHint(void) { XClassHint * r; - dprintf_x11(stddeb, "Call XAllocClassHint\n"); + dprintf_info(x11, "Call XAllocClassHint\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XAllocClassHint(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XAllocClassHint\n"); + dprintf_info(x11, "Ret XAllocClassHint\n"); return r; } XSizeHints * TSXAllocSizeHints(void) { XSizeHints * r; - dprintf_x11(stddeb, "Call XAllocSizeHints\n"); + dprintf_info(x11, "Call XAllocSizeHints\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XAllocSizeHints(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XAllocSizeHints\n"); + dprintf_info(x11, "Ret XAllocSizeHints\n"); return r; } XWMHints * TSXAllocWMHints(void) { XWMHints * r; - dprintf_x11(stddeb, "Call XAllocWMHints\n"); + dprintf_info(x11, "Call XAllocWMHints\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XAllocWMHints(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XAllocWMHints\n"); + dprintf_info(x11, "Ret XAllocWMHints\n"); return r; } int TSXClipBox(Region a0, XRectangle* a1) { int r; - dprintf_x11(stddeb, "Call XClipBox\n"); + dprintf_info(x11, "Call XClipBox\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XClipBox(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XClipBox\n"); + dprintf_info(x11, "Ret XClipBox\n"); return r; } Region TSXCreateRegion(void) { Region r; - dprintf_x11(stddeb, "Call XCreateRegion\n"); + dprintf_info(x11, "Call XCreateRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XCreateRegion(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XCreateRegion\n"); + dprintf_info(x11, "Ret XCreateRegion\n"); return r; } int TSXDeleteContext(Display* a0, XID a1, XContext a2) { int r; - dprintf_x11(stddeb, "Call XDeleteContext\n"); + dprintf_info(x11, "Call XDeleteContext\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDeleteContext(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDeleteContext\n"); + dprintf_info(x11, "Ret XDeleteContext\n"); return r; } int TSXDestroyRegion(Region a0) { int r; - dprintf_x11(stddeb, "Call XDestroyRegion\n"); + dprintf_info(x11, "Call XDestroyRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDestroyRegion(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDestroyRegion\n"); + dprintf_info(x11, "Ret XDestroyRegion\n"); return r; } int TSXEmptyRegion(Region a0) { int r; - dprintf_x11(stddeb, "Call XEmptyRegion\n"); + dprintf_info(x11, "Call XEmptyRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XEmptyRegion(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XEmptyRegion\n"); + dprintf_info(x11, "Ret XEmptyRegion\n"); return r; } int TSXEqualRegion(Region a0, Region a1) { int r; - dprintf_x11(stddeb, "Call XEqualRegion\n"); + dprintf_info(x11, "Call XEqualRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XEqualRegion(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XEqualRegion\n"); + dprintf_info(x11, "Ret XEqualRegion\n"); return r; } int TSXFindContext(Display* a0, XID a1, XContext a2, XPointer* a3) { int r; - dprintf_x11(stddeb, "Call XFindContext\n"); + dprintf_info(x11, "Call XFindContext\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XFindContext(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XFindContext\n"); + dprintf_info(x11, "Ret XFindContext\n"); return r; } XVisualInfo * TSXGetVisualInfo(Display* a0, long a1, XVisualInfo* a2, int* a3) { XVisualInfo * r; - dprintf_x11(stddeb, "Call XGetVisualInfo\n"); + dprintf_info(x11, "Call XGetVisualInfo\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetVisualInfo(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetVisualInfo\n"); + dprintf_info(x11, "Ret XGetVisualInfo\n"); return r; } int TSXGetWMSizeHints(Display* a0, Window a1, XSizeHints* a2, long* a3, Atom a4) { int r; - dprintf_x11(stddeb, "Call XGetWMSizeHints\n"); + dprintf_info(x11, "Call XGetWMSizeHints\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XGetWMSizeHints(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XGetWMSizeHints\n"); + dprintf_info(x11, "Ret XGetWMSizeHints\n"); return r; } int TSXIntersectRegion(Region a0, Region a1, Region a2) { int r; - dprintf_x11(stddeb, "Call XIntersectRegion\n"); + dprintf_info(x11, "Call XIntersectRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XIntersectRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XIntersectRegion\n"); + dprintf_info(x11, "Ret XIntersectRegion\n"); return r; } int TSXLookupString(XKeyEvent* a0, char* a1, int a2, KeySym* a3, XComposeStatus* a4) { int r; - dprintf_x11(stddeb, "Call XLookupString\n"); + dprintf_info(x11, "Call XLookupString\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XLookupString(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XLookupString\n"); + dprintf_info(x11, "Ret XLookupString\n"); return r; } int TSXOffsetRegion(Region a0, int a1, int a2) { int r; - dprintf_x11(stddeb, "Call XOffsetRegion\n"); + dprintf_info(x11, "Call XOffsetRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XOffsetRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XOffsetRegion\n"); + dprintf_info(x11, "Ret XOffsetRegion\n"); return r; } int TSXPointInRegion(Region a0, int a1, int a2) { int r; - dprintf_x11(stddeb, "Call XPointInRegion\n"); + dprintf_info(x11, "Call XPointInRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XPointInRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XPointInRegion\n"); + dprintf_info(x11, "Ret XPointInRegion\n"); return r; } Region TSXPolygonRegion(XPoint* a0, int a1, int a2) { Region r; - dprintf_x11(stddeb, "Call XPolygonRegion\n"); + dprintf_info(x11, "Call XPolygonRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XPolygonRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XPolygonRegion\n"); + dprintf_info(x11, "Ret XPolygonRegion\n"); return r; } int TSXRectInRegion(Region a0, int a1, int a2, unsigned int a3, unsigned int a4) { int r; - dprintf_x11(stddeb, "Call XRectInRegion\n"); + dprintf_info(x11, "Call XRectInRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XRectInRegion(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XRectInRegion\n"); + dprintf_info(x11, "Ret XRectInRegion\n"); return r; } int TSXSaveContext(Display* a0, XID a1, XContext a2, const char* a3) { int r; - dprintf_x11(stddeb, "Call XSaveContext\n"); + dprintf_info(x11, "Call XSaveContext\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSaveContext(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSaveContext\n"); + dprintf_info(x11, "Ret XSaveContext\n"); return r; } void TSXSetWMProperties(Display* a0, Window a1, XTextProperty* a2, XTextProperty* a3, char** a4, int a5, XSizeHints* a6, XWMHints* a7, XClassHint* a8) { - dprintf_x11(stddeb, "Call XSetWMProperties\n"); + dprintf_info(x11, "Call XSetWMProperties\n"); EnterCriticalSection( &X11DRV_CritSection ); XSetWMProperties(a0, a1, a2, a3, a4, a5, a6, a7, a8); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetWMProperties\n"); + dprintf_info(x11, "Ret XSetWMProperties\n"); } void TSXSetWMSizeHints(Display* a0, Window a1, XSizeHints* a2, Atom a3) { - dprintf_x11(stddeb, "Call XSetWMSizeHints\n"); + dprintf_info(x11, "Call XSetWMSizeHints\n"); EnterCriticalSection( &X11DRV_CritSection ); XSetWMSizeHints(a0, a1, a2, a3); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetWMSizeHints\n"); + dprintf_info(x11, "Ret XSetWMSizeHints\n"); } int TSXSetRegion(Display* a0, GC a1, Region a2) { int r; - dprintf_x11(stddeb, "Call XSetRegion\n"); + dprintf_info(x11, "Call XSetRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSetRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSetRegion\n"); + dprintf_info(x11, "Ret XSetRegion\n"); return r; } int TSXShrinkRegion(Region a0, int a1, int a2) { int r; - dprintf_x11(stddeb, "Call XShrinkRegion\n"); + dprintf_info(x11, "Call XShrinkRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XShrinkRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XShrinkRegion\n"); + dprintf_info(x11, "Ret XShrinkRegion\n"); return r; } int TSXStringListToTextProperty(char** a0, int a1, XTextProperty* a2) { int r; - dprintf_x11(stddeb, "Call XStringListToTextProperty\n"); + dprintf_info(x11, "Call XStringListToTextProperty\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XStringListToTextProperty(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XStringListToTextProperty\n"); + dprintf_info(x11, "Ret XStringListToTextProperty\n"); return r; } int TSXSubtractRegion(Region a0, Region a1, Region a2) { int r; - dprintf_x11(stddeb, "Call XSubtractRegion\n"); + dprintf_info(x11, "Call XSubtractRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSubtractRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSubtractRegion\n"); + dprintf_info(x11, "Ret XSubtractRegion\n"); return r; } int TSXUnionRectWithRegion(XRectangle* a0, Region a1, Region a2) { int r; - dprintf_x11(stddeb, "Call XUnionRectWithRegion\n"); + dprintf_info(x11, "Call XUnionRectWithRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUnionRectWithRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUnionRectWithRegion\n"); + dprintf_info(x11, "Ret XUnionRectWithRegion\n"); return r; } int TSXUnionRegion(Region a0, Region a1, Region a2) { int r; - dprintf_x11(stddeb, "Call XUnionRegion\n"); + dprintf_info(x11, "Call XUnionRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUnionRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUnionRegion\n"); + dprintf_info(x11, "Ret XUnionRegion\n"); return r; } int TSXXorRegion(Region a0, Region a1, Region a2) { int r; - dprintf_x11(stddeb, "Call XXorRegion\n"); + dprintf_info(x11, "Call XXorRegion\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XXorRegion(a0, a1, a2); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XXorRegion\n"); + dprintf_info(x11, "Ret XXorRegion\n"); return r; } int TSXDestroyImage(struct _XImage *a0) { int r; - dprintf_x11(stddeb, "Call XDestroyImage\n"); + dprintf_info(x11, "Call XDestroyImage\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XDestroyImage(a0); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XDestroyImage\n"); + dprintf_info(x11, "Ret XDestroyImage\n"); return r; } struct _XImage * TSXSubImage(struct _XImage *a0, int a1, int a2, unsigned int a3, unsigned int a4) { struct _XImage * r; - dprintf_x11(stddeb, "Call XSubImage\n"); + dprintf_info(x11, "Call XSubImage\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XSubImage(a0, a1, a2, a3, a4); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XSubImage\n"); + dprintf_info(x11, "Ret XSubImage\n"); return r; } int TSXAddPixel(struct _XImage *a0, long a1) { int r; - dprintf_x11(stddeb, "Call XAddPixel\n"); + dprintf_info(x11, "Call XAddPixel\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XAddPixel(a0, a1); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XAddPixel\n"); + dprintf_info(x11, "Ret XAddPixel\n"); return r; } XContext TSXUniqueContext(void) { XContext r; - dprintf_x11(stddeb, "Call XUniqueContext\n"); + dprintf_info(x11, "Call XUniqueContext\n"); EnterCriticalSection( &X11DRV_CritSection ); r = XUniqueContext(); LeaveCriticalSection( &X11DRV_CritSection ); - dprintf_x11(stddeb, "Ret XUniqueContext\n"); + dprintf_info(x11, "Ret XUniqueContext\n"); return r; } diff --git a/win32/advapi.c b/win32/advapi.c index 5404f41d8ce..50cae534306 100644 --- a/win32/advapi.c +++ b/win32/advapi.c @@ -11,7 +11,6 @@ #include "winerror.h" #include "shell.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** diff --git a/win32/code_page.c b/win32/code_page.c index 2771061aa92..bcd80ce1f87 100644 --- a/win32/code_page.c +++ b/win32/code_page.c @@ -10,7 +10,6 @@ #include "winerror.h" #include "winnls.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" @@ -85,9 +84,9 @@ BOOL32 WINAPI IsValidCodePage(UINT32 CodePage) /*********************************************************************** * MultiByteToWideChar (KERNEL32.392) */ -int WINAPI MultiByteToWideChar(UINT32 page, DWORD flags, - const char *src, int srclen, - WCHAR *dst, int dstlen) +INT32 WINAPI MultiByteToWideChar(UINT32 page, DWORD flags, + LPCSTR src, INT32 srclen, + LPWSTR dst, INT32 dstlen) { int ret; @@ -111,8 +110,9 @@ int WINAPI MultiByteToWideChar(UINT32 page, DWORD flags, return ret; } -int WINAPI WideCharToMultiByte(UINT32 page, DWORD flags, WCHAR *src, int srclen, - char *dst, int dstlen, char* defchar, BOOL32 *used) +INT32 WINAPI WideCharToMultiByte(UINT32 page, DWORD flags, LPCWSTR src, + INT32 srclen,LPSTR dst, INT32 dstlen, + LPCSTR defchar, BOOL32 *used) { int count = 0; int eos = 0; @@ -207,7 +207,7 @@ BOOL32 WINAPI IsDBCSLeadByte32( BYTE testchar ) */ BOOL32 WINAPI EnumSystemCodePages32A(CODEPAGE_ENUMPROC32A lpfnCodePageEnum,DWORD flags) { - dprintf_win32(stddeb,"EnumSystemCodePages32A(%p,%08lx)\n", + dprintf_info(win32,"EnumSystemCodePages32A(%p,%08lx)\n", lpfnCodePageEnum,flags ); lpfnCodePageEnum("437"); @@ -221,7 +221,7 @@ BOOL32 WINAPI EnumSystemCodePages32W( CODEPAGE_ENUMPROC32W lpfnCodePageEnum, DWORD flags) { WCHAR *cp; - dprintf_win32(stddeb,"EnumSystemCodePages32W(%p,%08lx)\n", + dprintf_info(win32,"EnumSystemCodePages32W(%p,%08lx)\n", lpfnCodePageEnum,flags ); cp = HEAP_strdupAtoW( GetProcessHeap(), 0, "437" ); diff --git a/win32/console.c b/win32/console.c index 2396f3443b8..d2f13b55f93 100644 --- a/win32/console.c +++ b/win32/console.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -25,7 +24,6 @@ #include "winerror.h" #include "wincon.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" static CONSOLE_SCREEN_BUFFER_INFO dummyinfo = @@ -39,23 +37,26 @@ static CONSOLE_SCREEN_BUFFER_INFO dummyinfo = /* The console -- I chose to keep the master and slave * (UNIX) file descriptors around in case they are needed for - * ioctls later. The pid is needed to detroy the xterm if needed. + * ioctls later. The pid is needed to destroy the xterm on close */ typedef struct _CONSOLE { K32OBJ header; int master; /* xterm side of pty */ int slave; /* wine side of pty */ int pid; /* xterm's pid, -1 if no xterm */ - int flags; /* CONSOLE_STARTED_FROM */ - K32OBJ *file_in; /* console input */ - K32OBJ *file_out; /* console output */ - K32OBJ *file_err; /* console error */ } CONSOLE; -#define CONSOLE_STARTED_FROM (0x1) /* FIXME: this is lame, it should have - something to do with sharing... */ static void CONSOLE_Destroy( K32OBJ *obj ); +static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer, + DWORD nNumberOfChars, LPDWORD lpNumberOfChars, + LPOVERLAPPED lpOverlapped); +static BOOL32 CONSOLE_Read(K32OBJ *ptr, LPVOID lpBuffer, + DWORD nNumberOfChars, LPDWORD lpNumberOfChars, + LPOVERLAPPED lpOverlapped); +static int wine_openpty(int *master, int *slave, char *name, + struct termios *term, struct winsize *winsize); +static BOOL32 wine_createConsole(int *master, int *slave, int *pid); const K32OBJ_OPS CONSOLE_Ops = { @@ -63,13 +64,12 @@ const K32OBJ_OPS CONSOLE_Ops = NULL, /* satisfied */ NULL, /* add_wait */ NULL, /* remove_wait */ + CONSOLE_Read, /* read */ + CONSOLE_Write, /* write */ CONSOLE_Destroy /* destroy */ }; -static int wine_openpty(int *master, int *slave, char *name, - struct termios *term, struct winsize *winsize); - static void CONSOLE_Destroy(K32OBJ *obj) @@ -84,10 +84,55 @@ static void CONSOLE_Destroy(K32OBJ *obj) kill(console->pid, SIGTERM); } HeapFree(SystemHeap, 0, console); - } +/* lpOverlapped is ignored */ +static BOOL32 CONSOLE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars, + LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped) +{ + CONSOLE *console = (CONSOLE *)ptr; + int result; + + dprintf_info(console, "CONSOLE_Read: %p %p %ld\n", ptr, lpBuffer, + nNumberOfChars); + + *lpNumberOfChars = 0; + + if ((result = read(console->slave, lpBuffer, nNumberOfChars)) == -1) { + FILE_SetDosError(); + return FALSE; + } + *lpNumberOfChars = result; + return TRUE; +} + +/* lpOverlapped is ignored */ +static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer, + DWORD nNumberOfChars, + LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped) +{ + CONSOLE *console = (CONSOLE *)ptr; + int result; + + dprintf_info(console, "CONSOLE_Write: %p %p %ld\n", ptr, lpBuffer, + nNumberOfChars); + + *lpNumberOfChars = 0; + + /* FIXME: there was a loop here before, why??? */ + + if ((result = write(console->slave, lpBuffer, nNumberOfChars)) == -1) { + FILE_SetDosError(); + return FALSE; + } + *lpNumberOfChars = result; + return TRUE; +} + + + + /*********************************************************************** * SetConsoleCtrlHandler (KERNEL32.459) */ @@ -164,9 +209,8 @@ BOOL32 WINAPI FreeConsole(VOID) return FALSE; } - if (console->file_in) K32OBJ_DecCount( console->file_in ); - if (console->file_out) K32OBJ_DecCount( console->file_out ); - if (console->file_err) K32OBJ_DecCount( console->file_err ); + PROCESS_CloseObjHandles(pdb, &console->header); + K32OBJ_DecCount( &console->header ); pdb->console = NULL; SYSTEM_UNLOCK(); @@ -264,6 +308,24 @@ static BOOL32 wine_createConsole(int *master, int *slave, int *pid) } +/*********************************************************************** + * CONSOLE_GetConsoleHandle + * returns a 16-bit style console handle + * note: only called from _lopen + */ +HFILE32 CONSOLE_GetConsoleHandle(VOID) +{ + PDB32 *pdb = PROCESS_Current(); + HFILE32 handle = HFILE_ERROR32; + + SYSTEM_LOCK(); + if (pdb->console != NULL) { + CONSOLE *console = (CONSOLE *)pdb->console; + handle = (HFILE32)HANDLE_Alloc(&console->header, 0, TRUE); + } + SYSTEM_UNLOCK(); + return handle; +} /*********************************************************************** * AllocConsole (KERNEL32.103) @@ -287,13 +349,8 @@ BOOL32 WINAPI AllocConsole(VOID) console = (CONSOLE *)pdb->console; - /* we only want to be able to open a console if the process doesn't have one - * now or we got the one we have from our parent - * - invalid handle comes from when the console was closed via FreeConsole() - * - CONSOLE_STARTED_FROM is when this process inherits its console from - * its parent - */ - if (console && (console->flags & CONSOLE_STARTED_FROM) == 0) { + /* don't create a console if we already have one */ + if (console != NULL) { SetLastError(ERROR_ACCESS_DENIED); SYSTEM_UNLOCK(); return FALSE; @@ -308,9 +365,6 @@ BOOL32 WINAPI AllocConsole(VOID) console->header.type = K32OBJ_CONSOLE; console->header.refcount = 1; console->pid = -1; - console->file_in = NULL; - console->file_out = NULL; - console->file_err = NULL; if (wine_createConsole(&master, &slave, &pid) == FALSE) { K32OBJ_DecCount(&console->header); @@ -322,26 +376,24 @@ BOOL32 WINAPI AllocConsole(VOID) console->master = master; console->slave = slave; console->pid = pid; - console->flags = 0; - if ((hIn = FILE_DupUnixHandle(slave)) == INVALID_HANDLE_VALUE32) + if ((hIn = HANDLE_Alloc(&console->header, 0, TRUE)) == INVALID_HANDLE_VALUE32) { K32OBJ_DecCount(&console->header); SYSTEM_UNLOCK(); return FALSE; } - FILE_SetFileType(hIn, FILE_TYPE_CHAR); - if ((hOut = FILE_DupUnixHandle(slave)) == INVALID_HANDLE_VALUE32) + if ((hOut = HANDLE_Alloc(&console->header, 0, TRUE)) == INVALID_HANDLE_VALUE32) { CloseHandle(hIn); K32OBJ_DecCount(&console->header); SYSTEM_UNLOCK(); return FALSE; } - FILE_SetFileType(hOut, FILE_TYPE_CHAR); - if ((hErr = FILE_DupUnixHandle(slave)) == INVALID_HANDLE_VALUE32) + + if ((hErr = HANDLE_Alloc(&console->header, 0, TRUE)) == INVALID_HANDLE_VALUE32) { CloseHandle(hIn); CloseHandle(hOut); @@ -349,11 +401,6 @@ BOOL32 WINAPI AllocConsole(VOID) SYSTEM_UNLOCK(); return FALSE; } - FILE_SetFileType(hErr, FILE_TYPE_CHAR); - - console->file_in = HANDLE_GetObjPtr( hIn, K32OBJ_FILE, 0 /*FIXME*/ ); - console->file_out = HANDLE_GetObjPtr( hIn, K32OBJ_FILE, 0 /*FIXME*/ ); - console->file_err = HANDLE_GetObjPtr( hIn, K32OBJ_FILE, 0 /*FIXME*/ ); /* associate this console with the process */ if (pdb->console) K32OBJ_DecCount( pdb->console ); @@ -436,18 +483,6 @@ BOOL32 WINAPI WriteConsole32A( HANDLE32 hConsoleOutput, /* FIXME: should I check if this is a console handle? */ return WriteFile(hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, NULL); - -#ifdef OLD - *lpNumberOfCharsWritten = fprintf(CONSOLE_console.conIO, "%.*s", - (int)nNumberOfCharsToWrite, - (LPSTR)lpBuffer ); - if (ferror(CONSOLE_console.conIO) { - clearerr(); - return FALSE; - } - - return TRUE; -#endif } /*********************************************************************** @@ -476,20 +511,6 @@ BOOL32 WINAPI WriteConsole32W( HANDLE32 hConsoleOutput, return WriteFile(hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, NULL); - -#ifdef OLD - LPSTR buf = HEAP_strdupWtoA( GetProcessHeap(), 0, lpBuffer ); - *lpNumberOfCharsWritten = fprintf(CONSOLE_console.conIO, "%.*s", - (int)nNumberOfCharsToWrite, buf ); - HeapFree( GetProcessHeap(), 0, buf ); - - if (ferror(CONSOLE_console.conIO) { - clearerr(); - return FALSE; - } - - return TRUE; -#endif } /*********************************************************************** diff --git a/win32/environment.c b/win32/environment.c index 0680d1ee8bd..70c253a017c 100644 --- a/win32/environment.c +++ b/win32/environment.c @@ -11,7 +11,6 @@ #include "winerror.h" #include "module.h" #include "task.h" -#include "stddebug.h" #include "debug.h" #include "process.h" /* for PROCESS_Current() */ diff --git a/win32/error.c b/win32/error.c index 62c55bfbcb6..39d28329a3c 100644 --- a/win32/error.c +++ b/win32/error.c @@ -8,7 +8,6 @@ #include #include "windows.h" #include "winerror.h" -#include "stddebug.h" #include "debug.h" /* The errno_xlat_table contains the errno-to-Win32 error diff --git a/win32/except.c b/win32/except.c index 0feae88fd50..08cc70d2760 100644 --- a/win32/except.c +++ b/win32/except.c @@ -38,7 +38,6 @@ #include "ldt.h" #include "process.h" #include "thread.h" -#include "stddebug.h" #include "debug.h" #include "except.h" @@ -82,7 +81,7 @@ void WINAPI RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip, (TEB_EXCEPTION_FRAME(pcontext) != ((void *)0xffffffff)) && (TEB_EXCEPTION_FRAME(pcontext) != pEndFrame)) { - dprintf_win32( stddeb, "calling exception handler at 0x%x\n", + dprintf_info(win32, "calling exception handler at 0x%x\n", (int)TEB_EXCEPTION_FRAME(pcontext)->Handler ); dispatch=0; @@ -90,7 +89,7 @@ void WINAPI RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip, TEB_EXCEPTION_FRAME(pcontext), pcontext, &dispatch); - dprintf_win32(stddeb,"exception handler returns 0x%x, dispatch=0x%x\n", + dprintf_info(win32,"exception handler returns 0x%x, dispatch=0x%x\n", retval, (int) dispatch); if ( (retval == ExceptionCollidedUnwind) && @@ -150,14 +149,14 @@ void WINAPI RaiseException(DWORD dwExceptionCode, while((pframe!=NULL)&&(pframe!=((void *)0xFFFFFFFF))) { - dprintf_win32(stddeb,"calling exception handler at 0x%x\n", + dprintf_info(win32,"calling exception handler at 0x%x\n", (int) pframe->Handler); dispatch=0; - dprintf_relay(stddeb,"CallTo32(except=%p,record=%p,frame=%p,context=%p,dispatch=%p)\n", + dprintf_info(relay,"CallTo32(except=%p,record=%p,frame=%p,context=%p,dispatch=%p)\n", pframe->Handler, &record, pframe, pcontext, &dispatch ); retval=pframe->Handler(&record,pframe,pcontext,&dispatch); - dprintf_win32(stddeb,"exception handler returns 0x%x, dispatch=0x%x\n", + dprintf_info(win32,"exception handler returns 0x%x, dispatch=0x%x\n", retval, (int) dispatch); if(retval==ExceptionContinueExecution) @@ -168,7 +167,7 @@ void WINAPI RaiseException(DWORD dwExceptionCode, if (retval!=ExceptionContinueExecution) { /* FIXME: what should we do here? */ - dprintf_win32(stddeb,"no handler wanted to handle the exception, exiting\n"); + dprintf_info(win32,"no handler wanted to handle the exception, exiting\n"); ExitProcess(dwExceptionCode); /* what status should be used here ? */ } } diff --git a/win32/file.c b/win32/file.c index f634dcebf1b..85ea01fd486 100644 --- a/win32/file.c +++ b/win32/file.c @@ -18,9 +18,8 @@ #include "winbase.h" #include "winerror.h" #include "file.h" +#include "process.h" #include "heap.h" -#include "stddebug.h" -#define DEBUG_WIN32 #include "debug.h" DWORD ErrnoToLastError(int errno_num); @@ -31,38 +30,44 @@ static int TranslateAccessFlags(DWORD access_flags); /*********************************************************************** * WriteFile (KERNEL32.578) */ -BOOL32 WINAPI WriteFile(HFILE32 hFile, LPVOID lpBuffer, DWORD numberOfBytesToWrite, +BOOL32 WINAPI WriteFile(HANDLE32 hFile, LPCVOID lpBuffer, + DWORD numberOfBytesToWrite, LPDWORD numberOfBytesWritten, LPOVERLAPPED lpOverlapped) { - LONG res; - - res = _lwrite32(hFile,lpBuffer,numberOfBytesToWrite); - if (res==-1) { - SetLastError(ErrnoToLastError(errno)); - return FALSE; - } - if(numberOfBytesWritten) - *numberOfBytesWritten = res; - return TRUE; + K32OBJ *ioptr; + BOOL32 status = FALSE; + + dprintf_info(file, "WriteFile: %d %p %ld\n", hFile, lpBuffer, + numberOfBytesToWrite); + + if (!(ioptr = HANDLE_GetObjPtr( hFile, K32OBJ_UNKNOWN, 0 ))) + return HFILE_ERROR32; + if (K32OBJ_OPS(ioptr)->write) + status = K32OBJ_OPS(ioptr)->write(ioptr, lpBuffer, numberOfBytesToWrite, + numberOfBytesWritten, lpOverlapped); + K32OBJ_DecCount( ioptr ); + return status; } /*********************************************************************** * ReadFile (KERNEL32.428) */ -BOOL32 WINAPI ReadFile(HFILE32 hFile, LPVOID lpBuffer, DWORD numtoread, - LPDWORD numread, LPOVERLAPPED lpOverlapped) +BOOL32 WINAPI ReadFile(HANDLE32 hFile, LPVOID lpBuffer, DWORD numberOfBytesToRead, + LPDWORD numberOfBytesRead, LPOVERLAPPED lpOverlapped) { - int actual_read; - - actual_read = _lread32(hFile,lpBuffer,numtoread); - if(actual_read == -1) { - SetLastError(ErrnoToLastError(errno)); - return FALSE; - } - if(numread) - *numread = actual_read; - - return TRUE; + K32OBJ *ioptr; + BOOL32 status = FALSE; + + dprintf_info(file, "ReadFile: %d %p %ld\n", hFile, lpBuffer, + numberOfBytesToRead); + + if (!(ioptr = HANDLE_GetObjPtr( hFile, K32OBJ_UNKNOWN, 0 ))) + return HFILE_ERROR32; + if (K32OBJ_OPS(ioptr)->read) + status = K32OBJ_OPS(ioptr)->read(ioptr, lpBuffer, numberOfBytesToRead, + numberOfBytesRead, lpOverlapped); + K32OBJ_DecCount( ioptr ); + return status; } @@ -107,7 +112,7 @@ HFILE32 WINAPI CreateFile32A(LPCSTR filename, DWORD access, DWORD sharing, create_flags = TranslateCreationFlags(creation); if(template) - dprintf_file(stddeb, "CreateFile: template handles not supported.\n"); + dprintf_fixme(file, "CreateFile: template handles not supported.\n"); /* If the name starts with '\\?' or '\\.', ignore the first 3 chars. */ @@ -118,7 +123,7 @@ HFILE32 WINAPI CreateFile32A(LPCSTR filename, DWORD access, DWORD sharing, */ if(!strncmp(filename, "\\\\", 2)) { - dprintf_file(stddeb, "CreateFile: UNC names not supported.\n"); + dprintf_fixme(file, "CreateFile: UNC names not supported.\n"); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return HFILE_ERROR32; } @@ -220,7 +225,7 @@ BOOL32 WINAPI SetFileAttributes32A(LPCSTR lpFileName, DWORD attributes) if (!DOSFS_GetFullName( lpFileName, TRUE, &full_name )) return FALSE; - dprintf_file(stddeb,"SetFileAttributes(%s,%lx)\n",lpFileName,attributes); + dprintf_info(file,"SetFileAttributes(%s,%lx)\n",lpFileName,attributes); if (attributes & FILE_ATTRIBUTE_NORMAL) { attributes &= ~FILE_ATTRIBUTE_NORMAL; if (attributes) diff --git a/win32/init.c b/win32/init.c index 50a44cd07a1..1472cc029fc 100644 --- a/win32/init.c +++ b/win32/init.c @@ -13,7 +13,6 @@ #include "except.h" #include "heap.h" #include "task.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** @@ -83,6 +82,7 @@ BOOL32 WINAPI GetUserName32A(LPSTR lpszName, LPDWORD lpSize) char *name; name=getlogin(); + if (!name) name=cuserid(NULL); len = name ? strlen(name) : 0; if (!len || !lpSize || len > *lpSize) { if (lpszName) *lpszName = 0; diff --git a/win32/kernel32.c b/win32/kernel32.c index a22c7754375..b1dd9426dbe 100644 --- a/win32/kernel32.c +++ b/win32/kernel32.c @@ -1,7 +1,7 @@ /* * KERNEL32 thunks and other undocumented stuff * - * Copyright 1997 Marcus Meissner + * Copyright 1997-1998 Marcus Meissner */ #include @@ -14,10 +14,10 @@ #include "module.h" #include "process.h" #include "stackframe.h" +#include "heap.h" #include "selectors.h" #include "task.h" #include "win.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** @@ -103,16 +103,16 @@ UINT32 WINAPI ThunkConnect32( struct thunkstruct *ths, LPSTR thunkfun16, SEGPTR thkbuf; struct thunkstruct *ths16; - dprintf_thunk(stddeb,"ThunkConnect32(,%s,%s,%s,%x,%lx)\n", + dprintf_info(thunk,"ThunkConnect32(,%s,%s,%s,%x,%lx)\n", thunkfun16,module32,module16,hmod32,dllinitarg1 ); - dprintf_thunk(stddeb," magic = %c%c%c%c\n", + dprintf_info(thunk," magic = %c%c%c%c\n", ths->magic[0], ths->magic[1], ths->magic[2], ths->magic[3] ); - dprintf_thunk(stddeb," length = %lx\n",ths->length); + dprintf_info(thunk," length = %lx\n",ths->length); if (lstrncmp32A(ths->magic,"SL01",4)&&lstrncmp32A(ths->magic,"LS01",4)) return 0; hmm=LoadModule16(module16,NULL); @@ -130,7 +130,7 @@ UINT32 WINAPI ThunkConnect32( struct thunkstruct *ths, LPSTR thunkfun16, return 0; ths->x0C = (DWORD)ths16; - dprintf_thunk(stddeb," ths16 magic is 0x%08lx\n",*(DWORD*)ths16->magic); + dprintf_info(thunk," ths16 magic is 0x%08lx\n",*(DWORD*)ths16->magic); if (*((DWORD*)ths16->magic) != 0x0000304C) return 0; if (!*(WORD*)(((LPBYTE)ths16)+0x12)) @@ -187,9 +187,9 @@ VOID WINAPI QT_Thunk(CONTEXT *context) DWORD WINAPI WOWCallback16(FARPROC16 fproc,DWORD arg) { DWORD ret; - dprintf_thunk(stddeb,"WOWCallback16(%p,0x%08lx) ",fproc,arg); + dprintf_info(thunk,"WOWCallback16(%p,0x%08lx)...\n",fproc,arg); ret = Callbacks->CallWOWCallbackProc(fproc,arg); - dprintf_thunk(stddeb,"... returns %ld\n",ret); + dprintf_info(thunk,"... returns %ld\n",ret); return ret; } @@ -212,7 +212,7 @@ LPVOID WINAPI _KERNEL32_52() { HMODULE32 hmod = LoadLibrary16("systhunk.dll"); - dprintf_thunk(stddeb, "_KERNEL32_52: systhunk.dll module %d\n", hmod); + dprintf_info(thunk, "_KERNEL32_52: systhunk.dll module %d\n", hmod); if (hmod<=32) return 0; @@ -256,7 +256,7 @@ DWORD WINAPI _KERNEL32_43(LPDWORD thunk,LPCSTR thkbuf,DWORD len, return 0; *(DWORD*)thunk = addr[1]; - dprintf_thunk(stddeb, "_KERNEL32_43: loaded module %d, func %s (%d) @ %p (%p), returning %p\n", + dprintf_info(thunk, "_KERNEL32_43: loaded module %d, func %s (%d) @ %p (%p), returning %p\n", hmod, HIWORD(thkbuf)==0 ? "" : thkbuf, (int)thkbuf, (void*)segaddr, addr, (void*)addr[1]); return addr[1]; @@ -277,11 +277,11 @@ VOID WINAPI _KERNEL32_45(CONTEXT *context) DWORD ret,stacksize; THDB *thdb = THREAD_Current(); - dprintf_thunk(stddeb,"KERNEL32_45(%%eax=0x%08lx(%%cx=0x%04lx,%%edx=0x%08lx))\n", + dprintf_info(thunk,"KERNEL32_45(%%eax=0x%08lx(%%cx=0x%04lx,%%edx=0x%08lx))\n", (DWORD)EAX_reg(context),(DWORD)CX_reg(context),(DWORD)EDX_reg(context) ); stacksize = EBP_reg(context)-ESP_reg(context); - dprintf_thunk(stddeb," stacksize = %ld\n",stacksize); + dprintf_info(thunk," stacksize = %ld\n",stacksize); memcpy(&context16,context,sizeof(context16)); @@ -294,7 +294,7 @@ VOID WINAPI _KERNEL32_45(CONTEXT *context) ret = Callbacks->CallRegisterLongProc(&context16,0); STACK16_POP( thdb, stacksize ); - dprintf_thunk(stddeb,". returned %08lx\n",ret); + dprintf_info(thunk,". returned %08lx\n",ret); EAX_reg(context) = ret; } @@ -312,12 +312,12 @@ VOID WINAPI _KERNEL32_40(CONTEXT *context) DWORD ret,stacksize; THDB *thdb = THREAD_Current(); - dprintf_thunk(stddeb,"_KERNEL32_40(EDX=0x%08lx)\n", + dprintf_info(thunk,"_KERNEL32_40(EDX=0x%08lx)\n", EDX_reg(context) ); stacksize = EBP_reg(context)-ESP_reg(context); - dprintf_thunk(stddeb," stacksize = %ld\n",stacksize); - dprintf_thunk(stddeb,"on top of stack: 0x%04x\n",*(WORD*)ESP_reg(context)); + dprintf_info(thunk," stacksize = %ld\n",stacksize); + dprintf_info(thunk,"on top of stack: 0x%04x\n",*(WORD*)ESP_reg(context)); memcpy(&context16,context,sizeof(context16)); @@ -329,7 +329,7 @@ VOID WINAPI _KERNEL32_40(CONTEXT *context) ret = Callbacks->CallRegisterShortProc(&context16,0); STACK16_POP( thdb, stacksize ); - dprintf_thunk(stddeb,". returned %08lx\n",ret); + dprintf_info(thunk,". returned %08lx\n",ret); EAX_reg(context) = ret; } @@ -404,7 +404,7 @@ LPVOID WINAPI _KERNEL32_41(LPBYTE thunk,LPCSTR thkbuf,DWORD len,LPCSTR dll16, if (HIWORD(addr2)) *(DWORD*)thunk = (DWORD)addr2; - dprintf_thunk(stddeb, "_KERNEL32_41: loaded module %d, func %s(%d) @ %p (%p), returning %p\n", + dprintf_info(thunk, "_KERNEL32_41: loaded module %d, func %s(%d) @ %p (%p), returning %p\n", hmod, HIWORD(thkbuf)==0 ? "" : thkbuf, (int)thkbuf, (void*)segaddr, addr, addr2); return addr2; @@ -419,7 +419,7 @@ LPVOID WINAPI _KERNEL32_41(LPBYTE thunk,LPCSTR thkbuf,DWORD len,LPCSTR dll16, */ VOID WINAPI _KERNEL32_90(CONTEXT *context) { - dprintf_thunk(stddeb, "_KERNEL32_90: QT Thunk priming; context %p\n", context); + dprintf_info(thunk, "_KERNEL32_90: QT Thunk priming; context %p\n", context); _write_qtthunk((LPBYTE)EAX_reg(context),*(DWORD*)(EAX_reg(context)+EDX_reg(context))); /* we just call the real QT_Thunk right now @@ -461,7 +461,7 @@ VOID WINAPI _KERNEL32_46(LPBYTE thunk,LPSTR thkbuf,DWORD len,LPSTR dll16, } *(DWORD*)PTR_SEG_TO_LIN(addr[1]) = (DWORD)thunk; - dprintf_thunk(stddeb, "_KERNEL32_46: loaded module %d, func %s(%d) @ %p (%p)\n", + dprintf_info(thunk, "_KERNEL32_46: loaded module %d, func %s(%d) @ %p (%p)\n", hmod, HIWORD(thkbuf)==0 ? "" : thkbuf, (int)thkbuf, (void*)segaddr, addr); } @@ -473,7 +473,7 @@ VOID WINAPI _KERNEL32_46(LPBYTE thunk,LPSTR thkbuf,DWORD len,LPSTR dll16, */ BOOL32 WINAPI _KERNEL32_87() { - dprintf_thunk(stddeb, "_KERNEL32_87: Yes, thunking is initialized\n"); + dprintf_info(thunk, "_KERNEL32_87: Yes, thunking is initialized\n"); return TRUE; } @@ -490,9 +490,13 @@ DWORD WINAPIV _KERNEL32_88( DWORD nr, DWORD flags, FARPROC32 fun, ... ) DWORD i,ret; DWORD *args = ((DWORD *)&fun) + 1; - dprintf_thunk(stddeb,"KERNEL32_88(%ld,0x%08lx,%p,[ ",nr,flags,fun); - for (i=0;i #include "windows.h" #include "winerror.h" -#include "stddebug.h" #include "debug.h" /*********************************************************************** diff --git a/win32/user32.c b/win32/user32.c index daeb8c9fa02..86ee37fb473 100644 --- a/win32/user32.c +++ b/win32/user32.c @@ -16,7 +16,6 @@ #include "struct32.h" #include "win.h" #include "debug.h" -#include "stddebug.h" /*********************************************************************** * GetMessage32A (USER32.269) diff --git a/windows/caret.c b/windows/caret.c index 315ce72bbaa..50e326b356b 100644 --- a/windows/caret.c +++ b/windows/caret.c @@ -7,8 +7,6 @@ #include "windows.h" #include "module.h" -#include "stddebug.h" -/* #define DEBUG_CARET */ #include "debug.h" typedef struct @@ -79,7 +77,7 @@ static void CARET_DisplayCaret( DISPLAY_CARET status ) */ static VOID CARET_Callback( HWND32 hwnd, UINT32 msg, UINT32 id, DWORD ctime) { - dprintf_caret(stddeb,"CARET_Callback: hwnd=%04x, timerid=%d, caret=%d\n", + dprintf_info(caret,"CARET_Callback: hwnd=%04x, timerid=%d, caret=%d\n", hwnd, id, Caret.on); CARET_DisplayCaret(CARET_TOGGLE); } @@ -138,7 +136,7 @@ void WINAPI CreateCaret16( HWND16 hwnd, HBITMAP16 bitmap, BOOL32 WINAPI CreateCaret32( HWND32 hwnd, HBITMAP32 bitmap, INT32 width, INT32 height ) { - dprintf_caret(stddeb,"CreateCaret: hwnd=%04x\n", hwnd); + dprintf_info(caret,"CreateCaret: hwnd=%04x\n", hwnd); if (!hwnd) return FALSE; @@ -190,7 +188,7 @@ BOOL32 WINAPI DestroyCaret32(void) { if (!Caret.hwnd) return FALSE; - dprintf_caret(stddeb,"DestroyCaret: hwnd=%04x, timerid=%d\n", + dprintf_info(caret,"DestroyCaret: hwnd=%04x, timerid=%d\n", Caret.hwnd, Caret.timerid); CARET_KillTimer(); @@ -218,7 +216,7 @@ BOOL32 WINAPI SetCaretPos32( INT32 x, INT32 y) if (!Caret.hwnd) return FALSE; if ((x == Caret.x) && (y == Caret.y)) return TRUE; - dprintf_caret(stddeb,"SetCaretPos: x=%d, y=%d\n", x, y); + dprintf_info(caret,"SetCaretPos: x=%d, y=%d\n", x, y); CARET_KillTimer(); CARET_DisplayCaret(CARET_OFF); @@ -250,7 +248,7 @@ BOOL32 WINAPI HideCaret32( HWND32 hwnd ) if (!Caret.hwnd) return FALSE; if (hwnd && (Caret.hwnd != hwnd)) return FALSE; - dprintf_caret(stddeb,"HideCaret: hwnd=%04x, hidden=%d\n", + dprintf_info(caret,"HideCaret: hwnd=%04x, hidden=%d\n", hwnd, Caret.hidden); CARET_KillTimer(); @@ -277,7 +275,7 @@ BOOL32 WINAPI ShowCaret32( HWND32 hwnd ) if (!Caret.hwnd) return FALSE; if (hwnd && (Caret.hwnd != hwnd)) return FALSE; - dprintf_caret(stddeb,"ShowCaret: hwnd=%04x, hidden=%d\n", + dprintf_info(caret,"ShowCaret: hwnd=%04x, hidden=%d\n", hwnd, Caret.hidden); if (Caret.hidden) @@ -308,7 +306,7 @@ BOOL32 WINAPI SetCaretBlinkTime32( UINT32 msecs ) { if (!Caret.hwnd) return FALSE; - dprintf_caret(stddeb,"SetCaretBlinkTime: hwnd=%04x, msecs=%d\n", + dprintf_info(caret,"SetCaretBlinkTime: hwnd=%04x, msecs=%d\n", Caret.hwnd, msecs); Caret.timeout = msecs; @@ -342,7 +340,7 @@ VOID WINAPI GetCaretPos16( LPPOINT16 pt ) { if (!Caret.hwnd || !pt) return; - dprintf_caret(stddeb,"GetCaretPos: hwnd=%04x, pt=%p, x=%d, y=%d\n", + dprintf_info(caret,"GetCaretPos: hwnd=%04x, pt=%p, x=%d, y=%d\n", Caret.hwnd, pt, Caret.x, Caret.y); pt->x = (INT16)Caret.x; pt->y = (INT16)Caret.y; diff --git a/windows/class.c b/windows/class.c index ca349f0c7fa..f9355c83041 100644 --- a/windows/class.c +++ b/windows/class.c @@ -19,7 +19,6 @@ #include "ldt.h" #include "toolhelp.h" #include "winproc.h" -#include "stddebug.h" #include "debug.h" @@ -318,7 +317,7 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc ) return 0; } - dprintf_class( stddeb, "RegisterClass16: atom=%04x wndproc=%08lx hinst=%04x + dprintf_info(class, "RegisterClass16: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n", atom, (DWORD)wc->lpfnWndProc, hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, @@ -355,7 +354,7 @@ ATOM WINAPI RegisterClass32A( const WNDCLASS32A* wc ) return 0; } - dprintf_class( stddeb, "RegisterClass32A: atom=%04x wndproc=%08lx + dprintf_info(class, "RegisterClass32A: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p name='%s'\n", atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, @@ -389,7 +388,7 @@ ATOM WINAPI RegisterClass32W( const WNDCLASS32W* wc ) return 0; } - dprintf_class( stddeb, "RegisterClass32W: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", + dprintf_info(class, "RegisterClass32W: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); @@ -421,7 +420,7 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc ) return 0; } - dprintf_class( stddeb, "RegisterClassEx16: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", + dprintf_info(class, "RegisterClassEx16: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", atom, (DWORD)wc->lpfnWndProc, hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); @@ -455,7 +454,7 @@ ATOM WINAPI RegisterClassEx32A( const WNDCLASSEX32A* wc ) return 0; } - dprintf_class( stddeb, "RegisterClassEx32A: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", + dprintf_info(class, "RegisterClassEx32A: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); @@ -487,7 +486,7 @@ ATOM WINAPI RegisterClassEx32W( const WNDCLASSEX32W* wc ) return 0; } - dprintf_class( stddeb, "RegisterClassEx32W: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", + dprintf_info(class, "RegisterClassEx32W: atom=%04x wndproc=%08lx hinst=%04x bg=%04x style=%08x clsExt=%d winExt=%d class=%p\n", atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); diff --git a/windows/clipboard.c b/windows/clipboard.c index ca9783731ad..393bed54fc9 100644 --- a/windows/clipboard.c +++ b/windows/clipboard.c @@ -21,7 +21,6 @@ #include "message.h" #include "clipboard.h" #include "xmalloc.h" -#include "stddebug.h" #include "debug.h" #define CF_REGFORMATBASE 0xC000 @@ -93,7 +92,7 @@ static LPCLIPFORMAT __lookup_format( LPCLIPFORMAT lpFormat, WORD wID ) */ static void CLIPBOARD_CheckSelection(WND* pWnd) { - dprintf_clipboard(stddeb,"\tchecking %08x\n", (unsigned)pWnd->window); + dprintf_info(clipboard,"\tchecking %08x\n", (unsigned)pWnd->window); if( selectionAcquired && selectionWindow != None && pWnd->window == selectionWindow ) @@ -107,7 +106,7 @@ static void CLIPBOARD_CheckSelection(WND* pWnd) if( pWnd->parent->child != pWnd ) selectionWindow = pWnd->parent->child->window; - dprintf_clipboard(stddeb,"\tswitching selection from %08x to %08x\n", + dprintf_info(clipboard,"\tswitching selection from %08x to %08x\n", (unsigned)selectionPrevWindow, (unsigned)selectionWindow); if( selectionWindow != None ) @@ -147,7 +146,7 @@ void CLIPBOARD_ResetOwner(WND* pWnd) { LPCLIPFORMAT lpFormat = ClipFormats; - dprintf_clipboard(stddeb,"DisOwn: clipboard owner = %04x, selection = %08x\n", + dprintf_info(clipboard,"DisOwn: clipboard owner = %04x, selection = %08x\n", hWndClipOwner, (unsigned)selectionWindow); if( pWnd->hwndSelf == hWndClipOwner) @@ -160,7 +159,7 @@ void CLIPBOARD_ResetOwner(WND* pWnd) { if( lpFormat->wDataPresent && !lpFormat->hData ) { - dprintf_clipboard( stddeb,"\tdata missing for clipboard format %i\n", + dprintf_info(clipboard,"\tdata missing for clipboard format %i\n", lpFormat->wFormatID); lpFormat->wDataPresent = 0; } @@ -205,7 +204,7 @@ static BOOL32 CLIPBOARD_RequestXSelection() if( !hWnd ) return FALSE; - dprintf_clipboard(stddeb,"Requesting selection...\n"); + dprintf_info(clipboard,"Requesting selection...\n"); /* request data type XA_STRING, later * CLIPBOARD_ReadSelection() will be invoked @@ -225,7 +224,7 @@ static BOOL32 CLIPBOARD_RequestXSelection() while(selectionWait) EVENT_WaitNetEvent( TRUE, FALSE ); /* we treat Unix text as CF_OEMTEXT */ - dprintf_clipboard(stddeb,"\tgot CF_OEMTEXT = %i\n", + dprintf_info(clipboard,"\tgot CF_OEMTEXT = %i\n", ClipFormats[CF_OEMTEXT-1].wDataPresent); return (BOOL32)ClipFormats[CF_OEMTEXT-1].wDataPresent; @@ -267,7 +266,7 @@ BOOL32 WINAPI OpenClipboard32( HWND32 hWnd ) { BOOL32 bRet; - dprintf_clipboard(stddeb,"OpenClipboard(%04x) = ", hWnd); + dprintf_info(clipboard,"OpenClipboard(%04x)...\n", hWnd); if (!hqClipLock) { @@ -278,7 +277,7 @@ BOOL32 WINAPI OpenClipboard32( HWND32 hWnd ) } else bRet = FALSE; - dprintf_clipboard(stddeb,"%i\n", bRet); + dprintf_info(clipboard," returning %i\n", bRet); return bRet; } @@ -297,7 +296,7 @@ BOOL16 WINAPI CloseClipboard16(void) */ BOOL32 WINAPI CloseClipboard32(void) { - dprintf_clipboard(stddeb,"CloseClipboard(); !\n"); + dprintf_info(clipboard,"CloseClipboard(); !\n"); if (hqClipLock == GetTaskQueue(0)) { @@ -327,7 +326,7 @@ BOOL32 WINAPI EmptyClipboard32(void) { LPCLIPFORMAT lpFormat = ClipFormats; - dprintf_clipboard(stddeb,"EmptyClipboard()\n"); + dprintf_info(clipboard,"EmptyClipboard()\n"); if (hqClipLock != GetTaskQueue(0)) return FALSE; @@ -352,7 +351,7 @@ BOOL32 WINAPI EmptyClipboard32(void) selectionPrevWindow = selectionWindow; selectionWindow = None; - dprintf_clipboard(stddeb, "\tgiving up selection (spw = %08x)\n", + dprintf_info(clipboard, "\tgiving up selection (spw = %08x)\n", (unsigned)selectionPrevWindow); TSXSetSelectionOwner(display, XA_PRIMARY, None, CurrentTime); @@ -387,7 +386,7 @@ HANDLE16 WINAPI SetClipboardData16( UINT16 wFormat, HANDLE16 hData ) LPCLIPFORMAT lpFormat = __lookup_format( ClipFormats, wFormat ); Window owner; - dprintf_clipboard(stddeb, + dprintf_info(clipboard, "SetClipboardData(%04X, %04x) !\n", wFormat, hData); /* NOTE: If the hData is zero and current owner doesn't match @@ -412,7 +411,7 @@ HANDLE16 WINAPI SetClipboardData16( UINT16 wFormat, HANDLE16 hData ) selectionAcquired = True; selectionWindow = owner; - dprintf_clipboard(stddeb,"Grabbed X selection, owner=(%08x)\n", + dprintf_info(clipboard,"Grabbed X selection, owner=(%08x)\n", (unsigned) owner); } } @@ -460,7 +459,7 @@ static BOOL32 CLIPBOARD_RenderFormat(LPCLIPFORMAT lpFormat) (WPARAM16)lpFormat->wFormatID,0L); else { - dprintf_clipboard(stddeb,"\thWndClipOwner (%04x) is lost!\n", + dprintf_warn(clipboard, "\thWndClipOwner (%04x) is lost!\n", hWndClipOwner); hWndClipOwner = 0; lpFormat->wDataPresent = 0; return FALSE; @@ -480,7 +479,7 @@ static BOOL32 CLIPBOARD_RenderText(LPCLIPFORMAT lpTarget, LPCLIPFORMAT lpSource) LPSTR lpstrT; if( !lpstrS ) return FALSE; - dprintf_clipboard(stddeb,"\tconverting from '%s' to '%s', %i chars\n", + dprintf_info(clipboard,"\tconverting from '%s' to '%s', %i chars\n", lpSource->Name, lpTarget->Name, size); lpTarget->hData = GlobalAlloc16(GMEM_ZEROINIT, size); @@ -492,7 +491,7 @@ static BOOL32 CLIPBOARD_RenderText(LPCLIPFORMAT lpTarget, LPCLIPFORMAT lpSource) CharToOemBuff32A(lpstrS, lpstrT, size); else OemToCharBuff32A(lpstrS, lpstrT, size); - dprintf_clipboard(stddeb,"\tgot %s\n", lpstrT); + dprintf_info(clipboard,"\tgot %s\n", lpstrT); return TRUE; } @@ -510,7 +509,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) if (hqClipLock != GetTaskQueue(0)) return 0; - dprintf_clipboard(stddeb,"GetClipboardData(%04X)\n", wFormat); + dprintf_info(clipboard,"GetClipboardData(%04X)\n", wFormat); if( wFormat == CF_TEXT && !lpRender[CF_TEXT-1].wDataPresent && lpRender[CF_OEMTEXT-1].wDataPresent ) @@ -518,7 +517,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) lpRender = &ClipFormats[CF_OEMTEXT-1]; lpUpdate = &ClipFormats[CF_TEXT-1]; - dprintf_clipboard(stddeb,"\tOEMTEXT -> TEXT\n"); + dprintf_info(clipboard,"\tOEMTEXT -> TEXT\n"); } else if( wFormat == CF_OEMTEXT && !lpRender[CF_OEMTEXT-1].wDataPresent && lpRender[CF_TEXT-1].wDataPresent ) @@ -526,7 +525,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) lpRender = &ClipFormats[CF_TEXT-1]; lpUpdate = &ClipFormats[CF_OEMTEXT-1]; - dprintf_clipboard(stddeb,"\tTEXT -> OEMTEXT\n"); + dprintf_info(clipboard,"\tTEXT -> OEMTEXT\n"); } else { @@ -538,7 +537,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) if( lpUpdate != lpRender && !lpUpdate->hData ) CLIPBOARD_RenderText(lpUpdate, lpRender); - dprintf_clipboard(stddeb,"\treturning %04x (type %i)\n", + dprintf_info(clipboard,"\treturning %04x (type %i)\n", lpUpdate->hData, lpUpdate->wFormatID); return lpUpdate->hData; } @@ -570,7 +569,7 @@ INT32 WINAPI CountClipboardFormats32(void) INT32 FormatCount = 0; LPCLIPFORMAT lpFormat = ClipFormats; - dprintf_clipboard(stddeb,"CountClipboardFormats()\n"); + dprintf_info(clipboard,"CountClipboardFormats()\n"); if( !selectionAcquired ) CLIPBOARD_RequestXSelection(); @@ -582,13 +581,13 @@ INT32 WINAPI CountClipboardFormats32(void) if (lpFormat == NULL) break; if (lpFormat->wDataPresent) { - dprintf_clipboard(stddeb, "\tdata found for format %i\n", lpFormat->wFormatID); + dprintf_info(clipboard, "\tdata found for format %i\n", lpFormat->wFormatID); FormatCount++; } lpFormat = lpFormat->NextFormat; } - dprintf_clipboard(stddeb,"\ttotal %d\n", FormatCount); + dprintf_info(clipboard,"\ttotal %d\n", FormatCount); return FormatCount; } @@ -609,7 +608,7 @@ UINT32 WINAPI EnumClipboardFormats32( UINT32 wFormat ) { LPCLIPFORMAT lpFormat = ClipFormats; - dprintf_clipboard(stddeb,"EnumClipboardFormats(%04X)\n", wFormat); + dprintf_info(clipboard,"EnumClipboardFormats(%04X)\n", wFormat); if( hqClipLock != GetTaskQueue(0) ) return 0; @@ -652,7 +651,7 @@ UINT16 WINAPI RegisterClipboardFormat16( LPCSTR FormatName ) if (FormatName == NULL) return 0; - dprintf_clipboard(stddeb,"RegisterClipboardFormat('%s') !\n", FormatName); + dprintf_info(clipboard,"RegisterClipboardFormat('%s') !\n", FormatName); /* walk format chain to see if it's already registered */ @@ -725,13 +724,13 @@ INT32 WINAPI GetClipboardFormatName32A( UINT32 wFormat, LPSTR retStr, INT32 maxl { LPCLIPFORMAT lpFormat = __lookup_format( ClipFormats, wFormat ); - dprintf_clipboard(stddeb, + dprintf_info(clipboard, "GetClipboardFormatName(%04X, %p, %d) !\n", wFormat, retStr, maxlen); if (lpFormat == NULL || lpFormat->Name == NULL || lpFormat->wFormatID < CF_REGFORMATBASE) return 0; - dprintf_clipboard(stddeb, + dprintf_info(clipboard, "GetClipboardFormat // Name='%s' !\n", lpFormat->Name); lstrcpyn32A( retStr, lpFormat->Name, maxlen ); @@ -768,7 +767,7 @@ HWND32 WINAPI SetClipboardViewer32( HWND32 hWnd ) { HWND32 hwndPrev = hWndViewer; - dprintf_clipboard(stddeb,"SetClipboardViewer(%04x): returning %04x\n", hWnd, hwndPrev); + dprintf_info(clipboard,"SetClipboardViewer(%04x): returning %04x\n", hWnd, hwndPrev); hWndViewer = hWnd; return hwndPrev; @@ -808,13 +807,14 @@ BOOL32 WINAPI ChangeClipboardChain32(HWND32 hWnd, HWND32 hWndNext) { BOOL32 bRet = 0; - dprintf_clipboard(stdnimp, "ChangeClipboardChain(%04x, %04x)\n", hWnd, hWndNext); + dprintf_fixme(clipboard, "ChangeClipboardChain(%04x, %04x) - stub?\n", + hWnd, hWndNext); if( hWndViewer ) bRet = !SendMessage16( hWndViewer, WM_CHANGECBCHAIN, (WPARAM16)hWnd, (LPARAM)hWndNext); else - dprintf_clipboard(stddeb,"ChangeClipboardChain: hWndViewer is lost\n"); + dprintf_warn(clipboard, "ChangeClipboardChain: hWndViewer is lost\n"); if( hWnd == hWndViewer ) hWndViewer = hWndNext; @@ -837,7 +837,7 @@ BOOL16 WINAPI IsClipboardFormatAvailable16( UINT16 wFormat ) */ BOOL32 WINAPI IsClipboardFormatAvailable32( UINT32 wFormat ) { - dprintf_clipboard(stddeb,"IsClipboardFormatAvailable(%04X) !\n", wFormat); + dprintf_info(clipboard,"IsClipboardFormatAvailable(%04X) !\n", wFormat); if( (wFormat == CF_TEXT || wFormat == CF_OEMTEXT) && !selectionAcquired ) CLIPBOARD_RequestXSelection(); @@ -907,7 +907,7 @@ void CLIPBOARD_ReadSelection(Window w,Atom prop) HANDLE16 hText = 0; LPCLIPFORMAT lpFormat = ClipFormats; - dprintf_clipboard(stddeb,"ReadSelection callback\n"); + dprintf_info(clipboard,"ReadSelection callback\n"); if(prop != None) { @@ -916,16 +916,16 @@ void CLIPBOARD_ReadSelection(Window w,Atom prop) unsigned long nitems,remain; unsigned char* val=NULL; - dprintf_clipboard(stddeb,"\tgot property %s\n",TSXGetAtomName(display,prop)); + dprintf_info(clipboard,"\tgot property %s\n",TSXGetAtomName(display,prop)); /* TODO: Properties longer than 64K */ if(TSXGetWindowProperty(display,w,prop,0,0x3FFF,True,XA_STRING, &atype, &aformat, &nitems, &remain, &val) != Success) - dprintf_clipboard(stddeb,"\tcouldn't read property\n"); + dprintf_warn(clipboard, "\tcouldn't read property\n"); else { - dprintf_clipboard(stddeb,"\tType %s,Format %d,nitems %ld,value %s\n", + dprintf_info(clipboard,"\tType %s,Format %d,nitems %ld,value %s\n", TSXGetAtomName(display,atype),aformat,nitems,val); if(atype == XA_STRING && aformat == 8) @@ -933,7 +933,7 @@ void CLIPBOARD_ReadSelection(Window w,Atom prop) int i,inlcount = 0; char* lpstr; - dprintf_clipboard(stddeb,"\tselection is '%s'\n",val); + dprintf_info(clipboard,"\tselection is '%s'\n",val); for(i=0; i <= nitems; i++) if( val[i] == '\n' ) inlcount++; @@ -985,7 +985,7 @@ void CLIPBOARD_ReleaseSelection(Window w, HWND32 hwnd) * selectionPrevWindow is nonzero if CheckSelection() was called. */ - dprintf_clipboard(stddeb,"\tevent->window = %08x (sw = %08x, spw=%08x)\n", + dprintf_info(clipboard,"\tevent->window = %08x (sw = %08x, spw=%08x)\n", (unsigned)w, (unsigned)selectionWindow, (unsigned)selectionPrevWindow ); if( selectionAcquired ) diff --git a/windows/dce.c b/windows/dce.c index 9ff60c50dcc..21d1080baef 100644 --- a/windows/dce.c +++ b/windows/dce.c @@ -25,8 +25,6 @@ #include "region.h" #include "heap.h" #include "sysmetrics.h" -#include "stddebug.h" -/* #define DEBUG_DC */ #include "debug.h" #define NB_DCE 5 /* Number of DCEs created at startup */ @@ -174,7 +172,7 @@ static void DCE_DeleteClipRgn( DCE* dce ) dce->hClipRgn = 0; - dprintf_dc(stddeb,"\trestoring VisRgn\n"); + dprintf_info(dc,"\trestoring VisRgn\n"); RestoreVisRgn(dce->hDC); } @@ -228,10 +226,11 @@ BOOL32 DCE_InvalidateDCE(WND* pWnd, const RECT32* pRectUpdate) { DCE *dce; - dprintf_dc(stddeb,"InvalidateDCE: scope hwnd = %04x, (%i,%i - %i,%i)\n", - wndScope->hwndSelf, pRectUpdate->left,pRectUpdate->top, - pRectUpdate->right,pRectUpdate->bottom); - if( debugging_dc ) DCE_DumpCache(); + dprintf_info(dc,"InvalidateDCE: scope hwnd = %04x, (%i,%i - %i,%i)\n", + wndScope->hwndSelf, pRectUpdate->left,pRectUpdate->top, + pRectUpdate->right,pRectUpdate->bottom); + if(debugging_info(dc)) + DCE_DumpCache(); /* walk all DCEs and fixup non-empty entries */ @@ -268,7 +267,7 @@ BOOL32 DCE_InvalidateDCE(WND* pWnd, const RECT32* pRectUpdate) { /* Don't bother with visible regions of unused DCEs */ - dprintf_dc(stddeb,"\tpurged %08x dce [%04x]\n", + dprintf_info(dc,"\tpurged %08x dce [%04x]\n", (unsigned)dce, wndCurrent->hwndSelf); dce->hwndCurrent = 0; @@ -279,7 +278,7 @@ BOOL32 DCE_InvalidateDCE(WND* pWnd, const RECT32* pRectUpdate) { /* Set dirty bits in the hDC and DCE structs */ - dprintf_dc(stddeb,"\tfixed up %08x dce [%04x]\n", + dprintf_info(dc,"\tfixed up %08x dce [%04x]\n", (unsigned)dce, wndCurrent->hwndSelf); dce->DCXflags |= DCX_DCEDIRTY; @@ -606,7 +605,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) BOOL32 bUpdateVisRgn = TRUE; BOOL32 bUpdateClipOrigin = FALSE; - dprintf_dc(stddeb,"GetDCEx: hwnd %04x, hrgnClip %04x, flags %08x\n", + dprintf_info(dc,"GetDCEx: hwnd %04x, hrgnClip %04x, flags %08x\n", hwnd, hrgnClip, (unsigned)flags); if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; @@ -685,7 +684,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) ((dce->DCXflags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)) == dcxFlags)) { - dprintf_dc(stddeb,"\tfound valid %08x dce [%04x], flags %08x\n", + dprintf_info(dc,"\tfound valid %08x dce [%04x], flags %08x\n", (unsigned)dce, hwnd, (unsigned)dcxFlags ); bUpdateVisRgn = FALSE; bUpdateClipOrigin = TRUE; @@ -700,7 +699,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) dce = (wndPtr->class->style & CS_OWNDC) ? wndPtr->dce : wndPtr->class->dce; if( dce->hwndCurrent == hwnd ) { - dprintf_dc(stddeb,"\tskipping hVisRgn update\n"); + dprintf_info(dc,"\tskipping hVisRgn update\n"); bUpdateVisRgn = FALSE; /* updated automatically, via DCHook() */ if( (dce->DCXflags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && @@ -734,7 +733,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) DCE_SetDrawable( wndPtr, dc, flags, bUpdateClipOrigin ); if( bUpdateVisRgn ) { - dprintf_dc(stddeb,"updating visrgn for %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd); + dprintf_info(dc,"updating visrgn for %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd); if (flags & DCX_PARENTCLIP) { @@ -770,7 +769,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) SelectVisRgn( hdc, hrgnVisible ); } else - dprintf_dc(stddeb,"no visrgn update %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd); + dprintf_info(dc,"no visrgn update %08x dce, hwnd [%04x]\n", (unsigned)dce, hwnd); /* apply additional region operation (if any) */ @@ -781,7 +780,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) dce->DCXflags |= flags & (DCX_KEEPCLIPRGN | DCX_INTERSECTRGN | DCX_EXCLUDERGN); dce->hClipRgn = hrgnClip; - dprintf_dc(stddeb, "\tsaved VisRgn, clipRgn = %04x\n", hrgnClip); + dprintf_info(dc, "\tsaved VisRgn, clipRgn = %04x\n", hrgnClip); SaveVisRgn( hdc ); CombineRgn32( hrgnVisible, InquireVisRgn( hdc ), hrgnClip, @@ -791,7 +790,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags ) if( hrgnVisible ) DeleteObject32( hrgnVisible ); - dprintf_dc(stddeb, "GetDCEx(%04x,%04x,0x%lx): returning %04x\n", + dprintf_info(dc, "GetDCEx(%04x,%04x,0x%lx): returning %04x\n", hwnd, hrgnClip, flags, hdc); return hdc; } @@ -853,7 +852,7 @@ INT32 WINAPI ReleaseDC32( HWND32 hwnd, HDC32 hdc ) { DCE * dce = firstDCE; - dprintf_dc(stddeb, "ReleaseDC: %04x %04x\n", hwnd, hdc ); + dprintf_info(dc, "ReleaseDC: %04x %04x\n", hwnd, hdc ); while (dce && (dce->hDC != hdc)) dce = dce->next; @@ -873,7 +872,7 @@ BOOL16 WINAPI DCHook( HDC16 hDC, WORD code, DWORD data, LPARAM lParam ) HRGN32 hVisRgn; DCE *dce = firstDCE;; - dprintf_dc(stddeb,"DCHook: hDC = %04x, %i\n", hDC, code); + dprintf_info(dc,"DCHook: hDC = %04x, %i\n", hDC, code); while (dce && (dce->hDC != hDC)) dce = dce->next; if (!dce) return 0; @@ -892,7 +891,7 @@ BOOL16 WINAPI DCHook( HDC16 hDC, WORD code, DWORD data, LPARAM lParam ) SetHookFlags(hDC, DCHF_VALIDATEVISRGN); hVisRgn = DCE_GetVisRgn(dce->hwndCurrent, dce->DCXflags); - dprintf_dc(stddeb,"\tapplying saved clipRgn\n"); + dprintf_info(dc,"\tapplying saved clipRgn\n"); /* clip this region with saved clipping region */ @@ -912,7 +911,7 @@ BOOL16 WINAPI DCHook( HDC16 hDC, WORD code, DWORD data, LPARAM lParam ) DeleteObject32( hVisRgn ); } else /* non-fatal but shouldn't happen */ - dprintf_dc(stddeb,"DCHook: DC is not in use!\n"); + dprintf_warn(dc, "DCHook: DC is not in use!\n"); break; case DCHC_DELETEDC: /* FIXME: ?? */ diff --git a/windows/defwnd.c b/windows/defwnd.c index 3cb57b80bc4..cc3ec64eb4e 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -14,7 +14,6 @@ #include "winpos.h" #include "dce.h" #include "sysmetrics.h" -#include "stddebug.h" #include "debug.h" #include "spy.h" @@ -98,7 +97,7 @@ static void DEFWND_SetRedraw( WND* wndPtr, WPARAM32 wParam ) { BOOL32 bVisible = wndPtr->dwStyle & WS_VISIBLE; -dprintf_win(stddeb,"SetRedraw: %04x %i\n", wndPtr->hwndSelf, (wParam!=0) ); +dprintf_info(win,"SetRedraw: %04x %i\n", wndPtr->hwndSelf, (wParam!=0) ); if( wParam ) { @@ -185,7 +184,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT32 msg, WPARAM32 wParam, SYSMETRICS_CXICON)/2; int y = (wndPtr->rectWindow.bottom - wndPtr->rectWindow.top - SYSMETRICS_CYICON)/2; - dprintf_win(stddeb,"Painting class icon: vis rect=(%i,%i - %i,%i)\n", + dprintf_info(win,"Painting class icon: vis rect=(%i,%i - %i,%i)\n", ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom ); DrawIcon32( hdc, x, y, wndPtr->class->hIcon ); } diff --git a/windows/dialog.c b/windows/dialog.c index 59ddae65662..2e2c85f79d2 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -21,7 +21,6 @@ #include "winproc.h" #include "message.h" #include "sysmetrics.h" -#include "stddebug.h" #include "debug.h" @@ -84,7 +83,7 @@ BOOL32 DIALOG_Init(void) if (!(tm.tmPitchAndFamily & TMPF_FIXED_PITCH)) xBaseUnit = xBaseUnit * 5 / 4; - dprintf_dialog( stddeb, "DIALOG_Init: base units = %d,%d\n", + dprintf_info(dialog, "DIALOG_Init: base units = %d,%d\n", xBaseUnit, yBaseUnit ); return TRUE; } @@ -147,12 +146,12 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info ) p += *p + 1; if(int_id) - dprintf_dialog( stddeb," %s %04x %d, %d, %d, %d, %d, %08lx, %08lx\n", + dprintf_info(dialog," %s %04x %d, %d, %d, %d, %d, %08lx, %08lx\n", info->className, LOWORD(info->windowName), info->id, info->x, info->y, info->cx, info->cy, info->style, (DWORD)info->data); else - dprintf_dialog( stddeb," %s '%s' %d, %d, %d, %d, %d, %08lx, %08lx\n", + dprintf_info(dialog," %s '%s' %d, %d, %d, %d, %d, %08lx, %08lx\n", info->className, info->windowName, info->id, info->x, info->y, info->cx, info->cy, info->style, (DWORD)info->data); @@ -222,12 +221,12 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info ) p++; if(int_id) - dprintf_dialog( stddeb," %p %04x %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", + dprintf_info(dialog," %p %04x %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", info->className, LOWORD(info->windowName), info->id, info->x, info->y, info->cx, info->cy, info->style, info->exStyle, (DWORD)info->data); else - dprintf_dialog( stddeb," %p '%p' %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", + dprintf_info(dialog," %p '%p' %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", info->className, info->windowName, info->id, info->x, info->y, info->cx, info->cy, info->style, info->exStyle, (DWORD)info->data); @@ -249,7 +248,7 @@ static BOOL32 DIALOG_CreateControls( WND *pWnd, LPCSTR template, INT32 items, DLG_CONTROL_INFO info; HWND32 hwndCtrl, hwndDefButton = 0; - dprintf_dialog(stddeb, " BEGIN\n" ); + dprintf_info(dialog, " BEGIN\n" ); while (items--) { if (!win32) @@ -313,7 +312,7 @@ static BOOL32 DIALOG_CreateControls( WND *pWnd, LPCSTR template, INT32 items, dlgInfo->idResult = GetWindowWord32( hwndCtrl, GWW_ID ); } } - dprintf_dialog(stddeb, " END\n" ); + dprintf_info(dialog, " END\n" ); return TRUE; } @@ -333,9 +332,9 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result ) result->y = GET_WORD(p); p += sizeof(WORD); result->cx = GET_WORD(p); p += sizeof(WORD); result->cy = GET_WORD(p); p += sizeof(WORD); - dprintf_dialog( stddeb, "DIALOG %d, %d, %d, %d\n", + dprintf_info(dialog, "DIALOG %d, %d, %d, %d\n", result->x, result->y, result->cx, result->cy ); - dprintf_dialog( stddeb, " STYLE %08lx\n", result->style ); + dprintf_info(dialog, " STYLE %08lx\n", result->style ); /* Get the menu name */ @@ -348,11 +347,11 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result ) case 0xff: result->menuName = (LPCSTR)(UINT32)GET_WORD( p + 1 ); p += 3; - dprintf_dialog(stddeb, " MENU %04x\n", LOWORD(result->menuName) ); + dprintf_info(dialog, " MENU %04x\n", LOWORD(result->menuName) ); break; default: result->menuName = p; - dprintf_dialog( stddeb, " MENU '%s'\n", p ); + dprintf_info(dialog, " MENU '%s'\n", p ); p += strlen(p) + 1; break; } @@ -362,7 +361,7 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result ) if (*p) { result->className = p; - dprintf_dialog( stddeb, " CLASS '%s'\n", result->className ); + dprintf_info(dialog, " CLASS '%s'\n", result->className ); } else result->className = DIALOG_CLASS_ATOM; p += strlen(p) + 1; @@ -371,7 +370,7 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result ) result->caption = p; p += strlen(p) + 1; - dprintf_dialog( stddeb, " CAPTION '%s'\n", result->caption ); + dprintf_info(dialog, " CAPTION '%s'\n", result->caption ); /* Get the font name */ @@ -381,7 +380,7 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result ) p += sizeof(WORD); result->faceName = p; p += strlen(p) + 1; - dprintf_dialog( stddeb, " FONT %d,'%s'\n", + dprintf_info(dialog, " FONT %d,'%s'\n", result->pointSize, result->faceName ); } return p; @@ -405,10 +404,10 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) result->y = GET_WORD(p); p++; result->cx = GET_WORD(p); p++; result->cy = GET_WORD(p); p++; - dprintf_dialog( stddeb, "DIALOG %d, %d, %d, %d\n", + dprintf_info(dialog, "DIALOG %d, %d, %d, %d\n", result->x, result->y, result->cx, result->cy ); - dprintf_dialog( stddeb, " STYLE %08lx\n", result->style ); - dprintf_dialog( stddeb, " EXSTYLE %08lx\n", result->exStyle ); + dprintf_info(dialog, " STYLE %08lx\n", result->style ); + dprintf_info(dialog, " EXSTYLE %08lx\n", result->exStyle ); /* Get the menu name */ @@ -421,11 +420,11 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) case 0xffff: result->menuName = (LPCSTR)(UINT32)GET_WORD( p + 1 ); p += 2; - dprintf_dialog(stddeb, " MENU %04x\n", LOWORD(result->menuName) ); + dprintf_info(dialog, " MENU %04x\n", LOWORD(result->menuName) ); break; default: result->menuName = (LPCSTR)p; - dprintf_dialog( stddeb, " MENU '%p'\n", p ); + dprintf_info(dialog, " MENU '%p'\n", p ); p += lstrlen32W( (LPCWSTR)p ) + 1; break; } @@ -441,11 +440,11 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) case 0xffff: result->className = (LPCSTR)(UINT32)GET_WORD( p + 1 ); p += 2; - dprintf_dialog(stddeb, " CLASS %04x\n", LOWORD(result->className) ); + dprintf_info(dialog, " CLASS %04x\n", LOWORD(result->className) ); break; default: result->className = (LPCSTR)p; - dprintf_dialog( stddeb, " CLASS '%p'\n", p ); + dprintf_info(dialog, " CLASS '%p'\n", p ); p += lstrlen32W( (LPCWSTR)p ) + 1; break; } @@ -454,7 +453,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) result->caption = (LPCSTR)p; p += lstrlen32W( (LPCWSTR)p ) + 1; - dprintf_dialog( stddeb, " CAPTION '%p'\n", result->caption ); + dprintf_info(dialog, " CAPTION '%p'\n", result->caption ); /* Get the font name */ @@ -464,7 +463,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) p++; result->faceName = (LPCSTR)p; p += lstrlen32W( (LPCWSTR)p ) + 1; - dprintf_dialog( stddeb, " FONT %d,'%p'\n", + dprintf_info(dialog, " FONT %d,'%p'\n", result->pointSize, result->faceName ); } /* First control is on dword boundary */ @@ -667,7 +666,7 @@ HWND16 WINAPI CreateDialogParam16( HINSTANCE16 hInst, SEGPTR dlgTemplate, HGLOBAL16 hmem; LPCVOID data; - dprintf_dialog(stddeb, "CreateDialogParam16: %04x,%08lx,%04x,%08lx,%ld\n", + dprintf_info(dialog, "CreateDialogParam16: %04x,%08lx,%04x,%08lx,%ld\n", hInst, (DWORD)dlgTemplate, owner, (DWORD)dlgProc, param ); if (!(hRsrc = FindResource16( hInst, dlgTemplate, RT_DIALOG ))) return 0; @@ -915,7 +914,7 @@ BOOL32 WINAPI EndDialog32( HWND32 hwnd, INT32 retval ) WND * wndPtr = WIN_FindWndPtr( hwnd ); DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra; - dprintf_dialog(stddeb, "EndDialog: %04x %d\n", hwnd, retval ); + dprintf_info(dialog, "EndDialog: %04x %d\n", hwnd, retval ); if( dlgInfo ) { @@ -1557,7 +1556,7 @@ static BOOL32 DIALOG_DlgDirSelect( HWND32 hwnd, LPSTR str, INT32 len, BOOL32 ret; HWND32 listbox = GetDlgItem32( hwnd, id ); - dprintf_dialog( stddeb, "DlgDirSelect: %04x '%s' %d\n", hwnd, str, id ); + dprintf_info(dialog, "DlgDirSelect: %04x '%s' %d\n", hwnd, str, id ); if (!listbox) return FALSE; if (win32) { @@ -1606,7 +1605,7 @@ static BOOL32 DIALOG_DlgDirSelect( HWND32 hwnd, LPSTR str, INT32 len, if (unicode) lstrcpynAtoW( (LPWSTR)str, ptr, len ); else lstrcpyn32A( str, ptr, len ); SEGPTR_FREE( buffer ); - dprintf_dialog( stddeb, "Returning %d '%s'\n", ret, str ); + dprintf_info(dialog, "Returning %d '%s'\n", ret, str ); return ret; } @@ -1627,7 +1626,7 @@ static INT32 DIALOG_DlgDirList( HWND32 hDlg, LPSTR spec, INT32 idLBox, ((attrib & DDL_POSTMSGS) ? PostMessage32A( hwnd, msg, wparam, lparam ) \ : SendMessage32A( hwnd, msg, wparam, lparam )) - dprintf_dialog( stddeb, "DlgDirList: %04x '%s' %d %d %04x\n", + dprintf_info(dialog, "DlgDirList: %04x '%s' %d %d %04x\n", hDlg, spec ? spec : "NULL", idLBox, idStatic, attrib ); if (spec && spec[0] && (spec[1] == ':')) @@ -1659,7 +1658,7 @@ static INT32 DIALOG_DlgDirList( HWND32 hDlg, LPSTR spec, INT32 idLBox, } } - dprintf_dialog( stddeb, "ListBoxDirectory: path=%c:\\%s mask=%s\n", + dprintf_info(dialog, "ListBoxDirectory: path=%c:\\%s mask=%s\n", 'A' + drive, DRIVE_GetDosCwd(drive), spec ); if (idLBox && ((hwnd = GetDlgItem32( hDlg, idLBox )) != 0)) diff --git a/windows/dinput.c b/windows/dinput.c index 5f510cd8060..101435f7c6c 100644 --- a/windows/dinput.c +++ b/windows/dinput.c @@ -5,9 +5,13 @@ /* Status: * * - Tomb Raider 2 Demo: - * Doesn't accept input yet. Although I am sure I've done everything right... + * Playable using keyboard only. * - WingCommander Prophecy Demo: - * dito. + * Doesn't get Input Focus. + * + * FIXME: The keyboard handling needs to (and will) be merged into keyboard.c + * (The current implementation is currently only a proof of concept and + * an utter mess.) */ #include "config.h" @@ -28,9 +32,11 @@ #include "heap.h" #include "win.h" #include "dinput.h" -#include "stddebug.h" #include "debug.h" +extern BYTE InputKeyStateTable[256]; +extern BYTE vkey2scode[512]; + static IDirectInputA_VTable ddiavt; static IDirectInputDeviceA_VTable SysKeyboardAvt; static IDirectInputDeviceA_VTable SysMouseAvt; @@ -73,13 +79,14 @@ static HRESULT WINAPI IDirectInputA_CreateDevice( ) { char xbuf[50]; - StringFromCLSID(rguid,xbuf); + WINE_StringFromCLSID(rguid,xbuf); fprintf(stderr,"IDirectInputA(%p)->CreateDevice(%s,%p,%p),stub!\n",this,xbuf,pdev,punk); if (!memcmp(&GUID_SysKeyboard,rguid,sizeof(GUID_SysKeyboard))) { - *pdev = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectInputDevice32A)); + *pdev = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysKeyboard32A)); (*pdev)->ref = 1; (*pdev)->lpvtbl = &SysKeyboardAvt; memcpy(&((*pdev)->guid),rguid,sizeof(*rguid)); + memset(((LPSYSKEYBOARD32A)(*pdev))->keystate,0,256); return 0; } if (!memcmp(&GUID_SysMouse,rguid,sizeof(GUID_SysMouse))) { @@ -97,7 +104,7 @@ static HRESULT WINAPI IDirectInputA_QueryInterface( ) { char xbuf[50]; - StringFromCLSID(riid,xbuf); + WINE_StringFromCLSID(riid,xbuf); fprintf(stderr,"IDirectInputA(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj); if (!memcmp(&IID_IUnknown,riid,sizeof(*riid))) { this->lpvtbl->fnAddRef(this); @@ -112,6 +119,12 @@ static HRESULT WINAPI IDirectInputA_QueryInterface( return E_FAIL; } +static HRESULT WINAPI IDirectInputA_Initialize( + LPDIRECTINPUT32A this,HINSTANCE32 hinst,DWORD x +) { + return DIERR_ALREADYINITIALIZED; +} + static IDirectInputA_VTable ddiavt= { IDirectInputA_QueryInterface, IDirectInputA_AddRef, @@ -120,7 +133,7 @@ static IDirectInputA_VTable ddiavt= { IDirectInputA_EnumDevices, (void*)6, (void*)7, - (void*)8 + IDirectInputA_Initialize }; /****************************************************************************** @@ -143,7 +156,7 @@ static HRESULT WINAPI IDirectInputDeviceA_SetDataFormat( char xbuf[50]; if (df->rgodf[i].pguid) - StringFromCLSID(df->rgodf[i].pguid,xbuf); + WINE_StringFromCLSID(df->rgodf[i].pguid,xbuf); else strcpy(xbuf,""); fprintf(stderr,"df.rgodf[%d].guid %s\n",i,xbuf); @@ -168,10 +181,23 @@ static HRESULT WINAPI IDirectInputDeviceA_SetProperty( char xbuf[50]; if (HIWORD(rguid)) - StringFromCLSID(rguid,xbuf); + WINE_StringFromCLSID(rguid,xbuf); else - strcpy(xbuf,""); + sprintf(xbuf,"",(DWORD)rguid); fprintf(stderr,"IDirectInputDeviceA(%p)->SetProperty(%s,%p)\n",this,xbuf,ph); + if (!HIWORD(rguid)) { + switch ((DWORD)rguid) { + case DIPROP_BUFFERSIZE: { + LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; + + fprintf(stderr," buffersize = %ld\n",pd->dwData); + break; + } + default: + fprintf(stderr," unknown type %ld\n",(DWORD)rguid); + break; + } + } return 0; } @@ -183,15 +209,14 @@ static HRESULT WINAPI IDirectInputDeviceA_SetEventNotification( } static HRESULT WINAPI IDirectInputDeviceA_GetDeviceData( - LPDIRECTINPUTDEVICE32A this,DWORD x,LPDIDEVICEOBJECTDATA dod, - LPDWORD y,DWORD z + LPDIRECTINPUTDEVICE32A this,DWORD dodsize,LPDIDEVICEOBJECTDATA dod, + LPDWORD entries,DWORD flags ) { -/* - fprintf(stderr,"IDirectInputDeviceA(%p)->GetDeviceData(0x%08lx,%p,%p,0x%08lx)\n",this,x,dod,y,z); - */ +/* fprintf(stderr,"IDirectInputDeviceA(%p)->GetDeviceData(%ld,%p,%p(0x%08lx),0x%08lx)\n",this,dodsize,dod,entries,*entries,flags);*/ return 0; } + static HRESULT WINAPI IDirectInputDeviceA_Acquire(LPDIRECTINPUTDEVICE32A this) { fprintf(stderr,"IDirectInputDeviceA(%p)->Aquire()\n",this); return 0; @@ -210,29 +235,100 @@ static ULONG WINAPI IDirectInputDeviceA_Release(LPDIRECTINPUTDEVICE32A this) { return 0; } +static HRESULT WINAPI SysKeyboardA_SetProperty( + LPDIRECTINPUTDEVICE32A this,REFGUID rguid,LPCDIPROPHEADER ph +) { + LPSYSKEYBOARD32A kthis = (LPSYSKEYBOARD32A)this; + char xbuf[50]; + + if (HIWORD(rguid)) + WINE_StringFromCLSID(rguid,xbuf); + else + sprintf(xbuf,"",(DWORD)rguid); + fprintf(stderr,"SysKeyboardA(%p)->SetProperty(%s,%p)\n",this,xbuf,ph); + fprintf(stderr," size is %ld, headersize is %ld,obj is %ld,how is %ld\n",ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); + if (!HIWORD(rguid)) { + switch ((DWORD)rguid) { + case DIPROP_BUFFERSIZE: { + LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; + + fprintf(stderr," buffersize = %ld\n",pd->dwData); + break; + } + default: + fprintf(stderr," unknown type %ld\n",(DWORD)rguid); + break; + } + } + return 0; +} + +static HRESULT WINAPI SysKeyboardA_GetDeviceState( + LPDIRECTINPUTDEVICE32A this,DWORD len,LPVOID ptr +) { + if (len==256) { + int i; + + memset(ptr,0,256); + for (i=0;i<256;i++) + if (InputKeyStateTable[i]&0x80) { + ((LPBYTE)ptr)[vkey2scode[i] ]=0x80; + ((LPBYTE)ptr)[vkey2scode[i]|0x80]=0x80; + } + return 0; + } + fprintf(stderr,"whoops, SysKeyboardA_GetDeviceState got len %ld?\n",len); + return 0; +} + +static HRESULT WINAPI SysKeyboardA_GetDeviceData( + LPDIRECTINPUTDEVICE32A this,DWORD dodsize,LPDIDEVICEOBJECTDATA dod, + LPDWORD entries,DWORD flags +) { + int i,n,xentries; + LPSYSKEYBOARD32A kthis = (LPSYSKEYBOARD32A)this; + +/* fprintf(stderr,"SysKeyboardA(%p)->GetDeviceData(%ld,%p,%p(%ld),0x%08lx)\n",this,dodsize,dod,entries,entries?*entries:0,flags);*/ + if (entries) + xentries = *entries; + else + xentries = 1; + + for (n=i=0;(i<256) && (n<*entries);i++) { + if (kthis->keystate[i] == (InputKeyStateTable[i]&0x80)) + continue; + if (dod) { + /* add an entry */ + dod[n].dwOfs = vkey2scode[i]; + dod[n].dwData = InputKeyStateTable[i]&0x80; + dod[n].dwTimeStamp = 0; /* umm */ + dod[n].dwSequence = 0; /* umm */ + n++; + } + if (!(flags & DIGDD_PEEK)) + kthis->keystate[i] = InputKeyStateTable[i]&0x80; + } + *entries = n; + return 0; +} + +static HRESULT WINAPI SysKeyboardA_Acquire(LPDIRECTINPUTDEVICE32A this) { + fprintf(stderr,"SysKeyboardA(%p)->Aquire()\n",this); + return 0; +} + +static HRESULT WINAPI SysKeyboardA_Unacquire(LPDIRECTINPUTDEVICE32A this) { + fprintf(stderr,"SysKeyboardA(%p)->Unaquire()\n",this); + return 0; +} -extern BYTE InputKeyStateTable[256]; -extern BYTE vkey2scode[512]; static HRESULT WINAPI IDirectInputDeviceA_GetDeviceState( LPDIRECTINPUTDEVICE32A this,DWORD len,LPVOID ptr ) { -/* fprintf(stderr,"IDirectInputDeviceA(%p)->GetDeviceState(0x%08lx,%p)\n", this,len,ptr ); - */ - if (len==256) {/* && this_is_a_keyboard */ - int i; - - memset(ptr,0,256); - for (i=0;i<256;i++) { - if (InputKeyStateTable[i]&0x80) - fprintf(stderr,"VKEY %d pressed (DIK 0x%02x\n",i,vkey2scode[i]); - ((LPBYTE)ptr)[i]=vkey2scode[InputKeyStateTable[i]]&0x80; - } - return 0; - } return 0; } @@ -241,7 +337,7 @@ static HRESULT WINAPI IDirectInputDeviceA_QueryInterface( ) { char xbuf[50]; - StringFromCLSID(riid,xbuf); + WINE_StringFromCLSID(riid,xbuf); fprintf(stderr,"IDirectInputA(%p)->QueryInterface(%s,%p)\n",this,xbuf,ppobj); if (!memcmp(&IID_IUnknown,riid,sizeof(*riid))) { this->lpvtbl->fnAddRef(this); @@ -263,11 +359,11 @@ static IDirectInputDeviceA_VTable SysKeyboardAvt={ (void*)4, (void*)5, (void*)6, - IDirectInputDeviceA_SetProperty, - IDirectInputDeviceA_Acquire, - IDirectInputDeviceA_Unacquire, - IDirectInputDeviceA_GetDeviceState, - IDirectInputDeviceA_GetDeviceData, + SysKeyboardA_SetProperty, + SysKeyboardA_Acquire, + SysKeyboardA_Unacquire, + SysKeyboardA_GetDeviceState, + SysKeyboardA_GetDeviceData, IDirectInputDeviceA_SetDataFormat, IDirectInputDeviceA_SetEventNotification, IDirectInputDeviceA_SetCooperativeLevel, diff --git a/windows/driver.c b/windows/driver.c index dbc85310ee1..85eefe3d3ab 100644 --- a/windows/driver.c +++ b/windows/driver.c @@ -10,7 +10,6 @@ #include "callback.h" #include "driver.h" #include "module.h" -#include "stddebug.h" #include "debug.h" LPDRIVERITEM lpDrvItemList = NULL; @@ -32,12 +31,12 @@ void LoadStartupDrivers(void) ptr = str; while (lstrlen32A( ptr ) != 0) { - dprintf_driver( stddeb, "LoadStartupDrivers // str='%s'\n", ptr ); + dprintf_info(driver, "LoadStartupDrivers // str='%s'\n", ptr ); hDrv = OpenDriver( ptr, "drivers", 0L ); - dprintf_driver( stddeb, "LoadStartupDrivers // hDrv=%04x\n", hDrv ); + dprintf_info(driver, "LoadStartupDrivers // hDrv=%04x\n", hDrv ); ptr += lstrlen32A(ptr) + 1; } - dprintf_driver( stddeb, "LoadStartupDrivers // end of list !\n" ); + dprintf_info(driver, "LoadStartupDrivers // end of list !\n" ); return; } @@ -51,7 +50,7 @@ LRESULT WINAPI SendDriverMessage(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1, LPDRIVERITEM lpdrv; LRESULT retval; - dprintf_driver( stddeb, "SendDriverMessage(%04x, %04X, %08lX, %08lX)\n", + dprintf_info(driver, "SendDriverMessage(%04x, %04X, %08lX, %08lX)\n", hDriver, msg, lParam1, lParam2 ); lpdrv = (LPDRIVERITEM)GlobalLock16( hDriver ); @@ -64,7 +63,7 @@ LRESULT WINAPI SendDriverMessage(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1, retval = Callbacks->CallDriverProc( lpdrv->lpDrvProc, 0L /* FIXME */, hDriver, msg, lParam1, lParam2 ); - dprintf_driver( stddeb, "SendDriverMessage // retval = %ld\n", retval ); + dprintf_info(driver, "SendDriverMessage // retval = %ld\n", retval ); GlobalUnlock16( hDriver ); return retval; @@ -80,13 +79,13 @@ HDRVR16 WINAPI OpenDriver(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam char DrvName[128]; WORD ordinal; - dprintf_driver( stddeb,"OpenDriver('%s', '%s', %08lX);\n", + dprintf_info(driver,"OpenDriver('%s', '%s', %08lX);\n", lpDriverName, lpSectionName, lParam ); if (lpSectionName == NULL) lpSectionName = "drivers"; GetPrivateProfileString32A( lpSectionName, lpDriverName, "", DrvName, sizeof(DrvName), "SYSTEM.INI" ); - dprintf_driver( stddeb,"OpenDriver // DrvName='%s'\n", DrvName ); + dprintf_info(driver,"OpenDriver // DrvName='%s'\n", DrvName ); if (lstrlen32A(DrvName) < 1) return 0; lpdrv = lpDrvItemList; @@ -147,7 +146,7 @@ HDRVR16 WINAPI OpenDriver(LPSTR lpDriverName, LPSTR lpSectionName, LPARAM lParam SendDriverMessage( hDrvr, DRV_ENABLE, 0L, lParam ); SendDriverMessage( hDrvr, DRV_OPEN, 0L, lParam ); - dprintf_driver( stddeb, "OpenDriver // hDrvr=%04x loaded !\n", hDrvr ); + dprintf_info(driver, "OpenDriver // hDrvr=%04x loaded !\n", hDrvr ); return hDrvr; } @@ -158,7 +157,7 @@ LRESULT WINAPI CloseDriver(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2) { LPDRIVERITEM lpdrv; - dprintf_driver( stddeb, "CloseDriver(%04x, %08lX, %08lX);\n", + dprintf_info(driver, "CloseDriver(%04x, %08lX, %08lX);\n", hDrvr, lParam1, lParam2 ); lpdrv = (LPDRIVERITEM)GlobalLock16( hDrvr ); @@ -182,7 +181,7 @@ LRESULT WINAPI CloseDriver(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2) GlobalFree16( hDrvr ); } - dprintf_driver( stddeb, "CloseDriver // hDrvr=%04x closed !\n", + dprintf_info(driver, "CloseDriver // hDrvr=%04x closed !\n", hDrvr ); return TRUE; } @@ -197,7 +196,7 @@ HMODULE16 WINAPI GetDriverModuleHandle(HDRVR16 hDrvr) LPDRIVERITEM lpdrv; HMODULE16 hModule = 0; - dprintf_driver( stddeb, "GetDriverModuleHandle(%04x);\n", hDrvr); + dprintf_info(driver, "GetDriverModuleHandle(%04x);\n", hDrvr); lpdrv = (LPDRIVERITEM)GlobalLock16( hDrvr ); if (lpdrv != NULL && lpdrv->dis.hDriver == hDrvr) @@ -253,7 +252,7 @@ BOOL16 WINAPI GetDriverInfo(HDRVR16 hDrvr, LPDRIVERINFOSTRUCT16 lpDrvInfo) { LPDRIVERITEM lpdrv; - dprintf_driver( stddeb, "GetDriverInfo(%04x, %p);\n", hDrvr, lpDrvInfo ); + dprintf_info(driver, "GetDriverInfo(%04x, %p);\n", hDrvr, lpDrvInfo ); if (lpDrvInfo == NULL) return FALSE; @@ -273,17 +272,17 @@ HDRVR16 WINAPI GetNextDriver(HDRVR16 hDrvr, DWORD dwFlags) LPDRIVERITEM lpdrv; HDRVR16 hRetDrv = 0; - dprintf_driver( stddeb, "GetNextDriver(%04x, %08lX);\n", hDrvr, dwFlags ); + dprintf_info(driver, "GetNextDriver(%04x, %08lX);\n", hDrvr, dwFlags ); if (hDrvr == 0) { if (lpDrvItemList == NULL) { - dprintf_driver(stddeb, "GetNextDriver // drivers list empty !\n"); + dprintf_info(driver, "GetNextDriver // drivers list empty !\n"); LoadStartupDrivers(); if (lpDrvItemList == NULL) return 0; } - dprintf_driver( stddeb,"GetNextDriver // return first %04x !\n", + dprintf_info(driver,"GetNextDriver // return first %04x !\n", lpDrvItemList->dis.hDriver ); return lpDrvItemList->dis.hDriver; } @@ -304,6 +303,6 @@ HDRVR16 WINAPI GetNextDriver(HDRVR16 hDrvr, DWORD dwFlags) GlobalUnlock16( hDrvr ); } - dprintf_driver( stddeb, "GetNextDriver // return %04x !\n", hRetDrv ); + dprintf_info(driver, "GetNextDriver // return %04x !\n", hRetDrv ); return hRetDrv; } diff --git a/windows/event.c b/windows/event.c index 84bc271005c..0350f143746 100644 --- a/windows/event.c +++ b/windows/event.c @@ -37,7 +37,6 @@ #include "drive.h" #include "shell.h" #include "keyboard.h" -#include "stddebug.h" #include "debug.h" #include "dde_proc.h" @@ -155,7 +154,7 @@ void EVENT_ProcessEvent( XEvent *event ) (char **)&pWnd ) != 0) return; /* Not for a registered window */ - dprintf_event( stddeb, "Got event %s for hwnd %04x\n", + dprintf_info(event, "Got event %s for hwnd %04x\n", event_names[event->type], pWnd->hwndSelf ); switch(event->type) @@ -249,7 +248,7 @@ void EVENT_ProcessEvent( XEvent *event ) break; default: - dprintf_event(stddeb, "Unprocessed event %s for hwnd %04x\n", + dprintf_warn(event, "Unprocessed event %s for hwnd %04x\n", event_names[event->type], pWnd->hwndSelf ); break; } @@ -510,7 +509,7 @@ static Window __get_top_decoration( Window w, Window ancestor ) TSXQueryTree( display, w, &root, &parent, &children, &total ); if( children ) TSXFree( children ); } while( parent && parent != ancestor ); - dprintf_event( stddeb, "\t%08x -> %08x\n", (unsigned)prev, (unsigned)w ); + dprintf_info(event, "\t%08x -> %08x\n", (unsigned)prev, (unsigned)w ); return ( parent ) ? w : 0 ; } @@ -932,7 +931,7 @@ static void EVENT_SelectionRequest( WND *pWnd, XSelectionRequestEvent *event ) } if(rprop == None) - dprintf_event(stddeb,"Request for %s ignored\n", TSXGetAtomName(display,event->target)); + dprintf_info(event,"Request for %s ignored\n", TSXGetAtomName(display,event->target)); result.type = SelectionNotify; result.display = display; @@ -955,7 +954,7 @@ static void EVENT_SelectionNotify( XSelectionEvent *event ) if (event->target != XA_STRING) CLIPBOARD_ReadSelection( 0, None ); else CLIPBOARD_ReadSelection( event->requestor, event->property ); - dprintf_clipboard(stddeb,"\tSelectionNotify done!\n"); + dprintf_info(clipboard,"\tSelectionNotify done!\n"); } @@ -1087,7 +1086,7 @@ static void EVENT_ClientMessage( WND *pWnd, XClientMessageEvent *event ) } /* WS_EX_ACCEPTFILES */ } /* dndProtocol */ else - dprintf_event( stddeb, "unrecognized ClientMessage\n" ); + dprintf_info(event, "unrecognized ClientMessage\n" ); } } @@ -1145,7 +1144,7 @@ HWND32 EVENT_Capture(HWND32 hwnd, INT16 ht) GrabModeAsync, GrabModeAsync, None, None, CurrentTime ) == GrabSuccess) ) { - dprintf_win(stddeb, "SetCapture(0x%04x)\n", hwnd ); + dprintf_info(win, "SetCapture(0x%04x)\n", hwnd ); captureWnd = hwnd; captureHT = ht; } @@ -1191,7 +1190,7 @@ HWND32 WINAPI SetCapture32( HWND32 hwnd ) */ void WINAPI ReleaseCapture(void) { - dprintf_win(stddeb, "ReleaseCapture() [%04x]\n", captureWnd ); + dprintf_info(win, "ReleaseCapture() [%04x]\n", captureWnd ); if( captureWnd ) EVENT_Capture( 0, 0 ); } @@ -1271,7 +1270,7 @@ void WINAPI Mouse_Event( CONTEXT *context ) BOOL16 WINAPI EnableHardwareInput(BOOL16 bEnable) { BOOL16 bOldState = InputEnabled; - dprintf_event(stdnimp,"EnableHardwareInput(%d);\n", bEnable); + dprintf_fixme(event,"EnableHardwareInput(%d) - stub\n", bEnable); InputEnabled = bEnable; return bOldState; } diff --git a/windows/hook.c b/windows/hook.c index ebf20c6001f..cff8d1ab00d 100644 --- a/windows/hook.c +++ b/windows/hook.c @@ -21,7 +21,6 @@ #include "heap.h" #include "struct32.h" #include "winproc.h" -#include "stddebug.h" #include "debug.h" #pragma pack(1) @@ -848,7 +847,7 @@ static HANDLE16 HOOK_SetHook( INT16 id, LPVOID proc, INT32 type, if ((id < WH_MINHOOK) || (id > WH_MAXHOOK)) return 0; - dprintf_hook( stddeb, "Setting hook %d: %08x %04x %04x\n", + dprintf_info(hook, "Setting hook %d: %08x %04x %04x\n", id, (UINT32)proc, hInst, hTask ); if (!hInst && (type!=HOOK_WIN16)) @@ -886,7 +885,7 @@ static HANDLE16 HOOK_SetHook( INT16 id, LPVOID proc, INT32 type, data->next = HOOK_systemHooks[id - WH_MINHOOK]; HOOK_systemHooks[id - WH_MINHOOK] = handle; } - dprintf_hook( stddeb, "Setting hook %d: ret=%04x [next=%04x]\n", + dprintf_info(hook, "Setting hook %d: ret=%04x [next=%04x]\n", id, handle, data->next ); return handle; } @@ -902,13 +901,13 @@ static BOOL32 HOOK_RemoveHook( HANDLE16 hook ) HOOKDATA *data; HANDLE16 *prevHook; - dprintf_hook( stddeb, "Removing hook %04x\n", hook ); + dprintf_info(hook, "Removing hook %04x\n", hook ); if (!(data = (HOOKDATA *)USER_HEAP_LIN_ADDR(hook))) return FALSE; if (data->flags & HOOK_INUSE) { /* Mark it for deletion later on */ - dprintf_hook( stddeb, "Hook still running, deletion delayed\n" ); + dprintf_warn(hook, "Hook still running, deletion delayed\n" ); data->proc = (HOOKPROC32)0; return TRUE; } @@ -982,12 +981,12 @@ static LRESULT HOOK_CallHook( HANDLE16 hook, INT32 fromtype, INT32 code, queue->hCurHook = hook; data->flags |= HOOK_INUSE; - dprintf_hook( stddeb, "Calling hook %04x: %d %08x %08lx\n", + dprintf_info(hook, "Calling hook %04x: %d %08x %08lx\n", hook, code, wParam, lParam ); ret = data->proc(code, wParam, lParam); - dprintf_hook( stddeb, "Ret hook %04x = %08lx\n", hook, ret ); + dprintf_info(hook, "Ret hook %04x = %08lx\n", hook, ret ); data->flags &= ~HOOK_INUSE; queue->hCurHook = prevHook; @@ -1275,7 +1274,7 @@ BOOL16 WINAPI UnhookWindowsHook16( INT16 id, HOOKPROC16 proc ) { HANDLE16 hook = HOOK_GetHook( id , GetTaskQueue(0) ); - dprintf_hook( stddeb, "UnhookWindowsHook: %d %08lx\n", id, (DWORD)proc ); + dprintf_info(hook, "UnhookWindowsHook: %d %08lx\n", id, (DWORD)proc ); while (hook) { @@ -1295,7 +1294,7 @@ BOOL32 WINAPI UnhookWindowsHook32( INT32 id, HOOKPROC32 proc ) { HANDLE16 hook = HOOK_GetHook( id , GetTaskQueue(0) ); - dprintf_hook( stddeb, "UnhookWindowsHook: %d %08lx\n", id, (DWORD)proc ); + dprintf_info(hook, "UnhookWindowsHook: %d %08lx\n", id, (DWORD)proc ); while (hook) { diff --git a/windows/keyboard.c b/windows/keyboard.c index b99656d3ffd..90189fcaa47 100644 --- a/windows/keyboard.c +++ b/windows/keyboard.c @@ -23,8 +23,6 @@ #include "heap.h" #include "keyboard.h" #include "message.h" -#include "stddebug.h" -/* #define DEBUG_KEYBOARD */ #include "debug.h" #include "struct32.h" @@ -191,12 +189,12 @@ BOOL32 KEYBOARD_Init(void) if (TSXKeycodeToKeysym(display, *kcp, k) == XK_Mode_switch) { AltGrMask = 1 << i; - dprintf_key(stddeb, "AltGrMask is %x\n", AltGrMask); + dprintf_info(key, "AltGrMask is %x\n", AltGrMask); } else if (TSXKeycodeToKeysym(display, *kcp, k) == XK_Num_Lock) { NumLockMask = 1 << i; - dprintf_key(stddeb, "NumLockMask is %x\n", NumLockMask); + dprintf_info(key, "NumLockMask is %x\n", NumLockMask); } } } @@ -283,10 +281,12 @@ BOOL32 KEYBOARD_Init(void) vkey = OEMvkey; - if (debugging_keyboard) + if (debugging_info(keyboard)) { - fprintf(stddeb,"OEM specific virtual key %X assigned to keycode %X :\n (" - ,OEMvkey,e2.keycode); + dbg_decl_str(keyboard, 1024); + + dprintf_info(keyboard, "OEM specific virtual key %X assigned" + "to keycode %X :\n", OEMvkey, e2.keycode); for (i = 0; i < keysyms_per_keycode; i += 1) { char *ksname; @@ -295,9 +295,9 @@ BOOL32 KEYBOARD_Init(void) ksname = TSXKeysymToString(keysym); if (!ksname) ksname = "NoSymbol"; - fprintf(stddeb, "%lX (%s) ", keysym, ksname); + dsprintf(keyboard, "%lX (%s) ", keysym, ksname); } - fprintf(stddeb, ")\n"); + dprintf_info(keyboard, "(%s)\n", dbg_str(keyboard)); } } } @@ -318,14 +318,14 @@ void KEYBOARD_GenerateMsg( WORD vkey, int Evtype, INT32 event_x, INT32 event_y, don't treat it. It's from the same key press. Then the state goes to ON. And from there, a 'release' event will switch off the toggle key. */ *State=FALSE; - dprintf_keyboard(stddeb,"INTERM : don\'t treat release of toggle key. InputKeyStateTable[%#x] = %#x\n",vkey,InputKeyStateTable[vkey]); + dprintf_info(keyboard,"INTERM : don\'t treat release of toggle key. InputKeyStateTable[%#x] = %#x\n",vkey,InputKeyStateTable[vkey]); } else { if ( InputKeyStateTable[vkey] & 0x1 ) /* it was ON */ { if (Evtype!=KeyPress) { - dprintf_keyboard(stddeb,"ON + KeyRelease => generating DOWN and UP messages.\n"); + dprintf_info(keyboard,"ON + KeyRelease => generating DOWN and UP messages.\n"); localkeylp.lp1.previous = 0; /* ? */ localkeylp.lp1.transition = 0; hardware_event( WM_KEYDOWN, vkey, localkeylp.lp2, @@ -339,7 +339,7 @@ void KEYBOARD_GenerateMsg( WORD vkey, int Evtype, INT32 event_x, INT32 event_y, else /* it was OFF */ if (Evtype==KeyPress) { - dprintf_keyboard(stddeb,"OFF + Keypress => generating DOWN and UP messages.\n"); + dprintf_info(keyboard,"OFF + Keypress => generating DOWN and UP messages.\n"); hardware_event( WM_KEYDOWN, vkey, localkeylp.lp2, event_x, event_y, event_time, 0 ); localkeylp.lp1.previous = 1; @@ -372,15 +372,15 @@ void KEYBOARD_HandleEvent( WND *pWnd, XKeyEvent *event ) INT32 event_y = pWnd->rectWindow.top + event->y; DWORD event_time = event->time - MSG_WineStartTicks; - dprintf_key(stddeb, "EVENT_key : state = %X\n", event->state); + dprintf_info(key, "EVENT_key : state = %X\n", event->state); if (keysym == XK_Mode_switch) { - dprintf_key(stddeb, "Alt Gr key event received\n"); + dprintf_info(key, "Alt Gr key event received\n"); event->keycode = TSXKeysymToKeycode(event->display, XK_Control_L); - dprintf_key(stddeb, "Control_L is keycode 0x%x\n", event->keycode); + dprintf_info(key, "Control_L is keycode 0x%x\n", event->keycode); KEYBOARD_HandleEvent( pWnd, event ); event->keycode = TSXKeysymToKeycode(event->display, XK_Alt_L); - dprintf_key(stddeb, "Alt_L is keycode 0x%x\n", event->keycode); + dprintf_info(key, "Alt_L is keycode 0x%x\n", event->keycode); force_extended = TRUE; KEYBOARD_HandleEvent( pWnd, event ); force_extended = FALSE; @@ -388,22 +388,21 @@ void KEYBOARD_HandleEvent( WND *pWnd, XKeyEvent *event ) } Str[ascii_chars] = '\0'; - if (debugging_key) - { + if (debugging_info(key)){ char *ksname; ksname = TSXKeysymToString(keysym); if (!ksname) - ksname = "No Name"; - fprintf(stddeb, "%s : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n", - (event->type == KeyPress) ? "KeyPress" : "KeyRelease", - keysym, ksname, ascii_chars, Str[0] & 0xff, Str); - } + ksname = "No Name"; + dprintf_info(key, "%s : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n", + (event->type == KeyPress) ? "KeyPress" : "KeyRelease", + keysym, ksname, ascii_chars, Str[0] & 0xff, Str); + } vkey = EVENT_event_to_vkey(event); if (force_extended) vkey |= 0x100; - dprintf_key(stddeb, "keycode 0x%x converted to vkey 0x%x\n", + dprintf_info(key, "keycode 0x%x converted to vkey 0x%x\n", event->keycode, vkey); if (vkey) @@ -424,10 +423,10 @@ void KEYBOARD_HandleEvent( WND *pWnd, XKeyEvent *event ) event_time, keylp); break; case VK_CAPITAL: - dprintf_keyboard(stddeb,"Caps Lock event. (type %d). State before : %#.2x\n",event->type,InputKeyStateTable[vkey]); + dprintf_info(keyboard,"Caps Lock event. (type %d). State before : %#.2x\n",event->type,InputKeyStateTable[vkey]); KEYBOARD_GenerateMsg( VK_CAPITAL, event->type, event_x, event_y, event_time, keylp ); - dprintf_keyboard(stddeb,"State after : %#.2x\n",InputKeyStateTable[vkey]); + dprintf_info(keyboard,"State after : %#.2x\n",InputKeyStateTable[vkey]); break; default: { @@ -458,7 +457,7 @@ void KEYBOARD_HandleEvent( WND *pWnd, XKeyEvent *event ) (InputKeyStateTable[VK_MENU] & 0x80)) ? 1 : 0; if (!(InputKeyStateTable[VK_NUMLOCK] & 0x01) != !(event->state & NumLockMask)) { - dprintf_keyboard(stddeb,"Adjusting NumLock state. \n"); + dprintf_info(keyboard,"Adjusting NumLock state. \n"); KEYBOARD_GenerateMsg( VK_NUMLOCK, KeyPress, event_x, event_y, event_time, keylp ); KEYBOARD_GenerateMsg( VK_NUMLOCK, KeyRelease, event_x, event_y, @@ -466,20 +465,20 @@ void KEYBOARD_HandleEvent( WND *pWnd, XKeyEvent *event ) } if (!(InputKeyStateTable[VK_CAPITAL] & 0x01) != !(event->state & LockMask)) { - dprintf_keyboard(stddeb,"Adjusting Caps Lock state. State before %#.2x \n",InputKeyStateTable[VK_CAPITAL]); + dprintf_info(keyboard,"Adjusting Caps Lock state. State before %#.2x \n",InputKeyStateTable[VK_CAPITAL]); KEYBOARD_GenerateMsg( VK_CAPITAL, KeyPress, event_x, event_y, event_time, keylp ); KEYBOARD_GenerateMsg( VK_CAPITAL, KeyRelease, event_x, event_y, event_time, keylp ); - dprintf_keyboard(stddeb,"State after %#.2x \n",InputKeyStateTable[VK_CAPITAL]); + dprintf_info(keyboard,"State after %#.2x \n",InputKeyStateTable[VK_CAPITAL]); } /* End of intermediary states. */ NumState = FALSE; CapsState = FALSE; - dprintf_key(stddeb," wParam=%04X, lParam=%08lX\n", + dprintf_info(key," wParam=%04X, lParam=%08lX\n", vkey, keylp.lp2 ); - dprintf_key(stddeb," InputKeyState=%X\n", + dprintf_info(key," InputKeyState=%X\n", InputKeyStateTable[vkey]); hardware_event( message, vkey, keylp.lp2, @@ -525,7 +524,7 @@ WORD WINAPI GetKeyState32(INT32 vkey) retval = ( (WORD)(QueueKeyStateTable[vkey] & 0x80) << 8 ) | (WORD)(QueueKeyStateTable[vkey] & 0x01); } - dprintf_key(stddeb, "GetKeyState(0x%x) -> %x\n", vkey, retval); + dprintf_info(key, "GetKeyState(0x%x) -> %x\n", vkey, retval); return retval; } @@ -537,7 +536,7 @@ WORD WINAPI GetKeyState32(INT32 vkey) */ VOID WINAPI GetKeyboardState(LPBYTE lpKeyState) { - dprintf_key(stddeb, "GetKeyboardState()\n"); + dprintf_info(key, "GetKeyboardState()\n"); if (lpKeyState != NULL) { QueueKeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] ? 0x80 : 0; QueueKeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] ? 0x80 : 0; @@ -551,7 +550,7 @@ VOID WINAPI GetKeyboardState(LPBYTE lpKeyState) */ VOID WINAPI SetKeyboardState(LPBYTE lpKeyState) { - dprintf_key(stddeb, "SetKeyboardState()\n"); + dprintf_info(key, "SetKeyboardState()\n"); if (lpKeyState != NULL) { memcpy(QueueKeyStateTable, lpKeyState, 256); MouseButtonsStates[0] = (QueueKeyStateTable[VK_LBUTTON] != 0); @@ -600,7 +599,7 @@ WORD WINAPI GetAsyncKeyState32(INT32 nKey) memset( AsyncMouseButtonsStates, 0, sizeof(AsyncMouseButtonsStates) ); memset( AsyncKeyStateTable, 0, sizeof(AsyncKeyStateTable) ); - dprintf_key(stddeb, "GetAsyncKeyState(%x) -> %x\n", nKey, retval); + dprintf_info(key, "GetAsyncKeyState(%x) -> %x\n", nKey, retval); return retval; } @@ -635,13 +634,14 @@ static BOOL32 KBD_translate_accelerator(HWND32 hWnd,LPMSG32 msg, if (msg->message == WM_CHAR) { if ( !(fVirt & FALT) && !(fVirt & FVIRTKEY) ) { - dprintf_accel(stddeb,"found accel for WM_CHAR: ('%c')",msg->wParam&0xff); + dprintf_info(accel,"found accel for WM_CHAR: ('%c')\n", + msg->wParam&0xff); sendmsg=TRUE; } } else { if(fVirt & FVIRTKEY) { INT32 mask = 0; - dprintf_accel(stddeb,"found accel for virt_key %04x (scan %04x)", + dprintf_info(accel,"found accel for virt_key %04x (scan %04x)\n", msg->wParam,0xff & HIWORD(msg->lParam)); if(GetKeyState32(VK_SHIFT) & 0x8000) mask |= FSHIFT; if(GetKeyState32(VK_CONTROL) & 0x8000) mask |= FCONTROL; @@ -649,7 +649,7 @@ static BOOL32 KBD_translate_accelerator(HWND32 hWnd,LPMSG32 msg, if(mask == (fVirt & (FSHIFT | FCONTROL | FALT))) sendmsg=TRUE; else - dprintf_accel(stddeb,", but incorrect SHIFT/CTRL/ALT-state\n"); + dprintf_info(accel,", but incorrect SHIFT/CTRL/ALT-state\n"); } else { @@ -657,7 +657,7 @@ static BOOL32 KBD_translate_accelerator(HWND32 hWnd,LPMSG32 msg, { if ((fVirt & FALT) && (msg->lParam & 0x20000000)) { /* ^^ ALT pressed */ - dprintf_accel(stddeb,"found accel for Alt-%c", msg->wParam&0xff); + dprintf_info(accel,"found accel for Alt-%c\n", msg->wParam&0xff); sendmsg=TRUE; } } @@ -714,7 +714,7 @@ static BOOL32 KBD_translate_accelerator(HWND32 hWnd,LPMSG32 msg, } if ( mesg==WM_COMMAND || mesg==WM_SYSCOMMAND ) { - dprintf_accel(stddeb,", sending %s, wParam=%0x\n", + dprintf_info(accel,", sending %s, wParam=%0x\n", mesg==WM_COMMAND ? "WM_COMMAND" : "WM_SYSCOMMAND", cmd); SendMessage32A(hWnd, mesg, cmd, 0x00010000L); @@ -730,7 +730,9 @@ static BOOL32 KBD_translate_accelerator(HWND32 hWnd,LPMSG32 msg, * #5: it's a menu option, but window is iconic * #6: it's a menu option, but disabled */ - dprintf_accel(stddeb,", but won't send WM_{SYS}COMMAND, reason is #%d\n",mesg); + dprintf_info(accel,", but won't send WM_{SYS}COMMAND, reason is #%d\n",mesg); + if(mesg==0) + dprintf_err(accel, " unknown reason - please report!"); } return TRUE; } @@ -750,7 +752,7 @@ INT32 WINAPI TranslateAccelerator32(HWND32 hWnd, HACCEL32 hAccel, LPMSG32 msg) msg->message != WM_SYSKEYUP && msg->message != WM_CHAR) return 0; - dprintf_accel(stddeb, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\ + dprintf_info(accel, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\ msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message); for (i = 0; lpAccelTbl[i].key ; i++) @@ -773,7 +775,7 @@ INT16 WINAPI TranslateAccelerator16(HWND16 hWnd, HACCEL16 hAccel, LPMSG16 msg) msg->message != WM_SYSKEYUP && msg->message != WM_CHAR) return 0; - dprintf_accel(stddeb, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\ + dprintf_info(accel, "TranslateAccelerators hAccel=%04x, hWnd=%04x,\ msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message); STRUCT32_MSG16to32(msg,&msg32); @@ -791,7 +793,7 @@ msg->hwnd=%04x, msg->message=%04x\n", hAccel,hWnd,msg->hwnd,msg->message); */ DWORD WINAPI OemKeyScan(WORD wOemChar) { - dprintf_keyboard(stddeb,"*OemKeyScan (%d)\n",wOemChar); + dprintf_info(keyboard,"*OemKeyScan (%d)\n",wOemChar); return wOemChar; } @@ -831,8 +833,8 @@ WORD WINAPI VkKeyScan32A(CHAR cChar) keycode = TSXKeysymToKeycode(display, keysym | 0xFE00); } - dprintf_keyboard(stddeb,"VkKeyScan '%c'(%#lx, %lu) : got keycode %#.2x ", - cChar,keysym,keysym,keycode); + dprintf_info(keyboard,"VkKeyScan '%c'(%#lx, %lu): got keycode %#.2x\n", + cChar,keysym,keysym,keycode); if (keycode) { @@ -854,7 +856,7 @@ WORD WINAPI VkKeyScan32A(CHAR cChar) index : ? adds 0x0700 (ctrl+alt+shift (used?)) */ } - dprintf_keyboard(stddeb," ... returning %#.2x\n", keyc2vkey[keycode]+highbyte); + dprintf_info(keyboard," ... returning %#.2x\n", keyc2vkey[keycode]+highbyte); return keyc2vkey[keycode]+highbyte; /* keycode -> (keyc2vkey) vkey */ } @@ -887,7 +889,7 @@ INT16 WINAPI GetKeyboardType16(INT16 nTypeFlag) */ INT32 WINAPI GetKeyboardType32(INT32 nTypeFlag) { - dprintf_keyboard(stddeb,"GetKeyboardType(%d)\n",nTypeFlag); + dprintf_info(keyboard,"GetKeyboardType(%d)\n",nTypeFlag); switch(nTypeFlag) { case 0: /* Keyboard type */ @@ -928,9 +930,10 @@ UINT32 WINAPI MapVirtualKey32W(UINT32 code, UINT32 maptype) */ UINT16 WINAPI MapVirtualKey16(UINT16 wCode, UINT16 wMapType) { -#define returnMVK(value) { dprintf_keyboard(stddeb,"returning 0x%x.\n",value); return value; } +#define returnMVK(value) { dprintf_info(keyboard,"returning 0x%x.\n",value); return value; } - dprintf_keyboard(stddeb,"MapVirtualKey wCode=0x%x wMapType=%d ... ",wCode,wMapType); + dprintf_info(keyboard,"MapVirtualKey wCode=0x%x wMapType=%d ... \n", + wCode,wMapType); switch(wMapType) { case 0: { /* vkey-code to scan-code */ /* let's do vkey -> keycode -> scan */ @@ -974,7 +977,7 @@ UINT16 WINAPI MapVirtualKey16(UINT16 wCode, UINT16 wMapType) */ INT16 WINAPI GetKBCodePage16(void) { - dprintf_keyboard(stddeb,"GetKBCodePage()\n"); + dprintf_info(keyboard,"GetKBCodePage()\n"); return 850; } @@ -984,7 +987,7 @@ INT16 WINAPI GetKBCodePage16(void) */ UINT32 WINAPI GetKBCodePage32(void) { - dprintf_keyboard(stddeb,"GetKbCodePage()\n"); + dprintf_info(keyboard,"GetKbCodePage()\n"); return 850; } @@ -1017,7 +1020,7 @@ INT16 WINAPI GetKeyNameText16(LONG lParam, LPSTR lpBuffer, INT16 nSize) { /* int i; */ - dprintf_keyboard(stddeb,"GetKeyNameText(%ld,,%d)\n",lParam,nSize); + dprintf_info(keyboard,"GetKeyNameText(%ld,,%d)\n",lParam,nSize); lParam >>= 16; lParam &= 0xff; @@ -1065,7 +1068,7 @@ INT32 WINAPI ToAscii32( UINT32 virtKey,UINT32 scanCode,LPBYTE lpKeyState, { if ((e.keycode) && ((virtKey<0x10) || (virtKey>0x12))) /* it's normal to have 2 shift, control, and alt ! */ - dprintf_keyboard(stddeb,"ToAscii : The keycodes %d and %d are matching the same vkey %#X\n", + dprintf_info(keyboard,"ToAscii : The keycodes %d and %d are matching the same vkey %#X\n", e.keycode,keyc,virtKey); e.keycode = keyc; } @@ -1085,7 +1088,7 @@ INT32 WINAPI ToAscii32( UINT32 virtKey,UINT32 scanCode,LPBYTE lpKeyState, e.state = 0; if (lpKeyState[VK_SHIFT] & 0x80) e.state |= ShiftMask; - dprintf_keyboard(stddeb,"ToAscii : lpKeyState[0x14(VK_CAPITAL)]=%#x\n",lpKeyState[VK_CAPITAL]); + dprintf_info(keyboard,"ToAscii : lpKeyState[0x14(VK_CAPITAL)]=%#x\n",lpKeyState[VK_CAPITAL]); if (lpKeyState[VK_CAPITAL] & 0x01) e.state |= LockMask; if (lpKeyState[VK_CONTROL] & 0x80) @@ -1095,7 +1098,7 @@ INT32 WINAPI ToAscii32( UINT32 virtKey,UINT32 scanCode,LPBYTE lpKeyState, e.state |= ControlMask; if (lpKeyState[VK_NUMLOCK] & 0x01) e.state |= NumLockMask; - dprintf_key(stddeb, "ToAscii(%04X, %04X) : faked state = %X\n", + dprintf_info(key, "ToAscii(%04X, %04X) : faked state = %X\n", virtKey, scanCode, e.state); ret = TSXLookupString(&e, (LPVOID)lpChar, 2, &keysym, &cs); if (ret == 0) @@ -1209,7 +1212,7 @@ INT32 WINAPI ToAscii32( UINT32 virtKey,UINT32 scanCode,LPBYTE lpKeyState, } } } - dprintf_key(stddeb, "ToAscii about to return %d with char %x\n", + dprintf_info(key, "ToAscii about to return %d with char %x\n", ret, *(char*)lpChar); return ret; } diff --git a/windows/mdi.c b/windows/mdi.c index e2049fd89ad..6bae6743d65 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -26,7 +26,6 @@ #include "resource.h" #include "struct32.h" #include "sysmetrics.h" -#include "stddebug.h" #include "debug.h" #define MDIF_NEEDUPDATE 0x0001 @@ -113,7 +112,7 @@ static BOOL32 MDI_MenuDeleteItem(WND* clientWnd, HWND32 hWndChild ) wndPtr = WIN_FindWndPtr(MDI_GetChildByID(clientWnd,index)); if( !wndPtr ) { - dprintf_mdi(stddeb,"MDIMenuDeleteItem: no window for id=%i\n",index); + dprintf_info(mdi,"MDIMenuDeleteItem: no window for id=%i\n",index); continue; } @@ -195,7 +194,7 @@ static LRESULT MDISetMenu( HWND32 hwnd, HMENU32 hmenuFrame, HWND32 hwndFrame = GetParent32(hwnd); HMENU32 oldFrameMenu = GetMenu32(hwndFrame); - dprintf_mdi(stddeb, "WM_MDISETMENU: %04x %04x %04x\n", + dprintf_info(mdi, "WM_MDISETMENU: %04x %04x %04x\n", hwnd, hmenuFrame, hmenuWindow); ci = (MDICLIENTINFO *) w->wExtra; @@ -265,7 +264,7 @@ static HWND32 MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND32 parent, WORD wIDmenu = ci->idFirstChild + ci->nActiveChildren; char lpstrDef[]="junk!"; - dprintf_mdi(stdnimp,"MDICreateChild: origin %i,%i - dim %i,%i, style %08x\n", + dprintf_info(mdi, "MDICreateChild: origin %i,%i - dim %i,%i, style %08x\n", cs->x, cs->y, cs->cx, cs->cy, (unsigned)cs->style); /* calculate placement */ MDI_CalcDefaultChildPos(w, ci->nTotalCreated++, pos, 0); @@ -354,7 +353,7 @@ static HWND32 MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND32 parent, MDI_UpdateFrameText( w->parent, ci->self, MDI_REPAINTFRAME, NULL ); } } - dprintf_mdi(stddeb, "MDICreateChild: created child - %04x\n",hwnd); + dprintf_info(mdi, "MDICreateChild: created child - %04x\n",hwnd); } else { @@ -389,7 +388,7 @@ static void MDI_ChildGetMinMaxInfo( WND* clientWnd, HWND32 hwnd, lpMinMax->ptMaxPosition.x = rect.left; lpMinMax->ptMaxPosition.y = rect.top; - dprintf_mdi(stddeb,"\tChildMinMaxInfo: max rect (%i,%i - %i, %i)\n", + dprintf_info(mdi,"\tChildMinMaxInfo: max rect (%i,%i - %i, %i)\n", rect.left,rect.top,rect.right,rect.bottom); } @@ -411,7 +410,7 @@ static void MDI_SwitchActiveChild( HWND32 clientHwnd, HWND32 childHwnd, ci = (MDICLIENTINFO *) w->wExtra; - dprintf_mdi(stddeb, "MDI_SwitchActiveChild: from %04x, to %04x\n",childHwnd,hwndTo); + dprintf_info(mdi, "MDI_SwitchActiveChild: from %04x, to %04x\n",childHwnd,hwndTo); if ( !hwndTo ) return; /* no window to switch to */ @@ -471,7 +470,7 @@ static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci, ci->nActiveChildren--; - dprintf_mdi(stddeb,"MDIDestroyChild: child destroyed - %04x\n",child); + dprintf_info(mdi,"MDIDestroyChild: child destroyed - %04x\n",child); if (flagDestroy) { @@ -502,7 +501,7 @@ static LONG MDI_ChildActivate( WND *clientPtr, HWND32 hWndChild ) if( wndPtr ) if( wndPtr->dwStyle & WS_DISABLED ) return 0L; - dprintf_mdi(stddeb,"MDI_ChildActivate: %04x\n", hWndChild); + dprintf_info(mdi,"MDI_ChildActivate: %04x\n", hWndChild); if( GetActiveWindow32() == clientPtr->parent->hwndSelf ) isActiveFrameWnd = TRUE; @@ -626,7 +625,7 @@ static LONG MDICascade(WND* clientWnd, MDICLIENTINFO *ci) /* walk the list and move windows */ while ( *ppWnd ) { - dprintf_mdi(stddeb, "MDICascade: move %04x to (%d,%d) size [%d,%d]\n", + dprintf_info(mdi, "MDICascade: move %04x to (%d,%d) size [%d,%d]\n", (*ppWnd)->hwndSelf, pos[0].x, pos[0].y, pos[1].x, pos[1].y); MDI_CalcDefaultChildPos(clientWnd, n++, pos, delta); @@ -660,7 +659,7 @@ static void MDITile( WND* wndClient, MDICLIENTINFO *ci, WPARAM32 wParam ) ppWnd = WIN_BuildWinArray(wndClient, BWA_SKIPHIDDEN | BWA_SKIPOWNED | BWA_SKIPICONIC | ((wParam & MDITILE_SKIPDISABLED)? BWA_SKIPDISABLED : 0), &total ); - dprintf_mdi(stddeb,"MDITile: %u windows to tile\n", total); + dprintf_info(mdi,"MDITile: %u windows to tile\n", total); if( ppWnd ) { @@ -729,7 +728,7 @@ static BOOL32 MDI_AugmentFrameMenu( MDICLIENTINFO* ci, WND *frame, WND* child = WIN_FindWndPtr(hChild); HMENU32 hSysPopup = 0; - dprintf_mdi(stddeb,"MDI_AugmentFrameMenu: frame %p,child %04x\n",frame,hChild); + dprintf_info(mdi,"MDI_AugmentFrameMenu: frame %p,child %04x\n",frame,hChild); if( !frame->wIDmenu || !child->hSysMenu ) return 0; @@ -738,7 +737,8 @@ static BOOL32 MDI_AugmentFrameMenu( MDICLIENTINFO* ci, WND *frame, if (!(hSysPopup = LoadMenuIndirect32A(SYSRES_GetResPtr(SYSRES_MENU_SYSMENU)))) return 0; - dprintf_mdi(stddeb,"\t\tgot popup %04x\n in sysmenu %04x",hSysPopup,child->hSysMenu); + dprintf_info(mdi,"\tgot popup %04x in sysmenu %04x\n", + hSysPopup, child->hSysMenu); if( !InsertMenu32A(frame->wIDmenu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP, hSysPopup, (LPSTR)(DWORD)hBmpClose )) @@ -771,7 +771,7 @@ static BOOL32 MDI_RestoreFrameMenu( WND *frameWnd, HWND32 hChild ) { INT32 nItems = GetMenuItemCount32(frameWnd->wIDmenu) - 1; - dprintf_mdi(stddeb,"MDI_RestoreFrameMenu: for child %04x\n",hChild); + dprintf_info(mdi,"MDI_RestoreFrameMenu: for child %04x\n",hChild); if( GetMenuItemID32(frameWnd->wIDmenu,nItems) != SC_RESTORE ) return 0; @@ -798,7 +798,7 @@ static void MDI_UpdateFrameText( WND *frameWnd, HWND32 hClient, WND* clientWnd = WIN_FindWndPtr(hClient); MDICLIENTINFO *ci = (MDICLIENTINFO *) clientWnd->wExtra; - dprintf_mdi(stddeb, "MDI: repaint %i, frameText %s\n", repaint, (lpTitle)?lpTitle:"NULL"); + dprintf_info(mdi, "MDI: repaint %i, frameText %s\n", repaint, (lpTitle)?lpTitle:"NULL"); if (!clientWnd) return; @@ -925,7 +925,7 @@ LRESULT WINAPI MDIClientWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam, NC_HandleNCCalcSize( w, &rect ); w->rectClient = rect; - dprintf_mdi(stddeb,"MDI: Client created - hwnd = %04x, idFirst = %u\n", + dprintf_info(mdi,"MDI: Client created - hwnd = %04x, idFirst = %u\n", hwnd, ci->idFirstChild ); return 0; @@ -1017,7 +1017,7 @@ LRESULT WINAPI MDIClientWndProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam, POINT16 pt = MAKEPOINT16(lParam); HWND16 child = ChildWindowFromPoint16(hwnd, pt); - dprintf_mdi(stddeb,"MDIClient: notification from %04x (%i,%i)\n",child,pt.x,pt.y); + dprintf_info(mdi,"MDIClient: notification from %04x (%i,%i)\n",child,pt.x,pt.y); if( child && child != hwnd && child != ci->hwndActiveChild ) SetWindowPos32(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE ); @@ -1265,7 +1265,7 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message, return 0; case WM_NCPAINT: - dprintf_mdi(stddeb,"DefMDIChildProc: WM_NCPAINT for %04x, active %04x\n", + dprintf_info(mdi,"DefMDIChildProc: WM_NCPAINT for %04x, active %04x\n", hwnd, ci->hwndActiveChild ); break; @@ -1332,7 +1332,7 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message, SendMessage16( hMaxChild, WM_SETREDRAW, TRUE, 0L ); } - dprintf_mdi(stddeb,"\tMDI: maximizing child %04x\n", hwnd ); + dprintf_info(mdi,"\tMDI: maximizing child %04x\n", hwnd ); ci->hwndChildMaximized = hwnd; /* !!! */ @@ -1523,7 +1523,7 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg ) default: return 0; } - dprintf_mdi(stddeb,"TranslateMDISysAccel: wParam = %04x\n", wParam); + dprintf_info(mdi,"TranslateMDISysAccel: wParam = %04x\n", wParam); SendMessage16( ci->hwndActiveChild, WM_SYSCOMMAND, wParam, (LPARAM)msg->wParam); return 1; diff --git a/windows/message.c b/windows/message.c index 5ac2407db7d..6b627a0711f 100644 --- a/windows/message.c +++ b/windows/message.c @@ -24,8 +24,6 @@ #include "queue.h" #include "winproc.h" #include "options.h" -#include "stddebug.h" -/* #define DEBUG_MSG */ #include "debug.h" #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE @@ -357,7 +355,7 @@ static int MSG_JournalPlayBackMsg(void) tmpMsg = SEGPTR_NEW(EVENTMSG16); wtime=HOOK_CallHooks16( WH_JOURNALPLAYBACK, HC_GETNEXT, 0, (LPARAM)SEGPTR_GET(tmpMsg)); - /* dprintf_msg(stddeb,"Playback wait time =%ld\n",wtime); */ + /* dprintf_info(msg,"Playback wait time =%ld\n",wtime); */ if (wtime<=0) { wtime=0; @@ -598,12 +596,12 @@ static LRESULT MSG_SendMessage( HQUEUE16 hDestQueue, HWND16 hwnd, UINT16 msg, if (IsTaskLocked() || !IsWindow32(hwnd)) return 0; debugSMRL+=4; - dprintf_sendmsg(stddeb,"%*sSM: %s [%04x] (%04x -> %04x)\n", + dprintf_info(sendmsg,"%*sSM: %s [%04x] (%04x -> %04x)\n", prevSMRL, "", SPY_GetMsgName(msg), msg, queue->self, hDestQueue ); if( !(queue->wakeBits & QS_SMPARAMSFREE) ) { - dprintf_sendmsg(stddeb,"\tIntertask SendMessage: sleeping since unreplied SendMessage pending\n"); + dprintf_info(sendmsg,"\tIntertask SendMessage: sleeping since unreplied SendMessage pending\n"); queue->changeBits &= ~QS_SMPARAMSFREE; QUEUE_WaitBits( QS_SMPARAMSFREE ); } @@ -621,7 +619,7 @@ static LRESULT MSG_SendMessage( HQUEUE16 hDestQueue, HWND16 hwnd, UINT16 msg, queue->wakeBits &= ~QS_SMPARAMSFREE; queue->flags = (queue->flags & ~(QUEUE_SM_WIN32|QUEUE_SM_UNICODE)) | flags; - dprintf_sendmsg(stddeb,"%*ssm: smResultInit = %08x\n", prevSMRL, "", (unsigned)&qCtrl); + dprintf_info(sendmsg,"%*ssm: smResultInit = %08x\n", prevSMRL, "", (unsigned)&qCtrl); queue->smResultInit = &qCtrl; @@ -636,11 +634,11 @@ static LRESULT MSG_SendMessage( HQUEUE16 hDestQueue, HWND16 hwnd, UINT16 msg, queue->changeBits &= ~QS_SMRESULT; DirectedYield( destQ->hTask ); QUEUE_WaitBits( QS_SMRESULT ); - dprintf_sendmsg(stddeb,"\tsm: have result!\n"); + dprintf_info(sendmsg,"\tsm: have result!\n"); } /* got something */ - dprintf_sendmsg(stddeb,"%*ssm: smResult = %08x\n", prevSMRL, "", (unsigned)queue->smResult ); + dprintf_info(sendmsg,"%*ssm: smResult = %08x\n", prevSMRL, "", (unsigned)queue->smResult ); if (queue->smResult) { /* FIXME, smResult should always be set */ queue->smResult->lResult = queue->SendMessageReturn; @@ -649,11 +647,11 @@ static LRESULT MSG_SendMessage( HQUEUE16 hDestQueue, HWND16 hwnd, UINT16 msg, queue->wakeBits &= ~QS_SMRESULT; if( queue->smResult != &qCtrl ) - dprintf_sendmsg(stddeb,"%*ssm: weird scenes inside the goldmine!\n", prevSMRL, ""); + dprintf_err(sendmsg, "%*ssm: weird scenes inside the goldmine!\n", prevSMRL, ""); } queue->smResultInit = NULL; - dprintf_sendmsg(stddeb,"%*sSM: [%04x] returning %08lx\n", prevSMRL, "", msg, qCtrl.lResult); + dprintf_info(sendmsg,"%*sSM: [%04x] returning %08lx\n", prevSMRL, "", msg, qCtrl.lResult); debugSMRL-=4; return qCtrl.lResult; @@ -670,11 +668,11 @@ void WINAPI ReplyMessage16( LRESULT result ) if (!(queue = (MESSAGEQUEUE*)GlobalLock16( GetTaskQueue(0) ))) return; - dprintf_msg(stddeb,"ReplyMessage, queue %04x\n", queue->self); + dprintf_info(msg,"ReplyMessage, queue %04x\n", queue->self); while( (senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->InSendMessageHandle))) { - dprintf_msg(stddeb,"\trpm: replying to %04x (%04x -> %04x)\n", + dprintf_info(msg,"\trpm: replying to %04x (%04x -> %04x)\n", queue->msg, queue->self, senderQ->self); if( queue->wakeBits & QS_SENDMESSAGE ) @@ -686,10 +684,10 @@ void WINAPI ReplyMessage16( LRESULT result ) if(!(senderQ->wakeBits & QS_SMRESULT) ) break; OldYield(); } - if( !senderQ ) { dprintf_msg(stddeb,"\trpm: done\n"); return; } + if( !senderQ ) { dprintf_info(msg,"\trpm: done\n"); return; } senderQ->SendMessageReturn = result; - dprintf_msg(stddeb,"\trpm: smResult = %08x, result = %08lx\n", + dprintf_info(msg,"\trpm: smResult = %08x, result = %08lx\n", (unsigned)queue->smResultCurrent, result ); senderQ->smResult = queue->smResultCurrent; @@ -939,7 +937,7 @@ BOOL16 WINAPI GetMessage16( SEGPTR msg, HWND16 hwnd, UINT16 first, UINT16 last) MSG_PeekMessage( lpmsg, hwnd, first, last, PM_REMOVE, FALSE ); - dprintf_msg(stddeb,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message, + dprintf_info(msg,"message %04x, hwnd %04x, filter(%04x - %04x)\n", lpmsg->message, hwnd, first, last ); HOOK_CallHooks16( WH_GETMESSAGE, HC_ACTION, 0, (LPARAM)msg ); return (lpmsg->message != WM_QUIT); @@ -970,17 +968,17 @@ BOOL16 WINAPI PostMessage16( HWND16 hwnd, UINT16 message, WPARAM16 wParam, if (hwnd == HWND_BROADCAST) { - dprintf_msg(stddeb,"PostMessage // HWND_BROADCAST !\n"); + dprintf_info(msg,"PostMessage // HWND_BROADCAST !\n"); for (wndPtr = WIN_GetDesktop()->child; wndPtr; wndPtr = wndPtr->next) { if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION) { - dprintf_msg(stddeb,"BROADCAST Message to hWnd=%04x m=%04X w=%04X l=%08lX !\n", + dprintf_info(msg,"BROADCAST Message to hWnd=%04x m=%04X w=%04X l=%08lX !\n", wndPtr->hwndSelf, message, wParam, lParam); PostMessage16( wndPtr->hwndSelf, message, wParam, lParam ); } } - dprintf_msg(stddeb,"PostMessage // End of HWND_BROADCAST !\n"); + dprintf_info(msg,"PostMessage // End of HWND_BROADCAST !\n"); return TRUE; } @@ -1053,20 +1051,20 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, { if (!(list = WIN_BuildWinArray( WIN_GetDesktop(), 0, NULL ))) return TRUE; - dprintf_msg(stddeb,"SendMessage // HWND_BROADCAST !\n"); + dprintf_info(msg,"SendMessage // HWND_BROADCAST !\n"); for (ppWnd = list; *ppWnd; ppWnd++) { wndPtr = *ppWnd; if (!IsWindow32(wndPtr->hwndSelf)) continue; if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION) { - dprintf_msg(stddeb,"BROADCAST Message to hWnd=%04x m=%04X w=%04lX l=%08lX !\n", + dprintf_info(msg,"BROADCAST Message to hWnd=%04x m=%04X w=%04lX l=%08lX !\n", wndPtr->hwndSelf, msg, (DWORD)wParam, lParam); SendMessage16( wndPtr->hwndSelf, msg, wParam, lParam ); } } HeapFree( SystemHeap, 0, list ); - dprintf_msg(stddeb,"SendMessage // End of HWND_BROADCAST !\n"); + dprintf_info(msg,"SendMessage // End of HWND_BROADCAST !\n"); return TRUE; } @@ -1424,15 +1422,16 @@ static BOOL32 MSG_DoTranslateMessage( UINT32 message, HWND32 hwnd, static int dead_char; BYTE wp[2]; - if ((debugging_msg && message != WM_MOUSEMOVE && message != WM_TIMER) - || (debugging_key - && message >= WM_KEYFIRST && message <= WM_KEYLAST)) - fprintf(stddeb, "TranslateMessage(%s, %04X, %08lX)\n", - SPY_GetMsgName(message), wParam, lParam ); + if (message != WM_MOUSEMOVE && message != WM_TIMER) + dprintf_info(msg, "TranslateMessage(%s, %04X, %08lX)\n", + SPY_GetMsgName(message), wParam, lParam ); + if(message >= WM_KEYFIRST && message <= WM_KEYLAST) + dprintf_info(key, "TranslateMessage(%s, %04X, %08lX)\n", + SPY_GetMsgName(message), wParam, lParam ); if ((message != WM_KEYDOWN) && (message != WM_SYSKEYDOWN)) return FALSE; - dprintf_key( stddeb, "Translating key %04X, scancode %04X\n", + dprintf_info(key, "Translating key %04X, scancode %04X\n", wParam, HIWORD(lParam) ); /* FIXME : should handle ToAscii yielding 2 */ @@ -1463,14 +1462,14 @@ static BOOL32 MSG_DoTranslateMessage( UINT32 message, HWND32 hwnd, } dead_char = 0; } - dprintf_key(stddeb, "1 -> PostMessage(%s)\n", SPY_GetMsgName(message)); + dprintf_info(key, "1 -> PostMessage(%s)\n", SPY_GetMsgName(message)); PostMessage16( hwnd, message, wp[0], lParam ); return TRUE; case -1 : message = (message == WM_KEYDOWN) ? WM_DEADCHAR : WM_SYSDEADCHAR; dead_char = wp[0]; - dprintf_key( stddeb, "-1 -> PostMessage(%s)\n", + dprintf_info(key, "-1 -> PostMessage(%s)\n", SPY_GetMsgName(message)); PostMessage16( hwnd, message, wp[0], lParam ); return TRUE; @@ -1643,7 +1642,7 @@ LONG WINAPI DispatchMessage32W( const MSG32* msg ) */ WORD WINAPI RegisterWindowMessage16( SEGPTR str ) { - dprintf_msg(stddeb, "RegisterWindowMessage16: %08lx\n", (DWORD)str ); + dprintf_info(msg, "RegisterWindowMessage16: %08lx\n", (DWORD)str ); return GlobalAddAtom16( str ); } @@ -1653,7 +1652,7 @@ WORD WINAPI RegisterWindowMessage16( SEGPTR str ) */ WORD WINAPI RegisterWindowMessage32A( LPCSTR str ) { - dprintf_msg(stddeb, "RegisterWindowMessage32A: %s\n", str ); + dprintf_info(msg, "RegisterWindowMessage32A: %s\n", str ); return GlobalAddAtom32A( str ); } @@ -1663,7 +1662,7 @@ WORD WINAPI RegisterWindowMessage32A( LPCSTR str ) */ WORD WINAPI RegisterWindowMessage32W( LPCWSTR str ) { - dprintf_msg(stddeb, "RegisterWindowMessage32W: %p\n", str ); + dprintf_info(msg, "RegisterWindowMessage32W: %p\n", str ); return GlobalAddAtom32W( str ); } diff --git a/windows/nonclient.c b/windows/nonclient.c index 145ded00f90..03ebe517b75 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -21,7 +21,6 @@ #include "graphics.h" #include "queue.h" #include "selectors.h" -#include "stddebug.h" #include "tweak.h" #include "debug.h" #include "options.h" @@ -202,7 +201,7 @@ BOOL16 WINAPI AdjustWindowRectEx16( LPRECT16 rect, DWORD style, exStyle &= WS_EX_DLGMODALFRAME; if (exStyle & WS_EX_DLGMODALFRAME) style &= ~WS_THICKFRAME; - dprintf_nonclient(stddeb, "AdjustWindowRectEx: (%d,%d)-(%d,%d) %08lx %d %08lx\n", + dprintf_info(nonclient, "AdjustWindowRectEx: (%d,%d)-(%d,%d) %08lx %d %08lx\n", rect->left, rect->top, rect->right, rect->bottom, style, menu, exStyle ); @@ -256,7 +255,7 @@ LONG NC_HandleNCCalcSize( WND *pWnd, RECT32 *winRect ) winRect->bottom -= tmpRect.bottom; if (HAS_MENU(pWnd)) { - dprintf_nonclient( stddeb, "NC_HandleNCCalcSize: Calling " + dprintf_info(nonclient, "NC_HandleNCCalcSize: Calling " "GetMenuBarHeight with HWND 0x%x, width %d, " "at (%d, %d).\n", pWnd->hwndSelf, winRect->right - winRect->left, @@ -323,7 +322,7 @@ LONG NC_HandleNCHitTest( HWND32 hwnd, POINT16 pt ) WND *wndPtr = WIN_FindWndPtr( hwnd ); if (!wndPtr) return HTERROR; - dprintf_nonclient(stddeb, "NC_HandleNCHitTest: hwnd=%04x pt=%d,%d\n", + dprintf_info(nonclient, "NC_HandleNCHitTest: hwnd=%04x pt=%d,%d\n", hwnd, pt.x, pt.y ); GetWindowRect16( hwnd, &rect ); @@ -1013,7 +1012,7 @@ void NC_DoNCPaint( WND* wndPtr, HRGN32 clip, BOOL32 suppress_menupaint ) active = wndPtr->flags & WIN_NCACTIVATED; - dprintf_nonclient(stddeb, "NC_DoNCPaint: %04x %d\n", hwnd, active ); + dprintf_info(nonclient, "NC_DoNCPaint: %04x %d\n", hwnd, active ); if (!(hdc = GetDCEx32( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return; @@ -1120,7 +1119,7 @@ void NC_DoNCPaint95( active = wndPtr->flags & WIN_NCACTIVATED; - dprintf_nonclient(stddeb, "NC_DoNCPaint95: %04x %d\n", hwnd, active ); + dprintf_info(nonclient, "NC_DoNCPaint95: %04x %d\n", hwnd, active ); if (!(hdc = GetDCEx32( hwnd, 0, DCX_USESTYLE | DCX_WINDOW ))) return; @@ -1173,14 +1172,14 @@ void NC_DoNCPaint95( r.bottom = rect.top + sysMetrics[SM_CYMENU] - sysMetrics[SM_CYBORDER]; r.top -= sysMetrics[SM_CYBORDER]; - dprintf_nonclient(stddeb, "DoNCPaint95: Calling DrawMenuBar with " + dprintf_info(nonclient, "DoNCPaint95: Calling DrawMenuBar with " "rect (%d, %d)-(%d, %d)\n", r.left, r.top, r.right, r.bottom); rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint ); } - dprintf_nonclient( stddeb, "After MenuBar, rect is (%d, %d)-(%d, %d).\n", + dprintf_info(nonclient, "After MenuBar, rect is (%d, %d)-(%d, %d).\n", rect.left, rect.top, rect.right, rect.bottom ); /* Draw the inner frames */ @@ -1882,7 +1881,7 @@ LONG NC_HandleSysCommand( HWND32 hwnd, WPARAM16 wParam, POINT16 pt ) POINT32 pt32; UINT16 uCommand = wParam & 0xFFF0; - dprintf_nonclient(stddeb, "Handling WM_SYSCOMMAND %x %d,%d\n", + dprintf_info(nonclient, "Handling WM_SYSCOMMAND %x %d,%d\n", wParam, pt.x, pt.y ); if (wndPtr->dwStyle & WS_CHILD && uCommand != SC_KEYMENU ) diff --git a/windows/painting.c b/windows/painting.c index 9baba58eb4d..20c8b1219f6 100644 --- a/windows/painting.c +++ b/windows/painting.c @@ -14,8 +14,6 @@ #include "gdi.h" #include "dce.h" #include "heap.h" -#include "stddebug.h" -/* #define DEBUG_WIN */ #include "debug.h" /* Last CTLCOLOR id */ @@ -30,7 +28,7 @@ void WIN_UpdateNCArea(WND* wnd, BOOL32 bUpdate) POINT16 pt = {0, 0}; HRGN32 hClip = 1; - dprintf_nonclient(stddeb,"NCUpdate: hwnd %04x, hrgnUpdate %04x\n", + dprintf_info(nonclient,"NCUpdate: hwnd %04x, hrgnUpdate %04x\n", wnd->hwndSelf, wnd->hrgnUpdate ); /* desktop window doesn't have nonclient area */ @@ -112,7 +110,7 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps ) HideCaret32( hwnd ); - dprintf_win(stddeb,"hrgnUpdate = %04x, ", hrgnUpdate); + dprintf_info(win,"hrgnUpdate = %04x, \n", hrgnUpdate); /* When bIcon is TRUE hrgnUpdate is automatically in window coordinates * (because rectClient == rectWindow for WS_MINIMIZE windows). @@ -133,7 +131,7 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps ) (bIcon ? DCX_WINDOW : 0) ); } - dprintf_win(stddeb,"hdc = %04x\n", lps->hdc); + dprintf_info(win,"hdc = %04x\n", lps->hdc); if (!lps->hdc) { @@ -143,7 +141,7 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps ) GetRgnBox16( InquireVisRgn(lps->hdc), &lps->rcPaint ); -dprintf_win(stddeb,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top, +dprintf_info(win,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top, lps->rcPaint.right, lps->rcPaint.bottom ); DPtoLP16( lps->hdc, (LPPOINT16)&lps->rcPaint, 2 ); @@ -297,13 +295,13 @@ BOOL32 PAINT_RedrawWindow( HWND32 hwnd, const RECT32 *rectUpdate, bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon); if (rectUpdate) { - dprintf_win(stddeb, "RedrawWindow: %04x %d,%d-%d,%d %04x flags=%04x\n", + dprintf_info(win, "RedrawWindow: %04x %d,%d-%d,%d %04x flags=%04x\n", hwnd, rectUpdate->left, rectUpdate->top, rectUpdate->right, rectUpdate->bottom, hrgnUpdate, flags ); } else { - dprintf_win(stddeb, "RedrawWindow: %04x NULL %04x flags=%04x\n", + dprintf_info(win, "RedrawWindow: %04x NULL %04x flags=%04x\n", hwnd, hrgnUpdate, flags); } diff --git a/windows/property.c b/windows/property.c index c44f8710bf1..221048c3b56 100644 --- a/windows/property.c +++ b/windows/property.c @@ -7,7 +7,6 @@ #include #include "win.h" #include "heap.h" -#include "stddebug.h" #include "debug.h" @@ -74,10 +73,10 @@ HANDLE32 WINAPI GetProp32A( HWND32 hwnd, LPCSTR str ) PROPERTY *prop = PROP_FindProp( hwnd, str ); if (HIWORD(str)) - dprintf_prop( stddeb, "GetProp(%08x,'%s'): returning %08x\n", + dprintf_info(prop, "GetProp(%08x,'%s'): returning %08x\n", hwnd, str, prop ? prop->handle : 0 ); else - dprintf_prop( stddeb, "GetProp(%08x,#%04x): returning %08x\n", + dprintf_info(prop, "GetProp(%08x,#%04x): returning %08x\n", hwnd, LOWORD(str), prop ? prop->handle : 0 ); return prop ? prop->handle : 0; @@ -117,9 +116,9 @@ BOOL32 WINAPI SetProp32A( HWND32 hwnd, LPCSTR str, HANDLE32 handle ) PROPERTY *prop; if (HIWORD(str)) - dprintf_prop( stddeb, "SetProp: %04x '%s' %08x\n", hwnd, str, handle ); + dprintf_info(prop, "SetProp: %04x '%s' %08x\n", hwnd, str, handle ); else - dprintf_prop( stddeb, "SetProp: %04x #%04x %08x\n", + dprintf_info(prop, "SetProp: %04x #%04x %08x\n", hwnd, LOWORD(str), handle ); if (!(prop = PROP_FindProp( hwnd, str ))) @@ -178,9 +177,9 @@ HANDLE32 WINAPI RemoveProp32A( HWND32 hwnd, LPCSTR str ) WND *pWnd = WIN_FindWndPtr( hwnd ); if (HIWORD(str)) - dprintf_prop( stddeb, "RemoveProp: %04x '%s'\n", hwnd, str ); + dprintf_info(prop, "RemoveProp: %04x '%s'\n", hwnd, str ); else - dprintf_prop( stddeb, "RemoveProp: %04x #%04x\n", hwnd, LOWORD(str)); + dprintf_info(prop, "RemoveProp: %04x #%04x\n", hwnd, LOWORD(str)); if (!pWnd) return NULL; @@ -263,7 +262,7 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func ) WND *pWnd; INT16 ret = -1; - dprintf_prop( stddeb, "EnumProps: %04x %08x\n", hwnd, (UINT32)func ); + dprintf_info(prop, "EnumProps: %04x %08x\n", hwnd, (UINT32)func ); if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1; for (prop = pWnd->pProp; (prop); prop = next) { @@ -271,7 +270,7 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func ) /* function removes the current property. */ next = prop->next; - dprintf_prop( stddeb, " Callback: handle=%08x str='%s'\n", + dprintf_info(prop, " Callback: handle=%08x str='%s'\n", prop->handle, prop->string ); ret = func( hwnd, SEGPTR_GET(prop->string), prop->handle ); if (!ret) break; @@ -307,7 +306,7 @@ INT32 WINAPI EnumPropsEx32A(HWND32 hwnd, PROPENUMPROCEX32A func, LPARAM lParam) WND *pWnd; INT32 ret = -1; - dprintf_prop( stddeb, "EnumPropsEx32A: %04x %08x %08lx\n", + dprintf_info(prop, "EnumPropsEx32A: %04x %08x %08lx\n", hwnd, (UINT32)func, lParam ); if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1; for (prop = pWnd->pProp; (prop); prop = next) @@ -316,7 +315,7 @@ INT32 WINAPI EnumPropsEx32A(HWND32 hwnd, PROPENUMPROCEX32A func, LPARAM lParam) /* function removes the current property. */ next = prop->next; - dprintf_prop( stddeb, " Callback: handle=%08x str='%s'\n", + dprintf_info(prop, " Callback: handle=%08x str='%s'\n", prop->handle, prop->string ); ret = func( hwnd, prop->string, prop->handle, lParam ); if (!ret) break; @@ -334,7 +333,7 @@ INT32 WINAPI EnumPropsEx32W(HWND32 hwnd, PROPENUMPROCEX32W func, LPARAM lParam) WND *pWnd; INT32 ret = -1; - dprintf_prop( stddeb, "EnumPropsEx32W: %04x %08x %08lx\n", + dprintf_info(prop, "EnumPropsEx32W: %04x %08x %08lx\n", hwnd, (UINT32)func, lParam ); if (!(pWnd = WIN_FindWndPtr( hwnd ))) return -1; for (prop = pWnd->pProp; (prop); prop = next) @@ -343,7 +342,7 @@ INT32 WINAPI EnumPropsEx32W(HWND32 hwnd, PROPENUMPROCEX32W func, LPARAM lParam) /* function removes the current property. */ next = prop->next; - dprintf_prop( stddeb, " Callback: handle=%08x str='%s'\n", + dprintf_info(prop, " Callback: handle=%08x str='%s'\n", prop->handle, prop->string ); if (HIWORD(prop->string)) { diff --git a/windows/queue.c b/windows/queue.c index f23542fecf1..d3053341392 100644 --- a/windows/queue.c +++ b/windows/queue.c @@ -15,7 +15,6 @@ #include "hook.h" #include "thread.h" #include "process.h" -#include "stddebug.h" #include "debug.h" #define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */ @@ -123,7 +122,7 @@ static HQUEUE16 QUEUE_CreateMsgQueue( int size ) int queueSize; TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() ); - dprintf_msg(stddeb,"Creating message queue...\n"); + dprintf_info(msg,"Creating message queue...\n"); queueSize = sizeof(MESSAGEQUEUE) + size * sizeof(QMSG); if (!(hQueue = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, queueSize ))) @@ -153,11 +152,11 @@ BOOL32 QUEUE_DeleteMsgQueue( HQUEUE16 hQueue ) HQUEUE16 senderQ; HQUEUE16 *pPrev; - dprintf_msg(stddeb,"Deleting message queue %04x\n", hQueue); + dprintf_info(msg,"Deleting message queue %04x\n", hQueue); if (!hQueue || !msgQueue) { - dprintf_msg(stddeb,"DeleteMsgQueue: invalid argument.\n"); + dprintf_warn(msg, "DeleteMsgQueue: invalid argument.\n"); return 0; } if( pCursorQueue == msgQueue ) pCursorQueue = NULL; @@ -224,7 +223,7 @@ MESSAGEQUEUE *QUEUE_GetSysQueue(void) */ void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit ) { - dprintf_msg(stddeb,"SetWakeBit: queue = %04x (wm=%04x), bit = %04x\n", + dprintf_info(msg,"SetWakeBit: queue = %04x (wm=%04x), bit = %04x\n", queue->self, queue->wakeMask, bit ); if (bit & QS_MOUSE) pMouseQueue = queue; @@ -258,7 +257,7 @@ void QUEUE_WaitBits( WORD bits ) { MESSAGEQUEUE *queue; - dprintf_msg(stddeb,"WaitBits: q %04x waiting for %04x\n", GetTaskQueue(0), bits); + dprintf_info(msg,"WaitBits: q %04x waiting for %04x\n", GetTaskQueue(0), bits); for (;;) { @@ -282,7 +281,7 @@ void QUEUE_WaitBits( WORD bits ) queue->wakeMask = bits | QS_SENDMESSAGE; if(queue->changeBits & bits) continue; - dprintf_msg(stddeb,"wb: (%04x) wakeMask is %04x, waiting\n", queue->self, queue->wakeMask); + dprintf_info(msg,"wb: (%04x) wakeMask is %04x, waiting\n", queue->self, queue->wakeMask); WaitEvent( 0 ); } @@ -301,10 +300,10 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ) QSMCTRL* prevCtrlPtr = NULL; LRESULT result = 0; - dprintf_msg(stddeb, "ReceiveMessage, queue %04x\n", queue->self ); + dprintf_info(msg, "ReceiveMessage, queue %04x\n", queue->self ); if (!(queue->wakeBits & QS_SENDMESSAGE) || !(senderQ = (MESSAGEQUEUE*)GlobalLock16( queue->hSendingTask))) - { dprintf_msg(stddeb,"\trcm: nothing to do\n"); return; } + { dprintf_info(msg,"\trcm: nothing to do\n"); return; } if( !senderQ->hPrevSendingTask ) { @@ -321,11 +320,11 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ) queue->smResultCurrent = senderQ->smResultInit; queue->hSendingTask = senderQ->hPrevSendingTask; - dprintf_msg(stddeb, "\trcm: smResultCurrent = %08x, prevCtrl = %08x\n", + dprintf_info(msg, "\trcm: smResultCurrent = %08x, prevCtrl = %08x\n", (unsigned)queue->smResultCurrent, (unsigned)prevCtrlPtr ); QUEUE_SetWakeBit( senderQ, QS_SMPARAMSFREE ); - dprintf_msg(stddeb, "\trcm: calling wndproc - %04x %04x %04x%04x %08x\n", + dprintf_info(msg, "\trcm: calling wndproc - %04x %04x %04x%04x %08x\n", senderQ->hWnd, senderQ->msg, senderQ->wParamHigh, senderQ->wParam, (unsigned)senderQ->lParam ); @@ -338,7 +337,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ) if (senderQ->flags & QUEUE_SM_WIN32) { WPARAM32 wParam = MAKELONG( senderQ->wParam, senderQ->wParamHigh ); - dprintf_msg(stddeb, "\trcm: msg is Win32\n" ); + dprintf_info(msg, "\trcm: msg is Win32\n" ); if (senderQ->flags & QUEUE_SM_UNICODE) result = CallWindowProc32W( wndPtr->winproc, senderQ->hWnd, senderQ->msg, @@ -354,9 +353,9 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ) senderQ->wParam, senderQ->lParam ); queue->GetMessageExtraInfoVal = extraInfo; /* Restore extra info */ - dprintf_msg(stddeb,"\trcm: result = %08x\n", (unsigned)result ); + dprintf_info(msg,"\trcm: result = %08x\n", (unsigned)result ); } - else dprintf_msg(stddeb,"\trcm: bad hWnd\n"); + else dprintf_warn(msg, "\trcm: bad hWnd\n"); /* Return the result to the sender task */ ReplyMessage16( result ); @@ -364,7 +363,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ) queue->InSendMessageHandle = prevSender; queue->smResultCurrent = prevCtrlPtr; - dprintf_msg(stddeb,"ReceiveMessage: done!\n"); + dprintf_info(msg,"ReceiveMessage: done!\n"); } /*********************************************************************** @@ -448,7 +447,7 @@ int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND32 hwnd, int first, int last ) { int i, pos = msgQueue->nextMessage; - dprintf_msg(stddeb,"QUEUE_FindMsg: hwnd=%04x pos=%d\n", hwnd, pos ); + dprintf_info(msg,"QUEUE_FindMsg: hwnd=%04x pos=%d\n", hwnd, pos ); if (!msgQueue->msgCount) return -1; if (!hwnd && !first && !last) return pos; @@ -539,7 +538,7 @@ static void QUEUE_WakeSomeone( UINT32 message ) } if( !queue ) { - dprintf_msg(stddeb,"WakeSomeone: couldn't find queue\n"); + dprintf_warn(msg, "WakeSomeone: couldn't find queue\n"); return; } } @@ -735,13 +734,13 @@ BOOL32 WINAPI SetMessageQueue32( INT32 size ) HQUEUE16 hQueue, hNewQueue; MESSAGEQUEUE *queuePtr; - dprintf_msg(stddeb,"SetMessageQueue: task %04x size %i\n", GetCurrentTask(), size); + dprintf_info(msg,"SetMessageQueue: task %04x size %i\n", GetCurrentTask(), size); if ((size > MAX_QUEUE_SIZE) || (size <= 0)) return TRUE; if( !(hNewQueue = QUEUE_CreateMsgQueue( size ))) { - dprintf_msg(stddeb,"SetMessageQueue: failed!\n"); + dprintf_warn(msg, "SetMessageQueue: failed!\n"); return FALSE; } queuePtr = (MESSAGEQUEUE *)GlobalLock16( hNewQueue ); diff --git a/windows/scroll.c b/windows/scroll.c index 6b7e86604c1..c656d572e03 100644 --- a/windows/scroll.c +++ b/windows/scroll.c @@ -16,7 +16,6 @@ #include "region.h" #include "graphics.h" #include "sysmetrics.h" -#include "stddebug.h" #include "debug.h" extern HWND32 CARET_GetHwnd(); /* windows/caret.c */ @@ -51,7 +50,7 @@ BOOL32 WINAPI ScrollWindow32( HWND32 hwnd, INT32 dx, INT32 dy, HWND32 hCaretWnd = CARET_GetHwnd(); WND* wndScroll = WIN_FindWndPtr( hwnd ); - dprintf_scroll(stddeb,"ScrollWindow: hwnd=%04x, dx=%d, dy=%d, lpRect =%p clipRect=%i,%i,%i,%i\n", + dprintf_info(scroll,"ScrollWindow: hwnd=%04x, dx=%d, dy=%d, lpRect =%p clipRect=%i,%i,%i,%i\n", hwnd, dx, dy, rect, clipRect ? clipRect->left : 0, clipRect ? clipRect->top : 0, @@ -157,7 +156,7 @@ BOOL32 WINAPI ScrollDC32( HDC32 hdc, INT32 dx, INT32 dy, const RECT32 *rc, INT32 ldx, ldy; DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC); - dprintf_scroll(stddeb,"ScrollDC: %04x %d,%d hrgnUpdate=%04x rcUpdate = %p cliprc = (%d,%d-%d,%d), rc=(%d,%d-%d,%d)\n", + dprintf_info(scroll,"ScrollDC: %04x %d,%d hrgnUpdate=%04x rcUpdate = %p cliprc = (%d,%d-%d,%d), rc=(%d,%d-%d,%d)\n", (HDC16)hdc, dx, dy, hrgnUpdate, rcUpdate, prLClip ? prLClip->left : 0, prLClip ? prLClip->top : 0, prLClip ? prLClip->right : 0, prLClip ? prLClip->bottom : 0, rc ? rc->left : 0, rc ? rc->top : 0, rc ? rc->right : 0, rc ? rc->bottom : 0 ); @@ -374,7 +373,7 @@ INT32 WINAPI ScrollWindowEx32( HWND32 hwnd, INT32 dx, INT32 dy, BOOL32 bUpdate = (rcUpdate || hrgnUpdate || flags & (SW_INVALIDATE | SW_ERASE)); HRGN32 hrgnClip = CreateRectRgnIndirect32(&cliprc); -dprintf_scroll(stddeb,"ScrollWindowEx: %04x, %d,%d hrgnUpdate=%04x rcUpdate = %p \ +dprintf_info(scroll,"ScrollWindowEx: %04x, %d,%d hrgnUpdate=%04x rcUpdate = %p \ cliprc = (%d,%d-%d,%d), rc=(%d,%d-%d,%d) %04x\n", (HWND16)hwnd, dx, dy, hrgnUpdate, rcUpdate, clipRect?clipRect->left:0, clipRect?clipRect->top:0, clipRect?clipRect->right:0, clipRect?clipRect->bottom:0, diff --git a/windows/timer.c b/windows/timer.c index a28a375f756..4524573bd93 100644 --- a/windows/timer.c +++ b/windows/timer.c @@ -7,8 +7,6 @@ #include "windows.h" #include "queue.h" #include "winproc.h" -#include "stddebug.h" -/* #define DEBUG_TIMER */ #include "debug.h" @@ -202,7 +200,7 @@ BOOL32 TIMER_GetTimerMsg( MSG16 *msg, HWND32 hwnd, if (!pTimer || (pTimer->expires > curTime)) return FALSE; /* No timer */ if (remove) TIMER_RestartTimer( pTimer, curTime ); /* Restart it */ - dprintf_timer( stddeb, "Timer expired: %04x, %04x, %04x, %08lx\n", + dprintf_info(timer, "Timer expired: %04x, %04x, %04x, %08lx\n", pTimer->hwnd, pTimer->msg, pTimer->id, (DWORD)pTimer->proc); /* Build the message */ @@ -264,7 +262,7 @@ static UINT32 TIMER_SetTimer( HWND32 hwnd, UINT32 id, UINT32 timeout, pTimer->expires = GetTickCount() + timeout; pTimer->proc = (HWINDOWPROC)0; if (proc) WINPROC_SetProc( &pTimer->proc, proc, type, WIN_PROC_TIMER ); - dprintf_timer( stddeb, "Timer added: %p, %04x, %04x, %04x, %08lx\n", + dprintf_info(timer, "Timer added: %p, %04x, %04x, %04x, %08lx\n", pTimer, pTimer->hwnd, pTimer->msg, pTimer->id, (DWORD)pTimer->proc ); TIMER_InsertTimer( pTimer ); @@ -304,7 +302,7 @@ static BOOL32 TIMER_KillTimer( HWND32 hwnd, UINT32 id, BOOL32 sys ) UINT16 WINAPI SetTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, TIMERPROC16 proc ) { - dprintf_timer( stddeb, "SetTimer16: %04x %d %d %08lx\n", + dprintf_info(timer, "SetTimer16: %04x %d %d %08lx\n", hwnd, id, timeout, (LONG)proc ); return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc, WIN_PROC_16, FALSE ); @@ -317,7 +315,7 @@ UINT16 WINAPI SetTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, UINT32 WINAPI SetTimer32( HWND32 hwnd, UINT32 id, UINT32 timeout, TIMERPROC32 proc ) { - dprintf_timer( stddeb, "SetTimer32: %04x %d %d %08lx\n", + dprintf_info(timer, "SetTimer32: %04x %d %d %08lx\n", hwnd, id, timeout, (LONG)proc ); return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc, WIN_PROC_32A, FALSE ); @@ -330,7 +328,7 @@ UINT32 WINAPI SetTimer32( HWND32 hwnd, UINT32 id, UINT32 timeout, UINT16 WINAPI SetSystemTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, TIMERPROC16 proc ) { - dprintf_timer( stddeb, "SetSystemTimer16: %04x %d %d %08lx\n", + dprintf_info(timer, "SetSystemTimer16: %04x %d %d %08lx\n", hwnd, id, timeout, (LONG)proc ); return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc, WIN_PROC_16, TRUE ); @@ -343,7 +341,7 @@ UINT16 WINAPI SetSystemTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, UINT32 WINAPI SetSystemTimer32( HWND32 hwnd, UINT32 id, UINT32 timeout, TIMERPROC32 proc ) { - dprintf_timer( stddeb, "SetSystemTimer32: %04x %d %d %08lx\n", + dprintf_info(timer, "SetSystemTimer32: %04x %d %d %08lx\n", hwnd, id, timeout, (LONG)proc ); return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc, WIN_PROC_32A, TRUE ); @@ -355,7 +353,7 @@ UINT32 WINAPI SetSystemTimer32( HWND32 hwnd, UINT32 id, UINT32 timeout, */ BOOL16 WINAPI KillTimer16( HWND16 hwnd, UINT16 id ) { - dprintf_timer(stddeb, "KillTimer16: %04x %d\n", hwnd, id ); + dprintf_info(timer, "KillTimer16: %04x %d\n", hwnd, id ); return TIMER_KillTimer( hwnd, id, FALSE ); } @@ -365,7 +363,7 @@ BOOL16 WINAPI KillTimer16( HWND16 hwnd, UINT16 id ) */ BOOL32 WINAPI KillTimer32( HWND32 hwnd, UINT32 id ) { - dprintf_timer(stddeb, "KillTimer32: %04x %d\n", hwnd, id ); + dprintf_info(timer, "KillTimer32: %04x %d\n", hwnd, id ); return TIMER_KillTimer( hwnd, id, FALSE ); } @@ -375,7 +373,7 @@ BOOL32 WINAPI KillTimer32( HWND32 hwnd, UINT32 id ) */ BOOL16 WINAPI KillSystemTimer16( HWND16 hwnd, UINT16 id ) { - dprintf_timer( stddeb, "KillSystemTimer16: %04x %d\n", hwnd, id ); + dprintf_info(timer, "KillSystemTimer16: %04x %d\n", hwnd, id ); return TIMER_KillTimer( hwnd, id, TRUE ); } @@ -385,6 +383,6 @@ BOOL16 WINAPI KillSystemTimer16( HWND16 hwnd, UINT16 id ) */ BOOL32 WINAPI KillSystemTimer32( HWND32 hwnd, UINT32 id ) { - dprintf_timer( stddeb, "KillSystemTimer32: %04x %d\n", hwnd, id ); + dprintf_info(timer, "KillSystemTimer32: %04x %d\n", hwnd, id ); return TIMER_KillTimer( hwnd, id, TRUE ); } diff --git a/windows/user.c b/windows/user.c index 8faf91bccc2..f7aea01338b 100644 --- a/windows/user.c +++ b/windows/user.c @@ -300,6 +300,20 @@ BOOL32 WINAPI ExitWindowsEx( UINT32 flags, DWORD reserved ) return FALSE; } +/*********************************************************************** + * EnumDisplaySettingsA (USER32.592) + */ +BOOL32 WINAPI EnumDisplaySettings32A(LPCSTR name,DWORD n,LPDEVMODE32A devmode) { + fprintf(stderr,"EnumDisplaySettings32A(%s,%ld,%p)\n",name,n,devmode); + if (n==0) { + devmode->dmBitsPerPel = DefaultDepthOfScreen(screen); + devmode->dmPelsHeight = screenHeight; + devmode->dmPelsWidth = screenWidth; + return TRUE; + } + return FALSE; +} + /*********************************************************************** * SetEventHook (USER.321) diff --git a/windows/win.c b/windows/win.c index 74b55eab5b7..d431b510bcc 100644 --- a/windows/win.c +++ b/windows/win.c @@ -30,10 +30,8 @@ #include "clipboard.h" #include "winproc.h" #include "thread.h" -#include "stddebug.h" -/* #define DEBUG_WIN */ -/* #define DEBUG_MENU */ #include "debug.h" +#include "debugstr.h" /* Desktop window */ static WND *pWndDesktop = NULL; @@ -237,7 +235,7 @@ HWND32 WIN_FindWinToRepaint( HWND32 hwnd, HQUEUE16 hQueue ) { if (!(pWnd->dwStyle & WS_VISIBLE)) { - dprintf_win( stddeb, "FindWinToRepaint: skipping window %04x\n", + dprintf_info(win, "FindWinToRepaint: skipping window %04x\n", pWnd->hwndSelf ); continue; } @@ -260,7 +258,7 @@ HWND32 WIN_FindWinToRepaint( HWND32 hwnd, HQUEUE16 hQueue ) pWnd = pWnd->next; } if (pWnd) hwndRet = pWnd->hwndSelf; - dprintf_win(stddeb,"FindWinToRepaint: found %04x\n",hwndRet); + dprintf_info(win,"FindWinToRepaint: found %04x\n",hwndRet); return hwndRet; } @@ -275,7 +273,7 @@ static WND* WIN_DestroyWindow( WND* wndPtr ) HWND32 hwnd = wndPtr->hwndSelf; WND *pWnd; - dprintf_win( stddeb, "WIN_DestroyWindow: %04x\n", wndPtr->hwndSelf ); + dprintf_info(win, "WIN_DestroyWindow: %04x\n", wndPtr->hwndSelf ); #ifdef CONFIG_IPC if (main_block) @@ -405,7 +403,7 @@ BOOL32 WIN_CreateDesktopWindow(void) CLASS *class; HWND32 hwndDesktop; - dprintf_win(stddeb,"Creating desktop window\n"); + dprintf_info(win,"Creating desktop window\n"); if (!ICONTITLE_Init() || !WINPOS_CreateInternalPosAtom() || @@ -469,14 +467,10 @@ static HWND32 WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom, POINT32 maxSize, maxPos, minTrack, maxTrack; LRESULT (WINAPI *localSend32)(HWND32, UINT32, WPARAM32, LPARAM); - dprintf_win( stddeb, "CreateWindowEx: " ); - if (HIWORD(cs->lpszName)) dprintf_win( stddeb, "'%s' ", cs->lpszName ); - else dprintf_win( stddeb, "#%04x ", LOWORD(cs->lpszName) ); - if (HIWORD(cs->lpszClass)) dprintf_win( stddeb, "'%s' ", cs->lpszClass ); - else dprintf_win( stddeb, "#%04x ", LOWORD(cs->lpszClass) ); - - dprintf_win( stddeb, "%08lx %08lx %d,%d %dx%d %04x %04x %08x %p\n", - cs->dwExStyle, cs->style, cs->x, cs->y, cs->cx, cs->cy, + dprintf_info(win, "CreateWindowEx: %s %s %08lx %08lx %d,%d %dx%d " + "%04x %04x %08x %p\n", debugres(cs->lpszName), + debugres(cs->lpszClass), cs->dwExStyle, + cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, cs->hMenu, cs->hInstance, cs->lpCreateParams); /* Find the parent window */ @@ -521,7 +515,7 @@ static HWND32 WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom, if (!(hwnd = USER_HEAP_ALLOC( sizeof(*wndPtr) + classPtr->cbWndExtra - sizeof(wndPtr->wExtra) ))) { - dprintf_win( stddeb, "CreateWindowEx: out of memory\n" ); + dprintf_info(win, "CreateWindowEx: out of memory\n" ); return 0; } @@ -580,7 +574,7 @@ static HWND32 WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom, cbtc.hwndInsertAfter = hwndLinkAfter; if ( HOOK_CallHooks32A(WH_CBT, HCBT_CREATEWND, hwnd, (LPARAM)&cbtc) ) { - dprintf_win(stddeb, "CreateWindowEx: CBT-hook returned 0\n"); + dprintf_info(win, "CreateWindowEx: CBT-hook returned 0\n"); USER_HEAP_FREE( hwnd ); return 0; } @@ -711,9 +705,11 @@ static HWND32 WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom, LoadMenu(cs->hInstance,(SEGPTR)classPtr->menuNameA); #else SEGPTR menuName = (SEGPTR)GetClassLong16( hwnd, GCL_MENUNAME ); - if (HIWORD(cs->hInstance)) + /* hInstance is still 16-bit in 980215 winelib */ + if (HIWORD(cs->hInstance) || __winelib) cs->hMenu = LoadMenu32A(cs->hInstance,PTR_SEG_TO_LIN(menuName)); else + /* doesn't work for winelib, since resources are unicode */ cs->hMenu = LoadMenu16(cs->hInstance,menuName); #endif } @@ -780,14 +776,14 @@ static HWND32 WIN_CreateWindowEx( CREATESTRUCT32A *cs, ATOM classAtom, if (!(wndPtr->dwStyle & WS_CHILD) && !wndPtr->owner) HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 ); - dprintf_win(stddeb, "CreateWindowEx: created window %04x\n", hwnd); + dprintf_info(win, "CreateWindowEx: created window %04x\n", hwnd); return hwnd; } } /* Abort window creation */ - dprintf_win(stddeb,"CreateWindowEx: aborted by WM_xxCREATE!\n"); + dprintf_warn(win, "CreateWindowEx: aborted by WM_xxCREATE!\n"); WIN_UnlinkWindow( hwnd ); WIN_DestroyWindow( wndPtr ); return 0; @@ -851,7 +847,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className, /*********************************************************************** - * CreateWindowEx32A (USER32.82) + * CreateWindowEx32A (USER32.83) */ HWND32 WINAPI CreateWindowEx32A( DWORD exStyle, LPCSTR className, LPCSTR windowName, DWORD style, INT32 x, @@ -891,7 +887,7 @@ HWND32 WINAPI CreateWindowEx32A( DWORD exStyle, LPCSTR className, /*********************************************************************** - * CreateWindowEx32W (USER32.83) + * CreateWindowEx32W (USER32.84) */ HWND32 WINAPI CreateWindowEx32W( DWORD exStyle, LPCWSTR className, LPCWSTR windowName, DWORD style, INT32 x, @@ -969,7 +965,7 @@ static void WIN_SendDestroyMsg( WND* pWnd ) WIN_CheckFocus(pWnd); } else - dprintf_win(stddeb,"\tdestroyed itself while in WM_DESTROY!\n"); + dprintf_warn(win, "\tdestroyed itself while in WM_DESTROY!\n"); } @@ -983,13 +979,13 @@ BOOL16 WINAPI DestroyWindow16( HWND16 hwnd ) /*********************************************************************** - * DestroyWindow32 (USER32.134) + * DestroyWindow32 (USER32.135) */ BOOL32 WINAPI DestroyWindow32( HWND32 hwnd ) { WND * wndPtr; - dprintf_win(stddeb, "DestroyWindow(%04x)\n", hwnd); + dprintf_info(win, "DestroyWindow(%04x)\n", hwnd); /* Initialization */ @@ -1085,7 +1081,7 @@ BOOL16 WINAPI CloseWindow16( HWND16 hwnd ) /*********************************************************************** - * CloseWindow32 (USER32.55) + * CloseWindow32 (USER32.56) */ BOOL32 WINAPI CloseWindow32( HWND32 hwnd ) { @@ -1106,7 +1102,7 @@ BOOL16 WINAPI OpenIcon16( HWND16 hwnd ) /*********************************************************************** - * OpenIcon32 (USER32.409) + * OpenIcon32 (USER32.410) */ BOOL32 WINAPI OpenIcon32( HWND32 hwnd ) { @@ -1192,7 +1188,7 @@ HWND16 WINAPI FindWindowEx16( HWND16 parent, HWND16 child, { ATOM atom = 0; - dprintf_win(stddeb, "FindWindowEx16: %04x %04x '%s' '%s'\n", parent, + dprintf_info(win, "FindWindowEx16: %04x %04x '%s' '%s'\n", parent, child, HIWORD(className)?(char *)PTR_SEG_TO_LIN(className):"", title ? title : ""); @@ -1207,7 +1203,7 @@ HWND16 WINAPI FindWindowEx16( HWND16 parent, HWND16 child, /*********************************************************************** - * FindWindow32A (USER32.197) + * FindWindow32A (USER32.198) */ HWND32 WINAPI FindWindow32A( LPCSTR className, LPCSTR title ) { @@ -1216,7 +1212,7 @@ HWND32 WINAPI FindWindow32A( LPCSTR className, LPCSTR title ) /*********************************************************************** - * FindWindowEx32A (USER32.198) + * FindWindowEx32A (USER32.199) */ HWND32 WINAPI FindWindowEx32A( HWND32 parent, HWND32 child, LPCSTR className, LPCSTR title ) @@ -1234,7 +1230,7 @@ HWND32 WINAPI FindWindowEx32A( HWND32 parent, HWND32 child, /*********************************************************************** - * FindWindowEx32W (USER32.199) + * FindWindowEx32W (USER32.200) */ HWND32 WINAPI FindWindowEx32W( HWND32 parent, HWND32 child, LPCWSTR className, LPCWSTR title ) @@ -1257,7 +1253,7 @@ HWND32 WINAPI FindWindowEx32W( HWND32 parent, HWND32 child, /*********************************************************************** - * FindWindow32W (USER32.200) + * FindWindow32W (USER32.201) */ HWND32 WINAPI FindWindow32W( LPCWSTR className, LPCWSTR title ) { @@ -1284,7 +1280,7 @@ HWND16 WINAPI GetDesktopWindow16(void) /********************************************************************** - * GetDesktopWindow32 (USER32.231) + * GetDesktopWindow32 (USER32.232) */ HWND32 WINAPI GetDesktopWindow32(void) { @@ -1314,7 +1310,7 @@ BOOL16 WINAPI EnableWindow16( HWND16 hwnd, BOOL16 enable ) /******************************************************************* - * EnableWindow32 (USER32.171) + * EnableWindow32 (USER32.172) */ BOOL32 WINAPI EnableWindow32( HWND32 hwnd, BOOL32 enable ) { @@ -1353,7 +1349,7 @@ BOOL16 WINAPI IsWindowEnabled16(HWND16 hWnd) /*********************************************************************** - * IsWindowEnabled32 (USER32.348) + * IsWindowEnabled32 (USER32.349) */ BOOL32 WINAPI IsWindowEnabled32(HWND32 hWnd) { @@ -1365,7 +1361,7 @@ BOOL32 WINAPI IsWindowEnabled32(HWND32 hWnd) /*********************************************************************** - * IsWindowUnicode (USER32.349) + * IsWindowUnicode (USER32.350) */ BOOL32 WINAPI IsWindowUnicode( HWND32 hwnd ) { @@ -1386,7 +1382,7 @@ WORD WINAPI GetWindowWord16( HWND16 hwnd, INT16 offset ) /********************************************************************** - * GetWindowWord32 (USER32.313) + * GetWindowWord32 (USER32.314) */ WORD WINAPI GetWindowWord32( HWND32 hwnd, INT32 offset ) { @@ -1440,7 +1436,7 @@ WORD WINAPI SetWindowWord16( HWND16 hwnd, INT16 offset, WORD newval ) /********************************************************************** - * SetWindowWord32 (USER32.523) + * SetWindowWord32 (USER32.524) */ WORD WINAPI SetWindowWord32( HWND32 hwnd, INT32 offset, WORD newval ) { @@ -1584,7 +1580,7 @@ LONG WINAPI GetWindowLong16( HWND16 hwnd, INT16 offset ) /********************************************************************** - * GetWindowLong32A (USER32.304) + * GetWindowLong32A (USER32.305) */ LONG WINAPI GetWindowLong32A( HWND32 hwnd, INT32 offset ) { @@ -1593,7 +1589,7 @@ LONG WINAPI GetWindowLong32A( HWND32 hwnd, INT32 offset ) /********************************************************************** - * GetWindowLong32W (USER32.305) + * GetWindowLong32W (USER32.306) */ LONG WINAPI GetWindowLong32W( HWND32 hwnd, INT32 offset ) { @@ -1611,7 +1607,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval ) /********************************************************************** - * SetWindowLong32A (USER32.516) + * SetWindowLong32A (USER32.517) */ LONG WINAPI SetWindowLong32A( HWND32 hwnd, INT32 offset, LONG newval ) { @@ -1620,7 +1616,7 @@ LONG WINAPI SetWindowLong32A( HWND32 hwnd, INT32 offset, LONG newval ) /********************************************************************** - * SetWindowLong32W (USER32.517) + * SetWindowLong32W (USER32.518) */ LONG WINAPI SetWindowLong32W( HWND32 hwnd, INT32 offset, LONG newval ) { @@ -1638,7 +1634,7 @@ INT16 WINAPI GetWindowText16( HWND16 hwnd, SEGPTR lpString, INT16 nMaxCount ) /******************************************************************* - * GetWindowText32A (USER32.308) + * GetWindowText32A (USER32.309) */ INT32 WINAPI GetWindowText32A( HWND32 hwnd, LPSTR lpString, INT32 nMaxCount ) { @@ -1648,7 +1644,7 @@ INT32 WINAPI GetWindowText32A( HWND32 hwnd, LPSTR lpString, INT32 nMaxCount ) /******************************************************************* - * GetWindowText32W (USER32.311) + * GetWindowText32W (USER32.312) */ INT32 WINAPI GetWindowText32W( HWND32 hwnd, LPWSTR lpString, INT32 nMaxCount ) { @@ -1676,7 +1672,7 @@ void WINAPI SetWindowText32A( HWND32 hwnd, LPCSTR lpString ) /******************************************************************* - * SetWindowText32W (USER32.522) + * SetWindowText32W (USER32.523) */ void WINAPI SetWindowText32W( HWND32 hwnd, LPCWSTR lpString ) { @@ -1694,7 +1690,7 @@ INT16 WINAPI GetWindowTextLength16( HWND16 hwnd ) /******************************************************************* - * GetWindowTextLength32A (USER32.309) + * GetWindowTextLength32A (USER32.310) */ INT32 WINAPI GetWindowTextLength32A( HWND32 hwnd ) { @@ -1702,7 +1698,7 @@ INT32 WINAPI GetWindowTextLength32A( HWND32 hwnd ) } /******************************************************************* - * GetWindowTextLength32W (USER32.309) + * GetWindowTextLength32W (USER32.311) */ INT32 WINAPI GetWindowTextLength32W( HWND32 hwnd ) { @@ -1720,7 +1716,7 @@ BOOL16 WINAPI IsWindow16( HWND16 hwnd ) /******************************************************************* - * IsWindow32 (USER32.347) + * IsWindow32 (USER32.348) */ BOOL32 WINAPI IsWindow32( HWND32 hwnd ) { @@ -1739,7 +1735,7 @@ HWND16 WINAPI GetParent16( HWND16 hwnd ) /***************************************************************** - * GetParent32 (USER32.277) + * GetParent32 (USER32.278) */ HWND32 WINAPI GetParent32( HWND32 hwnd ) { @@ -1782,7 +1778,7 @@ HWND16 WINAPI SetParent16( HWND16 hwndChild, HWND16 hwndNewParent ) /***************************************************************** - * SetParent32 (USER32.494) + * SetParent32 (USER32.495) */ HWND32 WINAPI SetParent32( HWND32 hwndChild, HWND32 hwndNewParent ) { @@ -1841,7 +1837,7 @@ BOOL16 WINAPI IsChild16( HWND16 parent, HWND16 child ) /******************************************************************* - * IsChild32 (USER32.338) + * IsChild32 (USER32.339) */ BOOL32 WINAPI IsChild32( HWND32 parent, HWND32 child ) { @@ -1865,7 +1861,7 @@ BOOL16 WINAPI IsWindowVisible16( HWND16 hwnd ) /*********************************************************************** - * IsWindowVisible32 (USER32.350) + * IsWindowVisible32 (USER32.351) */ BOOL32 WINAPI IsWindowVisible32( HWND32 hwnd ) { @@ -1928,7 +1924,7 @@ HWND16 WINAPI GetWindow16( HWND16 hwnd, WORD rel ) /******************************************************************* - * GetWindow32 (USER32.301) + * GetWindow32 (USER32.302) */ HWND32 WINAPI GetWindow32( HWND32 hwnd, WORD rel ) { @@ -1989,7 +1985,7 @@ void WINAPI ShowOwnedPopups16( HWND16 owner, BOOL16 fShow ) /******************************************************************* - * ShowOwnedPopups32 (USER32.530) + * ShowOwnedPopups32 (USER32.531) */ BOOL32 WINAPI ShowOwnedPopups32( HWND32 owner, BOOL32 fShow ) { @@ -2014,7 +2010,7 @@ HWND16 WINAPI GetLastActivePopup16( HWND16 hwnd ) } /******************************************************************* - * GetLastActivePopup32 (USER32.255) + * GetLastActivePopup32 (USER32.256) */ HWND32 WINAPI GetLastActivePopup32( HWND32 hwnd ) { @@ -2105,7 +2101,7 @@ BOOL16 WINAPI EnumWindows16( WNDENUMPROC16 lpEnumFunc, LPARAM lParam ) /******************************************************************* - * EnumWindows32 (USER32.192) + * EnumWindows32 (USER32.193) */ BOOL32 WINAPI EnumWindows32( WNDENUMPROC32 lpEnumFunc, LPARAM lParam ) { @@ -2142,7 +2138,7 @@ BOOL16 WINAPI EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func, /********************************************************************** - * EnumThreadWindows (USER32.189) + * EnumThreadWindows (USER32.190) */ BOOL32 WINAPI EnumThreadWindows( DWORD id, WNDENUMPROC32 func, LPARAM lParam ) { @@ -2196,7 +2192,7 @@ BOOL16 WINAPI EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func, /********************************************************************** - * EnumChildWindows32 (USER32.177) + * EnumChildWindows32 (USER32.178) */ BOOL32 WINAPI EnumChildWindows32( HWND32 parent, WNDENUMPROC32 func, LPARAM lParam ) @@ -2216,7 +2212,7 @@ BOOL16 WINAPI AnyPopup16(void) /******************************************************************* - * AnyPopup32 (USER32.3) + * AnyPopup32 (USER32.4) */ BOOL32 WINAPI AnyPopup32(void) { @@ -2237,13 +2233,13 @@ BOOL16 WINAPI FlashWindow16( HWND16 hWnd, BOOL16 bInvert ) /******************************************************************* - * FlashWindow32 (USER32.201) + * FlashWindow32 (USER32.202) */ BOOL32 WINAPI FlashWindow32( HWND32 hWnd, BOOL32 bInvert ) { WND *wndPtr = WIN_FindWndPtr(hWnd); - dprintf_win(stddeb,"FlashWindow: %04x\n", hWnd); + dprintf_info(win,"FlashWindow: %04x\n", hWnd); if (!wndPtr) return FALSE; @@ -2286,7 +2282,7 @@ HWND16 WINAPI SetSysModalWindow16( HWND16 hWnd ) { HWND32 hWndOldModal = hwndSysModal; hwndSysModal = hWnd; - dprintf_win(stdnimp,"EMPTY STUB !! SetSysModalWindow(%04x) !\n", hWnd); + dprintf_fixme(win, "EMPTY STUB !! SetSysModalWindow(%04x) !\n", hWnd); return hWndOldModal; } @@ -2344,7 +2340,7 @@ BOOL16 DRAG_QueryUpdate( HWND32 hQueryWnd, SEGPTR spDragInfo, BOOL32 bNoSend ) if(ptrWnd) { - dprintf_msg(stddeb,"DragQueryUpdate: hwnd = %04x, %d %d - %d %d\n", + dprintf_info(msg,"DragQueryUpdate: hwnd = %04x, %d %d - %d %d\n", ptrWnd->hwndSelf, ptrWnd->rectWindow.left, ptrWnd->rectWindow.top, ptrWnd->rectWindow.right, ptrWnd->rectWindow.bottom ); if( !(ptrWnd->dwStyle & WS_DISABLED) ) @@ -2383,7 +2379,7 @@ BOOL16 WINAPI DragDetect16( HWND16 hWnd, POINT16 pt ) } /******************************************************************* - * DragDetect32 (USER32.150) + * DragDetect32 (USER32.151) */ BOOL32 WINAPI DragDetect32( HWND32 hWnd, POINT32 pt ) { @@ -2483,7 +2479,7 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, lpDragInfo->pt = msg.pt; /* update DRAGINFO struct */ - dprintf_msg(stddeb,"drag: lpDI->hScope = %04x\n",lpDragInfo->hScope); + dprintf_info(msg,"drag: lpDI->hScope = %04x\n",lpDragInfo->hScope); if( DRAG_QueryUpdate(hwndScope, spDragInfo, FALSE) > 0 ) hCurrentCursor = hCursor; diff --git a/windows/winpos.c b/windows/winpos.c index 1c1bdd4142e..53b4ed596fd 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -20,8 +20,6 @@ #include "winpos.h" #include "dce.h" #include "nonclient.h" -#include "stddebug.h" -/* #define DEBUG_WIN */ #include "debug.h" #define HAS_DLGFRAME(style,exStyle) \ @@ -87,7 +85,7 @@ void WINPOS_CheckInternalPos( HWND32 hwnd ) if( hwnd == hwndActive ) { hwndActive = 0; - dprintf_win(stddeb,"\tattempt to activate destroyed window!\n"); + dprintf_warn(win, "\tattempt to activate destroyed window!\n"); } if( lpPos ) @@ -725,7 +723,7 @@ BOOL32 WINAPI MoveWindow32( HWND32 hwnd, INT32 x, INT32 y, INT32 cx, INT32 cy, { int flags = SWP_NOZORDER | SWP_NOACTIVATE; if (!repaint) flags |= SWP_NOREDRAW; - dprintf_win(stddeb, "MoveWindow: %04x %d,%d %dx%d %d\n", + dprintf_info(win, "MoveWindow: %04x %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint ); return SetWindowPos32( hwnd, 0, x, y, cx, cy, flags ); } @@ -791,7 +789,7 @@ BOOL32 WINPOS_ShowIconTitle( WND* pWnd, BOOL32 bShow ) { HWND16 hWnd = lpPos->hwndIconTitle; - dprintf_win(stddeb,"ShowIconTitle: 0x%04x %i\n", pWnd->hwndSelf, (bShow != 0) ); + dprintf_info(win,"ShowIconTitle: 0x%04x %i\n", pWnd->hwndSelf, (bShow != 0) ); if( !hWnd ) lpPos->hwndIconTitle = hWnd = ICONTITLE_Create( pWnd ); @@ -868,7 +866,7 @@ void WINPOS_GetMinMaxInfo( WND *wndPtr, POINT32 *maxSize, POINT32 *maxPos, /* Some sanity checks */ - dprintf_win(stddeb,"GetMinMaxInfo: %d %d / %d %d / %d %d / %d %d\n", + dprintf_info(win,"GetMinMaxInfo: %d %d / %d %d / %d %d / %d %d\n", MinMax.ptMaxSize.x, MinMax.ptMaxSize.y, MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y, MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y, @@ -899,7 +897,7 @@ UINT16 WINPOS_MinMaximize( WND* wndPtr, UINT16 cmd, LPRECT16 lpRect ) LPINTERNALPOS lpPos = WINPOS_InitInternalPos( wndPtr, size, &wndPtr->rectWindow ); - dprintf_win(stddeb,"MinMaximize: 0x%04x %u\n", wndPtr->hwndSelf, cmd ); + dprintf_info(win,"MinMaximize: 0x%04x %u\n", wndPtr->hwndSelf, cmd ); if (lpPos && !HOOK_CallHooks16(WH_CBT, HCBT_MINMAX, wndPtr->hwndSelf, cmd)) { @@ -997,7 +995,7 @@ BOOL32 WINAPI ShowWindow32( HWND32 hwnd, INT32 cmd ) if (!wndPtr) return FALSE; - dprintf_win(stddeb,"ShowWindow: hwnd=%04x, cmd=%d\n", hwnd, cmd); + dprintf_info(win,"ShowWindow: hwnd=%04x, cmd=%d\n", hwnd, cmd); wasVisible = (wndPtr->dwStyle & WS_VISIBLE) != 0; @@ -1375,7 +1373,7 @@ BOOL32 WINPOS_SetActiveWindow( HWND32 hWnd, BOOL32 fMouse, BOOL32 fChangeFocus) if( (wndTemp = WIN_FindWndPtr(hwndActive)) ) wIconized = HIWORD(wndTemp->dwStyle & WS_MINIMIZE); else - dprintf_win(stddeb,"WINPOS_ActivateWindow: no current active window.\n"); + dprintf_info(win,"WINPOS_ActivateWindow: no current active window.\n"); /* call CBT hook chain */ if ((cbtStruct = SEGPTR_NEW(CBTACTIVATESTRUCT16))) @@ -1617,7 +1615,7 @@ LONG WINPOS_SendNCCalcSize( HWND32 hwnd, BOOL32 calcValidRect, } result = SendMessage32A( hwnd, WM_NCCALCSIZE, calcValidRect, (LPARAM)¶ms ); - dprintf_win( stddeb, "WINPOS_SendNCCalcSize: %d,%d-%d,%d\n", + dprintf_info(win, "WINPOS_SendNCCalcSize: %d,%d-%d,%d\n", params.rgrc[0].left, params.rgrc[0].top, params.rgrc[0].right, params.rgrc[0].bottom ); *newClientRect = params.rgrc[0]; @@ -1817,7 +1815,7 @@ static UINT32 WINPOS_SizeMoveClean( WND* Wnd, HRGN32 oldVisRgn, HRGN32 dirtyRgn = CreateRectRgn32(0,0,0,0); int other, my; - dprintf_win(stddeb,"cleaning up...new wnd=(%i %i-%i %i) old wnd=(%i %i-%i %i)\n\ + dprintf_info(win,"cleaning up...new wnd=(%i %i-%i %i) old wnd=(%i %i-%i %i)\n\ \t\tnew client=(%i %i-%i %i) old client=(%i %i-%i %i)\n", Wnd->rectWindow.left, Wnd->rectWindow.top, Wnd->rectWindow.right, Wnd->rectWindow.bottom, @@ -2057,7 +2055,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter, int result = 0; UINT32 uFlags = 0; - dprintf_win(stddeb,"SetWindowPos: hwnd %04x, (%i,%i)-(%i,%i) flags %08x\n", + dprintf_info(win,"SetWindowPos: hwnd %04x, (%i,%i)-(%i,%i) flags %08x\n", hwnd, x, y, x+cx, y+cy, flags); /* Check window handle */ @@ -2192,14 +2190,16 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter, /* FIXME: WVR_ALIGNxxx */ - if( newClientRect.left != wndPtr->rectClient.left || - newClientRect.top != wndPtr->rectClient.top ) + if( !(winpos.flags & SWP_NOMOVE) && + (newClientRect.left != wndPtr->rectClient.left || + newClientRect.top != wndPtr->rectClient.top) ) winpos.flags &= ~SWP_NOCLIENTMOVE; - if( (newClientRect.right - newClientRect.left != - wndPtr->rectClient.right - wndPtr->rectClient.left) || - (newClientRect.bottom - newClientRect.top != - wndPtr->rectClient.bottom - wndPtr->rectClient.top) ) + if( !(winpos.flags & SWP_NOSIZE) && + ((newClientRect.right - newClientRect.left != + wndPtr->rectClient.right - wndPtr->rectClient.left) || + (newClientRect.bottom - newClientRect.top != + wndPtr->rectClient.bottom - wndPtr->rectClient.top)) ) winpos.flags &= ~SWP_NOCLIENTSIZE; } else @@ -2398,7 +2398,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter, /* And last, send the WM_WINDOWPOSCHANGED message */ - dprintf_win(stddeb,"\tstatus flags = %04x\n", winpos.flags & SWP_AGG_STATUSFLAGS); + dprintf_info(win,"\tstatus flags = %04x\n", winpos.flags & SWP_AGG_STATUSFLAGS); if ( ((winpos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE) && !(winpos.flags & SWP_NOSENDCHANGING)) diff --git a/windows/winproc.c b/windows/winproc.c index 1402b6c3b35..1474a77abf7 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -13,7 +13,6 @@ #include "struct32.h" #include "win.h" #include "winproc.h" -#include "stddebug.h" #include "debug.h" /* Window procedure 16-to-32-bit thunk, @@ -115,7 +114,7 @@ BOOL32 WINPROC_Init(void) static LRESULT WINPROC_CallWndProc32( WNDPROC32 proc, HWND32 hwnd, UINT32 msg, WPARAM32 wParam, LPARAM lParam ) { - dprintf_relay( stddeb, "CallTo32(wndproc=%p,hwnd=%08x,msg=%08x,wp=%08x,lp=%08lx)\n", + dprintf_info(relay, "CallTo32(wndproc=%p,hwnd=%08x,msg=%08x,wp=%08x,lp=%08lx)\n", proc, hwnd, msg, wParam, lParam ); return proc( hwnd, msg, wParam, lParam ); } @@ -225,7 +224,7 @@ static WINDOWPROC *WINPROC_AllocWinProc( WNDPROC16 func, WINDOWPROCTYPE type, proc->user = user; } proc->next = NULL; - dprintf_win( stddeb, "WINPROC_AllocWinProc(%08x,%d): returning %08x\n", + dprintf_info(win, "WINPROC_AllocWinProc(%08x,%d): returning %08x\n", (UINT32)func, type, (UINT32)proc ); return proc; } @@ -340,7 +339,7 @@ BOOL32 WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC16 func, /* Add the win proc at the head of the list */ - dprintf_win( stddeb, "WINPROC_SetProc(%08x,%08x,%d): res=%08x\n", + dprintf_info(win, "WINPROC_SetProc(%08x,%08x,%d): res=%08x\n", (UINT32)*pFirst, (UINT32)func, type, (UINT32)proc ); proc->next = *(WINDOWPROC **)pFirst; *(WINDOWPROC **)pFirst = proc; @@ -359,7 +358,7 @@ void WINPROC_FreeProc( HWINDOWPROC proc, WINDOWPROCUSER user ) { WINDOWPROC *next = ((WINDOWPROC *)proc)->next; if (((WINDOWPROC *)proc)->user != user) break; - dprintf_win( stddeb, "WINPROC_FreeProc: freeing %08x\n", (UINT32)proc); + dprintf_info(win, "WINPROC_FreeProc: freeing %08x\n", (UINT32)proc); HeapFree( WinProcHeap, 0, proc ); proc = next; }