Release 970415

Mon Apr 14 11:22:54 1997  John Harvey <john@division.co.uk>

	* [graphics/win16drv/init.c]
	Minor changes to help debug problems.

	* [if1632/dummy.c] [if1632/gdi.spec]
	Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.

	* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
	StartDoc16, EndDoc16 new functions.

Sun Apr 13 11:18:35 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [memory/virtual.c]
	Implemented MapViewOfFile.

	* [debugger/dbg.y]
	Added 'info maps' command.

Fri Apr 11 16:34:08 1997  Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>

	* [controls/edit.c] [controls/EDIT.TODO]
	Started restructuring.  Performance improvements.
	Fixed:	wordwrap, scrollbar handling, scrolling, painting,
		EditWndProc() is now reentrant, wordbreak procs,
		better compliance to specs.
	New:	margins, format rectangle.

	* [controls/widgets.c]
	Changed the cursor for the edit control class to an I-beam.

	* [include/callback.h]
	Added 32 bit wordbreak callback.

Mon Apr  7 20:53:28 1997  Albrecht Kleine  <kleine@ak.sax.de>

	* [objects/metafile.c]
	Added handling of some more metafile records: 
	META_CREATEREGION, META_INVERTREGION etc.

Sat Apr  5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>

	* [loader/signal.c]
	Define kernel sigaction ourselves instead of getting it
	from the kernel source.

Wed Apr  2 21:05:00 1997  Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [control/menu.c]
	Fix return value range for GetMenuState.

	* [files/file.c]
	Always fill out ofs->szPathName in FILE_DoOpenFile.

	* [memory/string.c]
	Add debug option string.

	* [objects/cursoricon.c]
	Fix return value for DestroyIcon32.

Mon Mar 31 17:16:12 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
	Added description of the source tree. Moved several
	files to fit it.

	* [misc/shell.c]
	Use Win32 heap functions.
This commit is contained in:
Alexandre Julliard 1997-04-15 17:19:52 +00:00
parent df2673b7e0
commit 889f74244d
60 changed files with 4003 additions and 3557 deletions

View File

@ -1,14 +1,13 @@
This is release 970329 of Wine, the MS Windows emulator. This is still a
This is release 970415 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-970329: (see ChangeLog for details)
- Win32 event/mutex/semaphore functions.
- Rewritten combobox.
- Portuguese language support.
WHAT'S NEW with Wine-970415: (see ChangeLog for details)
- Edit control improvements.
- Some files moved around.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -17,11 +16,11 @@ 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-970329.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970329.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970329.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-970329.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-970329.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-970415.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-970415.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-970415.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-970415.tar.gz
ftp://ftp.progsoc.uts.edu.au/pub/Wine/development/Wine-970415.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

View File

@ -1,3 +1,73 @@
----------------------------------------------------------------------
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
----------------------------------------------------------------------
Fri Mar 28 14:18:32 1997 Alexandre Julliard <julliard@lrc.epfl.ch>

View File

@ -1,6 +1,66 @@
This is intended to be a document to help new developers get started.
Existing developers should feel free to add their comments.
SOURCE TREE STRUCTURE
=====================
Source tree is loosely based on the original Windows modules. Most
directories are shared between the binary emulator and the library.
Shared directories:
-------------------
KERNEL:
files/ - file I/O
loader/ - Win16-, Win32-binary loader
memory/ - memory management
msdos/ - DOS and BIOS emulation
scheduler/ - process and thread management
GDI:
graphics/ - graphics drivers
graphics/x11drv/ - X11 display driver
graphics/metafiledrv/ - metafile driver
objects/ - logical objects
USER:
controls/ - built-in widgets
resources/ - built-in dialog resources
windows/ - window management
Miscellaneous:
misc/ - shell, registry, winsock, etc...
multimedia/ - multimedia driver
ipc/ - SysV IPC management
win32/ - misc Win32 functions
Tools:
rc/ - resource compiler
tools/ - relay code builder + misc tools
documentation/ - some documentation
Emulator-specific directories:
------------------------------
debugger/ - built-in debugger
if1632/ - relay code
miscemu/ - hardware instruction emulation
graphics/win16drv/ - Win16 printer driver
Winelib-specific directories:
-----------------------------
library/ - Winelib-specific routines (should disappear)
programs/ - utilities (Progman, WinHelp)
libtest/ - Winelib test samples
MEMORY AND SEGMENTS
===================

View File

@ -1,3 +1,16 @@
/*
* Outdated !!!
*
* The edit control is under reconstruction
* New documentation will be provided when I'm done
*
* Please contact me before you send in bug fixes, as the code
* might have changed already. However, keep reporting those
* bugs ... I might not know about them, yet.
*
* Frans van Dorsselaer
* dorssel@MolPhys.LeidenUniv.nl
*/
This file gives some information about the code in edit.c. If you want to
change, add, or fix code, please read this text. If you're not interested
in doing actual work on edit.c only C & D will be of interest to you.

File diff suppressed because it is too large Load Diff

View File

@ -1517,7 +1517,7 @@ static LRESULT LISTBOX_Directory( WND *wnd, LB_DESCR *descr, UINT32 attrib,
FindClose32( handle );
}
if ((ret == LB_OKAY) && (attrib & DDL_DRIVES))
if ((ret >= 0) && (attrib & DDL_DRIVES))
{
char buffer[] = "[-a-]";
int drive;

View File

@ -2325,7 +2325,9 @@ UINT32 GetMenuState32( HMENU32 hMenu, UINT32 wItemID, UINT32 wFlags )
if (!menu) return -1;
else return (menu->nItems << 8) | (menu->wFlags & 0xff);
}
else return item->item_flags;
else
/* Non POPUP Menus only return flags in the lower byte */
return (item->item_flags & 0x00ff);
}

View File

@ -61,31 +61,31 @@ static WNDCLASS32A WIDGETS_BuiltinClasses32[BIC32_NB_CLASSES] =
{
/* BIC32_BUTTON */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, 0, 0, 0, "Button" },
ButtonWndProc, 0, sizeof(BUTTONINFO), 0, 0, IDC_ARROW, 0, 0, "Button" },
/* BIC32_EDIT */
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
EditWndProc, 0, sizeof(void *), 0, 0, 0, 0, 0, "Edit" },
EditWndProc, 0, sizeof(void *), 0, 0, IDC_IBEAM, 0, 0, "Edit" },
/* BIC32_LISTBOX */
{ CS_GLOBALCLASS | CS_DBLCLKS /*| CS_PARENTDC*/,
ListBoxWndProc, 0, sizeof(void *), 0, 0, 0, 0, 0, "ListBox" },
ListBoxWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ListBox" },
/* BIC32_COMBO */
{ CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
ComboWndProc, 0, sizeof(void *), 0, 0, 0, 0, 0, "ComboBox" },
ComboWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboBox" },
/* BIC32_COMBOLB */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
ComboLBWndProc, 0, sizeof(void *), 0, 0, 0, 0, 0, "ComboLBox" },
ComboLBWndProc, 0, sizeof(void *), 0, 0, IDC_ARROW, 0, 0, "ComboLBox" },
/* BIC32_POPUPMENU */
{ CS_GLOBALCLASS | CS_SAVEBITS, PopupMenuWndProc,
0, sizeof(HMENU32), 0, 0, 0, 0, 0, POPUPMENU_CLASS_NAME },
0, sizeof(HMENU32), 0, 0, IDC_ARROW, 0, 0, POPUPMENU_CLASS_NAME },
/* BIC32_SCROLL */
{ CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, 0, 0, 0, "ScrollBar"},
ScrollBarWndProc, 0, sizeof(SCROLLBAR_INFO), 0, 0, IDC_ARROW, 0, 0, "ScrollBar"},
/* BIC32_DESKTOP */
{ CS_GLOBALCLASS, DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, 0, DESKTOP_CLASS_NAME },
0, 0, IDC_ARROW, 0, 0, DESKTOP_CLASS_NAME },
/* BIC32_DIALOG */
{ CS_GLOBALCLASS | CS_SAVEBITS, DefDlgProc32A, 0, DLGWINDOWEXTRA,
0, 0, 0, 0, 0, DIALOG_CLASS_NAME }
0, 0, IDC_ARROW, 0, 0, DIALOG_CLASS_NAME }
};
static ATOM bicAtomTable[BIC32_NB_CLASSES];
@ -142,7 +142,7 @@ BOOL32 WIDGETS_Init(void)
/* Just to make sure the string is > 0x10000 */
strcpy( name, (char *)class32->lpszClassName );
class32->lpszClassName = name;
class32->hCursor = LoadCursor16( 0, IDC_ARROW );
class32->hCursor = LoadCursor16( 0, class32->hCursor );
if (!(bicAtomTable[i] = RegisterClass32A( class32 ))) return FALSE;
}

View File

@ -32,6 +32,8 @@ void flush_symbols(void);
int yylex(void);
int yyerror(char *);
extern void VIRTUAL_Dump(void); /* memory/virtual.c */
%}
%union
@ -47,7 +49,7 @@ int yyerror(char *);
%token tCONT tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tINFO tWALK tUP tDOWN
%token tENABLE tDISABLE tBREAK tDELETE tSET tMODE tPRINT tEXAM tABORT
%token tCLASS tMODULE tSTACK tSEGMENTS tREGS tWND tQUEUE tLOCAL
%token tCLASS tMAPS tMODULE tSTACK tSEGMENTS tREGS tWND tQUEUE tLOCAL
%token tEOL tSTRING
%token tFRAME tSHARE tCOND tDISPLAY tUNDISPLAY tDISASSEMBLE
%token tSTEPI tNEXTI tFINISH tSHOW tDIR
@ -259,6 +261,7 @@ info_command:
DEBUG_FreeExprMem(); }
| tINFO tSEGMENTS tEOL { LDT_Print( 0, -1 ); }
| tINFO tSTACK tEOL { DEBUG_InfoStack(); }
| tINFO tMAPS tEOL { VIRTUAL_Dump(); }
| tINFO tWND expr_value tEOL { WIN_DumpWindow( $3 );
DEBUG_FreeExprMem(); }
| tINFO tLOCAL tEOL { DEBUG_InfoLocals(); }

View File

@ -140,7 +140,7 @@ $gs { yylval.reg = REG_GS; return tREG; }
<INITIAL>mode { BEGIN(NOCMD); return tMODE; }
<INITIAL>show|sho|sh { BEGIN(SHOW_CMD); return tSHOW; }
<INFO_CMD,INITIAL>break|brea|bre|br|b { BEGIN(PATH_EXPECTED); return tBREAK; }
<INITIAL,INFO_CMD,DEL_CMD>break|brea|bre|br|b { BEGIN(PATH_EXPECTED); return tBREAK; }
<INFO_CMD>share|shar|sha { return tSHARE; }
<INFO_CMD>locals|local|loca|loc { return tLOCAL; }
@ -150,6 +150,7 @@ $gs { yylval.reg = REG_GS; return tREG; }
<INFO_CMD>registers|regs|reg|re { return tREGS; }
<INFO_CMD>segments|segment|segm|seg|se { return tSEGMENTS; }
<INFO_CMD>stack|stac|sta|st { return tSTACK; }
<INFO_CMD>maps|map { return tMAPS; }
<INFO_CMD,WALK_CMD>window|windo|wind|win|wnd { return tWND; }
<HELP_CMD>info|inf|in { return tINFO; }

View File

@ -175,6 +175,7 @@ void DEBUG_HelpInfo(void)
" info break Dumps information about breakpoints",
" info display Shows auto-display expressions in use",
" info locals Displays values of all local vars for current frame",
" info maps Dumps all virtual memory mappings",
" info module Displays information about all modules",
" info queue <handle> Dumps queue information",
" info reg Displays values in all registers at top of stack",

View File

@ -608,12 +608,16 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
if (mode & OF_REOPEN) name = ofs->szPathName;
dprintf_file( stddeb, "OpenFile: %s %04x\n", name, mode );
/* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName
Are there any cases where getting the path here is wrong?
Uwe Bonnes 1997 Apr 2 */
if (!GetFullPathName32A( name, sizeof(ofs->szPathName),
ofs->szPathName, NULL )) goto error;
/* OF_PARSE simply fills the structure */
if (mode & OF_PARSE)
{
if (!GetFullPathName32A( name, sizeof(ofs->szPathName),
ofs->szPathName, NULL )) goto error;
ofs->fFixedDisk = (GetDriveType16( ofs->szPathName[0]-'A' )
!= DRIVE_REMOVABLE);
dprintf_file( stddeb, "OpenFile(%s): OF_PARSE, res = '%s'\n",
@ -628,8 +632,6 @@ static HFILE32 FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT32 mode,
{
if ((hFileRet = FILE_Create(name,0666,FALSE))== INVALID_HANDLE_VALUE32)
goto error;
GetFullPathName32A( name, sizeof(ofs->szPathName),
ofs->szPathName, NULL );
goto success;
}
@ -704,7 +706,8 @@ not_found: /* We get here if the file does not exist */
error: /* We get here if there was an error opening the file */
ofs->nErrCode = DOS_ExtendedError;
dprintf_file( stddeb, "OpenFile(%s): return = HFILE_ERROR\n", name );
dprintf_file( stddeb, "OpenFile(%s): return = HFILE_ERROR error= %d\n",
name,ofs->nErrCode );
return HFILE_ERROR32;
}

View File

@ -8,7 +8,10 @@ MODULE = graphics
C_SRCS = \
bitblt.c \
driver.c \
escape.c \
fontengine.c \
mapping.c \
painting.c \
wing.c
all: $(MODULE).o

View File

@ -23,6 +23,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
MFDRV_Ellipse, /* pEllipse */
NULL, /* pEnumDeviceFonts */
NULL, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */

766
graphics/painting.c Normal file
View File

@ -0,0 +1,766 @@
/*
* Misc. graphics operations
*
* Copyright 1993, 1994 Alexandre Julliard
*/
#include <math.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
#ifndef PI
#define PI M_PI
#endif
#include "gdi.h"
#include "dc.h"
#include "bitmap.h"
#include "callback.h"
#include "metafile.h"
#include "syscolor.h"
#include "palette.h"
#include "color.h"
#include "region.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
/***********************************************************************
* LineTo16 (GDI.19)
*/
BOOL16 LineTo16( HDC16 hdc, INT16 x, INT16 y )
{
return LineTo32( hdc, x, y );
}
/***********************************************************************
* LineTo32 (GDI32.249)
*/
BOOL32 LineTo32( HDC32 hdc, INT32 x, INT32 y )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pLineTo &&
dc->funcs->pLineTo(dc,x,y);
}
/***********************************************************************
* MoveTo (GDI.20)
*/
DWORD MoveTo( HDC16 hdc, INT16 x, INT16 y )
{
POINT16 pt;
if (!MoveToEx16(hdc,x,y,&pt))
return 0;
return MAKELONG(pt.x,pt.y);
}
/***********************************************************************
* MoveToEx16 (GDI.483)
*/
BOOL16 MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
{
POINT32 pt32;
if (!MoveToEx32( (HDC32)hdc, (INT32)x, (INT32)y, &pt32 )) return FALSE;
if (pt) CONV_POINT32TO16( &pt32, pt );
return TRUE;
}
/***********************************************************************
* MoveToEx32 (GDI32.254)
*/
BOOL32 MoveToEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pMoveToEx &&
dc->funcs->pMoveToEx(dc,x,y,pt);
}
/***********************************************************************
* Arc16 (GDI.23)
*/
BOOL16 Arc16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom,
INT16 xstart, INT16 ystart, INT16 xend, INT16 yend )
{
return Arc32( (HDC32)hdc, (INT32)left, (INT32)top, (INT32)right,
(INT32)bottom, (INT32)xstart, (INT32)ystart, (INT32)xend,
(INT32)yend );
}
/***********************************************************************
* Arc32 (GDI32.7)
*/
BOOL32 Arc32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pArc &&
dc->funcs->pArc(dc,left,top,right,bottom,xstart,ystart,xend,yend);
}
/***********************************************************************
* Pie16 (GDI.26)
*/
BOOL16 Pie16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom,
INT16 xstart, INT16 ystart, INT16 xend, INT16 yend )
{
return Pie32( (HDC32)hdc, (INT32)left, (INT32)top, (INT32)right,
(INT32)bottom, (INT32)xstart, (INT32)ystart, (INT32)xend,
(INT32)yend );
}
/***********************************************************************
* Pie32 (GDI32.262)
*/
BOOL32 Pie32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPie &&
dc->funcs->pPie(dc,left,top,right,bottom,xstart,ystart,xend,yend);
}
/***********************************************************************
* Chord16 (GDI.348)
*/
BOOL16 Chord16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom,
INT16 xstart, INT16 ystart, INT16 xend, INT16 yend )
{
return Chord32( hdc, left, top, right, bottom, xstart, ystart, xend, yend );
}
/***********************************************************************
* Chord32 (GDI32.14)
*/
BOOL32 Chord32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pChord &&
dc->funcs->pChord(dc,left,top,right,bottom,xstart,ystart,xend,yend);
}
/***********************************************************************
* Ellipse16 (GDI.24)
*/
BOOL16 Ellipse16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom )
{
return Ellipse32( hdc, left, top, right, bottom );
}
/***********************************************************************
* Ellipse32 (GDI32.75)
*/
BOOL32 Ellipse32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pEllipse &&
dc->funcs->pEllipse(dc,left,top,right,bottom);
}
/***********************************************************************
* Rectangle16 (GDI.27)
*/
BOOL16 Rectangle16(HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom)
{
return Rectangle32( hdc, left, top, right, bottom );
}
/***********************************************************************
* Rectangle32 (GDI32.283)
*/
BOOL32 Rectangle32(HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom)
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pRectangle &&
dc->funcs->pRectangle(dc,left,top,right,bottom);
}
/***********************************************************************
* RoundRect16 (GDI.28)
*/
BOOL16 RoundRect16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
INT16 bottom, INT16 ell_width, INT16 ell_height )
{
return RoundRect32( hdc, left, top, right, bottom, ell_width, ell_height );
}
/***********************************************************************
* RoundRect32 (GDI32.291)
*/
BOOL32 RoundRect32( HDC32 hdc, INT32 left, INT32 top, INT32 right,
INT32 bottom, INT32 ell_width, INT32 ell_height )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pRoundRect &&
dc->funcs->pRoundRect(dc,left,top,right,bottom,ell_width,ell_height);
}
/***********************************************************************
* FillRect16 (USER.81)
*/
INT16 FillRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
{
HBRUSH16 prevBrush;
/* coordinates are logical so we cannot fast-check 'rect',
* it will be done later in the PatBlt().
*/
if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
SelectObject16( hdc, prevBrush );
return 1;
}
/***********************************************************************
* FillRect32 (USER32.196)
*/
INT32 FillRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
{
HBRUSH32 prevBrush;
if (!(prevBrush = SelectObject32( hdc, hbrush ))) return 0;
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
SelectObject32( hdc, prevBrush );
return 1;
}
/***********************************************************************
* InvertRect16 (USER.82)
*/
void InvertRect16( HDC16 hdc, const RECT16 *rect )
{
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
}
/***********************************************************************
* InvertRect32 (USER32.329)
*/
void InvertRect32( HDC32 hdc, const RECT32 *rect )
{
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
}
/***********************************************************************
* FrameRect16 (USER.83)
*/
INT16 FrameRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
{
HBRUSH16 prevBrush;
int left, top, right, bottom;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
left = XLPTODP( dc, rect->left );
top = YLPTODP( dc, rect->top );
right = XLPTODP( dc, rect->right );
bottom = YLPTODP( dc, rect->bottom );
if ( (right <= left) || (bottom <= top) ) return 0;
if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
if (DC_SetupGCForBrush( dc ))
{
PatBlt32( hdc, rect->left, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->right - 1, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, 1, PATCOPY );
PatBlt32( hdc, rect->left, rect->bottom - 1,
rect->right - rect->left, 1, PATCOPY );
}
SelectObject16( hdc, prevBrush );
return 1;
}
/***********************************************************************
* FrameRect32 (USER32.202)
*/
INT32 FrameRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
{
RECT16 rect16;
CONV_RECT32TO16( rect, &rect16 );
return FrameRect16( (HDC16)hdc, &rect16, (HBRUSH16)hbrush );
}
/***********************************************************************
* SetPixel16 (GDI.31)
*/
COLORREF SetPixel16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
{
return SetPixel32( hdc, x, y, color );
}
/***********************************************************************
* SetPixel32 (GDI32.327)
*/
COLORREF SetPixel32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
{
DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pSetPixel) return 0;
return dc->funcs->pSetPixel(dc,x,y,color);
}
/***********************************************************************
* GetPixel16 (GDI.83)
*/
COLORREF GetPixel16( HDC16 hdc, INT16 x, INT16 y )
{
return GetPixel32( hdc, x, y );
}
/***********************************************************************
* GetPixel32 (GDI32.211)
*/
COLORREF GetPixel32( HDC32 hdc, INT32 x, INT32 y )
{
DC * dc = DC_GetDCPtr( hdc );
if (!dc) return 0;
#ifdef SOLITAIRE_SPEED_HACK
return 0;
#endif
/* FIXME: should this be in the graphics driver? */
if (!PtVisible32( hdc, x, y )) return 0;
if (!dc || !dc->funcs->pGetPixel) return 0;
return dc->funcs->pGetPixel(dc,x,y);
}
/***********************************************************************
* PaintRgn16 (GDI.43)
*/
BOOL16 PaintRgn16( HDC16 hdc, HRGN16 hrgn )
{
return PaintRgn32( hdc, hrgn );
}
/***********************************************************************
* PaintRgn32 (GDI32.259)
*/
BOOL32 PaintRgn32( HDC32 hdc, HRGN32 hrgn )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPaintRgn &&
dc->funcs->pPaintRgn(dc,hrgn);
}
/***********************************************************************
* FillRgn16 (GDI.40)
*/
BOOL16 FillRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush )
{
return FillRgn32( hdc, hrgn, hbrush );
}
/***********************************************************************
* FillRgn32 (GDI32.101)
*/
BOOL32 FillRgn32( HDC32 hdc, HRGN32 hrgn, HBRUSH32 hbrush )
{
BOOL32 retval;
HBRUSH32 prevBrush = SelectObject32( hdc, hbrush );
if (!prevBrush) return FALSE;
retval = PaintRgn32( hdc, hrgn );
SelectObject32( hdc, prevBrush );
return retval;
}
/***********************************************************************
* FrameRgn16 (GDI.41)
*/
BOOL16 FrameRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush,
INT16 nWidth, INT16 nHeight )
{
return FrameRgn32( hdc, hrgn, hbrush, nWidth, nHeight );
}
/***********************************************************************
* FrameRgn32 (GDI32.105)
*/
BOOL32 FrameRgn32( HDC32 hdc, HRGN32 hrgn, HBRUSH32 hbrush,
INT32 nWidth, INT32 nHeight )
{
HRGN32 tmp = CreateRectRgn32( 0, 0, 0, 0 );
if(!REGION_FrameRgn( tmp, hrgn, nWidth, nHeight )) return FALSE;
FillRgn32( hdc, tmp, hbrush );
DeleteObject32( tmp );
return TRUE;
}
/***********************************************************************
* InvertRgn16 (GDI.42)
*/
BOOL16 InvertRgn16( HDC16 hdc, HRGN16 hrgn )
{
return InvertRgn32( hdc, hrgn );
}
/***********************************************************************
* InvertRgn32 (GDI32.246)
*/
BOOL32 InvertRgn32( HDC32 hdc, HRGN32 hrgn )
{
HBRUSH32 prevBrush = SelectObject32( hdc, GetStockObject32(BLACK_BRUSH) );
INT32 prevROP = SetROP232( hdc, R2_NOT );
BOOL32 retval = PaintRgn32( hdc, hrgn );
SelectObject32( hdc, prevBrush );
SetROP232( hdc, prevROP );
return retval;
}
/***********************************************************************
* DrawFocusRect16 (USER.466)
*/
void DrawFocusRect16( HDC16 hdc, const RECT16* rc )
{
RECT32 rect32;
CONV_RECT16TO32( rc, &rect32 );
DrawFocusRect32( hdc, &rect32 );
}
/***********************************************************************
* DrawFocusRect32 (USER32.155)
*
* FIXME: should use Rectangle32!
*/
void DrawFocusRect32( HDC32 hdc, const RECT32* rc )
{
HPEN32 hOldPen;
INT32 oldDrawMode, oldBkMode;
INT32 left, top, right, bottom;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return;
left = XLPTODP( dc, rc->left );
top = YLPTODP( dc, rc->top );
right = XLPTODP( dc, rc->right );
bottom = YLPTODP( dc, rc->bottom );
hOldPen = SelectObject32( hdc, sysColorObjects.hpenWindowText );
oldDrawMode = SetROP232(hdc, R2_XORPEN);
oldBkMode = SetBkMode32(hdc, TRANSPARENT);
/* Hack: make sure the XORPEN operation has an effect */
dc->u.x.pen.pixel = (1 << screenDepth) - 1;
if (DC_SetupGCForPen( dc ))
XDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
SetBkMode32(hdc, oldBkMode);
SetROP232(hdc, oldDrawMode);
SelectObject32(hdc, hOldPen);
}
/**********************************************************************
* Polyline16 (GDI.37)
*/
BOOL16 Polyline16( HDC16 hdc, LPPOINT16 pt, INT16 count )
{
register int i;
LPPOINT32 pt32 = (LPPOINT32)xmalloc(count*sizeof(POINT32));
BOOL16 ret;
for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
ret = Polyline32(hdc,pt32,count);
free(pt32);
return ret;
}
/**********************************************************************
* Polyline32 (GDI32.276)
*/
BOOL32 Polyline32( HDC32 hdc, const LPPOINT32 pt, INT32 count )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolyline &&
dc->funcs->pPolyline(dc,pt,count);
}
/**********************************************************************
* Polygon16 (GDI.36)
*/
BOOL16 Polygon16( HDC16 hdc, LPPOINT16 pt, INT16 count )
{
register int i;
LPPOINT32 pt32 = (LPPOINT32)xmalloc(count*sizeof(POINT32));
BOOL32 ret;
for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
ret = Polygon32(hdc,pt32,count);
free(pt32);
return ret;
}
/**********************************************************************
* Polygon32 (GDI32.275)
*/
BOOL32 Polygon32( HDC32 hdc, LPPOINT32 pt, INT32 count )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolygon &&
dc->funcs->pPolygon(dc,pt,count);
}
/**********************************************************************
* PolyPolygon16 (GDI.450)
*/
BOOL16 PolyPolygon16( HDC16 hdc, LPPOINT16 pt, LPINT16 counts, UINT16 polygons)
{
int i,nrpts;
LPPOINT32 pt32;
LPINT32 counts32;
BOOL16 ret;
nrpts=0;
for (i=polygons;i--;)
nrpts+=counts[i];
pt32 = (LPPOINT32)xmalloc(sizeof(POINT32)*nrpts);
for (i=nrpts;i--;)
CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
counts32 = (LPINT32)xmalloc(polygons*sizeof(INT32));
for (i=polygons;i--;) counts32[i]=counts[i];
ret = PolyPolygon32(hdc,pt32,counts32,polygons);
free(counts32);
free(pt32);
return ret;
}
/**********************************************************************
* PolyPolygon32 (GDI.450)
*/
BOOL32 PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons)
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolyPolygon &&
dc->funcs->pPolyPolygon(dc,pt,counts,polygons);
}
/**********************************************************************
* ExtFloodFill16 (GDI.372)
*/
BOOL16 ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
UINT16 fillType )
{
return ExtFloodFill32( hdc, x, y, color, fillType );
}
/**********************************************************************
* ExtFloodFill32 (GDI32.96)
*/
BOOL32 ExtFloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color,
UINT32 fillType )
{
DC *dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pExtFloodFill &&
dc->funcs->pExtFloodFill(dc,x,y,color,fillType);
}
/**********************************************************************
* FloodFill16 (GDI.25)
*/
BOOL16 FloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
{
return ExtFloodFill32( hdc, x, y, color, FLOODFILLBORDER );
}
/**********************************************************************
* FloodFill32 (GDI32.104)
*/
BOOL32 FloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
{
return ExtFloodFill32( hdc, x, y, color, FLOODFILLBORDER );
}
/**********************************************************************
* DrawEdge16 (USER.659)
*/
BOOL16 DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
{
RECT32 rect32;
BOOL32 ret;
CONV_RECT16TO32( rc, &rect32 );
ret = DrawEdge32( hdc, &rect32, edge, flags );
CONV_RECT32TO16( &rect32, rc );
return ret;
}
/**********************************************************************
* DrawEdge32 (USER32.154)
*/
BOOL32 DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
HBRUSH32 hbrushOld;
if (flags >= BF_DIAGONAL)
fprintf( stderr, "DrawEdge: unsupported flags %04x\n", flags );
dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
hdc, rc->left, rc->top, rc->right, rc->bottom,
edge, flags );
/* First do all the raised edges */
hbrushOld = SelectObject32( hdc, sysColorObjects.hbrushBtnHighlight );
if (edge & BDR_RAISEDOUTER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
1, rc->bottom - rc->top - 1, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
rc->right - rc->left - 1, 1, PATCOPY );
}
if (edge & BDR_SUNKENOUTER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
1, rc->bottom - rc->top, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
rc->right - rc->left, 1, PATCOPY );
}
if (edge & BDR_RAISEDINNER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
rc->right - rc->left - 2, 1, PATCOPY );
}
if (edge & BDR_SUNKENINNER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
rc->right - rc->left - 2, 1, PATCOPY );
}
/* Then do all the sunken edges */
SelectObject32( hdc, sysColorObjects.hbrushBtnShadow );
if (edge & BDR_SUNKENOUTER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
1, rc->bottom - rc->top - 1, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
rc->right - rc->left - 1, 1, PATCOPY );
}
if (edge & BDR_RAISEDOUTER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
1, rc->bottom - rc->top, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
rc->right - rc->left, 1, PATCOPY );
}
if (edge & BDR_SUNKENINNER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
rc->right - rc->left - 2, 1, PATCOPY );
}
if (edge & BDR_RAISEDINNER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
rc->right - rc->left - 2, 1, PATCOPY );
}
SelectObject32( hdc, hbrushOld );
return TRUE;
}
/**********************************************************************
* DrawFrameControl16 (USER.656)
*/
BOOL16 DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
{
fprintf( stdnimp,"DrawFrameControl16(%x,%p,%d,%x), empty stub!\n",
hdc,rc,edge,flags );
return TRUE;
}
/**********************************************************************
* DrawFrameControl32 (USER32.157)
*/
BOOL32 DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), empty stub!\n",
hdc,rc,edge,flags );
return TRUE;
}

View File

@ -23,7 +23,16 @@
#include "debug.h"
#define SUPPORT_REALIZED_FONTS 1
#pragma pack(1)
typedef struct
{
SHORT nSize;
LPVOID lpindata;
LPVOID lpFont;
LPVOID lpXForm;
LPVOID lpDrawMode;
} EXTTEXTDATA, *LPEXTTEXTDATA;
#pragma pack(4)
#if 0
static BOOL16 windrvExtTextOut16( DC *dc, INT16 x, INT16 y, UINT16 flags, const RECT16 * lprect,
@ -45,6 +54,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
NULL, /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pEllipse */
NULL, /* pEnumDeviceFonts */
WIN16DRV_Escape, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */
@ -382,7 +392,18 @@ static INT32 WIN16DRV_Escape( DC *dc, INT32 nEscape, INT32 cbInput,
case 0x9:
printf("Escape: SetAbortProc ignored\n");
break;
case 0x100:
{
LPEXTTEXTDATA textData = PTR_SEG_TO_LIN(lpInData);
printf("Got in data 0x%x textData 0x%x\n",lpInData, textData);
printf("size %d in 0x%x:0x%x font 0x%x:0x%x xform 0x%x:0x%x drawm 0x%x:0x%x\n",
textData->nSize,
textData->lpindata,PTR_SEG_TO_LIN(textData->lpindata),
textData->lpFont,PTR_SEG_TO_LIN(textData->lpFont),
textData->lpXForm,PTR_SEG_TO_LIN(textData->lpXForm),
textData->lpDrawMode,PTR_SEG_TO_LIN(textData->lpDrawMode));
}
break;
default:
nRet = PRTDRV_Control(physDev->segptrPDEVICE, nEscape,
lpInData, lpOutData);

View File

@ -23,6 +23,7 @@ static const DC_FUNCTIONS X11DRV_Funcs =
X11DRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
X11DRV_Ellipse, /* pEllipse */
NULL, /* pEnumDeviceFonts */
NULL, /* pEscape */
NULL, /* pExcludeClipRect */
NULL, /* pExcludeVisRect */

View File

@ -1,4 +1,8 @@
#include <stdio.h>
long stub_GDI_379(void) { fprintf(stderr, "Warning: GDI_379:STARTPAGE unimplemented stub\n"); return 1; }
long stub_GDI_380(void) { fprintf(stderr, "Warning: GDI_380:ENDPAGE unimplemented stub\n"); return 1; }
long stub_GDI_381(void) { fprintf(stderr, "Warning: GDI_381:SETABORTPROC unimplemented stub\n"); return 1; }
long stub_GDI_382(void) { fprintf(stderr, "Warning: GDI_382:ABORTPROC unimplemented stub\n"); return 1; }
long stub_GDI_530(void) { fprintf(stderr, "Warning: GDI_530: unimplemented stub\n"); return 0; }
long stub_GDI_531(void) { fprintf(stderr, "Warning: GDI_531: unimplemented stub\n"); return 0; }
long stub_GDI_532(void) { fprintf(stderr, "Warning: GDI_532: unimplemented stub\n"); return 0; }

View File

@ -255,12 +255,12 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
374 pascal16 GetSystemPaletteUse(word) GetSystemPaletteUse16
375 pascal16 GetSystemPaletteEntries(word word word ptr) GetSystemPaletteEntries16
376 pascal16 ResetDC(word ptr) ResetDC16
377 stub STARTDOC
378 stub ENDDOC
379 stub STARTPAGE
380 stub ENDPAGE
381 stub SETABORTPROC
382 stub ABORTDOC
377 pascal16 StartDoc(word ptr) StartDoc16
378 pascal16 EndDoc(word) EndDoc16
379 pascal16 StartPage() stub_GDI_379
380 pascal16 EndPage() stub_GDI_380
381 pascal16 SetAbortProc() stub_GDI_381
382 pascal16 AbortDoc() stub_GDI_382
400 pascal16 FastWindowFrame(word ptr s_word s_word long) FastWindowFrame
401 stub GDIMOVEBITMAP
403 stub GDIINIT2

View File

@ -222,7 +222,7 @@ base 1
0217 stdcall GetFileAttributesA(ptr) GetFileAttributes32A
0218 stdcall GetFileAttributesW(ptr) GetFileAttributes32W
0219 stdcall GetFileInformationByHandle(long ptr) GetFileInformationByHandle
0220 stdcall GetFileSize(long ptr ptr) GetFileSize
0220 stdcall GetFileSize(long ptr) GetFileSize
0221 stdcall GetFileTime(long ptr ptr ptr) GetFileTime
0222 stdcall GetFileType(long) GetFileType
0223 stdcall GetFullPathNameA(ptr long ptr ptr) GetFullPathName32A

View File

@ -29,8 +29,8 @@ type win16
#101 8 010e FINDEXEDLGPROC exported, shared data
#101 DLLENTRYPOINT #win95 SHELL.DLL
102 pascal16 RegisterShellHook(ptr) RegisterShellHook
103 pascal16 ShellHookProc() ShellHookProc
102 pascal16 RegisterShellHook(word word) RegisterShellHook
103 pascal ShellHookProc(word word long) ShellHookProc
# 157 RESTARTDIALOG
# 166 PICKICONDLG

View File

@ -42,7 +42,7 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
#define XCREATEIMAGE(image,width,height,bpp) \
{ \
int width_bytes = DIB_GetImageWidthBytes( (width), (bpp) ); \
int width_bytes = DIB_GetImageWidthBytesX11( (width), (bpp) ); \
(image) = XCreateImage(display, DefaultVisualOfScreen(screen), \
(bpp), ZPixmap, 0, xmalloc( (height)*width_bytes ),\
(width), (height), 32, width_bytes ); \
@ -56,6 +56,7 @@ extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
/* objects/dib.c */
extern int DIB_GetImageWidthBytes( int width, int depth );
extern int DIB_GetImageWidthBytesX11( int width, int depth );
extern int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse );
/* objects/oembitmap.c */

View File

@ -56,7 +56,7 @@ extern LONG CallTo16_long_lwwllwlllllw( FARPROC16, LONG, WORD, WORD, LONG,
CallTo16_word_w( func, nExitType )
#define CallWndProc16( func, hwnd, msg, wParam, lParam ) \
CallTo16_long_wwwl( (FARPROC16)(func), hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
#define CallWordBreakProc16( func, lpch, ichCurrent, cch, code ) \
CallTo16_word_lwww( func, lpch, ichCurrent, cch, code )
#define CallWndProcNCCREATE16( func, exStyle, clsName, winName, style, \
x, y, cx, cy, hparent, hmenu, instance, \
@ -83,6 +83,8 @@ extern LONG CallTo32_5( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD );
CallTo32_3( func, hmodule, a, b )
#define CallWndProc32( func, hwnd, msg, wParam, lParam ) \
CallTo32_4( func, hwnd, msg, wParam, lParam )
#define CallWordBreakProc32A( func, lpch, ichCurrent, cch, code ) \
CallTo32_4( func, (DWORD)lpch, ichCurrent, cch, code )
#else /* WINELIB */
@ -97,7 +99,9 @@ extern LONG CallTo32_5( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD );
(*func)( hwnd, msg, wParam, lParam )
#define CallWndProc32( func, hwnd, msg, wParam, lParam ) \
(*func)( hwnd, msg, wParam, lParam )
#define CallWordBreakProc( func, lpch, ichCurrent, cch, code ) \
#define CallWordBreakProc16( func, lpch, ichCurrent, cch, code ) \
(*func)( lpch, ichCurrent, cch, code )
#define CallWordBreakProc32A( func, lpch, ichCurrent, cch, code ) \
(*func)( lpch, ichCurrent, cch, code )
#endif /* WINELIB */

View File

@ -73,6 +73,7 @@
#undef DEBUG_SENDMSG
#undef DEBUG_SHM
#undef DEBUG_STRESS
#undef DEBUG_STRING
#undef DEBUG_TASK
#undef DEBUG_TEXT
#undef DEBUG_TIMER
@ -154,6 +155,7 @@
#define DEBUG_SENDMSG
#define DEBUG_SHM
#define DEBUG_STRESS
#define DEBUG_STRING
#define DEBUG_TASK
#define DEBUG_TEXT
#define DEBUG_TIMER
@ -505,6 +507,11 @@ short debug_msg_enabled[]={
#else
0,
#endif
#ifdef DEBUG_STRING
1,
#else
0,
#endif
#ifdef DEBUG_TASK
1,
#else
@ -1439,8 +1446,21 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_task if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_task debug_msg_enabled[67]
#define dprintf_string if(!debug_msg_enabled[67]) ; else fprintf
#define debugging_string debug_msg_enabled[67]
#else
#ifdef DEBUG_STRING
#define dprintf_string fprintf
#define debugging_string 1
#else
#define dprintf_string while(0) fprintf
#define debugging_string 0
#endif
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_task if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_task debug_msg_enabled[68]
#else
#ifdef DEBUG_TASK
#define dprintf_task fprintf
@ -1452,8 +1472,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_text if(!debug_msg_enabled[68]) ; else fprintf
#define debugging_text debug_msg_enabled[68]
#define dprintf_text if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_text debug_msg_enabled[69]
#else
#ifdef DEBUG_TEXT
#define dprintf_text fprintf
@ -1465,8 +1485,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_timer if(!debug_msg_enabled[69]) ; else fprintf
#define debugging_timer debug_msg_enabled[69]
#define dprintf_timer if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_timer debug_msg_enabled[70]
#else
#ifdef DEBUG_TIMER
#define dprintf_timer fprintf
@ -1478,8 +1498,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_toolhelp if(!debug_msg_enabled[70]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[70]
#define dprintf_toolhelp if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_toolhelp debug_msg_enabled[71]
#else
#ifdef DEBUG_TOOLHELP
#define dprintf_toolhelp fprintf
@ -1491,8 +1511,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_ver if(!debug_msg_enabled[71]) ; else fprintf
#define debugging_ver debug_msg_enabled[71]
#define dprintf_ver if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_ver debug_msg_enabled[72]
#else
#ifdef DEBUG_VER
#define dprintf_ver fprintf
@ -1504,8 +1524,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_virtual if(!debug_msg_enabled[72]) ; else fprintf
#define debugging_virtual debug_msg_enabled[72]
#define dprintf_virtual if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_virtual debug_msg_enabled[73]
#else
#ifdef DEBUG_VIRTUAL
#define dprintf_virtual fprintf
@ -1517,8 +1537,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_vxd if(!debug_msg_enabled[73]) ; else fprintf
#define debugging_vxd debug_msg_enabled[73]
#define dprintf_vxd if(!debug_msg_enabled[74]) ; else fprintf
#define debugging_vxd debug_msg_enabled[74]
#else
#ifdef DEBUG_VXD
#define dprintf_vxd fprintf
@ -1530,8 +1550,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win if(!debug_msg_enabled[74]) ; else fprintf
#define debugging_win debug_msg_enabled[74]
#define dprintf_win if(!debug_msg_enabled[75]) ; else fprintf
#define debugging_win debug_msg_enabled[75]
#else
#ifdef DEBUG_WIN
#define dprintf_win fprintf
@ -1543,8 +1563,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win16drv if(!debug_msg_enabled[75]) ; else fprintf
#define debugging_win16drv debug_msg_enabled[75]
#define dprintf_win16drv if(!debug_msg_enabled[76]) ; else fprintf
#define debugging_win16drv debug_msg_enabled[76]
#else
#ifdef DEBUG_WIN16DRV
#define dprintf_win16drv fprintf
@ -1556,8 +1576,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_win32 if(!debug_msg_enabled[76]) ; else fprintf
#define debugging_win32 debug_msg_enabled[76]
#define dprintf_win32 if(!debug_msg_enabled[77]) ; else fprintf
#define debugging_win32 debug_msg_enabled[77]
#else
#ifdef DEBUG_WIN32
#define dprintf_win32 fprintf
@ -1569,8 +1589,8 @@ extern short debug_msg_enabled[];
#endif
#ifdef DEBUG_RUNTIME
#define dprintf_winsock if(!debug_msg_enabled[77]) ; else fprintf
#define debugging_winsock debug_msg_enabled[77]
#define dprintf_winsock if(!debug_msg_enabled[78]) ; else fprintf
#define debugging_winsock debug_msg_enabled[78]
#else
#ifdef DEBUG_WINSOCK
#define dprintf_winsock fprintf
@ -1652,6 +1672,7 @@ static char *debug_msg_name[] = {
"sendmsg",
"shm",
"stress",
"string",
"task",
"text",
"timer",

View File

@ -153,6 +153,7 @@ typedef struct tagDC_FUNCS
BOOL32 (*pDeleteDC)(DC*);
BOOL32 (*pDeleteObject)(HGDIOBJ16);
BOOL32 (*pEllipse)(DC*,INT32,INT32,INT32,INT32);
BOOL32 (*pEnumDeviceFonts)(DC*,LPLOGFONT32A,FONTENUMPROCEX32A,LPARAM);
INT32 (*pEscape)(DC*,INT32,INT32,SEGPTR,SEGPTR);
INT32 (*pExcludeClipRect)(DC*,INT32,INT32,INT32,INT32);
INT32 (*pExcludeVisRect)(DC*,INT32,INT32,INT32,INT32);

View File

@ -143,6 +143,7 @@
#undef DEBUG_SENDMSG
#undef DEBUG_SHM
#undef DEBUG_STRESS
#undef DEBUG_STRING
#undef DEBUG_TASK
#undef DEBUG_TEXT
#undef DEBUG_TIMER
@ -224,6 +225,7 @@
#define DEBUG_SENDMSG
#define DEBUG_SHM
#define DEBUG_STRESS
#define DEBUG_STRING
#define DEBUG_TASK
#define DEBUG_TEXT
#define DEBUG_TIMER

View File

@ -29,6 +29,12 @@
#define MEM_MAPPED 0x00040000
#define MEM_TOP_DOWN 0x00100000
#define SEC_FILE 0x00800000
#define SEC_IMAGE 0x01000000
#define SEC_RESERVE 0x04000000
#define SEC_COMMIT 0x08000000
#define SEC_NOCACHE 0x10000000
#define FILE_BEGIN 0
#define FILE_CURRENT 1
#define FILE_END 2
@ -38,6 +44,11 @@
#define FILE_UNICODE_ON_DISK 0x00000004
#define FILE_PERSISTENT_ACLS 0x00000008
#define FILE_MAP_COPY 0x00000001
#define FILE_MAP_WRITE 0x00000002
#define FILE_MAP_READ 0x00000004
#define FILE_MAP_ALL_ACCESS 0x000f001f
#define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
#define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
#define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK

View File

@ -4786,6 +4786,34 @@ DECL_WINELIB_TYPE_AW(ENUMRESLANGPROC);
#define LOAD_LIBRARY_AS_DATAFILE 0x00000002
#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
typedef struct
{
INT16 cbSize;
SEGPTR lpszDocName WINE_PACKED;
SEGPTR lpszOutput WINE_PACKED;
} DOCINFO16, *LPDOCINFO16;
typedef struct
{
INT32 cbSize;
LPCSTR lpszDocName;
LPCSTR lpszOutput;
LPCSTR lpszDatatype;
DWORD fwType;
} DOCINFO32A, *LPDOCINFO32A;
typedef struct
{
INT32 cbSize;
LPCWSTR lpszDocName;
LPCWSTR lpszOutput;
LPCWSTR lpszDatatype;
DWORD fwType;
} DOCINFO32W, *LPDOCINFO32W;
DECL_WINELIB_TYPE_AW(DOCINFO);
DECL_WINELIB_TYPE_AW(LPDOCINFO);
#pragma pack(4)
/* Declarations for functions that exist only in Win16 */
@ -4886,6 +4914,7 @@ VOID PostEvent(HTASK16);
WORD PrestoChangoSelector(WORD,WORD);
INT16 ReadComm(INT16,LPSTR,INT16);
UINT16 RealizeDefaultPalette(HDC16);
BOOL32 RegisterShellHook(HWND16,UINT16);
INT16 RestoreVisRgn(HDC16);
HRGN16 SaveVisRgn(HDC16);
DWORD ScaleViewportExt(HDC16,INT16,INT16,INT16,INT16);
@ -5647,6 +5676,9 @@ BOOL32 EndDeferWindowPos32(HDWP32);
BOOL16 EndDialog16(HWND16,INT16);
BOOL32 EndDialog32(HWND32,INT32);
#define EndDialog WINELIB_NAME(EndDialog)
INT16 EndDoc16(HDC16);
INT32 EndDoc32(HDC32);
#define EndDoc WINELIB_NAME(EndDoc)
BOOL16 EndPaint16(HWND16,const PAINTSTRUCT16*);
BOOL32 EndPaint32(HWND32,const PAINTSTRUCT32*);
#define EndPaint WINELIB_NAME(EndPaint)
@ -7061,6 +7093,10 @@ BOOL32 ShowWindow32(HWND32,INT32);
DWORD SizeofResource16(HMODULE16,HRSRC16);
DWORD SizeofResource32(HMODULE32,HRSRC32);
#define SizeofResource WINELIB_NAME(SizeofResource)
INT16 StartDoc16(HDC16,const DOCINFO16*);
INT32 StartDoc32A(HDC32,const DOCINFO32A*);
INT32 StartDoc32W(HDC32,const DOCINFO32W*);
#define StartDoc WINELIB_NAME_AW(StartDoc)
INT16 StartSound16(void);
VOID StartSound32(void);
#define StartSound WINELIB_NAME(StartSound)

View File

@ -26,6 +26,20 @@ typedef enum
typedef void *HWINDOWPROC; /* Really a pointer to a WINDOWPROC */
typedef struct
{
WPARAM16 wParam;
LPARAM lParam;
LRESULT lResult;
} MSGPARAM16;
typedef struct
{
WPARAM32 wParam;
LPARAM lParam;
LRESULT lResult;
} MSGPARAM32;
extern BOOL32 WINPROC_Init(void);
extern WNDPROC16 WINPROC_GetProc( HWINDOWPROC proc, WINDOWPROCTYPE type );
extern BOOL32 WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC16 func,
@ -57,9 +71,9 @@ extern void WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg16To32W( UINT32 msg, WPARAM32 wParam,
LPARAM lParam );
extern void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
LPARAM lParam, LRESULT lResult );
extern void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM16 wParam,
LPARAM lParam, LRESULT lResult );
extern void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM32 wParam,
LPARAM lParam, MSGPARAM16* pm16 );
extern void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM32 wParam,
LPARAM lParam, MSGPARAM16* pm16 );
#endif /* __WINE_WINPROC_H */

View File

@ -249,7 +249,7 @@ static BOOL32 DDE_DoOneMessage (int proc_idx, int size, struct msgbuf *msgbuf)
}
/* Do some sort of premitive hash table */
static HWND HWND_Local2Remote(HWND orig)
static HWND16 HWND_Local2Remote(HWND16 orig)
{
int dde_wnd_idx;
int deleted_idx= -1;
@ -309,10 +309,10 @@ static BOOL32 DDE_DoMessage( MSG16 *msg, int type )
}
if (msg->wParam == (HWND)-1)
if (msg->wParam == (HWND16)-1)
return FALSE;
if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND)-1)
if ( ! DDE_IsRemoteWindow(msg->hwnd) && msg->hwnd!= (HWND16)-1)
return FALSE;
dprintf_msg(stddeb, "%s: DDE_DoMessage(hwnd=0x%x,msg=0x%x,..)\n",
@ -331,7 +331,7 @@ static BOOL32 DDE_DoMessage( MSG16 *msg, int type )
msg_dat.dat.mtype=type;
if (msg->hwnd == (HWND)-1) {
if (msg->hwnd == (HWND16)-1) {
success= FALSE;
for ( proc_idx=0; proc_idx < DDE_PROCS ; proc_idx++) {
if (proc_idx == curr_proc_idx)
@ -357,7 +357,7 @@ BOOL32 DDE_PostMessage( MSG16 *msg)
}
void dde_proc_send_ack(HWND wnd, BOOL32 val) {
void dde_proc_send_ack(HWND16 wnd, BOOL32 val) {
int proc,msg;
static struct msgbuf msg_ack={DDE_ACK,{'0'}};
@ -441,8 +441,8 @@ int DDE_GetRemoteMessage()
print_dde_message(title, remote_message);
}
if (remote_message->hwnd != (HWND) -1 ) {
HWND dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd;
if (remote_message->hwnd != (HWND16) -1 ) {
HWND16 dde_window= DDE_WIN_INFO(remote_message->hwnd).wnd;
/* we should know exactly where to send the message (locally)*/
if (was_sent) {
dprintf_dde(stddeb,
@ -459,7 +459,7 @@ int DDE_GetRemoteMessage()
dde_proc_send_ack(remote_message->wParam, passed);
}
else {
passed= PostMessage(dde_window, remote_message->message,
passed= PostMessage16(dde_window, remote_message->message,
remote_message->wParam, remote_message->lParam);
if (passed == FALSE) {
/* Tell the sender, that the message is here, and failed */
@ -475,7 +475,7 @@ int DDE_GetRemoteMessage()
}
/* iterate through all the windows */
for (wndPtr = WIN_FindWndPtr(GetTopWindow(GetDesktopWindow32()));
for (wndPtr = WIN_FindWndPtr(GetTopWindow32(GetDesktopWindow32()));
wndPtr != NULL;
wndPtr = wndPtr->next)
{
@ -484,7 +484,7 @@ int DDE_GetRemoteMessage()
SendMessage16( wndPtr->hwndSelf, remote_message->message,
remote_message->wParam, remote_message->lParam );
else
PostMessage( wndPtr->hwndSelf, remote_message->message,
PostMessage16( wndPtr->hwndSelf, remote_message->message,
remote_message->wParam, remote_message->lParam );
} /* if */
} /* for */
@ -519,7 +519,7 @@ void dde_msg_setup(int *msg_ptr)
* If we have, atom usage will make this instance of wine set up
* it's IPC stuff.
*/
void DDE_TestDDE(HWND hwnd)
void DDE_TestDDE(HWND16 hwnd)
{
static in_test = 0;
if (in_test++) return;
@ -688,7 +688,7 @@ static BOOL32 DDE_ProcHasWindows(int proc_idx)
* This is inefficient, but who cares for the efficiency of this rare
* operation...
*/
void DDE_DestroyWindow(HWND hwnd)
void DDE_DestroyWindow(HWND16 hwnd)
{
int dde_wnd_idx;
WND_DATA *tested;

View File

@ -1054,11 +1054,11 @@ HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first )
hModule = MODULE_LoadExeHeader( hFile, &ofs );
if (hModule < 32)
{
/* FIXME: Hack because PE_LoadModule is recursive */
int fd = dup( FILE_GetUnixHandle(hFile) );
_lclose32( hFile );
if (hModule == 21) hModule = PE_LoadModule( fd, &ofs, paramBlock );
close( fd );
/* Note: PE_LoadModule closes the file */
if (hModule == 21)
hModule = PE_LoadModule( hFile, &ofs, paramBlock );
else _lclose32( hFile );
if (hModule < 32)
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
name, hModule );

View File

@ -527,7 +527,6 @@ void NE_InitializeDLLs( HMODULE16 hModule )
for (pDLL = (HMODULE16 *)GlobalLock16( to_init ); *pDLL; pDLL++)
{
NE_InitializeDLLs( *pDLL );
NE_InitDLL( *pDLL );
}
GlobalFree16( to_init );
}

View File

@ -420,8 +420,9 @@ problem needs to be fixed properly at some stage */
for(i=0; i < pe->pe_header->FileHeader.NumberOfSections; i++)
{
/* load only non-BSS segments */
if(pe->pe_seg[i].Characteristics &
~ IMAGE_SCN_CNT_UNINITIALIZED_DATA)
if(!(pe->pe_seg[i].Characteristics &
IMAGE_SCN_CNT_UNINITIALIZED_DATA))
{
if(lseek(fd,pe->pe_seg[i].PointerToRawData,SEEK_SET) == -1
|| read(fd,(char*)RVA(pe->pe_seg[i].VirtualAddress),
pe->pe_seg[i].SizeOfRawData) != pe->pe_seg[i].SizeOfRawData)
@ -429,6 +430,7 @@ problem needs to be fixed properly at some stage */
fprintf(stderr,"Failed to load section %x\n", i);
exit(0);
}
}
result = RVA (pe->pe_seg[i].VirtualAddress);
#if 1
/* not needed, memory is zero */
@ -568,21 +570,26 @@ problem needs to be fixed properly at some stage */
HINSTANCE16 MODULE_CreateInstance(HMODULE16 hModule,LOADPARAMS *params);
HINSTANCE16 PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
HINSTANCE16 PE_LoadModule( HFILE32 hFile, OFSTRUCT *ofs, LOADPARAMS* params )
{
HMODULE16 hModule;
HINSTANCE16 hInstance;
NE_MODULE *pModule;
struct mz_header_s mz_header;
int fd;
if ((hModule = MODULE_CreateDummyModule( ofs )) < 32) return hModule;
pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32;
/* FIXME: Hack because PE_LoadModule is recursive */
fd = dup( FILE_GetUnixHandle(hFile) );
_lclose32( hFile );
lseek( fd, 0, SEEK_SET );
read( fd, &mz_header, sizeof(mz_header) );
pModule->pe_module = PE_LoadImage( fd, hModule, mz_header.ne_offset );
close( fd );
hInstance = MODULE_CreateInstance( hModule, params );
@ -654,7 +661,6 @@ void PE_InitializeDLLs(HMODULE16 hModule,DWORD type,LPVOID lpReserved)
for (pDLL = (HMODULE16 *)GlobalLock16( to_init ); *pDLL; pDLL++)
{
PE_InitializeDLLs( *pDLL, type, lpReserved);
PE_InitDLL( *pDLL, type, lpReserved );
}
GlobalFree16( to_init );
}

View File

@ -1,11 +1,7 @@
#ifndef WINELIB
#include <stdio.h>
#include <stdlib.h>
#ifdef __GLIBC__
#include <linux/signal.h>
#else
#include <signal.h>
#endif
#include <string.h>
#include <errno.h>
#include <time.h>
@ -39,11 +35,21 @@ char * cstack[4096];
extern void ___sig_restore();
extern void ___masksig_restore();
/* This is the sigaction structure from the Linux 2.1.20 kernel. */
struct kernel_sigaction {
__sighandler_t sa_handler;
unsigned long sa_mask;
unsigned long sa_flags;
void (*sa_restorer) __P ((void));
};
/* Similar to the sigaction function in libc, except it leaves alone the
restorer field */
static int
wine_sigaction(int sig,struct sigaction * new, struct sigaction * old)
wine_sigaction(int sig,struct kernel_sigaction * new,
struct kernel_sigaction * old)
{
__asm__("int $0x80":"=a" (sig)
:"0" (SYS_sigaction),"b" (sig),"c" (new),"d" (old));
@ -166,9 +172,9 @@ HANDLER_DEF(SIGNAL_fault)
static void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
{
int ret;
struct sigaction sig_act;
#ifdef linux
struct kernel_sigaction sig_act;
sig_act.sa_handler = func;
sig_act.sa_flags = SA_RESTART | (flags) ? SA_NOMASK : 0;
/* Point to the top of the stack, minus 4 just in case, and make
@ -179,6 +185,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
#endif /* linux */
#if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigaction sig_act;
sigset_t sig_mask;
sigemptyset(&sig_mask);
sig_act.sa_handler = func;
@ -188,6 +195,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
#endif /* __FreeBSD__ || __NetBSD__ */
#if defined (__svr4__) || defined(_SCO_DS)
struct sigaction sig_act;
sigset_t sig_mask;
sigemptyset(&sig_mask);
sig_act.sa_handler = func;
@ -197,6 +205,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)(), int flags )
#endif /* __svr4__ || _SCO_DS */
#if defined(__EMX__)
struct sigaction sig_act;
sigset_t sig_mask;
sigemptyset(&sig_mask);
sig_act.sa_handler = func;

View File

@ -679,10 +679,10 @@ static void TASK_DeleteTask( HTASK16 hTask )
*/
void TASK_KillCurrentTask( INT16 exitCode )
{
extern void EXEC_ExitWindows(void);
extern void USER_ExitWindows(void);
TDB* pTask = (TDB*) GlobalLock16( hCurrentTask );
if (!pTask) EXEC_ExitWindows(); /* No current task yet */
if (!pTask) USER_ExitWindows(); /* No current task yet */
/* Perform USER cleanup */
@ -698,7 +698,7 @@ void TASK_KillCurrentTask( INT16 exitCode )
if (nTaskCount <= 1)
{
dprintf_task( stddeb, "Killing the last task, exiting\n" );
EXEC_ExitWindows();
USER_ExitWindows();
}
/* Remove the task from the list to be sure we never switch back to it */

View File

@ -9,6 +9,8 @@
#include <string.h>
#include "windows.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
static const BYTE STRING_Oem2Ansi[256] =
"\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\244"
@ -74,6 +76,8 @@ SEGPTR lstrcat16( SEGPTR dst, SEGPTR src )
*/
LPSTR lstrcat32A( LPSTR dst, LPCSTR src )
{
dprintf_string(stddeb,"strcat: Append '%s' to '%s'\n",
(src)?src:"NULL",(dst)?dst:"NULL");
strcat( dst, src );
return dst;
}
@ -107,6 +111,8 @@ SEGPTR lstrcatn16( SEGPTR dst, SEGPTR src, INT16 n )
LPSTR lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
{
register LPSTR p = dst;
dprintf_string(stddeb,"strcatn add %d chars from '%s' to '%s'\n",
n,(src)?src:"NULL",(dst)?dst:"NULL");
while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst;
lstrcpyn32A( p, src, n );
@ -141,6 +147,8 @@ INT16 lstrcmp16( LPCSTR str1, LPCSTR str2 )
*/
INT32 lstrcmp32A( LPCSTR str1, LPCSTR str2 )
{
dprintf_string(stddeb,"strcmp: '%s' and '%s'\n",
(str1)?str1:"NULL",(str2)?str2:"NULL");
return (INT32)strcmp( str1, str2 );
}
@ -171,6 +179,8 @@ INT32 lstrcmpi32A( LPCSTR str1, LPCSTR str2 )
{
INT32 res;
dprintf_string(stddeb,"strcmpi '%s' and '%s'\n",
(str1)?str1:"NULL",(str2)?str2:"NULL");
while (*str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
@ -214,6 +224,8 @@ SEGPTR lstrcpy16( SEGPTR dst, SEGPTR src )
*/
LPSTR lstrcpy32A( LPSTR dst, LPCSTR src )
{
dprintf_string(stddeb,"strcpy '%s'\n",
(src)?src:"NULL");
if (!src || !dst) return NULL;
strcpy( dst, src );
return dst;
@ -247,6 +259,8 @@ SEGPTR lstrcpyn16( SEGPTR dst, SEGPTR src, INT16 n )
LPSTR lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
{
LPSTR p = dst;
dprintf_string(stddeb,"strcpyn '%s' for %d chars\n",
(src)?src:"NULL",n);
while ((n-- > 1) && *src) *p++ = *src++;
*p = 0;
return dst;
@ -283,6 +297,7 @@ INT32 lstrlen32A( LPCSTR str )
* in lstrlen() ... we check only for NULL pointer reference.
* - Marcus Meissner
*/
dprintf_string(stddeb,"strlen '%s'\n", (str)?str:"NULL");
if (!str) return 0;
return (INT32)strlen(str);
}
@ -305,6 +320,8 @@ INT32 lstrlen32W( LPCWSTR str )
*/
INT32 lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
{
dprintf_string(stddeb,"strncmp '%s' and '%s' for %d chars\n",
(str1)?str1:"NULL",(str2)?str2:"NULL",n);
return (INT32)strncmp( str1, str2, n );
}
@ -327,6 +344,8 @@ INT32 lstrncmpi32A( LPCSTR str1, LPCSTR str2, INT32 n )
{
INT32 res;
dprintf_string(stddeb,"strncmpi '%s' and '%s' for %d chars\n",
(str1)?str1:"NULL",(str2)?str2:"NULL",n);
if (!n) return 0;
while ((--n > 0) && *str1)
if ( (res = toupper(*str1++) - toupper(*str2++)) ) return res;
@ -480,7 +499,9 @@ void OemToAnsiBuff16( LPCSTR s, LPSTR d, UINT16 len )
BOOL32 CharToOem32A( LPCSTR s, LPSTR d )
{
if (!s || !d) return TRUE;
dprintf_string(stddeb,"CharToOem '%s'\n", (s)?s:"NULL");
while ((*d++ = ANSI_TO_OEM(*s++)));
dprintf_string(stddeb," to '%s'\n", (d)?d:"NULL");
return TRUE;
}
@ -520,7 +541,9 @@ BOOL32 CharToOem32W( LPCWSTR s, LPSTR d )
*/
BOOL32 OemToChar32A( LPCSTR s, LPSTR d )
{
dprintf_string(stddeb,"OemToChar '%s'\n", (s)?s:"NULL");
while ((*d++ = OEM_TO_ANSI(*s++)));
dprintf_string(stddeb," to '%s'\n", (d)?d:"NULL");
return TRUE;
}
@ -530,6 +553,7 @@ BOOL32 OemToChar32A( LPCSTR s, LPSTR d )
*/
BOOL32 OemToCharBuff32A( LPCSTR s, LPSTR d, DWORD len )
{
dprintf_string(stddeb,"OemToCharBuff '%s' for %ld chars\n", (s)?s:"NULL",len);
while (len--) *d++ = OEM_TO_ANSI(*s++);
return TRUE;
}

View File

@ -38,6 +38,7 @@ typedef struct _FV
UINT32 base; /* Base address */
UINT32 size; /* Size in bytes */
UINT32 flags; /* Allocation flags */
UINT32 offset; /* Offset from start of mapped file */
FILE_MAPPING *mapping; /* File mapping */
BYTE protect; /* Protection for all pages at allocation time */
BYTE prot[1]; /* Protection byte for each page */
@ -81,6 +82,7 @@ static FILE_VIEW *VIRTUAL_FirstView;
static UINT32 page_shift;
static UINT32 page_mask;
static UINT32 granularity_mask; /* Allocation granularity (usually 64k) */
#define ROUND_ADDR(addr) \
((UINT32)(addr) & ~page_mask)
@ -89,22 +91,6 @@ static UINT32 page_mask;
(((UINT32)(size) + ((UINT32)(addr) & page_mask) + page_mask) & ~page_mask)
/***********************************************************************
* VIRTUAL_DestroyMapping
*
* Destroy a FILE_MAPPING object.
*/
void VIRTUAL_DestroyMapping( K32OBJ *ptr )
{
FILE_MAPPING *mapping = (FILE_MAPPING *)ptr;
assert( ptr->type == K32OBJ_MEM_MAPPED_FILE );
if (mapping->file) K32OBJ_DecCount( &mapping->file->header );
ptr->type = K32OBJ_UNKNOWN;
HeapFree( SystemHeap, 0, mapping );
}
/***********************************************************************
* VIRTUAL_GetProtStr
*/
@ -131,14 +117,19 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
UINT32 addr = view->base;
BYTE prot = view->prot[0];
dprintf_virtual( stddeb, "View: %08x - %08x%s\n",
fprintf( stderr, "View: %08x - %08x%s",
view->base, view->base + view->size - 1,
(view->flags & VFLAG_SYSTEM) ? " (system)" : "" );
if (view->mapping && view->mapping->file)
fprintf( stderr, " %s @ %08x\n",
view->mapping->file->unix_name, view->offset );
else
fprintf( stderr, " (anonymous)\n");
for (count = i = 1; i < view->size >> page_shift; i++, count++)
{
if (view->prot[i] == prot) continue;
dprintf_virtual( stddeb, " %08x - %08x %s\n",
fprintf( stderr, " %08x - %08x %s\n",
addr, addr + (count << page_shift) - 1,
VIRTUAL_GetProtStr(prot) );
addr += (count << page_shift);
@ -146,7 +137,7 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
count = 0;
}
if (count)
dprintf_virtual( stddeb, " %08x - %08x %s\n",
fprintf( stderr, " %08x - %08x %s\n",
addr, addr + (count << page_shift) - 1,
VIRTUAL_GetProtStr(prot) );
}
@ -158,7 +149,7 @@ static void VIRTUAL_DumpView( FILE_VIEW *view )
void VIRTUAL_Dump(void)
{
FILE_VIEW *view = VIRTUAL_FirstView;
dprintf_virtual( stddeb, "\nDump of all virtual memory views:\n\n" );
fprintf( stderr, "\nDump of all virtual memory views:\n\n" );
while (view)
{
VIRTUAL_DumpView( view );
@ -190,18 +181,21 @@ static FILE_VIEW *VIRTUAL_FindView( UINT32 addr )
*
* Create a new view and add it in the linked list.
*/
static FILE_VIEW *VIRTUAL_CreateView( UINT32 base, UINT32 size,
UINT32 flags, BYTE vprot )
static FILE_VIEW *VIRTUAL_CreateView( UINT32 base, UINT32 size, UINT32 offset,
UINT32 flags, BYTE vprot,
FILE_MAPPING *mapping )
{
FILE_VIEW *view, *prev;
/* Create the view structure */
size >>= page_shift;
view = (FILE_VIEW *)xmalloc( sizeof(*view) + size - 1 );
if (!(view = (FILE_VIEW *)malloc( sizeof(*view) + size - 1 ))) return NULL;
view->base = base;
view->size = size << page_shift;
view->flags = flags;
view->offset = offset;
view->mapping = mapping;
view->protect = vprot;
memset( view->prot, vprot, size );
@ -239,6 +233,7 @@ static void VIRTUAL_DeleteView( FILE_VIEW *view )
if (view->next) view->next->prev = view->prev;
if (view->prev) view->prev->next = view->next;
else VIRTUAL_FirstView = view->next;
if (view->mapping) K32OBJ_DecCount( &view->mapping->header );
free( view );
}
@ -369,8 +364,10 @@ BOOL32 VIRTUAL_Init(void)
GetSystemInfo( &sysinfo );
page_mask = sysinfo.dwPageSize - 1;
granularity_mask = sysinfo.dwAllocationGranularity - 1;
/* Make sure we have a power of 2 */
assert( !(sysinfo.dwPageSize & page_mask) );
assert( !(sysinfo.dwAllocationGranularity & granularity_mask) );
page_shift = 0;
while ((1 << page_shift) != sysinfo.dwPageSize) page_shift++;
@ -392,7 +389,8 @@ BOOL32 VIRTUAL_Init(void)
if (w == 'w') vprot |= VPROT_WRITE;
if (x == 'x') vprot |= VPROT_EXEC;
if (p == 'p') vprot |= VPROT_WRITECOPY;
VIRTUAL_CreateView( start, end - start, VFLAG_SYSTEM, vprot );
VIRTUAL_CreateView( start, end - start, 0,
VFLAG_SYSTEM, vprot, NULL );
}
fclose( f );
}
@ -424,7 +422,7 @@ LPVOID VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect )
if (addr)
{
if (type & MEM_RESERVE) /* Round down to 64k boundary */
base = ((UINT32)addr + 0xffff) & ~0xffff;
base = ((UINT32)addr + granularity_mask) & ~granularity_mask;
else
base = ROUND_ADDR( addr );
size = (((UINT32)addr + size + page_mask) & ~page_mask) - base;
@ -456,7 +454,7 @@ LPVOID VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect )
if ((type & MEM_RESERVE) || !base)
{
view_size = size + (base ? 0 : 0x10000);
view_size = size + (base ? 0 : granularity_mask + 1);
ptr = (UINT32)FILE_mmap( NULL, (LPVOID)base, 0, view_size, 0, 0,
VIRTUAL_GetUnixProt( vprot ), MAP_PRIVATE );
if (ptr == (UINT32)-1)
@ -469,19 +467,21 @@ LPVOID VirtualAlloc( LPVOID addr, DWORD size, DWORD type, DWORD protect )
/* Release the extra memory while keeping the range */
/* starting on a 64k boundary. */
if (ptr & 0xffff0000)
if (ptr & granularity_mask)
{
munmap( (void *)ptr, 0x10000 - (ptr & 0xffff) );
view_size -= (ptr & 0xffff);
ptr = (ptr + 0x10000) & 0xffff0000;
UINT32 extra = granularity_mask + 1 - (ptr & granularity_mask);
munmap( (void *)ptr, extra );
ptr += extra;
view_size -= extra;
}
if (view_size > size)
munmap( (void *)(ptr + size), view_size - size );
}
if (!(view = VIRTUAL_CreateView( ptr, size, 0, vprot )))
if (!(view = VIRTUAL_CreateView( ptr, size, 0, 0, vprot, NULL )))
{
munmap( (void *)ptr, size );
return NULL; /* FIXME: last error */
SetLastError( ERROR_OUTOFMEMORY );
return NULL;
}
if (debugging_virtual) VIRTUAL_DumpView( view );
return (LPVOID)ptr;
@ -827,6 +827,9 @@ HANDLE32 CreateFileMapping32A( HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
{
FILE_MAPPING *mapping = NULL;
HANDLE32 handle;
BYTE vprot;
/* First search for an object with the same name */
K32OBJ *obj = K32OBJ_FindName( name );
if (obj)
@ -840,9 +843,25 @@ HANDLE32 CreateFileMapping32A( HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
return 0;
}
printf( "CreateFileMapping32A(%x,%p,%08lx,%08lx%08lx,%s)\n",
/* Check parameters */
dprintf_virtual(stddeb,"CreateFileMapping32A(%x,%p,%08lx,%08lx%08lx,%s)\n",
hFile, attr, protect, size_high, size_low, name );
vprot = VIRTUAL_GetProt( protect );
if (protect & SEC_RESERVE)
{
if (hFile != INVALID_HANDLE_VALUE32)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
}
else vprot |= VPROT_COMMITTED;
if (protect & SEC_NOCACHE) vprot |= VPROT_NOCACHE;
/* Compute the size and extend the file if necessary */
if (hFile == INVALID_HANDLE_VALUE32)
{
if (!size_high && !size_low)
@ -856,6 +875,8 @@ HANDLE32 CreateFileMapping32A( HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
{
BY_HANDLE_FILE_INFORMATION info;
if (!(obj = PROCESS_GetObjPtr( hFile, K32OBJ_FILE ))) goto error;
/* FIXME: should check if the file permissions agree
* with the required protection flags */
if (!GetFileInformationByHandle( hFile, &info )) goto error;
if (!size_high && !size_low)
{
@ -873,12 +894,14 @@ HANDLE32 CreateFileMapping32A( HFILE32 hFile, LPSECURITY_ATTRIBUTES attr,
}
}
/* Allocate the mapping object */
if (!(mapping = HeapAlloc( SystemHeap, 0, sizeof(*mapping) ))) goto error;
mapping->header.type = K32OBJ_MEM_MAPPED_FILE;
mapping->header.refcount = 1;
mapping->protect = VIRTUAL_GetProt( protect ) | VPROT_COMMITTED;
mapping->protect = vprot;
mapping->size_high = size_high;
mapping->size_low = size_low;
mapping->size_low = ROUND_SIZE( 0, size_low );
mapping->file = (FILE_OBJECT *)obj;
handle = PROCESS_AllocHandle( &mapping->header, 0 );
@ -929,6 +952,22 @@ HANDLE32 OpenFileMapping32W( DWORD access, BOOL32 inherit, LPCWSTR name )
}
/***********************************************************************
* VIRTUAL_DestroyMapping
*
* Destroy a FILE_MAPPING object.
*/
void VIRTUAL_DestroyMapping( K32OBJ *ptr )
{
FILE_MAPPING *mapping = (FILE_MAPPING *)ptr;
assert( ptr->type == K32OBJ_MEM_MAPPED_FILE );
if (mapping->file) K32OBJ_DecCount( &mapping->file->header );
ptr->type = K32OBJ_UNKNOWN;
HeapFree( SystemHeap, 0, mapping );
}
/***********************************************************************
* MapViewOfFile (KERNEL32.385)
*/
@ -947,17 +986,81 @@ LPVOID MapViewOfFileEx( HANDLE32 handle, DWORD access, DWORD offset_high,
DWORD offset_low, DWORD count, LPVOID addr )
{
FILE_MAPPING *mapping;
LPVOID ret;
FILE_VIEW *view;
UINT32 ptr = (UINT32)-1, size = 0;
int flags = MAP_PRIVATE;
/* Check parameters */
if ((offset_low & granularity_mask) ||
(addr && ((UINT32)addr & granularity_mask)))
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
}
if (!(mapping = (FILE_MAPPING *)PROCESS_GetObjPtr( handle,
K32OBJ_MEM_MAPPED_FILE )))
return NULL;
ret = FILE_mmap(mapping->file, addr, mapping->size_high, mapping->size_low,
offset_high, offset_low, mapping->protect, MAP_PRIVATE );
if (mapping->size_high || offset_high)
fprintf( stderr, "MapViewOfFileEx: offsets larger than 4Gb not supported\n");
if ((offset_low >= mapping->size_low) ||
(count > mapping->size_low - offset_low))
{
SetLastError( ERROR_INVALID_PARAMETER );
goto error;
}
if (count) size = ROUND_SIZE( offset_low, count );
else size = mapping->size_low - offset_low;
switch(access)
{
case FILE_MAP_ALL_ACCESS:
case FILE_MAP_WRITE:
if (!(mapping->protect & VPROT_WRITE))
{
SetLastError( ERROR_INVALID_PARAMETER );
goto error;
}
flags = MAP_SHARED;
/* fall through */
case FILE_MAP_READ:
case FILE_MAP_COPY:
if (mapping->protect & VPROT_READ) break;
/* fall through */
default:
SetLastError( ERROR_INVALID_PARAMETER );
goto error;
}
/* Map the file */
dprintf_virtual( stddeb, "MapViewOfFile: handle=%x size=%x offset=%lx\n",
handle, size, offset_low );
ptr = (UINT32)FILE_mmap( mapping->file, addr, 0, size, 0, offset_low,
VIRTUAL_GetUnixProt( mapping->protect ),
flags );
if (ptr == (UINT32)-1)
{
SetLastError( ERROR_OUTOFMEMORY );
goto error;
}
if (!(view = VIRTUAL_CreateView( ptr, size, offset_low, 0,
mapping->protect, mapping )))
{
SetLastError( ERROR_OUTOFMEMORY );
goto error;
}
return (LPVOID)ptr;
error:
if (ptr != (UINT32)-1) munmap( (void *)ptr, size );
K32OBJ_DecCount( &mapping->header );
return ret;
return NULL;
}

View File

@ -6,16 +6,11 @@ VPATH = @srcdir@
MODULE = misc
C_SRCS = \
clipboard.c \
comm.c \
commdlg.c \
compobj.c \
crtdll.c \
cpu.c \
driver.c \
exec.c \
escape.c \
fontengine.c \
lstr.c \
lzexpand.c \
main.c \
@ -29,7 +24,6 @@ C_SRCS = \
olesvr.c \
port.c \
printdrv.c \
rect.c \
registry.c \
shell.c \
sound.c \
@ -37,7 +31,6 @@ C_SRCS = \
stress.c \
system.c \
toolhelp.c \
user.c \
ver.c \
w32sys.c \
winsock.c \

View File

@ -33,7 +33,7 @@ GetSystemInfo(LPSYSTEM_INFO si)
cachedsi.dwActiveProcessorMask = 1;
cachedsi.dwNumberOfProcessors = 1;
cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
cachedsi.dwAllocationGranularity = 8;
cachedsi.dwAllocationGranularity = 0x10000;
cachedsi.wProcessorLevel = 3; /* 386 */
cachedsi.wProcessorRevision = 0;

View File

@ -13,6 +13,29 @@
#include "winerror.h"
INT16 StartDoc16( HDC16 hdc, const DOCINFO16 *lpdoc )
{
INT16 retVal;
printf("In startdoc16(%p)\n", lpdoc );
printf("In StartDoc16 %d 0x%lx:0x%p 0x%lx:0x%p\n",lpdoc->cbSize,
lpdoc->lpszDocName,PTR_SEG_TO_LIN(lpdoc->lpszDocName),
lpdoc->lpszOutput,PTR_SEG_TO_LIN(lpdoc->lpszOutput));
printf("In StartDoc16 %d %s %s\n",lpdoc->cbSize,
(LPSTR)PTR_SEG_TO_LIN(lpdoc->lpszDocName),
(LPSTR)PTR_SEG_TO_LIN(lpdoc->lpszOutput));
retVal = Escape16(hdc, STARTDOC, sizeof(DOCINFO16), lpdoc->lpszDocName, 0);
printf("Escape16 returned %d\n",retVal);
return retVal;
}
INT16
EndDoc16(HDC16 hdc)
{
return Escape16(hdc, ENDDOC, 0, 0, 0);
}
DWORD
DrvGetPrinterData(LPSTR lpPrinter, LPSTR lpProfile, LPDWORD lpType,
LPBYTE lpPrinterData, int cbData, LPDWORD lpNeeded)

View File

@ -18,7 +18,6 @@
#include "cursoricon.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "winreg.h"
/* .ICO file ICONDIR definitions */
@ -50,6 +49,16 @@ typedef struct
extern HGLOBAL16 CURSORICON_LoadHandler( HGLOBAL16, HINSTANCE16, BOOL32);
extern WORD GetIconID( HGLOBAL16 hResource, DWORD resType );
static const char* lpstrMsgWndCreated = "OTHERWINDOWCREATED";
static const char* lpstrMsgWndDestroyed = "OTHERWINDOWDESTROYED";
static const char* lpstrMsgShellActivate = "ACTIVATESHELLWINDOW";
static HWND16 SHELL_hWnd = 0;
static HHOOK SHELL_hHook = 0;
static UINT16 uMsgWndCreated = 0;
static UINT16 uMsgWndDestroyed = 0;
static UINT16 uMsgShellActivate = 0;
/*************************************************************************
* DragAcceptFiles [SHELL.9]
*/
@ -466,6 +475,7 @@ BOOL32 ShellAbout32W( HWND32 hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
*/
static BYTE* SHELL_GetResourceTable(HFILE32 hFile)
{
BYTE* pTypeInfo = NULL;
struct mz_header_s mz_header;
struct ne_header_s ne_header;
int size;
@ -488,18 +498,20 @@ static BYTE* SHELL_GetResourceTable(HFILE32 hFile)
if( size > sizeof(NE_TYPEINFO) )
{
BYTE* pTypeInfo = (BYTE*)xmalloc(size);
if( !pTypeInfo ) return NULL;
pTypeInfo = (BYTE*)HeapAlloc( GetProcessHeap(), 0, size);
if( pTypeInfo )
{
_llseek32(hFile, mz_header.ne_offset+ne_header.resource_tab_offset, SEEK_SET);
if( _lread32( hFile, (char*)pTypeInfo, size) != size )
{ free(pTypeInfo); return NULL; }
return pTypeInfo;
{
HeapFree( GetProcessHeap(), 0, pTypeInfo);
pTypeInfo = NULL;
}
}
}
/* no resources */
return NULL;
return pTypeInfo;
}
/*************************************************************************
@ -559,7 +571,7 @@ static HGLOBAL16 ICO_GetIconDirectory(HINSTANCE16 hInst, HFILE32 hFile, LPicoICO
i = id[2]*sizeof(icoICONDIRENTRY) + sizeof(id);
lpiID = (LPicoICONDIR)xmalloc(i);
lpiID = (LPicoICONDIR)HeapAlloc( GetProcessHeap(), 0, i);
if( _lread32(hFile,(char*)lpiID->idEntries,i) == i )
{
@ -583,7 +595,7 @@ static HGLOBAL16 ICO_GetIconDirectory(HINSTANCE16 hInst, HFILE32 hFile, LPicoICO
}
/* fail */
free(lpiID);
HeapFree( GetProcessHeap(), 0, lpiID);
return 0;
}
@ -610,11 +622,9 @@ HGLOBAL16 InternalExtractIcon(HINSTANCE16 hInstance, LPCSTR lpszExeFileName, UIN
*RetPtr = (n == 0xFFFF)? 0: 1; /* error return values */
pData = SHELL_GetResourceTable(hFile);
if( pData )
if( (pData = SHELL_GetResourceTable(hFile)) )
{
HICON16 hIcon = 0;
BOOL32 icoFile = FALSE;
UINT16 iconDirCount = 0;
UINT16 iconCount = 0;
NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(pData + 2);
@ -627,8 +637,7 @@ HGLOBAL16 InternalExtractIcon(HINSTANCE16 hInstance, LPCSTR lpszExeFileName, UIN
/* check for .ICO file */
hIcon = ICO_GetIconDirectory(hInstance, hFile, &lpiID);
if( hIcon )
{ icoFile = TRUE; iconDirCount = 1; iconCount = lpiID->idCount; }
if( hIcon ) { iconDirCount = 1; iconCount = lpiID->idCount; }
}
else while( pTInfo->type_id && !(pIconStorage && pIconDir) )
{
@ -651,7 +660,7 @@ HGLOBAL16 InternalExtractIcon(HINSTANCE16 hInstance, LPCSTR lpszExeFileName, UIN
/* load resources and create icons */
if( (pIconStorage && pIconDir) || icoFile )
if( (pIconStorage && pIconDir) || lpiID )
if( nIconIndex == (UINT16)-1 ) RetPtr[0] = iconDirCount;
else if( nIconIndex < iconDirCount )
{
@ -663,7 +672,7 @@ HGLOBAL16 InternalExtractIcon(HINSTANCE16 hInstance, LPCSTR lpszExeFileName, UIN
{
/* .ICO files have only one icon directory */
if( !icoFile )
if( lpiID == NULL )
hIcon = SHELL_LoadResource( hInstance, hFile, pIconDir + i,
*(WORD*)pData );
RetPtr[i-nIconIndex] = GetIconID( hIcon, 3 );
@ -673,8 +682,9 @@ HGLOBAL16 InternalExtractIcon(HINSTANCE16 hInstance, LPCSTR lpszExeFileName, UIN
for( icon = nIconIndex; icon < nIconIndex + n; icon++ )
{
hIcon = 0;
if( icoFile )
hIcon = ICO_LoadIcon( hInstance, hFile, lpiID->idEntries + RetPtr[icon-nIconIndex]);
if( lpiID )
hIcon = ICO_LoadIcon( hInstance, hFile,
lpiID->idEntries + RetPtr[icon-nIconIndex]);
else
for( i = 0; i < iconCount; i++ )
if( pIconStorage[i].id == (RetPtr[icon-nIconIndex] | 0x8000) )
@ -683,8 +693,8 @@ HGLOBAL16 InternalExtractIcon(HINSTANCE16 hInstance, LPCSTR lpszExeFileName, UIN
RetPtr[icon-nIconIndex] = (hIcon)?CURSORICON_LoadHandler( hIcon, hInstance, FALSE ):0;
}
}
if( icoFile ) free(lpiID);
else free(pData);
if( lpiID ) HeapFree( GetProcessHeap(), 0, lpiID);
else HeapFree( GetProcessHeap(), 0, pData);
}
_lclose32( hFile );
@ -806,7 +816,7 @@ SEGPTR FindEnvironmentString(LPSTR str)
DWORD DoEnvironmentSubst(LPSTR str,WORD length)
{
LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(GetDOSEnvironment());
LPSTR lpBuffer = (LPSTR)xmalloc(length);
LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
LPSTR lpstr = str;
LPSTR lpbstr = lpBuffer;
@ -864,7 +874,7 @@ DWORD DoEnvironmentSubst(LPSTR str,WORD length)
dprintf_reg(stddeb," return %s\n", str);
OemToChar32A(str,str);
free(lpBuffer);
HeapFree( GetProcessHeap(), 0, lpBuffer);
/* Return str length in the LOWORD
* and 1 in HIWORD if subst was successful.
@ -873,24 +883,68 @@ DWORD DoEnvironmentSubst(LPSTR str,WORD length)
}
/*************************************************************************
* RegisterShellHook [SHELL.102]
* ShellHookProc [SHELL.103]
* System-wide WH_SHELL hook.
*/
int RegisterShellHook(void *ptr)
LRESULT ShellHookProc(INT16 code, WPARAM16 wParam, LPARAM lParam)
{
fprintf(stdnimp, "RegisterShellHook( %p ) : Empty Stub !!!\n", ptr);
return 0;
dprintf_reg(stddeb,"ShellHookProc: %i, %04x, %08x\n", code, wParam,
(unsigned)lParam );
if( SHELL_hHook && SHELL_hWnd )
{
UINT16 uMsg = 0;
switch( code )
{
case HSHELL_WINDOWCREATED: uMsg = uMsgWndCreated; break;
case HSHELL_WINDOWDESTROYED: uMsg = uMsgWndDestroyed; break;
case HSHELL_ACTIVATESHELLWINDOW: uMsg = uMsgShellActivate;
}
PostMessage16( SHELL_hWnd, uMsg, wParam, 0 );
}
return CallNextHookEx16( WH_SHELL, code, wParam, lParam );
}
/*************************************************************************
* ShellHookProc [SHELL.103]
* RegisterShellHook [SHELL.102]
*/
int ShellHookProc(void)
BOOL32 RegisterShellHook(HWND16 hWnd, UINT16 uAction)
{
fprintf(stdnimp, "ShellHookProc : Empty Stub !!!\n");
return 0;
dprintf_reg(stddeb,"RegisterShellHook: %04x [%u]\n", hWnd, uAction );
switch( uAction )
{
case 2: /* register hWnd as a shell window */
if( !SHELL_hHook )
{
HMODULE16 hShell = GetModuleHandle16( "SHELL" );
SHELL_hHook = SetWindowsHookEx16( WH_SHELL, ShellHookProc,
hShell, 0 );
if( SHELL_hHook )
{
uMsgWndCreated = RegisterWindowMessage32A( lpstrMsgWndCreated );
uMsgWndDestroyed = RegisterWindowMessage32A( lpstrMsgWndDestroyed );
uMsgShellActivate = RegisterWindowMessage32A( lpstrMsgShellActivate );
}
else fprintf( stderr, "\tunable to install ShellHookProc()!\n");
}
if( SHELL_hHook ) return ((SHELL_hWnd = hWnd) != 0);
break;
default:
fprintf( stderr, "RegisterShellHook: unknown code %i\n", uAction );
/* just in case */
SHELL_hWnd = 0;
}
return FALSE;
}
/*************************************************************************
* SHGetFileInfoA [SHELL32.54]
*/

View File

@ -1346,6 +1346,8 @@ void DOS3Call( CONTEXT *context )
AX_reg(context) = DOS_ExtendedError;
SET_CFLAG(context);
}
else AX_reg(context) = 0x0100;
/* intlist: many Microsoft products for Windows rely on this */
break;
case 0x47: /* "CWD" - GET CURRENT DIRECTORY */

View File

@ -693,7 +693,7 @@ BOOL32 DestroyIcon32( HICON32 hIcon )
{
dprintf_icon( stddeb, "DestroyIcon: %04x\n", hIcon );
/* FIXME: should check for OEM icon here */
return (GlobalFree16( hIcon ) != 0);
return (GlobalFree16( hIcon ) == 0);
}

View File

@ -18,6 +18,47 @@
extern void CLIPPING_UpdateGCRegion(DC* );
/***********************************************************************
* DIB_GetImageWidthBytesX11
*
* Return the width of an X image in bytes
*/
int DIB_GetImageWidthBytesX11( int width, int depth )
{
int wbits;
XImage *testimage;
#define DEPTHCASE(depth) \
case depth: { \
static int w##depth = 0; \
if (! w##depth ) { \
testimage=XCreateImage(display,DefaultVisualOfScreen(screen),\
depth,ZPixmap,0,NULL,1,1,32,20); \
w##depth = testimage->bits_per_pixel; \
XDestroyImage(testimage); \
} \
wbits = width*w##depth; \
break; \
}
switch(depth)
{
DEPTHCASE(1);
DEPTHCASE(4);
DEPTHCASE(8);
DEPTHCASE(15);
DEPTHCASE(16);
DEPTHCASE(24);
DEPTHCASE(32);
default:
fprintf(stderr, "DIB: unsupported depth %d.\n", depth );
/* assume 32 bits/pixel */
wbits = width*32;
break;
}
return 4 * ((wbits+31)/32);
}
/***********************************************************************
* DIB_GetImageWidthBytes
*
@ -840,7 +881,7 @@ INT32 GetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
dibImage = XCreateImage(display, DefaultVisualOfScreen( screen ),
info->bmiHeader.biBitCount, ZPixmap, 0, bits,
info->bmiHeader.biWidth, info->bmiHeader.biHeight,
32, DIB_GetImageWidthBytes( info->bmiHeader.biWidth,
32, DIB_GetImageWidthBytesX11(info->bmiHeader.biWidth,
info->bmiHeader.biBitCount ) );
if( dibImage )
{

View File

@ -690,14 +690,48 @@ void PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
DeleteDC32(hdcSrc);
}
break;
/* --- Begin of new metafile operations. April, 1997 (ak) ----*/
case META_CREATEREGION:
{
int i;
HRGN32 h1,h2,hrgn=CreateRectRgn32(mr->rdParam[7],mr->rdParam[8],
mr->rdParam[9],mr->rdParam[10]);
for (i=0,h1=CreateRectRgn32(0,0,0,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,h1,h2,mr->rdParam[16+i*6]); /* e.g. RGN_OR */
h1=hrgn;
}
}
MF_AddHandle(ht, nHandles,hrgn);
}
break;
case META_FILLREGION:
FillRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)),
*(ht->objectHandle + *(mr->rdParam+1)));
break;
case META_INVERTREGION:
InvertRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)));
break;
case META_PAINTREGION:
PaintRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)));
break;
case META_SELECTCLIPREGION:
SelectClipRgn32(hdc, *(ht->objectHandle + *(mr->rdParam)));
break;
#define META_UNIMP(x) case x: fprintf(stderr,"PlayMetaFileRecord:record type "#x" not implemented.\n");break;
META_UNIMP(META_SETTEXTCHAREXTRA)
META_UNIMP(META_SETTEXTJUSTIFICATION)
META_UNIMP(META_FILLREGION)
META_UNIMP(META_FRAMEREGION)
META_UNIMP(META_INVERTREGION)
META_UNIMP(META_PAINTREGION)
META_UNIMP(META_SELECTCLIPREGION)
META_UNIMP(META_DRAWTEXT)
META_UNIMP(META_SETDIBTODEV)
META_UNIMP(META_ANIMATEPALETTE)

View File

@ -169,7 +169,8 @@ BOOL32 ResizePalette32( HPALETTE32 hPal, UINT32 cEntries )
int* mapping = NULL;
dprintf_palette(stddeb,"ResizePalette: hpal = %04x, prev = %i, new = %i\n",
hPal, (palPtr)? -1: palPtr->logpalette.palNumEntries, cEntries );
hPal, palPtr ? palPtr->logpalette.palNumEntries : -1,
cEntries );
if( !palPtr ) return FALSE;
cPrevEnt = palPtr->logpalette.palNumEntries;
prevVer = palPtr->logpalette.palVersion;
@ -178,7 +179,7 @@ BOOL32 ResizePalette32( HPALETTE32 hPal, UINT32 cEntries )
size += sizeof(int*) + sizeof(GDIOBJHDR);
mapping = palPtr->mapping;
GDI_HEAP_REALLOC( hPal, size );
hPal = GDI_HEAP_REALLOC( hPal, size );
palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC );
if( !palPtr ) return FALSE;

View File

@ -751,7 +751,16 @@ HANDLE32 GetStdHandle( DWORD std_handle )
return INVALID_HANDLE_VALUE32;
}
hFile = FILE_DupUnixHandle( fd );
if (hFile != HFILE_ERROR32) FILE_SetFileType( hFile, FILE_TYPE_CHAR );
if (hFile != HFILE_ERROR32)
{
FILE_SetFileType( hFile, FILE_TYPE_CHAR );
switch(std_handle)
{
case STD_INPUT_HANDLE: pCurrentProcess->env_db->hStdin=hFile; break;
case STD_OUTPUT_HANDLE: pCurrentProcess->env_db->hStdout=hFile; break;
case STD_ERROR_HANDLE: pCurrentProcess->env_db->hStderr=hFile; break;
}
}
return hFile;
}

View File

@ -8,10 +8,12 @@ MODULE = windows
C_SRCS = \
caret.c \
class.c \
clipboard.c \
dce.c \
defdlg.c \
defwnd.c \
dialog.c \
driver.c \
event.c \
focus.c \
graphics.c \
@ -24,11 +26,14 @@ C_SRCS = \
painting.c \
property.c \
queue.c \
rect.c \
scroll.c \
syscolor.c \
sysmetrics.c \
timer.c \
user.c \
win.c \
winhelp.c \
winpos.c \
winproc.c

View File

@ -1,781 +1,25 @@
/*
* GDI graphics operations
* X-specific shortcuts to speed up WM code.
* No coordinate transformations except origin translation.
*
* Copyright 1993, 1994 Alexandre Julliard
*/
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
#ifndef PI
#define PI M_PI
#endif
#include "graphics.h"
#include "bitmap.h"
#include "gdi.h"
#include "dc.h"
#include "bitmap.h"
#include "callback.h"
#include "metafile.h"
#include "syscolor.h"
#include "stddebug.h"
#include "palette.h"
#include "color.h"
#include "region.h"
#include "debug.h"
#include "xmalloc.h"
#define MAX_DRAWLINES 8
/***********************************************************************
* LineTo16 (GDI.19)
*/
BOOL16 LineTo16( HDC16 hdc, INT16 x, INT16 y )
{
return LineTo32( hdc, x, y );
}
/***********************************************************************
* LineTo32 (GDI32.249)
*/
BOOL32 LineTo32( HDC32 hdc, INT32 x, INT32 y )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pLineTo &&
dc->funcs->pLineTo(dc,x,y);
}
/***********************************************************************
* MoveTo (GDI.20)
*/
DWORD MoveTo( HDC16 hdc, INT16 x, INT16 y )
{
POINT16 pt;
if (!MoveToEx16(hdc,x,y,&pt))
return 0;
return MAKELONG(pt.x,pt.y);
}
/***********************************************************************
* MoveToEx16 (GDI.483)
*/
BOOL16 MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt )
{
POINT32 pt32;
if (!MoveToEx32( (HDC32)hdc, (INT32)x, (INT32)y, &pt32 )) return FALSE;
if (pt) CONV_POINT32TO16( &pt32, pt );
return TRUE;
}
/***********************************************************************
* MoveToEx32 (GDI32.254)
*/
BOOL32 MoveToEx32( HDC32 hdc, INT32 x, INT32 y, LPPOINT32 pt )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pMoveToEx &&
dc->funcs->pMoveToEx(dc,x,y,pt);
}
/***********************************************************************
* Arc16 (GDI.23)
*/
BOOL16 Arc16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom,
INT16 xstart, INT16 ystart, INT16 xend, INT16 yend )
{
return Arc32( (HDC32)hdc, (INT32)left, (INT32)top, (INT32)right,
(INT32)bottom, (INT32)xstart, (INT32)ystart, (INT32)xend,
(INT32)yend );
}
/***********************************************************************
* Arc32 (GDI32.7)
*/
BOOL32 Arc32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pArc &&
dc->funcs->pArc(dc,left,top,right,bottom,xstart,ystart,xend,yend);
}
/***********************************************************************
* Pie16 (GDI.26)
*/
BOOL16 Pie16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom,
INT16 xstart, INT16 ystart, INT16 xend, INT16 yend )
{
return Pie32( (HDC32)hdc, (INT32)left, (INT32)top, (INT32)right,
(INT32)bottom, (INT32)xstart, (INT32)ystart, (INT32)xend,
(INT32)yend );
}
/***********************************************************************
* Pie32 (GDI32.262)
*/
BOOL32 Pie32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPie &&
dc->funcs->pPie(dc,left,top,right,bottom,xstart,ystart,xend,yend);
}
/***********************************************************************
* Chord16 (GDI.348)
*/
BOOL16 Chord16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom,
INT16 xstart, INT16 ystart, INT16 xend, INT16 yend )
{
return Chord32( hdc, left, top, right, bottom, xstart, ystart, xend, yend );
}
/***********************************************************************
* Chord32 (GDI32.14)
*/
BOOL32 Chord32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xend, INT32 yend )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pChord &&
dc->funcs->pChord(dc,left,top,right,bottom,xstart,ystart,xend,yend);
}
/***********************************************************************
* Ellipse16 (GDI.24)
*/
BOOL16 Ellipse16( HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom )
{
return Ellipse32( hdc, left, top, right, bottom );
}
/***********************************************************************
* Ellipse32 (GDI32.75)
*/
BOOL32 Ellipse32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pEllipse &&
dc->funcs->pEllipse(dc,left,top,right,bottom);
}
/***********************************************************************
* Rectangle16 (GDI.27)
*/
BOOL16 Rectangle16(HDC16 hdc, INT16 left, INT16 top, INT16 right, INT16 bottom)
{
return Rectangle32( hdc, left, top, right, bottom );
}
/***********************************************************************
* Rectangle32 (GDI32.283)
*/
BOOL32 Rectangle32(HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom)
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pRectangle &&
dc->funcs->pRectangle(dc,left,top,right,bottom);
}
/***********************************************************************
* RoundRect16 (GDI.28)
*/
BOOL16 RoundRect16( HDC16 hdc, INT16 left, INT16 top, INT16 right,
INT16 bottom, INT16 ell_width, INT16 ell_height )
{
return RoundRect32( hdc, left, top, right, bottom, ell_width, ell_height );
}
/***********************************************************************
* RoundRect32 (GDI32.291)
*/
BOOL32 RoundRect32( HDC32 hdc, INT32 left, INT32 top, INT32 right,
INT32 bottom, INT32 ell_width, INT32 ell_height )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pRoundRect &&
dc->funcs->pRoundRect(dc,left,top,right,bottom,ell_width,ell_height);
}
/***********************************************************************
* FillRect16 (USER.81)
*/
INT16 FillRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
{
HBRUSH16 prevBrush;
/* coordinates are logical so we cannot fast-check 'rect',
* it will be done later in the PatBlt().
*/
if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
SelectObject16( hdc, prevBrush );
return 1;
}
/***********************************************************************
* FillRect32 (USER32.196)
*/
INT32 FillRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
{
HBRUSH32 prevBrush;
if (!(prevBrush = SelectObject32( hdc, hbrush ))) return 0;
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
SelectObject32( hdc, prevBrush );
return 1;
}
/***********************************************************************
* InvertRect16 (USER.82)
*/
void InvertRect16( HDC16 hdc, const RECT16 *rect )
{
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
}
/***********************************************************************
* InvertRect32 (USER32.329)
*/
void InvertRect32( HDC32 hdc, const RECT32 *rect )
{
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, DSTINVERT );
}
/***********************************************************************
* FrameRect16 (USER.83)
*/
INT16 FrameRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
{
HBRUSH16 prevBrush;
int left, top, right, bottom;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
left = XLPTODP( dc, rect->left );
top = YLPTODP( dc, rect->top );
right = XLPTODP( dc, rect->right );
bottom = YLPTODP( dc, rect->bottom );
if ( (right <= left) || (bottom <= top) ) return 0;
if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
if (DC_SetupGCForBrush( dc ))
{
PatBlt32( hdc, rect->left, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->right - 1, rect->top, 1,
rect->bottom - rect->top, PATCOPY );
PatBlt32( hdc, rect->left, rect->top,
rect->right - rect->left, 1, PATCOPY );
PatBlt32( hdc, rect->left, rect->bottom - 1,
rect->right - rect->left, 1, PATCOPY );
}
SelectObject16( hdc, prevBrush );
return 1;
}
/***********************************************************************
* FrameRect32 (USER32.202)
*/
INT32 FrameRect32( HDC32 hdc, const RECT32 *rect, HBRUSH32 hbrush )
{
RECT16 rect16;
CONV_RECT32TO16( rect, &rect16 );
return FrameRect16( (HDC16)hdc, &rect16, (HBRUSH16)hbrush );
}
/***********************************************************************
* SetPixel16 (GDI.31)
*/
COLORREF SetPixel16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
{
return SetPixel32( hdc, x, y, color );
}
/***********************************************************************
* SetPixel32 (GDI32.327)
*/
COLORREF SetPixel32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
{
DC * dc = DC_GetDCPtr( hdc );
if (!dc || !dc->funcs->pSetPixel) return 0;
return dc->funcs->pSetPixel(dc,x,y,color);
}
/***********************************************************************
* GetPixel16 (GDI.83)
*/
COLORREF GetPixel16( HDC16 hdc, INT16 x, INT16 y )
{
return GetPixel32( hdc, x, y );
}
/***********************************************************************
* GetPixel32 (GDI32.211)
*/
COLORREF GetPixel32( HDC32 hdc, INT32 x, INT32 y )
{
DC * dc = DC_GetDCPtr( hdc );
if (!dc) return 0;
#ifdef SOLITAIRE_SPEED_HACK
return 0;
#endif
/* FIXME: should this be in the graphics driver? */
if (!PtVisible32( hdc, x, y )) return 0;
if (!dc || !dc->funcs->pGetPixel) return 0;
return dc->funcs->pGetPixel(dc,x,y);
}
/***********************************************************************
* PaintRgn16 (GDI.43)
*/
BOOL16 PaintRgn16( HDC16 hdc, HRGN16 hrgn )
{
return PaintRgn32( hdc, hrgn );
}
/***********************************************************************
* PaintRgn32 (GDI32.259)
*/
BOOL32 PaintRgn32( HDC32 hdc, HRGN32 hrgn )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPaintRgn &&
dc->funcs->pPaintRgn(dc,hrgn);
}
/***********************************************************************
* FillRgn16 (GDI.40)
*/
BOOL16 FillRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush )
{
return FillRgn32( hdc, hrgn, hbrush );
}
/***********************************************************************
* FillRgn32 (GDI32.101)
*/
BOOL32 FillRgn32( HDC32 hdc, HRGN32 hrgn, HBRUSH32 hbrush )
{
BOOL32 retval;
HBRUSH32 prevBrush = SelectObject32( hdc, hbrush );
if (!prevBrush) return FALSE;
retval = PaintRgn32( hdc, hrgn );
SelectObject32( hdc, prevBrush );
return retval;
}
/***********************************************************************
* FrameRgn16 (GDI.41)
*/
BOOL16 FrameRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush,
INT16 nWidth, INT16 nHeight )
{
return FrameRgn32( hdc, hrgn, hbrush, nWidth, nHeight );
}
/***********************************************************************
* FrameRgn32 (GDI32.105)
*/
BOOL32 FrameRgn32( HDC32 hdc, HRGN32 hrgn, HBRUSH32 hbrush,
INT32 nWidth, INT32 nHeight )
{
HRGN32 tmp = CreateRectRgn32( 0, 0, 0, 0 );
if(!REGION_FrameRgn( tmp, hrgn, nWidth, nHeight )) return FALSE;
FillRgn32( hdc, tmp, hbrush );
DeleteObject32( tmp );
return TRUE;
}
/***********************************************************************
* InvertRgn16 (GDI.42)
*/
BOOL16 InvertRgn16( HDC16 hdc, HRGN16 hrgn )
{
return InvertRgn32( hdc, hrgn );
}
/***********************************************************************
* InvertRgn32 (GDI32.246)
*/
BOOL32 InvertRgn32( HDC32 hdc, HRGN32 hrgn )
{
HBRUSH32 prevBrush = SelectObject32( hdc, GetStockObject32(BLACK_BRUSH) );
INT32 prevROP = SetROP232( hdc, R2_NOT );
BOOL32 retval = PaintRgn32( hdc, hrgn );
SelectObject32( hdc, prevBrush );
SetROP232( hdc, prevROP );
return retval;
}
/***********************************************************************
* DrawFocusRect16 (USER.466)
*/
void DrawFocusRect16( HDC16 hdc, const RECT16* rc )
{
RECT32 rect32;
CONV_RECT16TO32( rc, &rect32 );
DrawFocusRect32( hdc, &rect32 );
}
/***********************************************************************
* DrawFocusRect32 (USER32.155)
*
* FIXME: should use Rectangle32!
*/
void DrawFocusRect32( HDC32 hdc, const RECT32* rc )
{
HPEN32 hOldPen;
INT32 oldDrawMode, oldBkMode;
INT32 left, top, right, bottom;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return;
left = XLPTODP( dc, rc->left );
top = YLPTODP( dc, rc->top );
right = XLPTODP( dc, rc->right );
bottom = YLPTODP( dc, rc->bottom );
hOldPen = SelectObject32( hdc, sysColorObjects.hpenWindowText );
oldDrawMode = SetROP232(hdc, R2_XORPEN);
oldBkMode = SetBkMode32(hdc, TRANSPARENT);
/* Hack: make sure the XORPEN operation has an effect */
dc->u.x.pen.pixel = (1 << screenDepth) - 1;
if (DC_SetupGCForPen( dc ))
XDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
SetBkMode32(hdc, oldBkMode);
SetROP232(hdc, oldDrawMode);
SelectObject32(hdc, hOldPen);
}
/**********************************************************************
* Polyline16 (GDI.37)
*/
BOOL16 Polyline16( HDC16 hdc, LPPOINT16 pt, INT16 count )
{
register int i;
LPPOINT32 pt32 = (LPPOINT32)xmalloc(count*sizeof(POINT32));
BOOL16 ret;
for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
ret = Polyline32(hdc,pt32,count);
free(pt32);
return ret;
}
/**********************************************************************
* Polyline32 (GDI32.276)
*/
BOOL32 Polyline32( HDC32 hdc, const LPPOINT32 pt, INT32 count )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolyline &&
dc->funcs->pPolyline(dc,pt,count);
}
/**********************************************************************
* Polygon16 (GDI.36)
*/
BOOL16 Polygon16( HDC16 hdc, LPPOINT16 pt, INT16 count )
{
register int i;
LPPOINT32 pt32 = (LPPOINT32)xmalloc(count*sizeof(POINT32));
BOOL32 ret;
for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
ret = Polygon32(hdc,pt32,count);
free(pt32);
return ret;
}
/**********************************************************************
* Polygon32 (GDI32.275)
*/
BOOL32 Polygon32( HDC32 hdc, LPPOINT32 pt, INT32 count )
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolygon &&
dc->funcs->pPolygon(dc,pt,count);
}
/**********************************************************************
* PolyPolygon16 (GDI.450)
*/
BOOL16 PolyPolygon16( HDC16 hdc, LPPOINT16 pt, LPINT16 counts, UINT16 polygons)
{
int i,nrpts;
LPPOINT32 pt32;
LPINT32 counts32;
BOOL16 ret;
nrpts=0;
for (i=polygons;i--;)
nrpts+=counts[i];
pt32 = (LPPOINT32)xmalloc(sizeof(POINT32)*nrpts);
for (i=nrpts;i--;)
CONV_POINT16TO32(&(pt[i]),&(pt32[i]));
counts32 = (LPINT32)xmalloc(polygons*sizeof(INT32));
for (i=polygons;i--;) counts32[i]=counts[i];
ret = PolyPolygon32(hdc,pt32,counts32,polygons);
free(counts32);
free(pt32);
return ret;
}
/**********************************************************************
* PolyPolygon32 (GDI.450)
*/
BOOL32 PolyPolygon32( HDC32 hdc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons)
{
DC * dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pPolyPolygon &&
dc->funcs->pPolyPolygon(dc,pt,counts,polygons);
}
/**********************************************************************
* ExtFloodFill16 (GDI.372)
*/
BOOL16 ExtFloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color,
UINT16 fillType )
{
return ExtFloodFill32( hdc, x, y, color, fillType );
}
/**********************************************************************
* ExtFloodFill32 (GDI32.96)
*/
BOOL32 ExtFloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color,
UINT32 fillType )
{
DC *dc = DC_GetDCPtr( hdc );
return dc && dc->funcs->pExtFloodFill &&
dc->funcs->pExtFloodFill(dc,x,y,color,fillType);
}
/**********************************************************************
* FloodFill16 (GDI.25)
*/
BOOL16 FloodFill16( HDC16 hdc, INT16 x, INT16 y, COLORREF color )
{
return ExtFloodFill32( hdc, x, y, color, FLOODFILLBORDER );
}
/**********************************************************************
* FloodFill32 (GDI32.104)
*/
BOOL32 FloodFill32( HDC32 hdc, INT32 x, INT32 y, COLORREF color )
{
return ExtFloodFill32( hdc, x, y, color, FLOODFILLBORDER );
}
/**********************************************************************
* DrawEdge16 (USER.659)
*/
BOOL16 DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
{
RECT32 rect32;
BOOL32 ret;
CONV_RECT16TO32( rc, &rect32 );
ret = DrawEdge32( hdc, &rect32, edge, flags );
CONV_RECT32TO16( &rect32, rc );
return ret;
}
/**********************************************************************
* DrawEdge32 (USER32.154)
*/
BOOL32 DrawEdge32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
HBRUSH32 hbrushOld;
if (flags >= BF_DIAGONAL)
fprintf( stderr, "DrawEdge: unsupported flags %04x\n", flags );
dprintf_graphics( stddeb, "DrawEdge: %04x %d,%d-%d,%d %04x %04x\n",
hdc, rc->left, rc->top, rc->right, rc->bottom,
edge, flags );
/* First do all the raised edges */
hbrushOld = SelectObject32( hdc, sysColorObjects.hbrushBtnHighlight );
if (edge & BDR_RAISEDOUTER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
1, rc->bottom - rc->top - 1, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
rc->right - rc->left - 1, 1, PATCOPY );
}
if (edge & BDR_SUNKENOUTER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
1, rc->bottom - rc->top, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
rc->right - rc->left, 1, PATCOPY );
}
if (edge & BDR_RAISEDINNER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
rc->right - rc->left - 2, 1, PATCOPY );
}
if (edge & BDR_SUNKENINNER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
rc->right - rc->left - 2, 1, PATCOPY );
}
/* Then do all the sunken edges */
SelectObject32( hdc, sysColorObjects.hbrushBtnShadow );
if (edge & BDR_SUNKENOUTER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left, rc->top,
1, rc->bottom - rc->top - 1, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left, rc->top,
rc->right - rc->left - 1, 1, PATCOPY );
}
if (edge & BDR_RAISEDOUTER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 1, rc->top,
1, rc->bottom - rc->top, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left, rc->bottom - 1,
rc->right - rc->left, 1, PATCOPY );
}
if (edge & BDR_SUNKENINNER)
{
if (flags & BF_LEFT) PatBlt32( hdc, rc->left + 1, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_TOP) PatBlt32( hdc, rc->left + 1, rc->top + 1,
rc->right - rc->left - 2, 1, PATCOPY );
}
if (edge & BDR_RAISEDINNER)
{
if (flags & BF_RIGHT) PatBlt32( hdc, rc->right - 2, rc->top + 1,
1, rc->bottom - rc->top - 2, PATCOPY );
if (flags & BF_BOTTOM) PatBlt32( hdc, rc->left + 1, rc->bottom - 2,
rc->right - rc->left - 2, 1, PATCOPY );
}
SelectObject32( hdc, hbrushOld );
return TRUE;
}
/**********************************************************************
* DrawFrameControl16 (USER.656)
*/
BOOL16 DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags )
{
fprintf( stdnimp,"DrawFrameControl16(%x,%p,%d,%x), empty stub!\n",
hdc,rc,edge,flags );
return TRUE;
}
/**********************************************************************
* DrawFrameControl32 (USER32.157)
*/
BOOL32 DrawFrameControl32( HDC32 hdc, LPRECT32 rc, UINT32 edge, UINT32 flags )
{
fprintf( stdnimp,"DrawFrameControl32(%x,%p,%d,%x), empty stub!\n",
hdc,rc,edge,flags );
return TRUE;
}
/******************************* X-specific shortcuts to speed up WM code.
* `----------------------------------------
*
* Caveat: no coordinate transformations except origin translation.
*/
/**********************************************************************
*
* GRAPH_DrawLines
*
* Draw multiple unconnected lines (limited by MAX_DRAWLINES).

View File

@ -575,12 +575,13 @@ static void HOOK_UnMap32To16Common(INT32 id, INT32 code, WPARAM32 wParamOrig,
case WH_CALLWNDPROC:
{
void (*localUnMap)(UINT32, WPARAM16, LPARAM, LRESULT)
void (*localUnMap)(UINT32, WPARAM32, LPARAM, MSGPARAM16* )
= (bA) ? WINPROC_UnmapMsg32ATo16 : WINPROC_UnmapMsg32WTo16;
LPCWPSTRUCT16 lpcwp16 = (LPCWPSTRUCT16)PTR_SEG_TO_LIN(lParam);
LPCWPSTRUCT32 lpcwp32 = (LPCWPSTRUCT32)lParamOrig;
MSGPARAM16 mp16 = { lpcwp16->wParam, lpcwp16->lParam, 0 };
(*localUnMap)(lpcwp32->message, lpcwp16->wParam, lpcwp16->lParam, 0 );
(*localUnMap)(lpcwp32->message, lpcwp32->wParam, lpcwp32->lParam, &mp16 );
SEGPTR_FREE( PTR_SEG_TO_LIN(lParam) );
break;
}

View File

@ -1035,50 +1035,76 @@ INT32 ToAscii32(
switch (keysym)
{
/* symbolic ASCII is the same as defined in rfc1345 */
#ifdef XK_dead_tilde
case XK_dead_tilde :
#endif
case 0x1000FE7E : /* Xfree's XK_Dtilde */
dead_char = '~'; /* '? */
break;
#ifdef XK_dead_acute
case XK_dead_acute :
#endif
case 0x1000FE27 : /* Xfree's XK_Dacute_accent */
dead_char = 0xb4; /* '' */
break;
#ifdef XK_dead_circumflex
case XK_dead_circumflex :
#endif
case 0x1000FE5E : /* Xfree's XK_Dcircumflex_accent */
dead_char = '^'; /* '> */
break;
#ifdef XK_dead_grave
case XK_dead_grave :
#endif
case 0x1000FE60 : /* Xfree's XK_Dgrave_accent */
dead_char = '`'; /* '! */
break;
#ifdef XK_dead_diaeresis
case XK_dead_diaeresis :
#endif
case 0x1000FE22 : /* Xfree's XK_Ddiaeresis */
dead_char = 0xa8; /* ': */
break;
#ifdef XK_dead_cedilla
case XK_dead_cedilla :
dead_char = 0xb8; /* ', */
break;
#endif
#ifdef XK_dead_macron
case XK_dead_macron :
dead_char = '-'; /* 'm isn't defined on iso-8859-x */
break;
#endif
#ifdef XK_dead_breve
case XK_dead_breve :
dead_char = 0xa2; /* '( */
break;
#endif
#ifdef XK_dead_abovedot
case XK_dead_abovedot :
dead_char = 0xff; /* '. */
break;
#endif
#ifdef XK_dead_abovering
case XK_dead_abovering :
dead_char = '0'; /* '0 isn't defined on iso-8859-x */
break;
#endif
#ifdef XK_dead_doubleacute
case XK_dead_doubleacute :
dead_char = 0xbd; /* '" */
break;
#endif
#ifdef XK_dead_caron
case XK_dead_caron :
dead_char = 0xb7; /* '< */
break;
#endif
#ifdef XK_dead_ogonek
case XK_dead_ogonek :
dead_char = 0xb2; /* '; */
break;
#endif
/* FIXME: I don't know this three.
case XK_dead_iota :
dead_char = 'i';

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
#include "heap.h"
#include "gdi.h"
#include "user.h"
#include "task.h"
@ -137,3 +138,67 @@ void USER_AppExit( HTASK16 hTask, HINSTANCE16 hInstance, HQUEUE16 hQueue )
QUEUE_DeleteMsgQueue( hQueue );
}
/***********************************************************************
* USER_ExitWindows
*
* Clean-up everything and exit the Wine process.
* This is the back-end of ExitWindows(), called when all windows
* have agreed to be terminated.
*/
void USER_ExitWindows(void)
{
/* Do the clean-up stuff */
WriteOutProfiles();
SHELL_SaveRegistry();
exit(0);
}
/***********************************************************************
* ExitWindows16 (USER.7)
*/
BOOL16 ExitWindows16( DWORD dwReturnCode, UINT16 wReserved )
{
return ExitWindowsEx( EWX_LOGOFF, 0xffffffff );
}
/***********************************************************************
* ExitWindowsEx (USER32.195)
*/
BOOL32 ExitWindowsEx( UINT32 flags, DWORD reserved )
{
int i;
BOOL32 result;
WND **list, **ppWnd;
/* We have to build a list of all windows first, as in EnumWindows */
if (!(list = WIN_BuildWinArray( WIN_GetDesktop() ))) return FALSE;
/* Send a WM_QUERYENDSESSION message to every window */
for (ppWnd = list, i = 0; *ppWnd; ppWnd++, i++)
{
/* Make sure that the window still exists */
if (!IsWindow32( (*ppWnd)->hwndSelf )) continue;
if (!SendMessage16( (*ppWnd)->hwndSelf, WM_QUERYENDSESSION, 0, 0 ))
break;
}
result = !(*ppWnd);
/* Now notify all windows that got a WM_QUERYENDSESSION of the result */
for (ppWnd = list; i > 0; i--, ppWnd++)
{
if (!IsWindow32( (*ppWnd)->hwndSelf )) continue;
SendMessage16( (*ppWnd)->hwndSelf, WM_ENDSESSION, result, 0 );
}
HeapFree( SystemHeap, 0, list );
if (result) USER_ExitWindows();
return FALSE;
}

View File

@ -1,5 +1,5 @@
/*
* Windows Exec & Help
* Windows Help
*/
#include <stdlib.h>
@ -8,76 +8,7 @@
#include <unistd.h>
#include "windows.h"
#include "heap.h"
#include "neexe.h"
#include "shell.h"
#include "stddebug.h"
#include "debug.h"
#include "win.h"
/***********************************************************************
* EXEC_ExitWindows
*
* Clean-up everything and exit the Wine process.
* This is the back-end of ExitWindows(), called when all windows
* have agreed to be terminated.
*/
void EXEC_ExitWindows(void)
{
/* Do the clean-up stuff */
WriteOutProfiles();
SHELL_SaveRegistry();
exit(0);
}
/***********************************************************************
* ExitWindows16 (USER.7)
*/
BOOL16 ExitWindows16( DWORD dwReturnCode, UINT16 wReserved )
{
return ExitWindowsEx( EWX_LOGOFF, 0xffffffff );
}
/***********************************************************************
* ExitWindowsEx (USER32.195)
*/
BOOL32 ExitWindowsEx( UINT32 flags, DWORD reserved )
{
int i;
BOOL32 result;
WND **list, **ppWnd;
/* We have to build a list of all windows first, as in EnumWindows */
if (!(list = WIN_BuildWinArray( WIN_GetDesktop() ))) return FALSE;
/* Send a WM_QUERYENDSESSION message to every window */
for (ppWnd = list, i = 0; *ppWnd; ppWnd++, i++)
{
/* Make sure that the window still exists */
if (!IsWindow32( (*ppWnd)->hwndSelf )) continue;
if (!SendMessage16( (*ppWnd)->hwndSelf, WM_QUERYENDSESSION, 0, 0 ))
break;
}
result = !(*ppWnd);
/* Now notify all windows that got a WM_QUERYENDSESSION of the result */
for (ppWnd = list; i > 0; i--, ppWnd++)
{
if (!IsWindow32( (*ppWnd)->hwndSelf )) continue;
SendMessage16( (*ppWnd)->hwndSelf, WM_ENDSESSION, result, 0 );
}
HeapFree( SystemHeap, 0, list );
if (result) EXEC_ExitWindows();
return FALSE;
}
#include "ldt.h"
/**********************************************************************

View File

@ -17,7 +17,7 @@
#include "stddebug.h"
#include "debug.h"
/* Window procedure 16--to-32-bit thunk,
/* Window procedure 16-to-32-bit thunk,
* see BuildSpec16Files() in tools/build.c */
typedef struct
@ -1416,8 +1416,8 @@ INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
*
* Unmap a message that was mapped from 32-bit Ansi to 16-bit.
*/
void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
LPARAM lParam, LRESULT lResult )
void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM32 wParam,
LPARAM lParam, MSGPARAM16* p16 )
{
switch(msg)
{
@ -1439,15 +1439,15 @@ void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
case WM_DELETEITEM:
case WM_DRAWITEM:
case WM_SETTEXT:
SEGPTR_FREE( PTR_SEG_TO_LIN(lParam) );
SEGPTR_FREE( PTR_SEG_TO_LIN(p16->lParam) );
break;
case CB_GETDROPPEDCONTROLRECT32:
case LB_GETITEMRECT32:
{
RECT16 *rect = (RECT16 *)PTR_SEG_TO_LIN(lParam);
lParam = *(LPARAM *)(rect + 1);
CONV_RECT16TO32( rect, (RECT32 *)lParam );
RECT16 *rect = (RECT16 *)PTR_SEG_TO_LIN(p16->lParam);
p16->lParam = *(LPARAM *)(rect + 1);
CONV_RECT16TO32( rect, (RECT32 *)(p16->lParam));
SEGPTR_FREE( rect );
}
break;
@ -1455,29 +1455,27 @@ void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
{
INT32 i;
LPINT16 items = (LPINT16)PTR_SEG_TO_LIN(lParam);
lParam = *((LPARAM *)items - 1);
for (i = 0; i < wParam; i++) *((LPINT32)lParam + i) = items[i];
p16->lParam = *((LPARAM *)items - 1);
for (i = 0; i < p16->wParam; i++) *((LPINT32)(p16->lParam) + i) = items[i];
SEGPTR_FREE( (LPARAM *)items - 1 );
}
break;
case CB_GETEDITSEL32:
/*
if( wParam )
*((LPUINT32)wParam) = LOWORD(lResult);
*((LPUINT32)(wParam)) = LOWORD(p16->lResult);
if( lParam )
*((LPUINT32)lParam) = HIWORD(lResult);
*/
*((LPUINT32)(lParam)) = HIWORD(p16->lResult); /* FIXME: substract 1? */
break;
case LB_GETTEXT32:
case CB_GETLBTEXT32:
UnMapLS( (SEGPTR)lParam );
UnMapLS( (SEGPTR)(p16->lParam) );
break;
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT16 *mis = (MEASUREITEMSTRUCT16 *)PTR_SEG_TO_LIN(lParam);
MEASUREITEMSTRUCT16 *mis = (MEASUREITEMSTRUCT16 *)PTR_SEG_TO_LIN(p16->lParam);
MEASUREITEMSTRUCT32 *mis32 = *(MEASUREITEMSTRUCT32 **)(mis + 1);
mis32->itemWidth = mis->itemWidth;
mis32->itemHeight = mis->itemHeight;
@ -1486,23 +1484,23 @@ void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
break;
case WM_GETMINMAXINFO:
{
MINMAXINFO16 *mmi = (MINMAXINFO16 *)PTR_SEG_TO_LIN(lParam);
lParam = *(LPARAM *)(mmi + 1);
STRUCT32_MINMAXINFO16to32( mmi, (MINMAXINFO32 *)lParam );
MINMAXINFO16 *mmi = (MINMAXINFO16 *)PTR_SEG_TO_LIN(p16->lParam);
p16->lParam = *(LPARAM *)(mmi + 1);
STRUCT32_MINMAXINFO16to32( mmi, (MINMAXINFO32 *)(p16->lParam) );
SEGPTR_FREE(mmi);
}
break;
case WM_GETTEXT:
{
LPSTR str = (LPSTR)PTR_SEG_TO_LIN(lParam);
lParam = *((LPARAM *)str - 1);
lstrcpyn32A( (LPSTR)lParam, str, wParam );
LPSTR str = (LPSTR)PTR_SEG_TO_LIN(p16->lParam);
p16->lParam = *((LPARAM *)str - 1);
lstrcpyn32A( (LPSTR)(p16->lParam), str, p16->wParam );
SEGPTR_FREE( (LPARAM *)str - 1 );
}
break;
case WM_MDICREATE:
{
MDICREATESTRUCT16 *cs = (MDICREATESTRUCT16*)PTR_SEG_TO_LIN(lParam);
MDICREATESTRUCT16 *cs = (MDICREATESTRUCT16*)PTR_SEG_TO_LIN(p16->lParam);
SEGPTR_FREE( PTR_SEG_TO_LIN(cs->szTitle) );
SEGPTR_FREE( PTR_SEG_TO_LIN(cs->szClass) );
SEGPTR_FREE( cs );
@ -1511,11 +1509,11 @@ void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
case WM_NCCALCSIZE:
{
NCCALCSIZE_PARAMS32 *nc32;
NCCALCSIZE_PARAMS16 *nc = (NCCALCSIZE_PARAMS16 *)PTR_SEG_TO_LIN(lParam);
lParam = *(LPARAM *)(nc + 1);
nc32 = (NCCALCSIZE_PARAMS32 *)lParam;
NCCALCSIZE_PARAMS16 *nc = (NCCALCSIZE_PARAMS16 *)PTR_SEG_TO_LIN(p16->lParam);
p16->lParam = *(LPARAM *)(nc + 1);
nc32 = (NCCALCSIZE_PARAMS32 *)(p16->lParam);
CONV_RECT16TO32( &nc->rgrc[0], &nc32->rgrc[0] );
if (wParam)
if (p16->wParam)
{
CONV_RECT16TO32( &nc->rgrc[1], &nc32->rgrc[1] );
CONV_RECT16TO32( &nc->rgrc[2], &nc32->rgrc[2] );
@ -1529,7 +1527,7 @@ void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
case WM_NCCREATE:
case WM_CREATE:
{
CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(lParam);
CREATESTRUCT16 *cs = (CREATESTRUCT16 *)PTR_SEG_TO_LIN(p16->lParam);
SEGPTR_FREE( PTR_SEG_TO_LIN(cs->lpszName) );
SEGPTR_FREE( PTR_SEG_TO_LIN(cs->lpszClass) );
SEGPTR_FREE( cs );
@ -1538,9 +1536,9 @@ void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM16 wParam,
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS16 *wp = (WINDOWPOS16 *)PTR_SEG_TO_LIN(lParam);
lParam = *(LPARAM *)(wp + 1);
STRUCT32_WINDOWPOS16to32( wp, (WINDOWPOS32 *)lParam );
WINDOWPOS16 *wp = (WINDOWPOS16 *)PTR_SEG_TO_LIN(p16->lParam);
p16->lParam = *(LPARAM *)(wp + 1);
STRUCT32_WINDOWPOS16to32( wp, (WINDOWPOS32 *)p16->lParam );
SEGPTR_FREE(wp);
}
break;
@ -1646,21 +1644,21 @@ INT32 WINPROC_MapMsg32WTo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
*
* Unmap a message that was mapped from 32-bit Unicode to 16-bit.
*/
void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM16 wParam,
LPARAM lParam, LRESULT lResult )
void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM32 wParam,
LPARAM lParam, MSGPARAM16* p16 )
{
switch(msg)
{
case WM_GETTEXT:
{
LPSTR str = (LPSTR)PTR_SEG_TO_LIN(lParam);
lParam = *((LPARAM *)str - 1);
lstrcpyAtoW( (LPWSTR)lParam, str );
LPSTR str = (LPSTR)PTR_SEG_TO_LIN(p16->lParam);
p16->lParam = *((LPARAM *)str - 1);
lstrcpyAtoW( (LPWSTR)(p16->lParam), str );
SEGPTR_FREE( (LPARAM *)str - 1 );
}
break;
default:
WINPROC_UnmapMsg32ATo16( msg, wParam, lParam, lResult );
WINPROC_UnmapMsg32ATo16( msg, wParam, lParam, p16 );
break;
}
}
@ -1753,19 +1751,20 @@ static LRESULT WINPROC_CallProc32ATo16( WNDPROC16 func, HWND32 hwnd,
UINT32 msg, WPARAM32 wParam,
LPARAM lParam )
{
LRESULT result;
UINT16 msg16;
WPARAM16 wParam16;
MSGPARAM16 mp16;
WND *wndPtr = WIN_FindWndPtr( hwnd );
WORD ds = CURRENT_DS;
if (WINPROC_MapMsg32ATo16( msg, wParam, &msg16, &wParam16, &lParam ) == -1)
mp16.lParam = lParam;
if (WINPROC_MapMsg32ATo16( msg, wParam,
&msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
if (wndPtr) CURRENT_DS = wndPtr->hInstance;
result = CallWndProc16( func, hwnd, msg16, wParam16, lParam );
mp16.lResult = CallWndProc16( func, hwnd, msg16, mp16.wParam, mp16.lParam );
CURRENT_DS = ds;
WINPROC_UnmapMsg32ATo16( msg, wParam16, lParam, result );
return result;
WINPROC_UnmapMsg32ATo16( msg, wParam, lParam, &mp16 );
return mp16.lResult;
}
@ -1778,19 +1777,19 @@ static LRESULT WINPROC_CallProc32WTo16( WNDPROC16 func, HWND32 hwnd,
UINT32 msg, WPARAM32 wParam,
LPARAM lParam )
{
LRESULT result;
UINT16 msg16;
WPARAM16 wParam16;
MSGPARAM16 mp16;
WND *wndPtr = WIN_FindWndPtr( hwnd );
WORD ds = CURRENT_DS;
if (WINPROC_MapMsg32WTo16( msg, wParam, &msg16, &wParam16, &lParam ) == -1)
mp16.lParam = lParam;
if (WINPROC_MapMsg32WTo16( msg, wParam, &msg16, &mp16.wParam, &mp16.lParam ) == -1)
return 0;
if (wndPtr) CURRENT_DS = wndPtr->hInstance;
result = CallWndProc16( func, hwnd, msg16, wParam16, lParam );
mp16.lResult = CallWndProc16( func, hwnd, msg16, mp16.wParam, mp16.lParam );
CURRENT_DS = ds;
WINPROC_UnmapMsg32WTo16( msg, wParam16, lParam, result );
return result;
WINPROC_UnmapMsg32WTo16( msg, wParam, lParam, &mp16 );
return mp16.lResult;
}

View File

@ -65,15 +65,15 @@ Enter the debugger before starting application
.I -debugmsg name[,name]
Turn debugging messages on or off - for instance,
.I -debugmsg +dll,+heap
will turn on DLL and heap debugging messages. The full list is:
all, accel, atom, bitblt, bitmap, caret, cdaudio, class, clipboard, clipping,
combo, comm, commdlg, crtdll, cursor, dc, dde, dialog, dll, dosfs, driver, edit,
env, event, exec, file, fixup, font, gdi, global, graphics, heap, hook, icon,
int, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi, menu,
message, metafile, midi, mmio, mmsys, mmtime, module, msg, nonclient, ole,
palette, profile, prop, reg, region, relay, resource, scroll, selector,
sem, sendmsg, shm, stress, syscolor, task, text, timer, toolhelp, ver, vxd, win,
win32, winsock.
will turn on DLL and heap debugging messages. The full list is: all, accel,
atom, bitblt, bitmap, caret, cdaudio, class, clipboard, clipping, combo,
comm, commdlg, crtdll, cursor, dc, dde, dialog, dll, dosfs, driver, edit,
env, event, exec, file, fixup, font, gdi, global, graphics, heap, hook,
icon, int, key, keyboard, ldt, listbox, local, mci, mcianim, mciwave, mdi,
menu, message, metafile, midi, mmio, mmsys, mmtime, module, msg, nonclient,
ole, palette, profile, prop, reg, region, relay, resource, scroll, selector,
sem, sendmsg, shm, stress, string, syscolor, task, text, timer, toolhelp,
ver, vxd, win, win32, winsock.
.TP
.I -depth n
Change the depth to use for multiple-depth screens