Group commit for recovery after disk crash.

See Changelog for changes WRT release 990110.
This commit is contained in:
Alexandre Julliard 1999-01-17 16:55:11 +00:00
parent 638f169b1e
commit 8da12c43a9
81 changed files with 1870 additions and 1175 deletions

172
ChangeLog
View File

@ -1,3 +1,175 @@
Sun Jan 17 17:48:48 1999 Alexandre Julliard <julliard@winehq.com>
* ChangeLog:
Recovered log entries from CVS mailing list.
* relay32/ntdll.spec, dlls/ntdll/rtl.c:
Marcus Meissner <marcus@jet.franken.de>
Implemented _alloca_probe and _chkstk (mostly done by Ulrich Weigand).
* files/file.c
Marcus Meissner <marcus@jet.franken.de>
Handle ERROR_WRITE_PROTECT too in readonly fallback open.
* dlls/advapi32/security.c, relay32/advapi32.spec:
Marcus Meissner <marcus@jet.franken.de>
Added GetSecurityDescriptorLength stub for regedt32.exe.
* debugger/Makefile.in, files/Makefile.in:
Marcus Meissner <marcus@jet.franken.de>
Add "" around -D defines for paths with spaces in them.
* graphics/d3dtexture.c, graphics/ddraw.c, include/ddraw.h:
Lionel Ulmer <ulmer@directprovider.net>
Cleaned up ColorKey handling.
* objects/metafile.c:
Paul Quinn <paulq@COREL.CA>
METARECORD member rdParam should be rdParm (in win32 sdk)
lots of changes in this source file to reflect this change.
* graphics/escape.c, graphics/painting.c, graphics/metafiledrv/init.c, include/commctrl.h, include/commdlg.h, include/gdi.h, include/tchar.h, include/windows.h, include/wingdi.h, include/wintypes.h, include/winuser.h, misc/spooler.c, objects/gdiobj.c,
relay32/gdi32.spec:
Paul Quinn <paulq@COREL.CA>
Fixed bad defines, added a few types 'n defines.
* windows/dinput.c:
Marcus Meissner <marcus@jet.franken.de>
Disable broken callbacks which lead to crashes.
* multimedia/mcistring.c:
Eric Pouech <Eric.Pouech@wanadoo.fr>
Fixed ID usage (and rely less heavily on multimedia/mmsystem.c
internal structures).
* misc/toolhelp.c:
Marcus Meissner <marcus@jet.franken.de>
debug.h needs to be included last since it #undefs ERR for Solaris.
* debugger/debug.l, debugger/memory.c:
Marcus Meissner <marcus@jet.franken.de>
Added /u format to debugger display for UNICODE strings.
* loader/pe_image.c:
Marcus Meissner <marcus@jet.franken.de>
Remove irritating FIXME line no longer needed.
* msdos/int2f.c:
Eric Pouech <Eric.Pouech@wanadoo.fr>
Added missing '\n' in FIXME message.
* graphics/ddraw.c:
Robert Riggs <rriggs@tesser.com>
objbase.h needed for WINE_StringFromCLSID(), fix C function
declarations, install a colormap if we are not managed, release
backbuffers in DGA mode, fix video mode switching logic to avoid
possible NULL pointer dereference.
* msdos/dpmi.c:
Andreas Mohr <mohr@elektron.ikp.physik.tu-darmstadt.de>
Small fix.
* files/file.c, include/file.h, include/process.h, loader/resource.c, loader/dos/module.c, loader/ne/segment.c, misc/lzexpand.c, msdos/int21.c vxd.c, multimedia/mmio.c, win32/kernel32.c:
Better DOS file handle management.
* documentation/common_controls:
Francis Beaudet <francis@macadamian.com>
This should help prevent duplicate work.
* if1632/gdi.spec, include/wingdi.h, objects/dc.c:
Andreas Mohr <mohr@elektron.ikp.physik.tu-darmstadt.de>
Implemented Death() and Resurrection(), two functions needed by some
TPWin (?) command line tool.
* windows/winproc.c:
Juergen Schmied <juergen.schmied@metronet.de>
Added 32->16 translation for WM_ACTIVATEAPP.
* dlls/shell32/pidl.c, dlls/shell32/shellord.c, dlls/shell32/shellpath.c, dlls/shell32/shlfolder.c, relay32/shell32.spec:
Juergen Schmied <juergen.schmied@metronet.de>
New stubs: ShellMessageBoxW, RunDLL_CallEntry16.
Implementation for SHGetSpecialFolderPath32[A|W].
Many bugfixes.
* console/xterm.c, misc/port.c, win32/console.c:
Joseph Pranevich <jpranevich@lycos.com>
Change all Wine openpty() implementations to match the "standard" and
then make them both call the same code leaving the option to change
that code to call the "standard" openpty() at a later date.
* relay32/kernel32.spec, scheduler/process.c:
Marcus Meissner <marcus@jet.franken.de>
Added SetProcessAffinityMask stub.
* graphics/ddraw.c, include/ddraw.h:
Marcus Meissner <marcus@jet.franken.de>
Fixed the other union misuse too (one less mem corruption)
Re-added XInstallColormap (or non managed does not change palette)
* if1632/kernel.spec, scheduler/synchro.c:
Ulrich Weigand <weigand@informatik.uni-erlangen.de>
Added an implementation for KERNEL.495.
* documentation/status, documentation/direct3D, graphics/d3d_private.h, graphics/d3dcommon.c, graphics/d3ddevices.c, graphics/d3dexecutebuffer.c, graphics/d3dtexture.c, graphics/d3dviewport.c, graphics/ddraw.c, include/d3d.h, include/ddraw.h:
Lionel Ulmer <ulmer@directprovider.net>
- added bitmask to store which ColorKey structures are valid
- handle many new rendering states, some optimizations in state changes
- 8bit palettized textures now support ColorKeying
- some miscellaneous bug fixes and code rewrite
* controls/menu.c:
Noomen Hamza <noomen@macadamian.com>
Fixed the look of the menu so it would be compliant with Win95: modified
the mouse tracking code so it would change the selection every time the
mouse moved over a menu item.
* documentation/how-to-port:
Mike Castle <dalgoda@shell.rt66.com>
Small fix.
* dlls/comctl32/updown.c:
Noel Borthwick <noel@macadamian.com>
Fixed bugs:
- When an edit control buddy was used single digit values were not
being displayed.
- Comma values were not displayed correctly when thousands separation
was requested.
* win32/newfns.c:
Tom Bech <tomb@ii.uib.no>
While the debug event messages are not implemented, WaitForDebugEvent
should return FALSE.
* if1632/user.spec, objects/bitmap.c:
Andreas Mohr <mohr@elektron.ikp.physik.tu-darmstadt.de>
Implemented CopyImage16.
* documentation/bugreports
Andreas Mohr <mohr@elektron.ikp.physik.tu-darmstadt.de>
Small fix.
* console/generic.c, msdos/int21.c:
Marcus Meissner <marcus@jet.franken.de>
Changed 0x01 to use generic console, fixed 0x0b.
Fixed CONSOLE_GetCharacter (two args swapped).
* include/module.h, loader/main.c, loader/module.c, loader/dos/module.c:
Ulrich Weigand <weigand@informatik.uni-erlangen.de>
Allow specifying module name for NE dummy module.
* loader/pe_image.c
Ulrich Weigand <weigand@informatik.uni-erlangen.de>
Set module name of dummy module equal to module name of PE module.
* controls/scroll.c, controls/uitools.c:
Marcus Meissner <marcus@jet.franken.de>
Missing include wine/winuser16.h added.
* graphics/vga.c:
Marcus Meissner <marcus@jet.franken.de>
Create an actual primary surface for screenbuffer.
----------------------------------------------------------------
Sun Jan 10 14:40:34 1999 Alexandre Julliard <julliard@winehq.com> Sun Jan 10 14:40:34 1999 Alexandre Julliard <julliard@winehq.com>
* include/miscemu.h, include/msdos.h, loader/main.c, msdos/Makefile.in, msdos/dosconf.c, msdos/int21.c: * include/miscemu.h, include/msdos.h, loader/main.c, msdos/Makefile.in, msdos/dosconf.c, msdos/int21.c:

View File

@ -129,7 +129,7 @@ char GENERIC_GetCharacter()
while (!ch) while (!ch)
{ {
CONSOLE_GetKeystroke(&ch, &scan); CONSOLE_GetKeystroke(&scan, &ch);
} }
return ch; return ch;
} }

View File

@ -2,11 +2,11 @@
/* This "driver" is designed to go on top of an existing driver /* This "driver" is designed to go on top of an existing driver
to provide support for features only present if using an to provide support for features only present if using an
xterm or compatible program for your console output. It should xterm or compatible program for your console output.
inlcude such features as resizing, separation of output from the Currently, it supports resizing and separating debug messages from
standard wine console, and a configurable title bar for program output.
Win32 console. */ It does not currently support changing the title bar.
/* Right now, it doesn't have any "special" features */ */
#include <signal.h> #include <signal.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@ -99,67 +99,26 @@ void XTERM_ResizeScreen(int x, int y)
CONSOLE_NotifyResizeScreen(x, y); CONSOLE_NotifyResizeScreen(x, y);
} }
/**
* It looks like the openpty that comes with glibc in RedHat 5.0
* is buggy (second call returns what looks like a dup of 0 and 1
* instead of a new pty), this is a generic replacement.
*/
/** Can't we determine this using autoconf?
*/
static FILE *wine_openpty(FILE **master, FILE **slave, char *name,
struct termios *term, struct winsize *winsize)
{
FILE *fdm, *fds;
char *ptr1, *ptr2;
char pts_name[512];
strcpy (pts_name, "/dev/ptyXY");
for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1 != 0; ptr1++) {
pts_name[8] = *ptr1;
for (ptr2 = "0123456789abcdef"; *ptr2 != 0; ptr2++) {
pts_name[9] = *ptr2;
if ((fdm = fopen(pts_name, "r+")) == NULL) {
if (errno == ENOENT)
return (FILE *) -1;
else
continue;
}
pts_name[5] = 't';
if ((fds = fopen(pts_name, "r+")) == NULL) {
pts_name[5] = 'p';
continue;
}
*master = fdm;
*slave = fds;
if (term != NULL)
tcsetattr(fileno(*slave), TCSANOW, term);
if (winsize != NULL)
ioctl(fileno(*slave), TIOCSWINSZ, winsize);
if (name != NULL)
strcpy(name, pts_name);
return fds;
}
}
return (FILE *) -1;
}
static BOOL32 wine_create_console(FILE **master, FILE **slave, int *pid) static BOOL32 wine_create_console(FILE **master, FILE **slave, int *pid)
{ {
/* There is definately a bug in this routine that causes a lot
of garbage to be written to the screen, but I can't find it...
*/
struct termios term; struct termios term;
char buf[1024]; char buf[1024];
char c = '\0'; char c = '\0';
int status = 0; int status = 0;
int i; int i;
int tmaster, tslave;
if (tcgetattr(0, &term) < 0) return FALSE; if (tcgetattr(0, &term) < 0) return FALSE;
term.c_lflag |= ICANON; term.c_lflag |= ICANON;
term.c_lflag &= ~ECHO; term.c_lflag &= ~ECHO;
if (wine_openpty(master, slave, NULL, &term, NULL) < 0) if (wine_openpty(&tmaster, &tslave, NULL, &term, NULL) < 0)
return FALSE; return FALSE;
*master = fdopen(tmaster, "r+");
*slave = fdopen(tslave, "r+");
if ((*pid=fork()) == 0) { if ((*pid=fork()) == 0) {
tcsetattr(fileno(*slave), TCSADRAIN, &term); tcsetattr(fileno(*slave), TCSADRAIN, &term);

View File

@ -2339,11 +2339,15 @@ static BOOL32 MENU_TrackMenu( HMENU32 hmenu, UINT32 wFlags, INT32 x, INT32 y,
break; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
if ((msg.wParam & MK_LBUTTON) || ((wFlags & TPM_RIGHTBUTTON) /* In win95 winelook, the selected menu item must be changed every time the
&& (msg.wParam & MK_RBUTTON))) mouse moves. In Win31 winelook, the mouse button has to be held down */
{
if ( (TWEAK_WineLook > WIN31_LOOK) ||
( (msg.wParam & MK_LBUTTON) ||
((wFlags & TPM_RIGHTBUTTON) && (msg.wParam & MK_RBUTTON))) )
fEndMenu |= !MENU_MouseMove( &mt, hmenu ); fEndMenu |= !MENU_MouseMove( &mt, hmenu );
}
} /* switch(msg.message) - mouse */ } /* switch(msg.message) - mouse */
} }
else if ((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST)) else if ((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST))

View File

@ -6,6 +6,7 @@
*/ */
#include "windows.h" #include "windows.h"
#include "wine/winuser16.h"
#include "sysmetrics.h" #include "sysmetrics.h"
#include "scroll.h" #include "scroll.h"
#include "heap.h" #include "heap.h"

View File

@ -6,6 +6,7 @@
*/ */
#include "windows.h" #include "windows.h"
#include "wine/winuser16.h"
#include "debug.h" #include "debug.h"
static const WORD wPattern_AA55[8] = { 0xaaaa, 0x5555, 0xaaaa, 0x5555, static const WORD wPattern_AA55[8] = { 0xaaaa, 0x5555, 0xaaaa, 0x5555,

View File

@ -1,4 +1,4 @@
DEFS = -D__WINE__ -DLIBDIR=\"$(libdir)\" DEFS = -D__WINE__ -DLIBDIR="\"$(libdir)\""
TOPSRCDIR = @top_srcdir@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .. TOPOBJDIR = ..
SRCDIR = @srcdir@ SRCDIR = @srcdir@

View File

@ -33,7 +33,7 @@ static int syntax_error;
DIGIT [0-9] DIGIT [0-9]
HEXDIGIT [0-9a-fA-F] HEXDIGIT [0-9a-fA-F]
FORMAT [bcdiswx] FORMAT [ubcdiswx]
IDENTIFIER [_a-zA-Z\.~][_a-zA-Z0-9\.~@]* IDENTIFIER [_a-zA-Z\.~][_a-zA-Z0-9\.~@]*
PATHNAME [/_a-zA-Z\.~][/_a-zA-Z0-9\.~@]* PATHNAME [/_a-zA-Z\.~][/_a-zA-Z0-9\.~@]*
STRING \"[^\n"]+\" STRING \"[^\n"]+\"

View File

@ -223,6 +223,19 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char format )
switch(format) switch(format)
{ {
case 'u': {
WCHAR *ptr = (WCHAR*)pnt;
if (count == 1) count = 256;
while (count--)
{
if (!DBG_CHECK_READ_PTR( &addr, sizeof(WCHAR) )) return;
if (!*ptr) break;
addr.off++;
fputc( (char)*ptr++, stderr );
}
fprintf(stderr,"\n");
return;
}
case 's': case 's':
if (count == 1) count = 256; if (count == 1) count = 256;
while (count--) while (count--)

View File

@ -269,6 +269,16 @@ BOOL32 WINAPI InitializeSecurityDescriptor( SECURITY_DESCRIPTOR *pDescr,
return TRUE; return TRUE;
} }
/***********************************************************************
* GetSecurityDescriptorLength (ADVAPI.55)
*/
DWORD WINAPI GetSecurityDescriptorLength( SECURITY_DESCRIPTOR *pDescr)
{
FIXME(security, "(%p), stub\n", pDescr);
return 0;
}
/*********************************************************************** /***********************************************************************
* InitializeSid (ADVAPI.74) * InitializeSid (ADVAPI.74)

View File

@ -18,7 +18,10 @@
* - acceleration * - acceleration
* - base 16 * - base 16
* - UDS_ALIGNLEFT, ~UDS_WRAP * - UDS_ALIGNLEFT, ~UDS_WRAP
* (tested - they work)
* - integers with thousand separators. * - integers with thousand separators.
* (fixed bugs. <noel@macadamian.com>)
*
* Even though the above list seems rather large, the control seems to * Even though the above list seems rather large, the control seems to
* behave very well so I am confident it does work in most (all) of the * behave very well so I am confident it does work in most (all) of the
* untested cases. * untested cases.
@ -243,14 +246,15 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
sep = UPDOWN_GetThousandSep(); sep = UPDOWN_GetThousandSep();
if (!(wndPtr->dwStyle & UDS_NOTHOUSANDS)) { /* Do thousands seperation if necessary */
if (!(wndPtr->dwStyle & UDS_NOTHOUSANDS) && (len > 3)) {
char txt2[20], *src = txt1, *dst = txt2; char txt2[20], *src = txt1, *dst = txt2;
if(len%3 > 0){ if(len%3 > 0){
lstrcpyn32A (dst, src, len%3); lstrcpyn32A (dst, src, len%3 + 1); /* need to include the null */
dst += len%3; dst += len%3;
src += len%3; src += len%3;
} }
for(len=0; *src; len++,src++){ for(len=0; *src; len++){
if(len%3==0) if(len%3==0)
*dst++ = sep; *dst++ = sep;
*dst++ = *src++; *dst++ = *src++;

View File

@ -588,11 +588,16 @@ BOOL32 WINAPI RtlDosPathNameToNtPathName_U(
/************************************************************************** /**************************************************************************
* NTDLL_chkstk [NTDLL.862] * NTDLL_chkstk [NTDLL.862]
* NTDLL_alloca_probe [NTDLL.861]
* Glorified "enter xxxx".
*/ */
REGS_ENTRYPOINT(NTDLL_chkstk) REGS_ENTRYPOINT(NTDLL_chkstk)
{ {
/* FIXME: should subtract %eax bytes from stack pointer */ ESP_reg(context) -= EAX_reg(context);
FIXME(ntdll, "(eax=%ld): stub\n",EAX_reg(context)); }
REGS_ENTRYPOINT(NTDLL_alloca_probe)
{
ESP_reg(context) -= EAX_reg(context);
} }
/****************************************************************************** /******************************************************************************

View File

@ -631,23 +631,27 @@ BOOL32 WINAPI _ILIsDesktop(LPCITEMIDLIST pidl)
} }
BOOL32 WINAPI _ILIsMyComputer(LPCITEMIDLIST pidl) BOOL32 WINAPI _ILIsMyComputer(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl); { LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
return (pidl && PT_MYCOMP == _ILGetDataPointer(pidl)->type); TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_MYCOMP == lpPData->type);
} }
BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST pidl) BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl); { LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
return (pidl && PT_DRIVE == _ILGetDataPointer(pidl)->type); TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_DRIVE == lpPData->type);
} }
BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST pidl) BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl); { LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
return (pidl && PT_FOLDER == _ILGetDataPointer(pidl)->type); TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_FOLDER == lpPData->type);
} }
BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST pidl) BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl); { LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
return (pidl && PT_VALUE == _ILGetDataPointer(pidl)->type); TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_VALUE == lpPData->type);
} }
/************************************************************************** /**************************************************************************
@ -661,6 +665,7 @@ BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST pidl)
*/ */
DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST pidl,LPSTR lpszPath, DWORD dwSize) DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST pidl,LPSTR lpszPath, DWORD dwSize)
{ LPITEMIDLIST pidlTemp; { LPITEMIDLIST pidlTemp;
LPPIDLDATA pData;
DWORD dwCopied = 0; DWORD dwCopied = 0;
LPSTR pText; LPSTR pText;
@ -680,29 +685,34 @@ DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST pidl,LPSTR lpszPath, DWORD dwSize)
if(lpszPath) if(lpszPath)
*lpszPath = 0; *lpszPath = 0;
while(pidlTemp->mkid.cb) pData = _ILGetDataPointer(pidlTemp);
{ LPPIDLDATA pData = _ILGetDataPointer(pidlTemp);
/*if this item is a value, then skip it and finish */ while(pidlTemp->mkid.cb && !(PT_VALUE == pData->type))
if(PT_VALUE == pData->type) {
{ break; if (!(pText = _ILGetTextPointer(pData->type,pData)))
} return 0; /* foreign pidl */
pText = _ILGetTextPointer(pData->type,pData);
pidlTemp = ILGetNext(pidlTemp);
dwCopied += strlen(pText); dwCopied += strlen(pText);
pidlTemp = ILGetNext(pidlTemp);
pData = _ILGetDataPointer(pidlTemp);
if (lpszPath) if (lpszPath)
{ strcat(lpszPath, pText); { strcat(lpszPath, pText);
if (pidlTemp && lpszPath[dwCopied-1]!='\\')
if (pidlTemp->mkid.cb /* last element ? */
&& (pText[2] != '\\') /* drive has own '\' */
&& (PT_VALUE != pData->type)) /* next element is value */
{ lpszPath[dwCopied] = '\\'; { lpszPath[dwCopied] = '\\';
lpszPath[dwCopied+1] = '\0'; lpszPath[dwCopied+1] = '\0';
dwCopied++; dwCopied++;
} }
} }
else /* only length */ else /* only length */
{ if (pidlTemp && !_ILIsDrive (pidlTemp)) /* backslash between elements */ { if (pidlTemp->mkid.cb
dwCopied++; && (pText[2] != '\\')
&& (PT_VALUE != pData->type))
dwCopied++; /* backslash between elements */
} }
} }
@ -754,7 +764,8 @@ DWORD WINAPI _ILGetValueText(LPCITEMIDLIST pidl, LPSTR lpszValue, DWORD dwSize)
* strlen(lpszOut) * strlen(lpszOut)
*/ */
DWORD WINAPI _ILGetPidlPath( LPCITEMIDLIST pidl, LPSTR lpszOut, DWORD dwOutSize) DWORD WINAPI _ILGetPidlPath( LPCITEMIDLIST pidl, LPSTR lpszOut, DWORD dwOutSize)
{ WORD len = 0; { int len = 0;
LPSTR lpszTemp = lpszOut;
TRACE(pidl,"(%p,%lu)\n",lpszOut,dwOutSize); TRACE(pidl,"(%p,%lu)\n",lpszOut,dwOutSize);
@ -768,19 +779,17 @@ DWORD WINAPI _ILGetPidlPath( LPCITEMIDLIST pidl, LPSTR lpszOut, DWORD dwOutSize)
lpszOut += len; lpszOut += len;
strcpy (lpszOut,"\\"); strcpy (lpszOut,"\\");
lpszOut++; len++; lpszOut++; dwOutSize -= len;
dwOutSize -= len+1;;
len += _ILGetValueText(pidl, lpszOut, dwOutSize ); len += _ILGetValueText(pidl, lpszOut, dwOutSize );
/*remove the last backslash if necessary */ /*remove the last backslash if necessary */
if( lpszOut[len-1]=='\\') if( lpszTemp[len-1]=='\\')
{ lpszOut[len-1] = 0; { lpszTemp[len-1] = 0;
len--; len--;
} }
TRACE(pidl,"-- (%p=%s,%lu)\n",lpszOut,lpszOut,dwOutSize); TRACE(pidl,"-- (%p=%s,%u)\n",lpszTemp,lpszTemp,len);
return len; return len;
} }
@ -800,7 +809,7 @@ LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE type, LPVOID pIn, UINT16 uInSize)
LPPIDLDATA pData; LPPIDLDATA pData;
LPSTR pszDest; LPSTR pszDest;
TRACE(pidl,"(%x %p %x)\n",type,pIn,uInSize); TRACE(pidl,"(0x%02x %p %i)\n",type,pIn,uInSize);
if ( type == PT_DESKTOP) if ( type == PT_DESKTOP)
{ pidlOut = SHAlloc(2); { pidlOut = SHAlloc(2);
@ -812,7 +821,7 @@ LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE type, LPVOID pIn, UINT16 uInSize)
{ return NULL; { return NULL;
} }
/* the sizes of: cb(2), pidldata-1, szText+1, next cb(2) */ /* the sizes of: cb(2), pidldata-1(26), szText+1, next cb(2) */
switch (type) switch (type)
{ case PT_DRIVE: { case PT_DRIVE:
uSize = 4 + 9; uSize = 4 + 9;
@ -911,11 +920,9 @@ DWORD WINAPI _ILGetData(PIDLTYPE type, LPCITEMIDLIST pidl, LPVOID pOut, UINT32 u
* _ILGetDataPointer() * _ILGetDataPointer()
*/ */
LPPIDLDATA WINAPI _ILGetDataPointer(LPITEMIDLIST pidl) LPPIDLDATA WINAPI _ILGetDataPointer(LPITEMIDLIST pidl)
{ if(!pidl) { if(pidl && pidl->mkid.cb != 0x00)
{ return NULL;
}
/* TRACE(pidl,"(%p)\n", pidl);*/
return (LPPIDLDATA)(&pidl->mkid.abID); return (LPPIDLDATA)(&pidl->mkid.abID);
return NULL;
} }
/************************************************************************** /**************************************************************************
* _ILGetTextPointer() * _ILGetTextPointer()

View File

@ -188,19 +188,6 @@ StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
return MultiByteToWideChar (0, 0, lpMulti, nMulti, lpWide, nWide); return MultiByteToWideChar (0, 0, lpMulti, nMulti, lpWide, nWide);
} }
/*************************************************************************
* SHGetSpecialFolderPath [SHELL32.175]
*
* NOTES
* exported by ordinal
*/
void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
FIXME(shell,"(0x%04lx,0x%04lx,csidl=0x%04lx,0x%04lx):stub.\n",
x1,x2,x3,x4
);
}
/************************************************************************* /*************************************************************************
* RegisterShellHook [SHELL32.181] * RegisterShellHook [SHELL32.181]
* *
@ -214,6 +201,24 @@ void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) { void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD y) {
FIXME(shell,"(0x%08x,0x%08lx):stub.\n",hwnd,y); FIXME(shell,"(0x%08x,0x%08lx):stub.\n",hwnd,y);
} }
/*************************************************************************
* ShellMessageBoxW [SHELL32.182]
*
* Format and output errormessage.
*
* NOTES
* exported by ordinal
*/
void __cdecl
ShellMessageBoxW(HMODULE32 hmod,HWND32 hwnd,DWORD id,DWORD x,DWORD type,LPVOID arglist) {
WCHAR buf[100];
if (!LoadString32W(hmod,x,buf,100))
lstrcpyAtoW (buf,"Desktop");
FIXME(shell,"(%08lx,%08lx,%08lx,%08lx(%s),%08lx,%p):stub.\n",
(DWORD)hmod,(DWORD)hwnd,id,x,debugstr_w(buf),type,arglist);
}
/************************************************************************* /*************************************************************************
* ShellMessageBoxA [SHELL32.183] * ShellMessageBoxA [SHELL32.183]
@ -1243,3 +1248,11 @@ HRESULT WINAPI Control_FillCache_RunDLL(HWND32 hWnd, HANDLE32 hModule, DWORD w,
{ FIXME(shell,"0x%04x 0x%04x 0x%04lx 0x%04lx stub\n",hWnd, hModule,w,x); { FIXME(shell,"0x%04x 0x%04x 0x%04lx 0x%04lx stub\n",hWnd, hModule,w,x);
return 0; return 0;
} }
/*************************************************************************
* RunDLL_CallEntry16 [SHELL32.122]
* the name is propably wrong
*/
HRESULT WINAPI RunDLL_CallEntry16(DWORD v, DWORD w, DWORD x, DWORD y, DWORD z)
{ FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",v,w,x,y,z);
return 0;
}

View File

@ -724,3 +724,35 @@ HRESULT WINAPI PathProcessCommand (DWORD u, DWORD v, DWORD w, DWORD x)
{ FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x); { FIXME(shell,"0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",u,v,w,x);
return 0; return 0;
} }
/*************************************************************************
* SHGetSpecialFolderPath [SHELL32.175]
*
* converts csidl to path
*
*/
BOOL32 WINAPI SHGetSpecialFolderPath32A (DWORD x1,LPSTR szPath,DWORD csidl,DWORD x4)
{ LPITEMIDLIST pidl;
WARN(shell,"(0x%04lx,%p,csidl=%lu,0x%04lx) semi-stub\n", x1,szPath,csidl,x4);
SHGetSpecialFolderLocation(0, csidl, &pidl);
SHGetPathFromIDList32A (pidl, szPath);
SHFree (pidl);
return TRUE;
}
BOOL32 WINAPI SHGetSpecialFolderPath32W (DWORD x1,LPWSTR szPath, DWORD csidl,DWORD x4)
{ LPITEMIDLIST pidl;
WARN(shell,"(0x%04lx,%p,csidl=%lu,0x%04lx) semi-stub\n", x1,szPath,csidl,x4);
SHGetSpecialFolderLocation(0, csidl, &pidl);
SHGetPathFromIDList32W (pidl, szPath);
SHFree (pidl);
return TRUE;
}
BOOL32 WINAPI SHGetSpecialFolderPath32 (DWORD x1,LPVOID szPath,DWORD csidl,DWORD x4)
{ if (VERSION_OsIsUnicode())
return SHGetSpecialFolderPath32W ( x1, szPath, csidl, x4);
return SHGetSpecialFolderPath32A ( x1, szPath, csidl, x4);
}

View File

@ -107,6 +107,7 @@ LPSHELLFOLDER IShellFolder_Constructor(LPSHELLFOLDER pParent,LPITEMIDLIST pidl)
sf->mpSFParent=pParent; /* parrent shellfolder */ sf->mpSFParent=pParent; /* parrent shellfolder */
TRACE(shell,"(%p)->(parent=%p, pidl=%p)\n",sf,pParent, pidl); TRACE(shell,"(%p)->(parent=%p, pidl=%p)\n",sf,pParent, pidl);
pdump(pidl);
/* keep a copy of the pidl in the instance*/ /* keep a copy of the pidl in the instance*/
sf->mpidl = ILClone(pidl); sf->mpidl = ILClone(pidl);
@ -118,16 +119,19 @@ LPSHELLFOLDER IShellFolder_Constructor(LPSHELLFOLDER pParent,LPITEMIDLIST pidl)
TRACE(shell,"-- (%p)->(parent's path=%s)\n",sf, debugstr_a(sf->mpSFParent->sMyPath)); TRACE(shell,"-- (%p)->(parent's path=%s)\n",sf, debugstr_a(sf->mpSFParent->sMyPath));
} }
dwSize += _ILGetFolderText(sf->mpidl,NULL,0); /* add the size of the foldername*/ dwSize += _ILGetFolderText(sf->mpidl,NULL,0); /* add the size of the foldername*/
sf->sMyPath = SHAlloc(dwSize+1); sf->sMyPath = SHAlloc(dwSize+2); /* '\0' and backslash */
if(sf->sMyPath) if(sf->sMyPath)
{ *(sf->sMyPath)=0x00; { int len;
*(sf->sMyPath)=0x00;
if(sf->mpSFParent->sMyPath) /* if the parent has a path, get it*/ if(sf->mpSFParent->sMyPath) /* if the parent has a path, get it*/
{ strcpy(sf->sMyPath, sf->mpSFParent->sMyPath); { strcpy(sf->sMyPath, sf->mpSFParent->sMyPath);
PathAddBackslash32A (sf->sMyPath); PathAddBackslash32A (sf->sMyPath);
} }
sf->pMyPidl = ILCombine(sf->pMyPidl, pidl); sf->pMyPidl = ILCombine(sf->mpSFParent->pMyPidl, pidl);
_ILGetFolderText(sf->mpidl, sf->sMyPath+strlen(sf->sMyPath), dwSize-strlen(sf->sMyPath)); len = strlen(sf->sMyPath);
TRACE(shell,"-- (%p)->(my path=%s)\n",sf, debugstr_a(sf->sMyPath)); _ILGetFolderText(sf->mpidl, sf->sMyPath+len, dwSize-len);
TRACE(shell,"-- (%p)->(my pidl=%p, my path=%s)\n",sf, sf->pMyPidl,debugstr_a(sf->sMyPath));
pdump (sf->pMyPidl);
} }
} }
return sf; return sf;
@ -344,8 +348,6 @@ static HRESULT WINAPI IShellFolder_BindToObject( LPSHELLFOLDER this, LPCITEMIDLI
if(!pShellFolder) if(!pShellFolder)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
IShellFolder_Initialize(pShellFolder, this->pMyPidl);
hr = pShellFolder->lpvtbl->fnQueryInterface(pShellFolder, riid, ppvOut); hr = pShellFolder->lpvtbl->fnQueryInterface(pShellFolder, riid, ppvOut);
pShellFolder->lpvtbl->fnRelease(pShellFolder); pShellFolder->lpvtbl->fnRelease(pShellFolder);
TRACE(shell,"-- (%p)->(interface=%p)\n",this, ppvOut); TRACE(shell,"-- (%p)->(interface=%p)\n",this, ppvOut);
@ -614,6 +616,7 @@ static HRESULT WINAPI IShellFolder_GetDisplayNameOf( LPSHELLFOLDER this, LPCITEM
BOOL32 bSimplePidl=FALSE; BOOL32 bSimplePidl=FALSE;
TRACE(shell,"(%p)->(pidl=%p,0x%08lx,%p)\n",this,pidl,dwFlags,lpName); TRACE(shell,"(%p)->(pidl=%p,0x%08lx,%p)\n",this,pidl,dwFlags,lpName);
pdump(pidl);
szSpecial[0]=0x00; szSpecial[0]=0x00;
szDrive[0]=0x00; szDrive[0]=0x00;
@ -624,7 +627,6 @@ static HRESULT WINAPI IShellFolder_GetDisplayNameOf( LPSHELLFOLDER this, LPCITEM
if (pidlTemp && pidlTemp->mkid.cb==0x00) if (pidlTemp && pidlTemp->mkid.cb==0x00)
{ bSimplePidl = TRUE; { bSimplePidl = TRUE;
TRACE(shell,"-- simple pidl\n"); TRACE(shell,"-- simple pidl\n");
} }
if (_ILIsDesktop( pidl)) if (_ILIsDesktop( pidl))

View File

@ -39,7 +39,7 @@ likely to get answered and fixed):
bash and other sh-like shells: bash and other sh-like shells:
wine -debugmsg +relay [other_options] program_name 2>&1 | tee filename.out wine -debugmsg +relay,+snoop [other_options] program_name 2>&1 | tee filename.out
tail -100 filename.out > report_file tail -100 filename.out > report_file
'report_file' will now contain the last hundred lines of the debugging 'report_file' will now contain the last hundred lines of the debugging

View File

@ -183,12 +183,14 @@
Author: Author:
Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de> Dummy written by Eric Kohl. <ekohl@abo.rhein-zeitung.de>
Ben Williams <biwillia@shrug.isdn.uiuc.edu> Ben Williams <biwillia@shrug.isdn.uiuc.edu>
Luc Tourangeau <luc@macadamian.com>
Status: Status:
Under construction. Under construction.
Notes: Notes:
Author needed!! Any volunteers?? Basic data structure with related messages are supported.
No painting supported yet.
3.11 Month Calendar Control 3.11 Month Calendar Control

View File

@ -72,7 +72,7 @@ to
#ifdef HAVE_FOO_H #ifdef HAVE_FOO_H
#include <foo.h> #include <foo.h>
#elif defined (HAVE_BAR_H) #elif defined (HAVE_BAR_H)
#include <bat.h> #include <bar.h>
#endif #endif
If your system doesn't have a corresponding header file even If your system doesn't have a corresponding header file even

View File

@ -28,18 +28,24 @@ TODO (well, once the code will be put in the dll/ddraw directory)
Status Status
------ ------
I tested this code with two programs (all using Direct3D 5.0) : Some programs with which I tested the code :
* BOIDS.EXE that comes with the 5.2 DirectX SDK : works great. Only * BOIDS.EXE (DX5.0) that comes with the 5.2 DirectX SDK : works
thing missing is the texturing and transparency on the spinning great. Only thing missing is the texturing and transparency on the
gobes. Lighting seems to be a bit different than the Real One. spinning gobes. Lighting seems to be a bit different than the Real
One.
* Tomb Raider II : works quite well (without texturing). * Tomb Raider II (DX5.0) : works perfectly (but slowly). All the
calls needed to make TR2 work have been written.
* Jedi Knight (DX3.0) : does not start
* Shadow of the Empire demo (DX3.0) : runs but does not display
anything
TODO TODO
---- ----
* finish working on Execute Buffers (i.e. Direct3D 3.0) * finish working on Execute Buffers (i.e. Direct3D 3.0)
* texture mapping / blending effects
* real GLX implementation (will need a complete rewrite of DirectDraw * real GLX implementation (will need a complete rewrite of DirectDraw
also) to have 3DFx support also) to have 3DFx support
* restructuration of all the DDRAW.DLL (put that in the dll * restructuration of all the DDRAW.DLL (put that in the dll
@ -52,4 +58,4 @@ TODO
-- --
Lionel Ulmer - ulmer@directprovider.net Lionel Ulmer - ulmer@directprovider.net
Last updated : Sun Jan 03 1999 Last updated : Sun Jan 10 1999

View File

@ -1,6 +1,6 @@
prefix = @prefix@ prefix = @prefix@
sysconfdir = @sysconfdir@ sysconfdir = @sysconfdir@
DEFS = @DLLFLAGS@ -D__WINE__ -DETCDIR=\"$(sysconfdir)\" DEFS = @DLLFLAGS@ -D__WINE__ -DETCDIR="\"$(sysconfdir)\""
TOPSRCDIR = @top_srcdir@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .. TOPOBJDIR = ..
SRCDIR = @srcdir@ SRCDIR = @srcdir@

View File

@ -67,6 +67,8 @@ typedef struct DOS_FILE_LOCK DOS_FILE_LOCK;
static DOS_FILE_LOCK *locks = NULL; static DOS_FILE_LOCK *locks = NULL;
static void DOS_RemoveFileLocks(FILE_OBJECT *file); static void DOS_RemoveFileLocks(FILE_OBJECT *file);
/* Size of per-process table of DOS handles */
#define DOS_TABLE_SIZE 256
/*********************************************************************** /***********************************************************************
@ -421,7 +423,11 @@ HFILE32 FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
/* If write access failed, retry without GENERIC_WRITE */ /* If write access failed, retry without GENERIC_WRITE */
if ((reply.handle == -1) && !Options.failReadOnly && if ((reply.handle == -1) && !Options.failReadOnly &&
(access & GENERIC_WRITE) && (GetLastError() == ERROR_ACCESS_DENIED)) (access & GENERIC_WRITE))
{
DWORD lasterror = GetLastError();
if ((lasterror == ERROR_ACCESS_DENIED) ||
(lasterror == ERROR_WRITE_PROTECT))
{ {
req.access &= ~GENERIC_WRITE; req.access &= ~GENERIC_WRITE;
CLIENT_SendRequest( REQ_CREATE_FILE, -1, 2, CLIENT_SendRequest( REQ_CREATE_FILE, -1, 2,
@ -429,6 +435,7 @@ HFILE32 FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
filename, strlen(filename) + 1 ); filename, strlen(filename) + 1 );
CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL ); CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL );
} }
}
if (reply.handle == -1) return INVALID_HANDLE_VALUE32; if (reply.handle == -1) return INVALID_HANDLE_VALUE32;
/* Now build the FILE_OBJECT */ /* Now build the FILE_OBJECT */
@ -729,25 +736,6 @@ INT32 WINAPI CompareFileTime( LPFILETIME x, LPFILETIME y )
} }
/***********************************************************************
* FILE_Dup2
*
* dup2() function for DOS handles.
*/
HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 )
{
FILE_OBJECT *file;
TRACE(file, "FILE_Dup2 for handle %d\n", hFile1 );
/* FIXME: should use DuplicateHandle */
if (!(file = FILE_GetFile( hFile1, 0, NULL ))) return HFILE_ERROR32;
if (!HANDLE_SetObjPtr( PROCESS_Current(), hFile2, &file->header, 0 ))
hFile2 = HFILE_ERROR32;
FILE_ReleaseFile( file );
return hFile2;
}
/*********************************************************************** /***********************************************************************
* GetTempFileName16 (KERNEL.97) * GetTempFileName16 (KERNEL.97)
*/ */
@ -1014,7 +1002,7 @@ error: /* We get here if there was an error opening the file */
HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode ) HFILE16 WINAPI OpenFile16( LPCSTR name, OFSTRUCT *ofs, UINT16 mode )
{ {
TRACE(file,"OpenFile16(%s,%i)\n", name, mode); TRACE(file,"OpenFile16(%s,%i)\n", name, mode);
return HFILE32_TO_HFILE16(FILE_DoOpenFile( name, ofs, mode, FALSE )); return FILE_AllocDosHandle( FILE_DoOpenFile( name, ofs, mode, FALSE ) );
} }
@ -1027,13 +1015,118 @@ HFILE32 WINAPI OpenFile32( LPCSTR name, OFSTRUCT *ofs, UINT32 mode )
} }
/***********************************************************************
* FILE_AllocDosHandle
*
* Allocate a DOS handle for a Win32 handle. The Win32 handle is no
* longer valid after this function (even on failure).
*/
HFILE16 FILE_AllocDosHandle( HANDLE32 handle )
{
int i;
HANDLE32 *ptr = PROCESS_Current()->dos_handles;
if (!handle || (handle == INVALID_HANDLE_VALUE32))
return INVALID_HANDLE_VALUE16;
if (!ptr)
{
if (!(ptr = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY,
sizeof(*ptr) * DOS_TABLE_SIZE )))
goto error;
PROCESS_Current()->dos_handles = ptr;
ptr[0] = GetStdHandle(STD_INPUT_HANDLE);
ptr[1] = GetStdHandle(STD_OUTPUT_HANDLE);
ptr[2] = GetStdHandle(STD_ERROR_HANDLE);
ptr[3] = GetStdHandle(STD_ERROR_HANDLE);
ptr[4] = GetStdHandle(STD_ERROR_HANDLE);
}
for (i = 0; i < DOS_TABLE_SIZE; i++, ptr++)
if (!*ptr)
{
*ptr = handle;
TRACE( file, "Got %d for h32 %d\n", i, handle );
return i;
}
error:
DOS_ERROR( ER_TooManyOpenFiles, EC_ProgramError, SA_Abort, EL_Disk );
CloseHandle( handle );
return INVALID_HANDLE_VALUE16;
}
/***********************************************************************
* FILE_GetHandle32
*
* Return the Win32 handle for a DOS handle.
*/
HANDLE32 FILE_GetHandle32( HFILE16 hfile )
{
HANDLE32 *table = PROCESS_Current()->dos_handles;
if ((hfile >= DOS_TABLE_SIZE) || !table || !table[hfile])
{
DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
return INVALID_HANDLE_VALUE32;
}
return table[hfile];
}
/***********************************************************************
* FILE_Dup2
*
* dup2() function for DOS handles.
*/
HFILE16 FILE_Dup2( HFILE16 hFile1, HFILE16 hFile2 )
{
HANDLE32 *table = PROCESS_Current()->dos_handles;
HANDLE32 new_handle;
if ((hFile1 >= DOS_TABLE_SIZE) || (hFile2 >= DOS_TABLE_SIZE) ||
!table || !table[hFile1])
{
DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
return HFILE_ERROR16;
}
if (hFile2 < 5)
{
FIXME( file, "stdio handle closed, need proper conversion\n" );
DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
return HFILE_ERROR16;
}
if (!DuplicateHandle( GetCurrentProcess(), table[hFile1],
GetCurrentProcess(), &new_handle,
0, FALSE, DUPLICATE_SAME_ACCESS ))
return HFILE_ERROR16;
if (table[hFile2]) CloseHandle( table[hFile2] );
table[hFile2] = new_handle;
return hFile2;
}
/*********************************************************************** /***********************************************************************
* _lclose16 (KERNEL.81) * _lclose16 (KERNEL.81)
*/ */
HFILE16 WINAPI _lclose16( HFILE16 hFile ) HFILE16 WINAPI _lclose16( HFILE16 hFile )
{ {
TRACE(file, "handle %d\n", hFile ); HANDLE32 *table = PROCESS_Current()->dos_handles;
return CloseHandle( HFILE16_TO_HFILE32( hFile ) ) ? 0 : HFILE_ERROR16;
if (hFile < 5)
{
FIXME( file, "stdio handle closed, need proper conversion\n" );
DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
return HFILE_ERROR16;
}
if ((hFile >= DOS_TABLE_SIZE) || !table || !table[hFile])
{
DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
return HFILE_ERROR16;
}
TRACE( file, "%d (handle32=%d)\n", hFile, table[hFile] );
CloseHandle( table[hFile] );
table[hFile] = 0;
return 0;
} }
@ -1126,7 +1219,7 @@ LONG WINAPI WIN16_hread( HFILE16 hFile, SEGPTR buffer, LONG count )
/* Some programs pass a count larger than the allocated buffer */ /* Some programs pass a count larger than the allocated buffer */
maxlen = GetSelectorLimit( SELECTOROF(buffer) ) - OFFSETOF(buffer) + 1; maxlen = GetSelectorLimit( SELECTOROF(buffer) ) - OFFSETOF(buffer) + 1;
if (count > maxlen) count = maxlen; if (count > maxlen) count = maxlen;
return _lread32(HFILE16_TO_HFILE32(hFile), PTR_SEG_TO_LIN(buffer), count ); return _lread32(FILE_GetHandle32(hFile), PTR_SEG_TO_LIN(buffer), count );
} }
@ -1155,7 +1248,7 @@ UINT32 WINAPI _lread32( HFILE32 handle, LPVOID buffer, UINT32 count )
*/ */
UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count ) UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count )
{ {
return (UINT16)_lread32(HFILE16_TO_HFILE32(hFile), buffer, (LONG)count ); return (UINT16)_lread32(FILE_GetHandle32(hFile), buffer, (LONG)count );
} }
@ -1165,7 +1258,7 @@ UINT16 WINAPI _lread16( HFILE16 hFile, LPVOID buffer, UINT16 count )
HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr ) HFILE16 WINAPI _lcreat16( LPCSTR path, INT16 attr )
{ {
TRACE(file, "%s %02x\n", path, attr ); TRACE(file, "%s %02x\n", path, attr );
return (HFILE16) HFILE32_TO_HFILE16(_lcreat32( path, attr )); return FILE_AllocDosHandle( _lcreat32( path, attr ) );
} }
@ -1182,14 +1275,14 @@ HFILE32 WINAPI _lcreat32( LPCSTR path, INT32 attr )
/*********************************************************************** /***********************************************************************
* _lcreat_uniq (Not a Windows API) * _lcreat16_uniq (Not a Windows API)
*/ */
HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr ) HFILE16 _lcreat16_uniq( LPCSTR path, INT32 attr )
{ {
TRACE(file, "%s %02x\n", path, attr ); TRACE(file, "%s %02x\n", path, attr );
return CreateFile32A( path, GENERIC_READ | GENERIC_WRITE, return FILE_AllocDosHandle( CreateFile32A( path, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_NEW, attr, -1 ); CREATE_NEW, attr, -1 ));
} }
@ -1236,7 +1329,7 @@ DWORD WINAPI SetFilePointer( HFILE32 hFile, LONG distance, LONG *highword,
*/ */
LONG WINAPI _llseek16( HFILE16 hFile, LONG lOffset, INT16 nOrigin ) LONG WINAPI _llseek16( HFILE16 hFile, LONG lOffset, INT16 nOrigin )
{ {
return SetFilePointer( HFILE16_TO_HFILE32(hFile), lOffset, NULL, nOrigin ); return SetFilePointer( FILE_GetHandle32(hFile), lOffset, NULL, nOrigin );
} }
@ -1254,7 +1347,7 @@ LONG WINAPI _llseek32( HFILE32 hFile, LONG lOffset, INT32 nOrigin )
*/ */
HFILE16 WINAPI _lopen16( LPCSTR path, INT16 mode ) HFILE16 WINAPI _lopen16( LPCSTR path, INT16 mode )
{ {
return HFILE32_TO_HFILE16(_lopen32( path, mode )); return FILE_AllocDosHandle( _lopen32( path, mode ) );
} }
@ -1276,7 +1369,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode )
*/ */
UINT16 WINAPI _lwrite16( HFILE16 hFile, LPCSTR buffer, UINT16 count ) UINT16 WINAPI _lwrite16( HFILE16 hFile, LPCSTR buffer, UINT16 count )
{ {
return (UINT16)_hwrite32( HFILE16_TO_HFILE32(hFile), buffer, (LONG)count ); return (UINT16)_hwrite32( FILE_GetHandle32(hFile), buffer, (LONG)count );
} }
/*********************************************************************** /***********************************************************************
@ -1293,7 +1386,7 @@ UINT32 WINAPI _lwrite32( HFILE32 hFile, LPCSTR buffer, UINT32 count )
*/ */
LONG WINAPI _hread16( HFILE16 hFile, LPVOID buffer, LONG count) LONG WINAPI _hread16( HFILE16 hFile, LPVOID buffer, LONG count)
{ {
return _lread32( HFILE16_TO_HFILE32(hFile), buffer, count ); return _lread32( FILE_GetHandle32(hFile), buffer, count );
} }
@ -1311,7 +1404,7 @@ LONG WINAPI _hread32( HFILE32 hFile, LPVOID buffer, LONG count)
*/ */
LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count ) LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count )
{ {
return _hwrite32( HFILE16_TO_HFILE32(hFile), buffer, count ); return _hwrite32( FILE_GetHandle32(hFile), buffer, count );
} }

View File

@ -53,6 +53,13 @@
TRACE(ddraw, "%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \ TRACE(ddraw, "%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
TRACE(ddraw, "%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); TRACE(ddraw, "%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44);
typedef struct render_state {
/* This is used for the device mode */
GLenum src, dst;
/* This is used for textures */
GLenum mag, min;
} RenderState;
typedef struct OpenGL_IDirect3DDevice2 { typedef struct OpenGL_IDirect3DDevice2 {
IDirect3DDevice2 common; IDirect3DDevice2 common;
@ -60,6 +67,12 @@ typedef struct OpenGL_IDirect3DDevice2 {
OSMesaContext ctx; OSMesaContext ctx;
unsigned char *buffer; unsigned char *buffer;
/* The current render state */
RenderState rs;
/* The last type of vertex drawn */
D3DVERTEXTYPE vt;
float world_mat[16]; float world_mat[16];
float view_mat[16]; float view_mat[16];
float proj_mat[16]; float proj_mat[16];
@ -72,6 +85,9 @@ typedef struct OpenGL_IDirect3DDevice {
OSMesaContext ctx; OSMesaContext ctx;
unsigned char *buffer; unsigned char *buffer;
/* The current render state */
RenderState rs;
D3DMATRIX *world_mat; D3DMATRIX *world_mat;
D3DMATRIX *view_mat; D3DMATRIX *view_mat;
D3DMATRIX *proj_mat; D3DMATRIX *proj_mat;
@ -81,11 +97,11 @@ typedef struct OpenGL_IDirect3DDevice {
TRACE(ddraw, " " s " : %f %f %f %f\n", \ TRACE(ddraw, " " s " : %f %f %f %f\n", \
(v).r.r, (v).g.g, (v).b.b, (v).a.a); (v).r.r, (v).g.g, (v).b.b, (v).a.a);
#endif /* HAVE_MESAGL */
/* Common functions defined in d3dcommon.c */ /* Common functions defined in d3dcommon.c */
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState) ; DWORD dwRenderState, RenderState *rs) ;
#endif /* HAVE_MESAGL */
/* All non-static functions 'exported' by various sub-objects */ /* All non-static functions 'exported' by various sub-objects */
extern LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf) ; extern LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf) ;

View File

@ -61,6 +61,7 @@ static void _dump_renderstate(D3DRENDERSTATETYPE type,
"D3DRENDERSTATE_STIPPLEENABLE", "D3DRENDERSTATE_STIPPLEENABLE",
"D3DRENDERSTATE_EDGEANTIALIAS", "D3DRENDERSTATE_EDGEANTIALIAS",
"D3DRENDERSTATE_COLORKEYENABLE", "D3DRENDERSTATE_COLORKEYENABLE",
"ERR",
"D3DRENDERSTATE_BORDERCOLOR", "D3DRENDERSTATE_BORDERCOLOR",
"D3DRENDERSTATE_TEXTUREADDRESSU", "D3DRENDERSTATE_TEXTUREADDRESSU",
"D3DRENDERSTATE_TEXTUREADDRESSV", "D3DRENDERSTATE_TEXTUREADDRESSV",
@ -69,6 +70,8 @@ static void _dump_renderstate(D3DRENDERSTATETYPE type,
"D3DRENDERSTATE_RANGEFOGENABLE", "D3DRENDERSTATE_RANGEFOGENABLE",
"D3DRENDERSTATE_ANISOTROPY", "D3DRENDERSTATE_ANISOTROPY",
"D3DRENDERSTATE_FLUSHBATCH", "D3DRENDERSTATE_FLUSHBATCH",
"ERR", "ERR", "ERR", "ERR", "ERR", "ERR", "ERR",
"ERR", "ERR", "ERR", "ERR", "ERR", "ERR",
"D3DRENDERSTATE_STIPPLEPATTERN00", "D3DRENDERSTATE_STIPPLEPATTERN00",
"D3DRENDERSTATE_STIPPLEPATTERN01", "D3DRENDERSTATE_STIPPLEPATTERN01",
"D3DRENDERSTATE_STIPPLEPATTERN02", "D3DRENDERSTATE_STIPPLEPATTERN02",
@ -108,7 +111,7 @@ static void _dump_renderstate(D3DRENDERSTATETYPE type,
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState) DWORD dwRenderState, RenderState *rs)
{ {
if (TRACE_ON(ddraw)) if (TRACE_ON(ddraw))
@ -116,13 +119,13 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
/* First, all the stipple patterns */ /* First, all the stipple patterns */
if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) && if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) &&
(dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN31)) { (dwRenderStateType <= D3DRENDERSTATE_STIPPLEPATTERN31)) {
ERR(ddraw, "Unhandled stipple !\n");
} else { } else {
/* All others state variables */ /* All others state variables */
switch (dwRenderStateType) { switch (dwRenderStateType) {
case D3DRENDERSTATE_TEXTUREHANDLE: { case D3DRENDERSTATE_TEXTUREHANDLE: { /* 1 */
LPDIRECT3DTEXTURE2 tex = (LPDIRECT3DTEXTURE2) dwRenderState; LPDIRECT3DTEXTURE2 tex = (LPDIRECT3DTEXTURE2) dwRenderState;
if (tex == NULL) { if (tex == NULL) {
@ -131,13 +134,21 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
} else { } else {
TRACE(ddraw, "setting OpenGL texture handle : %d\n", tex->tex_name); TRACE(ddraw, "setting OpenGL texture handle : %d\n", tex->tex_name);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); /* Default parameters */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D, tex->tex_name); glBindTexture(GL_TEXTURE_2D, tex->tex_name);
/* To prevent state change, we could test here what are the parameters
stored in the texture */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, rs->mag);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, rs->min);
} }
} break; } break;
case D3DRENDERSTATE_TEXTUREPERSPECTIVE: /* 4 */
if (dwRenderState)
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
else
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
break;
case D3DRENDERSTATE_ZENABLE: /* 7 */ case D3DRENDERSTATE_ZENABLE: /* 7 */
if (dwRenderState) if (dwRenderState)
@ -146,6 +157,31 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
break; break;
case D3DRENDERSTATE_FILLMODE: /* 8 */
switch ((D3DFILLMODE) dwRenderState) {
case D3DFILL_SOLID:
break;
default:
ERR(ddraw, "Unhandled fill mode !\n");
}
break;
case D3DRENDERSTATE_SHADEMODE: /* 9 */
switch ((D3DSHADEMODE) dwRenderState) {
case D3DSHADE_FLAT:
glShadeModel(GL_FLAT);
break;
case D3DSHADE_GOURAUD:
glShadeModel(GL_SMOOTH);
break;
default:
ERR(ddraw, "Unhandled shade mode !\n");
}
break;
case D3DRENDERSTATE_ZWRITEENABLE: /* 14 */ case D3DRENDERSTATE_ZWRITEENABLE: /* 14 */
if (dwRenderState) if (dwRenderState)
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
@ -153,6 +189,95 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
break; break;
case D3DRENDERSTATE_TEXTUREMAG: /* 17 */
switch ((D3DTEXTUREFILTER) dwRenderState) {
case D3DFILTER_NEAREST:
rs->mag = GL_NEAREST;
break;
case D3DFILTER_LINEAR:
rs->mag = GL_LINEAR;
break;
default:
ERR(ddraw, "Unhandled texture mag !\n");
}
break;
case D3DRENDERSTATE_TEXTUREMIN: /* 18 */
switch ((D3DTEXTUREFILTER) dwRenderState) {
case D3DFILTER_NEAREST:
rs->min = GL_NEAREST;
break;
case D3DFILTER_LINEAR:
rs->mag = GL_LINEAR;
break;
default:
ERR(ddraw, "Unhandled texture min !\n");
}
break;
case D3DRENDERSTATE_SRCBLEND: /* 19 */
switch ((D3DBLEND) dwRenderState) {
case D3DBLEND_SRCALPHA:
rs->src = GL_SRC_ALPHA;
break;
default:
ERR(ddraw, "Unhandled blend mode !\n");
}
glBlendFunc(rs->src, rs->dst);
break;
case D3DRENDERSTATE_DESTBLEND: /* 20 */
switch ((D3DBLEND) dwRenderState) {
case D3DBLEND_INVSRCALPHA:
rs->dst = GL_ONE_MINUS_SRC_ALPHA;
break;
default:
ERR(ddraw, "Unhandled blend mode !\n");
}
glBlendFunc(rs->src, rs->dst);
break;
case D3DRENDERSTATE_TEXTUREMAPBLEND: /* 21 */
switch ((D3DTEXTUREBLEND) dwRenderState) {
case D3DTBLEND_MODULATE:
case D3DTBLEND_MODULATEALPHA:
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
break;
default:
ERR(ddraw, "Unhandled texture environment !\n");
}
break;
case D3DRENDERSTATE_CULLMODE: /* 22 */
switch ((D3DCULL) dwRenderState) {
case D3DCULL_NONE:
glDisable(GL_CULL_FACE);
break;
case D3DCULL_CW:
glEnable(GL_CULL_FACE);
glFrontFace(GL_CW);
break;
case D3DCULL_CCW:
glEnable(GL_CULL_FACE);
glFrontFace(GL_CCW);
break;
default:
ERR(ddraw, "Unhandled cull mode !\n");
}
break;
case D3DRENDERSTATE_ZFUNC: /* 23 */ case D3DRENDERSTATE_ZFUNC: /* 23 */
switch ((D3DCMPFUNC) dwRenderState) { switch ((D3DCMPFUNC) dwRenderState) {
case D3DCMP_NEVER: case D3DCMP_NEVER:
@ -192,8 +317,25 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
glDisable(GL_DITHER); glDisable(GL_DITHER);
break; break;
case D3DRENDERSTATE_ALPHABLENDENABLE: /* 27 */
if (dwRenderState)
glEnable(GL_BLEND);
else
glDisable(GL_BLEND);
break;
case D3DRENDERSTATE_COLORKEYENABLE: /* 41 */
if (dwRenderState)
glEnable(GL_BLEND);
else
glDisable(GL_BLEND);
break;
case D3DRENDERSTATE_FLUSHBATCH: /* 50 */
break;
default: default:
FIXME(ddraw, "Unhandled Render State\n"); ERR(ddraw, "Unhandled Render State\n");
break; break;
} }
} }

View File

@ -96,7 +96,7 @@ static void fill_opengl_caps(D3DDEVICEDESC *d1, D3DDEVICEDESC *d2)
d1->dlcLightingCaps.dwSize = sizeof(D3DLIGHTINGCAPS); d1->dlcLightingCaps.dwSize = sizeof(D3DLIGHTINGCAPS);
d1->dlcLightingCaps.dwCaps = D3DLIGHTCAPS_DIRECTIONAL | D3DLIGHTCAPS_PARALLELPOINT | D3DLIGHTCAPS_POINT | D3DLIGHTCAPS_SPOT; d1->dlcLightingCaps.dwCaps = D3DLIGHTCAPS_DIRECTIONAL | D3DLIGHTCAPS_PARALLELPOINT | D3DLIGHTCAPS_POINT | D3DLIGHTCAPS_SPOT;
d1->dlcLightingCaps.dwLightingModel = D3DLIGHTINGMODEL_RGB; d1->dlcLightingCaps.dwLightingModel = D3DLIGHTINGMODEL_RGB;
glGetIntegerv(GL_MAX_LIGHTS, &maxlight); d1->dlcLightingCaps.dwNumLights = maxlight; d1->dlcLightingCaps.dwNumLights = 16; /* glGetIntegerv(GL_MAX_LIGHTS, &maxlight); d1->dlcLightingCaps.dwNumLights = maxlight; */
fill_opengl_primcaps(&(d1->dpcLineCaps)); fill_opengl_primcaps(&(d1->dpcLineCaps));
fill_opengl_primcaps(&(d1->dpcTriCaps)); fill_opengl_primcaps(&(d1->dpcTriCaps));
d1->dwDeviceRenderBitDepth = DDBD_16; d1->dwDeviceRenderBitDepth = DDBD_16;
@ -160,6 +160,11 @@ int is_OpenGL(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE2 *de
odev->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); odev->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
odev->buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, odev->buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
surface->s.surface_desc.dwWidth * surface->s.surface_desc.dwHeight * 4); surface->s.surface_desc.dwWidth * surface->s.surface_desc.dwHeight * 4);
odev->rs.src = GL_ONE;
odev->rs.dst = GL_ZERO;
odev->rs.mag = GL_NEAREST;
odev->rs.min = GL_NEAREST;
odev->vt = 0;
memcpy(odev->world_mat, id_mat, 16 * sizeof(float)); memcpy(odev->world_mat, id_mat, 16 * sizeof(float));
memcpy(odev->view_mat , id_mat, 16 * sizeof(float)); memcpy(odev->view_mat , id_mat, 16 * sizeof(float));
@ -594,10 +599,12 @@ static HRESULT WINAPI IDirect3DDevice2_SetRenderState(LPDIRECT3DDEVICE2 this,
D3DRENDERSTATETYPE dwRenderStateType, D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState) DWORD dwRenderState)
{ {
OpenGL_IDirect3DDevice2 *odev = (OpenGL_IDirect3DDevice2 *) this;
TRACE(ddraw, "(%p)->(%d,%ld)\n", this, dwRenderStateType, dwRenderState); TRACE(ddraw, "(%p)->(%d,%ld)\n", this, dwRenderStateType, dwRenderState);
/* Call the render state functions */ /* Call the render state functions */
set_render_state(dwRenderStateType, dwRenderState); set_render_state(dwRenderStateType, dwRenderState, &(odev->rs));
return DD_OK; return DD_OK;
} }
@ -756,6 +763,165 @@ static HRESULT WINAPI IDirect3DDevice2_MultiplyTransform(LPDIRECT3DDEVICE2 this,
return DD_OK; return DD_OK;
} }
#define DRAW_PRIMITIVE(MAXVERT,INDEX) \
/* Puts GL in the correct lighting mode */ \
if (odev->vt != d3dv) { \
if (odev->vt == D3DVT_TLVERTEX) { \
/* Need to put the correct transformation again */ \
glMatrixMode(GL_MODELVIEW); \
glLoadMatrixf((float *) &(odev->world_mat)); \
glMatrixMode(GL_PROJECTION); \
glLoadMatrixf((float *) &(odev->proj_mat)); \
glMultMatrixf((float *) &(odev->view_mat)); \
} \
\
switch (d3dv) { \
case D3DVT_VERTEX: \
TRACE(ddraw, "Standard Vertex\n"); \
glEnable(GL_LIGHTING); \
break; \
\
case D3DVT_LVERTEX: \
TRACE(ddraw, "Lighted Vertex\n"); \
glDisable(GL_LIGHTING); \
break; \
\
case D3DVT_TLVERTEX: { \
GLdouble height, width, minZ, maxZ; \
\
TRACE(ddraw, "Transformed - Lighted Vertex\n"); \
/* First, disable lighting */ \
glDisable(GL_LIGHTING); \
\
/* Then do not put any transformation matrixes */ \
glMatrixMode(GL_MODELVIEW); \
glLoadIdentity(); \
glMatrixMode(GL_PROJECTION); \
glLoadIdentity(); \
\
if (this->current_viewport == NULL) { \
ERR(ddraw, "No current viewport !\n"); \
/* Using standard values */ \
height = 640.0; \
width = 480.0; \
minZ = -10.0; \
maxZ = 10.0; \
} else { \
if (this->current_viewport->use_vp2) { \
height = (GLdouble) this->current_viewport->viewport.vp2.dwHeight; \
width = (GLdouble) this->current_viewport->viewport.vp2.dwWidth; \
minZ = (GLdouble) this->current_viewport->viewport.vp2.dvMinZ; \
maxZ = (GLdouble) this->current_viewport->viewport.vp2.dvMaxZ; \
} else { \
height = (GLdouble) this->current_viewport->viewport.vp1.dwHeight; \
width = (GLdouble) this->current_viewport->viewport.vp1.dwWidth; \
minZ = (GLdouble) this->current_viewport->viewport.vp1.dvMinZ; \
maxZ = (GLdouble) this->current_viewport->viewport.vp1.dvMaxZ; \
} \
} \
\
glOrtho(0.0, width, height, 0.0, -minZ, -maxZ); \
} break; \
\
default: \
ERR(ddraw, "Unhandled vertex type\n"); \
break; \
} \
\
odev->vt = d3dv; \
} \
\
switch (d3dp) { \
case D3DPT_POINTLIST: \
TRACE(ddraw, "Start POINTS\n"); \
glBegin(GL_POINTS); \
break; \
\
case D3DPT_LINELIST: \
TRACE(ddraw, "Start LINES\n"); \
glBegin(GL_LINES); \
break; \
\
case D3DPT_LINESTRIP: \
TRACE(ddraw, "Start LINE_STRIP\n"); \
glBegin(GL_LINE_STRIP); \
break; \
\
case D3DPT_TRIANGLELIST: \
TRACE(ddraw, "Start TRIANGLES\n"); \
glBegin(GL_TRIANGLES); \
break; \
\
case D3DPT_TRIANGLESTRIP: \
TRACE(ddraw, "Start TRIANGLE_STRIP\n"); \
glBegin(GL_TRIANGLE_STRIP); \
break; \
\
case D3DPT_TRIANGLEFAN: \
TRACE(ddraw, "Start TRIANGLE_FAN\n"); \
glBegin(GL_TRIANGLE_FAN); \
break; \
\
default: \
TRACE(ddraw, "Unhandled primitive\n"); \
break; \
} \
\
/* Draw the primitives */ \
for (vx_index = 0; vx_index < MAXVERT; vx_index++) { \
switch (d3dv) { \
case D3DVT_VERTEX: { \
D3DVERTEX *vx = ((D3DVERTEX *) lpvertex) + INDEX; \
\
glNormal3f(vx->nx.nx, vx->ny.ny, vx->nz.nz); \
glVertex3f(vx->x.x, vx->y.y, vx->z.z); \
TRACE(ddraw, " V: %f %f %f\n", vx->x.x, vx->y.y, vx->z.z); \
} break; \
\
case D3DVT_LVERTEX: { \
D3DLVERTEX *vx = ((D3DLVERTEX *) lpvertex) + INDEX; \
DWORD col = vx->c.color; \
\
glColor3f(((col >> 16) & 0xFF) / 255.0, \
((col >> 8) & 0xFF) / 255.0, \
((col >> 0) & 0xFF) / 255.0); \
glVertex3f(vx->x.x, vx->y.y, vx->z.z); \
TRACE(ddraw, " LV: %f %f %f (%02lx %02lx %02lx)\n", \
vx->x.x, vx->y.y, vx->z.z, \
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF)); \
} break; \
\
case D3DVT_TLVERTEX: { \
D3DTLVERTEX *vx = ((D3DTLVERTEX *) lpvertex) + INDEX; \
DWORD col = vx->c.color; \
\
glColor3f(((col >> 16) & 0xFF) / 255.0, \
((col >> 8) & 0xFF) / 255.0, \
((col >> 0) & 0xFF) / 255.0); \
glTexCoord2f(vx->u.tu, vx->v.tv); \
if (vx->r.rhw < 0.01) \
glVertex3f(vx->x.sx, \
vx->y.sy, \
vx->z.sz); \
else \
glVertex4f(vx->x.sx / vx->r.rhw, \
vx->y.sy / vx->r.rhw, \
vx->z.sz / vx->r.rhw, \
1.0 / vx->r.rhw); \
TRACE(ddraw, " TLV: %f %f %f (%02lx %02lx %02lx) (%f %f) (%f)\n", \
vx->x.sx, vx->y.sy, vx->z.sz, \
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF), \
vx->u.tu, vx->v.tv, vx->r.rhw); \
} break; \
\
default: \
TRACE(ddraw, "Unhandled vertex type\n"); \
break; \
} \
} \
\
glEnd(); \
TRACE(ddraw, "End\n");
static HRESULT WINAPI IDirect3DDevice2_DrawPrimitive(LPDIRECT3DDEVICE2 this, static HRESULT WINAPI IDirect3DDevice2_DrawPrimitive(LPDIRECT3DDEVICE2 this,
@ -765,143 +931,14 @@ static HRESULT WINAPI IDirect3DDevice2_DrawPrimitive(LPDIRECT3DDEVICE2 this,
DWORD vertcount, DWORD vertcount,
DWORD dwFlags) DWORD dwFlags)
{ {
OpenGL_IDirect3DDevice2 *odev = (OpenGL_IDirect3DDevice2 *) this;
int vx_index; int vx_index;
TRACE(ddraw, "(%p)->(%d,%d,%p,%ld,%08lx): stub\n", this, d3dp, d3dv, lpvertex, vertcount, dwFlags); TRACE(ddraw, "(%p)->(%d,%d,%p,%ld,%08lx): stub\n", this, d3dp, d3dv, lpvertex, vertcount, dwFlags);
/* Puts GL in the correct lighting mode */ DRAW_PRIMITIVE(vertcount, vx_index);
switch (d3dv) {
case D3DVT_VERTEX:
TRACE(ddraw, "Standard Vertex\n");
glEnable(GL_LIGHTING);
break;
case D3DVT_LVERTEX: return D3D_OK;
TRACE(ddraw, "Lighted Vertex\n");
glDisable(GL_LIGHTING);
break;
case D3DVT_TLVERTEX: {
GLdouble height, width;
TRACE(ddraw, "Transformed - Lighted Vertex\n");
/* First, disable lighting */
glDisable(GL_LIGHTING);
/* Then do not put any transformation matrixes */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (this->current_viewport == NULL) {
ERR(ddraw, "No current viewport !\n");
/* Using standard values */
height = 640.0;
width = 480.0;
} else {
if (this->current_viewport->use_vp2) {
height = (GLdouble) this->current_viewport->viewport.vp2.dwHeight;
width = (GLdouble) this->current_viewport->viewport.vp2.dwWidth;
} else {
height = (GLdouble) this->current_viewport->viewport.vp1.dwHeight;
width = (GLdouble) this->current_viewport->viewport.vp1.dwWidth;
}
}
glOrtho(0.0, width, height, 0.0, 1.5, -1.5);
} break;
default:
TRACE(ddraw, "Unhandled vertex type\n");
break;
}
switch (d3dp) {
case D3DPT_POINTLIST:
TRACE(ddraw, "Start POINTS\n");
glBegin(GL_POINTS);
break;
case D3DPT_LINELIST:
TRACE(ddraw, "Start LINES\n");
glBegin(GL_LINES);
break;
case D3DPT_LINESTRIP:
TRACE(ddraw, "Start LINE_STRIP\n");
glBegin(GL_LINE_STRIP);
break;
case D3DPT_TRIANGLELIST:
TRACE(ddraw, "Start TRIANGLES\n");
glBegin(GL_TRIANGLES);
break;
case D3DPT_TRIANGLESTRIP:
TRACE(ddraw, "Start TRIANGLE_STRIP\n");
glBegin(GL_TRIANGLE_STRIP);
break;
case D3DPT_TRIANGLEFAN:
TRACE(ddraw, "Start TRIANGLE_FAN\n");
glBegin(GL_TRIANGLE_FAN);
break;
default:
TRACE(ddraw, "Unhandled primitive\n");
break;
}
/* Draw the primitives */
for (vx_index = 0; vx_index < vertcount; vx_index++) {
switch (d3dv) {
case D3DVT_VERTEX: {
D3DVERTEX *vx = ((D3DVERTEX *) lpvertex) + vx_index;
glNormal3f(vx->nx.nx, vx->ny.ny, vx->nz.nz);
glVertex3f(vx->x.x, vx->y.y, vx->z.z);
TRACE(ddraw, " V: %f %f %f\n", vx->x.x, vx->y.y, vx->z.z);
} break;
case D3DVT_LVERTEX: {
D3DLVERTEX *vx = ((D3DLVERTEX *) lpvertex) + vx_index;
DWORD col = vx->c.color;
glColor3f(((col >> 16) & 0xFF) / 255.0,
((col >> 8) & 0xFF) / 255.0,
((col >> 0) & 0xFF) / 255.0);
glVertex3f(vx->x.x, vx->y.y, vx->z.z);
TRACE(ddraw, " LV: %f %f %f (%02lx %02lx %02lx)\n",
vx->x.x, vx->y.y, vx->z.z,
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF));
} break;
case D3DVT_TLVERTEX: {
D3DTLVERTEX *vx = ((D3DTLVERTEX *) lpvertex) + vx_index;
DWORD col = vx->c.color;
glColor3f(((col >> 16) & 0xFF) / 255.0,
((col >> 8) & 0xFF) / 255.0,
((col >> 0) & 0xFF) / 255.0);
glTexCoord2f(vx->u.tu, vx->v.tv);
glVertex3f(vx->x.sx, vx->y.sy, vx->z.sz);
TRACE(ddraw, " TLV: %f %f %f (%02lx %02lx %02lx) (%f %f)\n",
vx->x.sx, vx->y.sy, vx->z.sz,
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF),
vx->u.tu, vx->v.tv);
} break;
default:
TRACE(ddraw, "Unhandled vertex type\n");
break;
}
}
glEnd();
TRACE(ddraw, "End\n");
return DD_OK;
} }
@ -915,73 +952,14 @@ static HRESULT WINAPI IDirect3DDevice2_DrawIndexedPrimitive(LPDIRECT3DDEVICE2 th
DWORD indexcount, DWORD indexcount,
DWORD dwFlags) DWORD dwFlags)
{ {
OpenGL_IDirect3DDevice2 *odev = (OpenGL_IDirect3DDevice2 *) this;
int vx_index; int vx_index;
TRACE(ddraw, "(%p)->(%d,%d,%p,%ld,%p,%ld,%08lx): stub\n", this, d3dp, d3dv, lpvertex, vertcount, lpindexes, indexcount, dwFlags); TRACE(ddraw, "(%p)->(%d,%d,%p,%ld,%p,%ld,%08lx): stub\n", this, d3dp, d3dv, lpvertex, vertcount, lpindexes, indexcount, dwFlags);
/* Puts GL in the correct lighting mode */ DRAW_PRIMITIVE(indexcount, lpindexes[vx_index]);
switch (d3dv) {
case D3DVT_VERTEX:
glEnable(GL_LIGHTING);
break;
case D3DVT_LVERTEX: return D3D_OK;
case D3DVT_TLVERTEX:
glDisable(GL_LIGHTING);
break;
default:
break;
}
switch (d3dp) {
case D3DPT_LINESTRIP:
TRACE(ddraw, "Start LINE_STRIP\n");
glBegin(GL_LINE_STRIP);
break;
case D3DPT_TRIANGLELIST:
TRACE(ddraw, "Start TRIANGLES\n");
glBegin(GL_TRIANGLES);
break;
default:
break;
}
/* Draw the primitives */
for (vx_index = 0; vx_index < indexcount; vx_index++) {
switch (d3dv) {
case D3DVT_VERTEX: {
D3DVERTEX *vx = ((D3DVERTEX *) lpvertex) + lpindexes[vx_index];
glNormal3f(vx->nx.nx, vx->ny.ny, vx->nz.nz);
glVertex3f(vx->x.x, vx->y.y, vx->z.z);
TRACE(ddraw, " V: %f %f %f\n", vx->x.x, vx->y.y, vx->z.z);
} break;
case D3DVT_LVERTEX: {
D3DLVERTEX *vx = ((D3DLVERTEX *) lpvertex) + lpindexes[vx_index];
DWORD col = vx->c.color;
glColor3f(((col >> 16) & 0xFF) / 255.0,
((col >> 8) & 0xFF) / 255.0,
((col >> 0) & 0xFF) / 255.0);
glVertex3f(vx->x.x, vx->y.y, vx->z.z);
TRACE(ddraw, " LV: %f %f %f (%02lx %02lx %02lx)\n",
vx->x.x, vx->y.y, vx->z.z,
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF));
} break;
default:
break;
}
}
glEnd();
TRACE(ddraw, "End\n");
return DD_OK;
} }
@ -1101,6 +1079,10 @@ int is_OpenGL_dx3(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE
odev->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL); odev->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
odev->buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, odev->buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
surface->s.surface_desc.dwWidth * surface->s.surface_desc.dwHeight * 4); surface->s.surface_desc.dwWidth * surface->s.surface_desc.dwHeight * 4);
odev->rs.src = GL_ONE;
odev->rs.dst = GL_ZERO;
odev->rs.mag = GL_NEAREST;
odev->rs.min = GL_NEAREST;
odev->world_mat = (LPD3DMATRIX) &id_mat; odev->world_mat = (LPD3DMATRIX) &id_mat;
odev->view_mat = (LPD3DMATRIX) &id_mat; odev->view_mat = (LPD3DMATRIX) &id_mat;

View File

@ -275,7 +275,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPD3DSTATE ci = (LPD3DSTATE) instr; LPD3DSTATE ci = (LPD3DSTATE) instr;
/* Handle the state transform */ /* Handle the state transform */
set_render_state(ci->t.drstRenderStateType, ci->v.dwArg[0]); set_render_state(ci->t.drstRenderStateType, ci->v.dwArg[0], &(odev->rs));
instr += size; instr += size;
} }

View File

@ -84,6 +84,12 @@ static ULONG WINAPI IDirect3DTexture2_Release(LPDIRECT3DTEXTURE2 this)
FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, this->ref ); FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, this->ref );
if (!--(this->ref)) { if (!--(this->ref)) {
/* Delete texture from OpenGL */
glDeleteTextures(1, &(this->tex_name));
/* Release surface */
this->surface->lpvtbl->fnRelease(this->surface);
HeapFree(GetProcessHeap(),0,this); HeapFree(GetProcessHeap(),0,this);
return 0; return 0;
} }
@ -168,17 +174,19 @@ static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
ERR(ddraw, "Error in surface sizes\n"); ERR(ddraw, "Error in surface sizes\n");
return D3DERR_TEXTURE_LOAD_FAILED; return D3DERR_TEXTURE_LOAD_FAILED;
} else { } else {
LPDIRECT3DDEVICE2 d3dd = (LPDIRECT3DDEVICE2) this->D3Ddevice; /* LPDIRECT3DDEVICE2 d3dd = (LPDIRECT3DDEVICE2) this->D3Ddevice; */
/* I should put a macro for the calculus of bpp */ /* I should put a macro for the calculus of bpp */
int bpp = (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ? int bpp = (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ?
1 /* 8 bit of palette index */: 1 /* 8 bit of palette index */:
src_d->ddpfPixelFormat.x.dwRGBBitCount / 8 /* RGB bits for each colors */ ); src_d->ddpfPixelFormat.x.dwRGBBitCount / 8 /* RGB bits for each colors */ );
GLuint current_texture;
/* Not sure if this is usefull ! */ /* Not sure if this is usefull ! */
memcpy(dst_d->y.lpSurface, src_d->y.lpSurface, src_d->dwWidth * src_d->dwHeight * bpp); memcpy(dst_d->y.lpSurface, src_d->y.lpSurface, src_d->dwWidth * src_d->dwHeight * bpp);
/* Now, load the texture */ /* Now, load the texture */
d3dd->set_context(d3dd); /* d3dd->set_context(d3dd); We need to set the context somehow.... */
glGetIntegerv(GL_TEXTURE_BINDING_2D, &current_texture);
glBindTexture(GL_TEXTURE_2D, this->tex_name); glBindTexture(GL_TEXTURE_2D, this->tex_name);
if (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) { if (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
@ -186,14 +194,45 @@ static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
BYTE table[256][4]; BYTE table[256][4];
int i; int i;
if (pal == NULL) {
ERR(ddraw, "Palettized texture Loading with a NULL palette !\n");
return D3DERR_TEXTURE_LOAD_FAILED;
}
/* Get the surface's palette */ /* Get the surface's palette */
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
table[i][0] = pal->palents[i].peRed; table[i][0] = pal->palents[i].peRed;
table[i][1] = pal->palents[i].peGreen; table[i][1] = pal->palents[i].peGreen;
table[i][2] = pal->palents[i].peBlue; table[i][2] = pal->palents[i].peBlue;
if ((this->surface->s.surface_desc.dwFlags & DDSD_CKSRCBLT) &&
(i >= this->surface->s.surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue) &&
(i <= this->surface->s.surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue))
table[i][3] = 0x00;
else
table[i][3] = 0xFF; table[i][3] = 0xFF;
} }
#if 0
/* If you want to see how the game manages its textures :-) */
{
FILE *f;
char buf[32];
int x, y;
sprintf(buf, "%d.pnm", this->tex_name);
f = fopen(buf, "wb");
fprintf(f, "P6\n%d %d\n255\n", src_d->dwWidth, src_d->dwHeight);
for (y = 0; y < src_d->dwHeight; y++) {
for (x = 0; x < src_d->dwWidth; x++) {
unsigned char c = ((unsigned char *) src_d->y.lpSurface)[y * src_d->dwWidth + x];
fputc(table[c][0], f);
fputc(table[c][1], f);
fputc(table[c][2], f);
}
}
fclose(f);
}
#endif
/* Use Paletted Texture Extension */ /* Use Paletted Texture Extension */
glColorTableEXT(GL_TEXTURE_2D, /* target */ glColorTableEXT(GL_TEXTURE_2D, /* target */
GL_RGBA, /* internal format */ GL_RGBA, /* internal format */
@ -213,9 +252,11 @@ static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
} else { } else {
ERR(ddraw, "Unhandled texture format\n"); ERR(ddraw, "Unhandled texture format\n");
} }
glBindTexture(GL_TEXTURE_2D, current_texture);
} }
return DD_OK; return D3D_OK;
} }

View File

@ -210,6 +210,7 @@ static HRESULT WINAPI IDirect3DViewport2_Clear(LPDIRECT3DVIEWPORT2 this,
LPD3DRECT lpRects, LPD3DRECT lpRects,
DWORD dwFlags) DWORD dwFlags)
{ {
GLboolean ztest;
FIXME(ddraw, "(%p)->(%8ld,%p,%08lx): stub\n", this, dwCount, lpRects, dwFlags); FIXME(ddraw, "(%p)->(%8ld,%p,%08lx): stub\n", this, dwCount, lpRects, dwFlags);
/* For the moment, ignore the rectangles */ /* For the moment, ignore the rectangles */
@ -221,8 +222,10 @@ static HRESULT WINAPI IDirect3DViewport2_Clear(LPDIRECT3DVIEWPORT2 this,
this->device.active_device1->set_context(this->device.active_device1); this->device.active_device1->set_context(this->device.active_device1);
/* Clears the screen */ /* Clears the screen */
glGetBooleanv(GL_DEPTH_TEST, &ztest);
glDepthMask(GL_TRUE); /* Enables Z writing to be sure to delete also the Z buffer */ glDepthMask(GL_TRUE); /* Enables Z writing to be sure to delete also the Z buffer */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthMask(ztest);
} }
return DD_OK; return DD_OK;

View File

@ -46,6 +46,7 @@
#include "message.h" #include "message.h"
#include "x11drv.h" #include "x11drv.h"
#include "options.h" #include "options.h"
#include "objbase.h"
#ifdef HAVE_LIBXXF86DGA #ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h" #include "ts_xf86dga.h"
@ -100,7 +101,7 @@ static XF86VidModeModeInfo *orig_mode = NULL;
#endif #endif
BOOL32 BOOL32
DDRAW_DGA_Available() DDRAW_DGA_Available(void)
{ {
#ifdef HAVE_LIBXXF86DGA #ifdef HAVE_LIBXXF86DGA
int evbase, evret, fd; int evbase, evret, fd;
@ -415,7 +416,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Unlock(
{ {
TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface); TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface);
if (!this->s.ddraw->e.xlib.paintable) if (!this->s.ddraw->d.paintable)
return DD_OK; return DD_OK;
/* Only redraw the screen when unlocking the buffer that is on screen */ /* Only redraw the screen when unlocking the buffer that is on screen */
@ -488,7 +489,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Flip(
LPDIRECTDRAWSURFACE3 this,LPDIRECTDRAWSURFACE3 flipto,DWORD dwFlags LPDIRECTDRAWSURFACE3 this,LPDIRECTDRAWSURFACE3 flipto,DWORD dwFlags
) { ) {
TRACE(ddraw,"(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags); TRACE(ddraw,"(%p)->Flip(%p,%08lx)\n",this,flipto,dwFlags);
if (!this->s.ddraw->e.xlib.paintable) if (!this->s.ddraw->d.paintable)
return DD_OK; return DD_OK;
if (!flipto) { if (!flipto) {
@ -557,6 +558,9 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_SetPalette(
{ {
pal->cm = TSXCreateColormap(display,this->s.ddraw->d.drawable,DefaultVisualOfScreen(screen),AllocAll); pal->cm = TSXCreateColormap(display,this->s.ddraw->d.drawable,DefaultVisualOfScreen(screen),AllocAll);
if (!Options.managed)
TSXInstallColormap(display,pal->cm);
for (i=0;i<256;i++) { for (i=0;i<256;i++) {
XColor xc; XColor xc;
@ -567,6 +571,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_SetPalette(
xc.pixel = i; xc.pixel = i;
TSXStoreColor(display,pal->cm,&xc); TSXStoreColor(display,pal->cm,&xc);
} }
TSXInstallColormap(display,pal->cm);
} }
/* According to spec, we are only supposed to /* According to spec, we are only supposed to
@ -863,6 +868,11 @@ static ULONG WINAPI DGA_IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) {
} else { } else {
this->s.ddraw->e.dga.vpmask &= ~(1<<(this->t.dga.fb_height/this->s.ddraw->e.dga.fb_height)); this->s.ddraw->e.dga.vpmask &= ~(1<<(this->t.dga.fb_height/this->s.ddraw->e.dga.fb_height));
} }
/* Free the backbuffer */
if (this->s.backbuffer)
this->s.backbuffer->lpvtbl->fnRelease(this->s.backbuffer);
HeapFree(GetProcessHeap(),0,this); HeapFree(GetProcessHeap(),0,this);
return 0; return 0;
} }
@ -1074,24 +1084,29 @@ static HRESULT WINAPI IDirectDrawSurface3_SetColorKey(
if( dwFlags & DDCKEY_SRCBLT ) if( dwFlags & DDCKEY_SRCBLT )
{ {
dwFlags &= ~DDCKEY_SRCBLT; dwFlags &= ~DDCKEY_SRCBLT;
memcpy( &(this->s.ckSrcBlt), ckey, sizeof( *ckey ) ); this->s.surface_desc.dwFlags |= DDSD_CKSRCBLT;
memcpy( &(this->s.surface_desc.ddckCKSrcBlt), ckey, sizeof( *ckey ) );
} }
if( dwFlags & DDCKEY_DESTBLT ) if( dwFlags & DDCKEY_DESTBLT )
{ {
dwFlags &= ~DDCKEY_DESTBLT; dwFlags &= ~DDCKEY_DESTBLT;
memcpy( &(this->s.ckDestBlt), ckey, sizeof( *ckey ) ); this->s.surface_desc.dwFlags |= DDSD_CKDESTBLT;
memcpy( &(this->s.surface_desc.ddckCKDestBlt), ckey, sizeof( *ckey ) );
} }
if( dwFlags & DDCKEY_SRCOVERLAY ) if( dwFlags & DDCKEY_SRCOVERLAY )
{ {
dwFlags &= ~DDCKEY_SRCOVERLAY; dwFlags &= ~DDCKEY_SRCOVERLAY;
memcpy( &(this->s.ckSrcOverlay), ckey, sizeof( *ckey ) ); this->s.surface_desc.dwFlags |= DDSD_CKSRCOVERLAY;
memcpy( &(this->s.surface_desc.ddckCKSrcOverlay), ckey, sizeof( *ckey ) );
} }
if( dwFlags & DDCKEY_DESTOVERLAY ) if( dwFlags & DDCKEY_DESTOVERLAY )
{ {
dwFlags &= ~DDCKEY_DESTOVERLAY; dwFlags &= ~DDCKEY_DESTOVERLAY;
memcpy( &(this->s.ckDestOverlay), ckey, sizeof( *ckey ) ); this->s.surface_desc.dwFlags |= DDSD_CKDESTOVERLAY;
memcpy( &(this->s.surface_desc.ddckCKDestOverlay), ckey, sizeof( *ckey ) );
} }
if( dwFlags ) if( dwFlags )
@ -1152,25 +1167,25 @@ static HRESULT WINAPI IDirectDrawSurface3_GetColorKey(
if( dwFlags & DDCKEY_SRCBLT ) { if( dwFlags & DDCKEY_SRCBLT ) {
dwFlags &= ~DDCKEY_SRCBLT; dwFlags &= ~DDCKEY_SRCBLT;
memcpy( lpDDColorKey, &(this->s.ckSrcBlt), sizeof( *lpDDColorKey ) ); memcpy( lpDDColorKey, &(this->s.surface_desc.ddckCKSrcBlt), sizeof( *lpDDColorKey ) );
} }
if( dwFlags & DDCKEY_DESTBLT ) if( dwFlags & DDCKEY_DESTBLT )
{ {
dwFlags &= ~DDCKEY_DESTBLT; dwFlags &= ~DDCKEY_DESTBLT;
memcpy( lpDDColorKey, &(this->s.ckDestBlt), sizeof( *lpDDColorKey ) ); memcpy( lpDDColorKey, &(this->s.surface_desc.ddckCKDestBlt), sizeof( *lpDDColorKey ) );
} }
if( dwFlags & DDCKEY_SRCOVERLAY ) if( dwFlags & DDCKEY_SRCOVERLAY )
{ {
dwFlags &= ~DDCKEY_SRCOVERLAY; dwFlags &= ~DDCKEY_SRCOVERLAY;
memcpy( lpDDColorKey, &(this->s.ckSrcOverlay), sizeof( *lpDDColorKey ) ); memcpy( lpDDColorKey, &(this->s.surface_desc.ddckCKSrcOverlay), sizeof( *lpDDColorKey ) );
} }
if( dwFlags & DDCKEY_DESTOVERLAY ) if( dwFlags & DDCKEY_DESTOVERLAY )
{ {
dwFlags &= ~DDCKEY_DESTOVERLAY; dwFlags &= ~DDCKEY_DESTOVERLAY;
memcpy( lpDDColorKey, &(this->s.ckDestOverlay), sizeof( *lpDDColorKey ) ); memcpy( lpDDColorKey, &(this->s.surface_desc.ddckCKDestOverlay), sizeof( *lpDDColorKey ) );
} }
if( dwFlags ) if( dwFlags )
@ -2427,7 +2442,7 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
_common_IDirectDraw_SetDisplayMode(this); _common_IDirectDraw_SetDisplayMode(this);
this->e.xlib.paintable = 1; this->d.paintable = 1;
this->d.drawable = ((X11DRV_WND_DATA *) WIN_FindWndPtr(this->d.window)->pDriverData)->window; this->d.drawable = ((X11DRV_WND_DATA *) WIN_FindWndPtr(this->d.window)->pDriverData)->window;
/* We don't have a context for this window. Host off the desktop */ /* We don't have a context for this window. Host off the desktop */
if( !this->d.drawable ) if( !this->d.drawable )
@ -2633,12 +2648,16 @@ static ULONG WINAPI DGA_IDirectDraw2_Release(LPDIRECTDRAW2 this) {
TSXF86DGADirectVideo(display,DefaultScreen(display),0); TSXF86DGADirectVideo(display,DefaultScreen(display),0);
#ifdef HAVE_LIBXXF86VM #ifdef HAVE_LIBXXF86VM
if (orig_mode) if (orig_mode) {
TSXF86VidModeSwitchToMode(display, DefaultScreen(display), orig_mode); TSXF86VidModeSwitchToMode(
display,
DefaultScreen(display),
orig_mode);
if (orig_mode->privsize) if (orig_mode->privsize)
TSXFree(orig_mode->private); TSXFree(orig_mode->private);
free(orig_mode); free(orig_mode);
orig_mode = NULL; orig_mode = NULL;
}
#endif #endif
#ifdef RESTORE_SIGNALS #ifdef RESTORE_SIGNALS
@ -3135,7 +3154,7 @@ LRESULT WINAPI Xlib_DDWndProc(HWND32 hwnd,UINT32 msg,WPARAM32 wParam,LPARAM lPar
{ {
/* Perform any special direct draw functions */ /* Perform any special direct draw functions */
if (msg==WM_PAINT) if (msg==WM_PAINT)
ddraw->e.xlib.paintable = 1; ddraw->d.paintable = 1;
/* Now let the application deal with the rest of this */ /* Now let the application deal with the rest of this */
if( ddraw->d.mainWindow ) if( ddraw->d.mainWindow )
@ -3232,7 +3251,7 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
} }
BOOL32 BOOL32
DDRAW_XSHM_Available() DDRAW_XSHM_Available(void)
{ {
#ifdef HAVE_LIBXXSHM #ifdef HAVE_LIBXXSHM
if (TSXShmQueryExtension(display)) if (TSXShmQueryExtension(display))

View File

@ -138,7 +138,7 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
} }
/****************************************************************************** /******************************************************************************
* ExtEscape32 [GDI32.95] * ExtEscape [GDI32.95]
* *
* PARAMS * PARAMS
* hdc [I] Handle to device context * hdc [I] Handle to device context
@ -153,7 +153,7 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
* Not implemented: 0 * Not implemented: 0
* Failure: <0 * Failure: <0
*/ */
INT32 WINAPI ExtEscape32( HDC32 hdc, INT32 nEscape, INT32 cbInput, INT32 WINAPI ExtEscape( HDC32 hdc, INT32 nEscape, INT32 cbInput,
LPCSTR lpszInData, INT32 cbOutput, LPSTR lpszOutData ) LPCSTR lpszInData, INT32 cbOutput, LPSTR lpszOutData )
{ {
FIXME(driver,"(0x%04x,0x%x,%d,%s,%d,%p):stub\n", FIXME(driver,"(0x%04x,0x%x,%d,%s,%d,%p):stub\n",
@ -166,7 +166,7 @@ INT32 WINAPI ExtEscape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
* *
* *
*/ */
INT32 WINAPI DrawEscape32(HDC32 hdc, INT32 nEscape, INT32 cbInput, LPCSTR lpszInData) INT32 WINAPI DrawEscape(HDC32 hdc, INT32 nEscape, INT32 cbInput, LPCSTR lpszInData)
{ {
FIXME(gdi, "DrawEscape, stub\n"); FIXME(gdi, "DrawEscape, stub\n");
return 0; return 0;

View File

@ -407,7 +407,7 @@ HDC32 WINAPI CreateEnhMetaFile32W(
return hReturnDC; return hReturnDC;
} }
HENHMETAFILE32 WINAPI CloseEnhMetaFile32( HDC32 hdc /* metafile DC */ ) HENHMETAFILE32 WINAPI CloseEnhMetaFile( HDC32 hdc /* metafile DC */ )
{ {
/* write EMR_EOF(0x0, 0x10, 0x14) */ /* write EMR_EOF(0x0, 0x10, 0x14) */
return 0; return 0;

View File

@ -127,9 +127,9 @@ BOOL32 WINAPI Arc32( HDC32 hdc, INT32 left, INT32 top, INT32 right,
} }
/*********************************************************************** /***********************************************************************
* ArcTo32 (GDI32.8) * ArcTo (GDI32.8)
*/ */
BOOL32 WINAPI ArcTo32( HDC32 hdc, BOOL32 WINAPI ArcTo( HDC32 hdc,
INT32 left, INT32 top, INT32 left, INT32 top,
INT32 right, INT32 bottom, INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart, INT32 xstart, INT32 ystart,
@ -819,9 +819,9 @@ BOOL32 WINAPI PolyPolygon32( HDC32 hdc, const POINT32* pt, const INT32* counts,
} }
/********************************************************************** /**********************************************************************
* PolyPolyline32 (GDI32.272) * PolyPolyline (GDI32.272)
*/ */
BOOL32 WINAPI PolyPolyline32( HDC32 hdc, const POINT32* pt, const DWORD* counts, BOOL32 WINAPI PolyPolyline( HDC32 hdc, const POINT32* pt, const DWORD* counts,
DWORD polylines ) DWORD polylines )
{ {
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
@ -1206,10 +1206,10 @@ BOOL32 WINAPI PolyBezierTo32( HDC32 hdc, const POINT32* lppt, DWORD cPoints )
} }
/*************************************************************** /***************************************************************
* AngleArc32 (GDI32.5) * AngleArc (GDI32.5)
* *
*/ */
BOOL32 WINAPI AngleArc32(HDC32 hdc, INT32 x, INT32 y, DWORD dwRadius, BOOL32 WINAPI AngleArc(HDC32 hdc, INT32 x, INT32 y, DWORD dwRadius,
FLOAT eStartAngle, FLOAT eSweepAngle) FLOAT eStartAngle, FLOAT eSweepAngle)
{ {
FIXME(gdi,"AngleArc, stub\n"); FIXME(gdi,"AngleArc, stub\n");

View File

@ -39,6 +39,8 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth)
lpddraw->lpvtbl->fnCreatePalette(lpddraw,0,NULL,&lpddpal,NULL); lpddraw->lpvtbl->fnCreatePalette(lpddraw,0,NULL,&lpddpal,NULL);
memset(&sdesc,0,sizeof(sdesc)); memset(&sdesc,0,sizeof(sdesc));
sdesc.dwSize=sizeof(sdesc); sdesc.dwSize=sizeof(sdesc);
sdesc.dwFlags = DDSD_CAPS;
sdesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if (lpddraw->lpvtbl->fnCreateSurface(lpddraw,&sdesc,&lpddsurf,NULL)||(!lpddsurf)) { if (lpddraw->lpvtbl->fnCreateSurface(lpddraw,&sdesc,&lpddsurf,NULL)||(!lpddsurf)) {
ERR(ddraw,"DirectDraw surface is not available\n"); ERR(ddraw,"DirectDraw surface is not available\n");
lpddraw->lpvtbl->fnRelease(lpddraw); lpddraw->lpvtbl->fnRelease(lpddraw);
@ -119,6 +121,9 @@ void VGA_Unlock(void)
lpddsurf->lpvtbl->fnUnlock(lpddsurf,sdesc.y.lpSurface); lpddsurf->lpvtbl->fnUnlock(lpddsurf,sdesc.y.lpSurface);
} }
/* We are called from SIGALRM, aren't we? We should _NOT_ do synchronization
* stuff!
*/
void VGA_Poll( WORD timer ) void VGA_Poll( WORD timer )
{ {
char *dat; char *dat;
@ -138,7 +143,7 @@ void VGA_Poll( WORD timer )
/* copy from virtual VGA frame buffer to DirectDraw surface */ /* copy from virtual VGA frame buffer to DirectDraw surface */
for (Y=0; Y<Height; Y++,surf+=Pitch,dat+=Width) { for (Y=0; Y<Height; Y++,surf+=Pitch,dat+=Width) {
memcpy(surf,dat,Width); memcpy(surf,dat,Width);
for (X=0; X<Width; X++) if (dat[X]) TRACE(ddraw,"data(%d) at (%d,%d)\n",dat[X],X,Y); /*for (X=0; X<Width; X++) if (dat[X]) TRACE(ddraw,"data(%d) at (%d,%d)\n",dat[X],X,Y);*/
} }
VGA_Unlock(); VGA_Unlock();
vga_refresh=1; vga_refresh=1;

View File

@ -117,8 +117,8 @@ file gdi.exe
106 pascal SetBitmapBits(word long ptr) SetBitmapBits16 106 pascal SetBitmapBits(word long ptr) SetBitmapBits16
117 pascal SetDCOrg(word s_word s_word) SetDCOrg 117 pascal SetDCOrg(word s_word s_word) SetDCOrg
119 pascal16 AddFontResource(str) AddFontResource16 119 pascal16 AddFontResource(str) AddFontResource16
121 stub Death 121 pascal16 Death(word) Death
122 stub ReSurRection 122 pascal16 Resurrection(word word word word word word word) Resurrection
123 pascal16 PlayMetaFile(word word) PlayMetaFile16 123 pascal16 PlayMetaFile(word word) PlayMetaFile16
124 pascal16 GetMetaFile(str) GetMetaFile16 124 pascal16 GetMetaFile(str) GetMetaFile16
125 pascal16 CreateMetaFile(str) CreateMetaFile16 125 pascal16 CreateMetaFile(str) CreateMetaFile16

View File

@ -400,6 +400,8 @@ file krnl386.exe
493 stub UTInit 493 stub UTInit
494 stub KERNEL_494 494 stub KERNEL_494
# 495 is present only in Win98
495 pascal WaitForMultipleObjectsEx(long ptr long long long) WIN16_WaitForMultipleObjectsEx
# 500-544 are WinNT extensions; some are also available in Win95 # 500-544 are WinNT extensions; some are also available in Win95

View File

@ -360,7 +360,7 @@ file user.exe
384 pascal16 SetMenuContextHelpId(word word) SetMenuContextHelpId16 384 pascal16 SetMenuContextHelpId(word word) SetMenuContextHelpId16
385 pascal16 GetMenuContextHelpId(word) GetMenuContextHelpId16 385 pascal16 GetMenuContextHelpId(word) GetMenuContextHelpId16
389 pascal LoadImage(word segstr word word word word) LoadImage16 389 pascal LoadImage(word segstr word word word word) LoadImage16
390 stub CopyImage 390 pascal16 CopyImage(word word word word word) CopyImage16
391 stub SignalProc32 391 stub SignalProc32
394 pascal16 DrawIconEx(word word word word word word word word word) DrawIconEx16 394 pascal16 DrawIconEx(word word word word word word word word word) DrawIconEx16
395 stub GetIconInfo 395 stub GetIconInfo

View File

@ -616,6 +616,7 @@ typedef struct _HD_ITEM32W
#define HDITEM WINELIB_NAME_AW(HDITEM) #define HDITEM WINELIB_NAME_AW(HDITEM)
#define LPHDITEM WINELIB_NAME_AW(LPHDITEM) #define LPHDITEM WINELIB_NAME_AW(LPHDITEM)
#define HD_ITEM HDITEM
#define HDITEM_V1_SIZE32A CCSIZEOF_STRUCT(HDITEM32A, lParam) #define HDITEM_V1_SIZE32A CCSIZEOF_STRUCT(HDITEM32A, lParam)
#define HDITEM_V1_SIZE32W CCSIZEOF_STRUCT(HDITEM32W, lParam) #define HDITEM_V1_SIZE32W CCSIZEOF_STRUCT(HDITEM32W, lParam)
@ -2211,8 +2212,8 @@ typedef struct tagLVITEMW
INT32 iIndent; /* (_WIN32_IE >= 0x0300) */ INT32 iIndent; /* (_WIN32_IE >= 0x0300) */
} LVITEM32W, *LPLVITEM32W; } LVITEM32W, *LPLVITEM32W;
#define LVITEM32 WINELIB_NAME_AW(LVITEM) #define LVITEM WINELIB_NAME_AW(LVITEM)
#define LPLVITEM32 WINELIB_NAME_AW(LPLVITEM) #define LPLVITEM WINELIB_NAME_AW(LPLVITEM)
#define LVITEM_V1_SIZE32A CCSIZEOF_STRUCT(LVITEM32A, lParam) #define LVITEM_V1_SIZE32A CCSIZEOF_STRUCT(LVITEM32A, lParam)
#define LVITEM_V1_SIZE32W CCSIZEOF_STRUCT(LVITEM32W, lParam) #define LVITEM_V1_SIZE32W CCSIZEOF_STRUCT(LVITEM32W, lParam)
@ -2454,7 +2455,7 @@ typedef struct tagTCITEM32W
#define TCITEM WINELIB_NAME_AW(TCITEM) #define TCITEM WINELIB_NAME_AW(TCITEM)
#define LPTCITEM WINELIB_NAME_AW(LPTCITEM) #define LPTCITEM WINELIB_NAME_AW(LPTCITEM)
#define TC_ITEM TCITEM
#define TCN_FIRST (0U-550U) #define TCN_FIRST (0U-550U)
#define TCN_LAST (0U-580U) #define TCN_LAST (0U-580U)

View File

@ -671,7 +671,7 @@ LRESULT WINAPI PrintSetupDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPAR
LRESULT WINAPI FormatCharDlgProc16(HWND16,UINT16,WPARAM16,LPARAM); LRESULT WINAPI FormatCharDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
LRESULT WINAPI FormatCharDlgProc32A(HWND32,UINT32,WPARAM32,LPARAM); LRESULT WINAPI FormatCharDlgProc32A(HWND32,UINT32,WPARAM32,LPARAM);
LRESULT WINAPI FormatCharDlgProc32W(HWND32,UINT32,WPARAM32,LPARAM); LRESULT WINAPI FormatCharDlgProc32W(HWND32,UINT32,WPARAM32,LPARAM);
#define FormatCharDlgProc LIBWINE_NAME_AW(FormatCharDlgProc) #define FormatCharDlgProc WINELIB_NAME_AW(FormatCharDlgProc)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -111,7 +111,7 @@ typedef enum {
D3DLIGHT_SPOT = 2, D3DLIGHT_SPOT = 2,
D3DLIGHT_DIRECTIONAL = 3, D3DLIGHT_DIRECTIONAL = 3,
D3DLIGHT_PARALLELPOINT = 4, D3DLIGHT_PARALLELPOINT = 4,
D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ D3DLIGHT_FORCE_DWORD = 0x7fffffff
} D3DLIGHTTYPE; } D3DLIGHTTYPE;
typedef enum { typedef enum {
@ -121,9 +121,69 @@ typedef enum {
D3DPT_TRIANGLELIST = 4, D3DPT_TRIANGLELIST = 4,
D3DPT_TRIANGLESTRIP = 5, D3DPT_TRIANGLESTRIP = 5,
D3DPT_TRIANGLEFAN = 6, D3DPT_TRIANGLEFAN = 6,
D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ D3DPT_FORCE_DWORD = 0x7fffffff
} D3DPRIMITIVETYPE; } D3DPRIMITIVETYPE;
typedef enum {
D3DFILL_POINT = 1,
D3DFILL_WIREFRAME = 2,
D3DFILL_SOLID = 3,
D3DFILL_FORCE_DWORD = 0x7fffffff
} D3DFILLMODE;
typedef enum {
D3DSHADE_FLAT = 1,
D3DSHADE_GOURAUD = 2,
D3DSHADE_PHONG = 3,
D3DSHADE_FORCE_DWORD = 0x7fffffff
} D3DSHADEMODE;
typedef enum {
D3DCULL_NONE = 1,
D3DCULL_CW = 2,
D3DCULL_CCW = 3,
D3DCULL_FORCE_DWORD = 0x7fffffff
} D3DCULL;
typedef enum {
D3DBLEND_ZERO = 1,
D3DBLEND_ONE = 2,
D3DBLEND_SRCCOLOR = 3,
D3DBLEND_INVSRCCOLOR = 4,
D3DBLEND_SRCALPHA = 5,
D3DBLEND_INVSRCALPHA = 6,
D3DBLEND_DESTALPHA = 7,
D3DBLEND_INVDESTALPHA = 8,
D3DBLEND_DESTCOLOR = 9,
D3DBLEND_INVDESTCOLOR = 10,
D3DBLEND_SRCALPHASAT = 11,
D3DBLEND_BOTHSRCALPHA = 12,
D3DBLEND_BOTHINVSRCALPHA = 13,
D3DBLEND_FORCE_DWORD = 0x7fffffff
} D3DBLEND;
typedef enum {
D3DTBLEND_DECAL = 1,
D3DTBLEND_MODULATE = 2,
D3DTBLEND_DECALALPHA = 3,
D3DTBLEND_MODULATEALPHA = 4,
D3DTBLEND_DECALMASK = 5,
D3DTBLEND_MODULATEMASK = 6,
D3DTBLEND_COPY = 7,
D3DTBLEND_ADD = 8,
D3DTBLEND_FORCE_DWORD = 0x7fffffff
} D3DTEXTUREBLEND;
typedef enum {
D3DFILTER_NEAREST = 1,
D3DFILTER_LINEAR = 2,
D3DFILTER_MIPNEAREST = 3,
D3DFILTER_MIPLINEAR = 4,
D3DFILTER_LINEARMIPNEAREST = 5,
D3DFILTER_LINEARMIPLINEAR = 6,
D3DFILTER_FORCE_DWORD = 0x7fffffff
} D3DTEXTUREFILTER;
typedef enum { typedef enum {
D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle */ D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle */
D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */ D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */

View File

@ -903,6 +903,7 @@ struct _common_directdrawdata {
HWND32 window; HWND32 window;
Window drawable; Window drawable;
PAINTSTRUCT32 ps; PAINTSTRUCT32 ps;
int paintable;
}; };
struct _dga_directdrawdata { struct _dga_directdrawdata {
@ -912,8 +913,6 @@ struct _dga_directdrawdata {
}; };
struct _xlib_directdrawdata { struct _xlib_directdrawdata {
int paintable;
#ifdef HAVE_LIBXXSHM #ifdef HAVE_LIBXXSHM
int xshm_active; int xshm_active;
#endif #endif
@ -999,9 +998,6 @@ struct _common_directdrawsurface {
LPDIRECTDRAWSURFACE3 backbuffer; LPDIRECTDRAWSURFACE3 backbuffer;
DDSURFACEDESC surface_desc; DDSURFACEDESC surface_desc;
DDCOLORKEY ckDestOverlay, ckSrcOverlay;
DDCOLORKEY ckDestBlt, ckSrcBlt;
}; };
struct _dga_directdrawsurface { struct _dga_directdrawsurface {

View File

@ -37,22 +37,6 @@ typedef struct
int flags; int flags;
} DOS_DEVICE; } DOS_DEVICE;
/* Macros to convert 16 bit to 32 bit file handles and back */
/* LZW handles are exempt as if not, could go below 0x400 */
#define HFILE16_TO_HFILE32(handle) \
(((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
((handle)==3) ? GetStdHandle(STD_ERROR_HANDLE) : \
((handle)==4) ? GetStdHandle(STD_ERROR_HANDLE) : \
((handle)>=0x400) ? handle : \
(handle)-5)
#define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
((hnd)>=0x400) ? hnd : \
(HFILE16)hnd+5); })
/* files/file.c */ /* files/file.c */
extern FILE_OBJECT *FILE_GetFile( HFILE32 handle, DWORD access, extern FILE_OBJECT *FILE_GetFile( HFILE32 handle, DWORD access,
@ -61,7 +45,7 @@ extern void FILE_ReleaseFile( FILE_OBJECT *file );
extern void FILE_SetDosError(void); extern void FILE_SetDosError(void);
extern HFILE32 FILE_DupUnixHandle( int fd, DWORD access ); extern HFILE32 FILE_DupUnixHandle( int fd, DWORD access );
extern BOOL32 FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info ); extern BOOL32 FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 ); extern HFILE16 FILE_Dup2( HFILE16 hFile1, HFILE16 hFile2 );
extern HFILE32 FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing, extern HFILE32 FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
LPSECURITY_ATTRIBUTES sa, DWORD creation, LPSECURITY_ATTRIBUTES sa, DWORD creation,
DWORD attributes, HANDLE32 template ); DWORD attributes, HANDLE32 template );
@ -70,7 +54,9 @@ extern LPVOID FILE_dommap( int unix_handle, LPVOID start,
DWORD offset_high, DWORD offset_low, DWORD offset_high, DWORD offset_low,
int prot, int flags ); int prot, int flags );
extern int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low ); extern int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low );
extern HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr ); extern HFILE16 FILE_AllocDosHandle( HANDLE32 handle );
extern HANDLE32 FILE_GetHandle32( HFILE16 hfile );
extern HFILE16 _lcreat16_uniq( LPCSTR path, INT32 attr );
/* files/directory.c */ /* files/directory.c */
extern int DIR_Init(void); extern int DIR_Init(void);

View File

@ -35,21 +35,6 @@ typedef struct tagGDIOBJHDR
} GDIOBJHDR; } GDIOBJHDR;
#define OBJ_PEN 1
#define OBJ_BRUSH 2
#define OBJ_DC 3
#define OBJ_METADC 4
#define OBJ_PAL 5
#define OBJ_FONT 6
#define OBJ_BITMAP 7
#define OBJ_REGION 8
#define OBJ_METAFILE 9
#define OBJ_MEMDC 10
#define OBJ_EXTPEN 11
#define OBJ_ENHMETADC 12
#define OBJ_ENHMETAFILE 13
typedef struct tagDeviceCaps typedef struct tagDeviceCaps
{ {
WORD version; /* 0: driver version */ WORD version; /* 0: driver version */

View File

@ -147,7 +147,7 @@ extern FARPROC32 MODULE_GetProcAddress32( struct _PDB32*pdb,HMODULE32 hModule,LP
extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule ); extern WINE_MODREF *MODULE32_LookupHMODULE( struct _PDB32 *process, HMODULE32 hModule );
extern void MODULE_InitializeDLLs( struct _PDB32 *process, HMODULE32 root, DWORD type, LPVOID lpReserved ); extern void MODULE_InitializeDLLs( struct _PDB32 *process, HMODULE32 root, DWORD type, LPVOID lpReserved );
extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path ); extern HMODULE32 MODULE_FindModule32( struct _PDB32 *process, LPCSTR path );
extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs ); extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName );
extern FARPROC16 MODULE_GetWndProcEntry16( const char *name ); extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name ); extern FARPROC16 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name );
extern SEGPTR WINAPI HasGPHandler( SEGPTR address ); extern SEGPTR WINAPI HasGPHandler( SEGPTR address );

View File

@ -108,6 +108,7 @@ typedef struct _PDB32
LCID locale; /* c4 Locale to be queried by GetThreadLocale (NT) */ LCID locale; /* c4 Locale to be queried by GetThreadLocale (NT) */
/* The following are Wine-specific fields */ /* The following are Wine-specific fields */
void *server_pid; /* Server id for this process */ void *server_pid; /* Server id for this process */
HANDLE32 *dos_handles; /* Handles mapping DOS -> Win32 */
struct _PDB32 *list_next; /* List reference - list of PDB's */ struct _PDB32 *list_next; /* List reference - list of PDB's */
struct _PDB32 *list_prev; /* List reference - list of PDB's */ struct _PDB32 *list_prev; /* List reference - list of PDB's */
} PDB32; } PDB32;

View File

@ -237,4 +237,15 @@
#define _vstprintf WINE_tchar_routine(vsprintf, vsprintf, vswprintf) #define _vstprintf WINE_tchar_routine(vsprintf, vsprintf, vswprintf)
#define _vtprintf WINE_tchar_routine(vprintf, vprintf, vwprintf) #define _vtprintf WINE_tchar_routine(vprintf, vprintf, vwprintf)
#define _T(x) __T(x)
#define _TEXT(x) __T(x)
#define __T(x) x
typedef CHAR _TCHAR32A;
typedef WCHAR _TCHAR32W;
DECL_WINELIB_TYPE_AW (_TCHAR)
typedef UCHAR _TUCHAR32A;
typedef WCHAR _TUCHAR32W;
DECL_WINELIB_TYPE_AW (_TUCHAR)
#endif /* __WINE_TCHAR_H */ #endif /* __WINE_TCHAR_H */

View File

@ -3172,6 +3172,11 @@ typedef struct {
#define DM_PROMPT 4 #define DM_PROMPT 4
#define DM_MODIFY 8 #define DM_MODIFY 8
#define DM_IN_BUFFER DM_MODIFY
#define DM_IN_PROMPT DM_PROMPT
#define DM_OUT_BUFFER DM_COPY
#define DM_OUT_DEFAULT DM_UPDATE
#define DM_ORIENTATION 0x00000001L #define DM_ORIENTATION 0x00000001L
#define DM_PAPERSIZE 0x00000002L #define DM_PAPERSIZE 0x00000002L
#define DM_PAPERLENGTH 0x00000004L #define DM_PAPERLENGTH 0x00000004L

View File

@ -429,6 +429,22 @@ typedef struct
#define MWT_LEFTMULTIPLY 2 #define MWT_LEFTMULTIPLY 2
#define MWT_RIGHTMULTIPLY 3 #define MWT_RIGHTMULTIPLY 3
/* Object Definitions for EnumObjects() */
#define OBJ_PEN 1
#define OBJ_BRUSH 2
#define OBJ_DC 3
#define OBJ_METADC 4
#define OBJ_PAL 5
#define OBJ_FONT 6
#define OBJ_BITMAP 7
#define OBJ_REGION 8
#define OBJ_METAFILE 9
#define OBJ_MEMDC 10
#define OBJ_EXTPEN 11
#define OBJ_ENHMETADC 12
#define OBJ_ENHMETAFILE 13
typedef struct typedef struct
{ {
FLOAT eM11; FLOAT eM11;
@ -1453,6 +1469,8 @@ typedef struct
#define SYSTEM_FIXED_FONT 16 #define SYSTEM_FIXED_FONT 16
#define DEFAULT_GUI_FONT 17 #define DEFAULT_GUI_FONT 17
#define STOCK_LAST 17
/* Metafile header structure */ /* Metafile header structure */
typedef struct typedef struct
{ {
@ -1470,7 +1488,7 @@ typedef struct
{ {
DWORD rdSize; DWORD rdSize;
WORD rdFunction; WORD rdFunction;
WORD rdParam[1]; WORD rdParm[1];
} METARECORD; } METARECORD;
typedef METARECORD *PMETARECORD; typedef METARECORD *PMETARECORD;
typedef METARECORD *LPMETARECORD; typedef METARECORD *LPMETARECORD;
@ -1951,24 +1969,26 @@ DECL_WINELIB_TYPE(ABORTPROC)
#pragma pack(4) #pragma pack(4)
/* Declarations for functions that exist only in Win16 */
VOID WINAPI Death(HDC16);
VOID WINAPI Resurrection(HDC16,WORD,WORD,WORD,WORD,WORD,WORD);
/* Declarations for functions that exist only in Win32 */ /* Declarations for functions that exist only in Win32 */
BOOL32 WINAPI AngleArc32(HDC32, INT32, INT32, DWORD, FLOAT, FLOAT); BOOL32 WINAPI AngleArc(HDC32, INT32, INT32, DWORD, FLOAT, FLOAT);
#define AngleArc WINELIB_NAME(AngleArc) BOOL32 WINAPI ArcTo(HDC32, INT32, INT32, INT32, INT32, INT32, INT32, INT32, INT32);
BOOL32 WINAPI ArcTo32(HDC32, INT32, INT32, INT32, INT32, INT32, INT32, INT32, INT32); HENHMETAFILE32 WINAPI CloseEnhMetaFile(HDC32);
HENHMETAFILE32 WINAPI CloseEnhMetaFile32(HDC32);
#define CloseEnhMetaFile WINELIB_NAME(CloseEnhMetaFile)
HBRUSH32 WINAPI CreateDIBPatternBrushPt(const void*,UINT32); HBRUSH32 WINAPI CreateDIBPatternBrushPt(const void*,UINT32);
HDC32 WINAPI CreateEnhMetaFile32A(HDC32,LPCSTR,const RECT32*,LPCSTR); HDC32 WINAPI CreateEnhMetaFile32A(HDC32,LPCSTR,const RECT32*,LPCSTR);
HDC32 WINAPI CreateEnhMetaFile32W(HDC32,LPCWSTR,const RECT32*,LPCWSTR); HDC32 WINAPI CreateEnhMetaFile32W(HDC32,LPCWSTR,const RECT32*,LPCWSTR);
#define CreateEnhMetaFile WINELIB_NAME_AW(CreateEnhMetaFile) #define CreateEnhMetaFile WINELIB_NAME_AW(CreateEnhMetaFile)
INT32 WINAPI DrawEscape32(HDC32,INT32,INT32,LPCSTR); INT32 WINAPI DrawEscape(HDC32,INT32,INT32,LPCSTR);
INT16 WINAPI ExcludeVisRect(HDC16,INT16,INT16,INT16,INT16); INT16 WINAPI ExcludeVisRect(HDC16,INT16,INT16,INT16,INT16);
BOOL16 WINAPI FastWindowFrame(HDC16,const RECT16*,INT16,INT16,DWORD); BOOL16 WINAPI FastWindowFrame(HDC16,const RECT16*,INT16,INT16,DWORD);
UINT16 WINAPI GDIRealizePalette(HDC16); UINT16 WINAPI GDIRealizePalette(HDC16);
HPALETTE16 WINAPI GDISelectPalette(HDC16,HPALETTE16,WORD); HPALETTE16 WINAPI GDISelectPalette(HDC16,HPALETTE16,WORD);
BOOL32 WINAPI GdiComment32(HDC32,UINT32,const BYTE *); BOOL32 WINAPI GdiComment(HDC32,UINT32,const BYTE *);
#define GdiComment WINELIB_NAME(GdiComment)
DWORD WINAPI GetBitmapDimension(HBITMAP16); DWORD WINAPI GetBitmapDimension(HBITMAP16);
DWORD WINAPI GetBrushOrg(HDC16); DWORD WINAPI GetBrushOrg(HDC16);
BOOL32 WINAPI GetCharABCWidthsFloat32A(HDC32,UINT32,UINT32,LPABCFLOAT); BOOL32 WINAPI GetCharABCWidthsFloat32A(HDC32,UINT32,UINT32,LPABCFLOAT);
@ -1977,8 +1997,7 @@ BOOL32 WINAPI GetCharABCWidthsFloat32W(HDC32,UINT32,UINT32,LPABCFLOAT);
BOOL32 WINAPI GetCharWidthFloat32A(HDC32,UINT32,UINT32,PFLOAT); BOOL32 WINAPI GetCharWidthFloat32A(HDC32,UINT32,UINT32,PFLOAT);
BOOL32 WINAPI GetCharWidthFloat32W(HDC32,UINT32,UINT32,PFLOAT); BOOL32 WINAPI GetCharWidthFloat32W(HDC32,UINT32,UINT32,PFLOAT);
#define GetCharWidthFloat WINELIB_NAME_AW(GetCharWidthFloat) #define GetCharWidthFloat WINELIB_NAME_AW(GetCharWidthFloat)
BOOL32 WINAPI GetColorAdjustment32(HDC32, LPCOLORADJUSTMENT); BOOL32 WINAPI GetColorAdjustment(HDC32, LPCOLORADJUSTMENT);
#define GetColorAdjustment WINELIB_NAME(GetColorAdjustment)
HFONT16 WINAPI GetCurLogFont(HDC16); HFONT16 WINAPI GetCurLogFont(HDC16);
DWORD WINAPI GetCurrentPosition(HDC16); DWORD WINAPI GetCurrentPosition(HDC16);
DWORD WINAPI GetDCHook(HDC16,FARPROC16*); DWORD WINAPI GetDCHook(HDC16,FARPROC16*);
@ -2032,7 +2051,7 @@ HPALETTE32 WINAPI CreateHalftonePalette(HDC32);
BOOL32 WINAPI DeleteEnhMetaFile(HENHMETAFILE32); BOOL32 WINAPI DeleteEnhMetaFile(HENHMETAFILE32);
INT32 WINAPI ExtSelectClipRgn(HDC32,HRGN32,INT32); INT32 WINAPI ExtSelectClipRgn(HDC32,HRGN32,INT32);
HRGN32 WINAPI ExtCreateRegion(const XFORM*,DWORD,const RGNDATA*); HRGN32 WINAPI ExtCreateRegion(const XFORM*,DWORD,const RGNDATA*);
INT32 WINAPI ExtEscape32(HDC32,INT32,INT32,LPCSTR,INT32,LPSTR); INT32 WINAPI ExtEscape(HDC32,INT32,INT32,LPCSTR,INT32,LPSTR);
BOOL32 WINAPI FixBrushOrgEx(HDC32,INT32,INT32,LPPOINT32); BOOL32 WINAPI FixBrushOrgEx(HDC32,INT32,INT32,LPPOINT32);
HANDLE32 WINAPI GetCurrentObject(HDC32,UINT32); HANDLE32 WINAPI GetCurrentObject(HDC32,UINT32);
BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32); BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32);
@ -2055,7 +2074,7 @@ BOOL32 WINAPI GetWorldTransform(HDC32,LPXFORM);
BOOL32 WINAPI ModifyWorldTransform(HDC32,const XFORM *, DWORD); BOOL32 WINAPI ModifyWorldTransform(HDC32,const XFORM *, DWORD);
BOOL32 WINAPI PlayEnhMetaFile(HDC32,HENHMETAFILE32,const RECT32*); BOOL32 WINAPI PlayEnhMetaFile(HDC32,HENHMETAFILE32,const RECT32*);
BOOL32 WINAPI PlayEnhMetaFileRecord(HDC32,LPHANDLETABLE32,const ENHMETARECORD*,UINT32); BOOL32 WINAPI PlayEnhMetaFileRecord(HDC32,LPHANDLETABLE32,const ENHMETARECORD*,UINT32);
BOOL32 WINAPI PolyPolyline32(HDC32,const POINT32*,const DWORD*,DWORD); BOOL32 WINAPI PolyPolyline(HDC32,const POINT32*,const DWORD*,DWORD);
BOOL32 WINAPI SetBrushOrgEx(HDC32,INT32,INT32,LPPOINT32); BOOL32 WINAPI SetBrushOrgEx(HDC32,INT32,INT32,LPPOINT32);
HENHMETAFILE32 WINAPI SetEnhMetaFileBits(UINT32,const BYTE *); HENHMETAFILE32 WINAPI SetEnhMetaFileBits(UINT32,const BYTE *);
INT32 WINAPI SetGraphicsMode(HDC32,INT32); INT32 WINAPI SetGraphicsMode(HDC32,INT32);
@ -2580,7 +2599,7 @@ HPALETTE16 WINAPI SelectPalette16(HDC16,HPALETTE16,BOOL16);
HPALETTE32 WINAPI SelectPalette32(HDC32,HPALETTE32,BOOL32); HPALETTE32 WINAPI SelectPalette32(HDC32,HPALETTE32,BOOL32);
#define SelectPalette WINELIB_NAME(SelectPalette) #define SelectPalette WINELIB_NAME(SelectPalette)
INT16 WINAPI SetAbortProc16(HDC16,SEGPTR); INT16 WINAPI SetAbortProc16(HDC16,SEGPTR);
INT32 WINAPI SetAbortProc32(HDC32,FARPROC32); INT32 WINAPI SetAbortProc32(HDC32,ABORTPROC32);
#define SetAbortProc WINELIB_NAME(SetAbortProc) #define SetAbortProc WINELIB_NAME(SetAbortProc)
INT16 WINAPI SetArcDirection16(HDC16,INT16); INT16 WINAPI SetArcDirection16(HDC16,INT16);
INT32 WINAPI SetArcDirection32(HDC32,INT32); INT32 WINAPI SetArcDirection32(HDC32,INT32);

View File

@ -413,6 +413,9 @@ DECL_WINELIB_TYPE(HWND)
#define max(a,b) MAX(a,b) #define max(a,b) MAX(a,b)
#define min(a,b) MIN(a,b) #define min(a,b) MIN(a,b)
#define _MAX_PATH 260
#define _MAX_FNAME 255
/* Winelib run-time flag */ /* Winelib run-time flag */
#ifdef __WINE__ #ifdef __WINE__

View File

@ -228,6 +228,7 @@ DECL_WINELIB_TYPE(DRAWSTATEPROC)
#define SBS_SIZEBOXTOPLEFTALIGN 0x0002L #define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L #define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
#define SBS_SIZEBOX 0x0008L #define SBS_SIZEBOX 0x0008L
#define SBS_SIZEGRIP 0x0010L
/* EnableScrollBar() flags */ /* EnableScrollBar() flags */
#define ESB_ENABLE_BOTH 0x0000 #define ESB_ENABLE_BOTH 0x0000
@ -923,6 +924,8 @@ INT32 WINAPI DlgDirList32W(HWND32,LPWSTR,INT32,INT32,UINT32);
INT32 WINAPI DlgDirListComboBox32A(HWND32,LPSTR,INT32,INT32,UINT32); INT32 WINAPI DlgDirListComboBox32A(HWND32,LPSTR,INT32,INT32,UINT32);
INT32 WINAPI DlgDirListComboBox32W(HWND32,LPWSTR,INT32,INT32,UINT32); INT32 WINAPI DlgDirListComboBox32W(HWND32,LPWSTR,INT32,INT32,UINT32);
#define DlgDirListComboBox WINELIB_NAME_AW(DlgDirListComboBox) #define DlgDirListComboBox WINELIB_NAME_AW(DlgDirListComboBox)
BOOL32 WINAPI DlgDirSelectComboBoxEx32A(HWND32,LPSTR,INT32,INT32);
BOOL32 WINAPI DlgDirSelectComboBoxEx32W(HWND32,LPWSTR,INT32,INT32);
#define DlgDirSelectComboBoxEx WINELIB_NAME_AW(DlgDirSelectComboBoxEx) #define DlgDirSelectComboBoxEx WINELIB_NAME_AW(DlgDirSelectComboBoxEx)
BOOL32 WINAPI DlgDirSelectEx32A(HWND32,LPSTR,INT32,INT32); BOOL32 WINAPI DlgDirSelectEx32A(HWND32,LPSTR,INT32,INT32);
BOOL32 WINAPI DlgDirSelectEx32W(HWND32,LPWSTR,INT32,INT32); BOOL32 WINAPI DlgDirSelectEx32W(HWND32,LPWSTR,INT32,INT32);

View File

@ -228,7 +228,7 @@ static int MZ_LoadImage( HFILE16 hFile, LPCSTR name, LPCSTR cmdline,
#endif #endif
old_com=1; /* assume .COM file */ old_com=1; /* assume .COM file */
image_start=0; image_start=0;
image_size=GetFileSize(HFILE16_TO_HFILE32(hFile),NULL); image_size=GetFileSize(FILE_GetHandle32(hFile),NULL);
min_size=0x10000; max_size=0x100000; min_size=0x10000; max_size=0x100000;
mz_header.e_crlc=0; mz_header.e_crlc=0;
mz_header.e_ss=0; mz_header.e_sp=0xFFFE; mz_header.e_ss=0; mz_header.e_sp=0xFFFE;
@ -432,7 +432,7 @@ HINSTANCE16 MZ_CreateProcess( LPCSTR name, LPCSTR cmdline, LPCSTR env, BOOL32 in
if ((!env)&&pdb) env = pdb->env_db->environ; if ((!env)&&pdb) env = pdb->env_db->environ;
if (alloc) { if (alloc) {
if ((hModule = MODULE_CreateDummyModule(&ofs)) < 32) if ((hModule = MODULE_CreateDummyModule(&ofs, NULL)) < 32)
return hModule; return hModule;
lpDosTask->hModule = hModule; lpDosTask->hModule = hModule;

View File

@ -291,7 +291,7 @@ HINSTANCE32 MAIN_WinelibInit( int *argc, char *argv[] )
PROCESS_Current()->exe_modref = wm; PROCESS_Current()->exe_modref = wm;
strcpy( ofs.szPathName, wm->modname ); strcpy( ofs.szPathName, wm->modname );
if ((hModule = MODULE_CreateDummyModule( &ofs )) < 32) return 0; if ((hModule = MODULE_CreateDummyModule( &ofs, NULL )) < 32) return 0;
pModule = (NE_MODULE *)GlobalLock16( hModule ); pModule = (NE_MODULE *)GlobalLock16( hModule );
pModule->flags = NE_FFLAGS_WIN32; pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = wm->module; pModule->module32 = wm->module;

View File

@ -177,7 +177,7 @@ void MODULE_InitializeDLLs( PDB32 *process, HMODULE32 root,
* *
* Create a dummy NE module for Win32 or Winelib. * Create a dummy NE module for Win32 or Winelib.
*/ */
HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs ) HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName )
{ {
HMODULE32 hModule; HMODULE32 hModule;
NE_MODULE *pModule; NE_MODULE *pModule;
@ -240,9 +240,14 @@ HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
/* Module name */ /* Module name */
pStr = (char *)pSegment; pStr = (char *)pSegment;
pModule->name_table = (int)pStr - (int)pModule; pModule->name_table = (int)pStr - (int)pModule;
if ( modName )
basename = modName;
else
{
basename = strrchr(ofs->szPathName,'\\'); basename = strrchr(ofs->szPathName,'\\');
if (!basename) basename = ofs->szPathName; if (!basename) basename = ofs->szPathName;
else basename++; else basename++;
}
len = strlen(basename); len = strlen(basename);
if ((s = strchr(basename,'.'))) len = s - basename; if ((s = strchr(basename,'.'))) len = s - basename;
if (len > 8) len = 8; if (len > 8) len = 8;

View File

@ -93,6 +93,8 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
DWORD oldstack; DWORD oldstack;
WORD old_hSeg, new_hSeg; WORD old_hSeg, new_hSeg;
THDB *thdb = THREAD_Current(); THDB *thdb = THREAD_Current();
HFILE32 hFile32;
HFILE16 hFile16;
selfloadheader = (SELFLOADHEADER *) selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(SEL(pSegTable->hSeg),0); PTR_SEG_OFF_TO_LIN(SEL(pSegTable->hSeg),0);
@ -111,12 +113,14 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
stack16Top->cs = 0; stack16Top->cs = 0;
TRACE(dll,"CallLoadAppSegProc(hmodule=0x%04x,hf=0x%04x,segnum=%d\n", TRACE(dll,"CallLoadAppSegProc(hmodule=0x%04x,hf=0x%04x,segnum=%d\n",
pModule->self,hf,segnum ); pModule->self,hf,segnum );
DuplicateHandle( GetCurrentProcess(), hf, GetCurrentProcess(), &hFile32,
0, FALSE, DUPLICATE_SAME_ACCESS );
hFile16 = FILE_AllocDosHandle( hFile32 );
new_hSeg = Callbacks->CallLoadAppSegProc(selfloadheader->LoadAppSeg, new_hSeg = Callbacks->CallLoadAppSegProc(selfloadheader->LoadAppSeg,
pModule->self, pModule->self, hFile16,
HFILE32_TO_HFILE16(hf),
segnum ); segnum );
TRACE(dll,"Ret CallLoadAppSegProc: hSeg = 0x%04x\n",new_hSeg); TRACE(dll,"Ret CallLoadAppSegProc: hSeg = 0x%04x\n",new_hSeg);
_lclose32( hf ); _lclose16( hFile16 );
if (SEL(new_hSeg) != SEL(old_hSeg)) { if (SEL(new_hSeg) != SEL(old_hSeg)) {
/* Self loaders like creating their own selectors; /* Self loaders like creating their own selectors;
* they love asking for trouble to Wine developers * they love asking for trouble to Wine developers
@ -390,6 +394,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
if (pModule->flags & NE_FFLAGS_SELFLOAD) if (pModule->flags & NE_FFLAGS_SELFLOAD)
{ {
HFILE32 hf; HFILE32 hf;
HFILE16 hFile16;
/* Handle self loading modules */ /* Handle self loading modules */
SELFLOADHEADER *selfloadheader; SELFLOADHEADER *selfloadheader;
STACK16FRAME *stack16Top; STACK16FRAME *stack16Top;
@ -422,13 +427,14 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
stack16Top->ip = 0; stack16Top->ip = 0;
stack16Top->cs = 0; stack16Top->cs = 0;
hf = NE_OpenFile( pModule ); DuplicateHandle( GetCurrentProcess(), NE_OpenFile(pModule),
TRACE(dll,"CallBootAppProc(hModule=0x%04x,hf=0x%04x)\n",pModule->self, GetCurrentProcess(), &hf, 0, FALSE, DUPLICATE_SAME_ACCESS );
HFILE32_TO_HFILE16(hf)); hFile16 = FILE_AllocDosHandle( hf );
Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self, TRACE(dll,"CallBootAppProc(hModule=0x%04x,hf=0x%04x)\n",
HFILE32_TO_HFILE16(hf)); pModule->self,hFile16);
Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self,hFile16);
TRACE(dll,"Return from CallBootAppProc\n"); TRACE(dll,"Return from CallBootAppProc\n");
_lclose32(hf); _lclose16(hf);
/* some BootApp procs overwrite the segment handle of dgroup */ /* some BootApp procs overwrite the segment handle of dgroup */
pSegTable[pModule->dgroup - 1].hSeg = saved_hSeg; pSegTable[pModule->dgroup - 1].hSeg = saved_hSeg;
thdb->cur_stack = oldstack; thdb->cur_stack = oldstack;

View File

@ -456,7 +456,7 @@ static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r )
* BUT we have to map the whole image anyway, for Win32 programs sometimes * BUT we have to map the whole image anyway, for Win32 programs sometimes
* want to access them. (HMODULE32 point to the start of it) * want to access them. (HMODULE32 point to the start of it)
*/ */
static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs ) static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs, LPCSTR *modName )
{ {
HMODULE32 hModule; HMODULE32 hModule;
HFILE32 hFile; HFILE32 hFile;
@ -464,6 +464,7 @@ static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs )
IMAGE_NT_HEADERS *nt; IMAGE_NT_HEADERS *nt;
IMAGE_SECTION_HEADER *pe_sec; IMAGE_SECTION_HEADER *pe_sec;
IMAGE_DATA_DIRECTORY *dir;
BY_HANDLE_FILE_INFORMATION bhfi; BY_HANDLE_FILE_INFORMATION bhfi;
int i, rawsize, lowest_va, lowest_fa, vma_size, file_size = 0; int i, rawsize, lowest_va, lowest_fa, vma_size, file_size = 0;
DWORD load_addr, aoep, reloc = 0; DWORD load_addr, aoep, reloc = 0;
@ -574,7 +575,6 @@ static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs )
if (load_addr == 0) if (load_addr == 0)
{ {
/* We need to perform base relocations */ /* We need to perform base relocations */
IMAGE_DATA_DIRECTORY *dir;
dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BASERELOC; dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BASERELOC;
if (dir->Size) if (dir->Size)
reloc = dir->VirtualAddress; reloc = dir->VirtualAddress;
@ -635,6 +635,11 @@ static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs )
if ( reloc ) if ( reloc )
do_relocations( load_addr, (IMAGE_BASE_RELOCATION *)RVA(reloc) ); do_relocations( load_addr, (IMAGE_BASE_RELOCATION *)RVA(reloc) );
/* Get module name */
dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_EXPORT;
if (dir->Size)
*modName = (LPCSTR)RVA(((PIMAGE_EXPORT_DIRECTORY)RVA(dir->VirtualAddress))->Name);
/* We don't need the orignal mapping any more */ /* We don't need the orignal mapping any more */
UnmapViewOfFile( (LPVOID)hModule ); UnmapViewOfFile( (LPVOID)hModule );
return (HMODULE32)load_addr; return (HMODULE32)load_addr;
@ -799,6 +804,7 @@ static WINE_MODREF *PE_CreateModule( PDB32 *process, HMODULE32 hModule,
HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process, HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
HFILE32 hFile, DWORD flags) HFILE32 hFile, DWORD flags)
{ {
LPCSTR modName = NULL;
OFSTRUCT ofs; OFSTRUCT ofs;
HMODULE32 hModule32; HMODULE32 hModule32;
HMODULE16 hModule16; HMODULE16 hModule16;
@ -814,7 +820,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
if ((hModule32 = BUILTIN32_LoadImage( name, &ofs, FALSE ))) if ((hModule32 = BUILTIN32_LoadImage( name, &ofs, FALSE )))
builtin = TRUE; builtin = TRUE;
/* try to load the specified dll/exe */ /* try to load the specified dll/exe */
else if ((hModule32 = PE_LoadImage( name, &ofs )) >= 32) else if ((hModule32 = PE_LoadImage( name, &ofs, &modName )) >= 32)
builtin = FALSE; builtin = FALSE;
/* Now try the built-in even if disabled */ /* Now try the built-in even if disabled */
else if ((hModule32 = BUILTIN32_LoadImage( name, &ofs, TRUE ))) else if ((hModule32 = BUILTIN32_LoadImage( name, &ofs, TRUE )))
@ -826,7 +832,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
return 0; return 0;
/* Create 16-bit dummy module */ /* Create 16-bit dummy module */
if ((hModule16 = MODULE_CreateDummyModule( &ofs )) < 32) return hModule16; if ((hModule16 = MODULE_CreateDummyModule( &ofs, modName )) < 32) return hModule16;
pModule = (NE_MODULE *)GlobalLock16( hModule16 ); pModule = (NE_MODULE *)GlobalLock16( hModule16 );
pModule->flags = NE_FFLAGS_LIBMODULE | NE_FFLAGS_SINGLEDATA | pModule->flags = NE_FFLAGS_LIBMODULE | NE_FFLAGS_SINGLEDATA |
NE_FFLAGS_WIN32 | (builtin? NE_FFLAGS_BUILTIN : 0); NE_FFLAGS_WIN32 | (builtin? NE_FFLAGS_BUILTIN : 0);
@ -855,6 +861,7 @@ HINSTANCE16 PE_CreateProcess( LPCSTR name, LPCSTR cmd_line,
LPCSTR env, BOOL32 inherit, LPSTARTUPINFO32A startup, LPCSTR env, BOOL32 inherit, LPSTARTUPINFO32A startup,
LPPROCESS_INFORMATION info ) LPPROCESS_INFORMATION info )
{ {
LPCSTR modName = NULL;
HMODULE16 hModule16; HMODULE16 hModule16;
HMODULE32 hModule32; HMODULE32 hModule32;
HINSTANCE16 hInstance; HINSTANCE16 hInstance;
@ -865,13 +872,13 @@ HINSTANCE16 PE_CreateProcess( LPCSTR name, LPCSTR cmd_line,
WINE_MODREF *wm; WINE_MODREF *wm;
/* Load file */ /* Load file */
if ((hModule32 = PE_LoadImage( name, &ofs )) < 32) if ((hModule32 = PE_LoadImage( name, &ofs, &modName )) < 32)
return hModule32; return hModule32;
if (PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL) if (PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL)
return 20; /* FIXME: not the right error code */ return 20; /* FIXME: not the right error code */
/* Create 16-bit dummy module */ /* Create 16-bit dummy module */
if ((hModule16 = MODULE_CreateDummyModule( &ofs )) < 32) return hModule16; if ((hModule16 = MODULE_CreateDummyModule( &ofs, modName )) < 32) return hModule16;
pModule = (NE_MODULE *)GlobalLock16( hModule16 ); pModule = (NE_MODULE *)GlobalLock16( hModule16 );
pModule->flags = NE_FFLAGS_WIN32; pModule->flags = NE_FFLAGS_WIN32;
pModule->module32 = hModule32; pModule->module32 = hModule32;
@ -969,7 +976,6 @@ void PE_InitTls(THDB *thdb)
delta = wm->module - peh->OptionalHeader.ImageBase; delta = wm->module - peh->OptionalHeader.ImageBase;
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress) if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress)
continue; continue;
FIXME(win32,"%s has TLS directory.\n",wm->longname);
pdir = (LPVOID)(wm->module + peh->OptionalHeader. pdir = (LPVOID)(wm->module + peh->OptionalHeader.
DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress); DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress);

View File

@ -331,7 +331,7 @@ INT16 WINAPI AccessResource16( HINSTANCE16 hModule, HRSRC16 hRsrc )
{ {
HANDLE32 hRsrc32 = MapHRsrc16To32( pModule, hRsrc ); HANDLE32 hRsrc32 = MapHRsrc16To32( pModule, hRsrc );
HFILE32 hFile32 = AccessResource32( pModule->module32, hRsrc32 ); HFILE32 hFile32 = AccessResource32( pModule->module32, hRsrc32 );
return HFILE32_TO_HFILE16( hFile32 ); return FILE_AllocDosHandle( hFile32 );
} }
return NE_AccessResource( pModule, hRsrc ); return NE_AccessResource( pModule, hRsrc );

View File

@ -30,8 +30,7 @@ struct lzfileheader {
}; };
static BYTE LZMagic[8]={'S','Z','D','D',0x88,0xf0,0x27,0x33}; static BYTE LZMagic[8]={'S','Z','D','D',0x88,0xf0,0x27,0x33};
static struct lzstate { struct lzstate {
HFILE32 lzfd; /* the handle used by the program */
HFILE32 realfd; /* the real filedescriptor */ HFILE32 realfd; /* the real filedescriptor */
CHAR lastchar; /* the last char of the filename */ CHAR lastchar; /* the last char of the filename */
@ -51,8 +50,13 @@ static struct lzstate {
BYTE *get; /* GETLEN bytes */ BYTE *get; /* GETLEN bytes */
DWORD getcur; /* current read */ DWORD getcur; /* current read */
DWORD getlen; /* length last got */ DWORD getlen; /* length last got */
} *lzstates=NULL; };
static int nroflzstates=0;
#define MAX_LZSTATES 16
static struct lzstate *lzstates[MAX_LZSTATES];
#define IS_LZ_HANDLE(h) (((h) >= 0x400) && ((h) < 0x400+MAX_LZSTATES))
#define GET_LZ_STATE(h) (IS_LZ_HANDLE(h) ? lzstates[(h)] : NULL)
/* reads one compressed byte, including buffering */ /* reads one compressed byte, including buffering */
#define GET(lzs,b) _lzget(lzs,&b) #define GET(lzs,b) _lzget(lzs,&b)
@ -132,7 +136,7 @@ INT32 WINAPI LZStart32(void)
*/ */
HFILE16 WINAPI LZInit16( HFILE16 hfSrc ) HFILE16 WINAPI LZInit16( HFILE16 hfSrc )
{ {
return HFILE32_TO_HFILE16( LZInit32( HFILE16_TO_HFILE32(hfSrc) ) ); return LZInit32( FILE_GetHandle32(hfSrc) );
} }
@ -143,7 +147,6 @@ HFILE16 WINAPI LZInit16( HFILE16 hfSrc )
* (return value the same as hfSrc, if hfSrc is not compressed) * (return value the same as hfSrc, if hfSrc is not compressed)
* on failure, returns error code <0 * on failure, returns error code <0
* lzfiledescriptors range from 0x400 to 0x410 (only 16 open files per process) * lzfiledescriptors range from 0x400 to 0x410 (only 16 open files per process)
* we use as much as we need, we just OR 0x400 to the passed HFILE.
* *
* since _llseek uses the same types as libc.lseek, we just use the macros of * since _llseek uses the same types as libc.lseek, we just use the macros of
* libc * libc
@ -154,6 +157,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
struct lzfileheader head; struct lzfileheader head;
struct lzstate *lzs; struct lzstate *lzs;
DWORD ret; DWORD ret;
int i;
TRACE(file,"(%d)\n",hfSrc); TRACE(file,"(%d)\n",hfSrc);
ret=read_header(hfSrc,&head); ret=read_header(hfSrc,&head);
@ -161,13 +165,12 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
_llseek32(hfSrc,0,SEEK_SET); _llseek32(hfSrc,0,SEEK_SET);
return ret?ret:hfSrc; return ret?ret:hfSrc;
} }
lzstates = HeapReAlloc( SystemHeap, 0, lzstates, for (i = 0; i < MAX_LZSTATES; i++) if (!lzstates[i]) break;
(++nroflzstates)*sizeof(struct lzstate) ); if (i == MAX_LZSTATES) return LZERROR_GLOBALLOC;
lzs = lzstates+(nroflzstates-1); lzstates[i] = lzs = HeapAlloc( SystemHeap, 0, sizeof(struct lzstate) );
memset(lzs,'\0',sizeof(*lzs)); memset(lzs,'\0',sizeof(*lzs));
lzs->realfd = hfSrc; lzs->realfd = hfSrc;
lzs->lzfd = hfSrc | 0x400;
lzs->lastchar = head.lastchar; lzs->lastchar = head.lastchar;
lzs->reallength = head.reallength; lzs->reallength = head.reallength;
@ -179,7 +182,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
memset(lzs->table,' ',0x1000); memset(lzs->table,' ',0x1000);
/* Yes, start 16 byte from the END of the table */ /* Yes, start 16 byte from the END of the table */
lzs->curtabent = 0xff0; lzs->curtabent = 0xff0;
return lzs->lzfd; return 0x400 + i;
} }
@ -302,7 +305,8 @@ INT32 WINAPI GetExpandedName32W( LPCWSTR in, LPWSTR out )
*/ */
INT16 WINAPI LZRead16( HFILE16 fd, LPVOID buf, UINT16 toread ) INT16 WINAPI LZRead16( HFILE16 fd, LPVOID buf, UINT16 toread )
{ {
return LZRead32(HFILE16_TO_HFILE32(fd),buf,toread); if (IS_LZ_HANDLE(fd)) return LZRead32( fd, buf, toread );
return _lread16( fd, buf, toread );
} }
@ -311,19 +315,14 @@ INT16 WINAPI LZRead16( HFILE16 fd, LPVOID buf, UINT16 toread )
*/ */
INT32 WINAPI LZRead32( HFILE32 fd, LPVOID vbuf, UINT32 toread ) INT32 WINAPI LZRead32( HFILE32 fd, LPVOID vbuf, UINT32 toread )
{ {
int i,howmuch; int howmuch;
BYTE b,*buf; BYTE b,*buf;
struct lzstate *lzs; struct lzstate *lzs;
buf=(LPBYTE)vbuf; buf=(LPBYTE)vbuf;
TRACE(file,"(%d,%p,%d)\n",fd,buf,toread); TRACE(file,"(%d,%p,%d)\n",fd,buf,toread);
howmuch=toread; howmuch=toread;
for (i=0;i<nroflzstates;i++) if (!(lzs = GET_LZ_STATE(fd))) return _lread32(fd,buf,toread);
if (lzstates[i].lzfd==fd)
break;
if (i==nroflzstates)
return _lread32(fd,buf,toread);
lzs=lzstates+i;
/* The decompressor itself is in a define, cause we need it twice /* The decompressor itself is in a define, cause we need it twice
* in this function. (the decompressed byte will be in b) * in this function. (the decompressed byte will be in b)
@ -407,7 +406,8 @@ INT32 WINAPI LZRead32( HFILE32 fd, LPVOID vbuf, UINT32 toread )
*/ */
LONG WINAPI LZSeek16( HFILE16 fd, LONG off, INT16 type ) LONG WINAPI LZSeek16( HFILE16 fd, LONG off, INT16 type )
{ {
return LZSeek32( HFILE16_TO_HFILE32(fd), off, type ); if (IS_LZ_HANDLE(fd)) return LZSeek32( fd, off, type );
return _llseek16( fd, off, type );
} }
@ -416,18 +416,12 @@ LONG WINAPI LZSeek16( HFILE16 fd, LONG off, INT16 type )
*/ */
LONG WINAPI LZSeek32( HFILE32 fd, LONG off, INT32 type ) LONG WINAPI LZSeek32( HFILE32 fd, LONG off, INT32 type )
{ {
int i;
struct lzstate *lzs; struct lzstate *lzs;
LONG newwanted; LONG newwanted;
TRACE(file,"(%d,%ld,%d)\n",fd,off,type); TRACE(file,"(%d,%ld,%d)\n",fd,off,type);
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
break;
/* not compressed? just use normal _llseek() */ /* not compressed? just use normal _llseek() */
if (i==nroflzstates) if (!(lzs = GET_LZ_STATE(fd))) return _llseek32(fd,off,type);
return _llseek32(fd,off,type);
lzs = lzstates+i;
newwanted = lzs->realwanted; newwanted = lzs->realwanted;
switch (type) { switch (type) {
case 1: /* SEEK_CUR */ case 1: /* SEEK_CUR */
@ -455,7 +449,19 @@ LONG WINAPI LZSeek32( HFILE32 fd, LONG off, INT32 type )
*/ */
LONG WINAPI LZCopy16( HFILE16 src, HFILE16 dest ) LONG WINAPI LZCopy16( HFILE16 src, HFILE16 dest )
{ {
return LZCopy32( HFILE16_TO_HFILE32(src), HFILE16_TO_HFILE32(dest) ); HFILE32 oldsrc = src;
int usedlzinit = 0;
LONG ret;
if (!IS_LZ_HANDLE(src))
{
src = LZInit16(src);
if (src!=oldsrc) usedlzinit=1;
if (src>0xfff0) return 0;
}
ret = LZCopy32( src, FILE_GetHandle32(dest) );
if (usedlzinit) LZClose32(src);
return ret;
} }
@ -468,7 +474,7 @@ LONG WINAPI LZCopy16( HFILE16 src, HFILE16 dest )
*/ */
LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest ) LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
{ {
int usedlzinit=0,i,ret,wret; int usedlzinit=0,ret,wret;
LONG len; LONG len;
HFILE32 oldsrc = src; HFILE32 oldsrc = src;
#define BUFLEN 1000 #define BUFLEN 1000
@ -476,7 +482,7 @@ LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
INT32 WINAPI (*xread)(HFILE32,LPVOID,UINT32); INT32 WINAPI (*xread)(HFILE32,LPVOID,UINT32);
TRACE(file,"(%d,%d)\n",src,dest); TRACE(file,"(%d,%d)\n",src,dest);
if (src<0x400) { if (!IS_LZ_HANDLE(src)) {
src = LZInit32(src); src = LZInit32(src);
if (src!=oldsrc) if (src!=oldsrc)
usedlzinit=1; usedlzinit=1;
@ -484,11 +490,8 @@ LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
return 0; return 0;
} }
for (i=0;i<nroflzstates;i++)
if (src==lzstates[i].lzfd)
break;
/* not compressed? just copy */ /* not compressed? just copy */
if (i==nroflzstates) if (!IS_LZ_HANDLE(src))
xread=(INT32(*)(HFILE32,LPVOID,UINT32))_lread32; xread=(INT32(*)(HFILE32,LPVOID,UINT32))_lread32;
else else
xread=LZRead32; xread=LZRead32;
@ -537,7 +540,7 @@ static LPSTR LZEXPAND_MangleName( LPCSTR fn )
*/ */
HFILE16 WINAPI LZOpenFile16( LPCSTR fn, LPOFSTRUCT ofs, UINT16 mode ) HFILE16 WINAPI LZOpenFile16( LPCSTR fn, LPOFSTRUCT ofs, UINT16 mode )
{ {
return HFILE32_TO_HFILE16 ( LZOpenFile32A( fn, ofs, mode ) ); return LZOpenFile32A( fn, ofs, mode );
} }
@ -597,7 +600,8 @@ HFILE32 WINAPI LZOpenFile32W( LPCWSTR fn, LPOFSTRUCT ofs, UINT32 mode )
*/ */
void WINAPI LZClose16( HFILE16 fd ) void WINAPI LZClose16( HFILE16 fd )
{ {
return LZClose32( HFILE16_TO_HFILE32 (fd) ); if (IS_LZ_HANDLE(fd)) LZClose32( fd );
else _lclose16( fd );
} }
@ -606,24 +610,17 @@ void WINAPI LZClose16( HFILE16 fd )
*/ */
void WINAPI LZClose32( HFILE32 fd ) void WINAPI LZClose32( HFILE32 fd )
{ {
int i; struct lzstate *lzs;
TRACE(file,"(%d)\n",fd); TRACE(file,"(%d)\n",fd);
for (i=0;i<nroflzstates;i++) if (!(lzs = GET_LZ_STATE(fd))) _lclose32(fd);
if (lzstates[i].lzfd==fd) else
break; {
if (i==nroflzstates) { if (lzs->get) HeapFree( GetProcessHeap(), 0, lzs->get );
_lclose32(fd); CloseHandle(lzs->realfd);
return; lzstates[fd - 0x400] = NULL;
HeapFree( SystemHeap, 0, lzs );
} }
if (lzstates[i].get)
HeapFree( GetProcessHeap(), 0, lzstates[i].get );
_lclose32(lzstates[i].realfd);
memmove(lzstates+i,lzstates+i+1,
sizeof(struct lzstate)*(nroflzstates-i-1));
nroflzstates--;
lzstates = HeapReAlloc( SystemHeap, 0, lzstates,
sizeof(struct lzstate)*nroflzstates );
} }
/*********************************************************************** /***********************************************************************
@ -632,7 +629,7 @@ void WINAPI LZClose32( HFILE32 fd )
LONG WINAPI CopyLZFile16( HFILE16 src, HFILE16 dest ) LONG WINAPI CopyLZFile16( HFILE16 src, HFILE16 dest )
{ {
TRACE(file,"(%d,%d)\n",src,dest); TRACE(file,"(%d,%d)\n",src,dest);
return LZCopy32(HFILE16_TO_HFILE32(src),HFILE16_TO_HFILE32(dest)); return LZCopy16(src,dest);
} }

View File

@ -7,6 +7,12 @@
#include "config.h" #include "config.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <libio.h>
#ifndef HAVE_USLEEP #ifndef HAVE_USLEEP
#ifdef __EMX__ #ifdef __EMX__
@ -90,3 +96,49 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg )
#endif /* __i386__ */ #endif /* __i386__ */
} }
#endif /* !HAVE_CLONE && __linux__ */ #endif /* !HAVE_CLONE && __linux__ */
/**
* It looks like the openpty that comes with glibc in RedHat 5.0
* is buggy (second call returns what looks like a dup of 0 and 1
* instead of a new pty), this is a generic replacement.
*/
/** We will have an autoconf check for this soon... */
int wine_openpty(int *master, int *slave, char *name,
struct termios *term, struct winsize *winsize)
{
char *ptr1, *ptr2;
char pts_name[512];
strcpy (pts_name, "/dev/ptyXY");
for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1 != 0; ptr1++) {
pts_name[8] = *ptr1;
for (ptr2 = "0123456789abcdef"; *ptr2 != 0; ptr2++) {
pts_name[9] = *ptr2;
if ((*master = open(pts_name, O_RDWR)) < 0) {
if (errno == ENOENT)
return -1;
else
continue;
}
pts_name[5] = 't';
if ((*slave = open(pts_name, O_RDWR)) < 0) {
pts_name[5] = 'p';
continue;
}
if (term != NULL)
tcsetattr(*slave, TCSANOW, term);
if (winsize != NULL)
ioctl(*slave, TIOCSWINSZ, winsize);
if (name != NULL)
strcpy(name, pts_name);
return *slave;
}
}
return -1;
}

View File

@ -52,7 +52,7 @@ INT16 WINAPI SetAbortProc16(HDC16 hdc, SEGPTR abrtprc)
* SetAbortProc32 (GDI32.301) * SetAbortProc32 (GDI32.301)
* *
*/ */
INT32 WINAPI SetAbortProc32(HDC32 hdc, FARPROC32 abrtprc) INT32 WINAPI SetAbortProc32(HDC32 hdc, ABORTPROC32 abrtprc)
{ {
FIXME(print, "stub\n"); FIXME(print, "stub\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);

View File

@ -14,10 +14,10 @@
#include "winerror.h" #include "winerror.h"
#include "tlhelp32.h" #include "tlhelp32.h"
#include "toolhelp.h" #include "toolhelp.h"
#include "debug.h"
#include "heap.h" #include "heap.h"
#include "process.h" #include "process.h"
#include "k32obj.h" #include "k32obj.h"
#include "debug.h"
/* /*
* Support for toolhelp's snapshots. They * Support for toolhelp's snapshots. They

View File

@ -291,8 +291,8 @@ callrmproc_again:
CurrRMCB = CurrRMCB->next; CurrRMCB = CurrRMCB->next;
#ifdef MZ_SUPPORTED #ifdef MZ_SUPPORTED
FIXME(int31,"DPMI real-mode call using DOS VM task system, not fully tested!\n");
if (!(CurrRMCB || pModule->lpDosTask)) { if (!(CurrRMCB || pModule->lpDosTask)) {
FIXME(int31,"DPMI real-mode call using DOS VM task system, not fully tested!\n");
TRACE(int31,"creating VM86 task\n"); TRACE(int31,"creating VM86 task\n");
if (MZ_InitTask( MZ_AllocDPMITask( pModule->self ) ) < 32) { if (MZ_InitTask( MZ_AllocDPMITask( pModule->self ) ) < 32) {
ERR(int31,"could not setup VM86 task\n"); ERR(int31,"could not setup VM86 task\n");

View File

@ -225,7 +225,7 @@ static void ioctlGetDeviceInfo( CONTEXT *context )
RESET_CFLAG(context); RESET_CFLAG(context);
/* DOS device ? */ /* DOS device ? */
if ((file = FILE_GetFile( HFILE16_TO_HFILE32(BX_reg(context)), 0, NULL ))) if ((file = FILE_GetFile( FILE_GetHandle32(BX_reg(context)), 0, NULL )))
{ {
const DOS_DEVICE *dev = DOSFS_GetDevice( file->unix_name ); const DOS_DEVICE *dev = DOSFS_GetDevice( file->unix_name );
FILE_ReleaseFile( file ); FILE_ReleaseFile( file );
@ -725,7 +725,7 @@ static BOOL32 INT21_CreateTempFile( CONTEXT *context )
sprintf( p, "wine%04x.%03d", (int)getpid(), counter ); sprintf( p, "wine%04x.%03d", (int)getpid(), counter );
counter = (counter + 1) % 1000; counter = (counter + 1) % 1000;
if ((AX_reg(context) = HFILE32_TO_HFILE16(_lcreat_uniq( name, 0 ))) != (WORD)HFILE_ERROR16) if ((AX_reg(context) = _lcreat16_uniq( name, 0 )) != (WORD)HFILE_ERROR16)
{ {
TRACE(int21, "created %s\n", name ); TRACE(int21, "created %s\n", name );
return TRUE; return TRUE;
@ -919,7 +919,7 @@ static void fLock( CONTEXT * context )
BX_reg(context), BX_reg(context),
MAKELONG(DX_reg(context),CX_reg(context)), MAKELONG(DX_reg(context),CX_reg(context)),
MAKELONG(DI_reg(context),SI_reg(context))) ; MAKELONG(DI_reg(context),SI_reg(context))) ;
if (!LockFile(HFILE16_TO_HFILE32(BX_reg(context)), if (!LockFile(FILE_GetHandle32(BX_reg(context)),
MAKELONG(DX_reg(context),CX_reg(context)), 0, MAKELONG(DX_reg(context),CX_reg(context)), 0,
MAKELONG(DI_reg(context),SI_reg(context)), 0)) { MAKELONG(DI_reg(context),SI_reg(context)), 0)) {
AX_reg(context) = DOS_ExtendedError; AX_reg(context) = DOS_ExtendedError;
@ -932,7 +932,7 @@ static void fLock( CONTEXT * context )
BX_reg(context), BX_reg(context),
MAKELONG(DX_reg(context),CX_reg(context)), MAKELONG(DX_reg(context),CX_reg(context)),
MAKELONG(DI_reg(context),SI_reg(context))) ; MAKELONG(DI_reg(context),SI_reg(context))) ;
if (!UnlockFile(HFILE16_TO_HFILE32(BX_reg(context)), if (!UnlockFile(FILE_GetHandle32(BX_reg(context)),
MAKELONG(DX_reg(context),CX_reg(context)), 0, MAKELONG(DX_reg(context),CX_reg(context)), 0,
MAKELONG(DI_reg(context),SI_reg(context)), 0)) { MAKELONG(DI_reg(context),SI_reg(context)), 0)) {
AX_reg(context) = DOS_ExtendedError; AX_reg(context) = DOS_ExtendedError;
@ -1127,7 +1127,9 @@ void WINAPI DOS3Call( CONTEXT *context )
break; break;
case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */ case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */
_lread16(1, (BYTE *)&context->Eax, 1); TRACE(int21,"DIRECT CHARACTER INPUT WITH ECHO\n");
AL_reg(context) = CONSOLE_GetCharacter();
/* FIXME: no echo */
break; break;
case 0x02: /* WRITE CHARACTER TO STANDARD OUTPUT */ case 0x02: /* WRITE CHARACTER TO STANDARD OUTPUT */
@ -1177,13 +1179,15 @@ void WINAPI DOS3Call( CONTEXT *context )
break; break;
} }
case 0x0b: /* GET STDIN STATUS */ case 0x0b: {/* GET STDIN STATUS */
{ char x1,x2;
CHAR dummy;
AL_reg(context) = CONSOLE_CheckForKeystroke(&dummy, &dummy); if (CONSOLE_CheckForKeystroke(&x1,&x2))
} AL_reg(context) = 0xff;
else
AL_reg(context) = 0;
break; break;
}
case 0x2e: /* SET VERIFY FLAG */ case 0x2e: /* SET VERIFY FLAG */
TRACE(int21,"SET VERIFY FLAG ignored\n"); TRACE(int21,"SET VERIFY FLAG ignored\n");
/* we cannot change the behaviour anyway, so just ignore it */ /* we cannot change the behaviour anyway, so just ignore it */
@ -1457,16 +1461,6 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x3e: /* "CLOSE" - CLOSE FILE */ case 0x3e: /* "CLOSE" - CLOSE FILE */
TRACE(int21,"CLOSE handle %d\n",BX_reg(context)); TRACE(int21,"CLOSE handle %d\n",BX_reg(context));
if ((BX_reg(context)<5)||
/* FIXME: need to improve on those handle conversion macros */
(BX_reg(context)==HFILE32_TO_HFILE16(GetStdHandle(STD_INPUT_HANDLE)))||
(BX_reg(context)==HFILE32_TO_HFILE16(GetStdHandle(STD_OUTPUT_HANDLE)))||
(BX_reg(context)==HFILE32_TO_HFILE16(GetStdHandle(STD_ERROR_HANDLE)))) {
/* hack to make sure stdio isn't closed */
FIXME(int21, "stdio handle closed, need proper conversion\n");
DOS_ExtendedError = 0x06;
bSetDOSExtendedError = TRUE;
} else
bSetDOSExtendedError = ((AX_reg(context) = _lclose16( BX_reg(context) )) != 0); bSetDOSExtendedError = ((AX_reg(context) = _lclose16( BX_reg(context) )) != 0);
break; break;
@ -1566,7 +1560,7 @@ void WINAPI DOS3Call( CONTEXT *context )
break; break;
case 0x02:{ case 0x02:{
FILE_OBJECT *file; FILE_OBJECT *file;
file = FILE_GetFile(HFILE16_TO_HFILE32(BX_reg(context)),0,NULL); file = FILE_GetFile(FILE_GetHandle32(BX_reg(context)),0,NULL);
if (!strcasecmp(file->unix_name, "SCSIMGR$")) if (!strcasecmp(file->unix_name, "SCSIMGR$"))
ASPI_DOS_HandleInt(context); ASPI_DOS_HandleInt(context);
FILE_ReleaseFile( file ); FILE_ReleaseFile( file );
@ -1685,19 +1679,19 @@ void WINAPI DOS3Call( CONTEXT *context )
HANDLE32 handle; HANDLE32 handle;
TRACE(int21,"DUP - DUPLICATE FILE HANDLE %d\n",BX_reg(context)); TRACE(int21,"DUP - DUPLICATE FILE HANDLE %d\n",BX_reg(context));
if ((bSetDOSExtendedError = !DuplicateHandle( GetCurrentProcess(), if ((bSetDOSExtendedError = !DuplicateHandle( GetCurrentProcess(),
HFILE16_TO_HFILE32(BX_reg(context)), FILE_GetHandle32(BX_reg(context)),
GetCurrentProcess(), &handle, GetCurrentProcess(), &handle,
0, TRUE, DUPLICATE_SAME_ACCESS ))) 0, TRUE, DUPLICATE_SAME_ACCESS )))
AX_reg(context) = HFILE_ERROR16; AX_reg(context) = HFILE_ERROR16;
else else
AX_reg(context) = HFILE32_TO_HFILE16(handle); AX_reg(context) = FILE_AllocDosHandle(handle);
break; break;
} }
case 0x46: /* "DUP2", "FORCEDUP" - FORCE DUPLICATE FILE HANDLE */ case 0x46: /* "DUP2", "FORCEDUP" - FORCE DUPLICATE FILE HANDLE */
TRACE(int21,"FORCEDUP - FORCE DUPLICATE FILE HANDLE %d to %d\n", TRACE(int21,"FORCEDUP - FORCE DUPLICATE FILE HANDLE %d to %d\n",
BX_reg(context),CX_reg(context)); BX_reg(context),CX_reg(context));
bSetDOSExtendedError = (FILE_Dup2( HFILE16_TO_HFILE32(BX_reg(context)), HFILE16_TO_HFILE32(CX_reg(context)) ) == HFILE_ERROR32); bSetDOSExtendedError = (FILE_Dup2( BX_reg(context), CX_reg(context) ) == HFILE_ERROR16);
break; break;
case 0x47: /* "CWD" - GET CURRENT DIRECTORY */ case 0x47: /* "CWD" - GET CURRENT DIRECTORY */
@ -1848,7 +1842,7 @@ void WINAPI DOS3Call( CONTEXT *context )
FILETIME filetime; FILETIME filetime;
TRACE(int21,"GET FILE DATE AND TIME for handle %d\n", TRACE(int21,"GET FILE DATE AND TIME for handle %d\n",
BX_reg(context)); BX_reg(context));
if (!GetFileTime( HFILE16_TO_HFILE32(BX_reg(context)), NULL, NULL, &filetime )) if (!GetFileTime( FILE_GetHandle32(BX_reg(context)), NULL, NULL, &filetime ))
bSetDOSExtendedError = TRUE; bSetDOSExtendedError = TRUE;
else FileTimeToDosDateTime( &filetime, &DX_reg(context), else FileTimeToDosDateTime( &filetime, &DX_reg(context),
&CX_reg(context) ); &CX_reg(context) );
@ -1863,7 +1857,7 @@ void WINAPI DOS3Call( CONTEXT *context )
DosDateTimeToFileTime( DX_reg(context), CX_reg(context), DosDateTimeToFileTime( DX_reg(context), CX_reg(context),
&filetime ); &filetime );
bSetDOSExtendedError = bSetDOSExtendedError =
(!SetFileTime( HFILE16_TO_HFILE32(BX_reg(context)), (!SetFileTime( FILE_GetHandle32(BX_reg(context)),
NULL, NULL, &filetime )); NULL, NULL, &filetime ));
} }
break; break;
@ -1897,7 +1891,7 @@ void WINAPI DOS3Call( CONTEXT *context )
TRACE(int21,"CREATE NEW FILE 0x%02x for %s\n", CX_reg(context), TRACE(int21,"CREATE NEW FILE 0x%02x for %s\n", CX_reg(context),
(LPCSTR)CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context))); (LPCSTR)CTX_SEG_OFF_TO_LIN(context, DS_reg(context), EDX_reg(context)));
bSetDOSExtendedError = ((AX_reg(context) = bSetDOSExtendedError = ((AX_reg(context) =
HFILE32_TO_HFILE16(_lcreat_uniq( CTX_SEG_OFF_TO_LIN(context, DS_reg(context),EDX_reg(context)), 0 ))) _lcreat16_uniq( CTX_SEG_OFF_TO_LIN(context, DS_reg(context),EDX_reg(context)), 0 ))
== (WORD)HFILE_ERROR16); == (WORD)HFILE_ERROR16);
break; break;
@ -2022,7 +2016,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x68: /* "FFLUSH" - COMMIT FILE */ case 0x68: /* "FFLUSH" - COMMIT FILE */
case 0x6a: /* COMMIT FILE */ case 0x6a: /* COMMIT FILE */
TRACE(int21,"FFLUSH/COMMIT handle %d\n",BX_reg(context)); TRACE(int21,"FFLUSH/COMMIT handle %d\n",BX_reg(context));
bSetDOSExtendedError = (!FlushFileBuffers( HFILE16_TO_HFILE32(BX_reg(context)) )); bSetDOSExtendedError = (!FlushFileBuffers( FILE_GetHandle32(BX_reg(context)) ));
break; break;
case 0x69: /* DISK SERIAL NUMBER */ case 0x69: /* DISK SERIAL NUMBER */

View File

@ -382,7 +382,7 @@ void do_mscdex( CONTEXT *context )
/* FIXME: why a new linux-only CDROM drive access, for crying out loud? /* FIXME: why a new linux-only CDROM drive access, for crying out loud?
* There are pretty complete routines in multimedia/mcicda.c already! */ * There are pretty complete routines in multimedia/mcicda.c already! */
case 0x10: /* direct driver acces */ case 0x10: /* direct driver acces */
FIXME(cdaudio,"mscdex should use multimedia/mcicda.c"); FIXME(cdaudio,"mscdex should use multimedia/mcicda.c\n");
do_mscdex_dd(context,ISV86(context)); do_mscdex_dd(context,ISV86(context));
break; break;

View File

@ -1009,7 +1009,7 @@ void VXD_Win32s( CONTEXT *context )
LARGE_INTEGER *size = (LARGE_INTEGER *)W32S_APP2WINE(stack[3], W32S_OFFSET); LARGE_INTEGER *size = (LARGE_INTEGER *)W32S_APP2WINE(stack[3], W32S_OFFSET);
DWORD protect = stack[4]; DWORD protect = stack[4];
DWORD flags2 = stack[5]; DWORD flags2 = stack[5];
HFILE32 hFile = HFILE16_TO_HFILE32(stack[6]); HFILE32 hFile = FILE_GetHandle32(stack[6]);
DWORD psp = stack[7]; DWORD psp = stack[7];
HANDLE32 result = INVALID_HANDLE_VALUE32; HANDLE32 result = INVALID_HANDLE_VALUE32;

View File

@ -29,13 +29,12 @@
#include "debug.h" #include "debug.h"
#include "xmalloc.h" #include "xmalloc.h"
/* FIXME the following definitions must be moved to mmsystem.c */
extern struct WINE_MCIDRIVER mciDrv[MAXMCIDRIVERS]; extern struct WINE_MCIDRIVER mciDrv[MAXMCIDRIVERS];
#define MCI_GetDrv(wDevID) (&mciDrv[MCI_DevIDToIndex(wDevID)]) #define MCI_GetDrv(wDevID) (&mciDrv[MCI_DevIDToIndex(wDevID)])
#define MCI_GetOpenDrv(wDevID) (&(MCI_GetDrv(wDevID)->mop)) #define MCI_GetOpenDrv(wDevID) (&(MCI_GetDrv(wDevID)->mop))
/* end of FIXME */
LONG WINAPI DrvDefDriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2);
/* The reason why I just don't lowercase the keywords array in /* The reason why I just don't lowercase the keywords array in
* mciSendString is left as an exercise to the reader. * mciSendString is left as an exercise to the reader.
@ -44,14 +43,15 @@ LONG WINAPI DrvDefDriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
/* standard function parameters for all functions */ /* standard function parameters for all functions */
#define _MCISTR_PROTO_ \ #define _MCISTR_PROTO_ \
WORD wDevID,WORD uDevTyp,LPSTR lpstrReturnString,UINT16 uReturnLength,\ WORD wDevID, WORD uDevTyp, LPSTR lpstrReturnString, \
LPCSTR dev,LPSTR *keywords,UINT16 nrofkeywords,DWORD dwFlags,\ UINT16 uReturnLength, LPCSTR dev, LPSTR *keywords, \
HWND16 hwndCallback UINT16 nrofkeywords, DWORD dwFlags, HWND16 hwndCallback
/* copy string to return pointer including necessary checks /* copy string to return pointer including necessary checks
* for use in mciSendString() * for use in mciSendString()
*/ */
#define _MCI_STR(s) do {\ #define _MCI_STR(s) \
do { \
TRACE(mci, "->returns '%s'\n", s); \ TRACE(mci, "->returns '%s'\n", s); \
if (lpstrReturnString) { \ if (lpstrReturnString) { \
lstrcpyn32A(lpstrReturnString, s, uReturnLength); \ lstrcpyn32A(lpstrReturnString, s, uReturnLength); \
@ -61,7 +61,8 @@ LONG WINAPI DrvDefDriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
/* print a DWORD in the specified timeformat */ /* print a DWORD in the specified timeformat */
static void static void
_MCISTR_printtf(char *buf,UINT16 uDevType,DWORD timef,DWORD val) { _MCISTR_printtf(char *buf,UINT16 uDevType,DWORD timef,DWORD val)
{
*buf = '\0'; *buf = '\0';
switch (timef) { switch (timef) {
case MCI_FORMAT_MILLISECONDS: case MCI_FORMAT_MILLISECONDS:
@ -79,16 +80,14 @@ _MCISTR_printtf(char *buf,UINT16 uDevType,DWORD timef,DWORD val) {
sprintf(buf, "%d:%d:%d", sprintf(buf, "%d:%d:%d",
MCI_HMS_HOUR(val), MCI_HMS_HOUR(val),
MCI_HMS_MINUTE(val), MCI_HMS_MINUTE(val),
MCI_HMS_SECOND(val) MCI_HMS_SECOND(val));
);
break; break;
case MCI_FORMAT_TMSF: case MCI_FORMAT_TMSF:
sprintf(buf, "%d:%d:%d:%d", sprintf(buf, "%d:%d:%d:%d",
MCI_TMSF_TRACK(val), MCI_TMSF_TRACK(val),
MCI_TMSF_MINUTE(val), MCI_TMSF_MINUTE(val),
MCI_TMSF_SECOND(val), MCI_TMSF_SECOND(val),
MCI_TMSF_FRAME(val) MCI_TMSF_FRAME(val) );
);
break; break;
default: default:
FIXME(mci, "missing timeformat for %ld, report.\n",timef); FIXME(mci, "missing timeformat for %ld, report.\n",timef);
@ -110,8 +109,8 @@ _MCISTR_printtf(char *buf,UINT16 uDevType,DWORD timef,DWORD val) {
static void static void
_MCISTR_convreturn(int type,DWORD dwReturn,LPSTR lpstrReturnString, _MCISTR_convreturn(int type,DWORD dwReturn,LPSTR lpstrReturnString,
WORD uReturnLength,WORD uDevTyp,int timef WORD uReturnLength,WORD uDevTyp,int timef)
) { {
switch (type) { switch (type) {
case _MCISTR_vdmtype: case _MCISTR_vdmtype:
switch (dwReturn) { switch (dwReturn) {
@ -211,8 +210,11 @@ _MCISTR_convreturn(int type,DWORD dwReturn,LPSTR lpstrReturnString,
i++; \ i++; \
continue; \ continue; \
} }
#define FLAG2(str1,str2,flag) \ #define FLAG2(str1,str2,flag) \
if (!STRCMP(keywords[i],str1) && (i+1<nrofkeywords) && !STRCMP(keywords[i+1],str2)) {\ if (!STRCMP(keywords[i],str1) && \
(i+1<nrofkeywords) && \
!STRCMP(keywords[i+1],str2)) { \
dwFlags |= flag; \ dwFlags |= flag; \
i+=2; \ i+=2; \
continue; \ continue; \
@ -261,7 +263,8 @@ _MCISTR_convreturn(int type,DWORD dwReturn,LPSTR lpstrReturnString,
* Returns nothing. * Returns nothing.
*/ */
static DWORD static DWORD
MCISTR_Open(_MCISTR_PROTO_) { MCISTR_Open(_MCISTR_PROTO_)
{
int res,i; int res,i;
char *s; char *s;
union U { union U {
@ -285,18 +288,7 @@ MCISTR_Open(_MCISTR_PROTO_) {
free(pU); free(pU);
return MCIERR_INVALID_DEVICE_NAME; return MCIERR_INVALID_DEVICE_NAME;
} }
wDevID=MCI_FirstDevID();
while(MCI_GetDrv(wDevID)->modp.wType) {
wDevID = MCI_NextDevID(wDevID);
if (!MCI_DevIDValid(wDevID)) {
TRACE(mci, "MAXMCIDRIVERS reached (%x) !\n", wDevID);
free(pU->openParams.lpstrElementName);
free(pU);
return MCIERR_INTERNAL;
}
}
MCI_GetDrv(wDevID)->modp.wType = uDevTyp;
MCI_GetDrv(wDevID)->modp.wDeviceID = 0; /* FIXME? for multiple devices */
pU->openParams.dwCallback = hwndCallback; pU->openParams.dwCallback = hwndCallback;
pU->openParams.wDeviceID = wDevID; pU->openParams.wDeviceID = wDevID;
pU->openParams.wReserved0 = 0; pU->openParams.wReserved0 = 0;
@ -385,15 +377,11 @@ MCISTR_Open(_MCISTR_PROTO_) {
keywords[i]); keywords[i]);
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_OPEN, dwFlags, (DWORD)pU); res = mciSendCommand32A(0, MCI_OPEN, dwFlags, (DWORD)pU);
if (res==0)
memcpy(MCI_GetOpenDrv(wDevID),&pU->openParams,sizeof(MCI_OPEN_PARMS16));
else {
free(pU->openParams.lpstrElementName); free(pU->openParams.lpstrElementName);
free(pU->openParams.lpstrDeviceType); free(pU->openParams.lpstrDeviceType);
free(pU->openParams.lpstrAlias); free(pU->openParams.lpstrAlias);
}
free(pU); free(pU);
return res; return res;
} }
@ -411,7 +399,7 @@ _MCISTR_determine_timeformat(LPCSTR dev,WORD wDevID,WORD uDevTyp,int *timef)
if (!statusParams) return 0; if (!statusParams) return 0;
statusParams->dwItem = MCI_STATUS_TIME_FORMAT; statusParams->dwItem = MCI_STATUS_TIME_FORMAT;
statusParams->dwReturn = 0; statusParams->dwReturn = 0;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_STATUS, dwFlags, (DWORD)statusParams); res = mciSendCommand32A(wDevID, MCI_STATUS, dwFlags, (DWORD)statusParams);
if (res==0) *timef = statusParams->dwReturn; if (res==0) *timef = statusParams->dwReturn;
free(statusParams); free(statusParams);
@ -481,8 +469,7 @@ _MCISTR_determine_timeformat(LPCSTR dev,WORD wDevID,WORD uDevTyp,int *timef)
#define ITEM2(str1,str2,item,xtype) \ #define ITEM2(str1,str2,item,xtype) \
if ( !STRCMP(keywords[i],str1) && \ if ( !STRCMP(keywords[i],str1) && \
(i+1 < nrofkeywords) && \ (i+1 < nrofkeywords) && \
!STRCMP(keywords[i+1],str2)\ !STRCMP(keywords[i+1],str2)) { \
) {\
statusParams->dwItem = item; \ statusParams->dwItem = item; \
type = xtype; \ type = xtype; \
i+=2; \ i+=2; \
@ -492,13 +479,13 @@ _MCISTR_determine_timeformat(LPCSTR dev,WORD wDevID,WORD uDevTyp,int *timef)
if ( !STRCMP(keywords[i],str1) && \ if ( !STRCMP(keywords[i],str1) && \
(i+2 < nrofkeywords) && \ (i+2 < nrofkeywords) && \
!STRCMP(keywords[i+1],str2) && \ !STRCMP(keywords[i+1],str2) && \
!STRCMP(keywords[i+2],str3)\ !STRCMP(keywords[i+2],str3)) { \
) {\
statusParams->dwItem = item; \ statusParams->dwItem = item; \
type = xtype; \ type = xtype; \
i+=3; \ i+=3; \
continue; \ continue; \
} }
static DWORD static DWORD
MCISTR_Status(_MCISTR_PROTO_) { MCISTR_Status(_MCISTR_PROTO_) {
MCI_STATUS_PARMS *statusParams = xmalloc(sizeof(MCI_STATUS_PARMS)); MCI_STATUS_PARMS *statusParams = xmalloc(sizeof(MCI_STATUS_PARMS));
@ -583,7 +570,7 @@ MCISTR_Status(_MCISTR_PROTO_) {
if (!statusParams->dwItem) if (!statusParams->dwItem)
return MCIERR_MISSING_STRING_ARGUMENT; return MCIERR_MISSING_STRING_ARGUMENT;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_STATUS, dwFlags, (DWORD)statusParams); res = mciSendCommand32A(wDevID, MCI_STATUS, dwFlags, (DWORD)statusParams);
if (res==0) if (res==0)
_MCISTR_convreturn(type,statusParams->dwReturn,lpstrReturnString,uReturnLength,uDevTyp,timef); _MCISTR_convreturn(type,statusParams->dwReturn,lpstrReturnString,uReturnLength,uDevTyp,timef);
@ -720,8 +707,10 @@ MCISTR_Set(_MCISTR_PROTO_) {
/* <keyword> <integer> */ /* <keyword> <integer> */
#define WII(str,flag,fmt,element) \ #define WII(str,flag,fmt,element) \
if (!STRCMP(keywords[i],str) && (i+1<nrofkeywords)) {\ if (!STRCMP(keywords[i],str) && \
sscanf(keywords[i+1],fmt,&(pU->wavesetParams. element ));\ (i+1 < nrofkeywords)) { \
sscanf(keywords[i+1], fmt, \
&(pU->wavesetParams. element)); \
dwFlags |= flag; \ dwFlags |= flag; \
i+=2; \ i+=2; \
continue; \ continue; \
@ -787,7 +776,7 @@ MCISTR_Set(_MCISTR_PROTO_) {
} }
if (!dwFlags) if (!dwFlags)
return MCIERR_MISSING_STRING_ARGUMENT; return MCIERR_MISSING_STRING_ARGUMENT;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_SET, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_SET, dwFlags, (DWORD)pU);
free(pU); free(pU);
return res; return res;
} }
@ -819,7 +808,7 @@ MCISTR_Break(_MCISTR_PROTO_)
continue; continue;
} }
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_BREAK, dwFlags, (DWORD)breakParams); res = mciSendCommand32A(wDevID, MCI_BREAK, dwFlags, (DWORD)breakParams);
free(breakParams); free(breakParams);
return res; return res;
} }
@ -834,8 +823,7 @@ MCISTR_Break(_MCISTR_PROTO_)
#define ITEM2(str1,str2,item,xtype) \ #define ITEM2(str1,str2,item,xtype) \
if ( !STRCMP(keywords[i],str1) && \ if ( !STRCMP(keywords[i],str1) && \
(i+1 < nrofkeywords) && \ (i+1 < nrofkeywords) && \
!STRCMP(keywords[i+1],str2)\ !STRCMP(keywords[i+1],str2)) { \
) {\
gdcParams->dwItem = item; \ gdcParams->dwItem = item; \
type = xtype; \ type = xtype; \
i+=2; \ i+=2; \
@ -845,13 +833,13 @@ MCISTR_Break(_MCISTR_PROTO_)
if ( !STRCMP(keywords[i],str1) && \ if ( !STRCMP(keywords[i],str1) && \
(i+2 < nrofkeywords) && \ (i+2 < nrofkeywords) && \
!STRCMP(keywords[i+1],str2) && \ !STRCMP(keywords[i+1],str2) && \
!STRCMP(keywords[i+2],str3)\ !STRCMP(keywords[i+2],str3)) { \
) {\
gdcParams->dwItem = item; \ gdcParams->dwItem = item; \
type = xtype; \ type = xtype; \
i+=3; \ i+=3; \
continue; \ continue; \
} }
/* get device capabilities of MCI drivers /* get device capabilities of MCI drivers
* Arguments: * Arguments:
* Generic: * Generic:
@ -939,7 +927,7 @@ MCISTR_Capability(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_GETDEVCAPS, dwFlags, (DWORD)gdcParams); res = mciSendCommand32A(wDevID, MCI_GETDEVCAPS, dwFlags, (DWORD)gdcParams);
/* no timeformat needed */ /* no timeformat needed */
if (res==0) if (res==0)
@ -958,7 +946,7 @@ MCISTR_Resume(_MCISTR_PROTO_)
MCI_GENERIC_PARMS *genParams = xmalloc(sizeof(MCI_GENERIC_PARMS)); MCI_GENERIC_PARMS *genParams = xmalloc(sizeof(MCI_GENERIC_PARMS));
int res; int res;
genParams->dwCallback = hwndCallback; genParams->dwCallback = hwndCallback;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_RESUME, dwFlags, (DWORD)genParams); res = mciSendCommand32A(wDevID, MCI_RESUME, dwFlags, (DWORD)genParams);
free(genParams); free(genParams);
return res; return res;
} }
@ -970,7 +958,7 @@ MCISTR_Pause(_MCISTR_PROTO_)
MCI_GENERIC_PARMS *genParams = xmalloc(sizeof(MCI_GENERIC_PARMS)); MCI_GENERIC_PARMS *genParams = xmalloc(sizeof(MCI_GENERIC_PARMS));
int res; int res;
genParams->dwCallback = hwndCallback; genParams->dwCallback = hwndCallback;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_PAUSE, dwFlags, (DWORD)genParams); res = mciSendCommand32A(wDevID, MCI_PAUSE, dwFlags, (DWORD)genParams);
free(genParams); free(genParams);
return res; return res;
} }
@ -982,7 +970,7 @@ MCISTR_Stop(_MCISTR_PROTO_)
MCI_GENERIC_PARMS *genParams = xmalloc(sizeof(MCI_GENERIC_PARMS)); MCI_GENERIC_PARMS *genParams = xmalloc(sizeof(MCI_GENERIC_PARMS));
int res; int res;
genParams->dwCallback = hwndCallback; genParams->dwCallback = hwndCallback;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_STOP, dwFlags, (DWORD)genParams); res = mciSendCommand32A(wDevID, MCI_STOP, dwFlags, (DWORD)genParams);
free(genParams); free(genParams);
return res; return res;
} }
@ -1057,7 +1045,7 @@ MCISTR_Record(_MCISTR_PROTO_) {
FLAG1("overwrite",MCI_RECORD_OVERWRITE); FLAG1("overwrite",MCI_RECORD_OVERWRITE);
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_RECORD, dwFlags, (DWORD)recordParams); res = mciSendCommand32A(wDevID, MCI_RECORD, dwFlags, (DWORD)recordParams);
free(recordParams); free(recordParams);
return res; return res;
} }
@ -1170,7 +1158,7 @@ MCISTR_Play(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_PLAY, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_PLAY, dwFlags, (DWORD)pU);
free(pU); free(pU);
return res; return res;
} }
@ -1243,7 +1231,7 @@ MCISTR_Seek(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_SEEK, dwFlags, (DWORD)seekParams); res = mciSendCommand32A(wDevID, MCI_SEEK, dwFlags, (DWORD)seekParams);
free(seekParams); free(seekParams);
return res; return res;
} }
@ -1255,7 +1243,7 @@ MCISTR_Close(_MCISTR_PROTO_)
MCI_GENERIC_PARMS* closeParams = xmalloc(sizeof(MCI_GENERIC_PARMS)); MCI_GENERIC_PARMS* closeParams = xmalloc(sizeof(MCI_GENERIC_PARMS));
int res; int res;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_CLOSE, dwFlags, (DWORD)closeParams); res = mciSendCommand32A(wDevID, MCI_CLOSE, dwFlags, (DWORD)closeParams);
free(closeParams); free(closeParams);
return res; return res;
} }
@ -1296,7 +1284,7 @@ MCISTR_Info(_MCISTR_PROTO_)
/* MCI driver will fill in lpstrReturn, dwRetSize. /* MCI driver will fill in lpstrReturn, dwRetSize.
* FIXME: I don't know if this is correct behaviour * FIXME: I don't know if this is correct behaviour
*/ */
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_INFO, dwFlags, (DWORD)infoParams); res = mciSendCommand32A(wDevID, MCI_INFO, dwFlags, (DWORD)infoParams);
if (res==0) if (res==0)
_MCI_STR(infoParams->lpstrReturn); _MCI_STR(infoParams->lpstrReturn);
free(infoParams); free(infoParams);
@ -1385,7 +1373,7 @@ MCISTR_Load(_MCISTR_PROTO_) {
} }
pU->loadParams.lpfilename=s; pU->loadParams.lpfilename=s;
dwFlags |= MCI_LOAD_FILE; dwFlags |= MCI_LOAD_FILE;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_LOAD, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_LOAD, dwFlags, (DWORD)pU);
free(s); free(s);
free(pU); free(pU);
return res; return res;
@ -1432,7 +1420,7 @@ MCISTR_Save(_MCISTR_PROTO_) {
} }
pU->saveParams.lpfilename=s; pU->saveParams.lpfilename=s;
dwFlags |= MCI_LOAD_FILE; dwFlags |= MCI_LOAD_FILE;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_SAVE, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_SAVE, dwFlags, (DWORD)pU);
free(s); free(s);
free(pU); free(pU);
return res; return res;
@ -1454,7 +1442,7 @@ MCISTR_Cue(_MCISTR_PROTO_) {
break; break;
} }
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_CUE, dwFlags, (DWORD)cueParams); res = mciSendCommand32A(wDevID, MCI_CUE, dwFlags, (DWORD)cueParams);
free(cueParams); free(cueParams);
return res; return res;
} }
@ -1522,7 +1510,7 @@ MCISTR_Delete(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_DELETE, dwFlags, (DWORD)deleteParams); res = mciSendCommand32A(wDevID, MCI_DELETE, dwFlags, (DWORD)deleteParams);
free(deleteParams); free(deleteParams);
return res; return res;
} }
@ -1551,7 +1539,7 @@ MCISTR_Escape(_MCISTR_PROTO_)
} }
escapeParams->lpstrCommand = s; escapeParams->lpstrCommand = s;
dwFlags |= MCI_VD_ESCAPE_STRING; dwFlags |= MCI_VD_ESCAPE_STRING;
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_ESCAPE, dwFlags, (DWORD)escapeParams); res = mciSendCommand32A(wDevID, MCI_ESCAPE, dwFlags, (DWORD)escapeParams);
free(s); free(s);
free(escapeParams); free(escapeParams);
return res; return res;
@ -1580,7 +1568,7 @@ MCISTR_Unfreeze(_MCISTR_PROTO_)
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_UNFREEZE, dwFlags, (DWORD)unfreezeParams); res = mciSendCommand32A(wDevID, MCI_UNFREEZE, dwFlags, (DWORD)unfreezeParams);
free(unfreezeParams); free(unfreezeParams);
return res; return res;
} }
@ -1607,7 +1595,7 @@ MCISTR_Freeze(_MCISTR_PROTO_)
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_FREEZE, dwFlags, (DWORD)freezeParams); res = mciSendCommand32A(wDevID, MCI_FREEZE, dwFlags, (DWORD)freezeParams);
free(freezeParams); free(freezeParams);
return res; return res;
} }
@ -1667,7 +1655,7 @@ MCISTR_Put(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_PUT, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_PUT, dwFlags, (DWORD)pU);
free(pU); free(pU);
return res; return res;
} }
@ -1691,7 +1679,7 @@ MCISTR_Realize(_MCISTR_PROTO_)
FLAG1("normal",MCI_ANIM_REALIZE_NORM); FLAG1("normal",MCI_ANIM_REALIZE_NORM);
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_REALIZE, dwFlags, (DWORD)realizeParams); res = mciSendCommand32A(wDevID, MCI_REALIZE, dwFlags, (DWORD)realizeParams);
free(realizeParams); free(realizeParams);
return res; return res;
} }
@ -1714,7 +1702,7 @@ MCISTR_Spin(_MCISTR_PROTO_)
FLAG1("down",MCI_VD_SPIN_UP); FLAG1("down",MCI_VD_SPIN_UP);
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_SPIN, dwFlags, (DWORD)spinParams); res = mciSendCommand32A(wDevID, MCI_SPIN, dwFlags, (DWORD)spinParams);
free(spinParams); free(spinParams);
return res; return res;
} }
@ -1756,7 +1744,7 @@ MCISTR_Step(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_STEP, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_STEP, dwFlags, (DWORD)pU);
free(pU); free(pU);
return res; return res;
} }
@ -1790,7 +1778,7 @@ MCISTR_Update(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_UPDATE, dwFlags, (DWORD)updateParams); res = mciSendCommand32A(wDevID, MCI_UPDATE, dwFlags, (DWORD)updateParams);
free(updateParams); free(updateParams);
return res; return res;
} }
@ -1829,7 +1817,7 @@ MCISTR_Where(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_WHERE, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_WHERE, dwFlags, (DWORD)pU);
if (res==0) { if (res==0) {
char buf[100]; char buf[100];
switch (uDevTyp) { switch (uDevTyp) {
@ -2012,7 +2000,7 @@ MCISTR_Window(_MCISTR_PROTO_) {
} }
i++; i++;
} }
res = MCI_SendCommand32(MCI_GetDrv(wDevID)->modp.wDeviceID, MCI_WINDOW, dwFlags, (DWORD)pU); res = mciSendCommand32A(wDevID, MCI_WINDOW, dwFlags, (DWORD)pU);
if (s) free(s); if (s) free(s);
free(pU); free(pU);
return res; return res;
@ -2129,6 +2117,7 @@ DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrReturnString,
i++; i++;
} }
/* FIXME: this code should be moved to mmsystem.c */
/* determine wDevID and uDevTyp for all commands except "open" */ /* determine wDevID and uDevTyp for all commands except "open" */
if (STRCMP(cmd,"open")!=0) { if (STRCMP(cmd,"open")!=0) {
wDevID = MCI_FirstDevID(); wDevID = MCI_FirstDevID();
@ -2149,6 +2138,7 @@ DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrReturnString,
} }
uDevTyp=MCI_GetDrv(wDevID)->modp.wType; uDevTyp=MCI_GetDrv(wDevID)->modp.wType;
} }
/* end of FIXME */
for (i=0;MCISTR_cmdtable[i].cmd!=NULL;i++) { for (i=0;MCISTR_cmdtable[i].cmd!=NULL;i++) {
if (!STRCMP(MCISTR_cmdtable[i].cmd,cmd)) { if (!STRCMP(MCISTR_cmdtable[i].cmd,cmd)) {

View File

@ -46,7 +46,7 @@ static LRESULT mmioDosIOProc(LPMMIOINFO16 lpmmioinfo, UINT16 uMessage, LPARAM lP
/* if filename NULL, assume open file handle in adwInfo[0] */ /* if filename NULL, assume open file handle in adwInfo[0] */
if (!szFileName) { if (!szFileName) {
if (lParam2) lpmmioinfo->adwInfo[0] = if (lParam2) lpmmioinfo->adwInfo[0] =
HFILE16_TO_HFILE32(lpmmioinfo->adwInfo[0]); FILE_GetHandle32(lpmmioinfo->adwInfo[0]);
return 0; return 0;
} }

View File

@ -527,6 +527,16 @@ HBITMAP32 BITMAP_CopyBitmap(HBITMAP32 hbitmap)
return res; return res;
} }
/******************************************************************************
* CopyImage16 [USER.390] Creates new image and copies attributes to it
*
*/
HICON16 WINAPI CopyImage16( HANDLE16 hnd, UINT16 type, INT16 desiredx,
INT16 desiredy, UINT16 flags )
{
return (HICON16)CopyImage32((HANDLE32)hnd, (UINT32)type, (INT32)desiredx,
(INT32)desiredy, (UINT32)flags);
}
/****************************************************************************** /******************************************************************************
* CopyImage32 [USER32.61] Creates new image and copies attributes to it * CopyImage32 [USER32.61] Creates new image and copies attributes to it

View File

@ -1269,3 +1269,25 @@ UINT32 WINAPI SetBoundsRect32(HDC32 hdc, const RECT32* rect, UINT32 flags)
return DCB_DISABLE; /* bounding rectangle always empty */ return DCB_DISABLE; /* bounding rectangle always empty */
} }
/***********************************************************************
* Death (GDI.121)
*
* Disables GDI, switches back to text mode.
* We don't have to do anything here,
* just let console support handle everything
*/
void WINAPI Death(HDC16 hDC)
{
MSG("Death(%04x) called. Application enters text mode...\n", hDC);
}
/***********************************************************************
* Resurrection (GDI.122)
*
* Restores GDI functionality
*/
void WINAPI Resurrection(HDC16 hDC,
WORD w1, WORD w2, WORD w3, WORD w4, WORD w5, WORD w6)
{
MSG("Resurrection(%04x, %04x, %04x, %04x, %04x, %04x, %04x) called. Application left text mode.\n", hDC, w1, w2, w3, w4, w5, w6);
}

View File

@ -996,7 +996,7 @@ INT32 WINAPI MulDiv32(
* *
* *
*/ */
BOOL32 WINAPI GetColorAdjustment32(HDC32 hdc, LPCOLORADJUSTMENT lpca) BOOL32 WINAPI GetColorAdjustment(HDC32 hdc, LPCOLORADJUSTMENT lpca)
{ {
FIXME(gdi, "GetColorAdjustment, stub\n"); FIXME(gdi, "GetColorAdjustment, stub\n");
return 0; return 0;
@ -1029,7 +1029,7 @@ BOOL32 WINAPI SetMiterLimit(HDC32 hdc, FLOAT eNewLimit, PFLOAT peOldLimit)
* *
* *
*/ */
BOOL32 WINAPI GdiComment32(HDC32 hdc, UINT32 cbSize, const BYTE *lpData) BOOL32 WINAPI GdiComment(HDC32 hdc, UINT32 cbSize, const BYTE *lpData)
{ {
FIXME(gdi, "GdiComment, stub\n"); FIXME(gdi, "GdiComment, stub\n");
return 0; return 0;

View File

@ -526,133 +526,133 @@ void WINAPI PlayMetaFileRecord16(
break; break;
case META_DELETEOBJECT: case META_DELETEOBJECT:
DeleteObject32(*(ht->objectHandle + *(mr->rdParam))); DeleteObject32(*(ht->objectHandle + *(mr->rdParm)));
*(ht->objectHandle + *(mr->rdParam)) = 0; *(ht->objectHandle + *(mr->rdParm)) = 0;
break; break;
case META_SETBKCOLOR: case META_SETBKCOLOR:
SetBkColor16(hdc, MAKELONG(*(mr->rdParam), *(mr->rdParam + 1))); SetBkColor16(hdc, MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break; break;
case META_SETBKMODE: case META_SETBKMODE:
SetBkMode16(hdc, *(mr->rdParam)); SetBkMode16(hdc, *(mr->rdParm));
break; break;
case META_SETMAPMODE: case META_SETMAPMODE:
SetMapMode16(hdc, *(mr->rdParam)); SetMapMode16(hdc, *(mr->rdParm));
break; break;
case META_SETROP2: case META_SETROP2:
SetROP216(hdc, *(mr->rdParam)); SetROP216(hdc, *(mr->rdParm));
break; break;
case META_SETRELABS: case META_SETRELABS:
SetRelAbs16(hdc, *(mr->rdParam)); SetRelAbs16(hdc, *(mr->rdParm));
break; break;
case META_SETPOLYFILLMODE: case META_SETPOLYFILLMODE:
SetPolyFillMode16(hdc, *(mr->rdParam)); SetPolyFillMode16(hdc, *(mr->rdParm));
break; break;
case META_SETSTRETCHBLTMODE: case META_SETSTRETCHBLTMODE:
SetStretchBltMode16(hdc, *(mr->rdParam)); SetStretchBltMode16(hdc, *(mr->rdParm));
break; break;
case META_SETTEXTCOLOR: case META_SETTEXTCOLOR:
SetTextColor16(hdc, MAKELONG(*(mr->rdParam), *(mr->rdParam + 1))); SetTextColor16(hdc, MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break; break;
case META_SETWINDOWORG: case META_SETWINDOWORG:
SetWindowOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam)); SetWindowOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_SETWINDOWEXT: case META_SETWINDOWEXT:
SetWindowExt(hdc, *(mr->rdParam + 1), *(mr->rdParam)); SetWindowExt(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_SETVIEWPORTORG: case META_SETVIEWPORTORG:
SetViewportOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam)); SetViewportOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_SETVIEWPORTEXT: case META_SETVIEWPORTEXT:
SetViewportExt(hdc, *(mr->rdParam + 1), *(mr->rdParam)); SetViewportExt(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_OFFSETWINDOWORG: case META_OFFSETWINDOWORG:
OffsetWindowOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam)); OffsetWindowOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_SCALEWINDOWEXT: case META_SCALEWINDOWEXT:
ScaleWindowExt(hdc, *(mr->rdParam + 3), *(mr->rdParam + 2), ScaleWindowExt(hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParam + 1), *(mr->rdParam)); *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_OFFSETVIEWPORTORG: case META_OFFSETVIEWPORTORG:
OffsetViewportOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam)); OffsetViewportOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_SCALEVIEWPORTEXT: case META_SCALEVIEWPORTEXT:
ScaleViewportExt(hdc, *(mr->rdParam + 3), *(mr->rdParam + 2), ScaleViewportExt(hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParam + 1), *(mr->rdParam)); *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_LINETO: case META_LINETO:
LineTo32(hdc, (INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); LineTo32(hdc, (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_MOVETO: case META_MOVETO:
MoveTo(hdc, *(mr->rdParam + 1), *(mr->rdParam)); MoveTo(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_EXCLUDECLIPRECT: case META_EXCLUDECLIPRECT:
ExcludeClipRect16( hdc, *(mr->rdParam + 3), *(mr->rdParam + 2), ExcludeClipRect16( hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParam + 1), *(mr->rdParam) ); *(mr->rdParm + 1), *(mr->rdParm) );
break; break;
case META_INTERSECTCLIPRECT: case META_INTERSECTCLIPRECT:
IntersectClipRect16( hdc, *(mr->rdParam + 3), *(mr->rdParam + 2), IntersectClipRect16( hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParam + 1), *(mr->rdParam) ); *(mr->rdParm + 1), *(mr->rdParm) );
break; break;
case META_ARC: case META_ARC:
Arc32(hdc, (INT16)*(mr->rdParam + 7), (INT16)*(mr->rdParam + 6), Arc32(hdc, (INT16)*(mr->rdParm + 7), (INT16)*(mr->rdParm + 6),
(INT16)*(mr->rdParam + 5), (INT16)*(mr->rdParam + 4), (INT16)*(mr->rdParm + 5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_ELLIPSE: case META_ELLIPSE:
Ellipse32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), Ellipse32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_FLOODFILL: case META_FLOODFILL:
FloodFill32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), FloodFill32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
MAKELONG(*(mr->rdParam), *(mr->rdParam + 1))); MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break; break;
case META_PIE: case META_PIE:
Pie32(hdc, (INT16)*(mr->rdParam + 7), (INT16)*(mr->rdParam + 6), Pie32(hdc, (INT16)*(mr->rdParm + 7), (INT16)*(mr->rdParm + 6),
(INT16)*(mr->rdParam + 5), (INT16)*(mr->rdParam + 4), (INT16)*(mr->rdParm + 5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_RECTANGLE: case META_RECTANGLE:
Rectangle32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), Rectangle32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_ROUNDRECT: case META_ROUNDRECT:
RoundRect32(hdc, (INT16)*(mr->rdParam + 5), (INT16)*(mr->rdParam + 4), RoundRect32(hdc, (INT16)*(mr->rdParm + 5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_PATBLT: case META_PATBLT:
PatBlt16(hdc, *(mr->rdParam + 5), *(mr->rdParam + 4), PatBlt16(hdc, *(mr->rdParm + 5), *(mr->rdParm + 4),
*(mr->rdParam + 3), *(mr->rdParam + 2), *(mr->rdParm + 3), *(mr->rdParm + 2),
MAKELONG(*(mr->rdParam), *(mr->rdParam + 1))); MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break; break;
case META_SAVEDC: case META_SAVEDC:
@ -660,60 +660,60 @@ void WINAPI PlayMetaFileRecord16(
break; break;
case META_SETPIXEL: case META_SETPIXEL:
SetPixel32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), SetPixel32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
MAKELONG(*(mr->rdParam), *(mr->rdParam + 1))); MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break; break;
case META_OFFSETCLIPRGN: case META_OFFSETCLIPRGN:
OffsetClipRgn16( hdc, *(mr->rdParam + 1), *(mr->rdParam) ); OffsetClipRgn16( hdc, *(mr->rdParm + 1), *(mr->rdParm) );
break; break;
case META_TEXTOUT: case META_TEXTOUT:
s1 = *(mr->rdParam); s1 = *(mr->rdParm);
TextOut16(hdc, *(mr->rdParam + ((s1 + 1) >> 1) + 2), TextOut16(hdc, *(mr->rdParm + ((s1 + 1) >> 1) + 2),
*(mr->rdParam + ((s1 + 1) >> 1) + 1), *(mr->rdParm + ((s1 + 1) >> 1) + 1),
(char *)(mr->rdParam + 1), s1); (char *)(mr->rdParm + 1), s1);
break; break;
case META_POLYGON: case META_POLYGON:
Polygon16(hdc, (LPPOINT16)(mr->rdParam + 1), *(mr->rdParam)); Polygon16(hdc, (LPPOINT16)(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_POLYPOLYGON: case META_POLYPOLYGON:
PolyPolygon16(hdc, (LPPOINT16)(mr->rdParam + *(mr->rdParam) + 1), PolyPolygon16(hdc, (LPPOINT16)(mr->rdParm + *(mr->rdParm) + 1),
(LPINT16)(mr->rdParam + 1), *(mr->rdParam)); (LPINT16)(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_POLYLINE: case META_POLYLINE:
Polyline16(hdc, (LPPOINT16)(mr->rdParam + 1), *(mr->rdParam)); Polyline16(hdc, (LPPOINT16)(mr->rdParm + 1), *(mr->rdParm));
break; break;
case META_RESTOREDC: case META_RESTOREDC:
RestoreDC32(hdc, (INT16)*(mr->rdParam)); RestoreDC32(hdc, (INT16)*(mr->rdParm));
break; break;
case META_SELECTOBJECT: case META_SELECTOBJECT:
SelectObject32(hdc, *(ht->objectHandle + *(mr->rdParam))); SelectObject32(hdc, *(ht->objectHandle + *(mr->rdParm)));
break; break;
case META_CHORD: case META_CHORD:
Chord32(hdc, (INT16)*(mr->rdParam + 7), (INT16)*(mr->rdParam + 6), Chord32(hdc, (INT16)*(mr->rdParm + 7), (INT16)*(mr->rdParm + 6),
(INT16)*(mr->rdParam+5), (INT16)*(mr->rdParam + 4), (INT16)*(mr->rdParm+5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2), (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam)); (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break; break;
case META_CREATEPATTERNBRUSH: case META_CREATEPATTERNBRUSH:
switch (*(mr->rdParam)) switch (*(mr->rdParm))
{ {
case BS_PATTERN: case BS_PATTERN:
infohdr = (BITMAPINFOHEADER *)(mr->rdParam + 2); infohdr = (BITMAPINFOHEADER *)(mr->rdParm + 2);
MF_AddHandle(ht, nHandles, MF_AddHandle(ht, nHandles,
CreatePatternBrush32(CreateBitmap32(infohdr->biWidth, CreatePatternBrush32(CreateBitmap32(infohdr->biWidth,
infohdr->biHeight, infohdr->biHeight,
infohdr->biPlanes, infohdr->biPlanes,
infohdr->biBitCount, infohdr->biBitCount,
(LPSTR)(mr->rdParam + (LPSTR)(mr->rdParm +
(sizeof(BITMAPINFOHEADER) / 2) + 4)))); (sizeof(BITMAPINFOHEADER) / 2) + 4))));
break; break;
@ -721,45 +721,45 @@ void WINAPI PlayMetaFileRecord16(
s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2; s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2;
hndl = GlobalAlloc16(GMEM_MOVEABLE, s1); hndl = GlobalAlloc16(GMEM_MOVEABLE, s1);
ptr = GlobalLock16(hndl); ptr = GlobalLock16(hndl);
memcpy(ptr, mr->rdParam + 2, s1); memcpy(ptr, mr->rdParm + 2, s1);
GlobalUnlock16(hndl); GlobalUnlock16(hndl);
MF_AddHandle(ht, nHandles, MF_AddHandle(ht, nHandles,
CreateDIBPatternBrush32(hndl, *(mr->rdParam + 1))); CreateDIBPatternBrush32(hndl, *(mr->rdParm + 1)));
GlobalFree16(hndl); GlobalFree16(hndl);
} }
break; break;
case META_CREATEPENINDIRECT: case META_CREATEPENINDIRECT:
MF_AddHandle(ht, nHandles, MF_AddHandle(ht, nHandles,
CreatePenIndirect16((LOGPEN16 *)(&(mr->rdParam)))); CreatePenIndirect16((LOGPEN16 *)(&(mr->rdParm))));
break; break;
case META_CREATEFONTINDIRECT: case META_CREATEFONTINDIRECT:
MF_AddHandle(ht, nHandles, MF_AddHandle(ht, nHandles,
CreateFontIndirect16((LOGFONT16 *)(&(mr->rdParam)))); CreateFontIndirect16((LOGFONT16 *)(&(mr->rdParm))));
break; break;
case META_CREATEBRUSHINDIRECT: case META_CREATEBRUSHINDIRECT:
MF_AddHandle(ht, nHandles, MF_AddHandle(ht, nHandles,
CreateBrushIndirect16((LOGBRUSH16 *)(&(mr->rdParam)))); CreateBrushIndirect16((LOGBRUSH16 *)(&(mr->rdParm))));
break; break;
/* W. Magro: Some new metafile operations. Not all debugged. */ /* W. Magro: Some new metafile operations. Not all debugged. */
case META_CREATEPALETTE: case META_CREATEPALETTE:
MF_AddHandle(ht, nHandles, MF_AddHandle(ht, nHandles,
CreatePalette16((LPLOGPALETTE)mr->rdParam)); CreatePalette16((LPLOGPALETTE)mr->rdParm));
break; break;
case META_SETTEXTALIGN: case META_SETTEXTALIGN:
SetTextAlign16(hdc, *(mr->rdParam)); SetTextAlign16(hdc, *(mr->rdParm));
break; break;
case META_SELECTPALETTE: case META_SELECTPALETTE:
SelectPalette16(hdc, *(ht->objectHandle + *(mr->rdParam+1)),*(mr->rdParam)); SelectPalette16(hdc, *(ht->objectHandle + *(mr->rdParm+1)),*(mr->rdParm));
break; break;
case META_SETMAPPERFLAGS: case META_SETMAPPERFLAGS:
SetMapperFlags16(hdc, *(mr->rdParam)); SetMapperFlags16(hdc, *(mr->rdParm));
break; break;
case META_REALIZEPALETTE: case META_REALIZEPALETTE:
@ -777,12 +777,12 @@ void WINAPI PlayMetaFileRecord16(
LPSTR sot; LPSTR sot;
DWORD len; DWORD len;
s1 = mr->rdParam[2]; /* String length */ s1 = mr->rdParm[2]; /* String length */
len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short) len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short)
+ sizeof(UINT16) + (mr->rdParam[3] ? sizeof(RECT16) : 0); /* rec len without dx array */ + sizeof(UINT16) + (mr->rdParm[3] ? sizeof(RECT16) : 0); /* rec len without dx array */
sot= (LPSTR)&mr->rdParam[4]; /* start_of_text */ sot= (LPSTR)&mr->rdParm[4]; /* start_of_text */
if (mr->rdParam[3]) if (mr->rdParm[3])
sot+=sizeof(RECT16); /* there is a rectangle, so add offset */ sot+=sizeof(RECT16); /* there is a rectangle, so add offset */
if (mr->rdSize == len / 2) if (mr->rdSize == len / 2)
@ -796,13 +796,13 @@ void WINAPI PlayMetaFileRecord16(
sot,mr->rdSize); sot,mr->rdSize);
WARN(metafile, WARN(metafile,
"Please report: PlayMetaFile/ExtTextOut len=%ld slen=%d rdSize=%ld opt=%04x\n", "Please report: PlayMetaFile/ExtTextOut len=%ld slen=%d rdSize=%ld opt=%04x\n",
len,s1,mr->rdSize,mr->rdParam[3]); len,s1,mr->rdSize,mr->rdParm[3]);
dxx = NULL; /* should't happen -- but if, we continue with NULL [for workaround] */ dxx = NULL; /* should't happen -- but if, we continue with NULL [for workaround] */
} }
ExtTextOut16( hdc, mr->rdParam[1], /* X position */ ExtTextOut16( hdc, mr->rdParm[1], /* X position */
mr->rdParam[0], /* Y position */ mr->rdParm[0], /* Y position */
mr->rdParam[3], /* options */ mr->rdParm[3], /* options */
mr->rdParam[3] ? (LPRECT16) &mr->rdParam[4]:NULL, /* rectangle */ mr->rdParm[3] ? (LPRECT16) &mr->rdParm[4]:NULL, /* rectangle */
sot, /* string */ sot, /* string */
s1, dxx); /* length, dx array */ s1, dxx); /* length, dx array */
if (dxx) if (dxx)
@ -813,40 +813,40 @@ void WINAPI PlayMetaFileRecord16(
case META_STRETCHDIB: case META_STRETCHDIB:
{ {
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[11]); LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[11]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[2] ); LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[2] );
StretchDIBits16(hdc,mr->rdParam[10],mr->rdParam[9],mr->rdParam[8], StretchDIBits16(hdc,mr->rdParm[10],mr->rdParm[9],mr->rdParm[8],
mr->rdParam[7],mr->rdParam[6],mr->rdParam[5], mr->rdParm[7],mr->rdParm[6],mr->rdParm[5],
mr->rdParam[4],mr->rdParam[3],bits,info, mr->rdParm[4],mr->rdParm[3],bits,info,
mr->rdParam[2],MAKELONG(mr->rdParam[0],mr->rdParam[1])); mr->rdParm[2],MAKELONG(mr->rdParm[0],mr->rdParm[1]));
} }
break; break;
case META_DIBSTRETCHBLT: case META_DIBSTRETCHBLT:
{ {
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[10]); LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[10]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[2] ); LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[2] );
StretchDIBits16(hdc,mr->rdParam[9],mr->rdParam[8],mr->rdParam[7], StretchDIBits16(hdc,mr->rdParm[9],mr->rdParm[8],mr->rdParm[7],
mr->rdParam[6],mr->rdParam[5],mr->rdParam[4], mr->rdParm[6],mr->rdParm[5],mr->rdParm[4],
mr->rdParam[3],mr->rdParam[2],bits,info, mr->rdParm[3],mr->rdParm[2],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1])); DIB_RGB_COLORS,MAKELONG(mr->rdParm[0],mr->rdParm[1]));
} }
break; break;
case META_STRETCHBLT: case META_STRETCHBLT:
{ {
HDC16 hdcSrc=CreateCompatibleDC16(hdc); HDC16 hdcSrc=CreateCompatibleDC16(hdc);
HBITMAP32 hbitmap=CreateBitmap32(mr->rdParam[10], /*Width */ HBITMAP32 hbitmap=CreateBitmap32(mr->rdParm[10], /*Width */
mr->rdParam[11], /*Height*/ mr->rdParm[11], /*Height*/
mr->rdParam[13], /*Planes*/ mr->rdParm[13], /*Planes*/
mr->rdParam[14], /*BitsPixel*/ mr->rdParm[14], /*BitsPixel*/
(LPSTR)&mr->rdParam[15]); /*bits*/ (LPSTR)&mr->rdParm[15]); /*bits*/
SelectObject32(hdcSrc,hbitmap); SelectObject32(hdcSrc,hbitmap);
StretchBlt16(hdc,mr->rdParam[9],mr->rdParam[8], StretchBlt16(hdc,mr->rdParm[9],mr->rdParm[8],
mr->rdParam[7],mr->rdParam[6], mr->rdParm[7],mr->rdParm[6],
hdcSrc,mr->rdParam[5],mr->rdParam[4], hdcSrc,mr->rdParm[5],mr->rdParm[4],
mr->rdParam[3],mr->rdParam[2], mr->rdParm[3],mr->rdParm[2],
MAKELONG(mr->rdParam[0],mr->rdParam[1])); MAKELONG(mr->rdParm[0],mr->rdParm[1]));
DeleteDC32(hdcSrc); DeleteDC32(hdcSrc);
} }
break; break;
@ -854,16 +854,16 @@ void WINAPI PlayMetaFileRecord16(
case META_BITBLT: /* <-- not yet debugged */ case META_BITBLT: /* <-- not yet debugged */
{ {
HDC16 hdcSrc=CreateCompatibleDC16(hdc); HDC16 hdcSrc=CreateCompatibleDC16(hdc);
HBITMAP32 hbitmap=CreateBitmap32(mr->rdParam[7]/*Width */, HBITMAP32 hbitmap=CreateBitmap32(mr->rdParm[7]/*Width */,
mr->rdParam[8]/*Height*/, mr->rdParm[8]/*Height*/,
mr->rdParam[10]/*Planes*/, mr->rdParm[10]/*Planes*/,
mr->rdParam[11]/*BitsPixel*/, mr->rdParm[11]/*BitsPixel*/,
(LPSTR)&mr->rdParam[12]/*bits*/); (LPSTR)&mr->rdParm[12]/*bits*/);
SelectObject32(hdcSrc,hbitmap); SelectObject32(hdcSrc,hbitmap);
BitBlt32(hdc,(INT16)mr->rdParam[6],(INT16)mr->rdParam[5], BitBlt32(hdc,(INT16)mr->rdParm[6],(INT16)mr->rdParm[5],
(INT16)mr->rdParam[4],(INT16)mr->rdParam[3], (INT16)mr->rdParm[4],(INT16)mr->rdParm[3],
hdcSrc, (INT16)mr->rdParam[2],(INT16)mr->rdParam[1], hdcSrc, (INT16)mr->rdParm[2],(INT16)mr->rdParm[1],
MAKELONG(0,mr->rdParam[0])); MAKELONG(0,mr->rdParm[0]));
DeleteDC32(hdcSrc); DeleteDC32(hdcSrc);
} }
break; break;
@ -879,51 +879,51 @@ void WINAPI PlayMetaFileRecord16(
break; break;
case META_FILLREGION: case META_FILLREGION:
FillRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)), FillRgn16(hdc, *(ht->objectHandle + *(mr->rdParm)),
*(ht->objectHandle + *(mr->rdParam+1))); *(ht->objectHandle + *(mr->rdParm+1)));
break; break;
case META_INVERTREGION: case META_INVERTREGION:
InvertRgn16(hdc, *(ht->objectHandle + *(mr->rdParam))); InvertRgn16(hdc, *(ht->objectHandle + *(mr->rdParm)));
break; break;
case META_PAINTREGION: case META_PAINTREGION:
PaintRgn16(hdc, *(ht->objectHandle + *(mr->rdParam))); PaintRgn16(hdc, *(ht->objectHandle + *(mr->rdParm)));
break; break;
case META_SELECTCLIPREGION: case META_SELECTCLIPREGION:
SelectClipRgn32(hdc, *(ht->objectHandle + *(mr->rdParam))); SelectClipRgn32(hdc, *(ht->objectHandle + *(mr->rdParm)));
break; break;
case META_DIBCREATEPATTERNBRUSH: case META_DIBCREATEPATTERNBRUSH:
/* *(mr->rdParam) may be BS_PATTERN or BS_DIBPATTERN: but there's no difference */ /* *(mr->rdParm) may be BS_PATTERN or BS_DIBPATTERN: but there's no difference */
TRACE(metafile,"%d\n",*(mr->rdParam)); TRACE(metafile,"%d\n",*(mr->rdParm));
s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2; s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2;
hndl = GlobalAlloc16(GMEM_MOVEABLE, s1); hndl = GlobalAlloc16(GMEM_MOVEABLE, s1);
ptr = GlobalLock16(hndl); ptr = GlobalLock16(hndl);
memcpy(ptr, mr->rdParam + 2, s1); memcpy(ptr, mr->rdParm + 2, s1);
GlobalUnlock16(hndl); GlobalUnlock16(hndl);
MF_AddHandle(ht, nHandles,CreateDIBPatternBrush16(hndl, *(mr->rdParam + 1))); MF_AddHandle(ht, nHandles,CreateDIBPatternBrush16(hndl, *(mr->rdParm + 1)));
GlobalFree16(hndl); GlobalFree16(hndl);
break; break;
case META_DIBBITBLT: case META_DIBBITBLT:
{ {
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[8]); LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[8]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[0] ); LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[0] );
StretchDIBits16(hdc,mr->rdParam[7],mr->rdParam[6],mr->rdParam[5], StretchDIBits16(hdc,mr->rdParm[7],mr->rdParm[6],mr->rdParm[5],
mr->rdParam[4],mr->rdParam[3],mr->rdParam[2], mr->rdParm[4],mr->rdParm[3],mr->rdParm[2],
mr->rdParam[5],mr->rdParam[4],bits,info, mr->rdParm[5],mr->rdParm[4],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1])); DIB_RGB_COLORS,MAKELONG(mr->rdParm[0],mr->rdParm[1]));
} }
break; break;
case META_SETTEXTCHAREXTRA: case META_SETTEXTCHAREXTRA:
SetTextCharacterExtra16(hdc, (INT16)*(mr->rdParam)); SetTextCharacterExtra16(hdc, (INT16)*(mr->rdParm));
break; break;
case META_SETTEXTJUSTIFICATION: case META_SETTEXTJUSTIFICATION:
SetTextJustification32(hdc, *(mr->rdParam + 1), *(mr->rdParam)); SetTextJustification32(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break; break;
#define META_UNIMP(x) case x: FIXME(metafile, "PlayMetaFileRecord:record type "#x" not implemented.\n");break; #define META_UNIMP(x) case x: FIXME(metafile, "PlayMetaFileRecord:record type "#x" not implemented.\n");break;
@ -1089,7 +1089,7 @@ UINT32 WINAPI GetWinMetaFileBits(HENHMETAFILE32 hemf,
/* /*
* The layout of the record looks something like this: * The layout of the record looks something like this:
* *
* rdParam meaning * rdParm meaning
* 0 Always 0? * 0 Always 0?
* 1 Always 6? * 1 Always 6?
* 2 Looks like a handle? - not constant * 2 Looks like a handle? - not constant
@ -1104,7 +1104,7 @@ UINT32 WINAPI GetWinMetaFileBits(HENHMETAFILE32 hemf,
* y-direction. Each band consists of pairs of on/off x-coords and is * y-direction. Each band consists of pairs of on/off x-coords and is
* written as * written as
* m y0 y1 x1 x2 x3 ... xm m * m y0 y1 x1 x2 x3 ... xm m
* into successive rdParam[]s. * into successive rdParm[]s.
* *
* This is probably just a dump of the internal RGNOBJ? * This is probably just a dump of the internal RGNOBJ?
* *
@ -1119,7 +1119,7 @@ static BOOL32 MF_Meta_CreateRegion( METARECORD *mr, HRGN32 hrgn )
INT16 y0, y1; INT16 y0, y1;
HRGN32 hrgn2 = CreateRectRgn32( 0, 0, 0, 0 ); HRGN32 hrgn2 = CreateRectRgn32( 0, 0, 0, 0 );
for(band = 0, start = &(mr->rdParam[11]); band < mr->rdParam[5]; for(band = 0, start = &(mr->rdParm[11]); band < mr->rdParm[5];
band++, start = end + 1) { band++, start = end + 1) {
if(*start / 2 != (*start + 1) / 2) { if(*start / 2 != (*start + 1) / 2) {
WARN(metafile, "Delimiter not even.\n"); WARN(metafile, "Delimiter not even.\n");
@ -1215,7 +1215,7 @@ BOOL32 MF_MetaParam1(DC *dc, short func, short param1)
mr->rdSize = 4; mr->rdSize = 4;
mr->rdFunction = func; mr->rdFunction = func;
*(mr->rdParam) = param1; *(mr->rdParm) = param1;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1230,8 +1230,8 @@ BOOL32 MF_MetaParam2(DC *dc, short func, short param1, short param2)
mr->rdSize = 5; mr->rdSize = 5;
mr->rdFunction = func; mr->rdFunction = func;
*(mr->rdParam) = param2; *(mr->rdParm) = param2;
*(mr->rdParam + 1) = param1; *(mr->rdParm + 1) = param1;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1248,10 +1248,10 @@ BOOL32 MF_MetaParam4(DC *dc, short func, short param1, short param2,
mr->rdSize = 7; mr->rdSize = 7;
mr->rdFunction = func; mr->rdFunction = func;
*(mr->rdParam) = param4; *(mr->rdParm) = param4;
*(mr->rdParam + 1) = param3; *(mr->rdParm + 1) = param3;
*(mr->rdParam + 2) = param2; *(mr->rdParm + 2) = param2;
*(mr->rdParam + 3) = param1; *(mr->rdParm + 3) = param1;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1268,12 +1268,12 @@ BOOL32 MF_MetaParam6(DC *dc, short func, short param1, short param2,
mr->rdSize = 9; mr->rdSize = 9;
mr->rdFunction = func; mr->rdFunction = func;
*(mr->rdParam) = param6; *(mr->rdParm) = param6;
*(mr->rdParam + 1) = param5; *(mr->rdParm + 1) = param5;
*(mr->rdParam + 2) = param4; *(mr->rdParm + 2) = param4;
*(mr->rdParam + 3) = param3; *(mr->rdParm + 3) = param3;
*(mr->rdParam + 4) = param2; *(mr->rdParm + 4) = param2;
*(mr->rdParam + 5) = param1; *(mr->rdParm + 5) = param1;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1290,14 +1290,14 @@ BOOL32 MF_MetaParam8(DC *dc, short func, short param1, short param2,
mr->rdSize = 11; mr->rdSize = 11;
mr->rdFunction = func; mr->rdFunction = func;
*(mr->rdParam) = param8; *(mr->rdParm) = param8;
*(mr->rdParam + 1) = param7; *(mr->rdParm + 1) = param7;
*(mr->rdParam + 2) = param6; *(mr->rdParm + 2) = param6;
*(mr->rdParam + 3) = param5; *(mr->rdParm + 3) = param5;
*(mr->rdParam + 4) = param4; *(mr->rdParm + 4) = param4;
*(mr->rdParam + 5) = param3; *(mr->rdParm + 5) = param3;
*(mr->rdParam + 6) = param2; *(mr->rdParm + 6) = param2;
*(mr->rdParam + 7) = param1; *(mr->rdParm + 7) = param1;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1314,14 +1314,14 @@ BOOL32 MF_CreateBrushIndirect(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
mr->rdSize = (sizeof(METARECORD) + sizeof(*logbrush) - 2) / 2; mr->rdSize = (sizeof(METARECORD) + sizeof(*logbrush) - 2) / 2;
mr->rdFunction = META_CREATEBRUSHINDIRECT; mr->rdFunction = META_CREATEBRUSHINDIRECT;
memcpy(&(mr->rdParam), logbrush, sizeof(*logbrush)); memcpy(&(mr->rdParm), logbrush, sizeof(*logbrush));
if (!(MF_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE; if (!(MF_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE;
mr->rdSize = sizeof(METARECORD) / 2; mr->rdSize = sizeof(METARECORD) / 2;
mr->rdFunction = META_SELECTOBJECT; mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE; if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index; *(mr->rdParm) = index;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1357,15 +1357,15 @@ BOOL32 MF_CreatePatternBrush(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
memset(mr, 0, len); memset(mr, 0, len);
mr->rdFunction = META_DIBCREATEPATTERNBRUSH; mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
mr->rdSize = len / 2; mr->rdSize = len / 2;
*(mr->rdParam) = logbrush->lbStyle; *(mr->rdParm) = logbrush->lbStyle;
*(mr->rdParam + 1) = DIB_RGB_COLORS; *(mr->rdParm + 1) = DIB_RGB_COLORS;
infohdr = (BITMAPINFOHEADER *)(mr->rdParam + 2); infohdr = (BITMAPINFOHEADER *)(mr->rdParm + 2);
infohdr->biSize = sizeof(BITMAPINFOHEADER); infohdr->biSize = sizeof(BITMAPINFOHEADER);
infohdr->biWidth = bmp->bitmap.bmWidth; infohdr->biWidth = bmp->bitmap.bmWidth;
infohdr->biHeight = bmp->bitmap.bmHeight; infohdr->biHeight = bmp->bitmap.bmHeight;
infohdr->biPlanes = bmp->bitmap.bmPlanes; infohdr->biPlanes = bmp->bitmap.bmPlanes;
infohdr->biBitCount = bmp->bitmap.bmBitsPixel; infohdr->biBitCount = bmp->bitmap.bmBitsPixel;
memcpy(mr->rdParam + (sizeof(BITMAPINFOHEADER) / 2) + 4, memcpy(mr->rdParm + (sizeof(BITMAPINFOHEADER) / 2) + 4,
PTR_SEG_TO_LIN(bmp->bitmap.bmBits), PTR_SEG_TO_LIN(bmp->bitmap.bmBits),
bmp->bitmap.bmHeight * bmp->bitmap.bmWidthBytes); bmp->bitmap.bmHeight * bmp->bitmap.bmWidthBytes);
GDI_HEAP_UNLOCK(logbrush->lbHatch); GDI_HEAP_UNLOCK(logbrush->lbHatch);
@ -1386,9 +1386,9 @@ BOOL32 MF_CreatePatternBrush(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
memset(mr, 0, len); memset(mr, 0, len);
mr->rdFunction = META_DIBCREATEPATTERNBRUSH; mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
mr->rdSize = len / 2; mr->rdSize = len / 2;
*(mr->rdParam) = logbrush->lbStyle; *(mr->rdParm) = logbrush->lbStyle;
*(mr->rdParam + 1) = LOWORD(logbrush->lbColor); *(mr->rdParm + 1) = LOWORD(logbrush->lbColor);
memcpy(mr->rdParam + 2, info, biSize + bmSize); memcpy(mr->rdParm + 2, info, biSize + bmSize);
break; break;
default: default:
return FALSE; return FALSE;
@ -1406,7 +1406,7 @@ BOOL32 MF_CreatePatternBrush(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
mr->rdFunction = META_SELECTOBJECT; mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE; if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index; *(mr->rdParm) = index;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1423,14 +1423,14 @@ BOOL32 MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN16 *logpen)
mr->rdSize = (sizeof(METARECORD) + sizeof(*logpen) - 2) / 2; mr->rdSize = (sizeof(METARECORD) + sizeof(*logpen) - 2) / 2;
mr->rdFunction = META_CREATEPENINDIRECT; mr->rdFunction = META_CREATEPENINDIRECT;
memcpy(&(mr->rdParam), logpen, sizeof(*logpen)); memcpy(&(mr->rdParm), logpen, sizeof(*logpen));
if (!(MF_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE; if (!(MF_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE;
mr->rdSize = sizeof(METARECORD) / 2; mr->rdSize = sizeof(METARECORD) / 2;
mr->rdFunction = META_SELECTOBJECT; mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE; if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index; *(mr->rdParm) = index;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1447,14 +1447,14 @@ BOOL32 MF_CreateFontIndirect(DC *dc, HFONT16 hFont, LOGFONT16 *logfont)
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGFONT16) - 2) / 2; mr->rdSize = (sizeof(METARECORD) + sizeof(LOGFONT16) - 2) / 2;
mr->rdFunction = META_CREATEFONTINDIRECT; mr->rdFunction = META_CREATEFONTINDIRECT;
memcpy(&(mr->rdParam), logfont, sizeof(LOGFONT16)); memcpy(&(mr->rdParm), logfont, sizeof(LOGFONT16));
if (!(MF_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE; if (!(MF_WriteRecord( dc, mr, mr->rdSize * 2))) return FALSE;
mr->rdSize = sizeof(METARECORD) / 2; mr->rdSize = sizeof(METARECORD) / 2;
mr->rdFunction = META_SELECTOBJECT; mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE; if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index; *(mr->rdParm) = index;
return MF_WriteRecord( dc, mr, mr->rdSize * 2); return MF_WriteRecord( dc, mr, mr->rdSize * 2);
} }
@ -1477,10 +1477,10 @@ BOOL32 MF_TextOut(DC *dc, short x, short y, LPCSTR str, short count)
mr->rdSize = len / 2; mr->rdSize = len / 2;
mr->rdFunction = META_TEXTOUT; mr->rdFunction = META_TEXTOUT;
*(mr->rdParam) = count; *(mr->rdParm) = count;
memcpy(mr->rdParam + 1, str, count); memcpy(mr->rdParm + 1, str, count);
*(mr->rdParam + ((count + 1) >> 1) + 1) = y; *(mr->rdParm + ((count + 1) >> 1) + 1) = y;
*(mr->rdParam + ((count + 1) >> 1) + 2) = x; *(mr->rdParm + ((count + 1) >> 1) + 2) = x;
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2); ret = MF_WriteRecord( dc, mr, mr->rdSize * 2);
GlobalFree16(hmr); GlobalFree16(hmr);
return ret; return ret;
@ -1512,14 +1512,14 @@ BOOL32 MF_ExtTextOut(DC*dc, short x, short y, UINT16 flags, const RECT16 *rect,
mr->rdSize = len / 2; mr->rdSize = len / 2;
mr->rdFunction = META_EXTTEXTOUT; mr->rdFunction = META_EXTTEXTOUT;
*(mr->rdParam) = y; *(mr->rdParm) = y;
*(mr->rdParam + 1) = x; *(mr->rdParm + 1) = x;
*(mr->rdParam + 2) = count; *(mr->rdParm + 2) = count;
*(mr->rdParam + 3) = flags; *(mr->rdParm + 3) = flags;
if (rect) memcpy(mr->rdParam + 4, rect, sizeof(RECT16)); if (rect) memcpy(mr->rdParm + 4, rect, sizeof(RECT16));
memcpy(mr->rdParam + (rect ? 8 : 4), str, count); memcpy(mr->rdParm + (rect ? 8 : 4), str, count);
if (lpDx) if (lpDx)
memcpy(mr->rdParam + (rect ? 8 : 4) + ((count + 1) >> 1),lpDx, memcpy(mr->rdParm + (rect ? 8 : 4) + ((count + 1) >> 1),lpDx,
count*sizeof(INT16)); count*sizeof(INT16));
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2); ret = MF_WriteRecord( dc, mr, mr->rdSize * 2);
GlobalFree16(hmr); GlobalFree16(hmr);
@ -1544,8 +1544,8 @@ BOOL32 MF_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
mr->rdSize = len / 2; mr->rdSize = len / 2;
mr->rdFunction = func; mr->rdFunction = func;
*(mr->rdParam) = count; *(mr->rdParm) = count;
memcpy(mr->rdParam + 1, pt, count * 4); memcpy(mr->rdParm + 1, pt, count * 4);
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2); ret = MF_WriteRecord( dc, mr, mr->rdSize * 2);
GlobalFree16(hmr); GlobalFree16(hmr);
return ret; return ret;
@ -1570,23 +1570,23 @@ BOOL32 MF_BitBlt(DC *dcDest, short xDest, short yDest, short width,
return FALSE; return FALSE;
mr = (METARECORD *)GlobalLock16(hmr); mr = (METARECORD *)GlobalLock16(hmr);
mr->rdFunction = META_BITBLT; mr->rdFunction = META_BITBLT;
*(mr->rdParam + 7) = BM.bmWidth; *(mr->rdParm + 7) = BM.bmWidth;
*(mr->rdParam + 8) = BM.bmHeight; *(mr->rdParm + 8) = BM.bmHeight;
*(mr->rdParam + 9) = BM.bmWidthBytes; *(mr->rdParm + 9) = BM.bmWidthBytes;
*(mr->rdParam +10) = BM.bmPlanes; *(mr->rdParm +10) = BM.bmPlanes;
*(mr->rdParam +11) = BM.bmBitsPixel; *(mr->rdParm +11) = BM.bmBitsPixel;
TRACE(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop); TRACE(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop);
if (GetBitmapBits32(dcSrc->w.hBitmap,BM.bmWidthBytes * BM.bmHeight, if (GetBitmapBits32(dcSrc->w.hBitmap,BM.bmWidthBytes * BM.bmHeight,
mr->rdParam +12)) mr->rdParm +12))
{ {
mr->rdSize = len / sizeof(INT16); mr->rdSize = len / sizeof(INT16);
*(mr->rdParam) = HIWORD(rop); *(mr->rdParm) = HIWORD(rop);
*(mr->rdParam + 1) = ySrc; *(mr->rdParm + 1) = ySrc;
*(mr->rdParam + 2) = xSrc; *(mr->rdParm + 2) = xSrc;
*(mr->rdParam + 3) = height; *(mr->rdParm + 3) = height;
*(mr->rdParam + 4) = width; *(mr->rdParm + 4) = width;
*(mr->rdParam + 5) = yDest; *(mr->rdParm + 5) = yDest;
*(mr->rdParam + 6) = xDest; *(mr->rdParm + 6) = xDest;
ret = MF_WriteRecord( dcDest, mr, mr->rdSize * 2); ret = MF_WriteRecord( dcDest, mr, mr->rdSize * 2);
} }
else else
@ -1627,7 +1627,7 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
return FALSE; return FALSE;
mr = (METARECORD *)GlobalLock16(hmr); mr = (METARECORD *)GlobalLock16(hmr);
mr->rdFunction = META_DIBSTRETCHBLT; mr->rdFunction = META_DIBSTRETCHBLT;
lpBMI=(LPBITMAPINFOHEADER)(mr->rdParam+10); lpBMI=(LPBITMAPINFOHEADER)(mr->rdParm+10);
lpBMI->biSize = sizeof(BITMAPINFOHEADER); lpBMI->biSize = sizeof(BITMAPINFOHEADER);
lpBMI->biWidth = BM.bmWidth; lpBMI->biWidth = BM.bmWidth;
lpBMI->biHeight = BM.bmHeight; lpBMI->biHeight = BM.bmHeight;
@ -1652,27 +1652,27 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
return FALSE; return FALSE;
mr = (METARECORD *)GlobalLock16(hmr); mr = (METARECORD *)GlobalLock16(hmr);
mr->rdFunction = META_STRETCHBLT; mr->rdFunction = META_STRETCHBLT;
*(mr->rdParam +10) = BM.bmWidth; *(mr->rdParm +10) = BM.bmWidth;
*(mr->rdParam +11) = BM.bmHeight; *(mr->rdParm +11) = BM.bmHeight;
*(mr->rdParam +12) = BM.bmWidthBytes; *(mr->rdParm +12) = BM.bmWidthBytes;
*(mr->rdParam +13) = BM.bmPlanes; *(mr->rdParm +13) = BM.bmPlanes;
*(mr->rdParam +14) = BM.bmBitsPixel; *(mr->rdParm +14) = BM.bmBitsPixel;
TRACE(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop); TRACE(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop);
if (GetBitmapBits32( dcSrc->w.hBitmap, BM.bmWidthBytes * BM.bmHeight, if (GetBitmapBits32( dcSrc->w.hBitmap, BM.bmWidthBytes * BM.bmHeight,
mr->rdParam +15)) mr->rdParm +15))
#endif #endif
{ {
mr->rdSize = len / sizeof(INT16); mr->rdSize = len / sizeof(INT16);
*(mr->rdParam) = LOWORD(rop); *(mr->rdParm) = LOWORD(rop);
*(mr->rdParam + 1) = HIWORD(rop); *(mr->rdParm + 1) = HIWORD(rop);
*(mr->rdParam + 2) = heightSrc; *(mr->rdParm + 2) = heightSrc;
*(mr->rdParam + 3) = widthSrc; *(mr->rdParm + 3) = widthSrc;
*(mr->rdParam + 4) = ySrc; *(mr->rdParm + 4) = ySrc;
*(mr->rdParam + 5) = xSrc; *(mr->rdParm + 5) = xSrc;
*(mr->rdParam + 6) = heightDest; *(mr->rdParm + 6) = heightDest;
*(mr->rdParam + 7) = widthDest; *(mr->rdParm + 7) = widthDest;
*(mr->rdParam + 8) = yDest; *(mr->rdParm + 8) = yDest;
*(mr->rdParam + 9) = xDest; *(mr->rdParm + 9) = xDest;
ret = MF_WriteRecord( dcDest, mr, mr->rdSize * 2); ret = MF_WriteRecord( dcDest, mr, mr->rdSize * 2);
} }
else else
@ -1714,7 +1714,7 @@ INT16 MF_CreateRegion(DC *dc, HRGN32 hrgn)
memset(mr, 0, len); memset(mr, 0, len);
Param = mr->rdParam + 11; Param = mr->rdParm + 11;
StartBand = NULL; StartBand = NULL;
pEndRect = (RECT32 *)rgndata->Buffer + rgndata->rdh.nCount; pEndRect = (RECT32 *)rgndata->Buffer + rgndata->rdh.nCount;
@ -1744,17 +1744,17 @@ INT16 MF_CreateRegion(DC *dc, HRGN32 hrgn)
} }
len = Param - (WORD *)mr; len = Param - (WORD *)mr;
mr->rdParam[0] = 0; mr->rdParm[0] = 0;
mr->rdParam[1] = 6; mr->rdParm[1] = 6;
mr->rdParam[2] = 0x1234; mr->rdParm[2] = 0x1234;
mr->rdParam[3] = 0; mr->rdParm[3] = 0;
mr->rdParam[4] = len * 2; mr->rdParm[4] = len * 2;
mr->rdParam[5] = Bands; mr->rdParm[5] = Bands;
mr->rdParam[6] = MaxBands; mr->rdParm[6] = MaxBands;
mr->rdParam[7] = rgndata->rdh.rcBound.left; mr->rdParm[7] = rgndata->rdh.rcBound.left;
mr->rdParam[8] = rgndata->rdh.rcBound.top; mr->rdParm[8] = rgndata->rdh.rcBound.top;
mr->rdParam[9] = rgndata->rdh.rcBound.right; mr->rdParm[9] = rgndata->rdh.rcBound.right;
mr->rdParam[10] = rgndata->rdh.rcBound.bottom; mr->rdParm[10] = rgndata->rdh.rcBound.bottom;
mr->rdFunction = META_CREATEREGION; mr->rdFunction = META_CREATEREGION;
mr->rdSize = len / 2; mr->rdSize = len / 2;
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2 ); ret = MF_WriteRecord( dc, mr, mr->rdSize * 2 );

View File

@ -56,7 +56,7 @@ type win32
0052 stub GetSecurityDescriptorControl 0052 stub GetSecurityDescriptorControl
0053 stub GetSecurityDescriptorDacl 0053 stub GetSecurityDescriptorDacl
0054 stub GetSecurityDescriptorGroup 0054 stub GetSecurityDescriptorGroup
0055 stub GetSecurityDescriptorLength 0055 stdcall GetSecurityDescriptorLength(ptr) GetSecurityDescriptorLength
0056 stub GetSecurityDescriptorOwner 0056 stub GetSecurityDescriptorOwner
0057 stub GetSecurityDescriptorSacl 0057 stub GetSecurityDescriptorSacl
0058 stub GetServiceDisplayNameA 0058 stub GetServiceDisplayNameA

View File

@ -7,17 +7,17 @@ init MAIN_GdiInit
2 stdcall AddFontResourceA(str) AddFontResource32A 2 stdcall AddFontResourceA(str) AddFontResource32A
3 stub AddFontResourceTracking 3 stub AddFontResourceTracking
4 stdcall AddFontResourceW(wstr) AddFontResource32W 4 stdcall AddFontResourceW(wstr) AddFontResource32W
5 stdcall AngleArc(long long long long long long) AngleArc32 5 stdcall AngleArc(long long long long long long) AngleArc
6 stdcall AnimatePalette(long long long ptr) AnimatePalette32 6 stdcall AnimatePalette(long long long ptr) AnimatePalette32
7 stdcall Arc(long long long long long long long long long) Arc32 7 stdcall Arc(long long long long long long long long long) Arc32
8 stdcall ArcTo(long long long long long long long long long) ArcTo32 8 stdcall ArcTo(long long long long long long long long long) ArcTo
9 stdcall BeginPath(long) BeginPath32 9 stdcall BeginPath(long) BeginPath32
10 stdcall BitBlt(long long long long long long long long long) BitBlt32 10 stdcall BitBlt(long long long long long long long long long) BitBlt32
11 stub CancelDC 11 stub CancelDC
12 stub CheckColorsInGamut 12 stub CheckColorsInGamut
13 stdcall ChoosePixelFormat(long ptr) ChoosePixelFormat 13 stdcall ChoosePixelFormat(long ptr) ChoosePixelFormat
14 stdcall Chord(long long long long long long long long long) Chord32 14 stdcall Chord(long long long long long long long long long) Chord32
15 stdcall CloseEnhMetaFile(long) CloseEnhMetaFile32 15 stdcall CloseEnhMetaFile(long) CloseEnhMetaFile
16 stdcall CloseFigure(long) CloseFigure32 16 stdcall CloseFigure(long) CloseFigure32
17 stdcall CloseMetaFile(long) CloseMetaFile32 17 stdcall CloseMetaFile(long) CloseMetaFile32
18 stub ColorMatchToTarget 18 stub ColorMatchToTarget
@ -76,7 +76,7 @@ init MAIN_GdiInit
71 stdcall DescribePixelFormat(long long long ptr) DescribePixelFormat 71 stdcall DescribePixelFormat(long long long ptr) DescribePixelFormat
72 stub DeviceCapabilitiesExA 72 stub DeviceCapabilitiesExA
73 stub DeviceCapabilitiesExW 73 stub DeviceCapabilitiesExW
74 stdcall DrawEscape(long long long ptr) DrawEscape32 74 stdcall DrawEscape(long long long ptr) DrawEscape
75 stdcall Ellipse(long long long long long) Ellipse32 75 stdcall Ellipse(long long long long long) Ellipse32
76 stdcall EndDoc(long) EndDoc32 76 stdcall EndDoc(long) EndDoc32
77 stdcall EndPage(long) EndPage32 77 stdcall EndPage(long) EndPage32
@ -97,7 +97,7 @@ init MAIN_GdiInit
92 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32 92 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32
93 stdcall ExtCreatePen(long long ptr long ptr) ExtCreatePen32 93 stdcall ExtCreatePen(long long ptr long ptr) ExtCreatePen32
94 stdcall ExtCreateRegion(ptr long ptr) ExtCreateRegion 94 stdcall ExtCreateRegion(ptr long ptr) ExtCreateRegion
95 stdcall ExtEscape(long long long ptr long ptr) ExtEscape32 95 stdcall ExtEscape(long long long ptr long ptr) ExtEscape
96 stdcall ExtFloodFill(long long long long long) ExtFloodFill32 96 stdcall ExtFloodFill(long long long long long) ExtFloodFill32
97 stdcall ExtSelectClipRgn(long long long) ExtSelectClipRgn 97 stdcall ExtSelectClipRgn(long long long) ExtSelectClipRgn
98 stdcall ExtTextOutA(long long long long ptr str long ptr) ExtTextOut32A 98 stdcall ExtTextOutA(long long long long ptr str long ptr) ExtTextOut32A
@ -111,7 +111,7 @@ init MAIN_GdiInit
106 stub FreeImageColorMatcher 106 stub FreeImageColorMatcher
107 stub GdiAssociateObject 107 stub GdiAssociateObject
108 stub GdiCleanCacheDC 108 stub GdiCleanCacheDC
109 stdcall GdiComment(long long ptr) GdiComment32 109 stdcall GdiComment(long long ptr) GdiComment
110 stub GdiConvertAndCheckDC 110 stub GdiConvertAndCheckDC
111 stub GdiConvertBitmap 111 stub GdiConvertBitmap
112 stub GdiConvertBrush 112 stub GdiConvertBrush
@ -166,7 +166,7 @@ init MAIN_GdiInit
161 stdcall GetCharacterPlacementW(long wstr long long ptr long) GetCharacterPlacement32W 161 stdcall GetCharacterPlacementW(long wstr long long ptr long) GetCharacterPlacement32W
162 stdcall GetClipBox(long ptr) GetClipBox32 162 stdcall GetClipBox(long ptr) GetClipBox32
163 stdcall GetClipRgn(long long) GetClipRgn32 163 stdcall GetClipRgn(long long) GetClipRgn32
164 stdcall GetColorAdjustment(long ptr) GetColorAdjustment32 164 stdcall GetColorAdjustment(long ptr) GetColorAdjustment
165 stdcall GetColorSpace(long) GetColorSpace 165 stdcall GetColorSpace(long) GetColorSpace
166 stdcall GetCurrentObject(long long) GetCurrentObject 166 stdcall GetCurrentObject(long long) GetCurrentObject
167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32 167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
@ -274,7 +274,7 @@ init MAIN_GdiInit
269 stdcall PolyBezierTo(long ptr long) PolyBezierTo32 269 stdcall PolyBezierTo(long ptr long) PolyBezierTo32
270 stdcall PolyDraw(long ptr ptr long) PolyDraw 270 stdcall PolyDraw(long ptr ptr long) PolyDraw
271 stdcall PolyPolygon(long ptr ptr long) PolyPolygon32 271 stdcall PolyPolygon(long ptr ptr long) PolyPolygon32
272 stdcall PolyPolyline(long ptr ptr long) PolyPolyline32 272 stdcall PolyPolyline(long ptr ptr long) PolyPolyline
273 stub PolyTextOutA 273 stub PolyTextOutA
274 stub PolyTextOutW 274 stub PolyTextOutW
275 stdcall Polygon(long ptr long) Polygon32 275 stdcall Polygon(long ptr long) Polygon32

View File

@ -906,7 +906,7 @@ init MAIN_KernelInit
887 stub SetConsoleIcon 887 stub SetConsoleIcon
888 stub SetConsoleInputExeNameA 888 stub SetConsoleInputExeNameA
889 stub SetConsoleInputExeNameW 889 stub SetConsoleInputExeNameW
890 stub SetProcessAffinityMask 890 stdcall SetProcessAffinityMask(long long) SetProcessAffinityMask
891 stdcall SetProcessPriorityBoost(long long) SetProcessPriorityBoost 891 stdcall SetProcessPriorityBoost(long long) SetProcessPriorityBoost
892 stub SetThreadIdealProcessor 892 stub SetThreadIdealProcessor
893 stub SetThreadPriorityBoost 893 stub SetThreadPriorityBoost

View File

@ -866,7 +866,7 @@ type win32
858 stub __eFYL2X 858 stub __eFYL2X
859 stub __eFYL2XP1 859 stub __eFYL2XP1
860 stub __eGetStatusWord 860 stub __eGetStatusWord
861 stub _alloca_probe 861 register _alloca_probe() NTDLL_alloca_probe
862 register _chkstk() NTDLL_chkstk 862 register _chkstk() NTDLL_chkstk
863 stub _fltused 863 stub _fltused
864 cdecl _ftol(double) CRTDLL__ftol 864 cdecl _ftol(double) CRTDLL__ftol

View File

@ -127,7 +127,7 @@ init Shell32LibMain
119 stdcall IsLFNDrive(str) IsLFNDrive32A 119 stdcall IsLFNDrive(str) IsLFNDrive32A
120 stub FileMenu_AbortInitMenu 120 stub FileMenu_AbortInitMenu
121 stdcall SHFlushClipboard () SHFlushClipboard 121 stdcall SHFlushClipboard () SHFlushClipboard
122 stub RunDLL_CallEntry16 122 stdcall RunDLL_CallEntry16 (long long long long long) RunDLL_CallEntry16 #name wrong?
123 stdcall SHFreeUnusedLibraries () SHFreeUnusedLibraries 123 stdcall SHFreeUnusedLibraries () SHFreeUnusedLibraries
124 stub FileMenu_AppendFilesForPidl 124 stub FileMenu_AppendFilesForPidl
125 stub FileMenu_AddFilesForPidl 125 stub FileMenu_AddFilesForPidl
@ -180,14 +180,14 @@ init Shell32LibMain
172 stub SHCreateLinks 172 stub SHCreateLinks
173 stub SHValidateUNC 173 stub SHValidateUNC
174 stdcall SHCreateShellFolderViewEx (ptr ptr) SHCreateShellFolderViewEx32 174 stdcall SHCreateShellFolderViewEx (ptr ptr) SHCreateShellFolderViewEx32
175 stdcall SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPath 175 stdcall SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPath32
176 stdcall SHSetInstanceExplorer (long) SHSetInstanceExplorer 176 stdcall SHSetInstanceExplorer (long) SHSetInstanceExplorer
177 stub DAD_SetDragImageFromListView 177 stub DAD_SetDragImageFromListView
178 stub SHObjectProperties 178 stub SHObjectProperties
179 stub SHGetNewLinkInfoA 179 stub SHGetNewLinkInfoA
180 stub SHGetNewLinkInfoW 180 stub SHGetNewLinkInfoW
181 stdcall RegisterShellHook(long long) RegisterShellHook32 181 stdcall RegisterShellHook(long long) RegisterShellHook32
182 stub ShellMessageBoxW 182 cdecl ShellMessageBoxW(long long long str long long) ShellMessageBoxW
183 cdecl ShellMessageBoxA(long long long str long long) ShellMessageBoxA 183 cdecl ShellMessageBoxA(long long long str long long) ShellMessageBoxA
184 stdcall ArrangeWindows(long long long long long) ArrangeWindows 184 stdcall ArrangeWindows(long long long long long) ArrangeWindows
185 stub SHHandleDiskFull 185 stub SHHandleDiskFull
@ -375,5 +375,5 @@ init Shell32LibMain
1217 stub FOOBAR1217 # no joke! This is the real name!! 1217 stub FOOBAR1217 # no joke! This is the real name!!
# later additions ... FIXME: incorrect ordinals # later additions ... FIXME: incorrect ordinals
1218 stdcall SHGetSpecialFolderPathA(long long long long) SHGetSpecialFolderPath 1218 stdcall SHGetSpecialFolderPathA(long ptr long long) SHGetSpecialFolderPath32A
1219 stub DoEnvironmentSubstW 1219 stub DoEnvironmentSubstW

View File

@ -720,6 +720,15 @@ DWORD WINAPI GetProcessFlags( DWORD processid )
return pdb->flags; return pdb->flags;
} }
/***********************************************************************
* SetProcessAffinityMask [KERNEL32.662]
*/
BOOL32 WINAPI SetProcessAffinityMask(HANDLE32 hProcess,DWORD affmask)
{
FIXME(process,"(0x%08x,%ld), stub - harmless\n",hProcess,affmask);
return TRUE;
}
/*********************************************************************** /***********************************************************************
* SetProcessWorkingSetSize [KERNEL32.662] * SetProcessWorkingSetSize [KERNEL32.662]
* Sets the min/max working set sizes for a specified process. * Sets the min/max working set sizes for a specified process.

View File

@ -186,3 +186,22 @@ DWORD WINAPI WIN16_WaitForMultipleObjects( DWORD count, const HANDLE32 *handles,
return retval; return retval;
} }
/***********************************************************************
* WIN16_WaitForMultipleObjectsEx (KERNEL.495)
*/
DWORD WINAPI WIN16_WaitForMultipleObjectsEx( DWORD count,
const HANDLE32 *handles,
BOOL32 wait_all, DWORD timeout,
BOOL32 alertable )
{
DWORD retval;
SYSLEVEL_ReleaseWin16Lock();
retval = WaitForMultipleObjectsEx( count, handles,
wait_all, timeout, alertable );
SYSLEVEL_RestoreWin16Lock();
return retval;
}

View File

@ -506,48 +506,23 @@ BOOL32 WINAPI FreeConsole(VOID)
static int CONSOLE_openpty(CONSOLE *console, char *name, static int CONSOLE_openpty(CONSOLE *console, char *name,
struct termios *term, struct winsize *winsize) struct termios *term, struct winsize *winsize)
{ {
int fdm, fds; int temp, slave;
char *ptr1, *ptr2;
char pts_name[512];
struct set_console_fd_request req; struct set_console_fd_request req;
strcpy (pts_name, "/dev/ptyXY"); temp = wine_openpty(&console->master, &slave, name, term,
winsize);
console->infd = console->outfd = slave;
for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1 != 0; ptr1++) {
pts_name[8] = *ptr1;
for (ptr2 = "0123456789abcdef"; *ptr2 != 0; ptr2++) {
pts_name[9] = *ptr2;
if ((fdm = open(pts_name, O_RDWR)) < 0) {
if (errno == ENOENT)
return -1;
else
continue;
}
pts_name[5] = 't';
if ((fds = open(pts_name, O_RDWR)) < 0) {
pts_name[5] = 'p';
continue;
}
console->master = fdm;
console->infd = console->outfd = fds;
req.handle = console->hread; req.handle = console->hread;
CLIENT_SendRequest( REQ_SET_CONSOLE_FD, dup(fds), 1, &req, sizeof(req) ); CLIENT_SendRequest(REQ_SET_CONSOLE_FD, dup(slave), 1,
&req, sizeof(req));
CLIENT_WaitReply( NULL, NULL, 0); CLIENT_WaitReply( NULL, NULL, 0);
req.handle = console->hwrite; req.handle = console->hwrite;
CLIENT_SendRequest( REQ_SET_CONSOLE_FD, dup(fds), 1, &req, sizeof(req) ); CLIENT_SendRequest( REQ_SET_CONSOLE_FD, dup(slave), 1,
&req, sizeof(req));
CLIENT_WaitReply( NULL, NULL, 0); CLIENT_WaitReply( NULL, NULL, 0);
if (term != NULL) return temp; /* The same result as the openpty call */
tcsetattr(console->infd, TCSANOW, term);
if (winsize != NULL)
ioctl(console->outfd, TIOCSWINSZ, winsize);
if (name != NULL)
strcpy(name, pts_name);
return fds;
}
}
return -1;
} }
/************************************************************************* /*************************************************************************

View File

@ -969,7 +969,7 @@ BOOL16 WINAPI IsPeFormat(
HFILE16 hf16 /* [in] open file, if filename is NULL */ HFILE16 hf16 /* [in] open file, if filename is NULL */
) { ) {
IMAGE_DOS_HEADER mzh; IMAGE_DOS_HEADER mzh;
HFILE32 hf=HFILE16_TO_HFILE32(hf16); HFILE32 hf=FILE_GetHandle32(hf16);
OFSTRUCT ofs; OFSTRUCT ofs;
DWORD xmagic; DWORD xmagic;

View File

@ -300,7 +300,7 @@ BOOL32 WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent,
DWORD dwMilliseconds ) DWORD dwMilliseconds )
{ {
FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds); FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds);
return TRUE; return FALSE;
} }

View File

@ -443,8 +443,10 @@ static HRESULT WINAPI IDirectInputDeviceA_EnumObjects(
DWORD dwFlags) DWORD dwFlags)
{ {
FIXME(dinput, "stub!\n"); FIXME(dinput, "stub!\n");
#if 0
if (lpCallback) if (lpCallback)
lpCallback(NULL, lpvRef); lpCallback(NULL, lpvRef);
#endif
return DI_OK; return DI_OK;
} }

View File

@ -1777,6 +1777,10 @@ INT32 WINPROC_MapMsg32ATo16( HWND32 hwnd, UINT32 msg32, WPARAM32 wParam32,
return 0; return 0;
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:
if (*plparam) {
*plparam = (LPARAM) THREAD_ID_TO_THDB((DWORD) *plparam)->teb.htask16;
}
return 1;
case WM_ASKCBFORMATNAME: case WM_ASKCBFORMATNAME:
case WM_DEVMODECHANGE: case WM_DEVMODECHANGE:
case WM_PAINTCLIPBOARD: case WM_PAINTCLIPBOARD: