Commit 0623a6f3 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 980118

Sun Jan 18 17:05:58 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [include/stackframe.h] [tools/build.c] Some cleanups in stack frame building. * [misc/port.c] Implemented clone() wrapper for libc5 users. * [scheduler/mutex.c] [scheduler/synchro.c] Implemented abandoned mutexes. * [scheduler/process.c] [scheduler/thread.c] We now create a process and a thread structure as soon as possible during initialization. * [scheduler/thread.c] [scheduler/sysdeps.c] Moved system-specific thread handling to sysdeps.c. Fri Jan 16 10:45:15 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [graphics/ddraw.c][include/ddraw.h] Surface handling enhanced. Some stuff already works ;) * [multimedia/dsound.c][include/dsound.h] Implemented using the Open Sound System. Slowly starts to work (sounds terrible for some programs). * [configure.in][multimedia/audio.c][include/config.h.in] Added check for OpenSoundSystem, fixed -lXxf86dga check. Replaced OS #ifdefs by #ifdef HAVE_OSS in mm/audio.c. * [if1632/relay.c][relay32/relay386.c] Do not print control characters for 'str' or 'wstr' args. * [misc/registry.c] "" seems to equals NULL in keynames. Replace where needed. Seems to help the win95 regedit.exe... * [win32/newfns.c] Implemented QueryPerformance* using gettimeofday(2) (should be done using the pentium timers probably). * [tools/ipcl] Removed useless open_pipe construct. Sun Jan 11 17:10:02 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk> * [objects/region.c] [include/region.h] [graphics/x11drv/clipping.c] Regions are now internal to Wine. The basis of this code is taken from the X11 distribution. GetRegionData() is implemented as is ExtCreateRegion() (without Xforms). CreatePolyPolygonRgn() should behave correctly now. * [objects/metafile.c] [graphics/metafiledrv/graphics.c] [graphics/metafiledrv/init.c] [include/metafile.h] [include/metafiledrv.h] Playback of META_CREATEREGION should now work. Implemented recording of META_CREATEREGION and META_PAINTREGION. * [graphics/x11drv/graphics.c] FillRgn() (and therefore its friends) respect logical co-ords. Wed Jan 7 01:21:45 1998 Steinar Hamre <steinarh@stud.fim.ntnu.no> * [configure.in] [include/acconfig.h] [tools/build.c] Now checking whether to use .string or .ascii. * [configure.in] [include/acconfig.h] [scheduler/critsection.c] Defining union semun if this is not available from header files. * [misc/lstr.c] Moved wine's own header files below <wctype.h> to avoid parse error on Solaris. Sun Jan 4 15:38:07 1998 Andrew Taylor <ataylor@cadvision.com> * [multimedia/mmsystem.c] [multimedia/mmio.c] Implemented mmioSendMessage and rearranged the mmio subsystem in terms of this function. Wed Dec 24 00:51:29 1997 Charles Duffy <cduffy@bigfoot.com> * [windows/clipboard.c] [relay32/user32.spec] GetPriorityClipboardFormat32 now has something other than just a stub. I have no idea if it works (can't test until SetClipboardData is finished) but HEdit likes things a lot more this way.
parent 02e90087
This is release 980104 of Wine, the MS Windows emulator. This is still a
This is release 980118 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-980104: (see ChangeLog for details)
- Beginnings of DirectDraw/DirectSound support.
- Preliminary threading support based on clone().
WHAT'S NEW with Wine-980118: (see ChangeLog for details)
- New region implementation based on X11 code.
- Improvements to DirectDraw and DirectSound.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -16,10 +16,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-980104.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980104.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980104.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980104.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-980118.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-980118.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-980118.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-980118.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sun Jan 18 17:05:58 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/stackframe.h] [tools/build.c]
Some cleanups in stack frame building.
* [misc/port.c]
Implemented clone() wrapper for libc5 users.
* [scheduler/mutex.c] [scheduler/synchro.c]
Implemented abandoned mutexes.
* [scheduler/process.c] [scheduler/thread.c]
We now create a process and a thread structure as soon as possible
during initialization.
* [scheduler/thread.c] [scheduler/sysdeps.c]
Moved system-specific thread handling to sysdeps.c.
Fri Jan 16 10:45:15 1998 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [graphics/ddraw.c][include/ddraw.h]
Surface handling enhanced. Some stuff already works ;)
* [multimedia/dsound.c][include/dsound.h]
Implemented using the Open Sound System.
Slowly starts to work (sounds terrible for some programs).
* [configure.in][multimedia/audio.c][include/config.h.in]
Added check for OpenSoundSystem, fixed -lXxf86dga check.
Replaced OS #ifdefs by #ifdef HAVE_OSS in mm/audio.c.
* [if1632/relay.c][relay32/relay386.c]
Do not print control characters for 'str' or 'wstr' args.
* [misc/registry.c]
"" seems to equals NULL in keynames. Replace where needed. Seems
to help the win95 regedit.exe...
* [win32/newfns.c]
Implemented QueryPerformance* using gettimeofday(2)
(should be done using the pentium timers probably).
* [tools/ipcl]
Removed useless open_pipe construct.
Sun Jan 11 17:10:02 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [objects/region.c] [include/region.h] [graphics/x11drv/clipping.c]
Regions are now internal to Wine. The basis of this code is taken
from the X11 distribution. GetRegionData() is implemented as is
ExtCreateRegion() (without Xforms). CreatePolyPolygonRgn() should
behave correctly now.
* [objects/metafile.c] [graphics/metafiledrv/graphics.c]
[graphics/metafiledrv/init.c] [include/metafile.h]
[include/metafiledrv.h]
Playback of META_CREATEREGION should now work. Implemented recording
of META_CREATEREGION and META_PAINTREGION.
* [graphics/x11drv/graphics.c]
FillRgn() (and therefore its friends) respect logical co-ords.
Wed Jan 7 01:21:45 1998 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in] [include/acconfig.h] [tools/build.c]
Now checking whether to use .string or .ascii.
* [configure.in] [include/acconfig.h] [scheduler/critsection.c]
Defining union semun if this is not available from header files.
* [misc/lstr.c]
Moved wine's own header files below <wctype.h> to avoid
parse error on Solaris.
Sun Jan 4 15:38:07 1998 Andrew Taylor <ataylor@cadvision.com>
* [multimedia/mmsystem.c] [multimedia/mmio.c]
Implemented mmioSendMessage and rearranged the mmio
subsystem in terms of this function.
Wed Dec 24 00:51:29 1997 Charles Duffy <cduffy@bigfoot.com>
* [windows/clipboard.c] [relay32/user32.spec]
GetPriorityClipboardFormat32 now has something other than just
a stub. I have no idea if it works (can't test until
SetClipboardData is finished) but HEdit likes things a lot more
this way.
----------------------------------------------------------------------
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
......@@ -149,6 +238,13 @@ Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
----------------------------------------------------------------------
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
......@@ -1232,7 +1328,7 @@ Thu Aug 28 19:30:08 1997 Morten Welinder <terra@diku.dk>
Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
GetSysColor16, GetSysColor32. Add support for above colors.
Sun Aug 24 16:22:57 1997 Andrew Taylor <andrew@riscan.com>
Sun Aug 24 16:22:57 1997 Andrew Taylor <ataylor@cadvision.com>
* [multimedia/mmsystem.c]
Changed mmioDescend to use mmio functions for file I/O, neccessary
......@@ -1731,7 +1827,7 @@ Wed Jun 11 09:14:20 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [windows/mdi.c] [windows/win.c]
Replaced WCL lists with WIN_BuildWinArray().
Mon Jun 9 23:51:16 1997 Andrew Taylor <andrew@riscan.com>
Mon Jun 9 23:51:16 1997 Andrew Taylor <ataylor@cadvision.com>
* [misc/error.c] [include/windows.h] [if1632/kernel.spec]
Implemented LogParamError, LogError functions.
......@@ -1973,7 +2069,7 @@ Mon Apr 21 13:10:24 1997 Marcus Meissner <msmeissn@immd4.informatik.uni-erlange
Another ximage!=bitmap memory layout bug.
All _XinitImageFuncPtrs except one removed.
Sun Apr 20 17:12:30 1997 Andrew Taylor <andrew@riscan.com>
Sun Apr 20 17:12:30 1997 Andrew Taylor <ataylor@cadvision.com>
* [multimedia/audio.c]
Fixed some regression bugs.
......@@ -2309,7 +2405,7 @@ Fri Feb 21 20:37:50 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [controls/edit.c]
Fix incorrect arg order in LOCAL_Alloc() call.
Fri Feb 21 18:19:17 1997 Andrew Taylor <andrew@riscan.com>
Fri Feb 21 18:19:17 1997 Andrew Taylor <ataylor@cadvision.com>
* [multimedia/mmsystem.c] [multimedia/mcistring.c]
Fixed bug related to device IDs returned by multimedia
......@@ -2351,7 +2447,7 @@ Fri Feb 14 00:24:39 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [msdos/dosmem.c] [memory/global.c]
Some changes in DOS memory allocation.
Fri Feb 7 21:46:03 1997 Andrew Taylor <andrew@riscan.com>
Fri Feb 7 21:46:03 1997 Andrew Taylor <ataylor@cadvision.com>
* [win32/security.c]
Added SID manipulation functions.
......@@ -3020,7 +3116,7 @@ Sat Dec 7 12:07:07 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [windows/win.c]
SetWindowWord(): call SetParent on GWW_HWNDPARENT.
Wed Dec 4 22:03:05 1996 Andrew Taylor <andrew@riscan.com>
Wed Dec 4 22:03:05 1996 Andrew Taylor <ataylor@cadvision.com>
* [files/dos_fs.c]
Check if buf is NULL before copying string in GetFullPathName32A().
......@@ -6870,7 +6966,7 @@ Sat Dec 16 19:39:14 MET 1995 Steffen Moeller <smoe0024@rz.uni-hildesheim.de>
* [controls/edit.c]
Almost rewrote EDIT_GetLineMsg.
Sat Dec 16 13:51:48 MST 1995 Andrew Taylor <andrew@riscan.com>
Sat Dec 16 13:51:48 MST 1995 Andrew Taylor <ataylor@cadvision.com>
* [windows/mdi.c]
Fixed MDITile() bug that occurs when 0 windows are present or all
......@@ -7883,7 +7979,7 @@ Sat Aug 19 01:31:23 1995 Graham Menhennitt <gfm@werple.mira.net.au>
* [loader/ne_image.c]
Preliminary support for iterated segments.
Sat Aug 19 00:43:04 1995 Andrew Taylor (andrew@riscan.com)
Sat Aug 19 00:43:04 1995 Andrew Taylor (ataylor@cadvision.com)
* [windows/mapping.c]
In function MAPPING_FixIsotropic(), VportExt[XY] is multiplied by
......
......@@ -18,7 +18,7 @@ SHELL = /bin/sh
CC = @CC@
CPP = @CPP@
CFLAGS = @CFLAGS@
OPTIONS = @OPTIONS@
OPTIONS = @OPTIONS@ -D_REENTRANT
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
XPM_LIB = -lXpm
......
......@@ -51,7 +51,33 @@ AC_CHECK_LIB(i386,i386_set_ldt)
dnl Check for -lw for Solaris
AC_CHECK_LIB(w,iswalnum)
dnl Check for XFree86 DGA extension
AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,,,-lXext -lX11)
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_CACHE_CHECK("for Open Sound System",
ac_cv_c_opensoundsystem,
AC_TRY_COMPILE([#include <sys/soundcard.h>],[
/* check for open sound system and one of the SNDCTL_ defines to be sure */
#if !defined(OPEN_SOUND_SYSTEM) || !defined(SNDCTL_DSP_STEREO)
#error No open sound system
#endif
],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
if test "$ac_cv_c_opensoundsystem" = "yes"
then
AC_DEFINE(HAVE_OSS)
fi
dnl **** Check for union semun ****
AC_CACHE_CHECK("for union semun", ac_cv_c_union_semun,
AC_TRY_COMPILE([#include <sys/sem.h>],[union semun foo],
ac_cv_c_union_semun="yes", ac_cv_c_union_semun="no"))
if test "$ac_cv_c_union_semun" = "yes"
then
AC_DEFINE(HAVE_UNION_SEMUN)
fi
dnl **** If ln -s doesn't work, use cp instead ****
if test "$ac_cv_prog_LN_S" = "ln -s"; then : ; else LN_S=cp ; fi
......@@ -98,6 +124,22 @@ then
AC_DEFINE(NEED_UNDERSCORE_PREFIX)
fi
dnl **** Check for .string in assembler ****
AC_CACHE_CHECK("whether assembler accepts .string",
ac_cv_c_asm_string,
[saved_libs=$LIBS
LIBS="conftest_asm.s $LIBS"
cat > conftest_asm.s <<EOF
.string "test"
EOF
AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
LIBS=$saved_libs])
if test "$ac_cv_c_asm_string" = "yes"
then
AC_DEFINE(HAVE_ASM_STRING)
fi
dnl **** Check for working dll ****
DLLFLAGS=""
......
......@@ -1837,7 +1837,7 @@ static BOOL32 MENU_ExecFocusedItem( MTRACKER* pmt, HMENU32 hMenu )
{
if( menu->wFlags & MF_SYSMENU )
{
PostMessage16( pmt->hOwnerWnd, WM_SYSCOMMAND, item->hSubMenu,
PostMessage16( pmt->hOwnerWnd, WM_SYSCOMMAND, item->wID,
MAKELPARAM((INT16)pmt->pt.x, (INT16)pmt->pt.y) );
}
else
......
......@@ -347,9 +347,7 @@ void DEBUG_AddModuleBreakpoints(void)
if (pModule->flags & NE_FFLAGS_WIN32) /* PE module */
{
PE_MODREF *pem;
if (!pCurrentProcess) continue;
pem = pCurrentProcess->modref_list;
PE_MODREF *pem = PROCESS_Current()->modref_list;
while (pem)
{
if (pem->module == pModule->module32) break;
......
......@@ -803,7 +803,7 @@ static void DEBUG_LoadEntryPoints32( HMODULE32 hModule, const char *name )
void **functions;
const char **names;
PE_MODREF *pem = pCurrentProcess->modref_list;
PE_MODREF *pem = PROCESS_Current()->modref_list;
while (pem && (pem->module != hModule)) pem = pem->next;
if (!pem) return;
exports = pem->pe_export;
......
......@@ -949,7 +949,7 @@ BOOL32 WINAPI GetVolumeInformation32A( LPCSTR root, LPSTR label,
if (DRIVE_GetType(drive)==TYPE_CDROM)
lstrcpyn32A( fsname, "CDFS", fsname_len );
else
lstrcpyn32A( fsname, "FAT16", fsname_len );
lstrcpyn32A( fsname, "FAT", fsname_len );
}
return TRUE;
}
......
......@@ -188,3 +188,18 @@ MFDRV_ExtFloodFill( DC *dc, INT32 x, INT32 y, COLORREF color, UINT32 fillType )
{
return MF_MetaParam4(dc,META_FLOODFILL,x,y,HIWORD(color),LOWORD(color));
}
/**********************************************************************
* MFDRV_PaintRgn
*/
BOOL32
MFDRV_PaintRgn( DC *dc, HRGN32 hrgn )
{
INT16 index;
index = MF_CreateRegion( dc, hrgn );
if(index == -1)
return FALSE;
return MF_MetaParam1( dc, META_PAINTREGION, index );
}
......@@ -38,7 +38,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
NULL, /* pOffsetClipRgn */
MFDRV_OffsetViewportOrg, /* pOffsetViewportOrg */
MFDRV_OffsetWindowOrg, /* pOffsetWindowOrg */
NULL, /* pPaintRgn */
MFDRV_PaintRgn, /* pPaintRgn */
MFDRV_PatBlt, /* pPatBlt */
MFDRV_Pie, /* pPie */
MFDRV_PolyPolygon, /* pPolyPolygon */
......
/*
* DC clipping functions
* X11DRV clipping functions
*
* Copyright 1993 Alexandre Julliard
* Copyright 1998 Huw Davies
*/
#include <stdio.h>
......@@ -10,26 +10,55 @@
#include "region.h"
#include "stddebug.h"
#include "debug.h"
#include "heap.h"
/***********************************************************************
* X11DRV_SetDeviceClipping
* Copy RECT32s to a temporary buffer of XRectangles and call
* XSetClipRectangles().
*
* Could write using GetRegionData but this would be slower.
*/
void X11DRV_SetDeviceClipping( DC * dc )
{
XRectangle *pXrect;
RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr(dc->w.hGCClipRgn, REGION_MAGIC);
if (!obj)
{
fprintf( stderr, "X11DRV_SetDeviceClipping: Rgn is 0. Please report this.\n");
exit(1);
}
if (obj->xrgn)
{
XSetRegion( display, dc->u.x.gc, obj->xrgn );
XSetClipOrigin( display, dc->u.x.gc, dc->w.DCOrgX, dc->w.DCOrgY );
}
else /* Clip everything */
if (obj->rgn->numRects > 0)
{
XSetClipRectangles( display, dc->u.x.gc, 0, 0, NULL, 0, 0 );
XRectangle *pXr;
RECT32 *pRect = obj->rgn->rects;
RECT32 *pEndRect = obj->rgn->rects + obj->rgn->numRects;
pXrect = HeapAlloc( GetProcessHeap(), 0,
sizeof(*pXrect) * obj->rgn->numRects );
if(!pXrect)
{
fprintf(stderr, "X11DRV_SetDeviceClipping() can't alloc buffer\n");
return;
}
for(pXr = pXrect; pRect < pEndRect; pRect++, pXr++)
{
pXr->x = pRect->left;
pXr->y = pRect->top;
pXr->width = pRect->right - pRect->left;
pXr->height = pRect->bottom - pRect->top;
}
}
else
pXrect = NULL;
XSetClipRectangles( display, dc->u.x.gc, dc->w.DCOrgX, dc->w.DCOrgY,
pXrect, obj->rgn->numRects, YXBanded );
if(pXrect)
HeapFree( GetProcessHeap(), 0, pXrect );
GDI_HEAP_UNLOCK( dc->w.hGCClipRgn );
}
......@@ -440,15 +440,20 @@ X11DRV_PaintRgn( DC *dc, HRGN32 hrgn )
HRGN32 tmpVisRgn, prevVisRgn;
HDC32 hdc = dc->hSelf; /* FIXME: should not mix dc/hdc this way */
/* Modify visible region */
if (!(tmpVisRgn = CreateRectRgn32( 0, 0, 0, 0 ))) return FALSE;
if (!(prevVisRgn = SaveVisRgn( hdc ))) return FALSE;
if (!(tmpVisRgn = CreateRectRgn32( 0, 0, 0, 0 )))
{
RestoreVisRgn( hdc );
return FALSE;
/* Transform region into device co-ords */
if (!REGION_LPTODP( hdc, tmpVisRgn, hrgn )) {
DeleteObject32( tmpVisRgn );
return FALSE;
}
/* Modify visible region */
if (!(prevVisRgn = SaveVisRgn( hdc ))) {
DeleteObject32( tmpVisRgn );
return FALSE;
}
CombineRgn32( tmpVisRgn, prevVisRgn, hrgn, RGN_AND );
CombineRgn32( tmpVisRgn, prevVisRgn, tmpVisRgn, RGN_AND );
SelectVisRgn( hdc, tmpVisRgn );
DeleteObject32( tmpVisRgn );
......
......@@ -112,8 +112,25 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
case 't':
args16 -= 4;
printf( "0x%08x", *(int *)args16 );
if (HIWORD(*(int *)args16))
printf( " \"%s\"", (char *)PTR_SEG_TO_LIN(*(int *)args16) );
if (HIWORD(*(int *)args16)) {
LPBYTE s = (LPBYTE)PTR_SEG_TO_LIN(*(int*)args16);
/* filter out non printable chars, which would destroy output */
fputs(" \"",stdout);
while (*s) {
if (*s < ' ') {
printf( "\\0x%02x",*s++);
continue;
}
if (*s=='\\') {
fputs( "\\\\",stdout);
s++;
continue;
}
fputc(*s++,stdout);
}
fputs("\"",stdout);
}
break;
case 'p':
args16 -= 4;
......@@ -122,8 +139,25 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
case 'T':
args16 -= 4;
printf( "%04x:%04x", *(WORD *)(args16+2), *(WORD *)args16 );
if (HIWORD(*(int *)args16))
printf( " \"%s\"", (char *)PTR_SEG_TO_LIN(*(int *)args16) );
if (HIWORD(*(int *)args16)) {
LPBYTE s = (LPBYTE)PTR_SEG_TO_LIN(*(int*)args16);
/* filter out non printable chars, which would destroy output */
fputs(" \"",stdout);
while (*s) {
if (*s < ' ') {
printf( "\\0x%02x",*s++);
continue;
}
if (*s=='\\') {
fputs( "\\\\",stdout);
s++;
continue;
}
fputc(*s++,stdout);
}
fputs("\"",stdout);
}
break;
}
args++;
......@@ -209,10 +243,10 @@ void RELAY_DebugCallTo16( int* stack, int nb_args )
if (nb_args == -1) /* Register function */
{
CONTEXT *context = (CONTEXT *)stack[0];
WORD *stack16 = (WORD *)CURRENT_STACK16 - 2 /* for saved %%esp */;
WORD *stack16 = (WORD *)CURRENT_STACK16;
printf( "CallTo16(func=%04lx:%04x,ds=%04lx",
CS_reg(context), IP_reg(context), DS_reg(context) );
nb_args = -stack[1] / sizeof(WORD);
nb_args = stack[1] / sizeof(WORD);
while (nb_args--) printf( ",0x%04x", *(--stack16) );
printf( ")\n" );
printf( " AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x BP=%04x ES=%04x\n",
......@@ -268,13 +302,13 @@ void WINAPI Catch( CONTEXT *context )
lpbuf[0] = IP_reg(context);
lpbuf[1] = CS_reg(context);
lpbuf[2] = LOWORD(pFrame->saved_ss_sp);
lpbuf[2] = LOWORD(pFrame->frame32);
lpbuf[3] = BP_reg(context);
lpbuf[4] = SI_reg(context);
lpbuf[5] = DI_reg(context);
lpbuf[6] = DS_reg(context);
lpbuf[7] = OFFSETOF(IF1632_Saved16_ss_sp);
lpbuf[8] = HIWORD(pFrame->saved_ss_sp);
lpbuf[8] = HIWORD(pFrame->frame32);
AX_reg(context) = 0; /* Return 0 */
}
......@@ -301,7 +335,7 @@ void WINAPI Throw( CONTEXT *context )
IF1632_Saved16_ss_sp = MAKELONG( lpbuf[7] - sizeof(WORD),
HIWORD(IF1632_Saved16_ss_sp) );
pFrame = CURRENT_STACK16;
pFrame->saved_ss_sp = MAKELONG( lpbuf[2], lpbuf[8] );
pFrame->frame32 = MAKELONG( lpbuf[2], lpbuf[8] );
IP_reg(context) = lpbuf[0];
CS_reg(context) = lpbuf[1];
BP_reg(context) = lpbuf[3];
......@@ -375,6 +409,14 @@ static DWORD RELAY_CallProc32W(int Ex)
break;
case 7: ret = proc32(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);
break;
case 8: ret = proc32(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
break;
case 9: ret = proc32(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]);
break;
case 10: ret = proc32(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9]);
break;
case 11: ret = proc32(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]);
break;
default:
/* FIXME: should go up to 32 arguments */
fprintf(stderr,"CallProc32W: unsupported number of arguments %ld, please report.\n",nrofargs);
......
......@@ -240,15 +240,14 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
}
}
args = (WORD *)CURRENT_STACK16 - 7;
args = (WORD *)CURRENT_STACK16 - 5;
args[0] = LOWORD(lParam);
args[1] = HIWORD(lParam);
args[2] = wParam;
args[3] = msg;
args[4] = hwnd;
/* args[5] and args[6] are used by relay code to store the stack pointer */
ret = CallTo16_sreg_( &context, -(5 * sizeof(WORD)) );
ret = CallTo16_sreg_( &context, 5 * sizeof(WORD) );
if (offset) STACK16_POP(offset);
return ret;
}
......
......@@ -5,3 +5,15 @@
/* Define if symbols declared in assembly code need an underscore prefix */
#undef NEED_UNDERSCORE_PREFIX
/* Define to use .string instead of .ascii */
#undef HAVE_ASM_STRING
/* Define if union semun is defined in sys/sem.h */
#undef HAVE_UNION_SEMUN
/* Define if you have the Xxf86dga library (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA
/* Define if you have the Open Sound system. */
#undef HAVE_OSS
......@@ -18,6 +18,18 @@
/* Define if symbols declared in assembly code need an underscore prefix */
#undef NEED_UNDERSCORE_PREFIX
/* Define to use .string instead of .ascii */
#undef HAVE_ASM_STRING
/* Define if union semun is defined in sys/sem.h */
#undef HAVE_UNION_SEMUN
/* Define if you have the Xxf86dga library (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA
/* Define if you have the Open Sound system. */
#undef HAVE_OSS
/* Define if you have the clone function. */
#undef HAVE_CLONE
......@@ -42,9 +54,6 @@
/* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
/* Define if you have the Xxf86dga library (-lXxf86dga). */
#undef HAVE_LIBXXF86DGA
/* Define if you have the i386 library (-li386). */
#undef HAVE_LIBI386
......
......@@ -20,6 +20,12 @@ typedef struct IDirectDrawPalette IDirectDrawPalette,*LPDIRECTDRAWPALETTE;
typedef struct IDirectDrawSurface IDirectDrawSurface,*LPDIRECTDRAWSURFACE;
typedef struct IDirectDrawSurface2 IDirectDrawSurface2,*LPDIRECTDRAWSURFACE2;
#define DDENUMRET_CANCEL 0
#define DDENUMRET_OK 1
#define DD_OK 0
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
......@@ -681,7 +687,7 @@ typedef struct IDirectDraw_VTable {
STDMETHOD(Compact)(THIS) PURE;
STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC *lpddsd, LPDIRECTDRAWSURFACE FAR *,
STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *,
IUnknown FAR *) PURE;
STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE
FAR * ) PURE;
......@@ -706,9 +712,10 @@ struct _directdrawdata {
DWORD depth;
DWORD vp_width,vp_height; /* viewport dimension */
DWORD height,width; /* SetDisplayMode */
DWORD current_height,fb_width,fb_height,fb_banksize,fb_memsize;
DWORD fb_width,fb_height,fb_banksize,fb_memsize;
HWND32 mainwindow;
void *fb_addr;
unsigned int vpmask;
};
......@@ -830,6 +837,7 @@ struct IDirectDrawSurface {
LPDIRECTDRAWPALETTE palette;
DWORD fb_height,lpitch,width,height;
LPDIRECTDRAW ddraw;
LPDIRECTDRAWSURFACE backbuffer;
};
#undef THIS
#define THIS LPDIRECTDRAWSURFACE2 this
......@@ -885,6 +893,7 @@ struct IDirectDrawSurface2 {
LPDIRECTDRAWPALETTE palette;
DWORD fb_height,lpitch,width,height;
LPDIRECTDRAW ddraw;
LPDIRECTDRAWSURFACE backbuffer;
};
#undef THIS
......
......@@ -14,6 +14,25 @@ DEFINE_GUID(IID_IDirectSoundBuffer,0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,
typedef struct IDirectSound IDirectSound,*LPDIRECTSOUND;
typedef struct IDirectSoundBuffer IDirectSoundBuffer,*LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
#define _FACDS 0x878
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1,_FACDS,code)
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
#define DSERR_INVALIDPARAM E_INVALIDARG
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
#define DSERR_GENERIC E_FAIL
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
#define DSERR_UNSUPPORTED E_NOTIMPL
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
#define DSCAPS_PRIMARYMONO 0x00000001
#define DSCAPS_PRIMARYSTEREO 0x00000002
#define DSCAPS_PRIMARY8BIT 0x00000004
......@@ -26,6 +45,11 @@ typedef struct IDirectSoundBuffer IDirectSoundBuffer,*LPDIRECTSOUNDBUFFER,**LPLP
#define DSCAPS_SECONDARY8BIT 0x00000400
#define DSCAPS_SECONDARY16BIT 0x00000800
#define DSSCL_NORMAL 1
#define DSSCL_PRIORITY 2
#define DSSCL_EXCLUSIVE 3
#define DSSCL_WRITEPRIMARY 4
typedef struct _DSCAPS
{
DWORD dwSize;
......@@ -145,6 +169,8 @@ typedef struct tagLPDIRECTSOUND_VTABLE
struct IDirectSound {
LPDIRECTSOUND_VTABLE lpvtbl;
DWORD ref;
int nrofbuffers;
LPDIRECTSOUNDBUFFER *buffers;
};
#undef THIS
......@@ -181,7 +207,11 @@ typedef struct tagLPDIRECTSOUNDBUFFER_VTABLE
struct IDirectSoundBuffer {
LPDIRECTSOUNDBUFFER_VTABLE lpvtbl;
WAVEFORMATEX wfx;
DWORD ref;
LPBYTE buffer;
DWORD playing,playpos,writepos,buflen;
LPDIRECTSOUND dsound;
};
#endif
......@@ -44,7 +44,7 @@ typedef struct
typedef struct
{
BOOL32 (*signaled)(K32OBJ*,DWORD); /* Is object signaled? */
void (*satisfied)(K32OBJ*,DWORD); /* Wait on object is satisfied */
BOOL32 (*satisfied)(K32OBJ*,DWORD); /* Wait on object is satisfied */
void (*add_wait)(K32OBJ*,DWORD); /* Add thread to wait queue */
void (*remove_wait)(K32OBJ*,DWORD); /* Remove thread from wait queue */
void (*destroy)(K32OBJ *); /* Destroy object on refcount==0 */
......
......@@ -36,6 +36,6 @@ BOOL32 MF_BitBlt(DC *dcDest, short xDest, short yDest, short width,
BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
short heightDest, DC *dcSrc, short xSrc, short ySrc,
short widthSrc, short heightSrc, DWORD rop);
INT16 MF_CreateRegion(DC *dc, HRGN32 hrgn);
#endif /* __WINE_METAFILE_H */
......@@ -72,5 +72,6 @@ extern BOOL32 MFDRV_ExtFloodFill( struct tagDC *dc, INT32 x, INT32 y,
extern BOOL32 MFDRV_ExtTextOut( struct tagDC *dc, INT32 x, INT32 y,
UINT32 flags, const RECT32 *lprect, LPCSTR str,
UINT32 count, const INT32 *lpDx );
extern BOOL32 MFDRV_PaintRgn( DC *dc, HRGN32 hrgn );
#endif /* __WINE_METAFILEDRV_H */
......@@ -59,7 +59,6 @@ struct options
if write access is requested */
WINE_MODE mode; /* Start Wine in selected mode
(standard/enhanced) */
int ipc; /* Use IPC mechanisms */
WINE_LANGUAGE language; /* Current language */
int managed; /* Managed windows */
int perfectGraphics; /* Favor correctness over speed for graphics */
......
......@@ -98,20 +98,12 @@ typedef struct _PDB32
LCID locale; /* c4 Locale to be queried by GetThreadLocale (NT) */
} PDB32;
/* PDB <-> Process id conversion macros */
#define PROCESS_OBFUSCATOR ((DWORD)0xdeadbeef)
#define PROCESS_ID_TO_PDB(id) ((PDB32 *)((id) ^ PROCESS_OBFUSCATOR))
#define PDB_TO_PROCESS_ID(pdb) ((DWORD)(pdb) ^ PROCESS_OBFUSCATOR)
/* scheduler/process.c */
extern PDB32 *PROCESS_Current(void);
extern PDB32 *PROCESS_IdToPDB( DWORD id );
extern HANDLE32 PROCESS_AllocHandle( K32OBJ *ptr, DWORD flags);
extern K32OBJ *PROCESS_GetObjPtr( HANDLE32 handle, K32OBJ_TYPE type );
extern BOOL32 PROCESS_SetObjPtr( HANDLE32 handle, K32OBJ *ptr, DWORD flags );
extern PDB32 *PROCESS_Create( TDB *pTask, LPCSTR cmd_line );
extern PDB32 *pCurrentProcess;
/* scheduler/event.c */
extern void EVENT_Set( K32OBJ *obj );
extern K32OBJ *EVENT_Create( BOOL32 manual_reset, BOOL32 initial_state );
#endif /* __WINE_PROCESS_H */
......@@ -13,35 +13,36 @@
#pragma pack(1)
/* 16-bit stack layout after CallFrom16() */
typedef struct
/* 32-bit stack layout after CallTo16() */
typedef struct _STACK32FRAME
{
DWORD saved_ss_sp; /* 00 saved previous 16-bit stack */
DWORD ebp; /* 04 full 32-bit content of ebp */
WORD entry_ip; /* 08 ip of entry point */
WORD ds; /* 0a ds */
WORD entry_cs; /* 0c cs of entry point */
WORD es; /* 0e es */
DWORD entry_point; /* 10 32-bit entry point to call */
WORD bp; /* 14 16-bit bp */
WORD ip; /* 16 return address */
WORD cs; /* 18 */
} STACK16FRAME;
SEGPTR frame16; /* 00 16-bit frame from last CallFrom16() */
DWORD edi; /* 04 saved registers */
DWORD esi; /* 08 */
DWORD edx; /* 0c */
DWORD ecx; /* 10 */
DWORD ebx; /* 14 */
DWORD restore_addr; /* 18 return address for restoring code selector */
DWORD codeselector; /* 1c code selector to restore */
DWORD ebp; /* 20 saved 32-bit frame pointer */
DWORD retaddr; /* 24 actual return address */
DWORD args[1]; /* 28 arguments to 16-bit function */
} STACK32FRAME;
/* 32-bit stack layout after CallTo16() */
/* 16-bit stack layout after CallFrom16() */
typedef struct
{
DWORD edi; /* 00 saved registers */
DWORD esi; /* 04 */
DWORD edx; /* 08 */
DWORD ecx; /* 0c */
DWORD ebx; /* 10 */
DWORD restore_addr; /* 14 return address for restoring code selector */
DWORD codeselector; /* 18 code selector to restore */
DWORD ebp; /* 1c saved 32-bit frame pointer */
DWORD retaddr; /* 20 actual return address */
DWORD args[1]; /* 24 arguments to 16-bit function */
} STACK32FRAME;
STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
DWORD ebp; /* 04 full 32-bit content of ebp */
WORD entry_ip; /* 08 ip of entry point */
WORD ds; /* 0a ds */
WORD entry_cs; /* 0c cs of entry point */
WORD es; /* 0e es */
DWORD entry_point; /* 10 32-bit entry point to call */
WORD bp; /* 14 16-bit bp */
WORD ip; /* 16 return address */
WORD cs; /* 18 */
} STACK16FRAME;
#pragma pack(4)
......
......@@ -55,9 +55,9 @@ typedef struct _THDB
DWORD exit_code; /* 48 Termination status */
WORD teb_sel; /* 4c Selector to TEB */
WORD emu_sel; /* 4e 80387 emulator selector */
DWORD unknown1; /* 50 Unknown */
int thread_errno; /* 50 Per-thread errno (was: unknown) */
WAIT_STRUCT *wait_list; /* 54 Event waiting list */
DWORD unknown2; /* 58 Unknown */
int thread_h_errno; /* 50 Per-thread h_errno (was: unknown) */
void *ring0_thread; /* 5c Pointer to ring 0 thread */
void *ptdbx; /* 60 Pointer to TDBX structure */
void *stack_base; /* 64 Base of the stack */
......@@ -86,7 +86,8 @@ typedef struct _THDB
K32OBJ *win16_mutex; /* 1e8 Pointer to Win16 mutex */
K32OBJ *win32_mutex; /* 1ec Pointer to KERNEL32 mutex */
K32OBJ *crit_section2; /* 1f0 Another critical section */
DWORD unknown6[3]; /* 1f4 Unknown */
K32OBJ *mutex_list; /* 1f4 List of owned mutex (was: unknown)*/
DWORD unknown6[2]; /* 1f8 Unknown */
/* The following are Wine-specific fields */
CONTEXT context; /* 200 Thread context */
WAIT_STRUCT wait_struct; /* Event wait structure */
......@@ -124,8 +125,20 @@ extern THDB *THREAD_Current(void);
extern void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread );
extern void THREAD_RemoveQueue( THREAD_QUEUE *queue, THDB *thread );
/* scheduler/event.c */
extern void EVENT_Set( K32OBJ *obj );
extern K32OBJ *EVENT_Create( BOOL32 manual_reset, BOOL32 initial_state );
/* scheduler/mutex.c */
extern void MUTEX_Abandon( K32OBJ *obj );
/* scheduler/synchro.c */
extern void SYNC_WaitForCondition( WAIT_STRUCT *wait, DWORD timeout );
extern void SYNC_WakeUp( THREAD_QUEUE *queue, DWORD max );
/* scheduler/sysdeps.c */
extern int SYSDEPS_SpawnThread( THDB *thread );
extern void SYSDEPS_ExitThread(void);
extern TEB * WINAPI NtCurrentTeb(void);
#endif /* __WINE_THREAD_H */
#define WINE_RELEASE_INFO "Wine release 980104"
#define WINE_RELEASE_INFO "Wine release 980118"
......@@ -5689,6 +5689,7 @@ BOOL32 WINAPI ExitWindowsEx(UINT32,DWORD);
DWORD WINAPI ExpandEnvironmentStrings32A(LPCSTR,LPSTR,DWORD);
DWORD WINAPI ExpandEnvironmentStrings32W(LPCWSTR,LPWSTR,DWORD);
#define ExpandEnvironmentStrings WINELIB_NAME_AW(ExpandEnvironmentStrings)
HRGN32 WINAPI ExtCreateRegion(LPXFORM,DWORD,LPRGNDATA);
BOOL32 WINAPI FileTimeToDosDateTime(const FILETIME*,LPWORD,LPWORD);
BOOL32 WINAPI FileTimeToLocalFileTime(const FILETIME*,LPFILETIME);
BOOL32 WINAPI FileTimeToSystemTime(const FILETIME*,LPSYSTEMTIME);
......@@ -5752,6 +5753,7 @@ INT32 WINAPI GetPrivateProfileSection32A(LPCSTR,LPSTR,INT32,LPCSTR);
INT32 WINAPI GetPrivateProfileSection32W(LPCWSTR,LPWSTR,INT32,LPCWSTR);
#define GetPrivateProfileSection WINELIB_NAME_AW(GetPrivateProfileSection)
HANDLE32 WINAPI GetProcessHeap(void);
DWORD WINAPI GetRegionData(HRGN32,DWORD,LPRGNDATA);
DWORD WINAPI GetShortPathName32A(LPCSTR,LPSTR,DWORD);
DWORD WINAPI GetShortPathName32W(LPCWSTR,LPWSTR,DWORD);
#define GetShortPathName WINELIB_NAME_AW(GetShortPathName)
......
......@@ -48,6 +48,7 @@ int __winelib = 1; /* Winelib run-time flag */
BOOL32 MAIN_KernelInit(void)
{
extern BOOL32 EVENT_Init(void);
extern BOOL32 PROCESS_Init(void);
extern BOOL32 VIRTUAL_Init(void);
/* Initialize virtual memory management */
......@@ -57,15 +58,18 @@ BOOL32 MAIN_KernelInit(void)
if (!(SystemHeap = HeapCreate( HEAP_GROWABLE, 0x10000, 0 ))) return FALSE;
if (!(SegptrHeap = HeapCreate( HEAP_WINE_SEGPTR, 0, 0 ))) return FALSE;
/* Create the initial process */
if (!PROCESS_Init()) return FALSE;
/* Initialize signal handling */
if (!SIGNAL_Init()) return FALSE;
/* Load the configuration file */
if (!PROFILE_LoadWineIni()) return FALSE;
/* Initialize DOS memory */
if (!DOSMEM_Init()) return FALSE;
/* Initialize signal handling */
if (!SIGNAL_Init()) return FALSE;
/* Initialise DOS drives */
if (!DRIVE_Init()) return FALSE;
......
......@@ -1437,7 +1437,7 @@ HMODULE32 WINAPI LoadLibraryEx32A(LPCSTR libname,HFILE32 hfile,DWORD flags)
hmod = PE_LoadLibraryEx32A(buffer,hfile,flags);
}
/* initialize all DLLs, which haven't been initialized yet. */
PE_InitializeDLLs( pCurrentProcess, DLL_PROCESS_ATTACH, NULL);
PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, NULL);
return hmod;
}
......
......@@ -78,7 +78,7 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
IF1632_Saved16_ss_sp = PTR_SEG_OFF_TO_SEGPTR(pModule->self_loading_sel,
0xff00 - sizeof(*stack16Top));
stack16Top = CURRENT_STACK16;
stack16Top->saved_ss_sp = 0;
stack16Top->frame32 = 0;
stack16Top->ds = stack16Top->es = pModule->self_loading_sel;
stack16Top->entry_point = 0;
stack16Top->entry_ip = 0;
......@@ -386,7 +386,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
IF1632_Saved16_ss_sp = PTR_SEG_OFF_TO_SEGPTR(pModule->self_loading_sel,
0xff00 - sizeof(*stack16Top) );
stack16Top = CURRENT_STACK16;
stack16Top->saved_ss_sp = 0;
stack16Top->frame32 = 0;
stack16Top->ebp = 0;
stack16Top->ds = stack16Top->es = pModule->self_loading_sel;
stack16Top->entry_point = 0;
......
......@@ -97,7 +97,7 @@ FARPROC32 PE_FindExportedFunction( HMODULE32 hModule, LPCSTR funcName)
u_long * function;
u_char ** name, *ename;
int i;
PDB32 *process=pCurrentProcess;
PDB32 *process=PROCESS_Current();
PE_MODREF *pem;
u_long rva_start, rva_end, addr;
char * forward;
......@@ -690,14 +690,14 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
if (!HIWORD(hModule)) /* internal (or bad) */
return hModule;
/* check if this module is already mapped */
pem = pCurrentProcess->modref_list;
pem = PROCESS_Current()->modref_list;
while (pem) {
if (pem->module == hModule) return hModule;
pem = pem->next;
}
pModule = MODULE_GetPtr(hModule);
if (pModule->flags & NE_FFLAGS_BUILTIN) {
PDB32 *process = pCurrentProcess;
PDB32 *process = PROCESS_Current();
IMAGE_DOS_HEADER *dh;
IMAGE_NT_HEADERS *nh;
IMAGE_SECTION_HEADER *sh;
......@@ -743,7 +743,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, HFILE32 hFile, DWORD flags) {
if (pModule->module32 < 32) return 21;
}
/* recurse */
pModule->module32 = PE_MapImage( pModule->module32, pCurrentProcess,
pModule->module32 = PE_MapImage( pModule->module32, PROCESS_Current(),
&ofs,flags);
return pModule->module32;
}
......@@ -776,7 +776,7 @@ HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
*((WORD*)PTR_SEG_TO_LIN(params->showCmd) + 1) );
}
pModule->module32 = PE_MapImage( hModule32, pCurrentProcess, ofs, 0 );
pModule->module32 = PE_MapImage( hModule32, PROCESS_Current(), ofs, 0 );
return hInstance;
}
......@@ -875,7 +875,7 @@ void PE_InitTls(PDB32 *pdb)
*/
BOOL32 WINAPI DisableThreadLibraryCalls(HMODULE32 hModule)
{
PDB32 *process = pCurrentProcess;
PDB32 *process = PROCESS_Current();
PE_MODREF *pem = process->modref_list;
while (pem) {
......
......@@ -33,7 +33,7 @@
static PE_MODREF*
HMODULE32toPE_MODREF(HMODULE32 hmod) {
NE_MODULE *pModule;
PDB32 *pdb = pCurrentProcess;
PDB32 *pdb = PROCESS_Current();
PE_MODREF *pem;
if (!hmod) hmod = GetTaskDS(); /* FIXME: correct? */
......
......@@ -56,7 +56,7 @@ static HGLOBAL16 hDOSEnvironment = 0;
static HGLOBAL16 TASK_CreateDOSEnvironment(void);
static void TASK_YieldToSystem(TDB*);
static THDB TASK_SystemTHDB;
/***********************************************************************
* TASK_Init
*/
......@@ -64,8 +64,6 @@ BOOL32 TASK_Init(void)
{
if (!(hDOSEnvironment = TASK_CreateDOSEnvironment()))
fprintf( stderr, "Not enough memory for DOS Environment\n" );
TASK_SystemTHDB.teb_sel = SELECTOR_AllocBlock( &TASK_SystemTHDB, 0x1000, SEGMENT_DATA, TRUE, FALSE );
SET_FS( TASK_SystemTHDB.teb_sel );
return (hDOSEnvironment != 0);
}
......@@ -340,6 +338,8 @@ static void TASK_CallToStart(void)
SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule );
IF1632_Saved16_ss_sp = pTask->ss_sp;
/* Terminate the stack frame */
CURRENT_STACK16->frame32 = NULL;
SET_CUR_THREAD( pTask->thdb );
if (pModule->flags & NE_FFLAGS_WIN32)
{
......@@ -347,11 +347,11 @@ static void TASK_CallToStart(void)
extern void InitTask( CONTEXT *context );
FARPROC32 entry = (FARPROC32)RVA_PTR( pCurrentProcess->exe_modref->module, OptionalHeader.AddressOfEntryPoint );
FARPROC32 entry = (FARPROC32)RVA_PTR( PROCESS_Current()->exe_modref->module, OptionalHeader.AddressOfEntryPoint );
InitTask( NULL );
InitApp( pTask->hModule );
PE_InitializeDLLs( pCurrentProcess, DLL_PROCESS_ATTACH, (LPVOID)-1 );
PE_InitializeDLLs( PROCESS_Current(), DLL_PROCESS_ATTACH, (LPVOID)-1 );
dprintf_relay( stddeb, "CallTo32(entryproc=%p)\n", entry );
exit_code = entry();
TASK_KillCurrentTask( exit_code );
......@@ -514,7 +514,7 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
/* Create the Win32 part of the task */
pCurrentProcess = pdb32 = PROCESS_Create( pTask, cmdLine );
pdb32 = PROCESS_Create( pTask, cmdLine );
/* FIXME: check for pdb32 == NULL. */
pdb32->task = hTask;
if (pModule->flags & NE_FFLAGS_WIN32)
......@@ -522,8 +522,8 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
/*
LPTHREAD_START_ROUTINE start =
(LPTHREAD_START_ROUTINE)(
pCurrentProcess->exe_modref->load_addr +
pCurrentProcess->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
PROCESS_Current()->exe_modref->load_addr +
PROCESS_Current()->exe_modref->pe_module->pe_header->OptionalHeader.AddressOfEntryPoint);
*/
pTask->thdb = THREAD_Create( pdb32,
PE_HEADER(pModule->module32)->OptionalHeader.SizeOfStackReserve,
......@@ -541,11 +541,11 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
stack32Top = (char*)pTask->thdb->teb.stack_top;
frame32 = (STACK32FRAME *)stack32Top - 1;
frame32->edi = 0;
frame32->esi = 0;
frame32->edx = 0;
frame32->ecx = 0;
frame32->ebx = 0;
frame32->edi = 0;
frame32->esi = 0;
frame32->edx = 0;
frame32->ecx = 0;
frame32->ebx = 0;
frame32->retaddr = (DWORD)TASK_CallToStart;
/* The remaining fields will be initialized in TASK_Reschedule */
......@@ -555,9 +555,9 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
sp = pSegTable[pModule->ss-1].minsize + pModule->stack_size;
sp &= ~1;
pTask->ss_sp = PTR_SEG_OFF_TO_SEGPTR( hInstance, sp );
pTask->ss_sp -= sizeof(STACK16FRAME) + sizeof(DWORD) /* for saved %esp */;
pTask->ss_sp -= sizeof(STACK16FRAME);
frame16 = (STACK16FRAME *)PTR_SEG_TO_LIN( pTask->ss_sp );
frame16->saved_ss_sp = 0;
frame16->frame32 = frame32;
frame16->ebp = sp + (int)&((STACK16FRAME *)0)->bp;
frame16->bp = LOWORD(frame16->ebp);
frame16->ds = frame16->es = pTask->hInstance;
......@@ -565,8 +565,6 @@ HTASK16 TASK_CreateTask( HMODULE16 hModule, HINSTANCE16 hInstance,
frame16->entry_cs = 0;
/* The remaining fields will be initialized in TASK_Reschedule */
*(STACK32FRAME **)(frame16 + 1) = frame32; /* Store the 32-bit %esp */
/* If there's no 16-bit stack yet, use a part of the new task stack */
/* This is only needed to have a stack to switch from on the first */
/* call to DirectedYield(). */
......@@ -775,8 +773,8 @@ void TASK_Reschedule(void)
if (!newframe16->entry_cs)
{
STACK16FRAME *oldframe16 = CURRENT_STACK16;
STACK32FRAME *oldframe32 = *(STACK32FRAME **)(oldframe16 + 1);
STACK32FRAME *newframe32 = *(STACK32FRAME **)(newframe16 + 1);
STACK32FRAME *oldframe32 = oldframe16->frame32;
STACK32FRAME *newframe32 = newframe16->frame32;
newframe16->entry_ip = oldframe16->entry_ip;
newframe16->entry_cs = oldframe16->entry_cs;
newframe16->ip = oldframe16->ip;
......@@ -790,7 +788,6 @@ void TASK_Reschedule(void)
hCurrentTask = hTask;
SET_CUR_THREAD( pNewTask->thdb );
pCurrentProcess = pNewTask->thdb->process;
IF1632_Saved16_ss_sp = pNewTask->ss_sp;
}
......@@ -1197,7 +1194,7 @@ void WINAPI SwitchStackBack(void)
/* Build a stack frame for the return */
newFrame = CURRENT_STACK16;
newFrame->saved_ss_sp = oldFrame->saved_ss_sp;
newFrame->frame32 = oldFrame->frame32;
if (debugging_relay)
{
newFrame->entry_ip = oldFrame->entry_ip;
......
......@@ -24,7 +24,6 @@
#ifdef CONFIG_IPC
#include "dde_atom.h"
#include "options.h"
#endif
#define DEFAULT_ATOMTABLE_SIZE 37
......@@ -399,9 +398,10 @@ ATOM WINAPI GlobalAddAtom16( SEGPTR str )
{
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalAddAtom( str );
#endif
return DDE_GlobalAddAtom( str );
#else
return ATOM_AddAtom( USER_HeapSel, (LPCSTR)PTR_SEG_TO_LIN(str) );
#endif
}
......@@ -433,9 +433,10 @@ ATOM WINAPI GlobalAddAtom32W( LPCWSTR str )
ATOM WINAPI GlobalDeleteAtom( ATOM atom )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalDeleteAtom( atom );
#endif
return DDE_GlobalDeleteAtom( atom );
#else
return ATOM_DeleteAtom( USER_HeapSel, atom );
#endif
}
......@@ -446,9 +447,10 @@ ATOM WINAPI GlobalFindAtom16( SEGPTR str )
{
if (!HIWORD(str)) return (ATOM)LOWORD(str); /* Integer atom */
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalFindAtom( str );
#endif
return DDE_GlobalFindAtom( str );
#else
return ATOM_FindAtom( USER_HeapSel, (LPCSTR)PTR_SEG_TO_LIN(str) );
#endif
}
......@@ -480,9 +482,10 @@ ATOM WINAPI GlobalFindAtom32W( LPCWSTR str )
UINT16 WINAPI GlobalGetAtomName16( ATOM atom, LPSTR buffer, INT16 count )
{
#ifdef CONFIG_IPC
if (Options.ipc) return DDE_GlobalGetAtomName( atom, buffer, count );
#endif
return DDE_GlobalGetAtomName( atom, buffer, count );
#else
return (UINT16)ATOM_GetAtomName( USER_HeapSel, atom, buffer, count );
#endif
}
......
......@@ -18,7 +18,6 @@
#include "dde_mem.h"
#include "stackframe.h"
#include "module.h"
#include "options.h"
#include "stddebug.h"
#include "debug.h"
#include "winerror.h"
......@@ -124,7 +123,7 @@ HGLOBAL16 GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
pArena->size = GET_SEL_LIMIT(sel) + 1;
#ifdef CONFIG_IPC
if ((flags & GMEM_DDESHARE) && Options.ipc)
if (flags & GMEM_DDESHARE)
{
pArena->handle = shmdata->handle;
pArena->shmid = shmdata->shmid;
......@@ -200,7 +199,7 @@ HGLOBAL16 GLOBAL_Alloc( UINT16 flags, DWORD size, HGLOBAL16 hOwner,
/* Allocate the linear memory */
#ifdef CONFIG_IPC
if ((flags & GMEM_DDESHARE) && Options.ipc)
if (flags & GMEM_DDESHARE)
ptr = DDE_malloc(flags, size, &shmdata);
else
#endif /* CONFIG_IPC */
......@@ -297,7 +296,8 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HGLOBAL16 handle, DWORD size, UINT16 flags )
if (!handle) return 0;
#ifdef CONFIG_IPC
if (Options.ipc && (flags & GMEM_DDESHARE || is_dde_handle(handle))) {
if (flags & GMEM_DDESHARE || is_dde_handle(handle))
{
fprintf(stdnimp,
"GlobalReAlloc16: shared memory reallocating unimplemented\n");
return 0;
......
......@@ -182,7 +182,8 @@ void SELECTOR_FreeBlock( WORD sel, WORD count )
{
if ((frame->ds >= sel) && (frame->ds < nextsel)) frame->ds = 0;
if ((frame->es >= sel) && (frame->es < nextsel)) frame->es = 0;
frame = PTR_SEG_TO_LIN( frame->saved_ss_sp );
if (!frame->frame32) break;
frame = PTR_SEG_TO_LIN( frame->frame32->frame16 );
}
}
......
......@@ -660,7 +660,7 @@ BOOL32 WINAPI VirtualProtectEx( HANDLE32 handle, LPVOID addr, DWORD size,
PDB32 *pdb = (PDB32 *)PROCESS_GetObjPtr( handle, K32OBJ_PROCESS );
if (pdb)
{
if (pdb == pCurrentProcess)
if (pdb == PROCESS_Current())
ret = VirtualProtect( addr, size, new_prot, old_prot );
else
fprintf(stderr,"Unsupported: VirtualProtectEx on other process\n");
......@@ -743,7 +743,7 @@ BOOL32 WINAPI VirtualQueryEx( HANDLE32 handle, LPCVOID addr,
PDB32 *pdb = (PDB32 *)PROCESS_GetObjPtr( handle, K32OBJ_PROCESS );
if (pdb)
{
if (pdb == pCurrentProcess)
if (pdb == PROCESS_Current())
ret = VirtualQuery( addr, info, len );
else
fprintf(stderr,"Unsupported: VirtualQueryEx on other process\n");
......
......@@ -10,16 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "windows.h"
#include "winnt.h" /* HEAP_ macros */
#include "task.h"
#include "heap.h"
#include "ldt.h"
#include "stackframe.h"
#include "module.h"
#include "stddebug.h"
#include "debug.h"
#include "config.h"
#ifdef HAVE_WCTYPE_H
# include <wctype.h>
......@@ -32,6 +23,17 @@
# define iswlower(c) islower(c)
#endif /* HAVE_WCTYPE_H */
#include "windows.h"
#include "winnt.h" /* HEAP_ macros */
#include "task.h"
#include "heap.h"
#include "ldt.h"
#include "stackframe.h"
#include "module.h"
#include "stddebug.h"
#include "debug.h"
/* Funny to divide them between user and kernel. */
/* be careful: always use functions from wctype.h if character > 255 */
......
......@@ -81,7 +81,6 @@ struct options Options =
FALSE,
FALSE, /* failReadOnly */
MODE_ENHANCED, /* Enhanced mode */
FALSE, /* IPC enabled */
#ifdef DEFAULT_LANG
DEFAULT_LANG, /* Default language */
#else
......@@ -99,7 +98,6 @@ static XrmOptionDescRec optionsTable[] =
{ "-depth", ".depth", XrmoptionSepArg, (caddr_t)NULL },
{ "-display", ".display", XrmoptionSepArg, (caddr_t)NULL },
{ "-iconic", ".iconic", XrmoptionNoArg, (caddr_t)"on" },
{ "-ipc", ".ipc", XrmoptionNoArg, (caddr_t)"off"},
{ "-language", ".language", XrmoptionSepArg, (caddr_t)"En" },
{ "-name", ".name", XrmoptionSepArg, (caddr_t)NULL },
{ "-perfect", ".perfect", XrmoptionNoArg, (caddr_t)"on" },
......@@ -131,7 +129,6 @@ static XrmOptionDescRec optionsTable[] =
" -failreadonly Read only files may not be opened in write mode\n" \
" -fixedmap Use a \"standard\" color map\n" \
" -iconic Start as an icon\n" \
" -ipc Enable IPC facilities\n" \
" -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo,It,Ko,\n Hu,Pl,Po)\n" \
" -managed Allow the window manager to manage created windows\n" \
" -mode mode Start Wine in a particular mode (standard or enhanced)\n" \
......@@ -359,8 +356,6 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
Options.debug = TRUE;
if (MAIN_GetResource( db, ".failreadonly", &value ))
Options.failReadOnly = TRUE;
if (MAIN_GetResource( db, ".ipc", &value ))
Options.ipc = TRUE;
if (MAIN_GetResource( db, ".perfect", &value ))
Options.perfectGraphics = TRUE;
if (MAIN_GetResource( db, ".depth", &value))
......@@ -537,8 +532,6 @@ BOOL32 MAIN_WineInit( int *argc, char *argv[] )
int *depth_list;
struct timeval tv;
extern int _WinMain(int argc, char **argv);
#ifdef MALLOC_DEBUGGING
char *trace;
......
......@@ -57,3 +57,36 @@ const char *strerror( int err )
return sys_errlist[err];
}
#endif /* HAVE_STRERROR */
#if !defined(HAVE_CLONE) && defined(__linux__)
#include <assert.h>
#include <errno.h>
#include <syscall.h>
int clone( int (*fn)(void *), void *stack, int flags, void *arg )
{
#ifdef __i386__
int ret;
void **stack_ptr = (void **)stack;
*--stack_ptr = arg; /* Push argument on stack */
*--stack_ptr = fn; /* Push function pointer (popped into ebx) */
__asm__ __volatile__( "pushl %%ebx\n\t"
"movl %2,%%ebx\n\t"
"int $0x80\n\t"
"popl %%ebx\n\t" /* Contains fn in the child */
"testl %%eax,%%eax\n\t"
"jnz 0f\n\t"
"call *%%ebx\n\t" /* Should never return */
"xorl %%eax,%%eax\n\t" /* Just in case it does*/
"0:"
: "=a" (ret)
: "0" (SYS_clone), "g" (flags), "c" (stack_ptr) );
assert( ret ); /* If ret is 0, we returned from the child function */
if (ret > 0) return ret;
errno = -ret;
return -1;
#else
errno = EINVAL;
return -1;
#endif /* __i386__ */
}
#endif /* !HAVE_CLONE && __linux__ */
......@@ -18,6 +18,7 @@
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <pwd.h>
#include <assert.h>
#include <time.h>
#include "windows.h"
#include "win.h"
......@@ -587,6 +588,11 @@ _find_or_add_value(
LPKEYVALUE val=NULL;
int i;
if (name && !*name) {/* empty string equals default (NULL) value */
free(name);
name = NULL;
}
for (i=0;i<lpkey->nrofvalues;i++) {
val=lpkey->values+i;
if (name==NULL) {
......@@ -711,7 +717,10 @@ _wine_read_USTRING(char *buf,LPWSTR *str) {
}
*ws = 0;
ws = *str;
*str = strdupW(*str);
if (*ws)
*str = strdupW(*str);
else
*str = NULL;
free(ws);
return s;
}
......@@ -1038,7 +1047,10 @@ _w95_walk_tree(LPKEYSTRUCT lpkey,struct _w95key *key) {
int len;
name = strdupA2W(key->values[i].name);
if (!*name) name = NULL;
if (!*name) {
free(name);
name = NULL;
}
free(key->values[i].name);
len = key->values[i].datalen;
......@@ -2085,6 +2097,8 @@ DWORD WINAPI RegQueryValueEx32W(
lpkey = lookup_hkey(hkey);
if (!lpkey)
return SHELL_ERROR_BADKEY;
if (lpszValueName && !*lpszValueName)
lpszValueName = NULL;
if (lpszValueName==NULL) {
for (i=0;i<lpkey->nrofvalues;i++)
if (lpkey->values[i].name==NULL)
......@@ -2726,9 +2740,8 @@ DWORD WINAPI RegEnumValue32W(
memcpy(lpszValue,val->name,2*lstrlen32W(val->name)+2);
*lpcchValue=lstrlen32W(val->name)*2+2;
} else {
/* how to handle NULL value? */
*lpszValue = 0;
*lpcchValue = 2;
*lpcchValue = 0;
}
if (lpdwType)
*lpdwType=val->type;
......
......@@ -168,7 +168,7 @@ static int testFileExclusiveExistence(
static int read_xx_header(HFILE32 lzfd) {
IMAGE_DOS_HEADER mzh;
char magic[2];
char magic[3];
LZSeek32(lzfd,0,SEEK_SET);
if (sizeof(mzh)!=LZRead32(lzfd,&mzh,sizeof(mzh)))
......@@ -183,7 +183,8 @@ static int read_xx_header(HFILE32 lzfd) {
return IMAGE_OS2_SIGNATURE;
if (magic[0] == 'P' && magic[1] == 'E')
return IMAGE_NT_SIGNATURE;
fprintf(stderr,"misc/ver.c:read_ne_header:can't handle %*s files.\n",2,magic);
magic[2]='\0';
fprintf(stderr,"misc/ver.c:read_ne_header:can't handle %s files.\n",magic);
return 0;
}
......@@ -727,7 +728,7 @@ DWORD WINAPI VerFindFile16(
strcpy(curDir, "");
strcpy(destDir, "");
if(flags & VFFF_ISSHAREDFILE && !getuid()) {
if(flags & VFFF_ISSHAREDFILE) {
GetSystemDirectory32A(destDir, 256);
/* Were we given a filename? If so, try to find the file. */
......
......@@ -114,17 +114,15 @@ static VERSION VERSION_GetVersion(void)
if (versionForced) /* user has overridden any sensible checks */
return defaultVersion;
if (!pCurrentProcess) /* at startuptime probably */
return defaultVersion;
if (!pCurrentProcess->exe_modref)
if (!PROCESS_Current()->exe_modref)
{
/* HACK: if we have loaded a PE image into this address space,
* we are probably using thunks, so Win95 is our best bet
*/
if (pCurrentProcess->modref_list) return WIN95;
if (PROCESS_Current()->modref_list) return WIN95;
return WIN31; /* FIXME: hmm, look at DDB.version ? */
}
peheader = PE_HEADER(pCurrentProcess->exe_modref->module);
peheader = PE_HEADER(PROCESS_Current()->exe_modref->module);
if (peheader->OptionalHeader.MajorSubsystemVersion == 4)
/* FIXME: NT4 has the same majorversion; add a check here for it. */
return WIN95;
......
......@@ -41,6 +41,25 @@ void WINAPI INT_Int2fHandler( CONTEXT *context )
do_int2f_16( context );
break;
case 0x45:
switch (AL_reg(context))
{
case 0x00:
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x07:
case 0x08:
/* Microsoft Profiler - not installed */
break;
default:
INT_BARF( context, 0x2f );
}
break;
case 0x4a:
switch(AL_reg(context))
{
......
......@@ -15,6 +15,7 @@ C_SRCS = \
midi.c \
mixer.c \
mmaux.c \
mmio.c \
mmsystem.c \
time.c
......
/*
* Sample Wine Driver for Linux
* Sample Wine Driver for Open Sound System (featured in Linux and FreeBSD)
*
* Copyright 1994 Martin Ayotte
*/
......@@ -24,17 +24,12 @@
#include "mmsystem.h"
#include "heap.h"
#include "ldt.h"
#ifdef linux
#include <linux/soundcard.h>
#elif __FreeBSD__
#include <machine/soundcard.h>
#endif
#include "stddebug.h"
#include "debug.h"
#if defined(linux) || defined(__FreeBSD__)
#ifdef HAVE_OSS
#include <sys/soundcard.h>
#define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer"
......@@ -62,7 +57,7 @@ typedef struct {
typedef struct {
int unixdev;
int state;
DWORD bufsize; /* Linux '/dev/dsp' give us that size */
DWORD bufsize; /* OpenSound '/dev/dsp' give us that size */
WAVEOPENDESC waveDesc;
WORD wFlags;
PCMWAVEFORMAT Format;
......@@ -749,17 +744,17 @@ static DWORD WAVE_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpPar
lpParms->lpstrReturn = NULL;
switch(dwFlags) {
case MCI_INFO_PRODUCT:
lpParms->lpstrReturn = "Linux Sound System 0.5";
lpParms->lpstrReturn = "Open Sound System 0.5";
break;
case MCI_INFO_FILE:
lpParms->lpstrReturn =
(LPSTR)MCIWavDev[wDevID].openParms.lpstrElementName;
break;
case MCI_WAVE_INPUT:
lpParms->lpstrReturn = "Linux Sound System 0.5";
lpParms->lpstrReturn = "Open Sound System 0.5";
break;
case MCI_WAVE_OUTPUT:
lpParms->lpstrReturn = "Linux Sound System 0.5";
lpParms->lpstrReturn = "Open Sound System 0.5";
break;
default:
return MCIERR_UNRECOGNIZED_COMMAND;
......@@ -799,7 +794,7 @@ static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS16 lpCaps, DWORD dwSize)
#else
lpCaps->wMid = 0x00FF; /* Manufac ID */
lpCaps->wPid = 0x0001; /* Product ID */
strcpy(lpCaps->szPname, "Linux WAVOUT Driver");
strcpy(lpCaps->szPname, "OpenSoundSystem WAVOUT Driver");
#endif
lpCaps->vDriverVersion = 0x0100;
lpCaps->dwFormats = 0x00000000;
......@@ -1213,8 +1208,6 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam)
return MMSYSERR_NOERROR;
}
#endif /* linux || __FreeBSD__*/
/**************************************************************************
* wodMessage [sample driver]
*/
......@@ -1223,7 +1216,6 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
{
dprintf_mciwave(stddeb,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
#if defined(linux) || defined(__FreeBSD__)
switch(wMsg) {
case WODM_OPEN:
return wodOpen(wDevID, (LPWAVEOPENDESC)dwParam1, dwParam2);
......@@ -1267,16 +1259,11 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
dprintf_mciwave(stddeb,"wodMessage // unknown message !\n");
}
return MMSYSERR_NOTSUPPORTED;
#else
return MMSYSERR_NOTENABLED;
#endif
}
/*-----------------------------------------------------------------------*/
#if defined(linux) || defined(__FreeBSD__)
/**************************************************************************
* widGetDevCaps [internal]
*/
......@@ -1297,7 +1284,7 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS16 lpCaps, DWORD dwSize)
#else
lpCaps->wMid = 0x00FF; /* Manufac ID */
lpCaps->wPid = 0x0001; /* Product ID */
strcpy(lpCaps->szPname, "Linux WAVIN Driver");
strcpy(lpCaps->szPname, "OpenSoundSystem WAVIN Driver");
#endif
lpCaps->dwFormats = 0x00000000;
lpCaps->wChannels = (IOCTL(audio, SNDCTL_DSP_STEREO, dsp_stereo) != 0) ? 1 : 2;
......@@ -1688,8 +1675,6 @@ dprintf_mciwave(stddeb,"widGetPosition // TIME_SMPTE=%02u:%02u:%02u:%02u\n",
return MMSYSERR_NOERROR;
}
#endif /* linux || __FreeBSD__ */
/**************************************************************************
* widMessage [sample driver]
*/
......@@ -1698,7 +1683,6 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
{
dprintf_mciwave(stddeb,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
#if defined(linux) || defined(__FreeBSD__)
switch(wMsg) {
case WIDM_OPEN:
return widOpen(wDevID, (LPWAVEOPENDESC)dwParam1, dwParam2);
......@@ -1728,9 +1712,6 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
dprintf_mciwave(stddeb,"widMessage // unknown message !\n");
}
return MMSYSERR_NOTSUPPORTED;
#else
return MMSYSERR_NOTENABLED;
#endif
}
......@@ -1740,7 +1721,6 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
#if defined(linux) || defined(__FreeBSD__)
dprintf_mciwave(stddeb,"WAVE_DriverProc(%08lX, %04X, %04X, %08lX, %08lX)\n",
dwDevID, hDriv, wMsg, dwParam1, dwParam2);
switch(wMsg) {
......@@ -1831,7 +1811,39 @@ LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
}
#else
return MMSYSERR_NOTENABLED;
#endif
}
#else /* !HAVE_OSS */
/**************************************************************************
* wodMessage [sample driver]
*/
DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
fprintf(stderr,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
return MMSYSERR_NOTENABLED;
}
/**************************************************************************
* widMessage [sample driver]
*/
DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2)
{
fprintf(stderr,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
return MMSYSERR_NOTENABLED;
}
/**************************************************************************
* AUDIO_DriverProc [sample driver]
*/
LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
return MMSYSERR_NOTENABLED;
}
#endif /* HAVE_OSS */
......@@ -26,9 +26,6 @@
/* GCs used for B&W and color bitmap operations */
GC BITMAP_monoGC = 0, BITMAP_colorGC = 0;
extern void CLIPPING_UpdateGCRegion( DC * dc ); /* objects/clipping.c */
/***********************************************************************
* XPutImage_wrapper
*
......
......@@ -505,6 +505,8 @@ INT16 WINAPI RestoreVisRgn( HDC16 hdc )
HRGN32 saved;
RGNOBJ *obj, *savedObj;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
INT16 ret;
if (!dc) return ERROR;
if (!dc->w.hVisRgn)
{
......@@ -533,6 +535,7 @@ INT16 WINAPI RestoreVisRgn( HDC16 hdc )
dc->w.hVisRgn = saved;
CLIPPING_UpdateGCRegion( dc );
GDI_HEAP_UNLOCK( hdc );
ret = savedObj->rgn->type; /* FIXME */
GDI_HEAP_UNLOCK( saved );
return savedObj->xrgn ? COMPLEXREGION : NULLREGION;
return ret;
}
......@@ -42,6 +42,7 @@
#include "debug.h"
#include "task.h"
#include "user.h"
#include "keyboard.h"
extern UINT16 COLOR_GetSystemPaletteSize();
......@@ -1243,6 +1244,18 @@ void WINAPI GetCursorPos16( POINT16 *pt )
{
pt->x = childX;
pt->y = childY;
if (mousebut & Button1Mask)
AsyncMouseButtonsStates[0] = MouseButtonsStates[0] = TRUE;
else
MouseButtonsStates[0] = FALSE;
if (mousebut & Button2Mask)
AsyncMouseButtonsStates[1] = MouseButtonsStates[1] = TRUE;
else
MouseButtonsStates[1] = FALSE;
if (mousebut & Button3Mask)
AsyncMouseButtonsStates[2] = MouseButtonsStates[2] = TRUE;
else
MouseButtonsStates[2] = FALSE;
}
dprintf_cursor(stddeb, "GetCursorPos: ret=%d,%d\n", pt->x, pt->y );
}
......
......@@ -1420,6 +1420,8 @@ HBITMAP32 WINAPI CreateDIBSection32 (HDC32 hdc, BITMAPINFO *bmi, UINT32 usage,
hdc,bmi->bmiHeader.biWidth,bmi->bmiHeader.biHeight,
usage,bits,section,offset
);
if (bmi->bmiHeader.biHeight < 0 ) bmi->bmiHeader.biHeight = -bmi->bmiHeader.biHeight;
if (bmi->bmiHeader.biWidth < 0 ) bmi->bmiHeader.biWidth = -bmi->bmiHeader.biWidth;
/* FIXME. The following line isn't quite right. */
res = CreateDIBitmap32 (hdc, &bmi->bmiHeader, 0, NULL, bmi, 0);
if (res)
......@@ -1429,6 +1431,9 @@ HBITMAP32 WINAPI CreateDIBSection32 (HDC32 hdc, BITMAPINFO *bmi, UINT32 usage,
{
/* FIXME: this is wrong! (bmBits is always NULL) */
if (bits) *bits = bmp.bmBits;
/* hmpf */
fprintf(stderr,"allocating %d bytes of memory\n",bmi->bmiHeader.biWidth*bmi->bmiHeader.biHeight*4);
if (bits) *bits = (LPBYTE)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,bmi->bmiHeader.biWidth*bmi->bmiHeader.biHeight*4);
return res;
}
}
......
......@@ -8,6 +8,7 @@
#include <string.h>
#include <fcntl.h>
#include "windows.h"
#include "gdi.h"
#include "bitmap.h"
#include "file.h"
......@@ -233,16 +234,15 @@ BOOL16 WINAPI IsValidMetaFile(HMETAFILE16 hmf)
/******************************************************************
* PlayMetafile16 (GDI.123)
* PlayMetaFile16 (GDI.123)
*/
BOOL16 WINAPI PlayMetaFile16( HDC16 hdc, HMETAFILE16 hmf )
{
return PlayMetaFile32( hdc, hmf );
}
/******************************************************************
* PlayMetafile32 (GDI32.265)
* PlayMetaFile32 (GDI32.265)
*/
BOOL32 WINAPI PlayMetaFile32( HDC32 hdc, HMETAFILE32 hmf )
{
......@@ -256,9 +256,8 @@ BOOL32 WINAPI PlayMetaFile32( HDC32 hdc, HMETAFILE32 hmf )
HBRUSH32 hBrush;
HFONT32 hFont;
DC *dc;
dprintf_metafile(stddeb,"PlayMetaFile(%04x %04x)\n",hdc,hmf);
if (!mh) return FALSE;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
hPen = dc->w.hPen;
......@@ -270,13 +269,14 @@ BOOL32 WINAPI PlayMetaFile32( HDC32 hdc, HMETAFILE32 hmf )
sizeof(HANDLETABLE16) * mh->mtNoObjects);
ht = (HANDLETABLE16 *)GlobalLock16(hHT);
/* loop through metafile playing records */
offset = mh->mtHeaderSize * 2;
while (offset < mh->mtSize * 2)
{
mr = (METARECORD *)((char *)mh + offset);
dprintf_metafile(stddeb,"offset = %04x size = %08lx function = %04x\n",
offset,mr->rdSize,mr->rdFunction);
mr = (METARECORD *)((char *)mh + offset);
dprintf_metafile(stddeb,"offset = %04x size = %08lx\n",
offset, mr->rdSize);
if (!mr->rdSize) {
fprintf(stderr,"METAFILE entry got size 0 at offset %d, total mf length is %ld\n",offset,mh->mtSize*2);
break; /* would loop endlessly otherwise */
......@@ -368,6 +368,7 @@ BOOL16 WINAPI EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf,
return TRUE;
}
static BOOL32 MF_Meta_CreateRegion( METARECORD *mr, HRGN32 hrgn );
/******************************************************************
* PlayMetaFileRecord16 (GDI.176)
......@@ -380,8 +381,9 @@ void WINAPI PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
char *ptr;
BITMAPINFOHEADER *infohdr;
dprintf_metafile(stddeb,"PlayMetaFileRecord(%04x %08lx %08lx %04x)\n",
hdc,(LONG)ht, (LONG)mr, nHandles);
dprintf_metafile(stddeb,
"PlayMetaFileRecord(%04x %08lx %08lx %04x) function %04x\n",
hdc,(LONG)ht, (LONG)mr, nHandles, mr->rdFunction);
switch (mr->rdFunction)
{
......@@ -420,6 +422,7 @@ void WINAPI PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
case META_SETSTRETCHBLTMODE:
SetStretchBltMode16(hdc, *(mr->rdParam));
break;
case META_SETTEXTCOLOR:
SetTextColor16(hdc, MAKELONG(*(mr->rdParam), *(mr->rdParam + 1)));
break;
......@@ -732,23 +735,13 @@ void WINAPI PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
/* --- Begin of new metafile operations. April, 1997 (ak) ----*/
case META_CREATEREGION:
{
int i;
HRGN32 h2,hrgn=CreateRectRgn32(mr->rdParam[7],mr->rdParam[8],
mr->rdParam[9],mr->rdParam[10]);
for (i = 0; i < mr->rdParam[5]; i++)
{
if (mr->rdParam[11+i*6]==2)
{
h2=CreateRectRgn32(mr->rdParam[14+i*6],mr->rdParam[12+i*6],
mr->rdParam[15+i*6],mr->rdParam[13+i*6]);
CombineRgn32(hrgn,hrgn,h2,mr->rdParam[16+i*6]); /* e.g. RGN_OR */
DeleteObject32( h2 );
}
}
MF_AddHandle(ht, nHandles,hrgn);
}
break;
{
HRGN32 hrgn = CreateRectRgn32(0,0,0,0);
MF_Meta_CreateRegion(mr, hrgn);
MF_AddHandle(ht, nHandles, hrgn);
}
break;
case META_FILLREGION:
FillRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)),
......@@ -861,6 +854,79 @@ HMETAFILE16 WINAPI SetMetaFileBitsBetter( HMETAFILE16 hMeta )
}
/******************************************************************
* MF_Meta_CreateRegion
*
* Handles META_CREATEREGION for PlayMetaFileRecord().
*/
/*
* The layout of the record looks something like this:
*
* rdParam meaning
* 0 Always 0?
* 1 Always 6?
* 2 Looks like a handle? - not constant
* 3 0 or 1 ??
* 4 Total number of bytes
* 5 No. of seperate bands = n [see below]
* 6 Largest number of x co-ords in a band
* 7-10 Bounding box x1 y1 x2 y2
* 11-... n bands
*
* Regions are divided into bands that are uniform in the
* y-direction. Each band consists of pairs of on/off x-coords and is
* written as
* m y0 y1 x1 x2 x3 ... xm m
* into successive rdParam[]s.
*
* This is probably just a dump of the internal RGNOBJ?
*
* HDMD - 18/12/97
*
*/
static BOOL32 MF_Meta_CreateRegion( METARECORD *mr, HRGN32 hrgn )
{
WORD band, pair;
WORD *start, *end;
INT16 y0, y1;
HRGN32 hrgn2 = CreateRectRgn32( 0, 0, 0, 0 );
for(band = 0, start = &(mr->rdParam[11]); band < mr->rdParam[5];
band++, start = end + 1) {
if(*start / 2 != (*start + 1) / 2) {
fprintf(stderr, "META_CREATEREGION: delimiter not even.\n");
DeleteObject32( hrgn2 );
return FALSE;
}
end = start + *start + 3;
if(end > (WORD *)mr + mr->rdSize) {
fprintf(stderr, "META_CREATEREGION: end points outside record.\n");
DeleteObject32( hrgn2 );
return FALSE;
}
if(*start != *end) {
fprintf(stderr, "META_CREATEREGION: mismatched delimiters.\n");
DeleteObject32( hrgn2 );
return FALSE;
}
y0 = *(INT16 *)(start + 1);
y1 = *(INT16 *)(start + 2);
for(pair = 0; pair < *start / 2; pair++) {
SetRectRgn32( hrgn2, *(INT16 *)(start + 3 + 2*pair), y0,
*(INT16 *)(start + 4 + 2*pair), y1 );
CombineRgn32(hrgn, hrgn, hrgn2, RGN_OR);
}
}
DeleteObject32( hrgn2 );
return TRUE;
}
/******************************************************************
* MF_WriteRecord
*
* Warning: this function can change the metafile handle.
......@@ -1389,3 +1455,88 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
}
/******************************************************************
* MF_CreateRegion
*/
INT16 MF_CreateRegion(DC *dc, HRGN32 hrgn)
{
DWORD len;
METARECORD *mr;
RGNDATA *rgndata;
RECT32 *pCurRect, *pEndRect;
WORD Bands = 0, MaxBands = 0;
WORD *Param, *StartBand;
BOOL32 ret;
len = GetRegionData( hrgn, 0, NULL );
if( !(rgndata = HeapAlloc( SystemHeap, 0, len )) ) {
fprintf(stderr, "MF_CreateRegion: can't alloc rgndata buffer\n");
return -1;
}
GetRegionData( hrgn, len, rgndata );
/* Overestimate of length:
* Assume every rect is a separate band -> 6 WORDs per rect
*/
len = sizeof(METARECORD) + 20 + (rgndata->rdh.nCount * 12);
if( !(mr = HeapAlloc( SystemHeap, 0, len )) ) {
fprintf(stderr, "MF_CreateRegion: can't alloc METARECORD buffer\n");
HeapFree( SystemHeap, 0, rgndata );
return -1;
}
memset(mr, 0, len);
Param = mr->rdParam + 11;
StartBand = NULL;
pEndRect = (RECT32 *)rgndata->Buffer + rgndata->rdh.nCount;
for(pCurRect = (RECT32 *)rgndata->Buffer; pCurRect < pEndRect; pCurRect++)
{
if( StartBand && pCurRect->top == *(StartBand + 1) )
{
*Param++ = pCurRect->left;
*Param++ = pCurRect->right;
}
else
{
if(StartBand)
{
*StartBand = Param - StartBand - 3;
*Param++ = *StartBand;
if(*StartBand > MaxBands)
MaxBands = *StartBand;
Bands++;
}
StartBand = Param++;
*Param++ = pCurRect->top;
*Param++ = pCurRect->bottom;
*Param++ = pCurRect->left;
*Param++ = pCurRect->right;
}
}
len = Param - (WORD *)mr;
mr->rdParam[0] = 0;
mr->rdParam[1] = 6;
mr->rdParam[2] = 0x1234;
mr->rdParam[3] = 0;
mr->rdParam[4] = len * 2;
mr->rdParam[5] = Bands;
mr->rdParam[6] = MaxBands;
mr->rdParam[7] = rgndata->rdh.rcBound.left;
mr->rdParam[8] = rgndata->rdh.rcBound.top;
mr->rdParam[9] = rgndata->rdh.rcBound.right;
mr->rdParam[10] = rgndata->rdh.rcBound.bottom;
mr->rdFunction = META_CREATEREGION;
mr->rdSize = len / 2;
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2 );
HeapFree( SystemHeap, 0, mr );
HeapFree( SystemHeap, 0, rgndata );
if(!ret)
{
fprintf(stderr, "MF_CreateRegion: MF_WriteRecord failed\n");
return -1;
}
return MF_AddHandleDC( dc );
}
......@@ -2,7 +2,7 @@
* Notepad (English resources)
*
* Copyright 1997 Marcel Baur <mbaur@g26.ethz.ch>
* FIXME: See TODO about how to fix weak translations.
* Proofread 1998 by David Lee Lambert <lamber45@egr.msu.edu>
*/
#define LANGUAGE_ID En
......@@ -13,9 +13,9 @@
#define MENU_FILE "&File"
#define MENU_FILE_NEW "&New..."
#define MENU_FILE_OPEN "O&pen"
#define MENU_FILE_OPEN "&Open"
#define MENU_FILE_SAVE "&Save"
#define MENU_FILE_SAVEAS "&Save as..."
#define MENU_FILE_SAVEAS "Save &as..."
#define MENU_FILE_PRINT "&Print"
#define MENU_FILE_PAGESETUP "Page Se&tup..."
#define MENU_FILE_PRINTSETUP "P&rinter Setup..."
......@@ -23,7 +23,7 @@
#define MENU_EDIT "&Edit"
#define MENU_EDIT_UNDO "&Undo\tCtrl+Z"
#define MENU_EDIT_CUT "Cu&t\Ctrl+X"
#define MENU_EDIT_CUT "Cu&t\tCtrl+X"
#define MENU_EDIT_COPY "&Copy\tCtrl+C"
#define MENU_EDIT_PASTE "&Paste\tCtrl+V"
#define MENU_EDIT_DELETE "&Delete\tDel"
......@@ -57,7 +57,7 @@
#define DIALOG_PAGESETUP_CAPTION "Page Setup"
#define DIALOG_PAGESETUP_HEAD "&Header:"
#define DIALOG_PAGESETUP_TAIL "&Footer:"
#define DIALOG_PAGESETUP_BORDER "Borders:"
#define DIALOG_PAGESETUP_BORDER "&Margins:"
#define DIALOG_PAGESETUP_LEFT "&Left:"
#define DIALOG_PAGESETUP_RIGHT "&Right:"
#define DIALOG_PAGESETUP_TOP "&Top:"
......@@ -75,7 +75,7 @@
#define STRING_ALLFILES "All files (*.*)"
#define STRING_TEXTFILES "Text files (*.txt)"
#define STRING_TOOLARGE "File '%s' ist too large for notepad.\n \
#define STRING_TOOLARGE "File '%s' is too large for notepad.\n \
Please use a different editor."
#define STRING_NOTEXT "You didn't enter any text. \
......@@ -89,3 +89,7 @@ memory."
#include "notepad.rc"
......@@ -51,10 +51,12 @@ CONCAT(MENU_, LANGUAGE_ID) MENU
MENUITEM MENU_HELP_HELP_ON_HELP, NP_HELP_ON_HELP
MENUITEM SEPARATOR
POPUP MENU_INFO {
MENUITEM MENU_INFO_LICENSE, NP_HELP_LICENSE
MENUITEM MENU_INFO_NO_WARRANTY, NP_HELP_NO_WARRANTY
MENUITEM MENU_INFO_ABOUT_WINE, NP_HELP_ABOUT_WINE
POPUP MENU_INFO {
MENUITEM MENU_INFO_LICENSE, NP_HELP_LICENSE
MENUITEM MENU_INFO_NO_WARRANTY, NP_HELP_NO_WARRANTY
MENUITEM MENU_INFO_ABOUT_WINE, NP_HELP_ABOUT_WINE
}
}
}
......@@ -120,6 +120,7 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll )
DEBUG_ENTRY_POINT *debug;
REG_ENTRY_POINT *regs;
PE_MODREF *pem;
PDB32 *pdb = PROCESS_Current();
INT32 i, size;
BYTE *addr;
......@@ -278,8 +279,8 @@ static HMODULE32 BUILTIN32_DoLoadModule( BUILTIN32_DLL *dll )
sizeof(*pem) );
pem->module = (HMODULE32)addr;
pem->pe_export = exp;
pem->next = pCurrentProcess->modref_list;
pCurrentProcess->modref_list = pem;
pem->next = pdb->modref_list;
pdb->modref_list = pem;
/* Create a Win16 dummy module */
......
......@@ -98,7 +98,7 @@ type win32
91 stdcall Escape(long long long ptr ptr) Escape32
92 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32
93 stdcall ExtCreatePen(long long ptr long ptr) ExtCreatePen32
94 stub ExtCreateRegion
94 stdcall ExtCreateRegion(ptr long ptr) ExtCreateRegion
95 stdcall ExtEscape(long long long ptr long ptr) ExtEscape32
96 stdcall ExtFloodFill(long long long long long) ExtFloodFill32
97 stub ExtSelectClipRgn
......
......@@ -14,6 +14,22 @@
#include "stddebug.h"
#include "debug.h"
static void _dumpstr(unsigned char *s) {
fputs("\"",stdout);
while (*s) {
if (*s<' ') {
printf("\\0x%02x",*s++);
continue;
}
if (*s=='\\') {
fputs("\\\\",stdout);
s++;
continue;
}
fputc(*s++,stdout);
}
fputs("\"",stdout);
}
/***********************************************************************
* RELAY_CallFrom32
......@@ -52,9 +68,14 @@ int RELAY_CallFrom32( int ret_addr, ... )
{
char buff[80];
lstrcpynWtoA( buff, (LPWSTR)args[i], sizeof(buff) );
printf( "%08x L\"%s\"", args[i], buff );
buff[sizeof(buff)-1]='\0';
printf( "%08x L", args[i] );
_dumpstr((unsigned char*)buff);
}
else {
printf( "%08x ", args[i] );
_dumpstr((unsigned char*)args[i]);
}
else printf( "%08x \"%s\"", args[i], (char *)args[i] );
}
else printf( "%08x", args[i] );
}
......
......@@ -281,7 +281,7 @@ type win32
276 stdcall GetNextDlgTabItem(long long long) GetNextDlgTabItem32
277 stdcall GetOpenClipboardWindow() GetOpenClipboardWindow32
278 stdcall GetParent(long) GetParent32
279 stub GetPriorityClipboardFormat
279 stdcall GetPriorityClipboardFormat(ptr long) GetPriorityClipboardFormat32
280 stub GetProcessWindowStation
281 stdcall GetPropA(long ptr) GetProp32A
282 stdcall GetPropW(long ptr) GetProp32W
......
name wow32
type win32
1 stub WOW_1
2 stub WOWCallback16
1 stdcall WOW_1(long long) WOW32_1
2 stdcall WOWCallback16(long long) WOWCallback16
3 stub WOWCallback16Ex
4 stub WOWDirectedYield16
5 stub WOWGetVDMPointer
6 stub WOWGetVDMPointerFix
7 stub WOWGetVDMPointerUnfix
5 stdcall WOWGetVDMPointer(long long long) WOWGetVDMPointer
6 stdcall WOWGetVDMPointerFix(long long long) WOWGetVDMPointerFix
7 stdcall WOWGetVDMPointerUnfix(long) WOWGetVDMPointerUnfix
8 stub WOWGlobalAlloc16
9 stub WOWGlobalAllocLock16
10 stub WOWGlobalFree16
......
......@@ -13,6 +13,7 @@ C_SRCS = \
process.c \
semaphore.c \
synchro.c \
sysdeps.c \
thread.c
all: $(MODULE).o
......
......@@ -28,9 +28,17 @@ typedef struct
BOOL32 signaled;
} CRIT_SECTION;
/* On some systems this is supposed to be defined in the program */
#ifndef HAVE_UNION_SEMUN
union semun {
int val;
struct semid_ds *buf;
ushort *array;
};
#endif
static BOOL32 CRIT_SECTION_Signaled( K32OBJ *obj, DWORD thread_id );
static void CRIT_SECTION_Satisfied( K32OBJ *obj, DWORD thread_id );
static BOOL32 CRIT_SECTION_Satisfied( K32OBJ *obj, DWORD thread_id );
static void CRIT_SECTION_AddWait( K32OBJ *obj, DWORD thread_id );
static void CRIT_SECTION_RemoveWait( K32OBJ *obj, DWORD thread_id );
static void CRIT_SECTION_Destroy( K32OBJ *obj );
......@@ -237,12 +245,13 @@ static BOOL32 CRIT_SECTION_Signaled( K32OBJ *obj, DWORD thread_id )
*
* Wait on this object has been satisfied.
*/
static void CRIT_SECTION_Satisfied( K32OBJ *obj, DWORD thread_id )
static BOOL32 CRIT_SECTION_Satisfied( K32OBJ *obj, DWORD thread_id )
{
CRIT_SECTION *crit = (CRIT_SECTION *)obj;
assert( obj->type == K32OBJ_CRITICAL_SECTION );
/* Only one thread is allowed to wake up */
crit->signaled = FALSE;
return FALSE; /* Not abandoned */
}
......
......@@ -21,7 +21,7 @@ typedef struct
} EVENT;
static BOOL32 EVENT_Signaled( K32OBJ *obj, DWORD thread_id );
static void EVENT_Satisfied( K32OBJ *obj, DWORD thread_id );
static BOOL32 EVENT_Satisfied( K32OBJ *obj, DWORD thread_id );
static void EVENT_AddWait( K32OBJ *obj, DWORD thread_id );
static void EVENT_RemoveWait( K32OBJ *obj, DWORD thread_id );
static void EVENT_Destroy( K32OBJ *obj );
......@@ -219,12 +219,13 @@ static BOOL32 EVENT_Signaled( K32OBJ *obj, DWORD thread_id )
*
* Wait on this object has been satisfied.
*/
static void EVENT_Satisfied( K32OBJ *obj, DWORD thread_id )
static BOOL32 EVENT_Satisfied( K32OBJ *obj, DWORD thread_id )
{
EVENT *event = (EVENT *)obj;
assert( obj->type == K32OBJ_EVENT );
/* Reset if it's an auto-reset event */
if (!event->manual_reset) event->signaled = FALSE;
return FALSE; /* Not abandoned */
}
......
......@@ -12,16 +12,19 @@
#include "thread.h"
#include "heap.h"
typedef struct
typedef struct _MUTEX
{
K32OBJ header;
THREAD_QUEUE wait_queue;
DWORD owner;
DWORD count;
K32OBJ header;
THREAD_QUEUE wait_queue;
DWORD owner;
DWORD count;
BOOL32 abandoned;
struct _MUTEX *next;
struct _MUTEX *prev;
} MUTEX;
static BOOL32 MUTEX_Signaled( K32OBJ *obj, DWORD thread_id );
static void MUTEX_Satisfied( K32OBJ *obj, DWORD thread_id );
static BOOL32 MUTEX_Satisfied( K32OBJ *obj, DWORD thread_id );
static void MUTEX_AddWait( K32OBJ *obj, DWORD thread_id );
static void MUTEX_RemoveWait( K32OBJ *obj, DWORD thread_id );
static void MUTEX_Destroy( K32OBJ *obj );
......@@ -37,6 +40,40 @@ const K32OBJ_OPS MUTEX_Ops =
/***********************************************************************
* MUTEX_Release
*
* Release a mutex once the count is 0.
* Helper function for MUTEX_Abandon and ReleaseMutex.
*/
static void MUTEX_Release( MUTEX *mutex )
{
/* Remove the mutex from the thread list of owned mutexes */
if (mutex->next) mutex->next->prev = mutex->prev;
if (mutex->prev) mutex->prev->next = mutex->next;
else THREAD_Current()->mutex_list = &mutex->next->header;
mutex->next = mutex->prev = NULL;
mutex->owner = 0;
SYNC_WakeUp( &mutex->wait_queue, INFINITE32 );
}
/***********************************************************************
* MUTEX_Abandon
*
* Abandon a mutex.
*/
void MUTEX_Abandon( K32OBJ *obj )
{
MUTEX *mutex = (MUTEX *)obj;
assert( obj->type == K32OBJ_MUTEX );
assert( mutex->count && (mutex->owner == GetCurrentThreadId()) );
mutex->count = 0;
mutex->abandoned = TRUE;
MUTEX_Release( mutex );
}
/***********************************************************************
* CreateMutex32A (KERNEL32.166)
*/
HANDLE32 WINAPI CreateMutex32A( SECURITY_ATTRIBUTES *sa, BOOL32 owner,
......@@ -52,18 +89,27 @@ HANDLE32 WINAPI CreateMutex32A( SECURITY_ATTRIBUTES *sa, BOOL32 owner,
{
/* Finish initializing it */
mutex->wait_queue = NULL;
mutex->abandoned = FALSE;
mutex->prev = NULL;
if (owner)
{
K32OBJ **list;
mutex->owner = GetCurrentThreadId();
mutex->count = 1;
/* Add the mutex in the thread list of owned mutexes */
list = &THREAD_Current()->mutex_list;
if ((mutex->next = (MUTEX *)*list)) mutex->next->prev = mutex;
*list = &mutex->header;
}
else
{
mutex->owner = 0;
mutex->count = 0;
mutex->next = NULL;
}
K32OBJ_DecCount( &mutex->header );
}
SetLastError(0); /* FIXME */
SYSTEM_UNLOCK();
return handle;
}
......@@ -130,11 +176,7 @@ BOOL32 WINAPI ReleaseMutex( HANDLE32 handle )
SetLastError( ERROR_NOT_OWNER );
return FALSE;
}
if (!--mutex->count)
{
mutex->owner = 0;
SYNC_WakeUp( &mutex->wait_queue, INFINITE32 );
}
if (!--mutex->count) MUTEX_Release( mutex );
K32OBJ_DecCount( &mutex->header );
SYSTEM_UNLOCK();
return TRUE;
......@@ -157,13 +199,25 @@ static BOOL32 MUTEX_Signaled( K32OBJ *obj, DWORD thread_id )
*
* Wait on this object has been satisfied.
*/
static void MUTEX_Satisfied( K32OBJ *obj, DWORD thread_id )
static BOOL32 MUTEX_Satisfied( K32OBJ *obj, DWORD thread_id )
{
BOOL32 ret;
MUTEX *mutex = (MUTEX *)obj;
assert( obj->type == K32OBJ_MUTEX );
assert( !mutex->count || (mutex->owner == thread_id) );
mutex->owner = thread_id;
mutex->count++;
if (!mutex->count++)
{
/* Add the mutex in the thread list of owned mutexes */
K32OBJ **list = &THREAD_ID_TO_THDB( thread_id )->mutex_list;
assert( !mutex->next );
if ((mutex->next = (MUTEX *)*list)) mutex->next->prev = mutex;
*list = &mutex->header;
mutex->prev = NULL;
}
ret = mutex->abandoned;
mutex->abandoned = FALSE;
return ret;
}
......
......@@ -21,7 +21,7 @@ typedef struct
} SEMAPHORE;
static BOOL32 SEMAPHORE_Signaled( K32OBJ *obj, DWORD thread_id );
static void SEMAPHORE_Satisfied( K32OBJ *obj, DWORD thread_id );
static BOOL32 SEMAPHORE_Satisfied( K32OBJ *obj, DWORD thread_id );
static void SEMAPHORE_AddWait( K32OBJ *obj, DWORD thread_id );
static void SEMAPHORE_RemoveWait( K32OBJ *obj, DWORD thread_id );
static void SEMAPHORE_Destroy( K32OBJ *obj );
......@@ -165,12 +165,13 @@ static BOOL32 SEMAPHORE_Signaled( K32OBJ *obj, DWORD thread_id )
*
* Wait on this object has been satisfied.
*/
static void SEMAPHORE_Satisfied( K32OBJ *obj, DWORD thread_id )
static BOOL32 SEMAPHORE_Satisfied( K32OBJ *obj, DWORD thread_id )
{
SEMAPHORE *sem = (SEMAPHORE *)obj;
assert( obj->type == K32OBJ_SEMAPHORE );
assert( sem->count > 0 );
sem->count--;
return FALSE; /* Not abandoned */
}
......
......@@ -88,7 +88,8 @@ static BOOL32 SYNC_CheckCondition( WAIT_STRUCT *wait, DWORD thread_id )
/* Wait satisfied: tell it to all objects */
wait->signaled = WAIT_OBJECT_0;
for (i = 0, ptr = wait->objs; i < wait->count; i++, ptr++)
K32OBJ_OPS( *ptr )->satisfied( *ptr, thread_id );
if (K32OBJ_OPS( *ptr )->satisfied( *ptr, thread_id ))
wait->signaled = WAIT_ABANDONED_0;
SYSTEM_UNLOCK();
return TRUE;
}
......@@ -100,7 +101,8 @@ static BOOL32 SYNC_CheckCondition( WAIT_STRUCT *wait, DWORD thread_id )
{
/* Wait satisfied: tell it to the object */
wait->signaled = WAIT_OBJECT_0 + i;
K32OBJ_OPS( *ptr )->satisfied( *ptr, thread_id );
if (K32OBJ_OPS( *ptr )->satisfied( *ptr, thread_id ))
wait->signaled = WAIT_ABANDONED_0 + i;
SYSTEM_UNLOCK();
return TRUE;
}
......
/*
* System-dependent scheduler support
*
* Copyright 1998 Alexandre Julliard
*/
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "thread.h"
#ifdef __linux__
# ifdef HAVE_SCHED_H
# include <sched.h>
# endif
# ifndef CLONE_VM
# define CLONE_VM 0x00000100
# define CLONE_FS 0x00000200
# define CLONE_FILES 0x00000400
# define CLONE_SIGHAND 0x00000800
# define CLONE_PID 0x00001000
/* If we didn't get the flags, we probably didn't get the prototype either */
extern int clone( int (*fn)(void *arg), void *stack, int flags, void *arg );
# endif /* CLONE_VM */
#endif /* __linux__ */
#ifdef __linux__
/***********************************************************************
* __errno_location
*
* Get the per-thread errno location.
*/
int *__errno_location()
{
static int static_errno;
THDB *thdb = THREAD_Current();
if (!thdb) return &static_errno;
return &thdb->thread_errno;
}
/***********************************************************************
* __h_errno_location
*
* Get the per-thread h_errno location.
*/
int *__h_errno_location()
{
static int static_h_errno;
THDB *thdb = THREAD_Current();
if (!thdb) return &static_h_errno;
return &thdb->thread_h_errno;
}
/***********************************************************************
* SYSDEPS_StartThread
*
* Startup routine for a new thread.
*/
static void SYSDEPS_StartThread( THDB *thdb )
{
LPTHREAD_START_ROUTINE func = (LPTHREAD_START_ROUTINE)thdb->entry_point;
thdb->unix_pid = getpid();
SET_FS( thdb->teb_sel );
ExitThread( func( thdb->entry_arg ) );
}
#endif /* __linux__ */
/***********************************************************************
* SYSDEPS_SpawnThread
*
* Start running a new thread.
* Return -1 on error, 0 if OK.
*/
int SYSDEPS_SpawnThread( THDB *thread )
{
#ifdef __linux__
if (clone( (int (*)(void *))SYSDEPS_StartThread, thread->teb.stack_top,
CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, thread ) < 0)
return -1;
#else
fprintf( stderr, "CreateThread: stub\n" );
#endif /* __linux__ */
return 0;
}
/***********************************************************************
* SYSDEPS_ExitThread
*
* Exit a running thread; must not return.
*/
void SYSDEPS_ExitThread(void)
{
_exit( 0 );
}
/**********************************************************************
* NtCurrentTeb (NTDLL.89)
*/
TEB * WINAPI NtCurrentTeb(void)
{
#ifdef __i386__
TEB *teb;
WORD ds, fs;
/* Check if we have a current thread */
GET_DS( ds );
GET_FS( fs );
if (fs == ds) return NULL; /* FIXME: should be an assert */
/* Get the TEB self-pointer */
__asm__( ".byte 0x64\n\tmovl (%1),%0"
: "=r" (teb) : "r" (&((TEB *)0)->self) );
return teb;
#else
if (!pCurrentThread) return NULL;
return &pCurrentThread->teb;
#endif /* __i386__ */
}
......@@ -18,27 +18,12 @@
#include "debug.h"
#include "stddebug.h"
#ifdef HAVE_CLONE
# ifdef HAVE_SCHED_H
# include <sched.h>
# endif
# ifndef CLONE_VM
# define CLONE_VM 0x00000100
# define CLONE_FS 0x00000200
# define CLONE_FILES 0x00000400
# define CLONE_SIGHAND 0x00000800
# define CLONE_PID 0x00001000
/* If we didn't get the flags, we probably didn't get the prototype either */
extern int clone( int (*fn)(void *arg), void *stack, int flags, void *arg );
# endif /* CLONE_VM */
#endif /* HAVE_CLONE */
#ifndef __i386__
THDB *pCurrentThread;
#endif
static BOOL32 THREAD_Signaled( K32OBJ *obj, DWORD thread_id );
static void THREAD_Satisfied( K32OBJ *obj, DWORD thread_id );
static BOOL32 THREAD_Satisfied( K32OBJ *obj, DWORD thread_id );
static void THREAD_AddWait( K32OBJ *obj, DWORD thread_id );
static void THREAD_RemoveWait( K32OBJ *obj, DWORD thread_id );
static void THREAD_Destroy( K32OBJ *obj );
......@@ -73,28 +58,6 @@ static THDB *THREAD_GetPtr( HANDLE32 handle )
}
/**********************************************************************
* NtCurrentTeb (NTDLL.89)
*/
TEB * WINAPI NtCurrentTeb(void)
{
#ifdef __i386__
TEB *teb;
WORD ds, fs;
/* Check if we have a current thread */
GET_DS( ds );
GET_FS( fs );
if (fs == ds) return NULL; /* FIXME: should be an assert */
__asm__( "movl %%fs:(24),%0" : "=r" (teb) );
return teb;
#else
if (!pCurrentThread) return NULL;
return &pCurrentThread->teb;
#endif /* __i386__ */
}
/***********************************************************************
* THREAD_Current
*
......@@ -181,7 +144,6 @@ THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size,
thdb->teb.self = &thdb->teb;
thdb->teb.tls_ptr = thdb->tls_array;
thdb->wait_list = &thdb->wait_struct;
thdb->process2 = pdb;
thdb->exit_code = 0x103; /* STILL_ACTIVE */
thdb->entry_point = start_addr;
thdb->entry_arg = param;
......@@ -234,20 +196,6 @@ error:
/***********************************************************************
* THREAD_Start
*
* Startup routine for a new thread.
*/
static void THREAD_Start( THDB *thdb )
{
LPTHREAD_START_ROUTINE func = (LPTHREAD_START_ROUTINE)thdb->entry_point;
thdb->unix_pid = getpid();
SET_FS( thdb->teb_sel );
ExitThread( func( thdb->entry_arg ) );
}
/***********************************************************************
* THREAD_Signaled
*/
static BOOL32 THREAD_Signaled( K32OBJ *obj, DWORD thread_id )
......@@ -263,7 +211,7 @@ static BOOL32 THREAD_Signaled( K32OBJ *obj, DWORD thread_id )
*
* Wait on this object has been satisfied.
*/
static void THREAD_Satisfied( K32OBJ *obj, DWORD thread_id )
static BOOL32 THREAD_Satisfied( K32OBJ *obj, DWORD thread_id )
{
THDB *thdb = (THDB *)obj;
assert( obj->type == K32OBJ_THREAD );
......@@ -336,26 +284,17 @@ HANDLE32 WINAPI CreateThread( LPSECURITY_ATTRIBUTES attribs, DWORD stack,
DWORD flags, LPDWORD id )
{
HANDLE32 handle;
THDB *thread = THREAD_Create( pCurrentProcess, stack, start, param );
THDB *thread = THREAD_Create( PROCESS_Current(), stack, start, param );
if (!thread) return INVALID_HANDLE_VALUE32;
handle = PROCESS_AllocHandle( &thread->header, 0 );
if (handle == INVALID_HANDLE_VALUE32)
{
K32OBJ_DecCount( &thread->header );
return INVALID_HANDLE_VALUE32;
}
#ifdef HAVE_CLONE
if (clone( (int (*)(void *))THREAD_Start, thread->teb.stack_top,
CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD, thread ) < 0)
{
K32OBJ_DecCount( &thread->header );
return INVALID_HANDLE_VALUE32;
}
#else
fprintf( stderr, "CreateThread: stub\n" );
#endif /* __linux__ */
if (handle == INVALID_HANDLE_VALUE32) goto error;
if (SYSDEPS_SpawnThread( thread ) == -1) goto error;
*id = THDB_TO_THREAD_ID( thread );
return handle;
error:
K32OBJ_DecCount( &thread->header );
return INVALID_HANDLE_VALUE32;
}
......@@ -370,12 +309,16 @@ void WINAPI ExitThread( DWORD code )
SYSTEM_LOCK();
thdb->exit_code = code;
EVENT_Set( thdb->event );
/* Abandon all owned mutexes */
while (thdb->mutex_list) MUTEX_Abandon( thdb->mutex_list );
/* FIXME: should free the stack somehow */
K32OBJ_DecCount( &thdb->header );
/* Completely unlock the system lock just in case */
count = SYSTEM_LOCK_COUNT();
while (count--) SYSTEM_UNLOCK();
_exit( 0 );
SYSDEPS_ExitThread();
}
......
......@@ -7,7 +7,7 @@
$IPC_RMID=0;
$USER=$ENV{USER};
do open_pipe(IPCS,"ipcs");
open(IPCS,"ipcs|");
#
# The following part is OS dependant, it works under linux only.
......@@ -60,33 +60,3 @@ foreach (@sem) {
foreach (@msq) {
msgctl($_, $IPC_RMID,0);
}
exit(0);
sub open_pipe {
local($pid);
local($handle,@params)=@_;
pipe($handle,WRITE) || die "can't pipe";
$pid=fork();
die "can't fork" if ($pid<0);
if ($pid>0) {
# whe are in the parent
close(WRITE);
waitpid($pid,0) || print "$params[0] exits status=$? ",$? >> 8, "\n";
} else {
# we are in the son.
open(STDOUT,">&WRITE");
open(STDERR, ">&WRITE");
close($handle);
close(WRITE);
exec(@params);
exit(-1);
}
}
......@@ -13,7 +13,7 @@
#include "task.h"
#include "stddebug.h"
#include "debug.h"
#include "process.h" /* for pCurrentProcess */
#include "process.h" /* for PROCESS_Current() */
/***********************************************************************
......@@ -21,7 +21,7 @@
*/
LPCSTR WINAPI GetCommandLine32A(void)
{
return pCurrentProcess->env_db->cmd_line;
return PROCESS_Current()->env_db->cmd_line;
}
/***********************************************************************
......
......@@ -188,12 +188,13 @@ void EXC_RaiseException( CONTEXT *context )
DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers)
{
char message[80];
PDB32 *pdb = PROCESS_Current();
/* FIXME: Should check if the process is being debugged */
if (pCurrentProcess && pCurrentProcess->top_filter)
if (pdb->top_filter)
{
DWORD ret = pCurrentProcess->top_filter( epointers );
DWORD ret = pdb->top_filter( epointers );
if (ret != EXCEPTION_CONTINUE_SEARCH) return ret;
}
......@@ -213,7 +214,8 @@ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers)
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(
LPTOP_LEVEL_EXCEPTION_FILTER filter )
{
LPTOP_LEVEL_EXCEPTION_FILTER old = pCurrentProcess->top_filter;
pCurrentProcess->top_filter = filter;
PDB32 *pdb = PROCESS_Current();
LPTOP_LEVEL_EXCEPTION_FILTER old = pdb->top_filter;
pdb->top_filter = filter;
return old;
}
......@@ -161,23 +161,22 @@ UINT32 WINAPI ThunkConnect32( struct thunkstruct *ths, LPSTR thunkfun16,
*/
VOID WINAPI QT_Thunk(CONTEXT *context)
{
CONTEXT context16;
DWORD argsize;
CONTEXT context16;
DWORD argsize;
memcpy(&context16,context,sizeof(context16));
memcpy(&context16,context,sizeof(context16));
CS_reg(&context16) = HIWORD(EDX_reg(context));
IP_reg(&context16) = LOWORD(EDX_reg(context));
CS_reg(&context16) = HIWORD(EDX_reg(context));
IP_reg(&context16) = LOWORD(EDX_reg(context));
EBP_reg(&context16) = OFFSETOF(IF1632_Saved16_ss_sp)
+ (WORD)&((STACK16FRAME*)0)->bp;
argsize = EBP_reg(context)-ESP_reg(context)-0x44;
argsize = EBP_reg(context)-ESP_reg(context)-0x44;
/* additional 4 bytes used by the relaycode for storing the stackptr */
memcpy( ((LPBYTE)CURRENT_STACK16)-argsize-4,
(LPBYTE)ESP_reg(context)+4,
argsize
);
EAX_reg(context) = Callbacks->CallRegisterShortProc(&context16,
-argsize);
memcpy( ((LPBYTE)CURRENT_STACK16)-argsize,
(LPBYTE)ESP_reg(context)+4, argsize );
EAX_reg(context) = Callbacks->CallRegisterShortProc( &context16, argsize );
}
......@@ -569,7 +568,7 @@ AllocSLCallback(DWORD finalizer,DWORD callback) {
*x++=0x66;*x++=0x52; /* pushl edx */
*x++=0xea;*(DWORD*)x=callback;x+=4; /* jmpf callback */
*(PDB32**)(thunk+18) = pCurrentProcess;
*(PDB32**)(thunk+18) = PROCESS_Current();
sel = SELECTOR_AllocBlock( thunk , 32, SEGMENT_CODE, FALSE, FALSE );
return (sel<<16)|0;
......
......@@ -8,7 +8,10 @@
at a later date. */
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include "windows.h"
#include "winnt.h"
#include "winerror.h"
#include "stddebug.h"
#include "debug.h"
......@@ -37,16 +40,18 @@ BOOL32 WINAPI UTUnRegister(HMODULE32 hModule)
return TRUE;
}
/****************************************************************************
* QueryPerformanceCounter (KERNEL32.564)
*/
BOOL32 WINAPI QueryPerformanceCounter(LPLARGE_INTEGER counter)
{
/* FIXME: don't know what are good values */
counter->LowPart = 0;
counter->HighPart = 0;
/* FIXME: Set appropriate error */
return FALSE;
struct timeval tv;
gettimeofday(&tv,NULL);
counter->LowPart = tv.tv_usec+tv.tv_sec*1000000;
counter->HighPart = 0;
return TRUE;
}
HANDLE32 WINAPI FindFirstChangeNotification32A(LPCSTR lpPathName,BOOL32 bWatchSubtree,DWORD dwNotifyFilter) {
......@@ -66,11 +71,9 @@ BOOL32 WINAPI FindNextChangeNotification(HANDLE32 fcnhandle) {
*/
BOOL32 WINAPI QueryPerformanceFrequency(LPLARGE_INTEGER frequency)
{
/* FIXME: don't know what are good values */
frequency->LowPart = 0;
frequency->LowPart = 1000000;
frequency->HighPart = 0;
/* FIXME: Set appropriate error */
return FALSE;
return TRUE;
}
/****************************************************************************
......
......@@ -52,11 +52,7 @@ DWORD WINAPI _KERNEL32_18(DWORD processid,DWORD action)
fprintf(stderr,"KERNEL32_18(%ld,%ld+0x38)\n",processid,action);
if (action>56)
return 0;
if (!processid) {
process=pCurrentProcess;
/* check if valid process */
} else
process=(PDB32*)pCurrentProcess; /* decrypt too, if needed */
if (!(process = PROCESS_IdToPDB( processid ))) return 0;
switch (action) {
case 0: /* return app compat flags */
pTask = (TDB*)GlobalLock16(process->task);
......
......@@ -871,13 +871,24 @@ INT16 WINAPI GetPriorityClipboardFormat16( UINT16 *lpPriorityList, INT16 nCount)
/**************************************************************************
* GetPriorityClipboardFormat32 (USER32
* GetPriorityClipboardFormat32 (USER32.279)
*/
INT32 WINAPI GetPriorityClipboardFormat32( UINT32 *lpPriorityList, INT32 nCount )
{
fprintf( stderr, "GetPriorityClipboardFormat32(%p, %d): stub\n",
lpPriorityList, nCount );
return 0;
int Counter;
if(CountClipboardFormats32() == 0)
{
return 0;
}
for(Counter = 0; Counter <= nCount; Counter++)
{
if(IsClipboardFormatAvailable32(*(lpPriorityList+sizeof(INT32)*Counter)))
return *(lpPriorityList+sizeof(INT32)*Counter);
}
return -1;
}
......
......@@ -340,6 +340,15 @@ BOOL32 PAINT_RedrawWindow( HWND32 hwnd, const RECT32 *rectUpdate,
if (flags & RDW_FRAME) wndPtr->flags |= WIN_NEEDS_NCPAINT;
/* restrict update region to client area (FIXME: correct?) */
if (wndPtr->hrgnUpdate)
{
HRGN32 clientRgn = CreateRectRgnIndirect32( &rectClient );
rgnNotEmpty = CombineRgn32( wndPtr->hrgnUpdate, clientRgn,
wndPtr->hrgnUpdate, RGN_AND );
DeleteObject32( clientRgn );
}
/* check for bogus update region */
if ( rgnNotEmpty == NULLREGION )
{
......
......@@ -2128,7 +2128,7 @@ BOOL16 WINAPI EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func,
*/
BOOL32 WINAPI EnumThreadWindows( DWORD id, WNDENUMPROC32 func, LPARAM lParam )
{
THDB *tdb = (THDB*)id;
THDB *tdb = THREAD_ID_TO_THDB(id);
return (BOOL16)EnumTaskWindows16(tdb->teb.htask16, (WNDENUMPROC16)func, lParam);
}
......
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