Commit 85ed45e3 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 980822

Sat Aug 22 17:46:19 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de> * [include/dosexe.h] [include/module.h] [include/pe_image.h] [include/process.h] [include/windows.h] [loader/dos/module.c] [loader/module.c] [loader/ne/module.c] [loader/pe_image.c] [scheduler/process.c] [win32/process.c] Partially implemented CreateProcess32. * [win32/device.c] [relay32/kernel32.spec] [scheduler/k32obj.c] [misc/registry.c] [win32/file.c] Partially implemented VxDCall (VMM registry services). * [files/dos_fs.c] DOSFS_FindNext made thread-safe. * [include/sig_context.h] [include/syslevel.h] [loader/signal.c] [scheduler/syslevel.c] [tools/build.c] Replaced CALLTO16_Current_fs by SYSLEVEL_Win16CurrentTeb. * [win32/kernel32.c] Bugfix: QT_Thunk/FT_Thunk should return 'long' in DX:AX, not EAX. * [if1632/relay.c] [relay32/builtin32.c] [windows/msgbox.c] [msdos/int20.c] [msdos/int21.c] Use ExitProcess instead of TASK_KillCurrentTask. * [include/task.h] [include/thread.h] [loader/task.c] [scheduler/thread.c] [include/queue.h] [windows/message.c] [windows/queue.c] [windows/win.c] Prevent Win32 threads from entering the TASK_Reschedule loop. (Note: Win32 messaging still doesn't work correctly; this patch is just preventing the system from crashing when Win32 threads call messaging functions. Messages will probably still get lost.) * [scheduler/critsection.c] Deactivated the use of SEM_UNDO for the SYSTEM_LOCK semaphore; for some reason, this leads to problems after threads terminate... Sat Aug 22 15:00:00 1998 Jrgen Schmied <juergen.schmied@metronet.de> * [include/authors.h] New file, includes all names of the developer (former shell.c) * [Makefile.in][configure][configure.in][dlls/Makefile.in] [dlls/shell32/Makefile.in][shres.rc] Created dlls/shell32 and moved the shell32 stuff in it. Started to create internal resources. * [dlls/shell32/*] Split the shell32 implementation into smaller files. New classes: IContextMenu, IExtractIcon, IShellView. Implemented Shell_GetImageList(). shell32 links to comctl32 now dynamically so it can use internal/external implementations. * [documentation/internal-dll] [documentation/shell32] New, could anybody do a spellcheck? * [include/commctrl.h] Many new LV constants, structures, functions. * [controls/comctl32undoc.c] Rewrote the DSA* functions. * [windows/winpos.c] SetShellWindow32, GetShellWindow32. Sat Aug 22 14:02:15 1998 Alexander Lukyanov <lav@long.yar.ru> * [loader/resource.c] Mark last accelerator as such in LoadAccelerators32W. * [relay32/shell32.spec] [misc/shell.c] Add stubs for SHGetSpecialFolderPath[AW]. Sat Aug 22 02:07:42 1998 Adrian Harvey <adrian@select.com.au> * [include/file.h] [file/file.c] [msdos/int21.c] [msdos/vxd.c] [misc/lzexpand.c] [win32/kernel32.c] [documentation/filehandles] Fixed file handle handling. Created universal HFILE16 to HFILE32 translation macro from msdos/int21 code by Ove Kaaven. Used macro in all Win16 functions so that win32 handles are translated to avoid DOS/Win16 stdxx handles. Removed handle translation from int21.c where Win16 functions are called. Changed remaining calls to use new macro names. Documented filehandle handling and differences between win 16 & 32. Fri Aug 21 20:32:49 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [server/process.c] [server/thread.c] Implemented object wait queues and synchronization. Fri Aug 21 18:40:02 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [graphics/psdrv/*] DEVMODE dmPaper{Width|Length} fields are in 0.1mm. Select a 100 pixel default font in CreateDC. Thu Aug 20 22:47:39 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> * [objects/bitmap.c] Handle bits=32 in SetBitmapBits32 and GetBitmapBits32. * [msdos/int21.c] Add handling of Int21 0A and 37. * [misc/commdlg.c] Use MapHModuleLS and MapHModuleSL when translating HINSTANCE16 to HINSTANCE32 and vice versa. * [win32/file.c] CreateFile32A: Abort if filename == NULL. Thu Aug 20 12:28:31 1998 Marcus Meissner <marcus@jet.franken.de> * [*/*] Lots of missing prototypes added, some parameter types adapted to match SDK. * [debugger/stabs.c] Don't loop forever if we don't find wine or one of the libxxx.so. * [loader/ne/module.c] Implemented MapHModuleLS,MapHModuleSL,MapHinstLS,MapHinstSL. * [misc/network.c] Implemented WNetGetUser32A. * [misc/shellord.c] Implemented ILRemoveLastID. * [multimedia/dsound.c] Fixed StarCraft memory leak. * [graphics/ddraw.c] Removed some unnecessary simple relaying functions, tried polishing up the Xlib implementation (still doesn't work), temp. removed Xshm code (to be remerged with working Xlib code). Tue Aug 18 22:29:17 1998 Ove Kaaven <ovek@arcticnet.no> * [multimedia/mmio.c] [multimedia/mmsystem.c] Fixed most mmio bugs, fully implementing mmioSetBuffer buffering, ability to read memory files, and the sndPlaySound() SND_MEMORY flag. Most mmio-using programs now work fine. * [include/dosexe.h] [include/miscemu.h] [include/module.h] [loader/module.c] [loader/task.c] [msdos/dosmem.c] Improved DOS VM flexibility and portability somewhat. (Did I get the #ifdefs right this time, BSD-ers?) * [msdos/int21.c] Made "Get Current PSP address" work as expected in a DOS VM. * [loader/dos/*] Began improving flexibility and portability somewhat. It should be easier to add DPMI RMCB callbacks now. The DOS VM no longer leaves big files lying around in /tmp after a crash. Tue Aug 18 12:38:31 1998 Turchanov Sergey <turchanov@usa.net> * [relay32/winmm.spec] This patch allows WinAmp to play WAV files (at least in PCM format). Sun Aug 16 05:34:13 1998 Pablo Saratxaga <srtxg@chanae.alphanet.ch> * [windows/keyboard.c] Corrected keyboard code to properly handle keys : ? ~ and " on non US keyboards. Sat Aug 15 18:47:14 1998 Brian Craft <bcboy@dorothy.wanglab.brandeis.edu> * [windows/win.c] Fixed severe bug in EnumChildWindwos(). Thu Aug 13 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [controls/tooltips.c] Fixed some bugs. Added subclassing support. * [controls/toolbar.c] Improved tooltip integration. Fixed some bugs. * [controls/commctrl.c] Changed control registration and added some documentation. Fixed ShowHideMenuCtl. * [controls/rebar.c][include/rebar.h][include/commctrl.h] Improved rebar implementation (still no display). * [controls/pager.c][include/pager.h][include/commctrl.h] Improved pager implementation (still no display). * [misc/imagelist.c] Fixed a bug. * [documentation/common_controls] Updated. Sun Aug 9 19:50:20 1998 James Juran <jrj120@psu.edu> * [Makefile.in] [documentation/Makefile.in] [programs/Makefile.in] [programs/*/Makefile.in] Added uninstall rules, cleaned up install rules a little bit. Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net> * [loader/ne/module.c] [if1632/kernel.spec] Added the undocumented HIWORD of GetModuleHandle (hFirstModule). * [loader/ne/segment.c] Wine forgot to set some NE_SEGFLAGS_*. Combined with another loader change, this fixed the "BLINKER -- error in loading module" or ghost MessageBox problem that about 1% of all Windows programs have. Some BLINKER programs still don't work, though. But I'm working on it, with great help from Blinkinc. * [loader/task.c] InitTask needs to decrement the SP register by two as Win95 does. Sun Aug 9 02:41:28 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de> * [if1632/kernel.spec] [relay32/kernel32.spec] [scheduler/syslevel.c] [loader/main.c] [win32/ordinals.c] [include/syslevel.h] [scheduler/Makefile.in] Implemented Win95 'syslevel' routines (including Win16Lock). * [if1632/relay.c] [if1632/thunk.c] [tools/build.c] [loader/task.c] [loader/ne/segment.c] [win32/kernel32.c] [memory/selector.c] [include/stackframe.h] [include/thread.h] 16-bit %fs handling revised. Use Win16Lock where appropriate. * [include/thread.h] [scheduler/synchro.c] [windows/message.c] [windows/queue.c] [win32/process.c] Implemented MsgWaitForMultipleObjects. * [files/change.c] [files/Makefile.in] [scheduler/k32obj.c] [win32/newfns.c] Implemented (dummy) file change notification objects. * [debugger/dbg.y] [scheduler/process.c] [scheduler/thread.c] [include/process.h] [include/thread.h] Suspend all threads except current when hitting debugger break point. * [objects/dib.c] Bugfix for CreateDIBSection.
parent 767e6f6f
This is release 980809 of Wine, the MS Windows emulator. This is still a This is release 980822 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly. features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry. forget to include a ChangeLog entry.
WHAT'S NEW with Wine-980809: (see ChangeLog for details) WHAT'S NEW with Wine-980822: (see ChangeLog for details)
- Preliminary DOS executables support. - Improved mmio support.
- Postscript driver improvements. - VxDCall support.
- More client/server stuff. - More common controls and shell32 stuff.
- Better shell32.dll builtin support. - Better DOS executables support.
- Proper Win16 mutex locking.
- Lots of bug fixes. - Lots of bug fixes.
See the README file in the distribution for installation instructions. See the README file in the distribution for installation instructions.
...@@ -19,10 +18,10 @@ Because of lags created by using mirror, this message may reach you before ...@@ -19,10 +18,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available the release is available at the ftp sites. The sources will be available
from the following locations: from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980809.tar.gz ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980822.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980809.tar.gz ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980822.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980809.tar.gz ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980822.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980809.tar.gz ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980822.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite. It should also be available from any site that mirrors tsx-11 or sunsite.
......
---------------------------------------------------------------------- ----------------------------------------------------------------------
Sat Aug 22 17:46:19 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [include/dosexe.h] [include/module.h] [include/pe_image.h]
[include/process.h] [include/windows.h] [loader/dos/module.c]
[loader/module.c] [loader/ne/module.c] [loader/pe_image.c]
[scheduler/process.c] [win32/process.c]
Partially implemented CreateProcess32.
* [win32/device.c] [relay32/kernel32.spec] [scheduler/k32obj.c]
[misc/registry.c] [win32/file.c]
Partially implemented VxDCall (VMM registry services).
* [files/dos_fs.c]
DOSFS_FindNext made thread-safe.
* [include/sig_context.h] [include/syslevel.h] [loader/signal.c]
[scheduler/syslevel.c] [tools/build.c]
Replaced CALLTO16_Current_fs by SYSLEVEL_Win16CurrentTeb.
* [win32/kernel32.c]
Bugfix: QT_Thunk/FT_Thunk should return 'long' in DX:AX, not EAX.
* [if1632/relay.c] [relay32/builtin32.c] [windows/msgbox.c]
[msdos/int20.c] [msdos/int21.c]
Use ExitProcess instead of TASK_KillCurrentTask.
* [include/task.h] [include/thread.h] [loader/task.c]
[scheduler/thread.c] [include/queue.h] [windows/message.c]
[windows/queue.c] [windows/win.c]
Prevent Win32 threads from entering the TASK_Reschedule loop.
(Note: Win32 messaging still doesn't work correctly; this patch
is just preventing the system from crashing when Win32 threads
call messaging functions. Messages will probably still get lost.)
* [scheduler/critsection.c]
Deactivated the use of SEM_UNDO for the SYSTEM_LOCK semaphore;
for some reason, this leads to problems after threads terminate...
Sat Aug 22 15:00:00 1998 Jrgen Schmied <juergen.schmied@metronet.de>
* [include/authors.h]
New file, includes all names of the developer (former shell.c)
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/shell32/Makefile.in][shres.rc]
Created dlls/shell32 and moved the shell32 stuff in it.
Started to create internal resources.
* [dlls/shell32/*]
Split the shell32 implementation into smaller files.
New classes: IContextMenu, IExtractIcon, IShellView.
Implemented Shell_GetImageList().
shell32 links to comctl32 now dynamically so it can use
internal/external implementations.
* [documentation/internal-dll] [documentation/shell32]
New, could anybody do a spellcheck?
* [include/commctrl.h]
Many new LV constants, structures, functions.
* [controls/comctl32undoc.c]
Rewrote the DSA* functions.
* [windows/winpos.c]
SetShellWindow32, GetShellWindow32.
Sat Aug 22 14:02:15 1998 Alexander Lukyanov <lav@long.yar.ru>
* [loader/resource.c]
Mark last accelerator as such in LoadAccelerators32W.
* [relay32/shell32.spec] [misc/shell.c]
Add stubs for SHGetSpecialFolderPath[AW].
Sat Aug 22 02:07:42 1998 Adrian Harvey <adrian@select.com.au>
* [include/file.h] [file/file.c] [msdos/int21.c] [msdos/vxd.c]
[misc/lzexpand.c] [win32/kernel32.c] [documentation/filehandles]
Fixed file handle handling. Created universal HFILE16 to HFILE32
translation macro from msdos/int21 code by Ove Kaaven.
Used macro in all Win16 functions so that win32 handles are translated
to avoid DOS/Win16 stdxx handles.
Removed handle translation from int21.c where Win16 functions are
called. Changed remaining calls to use new macro names.
Documented filehandle handling and differences between win 16 & 32.
Fri Aug 21 20:32:49 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [server/process.c] [server/thread.c]
Implemented object wait queues and synchronization.
Fri Aug 21 18:40:02 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
DEVMODE dmPaper{Width|Length} fields are in 0.1mm.
Select a 100 pixel default font in CreateDC.
Thu Aug 20 22:47:39 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [objects/bitmap.c]
Handle bits=32 in SetBitmapBits32 and GetBitmapBits32.
* [msdos/int21.c]
Add handling of Int21 0A and 37.
* [misc/commdlg.c]
Use MapHModuleLS and MapHModuleSL when translating HINSTANCE16 to
HINSTANCE32 and vice versa.
* [win32/file.c]
CreateFile32A: Abort if filename == NULL.
Thu Aug 20 12:28:31 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*]
Lots of missing prototypes added, some parameter types adapted to match
SDK.
* [debugger/stabs.c]
Don't loop forever if we don't find wine or one of the libxxx.so.
* [loader/ne/module.c]
Implemented MapHModuleLS,MapHModuleSL,MapHinstLS,MapHinstSL.
* [misc/network.c]
Implemented WNetGetUser32A.
* [misc/shellord.c]
Implemented ILRemoveLastID.
* [multimedia/dsound.c]
Fixed StarCraft memory leak.
* [graphics/ddraw.c]
Removed some unnecessary simple relaying functions, tried polishing
up the Xlib implementation (still doesn't work), temp. removed Xshm
code (to be remerged with working Xlib code).
Tue Aug 18 22:29:17 1998 Ove Kaaven <ovek@arcticnet.no>
* [multimedia/mmio.c] [multimedia/mmsystem.c]
Fixed most mmio bugs, fully implementing mmioSetBuffer
buffering, ability to read memory files, and the
sndPlaySound() SND_MEMORY flag. Most mmio-using programs
now work fine.
* [include/dosexe.h] [include/miscemu.h] [include/module.h]
[loader/module.c] [loader/task.c] [msdos/dosmem.c]
Improved DOS VM flexibility and portability somewhat. (Did
I get the #ifdefs right this time, BSD-ers?)
* [msdos/int21.c]
Made "Get Current PSP address" work as expected in a DOS VM.
* [loader/dos/*]
Began improving flexibility and portability somewhat. It
should be easier to add DPMI RMCB callbacks now. The
DOS VM no longer leaves big files lying around in /tmp
after a crash.
Tue Aug 18 12:38:31 1998 Turchanov Sergey <turchanov@usa.net>
* [relay32/winmm.spec]
This patch allows WinAmp to play WAV files (at least in PCM
format).
Sun Aug 16 05:34:13 1998 Pablo Saratxaga <srtxg@chanae.alphanet.ch>
* [windows/keyboard.c]
Corrected keyboard code to properly handle keys : ? ~ and "
on non US keyboards.
Sat Aug 15 18:47:14 1998 Brian Craft <bcboy@dorothy.wanglab.brandeis.edu>
* [windows/win.c]
Fixed severe bug in EnumChildWindwos().
Thu Aug 13 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/tooltips.c]
Fixed some bugs. Added subclassing support.
* [controls/toolbar.c]
Improved tooltip integration. Fixed some bugs.
* [controls/commctrl.c]
Changed control registration and added some documentation.
Fixed ShowHideMenuCtl.
* [controls/rebar.c][include/rebar.h][include/commctrl.h]
Improved rebar implementation (still no display).
* [controls/pager.c][include/pager.h][include/commctrl.h]
Improved pager implementation (still no display).
* [misc/imagelist.c]
Fixed a bug.
* [documentation/common_controls]
Updated.
Sun Aug 9 19:50:20 1998 James Juran <jrj120@psu.edu>
* [Makefile.in] [documentation/Makefile.in]
[programs/Makefile.in] [programs/*/Makefile.in]
Added uninstall rules, cleaned up install rules a little bit.
----------------------------------------------------------------------
Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net> Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne/module.c] [if1632/kernel.spec] * [loader/ne/module.c] [if1632/kernel.spec]
...@@ -15,6 +224,33 @@ Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net> ...@@ -15,6 +224,33 @@ Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [loader/task.c] * [loader/task.c]
InitTask needs to decrement the SP register by two as Win95 does. InitTask needs to decrement the SP register by two as Win95 does.
Sun Aug 9 02:41:28 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [if1632/kernel.spec] [relay32/kernel32.spec] [scheduler/syslevel.c]
[loader/main.c] [win32/ordinals.c] [include/syslevel.h]
[scheduler/Makefile.in]
Implemented Win95 'syslevel' routines (including Win16Lock).
* [if1632/relay.c] [if1632/thunk.c] [tools/build.c] [loader/task.c]
[loader/ne/segment.c] [win32/kernel32.c] [memory/selector.c]
[include/stackframe.h] [include/thread.h]
16-bit %fs handling revised. Use Win16Lock where appropriate.
* [include/thread.h] [scheduler/synchro.c] [windows/message.c]
[windows/queue.c] [win32/process.c]
Implemented MsgWaitForMultipleObjects.
* [files/change.c] [files/Makefile.in] [scheduler/k32obj.c]
[win32/newfns.c]
Implemented (dummy) file change notification objects.
* [debugger/dbg.y] [scheduler/process.c] [scheduler/thread.c]
[include/process.h] [include/thread.h]
Suspend all threads except current when hitting debugger break point.
* [objects/dib.c]
Bugfix for CreateDIBSection.
Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de> Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*] * [*/*]
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# clean: remove all intermediate files # clean: remove all intermediate files
# distclean: also remove all files created by configure # distclean: also remove all files created by configure
# install: install everything # install: install everything
# uninstall: uninstall everything
# depend: create the dependencies # depend: create the dependencies
# etags: create a TAGS file for Emacs. # etags: create a TAGS file for Emacs.
# manpages: compile manpages for Wine API # manpages: compile manpages for Wine API
...@@ -26,6 +27,7 @@ LIBSUBDIRS = \ ...@@ -26,6 +27,7 @@ LIBSUBDIRS = \
tools \ tools \
tools/wrc \ tools/wrc \
controls \ controls \
dlls/shell32 \
files \ files \
graphics \ graphics \
graphics/metafiledrv \ graphics/metafiledrv \
...@@ -75,6 +77,7 @@ INSTALLSUBDIRS = $(DOCSUBDIRS) ...@@ -75,6 +77,7 @@ INSTALLSUBDIRS = $(DOCSUBDIRS)
LIBOBJS = \ LIBOBJS = \
controls/controls.o \ controls/controls.o \
dlls/shell32/shell32.o \
files/files.o \ files/files.o \
graphics/graphics.o \ graphics/graphics.o \
graphics/metafiledrv/metafiledrv.o \ graphics/metafiledrv/metafiledrv.o \
...@@ -112,6 +115,8 @@ all: $(MAIN_TARGET) ...@@ -112,6 +115,8 @@ all: $(MAIN_TARGET)
install:: install_$(MAIN_TARGET) install:: install_$(MAIN_TARGET)
uninstall:: uninstall_$(MAIN_TARGET)
emu: wine emu: wine
lib: $(LIBSUBDIRS) $(LIB_TARGET) lib: $(LIBSUBDIRS) $(LIB_TARGET)
...@@ -129,28 +134,47 @@ libwine.so.1.0: $(LIBOBJS) ...@@ -129,28 +134,47 @@ libwine.so.1.0: $(LIBOBJS)
$(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS) $(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS)
install_emu: install_lib install_emu: install_lib
-mkdirhier $(bindir) [ -d $(bindir) ] || $(MKDIR) $(bindir)
-mkdirhier $(libdir)
$(INSTALL_PROGRAM) wine $(bindir)/wine $(INSTALL_PROGRAM) wine $(bindir)/wine
$(INSTALL_DATA) wine.sym $(libdir)/wine.sym
$(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
uninstall_emu: uninstall_lib
$(RM) $(bindir)/wine $(bindir)/dosmod
install_lib: install_includes install_lib: install_includes
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_DATA) $(LIB_TARGET) $(libdir) $(INSTALL_DATA) $(LIB_TARGET) $(libdir)
$(INSTALL_DATA) wine.sym $(libdir)/wine.sym
uninstall_lib: uninstall_includes
cd $(libdir); $(RM) $(LIB_TARGET)
$(RM) $(libdir)/wine.sym
install_includes: dummy install_includes: dummy
if [ -d $(includedir) ]; then : ; else $(MKDIR) $(includedir); fi [ -d $(includedir) ] || $(MKDIR) $(includedir)
cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir) cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
# Don't just do a rm -rf on $(includedir) -- don't want to wipe out
# anything extra the user may have put there.
uninstall_includes: dummy
$(RM) $(includedir)/windows.h $(includedir)/wintypes.h
-rmdir $(includedir)
$(ALLSUBDIRS): dummy $(ALLSUBDIRS): dummy
@cd $@; $(SUBMAKE) @cd $@; $(SUBMAKE)
install_programs: dummy install_programs: dummy
@cd programs; $(SUBMAKE) install @cd programs; $(SUBMAKE) install
uninstall_programs: dummy
@cd programs; $(SUBMAKE) uninstall
install:: install::
for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
uninstall::
for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
depend:: dummy depend:: dummy
for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
......
...@@ -3396,6 +3396,8 @@ Make.rules ...@@ -3396,6 +3396,8 @@ Make.rules
Makefile Makefile
controls/Makefile controls/Makefile
debugger/Makefile debugger/Makefile
dlls/Makefile
dlls/shell32/Makefile
documentation/Makefile documentation/Makefile
files/Makefile files/Makefile
graphics/Makefile graphics/Makefile
...@@ -3531,6 +3533,8 @@ CONFIG_FILES=\${CONFIG_FILES-"Make.rules ...@@ -3531,6 +3533,8 @@ CONFIG_FILES=\${CONFIG_FILES-"Make.rules
Makefile Makefile
controls/Makefile controls/Makefile
debugger/Makefile debugger/Makefile
dlls/Makefile
dlls/shell32/Makefile
documentation/Makefile documentation/Makefile
files/Makefile files/Makefile
graphics/Makefile graphics/Makefile
......
...@@ -460,6 +460,8 @@ Make.rules ...@@ -460,6 +460,8 @@ Make.rules
Makefile Makefile
controls/Makefile controls/Makefile
debugger/Makefile debugger/Makefile
dlls/Makefile
dlls/shell32/Makefile
documentation/Makefile documentation/Makefile
files/Makefile files/Makefile
graphics/Makefile graphics/Makefile
......
...@@ -22,18 +22,43 @@ ...@@ -22,18 +22,43 @@
#include "updown.h" #include "updown.h"
#include "debug.h" #include "debug.h"
/*********************************************************************** /***********************************************************************
* ComCtl32LibMain * ComCtl32LibMain [Internal] Initializes the internal 'COMCTL32.DLL'.
*
* PARAMS
* hinstDLL [I]
* fdwReason [I]
* lpvReserved [I]
*
*/ */
BOOL32 WINAPI ComCtl32LibMain (HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL32 WINAPI
{ TRACE(commctrl,"%x,%lx,%p\n",hinstDLL,fdwReason,lpvReserved); ComCtl32LibMain (HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
if ( fdwReason == DLL_PROCESS_ATTACH) {
{ InitCommonControls(); TRACE (commctrl, "%x,%lx,%p\n", hinstDLL, fdwReason, lpvReserved);
}
return TRUE; switch (fdwReason) {
case DLL_PROCESS_ATTACH:
TRACE (commctrl, "No animation class implemented!\n");
HEADER_Register ();
TRACE (commctrl, "No hotkey class implemented!\n");
LISTVIEW_Register ();
PROGRESS_Register ();
STATUS_Register ();
TRACE (commctrl, "No tab class implemented!\n");
TOOLBAR_Register ();
TOOLTIPS_Register ();
TRACKBAR_Register ();
TREEVIEW_Register ();
UPDOWN_Register ();
break;
}
return TRUE;
} }
/*********************************************************************** /***********************************************************************
* DrawStatusText32A [COMCTL32.5][COMCTL32.27] * DrawStatusText32A [COMCTL32.5][COMCTL32.27]
* *
...@@ -73,9 +98,18 @@ DrawStatusText32A (HDC32 hdc, LPRECT32 lprc, LPCSTR text, UINT32 style) ...@@ -73,9 +98,18 @@ DrawStatusText32A (HDC32 hdc, LPRECT32 lprc, LPCSTR text, UINT32 style)
/*********************************************************************** /***********************************************************************
* DrawStatusText32W [COMCTL32.28] * DrawStatusText32W [COMCTL32.28]
*
* Draws text with borders, like in a status bar.
*
* PARAMS
* hdc [I] handle to the window's display context
* lprc [I] pointer to a rectangle
* text [I] pointer to the text
* style [I]
*/ */
void WINAPI DrawStatusText32W( HDC32 hdc, LPRECT32 lprc, LPCWSTR text,
UINT32 style ) VOID WINAPI
DrawStatusText32W (HDC32 hdc, LPRECT32 lprc, LPCWSTR text, UINT32 style)
{ {
LPSTR p = HEAP_strdupWtoA( GetProcessHeap(), 0, text ); LPSTR p = HEAP_strdupWtoA( GetProcessHeap(), 0, text );
DrawStatusText32A(hdc, lprc, p, style); DrawStatusText32A(hdc, lprc, p, style);
...@@ -137,19 +171,14 @@ HWND32 WINAPI CreateUpDownControl( DWORD style, INT32 x, INT32 y, ...@@ -137,19 +171,14 @@ HWND32 WINAPI CreateUpDownControl( DWORD style, INT32 x, INT32 y,
* None. * None.
* *
* NOTES * NOTES
* Calls InitCommonControlsEx. * This function is just a dummy.
* InitCommonControlsEx should be used instead. * The Win95 controls are registered at the DLL's initialization.
* To register other controls InitCommonControlsEx must be used.
*/ */
VOID WINAPI VOID WINAPI
InitCommonControls (VOID) InitCommonControls (VOID)
{ {
INITCOMMONCONTROLSEX icc;
icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
icc.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx (&icc);
} }
...@@ -160,6 +189,10 @@ InitCommonControls (VOID) ...@@ -160,6 +189,10 @@ InitCommonControls (VOID)
* *
* PARAMS * PARAMS
* lpInitCtrls [I] pointer to a INITCOMMONCONTROLS structure. * lpInitCtrls [I] pointer to a INITCOMMONCONTROLS structure.
*
* NOTES
* Only the additinal common controls are registered by this function.
* The Win95 controls are registered at the DLL's initialization.
*/ */
BOOL32 WINAPI BOOL32 WINAPI
...@@ -173,49 +206,21 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls) ...@@ -173,49 +206,21 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
if (lpInitCtrls == NULL) return FALSE; if (lpInitCtrls == NULL) return FALSE;
if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return FALSE; if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return FALSE;
for (cCount = 0; cCount <= 31; cCount++) { for (cCount = 0; cCount < 32; cCount++) {
dwMask = 1 << cCount; dwMask = 1 << cCount;
if (!(lpInitCtrls->dwICC & dwMask)) if (!(lpInitCtrls->dwICC & dwMask))
continue; continue;
switch (lpInitCtrls->dwICC & dwMask) { switch (lpInitCtrls->dwICC & dwMask) {
/* dummy initialization */
case ICC_ANIMATE_CLASS:
case ICC_BAR_CLASSES:
case ICC_LISTVIEW_CLASSES: case ICC_LISTVIEW_CLASSES:
LISTVIEW_Register ();
HEADER_Register ();
break;
case ICC_TREEVIEW_CLASSES: case ICC_TREEVIEW_CLASSES:
TREEVIEW_Register ();
TOOLTIPS_Register ();
break;
case ICC_BAR_CLASSES:
TOOLBAR_Register ();
STATUS_Register ();
TRACKBAR_Register ();
TOOLTIPS_Register ();
break;
case ICC_TAB_CLASSES: case ICC_TAB_CLASSES:
TRACE (commctrl, "No tab class implemented!\n");
TOOLTIPS_Register ();
UPDOWN_Register ();
break;
case ICC_UPDOWN_CLASS: case ICC_UPDOWN_CLASS:
UPDOWN_Register ();
break;
case ICC_PROGRESS_CLASS: case ICC_PROGRESS_CLASS:
PROGRESS_Register ();
break;
case ICC_HOTKEY_CLASS: case ICC_HOTKEY_CLASS:
TRACE (commctrl, "No hotkey class implemented!\n");
break;
case ICC_ANIMATE_CLASS:
TRACE (commctrl, "No animation class implemented!\n");
break; break;
/* advanced classes - not included in Win95 */ /* advanced classes - not included in Win95 */
...@@ -267,6 +272,10 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls) ...@@ -267,6 +272,10 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
* hInst * hInst
* hwndStatus * hwndStatus
* lpwIDs * lpwIDs
*
* NOTES
* Some features are still missing because of incomplete WM_MENUSELECT
* messages (16->32 bit conversion).
*/ */
VOID WINAPI VOID WINAPI
...@@ -528,32 +537,60 @@ GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo) ...@@ -528,32 +537,60 @@ GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo)
/*********************************************************************** /***********************************************************************
* ShowHideMenuCtl [COMCTL32.3] * ShowHideMenuCtl [COMCTL32.3]
*
* Shows or hides controls and updates the corresponding menu item.
* *
* PARAMS * PARAMS
* hwnd [I] handle to the client window. * hwnd [I] handle to the client window.
* uFlags [I] menu command id * uFlags [I] menu command id.
* lpInfo [I] pointer to an array of integers * lpInfo [I] pointer to an array of integers. (See NOTES.)
* *
* NOTES * NOTES
* The official documentation is incomplete! This has been fixed.
*
* lpInfo
* The array of integers contains pairs of values. BOTH values of
* the first pair must be the handles to application's main menu.
* Each subsequent pair consists of a menu id and control id.
*/ */
BOOL32 WINAPI BOOL32 WINAPI
ShowHideMenuCtl (HWND32 hwnd, UINT32 uFlags, LPINT32 lpInfo) ShowHideMenuCtl (HWND32 hwnd, UINT32 uFlags, LPINT32 lpInfo)
{ {
LPINT32 lpMenuId;
FIXME (commctrl, "(0x%08x 0x%08x %p): empty stub!\n", FIXME (commctrl, "(0x%08x 0x%08x %p): empty stub!\n",
hwnd, uFlags, lpInfo); hwnd, uFlags, lpInfo);
#if 0
if (GetMenuState (lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
/* checked -> hide control */
if (lpInfo == NULL)
return FALSE;
if (!(lpInfo[0]) || !(lpInfo[1]))
return FALSE;
/* search for control */
lpMenuId = &lpInfo[2];
while (*lpMenuId != uFlags)
lpMenuId += 2;
if (GetMenuState32 (lpInfo[1], uFlags, MF_BYCOMMAND) & MFS_CHECKED) {
/* uncheck menu item */
CheckMenuItem32 (lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_UNCHECKED);
/* hide control */
lpMenuId++;
SetWindowPos32 (GetDlgItem32 (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
SWP_HIDEWINDOW);
} }
else { else {
/* not checked -> show control */ /* check menu item */
CheckMenuItem32 (lpInfo[0], *lpMenuId, MF_BYCOMMAND | MF_CHECKED);
/* show control */
lpMenuId++;
SetWindowPos32 (GetDlgItem32 (hwnd, *lpMenuId), 0, 0, 0, 0, 0,
SWP_SHOWWINDOW);
} }
#endif return TRUE;
return FALSE;
} }
...@@ -3852,7 +3852,7 @@ BOOL32 WINAPI SetMenuItemInfo32W(HMENU32 hmenu, UINT32 item, BOOL32 bypos, ...@@ -3852,7 +3852,7 @@ BOOL32 WINAPI SetMenuItemInfo32W(HMENU32 hmenu, UINT32 item, BOOL32 bypos,
/********************************************************************** /**********************************************************************
* SetMenuDefaultItem32 (USER32.489) * SetMenuDefaultItem32 (USER32.489)
*/ */
BOOL32 WINAPI SetMenuDefaultItem32(HMENU32 hmenu, UINT32 item, BOOL32 bypos) BOOL32 WINAPI SetMenuDefaultItem32(HMENU32 hmenu, UINT32 item, UINT32 bypos)
{ {
MENUITEM *menuitem = MENU_FindItem(&hmenu, &item, bypos); MENUITEM *menuitem = MENU_FindItem(&hmenu, &item, bypos);
POPUPMENU *menu; POPUPMENU *menu;
...@@ -3938,7 +3938,7 @@ BOOL32 WINAPI InsertMenuItem32W(HMENU32 hMenu, UINT32 uItem, BOOL32 bypos, ...@@ -3938,7 +3938,7 @@ BOOL32 WINAPI InsertMenuItem32W(HMENU32 hMenu, UINT32 uItem, BOOL32 bypos,
BOOL32 WINAPI CheckMenuRadioItem32(HMENU32 hMenu, BOOL32 WINAPI CheckMenuRadioItem32(HMENU32 hMenu,
UINT32 first, UINT32 last, UINT32 check, UINT32 first, UINT32 last, UINT32 check,
BOOL32 bypos) UINT32 bypos)
{ {
MENUITEM *mifirst, *milast, *micheck; MENUITEM *mifirst, *milast, *micheck;
HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu; HMENU32 mfirst = hMenu, mlast = hMenu, mcheck = hMenu;
......
...@@ -25,6 +25,17 @@ ...@@ -25,6 +25,17 @@
static __inline__ LRESULT static __inline__ LRESULT
PAGER_ForwardMouse (WND *wndPtr, WPARAM32 wParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
infoPtr->bForward = (BOOL32)wParam;
return 0;
}
static __inline__ LRESULT
PAGER_GetBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) PAGER_GetBkColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{ {
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr); PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
...@@ -51,6 +62,28 @@ PAGER_GetButtonSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) ...@@ -51,6 +62,28 @@ PAGER_GetButtonSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
} }
// << PAGER_GetButtonState >>
// << PAGER_GetDropTarget >>
static __inline__ LRESULT
PAGER_GetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
return infoPtr->iPos;
}
static LRESULT
PAGER_RecalcSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
// PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
FIXME (pager, "empty stub!\n");
return 0;
}
static __inline__ LRESULT static __inline__ LRESULT
...@@ -108,6 +141,18 @@ PAGER_SetChild (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) ...@@ -108,6 +141,18 @@ PAGER_SetChild (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
} }
static __inline__ LRESULT
PAGER_SetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
infoPtr->iPos = (INT32)lParam;
/* FIXME: redraw */
return 0;
}
static LRESULT static LRESULT
PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...@@ -120,7 +165,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) ...@@ -120,7 +165,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
wndPtr->wExtra[0] = (DWORD)infoPtr; wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) { if (infoPtr == NULL) {
ERR (treeview, "could not allocate info memory!\n"); ERR (pager, "could not allocate info memory!\n");
return 0; return 0;
} }
...@@ -134,6 +179,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) ...@@ -134,6 +179,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->clrBk = GetSysColor32 (COLOR_BTNFACE); infoPtr->clrBk = GetSysColor32 (COLOR_BTNFACE);
infoPtr->iBorder = 0; infoPtr->iBorder = 0;
infoPtr->iButtonSize = 0; infoPtr->iButtonSize = 0;
infoPtr->iPos = 0;
return 0; return 0;
...@@ -148,7 +194,7 @@ PAGER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) ...@@ -148,7 +194,7 @@ PAGER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* free tree view info data */ /* free pager info data */
HeapFree (GetProcessHeap (), 0, infoPtr); HeapFree (GetProcessHeap (), 0, infoPtr);
return 0; return 0;
...@@ -169,15 +215,19 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam) ...@@ -169,15 +215,19 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
} }
// << PAGER_MouseMove >>
// << PAGER_Paint >>
LRESULT WINAPI LRESULT WINAPI
PagerWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam) PAGER_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{ {
WND *wndPtr = WIN_FindWndPtr(hwnd); WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg) switch (uMsg)
{ {
// case PGM_FORWARDMOUSE: case PGM_FORWARDMOUSE:
return PAGER_ForwardMouse (wndPtr, wParam);
case PGM_GETBKCOLOR: case PGM_GETBKCOLOR:
return PAGER_GetBkColor (wndPtr, wParam, lParam); return PAGER_GetBkColor (wndPtr, wParam, lParam);
...@@ -190,8 +240,12 @@ PagerWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam) ...@@ -190,8 +240,12 @@ PagerWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
// case PGM_GETBUTTONSTATE: // case PGM_GETBUTTONSTATE:
// case PGM_GETDROPTARGET: // case PGM_GETDROPTARGET:
// case PGM_GETPOS:
// case PGM_RECALCSIZE: case PGM_GETPOS:
return PAGER_SetPos (wndPtr, wParam, lParam);
case PGM_RECALCSIZE:
return PAGER_RecalcSize (wndPtr, wParam, lParam);
case PGM_SETBKCOLOR: case PGM_SETBKCOLOR:
return PAGER_SetBkColor (wndPtr, wParam, lParam); return PAGER_SetBkColor (wndPtr, wParam, lParam);
...@@ -205,7 +259,8 @@ PagerWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam) ...@@ -205,7 +259,8 @@ PagerWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case PGM_SETCHILD: case PGM_SETCHILD:
return PAGER_SetChild (wndPtr, wParam, lParam); return PAGER_SetChild (wndPtr, wParam, lParam);
// case PGM_SETPOS: case PGM_SETPOS:
return PAGER_SetPos (wndPtr, wParam, lParam);
case WM_CREATE: case WM_CREATE:
return PAGER_Create (wndPtr, wParam, lParam); return PAGER_Create (wndPtr, wParam, lParam);
...@@ -242,7 +297,7 @@ PAGER_Register (void) ...@@ -242,7 +297,7 @@ PAGER_Register (void)
ZeroMemory (&wndClass, sizeof(WNDCLASS32A)); ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS; wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS;
wndClass.lpfnWndProc = (WNDPROC32)PagerWindowProc; wndClass.lpfnWndProc = (WNDPROC32)PAGER_WindowProc;
wndClass.cbClsExtra = 0; wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(PAGER_INFO *); wndClass.cbWndExtra = sizeof(PAGER_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A); wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);
......
...@@ -1075,7 +1075,7 @@ DEBUG_ProcessElfObject(char * filename, unsigned int load_offset) ...@@ -1075,7 +1075,7 @@ DEBUG_ProcessElfObject(char * filename, unsigned int load_offset)
goto leave; goto leave;
} }
free(fn); free(fn);
if (t) s = t+1; if (t) s = t+1; else break;
} }
if (!s || !*s) fprintf(stderr," not found"); if (!s || !*s) fprintf(stderr," not found");
free(paths); free(paths);
......
SUBDIRS = \
shell32
all: $(SUBDIRS)
$(SUBDIRS): dummy
@cd $@; $(MAKE)
depend:
for i in $(SUBDIRS); do (cd $$i; $(MAKE) depend) || exit 1; done
install:
for i in $(SUBDIRS); do (cd $$i; $(MAKE) install) || exit 1; done
uninstall:
for i in $(SUBDIRS); do (cd $$i; $(MAKE) uninstall) || exit 1; done
clean:
for i in $(SUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
dummy:
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = shell32
WRCEXTRA = -A -p $*
C_SRCS = \
contmenu.c \
enumidlist.c \
folders.c \
pidl.c \
shell32_main.c \
shellole.c \
shellord.c \
shlfolder.c \
shlview.c
RC_SRCS = \
shres.rc
all: check_wrc $(MODULE).o
@MAKE_RULES@
$(RC_SRCS:.rc=.s): $(WRC)
### Dependencies:
/*
* Shell Folder stuff (...and all the OLE-Objects of SHELL32.DLL)
*
* Copyright 1997 Marcus Meissner
* Copyright 1998 Juergen Schmied
*
* !!! currently work in progress on all classes !!!
* <contact juergen.schmied@metronet.de, 980801>
*/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "ole.h"
#include "ole2.h"
#include "debug.h"
#include "compobj.h"
#include "interfaces.h"
#include "shlobj.h"
#include "shell.h"
#include "winerror.h"
#include "winnls.h"
#include "winproc.h"
#include "commctrl.h"
#include "shell32_main.h"
/******************************************************************************
* foreward declaration
*/
/* IExtractIcon implementation*/
static HRESULT WINAPI IExtractIcon_QueryInterface(LPEXTRACTICON, REFIID, LPVOID *);
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON);
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON);
static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON);
static HRESULT IExtractIcon_GetIconLocation(LPEXTRACTICON, UINT32, LPSTR, UINT32, int *, UINT32 *);
static HRESULT IExtractIcon_Extract(LPEXTRACTICON, LPCSTR, UINT32, HICON32 *, HICON32 *, UINT32);
/* IShellLink Implementation */
static HRESULT WINAPI IShellLink_QueryInterface(LPSHELLLINK,REFIID,LPVOID*);
static ULONG WINAPI IShellLink_AddRef(LPSHELLLINK);
static ULONG WINAPI IShellLink_Release(LPSHELLLINK);
/***********************************************************************
* IExtractIcon implementation
*/
static struct IExtractIcon_VTable eivt =
{ IExtractIcon_QueryInterface,
IExtractIcon_AddRef,
IExtractIcon_Release,
IExtractIcon_GetIconLocation,
IExtractIcon_Extract
};
/**************************************************************************
* IExtractIcon_Constructor
*/
LPEXTRACTICON IExtractIcon_Constructor(LPCITEMIDLIST pidl)
{ LPEXTRACTICON ei;
ei=(LPEXTRACTICON)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIcon));
ei->ref=1;
ei->lpvtbl=&eivt;
ei->pidl=ILClone(pidl);
TRACE(shell,"(%p)\n",ei);
return ei;
}
/**************************************************************************
* IExtractIcon_QueryInterface
*/
static HRESULT WINAPI IExtractIcon_QueryInterface( LPEXTRACTICON this, REFIID riid, LPVOID *ppvObj)
{ char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE(shell,"(%p)->(\n\tIID:\t%s,%p)\n",this,xriid,ppvObj);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = this;
}
else if(IsEqualIID(riid, &IID_IExtractIcon)) /*IExtractIcon*/
{ *ppvObj = (IExtractIcon*)this;
}
if(*ppvObj)
{ (*(LPEXTRACTICON*)ppvObj)->lpvtbl->fnAddRef(this);
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE(shell,"-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/**************************************************************************
* IExtractIcon_AddRef
*/
static ULONG WINAPI IExtractIcon_AddRef(LPEXTRACTICON this)
{ TRACE(shell,"(%p)->(count=%lu)\n",this,(this->ref)+1);
return ++(this->ref);
}
/**************************************************************************
* IExtractIcon_Release
*/
static ULONG WINAPI IExtractIcon_Release(LPEXTRACTICON this)
{ TRACE(shell,"(%p)->()\n",this);
if (!--(this->ref))
{ TRACE(shell," destroying IExtractIcon(%p)\n",this);
SHFree(this->pidl);
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/**************************************************************************
* IExtractIcon_GetIconLocation
* NOTE
* FIXME returns allways the icon no. 3 (closed Folder)
*/
static HRESULT IExtractIcon_GetIconLocation(LPEXTRACTICON this, UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax, int * piIndex, UINT32 * pwFlags)
{ FIXME (shell,"(%p) (flags=%u file=%s max=%u %p %p) semi-stub\n", this, uFlags, szIconFile, cchMax, piIndex, pwFlags);
*pwFlags = GIL_NOTFILENAME;
*piIndex = 3;
return NOERROR;
}
/**************************************************************************
* IExtractIcon_Extract
*/
static HRESULT IExtractIcon_Extract(LPEXTRACTICON this, LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize)
{ FIXME (shell,"(%p) (file=%s index=%u %p %p size=%u) semi-stub\n", this, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
*phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
*phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
return S_OK;
}
/**************************************************************************
* IShellLink Implementation
*/
static struct IShellLink_VTable slvt = {
IShellLink_QueryInterface,
IShellLink_AddRef,
IShellLink_Release,
(void *)0xcafe0004,
(void *)0xcafe0005,
(void *)0xcafe0006,
(void *)0xcafe0007,
(void *)0xcafe0008,
(void *)0xcafe0009,
(void *)0xcafe0010,
(void *)0xcafe0011,
(void *)0xcafe0012,
(void *)0xcafe0013,
(void *)0xcafe0014,
(void *)0xcafe0015,
(void *)0xcafe0016,
(void *)0xcafe0017,
(void *)0xcafe0018,
(void *)0xcafe0019,
(void *)0xcafe0020,
(void *)0xcafe0021
};
/**************************************************************************
* IShellLink_Constructor
*/
LPSHELLLINK IShellLink_Constructor()
{ LPSHELLLINK sl;
sl = (LPSHELLLINK)HeapAlloc(GetProcessHeap(),0,sizeof(IShellLink));
sl->ref = 1;
sl->lpvtbl = &slvt;
TRACE(shell,"(%p)->()\n",sl);
return sl;
}
/**************************************************************************
* IShellLink::QueryInterface
*/
static HRESULT WINAPI IShellLink_QueryInterface(
LPSHELLLINK this, REFIID riid, LPVOID *ppvObj)
{ char xriid[50];
WINE_StringFromCLSID((LPCLSID)riid,xriid);
TRACE(shell,"(%p)->(\n\tIID:\t%s)\n",this,xriid);
*ppvObj = NULL;
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
{ *ppvObj = this;
}
else if(IsEqualIID(riid, &IID_IShellLink)) /*IShellLink*/
{ *ppvObj = (LPSHELLLINK)this;
}
if(*ppvObj)
{ (*(LPSHELLLINK*)ppvObj)->lpvtbl->fnAddRef(this);
TRACE(shell,"-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
return S_OK;
}
TRACE(shell,"-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
}
/******************************************************************************
* IShellLink_AddRef
*/
static ULONG WINAPI IShellLink_AddRef(LPSHELLLINK this)
{ TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
return ++(this->ref);
}
/******************************************************************************
* IClassFactory_Release
*/
static ULONG WINAPI IShellLink_Release(LPSHELLLINK this)
{ TRACE(shell,"(%p)->(count=%lu)\n",this,this->ref);
if (!--(this->ref))
{ TRACE(shell,"-- destroying IShellLink(%p)\n",this);
HeapFree(GetProcessHeap(),0,this);
return 0;
}
return this->ref;
}
/* INTERNAL CLASS pidlmgr */
#ifndef __WINE_PIDL_H
#define __WINE_PIDL_H
extern LPITEMIDLIST PidlMgr_CreateDesktop(LPPIDLMGR);
extern LPITEMIDLIST PidlMgr_CreateMyComputer(LPPIDLMGR);
extern LPITEMIDLIST PidlMgr_CreateDrive(LPPIDLMGR,LPCSTR);
extern LPITEMIDLIST PidlMgr_CreateFolder(LPPIDLMGR,LPCSTR);
extern LPITEMIDLIST PidlMgr_CreateValue(LPPIDLMGR,LPCSTR);
extern BOOL32 PidlMgr_GetDesktop(LPPIDLMGR,LPCITEMIDLIST,LPSTR);
extern BOOL32 PidlMgr_GetDrive(LPPIDLMGR,LPCITEMIDLIST,LPSTR,UINT16);
extern LPITEMIDLIST PidlMgr_GetLastItem(LPPIDLMGR,LPCITEMIDLIST);
extern DWORD PidlMgr_GetItemText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,UINT16);
extern BOOL32 PidlMgr_IsDesktop(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsMyComputer(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsDrive(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsFolder(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_IsValue(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_HasFolders(LPPIDLMGR,LPSTR,LPCITEMIDLIST);
extern DWORD PidlMgr_GetFolderText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
extern DWORD PidlMgr_GetValueText(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
extern BOOL32 PidlMgr_GetValueType(LPPIDLMGR,LPCITEMIDLIST,LPCITEMIDLIST,LPDWORD);
extern DWORD PidlMgr_GetDataText(LPPIDLMGR,LPCITEMIDLIST,LPCITEMIDLIST,LPSTR,DWORD);
extern DWORD PidlMgr_GetPidlPath(LPPIDLMGR,LPCITEMIDLIST,LPSTR,DWORD);
extern LPITEMIDLIST PidlMgr_Create(LPPIDLMGR,PIDLTYPE,LPVOID,UINT16);
extern DWORD PidlMgr_GetData(LPPIDLMGR,PIDLTYPE,LPCITEMIDLIST,LPVOID,UINT16);
extern LPPIDLDATA PidlMgr_GetDataPointer(LPPIDLMGR,LPCITEMIDLIST);
extern BOOL32 PidlMgr_SeparatePathAndValue(LPPIDLMGR,LPITEMIDLIST,LPITEMIDLIST*,LPITEMIDLIST*);
#endif
/*
* internal Shell32 Library definitions
*/
#ifndef __WINE_SHELL_MAIN_H
#define __WINE_SHELL_MAIN_H
/*******************************************
* global SHELL32.DLL variables
*/
extern HINSTANCE32 shell32_hInstance;
extern UINT32 shell32_DllRefCount;
extern HIMAGELIST ShellSmallIconList;
extern HIMAGELIST ShellBigIconList;
/*******************************************
* pointer to functions dynamically loaded
*/
extern void (CALLBACK* pDLLInitComctl)();
extern INT32 (CALLBACK* pImageList_AddIcon) (HIMAGELIST himl, HICON32 hIcon);
extern INT32(CALLBACK* pImageList_ReplaceIcon) (HIMAGELIST, INT32, HICON32);
extern HIMAGELIST (CALLBACK * pImageList_Create) (INT32,INT32,UINT32,INT32,INT32);
extern HICON32 (CALLBACK * pImageList_GetIcon) (HIMAGELIST, INT32, UINT32);
/* FIXME should be moved to a header file. IsEqualGUID
is declared but not exported in compobj.c !!!*/
#define IsEqualGUID(rguid1, rguid2) (!memcmp(rguid1, rguid2, sizeof(GUID)))
#define IsEqualIID(riid1, riid2) IsEqualGUID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2) IsEqualGUID(rclsid1, rclsid2)
#endif
#include "shresdef.h"
// we have to find a solution for the icons
// IDI_FOLDER ICON DISCARDABLE "folder.ico"
// IDI_FOLDEROPEN ICON DISCARDABLE "folderop.ico"
STRINGTABLE DISCARDABLE
BEGIN
IDS_FILE_TITLE "Files: "
IDS_MI_FILE "&Files"
IDS_MI_VIEW_FILES "&View Files"
IDS_TB_VIEW_FILES "View Filess"
IDS_MI_VIEW_IDW "Show &Docking Window"
IDS_TB_VIEW_IDW "Show Docking Window"
IDS_COLUMN1 "Name"
IDS_COLUMN2 "Date"
IDS_COLUMN3 "Size"
IDS_COLUMN4 "Attributes"
END
#ifndef __WINE_SHELL_RES_H
#define __WINE_SHELL_RES_H
#define IDS_FILE_TITLE 1
#define IDS_MI_FILE 2
#define IDS_MI_VIEW_FILES 3
#define IDS_TB_VIEW_FILES 4
#define IDS_MI_VIEW_IDW 5
#define IDS_TB_VIEW_IDW 6
#define IDS_COLUMN1 7
#define IDS_COLUMN2 8
#define IDS_COLUMN3 9
#define IDS_COLUMN4 10
#define IDS_MI_FILEITEM 12
#define IDI_FOLDER 101
#define IDI_FOLDEROPEN 102
#endif
...@@ -52,10 +52,16 @@ $(INCLUDES): ...@@ -52,10 +52,16 @@ $(INCLUDES):
install:: install::
$(INSTALL_DATA) $(SRCDIR)/wine.man $(mandir)/wine$(manext) $(INSTALL_DATA) $(SRCDIR)/wine.man $(mandir)/wine$(manext)
uninstall::
$(RM) $(mandir)/wine$(manext)
# Not done by default because of makeinfo bugs # Not done by default because of makeinfo bugs
install_info: $(INFOFILES) install_info: $(INFOFILES)
for i in $(INFOFILES); do $(INSTALL_DATA) $$i $(infodir)/$$i; done for i in $(INFOFILES); do $(INSTALL_DATA) $$i $(infodir)/$$i; done
uninstall_info:
for i in $(INFOFILES); do $(RM) $(infodir)/$$i; done
clean:: clean::
$(RM) $(INFOFILES) $(DVIFILES) $(INCLUDES) $(RM) $(INFOFILES) $(DVIFILES) $(INCLUDES)
$(RM) wine.aux wine.cp wine.cps wine.fn wine.fns wine.ky wine.log \ $(RM) wine.aux wine.cp wine.cps wine.fn wine.fns wine.ky wine.log \
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
- Basic functionality is almost done. (dll version 4.0) - Basic functionality is almost done. (dll version 4.0)
Notes: Notes:
Bitmaps are not correctly displayed. - Bitmaps are not correctly displayed.
3.19 Tooltip Control 3.19 Tooltip Control
...@@ -212,7 +212,6 @@ ...@@ -212,7 +212,6 @@
Notes: Notes:
- Unicode support is still missing. - Unicode support is still missing.
- No subclassing.
3.20 Trackbar Control 3.20 Trackbar Control
...@@ -236,9 +235,6 @@ ...@@ -236,9 +235,6 @@
Status: Status:
- Dummy control. No functionality. - Dummy control. No functionality.
Notes:
Author needed!! Any volunteers??
3.22 Updown Control 3.22 Updown Control
------------------- -------------------
...@@ -270,7 +266,7 @@ ...@@ -270,7 +266,7 @@
------------------------ ------------------------
There are quite a lot of undocumented functions like: There are quite a lot of undocumented functions like:
- DSA (Dynnamic String Array?) functions. - DSA (Dynnamic Structure Array) functions.
- DPA (Dymnamic Pointer Array?) functions. - DPA (Dymnamic Pointer Array?) functions.
- MRU ("Most Recently Used" List) functions. - MRU ("Most Recently Used" List) functions.
- other unknown functions. - other unknown functions.
...@@ -278,12 +274,13 @@ ...@@ -278,12 +274,13 @@
Have a look at relay32/comctl32.spec. Have a look at relay32/comctl32.spec.
5.1 Dymnamic String Arrays ??? (DSA) 5.1 Dymnamic Structure Arrays (DSA)
------------------------------------ ------------------------------------
Most of the DSA functions are implemented. I used TASKMAN.EXE to write them. Most of the DSA functions are implemented. I used TASKMAN.EXE to write them.
Since TASKMAN.EXE doesn't bail out or crash I think I've done it right. Since TASKMAN.EXE doesn't bail out or crash I think I've done it right.
Have a look at the source code to get more information. Have a look at the source code to get more information.
Further documentation will be written... Further documentation will be written...
...@@ -298,16 +295,32 @@ ...@@ -298,16 +295,32 @@
Further documentation will be written... Further documentation will be written...
5.3 MenuHelp 5.3 "Most Recently Used" - List (MRU)
-------------------------------------
Currently no information available!
5.4 MenuHelp
------------ ------------
Has to be written... Has to be written...
5.4 GetEffectiveClientRect 5.5 GetEffectiveClientRect
-------------------------- --------------------------
Has to be written... Has to be written...
5.6 ShowHideMenuCtl
-------------------
The official documentation provided by MS is incomplete.
lpInfo:
...
Both values of the first pair must be the handle to the applications main
menu.
...
6. Epilogue 6. Epilogue
----------- -----------
You see, much work has still to be done. If you are interested in writing You see, much work has still to be done. If you are interested in writing
......
DOS treats the first 5 file handles as special cases. They map directly
to stdin, stdout, stderr, stdaux and stdprn. Windows 16 inherits this
behavoir, and in fact, win16 handles are interchangable with DOS handles.
Some nasty windows programs even do this!
Windows32 issues file handles starting from 1, on the grounds that
most GUI processes don't need a stdin, out, etc.
The wine handle code is implemented in the Win32 style, and the Win16
functions use two macros to convert to and from the two types.
The macros are defined in file.h as follows.:
#define HFILE16_TO_HFILE32(handle) \
(((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
(handle)-5)
#define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
(HFILE16)hnd+5); })
WARNING: be careful not to use the macro HFILE16_TO_HFILE32 on
functions with side-effects, as it will cause them to be evaluated
several times. This could be considered a bug, but the use of this
macro is limited enough not to need a rewrite.
This document describes some points you should know when you are going to
implement the internal counterparts to external DLL's. Only 32 bit DLL's
are considered.
1. The LibMain function
-----------------------
These are the way to do some initialising when a process or thread is attached
to the dll. The function name is taken from a *.spec file line:
init YourFunctionName
the you have to implement the function:
BOOL32 WINAPI YourLibMain(HINSTANCE32 hinstDLL,
DWORD fdwReason, LPVOID lpvReserved)
{ if (fdwReason==DLL_PROCESS_ATTACH)
{ ...
}
....
}
2. Using functions from other build-in DLL's
--------------------------------------------
The problem here is, that you can't know if you have to call the function from
the internal or the external DLL. If you just call the function you will get
the internal implementation. If the external DLL is loaded the executed program
will use the external and you the internal DLL.
When you -as example- fill a iconlist placed in the internal DLL the
application wont get the icons from the external DLL.
To go around this you have to call the functions over pointer.
/* definition of the pointer type*/
void (CALLBACK* pDLLInitComctl)();
/* getting the function address this should be done in the
LibMain function when called with DLL_PROCESS_ATTACH*/
BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason,
LPVOID lpvReserved)
{ HINSTANCE32 hComctl32;
if (fdwReason==DLL_PROCESS_ATTACH)
{ /* load the external / internal DLL*/
hComctl32 = LoadLibrary32A("COMCTL32.DLL");
if (hComctl32)
{ /* get the function pointer */
pDLLInitComctl=GetProcAddress32(hComctl32,"InitCommonControlsEx");
/* check it */
if (pDLLInitComctl)
{ /* use it */
pDLLInitComctl();
}
/* free the DLL / decrease the ref count */
FreeLibrary32(hComctl32);
}
else
{ /* do some panic*/
ERR(shell,"P A N I C error getting functionpointers\n");
exit (1);
}
}
....
3. Getting resources from a *.rc file linked to the DLL
-------------------------------------------------------
< If you know how, write some lines>
----------
<juergen.schmied@metronet.de>
SHELL32
development status
Author needed!! Any volunteers??
mail to <juergen.schmied@metronet.de>
1. Introduction
---------------
All parts of this DLL are currently under development. About a third of
base functionality is roughly in place. The missing parts are the icon
(shell icon cache) handling and the dialogs provided from the dll like
the file copy status window.
The basis comes from Marcus Meissner and I <juergen.schmied@metronet.de>
implemented the classes and filled function stubs.
2. General Information
----------------------
3. Functions
------------
4. Classes
----------
4.1 IContextMenu
----------------
Status:
- development started
4.2 IShellExtInit
-----------------
only interface definition
4.3 IEnumIDList
---------------
Status:
- Almost finished.
4.4.IShellFolder
----------------
Status:
- roughly finished.
4.5 IShellView
--------------
Status:
- under development
4.6 IShellBrowser
-----------------
Status:
- only interface definition
it's implemented by the explorer
don't know if we need it
4.7. PIDL Manager
-----------------
Status:
- roughly complete will be migrated to a set of functions because it's
not holding any instance data,
5. Structures
-------------
5.1 PIDL
--------
...@@ -871,7 +871,7 @@ error: /* We get here if there was an error opening the file */ ...@@ -871,7 +871,7 @@ error: /* We get here if there was an error opening the file */
*/ */
HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode ) HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode )
{ {
return FILE_DoOpenFile( name, ofs, mode, FALSE ); return HFILE32_TO_HFILE16(FILE_DoOpenFile( name, ofs, mode, FALSE ));
} }
...@@ -890,7 +890,7 @@ HFILE32 WINAPI OpenFile32( LPCSTR name, OFSTRUCT *ofs, UINT32 mode ) ...@@ -890,7 +890,7 @@ HFILE32 WINAPI OpenFile32( LPCSTR name, OFSTRUCT *ofs, UINT32 mode )
HFILE16 WINAPI _lclose16( HFILE16 hFile ) HFILE16 WINAPI _lclose16( HFILE16 hFile )
{ {
TRACE(file, "handle %d\n", hFile ); TRACE(file, "handle %d\n", hFile );
return CloseHandle( hFile ) ? 0 : HFILE_ERROR16; return CloseHandle( HFILE16_TO_HFILE32( hFile ) ) ? 0 : HFILE_ERROR16;
} }
...@@ -917,7 +917,7 @@ LONG WINAPI WIN16_hread( HFILE16 hFile, SEGPTR buffer, LONG count ) ...@@ -917,7 +917,7 @@ LONG WINAPI WIN16_hread( HFILE16 hFile, SEGPTR buffer, LONG count )
/* Some programs pass a count larger than the allocated buffer */ /* Some programs pass a count larger than the allocated buffer */
maxlen = GetSelectorLimit( SELECTOROF(buffer) ) - OFFSETOF(buffer) + 1; maxlen = GetSelectorLimit( SELECTOROF(buffer) ) - OFFSETOF(buffer) + 1;
if (count > maxlen) count = maxlen; if (count > maxlen) count = maxlen;
return _lread32( hFile, PTR_SEG_TO_LIN(buffer), count ); return _lread32(HFILE16_TO_HFILE32(hFile), PTR_SEG_TO_LIN(buffer), count );
} }
...@@ -955,7 +955,7 @@ UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count ) ...@@ -955,7 +955,7 @@ UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count )
*/ */
UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count ) UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count )
{ {
return (UINT16)_lread32( hFile, buffer, (LONG)count ); return (UINT16)_lread32(HFILE16_TO_HFILE32(hFile), buffer, (LONG)count );
} }
...@@ -966,7 +966,7 @@ HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr ) ...@@ -966,7 +966,7 @@ HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
{ {
int mode = (attr & 1) ? 0444 : 0666; int mode = (attr & 1) ? 0444 : 0666;
TRACE(file, "%s %02x\n", path, attr ); TRACE(file, "%s %02x\n", path, attr );
return (HFILE16)FILE_Create( path, mode, FALSE ); return (HFILE16) HFILE32_TO_HFILE16(FILE_Create( path, mode, FALSE ));
} }
...@@ -1038,7 +1038,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword, ...@@ -1038,7 +1038,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
*/ */
LONG WINAPI _llseek16( HFILE16 hFile, LONG lOffset, INT16 nOrigin ) LONG WINAPI _llseek16( HFILE16 hFile, LONG lOffset, INT16 nOrigin )
{ {
return SetFilePointer( hFile, lOffset, NULL, nOrigin ); return SetFilePointer( HFILE16_TO_HFILE32(hFile), lOffset, NULL, nOrigin );
} }
...@@ -1056,7 +1056,7 @@ LONG WINAPI _llseek32( HFILE32 hFile, LONG lOffset, INT32 nOrigin ) ...@@ -1056,7 +1056,7 @@ LONG WINAPI _llseek32( HFILE32 hFile, LONG lOffset, INT32 nOrigin )
*/ */
HFILE16 WINAPI _lopen16( LPCSTR path, INT16 mode ) HFILE16 WINAPI _lopen16( LPCSTR path, INT16 mode )
{ {
return _lopen32( path, mode ); return HFILE32_TO_HFILE16(_lopen32( path, mode ));
} }
...@@ -1091,7 +1091,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode ) ...@@ -1091,7 +1091,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode )
*/ */
UINT16 WINAPI _lwrite16( HFILE16 hFile, LPCSTR buffer, UINT16 count ) UINT16 WINAPI _lwrite16( HFILE16 hFile, LPCSTR buffer, UINT16 count )
{ {
return (UINT16)_hwrite32( hFile, buffer, (LONG)count ); return (UINT16)_hwrite32( HFILE16_TO_HFILE32(hFile), buffer, (LONG)count );
} }
/*********************************************************************** /***********************************************************************
...@@ -1108,7 +1108,7 @@ UINT32 WINAPI _lwrite32( HFILE32 hFile, LPCSTR buffer, UINT32 count ) ...@@ -1108,7 +1108,7 @@ UINT32 WINAPI _lwrite32( HFILE32 hFile, LPCSTR buffer, UINT32 count )
*/ */
LONG WINAPI _hread16( HFILE16 hFile, LPVOID buffer, LONG count) LONG WINAPI _hread16( HFILE16 hFile, LPVOID buffer, LONG count)
{ {
return _lread32( hFile, buffer, count ); return _lread32( HFILE16_TO_HFILE32(hFile), buffer, count );
} }
...@@ -1126,7 +1126,7 @@ LONG WINAPI _hread32( HFILE32 hFile, LPVOID buffer, LONG count) ...@@ -1126,7 +1126,7 @@ LONG WINAPI _hread32( HFILE32 hFile, LPVOID buffer, LONG count)
*/ */
LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count ) LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count )
{ {
return _hwrite32( hFile, buffer, count ); return _hwrite32( HFILE16_TO_HFILE32(hFile), buffer, count );
} }
......
...@@ -945,7 +945,7 @@ INT32 WINAPI GetProfileString32W( LPCWSTR section, LPCWSTR entry, ...@@ -945,7 +945,7 @@ INT32 WINAPI GetProfileString32W( LPCWSTR section, LPCWSTR entry,
/*********************************************************************** /***********************************************************************
* GetProfileSection32A (KERNEL32.268) * GetProfileSection32A (KERNEL32.268)
*/ */
INT32 WINAPI GetProfileSection32A( LPCSTR section, LPSTR buffer, UINT32 len ) INT32 WINAPI GetProfileSection32A( LPCSTR section, LPSTR buffer, DWORD len )
{ {
return GetPrivateProfileSection32A( section, buffer, len, "win.ini" ); return GetPrivateProfileSection32A( section, buffer, len, "win.ini" );
} }
...@@ -1080,7 +1080,7 @@ INT32 WINAPI GetPrivateProfileString32W( LPCWSTR section, LPCWSTR entry, ...@@ -1080,7 +1080,7 @@ INT32 WINAPI GetPrivateProfileString32W( LPCWSTR section, LPCWSTR entry,
* GetPrivateProfileSection32A (KERNEL32.255) * GetPrivateProfileSection32A (KERNEL32.255)
*/ */
INT32 WINAPI GetPrivateProfileSection32A( LPCSTR section, LPSTR buffer, INT32 WINAPI GetPrivateProfileSection32A( LPCSTR section, LPSTR buffer,
UINT32 len, LPCSTR filename ) DWORD len, LPCSTR filename )
{ {
if (PROFILE_Open( filename )) if (PROFILE_Open( filename ))
return PROFILE_GetSection(CurProfile->section, section, buffer, len, return PROFILE_GetSection(CurProfile->section, section, buffer, len,
...@@ -1186,7 +1186,7 @@ WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size, ...@@ -1186,7 +1186,7 @@ WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size,
/*********************************************************************** /***********************************************************************
* GetPrivateProfileStruct32A (KERNEL32.370) * GetPrivateProfileStruct32A (KERNEL32.370)
*/ */
WORD WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key, BOOL32 WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key,
LPVOID buf, UINT32 len, LPCSTR filename) LPVOID buf, UINT32 len, LPCSTR filename)
{ {
PROFILEKEY *k; PROFILEKEY *k;
...@@ -1204,7 +1204,7 @@ WORD WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key, ...@@ -1204,7 +1204,7 @@ WORD WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key,
/*********************************************************************** /***********************************************************************
* WritePrivateProfileStruct32A (KERNEL32.744) * WritePrivateProfileStruct32A (KERNEL32.744)
*/ */
WORD WINAPI WritePrivateProfileStruct32A (LPCSTR section, LPCSTR key, BOOL32 WINAPI WritePrivateProfileStruct32A (LPCSTR section, LPCSTR key,
LPVOID buf, UINT32 bufsize, LPCSTR filename) LPVOID buf, UINT32 bufsize, LPCSTR filename)
{ {
if ((!section) && (!key) && (!buf)) { /* flush the cache */ if ((!section) && (!key) && (!buf)) { /* flush the cache */
......
...@@ -755,8 +755,8 @@ BOOL32 WINAPI PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts, ...@@ -755,8 +755,8 @@ BOOL32 WINAPI PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts,
/********************************************************************** /**********************************************************************
* PolyPolyline32 (GDI32.272) * PolyPolyline32 (GDI32.272)
*/ */
BOOL32 WINAPI PolyPolyline32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts, BOOL32 WINAPI PolyPolyline32( HDC32 hdc, LPPOINT32 pt, LPDWORD counts,
UINT32 polylines ) DWORD polylines )
{ {
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
......
...@@ -44,8 +44,10 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2, ...@@ -44,8 +44,10 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
} }
if(page) { if(page) {
dm1->dmPublic.dmPaperSize = dm2->dmPublic.dmPaperSize; dm1->dmPublic.dmPaperSize = dm2->dmPublic.dmPaperSize;
dm1->dmPublic.dmPaperWidth = page->PaperDimension->x * 25.4 / 72.0; dm1->dmPublic.dmPaperWidth = page->PaperDimension->x *
dm1->dmPublic.dmPaperLength = page->PaperDimension->y * 25.4 / 72.0; 254.0 / 72.0;
dm1->dmPublic.dmPaperLength = page->PaperDimension->y *
254.0 / 72.0;
TRACE(psdrv, "Changing page to %s %d x %d\n", page->FullName, TRACE(psdrv, "Changing page to %s %d x %d\n", page->FullName,
dm1->dmPublic.dmPaperWidth, dm1->dmPublic.dmPaperLength ); dm1->dmPublic.dmPaperWidth, dm1->dmPublic.dmPaperLength );
} else { } else {
......
...@@ -169,6 +169,12 @@ static PSDRV_DEVMODE16 DefaultDevmode = ...@@ -169,6 +169,12 @@ static PSDRV_DEVMODE16 DefaultDevmode =
HANDLE32 PSDRV_Heap = 0; HANDLE32 PSDRV_Heap = 0;
static HANDLE32 PSDRV_DefaultFont = 0;
static LOGFONT32A DefaultLogFont = {
100, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, 0, 0,
DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, ""
};
/********************************************************************* /*********************************************************************
* PSDRV_Init * PSDRV_Init
* *
...@@ -180,6 +186,7 @@ BOOL32 PSDRV_Init(void) ...@@ -180,6 +186,7 @@ BOOL32 PSDRV_Init(void)
TRACE(psdrv, "\n"); TRACE(psdrv, "\n");
PSDRV_Heap = HeapCreate(0, 0x10000, 0); PSDRV_Heap = HeapCreate(0, 0x10000, 0);
PSDRV_GetFontMetrics(); PSDRV_GetFontMetrics();
PSDRV_DefaultFont = CreateFontIndirect32A(&DefaultLogFont);
return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs ); return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs );
} }
...@@ -225,11 +232,11 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, ...@@ -225,11 +232,11 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
memcpy(devCaps, &PSDRV_DevCaps, sizeof(PSDRV_DevCaps)); memcpy(devCaps, &PSDRV_DevCaps, sizeof(PSDRV_DevCaps));
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_PORTRAIT) { if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_PORTRAIT) {
devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperWidth; devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperWidth / 10;
devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperLength; devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperLength / 10;
} else { } else {
devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperLength; devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperLength / 10;
devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperWidth; devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperWidth / 10;
} }
devCaps->horzRes = physDev->pi->ppd->DefaultResolution * devCaps->horzRes = physDev->pi->ppd->DefaultResolution *
...@@ -252,6 +259,7 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, ...@@ -252,6 +259,7 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
dc->w.hVisRgn = CreateRectRgn32(0, 0, dc->w.devCaps->horzRes, dc->w.hVisRgn = CreateRectRgn32(0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes); dc->w.devCaps->vertRes);
dc->w.hFont = PSDRV_DefaultFont;
physDev->job.output = HEAP_strdupA( PSDRV_Heap, 0, output ); physDev->job.output = HEAP_strdupA( PSDRV_Heap, 0, output );
physDev->job.hJob = 0; physDev->job.hJob = 0;
return TRUE; return TRUE;
......
...@@ -753,7 +753,7 @@ X11DRV_PolyPolygon( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons) ...@@ -753,7 +753,7 @@ X11DRV_PolyPolygon( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons)
* X11DRV_PolyPolyline * X11DRV_PolyPolyline
*/ */
BOOL32 BOOL32
X11DRV_PolyPolyline( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polylines ) X11DRV_PolyPolyline( DC *dc, LPPOINT32 pt, LPDWORD counts, DWORD polylines )
{ {
if (DC_SetupGCForPen ( dc )) if (DC_SetupGCForPen ( dc ))
{ {
......
...@@ -218,7 +218,7 @@ file gdi.exe ...@@ -218,7 +218,7 @@ file gdi.exe
305 stub ENGINEGETGLYPHBMP 305 stub ENGINEGETGLYPHBMP
306 stub ENGINEMAKEFONTDIR 306 stub ENGINEMAKEFONTDIR
307 pascal16 GetCharABCWidths(word word word ptr) GetCharABCWidths16 307 pascal16 GetCharABCWidths(word word word ptr) GetCharABCWidths16
308 pascal GetOutlineTextMetrics(word word ptr) GetOutlineTextMetrics 308 pascal GetOutlineTextMetrics(word word ptr) GetOutlineTextMetrics16
309 pascal GetGlyphOutline(word word word ptr long ptr ptr) GetGlyphOutline16 309 pascal GetGlyphOutline(word word word ptr long ptr ptr) GetGlyphOutline16
310 pascal16 CreateScalableFontResource(word str str str) CreateScalableFontResource16 310 pascal16 CreateScalableFontResource(word str str str) CreateScalableFontResource16
311 stub GetFontData 311 stub GetFontData
......
...@@ -8,7 +8,7 @@ type win16 ...@@ -8,7 +8,7 @@ type win16
5 pascal16 AnsiToOem(str ptr) AnsiToOem16 5 pascal16 AnsiToOem(str ptr) AnsiToOem16
6 pascal16 OemToAnsi(str ptr) OemToAnsi16 6 pascal16 OemToAnsi(str ptr) OemToAnsi16
7 return SetSpeed 2 65535 7 return SetSpeed 2 65535
#100 pascal ScreenSwitchEnable 100 pascal ScreenSwitchEnable(word) ScreenSwitchEnable
#126 pascal GetTableSeg #126 pascal GetTableSeg
#127 pascal NewTable #127 pascal NewTable
128 pascal OemKeyScan(word) OemKeyScan 128 pascal OemKeyScan(word) OemKeyScan
......
...@@ -236,7 +236,7 @@ void RELAY_Unimplemented16(void) ...@@ -236,7 +236,7 @@ void RELAY_Unimplemented16(void)
MSG("No handler for Win16 routine %s (called from %04x:%04x)\n", MSG("No handler for Win16 routine %s (called from %04x:%04x)\n",
BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal), BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal),
frame->cs, frame->ip ); frame->cs, frame->ip );
TASK_KillCurrentTask(1); ExitProcess(1);
} }
......
...@@ -368,7 +368,7 @@ file user.exe ...@@ -368,7 +368,7 @@ file user.exe
398 pascal16 GetClassInfoEx(word segstr ptr) GetClassInfoEx16 398 pascal16 GetClassInfoEx(word segstr ptr) GetClassInfoEx16
399 stub ChildWindowFromPointEx 399 stub ChildWindowFromPointEx
400 stub FinalUserInit 400 stub FinalUserInit
402 pascal16 GetPriorityClipboardFormat(word ptr s_word) GetPriorityClipboardFormat16 402 pascal16 GetPriorityClipboardFormat(ptr s_word) GetPriorityClipboardFormat16
403 pascal16 UnregisterClass(segstr word) UnregisterClass16 403 pascal16 UnregisterClass(segstr word) UnregisterClass16
404 pascal16 GetClassInfo(word segstr ptr) GetClassInfo16 404 pascal16 GetClassInfo(word segstr ptr) GetClassInfo16
406 pascal16 CreateCursor(word word word word word ptr ptr) CreateCursor16 406 pascal16 CreateCursor(word word word word word ptr ptr) CreateCursor16
......
#ifndef __WINE_AUTHORS_H
#define __WINE_AUTHORS_H
static const char * const SHELL_People[] =
{
"Bob Amstadt",
"Dag Asheim",
"Martin Ayotte",
"Karl Backstrm",
"Peter Bajusz",
"Marcel Baur",
"Georg Beyerle",
"Ross Biro",
"Martin Boehme",
"Uwe Bonnes",
"Erik Bos",
"Fons Botman",
"John Brezak",
"Andrew Bulhak",
"John Burton",
"Niels de Carpentier",
"Gordon Chaffee",
"Jimen Ching",
"Pascal Cuoq",
"David A. Cuthbert",
"Huw D. M. Davies",
"Roman Dolejsi",
"Frans van Dorsselaer",
"Chris Faherty",
"Carsten Fallesen",
"Paul Falstad",
"David Faure",
"Claus Fischer",
"Olaf Flebbe",
"Chad Fraleigh",
"Matthew Francis",
"Peter Galbavy",
"Ramon Garcia",
"Matthew Ghio",
"Jody Goldberg",
"Hans de Graaff",
"Charles M. Hannum",
"Adrian Harvey",
"John Harvey",
"Bill Hawes",
"Cameron Heide",
"Jochen Hoenicke",
"Onno Hovers",
"Jeffrey Hsu",
"Miguel de Icaza",
"Jukka Iivonen",
"Lee Jaekil",
"Alexandre Julliard",
"Bang Jun-Young",
"Pavel Kankovsky",
"Jochen Karrer",
"Andreas Kirschbaum",
"Rein Klazes",
"Albrecht Kleine",
"Eric Kohl",
"Jon Konrath",
"Alex Korobka",
"Greg Kreider",
"Anand Kumria",
"Ove Kven",
"Scott A. Laird",
"David Lee Lambert",
"Andrew Lewycky",
"Per Lindstrm",
"Martin von Loewis",
"Michiel van Loon",
"Kenneth MacDonald",
"Peter MacDonald",
"William Magro",
"Juergen Marquardt",
"Ricardo Massaro",
"Marcus Meissner",
"Graham Menhennitt",
"David Metcalfe",
"Bruce Milner",
"Steffen Moeller",
"Andreas Mohr",
"James Moody",
"Philippe De Muyter",
"Itai Nahshon",
"Kristian Nielsen",
"Henrik Olsen",
"Michael Patra",
"Dimitrie O. Paun",
"Jim Peterson",
"Robert Pouliot",
"Keith Reynolds",
"Slaven Rezic",
"John Richardson",
"Rick Richardson",
"Doug Ridgway",
"Bernhard Rosenkraenzer",
"Johannes Ruscheinski",
"Thomas Sandford",
"Constantine Sapuntzakis",
"Pablo Saratxaga",
"Daniel Schepler",
"Peter Schlaile",
"Ulrich Schmid",
"Bernd Schmidt",
"Juergen Schmied",
"Ingo Schneider",
"Victor Schneider",
"Yngvi Sigurjonsson",
"Stephen Simmons",
"Rick Sladkey",
"William Smith",
"Dominik Strasser",
"Vadim Strizhevsky",
"Bertho Stultiens",
"Erik Svendsen",
"Tristan Tarrant",
"Andrew Taylor",
"Duncan C Thomson",
"Goran Thyni",
"Jimmy Tirtawangsa",
"Jon Tombs",
"Linus Torvalds",
"Gregory Trubetskoy",
"Petri Tuomola",
"Michael Veksler",
"Sven Verdoolaege",
"Ronan Waide",
"Eric Warnke",
"Manfred Weichel",
"Ulrich Weigand",
"Morten Welinder",
"Len White",
"Lawson Whitney",
"Jan Willamowius",
"Carl Williams",
"Karl Guenter Wuensch",
"Eric Youngdale",
"James Youngman",
"Nikita V. Youshchenko",
"Mikolaj Zalewski",
"John Zero",
"Luiz Otavio L. Zorzella",
NULL
};
#endif /* __WINE_AUTHORS_H */
...@@ -876,7 +876,6 @@ FAR * ) PURE; ...@@ -876,7 +876,6 @@ FAR * ) PURE;
struct _common_directdrawdata { struct _common_directdrawdata {
DWORD depth; DWORD depth;
DWORD height,width; /* SetDisplayMode */ DWORD height,width; /* SetDisplayMode */
HWND32 mainwindow;
}; };
struct _dga_directdrawdata { struct _dga_directdrawdata {
...@@ -887,12 +886,16 @@ struct _dga_directdrawdata { ...@@ -887,12 +886,16 @@ struct _dga_directdrawdata {
struct _xlib_directdrawdata { struct _xlib_directdrawdata {
Window drawable; Window drawable;
int use_xshm;
/* are these needed for anything? (draw_surf is the active surface) /* are these needed for anything? (draw_surf is the active surface)
IDirectDrawSurface *surfs; IDirectDrawSurface *surfs;
DWORD num_surfs, alloc_surfs, draw_surf; */ DWORD num_surfs, alloc_surfs, draw_surf; */
int paintable;
ATOM winclass;
HWND32 window; /* current window implementation */
ATOM winclass;
HWND32 window;
PAINTSTRUCT32 ps;
}; };
struct IDirectDraw { struct IDirectDraw {
...@@ -901,7 +904,6 @@ struct IDirectDraw { ...@@ -901,7 +904,6 @@ struct IDirectDraw {
struct _common_directdrawdata d; struct _common_directdrawdata d;
union { union {
struct _xlib_directdrawdata xlib; struct _xlib_directdrawdata xlib;
struct _xlib_directdrawdata xshm;
struct _dga_directdrawdata dga; struct _dga_directdrawdata dga;
} e; } e;
}; };
...@@ -957,8 +959,6 @@ struct IDirectDraw2 { ...@@ -957,8 +959,6 @@ struct IDirectDraw2 {
struct _common_directdrawdata d; struct _common_directdrawdata d;
union { union {
struct _xlib_directdrawdata xlib; struct _xlib_directdrawdata xlib;
/* only different in image create&put */
struct _xlib_directdrawdata xshm;
struct _dga_directdrawdata dga; struct _dga_directdrawdata dga;
} e; } e;
}; };
...@@ -967,7 +967,7 @@ struct IDirectDraw2 { ...@@ -967,7 +967,7 @@ struct IDirectDraw2 {
#define THIS LPDIRECTDRAWSURFACE this #define THIS LPDIRECTDRAWSURFACE this
struct _common_directdrawsurface { struct _common_directdrawsurface {
LPDIRECTDRAWPALETTE palette; LPDIRECTDRAWPALETTE palette;
LPDIRECTDRAW ddraw; LPDIRECTDRAW2 ddraw;
LPDIRECTDRAWSURFACE3 backbuffer; LPDIRECTDRAWSURFACE3 backbuffer;
LPVOID surface; LPVOID surface;
DWORD lpitch,width,height; DWORD lpitch,width,height;
...@@ -977,16 +977,12 @@ struct _dga_directdrawsurface { ...@@ -977,16 +977,12 @@ struct _dga_directdrawsurface {
DWORD fb_height; DWORD fb_height;
}; };
struct _xshm_directdrawsurface { struct _xlib_directdrawsurface {
XImage *image; XImage *image;
#ifdef HAVE_LIBXXSHM #ifdef HAVE_LIBXXSHM
XShmSegmentInfo shminfo; XShmSegmentInfo shminfo;
#endif #endif
}; };
struct _xlib_directdrawsurface {
XImage *image;
BOOL32 surface_is_image_data;
};
typedef struct IDirectDrawSurface_VTable { typedef struct IDirectDrawSurface_VTable {
/*** IUnknown methods ***/ /*** IUnknown methods ***/
...@@ -1034,7 +1030,6 @@ struct IDirectDrawSurface { ...@@ -1034,7 +1030,6 @@ struct IDirectDrawSurface {
struct _common_directdrawsurface s; struct _common_directdrawsurface s;
union { union {
struct _dga_directdrawsurface dga; struct _dga_directdrawsurface dga;
struct _xshm_directdrawsurface xshm;
struct _xlib_directdrawsurface xlib; struct _xlib_directdrawsurface xlib;
} t; } t;
}; };
...@@ -1181,5 +1176,8 @@ struct IDirectDrawColorControl { ...@@ -1181,5 +1176,8 @@ struct IDirectDrawColorControl {
#undef STDMETHOD #undef STDMETHOD
#undef STDMETHOD_ #undef STDMETHOD_
extern HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID,LPDIRECTDRAW *lplpDD,LPUNKNOWN pUnkOuter ); HRESULT WINAPI DirectDrawCreate(LPGUID,LPDIRECTDRAW*,LPUNKNOWN);
HRESULT WINAPI DirectDrawEnumerate32A(LPDDENUMCALLBACK32A,LPVOID);
HRESULT WINAPI DirectDrawEnumerate32W(LPDDENUMCALLBACK32W,LPVOID);
#define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate)
#endif #endif
...@@ -87,58 +87,59 @@ ...@@ -87,58 +87,59 @@
#define dbch_ole 79 #define dbch_ole 79
#define dbch_pager 80 #define dbch_pager 80
#define dbch_palette 81 #define dbch_palette 81
#define dbch_print 82 #define dbch_pidl 82
#define dbch_process 83 #define dbch_print 83
#define dbch_profile 84 #define dbch_process 84
#define dbch_progress 85 #define dbch_profile 85
#define dbch_prop 86 #define dbch_progress 86
#define dbch_psdrv 87 #define dbch_prop 87
#define dbch_rebar 88 #define dbch_psdrv 88
#define dbch_reg 89 #define dbch_rebar 89
#define dbch_region 90 #define dbch_reg 90
#define dbch_relay 91 #define dbch_region 91
#define dbch_resource 92 #define dbch_relay 92
#define dbch_s 93 #define dbch_resource 93
#define dbch_scroll 94 #define dbch_s 94
#define dbch_security 95 #define dbch_scroll 95
#define dbch_segment 96 #define dbch_security 96
#define dbch_selector 97 #define dbch_segment 97
#define dbch_sem 98 #define dbch_selector 98
#define dbch_sendmsg 99 #define dbch_sem 99
#define dbch_shell 100 #define dbch_sendmsg 100
#define dbch_shm 101 #define dbch_shell 101
#define dbch_snoop 102 #define dbch_shm 102
#define dbch_sound 103 #define dbch_snoop 103
#define dbch_static 104 #define dbch_sound 104
#define dbch_statusbar 105 #define dbch_static 105
#define dbch_stress 106 #define dbch_statusbar 106
#define dbch_string 107 #define dbch_stress 107
#define dbch_syscolor 108 #define dbch_string 108
#define dbch_system 109 #define dbch_syscolor 109
#define dbch_task 110 #define dbch_system 110
#define dbch_text 111 #define dbch_task 111
#define dbch_thread 112 #define dbch_text 112
#define dbch_thunk 113 #define dbch_thread 113
#define dbch_timer 114 #define dbch_thunk 114
#define dbch_toolbar 115 #define dbch_timer 115
#define dbch_toolhelp 116 #define dbch_toolbar 116
#define dbch_tooltips 117 #define dbch_toolhelp 117
#define dbch_trackbar 118 #define dbch_tooltips 118
#define dbch_treeview 119 #define dbch_trackbar 119
#define dbch_tweak 120 #define dbch_treeview 120
#define dbch_uitools 121 #define dbch_tweak 121
#define dbch_updown 122 #define dbch_uitools 122
#define dbch_ver 123 #define dbch_updown 123
#define dbch_virtual 124 #define dbch_ver 124
#define dbch_vxd 125 #define dbch_virtual 125
#define dbch_win 126 #define dbch_vxd 126
#define dbch_win16drv 127 #define dbch_win 127
#define dbch_win32 128 #define dbch_win16drv 128
#define dbch_wing 129 #define dbch_win32 129
#define dbch_winsock 130 #define dbch_wing 130
#define dbch_wnet 131 #define dbch_winsock 131
#define dbch_x11 132 #define dbch_wnet 132
#define dbch_x11drv 133 #define dbch_x11 133
#define dbch_x11drv 134
/* Definitions for classes identifiers */ /* Definitions for classes identifiers */
#define dbcl_fixme 0 #define dbcl_fixme 0
#define dbcl_err 1 #define dbcl_err 1
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "debugtools.h" #include "debugtools.h"
#endif #endif
#define DEBUG_CHANNEL_COUNT 134 #define DEBUG_CHANNEL_COUNT 135
#ifdef DEBUG_RUNTIME #ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = { short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0}, {1, 1, 0, 0},
...@@ -141,6 +141,7 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = { ...@@ -141,6 +141,7 @@ 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},
}; };
const char* debug_ch_name[] = { const char* debug_ch_name[] = {
"1", "1",
...@@ -225,6 +226,7 @@ const char* debug_ch_name[] = { ...@@ -225,6 +226,7 @@ const char* debug_ch_name[] = {
"ole", "ole",
"pager", "pager",
"palette", "palette",
"pidl",
"print", "print",
"process", "process",
"profile", "profile",
......
...@@ -15,24 +15,25 @@ ...@@ -15,24 +15,25 @@
typedef struct _DOSTASK { typedef struct _DOSTASK {
LPVOID img; LPVOID img;
unsigned img_ofs; unsigned img_ofs;
WORD psp_seg,load_seg;
HMODULE16 hModule; HMODULE16 hModule;
struct vm86plus_struct VM86; struct vm86plus_struct VM86;
int fn, state; int fn, state;
#ifdef MZ_USESYSV
/* SYSV IPC is not quite supported yet... */
key_t shm_key;
int shm_id;
#else
char mm_name[128]; char mm_name[128];
int mm_fd; int mm_fd;
#endif
int read_pipe,write_pipe; int read_pipe,write_pipe;
pid_t task; pid_t task;
} DOSTASK, *LPDOSTASK; } DOSTASK, *LPDOSTASK;
extern HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline, LPCSTR env, UINT16 show_cmd ); #define MZ_SUPPORTED
extern int MZ_InitTask( LPDOSTASK lpDosTask );
extern int MZ_RunModule( LPDOSTASK lpDosTask ); extern int MZ_RunModule( LPDOSTASK lpDosTask );
extern void MZ_KillModule( LPDOSTASK lpDosTask ); extern void MZ_KillModule( LPDOSTASK lpDosTask );
extern int DOSVM_Process( LPDOSTASK lpDosTask ); extern int DOSVM_Process( LPDOSTASK lpDosTask );
#endif /* linux */ #endif /* linux */
extern HINSTANCE16 MZ_CreateProcess( LPCSTR name, LPCSTR cmdline, LPCSTR env,
LPSTARTUPINFO32A startup, LPPROCESS_INFORMATION info );
extern int DOSVM_Enter( PCONTEXT context );
...@@ -40,6 +40,17 @@ typedef struct ...@@ -40,6 +40,17 @@ typedef struct
int flags; int flags;
} DOS_DEVICE; } DOS_DEVICE;
/* Macros to convert 16 bit to 32 bit file handles and back */
#define HFILE16_TO_HFILE32(handle) \
(((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
(handle)-5)
#define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
(HFILE16)hnd+5); })
/* files/file.c */ /* files/file.c */
extern FILE_OBJECT *FILE_GetFile( HFILE32 handle ); extern FILE_OBJECT *FILE_GetFile( HFILE32 handle );
......
...@@ -200,7 +200,7 @@ typedef struct tagDC_FUNCS ...@@ -200,7 +200,7 @@ typedef struct tagDC_FUNCS
BOOL32 (*pPatBlt)(DC*,INT32,INT32,INT32,INT32,DWORD); BOOL32 (*pPatBlt)(DC*,INT32,INT32,INT32,INT32,DWORD);
BOOL32 (*pPie)(DC*,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32); BOOL32 (*pPie)(DC*,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
BOOL32 (*pPolyPolygon)(DC*,LPPOINT32,LPINT32,UINT32); BOOL32 (*pPolyPolygon)(DC*,LPPOINT32,LPINT32,UINT32);
BOOL32 (*pPolyPolyline)(DC*,LPPOINT32,LPINT32,UINT32); BOOL32 (*pPolyPolyline)(DC*,LPPOINT32,LPDWORD,DWORD);
BOOL32 (*pPolygon)(DC*,LPPOINT32,INT32); BOOL32 (*pPolygon)(DC*,LPPOINT32,INT32);
BOOL32 (*pPolyline)(DC*,LPPOINT32,INT32); BOOL32 (*pPolyline)(DC*,LPPOINT32,INT32);
BOOL32 (*pPolyBezier)(DC*,POINT32, LPPOINT32,DWORD); BOOL32 (*pPolyBezier)(DC*,POINT32, LPPOINT32,DWORD);
......
...@@ -18,32 +18,32 @@ typedef struct ...@@ -18,32 +18,32 @@ typedef struct
INT32 fmt; INT32 fmt;
LPARAM lParam; LPARAM lParam;
INT32 iImage; INT32 iImage;
INT32 iOrder; INT32 iOrder; /* see documentation of HD_ITEM */
BOOL32 bDown; BOOL32 bDown; /* is item pressed? (used for drawing) */
RECT32 rect; RECT32 rect; /* bounding rectangle of the item */
} HEADER_ITEM; } HEADER_ITEM;
typedef struct typedef struct
{ {
UINT32 uNumItem; UINT32 uNumItem; /* number of items (columns) */
INT32 nHeight; INT32 nHeight; /* height of the header (pixels) */
HFONT32 hFont; HFONT32 hFont; /* handle to the current font */
HCURSOR32 hcurArrow; HCURSOR32 hcurArrow; /* handle to the arrow cursor */
HCURSOR32 hcurDivider; HCURSOR32 hcurDivider; /* handle to a cursor (used over dividers) <-|-> */
HCURSOR32 hcurDivopen; HCURSOR32 hcurDivopen; /* handle to a cursor (used over dividers) <-||-> */
BOOL32 bCaptured; BOOL32 bCaptured; /* Is the mouse captured? */
BOOL32 bPressed; BOOL32 bPressed; /* Is a header item pressed (down)? */
BOOL32 bTracking; BOOL32 bTracking; /* Is in tracking mode? */
INT32 iMoveItem; INT32 iMoveItem; /* index of tracked item. (Tracking mode) */
INT32 xTrackOffset; INT32 xTrackOffset; /* distance between the right side of the tracked item and the cursor */
INT32 xOldTrack; INT32 xOldTrack; /* track offset (see above) after the last WM_MOUSEMOVE */
INT32 nOldWidth; INT32 nOldWidth; /* width of a sizing item after the last WM_MOUSEMOVE */
INT32 iHotItem; INT32 iHotItem; /* index of hot item (cursor is over this item) */
HIMAGELIST himl; HIMAGELIST himl; /* handle to a image list (may be 0) */
HEADER_ITEM *items; HEADER_ITEM *items; /* pointer to array of HEADER_ITEM's */
} HEADER_INFO; } HEADER_INFO;
......
...@@ -17,6 +17,7 @@ extern DWORD DOSMEM_CollateTable; ...@@ -17,6 +17,7 @@ extern DWORD DOSMEM_CollateTable;
extern BOOL32 DOSMEM_Init(HMODULE16 hModule); extern BOOL32 DOSMEM_Init(HMODULE16 hModule);
extern void DOSMEM_Tick(void); extern void DOSMEM_Tick(void);
extern WORD DOSMEM_AllocSelector(WORD); extern WORD DOSMEM_AllocSelector(WORD);
extern char * DOSMEM_MemoryBase(HMODULE16 hModule);
extern LPVOID DOSMEM_GetBlock(HMODULE16 hModule, UINT32 size, UINT16* p); extern LPVOID DOSMEM_GetBlock(HMODULE16 hModule, UINT32 size, UINT16* p);
extern BOOL32 DOSMEM_FreeBlock(HMODULE16 hModule, void* ptr); extern BOOL32 DOSMEM_FreeBlock(HMODULE16 hModule, void* ptr);
extern LPVOID DOSMEM_ResizeBlock(HMODULE16 hModule, void* ptr, UINT32 size, UINT16* p); extern LPVOID DOSMEM_ResizeBlock(HMODULE16 hModule, void* ptr, UINT32 size, UINT16* p);
...@@ -36,6 +37,10 @@ extern void IO_outport( int port, int count, DWORD value ); ...@@ -36,6 +37,10 @@ extern void IO_outport( int port, int count, DWORD value );
/* msdos/int1a.c */ /* msdos/int1a.c */
extern DWORD INT1A_GetTicksSinceMidnight(void); extern DWORD INT1A_GetTicksSinceMidnight(void);
extern void WINAPI INT_Int1aHandler(CONTEXT*);
/* msdos/int2f.c */
extern void WINAPI INT_Int2fHandler(CONTEXT*);
/* loader/signal.c */ /* loader/signal.c */
extern BOOL32 SIGNAL_Init(void); extern BOOL32 SIGNAL_Init(void);
......
...@@ -52,6 +52,7 @@ typedef struct _NE_MODULE ...@@ -52,6 +52,7 @@ typedef struct _NE_MODULE
HMODULE16 self; /* 44 Handle for this module */ HMODULE16 self; /* 44 Handle for this module */
WORD self_loading_sel; /* 46 Selector used for self-loading apps. */ WORD self_loading_sel; /* 46 Selector used for self-loading apps. */
struct _DOSTASK *lpDosTask; struct _DOSTASK *lpDosTask;
LPVOID dos_image; /* pointer to DOS memory (for DOS apps) */
} NE_MODULE; } NE_MODULE;
...@@ -98,7 +99,7 @@ typedef struct ...@@ -98,7 +99,7 @@ typedef struct
{ {
LPSTR lpEnvAddress; LPSTR lpEnvAddress;
LPSTR lpCmdLine; LPSTR lpCmdLine;
LPSTR lpCmdShow; UINT16 *lpCmdShow;
DWORD dwReserved; DWORD dwReserved;
} LOADPARAMS32; } LOADPARAMS32;
...@@ -140,8 +141,6 @@ extern FARPROC32 MODULE_GetProcAddress32( struct _PDB32*pdb,HMODULE32 hModule,LP ...@@ -140,8 +141,6 @@ extern FARPROC32 MODULE_GetProcAddress32( struct _PDB32*pdb,HMODULE32 hModule,LP
extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule ); extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule );
extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path ); extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path );
extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs ); extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit, LPCSTR cmd_line,
LPCSTR env, UINT32 show_cmd );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name ); extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name ); extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name );
......
...@@ -14,7 +14,8 @@ typedef struct tagPAGER_INFO ...@@ -14,7 +14,8 @@ typedef struct tagPAGER_INFO
COLORREF clrBk; COLORREF clrBk;
INT32 iBorder; INT32 iBorder;
INT32 iButtonSize; INT32 iButtonSize;
INT32 iPos;
BOOL32 bForward;
} PAGER_INFO; } PAGER_INFO;
......
...@@ -40,8 +40,9 @@ extern HRSRC32 PE_FindResourceEx32W(struct _wine_modref*,LPCWSTR,LPCWSTR,WORD); ...@@ -40,8 +40,9 @@ extern HRSRC32 PE_FindResourceEx32W(struct _wine_modref*,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource32(HMODULE32,HRSRC32); extern DWORD PE_SizeofResource32(HMODULE32,HRSRC32);
extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,struct _PDB32*,HFILE32,DWORD); extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,struct _PDB32*,HFILE32,DWORD);
extern HGLOBAL32 PE_LoadResource32(struct _wine_modref *wm,HRSRC32); extern HGLOBAL32 PE_LoadResource32(struct _wine_modref *wm,HRSRC32);
extern HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line, extern HINSTANCE16 PE_CreateProcess( LPCSTR name, LPCSTR cmd_line,
LPCSTR env, UINT16 showCmd ); LPCSTR env, LPSTARTUPINFO32A startup,
LPPROCESS_INFORMATION info );
struct _PDB32; /* forward definition */ struct _PDB32; /* forward definition */
struct _THDB; /* forward definition */ struct _THDB; /* forward definition */
......
...@@ -142,7 +142,7 @@ extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access, int *server_handle ...@@ -142,7 +142,7 @@ extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access, int *server_handle
extern PDB32 *PROCESS_IdToPDB( DWORD id ); extern PDB32 *PROCESS_IdToPDB( DWORD id );
extern PDB32 *PROCESS_Create( struct _NE_MODULE *pModule, LPCSTR cmd_line, extern PDB32 *PROCESS_Create( struct _NE_MODULE *pModule, LPCSTR cmd_line,
LPCSTR env, HINSTANCE16 hInstance, LPCSTR env, HINSTANCE16 hInstance,
HINSTANCE16 hPrevInstance, UINT32 cmdShow, HINSTANCE16 hPrevInstance, STARTUPINFO32A *startup,
PROCESS_INFORMATION *info ); PROCESS_INFORMATION *info );
extern void PROCESS_SuspendOtherThreads(void); extern void PROCESS_SuspendOtherThreads(void);
extern void PROCESS_ResumeOtherThreads(void); extern void PROCESS_ResumeOtherThreads(void);
......
...@@ -80,6 +80,8 @@ extern void QUEUE_WalkQueues(void); ...@@ -80,6 +80,8 @@ extern void QUEUE_WalkQueues(void);
extern BOOL32 QUEUE_IsExitingQueue( HQUEUE16 hQueue ); extern BOOL32 QUEUE_IsExitingQueue( HQUEUE16 hQueue );
extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue ); extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue );
extern MESSAGEQUEUE *QUEUE_GetSysQueue(void); extern MESSAGEQUEUE *QUEUE_GetSysQueue(void);
extern void QUEUE_Signal( HTASK16 hTask );
extern void QUEUE_Wait(void);
extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit ); extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit );
extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit ); extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
extern void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ); extern void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue );
......
...@@ -7,10 +7,38 @@ ...@@ -7,10 +7,38 @@
#ifndef __WINE_REBAR_H #ifndef __WINE_REBAR_H
#define __WINE_REBAR_H #define __WINE_REBAR_H
typedef struct tagREBAR_BAND
{
UINT32 fStyle;
COLORREF clrFore;
COLORREF clrBack;
INT32 iImage;
HWND32 hwndChild;
UINT32 cxMinChild;
UINT32 cyMinChild;
UINT32 cx;
HBITMAP32 hbmBack;
UINT32 wID;
UINT32 cyChild;
UINT32 cyMaxChild;
UINT32 cyIntegral;
UINT32 cxIdeal;
LPARAM lParam;
UINT32 cxHeader;
LPSTR lpText;
} REBAR_BAND;
typedef struct tagREBAR_INFO typedef struct tagREBAR_INFO
{ {
UINT32 uDummy; /* this is just a dummy to keep the compiler happy */ COLORREF clrBk; /* background color */
COLORREF clrText; /* text color */
HIMAGELIST himl; /* handle to imagelist */
UINT32 uNumBands; /* number of bands in the rebar */
REBAR_BAND *bands; /* pointer to the array of rebar bands */
} REBAR_INFO; } REBAR_INFO;
......
...@@ -86,6 +86,18 @@ struct get_process_info_reply ...@@ -86,6 +86,18 @@ struct get_process_info_reply
}; };
/* Retrieve information about a thread */
struct get_thread_info_request
{
int handle; /* thread handle */
};
struct get_thread_info_reply
{
void* pid; /* server thread id */
int exit_code; /* thread exit code */
};
/* Close a handle for the current process */ /* Close a handle for the current process */
struct close_handle_request struct close_handle_request
{ {
...@@ -123,6 +135,23 @@ struct open_process_reply ...@@ -123,6 +135,23 @@ struct open_process_reply
}; };
/* Wait for handles */
struct select_request
{
int count; /* handles count */
int flags; /* wait flags (see below) */
int timeout; /* timeout in ms */
/* int handles[] */
};
struct select_reply
{
int signaled; /* signaled handle */
};
#define SELECT_ALL 1
#define SELECT_MSG 2
#define SELECT_ALERTABLE 4
#define SELECT_TIMEOUT 8
/* client-side functions */ /* client-side functions */
#ifndef __WINE_SERVER__ #ifndef __WINE_SERVER__
...@@ -134,8 +163,10 @@ extern int CLIENT_TerminateThread( int handle, int exit_code ); ...@@ -134,8 +163,10 @@ extern int CLIENT_TerminateThread( int handle, int exit_code );
extern int CLIENT_CloseHandle( int handle ); extern int CLIENT_CloseHandle( int handle );
extern int CLIENT_DuplicateHandle( int src_process, int src_handle, int dst_process, extern int CLIENT_DuplicateHandle( int src_process, int src_handle, int dst_process,
int dst_handle, DWORD access, BOOL32 inherit, DWORD options ); int dst_handle, DWORD access, BOOL32 inherit, DWORD options );
extern int CLIENT_GetThreadInfo( int handle, struct get_thread_info_reply *reply );
extern int CLIENT_GetProcessInfo( int handle, struct get_process_info_reply *reply ); extern int CLIENT_GetProcessInfo( int handle, struct get_process_info_reply *reply );
extern int CLIENT_OpenProcess( void *pid, DWORD access, BOOL32 inherit ); extern int CLIENT_OpenProcess( void *pid, DWORD access, BOOL32 inherit );
extern int CLIENT_Select( int count, int *handles, int flags, int timeout );
#endif /* __WINE_SERVER__ */ #endif /* __WINE_SERVER__ */
#endif /* __WINE_SERVER_H */ #endif /* __WINE_SERVER_H */
...@@ -18,17 +18,22 @@ ...@@ -18,17 +18,22 @@
struct object; struct object;
struct object_name; struct object_name;
struct thread;
struct object_ops struct object_ops
{ {
void (*dump)(struct object *,int); /* dump the object (for debugging) */ void (*dump)(struct object *,int); /* dump the object (for debugging) */
void (*destroy)(struct object *); /* destroy on refcount == 0 */ int (*signaled)(struct object *,struct thread *); /* is object signaled? */
int (*satisfied)(struct object *,struct thread *); /* wait satisfied; return 1 if abandoned */
void (*destroy)(struct object *); /* destroy on refcount == 0 */
}; };
struct object struct object
{ {
unsigned int refcount; unsigned int refcount;
const struct object_ops *ops; const struct object_ops *ops;
struct wait_queue_entry *head;
struct wait_queue_entry *tail;
struct object_name *name; struct object_name *name;
}; };
......
...@@ -10,9 +10,11 @@ enum request ...@@ -10,9 +10,11 @@ enum request
REQ_TERMINATE_PROCESS, REQ_TERMINATE_PROCESS,
REQ_TERMINATE_THREAD, REQ_TERMINATE_THREAD,
REQ_GET_PROCESS_INFO, REQ_GET_PROCESS_INFO,
REQ_GET_THREAD_INFO,
REQ_CLOSE_HANDLE, REQ_CLOSE_HANDLE,
REQ_DUP_HANDLE, REQ_DUP_HANDLE,
REQ_OPEN_PROCESS, REQ_OPEN_PROCESS,
REQ_SELECT,
REQ_NB_REQUESTS REQ_NB_REQUESTS
}; };
...@@ -26,9 +28,11 @@ DECL_HANDLER(init_thread); ...@@ -26,9 +28,11 @@ DECL_HANDLER(init_thread);
DECL_HANDLER(terminate_process); DECL_HANDLER(terminate_process);
DECL_HANDLER(terminate_thread); DECL_HANDLER(terminate_thread);
DECL_HANDLER(get_process_info); DECL_HANDLER(get_process_info);
DECL_HANDLER(get_thread_info);
DECL_HANDLER(close_handle); DECL_HANDLER(close_handle);
DECL_HANDLER(dup_handle); DECL_HANDLER(dup_handle);
DECL_HANDLER(open_process); DECL_HANDLER(open_process);
DECL_HANDLER(select);
static const struct handler { static const struct handler {
void (*handler)(); void (*handler)();
...@@ -39,9 +43,11 @@ static const struct handler { ...@@ -39,9 +43,11 @@ static const struct handler {
{ (void(*)())req_terminate_process, sizeof(struct terminate_process_request) }, { (void(*)())req_terminate_process, sizeof(struct terminate_process_request) },
{ (void(*)())req_terminate_thread, sizeof(struct terminate_thread_request) }, { (void(*)())req_terminate_thread, sizeof(struct terminate_thread_request) },
{ (void(*)())req_get_process_info, sizeof(struct get_process_info_request) }, { (void(*)())req_get_process_info, sizeof(struct get_process_info_request) },
{ (void(*)())req_get_thread_info, sizeof(struct get_thread_info_request) },
{ (void(*)())req_close_handle, sizeof(struct close_handle_request) }, { (void(*)())req_close_handle, sizeof(struct close_handle_request) },
{ (void(*)())req_dup_handle, sizeof(struct dup_handle_request) }, { (void(*)())req_dup_handle, sizeof(struct dup_handle_request) },
{ (void(*)())req_open_process, sizeof(struct open_process_request) }, { (void(*)())req_open_process, sizeof(struct open_process_request) },
{ (void(*)())req_select, sizeof(struct select_request) },
}; };
#endif /* WANT_REQUEST_HANDLERS */ #endif /* WANT_REQUEST_HANDLERS */
......
...@@ -16,21 +16,26 @@ ...@@ -16,21 +16,26 @@
/* thread structure */ /* thread structure */
struct process; struct process;
struct thread_wait;
enum run_state { STARTING, RUNNING, TERMINATED };
struct thread struct thread
{ {
struct object obj; /* object header */ struct object obj; /* object header */
struct thread *next; /* system-wide thread list */ struct thread *next; /* system-wide thread list */
struct thread *prev; struct thread *prev;
struct thread *proc_next; /* per-process thread list */ struct thread *proc_next; /* per-process thread list */
struct thread *proc_prev; struct thread *proc_prev;
struct process *process; struct process *process;
int error; /* current error code */ struct thread_wait *wait; /* current wait condition if sleeping */
int exit_code; /* thread exit code */ int error; /* current error code */
int client_fd; /* client fd for socket communications */ enum run_state state; /* running state */
int unix_pid; /* Unix pid of client */ int exit_code; /* thread exit code */
enum request last_req; /* last request received (for debugging) */ int client_fd; /* client fd for socket communications */
char *name; int unix_pid; /* Unix pid of client */
enum request last_req; /* last request received (for debugging) */
char *name;
}; };
extern struct thread *current; extern struct thread *current;
...@@ -41,10 +46,16 @@ extern struct thread *create_thread( int fd, void *pid, int *thread_handle, ...@@ -41,10 +46,16 @@ extern struct thread *create_thread( int fd, void *pid, int *thread_handle,
int *process_handle ); int *process_handle );
extern struct thread *get_thread_from_id( void *id ); extern struct thread *get_thread_from_id( void *id );
extern struct thread *get_thread_from_handle( int handle, unsigned int access ); extern struct thread *get_thread_from_handle( int handle, unsigned int access );
extern void get_thread_info( struct thread *thread,
struct get_thread_info_reply *reply );
extern int send_reply( struct thread *thread, int pass_fd, extern int send_reply( struct thread *thread, int pass_fd,
int n, ... /* arg_1, len_1, ..., arg_n, len_n */ ); int n, ... /* arg_1, len_1, ..., arg_n, len_n */ );
extern void kill_thread( struct thread *thread, int exit_code ); extern void kill_thread( struct thread *thread, int exit_code );
extern void thread_killed( struct thread *thread, int exit_code ); extern void thread_killed( struct thread *thread, int exit_code );
extern void thread_timeout(void);
extern void sleep_on( struct thread *thread, int count, int *handles,
int flags, int timeout );
extern void wake_up( struct object *obj, int max );
#define SET_ERROR(err) (current->error = (err)) #define SET_ERROR(err) (current->error = (err))
#define CLEAR_ERROR() (current->error = 0) #define CLEAR_ERROR() (current->error = 0)
......
...@@ -6,15 +6,29 @@ ...@@ -6,15 +6,29 @@
#include "windows.h" #include "windows.h"
#include "winreg.h" #include "winreg.h"
#include "imagelist.h"
#ifndef MAX_PATH #ifndef MAX_PATH
#define MAX_PATH 260 #define MAX_PATH 260
#endif #endif
/****************************************************************************
* shell 16
*/
extern void SHELL_LoadRegistry(); extern void SHELL_LoadRegistry();
extern void SHELL_SaveRegistry(); extern void SHELL_SaveRegistry();
extern void SHELL_Init(); extern void SHELL_Init();
/* global functions used from shell32 */
extern HINSTANCE32 SHELL_FindExecutable(LPCSTR,LPCSTR ,LPSTR);
extern HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16,LPCSTR,UINT16,WORD);
/****************************************************************************
* shell 32
*/
/****************************************************************************
* common return codes
*/
#define SHELL_ERROR_SUCCESS 0L #define SHELL_ERROR_SUCCESS 0L
#define SHELL_ERROR_BADDB 1L #define SHELL_ERROR_BADDB 1L
#define SHELL_ERROR_BADKEY 2L #define SHELL_ERROR_BADKEY 2L
...@@ -25,8 +39,8 @@ extern void SHELL_Init(); ...@@ -25,8 +39,8 @@ extern void SHELL_Init();
#define SHELL_ERROR_INVALID_PARAMETER 7L #define SHELL_ERROR_INVALID_PARAMETER 7L
#define SHELL_ERROR_ACCESS_DENIED 8L #define SHELL_ERROR_ACCESS_DENIED 8L
/****************************** /****************************************************************************
* common shell file structures * common shell file structures
*/ */
#define FO_MOVE 0x0001 #define FO_MOVE 0x0001
#define FO_COPY 0x0002 #define FO_COPY 0x0002
...@@ -63,8 +77,8 @@ typedef struct { /* structure for dropped files */ ...@@ -63,8 +77,8 @@ typedef struct { /* structure for dropped files */
/* memory block with filenames follows */ /* memory block with filenames follows */
} DROPFILESTRUCT, *LPDROPFILESTRUCT; } DROPFILESTRUCT, *LPDROPFILESTRUCT;
/****************************** /****************************************************************************
* NOTIFYICONDATA * NOTIFYICONDATA
*/ */
typedef struct _NOTIFYICONDATA { typedef struct _NOTIFYICONDATA {
DWORD cbSize; DWORD cbSize;
...@@ -76,8 +90,8 @@ typedef struct _NOTIFYICONDATA { ...@@ -76,8 +90,8 @@ typedef struct _NOTIFYICONDATA {
CHAR szTip[64]; CHAR szTip[64];
} NOTIFYICONDATA, *PNOTIFYICONDATA; } NOTIFYICONDATA, *PNOTIFYICONDATA;
/******************************* /****************************************************************************
* SHITEMID, ITEMIDLIST, PIDL API * SHITEMID, ITEMIDLIST, PIDL API
*/ */
typedef struct typedef struct
{ WORD cb; /* nr of bytes in this item */ { WORD cb; /* nr of bytes in this item */
...@@ -89,6 +103,7 @@ typedef struct ...@@ -89,6 +103,7 @@ typedef struct
} ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST; } ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST;
LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl); LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl);
LPITEMIDLIST WINAPI ILGetNext(LPITEMIDLIST pidl);
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST iil1,LPCITEMIDLIST iil2); LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST iil1,LPCITEMIDLIST iil2);
DWORD WINAPI ILGetSize(LPITEMIDLIST pidl); DWORD WINAPI ILGetSize(LPITEMIDLIST pidl);
...@@ -97,7 +112,7 @@ DWORD WINAPI SHGetPathFromIDList32W (LPCITEMIDLIST pidl,LPWSTR pszPath); ...@@ -97,7 +112,7 @@ DWORD WINAPI SHGetPathFromIDList32W (LPCITEMIDLIST pidl,LPWSTR pszPath);
#define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList) #define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
/**************************************************************************** /****************************************************************************
* SHFILEINFO API * SHFILEINFO API
*/ */
typedef struct tagSHFILEINFO32A { typedef struct tagSHFILEINFO32A {
HICON32 hIcon; /* icon */ HICON32 hIcon; /* icon */
...@@ -122,7 +137,7 @@ DWORD WINAPI SHGetFileInfo32W(LPCWSTR,DWORD,SHFILEINFO32W*,UINT32,UINT32); ...@@ -122,7 +137,7 @@ DWORD WINAPI SHGetFileInfo32W(LPCWSTR,DWORD,SHFILEINFO32W*,UINT32,UINT32);
#define SHGetFileInfo WINELIB_NAME_AW(SHGetFileInfo) #define SHGetFileInfo WINELIB_NAME_AW(SHGetFileInfo)
/**************************************************************************** /****************************************************************************
* SHFILEOPSTRUCT API * SHFILEOPSTRUCT API
*/ */
typedef struct _SHFILEOPSTRUCTA typedef struct _SHFILEOPSTRUCTA
{ HWND32 hwnd; { HWND32 hwnd;
...@@ -153,7 +168,7 @@ DECL_WINELIB_TYPE_AW(SHFILEOPSTRUCT) ...@@ -153,7 +168,7 @@ DECL_WINELIB_TYPE_AW(SHFILEOPSTRUCT)
DWORD WINAPI SHFileOperation32(LPSHFILEOPSTRUCT32 lpFileOp); DWORD WINAPI SHFileOperation32(LPSHFILEOPSTRUCT32 lpFileOp);
/**************** /****************************************************************************
* APPBARDATA * APPBARDATA
*/ */
typedef struct _AppBarData { typedef struct _AppBarData {
...@@ -188,6 +203,7 @@ typedef struct ...@@ -188,6 +203,7 @@ typedef struct
{ LPITEMIDLIST pidl; { LPITEMIDLIST pidl;
DWORD unknown; DWORD unknown;
} IDSTRUCT; } IDSTRUCT;
DWORD WINAPI SHChangeNotifyRegister(HWND32 hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist); DWORD WINAPI SHChangeNotifyRegister(HWND32 hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist);
DWORD WINAPI SHChangeNotifyDeregister(LONG x1,LONG x2); DWORD WINAPI SHChangeNotifyDeregister(LONG x1,LONG x2);
...@@ -200,13 +216,17 @@ DWORD WINAPI SHChangeNotifyDeregister(LONG x1,LONG x2); ...@@ -200,13 +216,17 @@ DWORD WINAPI SHChangeNotifyDeregister(LONG x1,LONG x2);
DWORD WINAPI SHAddToRecentDocs(UINT32 uFlags, LPCVOID pv); DWORD WINAPI SHAddToRecentDocs(UINT32 uFlags, LPCVOID pv);
/**************************************************************************** /****************************************************************************
* other functions * string and path functions
*/ */
LPVOID WINAPI SHAlloc(DWORD len);
DWORD WINAPI SHFree(LPVOID x);
LPSTR WINAPI PathAddBackslash(LPSTR path); LPSTR WINAPI PathAddBackslash(LPSTR path);
LPSTR WINAPI PathCombine(LPSTR target,LPSTR x1,LPSTR x2); LPSTR WINAPI PathCombine(LPSTR target,LPSTR x1,LPSTR x2);
LPSTR WINAPI PathRemoveBlanks(LPSTR str); LPSTR WINAPI PathRemoveBlanks(LPSTR str);
LPSTR WINAPI PathFindFilename(LPSTR fn);
/****************************************************************************
* other functions
*/
LPVOID WINAPI SHAlloc(DWORD len);
DWORD WINAPI SHFree(LPVOID x);
#define SE_ERR_SHARE 26 #define SE_ERR_SHARE 26
#define SE_ERR_ASSOCINCOMPLETE 27 #define SE_ERR_ASSOCINCOMPLETE 27
...@@ -233,10 +253,4 @@ LPSTR WINAPI PathRemoveBlanks(LPSTR str); ...@@ -233,10 +253,4 @@ LPSTR WINAPI PathRemoveBlanks(LPSTR str);
#define CSIDL_FONTS 0x0014 #define CSIDL_FONTS 0x0014
#define CSIDL_TEMPLATES 0x0015 #define CSIDL_TEMPLATES 0x0015
/*******************************************
* global SHELL32.DLL variables
*/
extern HINSTANCE32 shell32_hInstance;
extern UINT32 shell32_DllRefCount;
#endif /* __WINE_SHELL_H */ #endif /* __WINE_SHELL_H */
...@@ -217,10 +217,10 @@ typedef struct _CONTEXT /* Note 1 */ ...@@ -217,10 +217,10 @@ typedef struct _CONTEXT /* Note 1 */
#define FL_sig(context) (*(WORD*)&EFL_sig(context)) #define FL_sig(context) (*(WORD*)&EFL_sig(context))
#ifdef FS_sig #ifdef FS_sig
extern WORD CALLTO16_Current_fs; #include "syslevel.h"
#define HANDLER_INIT() \ #define HANDLER_INIT() \
SET_FS(IS_SELECTOR_SYSTEM(CS_sig(HANDLER_CONTEXT)) ? \ SET_FS(IS_SELECTOR_SYSTEM(CS_sig(HANDLER_CONTEXT)) ? \
FS_sig(HANDLER_CONTEXT) : CALLTO16_Current_fs) FS_sig(HANDLER_CONTEXT) : SYSLEVEL_Win16CurrentTeb)
#else #else
#define HANDLER_INIT() /* nothing */ #define HANDLER_INIT() /* nothing */
#endif #endif
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "wintypes.h" #include "wintypes.h"
#include "winbase.h" #include "winbase.h"
extern WORD SYSLEVEL_Win16CurrentTeb;
void SYSLEVEL_Init(void); void SYSLEVEL_Init(void);
VOID SYSLEVEL_EnterWin16Lock(VOID); VOID SYSLEVEL_EnterWin16Lock(VOID);
VOID SYSLEVEL_LeaveWin16Lock(VOID); VOID SYSLEVEL_LeaveWin16Lock(VOID);
......
...@@ -147,6 +147,7 @@ extern THHOOK *pThhook; ...@@ -147,6 +147,7 @@ extern THHOOK *pThhook;
extern HTASK16 TASK_Create( struct _THDB *thdb, struct _NE_MODULE *pModule, extern HTASK16 TASK_Create( struct _THDB *thdb, struct _NE_MODULE *pModule,
HINSTANCE16 hInstance, HINSTANCE16 hPrevInstance, HINSTANCE16 hInstance, HINSTANCE16 hPrevInstance,
UINT16 cmdShow ); UINT16 cmdShow );
extern void TASK_StartTask( HTASK16 hTask );
extern void TASK_KillCurrentTask( INT16 exitCode ); extern void TASK_KillCurrentTask( INT16 exitCode );
extern HTASK16 TASK_GetNextTask( HTASK16 hTask ); extern HTASK16 TASK_GetNextTask( HTASK16 hTask );
extern void TASK_Reschedule(void); extern void TASK_Reschedule(void);
......
...@@ -44,6 +44,7 @@ typedef struct ...@@ -44,6 +44,7 @@ typedef struct
BOOL32 wait_all; /* Wait for all objects flag */ BOOL32 wait_all; /* Wait for all objects flag */
BOOL32 wait_msg; /* Wait for message flag */ BOOL32 wait_msg; /* Wait for message flag */
K32OBJ *objs[MAXIMUM_WAIT_OBJECTS]; /* Object pointers */ K32OBJ *objs[MAXIMUM_WAIT_OBJECTS]; /* Object pointers */
int server[MAXIMUM_WAIT_OBJECTS]; /* Server handles */
} WAIT_STRUCT; } WAIT_STRUCT;
/* Thread database */ /* Thread database */
...@@ -128,6 +129,7 @@ extern THDB *THREAD_Create( struct _PDB32 *pdb, DWORD stack_size, ...@@ -128,6 +129,7 @@ extern THDB *THREAD_Create( struct _PDB32 *pdb, DWORD stack_size,
int *server_thandle, int *server_phandle, int *server_thandle, int *server_phandle,
LPTHREAD_START_ROUTINE start_addr, LPVOID param ); LPTHREAD_START_ROUTINE start_addr, LPVOID param );
extern THDB *THREAD_Current(void); extern THDB *THREAD_Current(void);
extern BOOL32 THREAD_IsWin16( THDB *thdb );
extern void THREAD_Start( THDB *thdb ); extern void THREAD_Start( THDB *thdb );
extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access, int *server_handle ); extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access, int *server_handle );
extern void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread ); extern void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread );
......
...@@ -32,17 +32,18 @@ typedef struct tagTOOLBAR_INFO ...@@ -32,17 +32,18 @@ typedef struct tagTOOLBAR_INFO
INT32 nBitmapHeight; INT32 nBitmapHeight;
INT32 nBitmapWidth; INT32 nBitmapWidth;
INT32 nIndent; INT32 nIndent;
INT32 nMaxRows; /* maximum number of rows */ INT32 nMaxRows; /* maximum number of button rows */
INT32 nMaxTextRows; /* maximum number of text rows */
INT32 cxMin; /* minimum button width */
INT32 cxMax; /* maximum button width */
INT32 nNumButtons; /* number of buttons */ INT32 nNumButtons; /* number of buttons */
INT32 nNumBitmaps; /* number of bitmaps */ INT32 nNumBitmaps; /* number of bitmaps */
INT32 nNumStrings; /* number of strings */ INT32 nNumStrings; /* number of strings */
BOOL32 bUnicode; /* ASCII (FALSE) or Unicode (TRUE)? */
BOOL32 bCaptured; BOOL32 bCaptured; /* mouse captured? */
INT32 nButtonDown; INT32 nButtonDown;
INT32 nOldHit; INT32 nOldHit;
INT32 nHotItem; /* index of the "hot" item */ INT32 nHotItem; /* index of the "hot" item */
HFONT32 hFont; /* text font */ HFONT32 hFont; /* text font */
HIMAGELIST himlDef; /* default image list */ HIMAGELIST himlDef; /* default image list */
HIMAGELIST himlHot; /* hot image list */ HIMAGELIST himlHot; /* hot image list */
...@@ -50,12 +51,13 @@ typedef struct tagTOOLBAR_INFO ...@@ -50,12 +51,13 @@ typedef struct tagTOOLBAR_INFO
HWND32 hwndToolTip; /* handle to tool tip control */ HWND32 hwndToolTip; /* handle to tool tip control */
HWND32 hwndNotify; /* handle to the window that gets notifications */ HWND32 hwndNotify; /* handle to the window that gets notifications */
BOOL32 bTransparent; /* background transparency flag */ BOOL32 bTransparent; /* background transparency flag */
BOOL32 bAutoSize; BOOL32 bAutoSize; /* auto size deadlock indicator */
DWORD dwExStyle; /* extended toolbar style */ DWORD dwExStyle; /* extended toolbar style */
SIZE32 maxSize; /* maximum toolbar size */
COLORREF clrInsertMark; /* insert mark color */ COLORREF clrInsertMark; /* insert mark color */
TBUTTON_INFO *buttons; TBUTTON_INFO *buttons; /* pointer to button array */
CHAR **strings; CHAR **strings;
} TOOLBAR_INFO; } TOOLBAR_INFO;
......
...@@ -8,6 +8,14 @@ ...@@ -8,6 +8,14 @@
#define __WINE_TOOLTIPS_H #define __WINE_TOOLTIPS_H
typedef struct tagTT_SUBCLASS_INFO
{
WNDPROC32 wpOrigProc;
HWND32 hwndToolTip;
UINT32 uRefCount;
} TT_SUBCLASS_INFO, *LPTT_SUBCLASS_INFO;
typedef struct tagTTTOOL_INFO typedef struct tagTTTOOL_INFO
{ {
UINT32 uFlags; UINT32 uFlags;
...@@ -17,8 +25,6 @@ typedef struct tagTTTOOL_INFO ...@@ -17,8 +25,6 @@ typedef struct tagTTTOOL_INFO
HINSTANCE32 hinst; HINSTANCE32 hinst;
LPSTR lpszText; LPSTR lpszText;
LPARAM lParam; LPARAM lParam;
WNDPROC32 lpfnOrigProc;
} TTTOOL_INFO; } TTTOOL_INFO;
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "wintypes.h" #include "wintypes.h"
int TWEAK_Init(); int TWEAK_Init(void);
int TWEAK_CheckConfiguration(); int TWEAK_CheckConfiguration(void);
void TWEAK_DrawReliefRect95(HDC32, RECT32 const *); void TWEAK_DrawReliefRect95(HDC32, RECT32 const *);
void TWEAK_DrawRevReliefRect95(HDC32, RECT32 const *); void TWEAK_DrawRevReliefRect95(HDC32, RECT32 const *);
void TWEAK_DrawMenuSeparatorHoriz95(HDC32, UINT32, UINT32, UINT32); void TWEAK_DrawMenuSeparatorHoriz95(HDC32, UINT32, UINT32, UINT32);
......
#define WINE_RELEASE_INFO "Wine release 980809" #define WINE_RELEASE_INFO "Wine release 980822"
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#define WAIT_OBJECT_0 0 #define WAIT_OBJECT_0 0
#define WAIT_ABANDONED STATUS_ABANDONED_WAIT_0 #define WAIT_ABANDONED STATUS_ABANDONED_WAIT_0
#define WAIT_ABANDONED_0 STATUS_ABANDONED_WAIT_0 #define WAIT_ABANDONED_0 STATUS_ABANDONED_WAIT_0
#define WAIT_IO_COMPLETION STATUS_USER_APC
#define WAIT_TIMEOUT STATUS_TIMEOUT #define WAIT_TIMEOUT STATUS_TIMEOUT
#define PAGE_NOACCESS 0x01 #define PAGE_NOACCESS 0x01
...@@ -189,6 +190,7 @@ void WINAPI InitializeCriticalSection(CRITICAL_SECTION *lpCrit); ...@@ -189,6 +190,7 @@ void WINAPI InitializeCriticalSection(CRITICAL_SECTION *lpCrit);
void WINAPI LeaveCriticalSection(CRITICAL_SECTION *lpCrit); void WINAPI LeaveCriticalSection(CRITICAL_SECTION *lpCrit);
HANDLE32 WINAPI OpenProcess(DWORD access, BOOL32 inherit, DWORD id); HANDLE32 WINAPI OpenProcess(DWORD access, BOOL32 inherit, DWORD id);
void WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD); void WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD);
int WINAPI TerminateProcess(HANDLE32 h, int ret); BOOL32 WINAPI TerminateProcess(HANDLE32,DWORD);
BOOL32 WINAPI TerminateThread(HANDLE32,DWORD);
#endif /* __WINE_WINBASE_H */ #endif /* __WINE_WINBASE_H */
...@@ -22,6 +22,9 @@ extern int WIN32_LastError; ...@@ -22,6 +22,9 @@ extern int WIN32_LastError;
*/ */
#define ERROR_UNKNOWN 99999 #define ERROR_UNKNOWN 99999
#define SEVERITY_SUCCESS 0
#define SEVERITY_ERROR 1
#define ERROR_SUCCESS 0 #define ERROR_SUCCESS 0
#define ERROR_FILE_NOT_FOUND 2 #define ERROR_FILE_NOT_FOUND 2
#define ERROR_PATH_NOT_FOUND 3 #define ERROR_PATH_NOT_FOUND 3
......
...@@ -135,6 +135,7 @@ typedef void* SEGPTR; ...@@ -135,6 +135,7 @@ typedef void* SEGPTR;
DECLARE_HANDLE(HACCEL); DECLARE_HANDLE(HACCEL);
DECLARE_HANDLE(HBITMAP); DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HBRUSH); DECLARE_HANDLE(HBRUSH);
DECLARE_HANDLE(HCOLORSPACE);
DECLARE_HANDLE(HCURSOR); DECLARE_HANDLE(HCURSOR);
DECLARE_HANDLE(HDC); DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HDROP); DECLARE_HANDLE(HDROP);
...@@ -243,6 +244,7 @@ DECL_WINELIB_TYPE(HACCEL) ...@@ -243,6 +244,7 @@ DECL_WINELIB_TYPE(HACCEL)
DECL_WINELIB_TYPE(HANDLE) DECL_WINELIB_TYPE(HANDLE)
DECL_WINELIB_TYPE(HBITMAP) DECL_WINELIB_TYPE(HBITMAP)
DECL_WINELIB_TYPE(HBRUSH) DECL_WINELIB_TYPE(HBRUSH)
DECL_WINELIB_TYPE(HCOLORSPACE)
DECL_WINELIB_TYPE(HCURSOR) DECL_WINELIB_TYPE(HCURSOR)
DECL_WINELIB_TYPE(HDC) DECL_WINELIB_TYPE(HDC)
DECL_WINELIB_TYPE(HDROP) DECL_WINELIB_TYPE(HDROP)
......
...@@ -98,7 +98,7 @@ extern BOOL32 X11DRV_Polygon( struct tagDC *dc, LPPOINT32 pt, INT32 count ); ...@@ -98,7 +98,7 @@ extern BOOL32 X11DRV_Polygon( struct tagDC *dc, LPPOINT32 pt, INT32 count );
extern BOOL32 X11DRV_PolyPolygon( struct tagDC *dc, LPPOINT32 pt, extern BOOL32 X11DRV_PolyPolygon( struct tagDC *dc, LPPOINT32 pt,
LPINT32 counts, UINT32 polygons); LPINT32 counts, UINT32 polygons);
extern BOOL32 X11DRV_PolyPolyline( struct tagDC *dc, LPPOINT32 pt, extern BOOL32 X11DRV_PolyPolyline( struct tagDC *dc, LPPOINT32 pt,
LPINT32 counts, UINT32 polylines); LPDWORD counts, DWORD polylines);
extern HGDIOBJ32 X11DRV_SelectObject( struct tagDC *dc, HGDIOBJ32 handle ); extern HGDIOBJ32 X11DRV_SelectObject( struct tagDC *dc, HGDIOBJ32 handle );
......
...@@ -9,7 +9,9 @@ C_SRCS = \ ...@@ -9,7 +9,9 @@ C_SRCS = \
module.c \ module.c \
dosvm.c dosvm.c
all: $(MODULE).o dosmod PROGRAMS = dosmod
all: $(MODULE).o $(PROGRAMS)
dosmod: dosmod.c dosmod: dosmod.c
$(CC) $(ALLCFLAGS) -o dosmod $< $(CC) $(ALLCFLAGS) -o dosmod $<
......
...@@ -6,18 +6,26 @@ ...@@ -6,18 +6,26 @@
#ifdef linux #ifdef linux
/* force dosmod at high addresses */ /* apparently ELF images are usually loaded high anyway */
#ifndef __ELF__
/* if not, force dosmod at high addresses */
asm(".org 0x110000"); asm(".org 0x110000");
#endif __ELF__
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/vm86.h> #include <sys/vm86.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
/* FIXME: hack because libc vm86 may be the old syscall version */ /* FIXME: hack because libc vm86 may be the old syscall version */
static __inline__ int vm86plus( int func, struct vm86plus_struct *ptr ) static __inline__ int vm86plus( int func, struct vm86plus_struct *ptr )
...@@ -50,16 +58,37 @@ int main(int argc,char**argv) ...@@ -50,16 +58,37 @@ int main(int argc,char**argv)
void*img; void*img;
struct vm86plus_struct VM86; struct vm86plus_struct VM86;
int func,ret; int func,ret;
off_t fofs=0;
pid_t ppid=getppid();
/* fprintf(stderr,"main is at %08lx, file is %s, fd=%d\n",(unsigned long)&main,argv[0],mfd); */ /* fprintf(stderr,"main is at %08lx, file is %s, fd=%d\n",(unsigned long)&main,argv[0],mfd); */
if (mfd<0) return 1; if (mfd<0) return 1;
/* Map in our DOS image at the start of the process address space */ /* Map in our DOS image at the start of the process address space */
img=mmap(NULL,0x110000,PROT_EXEC|PROT_READ|PROT_WRITE,MAP_FIXED|MAP_SHARED,mfd,0); if (argv[1]) {
/* Ulrich Weigand suggested mapping in the DOS image directly from the Wine
address space */
fofs=atol(argv[1]);
/* linux currently only allows mapping a process memory if it's being ptraced */
/* Linus doesn't like it, so this probably won't work in the future */
/* it doesn't even work for me right now */
ptrace(PTRACE_ATTACH,ppid,0,0);
kill(ppid,SIGSTOP);
waitpid(ppid,NULL,0);
}
img=mmap(NULL,0x110000,PROT_EXEC|PROT_READ|PROT_WRITE,MAP_FIXED|MAP_SHARED,mfd,fofs);
if (argv[1]) {
ptrace(PTRACE_DETACH,ppid,0,0);
kill(ppid,SIGCONT);
}
if (img==(void*)-1) { if (img==(void*)-1) {
fprintf(stderr,"DOS memory map failed, error=%s\n",strerror(errno)); fprintf(stderr,"DOS memory map failed, error=%s\n",strerror(errno));
fprintf(stderr,"in attempt to map %s, offset %08lX, length 110000, to offset 0\n",argv[0],fofs);
return 1; return 1;
} }
/* fprintf(stderr,"Successfully mapped DOS memory, entering vm86 loop\n"); */ /* fprintf(stderr,"Successfully mapped DOS memory, entering vm86 loop\n"); */
/* report back to the main program that we're ready */
ret=0;
write(1,&ret,sizeof(ret));
/* context exchange loop */ /* context exchange loop */
do { do {
if (read(0,&func,sizeof(func))!=sizeof(func)) return 1; if (read(0,&func,sizeof(func))!=sizeof(func)) return 1;
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* DOS Virtual Machine * DOS Virtual Machine
* *
* Copyright 1998 Ove Kven * Copyright 1998 Ove Kven
*
* This code hasn't been completely cleaned up yet.
*/ */
#ifdef linux #ifdef linux
...@@ -17,14 +19,16 @@ ...@@ -17,14 +19,16 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "windows.h" #include "windows.h"
#include "winbase.h" #include "winbase.h"
#include "winnt.h"
#include "msdos.h" #include "msdos.h"
#include "miscemu.h" #include "miscemu.h"
#include "debug.h" #include "debug.h"
#include "module.h" #include "module.h"
#include "task.h"
#include "ldt.h" #include "ldt.h"
#include "dosexe.h" #include "dosexe.h"
void DOSVM_Dump( LPDOSTASK lpDosTask) static void DOSVM_Dump( LPDOSTASK lpDosTask)
{ {
unsigned iofs; unsigned iofs;
BYTE*inst; BYTE*inst;
...@@ -48,6 +52,7 @@ void DOSVM_Dump( LPDOSTASK lpDosTask) ...@@ -48,6 +52,7 @@ void DOSVM_Dump( LPDOSTASK lpDosTask)
fprintf(stderr,"AX=%04lX CX=%04lX DX=%04lX BX=%04lX\n",REGS.eax,REGS.ebx,REGS.ecx,REGS.edx); fprintf(stderr,"AX=%04lX CX=%04lX DX=%04lX BX=%04lX\n",REGS.eax,REGS.ebx,REGS.ecx,REGS.edx);
fprintf(stderr,"SI=%04lX DI=%04lX SP=%04lX BP=%04lX\n",REGS.esi,REGS.edi,REGS.esp,REGS.ebp); fprintf(stderr,"SI=%04lX DI=%04lX SP=%04lX BP=%04lX\n",REGS.esi,REGS.edi,REGS.esp,REGS.ebp);
fprintf(stderr,"CS=%04X DS=%04X ES=%04X SS=%04X\n",REGS.cs,REGS.ds,REGS.es,REGS.ss); fprintf(stderr,"CS=%04X DS=%04X ES=%04X SS=%04X\n",REGS.cs,REGS.ds,REGS.es,REGS.ss);
fprintf(stderr,"EIP=%04lX EFLAGS=%08lX\n",REGS.eip,REGS.eflags);
iofs=((DWORD)REGS.cs<<4)+REGS.eip; iofs=((DWORD)REGS.cs<<4)+REGS.eip;
#undef REGS #undef REGS
...@@ -59,8 +64,10 @@ void DOSVM_Dump( LPDOSTASK lpDosTask) ...@@ -59,8 +64,10 @@ void DOSVM_Dump( LPDOSTASK lpDosTask)
exit(0); exit(0);
} }
int DOSVM_Int(int vect, LPDOSTASK lpDosTask, PCONTEXT context ) static int DOSVM_Int(int vect, LPDOSTASK lpDosTask, PCONTEXT context )
{ {
/* we should really map to if1632/wprocs.spec, but not all
interrupt handlers are adapted to support our VM yet */
switch (vect) { switch (vect) {
case 0x20: case 0x20:
return -1; return -1;
...@@ -68,21 +75,30 @@ int DOSVM_Int(int vect, LPDOSTASK lpDosTask, PCONTEXT context ) ...@@ -68,21 +75,30 @@ int DOSVM_Int(int vect, LPDOSTASK lpDosTask, PCONTEXT context )
if (AH_reg(context)==0x4c) return -1; if (AH_reg(context)==0x4c) return -1;
DOS3Call(context); DOS3Call(context);
break; break;
case 0x1a:
INT_Int1aHandler(context);
break;
case 0x2f:
INT_Int2fHandler(context);
break;
} }
return 0; return 0;
} }
#define CV CP(eax,Eax); CP(ecx,Ecx); CP(edx,Edx); CP(ebx,Ebx); \
CP(esi,Esi); CP(edi,Edi); CP(esp,Esp); CP(ebp,Ebp); \
CP(cs,SegCs); CP(ds,SegDs); CP(es,SegEs); \
CP(ss,SegSs); CP(fs,SegFs); CP(gs,SegGs); \
CP(eip,Eip); CP(eflags,EFlags)
int DOSVM_Process( LPDOSTASK lpDosTask ) int DOSVM_Process( LPDOSTASK lpDosTask )
{ {
CONTEXT context; CONTEXT context;
int ret=0; int ret=0;
#define REGS lpDosTask->VM86.regs #define CP(x,y) context.y = lpDosTask->VM86.regs.x
context.Eax=REGS.eax; context.Ecx=REGS.ecx; context.Edx=REGS.edx; context.Ebx=REGS.ebx; CV;
context.Esi=REGS.esi; context.Edi=REGS.edi; context.Esp=REGS.esp; context.Ebp=REGS.ebp; #undef CP
context.SegCs=REGS.cs; context.SegDs=REGS.ds; context.SegEs=REGS.es;
context.SegSs=REGS.ss; context.SegFs=REGS.fs; context.SegGs=REGS.gs;
context.Eip=REGS.eip; context.EFlags=REGS.eflags;
(void*)V86BASE(&context)=lpDosTask->img; (void*)V86BASE(&context)=lpDosTask->img;
switch (VM86_TYPE(lpDosTask->fn)) { switch (VM86_TYPE(lpDosTask->fn)) {
...@@ -106,13 +122,67 @@ int DOSVM_Process( LPDOSTASK lpDosTask ) ...@@ -106,13 +122,67 @@ int DOSVM_Process( LPDOSTASK lpDosTask )
} }
lpDosTask->fn=VM86_ENTER; lpDosTask->fn=VM86_ENTER;
REGS.eax=context.Eax; REGS.ecx=context.Ecx; REGS.edx=context.Edx; REGS.ebx=context.Ebx; #define CP(x,y) lpDosTask->VM86.regs.x = context.y
REGS.esi=context.Esi; REGS.edi=context.Edi; REGS.esp=context.Esp; REGS.ebp=context.Ebp; CV;
REGS.cs=context.SegCs; REGS.ds=context.SegDs; REGS.es=context.SegEs; #undef CP
REGS.ss=context.SegSs; REGS.fs=context.SegFs; REGS.gs=context.SegGs;
REGS.eip=context.Eip; REGS.eflags=context.EFlags;
#undef REGS
return ret; return ret;
} }
int DOSVM_Enter( PCONTEXT context )
{
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
NE_MODULE *pModule = NE_GetPtr( pTask->hModule );
LPDOSTASK lpDosTask;
int stat;
GlobalUnlock16( GetCurrentTask() );
if (!pModule) {
ERR(module,"No task is currently active!\n");
return -1;
}
if (!pModule->lpDosTask) {
/* no VM86 (dosmod) task is currently running, start one */
if ((lpDosTask = calloc(1, sizeof(DOSTASK))) == NULL)
return 0;
lpDosTask->img=DOSMEM_MemoryBase(pModule->self);
lpDosTask->hModule=pModule->self;
stat=MZ_InitTask(lpDosTask);
if (stat<32) {
free(lpDosTask);
return -1;
}
pModule->lpDosTask = lpDosTask;
pModule->dos_image = lpDosTask->img;
/* Note: we're leaving it running after this, in case we need it again,
as this minimizes the overhead of starting it up every time...
it will be killed automatically when the current task terminates */
} else lpDosTask=pModule->lpDosTask;
if (context) {
#define CP(x,y) lpDosTask->VM86.regs.x = context->y
CV;
#undef CP
}
/* main loop */
while ((stat = MZ_RunModule(lpDosTask)) >= 0)
if (stat > 0 && DOSVM_Process(lpDosTask) < 0)
break;
if (context) {
#define CP(x,y) context->y = lpDosTask->VM86.regs.x
CV;
#undef CP
}
return 0;
}
#else /* !linux */
int DOSVM_Enter( PCONTEXT context )
{
ERR(module,"DOS realmode not supported on this architecture!\n");
return -1;
}
#endif /* linux */ #endif /* linux */
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* DOS (MZ) loader * DOS (MZ) loader
* *
* Copyright 1998 Ove Kven * Copyright 1998 Ove Kven
*
* This code hasn't been completely cleaned up yet.
*/ */
#ifdef linux #ifdef linux
...@@ -15,16 +17,8 @@ ...@@ -15,16 +17,8 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef MZ_USESYSV
#include <sys/ipc.h>
#include <sys/shm.h>
#else
#include <sys/mman.h> #include <sys/mman.h>
#endif
#include <sys/vm86.h> #include <sys/vm86.h>
#ifdef MZ_USESYSV
#include <linux/mm.h> /* FIXME: where else should I fetch the PAGE_SIZE define? */
#endif
#include "windows.h" #include "windows.h"
#include "winbase.h" #include "winbase.h"
#include "module.h" #include "module.h"
...@@ -35,15 +29,14 @@ ...@@ -35,15 +29,14 @@
#include "debug.h" #include "debug.h"
#include "dosexe.h" #include "dosexe.h"
/* define this to try mapping through /proc/pid/mem instead of a temp file,
but Linus doesn't like mmapping /proc/pid/mem, so it doesn't work for me */
#undef MZ_MAPSELF
#define BIOS_DATA_SEGMENT 0x40 #define BIOS_DATA_SEGMENT 0x40
#define BIOS_SEGMENT BIOSSEG /* BIOSSEG is defined to 0xf000 in sys/vm86.h */ #define BIOS_SEGMENT BIOSSEG /* BIOSSEG is defined to 0xf000 in sys/vm86.h */
#define STUB_SEGMENT BIOS_SEGMENT #define STUB_SEGMENT BIOS_SEGMENT
#ifdef MZ_USESYSV
/* it might be that SYSV supports START_OFFSET 0 after all, haven't checked */
#define START_OFFSET PAGE_SIZE
#else
#define START_OFFSET 0 #define START_OFFSET 0
#endif
#define PSP_SIZE 0x10 #define PSP_SIZE 0x10
#define SEG16(ptr,seg) ((LPVOID)((BYTE*)ptr+((DWORD)(seg)<<4))) #define SEG16(ptr,seg) ((LPVOID)((BYTE*)ptr+((DWORD)(seg)<<4)))
...@@ -80,7 +73,10 @@ static void MZ_InitPSP( LPVOID lpPSP, LPCSTR cmdline, LPCSTR env ) ...@@ -80,7 +73,10 @@ static void MZ_InitPSP( LPVOID lpPSP, LPCSTR cmdline, LPCSTR env )
psp->nextParagraph=0x9FFF; psp->nextParagraph=0x9FFF;
/* copy parameters */ /* copy parameters */
if (cmd) { if (cmd) {
#if 0
/* command.com doesn't do this */
while (*cmd == ' ') cmd++; while (*cmd == ' ') cmd++;
#endif
psp->cmdLine[0]=strlen(cmd); psp->cmdLine[0]=strlen(cmd);
strcpy(psp->cmdLine+1,cmd); strcpy(psp->cmdLine+1,cmd);
psp->cmdLine[psp->cmdLine[0]+1]='\r'; psp->cmdLine[psp->cmdLine[0]+1]='\r';
...@@ -89,11 +85,11 @@ static void MZ_InitPSP( LPVOID lpPSP, LPCSTR cmdline, LPCSTR env ) ...@@ -89,11 +85,11 @@ static void MZ_InitPSP( LPVOID lpPSP, LPCSTR cmdline, LPCSTR env )
/* FIXME: integrate the PDB stuff from Wine (loader/task.c) */ /* FIXME: integrate the PDB stuff from Wine (loader/task.c) */
} }
static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lpDosTask ) static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env,
LPDOSTASK lpDosTask, NE_MODULE *pModule )
{ {
IMAGE_DOS_HEADER mz_header; IMAGE_DOS_HEADER mz_header;
DWORD image_start,image_size,min_size,max_size,avail; DWORD image_start,image_size,min_size,max_size,avail;
WORD psp_seg,load_seg;
BYTE*psp_start,*load_start; BYTE*psp_start,*load_start;
int x; int x;
SEGPTR reloc; SEGPTR reloc;
...@@ -111,10 +107,10 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp ...@@ -111,10 +107,10 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp
/* allocate 1MB+64K shared memory */ /* allocate 1MB+64K shared memory */
lpDosTask->img_ofs=START_OFFSET; lpDosTask->img_ofs=START_OFFSET;
#ifdef MZ_USESYSV #ifdef MZ_MAPSELF
lpDosTask->key=ftok(".",'d'); /* FIXME: this is from my IPC intro doc */ lpDosTask->img=VirtualAlloc(NULL,0x110000,MEM_COMMIT,PAGE_READWRITE);
lpDosTask->shm_id=shmget(lpDosTask->key,0x110000-START_OFFSET,IPC_CREAT|SHM_R|SHM_W); /* make sure mmap accepts it */
lpDosTask->img=shmat(lpDosTask->shm_id,NULL,0); ((char*)lpDosTask->img)[0x10FFFF]=0;
#else #else
tmpnam(lpDosTask->mm_name); tmpnam(lpDosTask->mm_name);
/* strcpy(lpDosTask->mm_name,"/tmp/mydosimage"); */ /* strcpy(lpDosTask->mm_name,"/tmp/mydosimage"); */
...@@ -131,6 +127,7 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp ...@@ -131,6 +127,7 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp
return 0; return 0;
} }
TRACE(module,"DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img); TRACE(module,"DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img);
pModule->dos_image=lpDosTask->img;
/* initialize the memory */ /* initialize the memory */
MZ_InitSystem(lpDosTask->img); MZ_InitSystem(lpDosTask->img);
...@@ -147,12 +144,12 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp ...@@ -147,12 +144,12 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp
return 0; return 0;
} }
if (avail>max_size) avail=max_size; if (avail>max_size) avail=max_size;
psp_start=DOSMEM_GetBlock(lpDosTask->hModule,avail,&psp_seg); psp_start=DOSMEM_GetBlock(lpDosTask->hModule,avail,&lpDosTask->psp_seg);
if (!psp_start) { if (!psp_start) {
ERR(module, "error allocating DOS memory\n"); ERR(module, "error allocating DOS memory\n");
return 0; return 0;
} }
load_seg=psp_seg+PSP_SIZE; lpDosTask->load_seg=lpDosTask->psp_seg+PSP_SIZE;
load_start=psp_start+(PSP_SIZE<<4); load_start=psp_start+(PSP_SIZE<<4);
MZ_InitPSP(psp_start, cmdline, env); MZ_InitPSP(psp_start, cmdline, env);
...@@ -169,26 +166,27 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp ...@@ -169,26 +166,27 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lp
for (x=0; x<mz_header.e_crlc; x++) { for (x=0; x<mz_header.e_crlc; x++) {
if (_lread16(hFile,&reloc,sizeof(reloc)) != sizeof(reloc)) if (_lread16(hFile,&reloc,sizeof(reloc)) != sizeof(reloc))
return 11; /* invalid exe */ return 11; /* invalid exe */
*(WORD*)SEGPTR16(load_start,reloc)+=load_seg; *(WORD*)SEGPTR16(load_start,reloc)+=lpDosTask->load_seg;
} }
/* initialize vm86 struct */ /* initialize vm86 struct */
memset(&lpDosTask->VM86,0,sizeof(lpDosTask->VM86)); memset(&lpDosTask->VM86,0,sizeof(lpDosTask->VM86));
lpDosTask->VM86.regs.cs=load_seg+mz_header.e_cs; lpDosTask->VM86.regs.cs=lpDosTask->load_seg+mz_header.e_cs;
lpDosTask->VM86.regs.eip=mz_header.e_ip; lpDosTask->VM86.regs.eip=mz_header.e_ip;
lpDosTask->VM86.regs.ss=load_seg+mz_header.e_ss; lpDosTask->VM86.regs.ss=lpDosTask->load_seg+mz_header.e_ss;
lpDosTask->VM86.regs.esp=mz_header.e_sp; lpDosTask->VM86.regs.esp=mz_header.e_sp;
lpDosTask->VM86.regs.ds=psp_seg; lpDosTask->VM86.regs.ds=lpDosTask->psp_seg;
lpDosTask->VM86.regs.es=psp_seg; lpDosTask->VM86.regs.es=lpDosTask->psp_seg;
/* hmm, what else do we need? */ /* hmm, what else do we need? */
return 32; return 32;
} }
static int MZ_InitTask( LPDOSTASK lpDosTask ) int MZ_InitTask( LPDOSTASK lpDosTask )
{ {
int read_fd[2],write_fd[2]; int read_fd[2],write_fd[2];
pid_t child; pid_t child;
char *fname,*farg,arg[16],fproc[64];
/* create read pipe */ /* create read pipe */
if (pipe(read_fd)<0) return 0; if (pipe(read_fd)<0) return 0;
...@@ -199,15 +197,36 @@ static int MZ_InitTask( LPDOSTASK lpDosTask ) ...@@ -199,15 +197,36 @@ static int MZ_InitTask( LPDOSTASK lpDosTask )
lpDosTask->write_pipe=write_fd[1]; lpDosTask->write_pipe=write_fd[1];
lpDosTask->fn=VM86_ENTER; lpDosTask->fn=VM86_ENTER;
lpDosTask->state=1; lpDosTask->state=1;
TRACE(module,"Preparing to load DOS EXE support module: forking\n"); /* if we have a mapping file, use it */
fname=lpDosTask->mm_name; farg=NULL;
if (!fname[0]) {
/* otherwise, map our own memory image */
sprintf(fproc,"/proc/%d/mem",getpid());
sprintf(arg,"%ld",(unsigned long)lpDosTask->img);
fname=fproc; farg=arg;
}
TRACE(module,"Preparing to load DOS VM support module: forking\n");
if ((child=fork())<0) { if ((child=fork())<0) {
close(write_fd[0]); close(write_fd[1]); close(write_fd[0]); close(write_fd[1]);
close(read_fd[0]); close(read_fd[1]); return 0; close(read_fd[0]); close(read_fd[1]); return 0;
} }
if (child!=0) { if (child!=0) {
/* parent process */ /* parent process */
int ret;
close(read_fd[1]); close(write_fd[0]); close(read_fd[1]); close(write_fd[0]);
lpDosTask->task=child; lpDosTask->task=child;
/* wait for child process to signal readiness */
do {
if (read(lpDosTask->read_pipe,&ret,sizeof(ret))!=sizeof(ret)) {
if ((errno==EINTR)||(errno==EAGAIN)) continue;
/* failure */
ERR(module,"dosmod has failed to initialize\n");
return 0;
}
} while (0);
/* all systems are now go */
} else { } else {
/* child process */ /* child process */
close(read_fd[0]); close(write_fd[1]); close(read_fd[0]); close(write_fd[1]);
...@@ -215,9 +234,9 @@ static int MZ_InitTask( LPDOSTASK lpDosTask ) ...@@ -215,9 +234,9 @@ static int MZ_InitTask( LPDOSTASK lpDosTask )
dup2(write_fd[0],0); /* stdin */ dup2(write_fd[0],0); /* stdin */
dup2(read_fd[1],1); /* stdout */ dup2(read_fd[1],1); /* stdout */
/* now load dosmod */ /* now load dosmod */
execlp("dosmod",lpDosTask->mm_name,NULL); execlp("dosmod",fname,farg,NULL);
execl("dosmod",lpDosTask->mm_name,NULL); execl("dosmod",fname,farg,NULL);
execl("loader/dos/dosmod",lpDosTask->mm_name,NULL); execl("loader/dos/dosmod",fname,farg,NULL);
/* if failure, exit */ /* if failure, exit */
ERR(module,"Failed to spawn dosmod, error=%s\n",strerror(errno)); ERR(module,"Failed to spawn dosmod, error=%s\n",strerror(errno));
exit(1); exit(1);
...@@ -225,8 +244,8 @@ static int MZ_InitTask( LPDOSTASK lpDosTask ) ...@@ -225,8 +244,8 @@ static int MZ_InitTask( LPDOSTASK lpDosTask )
return 32; return 32;
} }
HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline, HINSTANCE16 MZ_CreateProcess( LPCSTR name, LPCSTR cmdline, LPCSTR env,
LPCSTR env, UINT16 show_cmd ) LPSTARTUPINFO32A startup, LPPROCESS_INFORMATION info )
{ {
LPDOSTASK lpDosTask; LPDOSTASK lpDosTask;
HMODULE16 hModule; HMODULE16 hModule;
...@@ -234,7 +253,6 @@ HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline, ...@@ -234,7 +253,6 @@ HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline,
NE_MODULE *pModule; NE_MODULE *pModule;
HFILE16 hFile; HFILE16 hFile;
OFSTRUCT ofs; OFSTRUCT ofs;
PROCESS_INFORMATION info;
int err; int err;
if ((lpDosTask = calloc(1, sizeof(DOSTASK))) == NULL) if ((lpDosTask = calloc(1, sizeof(DOSTASK))) == NULL)
...@@ -252,29 +270,41 @@ HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline, ...@@ -252,29 +270,41 @@ HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline,
pModule->lpDosTask = lpDosTask; pModule->lpDosTask = lpDosTask;
lpDosTask->img=NULL; lpDosTask->mm_name[0]=0; lpDosTask->mm_fd=-1; lpDosTask->img=NULL; lpDosTask->mm_name[0]=0; lpDosTask->mm_fd=-1;
err = MZ_LoadImage( hFile, cmdline, env, lpDosTask ); err = MZ_LoadImage( hFile, cmdline, env, lpDosTask, pModule );
_lclose16(hFile); _lclose16(hFile);
pModule->dos_image = lpDosTask->img;
if (err<32) {
if (lpDosTask->mm_name[0]!=0) {
if (lpDosTask->img!=NULL) munmap(lpDosTask->img,0x110000-START_OFFSET);
if (lpDosTask->mm_fd>=0) close(lpDosTask->mm_fd);
unlink(lpDosTask->mm_name);
} else
if (lpDosTask->img!=NULL) VirtualFree(lpDosTask->img,0x110000,MEM_RELEASE);
return err;
}
err = MZ_InitTask( lpDosTask );
if (lpDosTask->mm_name[0]!=0) {
/* we unlink the temp file here to avoid leaving a mess in /tmp
if/when Wine crashes; the mapping still remains open, though */
unlink(lpDosTask->mm_name);
}
if (err<32) { if (err<32) {
if (lpDosTask->img!=NULL) munmap(lpDosTask->img,0x110000-START_OFFSET); MZ_KillModule( lpDosTask );
if (lpDosTask->mm_fd>=0) close(lpDosTask->mm_fd); /* FIXME: cleanup hModule */
if (lpDosTask->mm_name[0]!=0) unlink(lpDosTask->mm_name);
return err; return err;
} }
MZ_InitTask( lpDosTask );
hInstance = NE_CreateInstance(pModule, NULL, (cmdline == NULL)); hInstance = NE_CreateInstance(pModule, NULL, (cmdline == NULL));
PROCESS_Create( pModule, cmdline, env, hInstance, 0, show_cmd, &info ); PROCESS_Create( pModule, cmdline, env, hInstance, 0, startup, info );
/* we don't need the handles for now */
CloseHandle( info.hThread );
CloseHandle( info.hProcess );
return hInstance; return hInstance;
} }
void MZ_KillModule( LPDOSTASK lpDosTask ) void MZ_KillModule( LPDOSTASK lpDosTask )
{ {
munmap(lpDosTask->img,0x110000-START_OFFSET); if (lpDosTask->mm_name[0]!=0) {
close(lpDosTask->mm_fd); munmap(lpDosTask->img,0x110000-START_OFFSET);
unlink(lpDosTask->mm_name); close(lpDosTask->mm_fd);
} else VirtualFree(lpDosTask->img,0x110000,MEM_RELEASE);
close(lpDosTask->read_pipe); close(lpDosTask->read_pipe);
close(lpDosTask->write_pipe); close(lpDosTask->write_pipe);
kill(lpDosTask->task,SIGTERM); kill(lpDosTask->task,SIGTERM);
...@@ -310,4 +340,13 @@ int MZ_RunModule( LPDOSTASK lpDosTask ) ...@@ -310,4 +340,13 @@ int MZ_RunModule( LPDOSTASK lpDosTask )
return 0; return 0;
} }
#endif /* linux */ #else /* !linux */
HINSTANCE16 MZ_CreateProcess( LPCSTR name, LPCSTR cmdline, LPCSTR env,
LPSTARTUPINFO32A startup, LPPROCESS_INFORMATION info )
{
WARN(module,"DOS executables not supported on this architecture\n");
return (HMODULE16)11; /* invalid exe */
}
#endif
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "process.h" #include "process.h"
#include "toolhelp.h" #include "toolhelp.h"
#include "snoop.h" #include "snoop.h"
#include "stackframe.h"
#include "debug.h" #include "debug.h"
FARPROC16 (*fnSNOOP16_GetProcAddress16)(HMODULE16,DWORD,FARPROC16) = NULL; FARPROC16 (*fnSNOOP16_GetProcAddress16)(HMODULE16,DWORD,FARPROC16) = NULL;
...@@ -744,6 +745,8 @@ HINSTANCE16 NE_LoadModule( LPCSTR name, HINSTANCE16 *hPrevInstance, ...@@ -744,6 +745,8 @@ HINSTANCE16 NE_LoadModule( LPCSTR name, HINSTANCE16 *hPrevInstance,
{ {
HINSTANCE16 prev; HINSTANCE16 prev;
pModule = NE_GetPtr( hModule ); pModule = NE_GetPtr( hModule );
if ( pModule->module32 ) return (HINSTANCE16)21;
hInstance = NE_CreateInstance( pModule, &prev, lib_only ); hInstance = NE_CreateInstance( pModule, &prev, lib_only );
if (hInstance != prev) /* not a library */ if (hInstance != prev) /* not a library */
NE_LoadSegment( pModule, pModule->dgroup ); NE_LoadSegment( pModule, pModule->dgroup );
...@@ -1115,3 +1118,55 @@ BOOL16 WINAPI ModuleFindHandle( MODULEENTRY *lpme, HMODULE16 hModule ) ...@@ -1115,3 +1118,55 @@ BOOL16 WINAPI ModuleFindHandle( MODULEENTRY *lpme, HMODULE16 hModule )
lpme->wNext = hModule; lpme->wNext = hModule;
return ModuleNext( lpme ); return ModuleNext( lpme );
} }
/***************************************************************************
* MapHModuleLS (KERNEL32.520)
*/
HMODULE16 WINAPI MapHModuleLS(HMODULE32 hmod) {
NE_MODULE *pModule;
if (!hmod)
return ((TDB*)GlobalLock16(GetCurrentTask()))->hInstance;
if (!HIWORD(hmod))
return hmod; /* we already have a 16 bit module handle */
pModule = (NE_MODULE*)GlobalLock16(hFirstModule);
while (pModule) {
if (pModule->module32 == hmod)
return pModule->self;
pModule = (NE_MODULE*)GlobalLock16(pModule->next);
}
return 0;
}
/***************************************************************************
* MapHModuleSL (KERNEL32.521)
*/
HMODULE32 WINAPI MapHModuleSL(HMODULE16 hmod) {
NE_MODULE *pModule;
if (!hmod) {
TDB *pTask = (TDB*)GlobalLock16(GetCurrentTask());
hmod = pTask->hInstance;
}
pModule = (NE_MODULE*)GlobalLock16(hmod);
if ( (pModule->magic!=IMAGE_OS2_SIGNATURE) ||
!(pModule->flags & NE_FFLAGS_WIN32)
)
return 0;
return pModule->module32;
}
/***************************************************************************
* MapHInstLS (KERNEL32.516)
*/
REGS_ENTRYPOINT(MapHInstLS) {
EAX_reg(context) = MapHModuleLS(EAX_reg(context));
}
/***************************************************************************
* MapHInstLS (KERNEL32.518)
*/
REGS_ENTRYPOINT(MapHInstSL) {
EAX_reg(context) = MapHModuleSL(EAX_reg(context));
}
...@@ -374,7 +374,7 @@ HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType, ...@@ -374,7 +374,7 @@ HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
*/ */
INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc ) INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{ {
HFILE32 fd; HFILE16 fd;
NE_MODULE *pModule = NE_GetPtr( hModule ); NE_MODULE *pModule = NE_GetPtr( hModule );
if (!pModule || !pModule->res_table || !hRsrc) return -1; if (!pModule || !pModule->res_table || !hRsrc) return -1;
...@@ -383,11 +383,11 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc ) ...@@ -383,11 +383,11 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */ assert( !__winelib ); /* Can't use Win16 resource functions in Winelib */
if ((fd = _lopen32( NE_MODULE_NAME(pModule), OF_READ )) != -1) if ((fd = _lopen16( NE_MODULE_NAME(pModule), OF_READ )) != -1)
{ {
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table); WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
NE_NAMEINFO *pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc); NE_NAMEINFO *pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
_llseek32( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET ); _llseek16( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET );
} }
return fd; return fd;
} }
......
...@@ -827,8 +827,9 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process, ...@@ -827,8 +827,9 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
* FIXME: this function should use PE_LoadLibraryEx32A, but currently can't * FIXME: this function should use PE_LoadLibraryEx32A, but currently can't
* due to the PROCESS_Create stuff. * due to the PROCESS_Create stuff.
*/ */
HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line, HINSTANCE16 PE_CreateProcess( LPCSTR name, LPCSTR cmd_line,
LPCSTR env, UINT16 show_cmd ) LPCSTR env, LPSTARTUPINFO32A startup,
LPPROCESS_INFORMATION info )
{ {
HMODULE16 hModule16; HMODULE16 hModule16;
HMODULE32 hModule32; HMODULE32 hModule32;
...@@ -836,8 +837,8 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line, ...@@ -836,8 +837,8 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line,
NE_MODULE *pModule; NE_MODULE *pModule;
HFILE32 hFile; HFILE32 hFile;
OFSTRUCT ofs; OFSTRUCT ofs;
THDB *thdb = THREAD_Current();
PDB32 *process; PDB32 *process;
TDB *pTask;
WINE_MODREF *wm; WINE_MODREF *wm;
if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32) if ((hFile = OpenFile32( name, &ofs, OF_READ )) == HFILE_ERROR32)
...@@ -850,21 +851,13 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line, ...@@ -850,21 +851,13 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line,
pModule->module32 = hModule32 = PE_LoadImage( hFile ); pModule->module32 = hModule32 = PE_LoadImage( hFile );
if (hModule32 < 32) return 21; if (hModule32 < 32) return 21;
hInstance = NE_CreateInstance( pModule, NULL, (cmd_line == NULL) ); if (PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL)
if (cmd_line && return 11;
!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
PROCESS_INFORMATION info;
PDB32 *pdb = PROCESS_Create( pModule, cmd_line, env,
hInstance, 0, show_cmd, &info );
TDB *pTask = (TDB *)GlobalLock16( pdb->task );
thdb = pTask->thdb;
/* we don't need the handles for now */
CloseHandle( info.hThread );
CloseHandle( info.hProcess );
}
process = thdb->process; hInstance = NE_CreateInstance( pModule, NULL, FALSE );
process = PROCESS_Create( pModule, cmd_line, env,
hInstance, 0, startup, info );
pTask = (TDB *)GlobalLock16( process->task );
wm=(WINE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,sizeof(*wm)); wm=(WINE_MODREF*)HeapAlloc(process->heap,HEAP_ZERO_MEMORY,sizeof(*wm));
wm->type = MODULE32_PE; wm->type = MODULE32_PE;
...@@ -878,8 +871,10 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line, ...@@ -878,8 +871,10 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line,
return 0; return 0;
} }
pModule->module32 = wm->module; pModule->module32 = wm->module;
/* FIXME: Yuck. Is there no other good place to do that? */ /* FIXME: Yuck. Is there no other good place to do that? */
PE_InitTls( thdb ); PE_InitTls( pTask->thdb );
return hInstance; return hInstance;
} }
...@@ -916,7 +911,7 @@ static void PE_InitDLL(WINE_MODREF *wm, DWORD type,LPVOID lpReserved) ...@@ -916,7 +911,7 @@ static void PE_InitDLL(WINE_MODREF *wm, DWORD type,LPVOID lpReserved)
if ((PE_HEADER(wm->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) && if ((PE_HEADER(wm->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
(PE_HEADER(wm->module)->OptionalHeader.AddressOfEntryPoint) (PE_HEADER(wm->module)->OptionalHeader.AddressOfEntryPoint)
) { ) {
FARPROC32 entry = (FARPROC32)RVA_PTR( wm->module, DWORD (CALLBACK *entry)(HMODULE32,DWORD,LPVOID) = (void*)RVA_PTR( wm->module,
OptionalHeader.AddressOfEntryPoint ); OptionalHeader.AddressOfEntryPoint );
TRACE(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n", TRACE(relay, "CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
entry, wm->module, type, lpReserved ); entry, wm->module, type, lpReserved );
......
...@@ -66,7 +66,7 @@ HANDLE32 WINAPI FindResourceEx32A( HMODULE32 hModule, LPCSTR name, LPCSTR type, ...@@ -66,7 +66,7 @@ HANDLE32 WINAPI FindResourceEx32A( HMODULE32 hModule, LPCSTR name, LPCSTR type,
*/ */
HRSRC32 WINAPI FindResourceEx32W( HMODULE32 hModule, LPCWSTR name, HRSRC32 WINAPI FindResourceEx32W( HMODULE32 hModule, LPCWSTR name,
LPCWSTR type, WORD lang ) LPCWSTR type, WORD lang )
{ { HRSRC32 ret;
WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule); WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule);
HRSRC32 hrsrc; HRSRC32 hrsrc;
...@@ -83,7 +83,10 @@ HRSRC32 WINAPI FindResourceEx32W( HMODULE32 hModule, LPCWSTR name, ...@@ -83,7 +83,10 @@ HRSRC32 WINAPI FindResourceEx32W( HMODULE32 hModule, LPCWSTR name,
if (wm) { if (wm) {
switch (wm->type) { switch (wm->type) {
case MODULE32_PE: case MODULE32_PE:
return PE_FindResourceEx32W(wm,name,type,lang); ret = PE_FindResourceEx32W(wm,name,type,lang);
if ( ret==0 )
ERR(resource,"%s not found!\n",debugres_w (name));
return ret;
default: default:
ERR(module,"unknown module type %d\n",wm->type); ERR(module,"unknown module type %d\n",wm->type);
break; break;
...@@ -229,6 +232,7 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName) ...@@ -229,6 +232,7 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName)
{ {
HRSRC32 hRsrc; HRSRC32 hRsrc;
HACCEL32 hRetval; HACCEL32 hRetval;
DWORD size;
if (HIWORD(lpTableName)) if (HIWORD(lpTableName))
TRACE(accel, "%p '%s'\n", TRACE(accel, "%p '%s'\n",
...@@ -244,6 +248,13 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName) ...@@ -244,6 +248,13 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName)
} }
else { else {
hRetval = LoadResource32( instance, hRsrc ); hRetval = LoadResource32( instance, hRsrc );
size = SizeofResource32( instance, hRsrc );
if(size>=sizeof(ACCEL32))
{
LPACCEL32 accel_table = (LPACCEL32) hRetval;
/* mark last element as such - sometimes it is not marked in image */
accel_table[size/sizeof(ACCEL32)-1].fVirt |= 0x80;
}
} }
TRACE(accel, "returning HACCEL 0x%x\n", hRsrc); TRACE(accel, "returning HACCEL 0x%x\n", hRsrc);
......
...@@ -34,9 +34,6 @@ ...@@ -34,9 +34,6 @@
#include "sig_context.h" #include "sig_context.h"
#include "winsock.h" #include "winsock.h"
/* Global variable to save %fs register while in 16-bit code */
WORD CALLTO16_Current_fs;
/* Linux sigaction function */ /* Linux sigaction function */
#if defined(linux) && defined(__i386__) #if defined(linux) && defined(__i386__)
......
...@@ -25,7 +25,6 @@ C_SRCS = \ ...@@ -25,7 +25,6 @@ C_SRCS = \
printdrv.c \ printdrv.c \
registry.c \ registry.c \
shell.c \ shell.c \
shellord.c \
sound.c \ sound.c \
spy.c \ spy.c \
stress.c \ stress.c \
......
...@@ -73,7 +73,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn ) ...@@ -73,7 +73,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
if (lpofn->Flags & OFN_WINE32) { if (lpofn->Flags & OFN_WINE32) {
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE)
{ {
if (!(template = LockResource32( lpofn->hInstance ))) if (!(template = LockResource32( MapHModuleSL(lpofn->hInstance ))))
{ {
CommDlgLastError = CDERR_LOADRESFAILURE; CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE; return FALSE;
...@@ -81,13 +81,14 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn ) ...@@ -81,13 +81,14 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
} }
else if (lpofn->Flags & OFN_ENABLETEMPLATE) else if (lpofn->Flags & OFN_ENABLETEMPLATE)
{ {
if (!(hResInfo = FindResource32A(lpofn->hInstance, if (!(hResInfo = FindResource32A(MapHModuleSL(lpofn->hInstance),
PTR_SEG_TO_LIN(lpofn->lpTemplateName), RT_DIALOG32A))) PTR_SEG_TO_LIN(lpofn->lpTemplateName), RT_DIALOG32A)))
{ {
CommDlgLastError = CDERR_FINDRESFAILURE; CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE; return FALSE;
} }
if (!(hDlgTmpl = LoadResource32( lpofn->hInstance, hResInfo )) || if (!(hDlgTmpl = LoadResource32( MapHModuleSL(lpofn->hInstance),
hResInfo )) ||
!(template = LockResource32( hDlgTmpl ))) !(template = LockResource32( hDlgTmpl )))
{ {
CommDlgLastError = CDERR_LOADRESFAILURE; CommDlgLastError = CDERR_LOADRESFAILURE;
...@@ -198,7 +199,7 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn) ...@@ -198,7 +199,7 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
if (lpofn->Flags & OFN_WINE32) { if (lpofn->Flags & OFN_WINE32) {
if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE)
{ {
if (!(template = LockResource32( lpofn->hInstance ))) if (!(template = LockResource32( MapHModuleSL(lpofn->hInstance ))))
{ {
CommDlgLastError = CDERR_LOADRESFAILURE; CommDlgLastError = CDERR_LOADRESFAILURE;
return FALSE; return FALSE;
...@@ -207,14 +208,15 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn) ...@@ -207,14 +208,15 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
else if (lpofn->Flags & OFN_ENABLETEMPLATE) else if (lpofn->Flags & OFN_ENABLETEMPLATE)
{ {
HANDLE32 hResInfo; HANDLE32 hResInfo;
if (!(hResInfo = FindResource32A(lpofn->hInstance, if (!(hResInfo = FindResource32A(MapHModuleSL(lpofn->hInstance),
PTR_SEG_TO_LIN(lpofn->lpTemplateName), PTR_SEG_TO_LIN(lpofn->lpTemplateName),
RT_DIALOG32A))) RT_DIALOG32A)))
{ {
CommDlgLastError = CDERR_FINDRESFAILURE; CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE; return FALSE;
} }
if (!(hDlgTmpl = LoadResource32(lpofn->hInstance,hResInfo)) || if (!(hDlgTmpl = LoadResource32(MapHModuleSL(lpofn->hInstance),
hResInfo)) ||
!(template = LockResource32(hDlgTmpl))) !(template = LockResource32(hDlgTmpl)))
{ {
CommDlgLastError = CDERR_LOADRESFAILURE; CommDlgLastError = CDERR_LOADRESFAILURE;
...@@ -3646,8 +3648,7 @@ static BOOL32 Commdlg_GetFileName32A( BOOL16 (CALLBACK *dofunction)(SEGPTR x), ...@@ -3646,8 +3648,7 @@ static BOOL32 Commdlg_GetFileName32A( BOOL16 (CALLBACK *dofunction)(SEGPTR x),
memset(ofn16,'\0',sizeof(*ofn16)); memset(ofn16,'\0',sizeof(*ofn16));
ofn16->lStructSize = sizeof(*ofn16); ofn16->lStructSize = sizeof(*ofn16);
ofn16->hwndOwner = ofn->hwndOwner; ofn16->hwndOwner = ofn->hwndOwner;
/* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */ ofn16->hInstance = MapHModuleLS(ofn->hInstance);
ofn16->hInstance = 0;
if (ofn->lpstrFilter) { if (ofn->lpstrFilter) {
LPSTR s,x; LPSTR s,x;
...@@ -3736,8 +3737,7 @@ static BOOL32 Commdlg_GetFileName32W( BOOL16 (CALLBACK *dofunction)(SEGPTR x), ...@@ -3736,8 +3737,7 @@ static BOOL32 Commdlg_GetFileName32W( BOOL16 (CALLBACK *dofunction)(SEGPTR x),
memset(ofn16,'\0',sizeof(*ofn16)); memset(ofn16,'\0',sizeof(*ofn16));
ofn16->lStructSize = sizeof(*ofn16); ofn16->lStructSize = sizeof(*ofn16);
ofn16->hwndOwner = ofn->hwndOwner; ofn16->hwndOwner = ofn->hwndOwner;
/* FIXME: OPENFILENAME16 got only 16 bit for HINSTANCE... */ ofn16->hInstance = MapHModuleLS(ofn->hInstance);
ofn16->hInstance = 0;
if (ofn->lpstrFilter) { if (ofn->lpstrFilter) {
LPWSTR s; LPWSTR s;
LPSTR x,y; LPSTR x,y;
...@@ -3881,7 +3881,7 @@ BOOL32 WINAPI ChooseColor32A(LPCHOOSECOLOR32A lpChCol ) ...@@ -3881,7 +3881,7 @@ BOOL32 WINAPI ChooseColor32A(LPCHOOSECOLOR32A lpChCol )
memset(lpcc16,'\0',sizeof(*lpcc16)); memset(lpcc16,'\0',sizeof(*lpcc16));
lpcc16->lStructSize=sizeof(*lpcc16); lpcc16->lStructSize=sizeof(*lpcc16);
lpcc16->hwndOwner=lpChCol->hwndOwner; lpcc16->hwndOwner=lpChCol->hwndOwner;
lpcc16->hInstance=0; /* FIXME:MODULE_HANDLEtoHMODULE16(lpChCol->hInstance)*/ lpcc16->hInstance=MapHModuleLS(lpChCol->hInstance);
lpcc16->rgbResult=lpChCol->rgbResult; lpcc16->rgbResult=lpChCol->rgbResult;
memcpy(ccref,lpChCol->lpCustColors,64); memcpy(ccref,lpChCol->lpCustColors,64);
lpcc16->lpCustColors=(COLORREF*)SEGPTR_GET(ccref); lpcc16->lpCustColors=(COLORREF*)SEGPTR_GET(ccref);
...@@ -3915,7 +3915,7 @@ BOOL32 WINAPI ChooseColor32W(LPCHOOSECOLOR32W lpChCol ) ...@@ -3915,7 +3915,7 @@ BOOL32 WINAPI ChooseColor32W(LPCHOOSECOLOR32W lpChCol )
memset(lpcc16,'\0',sizeof(*lpcc16)); memset(lpcc16,'\0',sizeof(*lpcc16));
lpcc16->lStructSize=sizeof(*lpcc16); lpcc16->lStructSize=sizeof(*lpcc16);
lpcc16->hwndOwner=lpChCol->hwndOwner; lpcc16->hwndOwner=lpChCol->hwndOwner;
lpcc16->hInstance=0; /*FIXME:MODULE_HANDLEtoHMODULE16(lpChCol->hInstance)*/ lpcc16->hInstance=MapHModuleLS(lpChCol->hInstance);
lpcc16->rgbResult=lpChCol->rgbResult; lpcc16->rgbResult=lpChCol->rgbResult;
memcpy(ccref,lpChCol->lpCustColors,64); memcpy(ccref,lpChCol->lpCustColors,64);
lpcc16->lpCustColors=(COLORREF*)SEGPTR_GET(ccref); lpcc16->lpCustColors=(COLORREF*)SEGPTR_GET(ccref);
......
...@@ -556,7 +556,7 @@ ImageList_Create (INT32 cx, INT32 cy, UINT32 flags, ...@@ -556,7 +556,7 @@ ImageList_Create (INT32 cx, INT32 cy, UINT32 flags,
himl->clrBk = CLR_NONE; himl->clrBk = CLR_NONE;
/* initialize overlay mask indices */ /* initialize overlay mask indices */
for (nCount = 0; nCount <= MAX_OVERLAYIMAGE; nCount++) for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1; himl->nOvlIdx[nCount] = -1;
hdc = CreateCompatibleDC32 (0); hdc = CreateCompatibleDC32 (0);
...@@ -1691,7 +1691,7 @@ ImageList_Remove (HIMAGELIST himl, INT32 i) ...@@ -1691,7 +1691,7 @@ ImageList_Remove (HIMAGELIST himl, INT32 i)
himl->cMaxImage = himl->cInitial + himl->cGrow; himl->cMaxImage = himl->cInitial + himl->cGrow;
himl->cCurImage = 0; himl->cCurImage = 0;
for (nCount = 0; nCount <= MAX_OVERLAYIMAGE; nCount++) for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
himl->nOvlIdx[nCount] = -1; himl->nOvlIdx[nCount] = -1;
DeleteObject32 (himl->hbmImage); DeleteObject32 (himl->hbmImage);
...@@ -1921,10 +1921,10 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT32 i, HICON32 hIcon) ...@@ -1921,10 +1921,10 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT32 i, HICON32 hIcon)
if (hdcImage) if (hdcImage)
DeleteDC32 (hdcImage); DeleteDC32 (hdcImage);
// FIXME (imagelist, "deleting hbmColor!\n"); if (ii.hbmColor)
DeleteObject32 (ii.hbmColor); DeleteObject32 (ii.hbmColor);
// FIXME (imagelist, "deleted hbmColor!\n"); if (ii.hbmMask)
DeleteObject32 (ii.hbmMask); DeleteObject32 (ii.hbmMask);
return (nIndex); return (nIndex);
} }
......
...@@ -668,6 +668,7 @@ DWORD WINAPI FormatMessage32A( ...@@ -668,6 +668,7 @@ DWORD WINAPI FormatMessage32A(
if (nSize && talloced<nSize) { if (nSize && talloced<nSize) {
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize); target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
} }
TRACE(resource,"-- %s\n",target);
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) { if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
/* nSize is the MINIMUM size */ /* nSize is the MINIMUM size */
*((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc32(GMEM_ZEROINIT,talloced); *((LPVOID*)lpBuffer) = (LPVOID)LocalAlloc32(GMEM_ZEROINIT,talloced);
......
...@@ -137,7 +137,7 @@ INT32 WINAPI LZStart32(void) ...@@ -137,7 +137,7 @@ INT32 WINAPI LZStart32(void)
*/ */
HFILE16 WINAPI LZInit16( HFILE16 hfSrc ) HFILE16 WINAPI LZInit16( HFILE16 hfSrc )
{ {
return LZInit32( hfSrc ); return LZInit32( HFILE16_TO_HFILE32(hfSrc) );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment