Release 980628

Sun Jun 28 18:37:02 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c]
	Moved page-fault handling to INSTR_EmulateInstruction.

	* [scheduler/thread.c]
	Added locking and check for own thread in Suspend/ResumeThread.

Sat Jun 27 21:25:21 1998  Ulrich Weigand <weigand@informatik.uni-erlangen.de>

	* [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c] 
	  [graphics/x11drv/bitblt.c] [include/bitmap.h]
	Improved DIB section handling using page fault handlers.
	(Note: This patch includes code contributed by Matthew J. Francis.)

	* [memory/virtual.c] [if1632/signal.c] [include/global.h]
	Page Fault handler support added.

	* [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c]
	  [misc/winsock_dns.c] [include/sig_context.h] [include/thread.h]
	16-bit %fs handling improved: Always preserve 16-bit %fs value,
	always restore 32-bit %fs value for signal handlers.

	* [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c]
	  [loader/ne/resource.c] [include/callback.h] [include/module.h]
	  [if1632/kernel.spec] [if1632/wprocs.spec]
	Resource Handler function pointer stored as 16-bit SEGPTR.

	* [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec]
	  [if1632/kernel.spec] [loader/ne/module.c]
	Some minor incompatibilities fixed (Win32s relies on those):
	GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize
	should cope with having the WINDOWPOS structure trashed;
	the OFSTRUCT in the NE module image should be placed *last*.

	* [include/windows.h]
	Missing prototype for FlushViewOfFile.

	* [loader/task.c]
	Bugfix: Command line should *not* start with a blank.
	
	* [loader/ne/segment.c]
	Bugfix: Fixups to offset 0 were never applied.

	* [misc/lstr.c]
	Use debugstr_a in OutputDebugString16.

	* [msdos/dpmi.c]
	Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added.

	* [msdos/int21.c]
	Stub for int 21 AX=440d CL=6f (get drive map information) added.

Fri Jun 26 18:08:30 1998  Rein Klazes <rklazes@casema.net>

	* [windows/winpos.c]
	Fix small buglet that mixed up maximized and minimized windows.

	* [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c]
	  [graphics/x11drv/graphics.c]
	Fix some bugs with lines joining styles. Draws rectangles
	with thick pens now correctly.

Fri Jun 26 16:22:23 1998  James Juran <jrj120@psu.edu>

	* [misc/shell.c]
	Fixed bug I introduced last release in InternalExtractIcon.

	* [win32/file.c]
	Added documentation for CreateFile32A.

	* [documentation/wine.man]
	Updated manpage.	

	* [ChangeLog]
	Added my entry from last release.

Fri Jun 26 13:33:30 1998  Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>

	* [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h]
	  [include/print.h] [objects/gdiobj.c]
	First stages of an internal Postscript driver. See
	graphics/psdrv/README . Should print text (badly) from win3.1 notepad,
	write and winword6.

	* [documentation/printing]
	Some notes on printing.

	* [controls/edit.c]
	Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle.
	EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS
	and not as an action as the docs say. This actually makes more sense.
	Scroll the caret back to zero after a WM_SETTEXT.

Fri Jun 26 10:56:25 1998  Marcus Meissner <marcus@jet.franken.de>

	* [if1632/snoop.c]
	Added win16 inter-dll snooping.

	* [win32/ordinals.c]
	KERNEL_485 is GetProcessDword.

	* [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c]
	Added xcalloc so we 0 initialize XImages. 
	Fixes/Hides the 'junk around MOPYFish'.

	* [misc/ntdll.c]
	Some stubs added.

Thu Jun 25 15:22:43 1998  Adrian Harvey <adrian@select.com.au>

	* [scheduler/thread.c] 
	Implemented SuspendThread and ResumeThread.

Thu Jun 25 00:55:03 1998  Peter Hunnisett <hunnise@nortel.ca>

	* [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c]
	  [relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in]
	  [documentation/status/directplay]
	Added preliminary support for DirectPlay & DirectPlayLobby. Moved the
	preliminary stubs put in the dsound files into two new files
	dplay.h and dplay.c.
	Added new debug channel (dplay) for this.
	Created new document to keep track of implementation.

	* [include/winioctl.h][win32/device.c]
	Added some framework in DeviceIoControl to, in the future, support
	the "builtin" windows dwIoControlCodes. Added new header file
	winioctl.h . 

	* [multimedia/mmsystem.c]
	Added slightly improved debugging information for PlaySound.

Wed Jun 24 12:00:00 1998  Juergen Schmied <juergen.schmied@metronet.de> 

	* [files/profile.c][graphics/x11drv/xfont.c][loader/module.c]
	Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp,
	lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp
	because it's not necessary to support locale on such places.
	It causes a huge overhead and even fails sometimes 

	* [include/oleauto.h][include/winerror.h]
	Added some ole-related constants.

	* [misc/shell.c]
	SHELL32_DllGetClassObject, SHGetSpecialFolderLocation,
	SHGetPathFromIDList improved the stubs

	* [ole/folders.c]
	IShellFolder* functions rewrote the stubs so don't crash and give
	something sensible back, started implementation of.

	* [ole/typelib.c][relay32/oleaut32.spec]
	LoadTypeLib32, RegisterTypeLib stub.

	* [ole/ole2nls.c]
	Fixed a buffer overrun in CompareString32A.
	Test for a bad pointer in LCMapString32A (happens
	in winhlp32 while building a index for searching). 

	* [relay32/oleaut32.spec] [ole/typelib.c]
	Added stub for LoadTypeLib (ole32) to make excel95 happy.

Tue Jun 23 22:47:09 1998  Alex Priem <alexp@sci.kun.nl>

	* [files/profile.c] [relay32/kernel32.spec]
	Added WritePrivateProfileStructA, GetPrivateProfileStructA,
	GetPrivateProfileSectionNames16.

Tue Jun 23 01:34:43 1998  Pascal Cuoq <pcuoq@ens-lyon.fr>

	* [ole/ole2nls.c]
	GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases.
	LCMapString32A: Map final '\0' for '\0'-terminated strings.

	* [misc/shellord.c] [files/profile.c] [graphics/driver.c] 
	  [loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c]
	Changed lstrcmpi32A -> strcasecmp.  Should be OK in these places.

Sat Jun 20 23:40:00 1998  Bertho Stultiens <bertho@akhphd.au.dk>

	* [tools/wrc/]
	Wrc version 1.0.2 (20-Jun-1998). Please revert to 
	the file tools/wrc/CHANGES for details.

Sat Jun 20 14:58:00 1998  Marcel Baur  <mbaur@g26.ethz.ch>

	* [ole/ole2nls.c] [ole/nls/*]
	Added the first 57 nls files, most are not yet complete.

Wed Jun 17 11:16:54 1998  David Luyer <luyer@ucs.uwa.edu.au>

	* [relay32/relay386.c] [if1632/relay.c]
	Move debug_relay_(include|exclude)_list handling into
	seperate function RELAY_ShowDebugmsgsRelay().  Include
	checking of this for 16 bit calls (originally only
	32-bit calls).

	* [relay32/snoop.c] [misc/main.c]
	Add debug_snoop_(include|exclude)_list as per the relay stuff.
	Fix typo and add information on -debugmsg +/-relay=... in
	help on -debugmsg.  Refer to availability of snoop too.

Tue Jun 10 22:00:18 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [controls/header.c][include/header.h][include/commctrl.h]
	Added owner draw support.

	* [windows/nonclient.c][windows/sysmetics.c]
	Fixed menu bar height for Win95 look.
	Split NC_AdjustRect95() into NC_AdjustRectOuter95() and
	NC_AdjustRectInner95 to fix a menu bar bug.
	Improved Win95 look.

	* [controls/progress.c]
	Improved drawing code. Borders will be drawn by non-client code.

	* [controls/updown.c]
	Changed memory allocation and fixed some bugs.

	* [controls/toolbar.c]
	Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs.
	Several improvements.

	* [misc/shell.c]
	Added stub for BrowseForFoldersA().

	* [misc/shellord.c]
	Added stub for SHELL32_147().

	* [controls/comctl32undoc.c]
	Minor changes.

	* [documentation/common_controls]
	New File: Documentation about development status, undocumented
	features and functions of the common controls.
This commit is contained in:
Alexandre Julliard 1998-06-28 18:40:26 +00:00
parent f90efa9cf0
commit ebfc0fee51
204 changed files with 14366 additions and 2848 deletions

View File

@ -1,13 +1,15 @@
This is release 980614 of Wine, the MS Windows emulator. This is still a
This is release 980628 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-980614: (see ChangeLog for details)
- Many drawing fixes.
- Inter-DLL calls snooping.
WHAT'S NEW with Wine-980628: (see ChangeLog for details)
- Common controls improvements.
- Win16 DLL snooping.
- Preliminary internal Postscript driver.
- Improved DIB section handling.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -16,10 +18,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980614.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980614.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980614.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980614.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980628.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980628.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-980628.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980628.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

12
BUGS
View File

@ -13,17 +13,21 @@ General:
* Incomplete thread/process scheduling support in Win32 code.
* Threading for non Linux systems completely missing. (might use
LWPs in Solaris, FreeBSD? NetBSD? SCO?)
* Very alpha printing code using win16 drivers.
We should add a WINE internal PostScript driver (all other printers
can be supported using ghostscript filters).
* Very alpha internal Postscript driver. [h.davies1@physics.ox.ac.uk]
* Extremely alpha Win95 interface code.
* No OLE2 and OLE32 support (including OLE2 interfaces etc.).
(started work on pidl-handling, IShellFolders IEnumIdLists
and SH* functions juergen.schmied@metronet.de)
* No MS Video support. [just started, marcus@jet.franken.de]
* COMDLG32 support not complete yet [bertho@akhphd.au.dk?]
* COMDLG32 support not complete yet [bertho@akhphd.au.dk]
* COMMCTRL/COMCTL32 support in progress [ekohl@abo.rhein-zeitung.de].

259
ChangeLog
View File

@ -1,3 +1,241 @@
----------------------------------------------------------------------
Sun Jun 28 18:37:02 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c]
Moved page-fault handling to INSTR_EmulateInstruction.
* [scheduler/thread.c]
Added locking and check for own thread in Suspend/ResumeThread.
Sat Jun 27 21:25:21 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c]
[graphics/x11drv/bitblt.c] [include/bitmap.h]
Improved DIB section handling using page fault handlers.
(Note: This patch includes code contributed by Matthew J. Francis.)
* [memory/virtual.c] [if1632/signal.c] [include/global.h]
Page Fault handler support added.
* [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c]
[misc/winsock_dns.c] [include/sig_context.h] [include/thread.h]
16-bit %fs handling improved: Always preserve 16-bit %fs value,
always restore 32-bit %fs value for signal handlers.
* [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c]
[loader/ne/resource.c] [include/callback.h] [include/module.h]
[if1632/kernel.spec] [if1632/wprocs.spec]
Resource Handler function pointer stored as 16-bit SEGPTR.
* [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec]
[if1632/kernel.spec] [loader/ne/module.c]
Some minor incompatibilities fixed (Win32s relies on those):
GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize
should cope with having the WINDOWPOS structure trashed;
the OFSTRUCT in the NE module image should be placed *last*.
* [include/windows.h]
Missing prototype for FlushViewOfFile.
* [loader/task.c]
Bugfix: Command line should *not* start with a blank.
* [loader/ne/segment.c]
Bugfix: Fixups to offset 0 were never applied.
* [misc/lstr.c]
Use debugstr_a in OutputDebugString16.
* [msdos/dpmi.c]
Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added.
* [msdos/int21.c]
Stub for int 21 AX=440d CL=6f (get drive map information) added.
Fri Jun 26 18:08:30 1998 Rein Klazes <rklazes@casema.net>
* [windows/winpos.c]
Fix small buglet that mixed up maximized and minimized windows.
* [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c]
[graphics/x11drv/graphics.c]
Fix some bugs with lines joining styles. Draws rectangles
with thick pens now correctly.
Fri Jun 26 16:22:23 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c]
Fixed bug I introduced last release in InternalExtractIcon.
* [win32/file.c]
Added documentation for CreateFile32A.
* [documentation/wine.man]
Updated manpage.
* [ChangeLog]
Added my entry from last release.
Fri Jun 26 13:33:30 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h]
[include/print.h] [objects/gdiobj.c]
First stages of an internal Postscript driver. See
graphics/psdrv/README . Should print text (badly) from win3.1 notepad,
write and winword6.
* [documentation/printing]
Some notes on printing.
* [controls/edit.c]
Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle.
EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS
and not as an action as the docs say. This actually makes more sense.
Scroll the caret back to zero after a WM_SETTEXT.
Fri Jun 26 10:56:25 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/snoop.c]
Added win16 inter-dll snooping.
* [win32/ordinals.c]
KERNEL_485 is GetProcessDword.
* [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c]
Added xcalloc so we 0 initialize XImages.
Fixes/Hides the 'junk around MOPYFish'.
* [misc/ntdll.c]
Some stubs added.
Thu Jun 25 15:22:43 1998 Adrian Harvey <adrian@select.com.au>
* [scheduler/thread.c]
Implemented SuspendThread and ResumeThread.
Thu Jun 25 00:55:03 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c]
[relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in]
[documentation/status/directplay]
Added preliminary support for DirectPlay & DirectPlayLobby. Moved the
preliminary stubs put in the dsound files into two new files
dplay.h and dplay.c.
Added new debug channel (dplay) for this.
Created new document to keep track of implementation.
* [include/winioctl.h][win32/device.c]
Added some framework in DeviceIoControl to, in the future, support
the "builtin" windows dwIoControlCodes. Added new header file
winioctl.h .
* [multimedia/mmsystem.c]
Added slightly improved debugging information for PlaySound.
Wed Jun 24 12:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [files/profile.c][graphics/x11drv/xfont.c][loader/module.c]
Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp,
lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp
because it's not necessary to support locale on such places.
It causes a huge overhead and even fails sometimes
* [include/oleauto.h][include/winerror.h]
Added some ole-related constants.
* [misc/shell.c]
SHELL32_DllGetClassObject, SHGetSpecialFolderLocation,
SHGetPathFromIDList improved the stubs
* [ole/folders.c]
IShellFolder* functions rewrote the stubs so don't crash and give
something sensible back, started implementation of.
* [ole/typelib.c][relay32/oleaut32.spec]
LoadTypeLib32, RegisterTypeLib stub.
* [ole/ole2nls.c]
Fixed a buffer overrun in CompareString32A.
Test for a bad pointer in LCMapString32A (happens
in winhlp32 while building a index for searching).
* [relay32/oleaut32.spec] [ole/typelib.c]
Added stub for LoadTypeLib (ole32) to make excel95 happy.
Tue Jun 23 22:47:09 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [relay32/kernel32.spec]
Added WritePrivateProfileStructA, GetPrivateProfileStructA,
GetPrivateProfileSectionNames16.
Tue Jun 23 01:34:43 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases.
LCMapString32A: Map final '\0' for '\0'-terminated strings.
* [misc/shellord.c] [files/profile.c] [graphics/driver.c]
[loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c]
Changed lstrcmpi32A -> strcasecmp. Should be OK in these places.
Sat Jun 20 23:40:00 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/]
Wrc version 1.0.2 (20-Jun-1998). Please revert to
the file tools/wrc/CHANGES for details.
Sat Jun 20 14:58:00 1998 Marcel Baur <mbaur@g26.ethz.ch>
* [ole/ole2nls.c] [ole/nls/*]
Added the first 57 nls files, most are not yet complete.
Wed Jun 17 11:16:54 1998 David Luyer <luyer@ucs.uwa.edu.au>
* [relay32/relay386.c] [if1632/relay.c]
Move debug_relay_(include|exclude)_list handling into
seperate function RELAY_ShowDebugmsgsRelay(). Include
checking of this for 16 bit calls (originally only
32-bit calls).
* [relay32/snoop.c] [misc/main.c]
Add debug_snoop_(include|exclude)_list as per the relay stuff.
Fix typo and add information on -debugmsg +/-relay=... in
help on -debugmsg. Refer to availability of snoop too.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/header.c][include/header.h][include/commctrl.h]
Added owner draw support.
* [windows/nonclient.c][windows/sysmetics.c]
Fixed menu bar height for Win95 look.
Split NC_AdjustRect95() into NC_AdjustRectOuter95() and
NC_AdjustRectInner95 to fix a menu bar bug.
Improved Win95 look.
* [controls/progress.c]
Improved drawing code. Borders will be drawn by non-client code.
* [controls/updown.c]
Changed memory allocation and fixed some bugs.
* [controls/toolbar.c]
Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs.
Several improvements.
* [misc/shell.c]
Added stub for BrowseForFoldersA().
* [misc/shellord.c]
Added stub for SHELL32_147().
* [controls/comctl32undoc.c]
Minor changes.
* [documentation/common_controls]
New File: Documentation about development status, undocumented
features and functions of the common controls.
----------------------------------------------------------------------
Sun Jun 15 10:30:35 1998 Andreas Mohr <100.30936@germany.net>
@ -112,6 +350,27 @@ Fri Jun 12 06:23:19 1998 Matthew Becker <mbecker@glasscity.net>
Added stubs for OpenDesktopA, SetThreadDesktop, and
SetUserObjectInformationA.
Wed Jun 10 20:28:08 1998 James Juran <jrj120@psu.edu>
* [debugger/break.c]
Fixed bug introduced in 980503 that broke the -debug command
line option for PE executable files.
* [configure.in] [include/acconfig.h] [include/debugtools.h]
[documentation/debug-msgs]
Added 'configure' options to compile out debugging messages.
Use --disable-debug to disable all debugging messages, and
--disable-trace to just disable TRACE messages. This results
in a stripped executable that is 15-20% smaller. This option
is very much untested--don't expect it to work.
* [documentation/debug-msgs] [documentation/debugging]
Minor updates.
* [*/*.c]
Fixed some compile warnings. This also includes the
compile_warnings_trivial patch from WineHQ.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [windows/sysmetrics.c][include/sysmetrics.h]

View File

@ -50,6 +50,7 @@ LIBSUBDIRS = \
EMUSUBDIRS = \
debugger \
graphics/psdrv \
graphics/win16drv \
if1632 \
miscemu
@ -95,6 +96,7 @@ LIBOBJS = \
EMUOBJS = \
debugger/debugger.o \
graphics/psdrv/psdrv.o \
graphics/win16drv/win16drv.o \
if1632/if1632.o \
miscemu/miscemu.o

4
configure vendored
View File

@ -2447,7 +2447,7 @@ EOF
fi
for ac_func in clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid
for ac_func in clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2454: checking for $ac_func" >&5
@ -3303,6 +3303,7 @@ documentation/Makefile
files/Makefile
graphics/Makefile
graphics/metafiledrv/Makefile
graphics/psdrv/Makefile
graphics/win16drv/Makefile
graphics/x11drv/Makefile
if1632/Makefile
@ -3435,6 +3436,7 @@ documentation/Makefile
files/Makefile
graphics/Makefile
graphics/metafiledrv/Makefile
graphics/psdrv/Makefile
graphics/win16drv/Makefile
graphics/x11drv/Makefile
if1632/Makefile

View File

@ -235,7 +235,7 @@ fi
dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid)
AC_CHECK_FUNCS(clone getpagesize memmove 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 sys/cdio.h sys/filio.h sys/modem.h strings.h sys/strtio.h)
AC_HEADER_STAT()
AC_C_CONST()
@ -442,6 +442,7 @@ documentation/Makefile
files/Makefile
graphics/Makefile
graphics/metafiledrv/Makefile
graphics/psdrv/Makefile
graphics/win16drv/Makefile
graphics/x11drv/Makefile
if1632/Makefile

View File

@ -11,6 +11,7 @@
*
* TODO
* - Fix DSA_InsertItem.
* - Fix DSA_GetItem.
* - Write documentation.
*/
@ -39,10 +40,6 @@ typedef struct _DPA_DATA
} DPA_DATA, *LPDPA_DATA;
DWORD WINAPI Alloc (DWORD);
DWORD WINAPI ReAlloc (DWORD, DWORD);
DWORD WINAPI Free (DWORD);
DWORD WINAPI DSA_Create (DWORD, DWORD);
@ -51,31 +48,32 @@ DWORD WINAPI DPA_GetPtr (DWORD, DWORD);
DWORD WINAPI DPA_InsertPtr (DWORD, DWORD, DWORD);
LPSTR WINAPI COMCTL32_StrChrA (LPSTR lpString, CHAR cChar);
DWORD WINAPI
Alloc (DWORD dwParam1)
COMCTL32_Alloc (DWORD dwParam)
{
DWORD dwPtr;
dwPtr = (DWORD)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, dwParam1);
dwPtr = (DWORD)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, dwParam);
TRACE (commctrl, "(0x%08lx) ret=0x%08lx\n", dwParam1, dwPtr);
TRACE (commctrl, "(0x%08lx) ret=0x%08lx\n", dwParam, dwPtr);
return dwPtr;
}
DWORD WINAPI
ReAlloc (DWORD dwParam1, DWORD dwParam2)
COMCTL32_ReAlloc (DWORD dwParam1, DWORD dwParam2)
{
DWORD dwPtr;
if (dwParam1 == 0)
dwPtr = (DWORD)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, dwParam2);
dwPtr = (DWORD)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
dwParam2);
else
dwPtr = (DWORD)HeapReAlloc (SystemHeap, HEAP_ZERO_MEMORY,
dwPtr = (DWORD)HeapReAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
(LPVOID)dwParam1, dwParam2);
TRACE (commctrl, "(0x%08lx 0x%08lx) ret=0x%08lx\n",
@ -86,15 +84,21 @@ ReAlloc (DWORD dwParam1, DWORD dwParam2)
DWORD WINAPI
Free (DWORD dwParam1)
COMCTL32_Free (DWORD dwParam)
{
TRACE (commctrl, "(0x%08lx)\n", dwParam1);
HeapFree (SystemHeap, 0, (LPVOID)dwParam1);
TRACE (commctrl, "(0x%08lx)\n", dwParam);
HeapFree (GetProcessHeap (), 0, (LPVOID)dwParam);
return 0;
}
DWORD WINAPI
COMCTL32_GetSize (DWORD dwParam)
{
TRACE (commctrl, "(0x%08lx)\n", dwParam);
return (HeapSize (GetProcessHeap (), 0, (LPVOID)dwParam));
}
@ -135,6 +139,36 @@ DSA_Destroy (DWORD dwParam1)
}
DWORD WINAPI
DSA_GetItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
{
FIXME (commctrl, "(0x%08lx 0x%08lx 0x%08lx): stub!\n",
dwParam1, dwParam2, dwParam3);
return 0;
}
DWORD WINAPI
DSA_GetItemPtr (DWORD dwParam1, DWORD dwParam2)
{
LPDSA_DATA dsaPtr = (LPDSA_DATA)dwParam1;
TRACE (commctrl, "(0x%08lx 0x%08lx)\n", dwParam1, dwParam2);
if (dsaPtr == NULL)
return 0;
if (dsaPtr->ptrs == NULL)
return 0;
if ((dwParam2 < 0) || (dwParam2 >= dsaPtr->dwEntryCount))
return 0;
TRACE (commctrl, "ret=0x%08lx\n", (DWORD)dsaPtr->ptrs[dwParam2]);
return (DWORD)dsaPtr->ptrs[dwParam2];
}
DWORD WINAPI
DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
{
@ -188,24 +222,6 @@ DSA_InsertItem (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
}
DWORD WINAPI
DSA_GetItemPtr (DWORD dwParam1, DWORD dwParam2)
{
LPDSA_DATA dsaPtr = (LPDSA_DATA)dwParam1;
TRACE (commctrl, "(0x%08lx 0x%08lx)\n", dwParam1, dwParam2);
if (dsaPtr == NULL)
return 0;
if (dsaPtr->ptrs == NULL)
return 0;
if ((dwParam2 < 0) || (dwParam2 >= dsaPtr->dwEntryCount))
return 0;
TRACE (commctrl, "ret=0x%08lx\n", (DWORD)dsaPtr->ptrs[dwParam2]);
return (DWORD)dsaPtr->ptrs[dwParam2];
}
DWORD WINAPI

View File

@ -218,7 +218,7 @@ InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
/***********************************************************************
* MenuHelp (COMCTL32.2)
* MenuHelp [COMCTL32.2]
*
*
*
@ -245,7 +245,6 @@ MenuHelp (UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, HMENU32 hMainMenu,
else {
if (HIWORD(wParam) & MF_POPUP) {
TRACE (commctrl, "popup menu selected!\n");
FIXME (commctrl, "no popup menu texts!\n");
szStatusText[0] = 0;
}
@ -281,7 +280,7 @@ CreateToolbarEx (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
INT32 dxBitmap, INT32 dyBitmap, UINT32 uStructSize)
{
HWND32 hwndTB =
CreateWindowEx32A(0, TOOLBARCLASSNAME32A, "", style, 0, 0, 0, 0,
CreateWindowEx32A (0, TOOLBARCLASSNAME32A, "", style, 0, 0, 0, 0,
hwnd, (HMENU32)wID, 0, NULL);
if(hwndTB) {
TBADDBITMAP tbab;
@ -348,35 +347,39 @@ CreateToolbar (HWND32 hwnd, DWORD style, UINT32 wID, INT32 nBitmaps,
/***********************************************************************
* GetEffectiveClientRect [COMCTL32.4]
*
* PARAMS
* hwnd [I] handle to the client window.
* lpRect [O] pointer to the rectangle of the client window
* lpInfo [I] pointer to an array of integers
*
*
* NOTES
*/
VOID WINAPI
GetEffectiveClientRect (HWND32 hwnd, LPRECT32 lpRect, LPINT32 lpInfo)
{
RECT32 rcClient, rcCtrl;
HWND32 hwndCtrl;
LPINT32 lpRun;
INT32 idCtrl, *lpRun;
TRACE (commctrl, "hwnd=0x%08lx lpRect=0x%08lx lpInfo=0x%08lx\n",
(DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);
GetClientRect32 (hwnd, &rcClient);
#if 0
lpRun = lpInfo;
TRACE (commctrl, "*lpRun=0x%08x\n", *lpRun);
while (*lpRun) {
lpRun++;
TRACE (commctrl, "control id 0x%08x\n", *lpRun);
hwndCtrl = GetDlgItem32 (hwnd, *lpRun);
GetWindowRect32 (hwndCtrl, &rcCtrl);
do {
lpRun += 3;
idCtrl = *lpRun;
if (idCtrl) {
TRACE (commctrl, "control id 0x%x\n", idCtrl);
GetWindowRect32 (GetDlgItem32 (hwnd, idCtrl), &rcCtrl);
MapWindowPoints32 (NULL, hwnd, (LPPOINT32)&rcCtrl, 2);
SubtractRect32 (&rcClient, &rcClient, &rcCtrl);
lpRun++;
TRACE (commctrl, "*lpRun=0x%08x\n", *lpRun);
}
} while (idCtrl);
#endif
CopyRect32 (lpRect, &rcClient);
}

View File

@ -19,6 +19,7 @@
#include "resource.h"
#include "debug.h"
#include "callback.h"
#include "tweak.h"
#define BUFLIMIT_MULTI 65534 /* maximum buffer size (not including '\0')
FIXME: BTW, new specs say 65535 (do you dare ???) */
@ -177,6 +178,7 @@ static void EDIT_MoveWordBackward(WND *wnd, EDITSTATE *es, BOOL32 extend);
static void EDIT_MoveWordForward(WND *wnd, EDITSTATE *es, BOOL32 extend);
static void EDIT_PaintLine(WND *wnd, EDITSTATE *es, HDC32 hdc, INT32 line, BOOL32 rev);
static INT32 EDIT_PaintText(WND *wnd, EDITSTATE *es, HDC32 hdc, INT32 x, INT32 y, INT32 line, INT32 col, INT32 count, BOOL32 rev);
static void EDIT_SetCaretPos(WND *wnd, EDITSTATE *es, INT32 pos, BOOL32 after_wrap);
static void EDIT_SetRectNP(WND *wnd, EDITSTATE *es, LPRECT32 lprc);
static void EDIT_UnlockBuffer(WND *wnd, EDITSTATE *es, BOOL32 force);
static INT32 EDIT_WordBreakProc(LPSTR s, INT32 index, INT32 count, INT32 action);
@ -216,7 +218,7 @@ static void EDIT_WM_Char(WND *wnd, EDITSTATE *es, CHAR c, DWORD key_data);
static void EDIT_WM_Command(WND *wnd, EDITSTATE *es, INT32 code, INT32 id, HWND32 conrtol);
static void EDIT_WM_ContextMenu(WND *wnd, EDITSTATE *es, HWND32 hwnd, INT32 x, INT32 y);
static void EDIT_WM_Copy(WND *wnd, EDITSTATE *es);
static LRESULT EDIT_WM_Create(WND *wnd, LPCREATESTRUCT32A cs);
static LRESULT EDIT_WM_Create(WND *wnd, EDITSTATE *es, LPCREATESTRUCT32A cs);
static void EDIT_WM_Destroy(WND *wnd, EDITSTATE *es);
static LRESULT EDIT_WM_EraseBkGnd(WND *wnd, EDITSTATE *es, HDC32 dc);
static INT32 EDIT_WM_GetText(WND *wnd, EDITSTATE *es, INT32 count, LPSTR text);
@ -227,6 +229,7 @@ static LRESULT EDIT_WM_LButtonDblClk(WND *wnd, EDITSTATE *es, DWORD keys, INT32
static LRESULT EDIT_WM_LButtonDown(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x, INT32 y);
static LRESULT EDIT_WM_LButtonUp(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x, INT32 y);
static LRESULT EDIT_WM_MouseMove(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x, INT32 y);
static LRESULT EDIT_WM_NCCreate(WND *wnd, LPCREATESTRUCT32A cs);
static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es);
static void EDIT_WM_Paste(WND *wnd, EDITSTATE *es);
static void EDIT_WM_SetFocus(WND *wnd, EDITSTATE *es, HWND32 window_losing_focus);
@ -305,14 +308,14 @@ LRESULT WINAPI EditWndProc( HWND32 hwnd, UINT32 msg,
LRESULT result = 0;
switch (msg) {
case WM_CREATE:
DPRINTF_EDIT_MSG32("WM_CREATE");
return EDIT_WM_Create(wnd, (LPCREATESTRUCT32A)lParam);
case WM_DESTROY:
DPRINTF_EDIT_MSG32("WM_DESTROY");
EDIT_WM_Destroy(wnd, es);
return 0;
case WM_NCCREATE:
DPRINTF_EDIT_MSG32("WM_NCCREATE");
return EDIT_WM_NCCreate(wnd, (LPCREATESTRUCT32A)lParam);
}
if (!es)
@ -718,6 +721,11 @@ LRESULT WINAPI EditWndProc( HWND32 hwnd, UINT32 msg,
EDIT_WM_Copy(wnd, es);
break;
case WM_CREATE:
DPRINTF_EDIT_MSG32("WM_CREATE");
result = EDIT_WM_Create(wnd, es, (LPCREATESTRUCT32A)lParam);
break;
case WM_CUT:
DPRINTF_EDIT_MSG32("WM_CUT");
EDIT_WM_Cut(wnd, es);
@ -1721,67 +1729,26 @@ static INT32 EDIT_PaintText(WND *wnd, EDITSTATE *es, HDC32 dc, INT32 x, INT32 y,
/*********************************************************************
*
* EM_SCROLLCARET
* EDIT_SetCaretPos
*
*/
static void EDIT_EM_ScrollCaret(WND *wnd, EDITSTATE *es)
static void EDIT_SetCaretPos(WND *wnd, EDITSTATE *es, INT32 pos,
BOOL32 after_wrap)
{
if (es->style & ES_MULTILINE) {
INT32 l;
INT32 li;
INT32 vlc;
INT32 ww;
INT32 cw = es->char_width;
INT32 x;
INT32 dy = 0;
INT32 dx = 0;
LRESULT res = EDIT_EM_PosFromChar(wnd, es, pos, after_wrap);
INT32 x = SLOWORD(res);
INT32 y = SHIWORD(res);
l = EDIT_EM_LineFromChar(wnd, es, es->selection_end);
li = EDIT_EM_LineIndex(wnd, es, l);
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP));
vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
if (l >= es->y_offset + vlc)
dy = l - vlc + 1 - es->y_offset;
if (l < es->y_offset)
dy = l - es->y_offset;
ww = es->format_rect.right - es->format_rect.left;
if (x < es->format_rect.left)
dx = x - es->format_rect.left - ww / HSCROLL_FRACTION / cw * cw;
if (x > es->format_rect.right)
dx = x - es->format_rect.left - (HSCROLL_FRACTION - 1) * ww / HSCROLL_FRACTION / cw * cw;
if (dy || dx)
EDIT_EM_LineScroll(wnd, es, dx, dy);
} else {
INT32 x;
INT32 goal;
INT32 format_width;
if (!(es->style & ES_AUTOHSCROLL))
if(x < es->format_rect.left)
x = es->format_rect.left;
if(x > es->format_rect.right - 2)
x = es->format_rect.right - 2;
if(y > es->format_rect.bottom)
y = es->format_rect.bottom;
if(y < es->format_rect.top)
y = es->format_rect.top;
SetCaretPos32(x, y);
return;
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, FALSE));
format_width = es->format_rect.right - es->format_rect.left;
if (x < es->format_rect.left) {
goal = es->format_rect.left + format_width / HSCROLL_FRACTION;
do {
es->x_offset--;
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, FALSE));
} while ((x < goal) && es->x_offset);
/* FIXME: use ScrollWindow() somehow to improve performance */
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
} else if (x > es->format_rect.right) {
INT32 x_last;
INT32 len = lstrlen32A(es->text);
goal = es->format_rect.right - format_width / HSCROLL_FRACTION;
do {
es->x_offset++;
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, FALSE));
x_last = SLOWORD(EDIT_EM_PosFromChar(wnd, es, len, FALSE));
} while ((x > goal) && (x_last > es->format_rect.right));
/* FIXME: use ScrollWindow() somehow to improve performance */
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
}
}
}
@ -1798,6 +1765,8 @@ static void EDIT_SetRectNP(WND *wnd, EDITSTATE *es, LPRECT32 rc)
CopyRect32(&es->format_rect, rc);
if (es->style & WS_BORDER) {
INT32 bw = GetSystemMetrics32(SM_CXBORDER) + 1;
if(!TWEAK_Win95Look)
bw += 2;
es->format_rect.left += bw;
es->format_rect.top += bw;
es->format_rect.right -= bw;
@ -2494,6 +2463,72 @@ static LRESULT EDIT_EM_Scroll(WND *wnd, EDITSTATE *es, INT32 action)
}
/*********************************************************************
*
* EM_SCROLLCARET
*
*/
static void EDIT_EM_ScrollCaret(WND *wnd, EDITSTATE *es)
{
if (es->style & ES_MULTILINE) {
INT32 l;
INT32 li;
INT32 vlc;
INT32 ww;
INT32 cw = es->char_width;
INT32 x;
INT32 dy = 0;
INT32 dx = 0;
l = EDIT_EM_LineFromChar(wnd, es, es->selection_end);
li = EDIT_EM_LineIndex(wnd, es, l);
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP));
vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
if (l >= es->y_offset + vlc)
dy = l - vlc + 1 - es->y_offset;
if (l < es->y_offset)
dy = l - es->y_offset;
ww = es->format_rect.right - es->format_rect.left;
if (x < es->format_rect.left)
dx = x - es->format_rect.left - ww / HSCROLL_FRACTION / cw * cw;
if (x > es->format_rect.right)
dx = x - es->format_rect.left - (HSCROLL_FRACTION - 1) * ww / HSCROLL_FRACTION / cw * cw;
if (dy || dx)
EDIT_EM_LineScroll(wnd, es, dx, dy);
} else {
INT32 x;
INT32 goal;
INT32 format_width;
if (!(es->style & ES_AUTOHSCROLL))
return;
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, FALSE));
format_width = es->format_rect.right - es->format_rect.left;
if (x < es->format_rect.left) {
goal = es->format_rect.left + format_width / HSCROLL_FRACTION;
do {
es->x_offset--;
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, FALSE));
} while ((x < goal) && es->x_offset);
/* FIXME: use ScrollWindow() somehow to improve performance */
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
} else if (x > es->format_rect.right) {
INT32 x_last;
INT32 len = lstrlen32A(es->text);
goal = es->format_rect.right - format_width / HSCROLL_FRACTION;
do {
es->x_offset++;
x = SLOWORD(EDIT_EM_PosFromChar(wnd, es, es->selection_end, FALSE));
x_last = SLOWORD(EDIT_EM_PosFromChar(wnd, es, len, FALSE));
} while ((x > goal) && (x_last > es->format_rect.right));
/* FIXME: use ScrollWindow() somehow to improve performance */
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
}
}
}
/*********************************************************************
*
* EM_SETHANDLE
@ -2608,23 +2643,32 @@ static void EDIT_EM_SetLimitText(WND *wnd, EDITSTATE *es, INT32 limit)
*
* EM_SETMARGINS
*
* EC_USEFONTINFO is used as a left or right value i.e. lParam and not as an
* action wParam despite what the docs say. It also appears not to affect
* multiline controls??
*
*/
static void EDIT_EM_SetMargins(WND *wnd, EDITSTATE *es, INT32 action, INT32 left, INT32 right)
static void EDIT_EM_SetMargins(WND *wnd, EDITSTATE *es, INT32 action,
INT32 left, INT32 right)
{
if (action & EC_USEFONTINFO) {
if (es->style & ES_MULTILINE) {
/*
* FIXME: do some GetABCCharWidth, or so
* This is just preliminary
*/
es->left_margin = es->right_margin = es->char_width/4;
} else
es->left_margin = es->right_margin = es->char_width/4;
} else {
if (action & EC_LEFTMARGIN)
if (action & EC_LEFTMARGIN) {
if (left != EC_USEFONTINFO)
es->left_margin = left;
if (action & EC_RIGHTMARGIN)
else
if (es->style & ES_MULTILINE)
es->left_margin = 0; /* ?? */
else
es->left_margin = es->char_width;
}
if (action & EC_RIGHTMARGIN) {
if (right != EC_USEFONTINFO)
es->right_margin = right;
else
if (es->style & ES_MULTILINE)
es->right_margin = 0; /* ?? */
else
es->right_margin = es->char_width;
}
TRACE(edit, "left=%d, right=%d\n", es->left_margin, es->right_margin);
}
@ -2683,10 +2727,8 @@ static void EDIT_EM_SetSel(WND *wnd, EDITSTATE *es, UINT32 start, UINT32 end, BO
es->flags |= EF_AFTER_WRAP;
else
es->flags &= ~EF_AFTER_WRAP;
if (es->flags & EF_FOCUSED) {
LRESULT pos = EDIT_EM_PosFromChar(wnd, es, end, after_wrap);
SetCaretPos32(SLOWORD(pos), SHIWORD(pos));
}
if (es->flags & EF_FOCUSED)
EDIT_SetCaretPos(wnd, es, end, after_wrap);
/* This is little bit more efficient than before, not sure if it can be improved. FIXME? */
ORDER_UINT32(start, end);
ORDER_UINT32(end, old_end);
@ -2976,70 +3018,8 @@ static void EDIT_WM_Copy(WND *wnd, EDITSTATE *es)
* WM_CREATE
*
*/
static LRESULT EDIT_WM_Create(WND *wnd, LPCREATESTRUCT32A cs)
static LRESULT EDIT_WM_Create(WND *wnd, EDITSTATE *es, LPCREATESTRUCT32A cs)
{
EDITSTATE *es;
if (!(es = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*es))))
return -1;
*(EDITSTATE **)wnd->wExtra = es;
if (!(es->heap = HeapCreate(0, 0x10000, 0)))
return -1;
es->style = cs->style;
/* remove the WS_CAPTION style if it has been set - this is really a */
/* pseudo option made from a combination of WS_BORDER and WS_DLGFRAME */
if ((es->style & WS_BORDER) && (es->style & WS_DLGFRAME))
es->style ^= WS_DLGFRAME;
if (es->style & ES_MULTILINE) {
es->buffer_size = BUFSTART_MULTI;
es->buffer_limit = BUFLIMIT_MULTI;
if (es->style & WS_VSCROLL)
es->style |= ES_AUTOVSCROLL;
if (es->style & WS_HSCROLL)
es->style |= ES_AUTOHSCROLL;
es->style &= ~ES_PASSWORD;
if ((es->style & ES_CENTER) || (es->style & ES_RIGHT)) {
if (es->style & ES_RIGHT)
es->style &= ~ES_CENTER;
es->style &= ~WS_HSCROLL;
es->style &= ~ES_AUTOHSCROLL;
}
/* FIXME: for now, all multi line controls are AUTOVSCROLL */
es->style |= ES_AUTOVSCROLL;
} else {
es->buffer_size = BUFSTART_SINGLE;
es->buffer_limit = BUFLIMIT_SINGLE;
es->style &= ~ES_CENTER;
es->style &= ~ES_RIGHT;
es->style &= ~WS_HSCROLL;
es->style &= ~WS_VSCROLL;
es->style &= ~ES_AUTOVSCROLL;
es->style &= ~ES_WANTRETURN;
if (es->style & ES_UPPERCASE) {
es->style &= ~ES_LOWERCASE;
es->style &= ~ES_NUMBER;
} else if (es->style & ES_LOWERCASE)
es->style &= ~ES_NUMBER;
if (es->style & ES_PASSWORD)
es->password_char = '*';
/* FIXME: for now, all single line controls are AUTOHSCROLL */
es->style |= ES_AUTOHSCROLL;
}
if (!(es->text = HeapAlloc(es->heap, 0, es->buffer_size + 1)))
return -1;
es->buffer_size = HeapSize(es->heap, 0, es->text) - 1;
if (!(es->undo_text = HeapAlloc(es->heap, 0, es->buffer_size + 1)))
return -1;
es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1;
*es->text = '\0';
if (es->style & ES_MULTILINE)
if (!(es->first_line_def = HeapAlloc(es->heap, HEAP_ZERO_MEMORY, sizeof(LINEDEF))))
return -1;
es->line_count = 1;
/*
* To initialize some final structure members, we call some helper
* functions. However, since the EDITSTATE is not consistent (i.e.
@ -3545,6 +3525,78 @@ static LRESULT EDIT_WM_MouseMove(WND *wnd, EDITSTATE *es, DWORD keys, INT32 x, I
}
/*********************************************************************
*
* WM_NCCREATE
*
*/
static LRESULT EDIT_WM_NCCreate(WND *wnd, LPCREATESTRUCT32A cs)
{
EDITSTATE *es;
if (!(es = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*es))))
return FALSE;
*(EDITSTATE **)wnd->wExtra = es;
if (!(es->heap = HeapCreate(0, 0x10000, 0)))
return FALSE;
es->style = cs->style;
if ((es->style & WS_BORDER) && !(es->style & WS_DLGFRAME))
SetWindowLong32A(wnd->hwndSelf, GWL_STYLE,
es->style & ~WS_BORDER);
if (es->style & ES_MULTILINE) {
es->buffer_size = BUFSTART_MULTI;
es->buffer_limit = BUFLIMIT_MULTI;
if (es->style & WS_VSCROLL)
es->style |= ES_AUTOVSCROLL;
if (es->style & WS_HSCROLL)
es->style |= ES_AUTOHSCROLL;
es->style &= ~ES_PASSWORD;
if ((es->style & ES_CENTER) || (es->style & ES_RIGHT)) {
if (es->style & ES_RIGHT)
es->style &= ~ES_CENTER;
es->style &= ~WS_HSCROLL;
es->style &= ~ES_AUTOHSCROLL;
}
/* FIXME: for now, all multi line controls are AUTOVSCROLL */
es->style |= ES_AUTOVSCROLL;
} else {
es->buffer_size = BUFSTART_SINGLE;
es->buffer_limit = BUFLIMIT_SINGLE;
es->style &= ~ES_CENTER;
es->style &= ~ES_RIGHT;
es->style &= ~WS_HSCROLL;
es->style &= ~WS_VSCROLL;
es->style &= ~ES_AUTOVSCROLL;
es->style &= ~ES_WANTRETURN;
if (es->style & ES_UPPERCASE) {
es->style &= ~ES_LOWERCASE;
es->style &= ~ES_NUMBER;
} else if (es->style & ES_LOWERCASE)
es->style &= ~ES_NUMBER;
if (es->style & ES_PASSWORD)
es->password_char = '*';
/* FIXME: for now, all single line controls are AUTOHSCROLL */
es->style |= ES_AUTOHSCROLL;
}
if (!(es->text = HeapAlloc(es->heap, 0, es->buffer_size + 1)))
return FALSE;
es->buffer_size = HeapSize(es->heap, 0, es->text) - 1;
if (!(es->undo_text = HeapAlloc(es->heap, 0, es->buffer_size + 1)))
return FALSE;
es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1;
*es->text = '\0';
if (es->style & ES_MULTILINE)
if (!(es->first_line_def = HeapAlloc(es->heap, HEAP_ZERO_MEMORY, sizeof(LINEDEF))))
return FALSE;
es->line_count = 1;
return TRUE;
}
/*********************************************************************
*
* WM_PAINT
@ -3559,7 +3611,6 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es)
RECT32 rc;
RECT32 rcLine;
RECT32 rcRgn;
LRESULT pos;
BOOL32 rev = IsWindowEnabled32(wnd->hwndSelf) &&
((es->flags & EF_FOCUSED) ||
(es->style & ES_NOHIDESEL));
@ -3568,6 +3619,14 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es)
EDIT_NOTIFY_PARENT(wnd, EN_UPDATE, "EN_UPDATE");
dc = BeginPaint32(wnd->hwndSelf, &ps);
if(es->style & WS_BORDER) {
GetClientRect32(wnd->hwndSelf, &rc);
if(es->style & ES_MULTILINE) {
if(es->style & WS_HSCROLL) rc.bottom++;
if(es->style & WS_VSCROLL) rc.right++;
}
Rectangle32(dc, rc.left, rc.top, rc.right, rc.bottom);
}
IntersectClipRect32(dc, es->format_rect.left,
es->format_rect.top,
es->format_rect.right,
@ -3596,10 +3655,9 @@ static void EDIT_WM_Paint(WND *wnd, EDITSTATE *es)
}
if (es->font)
SelectObject32(dc, old_font);
if (es->flags & EF_FOCUSED) {
pos = EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP);
SetCaretPos32(SLOWORD(pos), SHIWORD(pos));
}
if (es->flags & EF_FOCUSED)
EDIT_SetCaretPos(wnd, es, es->selection_end,
es->flags & EF_AFTER_WRAP);
EndPaint32(wnd->hwndSelf, &ps);
if ((es->style & WS_VSCROLL) && !(es->flags & EF_VSCROLL_TRACK)) {
INT32 vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
@ -3661,12 +3719,10 @@ static void EDIT_WM_Paste(WND *wnd, EDITSTATE *es)
*/
static void EDIT_WM_SetFocus(WND *wnd, EDITSTATE *es, HWND32 window_losing_focus)
{
LRESULT pos;
es->flags |= EF_FOCUSED;
CreateCaret32(wnd->hwndSelf, 0, 2, es->line_height);
pos = EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP);
SetCaretPos32(SLOWORD(pos), SHIWORD(pos));
EDIT_SetCaretPos(wnd, es, es->selection_end,
es->flags & EF_AFTER_WRAP);
if(!(es->style & ES_NOHIDESEL))
EDIT_InvalidateText(wnd, es, es->selection_start, es->selection_end);
ShowCaret32(wnd->hwndSelf);
@ -3678,6 +3734,10 @@ static void EDIT_WM_SetFocus(WND *wnd, EDITSTATE *es, HWND32 window_losing_focus
*
* WM_SETFONT
*
* With Win95 look the margins are set to default font value unless
* the system font (font == 0) is being set, in which case they are left
* unchanged.
*
*/
static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT32 font, BOOL32 redraw)
{
@ -3695,18 +3755,23 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT32 font, BOOL32 redraw
if (font)
SelectObject32(dc, old_font);
ReleaseDC32(wnd->hwndSelf, dc);
if (wnd->flags & WIN_ISWIN32)
EDIT_EM_SetMargins(wnd, es, EC_USEFONTINFO, 0, 0);
if (font & TWEAK_Win95Look)
EDIT_EM_SetMargins(wnd, es, EC_LEFTMARGIN | EC_RIGHTMARGIN,
EC_USEFONTINFO, EC_USEFONTINFO);
if (es->style & ES_MULTILINE)
EDIT_BuildLineDefs_ML(wnd, es);
else {
RECT32 r;
GetClientRect32(wnd->hwndSelf, &r);
EDIT_SetRectNP(wnd, es, &r);
}
if (redraw)
InvalidateRect32(wnd->hwndSelf, NULL, TRUE);
if (es->flags & EF_FOCUSED) {
LRESULT pos;
DestroyCaret32();
CreateCaret32(wnd->hwndSelf, 0, 2, es->line_height);
pos = EDIT_EM_PosFromChar(wnd, es, es->selection_end, es->flags & EF_AFTER_WRAP);
SetCaretPos32(SLOWORD(pos), SHIWORD(pos));
EDIT_SetCaretPos(wnd, es, es->selection_end,
es->flags & EF_AFTER_WRAP);
ShowCaret32(wnd->hwndSelf);
}
}
@ -3723,10 +3788,14 @@ static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPCSTR text)
if (text) {
TRACE(edit, "\t'%s'\n", text);
EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
es->x_offset = 0;
} else {
TRACE(edit, "\t<NULL>\n");
EDIT_EM_ReplaceSel(wnd, es, FALSE, "");
}
es->x_offset = 0;
es->flags |= EF_MODIFIED;
es->flags |= EF_UPDATE;
EDIT_EM_SetSel(wnd, es, 0, 0, FALSE);
EDIT_EM_ScrollCaret(wnd, es);
}

View File

@ -6,7 +6,6 @@
* TODO:
* - Imagelist support (partially).
* - Callback items.
* - Owner draw support.
* - Order list support.
* - Control specific cursors (over dividers).
* - Hottrack support (partially).
@ -38,8 +37,10 @@
static INT32
HEADER_DrawItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi, BOOL32 bHotTrack)
HEADER_DrawItem (WND *wndPtr, HDC32 hdc, INT32 iItem, BOOL32 bHotTrack)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HEADER_ITEM *phdi = &infoPtr->items[iItem];
RECT32 r;
INT32 oldBkMode;
@ -62,7 +63,18 @@ HEADER_DrawItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi, BOOL32 bHotTrack)
DrawEdge32 (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
if (phdi->fmt & HDF_OWNERDRAW) {
/* FIXME: owner drawn items */
DRAWITEMSTRUCT32 dis;
dis.CtlType = ODT_HEADER;
dis.CtlID = wndPtr->wIDmenu;
dis.itemID = iItem;
dis.itemAction = ODA_DRAWENTIRE;
dis.itemState = phdi->bDown ? ODS_SELECTED : 0;
dis.hwndItem = wndPtr->hwndSelf;
dis.hDC = hdc;
dis.rcItem = r;
dis.itemData = phdi->lParam;
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_DRAWITEM,
(WPARAM32)wndPtr->wIDmenu, (LPARAM)&dis);
}
else {
UINT32 uTextJustify = DT_LEFT;
@ -161,7 +173,6 @@ HEADER_DrawItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi, BOOL32 bHotTrack)
}
if (phdi->fmt & HDF_IMAGE) {
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
// ImageList_Draw (infoPtr->himl, phdi->iImage,...);
@ -203,7 +214,7 @@ HEADER_Refresh (WND *wndPtr, HDC32 hdc)
x = rect.left;
for (i = 0; i < infoPtr->uNumItem; i++) {
x = HEADER_DrawItem (wndPtr, hdc, &infoPtr->items[i], FALSE);
x = HEADER_DrawItem (wndPtr, hdc, i, FALSE);
}
if ((x <= rect.right) && (infoPtr->uNumItem > 0)) {
@ -219,14 +230,14 @@ HEADER_Refresh (WND *wndPtr, HDC32 hdc)
static void
HEADER_RefreshItem (WND *wndPtr, HDC32 hdc, HEADER_ITEM *phdi)
HEADER_RefreshItem (WND *wndPtr, HDC32 hdc, INT32 iItem)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr(wndPtr);
HFONT32 hFont, hOldFont;
hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject32 (SYSTEM_FONT);
hOldFont = SelectObject32 (hdc, hFont);
HEADER_DrawItem (wndPtr, hdc, phdi, FALSE);
HEADER_DrawItem (wndPtr, hdc, iItem, FALSE);
SelectObject32 (hdc, hOldFont);
}
@ -501,8 +512,8 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM32 wParam)
if (infoPtr->uNumItem == 1) {
TRACE(header, "Simple delete!\n");
if (infoPtr->items[0].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[0].pszText);
HeapFree (SystemHeap, 0, infoPtr->items);
HeapFree (GetProcessHeap (), 0, infoPtr->items[0].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items);
infoPtr->items = 0;
infoPtr->uNumItem = 0;
}
@ -511,10 +522,10 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM32 wParam)
TRACE(header, "Complex delete! [iItem=%d]\n", iItem);
if (infoPtr->items[iItem].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[iItem].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
infoPtr->uNumItem--;
infoPtr->items = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (HEADER_ITEM) * infoPtr->uNumItem);
/* pre delete copy */
if (iItem > 0) {
@ -528,7 +539,7 @@ HEADER_DeleteItem (WND *wndPtr, WPARAM32 wParam)
(infoPtr->uNumItem - iItem) * sizeof(HEADER_ITEM));
}
HeapFree (SystemHeap, 0, oldItems);
HeapFree (GetProcessHeap (), 0, oldItems);
}
HEADER_SetItemBounds (wndPtr);
@ -669,7 +680,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
iItem = infoPtr->uNumItem;
if (infoPtr->uNumItem == 0) {
infoPtr->items = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (HEADER_ITEM));
infoPtr->uNumItem++;
}
@ -677,7 +688,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HEADER_ITEM *oldItems = infoPtr->items;
infoPtr->uNumItem++;
infoPtr->items = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->items = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (HEADER_ITEM) * infoPtr->uNumItem);
/* pre insert copy */
if (iItem > 0) {
@ -691,7 +702,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
(infoPtr->uNumItem - iItem) * sizeof(HEADER_ITEM));
}
HeapFree (SystemHeap, 0, oldItems);
HeapFree (GetProcessHeap (), 0, oldItems);
}
infoPtr->items[iItem].bDown = FALSE;
@ -703,7 +714,7 @@ HEADER_InsertItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
len = lstrlen32A (phdi->pszText);
infoPtr->items[iItem].pszText =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, len+1);
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (infoPtr->items[iItem].pszText, phdi->pszText);
infoPtr->items[iItem].cchTextMax = phdi->cchTextMax;
}
@ -748,7 +759,7 @@ HEADER_Layout (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpLayout->pwpos->cy = 0;
else
lpLayout->pwpos->cy = infoPtr->nHeight;
lpLayout->pwpos->flags = SWP_NOACTIVATE|SWP_NOZORDER;
lpLayout->pwpos->flags = SWP_NOZORDER;
TRACE (header, "Layout x=%d y=%d cx=%d cy=%d\n",
lpLayout->pwpos->x, lpLayout->pwpos->y,
@ -818,9 +829,9 @@ HEADER_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (phdi->mask & HDI_TEXT) {
INT32 len = lstrlen32A (phdi->pszText);
if (infoPtr->items[iItem].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[iItem].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
infoPtr->items[iItem].pszText =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, len+1);
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, len+1);
lstrcpy32A (infoPtr->items[iItem].pszText, phdi->pszText);
infoPtr->items[iItem].cchTextMax = phdi->cchTextMax;
}
@ -859,7 +870,7 @@ HEADER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
HFONT32 hOldFont;
HDC32 hdc;
infoPtr = (HEADER_INFO *)HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
infoPtr = (HEADER_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(HEADER_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
@ -896,15 +907,15 @@ HEADER_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (infoPtr->items) {
for (iItem = 0; iItem < infoPtr->uNumItem; iItem++) {
if (infoPtr->items[iItem].pszText)
HeapFree (SystemHeap, 0, infoPtr->items[iItem].pszText);
HeapFree (GetProcessHeap (), 0, infoPtr->items[iItem].pszText);
}
HeapFree (SystemHeap, 0, infoPtr->items);
HeapFree (GetProcessHeap (), 0, infoPtr->items);
}
if (infoPtr->himl)
ImageList_Destroy (infoPtr->himl);
HeapFree (SystemHeap, 0, infoPtr);
HeapFree (GetProcessHeap (), 0, infoPtr);
return 0;
}
@ -962,7 +973,7 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* Send WM_CUSTOMDRAW */
hdc = GetDC32 (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, &infoPtr->items[iItem]);
HEADER_RefreshItem (wndPtr, hdc, iItem);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
TRACE (header, "Pressed item %d!\n", iItem);
@ -987,8 +998,6 @@ HEADER_LButtonDown (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
}
return 0;
}
@ -1010,7 +1019,7 @@ HEADER_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if ((iItem == infoPtr->iMoveItem) && (flags == HHT_ONHEADER)) {
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC32 (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, &infoPtr->items[infoPtr->iMoveItem]);
HEADER_RefreshItem (wndPtr, hdc, infoPtr->iMoveItem);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
HEADER_SendClickNotify (wndPtr, HDN_ITEMCLICK32A, infoPtr->iMoveItem);
@ -1086,7 +1095,7 @@ HEADER_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
else
infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
hdc = GetDC32 (wndPtr->hwndSelf);
HEADER_RefreshItem (wndPtr, hdc, &infoPtr->items[infoPtr->iMoveItem]);
HEADER_RefreshItem (wndPtr, hdc, infoPtr->iMoveItem);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
TRACE (header, "Moving pressed item %d!\n", infoPtr->iMoveItem);
@ -1127,7 +1136,7 @@ HEADER_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
if ((wndPtr->dwStyle & HDS_BUTTONS) && (wndPtr->dwStyle & HDS_HOTTRACK)) {
FIXME (header, "hot track support!\n");
}
return 0;

View File

@ -13,6 +13,7 @@
#include "win.h"
#include "combo.h"
#include "debug.h"
#include "tweak.h"
/* Unimplemented yet:
* - LBS_NOSEL
@ -1330,7 +1331,7 @@ static LRESULT LISTBOX_InsertItem( WND *wnd, LB_DESCR *descr, INT32 index,
if (index <= descr->focus_item)
{
descr->focus_item++;
LISTBOX_MoveCaret( wnd, descr, descr->focus_item - 1, FALSE );
LISTBOX_MoveCaret( wnd, descr, descr->focus_item, FALSE );
}
/* If listbox was empty, set focus to the first item */
@ -1447,7 +1448,7 @@ static LRESULT LISTBOX_RemoveItem( WND *wnd, LB_DESCR *descr, INT32 index )
if (index <= descr->focus_item)
{
descr->focus_item--;
LISTBOX_MoveCaret( wnd, descr, descr->focus_item + 1, FALSE );
LISTBOX_MoveCaret( wnd, descr, descr->focus_item, FALSE );
}
return LB_OKAY;
}
@ -2484,6 +2485,11 @@ LRESULT WINAPI ListBoxWndProc( HWND32 hwnd, UINT32 msg,
}
break;
case WM_NCCREATE:
if (TWEAK_Win95Look)
wnd->dwExStyle |= WS_EX_CLIENTEDGE;
return DefWindowProc32A( hwnd, msg, wParam, lParam );
default:
if ((msg >= WM_USER) && (msg < 0xc000))
WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",

View File

@ -653,6 +653,9 @@ static void MENU_CalcItemSize( HDC32 hdc, MENUITEM *lpitem, HWND32 hwndOwner,
{
dwSize = GetTextExtent( hdc, lpitem->text, strlen(lpitem->text) );
lpitem->rect.right += LOWORD(dwSize);
if (TWEAK_Win95Look)
lpitem->rect.bottom += MAX (HIWORD(dwSize), sysMetrics[SM_CYMENU]- 1);
else
lpitem->rect.bottom += MAX( HIWORD(dwSize), SYSMETRICS_CYMENU );
lpitem->xTab = 0;
@ -698,6 +701,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND32 hwndOwner )
lpitem = &lppop->items[start];
orgX = maxX;
orgY = SYSMETRICS_CYBORDER;
maxTab = maxTabWidth = 0;
/* Parse items until column break or end of menu */
@ -731,6 +735,9 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND32 hwndOwner )
lppop->Height = MAX( lppop->Height, orgY );
}
if(TWEAK_Win95Look)
lppop->Height++;
lppop->Width = maxX;
ReleaseDC32( 0, hdc );
}
@ -881,22 +888,10 @@ static void MENU_DrawMenuItem( HWND32 hwnd, HDC32 hdc, MENUITEM *lpitem,
*/
}
if (lpitem->fState & MF_HILITE) {
RECT32 r = rect;
r.top += MENU_HighlightTopNudge;
r.bottom += MENU_HighlightBottomNudge;
r.left += MENU_HighlightLeftNudge;
r.right += MENU_HighlightRightNudge;
FillRect32( hdc, &r, GetSysColorBrush32(COLOR_HIGHLIGHT) );
}
else {
RECT32 r = rect;
r.top += MENU_HighlightTopNudge;
r.bottom += MENU_HighlightBottomNudge;
r.left += MENU_HighlightLeftNudge;
r.right += MENU_HighlightRightNudge;
FillRect32( hdc, &r, GetSysColorBrush32(COLOR_MENU) );
}
if (lpitem->fState & MF_HILITE)
FillRect32( hdc, &rect, GetSysColorBrush32(COLOR_HIGHLIGHT) );
else
FillRect32( hdc, &rect, GetSysColorBrush32(COLOR_MENU) );
SetBkMode32( hdc, TRANSPARENT );
@ -1147,9 +1142,6 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
lprect->bottom = lprect->top + lppop->Height;
if (suppress_draw) return lppop->Height;
if(TWEAK_Win95Look)
++lprect->bottom;
FillRect32(hDC, lprect, GetSysColorBrush32(COLOR_MENU) );
if(!TWEAK_Win95Look) {
@ -1157,6 +1149,11 @@ UINT32 MENU_DrawMenuBar( HDC32 hDC, LPRECT32 lprect, HWND32 hwnd,
MoveTo( hDC, lprect->left, lprect->bottom );
LineTo32( hDC, lprect->right, lprect->bottom );
}
else {
SelectObject32( hDC, GetSysColorPen32(COLOR_3DFACE));
MoveTo( hDC, lprect->left, lprect->bottom );
LineTo32( hDC, lprect->right, lprect->bottom );
}
if (lppop->nItems == 0) return SYSMETRICS_CYMENU;
for (i = 0; i < lppop->nItems; i++)

View File

@ -29,25 +29,20 @@
/***********************************************************************
* PROGRESS_Paint
* Draw the arrows. The background need not be erased.
* If dc!=0, it draws on it
* PROGRESS_Draw
* Draws the progress bar.
*/
static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
static void
PROGRESS_Draw (WND *wndPtr, HDC32 hdc)
{
PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(wndPtr);
HBRUSH32 hbrBar, hbrBk;
int rightBar, rightMost, ledWidth;
PAINTSTRUCT32 ps;
RECT32 rect;
HDC32 hdc;
TRACE(progress, "paint pos=%d min=%d, max=%d\n",
TRACE(progress, "refresh pos=%d min=%d, max=%d\n",
infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal);
/* get a dc */
hdc = dc==0 ? BeginPaint32(wndPtr->hwndSelf, &ps) : dc;
/* get the required bar brush */
if (infoPtr->ColorBar == CLR_DEFAULT)
hbrBar = GetSysColorBrush32(COLOR_HIGHLIGHT);
@ -60,11 +55,10 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
else
hbrBk = CreateSolidBrush32 (infoPtr->ColorBk);
/* get rect for the bar, adjusted for the border */
/* get client rectangle */
GetClientRect32 (wndPtr->hwndSelf, &rect);
/* draw the border */
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST);
/* draw the background */
FillRect32(hdc, &rect, hbrBk);
rect.left++; rect.right--; rect.top++; rect.bottom--;
@ -125,12 +119,39 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
/* delete background brush */
if (infoPtr->ColorBk != CLR_DEFAULT)
DeleteObject32 (hbrBk);
/* clean-up */
if(!dc)
EndPaint32(wndPtr->hwndSelf, &ps);
}
/***********************************************************************
* PROGRESS_Refresh
* Draw the progress bar. The background need not be erased.
*/
static void
PROGRESS_Refresh (WND *wndPtr)
{
HDC32 hdc;
hdc = GetDC32 (wndPtr->hwndSelf);
PROGRESS_Draw (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
/***********************************************************************
* PROGRESS_Paint
* Draw the progress bar. The background need not be erased.
* If dc!=0, it draws on it
*/
static void
PROGRESS_Paint (WND *wndPtr)
{
PAINTSTRUCT32 ps;
HDC32 hdc;
hdc = BeginPaint32 (wndPtr->hwndSelf, &ps);
PROGRESS_Draw (wndPtr, hdc);
EndPaint32 (wndPtr->hwndSelf, &ps);
}
/***********************************************************************
* PROGRESS_CoercePos
* Makes sure the current position (CUrVal) is within bounds.
@ -157,9 +178,14 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
switch(message)
{
case WM_NCCREATE:
wndPtr->dwExStyle |= WS_EX_STATICEDGE;
return TRUE;
case WM_CREATE:
/* allocate memory for info struct */
infoPtr = (PROGRESS_INFO *)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr =
(PROGRESS_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(PROGRESS_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
@ -175,7 +201,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
case WM_DESTROY:
TRACE(progress, "Progress Ctrl destruction, hwnd=%04x\n", hwnd);
HeapFree (SystemHeap, 0, infoPtr);
HeapFree (GetProcessHeap (), 0, infoPtr);
break;
case WM_ERASEBKGND:
@ -194,7 +220,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
break;
case WM_PAINT:
PROGRESS_Paint(wndPtr, wParam);
PROGRESS_Paint (wndPtr);
break;
case PBM_DELTAPOS:
@ -204,8 +230,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(wParam != 0){
infoPtr->CurVal += (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
@ -216,8 +241,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(temp != wParam){
infoPtr->CurVal = (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
@ -231,8 +255,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
@ -251,10 +274,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->CurVal > infoPtr->MaxVal)
infoPtr->CurVal = infoPtr->MinVal;
if(temp != infoPtr->CurVal)
{
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
}
PROGRESS_Refresh (wndPtr);
return temp;
case PBM_SETRANGE32:
@ -266,8 +286,7 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
}
return temp;
@ -287,16 +306,14 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if (wParam)
UNKNOWN_PARAM(PBM_SETBARCOLOR, wParam, lParam);
infoPtr->ColorBar = (COLORREF)lParam;
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
break;
case PBM_SETBKCOLOR:
if (wParam)
UNKNOWN_PARAM(PBM_SETBKCOLOR, wParam, lParam);
infoPtr->ColorBk = (COLORREF)lParam;
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
PROGRESS_Refresh (wndPtr);
break;
default:
@ -316,7 +333,8 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
* Registers the progress bar window class.
*
*/
void PROGRESS_Register(void)
void
PROGRESS_Register(void)
{
WNDCLASS32A wndClass;

View File

@ -12,12 +12,13 @@
#include "static.h"
#include "heap.h"
#include "debug.h"
#include "tweak.h"
static void STATIC_PaintTextfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintRectfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintIconfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintBitmapfn( WND *wndPtr, HDC32 hdc );
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC32 hdc );
static COLORREF color_windowframe, color_background, color_window;
@ -42,9 +43,9 @@ static pfPaint staticPaintFunc[SS_TYPEMASK+1] =
NULL, /* SS_OWNERDRAW */
STATIC_PaintBitmapfn, /* SS_BITMAP */
NULL, /* SS_ENHMETAFILE */
NULL, /* SS_ETCHEDHORIZ */
NULL, /* SS_ETCHEDVERT */
NULL, /* SS_ETCHEDFRAME */
STATIC_PaintEtchedfn, /* SS_ETCHEDHORIZ */
STATIC_PaintEtchedfn, /* SS_ETCHEDVERT */
STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */
};
@ -170,6 +171,9 @@ LRESULT WINAPI StaticWndProc( HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam,
switch (uMsg)
{
case WM_NCCREATE:
if (TWEAK_Win95Look && (wndPtr->dwStyle & SS_SUNKEN))
wndPtr->dwExStyle |= WS_EX_STATICEDGE;
if (style == SS_ICON)
{
CREATESTRUCT32A *cs = (CREATESTRUCT32A *)lParam;
@ -416,3 +420,48 @@ static void STATIC_PaintBitmapfn(WND *wndPtr, HDC32 hdc )
GDI_HEAP_UNLOCK(infoPtr->hIcon);
}
}
static void STATIC_PaintEtchedfn( WND *wndPtr, HDC32 hdc )
{
RECT32 rc;
HBRUSH32 hbrush;
HPEN32 hpen;
if (!TWEAK_Win95Look) return;
GetClientRect32( wndPtr->hwndSelf, &rc );
hbrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
FillRect32( hdc, &rc, hbrush );
switch (wndPtr->dwStyle & SS_TYPEMASK)
{
case SS_ETCHEDHORZ:
hpen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
MoveToEx32 (hdc, rc.left, rc.bottom / 2 - 1, NULL);
LineTo32 (hdc, rc.right - 1, rc.bottom / 2 - 1);
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
MoveToEx32 (hdc, rc.left, rc.bottom / 2, NULL);
LineTo32 (hdc, rc.right, rc.bottom / 2);
LineTo32 (hdc, rc.right, rc.bottom / 2 - 1);
SelectObject32 (hdc, hpen);
break;
case SS_ETCHEDVERT:
hpen = SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DSHADOW));
MoveToEx32 (hdc, rc.right / 2 - 1, rc.top, NULL);
LineTo32 (hdc, rc.right / 2 - 1, rc.bottom - 1);
SelectObject32 (hdc, GetSysColorPen32 (COLOR_3DHIGHLIGHT));
MoveToEx32 (hdc, rc.right / 2, rc.top, NULL);
LineTo32 (hdc, rc.right / 2, rc.bottom);
LineTo32 (hdc, rc.right / 2 -1 , rc.bottom);
SelectObject32 (hdc, hpen);
break;
case SS_ETCHEDFRAME:
DrawEdge32 (hdc, &rc, EDGE_ETCHED, BF_RECT);
break;
}
}

View File

@ -103,7 +103,7 @@ SB_DrawPart( HDC32 hdc, LPRECT32 lprc, HICON32 hIcon,
/* now draw text */
if (text) {
int oldbkmode = SetBkMode32(hdc, TRANSPARENT);
LPSTR p = text;
LPSTR p = (LPSTR)text;
UINT32 align = DT_LEFT;
if (*p == '\t') {
p++;

View File

@ -11,14 +11,16 @@
* Eric <ekohl@abo.rhein-zeitung.de>
*
* TODO:
* - Many messages.
* - All notifications.
* - Bitmap drawing.
* - Button wrapping.
* - Messages.
* - Notifications.
* - Fix TB_GETBITMAPFLAGS.
* - Fix TB_GETROWS and TB_SETROWS.
* - Tooltip support (partially).
* - Unicode suppport.
* - Internal COMMCTL32 bitmaps.
* - Customize dialog.
* - Fix TOOLBAR_Customize. (Customize dialog.)
*
* Testing:
* - Run tests using Waite Group Windows95 API Bible Volume 2.
@ -41,41 +43,59 @@
#define SEPARATOR_WIDTH 8
#define SEPARATOR_HEIGHT 5
#define TOP_BORDER 2
#define BOTTOM_BORDER 2
#define TOOLBAR_GetInfoPtr(wndPtr) ((TOOLBAR_INFO *)wndPtr->wExtra[0])
static void
TOOLBAR_DrawFlatSeparator (LPRECT32 lpRect, HDC32 hdc)
{
INT32 x = (lpRect->left + lpRect->right) / 2 - 1;
INT32 yBottom = lpRect->bottom - 3;
INT32 yTop = lpRect->top + 1;
SelectObject32 ( hdc, GetSysColorPen32 (COLOR_3DSHADOW));
MoveToEx32 (hdc, x, yBottom, NULL);
LineTo32 (hdc, x, yTop);
x++;
SelectObject32 ( hdc, GetSysColorPen32 (COLOR_3DHILIGHT));
MoveToEx32 (hdc, x, yBottom, NULL);
LineTo32 (hdc, x, yTop);
}
static void
TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
BOOL32 bFlat = (wndPtr->dwStyle & TBSTYLE_FLAT);
RECT32 rc;
if (btnPtr->fsState & TBSTATE_HIDDEN) return;
rc = btnPtr->rect;
if (btnPtr->fsStyle & TBSTYLE_SEP) {
if ((bFlat) && (btnPtr->idCommand == 0))
TOOLBAR_DrawFlatSeparator (&btnPtr->rect, hdc);
return;
}
else {
/* disabled */
if (!(btnPtr->fsState & TBSTATE_ENABLED)) {
/* button is disabled */
HICON32 hIcon;
DrawEdge32 (hdc, &rc, EDGE_RAISED,
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
hIcon = ImageList_GetIcon (infoPtr->himlDef, btnPtr->iBitmap, ILD_IMAGE);
DrawState32A (hdc, (HBRUSH32)NULL, NULL, MAKELONG(hIcon, 0), 0,
rc.left+1, rc.top+1,
infoPtr->nBitmapWidth, infoPtr->nBitmapHeight, DST_ICON|DSS_DISABLED);
// ImageList_Draw (infoPtr->himlDis, btnPtr->iBitmap, hdc,
// rc.left+1, rc.top+1, ILD_NORMAL);
return;
}
/* TBSTYLE_BUTTON */
/* pressed TBSTYLE_BUTTON */
if (btnPtr->fsState & TBSTATE_PRESSED) {
DrawEdge32 (hdc, &rc, EDGE_SUNKEN,
BF_RECT | BF_MIDDLE | BF_ADJUST);
@ -84,6 +104,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
return;
}
/* checked TBSTYLE_CHECK*/
if ((btnPtr->fsStyle & TBSTYLE_CHECK) &&
(btnPtr->fsState & TBSTATE_CHECKED)) {
HBRUSH32 hbr;
@ -99,6 +120,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
return;
}
/* indeterminate */
if (btnPtr->fsState & TBSTATE_INDETERMINATE) {
HBRUSH32 hbr;
DrawEdge32 (hdc, &rc, EDGE_RAISED,
@ -108,7 +130,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
PatBlt32 (hdc, rc.left, rc.top, rc.right - rc.left,
rc.bottom - rc.top, 0x00FA0089);
SelectObject32 (hdc, hbr);
// ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
// ImageList_Draw (infoPtr->himlDis, btnPtr->iBitmap, hdc,
// rc.left+1, rc.top+1, ILD_NORMAL);
return;
}
@ -118,7 +140,6 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
rc.left+1, rc.top+1, ILD_NORMAL);
}
}
@ -130,14 +151,10 @@ TOOLBAR_Refresh (WND *wndPtr, HDC32 hdc)
TBUTTON_INFO *btnPtr;
INT32 i;
/* draw buttons */
btnPtr = infoPtr->buttons;
for (i = 0; i < infoPtr->nNumButtons; i++) {
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++)
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
btnPtr++;
}
}
@ -146,33 +163,63 @@ TOOLBAR_CalcToolbar (WND *wndPtr)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
TBUTTON_INFO *btnPtr;
RECT32 rect;
INT32 i;
INT32 i, j, nRows;
INT32 x, y, cx, cy;
BOOL32 bVertical;
rect.left = infoPtr->nIndent;
rect.top = infoPtr->nButtonTop;
// rect.right = rect.left + infoPtr->nButtonWidth;
rect.bottom = rect.top + infoPtr->nButtonHeight;
x = infoPtr->nIndent;
y = TOP_BORDER;
cx = infoPtr->nButtonWidth;
cy = infoPtr->nButtonHeight;
nRows = 1;
btnPtr = infoPtr->buttons;
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) {
if (btnPtr->fsState & TBSTATE_HIDDEN) {
btnPtr->rect.left = 0;
btnPtr->rect.right = 0;
btnPtr->rect.top = 0;
btnPtr->rect.bottom = 0;
bVertical = FALSE;
if (btnPtr->fsState & TBSTATE_HIDDEN)
continue;
}
btnPtr->rect = rect;
if (btnPtr->fsStyle & TBSTYLE_SEP)
btnPtr->rect.right = btnPtr->rect.left + SEPARATOR_WIDTH;
if (btnPtr->fsStyle & TBSTYLE_SEP) {
/* UNDOCUMENTED: If a separator has a non zero bitmap index, */
/* it is the actual width of the separator. This is used for */
/* custom controls in toolbars. */
if ((wndPtr->dwStyle & TBSTYLE_WRAPABLE) &&
(btnPtr->fsState & TBSTATE_WRAP)) {
x = 0;
y += cy;
cx = infoPtr->nWidth;
cy = ((btnPtr->iBitmap == 0) ?
SEPARATOR_WIDTH : btnPtr->iBitmap) * 2 / 3;
nRows++;
bVertical = TRUE;
}
else
btnPtr->rect.right = btnPtr->rect.left + infoPtr->nButtonWidth;
rect.left = btnPtr->rect.right;
cx = (btnPtr->iBitmap == 0) ?
SEPARATOR_WIDTH : btnPtr->iBitmap;
}
else {
/* this must be a button */
cx = infoPtr->nButtonWidth;
}
infoPtr->nHeight = rect.bottom + 8;
btnPtr->rect.left = x;
btnPtr->rect.top = y;
btnPtr->rect.right = x + cx;
btnPtr->rect.bottom = y + cy;
if (bVertical) {
x = 0;
y += cy;
if (i < infoPtr->nNumButtons)
nRows++;
}
else
x += cx;
}
infoPtr->nHeight = y + cy + BOTTOM_BORDER;
}
@ -183,9 +230,8 @@ TOOLBAR_InternalHitTest (WND *wndPtr, LPPOINT32 lpPt)
TBUTTON_INFO *btnPtr;
INT32 i;
btnPtr = infoPtr->buttons;
for (i = 0; i < infoPtr->nNumButtons; i++) {
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) {
if (btnPtr->fsStyle & TBSTYLE_SEP) {
if (PtInRect32 (&btnPtr->rect, *lpPt)) {
TRACE (toolbar, " ON SEPARATOR %d!\n", i);
@ -197,10 +243,7 @@ TOOLBAR_InternalHitTest (WND *wndPtr, LPPOINT32 lpPt)
TRACE (toolbar, " ON BUTTON %d!\n", i);
return i;
}
}
btnPtr++;
}
TRACE (toolbar, " NOWHERE!\n");
@ -215,12 +258,11 @@ TOOLBAR_GetButtonIndex (TOOLBAR_INFO *infoPtr, INT32 idCommand)
INT32 i;
btnPtr = infoPtr->buttons;
for (i = 0; i < infoPtr->nNumButtons; i++) {
for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) {
if (btnPtr->idCommand == idCommand) {
TRACE (toolbar, "command=%d index=%d\n", idCommand, i);
return i;
}
btnPtr++;
}
TRACE (toolbar, "no index found for command=%d\n", idCommand);
return -1;
@ -289,28 +331,15 @@ TOOLBAR_AddBitmap (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* create new default image list */
TRACE (toolbar, "creating default image list!\n");
infoPtr->himlDef =
ImageList_Create (infoPtr->nBitmapWidth,
infoPtr->nBitmapHeight, ILC_COLOR | ILC_MASK,
(INT32)wParam, 2);
ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight,
ILC_COLOR | ILC_MASK, (INT32)wParam, 2);
}
#if 0
if (!(infoPtr->himlDis)) {
/* create new disabled image list */
TRACE (toolbar, "creating disabled image list!\n");
infoPtr->himlDis =
ImageList_Create (infoPtr->nBitmapWidth,
infoPtr->nBitmapHeight, ILC_COLOR | ILC_MASK,
(INT32)wParam, 2);
}
#endif
/* Add bitmaps to the default image list */
if (lpAddBmp->hInst == (HINSTANCE32)0) {
nIndex =
ImageList_AddMasked (infoPtr->himlDef, (HBITMAP32)lpAddBmp->nID,
0xC0C0C0);
// GetSysColor32 (COLOR_3DFACE));
GetSysColor32 (COLOR_3DFACE));
}
else if (lpAddBmp->hInst == HINST_COMMCTRL) {
/* add internal bitmaps */
@ -353,17 +382,17 @@ TOOLBAR_AddButtons32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (infoPtr->nNumButtons == 0) {
infoPtr->buttons =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (TBUTTON_INFO) * nNewButtons);
}
else {
TBUTTON_INFO *oldButtons = infoPtr->buttons;
infoPtr->buttons =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (TBUTTON_INFO) * nNewButtons);
memcpy (&infoPtr->buttons[0], &oldButtons[0],
nOldButtons * sizeof(TBUTTON_INFO));
HeapFree (SystemHeap, 0, oldButtons);
HeapFree (GetProcessHeap (), 0, oldButtons);
}
infoPtr->nNumButtons = nNewButtons;
@ -409,20 +438,20 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
nIndex = infoPtr->nNumStrings;
if (infoPtr->nNumStrings == 0) {
infoPtr->strings =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, sizeof(char *));
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(char *));
}
else {
char **oldStrings = infoPtr->strings;
infoPtr->strings =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(char *) * (infoPtr->nNumStrings + 1));
memcpy (&infoPtr->strings[0], &oldStrings[0],
sizeof(char *) * infoPtr->nNumStrings);
HeapFree (SystemHeap, 0, oldStrings);
HeapFree (GetProcessHeap (), 0, oldStrings);
}
infoPtr->strings[infoPtr->nNumStrings] =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, sizeof(char)*(len+1));
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(char)*(len+1));
lstrcpy32A (infoPtr->strings[infoPtr->nNumStrings], szString);
infoPtr->nNumStrings++;
}
@ -439,20 +468,20 @@ TOOLBAR_AddString32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (infoPtr->nNumStrings == 0) {
infoPtr->strings =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, sizeof(char *));
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(char *));
}
else {
char **oldStrings = infoPtr->strings;
infoPtr->strings =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(char *) * (infoPtr->nNumStrings + 1));
memcpy (&infoPtr->strings[0], &oldStrings[0],
sizeof(char *) * infoPtr->nNumStrings);
HeapFree (SystemHeap, 0, oldStrings);
HeapFree (GetProcessHeap (), 0, oldStrings);
}
infoPtr->strings[infoPtr->nNumStrings] =
HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY, sizeof(char)*(len+1));
HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(char)*(len+1));
lstrcpy32A (infoPtr->strings[infoPtr->nNumStrings], p);
infoPtr->nNumStrings++;
@ -493,6 +522,12 @@ TOOLBAR_ButtonStructSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
if (infoPtr == NULL) {
ERR (toolbar, "(0x%08lx, 0x%08x, 0x%08lx)\n", (DWORD)wndPtr, wParam, lParam);
ERR (toolbar, "infoPtr == NULL!\n");
return 0;
}
infoPtr->dwStructSize = (DWORD)wParam;
return 0;
@ -575,7 +610,13 @@ TOOLBAR_CommandToIndex (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
// << TOOLBAR_Customize >>
static LRESULT
TOOLBAR_Customize (WND *wndPtr)
{
FIXME (toolbar, "customization not implemented!\n");
return 0;
}
static LRESULT
@ -589,7 +630,7 @@ TOOLBAR_DeleteButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if (infoPtr->nNumButtons == 1) {
TRACE (toolbar, " simple delete!\n");
HeapFree (SystemHeap, 0, infoPtr->buttons);
HeapFree (GetProcessHeap (), 0, infoPtr->buttons);
infoPtr->buttons = NULL;
infoPtr->nNumButtons = 0;
}
@ -598,7 +639,7 @@ TOOLBAR_DeleteButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
TRACE(toolbar, "complex delete! [nIndex=%d]\n", nIndex);
infoPtr->nNumButtons--;
infoPtr->buttons = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->buttons = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (TBUTTON_INFO) * infoPtr->nNumButtons);
if (nIndex > 0) {
memcpy (&infoPtr->buttons[0], &oldButtons[0],
@ -610,7 +651,7 @@ TOOLBAR_DeleteButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
(infoPtr->nNumButtons - nIndex) * sizeof(TBUTTON_INFO));
}
HeapFree (SystemHeap, 0, oldButtons);
HeapFree (GetProcessHeap (), 0, oldButtons);
}
TOOLBAR_CalcToolbar (wndPtr);
@ -636,7 +677,7 @@ TOOLBAR_EnableButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
btnPtr = &infoPtr->buttons[nIndex];
if (LOWORD(lParam) == FALSE)
btnPtr->fsState &= ~TBSTATE_ENABLED;
btnPtr->fsState &= ~(TBSTATE_ENABLED | TBSTATE_PRESSED);
else
btnPtr->fsState |= TBSTATE_ENABLED;
@ -700,7 +741,16 @@ TOOLBAR_GetButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
// << TOOLBAR_GetButtonInfo >>
// << TOOLBAR_GetButtonSize >>
static LRESULT
TOOLBAR_GetButtonSize (WND *wndPtr)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
return MAKELONG((WORD)infoPtr->nButtonWidth,
(WORD)infoPtr->nButtonHeight);
}
static LRESULT
@ -904,7 +954,7 @@ TOOLBAR_InsertButton32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
oldButtons = infoPtr->buttons;
infoPtr->nNumButtons++;
infoPtr->buttons = HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
infoPtr->buttons = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof (TBUTTON_INFO) * infoPtr->nNumButtons);
/* pre insert copy */
if (nIndex > 0) {
@ -926,7 +976,7 @@ TOOLBAR_InsertButton32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
(infoPtr->nNumButtons - nIndex - 1) * sizeof(TBUTTON_INFO));
}
HeapFree (SystemHeap, 0, oldButtons);
HeapFree (GetProcessHeap (), 0, oldButtons);
TOOLBAR_CalcToolbar (wndPtr);
@ -1059,7 +1109,37 @@ TOOLBAR_PressButton (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
// << TOOLBAR_ReplaceBitmap >>
// << TOOLBAR_SaveRestore >>
static LRESULT
TOOLBAR_SaveRestore32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
LPTBSAVEPARAMS32A lpSave = (LPTBSAVEPARAMS32A)lParam;
if (lpSave == NULL) return 0;
if ((BOOL32)wParam) {
/* save toolbar information */
FIXME (toolbar, "save to \"%s\" \"%s\"\n",
lpSave->pszSubKey, lpSave->pszValueName);
}
else {
/* restore toolbar information */
FIXME (toolbar, "restore from \"%s\" \"%s\"\n",
lpSave->pszSubKey, lpSave->pszValueName);
}
return 0;
}
// << TOOLBAR_SaveRestore32W >>
// << TOOLBAR_SetAnchorHighlight >>
@ -1233,26 +1313,15 @@ TOOLBAR_SetToolTips (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
static LRESULT
TOOLBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (TOOLBAR_INFO *)HeapAlloc (SystemHeap, HEAP_ZERO_MEMORY,
sizeof(TOOLBAR_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (toolbar, "could not allocate info memory!\n");
return 0;
}
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
/* initialize info structure */
infoPtr->nButtonHeight = 22;
infoPtr->nButtonWidth = 23;
infoPtr->nButtonTop = 2;
infoPtr->nBitmapHeight = 15;
infoPtr->nBitmapWidth = 16;
infoPtr->nHeight = infoPtr->nButtonHeight + 6;
infoPtr->nHeight = infoPtr->nButtonHeight + TOP_BORDER + BOTTOM_BORDER;
infoPtr->nMaxRows = 1;
infoPtr->bCaptured = 0;
@ -1260,6 +1329,8 @@ TOOLBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr->nOldHit = -1;
infoPtr->hwndNotify = GetParent32 (wndPtr->hwndSelf);
infoPtr->bTransparent = (wndPtr->dwStyle & TBSTYLE_FLAT);
infoPtr->nHotItem = -1;
return 0;
}
@ -1276,16 +1347,16 @@ TOOLBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
/* delete button data */
if (infoPtr->buttons)
HeapFree (SystemHeap, 0, infoPtr->buttons);
HeapFree (GetProcessHeap (), 0, infoPtr->buttons);
/* delete strings */
if (infoPtr->strings) {
INT32 i;
for (i = 0; i < infoPtr->nNumStrings; i++)
if (infoPtr->strings[i])
HeapFree (SystemHeap, 0, infoPtr->strings[i]);
HeapFree (GetProcessHeap (), 0, infoPtr->strings[i]);
HeapFree (SystemHeap, 0, infoPtr->strings);
HeapFree (GetProcessHeap (), 0, infoPtr->strings);
}
/* destroy default image list */
@ -1301,7 +1372,7 @@ TOOLBAR_Destroy (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
ImageList_Destroy (infoPtr->himlHot);
/* free toolbar info data */
HeapFree (SystemHeap, 0, infoPtr);
HeapFree (GetProcessHeap (), 0, infoPtr);
return 0;
}
@ -1334,11 +1405,8 @@ TOOLBAR_LButtonDblClk (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
else if (wndPtr->dwStyle & CCS_ADJUSTABLE) {
/* customize */
FIXME (toolbar, "customization not implemented!\n");
}
else if (wndPtr->dwStyle & CCS_ADJUSTABLE)
TOOLBAR_Customize (wndPtr);
return 0;
}
@ -1388,6 +1456,7 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
INT32 nHit;
INT32 nOldIndex = -1;
HDC32 hdc;
BOOL32 bSendMessage = TRUE;
pt.x = (INT32)LOWORD(lParam);
pt.y = (INT32)HIWORD(lParam);
@ -1399,12 +1468,15 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
btnPtr = &infoPtr->buttons[infoPtr->nButtonDown];
btnPtr->fsState &= ~TBSTATE_PRESSED;
if (nHit == infoPtr->nButtonDown) {
if (btnPtr->fsStyle & TBSTYLE_CHECK) {
if (btnPtr->fsStyle & TBSTYLE_GROUP) {
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, infoPtr->nButtonDown);
nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr,
infoPtr->nButtonDown);
if (nOldIndex == infoPtr->nButtonDown)
return 0;
if (nOldIndex != -1)
bSendMessage = FALSE;
if ((nOldIndex != infoPtr->nButtonDown) &&
(nOldIndex != -1))
infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED;
btnPtr->fsState |= TBSTATE_CHECKED;
}
@ -1415,9 +1487,9 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
btnPtr->fsState |= TBSTATE_CHECKED;
}
}
infoPtr->nButtonDown = -1;
infoPtr->nOldHit = -1;
}
else
bSendMessage = FALSE;
hdc = GetDC32 (wndPtr->hwndSelf);
if (nOldIndex != -1)
@ -1425,9 +1497,13 @@ TOOLBAR_LButtonUp (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
TOOLBAR_DrawButton (wndPtr, btnPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
SendMessage32A (GetParent32 (wndPtr->hwndSelf), WM_COMMAND,
if (bSendMessage)
SendMessage32A (infoPtr->hwndNotify, WM_COMMAND,
MAKEWPARAM(btnPtr->idCommand, 0),
(LPARAM)wndPtr->hwndSelf);
infoPtr->nButtonDown = -1;
infoPtr->nOldHit = -1;
}
return 0;
@ -1470,34 +1546,43 @@ TOOLBAR_MouseMove (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
static LRESULT
TOOLBAR_NCCalcSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
RECT32 tmpRect = {0, 0, 0, 0};
LPRECT32 winRect;
// DefWindowProc32A (wndPtr->hwndSelf, WM_NCCALCSIZE, wParam, lParam);
winRect = (LPRECT32)lParam;
// if (wndPtr->dwStyle & WS_BORDER)
// InflateRect32 (&tmpRect, 1, 1);
if (!(wndPtr->dwStyle & CCS_NODIVIDER)) {
tmpRect.top -= 2;
tmpRect.bottom -= 2;
LPRECT32 winRect = (LPRECT32)lParam;
winRect->top += 2;
winRect->bottom += 2;
}
winRect->left -= tmpRect.left;
winRect->top -= tmpRect.top;
winRect->right -= tmpRect.right;
winRect->bottom -= tmpRect.bottom;
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCALCSIZE, wParam, lParam);
// return 0;
}
static LRESULT
TOOLBAR_NCCreate (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
{
TOOLBAR_INFO *infoPtr;
/* allocate memory for info structure */
infoPtr = (TOOLBAR_INFO *)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(TOOLBAR_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
if (infoPtr == NULL) {
ERR (toolbar, "could not allocate info memory!\n");
return 0;
}
if ((TOOLBAR_INFO*)wndPtr->wExtra[0] != infoPtr) {
ERR (toolbar, "pointer assignment error!\n");
return 0;
}
/* this is just for security (reliable??)*/
infoPtr->dwStructSize = sizeof(TBBUTTON);
return DefWindowProc32A (wndPtr->hwndSelf, WM_NCCREATE, wParam, lParam);
}
@ -1568,32 +1653,44 @@ TOOLBAR_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr(wndPtr);
RECT32 parent_rect;
HWND32 parent;
INT32 x, y, cx, cy;
INT32 flags;
UINT32 uPosFlags = 0;
flags = (INT32) wParam;
/* FIXME for flags =
* SIZE_MAXIMIZED, SIZE_MAXSHOW, SIZE_MINIMIZED, SIZE_RESTORED
* SIZE_MAXIMIZED, SIZE_MAXSHOW, SIZE_MINIMIZED
*/
// if (flags == SIZE_RESTORED) {
if (flags == SIZE_RESTORED) {
/* width and height don't apply */
parent = GetParent32 (wndPtr->hwndSelf);
GetClientRect32(parent, &parent_rect);
if (wndPtr->dwStyle & CCS_NORESIZE)
uPosFlags |= SWP_NOSIZE;
else {
infoPtr->nWidth = parent_rect.right - parent_rect.left;
TOOLBAR_CalcToolbar (wndPtr);
MoveWindow32(wndPtr->hwndSelf, parent_rect.left, parent_rect.top, //0, 0,
infoPtr->nWidth, infoPtr->nHeight, TRUE);
// }
cy = infoPtr->nHeight;
cx = infoPtr->nWidth;
}
if (wndPtr->dwStyle & CCS_NOPARENTALIGN) {
uPosFlags |= SWP_NOMOVE;
}
if (!(wndPtr->dwStyle & CCS_NODIVIDER))
cy += 2;
SetWindowPos32 (wndPtr->hwndSelf, 0, parent_rect.left, parent_rect.top,
cx, cy, uPosFlags | SWP_NOZORDER);
}
return 0;
}
LRESULT WINAPI
ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
{
@ -1632,7 +1729,8 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case TB_COMMANDTOINDEX:
return TOOLBAR_CommandToIndex (wndPtr, wParam, lParam);
// case TB_CUSTOMIZE:
case TB_CUSTOMIZE:
return TOOLBAR_Customize (wndPtr);
case TB_DELETEBUTTON:
return TOOLBAR_DeleteButton (wndPtr, wParam, lParam);
@ -1652,7 +1750,9 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
return TOOLBAR_GetButton (wndPtr, wParam, lParam);
// case TB_GETBUTTONINFO: /* 4.71 */
// case TB_GETBUTTONSIZE: /* 4.70 */
case TB_GETBUTTONSIZE:
return TOOLBAR_GetButtonSize (wndPtr);
case TB_GETBUTTONTEXT32A:
return TOOLBAR_GetButtonText32A (wndPtr, wParam, lParam);
@ -1734,7 +1834,10 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
return TOOLBAR_PressButton (wndPtr, wParam, lParam);
// case TB_REPLACEBITMAP:
// case TB_SAVERESTORE32A:
case TB_SAVERESTORE32A:
return TOOLBAR_SaveRestore32A (wndPtr, wParam, lParam);
// case TB_SAVERESTORE32W:
// case TB_SETANCHORHIGHLIGHT: /* 4.71 */
@ -1790,6 +1893,9 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_DESTROY:
return TOOLBAR_Destroy (wndPtr, wParam, lParam);
// case WM_ERASEBKGND:
// return TOOLBAR_EraseBackground (wndPtr, wParam, lParam);
case WM_LBUTTONDBLCLK:
return TOOLBAR_LButtonDblClk (wndPtr, wParam, lParam);
@ -1808,6 +1914,9 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_NCCALCSIZE:
return TOOLBAR_NCCalcSize (wndPtr, wParam, lParam);
case WM_NCCREATE:
return TOOLBAR_NCCreate (wndPtr, wParam, lParam);
case WM_NCPAINT:
return TOOLBAR_NCPaint (wndPtr, wParam, lParam);

View File

@ -8,7 +8,9 @@
* arrow keys
* - I am not sure about the default values for the Min, Max, Pos
* (in the UPDOWN_INFO the fields: MinVal, MaxVal, CurVal)
* - I think I do not handle correctly the WS_BORDER style.
* - I think I don not handle correctly the WS_BORDER style.
* (Should be fixed. <ekohl@abo.rhein-zeitung.de>)
*
* Testing:
* Not much. The following have not been tested at all:
* - horizontal arrows
@ -63,7 +65,8 @@ static int accelIndex = -1;
"UpDown Ctrl: Unknown parameter(s) for message " #msg \
"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
#define UPDOWN_GetInfoPtr(wndPtr) ((UPDOWN_INFO *)wndPtr->wExtra)
#define UPDOWN_GetInfoPtr(wndPtr) ((UPDOWN_INFO *)wndPtr->wExtra[0])
/***********************************************************************
* UPDOWN_InBounds
@ -189,7 +192,7 @@ static BOOL32 UPDOWN_GetBuddyInt(WND *wndPtr)
return FALSE;
}
else{
/* we have a regural window, so will get the text */
/* we have a regular window, so will get the text */
if (!GetWindowText32A(infoPtr->Buddy, txt, sizeof(txt)))
return FALSE;
@ -238,7 +241,7 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
if(WIDGETS_IsControl32(WIN_FindWndPtr(infoPtr->Buddy), BIC32_LISTBOX)){
SendMessage32A(infoPtr->Buddy, LB_SETCURSEL32, infoPtr->CurVal, 0);
}
else{ /* Regural window, so set caption to the number */
else{ /* Regular window, so set caption to the number */
len = sprintf(txt1, (infoPtr->Base==16) ? "%X" : "%d", infoPtr->CurVal);
sep = UPDOWN_GetThousandSep();
@ -265,19 +268,15 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
}
/***********************************************************************
* UPDOWN_Paint
* UPDOWN_Draw [Internal]
*
* Draw the arrows. The background need not be erased.
*/
static void UPDOWN_Paint(WND *wndPtr)
static void UPDOWN_Draw (WND *wndPtr, HDC32 hdc)
{
UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(wndPtr);
PAINTSTRUCT32 ps;
BOOL32 prssed;
RECT32 rect;
HDC32 hdc;
/* start painting the button */
hdc = BeginPaint32( wndPtr->hwndSelf, &ps );
/* Draw the incr button */
UPDOWN_GetArrowRect(wndPtr, &rect, TRUE);
@ -298,10 +297,38 @@ static void UPDOWN_Paint(WND *wndPtr)
(wndPtr->dwStyle & UDS_HORZ ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN) |
(prssed ? DFCS_PUSHED : 0) |
(wndPtr->dwStyle&WS_DISABLED ? DFCS_INACTIVE : 0) );
}
/***********************************************************************
* UPDOWN_Refresh [Internal]
*
* Synchronous drawing (must NOT be used in WM_PAINT).
* Calls UPDOWN_Draw.
*/
static void UPDOWN_Refresh (WND *wndPtr)
{
HDC32 hdc;
hdc = GetDC32 (wndPtr->hwndSelf);
UPDOWN_Draw (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
}
/* clean-up */
EndPaint32( wndPtr->hwndSelf, &ps );
/***********************************************************************
* UPDOWN_Paint [Internal]
*
* Asynchronous drawing (must ONLY be used in WM_PAINT).
* Calls UPDOWN_Draw.
*/
static void UPDOWN_Paint (WND *wndPtr)
{
PAINTSTRUCT32 ps;
HDC32 hdc;
hdc = BeginPaint32 (wndPtr->hwndSelf, &ps);
UPDOWN_Draw (wndPtr, hdc);
EndPaint32 (wndPtr->hwndSelf, &ps);
}
/***********************************************************************
@ -355,6 +382,7 @@ static BOOL32 UPDOWN_SetBuddy(WND *wndPtr, HWND32 hwndBud)
/* now position the up/down */
/* Since the UDS_ALIGN* flags were used, */
/* we will pick the position and size of the window. */
SetWindowPos32(wndPtr->hwndSelf,0,x,budRect.top-DEFAULT_ADDTOP,DEFAULT_WIDTH,
(budRect.bottom-budRect.top)+DEFAULT_ADDTOP+DEFAULT_ADDBOT,
SWP_NOACTIVATE|SWP_NOZORDER);
@ -413,7 +441,8 @@ static void UPDOWN_DoAction(WND *wndPtr, int delta, BOOL32 incr)
/* Also, notify it */
/* FIXME: do we need to send the notification only if
we do not have the UDS_SETBUDDYINT style set? */
SendMessage32A(infoPtr->Buddy,
SendMessage32A(GetParent32 (wndPtr->hwndSelf),
wndPtr->dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
MAKELONG(incr ? SB_LINEUP : SB_LINEDOWN, infoPtr->CurVal),
wndPtr->hwndSelf);
@ -457,7 +486,7 @@ static BOOL32 UPDOWN_CancelMode(WND *wndPtr)
ReleaseCapture(); /* if we still have it */
infoPtr->Flags = 0; /* get rid of any flags */
UPDOWN_Paint(wndPtr); /* redraw the control just in case */
UPDOWN_Refresh (wndPtr); /* redraw the control just in case */
return TRUE;
}
@ -505,7 +534,7 @@ static void UPDOWN_HandleMouseEvent(WND *wndPtr, UINT32 msg, POINT32 pt)
infoPtr->Flags |= FLAG_MOUSEIN;
/* repaint the control */
UPDOWN_Paint(wndPtr);
UPDOWN_Refresh (wndPtr);
/* process the click */
UPDOWN_DoAction(wndPtr, 1, infoPtr->Flags & FLAG_INCR);
@ -541,7 +570,7 @@ static void UPDOWN_HandleMouseEvent(WND *wndPtr, UINT32 msg, POINT32 pt)
}
/* If state changed, redraw the control */
if(temp != infoPtr->Flags)
UPDOWN_Paint(wndPtr);
UPDOWN_Refresh (wndPtr);
break;
default:
@ -562,9 +591,16 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
switch(message)
{
case WM_CREATE:
case WM_NCCREATE:
/* get rid of border, if any */
wndPtr->dwStyle &= ~WS_BORDER;
return TRUE;
case WM_CREATE:
infoPtr =
(UPDOWN_INFO*)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY,
sizeof(UPDOWN_INFO));
wndPtr->wExtra[0] = (DWORD)infoPtr;
/* initialize the info struct */
infoPtr->AccelCount=0; infoPtr->AccelVect=0;
@ -583,6 +619,10 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
case WM_DESTROY:
if(infoPtr->AccelVect)
free(infoPtr->AccelVect);
HeapFree (GetProcessHeap (), 0, infoPtr);
wndPtr->wExtra[0] = 0;
TRACE(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
break;
@ -796,10 +836,10 @@ void UPDOWN_Register(void)
if( GlobalFindAtom32A( UPDOWN_CLASS32A ) ) return;
ZeroMemory( &wndClass, sizeof( WNDCLASS32A ) );
wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW;
wndClass.style = CS_GLOBALCLASS | CS_VREDRAW;
wndClass.lpfnWndProc = (WNDPROC32)UpDownWindowProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = sizeof(UPDOWN_INFO);
wndClass.cbWndExtra = sizeof(UPDOWN_INFO*);
wndClass.hCursor = LoadCursor32A( 0, IDC_ARROW32A );
wndClass.hbrBackground = (HBRUSH32)(COLOR_3DFACE + 1);
wndClass.lpszClassName = UPDOWN_CLASS32A;

View File

@ -0,0 +1,296 @@
COMMON CONTROLS
their development status
and their UNDOCUMENTED features and functions
-----------------------------------------------------
1. Introduction
---------------
The information provided herein is based on the dll version 4.72 which
is included in MS Internet Explorer 4.01.
All information about common controls should be collected in this document.
All Wine programmers are encouraged to add their knowledge to this document.
2. General Information
----------------------
Further information about common controls can be found in the MS Platform SDK
and the MS Internet Client SDK (most recent). Information from these SDK's
will NOT be repeated here. Only information which can NOT be found in these
SDK's will be collected here. Some information in the SDK's mentioned above
is (intentionally???) WRONG. Corrections to wrong information will be
collected here too.
3. Controls
-----------
This paragraph describes the development status of the common controls.
3.1 Animation Control
---------------------
Status:
- Nothing done at all.
3.2 Combo Box Ex Control
------------------------
Status:
- Nothing done at all.
3.3 Date and Time Picker Control
--------------------------------
Status:
- Nothing done at all.
3.4 Drag List Box Control
-------------------------
Status:
- Nothing done at all.
3.5 Flat Scroll Bar Control
---------------------------
Status:
- Nothing done at all.
3.6 Header Control
------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Almost finished.
3.7 Hot Key Control
-------------------
Status:
- Nothing done at all.
3.8 Image List (no control)
---------------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Almost finished.
Notes:
Most of my test programs work as expected. But when image lists are used
in other controls (e.g. Toolbar) they don't seem to be error-free.
It looks like I have to do a major re-write (use DIB's instead of DDB's).
3.9 IP Address Control
----------------------
Status:
- Nothing done at all.
3.10 List View Control
----------------------
Status:
- Nothing done at all.
Notes:
This control id NEEDED in many places. Any volunteers??
3.11 Month Calendar Control
---------------------------
Status:
- Nothing done at all.
3.12 Pager Control
------------------
Status:
- Dummy control. No functionality.
- Not yet published.
Notes:
The dummy source code is available from the author.
3.13 Progress Bar Control
-------------------------
Author:
Original implementation by Dimitrie O. Paun.
Fixes and improvements by Eric Kohl.
Status:
- Almost finished (should behave like the original).
Notes:
WM_GETFONT and WM_SETFONT are not implemented yet. They seem to be
useless because progress bars usually don't display any textual
information. But if M$ implemented an undocumented flag to display
textual information (e.g. percentage) these messages would make sense.
3.14 Property Sheet
-------------------
Status:
- Nothing done at all.
Notes:
- This control id NEEDED in many places.
- Tab control has to be implemented first.
Any volunteers??
3.15 Rebar Control (Cool Bar)
-----------------------------
Status:
- Dummy control. No functionality.
- Not yet published.
Notes:
The dummy source code is available from the author.
3.16 Status Bar Control
-----------------------
Author:
Original implementation by Bruce Milner.
Fixes and improvements by Eric Kohl.
Status:
- 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.
3.17 Tab Control
----------------
Status:
- Nothing done at all.
- needed.
3.18 Toolbar Control
--------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
- Basic functionality is almost done. (dll version 4.0)
3.19 Tooltip Control
--------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
- Not yet published, but will be published soon.
3.20 Trackbar Control
---------------------
Author:
Eric Kohl <ekohl@abo.rhein-zeitung.de>
Status:
- Development in progress.
- Not yet published, but will be published soon.
3.21 Tree View Control
----------------------
Status:
- Nothing done at all.
- needed.
3.22 Updown Control
-------------------
Author:
Original implementation by Dimitrie O. Paun.
Some minor changes by Eric Kohl <ekohl@abo.rhein-zeitung.de>.
Status:
- Unknown.
Notes:
- Have a look at controls/updown.c for a list of bugs and missing
features.
- The status is unknown, because I did not have a close look at this
control. One test-program looked quite good, but in Win95's
cdplayer.exe the control does not show at all.
Any volunteers??
4. Additional Information
-------------------------
Has to be written...
5. Undocumented features
------------------------
There are quite a lot of undocumented functions like:
- DSA (Dynnamic String Array?) functions.
- DPA (Dymnamic Pointer Array?) functions.
- MRU ("Most Recently Used" List) functions.
- other unknown functions.
Have a look at relay32/comctl32.spec.
5.1 Dymnamic String Arrays ??? (DSA)
------------------------------------
Most of the DSA functions are implemented. I used TASKMAN.EXE to write them.
Since TASKMAN.EXE doesn't bail out or crash I think I've done it right.
Have a look at the source code to get more information.
Further documentation will be written...
5.2 Dynamic Pointer Arrays ??? (DPA)
------------------------------------
Similar to the DSA functions, but they just store pointers. I have written
some stubs and semi-stubs. They are used by Explorer and IE4 but the
implementation is still incomplete since both programs seem to crash because
of other incomplete functions.
Have a look at the source code to get more information.
Further documentation will be written...
5.3 MenuHelp
------------
Has to be written...
5.4 GetEffectiveClientRect
--------------------------
Has to be written...
6. Epilogue
-----------
You see, much work has still to be done. If you are interested in writing
a control send me an e-mail. If you like to fix bugs or add some
functionality send an e-mail to the author of the control.
Eric Kohl <ekohl@abo.rhein-zeitung.de>

50
documentation/printing Normal file
View File

@ -0,0 +1,50 @@
Printing in Wine
================
Printing in Wine can be done in one of two ways. Both of which are very alpha.
1. Use a windows 3.1 printer driver.
2. Use the builtin Wine Postscript driver (+ ghostscript to produce output for
non-postscript printers).
1. External printer drivers
---------------------------
At present only 16 bit drivers will work.
Add
printer=on
to the [wine] section of wine.conf (or ~/.winerc). This lets CreateDC proceed
if its driver argument is a 16 bit driver.
You will probably also need to add
TTEnable=0
TTOnly=0
to the [TrueType] section of win.ini .
The code for the driver interface is in graphics/win16drv .
2. Builtin Wine Postscript driver
---------------------------------
Enables printing of postscript files via a driver built into Wine. See
graphics/psdrv/README for installation instructions. The code for the
postscript driver is in graphics/psdrv .
Spooling
========
Spooling is rather primitive. The [spooler] section of wine.conf maps a port
(e.g. LPT1:) to a file or a command via a pipe. For example the following lines
LPT1:=foo.ps
LPT2:=|lpr
map LPT1: to file foo.ps and LPT2: to the lpr command. If a job is sent to an
unlisted port then a file is created with that port's name e.g. for LPT3: a
file called LPT3: would be created.

View File

@ -0,0 +1,17 @@
This file contains information on the implementation of the direct play
and direct play lobby features.
Most methods and APIs are not implemented at this point. Examine the code
to see what has been implemented. Stay tuned for some information here once
there is more implementation (and I figure out what the heck I'm doing).
The files are include/dplay.h and multimedia/dplay.c.
I think I can safely say that any application which requires direct play
or direct play lobby will not work at this point. Priority will be to get
lserver.exe and star wars rebellion going (at least the direct play portions).
TODO:
Just about everything

View File

@ -1,5 +1,5 @@
.\" -*- nroff -*-
.TH WINE 1 "September 1, 1995" "Version 9/1/95" "Windows Emulation"
.TH WINE 1 "June 22, 1998" "Version 980614" "Windows Emulator"
.SH NAME
wine \- run Windows programs under Unix
.SH SYNOPSIS
@ -16,44 +16,50 @@ wine \- run Windows programs under Unix
invokes the Windows emulator.
.PP
.B wine
currently runs a number of games and small applications (approximately
half of the applets and common games actually run), although the entire API
has not been implemented.
.PP
See the files
.B README,
.B ChangeLog,
.B configure,
and the
.B Makefile
contained in the source distribution
to compile
.B wine.
currently runs a growing list of applications written for both Win3.1 and
Win95. Older, simpler applications work better than newer, more complex
ones. A large percentage of the API has been implemented, although there
are still several major pieces of work left to do.
.SH REQUIREMENTS
At present,
.B wine
will run under any Linux kernel more recent than 0.99.13, or
under recent releases of NetBSD/i386, FreeBSD and OpenBSD/i386.
.PP
The current support for multithreaded applications relies on the
.B clone(2)
system call, which is currently available only on Linux systems running
libc6 (glibc2).
.PP
.B X
must be installed.
must be installed. To use Wine's support for multithreaded applications,
your X libraries must be reetrant. If you have libc6 (glibc2), or you
compiled the libraries yourself, they were probably compiled with the
reetrant option enabled.
.PP
.B libXpm
must be installed. (It is probably available from the same site
must be installed. It is probably available from the same site
.B wine
was, or the sources may be FTP'd from ftp.x.org).
was, or the sources may be FTP'd from ftp.x.org. Usually it's in a
package named something like XFree86-devel.
.SH INSTALLATION
To install
.B Wine,
run "./configure", which will detect your specific setup and create
the Makefiles. You can run "./configure --help" to see the available
configuration options. Then do "make depend; make" to build the
run "./configure" in the top-level directory of the source, which will
detect your specific setup and create the Makefiles. You can run
"./configure --help" to see the available configuration options. Then do
"make depend; make" to build the
.B wine
executable, and then "make install" to install it. By default,
.B wine
is installed in /usr/local/bin; you can specify a different path with
the --prefix option when running
.B configure.
.PP
For more information, see the
.B README
file contained in the source distribution
.SH OPTIONS
.TP
.I -backingstore
@ -62,17 +68,39 @@ Turn on backing store
.I -debug
Enter the debugger before starting application
.TP
.I -debugmsg name[,name]
Turn debugging messages on or off - for instance,
.I -debugmsg +dll,+heap
will turn on DLL and heap debugging messages. The full list is: all, accel,
atom, bitblt, bitmap, caret, cdaudio, class, clipboard, clipping, combo,
comm, commdlg, crtdll, cursor, dc, dde, dialog, dll, dosfs, driver, edit,
env, event, exec, file, fixup, font, gdi, global, graphics, heap, hook,
icon, int, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi,
menu, message, metafile, midi, mmio, mmsys, mmtime, module, msg, nonclient,
ole, palette, profile, prop, reg, region, relay, resource, scroll, segment,
selector,sem, sendmsg, shm, stress, string, syscolor, task, text, timer, toolhelp,ver, vxd, win, win32, winsock.
.I -debugmsg [xxx]#name[,[xxx1]#name1]
Turn debugging messages on or off.
.RS +7
.PP
xxx can be one of the following: err, warn, fixme, or trace, and # can be
either + or -. Note that there is not a space between names.
.PP
For instance:
.PP
.I -debugmsg warn+dll,+heap
will turn on DLL and heap warning messages.
.br
.I -debugmsg fixme-all,warn+cursor,+relay
will turn off all FIXME messages, turn on cursor warning messages, and turn
on all relay messages (API calls).
.PP
The full list of names is: all, accel, advapi, aspi, atom, bitblt, bitmap,
caret, cd, cdaudio, class, clipboard, clipping, combo, comm, commctrl,
commdlg, console, crtdll, cursor, dc, dde, ddeml, ddraw, debug, dialog,
dinput, dll, dosfs, driver, dsound, edit, event, exec, file, fixup, font,
gdi, global, graphics, header, heap, hook, icon, imagelist, int, int21,
int31, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi, menu,
message, metafile, midi, mmaux, mmio, mmsys, mmtime, module, mpr, msg,
nonclient, ntdll, ole, palette, print, process, profile, prop, reg, region,
relay, resource, scroll, security, segment, selector, sem, sendmsg, shell,
shm, snoop, sound, stress, string, syscolor, task, text, thread, thunk, timer,
toolhelp, tweak, uitools, updown, ver, virtual, vxd, win, win16drv, win32,
wing, winsock, wnet, x11, x11drv.
.PP
For more information on debugging messages, see the file
.I documentation/debug-msgs
in the source distribution.
.RE
.TP
.I -depth n
Change the depth to use for multiple-depth screens
@ -133,7 +161,7 @@ Turn on synchronous display mode
.TP
.I -winver version
Specify which Windows version WINE should imitate.
Possible arguments are: win31, win95 and nt351.
Possible arguments are: win31, win95, nt351, and nt40.
.PD 1
.SH PROGRAM/ARGUMENTS
The program name may be specified in DOS format (C:\\WINDOWS\\SOL.EXE) or in
@ -155,7 +183,9 @@ the
.B configure
script. Alternatively, you may have a
.I .winerc
file of this format in your home directory.
file of this format in your home directory or the environment variable
.B WINE_INI
pointing to a configuration file.
.SH CONFIGURATION FILE FORMAT
All entries are grouped in sections; a section begins with the line
.br
@ -290,6 +320,14 @@ Used to specify which messages will be excluded from the logfile.
.br
default: none
.br Used to specify which messages will be included in the logfile.
.PP
.B [Tweak.Layout]
.br
.I format: Win95Look=<true|false>
.br
default: false
.br
Use Win95 look (true) or Win3.1 look (false).
.SH SAMPLE CONFIGURATION FILE
[Drive A]
.br
@ -340,6 +378,12 @@ lpt1=/dev/lp0
Exclude=WM_TIMER;WM_SETCURSOR;WM_MOUSEMOVE;WM_NCHITTEST;
.br
Include=WM_COMMAND;
.PP
[Tweak.Layout]
.br Win95Look=[true|false]
.br Win95Look=true enables Win95-like windows layouts; Win95Look=false
uses Win3.1-like displays. If this section is not included, it defaults
to false.
.SH AUTHORS
.B Wine
is available thanks to the work of Bob Amstadt, Dag Asheim,
@ -356,9 +400,6 @@ Erik Svendsen, Goran Thyni, Jimmy Tirtawangsa, Jon Tombs,
Linus Torvalds, Gregory Trubetskoy, Michael Veksler, Morten Welinder,
Jan Willamowius, Carl Williams, Karl Guenter Wuensch, Eric Youngdale,
and James Youngman.
.PP
This man page is maintained by Mike Phillips (msphil@facstaff.wm.edu), so
please send all corrections, comments, flames, etc., to him.
.SH BUGS
There are too many to count, much less list. Some bugs of note, however,
are that programs requiring VBRUNxxx.DLL are unreliable (with reports of
@ -366,18 +407,11 @@ some working), OLE is not in place, the internal COMMDLG support is not yet
at 100% (although rapidly improving). Color support for other than 8bpp
(256 colors) is currently flaky.
.PP
A partial list of applications known to work with
.B wine
include: sol, cruel, golf, clock, notepad, charmap, calc, and wzip11.
The following URLs point to different success/testing lists:
.br
.I http://www.ifi.uio.no/~dash/wine/working-apps.html
.br
.I http://dutifp.twi.tudelft.nl:8000/wine/
A status report on many appplications is available from
.I http://www.winehq.com/apps.cgi.
Users can add, modify, and delete entries on this list.
.PP
We would like to hear about what software does run under
.B Wine,
and such reports may be posted to
Bug reports and successes may be posted to
.I comp.emulators.ms-windows.wine.
.SH AVAILABILITY
The most recent public version of
@ -385,6 +419,20 @@ The most recent public version of
can be ftp'ed from tsx-11.mit.edu in the /pub/linux/ALPHA/Wine/development
directory. The releases are in the format 'Wine-yymmdd.tar.gz',
or 'Wine-yymmdd.diff.gz' for the diff's from the previous release.
.PP
The
.B wine
homepage is at
.I http://www.winehq.com.
This website contains a great deal of information about
.B wine
as well as a collection of unofficial patches against the current release.
.PP
The
.B wine
newsgroup is
.I comp.emulators.ms-windows.wine.
All discussions about the project take place in this forum.
.SH FILES
.PD 0
.TP
@ -392,14 +440,12 @@ or 'Wine-yymmdd.diff.gz' for the diff's from the previous release.
The invoker program.
.TP
.I /usr/local/etc/wine.conf
Main configuration file for wine.
Global configuration file for wine.
.TP
.I ChangeLog
Changes in Wine, since the beginning (most recent changes first)
.I /usr/local/lib/wine.sym
Global symbol table (used in debugger)
.TP
.I configure
Shell script to automatically generate Makefiles. Usually followed by
make to compile wine.
.TP
.I Wine newsgroup
Subscribe to comp.emulators.ms-windows.wine
.I ~/.winerc
User-specific configuration file
.SH "SEE ALSO"
clone(2)

View File

@ -190,7 +190,7 @@ BYTE WINAPI GetTempDrive( BYTE ignored )
char buffer[2];
/* FIXME: apparently Windows does something with the ignored byte */
if (!GetTempPath32A( sizeof(buffer), buffer )) buffer[0] = 'C';
return toupper(buffer[0]) - 'A';
return toupper(buffer[0]);
}

View File

@ -102,7 +102,7 @@ static DRIVETYPE DRIVE_GetDriveType( const char *name )
PROFILE_GetWineIniString( name, "Type", "hd", buffer, sizeof(buffer) );
for (i = 0; i < sizeof(DRIVE_Types)/sizeof(DRIVE_Types[0]); i++)
{
if (!lstrcmpi32A( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
if (!strcasecmp( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
}
MSG("%s: unknown type '%s', defaulting to 'hd'.\n", name, buffer );
return TYPE_HD;
@ -117,7 +117,7 @@ static UINT32 DRIVE_GetFSFlags( const char *name, const char *value )
const FS_DESCR *descr;
for (descr = DRIVE_Filesystems; descr->name; descr++)
if (!lstrcmpi32A( value, descr->name )) return descr->flags;
if (!strcasecmp( value, descr->name )) return descr->flags;
MSG("%s: unknown filesystem type '%s', defaulting to 'unix'.\n",
name, value );
return DRIVE_CASE_SENSITIVE | DRIVE_CASE_PRESERVING;

View File

@ -242,7 +242,7 @@ static BOOL32 PROFILE_DeleteSection( PROFILESECTION **section, LPCSTR name )
{
while (*section)
{
if ((*section)->name && !lstrcmpi32A( (*section)->name, name ))
if ((*section)->name && !strcasecmp( (*section)->name, name ))
{
PROFILESECTION *to_del = *section;
*section = to_del->next;
@ -266,12 +266,12 @@ static BOOL32 PROFILE_DeleteKey( PROFILESECTION **section,
{
while (*section)
{
if ((*section)->name && !lstrcmpi32A( (*section)->name, section_name ))
if ((*section)->name && !strcasecmp( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
if (!lstrcmpi32A( (*key)->name, key_name ))
if (!strcasecmp( (*key)->name, key_name ))
{
PROFILEKEY *to_del = *key;
*key = to_del->next;
@ -300,12 +300,12 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section,
{
while (*section)
{
if ((*section)->name && !lstrcmpi32A( (*section)->name, section_name ))
if ((*section)->name && !strcasecmp( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
if (!lstrcmpi32A( (*key)->name, key_name )) return *key;
if (!strcasecmp( (*key)->name, key_name )) return *key;
key = &(*key)->next;
}
if (!create) return NULL;
@ -476,7 +476,7 @@ static INT32 PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name,
PROFILEKEY *key;
while (section)
{
if (section->name && !lstrcmpi32A( section->name, section_name ))
if (section->name && !strcasecmp( section->name, section_name ))
{
INT32 oldlen = len;
for (key = section->key; key; key = key->next)
@ -664,7 +664,7 @@ int PROFILE_EnumerateWineIniSection(
/* Search for the correct section */
for(scansect = WineProfile; scansect; scansect = scansect->next) {
if(scansect->name && !lstrcmpi32A(scansect->name, section)) {
if(scansect->name && !strcasecmp(scansect->name, section)) {
/* Enumerate each key with the callback */
for(scankey = scansect->key; scankey; scankey = scankey->next) {
@ -752,6 +752,12 @@ int PROFILE_LoadWineIni(void)
const char *p;
FILE *f;
if ( (p = getenv( "WINE_INI" )) && (f = fopen( p, "r" )) )
{
WineProfile = PROFILE_Load( f );
fclose( f );
return 1;
}
if ((p = getenv( "HOME" )) != NULL)
{
lstrcpyn32A(buffer, p, MAX_PATHNAME_LEN - sizeof(PROFILE_WineIniName));
@ -1077,11 +1083,67 @@ BOOL32 WINAPI WritePrivateProfileSection32A( LPCSTR section,
WORD WINAPI GetPrivateProfileSectionNames16( LPSTR buffer, WORD size,
LPCSTR filename )
{
FIXME(profile, "(%p,%d,%s):stub\n", buffer, size, filename);
buffer[0] = buffer[1] = '\0';
return 0;
char *buf;
int l,cursize;
PROFILESECTION *section;
if (PROFILE_Open( filename )) {
buf=buffer;
cursize=0;
section=CurProfile.section;
for ( ; section; section = section->next) {
l=strlen (section->name);
cursize+=l+1;
if (cursize > size+1)
return size-2;
strcpy (buf,section->name);
buf+=l;
*buf=0;
buf++;
}
buf++;
*buf=0;
return (buf-buffer);
}
return FALSE;
}
/***********************************************************************
* GetPrivateProfileStruct32A (KERNEL32.370)
*/
WORD WINAPI GetPrivateProfileStruct32A (LPCSTR section, LPCSTR key,
LPVOID buf, UINT32 len, LPCSTR filename)
{
PROFILEKEY *k;
if (PROFILE_Open( filename )) {
k=PROFILE_Find ( &CurProfile.section, section, key, FALSE);
if (!k) return FALSE;
lstrcpyn32A( buf, k->value, strlen(k->value));
return TRUE;
}
return FALSE;
}
/***********************************************************************
* WritePrivateProfileStruct32A (KERNEL32.744)
*/
WORD WINAPI WritePrivateProfileStruct32A (LPCSTR section, LPCSTR key,
LPVOID buf, UINT32 bufsize, LPCSTR filename)
{
if ((!section) && (!key) && (!buf)) { /* flush the cache */
PROFILE_FlushFile();
return FALSE;
}
if (!PROFILE_Open( filename )) return FALSE;
return PROFILE_SetString( section, key, buf);
}
/***********************************************************************
* WriteOutProfiles (KERNEL.315)
*/

View File

@ -7,6 +7,7 @@
#include "gdi.h"
#include "heap.h"
#include "debug.h"
#include <string.h>
typedef struct tagGRAPHICS_DRIVER
{
@ -54,7 +55,7 @@ const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name )
GRAPHICS_DRIVER *driver = firstDriver;
while (driver)
{
if (!lstrcmpi32A( driver->name, name )) return driver->funcs;
if (!strcasecmp( driver->name, name )) return driver->funcs;
driver = driver->next;
}
return genericDriver ? genericDriver->funcs : NULL;
@ -71,7 +72,7 @@ BOOL32 DRIVER_UnregisterDriver( LPCSTR name )
GRAPHICS_DRIVER **ppDriver = &firstDriver;
while (*ppDriver)
{
if (!lstrcmpi32A( (*ppDriver)->name, name ))
if (!strcasecmp( (*ppDriver)->name, name ))
{
GRAPHICS_DRIVER *driver = *ppDriver;
(*ppDriver) = driver->next;

View File

@ -0,0 +1,23 @@
DEFS = -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = psdrv
C_SRCS = \
afm.c \
driver.c \
escape.c \
font.c \
graphics.c \
init.c \
objects.c \
ps.c \
text.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:

75
graphics/psdrv/README Normal file
View File

@ -0,0 +1,75 @@
Wine Postscript Driver
======================
When complete this will allow Wine to generate Postscript files without needing
an external printer driver. It should be possible to print to a non Postscript
printer by filtering the output through ghostscript.
Installation
------------
At the moment the driver will only work for 16 bit apps, the move to 32 bit
should be quite easy, I'd just like to improve it first. The driver behaves as
if it were a DRV file called WINEPS.DRV . To install it as the default printer
driver add
device=Wine Postscript Driver,WINEPS,LPT1:
to the [windows] section of win.ini . You may prefer to add
Wine Postscript Driver=WINEPS,LPT1:
to the [devices] section of win.ini instead.
You will need Adobe Font Metric (AFM) files for the (type 1 Postscript) fonts
that you wish to use. You can get these from
ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles . The directories base17 or
base35 are good places to start.
Note that these are only the font metrics and not the fonts themselves. At
present the driver does not download additional fonts, so you can only use
fonts that are already present on the printer.
Then create a [afmfiles] section in your wine.conf (or ~/.winerc) and add a
line of the form
file=/unix/path/name/filename.afm
for each AFM file that you wish to use. [This might change in the future]
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.
If you're lucky you should now be able to produce PS files from Wine!
I've tested it with win3.1 notepad/write, Winword6 and Origin4.0 with some
degree of success - you should be able to get something out, it may not be in
the right place.
TODO / Bugs
-----------
Driver doesn't read PPD files - it should.
A4 portrait mode is hard coded in at the moment.
Graphics are basically non-existent. Only MoveTo/LineTo/Rectangle with a thin
black pen.
No colour.
AFM parsing is not finished (or ideal).
No TrueType download.
Many partial-implemented functions.
Probably many more...
Since the driver is very 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>

304
graphics/psdrv/afm.c Normal file
View File

@ -0,0 +1,304 @@
/*
* Adobe Font Metric (AFM) file parsing
* See http://www.adobe.com/supportservice/devrelations/PDFS/TN/5004.AFM_Spec.pdf
*
* Copyright 1998 Huw D M Davies
*
*/
#include <string.h>
#include "windows.h"
#include "winnt.h" /* HEAP_ZERO_MEMORY */
#include "psdrv.h"
#include "options.h"
#include "debug.h"
#include "heap.h"
#include <ctype.h>
/* ptr to fonts for which we have afm files */
FontFamily *PSDRV_AFMFontList = NULL;
/***********************************************************
*
* PSDRV_AFMGetCharMetrics
*
* Parses CharMetric section of AFM file.
*
* Actually only collects the widths of numbered chars and puts then in
* afm->CharWidths.
*/
static void PSDRV_AFMGetCharMetrics(AFM *afm, FILE *fp)
{
char buf[256];
char *cp, *item, *value;
int i, charno;
for(i = 0; i < afm->NumofMetrics; i++) {
if(!fgets(buf, sizeof(buf), fp)) {
ERR(psdrv, "Unexpected EOF\n");
return;
}
cp = buf + strlen(buf);
do {
*cp = '\0';
cp--;
} while(cp > buf && isspace(*cp));
item = strtok(buf, ";");
if(!strncmp(item, "C ", 2)) {
value = strchr(item, ' ');
sscanf(value, " %d", &charno);
} else if(!strncmp(item, "CH ", 3)) {
value = strrchr(item, ' ');
sscanf(value, " %x", &charno);
} else {
WARN(psdrv, "Don't understand '%s'\n", item);
return;
}
while((item = strtok(NULL, ";"))) {
while(isspace(*item))
item++;
value = strchr(item, ' ');
if(!value) /* last char maybe a ';' but no white space after it */
break;
value++;
if(!strncmp("WX ", item, 3) || !strncmp("W0X ", item, 4)) {
if(charno >= 0 && charno <= 0xff)
sscanf(value, "%f", &(afm->CharWidths[charno]));
}
/* would carry on here to scan in BBox, name and ligs */
}
}
return;
}
/***********************************************************
*
* PSDRV_AFMParse
*
* Fills out an AFM structure and associated substructures (see psdrv.h)
* for a given AFM file. All memory is allocated from the process heap.
* Returns a ptr to the AFM structure or NULL on error.
*
* This is not complete (we don't handle kerning yet) and not efficient
*/
static AFM *PSDRV_AFMParse(char const *file)
{
FILE *fp;
char buf[256];
char *value;
AFM *afm;
char *cp;
if((fp = fopen(file, "r")) == NULL) {
MSG("Can't open AFM file '%s'. Please check wine.conf .\n", file);
return NULL;
}
afm = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AFM));
if(!afm) {
fclose(fp);
return NULL;
}
while(fgets(buf, sizeof(buf), fp)) {
cp = buf + strlen(buf);
do {
*cp = '\0';
cp--;
} while(cp > buf && isspace(*cp));
value = strchr(buf, ' ');
if(value)
value++;
if(!strncmp("FontName", buf, 8)) {
afm->FontName = HEAP_strdupA(GetProcessHeap(), 0, value);
continue;
}
if(!strncmp("FullName", buf, 8)) {
afm->FullName = HEAP_strdupA(GetProcessHeap(), 0, value);
continue;
}
if(!strncmp("FamilyName", buf, 10)) {
afm->FamilyName = HEAP_strdupA(GetProcessHeap(), 0, value);
continue;
}
if(!strncmp("Weight", buf, 6)) {
if(!strncmp("Roman", value, 5) || !strncmp("Medium", value, 6)
|| !strncmp("Book", value, 4))
afm->Weight = FW_NORMAL;
else if(!strncmp("Demi", value, 4))
afm->Weight = FW_DEMIBOLD;
else if(!strncmp("Bold", value, 4))
afm->Weight = FW_BOLD;
else if(!strncmp("Light", value, 5))
afm->Weight = FW_LIGHT;
else {
FIXME(psdrv, "Unkown AFM Weight '%s'\n", value);
afm->Weight = FW_NORMAL;
}
continue;
}
if(!strncmp("ItalicAngle", buf, 11)) {
sscanf(value, "%f", &(afm->ItalicAngle));
continue;
}
if(!strncmp("IsFixedPitch", buf, 12)) {
if(!strncasecmp("false", value, 5))
afm->IsFixedPitch = FALSE;
else
afm->IsFixedPitch = TRUE;
continue;
}
if(!strncmp("FontBBox", buf, 8)) {
sscanf(value, "%f %f %f %f", &(afm->FontBBox.llx),
&(afm->FontBBox.lly), &(afm->FontBBox.urx),
&(afm->FontBBox.ury) );
continue;
}
if(!strncmp("UnderlinePosition", buf, 17)) {
sscanf(value, "%f", &(afm->UnderlinePosition) );
continue;
}
if(!strncmp("UnderlineThickness", buf, 18)) {
sscanf(value, "%f", &(afm->UnderlineThickness) );
continue;
}
if(!strncmp("CapHeight", buf, 9)) {
sscanf(value, "%f", &(afm->CapHeight) );
continue;
}
if(!strncmp("XHeight", buf, 7)) {
sscanf(value, "%f", &(afm->XHeight) );
continue;
}
if(!strncmp("Ascender", buf, 8)) {
sscanf(value, "%f", &(afm->Ascender) );
continue;
}
if(!strncmp("Descender", buf, 9)) {
sscanf(value, "%f", &(afm->Descender) );
continue;
}
if(!strncmp("StartCharMetrics", buf, 16)) {
sscanf(value, "%d", &(afm->NumofMetrics) );
PSDRV_AFMGetCharMetrics(afm, fp);
continue;
}
}
fclose(fp);
if(afm->Ascender == 0.0) afm->Ascender = 1000.0;
return afm;
}
/***********************************************************
*
* PSDRV_AddAFMtoList
*
* Adds an afm to the current font list. Creates new family node if necessary.
*/
static void PSDRV_AddAFMtoList(AFM *afm)
{
FontFamily *family = PSDRV_AFMFontList;
FontFamily **insert = &PSDRV_AFMFontList;
AFM *tmpafm;
while(family) {
if(!strcmp(family->FamilyName, afm->FamilyName))
break;
insert = &(family->next);
family = family->next;
}
if(!family) {
family = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(*family));
*insert = family;
family->FamilyName = HEAP_strdupA(GetProcessHeap(), 0,
afm->FamilyName);
family->afm = afm;
return;
}
tmpafm = family->afm;
while(tmpafm->next)
tmpafm = tmpafm->next;
tmpafm->next = afm;
return;
}
/***********************************************************
*
* PSDRV_afmfilesCallback
*
* Callback for PROFILE_EnumerateWineIniSection
*/
static void PSDRV_afmfilesCallback(char const *key, char const *value,
void *user)
{
AFM *afm;
afm = PSDRV_AFMParse(value);
if(afm)
PSDRV_AddAFMtoList(afm);
return;
}
/***********************************************************
*
* PSDRV_DumpFontList
*
*/
static void PSDRV_DumpFontList(void)
{
FontFamily *family;
AFM *afm;
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);
}
}
return;
}
/***********************************************************
*
* PSDRV_GetFontMetrics
*
* Only exported function in this file. Parses all afm files listed in
* [afmfiles] of wine.conf .
*/
BOOL32 PSDRV_GetFontMetrics(void)
{
PROFILE_EnumerateWineIniSection( "afmfiles", PSDRV_afmfilesCallback, NULL);
PSDRV_DumpFontList();
return TRUE;
}

145
graphics/psdrv/driver.c Normal file
View File

@ -0,0 +1,145 @@
/*
* Exported functions from the Postscript driver.
*
* [Ext]DeviceMode, DeviceCapabilities.
*
* Will need ExtTextOut for winword6 (urgh!)
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "debug.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_ExtDeviceMode16 [WINEPS.90]
*
* Just returns default devmode at the moment
*/
INT16 WINAPI PSDRV_ExtDeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPDEVMODE16 lpdmOutput, LPSTR lpszDevice, LPSTR lpszPort,
LPDEVMODE16 lpdmInput, LPSTR lpszProfile, WORD fwMode)
{
TRACE(psdrv,
"(hwnd=%04x, hDriver=%04x, devOut=%p, Device='%s', Port='%s', devIn=%p, Profile='%s', Mode=%04x)\n",
hwnd, hDriver, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile,
fwMode);
if(!fwMode)
return sizeof(DefaultDevMode);
if(fwMode & DM_COPY)
memcpy(lpdmOutput, &DefaultDevMode, sizeof(DefaultDevMode));
return IDOK;
}
/***************************************************************
*
* PSDRV_DeviceCapabilities16 [WINEPS.91]
*
*/
DWORD WINAPI PSDRV_DeviceCapabilities16(LPSTR lpszDevice, LPSTR lpszPort,
WORD fwCapability, LPSTR lpszOutput, LPDEVMODE16 lpdm)
{
TRACE(psdrv, "Cap=%d\n", fwCapability);
switch(fwCapability) {
case DC_PAPERS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Papers, sizeof(Papers));
return sizeof(Papers) / sizeof(WORD);
case DC_PAPERSIZE:
if(lpszOutput != NULL)
memcpy(lpszOutput, PaperSizes, sizeof(PaperSizes));
return sizeof(PaperSizes) / sizeof(POINT16);
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]);
case DC_PAPERNAMES:
if(lpszOutput != NULL)
memcpy(lpszOutput, PaperNames, sizeof(PaperNames));
return sizeof(PaperNames) / sizeof(PaperNames[0]);
case DC_ORIENTATION:
return 90;
case DC_ENUMRESOLUTIONS:
if(lpszOutput != NULL)
memcpy(lpszOutput, Resolutions, sizeof(Resolutions));
return sizeof(Resolutions) / sizeof(Resolutions[0]);
default:
FIXME(psdrv, "Unsupported capability %d\n", fwCapability);
}
return -1;
}
/***************************************************************
*
* PSDRV_DeviceMode16 [WINEPS.13]
*
*/
void WINAPI PSDRV_DeviceMode16(HWND16 hwnd, HANDLE16 hDriver,
LPSTR lpszDevice, LPSTR lpszPort)
{
PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL,
NULL, DM_PROMPT );
return;
}

137
graphics/psdrv/escape.c Normal file
View File

@ -0,0 +1,137 @@
/*
* Postscript driver Escape function
*
* Copyright 1998 Huw D M Davies
*/
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include "print.h"
INT32 PSDRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
SEGPTR lpInData, SEGPTR lpOutData )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
switch(nEscape) {
case NEXTBAND: {
RECT16 *r = (RECT16 *)PTR_SEG_TO_LIN(lpOutData);
if(!physDev->job.banding) {
physDev->job.banding = TRUE;
SetRect16( r, 0, 0, dc->w.devCaps->horzRes,
dc->w.devCaps->vertRes );
TRACE(psdrv, "NEXTBAND returning %d,%d - %d,%d\n", r->left,
r->top, r->right, r->bottom );
return 1;
}
SetRect16( r, 0, 0, 0, 0 );
TRACE(psdrv, "NEXTBAND rect to 0,0 - 0,0\n" );
physDev->job.banding = FALSE;
} /* Fall through */
case NEWFRAME:
TRACE(psdrv, "NEWFRAME\n");
if(!physDev->job.hJob) {
FIXME(psdrv, "hJob == 0. Now what?\n");
return 0;
}
if(!PSDRV_WriteEndPage( dc ))
return 0;
physDev->job.NeedPageHeader = TRUE;
return 1;
case STARTDOC:
TRACE(psdrv, "STARTDOC\n");
if(physDev->job.hJob) {
FIXME(psdrv, "hJob != 0. Now what?\n");
return 0;
}
physDev->job.hJob = OpenJob(physDev->job.output,
PTR_SEG_TO_LIN(lpInData), dc->hSelf);
if(!physDev->job.hJob) {
WARN(psdrv, "OpenJob failed\n");
return 0;
}
physDev->job.banding = FALSE;
physDev->job.NeedPageHeader = FALSE;
physDev->job.PageNo = 1;
if(!PSDRV_WriteHeader( dc, PTR_SEG_TO_LIN(lpInData), cbInput ))
return 0;
if(!PSDRV_WriteNewPage( dc ))
return 0;
return 1;
case QUERYESCSUPPORT:
if(cbInput != 2) {
WARN(psdrv, "cbInput != 2 (=%d) for QUERYESCSUPPORT\n", cbInput);
return 0;
} else {
UINT16 num = *(UINT16 *)PTR_SEG_TO_LIN(lpInData);
TRACE(psdrv, "QUERYESCSUPPORT for %d\n", num);
return 0;
}
case SETABORTPROC:
FIXME(psdrv, "SETABORTPROC: ignoring\n");
return 1;
case GETPHYSPAGESIZE:
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = dc->w.devCaps->horzRes;
p->y = dc->w.devCaps->vertRes;
TRACE(psdrv, "GETPHYSPAGESIZE: returning %dx%d\n", p->x, p->y);
return 1;
}
case GETPRINTINGOFFSET:
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = p->y = 0;
TRACE(psdrv, "GETPRINTINGOFFSET: returning %dx%d\n", p->x, p->y);
return 1;
}
case GETSCALINGFACTOR:
{
POINT16 *p = (POINT16 *)PTR_SEG_TO_LIN(lpOutData);
p->x = p->y = 0;
TRACE(psdrv, "GETSCALINGFACTOR: returning %dx%d\n", p->x, p->y);
return 1;
}
case ENDDOC:
TRACE(psdrv, "ENDDOC\n");
if(!physDev->job.hJob) {
FIXME(psdrv, "hJob == 0. Now what?\n");
return 0;
}
physDev->job.NeedPageHeader = FALSE;
if(!PSDRV_WriteFooter( dc ))
return 0;
if( CloseJob( physDev->job.hJob ) == SP_ERROR ) {
WARN(psdrv, "CloseJob error\n");
return 0;
}
physDev->job.hJob = 0;
return 1;
default:
FIXME(psdrv, "Unimplemented code 0x%x\n", nEscape);
return 0;
}
}

269
graphics/psdrv/font.c Normal file
View File

@ -0,0 +1,269 @@
/*
* Postscript driver font functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include <string.h>
#include "windows.h"
#include "print.h"
#include "psdrv.h"
#include "debug.h"
/***********************************************************************
* PSDRV_FONT_SelectObject
*/
HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
FONTOBJ *font )
{
HFONT16 prevfont = dc->w.hFont;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
LOGFONT16 *lf = &(font->logfont);
BOOL32 bd = FALSE, it = FALSE;
AFM *afm;
FontFamily *family;
char FaceName[LF_FACESIZE];
TRACE(psdrv, "FaceName = '%s' Height = %d Italic = %d Weight = %d\n",
lf->lfFaceName, lf->lfHeight, lf->lfItalic, lf->lfWeight);
dc->w.hFont = hfont;
if(lf->lfItalic)
it = TRUE;
if(lf->lfWeight > 550)
bd = TRUE;
lstrcpy32A(FaceName, lf->lfFaceName);
if(FaceName[0] == '\0') {
switch(lf->lfPitchAndFamily & 0xf0) {
case FF_DONTCARE:
break;
case FF_ROMAN:
case FF_SCRIPT:
lstrcpy32A(FaceName, "Times");
break;
case FF_SWISS:
lstrcpy32A(FaceName, "Helvetica");
break;
case FF_MODERN:
lstrcpy32A(FaceName, "Courier");
break;
case FF_DECORATIVE:
lstrcpy32A(FaceName, "Symbol");
break;
}
}
if(FaceName[0] == '\0') {
switch(lf->lfPitchAndFamily & 0x0f) {
case VARIABLE_PITCH:
lstrcpy32A(FaceName, "Times");
break;
default:
lstrcpy32A(FaceName, "Courier");
break;
}
}
for(family = PSDRV_AFMFontList; family; family = family->next) {
if(!lstrncmp32A(FaceName, family->FamilyName,
strlen(family->FamilyName)))
break;
}
if(!family)
family = PSDRV_AFMFontList;
for(afm = family->afm; afm; afm = afm->next) {
if( (bd == (afm->Weight == FW_BOLD)) &&
(it == (afm->ItalicAngle != 0.0)) )
break;
}
if(!afm)
afm = family->afm; /* 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);
physDev->font.escapement = lf->lfEscapement;
physDev->font.tm.tmHeight = physDev->font.size;
physDev->font.tm.tmAscent = afm->Ascender * 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.tmAveCharWidth = afm->CharWidths[120] * /* x */
physDev->font.scale;
physDev->font.tm.tmMaxCharWidth = afm->CharWidths[77] * /* M */
physDev->font.scale;
physDev->font.tm.tmWeight = afm->Weight;
physDev->font.tm.tmItalic = afm->ItalicAngle != 0.0;
physDev->font.tm.tmUnderlined = lf->lfUnderline;
physDev->font.tm.tmStruckOut = lf->lfStrikeOut;
physDev->font.tm.tmFirstChar = 32;
physDev->font.tm.tmLastChar = 251;
physDev->font.tm.tmDefaultChar = 128;
physDev->font.tm.tmBreakChar = 32;
physDev->font.tm.tmPitchAndFamily = afm->IsFixedPitch ? 0 :
TMPF_FIXED_PITCH;
physDev->font.tm.tmPitchAndFamily |= TMPF_DEVICE;
physDev->font.tm.tmCharSet = ANSI_CHARSET;
physDev->font.tm.tmOverhang = 0;
physDev->font.tm.tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
physDev->font.tm.tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
physDev->font.set = FALSE;
TRACE(psdrv, "Selected PS font '%s' size %d weight %d\n",
physDev->font.afm->FontName, physDev->font.size,
physDev->font.tm.tmWeight );
return prevfont;
}
/***********************************************************************
* PSDRV_GetTextMetrics
*/
BOOL32 PSDRV_GetTextMetrics(DC *dc, TEXTMETRIC32A *metrics)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
memcpy(metrics, &(physDev->font.tm), sizeof(physDev->font.tm));
return TRUE;
}
/***********************************************************************
* PSDRV_GetTextExtentPoint
*/
BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
LPSIZE32 size )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
INT32 i;
float width;
size->cy = YDSTOLS(dc, physDev->font.tm.tmHeight);
width = 0.0;
for(i = 0; i < count && str[i]; i++)
width += physDev->font.afm->CharWidths[ (UINT32)str[i] ];
width *= physDev->font.scale;
size->cx = XDSTOLS(dc, width);
return TRUE;
}
/***********************************************************************
* PSDRV_SetFont
*/
BOOL32 PSDRV_SetFont( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if(physDev->font.set) return TRUE;
PSDRV_WriteReencodeFont(dc);
PSDRV_WriteSetFont(dc);
physDev->font.set = TRUE;
return TRUE;
}
/***********************************************************************
* PSDRV_GetFontMetric
*/
static UINT32 PSDRV_GetFontMetric(DC *dc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
ENUMLOGFONTEX16 *pLF, INT16 size)
{
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->lfWeight = pTM->tmWeight = pafm->Weight;
plf->lfItalic = pTM->tmItalic = pafm->ItalicAngle != 0.0;
plf->lfUnderline = pTM->tmUnderlined = 0;
plf->lfStrikeOut = pTM->tmStruckOut = 0;
plf->lfCharSet = pTM->tmCharSet = ANSI_CHARSET;
/* convert pitch values */
pTM->tmPitchAndFamily = pafm->IsFixedPitch ? 0 : TMPF_FIXED_PITCH;
pTM->tmPitchAndFamily |= TMPF_DEVICE;
plf->lfPitchAndFamily = 0;
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->tmDigitizedAspectX = dc->w.devCaps->logPixelsY;
pTM->tmDigitizedAspectY = dc->w.devCaps->logPixelsX;
*(INT32*)&pTM->tmFirstChar = 32;
/* return font type */
return DEVICE_FONTTYPE;
}
/***********************************************************************
* PSDRV_EnumDeviceFonts
*/
BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
{
ENUMLOGFONTEX16 lf;
NEWTEXTMETRIC16 tm;
BOOL32 b, bRet = 0;
AFM *afm;
FontFamily *family;
if( plf->lfFaceName[0] ) {
TRACE(psdrv, "lfFaceName = '%s'\n", plf->lfFaceName);
for(family = PSDRV_AFMFontList; 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);
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
PSDRV_GetFontMetric( dc, afm, &tm, &lf, 200 ), lp )) )
bRet = b;
else break;
}
}
} else {
TRACE(psdrv, "lfFaceName = NULL\n");
for(family = PSDRV_AFMFontList; family; family = family->next) {
afm = family->afm;
TRACE(psdrv, "Got '%s'\n", afm->FontName);
if( (b = (*proc)( (LPENUMLOGFONT16)&lf, &tm,
PSDRV_GetFontMetric( dc, afm, &tm, &lf, 200 ), lp )) )
bRet = b;
else break;
}
}
return bRet;
}

73
graphics/psdrv/graphics.c Normal file
View File

@ -0,0 +1,73 @@
/*
* Postscript driver graphics functions
*
* Copyright 1998 Huw D M Davies
*
* Not much here yet...
*/
#include <string.h>
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include "print.h"
/**********************************************************************
* PSDRV_MoveToEx
*/
BOOL32 PSDRV_MoveToEx(DC *dc, INT32 x, INT32 y, LPPOINT32 pt)
{
TRACE(psdrv, "%d %d\n", x, y);
if (pt)
{
pt->x = dc->w.CursPosX;
pt->y = dc->w.CursPosY;
}
dc->w.CursPosX = x;
dc->w.CursPosY = y;
return PSDRV_WriteMoveTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
}
/***********************************************************************
* PSDRV_LineTo
*/
BOOL32 PSDRV_LineTo(DC *dc, INT32 x, INT32 y)
{
TRACE(psdrv, "%d %d\n", x, y);
PSDRV_WriteLineTo(dc, XLPTODP(dc, x), YLPTODP(dc, y));
PSDRV_WriteStroke(dc);
dc->w.CursPosX = x;
dc->w.CursPosY = y;
return TRUE;
}
/***********************************************************************
* PSDRV_Rectangle
*/
BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
INT32 bottom)
{
INT32 width = XLSTODS(dc, right - left);
INT32 height = YLSTODS(dc, bottom - top);
TRACE(psdrv, "%d %d - %d %d\n", left, top, right, bottom);
PSDRV_WriteRectangle(dc, XLPTODP(dc, left), YLPTODP(dc, top),
width, height);
PSDRV_WriteStroke(dc);
return TRUE;
}
/***********************************************************************
* PSDRV_Ellipse
*/
BOOL32 PSDRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
{
TRACE(psdrv, "%d %d - %d %d\n", left, top, right, bottom);
return TRUE;
}

183
graphics/psdrv/init.c Normal file
View File

@ -0,0 +1,183 @@
/*
* 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"
static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData );
static BOOL32 PSDRV_DeleteDC( DC *dc );
static const DC_FUNCTIONS PSDRV_Funcs =
{
NULL, /* pArc */
NULL, /* pBitBlt */
NULL, /* pChord */
PSDRV_CreateDC, /* pCreateDC */
PSDRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
PSDRV_Ellipse, /* pEllipse */
PSDRV_EnumDeviceFonts, /* pEnumDeviceFonts */
PSDRV_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */
NULL, /* pExtFloodFill */
PSDRV_ExtTextOut, /* pExtTextOut */
NULL, /* pGetCharWidth */
NULL, /* pGetPixel */
PSDRV_GetTextExtentPoint, /* pGetTextExtentPoint */
PSDRV_GetTextMetrics, /* pGetTextMetrics */
NULL, /* pIntersectClipRect */
NULL, /* pIntersectVisRect */
PSDRV_LineTo, /* pLineTo */
PSDRV_MoveToEx, /* pMoveToEx */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg (optional) */
NULL, /* pOffsetWindowOrg (optional) */
NULL, /* pPaintRgn */
NULL, /* pPatBlt */
NULL, /* pPie */
NULL, /* pPolyPolygon */
NULL, /* pPolyPolyline */
NULL, /* pPolygon */
NULL, /* pPolyline */
NULL, /* pRealizePalette */
PSDRV_Rectangle, /* pRectangle */
NULL, /* pRestoreDC */
NULL, /* pRoundRect */
NULL, /* pSaveDC */
NULL, /* pScaleViewportExt (optional) */
NULL, /* pScaleWindowExt (optional) */
NULL, /* pSelectClipRgn */
PSDRV_SelectObject, /* pSelectObject */
NULL, /* pSelectPalette */
NULL, /* pSetBkColor */
NULL, /* pSetBkMode */
NULL, /* pSetDeviceClipping */
NULL, /* pSetDIBitsToDevice */
NULL, /* pSetMapMode (optional) */
NULL, /* pSetMapperFlags */
NULL, /* pSetPixel */
NULL, /* pSetPolyFillMode */
NULL, /* pSetROP2 */
NULL, /* pSetRelAbs */
NULL, /* pSetStretchBltMode */
NULL, /* pSetTextAlign */
NULL, /* pSetTextCharacterExtra */
NULL, /* pSetTextColor */
NULL, /* pSetTextJustification */
NULL, /* pSetViewportExt (optional) */
NULL, /* pSetViewportOrg (optional) */
NULL, /* pSetWindowExt (optional) */
NULL, /* pSetWindowOrg (optional) */
NULL, /* pStretchBlt */
NULL /* pStretchDIBits */
};
/* Default entries for devcaps */
static DeviceCaps PSDRV_DevCaps = {
/* version */ 0,
/* technology */ DT_RASPRINTER,
/* horzSize */ 200,
/* vertSize */ 288,
/* horzRes */ 4733,
/* vertRes */ 6808,
/* bitsPixel */ 1,
/* planes */ 1,
/* numBrushes */ -1,
/* numPens */ 10,
/* numMarkers */ 0,
/* numFonts */ 39,
/* numColors */ 2,
/* pdeviceSize */ 0,
/* curveCaps */ CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES |
CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS |
CC_ROUNDRECT,
/* lineCaps */ LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
LC_STYLED | LC_WIDESTYLED | LC_INTERIORS,
/* polygoalnCaps */ PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON |
PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED |
PC_INTERIORS,
/* textCaps */ 0, /* psdrv 0x59f7 */
/* clipCaps */ CP_RECTANGLE,
/* rasterCaps */ RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 |
RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT |
RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS,
/* psdrv 0x6e99 */
/* aspectX */ 600,
/* aspectY */ 600,
/* aspectXY */ 848,
/* pad1 */ { 0 },
/* logPixelsX */ 600,
/* logPixelsY */ 600,
/* pad2 */ { 0 },
/* palette size */ 0,
/* ..etc */ 0, 0 };
/*********************************************************************
* PSDRV_Init
*
* Initializes font metrics and registers driver. Called from GDI_Init()
*
*/
BOOL32 PSDRV_Init(void)
{
TRACE(psdrv, "\n");
PSDRV_GetFontMetrics();
return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs );
}
/**********************************************************************
* PSDRV_CreateDC
*/
static BOOL32 PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
LPCSTR output, const DEVMODE16* initData )
{
PSDRV_PDEVICE *physDev;
TRACE(psdrv, "(%s %s %s %p)\n", driver, device, output, initData);
if(!PSDRV_AFMFontList) {
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,
sizeof(*physDev) );
if (!physDev) return FALSE;
dc->physDev = physDev;
physDev->job.output = HEAP_strdupA( GetProcessHeap(), 0, output );
if (!physDev->job.output) return FALSE;
physDev->job.hJob = 0;
return TRUE;
}
/**********************************************************************
* PSDRV_DeleteDC
*/
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 );
dc->physDev = NULL;
return TRUE;
}

82
graphics/psdrv/objects.c Normal file
View File

@ -0,0 +1,82 @@
/*
* Postscript driver object handling
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "font.h"
#include "pen.h"
#include "brush.h"
#include "bitmap.h"
#include "debug.h"
/***********************************************************************
* PSDRV_BITMAP_SelectObject
*/
static HBITMAP16 PSDRV_BITMAP_SelectObject( DC * dc, HBITMAP16 hbitmap,
BITMAPOBJ * bmp )
{
FIXME(psdrv, "stub\n");
return 0;
}
/***********************************************************************
* PSDRV_BRUSH_SelectObject
*/
static HBRUSH32 PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH32 hbrush,
BRUSHOBJ * brush )
{
FIXME(psdrv, "stub\n");
return 0;
}
/***********************************************************************
* PSDRV_PEN_SelectObject
*/
static HPEN32 PSDRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
{
FIXME(psdrv, "stub\n");
return 0;
}
/***********************************************************************
* PSDRV_SelectObject
*/
HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle )
{
GDIOBJHDR * ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE );
HGDIOBJ32 ret = 0;
if (!ptr) return 0;
TRACE(psdrv, "hdc=%04x %04x\n", dc->hSelf, handle );
switch(ptr->wMagic)
{
case PEN_MAGIC:
ret = PSDRV_PEN_SelectObject( dc, handle, (PENOBJ *)ptr );
break;
case BRUSH_MAGIC:
ret = PSDRV_BRUSH_SelectObject( dc, handle, (BRUSHOBJ *)ptr );
break;
case BITMAP_MAGIC:
ret = PSDRV_BITMAP_SelectObject( dc, handle, (BITMAPOBJ *)ptr );
break;
case FONT_MAGIC:
ret = PSDRV_FONT_SelectObject( dc, handle, (FONTOBJ *)ptr );
break;
case REGION_MAGIC:
ret = (HGDIOBJ16)SelectClipRgn16( dc->hSelf, handle );
break;
default:
ERR(psdrv, "Unknown object magic %04x\n", ptr->wMagic);
break;
}
GDI_HEAP_UNLOCK( handle );
return ret;
}

323
graphics/psdrv/ps.c Normal file
View File

@ -0,0 +1,323 @@
/*
* Postscript output functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include "windows.h"
#include "psdrv.h"
#include "print.h"
#include "debug.h"
char psheader[] = /* title */
"%%!PS-Adobe-3.0 (not quite)\n"
"%%%%Creator: Wine Postscript Driver\n"
"%%%%Title: %s\n"
"%%%%BoundingBox: 0 0 595 842\n"
"%%%%Pages: (atend)\n"
"%%%%EndComments\n"
"%%%%BeginProlog\n"
"/reencodefont {\n"
"findfont\n"
"dup length dict begin\n"
"{1 index /FID ne {def} {pop pop} ifelse} forall\n"
"/Encoding ISOLatin1Encoding def\n"
"currentdict\n"
"end\n"
"definefont pop\n"
"} bind def\n"
"%%%%EndProlog\n"
"%%%%BeginSetup\n"
"%%%%EndSetup\n";
char psnewpage[] = /* name, number */
"%%%%Page: %s %d\n"
"%%%%BeginPageSetup\n"
"/pgsave save def\n"
"72 600 div dup scale\n"
"0 7014 translate\n"
"1 -1 scale\n"
"%%%%EndPageSetup\n";
char psendpage[] =
"pgsave restore\n"
"showpage\n";
char psfooter[] = /* pages */
"%%%%Trailer\n"
"%%%%Pages: %d\n"
"%%%%EOF\n";
char psmoveto[] = /* x, y */
"%d %d moveto\n";
char pslineto[] = /* x, y */
"%d %d lineto\n";
char psrlineto[] = /* dx, dy */
"%d %d rlineto\n";
char psstroke[] =
"stroke\n";
char psrectangle[] = /* x, y, width, height, -width */
"%d %d moveto\n"
"%d 0 rlineto\n"
"0 %d rlineto\n"
"%d 0 rlineto\n"
"closepath\n";
char psshow[] = /* string */
"(%s) show\n";
char pssetfont[] = /* fontname, xscale, yscale, ascent, escapement */
"/%s findfont\n"
"[%d 0 0 %d 0 %d]\n"
"%d 10 div matrix rotate\n"
"matrix concatmatrix\n"
"makefont setfont\n";
char psreencodefont[] = /* newfontname basefontname*/
"/%s /%s reencodefont\n";
int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if(physDev->job.NeedPageHeader) {
physDev->job.PageNo++;
if( !PSDRV_WriteNewPage(dc) )
return FALSE;
physDev->job.NeedPageHeader = FALSE;
}
return WriteSpool( physDev->job.hJob, lpData, cch );
}
INT32 PSDRV_WriteHeader( DC *dc, char *title, int len )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *titlebuf;
titlebuf = (char *)HeapAlloc( GetProcessHeap(), 0, len+1 );
if(!titlebuf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
}
memcpy(titlebuf, title, len);
titlebuf[len] = '\0';
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psheader) + len);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree( GetProcessHeap(), 0, titlebuf );
return 0;
}
wsprintf32A(buf, psheader, title);
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( GetProcessHeap(), 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, titlebuf );
HeapFree( GetProcessHeap(), 0, buf );
return 1;
}
INT32 PSDRV_WriteFooter( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psfooter) + 100 );
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
}
wsprintf32A(buf, psfooter, physDev->job.PageNo);
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
return 1;
}
INT32 PSDRV_WriteEndPage( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
if( WriteSpool( physDev->job.hJob, psendpage, sizeof(psendpage)-1 ) !=
sizeof(psendpage)-1 ) {
WARN(psdrv, "WriteSpool error\n");
return 0;
}
return 1;
}
INT32 PSDRV_WriteNewPage( DC *dc )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf;
char name[100];
wsprintf32A(name, "%d", physDev->job.PageNo);
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psnewpage) + 100 );
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return 0;
}
wsprintf32A(buf, psnewpage, name, physDev->job.PageNo);
if( WriteSpool( physDev->job.hJob, buf, strlen(buf) ) !=
strlen(buf) ) {
WARN(psdrv, "WriteSpool error\n");
HeapFree( GetProcessHeap(), 0, buf );
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
return 1;
}
BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y)
{
char buf[100];
wsprintf32A(buf, psmoveto, x, y);
return PSDRV_WriteSpool(dc, buf, strlen(buf));
}
BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y)
{
char buf[100];
wsprintf32A(buf, pslineto, x, y);
return PSDRV_WriteSpool(dc, buf, strlen(buf));
}
BOOL32 PSDRV_WriteStroke(DC *dc)
{
return PSDRV_WriteSpool(dc, psstroke, sizeof(psstroke)-1);
}
BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
INT32 height)
{
char buf[100];
wsprintf32A(buf, psrectangle, x, y, width, height, -width);
return PSDRV_WriteSpool(dc, buf, strlen(buf));
}
static char encodingext[] = "-ISOLatin1";
BOOL32 PSDRV_WriteSetFont(DC *dc)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *newbuf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0,
sizeof(pssetfont) + strlen(physDev->font.afm->FontName) + 40);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
newbuf = (char *)HeapAlloc( GetProcessHeap(), 0,
strlen(physDev->font.afm->FontName) + sizeof(encodingext));
if(!newbuf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree(GetProcessHeap(), 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);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}
BOOL32 PSDRV_WriteReencodeFont(DC *dc)
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *buf, *newbuf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0,
sizeof(psreencodefont) + 2 * strlen(physDev->font.afm->FontName)
+ sizeof(encodingext));
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
newbuf = (char *)HeapAlloc( GetProcessHeap(), 0,
strlen(physDev->font.afm->FontName) + sizeof(encodingext));
if(!newbuf) {
WARN(psdrv, "HeapAlloc failed\n");
HeapFree(GetProcessHeap(), 0, buf);
return FALSE;
}
wsprintf32A(newbuf, "%s%s", physDev->font.afm->FontName, encodingext);
wsprintf32A(buf, psreencodefont, newbuf, physDev->font.afm->FontName);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, newbuf);
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}
BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count)
{
char *buf;
buf = (char *)HeapAlloc( GetProcessHeap(), 0, sizeof(psshow) + count);
if(!buf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
wsprintf32A(buf, psshow, str);
PSDRV_WriteSpool(dc, buf, strlen(buf));
HeapFree(GetProcessHeap(), 0, buf);
return TRUE;
}

85
graphics/psdrv/text.c Normal file
View File

@ -0,0 +1,85 @@
/*
* Postscript driver text functions
*
* Copyright 1998 Huw D M Davies
*
*/
#include <string.h>
#include "windows.h"
#include "psdrv.h"
#include "debug.h"
#include "print.h"
/***********************************************************************
* PSDRV_ExtTextOut
*/
BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
const RECT32 *lprect, LPCSTR str, UINT32 count,
const INT32 *lpDx )
{
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
char *strbuf;
SIZE32 sz;
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);
if(!strbuf) {
WARN(psdrv, "HeapAlloc failed\n");
return FALSE;
}
if(dc->w.textAlign & TA_UPDATECP) {
x = dc->w.CursPosX;
y = dc->w.CursPosY;
}
x = XLPTODP(dc, x);
y = YLPTODP(dc, y);
GetTextExtentPoint32A(dc->hSelf, str, count, &sz);
sz.cx = XLSTODS(dc, sz.cx);
sz.cy = YLSTODS(dc, sz.cy);
switch(dc->w.textAlign & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
case TA_LEFT:
if(dc->w.textAlign & TA_UPDATECP)
dc->w.CursPosX = XDPTOLP(dc, x + sz.cx);
break;
case TA_CENTER:
x -= sz.cx/2;
break;
case TA_RIGHT:
x -= sz.cx;
if(dc->w.textAlign & TA_UPDATECP)
dc->w.CursPosX = XDPTOLP(dc, x);
break;
}
switch(dc->w.textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
case TA_TOP:
break;
case TA_BASELINE:
y -= physDev->font.tm.tmAscent;
break;
case TA_BOTTOM:
y -= sz.cy;
break;
}
memcpy(strbuf, str, count);
*(strbuf + count) = '\0';
PSDRV_SetFont(dc);
PSDRV_WriteMoveTo(dc, x, y);
PSDRV_WriteShow(dc, strbuf, strlen(strbuf));
HeapFree(GetProcessHeap(), 0, strbuf);
return TRUE;
}

View File

@ -1404,7 +1404,6 @@ BOOL32 X11DRV_BitBlt( DC *dcDst, INT32 xDst, INT32 yDst,
result = (BOOL32)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dcDst, TRUE );
DIB_UpdateDIBSection( dcSrc, TRUE );
return result;
}
@ -1427,6 +1426,5 @@ BOOL32 X11DRV_StretchBlt( DC *dcDst, INT32 xDst, INT32 yDst,
result = (BOOL32)CALL_LARGE_STACK( BITBLT_DoStretchBlt, &params );
LeaveCriticalSection( &X11DRV_CritSection );
DIB_UpdateDIBSection( dcDst, TRUE );
DIB_UpdateDIBSection( dcSrc, TRUE );
return result;
}

View File

@ -246,7 +246,7 @@ X11DRV_Ellipse( DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom )
BOOL32
X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
{
INT32 width, oldwidth;
INT32 width, oldwidth, oldjoinstyle;
TRACE(graphics, "(%d %d %d %d)\n",
left, top, right, bottom);
@ -276,6 +276,9 @@ X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
}
if(width == 1) width=0;
dc->u.x.pen.width=width;
oldjoinstyle=dc->u.x.pen.linejoin;
if(dc->u.x.pen.type!=PS_GEOMETRIC)
dc->u.x.pen.linejoin=PS_JOIN_MITER;
if ((right > left + width) && (bottom > top + width))
{
@ -291,6 +294,7 @@ X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
right-left-1, bottom-top-1 );
dc->u.x.pen.width=oldwidth;
dc->u.x.pen.linejoin=oldjoinstyle;
return TRUE;
}

View File

@ -23,10 +23,12 @@ HPEN32 X11DRV_PEN_SelectObject( DC * dc, HPEN32 hpen, PENOBJ * pen )
dc->w.hPen = hpen;
dc->u.x.pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
dc->u.x.pen.type = pen->logpen.lopnStyle & PS_TYPE_MASK;
dc->u.x.pen.endcap = pen->logpen.lopnStyle & PS_ENDCAP_MASK;
dc->u.x.pen.linejoin = pen->logpen.lopnStyle & PS_JOIN_MASK;
dc->u.x.pen.width = pen->logpen.lopnWidth.x * dc->vportExtX / dc->wndExtX;
dc->u.x.pen.width = (pen->logpen.lopnWidth.x * dc->vportExtX +
dc->wndExtX / 2) / dc->wndExtX;
if (dc->u.x.pen.width < 0) dc->u.x.pen.width = -dc->u.x.pen.width;
if (dc->u.x.pen.width == 1) dc->u.x.pen.width = 0; /* Faster */
dc->u.x.pen.pixel = COLOR_ToPhysical( dc, pen->logpen.lopnColor );

View File

@ -197,14 +197,14 @@ static void LFD_GetWeight( fontInfo* fi, LPSTR lpStr, int j)
fi->fi_flags |= FI_POLYWEIGHT;
else if( j == 4 )
{
if( !lstrncmpi32A( "bold", lpStr, 4) )
if( !strncasecmp( "bold", lpStr, 4) )
fi->df.dfWeight = FW_BOLD;
else if( !lstrncmpi32A( "demi", lpStr, 4) )
else if( !strncasecmp( "demi", lpStr, 4) )
{
fi->fi_flags |= FI_FW_DEMI;
fi->df.dfWeight = FW_DEMIBOLD;
}
else if( !lstrncmpi32A( "book", lpStr, 4) )
else if( !strncasecmp( "book", lpStr, 4) )
{
fi->fi_flags |= FI_FW_BOOK;
fi->df.dfWeight = FW_REGULAR;
@ -212,14 +212,14 @@ static void LFD_GetWeight( fontInfo* fi, LPSTR lpStr, int j)
}
else if( j == 5 )
{
if( !lstrncmpi32A( "light", lpStr, 5) )
if( !strncasecmp( "light", lpStr, 5) )
fi->df.dfWeight = FW_LIGHT;
else if( !lstrncmpi32A( "black", lpStr, 5) )
else if( !strncasecmp( "black", lpStr, 5) )
fi->df.dfWeight = FW_BLACK;
}
else if( j == 6 && !lstrncmpi32A( "medium", lpStr, 6) )
else if( j == 6 && !strncasecmp( "medium", lpStr, 6) )
fi->df.dfWeight = FW_REGULAR;
else if( j == 8 && !lstrncmpi32A( "demibold", lpStr, 8) )
else if( j == 8 && !strncasecmp( "demibold", lpStr, 8) )
fi->df.dfWeight = FW_DEMIBOLD;
else
fi->df.dfWeight = FW_DONTCARE; /* FIXME: try to get something
@ -274,7 +274,7 @@ static int LFD_InitFontInfo( fontInfo* fi, LPSTR lpstr )
/* width name - */
lpch = LFD_Advance( lpstr = lpch, 1);
if( !*lpch ) return FALSE;
if( lstrncmpi32A( "normal", lpstr, 6) ) /* XXX 'narrow', 'condensed', etc... */
if( strncasecmp( "normal", lpstr, 6) ) /* XXX 'narrow', 'condensed', etc... */
dec_style_check = TRUE;
else
fi->fi_flags |= FI_NORMAL;
@ -751,28 +751,28 @@ static BYTE XFONT_FixupFlags( LPCSTR lfFaceName )
switch( lfFaceName[0] )
{
case 'h':
case 'H': if(!lstrcmpi32A(lfFaceName, "Helvetica") )
case 'H': if(!strcasecmp(lfFaceName, "Helvetica") )
return FF_SWISS;
break;
case 'c':
case 'C': if(!lstrcmpi32A(lfFaceName, "Courier") ||
!lstrcmpi32A(lfFaceName, "Charter") )
case 'C': if(!strcasecmp(lfFaceName, "Courier") ||
!strcasecmp(lfFaceName, "Charter") )
return FF_ROMAN;
break;
case 'p':
case 'P': if( !lstrcmpi32A(lfFaceName,"Palatino") )
case 'P': if( !strcasecmp(lfFaceName,"Palatino") )
return FF_ROMAN;
break;
case 't':
case 'T': if(!lstrncmpi32A(lfFaceName, "Times", 5) )
case 'T': if(!strncasecmp(lfFaceName, "Times", 5) )
return FF_ROMAN;
break;
case 'u':
case 'U': if(!lstrcmpi32A(lfFaceName, "Utopia") )
case 'U': if(!strcasecmp(lfFaceName, "Utopia") )
return FF_ROMAN;
break;
case 'z':
case 'Z': if(!lstrcmpi32A(lfFaceName, "Zapf Dingbats") )
case 'Z': if(!strcasecmp(lfFaceName, "Zapf Dingbats") )
return FF_DECORATIVE;
}
return 0;
@ -786,7 +786,7 @@ static BOOL32 XFONT_CheckResourceName( LPSTR resource, LPCSTR name, INT32 n )
{
resource = LFD_Advance( resource, 2 );
if( resource )
return (!lstrncmpi32A( resource, name, n ));
return (!strncasecmp( resource, name, n ));
return FALSE;
}
@ -857,8 +857,8 @@ static void XFONT_WindowsNames( char* buffer )
while( *buffer && isspace(*buffer) ) buffer++;
for( fr = NULL, pfr = fontList; pfr; pfr = pfr->next )
{
i = lstrlen32A( pfr->resource );
if( !lstrncmpi32A( pfr->resource, buffer, i) )
i = strlen( pfr->resource );
if( !strncasecmp( pfr->resource, buffer, i) )
{
if( fr )
{
@ -884,7 +884,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias )
while( 1 )
{
/* check if we already got one */
if( !lstrcmpi32A( pfa->faTypeFace, lpAlias ) )
if( !strcasecmp( pfa->faTypeFace, lpAlias ) )
{
TRACE(font,"\tredundant alias '%s' -> '%s'\n",
lpAlias, lpTypeFace );
@ -966,14 +966,14 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
{
int length;
length = lstrlen32A( lpAlias );
length = strlen( lpAlias );
if( lpResource && length )
{
fontResource* fr, *frMatch = NULL;
for (fr = fontList; fr ; fr = fr->next)
{
if( !lstrcmpi32A( fr->resource, lpResource ) ) frMatch = fr;
if( !strcasecmp( fr->resource, lpResource ) ) frMatch = fr;
if( XFONT_CheckResourceName( fr->resource, lpAlias, length ) )
{
/* alias is not needed since the real font is present */
@ -990,7 +990,7 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
for(pfa = aliasTable; pfa; pfa = pfa->next)
{
/* Remove lpAlias from aliasTable - we should free the old entry */
if(!lstrcmp32A(lpAlias, pfa->faAlias))
if(!strcmp(lpAlias, pfa->faAlias))
{
if(prev)
prev->next = pfa->next;
@ -999,7 +999,7 @@ static void XFONT_LoadAliases( char** buffer, int buf_size )
}
/* Update any references to the substituted font in aliasTable */
if(!lstrcmp32A(frMatch->lfFaceName,
if(!strcmp(frMatch->lfFaceName,
pfa->faTypeFace))
pfa->faTypeFace = HEAP_strdupA( SystemHeap, 0,
lpAlias );
@ -1037,11 +1037,11 @@ static char* XFONT_UserMetricsCache( char* buffer, int* buf_size )
pwd = getpwuid(getuid());
if( pwd && pwd->pw_dir )
{
int i = lstrlen32A( pwd->pw_dir ) + lstrlen32A( INIWinePrefix ) +
lstrlen32A( INIFontMetrics ) + 2;
int i = strlen( pwd->pw_dir ) + strlen( INIWinePrefix ) +
strlen( INIFontMetrics ) + 2;
if( i > *buf_size )
buffer = (char*) HeapReAlloc( SystemHeap, 0, buffer, *buf_size = i );
lstrcpy32A( buffer, pwd->pw_dir );
strcpy( buffer, pwd->pw_dir );
strcat( buffer, INIWinePrefix );
strcat( buffer, INIFontMetrics );
} else buffer[0] = '\0';
@ -1170,7 +1170,7 @@ static BOOL32 XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count
for( j = i = 0, pfr = fontList; pfr; pfr = pfr->next )
{
i += lstrlen32A( pfr->resource ) + 1;
i += strlen( pfr->resource ) + 1;
j += pfr->count;
}
i += n_ff * sizeof(fontResource) + j * sizeof(fontInfo) + sizeof(int);
@ -1207,7 +1207,7 @@ static BOOL32 XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count
write( fd, &i, sizeof(int) );
for( pfr = fontList; pfr && i == j; pfr = pfr->next )
{
i = lstrlen32A( pfr->resource ) + 1;
i = strlen( pfr->resource ) + 1;
j = write( fd, pfr->resource, i );
}
}
@ -1349,7 +1349,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
printf("%i\t: %s\n", i, x_pattern[i] );
#endif
j = lstrlen32A( x_pattern[i] );
j = strlen( x_pattern[i] );
if( j ) x_checksum ^= __genericCheckSum( x_pattern[i], j );
}
x_checksum |= X_PFONT_MAGIC;
@ -1395,8 +1395,8 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
for( pfr = NULL, fr = fontList; fr; fr = fr->next )
{
if( !lstrncmpi32A(fr->resource, typeface, j) &&
lstrlen32A(fr->resource) == j ) break;
if( !strncasecmp(fr->resource, typeface, j) &&
strlen(fr->resource) == j ) break;
pfr = fr;
}
@ -1433,7 +1433,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
{
/* set scalable font height to 24 to get an origin for extrapolation */
j = lstrlen32A(typeface); j += 0x10;
j = strlen(typeface); j += 0x10;
if( j > buf_size )
buffer = (char*)HeapReAlloc( SystemHeap, 0, buffer, buf_size = j );
@ -1482,7 +1482,7 @@ BOOL32 X11DRV_FONT_Init( DeviceCaps* pDevCaps )
/* check if we're dealing with X11 R6 server */
lstrcpy32A(buffer, "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1");
strcpy(buffer, "-*-*-*-*-normal-*-[12 0 0 12]-*-72-*-*-*-iso8859-1");
if( (x_fs = TSXLoadQueryFont(display, buffer)) )
{
XTextCaps |= TC_SF_X_YINDEP;
@ -1739,7 +1739,7 @@ static fontResource* XFONT_FindFIList( fontResource* pfr, const char* pTypeFace
{
while( pfr )
{
if( !lstrcmpi32A( pfr->lfFaceName, pTypeFace ) ) break;
if( !strcasecmp( pfr->lfFaceName, pTypeFace ) ) break;
pfr = pfr->next;
}
return pfr;
@ -1761,7 +1761,7 @@ static BOOL32 XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm )
LPSTR str = NULL;
for( fa = aliasTable; fa; fa = fa->next )
if( !lstrcmpi32A( fa->faAlias, fm.plf->lfFaceName ) )
if( !strcmp( fa->faAlias, fm.plf->lfFaceName ) )
{
str = fa->faTypeFace;
break;
@ -1834,7 +1834,7 @@ static fontObject* XFONT_LookupCachedFont( LPLOGFONT16 plf, UINT16* checksum )
if( !memcmp( plf, &fontCache[i].lf,
sizeof(LOGFONT16) - LF_FACESIZE ) &&
!lstrncmpi32A( plf->lfFaceName, fontCache[i].lf.lfFaceName,
!strncasecmp( plf->lfFaceName, fontCache[i].lf.lfFaceName,
LF_FACESIZE ) )
{
/* remove temporarily from the lru list */

View File

@ -38,6 +38,7 @@ DLLS = \
win87em.spec \
winaspi.spec \
windebug.spec \
wineps.spec \
wing.spec \
winsock.spec \
wprocs.spec
@ -49,6 +50,7 @@ C_SRCS = \
dummy.c \
relay.c \
signal.c \
snoop.c \
thunk.c
GEN_ASM_SRCS = \

View File

@ -76,6 +76,7 @@ extern const WIN16_DESCRIPTOR WIN32S16_Descriptor;
extern const WIN16_DESCRIPTOR WIN87EM_Descriptor;
extern const WIN16_DESCRIPTOR WINASPI_Descriptor;
extern const WIN16_DESCRIPTOR WINDEBUG_Descriptor;
extern const WIN16_DESCRIPTOR WINEPS_Descriptor;
extern const WIN16_DESCRIPTOR WING_Descriptor;
extern const WIN16_DESCRIPTOR WINSOCK_Descriptor;
extern const WIN16_DESCRIPTOR WPROCS_Descriptor;
@ -117,6 +118,7 @@ static BUILTIN16_DLL BuiltinDLLs[] =
{ &WIN32S16_Descriptor, 0 },
{ &WIN87EM_Descriptor, DLL_FLAG_NOT_USED },
{ &WINASPI_Descriptor, 0 },
{ &WINEPS_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &WING_Descriptor, 0 },
{ &WINSOCK_Descriptor, 0 },
/* Last entry */

View File

@ -64,7 +64,7 @@ file krnl386.exe
64 pascal16 AccessResource(word word) AccessResource16
65 pascal SizeofResource(word word) SizeofResource16
66 pascal16 AllocResource(word word long) AllocResource
67 pascal SetResourceHandler(word segstr segptr) THUNK_SetResourceHandler
67 pascal SetResourceHandler(word segstr segptr) SetResourceHandler
68 pascal16 InitAtomTable(word) InitAtomTable16
69 pascal16 FindAtom(segstr) FindAtom16
70 pascal16 AddAtom(segstr) AddAtom16
@ -133,7 +133,7 @@ file krnl386.exe
130 pascal FileCDR(ptr) FileCDR
131 pascal GetDOSEnvironment() GetDOSEnvironment
132 pascal GetWinFlags() GetWinFlags
133 pascal16 GetExePtr(word) GetExePtr
133 register GetExePtr(word) WIN16_GetExePtr
134 pascal16 GetWindowsDirectory(ptr word) GetWindowsDirectory16
135 pascal16 GetSystemDirectory(ptr word) GetSystemDirectory16
136 pascal16 GetDriveType(word) GetDriveType16
@ -322,7 +322,7 @@ file krnl386.exe
480 stub KERNEL_480
481 stub KERNEL_481
482 pascal LoadLibrary32(str) LoadLibrary32A
485 stub KERNEL_485
485 pascal GetProcessDWORD(long s_word) GetProcessDword
486 stub KERNEL_486
491 stub RegisterServiceProcess
500 stub KERNEL_500

View File

@ -7,7 +7,7 @@ type win16
5 pascal mmsystemGetVersion() mmsystemGetVersion16
6 pascal DriverProc(long word word long long) DriverProc
8 stub WMMMIDIRUNONCE
30 pascal16 OutputDebugStr(ptr) OutputDebugString16
30 pascal16 OutputDebugStr(str) OutputDebugString16
31 pascal DriverCallback(long word word word long long long) DriverCallback
32 stub STACKENTER
33 stub STACKLEAVE

View File

@ -55,6 +55,9 @@ BOOL32 RELAY_Init(void)
}
/* from relay32/relay386.c */
extern debug_relay_includelist;
extern debug_relay_excludelist;
/***********************************************************************
* RELAY_DebugCallFrom16
@ -65,14 +68,18 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
STACK16FRAME *frame;
WORD ordinal;
char *args16;
const char *funstr;
int i;
/* from relay32/relay386.c */
extern int RELAY_ShowDebugmsgRelay(const char *);
if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16;
DPRINTF( "Call %s(", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
&ordinal ));
funstr = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal);
if (!funstr) return; /* happens for the two snoop register relays */
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Call %s(",funstr);
VA_START16( args16 );
if (func_type & 4) /* cdecl */
@ -184,12 +191,16 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT *context)
{
STACK16FRAME *frame;
WORD ordinal;
const char *funstr;
/* from relay32/relay386.c */
extern int RELAY_ShowDebugmsgRelay(const char *);
if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16;
DPRINTF( "Ret %s() ", BUILTIN_GetEntryPoint16( frame->entry_cs,
frame->entry_ip,
&ordinal ));
funstr = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal);
if (!funstr) return;
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Ret %s() ",funstr);
switch(func_type)
{
case 0: /* long */

316
if1632/snoop.c Normal file
View File

@ -0,0 +1,316 @@
/*
* 386-specific Win16 dll<->dll snooping functions
*
* Copyright 1998 Marcus Meissner
*/
#ifdef __i386__
#include <assert.h>
#include "windows.h"
#include "winbase.h"
#include "winnt.h"
#include "heap.h"
#include "global.h"
#include "selectors.h"
#include "stackframe.h"
#include "snoop.h"
#include "debugstr.h"
#include "debug.h"
#pragma pack(1)
void WINAPI SNOOP16_Entry(CONTEXT *context);
void WINAPI SNOOP16_Return(CONTEXT *context);
extern void CallFrom16_p_regs_();
/* Generic callfrom16_p_regs function entry.
* pushw %bp 0x55
* pushl $DOS3Call DWORD fun32
* .byte 0x9a 0x9a
* .long CallFrom16_p_regs_ DWORD addr
* .long 0x90900023 WORD seg;nop;nop
*/
typedef struct tagSNOOP16_FUN {
/* code part */
BYTE lcall; /* 0x9a call absolute with segment */
DWORD snr;
/* unreached */
int nrofargs;
FARPROC16 origfun;
char *name;
} SNOOP16_FUN;
typedef struct tagSNOOP16_DLL {
HMODULE16 hmod;
HANDLE16 funhandle;
SNOOP16_FUN *funs;
LPCSTR name;
struct tagSNOOP16_DLL *next;
} SNOOP16_DLL;
typedef struct tagSNOOP16_RETURNENTRY {
/* code part */
BYTE lcall; /* 0x9a call absolute with segment */
DWORD snr;
/* unreached */
FARPROC16 origreturn;
SNOOP16_DLL *dll;
DWORD ordinal;
WORD origSP;
WORD *args; /* saved args across a stdcall */
} SNOOP16_RETURNENTRY;
typedef struct tagSNOOP16_RETURNENTRIES {
SNOOP16_RETURNENTRY entry[65500/sizeof(SNOOP16_RETURNENTRY)];
HANDLE16 rethandle;
struct tagSNOOP16_RETURNENTRIES *next;
} SNOOP16_RETURNENTRIES;
typedef struct tagSNOOP16_RELAY {
/* code part */
BYTE prefix; /* 0x66 , 32bit prefix */
BYTE pushbp; /* 0x55 */
BYTE pushl; /* 0x68 */
DWORD realfun; /* SNOOP16_Return */
BYTE lcall; /* 0x9a call absolute with segment */
DWORD callfromregs;
WORD seg;
/* unreached */
} SNOOP16_RELAY;
#pragma pack(4)
static SNOOP16_DLL *firstdll = NULL;
static SNOOP16_RETURNENTRIES *firstrets = NULL;
static SNOOP16_RELAY *snr;
static HANDLE16 xsnr = 0;
void
SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
SNOOP16_DLL **dll = &(firstdll);
char *s;
if (!TRACE_ON(snoop)) return;
if (!snr) {
xsnr=GLOBAL_Alloc(GMEM_ZEROINIT,2*sizeof(*snr),0,TRUE,TRUE,FALSE);
snr = GlobalLock16(xsnr);
snr[0].prefix = 0x66;
snr[0].pushbp = 0x55;
snr[0].pushl = 0x68;
snr[0].realfun = (DWORD)SNOOP16_Entry;
snr[0].lcall = 0x9a;
snr[0].callfromregs = (DWORD)CallFrom16_p_regs_;
GET_CS(snr[0].seg);
snr[1].prefix = 0x66;
snr[1].pushbp = 0x55;
snr[1].pushl = 0x68;
snr[1].realfun = (DWORD)SNOOP16_Return;
snr[1].lcall = 0x9a;
snr[1].callfromregs = (DWORD)CallFrom16_p_regs_;
GET_CS(snr[1].seg);
}
while (*dll) {
if ((*dll)->hmod == pModule->self)
return; /* already registered */
dll = &((*dll)->next);
}
*dll = (SNOOP16_DLL*)HeapAlloc(SystemHeap,HEAP_ZERO_MEMORY,sizeof(SNOOP16_DLL));
(*dll)->next = NULL;
(*dll)->hmod = pModule->self;
if ((s=strrchr(name,'\\')))
name = s+1;
(*dll)->name = HEAP_strdupA(SystemHeap,0,name);
if ((s=strrchr((*dll)->name,'.')))
*s='\0';
(*dll)->funhandle = GlobalHandleToSel(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,TRUE,FALSE,FALSE));
(*dll)->funs = GlobalLock16((*dll)->funhandle);
if (!(*dll)->funs) {
HeapFree(SystemHeap,0,*dll);
FIXME(snoop,"out of memory\n");
return;
}
memset((*dll)->funs,0,65535);
}
FARPROC16
SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
SNOOP16_DLL *dll = firstdll;
SNOOP16_FUN *fun;
NE_MODULE *pModule = NE_GetPtr(hmod);
unsigned char *cpnt;
char name[200];
if (!TRACE_ON(snoop) || !pModule || !HIWORD(origfun))
return origfun;
if (!*(LPBYTE)PTR_SEG_TO_LIN(origfun)) /* 0x00 is an imposs. opcode, poss. dataref. */
return origfun;
while (dll) {
if (hmod == dll->hmod)
break;
dll=dll->next;
}
if (!dll) /* probably internal */
return origfun;
if (ordinal>65535/sizeof(SNOOP16_FUN))
return origfun;
fun = dll->funs+ordinal;
/* already done? */
fun->lcall = 0x9a;
fun->snr = MAKELONG(0,xsnr);
fun->origfun = origfun;
if (fun->name)
return (FARPROC16)(SEGPTR)MAKELONG(((char*)fun-(char*)dll->funs),dll->funhandle);
cpnt = (unsigned char *)pModule + pModule->name_table;
while (*cpnt) {
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD*)(cpnt+*cpnt+1) == ordinal) {
sprintf(name,"%.*s",*cpnt,cpnt+1);
break;
}
}
/* Now search the non-resident names table */
if (!*cpnt && pModule->nrname_handle) {
cpnt = (char *)GlobalLock16( pModule->nrname_handle );
while (*cpnt) {
cpnt += *cpnt + 1 + sizeof(WORD);
if (*(WORD*)(cpnt+*cpnt+1) == ordinal) {
sprintf(name,"%.*s",*cpnt,cpnt+1);
break;
}
}
}
if (*cpnt)
fun->name = HEAP_strdupA(SystemHeap,0,name);
else
fun->name = HEAP_strdupA(SystemHeap,0,"");
fun->lcall = 0x9a;
fun->snr = MAKELONG(0,xsnr);
fun->origfun = origfun;
fun->nrofargs = -1;
return (FARPROC16)(SEGPTR)MAKELONG(((char*)fun-(char*)dll->funs),dll->funhandle);
}
#define CALLER1REF (*(DWORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context)+4)))
void WINAPI SNOOP16_Entry(CONTEXT *context) {
DWORD ordinal=0;
DWORD entry=(DWORD)PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5;
WORD xcs = CS_reg(context);
SNOOP16_DLL *dll = firstdll;
SNOOP16_FUN *fun = NULL;
SNOOP16_RETURNENTRIES **rets = &firstrets;
SNOOP16_RETURNENTRY *ret;
int i,max;
while (dll) {
if (xcs == dll->funhandle) {
fun = (SNOOP16_FUN*)entry;
ordinal = fun-dll->funs;
break;
}
dll=dll->next;
}
if (!dll) {
FIXME(snoop,"entrypoint 0x%08lx not found\n",entry);
return; /* oops */
}
/* guess cdecl ... */
if (fun->nrofargs<0) {
/* Typical cdecl return frame is:
* add esp, xxxxxxxx
* which has (for xxxxxxxx up to 255 the opcode "83 C4 xx".
*/
LPBYTE reteip = (LPBYTE)PTR_SEG_TO_LIN(CALLER1REF);
if ((reteip[0]==0x83)&&(reteip[1]==0xc4))
fun->nrofargs=reteip[2]/2;
}
while (*rets) {
for (i=0;i<sizeof((*rets)->entry)/sizeof((*rets)->entry[0]);i++)
if (!(*rets)->entry[i].origreturn)
break;
if (i!=sizeof((*rets)->entry)/sizeof((*rets)->entry[0]))
break;
rets = &((*rets)->next);
}
if (!*rets) {
HANDLE16 hand = GlobalHandleToSel(GLOBAL_Alloc(GMEM_ZEROINIT,65535,0,TRUE,FALSE,FALSE));
*rets = GlobalLock16(hand);
memset(*rets,0,65535);
(*rets)->rethandle = hand;
i = 0; /* entry 0 is free */
}
ret = &((*rets)->entry[i]);
ret->lcall = 0x9a;
ret->snr = MAKELONG(sizeof(SNOOP16_RELAY),xsnr);
ret->origreturn = (FARPROC16)CALLER1REF;
CALLER1REF = MAKELONG((char*)&(ret->lcall)-(char*)((*rets)->entry),(*rets)->rethandle);
ret->dll = dll;
ret->args = NULL;
ret->ordinal = ordinal;
ret->origSP = SP_reg(context);
IP_reg(context)= LOWORD(fun->origfun);
CS_reg(context)= HIWORD(fun->origfun);
DPRINTF("Call %s.%ld: %s(",dll->name,ordinal,fun->name);
if (fun->nrofargs>0) {
max = fun->nrofargs; if (max>16) max=16;
for (i=max;i--;)
DPRINTF("%04x%s",*(WORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context))+8+sizeof(WORD)*i),i?",":"");
if (max!=fun->nrofargs)
DPRINTF(" ...");
} else if (fun->nrofargs<0) {
DPRINTF("<unknown, check return>");
ret->args = HeapAlloc(SystemHeap,0,16*sizeof(WORD));
memcpy(ret->args,(LPBYTE)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context))+8),sizeof(WORD)*16);
}
DPRINTF(") ret=%04x:%04x\n",HIWORD((DWORD)(*rets)->entry[i].origreturn),LOWORD((DWORD)(*rets)->entry[i].origreturn));
}
void WINAPI SNOOP16_Return(CONTEXT *context) {
SNOOP16_RETURNENTRY *ret = (SNOOP16_RETURNENTRY*)(PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5);
/* We haven't found out the nrofargs yet. If we called a cdecl
* function it is too late anyway and we can just set '0' (which
* will be the difference between orig and current SP
* If pascal -> everything ok.
*/
if (ret->dll->funs[ret->ordinal].nrofargs<0)
ret->dll->funs[ret->ordinal].nrofargs=(SP_reg(context)-ret->origSP-4)/2;
IP_reg(context) = LOWORD(ret->origreturn);
CS_reg(context) = HIWORD(ret->origreturn);
if (ret->args) {
int i,max;
DPRINTF("Ret %s.%ld: %s(",ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name);
max = ret->dll->funs[ret->ordinal].nrofargs;
if (max>16) max=16;
for (i=max;i--;)
DPRINTF("%04x%s",ret->args[i],i?",":"");
DPRINTF(") retval = %04x:%04x ret=%04x:%04x\n",
DX_reg(context),AX_reg(context),HIWORD(ret->origreturn),LOWORD(ret->origreturn)
);
HeapFree(SystemHeap,0,ret->args);
ret->args = NULL;
} else
DPRINTF("Ret %s.%ld: %s() retval = %04x:%04x ret=%04x:%04x\n",
ret->dll->name,ret->ordinal,ret->dll->funs[ret->ordinal].name,
DX_reg(context),AX_reg(context),HIWORD(ret->origreturn),LOWORD(ret->origreturn)
);
ret->origreturn = NULL; /* mark as empty */
}
#else /* !__i386__ */
void SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
FIXME(snoop,"snooping works only on i386 for now.\n");
return;
}
FARPROC16 SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) {
return origfun;
}
#endif /* !__i386__ */

View File

@ -152,6 +152,7 @@ static const CALLBACKS_TABLE CALLBACK_EmulatorTable =
(void *)CallTo16_word_ww, /* CallBootAppProc */
(void *)CallTo16_word_www, /* CallLoadAppSegProc */
(void *)CallTo16_word_, /* CallSystemTimerProc */
(void *)CallTo16_word_www, /* CallResourceHandlerProc */
(void *)CallTo16_long_l, /* CallWOWCallbackProc */
THUNK_WOWCallback16Ex, /* CallWOWCallback16Ex */
(void *)CallTo16_long_l, /* CallASPIPostProc */
@ -565,55 +566,6 @@ FARPROC16 WINAPI THUNK_SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
}
/***********************************************************************
* THUNK_SetResourceHandler (KERNEL.67)
*/
FARPROC16 WINAPI THUNK_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC16 proc )
{
static FARPROC16 defDIBIconLoader16 = NULL;
static FARPROC16 defDIBCursorLoader16 = NULL;
static FARPROC16 defResourceLoader16 = NULL;
THUNK *thunk = NULL;
if( !defResourceLoader16 )
{
HMODULE16 hUser = GetModuleHandle16("USER");
defDIBIconLoader16 = NE_GetEntryPoint( hUser, 357 );
defDIBCursorLoader16 = NE_GetEntryPoint( hUser, 356 );
defResourceLoader16 = MODULE_GetWndProcEntry16( "DefResourceHandler" );
}
if( proc == defResourceLoader16 )
thunk = (THUNK*)&NE_DefResourceHandler;
else if( proc == defDIBIconLoader16 )
thunk = (THUNK*)&LoadDIBIconHandler;
else if( proc == defDIBCursorLoader16 )
thunk = (THUNK*)&LoadDIBCursorHandler;
else
{
thunk = THUNK_Alloc( proc, (RELAY)CallTo16_word_www );
if( !thunk ) return FALSE;
}
thunk = (THUNK*)SetResourceHandler( hModule, typeId, (FARPROC16)thunk );
if( thunk == (THUNK*)&NE_DefResourceHandler )
return defResourceLoader16;
if( thunk == (THUNK*)&LoadDIBIconHandler )
return defDIBIconLoader16;
if( thunk == (THUNK*)&LoadDIBCursorHandler )
return defDIBCursorLoader16;
if( thunk )
{
proc = thunk->proc;
THUNK_Free( thunk );
return proc;
}
return NULL;
}
/***********************************************************************
* THUNK_WOWCallback16Ex (WOW32.3)(KERNEL32.55)
* Generic thunking routine to call 16 bit functions from 32bit code.

View File

@ -48,7 +48,7 @@ file user.exe
44 pascal16 OpenIcon(word) OpenIcon16
45 pascal16 BringWindowToTop(word) BringWindowToTop16
46 pascal16 GetParent(word) GetParent16
47 pascal16 IsWindow(word) IsWindow16
47 register IsWindow(word) WIN16_IsWindow16
48 pascal16 IsChild(word word) IsChild16
49 pascal16 IsWindowVisible(word) IsWindowVisible16
50 pascal16 FindWindow(segstr str) FindWindow16

7
if1632/wineps.spec Normal file
View File

@ -0,0 +1,7 @@
name wineps
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

View File

@ -14,6 +14,8 @@ type win16
29 pascal DefResourceHandler(word word word) NE_DefResourceHandler
30 pascal FormatCharDlgProc(word word word long) FormatCharDlgProc16
31 pascal16 ASPI_DOS_func(long) ASPI_DOS_func
32 pascal LoadDIBIconHandler(word word word) LoadDIBIconHandler
33 pascal LoadDIBCursorHandler(word word word) LoadDIBCursorHandler
# Interrupt vectors 0-255 are ordinals 100-355
# The 'word' parameter are the flags pushed on the stack by the interrupt

View File

@ -34,6 +34,8 @@ typedef struct
DIBSECTION *dibSection;
RGBQUAD *colorMap;
int nColorMap;
/* DIBSECTION mapping status */
enum { DIB_NoHandler, DIB_InSync, DIB_AppMod, DIB_GdiMod } status;
} BITMAPOBJ;
@ -51,7 +53,7 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
{ \
int width_bytes = DIB_GetXImageWidthBytes( (width), (bpp) ); \
(image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
(bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
(bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
}

View File

@ -37,6 +37,7 @@ typedef struct
VOID (CALLBACK *CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
WORD (CALLBACK *CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
VOID (CALLBACK *CallSystemTimerProc)( FARPROC16 );
HGLOBAL16 (CALLBACK *CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
DWORD (CALLBACK *CallWOWCallbackProc)( FARPROC16, DWORD );
BOOL32 (CALLBACK *CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID,
LPDWORD );

View File

@ -85,6 +85,12 @@ BOOL32 WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
#define LPSTR_TEXTCALLBACK WINELIB_NAME_AW(LPSTR_TEXTCALLBACK)
/* owner drawn types */
#define ODT_HEADER 100
#define ODT_TAB 101
#define ODT_LISTVIEW 102
/* StatusWindow */
#define STATUSCLASSNAME16 "msctls_statusbar"
@ -523,6 +529,7 @@ typedef struct tagNMHEADERA
#define TBSTATE_ELLIPSES 0x40
#define TBSTATE_MARKED 0x80
#define TBSTYLE_BUTTON 0x00
#define TBSTYLE_SEP 0x01
#define TBSTYLE_CHECK 0x02
@ -602,10 +609,32 @@ typedef struct tagNMHEADERA
#define TB_SETBUTTONWIDTH (WM_USER+59)
#define TB_SETMAXTEXTROWS (WM_USER+60)
#define TB_GETTEXTROWS (WM_USER+61)
#define TB_GETOBJECT (WM_USER+62)
#define TB_SETDRAWTEXTFLAGS (WM_USER+70)
#define TB_GETHOTITEM (WM_USER+71)
#define TB_SETHOTITEM (WM_USER+72)
#define TB_SETANCHORHIGHLIGHT (WM_USER+73)
#define TB_GETANCHORHIGHLIGHT (WM_USER+74)
#define TB_MAPACCELERATOR32A (WM_USER+78)
#define TB_MAPACCELERATOR32W (WM_USER+90)
#define TB_MAPACCELERATOR WINELIB_NAME_AW(TB_MAPACCELERATOR)
#define TB_GETINSERTMARK (WM_USER+79)
#define TB_SETINSERTMARK (WM_USER+80)
#define TB_INSERTMARKHITTEST (WM_USER+81)
#define TB_MOVEBUTTON (WM_USER+82)
#define TB_GETMAXSIZE (WM_USER+83)
#define TB_SETEXTENDEDSTYLE (WM_USER+84)
#define TB_GETEXTENDEDSTYLE (WM_USER+85)
#define TB_GETPADDING (WM_USER+86)
#define TB_SETPADDING (WM_USER+87)
#define TB_SETINSERTMARKCOLOR (WM_USER+88)
#define TB_GETINSERTMARKCOLOR (WM_USER+89)
#define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME
#define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME
#define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
#define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT
/* This is just for old CreateToolbar. */
@ -646,12 +675,33 @@ typedef struct tagTBADDBITMAP {
#define HINST_COMMCTRL ((HINSTANCE32)-1)
HWND32 WINAPI CreateToolbar(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
typedef struct tagTBSAVEPARAMSA {
HKEY hkr;
LPCSTR pszSubKey;
LPCSTR pszValueName;
} TBSAVEPARAMS32A, *LPTBSAVEPARAMS32A;
typedef struct tagTBSAVEPARAMSW {
HKEY hkr;
LPCWSTR pszSubKey;
LPCWSTR pszValueName;
} TBSAVEPARAMSA32W, *LPTBSAVEPARAMSA32W;
#define TBSAVEPARAMS WINELIB_NAMEAW(TBSAVEPARAMS)
#define LPTBSAVEPARAMS WINELIB_NAMEAW(LPTBSAVEPARAMS)
HWND32 WINAPI
CreateToolbar(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
UINT32, LPCOLDTBBUTTON, INT32);
HWND32 WINAPI CreateToolbarEx(HWND32, DWORD, UINT32, INT32, HINSTANCE32,
UINT32, LPCTBBUTTON, INT32, INT32, INT32,
INT32, INT32, UINT32);
HBITMAP32 WINAPI CreateMappedBitmap (HINSTANCE32, INT32, UINT32,
LPCOLORMAP, INT32);
HWND32 WINAPI
CreateToolbarEx(HWND32, DWORD, UINT32, INT32,
HINSTANCE32, UINT32, LPCTBBUTTON,
INT32, INT32, INT32, INT32, INT32, UINT32);
HBITMAP32 WINAPI
CreateMappedBitmap (HINSTANCE32, INT32, UINT32, LPCOLORMAP, INT32);
#endif /* __WINE_COMMCTRL_H */

View File

@ -87,6 +87,9 @@
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
/* Define if you have the vfscanf function. */
#undef HAVE_VFSCANF
/* Define if you have the wait4 function. */
#undef HAVE_WAIT4

View File

@ -34,94 +34,96 @@
#define dbch_dll 26
#define dbch_dosfs 27
#define dbch_dosmem 28
#define dbch_driver 29
#define dbch_dsound 30
#define dbch_edit 31
#define dbch_event 32
#define dbch_exec 33
#define dbch_file 34
#define dbch_fixup 35
#define dbch_font 36
#define dbch_gdi 37
#define dbch_global 38
#define dbch_graphics 39
#define dbch_header 40
#define dbch_heap 41
#define dbch_hook 42
#define dbch_icon 43
#define dbch_imagelist 44
#define dbch_int 45
#define dbch_int21 46
#define dbch_int31 47
#define dbch_key 48
#define dbch_keyboard 49
#define dbch_ldt 50
#define dbch_listbox 51
#define dbch_local 52
#define dbch_mci 53
#define dbch_mcianim 54
#define dbch_mciwave 55
#define dbch_mdi 56
#define dbch_menu 57
#define dbch_message 58
#define dbch_metafile 59
#define dbch_midi 60
#define dbch_mmaux 61
#define dbch_mmio 62
#define dbch_mmsys 63
#define dbch_mmtime 64
#define dbch_module 65
#define dbch_mpr 66
#define dbch_msg 67
#define dbch_nonclient 68
#define dbch_ntdll 69
#define dbch_ole 70
#define dbch_palette 71
#define dbch_print 72
#define dbch_process 73
#define dbch_profile 74
#define dbch_progress 75
#define dbch_prop 76
#define dbch_reg 77
#define dbch_region 78
#define dbch_relay 79
#define dbch_resource 80
#define dbch_scroll 81
#define dbch_security 82
#define dbch_segment 83
#define dbch_selector 84
#define dbch_sem 85
#define dbch_sendmsg 86
#define dbch_shell 87
#define dbch_shm 88
#define dbch_snoop 89
#define dbch_sound 90
#define dbch_static 91
#define dbch_stress 92
#define dbch_string 93
#define dbch_syscolor 94
#define dbch_system 95
#define dbch_task 96
#define dbch_text 97
#define dbch_thread 98
#define dbch_thunk 99
#define dbch_timer 100
#define dbch_toolbar 101
#define dbch_toolhelp 102
#define dbch_tweak 103
#define dbch_uitools 104
#define dbch_updown 105
#define dbch_ver 106
#define dbch_virtual 107
#define dbch_vxd 108
#define dbch_win 109
#define dbch_win16drv 110
#define dbch_win32 111
#define dbch_wing 112
#define dbch_winsock 113
#define dbch_wnet 114
#define dbch_x11 115
#define dbch_x11drv 116
#define dbch_dplay 29
#define dbch_driver 30
#define dbch_dsound 31
#define dbch_edit 32
#define dbch_event 33
#define dbch_exec 34
#define dbch_file 35
#define dbch_fixup 36
#define dbch_font 37
#define dbch_gdi 38
#define dbch_global 39
#define dbch_graphics 40
#define dbch_header 41
#define dbch_heap 42
#define dbch_hook 43
#define dbch_icon 44
#define dbch_imagelist 45
#define dbch_int 46
#define dbch_int21 47
#define dbch_int31 48
#define dbch_key 49
#define dbch_keyboard 50
#define dbch_ldt 51
#define dbch_listbox 52
#define dbch_local 53
#define dbch_mci 54
#define dbch_mcianim 55
#define dbch_mciwave 56
#define dbch_mdi 57
#define dbch_menu 58
#define dbch_message 59
#define dbch_metafile 60
#define dbch_midi 61
#define dbch_mmaux 62
#define dbch_mmio 63
#define dbch_mmsys 64
#define dbch_mmtime 65
#define dbch_module 66
#define dbch_mpr 67
#define dbch_msg 68
#define dbch_nonclient 69
#define dbch_ntdll 70
#define dbch_ole 71
#define dbch_palette 72
#define dbch_print 73
#define dbch_process 74
#define dbch_profile 75
#define dbch_progress 76
#define dbch_prop 77
#define dbch_psdrv 78
#define dbch_reg 79
#define dbch_region 80
#define dbch_relay 81
#define dbch_resource 82
#define dbch_scroll 83
#define dbch_security 84
#define dbch_segment 85
#define dbch_selector 86
#define dbch_sem 87
#define dbch_sendmsg 88
#define dbch_shell 89
#define dbch_shm 90
#define dbch_snoop 91
#define dbch_sound 92
#define dbch_static 93
#define dbch_stress 94
#define dbch_string 95
#define dbch_syscolor 96
#define dbch_system 97
#define dbch_task 98
#define dbch_text 99
#define dbch_thread 100
#define dbch_thunk 101
#define dbch_timer 102
#define dbch_toolbar 103
#define dbch_toolhelp 104
#define dbch_tweak 105
#define dbch_uitools 106
#define dbch_updown 107
#define dbch_ver 108
#define dbch_virtual 109
#define dbch_vxd 110
#define dbch_win 111
#define dbch_win16drv 112
#define dbch_win32 113
#define dbch_wing 114
#define dbch_winsock 115
#define dbch_wnet 116
#define dbch_x11 117
#define dbch_x11drv 118
/* 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 117
#define DEBUG_CHANNEL_COUNT 119
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
@ -124,6 +124,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[] = {
"accel",
@ -155,6 +157,7 @@ const char* debug_ch_name[] = {
"dll",
"dosfs",
"dosmem",
"dplay",
"driver",
"dsound",
"edit",
@ -203,6 +206,7 @@ const char* debug_ch_name[] = {
"profile",
"progress",
"prop",
"psdrv",
"reg",
"region",
"relay",

338
include/dplay.h Normal file
View File

@ -0,0 +1,338 @@
/* Header for Direct Play and Direct Play Lobby */
#ifndef __WINE_DPLAY_H
#define __WINE_DPLAY_H
#include "mmsystem.h"
/* Return Values */
#define _FACDP 0x877
#define MAKE_DPHRESULT( code ) MAKE_HRESULT( 1, _FACDP, code )
#define DP_OK S_OK
#define DPERR_ALREADYINITIALIZED MAKE_DPHRESULT( 5 )
#define DPERR_ACCESSDENIED MAKE_DPHRESULT( 10 )
#define DPERR_ACTIVEPLAYERS MAKE_DPHRESULT( 20 )
#define DPERR_BUFFERTOOSMALL MAKE_DPHRESULT( 30 )
#define DPERR_CANTADDPLAYER MAKE_DPHRESULT( 40 )
#define DPERR_CANTCREATEGROUP MAKE_DPHRESULT( 50 )
#define DPERR_CANTCREATEPLAYER MAKE_DPHRESULT( 60 )
#define DPERR_CANTCREATESESSION MAKE_DPHRESULT( 70 )
#define DPERR_CAPSNOTAVAILABLEYET MAKE_DPHRESULT( 80 )
#define DPERR_EXCEPTION MAKE_DPHRESULT( 90 )
#define DPERR_GENERIC E_FAIL
#define DPERR_INVALIDFLAGS MAKE_DPHRESULT( 120 )
#define DPERR_INVALIDOBJECT MAKE_DPHRESULT( 130 )
#define DPERR_INVALIDPARAM E_INVALIDARG
#define DPERR_INVALIDPARAMS DPERR_INVALIDPARAM
#define DPERR_INVALIDPLAYER MAKE_DPHRESULT( 150 )
#define DPERR_INVALIDGROUP MAKE_DPHRESULT( 155 )
#define DPERR_NOCAPS MAKE_DPHRESULT( 160 )
#define DPERR_NOCONNECTION MAKE_DPHRESULT( 170 )
#define DPERR_NOMEMORY E_OUTOFMEMORY
#define DPERR_OUTOFMEMORY DPERR_NOMEMORY
#define DPERR_NOMESSAGES MAKE_DPHRESULT( 190 )
#define DPERR_NONAMESERVERFOUND MAKE_DPHRESULT( 200 )
#define DPERR_NOPLAYERS MAKE_DPHRESULT( 210 )
#define DPERR_NOSESSIONS MAKE_DPHRESULT( 220 )
#define DPERR_PENDING E_PENDING
#define DPERR_SENDTOOBIG MAKE_DPHRESULT( 230 )
#define DPERR_TIMEOUT MAKE_DPHRESULT( 240 )
#define DPERR_UNAVAILABLE MAKE_DPHRESULT( 250 )
#define DPERR_UNSUPPORTED E_NOTIMPL
#define DPERR_BUSY MAKE_DPHRESULT( 270 )
#define DPERR_USERCANCEL MAKE_DPHRESULT( 280 )
#define DPERR_NOINTERFACE E_NOINTERFACE
#define DPERR_CANNOTCREATESERVER MAKE_DPHRESULT( 290 )
#define DPERR_PLAYERLOST MAKE_DPHRESULT( 300 )
#define DPERR_SESSIONLOST MAKE_DPHRESULT( 310 )
#define DPERR_UNINITIALIZED MAKE_DPHRESULT( 320 )
#define DPERR_NONEWPLAYERS MAKE_DPHRESULT( 330 )
#define DPERR_INVALIDPASSWORD MAKE_DPHRESULT( 340 )
#define DPERR_CONNECTING MAKE_DPHRESULT( 350 )
#define DPERR_BUFFERTOOLARGE MAKE_DPHRESULT( 1000 )
#define DPERR_CANTCREATEPROCESS MAKE_DPHRESULT( 1010 )
#define DPERR_APPNOTSTARTED MAKE_DPHRESULT( 1020 )
#define DPERR_INVALIDINTERFACE MAKE_DPHRESULT( 1030 )
#define DPERR_NOSERVICEPROVIDER MAKE_DPHRESULT( 1040 )
#define DPERR_UNKNOWNAPPLICATION MAKE_DPHRESULT( 1050 )
#define DPERR_NOTLOBBIED MAKE_DPHRESULT( 1070 )
#define DPERR_SERVICEPROVIDERLOADED MAKE_DPHRESULT( 1080 )
#define DPERR_ALREADYREGISTERED MAKE_DPHRESULT( 1090 )
#define DPERR_NOTREGISTERED MAKE_DPHRESULT( 1100 )
#define DPERR_AUTHENTICATIONFAILED MAKE_DPHRESULT( 2000 )
#define DPERR_CANTLOADSSPI MAKE_DPHRESULT( 2010 )
#define DPERR_ENCRYPTIONFAILED MAKE_DPHRESULT( 2020 )
#define DPERR_SIGNFAILED MAKE_DPHRESULT( 2030 )
#define DPERR_CANTLOADSECURITYPACKAGE MAKE_DPHRESULT( 2040 )
#define DPERR_ENCRYPTIONNOTSUPPORTED MAKE_DPHRESULT( 2050 )
#define DPERR_CANTLOADCAPI MAKE_DPHRESULT( 2060 )
#define DPERR_NOTLOGGEDIN MAKE_DPHRESULT( 2070 )
#define DPERR_LOGONDENIED MAKE_DPHRESULT( 2080 )
DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB}
DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
/* {AF465C71-9588-11cf-A020-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {26C66A70-B367-11cf-A024-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {0194C220-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/*
* GUIDS used by Service Providers shipped with DirectPlay
* Use these to identify Service Provider returned by EnumConnections
*/
/* GUID for IPX service provider {685BC400-9D2C-11cf-A9CD-00AA006886E3} */
DEFINE_GUID(DPSPGUID_IPX, 0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3);
/* GUID for TCP/IP service provider 36E95EE0-8577-11cf-960C-0080C7534E82 */
DEFINE_GUID(DPSPGUID_TCPIP, 0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82);
/* GUID for Serial service provider {0F1D6860-88D9-11cf-9C4E-00A0C905425E} */
DEFINE_GUID(DPSPGUID_SERIAL, 0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* GUID for Modem service provider {44EAA760-CB68-11cf-9C4E-00A0C905425E} */
DEFINE_GUID(DPSPGUID_MODEM, 0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
#pragma pack(1)
/* Direct Play */
typedef struct IDirectPlay IDirectPlay, *LPDIRECTPLAY;
/* Direct Play 2 */
typedef struct IDirectPlay2 IDirectPlay2, *LPDIRECTPLAY2;
typedef struct IDirectPlay2 IDirectPlay2A, *LPDIRECTPLAY2A;
/* Direct Play 3 */
typedef struct IDirectPlay3 IDirectPlay3, *LPDIRECTPLAY3;
typedef struct IDirectPlay3 IDirectPlay3A, *LPDIRECTPLAY3A;
/* DPID - DirectPlay player and group ID */
typedef DWORD DPID, *LPDPID;
/* DPID from whence originate messages - just an ID */
#define DPID_SYSMSG 0 /* DPID of system */
#define DPID_ALLPLAYERS 0 /* DPID of all players */
#define DPID_SERVERPLAYER 1 /* DPID of the server player */
#define DPID_UNKNOWN 0xFFFFFFFF /* Player ID is unknown */
/* DPCAPS - Used to obtain the capabilities of a DirectPlay object */
typedef struct tagDPCAPS
{
DWORD dwSize; /* Size of structure in bytes */
DWORD dwFlags;
DWORD dwMaxBufferSize;
DWORD dwMaxQueueSize; /* Obsolete. */
DWORD dwMaxPlayers; /* Maximum players/groups (local + remote) */
DWORD dwHundredBaud; /* Bandwidth in 100 bits per second units;
* i.e. 24 is 2400, 96 is 9600, etc.
*/
DWORD dwLatency; /* Estimated latency; 0 = unknown */
DWORD dwMaxLocalPlayers; /* Maximum # of locally created players */
DWORD dwHeaderLength; /* Maximum header length in bytes */
DWORD dwTimeout; /* Service provider's suggested timeout value
* This is how long DirectPlay will wait for
* responses to system messages
*/
} DPCAPS, *LPDPCAPS;
typedef struct tagDPNAME
{
DWORD dwSize;
DWORD dwFlags; /* Not used must be 0 */
union playerShortName /* Player's Handle? */
{
LPWSTR lpszShortName;
LPSTR lpszShortNameA;
};
union playerLongName /* Player's formal/real name */
{
LPWSTR lpszLongName;
LPSTR lpszLongNameA;
};
} DPNAME, *LPDPNAME;
typedef struct tagDPSESSIONDESC2
{
DWORD dwSize;
DWORD dwFlags;
GUID guidInstance;
GUID guidApplication;
DWORD dwMaxPlayers;
DWORD dwCurrentPlayers;
union sessionName
{
LPWSTR lpszSessionName;
LPSTR lpszSessionNameA;
};
union optnlSessionPasswd
{
LPWSTR lpszPassword;
LPSTR lpszPasswordA;
};
DWORD dwReserved1;
DWORD dwReserved2;
DWORD dwUser1;
DWORD dwUser2;
DWORD dwUser3;
DWORD dwUser4;
} DPSESSIONDESC2, *LPDPSESSIONDESC2;
typedef struct tagDPLCONNECTION
{
DWORD dwSize;
DWORD dwFlags;
LPDPSESSIONDESC2 lpSessionDesc;
LPDPNAME lpPlayerName;
GUID guidSP;
LPVOID lpAddress;
DWORD dwAddressSize;
} DPLCONNECTION, *LPDPLCONNECTION;
typedef struct tagDPLAPPINFO
{
DWORD dwSize;
GUID guidApplication;
union appName
{
LPSTR lpszAppNameA;
LPWSTR lpszAppName;
};
} DPLAPPINFO, *LPDPLAPPINFO;
typedef const DPLAPPINFO *LPCDPLAPPINFO;
typedef struct DPCOMPOUNDADDRESSELEMENT
{
GUID guidDataType;
DWORD dwDataSize;
LPVOID lpData;
} DPCOMPOUNDADDRESSELEMENT, *LPDPCOMPOUNDADDRESSELEMENT;
typedef const DPCOMPOUNDADDRESSELEMENT *LPCDPCOMPOUNDADDRESSELEMENT;
typedef BOOL32 (CALLBACK* LPDPENUMDPCALLBACKW)(
LPGUID lpguidSP,
LPWSTR lpSPName,
DWORD dwMajorVersion,
DWORD dwMinorVersion,
LPVOID lpContext);
typedef BOOL32 (CALLBACK* LPDPENUMDPCALLBACKA)(
LPGUID lpguidSP,
LPSTR lpSPName, /* ptr to str w/ driver description */
DWORD dwMajorVersion, /* Major # of driver spec in lpguidSP */
DWORD dwMinorVersion, /* Minor # of driver spec in lpguidSP */
LPVOID lpContext); /* User given */
typedef const GUID *LPCGUID;
typedef const DPNAME *LPCDPNAME;
typedef BOOL32 (CALLBACK* LPDPENUMCONNECTIONSCALLBACK)(
LPCGUID lpguidSP,
LPVOID lpConnection,
DWORD dwConnectionSize,
LPCDPNAME lpName,
DWORD dwFlags,
LPVOID lpContext);
extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID );
extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW, LPVOID );
extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk);
/* Direct Play Lobby 1 */
typedef struct IDirectPlayLobby IDirectPlayLobby, *LPDIRECTPLAYLOBBY;
typedef struct IDirectPlayLobby IDirectPlayLobbyA, *LPDIRECTPLAYLOBBYA;
/* Direct Play Lobby 2 */
typedef struct IDirectPlayLobby2 IDirectPlayLobby2, *LPDIRECTPLAYLOBBY2;
typedef struct IDirectPlayLobby2 IDirectPlayLobby2A, *LPDIRECTPLAYLOBBY2A;
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY2 *, IUnknown *, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBY2A *, IUnknown *, LPVOID, DWORD );
typedef BOOL32 (CALLBACK* LPDPENUMADDRESSCALLBACK)(
REFGUID guidDataType,
DWORD dwDataSize,
LPCVOID lpData,
LPVOID lpContext);
typedef BOOL32 (CALLBACK* LPDPLENUMADDRESSTYPESCALLBACK)(
REFGUID guidDataType,
LPVOID lpContext,
DWORD dwFlags);
typedef BOOL32 (CALLBACK* LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
LPCDPLAPPINFO lpAppInfo,
LPVOID lpContext,
DWORD dwFlags);
#define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
#define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)
#define PURE
#define FAR
#define THIS_ THIS,
#define THIS LPDIRECTPLAYLOBBY2 this
typedef struct tagLPDIRECTPLAYLOBBY2_VTABLE {
/* IUnknown Methods "Inherited Methods" */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectPlayLobby Methods */
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown *) PURE;
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE32) PURE;
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE32) PURE;
/* IDirectPlayLobby2 Methods */
STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT, DWORD, LPVOID, LPDWORD) PURE;
} DIRECTPLAYLOBBY2_VTABLE, *LPDIRECTPLAYLOBBY2_VTABLE;
/* Is this right? How does one know? */
struct IDirectPlayLobby2 {
LPDIRECTPLAYLOBBY2_VTABLE lpvtbl;
DWORD ref;
};
#pragma pack(4)
#undef STDMETHOD
#undef STDMETHOD_
#undef PURE
#undef FAR
#undef THIS_
#endif

View File

@ -251,29 +251,4 @@ struct IDirectSoundNotify {
#undef PURE
#undef FAR
#undef THIS_
/* DirectPlayLobby stuff */
/* {AF465C71-9588-11cf-A020-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {26C66A70-B367-11cf-A024-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {0194C220-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
typedef struct IDirectPlayLobby *LPDIRECTPLAYLOBBY;
typedef struct IDirectPlayLobby *LPDIRECTPLAYLOBBYA;
typedef struct IDirectPlayLobby IDirectPlayLobbyA;
typedef struct IDirectPlayLobby2 *LPDIRECTPLAYLOBBY2;
typedef struct IDirectPlayLobby2 *LPDIRECTPLAYLOBBY2A;
typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
#endif

View File

@ -33,4 +33,8 @@ extern BOOL32 VIRTUAL_Init( void );
extern DWORD VIRTUAL_GetPageSize(void);
extern DWORD VIRTUAL_GetGranularity(void);
typedef BOOL32 (*HANDLERPROC)(LPVOID, LPVOID);
extern BOOL32 VIRTUAL_SetFaultHandler(LPVOID addr, HANDLERPROC proc, LPVOID arg);
extern BOOL32 VIRTUAL_HandleFault(LPVOID addr);
#endif /* __WINE_GLOBAL_H */

View File

@ -47,6 +47,6 @@ typedef struct
} HEADER_INFO;
void HEADER_Register( void );
extern void HEADER_Register (void);
#endif /* __WINE_HEADER_H_ */

View File

@ -142,8 +142,6 @@ extern HINSTANCE16 MODULE_Load( LPCSTR name, BOOL32 implicit, LPCSTR cmd_line,
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name );
typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16,HMODULE16,HRSRC16);
/* loader/ne/module.c */
extern NE_MODULE *NE_GetPtr( HMODULE16 hModule );
extern void NE_DumpModule( HMODULE16 hModule );

View File

@ -18,7 +18,7 @@ extern LONG NC_HandleNCLButtonDblClk( WND *pWnd, WPARAM16 wParam, LPARAM lParam)
extern LONG NC_HandleSysCommand( HWND32 hwnd, WPARAM16 wParam, POINT16 pt );
extern LONG NC_HandleSetCursor( HWND32 hwnd, WPARAM16 wParam, LPARAM lParam );
extern void NC_DrawSysButton( HWND32 hwnd, HDC32 hdc, BOOL32 down );
extern void NC_DrawSysButton95( HWND32 hwnd, HDC32 hdc, BOOL32 down );
extern BOOL32 NC_DrawSysButton95( HWND32 hwnd, HDC32 hdc, BOOL32 down );
extern BOOL32 NC_GetSysPopupPos( WND* wndPtr, RECT32* rect );
#endif /* __WINE_NONCLIENT_H */

View File

@ -11,4 +11,8 @@ VOID SysFreeString16(BSTR16);
VOID SysFreeString32(BSTR32);
#define SysFreeString WINELIB_NAME(SysFreeString)
typedef char OLECHAR;
typedef void ITypeLib;
typedef ITypeLib * LPTYPELIB;
#endif

15
include/print.h Normal file
View File

@ -0,0 +1,15 @@
#include "windows.h"
HANDLE16 WINAPI OpenJob(LPSTR lpOutput, LPSTR lpTitle, HDC16 hDC);
int WINAPI CloseJob(HANDLE16 hJob);
int WINAPI WriteSpool(HANDLE16 hJob, LPSTR lpData, WORD cch);
int WINAPI DeleteJob(HANDLE16 hJob, WORD wNotUsed);
int WINAPI StartSpoolPage(HANDLE16 hJob);
int WINAPI EndSpoolPage(HANDLE16 hJob);
DWORD WINAPI GetSpoolJob(int nOption, LONG param);
int WINAPI WriteDialog(HANDLE16 hJob, LPSTR lpMsg, WORD cchMsg);

123
include/psdrv.h Normal file
View File

@ -0,0 +1,123 @@
/*
* Postscript driver definitions
*
* Copyright 1998 Huw D M Davies
*/
#include "windows.h"
#include "font.h"
typedef struct {
float llx, lly, urx, ury;
} AFMBBOX;
typedef struct _tagAFMLIGS {
char *successor;
char *ligature;
struct _tagAFMLIGS *next;
} AFMLIGS;
typedef struct _tagAFMMETRICS {
int C; /* character */
float WX;
char *N; /* name */
AFMBBOX B;
AFMLIGS *L; /* Ligatures */
struct _tagAFMMETRICS *next;
} AFMMETRICS;
typedef struct _tagAFM {
char *FontName;
char *FullName;
char *FamilyName;
int Weight; /* FW_NORMAL etc. */
float ItalicAngle;
BOOL32 IsFixedPitch;
float UnderlinePosition;
float UnderlineThickness;
AFMBBOX FontBBox;
float CapHeight;
float XHeight;
float Ascender;
float Descender;
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;
extern FontFamily *PSDRV_AFMFontList;
typedef struct {
AFM *afm;
TEXTMETRIC32A tm;
INT32 size;
float scale;
INT32 escapement;
BOOL32 set; /* Have we done a setfont yet */
} PSFONT;
typedef struct {
HANDLE16 hJob;
LPSTR output; /* Output file/port */
BOOL32 banding; /* Have we received a NEXTBAND */
BOOL32 NeedPageHeader; /* Page header not sent yet */
INT32 PageNo;
} JOB;
typedef struct
{
PSFONT font; /* Current PS font */
JOB job;
} PSDRV_PDEVICE;
extern BOOL32 PSDRV_GetFontMetrics(void);
extern BOOL32 PSDRV_Init(void);
extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font);
extern BOOL32 PSDRV_SetFont( DC *dc );
extern INT32 PSDRV_WriteHeader( DC *dc, char *title, int len );
extern INT32 PSDRV_WriteFooter( DC *dc );
extern INT32 PSDRV_WriteNewPage( DC *dc );
extern INT32 PSDRV_WriteEndPage( DC *dc );
extern BOOL32 PSDRV_WriteMoveTo(DC *dc, INT32 x, INT32 y);
extern BOOL32 PSDRV_WriteLineTo(DC *dc, INT32 x, INT32 y);
extern BOOL32 PSDRV_WriteStroke(DC *dc);
extern BOOL32 PSDRV_WriteRectangle(DC *dc, INT32 x, INT32 y, INT32 width,
INT32 height);
extern BOOL32 PSDRV_WriteSetFont(DC *dc);
extern BOOL32 PSDRV_WriteShow(DC *dc, char *str, INT32 count);
extern BOOL32 PSDRV_WriteReencodeFont(DC *dc);
extern BOOL32 PSDRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp );
extern INT32 PSDRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
SEGPTR lpInData, SEGPTR lpOutData );
extern BOOL32 PSDRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
const RECT32 *lprect, LPCSTR str, UINT32 count,
const INT32 *lpDx );
extern BOOL32 PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT32 count,
LPSIZE32 size );
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 HGDIOBJ32 PSDRV_SelectObject( DC *dc, HGDIOBJ32 handle );
extern BOOL32 PSDRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right,
INT32 bottom);
extern BOOL32 PSDRV_Ellipse(DC *dc, INT32 left, INT32 top, INT32 right,
INT32 bottom);

View File

@ -247,6 +247,84 @@ extern LPENUMIDLIST IEnumIDList_Constructor();
DWORD WINAPI SHELL32_DllGetClassObject(LPCLSID,REFIID,LPVOID*);
/****************************************************************************
* SHBrowseForFolder API
*/
typedef int (CALLBACK* BFFCALLBACK)(HWND32 hwnd, UINT32 uMsg, LPARAM lParam, LPARAM lpData);
typedef struct tagBROWSEINFO32A {
HWND32 hwndOwner;
LPCITEMIDLIST pidlRoot;
LPSTR pszDisplayName;
LPCSTR lpszTitle;
UINT32 ulFlags;
BFFCALLBACK lpfn;
LPARAM lParam;
int iImage;
} BROWSEINFO32A, *PBROWSEINFO32A, *LPBROWSEINFO32A;
typedef struct tagBROWSEINFO32W {
HWND32 hwndOwner;
LPCITEMIDLIST pidlRoot;
LPWSTR pszDisplayName;
LPCWSTR lpszTitle;
UINT32 ulFlags;
BFFCALLBACK lpfn;
LPARAM lParam;
int iImage;
} BROWSEINFO32W, *PBROWSEINFO32W, *LPBROWSEINFO32W;
#define BROWSEINFO WINELIB_NAME_AW(BROWSEINFO)
#define PBROWSEINFO WINELIB_NAME_AW(PBROWSEINFO)
#define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
// Browsing for directory.
#define BIF_RETURNONLYFSDIRS 0x0001
#define BIF_DONTGOBELOWDOMAIN 0x0002
#define BIF_STATUSTEXT 0x0004
#define BIF_RETURNFSANCESTORS 0x0008
#define BIF_EDITBOX 0x0010
#define BIF_VALIDATE 0x0020
#define BIF_BROWSEFORCOMPUTER 0x1000
#define BIF_BROWSEFORPRINTER 0x2000
#define BIF_BROWSEINCLUDEFILES 0x4000
// message from browser
#define BFFM_INITIALIZED 1
#define BFFM_SELCHANGED 2
#define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog)
#define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog)
// messages to browser
#define BFFM_SETSTATUSTEXTA (WM_USER+100)
#define BFFM_ENABLEOK (WM_USER+101)
#define BFFM_SETSELECTIONA (WM_USER+102)
#define BFFM_SETSELECTIONW (WM_USER+103)
#define BFFM_SETSTATUSTEXTW (WM_USER+104)
LPITEMIDLIST WINAPI SHBrowseForFolder32A(LPBROWSEINFO32A lpbi);
/*
LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);
#ifdef UNICODE
#define SHBrowseForFolder SHBrowseForFolderW
#define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
#define BFFM_SETSELECTION BFFM_SETSELECTIONW
#define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
#else
#define SHBrowseForFolder SHBrowseForFolderA
#define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
#define BFFM_SETSELECTION BFFM_SETSELECTIONA
#define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
#endif
*/
#undef PURE
#undef FAR
#undef THIS

View File

@ -217,8 +217,11 @@ typedef struct _CONTEXT /* Note 1 */
#define FL_sig(context) (*(WORD*)&EFL_sig(context))
#ifdef FS_sig
#define HANDLER_INIT() SET_FS(FS_sig(HANDLER_CONTEXT))
#else FS_sig
extern WORD CALLTO16_Current_fs;
#define HANDLER_INIT() \
SET_FS(IS_SELECTOR_SYSTEM(CS_sig(HANDLER_CONTEXT)) ? \
FS_sig(HANDLER_CONTEXT) : CALLTO16_Current_fs)
#else
#define HANDLER_INIT() /* nothing */
#endif

View File

@ -1,8 +1,13 @@
/*
* Definitions for inter-win32-dll snooping
* Definitions for inter-dll snooping
*/
#ifndef __WINE_SNOOP_H
#define __WINE_SNOOP_H
extern void SNOOP_RegisterDLL(HMODULE32 hmod,LPCSTR name,DWORD nrofordinals);
extern FARPROC32 SNOOP_GetProcAddress32(HMODULE32 hmod,LPCSTR name,DWORD ordinal,FARPROC32 origfun);
#include "module.h"
extern void SNOOP_RegisterDLL(HMODULE32,LPCSTR,DWORD);
extern FARPROC32 SNOOP_GetProcAddress32(HMODULE32,LPCSTR,DWORD,FARPROC32);
extern void SNOOP16_RegisterDLL(NE_MODULE*,LPCSTR);
extern FARPROC16 SNOOP16_GetProcAddress16(HMODULE16,DWORD,FARPROC16);
#endif

View File

@ -70,7 +70,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 pad2; /* 8e */
WORD saved_fs; /* 8e Saved 16-bit FS (was: pad2) */
void *ss_table; /* 90 Pointer to info about 16-bit stack */
WORD thunk_ss; /* 94 Yet another 16-bit stack selector */
WORD pad3; /* 96 */

View File

@ -27,7 +27,6 @@ typedef struct tagTOOLBAR_INFO
DWORD dwStructSize; /* size of TBBUTTON struct */
INT32 nHeight; /* height of the toolbar */
INT32 nWidth; /* width of the toolbar */
INT32 nButtonTop; /* top of the button rectangle */
INT32 nButtonHeight;
INT32 nButtonWidth;
INT32 nBitmapHeight;
@ -42,12 +41,14 @@ typedef struct tagTOOLBAR_INFO
BOOL32 bCaptured;
INT32 nButtonDown;
INT32 nOldHit;
INT32 nHotItem; /* index of the "hot" item */
HIMAGELIST himlDef; /* default image list */
HIMAGELIST himlHot; /* hot image list */
HIMAGELIST himlDis; /* disabled image list */
HWND32 hwndToolTip; /* handle to tool tip control */
HWND32 hwndNotify; /* handle to the window that gets notifications */
BOOL32 bTransparent; /* background transparency flag */
TBUTTON_INFO *buttons;
CHAR **strings;

View File

@ -1 +1 @@
#define WINE_RELEASE_INFO "Wine release 980614"
#define WINE_RELEASE_INFO "Wine release 980628"

View File

@ -465,6 +465,9 @@ DECL_WINELIB_TYPE(LPNCCALCSIZE_PARAMS)
#define HTGROWBOX HTSIZE
#define HTREDUCE HTMINBUTTON
#define HTZOOM HTMAXBUTTON
#define HTOBJECT 19
#define HTCLOSE 20
#define HTHELP 21
/* WM_SYSCOMMAND parameters */
#ifdef SC_SIZE /* at least HP-UX: already defined in /usr/include/sys/signal.h */
@ -5442,6 +5445,54 @@ typedef struct
DECL_WINELIB_TYPE_AW(DEVMODE)
DECL_WINELIB_TYPE_AW(LPDEVMODE)
#define DM_UPDATE 1
#define DM_COPY 2
#define DM_PROMPT 4
#define DM_MODIFY 8
#define DM_ORIENTATION 0x00000001L
#define DM_PAPERSIZE 0x00000002L
#define DM_PAPERLENGTH 0x00000004L
#define DM_PAPERWIDTH 0x00000008L
#define DM_SCALE 0x00000010L
#define DM_COPIES 0x00000100L
#define DM_DEFAULTSOURCE 0x00000200L
#define DM_PRINTQUALITY 0x00000400L
#define DM_COLOR 0x00000800L
#define DM_DUPLEX 0x00001000L
/* etc.... */
#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 DMBIN_UPPER 1
#define DMBIN_AUTO 7
#define DC_FIELDS 1
#define DC_PAPERS 2
#define DC_PAPERSIZE 3
#define DC_MINEXTENT 4
#define DC_MAXEXTENT 5
#define DC_BINS 6
#define DC_DUPLEX 7
#define DC_SIZE 8
#define DC_EXTRA 9
#define DC_VERSION 10
#define DC_DRIVER 11
#define DC_BINNAMES 12
#define DC_ENUMRESOLUTIONS 13
#define DC_FILEDEPENDENCIES 14
#define DC_TRUETYPE 15
#define DC_PAPERNAMES 16
#define DC_ORIENTATION 17
#define DC_COPIES 18
typedef struct _PRINTER_DEFAULTS32A {
LPSTR pDatatype;
LPDEVMODE32A pDevMode;
@ -6326,6 +6377,7 @@ HRSRC32 WINAPI FindResourceEx32W(HMODULE32,LPCWSTR,LPCWSTR,WORD);
#define FindResourceEx WINELIB_NAME_AW(FindResourceEx)
BOOL32 WINAPI FlushConsoleInputBuffer(HANDLE32);
BOOL32 WINAPI FlushFileBuffers(HFILE32);
BOOL32 WINAPI FlushViewOfFile(LPCVOID, DWORD);
DWORD WINAPI FormatMessage32A(DWORD,LPCVOID,DWORD,DWORD,LPSTR,
DWORD,LPDWORD);
#define FormatMessage WINELIB_NAME_AW(FormatMessage)

View File

@ -70,17 +70,47 @@ extern int WIN32_LastError;
#define ERROR_INVALID_PRINTER_NAME 1801
/* HRESULT values for OLE, SHELL and other Interface stuff */
/* the codes 4000-40ff are reserved for OLE */
#define NOERROR 0
#define S_OK 0
#define E_FAIL 0x80000008
#define E_UNEXPECTED 0x8000FFFF
#define E_NOTIMPL 0x80004001
#define E_NOINTERFACE 0x80004002
#define E_POINTER 0x80004003
#define E_ABORT 0x80004004
#define E_FAIL 0x80004005
/*#define CO_E_INIT_TLS 0x80004006
#define CO_E_INIT_SHARED_ALLOCATOR 0x80004007
#define CO_E_INIT_MEMORY_ALLOCATOR 0x80004008
#define CO_E_INIT_CLASS_CACHE 0x80004009
#define CO_E_INIT_RPC_CHANNEL 0x8000400A
#define CO_E_INIT_TLS_SET_CHANNEL_CONTROL 0x8000400B
#define CO_E_INIT_TLS_CHANNEL_CONTROL 0x8000400C
#define CO_E_INIT_UNACCEPTED_USER_ALLOCATOR 0x8000400D
#define CO_E_INIT_SCM_MUTEX_EXISTS 0x8000400E
#define CO_E_INIT_SCM_FILE_MAPPING_EXISTS 0x8000400F
#define CO_E_INIT_SCM_MAP_VIEW_OF_FILE 0x80004010
#define CO_E_INIT_SCM_EXEC_FAILURE 0x80004011
#define CO_E_INIT_ONLY_SINGLE_THREADED 0x80004012 */
#define OLE_E_ENUM_NOMORE 0x80040002
#define CLASS_E_CLASSNOTAVAILABLE 0x80040111
#define E_ACCESSDENIED 0x80070005
#define E_HANDLE 0x80070006
#define E_OUTOFMEMORY 0x8007000E
#define E_INVALIDARG 0x80070057
//#define OLE_E_FIRST 0x80040000L
//#define OLE_E_LAST 0x800400FFL
//#define OLE_S_FIRST 0x00040000L
//#define OLE_S_LAST 0x000400FFL
#define STG_E_INVALIDFUNCTION 0x80030001
#define STG_E_FILENOTFOUND 0x80030002
#define STG_E_PATHNOTFOUND 0x80030003
@ -115,4 +145,15 @@ extern int WIN32_LastError;
#define STG_E_NOTFILEBASEDSTORAGE 0x80030107
#define STG_E_EXTANTMARSHALLINGS 0x80030108
/* alten versionen
#define E_NOTIMPL 0x80000001
#define E_OUTOFMEMORY 0x80000002
#define E_INVALIDARG 0x80000003
#define E_NOINTERFACE 0x80000004
#define E_POINTER 0x80000005
#define E_HANDLE 0x80000006
#define E_ABORT 0x80000007
#define E_FAIL 0x80000008
#define E_ACCESSDENIED 0x80000009 */
#endif /* __WINE_WINERROR_H */

254
include/winioctl.h Normal file
View File

@ -0,0 +1,254 @@
#ifndef __WINE_WINIOCTL_H
#define __WINE_WINIOCTL_H
#include "winnt.h"
#pragma pack(1)
#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
(DWORD)((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
#define DEVICE_TYPE DWORD
#define FILE_DEVICE_BEEP 0x00000001
#define FILE_DEVICE_CD_ROM 0x00000002
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
#define FILE_DEVICE_CONTROLLER 0x00000004
#define FILE_DEVICE_DATALINK 0x00000005
#define FILE_DEVICE_DFS 0x00000006
#define FILE_DEVICE_DISK 0x00000007
#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
#define FILE_DEVICE_FILE_SYSTEM 0x00000009
#define FILE_DEVICE_INPORT_PORT 0x0000000a
#define FILE_DEVICE_KEYBOARD 0x0000000b
#define FILE_DEVICE_MAILSLOT 0x0000000c
#define FILE_DEVICE_MIDI_IN 0x0000000d
#define FILE_DEVICE_MIDI_OUT 0x0000000e
#define FILE_DEVICE_MOUSE 0x0000000f
#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
#define FILE_DEVICE_NAMED_PIPE 0x00000011
#define FILE_DEVICE_NETWORK 0x00000012
#define FILE_DEVICE_NETWORK_BROWSER 0x00000013
#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
#define FILE_DEVICE_NULL 0x00000015
#define FILE_DEVICE_PARALLEL_PORT 0x00000016
#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
#define FILE_DEVICE_PRINTER 0x00000018
#define FILE_DEVICE_SCANNER 0x00000019
#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
#define FILE_DEVICE_SERIAL_PORT 0x0000001b
#define FILE_DEVICE_SCREEN 0x0000001c
#define FILE_DEVICE_SOUND 0x0000001d
#define FILE_DEVICE_STREAMS 0x0000001e
#define FILE_DEVICE_TAPE 0x0000001f
#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
#define FILE_DEVICE_TRANSPORT 0x00000021
#define FILE_DEVICE_UNKNOWN 0x00000022
#define FILE_DEVICE_VIDEO 0x00000023
#define FILE_DEVICE_VIRTUAL_DISK 0x00000024
#define FILE_DEVICE_WAVE_IN 0x00000025
#define FILE_DEVICE_WAVE_OUT 0x00000026
#define FILE_DEVICE_8042_PORT 0x00000027
#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
#define FILE_DEVICE_BATTERY 0x00000029
#define FILE_DEVICE_BUS_EXTENDER 0x0000002a
#define FILE_DEVICE_MODEM 0x0000002b
#define FILE_DEVICE_VDM 0x0000002c
#define FILE_DEVICE_MASS_STORAGE 0x0000002d
#define FILE_DEVICE_SMB 0x0000002e
#define FILE_DEVICE_KS 0x0000002f
#define FILE_DEVICE_CHANGER 0x00000030
#define FILE_DEVICE_SMARTCARD 0x00000031
#define FILE_DEVICE_ACPI 0x00000032
#define FILE_DEVICE_DVD 0x00000033
#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
#define FILE_DEVICE_DFS_VOLUME 0x00000036
#define METHOD_BUFFERED 0
#define METHOD_IN_DIRECT 1
#define METHOD_OUT_DIRECT 2
#define METHOD_NEITHER 3
#define FILE_ANY_ACCESS 0
#define FILE_READ_ACCESS FILE_READ_DATA /* file & pipe */
#define FILE_WRITE_ACCESS FILE_WRITE_DATA /* file & pipe */
#define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* decommissioned fsctl value 9 */
#define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* decommissioned fsctl value 13 */
#define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
/* decommissioned fsctl value 17 */
/* decommissioned fsctl value 18 */
#define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* Start: _WIN32_WINNT >= 0x0400 */
#define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
/* End: _WIN32_WINNT >= 0x0400 */
/* Start: _WIN32_WINNT >= 0x0500 */
#define FSCTL_READ_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_WRITE_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
/* decommissioned fsctl value 36 */
#define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA
#define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA)
#define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* End: _WIN32_WINNT >= 0x0500 */
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
#define IOCTL_STORAGE_CHECK_VERIFY CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_MEDIA_REMOVAL CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_EJECT_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_LOAD_MEDIA CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RESERVE CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RELEASE CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STORAGE_RESET_BUS CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_RESET_DEVICE CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_BASE FILE_DEVICE_DISK
#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_PERFORMANCE CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_IS_WRITABLE CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_LOGGING CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_REQUEST_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_DISK_CHECK_VERIFY CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_MEDIA_REMOVAL CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_EJECT_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_LOAD_MEDIA CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_RESERVE CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_RELEASE CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_FIND_NEW_DEVICES CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* Start: For _WIN32_WINNT >= 0x0400 */
#define IOCTL_DISK_CONTROLLER_NUMBER CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)
#define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
/* End: For _WIN32_WINNT >= 0x0400 */
#define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
/* Return Codes... should these be the same as something somewhere? */
#define PARTITION_ENTRY_UNUSED 0x00 // Entry unused
#define PARTITION_FAT_12 0x01 // 12-bit FAT entries
#define PARTITION_XENIX_1 0x02 // Xenix
#define PARTITION_XENIX_2 0x03 // Xenix
#define PARTITION_FAT_16 0x04 // 16-bit FAT entries
#define PARTITION_EXTENDED 0x05 // Extended partition entry
#define PARTITION_HUGE 0x06 // Huge partition MS-DOS V4
#define PARTITION_IFS 0x07 // IFS Partition
#define PARTITION_FAT32 0x0B // FAT32
#define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
#define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
#define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
#define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
#define PARTITION_LDM 0x42 // Logical Disk Manager partition
#define PARTITION_UNIX 0x63 // Unix
/* Device Io Stuff - Most VxD support.
* NOTE: All VxD messages seem to start with a hiword or 0
*/
typedef struct tagDIOCRegs {
DWORD reg_EBX;
DWORD reg_EDX;
DWORD reg_ECX;
DWORD reg_EAX;
DWORD reg_EDI;
DWORD reg_ESI;
DWORD reg_Flags;
} DIOC_REGISTERS, *PDIOC_REGISTERS;
/* Start VWIN32 information:
* VWIN32 is a VxD which supports the MSDOS Io routines.
*/
#define VWIN32_DIOC_DOS_IOCTL 1 /* This is the specified MS-DOS device I/O ctl - Interrupt 21h Function 4400h - 4411h */
#define VWIN32_DIOC_DOS_INT25 2 /* This is the Absolute Disk Read command - Interrupt 25h */
#define VWIN32_DIOC_DOS_INT26 3 /* This is the Absolute Disk Write command - Interrupt 25h */
#define VWIN32_DIOC_DOS_INT13 4 /* This is Interrupt 13h commands */
#define VWIN32_DIOC_DOS_DRIVEINFO 6 /* This is Interrupt 21h Function 730X commands */
/* Important: All MS_DOS data structures must be packed on a one-byte boundary - good old 16 bit. */
#pragma pack(1)
typedef struct tagMID {
WORD midInfoLevel;
DWORD midSerialNum;
BYTE midVolLabel[11];
BYTE midFileSysType[8];
} MID, *PMID;
#pragma pack()
/* End VWIN32 information */
#endif

View File

@ -20,6 +20,7 @@ typedef struct
int width;
char * dashes;
int dash_len;
int type; /* GEOMETRIC || COSMETIC */
} X_PHYSPEN;
/* X physical brush */

View File

@ -2,6 +2,7 @@
#define __WINE_XMALLOC_H
void *xmalloc( int size );
void *xcalloc( int size );
void *xrealloc( void *ptr, int size );
char *xstrdup( const char *str );

View File

@ -173,6 +173,12 @@ FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
return (FARPROC16)PrintSetupDlgProc;
if (!strcmp(name,"ReplaceTextDlgProc"))
return (FARPROC16)ReplaceTextDlgProc16;
if (!strcmp(name,"DefResourceHandler"))
return (FARPROC16)NE_DefResourceHandler;
if (!strcmp(name,"LoadDIBIconHandler"))
return (FARPROC16)LoadDIBIconHandler;
if (!strcmp(name,"LoadDIBCursorHandler"))
return (FARPROC16)LoadDIBCursorHandler;
FIXME(module,"No mapping for %s(), add one in library/miscstubs.c\n",name);
assert( FALSE );
return NULL;
@ -236,7 +242,7 @@ HMODULE32 MODULE_FindModule32(
if (dotptr) *dotptr = '\0';
if (xdotptr) *xdotptr = '\0';
}
if (!lstrcmpi32A( filename, xmodname)) {
if (!strcasecmp( filename, xmodname)) {
HeapFree(process->heap,0,filename);
HeapFree(process->heap,0,xmodname);
return wm->module;

View File

@ -18,6 +18,7 @@
#include "global.h"
#include "process.h"
#include "toolhelp.h"
#include "snoop.h"
#include "debug.h"
static HMODULE16 hFirstModule = 0;
@ -327,7 +328,10 @@ FARPROC16 NE_GetEntryPoint( HMODULE16 hModule, WORD ordinal )
if (sel == 0xfe) sel = 0xffff; /* constant entry */
else sel = (WORD)(DWORD)NE_SEG_TABLE(pModule)[sel-1].selector;
if (sel==0xffff)
return (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( sel, offset );
else
return (FARPROC16)SNOOP16_GetProcAddress16(hModule,ordinal,(FARPROC16)PTR_SEG_OFF_TO_SEGPTR( sel, offset ));
}
@ -444,8 +448,6 @@ static HMODULE16 NE_LoadExeHeader( HFILE16 hFile, OFSTRUCT *ofs )
/* We now have a valid NE header */
size = sizeof(NE_MODULE) +
/* loaded file info */
sizeof(OFSTRUCT)-sizeof(ofs->szPathName)+strlen(ofs->szPathName)+1+
/* segment table */
ne_header.n_segment_tab * sizeof(SEGTABLEENTRY) +
/* resource table */
@ -457,9 +459,11 @@ static HMODULE16 NE_LoadExeHeader( HFILE16 hFile, OFSTRUCT *ofs )
/* imported names table */
ne_header.entry_tab_offset - ne_header.iname_tab_offset +
/* entry table length */
ne_header.entry_tab_length;
ne_header.entry_tab_length +
/* loaded file info */
sizeof(OFSTRUCT)-sizeof(ofs->szPathName)+strlen(ofs->szPathName)+1;
hModule = GlobalAlloc16( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
hModule = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, size );
if (!hModule) return (HMODULE16)11; /* invalid exe */
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE *)GlobalLock16( hModule );
@ -494,14 +498,6 @@ static HMODULE16 NE_LoadExeHeader( HFILE16 hFile, OFSTRUCT *ofs )
}
}
/* Store the filename information */
pModule->fileinfo = (int)pData - (int)pModule;
size = sizeof(OFSTRUCT)-sizeof(ofs->szPathName)+strlen(ofs->szPathName)+1;
memcpy( pData, ofs, size );
((OFSTRUCT *)pData)->cBytes = size - 1;
pData += size;
/* Get the segment table */
pModule->seg_table = (int)pData - (int)pModule;
@ -605,6 +601,14 @@ static HMODULE16 NE_LoadExeHeader( HFILE16 hFile, OFSTRUCT *ofs )
}
pData += ne_header.entry_tab_length;
/* Store the filename information */
pModule->fileinfo = (int)pData - (int)pModule;
size = sizeof(OFSTRUCT)-sizeof(ofs->szPathName)+strlen(ofs->szPathName)+1;
memcpy( pData, ofs, size );
((OFSTRUCT *)pData)->cBytes = size - 1;
pData += size;
/* Free the fast-load area */
#undef READ
@ -650,6 +654,7 @@ static HMODULE16 NE_LoadExeHeader( HFILE16 hFile, OFSTRUCT *ofs )
else pModule->dlls_to_init = 0;
NE_RegisterModule( pModule );
SNOOP16_RegisterDLL(pModule,ofs->szPathName);
return hModule;
}

View File

@ -20,6 +20,7 @@
#include "module.h"
#include "neexe.h"
#include "resource.h"
#include "callback.h"
#include "debug.h"
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
@ -218,11 +219,13 @@ BOOL32 NE_InitResourceHandler( HMODULE16 hModule )
NE_MODULE *pModule = NE_GetPtr( hModule );
NE_TYPEINFO *pTypeInfo = (NE_TYPEINFO *)((char *)pModule + pModule->res_table + 2);
FARPROC16 handler = MODULE_GetWndProcEntry16("DefResourceHandler");
TRACE(resource,"InitResourceHandler[%04x]\n", hModule );
while(pTypeInfo->type_id)
{
pTypeInfo->resloader = (FARPROC16)&NE_DefResourceHandler;
pTypeInfo->resloader = handler;
pTypeInfo = NEXT_TYPEINFO(pTypeInfo);
}
return TRUE;
@ -450,7 +453,6 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
if (pNameInfo)
{
RESOURCEHANDLER16 loader;
if (pNameInfo->handle
&& !(GlobalFlags16(pNameInfo->handle) & GMEM_DISCARDED))
{
@ -461,16 +463,16 @@ HGLOBAL16 WINAPI LoadResource16( HMODULE16 hModule, HRSRC16 hRsrc )
else
{
if (pTypeInfo->resloader)
loader = (RESOURCEHANDLER16)pTypeInfo->resloader;
pNameInfo->handle = Callbacks->CallResourceHandlerProc(
pTypeInfo->resloader, pNameInfo->handle, hModule, hRsrc );
else /* this is really bad */
{
ERR(resource, "[%04x]: Missing resource handler!\n", hModule);
loader = NE_DefResourceHandler;
pNameInfo->handle = NE_DefResourceHandler(
pNameInfo->handle, hModule, hRsrc );
}
/* Finally call resource loader */
if ((pNameInfo->handle = loader(pNameInfo->handle, hModule, hRsrc)))
if (pNameInfo->handle)
{
pNameInfo->usage++;
pNameInfo->flags |= NE_SEGFLAGS_LOADED;

View File

@ -349,7 +349,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (next_offset == offset) break; /* avoid infinite loop */
if (next_offset >= GlobalSize16(pSeg->selector)) break;
offset = next_offset;
} while (offset && (offset != 0xffff));
} while (offset != 0xffff);
}
}

View File

@ -34,6 +34,8 @@
#include "sig_context.h"
#include "winsock.h"
/* Global variable to save %fs register while in 16-bit code */
WORD CALLTO16_Current_fs;
/* Linux sigaction function */

View File

@ -346,6 +346,7 @@ HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
cmd_line = pdb32->env_db->cmd_line;
while (*cmd_line && (*cmd_line != ' ') && (*cmd_line != '\t')) cmd_line++;
while ((*cmd_line == ' ') || (*cmd_line == '\t')) cmd_line++;
lstrcpyn32A( pTask->pdb.cmdLine+1, cmd_line, sizeof(pTask->pdb.cmdLine)-1);
pTask->pdb.cmdLine[0] = strlen( pTask->pdb.cmdLine + 1 );
@ -1245,10 +1246,9 @@ VOID WINAPI GlobalNotify( FARPROC16 proc )
/***********************************************************************
* GetExePtr (KERNEL.133)
*/
HMODULE16 WINAPI GetExePtr( HANDLE16 handle )
static HMODULE16 GetExePtrHelper( HANDLE16 handle, HTASK16 *hTask )
{
char *ptr;
HTASK16 hTask;
HANDLE16 owner;
/* Check for module handle */
@ -1256,31 +1256,60 @@ HMODULE16 WINAPI GetExePtr( HANDLE16 handle )
if (!(ptr = GlobalLock16( handle ))) return 0;
if (((NE_MODULE *)ptr)->magic == IMAGE_OS2_SIGNATURE) return handle;
/* Search for this handle inside all tasks */
*hTask = hFirstTask;
while (*hTask)
{
TDB *pTask = (TDB *)GlobalLock16( *hTask );
if ((*hTask == handle) ||
(pTask->hInstance == handle) ||
(pTask->hQueue == handle) ||
(pTask->hPDB == handle)) return pTask->hModule;
*hTask = pTask->hNext;
}
/* Check the owner for module handle */
owner = FarGetOwner( handle );
if (!(ptr = GlobalLock16( owner ))) return 0;
if (((NE_MODULE *)ptr)->magic == IMAGE_OS2_SIGNATURE) return owner;
/* Search for this handle and its owner inside all tasks */
/* Search for the owner inside all tasks */
hTask = hFirstTask;
while (hTask)
*hTask = hFirstTask;
while (*hTask)
{
TDB *pTask = (TDB *)GlobalLock16( hTask );
if ((hTask == handle) ||
(pTask->hInstance == handle) ||
(pTask->hQueue == handle) ||
(pTask->hPDB == handle)) return pTask->hModule;
if ((hTask == owner) ||
TDB *pTask = (TDB *)GlobalLock16( *hTask );
if ((*hTask == owner) ||
(pTask->hInstance == owner) ||
(pTask->hQueue == owner) ||
(pTask->hPDB == owner)) return pTask->hModule;
hTask = pTask->hNext;
*hTask = pTask->hNext;
}
return 0;
}
HMODULE16 WINAPI GetExePtr( HANDLE16 handle )
{
HTASK16 dummy;
return GetExePtrHelper( handle, &dummy );
}
void WINAPI WIN16_GetExePtr( CONTEXT *context )
{
WORD *stack = PTR_SEG_OFF_TO_LIN(SS_reg(context), SP_reg(context));
HANDLE16 handle = (HANDLE16)stack[2];
HTASK16 hTask = 0;
HMODULE16 hModule;
hModule = GetExePtrHelper( handle, &hTask );
AX_reg(context) = CX_reg(context) = hModule;
if (hTask) ES_reg(context) = hTask;
}
/***********************************************************************
* TaskFirst (TOOLHELP.63)
*/

View File

@ -17,6 +17,7 @@
#include "heap.h"
#include "process.h"
#include "xmalloc.h"
#include "global.h"
#include "debug.h"
#ifndef MS_SYNC
@ -43,6 +44,8 @@ typedef struct _FV
UINT32 flags; /* Allocation flags */
UINT32 offset; /* Offset from start of mapped file */
FILE_MAPPING *mapping; /* File mapping */
HANDLERPROC handlerProc; /* Fault handler */
LPVOID handlerArg; /* Fault handler argument */
BYTE protect; /* Protection for all pages at allocation time */
BYTE prot[1]; /* Protection byte for each page */
} FILE_VIEW;
@ -500,6 +503,32 @@ DWORD VIRTUAL_GetGranularity(void)
}
/***********************************************************************
* VIRTUAL_SetFaultHandler
*/
BOOL32 VIRTUAL_SetFaultHandler( LPVOID addr, HANDLERPROC proc, LPVOID arg )
{
FILE_VIEW *view;
if (!(view = VIRTUAL_FindView((UINT32)addr))) return FALSE;
view->handlerProc = proc;
view->handlerArg = arg;
return TRUE;
}
/***********************************************************************
* VIRTUAL_HandleFault
*/
BOOL32 VIRTUAL_HandleFault(LPVOID addr)
{
FILE_VIEW *view = VIRTUAL_FindView((UINT32)addr);
if (view && view->handlerProc)
return view->handlerProc(view->handlerArg, addr);
return FALSE;
}
/***********************************************************************
* VirtualAlloc (KERNEL32.548)
* Reserves or commits a region of pages in virtual address space

View File

@ -116,6 +116,17 @@ static void WINAPI CALLBACK_CallSystemTimerProc( FARPROC16 proc )
proc();
}
/**********************************************************************
* CALLBACK_CallResourceHandlerProc
*/
static HGLOBAL16 WINAPI CALLBACK_CallResourceHandlerProc( FARPROC16 proc,
HGLOBAL16 hMemObj,
HMODULE16 hModule,
HRSRC16 hRsrc )
{
return proc( hMemObj, hModule, hRsrc );
}
/**********************************************************************
* CALLBACK_CallASPIPostProc
@ -240,6 +251,7 @@ static const CALLBACKS_TABLE CALLBACK_WinelibTable =
CALLBACK_CallBootAppProc, /* CallBootAppProc */
CALLBACK_CallLoadAppSegProc, /* CallLoadAppSegProc */
CALLBACK_CallSystemTimerProc, /* CallSystemTimerProc */
CALLBACK_CallResourceHandlerProc, /* CallResourceHandlerProc */
CALLBACK_CallWOWCallbackProc, /* CallWOWCallbackProc */
CALLBACK_CallWOWCallback16Ex, /* CallWOWCallback16Ex */
CALLBACK_CallASPIPostProc, /* CallASPIPostProc */

View File

@ -306,7 +306,9 @@ INT32 __cdecl CRTDLL_fscanf( LPVOID stream, LPSTR format, ... )
INT32 res;
va_start( valist, format );
#ifdef HAVE_VFSCANF
res = vfscanf( xlat_file_ptr(stream), format, valist );
#endif
va_end( valist );
return res;
}

View File

@ -4,7 +4,7 @@
* Copyright 1998 Eric Kohl
*
* TODO:
* - Fix offsets in ImageList_DrawIndirect.
* - Fix xBitmap and yBitmap in ImageList_DrawIndirect.
* - Fix ILD_TRANSPARENT error in ImageList_DrawIndirect.
* - Fix ImageList_GetIcon (might be a result of the
* ILD_TRANSPARENT error in ImageList_DrawIndirect).
@ -115,7 +115,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT32 nImageCount)
if (himl->hbmMask) {
hbmNewBitmap =
CreateBitmap32 (nNewWidth, himl->cy, 1, 1, NULL);
CreateBitmap32 (nNewWidth, himl->cy, 1, himl->uBitsPixel, NULL);
if (hbmNewBitmap == 0)
ERR (imagelist, "creating new mask bitmap!");
@ -274,10 +274,13 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP32 hbmImage, COLORREF clrMask)
INT32 nIndex, nImageCount;
BITMAP32 bmp;
INT32 nStartX, nRunX, nRunY;
COLORREF bkColor;
if (himl == NULL)
return (-1);
bkColor = (clrMask == CLR_NONE) ? himl->clrBk : clrMask;
GetObject32A (hbmImage, sizeof(BITMAP32), &bmp);
nImageCount = bmp.bmWidth / himl->cx;
@ -303,8 +306,7 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP32 hbmImage, COLORREF clrMask)
for (nRunY = 0; nRunY < himl->cy; nRunY++) {
for (nRunX = 0; nRunX < bmp.bmWidth; nRunX++) {
if (GetPixel32 (hdcImageList, nStartX + nRunX, nRunY) ==
clrMask)
{
bkColor) {
SetPixel32 (hdcImageList, nStartX + nRunX, nRunY,
RGB(0, 0, 0));
SetPixel32 (hdcMask, nStartX + nRunX, nRunY,
@ -438,7 +440,8 @@ ImageList_Copy (HIMAGELIST himlDst, INT32 iDst, HIMAGELIST himlSrc,
/* create temporary bitmaps */
hbmTempImage = CreateBitmap32 (himlSrc->cx, himlSrc->cy, 1,
himlSrc->uBitsPixel, NULL);
hbmTempMask = CreateBitmap32 (himlSrc->cx, himlSrc->cy, 1, 1, NULL);
hbmTempMask = CreateBitmap32 (himlSrc->cx, himlSrc->cy, 1,
himlSrc->uBitsPixel, NULL);
/* copy (and stretch) destination to temporary bitmaps.(save) */
/* image */
@ -578,8 +581,8 @@ ImageList_Create (INT32 cx, INT32 cy, UINT32 flags,
}
if (himl->flags & ILC_MASK) {
himl->hbmMask =
CreateBitmap32 (himl->cx * himl->cMaxImage, himl->cy, 1, 1, NULL);
himl->hbmMask = CreateBitmap32 (himl->cx * himl->cMaxImage, himl->cy,
1, himl->uBitsPixel, NULL);
if (himl->hbmMask == 0) {
ERR(imagelist, "Error creating mask bitmap!\n");
if (himl->hbmImage)
@ -860,7 +863,7 @@ ImageList_Draw (HIMAGELIST himl, INT32 i, HDC32 hdc,
BOOL32 WINAPI
ImageList_DrawEx (HIMAGELIST himl, INT32 i, HDC32 hdc, INT32 x, INT32 y,
INT32 xOffs, INT32 yOffs, COLORREF rgbBk, COLORREF rgbFg,
INT32 dx, INT32 dy, COLORREF rgbBk, COLORREF rgbFg,
UINT32 fStyle)
{
IMAGELISTDRAWPARAMS imldp;
@ -871,8 +874,8 @@ ImageList_DrawEx (HIMAGELIST himl, INT32 i, HDC32 hdc, INT32 x, INT32 y,
imldp.hdcDst = hdc,
imldp.x = x;
imldp.y = y;
imldp.cx = xOffs;
imldp.cy = yOffs;
imldp.cx = dx;
imldp.cy = dy;
imldp.xBitmap = 0;
imldp.yBitmap = 0;
imldp.rgbBk = rgbBk;
@ -904,6 +907,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
HDC32 hdcImageList, hdcTempImage;
HBITMAP32 hbmTempImage;
HBRUSH32 hBrush, hOldBrush;
INT32 cx, cy;
INT32 nOvlIdx;
COLORREF clrBlend;
BOOL32 bImage; /* draw image ? */
@ -921,6 +925,9 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
himlLocal = pimldp->himl;
cx = (pimldp->cx == 0) ? himlLocal->cx : pimldp->cx;
cy = (pimldp->cy == 0) ? himlLocal->cy : pimldp->cy;
/* ILD_NORMAL state */
bImage = TRUE;
bImageTrans = FALSE;
@ -969,10 +976,8 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
{
/* draw the mask */
SelectObject32 (hdcImageList, himlLocal->hbmMask);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
himlLocal->cx, himlLocal->cy, hdcImageList,
himlLocal->cx * pimldp->i, 0,
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy,
hdcImageList, himlLocal->cx * pimldp->i, 0,
bMaskTrans ? SRCAND : SRCCOPY);
}
@ -986,12 +991,12 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
hBrush = CreateSolidBrush32 (himlLocal->clrBk);
hOldBrush = SelectObject32 (pimldp->hdcDst, hBrush);
PatBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
himlLocal->cx, himlLocal->cy, PATCOPY);
cx, cy, PATCOPY);
DeleteObject32 (SelectObject32 (pimldp->hdcDst, hOldBrush));
}
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcImageList, himlLocal->cx * pimldp->i, 0,
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy,
hdcImageList, himlLocal->cx * pimldp->i, 0,
SRCPAINT);
if (bBlend25 || bBlend50)
@ -1017,8 +1022,8 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
himlLocal->cy, hdcImageList,
pimldp->i * himlLocal->cx, 0, SRCPAINT);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcTempImage, 0, 0, SRCAND);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy,
hdcTempImage, 0, 0, SRCAND);
/* fill */
hBrush = CreateSolidBrush32 (clrBlend);
@ -1035,8 +1040,8 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
himlLocal->cy, hdcImageList,
pimldp->i * himlLocal->cx, 0, SRCPAINT);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcTempImage, 0, 0, SRCPAINT);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy,
hdcTempImage, 0, 0, SRCPAINT);
DeleteObject32 (hbmTempImage);
DeleteDC32 (hdcTempImage);
@ -1044,24 +1049,20 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
}
/* Draw overlay image */
if (pimldp->fStyle & 0x0700)
{
if (pimldp->fStyle & 0x0700) {
nOvlIdx = (pimldp->fStyle & 0x0700) >> 8;
if ((nOvlIdx >= 1) && (nOvlIdx <= MAX_OVERLAYIMAGE))
{
if ((nOvlIdx >= 1) && (nOvlIdx <= MAX_OVERLAYIMAGE)) {
nOvlIdx = pimldp->himl->nOvlIdx[nOvlIdx - 1];
if ((nOvlIdx >= 0) && (nOvlIdx <= pimldp->himl->cCurImage))
{
if (pimldp->himl->hbmMask)
{
if ((nOvlIdx >= 0) && (nOvlIdx <= pimldp->himl->cCurImage)) {
if (pimldp->himl->hbmMask) {
SelectObject32 (hdcImageList, pimldp->himl->hbmMask);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
pimldp->himl->cx, pimldp->himl->cy, hdcImageList,
pimldp->himl->cx * nOvlIdx, 0, SRCAND);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy,
hdcImageList, pimldp->himl->cx * nOvlIdx, 0,
SRCAND);
}
SelectObject32 (hdcImageList, pimldp->himl->hbmImage);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
pimldp->himl->cx, pimldp->himl->cy, hdcImageList,
cx, cy, hdcImageList,
pimldp->himl->cx * nOvlIdx, 0, SRCPAINT);
}
}
@ -1745,7 +1746,7 @@ ImageList_Remove (HIMAGELIST himl, INT32 i)
DeleteObject32 (himl->hbmMask);
himl->hbmMask =
CreateBitmap32 (himl->cMaxImage * himl->cx, himl->cy,
1, 1, NULL);
1, himl->uBitsPixel, NULL);
}
}
else {
@ -1764,7 +1765,7 @@ ImageList_Remove (HIMAGELIST himl, INT32 i)
CreateBitmap32 (cxNew, himl->cy, 1, himl->uBitsPixel, NULL);
if (himl->hbmMask)
hbmNewMask = CreateBitmap32 (cxNew, himl->cy, 1, 1, NULL);
hbmNewMask = CreateBitmap32 (cxNew, himl->cy, 1, himl->uBitsPixel, NULL);
else
hbmNewMask = 0; /* Just to keep compiler happy! */
@ -2122,7 +2123,7 @@ ImageList_SetIconSize (HIMAGELIST himl, INT32 cx, INT32 cy)
DeleteObject32 (himl->hbmMask);
himl->hbmMask =
CreateBitmap32 (himl->cMaxImage * himl->cx, himl->cy,
1, 1, NULL);
1, himl->uBitsPixel, NULL);
}
return (TRUE);
@ -2179,7 +2180,7 @@ ImageList_SetImageCount (HIMAGELIST himl, INT32 iImageCount)
if (himl->hbmMask)
{
hbmNewBitmap = CreateBitmap32 (nNewCount * himl->cx, himl->cy,
1, 1, NULL);
1, himl->uBitsPixel, NULL);
if (hbmNewBitmap != 0)
{
SelectObject32 (hdcImageList, himl->hbmMask);

View File

@ -43,13 +43,13 @@
/* FIXME: should probably get rid of wctype.h altogether */
#include "casemap.h"
WCHAR _towupper(WCHAR code)
WCHAR towupper(WCHAR code)
{
const WCHAR * ptr = uprtable[HIBYTE(code)];
return ptr ? ptr[LOBYTE(code)] : code;
}
WCHAR _towlower(WCHAR code)
WCHAR towlower(WCHAR code)
{
const WCHAR * ptr = lwrtable[HIBYTE(code)];
return ptr ? ptr[LOBYTE(code)] : code;
@ -171,15 +171,10 @@ SEGPTR WINAPI AnsiPrev16( SEGPTR start, SEGPTR current )
void WINAPI OutputDebugString16( LPCSTR str )
{
char module[10];
char *p, *buffer = HeapAlloc( GetProcessHeap(), 0, strlen(str)+2 );
/* Remove CRs */
for (p = buffer; *str; str++) if (*str != '\r') *p++ = *str;
*p = '\0';
if ((p > buffer) && (p[-1] == '\n')) p[1] = '\0'; /* Remove trailing \n */
if (!GetModuleName( GetCurrentTask(), module, sizeof(module) ))
strcpy( module, "???" );
DUMP("%s says '%s'\n", module, buffer );
HeapFree( GetProcessHeap(), 0, buffer );
DUMP( "%s says %s\n", module, debugstr_a(str) );
}

View File

@ -212,6 +212,9 @@ static BOOL32 MAIN_ParseDebugOptions(char *options)
/* defined in relay32/relay386.c */
extern char **debug_relay_includelist;
extern char **debug_relay_excludelist;
/* defined in relay32/snoop.c */
extern char **debug_snoop_includelist;
extern char **debug_snoop_excludelist;
int l, cls;
if (strlen(options)<3)
@ -247,13 +250,14 @@ static BOOL32 MAIN_ParseDebugOptions(char *options)
if(cls == -1 || cls == j)
debug_msg_enabled[i][j]=(*options=='+');
}
else if (!lstrncmpi32A(options+1, "relay=", 6))
else if (!lstrncmpi32A(options+1, "relay=", 6) ||
!lstrncmpi32A(options+1, "snoop=", 6))
{
int i, j;
char *s, *s2, ***output, c;
for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
if (debug_ch_name && (!lstrncmpi32A(debug_ch_name[i],"relay",5))){
if (debug_ch_name && (!lstrncmpi32A(debug_ch_name[i],options+1,5))){
for(j=0; j<DEBUG_CLASS_COUNT; j++)
if(cls == -1 || cls == j)
debug_msg_enabled[i][j]=TRUE;
@ -262,10 +266,13 @@ static BOOL32 MAIN_ParseDebugOptions(char *options)
/* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
if (i==DEBUG_CHANNEL_COUNT)
return FALSE;
if (*options == '+')
output = &debug_relay_includelist;
else
output = &debug_relay_excludelist;
output = (*options == '+') ?
((*(options+1) == 'r') ?
&debug_relay_includelist :
&debug_snoop_includelist) :
((*(options+1) == 'r') ?
&debug_relay_excludelist :
&debug_snoop_excludelist);
s = options + 7;
i = 1;
while((s = strchr(s, ':'))) i++, s++;
@ -448,8 +455,13 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
int i;
MSG("%s: Syntax: -debugmsg [class]+xxx,... or "
"-debugmsg [class]-xxx,...\n",argv[0]);
MSG("Example: -debugmsg +all,warn-heap"
"turn on all messages except warning heap messages\n");
MSG("Example: -debugmsg +all,warn-heap\n"
" turn on all messages except warning heap messages\n");
MSG("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
" turn on -debugmsg +relay only as specified\n"
"Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
" turn on -debugmsg +relay except as specified\n"
"Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
MSG("Available message classes:\n");
for(i=0;i<DEBUG_CLASS_COUNT;i++)

View File

@ -17,6 +17,7 @@
#include "debug.h"
#include "module.h"
#include "heap.h"
#include "debugstr.h"
/**************************************************************************
* RtlLengthRequiredSid [NTDLL]
@ -680,3 +681,34 @@ long long /*LARGE_INTEGER*/ WINAPI RtlExtendedIntegerMultiply(
return 0;
#endif
}
DWORD WINAPI NtOpenKey(DWORD x1,DWORD x2,DWORD x3) {
FIXME(ntdll,"(0x%08lx(%s),0x%08lx,0x%08lx),stub!\n",x1,
debugstr_w(*(LPWSTR*)x1),x2,x3);
/* hmm... */
return RegOpenKey32W(x2,*(LPWSTR*)x1,x3);
}
DWORD WINAPI NtQueryValueKey(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6) {
FIXME(ntdll,"(%08lx,%08lx,%08lx,%08lx,%08lx,%08lx),stub!\n",
x1,x2,x3,x4,x5,x6
);
return 0;
}
DWORD WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3) {
FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3);
return 1;
}
DWORD WINAPI NtClose(DWORD x1) {
FIXME(ntdll,"(0x%08lx),stub!\n",x1);
return 1;
}
DWORD WINAPI NtQueryInformationProcess(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) {
FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",
x1,x2,x3,x4,x5
);
return 0;
}

View File

@ -1,5 +1,8 @@
/*
* Shell Library Functions
*
* currently work in progress on SH* and SHELL32_DllGetClassObject functions
* <contact juergen.schmied@metronet.de 980624>
*/
#include <assert.h>
#include <stdlib.h>
@ -1172,7 +1175,7 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
for (i=0;i<n;i++) {
LPIMAGE_RESOURCE_DIRECTORY xresdir;
xresdir = GetResDirEntryW(iconresdir,(LPWSTR)&(RetPtr[i]),(DWORD)rootresdir,FALSE);
xresdir = GetResDirEntryW(iconresdir,(LPWSTR)RetPtr[i],(DWORD)rootresdir,FALSE);
xresdir = GetResDirEntryW(xresdir,(LPWSTR)0,(DWORD)rootresdir,TRUE);
idataent = (LPIMAGE_RESOURCE_DATA_ENTRY)xresdir;
@ -1580,6 +1583,7 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
char xclsid[50],xiid[50];
HRESULT hres = E_OUTOFMEMORY;
WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
WINE_StringFromCLSID((LPCLSID)iid,xiid);
TRACE(shell,"(%s,%s,%p)\n",xclsid,xiid,ppv);
@ -1602,15 +1606,16 @@ DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
* something.
*/
if (!memcmp(rclsid,&CLSID_ShellDesktop,sizeof(CLSID_ShellDesktop))) {
TRACE(shell," requested CLSID_ShellDesktop, creating it.\n");
if (!memcmp(rclsid,&CLSID_ShellDesktop,sizeof(CLSID_ShellDesktop)))
{ TRACE(shell," requested CLSID_ShellDesktop, creating it.\n");
*ppv = IShellFolder_Constructor();
FIXME(shell,"Initialize this folder to be the shell desktop folder\n");
return 0;
/* FIXME(shell,"Initialize this folder to be the shell desktop folder\n")*/
return S_OK;
}
FIXME(shell, "clsid(%s) not found. Returning E_OUTOFMEMORY.\n",xclsid);
return hres;
FIXME(shell, "clsid(%s) not found, return CLASS_E_CLASSNOTAVAILABLE.\n",xclsid);
*ppv=NULL;
return CLASS_E_CLASSNOTAVAILABLE;
}
/*************************************************************************
@ -1651,11 +1656,51 @@ DWORD WINAPI SHGetMalloc(LPMALLOC32 *lpmal) {
*
* nFolder is a CSIDL_xxxxx.
*/
HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITEMIDLIST * ppidl) {
FIXME(shell,"(%04x,%d,%p),stub!\n", hwndOwner,nFolder,ppidl);
*ppidl = (LPITEMIDLIST)HeapAlloc(GetProcessHeap(),0,2*sizeof(ITEMIDLIST));
FIXME(shell, "we return only the empty ITEMIDLIST currently.\n");
(*ppidl)->mkid.cb = 0;
HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITEMIDLIST * ppidl)
{ FIXME(shell,"(%04x,%d,%p),stub!\n", hwndOwner,nFolder,ppidl);
switch (nFolder)
{ case CSIDL_BITBUCKET: TRACE (shell,"looking for Recyceler\n");
break;
case CSIDL_CONTROLS: TRACE (shell,"looking for Control\n");
break;
case CSIDL_DESKTOP: TRACE (shell,"looking for Desktop\n");
break;
case CSIDL_DESKTOPDIRECTORY: TRACE (shell,"looking for DeskDir\n");
break;
case CSIDL_DRIVES: TRACE (shell,"looking for Drives\n");
break;
case CSIDL_FONTS: TRACE (shell,"looking for Fonts\n");
break;
case CSIDL_NETHOOD: TRACE (shell,"looking for Nethood\n");
break;
case CSIDL_NETWORK: TRACE (shell,"looking for Network\n");
break;
case CSIDL_PERSONAL: TRACE (shell,"looking for Personal\n");
break;
case CSIDL_PRINTERS: TRACE (shell,"looking for Printers\n");
break;
case CSIDL_PROGRAMS: TRACE (shell,"looking for Programms\n");
break;
case CSIDL_RECENT: TRACE (shell,"looking for Recent\n");
break;
case CSIDL_SENDTO: TRACE (shell,"looking for Sendto\n");
break;
case CSIDL_STARTMENU: TRACE (shell,"looking for Startmenu\n");
break;
case CSIDL_STARTUP: TRACE (shell,"looking for Startup\n");
break;
case CSIDL_TEMPLATES: TRACE (shell,"looking for Templates\n");
break;
default: ERR (shell,"unknown CSIDL\n");
break;
}
*ppidl = (LPITEMIDLIST)HeapAlloc(GetProcessHeap(),0,sizeof(ITEMIDLIST));
(*ppidl)->mkid.cb = 0; /*the first ITEMIDLIST*/
FIXME(shell, "return empty ITEMIDLIST only (pidl %p)\n",*ppidl);
return NOERROR;
}
@ -1663,9 +1708,9 @@ HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITE
* SHGetPathFromIDList [SHELL32.221]
* returns the path from a passed PIDL.
*/
BOOL32 WINAPI SHGetPathFromIDList(LPCITEMIDLIST pidl,LPSTR pszPath) {
FIXME(shell,"(%p,%p),stub!\n",pidl,pszPath);
lstrcpy32A(pszPath,"E:\\"); /* FIXME */
BOOL32 WINAPI SHGetPathFromIDList(LPCITEMIDLIST pidl,LPSTR pszPath)
{ FIXME(shell,"(pidl %p,%p),stub, returning E:\\\\ \n",pidl,pszPath);
strcpy(pszPath,"E:\\"); /* FIXME */
return NOERROR;
}
@ -1683,3 +1728,18 @@ SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
return 0;
}
/*************************************************************************
* SHBrowseForFolderA [SHELL32.209]
*
*/
LPITEMIDLIST WINAPI
SHBrowseForFolder32A (LPBROWSEINFO32A lpbi)
{
FIXME (exec, "(%lx) empty stub!\n", (DWORD)lpbi);
FIXME (exec, "(%s) empty stub!\n", lpbi->lpszTitle);
return NULL;
}

View File

@ -68,9 +68,9 @@ LPSHITEMID WINAPI SHELL32_16(LPITEMIDLIST iil) {
* Original Name: PathIsRoot
*/
BOOL32 WINAPI SHELL32_29(LPCSTR x) {
if (!lstrcmp32A(x+1,":\\")) /* "X:\" */
if (!strcmp(x+1,":\\")) /* "X:\" */
return 1;
if (!lstrcmp32A(x,"\\")) /* "\" */
if (!strcmp(x,"\\")) /* "\" */
return 1;
if (x[0]=='\\' && x[1]=='\\') { /* UNC "\\<xx>\" */
int foundbackslash = 0;
@ -400,7 +400,7 @@ void WINAPI SHELL32_175(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
* Original name: RegisterShellHook (exported by ordinal)
*/
void WINAPI SHELL32_181(HWND32 hwnd, DWORD y) {
FIXME(shell,"(0x%08lx,0x%08lx):stub.\n",hwnd,y);
FIXME(shell,"(0x%08lx,0x%08x):stub.\n",hwnd,y);
}
/*************************************************************************
@ -441,7 +441,7 @@ static GetClassPtr SH_find_moduleproc(LPSTR dllname,HMODULE32 *xhmod,
FARPROC32 dllunload,nameproc;
if (xhmod) *xhmod = 0;
if (!lstrcmpi32A(SHELL32_34(dllname),"shell32.dll"))
if (!strcasecmp(SHELL32_34(dllname),"shell32.dll"))
return (GetClassPtr)SHELL32_DllGetClassObject;
hmod = LoadLibraryEx32A(dllname,0,LOAD_WITH_ALTERED_SEARCH_PATH);
@ -607,6 +607,8 @@ DWORD WINAPI SHELL32_152(LPITEMIDLIST iil) {
LPSHITEMID si;
DWORD len;
if (!iil)
return 0;
si = &(iil->mkid);
len = 2;
while (si->cb) {
@ -639,6 +641,9 @@ DWORD WINAPI SHELL32_165(DWORD x,LPCSTR path) {
/*************************************************************************
* SHELL32_195 [SHELL32.195]
* free_ptr() - frees memory using IMalloc
*
* NOTES
* Original name: SHFree (exported by ordinal)
*/
DWORD WINAPI SHELL32_195(LPVOID x) {
return LocalFree32((HANDLE32)x);
@ -662,6 +667,7 @@ LPITEMIDLIST WINAPI SHELL32_18(LPITEMIDLIST iil) {
len = SHELL32_152(iil);
newiil = (LPITEMIDLIST)SHELL32_196(len);
if (newiil)
memcpy(newiil,iil,len);
return newiil;
}
@ -685,16 +691,22 @@ LPITEMIDLIST WINAPI SHELL32_25(LPITEMIDLIST iil1,LPITEMIDLIST iil2) {
/*************************************************************************
* SHELL32_155 [SHELL32.155]
* free_check_ptr - frees memory (if not NULL) allocated by SHMalloc allocator
*
* NOTES
* Original name: ILFree (exported by ordinal)
*/
DWORD WINAPI SHELL32_155(LPVOID x) {
if (!x)
FIXME (shell,"(0x%08lx):stub.\n", (DWORD)x);
// if (!x)
return 0;
return SHELL32_195(x);
// return SHELL32_195(x);
}
/*************************************************************************
* SHELL32_85 [SHELL32.85]
* unknown
*
* NOTES
* Original name: OpenRegStream (exported by ordinal)
*/
DWORD WINAPI SHELL32_85(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
FIXME(shell,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub.\n",
@ -706,15 +718,21 @@ DWORD WINAPI SHELL32_85(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
/*************************************************************************
* SHELL32_86 [SHELL32.86]
* unknown
*
* NOTES
* Original name: SHRegisterDragDrop (exported by ordinal)
*/
DWORD WINAPI SHELL32_86(HWND32 hwnd,DWORD x2) {
FIXME(shell,"(0x%08lx,0x%08lx):stub.\n",hwnd,x2);
FIXME (shell, "(0x%08lx,0x%08x):stub.\n", hwnd, x2);
return 0;
}
/*************************************************************************
* SHELL32_87 [SHELL32.87]
* unknown
*
* NOTES
* Original name: SHRevokeDragDrop (exported by ordinal)
*/
DWORD WINAPI SHELL32_87(DWORD x) {
FIXME(shell,"(0x%08lx):stub.\n",x);
@ -724,13 +742,15 @@ DWORD WINAPI SHELL32_87(DWORD x) {
/*************************************************************************
* SHELL32_61 [SHELL32.61]
* Shell/Run-Dialog
*
* NOTES
* Original name: RunFileDlg (exported by ordinal)
*/
DWORD WINAPI
SHELL32_61 (HWND32 hwndOwner, DWORD dwParam1, DWORD dwParam2,
LPSTR lpszTitle, LPSTR lpszPrompt, UINT32 uFlags)
{
FIXME (shell,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%lx):stub.\n",
FIXME (shell,"(0x%08x 0x%lx 0x%lx \"%s\" \"%s\" 0x%x):stub.\n",
hwndOwner, dwParam1, dwParam2, lpszTitle, lpszPrompt, uFlags);
return 0;
}
@ -761,3 +781,17 @@ SHELL32_184 (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3,
return 0;
}
/*************************************************************************
* SHELL32_147 [SHELL32.147]
*
* NOTES
* Original name: SHCLSIDFromString (exported by ordinal)
*/
DWORD WINAPI
SHELL32_147 (DWORD dwParam1, DWORD dwParam2)
{
FIXME (shell,"(0x%lx 0x%lx):stub.\n", dwParam1, dwParam2);
return 0;
}

View File

@ -101,3 +101,12 @@ FARPROC16 tmp;
/* just return previously installed notification function */
return tmp;
}
/***********************************************************************
* CreateToolHelp32Snapshot (KERNEL32.179)
* see "Undocumented Windows"
*/
HANDLE32 WINAPI CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID) {
FIXME(toolhelp,"(0x%08lx,0x%08lx), stub!\n",dwFlags,th32ProcessID);
return INVALID_HANDLE_VALUE32;
}

View File

@ -65,8 +65,6 @@
/* ----------------------------------- internal data */
extern int h_errno;
static HANDLE32 _WSHeap = 0;
static unsigned char* _ws_stub = NULL;
static LPWSINFO _wsi_list = NULL;
@ -2570,9 +2568,9 @@ UINT16 wsaErrno(void)
{
int loc_errno = errno;
#ifdef HAVE_STRERROR
WARN(winsock, "errno %d, (%s).\n", errno, strerror(errno));
WARN(winsock, "errno %d, (%s).\n", loc_errno, strerror(loc_errno));
#else
WARN(winsock, "errno %d\n", errno);
WARN(winsock, "errno %d\n", loc_errno);
#endif
switch(loc_errno)
@ -2635,7 +2633,7 @@ UINT16 wsaErrno(void)
/* just in case we ever get here and there are no problems */
case 0: return 0;
default:
WARN(winsock, "Unknown errno %d!\n", errno);
WARN(winsock, "Unknown errno %d!\n", loc_errno);
return WSAEOPNOTSUPP;
}
}
@ -2644,11 +2642,7 @@ UINT16 wsaHerrno(void)
{
int loc_errno = h_errno;
#ifdef HAVE_STRERROR
WARN(winsock, "h_errno %d, (%s).\n", h_errno, strerror(h_errno));
#else
WARN(winsock, "h_errno %d.\n", h_errno);
#endif
WARN(winsock, "h_errno %d.\n", loc_errno);
switch(loc_errno)
{
@ -2659,7 +2653,7 @@ UINT16 wsaHerrno(void)
case 0: return 0;
default:
WARN(winsock,"Unknown h_errno %d!\n", h_errno);
WARN(winsock,"Unknown h_errno %d!\n", loc_errno);
return WSAEOPNOTSUPP;
}
}

View File

@ -33,8 +33,6 @@
# include <sys/file.h>
#endif
extern int h_errno;
#include "winsock.h"
#include "windows.h"
#include "heap.h"

View File

@ -28,6 +28,16 @@ void *xmalloc( int size )
MSG("Virtual memory exhausted.\n");
exit (1);
}
memset(res,0,size);
return res;
}
void *xcalloc( int size )
{
void *res;
res = xmalloc (size);
memset(res,0,size);
return res;
}

View File

@ -6,6 +6,7 @@
#include "windows.h"
#include "ldt.h"
#include "global.h"
#include "miscemu.h"
#include "sig_context.h"
#include "debug.h"
@ -296,6 +297,13 @@ BOOL32 INSTR_EmulateInstruction( SIGCONTEXT *context )
int prefix, segprefix, prefixlen, len, repX, long_op, long_addr;
BYTE *instr;
/* Check for page-fault */
#if defined(TRAP_sig) && defined(CR2_sig)
if (TRAP_sig(context) == 0x0e
&& VIRTUAL_HandleFault( (LPVOID)CR2_sig(context) )) return TRUE;
#endif
long_op = long_addr = IS_SELECTOR_32BIT(CS_sig(context));
instr = (BYTE *)MAKE_PTR(CS_sig(context),EIP_sig(context));
if (!instr) return FALSE;

View File

@ -12,6 +12,7 @@
#include "options.h"
#include "process.h"
#include "win16drv.h"
#include "psdrv.h"
#include "windows.h"
@ -32,6 +33,9 @@ BOOL32 MAIN_EmulatorInit(void)
/* Create the Win16 printer driver */
if (!WIN16DRV_Init()) return FALSE;
/* Create the Postscript printer driver (FIXME: should be in Winelib) */
if (!PSDRV_Init()) return FALSE;
/* Initialize all the USER stuff */
return MAIN_UserInit();
}

View File

@ -191,6 +191,18 @@ static void INT_DoRealModeInt( CONTEXT *context )
/* MSCDEX hook */
do_mscdex( &realmode_ctx, 1 );
break;
case 0x7a:
/* NOVELL NetWare */
switch (AL_reg(&realmode_ctx))
{
case 0x20: /* Get VLM Call Address */
/* return nothing -> NetWare not installed */
break;
default:
SET_CFLAG(context);
break;
}
break;
default:
SET_CFLAG(context);
break;

View File

@ -289,6 +289,13 @@ static BOOL32 ioctlGenericBlkDevReq( CONTEXT *context )
TRACE(int21,"logical volume %d unlocked.\n",drive);
break;
case 0x6f:
memset(dataptr+1, '\0', dataptr[0]-1);
dataptr[1] = dataptr[0];
dataptr[2] = 0x07; /* protected mode driver; no eject; no notification */
dataptr[3] = 0xFF; /* no physical drive */
break;
default:
INT_BARF( context, 0x21 );
}
@ -1316,7 +1323,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x02:{
FILE_OBJECT *file;
file = FILE_GetFile(BX_reg(context));
if (!lstrcmpi32A(file->unix_name, "SCSIMGR$"))
if (!strcasecmp(file->unix_name, "SCSIMGR$"))
ASPI_DOS_HandleInt(context);
break;
}

View File

@ -7,6 +7,7 @@ MODULE = multimedia
C_SRCS = \
audio.c \
dplay.c \
dsound.c \
init.c \
joystick.c \

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