Release 980413

Sun Apr 12 12:22:23 1997  Andreas Mohr <100.30936@germany.net>

	* [files/drive.c]
	Fixed "no free space" problem with partition sizes between 1 and 2 GB
	(cluster_sectors may not exceed 0x40).

	* [windows/msgbox.c] [if1632/user.spec] [include/windows.h]
	Implemented MessageBoxIndirect16, corrected MSGBOXPARAMS16.

	* [loader/task.c]
	DOS environment strings may never exceed 127 chars
	-> truncate Unix environment strings if necessary.

Sun Apr 12 02:51:44 1998  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [files/*.c]
	All fprintf statements were converted to appropriate debug
	messages.

	* [tools/find_debug_channels]
	Updated comments at the beginning of the file.

Sat Apr 11 15:27:21 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [loader/module.c] [loader/task.c] [scheduler/process.c]
	Moved some code around to prepare the ground for CreateProcess().

	* [memory/environ.c] [loader/task.c]
	Moved Win32 environment strings functions to environ.c.
	Unified Win16 and Win32 environment management.

	* [scheduler/handle.c] [scheduler/k32obj.c] [scheduler/*.c]
	Implemented handle inheritance and DuplicateHandle().

	* [scheduler/thread.c]
	Create a 16-bit stack for all threads.

	* [windows/dialog.c]
	Implemented DIALOGEX resource format.

Fri Apr 10 20:21:51 1998  Marcus Meissner <marcus@mud.de>

	* [configure.in][include/acconfig.h][*/*][multimedia/*]
	Cleaned up the OSS detection stuff, added some more checks for
	headerfiles/functions.
	Removed a lot of OS specific #ifdefs.
	Lots of dependend multimedia cleanups.

	* [loader/pe_image.c]
	Enhanced comment, added missing reference count increase.

	* [ole/compobj.c]
	Replaced broken StringFromGUID2 by working one.

	* [misc/winsock.c]
	SO_LINGER uses unsigned 16 bit in Win16 and Win32, but unsigned
	int (32bit) for UNIX.

	* [memory/global.c]
	Allow realloc for lockcount 1 too.

Fri Apr 10 15:27:34 1998  Morten Welinder  <terra@diku.dk>

	* [graphics/x11drv/text.c]
	Handle control characters in trace.  Ignore terminating newline.

	* [multimedia/init.c]
	(MULTIMEDIA_Init): Correct allocations.

	* [tools/examine-relay]
 	Tidy up.

	* [windows/syscolor.c]
	Change highlight colour from lightblue to lightgray.  This
	looks correct for menus.

Fri Apr 10 01:49:58 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [configure.in] [Make.rules.in]
	Add check for c2man before using it.

Fri Apr 10 02:59:21 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [DEVELOPERS-HINTS]
	Simple description of adding API calls.

	* [include/wintypes.h] [include/windows.h]
	Get rid of Winelib16, avoid declaring some illegal functions in
	Winelib, add prototypes for some enhanced metafile functions, fix
	GetTextExtentPoint32 declarations.

	* [relay32/gdi32.spec] [objects/enhmetafile.c]
	Cosmetic and functional improvements.

	* [include/wincon.h] [programs/view/*]
	Fixes, improved compatibility with native compilers.

Thu Apr  9 15:48:49 1998  Ulrich Weigand <weigand@informatik.uni-erlangen.de>

	* [win32/kernel32.c]
	Implemented FT_Thunk / FT_Prolog / FT_Exit / FT_PrologPrime.
	Fixed Common32ThkLS thunk function.

	* [tools/build.c] [relay32/relay386.c] [if1632/relay.c]
	Changed relay code to allow register functions to modify stack layout.

	* [memory/selector.c]
	Implemented AllocMappedBuffer / FreeMappedBuffer.

	* [relay32/kernel32.spec] [if1632/kernel.spec] [win32/ordinals.c]
	Added names for undocumented functions.

	* [loader/module.c]
	Bugfix: LoadLibrary16 should *not* silently load 32-bit DLL.

Thu Apr  9 03:54:58 1998  Jim Peterson <jspeter@birch.ee.vt.edu>

	* [windows/keyboard.c]
	Fix an erroneous test in TranslateAccelerator{16,32} for the end
	of the accelerator table.

Thu Apr  8 20:36:28 1998  Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> 

	* [misc/crtdll.c]
	Implement getenv.

	* [misc/commdlg.c]
	Make Get[Save/Open]FileName work in most situations.

	* [misc/lstr.c]
	Use wvsprintf32A instead of vsprintf in FormatMessage32X

	* [misc/version]
	Make NT3.50 a recognised version

	* [graphics/x11drv/graphics.c]
	Change the algorithme to draw arcs

	* [loader/resource.c]
	Return an empty buffer in LoadString32A if no resource found.

	* [win32/code_page.c]
	Try harder to get the right size in MultiByteToWideChar.

	* [win32/process.c]
	Call WinExec32 for CreateProcess32A.

	* [windows/user.c]
	Install default Int0 Handler in InitApp().

Thu Apr  8 19:29:48 1998  Eric Kohl <ekohl@abo.rhein-zeitung.de>

	* [misc/imagelist.c]
	Preliminary fix for drawing selected images.
	Various improvements.

	* [controls/progress.c][include/progress.c][include/commctrl.h]
	Added progress bar messages and styles for IE4.01 (dll version 4.72)
	compatibility.
	Fixed led size problem.

	* [controls/updown.c][include/commctrl.h]
	Added UDM_GETRANGE32 and UDM_SETRANGE32.

	* [objects/oembitmaps.c][include/windows.h][include/bitmaps/*]
	Added Win95 icons and fixed Win95 cursor and restore button bug.
	Now they should be visible. Sorry!!!

	* [relay32/comctl32.spec]
	Added most missing function names.

Tue Apr  6 18:48:36 1998  Matthew Becker <mbecker@glasscity.net>

	* [objects/font.c] [if1632/gdi.spec]
	GetOutlineTextMetrics: stub

	* [objects/text.c]
	GetTextCharset should just call GetTextCharsetInfo.

	* [misc/mpr.c] [relay32/mpr.spec]
	WNetCachePassword: stub

	* [scheduler/thread.c] [relay32/user32.spec]
	AttachThreadInput: stub
	Updated documentation.

	* [objects/palette.c]
	Updated documentation.

Tue Mar 31 17:06:30 1998  James Juran <jrj120@psu.edu>

	* [*/*.c]
	Finished fixing USER32 ordinal numbers in function documentation.

Mon Mar 30 20:27:38 1998  Morten Welinder  <terra@diku.dk>

	* [misc/debugstr.c] [include/debugstr.h]
	Moved _dumpstr from relay32/relay386.c.  Improved control
	character handling.

	* [msdos/int21.c]
	Implement 215E00 -- get machine name.

	* [windows/winpos.c]
	SetWindowPos32: Make an extra sync when mapping managed
	windows.  This makes sure the reconfigure event has been
	handled.  See Mshearts' what's-your-name window.

Mon Mar 30 01:13:50 1998  Alexander V. Lukyanov <lav@long.yar.ru>

	* [Makefile.in]
	Install includes from TOPSRCDIR.
oldstable wine-980413
Alexandre Julliard 1998-04-13 12:21:30 +00:00
parent 54c2711ff6
commit c7c217b31c
187 changed files with 5856 additions and 3133 deletions

View File

@ -1,14 +1,14 @@
This is release 980329 of Wine, the MS Windows emulator. This is still a
This is release 980413 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-980329: (see ChangeLog for details)
- More ImageLists support.
- More Win32 metafile support.
- Still some debugging output changes.
WHAT'S NEW with Wine-980413: (see ChangeLog for details)
- Flat thunks support.
- Many more autoconf checks for better portability.
- DIALOGEX resource support.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -17,10 +17,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980329.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980329.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980329.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980329.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980413.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980413.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980413.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980413.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

214
ChangeLog
View File

@ -1,3 +1,217 @@
----------------------------------------------------------------------
Sun Apr 12 12:22:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/drive.c]
Fixed "no free space" problem with partition sizes between 1 and 2 GB
(cluster_sectors may not exceed 0x40).
* [windows/msgbox.c] [if1632/user.spec] [include/windows.h]
Implemented MessageBoxIndirect16, corrected MSGBOXPARAMS16.
* [loader/task.c]
DOS environment strings may never exceed 127 chars
-> truncate Unix environment strings if necessary.
Sun Apr 12 02:51:44 1998 Dimitrie O. Paun <dimi@mail.cs.toronto.edu>
* [files/*.c]
All fprintf statements were converted to appropriate debug
messages.
* [tools/find_debug_channels]
Updated comments at the beginning of the file.
Sat Apr 11 15:27:21 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/module.c] [loader/task.c] [scheduler/process.c]
Moved some code around to prepare the ground for CreateProcess().
* [memory/environ.c] [loader/task.c]
Moved Win32 environment strings functions to environ.c.
Unified Win16 and Win32 environment management.
* [scheduler/handle.c] [scheduler/k32obj.c] [scheduler/*.c]
Implemented handle inheritance and DuplicateHandle().
* [scheduler/thread.c]
Create a 16-bit stack for all threads.
* [windows/dialog.c]
Implemented DIALOGEX resource format.
Fri Apr 10 20:21:51 1998 Marcus Meissner <marcus@mud.de>
* [configure.in][include/acconfig.h][*/*][multimedia/*]
Cleaned up the OSS detection stuff, added some more checks for
headerfiles/functions.
Removed a lot of OS specific #ifdefs.
Lots of dependend multimedia cleanups.
* [loader/pe_image.c]
Enhanced comment, added missing reference count increase.
* [ole/compobj.c]
Replaced broken StringFromGUID2 by working one.
* [misc/winsock.c]
SO_LINGER uses unsigned 16 bit in Win16 and Win32, but unsigned
int (32bit) for UNIX.
* [memory/global.c]
Allow realloc for lockcount 1 too.
Fri Apr 10 15:27:34 1998 Morten Welinder <terra@diku.dk>
* [graphics/x11drv/text.c]
Handle control characters in trace. Ignore terminating newline.
* [multimedia/init.c]
(MULTIMEDIA_Init): Correct allocations.
* [tools/examine-relay]
Tidy up.
* [windows/syscolor.c]
Change highlight colour from lightblue to lightgray. This
looks correct for menus.
Fri Apr 10 01:49:58 1998 Douglas Ridgway <ridgway@winehq.com>
* [configure.in] [Make.rules.in]
Add check for c2man before using it.
Fri Apr 10 02:59:21 1998 Douglas Ridgway <ridgway@winehq.com>
* [DEVELOPERS-HINTS]
Simple description of adding API calls.
* [include/wintypes.h] [include/windows.h]
Get rid of Winelib16, avoid declaring some illegal functions in
Winelib, add prototypes for some enhanced metafile functions, fix
GetTextExtentPoint32 declarations.
* [relay32/gdi32.spec] [objects/enhmetafile.c]
Cosmetic and functional improvements.
* [include/wincon.h] [programs/view/*]
Fixes, improved compatibility with native compilers.
Thu Apr 9 15:48:49 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [win32/kernel32.c]
Implemented FT_Thunk / FT_Prolog / FT_Exit / FT_PrologPrime.
Fixed Common32ThkLS thunk function.
* [tools/build.c] [relay32/relay386.c] [if1632/relay.c]
Changed relay code to allow register functions to modify stack layout.
* [memory/selector.c]
Implemented AllocMappedBuffer / FreeMappedBuffer.
* [relay32/kernel32.spec] [if1632/kernel.spec] [win32/ordinals.c]
Added names for undocumented functions.
* [loader/module.c]
Bugfix: LoadLibrary16 should *not* silently load 32-bit DLL.
Thu Apr 9 03:54:58 1998 Jim Peterson <jspeter@birch.ee.vt.edu>
* [windows/keyboard.c]
Fix an erroneous test in TranslateAccelerator{16,32} for the end
of the accelerator table.
Thu Apr 8 20:36:28 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [misc/crtdll.c]
Implement getenv.
* [misc/commdlg.c]
Make Get[Save/Open]FileName work in most situations.
* [misc/lstr.c]
Use wvsprintf32A instead of vsprintf in FormatMessage32X
* [misc/version]
Make NT3.50 a recognised version
* [graphics/x11drv/graphics.c]
Change the algorithme to draw arcs
* [loader/resource.c]
Return an empty buffer in LoadString32A if no resource found.
* [win32/code_page.c]
Try harder to get the right size in MultiByteToWideChar.
* [win32/process.c]
Call WinExec32 for CreateProcess32A.
* [windows/user.c]
Install default Int0 Handler in InitApp().
Thu Apr 8 19:29:48 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [misc/imagelist.c]
Preliminary fix for drawing selected images.
Various improvements.
* [controls/progress.c][include/progress.c][include/commctrl.h]
Added progress bar messages and styles for IE4.01 (dll version 4.72)
compatibility.
Fixed led size problem.
* [controls/updown.c][include/commctrl.h]
Added UDM_GETRANGE32 and UDM_SETRANGE32.
* [objects/oembitmaps.c][include/windows.h][include/bitmaps/*]
Added Win95 icons and fixed Win95 cursor and restore button bug.
Now they should be visible. Sorry!!!
* [relay32/comctl32.spec]
Added most missing function names.
Tue Apr 6 18:48:36 1998 Matthew Becker <mbecker@glasscity.net>
* [objects/font.c] [if1632/gdi.spec]
GetOutlineTextMetrics: stub
* [objects/text.c]
GetTextCharset should just call GetTextCharsetInfo.
* [misc/mpr.c] [relay32/mpr.spec]
WNetCachePassword: stub
* [scheduler/thread.c] [relay32/user32.spec]
AttachThreadInput: stub
Updated documentation.
* [objects/palette.c]
Updated documentation.
Tue Mar 31 17:06:30 1998 James Juran <jrj120@psu.edu>
* [*/*.c]
Finished fixing USER32 ordinal numbers in function documentation.
Mon Mar 30 20:27:38 1998 Morten Welinder <terra@diku.dk>
* [misc/debugstr.c] [include/debugstr.h]
Moved _dumpstr from relay32/relay386.c. Improved control
character handling.
* [msdos/int21.c]
Implement 215E00 -- get machine name.
* [windows/winpos.c]
SetWindowPos32: Make an extra sync when mapping managed
windows. This makes sure the reconfigure event has been
handled. See Mshearts' what's-your-name window.
Mon Mar 30 01:13:50 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [Makefile.in]
Install includes from TOPSRCDIR.
----------------------------------------------------------------------
Sun Mar 29 15:18:57 1998 Uwe Bonnes <elektron.ikp.physik.tu-darmstadt.de>

View File

@ -60,6 +60,60 @@ Winelib-specific directories:
programs/ - utilities (Progman, WinHelp)
libtest/ - Winelib test samples
IMPLEMENTING NEW API CALLS
==========================
This is the simple version, and covers only Win32. Win16 is slightly uglier,
because of the Pascal heritage and the segmented memory model.
All of the Win32 APIs known to Wine are listed in [relay32/*.spec]. An
unimplemented call will look like (from gdi32.spec)
269 stub PolyBezierTo
To implement this call, you need to do the following four things.
1. Find the appropriate parameters for the call, and add a prototype to
[include/windows.h]. In this case, it might look like
BOOL32 WINAPI PolyBezierTo32(HDC32, LPCVOID, DWORD);
#define PolyBezierTo WINELIB_NAME(PolyBezierTo)
Note the use of the #define for Winelib. See below for discussion of
function naming conventions.
2. Modify the .spec file to tell Wine that the function has an
implementation, what the parameters look like and what Wine function
to use for the implementation. In Win32, things are simple--everything
is 32-bits. However, the relay code handles pointers and pointers to
strings slightly differently, so you should use 'str' and 'wstr' for
strings, 'ptr' for other pointer types, and 'long' for everything else.
269 stdcall PolyBezierTo(long ptr long) PolyBezierTo32
The 'PolyBezierTo32' at the end of the line is which Wine function to use
for the implementation.
3. Implement the function as a stub. Once you add the function to the .spec
file, you must add the function to the Wine source before it will link.
Add a function called 'PolyBezierTo32' somewhere. Good things to put
into a stub:
o a correct prototype, including the WINAPI
o header comments, including full documentation for the function and
arguments
o A FIXME message and an appropriate return value are good things to
put in a stub.
/************************************************************
* PolyBezierTo32 (GDI32.269) Draw many Bezier curves
*
* BUGS
* Unimplemented
*/
BOOL32 WINAPI PolyBezierTo32(HDC32 hdc, LPCVOID p, DWORD count) {
/* tell the user they've got a substandard implementation */
FIXME(gdi, ":(%x,%p,%d): stub\n", hdc, p, count);
/* some programs may be able to compensate,
if they know what happened */
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE; /* error value */
}
4. Implement and test the function.
MEMORY AND SEGMENTS
===================
@ -147,8 +201,10 @@ the correct 'xxx' function or type for Winelib. When compiling the
emulator, 'xxx' is _not_ defined, meaning that you must always specify
explicitly whether you want the 16-bit or 32-bit version.
Note: if 'xxx' is the same in Win16 and Win32, you can simply use the
same name as Windows.
If 'xxx' is the same in Win16 and Win32, or if 'xxx' is Win16 only,
you can simply use the same name as Windows, i.e. just 'xxx'. If
'xxx' is Win32 only, you can use 'xxx' if there are no strings
involved, otherwise you must use the 'xxx32A' and 'xxx32W' forms.
Examples:
@ -173,7 +229,7 @@ The Winelib user can then say:
RegisterClass( &wc );
and this will use the correct declaration depending on the definition
of the symbols WINELIB16, WINELIB32 and UNICODE.
of the symbols WINELIB and UNICODE.
API ENTRY POINTS

View File

@ -36,7 +36,7 @@ LDCOMBINE = ld -r
AR = ar rc
RM = rm -f
MKDIR = mkdir
C2MAN = c2man
C2MAN = @C2MAN@
BUILD = $(TOPOBJDIR)/tools/build@PROGEXT@
MAKEDEP = $(TOPOBJDIR)/tools/makedep@PROGEXT@
WINERC = $(TOPOBJDIR)/rc/winerc@PROGEXT@

View File

@ -128,7 +128,7 @@ install_lib: install_includes
install_includes: dummy
if [ -d $(includedir) ]; then : ; else $(MKDIR) $(includedir); fi
cd include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
$(ALLSUBDIRS): dummy
@cd $@; $(SUBMAKE)

386
configure vendored
View File

@ -1896,10 +1896,39 @@ else
echo "$ac_t""no" 1>&6
fi
# Extract the first word of "c2man", so it can be a program name with args.
set dummy c2man; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1903: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_C2MAN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$C2MAN"; then
ac_cv_prog_C2MAN="$C2MAN" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_C2MAN="c2man"
break
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_prog_C2MAN" && ac_cv_prog_C2MAN="true"
fi
fi
C2MAN="$ac_cv_prog_C2MAN"
if test -n "$C2MAN"; then
echo "$ac_t""$C2MAN" 1>&6
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for i386_set_ldt in -li386""... $ac_c" 1>&6
echo "configure:1903: checking for i386_set_ldt in -li386" >&5
echo "configure:1932: checking for i386_set_ldt in -li386" >&5
ac_lib_var=`echo i386'_'i386_set_ldt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1907,7 +1936,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li386 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1911 "configure"
#line 1940 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1918,7 +1947,7 @@ int main() {
i386_set_ldt()
; return 0; }
EOF
if { (eval echo configure:1922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1946,7 +1975,7 @@ else
fi
echo $ac_n "checking for iswalnum in -lw""... $ac_c" 1>&6
echo "configure:1950: checking for iswalnum in -lw" >&5
echo "configure:1979: checking for iswalnum in -lw" >&5
ac_lib_var=`echo w'_'iswalnum | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1954,7 +1983,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1958 "configure"
#line 1987 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1965,7 +1994,7 @@ int main() {
iswalnum()
; return 0; }
EOF
if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1993,7 +2022,7 @@ else
fi
echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6
echo "configure:1997: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
echo "configure:2026: checking for XF86DGAQueryExtension in -lXxf86dga" >&5
ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2001,7 +2030,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXxf86dga $X_LIBS -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2005 "configure"
#line 2034 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2012,7 +2041,7 @@ int main() {
XF86DGAQueryExtension()
; return 0; }
EOF
if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2036,18 +2065,66 @@ else
fi
for ac_hdr in sys/soundcard.h machine/soundcard.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2073: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2078 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6
echo "configure:2042: checking "for Open Sound System"" >&5
echo "configure:2111: checking "for Open Sound System"" >&5
if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2047 "configure"
#line 2116 "configure"
#include "confdefs.h"
#include <sys/soundcard.h>
#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
#include <machine/soundcard.h>
#endif
int main() {
/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
@ -2055,75 +2132,33 @@ int main() {
; return 0; }
EOF
if { (eval echo configure:2059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_opensoundsystem="yes"
cat >> confdefs.h <<\EOF
#define HAVE_OSS 1
EOF
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_opensoundsystem="no"
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6
echo $ac_n "checking "for Open Sound System on *BSD"""... $ac_c" 1>&6
echo "configure:2074: checking "for Open Sound System on *BSD"" >&5
if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem_bsd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2079 "configure"
#include "confdefs.h"
#include <machine/soundcard.h>
int main() {
/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
; return 0; }
EOF
if { (eval echo configure:2091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_opensoundsystem_bsd="yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ac_cv_c_opensoundsystem_bsd="no"
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_c_opensoundsystem_bsd" 1>&6
if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
then
cat >> confdefs.h <<\EOF
#define HAVE_OSS 1
EOF
if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
then
cat >> confdefs.h <<\EOF
#define HAVE_MACHINE_SOUNDCARD_H 1
EOF
fi
fi
echo $ac_n "checking "for union semun"""... $ac_c" 1>&6
echo "configure:2122: checking "for union semun"" >&5
echo "configure:2157: checking "for union semun"" >&5
if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2127 "configure"
#line 2162 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/sem.h>
@ -2131,7 +2166,7 @@ int main() {
union semun foo
; return 0; }
EOF
if { (eval echo configure:2135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_union_semun="yes"
else
@ -2159,7 +2194,7 @@ if test "x${GCC}" = "xyes"
then
CFLAGS="$CFLAGS -Wall"
echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
echo "configure:2163: checking "for gcc strength-reduce bug"" >&5
echo "configure:2198: checking "for gcc strength-reduce bug"" >&5
if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2167,7 +2202,7 @@ else
ac_cv_c_gcc_strength_bug="yes"
else
cat > conftest.$ac_ext <<EOF
#line 2171 "configure"
#line 2206 "configure"
#include "confdefs.h"
int main(void) {
@ -2178,7 +2213,7 @@ int main(void) {
exit( Array[1] != -2 );
}
EOF
if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_gcc_strength_bug="no"
else
@ -2201,7 +2236,7 @@ fi
echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
echo "configure:2205: checking "whether external symbols need an underscore prefix"" >&5
echo "configure:2240: checking "whether external symbols need an underscore prefix"" >&5
if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2213,14 +2248,14 @@ _ac_test:
.long 0
EOF
cat > conftest.$ac_ext <<EOF
#line 2217 "configure"
#line 2252 "configure"
#include "confdefs.h"
extern int ac_test;
int main() {
if (ac_test) return 1
; return 0; }
EOF
if { (eval echo configure:2224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_extern_prefix="yes"
else
@ -2244,7 +2279,7 @@ fi
echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6
echo "configure:2248: checking "whether assembler accepts .string"" >&5
echo "configure:2283: checking "whether assembler accepts .string"" >&5
if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2254,14 +2289,14 @@ cat > conftest_asm.s <<EOF
.string "test"
EOF
cat > conftest.$ac_ext <<EOF
#line 2258 "configure"
#line 2293 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_asm_string="yes"
else
@ -2288,21 +2323,21 @@ DLLFLAGS=""
if test "$LIB_TARGET" = "libwine.so.1.0"
then
echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
echo "configure:2292: checking "whether we can build a dll"" >&5
echo "configure:2327: checking "whether we can build a dll"" >&5
if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
cat > conftest.$ac_ext <<EOF
#line 2299 "configure"
#line 2334 "configure"
#include "confdefs.h"
int main() {
return 1
; return 0; }
EOF
if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_c_dll="yes"
else
@ -2328,7 +2363,7 @@ fi
echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6
echo "configure:2332: checking "for reentrant X libraries"" >&5
echo "configure:2367: checking "for reentrant X libraries"" >&5
if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -2369,15 +2404,15 @@ EOF
fi
for ac_func in clone memmove strerror tcgetattr timegm usleep wait4 waitpid
for ac_func in clone getpagesize memmove sigaltstack strerror tcgetattr timegm usleep wait4 waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2376: checking for $ac_func" >&5
echo "configure:2411: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2381 "configure"
#line 2416 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -2400,7 +2435,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2424,21 +2459,21 @@ else
fi
done
for ac_hdr in wctype.h
for ac_hdr in 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
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2432: checking for $ac_hdr" >&5
echo "configure:2467: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2437 "configure"
#line 2472 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2465,12 +2500,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
echo "configure:2469: checking whether stat file-mode macros are broken" >&5
echo "configure:2504: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2474 "configure"
#line 2509 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -2521,12 +2556,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2525: checking for working const" >&5
echo "configure:2560: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2530 "configure"
#line 2565 "configure"
#include "confdefs.h"
int main() {
@ -2575,7 +2610,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:2579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@ -2596,12 +2631,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2600: checking for ANSI C header files" >&5
echo "configure:2635: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2605 "configure"
#line 2640 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -2609,7 +2644,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2626,7 +2661,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2630 "configure"
#line 2665 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@ -2644,7 +2679,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 2648 "configure"
#line 2683 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -2665,7 +2700,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 2669 "configure"
#line 2704 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -2676,7 +2711,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@ -2700,12 +2735,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:2704: checking for size_t" >&5
echo "configure:2739: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2709 "configure"
#line 2744 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@ -2732,6 +2767,160 @@ EOF
fi
echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:2772: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_sizeof_long_long=0
else
cat > conftest.$ac_ext <<EOF
#line 2780 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
FILE *f=fopen("conftestval", "w");
if (!f) exit(1);
fprintf(f, "%d\n", sizeof(long long));
exit(0);
}
EOF
if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
ac_cv_sizeof_long_long=0
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF
echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6
echo "configure:2812: checking "for statfs.f_bavail"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$statfs_bavail" = "xno"
then
wine_cv_statfs_bavail=no
else
cat > conftest.$ac_ext <<EOF
#line 2821 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
int main() {
struct statfs stfs;
stfs.f_bavail++;
; return 0; }
EOF
if { (eval echo configure:2845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bavail=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
wine_cv_statfs_bavail=no
fi
rm -f conftest*
fi
fi
echo "$ac_t""$wine_cv_statfs_bavail" 1>&6
if test "$wine_cv_statfs_bavail" = "yes"
then
cat >> confdefs.h <<\EOF
#define STATFS_HAS_BAVAIL 1
EOF
fi
echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6
echo "configure:2869: checking "for statfs.f_bfree"" >&5
if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$statfs_bfree" = "xno"
then
wine_cv_statfs_bfree=no
else
cat > conftest.$ac_ext <<EOF
#line 2878 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
int main() {
struct statfs stfs;
stfs.f_bfree++;
; return 0; }
EOF
if { (eval echo configure:2902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
wine_cv_statfs_bfree=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
wine_cv_statfs_bfree=no
fi
rm -f conftest*
fi
fi
echo "$ac_t""$wine_cv_statfs_bfree" 1>&6
if test "$wine_cv_statfs_bfree" = "yes"
then
cat >> confdefs.h <<\EOF
#define STATFS_HAS_BFREE 1
EOF
fi
MAKE_RULES=Make.rules
@ -2923,6 +3112,7 @@ s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LN_S@%$LN_S%g
s%@C2MAN@%$C2MAN%g
s%@DLLFLAGS@%$DLLFLAGS%g
/@MAKE_RULES@/r $MAKE_RULES
s%@MAKE_RULES@%%g

View File

@ -46,6 +46,7 @@ AC_PROG_LEX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_CHECK_PROG(C2MAN,c2man,c2man,true)
dnl **** Check for some libraries ****
@ -57,33 +58,28 @@ dnl Check for XFree86 DGA extension
AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11)
dnl **** Check for Open Sound System ****
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CACHE_CHECK("for Open Sound System",
ac_cv_c_opensoundsystem,
AC_TRY_COMPILE([#include <sys/soundcard.h>],[
AC_TRY_COMPILE([
#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
#include <machine/soundcard.h>
#endif
],[
/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
AC_CACHE_CHECK("for Open Sound System on *BSD",
ac_cv_c_opensoundsystem_bsd,
AC_TRY_COMPILE([#include <machine/soundcard.h>],[
/* check for one of the Open Sound System specific SNDCTL_ defines */
#if !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
],ac_cv_c_opensoundsystem_bsd="yes",ac_cv_c_opensoundsystem_bsd="no"))
if test "$ac_cv_c_opensoundsystem" = "yes" -o "$ac_cv_c_opensoundsystem_bsd" = "yes"
then
AC_DEFINE(HAVE_OSS)
if test "$ac_cv_c_opensoundsystem_bsd" = "yes"
then
AC_DEFINE(HAVE_MACHINE_SOUNDCARD_H)
fi
fi
],
ac_cv_c_opensoundsystem="yes"
AC_DEFINE(HAVE_OSS),
ac_cv_c_opensoundsystem="no"
))
dnl **** Check for union semun ****
@ -217,11 +213,74 @@ fi
dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(clone memmove strerror tcgetattr timegm usleep wait4 waitpid)
AC_CHECK_HEADERS(wctype.h)
AC_CHECK_FUNCS(clone getpagesize memmove sigaltstack strerror tcgetattr timegm usleep wait4 waitpid)
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)
AC_HEADER_STAT()
AC_C_CONST()
AC_TYPE_SIZE_T()
AC_CHECK_SIZEOF(long long,0)
dnl **** Dependent checks ****
AC_CACHE_CHECK( "for statfs.f_bavail", wine_cv_statfs_bavail,
[ if test "x$statfs_bavail" = "xno"
then
wine_cv_statfs_bavail=no
else
AC_TRY_COMPILE([
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
],[
struct statfs stfs;
stfs.f_bavail++;
],wine_cv_statfs_bavail=yes,wine_cv_statfs_bavail=no
)
fi ] )
if test "$wine_cv_statfs_bavail" = "yes"
then
AC_DEFINE(STATFS_HAS_BAVAIL)
fi
AC_CACHE_CHECK( "for statfs.f_bfree", wine_cv_statfs_bfree,
[ if test "x$statfs_bfree" = "xno"
then
wine_cv_statfs_bfree=no
else
AC_TRY_COMPILE([
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
],[
struct statfs stfs;
stfs.f_bfree++;
],wine_cv_statfs_bfree=yes,wine_cv_statfs_bfree=no
)
fi ] )
if test "$wine_cv_statfs_bfree" = "yes"
then
AC_DEFINE(STATFS_HAS_BFREE)
fi
dnl **** Generate output files ****

View File

@ -100,7 +100,7 @@ LRESULT WINAPI ButtonWndProc( HWND32 hWnd, UINT32 uMsg,
if (!hbitmapCheckBoxes)
{
BITMAP32 bmp;
hbitmapCheckBoxes = LoadBitmap32A(0, MAKEINTRESOURCE(OBM_CHECKBOXES));
hbitmapCheckBoxes = LoadBitmap32A(0, MAKEINTRESOURCE32A(OBM_CHECKBOXES));
GetObject32A( hbitmapCheckBoxes, sizeof(bmp), &bmp );
checkBoxWidth = bmp.bmWidth / 4;
checkBoxHeight = bmp.bmHeight / 3;

View File

@ -52,7 +52,7 @@ static BOOL32 COMBO_Init()
if( (hDC = CreateCompatibleDC32(0)) )
{
BOOL32 bRet = FALSE;
if( (hComboBmp = LoadBitmap32A(0, MAKEINTRESOURCE(OBM_COMBO))) )
if( (hComboBmp = LoadBitmap32A(0, MAKEINTRESOURCE32A(OBM_COMBO))) )
{
BITMAP32 bm;
HBITMAP32 hPrevB;

View File

@ -114,7 +114,7 @@ HWND16 WINAPI CreateStatusWindow16( INT16 style, LPCSTR text, HWND16 parent,
HWND32 WINAPI CreateStatusWindow32W( INT32 style, LPCWSTR text, HWND32 parent,
UINT32 wid )
{
return CreateWindow32W(STATUSCLASSNAME32W, text, style,
return CreateWindow32W((LPCWSTR)STATUSCLASSNAME32W, text, style,
CW_USEDEFAULT32, CW_USEDEFAULT32,
CW_USEDEFAULT32, CW_USEDEFAULT32,
parent, wid, 0, 0);
@ -156,7 +156,7 @@ void WINAPI InitCommonControls(void)
old_name = class32->lpszClassName;
strcpy( name, (char *)class32->lpszClassName );
class32->lpszClassName = name;
class32->hCursor = LoadCursor32A( 0, (LPCSTR)IDC_ARROW );
class32->hCursor = LoadCursor32A( 0, IDC_ARROW32A );
RegisterClass32A( class32 );
class32->lpszClassName = old_name;
}

View File

@ -160,7 +160,7 @@ LRESULT WINAPI DesktopWndProc( HWND32 hwnd, UINT32 message,
ExitWindows16( 0, 0 );
case WM_SETCURSOR:
return (LRESULT)SetCursor16( LoadCursor16( 0, IDC_ARROW ) );
return (LRESULT)SetCursor16( LoadCursor16( 0, IDC_ARROW16 ) );
}
return 0;

View File

@ -329,9 +329,9 @@ BOOL32 MENU_Init()
0x55, 0, 0xAA, 0 };
/* Load menu bitmaps */
hStdCheck = LoadBitmap32A(0, (LPSTR)MAKEINTRESOURCE(OBM_CHECK));
hStdRadioCheck = LoadBitmap32A(0, (LPSTR)MAKEINTRESOURCE(OBM_RADIOCHECK));
hStdMnArrow = LoadBitmap32A(0, (LPSTR)MAKEINTRESOURCE(OBM_MNARROW));
hStdCheck = LoadBitmap32A(0, MAKEINTRESOURCE32A(OBM_CHECK));
hStdRadioCheck = LoadBitmap32A(0, MAKEINTRESOURCE32A(OBM_RADIOCHECK));
hStdMnArrow = LoadBitmap32A(0, MAKEINTRESOURCE32A(OBM_MNARROW));
if (hStdCheck)
{
@ -2542,7 +2542,7 @@ BOOL16 WINAPI TrackPopupMenu16( HMENU16 hMenu, UINT16 wFlags, INT16 x, INT16 y,
/**********************************************************************
* TrackPopupMenu32 (USER32.548)
* TrackPopupMenu32 (USER32.549)
*/
BOOL32 WINAPI TrackPopupMenu32( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
INT32 nReserved, HWND32 hWnd, const RECT32 *lpRect )
@ -2558,7 +2558,7 @@ BOOL32 WINAPI TrackPopupMenu32( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
}
/**********************************************************************
* TrackPopupMenuEx (USER32.549)
* TrackPopupMenuEx (USER32.550)
*/
BOOL32 WINAPI TrackPopupMenuEx( HMENU32 hMenu, UINT32 wFlags, INT32 x, INT32 y,
HWND32 hWnd, LPTPMPARAMS lpTpm )
@ -2702,7 +2702,7 @@ BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,
/*******************************************************************
* ChangeMenu32A (USER32.22)
* ChangeMenu32A (USER32.23)
*/
BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
UINT32 id, UINT32 flags )
@ -2723,7 +2723,7 @@ BOOL32 WINAPI ChangeMenu32A( HMENU32 hMenu, UINT32 pos, LPCSTR data,
/*******************************************************************
* ChangeMenu32W (USER32.23)
* ChangeMenu32W (USER32.24)
*/
BOOL32 WINAPI ChangeMenu32W( HMENU32 hMenu, UINT32 pos, LPCWSTR data,
UINT32 id, UINT32 flags )
@ -2753,7 +2753,7 @@ BOOL16 WINAPI CheckMenuItem16( HMENU16 hMenu, UINT16 id, UINT16 flags )
/*******************************************************************
* CheckMenuItem32 (USER32.45)
* CheckMenuItem32 (USER32.46)
*/
DWORD WINAPI CheckMenuItem32( HMENU32 hMenu, UINT32 id, UINT32 flags )
{
@ -2779,7 +2779,7 @@ BOOL16 WINAPI EnableMenuItem16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )
/**********************************************************************
* EnableMenuItem32 (USER32.169)
* EnableMenuItem32 (USER32.170)
*/
BOOL32 WINAPI EnableMenuItem32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
{
@ -2827,7 +2827,7 @@ INT16 WINAPI GetMenuString16( HMENU16 hMenu, UINT16 wItemID,
/*******************************************************************
* GetMenuString32A (USER32.267)
* GetMenuString32A (USER32.268)
*/
INT32 WINAPI GetMenuString32A( HMENU32 hMenu, UINT32 wItemID,
LPSTR str, INT32 nMaxSiz, UINT32 wFlags )
@ -2847,7 +2847,7 @@ INT32 WINAPI GetMenuString32A( HMENU32 hMenu, UINT32 wItemID,
/*******************************************************************
* GetMenuString32W (USER32.268)
* GetMenuString32W (USER32.269)
*/
INT32 WINAPI GetMenuString32W( HMENU32 hMenu, UINT32 wItemID,
LPWSTR str, INT32 nMaxSiz, UINT32 wFlags )
@ -2876,7 +2876,7 @@ BOOL16 WINAPI HiliteMenuItem16( HWND16 hWnd, HMENU16 hMenu, UINT16 wItemID,
/**********************************************************************
* HiliteMenuItem32 (USER32.317)
* HiliteMenuItem32 (USER32.318)
*/
BOOL32 WINAPI HiliteMenuItem32( HWND32 hWnd, HMENU32 hMenu, UINT32 wItemID,
UINT32 wHilite )
@ -2903,7 +2903,7 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )
/**********************************************************************
* GetMenuState32 (USER32.266)
* GetMenuState32 (USER32.267)
*/
UINT32 WINAPI GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
{
@ -2942,7 +2942,7 @@ INT16 WINAPI GetMenuItemCount16( HMENU16 hMenu )
/**********************************************************************
* GetMenuItemCount32 (USER32.261)
* GetMenuItemCount32 (USER32.262)
*/
INT32 WINAPI GetMenuItemCount32( HMENU32 hMenu )
{
@ -2969,7 +2969,7 @@ UINT16 WINAPI GetMenuItemID16( HMENU16 hMenu, INT16 nPos )
/**********************************************************************
* GetMenuItemID32 (USER32.262)
* GetMenuItemID32 (USER32.263)
*/
UINT32 WINAPI GetMenuItemID32( HMENU32 hMenu, INT32 nPos )
{
@ -2997,7 +2997,7 @@ BOOL16 WINAPI InsertMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,
/*******************************************************************
* InsertMenu32A (USER32.321)
* InsertMenu32A (USER32.322)
*/
BOOL32 WINAPI InsertMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
UINT32 id, LPCSTR str )
@ -3030,7 +3030,7 @@ BOOL32 WINAPI InsertMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
/*******************************************************************
* InsertMenu32W (USER32.324)
* InsertMenu32W (USER32.325)
*/
BOOL32 WINAPI InsertMenu32W( HMENU32 hMenu, UINT32 pos, UINT32 flags,
UINT32 id, LPCWSTR str )
@ -3058,7 +3058,7 @@ BOOL16 WINAPI AppendMenu16(HMENU16 hMenu, UINT16 flags, UINT16 id, SEGPTR data)
/*******************************************************************
* AppendMenu32A (USER32.4)
* AppendMenu32A (USER32.5)
*/
BOOL32 WINAPI AppendMenu32A( HMENU32 hMenu, UINT32 flags,
UINT32 id, LPCSTR data )
@ -3068,7 +3068,7 @@ BOOL32 WINAPI AppendMenu32A( HMENU32 hMenu, UINT32 flags,
/*******************************************************************
* AppendMenu32W (USER32.5)
* AppendMenu32W (USER32.6)
*/
BOOL32 WINAPI AppendMenu32W( HMENU32 hMenu, UINT32 flags,
UINT32 id, LPCWSTR data )
@ -3087,7 +3087,7 @@ BOOL16 WINAPI RemoveMenu16( HMENU16 hMenu, UINT16 nPos, UINT16 wFlags )
/**********************************************************************
* RemoveMenu32 (USER32.440)
* RemoveMenu32 (USER32.441)
*/
BOOL32 WINAPI RemoveMenu32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags )
{
@ -3132,7 +3132,7 @@ BOOL16 WINAPI DeleteMenu16( HMENU16 hMenu, UINT16 nPos, UINT16 wFlags )
/**********************************************************************
* DeleteMenu32 (USER32.128)
* DeleteMenu32 (USER32.129)
*/
BOOL32 WINAPI DeleteMenu32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags )
{
@ -3159,7 +3159,7 @@ BOOL16 WINAPI ModifyMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,
/*******************************************************************
* ModifyMenu32A (USER32.396)
* ModifyMenu32A (USER32.397)
*/
BOOL32 WINAPI ModifyMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
UINT32 id, LPCSTR str )
@ -3184,7 +3184,7 @@ BOOL32 WINAPI ModifyMenu32A( HMENU32 hMenu, UINT32 pos, UINT32 flags,
/*******************************************************************
* ModifyMenu32W (USER32.397)
* ModifyMenu32W (USER32.398)
*/
BOOL32 WINAPI ModifyMenu32W( HMENU32 hMenu, UINT32 pos, UINT32 flags,
UINT32 id, LPCWSTR str )
@ -3212,7 +3212,7 @@ HMENU16 WINAPI CreatePopupMenu16(void)
/**********************************************************************
* CreatePopupMenu32 (USER32.81)
* CreatePopupMenu32 (USER32.82)
*/
HMENU32 WINAPI CreatePopupMenu32(void)
{
@ -3227,7 +3227,7 @@ HMENU32 WINAPI CreatePopupMenu32(void)
/**********************************************************************
* GetMenuCheckMarkDimensions (USER.417) (USER32.257)
* GetMenuCheckMarkDimensions (USER.417) (USER32.258)
*/
DWORD WINAPI GetMenuCheckMarkDimensions(void)
{
@ -3246,7 +3246,7 @@ BOOL16 WINAPI SetMenuItemBitmaps16( HMENU16 hMenu, UINT16 nPos, UINT16 wFlags,
/**********************************************************************
* SetMenuItemBitmaps32 (USER32.489)
* SetMenuItemBitmaps32 (USER32.490)
*/
BOOL32 WINAPI SetMenuItemBitmaps32( HMENU32 hMenu, UINT32 nPos, UINT32 wFlags,
HBITMAP32 hNewUnCheck, HBITMAP32 hNewCheck)
@ -3280,7 +3280,7 @@ HMENU16 WINAPI CreateMenu16(void)
/**********************************************************************
* CreateMenu32 (USER32.80)
* CreateMenu32 (USER32.81)
*/
HMENU32 WINAPI CreateMenu32(void)
{
@ -3312,7 +3312,7 @@ BOOL16 WINAPI DestroyMenu16( HMENU16 hMenu )
/**********************************************************************
* DestroyMenu32 (USER32.133)
* DestroyMenu32 (USER32.134)
*/
BOOL32 WINAPI DestroyMenu32( HMENU32 hMenu )
{
@ -3364,7 +3364,7 @@ HMENU16 WINAPI GetSystemMenu16( HWND16 hWnd, BOOL16 bRevert )
/**********************************************************************
* GetSystemMenu32 (USER32.290)
* GetSystemMenu32 (USER32.291)
*/
HMENU32 WINAPI GetSystemMenu32( HWND32 hWnd, BOOL32 bRevert )
{
@ -3408,7 +3408,7 @@ BOOL16 WINAPI SetSystemMenu16( HWND16 hwnd, HMENU16 hMenu )
/*******************************************************************
* SetSystemMenu32 (USER32.507)
* SetSystemMenu32 (USER32.508)
*/
BOOL32 WINAPI SetSystemMenu32( HWND32 hwnd, HMENU32 hMenu )
{
@ -3437,7 +3437,7 @@ HMENU16 WINAPI GetMenu16( HWND16 hWnd )
/**********************************************************************
* GetMenu32 (USER32.256)
* GetMenu32 (USER32.257)
*/
HMENU32 WINAPI GetMenu32( HWND32 hWnd )
{
@ -3458,7 +3458,7 @@ BOOL16 WINAPI SetMenu16( HWND16 hWnd, HMENU16 hMenu )
/**********************************************************************
* SetMenu32 (USER32.486)
* SetMenu32 (USER32.487)
*/
BOOL32 WINAPI SetMenu32( HWND32 hWnd, HMENU32 hMenu )
{
@ -3500,7 +3500,7 @@ HMENU16 WINAPI GetSubMenu16( HMENU16 hMenu, INT16 nPos )
/**********************************************************************
* GetSubMenu32 (USER32.287)
* GetSubMenu32 (USER32.288)
*/
HMENU32 WINAPI GetSubMenu32( HMENU32 hMenu, INT32 nPos )
{
@ -3523,7 +3523,7 @@ void WINAPI DrawMenuBar16( HWND16 hWnd )
/**********************************************************************
* DrawMenuBar32 (USER32.160)
* DrawMenuBar32 (USER32.161)
*/
BOOL32 WINAPI DrawMenuBar32( HWND32 hWnd )
{
@ -3544,7 +3544,7 @@ BOOL32 WINAPI DrawMenuBar32( HWND32 hWnd )
/***********************************************************************
* EndMenu (USER.187) (USER32.174)
* EndMenu (USER.187) (USER32.175)
*/
void WINAPI EndMenu(void)
{
@ -3589,7 +3589,7 @@ HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name )
return LoadMenu32A(instance,PTR_SEG_TO_LIN(name));
instance = GetExePtr( instance );
if (!(hRsrc = FindResource16( instance, name, RT_MENU ))) return 0;
if (!(hRsrc = FindResource16( instance, name, RT_MENU16 ))) return 0;
if (!(handle = LoadResource16( instance, hRsrc ))) return 0;
hMenu = LoadMenuIndirect16(LockResource16(handle));
FreeResource16( handle );
@ -3602,18 +3602,18 @@ HMENU16 WINAPI LoadMenu16( HINSTANCE16 instance, SEGPTR name )
*/
HMENU32 WINAPI LoadMenu32A( HINSTANCE32 instance, LPCSTR name )
{
HRSRC32 hrsrc = FindResource32A( instance, name, (LPSTR)RT_MENU );
HRSRC32 hrsrc = FindResource32A( instance, name, RT_MENU32A );
if (!hrsrc) return 0;
return LoadMenuIndirect32A( (LPCVOID)LoadResource32( instance, hrsrc ));
}
/*****************************************************************
* LoadMenu32W (USER32.372)
* LoadMenu32W (USER32.373)
*/
HMENU32 WINAPI LoadMenu32W( HINSTANCE32 instance, LPCWSTR name )
{
HRSRC32 hrsrc = FindResource32W( instance, name, (LPWSTR)RT_MENU );
HRSRC32 hrsrc = FindResource32W( instance, name, RT_MENU32W );
if (!hrsrc) return 0;
return LoadMenuIndirect32W( (LPCVOID)LoadResource32( instance, hrsrc ));
}
@ -3649,7 +3649,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
/**********************************************************************
* LoadMenuIndirect32A (USER32.370)
* LoadMenuIndirect32A (USER32.371)
*/
HMENU32 WINAPI LoadMenuIndirect32A( LPCVOID template )
{
@ -3690,7 +3690,7 @@ HMENU32 WINAPI LoadMenuIndirect32A( LPCVOID template )
/**********************************************************************
* LoadMenuIndirect32W (USER32.371)
* LoadMenuIndirect32W (USER32.372)
*/
HMENU32 WINAPI LoadMenuIndirect32W( LPCVOID template )
{
@ -3710,7 +3710,7 @@ BOOL16 WINAPI IsMenu16( HMENU16 hmenu )
/**********************************************************************
* IsMenu32 (USER32.345)
* IsMenu32 (USER32.346)
*/
BOOL32 WINAPI IsMenu32(HMENU32 hmenu)
{
@ -3775,7 +3775,7 @@ static BOOL32 GetMenuItemInfo32_common ( HMENU32 hmenu, UINT32 item,
}
/**********************************************************************
* GetMenuItemInfo32A (USER32.263)
* GetMenuItemInfo32A (USER32.264)
*/
BOOL32 WINAPI GetMenuItemInfo32A( HMENU32 hmenu, UINT32 item, BOOL32 bypos,
LPMENUITEMINFO32A lpmii)
@ -3784,7 +3784,7 @@ BOOL32 WINAPI GetMenuItemInfo32A( HMENU32 hmenu, UINT32 item, BOOL32 bypos,
}
/**********************************************************************
* GetMenuItemInfo32W (USER32.264)
* GetMenuItemInfo32W (USER32.265)
*/
BOOL32 WINAPI GetMenuItemInfo32W( HMENU32 hmenu, UINT32 item, BOOL32 bypos,
LPMENUITEMINFO32W lpmii)
@ -3840,7 +3840,7 @@ static BOOL32 SetMenuItemInfo32_common(MENUITEM * menu,
}
/**********************************************************************
* SetMenuItemInfo32A (USER32.490)
* SetMenuItemInfo32A (USER32.491)
*/
BOOL32 WINAPI SetMenuItemInfo32A(HMENU32 hmenu, UINT32 item, BOOL32 bypos,
const MENUITEMINFO32A *lpmii)
@ -3850,7 +3850,7 @@ BOOL32 WINAPI SetMenuItemInfo32A(HMENU32 hmenu, UINT32 item, BOOL32 bypos,
}
/**********************************************************************
* SetMenuItemInfo32W (USER32.491)
* SetMenuItemInfo32W (USER32.492)
*/
BOOL32 WINAPI SetMenuItemInfo32W(HMENU32 hmenu, UINT32 item, BOOL32 bypos,
const MENUITEMINFO32W *lpmii)
@ -3860,7 +3860,7 @@ BOOL32 WINAPI SetMenuItemInfo32W(HMENU32 hmenu, UINT32 item, BOOL32 bypos,
}
/**********************************************************************
* SetMenuDefaultItem32 (USER32.488)
* SetMenuDefaultItem32 (USER32.489)
*/
BOOL32 WINAPI SetMenuDefaultItem32(HMENU32 hmenu, UINT32 item, BOOL32 bypos)
{
@ -3900,7 +3900,7 @@ BOOL16 WINAPI InsertMenuItem16( HMENU16 hmenu, UINT16 pos, BOOL16 byposition,
/**********************************************************************
* InsertMenuItem32A (USER32.322)
* InsertMenuItem32A (USER32.323)
*/
BOOL32 WINAPI InsertMenuItem32A(HMENU32 hMenu, UINT32 uItem, BOOL32 bypos,
const MENUITEMINFO32A *lpmii)
@ -3911,7 +3911,7 @@ BOOL32 WINAPI InsertMenuItem32A(HMENU32 hMenu, UINT32 uItem, BOOL32 bypos,
/**********************************************************************
* InsertMenuItem32W (USER32.323)
* InsertMenuItem32W (USER32.324)
*/
BOOL32 WINAPI InsertMenuItem32W(HMENU32 hMenu, UINT32 uItem, BOOL32 bypos,
const MENUITEMINFO32W *lpmii)

View File

@ -5,8 +5,6 @@
*
* TODO:
* - I do not know what to to on WM_[SG]ET_FONT
* Problems:
* - I think I do not compute correctly the numer of leds to be drawn
*/
#include <stdlib.h>
@ -21,7 +19,6 @@
/* Control configuration constants */
#define LED_WIDTH 8
#define LED_GAP 2
/* Work constants */
@ -41,8 +38,8 @@
static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
{
PROGRESS_INFO *infoPtr = PROGRESS_GetInfoPtr(wndPtr);
HBRUSH32 ledBrush;
int rightBar, rightMost;
HBRUSH32 hbrBar, hbrBk;
int rightBar, rightMost, ledWidth;
PAINTSTRUCT32 ps;
RECT32 rect;
HDC32 hdc;
@ -53,29 +50,90 @@ static void PROGRESS_Paint(WND *wndPtr, HDC32 dc)
/* get a dc */
hdc = dc==0 ? BeginPaint32(wndPtr->hwndSelf, &ps) : dc;
/* get the required brush */
ledBrush = GetSysColorBrush32(COLOR_HIGHLIGHT);
/* get the required bar brush */
if (infoPtr->ColorBar == CLR_DEFAULT)
hbrBar = GetSysColorBrush32(COLOR_HIGHLIGHT);
else
hbrBar = CreateSolidBrush32 (infoPtr->ColorBar);
/* get the required background brush */
if (infoPtr->ColorBk != CLR_DEFAULT)
hbrBk = CreateSolidBrush32 (infoPtr->ColorBk);
else
hbrBk = 0; /* to keep the compiler happy ;-) */
/* get rect for the bar, adjusted for the border */
GetClientRect32(wndPtr->hwndSelf, &rect);
GetClientRect32 (wndPtr->hwndSelf, &rect);
/* Hack because of missing top border */
rect.top++;
/* draw the border */
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST|BF_MIDDLE);
if (infoPtr->ColorBk == CLR_DEFAULT)
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST|BF_MIDDLE);
else
{
DrawEdge32(hdc, &rect, BDR_SUNKENOUTER, BF_RECT|BF_ADJUST);
FillRect32(hdc, &rect, hbrBk);
}
rect.left++; rect.right--; rect.top++; rect.bottom--;
rightMost = rect.right;
/* compute extent of progress bar */
rightBar = rect.left +
MulDiv32(infoPtr->CurVal-infoPtr->MinVal,
rect.right - rect.left,
infoPtr->MaxVal-infoPtr->MinVal);
if (wndPtr->dwStyle & PBS_VERTICAL)
{
rightBar = rect.bottom -
MulDiv32(infoPtr->CurVal-infoPtr->MinVal,
rect.bottom - rect.top,
infoPtr->MaxVal-infoPtr->MinVal);
ledWidth = MulDiv32 ((rect.right - rect.left), 2, 3);
rightMost = rect.top;
}
else
{
rightBar = rect.left +
MulDiv32(infoPtr->CurVal-infoPtr->MinVal,
rect.right - rect.left,
infoPtr->MaxVal-infoPtr->MinVal);
ledWidth = MulDiv32 ((rect.bottom - rect.top), 2, 3);
rightMost = rect.right;
}
/* now draw the bar */
while(rect.left < rightBar) {
rect.right = rect.left+LED_WIDTH;
FillRect32(hdc, &rect, ledBrush);
rect.left = rect.right+LED_GAP;
if (wndPtr->dwStyle & PBS_SMOOTH)
{
if (wndPtr->dwStyle & PBS_VERTICAL)
rect.top = rightBar;
else
rect.right = rightBar;
FillRect32(hdc, &rect, hbrBar);
}
else
{
if (wndPtr->dwStyle & PBS_VERTICAL)
while(rect.bottom > rightBar) {
rect.top = rect.bottom-ledWidth;
if (rect.top < rightMost)
rect.top = rightMost;
FillRect32(hdc, &rect, hbrBar);
rect.bottom = rect.top-LED_GAP;
}
else
while(rect.left < rightBar) {
rect.right = rect.left+ledWidth;
if (rect.right > rightMost)
rect.right = rightMost;
FillRect32(hdc, &rect, hbrBar);
rect.left = rect.right+LED_GAP;
}
}
/* delete bar brush */
if (infoPtr->ColorBar != CLR_DEFAULT)
DeleteObject32 (hbrBar);
/* delete background brush */
if (infoPtr->ColorBk != CLR_DEFAULT)
DeleteObject32 (hbrBk);
/* clean-up */
if(!dc)
@ -114,6 +172,8 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
infoPtr->MaxVal=100;
infoPtr->CurVal=0;
infoPtr->Step=10;
infoPtr->ColorBar=CLR_DEFAULT;
infoPtr->ColorBk=CLR_DEFAULT;
TRACE(updown, "Progress Ctrl creation, hwnd=%04x\n", hwnd);
break;
@ -145,7 +205,9 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(wParam != 0){
infoPtr->CurVal += (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
PROGRESS_Paint(wndPtr, 0);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
// PROGRESS_Paint(wndPtr, 0);
}
return temp;
@ -156,7 +218,8 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(temp != wParam){
infoPtr->CurVal = (UINT16)wParam;
PROGRESS_CoercePos(wndPtr);
PROGRESS_Paint(wndPtr, 0);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
}
return temp;
@ -170,7 +233,8 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
PROGRESS_Paint(wndPtr, 0);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
}
return temp;
@ -189,9 +253,54 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
if(infoPtr->CurVal > infoPtr->MaxVal)
infoPtr->CurVal = infoPtr->MinVal;
if(temp != infoPtr->CurVal)
PROGRESS_Paint(wndPtr, 0);
{
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
}
return temp;
case PBM_SETRANGE32:
temp = MAKELONG(infoPtr->MinVal, infoPtr->MaxVal);
if((infoPtr->MinVal != (INT32)wParam) ||
(infoPtr->MaxVal != (INT32)lParam)) {
infoPtr->MinVal = (INT32)wParam;
infoPtr->MaxVal = (INT32)lParam;
if(infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal+1;
PROGRESS_CoercePos(wndPtr);
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
}
return temp;
case PBM_GETRANGE:
if (lParam){
((PPBRANGE)lParam)->iLow = infoPtr->MinVal;
((PPBRANGE)lParam)->iHigh = infoPtr->MaxVal;
}
return (wParam) ? infoPtr->MinVal : infoPtr->MaxVal;
case PBM_GETPOS:
if (wParam || lParam)
UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
return (infoPtr->CurVal);
case PBM_SETBARCOLOR:
if (wParam)
UNKNOWN_PARAM(PBM_SETBARCOLOR, wParam, lParam);
infoPtr->ColorBar = (COLORREF)lParam;
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
break;
case PBM_SETBKCOLOR:
if (wParam)
UNKNOWN_PARAM(PBM_SETBKCOLOR, wParam, lParam);
infoPtr->ColorBk = (COLORREF)lParam;
InvalidateRect32 (hwnd, NULL, FALSE);
UpdateWindow32 (hwnd);
break;
default:
if (message >= WM_USER)
ERR(progress, "unknown msg %04x wp=%04x lp=%08lx\n",
@ -202,5 +311,3 @@ LRESULT WINAPI ProgressWindowProc(HWND32 hwnd, UINT32 message,
return 0;
}

View File

@ -81,18 +81,18 @@ static BOOL32 SCROLL_MovingThumb = FALSE;
*/
static void SCROLL_LoadBitmaps(void)
{
hUpArrow = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_UPARROW) );
hDnArrow = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_DNARROW) );
hLfArrow = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_LFARROW) );
hRgArrow = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_RGARROW) );
hUpArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_UPARROWD) );
hDnArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_DNARROWD) );
hLfArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_LFARROWD) );
hRgArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_RGARROWD) );
hUpArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_UPARROWI) );
hDnArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_DNARROWI) );
hLfArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_LFARROWI) );
hRgArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE(OBM_RGARROWI) );
hUpArrow = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_UPARROW) );
hDnArrow = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_DNARROW) );
hLfArrow = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_LFARROW) );
hRgArrow = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_RGARROW) );
hUpArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_UPARROWD) );
hDnArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_DNARROWD) );
hLfArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_LFARROWD) );
hRgArrowD = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_RGARROWD) );
hUpArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_UPARROWI) );
hDnArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_DNARROWI) );
hLfArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_LFARROWI) );
hRgArrowI = LoadBitmap32A( 0, MAKEINTRESOURCE32A(OBM_RGARROWI) );
}
@ -1018,7 +1018,7 @@ BOOL16 WINAPI GetScrollInfo16( HWND16 hwnd, INT16 nBar, LPSCROLLINFO info )
/*************************************************************************
* GetScrollInfo32 (USER32.283)
* GetScrollInfo32 (USER32.284)
*/
BOOL32 WINAPI GetScrollInfo32( HWND32 hwnd, INT32 nBar, LPSCROLLINFO info )
{
@ -1082,7 +1082,7 @@ INT16 WINAPI GetScrollPos16( HWND16 hwnd, INT16 nBar )
/*************************************************************************
* GetScrollPos32 (USER32.284)
* GetScrollPos32 (USER32.285)
*/
INT32 WINAPI GetScrollPos32( HWND32 hwnd, INT32 nBar )
{
@ -1171,7 +1171,7 @@ BOOL16 WINAPI GetScrollRange16( HWND16 hwnd, INT16 nBar,
/*************************************************************************
* GetScrollRange32 (USER32.285)
* GetScrollRange32 (USER32.286)
*/
BOOL32 WINAPI GetScrollRange32( HWND32 hwnd, INT32 nBar,
LPINT32 lpMin, LPINT32 lpMax)
@ -1200,7 +1200,7 @@ void WINAPI ShowScrollBar16( HWND16 hwnd, INT16 nBar, BOOL16 fShow )
/*************************************************************************
* ShowScrollBar32 (USER32.531)
* ShowScrollBar32 (USER32.532)
*/
BOOL32 WINAPI ShowScrollBar32( HWND32 hwnd, INT32 nBar, BOOL32 fShow )
{
@ -1276,7 +1276,7 @@ BOOL16 WINAPI EnableScrollBar16( HWND16 hwnd, INT16 nBar, UINT16 flags )
/*************************************************************************
* EnableScrollBar32 (USER32.170)
* EnableScrollBar32 (USER32.171)
*/
BOOL32 WINAPI EnableScrollBar32( HWND32 hwnd, INT32 nBar, UINT32 flags )
{

View File

@ -558,7 +558,7 @@ BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
}
/**********************************************************************
* DrawEdge32 (USER32.154)
* DrawEdge32 (USER32.155)
*/
BOOL32 WINAPI DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
@ -1364,7 +1364,7 @@ BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType,
/**********************************************************************
* DrawFrameControl32 (USER32.157)
* DrawFrameControl32 (USER32.158)
*/
BOOL32 WINAPI DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 uType,
UINT32 uState )

View File

@ -105,7 +105,7 @@ static BOOL32 UPDOWN_OffsetVal(WND *wndPtr, int delta)
}
/***********************************************************************
* UPDOWN_GetArrawRect
* UPDOWN_GetArrowRect
* wndPtr - pointer to the up-down wnd
* rect - will hold the rectangle
* incr - TRUE get the "increment" rect (up or right)
@ -759,6 +759,22 @@ LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
infoPtr->MinVal, infoPtr->MaxVal, hwnd);
break;
case UDM_GETRANGE32:
if (wParam)
*(LPINT32)wParam = infoPtr->MinVal;
if (lParam)
*(LPINT32)lParam = infoPtr->MaxVal;
break;
case UDM_SETRANGE32:
infoPtr->MinVal = (INT32)wParam;
infoPtr->MaxVal = (INT32)lParam;
if (infoPtr->MaxVal <= infoPtr->MinVal)
infoPtr->MaxVal = infoPtr->MinVal + 1;
TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
infoPtr->MinVal, infoPtr->MaxVal, hwnd);
break;
default:
if (message >= WM_USER)
WARN(updown, "unknown msg %04x wp=%04x lp=%08lx\n",

View File

@ -38,40 +38,45 @@ static WNDCLASS32A WIDGETS_BuiltinClasses[BIC32_NB_CLASSES] =
{
/* BIC32_BUTTON */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, IDC_ARROW, 0, 0, "Button" },
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0,
(HCURSOR32)IDC_ARROW32A, 0, 0, "Button" },
/* BIC32_EDIT */
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
EditWndProc, 0, sizeof(void *), 0, 0, IDC_IBEAM, 0, 0, "Edit" },
EditWndProc, 0, sizeof(void *), 0, 0,
(HCURSOR32)IDC_IBEAM32A, 0, 0, "Edit" },
/* BIC32_LISTBOX */
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
ListBoxWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ListBox" },
ListBoxWndProc, 0, sizeof(void *), 0, 0,
(HCURSOR32)IDC_ARROW32A, 0, 0, "ListBox" },
/* BIC32_COMBO */
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
ComboWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboBox" },
ComboWndProc, 0, sizeof(void *), 0, 0,
(HCURSOR32)IDC_ARROW32A, 0, 0, "ComboBox" },
/* BIC32_COMBOLB */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
ComboLBWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboLBox" },
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS, ComboLBWndProc,
0, sizeof(void *), 0, 0, (HCURSOR32)IDC_ARROW32A, 0, 0, "ComboLBox" },
/* BIC32_POPUPMENU */
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0,
sizeof(HMENU32), 0, 0, IDC_ARROW, NULL_BRUSH, 0, POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc, 0, sizeof(HMENU32),
0, 0, (HCURSOR32)IDC_ARROW32A, NULL_BRUSH, 0, POPUPMENU_CLASS_NAME },
/* BIC32_STATIC */
{ CS_GLOBALCLASS | CS_PARENTDC, StaticWndProc,
0, sizeof(STATICINFO), 0, 0, IDC_ARROW, 0, 0, "Static" },
0, sizeof(STATICINFO), 0, 0, (HCURSOR32)IDC_ARROW32A, 0, 0, "Static" },
/* BIC32_SCROLL */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, IDC_ARROW, 0, 0, "ScrollBar"},
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0,
(HCURSOR32)IDC_ARROW32A, 0, 0, "ScrollBar"},
/* BIC32_MDICLIENT */
{ CS_GLOBALCLASS, MDIClientWndProc,
0, sizeof(MDICLIENTINFO), 0, 0, 0, STOCK_LTGRAY_BRUSH, 0, "MDIClient" },
/* BIC32_DESKTOP */
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, IDC_ARROW, 0, 0, DESKTOP_CLASS_NAME },
0, 0, (HCURSOR32)IDC_ARROW32A, 0, 0, DESKTOP_CLASS_NAME },
/* BIC32_DIALOG */
{ CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProc32A, 0, DLGWINDOWEXTRA,
0, 0, IDC_ARROW, 0, 0, DIALOG_CLASS_NAME },
0, 0, (HCURSOR32)IDC_ARROW32A, 0, 0, DIALOG_CLASS_NAME },
/* BIC32_ICONTITLE */
{ CS_GLOBALCLASS, IconTitleWndProc, 0, 0,
0, 0, IDC_ARROW, 0, 0, ICONTITLE_CLASS_NAME }
0, 0, (HCURSOR32)IDC_ARROW32A, 0, 0, ICONTITLE_CLASS_NAME }
};
static ATOM bicAtomTable[BIC32_NB_CLASSES];

View File

@ -83,7 +83,9 @@ relevant developer as feasonable.
6. If that isn't enough add more debug output for yourself into the
functions you find relevant.
You might also try to run the program in gdb instead of using the
WINE-debugger.
WINE-debugger. If you don't use the "-desktop" or "-managed" option,
start the WINE process with "-sync", or chances are good to get X into
an unusable state.
7. You can also set a breakpoint for that function. Start wine with the
"-debug" option added to the commandline. After loading the executable

View File

@ -4,6 +4,7 @@
* Copyright 1995 Alexandre Julliard
*/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@ -20,18 +21,9 @@
#include "options.h"
#include "debug.h"
#define MAX_PATH_ELEMENTS 20
static DOS_FULL_NAME DIR_Windows;
static DOS_FULL_NAME DIR_System;
static char *DIR_WindowsDosDir;
static char *DIR_WindowsUnixDir;
static char *DIR_SystemDosDir;
static char *DIR_SystemUnixDir;
static char *DIR_TempDosDir;
static char *DIR_TempUnixDir;
static char *DIR_DosPath[MAX_PATH_ELEMENTS]; /* Path in DOS format */
static char *DIR_UnixPath[MAX_PATH_ELEMENTS]; /* Path in Unix format */
static int DIR_PathElements = 0;
/***********************************************************************
* DIR_GetPath
@ -39,78 +31,30 @@ static int DIR_PathElements = 0;
* Get a path name from the wine.ini file and make sure it is valid.
*/
static int DIR_GetPath( const char *keyname, const char *defval,
char **dos_path, char **unix_path )
DOS_FULL_NAME *full_name )
{
char path[MAX_PATHNAME_LEN];
DOS_FULL_NAME full_name;
BY_HANDLE_FILE_INFORMATION info;
PROFILE_GetWineIniString( "wine", keyname, defval, path, sizeof(path) );
if (!DOSFS_GetFullName( path, TRUE, &full_name ) ||
!FILE_Stat( full_name.long_name, &info ) ||
if (!DOSFS_GetFullName( path, TRUE, full_name ) ||
!FILE_Stat( full_name->long_name, &info ) ||
!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
fprintf(stderr, "Invalid path '%s' for %s directory\n", path, keyname);
MSG("Invalid path '%s' for %s directory\n", path, keyname);
return 0;
}
*unix_path = HEAP_strdupA( SystemHeap, 0, full_name.long_name );
*dos_path = HEAP_strdupA( SystemHeap, 0, full_name.short_name );
return 1;
}
/***********************************************************************
* DIR_ParseWindowsPath
*/
void DIR_ParseWindowsPath( char *path )
{
char *p;
DOS_FULL_NAME full_name;
BY_HANDLE_FILE_INFORMATION info;
int i;
for ( ; path && *path; path = p)
{
p = strchr( path, ';' );
if (p) while (*p == ';') *p++ = '\0';
if (DIR_PathElements >= MAX_PATH_ELEMENTS)
{
fprintf( stderr, "Warning: path has more than %d elements.\n",
MAX_PATH_ELEMENTS );
break;
}
if (!DOSFS_GetFullName( path, TRUE, &full_name ) ||
!FILE_Stat( full_name.long_name, &info ) ||
!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
fprintf(stderr,"Warning: invalid dir '%s' in path, deleting it.\n",
path );
continue;
}
DIR_UnixPath[DIR_PathElements] = HEAP_strdupA( SystemHeap, 0,
full_name.long_name );
DIR_DosPath[DIR_PathElements] = HEAP_strdupA( SystemHeap, 0,
full_name.short_name );
DIR_PathElements++;
}
if (TRACE_ON(dosfs))
for (i = 0; i < DIR_PathElements; i++)
{
TRACE(dosfs, "Path[%d]: %s = %s\n",
i, DIR_DosPath[i], DIR_UnixPath[i] );
}
}
/***********************************************************************
* DIR_Init
*/
int DIR_Init(void)
{
char path[MAX_PATHNAME_LEN], *env_p;
char path[MAX_PATHNAME_LEN];
DOS_FULL_NAME tmp_dir;
int drive;
const char *cwd;
@ -122,8 +66,8 @@ int DIR_Init(void)
cwd = path;
if ((drive = DRIVE_FindDriveRoot( &cwd )) == -1)
{
fprintf( stderr, "Warning: could not find DOS drive for cwd %s; starting in windows directory.\n",
cwd );
MSG("Warning: could not find DOS drive for cwd %s; "
"starting in windows directory.\n", cwd );
}
else
{
@ -131,50 +75,47 @@ int DIR_Init(void)
DRIVE_Chdir( drive, cwd );
}
if (!(DIR_GetPath( "windows", "c:\\windows",
&DIR_WindowsDosDir, &DIR_WindowsUnixDir ))) return 0;
if (!(DIR_GetPath( "system", "c:\\windows\\system",
&DIR_SystemDosDir, &DIR_SystemUnixDir ))) return 0;
if (!(DIR_GetPath( "temp", "c:\\windows",
&DIR_TempDosDir, &DIR_TempUnixDir ))) return 0;
if (-1==access(DIR_TempUnixDir,W_OK)) {
if (!(DIR_GetPath( "windows", "c:\\windows", &DIR_Windows )))
return 0;
if (!(DIR_GetPath( "system", "c:\\windows\\system", &DIR_System )))
return 0;
if (!(DIR_GetPath( "temp", "c:\\windows", &tmp_dir )))
return 0;
if (-1 == access( tmp_dir.long_name, W_OK ))
{
if (errno==EACCES)
fprintf(stderr,"Warning: The Temporary Directory (as specified in wine.conf) is NOT writeable. Please check your configuration.\n");
MSG("Warning: The Temporary Directory (as specified in wine.conf) is NOT writeable. Please check your configuration.\n");
else
fprintf(stderr,"Warning: Access to Temporary Directory failed (%s).\n",strerror(errno));
MSG("Warning: Access to Temporary Directory failed (%s).\n",
strerror(errno));
}
if (drive == -1)
{
drive = DIR_WindowsDosDir[0] - 'A';
drive = DIR_Windows.drive;
DRIVE_SetCurrentDrive( drive );
DRIVE_Chdir( drive, DIR_WindowsDosDir + 2 );
DRIVE_Chdir( drive, DIR_Windows.short_name + 2 );
}
PROFILE_GetWineIniString("wine", "path", "c:\\windows;c:\\windows\\system",
path, sizeof(path) );
DIR_ParseWindowsPath( path );
TRACE(dosfs, "WindowsDir = %s\n", DIR_WindowsDosDir);
TRACE(dosfs, "SystemDir = %s\n", DIR_SystemDosDir);
TRACE(dosfs, "TempDir = %s\n", DIR_TempDosDir);
/* Set the environment variables */
SetEnvironmentVariable32A( "PATH", path );
SetEnvironmentVariable32A( "TEMP", tmp_dir.short_name );
SetEnvironmentVariable32A( "windir", DIR_Windows.short_name );
SetEnvironmentVariable32A( "winsysdir", DIR_System.short_name );
TRACE(dosfs, "WindowsDir = %s (%s)\n",
DIR_Windows.short_name, DIR_Windows.long_name );
TRACE(dosfs, "SystemDir = %s (%s)\n",
DIR_System.short_name, DIR_System.long_name );
TRACE(dosfs, "TempDir = %s (%s)\n",
tmp_dir.short_name, tmp_dir.long_name );
TRACE(dosfs, "Path = %s\n", path );
TRACE(dosfs, "Cwd = %c:\\%s\n",
'A' + drive, DRIVE_GetDosCwd( drive ) );
/* Put the temp and Windows and system directories into the environment */
env_p = HEAP_xalloc( SystemHeap, 0, strlen(DIR_TempDosDir) + 6 );
strcpy( env_p, "TEMP=" );
strcpy( env_p + 5, DIR_TempDosDir );
putenv( env_p );
env_p = HEAP_xalloc( SystemHeap, 0, strlen(DIR_WindowsDosDir) + 8 );
strcpy( env_p, "windir=" );
strcpy( env_p + 7, DIR_WindowsDosDir );
putenv( env_p );
env_p = HEAP_xalloc( SystemHeap, 0, strlen(DIR_SystemDosDir) + 11 );
strcpy( env_p, "winsysdir=" );
strcpy( env_p + 10, DIR_SystemDosDir );
putenv( env_p );
'A' + drive, DRIVE_GetDosCwd( drive ) );
return 1;
}
@ -185,8 +126,11 @@ int DIR_Init(void)
*/
UINT32 WINAPI GetTempPath32A( UINT32 count, LPSTR path )
{
if (path) lstrcpyn32A( path, DIR_TempDosDir, count );
return strlen( DIR_TempDosDir );
UINT32 ret;
if (!(ret = GetEnvironmentVariable32A( "TMP", path, count )))
if (!(ret = GetEnvironmentVariable32A( "TEMP", path, count )))
ret = GetCurrentDirectory32A( count, path );
return ret;
}
@ -195,18 +139,13 @@ UINT32 WINAPI GetTempPath32A( UINT32 count, LPSTR path )
*/
UINT32 WINAPI GetTempPath32W( UINT32 count, LPWSTR path )
{
if (path) lstrcpynAtoW( path, DIR_TempDosDir, count );
return strlen( DIR_TempDosDir );
}
/***********************************************************************
* DIR_GetTempUnixDir
*/
UINT32 DIR_GetTempUnixDir( LPSTR path, UINT32 count )
{
if (path) lstrcpyn32A( path, DIR_TempUnixDir, count );
return strlen( DIR_TempUnixDir );
static const WCHAR tmp[] = { 'T', 'M', 'P', 0 };
static const WCHAR temp[] = { 'T', 'E', 'M', 'P', 0 };
UINT32 ret;
if (!(ret = GetEnvironmentVariable32W( tmp, path, count )))
if (!(ret = GetEnvironmentVariable32W( temp, path, count )))
ret = GetCurrentDirectory32W( count, path );
return ret;
}
@ -215,8 +154,8 @@ UINT32 DIR_GetTempUnixDir( LPSTR path, UINT32 count )
*/
UINT32 DIR_GetWindowsUnixDir( LPSTR path, UINT32 count )
{
if (path) lstrcpyn32A( path, DIR_WindowsUnixDir, count );
return strlen( DIR_WindowsUnixDir );
if (path) lstrcpyn32A( path, DIR_Windows.long_name, count );
return strlen( DIR_Windows.long_name );
}
@ -225,19 +164,8 @@ UINT32 DIR_GetWindowsUnixDir( LPSTR path, UINT32 count )
*/
UINT32 DIR_GetSystemUnixDir( LPSTR path, UINT32 count )
{
if (path) lstrcpyn32A( path, DIR_SystemUnixDir, count );
return strlen( DIR_SystemUnixDir );
}
/***********************************************************************
* DIR_GetDosPath
*/
UINT32 DIR_GetDosPath( INT32 element, LPSTR path, UINT32 count )
{
if ((element < 0) || (element >= DIR_PathElements)) return 0;
if (path) lstrcpyn32A( path, DIR_DosPath[element], count );
return strlen( DIR_DosPath[element] );
if (path) lstrcpyn32A( path, DIR_System.long_name, count );
return strlen( DIR_System.long_name );
}
@ -246,8 +174,10 @@ UINT32 DIR_GetDosPath( INT32 element, LPSTR path, UINT32 count )
*/
BYTE WINAPI GetTempDrive( BYTE ignored )
{
char buffer[2];
/* FIXME: apparently Windows does something with the ignored byte */
return DIR_TempDosDir[0];
if (!GetTempPath32A( sizeof(buffer), buffer )) buffer[0] = 'C';
return toupper(buffer[0]) - 'A';
}
@ -279,8 +209,8 @@ UINT16 WINAPI GetWindowsDirectory16( LPSTR path, UINT16 count )
*/
UINT32 WINAPI GetWindowsDirectory32A( LPSTR path, UINT32 count )
{
if (path) lstrcpyn32A( path, DIR_WindowsDosDir, count );
return strlen( DIR_WindowsDosDir );
if (path) lstrcpyn32A( path, DIR_Windows.short_name, count );
return strlen( DIR_Windows.short_name );
}
@ -289,8 +219,8 @@ UINT32 WINAPI GetWindowsDirectory32A( LPSTR path, UINT32 count )
*/
UINT32 WINAPI GetWindowsDirectory32W( LPWSTR path, UINT32 count )
{
if (path) lstrcpynAtoW( path, DIR_WindowsDosDir, count );
return strlen( DIR_WindowsDosDir );
if (path) lstrcpynAtoW( path, DIR_Windows.short_name, count );
return strlen( DIR_Windows.short_name );
}
@ -308,8 +238,8 @@ UINT16 WINAPI GetSystemDirectory16( LPSTR path, UINT16 count )
*/
UINT32 WINAPI GetSystemDirectory32A( LPSTR path, UINT32 count )
{
if (path) lstrcpyn32A( path, DIR_SystemDosDir, count );
return strlen( DIR_SystemDosDir );
if (path) lstrcpyn32A( path, DIR_System.short_name, count );
return strlen( DIR_System.short_name );
}
@ -318,8 +248,8 @@ UINT32 WINAPI GetSystemDirectory32A( LPSTR path, UINT32 count )
*/
UINT32 WINAPI GetSystemDirectory32W( LPWSTR path, UINT32 count )
{
if (path) lstrcpynAtoW( path, DIR_SystemDosDir, count );
return strlen( DIR_SystemDosDir );
if (path) lstrcpynAtoW( path, DIR_System.short_name, count );
return strlen( DIR_System.short_name );
}
@ -443,11 +373,11 @@ BOOL32 WINAPI RemoveDirectory32W( LPCWSTR path )
*
* Helper function for DIR_SearchPath.
*/
static BOOL32 DIR_TryPath( LPCSTR unix_dir, LPCSTR dos_dir, LPCSTR name,
static BOOL32 DIR_TryPath( const DOS_FULL_NAME *dir, LPCSTR name,
DOS_FULL_NAME *full_name )
{
LPSTR p_l = full_name->long_name + strlen(unix_dir) + 1;
LPSTR p_s = full_name->short_name + strlen(dos_dir) + 1;
LPSTR p_l = full_name->long_name + strlen(dir->long_name) + 1;
LPSTR p_s = full_name->short_name + strlen(dir->short_name) + 1;
if ((p_s >= full_name->short_name + sizeof(full_name->short_name) - 14) ||
(p_l >= full_name->long_name + sizeof(full_name->long_name) - 1))
@ -455,18 +385,56 @@ static BOOL32 DIR_TryPath( LPCSTR unix_dir, LPCSTR dos_dir, LPCSTR name,
DOS_ERROR( ER_PathNotFound, EC_NotFound, SA_Abort, EL_Disk );
return FALSE;
}
if (!DOSFS_FindUnixName( unix_dir, name, p_l,
if (!DOSFS_FindUnixName( dir->long_name, name, p_l,
sizeof(full_name->long_name) - (p_l - full_name->long_name),
p_s, DRIVE_GetFlags( dos_dir[0] - 'A' ) ))
p_s, DRIVE_GetFlags( dir->drive ) ))
return FALSE;
strcpy( full_name->long_name, unix_dir );
strcpy( full_name->long_name, dir->long_name );
p_l[-1] = '/';
strcpy( full_name->short_name, dos_dir );
strcpy( full_name->short_name, dir->short_name );
p_s[-1] = '\\';
return TRUE;
}
/***********************************************************************
* DIR_TryEnvironmentPath
*
* Helper function for DIR_SearchPath.
*/
static BOOL32 DIR_TryEnvironmentPath( LPCSTR name, DOS_FULL_NAME *full_name )
{
LPSTR path, next, buffer;
BOOL32 ret = FALSE;
INT32 len = strlen(name);
DWORD size = GetEnvironmentVariable32A( "PATH", NULL, 0 );
if (!size) return FALSE;
if (!(path = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
if (!GetEnvironmentVariable32A( "PATH", path, size )) goto done;
next = path;
while (!ret && next)
{
LPSTR cur = next;
while (*cur == ';') cur++;
if (!*cur) break;
next = strchr( cur, ';' );
if (next) *next++ = '\0';
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, strlen(cur) + len + 2)))
goto done;
strcpy( buffer, cur );
strcat( buffer, "\\" );
strcat( buffer, name );
ret = DOSFS_GetFullName( buffer, TRUE, full_name );
HeapFree( GetProcessHeap(), 0, buffer );
}
done:
HeapFree( GetProcessHeap(), 0, path );
return ret;
}
/***********************************************************************
* DIR_TryModulePath
*
@ -501,7 +469,6 @@ DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext,
{
DWORD len;
LPCSTR p;
int i;
LPSTR tmp = NULL;
BOOL32 ret = TRUE;
@ -558,12 +525,12 @@ DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext,
/* Try the Windows directory */
if (DIR_TryPath( DIR_WindowsUnixDir, DIR_WindowsDosDir, name, full_name ))
if (DIR_TryPath( &DIR_Windows, name, full_name ))
goto done;
/* Try the Windows system directory */
if (DIR_TryPath( DIR_SystemUnixDir, DIR_SystemDosDir, name, full_name ))
if (DIR_TryPath( &DIR_System, name, full_name ))
goto done;
/* Try the path of the current executable (for Win16 search order) */
@ -572,13 +539,8 @@ DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext,
/* Try all directories in path */
for (i = 0; i < DIR_PathElements; i++)
{
if (DIR_TryPath( DIR_UnixPath[i], DIR_DosPath[i], name, full_name ))
goto done;
}
ret = DIR_TryEnvironmentPath( name, full_name );
ret = FALSE;
done:
if (tmp) HeapFree( GetProcessHeap(), 0, tmp );
return ret;

View File

@ -5,6 +5,7 @@
* Copyright 1996 Alexandre Julliard
*/
#include "config.h"
#include <sys/types.h>
#include <ctype.h>
#include <dirent.h>
@ -17,8 +18,8 @@
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#if defined(__svr4__) || defined(_SCO_DS)
#include <sys/statfs.h>
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#include "windows.h"
@ -646,8 +647,7 @@ static int DOSFS_GetPathDrive( const char **name )
{
if ((drive = DRIVE_FindDriveRoot( name )) == -1)
{
fprintf( stderr, "Warning: %s not accessible from a DOS drive\n",
*name );
MSG("Warning: %s not accessible from a DOS drive\n", *name );
/* Assume it really was a DOS name */
drive = DRIVE_GetCurrentDrive();
}
@ -1335,7 +1335,7 @@ void DOSFS_UnixTimeToFileTime( time_t unix_time, FILETIME *filetime,
Claus Fischer, fischer@iue.tuwien.ac.at
*/
#if __GNUC__
#if (SIZEOF_LONG_LONG >= 8)
# define USE_LONG_LONG 1
#else
# define USE_LONG_LONG 0

View File

@ -5,6 +5,8 @@
* Copyright 1996 Alexandre Julliard
*/
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <string.h>
@ -12,17 +14,19 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#if defined(__linux__) || defined(sun) || defined(hpux)
#include <sys/vfs.h>
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/errno.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#if defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
#include <sys/statfs.h>
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#include "windows.h"
@ -98,8 +102,7 @@ static DRIVETYPE DRIVE_GetDriveType( const char *name )
{
if (!lstrcmpi32A( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
}
fprintf( stderr, "%s: unknown type '%s', defaulting to 'hd'.\n",
name, buffer );
MSG("%s: unknown type '%s', defaulting to 'hd'.\n", name, buffer );
return TYPE_HD;
}
@ -113,8 +116,8 @@ static UINT32 DRIVE_GetFSFlags( const char *name, const char *value )
for (descr = DRIVE_Filesystems; descr->name; descr++)
if (!lstrcmpi32A( value, descr->name )) return descr->flags;
fprintf( stderr, "%s: unknown filesystem type '%s', defaulting to 'unix'.\n",
name, value );
MSG("%s: unknown filesystem type '%s', defaulting to 'unix'.\n",
name, value );
return DRIVE_CASE_SENSITIVE | DRIVE_CASE_PRESERVING;
}
@ -143,14 +146,13 @@ int DRIVE_Init(void)
if (stat( path, &drive_stat_buffer ))
{
fprintf( stderr, "Could not stat %s, ignoring drive %c:\n",
path, 'A' + i );
MSG("Could not stat %s, ignoring drive %c:\n", path, 'A' + i );
continue;
}
if (!S_ISDIR(drive_stat_buffer.st_mode))
{
fprintf( stderr, "%s is not a directory, ignoring drive %c:\n",
path, 'A' + i );
MSG("%s is not a directory, ignoring drive %c:\n",
path, 'A' + i );
continue;
}
@ -203,7 +205,7 @@ int DRIVE_Init(void)
if (!count)
{
fprintf( stderr, "Warning: no valid DOS drive found, check your configuration file.\n" );
MSG("Warning: no valid DOS drive found, check your configuration file.\n" );
/* Create a C drive pointing to Unix root dir */
DOSDrives[2].root = HEAP_strdupA( SystemHeap, 0, "/" );
DOSDrives[2].dos_cwd = HEAP_strdupA( SystemHeap, 0, "" );
@ -583,6 +585,7 @@ static int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
return 0;
}
/* FIXME: add autoconf check for this */
#if defined(__svr4__) || defined(_SCO_DS)
if (statfs( DOSDrives[drive].root, &info, 0, 0) < 0)
#else
@ -590,15 +593,19 @@ static int DRIVE_GetFreeSpace( int drive, DWORD *size, DWORD *available )
#endif
{
FILE_SetDosError();
fprintf(stderr,"dosfs: cannot do statfs(%s)\n", DOSDrives[drive].root);
WARN(dosfs, "cannot do statfs(%s)\n", DOSDrives[drive].root);
return 0;
}
*size = info.f_bsize * info.f_blocks;
#if defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
*available = info.f_bfree * info.f_bsize;
#else
#ifdef STATFS_HAS_BAVAIL
*available = info.f_bavail * info.f_bsize;
#else
# ifdef STATFS_HAS_BFREE
*available = info.f_bfree * info.f_bsize;
# else
# error "statfs has no bfree/bavail member!"
# endif
#endif
return 1;
}
@ -631,7 +638,7 @@ BOOL32 WINAPI GetDiskFreeSpace32A( LPCSTR root, LPDWORD cluster_sectors,
{
if ((root[1]) && ((root[1] != ':') || (root[2] != '\\')))
{
fprintf( stderr, "GetDiskFreeSpaceA: invalid root '%s'\n", root );
WARN(dosfs, "invalid root '%s'\n", root );
return FALSE;
}
drive = toupper(root[0]) - 'A';
@ -653,7 +660,7 @@ BOOL32 WINAPI GetDiskFreeSpace32A( LPCSTR root, LPDWORD cluster_sectors,
}
/* fixme: probably have to adjust those variables too for CDFS */
*cluster_sectors = 1;
while (*cluster_sectors * 65530 < size) *cluster_sectors *= 2;
while (*cluster_sectors * 65536 < size) *cluster_sectors *= 2;
*free_clusters = available/ *cluster_sectors;
*total_clusters = size/ *cluster_sectors;
return TRUE;
@ -694,8 +701,7 @@ BOOL32 WINAPI GetDiskFreeSpaceEx32A( LPCSTR root,
{
if ((root[1]) && ((root[1] != ':') || (root[2] != '\\')))
{
fprintf( stderr, "GetDiskFreeSpaceExA: invalid root '%s'\n",
root );
WARN(dosfs, "invalid root '%s'\n", root );
return FALSE;
}
drive = toupper(root[0]) - 'A';
@ -755,7 +761,7 @@ UINT32 WINAPI GetDriveType32A( LPCSTR root )
TRACE(dosfs, "(%s)\n", root );
if ((root[1]) && (root[1] != ':'))
{
fprintf( stderr, "GetDriveType32A: invalid root '%s'\n", root );
WARN(dosfs, "invalid root '%s'\n", root );
return DRIVE_DOESNOTEXIST;
}
switch(DRIVE_GetType(toupper(root[0]) - 'A'))
@ -949,7 +955,7 @@ BOOL32 WINAPI GetVolumeInformation32A( LPCSTR root, LPSTR label,
{
if ((root[1]) && (root[1] != ':'))
{
fprintf( stderr, "GetVolumeInformation: invalid root '%s'\n",root);
WARN(dosfs, "invalid root '%s'\n",root);
return FALSE;
}
drive = toupper(root[0]) - 'A';

View File

@ -89,8 +89,9 @@ static HFILE32 FILE_Alloc( FILE_OBJECT **file )
(*file)->unix_name = NULL;
(*file)->type = FILE_TYPE_DISK;
handle = HANDLE_Alloc( &(*file)->header, FILE_ALL_ACCESS | GENERIC_READ |
GENERIC_WRITE | GENERIC_EXECUTE /*FIXME*/, FALSE );
handle = HANDLE_Alloc( PROCESS_Current(), &(*file)->header,
FILE_ALL_ACCESS | GENERIC_READ |
GENERIC_WRITE | GENERIC_EXECUTE /*FIXME*/, TRUE );
/* If the allocation failed, the object is already destroyed */
if (handle == INVALID_HANDLE_VALUE32) *file = NULL;
return handle;
@ -187,7 +188,8 @@ static void FILE_Destroy( K32OBJ *ptr )
*/
static FILE_OBJECT *FILE_GetFile( HFILE32 handle )
{
return (FILE_OBJECT *)HANDLE_GetObjPtr( handle, K32OBJ_FILE, 0 /*FIXME*/ );
return (FILE_OBJECT *)HANDLE_GetObjPtr( PROCESS_Current(), handle,
K32OBJ_FILE, 0 /*FIXME*/ );
}
@ -359,7 +361,7 @@ HFILE32 FILE_Open( LPCSTR path, INT32 mode )
return ret;
/* Do not silence this please. It is a critical error. -MM */
fprintf(stderr, "FILE_Open: Couldn't open device '%s'!\n",path);
ERR(file, "Couldn't open device '%s'!\n",path);
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
return HFILE_ERROR32;
@ -389,7 +391,7 @@ static HFILE32 FILE_Create( LPCSTR path, int mode, int unique )
if (DOSFS_IsDevice( path ))
{
fprintf(stderr, "FILE_Create: cannot create DOS device '%s'!\n", path);
WARN(file, "cannot create DOS device '%s'!\n", path);
DOS_ERROR( ER_AccessDenied, EC_NotFound, SA_Abort, EL_Disk );
return INVALID_HANDLE_VALUE32;
}
@ -579,13 +581,12 @@ INT32 WINAPI CompareFileTime( LPFILETIME x, LPFILETIME y )
*/
HFILE32 FILE_Dup( HFILE32 hFile )
{
FILE_OBJECT *file;
HFILE32 handle;
TRACE(file, "FILE_Dup for handle %d\n", hFile );
if (!(file = FILE_GetFile( hFile ))) return HFILE_ERROR32;
handle = HANDLE_Alloc( &file->header, FILE_ALL_ACCESS /*FIXME*/, FALSE );
FILE_ReleaseFile( file );
if (!DuplicateHandle( GetCurrentProcess(), hFile, GetCurrentProcess(),
&handle, FILE_ALL_ACCESS /* FIXME */, FALSE, 0 ))
handle = HFILE_ERROR32;
TRACE(file, "FILE_Dup return handle %d\n", handle );
return handle;
}
@ -603,7 +604,8 @@ HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 )
TRACE(file, "FILE_Dup2 for handle %d\n", hFile1 );
/* FIXME: should use DuplicateHandle */
if (!(file = FILE_GetFile( hFile1 ))) return HFILE_ERROR32;
if (!HANDLE_SetObjPtr( hFile2, &file->header, 0 )) hFile2 = HFILE_ERROR32;
if (!HANDLE_SetObjPtr( PROCESS_Current(), hFile2, &file->header, 0 ))
hFile2 = HFILE_ERROR32;
FILE_ReleaseFile( file );
return hFile2;
}
@ -624,8 +626,7 @@ UINT16 WINAPI GetTempFileName16( BYTE drive, LPCSTR prefix, UINT16 unique,
!DRIVE_IsValid( toupper(drive & ~TF_FORCEDRIVE) - 'A' ))
{
drive &= ~TF_FORCEDRIVE;
fprintf( stderr, "Warning: GetTempFileName: invalid drive %d specified\n",
drive );
WARN(file, "invalid drive %d specified\n", drive );
}
if (drive & TF_FORCEDRIVE)
@ -691,10 +692,8 @@ UINT32 WINAPI GetTempFileName32A( LPCSTR path, LPCSTR prefix, UINT32 unique,
/* Check if we have write access in the directory */
if ((p = strrchr( full_name.long_name, '/' ))) *p = '\0';
if (access( full_name.long_name, W_OK ) == -1)
fprintf( stderr,
"Warning: GetTempFileName returns '%s', which doesn't seem to be writeable.\n"
"Please check your configuration file if this generates a failure.\n",
buffer);
WARN(file, "returns '%s', which doesn't seem to be writeable.\n",
buffer);
}
TRACE(file, "returning %s\n", buffer );
return unique ? unique : num;
@ -745,8 +744,7 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
if (mode & OF_REOPEN) name = ofs->szPathName;
if (!name) {
fprintf(stderr, "ERROR: FILE_DoOpenFile() called with `name' set to NULL ! Please debug.\n");
ERR(file, "called with `name' set to NULL ! Please debug.\n");
return HFILE_ERROR32;
}
@ -930,7 +928,8 @@ UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count )
BOOL32 result = FALSE;
TRACE( file, "%d %p %d\n", handle, buffer, count);
if (!(ptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0))) return -1;
if (!(ptr = HANDLE_GetObjPtr( PROCESS_Current(), handle,
K32OBJ_UNKNOWN, 0))) return -1;
if (K32OBJ_OPS(ptr)->read)
result = K32OBJ_OPS(ptr)->read(ptr, buffer, count, &numWritten, NULL);
K32OBJ_DecCount( ptr );
@ -992,12 +991,12 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
if (highword && *highword)
{
fprintf( stderr, "SetFilePointer: 64-bit offsets not supported yet\n");
FIXME(file, "64-bit offsets not supported yet\n");
SetLastError( ERROR_INVALID_PARAMETER );
return 0xffffffff;
}
TRACE(file, "handle %d offset %ld origin %ld\n",
hFile, distance, method );
hFile, distance, method );
if (!(file = FILE_GetFile( hFile ))) return 0xffffffff;
switch(method)
@ -1143,7 +1142,8 @@ LONG WINAPI _hwrite32( HFILE32 handle, LPCSTR buffer, LONG count )
}
}
if (!(ioptr = HANDLE_GetObjPtr( handle, K32OBJ_UNKNOWN, 0 )))
if (!(ioptr = HANDLE_GetObjPtr( PROCESS_Current(), handle,
K32OBJ_UNKNOWN, 0 )))
return HFILE_ERROR32;
if (K32OBJ_OPS(ioptr)->write)
status = K32OBJ_OPS(ioptr)->write(ioptr, buffer, count, &result, NULL);
@ -1276,7 +1276,7 @@ BOOL32 WINAPI DeleteFile32A( LPCSTR path )
if (DOSFS_IsDevice( path ))
{
fprintf(stderr, "DeleteFile: cannot remove DOS device '%s'!\n", path);
WARN(file, "cannot remove DOS device '%s'!\n", path);
DOS_ERROR( ER_FileNotFound, EC_NotFound, SA_Abort, EL_Disk );
return FALSE;
}
@ -1347,7 +1347,7 @@ LPVOID FILE_dommap( FILE_OBJECT *file, LPVOID start,
LPVOID ret;
if (size_high || offset_high)
fprintf( stderr, "FILE_mmap: offsets larger than 4Gb not supported\n");
FIXME(file, "offsets larger than 4Gb not supported\n");
if (!file)
{
@ -1420,7 +1420,7 @@ LPVOID FILE_dommap( FILE_OBJECT *file, LPVOID start,
int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low )
{
if (size_high)
fprintf( stderr, "FILE_munmap: offsets larger than 4Gb not supported\n");
FIXME(file, "offsets larger than 4Gb not supported\n");
return munmap( start, size_low );
}
@ -1470,8 +1470,7 @@ BOOL32 WINAPI MoveFileEx32A( LPCSTR fn1, LPCSTR fn2, DWORD flag )
else /* fn2 == NULL means delete source */
if (flag & MOVEFILE_DELAY_UNTIL_REBOOT) {
if (flag & MOVEFILE_COPY_ALLOWED) {
fprintf( stderr,
"MoveFileEx32A: Illegal flag\n");
WARN(file, "Illegal flag\n");
DOS_ERROR( ER_GeneralFailure, EC_SystemFailure, SA_Abort,
EL_Unknown );
return FALSE;
@ -1480,11 +1479,8 @@ BOOL32 WINAPI MoveFileEx32A( LPCSTR fn1, LPCSTR fn2, DWORD flag )
Perhaps we should queue these command and execute it
when exiting... What about using on_exit(2)
*/
fprintf( stderr,"MoveFileEx32A: Please delete file %s\n",
full_name1.long_name);
fprintf( stderr," when Wine has finished\n");
fprintf( stderr," like \"rm %s\"\n",
full_name1.long_name);
FIXME(file, "Please delete file '%s' when Wine has finished\n",
full_name1.long_name);
return TRUE;
}
else if (unlink( full_name1.long_name ) == -1)
@ -1499,13 +1495,9 @@ BOOL32 WINAPI MoveFileEx32A( LPCSTR fn1, LPCSTR fn2, DWORD flag )
Perhaps we should queue these command and execute it
when exiting... What about using on_exit(2)
*/
fprintf( stderr,"MoveFileEx32A: Please move existing file %s\n"
,full_name1.long_name);
fprintf( stderr," to file %s\n"
,full_name2.long_name);
fprintf( stderr," when Wine has finished\n");
fprintf( stderr," like \" mv %s %s\"\n",
full_name1.long_name,full_name2.long_name);
FIXME(file,"Please move existing file '%s' to file '%s'"
"when Wine has finished\n",
full_name1.long_name, full_name2.long_name);
return TRUE;
}

View File

@ -184,8 +184,8 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
{
if (!(p2 = strrchr( p, ']' )))
{
fprintf( stderr, "PROFILE_Load: Invalid section header at line %d: '%s'\n",
line, p );
WARN(profile, "Invalid section header at line %d: '%s'\n",
line, p );
}
else
{
@ -352,13 +352,11 @@ static BOOL32 PROFILE_FlushFile(void)
if (!file)
{
fprintf( stderr, "Warning: could not save profile file %s\n",
CurProfile.dos_name );
WARN(profile, "could not save profile file %s\n", CurProfile.dos_name);
return FALSE;
}
TRACE(profile, "Saving '%s' into '%s'\n",
CurProfile.dos_name, unix_name );
TRACE(profile, "Saving '%s' into '%s'\n", CurProfile.dos_name, unix_name );
PROFILE_Save( file, CurProfile.section );
fclose( file );
CurProfile.changed = FALSE;
@ -452,7 +450,7 @@ static BOOL32 PROFILE_Open( LPCSTR filename )
else
{
/* Does not exist yet, we will create it in PROFILE_FlushFile */
fprintf( stderr, "Warning: profile file %s not found\n", newdos_name );
WARN(profile, "profile file %s not found\n", newdos_name );
}
return TRUE;
}
@ -479,6 +477,13 @@ static INT32 PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name,
PROFILE_CopyEntry( buffer, key->name, len - 1, handle_env );
len -= strlen(buffer) + 1;
buffer += strlen(buffer) + 1;
if (key->value)
{
buffer[-1] = '=';
PROFILE_CopyEntry(buffer, key->value, len - 1, handle_env);
len -= strlen(buffer) + 1;
buffer += strlen(buffer) + 1;
}
}
*buffer = '\0';
return oldlen - len + 1;
@ -738,7 +743,7 @@ int PROFILE_LoadWineIni(void)
return 1;
}
}
else fprintf( stderr, "Warning: could not get $HOME value for config file.\n" );
else WARN(profile, "could not get $HOME value for config file.\n" );
/* Try global file */
@ -748,8 +753,8 @@ int PROFILE_LoadWineIni(void)
fclose( f );
return 1;
}
fprintf( stderr, "Can't open configuration file %s or $HOME%s\n",
WINE_INI_GLOBAL, PROFILE_WineIniName );
WARN(profile, "Can't open configuration file %s or $HOME%s\n",
WINE_INI_GLOBAL, PROFILE_WineIniName );
return 0;
}

View File

@ -267,7 +267,7 @@ INT16 WINAPI FillRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
/***********************************************************************
* FillRect32 (USER32.196)
* FillRect32 (USER32.197)
*/
INT32 WINAPI FillRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
{
@ -292,7 +292,7 @@ void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect )
/***********************************************************************
* InvertRect32 (USER32.329)
* InvertRect32 (USER32.330)
*/
void WINAPI InvertRect32( HDC32 hdc, const RECT32 *rect )
{
@ -337,7 +337,7 @@ INT16 WINAPI FrameRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
/***********************************************************************
* FrameRect32 (USER32.202)
* FrameRect32 (USER32.203)
*/
INT32 WINAPI FrameRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
{
@ -510,7 +510,7 @@ void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc )
/***********************************************************************
* DrawFocusRect32 (USER32.155)
* DrawFocusRect32 (USER32.156)
*
* FIXME: PatBlt(PATINVERT) with background brush.
*/

View File

@ -26,7 +26,7 @@ static LOADED_PRINTER_DRIVER *gapLoadedPrinterDrivers[MAX_PRINTER_DRIVERS];
static void GetPrinterDriverFunctions(HINSTANCE16 hInst, LOADED_PRINTER_DRIVER *pLPD)
{
#define LoadPrinterDrvFunc(A) pLPD->fn[FUNC_##A] = \
GetProcAddress16(hInst, MAKEINTRESOURCE(ORD_##A))
GetProcAddress16(hInst, MAKEINTRESOURCE16(ORD_##A))
LoadPrinterDrvFunc(BITBLT);
LoadPrinterDrvFunc(COLORINFO);

View File

@ -5,8 +5,8 @@
*/
#include <math.h>
#if defined(__EMX__)
#include <float.h>
#ifdef HAVE_FLOAT_H
# include <float.h>
#endif
#include <stdlib.h>
#include "ts_xlib.h"
@ -92,17 +92,32 @@ X11DRV_DrawArc( DC *dc, INT32 left, INT32 top, INT32 right,
yend = YLPTODP( dc, yend );
if ((left == right) || (top == bottom)) return FALSE;
if (left > right) { tmp=left; left=right; right=tmp; }
if (top > bottom) { tmp=top; top=bottom; bottom=tmp; }
xcenter = (right + left) / 2;
ycenter = (bottom + top) / 2;
start_angle = atan2( (double)(ycenter-ystart)*(right-left),
(double)(xstart-xcenter)*(bottom-top) );
end_angle = atan2( (double)(ycenter-yend)*(right-left),
(double)(xend-xcenter)*(bottom-top) );
if ((xstart==xend)&&(ystart==yend))
{ /* A lazy program delivers xstart=xend=ystart=yend=0) */
start_angle = 0;
end_angle = 2* PI;
}
else /* notorious cases */
if ((start_angle == PI)&&( end_angle <0))
start_angle = - PI;
else
if ((end_angle == PI)&&( start_angle <0))
end_angle = - PI;
istart_angle = (INT32)(start_angle * 180 * 64 / PI);
idiff_angle = (INT32)((end_angle - start_angle) * 180 * 64 / PI );
if (idiff_angle <= 0) idiff_angle += 360 * 64;
if (left > right) { tmp=left; left=right; right=tmp; }
if (top > bottom) { tmp=top; top=bottom; bottom=tmp; }
if (idiff_angle < 0)
{
istart_angle+= idiff_angle;
idiff_angle = abs(idiff_angle);
}
/* Fill arc with brush if Chord() or Pie() */
@ -227,12 +242,14 @@ X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
if ((left == right) || (top == bottom))
{
#if 0
if (DC_SetupGCForPen( dc ))
TSXDrawLine(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left,
dc->w.DCOrgY + top,
dc->w.DCOrgX + right,
dc->w.DCOrgY + bottom);
#endif
return TRUE;
}
width = dc->u.x.pen.width;

View File

@ -13,6 +13,7 @@
/*#include "callback.h"*/
#include "heap.h"
#include "x11font.h"
#include "debugstr.h"
#include "debug.h"
#define SWAP_INT(a,b) { int t = a; a = b; b = t; }
@ -43,10 +44,16 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
lfUnderline = (pfo->fo_flags & FO_SYNTH_UNDERLINE) ? 1 : 0;
lfStrikeOut = (pfo->fo_flags & FO_SYNTH_STRIKEOUT) ? 1 : 0;
TRACE(text,"hdc=%04x df=%04x %d,%d '%.*s', %d flags=%d\n",
dc->hSelf, (UINT16)(dc->u.x.font), x, y, (int)count, str, count, flags);
TRACE(text,"hdc=%04x df=%04x %d,%d %s, %d flags=%d\n",
dc->hSelf, (UINT16)(dc->u.x.font), x, y,
debugstr_an (str, count), count, flags);
if (lprect != NULL) TRACE(text, "\trect=(%d,%d- %d,%d)\n",
/* some strings sent here end in a newline for whatever reason. I have no
clue what the right treatment should be in general, but ignoring
terminating newlines seems ok. MW, April 1998. */
if (count > 0 && str[count - 1] == '\n') count--;
if (lprect != NULL) TRACE(text, "\trect=(%d,%d - %d,%d)\n",
lprect->left, lprect->top,
lprect->right, lprect->bottom );
/* Setup coordinates */
@ -85,7 +92,7 @@ X11DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
x = XLPTODP( dc, x );
y = YLPTODP( dc, y );
TRACE(text,"\treal coord: x=%i, y=%i, rect=(%d,%d-%d,%d)\n",
TRACE(text,"\treal coord: x=%i, y=%i, rect=(%d,%d - %d,%d)\n",
x, y, rect.left, rect.top, rect.right, rect.bottom);
/* Draw the rectangle */

View File

@ -2105,9 +2105,6 @@ BOOL32 X11DRV_EnumDeviceFonts( DC* dc, LPLOGFONT16 plf,
}
static char* test_string = "Abc Def Ghi Jkl Mno Pqr Stu Vwx Yz";
/***********************************************************************
* X11DRV_GetTextExtentPoint
*/
@ -2213,7 +2210,7 @@ INT16 WINAPI AddFontResource16( LPCSTR filename )
*/
INT32 WINAPI AddFontResource32A( LPCSTR str )
{
FIXME(font, "(%s): stub\n", debugres(str));
FIXME(font, "(%s): stub\n", debugres_a(str));
return 1;
}
@ -2223,7 +2220,7 @@ INT32 WINAPI AddFontResource32A( LPCSTR str )
*/
INT32 WINAPI AddFontResource32W( LPCWSTR str )
{
FIXME(font, "(%p): stub\n", str );
FIXME(font, "(%s): stub\n", debugres_w(str) );
return 1;
}
@ -2232,7 +2229,7 @@ INT32 WINAPI AddFontResource32W( LPCWSTR str )
*/
BOOL16 WINAPI RemoveFontResource16( SEGPTR str )
{
FIXME(font, "(%s): stub\n", debugres(PTR_SEG_TO_LIN(str)));
FIXME(font, "(%s): stub\n", debugres_a(PTR_SEG_TO_LIN(str)));
return TRUE;
}
@ -2242,7 +2239,7 @@ BOOL16 WINAPI RemoveFontResource16( SEGPTR str )
*/
BOOL32 WINAPI RemoveFontResource32A( LPCSTR str )
{
FIXME(font, "(%s): stub\n", debugres(str));
FIXME(font, "(%s): stub\n", debugres_a(str));
return TRUE;
}
@ -2252,7 +2249,7 @@ BOOL32 WINAPI RemoveFontResource32A( LPCSTR str )
*/
BOOL32 WINAPI RemoveFontResource32W( LPCWSTR str )
{
FIXME(font, "(%p): stub\n", str );
FIXME(font, "(%s): stub\n", debugres_w(str) );
return TRUE;
}

View File

@ -8,10 +8,10 @@ type win16
7 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
8 pascal ColorDlgProc(word word word long) ColorDlgProc
#9 pascal LOADALTERBITMAP exported, shared data
11 pascal16 FindText(segptr) FindText
12 pascal16 ReplaceText(segptr) ReplaceText
13 pascal FindTextDlgProc(word word word long) FindTextDlgProc
14 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc
11 pascal16 FindText(segptr) FindText16
12 pascal16 ReplaceText(segptr) ReplaceText16
13 pascal FindTextDlgProc(word word word long) FindTextDlgProc16
14 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc16
15 pascal16 ChooseFont(ptr) ChooseFont
16 pascal16 FormatCharDlgProc(word word word long) FormatCharDlgProc
18 pascal16 FontStyleEnumProc(ptr ptr word long) FontStyleEnumProc

View File

@ -218,7 +218,7 @@ file gdi.exe
305 stub ENGINEGETGLYPHBMP
306 stub ENGINEMAKEFONTDIR
307 pascal16 GetCharABCWidths(word word word ptr) GetCharABCWidths16
308 stub GetOutLineTextMetrics
308 pascal GetOutlineTextMetrics(word word ptr) GetOutlineTextMetrics
309 pascal GetGlyphOutline(word word word ptr long ptr ptr) GetGlyphOutline16
310 pascal16 CreateScalableFontResource(word str str str) CreateScalableFontResource16
311 stub GetFontData

View File

@ -278,8 +278,8 @@ file krnl386.exe
355 pascal16 GetWinDebugInfo(ptr word) GetWinDebugInfo
356 pascal16 SetWinDebugInfo(ptr) SetWinDebugInfo
357 stub KERNEL_357
358 pascal KERNEL_358(long) _KERNEL_358
359 pascal KERNEL_359(long) _KERNEL_359
358 pascal MapLS(long) MapLS
359 pascal UnMapLS(ptr) UnMapLS
360 stub OpenFileEx
#361 PIGLET_361
365 stub KERNEL_365

View File

@ -13,6 +13,7 @@
#include "module.h"
#include "stackframe.h"
#include "task.h"
#include "debugstr.h"
#include "debug.h"
#if 0
@ -33,8 +34,10 @@ BOOL32 RELAY_Init(void)
extern void CALLTO16_Start(), CALLTO16_End();
extern void CALLTO16_Ret_word(), CALLTO16_Ret_long();
extern void CALLTO16_Ret_eax();
extern DWORD CALLTO16_RetAddr_word;
extern DWORD CALLTO16_RetAddr_long;
extern DWORD CALLTO16_RetAddr_eax;
codesel = GLOBAL_CreateBlock( GMEM_FIXED, (void *)CALLTO16_Start,
(int)CALLTO16_End - (int)CALLTO16_Start,
@ -47,6 +50,8 @@ BOOL32 RELAY_Init(void)
codesel );
CALLTO16_RetAddr_long=MAKELONG( (int)CALLTO16_Ret_long-(int)CALLTO16_Start,
codesel );
CALLTO16_RetAddr_eax =MAKELONG( (int)CALLTO16_Ret_eax -(int)CALLTO16_Start,
codesel );
/* Create built-in modules */
if (!BUILTIN_Init()) return FALSE;
@ -56,19 +61,6 @@ BOOL32 RELAY_Init(void)
}
static void RELAY_dumpstr( unsigned char *s )
{
fputc( '\"', stdout );
for ( ; *s; s++)
{
if (*s < ' ') printf( "\\0x%02x", *s );
else if (*s == '\\') fputs( "\\\\", stdout );
else fputc( *s, stdout );
}
fputc( '\"', stdout );
}
/***********************************************************************
* RELAY_DebugCallFrom16
@ -107,7 +99,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
case 't':
printf( "%04x:%04x", *(WORD *)(args16+2), *(WORD *)args16 );
if (HIWORD(*(SEGPTR *)args16))
RELAY_dumpstr( (LPBYTE)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
debug_dumpstr( (LPSTR)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
args16 += 4;
break;
case 'p':
@ -117,7 +109,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
case 'T':
printf( "%04x:%04x", *(WORD *)(args16+2), *(WORD *)args16 );
if (HIWORD( *(SEGPTR *)args16 ))
RELAY_dumpstr( (LPBYTE)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
debug_dumpstr( (LPSTR)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
args16 += 4;
break;
}
@ -162,7 +154,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
args16 -= 4;
printf( "0x%08x", *(int *)args16 );
if (HIWORD(*(SEGPTR *)args16))
RELAY_dumpstr( (LPBYTE)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
debug_dumpstr( (LPSTR)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
break;
case 'p':
args16 -= 4;
@ -172,7 +164,7 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
args16 -= 4;
printf( "%04x:%04x", *(WORD *)(args16+2), *(WORD *)args16 );
if (HIWORD( *(SEGPTR *)args16 ))
RELAY_dumpstr( (LPBYTE)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
debug_dumpstr( (LPSTR)PTR_SEG_TO_LIN(*(SEGPTR *)args16 ));
break;
}
args++;

View File

@ -17,15 +17,6 @@
#include <sys/types.h>
#include <sys/wait.h>
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
# if !defined(_SCO_DS) && !defined(__EMX__)
# include <sys/syscall.h>
# endif
# include <sys/param.h>
#else
# include <syscall.h>
#endif
#include "debugger.h"
#include "options.h"
#include "sig_context.h"

View File

@ -521,10 +521,10 @@ file user.exe
821 stub TranslateMessage32
#821 stub IsDialogMessage32 # FIXME: two ordinal 821???
822 stub DispatchMessage32
823 stub CallMsgFilter32
825 stub PostMessage32
826 stub PostThreadMessage32
827 stub MessageBoxIndirect
823 stub CallMsgFilter32
827 pascal16 MessageBoxIndirect(ptr) MessageBoxIndirect16
851 stub MsgThkConnectionDataLS
853 stub FT_USRFTHKTHKCONNECTIONDATA
854 stub FT__USRF2THKTHKCONNECTIONDATA

View File

@ -4,8 +4,8 @@ type win16
14 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
15 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
16 pascal ColorDlgProc(word word word long) ColorDlgProc
17 pascal FindTextDlgProc(word word word long) FindTextDlgProc
18 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc
17 pascal FindTextDlgProc(word word word long) FindTextDlgProc16
18 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc16
19 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc
20 pascal PrintDlgProc(word word word long) PrintDlgProc
24 pascal16 TASK_Reschedule() TASK_Reschedule

View File

@ -21,5 +21,8 @@
/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */
#undef NO_REENTRANT_X11
/* Define if you have machine/soundcard.h instead of sys/soundcard.h. */
#undef HAVE_MACHINE_SOUNDCARD_H
/* Define if the struct statfs has the member bavail */
#undef STATFS_HAS_BAVAIL
/* Define if the struct statfs has the member bfree */
#undef STATFS_HAS_BFREE

View File

@ -0,0 +1,41 @@
/* XPM */
static char * oic_bang_95[] = {
"32 32 6 1",
" s None c None",
". s black c black",
"X s yellow c yellow",
"x s dkgreen c #008000",
"o s ltgray c #c0c0c0",
"O s dkgray c #808080",
" xxx ",
" xXXo. ",
" xXXXXo.O ",
" xXXXXX.OO ",
" xXXXXXXo.OO ",
" xXXXXXXX.OO ",
" xXXXXXXXXo.OO ",
" xXXXXXXXXX.OO ",
" xXXXXXXXXXXo.OO ",
" xXXXo...oXXX.OO ",
" xXXXX.....XXXo.OO ",
" xXXXX.....XXXX.OO ",
" xXXXXX.....XXXXo.OO ",
" xXXXXX.....XXXXX.OO ",
" xXXXXXX.....XXXXXo.OO ",
" xXXXXXXx...xXXXXXX.OO ",
" xXXXXXXXo...oXXXXXXo.OO ",
" xXXXXXXXX...XXXXXXXX.OO ",
" xXXXXXXXXXx.xXXXXXXXXo.OO ",
" xXXXXXXXXXo.oXXXXXXXXX.OO ",
" xXXXXXXXXXXX.XXXXXXXXXXo.OO ",
" xXXXXXXXXXXXXXXXXXXXXXXX.OO ",
" xXXXXXXXXXXXo..oXXXXXXXXXo.OO ",
" xXXXXXXXXXXX....XXXXXXXXXX.OO ",
"xXXXXXXXXXXXX....XXXXXXXXXXo.OO ",
"xXXXXXXXXXXXXo..oXXXXXXXXXXX.OO ",
"xXXXXXXXXXXXXXXXXXXXXXXXXXXX.OOO",
"xXXXXXXXXXXXXXXXXXXXXXXXXXXo.OOO",
" xXXXXXXXXXXXXXXXXXXXXXXXXo.OOOO",
" x........................OOOOO",
" OOOOOOOOOOOOOOOOOOOOOOOOOOO ",
" OOOOOOOOOOOOOOOOOOOOOOOOO "};

View File

@ -0,0 +1,40 @@
/* XPM */
static char * oic_hand_95[] = {
"32 32 5 1",
" s None c None",
"o s white c white",
"O s dkgray c #808080",
"+ s dkred c #800000",
"X s red c red",
" ++++++++ ",
" +++XXXXXXXX+++ ",
" +XXXXXXXXXXXXXX+ ",
" ++XXXXXXXXXXXXXXXX++ ",
" +XXXXXXXXXXXXXXXXXXXX+ ",
" +XXXXXXXXXXXXXXXXXXXXXX+ ",
" +XXXXXXXXXXXXXXXXXXXXXX+O ",
" +XXXXXXoXXXXXXXXXXoXXXXXX+O ",
" +XXXXXXoooXXXXXXXXoooXXXXXX+ ",
" +XXXXXoooooXXXXXXoooooXXXXX+O ",
" +XXXXXXoooooXXXXoooooXXXXXX+OO ",
"+XXXXXXXXoooooXXoooooXXXXXXXX+O ",
"+XXXXXXXXXooooooooooXXXXXXXXX+O ",
"+XXXXXXXXXXooooooooXXXXXXXXXX+OO",
"+XXXXXXXXXXXooooooXXXXXXXXXXX+OO",
"+XXXXXXXXXXXooooooXXXXXXXXXXX+OO",
"+XXXXXXXXXXooooooooXXXXXXXXXX+OO",
"+XXXXXXXXXooooooooooXXXXXXXXX+OO",
"+XXXXXXXXoooooXXoooooXXXXXXXX+OO",
" +XXXXXXoooooXXXXoooooXXXXXX+OOO",
" +XXXXXoooooXXXXXXoooooXXXXX+OOO",
" +XXXXXXoooXXXXXXXXoooXXXXXX+OO ",
" +XXXXXXoXXXXXXXXXXoXXXXXX+OOO ",
" +XXXXXXXXXXXXXXXXXXXXXX+OOOO ",
" +XXXXXXXXXXXXXXXXXXXXXX+OOO ",
" +XXXXXXXXXXXXXXXXXXXX+OOO ",
" ++XXXXXXXXXXXXXXXX++OOOO ",
" O+XXXXXXXXXXXXXX+OOOOO ",
" O+++XXXXXXXX+++OOOOO ",
" OO++++++++OOOOOO ",
" OOOOOOOOOOOOOO ",
" OOOOOOOO "};

View File

@ -0,0 +1,41 @@
/* XPM */
static char * oic_note_95[] = {
"32 32 6 1",
" s None c None",
". s black c black",
"X s white c white",
"o s ltgray c #c0c0c0",
"O s dkgray c #808080",
"x s blue c blue",
" OOOOOOOO ",
" OOOoXXXXXXoOOO ",
" OOoXXXXXXXXXXXXoOO ",
" OoXXXXXXXXXXXXXXXXoO ",
" OXXXXXXXXXXXXXXXXXXXX. ",
" OXXXXXXXXoxxxxoXXXXXXXX. ",
" OXXXXXXXXXxxxxxxXXXXXXXXX. ",
" OoXXXXXXXXXxxxxxxXXXXXXXXXo. ",
" OXXXXXXXXXXoxxxxoXXXXXXXXXX.O ",
"OoXXXXXXXXXXXXXXXXXXXXXXXXXXo.O ",
"OXXXXXXXXXXXXXXXXXXXXXXXXXXXX.O ",
"OXXXXXXXXXXxxxxxxxXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXxxxxxXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXxxxxxXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXxxxxxXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXxxxxxXXXXXXXXXXo.OO",
" OXXXXXXXXXXXxxxxxXXXXXXXXXX.OOO",
" OoXXXXXXXXXXxxxxxXXXXXXXXXo.OOO",
" OXXXXXXXXXXxxxxxXXXXXXXXX.OOO ",
" .XXXXXXXxxxxxxxxxXXXXXX.OOOO ",
" .XXXXXXXXXXXXXXXXXXXX.OOOO ",
" .oXXXXXXXXXXXXXXXXo.OOOO ",
" ..oXXXXXXXXXXXXo..OOOO ",
" O...oXXXXXXo...OOOO ",
" OOO...oXXX.OOOOOO ",
" OOOO.XXX.OOOOO ",
" O.XXX.OO ",
" .XX.OO ",
" .X.OO ",
" ..OO ",
" OOO ",
" OO "};

View File

@ -0,0 +1,41 @@
/* XPM */
static char * oic_ques_95[] = {
"32 32 6 1",
" s None c None",
". s black c black",
"X s white c white",
"o s ltgray c #c0c0c0",
"O s dkgray c #808080",
"x s blue c blue",
" OOOOOOOO ",
" OOOoXXXXXXoOOO ",
" OOoXXXXXXXXXXXXoOO ",
" OoXXXXXXXXXXXXXXXXoO ",
" OXXXXXXXXXXXXXXXXXXXX. ",
" OXXXXXXXoxxxxxxoXXXXXXX. ",
" OXXXXXXXoxoXXxxxxoXXXXXXX. ",
" OoXXXXXXXxxXXXXxxxxXXXXXXXo. ",
" OXXXXXXXXxxxxXXxxxxXXXXXXXX.O ",
"OoXXXXXXXXxxxxXXxxxxXXXXXXXXo.O ",
"OXXXXXXXXXoxxoXxxxxXXXXXXXXXX.O ",
"OXXXXXXXXXXXXXoxxxXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXXxxxXXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXXxxoXXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXXxxXXXXXXXXXXXXX.OO",
"OXXXXXXXXXXXXXXXXXXXXXXXXXXXo.OO",
" OXXXXXXXXXXXoxxoXXXXXXXXXXX.OOO",
" OoXXXXXXXXXXxxxxXXXXXXXXXXo.OOO",
" OXXXXXXXXXXxxxxXXXXXXXXXX.OOO ",
" .XXXXXXXXXoxxoXXXXXXXXX.OOOO ",
" .XXXXXXXXXXXXXXXXXXXX.OOOO ",
" .oXXXXXXXXXXXXXXXXo.OOOO ",
" ..oXXXXXXXXXXXXo..OOOO ",
" O...oXXXXXXo...OOOO ",
" OOO...oXXX.OOOOOO ",
" OOOO.XXX.OOOOO ",
" O.XXX.OO ",
" .XX.OO ",
" .X.OO ",
" ..OO ",
" OOO ",
" OO "};

View File

@ -24,6 +24,13 @@ void WINAPI InitCommonControls(void);
#define CCS_NOMOVEX (CCS_VERT|CCS_NOMOVEY)
/* common control shared messages */
#define CCM_FIRST 0x2000
#define CCM_SETBKCOLOR (CCM_FIRST+1) // lParam = bkColor
/* StatusWindow */
#define STATUSCLASSNAME16 "msctls_statusbar"
@ -93,6 +100,9 @@ typedef struct tagUDACCEL
#define UDM_GETACCEL (WM_USER+108)
#define UDM_SETBASE (WM_USER+109)
#define UDM_GETBASE (WM_USER+110)
#define UDM_SETRANGE32 (WM_USER+111)
#define UDM_GETRANGE32 (WM_USER+112)
/* Progress Bar */
@ -107,6 +117,21 @@ typedef struct tagUDACCEL
#define PBM_DELTAPOS (WM_USER+3)
#define PBM_SETSTEP (WM_USER+4)
#define PBM_STEPIT (WM_USER+5)
#define PBM_SETRANGE32 (WM_USER+6)
#define PBM_GETRANGE (WM_USER+7)
#define PBM_GETPOS (WM_USER+8)
#define PBM_SETBARCOLOR (WM_USER+9)
#define PBM_SETBKCOLOR CCM_SETBKCOLOR
#define PBS_SMOOTH 0x01
#define PBS_VERTICAL 0x04
typedef struct
{
INT32 iLow;
INT32 iHigh;
} PBRANGE, *PPBRANGE;
/* Functions prototypes */

View File

@ -150,9 +150,41 @@ typedef struct {
LPARAM lCustData; /* data passed to hook fn. */
WNDPROC16 lpfnHook;
SEGPTR lpTemplateName; /* custom template name */
} FINDREPLACE;
typedef FINDREPLACE *LPFINDREPLACE;
} FINDREPLACE16, *LPFINDREPLACE16;
typedef struct {
DWORD lStructSize;
HWND32 hwndOwner;
HINSTANCE32 hInstance;
DWORD Flags;
LPSTR lpstrFindWhat;
LPSTR lpstrReplaceWith;
WORD wFindWhatLen;
WORD wReplaceWithLen;
LPARAM lCustData;
WNDPROC32 lpfnHook;
LPCSTR lpTemplateName;
} FINDREPLACE32A, *LPFINDREPLACE32A;
typedef struct {
DWORD lStructSize;
HWND32 hwndOwner;
HINSTANCE32 hInstance;
DWORD Flags;
LPWSTR lpstrFindWhat;
LPWSTR lpstrReplaceWith;
WORD wFindWhatLen;
WORD wReplaceWithLen;
LPARAM lCustData;
WNDPROC32 lpfnHook;
LPCWSTR lpTemplateName;
} FINDREPLACE32W, *LPFINDREPLACE32W;
DECL_WINELIB_TYPE_AW(FINDREPLACE);
DECL_WINELIB_TYPE_AW(LPFINDREPLACE);
#define FR_DOWN 0x00000001
#define FR_WHOLEWORD 0x00000002
#define FR_MATCHCASE 0x00000004
@ -393,7 +425,10 @@ typedef DEVNAMES * LPDEVNAMES;
BOOL16 WINAPI ChooseColor(LPCHOOSECOLOR lpChCol);
DWORD WINAPI CommDlgExtendedError(void);
HWND16 WINAPI FindText( SEGPTR find);
HWND16 WINAPI FindText16( SEGPTR find);
HWND32 WINAPI FindText32A(LPFINDREPLACE32A lpFind);
HWND32 WINAPI FindText32W(LPFINDREPLACE32W lpFind);
#define FindText WINELIB_NAME_AW(FindText)
INT16 WINAPI GetFileTitle16(LPCSTR lpFile, LPSTR lpTitle, UINT16 cbBuf);
INT16 WINAPI GetFileTitle32A(LPCSTR lpFile, LPSTR lpTitle, UINT32 cbBuf);
INT16 WINAPI GetFileTitle32W(LPCWSTR lpFile, LPWSTR lpTitle, UINT32 cbBuf);
@ -407,13 +442,22 @@ BOOL32 WINAPI GetSaveFileName32A(LPOPENFILENAME32A ofn);
BOOL32 WINAPI GetSaveFileName32W(LPOPENFILENAME32W ofn);
#define GetSaveFileName WINELIB_NAME_AW(GetSaveFileName)
BOOL16 WINAPI PrintDlg( SEGPTR print);
HWND16 WINAPI ReplaceText( SEGPTR find);
HWND16 WINAPI ReplaceText16( SEGPTR find);
HWND32 WINAPI ReplaceText32A( LPFINDREPLACE32A lpFind);
HWND32 WINAPI ReplaceText32W( LPFINDREPLACE32W lpFind);
#define ReplaceText WINELIB_NAME_AW(ReplaceText)
BOOL16 WINAPI ChooseFont(LPCHOOSEFONT lpChFont);
LRESULT WINAPI FileOpenDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FileSaveDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI ColorDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI ReplaceTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProc32A(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam, LPARAM lParam);
LRESULT WINAPI FindTextDlgProc32W(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam, LPARAM lParam);
#define FindTextDlgProc WINELIB_NAME_AW(FindTextDlgProc)
LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI ReplaceTextDlgProc32A(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam, LPARAM lParam);
LRESULT WINAPI ReplaceTextDlgProc32W(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam, LPARAM lParam);
#define ReplaceTextProc WINELIB_NAME_AW(ReplaceTextDlgProc)
LRESULT WINAPI PrintDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI PrintSetupDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
LRESULT WINAPI FormatCharDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);

View File

@ -24,8 +24,7 @@ OLESTATUS WINAPI CLSIDFromString32(LPCOLESTR32, CLSID *);
OLESTATUS WINAPI WINE_StringFromCLSID(const CLSID *id, LPSTR);
OLESTATUS WINAPI StringFromGUID2(const REFGUID *id, LPOLESTR32 *str, INT32 cmax);
// #define StringFromGUID2 WINELIB_NAME(StringFromGUID2)
INT32 WINAPI StringFromGUID2(REFGUID id, LPOLESTR32 str, INT32 cmax);
#ifdef INITGUID

View File

@ -33,15 +33,27 @@
/* Define if X libraries are not reentrant (compiled without -D_REENTRANT). */
#undef NO_REENTRANT_X11
/* Define if you have machine/soundcard.h instead of sys/soundcard.h. */
#undef HAVE_MACHINE_SOUNDCARD_H
/* Define if the struct statfs has the member bavail */
#undef STATFS_HAS_BAVAIL
/* Define if the struct statfs has the member bfree */
#undef STATFS_HAS_BFREE
/* The number of bytes in a long long. */
#undef SIZEOF_LONG_LONG
/* Define if you have the clone function. */
#undef HAVE_CLONE
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the sigaltstack function. */
#undef HAVE_SIGALTSTACK
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
@ -60,6 +72,42 @@
/* Define if you have the waitpid function. */
#undef HAVE_WAITPID
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define if you have the <linux/cdrom.h> header file. */
#undef HAVE_LINUX_CDROM_H
/* Define if you have the <machine/soundcard.h> header file. */
#undef HAVE_MACHINE_SOUNDCARD_H
/* Define if you have the <sys/cdio.h> header file. */
#undef HAVE_SYS_CDIO_H
/* Define if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
/* Define if you have the <sys/mount.h> header file. */
#undef HAVE_SYS_MOUNT_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H
/* Define if you have the <sys/statfs.h> header file. */
#undef HAVE_SYS_STATFS_H
/* Define if you have the <sys/syscall.h> header file. */
#undef HAVE_SYS_SYSCALL_H
/* Define if you have the <sys/vfs.h> header file. */
#undef HAVE_SYS_VFS_H
/* Define if you have the <syscall.h> header file. */
#undef HAVE_SYSCALL_H
/* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H

View File

@ -1049,48 +1049,49 @@ struct IDirectDrawSurface2 {
typedef struct IDirectDrawSurface3_VTable {
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*00*/STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
/*04*/STDMETHOD_(ULONG,AddRef) (THIS) PURE;
/*08*/STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectDrawSurface methods ***/
STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT32) PURE;
STDMETHOD(Blt)(THIS_ LPRECT32,LPDIRECTDRAWSURFACE3, LPRECT32,DWORD, LPDDBLTFX) PURE;
STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT32,DWORD) PURE;
STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
STDMETHOD(GetDC)(THIS_ HDC32 FAR *) PURE;
STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
STDMETHOD(IsLost)(THIS) PURE;
STDMETHOD(Lock)(THIS_ LPRECT32,LPDDSURFACEDESC,DWORD,HANDLE32) PURE;
STDMETHOD(ReleaseDC)(THIS_ HDC32) PURE;
STDMETHOD(Restore)(THIS) PURE;
STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
STDMETHOD(UpdateOverlay)(THIS_ LPRECT32, LPDIRECTDRAWSURFACE3,LPRECT32,DWORD, LPDDOVERLAYFX) PURE;
STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
/*0c*/STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
/*10*/STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT32) PURE;
/*14*/STDMETHOD(Blt)(THIS_ LPRECT32,LPDIRECTDRAWSURFACE3, LPRECT32,DWORD, LPDDBLTFX) PURE;
/*18*/STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
/*1c*/STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT32,DWORD) PURE;
/*20*/STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
/*24*/STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
/*28*/STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
/*2c*/STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
/*30*/STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
/*34*/STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
/*38*/STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
/*3c*/STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
/*40*/STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
/*44*/STDMETHOD(GetDC)(THIS_ HDC32 FAR *) PURE;
/*48*/STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
/*4c*/STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
/*50*/STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
/*54*/STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
/*58*/STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
/*5c*/STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
/*60*/STDMETHOD(IsLost)(THIS) PURE;
/*64*/STDMETHOD(Lock)(THIS_ LPRECT32,LPDDSURFACEDESC,DWORD,HANDLE32) PURE;
/*68*/STDMETHOD(ReleaseDC)(THIS_ HDC32) PURE;
/*6c*/STDMETHOD(Restore)(THIS) PURE;
/*70*/STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
/*74*/STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
/*78*/STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
/*7c*/STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
/*80*/STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
/*84*/STDMETHOD(UpdateOverlay)(THIS_ LPRECT32, LPDIRECTDRAWSURFACE3,LPRECT32,DWORD, LPDDOVERLAYFX) PURE;
/*88*/STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
/*8c*/STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
/*** Added in the v2 interface ***/
STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
STDMETHOD(PageLock)(THIS_ DWORD) PURE;
STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
/*90*/STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
/*94*/STDMETHOD(PageLock)(THIS_ DWORD) PURE;
/*98*/STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
/*** Added in the V3 interface ***/
STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE;
/*9c*/STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE;
} *LPDIRECTDRAWSURFACE3_VTABLE,IDirectDrawSurface3_VTable;
struct IDirectDrawSurface3 {

View File

@ -11,8 +11,8 @@ LPSTR debugstr_an (LPCSTR s, int n);
LPSTR debugstr_a (LPCSTR s);
LPSTR debugstr_wn (LPCWSTR s, int n);
LPSTR debugstr_w (LPCWSTR s);
LPSTR debugres (const void *res);
LPSTR debugres_a (LPCSTR res);
LPSTR debugres_w (LPCWSTR res);
void debug_dumpstr (LPCSTR s);
#endif /* __WINE_DEBUGSTR_H */

View File

@ -2,6 +2,8 @@
#ifndef __WINE_DEBUGTOOLS_H
#define __WINE_DEBUGTOOLS_H
#ifdef __WINE__ /* Debugging interface is internal to Wine */
#include <stdio.h>
#include "debugstr.h"
@ -50,4 +52,6 @@ extern short debug_msg_enabled[][DEBUG_CLASS_COUNT];
#define WARN_ON(ch) DEBUGGING(warn, ch)
#define TRACE_ON(ch) DEBUGGING(trace, ch)
#endif /* __WINE__ */
#endif /* __WINE_DEBUGTOOLS_H */

View File

@ -58,9 +58,6 @@ extern HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr );
extern int DIR_Init(void);
extern UINT32 DIR_GetWindowsUnixDir( LPSTR path, UINT32 count );
extern UINT32 DIR_GetSystemUnixDir( LPSTR path, UINT32 count );
extern UINT32 DIR_GetTempUnixDir( LPSTR path, UINT32 count );
extern UINT32 DIR_GetDosPath( INT32 element, LPSTR path, UINT32 count );
extern UINT32 DIR_GetUnixPath( INT32 element, LPSTR path, UINT32 count );
extern DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext,
DOS_FULL_NAME *full_name, BOOL32 win32 );

View File

@ -16,6 +16,7 @@ typedef struct
int shmid;
} SHMDATA;
/* memory/global.c */
extern HGLOBAL16 GLOBAL_CreateBlock( UINT16 flags, const void *ptr, DWORD size,
HGLOBAL16 hOwner, BOOL16 isCode,
BOOL16 is32Bit, BOOL16 isReadOnly,
@ -26,4 +27,8 @@ extern HGLOBAL16 GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL16 hOwner,
BOOL16 isReadOnly );
extern WORD GlobalHandleToSel( HGLOBAL16 handle );
/* memory/virtual.c */
extern DWORD VIRTUAL_GetPageSize(void);
extern DWORD VIRTUAL_GetGranularity(void);
#endif /* __WINE_GLOBAL_H */

View File

@ -11,8 +11,8 @@ struct _IMAGELIST
{
HBITMAP32 hbmImage;
HBITMAP32 hbmMask;
HBRUSH32 hbrushBlend25;
HBRUSH32 hbrushBlend50;
HBRUSH32 hbrBlend25;
HBRUSH32 hbrBlend50;
COLORREF clrBk;
INT32 cInitial;
INT32 cGrow;

View File

@ -62,7 +62,8 @@ extern void K32OBJ_DecCount( K32OBJ *ptr );
extern BOOL32 K32OBJ_IsValid( K32OBJ *ptr, K32OBJ_TYPE type );
extern BOOL32 K32OBJ_AddName( K32OBJ *obj, LPCSTR name );
extern K32OBJ *K32OBJ_Create( K32OBJ_TYPE type, DWORD size, LPCSTR name,
DWORD access, HANDLE32 *handle );
DWORD access, SECURITY_ATTRIBUTES *sa,
HANDLE32 *handle );
extern K32OBJ *K32OBJ_FindName( LPCSTR name );
extern K32OBJ *K32OBJ_FindNameType( LPCSTR name, K32OBJ_TYPE type );

View File

@ -11,7 +11,7 @@
#include "pe_image.h"
/* In-memory module structure. See 'Windows Internals' p. 219 */
typedef struct
typedef struct _NE_MODULE
{
WORD magic; /* 00 'NE' signature */
WORD count; /* 02 Usage count */
@ -128,10 +128,11 @@ extern int MODULE_OpenFile( HMODULE32 hModule );
extern LPSTR MODULE_GetModuleName( HMODULE32 hModule );
extern void MODULE_RegisterModule( NE_MODULE *pModule );
extern HMODULE32 MODULE_FindModule( LPCSTR path );
extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, LOADPARAMS* paramBlock );
extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, BOOL32 lib_only );
extern HINSTANCE16 MODULE_GetInstance( HMODULE32 hModule );
extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
extern HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 flags );
extern HINSTANCE16 MODULE_Load( LPCSTR name, UINT16 uFlags, LPCSTR cmd_line,
LPCSTR env, UINT32 show_cmd );
extern WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name );
extern FARPROC16 MODULE_GetEntryPoint( HMODULE32 hModule, WORD ordinal );
extern BOOL16 MODULE_SetEntryPoint( HMODULE32 hModule, WORD ordinal,

View File

@ -20,18 +20,16 @@
#define MAX_MIDIOUTDRV (16)
#define MAX_MCIMIDIDRV (1)
#if defined (linux)
#define __HAS_SOUNDCARD_H__
#include <sys/soundcard.h>
#elif defined (__FreeBSD__)
#define __HAS_SOUNDCARD_H__
#include <machine/soundcard.h>
#include <sys/errno.h>
#ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
# include <machine/soundcard.h>
#endif
#if defined (__HAS_SOUNDCARD_H__)
#include <sys/errno.h>
#define MIDI_DEV "/dev/sequencer"
#define MIDI_DEV "/dev/midi"
#ifdef SOUND_VERSION
#define IOCTL(a,b,c) ioctl(a,b,&c)
@ -75,7 +73,4 @@ typedef struct {
HLOCAL16 hMidiHdr;
WORD dwStatus;
} LINUX_MCIMIDI;
#endif
#endif /* __WINE_MULTIMEDIA_H */

View File

@ -42,6 +42,8 @@ extern HRSRC32 PE_FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
extern DWORD PE_SizeofResource32(HINSTANCE32,HRSRC32);
extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,struct _PDB32*,HFILE32,DWORD);
extern HGLOBAL32 PE_LoadResource32(HINSTANCE32,HRSRC32);
extern HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs,
LPCSTR cmd_line, LPCSTR env, UINT16 showCmd);
struct _PDB32; /* forward definition */
struct _THDB; /* forward definition */

View File

@ -12,7 +12,8 @@
#include "winnt.h"
#include "k32obj.h"
#include "pe_image.h"
#include "task.h"
struct _NE_MODULE;
/* Process handle entry */
typedef struct
@ -31,21 +32,25 @@ typedef struct
/* Win32 process environment database */
typedef struct
{
LPSTR environ; /* 00 Process environment strings */
DWORD env_size; /* 04 Environment size (was: Unknown) */
LPSTR cmd_line; /* 08 Command line */
LPSTR cur_dir; /* 0c Current directory */
STARTUPINFO32A *startup_info; /* 10 Startup information */
HANDLE32 hStdin; /* 14 Handle for standard input */
HANDLE32 hStdout; /* 18 Handle for standard output */
HANDLE32 hStderr; /* 1c Handle for standard error */
DWORD unknown2; /* 20 Unknown */
DWORD inherit_console; /* 24 Inherit console flag */
DWORD break_type; /* 28 Console events flag */
K32OBJ *break_sem; /* 2c SetConsoleCtrlHandler semaphore */
K32OBJ *break_event; /* 30 SetConsoleCtrlHandler event */
K32OBJ *break_thread; /* 34 SetConsoleCtrlHandler thread */
void *break_handlers; /* 38 List of console handlers */
LPSTR environ; /* 00 Process environment strings */
DWORD unknown1; /* 04 Unknown */
LPSTR cmd_line; /* 08 Command line */
LPSTR cur_dir; /* 0c Current directory */
STARTUPINFO32A *startup_info; /* 10 Startup information */
HANDLE32 hStdin; /* 14 Handle for standard input */
HANDLE32 hStdout; /* 18 Handle for standard output */
HANDLE32 hStderr; /* 1c Handle for standard error */
DWORD unknown2; /* 20 Unknown */
DWORD inherit_console; /* 24 Inherit console flag */
DWORD break_type; /* 28 Console events flag */
K32OBJ *break_sem; /* 2c SetConsoleCtrlHandler semaphore */
K32OBJ *break_event; /* 30 SetConsoleCtrlHandler event */
K32OBJ *break_thread; /* 34 SetConsoleCtrlHandler thread */
void *break_handlers; /* 38 List of console handlers */
/* The following are Wine-specific fields */
CRITICAL_SECTION section; /* 3c Env DB critical section */
LPWSTR cmd_lineW; /* 40 Unicode command line */
WORD env_sel; /* 44 Environment strings selector */
} ENVDB;
/* Win32 process database */
@ -103,17 +108,27 @@ typedef struct _PDB32
#define PROCESS_ID_TO_PDB(id) ((PDB32 *)((id) ^ PROCESS_OBFUSCATOR))
#define PDB_TO_PROCESS_ID(pdb) ((DWORD)(pdb) ^ PROCESS_OBFUSCATOR)
/* scheduler/environ.c */
extern BOOL32 ENV_BuildEnvironment( PDB32 *pdb );
extern BOOL32 ENV_InheritEnvironment( PDB32 *pdb, LPCSTR env );
extern void ENV_FreeEnvironment( PDB32 *pdb );
/* scheduler/handle.c */
extern HANDLE_TABLE *HANDLE_AllocTable( PDB32 *process );
extern HANDLE32 HANDLE_Alloc( K32OBJ *ptr, DWORD access, BOOL32 inherit );
extern K32OBJ *HANDLE_GetObjPtr( HANDLE32 handle, K32OBJ_TYPE type,
DWORD access );
extern BOOL32 HANDLE_SetObjPtr( HANDLE32 handle, K32OBJ *ptr, DWORD access );
extern BOOL32 HANDLE_CreateTable( PDB32 *pdb, BOOL32 inherit );
extern HANDLE32 HANDLE_Alloc( PDB32 *pdb, K32OBJ *ptr, DWORD access,
BOOL32 inherit );
extern K32OBJ *HANDLE_GetObjPtr( PDB32 *pdb, HANDLE32 handle,
K32OBJ_TYPE type, DWORD access );
extern BOOL32 HANDLE_SetObjPtr( PDB32 *pdb, HANDLE32 handle,
K32OBJ *ptr, DWORD access );
extern void HANDLE_CloseAll( PDB32 *pdb, K32OBJ *ptr );
/* scheduler/process.c */
extern PDB32 *PROCESS_Current(void);
extern PDB32 *PROCESS_GetPtr( HANDLE32 handle, DWORD access );
extern PDB32 *PROCESS_IdToPDB( DWORD id );
extern PDB32 *PROCESS_Create( TDB *pTask, LPCSTR cmd_line );
extern void PROCESS_CloseObjHandles(PDB32 *pdb, K32OBJ *ptr);
extern PDB32 *PROCESS_Create( struct _NE_MODULE *pModule, LPCSTR cmd_line,
LPCSTR env, HINSTANCE16 hInstance,
HINSTANCE16 hPrevInstance, UINT32 cmdShow );
#endif /* __WINE_PROCESS_H */

View File

@ -16,6 +16,8 @@ typedef struct
INT32 MinVal; /* Minimum progress value */
INT32 MaxVal; /* Maximum progress value */
INT32 Step; /* Step to use on PMB_STEPIT */
COLORREF ColorBar; /* Bar color */
COLORREF ColorBk; /* Background color */
} PROGRESS_INFO;
LRESULT WINAPI ProgressWindowProc(HWND32, UINT32, WPARAM32, LPARAM);

View File

@ -16,6 +16,7 @@ extern WORD SELECTOR_AllocBlock( const void *base, DWORD size,
extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size,
enum seg_type type, BOOL32 is32bit,
BOOL32 readonly );
extern void SELECTOR_MoveBlock( WORD sel, const void *new_base );
extern void SELECTOR_FreeBlock( WORD sel, WORD count );
#ifdef __i386__

View File

@ -50,6 +50,7 @@ typedef struct
struct _THDB;
struct _WSINFO;
struct _NE_MODULE;
/* signal proc typedef */
typedef void (CALLBACK *USERSIGNALPROC)(HANDLE16, UINT16, UINT16,
@ -124,11 +125,9 @@ typedef struct _TDB
#pragma pack(4)
extern BOOL32 TASK_Init(void);
extern HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
HINSTANCE16 hPrevInstance,
HANDLE16 hEnvironment, LPCSTR cmdLine,
UINT16 cmdShow );
extern HTASK16 TASK_Create( struct _THDB *thdb, struct _NE_MODULE *pModule,
HINSTANCE16 hInstance, HINSTANCE16 hPrevInstance,
UINT16 cmdShow );
extern void TASK_KillCurrentTask( INT16 exitCode );
extern HTASK16 TASK_GetNextTask( HTASK16 hTask );
extern void TASK_Reschedule(void);

View File

@ -121,6 +121,7 @@ extern THDB *pCurrentThread;
/* scheduler/thread.c */
extern THDB *THREAD_Create( struct _PDB32 *pdb, DWORD stack_size,
BOOL32 alloc_stack16,
LPTHREAD_START_ROUTINE start_addr, LPVOID param );
extern THDB *THREAD_Current(void);
extern THDB *THREAD_GetPtr( HANDLE32 handle, DWORD access );

View File

@ -8,9 +8,9 @@
#include "windows.h"
/* resource ids for different version infos */
#define VS_FILE_INFO MAKEINTRESOURCE(16)
#define VS_VERSION_INFO MAKEINTRESOURCE(1)
#define VS_USER_INFO MAKEINTRESOURCE(100)
#define VS_FILE_INFO MAKEINTRESOURCE16(16)
#define VS_VERSION_INFO MAKEINTRESOURCE16(1)
#define VS_USER_INFO MAKEINTRESOURCE16(100)
#define VS_FFI_SIGNATURE 0xfeef04bdL /* FileInfo Magic */
#define VS_FFI_STRUCVERSION 0x00010000L /* struc version 1.0 */

View File

@ -1 +1 @@
#define WINE_RELEASE_INFO "Wine release 980329"
#define WINE_RELEASE_INFO "Wine release 980413"

View File

@ -76,6 +76,7 @@ typedef struct tagWND
DWORD dwStyle; /* Window style (from CreateWindow) */
DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
UINT32 wIDmenu; /* ID or hmenu (from CreateWindow) */
DWORD helpContext; /* Help context ID */
WORD flags; /* Misc. flags (see below) */
Window window; /* X window (only for top-level windows) */
HMENU16 hSysMenu; /* window's copy of System Menu */

View File

@ -100,6 +100,15 @@
#define HANDLE_FLAG_INHERIT 0x00000001
#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
#define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
#define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
#define THREAD_PRIORITY_NORMAL 0
#define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
#define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
#define THREAD_PRIORITY_ERROR_RETURN (0x7fffffff)
#define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
typedef struct
{
int type;

View File

@ -40,8 +40,8 @@ typedef struct tagCOORD
typedef struct tagSMALL_RECT
{
INT16 Left;
INT16 Right;
INT16 Top;
INT16 Right;
INT16 Bottom;
} SMALL_RECT,*LPSMALL_RECT;

View File

@ -2461,45 +2461,147 @@ typedef struct tagCOMSTAT
#define WF_WIN32WOW 0x4000 /* undoc */
#define WF_WLO 0x8000
#define MAKEINTRESOURCE(i) (SEGPTR)((DWORD)((WORD)(i)))
#define MAKEINTRESOURCE16(i) (SEGPTR)((DWORD)((WORD)(i)))
#define MAKEINTRESOURCE32A(i) (LPSTR)((DWORD)((WORD)(i)))
#define MAKEINTRESOURCE32W(i) (LPWSTR)((DWORD)((WORD)(i)))
#define MAKEINTRESOURCE WINELIB_NAME_AW(MAKEINTRESOURCE)
/* Predefined resource types */
#define RT_CURSOR MAKEINTRESOURCE(1)
#define RT_BITMAP MAKEINTRESOURCE(2)
#define RT_ICON MAKEINTRESOURCE(3)
#define RT_MENU MAKEINTRESOURCE(4)
#define RT_DIALOG MAKEINTRESOURCE(5)
#define RT_STRING MAKEINTRESOURCE(6)
#define RT_FONTDIR MAKEINTRESOURCE(7)
#define RT_FONT MAKEINTRESOURCE(8)
#define RT_ACCELERATOR MAKEINTRESOURCE(9)
#define RT_RCDATA MAKEINTRESOURCE(10)
#define RT_MESSAGELIST MAKEINTRESOURCE(11)
#define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
#define RT_GROUP_ICON MAKEINTRESOURCE(14)
#define RT_CURSOR16 MAKEINTRESOURCE16(1)
#define RT_CURSOR32A MAKEINTRESOURCE32A(1)
#define RT_CURSOR32W MAKEINTRESOURCE32W(1)
#define RT_CURSOR WINELIB_NAME_AW(RT_CURSOR)
#define RT_BITMAP16 MAKEINTRESOURCE16(2)
#define RT_BITMAP32A MAKEINTRESOURCE32A(2)
#define RT_BITMAP32W MAKEINTRESOURCE32W(2)
#define RT_BITMAP WINELIB_NAME_AW(RT_BITMAP)
#define RT_ICON16 MAKEINTRESOURCE16(3)
#define RT_ICON32A MAKEINTRESOURCE32A(3)
#define RT_ICON32W MAKEINTRESOURCE32W(3)
#define RT_ICON WINELIB_NAME_AW(RT_ICON)
#define RT_MENU16 MAKEINTRESOURCE16(4)
#define RT_MENU32A MAKEINTRESOURCE32A(4)
#define RT_MENU32W MAKEINTRESOURCE32W(4)
#define RT_MENU WINELIB_NAME_AW(RT_MENU)
#define RT_DIALOG16 MAKEINTRESOURCE16(5)
#define RT_DIALOG32A MAKEINTRESOURCE32A(5)
#define RT_DIALOG32W MAKEINTRESOURCE32W(5)
#define RT_DIALOG WINELIB_NAME_AW(RT_DIALOG)
#define RT_STRING16 MAKEINTRESOURCE16(6)
#define RT_STRING32A MAKEINTRESOURCE32A(6)
#define RT_STRING32W MAKEINTRESOURCE32W(6)
#define RT_STRING WINELIB_NAME_AW(RT_STRING)
#define RT_FONTDIR16 MAKEINTRESOURCE16(7)
#define RT_FONTDIR32A MAKEINTRESOURCE32A(7)
#define RT_FONTDIR32W MAKEINTRESOURCE32W(7)
#define RT_FONTDIR WINELIB_NAME_AW(RT_FONTDIR)
#define RT_FONT16 MAKEINTRESOURCE16(8)
#define RT_FONT32A MAKEINTRESOURCE32A(8)
#define RT_FONT32W MAKEINTRESOURCE32W(8)
#define RT_FONT WINELIB_NAME_AW(RT_FONT)
#define RT_ACCELERATOR16 MAKEINTRESOURCE16(9)
#define RT_ACCELERATOR32A MAKEINTRESOURCE32A(9)
#define RT_ACCELERATOR32W MAKEINTRESOURCE32W(9)
#define RT_ACCELERATOR WINELIB_NAME_AW(RT_ACCELERATOR)
#define RT_RCDATA16 MAKEINTRESOURCE16(10)
#define RT_RCDATA32A MAKEINTRESOURCE32A(10)
#define RT_RCDATA32W MAKEINTRESOURCE32W(10)
#define RT_RCDATA WINELIB_NAME_AW(RT_RCDATA)
#define RT_MESSAGELIST16 MAKEINTRESOURCE16(11)
#define RT_MESSAGELIST32A MAKEINTRESOURCE32A(11)
#define RT_MESSAGELIST32W MAKEINTRESOURCE32W(11)
#define RT_MESSAGELIST WINELIB_NAME_AW(RT_MESSAGELIST)
#define RT_GROUP_CURSOR16 MAKEINTRESOURCE16(12)
#define RT_GROUP_CURSOR32A MAKEINTRESOURCE32A(12)
#define RT_GROUP_CURSOR32W MAKEINTRESOURCE32W(12)
#define RT_GROUP_CURSOR WINELIB_NAME_AW(RT_GROUP_CURSOR)
#define RT_GROUP_ICON16 MAKEINTRESOURCE16(14)
#define RT_GROUP_ICON32A MAKEINTRESOURCE32A(14)
#define RT_GROUP_ICON32W MAKEINTRESOURCE32W(14)
#define RT_GROUP_ICON WINELIB_NAME_AW(RT_GROUP_ICON)
/* Predefined resources */
#define IDI_APPLICATION MAKEINTRESOURCE(32512)
#define IDI_HAND MAKEINTRESOURCE(32513)
#define IDI_QUESTION MAKEINTRESOURCE(32514)
#define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
#define IDI_ASTERISK MAKEINTRESOURCE(32516)
#define IDI_APPLICATION16 MAKEINTRESOURCE16(32512)
#define IDI_APPLICATION32A MAKEINTRESOURCE32A(32512)
#define IDI_APPLICATION32W MAKEINTRESOURCE32W(32512)
#define IDI_APPLICATION WINELIB_NAME_AW(IDI_APPLICATION)
#define IDI_HAND16 MAKEINTRESOURCE16(32513)
#define IDI_HAND32A MAKEINTRESOURCE32A(32513)
#define IDI_HAND32W MAKEINTRESOURCE32W(32513)
#define IDI_HAND WINELIB_NAME_AW(IDI_HAND)
#define IDI_QUESTION16 MAKEINTRESOURCE16(32514)
#define IDI_QUESTION32A MAKEINTRESOURCE32A(32514)
#define IDI_QUESTION32W MAKEINTRESOURCE32W(32514)
#define IDI_QUESTION WINELIB_NAME_AW(IDI_QUESTION)
#define IDI_EXCLAMATION16 MAKEINTRESOURCE16(32515)
#define IDI_EXCLAMATION32A MAKEINTRESOURCE32A(32515)
#define IDI_EXCLAMATION32W MAKEINTRESOURCE32W(32515)
#define IDI_EXCLAMATION WINELIB_NAME_AW(IDI_EXCLAMATION)
#define IDI_ASTERISK16 MAKEINTRESOURCE16(32516)
#define IDI_ASTERISK32A MAKEINTRESOURCE32A(32516)
#define IDI_ASTERISK32W MAKEINTRESOURCE32W(32516)
#define IDI_ASTERISK WINELIB_NAME_AW(IDI_ASTERISK)
#define IDC_BUMMER MAKEINTRESOURCE(100)
#define IDC_ARROW MAKEINTRESOURCE(32512)
#define IDC_IBEAM MAKEINTRESOURCE(32513)
#define IDC_WAIT MAKEINTRESOURCE(32514)
#define IDC_CROSS MAKEINTRESOURCE(32515)
#define IDC_UPARROW MAKEINTRESOURCE(32516)
#define IDC_SIZE MAKEINTRESOURCE(32640)
#define IDC_ICON MAKEINTRESOURCE(32641)
#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
#define IDC_SIZENESW MAKEINTRESOURCE(32643)
#define IDC_SIZEWE MAKEINTRESOURCE(32644)
#define IDC_SIZENS MAKEINTRESOURCE(32645)
#define IDC_NO MAKEINTRESOURCE(32648)
#define IDC_APPSTARTING MAKEINTRESOURCE(32650)
#define IDC_HELP MAKEINTRESOURCE(32651)
#define IDC_BUMMER16 MAKEINTRESOURCE16(100)
#define IDC_BUMMER32A MAKEINTRESOURCE32A(100)
#define IDC_BUMMER32W MAKEINTRESOURCE32W(100)
#define IDC_BUMMER WINELIB_NAME_AW(IDC_BUMMER)
#define IDC_ARROW16 MAKEINTRESOURCE16(32512)
#define IDC_ARROW32A MAKEINTRESOURCE32A(32512)
#define IDC_ARROW32W MAKEINTRESOURCE32W(32512)
#define IDC_ARROW WINELIB_NAME_AW(IDC_ARROW)
#define IDC_IBEAM16 MAKEINTRESOURCE16(32513)
#define IDC_IBEAM32A MAKEINTRESOURCE32A(32513)
#define IDC_IBEAM32W MAKEINTRESOURCE32W(32513)
#define IDC_IBEAM WINELIB_NAME_AW(IDC_IBEAM)
#define IDC_WAIT16 MAKEINTRESOURCE16(32514)
#define IDC_WAIT32A MAKEINTRESOURCE32A(32514)
#define IDC_WAIT32W MAKEINTRESOURCE32W(32514)
#define IDC_WAIT WINELIB_NAME_AW(IDC_WAIT)
#define IDC_CROSS16 MAKEINTRESOURCE16(32515)
#define IDC_CROSS32A MAKEINTRESOURCE32A(32515)
#define IDC_CROSS32W MAKEINTRESOURCE32W(32515)
#define IDC_CROSS WINELIB_NAME_AW(IDC_CROSS)
#define IDC_UPARROW16 MAKEINTRESOURCE16(32516)
#define IDC_UPARROW32A MAKEINTRESOURCE32A(32516)
#define IDC_UPARROW32W MAKEINTRESOURCE32W(32516)
#define IDC_UPARROW WINELIB_NAME_AW(IDC_UPARROW)
#define IDC_SIZE16 MAKEINTRESOURCE16(32640)
#define IDC_SIZE32A MAKEINTRESOURCE32A(32640)
#define IDC_SIZE32W MAKEINTRESOURCE32W(32640)
#define IDC_SIZE WINELIB_NAME_AW(IDC_SIZE)
#define IDC_ICON16 MAKEINTRESOURCE16(32641)
#define IDC_ICON32A MAKEINTRESOURCE32A(32641)
#define IDC_ICON32W MAKEINTRESOURCE32W(32641)
#define IDC_ICON WINELIB_NAME_AW(IDC_ICON)
#define IDC_SIZENWSE16 MAKEINTRESOURCE16(32642)
#define IDC_SIZENWSE32A MAKEINTRESOURCE32A(32642)
#define IDC_SIZENWSE32W MAKEINTRESOURCE32W(32642)
#define IDC_SIZENWSE WINELIB_NAME_AW(IDC_SIZENWSE)
#define IDC_SIZENESW16 MAKEINTRESOURCE16(32643)
#define IDC_SIZENESW32A MAKEINTRESOURCE32A(32643)
#define IDC_SIZENESW32W MAKEINTRESOURCE32W(32643)
#define IDC_SIZENESW WINELIB_NAME_AW(IDC_SIZENESW)
#define IDC_SIZEWE16 MAKEINTRESOURCE16(32644)
#define IDC_SIZEWE32A MAKEINTRESOURCE32A(32644)
#define IDC_SIZEWE32W MAKEINTRESOURCE32W(32644)
#define IDC_SIZEWE WINELIB_NAME_AW(IDC_SIZEWE)
#define IDC_SIZENS16 MAKEINTRESOURCE16(32645)
#define IDC_SIZENS32A MAKEINTRESOURCE32A(32645)
#define IDC_SIZENS32W MAKEINTRESOURCE32W(32645)
#define IDC_SIZENS WINELIB_NAME_AW(IDC_SIZENS)
#define IDC_NO16 MAKEINTRESOURCE16(32648)
#define IDC_NO32A MAKEINTRESOURCE32A(32648)
#define IDC_NO32W MAKEINTRESOURCE32W(32648)
#define IDC_NO WINELIB_NAME_AW(IDC_NO)
#define IDC_APPSTARTING16 MAKEINTRESOURCE16(32650)
#define IDC_APPSTARTING32A MAKEINTRESOURCE32A(32650)
#define IDC_APPSTARTING32W MAKEINTRESOURCE32W(32650)
#define IDC_APPSTARTING WINELIB_NAME_AW(IDC_APPSTARTING)
#define IDC_HELP16 MAKEINTRESOURCE16(32651)
#define IDC_HELP32A MAKEINTRESOURCE32A(32651)
#define IDC_HELP32W MAKEINTRESOURCE32W(32651)
#define IDC_HELP WINELIB_NAME_AW(IDC_HELP)
/* OEM Resource Ordinal Numbers */
#define OBM_CLOSE 32754
@ -4259,6 +4361,7 @@ typedef struct tagMEMORYSTATUS
#define CF_PENDATA 10
#define CF_RIFF 11
#define CF_WAVE 12
#define CF_ENHMETAFILE 14
#define CF_OWNERDISPLAY 0x0080
#define CF_DSPTEXT 0x0081
@ -4430,6 +4533,7 @@ DECL_WINELIB_TYPE(LPMETAFILEPICT);
#define META_CREATEBITMAPINDIRECT 0x02FD
#define META_CREATEBITMAP 0x06FE
#define META_CREATEREGION 0x06FF
#define META_UNKNOWN 0x0529 /* FIXME: unknown meta magic */
typedef INT16 (CALLBACK *MFENUMPROC16)(HDC16,HANDLETABLE16*,METARECORD*,
INT16,LPARAM);
@ -5587,13 +5691,13 @@ typedef void (CALLBACK *MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo);
typedef struct /* not sure if the 16bit version is correct */
{
UINT16 cbSize;
UINT32 cbSize;
HWND16 hwndOwner;
HINSTANCE16 hInstance;
LPCSTR lpszText;
LPCSTR lpszCaption;
SEGPTR lpszText;
SEGPTR lpszCaption;
DWORD dwStyle;
LPCSTR lpszIcon;
SEGPTR lpszIcon;
DWORD dwContextHelpId;
MSGBOXCALLBACK lpfnMsgBoxCallback;
DWORD dwLanguageId;
@ -5659,6 +5763,7 @@ typedef enum _WOW_HANDLE_TYPE { /* WOW */
/* Declarations for functions that exist only in Win16 */
#ifndef WINELIB
WORD WINAPI AllocCStoDSAlias(WORD);
WORD WINAPI AllocDStoCSAlias(WORD);
WORD WINAPI AllocSelector(WORD);
@ -5811,7 +5916,7 @@ BOOL16 WINAPI WaitEvent(HTASK16);
INT16 WINAPI WriteComm(INT16,LPSTR,INT16);
VOID WINAPI WriteOutProfiles(VOID);
VOID WINAPI hmemcpy(LPVOID,LPCVOID,LONG);
#endif /* WINELIB */
/* Declarations for functions that exist only in Win32 */
@ -5823,6 +5928,8 @@ BOOL32 WINAPI CloseHandle(HANDLE32);
INT32 WINAPI CopyAcceleratorTable32A(HACCEL32,LPACCEL32,INT32);
INT32 WINAPI CopyAcceleratorTable32W(HACCEL32,LPACCEL32,INT32);
#define CopyAcceleratorTable WINELIB_NAME_AW(CopyAcceleratorTable)
HENHMETAFILE32 WINAPI CopyEnhMetaFile32A(HENHMETAFILE32,LPCSTR);
#define CopyEnhMetaFile WINELIB_NAME_AW(CopyEnhMetaFile)
BOOL32 WINAPI CopyFile32A(LPCSTR,LPCSTR,BOOL32);
BOOL32 WINAPI CopyFile32W(LPCWSTR,LPCWSTR,BOOL32);
#define CopyFile WINELIB_NAME_AW(CopyFile)
@ -5849,9 +5956,11 @@ HANDLE32 WINAPI CreateSemaphore32A(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
HANDLE32 WINAPI CreateSemaphore32W(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
#define CreateSemaphore WINELIB_NAME_AW(CreateSemaphore)
HANDLE32 WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
BOOL32 WINAPI DeleteEnhMetaFile(HENHMETAFILE32);
BOOL32 WINAPI DestroyAcceleratorTable(HACCEL32);
BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32);
BOOL32 WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
BOOL32 WINAPI DuplicateHandle(HANDLE32,HANDLE32,HANDLE32,HANDLE32*,DWORD,BOOL32,DWORD);
INT32 WINAPI EnumPropsEx32A(HWND32,PROPENUMPROCEX32A,LPARAM);
INT32 WINAPI EnumPropsEx32W(HWND32,PROPENUMPROCEX32W,LPARAM);
#define EnumPropsEx WINELIB_NAME_AW(EnumPropsEx)
@ -5921,6 +6030,10 @@ INT32 WINAPI GetDateFormat32A(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT32);
INT32 WINAPI GetDateFormat32W(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT32);
#define GetDateFormat WINELIB_NAME_AW(GetDateFormat)
BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32);
HENHMETAFILE32 WINAPI GetEnhMetaFile32A(LPCSTR);
HENHMETAFILE32 WINAPI GetEnhMetaFile32W(LPCWSTR);
#define GetEnhMetaFile WINELIB_NAME_AW(GetEnhMetaFile)
UINT32 WINAPI GetEnhMetaFileHeader(HENHMETAFILE32,UINT32,LPENHMETAHEADER);
LPSTR WINAPI GetEnvironmentStrings32A(void);
LPWSTR WINAPI GetEnvironmentStrings32W(void);
#define GetEnvironmentStrings WINELIB_NAME_AW(GetEnvironmentStrings)
@ -5976,6 +6089,7 @@ BOOL32 WINAPI GetThreadSelectorEntry(HANDLE32,DWORD,LPLDT_ENTRY);
BOOL32 WINAPI GetUserName32A(LPSTR,LPDWORD);
BOOL32 WINAPI GetUserName32W(LPWSTR,LPDWORD);
#define GetUserName WINELIB_NAME_AW(GetUserName)
DWORD WINAPI GetWindowContextHelpId(HWND32);
DWORD WINAPI GetWindowThreadProcessId(HWND32,LPDWORD);
BOOL32 WINAPI GetWorldTransform(HDC32,LPXFORM);
VOID WINAPI GlobalMemoryStatus(LPMEMORYSTATUS);
@ -6027,6 +6141,8 @@ HANDLE32 WINAPI OpenProcess(DWORD,BOOL32,DWORD);
HANDLE32 WINAPI OpenSemaphore32A(DWORD,BOOL32,LPCSTR);
HANDLE32 WINAPI OpenSemaphore32W(DWORD,BOOL32,LPCWSTR);
#define OpenSemaphore WINELIB_NAME_AW(OpenSemaphore)
BOOL32 WINAPI PlayEnhMetaFile(HDC32,HENHMETAFILE32,const RECT32*);
BOOL32 WINAPI PlayEnhMetaFileRecord(HDC32,LPHANDLETABLE32,const ENHMETARECORD*,UINT32);
BOOL32 WINAPI PulseEvent(HANDLE32);
DWORD WINAPI QueryDosDevice32A(LPCSTR,LPSTR,DWORD);
DWORD WINAPI QueryDosDevice32W(LPCWSTR,LPWSTR,DWORD);
@ -6087,12 +6203,14 @@ VOID WINAPI SetLastErrorEx(DWORD,DWORD);
BOOL32 WINAPI SetMenuItemInfo32A(HMENU32,UINT32,BOOL32,const MENUITEMINFO32A*);
BOOL32 WINAPI SetMenuItemInfo32W(HMENU32,UINT32,BOOL32,const MENUITEMINFO32W*);
#define SetMenuItemInfo WINELIB_NAME_AW(SetMenuItemInfo)
HMETAFILE32 WINAPI SetMetaFileBitsEx(UINT32,const BYTE*);
BOOL32 WINAPI SetPriorityClass(HANDLE32,DWORD);
BOOL32 WINAPI SetStdHandle(DWORD,HANDLE32);
BOOL32 WINAPI SetSystemPowerState(BOOL32,BOOL32);
BOOL32 WINAPI SetSystemTime(const SYSTEMTIME*);
BOOL32 WINAPI SetThreadPriority(HANDLE32,INT32);
BOOL32 WINAPI SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION);
BOOL32 WINAPI SetWindowContextHelpId(HWND32,DWORD);
BOOL32 WINAPI SetWorldTransform(HDC32,const XFORM*);
VOID WINAPI Sleep(DWORD);
BOOL32 WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
@ -6126,6 +6244,8 @@ BOOL32 WINAPI WriteConsole32A(HANDLE32,LPCVOID,DWORD,LPDWORD,LPVOID);
BOOL32 WINAPI WriteConsole32W(HANDLE32,LPCVOID,DWORD,LPDWORD,LPVOID);
#define WriteConsole WINELIB_NAME_AW(WriteConsole)
BOOL32 WINAPI WriteFile(HANDLE32,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
VOID WINAPI ZeroMemory(LPVOID,UINT32);
#define ZeroMemory RtlZeroMemory
/* Declarations for functions that are the same in Win16 and Win32 */
@ -7240,10 +7360,21 @@ INT32 WINAPI GetTextCharacterExtra32(HDC32);
COLORREF WINAPI GetTextColor16(HDC16);
COLORREF WINAPI GetTextColor32(HDC32);
#define GetTextColor WINELIB_NAME(GetTextColor)
/* this one is different, because Win32 has *both*
* GetTextExtentPoint and GetTextExtentPoint32 !
*/
BOOL16 WINAPI GetTextExtentPoint16(HDC16,LPCSTR,INT16,LPSIZE16);
BOOL32 WINAPI GetTextExtentPoint32A(HDC32,LPCSTR,INT32,LPSIZE32);
BOOL32 WINAPI GetTextExtentPoint32W(HDC32,LPCWSTR,INT32,LPSIZE32);
#define GetTextExtentPoint WINELIB_NAME_AW(GetTextExtentPoint)
BOOL32 WINAPI GetTextExtentPoint32ABuggy(HDC32,LPCSTR,INT32,LPSIZE32);
BOOL32 WINAPI GetTextExtentPoint32WBuggy(HDC32,LPCWSTR,INT32,LPSIZE32);
#ifdef UNICODE
#define GetTextExtentPoint GetTextExtentPoint32WBuggy
#define GetTextExtentPoint32 GetTextExtentPoint32W
#else
#define GetTextExtentPoint GetTextExtentPoint32ABuggy
#define GetTextExtentPoint32 GetTextExtentPoint32A
#endif
INT16 WINAPI GetTextFace16(HDC16,INT16,LPSTR);
INT32 WINAPI GetTextFace32A(HDC32,INT32,LPSTR);
INT32 WINAPI GetTextFace32W(HDC32,INT32,LPWSTR);

View File

@ -10,38 +10,29 @@
#ifdef __WINE__
# include "config.h"
# undef WINELIB
# undef WINELIB16
# undef WINELIB32
# undef UNICODE
#else /* __WINE__ */
# ifndef WINELIB
# define WINELIB
# endif
# ifdef WINELIB16
# undef WINELIB32
# else
# define WINELIB32
# endif
#endif /* __WINE__ */
/* Macros to map Winelib names to the correct implementation name */
/* depending on WINELIB16, WINELIB32 and UNICODE macros. */
/* depending on WINELIB and UNICODE macros. */
/* Note that WINELIB is purely Win32. */
#ifdef __WINE__
# define WINELIB_NAME(func) this is a syntax error
# define WINELIB_NAME_AW(func) this is a syntax error
#else /* __WINE__ */
# ifdef WINELIB32
# ifdef WINELIB
# define WINELIB_NAME(func) func##32
# ifdef UNICODE
# define WINELIB_NAME_AW(func) func##32W
# else
# define WINELIB_NAME_AW(func) func##32A
# endif /* UNICODE */
# else /* WINELIB32 */
# define WINELIB_NAME(func) func##16
# define WINELIB_NAME_AW(func) func##16
# endif /* WINELIB32 */
# endif /* WINELIB */
#endif /* __WINE__ */
#ifdef __WINE__

View File

@ -27,7 +27,6 @@
#include "miscemu.h"
#include "options.h"
#include "spy.h"
#include "task.h"
#include "tweak.h"
#include "user.h"
#include "dce.h"
@ -60,9 +59,6 @@ BOOL32 MAIN_KernelInit(void)
/* Initialise DOS directories */
if (!DIR_Init()) return FALSE;
/* Initialize tasks */
if (!TASK_Init()) return FALSE;
/* Initialize event handling */
if (!EVENT_Init()) return FALSE;

View File

@ -18,6 +18,7 @@
#include "heap.h"
#include "module.h"
#include "neexe.h"
#include "pe_image.h"
#include "process.h"
#include "thread.h"
#include "resource.h"
@ -28,8 +29,6 @@
#include "debug.h"
#include "callback.h"
extern HINSTANCE16 PE_LoadModule( HFILE32 hf, OFSTRUCT *ofs, LOADPARAMS* params );
extern BOOL32 THREAD_InitDone;
static HMODULE16 hFirstModule = 0;
@ -375,8 +374,10 @@ HINSTANCE16 MODULE_GetInstance( HMODULE32 hModule )
/***********************************************************************
* MODULE_CreateInstance
*
* If lib_only is TRUE, handle the module like a library even if it is a .EXE
*/
HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, LOADPARAMS *params )
HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, BOOL32 lib_only )
{
SEGTABLEENTRY *pSegment;
NE_MODULE *pModule;
@ -393,7 +394,7 @@ HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, LOADPARAMS *params )
if (hPrevInstance)
{
if (pModule->flags & NE_FFLAGS_LIBMODULE) return hPrevInstance;
if (params == (LOADPARAMS*)-1) return hPrevInstance;
if (lib_only) return hPrevInstance;
}
minsize = pSegment->minsize ? pSegment->minsize : 0x10000;
@ -533,6 +534,7 @@ static HMODULE32 MODULE_LoadExeHeader( HFILE32 hFile, OFSTRUCT *ofs )
fprintf(stderr, "Sorry, this is an OS/2 linear executable (LX) file !\n");
return (HMODULE32)12;
}
/* We now have a valid NE header */
size = sizeof(NE_MODULE) +
@ -929,10 +931,10 @@ FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
extern LRESULT ColorDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileOpenDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FileSaveDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FindTextDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT FindTextDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT PrintSetupDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT ReplaceTextDlgProc(HWND16,UINT16,WPARAM16,LPARAM);
extern LRESULT ReplaceTextDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
if (!strcmp(name,"ColorDlgProc"))
return (FARPROC16)ColorDlgProc;
@ -941,13 +943,13 @@ FARPROC16 MODULE_GetWndProcEntry16( LPCSTR name )
if (!strcmp(name,"FileSaveDlgProc"))
return (FARPROC16)FileSaveDlgProc;
if (!strcmp(name,"FindTextDlgProc"))
return (FARPROC16)FindTextDlgProc;
return (FARPROC16)FindTextDlgProc16;
if (!strcmp(name,"PrintDlgProc"))
return (FARPROC16)PrintDlgProc;
if (!strcmp(name,"PrintSetupDlgProc"))
return (FARPROC16)PrintSetupDlgProc;
if (!strcmp(name,"ReplaceTextDlgProc"))
return (FARPROC16)ReplaceTextDlgProc;
return (FARPROC16)ReplaceTextDlgProc16;
fprintf(stderr,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name);
assert( FALSE );
return NULL;
@ -1135,14 +1137,18 @@ BOOL16 MODULE_FreeModule( HMODULE32 hModule, TDB* pTaskContext )
/**********************************************************************
* MODULE_Load
*
* Implementation of LoadModule()
* Implementation of LoadModule().
*
* cmd_line must contain the whole command-line, including argv[0] (and
* without a preceding length byte).
* If cmd_line is NULL, the module is loaded as a library even if it is a .exe
*/
HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
HINSTANCE16 MODULE_Load( LPCSTR name, UINT16 uFlags,
LPCSTR cmd_line, LPCSTR env, UINT32 show_cmd )
{
HMODULE32 hModule;
HINSTANCE16 hInstance, hPrevInstance;
NE_MODULE *pModule;
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
OFSTRUCT ofs;
HFILE32 hFile;
@ -1152,7 +1158,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return hModule;
pModule = (NE_MODULE *)GlobalLock16( hModule );
hPrevInstance = 0;
hInstance = MODULE_CreateInstance( hModule, params );
hInstance = MODULE_CreateInstance( hModule, (cmd_line == NULL) );
}
else
{
@ -1180,9 +1186,10 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
hModule = MODULE_LoadExeHeader( hFile, &ofs );
if (hModule < 32)
{
if (hModule == 21)
hModule = PE_LoadModule( hFile, &ofs, paramBlock );
else _lclose32( hFile );
if ((hModule == 21) && cmd_line)
hModule = PE_LoadModule( hFile, &ofs, cmd_line,
env, show_cmd );
_lclose32( hFile );
if (hModule < 32)
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
@ -1197,7 +1204,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
MODULE_CreateSegments( hModule );
hPrevInstance = 0;
hInstance = MODULE_CreateInstance(hModule,(LOADPARAMS*)paramBlock);
hInstance = MODULE_CreateInstance( hModule, (cmd_line == NULL) );
/* Load the referenced DLLs */
@ -1228,7 +1235,7 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
{
pModule = MODULE_GetPtr( hModule );
hPrevInstance = MODULE_GetInstance( hModule );
hInstance = MODULE_CreateInstance( hModule, params );
hInstance = MODULE_CreateInstance( hModule, (cmd_line == NULL) );
if (hInstance != hPrevInstance) /* not a library */
NE_LoadSegment( pModule, pModule->dgroup );
pModule->count++;
@ -1237,25 +1244,15 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
/* Create a task for this instance */
if (!(pModule->flags & NE_FFLAGS_LIBMODULE) && (paramBlock != (LPVOID)-1))
if (cmd_line && !(pModule->flags & NE_FFLAGS_LIBMODULE))
{
HTASK16 hTask;
WORD showcmd;
PDB32 *pdb;
pModule->flags |= NE_FFLAGS_GUI;
/* PowerPoint passes NULL as showCmd */
if (params->showCmd)
showcmd = *((WORD *)PTR_SEG_TO_LIN(params->showCmd)+1);
else
showcmd = 0; /* FIXME: correct */
hTask = TASK_CreateTask( hModule, hInstance, hPrevInstance,
params->hEnvironment,
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
showcmd );
if( hTask && TASK_GetNextTask(hTask)) Yield16();
pdb = PROCESS_Create( pModule, cmd_line, env, hInstance,
hPrevInstance, show_cmd );
if (pdb && (GetNumTasks() > 1)) Yield16();
}
return hInstance;
@ -1267,7 +1264,37 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 uFlags)
*/
HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
{
return MODULE_Load( name, paramBlock, 0 );
LOADPARAMS *params = (LOADPARAMS *)paramBlock;
LPSTR cmd_line = (LPSTR)PTR_SEG_TO_LIN( params->cmdLine );
LPSTR new_cmd_line;
UINT16 show_cmd = 0;
LPCVOID env = NULL;
HINSTANCE16 hInstance;
if (!paramBlock || (paramBlock == (LPVOID)-1))
return LoadLibrary16( name );
params = (LOADPARAMS *)paramBlock;
cmd_line = (LPSTR)PTR_SEG_TO_LIN( params->cmdLine );
/* PowerPoint passes NULL as showCmd */
if (params->showCmd)
show_cmd = *((UINT16 *)PTR_SEG_TO_LIN(params->showCmd)+1);
if (!cmd_line) cmd_line = "";
else if (*cmd_line) cmd_line++; /* skip the length byte */
if (!(new_cmd_line = HeapAlloc( GetProcessHeap(), 0,
strlen(cmd_line) + strlen(name) + 2 )))
return 0;
strcpy( new_cmd_line, name );
strcat( new_cmd_line, " " );
strcat( new_cmd_line, cmd_line );
if (params->hEnvironment) env = GlobalLock16( params->hEnvironment );
hInstance = MODULE_Load( name, 0, new_cmd_line, env, show_cmd );
if (params->hEnvironment) GlobalUnlock16( params->hEnvironment );
HeapFree( GetProcessHeap(), 0, new_cmd_line );
return hInstance;
}
/**********************************************************************
@ -1280,8 +1307,8 @@ HINSTANCE16 LoadModule16( LPCSTR name, LPVOID paramBlock )
*/
DWORD LoadModule32( LPCSTR name, LPVOID paramBlock )
{
#ifdef 0
LOADPARAMS32 *p = paramBlock;
LOADPARAMS32 *params = (LOADPARAMS32 *)paramBlock;
#if 0
STARTUPINFO st;
PROCESSINFORMATION pi;
st.cb = sizeof(STARTUPINFO);
@ -1297,7 +1324,8 @@ DWORD LoadModule32( LPCSTR name, LPVOID paramBlock )
CloseHandle32(pi.hThread);
#else
return MODULE_Load( name, paramBlock, 0 );
return MODULE_Load( name, 0, params->lpCmdLine, params->lpEnvAddress,
*((UINT16 *)params->lpCmdShow + 1) );
#endif
}
@ -1455,7 +1483,7 @@ HMODULE32 WINAPI LoadLibraryEx32A(LPCSTR libname,HFILE32 hfile,DWORD flags)
HMODULE32 hmod;
hmod = PE_LoadLibraryEx32A(libname,PROCESS_Current(),hfile,flags);
if (hmod <= 32) {
if (hmod < 32) {
char buffer[256];
strcpy( buffer, libname );
@ -1463,7 +1491,8 @@ HMODULE32 WINAPI LoadLibraryEx32A(LPCSTR libname,HFILE32 hfile,DWORD flags)
hmod = PE_LoadLibraryEx32A(buffer,PROCESS_Current(),hfile,flags);
}
/* initialize all DLLs, which haven't been initialized yet. */
PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, NULL);
if (hmod >= 32)
PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, NULL);
return hmod;
}
@ -1519,13 +1548,13 @@ HINSTANCE16 WINAPI LoadLibrary16( LPCSTR libname )
}
TRACE(module, "(%08x) %s\n", (int)libname, libname);
handle = MODULE_Load( libname, (LPVOID)-1, 0 );
handle = MODULE_Load( libname, 0, NULL, NULL, 0 );
if (handle == (HINSTANCE16)2) /* file not found */
{
char buffer[256];
lstrcpyn32A( buffer, libname, 252 );
strcat( buffer, ".dll" );
handle = MODULE_Load( buffer, (LPVOID)-1, 0 );
handle = MODULE_Load( buffer, 0, NULL, NULL, 0 );
}
return handle;
}
@ -1577,23 +1606,13 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow )
*/
HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
{
LOADPARAMS params;
HGLOBAL16 cmdShowHandle, cmdLineHandle;
HINSTANCE32 handle = 2;
WORD *cmdShowPtr;
char *p, *cmdline, filename[256];
char *p, filename[256];
static int use_load_module = 1;
int spacelimit = 0, exhausted = 0;
if (!lpCmdLine)
return 2; /* File not found */
if (!(cmdShowHandle = GlobalAlloc16( 0, 2 * sizeof(WORD) )))
return 8; /* Out of memory */
if (!(cmdLineHandle = GlobalAlloc16( 0, 2048 )))
{
GlobalFree16( cmdShowHandle );
return 8; /* Out of memory */
}
/* Keep trying to load a file by trying different filenames; e.g.,
for the cmdline "abcd efg hij", try "abcd" with args "efg hij",
@ -1603,15 +1622,8 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
while(!exhausted && handle == 2) {
int spacecount = 0;
/* Store nCmdShow */
cmdShowPtr = (WORD *)GlobalLock16( cmdShowHandle );
cmdShowPtr[0] = 2;
cmdShowPtr[1] = nCmdShow;
/* Build the filename and command-line */
cmdline = (char *)GlobalLock16( cmdLineHandle );
lstrcpyn32A(filename, lpCmdLine,
sizeof(filename) - 4 /* for extension */);
@ -1633,18 +1645,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
}
}
if (*p)
lstrcpyn32A( cmdline + 1, p + 1, 255 );
else
cmdline[1] = '\0';
cmdline[0] = strlen( cmdline + 1 );
*p = '\0';
/* this is a (hopefully acceptable hack to get the whole
commandline for PROCESS_Create
we put it after the processed one */
lstrcpyn32A(cmdline + (unsigned char)cmdline[0] +2,
lpCmdLine, 2048 - 256);
/* Now load the executable file */
@ -1652,11 +1653,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
{
/* Winelib: Use LoadModule() only for the program itself */
if (__winelib) use_load_module = 0;
params.hEnvironment = (HGLOBAL16)SELECTOROF( GetDOSEnvironment() );
params.cmdLine = (SEGPTR)WIN16_GlobalLock16( cmdLineHandle );
params.showCmd = (SEGPTR)WIN16_GlobalLock16( cmdShowHandle );
params.reserved = 0;
handle = LoadModule32( filename, &params );
handle = MODULE_Load( filename, 0, lpCmdLine, NULL, nCmdShow );
if (handle == 2) /* file not found */
{
/* Check that the original file name did not have a suffix */
@ -1666,8 +1663,9 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
{
p = filename + strlen(filename);
strcpy( p, ".exe" );
handle = LoadModule16( filename, &params );
*p = '\0'; /* Remove extension */
handle = MODULE_Load( filename, 0, lpCmdLine,
NULL, nCmdShow );
*p = '\0'; /* Remove extension */
}
}
}
@ -1703,7 +1701,7 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
argptr = argv;
if (iconic) *argptr++ = "-iconic";
*argptr++ = unixfilename;
p = cmdline + 1;
p = strdup(lpCmdLine);
while (1)
{
while (*p && (*p == ' ' || *p == '\t')) *p++ = '\0';
@ -1740,8 +1738,6 @@ HINSTANCE32 WINAPI WinExec32( LPCSTR lpCmdLine, UINT32 nCmdShow )
}
} /* while (!exhausted && handle < 32) */
GlobalFree16( cmdShowHandle );
GlobalFree16( cmdLineHandle );
return handle;
}

View File

@ -27,6 +27,24 @@
#include "xmalloc.h"
/***********************************************************************
* NE_GetRelocAddrName
*/
static const char *NE_GetRelocAddrName( BYTE addr_type, int additive )
{
switch(addr_type & 0x7f)
{
case NE_RADDR_LOWBYTE: return additive ? "BYTE add" : "BYTE";
case NE_RADDR_OFFSET16: return additive ? "OFFSET16 add" : "OFFSET16";
case NE_RADDR_POINTER32: return additive ? "POINTER32 add" : "POINTER32";
case NE_RADDR_SELECTOR: return additive ? "SELECTOR add" : "SELECTOR";
case NE_RADDR_POINTER48: return additive ? "POINTER48 add" : "POINTER48";
case NE_RADDR_OFFSET32: return additive ? "OFFSET32 add" : "OFFSET32";
}
return "???";
}
/***********************************************************************
* NE_LoadSegment
*/
@ -34,9 +52,9 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
{
SEGTABLEENTRY *pSegTable, *pSeg;
WORD *pModuleTable;
WORD count, i, offset;
WORD count, i, offset, next_offset;
HMODULE16 module;
FARPROC16 address;
FARPROC16 address = 0;
int fd;
struct relocation_entry_s *rep, *reloc_entries;
BYTE *func_name;
@ -170,7 +188,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
and target */
additive = rep->relocation_type & NE_RELFLAG_ADDITIVE;
rep->relocation_type &= 0x3;
switch (rep->relocation_type)
{
case NE_RELTYPE_ORDINAL:
@ -187,8 +205,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1 );
else
fprintf( stderr, "Warning: no handler for %*.*s.%d, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
fprintf( stderr, "Warning: no handler for %.*s.%d, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
ordinal );
@ -196,11 +213,11 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
if (TRACE_ON(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
TRACE(fixup, "%d: %*.*s.%d=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
ordinal, HIWORD(address), LOWORD(address) );
TRACE( fixup, "%d: %.*s.%d=%04x:%04x %s\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
ordinal, HIWORD(address), LOWORD(address),
NE_GetRelocAddrName( rep->address_type, additive ) );
}
break;
@ -218,16 +235,17 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
ERR(fixup, "Warning: no handler for %.*s.%s, setting to 0:0\n",
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1, func_name );
}
if (TRACE_ON(fixup))
{
NE_MODULE *pTarget = MODULE_GetPtr( module );
TRACE(fixup, "%d: %.*s.%s=%04x:%04x\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address) );
TRACE( fixup, "%d: %.*s.%s=%04x:%04x %s\n", i + 1,
*((BYTE *)pTarget + pTarget->name_table),
(char *)pTarget + pTarget->name_table + 1,
func_name, HIWORD(address), LOWORD(address),
NE_GetRelocAddrName( rep->address_type, additive ) );
}
break;
@ -241,8 +259,9 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
address = (FARPROC16)PTR_SEG_OFF_TO_SEGPTR( pSegTable[rep->target1-1].selector, rep->target2 );
}
TRACE(fixup,"%d: %04x:%04x\n",
i + 1, HIWORD(address), LOWORD(address) );
TRACE( fixup,"%d: %04x:%04x %s\n",
i + 1, HIWORD(address), LOWORD(address),
NE_GetRelocAddrName( rep->address_type, additive ) );
break;
case NE_RELTYPE_OSFIXUP:
@ -254,18 +273,11 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
* successfully emulate the coprocessor if it doesn't
* exist.
*/
TRACE(fixup, "%d: ADDR TYPE %d, TYPE %d, OFFSET %04x, "
"TARGET %04x %04x\n", i + 1, rep->address_type,
rep->relocation_type, rep->offset, rep->target1, rep->target2);
TRACE( fixup, "%d: TYPE %d, OFFSET %04x, TARGET %04x %04x %s\n",
i + 1, rep->relocation_type, rep->offset,
rep->target1, rep->target2,
NE_GetRelocAddrName( rep->address_type, additive ) );
continue;
default:
WARN(fixup, "WARNING: %d: ADDR TYPE %d, "
"unknown TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2);
free(reloc_entries);
return FALSE;
}
offset = rep->offset;
@ -273,76 +285,76 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
/* Apparently, high bit of address_type is sometimes set; */
/* we ignore it for now */
if (rep->address_type > NE_RADDR_OFFSET32)
fprintf( stderr, "WARNING: module %s: unknown reloc addr type = 0x%02x. Please report.\n",
MODULE_GetModuleName(pModule->self), rep->address_type );
ERR( fixup, "WARNING: module %s: unknown reloc addr type = 0x%02x. Please report.\n",
MODULE_GetModuleName(pModule->self), rep->address_type );
switch (rep->address_type & 0x7f)
{
case NE_RADDR_LOWBYTE:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
TRACE(fixup," %04x:%04x:%04x BYTE%s\n",
pSeg->selector, offset, *sp, additive ? " additive":"");
offset = *sp;
if(additive)
*(unsigned char*)sp = (unsigned char)(((int)address+offset) & 0xFF);
else
*(unsigned char*)sp = (unsigned char)((int)address & 0xFF);
}
while (offset && offset != 0xffff && !additive);
break;
case NE_RADDR_OFFSET16:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
TRACE(fixup," %04x:%04x:%04x OFFSET16%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
if (additive) *sp += offset;
}
while (offset && offset != 0xffff && !additive);
break;
case NE_RADDR_POINTER32:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
TRACE(fixup," %04x:%04x:%04x POINTER32%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = LOWORD(address);
if (additive) *sp += offset;
if (additive)
{
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
TRACE( fixup," %04x:%04x\n", offset, *sp );
switch (rep->address_type & 0x7f)
{
case NE_RADDR_LOWBYTE:
*(BYTE *)sp += LOBYTE((int)address);
break;
case NE_RADDR_OFFSET16:
*sp += LOWORD(address);
break;
case NE_RADDR_POINTER32:
*sp += LOWORD(address);
*(sp+1) = HIWORD(address);
}
while (offset && offset != 0xffff && !additive);
break;
case NE_RADDR_SELECTOR:
do {
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
TRACE(fixup," %04x:%04x:%04x SELECTOR%s\n",
pSeg->selector, offset, *sp, additive ? " additive" : "" );
offset = *sp;
*sp = HIWORD(address);
break;
case NE_RADDR_SELECTOR:
/* Borland creates additive records with offset zero. Strange, but OK */
if(additive && offset)
fprintf(stderr,"Additive selector to %4.4x.Please report\n",offset);
}
while (offset && offset != 0xffff && !additive);
break;
default:
WARN(fixup, "WARNING: %d: unknown ADDR TYPE %d, "
"TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2);
free(reloc_entries);
return FALSE;
}
if (*sp)
ERR(fixup,"Additive selector to %04x.Please report\n",*sp);
else
*sp = HIWORD(address);
default:
goto unknown;
}
}
else /* non-additive fixup */
{
do
{
sp = PTR_SEG_OFF_TO_LIN( pSeg->selector, offset );
next_offset = *sp;
TRACE( fixup," %04x:%04x\n", offset, *sp );
switch (rep->address_type & 0x7f)
{
case NE_RADDR_LOWBYTE:
*(BYTE *)sp = LOBYTE((int)address);
break;
case NE_RADDR_OFFSET16:
*sp = LOWORD(address);
break;
case NE_RADDR_POINTER32:
*(FARPROC16 *)sp = address;
break;
case NE_RADDR_SELECTOR:
*sp = SELECTOROF(address);
break;
default:
goto unknown;
}
if (next_offset == offset) break; /* avoid infinite loop */
if (next_offset >= GlobalSize16(pSeg->selector)) break;
offset = next_offset;
} while (offset && (offset != 0xffff));
}
}
free(reloc_entries);
return TRUE;
unknown:
WARN(fixup, "WARNING: %d: unknown ADDR TYPE %d, "
"TYPE %d, OFFSET %04x, TARGET %04x %04x\n",
i + 1, rep->address_type, rep->relocation_type,
rep->offset, rep->target1, rep->target2);
free(reloc_entries);
return FALSE;
}
@ -429,7 +441,8 @@ BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
/* its handle in the list of DLLs to initialize. */
HMODULE16 hDLL;
if ((hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT )) == 2)
if ((hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT,
NULL, NULL, 0 )) == 2)
{
/* file not found */
char *p;
@ -439,7 +452,7 @@ BOOL32 NE_LoadDLLs( NE_MODULE *pModule )
if (!(p = strrchr( buffer, '\\' ))) p = buffer;
memcpy( p + 1, pstr + 1, *pstr );
strcpy( p + 1 + *pstr, ".dll" );
hDLL = MODULE_Load( buffer, (LPVOID)-1, NE_FFLAGS_IMPLICIT );
hDLL = MODULE_Load( buffer, NE_FFLAGS_IMPLICIT, NULL, NULL, 0);
}
if (hDLL < 32)
{

View File

@ -21,15 +21,23 @@
* state MUST be correct since this function can be called with the SAME image
* AGAIN. (Thats recursion for you.) That means MODREF.module and
* NE_MODULE.module32.
* - No, you cannot use Linux mmap() to mmap() the images directly. Linux aligns
* them at pagesize (4096), Win32 requires 512 byte alignment.
* - No, you (usually) cannot use Linux mmap() to mmap() the images directly.
*
* The problem is, that there is not direct 1:1 mapping from a diskimage and
* a memoryimage. The headers at the start are mapped linear, but the sections
* are not. For x86 the sections are 512 byte aligned in file and 4096 byte
* aligned in memory. Linux likes them 4096 byte aligned in memory (due to
* x86 pagesize, this cannot be fixed without a rather large kernel rewrite)
* and 'blocksize' file-aligned (offsets). Since we have 512/1024/2048 (CDROM)
* and other byte blocksizes, we can't do this. However, this could be less
* difficult to support... (See mm/filemap.c).
* - All those function map things into a new addresspace. From the wrong
* process and the wrong thread. So calling other API functions will mess
* things up badly sometimes.
*/
/*#include <ctype.h>*/
#include <errno.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -49,9 +57,7 @@
#include "module.h"
#include "global.h"
#include "task.h"
#include "ldt.h"
#include "debug.h"
#include "xmalloc.h"
static void PE_InitDLL(PE_MODREF* modref, DWORD type, LPVOID lpReserved);
@ -721,8 +727,6 @@ static BOOL32 PE_MapImage( HMODULE32 *phModule, PDB32 *process,
return 1;
}
HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params);
/******************************************************************************
* The PE Library Loader frontend.
* FIXME: handle the flags.
@ -743,11 +747,14 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
return hModule;
/* check if this module is already mapped */
pem = process->modref_list;
pModule = MODULE_GetPtr(hModule);
while (pem) {
if (pem->module == hModule) return hModule;
if (pem->module == hModule) {
pModule->count++;
return hModule;
}
pem = pem->next;
}
pModule = MODULE_GetPtr(hModule);
if (pModule->flags & NE_FFLAGS_BUILTIN) {
IMAGE_DOS_HEADER *dh;
IMAGE_NT_HEADERS *nh;
@ -804,9 +811,10 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
/*****************************************************************************
* Load the PE main .EXE. All other loading is done by PE_LoadLibraryEx32A
* FIXME: this function should use PE_LoadLibraryEx32A, but currently can't
* due to the TASK_CreateTask stuff.
* due to the PROCESS_Create stuff.
*/
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LPCSTR cmd_line,
LPCSTR env, UINT16 show_cmd )
{
HMODULE16 hModule16;
HMODULE32 hModule32;
@ -819,17 +827,15 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = hModule32 = PE_LoadImage( hFile );
CloseHandle( hFile );
if (hModule32 < 32) return 21;
hInstance = MODULE_CreateInstance( hModule16, params );
if (!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
hInstance = MODULE_CreateInstance( hModule16, (cmd_line == NULL) );
if (cmd_line &&
!(PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
HTASK16 hTask = TASK_CreateTask( hModule16, hInstance, 0,
params->hEnvironment,
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
*((WORD*)PTR_SEG_TO_LIN(params->showCmd) + 1) );
TDB *pTask = (TDB *)GlobalLock16( hTask );
PDB32 *pdb = PROCESS_Create( pModule, cmd_line, env,
hInstance, 0, show_cmd );
TDB *pTask = (TDB *)GlobalLock16( pdb->task );
thdb = pTask->thdb;
}
if (!PE_MapImage( &(pModule->module32), thdb->process, ofs, 0 ))

View File

@ -61,8 +61,8 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, SEGPTR name, SEGPTR type )
}
TRACE(resource, "module=%04x name=%s type=%s\n",
hModule, debugres(PTR_SEG_TO_LIN(name)),
debugres(PTR_SEG_TO_LIN(type)) );
hModule, debugres_a(PTR_SEG_TO_LIN(name)),
debugres_a(PTR_SEG_TO_LIN(type)) );
if ((pModule = MODULE_GetPtr( hModule )))
{
@ -414,7 +414,6 @@ HGLOBAL16 WINAPI DirectResAlloc( HINSTANCE16 hInstance, WORD wType,
HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, SEGPTR lpTableName)
{
HRSRC16 hRsrc;
HACCEL16 hAccel;
if (HIWORD(lpTableName))
TRACE(accel, "%04x '%s'\n",
@ -423,7 +422,7 @@ HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, SEGPTR lpTableName)
TRACE(accel, "%04x %04x\n",
instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR ))) {
if (!(hRsrc = FindResource16( instance, lpTableName, RT_ACCELERATOR16 ))) {
WARN(accel, "couldn't find accelerator table resource\n");
return 0;
}
@ -453,8 +452,8 @@ HACCEL32 WINAPI LoadAccelerators32W(HINSTANCE32 instance,LPCWSTR lpTableName)
TRACE(accel, "%p 0x%04x\n",
(LPVOID)instance, LOWORD(lpTableName) );
if (!(hRsrc = FindResource32W( instance, lpTableName,
(LPCWSTR)RT_ACCELERATOR ))) {
if (!(hRsrc = FindResource32W( instance, lpTableName, RT_ACCELERATOR32W )))
{
WARN(accel, "couldn't find accelerator table resource\n");
hRetval = 0;
}
@ -625,7 +624,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
TRACE(resource,"inst=%04x id=%04x buff=%08x len=%d\n",
instance, resource_id, (int) buffer, buflen);
hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING );
hrsrc = FindResource16( instance, (SEGPTR)((resource_id>>4)+1), RT_STRING16 );
if (!hrsrc) return 0;
hmem = LoadResource16( instance, hrsrc );
if (!hmem) return 0;
@ -658,7 +657,7 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id,
}
/**********************************************************************
* LoadString32W (USER32.375)
* LoadString32W (USER32.376)
*/
INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
LPWSTR buffer, INT32 buflen )
@ -674,8 +673,8 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
TRACE(resource, "instance = %04x, id = %04x, buffer = %08x, "
"length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1),
(LPCWSTR)RT_STRING );
hrsrc = FindResource32W( instance, (LPCWSTR)((resource_id>>4)+1),
RT_STRING32W );
if (!hrsrc) return 0;
hmem = LoadResource32( instance, hrsrc );
if (!hmem) return 0;
@ -709,7 +708,7 @@ INT32 WINAPI LoadString32W( HINSTANCE32 instance, UINT32 resource_id,
}
/**********************************************************************
* LoadString32A (USER32.374)
* LoadString32A (USER32.375)
*/
INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
LPSTR buffer, INT32 buflen )
@ -726,6 +725,8 @@ INT32 WINAPI LoadString32A( HINSTANCE32 instance, UINT32 resource_id,
lstrcpynWtoA( buffer, buffer2, buflen );
retval = lstrlen32A( buffer );
}
else
*buffer = 0;
HeapFree( GetProcessHeap(), 0, buffer2 );
}
return retval;
@ -777,7 +778,7 @@ INT32 LoadMessage32A( HINSTANCE32 instance, UINT32 id, WORD lang,
TRACE(resource, "instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
/*FIXME: I am not sure about the '1' ... But I've only seen those entries*/
hrsrc = FindResourceEx32W(instance,(LPWSTR)1,(LPCWSTR)RT_MESSAGELIST,lang);
hrsrc = FindResourceEx32W(instance,(LPWSTR)1,RT_MESSAGELIST32W,lang);
if (!hrsrc) return 0;
hmem = LoadResource32( instance, hrsrc );
if (!hmem) return 0;
@ -854,7 +855,7 @@ FARPROC16 WINAPI SetResourceHandler( HMODULE16 hModule, SEGPTR s,
hModule = GetExePtr( hModule );
TRACE(resource, "module=%04x type=%s\n",
hModule, debugres(PTR_SEG_TO_LIN(s)) );
hModule, debugres_a(PTR_SEG_TO_LIN(s)) );
if ((pModule = MODULE_GetPtr( hModule )))
{

View File

@ -3,6 +3,8 @@
*
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@ -16,13 +18,15 @@
#include <sys/types.h>
#include <sys/wait.h>
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
#if !defined(_SCO_DS) && !defined(__EMX__)
#include <sys/syscall.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/param.h>
#ifdef HAVE_SYSCALL_H
# include <syscall.h>
#else
#include <syscall.h>
# ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
# endif
#endif
#include "miscemu.h"
@ -154,9 +158,7 @@ BOOL32 SIGNAL_Init(void)
{
extern void SYNC_SetupSignals(void);
sigemptyset(&async_signal_set);
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__svr4__) || defined(_SCO_DS)
#ifdef HAVE_SIGALTSTACK
struct sigaltstack ss;
ss.ss_sp = SIGNAL_Stack;
ss.ss_size = sizeof(SIGNAL_Stack);
@ -166,8 +168,10 @@ BOOL32 SIGNAL_Init(void)
perror("sigstack");
return FALSE;
}
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __svr4__ || _SCO_DS */
#endif /* HAVE_SIGALTSTACK */
sigemptyset(&async_signal_set);
SIGNAL_SetHandler( SIGCHLD, (void (*)())SIGNAL_child, 1);
#ifdef CONFIG_IPC
sigaddset(&async_signal_set, SIGUSR2);

View File

@ -25,6 +25,7 @@
#include "queue.h"
#include "selectors.h"
#include "stackframe.h"
#include "task.h"
#include "thread.h"
#include "toolhelp.h"
#include "winnt.h"
@ -46,21 +47,8 @@ static HTASK16 hCurrentTask = 0;
static HTASK16 hTaskToKill = 0;
static HTASK16 hLockedTask = 0;
static UINT16 nTaskCount = 0;
static HGLOBAL16 hDOSEnvironment = 0;
static HGLOBAL16 TASK_CreateDOSEnvironment(void);
static void TASK_YieldToSystem(TDB*);
/***********************************************************************
* TASK_Init
*/
BOOL32 TASK_Init(void)
{
if (!(hDOSEnvironment = TASK_CreateDOSEnvironment()))
fprintf( stderr, "Not enough memory for DOS Environment\n" );
return (hDOSEnvironment != 0);
}
static void TASK_YieldToSystem(TDB*);
/***********************************************************************
@ -75,115 +63,6 @@ HTASK16 TASK_GetNextTask( HTASK16 hTask )
}
/***********************************************************************
* TASK_CreateDOSEnvironment
*
* Create the original DOS environment.
*/
static HGLOBAL16 TASK_CreateDOSEnvironment(void)
{
static const char program_name[] = "KRNL386.EXE";
char **e, *p;
int initial_size, size, i, winpathlen, sysdirlen;
HGLOBAL16 handle;
extern char **environ;
/* DOS environment format:
* ASCIIZ string 1
* ASCIIZ string 2
* ...
* ASCIIZ string n
* ASCIIZ PATH=xxx
* BYTE 0
* WORD 1
* ASCIIZ program name (e.g. C:\WINDOWS\SYSTEM\KRNL386.EXE)
*/
/* First compute the size of the fixed part of the environment */
for (i = winpathlen = 0; ; i++)
{
int len = DIR_GetDosPath( i, NULL, 0 );
if (!len) break;
winpathlen += len + 1;
}
if (!winpathlen) winpathlen = 1;
sysdirlen = GetSystemDirectory32A( NULL, 0 ) + 1;
initial_size = 5 + winpathlen + /* PATH=xxxx */
1 + /* BYTE 0 at end */
sizeof(WORD) + /* WORD 1 */
sysdirlen + /* program directory */
strlen(program_name) + 1; /* program name */
/* Compute the total size of the Unix environment (except path) */
for (e = environ, size = initial_size; *e; e++)
{
if (lstrncmpi32A(*e, "path=", 5))
{
int len = strlen(*e) + 1;
if (size + len >= 32767)
{
fprintf( stderr, "Warning: environment larger than 32k.\n" );
break;
}
size += len;
}
}
/* Now allocate the environment */
if (!(handle = GlobalAlloc16( GMEM_FIXED, size ))) return 0;
p = (char *)GlobalLock16( handle );
/* And fill it with the Unix environment */
for (e = environ, size = initial_size; *e; e++)
{
if (lstrncmpi32A(*e, "path=", 5))
{
int len = strlen(*e) + 1;
if (size + len >= 32767) break;
strcpy( p, *e );
size += len;
p += len;
}
}
/* Now add the path */
strcpy( p, "PATH=" );
for (i = 0, p += 5; ; i++)
{
if (!DIR_GetDosPath( i, p, winpathlen )) break;
p += strlen(p);
*p++ = ';';
}
if (p[-1] == ';') p[-1] = '\0';
else p++;
/* Now add the program name */
*p++ = '\0';
PUT_WORD( p, 1 );
p += sizeof(WORD);
GetSystemDirectory32A( p, sysdirlen );
strcat( p, "\\" );
strcat( p, program_name );
/* Display it */
p = (char *) GlobalLock16( handle );
TRACE(task, "Master DOS environment at %p\n", p);
for (; *p; p += strlen(p) + 1) TRACE(task, " %s\n", p);
TRACE(task, "Progname: %s\n", p+3 );
return handle;
}
/***********************************************************************
* TASK_LinkTask
*/
@ -390,51 +269,28 @@ static void TASK_CallToStart(void)
/***********************************************************************
* TASK_CreateTask
* TASK_Create
*/
HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
HINSTANCE16 hPrevInstance, HANDLE16 hEnvironment,
LPCSTR cmdLine, UINT16 cmdShow )
HTASK16 TASK_Create( THDB *thdb, NE_MODULE *pModule, HINSTANCE16 hInstance,
HINSTANCE16 hPrevInstance, UINT16 cmdShow)
{
HTASK16 hTask;
TDB *pTask;
PDB32 *pdb32;
HGLOBAL16 hParentEnv;
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
LPSTR name;
LPSTR name, cmd_line;
WORD sp;
char *stack32Top;
STACK16FRAME *frame16;
STACK32FRAME *frame32;
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
pSegTable = NE_SEG_TABLE( pModule );
PDB32 *pdb32 = thdb->process;
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
/* Allocate the task structure */
hTask = GLOBAL_Alloc( GMEM_FIXED | GMEM_ZEROINIT, sizeof(TDB),
hModule, FALSE, FALSE, FALSE );
pModule->self, FALSE, FALSE, FALSE );
if (!hTask) return 0;
pTask = (TDB *)GlobalLock16( hTask );
/* Allocate the new environment block */
if (!(hParentEnv = hEnvironment))
{
TDB *pParent = (TDB *)GlobalLock16( hCurrentTask );
hParentEnv = pParent ? pParent->pdb.environment : hDOSEnvironment;
}
/* FIXME: do we really need to make a copy also when */
/* we don't use the parent environment? */
if (!(hEnvironment = GlobalAlloc16( GMEM_FIXED, GlobalSize16(hParentEnv))))
{
GlobalFree16( hTask );
return 0;
}
memcpy( GlobalLock16( hEnvironment ), GlobalLock16( hParentEnv ),
GlobalSize16( hParentEnv ) );
/* Fill the task structure */
pTask->nEvents = 1; /* So the task can be started */
@ -447,10 +303,11 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
pTask->version = pModule->expected_version;
pTask->hInstance = hInstance;
pTask->hPrevInstance = hPrevInstance;
pTask->hModule = hModule;
pTask->hModule = pModule->self;
pTask->hParent = hCurrentTask;
pTask->magic = TDB_MAGIC;
pTask->nCmdShow = cmdShow;
pTask->thdb = thdb;
pTask->curdrive = DRIVE_GetCurrentDrive() | 0x80;
strcpy( pTask->curdir, "\\" );
lstrcpyn32A( pTask->curdir + 1, DRIVE_GetDosCwd( DRIVE_GetCurrentDrive() ),
@ -462,13 +319,13 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
/* Copy the module name */
name = MODULE_GetModuleName( hModule );
name = MODULE_GetModuleName( pModule->self );
strncpy( pTask->module_name, name, sizeof(pTask->module_name) );
/* Allocate a selector for the PDB */
pTask->hPDB = GLOBAL_CreateBlock( GMEM_FIXED, &pTask->pdb, sizeof(PDB),
hModule, FALSE, FALSE, FALSE, NULL );
pModule->self, FALSE, FALSE, FALSE, NULL );
/* Fill the PDB */
@ -484,9 +341,15 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
(int)&((PDB *)0)->fileHandles );
pTask->pdb.hFileHandles = 0;
memset( pTask->pdb.fileHandles, 0xff, sizeof(pTask->pdb.fileHandles) );
pTask->pdb.environment = hEnvironment;
pTask->pdb.environment = pdb32->env_db->env_sel;
pTask->pdb.nbFiles = 20;
lstrcpyn32A( pTask->pdb.cmdLine, cmdLine, sizeof(pTask->pdb.cmdLine) );
/* Fill the command line */
cmd_line = pdb32->env_db->cmd_line;
while (*cmd_line && (*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 );
/* Get the compatibility flags */
@ -507,33 +370,12 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
pTask->dta = PTR_SEG_OFF_TO_SEGPTR( pTask->hPDB,
(int)&pTask->pdb.cmdLine - (int)&pTask->pdb );
/* Create the Win32 part of the task */
pdb32 = PROCESS_Create( pTask, cmdLine );
/* FIXME: check for pdb32 == NULL. */
pdb32->task = hTask;
if (pModule->flags & NE_FFLAGS_WIN32)
{
/*
LPTHREAD_START_ROUTINE start =
(LPTHREAD_START_ROUTINE)(
PROCESS_Current()->exe_modref->load_addr +
PROCESS_Current()->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
*/
pTask->thdb = THREAD_Create( pdb32,
PE_HEADER(pModule->module32)->OptionalHeader.SizeOfStackReserve,
NULL, NULL );
}
else
pTask->thdb = THREAD_Create( pdb32, 0, NULL, NULL );
/* FIXME: check for pTask->thdb == NULL. */
/* Create the 16-bit stack frame */
if (!(sp = pModule->sp))
sp = pSegTable[pModule->ss-1].minsize + pModule->stack_size;
sp &= ~1;
pTask->thdb->cur_stack = PTR_SEG_OFF_TO_SEGPTR( hInstance, sp );
pTask->thdb->cur_stack = PTR_SEG_OFF_TO_SEGPTR( pTask->hInstance, sp );
pTask->thdb->cur_stack -= sizeof(STACK16FRAME) + sizeof(STACK32FRAME *);
frame16 = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->thdb->cur_stack );
frame16->ebp = sp + (int)&((STACK16FRAME *)0)->bp;
@ -564,7 +406,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
TASK_LinkTask( hTask );
TRACE(task, "module='%s' cmdline='%s' task=%04x\n",
name, cmdLine, hTask );
name, cmd_line, hTask );
return hTask;
}
@ -840,6 +682,14 @@ void WINAPI InitTask( CONTEXT *context )
*/
EAX_reg(context) = 1;
EBX_reg(context) = pTask->pdb.cmdLine[0] ? 0x81 : 0x80;
if (!pTask->pdb.cmdLine[0]) EBX_reg(context) = 0x80;
else
{
LPBYTE p = &pTask->pdb.cmdLine[1];
while ((*p == ' ') || (*p == '\t')) p++;
EBX_reg(context) = 0x80 + (p - pTask->pdb.cmdLine);
}
ECX_reg(context) = pModule->stack_size;
EDX_reg(context) = pTask->nCmdShow;
ESI_reg(context) = (DWORD)pTask->hPrevInstance;
@ -1294,7 +1144,7 @@ SEGPTR WINAPI GetDOSEnvironment(void)
TDB *pTask;
if (!(pTask = (TDB *)GlobalLock16( hCurrentTask ))) return 0;
return (SEGPTR)WIN16_GlobalLock16( pTask->pdb.environment );
return PTR_SEG_OFF_TO_SEGPTR( pTask->pdb.environment, 0 );
}
@ -1491,7 +1341,7 @@ DWORD WINAPI GetAppCompatFlags16( HTASK16 hTask )
/***********************************************************************
* GetAppCompatFlags32 (USER32.205)
* GetAppCompatFlags32 (USER32.206)
*/
DWORD WINAPI GetAppCompatFlags32( HTASK32 hTask )
{

View File

@ -7,6 +7,7 @@ MODULE = memory
C_SRCS = \
atom.c \
environ.c \
global.c \
heap.c \
ldt.c \

437
memory/environ.c 100644
View File

@ -0,0 +1,437 @@
/*
* Process environment management
*
* Copyright 1996, 1998 Alexandre Julliard
*/
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "process.h"
#include "heap.h"
#include "selectors.h"
#include "winerror.h"
/* Format of an environment block:
* ASCIIZ string 1 (xx=yy format)
* ...
* ASCIIZ string n
* BYTE 0
* WORD 1
* ASCIIZ program name (e.g. C:\WINDOWS\SYSTEM\KRNL386.EXE)
*
* Notes:
* - contrary to Microsoft docs, the environment strings do not appear
* to be sorted on Win95 (although they are on NT); so we don't bother
* to sort them either.
*/
static const char ENV_program_name[] = "C:\\WINDOWS\\SYSTEM\\KRNL386.EXE";
/* Maximum length of an environment string (including NULL) */
#define MAX_STR_LEN 128
/* Extra bytes to reserve at the end of an environment */
#define EXTRA_ENV_SIZE (sizeof(BYTE) + sizeof(WORD) + sizeof(ENV_program_name))
/* Fill the extra bytes with the program name and stuff */
#define FILL_EXTRA_ENV(p) \
*(p) = '\0'; \
PUT_WORD( (p) + 1, 1 ); \
strcpy( (p) + 3, ENV_program_name );
/***********************************************************************
* ENV_FindVariable
*
* Find a variable in the environment and return a pointer to the value.
* Helper function for GetEnvironmentVariable and ExpandEnvironmentStrings.
*/
static LPCSTR ENV_FindVariable( LPCSTR env, LPCSTR name, INT32 len )
{
while (*env)
{
if (!lstrncmpi32A( name, env, len ) && (env[len] == '='))
return env + len + 1;
env += strlen(env) + 1;
}
return NULL;
}
/***********************************************************************
* ENV_BuildEnvironment
*
* Build the environment for the initial process
*/
BOOL32 ENV_BuildEnvironment( PDB32 *pdb )
{
extern char **environ;
LPSTR p, *e;
int size, len;
/* Compute the total size of the Unix environment */
size = EXTRA_ENV_SIZE;
for (e = environ; *e; e++)
{
len = strlen(*e) + 1;
size += MIN( len, MAX_STR_LEN );
}
/* Now allocate the environment */
if (!(p = HeapAlloc( SystemHeap, 0, size ))) return FALSE;
pdb->env_db->environ = p;
pdb->env_db->env_sel = SELECTOR_AllocBlock( p, 0x10000, SEGMENT_DATA,
FALSE, FALSE );
/* And fill it with the Unix environment */
for (e = environ; *e; e++)
{
lstrcpyn32A( p, *e, MAX_STR_LEN );
p += strlen(p) + 1;
}
/* Now add the program name */
FILL_EXTRA_ENV( p );
return TRUE;
}
/***********************************************************************
* ENV_InheritEnvironment
*
* Make a process inherit the environment from its parent or from an
* explicit environment.
*/
BOOL32 ENV_InheritEnvironment( PDB32 *pdb, LPCSTR env )
{
DWORD size;
LPCSTR p;
/* FIXME: should lock the parent environment */
if (!env) env = pdb->parent->env_db->environ;
/* Compute the environment size */
p = env;
while (*p) p += strlen(p) + 1;
size = (p - env);
/* Copy the environment */
if (!(pdb->env_db->environ = HeapAlloc( pdb->heap, 0,
size + EXTRA_ENV_SIZE )))
return FALSE;
pdb->env_db->env_sel = SELECTOR_AllocBlock( pdb->env_db->environ,
0x10000, SEGMENT_DATA,
FALSE, FALSE );
memcpy( pdb->env_db->environ, env, size );
FILL_EXTRA_ENV( pdb->env_db->environ + size );
return TRUE;
}
/***********************************************************************
* ENV_FreeEnvironment
*
* Free a process environment.
*/
void ENV_FreeEnvironment( PDB32 *pdb )
{
if (!pdb->env_db) return;
if (pdb->env_db->env_sel) SELECTOR_FreeBlock( pdb->env_db->env_sel, 1 );
DeleteCriticalSection( &pdb->env_db->section );
HeapFree( pdb->heap, 0, pdb->env_db );
}
/***********************************************************************
* GetCommandLine32A (KERNEL32.289)
*/
LPCSTR WINAPI GetCommandLine32A(void)
{
return PROCESS_Current()->env_db->cmd_line;
}
/***********************************************************************
* GetCommandLine32W (KERNEL32.290)
*/
LPCWSTR WINAPI GetCommandLine32W(void)
{
PDB32 *pdb = PROCESS_Current();
EnterCriticalSection( &pdb->env_db->section );
if (!pdb->env_db->cmd_lineW)
pdb->env_db->cmd_lineW = HEAP_strdupAtoW( pdb->heap, 0,
pdb->env_db->cmd_line );
LeaveCriticalSection( &pdb->env_db->section );
return pdb->env_db->cmd_lineW;
}
/***********************************************************************
* GetEnvironmentStrings32A (KERNEL32.319) (KERNEL32.320)
*/
LPSTR WINAPI GetEnvironmentStrings32A(void)
{
PDB32 *pdb = PROCESS_Current();
return pdb->env_db->environ;
}
/***********************************************************************
* GetEnvironmentStrings32W (KERNEL32.321)
*/
LPWSTR WINAPI GetEnvironmentStrings32W(void)
{
INT32 size;
LPWSTR ret;
PDB32 *pdb = PROCESS_Current();
EnterCriticalSection( &pdb->env_db->section );
size = HeapSize( pdb->heap, 0, pdb->env_db->environ );
if ((ret = HeapAlloc( pdb->heap, 0, size * sizeof(WCHAR) )) != NULL)
{
LPSTR pA = pdb->env_db->environ;
LPWSTR pW = ret;
while (size--) *pW++ = (WCHAR)(BYTE)*pA++;
}
LeaveCriticalSection( &pdb->env_db->section );
return ret;
}
/***********************************************************************
* FreeEnvironmentStrings32A (KERNEL32.268)
*/
BOOL32 WINAPI FreeEnvironmentStrings32A( LPSTR ptr )
{
PDB32 *pdb = PROCESS_Current();
if (ptr != pdb->env_db->environ)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* FreeEnvironmentStrings32W (KERNEL32.269)
*/
BOOL32 WINAPI FreeEnvironmentStrings32W( LPWSTR ptr )
{
return HeapFree( GetProcessHeap(), 0, ptr );
}
/***********************************************************************
* GetEnvironmentVariable32A (KERNEL32.322)
*/
DWORD WINAPI GetEnvironmentVariable32A( LPCSTR name, LPSTR value, DWORD size )
{
LPCSTR p;
INT32 ret = 0;
PDB32 *pdb = PROCESS_Current();
if (!name || !*name)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
EnterCriticalSection( &pdb->env_db->section );
if ((p = ENV_FindVariable( pdb->env_db->environ, name, strlen(name) )))
{
ret = strlen(p);
if (size <= ret)
{
/* If not enough room, include the terminating null
* in the returned size and return an empty string */
ret++;
if (value) *value = '\0';
}
else if (value) strcpy( value, p );
}
LeaveCriticalSection( &pdb->env_db->section );
return ret; /* FIXME: SetLastError */
}
/***********************************************************************
* GetEnvironmentVariable32W (KERNEL32.323)
*/
DWORD WINAPI GetEnvironmentVariable32W( LPCWSTR nameW, LPWSTR valW, DWORD size)
{
LPSTR name = HEAP_strdupWtoA( GetProcessHeap(), 0, nameW );
LPSTR val = valW ? HeapAlloc( GetProcessHeap(), 0, size ) : NULL;
DWORD res = GetEnvironmentVariable32A( name, val, size );
HeapFree( GetProcessHeap(), 0, name );
if (val)
{
lstrcpynAtoW( valW, val, size );
HeapFree( GetProcessHeap(), 0, val );
}
return res;
}
/***********************************************************************
* SetEnvironmentVariable32A (KERNEL32.641)
*/
BOOL32 WINAPI SetEnvironmentVariable32A( LPCSTR name, LPCSTR value )
{
INT32 old_size, len, res;
LPSTR p, env, new_env;
BOOL32 ret = FALSE;
PDB32 *pdb = PROCESS_Current();
EnterCriticalSection( &pdb->env_db->section );
env = p = pdb->env_db->environ;
/* Find a place to insert the string */
res = -1;
len = strlen(name);
while (*p)
{
if (!lstrncmpi32A( name, p, len ) && (p[len] == '=')) break;
p += strlen(p) + 1;
}
if (!value && !*p) goto done; /* Value to remove doesn't exist */
/* Realloc the buffer */
len = value ? strlen(name) + strlen(value) + 2 : 0;
if (*p) len -= strlen(p) + 1; /* The name already exists */
old_size = HeapSize( pdb->heap, 0, env );
if (len < 0)
{
LPSTR next = p + strlen(p) + 1; /* We know there is a next one */
memmove( next + len, next, old_size - (next - env) );
}
if (!(new_env = HeapReAlloc( pdb->heap, 0, env, old_size + len )))
goto done;
SELECTOR_MoveBlock( pdb->env_db->env_sel, new_env );
p = new_env + (p - env);
if (len > 0) memmove( p + len, p, old_size - (p - new_env) );
/* Set the new string */
if (value)
{
strcpy( p, name );
strcat( p, "=" );
strcat( p, value );
}
pdb->env_db->environ = new_env;
ret = TRUE;
done:
LeaveCriticalSection( &pdb->env_db->section );
return ret;
}
/***********************************************************************
* SetEnvironmentVariable32W (KERNEL32.642)
*/
BOOL32 WINAPI SetEnvironmentVariable32W( LPCWSTR name, LPCWSTR value )
{
LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
LPSTR valueA = HEAP_strdupWtoA( GetProcessHeap(), 0, value );
BOOL32 ret = SetEnvironmentVariable32A( nameA, valueA );
HeapFree( GetProcessHeap(), 0, nameA );
HeapFree( GetProcessHeap(), 0, valueA );
return ret;
}
/***********************************************************************
* ExpandEnvironmentStrings32A (KERNEL32.216)
*
* Note: overlapping buffers are not supported; this is how it should be.
*/
DWORD WINAPI ExpandEnvironmentStrings32A( LPCSTR src, LPSTR dst, DWORD count )
{
DWORD len, total_size = 1; /* 1 for terminating '\0' */
LPCSTR p, var;
PDB32 *pdb = PROCESS_Current();
if (!count) dst = NULL;
EnterCriticalSection( &pdb->env_db->section );
while (*src)
{
if (*src != '%')
{
if ((p = strchr( src, '%' ))) len = p - src;
else len = strlen(src);
var = src;
src += len;
}
else /* we are at the start of a variable */
{
if ((p = strchr( src + 1, '%' )))
{
len = p - src - 1; /* Length of the variable name */
if ((var = ENV_FindVariable( pdb->env_db->environ,
src + 1, len )))
{
src += len + 2; /* Skip the variable name */
len = strlen(var);
}
else
{
var = src; /* Copy original name instead */
len += 2;
src += len;
}
}
else /* unfinished variable name, ignore it */
{
var = src;
len = strlen(src); /* Copy whole string */
src += len;
}
}
total_size += len;
if (dst)
{
if (count < len) len = count;
memcpy( dst, var, len );
dst += len;
count -= len;
}
}
LeaveCriticalSection( &pdb->env_db->section );
/* Null-terminate the string */
if (dst)
{
if (!count) dst--;
*dst = '\0';
}
return total_size;
}
/***********************************************************************
* ExpandEnvironmentStrings32W (KERNEL32.217)
*/
DWORD WINAPI ExpandEnvironmentStrings32W( LPCWSTR src, LPWSTR dst, DWORD len )
{
LPSTR srcA = HEAP_strdupWtoA( GetProcessHeap(), 0, src );
LPSTR dstA = dst ? HeapAlloc( GetProcessHeap(), 0, len ) : NULL;
DWORD ret = ExpandEnvironmentStrings32A( srcA, dstA, len );
if (dstA)
{
lstrcpyAtoW( dst, dstA );
HeapFree( GetProcessHeap(), 0, dstA );
}
HeapFree( GetProcessHeap(), 0, srcA );
return ret;
}

View File

@ -282,7 +282,7 @@ HGLOBAL16 WINAPI GlobalAlloc16(
HANDLE16 owner = GetCurrentPDB();
if (flags & GMEM_DDESHARE)
owner = MODULE_HANDLEtoHMODULE16(owner); /* Make it a module handle */
owner = GetExePtr(owner); /* Make it a module handle */
return GLOBAL_Alloc( flags, size, owner, FALSE, FALSE, FALSE );
}
@ -963,11 +963,7 @@ BOOL16 WINAPI MemManInfo( MEMMANINFO *info )
* (under Windows) always fills the structure and returns true.
*/
GlobalMemoryStatus( &status );
#ifdef __svr4__
info->wPageSize = sysconf(_SC_PAGESIZE);
#else
info->wPageSize = getpagesize();
#endif
info->wPageSize = VIRTUAL_GetPageSize();
info->dwLargestFreeBlock = status.dwAvailVirtual;
info->dwMaxPagesAvailable = info->dwLargestFreeBlock / info->wPageSize;
info->dwMaxPagesLockable = info->dwMaxPagesAvailable;
@ -1225,9 +1221,10 @@ HGLOBAL32 WINAPI GlobalReAlloc32(
{
/* reallocate a moveable block */
pintern=HANDLE_TO_INTERN(hmem);
if(pintern->LockCount!=0)
if(pintern->LockCount>1) {
ERR(global,"handle 0x%08lx is still locked, cannot realloc!\n",(DWORD)hmem);
SetLastError(ERROR_INVALID_HANDLE);
else if(size!=0)
} else if(size!=0)
{
hnew=hmem;
if(pintern->Pointer)

View File

@ -1225,7 +1225,7 @@ BOOL32 WINAPI HeapValidate(
LPCVOID block /* [in] Optional pointer to memory block to validate */
) {
SUBHEAP *subheap;
HEAP *heapPtr = HEAP_GetPtr(heap);
HEAP *heapPtr = (HEAP *)(heap);
if (!heapPtr || (heapPtr->magic != HEAP_MAGIC))
{

View File

@ -26,10 +26,6 @@
#include "toolhelp.h"
#include "debug.h"
/* needed only for GDI_HeapSel and USER_HeapSel */
#include "gdi.h"
#include "user.h"
typedef struct
{
/* Arena header */
@ -103,6 +99,8 @@ typedef struct
#define LOCAL_HEAP_MAGIC 0x484c /* 'LH' */
WORD USER_HeapSel = 0; /* USER heap selector */
WORD GDI_HeapSel = 0; /* GDI heap selector */
/* All local heap allocations are aligned on 4-byte boundaries */
#define LALIGN(word) (((word) + 3) & ~3)
@ -1099,7 +1097,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags )
char *ptr = PTR_SEG_OFF_TO_LIN( ds, 0 );
LOCALHEAPINFO *pInfo;
LOCALARENA *pArena, *pNext;
LOCALHANDLEENTRY *pEntry;
LOCALHANDLEENTRY *pEntry = NULL;
WORD arena, oldsize;
HLOCAL16 hmem, blockhandle;
LONG nextarena;

View File

@ -137,6 +137,25 @@ WORD SELECTOR_AllocBlock( const void *base, DWORD size, enum seg_type type,
}
/***********************************************************************
* SELECTOR_MoveBlock
*
* Move a block of selectors in linear memory.
*/
void SELECTOR_MoveBlock( WORD sel, const void *new_base )
{
WORD i, count = (GET_SEL_LIMIT(sel) >> 16) + 1;
for (i = 0; i < count; i++)
{
ldt_entry entry;
LDT_GetEntry( SELECTOR_TO_ENTRY(sel) + i, &entry );
entry.base = (unsigned long)new_base;
LDT_SetEntry( SELECTOR_TO_ENTRY(sel) + i, &entry );
}
}
/***********************************************************************
* SELECTOR_FreeBlock
*
@ -496,13 +515,10 @@ DWORD WINAPI MemoryWrite( WORD sel, DWORD offset, void *buffer, DWORD count )
/************************************* Win95 pointer mapping functions *
*
* NOTE: MapSLFix and UnMapSLFixArray are probably needed to prevent
* unexpected linear address change when GlobalCompact() shuffles
* moveable blocks.
*/
/***********************************************************************
* MapSL (KERNEL32.662)
* MapSL (KERNEL32.523)
*
* Maps fixed segmented pointer to linear.
*/
@ -511,27 +527,53 @@ LPVOID WINAPI MapSL( SEGPTR sptr )
return (LPVOID)PTR_SEG_TO_LIN(sptr);
}
/***********************************************************************
* MapSLFix (KERNEL32.524)
*
* FIXME: MapSLFix and UnMapSLFixArray should probably prevent
* unexpected linear address change when GlobalCompact() shuffles
* moveable blocks.
*/
LPVOID WINAPI MapSLFix( SEGPTR sptr )
{
return (LPVOID)PTR_SEG_TO_LIN(sptr);
}
/***********************************************************************
* MapLS (KERNEL32.679)
* UnMapSLFixArray (KERNEL32.701)
*/
void WINAPI UnMapSLFixArray( SEGPTR sptr[], INT32 length )
{
}
/***********************************************************************
* MapLS (KERNEL32.522)
*
* Maps linear pointer to segmented.
*/
SEGPTR WINAPI MapLS( LPVOID ptr )
{
WORD sel = SELECTOR_AllocBlock( ptr, 0x10000, SEGMENT_DATA, FALSE, FALSE );
return PTR_SEG_OFF_TO_SEGPTR( sel, 0 );
if (!HIWORD(ptr))
return (SEGPTR)ptr;
else
{
WORD sel = SELECTOR_AllocBlock( ptr, 0x10000, SEGMENT_DATA, FALSE, FALSE );
return PTR_SEG_OFF_TO_SEGPTR( sel, 0 );
}
}
/***********************************************************************
* UnMapLS (KERNEL32.680)
* UnMapLS (KERNEL32.700)
*
* Free mapped selector.
*/
void WINAPI UnMapLS( SEGPTR sptr )
{
if (!__winelib) SELECTOR_FreeBlock( SELECTOROF(sptr), 1 );
if (SELECTOROF(sptr))
SELECTOR_FreeBlock( SELECTOROF(sptr), 1 );
}
/***********************************************************************
@ -625,6 +667,71 @@ void WINAPI SUnMapLS_IP_EBP_32(CONTEXT *context) { x_SUnMapLS_IP_EBP_x(context,3
void WINAPI SUnMapLS_IP_EBP_36(CONTEXT *context) { x_SUnMapLS_IP_EBP_x(context,36); }
void WINAPI SUnMapLS_IP_EBP_40(CONTEXT *context) { x_SUnMapLS_IP_EBP_x(context,40); }
/**********************************************************************
* AllocMappedBuffer (KERNEL32.38)
*
* This is a undocumented KERNEL32 function that
* SMapLS's a GlobalAlloc'ed buffer.
*
* Input: EDI register: size of buffer to allocate
* Output: EDI register: pointer to buffer
*
* Note: The buffer is preceeded by 8 bytes:
* ...
* edi+0 buffer
* edi-4 SEGPTR to buffer
* edi-8 some magic Win95 needs for SUnMapLS
* (we use it for the memory handle)
*
* The SEGPTR is used by the caller!
*/
void WINAPI AllocMappedBuffer(CONTEXT *context)
{
HGLOBAL32 handle = GlobalAlloc32(0, EDI_reg(context) + 8);
DWORD *buffer = (DWORD *)GlobalLock32(handle);
SEGPTR ptr = 0;
if (buffer)
if (!(ptr = MapLS(buffer + 2)))
{
GlobalUnlock32(handle);
GlobalFree32(handle);
}
if (!ptr)
EAX_reg(context) = EDI_reg(context) = 0;
else
{
buffer[0] = handle;
buffer[1] = ptr;
EAX_reg(context) = (DWORD) ptr;
EDI_reg(context) = (DWORD)(buffer + 2);
}
}
/**********************************************************************
* FreeMappedBuffer (KERNEL32.39)
*
* Free a buffer allocated by AllocMappedBuffer
*
* Input: EDI register: pointer to buffer
*/
void WINAPI FreeMappedBuffer(CONTEXT *context)
{
if (EDI_reg(context))
{
DWORD *buffer = (DWORD *)EDI_reg(context) - 2;
UnMapLS(buffer[1]);
GlobalUnlock32(buffer[0]);
GlobalFree32(buffer[0]);
}
}
/**********************************************************************
* WOWGetVDMPointer (KERNEL32.55)
* Get linear from segmented pointer. (MSDN lib)

View File

@ -542,7 +542,7 @@ void WINAPI OemToAnsiBuff16( LPCSTR s, LPSTR d, UINT16 len )
/***********************************************************************
* CharToOem32A (USER32.36)
* CharToOem32A (USER32.37)
*/
BOOL32 WINAPI CharToOem32A( LPCSTR s, LPSTR d )
{
@ -556,7 +556,7 @@ BOOL32 WINAPI CharToOem32A( LPCSTR s, LPSTR d )
/***********************************************************************
* CharToOemBuff32A (USER32.37)
* CharToOemBuff32A (USER32.38)
*/
BOOL32 WINAPI CharToOemBuff32A( LPCSTR s, LPSTR d, DWORD len )
{
@ -566,7 +566,7 @@ BOOL32 WINAPI CharToOemBuff32A( LPCSTR s, LPSTR d, DWORD len )
/***********************************************************************
* CharToOemBuff32W (USER32.38)
* CharToOemBuff32W (USER32.39)
*/
BOOL32 WINAPI CharToOemBuff32W( LPCWSTR s, LPSTR d, DWORD len )
{
@ -576,7 +576,7 @@ BOOL32 WINAPI CharToOemBuff32W( LPCWSTR s, LPSTR d, DWORD len )
/***********************************************************************
* CharToOem32W (USER32.39)
* CharToOem32W (USER32.40)
*/
BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d )
{
@ -590,7 +590,7 @@ BOOL32 WINAPI CharToOem32W( LPCWSTR s, LPSTR d )
/***********************************************************************
* OemToChar32A (USER32.401)
* OemToChar32A (USER32.402)
*/
BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
{
@ -603,7 +603,7 @@ BOOL32 WINAPI OemToChar32A( LPCSTR s, LPSTR d )
/***********************************************************************
* OemToCharBuff32A (USER32.402)
* OemToCharBuff32A (USER32.403)
*/
BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
{
@ -614,7 +614,7 @@ BOOL32 WINAPI OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
/***********************************************************************
* OemToCharBuff32W (USER32.403)
* OemToCharBuff32W (USER32.404)
*/
BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len )
{
@ -625,7 +625,7 @@ BOOL32 WINAPI OemToCharBuff32W( LPCSTR s, LPWSTR d, DWORD len )
/***********************************************************************
* OemToChar32W (USER32.404)
* OemToChar32W (USER32.405)
*/
BOOL32 WINAPI OemToChar32W( LPCSTR s, LPWSTR d )
{

View File

@ -84,9 +84,16 @@ static const BYTE VIRTUAL_Win32Flags[16] =
static FILE_VIEW *VIRTUAL_FirstView;
#ifdef __i386___
/* These are always the same on an i386, and it will be faster this way */
# define page_mask 0xfff
# define page_shift 12
# define granularity_mask 0xffff
#else
static UINT32 page_shift;
static UINT32 page_mask;
static UINT32 granularity_mask; /* Allocation granularity (usually 64k) */
#endif /* __i386__ */
#define ROUND_ADDR(addr) \
((UINT32)(addr) & ~page_mask)
@ -415,16 +422,25 @@ static BOOL32 VIRTUAL_CheckFlags(
*/
BOOL32 VIRTUAL_Init(void)
{
SYSTEM_INFO sysinfo;
GetSystemInfo( &sysinfo );
#ifndef __i386__
DWORD page_size;
page_mask = sysinfo.dwPageSize - 1;
granularity_mask = sysinfo.dwAllocationGranularity - 1;
# ifdef HAVE_GETPAGESIZE
page_size = getpagesize();
# else
# ifdef __svr4__
page_size = sysconf(_SC_PAGESIZE);
# else
# error Cannot get the page size on this platform
# endif
# endif
page_mask = page_size - 1;
granularity_mask = 0xffff; /* hard-coded for now */
/* Make sure we have a power of 2 */
assert( !(sysinfo.dwPageSize & page_mask) );
assert( !(sysinfo.dwAllocationGranularity & granularity_mask) );
assert( !(page_size & page_mask) );
page_shift = 0;
while ((1 << page_shift) != sysinfo.dwPageSize) page_shift++;
while ((1 << page_shift) != page_size) page_shift++;
#endif /* !__i386__ */
#ifdef linux
{
@ -467,6 +483,24 @@ BOOL32 VIRTUAL_Init(void)
}
/***********************************************************************
* VIRTUAL_GetPageSize
*/
DWORD VIRTUAL_GetPageSize(void)
{
return 1 << page_shift;
}
/***********************************************************************
* VIRTUAL_GetGranularity
*/
DWORD VIRTUAL_GetGranularity(void)
{
return granularity_mask + 1;
}
/***********************************************************************
* VirtualAlloc (KERNEL32.548)
* Reserves or commits a region of pages in virtual address space
@ -1013,15 +1047,16 @@ BOOL32 WINAPI IsBadStringPtr32W( LPCWSTR str, UINT32 max )
*/
HANDLE32 WINAPI CreateFileMapping32A(
HFILE32 hFile, /* [in] Handle of file to map */
LPSECURITY_ATTRIBUTES attr, /* [in] Optional security attributes */
SECURITY_ATTRIBUTES *sa, /* [in] Optional security attributes*/
DWORD protect, /* [in] Protection for mapping object */
DWORD size_high, /* [in] High-order 32 bits of object size */
DWORD size_low, /* [in] Low-order 32 bits of object size */
LPCSTR name /* [in] Name of file-mapping object */
) {
LPCSTR name /* [in] Name of file-mapping object */ )
{
FILE_MAPPING *mapping = NULL;
HANDLE32 handle;
BYTE vprot;
BOOL32 inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
/* First search for an object with the same name */
@ -1031,7 +1066,8 @@ HANDLE32 WINAPI CreateFileMapping32A(
if (obj->type == K32OBJ_MEM_MAPPED_FILE)
{
SetLastError( ERROR_ALREADY_EXISTS );
handle = HANDLE_Alloc( obj, FILE_MAP_ALL_ACCESS /*FIXME*/, FALSE );
handle = HANDLE_Alloc( PROCESS_Current(), obj,
FILE_MAP_ALL_ACCESS /*FIXME*/, inherit );
}
else
{
@ -1045,7 +1081,7 @@ HANDLE32 WINAPI CreateFileMapping32A(
/* Check parameters */
TRACE(virtual,"(%x,%p,%08lx,%08lx%08lx,%s)\n",
hFile, attr, protect, size_high, size_low, name );
hFile, sa, protect, size_high, size_low, name );
vprot = VIRTUAL_GetProt( protect );
if (protect & SEC_RESERVE)
@ -1080,7 +1116,8 @@ HANDLE32 WINAPI CreateFileMapping32A(
((protect & 0xff) == PAGE_EXECUTE_READWRITE) ||
((protect & 0xff) == PAGE_EXECUTE_WRITECOPY))
access |= GENERIC_WRITE;
if (!(obj = HANDLE_GetObjPtr( hFile, K32OBJ_FILE, access )))
if (!(obj = HANDLE_GetObjPtr( PROCESS_Current(), hFile,
K32OBJ_FILE, access )))
goto error;
if (!GetFileInformationByHandle( hFile, &info )) goto error;
@ -1111,8 +1148,8 @@ HANDLE32 WINAPI CreateFileMapping32A(
mapping->file = (FILE_OBJECT *)obj;
if (!K32OBJ_AddName( &mapping->header, name )) handle = 0;
else handle = HANDLE_Alloc( &mapping->header,
FILE_MAP_ALL_ACCESS /*FIXME*/, FALSE );
else handle = HANDLE_Alloc( PROCESS_Current(), &mapping->header,
FILE_MAP_ALL_ACCESS /*FIXME*/, inherit );
K32OBJ_DecCount( &mapping->header );
return handle;
@ -1157,7 +1194,7 @@ HANDLE32 WINAPI OpenFileMapping32A(
SYSTEM_LOCK();
if ((obj = K32OBJ_FindNameType( name, K32OBJ_MEM_MAPPED_FILE )))
{
handle = HANDLE_Alloc( obj, access, inherit );
handle = HANDLE_Alloc( PROCESS_Current(), obj, access, inherit );
K32OBJ_DecCount( obj );
}
SYSTEM_UNLOCK();
@ -1244,7 +1281,8 @@ LPVOID WINAPI MapViewOfFileEx(
return NULL;
}
if (!(mapping = (FILE_MAPPING *)HANDLE_GetObjPtr( handle,
if (!(mapping = (FILE_MAPPING *)HANDLE_GetObjPtr( PROCESS_Current(),
handle,
K32OBJ_MEM_MAPPED_FILE,
0 /* FIXME */ )))
return NULL;

View File

@ -16,6 +16,8 @@
* <lawson_whitney@juno.com>
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
@ -24,8 +26,8 @@
#include <errno.h>
#include <ctype.h>
#include <sys/stat.h>
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__svr4__)
#include <sys/filio.h>
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#include <sys/ioctl.h>
#include <unistd.h>

View File

@ -27,6 +27,7 @@ static HBITMAP16 hFloppy = 0;
static HBITMAP16 hHDisk = 0;
static HBITMAP16 hCDRom = 0;
static HBITMAP16 hBitmapTT = 0;
static const char defaultfilter[]=" \0\0";
/***********************************************************************
* FileDlg_Init [internal]
@ -36,11 +37,11 @@ static BOOL32 FileDlg_Init()
static BOOL32 initialized = 0;
if (!initialized) {
if (!hFolder) hFolder = LoadBitmap16(0, MAKEINTRESOURCE(OBM_FOLDER));
if (!hFolder2) hFolder2 = LoadBitmap16(0, MAKEINTRESOURCE(OBM_FOLDER2));
if (!hFloppy) hFloppy = LoadBitmap16(0, MAKEINTRESOURCE(OBM_FLOPPY));
if (!hHDisk) hHDisk = LoadBitmap16(0, MAKEINTRESOURCE(OBM_HDISK));
if (!hCDRom) hCDRom = LoadBitmap16(0, MAKEINTRESOURCE(OBM_CDROM));
if (!hFolder) hFolder = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_FOLDER));
if (!hFolder2) hFolder2 = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_FOLDER2));
if (!hFloppy) hFloppy = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_FLOPPY));
if (!hHDisk) hHDisk = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_HDISK));
if (!hCDRom) hCDRom = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_CDROM));
if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
hHDisk == 0 || hCDRom == 0)
{
@ -63,6 +64,8 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
HWND32 hwndDialog;
LPOPENFILENAME16 lpofn = (LPOPENFILENAME16)PTR_SEG_TO_LIN(ofn);
LPCVOID template;
char defaultopen[]="Open File";
char *str=0,*str1=0;
if (!lpofn || !FileDlg_Init()) return FALSE;
@ -78,7 +81,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
else if (lpofn->Flags & OFN_ENABLETEMPLATE)
{
if (!(hResInfo = FindResource32A(lpofn->hInstance,
PTR_SEG_TO_LIN(lpofn->lpTemplateName), (LPSTR)RT_DIALOG)))
PTR_SEG_TO_LIN(lpofn->lpTemplateName), RT_DIALOG32A)))
{
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
@ -105,7 +108,8 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
else if (lpofn->Flags & OFN_ENABLETEMPLATE)
{
if (!(hResInfo = FindResource16(lpofn->hInstance,
lpofn->lpTemplateName, RT_DIALOG)))
lpofn->lpTemplateName,
RT_DIALOG16)))
{
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
@ -123,6 +127,23 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
}
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
if (!(lpofn->lpstrFilter))
{
str = SEGPTR_ALLOC(sizeof(defaultfilter));
TRACE(commdlg,"Alloc %p default for Filetype in GetOpenFileName\n",str);
memcpy(str,defaultfilter,sizeof(defaultfilter));
lpofn->lpstrFilter=SEGPTR_GET(str);
}
if (!(lpofn->lpstrTitle))
{
str1 = SEGPTR_ALLOC(strlen(defaultopen)+1);
TRACE(commdlg,"Alloc %p default for Title in GetOpenFileName\n",str1);
strcpy(str1,defaultopen);
lpofn->lpstrTitle=SEGPTR_GET(str1);
}
/* FIXME: doesn't handle win32 format correctly yet */
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpofn->hwndOwner,
@ -130,6 +151,20 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn )
ofn, WIN_PROC_16 );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner );
if (str1)
{
TRACE(commdlg,"Freeing %p default for Title in GetOpenFileName\n",str1);
SEGPTR_FREE(str1);
lpofn->lpstrTitle=0;
}
if (str)
{
TRACE(commdlg,"Freeing %p default for Filetype in GetOpenFileName\n",str);
SEGPTR_FREE(str);
lpofn->lpstrFilter=0;
}
if (hDlgTmpl) {
if (lpofn->Flags & OFN_WINE32)
FreeResource32( hDlgTmpl );
@ -154,6 +189,8 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
LPOPENFILENAME16 lpofn = (LPOPENFILENAME16)PTR_SEG_TO_LIN(ofn);
LPCVOID template;
HWND32 hwndDialog;
char defaultsave[]="Save as";
char *str =0,*str1=0;
if (!lpofn || !FileDlg_Init()) return FALSE;
@ -170,7 +207,8 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
{
HANDLE32 hResInfo;
if (!(hResInfo = FindResource32A(lpofn->hInstance,
PTR_SEG_TO_LIN(lpofn->lpTemplateName), (LPSTR)RT_DIALOG)))
PTR_SEG_TO_LIN(lpofn->lpTemplateName),
RT_DIALOG32A)))
{
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
@ -199,7 +237,8 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
{
HANDLE16 hResInfo;
if (!(hResInfo = FindResource16(lpofn->hInstance,
lpofn->lpTemplateName, RT_DIALOG)))
lpofn->lpTemplateName,
RT_DIALOG16)))
{
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
@ -218,12 +257,42 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn)
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
if (!(lpofn->lpstrFilter))
{
str = SEGPTR_ALLOC(sizeof(defaultfilter));
TRACE(commdlg,"Alloc default for Filetype in GetSaveFileName\n");
memcpy(str,defaultfilter,sizeof(defaultfilter));
lpofn->lpstrFilter=SEGPTR_GET(str);
}
if (!(lpofn->lpstrTitle))
{
str1 = SEGPTR_ALLOC(sizeof(defaultsave)+1);
TRACE(commdlg,"Alloc default for Title in GetSaveFileName\n");
strcpy(str1,defaultsave);
lpofn->lpstrTitle=SEGPTR_GET(str1);
}
hwndDialog = DIALOG_CreateIndirect( hInst, template, win32Format,
lpofn->hwndOwner,
(DLGPROC16)MODULE_GetWndProcEntry16("FileSaveDlgProc"),
ofn, WIN_PROC_16 );
if (hwndDialog) bRet = DIALOG_DoDialogBox( hwndDialog, lpofn->hwndOwner );
if (str1)
{
TRACE(commdlg,"Freeing %p default for Title in GetSaveFileName\n",str1);
SEGPTR_FREE(str1);
lpofn->lpstrTitle=0;
}
if (str)
{
TRACE(commdlg,"Freeing %p default for Filetype in GetSaveFileName\n",str);
SEGPTR_FREE(str);
lpofn->lpstrFilter=0;
}
if (hDlgTmpl) {
if (lpofn->Flags & OFN_WINE32)
FreeResource32( hDlgTmpl );
@ -561,6 +630,9 @@ static LONG FILEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
/***********************************************************************
* FILEDLG_WMCommand [internal]
*/
BOOL32 in_lst1=FALSE;
BOOL32 in_update=FALSE;
static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
{
LONG lRet;
@ -580,7 +652,10 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
case lst1: /* file list */
FILEDLG_StripEditControl(hWnd);
if (notification == LBN_DBLCLK)
{
in_lst1=TRUE;
goto almost_ok;
}
lRet = SendDlgItemMessage16(hWnd, lst1, LB_GETCURSEL16, 0, 0);
if (lRet == LB_ERR) return TRUE;
if ((pstr = SEGPTR_ALLOC(512)))
@ -623,6 +698,10 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
goto reset_scan;
}
return TRUE;
case chx1:
return TRUE;
case pshHelp:
return TRUE;
case cmb2: /* disk drop list */
FILEDLG_StripEditControl(hWnd);
lRet = SendDlgItemMessage16(hWnd, cmb2, CB_GETCURSEL16, 0, 0L);
@ -640,11 +719,7 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
TRACE(commdlg,"Selected filter : %s\n", pstr);
SetDlgItemText32A( hWnd, edt1, pstr );
FILEDLG_ScanDir(hWnd, tmpstr);
return TRUE;
case chx1:
return TRUE;
case pshHelp:
return TRUE;
in_update=TRUE;
case IDOK:
almost_ok:
ofn2=*lpofn; /* for later restoring */
@ -684,8 +759,12 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
PTR_SEG_TO_LIN(lpofn->lpstrFilter),
lRet), sizeof(tmpstr2));
SetDlgItemText32A( hWnd, edt1, tmpstr2 );
if (in_lst1)
{
/* if ScanDir succeeds, we have changed the directory */
in_lst1 = FALSE;
if (FILEDLG_ScanDir(hWnd, tmpstr)) return TRUE;
}
/* if not, this must be a filename */
*pstr2 = 0;
if (pstr != NULL)
@ -711,9 +790,13 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
if (strlen(tmpstr2) > 3)
strcat(tmpstr2, "\\");
strncat(tmpstr2, tmpstr, 511-strlen(tmpstr2)); tmpstr2[511]=0;
strcpy(PTR_SEG_TO_LIN(lpofn->lpstrFile), tmpstr2);
if (lpofn->lpstrFile)
{
strncpy(PTR_SEG_TO_LIN(lpofn->lpstrFile), tmpstr2,lpofn->nMaxFile-1);
*((LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile)+lpofn->nMaxFile) ='\0';
}
lpofn->nFileOffset = 0;
}
lpofn->nFileOffset = strrchr(tmpstr2,'\\') - tmpstr2 +1;
lpofn->nFileExtension = 0;
while(tmpstr2[lpofn->nFileExtension] != '.' && tmpstr2[lpofn->nFileExtension] != '\0')
lpofn->nFileExtension++;
@ -721,6 +804,17 @@ static LRESULT FILEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
lpofn->nFileExtension = 0;
else
lpofn->nFileExtension++;
if(in_update)
{
if (FILEDLG_HookCallChk(lpofn))
FILEDLG_CallWindowProc(lpofn,hWnd,
RegisterWindowMessage32A( LBSELCHSTRING ),
control, MAKELONG(lRet,CD_LBSELCHANGE));
in_update = FALSE;
return TRUE;
}
if (PTR_SEG_TO_LIN(lpofn->lpstrFileTitle) != NULL)
{
lRet = SendDlgItemMessage16(hWnd, lst1, LB_GETCURSEL16, 0, 0);
@ -843,13 +937,13 @@ LRESULT WINAPI FileSaveDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
/***********************************************************************
* FindTextDlg (COMMDLG.11)
* FindText16 (COMMDLG.11)
*/
HWND16 WINAPI FindText( SEGPTR find )
HWND16 WINAPI FindText16( SEGPTR find )
{
HANDLE16 hInst;
LPCVOID ptr;
LPFINDREPLACE lpFind = (LPFINDREPLACE)PTR_SEG_TO_LIN(find);
LPFINDREPLACE16 lpFind = (LPFINDREPLACE16)PTR_SEG_TO_LIN(find);
/*
* FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
@ -866,15 +960,58 @@ HWND16 WINAPI FindText( SEGPTR find )
find, WIN_PROC_16 );
}
/***********************************************************************
* ReplaceText (COMMDLG.12)
* FindText32A (COMMDLG.6)
*/
HWND16 WINAPI ReplaceText( SEGPTR find )
HWND32 WINAPI FindText32A( LPFINDREPLACE32A lpFind )
{
HANDLE16 hInst;
LPCVOID ptr;
LPFINDREPLACE lpFind = (LPFINDREPLACE)PTR_SEG_TO_LIN(find);
/*
* FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
* For now, only the standard dialog works.
*/
/*
* FIXME : We should do error checking on the lpFind structure here
* and make CommDlgExtendedError() return the error condition.
*/
ptr = SYSRES_GetResPtr( SYSRES_DIALOG_FIND_TEXT );
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)FindTextDlgProc32A, (LPARAM)lpFind, WIN_PROC_32A );
}
/***********************************************************************
* FindText32W (COMMDLG.7)
*/
HWND32 WINAPI FindText32W( LPFINDREPLACE32W lpFind )
{
HANDLE16 hInst;
LPCVOID ptr;
/*
* FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
* For now, only the standard dialog works.
*/
/*
* FIXME : We should do error checking on the lpFind structure here
* and make CommDlgExtendedError() return the error condition.
*/
ptr = SYSRES_GetResPtr( SYSRES_DIALOG_FIND_TEXT );
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)FindTextDlgProc32W, (LPARAM)lpFind, WIN_PROC_32W );
}
/***********************************************************************
* ReplaceText16 (COMMDLG.12)
*/
HWND16 WINAPI ReplaceText16( SEGPTR find )
{
HANDLE16 hInst;
LPCVOID ptr;
LPFINDREPLACE16 lpFind = (LPFINDREPLACE16)PTR_SEG_TO_LIN(find);
/*
* FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
@ -891,44 +1028,87 @@ HWND16 WINAPI ReplaceText( SEGPTR find )
find, WIN_PROC_16 );
}
/***********************************************************************
* ReplaceText32A (COMDLG32.19)
*/
HWND32 WINAPI ReplaceText32A( LPFINDREPLACE32A lpFind )
{
HANDLE16 hInst;
LPCVOID ptr;
/*
* FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
* For now, only the standard dialog works.
*/
/*
* FIXME : We should do error checking on the lpFind structure here
* and make CommDlgExtendedError() return the error condition.
*/
ptr = SYSRES_GetResPtr( SYSRES_DIALOG_REPLACE_TEXT );
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)ReplaceTextDlgProc32A, (LPARAM)lpFind, WIN_PROC_32A );
}
/***********************************************************************
* ReplaceText32W (COMDLG32.20)
*/
HWND32 WINAPI ReplaceText32W( LPFINDREPLACE32W lpFind )
{
HANDLE16 hInst;
LPCVOID ptr;
/*
* FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
* For now, only the standard dialog works.
*/
/*
* FIXME : We should do error checking on the lpFind structure here
* and make CommDlgExtendedError() return the error condition.
*/
ptr = SYSRES_GetResPtr( SYSRES_DIALOG_REPLACE_TEXT );
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
return DIALOG_CreateIndirect( hInst, ptr, TRUE, lpFind->hwndOwner,
(DLGPROC16)ReplaceTextDlgProc32W, (LPARAM)lpFind, WIN_PROC_32W );
}
/***********************************************************************
* FINDDLG_WMInitDialog [internal]
*/
static LRESULT FINDDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
static LRESULT FINDDLG_WMInitDialog(HWND32 hWnd, LPARAM lParam, LPDWORD lpFlags,
LPSTR lpstrFindWhat, BOOL32 fUnicode)
{
LPFINDREPLACE lpfr;
SetWindowLong32A(hWnd, DWL_USER, lParam);
lpfr = (LPFINDREPLACE)PTR_SEG_TO_LIN(lParam);
lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
/*
* FIXME : If the initial FindWhat string is empty, we should disable the
* FindNext (IDOK) button. Only after typing some text, the button should be
* enabled.
*/
SetDlgItemText16(hWnd, edt1, lpfr->lpstrFindWhat);
CheckRadioButton32(hWnd, rad1, rad2, (lpfr->Flags & FR_DOWN) ? rad2 : rad1);
if (lpfr->Flags & (FR_HIDEUPDOWN | FR_NOUPDOWN)) {
if (fUnicode) SetDlgItemText32W(hWnd, edt1, (LPWSTR)lpstrFindWhat);
else SetDlgItemText32A(hWnd, edt1, lpstrFindWhat);
CheckRadioButton32(hWnd, rad1, rad2, (*lpFlags & FR_DOWN) ? rad2 : rad1);
if (*lpFlags & (FR_HIDEUPDOWN | FR_NOUPDOWN)) {
EnableWindow32(GetDlgItem32(hWnd, rad1), FALSE);
EnableWindow32(GetDlgItem32(hWnd, rad2), FALSE);
}
if (lpfr->Flags & FR_HIDEUPDOWN) {
if (*lpFlags & FR_HIDEUPDOWN) {
ShowWindow32(GetDlgItem32(hWnd, rad1), SW_HIDE);
ShowWindow32(GetDlgItem32(hWnd, rad2), SW_HIDE);
ShowWindow32(GetDlgItem32(hWnd, grp1), SW_HIDE);
}
CheckDlgButton32(hWnd, chx1, (lpfr->Flags & FR_WHOLEWORD) ? 1 : 0);
if (lpfr->Flags & (FR_HIDEWHOLEWORD | FR_NOWHOLEWORD))
CheckDlgButton32(hWnd, chx1, (*lpFlags & FR_WHOLEWORD) ? 1 : 0);
if (*lpFlags & (FR_HIDEWHOLEWORD | FR_NOWHOLEWORD))
EnableWindow32(GetDlgItem32(hWnd, chx1), FALSE);
if (lpfr->Flags & FR_HIDEWHOLEWORD)
if (*lpFlags & FR_HIDEWHOLEWORD)
ShowWindow32(GetDlgItem32(hWnd, chx1), SW_HIDE);
CheckDlgButton32(hWnd, chx2, (lpfr->Flags & FR_MATCHCASE) ? 1 : 0);
if (lpfr->Flags & (FR_HIDEMATCHCASE | FR_NOMATCHCASE))
CheckDlgButton32(hWnd, chx2, (*lpFlags & FR_MATCHCASE) ? 1 : 0);
if (*lpFlags & (FR_HIDEMATCHCASE | FR_NOMATCHCASE))
EnableWindow32(GetDlgItem32(hWnd, chx2), FALSE);
if (lpfr->Flags & FR_HIDEMATCHCASE)
if (*lpFlags & FR_HIDEMATCHCASE)
ShowWindow32(GetDlgItem32(hWnd, chx2), SW_HIDE);
if (!(lpfr->Flags & FR_SHOWHELP)) {
if (!(*lpFlags & FR_SHOWHELP)) {
EnableWindow32(GetDlgItem32(hWnd, pshHelp), FALSE);
ShowWindow32(GetDlgItem32(hWnd, pshHelp), SW_HIDE);
}
@ -940,40 +1120,43 @@ static LRESULT FINDDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
/***********************************************************************
* FINDDLG_WMCommand [internal]
*/
static LRESULT FINDDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
static LRESULT FINDDLG_WMCommand(HWND32 hWnd, WPARAM32 wParam,
HWND32 hwndOwner, LPDWORD lpFlags,
LPSTR lpstrFindWhat, WORD wFindWhatLen,
BOOL32 fUnicode)
{
LPFINDREPLACE lpfr;
int uFindReplaceMessage = RegisterWindowMessage32A( FINDMSGSTRING );
int uHelpMessage = RegisterWindowMessage32A( HELPMSGSTRING );
lpfr = (LPFINDREPLACE)PTR_SEG_TO_LIN(GetWindowLong32A(hWnd, DWL_USER));
switch (wParam) {
case IDOK:
GetDlgItemText16(hWnd, edt1, lpfr->lpstrFindWhat, lpfr->wFindWhatLen);
if (fUnicode)
GetDlgItemText32W(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2);
else GetDlgItemText32A(hWnd, edt1, lpstrFindWhat, wFindWhatLen);
if (IsDlgButtonChecked32(hWnd, rad2))
lpfr->Flags |= FR_DOWN;
else lpfr->Flags &= ~FR_DOWN;
*lpFlags |= FR_DOWN;
else *lpFlags &= ~FR_DOWN;
if (IsDlgButtonChecked32(hWnd, chx1))
lpfr->Flags |= FR_WHOLEWORD;
else lpfr->Flags &= ~FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked32(hWnd, chx2))
lpfr->Flags |= FR_MATCHCASE;
else lpfr->Flags &= ~FR_MATCHCASE;
lpfr->Flags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
lpfr->Flags |= FR_FINDNEXT;
SendMessage16(lpfr->hwndOwner, uFindReplaceMessage, 0,
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags |= FR_FINDNEXT;
SendMessage32A(hwndOwner, uFindReplaceMessage, 0,
GetWindowLong32A(hWnd, DWL_USER) );
return TRUE;
case IDCANCEL:
lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL);
lpfr->Flags |= FR_DIALOGTERM;
SendMessage16(lpfr->hwndOwner, uFindReplaceMessage, 0,
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL);
*lpFlags |= FR_DIALOGTERM;
SendMessage32A(hwndOwner, uFindReplaceMessage, 0,
GetWindowLong32A(hWnd, DWL_USER) );
DestroyWindow16(hWnd);
DestroyWindow32(hWnd);
return TRUE;
case pshHelp:
/* FIXME : should lpfr structure be passed as an argument ??? */
SendMessage16(lpfr->hwndOwner, uHelpMessage, 0, 0);
SendMessage32A(hwndOwner, uHelpMessage, 0, 0);
return TRUE;
}
return FALSE;
@ -981,16 +1164,64 @@ static LRESULT FINDDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
/***********************************************************************
* FindTextDlgProc (COMMDLG.13)
* FindTextDlgProc16 (COMMDLG.13)
*/
LRESULT WINAPI FindTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
LPARAM lParam)
LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
LPARAM lParam)
{
LPFINDREPLACE16 lpfr;
switch (wMsg) {
case WM_INITDIALOG:
return FINDDLG_WMInitDialog(hWnd, wParam, lParam);
lpfr=(LPFINDREPLACE16)PTR_SEG_TO_LIN(lParam);
return FINDDLG_WMInitDialog(hWnd, lParam, &(lpfr->Flags),
PTR_SEG_TO_LIN(lpfr->lpstrFindWhat), FALSE);
case WM_COMMAND:
return FINDDLG_WMCommand(hWnd, wParam, lParam);
lpfr=(LPFINDREPLACE16)PTR_SEG_TO_LIN(GetWindowLong32A(hWnd, DWL_USER));
return FINDDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, PTR_SEG_TO_LIN(lpfr->lpstrFindWhat),
lpfr->wFindWhatLen, FALSE);
}
return FALSE;
}
/***********************************************************************
* FindTextDlgProc32A
*/
LRESULT WINAPI FindTextDlgProc32A(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam,
LPARAM lParam)
{
LPFINDREPLACE32A lpfr;
switch (wMsg) {
case WM_INITDIALOG:
lpfr=(LPFINDREPLACE32A)lParam;
return FINDDLG_WMInitDialog(hWnd, lParam, &(lpfr->Flags),
lpfr->lpstrFindWhat, FALSE);
case WM_COMMAND:
lpfr=(LPFINDREPLACE32A)GetWindowLong32A(hWnd, DWL_USER);
return FINDDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, lpfr->lpstrFindWhat, lpfr->wFindWhatLen,
FALSE);
}
return FALSE;
}
/***********************************************************************
* FindTextDlgProc32W
*/
LRESULT WINAPI FindTextDlgProc32W(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam,
LPARAM lParam)
{
LPFINDREPLACE32W lpfr;
switch (wMsg) {
case WM_INITDIALOG:
lpfr=(LPFINDREPLACE32W)lParam;
return FINDDLG_WMInitDialog(hWnd, lParam, &(lpfr->Flags),
(LPSTR)lpfr->lpstrFindWhat, TRUE);
case WM_COMMAND:
lpfr=(LPFINDREPLACE32W)GetWindowLong32A(hWnd, DWL_USER);
return FINDDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, (LPSTR)lpfr->lpstrFindWhat, lpfr->wFindWhatLen,
TRUE);
}
return FALSE;
}
@ -999,31 +1230,37 @@ LRESULT WINAPI FindTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
/***********************************************************************
* REPLACEDLG_WMInitDialog [internal]
*/
static LRESULT REPLACEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
static LRESULT REPLACEDLG_WMInitDialog(HWND32 hWnd, LPARAM lParam,
LPDWORD lpFlags, LPSTR lpstrFindWhat,
LPSTR lpstrReplaceWith, BOOL32 fUnicode)
{
LPFINDREPLACE lpfr;
SetWindowLong32A(hWnd, DWL_USER, lParam);
lpfr = (LPFINDREPLACE)PTR_SEG_TO_LIN(lParam);
lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
/*
* FIXME : If the initial FindWhat string is empty, we should disable the FinNext /
* Replace / ReplaceAll buttons. Only after typing some text, the buttons should be
* enabled.
*/
SetDlgItemText16(hWnd, edt1, lpfr->lpstrFindWhat);
SetDlgItemText16(hWnd, edt2, lpfr->lpstrReplaceWith);
CheckDlgButton32(hWnd, chx1, (lpfr->Flags & FR_WHOLEWORD) ? 1 : 0);
if (lpfr->Flags & (FR_HIDEWHOLEWORD | FR_NOWHOLEWORD))
if (fUnicode)
{
SetDlgItemText32W(hWnd, edt1, (LPWSTR)lpstrFindWhat);
SetDlgItemText32W(hWnd, edt2, (LPWSTR)lpstrReplaceWith);
} else
{
SetDlgItemText32A(hWnd, edt1, lpstrFindWhat);
SetDlgItemText32A(hWnd, edt2, lpstrReplaceWith);
}
CheckDlgButton32(hWnd, chx1, (*lpFlags & FR_WHOLEWORD) ? 1 : 0);
if (*lpFlags & (FR_HIDEWHOLEWORD | FR_NOWHOLEWORD))
EnableWindow32(GetDlgItem32(hWnd, chx1), FALSE);
if (lpfr->Flags & FR_HIDEWHOLEWORD)
if (*lpFlags & FR_HIDEWHOLEWORD)
ShowWindow32(GetDlgItem32(hWnd, chx1), SW_HIDE);
CheckDlgButton32(hWnd, chx2, (lpfr->Flags & FR_MATCHCASE) ? 1 : 0);
if (lpfr->Flags & (FR_HIDEMATCHCASE | FR_NOMATCHCASE))
CheckDlgButton32(hWnd, chx2, (*lpFlags & FR_MATCHCASE) ? 1 : 0);
if (*lpFlags & (FR_HIDEMATCHCASE | FR_NOMATCHCASE))
EnableWindow32(GetDlgItem32(hWnd, chx2), FALSE);
if (lpfr->Flags & FR_HIDEMATCHCASE)
if (*lpFlags & FR_HIDEMATCHCASE)
ShowWindow32(GetDlgItem32(hWnd, chx2), SW_HIDE);
if (!(lpfr->Flags & FR_SHOWHELP)) {
if (!(*lpFlags & FR_SHOWHELP)) {
EnableWindow32(GetDlgItem32(hWnd, pshHelp), FALSE);
ShowWindow32(GetDlgItem32(hWnd, pshHelp), SW_HIDE);
}
@ -1035,66 +1272,89 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND16 hWnd, WPARAM16 wParam, LPARAM lPar
/***********************************************************************
* REPLACEDLG_WMCommand [internal]
*/
static LRESULT REPLACEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
static LRESULT REPLACEDLG_WMCommand(HWND32 hWnd, WPARAM16 wParam,
HWND32 hwndOwner, LPDWORD lpFlags,
LPSTR lpstrFindWhat, WORD wFindWhatLen,
LPSTR lpstrReplaceWith, WORD wReplaceWithLen,
BOOL32 fUnicode)
{
LPFINDREPLACE lpfr;
int uFindReplaceMessage = RegisterWindowMessage32A( FINDMSGSTRING );
int uHelpMessage = RegisterWindowMessage32A( HELPMSGSTRING );
lpfr = (LPFINDREPLACE)PTR_SEG_TO_LIN(GetWindowLong32A(hWnd, DWL_USER));
switch (wParam) {
case IDOK:
GetDlgItemText16(hWnd, edt1, lpfr->lpstrFindWhat, lpfr->wFindWhatLen);
GetDlgItemText16(hWnd, edt2, lpfr->lpstrReplaceWith, lpfr->wReplaceWithLen);
if (fUnicode)
{
GetDlgItemText32W(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2);
GetDlgItemText32W(hWnd, edt2, (LPWSTR)lpstrReplaceWith, wReplaceWithLen/2);
} else
{
GetDlgItemText32A(hWnd, edt1, lpstrFindWhat, wFindWhatLen);
GetDlgItemText32A(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen);
}
if (IsDlgButtonChecked32(hWnd, chx1))
lpfr->Flags |= FR_WHOLEWORD;
else lpfr->Flags &= ~FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked32(hWnd, chx2))
lpfr->Flags |= FR_MATCHCASE;
else lpfr->Flags &= ~FR_MATCHCASE;
lpfr->Flags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
lpfr->Flags |= FR_FINDNEXT;
SendMessage16(lpfr->hwndOwner, uFindReplaceMessage, 0,
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags |= FR_FINDNEXT;
SendMessage32A(hwndOwner, uFindReplaceMessage, 0,
GetWindowLong32A(hWnd, DWL_USER) );
return TRUE;
case IDCANCEL:
lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL);
lpfr->Flags |= FR_DIALOGTERM;
SendMessage16(lpfr->hwndOwner, uFindReplaceMessage, 0,
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL);
*lpFlags |= FR_DIALOGTERM;
SendMessage32A(hwndOwner, uFindReplaceMessage, 0,
GetWindowLong32A(hWnd, DWL_USER) );
DestroyWindow16(hWnd);
DestroyWindow32(hWnd);
return TRUE;
case psh1:
GetDlgItemText16(hWnd, edt1, lpfr->lpstrFindWhat, lpfr->wFindWhatLen);
GetDlgItemText16(hWnd, edt2, lpfr->lpstrReplaceWith, lpfr->wReplaceWithLen);
if (fUnicode)
{
GetDlgItemText32W(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2);
GetDlgItemText32W(hWnd, edt2, (LPWSTR)lpstrReplaceWith, wReplaceWithLen/2);
} else
{
GetDlgItemText32A(hWnd, edt1, lpstrFindWhat, wFindWhatLen);
GetDlgItemText32A(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen);
}
if (IsDlgButtonChecked32(hWnd, chx1))
lpfr->Flags |= FR_WHOLEWORD;
else lpfr->Flags &= ~FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked32(hWnd, chx2))
lpfr->Flags |= FR_MATCHCASE;
else lpfr->Flags &= ~FR_MATCHCASE;
lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACEALL | FR_DIALOGTERM);
lpfr->Flags |= FR_REPLACE;
SendMessage16(lpfr->hwndOwner, uFindReplaceMessage, 0,
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACEALL | FR_DIALOGTERM);
*lpFlags |= FR_REPLACE;
SendMessage32A(hwndOwner, uFindReplaceMessage, 0,
GetWindowLong32A(hWnd, DWL_USER) );
return TRUE;
case psh2:
GetDlgItemText16(hWnd, edt1, lpfr->lpstrFindWhat, lpfr->wFindWhatLen);
GetDlgItemText16(hWnd, edt2, lpfr->lpstrReplaceWith, lpfr->wReplaceWithLen);
if (fUnicode)
{
GetDlgItemText32W(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2);
GetDlgItemText32W(hWnd, edt2, (LPWSTR)lpstrReplaceWith, wReplaceWithLen/2);
} else
{
GetDlgItemText32A(hWnd, edt1, lpstrFindWhat, wFindWhatLen);
GetDlgItemText32A(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen);
}
if (IsDlgButtonChecked32(hWnd, chx1))
lpfr->Flags |= FR_WHOLEWORD;
else lpfr->Flags &= ~FR_WHOLEWORD;
*lpFlags |= FR_WHOLEWORD;
else *lpFlags &= ~FR_WHOLEWORD;
if (IsDlgButtonChecked32(hWnd, chx2))
lpfr->Flags |= FR_MATCHCASE;
else lpfr->Flags &= ~FR_MATCHCASE;
lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_DIALOGTERM);
lpfr->Flags |= FR_REPLACEALL;
SendMessage16(lpfr->hwndOwner, uFindReplaceMessage, 0,
*lpFlags |= FR_MATCHCASE;
else *lpFlags &= ~FR_MATCHCASE;
*lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_DIALOGTERM);
*lpFlags |= FR_REPLACEALL;
SendMessage32A(hwndOwner, uFindReplaceMessage, 0,
GetWindowLong32A(hWnd, DWL_USER) );
return TRUE;
case pshHelp:
/* FIXME : should lpfr structure be passed as an argument ??? */
SendMessage16(lpfr->hwndOwner, uHelpMessage, 0, 0);
SendMessage32A(hwndOwner, uHelpMessage, 0, 0);
return TRUE;
}
return FALSE;
@ -1102,16 +1362,67 @@ static LRESULT REPLACEDLG_WMCommand(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
/***********************************************************************
* ReplaceTextDlgProc (COMMDLG.14)
* ReplaceTextDlgProc16 (COMMDLG.14)
*/
LRESULT WINAPI ReplaceTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
LPARAM lParam)
LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
LPARAM lParam)
{
LPFINDREPLACE16 lpfr;
switch (wMsg) {
case WM_INITDIALOG:
return REPLACEDLG_WMInitDialog(hWnd, wParam, lParam);
lpfr=(LPFINDREPLACE16)PTR_SEG_TO_LIN(lParam);
return REPLACEDLG_WMInitDialog(hWnd, lParam, &lpfr->Flags,
PTR_SEG_TO_LIN(lpfr->lpstrFindWhat),
PTR_SEG_TO_LIN(lpfr->lpstrReplaceWith), FALSE);
case WM_COMMAND:
return REPLACEDLG_WMCommand(hWnd, wParam, lParam);
lpfr=(LPFINDREPLACE16)PTR_SEG_TO_LIN(GetWindowLong32A(hWnd, DWL_USER));
return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, PTR_SEG_TO_LIN(lpfr->lpstrFindWhat),
lpfr->wFindWhatLen, PTR_SEG_TO_LIN(lpfr->lpstrReplaceWith),
lpfr->wReplaceWithLen, FALSE);
}
return FALSE;
}
/***********************************************************************
* ReplaceTextDlgProc32A
*/
LRESULT WINAPI ReplaceTextDlgProc32A(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam,
LPARAM lParam)
{
LPFINDREPLACE32A lpfr;
switch (wMsg) {
case WM_INITDIALOG:
lpfr=(LPFINDREPLACE32A)lParam;
return REPLACEDLG_WMInitDialog(hWnd, lParam, &lpfr->Flags,
lpfr->lpstrFindWhat, lpfr->lpstrReplaceWith, FALSE);
case WM_COMMAND:
lpfr=(LPFINDREPLACE32A)GetWindowLong32A(hWnd, DWL_USER);
return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, lpfr->lpstrFindWhat, lpfr->wFindWhatLen,
lpfr->lpstrReplaceWith, lpfr->wReplaceWithLen, FALSE);
}
return FALSE;
}
/***********************************************************************
* ReplaceTextDlgProc32W
*/
LRESULT WINAPI ReplaceTextDlgProc32W(HWND32 hWnd, UINT32 wMsg, WPARAM32 wParam,
LPARAM lParam)
{
LPFINDREPLACE32W lpfr;
switch (wMsg) {
case WM_INITDIALOG:
lpfr=(LPFINDREPLACE32W)lParam;
return REPLACEDLG_WMInitDialog(hWnd, lParam, &lpfr->Flags,
(LPSTR)lpfr->lpstrFindWhat, (LPSTR)lpfr->lpstrReplaceWith,
TRUE);
case WM_COMMAND:
lpfr=(LPFINDREPLACE32W)GetWindowLong32A(hWnd, DWL_USER);
return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner,
&lpfr->Flags, (LPSTR)lpfr->lpstrFindWhat, lpfr->wFindWhatLen,
(LPSTR)lpfr->lpstrReplaceWith, lpfr->wReplaceWithLen, TRUE);
}
return FALSE;
}
@ -1321,7 +1632,8 @@ BOOL16 WINAPI ChooseColor(LPCHOOSECOLOR lpChCol)
{
HANDLE16 hResInfo;
if (!(hResInfo = FindResource16(lpChCol->hInstance,
lpChCol->lpTemplateName, RT_DIALOG)))
lpChCol->lpTemplateName,
RT_DIALOG16)))
{
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
@ -1798,7 +2110,7 @@ static void CC_PrepareColorGraph(HWND16 hDlg)
HBRUSH32 hbrush;
HDC32 hdc ;
RECT16 rect,client;
HCURSOR16 hcursor=SetCursor16(LoadCursor16(0,IDC_WAIT));
HCURSOR16 hcursor=SetCursor16(LoadCursor16(0,IDC_WAIT16));
GetClientRect16(hwnd,&client);
hdc=GetDC32(hwnd);
@ -2416,7 +2728,8 @@ BOOL16 WINAPI ChooseFont(LPCHOOSEFONT lpChFont)
{
HANDLE16 hResInfo;
if (!(hResInfo = FindResource16( lpChFont->hInstance,
lpChFont->lpTemplateName, RT_DIALOG)))
lpChFont->lpTemplateName,
RT_DIALOG16)))
{
CommDlgLastError = CDERR_FINDRESFAILURE;
return FALSE;
@ -2635,7 +2948,7 @@ LRESULT CFn_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam)
int i,j,res,init=0;
long l;
LPLOGFONT16 lpxx;
HCURSOR16 hcursor=SetCursor16(LoadCursor16(0,IDC_WAIT));
HCURSOR16 hcursor=SetCursor16(LoadCursor16(0,IDC_WAIT16));
LPCHOOSEFONT lpcf;
SetWindowLong32A(hDlg, DWL_USER, lParam);
@ -2650,7 +2963,7 @@ LRESULT CFn_WMInitDialog(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam)
return FALSE;
}
if (!hBitmapTT)
hBitmapTT = LoadBitmap16(0, MAKEINTRESOURCE(OBM_TRTYPE));
hBitmapTT = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_TRTYPE));
if (!(lpcf->Flags & CF_SHOWHELP) || !IsWindow32(lpcf->hwndOwner))
ShowWindow32(GetDlgItem32(hDlg,pshHelp),SW_HIDE);
@ -2754,7 +3067,7 @@ LRESULT CFn_WMMeasureItem(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam)
BITMAP16 bm;
LPMEASUREITEMSTRUCT16 lpmi=PTR_SEG_TO_LIN((LPMEASUREITEMSTRUCT16)lParam);
if (!hBitmapTT)
hBitmapTT = LoadBitmap16(0, MAKEINTRESOURCE(OBM_TRTYPE));
hBitmapTT = LoadBitmap16(0, MAKEINTRESOURCE16(OBM_TRTYPE));
GetObject16( hBitmapTT, sizeof(bm), &bm );
lpmi->itemHeight=bm.bmHeight;
/* FIXME: use MAX of bm.bmHeight and tm.tmHeight .*/
@ -2896,7 +3209,7 @@ LRESULT CFn_WMCommand(HWND16 hDlg, WPARAM16 wParam, LPARAM lParam)
i=SendDlgItemMessage16(hDlg,cmb1,CB_GETCURSEL16,0,0);
if (i!=CB_ERR)
{
HCURSOR16 hcursor=SetCursor16(LoadCursor16(0,IDC_WAIT));
HCURSOR16 hcursor=SetCursor16(LoadCursor16(0,IDC_WAIT16));
char *str = SEGPTR_ALLOC(256);
SendDlgItemMessage16(hDlg,cmb1,CB_GETLBTEXT16,i,
(LPARAM)SEGPTR_GET(str));
@ -3084,11 +3397,14 @@ BOOL32 WINAPI xxx##32A( LPOPENFILENAME32A ofn ) \
} \
ofn16->nMaxCustFilter = ofn->nMaxCustFilter; \
ofn16->nFilterIndex = ofn->nFilterIndex; \
if (ofn->nMaxFile) \
ofn16->lpstrFile = SEGPTR_GET(SEGPTR_ALLOC(ofn->nMaxFile)); \
ofn16->nMaxFile = ofn->nMaxFile; \
if (ofn->lpstrFileTitle) \
if (ofn16->lpstrFileTitle) \
ofn16->lpstrFileTitle= SEGPTR_GET(SEGPTR_STRDUP(ofn->lpstrFileTitle));\
ofn16->nMaxFileTitle = ofn->nMaxFileTitle; \
if (ofn16->nMaxFileTitle) \
ofn16->lpstrFileTitle = SEGPTR_GET(SEGPTR_ALLOC(ofn->nMaxFileTitle));\
if (ofn->lpstrInitialDir) \
ofn16->lpstrInitialDir = SEGPTR_GET(SEGPTR_STRDUP(ofn->lpstrInitialDir));\
if (ofn->lpstrTitle) \
@ -3106,6 +3422,8 @@ BOOL32 WINAPI xxx##32A( LPOPENFILENAME32A ofn ) \
\
ret = xxx##16(SEGPTR_GET(ofn16)); \
\
ofn->nFileOffset = ofn16->nFileOffset; \
ofn->nFileExtension = ofn16->nFileExtension; \
if (ofn16->lpstrFilter) \
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFilter)); \
if (ofn16->lpTemplateName) \
@ -3119,11 +3437,15 @@ BOOL32 WINAPI xxx##32A( LPOPENFILENAME32A ofn ) \
if (ofn16->lpstrCustomFilter) \
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrCustomFilter)); \
\
if (ofn16->lpstrFile) { \
strcpy(ofn->lpstrFile,PTR_SEG_TO_LIN(ofn16->lpstrFile)); \
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFile)); \
} \
\
if (ofn16->lpstrFileTitle) \
if (ofn16->lpstrFileTitle) { \
strcpy(ofn->lpstrFileTitle,PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));\
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFileTitle)); \
} \
SEGPTR_FREE(ofn16); \
return ret; \
} \
@ -3182,11 +3504,14 @@ BOOL32 WINAPI xxx##32W( LPOPENFILENAME32W ofn ) \
} \
ofn16->nMaxCustFilter = ofn->nMaxCustFilter; \
ofn16->nFilterIndex = ofn->nFilterIndex; \
if (ofn->nMaxFile) \
ofn16->lpstrFile = SEGPTR_GET(SEGPTR_ALLOC(ofn->nMaxFile)); \
ofn16->nMaxFile = ofn->nMaxFile; \
if (ofn->lpstrFileTitle) \
if (ofn16->lpstrFileTitle) \
ofn16->lpstrFileTitle= SEGPTR_GET(SEGPTR_STRDUP_WtoA(ofn->lpstrFileTitle));\
ofn16->nMaxFileTitle = ofn->nMaxFileTitle; \
if (ofn->nMaxFileTitle) \
ofn16->lpstrFileTitle = SEGPTR_GET(SEGPTR_ALLOC(ofn->nMaxFileTitle));\
if (ofn->lpstrInitialDir) \
ofn16->lpstrInitialDir = SEGPTR_GET(SEGPTR_STRDUP_WtoA(ofn->lpstrInitialDir));\
if (ofn->lpstrTitle) \
@ -3203,6 +3528,8 @@ BOOL32 WINAPI xxx##32W( LPOPENFILENAME32W ofn ) \
} \
ret = xxx##16(SEGPTR_GET(ofn16)); \
\
ofn->nFileOffset = ofn16->nFileOffset; \
ofn->nFileExtension = ofn16->nFileExtension; \
if (ofn16->lpstrFilter) \
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFilter)); \
if (ofn16->lpTemplateName) \
@ -3216,11 +3543,15 @@ BOOL32 WINAPI xxx##32W( LPOPENFILENAME32W ofn ) \
if (ofn16->lpstrCustomFilter) \
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrCustomFilter)); \
\
if (ofn16->lpstrFile) { \
lstrcpyAtoW(ofn->lpstrFile,PTR_SEG_TO_LIN(ofn16->lpstrFile)); \
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFile)); \
} \
\
if (ofn16->lpstrFileTitle) \
if (ofn16->lpstrFileTitle) { \
lstrcpyAtoW(ofn->lpstrFileTitle,PTR_SEG_TO_LIN(ofn16->lpstrFileTitle));\
SEGPTR_FREE(PTR_SEG_TO_LIN(ofn16->lpstrFileTitle)); \
} \
SEGPTR_FREE(ofn16); \
return ret; \
}

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "global.h"
#include "windows.h"
#include "winnt.h"
#include "winreg.h"
@ -34,7 +35,7 @@ VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si)
* FIXME: perhaps overrideable with precompiler flags?
*/
cachedsi.u.x.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL;
cachedsi.dwPageSize = 4096;
cachedsi.dwPageSize = VIRTUAL_GetPageSize();
/* FIXME: better values for the two entries below... */
cachedsi.lpMinimumApplicationAddress = (void *)0x40000000;

View File

@ -1703,3 +1703,29 @@ VOID __cdecl CRTDLL__sleep(unsigned long timeout)
TRACE(crtdll,"CRTDLL__sleep for %ld milliseconds\n",timeout);
Sleep((timeout)?timeout:1);
}
/*********************************************************************
* getenv (CRTDLL.437)
*/
LPSTR __cdecl CRTDLL_getenv(const char *name)
{
LPSTR environ = GetEnvironmentStrings32A();
LPSTR pp,pos = NULL;
unsigned int length;
for (pp = environ; (*pp); pp = pp + strlen(pp) +1)
{
pos =strchr(pp,'=');
if (pos)
length = pos -pp;
else
length = strlen(pp);
if (!strncmp(pp,name,length)) break;
}
if ((pp)&& (pos))
{
pp = pos+1;
TRACE(crtdll,"got %s\n",pp);
}
FreeEnvironmentStrings32A( environ );
return pp;
}

View File

@ -12,6 +12,9 @@
#include "debug.h"
static LONG DDE_current_handle;
/*****************************************************************
* DdeInitialize16 (DDEML.2)
*/
@ -174,7 +177,8 @@ HSZ WINAPI DdeCreateStringHandle16( DWORD idInst, LPCSTR str, INT16 codepage )
HSZ WINAPI DdeCreateStringHandle32A( DWORD idInst, LPCSTR psz, INT32 codepage )
{
FIXME( ddeml, "empty stub\n" );
return 0;
DDE_current_handle++;
return DDE_current_handle;
}
@ -184,7 +188,8 @@ HSZ WINAPI DdeCreateStringHandle32A( DWORD idInst, LPCSTR psz, INT32 codepage )
HSZ WINAPI DdeCreateStringHandle32W( DWORD idInst, LPCWSTR psz, INT32 codepage)
{
FIXME( ddeml, "empty stub\n" );
return 0;
DDE_current_handle++;
return DDE_current_handle;
}

View File

@ -129,15 +129,57 @@ debugstr_w (LPCWSTR s)
/* This routine returns a nicely formated name of the resource res
If the resource name is a string, it will return '<res-name>'
If it is a number, it will return #<4-digit-hex-number> */
LPSTR
debugres (const void *res)
LPSTR debugres_a( LPCSTR res )
{
if (HIWORD((DWORD)res))
return debugstr_a((LPCSTR)res);
else{
char resname[10];
if (HIWORD(res)) return debugstr_a(res);
sprintf(resname, "#%04x", LOWORD(res));
return debugstr_a (resname);
}
}
LPSTR debugres_w( LPCWSTR res )
{
char resname[10];
if (HIWORD(res)) return debugstr_w(res);
sprintf(resname, "#%04x", LOWORD(res));
return debugstr_a (resname);
}
/* ---------------------------------------------------------------------- */
void debug_dumpstr (LPCSTR s)
{
fputc ('"', stderr);
while (*s)
{
switch (*s)
{
case '\\':
case '"':
fputc ('\\', stderr);
fputc (*s, stderr);
break;
case '\n':
fputc ('\\', stderr);
fputc ('n', stderr);
break;
case '\r':
fputc ('\\', stderr);
fputc ('r', stderr);
break;
case '\t':
fputc ('\\', stderr);
fputc ('t', stderr);
break;
default:
if (*s<' ')
printf ("\\0x%02x", *s);
else
fputc (*s, stderr);
}
s++;
}
fputc ('"', stderr);
}
/* ---------------------------------------------------------------------- */

View File

@ -5,28 +5,21 @@
*
* TODO:
* - Improve the documentation.
* - Fix ImageList_DrawIndirect.
* - Drawing selected images is awfully slow since it has to
* be done pixel by pixel.
* - Fix ImageList_GetIcon (almost fixed).
* - Fix all other stubs.
* - Improve error checking in some functions.
* - Fix ILD_TRANSPARENT error in ImageList_DrawIndirect.
* - Fix offsets in ImageList_DrawIndirect.
* - Fix ImageList_GetIcon (might be a result of the
* ILD_TRANSPARENT error in ImageList_DrawIndirect).
* - Fix drag functions.
* - Improve error checking in most functions.
* - Fix all other stubs.
* - Add ImageList_SetFilter (undocumented).
* BTW does anybody know anything about this function???
* - It removes 12 Bytes from the stack (3 Parameters).
* - First parameter SHOULD be a HIMAGELIST.
* - Second parameter COULD be an index?????
* - Third parameter.... ?????????????????????
* - Add undocumented functions.
* Are there any other undocumented ImageList functions?
*
* Testing:
* - Test ImageList_LoadImageA/W with Icons and Cursors.
* - Test ImageList_Copy.
* - Test ImageList_Duplicate.
* - Test ImageList_Remove.
* - Test ImageList_SetImageCount.
* - Test ImageList_GetImageRect (undocumented).
* - Test all the other functions.
*
@ -54,7 +47,6 @@
#include "imagelist.h"
#include "commctrl.h"
#include "debug.h"
#include "heap.h"
#ifdef __GET_ICON_INFO_HACK__
#include "bitmap.h"
@ -76,8 +68,16 @@ static INT32 nInternalDragHotspotY = 0;
static HCURSOR32 hcurInternal = 0;
static void
IMAGELIST_InternalGrowBitmaps (HIMAGELIST himl, INT32 nImageCount)
/*************************************************************************
* IMAGELIST_InternalGrowBitmaps [Internal]
*
* Grows the bitmaps of the given image list by the given number of
* images. Can NOT be used to reduce the number of images.
*/
static void IMAGELIST_InternalGrowBitmaps (
HIMAGELIST himl, /* image list handle */
INT32 nImageCount) /* number of images to grow by */
{
HDC32 hdcImageList, hdcBitmap;
HBITMAP32 hbmNewBitmap;
@ -126,44 +126,14 @@ IMAGELIST_InternalGrowBitmaps (HIMAGELIST himl, INT32 nImageCount)
}
static void
IMAGELIST_InternalDrawMask (HIMAGELIST himl, INT32 i, HDC32 hdc,
INT32 x, INT32 y)
{
HDC32 hdcImageList;
if (himl->hbmMask)
{
hdcImageList = CreateCompatibleDC32 (0);
SelectObject32 (hdcImageList, himl->hbmMask);
BitBlt32 (hdc, x, y, himl->cx, himl->cy, hdcImageList,
himl->cx * i, 0, SRCCOPY);
DeleteDC32 (hdcImageList);
}
}
static void
IMAGELIST_InternalDrawImage (HIMAGELIST himl, INT32 i, HDC32 hdc,
INT32 x, INT32 y, UINT32 fStyle)
{
HDC32 hdcImageList;
hdcImageList = CreateCompatibleDC32 (0);
SelectObject32 (hdcImageList, himl->hbmImage);
BitBlt32 (hdc, x, y, himl->cx, himl->cy, hdcImageList,
himl->cx * i, 0, SRCCOPY);
DeleteDC32 (hdcImageList);
}
/*************************************************************************
* ImageList_Add [COMCTL32.39]
*
* Add an image (and a mask) to an image list.
*
* RETURNS
* Index of the first image that was added, -1 if an error occurred.
* Index of the first image that was added.
* -1 if an error occurred.
*/
INT32 WINAPI ImageList_Add (
@ -174,17 +144,17 @@ INT32 WINAPI ImageList_Add (
HDC32 hdcImageList, hdcImage, hdcMask;
INT32 nFirstIndex, nImageCount;
INT32 nStartX, nRunX, nRunY;
COLORREF clrColor;
BITMAP32 bmp;
if (himl == NULL) return (-1);
hdcMask = 0; /* to keep compiler happy ;-) */
GetObject32A (hbmImage, sizeof(BITMAP32), (LPVOID)&bmp);
nImageCount = bmp.bmWidth / himl->cx;
if (himl->cCurImage + nImageCount >= himl->cMaxImage)
IMAGELIST_InternalGrowBitmaps (himl, nImageCount);
// ImageList_SetImageCount (himl, himl->cCurImage + nImageCount);
hdcImageList = CreateCompatibleDC32 (0);
hdcImage = CreateCompatibleDC32 (0);
@ -203,6 +173,21 @@ INT32 WINAPI ImageList_Add (
SelectObject32 (hdcImage, hbmMask);
BitBlt32 (hdcImageList, himl->cCurImage * himl->cx, 0,
bmp.bmWidth, himl->cy, hdcImage, 0, 0, SRCCOPY);
/* fix transparent areas of the image bitmap*/
SelectObject32 (hdcMask, himl->hbmMask);
SelectObject32 (hdcImage, himl->hbmImage);
nStartX = himl->cCurImage * himl->cx;
for (nRunY = 0; nRunY < himl->cy; nRunY++)
{
for (nRunX = 0; nRunX < bmp.bmWidth; nRunX++)
{
if (GetPixel32 (hdcMask, nStartX + nRunX, nRunY) ==
RGB(255, 255, 255))
SetPixel32 (hdcImage, nStartX + nRunX, nRunY,
RGB(0, 0, 0));
}
}
}
else
{
@ -214,8 +199,8 @@ INT32 WINAPI ImageList_Add (
{
for (nRunX = 0; nRunX < bmp.bmWidth; nRunX++)
{
clrColor = GetPixel32 (hdcImageList, nStartX + nRunX, nRunY);
if (clrColor == himl->clrBk)
if (GetPixel32 (hdcImageList, nStartX + nRunX, nRunY) ==
himl->clrBk)
{
SetPixel32 (hdcImageList, nStartX + nRunX, nRunY,
RGB(0, 0, 0));
@ -248,7 +233,8 @@ INT32 WINAPI ImageList_Add (
* mask color.
*
* RETURNS
* Index of the first image that was added, -1 if an error occurred.
* Index of the first image that was added.
* -1 if an error occurred.
*/
INT32 WINAPI ImageList_AddMasked (
@ -260,7 +246,6 @@ INT32 WINAPI ImageList_AddMasked (
INT32 nIndex, nImageCount;
BITMAP32 bmp;
INT32 nStartX, nRunX, nRunY;
COLORREF clrColor;
if (himl == NULL) return (-1);
@ -291,8 +276,8 @@ INT32 WINAPI ImageList_AddMasked (
{
for (nRunX = 0; nRunX < bmp.bmWidth; nRunX++)
{
clrColor = GetPixel32 (hdcImageList, nStartX + nRunX, nRunY);
if (clrColor == clrMask)
if (GetPixel32 (hdcImageList, nStartX + nRunX, nRunY) ==
clrMask)
{
SetPixel32 (hdcImageList, nStartX + nRunX, nRunY,
RGB(0, 0, 0));
@ -316,8 +301,11 @@ INT32 WINAPI ImageList_AddMasked (
/*************************************************************************
* ImageList_BeginDrag [COMCTL32.42]
*
* Creates a temporary imagelist with an image in it, which will be used
* as a drag image.
* Creates a temporary imagelist with an image in it, which will be used
* as a drag image.
*
* RETURNS
* ...
*/
BOOL32 WINAPI ImageList_BeginDrag (
@ -377,6 +365,9 @@ BOOL32 WINAPI ImageList_BeginDrag (
* Copying from one imagelist to another is allowed, in contrary to
* M$'s original implementation. They just allow copying or swapping
* within one imagelist (himlDst and himlSrc must be the same).
*
* RETURNS
* ...
*/
BOOL32 WINAPI ImageList_Copy (
@ -491,7 +482,8 @@ BOOL32 WINAPI ImageList_Copy (
* Creates an imagelist of the given image size and number of images.
*
* RETURNS
* Handle of the created image list, 0 if an error occurred.
* Handle of the created image list.
* 0 if an error occurred.
*/
HIMAGELIST WINAPI ImageList_Create (
@ -505,6 +497,13 @@ HIMAGELIST WINAPI ImageList_Create (
HIMAGELIST himl;
HDC32 hdc;
INT32 nCount;
HBITMAP32 hbmTemp;
WORD aBitBlend25[16] =
{0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD,
0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD, 0x7777, 0xDDDD};
WORD aBitBlend50[16] =
{0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA,
0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA};
himl = (HIMAGELIST)LocalAlloc32 (LMEM_FIXED | LMEM_ZEROINIT,
sizeof(struct _IMAGELIST));
@ -553,6 +552,15 @@ HIMAGELIST WINAPI ImageList_Create (
else
himl->hbmMask = 0;
/* create blending brushes */
hbmTemp = CreateBitmap32 (16, 16, 1, 1, &aBitBlend25);
himl->hbrBlend25 = CreatePatternBrush32 (hbmTemp);
DeleteObject32 (hbmTemp);
hbmTemp = CreateBitmap32 (16, 16, 1, 1, &aBitBlend50);
himl->hbrBlend50 = CreatePatternBrush32 (hbmTemp);
DeleteObject32 (hbmTemp);
return (himl);
}
@ -563,7 +571,8 @@ HIMAGELIST WINAPI ImageList_Create (
* Destroy the given imagelist.
*
* RETURNS
* TRUE if the image list was destryed, FALSE if an error occurred.
* TRUE if the image list was destroyed.
* FALSE if an error occurred.
*/
BOOL32 WINAPI ImageList_Destroy (
@ -614,7 +623,6 @@ BOOL32 WINAPI ImageList_DragLeave (
FIXME (imagelist, "empty stub!\n");
SetCursor32 (hcurInternal);
hcurInternal = 0;
@ -727,23 +735,24 @@ BOOL32 WINAPI ImageList_DrawEx (
/*************************************************************************
* ImageList_Drawindirect [COMCTL32.52]
* ImageList_DrawIndirect [COMCTL32.52]
*/
BOOL32 WINAPI ImageList_DrawIndirect (
IMAGELISTDRAWPARAMS *pimldp)
{
HIMAGELIST himlLocal;
HDC32 hdcImageList,hdcMask, hdcTempImage;
HBITMAP32 hbmMask, hbmTempImage;
HDC32 hdcImageList, hdcTempImage;
HBITMAP32 hbmTempImage;
HBRUSH32 hBrush, hOldBrush;
INT32 nOvlIdx, nStartX, nRunX, nRunY;
COLORREF clrBlend, clrImage;
INT32 nOvlIdx;
COLORREF clrBlend;
BOOL32 bImage; /* draw image ? */
BOOL32 bImageTrans; /* draw image transparent ? */
BOOL32 bMask; /* draw mask ? */
BOOL32 bMaskTrans; /* draw mask transparent ? */
BOOL32 bBlend = FALSE;
BOOL32 bBlend25;
BOOL32 bBlend50;
if (pimldp == NULL) return (FALSE);
if (pimldp->cbSize < sizeof(IMAGELISTDRAWPARAMS)) return (FALSE);
@ -755,6 +764,8 @@ BOOL32 WINAPI ImageList_DrawIndirect (
bImageTrans = FALSE;
bMask = FALSE;
bMaskTrans = FALSE;
bBlend25 = FALSE;
bBlend50 = FALSE;
if ((himlLocal->clrBk == CLR_NONE) && (himlLocal->hbmMask))
{
bImageTrans = TRUE;
@ -778,90 +789,92 @@ BOOL32 WINAPI ImageList_DrawIndirect (
bImage = FALSE;
}
if ((pimldp->fStyle & ILD_TRANSPARENT) && (himlLocal->hbmMask))
{
bMaskTrans = TRUE;
bImageTrans = TRUE;
}
if ((himlLocal->clrBk == CLR_NONE) && (himlLocal->hbmMask))
bMaskTrans = TRUE;
if ((pimldp->fStyle & ILD_BLEND25) || (pimldp->fStyle & ILD_BLEND50))
bBlend = TRUE;
if (pimldp->fStyle & ILD_BLEND50)
bBlend50 = TRUE;
else if (pimldp->fStyle & ILD_BLEND25)
bBlend25 = TRUE;
hdcImageList = CreateCompatibleDC32 (0);
if (bMask)
{
/* draw the mask */
SelectObject32 (hdcImageList, himlLocal->hbmMask);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, pimldp->himl->cx,
pimldp->himl->cy, hdcImageList,
pimldp->himl->cx * pimldp->i, 0,
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
himlLocal->cx, himlLocal->cy, hdcImageList,
himlLocal->cx * pimldp->i, 0,
bMaskTrans ? SRCAND : SRCCOPY);
}
if (bImage)
{
/* draw the image */
SelectObject32 (hdcImageList, himlLocal->hbmImage);
if (!bBlend)
if (!bImageTrans)
{
if (!bImageTrans)
{
hBrush = CreateSolidBrush32 (himlLocal->clrBk);
hOldBrush = SelectObject32 (pimldp->hdcDst, hBrush);
PatBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
himlLocal->cx, himlLocal->cy, PATCOPY);
DeleteObject32 (SelectObject32 (pimldp->hdcDst, hOldBrush));
}
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcImageList, himlLocal->cx * pimldp->i, 0,
SRCPAINT);
hBrush = CreateSolidBrush32 (himlLocal->clrBk);
hOldBrush = SelectObject32 (pimldp->hdcDst, hBrush);
PatBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y,
himlLocal->cx, himlLocal->cy, PATCOPY);
DeleteObject32 (SelectObject32 (pimldp->hdcDst, hOldBrush));
}
else
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcImageList, himlLocal->cx * pimldp->i, 0,
SRCPAINT);
if (bBlend25 || bBlend50)
{
if (pimldp->rgbFg == CLR_DEFAULT)
clrBlend = (GetSysColor32 (COLOR_HIGHLIGHT) & 0xFEFEFEFE)>>1;
clrBlend = GetSysColor32 (COLOR_HIGHLIGHT);
else
clrBlend = (pimldp->rgbFg & 0xFEFEFEFE)>>1;
clrBlend = pimldp->rgbFg;
hdcTempImage = CreateCompatibleDC32 (0);
hbmTempImage = CreateBitmap32 (himlLocal->cx, himlLocal->cy,
1, himlLocal->uBitsPixel, NULL);
SelectObject32 (hdcTempImage, hbmTempImage);
PatBlt32 (hdcTempImage, 0, 0, himlLocal->cx, himlLocal->cy, BLACKNESS);
#if 0
if (bImageTrans)
{
#endif
hdcMask = CreateCompatibleDC32 (0);
SelectObject32 (hdcMask, himlLocal->hbmMask);
nStartX = pimldp->i * himlLocal->cx;
for (nRunY = 0; nRunY < himlLocal->cy; nRunY++)
{
for (nRunX = 0; nRunX < himlLocal->cx; nRunX++)
{
if (GetPixel32 (hdcMask, nStartX + nRunX, nRunY) == 0)
{
clrImage = GetPixel32 (hdcImageList, nStartX + nRunX, nRunY);
clrImage = ((clrImage & 0xFEFEFEFE)>>1) + clrBlend;
/* mask */
SelectObject32 (hdcTempImage,
bBlend50 ? himlLocal->hbrBlend50 : himlLocal->hbrBlend25);
PatBlt32 (hdcTempImage, 0, 0, himlLocal->cx, himlLocal->cy, PATCOPY);
SetPixel32 (hdcTempImage, nRunX, nRunY, clrImage);
}
}
}
SelectObject32 (hdcImageList, himlLocal->hbmMask);
BitBlt32 (hdcTempImage, 0, 0, himlLocal->cx,
himlLocal->cy, hdcImageList,
pimldp->i * himlLocal->cx, 0, SRCPAINT);
DeleteDC32 (hdcMask);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcTempImage, 0, 0, SRCPAINT);
#if 0
}
else
{
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcTempImage, 0, 0, SRCAND);
}
#endif
/* fill */
hBrush = CreateSolidBrush32 (clrBlend);
SelectObject32 (hdcTempImage, hBrush);
PatBlt32 (hdcTempImage, 0, 0, himlLocal->cx, himlLocal->cy, PATCOPY);
DeleteObject32 (hBrush);
SelectObject32 (hdcTempImage,
bBlend50 ? himlLocal->hbrBlend50 : himlLocal->hbrBlend25);
PatBlt32 (hdcTempImage, 0, 0, himlLocal->cx, himlLocal->cy, 0x0A0329);
SelectObject32 (hdcImageList, himlLocal->hbmMask);
BitBlt32 (hdcTempImage, 0, 0, himlLocal->cx,
himlLocal->cy, hdcImageList,
pimldp->i * himlLocal->cx, 0, SRCPAINT);
BitBlt32 (pimldp->hdcDst, pimldp->x, pimldp->y, himlLocal->cx,
himlLocal->cy, hdcTempImage, 0, 0, SRCPAINT);
DeleteObject32 (hbmTempImage);
DeleteDC32 (hdcTempImage);
@ -946,6 +959,15 @@ HIMAGELIST WINAPI ImageList_Duplicate (
}
/*************************************************************************
* ImageList_EndDrag [COMCTL32.54]
*
* Finishes a drag operation.
*
* FIXME
* semi-stub.
*/
BOOL32 WINAPI ImageList_EndDrag (VOID)
{
FIXME (imagelist, "partially implemented!\n");
@ -965,6 +987,15 @@ BOOL32 WINAPI ImageList_EndDrag (VOID)
}
/*************************************************************************
* ImageList_GetBkColor [COMCTL32.55]
*
* Returns the background color of an image list.
*
* RETURNS
* Background color.
*/
COLORREF WINAPI ImageList_GetBkColor (
HIMAGELIST himl)
{
@ -972,6 +1003,15 @@ COLORREF WINAPI ImageList_GetBkColor (
}
/*************************************************************************
* ImageList_GetDragImage [COMCTL32.56]
*
* Returns the handle to the internal drag image list.
*
* FIXME
* semi-stub.
*/
HIMAGELIST WINAPI ImageList_GetDragImage (
POINT32 *ppt,
POINT32 *pptHotspot)
@ -985,6 +1025,10 @@ HIMAGELIST WINAPI ImageList_GetDragImage (
}
/*************************************************************************
* ImageList_GetIcon [COMCTL32.57]
*/
HICON32 WINAPI ImageList_GetIcon (
HIMAGELIST himl,
INT32 i,
@ -1002,8 +1046,7 @@ HICON32 WINAPI ImageList_GetIcon (
ii.xHotspot = 0;
ii.yHotspot = 0;
ii.hbmMask = CreateBitmap32 (nWidth, nHeight, 1, 1, NULL);
ii.hbmColor = CreateBitmap32 (nWidth, nHeight,
1, 1, NULL);
ii.hbmColor = CreateBitmap32 (nWidth, nHeight, 1, 1, NULL);
hdc = CreateCompatibleDC32(0);
@ -1027,6 +1070,10 @@ HICON32 WINAPI ImageList_GetIcon (
}
/*************************************************************************
* ImageList_GetIconSize [COMCTL32.58]
*/
BOOL32 WINAPI ImageList_GetIconSize (
HIMAGELIST himl,
INT32 *cx,
@ -1044,6 +1091,10 @@ BOOL32 WINAPI ImageList_GetIconSize (
}
/*************************************************************************
* ImageList_GetIconCount [COMCTL32.59]
*/
INT32 WINAPI ImageList_GetImageCount (
HIMAGELIST himl)
{
@ -1051,6 +1102,10 @@ INT32 WINAPI ImageList_GetImageCount (
}
/*************************************************************************
* ImageList_GetImageInfo [COMCTL32.60]
*/
BOOL32 WINAPI ImageList_GetImageInfo (
HIMAGELIST himl,
INT32 i,
@ -1070,7 +1125,12 @@ BOOL32 WINAPI ImageList_GetImageInfo (
}
/* I don't know if it is really a BOOL32 or something else!!!?? */
/*************************************************************************
* ImageList_GetImageRect [COMCTL32.61]
*
* COMMENTS
* I don't know if it really returns a BOOL32 or something else!!!??
*/
BOOL32 WINAPI ImageList_GetImageRect (
HIMAGELIST himl,
@ -1090,6 +1150,10 @@ BOOL32 WINAPI ImageList_GetImageRect (
}
/*************************************************************************
* ImageList_LoadImage32A [COMCTL32.63]
*/
HIMAGELIST WINAPI ImageList_LoadImage32A (
HINSTANCE32 hi,
LPCSTR lpbmp,
@ -1152,6 +1216,10 @@ HIMAGELIST WINAPI ImageList_LoadImage32A (
}
/*************************************************************************
* ImageList_LoadImage32W [COMCTL32.64]
*/
HIMAGELIST WINAPI ImageList_LoadImage32W (
HINSTANCE32 hi,
LPCWSTR lpbmp,
@ -1217,6 +1285,10 @@ HIMAGELIST WINAPI ImageList_LoadImage32W (
}
/*************************************************************************
* ImageList_Merge [COMCTL32.65]
*/
HIMAGELIST WINAPI ImageList_Merge (
HIMAGELIST himl1,
INT32 i1,
@ -1234,7 +1306,15 @@ HIMAGELIST WINAPI ImageList_Merge (
if ((himl1 == NULL) || (himl2 == NULL)) return (NULL);
/* check indices */
if ((i1 < 0) || (i1 >= himl1->cCurImage)) {
ERR (imagelist, "Index 1 out of range! %d\n", i1);
return (NULL);
}
if ((i2 < 0) || (i2 >= himl2->cCurImage)) {
ERR (imagelist, "Index 2 out of range! %d\n", i2);
return (NULL);
}
if (xOffs > 0) {
cxDst = _MAX (himl1->cx, xOffs + himl2->cx);
@ -1435,9 +1515,6 @@ BOOL32 WINAPI ImageList_Remove (
himl->cCurImage--;
himl->cMaxImage = himl->cCurImage + himl->cGrow;
TRACE (imagelist, "Number of images: %d\n", himl->cCurImage);
TRACE (imagelist, "Max. number of images: %d\n", himl->cMaxImage);
}
return (TRUE);
@ -1507,6 +1584,7 @@ INT32 WINAPI ImageList_ReplaceIcon (
BITMAP32 bmp;
#endif
if (himl == NULL) return (-1);
if ((i >= himl->cCurImage) || (i < -1)) return (-1);
#ifdef __GET_ICON_INFO_HACK__
@ -1525,8 +1603,9 @@ INT32 WINAPI ImageList_ReplaceIcon (
if (i == -1) {
if (himl->cCurImage + 1 >= himl->cMaxImage)
IMAGELIST_InternalGrowBitmaps (himl, 1);
nIndex = himl->cCurImage;
himl->cCurImage ++;
himl->cCurImage++;
}
else
nIndex = i;
@ -1645,24 +1724,25 @@ BOOL32 WINAPI ImageList_SetImageCount (
{
HDC32 hdcImageList, hdcBitmap;
HBITMAP32 hbmNewBitmap;
INT32 nNewWidth;
INT32 nNewCount, nCopyCount;
if (himl == NULL) return (FALSE);
if (himl->cCurImage <= iImageCount) return (FALSE);
if (himl->cMaxImage > iImageCount) return (TRUE);
nNewWidth = (iImageCount + himl->cGrow) * himl->cx;
nNewCount = iImageCount + himl->cGrow;
nCopyCount = _MIN(himl->cCurImage, iImageCount);
hdcImageList = CreateCompatibleDC32 (0);
hdcBitmap = CreateCompatibleDC32 (0);
hbmNewBitmap =
CreateBitmap32 (nNewWidth, himl->cy, 1, himl->uBitsPixel, NULL);
hbmNewBitmap = CreateBitmap32 (nNewCount * himl->cx, himl->cy,
1, himl->uBitsPixel, NULL);
if (hbmNewBitmap == 0)
{
SelectObject32 (hdcImageList, himl->hbmImage);
SelectObject32 (hdcBitmap, hbmNewBitmap);
BitBlt32 (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, himl->cy,
BitBlt32 (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
hdcImageList, 0, 0, SRCCOPY);
DeleteObject32 (himl->hbmImage);
himl->hbmImage = hbmNewBitmap;
@ -1674,14 +1754,13 @@ BOOL32 WINAPI ImageList_SetImageCount (
if (himl->hbmMask)
{
hbmNewBitmap =
CreateBitmap32 (nNewWidth, himl->cy, 1, 1, NULL);
hbmNewBitmap = CreateBitmap32 (nNewCount * himl->cx, himl->cy,
1, 1, NULL);
if (hbmNewBitmap != 0)
{
SelectObject32 (hdcImageList, himl->hbmMask);
SelectObject32 (hdcBitmap, hbmNewBitmap);
BitBlt32 (hdcBitmap, 0, 0, himl->cCurImage * himl->cx, himl->cy,
BitBlt32 (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
hdcImageList, 0, 0, SRCCOPY);
DeleteObject32 (himl->hbmMask);
himl->hbmMask = hbmNewBitmap;
@ -1695,8 +1774,10 @@ BOOL32 WINAPI ImageList_SetImageCount (
DeleteDC32 (hdcImageList);
DeleteDC32 (hdcBitmap);
/* Update max image count */
himl->cMaxImage = iImageCount + himl->cx;
/* Update max image count and current image count */
himl->cMaxImage = nNewCount;
if (himl->cCurImage > nCopyCount)
himl->cCurImage = nCopyCount;
return (TRUE);
}

View File

@ -5,12 +5,13 @@
* Copyright 1996 Marcus Meissner
*/
#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "config.h"
#ifdef HAVE_WCTYPE_H
# include <wctype.h>
@ -187,7 +188,7 @@ void WINAPI OutputDebugString32W( LPCWSTR str )
/***********************************************************************
* CharNext32A (USER32.28)
* CharNext32A (USER32.29)
*/
LPSTR WINAPI CharNext32A( LPCSTR ptr )
{
@ -198,7 +199,7 @@ LPSTR WINAPI CharNext32A( LPCSTR ptr )
/***********************************************************************
* CharNextEx32A (USER32.29)
* CharNextEx32A (USER32.30)
*/
LPSTR WINAPI CharNextEx32A( WORD codepage, LPCSTR ptr, DWORD flags )
{
@ -209,7 +210,7 @@ LPSTR WINAPI CharNextEx32A( WORD codepage, LPCSTR ptr, DWORD flags )
/***********************************************************************
* CharNextExW (USER32.30)
* CharNextExW (USER32.31)
*/
LPWSTR WINAPI CharNextEx32W(WORD codepage,LPCWSTR x,DWORD flags)
{
@ -219,7 +220,7 @@ LPWSTR WINAPI CharNextEx32W(WORD codepage,LPCWSTR x,DWORD flags)
}
/***********************************************************************
* CharNextW (USER32.31)
* CharNextW (USER32.32)
*/
LPWSTR WINAPI CharNext32W(LPCWSTR x)
{
@ -228,7 +229,7 @@ LPWSTR WINAPI CharNext32W(LPCWSTR x)
}
/***********************************************************************
* CharPrev32A (USER32.32)
* CharPrev32A (USER32.33)
*/
LPSTR WINAPI CharPrev32A( LPCSTR start, LPCSTR ptr )
{
@ -243,7 +244,7 @@ LPSTR WINAPI CharPrev32A( LPCSTR start, LPCSTR ptr )
/***********************************************************************
* CharPrevEx32A (USER32.33)
* CharPrevEx32A (USER32.34)
*/
LPSTR WINAPI CharPrevEx32A( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags )
{
@ -258,7 +259,7 @@ LPSTR WINAPI CharPrevEx32A( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags
/***********************************************************************
* CharPrevExW (USER32.34)
* CharPrevExW (USER32.35)
*/
LPWSTR WINAPI CharPrevEx32W(WORD codepage,LPCWSTR start,LPCWSTR x,DWORD flags)
{
@ -268,7 +269,7 @@ LPWSTR WINAPI CharPrevEx32W(WORD codepage,LPCWSTR start,LPCWSTR x,DWORD flags)
}
/***********************************************************************
* CharPrevW (USER32.35)
* CharPrevW (USER32.36)
*/
LPWSTR WINAPI CharPrev32W(LPCWSTR start,LPCWSTR x)
{
@ -277,7 +278,7 @@ LPWSTR WINAPI CharPrev32W(LPCWSTR start,LPCWSTR x)
}
/***********************************************************************
* CharLowerA (USER32.24)
* CharLowerA (USER32.25)
* FIXME: handle current locale
*/
LPSTR WINAPI CharLower32A(LPSTR x)
@ -298,7 +299,7 @@ LPSTR WINAPI CharLower32A(LPSTR x)
}
/***********************************************************************
* CharLowerBuffA (USER32.25)
* CharLowerBuffA (USER32.26)
* FIXME: handle current locale
*/
DWORD WINAPI CharLowerBuff32A(LPSTR x,DWORD buflen)
@ -316,7 +317,7 @@ DWORD WINAPI CharLowerBuff32A(LPSTR x,DWORD buflen)
}
/***********************************************************************
* CharLowerBuffW (USER32.26)
* CharLowerBuffW (USER32.27)
* FIXME: handle current locale
*/
DWORD WINAPI CharLowerBuff32W(LPWSTR x,DWORD buflen)
@ -334,7 +335,7 @@ DWORD WINAPI CharLowerBuff32W(LPWSTR x,DWORD buflen)
}
/***********************************************************************
* CharLowerW (USER32.27)
* CharLowerW (USER32.28)
* FIXME: handle current locale
*/
LPWSTR WINAPI CharLower32W(LPWSTR x)
@ -353,7 +354,7 @@ LPWSTR WINAPI CharLower32W(LPWSTR x)
}
/***********************************************************************
* CharUpper32A (USER32.40)
* CharUpper32A (USER32.41)
* FIXME: handle current locale
*/
LPSTR WINAPI CharUpper32A(LPSTR x)
@ -372,7 +373,7 @@ LPSTR WINAPI CharUpper32A(LPSTR x)
}
/***********************************************************************
* CharUpperBuffA (USER32.41)
* CharUpperBuffA (USER32.42)
* FIXME: handle current locale
*/
DWORD WINAPI CharUpperBuff32A(LPSTR x,DWORD buflen)
@ -390,7 +391,7 @@ DWORD WINAPI CharUpperBuff32A(LPSTR x,DWORD buflen)
}
/***********************************************************************
* CharUpperBuffW (USER32.42)
* CharUpperBuffW (USER32.43)
* FIXME: handle current locale
*/
DWORD WINAPI CharUpperBuff32W(LPWSTR x,DWORD buflen)
@ -408,7 +409,7 @@ DWORD WINAPI CharUpperBuff32W(LPWSTR x,DWORD buflen)
}
/***********************************************************************
* CharUpperW (USER32.43)
* CharUpperW (USER32.44)
* FIXME: handle current locale
*/
LPWSTR WINAPI CharUpper32W(LPWSTR x)
@ -427,7 +428,7 @@ LPWSTR WINAPI CharUpper32W(LPWSTR x)
}
/***********************************************************************
* IsCharAlphaA (USER32.330)
* IsCharAlphaA (USER32.331)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharAlpha32A(CHAR x)
@ -436,7 +437,7 @@ BOOL32 WINAPI IsCharAlpha32A(CHAR x)
}
/***********************************************************************
* IsCharAlphaNumericA (USER32.331)
* IsCharAlphaNumericA (USER32.332)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharAlphaNumeric32A(CHAR x)
@ -445,7 +446,7 @@ BOOL32 WINAPI IsCharAlphaNumeric32A(CHAR x)
}
/***********************************************************************
* IsCharAlphaNumericW (USER32.332)
* IsCharAlphaNumericW (USER32.333)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharAlphaNumeric32W(WCHAR x)
@ -454,7 +455,7 @@ BOOL32 WINAPI IsCharAlphaNumeric32W(WCHAR x)
}
/***********************************************************************
* IsCharAlphaW (USER32.333)
* IsCharAlphaW (USER32.334)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharAlpha32W(WCHAR x)
@ -463,7 +464,7 @@ BOOL32 WINAPI IsCharAlpha32W(WCHAR x)
}
/***********************************************************************
* IsCharLower32A (USER32.334)
* IsCharLower32A (USER32.335)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharLower32A(CHAR x)
@ -472,7 +473,7 @@ BOOL32 WINAPI IsCharLower32A(CHAR x)
}
/***********************************************************************
* IsCharLower32W (USER32.335)
* IsCharLower32W (USER32.336)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharLower32W(WCHAR x)
@ -481,7 +482,7 @@ BOOL32 WINAPI IsCharLower32W(WCHAR x)
}
/***********************************************************************
* IsCharUpper32A (USER32.336)
* IsCharUpper32A (USER32.337)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharUpper32A(CHAR x)
@ -490,7 +491,7 @@ BOOL32 WINAPI IsCharUpper32A(CHAR x)
}
/***********************************************************************
* IsCharUpper32W (USER32.337)
* IsCharUpper32W (USER32.338)
* FIXME: handle current locale
*/
BOOL32 WINAPI IsCharUpper32W(WCHAR x)
@ -610,7 +611,7 @@ DWORD WINAPI FormatMessage32A(
sprintfbuf=HeapAlloc(GetProcessHeap(),0,100);
/* CMF - This makes a BIG assumption about va_list */
vsprintf(sprintfbuf, fmtstr, (va_list) argliststart);
wvsprintf32A(sprintfbuf, fmtstr, (va_list) argliststart);
x=sprintfbuf;
while (*x) {
ADD_TO_T(*x++);
@ -620,7 +621,7 @@ DWORD WINAPI FormatMessage32A(
/* NULL args - copy formatstr
* (probably wrong)
*/
while (lastf<f) {
while ((lastf<f)&&(*lastf)) {
ADD_TO_T(*lastf++);
}
}
@ -787,7 +788,7 @@ DWORD WINAPI FormatMessage32W(
sprintfbuf=HeapAlloc(GetProcessHeap(),0,100);
/* CMF - This makes a BIG assumption about va_list */
vsprintf(sprintfbuf, fmtstr, (va_list) argliststart);
wvsprintf32A(sprintfbuf, fmtstr, (va_list) argliststart);
}
x=sprintfbuf;
while (*x) {

View File

@ -626,7 +626,7 @@ void WINAPI MessageBeep16( UINT16 i )
/***********************************************************************
* MessageBeep32 (USER32.389)
* MessageBeep32 (USER32.390)
*/
BOOL32 WINAPI MessageBeep32( UINT32 i )
{
@ -655,7 +655,7 @@ LONG WINAPI GetTimerResolution(void)
}
/***********************************************************************
* SystemParametersInfo32A (USER32.539)
* SystemParametersInfo32A (USER32.540)
*/
BOOL32 WINAPI SystemParametersInfo32A( UINT32 uAction, UINT32 uParam,
LPVOID lpvParam, UINT32 fuWinIni )
@ -999,7 +999,7 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
}
/***********************************************************************
* SystemParametersInfo32W (USER32.540)
* SystemParametersInfo32W (USER32.541)
*/
BOOL32 WINAPI SystemParametersInfo32W( UINT32 uAction, UINT32 uParam,
LPVOID lpvParam, UINT32 fuWinIni )

View File

@ -6,23 +6,66 @@
#include <stdio.h>
#include "win.h"
#include "debug.h"
#include "wnet.h"
/**************************************************************************
* WNetCachePassword [MPR.52] Saves password in cache
*
* RETURNS
* Success: WN_SUCCESS
* Failure: WNACCESS_DENIED, WN_BAD_PASSWORD, WN_BADVALUE, WN_NET_ERROR,
* WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
*/
DWORD WINAPI WNetCachePassword(
LPSTR pbResource, /* [in] Name of workgroup, computer, or resource */
WORD cbResource, /* [in] Size of name */
LPSTR pbPassword, /* [in] Buffer containing password */
WORD cbPassword, /* [in] Size of password */
BYTE nType) /* [in] Type of password to cache */
{
FIXME(mpr,"(%s,%d,%s,%d,%d): stub\n", pbResource,cbResource,
pbPassword,cbPassword,nType);
return WN_SUCCESS;
}
/**************************************************************************
* WNetGetCachedPassword [MPR.???] Retrieves password from cache
*
* RETURNS
* Success: WN_SUCCESS
* Failure: WNACCESS_DENIED, WN_BAD_PASSWORD, WN_BAD_VALUE, WN_NET_ERROR,
* WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
*/
DWORD WINAPI WNetGetCachedPassword(
LPSTR pbResource,
WORD cbResource,
LPSTR pbPassword,
LPWORD pcbPassword,
BYTE nType
) {
FIXME(mpr,"(%s,%d,%p,%d,%d): stub\n",
pbResource,cbResource,pbPassword,*pcbPassword,nType);
return 0;
LPSTR pbResource, /* [in] Name of workgroup, computer, or resource */
WORD cbResource, /* [in] Size of name */
LPSTR pbPassword, /* [out] Buffer to receive password */
LPWORD pcbPassword, /* [out] Receives size of password */
BYTE nType) /* [in] Type of password to retrieve */
{
FIXME(mpr,"(%s,%d,%p,%d,%d): stub\n",
pbResource,cbResource,pbPassword,*pcbPassword,nType);
return WN_ACCESS_DENIED;
}
/**************************************************************************
* MultinetGetConnectionPerformance32A [MPR.???]
*
* RETURNS
* Success: NO_ERROR
* Failure: ERROR_NOT_SUPPORTED, ERROR_NOT_CONNECTED,
* ERROR_NO_NET_OR_BAD_PATH, ERROR_BAD_DEVICE,
* ERROR_BAD_NET_NAME, ERROR_INVALID_PARAMETER,
* ERROR_NO_NETWORK, ERROR_EXTENDED_ERROR
*/
DWORD WINAPI MultinetGetConnectionPerformance32A(
LPNETRESOURCE32A lpNetResource,
LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
) {
FIXME(mpr,"(%p,%p): stub\n",lpNetResource,lpNetConnectInfoStruct);
return 1;
LPNETRESOURCE32A lpNetResource, /* [in] Specifies resource */
LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct) /* [in] Pointer to struct */
{
FIXME(mpr,"(%p,%p): stub\n",lpNetResource,lpNetConnectInfoStruct);
return WN_NOT_SUPPORTED;
}

View File

@ -199,9 +199,6 @@ lookup_hkey(HKEY hkey) {
case HKEY_CURRENT_CONFIG:
return key_current_config;
default:
WARN(reg, "(%lx), special key!\n",
(LONG)hkey
);
return get_handle(hkey);
}
/*NOTREACHED*/

View File

@ -620,7 +620,7 @@ LRESULT WINAPI AboutDlgProc32( HWND32 hWnd, UINT32 msg, WPARAM32 wParam,
if( pstr )
{
HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE(OCR_DRAGOBJECT) );
HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE16(OCR_DRAGOBJECT) );
SendMessage32A( hWndCtl, LB_GETTEXT32, (WPARAM32)idx, (LPARAM)pstr );
SendMessage32A( hWndCtl, LB_DELETESTRING32, (WPARAM32)idx, 0 );
UpdateWindow32( hWndCtl );
@ -729,7 +729,7 @@ BOOL32 WINAPI ShellAbout32A( HWND32 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
info.szApp = szApp;
info.szOtherStuff = szOtherStuff;
info.hIcon = hIcon;
if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE(OIC_WINEICON) );
if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
return DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
SYSRES_GetResPtr( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX ),
hWnd, AboutDlgProc32, (LPARAM)&info );
@ -748,7 +748,7 @@ BOOL32 WINAPI ShellAbout32W( HWND32 hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
info.szApp = HEAP_strdupWtoA( GetProcessHeap(), 0, szApp );
info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff );
info.hIcon = hIcon;
if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE(OIC_WINEICON) );
if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
ret = DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
SYSRES_GetResPtr( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX ),
hWnd, AboutDlgProc32, (LPARAM)&info );
@ -1074,7 +1074,8 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
_lclose32( hFile);
return 0;
}
icongroupresdir = GetResDirEntryW(rootresdir,(LPWSTR)RT_GROUP_ICON,(DWORD)rootresdir,FALSE);
icongroupresdir = GetResDirEntryW(rootresdir,RT_GROUP_ICON32W,
(DWORD)rootresdir,FALSE);
if (!icongroupresdir) {
WARN(reg,"No Icongroupresourcedirectory!\n");
UnmapViewOfFile(peimage);
@ -1143,7 +1144,8 @@ HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16 hInstance,
cids[i] = cid;
RetPtr[i] = LookupIconIdFromDirectoryEx32(igdata,TRUE,SYSMETRICS_CXICON,SYSMETRICS_CYICON,0);
}
iconresdir=GetResDirEntryW(rootresdir,(LPWSTR)RT_ICON,(DWORD)rootresdir,FALSE);
iconresdir=GetResDirEntryW(rootresdir,RT_ICON32W,
(DWORD)rootresdir,FALSE);
if (!iconresdir) {
WARN(reg,"No Iconresourcedirectory!\n");
UnmapViewOfFile(peimage);
@ -1270,7 +1272,7 @@ HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst,LPSTR lpIconPath,
*lpiIcon = 6; /* generic icon - found nothing */
GetModuleFileName16(hInst, lpIconPath, 0x80);
hIcon = LoadIcon16( hInst, MAKEINTRESOURCE(*lpiIcon));
hIcon = LoadIcon16( hInst, MAKEINTRESOURCE16(*lpiIcon));
}
return hIcon;

View File

@ -133,6 +133,7 @@ static VERSION VERSION_GetVersion(void)
/* Win3.10 */
if (peheader->OptionalHeader.MinorSubsystemVersion <= 11) return WIN31;
/* NT 3.51 */
if (peheader->OptionalHeader.MinorSubsystemVersion == 50) return NT351;
if (peheader->OptionalHeader.MinorSubsystemVersion == 51) return NT351;
}
ERR(ver,"unknown subsystem version: %04x.%04x, please report.\n",

View File

@ -10,21 +10,30 @@
*
*/
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#if defined(__svr4__)
#include <sys/filio.h>
#include <sys/ioccom.h>
#include <sys/sockio.h>
#endif
#if defined(__EMX__)
#include <sys/so_ioctl.h>
#include <sys/param.h>
# include <sys/so_ioctl.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include <sys/msg.h>
#include <sys/wait.h>
#include <sys/socket.h>
@ -1227,7 +1236,16 @@ INT32 WINAPI WINSOCK_setsockopt32(SOCKET16 s, INT32 level, INT32 optname,
(unsigned)pwsi, s, level, optname, (int) optval, optlen);
if( _check_ws(pwsi, pws) )
{
struct linger linger;
convert_sockopt(&level, &optname);
if (optname == SO_LINGER) {
/* yes, uses unsigned short in both win16/win32 */
linger.l_onoff = ((UINT16*)optval)[0];
linger.l_linger = ((UINT16*)optval)[1];
optval = (char*)&linger;
optlen = sizeof(struct linger);
}
if (setsockopt(pws->fd, level, optname, optval, optlen) == 0) return 0;
pwsi->err = wsaErrno();
}
@ -1241,16 +1259,7 @@ INT32 WINAPI WINSOCK_setsockopt32(SOCKET16 s, INT32 level, INT32 optname,
INT16 WINAPI WINSOCK_setsockopt16(SOCKET16 s, INT16 level, INT16 optname,
char *optval, INT16 optlen)
{
INT32 linger32[2];
if( !optval ) return SOCKET_ERROR;
if( optname == SO_LINGER )
{
INT16* ptr = (INT16*)optval;
linger32[0] = ptr[0];
linger32[1] = ptr[1];
optval = (char*)&linger32;
optlen = sizeof(linger32);
}
return (INT16)WINSOCK_setsockopt32( s, (UINT16)level, optname, optval, optlen );
}
@ -2668,5 +2677,3 @@ UINT16 wsaHerrno(void)
return WSAEOPNOTSUPP;
}
}

View File

@ -9,6 +9,8 @@
* Netscape 4.0).
*/
#include "config.h"
#include <unistd.h>
#include <string.h>
#include <signal.h>
@ -19,12 +21,16 @@
#include <sys/wait.h>
#include <errno.h>
#ifdef __EMX__
#include <sys/so_ioctl.h>
#include <sys/param.h>
# include <sys/so_ioctl.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#ifdef __svr4__
#include <sys/file.h>
#include <sys/filio.h>
# include <sys/file.h>
#endif
extern int h_errno;
@ -364,6 +370,9 @@ HANDLE16 __WSAsyncDBQuery(LPWSINFO pwsi, HWND32 hWnd, UINT32 uMsg, INT32 type, L
}
else
{
extern BOOL32 THREAD_InitDone;
THREAD_InitDone = FALSE;
/* child process */
close(async_ctl.ws_aop->fd[0]); /* read endpoint */

View File

@ -483,7 +483,7 @@ INT16 WINAPI wvsprintf16( LPSTR buffer, LPCSTR spec, LPCVOID args )
/***********************************************************************
* wvsprintf32A (USER32.586)
* wvsprintf32A (USER32.587)
*/
INT32 WINAPI wvsprintf32A( LPSTR buffer, LPCSTR spec, va_list args )
{
@ -493,7 +493,7 @@ INT32 WINAPI wvsprintf32A( LPSTR buffer, LPCSTR spec, va_list args )
/***********************************************************************
* wvsprintf32W (USER32.587)
* wvsprintf32W (USER32.588)
*/
INT32 WINAPI wvsprintf32W( LPWSTR buffer, LPCWSTR spec, va_list args )
{

View File

@ -824,6 +824,38 @@ static void fLock( CONTEXT * context )
}
}
static BOOL32
INT21_networkfunc (CONTEXT *context)
{
switch (AL_reg(context)) {
case 0x00: /* Get machine name. */
{
char *dst = PTR_SEG_OFF_TO_LIN (DS_reg(context),DX_reg(context));
TRACE(int21, "getting machine name to %p\n", dst);
if (gethostname (dst, 15))
{
WARN(int21,"failed!\n");
DOS_ERROR( ER_NoNetwork, EC_NotFound, SA_Abort, EL_Network );
return TRUE;
} else {
int len = strlen (dst);
while (len < 15)
dst[len++] = ' ';
dst[15] = 0;
CH_reg(context) = 1; /* Valid */
CL_reg(context) = 1; /* NETbios number??? */
TRACE(int21, "returning %s\n", debugstr_an (dst, 16));
return FALSE;
}
}
default:
DOS_ERROR( ER_NoNetwork, EC_NotFound, SA_Abort, EL_Network );
return TRUE;
}
}
SEGPTR INT21_GetListOfLists()
{
static DOS_LISTOFLISTS *LOL;
@ -891,13 +923,15 @@ void WINAPI DOS3Call( CONTEXT *context )
{
BOOL32 bSetDOSExtendedError = FALSE;
/* TRACE(int21, "AX=%04x BX=%04x CX=%04x DX=%04x "
"SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
(WORD)DS_reg(context), (WORD)ES_reg(context),
EFL_reg(context) );
*/
#if 0
TRACE(int21, "AX=%04x BX=%04x CX=%04x DX=%04x "
"SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n",
AX_reg(context), BX_reg(context), CX_reg(context), DX_reg(context),
SI_reg(context), DI_reg(context),
(WORD)DS_reg(context), (WORD)ES_reg(context),
EFL_reg(context) );
#endif
if (AH_reg(context) == 0x59) /* Get extended error info */
{
TRACE(int21, "GET EXTENDED ERROR code 0x%02x class 0x%02x action 0x%02x locus %02x\n",
@ -1526,13 +1560,16 @@ void WINAPI DOS3Call( CONTEXT *context )
break;
case 0x5d: /* NETWORK */
case 0x5e:
TRACE(int21,"Network function AX=%04x\n",AX_reg(context));
/* network software not installed */
FIXME(int21,"Function 0x%04x not implemented.\n", AX_reg (context));
/* Fix the following while you're at it. */
DOS_ERROR( ER_NoNetwork, EC_NotFound, SA_Abort, EL_Network );
bSetDOSExtendedError = TRUE;
break;
case 0x5e:
bSetDOSExtendedError = INT21_networkfunc (context);
break;
case 0x5f: /* NETWORK */
switch (AL_reg(context))
{

View File

@ -28,11 +28,13 @@
#include "debug.h"
#ifdef HAVE_OSS
#ifdef HAVE_MACHINE_SOUNDCARD_H
#include <machine/soundcard.h>
#else /* HAVE_MACHINE_SOUNDCARD_H */
#include <sys/soundcard.h>
#endif /* HAVE_MACHINE_SOUNDCARD_H */
# include <machine/soundcard.h>
#endif
#ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
#endif
#define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer"

View File

@ -28,6 +28,7 @@
* Sound works for the intromovie.
*/
#include "config.h"
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
@ -45,12 +46,13 @@
#include "debug.h"
#ifdef HAVE_OSS
#include <sys/ioctl.h>
#ifdef HAVE_MACHINE_SOUNDCARD_H
#include <machine/soundcard.h>
#else /* HAVE_MACHINE_SOUNDCARD_H */
#include <sys/soundcard.h>
#endif /* HAVE_MACHINE_SOUNDCARD_H */
# include <sys/ioctl.h>
# ifdef HAVE_MACHINE_SOUNDCARD_H
# include <machine/soundcard.h>
# endif
# ifdef HAVE_SYS_SOUNDCARD_H
# include <sys/soundcard.h>
# endif
static int audiofd = -1;
static LPDIRECTSOUND dsound = NULL;
@ -845,7 +847,7 @@ DSOUND_thread(LPVOID arg) {
#endif /* HAVE_OSS */
HRESULT WINAPI DirectSoundCreate(LPGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pUnkOuter ) {
int xx;
int xx;
if (lpGUID)
fprintf(stderr,"DirectSoundCreate(%p,%p,%p)\n",lpGUID,ppDS,pUnkOuter);
#ifdef HAVE_OSS

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