Commit c7c217b3 authored by Alexandre Julliard's avatar Alexandre Julliard

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.
parent 54c2711f
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.
......
----------------------------------------------------------------------
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>
* [msdos/int21.c]
......
......@@ -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
......
......@@ -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@
......
......@@ -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)
......
......@@ -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>],[
/* 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_TRY_COMPILE([
#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
#endif
#ifdef HAVE_MACHINE_SOUNDCARD_H
#include <machine/soundcard.h>
#endif
],[
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 ****
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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,30 +50,91 @@ 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)
EndPaint32(wndPtr->hwndSelf, &ps);
......@@ -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;
}
......@@ -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 )
{
......
......@@ -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 )
......
......@@ -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",
......
......@@ -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];
......
......@@ -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
......
......@@ -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
......
......@@ -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
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/errno.h>
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#if defined(__svr4__) || defined(_SCO_DS) || defined(__EMX__)
#include <sys/statfs.h>
#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';
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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.
*/
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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++;
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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
/* 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 "};
/* 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 "};
/* 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 "};
/* 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 "};
......@@ -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 */
......
......@@ -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);
......
......@@ -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
......
......@@ -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
......
......@@ -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 {
......
......@@ -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 */
......@@ -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 */
......@@ -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 );
......
......@@ -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 */
......@@ -11,8 +11,8 @@ struct _IMAGELIST
{
HBITMAP32 hbmImage;
HBITMAP32 hbmMask;
HBRUSH32 hbrushBlend25;
HBRUSH32 hbrushBlend50;
HBRUSH32 hbrBlend25;
HBRUSH32 hbrBlend50;
COLORREF clrBk;
INT32 cInitial;
INT32 cGrow;
......
......@@ -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 );
......
......@@ -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,
......
......@@ -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 */
......@@ -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 */
......
......@@ -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 */
......@@ -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);
......
......@@ -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__
......
......@@ -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);
......
......@@ -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 );
......
......@@ -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 */
......
#define WINE_RELEASE_INFO "Wine release 980329"
#define WINE_RELEASE_INFO "Wine release 980413"
......@@ -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 */
......
......@@ -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;
......
......@@ -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;
......
......@@ -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__
......
......@@ -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;
......
......@@ -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 ))
......
......@@ -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 )))
{
......
......@@ -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);
......
......@@ -7,6 +7,7 @@ MODULE = memory
C_SRCS = \
atom.c \
environ.c \
global.c \
heap.c \
ldt.c \
......
......@@ -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)
......
......@@ -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))
{
......
......@@ -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;
......
......@@ -138,6 +138,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
*
* Free a block of selectors.
......@@ -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);
}
/***********************************************************************
* UnMapSLFixArray (KERNEL32.701)
*/
void WINAPI UnMapSLFixArray( SEGPTR sptr[], INT32 length )
{
}
/***********************************************************************
* MapLS (KERNEL32.679)
* 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 );
}
/***********************************************************************
......@@ -626,6 +668,71 @@ void WINAPI SUnMapLS_IP_EBP_36(CONTEXT *context) { x_SUnMapLS_IP_EBP_x(context,3
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)
*/
......
......@@ -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 )
{
......
......@@ -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 );
page_mask = sysinfo.dwPageSize - 1;
granularity_mask = sysinfo.dwAllocationGranularity - 1;
#ifndef __i386__
DWORD page_size;
# 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
{
......@@ -468,6 +484,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;
......
......@@ -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>
......
......@@ -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;
......
......@@ -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;
}
......@@ -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;
}
......
......@@ -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 )
{
char resname[10];
if (HIWORD(res)) return debugstr_a(res);
sprintf(resname, "#%04x", LOWORD(res));
return debugstr_a (resname);
}
LPSTR debugres_w( LPCWSTR res )
{
if (HIWORD((DWORD)res))
return debugstr_a((LPCSTR)res);
else{
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);
}
/* ---------------------------------------------------------------------- */
......@@ -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) {
......
......@@ -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 )
......
......@@ -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;
}
......@@ -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*/
......
......@@ -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;
......
......@@ -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",
......
......@@ -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;
}
}
......@@ -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 */
......
......@@ -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 )
{
......
......@@ -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))
{
......
......@@ -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"
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment