Release 980809

Sat Aug  8 19:11:46 1998  Marcus Meissner <marcus@jet.franken.de>

 	* [*/*]
	Added some missing WINAPI and some missing prototypes for
	functions.

	* [controls/static.c]
	Got rid of the MODULE32_LookupHMODULE error showing up for every
	message box.

	* [windows/winproc.c]
	WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called).

	* [misc/winsock.c]
	hostent/servent/protoent should not use the same static buffers.
	(has broken nt3.15 finger.exe which does hp=gethostbyname(), then
	getservbyname("finger","tcp") and the references hp->h_addr_list[0]).

Sat Aug  8 13:21:24 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [include/server.h] [tools/make_requests] [server/request.c]
	  [server/trace.c]
	Automated part of the client/server request code generation.
	Added tracing of client/server communication.

	* [scheduler/*.c] [server/process.c]
	Added support for server-side handles.

	* [scheduler/thread.c]
	Added DLL_THREAD_ATTACH/DETACH notifications.

	* [configure.in]
	Added check for -lsocket.

	* [windows/winproc.c]
	Return the thunk address in WINPROC_GetProc if the function types
	don't match.

Sat Aug  8 02:44:04 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [windows/winproc.c][windows/win.c][windows/message.c]  
	Documentation for CallWindowProc, SetWindowLong, DispatchMessage,
	WaitMessage, GetMessage, and PeekMessage.

Sat Aug  8 01:00:00 1998  Juergen Schmied <juergen.schmied@metronet.de>

	* [controls/commctrl.c][controls/widgets.c][include/builtin32.h]
	  [include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec]
	  [tools/build.c] [relay32/shell32.spec]
	Added the functionality of the LibMain function. The common 
	controls are properly initialized now.

	* [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c]
	  [windows/msgbox.c][windows/win.c]
	Put TRACE in, put SetLastError() in.

	* [include/interfaces.h]
	Added IClassFactory::LockServer.

	* [include/ole2.h]
	Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32.

	* [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c]
	Reorganized and many structs and classes (IShellBrowser,IShellView)
	added. shell32.dll should work in many cases now.
	Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A.
	New Shell32LibMain started ShellIconCache Implementation.

	* [misc/shellord.c]
	Rewrote ILCombine, ILGetSize
	New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx,
	SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries.

	* [include/winerror.h]
	Class and window related error codes added.

	* [memory/heap.c]
	Changed lstrlen32A to strlen to get rid of milions of TRACE lines.

	* [misc/ddeml.c]
	First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32.

	* [misc/network.c][relay32/mpr.spec]
	Fixed some bugs, changed ordinals.

	* [windows/class.c]
	Workarounds for incorrect hInstance handling. Fixes parts of
	MSWord95/Excel95 and Money95.

Thu Aug  6 21:05:35 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [windows/nonclient.c][misc/tweak.c][include/tweak.h]
	  [documentation/win95look]
	Removed some tweak variables. They are no longer needed.

	* [files/dos_fs.c]
	Added check for null pointer in DOSFS_GetDevice().

	* [controls/tooltips.c][include/commctrl.h]
	Improved tooltips.

	* [controls/status.c][include/commctrl.h]
	Cleaned up code and added tooltip support.

	* [controls/toolbar.c][include/commctrl.h]
	Added tooltip support.

	* [documentation/common_controls]
	Updated.

Thu Aug  6 00:05:22 1998  Uwe Bonnes  <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [include/ver.h] [misc/ver.c]
	Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL.

	* [debugger/hash.c] [debugger/stabs.c]
	Make debug output more friendly for posting.

	* [files/file.c]
	Partial implementation of OF_SHARE_EXCLUSIVE.
	Needed for Quicklogic/QuickChip (InstallShield).

	* [files/profile.c]
	When a cached-only entry is found, return it.

	* [graphics/x11drv/xfont.c]
	Accept a space as delimiter for a fontname and inhibit overrun
	(Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed).

	* [miscemu/main.c]
	Delay setting IF1632_CallLargeStack after loading the executables.
	Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when
 	showing the Blinker error Message Box.

	* [misc/network.c]
	Make WNetGetConnection16 recognise a CDROM as a local drive.

	* [multimedia/mmsystem.c]
	Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME.


Tue Aug 4 21:15:23 1998  James Juran <jrj120@psu.edu>

	* [ole/ole2nls.c]
	Fixed bug in CompareString32A.  strcmp() doesn't necessarily
	return -1, 0, or 1, which the previous code depended on.
	Changed name of is_punctuation to OLE2NLS_isPunctuation.
	Made NORM_IGNOREWIDTH not print a FIXME message in 
	LCMapString32A.
	Other debugging messages, documentation, and code cleanups.

	* [objects/font.c] [relay32/gdi32.spec] [include/winerror.h]
	Added stub for GetFontData32, and added GDI_ERROR constant 
	to winerror.h.

Tue Aug  4 07:44:43 1998  Ove Kaaven <ovek@arcticnet.no>

	* [multimedia/mmio.c]
	Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and
	mmioCreateChunk to the best of my knowledge. But watch out,
	there's bound to be bugs in there...

	* [include/mmsystem.h] [multimedia/mmsystem.c]
	Hacked in support for 32-bit multimedia function callbacks.

	* [AUTHORS] [misc/shell.c]
	Selfishly credited my authorship. Hopefully I'm excused.

	* [include/dosexe.h] [include/module.h] [loader/dos/*]
	  [loader/module.c] [loader/task.c] [Makefile.in]
	  [configure.in] [Makefile.in]
	Added DOS EXE (MZ) loader and virtual machine. Task
	structure integration thanks to Ulrich Weigand.

	* [files/dos_fs.c]
	Work around a null pointer dereference if ioctlGetDeviceInfo-ing
	a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd).

	* [include/miscemu.h] [include/winnt.h] [loader/main.c]
	  [memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c]
	Added support for DOS memory images, and added
	DOSMEM_ResizeBlock() and DOSMEM_Available().

	* [msdos/int21.c]
	Added support for the DOS virtual machine, tweaked handle
	assignment to avoid stdio clashes, forced INT21_FindNext to exit
	wildcardless searches after finding one entry, added AH=7, 8, 9,
	C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the
	long filename calls only respond if running with with -winver
	win95.

	* [objects/cursoricon.c]
	DestroyCursor32 and DestroyIcon32 should now free the objects
	(hopefully) correctly.

Sun Aug  2 21:42:09 1998  Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>

	* [graphics/psdrv/*] [include/psdrv.h]
	Added PPD file parsing - at the moment it reads a file called
	default.ppd from the directory in which you start Wine. Page sizes
	other than A4 should now work (landscape may not). All fonts that are
	present on your printer (according to the PPD) should be available,
	providing you have the AFM files. Fonts should now be the correct size.
	Graphics is still basically lines only. See graphics/psdrv/README .

	* [misc/printdrv.c]
	Yet more Drv[Get/Set]PrinterData fixes.

Fri Jul 31 21:33:22 1998  Per Lindstrm <pelinstr@algonet.se>

	* [relay32/crtdll.spec] [misc/crtdll.c]
	Added stub for freopen, _findfirst, _findnext, _fstat and _read.

	* [files/directory.c]
	Modified warning message.

Wed Jul 29 11:25:28 1998  Luiz Otavio L. Zorzella  <zorzella@nr.conexware.com>

	* [objects/font.c]
	Added stub for GetFontData.

	* [multimedia/msvideo.c]
	Created this file to hold the msvideo.dll calls (and maybe also
	msvfw32.dll). 

	* [objects/cursoricon.c]
	Added search in Global Heap for cursor when trying to destroy it
	with DestroyCursor16. This test should be done in many (all?)
	other functions that use FreeResource.

	* [controls/treeview.c] [include/commctrl.h]
	Minor correction in name and addition of many placeholders for TVM
	messages in TREEVIEW_WindowProc.

	* [msdos/dpmi.c]
	Fixed a bug in DPMI_xrealloc where in a copy of a memory region
	"A" of size "a" to a region "B" of size "b", "b" bytes were being
	copied, instead of "a", as the new version does. This both
	increases speed, as well as avoids segfaults.
This commit is contained in:
Alexandre Julliard 1998-08-09 12:47:43 +00:00
parent 829fe323e4
commit 767e6f6f9d
176 changed files with 10304 additions and 3092 deletions

View File

@ -1,14 +1,16 @@
This is release 980726 of Wine, the MS Windows emulator. This is still a
This is release 980809 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-980726: (see ChangeLog for details)
- Still more common controls stuff.
- More DirectDraw support.
- Compilation problems should be gone.
WHAT'S NEW with Wine-980809: (see ChangeLog for details)
- Preliminary DOS executables support.
- Postscript driver improvements.
- More client/server stuff.
- Better shell32.dll builtin support.
- Proper Win16 mutex locking.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -17,10 +19,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980726.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980726.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980726.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980726.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980809.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980809.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980809.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980809.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

View File

@ -64,6 +64,7 @@ Jon Konrath,
Alex Korobka,
Greg Kreider,
Anand Kumria,
Ove Kåven,
Scott A. Laird,
David Lee Lambert,
Andrew Lewycky,

4
BUGS
View File

@ -73,6 +73,10 @@ Miscellaneous:
* AllocCSToDSAlias() shouldn't alloc alias for the same segment multiple
times.
* Some programs expect that menu window handles stay the same all the time.
(chemdraw). This implies that the menu popupwindows are just hidden, not
destroyed in real Windows.
Where to look in source files:

257
ChangeLog
View File

@ -1,3 +1,260 @@
----------------------------------------------------------------------
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.
Sat Aug 8 19:11:46 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*]
Added some missing WINAPI and some missing prototypes for
functions.
* [controls/static.c]
Got rid of the MODULE32_LookupHMODULE error showing up for every
message box.
* [windows/winproc.c]
WM_NOTIFY 16->32 mapping (AOL Instant Messenger or however it is called).
* [misc/winsock.c]
hostent/servent/protoent should not use the same static buffers.
(has broken nt3.15 finger.exe which does hp=gethostbyname(), then
getservbyname("finger","tcp") and the references hp->h_addr_list[0]).
Sat Aug 8 13:21:24 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/server.h] [tools/make_requests] [server/request.c]
[server/trace.c]
Automated part of the client/server request code generation.
Added tracing of client/server communication.
* [scheduler/*.c] [server/process.c]
Added support for server-side handles.
* [scheduler/thread.c]
Added DLL_THREAD_ATTACH/DETACH notifications.
* [configure.in]
Added check for -lsocket.
* [windows/winproc.c]
Return the thunk address in WINPROC_GetProc if the function types
don't match.
Sat Aug 8 02:44:04 1998 Douglas Ridgway <ridgway@winehq.com>
* [windows/winproc.c][windows/win.c][windows/message.c]
Documentation for CallWindowProc, SetWindowLong, DispatchMessage,
WaitMessage, GetMessage, and PeekMessage.
Sat Aug 8 01:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [controls/commctrl.c][controls/widgets.c][include/builtin32.h]
[include/commctrl.h][relay32/builtin32.c][relay32/comctl32.spec]
[tools/build.c] [relay32/shell32.spec]
Added the functionality of the LibMain function. The common
controls are properly initialized now.
* [controls/treeview.c][memory/atom.c][scheduler/thread.c][windows/class.c]
[windows/msgbox.c][windows/win.c]
Put TRACE in, put SetLastError() in.
* [include/interfaces.h]
Added IClassFactory::LockServer.
* [include/ole2.h]
Added struct for LPOLEMENUGROUPWIDTHS32, HOLEMENU32.
* [include/shell.h][include/shlobj.h][misc/shell.c][ole/folders.c]
Reorganized and many structs and classes (IShellBrowser,IShellView)
added. shell32.dll should work in many cases now.
Started SHGetFileInfoA implementeation, rewrote SHGetPathFromIDList32A.
New Shell32LibMain started ShellIconCache Implementation.
* [misc/shellord.c]
Rewrote ILCombine, ILGetSize
New stubs SHFind_InitMenuPopup, FileMenu_Create, ShellExecuteEx,
SHSetInstanceExplorer, SHGetInstanceExplorer, SHFreeUnusedLibraries.
* [include/winerror.h]
Class and window related error codes added.
* [memory/heap.c]
Changed lstrlen32A to strlen to get rid of milions of TRACE lines.
* [misc/ddeml.c]
First lines for DdeCreateStringHandle32A / DdeFreeStringHandle32.
* [misc/network.c][relay32/mpr.spec]
Fixed some bugs, changed ordinals.
* [windows/class.c]
Workarounds for incorrect hInstance handling. Fixes parts of
MSWord95/Excel95 and Money95.
Thu Aug 6 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [windows/nonclient.c][misc/tweak.c][include/tweak.h]
[documentation/win95look]
Removed some tweak variables. They are no longer needed.
* [files/dos_fs.c]
Added check for null pointer in DOSFS_GetDevice().
* [controls/tooltips.c][include/commctrl.h]
Improved tooltips.
* [controls/status.c][include/commctrl.h]
Cleaned up code and added tooltip support.
* [controls/toolbar.c][include/commctrl.h]
Added tooltip support.
* [documentation/common_controls]
Updated.
Thu Aug 6 00:05:22 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [include/ver.h] [misc/ver.c]
Write VIF_BUFFTOOSMALL, not VIF_BUFTOSMALL.
* [debugger/hash.c] [debugger/stabs.c]
Make debug output more friendly for posting.
* [files/file.c]
Partial implementation of OF_SHARE_EXCLUSIVE.
Needed for Quicklogic/QuickChip (InstallShield).
* [files/profile.c]
When a cached-only entry is found, return it.
* [graphics/x11drv/xfont.c]
Accept a space as delimiter for a fontname and inhibit overrun
(Make xplasim.ex from the Phillips Coolrunner CPLD suite proceed).
* [miscemu/main.c]
Delay setting IF1632_CallLargeStack after loading the executables.
Stops fpgaexp.exe from the Viewlogic FPGA suite from crashing when
showing the Blinker error Message Box.
* [misc/network.c]
Make WNetGetConnection16 recognise a CDROM as a local drive.
* [multimedia/mmsystem.c]
Preliminary check for MCI_ALL_DEVICE_ID in MCI_Close by a FIXME.
Tue Aug 4 21:15:23 1998 James Juran <jrj120@psu.edu>
* [ole/ole2nls.c]
Fixed bug in CompareString32A. strcmp() doesn't necessarily
return -1, 0, or 1, which the previous code depended on.
Changed name of is_punctuation to OLE2NLS_isPunctuation.
Made NORM_IGNOREWIDTH not print a FIXME message in
LCMapString32A.
Other debugging messages, documentation, and code cleanups.
* [objects/font.c] [relay32/gdi32.spec] [include/winerror.h]
Added stub for GetFontData32, and added GDI_ERROR constant
to winerror.h.
Tue Aug 4 07:44:43 1998 Ove Kaaven <ovek@arcticnet.no>
* [multimedia/mmio.c]
Implemented mmioSetBuffer, mmioAdvance, mmioAscend, and
mmioCreateChunk to the best of my knowledge. But watch out,
there's bound to be bugs in there...
* [include/mmsystem.h] [multimedia/mmsystem.c]
Hacked in support for 32-bit multimedia function callbacks.
* [AUTHORS] [misc/shell.c]
Selfishly credited my authorship. Hopefully I'm excused.
* [include/dosexe.h] [include/module.h] [loader/dos/*]
[loader/module.c] [loader/task.c] [Makefile.in]
[configure.in] [Makefile.in]
Added DOS EXE (MZ) loader and virtual machine. Task
structure integration thanks to Ulrich Weigand.
* [files/dos_fs.c]
Work around a null pointer dereference if ioctlGetDeviceInfo-ing
a FILE_DupUnixHandle'd file (i.e. GetStdHandle'd).
* [include/miscemu.h] [include/winnt.h] [loader/main.c]
[memory/global.c] [msdos/dpmi.c] [msdos/dosmem.c]
Added support for DOS memory images, and added
DOSMEM_ResizeBlock() and DOSMEM_Available().
* [msdos/int21.c]
Added support for the DOS virtual machine, tweaked handle
assignment to avoid stdio clashes, forced INT21_FindNext to exit
wildcardless searches after finding one entry, added AH=7, 8, 9,
C, 48, 49, 4A, and 7160 CL=1 (Get Short Filename), and made the
long filename calls only respond if running with with -winver
win95.
* [objects/cursoricon.c]
DestroyCursor32 and DestroyIcon32 should now free the objects
(hopefully) correctly.
Sun Aug 2 21:42:09 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [include/psdrv.h]
Added PPD file parsing - at the moment it reads a file called
default.ppd from the directory in which you start Wine. Page sizes
other than A4 should now work (landscape may not). All fonts that are
present on your printer (according to the PPD) should be available,
providing you have the AFM files. Fonts should now be the correct size.
Graphics is still basically lines only. See graphics/psdrv/README .
* [misc/printdrv.c]
Yet more Drv[Get/Set]PrinterData fixes.
Fri Jul 31 21:33:22 1998 Per Lindström <pelinstr@algonet.se>
* [relay32/crtdll.spec] [misc/crtdll.c]
Added stub for freopen, _findfirst, _findnext, _fstat and _read.
* [files/directory.c]
Modified warning message.
Wed Jul 29 11:25:28 1998 Luiz Otavio L. Zorzella <zorzella@nr.conexware.com>
* [objects/font.c]
Added stub for GetFontData.
* [multimedia/msvideo.c]
Created this file to hold the msvideo.dll calls (and maybe also
msvfw32.dll).
* [objects/cursoricon.c]
Added search in Global Heap for cursor when trying to destroy it
with DestroyCursor16. This test should be done in many (all?)
other functions that use FreeResource.
* [controls/treeview.c] [include/commctrl.h]
Minor correction in name and addition of many placeholders for TVM
messages in TREEVIEW_WindowProc.
* [msdos/dpmi.c]
Fixed a bug in DPMI_xrealloc where in a copy of a memory region
"A" of size "a" to a region "B" of size "b", "b" bytes were being
copied, instead of "a", as the new version does. This both
increases speed, as well as avoids segfaults.
----------------------------------------------------------------------
Sat Jul 25 19:45:45 1998 Juergen Schmied <juergen.schmied@metronet.de>

View File

@ -34,6 +34,7 @@ LIBSUBDIRS = \
library \
loader \
loader/ne \
loader/dos \
memory \
misc \
msdos \
@ -81,6 +82,7 @@ LIBOBJS = \
ipc/ipc.o \
loader/loader.o \
loader/ne/ne.o \
loader/dos/dos.o \
memory/memory.o \
misc/misc.o \
msdos/msdos.o \
@ -131,6 +133,7 @@ install_emu: install_lib
-mkdirhier $(libdir)
$(INSTALL_PROGRAM) wine $(bindir)/wine
$(INSTALL_DATA) wine.sym $(libdir)/wine.sym
$(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
install_lib: install_includes
$(INSTALL_DATA) $(LIB_TARGET) $(libdir)

2
README
View File

@ -15,7 +15,7 @@ To compile the emulator, you must have one of:
Linux version 0.99.13 or above
NetBSD-current
FreeBSD-current or FreeBSD 1.1
FreeBSD-current or FreeBSD 1.1 or later
OpenBSD/i386 2.1 or later
Solaris x86 2.5 or later

97
configure vendored
View File

@ -2457,7 +2457,7 @@ EOF
fi
for ac_func in clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf
for ac_func in clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2464: checking for $ac_func" >&5
@ -2861,15 +2861,66 @@ EOF
if test $ac_cv_func_sendmsg = no; then
echo $ac_n "checking for sendmsg in -lsocket""... $ac_c" 1>&6
echo "configure:2867: checking for sendmsg in -lsocket" >&5
ac_lib_var=`echo socket'_'sendmsg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2875 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char sendmsg();
int main() {
sendmsg()
; return 0; }
EOF
if { (eval echo configure:2886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
LIBS="-lsocket $LIBS"
else
echo "$ac_t""no" 1>&6
fi
fi
if test "$ac_cv_header_sys_vfs_h" = "yes"
then
echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6
echo "configure:2868: checking "whether sys/vfs.h defines statfs"" >&5
echo "configure:2919: checking "whether sys/vfs.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2873 "configure"
#line 2924 "configure"
#include "confdefs.h"
#include <sys/types.h>
@ -2886,7 +2937,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_sys_vfs_has_statfs=yes
else
@ -2913,12 +2964,12 @@ fi
if test "$ac_cv_header_sys_statfs_h" = "yes"
then
echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6
echo "configure:2917: checking "whether sys/statfs.h defines statfs"" >&5
echo "configure:2968: checking "whether sys/statfs.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2922 "configure"
#line 2973 "configure"
#include "confdefs.h"
#include <sys/types.h>
@ -2933,7 +2984,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_sys_statfs_has_statfs=yes
else
@ -2960,12 +3011,12 @@ fi
if test "$ac_cv_header_sys_mount_h" = "yes"
then
echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6
echo "configure:2964: checking "whether sys/mount.h defines statfs"" >&5
echo "configure:3015: checking "whether sys/mount.h defines statfs"" >&5
if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2969 "configure"
#line 3020 "configure"
#include "confdefs.h"
#include <sys/types.h>
@ -2980,7 +3031,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_sys_mount_has_statfs=yes
else
@ -3006,7 +3057,7 @@ fi
echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
echo "configure:3010: checking "for statfs.f_bfree"" >&5
echo "configure:3061: checking "for statfs.f_bfree"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -3015,7 +3066,7 @@ else
wine_cv_statfs_bfree=no
else
cat > conftest.$ac_ext <<EOF
#line 3019 "configure"
#line 3070 "configure"
#include "confdefs.h"
#include <sys/types.h>
@ -3042,7 +3093,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:3046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bfree=yes
else
@ -3066,7 +3117,7 @@ EOF
fi
echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6
echo "configure:3070: checking "for statfs.f_bavail"" >&5
echo "configure:3121: checking "for statfs.f_bavail"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -3075,7 +3126,7 @@ else
wine_cv_statfs_bavail=no
else
cat > conftest.$ac_ext <<EOF
#line 3079 "configure"
#line 3130 "configure"
#include "confdefs.h"
#include <sys/types.h>
@ -3102,7 +3153,7 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:3106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bavail=yes
else
@ -3127,7 +3178,7 @@ fi
echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6
echo "configure:3131: checking "for working sigaltstack"" >&5
echo "configure:3182: checking "for working sigaltstack"" >&5
if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -3136,7 +3187,7 @@ else
else
cat > conftest.$ac_ext <<EOF
#line 3140 "configure"
#line 3191 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -3174,7 +3225,7 @@ else
}
EOF
if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:3229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_working_sigaltstack="yes"
else
@ -3201,12 +3252,12 @@ fi
echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6
echo "configure:3205: checking "for msg_accrights in struct msghdr"" >&5
echo "configure:3256: checking "for msg_accrights in struct msghdr"" >&5
if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3210 "configure"
#line 3261 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -3214,7 +3265,7 @@ int main() {
struct msghdr hdr; hdr.msg_accrights=0
; return 0; }
EOF
if { (eval echo configure:3218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_msg_accrights="yes"
else
@ -3358,6 +3409,7 @@ library/Makefile
libtest/Makefile
loader/Makefile
loader/ne/Makefile
loader/dos/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile
@ -3492,6 +3544,7 @@ library/Makefile
libtest/Makefile
loader/Makefile
loader/ne/Makefile
loader/dos/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile

View File

@ -240,13 +240,19 @@ fi
dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
AC_CHECK_FUNCS(clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf)
AC_CHECK_HEADERS(wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h sys/statfs.h float.h linux/cdrom.h linux/ucdrom.h sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h)
AC_HEADER_STAT()
AC_C_CONST()
AC_TYPE_SIZE_T()
AC_CHECK_SIZEOF(long long,0)
dnl **** Check for sendmsg in -lsocket if not found above ****
if test $ac_cv_func_sendmsg = no; then
AC_CHECK_LIB(socket,sendmsg)
fi
dnl **** statfs checks ****
if test "$ac_cv_header_sys_vfs_h" = "yes"
@ -467,6 +473,7 @@ library/Makefile
libtest/Makefile
loader/Makefile
loader/ne/Makefile
loader/dos/Makefile
memory/Makefile
misc/Makefile
miscemu/Makefile

View File

@ -42,9 +42,6 @@ typedef struct _DPA_DATA
} DPA_DATA, *LPDPA_DATA;
DWORD WINAPI DSA_Create (DWORD, DWORD);
DWORD WINAPI DPA_Create (DWORD);
DWORD WINAPI DPA_GetPtr (DWORD, DWORD);
DWORD WINAPI DPA_InsertPtr (DWORD, DWORD, DWORD);
@ -255,24 +252,24 @@ DSA_GetItemPtr (DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI
DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, LPSTR lpString)
{
LPDSA_DATA dsaPtr = (LPDSA_DATA)dwParam1;
DWORD dwIndex;
INT32 len;
TRACE (commctrl, "(0x%08lx 0x%08lx \"%s\"):semi-stub!\n",
dwParam1, dwParam2, (LPSTR)dwParam3);
dwParam1, dwParam2, lpString);
if (dsaPtr->ptrs == NULL) {
dsaPtr->ptrs = (LPSTR*)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
dsaPtr->dwInitial * sizeof(LPVOID));
dsaPtr->dwMaxCount = dsaPtr->dwInitial;
dwIndex = 0;
len = lstrlen32A ((LPSTR)dwParam3);
len = lstrlen32A (lpString);
dsaPtr->ptrs[dwIndex] =
(LPSTR)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (dsaPtr->ptrs[dwIndex], (LPSTR)dwParam3);
lstrcpy32A (dsaPtr->ptrs[dwIndex], lpString);
}
else {
TRACE (commctrl, "(0x%08lx 0x%08lx)\n",
@ -280,10 +277,10 @@ DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
if (dwParam2 >= dsaPtr->dwEntryCount) {
if (dsaPtr->dwEntryCount < dsaPtr->dwMaxCount) {
dwIndex = dsaPtr->dwEntryCount;
len = lstrlen32A ((LPSTR)dwParam3);
len = lstrlen32A (lpString);
dsaPtr->ptrs[dwIndex] =
(LPSTR)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (dsaPtr->ptrs[dwIndex], (LPSTR)dwParam3);
lstrcpy32A (dsaPtr->ptrs[dwIndex], lpString);
}
else {
/* allocate new pointer list and copy all pointers */
@ -298,10 +295,10 @@ DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
/* add new string */
dwIndex = dsaPtr->dwEntryCount;
len = lstrlen32A ((LPSTR)dwParam3);
len = lstrlen32A (lpString);
dsaPtr->ptrs[dwIndex] =
(LPSTR)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (dsaPtr->ptrs[dwIndex], (LPSTR)dwParam3);
lstrcpy32A (dsaPtr->ptrs[dwIndex], lpString);
}
}
else {

View File

@ -22,7 +22,18 @@
#include "updown.h"
#include "debug.h"
/***********************************************************************
* ComCtl32LibMain
*/
BOOL32 WINAPI ComCtl32LibMain (HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ TRACE(commctrl,"%x,%lx,%p\n",hinstDLL,fdwReason,lpvReserved);
if ( fdwReason == DLL_PROCESS_ATTACH)
{ InitCommonControls();
}
return TRUE;
}
/***********************************************************************
* DrawStatusText32A [COMCTL32.5][COMCTL32.27]
*
@ -157,6 +168,8 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
INT32 cCount;
DWORD dwMask;
TRACE(commctrl,"\n");
if (lpInitCtrls == NULL) return FALSE;
if (lpInitCtrls->dwSize < sizeof(INITCOMMONCONTROLSEX)) return FALSE;
@ -544,4 +557,3 @@ ShowHideMenuCtl (HWND32 hwnd, UINT32 uFlags, LPINT32 lpInfo)
return FALSE;
}

View File

@ -115,18 +115,22 @@ static HICON16 STATIC_LoadIcon( WND *wndPtr, LPCSTR name )
if (wndPtr->flags & WIN_ISWIN32)
{
hicon = LoadIcon32A( wndPtr->hInstance, name );
if (!hicon) /* Try OEM icon (FIXME: is this right?) */
hicon = LoadIcon32A( 0, name );
}
else
{
if (!HIWORD(wndPtr->hInstance)) {
LPSTR segname = SEGPTR_STRDUP(name);
hicon = LoadIcon16( wndPtr->hInstance, SEGPTR_GET(segname) );
SEGPTR_FREE(segname);
} else
hicon = LoadIcon32A( wndPtr->hInstance, name );
} else {
LPSTR segname = SEGPTR_STRDUP(name);
if (HIWORD(wndPtr->hInstance))
FIXME(static,"win16 window class, but win32 hinstance??\n");
hicon = LoadIcon16( wndPtr->hInstance, SEGPTR_GET(segname) );
if (!hicon) /* Try OEM icon (FIXME: is this right?) */
hicon = LoadIcon32A( 0, segname );
SEGPTR_FREE(segname);
}
if (!hicon)
hicon = LoadIcon32A( 0, name );
return hicon;
}

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
* - Notifications.
* - Fix TB_GETBITMAPFLAGS.
* - Fix TB_GETROWS and TB_SETROWS.
* - Tooltip support (partially).
* - Tooltip support (under contruction).
* - Unicode suppport.
* - Internal COMMCTL32 bitmaps.
* - Fix TOOLBAR_Customize. (Customize dialog.)
@ -249,8 +249,6 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
BOOL32 bVertical;
SIZE32 sizeString;
/* test */
TOOLBAR_CalcStrings (wndPtr, &sizeString);
if (sizeString.cy > 0)
@ -301,6 +299,18 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
btnPtr->rect.right = x + cx;
btnPtr->rect.bottom = y + cy;
if (infoPtr->hwndToolTip) {
TTTOOLINFO32A ti;
ZeroMemory (&ti, sizeof(TTTOOLINFO32A));
ti.cbSize = sizeof(TTTOOLINFO32A);
ti.hwnd = wndPtr->hwndSelf;
ti.uId = btnPtr->idCommand;
ti.rect = btnPtr->rect;
SendMessage32A (infoPtr->hwndToolTip, TTM_NEWTOOLRECT32A,
0, (LPARAM)&ti);
}
if (bVertical) {
x = 0;
y += cy;
@ -411,6 +421,24 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT32 nIndex)
}
static VOID
TOOLBAR_RelayEvent (HWND32 hwndTip, HWND32 hwndMsg, UINT32 uMsg,
WPARAM32 wParam, LPARAM lParam)
{
MSG32 msg;
msg.hwnd = hwndMsg;
msg.message = uMsg;
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = GetMessageTime ();
msg.pt.x = LOWORD(GetMessagePos ());
msg.pt.y = HIWORD(GetMessagePos ());
SendMessage32A (hwndTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);
}
static LRESULT
TOOLBAR_AddBitmap (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
@ -512,6 +540,20 @@ TOOLBAR_AddButtons32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->buttons[nOldButtons+nCount].fsStyle = lpTbb[nCount].fsStyle;
infoPtr->buttons[nOldButtons+nCount].dwData = lpTbb[nCount].dwData;
infoPtr->buttons[nOldButtons+nCount].iString = lpTbb[nCount].iString;
if (infoPtr->hwndToolTip) {
TTTOOLINFO32A ti;
ZeroMemory (&ti, sizeof(TTTOOLINFO32A));
ti.cbSize = sizeof (TTTOOLINFO32A);
ti.hwnd = wndPtr->hwndSelf;
ti.uId = (LPSTR)lpTbb[nCount].idCommand;
ti.hinst = 0;
ti.lpszText = LPSTR_TEXTCALLBACK32A;
SendMessage32A (infoPtr->hwndToolTip, TTM_ADDTOOL32A,
0, (LPARAM)&ti);
}
}
TOOLBAR_CalcToolbar (wndPtr);
@ -636,8 +678,8 @@ TOOLBAR_AutoSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
cy += 2;
infoPtr->bAutoSize = TRUE;
SetWindowPos32 (wndPtr->hwndSelf, 0, parent_rect.left, parent_rect.top,
cx, cy, uPosFlags | SWP_NOZORDER);
SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, parent_rect.left, parent_rect.top,
cx, cy, uPosFlags);
return 0;
}
@ -763,6 +805,17 @@ TOOLBAR_DeleteButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons))
return FALSE;
if (infoPtr->hwndToolTip) {
TTTOOLINFO32A ti;
ZeroMemory (&ti, sizeof(TTTOOLINFO32A));
ti.cbSize = sizeof (TTTOOLINFO32A);
ti.hwnd = wndPtr->hwndSelf;
ti.uId = infoPtr->buttons[nIndex].idCommand;
SendMessage32A (infoPtr->hwndToolTip, TTM_DELTOOL32A, 0, (LPARAM)&ti);
}
if (infoPtr->nNumButtons == 1) {
TRACE (toolbar, " simple delete!\n");
HeapFree (GetProcessHeap (), 0, infoPtr->buttons);
@ -875,7 +928,55 @@ TOOLBAR_GetButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
// << TOOLBAR_GetButtonInfo >>
static LRESULT
TOOLBAR_GetButtonInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
LPTBBUTTONINFO32A lpTbInfo = (LPTBBUTTONINFO32A)lParam;
TBUTTON_INFO *btnPtr;
INT32 nIndex;
if (infoPtr == NULL) return -1;
if (lpTbInfo == NULL) return -1;
if (lpTbInfo->cbSize < sizeof(LPTBBUTTONINFO32A)) return -1;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT32)wParam);
if (nIndex == -1)
return -1;
btnPtr = &infoPtr->buttons[nIndex];
if (lpTbInfo->dwMask & TBIF_COMMAND)
lpTbInfo->idCommand = btnPtr->idCommand;
if (lpTbInfo->dwMask & TBIF_IMAGE)
lpTbInfo->iImage = btnPtr->iBitmap;
if (lpTbInfo->dwMask & TBIF_LPARAM)
lpTbInfo->lParam = btnPtr->dwData;
if (lpTbInfo->dwMask & TBIF_SIZE)
lpTbInfo->cx = (WORD)(btnPtr->rect.right - btnPtr->rect.left);
if (lpTbInfo->dwMask & TBIF_STATE)
lpTbInfo->fsState = btnPtr->fsState;
if (lpTbInfo->dwMask & TBIF_STYLE)
lpTbInfo->fsStyle = btnPtr->fsStyle;
if (lpTbInfo->dwMask & TBIF_TEXT) {
if ((btnPtr->iString >= 0) || (btnPtr->iString < infoPtr->nNumStrings))
lstrcpyn32A (lpTbInfo->pszText,
(LPSTR)infoPtr->strings[btnPtr->iString],
lpTbInfo->cchText);
}
return nIndex;
}
// << TOOLBAR_GetButtonInfo32W >>
static LRESULT
@ -929,7 +1030,13 @@ TOOLBAR_GetDisabledImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
// << TOOLBAR_GetExtendedStyle >>
__inline__ static LRESULT
TOOLBAR_GetExtendedStyle (WND *wndPtr)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
return infoPtr->dwExStyle;
}
static LRESULT
@ -995,7 +1102,7 @@ TOOLBAR_GetMaxSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
LPSIZE32 lpSize = (LPSIZE32)lParam;
FIXME (toolbar, "empty stub!\n");
return TRUE;
}
@ -1155,6 +1262,20 @@ TOOLBAR_InsertButton32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->buttons[nIndex].dwData = lpTbb->dwData;
infoPtr->buttons[nIndex].iString = lpTbb->iString;
if (infoPtr->hwndToolTip) {
TTTOOLINFO32A ti;
ZeroMemory (&ti, sizeof(TTTOOLINFO32A));
ti.cbSize = sizeof (TTTOOLINFO32A);
ti.hwnd = wndPtr->hwndSelf;
ti.uId = lpTbb->idCommand;
ti.hinst = 0;
ti.lpszText = LPSTR_TEXTCALLBACK32A;
SendMessage32A (infoPtr->hwndToolTip, TTM_ADDTOOL32A,
0, (LPARAM)&ti);
}
/* post insert copy */
if (nIndex < infoPtr->nNumButtons - 1) {
memcpy (&infoPtr->buttons[nIndex+1], &oldButtons[nIndex],
@ -1612,10 +1733,25 @@ TOOLBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (wndPtr->dwStyle & TBSTYLE_TOOLTIPS) {
/* Create tooltip control */
// infoPtr->hwndToolTip = CreateWindowEx32A (....);
infoPtr->hwndToolTip =
CreateWindowEx32A (0, TOOLTIPS_CLASS32A, NULL, TTS_ALWAYSTIP,
CW_USEDEFAULT32, CW_USEDEFAULT32,
CW_USEDEFAULT32, CW_USEDEFAULT32,
wndPtr->hwndSelf, 0,
wndPtr->hInstance, 0);
/* Send NM_TOOLTIPSCREATED notification */
if (infoPtr->hwndToolTip) {
NMTOOLTIPSCREATED nmttc;
nmttc.hdr.hwndFrom = wndPtr->hwndSelf;
nmttc.hdr.idFrom = wndPtr->wIDmenu;
nmttc.hdr.code = NM_TOOLTIPSCREATED;
nmttc.hwndToolTips = infoPtr->hwndToolTip;
SendMessage32A (infoPtr->hwndNotify, WM_NOTIFY,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&nmttc);
}
}
return 0;
@ -1724,6 +1860,10 @@ TOOLBAR_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
INT32 nHit;
HDC32 hdc;
if (infoPtr->hwndToolTip)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
WM_LBUTTONDOWN, wParam, lParam);
pt.x = (INT32)LOWORD(lParam);
pt.y = (INT32)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
@ -1761,6 +1901,10 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HDC32 hdc;
BOOL32 bSendMessage = TRUE;
if (infoPtr->hwndToolTip)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
WM_LBUTTONUP, wParam, lParam);
pt.x = (INT32)LOWORD(lParam);
pt.y = (INT32)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
@ -1822,6 +1966,10 @@ TOOLBAR_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
INT32 nHit;
HDC32 hdc;
if (infoPtr->hwndToolTip)
TOOLBAR_RelayEvent (infoPtr->hwndToolTip, wndPtr->hwndSelf,
WM_MOUSEMOVE, wParam, lParam);
pt.x = (INT32)LOWORD(lParam);
pt.y = (INT32)HIWORD(lParam);
nHit = TOOLBAR_InternalHitTest (wndPtr, &pt);
@ -1885,9 +2033,13 @@ TOOLBAR_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
return 0;
}
/* this is just for security (reliable??)*/
/* paranoid!! */
infoPtr->dwStructSize = sizeof(TBBUTTON);
/* fix instance handle, if the toolbar was created by CreateToolbarEx() */
if (!wndPtr->hInstance)
wndPtr->hInstance = wndPtr->parent->hInstance;
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
}
@ -1910,8 +2062,7 @@ TOOLBAR_NCPaint (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
wndPtr->rectClient.top-wndPtr->rectWindow.top,
wndPtr->rectClient.right-wndPtr->rectWindow.left,
wndPtr->rectClient.bottom-wndPtr->rectWindow.top )
== NULLREGION)
{
== NULLREGION){
ReleaseDC32( hwnd, hdc );
return 0;
}
@ -1939,6 +2090,23 @@ TOOLBAR_NCPaint (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
__inline__ static LRESULT
TOOLBAR_Notify (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
LPNMHDR lpnmh = (LPNMHDR)lParam;
if ((infoPtr->hwndToolTip) && ((lpnmh->code == TTN_GETDISPINFO32A) ||
(lpnmh->code == TTN_GETDISPINFO32W))) {
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
wParam, lParam);
}
return 0;
}
static LRESULT
TOOLBAR_Paint (WND *wndPtr, WPARAM32 wParam)
{
@ -2079,7 +2247,10 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case TB_GETBUTTON:
return TOOLBAR_GetButton (wndPtr, wParam, lParam);
// case TB_GETBUTTONINFO: /* 4.71 */
case TB_GETBUTTONINFO32A:
return TOOLBAR_GetButtonInfo32A (wndPtr, wParam, lParam);
// case TB_GETBUTTONINFO32W: /* 4.71 */
case TB_GETBUTTONSIZE:
return TOOLBAR_GetButtonSize (wndPtr);
@ -2093,7 +2264,8 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case TB_GETDISABLEDIMAGELIST:
return TOOLBAR_GetDisabledImageList (wndPtr, wParam, lParam);
// case TB_GETEXTENDEDSTYLE: /* 4.71 */
case TB_GETEXTENDEDSTYLE:
return TOOLBAR_GetExtendedStyle (wndPtr);
case TB_GETHOTIMAGELIST:
return TOOLBAR_GetHotImageList (wndPtr, wParam, lParam);
@ -2185,7 +2357,8 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case TB_SETBITMAPSIZE:
return TOOLBAR_SetBitmapSize (wndPtr, wParam, lParam);
// case TB_SETBUTTONINFO: /* 4.71 */
// case TB_SETBUTTONINFO32A: /* 4.71 */
// case TB_SETBUTTONINFO32W: /* 4.71 */
case TB_SETBUTTONSIZE:
return TOOLBAR_SetButtonSize (wndPtr, wParam, lParam);
@ -2243,15 +2416,23 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
return TOOLBAR_SetUnicodeFormat (wndPtr, wParam, lParam);
// case WM_CHAR:
case WM_CREATE:
return TOOLBAR_Create (wndPtr, wParam, lParam);
// case WM_COMMAND:
case WM_DESTROY:
return TOOLBAR_Destroy (wndPtr, wParam, lParam);
case WM_ERASEBKGND:
return TOOLBAR_EraseBackground (wndPtr, wParam, lParam);
// case WM_GETFONT:
// case WM_KEYDOWN:
// case WM_KILLFOCUS:
case WM_LBUTTONDBLCLK:
return TOOLBAR_LButtonDblClk (wndPtr, wParam, lParam);
@ -2276,8 +2457,10 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_NCPAINT:
return TOOLBAR_NCPaint (wndPtr, wParam, lParam);
// case WM_NOTIFY:
// SendMessage32A (GetParent32 (hwnd), uMsg, wParam, lParam);
case WM_NOTIFY:
return TOOLBAR_Notify (wndPtr, wParam, lParam);
// case WM_NOTIFYFORMAT:
case WM_PAINT:
return TOOLBAR_Paint (wndPtr, wParam);
@ -2306,8 +2489,7 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
}
void
TOOLBAR_Register (void)
void TOOLBAR_Register (void)
{
WNDCLASS32A wndClass;
@ -2324,4 +2506,3 @@ TOOLBAR_Register (void)
RegisterClass32A (&wndClass);
}

View File

@ -4,17 +4,24 @@
* Copyright 1998 Eric Kohl
*
* TODO:
* - Some messages.
* - All notifications.
* - Subclassing.
* - Tracking tooltips (under construction).
* - TTS_ALWAYSTIP (undefined).
* - Unicode support.
* - Custom draw support.
*
* Testing:
* - Run tests using Waite Group Windows95 API Bible Volume 2.
* The second cdrom contains executables enumtools.exe ...
* - additional features.
* The second cdrom (chapter 3) contains executables activate.exe,
* curtool.exe, deltool.exe, enumtools.exe, getinfo.exe, getiptxt.exe,
* hittest.exe, needtext.exe, newrect.exe, updtext.exe and winfrpt.exe.
*
* FIXME:
* - Display code.
* - Missing Unicode support.
* - Activate.exe, deltool.exe, enumtool.exe, getinfo.exe and getiptxt.exe
* are the only working examples, since subclassing is not implemented.
*
* Fixme:
* - The "lParam" variable from NMTTDISPINFO32A is not handled
* in TOOLTIPS_GetTipText.
*/
#include "windows.h"
@ -25,8 +32,9 @@
#include "debug.h"
#define ID_TIMER1 1
#define ID_TIMER2 2
#define ID_TIMER1 1 /* show delay timer */
#define ID_TIMER2 2 /* auto pop timer */
#define ID_TIMER3 3 /* tool leave timer */
#define TOOLTIPS_GetInfoPtr(wndPtr) ((TOOLTIPS_INFO *)wndPtr->wExtra[0])
@ -38,12 +46,21 @@ TOOLTIPS_Refresh (WND *wndPtr, HDC32 hdc)
RECT32 rc;
INT32 oldBkMode;
HFONT32 hOldFont;
UINT32 uFlags = DT_EXTERNALLEADING;
if (infoPtr->nMaxTipWidth > -1)
uFlags |= DT_WORDBREAK;
if (wndPtr->dwStyle & TTS_NOPREFIX)
uFlags |= DT_NOPREFIX;
GetClientRect32 (wndPtr->hwndSelf, &rc);
rc.left += (2 + infoPtr->rcMargin.left);
rc.top += (2 + infoPtr->rcMargin.top);
rc.right -= (2 + infoPtr->rcMargin.right);
rc.bottom -= (2 + infoPtr->rcMargin.bottom);
oldBkMode = SetBkMode32 (hdc, TRANSPARENT);
SetTextColor32 (hdc, infoPtr->clrText);
hOldFont = SelectObject32 (hdc, infoPtr->hFont);
DrawText32A (hdc, infoPtr->szTipText, -1, &rc, DT_EXTERNALLEADING);
DrawText32A (hdc, infoPtr->szTipText, -1, &rc, uFlags);
SelectObject32 (hdc, hOldFont);
if (oldBkMode != TRANSPARENT)
SetBkMode32 (hdc, oldBkMode);
@ -56,28 +73,72 @@ TOOLTIPS_GetTipText (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
TTTOOL_INFO *toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
if (toolPtr->hinst) {
TRACE (tooltips, "get res string %x %x\n",
toolPtr->hinst, (int)toolPtr->lpszText);
LoadString32A (toolPtr->hinst, (UINT32)toolPtr->lpszText,
infoPtr->szTipText, INFOTIPSIZE);
}
else if (toolPtr->lpszText) {
if (toolPtr->lpszText == LPSTR_TEXTCALLBACK32A) {
NMTTDISPINFOA ttnmdi;
NMTTDISPINFO32A ttnmdi;
/* fill NMHDR struct */
ZeroMemory (&ttnmdi, sizeof(NMTTDISPINFO32A));
ttnmdi.hdr.hwndFrom = wndPtr->hwndSelf;
ttnmdi.hdr.idFrom = infoPtr->nCurrentTool;
ttnmdi.hdr.code = TTN_GETDISPINFOA;
ttnmdi.hdr.idFrom = toolPtr->uId;
ttnmdi.hdr.code = TTN_GETDISPINFO32A;
ttnmdi.uFlags = toolPtr->uFlags;
ttnmdi.lpszText = infoPtr->szTipText;
TRACE (tooltips, "hdr.idFrom = %x\n", ttnmdi.hdr.idFrom);
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&ttnmdi);
/* FIXME: partial */
lstrcpyn32A (infoPtr->szTipText, ttnmdi.szText, INFOTIPSIZE);
if (ttnmdi.hinst) {
LoadString32A (ttnmdi.hinst, (UINT32)ttnmdi.szText,
infoPtr->szTipText, INFOTIPSIZE);
if (ttnmdi.uFlags & TTF_DI_SETITEM) {
toolPtr->hinst = ttnmdi.hinst;
toolPtr->lpszText = ttnmdi.szText;
}
}
else if (ttnmdi.szText[0]) {
lstrcpyn32A (infoPtr->szTipText, ttnmdi.szText, 80);
if (ttnmdi.uFlags & TTF_DI_SETITEM) {
INT32 len = lstrlen32A (ttnmdi.szText) + 1;
toolPtr->hinst = 0;
toolPtr->lpszText =
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len);
lstrcpy32A (toolPtr->lpszText, ttnmdi.szText);
}
}
else if (ttnmdi.lpszText == 0) {
/* no text available */
infoPtr->szTipText[0] = '\0';
}
else if (ttnmdi.lpszText != LPSTR_TEXTCALLBACK32A) {
if (ttnmdi.lpszText != infoPtr->szTipText)
lstrcpyn32A (infoPtr->szTipText, ttnmdi.lpszText,
INFOTIPSIZE);
if (ttnmdi.uFlags & TTF_DI_SETITEM) {
INT32 len = lstrlen32A (ttnmdi.lpszText) + 1;
toolPtr->hinst = 0;
toolPtr->lpszText =
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len);
lstrcpy32A (toolPtr->lpszText, ttnmdi.lpszText);
}
}
else
ERR (tooltips, "recursive text callback!\n");
}
else
lstrcpyn32A (infoPtr->szTipText, toolPtr->lpszText, INFOTIPSIZE);
}
else
/* no text available */
infoPtr->szTipText[0] = '\0';
TRACE (tooltips, "\"%s\"\n", infoPtr->szTipText);
}
@ -86,36 +147,94 @@ TOOLTIPS_CalcTipSize (WND *wndPtr, TOOLTIPS_INFO *infoPtr, LPSIZE32 lpSize)
{
HDC32 hdc;
HFONT32 hOldFont;
RECT32 rc;
UINT32 uFlags = DT_EXTERNALLEADING | DT_CALCRECT;
RECT32 rc = {0, 0, 0, 0};
if (infoPtr->nMaxTipWidth > -1) {
rc.right = infoPtr->nMaxTipWidth;
uFlags |= DT_WORDBREAK;
}
if (wndPtr->dwStyle & TTS_NOPREFIX)
uFlags |= DT_NOPREFIX;
TRACE (tooltips, "\"%s\"\n", infoPtr->szTipText);
hdc = GetDC32 (wndPtr->hwndSelf);
hOldFont = SelectObject32 (hdc, infoPtr->hFont);
DrawText32A (hdc, infoPtr->szTipText, -1, &rc, DT_EXTERNALLEADING | DT_CALCRECT);
DrawText32A (hdc, infoPtr->szTipText, -1, &rc, uFlags);
SelectObject32 (hdc, hOldFont);
ReleaseDC32 (hdc, wndPtr->hwndSelf);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
lpSize->cx = rc.right - rc.left + 4;
lpSize->cy = rc.bottom - rc.top + 4;
lpSize->cx = rc.right - rc.left + 4 +
infoPtr->rcMargin.left + infoPtr->rcMargin.right;
lpSize->cy = rc.bottom - rc.top + 4 +
infoPtr->rcMargin.bottom + infoPtr->rcMargin.top;
}
static VOID
TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
POINT32 pt;
SIZE32 size;
NMHDR hdr;
if (infoPtr->nTool == -1) {
TRACE (tooltips, "invalid tool (-1)!\n");
return;
}
infoPtr->nCurrentTool = infoPtr->nTool;
FIXME (tooltips, "Show tooltip %d!\n", infoPtr->nCurrentTool);
GetCursorPos32 (&pt);
TRACE (tooltips, "Show tooltip pre %d!\n", infoPtr->nTool);
TOOLTIPS_GetTipText (wndPtr, infoPtr);
if (infoPtr->szTipText[0] == '\0') {
infoPtr->nCurrentTool = -1;
return;
}
TRACE (tooltips, "Show tooltip %d!\n", infoPtr->nTool);
hdr.hwndFrom = wndPtr->hwndSelf;
hdr.idFrom = infoPtr->nTool;
hdr.code = TTN_SHOW;
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&hdr);
TRACE (tooltips, "\"%s\"\n", infoPtr->szTipText);
toolPtr = &infoPtr->tools[infoPtr->nTool];
TOOLTIPS_CalcTipSize (wndPtr, infoPtr, &size);
TRACE (tooltips, "size %d - %d\n", size.cx, size.cy);
SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, pt.x, pt.y + 20,
if ((toolPtr->uFlags & TTF_TRACK) && (toolPtr->uFlags & TTF_ABSOLUTE)) {
pt.x = infoPtr->xTrackPos;
pt.y = infoPtr->yTrackPos;
}
else if (toolPtr->uFlags & TTF_CENTERTIP) {
RECT32 rect;
if (toolPtr->uFlags & TTF_IDISHWND)
GetWindowRect32 ((HWND32)toolPtr->uId, &rect);
else {
rect = toolPtr->rect;
MapWindowPoints32 (toolPtr->hwnd, (HWND32)0, (LPPOINT32)&rect, 2);
}
pt.x = (rect.left + rect.right - size.cx) / 2;
pt.y = rect.bottom + 2;
}
else {
GetCursorPos32 (&pt);
pt.y += 20;
}
TRACE (tooltips, "pos %d - %d\n", pt.x, pt.y);
// SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, pt.x, pt.y,
// size.cx, size.cy, SWP_SHOWWINDOW);
SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, 1, 1,
size.cx, size.cy, SWP_SHOWWINDOW);
SetTimer32 (wndPtr->hwndSelf, ID_TIMER2, infoPtr->nAutoPopTime, 0);
@ -125,28 +244,63 @@ TOOLTIPS_Show (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
static VOID
TOOLTIPS_Hide (WND *wndPtr, TOOLTIPS_INFO *infoPtr)
{
NMHDR hdr;
if (infoPtr->nCurrentTool == -1)
return;
FIXME (tooltips, "Hide tooltip %d!\n", infoPtr->nCurrentTool);
TRACE (tooltips, "Hide tooltip %d!\n", infoPtr->nCurrentTool);
KillTimer32 (wndPtr->hwndSelf, ID_TIMER2);
hdr.hwndFrom = wndPtr->hwndSelf;
hdr.idFrom = infoPtr->nCurrentTool;
hdr.code = TTN_POP;
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_NOTIFY,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&hdr);
infoPtr->nCurrentTool = -1;
SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0, SWP_HIDEWINDOW);
}
static INT32
TOOLTIPS_GetIndexFromInfoA (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOA lpToolInfo)
TOOLTIPS_GetToolFromInfoA (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFO32A lpToolInfo)
{
TTTOOL_INFO *toolPtr;
INT32 nIndex;
INT32 nTool;
for (nIndex = 0; nIndex < infoPtr->uNumTools; nIndex++) {
toolPtr = &infoPtr->tools[nIndex];
#if 0
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool];
if ((lpToolInfo->hwnd == toolPtr->hwnd) &&
if (toolPtr->uFlags & TTF_IDISHWND) {
if (lpToolInfo->uId == toolPtr->uId)
return nTool;
}
else {
if ((lpToolInfo->hwnd == toolPtr->hwnd) &&
(lpToolInfo->uId == toolPtr->uId))
return nTool;
}
}
#endif
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool];
if (!(toolPtr->uFlags & TTF_IDISHWND) &&
(lpToolInfo->hwnd == toolPtr->hwnd) &&
(lpToolInfo->uId == toolPtr->uId))
return nIndex;
return nTool;
}
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool];
if ((toolPtr->uFlags & TTF_IDISHWND) &&
(lpToolInfo->uId == toolPtr->uId))
return nTool;
}
return -1;
@ -154,24 +308,24 @@ TOOLTIPS_GetIndexFromInfoA (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOA lpToolInfo)
static INT32
TOOLTIPS_GetIndexFromPoint (TOOLTIPS_INFO *infoPtr, HWND32 hwnd, LPPOINT32 lpPt)
TOOLTIPS_GetToolFromPoint (TOOLTIPS_INFO *infoPtr, HWND32 hwnd, LPPOINT32 lpPt)
{
TTTOOL_INFO *toolPtr;
INT32 nIndex;
INT32 nTool;
for (nIndex = 0; nIndex < infoPtr->uNumTools; nIndex++) {
toolPtr = &infoPtr->tools[nIndex];
for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) {
toolPtr = &infoPtr->tools[nTool];
if (toolPtr->uFlags & TTF_IDISHWND) {
if ((HWND32)toolPtr->uId == hwnd)
return nIndex;
return nTool;
}
else {
if (hwnd != toolPtr->hwnd)
continue;
if (!PtInRect32 (&toolPtr->rect, *lpPt))
continue;
return nIndex;
return nTool;
}
}
@ -179,6 +333,28 @@ TOOLTIPS_GetIndexFromPoint (TOOLTIPS_INFO *infoPtr, HWND32 hwnd, LPPOINT32 lpPt)
}
static BOOL32
TOOLTIPS_CheckTool (WND *wndPtr)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
POINT32 pt;
HWND32 hwndTool;
INT32 nTool;
GetCursorPos32 (&pt);
hwndTool =
SendMessage32A (wndPtr->hwndSelf, TTM_WINDOWFROMPOINT, 0, (LPARAM)&pt);
if (hwndTool == 0)
return FALSE;
ScreenToClient32 (hwndTool, &pt);
nTool = TOOLTIPS_GetToolFromPoint (infoPtr, hwndTool, &pt);
TRACE (tooltips, "tool %d\n", nTool);
return (nTool != -1);
}
static LRESULT
TOOLTIPS_Activate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
@ -186,12 +362,11 @@ TOOLTIPS_Activate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->bActive = (BOOL32)wParam;
if (infoPtr->bActive) {
FIXME (tooltips, "activated!\n");
}
else {
FIXME (tooltips, "deactivated!\n");
}
if (infoPtr->bActive)
TRACE (tooltips, "activate!\n");
if (!(infoPtr->bActive) && (infoPtr->nCurrentTool != -1))
TOOLTIPS_Hide (wndPtr, infoPtr);
return 0;
}
@ -201,11 +376,18 @@ static LRESULT
TOOLTIPS_AddTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
if (lpToolInfo == NULL) return FALSE;
if (lpToolInfo->uFlags & TTF_SUBCLASS)
FIXME (tooltips, "subclassing not supported!\n");
TRACE (tooltips, "add tool (%x) %x %d%s!\n",
wndPtr->hwndSelf, lpToolInfo->hwnd, lpToolInfo->uId,
(lpToolInfo->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : "");
if (infoPtr->uNumTools == 0) {
infoPtr->tools =
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
@ -233,20 +415,24 @@ TOOLTIPS_AddTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
toolPtr->hinst = lpToolInfo->hinst;
if (lpToolInfo->hinst) {
TRACE (tooltips, "add string id %x!\n", (int)lpToolInfo->lpszText);
toolPtr->lpszText = lpToolInfo->lpszText;
}
else if (lpToolInfo->lpszText) {
if (lpToolInfo->lpszText == LPSTR_TEXTCALLBACK32A)
if (lpToolInfo->lpszText == LPSTR_TEXTCALLBACK32A) {
TRACE (tooltips, "add CALLBACK!\n");
toolPtr->lpszText = lpToolInfo->lpszText;
}
else {
INT32 len = lstrlen32A (lpToolInfo->lpszText);
TRACE (tooltips, "add text \"%s\"!\n", lpToolInfo->lpszText);
toolPtr->lpszText =
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len + 1);
lstrcpy32A (toolPtr->lpszText, lpToolInfo->lpszText);
}
}
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFOA))
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFO32A))
toolPtr->lParam = lpToolInfo->lParam;
return TRUE;
@ -260,20 +446,20 @@ static LRESULT
TOOLTIPS_DelTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
INT32 nIndex;
INT32 nTool;
if (lpToolInfo == NULL) return 0;
if (infoPtr->uNumTools == 0) return 0;
nIndex = TOOLTIPS_GetIndexFromInfoA (infoPtr, lpToolInfo);
if (nIndex == -1) return 0;
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
if (nTool == -1) return 0;
TRACE (tooltips, "index=%d\n", nIndex);
TRACE (tooltips, "tool %d\n", nTool);
/* delete text string */
toolPtr = &infoPtr->tools[nIndex];
toolPtr = &infoPtr->tools[nTool];
if ((toolPtr->hinst) && (toolPtr->lpszText)) {
if (toolPtr->lpszText != LPSTR_TEXTCALLBACK32A)
HeapFree (GetProcessHeap (), 0, toolPtr->lpszText);
@ -290,13 +476,13 @@ TOOLTIPS_DelTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(TTTOOL_INFO) * (infoPtr->uNumTools - 1));
if (nIndex > 0)
if (nTool > 0)
memcpy (&infoPtr->tools[0], &oldTools[0],
nIndex * sizeof(TTTOOL_INFO));
nTool * sizeof(TTTOOL_INFO));
if (nIndex < infoPtr->uNumTools - 1)
memcpy (&infoPtr->tools[nIndex], &oldTools[nIndex + 1],
(infoPtr->uNumTools - nIndex - 1) * sizeof(TTTOOL_INFO));
if (nTool < infoPtr->uNumTools - 1)
memcpy (&infoPtr->tools[nTool], &oldTools[nTool + 1],
(infoPtr->uNumTools - nTool - 1) * sizeof(TTTOOL_INFO));
HeapFree (GetProcessHeap (), 0, oldTools);
}
@ -315,7 +501,7 @@ TOOLTIPS_EnumTools32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
UINT32 uIndex = (UINT32)wParam;
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
if (uIndex >= infoPtr->uNumTools) return FALSE;
@ -333,7 +519,7 @@ TOOLTIPS_EnumTools32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpToolInfo->hinst = toolPtr->hinst;
lpToolInfo->lpszText = toolPtr->lpszText;
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFOA))
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFO32A))
lpToolInfo->lParam = toolPtr->lParam;
return TRUE;
@ -347,7 +533,7 @@ static LRESULT
TOOLTIPS_GetCurrentTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpti = (LPTTTOOLINFOA)lParam;
LPTTTOOLINFO32A lpti = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
if (lpti) {
@ -360,7 +546,7 @@ TOOLTIPS_GetCurrentTool32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpti->hinst = toolPtr->hinst;
lpti->lpszText = toolPtr->lpszText;
if (lpti->cbSize >= sizeof(TTTOOLINFOA))
if (lpti->cbSize >= sizeof(TTTOOLINFO32A))
lpti->lParam = toolPtr->lParam;
return TRUE;
@ -429,16 +615,16 @@ static LRESULT
TOOLTIPS_GetText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpti = (LPTTTOOLINFOA)lParam;
INT32 nIndex;
LPTTTOOLINFO32A lpti = (LPTTTOOLINFO32A)lParam;
INT32 nTool;
if (!(lpti)) return 0;
if (lpti->cbSize < sizeof(TTTOOLINFOA)) return 0;
if (lpti->cbSize < sizeof(TTTOOLINFO32A)) return 0;
nIndex = TOOLTIPS_GetIndexFromInfoA (infoPtr, lpti);
if (nIndex == -1) return 0;
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpti);
if (nTool == -1) return 0;
lstrcpy32A (lpti->lpszText, infoPtr->tools[nIndex].lpszText);
lstrcpy32A (lpti->lpszText, infoPtr->tools[nTool].lpszText);
return 0;
}
@ -475,19 +661,19 @@ static LRESULT
TOOLTIPS_GetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
INT32 nIndex;
INT32 nTool;
if (lpToolInfo == NULL) return FALSE;
if (infoPtr->uNumTools == 0) return FALSE;
nIndex = TOOLTIPS_GetIndexFromInfoA (infoPtr, lpToolInfo);
if (nIndex == -1) return FALSE;
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
if (nTool == -1) return FALSE;
TRACE (tooltips, "index=%d\n", nIndex);
TRACE (tooltips, "tool %d\n", nTool);
toolPtr = &infoPtr->tools[nIndex];
toolPtr = &infoPtr->tools[nTool];
/* copy tool data */
lpToolInfo->uFlags = toolPtr->uFlags;
@ -495,7 +681,7 @@ TOOLTIPS_GetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpToolInfo->hinst = toolPtr->hinst;
lpToolInfo->lpszText = toolPtr->lpszText;
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFOA))
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFO32A))
lpToolInfo->lParam = toolPtr->lParam;
return TRUE;
@ -509,22 +695,22 @@ static LRESULT
TOOLTIPS_HitTest32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTHITTESTINFOA lptthit = (LPTTHITTESTINFOA)lParam;
LPTTHITTESTINFO32A lptthit = (LPTTHITTESTINFO32A)lParam;
TTTOOL_INFO *toolPtr;
INT32 nTool;
if (lptthit == 0)
return FALSE;
nTool = TOOLTIPS_GetIndexFromPoint (infoPtr, lptthit->hwnd, &lptthit->pt);
nTool = TOOLTIPS_GetToolFromPoint (infoPtr, lptthit->hwnd, &lptthit->pt);
if (nTool == -1)
return FALSE;
TRACE (tooltips, "nTool = %d!\n", nTool);
TRACE (tooltips, "tool %d!\n", nTool);
/* copy tool data */
toolPtr = &infoPtr->tools[nTool];
lptthit->ti.cbSize = sizeof(TTTOOLINFOA);
lptthit->ti.cbSize = sizeof(TTTOOLINFO32A);
lptthit->ti.uFlags = toolPtr->uFlags;
lptthit->ti.hwnd = toolPtr->hwnd;
lptthit->ti.uId = toolPtr->uId;
@ -544,16 +730,16 @@ static LRESULT
TOOLTIPS_NewToolRect32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpti = (LPTTTOOLINFOA)lParam;
INT32 nIndex;
LPTTTOOLINFO32A lpti = (LPTTTOOLINFO32A)lParam;
INT32 nTool;
if (!(lpti)) return 0;
if (lpti->cbSize < sizeof(TTTOOLINFOA)) return 0;
if (lpti->cbSize < sizeof(TTTOOLINFO32A)) return 0;
nIndex = TOOLTIPS_GetIndexFromInfoA (infoPtr, lpti);
if (nIndex == -1) return 0;
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpti);
if (nTool == -1) return 0;
infoPtr->tools[nIndex].rect = lpti->rect;
infoPtr->tools[nTool].rect = lpti->rect;
return 0;
}
@ -581,15 +767,15 @@ TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
POINT32 pt;
if (lpMsg == NULL) {
WARN (tooltips, "lpMsg == NULL!\n");
ERR (tooltips, "lpMsg == NULL!\n");
return 0;
}
pt = lpMsg->pt;
ScreenToClient32 (lpMsg->hwnd, &pt);
infoPtr->nOldTool = infoPtr->nTool;
infoPtr->nTool = TOOLTIPS_GetIndexFromPoint (infoPtr, lpMsg->hwnd, &pt);
TRACE (tooltips, "nTool = %d\n", infoPtr->nTool);
infoPtr->nTool = TOOLTIPS_GetToolFromPoint (infoPtr, lpMsg->hwnd, &pt);
TRACE (tooltips, "tool (%x) %d %d\n", wndPtr->hwndSelf, infoPtr->nOldTool, infoPtr->nTool);
switch (lpMsg->message) {
case WM_LBUTTONDOWN:
@ -602,13 +788,24 @@ TOOLTIPS_RelayEvent (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
break;
case WM_MOUSEMOVE:
TRACE (tooltips, "WM_MOUSEMOVE (%d %d)\n", pt.x, pt.y);
if (infoPtr->nTool != infoPtr->nOldTool) {
if (infoPtr->nOldTool == -1)
SetTimer32 (wndPtr->hwndSelf, ID_TIMER1, infoPtr->nInitialTime, 0);
else
TRACE (tooltips, "WM_MOUSEMOVE (%04x %d %d)\n",
wndPtr->hwndSelf, pt.x, pt.y);
if ((infoPtr->bActive) && (infoPtr->nTool != infoPtr->nOldTool)) {
if (infoPtr->nOldTool == -1) {
SetTimer32 (wndPtr->hwndSelf, ID_TIMER1,
infoPtr->nInitialTime, 0);
TRACE (tooltips, "timer 1 started!\n");
}
else {
TOOLTIPS_Hide (wndPtr, infoPtr);
SetTimer32 (wndPtr->hwndSelf, ID_TIMER1, infoPtr->nReshowTime, 0);
SetTimer32 (wndPtr->hwndSelf, ID_TIMER1,
infoPtr->nReshowTime, 0);
TRACE (tooltips, "timer 2 started!\n");
}
}
if (infoPtr->nCurrentTool != -1) {
SetTimer32 (wndPtr->hwndSelf, ID_TIMER3, 100, 0);
TRACE (tooltips, "timer 3 started!\n");
}
break;
}
@ -709,18 +906,18 @@ static LRESULT
TOOLTIPS_SetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
INT32 nIndex;
INT32 nTool;
if (lpToolInfo == NULL) return 0;
nIndex = TOOLTIPS_GetIndexFromInfoA (infoPtr, lpToolInfo);
if (nIndex == -1) return 0;
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
if (nTool == -1) return 0;
TRACE (tooltips, "nIndex=%d\n", nIndex);
TRACE (tooltips, "tool %d\n", nTool);
toolPtr = &infoPtr->tools[nIndex];
toolPtr = &infoPtr->tools[nTool];
/* copy tool data */
toolPtr->uFlags = lpToolInfo->uFlags;
@ -744,7 +941,7 @@ TOOLTIPS_SetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
}
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFOA))
if (lpToolInfo->cbSize >= sizeof(TTTOOLINFO32A))
toolPtr->lParam = lpToolInfo->lParam;
return 0;
@ -752,12 +949,112 @@ TOOLTIPS_SetToolInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
// << TOOLTIPS_SetToolInfo32W >>
// << TOOLTIPS_TrackActive >>
// << TOOLTIPS_TrackPosition >>
// << TOOLTIPS_Update >>
// << TOOLTIPS_UpdateTipText32A >>
static LRESULT
TOOLTIPS_TrackActivate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
if ((BOOL32)wParam) {
/* activate */
infoPtr->nTrackTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
if (infoPtr->nTrackTool != -1) {
infoPtr->bTrackActive = TRUE;
/* FIXME : show tool tip */
}
}
else {
/* deactivate */
/* FIXME : hide tool tip */
infoPtr->bTrackActive = FALSE;
infoPtr->nTrackTool = -1;
}
return 0;
}
static LRESULT
TOOLTIPS_TrackPosition (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
infoPtr->xTrackPos = (INT32)LOWORD(lParam);
infoPtr->yTrackPos = (INT32)HIWORD(lParam);
if (infoPtr->bTrackActive) {
FIXME (tooltips, "set position!\n");
}
return 0;
}
static LRESULT
TOOLTIPS_Update (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
if (infoPtr->nCurrentTool != -1)
UpdateWindow32 (wndPtr->hwndSelf);
return 0;
}
static LRESULT
TOOLTIPS_UpdateTipText32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LPTTTOOLINFO32A lpToolInfo = (LPTTTOOLINFO32A)lParam;
TTTOOL_INFO *toolPtr;
INT32 nTool;
if (lpToolInfo == NULL) return 0;
nTool = TOOLTIPS_GetToolFromInfoA (infoPtr, lpToolInfo);
if (nTool == -1) return 0;
TRACE (tooltips, "tool %d\n", nTool);
toolPtr = &infoPtr->tools[nTool];
/* copy tool text */
toolPtr->hinst = lpToolInfo->hinst;
if (lpToolInfo->hinst) {
toolPtr->lpszText = lpToolInfo->lpszText;
}
else if (lpToolInfo->lpszText) {
if (lpToolInfo->lpszText == LPSTR_TEXTCALLBACK32A)
toolPtr->lpszText = lpToolInfo->lpszText;
else {
INT32 len = lstrlen32A (lpToolInfo->lpszText);
HeapFree (GetProcessHeap (), 0, toolPtr->lpszText);
toolPtr->lpszText =
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len + 1);
lstrcpy32A (toolPtr->lpszText, lpToolInfo->lpszText);
}
}
return 0;
}
// << TOOLTIPS_UpdateTipText32W >>
// << TOOLTIPS_WindowFromPoint >>
static LRESULT
TOOLTIPS_WindowFromPoint (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
return WindowFromPoint32 (*((LPPOINT32)lParam));
}
static LRESULT
@ -778,6 +1075,7 @@ TOOLTIPS_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* initialize info structure */
infoPtr->bActive = TRUE;
infoPtr->bTrackActive = FALSE;
infoPtr->clrBk = GetSysColor32 (COLOR_INFOBK);
infoPtr->clrText = GetSysColor32 (COLOR_INFOTEXT);
@ -788,12 +1086,15 @@ TOOLTIPS_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->nTool = -1;
infoPtr->nOldTool = -1;
infoPtr->nCurrentTool = -1;
infoPtr->nTrackTool = -1;
infoPtr->nAutomaticTime = 500;
infoPtr->nReshowTime = 100;
infoPtr->nAutoPopTime = 5000;
infoPtr->nInitialTime = 500;
SetWindowPos32 (wndPtr->hwndSelf, HWND_TOP, 0, 0, 0, 0, SWP_HIDEWINDOW);
return 0;
}
@ -803,7 +1104,6 @@ TOOLTIPS_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
/* free tools */
if (infoPtr->tools) {
INT32 i;
@ -816,6 +1116,9 @@ TOOLTIPS_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HeapFree (GetProcessHeap (), 0, infoPtr->tools);
}
/* delete font */
DeleteObject32 (infoPtr->hFont);
/* free tool tips info data */
HeapFree (GetProcessHeap (), 0, infoPtr);
@ -890,9 +1193,8 @@ TOOLTIPS_SetFont (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->hFont = (HFONT32)wParam;
if (LOWORD(lParam)) {
/* redraw */
if ((LOWORD(lParam)) & (infoPtr->nCurrentTool != -1)) {
FIXME (tooltips, "full redraw needed!\n");
}
return 0;
@ -904,6 +1206,8 @@ TOOLTIPS_Timer (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
TRACE (tooltips, "timer %d (%x) expired!\n", wParam, wndPtr->hwndSelf);
switch (wParam)
{
case ID_TIMER1:
@ -914,12 +1218,35 @@ TOOLTIPS_Timer (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
case ID_TIMER2:
TOOLTIPS_Hide (wndPtr, infoPtr);
break;
case ID_TIMER3:
KillTimer32 (wndPtr->hwndSelf, ID_TIMER3);
if (TOOLTIPS_CheckTool (wndPtr) == FALSE) {
infoPtr->nTool = -1;
infoPtr->nOldTool = -1;
TOOLTIPS_Hide (wndPtr, infoPtr);
}
break;
}
return 0;
}
// << TOOLTIPS_WinIniChange >>
static LRESULT
TOOLTIPS_WinIniChange (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr(wndPtr);
LOGFONT32A logFont;
infoPtr->clrBk = GetSysColor32 (COLOR_INFOBK);
infoPtr->clrText = GetSysColor32 (COLOR_INFOTEXT);
DeleteObject32 (infoPtr->hFont);
SystemParametersInfo32A( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 );
infoPtr->hFont = CreateFontIndirect32A( &logFont );
return 0;
}
LRESULT WINAPI
@ -1015,12 +1342,23 @@ ToolTipsWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
return TOOLTIPS_SetToolInfo32A (wndPtr, wParam, lParam);
// case TTM_SETTOOLINFO32W:
// case TTM_TRACKACTIVE: /* 4.70 */
// case TTM_TRACKPOSITION: /* 4.70 */
// case TTM_UPDATE: /* 4.71 */
// case TTM_UPDATETIPTEXT32A:
case TTM_TRACKACTIVATE:
return TOOLTIPS_TrackActivate (wndPtr, wParam, lParam);
case TTM_TRACKPOSITION:
return TOOLTIPS_TrackPosition (wndPtr, wParam, lParam);
case TTM_UPDATE:
return TOOLTIPS_Update (wndPtr, wParam, lParam);
case TTM_UPDATETIPTEXT32A:
return TOOLTIPS_UpdateTipText32A (wndPtr, wParam, lParam);
// case TTM_UPDATETIPTEXT32W:
// case TTM_WINDOWFROMPOINT:
case TTM_WINDOWFROMPOINT:
return TOOLTIPS_WindowFromPoint (wndPtr, wParam, lParam);
case WM_CREATE:
@ -1035,22 +1373,36 @@ ToolTipsWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_GETFONT:
return TOOLTIPS_GetFont (wndPtr, wParam, lParam);
// case WM_GETTEXT:
// case WM_GETTEXTLENGTH:
// case WM_LBUTTONDOWN:
// case WM_MBUTTONDOWN:
case WM_MOUSEMOVE:
return TOOLTIPS_MouseMove (wndPtr, wParam, lParam);
case WM_NCCREATE:
return TOOLTIPS_NcCreate (wndPtr, wParam, lParam);
// case WM_NCHITTEST:
// case WM_NOTIFYFORMAT:
case WM_PAINT:
return TOOLTIPS_Paint (wndPtr, wParam, lParam);
// case WM_PRINTCLIENT:
// case WM_RBUTTONDOWN:
case WM_SETFONT:
return TOOLTIPS_SetFont (wndPtr, wParam, lParam);
// case WM_STYLECHANGED:
case WM_TIMER:
return TOOLTIPS_Timer (wndPtr, wParam, lParam);
// case WM_WININICHANGE:
case WM_WININICHANGE:
return TOOLTIPS_WinIniChange (wndPtr, wParam, lParam);
default:
if (uMsg >= WM_USER)
@ -1080,4 +1432,3 @@ TOOLTIPS_Register (void)
RegisterClass32A (&wndClass);
}

View File

@ -40,7 +40,7 @@ TREEVIEW_SetImageList (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->himlState = (HIMAGELIST)lParam;
}
else
return NULL;
return 0;
return (LRESULT)himlTemp;
}
@ -109,23 +109,132 @@ TREEVIEW_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
LRESULT WINAPI
TreeviewWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
TREEVIEW_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
switch (uMsg)
{
case TVM_INSERTITEMA:
FIXME (treeview, "Unimplemented msg TVM_INSERTITEMA\n");
return 0;
// case TVM_GETIMAGELIST:
// return TREEVIEW_GetImageList (wndPtr, wParam, lParam);
case TVM_INSERTITEMW:
FIXME (treeview, "Unimplemented msg TVM_INSERTITEMW\n");
return 0;
case TVM_DELETEITEM:
FIXME (treeview, "Unimplemented msg TVM_DELETEITEM\n");
return 0;
case TVM_EXPAND:
FIXME (treeview, "Unimplemented msg TVM_EXPAND\n");
return 0;
case TVM_GETITEMRECT:
FIXME (treeview, "Unimplemented msg TVM_GETITEMRECT\n");
return 0;
case TVM_GETCOUNT:
FIXME (treeview, "Unimplemented msg TVM_GETCOUNT\n");
return 0;
case TVM_GETINDENT:
FIXME (treeview, "Unimplemented msg TVM_GETINDENT\n");
return 0;
case TVM_SETINDENT:
FIXME (treeview, "Unimplemented msg TVM_SETINDENT\n");
return 0;
case TVM_GETIMAGELIST:
FIXME (treeview, "Unimplemented msg TVM_GETIMAGELIST\n");
return 0;
//return TREEVIEW_GetImageList (wndPtr, wParam, lParam);
case TVM_SETIMAGELIST:
return TREEVIEW_SetImageList (wndPtr, wParam, lParam);
case TVM_GETNEXTITEM:
FIXME (treeview, "Unimplemented msg TVM_GETNEXTITEM\n");
return 0;
case TVM_SELECTITEM:
FIXME (treeview, "Unimplemented msg TVM_SELECTITEM \n");
return 0;
case TVM_GETITEMA:
FIXME (treeview, "Unimplemented msg TVM_GETITEMA\n");
return 0;
case TVM_GETITEMW:
FIXME (treeview, "Unimplemented msg TVM_GETITEMW\n");
return 0;
case TVM_SETITEMA:
FIXME (treeview, "Unimplemented msg TVM_SETITEMA\n");
return 0;
case TVM_SETITEMW:
FIXME (treeview, "Unimplemented msg TVM_SETITEMW\n");
return 0;
case TVM_EDITLABELA:
FIXME (treeview, "Unimplemented msg TVM_EDITLABELA \n");
return 0;
case TVM_EDITLABELW:
FIXME (treeview, "Unimplemented msg TVM_EDITLABELW \n");
return 0;
case TVM_GETEDITCONTROL:
FIXME (treeview, "Unimplemented msg TVM_GETEDITCONTROL\n");
return 0;
case TVM_GETVISIBLECOUNT:
FIXME (treeview, "Unimplemented msg TVM_GETVISIBLECOUNT\n");
return 0;
case TVM_HITTEST:
FIXME (treeview, "Unimplemented msg TVM_HITTEST\n");
return 0;
case TVM_CREATEDRAGIMAGE:
FIXME (treeview, "Unimplemented msg TVM_CREATEDRAGIMAGE\n");
return 0;
case TVM_SORTCHILDREN:
FIXME (treeview, "Unimplemented msg TVM_SORTCHILDREN\n");
return 0;
case TVM_ENSUREVISIBLE:
FIXME (treeview, "Unimplemented msg TVM_ENSUREVISIBLE\n");
return 0;
case TVM_SORTCHILDRENCB:
FIXME (treeview, "Unimplemented msg TVM_SORTCHILDRENCB\n");
return 0;
case TVM_ENDEDITLABELNOW:
FIXME (treeview, "Unimplemented msg TVM_ENDEDITLABELNOW\n");
return 0;
case TVM_GETISEARCHSTRINGA:
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRINGA\n");
return 0;
case TVM_GETISEARCHSTRINGW:
FIXME (treeview, "Unimplemented msg TVM_GETISEARCHSTRINGW\n");
return 0;
case TVM_SETTOOLTIPS:
FIXME (treeview, "Unimplemented msg TVM_SETTOOLTIPS\n");
return 0;
case TVM_GETTOOLTIPS:
FIXME (treeview, "Unimplemented msg TVM_GETTOOLTIPS\n");
return 0;
case WM_CREATE:
return TREEVIEW_Create (wndPtr, wParam, lParam);
@ -141,7 +250,6 @@ TreeviewWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_GETDLGCODE:
return DLGC_WANTARROWS | DLGC_WANTCHARS;
// case WM_PAINT:
// return TREEVIEW_Paint (wndPtr, wParam);
@ -153,7 +261,7 @@ TreeviewWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
default:
if (uMsg >= WM_USER)
ERR (treeview, "unknown msg %04x wp=%08x lp=%08lx\n",
FIXME (treeview, "Unknown msg %04x wp=%08x lp=%08lx\n",
uMsg, wParam, lParam);
return DefWindowProc32A (hwnd, uMsg, wParam, lParam);
}
@ -166,11 +274,13 @@ TREEVIEW_Register (void)
{
WNDCLASS32A wndClass;
TRACE (treeview,"\n");
if (GlobalFindAtom32A (WC_TREEVIEW32A)) return;
ZeroMemory (&wndClass, sizeof(WNDCLASS32A));
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
wndClass.lpfnWndProc = (WNDPROC32)TreeviewWindowProc;
wndClass.lpfnWndProc = (WNDPROC32)TREEVIEW_WindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(TREEVIEW_INFO *);
wndClass.hCursor = LoadCursor32A (0, IDC_ARROW32A);

View File

@ -103,8 +103,6 @@ BOOL32 WIDGETS_Init(void)
if (!(bicAtomTable[i] = RegisterClass32A( cls ))) return FALSE;
}
/* FIXME: hack to enable using built-in controls with Windows COMCTL32 */
InitCommonControls();
return TRUE;
}

View File

@ -19,6 +19,7 @@
#include "winnt.h"
#include "debugger.h"
#include "neexe.h"
#include "process.h"
#include "expr.h"
@ -436,7 +437,6 @@ static void DEBUG_Main( int signal )
* don't grok that yet, and in this case we fall back to using
* the wine.sym file.
*/
fprintf(stderr,"Loading symbols: ");
if( DEBUG_ReadExecutableDbgInfo() == FALSE )
{
char *symfilename = "wine.sym";
@ -451,7 +451,6 @@ static void DEBUG_Main( int signal )
DEBUG_LoadEntryPoints();
DEBUG_ProcessDeferredDebug();
fprintf(stderr,"\n");
}
#if 0
@ -481,6 +480,8 @@ static void DEBUG_Main( int signal )
if (newmode != dbg_mode)
fprintf(stderr,"In %d bit mode.\n", dbg_mode = newmode);
PROCESS_SuspendOtherThreads();
DEBUG_DoDisplay();
if (signal != SIGTRAP) /* This is a real crash, dump some info */
@ -542,6 +543,7 @@ static void DEBUG_Main( int signal )
if( dbg_exec_mode == EXEC_CONT )
{
dbg_exec_count = 0;
PROCESS_ResumeOtherThreads();
}
in_debugger = FALSE;

View File

@ -874,19 +874,35 @@ void DEBUG_LoadEntryPoints(void)
NE_MODULE *pModule;
BOOL32 ok;
WINE_MODREF *wm;
int rowcount = 3;
fprintf( stderr, " " );
for (ok = ModuleFirst(&entry); ok; ok = ModuleNext(&entry))
{
if (!(pModule = NE_GetPtr( entry.hModule ))) continue;
if ((rowcount + strlen(entry.szModule)) > 76)
{
fprintf( stderr,"\n ");
rowcount = 3;
}
fprintf( stderr, " %s", entry.szModule );
rowcount += strlen(entry.szModule) + 1;
if (!(pModule->flags & NE_FFLAGS_WIN32)) /* NE module */
DEBUG_LoadEntryPoints16( entry.hModule, pModule, entry.szModule );
}
for (wm=PROCESS_Current()->modref_list;wm;wm=wm->next) {
for (wm=PROCESS_Current()->modref_list;wm;wm=wm->next)
{
if ((rowcount + strlen(wm->modname)) > 76)
{
fprintf( stderr,"\n ");
rowcount = 3;
}
fprintf( stderr, " %s", wm->modname );
rowcount += strlen(wm->modname) + 1;
DEBUG_LoadEntryPoints32( wm->module, wm->modname );
}
fprintf( stderr, "\n" );
}

View File

@ -19,7 +19,7 @@
* write (rwflag == 0)
************************************************************/
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
BOOL32 DEBUG_checkmap_bad( const char *addr, size_t size, int rwflag)
{
FILE *fp;
@ -28,6 +28,7 @@ BOOL32 DEBUG_checkmap_bad( const char *addr, size_t size, int rwflag)
char *start, *end;
int ret = TRUE;
#ifdef linux
/*
The entries in /proc/self/maps are of the form:
08000000-08002000 r-xp 00000000 03:41 2361
@ -41,12 +42,34 @@ BOOL32 DEBUG_checkmap_bad( const char *addr, size_t size, int rwflag)
Only permissions start and end are used here
*/
#else
/*
% cat /proc/curproc/map
start end resident private perm type
0x1000 0xe000 12 0 r-x COW vnode
0xe000 0x10000 2 2 rwx COW vnode
0x10000 0x27000 4 4 rwx default
0x800e000 0x800f000 1 1 rw- default
0xefbde000 0xefbfe000 1 1 rwx default
COW = "copy on write"
*/
#endif
#ifdef linux
if (!(fp = fopen("/proc/self/maps", "r")))
#else
if (!(fp = fopen("/proc/curproc/map", "r")))
#endif
return FALSE;
while (fgets( buf, 79, fp)) {
#ifdef linux
sscanf(buf, "%x-%x %3s", (int *) &start, (int *) &end, prot);
#else
sscanf(buf, "%x %x %*d %*d %3s", (int *) &start, (int *) &end, prot);
#endif
if ( end <= addr)
continue;
if (start <= addr && addr+size < end) {
@ -60,13 +83,13 @@ BOOL32 DEBUG_checkmap_bad( const char *addr, size_t size, int rwflag)
fclose( fp);
return ret;
}
#else /* linux */
#else /* linux || FreeBSD */
/* FIXME: code needed for BSD et al. */
BOOL32 DEBUG_checkmap_bad(char *addr, size_t size, int rwflag)
{
return FALSE;
}
#endif /* linux */
#endif /* linux || FreeBSD */
/***********************************************************************

View File

@ -1077,8 +1077,7 @@ DEBUG_ProcessElfObject(char * filename, unsigned int load_offset)
free(fn);
if (t) s = t+1;
}
if (!s || !*s)
fprintf(stderr," %s not found",filename);
if (!s || !*s) fprintf(stderr," not found");
free(paths);
goto leave;
}
@ -1099,12 +1098,6 @@ DEBUG_ProcessElfObject(char * filename, unsigned int load_offset)
if( addr == (char *) 0xffffffff )
goto leave;
/*
* Give a nice status message here...
* Well not, just print the name.
*/
fprintf(stderr, " %s", filename);
/*
* Next, we need to find a few of the internal ELF headers within
* this thing. We need the main executable header, and the section
@ -1182,6 +1175,7 @@ DEBUG_ReadExecutableDbgInfo(void)
struct link_map * lpnt = NULL;
extern Elf32_Dyn _DYNAMIC[];
int rtn = FALSE;
int rowcount;
exe_name = DEBUG_argv0;
@ -1191,6 +1185,8 @@ DEBUG_ReadExecutableDbgInfo(void)
if( exe_name == NULL )
goto leave;
fprintf( stderr, "Loading symbols: %s", exe_name );
rowcount = 17 + strlen(exe_name);
DEBUG_ProcessElfObject(exe_name, 0);
/*
@ -1238,13 +1234,22 @@ DEBUG_ReadExecutableDbgInfo(void)
continue;
if( lpnt->l_name != NULL )
{
if (rowcount + strlen(lpnt->l_name) > 76)
{
fprintf( stderr, "\n " );
rowcount = 3;
}
fprintf( stderr, " %s", lpnt->l_name );
rowcount += strlen(lpnt->l_name) + 1;
DEBUG_ProcessElfObject(lpnt->l_name, lpnt->l_addr);
}
}
rtn = TRUE;
leave:
fprintf( stderr, "\n" );
return (rtn);
}
@ -1309,7 +1314,7 @@ DEBUG_ReadExecutableDbgInfo(void)
/*
* Give a nice status message here...
*/
fprintf(stderr, " %s", exe_name);
fprintf( stderr, "Loading symbols: %s", exe_name );
rtn = TRUE;

View File

@ -175,10 +175,8 @@
- Almost finished.
Notes:
- Tool tips need to be added, but since they are not done yet...
Notes:
Have a look at controls/status.c for a list of bugs and missing features.
- Unicode support is still missing.
- Tooltip integration is almost complete.
3.17 Tab Control
@ -200,7 +198,7 @@
- Development in progress.
- Basic functionality is almost done. (dll version 4.0)
Notes
Notes:
Bitmaps are not correctly displayed.
@ -210,10 +208,11 @@
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress. Almost done.
- Almost finished.
Notes
The control does not behave very well. This will be fixed
Notes:
- Unicode support is still missing.
- No subclassing.
3.20 Trackbar Control
@ -232,6 +231,7 @@
----------------------
Author:
Dummy written by Eric Kohl.
Alex Priem (alexp@sci.kun.nl)
Status:
- Dummy control. No functionality.

View File

@ -21,7 +21,6 @@ SystemFixed.xxx # Same parameters for the System fixed typeface
[Tweak.Layout]
Win95Look=[true|false] # Enables/disables the Win95 look and feel
MenuHeight=<pixels> # Sets the height of the menu bar
MenuBarItemTopNudge=<pixels> # Nudges the menu bar items down/up
MenuBarItemLeftNudge=<pixels> # Nudges the menu bar items left/right
MenuItemTopNudge=<pixels> # Nudges the menu items down/up
@ -30,18 +29,4 @@ MenuHighlightTopNudge=<pixels> # Nudges the top of the highlight bar
MenuHighlightLeftNudge=<pixels> # Nudges the left side of the highlight bar
MenuHighlightRightNudge=<pixels> # Nudges the right side of the highlight bar
MenuHighlightBottomNudge=<pixels> # Nudges the bottom of the highlight bar
CaptionAlignment=[left|right|center] # Sets the alignment of caption text
SysControlNudge=<pixels> # Nudges the system menu left/right
MaxControlNudge=<pixels> # Nudges the maximize control left/right
MinControlNudge=<pixels> # Nudges the minimize control left/right
ScrollBarWidth=<pixels> # Sets scroll bar sizes
DialogFrameWidth=<pixels> # Sets the frame width of dialog boxes
[Tweak.Colors]
PenFF95.Red=<0-255> # Sets the red value of the Win95 white pen
PenFF95.Grn=<0-255> # Sets the green value of the Win95 white pen
PenFF95.Blu=<0-255> # Sets the blue value of the Win95 white pen
PenE095.xxx # Sets the RGB values of the Win95 grey-88 pen
PenC095.xxx # Sets the RGB values of the Win95 grey-75 pen
Pen8095.xxx # Sets the RGB values of the Win95 grey-50 pen
Pen0095.xxx # Sets the RGB values of the Win95 black pen

View File

@ -8,6 +8,7 @@ VPATH = @srcdir@
MODULE = files
C_SRCS = \
change.c \
directory.c \
dos_fs.c \
drive.c \

188
files/change.c Normal file
View File

@ -0,0 +1,188 @@
/*
* Win32 file change notification functions
*
* Copyright 1998 Ulrich Weigand
*/
#include <errno.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include "windows.h"
#include "winbase.h"
#include "winerror.h"
#include "process.h"
#include "thread.h"
#include "heap.h"
#include "debug.h"
static BOOL32 CHANGE_Signaled( K32OBJ *obj, DWORD thread_id );
static BOOL32 CHANGE_Satisfied( K32OBJ *obj, DWORD thread_id );
static void CHANGE_AddWait( K32OBJ *obj, DWORD thread_id );
static void CHANGE_RemoveWait( K32OBJ *obj, DWORD thread_id );
static void CHANGE_Destroy( K32OBJ *obj );
const K32OBJ_OPS CHANGE_Ops =
{
CHANGE_Signaled, /* signaled */
CHANGE_Satisfied, /* satisfied */
CHANGE_AddWait, /* add_wait */
CHANGE_RemoveWait, /* remove_wait */
NULL, /* read */
NULL, /* write */
CHANGE_Destroy /* destroy */
};
/* The change notification object */
typedef struct
{
K32OBJ header;
LPSTR lpPathName;
BOOL32 bWatchSubtree;
DWORD dwNotifyFilter;
THREAD_QUEUE wait_queue;
BOOL32 notify;
} CHANGE_OBJECT;
/***********************************************************************
* CHANGE_Signaled
*/
static BOOL32 CHANGE_Signaled( K32OBJ *obj, DWORD thread_id )
{
CHANGE_OBJECT *change = (CHANGE_OBJECT *)obj;
assert( obj->type == K32OBJ_CHANGE );
return change->notify;
}
/***********************************************************************
* CHANGE_Satisfied
*
* Wait on this object has been satisfied.
*/
static BOOL32 CHANGE_Satisfied( K32OBJ *obj, DWORD thread_id )
{
assert( obj->type == K32OBJ_CHANGE );
return FALSE; /* Not abandoned */
}
/***********************************************************************
* CHANGE_AddWait
*
* Add thread to object wait queue.
*/
static void CHANGE_AddWait( K32OBJ *obj, DWORD thread_id )
{
CHANGE_OBJECT *change = (CHANGE_OBJECT *)obj;
assert( obj->type == K32OBJ_CHANGE );
THREAD_AddQueue( &change->wait_queue, THREAD_ID_TO_THDB(thread_id) );
}
/***********************************************************************
* CHANGE_RemoveWait
*
* Remove thread from object wait queue.
*/
static void CHANGE_RemoveWait( K32OBJ *obj, DWORD thread_id )
{
CHANGE_OBJECT *change = (CHANGE_OBJECT *)obj;
assert( obj->type == K32OBJ_CHANGE );
THREAD_RemoveQueue( &change->wait_queue, THREAD_ID_TO_THDB(thread_id) );
}
/****************************************************************************
* CHANGE_Destroy
*/
static void CHANGE_Destroy( K32OBJ *obj )
{
CHANGE_OBJECT *change = (CHANGE_OBJECT *)obj;
assert( obj->type == K32OBJ_CHANGE );
if ( change->lpPathName )
{
HeapFree( SystemHeap, 0, change->lpPathName );
change->lpPathName = NULL;
}
obj->type = K32OBJ_UNKNOWN;
HeapFree( SystemHeap, 0, change );
}
/****************************************************************************
* FindFirstChangeNotification32A (KERNEL32.248)
*/
HANDLE32 WINAPI FindFirstChangeNotification32A( LPCSTR lpPathName,
BOOL32 bWatchSubtree,
DWORD dwNotifyFilter )
{
HANDLE32 handle;
CHANGE_OBJECT *change;
change = HeapAlloc( SystemHeap, 0, sizeof(CHANGE_OBJECT) );
if (!change) return INVALID_HANDLE_VALUE32;
change->header.type = K32OBJ_CHANGE;
change->header.refcount = 1;
change->lpPathName = HEAP_strdupA( SystemHeap, 0, lpPathName );
change->bWatchSubtree = bWatchSubtree;
change->dwNotifyFilter = dwNotifyFilter;
change->wait_queue = NULL;
change->notify = FALSE;
handle = HANDLE_Alloc( PROCESS_Current(), &change->header,
FILE_ALL_ACCESS /*FIXME*/, TRUE, -1 );
/* If the allocation failed, the object is already destroyed */
if (handle == INVALID_HANDLE_VALUE32) change = NULL;
return handle;
}
/****************************************************************************
* FindFirstChangeNotification32W (KERNEL32.249)
*/
HANDLE32 WINAPI FindFirstChangeNotification32W( LPCWSTR lpPathName,
BOOL32 bWatchSubtree,
DWORD dwNotifyFilter)
{
LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName );
HANDLE32 ret = FindFirstChangeNotification32A( nameA, bWatchSubtree,
dwNotifyFilter );
if (nameA) HeapFree( GetProcessHeap(), 0, nameA );
return ret;
}
/****************************************************************************
* FindNextChangeNotification (KERNEL32.252)
*/
BOOL32 WINAPI FindNextChangeNotification( HANDLE32 handle )
{
CHANGE_OBJECT *change;
SYSTEM_LOCK();
if (!(change = (CHANGE_OBJECT *)HANDLE_GetObjPtr( PROCESS_Current(),
handle, K32OBJ_CHANGE,
0 /*FIXME*/, NULL )) )
{
SYSTEM_UNLOCK();
return FALSE;
}
change->notify = FALSE;
K32OBJ_DecCount( &change->header );
SYSTEM_UNLOCK();
return TRUE;
}
/****************************************************************************
* FindCloseChangeNotification (KERNEL32.247)
*/
BOOL32 WINAPI FindCloseChangeNotification( HANDLE32 handle)
{
return CloseHandle( handle );
}

View File

@ -85,7 +85,7 @@ int DIR_Init(void)
if (-1 == access( tmp_dir.long_name, W_OK ))
{
if (errno==EACCES)
MSG("Warning: The Temporary Directory (as specified in wine.conf) is NOT writeable. Please check your configuration.\n");
MSG("Warning: The Temporary Directory (as specified in wine.conf or ~/.winerc) is NOT writeable. Please check your configuration.\n");
else
MSG("Warning: Access to Temporary Directory failed (%s).\n",
strerror(errno));

View File

@ -577,6 +577,7 @@ const DOS_DEVICE *DOSFS_GetDevice( const char *name )
int i;
const char *p;
if (!name) return NULL; /* if FILE_DupUnixHandle was used */
if (name[0] && (name[1] == ':')) name += 2;
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;
@ -604,6 +605,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
FILE_OBJECT *file;
HFILE32 handle;
if (!name) return NULL; /* if FILE_DupUnixHandle was used */
if (name[0] && (name[1] == ':')) name += 2;
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;

View File

@ -998,7 +998,12 @@ BOOL32 WINAPI GetVolumeInformation32A( LPCSTR root, LPSTR label,
/* Set the filesystem information */
/* Note: we only emulate a FAT fs at the present */
if (filename_len) *filename_len = 12;
if (filename_len) {
if (DOSDrives[drive].flags & DRIVE_SHORT_NAMES)
*filename_len = 12;
else
*filename_len = 255;
}
if (flags) *flags = 0;
if (fsname) {
/* Diablo checks that return code ... */

View File

@ -90,7 +90,7 @@ HFILE32 FILE_Alloc( FILE_OBJECT **file )
handle = HANDLE_Alloc( PROCESS_Current(), &(*file)->header,
FILE_ALL_ACCESS | GENERIC_READ |
GENERIC_WRITE | GENERIC_EXECUTE /*FIXME*/, TRUE );
GENERIC_WRITE | GENERIC_EXECUTE /*FIXME*/, TRUE, -1 );
/* If the allocation failed, the object is already destroyed */
if (handle == INVALID_HANDLE_VALUE32) *file = NULL;
return handle;
@ -188,7 +188,7 @@ static void FILE_Destroy( K32OBJ *ptr )
FILE_OBJECT *FILE_GetFile( HFILE32 handle )
{
return (FILE_OBJECT *)HANDLE_GetObjPtr( PROCESS_Current(), handle,
K32OBJ_FILE, 0 /*FIXME*/ );
K32OBJ_FILE, 0 /*FIXME*/, NULL );
}
@ -508,7 +508,7 @@ DWORD WINAPI GetFileAttributes32A( LPCSTR name )
DOS_FULL_NAME full_name;
BY_HANDLE_FILE_INFORMATION info;
if (name == NULL) return -1;
if (name == NULL || *name=='\0') return -1;
if (!DOSFS_GetFullName( name, TRUE, &full_name )) return -1;
if (!FILE_Stat( full_name.long_name, &info )) return -1;
@ -796,6 +796,22 @@ found:
lstrcpyn32A( ofs->szPathName, full_name.short_name,
sizeof(ofs->szPathName) );
if (mode & OF_SHARE_EXCLUSIVE)
{
char *last = strrchr(full_name.long_name,'/');
if (!last)
last = full_name.long_name - 1;
/* Some InstallShield version uses OF_SHARE_EXCLUSIVE
on the file <tempdir>/_ins0432._mp to determine how
far installation has proceeded*/
if (GetModuleHandle16(last+1))
{
TRACE(file,"Denying shared open for %s\n",full_name.long_name);
return HFILE_ERROR32;
}
FIXME(file,"OF_SHARE_EXCLUSIVE only partial implemented\n");
}
if (mode & OF_DELETE)
{
if (unlink( full_name.long_name ) == -1) goto not_found;
@ -925,7 +941,7 @@ UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count )
TRACE( file, "%d %p %d\n", handle, buffer, count);
if (!(ptr = HANDLE_GetObjPtr( PROCESS_Current(), handle,
K32OBJ_UNKNOWN, 0))) return -1;
K32OBJ_UNKNOWN, 0, NULL))) return -1;
if (K32OBJ_OPS(ptr)->read)
result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL);
K32OBJ_DecCount( ptr );
@ -1147,7 +1163,7 @@ LONG WINAPI _hwrite32( HFILE32 handle, LPCSTR buffer, LONG count )
}
if (!(ioptr = HANDLE_GetObjPtr( PROCESS_Current(), handle,
K32OBJ_UNKNOWN, 0 )))
K32OBJ_UNKNOWN, 0, NULL )))
return HFILE_ERROR32;
if (K32OBJ_OPS(ioptr)->write)
status = K32OBJ_OPS(ioptr)->write(ioptr, buffer, count, &result, NULL);

View File

@ -452,13 +452,12 @@ static BOOL32 PROFILE_Open( LPCSTR filename )
CurProfile=tempProfile;
}
if(!stat(CurProfile->unix_name,&buf) && CurProfile->mtime==buf.st_mtime)
{
TRACE(profile, "(%s): already opened (mru=%d)\n",
filename, i );
return TRUE;
}
TRACE(profile, "(%s): already opened, needs refreshing (mru=%d)\n",
filename, i );
else
TRACE(profile, "(%s): already opened, needs refreshing (mru=%d)\n",
filename, i );
return TRUE;
}
}

View File

@ -53,7 +53,8 @@ BOOL32 DRIVER_RegisterDriver( LPCSTR name, const DC_FUNCTIONS *funcs )
const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name )
{
GRAPHICS_DRIVER *driver = firstDriver;
while (driver)
while (driver && name)
{
if (!strcasecmp( driver->name, name )) return driver->funcs;
driver = driver->next;

View File

@ -13,6 +13,7 @@ C_SRCS = \
graphics.c \
init.c \
objects.c \
ppd.c \
ps.c \
text.c

View File

@ -39,6 +39,13 @@ file=/unix/path/name/filename.afm
for each AFM file that you wish to use. [This might change in the future]
You also require a ppd file for your printer. This describes certain
characteristics of the printer such as which fonts are installed, how to select
manual feed etc. Adobe also has many of these on its website, have a look in
ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/
Put the ppd in the directory from which you start wine and call it default.ppd
[this will definitely change soon].
Note that you need not set printer=on in the [wine] section of wine.conf, this
enables printing via external printer drivers and does not affect wineps.
@ -51,9 +58,12 @@ the right place.
TODO / Bugs
-----------
Driver doesn't read PPD files - it should.
Driver does read PPD files, but ignores all constraints and doesn't let you
specify whether you have optional extras such as envelope feeders. You will
therefore find a larger than normal selection of input bins in the print setup
dialog box. I've only really tested ppd parsing on the hp4m6_v1.ppd file.
A4 portrait mode is hard coded in at the moment.
Landscape mode probably doesn't quite work yet (this is easy to fix).
Graphics are basically non-existent. Only MoveTo/LineTo/Rectangle with a thin
black pen.
@ -64,12 +74,13 @@ AFM parsing is not finished (or ideal).
No TrueType download.
Many partial-implemented functions.
Many partially implemented functions.
ps.c is becoming messy.
Probably many more...
Since the driver is very very alpha, things are likely to change quickly.
Since the driver is very alpha, things are likely to change quickly.
Please contact me if you want to help so that we can avoid duplication.
Huw Davies <h.davies1@physics.ox.ac.uk>

View File

@ -16,7 +16,7 @@
#include <ctype.h>
/* ptr to fonts for which we have afm files */
FontFamily *PSDRV_AFMFontList = NULL;
FONTFAMILY *PSDRV_AFMFontList = NULL;
/***********************************************************
@ -35,6 +35,8 @@ static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
int i, charno;
for(i = 0; i < afm->NumofMetrics; i++) {
char *name = NULL;
if(!fgets(buf, sizeof(buf), fp)) {
ERR(psdrv, "Unexpected EOF\n");
return;
@ -71,6 +73,22 @@ static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
}
/* would carry on here to scan in BBox, name and ligs */
/* Carry on to find BBox (or actually just ascent) of Aring. This
will provide something like the lfHeight value */
else if(!strncmp("N ", item, 2)) {
name = value; /* may end in space */
}
else if(!strncmp("B ", item, 2)) {
if(name && !strncmp("Aring", name, 5)) {
float llx, lly, urx, ury;
llx = lly = urx = ury = 0.0;
sscanf(value, "%f%f%f%f", &llx, &lly, &urx, &ury);
afm->FullAscender = ury;
}
}
}
}
@ -100,7 +118,7 @@ static AFM *PSDRV_AFMParse(char const *file)
return NULL;
}
afm = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AFM));
afm = HeapAlloc(PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(AFM));
if(!afm) {
fclose(fp);
return NULL;
@ -118,17 +136,17 @@ static AFM *PSDRV_AFMParse(char const *file)
value++;
if(!strncmp("FontName", buf, 8)) {
afm->FontName = HEAP_strdupA(GetProcessHeap(), 0, value);
afm->FontName = HEAP_strdupA(PSDRV_Heap, 0, value);
continue;
}
if(!strncmp("FullName", buf, 8)) {
afm->FullName = HEAP_strdupA(GetProcessHeap(), 0, value);
afm->FullName = HEAP_strdupA(PSDRV_Heap, 0, value);
continue;
}
if(!strncmp("FamilyName", buf, 10)) {
afm->FamilyName = HEAP_strdupA(GetProcessHeap(), 0, value);
afm->FamilyName = HEAP_strdupA(PSDRV_Heap, 0, value);
continue;
}
@ -205,24 +223,81 @@ static AFM *PSDRV_AFMParse(char const *file)
continue;
}
}
}
fclose(fp);
if(afm->Ascender == 0.0) afm->Ascender = 1000.0;
if(afm->Ascender == 0.0)
afm->Ascender = afm->FontBBox.ury;
if(afm->Descender == 0.0)
afm->Descender = afm->FontBBox.lly;
if(afm->FullAscender == 0.0)
afm->FullAscender = afm->Ascender;
return afm;
}
/***********************************************************
*
* PSDRV_FreeAFMList
*
* Frees the family and afmlistentry structures in list head
*/
void PSDRV_FreeAFMList( FONTFAMILY *head )
{
AFMLISTENTRY *afmle, *nexta;
FONTFAMILY *family, *nextf;
for(nextf = family = head; nextf; family = nextf) {
for(nexta = afmle = family->afmlist; nexta; afmle = nexta) {
nexta = afmle->next;
HeapFree( PSDRV_Heap, 0, afmle );
}
nextf = family->next;
HeapFree( PSDRV_Heap, 0, family );
}
return;
}
/***********************************************************
*
* PSDRV_FindAFMinList
* Returns ptr to an AFM if name (which is a PS font name) exists in list
* headed by head.
*/
AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name)
{
FONTFAMILY *family;
AFMLISTENTRY *afmle;
for(family = head; family; family = family->next) {
for(afmle = family->afmlist; afmle; afmle = afmle->next) {
if(!strcmp(afmle->afm->FontName, name))
return afmle->afm;
}
}
return NULL;
}
/***********************************************************
*
* PSDRV_AddAFMtoList
*
* Adds an afm to the current font list. Creates new family node if necessary.
* Adds an afm to the list whose head is pointed to by head. Creates new
* family node if necessary and always creates a new AFMLISTENTRY.
*/
static void PSDRV_AddAFMtoList(AFM *afm)
void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm)
{
FontFamily *family = PSDRV_AFMFontList;
FontFamily **insert = &PSDRV_AFMFontList;
AFM *tmpafm;
FONTFAMILY *family = *head;
FONTFAMILY **insert = head;
AFMLISTENTRY *tmpafmle, *newafmle;
newafmle = HeapAlloc(PSDRV_Heap, HEAP_ZERO_MEMORY,
sizeof(*newafmle));
newafmle->afm = afm;
while(family) {
if(!strcmp(family->FamilyName, afm->FamilyName))
@ -230,22 +305,22 @@ static void PSDRV_AddAFMtoList(AFM *afm)
insert = &(family->next);
family = family->next;
}
if(!family) {
family = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
family = HeapAlloc(PSDRV_Heap, HEAP_ZERO_MEMORY,
sizeof(*family));
*insert = family;
family->FamilyName = HEAP_strdupA(GetProcessHeap(), 0,
family->FamilyName = HEAP_strdupA(PSDRV_Heap, 0,
afm->FamilyName);
family->afm = afm;
family->afmlist = newafmle;
return;
}
tmpafm = family->afm;
while(tmpafm->next)
tmpafm = tmpafm->next;
tmpafmle = family->afmlist;
while(tmpafmle->next)
tmpafmle = tmpafmle->next;
tmpafm->next = afm;
tmpafmle->next = newafmle;
return;
}
@ -263,7 +338,7 @@ void *user)
afm = PSDRV_AFMParse(value);
if(afm)
PSDRV_AddAFMtoList(afm);
PSDRV_AddAFMtoList(&PSDRV_AFMFontList, afm);
return;
}
@ -275,13 +350,13 @@ void *user)
*/
static void PSDRV_DumpFontList(void)
{
FontFamily *family;
AFM *afm;
FONTFAMILY *family;
AFMLISTENTRY *afmle;
for(family = PSDRV_AFMFontList; family; family = family->next) {
TRACE(psdrv, "Family '%s'\n", family->FamilyName);
for(afm = family->afm; afm; afm = afm->next) {
TRACE(psdrv, "\tFontName '%s'\n", afm->FontName);
for(afmle = family->afmlist; afmle; afmle = afmle->next) {
TRACE(psdrv, "\tFontName '%s'\n", afmle->afm->FontName);
}
}
return;

View File

@ -1,7 +1,7 @@
/*
* Exported functions from the Postscript driver.
* Exported functions from the PostScript driver.
*
* [Ext]DeviceMode, DeviceCapabilities.
* [Ext]DeviceMode, DeviceCapabilities, AdvancedSetupDialog.
*
* Will need ExtTextOut for winword6 (urgh!)
*
@ -9,51 +9,171 @@
*
*/
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include <windows.h>
#include <psdrv.h>
#include <debug.h>
#include <resource.h>
#include <string.h>
#include <win.h>
#include <print.h>
static DEVMODE16 DefaultDevMode =
{
/* dmDeviceName */ "Wine Postscript Driver",
/* dmSpecVersion */ 0x30a,
/* dmDriverVersion */ 0x001,
/* dmSize */ sizeof(DEVMODE16),
/* dmDriverExtra */ 0,
/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_PAPERLENGTH |
DM_PAPERWIDTH,
/* dmOrientation */ DMORIENT_PORTRAIT,
/* dmPaperSize */ DMPAPER_A4,
/* dmPaperLength */ 2930,
/* dmPaperWidth */ 2000,
/* dmScale */ 0,
/* dmCopies */ 0,
/* dmDefaultSource */ 0,
/* dmPrintQuality */ 0,
/* dmColor */ 0,
/* dmDuplex */ 0,
/* dmYResolution */ 0,
/* dmTTOption */ 0,
/* dmCollate */ 0,
/* dmFormName */ "",
/* dmUnusedPadding */ 0,
/* dmBitsPerPel */ 0,
/* dmPelsWidth */ 0,
/* dmPelsHeight */ 0,
/* dmDisplayFlags */ 0,
/* dmDisplayFrequency */ 0
};
static char PaperNames[][64] = {"My A4"};
static WORD Papers[] = {DMPAPER_A4};
static POINT16 PaperSizes[] = {{2110, 2975}};
static char BinNames[][24] = {"My Bin"};
static WORD Bins[] = {DMBIN_AUTO};
static LONG Resolutions[][2] = { {600,600} };
/************************************************************************
*
* PSDRV_MergeDevmodes
*
* Updates dm1 with some fields from dm2
*
*/
void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
PRINTERINFO *pi)
{
/* some sanity checks here on dm2 */
if(dm2->dmPublic.dmFields & DM_ORIENTATION)
dm1->dmPublic.dmOrientation = dm2->dmPublic.dmOrientation;
/* NB PaperWidth is always < PaperLength */
if(dm2->dmPublic.dmFields & DM_PAPERSIZE) {
PAGESIZE *page;
for(page = pi->ppd->PageSizes; page; page = page->next) {
if(page->WinPage == dm2->dmPublic.dmPaperSize)
break;
}
if(page) {
dm1->dmPublic.dmPaperSize = dm2->dmPublic.dmPaperSize;
dm1->dmPublic.dmPaperWidth = page->PaperDimension->x * 25.4 / 72.0;
dm1->dmPublic.dmPaperLength = page->PaperDimension->y * 25.4 / 72.0;
TRACE(psdrv, "Changing page to %s %d x %d\n", page->FullName,
dm1->dmPublic.dmPaperWidth, dm1->dmPublic.dmPaperLength );
} else {
TRACE(psdrv, "Trying to change to unsupported pagesize %d\n",
dm2->dmPublic.dmPaperSize);
}
}
if(dm2->dmPublic.dmFields & DM_DEFAULTSOURCE) {
INPUTSLOT *slot;
for(slot = pi->ppd->InputSlots; slot; slot = slot->next) {
if(slot->WinBin == dm2->dmPublic.dmDefaultSource)
break;
}
if(slot) {
dm1->dmPublic.dmDefaultSource = dm2->dmPublic.dmDefaultSource;
TRACE(psdrv, "Changing bin to '%s'\n", slot->FullName);
} else {
TRACE(psdrv, "Trying to change to unsupported bin %d\n",
dm2->dmPublic.dmDefaultSource);
}
}
/* etc */
return;
}
#if 0
/*******************************************************************
*
* PSDRV_NewPrinterDlgProc32
*
*
*/
LRESULT WINAPI PSDRV_NewPrinterDlgProc32(HWND32 hWnd, UINT32 wMsg,
WPARAM32 wParam, LPARAM lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
TRACE(psdrv,"WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow32(hWnd, SW_SHOWNORMAL);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
EndDialog32(hWnd, TRUE);
return TRUE;
case IDCANCEL:
EndDialog32(hWnd, FALSE);
return TRUE;
default:
return FALSE;
}
default:
return FALSE;
}
}
LRESULT WINAPI PSDRV_AdvancedSetupDlgProc32(HWND32 hWnd, UINT32 wMsg,
WPARAM32 wParam, LPARAM lParam)
{
switch (wMsg) {
case WM_INITDIALOG:
TRACE(psdrv,"WM_INITDIALOG lParam=%08lX\n", lParam);
SendDlgItemMessage32A(hWnd, 99, CB_ADDSTRING32, 0,
(LPARAM)"Default Tray");
ShowWindow32(hWnd, SW_SHOWNORMAL);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
EndDialog32(hWnd, TRUE);
return TRUE;
case IDCANCEL:
EndDialog32(hWnd, FALSE);
return TRUE;
case 200:
DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
SYSRES_GetResPtr( SYSRES_DIALOG_PSDRV_NEWPRINTER ),
hWnd, PSDRV_NewPrinterDlgProc32, (LPARAM) NULL );
return TRUE;
default:
return FALSE;
}
default:
return FALSE;
}
}
#endif /* 0 */
/**************************************************************
*
* PSDRV_AdvancedSetupDialog16 [WINEPS.93]
*
* Presumably dev1 and dev2 are in and out, don't know which is which yet.
* Not sure about return value either. (I haven't got any docs on this at all)
*
*/
INT16 WINAPI PSDRV_AdvancedSetupDialog16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODE16 dev1, LPDEVMODE16 dev2 )
{
TRACE(psdrv, "hwnd = %04x, hDriver = %04x dev1=%p dev2=%p\n", hwnd,
hDriver, dev1, dev2);
return IDCANCEL;
#if 0
return DialogBoxIndirectParam32A( WIN_GetWindowInstance( hwnd ),
SYSRES_GetResPtr( SYSRES_DIALOG_PSDRV_ADVANCEDSETUP ),
hwnd, PSDRV_AdvancedSetupDlgProc32, (LPARAM) NULL );
#endif
}
/***************************************************************
*
* PSDRV_ExtDeviceMode16 [WINEPS.90]
@ -64,6 +184,7 @@ INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODE16 lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODE16 lpdmInput, LPSTR lpszProfile, WORD fwMode)
{
PRINTERINFO *pi = PSDRV_FindPrinterInfo(lpszDevice);
TRACE(psdrv,
"(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
@ -71,14 +192,23 @@ hwnd, hDriver, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile,
fwMode);
if(!fwMode)
return sizeof(DefaultDevMode);
return sizeof(DEVMODE16); /* Just copy dmPublic bit of PSDRV_DEVMODE */
if(fwMode & DM_COPY)
memcpy(lpdmOutput, &DefaultDevMode, sizeof(DefaultDevMode));
if((fwMode & DM_PROMPT) || (fwMode & DM_UPDATE))
FIXME(psdrv, "Mode %d not implemented\n", fwMode);
if(fwMode & DM_MODIFY) {
TRACE(psdrv, "DM_MODIFY set. devIn->dmFields = %08lx\n", lpdmInput->dmFields);
PSDRV_MergeDevmodes(pi->Devmode, (PSDRV_DEVMODE16 *)lpdmInput, pi);
}
if(fwMode & DM_COPY) {
memcpy(lpdmOutput, pi->Devmode, sizeof(DEVMODE16));
}
return IDOK;
}
/***************************************************************
*
* PSDRV_DeviceCapabilities16 [WINEPS.91]
@ -87,37 +217,84 @@ fwMode);
DWORD WINAPI PSDRV_DeviceCapabilities16(LPSTR lpszDevice, LPSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput, LPDEVMODE16 lpdm)
{
TRACE(psdrv, "Cap=%d\n", fwCapability);
PRINTERINFO *pi;
pi = PSDRV_FindPrinterInfo(lpszDevice);
TRACE(psdrv, "Cap=%d. Got PrinterInfo = %p\n", fwCapability, pi);
switch(fwCapability) {
case DC_PAPERS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Papers, sizeof(Papers));
return sizeof(Papers) / sizeof(WORD);
{
PAGESIZE *ps;
WORD *wp = (WORD *)lpszOutput;
int i = 0;
for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
if(lpszOutput != NULL)
*wp++ = ps->WinPage;
return i;
}
case DC_PAPERSIZE:
if(lpszOutput != NULL)
memcpy(lpszOutput, PaperSizes, sizeof(PaperSizes));
return sizeof(PaperSizes) / sizeof(POINT16);
{
PAGESIZE *ps;
POINT16 *pt = (POINT16 *)lpszOutput;
int i = 0;
case DC_BINS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Bins, sizeof(Bins));
return sizeof(Bins) / sizeof(WORD);
case DC_BINNAMES:
if(lpszOutput != NULL)
memcpy(lpszOutput, BinNames, sizeof(BinNames));
return sizeof(BinNames) / sizeof(BinNames[0]);
for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
if(lpszOutput != NULL) {
pt->x = ps->PaperDimension->x * 254.0 / 72.0;
pt->y = ps->PaperDimension->y * 254.0 / 72.0;
pt++;
}
return i;
}
case DC_PAPERNAMES:
if(lpszOutput != NULL)
memcpy(lpszOutput, PaperNames, sizeof(PaperNames));
return sizeof(PaperNames) / sizeof(PaperNames[0]);
{
PAGESIZE *ps;
char *cp = lpszOutput;
int i = 0;
for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++)
if(lpszOutput != NULL) {
strncpy(cp, ps->FullName, 64);
*(cp + 63) = '\0';
cp += 64;
}
return i;
}
case DC_ORIENTATION:
return 90;
return pi->ppd->LandscapeOrientation ? pi->ppd->LandscapeOrientation : 90;
case DC_BINS:
{
INPUTSLOT *slot;
WORD *wp = (WORD *)lpszOutput;
int i = 0;
for(slot = pi->ppd->InputSlots; slot; slot = slot->next, i++)
if(lpszOutput != NULL)
*wp++ = slot->WinBin;
return i;
}
case DC_BINNAMES:
{
INPUTSLOT *slot;
char *cp = lpszOutput;
int i = 0;
for(slot = pi->ppd->InputSlots; slot; slot = slot->next, i++)
if(lpszOutput != NULL) {
strncpy(cp, slot->FullName, 24);
*(cp + 23) = '\0';
cp += 24;
}
return i;
}
case DC_ENUMRESOLUTIONS:
if(lpszOutput != NULL)

View File

@ -1,5 +1,5 @@
/*
* Postscript driver Escape function
* PostScript driver Escape function
*
* Copyright 1998 Huw D M Davies
*/

View File

@ -1,5 +1,5 @@
/*
* Postscript driver font functions
* PostScript driver font functions
*
* Copyright 1998 Huw D M Davies
*
@ -22,8 +22,9 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
LOGFONT16 *lf = &(font->logfont);
BOOL32 bd = FALSE, it = FALSE;
AFMLISTENTRY *afmle;
AFM *afm;
FontFamily *family;
FONTFAMILY *family;
char FaceName[LF_FACESIZE];
@ -69,39 +70,42 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
}
}
for(family = PSDRV_AFMFontList; family; family = family->next) {
for(family = physDev->pi->Fonts; family; family = family->next) {
if(!lstrncmp32A(FaceName, family->FamilyName,
strlen(family->FamilyName)))
break;
}
if(!family)
family = PSDRV_AFMFontList;
family = physDev->pi->Fonts;
for(afm = family->afm; afm; afm = afm->next) {
if( (bd == (afm->Weight == FW_BOLD)) &&
(it == (afm->ItalicAngle != 0.0)) )
for(afmle = family->afmlist; afmle; afmle = afmle->next) {
if( (bd == (afmle->afm->Weight == FW_BOLD)) &&
(it == (afmle->afm->ItalicAngle != 0.0)) )
break;
}
if(!afm)
afm = family->afm; /* not ideal */
if(!afmle)
afmle = family->afmlist; /* not ideal */
physDev->font.afm = afm;
physDev->font.size = YLSTODS(dc, lf->lfHeight);
if(physDev->font.size < 0) {
TRACE(psdrv, "physDev->font.size < 0\n");
physDev->font.size = abs(physDev->font.size);
TRACE(psdrv, "physDev->font.size now %d\n", physDev->font.size);
}
physDev->font.scale = physDev->font.size /
(afm->Ascender - afm->Descender);
afm = afmle->afm;
physDev->font.afm = afm;
physDev->font.tm.tmHeight = YLSTODS(dc, lf->lfHeight);
if(physDev->font.tm.tmHeight < 0) {
physDev->font.tm.tmHeight *= - (afm->FullAscender - afm->Descender) /
(afm->Ascender - afm->Descender);
TRACE(psdrv, "Fixed -ve height to %d\n", physDev->font.tm.tmHeight);
}
physDev->font.size = physDev->font.tm.tmHeight * 1000.0 /
(afm->FullAscender - afm->Descender);
physDev->font.scale = physDev->font.size / 1000.0;
physDev->font.escapement = lf->lfEscapement;
physDev->font.tm.tmHeight = physDev->font.size;
physDev->font.tm.tmAscent = afm->Ascender * physDev->font.scale;
physDev->font.tm.tmAscent = afm->FullAscender * physDev->font.scale;
physDev->font.tm.tmDescent = -afm->Descender * physDev->font.scale;
physDev->font.tm.tmInternalLeading = physDev->font.tm.tmHeight * 0.2;
physDev->font.tm.tmExternalLeading = physDev->font.tm.tmHeight * 0.2;
physDev->font.tm.tmInternalLeading = (afm->FullAscender - afm->Ascender)
* physDev->font.scale;
physDev->font.tm.tmExternalLeading = (1000.0 - afm->FullAscender)
* physDev->font.scale; /* ?? */
physDev->font.tm.tmAveCharWidth = afm->CharWidths[120] * /* x */
physDev->font.scale;
physDev->font.tm.tmMaxCharWidth = afm->CharWidths[77] * /* M */
@ -124,10 +128,14 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
physDev->font.set = FALSE;
TRACE(psdrv, "Selected PS font '%s' size %d weight %d\n",
TRACE(psdrv, "Selected PS font '%s' size %d weight %d.\n",
physDev->font.afm->FontName, physDev->font.size,
physDev->font.tm.tmWeight );
TRACE(psdrv, "H = %d As = %d Des = %d IL = %d EL = %d\n",
physDev->font.tm.tmHeight, physDev->font.tm.tmAscent,
physDev->font.tm.tmDescent, physDev->font.tm.tmInternalLeading,
physDev->font.tm.tmExternalLeading);
return prevfont;
}
@ -156,10 +164,12 @@ BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
size->cy = YDSTOLS(dc, physDev->font.tm.tmHeight);
width = 0.0;
for(i = 0; i < count && str[i]; i++)
for(i = 0; i < count && str[i]; i++) {
width += physDev->font.afm->CharWidths[ (UINT32)str[i] ];
TRACE(psdrv, "Width after %dth char '%c' = %f\n", i, str[i], width);
}
width *= physDev->font.scale;
TRACE(psdrv, "Width after scale (%f) is %f\n", physDev->font.scale, width);
size->cx = XDSTOLS(dc, width);
return TRUE;
@ -189,12 +199,13 @@ static UINT32 PSDRV_GetFontMetric(DC *dc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
ENUMLOGFONTEX16 *pLF, INT16 size)
{
float scale = size / (pafm->FullAscender - pafm->Descender);
memset( pLF, 0, sizeof(*pLF) );
memset( pTM, 0, sizeof(*pTM) );
#define plf ((LPLOGFONT16)pLF)
plf->lfHeight = pTM->tmHeight = size;
plf->lfWidth = pTM->tmAveCharWidth = size * 0.7;
plf->lfWidth = pTM->tmAveCharWidth = pafm->CharWidths[120] * scale;
plf->lfWeight = pTM->tmWeight = pafm->Weight;
plf->lfItalic = pTM->tmItalic = pafm->ItalicAngle != 0.0;
plf->lfUnderline = pTM->tmUnderlined = 0;
@ -210,10 +221,10 @@ static UINT32 PSDRV_GetFontMetric(DC *dc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
lstrcpyn32A( plf->lfFaceName, pafm->FamilyName, LF_FACESIZE );
#undef plf
pTM->tmAscent = pTM->tmHeight * 0.2;
pTM->tmDescent = pTM->tmHeight - pTM->tmAscent;
pTM->tmInternalLeading = pTM->tmHeight * 0.2;
pTM->tmMaxCharWidth = pTM->tmHeight * 0.7;
pTM->tmAscent = pafm->FullAscender * scale;
pTM->tmDescent = -pafm->Descender * scale;
pTM->tmInternalLeading = (pafm->FullAscender - pafm->Ascender) * scale;
pTM->tmMaxCharWidth = pafm->CharWidths[77] * scale;
pTM->tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
pTM->tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
@ -234,21 +245,23 @@ BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
ENUMLOGFONTEX16 lf;
NEWTEXTMETRIC16 tm;
BOOL32 b, bRet = 0;
AFM *afm;
FontFamily *family;
AFMLISTENTRY *afmle;
FONTFAMILY *family;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if( plf->lfFaceName[0] ) {
TRACE(psdrv, "lfFaceName = '%s'\n", plf->lfFaceName);
for(family = PSDRV_AFMFontList; family; family = family->next) {
for(family = physDev->pi->Fonts; family; family = family->next) {
if(!lstrncmp32A(plf->lfFaceName, family->FamilyName,
strlen(family->FamilyName)))
break;
}
if(family) {
for(afm = family->afm; afm; afm = afm->next) {
TRACE(psdrv, "Got '%s'\n", afm->FontName);
for(afmle = family->afmlist; afmle; afmle = afmle->next) {
TRACE(psdrv, "Got '%s'\n", afmle->afm->FontName);
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
PSDRV_GetFontMetric( dc, afm, &tm, &lf, 200 ), lp )) )
PSDRV_GetFontMetric( dc, afmle->afm, &tm, &lf, 200 ),
lp )) )
bRet = b;
else break;
}
@ -256,11 +269,12 @@ BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
} else {
TRACE(psdrv, "lfFaceName = NULL\n");
for(family = PSDRV_AFMFontList; family; family = family->next) {
afm = family->afm;
TRACE(psdrv, "Got '%s'\n", afm->FontName);
for(family = physDev->pi->Fonts; family; family = family->next) {
afmle = family->afmlist;
TRACE(psdrv, "Got '%s'\n", afmle->afm->FontName);
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
PSDRV_GetFontMetric( dc, afm, &tm, &lf, 200 ), lp )) )
PSDRV_GetFontMetric( dc, afmle->afm, &tm, &lf, 200 ),
lp )) )
bRet = b;
else break;
}

View File

@ -1,5 +1,5 @@
/*
* Postscript driver graphics functions
* PostScript driver graphics functions
*
* Copyright 1998 Huw D M Davies
*
@ -71,3 +71,41 @@ BOOL32 PSDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
return TRUE;
}
/***********************************************************************
* PSDRV_Polyline
*/
BOOL32 PSDRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count )
{
INT32 i;
TRACE(psdrv, "count = %d\n", count);
PSDRV_WriteMoveTo(dc, XLPTODP(dc, pt[0].x), YLPTODP(dc, pt[0].y));
for(i = 1; i < count; i++)
PSDRV_WriteLineTo(dc, XLPTODP(dc, pt[i].x), YLPTODP(dc, pt[i].y));
PSDRV_WriteStroke(dc);
return TRUE;
}
/***********************************************************************
* PSDRV_Polygon
*/
BOOL32 PSDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count )
{
INT32 i;
TRACE(psdrv, "count = %d\n", count);
FIXME(psdrv, "Hack!\n");
PSDRV_WriteMoveTo(dc, XLPTODP(dc, pt[0].x), YLPTODP(dc, pt[0].y));
for(i = 1; i < count; i++)
PSDRV_WriteLineTo(dc, XLPTODP(dc, pt[i].x), YLPTODP(dc, pt[i].y));
if(pt[0].x != pt[count-1].x || pt[0].y != pt[count-1].y)
PSDRV_WriteLineTo(dc, XLPTODP(dc, pt[0].x), YLPTODP(dc, pt[0].y));
PSDRV_WriteStroke(dc);
return TRUE;
}

View File

@ -1,15 +1,18 @@
/*
* Postscript driver initialization functions
* PostScript driver initialization functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "gdi.h"
#include "psdrv.h"
#include "debug.h"
#include "heap.h"
#include <windows.h>
#include <gdi.h>
#include <psdrv.h>
#include <debug.h>
#include <heap.h>
#include <winreg.h>
#include <print.h>
#include <winerror.h>
static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
@ -46,9 +49,9 @@ static const DC_FUNCTIONS PSDRV_Funcs =
NULL, /* pPie */
NULL, /* pPolyPolygon */
NULL, /* pPolyPolyline */
NULL, /* pPolygon */
NULL, /* pPolyline */
NULL, /* pPolyBezier */
PSDRV_Polygon, /* pPolygon */
PSDRV_Polyline, /* pPolyline */
NULL, /* pPolyBezier */
NULL, /* pRealizePalette */
PSDRV_Rectangle, /* pRectangle */
NULL, /* pRestoreDC */
@ -88,10 +91,10 @@ static const DC_FUNCTIONS PSDRV_Funcs =
static DeviceCaps PSDRV_DevCaps = {
/* version */ 0,
/* technology */ DT_RASPRINTER,
/* horzSize */ 200,
/* vertSize */ 288,
/* horzRes */ 4733,
/* vertRes */ 6808,
/* horzSize */ 210,
/* vertSize */ 297,
/* horzRes */ 4961,
/* vertRes */ 7016,
/* bitsPixel */ 1,
/* planes */ 1,
/* numBrushes */ -1,
@ -108,7 +111,7 @@ static DeviceCaps PSDRV_DevCaps = {
/* polygoalnCaps */ PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON |
PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED |
PC_INTERIORS,
/* textCaps */ 0, /* psdrv 0x59f7 */
/* textCaps */ TC_CR_ANY, /* psdrv 0x59f7 */
/* clipCaps */ CP_RECTANGLE,
/* rasterCaps */ RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 |
RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT |
@ -124,6 +127,48 @@ static DeviceCaps PSDRV_DevCaps = {
/* palette size */ 0,
/* ..etc */ 0, 0 };
static PSDRV_DEVMODE16 DefaultDevmode =
{
{ /* dmPublic */
/* dmDeviceName */ "Wine PostScript Driver",
/* dmSpecVersion */ 0x30a,
/* dmDriverVersion */ 0x001,
/* dmSize */ sizeof(DEVMODE16),
/* dmDriverExtra */ 0,
/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_PAPERLENGTH |
DM_PAPERWIDTH | DM_SCALE | DM_COPIES |
DM_DEFAULTSOURCE | DM_COLOR | DM_DUPLEX |
DM_YRESOLUTION | DM_TTOPTION,
/* dmOrientation */ DMORIENT_PORTRAIT,
/* dmPaperSize */ DMPAPER_A4,
/* dmPaperLength */ 2969,
/* dmPaperWidth */ 2101,
/* dmScale */ 100, /* ?? */
/* dmCopies */ 1,
/* dmDefaultSource */ DMBIN_AUTO,
/* dmPrintQuality */ 0,
/* dmColor */ DMCOLOR_MONOCHROME,
/* dmDuplex */ 0,
/* dmYResolution */ 0,
/* dmTTOption */ DMTT_SUBDEV,
/* dmCollate */ 0,
/* dmFormName */ "",
/* dmUnusedPadding */ 0,
/* dmBitsPerPel */ 0,
/* dmPelsWidth */ 0,
/* dmPelsHeight */ 0,
/* dmDisplayFlags */ 0,
/* dmDisplayFrequency */ 0
},
{ /* dmDocPrivate */
},
{ /* dmDrvPrivate */
/* ppdfilename */ "default.ppd"
}
};
HANDLE32 PSDRV_Heap = 0;
/*********************************************************************
* PSDRV_Init
*
@ -132,12 +177,12 @@ static DeviceCaps PSDRV_DevCaps = {
*/
BOOL32 PSDRV_Init(void)
{
TRACE(psdrv, "\n");
PSDRV_GetFontMetrics();
return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs );
TRACE(psdrv, "\n");
PSDRV_Heap = HeapCreate(0, 0x10000, 0);
PSDRV_GetFontMetrics();
return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs );
}
/**********************************************************************
* PSDRV_CreateDC
*/
@ -145,24 +190,69 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData )
{
PSDRV_PDEVICE *physDev;
PRINTERINFO *pi = PSDRV_FindPrinterInfo(device);
DeviceCaps *devCaps;
TRACE(psdrv, "(%s %s %s %p)\n", driver, device, output, initData);
if(!PSDRV_AFMFontList) {
if(!pi->Fonts) {
MSG("To use WINEPS you need to install some AFM files.\n");
return FALSE;
}
dc->w.devCaps = &PSDRV_DevCaps;
dc->w.hVisRgn = CreateRectRgn32(0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes);
physDev = (PSDRV_PDEVICE *)HeapAlloc( GetProcessHeap(), 0,
physDev = (PSDRV_PDEVICE *)HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
sizeof(*physDev) );
if (!physDev) return FALSE;
dc->physDev = physDev;
physDev->job.output = HEAP_strdupA( GetProcessHeap(), 0, output );
if (!physDev->job.output) return FALSE;
physDev->pi = pi;
physDev->Devmode = (PSDRV_DEVMODE16 *)HeapAlloc( PSDRV_Heap, 0,
sizeof(PSDRV_DEVMODE16) );
if(!physDev->Devmode) {
HeapFree( PSDRV_Heap, 0, physDev );
return FALSE;
}
memcpy( physDev->Devmode, pi->Devmode, sizeof(PSDRV_DEVMODE16) );
if(initData) {
PSDRV_MergeDevmodes(physDev->Devmode, (PSDRV_DEVMODE16 *)initData, pi);
}
devCaps = HeapAlloc( PSDRV_Heap, 0, sizeof(PSDRV_DevCaps) );
memcpy(devCaps, &PSDRV_DevCaps, sizeof(PSDRV_DevCaps));
if(physDev->Devmode->dmPublic.dmOrientation == DMORIENT_PORTRAIT) {
devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperWidth;
devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperLength;
} else {
devCaps->horzSize = physDev->Devmode->dmPublic.dmPaperLength;
devCaps->vertSize = physDev->Devmode->dmPublic.dmPaperWidth;
}
devCaps->horzRes = physDev->pi->ppd->DefaultResolution *
devCaps->horzSize / 25.4;
devCaps->vertRes = physDev->pi->ppd->DefaultResolution *
devCaps->vertSize / 25.4;
/* Are aspect[XY] and logPixels[XY] correct? */
/* Need to handle different res in x and y => fix ppd */
devCaps->aspectX = devCaps->logPixelsX =
physDev->pi->ppd->DefaultResolution;
devCaps->aspectY = devCaps->logPixelsY =
physDev->pi->ppd->DefaultResolution;
devCaps->aspectXY = (int)hypot( (double)devCaps->aspectX,
(double)devCaps->aspectY );
/* etc */
dc->w.devCaps = devCaps;
dc->w.hVisRgn = CreateRectRgn32(0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes);
physDev->job.output = HEAP_strdupA( PSDRV_Heap, 0, output );
physDev->job.hJob = 0;
return TRUE;
}
@ -174,11 +264,71 @@ static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
static BOOL32 PSDRV_DeleteDC( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
TRACE(psdrv, "\n");
HeapFree( GetProcessHeap(), 0, physDev->job.output );
HeapFree( GetProcessHeap(), 0, physDev );
HeapFree( PSDRV_Heap, 0, physDev->Devmode );
HeapFree( PSDRV_Heap, 0, physDev->job.output );
HeapFree( PSDRV_Heap, 0, (void *)dc->w.devCaps );
HeapFree( PSDRV_Heap, 0, physDev );
dc->physDev = NULL;
return TRUE;
}
/**********************************************************************
* PSDRV_FindPrinterInfo
*/
PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
{
static PRINTERINFO *PSDRV_PrinterList;
DWORD type = REG_BINARY, needed, res;
PRINTERINFO *pi = PSDRV_PrinterList, **last = &PSDRV_PrinterList;
FONTNAME *font;
AFM *afm;
TRACE(psdrv, "'%s'\n", name);
for( ; pi; last = &pi->next, pi = pi->next) {
if(!strcmp(pi->FriendlyName, name))
return pi;
}
pi = *last = HeapAlloc( PSDRV_Heap, 0, sizeof(*pi) );
pi->FriendlyName = HEAP_strdupA( PSDRV_Heap, 0, name );
res = DrvGetPrinterData((LPSTR)name, (LPSTR)INT_PD_DEFAULT_DEVMODE, &type,
NULL, 0, &needed );
if(res == ERROR_INVALID_PRINTER_NAME) {
pi->Devmode = HeapAlloc( PSDRV_Heap, 0, sizeof(DefaultDevmode) );
memcpy(pi->Devmode, &DefaultDevmode, sizeof(DefaultDevmode) );
DrvSetPrinterData((LPSTR)name, (LPSTR)INT_PD_DEFAULT_DEVMODE,
REG_BINARY, (LPBYTE)&DefaultDevmode, sizeof(DefaultDevmode) );
/* need to do something here AddPrinter?? */
} else {
pi->Devmode = HeapAlloc( PSDRV_Heap, 0, needed );
DrvGetPrinterData((LPSTR)name, (LPSTR)INT_PD_DEFAULT_DEVMODE, &type,
(LPBYTE)pi->Devmode, needed, &needed);
}
pi->ppd = PSDRV_ParsePPD(pi->Devmode->dmDrvPrivate.ppdFileName);
pi->next = NULL;
pi->Fonts = NULL;
for(font = pi->ppd->InstalledFonts; font; font = font->next) {
afm = PSDRV_FindAFMinList(PSDRV_AFMFontList, font->Name);
if(!afm) {
MSG(
"Couldn't find AFM file for installed printer font '%s' - ignoring\n",
font->Name);
} else {
PSDRV_AddAFMtoList(&pi->Fonts, afm);
}
}
return pi;
}

View File

@ -1,5 +1,5 @@
/*
* Postscript driver object handling
* PostScript driver object handling
*
* Copyright 1998 Huw D M Davies
*

656
graphics/psdrv/ppd.c Normal file
View File

@ -0,0 +1,656 @@
/* PostScript Printer Description (PPD) file parser
*
* See http://www.adobe.com/supportservice/devrelations/PDFS/TN/5003.PPD_Spec_v4.3.pdf
*
* Copyright 1998 Huw D M Davies
*/
#include <windows.h>
#include <winnt.h> /* HEAP_ZERO_MEMORY */
#include <heap.h>
#include <debug.h>
#include <psdrv.h>
#include <string.h>
#include <ctype.h>
#include <print.h>
typedef struct {
char *key;
char *option;
char *opttrans;
char *value;
char *valtrans;
} PPDTuple;
/* map of page names in ppd file to Windows paper constants */
static struct {
char *PSName;
WORD WinPage;
} PageTrans[] = {
{"A4", DMPAPER_A4},
{"Letter", DMPAPER_LETTER},
{"Legal", DMPAPER_LEGAL},
{"Executive", DMPAPER_EXECUTIVE},
{"Comm10", DMPAPER_ENV_10},
{"Monarch", DMPAPER_ENV_MONARCH},
{"DL", DMPAPER_ENV_DL},
{"C5", DMPAPER_ENV_C5},
{"B5", DMPAPER_ENV_B5},
{NULL, 0}
};
/* the same for bin names */
static struct {
char *PSName;
WORD WinBin;
} BinTrans[] = {
{"Lower", DMBIN_LOWER},
{"Upper", DMBIN_UPPER},
{"Envelope", DMBIN_ENVELOPE},
{"LargeCapacity", DMBIN_LARGECAPACITY},
{NULL, 0}
};
/***********************************************************************
*
* PSDRV_PPDDecodeHex
*
* Copies str into a newly allocated string from the process heap subsituting
* hex strings enclosed in '<' and '>' for their byte codes.
*
*/
static char *PSDRV_PPDDecodeHex(char *str)
{
char *buf, *in, *out;
BOOL32 inhex = FALSE;
buf = HeapAlloc(PSDRV_Heap, 0, strlen(str) + 1);
if(!buf)
return NULL;
for(in = str, out = buf; *in; in++) {
if(!inhex) {
if(*in != '<')
*out++ = *in;
else
inhex = TRUE;
} else {
if(*in == '>') {
inhex = FALSE;
continue;
}
else if(isspace(*in))
continue;
else {
int i;
if(!isxdigit(*in) || !isxdigit(*(in + 1))) {
ERR(psdrv, "Invalid hex char in hex string\n");
HeapFree(PSDRV_Heap, 0, buf);
return NULL;
}
*out = 0;
for(i = 0; i < 2; i++) {
if(isdigit(*(in + i)))
*out |= (*(in + i) - '0') << ((1-i) * 4);
else
*out |= (toupper(*(in + i)) - 'A' + 10) << ((1-i) * 4);
}
out++;
in++;
}
}
}
*out = '\0';
return buf;
}
/***********************************************************************
*
* PSDRV_PPDGetTransValue
*
*/
static BOOL32 PSDRV_PPDGetTransValue(char *start, PPDTuple *tuple)
{
char *buf, *end;
end = strpbrk(start, "\r\n");
if(end == start) return FALSE;
if(!end) end = start + strlen(start);
buf = HeapAlloc( PSDRV_Heap, 0, end - start + 1 );
memcpy(buf, start, end - start);
*(buf + (end - start)) = '\0';
tuple->valtrans = PSDRV_PPDDecodeHex(buf);
HeapFree( PSDRV_Heap, 0, buf );
return TRUE;
}
/***********************************************************************
*
* PSDRV_PPDGetInvocationValue
*
* Passed string that should be surrounded by `"'s, return string alloced
* from process heap.
*/
static BOOL32 PSDRV_PPDGetInvocationValue(FILE *fp, char *pos, PPDTuple *tuple)
{
char *start, *end, *buf;
char line[257];
int len;
start = pos + 1;
buf = HeapAlloc( PSDRV_Heap, 0, strlen(start) + 1 );
len = 0;
do {
end = strchr(start, '"');
if(end) {
buf = HeapReAlloc( PSDRV_Heap, 0, buf,
len + (end - start) + 1 );
memcpy(buf + len, start, end - start);
*(buf + len + (end - start)) = '\0';
tuple->value = buf;
start = strchr(end, '/');
if(start)
return PSDRV_PPDGetTransValue(start + 1, tuple);
return TRUE;
} else {
int sl = strlen(start);
buf = HeapReAlloc( PSDRV_Heap, 0, buf, len + sl + 1 );
strcpy(buf + len, start);
len += sl;
}
} while( fgets((start = line), sizeof(line), fp) );
tuple->value = NULL;
HeapFree( PSDRV_Heap, 0, buf );
return FALSE;
}
/***********************************************************************
*
* PSDRV_PPDGetQuotedValue
*
* Passed string that should be surrounded by `"'s. Expand <xx> as hex
* return string alloced from process heap.
*/
static BOOL32 PSDRV_PPDGetQuotedValue(FILE *fp, char *pos, PPDTuple *tuple)
{
char *buf;
if(!PSDRV_PPDGetInvocationValue(fp, pos, tuple))
return FALSE;
buf = PSDRV_PPDDecodeHex(tuple->value);
HeapFree(PSDRV_Heap, 0, tuple->value);
tuple->value = buf;
return TRUE;
}
/***********************************************************************
*
* PSDRV_PPDGetStringValue
*
* Just strip leading white space.
*/
static BOOL32 PSDRV_PPDGetStringValue(char *str, PPDTuple *tuple)
{
char *start = str, *end;
while(*start != '\0' && isspace(*start))
start++;
end = strpbrk(start, "/\r\n");
if(!end) end = start + strlen(start);
tuple->value = HeapAlloc( PSDRV_Heap, 0, (end - start) + 1 );
memcpy(tuple->value, start, end - start);
*(tuple->value + (end - start)) = '\0';
if(*end == '/')
PSDRV_PPDGetTransValue(end + 1, tuple);
return TRUE;
}
/***********************************************************************
*
* PSDRV_PPDSymbolValue
*
* Not implemented yet.
*/
static BOOL32 PSDRV_PPDGetSymbolValue(char *pos, PPDTuple *tuple)
{
FIXME(psdrv, "Stub\n");
return FALSE;
}
/*********************************************************************
*
* PSDRV_PPDGetNextTuple
*
* Gets the next Keyword Option Value tuple from the file. Allocs space off
* the process heap which should be free()ed by the caller if not needed.
*/
static BOOL32 PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple)
{
char line[257], *opt = NULL, *cp, *trans;
BOOL32 gotoption = TRUE;
memset(tuple, 0, sizeof(*tuple));
do {
if(!fgets(line, sizeof(line), fp))
return FALSE;
if(line[0] == '*' && line[1] != '%' && strncmp(line, "*End", 4))
break;
} while(1);
if(line[strlen(line)-1] != '\n') {
ERR(psdrv, "Line too long.\n");
return FALSE;
}
for(cp = line; !isspace(*cp); cp++)
;
if(*(cp-1) == ':') {
cp--;
gotoption = FALSE;
} else {
opt = cp;
}
tuple->key = HeapAlloc( PSDRV_Heap, 0, cp - line + 1 );
if(!tuple->key) return FALSE;
memcpy(tuple->key, line, cp - line);
tuple->key[cp - line] = '\0';
if(gotoption) {
while(isspace(*opt))
opt++;
cp = strpbrk(opt, ":/");
if(!cp) {
ERR(psdrv, "Error in line '%s'?\n", line);
return FALSE;
}
tuple->option = HeapAlloc( PSDRV_Heap, 0, cp - opt + 1 );
if(!tuple->option) return FALSE;
memcpy(tuple->option, opt, cp - opt);
tuple->option[cp - opt] = '\0';
if(*cp == '/') {
char *buf;
trans = cp + 1;
cp = strchr(trans, ':');
if(!cp) {
ERR(psdrv, "Error in line '%s'?\n", line);
return FALSE;
}
buf = HeapAlloc( PSDRV_Heap, 0, cp - trans + 1 );
if(!buf) return FALSE;
memcpy(buf, trans, cp - trans);
buf[cp - trans] = '\0';
tuple->opttrans = PSDRV_PPDDecodeHex(buf);
HeapFree( PSDRV_Heap, 0, buf );
}
}
while(!isspace(*cp))
cp++;
while(isspace(*cp))
cp++;
switch(*cp) {
case '"':
if( (!gotoption && strncmp(tuple->key, "*?", 2) ) ||
!strncmp(tuple->key, "*JCL", 4))
PSDRV_PPDGetQuotedValue(fp, cp, tuple);
else
PSDRV_PPDGetInvocationValue(fp, cp, tuple);
break;
case '^':
PSDRV_PPDGetSymbolValue(cp, tuple);
break;
default:
PSDRV_PPDGetStringValue(cp, tuple);
}
return TRUE;
}
/*********************************************************************
*
* PSDRV_PPDGetPageSizeInfo
*
* Searches ppd PageSize list to return entry matching name or creates new
* entry which is appended to the list if name is not found.
*
*/
PAGESIZE *PSDRV_PPDGetPageSizeInfo(PPD *ppd, char *name)
{
PAGESIZE *page = ppd->PageSizes, *lastpage;
if(!page) {
page = ppd->PageSizes = HeapAlloc( PSDRV_Heap,
HEAP_ZERO_MEMORY, sizeof(*page) );
return page;
} else {
for( ; page; page = page->next) {
if(!strcmp(page->Name, name))
return page;
lastpage = page;
}
lastpage->next = HeapAlloc( PSDRV_Heap,
HEAP_ZERO_MEMORY, sizeof(*page) );
return lastpage->next;
}
}
/**********************************************************************
*
* PSDRV_PPDGetWord
*
* Returns ptr alloced from heap to first word in str. Strips leading spaces.
* Puts ptr to next word in next
*/
static char *PSDRV_PPDGetWord(char *str, char **next)
{
char *start, *end, *ret;
start = str;
while(start && *start && isspace(*start))
start++;
if(!start || !*start) return FALSE;
end = start;
while(*end && !isspace(*end))
end++;
ret = HeapAlloc( PSDRV_Heap, 0, end - start + 1 );
memcpy(ret, start, end - start );
*(ret + (end - start)) = '\0';
while(*end && isspace(*end))
end++;
if(*end)
*next = end;
else
*next = NULL;
return ret;
}
/***********************************************************************
*
* PSDRV_ParsePPD
*
*
*/
PPD *PSDRV_ParsePPD(char *fname)
{
FILE *fp;
PPD *ppd;
PPDTuple tuple;
TRACE(psdrv, "%s\n", fname);
if((fp = fopen(fname, "r")) == NULL)
return NULL;
ppd = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*ppd));
if(!ppd) {
ERR(psdrv, "Unable to allocate memory for ppd\n");
fclose(fp);
return NULL;
}
while( PSDRV_PPDGetNextTuple(fp, &tuple)) {
if(!strcmp("*NickName", tuple.key)) {
ppd->NickName = tuple.value;
tuple.value = NULL;
TRACE(psdrv, "NickName = '%s'\n", ppd->NickName);
}
else if(!strcmp("*LanguageLevel", tuple.key)) {
sscanf(tuple.value, "%d", &(ppd->LanguageLevel));
TRACE(psdrv, "LanguageLevel = %d\n", ppd->LanguageLevel);
}
else if(!strcmp("*ColorDevice", tuple.key)) {
if(!strcasecmp(tuple.value, "true"))
ppd->ColorDevice = TRUE;
TRACE(psdrv, "ColorDevice = %d\n", (int)ppd->ColorDevice);
}
else if(!strcmp("*DefaultResolution", tuple.key)) {
sscanf(tuple.value, "%d", &(ppd->DefaultResolution));
TRACE(psdrv, "DefaultResolution = %d\n", ppd->DefaultResolution);
}
else if(!strcmp("*Font", tuple.key)) {
FONTNAME *fn;
for(fn = ppd->InstalledFonts; fn && fn->next; fn = fn->next)
;
if(!fn) {
ppd->InstalledFonts = HeapAlloc(PSDRV_Heap,
HEAP_ZERO_MEMORY, sizeof(*fn));
fn = ppd->InstalledFonts;
} else {
fn->next = HeapAlloc(PSDRV_Heap,
HEAP_ZERO_MEMORY, sizeof(*fn));
fn = fn->next;
}
fn->Name = tuple.option;
tuple.option = NULL;
}
else if(!strcmp("*DefaultFont", tuple.key)) {
ppd->DefaultFont = tuple.value;
tuple.value = NULL;
}
else if(!strcmp("*JCLBegin", tuple.key)) {
ppd->JCLBegin = tuple.value;
tuple.value = NULL;
}
else if(!strcmp("*JCLToPSInterpreter", tuple.key)) {
ppd->JCLToPSInterpreter = tuple.value;
tuple.value = NULL;
}
else if(!strcmp("*JCLEnd", tuple.key)) {
ppd->JCLEnd = tuple.value;
tuple.value = NULL;
}
else if(!strcmp("*PageSize", tuple.key)) {
PAGESIZE *page;
page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option);
if(!page->Name) {
int i;
page->Name = tuple.option;
tuple.option = NULL;
for(i = 0; PageTrans[i].PSName; i++) {
if(!strcmp(PageTrans[i].PSName, page->Name)) { /* case ? */
page->WinPage = PageTrans[i].WinPage;
break;
}
}
if(!page->WinPage)
FIXME(psdrv, "Can't find Windows page type for '%s'\n",
page->Name);
}
if(!page->FullName) {
page->FullName = tuple.opttrans;
tuple.opttrans = NULL;
}
if(!page->InvocationString) {
page->InvocationString = tuple.value;
tuple.value = NULL;
}
}
else if(!strcmp("*ImageableArea", tuple.key)) {
PAGESIZE *page;
page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option);
if(!page->Name) {
page->Name = tuple.option;
tuple.option = NULL;
}
if(!page->FullName) {
page->FullName = tuple.opttrans;
tuple.opttrans = NULL;
}
#define PIA page->ImageableArea
if(!PIA) {
PIA = HeapAlloc( PSDRV_Heap, 0, sizeof(*PIA) );
sscanf(tuple.value, "%f%f%f%f", &PIA->llx, &PIA->lly,
&PIA->urx, &PIA->ury);
}
#undef PIA
}
else if(!strcmp("*PaperDimension", tuple.key)) {
PAGESIZE *page;
page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option);
if(!page->Name) {
page->Name = tuple.option;
tuple.option = NULL;
}
if(!page->FullName) {
page->FullName = tuple.opttrans;
tuple.opttrans = NULL;
}
#define PD page->PaperDimension
if(!PD) {
PD = HeapAlloc( PSDRV_Heap, 0, sizeof(*PD) );
sscanf(tuple.value, "%f%f", &PD->x, &PD->y);
}
#undef PD
}
else if(!strcmp("*LandscapeOrientation", tuple.key)) {
if(!strcmp(tuple.value, "Plus90"))
ppd->LandscapeOrientation = 90;
else if(!strcmp(tuple.value, "Minus90"))
ppd->LandscapeOrientation = 270;
/* anything else, namely 'any', leaves value at 0 */
TRACE(psdrv, "LandscapeOrientation = %d\n",
ppd->LandscapeOrientation);
}
else if(!strcmp("*UIConstraints", tuple.key)) {
char *start;
CONSTRAINT *con, **insert = &ppd->Constraints;
while(*insert)
insert = &((*insert)->next);
con = *insert = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
sizeof(*con) );
start = tuple.value;
con->Feature1 = PSDRV_PPDGetWord(start, &start);
con->Value1 = PSDRV_PPDGetWord(start, &start);
con->Feature2 = PSDRV_PPDGetWord(start, &start);
con->Value2 = PSDRV_PPDGetWord(start, &start);
}
else if(!strcmp("*InputSlot", tuple.key)) {
INPUTSLOT *slot, **insert = &ppd->InputSlots;
int i;
while(*insert)
insert = &((*insert)->next);
slot = *insert = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
sizeof(*slot) );
slot->Name = tuple.option;
tuple.option = NULL;
if(tuple.opttrans) {
slot->FullName = tuple.opttrans;
tuple.opttrans = NULL;
}
if(tuple.value) {
slot->InvocationString = tuple.value;
tuple.value = NULL;
}
for(i = 0; BinTrans[i].PSName; i++) {
if(!strcmp(BinTrans[i].PSName, slot->Name)) { /* case ? */
slot->WinBin = BinTrans[i].WinBin;
break;
}
}
if(!slot->WinBin)
FIXME(psdrv, "Can't find Windows bin type for '%s'\n",
slot->Name);
}
if(tuple.key) HeapFree(PSDRV_Heap, 0, tuple.key);
if(tuple.option) HeapFree(PSDRV_Heap, 0, tuple.option);
if(tuple.value) HeapFree(PSDRV_Heap, 0, tuple.value);
if(tuple.opttrans) HeapFree(PSDRV_Heap, 0, tuple.opttrans);
if(tuple.valtrans) HeapFree(PSDRV_Heap, 0, tuple.valtrans);
}
{
FONTNAME *fn;
PAGESIZE *page;
CONSTRAINT *con;
INPUTSLOT *slot;
for(fn = ppd->InstalledFonts; fn; fn = fn->next)
TRACE(psdrv, "'%s'\n", fn->Name);
for(page = ppd->PageSizes; page; page = page->next) {
TRACE(psdrv, "'%s' aka '%s' (%d) invoked by '%s'\n", page->Name,
page->FullName, page->WinPage, page->InvocationString);
if(page->ImageableArea)
TRACE(psdrv, "Area = %.2f,%.2f - %.2f, %.2f\n",
page->ImageableArea->llx, page->ImageableArea->lly,
page->ImageableArea->urx, page->ImageableArea->ury);
if(page->PaperDimension)
TRACE(psdrv, "Dimension = %.2f x %.2f\n",
page->PaperDimension->x, page->PaperDimension->y);
}
for(con = ppd->Constraints; con; con = con->next)
TRACE(psdrv, "%s %s %s %s\n", con->Feature1, con->Value1,
con->Feature2, con->Value2);
for(slot = ppd->InputSlots; slot; slot = slot->next)
TRACE(psdrv, "Slot '%s' Name '%s' (%d) Invocation '%s'\n",
slot->Name, slot->FullName, slot->WinBin,
slot->InvocationString);
}
return ppd;
}

View File

@ -1,20 +1,21 @@
/*
* Postscript output functions
* PostScript output functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "print.h"
#include "debug.h"
#include <windows.h>
#include <psdrv.h>
#include <print.h>
#include <debug.h>
#include <ctype.h>
char psheader[] = /* title */
char psheader[] = /* title llx lly urx ury */
"%%!PS-Adobe-3.0 (not quite)\n"
"%%%%Creator: Wine Postscript Driver\n"
"%%%%Creator: Wine PostScript Driver\n"
"%%%%Title: %s\n"
"%%%%BoundingBox: 0 0 595 842\n"
"%%%%BoundingBox: %d %d %d %d\n"
"%%%%Pages: (atend)\n"
"%%%%EndComments\n"
"%%%%BeginProlog\n"
@ -27,9 +28,21 @@ char psheader[] = /* title */
"end\n"
"definefont pop\n"
"} bind def\n"
"%%%%EndProlog\n"
"%%%%BeginSetup\n"
"%%%%EndSetup\n";
"%%%%EndProlog\n";
char psbeginsetup[] =
"%%BeginSetup\n";
char psendsetup[] =
"%%EndSetup\n";
char psbeginfeature[] = /* feature, value */
"mark {\n"
"%%%%BeginFeature: %s %s\n";
char psendfeature[] =
"\n%%EndFeature\n"
"} stopped cleartomark\n";
char psnewpage[] = /* name, number */
"%%%%Page: %s %d\n"
@ -73,7 +86,7 @@ char psshow[] = /* string */
char pssetfont[] = /* fontname, xscale, yscale, ascent, escapement */
"/%s findfont\n"
"[%d 0 0 %d 0 %d]\n"
"[%d 0 0 %d 0 0]\n"
"%d 10 div matrix rotate\n"
"matrix concatmatrix\n"
"makefont setfont\n";
@ -96,13 +109,35 @@ int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch)
}
INT32 PSDRV_WriteFeature(HANDLE16 hJob, char *feature, char *value,
char *invocation)
{
char *buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psheader) +
strlen(feature) + strlen(value));
wsprintf32A(buf, psbeginfeature, feature, value);
WriteSpool( hJob, buf, strlen(buf) );
WriteSpool( hJob, invocation, strlen(invocation) );
WriteSpool( hJob, psendfeature, strlen(psendfeature) );
HeapFree( PSDRV_Heap, 0, buf );
return 1;
}
INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *titlebuf;
INPUTSLOT *slot;
PAGESIZE *page;
titlebuf = (char *)HeapAlloc( GetProcessHeap(), 0, len+1 );
titlebuf = (char *)HeapAlloc( PSDRV_Heap, 0, len+1 );
if(!titlebuf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
@ -110,24 +145,54 @@ INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
memcpy(titlebuf, title, len);
titlebuf[len] = '\0';
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psheader) + len);
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psheader) + len + 20);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( PSDRV_Heap, 0, titlebuf );
return 0;
}
wsprintf32A(buf, psheader, title);
wsprintf32A(buf, psheader, title, 0, 0,
(int) (dc->w.devCaps->horzSize * 72.0 / 25.4),
(int) (dc->w.devCaps->vertSize * 72.0 / 25.4) );
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( GetProcessHeap(), 0, buf );
HeapFree( PSDRV_Heap, 0, titlebuf );
HeapFree( PSDRV_Heap, 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( GetProcessHeap(), 0, buf );
HeapFree( PSDRV_Heap, 0, titlebuf );
HeapFree( PSDRV_Heap, 0, buf );
WriteSpool( physDev->job.hJob, psbeginsetup, strlen(psbeginsetup) );
for(slot = physDev->pi->ppd->InputSlots; slot; slot = slot->next) {
if(slot->WinBin == physDev->Devmode->dmPublic.dmDefaultSource) {
if(slot->InvocationString) {
PSDRV_WriteFeature(physDev->job.hJob, "*InputSlot", slot->Name,
slot->InvocationString);
break;
}
}
}
for(page = physDev->pi->ppd->PageSizes; page; page = page->next) {
if(page->WinPage == physDev->Devmode->dmPublic.dmPaperSize) {
if(page->InvocationString) {
PSDRV_WriteFeature(physDev->job.hJob, "*PageSize", page->Name,
page->InvocationString);
break;
}
}
}
WriteSpool( physDev->job.hJob, psendsetup, strlen(psendsetup) );
return 1;
}
@ -137,7 +202,7 @@ INT32 PSDRV_WriteFooter( DC *dc )
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psfooter) + 100 );
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psfooter) + 100 );
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
@ -148,10 +213,10 @@ INT32 PSDRV_WriteFooter( DC *dc )
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, buf );
HeapFree( PSDRV_Heap, 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
HeapFree( PSDRV_Heap, 0, buf );
return 1;
}
@ -180,7 +245,7 @@ INT32 PSDRV_WriteNewPage( DC *dc )
wsprintf32A(name, "%d", physDev->job.PageNo);
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psnewpage) + 100 );
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psnewpage) + 100 );
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
@ -190,10 +255,10 @@ INT32 PSDRV_WriteNewPage( DC *dc )
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, buf );
HeapFree( PSDRV_Heap, 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
HeapFree( PSDRV_Heap, 0, buf );
return 1;
}
@ -238,7 +303,7 @@ BOOL32 PSDRV_WriteSetFont(DC *dc)
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *newbuf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0,
buf = (char *)HeapAlloc( PSDRV_Heap, 0,
sizeof(pssetfont) + strlen(physDev->font.afm->FontName) + 40);
if(!buf) {
@ -246,23 +311,23 @@ BOOL32 PSDRV_WriteSetFont(DC *dc)
return FALSE;
}
newbuf = (char *)HeapAlloc( GetProcessHeap(), 0,
newbuf = (char *)HeapAlloc( PSDRV_Heap, 0,
strlen(physDev->font.afm->FontName) + sizeof(encodingext));
if(!newbuf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree(GetProcessHeap(), 0, buf);
HeapFree(PSDRV_Heap, 0, buf);
return FALSE;
}
wsprintf32A(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
wsprintf32A(buf, pssetfont, newbuf,
physDev->font.tm.tmHeight, -physDev->font.tm.tmHeight,
physDev->font.tm.tmAscent, -physDev->font.escapement);
physDev->font.size, -physDev->font.size,
-physDev->font.escapement);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf);
HeapFree(PSDRV_Heap, 0, buf);
return TRUE;
}
@ -271,7 +336,7 @@ BOOL32 PSDRV_WriteReencodeFont(DC *dc)
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *newbuf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0,
buf = (char *)HeapAlloc( PSDRV_Heap, 0,
sizeof(psreencodefont) + 2 * strlen(physDev->font.afm->FontName)
+ sizeof(encodingext));
@ -280,12 +345,12 @@ BOOL32 PSDRV_WriteReencodeFont(DC *dc)
return FALSE;
}
newbuf = (char *)HeapAlloc( GetProcessHeap(), 0,
newbuf = (char *)HeapAlloc( PSDRV_Heap, 0,
strlen(physDev->font.afm->FontName) + sizeof(encodingext));
if(!newbuf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree(GetProcessHeap(), 0, buf);
HeapFree(PSDRV_Heap, 0, buf);
return FALSE;
}
@ -294,26 +359,45 @@ BOOL32 PSDRV_WriteReencodeFont(DC *dc)
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, newbuf);
HeapFree(GetProcessHeap(), 0, buf);
HeapFree(PSDRV_Heap, 0, newbuf);
HeapFree(PSDRV_Heap, 0, buf);
return TRUE;
}
BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count)
{
char *buf;
char *buf, *buf1;
INT32 buflen = count + 10, i, done;
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psshow) + count);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
buf = (char *)HeapAlloc( PSDRV_Heap, 0, buflen );
for(i = done = 0; i < count; i++) {
if(!isprint(str[i])) {
if(done + 4 >= buflen)
buf = HeapReAlloc( PSDRV_Heap, 0, buf, buflen += 10 );
sprintf(buf + done, "\\%03o", (int)(unsigned char)str[i] );
done += 4;
} else if(str[i] == '\\' || str[i] == '(' || str[i] == ')' ) {
if(done + 2 >= buflen)
buf = HeapReAlloc( PSDRV_Heap, 0, buf, buflen += 10 );
buf[done++] = '\\';
buf[done++] = str[i];
} else {
if(done + 1 >= buflen)
buf = HeapReAlloc( PSDRV_Heap, 0, buf, buflen += 10 );
buf[done++] = str[i];
}
}
buf[done] = '\0';
wsprintf32A(buf, psshow, str);
buf1 = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psshow) + done);
wsprintf32A(buf1, psshow, buf);
PSDRV_WriteSpool(dc, buf1, strlen(buf1));
HeapFree(PSDRV_Heap, 0, buf);
HeapFree(PSDRV_Heap, 0, buf1);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}

View File

@ -1,5 +1,5 @@
/*
* Postscript driver text functions
* PostScript driver text functions
*
* Copyright 1998 Huw D M Davies
*
@ -24,7 +24,7 @@ BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
TRACE(psdrv, "(x=%d, y=%d, flags=0x%08x, str='%s', count=%d)\n", x, y,
flags, str, count);
strbuf = (char *)HeapAlloc( GetProcessHeap(), 0, count + 1);
strbuf = (char *)HeapAlloc( PSDRV_Heap, 0, count + 1);
if(!strbuf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
@ -61,14 +61,14 @@ BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
switch(dc->w.textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
case TA_TOP:
y += physDev->font.tm.tmAscent;
break;
case TA_BASELINE:
y -= physDev->font.tm.tmAscent;
break;
case TA_BOTTOM:
y -= sz.cy;
y -= physDev->font.tm.tmDescent;
break;
}
@ -80,6 +80,6 @@ BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
PSDRV_WriteMoveTo(dc, x, y);
PSDRV_WriteShow(dc, strbuf, strlen(strbuf));
HeapFree(GetProcessHeap(), 0, strbuf);
HeapFree(PSDRV_Heap, 0, strbuf);
return TRUE;
}

View File

@ -613,7 +613,8 @@ HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC)
memset(pPrintJob, 0, sizeof(PRINTJOB));
pPrintJob->pszOutput = strdup(lpOutput);
pPrintJob->pszTitle = strdup(lpTitle);
if(lpTitle)
pPrintJob->pszTitle = strdup(lpTitle);
pPrintJob->hDC = hDC;
pPrintJob->fd = fd;
pPrintJob->nIndex = 0;

View File

@ -165,7 +165,7 @@ static UINT16 __lfCheckSum( LPLOGFONT16 plf )
#undef ptr
i = 0;
#define ptr ((CHAR*)plf)
do { font[i++] = tolower(*ptr); } while (*ptr++);
do { font[i++] = tolower(*ptr++); } while (( i < LF_FACESIZE) && (*ptr) && (*ptr!=' '));
for( ptr = font, i >>= 1; i > 0; i-- )
#undef ptr
#define ptr ((UINT16*)plf)
@ -2240,6 +2240,7 @@ BOOL32 X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
}
else
for( ; pfr ; pfr = pfr->next )
if(pfr->fi)
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
XFONT_GetFontMetric( pfr->fi, &lf, &tm ), lp )) )
bRet = b;

View File

@ -44,7 +44,7 @@ file krnl386.exe
42 return DisableDos 0 0
45 pascal16 LoadModule(str ptr) LoadModule16
46 pascal16 FreeModule(word) FreeModule16
47 pascal16 GetModuleHandle(segstr) WIN16_GetModuleHandle
47 pascal GetModuleHandle(segstr) WIN16_GetModuleHandle
48 pascal16 GetModuleUsage(word) GetModuleUsage
49 pascal16 GetModuleFileName(word ptr s_word) GetModuleFileName16
50 pascal GetProcAddress(word segstr) GetProcAddress16
@ -309,7 +309,7 @@ file krnl386.exe
445 stub KERNEL_445
446 stub KERNEL_446
447 stub KERNEL_447
449 pascal KERNEL_449() KERNEL_449
449 pascal GetpWin16Lock() GetpWin16Lock16
450 pascal16 KERNEL_450() stub_KERNEL_450
452 stub KERNEL_452
453 stub KERNEL_453

View File

@ -1,7 +1,7 @@
name msvideo
type win16
2 stub VIDEOFORWINDOWSVERSION
2 pascal VideoForWindowsVersion() VideoForWindowsVersion
20 stub VIDEOGETNUMDEVS
21 stub VIDEOGETERRORTEXT
22 stub VIDEOCAPDRIVERDESCANDVER

View File

@ -270,10 +270,10 @@ void RELAY_DebugCallTo16( int* stack, int nb_args )
}
DPRINTF(") ss:sp=%04x:%04x\n", SELECTOROF(thdb->cur_stack),
OFFSETOF(thdb->cur_stack) );
DPRINTF(" AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x BP=%04x ES=%04x\n",
DPRINTF(" AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x BP=%04x ES=%04x FS=%04x\n",
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
BP_reg(context), (WORD)ES_reg(context) );
BP_reg(context), (WORD)ES_reg(context), (WORD)FS_reg(context) );
}
else
{
@ -291,6 +291,21 @@ void RELAY_DebugCallTo16( int* stack, int nb_args )
}
/***********************************************************************
* RELAY_DebugCallTo16Ret
*/
void RELAY_DebugCallTo16Ret( int ret_val )
{
THDB *thdb;
if (!TRACE_ON(relay)) return;
thdb = THREAD_Current();
DPRINTF("CallTo16() ss:sp=%04x:%04x retval=0x%08x\n",
SELECTOROF(thdb->cur_stack), OFFSETOF(thdb->cur_stack), ret_val);
}
/**********************************************************************
* Catch (KERNEL.55)
*

View File

@ -250,7 +250,8 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
THDB *thdb = THREAD_Current();
/* Window procedures want ax = hInstance, ds = es = ss */
memset(&context, '\0', sizeof(context));
DS_reg(&context) = SELECTOROF(thdb->cur_stack);
ES_reg(&context) = DS_reg(&context);
EAX_reg(&context) = wndPtr ? wndPtr->hInstance : DS_reg(&context);
@ -892,8 +893,6 @@ void WINAPI C16ThkSL01(CONTEXT *context)
CS_reg(context) = stack[3];
SP_reg(context) += td->apiDB[targetNr].nrArgBytes + 4;
/* Win95 allows delayed loading of the 32-bit DLL.
We don't do that at the moment. */
ERR(thunk, "Process %08lx did not ThunkConnect32 %s to %s\n",
(DWORD)PROCESS_Current(), td->pszDll32, td->pszDll16);
}

View File

@ -4,4 +4,4 @@ type win16
13 pascal16 DeviceMode(word word str str) PSDRV_DeviceMode16
90 pascal16 ExtDeviceMode(word word ptr str str ptr str word) PSDRV_ExtDeviceMode16
91 pascal DeviceCapabilities(str str word ptr ptr) PSDRV_DeviceCapabilities16
93 pascal16 AdvancedSetupDialog(word word ptr ptr) PSDRV_AdvancedSetupDialog16

View File

@ -20,6 +20,7 @@ typedef struct
const unsigned short *ordinals; /* Pointer to ordinals table */
const unsigned char *args; /* Pointer to argument lengths */
const unsigned int *argtypes; /* Pointer to argument types bitmask */
const ENTRYPOINT32 dllentrypoint;/* Pointer to LibMain function */
} BUILTIN32_DESCRIPTOR;
extern ENTRYPOINT32 BUILTIN32_GetEntryPoint( char *buffer, void *relay,

View File

@ -6,6 +6,7 @@
#define __WINE_COMMCTRL_H
#include "windows.h"
#include "imagelist.h"
BOOL32 WINAPI ShowHideMenuCtl (HWND32, UINT32, LPINT32);
VOID WINAPI GetEffectiveClientRect (HWND32, LPRECT32, LPINT32);
@ -92,6 +93,13 @@ BOOL32 WINAPI InitCommonControlsEx (LPINITCOMMONCONTROLSEX);
#define ODT_TAB 101
#define ODT_LISTVIEW 102
/* common notification structures */
typedef struct tagNMTOOLTIPSCREATED
{
NMHDR hdr;
HWND32 hwndToolTips;
} NMTOOLTIPSCREATED, *LPNMTOOLTIPSCREATED;
/* StatusWindow */
@ -118,12 +126,19 @@ BOOL32 WINAPI InitCommonControlsEx (LPINITCOMMONCONTROLSEX);
#define SB_GETRECT (WM_USER+10)
#define SB_ISSIMPLE (WM_USER+14)
#define SB_SETICON (WM_USER+15)
#define SB_SETTIPTEXT32A (WM_USER+16)
#define SB_SETTIPTEXT32W (WM_USER+17)
#define SB_SETTIPTEXT WINELIB_NAME_AW(SB_SETTIPTEXT)
#define SB_GETTIPTEXT32A (WM_USER+18)
#define SB_GETTIPTEXT32W (WM_USER+19)
#define SB_GETTIPTEXT WINELIB_NAME_AW(SB_GETTIPTEXT)
#define SB_GETICON (WM_USER+20)
#define SB_SETBKCOLOR CCM_SETBKCOLOR /* lParam = bkColor */
#define SBT_NOBORDERS 0x0100
#define SBT_POPOUT 0x0200
#define SBT_RTLREADING 0x0400 /* not supported */
#define SBT_TOOLTIPS 0x0800
#define SBT_OWNERDRAW 0x1000
#define SBARS_SIZEGRIP 0x0100
@ -132,7 +147,14 @@ BOOL32 WINAPI InitCommonControlsEx (LPINITCOMMONCONTROLSEX);
#define SBN_LAST (0U-899U)
#define SBN_SIMPLEMODECHANGE (SBN_FIRST-0)
void WINAPI MenuHelp (UINT32, WPARAM32, LPARAM, HMENU32,
HWND32 WINAPI CreateStatusWindow32A (INT32, LPCSTR, HWND32, UINT32);
HWND32 WINAPI CreateStatusWindow32W (INT32, LPCWSTR, HWND32, UINT32);
#define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow)
VOID WINAPI DrawStatusText32A (HDC32, LPRECT32, LPCSTR, UINT32);
VOID WINAPI DrawStatusText32W (HDC32, LPRECT32, LPCWSTR, UINT32);
#define DrawStatusText WINELIB_NAME_AW(DrawStatusText)
VOID WINAPI MenuHelp (UINT32, WPARAM32, LPARAM, HMENU32,
HINSTANCE32, HWND32, LPUINT32);
@ -145,8 +167,8 @@ void WINAPI MenuHelp (UINT32, WPARAM32, LPARAM, HMENU32,
typedef struct tagUDACCEL
{
UINT32 nSec;
UINT32 nInc;
UINT32 nSec;
UINT32 nInc;
} UDACCEL;
#define UD_MAXVAL 0x7fff
@ -177,13 +199,15 @@ typedef struct tagUDACCEL
#define UDM_SETRANGE32 (WM_USER+111)
#define UDM_GETRANGE32 (WM_USER+112)
HWND32 WINAPI CreateUpDownControl (DWORD, INT32, INT32, INT32, INT32,
HWND32, INT32, HINSTANCE32, HWND32,
INT32, INT32, INT32);
/* Progress Bar */
#define PROGRESS_CLASS32A "msctls_progress32"
#define PROGRESS_CLASS32W L"msctls_progress32"
#define PROGRESS_CLASS16 "msctls_progress"
#define PROGRESS_CLASS WINELIB_NAME_AW(PROGRESS_CLASS)
#define PBM_SETRANGE (WM_USER+1)
@ -206,27 +230,14 @@ typedef struct
INT32 iHigh;
} PBRANGE, *PPBRANGE;
/* Functions prototypes */
HWND32 WINAPI CreateStatusWindow32A(INT32,LPCSTR,HWND32,UINT32);
HWND32 WINAPI CreateStatusWindow32W(INT32,LPCWSTR,HWND32,UINT32);
#define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow)
HWND32 WINAPI CreateUpDownControl(DWORD,INT32,INT32,INT32,INT32,
HWND32,INT32,HINSTANCE32,HWND32,
INT32,INT32,INT32);
VOID WINAPI DrawStatusText32A(HDC32,LPRECT32,LPCSTR,UINT32);
VOID WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32);
#define DrawStatusText WINELIB_NAME_AW(DrawStatusText)
/* ImageList */
/*
#if defined(__WINE__) && defined(__WINE_IMAGELIST_C)
#else
struct _IMAGELIST;
typedef struct _IMAGELIST *HIMAGELIST;
#endif /* __WINE__ */
#endif*/ /* __WINE__ */
#define CLR_NONE 0xFFFFFFFF
#define CLR_DEFAULT 0xFF000000
@ -545,7 +556,24 @@ typedef struct tagNMHEADERA
#define TBSTYLE_FLAT 0x0800
#define TBSTYLE_LIST 0x1000
#define TBSTYLE_CUSTOMERASE 0x2000
#define TBIF_IMAGE 0x00000001
#define TBIF_TEXT 0x00000002
#define TBIF_STATE 0x00000004
#define TBIF_STYLE 0x00000008
#define TBIF_LPARAM 0x00000010
#define TBIF_COMMAND 0x00000020
#define TBIF_SIZE 0x00000040
#define TBN_FIRST (0U-700U)
#define TBN_LAST (0U-720U)
#define TBN_GETBUTTONINFO32A (TBN_FIRST-0)
#define TBN_GETBUTTONINFO32W (TBN_FIRST-20)
#define TBN_GETINFOTIP32A (TBN_FIRST-18)
#define TBN_GETINFOTIP32W (TBN_FIRST-19)
#define TB_ENABLEBUTTON (WM_USER+1)
#define TB_CHECKBUTTON (WM_USER+2)
#define TB_PRESSBUTTON (WM_USER+3)
@ -612,6 +640,12 @@ typedef struct tagNMHEADERA
#define TB_SETMAXTEXTROWS (WM_USER+60)
#define TB_GETTEXTROWS (WM_USER+61)
#define TB_GETOBJECT (WM_USER+62)
#define TB_GETBUTTONINFO32W (WM_USER+63)
#define TB_GETBUTTONINFO32A (WM_USER+65)
#define TB_GETBUTTONINFO WINELIB_NAME_AW(TB_GETBUTTONINFO)
#define TB_SETBUTTONINFO32W (WM_USER+64)
#define TB_SETBUTTONINFO32A (WM_USER+66)
#define TB_SETBUTTONINFO WINELIB_NAME_AW(TB_SETBUTTONINFO)
#define TB_SETDRAWTEXTFLAGS (WM_USER+70)
#define TB_GETHOTITEM (WM_USER+71)
#define TB_SETHOTITEM (WM_USER+72)
@ -692,6 +726,58 @@ typedef struct tagTBSAVEPARAMSW {
#define TBSAVEPARAMS WINELIB_NAMEAW(TBSAVEPARAMS)
#define LPTBSAVEPARAMS WINELIB_NAMEAW(LPTBSAVEPARAMS)
typedef struct
{
UINT32 cbSize;
DWORD dwMask;
INT32 idCommand;
INT32 iImage;
BYTE fsState;
BYTE fsStyle;
WORD cx;
DWORD lParam;
LPSTR pszText;
INT32 cchText;
} TBBUTTONINFO32A, *LPTBBUTTONINFO32A;
typedef struct
{
UINT32 cbSize;
DWORD dwMask;
INT32 idCommand;
INT32 iImage;
BYTE fsState;
BYTE fsStyle;
WORD cx;
DWORD lParam;
LPWSTR pszText;
INT32 cchText;
} TBBUTTONINFO32W, *LPTBBUTTONINFO32W;
#define TBBUTTONINFO WINELIB_NAMEAW(TBBUTTONINFO)
#define LPTBBUTTONINFO WINELIB_NAMEAW(LPTBBUTTONINFO)
typedef struct tagNMTBGETINFOTIPA
{
NMHDR hdr;
LPSTR pszText;
INT32 cchTextMax;
INT32 iItem;
LPARAM lParam;
} NMTBGETINFOTIP32A, *LPNMTBGETINFOTIP32A;
typedef struct tagNMTBGETINFOTIPW
{
NMHDR hdr;
LPWSTR pszText;
INT32 cchTextMax;
INT32 iItem;
LPARAM lParam;
} NMTBGETINFOTIP32W, *LPNMTBGETINFOTIP32W;
#define NMTBGETINFOTIP WINELIB_NAMEAW(NMTBGETINFOFTIP)
#define LPNMTBGETINFOTIP WINELIB_NAMEAW(LPNMTBGETINFOTIP)
HWND32 WINAPI
CreateToolbar(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
@ -786,12 +872,12 @@ CreateMappedBitmap (HINSTANCE32, INT32, UINT32, LPCOLORMAP, INT32);
#define TTN_FIRST (0U-520U)
#define TTN_LAST (0U-549U)
#define TTN_GETDISPINFOA (TTN_FIRST-0)
#define TTN_GETDISPINFOW (TTN_FIRST-10)
#define TTN_GETDISPINFO32A (TTN_FIRST-0)
#define TTN_GETDISPINFO32W (TTN_FIRST-10)
#define TTN_GETDISPINFO WINELIB_NAME_AW(TTN_GETDISPINFO)
#define TTN_SHOW (TTN_FIRST-1)
#define TTN_POP (TTN_FIRST-2)
typedef struct tagTOOLINFOA {
UINT32 cbSize;
UINT32 uFlags;
@ -801,7 +887,7 @@ typedef struct tagTOOLINFOA {
HINSTANCE32 hinst;
LPSTR lpszText;
LPARAM lParam;
} TTTOOLINFOA, *PTOOLINFOA, *LPTTTOOLINFOA;
} TTTOOLINFO32A, *PTOOLINFO32A, *LPTTTOOLINFO32A;
typedef struct tagTOOLINFOW {
UINT32 cbSize;
@ -812,21 +898,28 @@ typedef struct tagTOOLINFOW {
HINSTANCE32 hinst;
LPWSTR lpszText;
LPARAM lParam;
} TTTOOLINFOW, *PTOOLINFOW, *LPTTTOOLINFOW;
} TTTOOLINFO32W, *PTOOLINFO32W, *LPTTTOOLINFO32W;
#define TTTOOLINFO WINELIB_NAME_AW(TTTOOLINFO)
#define PTOOLINFO WINELIB_NAME_AW(PTOOLINFO)
#define LPTTTOOLINFO WINELIB_NAME_AW(LPTTTOOLINFO)
typedef struct _TT_HITTESTINFOA
{
HWND32 hwnd;
POINT32 pt;
TTTOOLINFOA ti;
} TTHITTESTINFOA, *LPTTHITTESTINFOA;
HWND32 hwnd;
POINT32 pt;
TTTOOLINFO32A ti;
} TTHITTESTINFO32A, *LPTTHITTESTINFO32A;
typedef struct _TT_HITTESTINFOW
{
HWND32 hwnd;
POINT32 pt;
TTTOOLINFOW ti;
} TTHITTESTINFOW, *LPTTHITTESTINFOW;
HWND32 hwnd;
POINT32 pt;
TTTOOLINFO32W ti;
} TTHITTESTINFO32W, *LPTTHITTESTINFO32W;
#define TTHITTESTINFO WINELIB_NAME_AW(TTHITTESTINFO)
#define LPTTHITTESTINFO WINELIB_NAME_AW(LPTTHITTESTINFO)
typedef struct tagNMTTDISPINFOA
{
@ -836,7 +929,7 @@ typedef struct tagNMTTDISPINFOA
HINSTANCE32 hinst;
UINT32 uFlags;
LPARAM lParam;
} NMTTDISPINFOA, *LPNMTTDISPINFOA;
} NMTTDISPINFO32A, *LPNMTTDISPINFO32A;
typedef struct tagNMTTDISPINFOW
{
@ -846,8 +939,10 @@ typedef struct tagNMTTDISPINFOW
HINSTANCE32 hinst;
UINT32 uFlags;
LPARAM lParam;
} NMTTDISPINFOW, *LPNMTTDISPINFOW;
} NMTTDISPINFO32W, *LPNMTTDISPINFO32W;
#define NMTTDISPINFO WINELIB_NAME_AW(NMTTDISPINFO)
#define LPNMTTDISPINFO WINELIB_NAME_AW(LPNMTTDISPINFO)
/* Rebar control */
@ -879,13 +974,41 @@ typedef struct tagNMTTDISPINFOW
#define TBS_NOTHUMB 0x0080
#define TBS_TOOLTIPS 0x0100
#define TBTS_TOP 0
#define TBTS_LEFT 1
#define TBTS_BOTTOM 2
#define TBTS_RIGHT 3
#define TB_LINEUP 0
#define TB_LINEDOWN 1
#define TB_PAGEUP 2
#define TB_PAGEDOWN 3
#define TB_THUMBPOSITION 4
#define TB_THUMBTRACK 5
#define TB_TOP 6
#define TB_BOTTOM 7
#define TB_ENDTRACK 8
#define TBCD_TICS 0x0001
#define TBCD_THUMB 0x0002
#define TBCD_CHANNEL 0x0003
#define TBM_GETPOS (WM_USER)
#define TBM_GETRANGEMIN (WM_USER+1)
#define TBM_GETRANGEMAX (WM_USER+2)
#define TBM_GETTIC (WM_USER+3)
#define TBM_SETTIC (WM_USER+4)
#define TBM_SETPOS (WM_USER+5)
#define TBM_SETRANGE (WM_USER+6)
#define TBM_SETRANGEMIN (WM_USER+7)
#define TBM_SETRANGEMAX (WM_USER+8)
#define TBM_CLEARTICS (WM_USER+9)
#define TBM_SETSEL (WM_USER+10)
#define TBM_SETSELSTART (WM_USER+11)
#define TBM_SETSELEND (WM_USER+12)
#define TBM_GETPTICS (WM_USER+14)
#define TBM_GETTICPOS (WM_USER+15)
#define TBM_GETNUMTICS (WM_USER+16)
#define TBM_GETSELSTART (WM_USER+17)
#define TBM_GETSELEND (WM_USER+18)
#define TBM_CLEARSEL (WM_USER+19)
@ -898,6 +1021,13 @@ typedef struct tagNMTTDISPINFOW
#define TBM_GETCHANNELRECT (WM_USER+26)
#define TBM_SETTHUMBLENGTH (WM_USER+27)
#define TBM_GETTHUMBLENGTH (WM_USER+28)
#define TBM_SETTOOLTIPS (WM_USER+29)
#define TBM_GETTOOLTIPS (WM_USER+30)
#define TBM_SETTIPSIDE (WM_USER+31)
#define TBM_SETBUDDY (WM_USER+32)
#define TBM_GETBUDDY (WM_USER+33)
#define TBM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TBM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
/* Pager control */
@ -949,11 +1079,36 @@ typedef struct tagNMTTDISPINFOW
#define TV_FIRST 0x1100
#define TVM_INSERTITEMA (TV_FIRST+0)
#define TVM_INSERTITEMW (TV_FIRST+50)
#define TVM_DELETEITEM (TV_FIRST+1)
#define TVM_EXPAND (TV_FIRST+2)
#define TVM_GETITEMRECT (TV_FIRST+4)
#define TVM_GETCOUNT (TV_FIRST+5)
#define TVM_GETINDENT (TV_FIRST+6)
#define TVM_SETINDENT (TV_FIRST+7)
#define TVM_GETIMAGELIST (TV_FIRST+8)
#define TVM_SETIMAGELIST (TV_FIRST+9)
#define TVM_GETNEXTITEM (TV_FIRST+10)
#define TVM_SELECTITEM (TV_FIRST+11)
#define TVM_GETITEMA (TV_FIRST+12)
#define TVM_GETITEMW (TV_FIRST+62)
#define TVM_SETITEMA (TV_FIRST+13)
#define TVM_SETITEMW (TV_FIRST+63)
#define TVM_EDITLABELA (TV_FIRST+14)
#define TVM_EDITLABELW (TV_FIRST+65)
#define TVM_GETEDITCONTROL (TV_FIRST+15)
#define TVM_GETVISIBLECOUNT (TV_FIRST+16)
#define TVM_HITTEST (TV_FIRST+17)
#define TVM_CREATEDRAGIMAGE (TV_FIRST+18)
#define TVM_SORTCHILDREN (TV_FIRST+19)
#define TVM_ENSUREVISIBLE (TV_FIRST+20)
#define TVM_SORTCHILDRENCB (TV_FIRST+21)
#define TVM_ENDEDITLABELNOW (TV_FIRST+22)
#define TVM_GETISEARCHSTRINGA (TV_FIRST+23)
#define TVM_GETISEARCHSTRINGW (TV_FIRST+64)
#define TVM_SETTOOLTIPS (TV_FIRST+24)
#define TVM_GETTOOLTIPS (TV_FIRST+25)
/* Listview control */

View File

@ -72,6 +72,9 @@
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the sendmsg function. */
#undef HAVE_SENDMSG
/* Define if you have the sigaltstack function. */
#undef HAVE_SIGALTSTACK
@ -153,5 +156,8 @@
/* Define if you have the i386 library (-li386). */
#undef HAVE_LIBI386
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the w library (-lw). */
#undef HAVE_LIBW

View File

@ -81,62 +81,64 @@
#define dbch_module 73
#define dbch_mpr 74
#define dbch_msg 75
#define dbch_nonclient 76
#define dbch_ntdll 77
#define dbch_ole 78
#define dbch_pager 79
#define dbch_palette 80
#define dbch_print 81
#define dbch_process 82
#define dbch_profile 83
#define dbch_progress 84
#define dbch_prop 85
#define dbch_psdrv 86
#define dbch_rebar 87
#define dbch_reg 88
#define dbch_region 89
#define dbch_relay 90
#define dbch_resource 91
#define dbch_s 92
#define dbch_scroll 93
#define dbch_security 94
#define dbch_segment 95
#define dbch_selector 96
#define dbch_sem 97
#define dbch_sendmsg 98
#define dbch_shell 99
#define dbch_shm 100
#define dbch_snoop 101
#define dbch_sound 102
#define dbch_static 103
#define dbch_stress 104
#define dbch_string 105
#define dbch_syscolor 106
#define dbch_system 107
#define dbch_task 108
#define dbch_text 109
#define dbch_thread 110
#define dbch_thunk 111
#define dbch_timer 112
#define dbch_toolbar 113
#define dbch_toolhelp 114
#define dbch_tooltips 115
#define dbch_trackbar 116
#define dbch_treeview 117
#define dbch_tweak 118
#define dbch_uitools 119
#define dbch_updown 120
#define dbch_ver 121
#define dbch_virtual 122
#define dbch_vxd 123
#define dbch_win 124
#define dbch_win16drv 125
#define dbch_win32 126
#define dbch_wing 127
#define dbch_winsock 128
#define dbch_wnet 129
#define dbch_x11 130
#define dbch_x11drv 131
#define dbch_msvideo 76
#define dbch_nonclient 77
#define dbch_ntdll 78
#define dbch_ole 79
#define dbch_pager 80
#define dbch_palette 81
#define dbch_print 82
#define dbch_process 83
#define dbch_profile 84
#define dbch_progress 85
#define dbch_prop 86
#define dbch_psdrv 87
#define dbch_rebar 88
#define dbch_reg 89
#define dbch_region 90
#define dbch_relay 91
#define dbch_resource 92
#define dbch_s 93
#define dbch_scroll 94
#define dbch_security 95
#define dbch_segment 96
#define dbch_selector 97
#define dbch_sem 98
#define dbch_sendmsg 99
#define dbch_shell 100
#define dbch_shm 101
#define dbch_snoop 102
#define dbch_sound 103
#define dbch_static 104
#define dbch_statusbar 105
#define dbch_stress 106
#define dbch_string 107
#define dbch_syscolor 108
#define dbch_system 109
#define dbch_task 110
#define dbch_text 111
#define dbch_thread 112
#define dbch_thunk 113
#define dbch_timer 114
#define dbch_toolbar 115
#define dbch_toolhelp 116
#define dbch_tooltips 117
#define dbch_trackbar 118
#define dbch_treeview 119
#define dbch_tweak 120
#define dbch_uitools 121
#define dbch_updown 122
#define dbch_ver 123
#define dbch_virtual 124
#define dbch_vxd 125
#define dbch_win 126
#define dbch_win16drv 127
#define dbch_win32 128
#define dbch_wing 129
#define dbch_winsock 130
#define dbch_wnet 131
#define dbch_x11 132
#define dbch_x11drv 133
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_err 1

View File

@ -4,7 +4,7 @@
#include "debugtools.h"
#endif
#define DEBUG_CHANNEL_COUNT 132
#define DEBUG_CHANNEL_COUNT 134
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
@ -139,6 +139,8 @@ 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},
};
const char* debug_ch_name[] = {
"1",
@ -217,6 +219,7 @@ const char* debug_ch_name[] = {
"module",
"mpr",
"msg",
"msvideo",
"nonclient",
"ntdll",
"ole",
@ -245,6 +248,7 @@ const char* debug_ch_name[] = {
"snoop",
"sound",
"static",
"statusbar",
"stress",
"string",
"syscolor",

38
include/dosexe.h Normal file
View File

@ -0,0 +1,38 @@
/*
* DOS EXE loader
*
* Copyright 1998 Ove Kåven
*/
#ifdef linux
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/vm86.h>
#include "wintypes.h"
typedef struct _DOSTASK {
LPVOID img;
unsigned img_ofs;
HMODULE16 hModule;
struct vm86plus_struct VM86;
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];
int mm_fd;
#endif
int read_pipe,write_pipe;
pid_t task;
} DOSTASK, *LPDOSTASK;
extern HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline, LPCSTR env, UINT16 show_cmd );
extern int MZ_RunModule( LPDOSTASK lpDosTask );
extern void MZ_KillModule( LPDOSTASK lpDosTask );
extern int DOSVM_Process( LPDOSTASK lpDosTask );
#endif /* linux */

View File

@ -46,6 +46,7 @@ typedef struct {
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
STDMETHOD(CreateInstance) (THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppvObject) PURE;
STDMETHOD(LockServer) (THIS) PURE;
} *LPCLASSFACTORY_VTABLE,IClassFactory_VTable;
struct IClassFactory {

View File

@ -14,11 +14,13 @@
extern HANDLE16 DOSMEM_BiosSeg;
extern DWORD DOSMEM_CollateTable;
extern BOOL32 DOSMEM_Init(void);
extern BOOL32 DOSMEM_Init(HMODULE16 hModule);
extern void DOSMEM_Tick(void);
extern WORD DOSMEM_AllocSelector(WORD);
extern LPVOID DOSMEM_GetBlock(UINT32 size, UINT16* p);
extern BOOL32 DOSMEM_FreeBlock(void* ptr);
extern LPVOID DOSMEM_GetBlock(HMODULE16 hModule, UINT32 size, UINT16* p);
extern BOOL32 DOSMEM_FreeBlock(HMODULE16 hModule, void* ptr);
extern LPVOID DOSMEM_ResizeBlock(HMODULE16 hModule, void* ptr, UINT32 size, UINT16* p);
extern UINT32 DOSMEM_Available(HMODULE16 hModule);
extern LPVOID DOSMEM_MapRealToLinear(DWORD); /* real-mode to linear */
extern LPVOID DOSMEM_MapDosToLinear(UINT32); /* linear DOS to Wine */
extern UINT32 DOSMEM_MapLinearToDos(LPVOID); /* linear Wine to DOS */
@ -46,6 +48,10 @@ extern BOOL32 SIGNAL_InitEmulator(void);
/* misc/aspi.c */
extern void ASPI_DOS_HandleInt(CONTEXT *context);
#define CTX_SEG_OFF_TO_LIN(context,seg,off) \
(ISV86(context) ? (void*)(V86BASE(context)+((seg)<<4)+off) \
: PTR_SEG_OFF_TO_LIN(seg,off))
#define INT_BARF(context,num) \
fprintf( stderr, "int%x: unknown/not implemented parameters:\n" \
"int%x: AX %04x, BX %04x, CX %04x, DX %04x, " \

View File

@ -144,8 +144,13 @@ DECL_WINELIB_TYPE(LPMMTIME)
#define CALLBACK_WINDOW 0x00010000l /* dwCallback is a HWND */
#define CALLBACK_TASK 0x00020000l /* dwCallback is a HTASK */
#define CALLBACK_FUNCTION 0x00030000l /* dwCallback is a FARPROC */
#define CALLBACK_FUNC32 0x00070000l /* (ugly hack) 32-bit FARPROC */
#define CALLBACK32CONV(x) ((((x)&CALLBACK_TYPEMASK)==CALLBACK_FUNCTION) ? \
(((x)&~CALLBACK_TYPEMASK)|CALLBACK_FUNC32) : (x))
typedef void (CALLBACK *LPDRVCALLBACK) (HDRVR16 h, UINT16 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
typedef void (CALLBACK *LPDRVCALLBACK16) (HDRVR16 h, UINT16 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
typedef void (CALLBACK *LPDRVCALLBACK32) (HDRVR32 h, UINT32 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
DECL_WINELIB_TYPE(LPDRVCALLBACK)
#define MM_MICROSOFT 1 /* Microsoft Corp. */
@ -196,7 +201,9 @@ BOOL32 WINAPI PlaySound32W(LPCWSTR pszSound, HMODULE32 hmod, DWORD fdwSound);
typedef HWAVEIN16 *LPHWAVEIN16;
typedef HWAVEOUT16 *LPHWAVEOUT16;
typedef LPDRVCALLBACK LPWAVECALLBACK;
typedef LPDRVCALLBACK16 LPWAVECALLBACK16;
typedef LPDRVCALLBACK32 LPWAVECALLBACK32;
DECL_WINELIB_TYPE(LPWAVECALLBACK)
typedef HMIXER16 *LPHMIXER16;
typedef HMIXER32 *LPHMIXER32;
@ -464,7 +471,9 @@ DWORD WINAPI waveInMessage32(HWAVEIN32,UINT32,DWORD,DWORD);
typedef HMIDIIN16 *LPHMIDIIN16;
typedef HMIDIOUT16 *LPHMIDIOUT16;
typedef LPDRVCALLBACK LPMIDICALLBACK;
typedef LPDRVCALLBACK16 LPMIDICALLBACK16;
typedef LPDRVCALLBACK32 LPMIDICALLBACK32;
DECL_WINELIB_TYPE(LPMIDICALLBACK)
#define MIDIPATCHSIZE 128
typedef WORD PATCHARRAY[MIDIPATCHSIZE];
typedef WORD *LPPATCHARRAY;
@ -2788,6 +2797,7 @@ BOOL16 WINAPI mciFreeCommandResource(UINT16 uTable);
#define DCB_WINDOW 0x0001 /* dwCallback is a HWND */
#define DCB_TASK 0x0002 /* dwCallback is a HTASK */
#define DCB_FUNCTION 0x0003 /* dwCallback is a FARPROC */
#define DCB_FUNC32 0x0007 /* (ugly hack) 32-bit FARPROC */
#define DCB_TYPEMASK 0x0007
#define DCB_NOSWITCH 0x0008 /* don't switch stacks for callback */

View File

@ -10,6 +10,8 @@
#include "wintypes.h"
#include "pe_image.h"
struct _DOSTASK;
/* In-memory module structure. See 'Windows Internals' p. 219 */
typedef struct _NE_MODULE
{
@ -49,6 +51,7 @@ typedef struct _NE_MODULE
HMODULE32 module32; /* 40 PE module handle for Win32 modules */
HMODULE16 self; /* 44 Handle for this module */
WORD self_loading_sel; /* 46 Selector used for self-loading apps. */
struct _DOSTASK *lpDosTask;
} NE_MODULE;

View File

@ -17,4 +17,13 @@ typedef LPVOID LPMONIKER;
#define rmm 23
#define rup 639
/* FIXME should be in oleidl.h*/
typedef struct tagOleMenuGroupWidths
{ LONG width[ 6 ];
} OLEMENUGROUPWIDTHS32;
typedef struct tagOleMenuGroupWidths *LPOLEMENUGROUPWIDTHS32;
typedef HGLOBAL32 HOLEMENU32;
#endif /* __WINE_OLE2_H */

View File

@ -1,14 +1,14 @@
#ifndef __WINE_OLEAUTO_H
#define __WINE_OLEAUTO_H
BSTR16 SysAllocString16(LPOLESTR16);
BSTR32 SysAllocString32(LPOLESTR32);
BSTR16 WINAPI SysAllocString16(LPOLESTR16);
BSTR32 WINAPI SysAllocString32(LPOLESTR32);
#define SysAllocString WINELIB_NAME(SysAllocString)
INT16 SysReAllocString16(LPBSTR16,LPOLESTR16);
INT32 SysReAllocString32(LPBSTR32,LPOLESTR32);
INT16 WINAPI SysReAllocString16(LPBSTR16,LPOLESTR16);
INT32 WINAPI SysReAllocString32(LPBSTR32,LPOLESTR32);
#define SysReAllocString WINELIB_NAME(SysReAllocString)
VOID SysFreeString16(BSTR16);
VOID SysFreeString32(BSTR32);
VOID WINAPI SysFreeString16(BSTR16);
VOID WINAPI SysFreeString32(BSTR32);
#define SysFreeString WINELIB_NAME(SysFreeString)
typedef char OLECHAR;

View File

@ -25,6 +25,11 @@
#define PRINTER_ATTRIBUTE_WORK_OFFLINE 0x00000400
#define PRINTER_ATTRIBUTE_ENABLE_BIDI 0x00000800
DWORD WINAPI DrvGetPrinterData(LPSTR lpPrinter, LPSTR lpProfile,
LPDWORD lpType, LPBYTE lpPrinterData, int cbData, LPDWORD lpNeeded);
DWORD WINAPI DrvSetPrinterData(LPSTR lpPrinter, LPSTR lpProfile,
DWORD lpType, LPBYTE lpPrinterData, DWORD dwSize);
HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC);
int WINAPI CloseJob(HANDLE16 hJob);
int WINAPI WriteSpool(HANDLE16 hJob, LPSTR lpData, WORD cch);
@ -35,3 +40,4 @@ DWORD WINAPI GetSpoolJob(int nOption, LONG param);
int WINAPI WriteDialog(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg);
#endif /* __WINE_PRINT_H */

View File

@ -14,12 +14,14 @@
#include "k32obj.h"
struct _NE_MODULE;
struct _THREAD_ENTRY;
/* Process handle entry */
typedef struct
{
DWORD access; /* Access flags */
K32OBJ *ptr; /* Object ptr */
int server; /* Server handle (FIXME: tmp hack) */
} HANDLE_ENTRY;
/* Process handle table */
@ -78,7 +80,7 @@ typedef struct _PDB32
HANDLE_TABLE *handle_table; /* 44 Handle table */
struct _PDB32 *parent; /* 48 Parent process */
WINE_MODREF *modref_list; /* 4c MODREF list */
void *thread_list; /* 50 List of threads */
struct _THREAD_ENTRY *thread_list; /* 50 List of threads */
void *debuggee_CB; /* 54 Debuggee context block */
void *local_heap_free; /* 58 Head of local heap free list */
DWORD unknown4; /* 5c Unknown */
@ -125,9 +127,10 @@ extern void ENV_FreeEnvironment( PDB32 *pdb );
/* scheduler/handle.c */
extern BOOL32 HANDLE_CreateTable( PDB32 *pdb, BOOL32 inherit );
extern HANDLE32 HANDLE_Alloc( PDB32 *pdb, K32OBJ *ptr, DWORD access,
BOOL32 inherit );
BOOL32 inherit, int server_handle );
extern K32OBJ *HANDLE_GetObjPtr( PDB32 *pdb, HANDLE32 handle,
K32OBJ_TYPE type, DWORD access );
K32OBJ_TYPE type, DWORD access,
int *server_handle );
extern BOOL32 HANDLE_SetObjPtr( PDB32 *pdb, HANDLE32 handle,
K32OBJ *ptr, DWORD access );
extern void HANDLE_CloseAll( PDB32 *pdb, K32OBJ *ptr );
@ -135,10 +138,13 @@ extern void HANDLE_CloseAll( PDB32 *pdb, K32OBJ *ptr );
/* scheduler/process.c */
extern BOOL32 PROCESS_Init( void );
extern PDB32 *PROCESS_Current(void);
extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access );
extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access, int *server_handle );
extern PDB32 *PROCESS_IdToPDB( DWORD id );
extern PDB32 *PROCESS_Create( struct _NE_MODULE *pModule, LPCSTR cmd_line,
LPCSTR env, HINSTANCE16 hInstance,
HINSTANCE16 hPrevInstance, UINT32 cmdShow );
HINSTANCE16 hPrevInstance, UINT32 cmdShow,
PROCESS_INFORMATION *info );
extern void PROCESS_SuspendOtherThreads(void);
extern void PROCESS_ResumeOtherThreads(void);
#endif /* __WINE_PROCESS_H */

View File

@ -1,5 +1,6 @@
/*
* Postscript driver definitions
* PostScript driver definitions
*
* Copyright 1998 Huw D M Davies
*/
@ -39,19 +40,126 @@ typedef struct _tagAFM {
float XHeight;
float Ascender;
float Descender;
float FullAscender; /* Ascent of Aring character */
float CharWidths[256];
int NumofMetrics;
AFMMETRICS *Metrics;
struct _tagAFM *next;
} AFM; /* CharWidths is a shortcut to the WX values of numbered glyphs */
typedef struct _tagFontFamily {
char *FamilyName; /* family name */
AFM *afm; /* list of afms for this family */
struct _tagFontFamily *next; /* next family */
} FontFamily;
/* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than
one list to exist without having to reallocate the entire AFM structure. We
keep a global list of all afms (PSDRV_AFMFontList) plus a list of available
fonts for each DC (dc->physDev->Fonts) */
extern FontFamily *PSDRV_AFMFontList;
typedef struct _tagAFMLISTENTRY {
AFM *afm;
struct _tagAFMLISTENTRY *next;
} AFMLISTENTRY;
typedef struct _tagFONTFAMILY {
char *FamilyName; /* family name */
AFMLISTENTRY *afmlist; /* list of afms for this family */
struct _tagFONTFAMILY *next; /* next family */
} FONTFAMILY;
extern FONTFAMILY *PSDRV_AFMFontList;
typedef struct _tagFONTNAME {
char *Name;
struct _tagFONTNAME *next;
} FONTNAME;
typedef struct {
float llx, lly, urx, ury;
} IMAGEABLEAREA;
typedef struct {
float x, y;
} PAPERDIMENSION;
typedef struct _tagPAGESIZE {
char *Name;
char *FullName;
char *InvocationString;
IMAGEABLEAREA *ImageableArea;
PAPERDIMENSION *PaperDimension;
WORD WinPage; /*eg DMPAPER_A4. Doesn't really belong here */
struct _tagPAGESIZE *next;
} PAGESIZE;
typedef struct _tagOPTIONENTRY {
char *Name; /* eg "True" */
char *FullName; /* eg "Installed" */
char *InvocationString; /* Often NULL */
struct _tagOPTIONENTRY *next;
} OPTIONENTRY;
typedef struct _tagOPTION { /* Treat bool as a special case of pickone */
char *OptionName; /* eg "*Option1" */
char *FullName; /* eg "Envelope Feeder" */
char *DefaultOption; /* eg "False" */
OPTIONENTRY *Options;
struct _tagOPTION *next;
} OPTION;
typedef struct _tagCONSTRAINT {
char *Feature1;
char *Value1;
char *Feature2;
char *Value2;
struct _tagCONSTRAINT *next;
} CONSTRAINT;
typedef struct _tagINPUTSLOT {
char *Name;
char *FullName;
char *InvocationString;
WORD WinBin; /* eg DMBIN_LOWER */
struct _tagINPUTSLOT *next;
} INPUTSLOT;
typedef struct {
char *NickName;
int LanguageLevel;
BOOL32 ColorDevice;
int DefaultResolution;
int LandscapeOrientation;
char *JCLBegin;
char *JCLToPSInterpreter;
char *JCLEnd;
char *DefaultFont;
FONTNAME *InstalledFonts; /* ptr to a list of FontNames */
PAGESIZE *PageSizes;
OPTION *InstalledOptions;
CONSTRAINT *Constraints;
INPUTSLOT *InputSlots;
} PPD;
typedef struct {
DEVMODE16 dmPublic;
struct _tagdocprivate {
} dmDocPrivate;
struct _tagdrvprivate {
char ppdFileName[100]; /* Hack */
UINT32 numInstalledOptions; /* Options at end of struct */
} dmDrvPrivate;
/* Now comes:
numInstalledOptions of OPTIONs
*/
} PSDRV_DEVMODE16;
typedef struct _tagPI {
char *FriendlyName;
PPD *ppd;
PSDRV_DEVMODE16 *Devmode;
FONTFAMILY *Fonts;
struct _tagPI *next;
} PRINTERINFO;
typedef struct {
AFM *afm;
@ -74,10 +182,20 @@ typedef struct
{
PSFONT font; /* Current PS font */
JOB job;
PSDRV_DEVMODE16 *Devmode;
PRINTERINFO *pi;
} PSDRV_PDEVICE;
extern HANDLE32 PSDRV_Heap;
extern void PSDRV_MergeDevmodes(PSDRV_DEVMODE16 *dm1, PSDRV_DEVMODE16 *dm2,
PRINTERINFO *pi);
extern BOOL32 PSDRV_GetFontMetrics(void);
extern PPD *PSDRV_ParsePPD(char *fname);
extern PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name);
extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name);
extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm);
extern void PSDRV_FreeAFMList( FONTFAMILY *head );
extern BOOL32 PSDRV_Init(void);
extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
@ -115,6 +233,8 @@ extern BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
extern BOOL32 PSDRV_GetTextMetrics( DC *dc, TEXTMETRIC32A *metrics );
extern BOOL32 PSDRV_LineTo( DC *dc, INT32 x, INT32 y );
extern BOOL32 PSDRV_MoveToEx( DC *dc, INT32 x, INT32 y, LPPOINT32 pt );
extern BOOL32 PSDRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count );
extern BOOL32 PSDRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count );
extern HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle );
extern BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,

View File

@ -27,47 +27,115 @@ struct cmsg_fd
int fd; /* fd to pass */
};
/* request from client to server */
enum request
{
REQ_TIMEOUT, /* internal timeout msg */
REQ_KILL_THREAD, /* internal kill thread msg */
REQ_NEW_THREAD, /* create a new thread (called from the creator) */
REQ_INIT_THREAD, /* init a new thread (called by itself) */
REQ_NB_REQUESTS
};
/* Request structures */
/* request structures */
/* following are the definitions of all the client<->server */
/* communication format; requests are from client to server, */
/* replies are from server to client. All requests must have */
/* a corresponding structure; the replies can be empty in */
/* which case it isn't necessary to define a structure. */
/* Create a new thread from the context of the parent */
struct new_thread_request
{
void *pid; /* process id for the new thread (or 0 if none yet) */
void* pid; /* process id for the new thread (or 0 if none yet) */
};
struct new_thread_reply
{
void *tid; /* thread id */
void *pid; /* process id (created if necessary) */
void* tid; /* thread id */
int thandle; /* thread handle (in the current process) */
void* pid; /* process id (created if necessary) */
int phandle; /* process handle (in the current process) */
};
/* Initialize a thread; called from the child after fork()/clone() */
struct init_thread_request
{
int pid;
/* char name[...];*/
int unix_pid; /* Unix pid of new thread */
};
/* server-side functions */
extern void server_main_loop( int fd );
/* Terminate a process */
struct terminate_process_request
{
int handle; /* process handle to terminate */
int exit_code; /* process exit code */
};
/* Terminate a thread */
struct terminate_thread_request
{
int handle; /* thread handle to terminate */
int exit_code; /* thread exit code */
};
/* Retrieve information about a process */
struct get_process_info_request
{
int handle; /* process handle */
};
struct get_process_info_reply
{
void* pid; /* server process id */
int exit_code; /* process exit code */
};
/* Close a handle for the current process */
struct close_handle_request
{
int handle; /* handle to close */
};
/* Duplicate a handle */
struct dup_handle_request
{
int src_process; /* src process handle */
int src_handle; /* src handle to duplicate */
int dst_process; /* dst process handle */
int dst_handle; /* handle to duplicate to (or -1 for any) */
unsigned int access; /* wanted access rights */
int inherit; /* inherit flag */
int options; /* duplicate options (see below) */
};
struct dup_handle_reply
{
int handle; /* duplicated handle in dst process */
};
/* Open a handle to a process */
struct open_process_request
{
void* pid; /* process id to open */
unsigned int access; /* wanted access rights */
int inherit; /* inherit flag */
};
struct open_process_reply
{
int handle; /* handle to the process */
};
/* client-side functions */
#ifndef __WINE_SERVER__
struct _THDB;
extern int CLIENT_NewThread( struct _THDB *thdb );
extern int CLIENT_NewThread( struct _THDB *thdb, int *thandle, int *phandle );
extern int CLIENT_InitThread(void);
extern int CLIENT_TerminateProcess( int handle, int exit_code );
extern int CLIENT_TerminateThread( int handle, int exit_code );
extern int CLIENT_CloseHandle( int handle );
extern int CLIENT_DuplicateHandle( int src_process, int src_handle, int dst_process,
int dst_handle, DWORD access, BOOL32 inherit, DWORD options );
extern int CLIENT_GetProcessInfo( int handle, struct get_process_info_reply *reply );
extern int CLIENT_OpenProcess( void *pid, DWORD access, BOOL32 inherit );
#endif /* __WINE_SERVER__ */
#endif /* __WINE_SERVER_H */

98
include/server/object.h Normal file
View File

@ -0,0 +1,98 @@
/*
* Wine server objects
*
* Copyright (C) 1998 Alexandre Julliard
*/
#ifndef __WINE_SERVER_OBJECT_H
#define __WINE_SERVER_OBJECT_H
#ifndef __WINE_SERVER__
#error This file can only be used in the Wine server
#endif
#include <sys/time.h>
#include "server/request.h"
/* kernel objects */
struct object;
struct object_name;
struct object_ops
{
void (*dump)(struct object *,int); /* dump the object (for debugging) */
void (*destroy)(struct object *); /* destroy on refcount == 0 */
};
struct object
{
unsigned int refcount;
const struct object_ops *ops;
struct object_name *name;
};
extern void init_object( struct object *obj, const struct object_ops *ops,
const char *name );
/* grab/release_object can take any pointer, but you better make sure */
/* that the thing pointed to starts with a struct object... */
extern struct object *grab_object( void *obj );
extern void release_object( void *obj );
/* request handlers */
struct iovec;
struct thread;
extern void call_req_handler( struct thread *thread, enum request req,
void *data, int len, int fd );
extern void call_timeout_handler( struct thread *thread );
extern void call_kill_handler( struct thread *thread, int exit_code );
extern void trace_request( enum request req, void *data, int len, int fd );
extern void trace_timeout(void);
extern void trace_kill( int exit_code );
extern void trace_reply( struct thread *thread, int type, int pass_fd,
struct iovec *vec, int veclen );
/* socket functions */
extern int add_client( int client_fd, struct thread *self );
extern void remove_client( int client_fd, int exit_code );
extern int get_initial_client_fd(void);
extern void set_timeout( int client_fd, struct timeval *when );
extern int send_reply_v( int client_fd, int type, int pass_fd,
struct iovec *vec, int veclen );
/* process functions */
struct process;
extern struct process *create_process(void);
extern struct process *get_process_from_id( void *id );
extern struct process *get_process_from_handle( int handle, unsigned int access );
extern void add_process_thread( struct process *process,
struct thread *thread );
extern void remove_process_thread( struct process *process,
struct thread *thread );
extern void kill_process( struct process *process, int exit_code );
extern void get_process_info( struct process *process,
struct get_process_info_reply *reply );
/* handle functions */
/* alloc_handle takes a void *obj for convenience, but you better make sure */
/* that the thing pointed to starts with a struct object... */
extern int alloc_handle( struct process *process, void *obj,
unsigned int access, int inherit );
extern int close_handle( struct process *process, int handle );
extern int set_handle_info( struct process *process, int handle,
int mask, int flags );
extern struct object *get_handle_obj( struct process *process, int handle,
unsigned int access, const struct object_ops *ops );
extern int duplicate_handle( struct process *src, int src_handle, struct process *dst,
int dst_handle, unsigned int access, int inherit, int options );
extern int debug_level;
#endif /* __WINE_SERVER_OBJECT_H */

48
include/server/request.h Normal file
View File

@ -0,0 +1,48 @@
/* File generated automatically by tools/make_requests; DO NOT EDIT!! */
#ifndef __WINE_SERVER_REQUEST_H
#define __WINE_SERVER_REQUEST_H
enum request
{
REQ_NEW_THREAD,
REQ_INIT_THREAD,
REQ_TERMINATE_PROCESS,
REQ_TERMINATE_THREAD,
REQ_GET_PROCESS_INFO,
REQ_CLOSE_HANDLE,
REQ_DUP_HANDLE,
REQ_OPEN_PROCESS,
REQ_NB_REQUESTS
};
#ifdef WANT_REQUEST_HANDLERS
#define DECL_HANDLER(name) \
static void req_##name( struct name##_request *req, void *data, int len, int fd )
DECL_HANDLER(new_thread);
DECL_HANDLER(init_thread);
DECL_HANDLER(terminate_process);
DECL_HANDLER(terminate_thread);
DECL_HANDLER(get_process_info);
DECL_HANDLER(close_handle);
DECL_HANDLER(dup_handle);
DECL_HANDLER(open_process);
static const struct handler {
void (*handler)();
unsigned int min_size;
} req_handlers[REQ_NB_REQUESTS] = {
{ (void(*)())req_new_thread, sizeof(struct new_thread_request) },
{ (void(*)())req_init_thread, sizeof(struct init_thread_request) },
{ (void(*)())req_terminate_process, sizeof(struct terminate_process_request) },
{ (void(*)())req_terminate_thread, sizeof(struct terminate_thread_request) },
{ (void(*)())req_get_process_info, sizeof(struct get_process_info_request) },
{ (void(*)())req_close_handle, sizeof(struct close_handle_request) },
{ (void(*)())req_dup_handle, sizeof(struct dup_handle_request) },
{ (void(*)())req_open_process, sizeof(struct open_process_request) },
};
#endif /* WANT_REQUEST_HANDLERS */
#endif /* __WINE_SERVER_REQUEST_H */

52
include/server/thread.h Normal file
View File

@ -0,0 +1,52 @@
/*
* Wine server threads
*
* Copyright (C) 1998 Alexandre Julliard
*/
#ifndef __WINE_SERVER_THREAD_H
#define __WINE_SERVER_THREAD_H
#ifndef __WINE_SERVER__
#error This file can only be used in the Wine server
#endif
#include "server/object.h"
/* thread structure */
struct process;
struct thread
{
struct object obj; /* object header */
struct thread *next; /* system-wide thread list */
struct thread *prev;
struct thread *proc_next; /* per-process thread list */
struct thread *proc_prev;
struct process *process;
int error; /* current error code */
int exit_code; /* thread exit code */
int client_fd; /* client fd for socket communications */
int unix_pid; /* Unix pid of client */
enum request last_req; /* last request received (for debugging) */
char *name;
};
extern struct thread *current;
/* thread functions */
extern struct thread *create_thread( int fd, void *pid, int *thread_handle,
int *process_handle );
extern struct thread *get_thread_from_id( void *id );
extern struct thread *get_thread_from_handle( int handle, unsigned int access );
extern int send_reply( struct thread *thread, int pass_fd,
int n, ... /* arg_1, len_1, ..., arg_n, len_n */ );
extern void kill_thread( struct thread *thread, int exit_code );
extern void thread_killed( struct thread *thread, int exit_code );
#define SET_ERROR(err) (current->error = (err))
#define CLEAR_ERROR() (current->error = 0)
#endif /* __WINE_SERVER_THREAD_H */

View File

@ -25,6 +25,37 @@ extern void SHELL_Init();
#define SHELL_ERROR_INVALID_PARAMETER 7L
#define SHELL_ERROR_ACCESS_DENIED 8L
/******************************
* common shell file structures
*/
#define FO_MOVE 0x0001
#define FO_COPY 0x0002
#define FO_DELETE 0x0003
#define FO_RENAME 0x0004
#define FOF_MULTIDESTFILES 0x0001
#define FOF_CONFIRMMOUSE 0x0002
#define FOF_SILENT 0x0004
#define FOF_RENAMEONCOLLISION 0x0008
#define FOF_NOCONFIRMATION 0x0010
#define FOF_WANTMAPPINGHANDLE 0x0020
#define FOF_ALLOWUNDO 0x0040
#define FOF_FILESONLY 0x0080
#define FOF_SIMPLEPROGRESS 0x0100
#define FOF_NOCONFIRMMKDIR 0x0200
#define FOF_NOERRORUI 0x0400
typedef WORD FILEOP_FLAGS;
#define PO_DELETE 0x0013
#define PO_RENAME 0x0014
#define PO_PORTCHANGE 0x0020
typedef WORD PRINTEROP_FLAGS;
/******************************
* DROPFILESTRUCT
*/
typedef struct { /* structure for dropped files */
WORD wSize;
POINT16 ptMousePos;
@ -32,6 +63,9 @@ typedef struct { /* structure for dropped files */
/* memory block with filenames follows */
} DROPFILESTRUCT, *LPDROPFILESTRUCT;
/******************************
* NOTIFYICONDATA
*/
typedef struct _NOTIFYICONDATA {
DWORD cbSize;
HWND32 hWnd;
@ -42,6 +76,29 @@ typedef struct _NOTIFYICONDATA {
CHAR szTip[64];
} NOTIFYICONDATA, *PNOTIFYICONDATA;
/*******************************
* SHITEMID, ITEMIDLIST, PIDL API
*/
typedef struct
{ WORD cb; /* nr of bytes in this item */
BYTE abID[1];/* first byte in this item */
} SHITEMID,*LPSHITEMID;
typedef struct
{ SHITEMID mkid; /* first itemid in list */
} ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST;
LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl);
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST iil1,LPCITEMIDLIST iil2);
DWORD WINAPI ILGetSize(LPITEMIDLIST pidl);
DWORD WINAPI SHGetPathFromIDList32A (LPCITEMIDLIST pidl,LPSTR pszPath);
DWORD WINAPI SHGetPathFromIDList32W (LPCITEMIDLIST pidl,LPWSTR pszPath);
#define SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
/****************************************************************************
* SHFILEINFO API
*/
typedef struct tagSHFILEINFO32A {
HICON32 hIcon; /* icon */
int iIcon; /* icon index */
@ -60,6 +117,45 @@ typedef struct tagSHFILEINFO32W {
DECL_WINELIB_TYPE_AW(SHFILEINFO)
DWORD WINAPI SHGetFileInfo32A(LPCSTR,DWORD,SHFILEINFO32A*,UINT32,UINT32);
DWORD WINAPI SHGetFileInfo32W(LPCWSTR,DWORD,SHFILEINFO32W*,UINT32,UINT32);
#define SHGetFileInfo WINELIB_NAME_AW(SHGetFileInfo)
/****************************************************************************
* SHFILEOPSTRUCT API
*/
typedef struct _SHFILEOPSTRUCTA
{ HWND32 hwnd;
UINT32 wFunc;
LPCSTR pFrom;
LPCSTR pTo;
FILEOP_FLAGS fFlags;
BOOL32 fAnyOperationsAborted;
LPVOID hNameMappings;
LPCSTR lpszProgressTitle;
} SHFILEOPSTRUCT32A, *LPSHFILEOPSTRUCT32A;
typedef struct _SHFILEOPSTRUCTW
{ HWND32 hwnd;
UINT32 wFunc;
LPCWSTR pFrom;
LPCWSTR pTo;
FILEOP_FLAGS fFlags;
BOOL32 fAnyOperationsAborted;
LPVOID hNameMappings;
LPCWSTR lpszProgressTitle;
} SHFILEOPSTRUCT32W, *LPSHFILEOPSTRUCT32W;
typedef SHFILEOPSTRUCT32A SHFILEOPSTRUCT32;
typedef LPSHFILEOPSTRUCT32A LPSHFILEOPSTRUCT32;
DECL_WINELIB_TYPE_AW(SHFILEOPSTRUCT)
DWORD WINAPI SHFileOperation32(LPSHFILEOPSTRUCT32 lpFileOp);
/****************
* APPBARDATA
*/
typedef struct _AppBarData {
DWORD cbSize;
HWND32 hWnd;
@ -84,9 +180,33 @@ typedef struct _AppBarData {
#define SHGFI_SHELLICONSIZE 0x000000004 /* get shell size icon */
#define SHGFI_PIDL 0x000000008 /* pszPath is a pidl */
#define SHGFI_USEFILEATTRIBUTES 0x000000010 /* use passed dwFileAttribute */
DWORD WINAPI SHGetFileInfo32A(LPCSTR,DWORD,SHFILEINFO32A*,UINT32,UINT32);
DWORD WINAPI SHGetFileInfo32W(LPCWSTR,DWORD,SHFILEINFO32W*,UINT32,UINT32);
#define SHGetFileInfo WINELIB_NAME_AW(SHGetFileInfo)
/****************************************************************************
* SHChangeNotifyRegister API
*/
typedef struct
{ LPITEMIDLIST pidl;
DWORD unknown;
} IDSTRUCT;
DWORD WINAPI SHChangeNotifyRegister(HWND32 hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist);
DWORD WINAPI SHChangeNotifyDeregister(LONG x1,LONG x2);
/****************************************************************************
* SHAddToRecentDocs API
*/
#define SHARD_PIDL 0x00000001L
#define SHARD_PATH 0x00000002L
DWORD WINAPI SHAddToRecentDocs(UINT32 uFlags, LPCVOID pv);
/****************************************************************************
* other functions
*/
LPVOID WINAPI SHAlloc(DWORD len);
DWORD WINAPI SHFree(LPVOID x);
LPSTR WINAPI PathAddBackslash(LPSTR path);
LPSTR WINAPI PathCombine(LPSTR target,LPSTR x1,LPSTR x2);
LPSTR WINAPI PathRemoveBlanks(LPSTR str);
#define SE_ERR_SHARE 26
#define SE_ERR_ASSOCINCOMPLETE 27
@ -113,4 +233,10 @@ DWORD WINAPI SHGetFileInfo32W(LPCWSTR,DWORD,SHFILEINFO32W*,UINT32,UINT32);
#define CSIDL_FONTS 0x0014
#define CSIDL_TEMPLATES 0x0015
/*******************************************
* global SHELL32.DLL variables
*/
extern HINSTANCE32 shell32_hInstance;
extern UINT32 shell32_DllRefCount;
#endif /* __WINE_SHELL_H */

View File

@ -5,6 +5,8 @@
#include "ole.h"
#include "ole2.h"
#include "compobj.h"
#include "storage.h"
#include "commctrl.h"
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
@ -12,88 +14,41 @@
#define FAR
#define THIS_ THIS,
/* common shell file structures*/
#define FO_MOVE 0x0001
#define FO_COPY 0x0002
#define FO_DELETE 0x0003
#define FO_RENAME 0x0004
#define FOF_MULTIDESTFILES 0x0001
#define FOF_CONFIRMMOUSE 0x0002
#define FOF_SILENT 0x0004
#define FOF_RENAMEONCOLLISION 0x0008
#define FOF_NOCONFIRMATION 0x0010
#define FOF_WANTMAPPINGHANDLE 0x0020
#define FOF_ALLOWUNDO 0x0040
#define FOF_FILESONLY 0x0080
#define FOF_SIMPLEPROGRESS 0x0100
#define FOF_NOCONFIRMMKDIR 0x0200
#define FOF_NOERRORUI 0x0400
typedef WORD FILEOP_FLAGS;
#define PO_DELETE 0x0013
#define PO_RENAME 0x0014
#define PO_PORTCHANGE 0x0020
/****************************************************************************
* DllGetClassObject
*/
DWORD WINAPI SHELL32_DllGetClassObject(LPCLSID,REFIID,LPVOID*);
typedef WORD PRINTEROP_FLAGS;
typedef struct _SHFILEOPSTRUCTA
{ HWND32 hwnd;
UINT32 wFunc;
LPCSTR pFrom;
LPCSTR pTo;
FILEOP_FLAGS fFlags;
BOOL32 fAnyOperationsAborted;
LPVOID hNameMappings;
LPCSTR lpszProgressTitle;
} SHFILEOPSTRUCT32A, FAR *LPSHFILEOPSTRUCT32A;
typedef struct _SHFILEOPSTRUCTW
{ HWND32 hwnd;
UINT32 wFunc;
LPCWSTR pFrom;
LPCWSTR pTo;
FILEOP_FLAGS fFlags;
BOOL32 fAnyOperationsAborted;
LPVOID hNameMappings;
LPCWSTR lpszProgressTitle;
} SHFILEOPSTRUCT32W, FAR *LPSHFILEOPSTRUCT32W;
typedef SHFILEOPSTRUCT32A SHFILEOPSTRUCT32;
typedef LPSHFILEOPSTRUCT32A LPSHFILEOPSTRUCT32;
/*common IDList structures*/
typedef struct {
WORD cb; /* nr of bytes in this item */
BYTE abID[1];/* first byte in this item */
} SHITEMID,*LPSHITEMID;
typedef struct {
SHITEMID mkid; /* first itemid in list */
} ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST;
/* for SHChangeNotifyRegister*/
typedef struct {
LPITEMIDLIST pidl;
DWORD unknown;
} IDSTRUCT;
/* for SHAddToRecentDocs*/
#define SHARD_PIDL 0x00000001L
#define SHARD_PATH 0x00000002L
typedef LPVOID LPBC; /* *IBindCtx really */
/*
* shell32 classids
*/
/* foreward declaration of the objects*/
typedef struct IEnumIDList IEnumIDList,*LPENUMIDLIST;
typedef struct tagSHELLFOLDER *LPSHELLFOLDER,IShellFolder;
typedef struct tagSHELLVIEW *LPSHELLVIEW,IShellView;
typedef struct tagSHELLBROWSER *LPSHELLBROWSER,IShellBrowser;
/****************************************************************************
* SHELL ID
*/
/* shell32 classids */
DEFINE_SHLGUID(CLSID_ShellDesktop, 0x00021400L, 0, 0);
DEFINE_SHLGUID(CLSID_ShellLink, 0x00021401L, 0, 0);
/* shell32 formatids */
DEFINE_SHLGUID(FMTID_Intshcut, 0x000214A0L, 0, 0);
DEFINE_SHLGUID(FMTID_InternetSite, 0x000214A1L, 0, 0);
/* command group ids */
DEFINE_SHLGUID(CGID_Explorer, 0x000214D0L, 0, 0);
DEFINE_SHLGUID(CGID_ShellDocView, 0x000214D1L, 0, 0);
/*
* shell32 Interface ids
*/
/* shell32 Interface ids */
DEFINE_SHLGUID(IID_INewShortcutHookA, 0x000214E1L, 0, 0);
DEFINE_SHLGUID(IID_IShellBrowser, 0x000214E2L, 0, 0);
DEFINE_SHLGUID(IID_IShellView, 0x000214E3L, 0, 0);
DEFINE_SHLGUID(IID_IContextMenu, 0x000214E4L, 0, 0);
DEFINE_SHLGUID(IID_IShellIcon, 0x000214E5L, 0, 0);
DEFINE_SHLGUID(IID_IShellFolder, 0x000214E6L, 0, 0);
DEFINE_SHLGUID(IID_IShellExtInit, 0x000214E8L, 0, 0);
DEFINE_SHLGUID(IID_IShellPropSheetExt, 0x000214E9L, 0, 0);
@ -101,12 +56,25 @@ DEFINE_SHLGUID(IID_IExtractIcon, 0x000214EBL, 0, 0);
DEFINE_SHLGUID(IID_IShellLink, 0x000214EEL, 0, 0);
DEFINE_SHLGUID(IID_IShellCopyHook, 0x000214EFL, 0, 0);
DEFINE_SHLGUID(IID_IFileViewer, 0x000214F0L, 0, 0);
DEFINE_SHLGUID(IID_ICommDlgBrowser, 0x000214F1L, 0, 0);
DEFINE_SHLGUID(IID_IEnumIDList, 0x000214F2L, 0, 0);
DEFINE_SHLGUID(IID_IFileViewerSite, 0x000214F3L, 0, 0);
DEFINE_SHLGUID(IID_IContextMenu2, 0x000214F4L, 0, 0);
DEFINE_SHLGUID(IID_IShellExecuteHookA, 0x000214F5L, 0, 0);
DEFINE_SHLGUID(IID_IPropSheetPage, 0x000214F6L, 0, 0);
DEFINE_SHLGUID(IID_INewShortcutHookW, 0x000214F7L, 0, 0);
DEFINE_SHLGUID(IID_IFileViewerW, 0x000214F8L, 0, 0);
DEFINE_SHLGUID(IID_IShellLinkW, 0x000214F9L, 0, 0);
DEFINE_SHLGUID(IID_IExtractIconW, 0x000214FAL, 0, 0);
DEFINE_SHLGUID(IID_IShellExecuteHookW, 0x000214FBL, 0, 0);
DEFINE_SHLGUID(IID_IShellCopyHookW, 0x000214FCL, 0, 0);
#define STRRET_WSTR 0x0000
/****************************************************************************
* STRRET
*/
#define STRRET_WSTR 0x0000
#define STRRET_OFFSET 0x0001
#define STRRET_CSTR 0x0002
#define STRRET_CSTR 0x0002
typedef struct _STRRET
{ UINT32 uType; /* STRRET_xxx */
@ -126,18 +94,18 @@ typedef struct _STRRET
typedef enum tagPIDLTYPE
{ PT_DESKTOP = 0x00000000,
PT_MYCOMP = 0x00000001,
PT_CONTROL = 0x00000002,
PT_RECYCLER =0x00000004,
PT_CONTROL = 0x00000002,
PT_RECYCLER =0x00000004,
PT_DRIVE = 0x00000008,
PT_FOLDER = 0x00000010,
PT_VALUE = 0x00000020,
PT_VALUE = 0x00000020,
PT_TEXT = PT_FOLDER | PT_VALUE
} PIDLTYPE;
typedef struct tagPIDLDATA
{ PIDLTYPE type;
CHAR szText[1];
}PIDLDATA, FAR *LPPIDLDATA;
} PIDLDATA, FAR *LPPIDLDATA;
typedef struct pidlmgr pidlmgr,*LPPIDLMGR;
typedef struct PidlMgr_VTable
@ -146,13 +114,11 @@ typedef struct PidlMgr_VTable
STDMETHOD_(LPITEMIDLIST, CreateDrive) (THIS_ LPCSTR);
STDMETHOD_(LPITEMIDLIST, CreateFolder) (THIS_ LPCSTR);
STDMETHOD_(LPITEMIDLIST, CreateValue) (THIS_ LPCSTR);
STDMETHOD_(void, Delete) (THIS_ LPITEMIDLIST);
/* STDMETHOD_(void, Delete) (THIS_ LPITEMIDLIST);*/
STDMETHOD_(LPITEMIDLIST, GetNextItem) (THIS_ LPCITEMIDLIST);
STDMETHOD_(LPITEMIDLIST, Copy) (THIS_ LPCITEMIDLIST);
STDMETHOD_(UINT16, GetSize) (THIS_ LPCITEMIDLIST);
STDMETHOD_(BOOL32, GetDesktop) (THIS_ LPCITEMIDLIST, LPSTR);
STDMETHOD_(BOOL32, GetDrive) (THIS_ LPCITEMIDLIST, LPSTR, UINT16);
STDMETHOD_(LPITEMIDLIST, GetLastItem) (THIS_ LPCITEMIDLIST);
STDMETHOD_(LPITEMIDLIST, GetLastItem) (THIS_ LPCITEMIDLIST);
STDMETHOD_(DWORD, GetItemText) (THIS_ LPCITEMIDLIST, LPSTR, UINT16);
STDMETHOD_(BOOL32, IsDesktop) (THIS_ LPCITEMIDLIST);
STDMETHOD_(BOOL32, IsMyComputer) (THIS_ LPCITEMIDLIST);
@ -162,15 +128,9 @@ typedef struct PidlMgr_VTable
STDMETHOD_(BOOL32, HasFolders) (THIS_ LPSTR, LPCITEMIDLIST);
STDMETHOD_(DWORD, GetFolderText) (THIS_ LPCITEMIDLIST, LPSTR, DWORD);
STDMETHOD_(DWORD, GetValueText) (THIS_ LPCITEMIDLIST, LPSTR, DWORD);
/* STDMETHOD_(BOOL32, GetValueType) (THIS_ LPCITEMIDLIST, LPDWORD);*/
STDMETHOD_(BOOL32, GetValueType) (THIS_ LPCITEMIDLIST, LPCITEMIDLIST, LPDWORD);
/* STDMETHOD_(DWORD, GetDataText) (THIS_ LPCITEMIDLIST, LPSTR, DWORD);*/
STDMETHOD_(DWORD, GetDataText) (THIS_ LPCITEMIDLIST, LPCITEMIDLIST, LPSTR, DWORD);
STDMETHOD_(DWORD, GetPidlPath) (THIS_ LPCITEMIDLIST, LPSTR, DWORD);
STDMETHOD_(LPITEMIDLIST, Concatenate) (THIS_ LPCITEMIDLIST, LPCITEMIDLIST);
STDMETHOD_(LPITEMIDLIST, Create) (THIS_ PIDLTYPE, LPVOID, UINT16);
STDMETHOD_(DWORD, GetData) (THIS_ PIDLTYPE, LPCITEMIDLIST, LPVOID, UINT16);
STDMETHOD_(LPPIDLDATA, GetDataPointer) (THIS_ LPCITEMIDLIST);
@ -179,8 +139,9 @@ typedef struct PidlMgr_VTable
} *LPPIDLMGR_VTABLE,PidlMgr_VTable;
struct pidlmgr
{ LPPIDLMGR_VTABLE lpvtbl;
{ LPPIDLMGR_VTABLE lpvtbl;
};
#ifdef __WINE__
extern LPPIDLMGR PidlMgr_Constructor();
extern void PidlMgr_Destructor(THIS);
@ -192,16 +153,16 @@ extern void PidlMgr_Destructor(THIS);
* IEnumIDList interface
*/
#define THIS LPENUMIDLIST this
typedef struct tagENUMLIST
{ struct tagENUMLIST *pNext;
LPITEMIDLIST pidl;
} ENUMLIST, *LPENUMLIST;
typedef struct IEnumIDList IEnumIDList,*LPENUMIDLIST;
typedef struct IEnumIDList_VTable {
/* *** IUnknown methods *** */
typedef struct IEnumIDList_VTable
{ /* *** IUnknown methods *** */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* *** IEnumIDList methods *** */
@ -212,26 +173,79 @@ typedef struct IEnumIDList_VTable {
STDMETHOD(Reset) (THIS) PURE;
STDMETHOD(Clone) (THIS_ IEnumIDList **ppenum) PURE;
/* *** private methods *** */
STDMETHOD_(BOOL32,CreateEnumList)(THIS_ LPCSTR, DWORD) PURE;
STDMETHOD_(BOOL32,CreateEnumList)(THIS_ LPCSTR, DWORD) PURE;
STDMETHOD_(BOOL32,AddToEnumList)(THIS_ LPITEMIDLIST) PURE;
STDMETHOD_(BOOL32,DeleteList)(THIS) PURE;
} IEnumIDList_VTable,*LPENUMIDLIST_VTABLE;
struct IEnumIDList {
LPENUMIDLIST_VTABLE lpvtbl;
DWORD ref;
LPPIDLMGR mpPidlMgr;
LPENUMLIST mpFirst;
LPENUMLIST mpLast;
LPENUMLIST mpCurrent;
struct IEnumIDList
{ LPENUMIDLIST_VTABLE lpvtbl;
DWORD ref;
LPPIDLMGR mpPidlMgr;
LPENUMLIST mpFirst;
LPENUMLIST mpLast;
LPENUMLIST mpCurrent;
};
#undef THIS
//--------------------------------------------------------------------------
//
// FOLDERSETTINGS
//
// FOLDERSETTINGS is a data structure that explorer passes from one folder
// view to another, when the user is browsing. It calls ISV::GetCurrentInfo
// member to get the current settings and pass it to ISV::CreateViewWindow
// to allow the next folder view "inherit" it. These settings assumes a
// particular UI (which the shell's folder view has), and shell extensions
// may or may not use those settings.
//
//--------------------------------------------------------------------------
typedef LPBYTE LPVIEWSETTINGS;
// NB Bitfields.
// FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL
typedef enum
{ FWF_AUTOARRANGE = 0x0001,
FWF_ABBREVIATEDNAMES = 0x0002,
FWF_SNAPTOGRID = 0x0004,
FWF_OWNERDATA = 0x0008,
FWF_BESTFITWINDOW = 0x0010,
FWF_DESKTOP = 0x0020,
FWF_SINGLESEL = 0x0040,
FWF_NOSUBFOLDERS = 0x0080,
FWF_TRANSPARENT = 0x0100,
FWF_NOCLIENTEDGE = 0x0200,
FWF_NOSCROLL = 0x0400,
FWF_ALIGNLEFT = 0x0800,
FWF_SINGLECLICKACTIVATE=0x8000 // TEMPORARY -- NO UI FOR THIS
} FOLDERFLAGS;
typedef enum
{ FVM_ICON = 1,
FVM_SMALLICON = 2,
FVM_LIST = 3,
FVM_DETAILS = 4,
} FOLDERVIEWMODE;
typedef struct
{ UINT32 ViewMode; // View mode (FOLDERVIEWMODE values)
UINT32 fFlags; // View options (FOLDERFLAGS bits)
} FOLDERSETTINGS, *LPFOLDERSETTINGS;
typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
/* FIXME; the next two lines are propersheet related, move to prsht.h when created */
struct _PSP;
typedef struct _PSP FAR* HPROPSHEETPAGE;
typedef BOOL32 (CALLBACK FAR * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
typedef BOOL32 (CALLBACK FAR * LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE,LPARAM);
/************************************************************************
* The IShellFolder interface ... the basic interface for a lot of stuff
* IShellFolder interface
*/
#define THIS LPSHELLFOLDER this
@ -279,50 +293,146 @@ typedef enum tagSHCONTF
#define SFGAO_VALIDATE 0x01000000L /* invalidate cached information */
#define SFGAO_REMOVABLE 0x02000000L /* is this removeable media? */
typedef struct tagSHELLFOLDER *LPSHELLFOLDER,IShellFolder;
typedef struct IShellFolder_VTable {
/* *** IUnknown methods *** */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* *** IPersist Folder methods *** */
/* STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE; */
/* *** IShellFolder methods *** */
STDMETHOD(ParseDisplayName) (THIS_ HWND32 hwndOwner,
LPBC pbcReserved, LPOLESTR32 lpszDisplayName,
ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
STDMETHOD(EnumObjects) ( THIS_ HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST
* ppenumIDList) PURE;
STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,
REFIID riid, LPVOID * ppvOut) PURE;
STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,
REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
STDMETHOD(CreateViewObject) (THIS_ HWND32 hwndOwner, REFIID riid, LPVOID * ppvOut) PURE;
STDMETHOD(GetAttributesOf) (THIS_ UINT32 cidl, LPCITEMIDLIST * apidl,
ULONG * rgfInOut) PURE;
STDMETHOD(GetUIObjectOf) (THIS_ HWND32 hwndOwner, UINT32 cidl, LPCITEMIDLIST
* apidl,
REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut) PURE;
STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
STDMETHOD(SetNameOf) (THIS_ HWND32 hwndOwner, LPCITEMIDLIST pidl,
LPCOLESTR32 lpszName, DWORD uFlags,
LPITEMIDLIST * ppidlOut) PURE;
STDMETHOD(ParseDisplayName) (THIS_ HWND32 hwndOwner,LPBC pbcReserved, LPOLESTR32 lpszDisplayName,ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
STDMETHOD(EnumObjects)( THIS_ HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST * ppenumIDList) PURE;
STDMETHOD(BindToObject)(THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,REFIID riid, LPVOID * ppvOut) PURE;
STDMETHOD(BindToStorage)(THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD(CompareIDs)(THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
STDMETHOD(CreateViewObject)(THIS_ HWND32 hwndOwner, REFIID riid, LPVOID * ppvOut) PURE;
STDMETHOD(GetAttributesOf)(THIS_ UINT32 cidl, LPCITEMIDLIST * apidl,ULONG * rgfInOut) PURE;
STDMETHOD(GetUIObjectOf)(THIS_ HWND32 hwndOwner, UINT32 cidl, LPCITEMIDLIST * apidl,REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut) PURE;
STDMETHOD(GetDisplayNameOf)(THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
STDMETHOD(SetNameOf)(THIS_ HWND32 hwndOwner, LPCITEMIDLIST pidl,LPCOLESTR32 lpszName, DWORD uFlags,LPITEMIDLIST * ppidlOut) PURE;
} *LPSHELLFOLDER_VTABLE,IShellFolder_VTable;
struct tagSHELLFOLDER {
LPSHELLFOLDER_VTABLE lpvtbl;
DWORD ref;
LPSTR mlpszFolder;
LPPIDLMGR pPidlMgr;
LPPIDLMGR pPidlMgr;
LPITEMIDLIST mpidl;
LPITEMIDLIST mpidlNSRoot;
LPSHELLFOLDER mpSFParent;
};
extern LPSHELLFOLDER pdesktopfolder;
#undef THIS
/************************************************************************
* IShellBrowser Inteface
*/
#define THIS LPSHELLBROWSER this
typedef struct IShellBrowser_VTable
{ // *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IOleWindow methods ***
STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
// *** IShellBrowser methods *** (same as IOleInPlaceFrame)
STDMETHOD(InsertMenusSB) (THIS_ HMENU32 hmenuShared, LPOLEMENUGROUPWIDTHS32 lpMenuWidths) PURE;
STDMETHOD(SetMenuSB) (THIS_ HMENU32 hmenuShared, HOLEMENU32 holemenuReserved, HWND32 hwndActiveObject) PURE;
STDMETHOD(RemoveMenusSB) (THIS_ HMENU32 hmenuShared) PURE;
STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR32 lpszStatusText) PURE;
STDMETHOD(EnableModelessSB) (THIS_ BOOL32 fEnable) PURE;
STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG32 lpmsg, WORD wID) PURE;
// *** IShellBrowser methods ***
STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT32 wFlags) PURE;
STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode, LPSTREAM32 *ppStrm) PURE;
STDMETHOD(GetControlWindow)(THIS_ UINT32 id, HWND32 * lphwnd) PURE;
STDMETHOD(SendControlMsg)(THIS_ UINT32 id, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, LRESULT * pret) PURE;
STDMETHOD(QueryActiveShellView)(THIS_ IShellView ** ppshv) PURE;
STDMETHOD(OnViewWindowActive)(THIS_ IShellView * ppshv) PURE;
STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT32 nButtons, UINT32 uFlags) PURE;
} *LPSHELLBROWSER_VTABLE,IShellBrowser_VTable;;
struct tagSHELLBROWSER
{ LPSHELLBROWSER_VTABLE lpvtbl;
DWORD ref;
};
#undef THIS
/************************************************************************
* IShellView Inteface
*/
#define THIS LPSHELLVIEW this
/* shellview select item flags*/
#define SVSI_DESELECT 0x0000
#define SVSI_SELECT 0x0001
#define SVSI_EDIT 0x0003 // includes select
#define SVSI_DESELECTOTHERS 0x0004
#define SVSI_ENSUREVISIBLE 0x0008
#define SVSI_FOCUSED 0x0010
/* shellview get item object flags */
#define SVGIO_BACKGROUND 0x00000000
#define SVGIO_SELECTION 0x00000001
#define SVGIO_ALLVIEW 0x00000002
/* uState values for IShellView::UIActivate */
typedef enum
{ SVUIA_DEACTIVATE = 0,
SVUIA_ACTIVATE_NOFOCUS = 1,
SVUIA_ACTIVATE_FOCUS = 2,
SVUIA_INPLACEACTIVATE = 3 // new flag for IShellView2
} SVUIA_STATUS;
typedef struct IShellView_VTable
{ // *** IUnknown methods ***
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// *** IOleWindow methods ***
STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
// *** IShellView methods ***
STDMETHOD(TranslateAccelerator) (THIS_ LPMSG32 lpmsg) PURE;
STDMETHOD(EnableModeless) (THIS_ BOOL32 fEnable) PURE;
STDMETHOD(UIActivate) (THIS_ UINT32 uState) PURE;
STDMETHOD(Refresh) (THIS) PURE;
STDMETHOD(CreateViewWindow)(THIS_ IShellView *lpPrevView,LPCFOLDERSETTINGS lpfs, IShellBrowser * psb,RECT32 * prcView, HWND32 *phWnd) PURE;
STDMETHOD(DestroyViewWindow)(THIS) PURE;
STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
STDMETHOD(SaveViewState)(THIS) PURE;
STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT32 uFlags) PURE;
STDMETHOD(GetItemObject)(THIS_ UINT32 uItem, REFIID riid,LPVOID *ppv) PURE;
} IShellView_VTable,*LPSHELLVIEW_VTABLE;;
struct tagSHELLVIEW
{ LPSHELLVIEW_VTABLE lpvtbl;
DWORD ref;
LPITEMIDLIST mpidl;
LPSHELLFOLDER pSFParent;
LPSHELLBROWSER pShellBrowser;
HWND32 hWnd;
FOLDERSETTINGS FolderSettings;
HWND32 hWndParent;
};
typedef GUID SHELLVIEWID;
#define SV_CLASS_NAME ("ShellViewClass")
#undef THIS
/****************************************************************************
* IShellLink interface
*/
@ -389,8 +499,10 @@ struct IShellLink {
#undef THIS
#ifdef __WINE__
extern LPCLASSFACTORY IClassFactory_Constructor();
extern LPSHELLFOLDER IShellFolder_Constructor(LPSHELLFOLDER,LPITEMIDLIST);
extern LPSHELLVIEW IShellView_Constructor();
extern LPSHELLLINK IShellLink_Constructor();
extern LPENUMIDLIST IEnumIDList_Constructor(LPCSTR,DWORD,HRESULT*);
#endif
@ -452,8 +564,6 @@ typedef struct tagBROWSEINFO32W {
#define BFFM_SETSELECTIONW (WM_USER+103)
#define BFFM_SETSTATUSTEXTW (WM_USER+104)
/*
#ifdef UNICODE
#define SHBrowseForFolder SHBrowseForFolderW
@ -470,10 +580,30 @@ typedef struct tagBROWSEINFO32W {
#endif
*/
LPITEMIDLIST WINAPI SHBrowseForFolder32A(LPBROWSEINFO32A lpbi);
/*LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);*/
#define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
/****************************************************************************
* shlview structures
*/
typedef HRESULT(CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,HWND32 hwnd,UINT32 uMsg,UINT32 wParam,LPARAM lParam);
/*
* IShellFolderViewCallback Callback
* This "callback" is called by the shells default IShellView implementation (that
* we got using SHCreateShellViewEx()), to notify us of the various things that
* are happening to the shellview (and ask for things too).
*
* You don't have to support anything here - anything you don't want to
* handle, the shell will do itself if you just return E_NOTIMPL. This parameters
* that the shell passes to this function are entirely undocumented.
*
* HOWEVER, as the cabview sample as originally written used this callback, the
* writers implemented the callback mechanism on top of their own IShellView.
* Look there for some clues on what to do here.
*/
typedef HRESULT(CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,
HWND32 hwnd,UINT32 uMsg,UINT32 wParam,LPARAM lParam);
/* NF valid values for the "viewmode" item of the SHELLTEMPLATE*/
#define NF_INHERITVIEW 0x0000
@ -489,22 +619,6 @@ typedef struct _SHELLVIEWDATA // idl
DWORD viewmode; // NF_* enum
} SHELLVIEWDATA, * LPSHELLVIEWDATA;
/****************************************************************************
* functions
*/
DWORD WINAPI ILGetSize(LPITEMIDLIST iil);
DWORD WINAPI SHAddToRecentDocs(UINT32 uFlags, LPCVOID pv);
LPVOID WINAPI SHAlloc(DWORD len);
LPITEMIDLIST WINAPI SHBrowseForFolder32A(LPBROWSEINFO32A lpbi);
/*LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);*/
DWORD WINAPI SHChangeNotifyRegister(HWND32 hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist);
DWORD WINAPI SHELL32_DllGetClassObject(LPCLSID,REFIID,LPVOID*);
DWORD WINAPI SHFileOperation32(LPSHFILEOPSTRUCT32 lpFileOp);
LPSTR WINAPI PathAddBackslash(LPSTR path);
LPSTR WINAPI PathRemoveBlanks(LPSTR str);
#undef PURE
#undef FAR
#undef THIS

View File

@ -18,13 +18,13 @@
typedef struct _STACK32FRAME
{
SEGPTR frame16; /* 00 16-bit frame from last CallFrom16() */
DWORD edi; /* 04 saved registers */
DWORD esi; /* 08 */
DWORD edx; /* 0c */
DWORD ecx; /* 10 */
DWORD ebx; /* 14 */
DWORD restore_addr; /* 18 return address for restoring code selector */
DWORD codeselector; /* 1c code selector to restore */
DWORD restore_addr; /* 04 return address for restoring code selector */
DWORD codeselector; /* 08 code selector to restore */
DWORD edi; /* 0c saved registers */
DWORD esi; /* 10 */
DWORD edx; /* 14 */
DWORD ecx; /* 18 */
DWORD ebx; /* 1c */
DWORD ebp; /* 20 saved 32-bit frame pointer */
DWORD retaddr; /* 24 actual return address */
DWORD args[1]; /* 28 arguments to 16-bit function */
@ -35,14 +35,16 @@ typedef struct
{
STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
DWORD ebp; /* 04 full 32-bit content of ebp */
WORD entry_ip; /* 08 ip of entry point */
WORD ds; /* 0a ds */
WORD entry_cs; /* 0c cs of entry point */
WORD es; /* 0e es */
DWORD entry_point; /* 10 32-bit entry point to call */
WORD bp; /* 14 16-bit bp */
WORD ip; /* 16 return address */
WORD cs; /* 18 */
WORD mutex_count; /* 08 Win16Mutex recursion count */
WORD fs; /* 0a fs */
WORD entry_ip; /* 0c ip of entry point */
WORD ds; /* 0e ds */
WORD entry_cs; /* 10 cs of entry point */
WORD es; /* 12 es */
DWORD entry_point; /* 14 32-bit entry point to call */
WORD bp; /* 18 16-bit bp */
WORD ip; /* 1a return address */
WORD cs; /* 1c */
} STACK16FRAME;
#pragma pack(4)

View File

@ -24,6 +24,7 @@ typedef struct
UINT16 textHeight;
UINT32 height;
BOOL32 simple;
HWND32 hwndToolTip;
HFONT32 hFont;
HFONT32 hDefaultFont;
COLORREF clrBk; /* background color */

28
include/syslevel.h Normal file
View File

@ -0,0 +1,28 @@
/*
* Win32 'syslevel' routines
*
* Copyright 1998 Ulrich Weigand
*/
#ifndef __WINE_SYSLEVEL_H
#define __WINE_SYSLEVEL_H
#include "wintypes.h"
#include "winbase.h"
void SYSLEVEL_Init(void);
VOID SYSLEVEL_EnterWin16Lock(VOID);
VOID SYSLEVEL_LeaveWin16Lock(VOID);
VOID SYSLEVEL_ReleaseWin16Lock(VOID);
VOID SYSLEVEL_RestoreWin16Lock(VOID);
VOID WINAPI GetpWin16Lock32(CRITICAL_SECTION **lock);
SEGPTR WINAPI GetpWin16Lock16(void);
VOID WINAPI _EnterSysLevel(CRITICAL_SECTION *lock);
VOID WINAPI _LeaveSysLevel(CRITICAL_SECTION *lock);
VOID WINAPI ReleaseThunkLock(DWORD *mutex_count);
VOID WINAPI RestoreThunkLock(DWORD mutex_count);
#endif /* __WINE_SYSLEVEL_H */

View File

@ -9,6 +9,7 @@
#include "k32obj.h"
#include "windows.h"
#include "winbase.h"
#include "winnt.h"
#include "selectors.h" /* for SET_FS */
@ -41,6 +42,7 @@ typedef struct
DWORD count; /* Count of valid objects */
DWORD signaled; /* Index of signaled object (or WAIT_FAILED)*/
BOOL32 wait_all; /* Wait for all objects flag */
BOOL32 wait_msg; /* Wait for message flag */
K32OBJ *objs[MAXIMUM_WAIT_OBJECTS]; /* Object pointers */
} WAIT_STRUCT;
@ -70,7 +72,7 @@ typedef struct _THDB
DWORD cur_stack; /* 80 Current stack (was: unknown) */
DWORD unknown3[2]; /* 84 Unknown */
WORD current_ss; /* 8c Another 16-bit stack selector */
WORD saved_fs; /* 8e Saved 16-bit FS (was: pad2) */
WORD pad2; /* 8e */
void *ss_table; /* 90 Pointer to info about 16-bit stack */
WORD thunk_ss; /* 94 Yet another 16-bit stack selector */
WORD pad3; /* 96 */
@ -82,12 +84,10 @@ typedef struct _THDB
void *entry_point; /* 1c0 Thread entry point (was: unknown) */
void *entry_arg; /* 1c4 Entry point arg (was: unknown) */
int unix_pid; /* 1c8 Unix thread pid (was: unknown) */
DWORD unknown5[6]; /* 1cc Unknown */
K32OBJ *crit_section; /* 1e4 Some critical section */
K32OBJ *win16_mutex; /* 1e8 Pointer to Win16 mutex */
K32OBJ *win32_mutex; /* 1ec Pointer to KERNEL32 mutex */
K32OBJ *crit_section2; /* 1f0 Another critical section */
K32OBJ *mutex_list; /* 1f4 List of owned mutex (was: unknown)*/
K32OBJ *mutex_list; /* 1cc List of owned mutex (was: unknown)*/
DWORD unknown5[2]; /* 1d0 Unknown */
DWORD sys_count[4]; /* 1d8 Syslevel mutex entry counters */
CRITICAL_SECTION *sys_mutex[4];/* 1e8 Syslevel mutex pointers */
DWORD unknown6[2]; /* 1f8 Unknown */
/* The following are Wine-specific fields */
CONTEXT context; /* 200 Thread context */
@ -125,9 +125,11 @@ extern THDB *pCurrentThread;
/* scheduler/thread.c */
extern THDB *THREAD_Create( struct _PDB32 *pdb, DWORD stack_size,
BOOL32 alloc_stack16,
int *server_thandle, int *server_phandle,
LPTHREAD_START_ROUTINE start_addr, LPVOID param );
extern THDB *THREAD_Current(void);
extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access );
extern void THREAD_Start( THDB *thdb );
extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access, int *server_handle );
extern void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread );
extern void THREAD_RemoveQueue( THREAD_QUEUE *queue, THDB *thread );
extern DWORD THREAD_TlsAlloc( THDB *thread );
@ -142,7 +144,12 @@ extern void MUTEX_Abandon( K32OBJ *obj );
/* scheduler/synchro.c */
extern void SYNC_WaitForCondition( WAIT_STRUCT *wait, DWORD timeout );
extern void SYNC_WakeUp( THREAD_QUEUE *queue, DWORD max );
extern void SYNC_MsgWakeUp( THDB *thdb );
extern void SYNC_SetupSignals(void);
extern DWORD SYNC_DoWait( DWORD count, const HANDLE32 *handles,
BOOL32 wait_all, DWORD timeout,
BOOL32 alertable, BOOL32 wait_msg );
/* scheduler/sysdeps.c */
extern int SYSDEPS_SpawnThread( THDB *thread );

View File

@ -18,7 +18,7 @@ typedef struct tagTTTOOL_INFO
LPSTR lpszText;
LPARAM lParam;
WNDPROC32 lpfnOrigProc;
} TTTOOL_INFO;
@ -26,21 +26,23 @@ typedef struct tagTOOLTIPS_INFO
{
CHAR szTipText[INFOTIPSIZE];
BOOL32 bActive;
BOOL32 bTrackActive;
UINT32 uNumTools;
COLORREF clrBk;
COLORREF clrText;
HFONT32 hFont;
INT32 xTrackPos;
INT32 yTrackPos;
INT32 nMaxTipWidth;
INT32 nTool;
INT32 nOldTool;
INT32 nCurrentTool;
INT32 nTrackTool;
INT32 nAutomaticTime;
INT32 nReshowTime;
INT32 nAutoPopTime;
INT32 nInitialTime;
RECT32 rcMargin;
TTTOOL_INFO *tools;
} TOOLTIPS_INFO;

View File

@ -13,17 +13,11 @@
int TWEAK_Init();
int TWEAK_CheckConfiguration();
INT32 TWEAK_PartyMessageBox(LPCSTR, LPCSTR, DWORD);
void TWEAK_DrawReliefRect95(HDC32, RECT32 const *);
void TWEAK_DrawRevReliefRect95(HDC32, RECT32 const *);
void TWEAK_DrawMenuSeparatorHoriz95(HDC32, UINT32, UINT32, UINT32);
void TWEAK_DrawMenuSeparatorVert95(HDC32, UINT32, UINT32, UINT32);
extern int TWEAK_Win95Look;
extern int TWEAK_WineInitialized;
extern HPEN32 TWEAK_PenFF95;
extern HPEN32 TWEAK_PenE095;
extern HPEN32 TWEAK_PenC095;
extern HPEN32 TWEAK_Pen8095;
extern HPEN32 TWEAK_Pen0095;
#endif /* __WINE_TWEAK_H */

View File

@ -29,7 +29,7 @@ extern WORD USER_HeapSel;
#define USUD_LOCALHEAP 0x0004
#define USUD_FIRSTCLASS 0x0005
void USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
void WINAPI USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
void USER_ExitWindows(void);
HGLOBAL16 USER_CallDefaultRsrcHandler( HGLOBAL16 hMemObj, HMODULE16 hModule,
HRSRC16 hRsrc );

View File

@ -109,7 +109,7 @@
#define VIF_OUTOFMEMORY 0x00008000L
#define VIF_CANNOTREADSRC 0x00010000L
#define VIF_CANNOTREADDST 0x00020000L
#define VIF_BUFTOSMALL 0x00040000L
#define VIF_BUFFTOOSMALL 0x00040000L
typedef struct tagVS_FIXEDFILEINFO {
DWORD dwSignature;

View File

@ -1 +1 @@
#define WINE_RELEASE_INFO "Wine release 980726"
#define WINE_RELEASE_INFO "Wine release 980809"

View File

@ -5203,25 +5203,38 @@ typedef struct {
/* Process startup information.
*/
/* STARTUPINFO.dwFlags */
#define STARTF_USESHOWWINDOW 0x00000001
#define STARTF_USESIZE 0x00000002
#define STARTF_USEPOSITION 0x00000004
#define STARTF_USECOUNTCHARS 0x00000008
#define STARTF_USEFILLATTRIBUTE 0x00000010
#define STARTF_RUNFULLSCREEN 0x00000020
#define STARTF_FORCEONFEEDBACK 0x00000040
#define STARTF_FORCEOFFFEEDBACK 0x00000080
#define STARTF_USESTDHANDLES 0x00000100
#define STARTF_USEHOTKEY 0x00000200
typedef struct {
DWORD cb;
LPSTR lpReserved;
LPSTR lpDesktop;
LPSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
BYTE *lpReserved2;
HANDLE32 hStdInput;
HANDLE32 hStdOutput;
HANDLE32 hStdError;
DWORD cb; /* 00: size of struct */
LPSTR lpReserved; /* 04: */
LPSTR lpDesktop; /* 08: */
LPSTR lpTitle; /* 0c: */
DWORD dwX; /* 10: */
DWORD dwY; /* 14: */
DWORD dwXSize; /* 18: */
DWORD dwYSize; /* 1c: */
DWORD dwXCountChars; /* 20: */
DWORD dwYCountChars; /* 24: */
DWORD dwFillAttribute; /* 28: */
DWORD dwFlags; /* 2c: */
WORD wShowWindow; /* 30: */
WORD cbReserved2; /* 32: */
BYTE *lpReserved2; /* 34: */
HANDLE32 hStdInput; /* 38: */
HANDLE32 hStdOutput; /* 3c: */
HANDLE32 hStdError; /* 40: */
} STARTUPINFO32A, *LPSTARTUPINFO32A;
typedef struct {
@ -5504,6 +5517,7 @@ typedef struct
DECL_WINELIB_TYPE_AW(DEVMODE)
DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DM_UPDATE 1
#define DM_COPY 2
#define DM_PROMPT 4
@ -5519,7 +5533,8 @@ DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DM_PRINTQUALITY 0x00000400L
#define DM_COLOR 0x00000800L
#define DM_DUPLEX 0x00001000L
#define DM_YRESOLUTION 0x00002000L
#define DM_TTOPTION 0x00004000L
#define DM_BITSPERPEL 0x00040000L
#define DM_PELSWIDTH 0x00080000L
#define DM_PELSHEIGHT 0x00100000L
@ -5531,13 +5546,34 @@ DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DMORIENT_PORTRAIT 1
#define DMORIENT_LANDSCAPE 2
#define DMPAPER_LETTER 1
#define DMPAPER_A3 8
#define DMPAPER_A4 9
#define DMPAPER_A5 11
#define DMPAPER_LETTER 1
#define DMPAPER_LEGAL 5
#define DMPAPER_EXECUTIVE 7
#define DMPAPER_A3 8
#define DMPAPER_A4 9
#define DMPAPER_A5 11
#define DMPAPER_ENV_10 20
#define DMPAPER_ENV_DL 27
#define DMPAPER_ENV_C5 28
#define DMPAPER_ENV_B5 34
#define DMPAPER_ENV_MONARCH 37
#define DMBIN_UPPER 1
#define DMBIN_LOWER 2
#define DMBIN_MIDDLE 3
#define DMBIN_MANUAL 4
#define DMBIN_ENVELOPE 5
#define DMBIN_ENVMANUAL 6
#define DMBIN_AUTO 7
#define DMBIN_LARGECAPACITY 11
#define DMCOLOR_MONOCHROME 1
#define DMCOLOR_COLOR 2
#define DMTT_BITMAP 1
#define DMTT_DOWNLOAD 2
#define DMTT_SUBDEV 3
#define DMBIN_UPPER 1
#define DMBIN_AUTO 7
#define DC_FIELDS 1
#define DC_PAPERS 2
@ -5558,6 +5594,7 @@ DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DC_ORIENTATION 17
#define DC_COPIES 18
typedef struct _PRINTER_DEFAULTS32A {
LPSTR pDatatype;
LPDEVMODE32A pDevMode;
@ -6705,6 +6742,7 @@ LONG WINAPI RegUnLoadKey32W(HKEY,LPCWSTR);
#define RegUnLoadKey WINELIB_NAME_AW(RegUnLoadKey)
BOOL32 WINAPI ReleaseSemaphore(HANDLE32,LONG,LPLONG);
BOOL32 WINAPI ResetEvent(HANDLE32);
DWORD WINAPI ResumeThread(HANDLE32);
VOID WINAPI RtlFillMemory(LPVOID,UINT32,UINT32);
VOID WINAPI RtlMoveMemory(LPVOID,LPCVOID,UINT32);
VOID WINAPI RtlZeroMemory(LPVOID,UINT32);
@ -6754,6 +6792,7 @@ DWORD WINAPI SleepEx(DWORD,BOOL32);
BOOL32 WINAPI StartService32A(HANDLE32,DWORD,LPCSTR*);
BOOL32 WINAPI StartService32W(HANDLE32,DWORD,LPCWSTR*);
#define StartService WINELIB_NAME_AW(StartService)
DWORD WINAPI SuspendThread(HANDLE32);
BOOL32 WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
WORD WINAPI TileWindows (HWND32, UINT32, const LPRECT32,
UINT32, const HWND32 *);
@ -6990,7 +7029,7 @@ BOOL32 WINAPI CheckRadioButton32(HWND32,UINT32,UINT32,UINT32);
HWND16 WINAPI ChildWindowFromPoint16(HWND16,POINT16);
HWND32 WINAPI ChildWindowFromPoint32(HWND32,POINT32);
#define ChildWindowFromPoint WINELIB_NAME(ChildWindowFromPoint)
INT32 ChoosePixelFormat(HDC32,PIXELFORMATDESCRIPTOR*);
INT32 WINAPI ChoosePixelFormat(HDC32,PIXELFORMATDESCRIPTOR*);
BOOL16 WINAPI Chord16(HDC16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,INT16);
BOOL32 WINAPI Chord32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
#define Chord WINELIB_NAME(Chord)
@ -8426,6 +8465,9 @@ BOOL32 WINAPI PlayMetaFileRecord32(HDC32,LPHANDLETABLE32,LPMETARECORD,UINT3
BOOL16 WINAPI PolyBezier16(HDC16,LPPOINT16,INT16);
BOOL32 WINAPI PolyBezier32(HDC32,LPPOINT32,DWORD);
#define PolyBezier WINELIB_NAME(PolyBezier)
BOOL16 WINAPI PolyBezierTo16(HDC16,LPPOINT16,INT16);
BOOL32 WINAPI PolyBezierTo32(HDC32,LPPOINT32,DWORD);
#define PolyBezierTo WINELIB_NAME(PolyBezierTo)
BOOL16 WINAPI PolyPolygon16(HDC16,LPPOINT16,LPINT16,UINT16);
BOOL32 WINAPI PolyPolygon32(HDC32,LPPOINT32,LPINT32,UINT32);
#define PolyPolygon WINELIB_NAME(PolyPolygon)

View File

@ -66,6 +66,11 @@ extern int WIN32_LastError;
#define ERROR_NO_NETWORK 1222
#define ERROR_ALREADY_INITIALIZED 1247
#define ERROR_PRIVILEGE_NOT_HELD 1314
#define ERROR_CANNOT_FIND_WND_CLASS 1407
#define ERROR_WINDOW_OF_OTHER_THREAD 1408
#define ERROR_CLASS_ALREADY_EXISTS 1410
#define ERROR_CLASS_DOES_NOT_EXIST 1411
#define ERROR_CLASS_HAS_WINDOWS 1412
#define ERROR_COMMITMENT_LIMIT 1455
#define ERROR_INVALID_PRINTER_NAME 1801
@ -155,4 +160,7 @@ extern int WIN32_LastError;
#define E_FAIL 0x80000008
#define E_ACCESSDENIED 0x80000009 */
/* Obtained from lcc-win32 include files */
#define GDI_ERROR 0xffffffff
#endif /* __WINE_WINERROR_H */

View File

@ -148,6 +148,9 @@ typedef HANDLE32 *PHANDLE;
#define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
#define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
#define ISV86(context) (EFL_reg(context) & 0x00020000)
#define V86BASE(context) ((context)->Dr7) /* ugly */
#endif /* __WINE__ */
/*

View File

@ -557,6 +557,12 @@ typedef struct _WSINFO
INT16 last_free; /* entry in the socket table */
UINT16 buflen;
char* buffer; /* allocated from SEGPTR heap */
struct ws_hostent *he;
int helen;
struct ws_servent *se;
int selen;
struct ws_protoent *pe;
int pelen;
char* dbuffer; /* buffer for dummies (32 bytes) */
ws_socket sock[WS_MAX_SOCKETS_PER_PROCESS];

19
loader/dos/Makefile.in Normal file
View File

@ -0,0 +1,19 @@
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dos
C_SRCS = \
module.c \
dosvm.c
all: $(MODULE).o dosmod
dosmod: dosmod.c
$(CC) $(ALLCFLAGS) -o dosmod $<
@MAKE_RULES@
### Dependencies:

77
loader/dos/dosmod.c Normal file
View File

@ -0,0 +1,77 @@
/*
* DOS Virtual Machine
*
* Copyright 1998 Ove Kåven
*/
#ifdef linux
/* force dosmod at high addresses */
asm(".org 0x110000");
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/vm86.h>
#include <sys/syscall.h>
/* FIXME: hack because libc vm86 may be the old syscall version */
static __inline__ int vm86plus( int func, struct vm86plus_struct *ptr )
{
int res;
#ifdef __PIC__
__asm__ __volatile__( "pushl %%ebx\n\t"
"movl %2,%%ebx\n\t"
"int $0x80\n\t"
"popl %%ebx"
: "=a" (res)
: "0" (SYS_vm86),
"g" (func),
"c" (ptr) );
#else
__asm__ __volatile__("int $0x80"
: "=a" (res)
: "0" (SYS_vm86),
"b" (func),
"c" (ptr) );
#endif /* __PIC__ */
if (res >= 0) return res;
errno = -res;
return -1;
}
int main(int argc,char**argv)
{
int mfd=open(argv[0],O_RDWR);
void*img;
struct vm86plus_struct VM86;
int func,ret;
/* fprintf(stderr,"main is at %08lx, file is %s, fd=%d\n",(unsigned long)&main,argv[0],mfd); */
if (mfd<0) return 1;
/* 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 (img==(void*)-1) {
fprintf(stderr,"DOS memory map failed, error=%s\n",strerror(errno));
return 1;
}
/* fprintf(stderr,"Successfully mapped DOS memory, entering vm86 loop\n"); */
/* context exchange loop */
do {
if (read(0,&func,sizeof(func))!=sizeof(func)) return 1;
if (read(0,&VM86,sizeof(VM86))!=sizeof(VM86)) return 1;
if (func<0) break;
ret=vm86plus(func,&VM86);
if (write(1,&ret,sizeof(ret))!=sizeof(ret)) return 1;
if (write(1,&VM86,sizeof(VM86))!=sizeof(VM86)) return 1;
} while (1);
return 0;
}
#else /* !linux */
int main(void) {return 1;}
#endif

118
loader/dos/dosvm.c Normal file
View File

@ -0,0 +1,118 @@
/*
* DOS Virtual Machine
*
* Copyright 1998 Ove Kåven
*/
#ifdef linux
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "windows.h"
#include "winbase.h"
#include "msdos.h"
#include "miscemu.h"
#include "debug.h"
#include "module.h"
#include "ldt.h"
#include "dosexe.h"
void DOSVM_Dump( LPDOSTASK lpDosTask)
{
unsigned iofs;
BYTE*inst;
int x;
switch (VM86_TYPE(lpDosTask->fn)) {
case VM86_SIGNAL:
printf("Trapped signal\n"); break;
case VM86_UNKNOWN:
printf("Trapped unhandled GPF\n"); break;
case VM86_INTx:
printf("Trapped INT %02x\n",VM86_ARG(lpDosTask->fn)); break;
case VM86_STI:
printf("Trapped STI\n"); break;
case VM86_PICRETURN:
printf("Trapped due to pending PIC request\n"); break;
case VM86_TRAP:
printf("Trapped debug request\n"); break;
}
#define REGS lpDosTask->VM86.regs
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,"CS=%04X DS=%04X ES=%04X SS=%04X\n",REGS.cs,REGS.ds,REGS.es,REGS.ss);
iofs=((DWORD)REGS.cs<<4)+REGS.eip;
#undef REGS
inst=(BYTE*)lpDosTask->img+iofs;
printf("Opcodes:");
for (x=0; x<8; x++) printf(" %02x",inst[x]);
printf("\n");
exit(0);
}
int DOSVM_Int(int vect, LPDOSTASK lpDosTask, PCONTEXT context )
{
switch (vect) {
case 0x20:
return -1;
case 0x21:
if (AH_reg(context)==0x4c) return -1;
DOS3Call(context);
break;
}
return 0;
}
int DOSVM_Process( LPDOSTASK lpDosTask )
{
CONTEXT context;
int ret=0;
#define REGS lpDosTask->VM86.regs
context.Eax=REGS.eax; context.Ecx=REGS.ecx; context.Edx=REGS.edx; context.Ebx=REGS.ebx;
context.Esi=REGS.esi; context.Edi=REGS.edi; context.Esp=REGS.esp; context.Ebp=REGS.ebp;
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;
switch (VM86_TYPE(lpDosTask->fn)) {
case VM86_SIGNAL:
printf("Trapped signal\n");
ret=-1; break;
case VM86_UNKNOWN:
DOSVM_Dump(lpDosTask);
break;
case VM86_INTx:
TRACE(int,"DOS EXE calls INT %02x\n",VM86_ARG(lpDosTask->fn));
ret=DOSVM_Int(VM86_ARG(lpDosTask->fn),lpDosTask,&context); break;
case VM86_STI:
break;
case VM86_PICRETURN:
printf("Trapped due to pending PIC request\n"); break;
case VM86_TRAP:
printf("Trapped debug request\n"); break;
default:
DOSVM_Dump(lpDosTask);
}
lpDosTask->fn=VM86_ENTER;
REGS.eax=context.Eax; REGS.ecx=context.Ecx; REGS.edx=context.Edx; REGS.ebx=context.Ebx;
REGS.esi=context.Esi; REGS.edi=context.Edi; REGS.esp=context.Esp; REGS.ebp=context.Ebp;
REGS.cs=context.SegCs; REGS.ds=context.SegDs; REGS.es=context.SegEs;
REGS.ss=context.SegSs; REGS.fs=context.SegFs; REGS.gs=context.SegGs;
REGS.eip=context.Eip; REGS.eflags=context.EFlags;
#undef REGS
return ret;
}
#endif /* linux */

313
loader/dos/module.c Normal file
View File

@ -0,0 +1,313 @@
/*
* DOS (MZ) loader
*
* Copyright 1998 Ove Kåven
*/
#ifdef linux
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef MZ_USESYSV
#include <sys/ipc.h>
#include <sys/shm.h>
#else
#include <sys/mman.h>
#endif
#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 "winbase.h"
#include "module.h"
#include "task.h"
#include "ldt.h"
#include "process.h"
#include "miscemu.h"
#include "debug.h"
#include "dosexe.h"
#define BIOS_DATA_SEGMENT 0x40
#define BIOS_SEGMENT BIOSSEG /* BIOSSEG is defined to 0xf000 in sys/vm86.h */
#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
#endif
#define PSP_SIZE 0x10
#define SEG16(ptr,seg) ((LPVOID)((BYTE*)ptr+((DWORD)(seg)<<4)))
#define SEGPTR16(ptr,segptr) ((LPVOID)((BYTE*)ptr+((DWORD)SELECTOROF(segptr)<<4)+OFFSETOF(segptr)))
#define STUB(x) (0x90CF00CD|(x<<8)) /* INT x; IRET; NOP */
static void MZ_InitSystem( LPVOID lpImage )
{
SEGPTR*isr=lpImage;
DWORD*stub=SEG16(lpImage,STUB_SEGMENT);
int x;
/* initialize ISR table to make it point to INT stubs in BIOSSEG;
Linux only sends INTs performed from or destined to BIOSSEG at us,
if the int_revectored table is empty.
This allows DOS programs to hook interrupts, as well as use their
familiar retf tricks to call them... */
/* (note that the hooking might not actually work since DOS3Call stuff
isn't fully integrated with the DOS VM yet...) */
TRACE(module,"Initializing interrupt vector table\n");
for (x=0; x<256; x++) isr[x]=PTR_SEG_OFF_TO_SEGPTR(STUB_SEGMENT,x*4);
TRACE(module,"Initializing interrupt stub table\n");
for (x=0; x<256; x++) stub[x]=STUB(x);
}
static void MZ_InitPSP( LPVOID lpPSP, LPCSTR cmdline, LPCSTR env )
{
PDB*psp=lpPSP;
const char*cmd=cmdline?strchr(cmdline,' '):NULL;
psp->int20=0x20CD; /* int 20 */
/* some programs use this to calculate how much memory they need */
psp->nextParagraph=0x9FFF;
/* copy parameters */
if (cmd) {
while (*cmd == ' ') cmd++;
psp->cmdLine[0]=strlen(cmd);
strcpy(psp->cmdLine+1,cmd);
psp->cmdLine[psp->cmdLine[0]+1]='\r';
} else psp->cmdLine[1]='\r';
/* FIXME: integrate the memory stuff from Wine (msdos/dosmem.c) */
/* FIXME: integrate the PDB stuff from Wine (loader/task.c) */
}
static int MZ_LoadImage( HFILE16 hFile, LPCSTR cmdline, LPCSTR env, LPDOSTASK lpDosTask )
{
IMAGE_DOS_HEADER mz_header;
DWORD image_start,image_size,min_size,max_size,avail;
WORD psp_seg,load_seg;
BYTE*psp_start,*load_start;
int x;
SEGPTR reloc;
if ((_hread16(hFile,&mz_header,sizeof(mz_header)) != sizeof(mz_header)) ||
(mz_header.e_magic != IMAGE_DOS_SIGNATURE))
return 11; /* invalid exe */
/* calculate load size */
image_start=mz_header.e_cparhdr<<4;
image_size=mz_header.e_cp<<9; /* pages are 512 bytes */
if ((mz_header.e_cblp!=0)&&(mz_header.e_cblp!=4)) image_size-=512-mz_header.e_cblp;
image_size-=image_start;
min_size=image_size+((DWORD)mz_header.e_minalloc<<4)+(PSP_SIZE<<4);
max_size=image_size+((DWORD)mz_header.e_maxalloc<<4)+(PSP_SIZE<<4);
/* allocate 1MB+64K shared memory */
lpDosTask->img_ofs=START_OFFSET;
#ifdef MZ_USESYSV
lpDosTask->key=ftok(".",'d'); /* FIXME: this is from my IPC intro doc */
lpDosTask->shm_id=shmget(lpDosTask->key,0x110000-START_OFFSET,IPC_CREAT|SHM_R|SHM_W);
lpDosTask->img=shmat(lpDosTask->shm_id,NULL,0);
#else
tmpnam(lpDosTask->mm_name);
/* strcpy(lpDosTask->mm_name,"/tmp/mydosimage"); */
lpDosTask->mm_fd=open(lpDosTask->mm_name,O_RDWR|O_CREAT /* |O_TRUNC */,S_IRUSR|S_IWUSR);
if (lpDosTask->mm_fd<0) ERR(module,"file %s could not be opened\n",lpDosTask->mm_name);
/* expand file to 1MB+64K */
lseek(lpDosTask->mm_fd,0x110000-1,SEEK_SET);
x=0; write(lpDosTask->mm_fd,&x,1);
/* map it in */
lpDosTask->img=mmap(NULL,0x110000-START_OFFSET,PROT_READ|PROT_WRITE,MAP_SHARED,lpDosTask->mm_fd,0);
#endif
if (lpDosTask->img==(LPVOID)-1) {
ERR(module,"could not map shared memory, error=%s\n",strerror(errno));
return 0;
}
TRACE(module,"DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img);
/* initialize the memory */
MZ_InitSystem(lpDosTask->img);
TRACE(module,"Initializing DOS memory structures\n");
DOSMEM_Init(lpDosTask->hModule);
/* FIXME: allocate memory for environment variables */
/* allocate memory for the executable */
TRACE(module,"Allocating DOS memory (min=%ld, max=%ld)\n",min_size,max_size);
avail=DOSMEM_Available(lpDosTask->hModule);
if (avail<min_size) {
ERR(module, "insufficient DOS memory\n");
return 0;
}
if (avail>max_size) avail=max_size;
psp_start=DOSMEM_GetBlock(lpDosTask->hModule,avail,&psp_seg);
if (!psp_start) {
ERR(module, "error allocating DOS memory\n");
return 0;
}
load_seg=psp_seg+PSP_SIZE;
load_start=psp_start+(PSP_SIZE<<4);
MZ_InitPSP(psp_start, cmdline, env);
/* load executable image */
TRACE(module,"loading DOS EXE image size, %08lx bytes\n",image_size);
_llseek16(hFile,image_start,FILE_BEGIN);
if ((_hread16(hFile,load_start,image_size)) != image_size)
return 11; /* invalid exe */
/* load relocation table */
TRACE(module,"loading DOS EXE relocation table, %d entries\n",mz_header.e_lfarlc);
/* FIXME: is this too slow without read buffering? */
_llseek16(hFile,mz_header.e_lfarlc,FILE_BEGIN);
for (x=0; x<mz_header.e_crlc; x++) {
if (_lread16(hFile,&reloc,sizeof(reloc)) != sizeof(reloc))
return 11; /* invalid exe */
*(WORD*)SEGPTR16(load_start,reloc)+=load_seg;
}
/* initialize vm86 struct */
memset(&lpDosTask->VM86,0,sizeof(lpDosTask->VM86));
lpDosTask->VM86.regs.cs=load_seg+mz_header.e_cs;
lpDosTask->VM86.regs.eip=mz_header.e_ip;
lpDosTask->VM86.regs.ss=load_seg+mz_header.e_ss;
lpDosTask->VM86.regs.esp=mz_header.e_sp;
lpDosTask->VM86.regs.ds=psp_seg;
lpDosTask->VM86.regs.es=psp_seg;
/* hmm, what else do we need? */
return 32;
}
static int MZ_InitTask( LPDOSTASK lpDosTask )
{
int read_fd[2],write_fd[2];
pid_t child;
/* create read pipe */
if (pipe(read_fd)<0) return 0;
if (pipe(write_fd)<0) {
close(read_fd[0]); close(read_fd[1]); return 0;
}
lpDosTask->read_pipe=read_fd[0];
lpDosTask->write_pipe=write_fd[1];
lpDosTask->fn=VM86_ENTER;
lpDosTask->state=1;
TRACE(module,"Preparing to load DOS EXE support module: forking\n");
if ((child=fork())<0) {
close(write_fd[0]); close(write_fd[1]);
close(read_fd[0]); close(read_fd[1]); return 0;
}
if (child!=0) {
/* parent process */
close(read_fd[1]); close(write_fd[0]);
lpDosTask->task=child;
} else {
/* child process */
close(read_fd[0]); close(write_fd[1]);
/* put our pipes somewhere dosmod can find them */
dup2(write_fd[0],0); /* stdin */
dup2(read_fd[1],1); /* stdout */
/* now load dosmod */
execlp("dosmod",lpDosTask->mm_name,NULL);
execl("dosmod",lpDosTask->mm_name,NULL);
execl("loader/dos/dosmod",lpDosTask->mm_name,NULL);
/* if failure, exit */
ERR(module,"Failed to spawn dosmod, error=%s\n",strerror(errno));
exit(1);
}
return 32;
}
HINSTANCE16 MZ_LoadModule( LPCSTR name, LPCSTR cmdline,
LPCSTR env, UINT16 show_cmd )
{
LPDOSTASK lpDosTask;
HMODULE16 hModule;
HINSTANCE16 hInstance;
NE_MODULE *pModule;
HFILE16 hFile;
OFSTRUCT ofs;
PROCESS_INFORMATION info;
int err;
if ((lpDosTask = calloc(1, sizeof(DOSTASK))) == NULL)
return 0;
if ((hFile = OpenFile16( name, &ofs, OF_READ )) == HFILE_ERROR16)
return 2; /* File not found */
if ((hModule = MODULE_CreateDummyModule(&ofs)) < 32)
return hModule;
lpDosTask->hModule = hModule;
pModule = (NE_MODULE *)GlobalLock16(hModule);
pModule->lpDosTask = lpDosTask;
lpDosTask->img=NULL; lpDosTask->mm_name[0]=0; lpDosTask->mm_fd=-1;
err = MZ_LoadImage( hFile, cmdline, env, lpDosTask );
_lclose16(hFile);
if (err<32) {
if (lpDosTask->img!=NULL) munmap(lpDosTask->img,0x110000-START_OFFSET);
if (lpDosTask->mm_fd>=0) close(lpDosTask->mm_fd);
if (lpDosTask->mm_name[0]!=0) unlink(lpDosTask->mm_name);
return err;
}
MZ_InitTask( lpDosTask );
hInstance = NE_CreateInstance(pModule, NULL, (cmdline == NULL));
PROCESS_Create( pModule, cmdline, env, hInstance, 0, show_cmd, &info );
/* we don't need the handles for now */
CloseHandle( info.hThread );
CloseHandle( info.hProcess );
return hInstance;
}
void MZ_KillModule( LPDOSTASK lpDosTask )
{
munmap(lpDosTask->img,0x110000-START_OFFSET);
close(lpDosTask->mm_fd);
unlink(lpDosTask->mm_name);
close(lpDosTask->read_pipe);
close(lpDosTask->write_pipe);
kill(lpDosTask->task,SIGTERM);
}
int MZ_RunModule( LPDOSTASK lpDosTask )
{
/* transmit the current context structure to the DOS task */
if (lpDosTask->state==1) {
if (write(lpDosTask->write_pipe,&lpDosTask->fn,sizeof(lpDosTask->fn))!=sizeof(lpDosTask->fn))
return -1;
if (write(lpDosTask->write_pipe,&lpDosTask->VM86,sizeof(lpDosTask->VM86))!=sizeof(lpDosTask->VM86))
return -1;
lpDosTask->state=2;
}
/* wait for another context structure to appear (this may block) */
if (lpDosTask->state==2) {
if (read(lpDosTask->read_pipe,&lpDosTask->fn,sizeof(lpDosTask->fn))!=sizeof(lpDosTask->fn)) {
if ((errno==EINTR)||(errno==EAGAIN)) return 0;
return -1;
}
lpDosTask->state=3;
}
if (lpDosTask->state==3) {
if (read(lpDosTask->read_pipe,&lpDosTask->VM86,sizeof(lpDosTask->VM86))!=sizeof(lpDosTask->VM86)) {
if ((errno==EINTR)||(errno==EAGAIN)) return 0;
return -1;
}
/* got one */
lpDosTask->state=1;
return 1;
}
return 0;
}
#endif /* linux */

View File

@ -35,6 +35,7 @@
#include "dce.h"
#include "shell.h"
#include "winproc.h"
#include "syslevel.h"
#include "debug.h"
@ -45,6 +46,9 @@ int __winelib = 1; /* Winelib run-time flag */
*/
BOOL32 MAIN_KernelInit(void)
{
/* Initialize syslevel handling */
SYSLEVEL_Init();
/* Initialize signal handling */
if (!SIGNAL_Init()) return FALSE;
@ -52,7 +56,7 @@ BOOL32 MAIN_KernelInit(void)
if (!PROFILE_LoadWineIni()) return FALSE;
/* Initialize DOS memory */
if (!DOSMEM_Init()) return FALSE;
if (!DOSMEM_Init(0)) return FALSE;
/* Initialise DOS drives */
if (!DRIVE_Init()) return FALSE;

View File

@ -18,6 +18,7 @@
#include "module.h"
#include "neexe.h"
#include "pe_image.h"
#include "dosexe.h"
#include "process.h"
#include "thread.h"
#include "resource.h"
@ -313,6 +314,10 @@ HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit,
(cmd_line == NULL) );
if ((hInstance == 21) && cmd_line)
return PE_LoadModule( name, cmd_line, env, show_cmd );
#ifdef linux
if (hInstance == 11)
return MZ_LoadModule(name, cmd_line, env, show_cmd );
#endif
}
/* Create a task for this instance */
@ -322,11 +327,15 @@ HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit,
if (cmd_line && !(pModule->flags & NE_FFLAGS_LIBMODULE))
{
PDB32 *pdb;
PROCESS_INFORMATION info;
pModule->flags |= NE_FFLAGS_GUI;
pdb = PROCESS_Create( pModule, cmd_line, env, hInstance,
hPrevInstance, show_cmd );
hPrevInstance, show_cmd, &info );
/* we don't need the handles for now */
CloseHandle( info.hThread );
CloseHandle( info.hProcess );
if (pdb && (GetNumTasks() > 1)) Yield16();
}
@ -337,7 +346,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit,
/**********************************************************************
* LoadModule16 (KERNEL.45)
*/
HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock )
{
LOADPARAMS *params;
LPSTR cmd_line, new_cmd_line;
@ -379,7 +388,7 @@ HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
* This should get implemented via CreateProcess -- MODULE_Load
* is resolutely 16-bit.
*/
DWORD LoadModule32( LPCSTR name, LPVOID paramBlock )
DWORD WINAPI LoadModule32( LPCSTR name, LPVOID paramBlock )
{
LOADPARAMS32 *params = (LOADPARAMS32 *)paramBlock;
#if 0

View File

@ -1020,13 +1020,17 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
* Find a module from a path name.
*
* RETURNS
* LOWORD:
* the win16 module handle if found
* 0 if not
* HIWORD (undocumented, see "Undocumented Windows", chapter 5):
* Always hFirstModule
*/
HMODULE16 WINAPI WIN16_GetModuleHandle( SEGPTR name )
DWORD WINAPI WIN16_GetModuleHandle( SEGPTR name )
{
if (HIWORD(name) == 0) return GetExePtr( (HINSTANCE16)name );
return GetModuleHandle16( PTR_SEG_TO_LIN(name) );
if (HIWORD(name) == 0)
return MAKELONG(GetExePtr( (HINSTANCE16)name), hFirstModule );
return MAKELONG(GetModuleHandle16( PTR_SEG_TO_LIN(name)), hFirstModule );
}
HMODULE16 WINAPI GetModuleHandle16( LPCSTR name )

View File

@ -425,8 +425,13 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
/* some BootApp procs overwrite the selector of dgroup */
pSegTable[pModule->dgroup - 1].selector = saved_dgroup;
thdb->cur_stack = oldstack;
for (i = 2; i <= pModule->seg_count; i++)
if (!NE_LoadSegment( pModule, i )) return FALSE;
/* FIXME
commented out by Andreas Mohr;
some self-loading exe ("BLINKER") relies on non-primary segs not loaded.
contact me if you experience problems */
/*for (i = 2; i <= pModule->seg_count; i++)
if (!NE_LoadSegment( pModule, i )) return FALSE;*/
}
else
{
@ -580,7 +585,7 @@ static VOID NE_GetDLLInitParams( NE_MODULE *pModule,
static BOOL32 NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
{
SEGTABLEENTRY *pSegTable;
WORD hInst, ds, heap, fs;
WORD hInst, ds, heap;
CONTEXT context;
pSegTable = NE_SEG_TABLE( pModule );
@ -611,13 +616,11 @@ static BOOL32 NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
memset( &context, 0, sizeof(context) );
NE_GetDLLInitParams( pModule, &hInst, &ds, &heap );
GET_FS( fs );
ECX_reg(&context) = heap;
EDI_reg(&context) = hInst;
DS_reg(&context) = ds;
ES_reg(&context) = ds; /* who knows ... */
FS_reg(&context) = fs;
CS_reg(&context) = pSegTable[pModule->cs-1].selector;
EIP_reg(&context) = pModule->ip;
@ -641,7 +644,7 @@ static BOOL32 NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
{
WORD hInst, ds, heap, fs;
WORD hInst, ds, heap;
FARPROC16 entryPoint;
WORD ordinal;
CONTEXT context;
@ -655,11 +658,9 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
memset( &context, 0, sizeof(context) );
NE_GetDLLInitParams( pModule, &hInst, &ds, &heap );
GET_FS( fs );
DS_reg(&context) = ds;
ES_reg(&context) = ds; /* who knows ... */
FS_reg(&context) = fs;
CS_reg(&context) = HIWORD(entryPoint);
IP_reg(&context) = LOWORD(entryPoint);
@ -745,6 +746,7 @@ HINSTANCE16 NE_CreateInstance( NE_MODULE *pModule, HINSTANCE16 *prev,
pModule->self, FALSE, FALSE, FALSE );
if (!hNewInstance) return 0;
pSegment->selector = hNewInstance;
pSegment->flags |= NE_SEGFLAGS_ALLOCATED;
return hNewInstance;
}
@ -821,6 +823,7 @@ BOOL32 NE_CreateSegments( NE_MODULE *pModule )
FALSE,
FALSE /*pSegment->flags & NE_SEGFLAGS_READONLY*/ );
if (!pSegment->selector) return FALSE;
pSegment->flags |= NE_SEGFLAGS_ALLOCATED;
}
pModule->dgroup_entry = pModule->dgroup ? pModule->seg_table +

View File

@ -854,10 +854,14 @@ HINSTANCE16 PE_LoadModule( LPCSTR name, LPCSTR cmd_line,
if (cmd_line &&
!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
PROCESS_INFORMATION info;
PDB32 *pdb = PROCESS_Create( pModule, cmd_line, env,
hInstance, 0, show_cmd );
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;

View File

@ -550,7 +550,7 @@ INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
/**********************************************************************
* LoadMessage32A (internal)
*/
INT32 LoadMessage32A( HMODULE32 instance, UINT32 id, WORD lang,
INT32 WINAPI LoadMessage32A( HMODULE32 instance, UINT32 id, WORD lang,
LPSTR buffer, INT32 buflen )
{
HGLOBAL32 hmem;
@ -617,7 +617,7 @@ INT32 LoadMessage32A( HMODULE32 instance, UINT32 id, WORD lang,
/**********************************************************************
* LoadMessage32W (internal)
*/
INT32 LoadMessage32W( HMODULE32 instance, UINT32 id, WORD lang,
INT32 WINAPI LoadMessage32W( HMODULE32 instance, UINT32 id, WORD lang,
LPWSTR buffer, INT32 buflen )
{
INT32 retval;

View File

@ -30,7 +30,9 @@
#include "winnt.h"
#include "winsock.h"
#include "thread.h"
#include "syslevel.h"
#include "debug.h"
#include "dosexe.h"
#include "dde_proc.h"
#include "server.h"
@ -227,8 +229,10 @@ static void TASK_CallToStart(void)
SET_CUR_THREAD( pTask->thdb );
CLIENT_InitThread();
/* Terminate the stack frame */
THREAD_STACK16(pTask->thdb)->frame32 = NULL;
/* Terminate the stack frame chain */
memset(THREAD_STACK16( pTask->thdb ), '\0', sizeof(STACK16FRAME));
if (pModule->flags & NE_FFLAGS_WIN32)
{
/* FIXME: all this is an ugly hack */
@ -245,6 +249,19 @@ static void TASK_CallToStart(void)
exit_code = entry();
TASK_KillCurrentTask( exit_code );
}
#ifdef linux
else if (pModule->lpDosTask)
{
int stat;
while ((stat = MZ_RunModule(pModule->lpDosTask)) >= 0)
if (stat > 0 && DOSVM_Process(pModule->lpDosTask) < 0)
break;
MZ_KillModule(pModule->lpDosTask);
TASK_KillCurrentTask( 0 );
}
#endif
else
{
/* Registers at initialization must be:
@ -315,6 +332,8 @@ HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
if (pModule->flags & NE_FFLAGS_WIN32)
pTask->flags |= TDBF_WIN32;
if (pModule->lpDosTask)
pTask->flags |= TDBF_WINOLDAP;
pTask->version = pModule->expected_version;
pTask->hInstance = hInstance;
@ -393,13 +412,15 @@ HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
sp = pSegTable[pModule->ss-1].minsize + pModule->stack_size;
sp &= ~1;
pTask->thdb->cur_stack = PTR_SEG_OFF_TO_SEGPTR( pTask->hInstance, sp );
pTask->thdb->cur_stack -= sizeof(STACK16FRAME) + sizeof(STACK32FRAME *);
pTask->thdb->cur_stack -= 2*sizeof(STACK16FRAME);
frame16 = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
frame16->ebp = sp + (int)&((STACK16FRAME *)0)->bp;
frame16->bp = LOWORD(frame16->ebp);
frame16->ds = frame16->es = pTask->hInstance;
frame16->fs = 0;
frame16->entry_point = 0;
frame16->entry_cs = 0;
frame16->mutex_count = 1; /* TASK_Reschedule is called from 16-bit code */
/* The remaining fields will be initialized in TASK_Reschedule */
/* Create the 32-bit stack frame */
@ -546,6 +567,8 @@ void TASK_Reschedule(void)
HTASK16 hTask = 0;
STACK16FRAME *newframe16;
SYSLEVEL_ReleaseWin16Lock();
#ifdef CONFIG_IPC
dde_reschedule();
#endif
@ -599,6 +622,7 @@ void TASK_Reschedule(void)
if (hTask == hCurrentTask)
{
TRACE(task, "returning to the current task(%04x)\n", hTask );
SYSLEVEL_RestoreWin16Lock();
return; /* Nothing to do */
}
pNewTask = (TDB *)GlobalLock16( hTask );
@ -634,6 +658,8 @@ void TASK_Reschedule(void)
hCurrentTask = hTask;
SET_CUR_THREAD( pNewTask->thdb );
pNewTask->ss_sp = pNewTask->thdb->cur_stack;
SYSLEVEL_RestoreWin16Lock();
}
@ -696,7 +722,13 @@ void WINAPI InitTask( CONTEXT *context )
* si instance handle of the previous instance
* di instance handle of the new task
* es:bx pointer to command-line inside PSP
*
* 0 (=%bp) is pushed on the stack
*/
SEGPTR ptr = STACK16_PUSH( pTask->thdb, sizeof(WORD) );
*(WORD *)PTR_SEG_TO_LIN(ptr) = 0;
SP_reg(context) -= 2;
EAX_reg(context) = 1;
if (!pTask->pdb.cmdLine[0]) EBX_reg(context) = 0x80;

View File

@ -21,6 +21,7 @@
#include "ldt.h"
#include "stackframe.h"
#include "user.h"
#include "debug.h"
#ifdef CONFIG_IPC
#include "dde_atom.h"
@ -136,6 +137,8 @@ static WORD ATOM_Hash(
) {
WORD i, hash = 0;
TRACE(atom,"%x, %s, %x\n", entries, str, len);
for (i = 0; i < len; i++) hash ^= toupper(str[i]) + i;
return hash % entries;
}
@ -163,6 +166,8 @@ static ATOM ATOM_AddAtom(
ATOMTABLE * table;
int len, ae_len;
TRACE(atom,"0x%x, %s\n", selector, str);
if (str[0] == '#') return atoi( &str[1] ); /* Check for integer atom */
if ((len = strlen( str )) > MAX_ATOM_LEN) len = MAX_ATOM_LEN;
if (!(table = ATOM_GetTable( selector, TRUE ))) return 0;
@ -175,6 +180,7 @@ static ATOM ATOM_AddAtom(
(!lstrncmpi32A( entryPtr->str, str, len )))
{
entryPtr->refCount++;
TRACE(atom,"-- existing 0x%x\n", entry);
return HANDLETOATOM( entry );
}
entry = entryPtr->next;
@ -191,6 +197,7 @@ static ATOM ATOM_AddAtom(
entryPtr->length = len;
strncpy( entryPtr->str, str, ae_len - sizeof(ATOMENTRY) + 1); /* always use strncpy ('\0's padding) */
table->entries[hash] = entry;
TRACE(atom,"-- new 0x%x\n", entry);
return HANDLETOATOM( entry );
}
@ -209,6 +216,8 @@ static ATOM ATOM_DeleteAtom(
ATOMTABLE * table;
HANDLE16 entry, *prevEntry;
WORD hash;
TRACE(atom,"0x%x, 0x%x\n", selector, atom);
if (atom < MIN_STR_ATOM) return 0; /* Integer atom */
@ -251,6 +260,8 @@ static ATOM ATOM_FindAtom(
HANDLE16 entry;
int len;
TRACE(atom,"%x, %s\n", selector, str);
if (str[0] == '#') return atoi( &str[1] ); /* Check for integer atom */
if ((len = strlen( str )) > 255) len = 255;
if (!(table = ATOM_GetTable( selector, FALSE ))) return 0;
@ -261,9 +272,12 @@ static ATOM ATOM_FindAtom(
ATOMENTRY * entryPtr = ATOM_MakePtr( selector, entry );
if ((entryPtr->length == len) &&
(!lstrncmpi32A( entryPtr->str, str, len )))
{ TRACE(atom,"-- found %x\n", entry);
return HANDLETOATOM( entry );
}
entry = entryPtr->next;
}
TRACE(atom,"-- not found\n");
return 0;
}
@ -287,6 +301,8 @@ static UINT32 ATOM_GetAtomName(
UINT32 len;
char text[8];
TRACE(atom,"%x, %x\n", selector, atom);
if (!count) return 0;
if (atom < MIN_STR_ATOM)
{
@ -296,7 +312,7 @@ static UINT32 ATOM_GetAtomName(
}
else
{
if (!(table = ATOM_GetTable( selector, FALSE ))) return 0;
if (!(table = ATOM_GetTable( selector, FALSE ))) return 0;
entry = ATOMTOHANDLE( atom );
entryPtr = ATOM_MakePtr( selector, entry );
len = entryPtr->length;

View File

@ -715,7 +715,7 @@ DWORD WINAPI GlobalDOSAlloc(
DWORD size /* [in] Number of bytes to be allocated */
) {
UINT16 uParagraph;
LPVOID lpBlock = DOSMEM_GetBlock( size, &uParagraph );
LPVOID lpBlock = DOSMEM_GetBlock( 0, size, &uParagraph );
if( lpBlock )
{
@ -744,7 +744,7 @@ WORD WINAPI GlobalDOSFree(
if( block && block < 0x100000 )
{
LPVOID lpBlock = DOSMEM_MapDosToLinear( block );
if( DOSMEM_FreeBlock( lpBlock ) )
if( DOSMEM_FreeBlock( 0, lpBlock ) )
GLOBAL_FreeBlock( sel );
sel = 0;
}

View File

@ -1310,8 +1310,8 @@ LPVOID HEAP_xalloc( HANDLE32 heap, DWORD flags, DWORD size )
*/
LPSTR HEAP_strdupA( HANDLE32 heap, DWORD flags, LPCSTR str )
{
LPSTR p = HEAP_xalloc( heap, flags, lstrlen32A(str) + 1 );
lstrcpy32A( p, str );
LPSTR p = HEAP_xalloc( heap, flags, strlen(str) + 1 );
strcpy( p, str );
return p;
}
@ -1336,7 +1336,7 @@ LPWSTR HEAP_strdupAtoW( HANDLE32 heap, DWORD flags, LPCSTR str )
LPWSTR ret;
if (!str) return NULL;
ret = HEAP_xalloc( heap, flags, (lstrlen32A(str)+1) * sizeof(WCHAR) );
ret = HEAP_xalloc( heap, flags, (strlen(str)+1) * sizeof(WCHAR) );
lstrcpyAtoW( ret, str );
return ret;
}

View File

@ -179,8 +179,6 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
WARN(selector, "Freeing %%fs selector (%04x), not good.\n", fs );
SET_FS( 0 );
}
fs = THREAD_Current()->saved_fs;
if ((fs >= sel) && (fs < nextsel)) THREAD_Current()->saved_fs = 0;
GET_GS(gs);
if ((gs >= sel) && (gs < nextsel)) SET_GS( 0 );
}
@ -199,6 +197,7 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
{
if ((frame->ds >= sel) && (frame->ds < nextsel)) frame->ds = 0;
if ((frame->es >= sel) && (frame->es < nextsel)) frame->es = 0;
if ((frame->fs >= sel) && (frame->fs < nextsel)) frame->fs = 0;
frame = PTR_SEG_TO_LIN( frame->frame32->frame16 );
}
}

View File

@ -817,7 +817,7 @@ BOOL32 WINAPI VirtualProtectEx(
) {
BOOL32 ret = FALSE;
PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_VM_OPERATION );
PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_VM_OPERATION, NULL );
if (pdb)
{
if (pdb == PROCESS_Current())
@ -914,7 +914,7 @@ DWORD WINAPI VirtualQueryEx(
) {
DWORD ret = len;
PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_QUERY_INFORMATION );
PDB32 *pdb = PROCESS_GetPtr( handle, PROCESS_QUERY_INFORMATION, NULL );
if (pdb)
{
if (pdb == PROCESS_Current())
@ -1089,13 +1089,15 @@ HANDLE32 WINAPI CreateFileMapping32A(
/* First search for an object with the same name */
K32OBJ *obj = K32OBJ_FindName( name );
SetLastError(0); /* Win95 does that for some functions, like CFM */
if (obj)
{
if (obj->type == K32OBJ_MEM_MAPPED_FILE)
{
SetLastError( ERROR_ALREADY_EXISTS );
handle = HANDLE_Alloc( PROCESS_Current(), obj,
FILE_MAP_ALL_ACCESS /*FIXME*/, inherit );
FILE_MAP_ALL_ACCESS /*FIXME*/, inherit, -1 );
}
else
{
@ -1145,7 +1147,7 @@ HANDLE32 WINAPI CreateFileMapping32A(
((protect & 0xff) == PAGE_EXECUTE_WRITECOPY))
access |= GENERIC_WRITE;
if (!(obj = HANDLE_GetObjPtr( PROCESS_Current(), hFile,
K32OBJ_FILE, access )))
K32OBJ_FILE, access, NULL )))
goto error;
if (!GetFileInformationByHandle( hFile, &info )) goto error;
@ -1177,7 +1179,7 @@ HANDLE32 WINAPI CreateFileMapping32A(
if (!K32OBJ_AddName( &mapping->header, name )) handle = 0;
else handle = HANDLE_Alloc( PROCESS_Current(), &mapping->header,
FILE_MAP_ALL_ACCESS /*FIXME*/, inherit );
FILE_MAP_ALL_ACCESS /*FIXME*/, inherit, -1 );
K32OBJ_DecCount( &mapping->header );
return handle;
@ -1222,7 +1224,7 @@ HANDLE32 WINAPI OpenFileMapping32A(
SYSTEM_LOCK();
if ((obj = K32OBJ_FindNameType( name, K32OBJ_MEM_MAPPED_FILE )))
{
handle = HANDLE_Alloc( PROCESS_Current(), obj, access, inherit );
handle = HANDLE_Alloc( PROCESS_Current(), obj, access, inherit, -1 );
K32OBJ_DecCount( obj );
}
SYSTEM_UNLOCK();
@ -1312,7 +1314,7 @@ LPVOID WINAPI MapViewOfFileEx(
if (!(mapping = (FILE_MAPPING *)HANDLE_GetObjPtr( PROCESS_Current(),
handle,
K32OBJ_MEM_MAPPED_FILE,
0 /* FIXME */ )))
0 /* FIXME */, NULL )))
return NULL;
if (mapping->size_high || offset_high)

View File

@ -140,6 +140,45 @@ DWORD __cdecl CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,
typedef void (*_INITTERMFUN)();
/*********************************************************************
* _findfirst (CRTDLL.099)
*
* BUGS
* Unimplemented
*/
DWORD __cdecl CRTDLL__findfirst(LPCSTR fname,struct find_t* x2)
{
FIXME(crtdll, ":(%s,%p): stub\n",fname,x2);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*********************************************************************
* _findnext (CRTDLL.100)
*
* BUGS
* Unimplemented
*/
INT32 __cdecl CRTDLL__findnext(DWORD hand,struct find_t* x2)
{
FIXME(crtdll, ":(%d,%p): stub\n",hand,x2);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*********************************************************************
* _fstat (CRTDLL.111)
*
* BUGS
* Unimplemented
*/
int __cdecl CRTDLL__fstat(int file, struct stat* buf)
{
FIXME(crtdll, ":(%d,%p): stub\n",file,buf);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*********************************************************************
* _initterm (CRTDLL.135)
*/
@ -209,6 +248,18 @@ void __cdecl CRTDLL__local_unwind2( PEXCEPTION_FRAME endframe, DWORD nr )
{
TRACE(crtdll,"(%p,%ld)\n",endframe,nr);
}
/*********************************************************************
* _read (CRTDLL.256)
*
* BUGS
* Unimplemented
*/
INT32 __cdecl CRTDLL__read(INT32 fd, LPVOID buf, UINT32 count)
{
FIXME(crtdll,":(%d,%p,%d): stub\n",fd,buf,count);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*********************************************************************
* fopen (CRTDLL.372)
@ -296,7 +347,19 @@ DWORD __cdecl CRTDLL_fread(LPVOID ptr, INT32 size, INT32 nmemb, LPVOID vfile)
return ret;
#endif
}
/*********************************************************************
* freopen (CRTDLL.379)
*
* BUGS
* Unimplemented
*/
DWORD __cdecl CRTDLL_freopen(LPCSTR path, LPCSTR mode, LPVOID stream)
{
FIXME(crtdll, ":(%s,%s,%p): stub\n", path, mode, stream);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*********************************************************************
* fscanf (CRTDLL.381)
*/

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