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>
* 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)
{
CONSOLE_GetKeystroke(&ch, &scan);
CONSOLE_GetKeystroke(&scan, &ch);
}
return ch;
}

View File

@ -2,11 +2,11 @@
/* This "driver" is designed to go on top of an existing driver
to provide support for features only present if using an
xterm or compatible program for your console output. It should
inlcude such features as resizing, separation of output from the
standard wine console, and a configurable title bar for
Win32 console. */
/* Right now, it doesn't have any "special" features */
xterm or compatible program for your console output.
Currently, it supports resizing and separating debug messages from
program output.
It does not currently support changing the title bar.
*/
#include <signal.h>
#include <sys/ioctl.h>
@ -99,67 +99,26 @@ void XTERM_ResizeScreen(int x, int 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)
{
/* 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;
char buf[1024];
char c = '\0';
int status = 0;
int i;
int tmaster, tslave;
if (tcgetattr(0, &term) < 0) return FALSE;
term.c_lflag |= ICANON;
term.c_lflag &= ~ECHO;
if (wine_openpty(master, slave, NULL, &term, NULL) < 0)
if (wine_openpty(&tmaster, &tslave, NULL, &term, NULL) < 0)
return FALSE;
*master = fdopen(tmaster, "r+");
*slave = fdopen(tslave, "r+");
if ((*pid=fork()) == 0) {
tcsetattr(fileno(*slave), TCSADRAIN, &term);

View File

@ -2339,11 +2339,15 @@ static BOOL32 MENU_TrackMenu( HMENU32 hmenu, UINT32 wFlags, INT32 x, INT32 y,
break;
case WM_MOUSEMOVE:
if ((msg.wParam & MK_LBUTTON) || ((wFlags & TPM_RIGHTBUTTON)
&& (msg.wParam & MK_RBUTTON)))
{
/* In win95 winelook, the selected menu item must be changed every time the
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 );
}
} /* switch(msg.message) - mouse */
}
else if ((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST))

View File

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

View File

@ -6,6 +6,7 @@
*/
#include "windows.h"
#include "wine/winuser16.h"
#include "debug.h"
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@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

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

View File

@ -223,6 +223,19 @@ void DEBUG_ExamineMemory( const DBG_ADDR *address, int count, char 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':
if (count == 1) count = 256;
while (count--)

View File

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

View File

@ -18,7 +18,10 @@
* - acceleration
* - base 16
* - UDS_ALIGNLEFT, ~UDS_WRAP
* (tested - they work)
* - integers with thousand separators.
* (fixed bugs. <noel@macadamian.com>)
*
* 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
* untested cases.
@ -243,14 +246,15 @@ static BOOL32 UPDOWN_SetBuddyInt(WND *wndPtr)
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;
if(len%3 > 0){
lstrcpyn32A (dst, src, len%3);
lstrcpyn32A (dst, src, len%3 + 1); /* need to include the null */
dst += len%3;
src += len%3;
}
for(len=0; *src; len++,src++){
for(len=0; *src; len++){
if(len%3==0)
*dst++ = sep;
*dst++ = *src++;

View File

@ -588,11 +588,16 @@ BOOL32 WINAPI RtlDosPathNameToNtPathName_U(
/**************************************************************************
* NTDLL_chkstk [NTDLL.862]
* NTDLL_alloca_probe [NTDLL.861]
* Glorified "enter xxxx".
*/
REGS_ENTRYPOINT(NTDLL_chkstk)
{
/* FIXME: should subtract %eax bytes from stack pointer */
FIXME(ntdll, "(eax=%ld): stub\n",EAX_reg(context));
ESP_reg(context) -= 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)
{ TRACE(pidl,"(%p)\n",pidl);
return (pidl && PT_MYCOMP == _ILGetDataPointer(pidl)->type);
{ LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_MYCOMP == lpPData->type);
}
BOOL32 WINAPI _ILIsDrive(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl);
return (pidl && PT_DRIVE == _ILGetDataPointer(pidl)->type);
{ LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_DRIVE == lpPData->type);
}
BOOL32 WINAPI _ILIsFolder(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl);
return (pidl && PT_FOLDER == _ILGetDataPointer(pidl)->type);
{ LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
TRACE(pidl,"(%p)\n",pidl);
return (pidl && lpPData && PT_FOLDER == lpPData->type);
}
BOOL32 WINAPI _ILIsValue(LPCITEMIDLIST pidl)
{ TRACE(pidl,"(%p)\n",pidl);
return (pidl && PT_VALUE == _ILGetDataPointer(pidl)->type);
{ LPPIDLDATA lpPData = _ILGetDataPointer(pidl);
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)
{ LPITEMIDLIST pidlTemp;
LPPIDLDATA pData;
DWORD dwCopied = 0;
LPSTR pText;
@ -680,29 +685,34 @@ DWORD WINAPI _ILGetFolderText(LPCITEMIDLIST pidl,LPSTR lpszPath, DWORD dwSize)
if(lpszPath)
*lpszPath = 0;
while(pidlTemp->mkid.cb)
{ LPPIDLDATA pData = _ILGetDataPointer(pidlTemp);
pData = _ILGetDataPointer(pidlTemp);
/*if this item is a value, then skip it and finish */
if(PT_VALUE == pData->type)
{ break;
}
pText = _ILGetTextPointer(pData->type,pData);
pidlTemp = ILGetNext(pidlTemp);
while(pidlTemp->mkid.cb && !(PT_VALUE == pData->type))
{
if (!(pText = _ILGetTextPointer(pData->type,pData)))
return 0; /* foreign pidl */
dwCopied += strlen(pText);
pidlTemp = ILGetNext(pidlTemp);
pData = _ILGetDataPointer(pidlTemp);
if (lpszPath)
{ 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+1] = '\0';
dwCopied++;
}
}
else /* only length */
{ if (pidlTemp && !_ILIsDrive (pidlTemp)) /* backslash between elements */
dwCopied++;
{ if (pidlTemp->mkid.cb
&& (pText[2] != '\\')
&& (PT_VALUE != pData->type))
dwCopied++; /* backslash between elements */
}
}
@ -754,8 +764,9 @@ DWORD WINAPI _ILGetValueText(LPCITEMIDLIST pidl, LPSTR lpszValue, DWORD dwSize)
* strlen(lpszOut)
*/
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);
if(!lpszOut)
@ -768,19 +779,17 @@ DWORD WINAPI _ILGetPidlPath( LPCITEMIDLIST pidl, LPSTR lpszOut, DWORD dwOutSize)
lpszOut += len;
strcpy (lpszOut,"\\");
lpszOut++;
dwOutSize -= len+1;;
len++; lpszOut++; dwOutSize -= len;
len += _ILGetValueText(pidl, lpszOut, dwOutSize );
/*remove the last backslash if necessary */
if( lpszOut[len-1]=='\\')
{ lpszOut[len-1] = 0;
if( lpszTemp[len-1]=='\\')
{ lpszTemp[len-1] = 0;
len--;
}
TRACE(pidl,"-- (%p=%s,%lu)\n",lpszOut,lpszOut,dwOutSize);
TRACE(pidl,"-- (%p=%s,%u)\n",lpszTemp,lpszTemp,len);
return len;
}
@ -800,7 +809,7 @@ LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE type, LPVOID pIn, UINT16 uInSize)
LPPIDLDATA pData;
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)
{ pidlOut = SHAlloc(2);
@ -812,7 +821,7 @@ LPITEMIDLIST WINAPI _ILCreate(PIDLTYPE type, LPVOID pIn, UINT16 uInSize)
{ 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)
{ case PT_DRIVE:
uSize = 4 + 9;
@ -911,11 +920,9 @@ DWORD WINAPI _ILGetData(PIDLTYPE type, LPCITEMIDLIST pidl, LPVOID pOut, UINT32 u
* _ILGetDataPointer()
*/
LPPIDLDATA WINAPI _ILGetDataPointer(LPITEMIDLIST pidl)
{ if(!pidl)
{ return NULL;
}
/* TRACE(pidl,"(%p)\n", pidl);*/
return (LPPIDLDATA)(&pidl->mkid.abID);
{ if(pidl && pidl->mkid.cb != 0x00)
return (LPPIDLDATA)(&pidl->mkid.abID);
return NULL;
}
/**************************************************************************
* _ILGetTextPointer()

View File

@ -188,19 +188,6 @@ StrToOleStrN (LPWSTR lpWide, INT32 nWide, LPCSTR lpMulti, INT32 nMulti) {
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]
*
@ -214,6 +201,24 @@ void WINAPI SHGetSpecialFolderPath(DWORD x1,DWORD x2,DWORD x3,DWORD x4) {
void WINAPI RegisterShellHook32(HWND32 hwnd, DWORD 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]
@ -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);
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);
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,27 +107,31 @@ LPSHELLFOLDER IShellFolder_Constructor(LPSHELLFOLDER pParent,LPITEMIDLIST pidl)
sf->mpSFParent=pParent; /* parrent shellfolder */
TRACE(shell,"(%p)->(parent=%p, pidl=%p)\n",sf,pParent, pidl);
pdump(pidl);
/* keep a copy of the pidl in the instance*/
sf->mpidl = ILClone(pidl);
if(sf->mpidl) /* do we have a pidl? */
if(sf->mpidl) /* do we have a pidl? */
{ dwSize = 0;
if(sf->mpSFParent->sMyPath) /* get the size of the parents path */
if(sf->mpSFParent->sMyPath) /* get the size of the parents path */
{ dwSize += strlen(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*/
sf->sMyPath = SHAlloc(dwSize+1);
sf->sMyPath = SHAlloc(dwSize+2); /* '\0' and backslash */
if(sf->sMyPath)
{ *(sf->sMyPath)=0x00;
if(sf->mpSFParent->sMyPath) /* if the parent has a path, get it*/
{ int len;
*(sf->sMyPath)=0x00;
if(sf->mpSFParent->sMyPath) /* if the parent has a path, get it*/
{ strcpy(sf->sMyPath, sf->mpSFParent->sMyPath);
PathAddBackslash32A (sf->sMyPath);
}
sf->pMyPidl = ILCombine(sf->pMyPidl, pidl);
_ILGetFolderText(sf->mpidl, sf->sMyPath+strlen(sf->sMyPath), dwSize-strlen(sf->sMyPath));
TRACE(shell,"-- (%p)->(my path=%s)\n",sf, debugstr_a(sf->sMyPath));
sf->pMyPidl = ILCombine(sf->mpSFParent->pMyPidl, pidl);
len = strlen(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;
@ -344,8 +348,6 @@ static HRESULT WINAPI IShellFolder_BindToObject( LPSHELLFOLDER this, LPCITEMIDLI
if(!pShellFolder)
return E_OUTOFMEMORY;
IShellFolder_Initialize(pShellFolder, this->pMyPidl);
hr = pShellFolder->lpvtbl->fnQueryInterface(pShellFolder, riid, ppvOut);
pShellFolder->lpvtbl->fnRelease(pShellFolder);
TRACE(shell,"-- (%p)->(interface=%p)\n",this, ppvOut);
@ -614,7 +616,8 @@ static HRESULT WINAPI IShellFolder_GetDisplayNameOf( LPSHELLFOLDER this, LPCITEM
BOOL32 bSimplePidl=FALSE;
TRACE(shell,"(%p)->(pidl=%p,0x%08lx,%p)\n",this,pidl,dwFlags,lpName);
pdump(pidl);
szSpecial[0]=0x00;
szDrive[0]=0x00;
szText[0]=0x00;
@ -624,7 +627,6 @@ static HRESULT WINAPI IShellFolder_GetDisplayNameOf( LPSHELLFOLDER this, LPCITEM
if (pidlTemp && pidlTemp->mkid.cb==0x00)
{ bSimplePidl = TRUE;
TRACE(shell,"-- simple pidl\n");
}
if (_ILIsDesktop( pidl))

View File

@ -39,7 +39,7 @@ likely to get answered and fixed):
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
'report_file' will now contain the last hundred lines of the debugging

View File

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

View File

@ -72,7 +72,7 @@ to
#ifdef HAVE_FOO_H
#include <foo.h>
#elif defined (HAVE_BAR_H)
#include <bat.h>
#include <bar.h>
#endif
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
------
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
thing missing is the texturing and transparency on the spinning
gobes. Lighting seems to be a bit different than the Real One.
* BOIDS.EXE (DX5.0) that comes with the 5.2 DirectX SDK : works
great. Only thing missing is the texturing and transparency on the
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
----
* finish working on Execute Buffers (i.e. Direct3D 3.0)
* texture mapping / blending effects
* real GLX implementation (will need a complete rewrite of DirectDraw
also) to have 3DFx support
* restructuration of all the DDRAW.DLL (put that in the dll
@ -52,4 +58,4 @@ TODO
--
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@
sysconfdir = @sysconfdir@
DEFS = @DLLFLAGS@ -D__WINE__ -DETCDIR=\"$(sysconfdir)\"
DEFS = @DLLFLAGS@ -D__WINE__ -DETCDIR="\"$(sysconfdir)\""
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@

View File

@ -67,6 +67,8 @@ typedef struct DOS_FILE_LOCK DOS_FILE_LOCK;
static DOS_FILE_LOCK *locks = NULL;
static void DOS_RemoveFileLocks(FILE_OBJECT *file);
/* Size of per-process table of DOS handles */
#define DOS_TABLE_SIZE 256
/***********************************************************************
@ -421,13 +423,18 @@ HFILE32 FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
/* If write access failed, retry without GENERIC_WRITE */
if ((reply.handle == -1) && !Options.failReadOnly &&
(access & GENERIC_WRITE) && (GetLastError() == ERROR_ACCESS_DENIED))
(access & GENERIC_WRITE))
{
req.access &= ~GENERIC_WRITE;
CLIENT_SendRequest( REQ_CREATE_FILE, -1, 2,
&req, sizeof(req),
filename, strlen(filename) + 1 );
CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL );
DWORD lasterror = GetLastError();
if ((lasterror == ERROR_ACCESS_DENIED) ||
(lasterror == ERROR_WRITE_PROTECT))
{
req.access &= ~GENERIC_WRITE;
CLIENT_SendRequest( REQ_CREATE_FILE, -1, 2,
&req, sizeof(req),
filename, strlen(filename) + 1 );
CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL );
}
}
if (reply.handle == -1) return INVALID_HANDLE_VALUE32;
@ -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)
*/
@ -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 )
{
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)
*/
HFILE16 WINAPI _lclose16( HFILE16 hFile )
{
TRACE(file, "handle %d\n", hFile );
return CloseHandle( HFILE16_TO_HFILE32( hFile ) ) ? 0 : HFILE_ERROR16;
HANDLE32 *table = PROCESS_Current()->dos_handles;
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 */
maxlen = GetSelectorLimit( SELECTOROF(buffer) ) - OFFSETOF(buffer) + 1;
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 )
{
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 )
{
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 );
return CreateFile32A( path, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_NEW, attr, -1 );
return FILE_AllocDosHandle( CreateFile32A( path, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
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 )
{
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 )
{
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 )
{
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)
{
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 )
{
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)->_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 {
IDirect3DDevice2 common;
@ -60,6 +67,12 @@ typedef struct OpenGL_IDirect3DDevice2 {
OSMesaContext ctx;
unsigned char *buffer;
/* The current render state */
RenderState rs;
/* The last type of vertex drawn */
D3DVERTEXTYPE vt;
float world_mat[16];
float view_mat[16];
float proj_mat[16];
@ -72,6 +85,9 @@ typedef struct OpenGL_IDirect3DDevice {
OSMesaContext ctx;
unsigned char *buffer;
/* The current render state */
RenderState rs;
D3DMATRIX *world_mat;
D3DMATRIX *view_mat;
D3DMATRIX *proj_mat;
@ -81,11 +97,11 @@ typedef struct OpenGL_IDirect3DDevice {
TRACE(ddraw, " " s " : %f %f %f %f\n", \
(v).r.r, (v).g.g, (v).b.b, (v).a.a);
#endif /* HAVE_MESAGL */
/* Common functions defined in d3dcommon.c */
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState) ;
DWORD dwRenderState, RenderState *rs) ;
#endif /* HAVE_MESAGL */
/* All non-static functions 'exported' by various sub-objects */
extern LPDIRECT3DTEXTURE2 d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf) ;

View File

@ -61,6 +61,7 @@ static void _dump_renderstate(D3DRENDERSTATETYPE type,
"D3DRENDERSTATE_STIPPLEENABLE",
"D3DRENDERSTATE_EDGEANTIALIAS",
"D3DRENDERSTATE_COLORKEYENABLE",
"ERR",
"D3DRENDERSTATE_BORDERCOLOR",
"D3DRENDERSTATE_TEXTUREADDRESSU",
"D3DRENDERSTATE_TEXTUREADDRESSV",
@ -69,6 +70,8 @@ static void _dump_renderstate(D3DRENDERSTATETYPE type,
"D3DRENDERSTATE_RANGEFOGENABLE",
"D3DRENDERSTATE_ANISOTROPY",
"D3DRENDERSTATE_FLUSHBATCH",
"ERR", "ERR", "ERR", "ERR", "ERR", "ERR", "ERR",
"ERR", "ERR", "ERR", "ERR", "ERR", "ERR",
"D3DRENDERSTATE_STIPPLEPATTERN00",
"D3DRENDERSTATE_STIPPLEPATTERN01",
"D3DRENDERSTATE_STIPPLEPATTERN02",
@ -108,7 +111,7 @@ static void _dump_renderstate(D3DRENDERSTATETYPE type,
void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState)
DWORD dwRenderState, RenderState *rs)
{
if (TRACE_ON(ddraw))
@ -116,13 +119,13 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
/* First, all the stipple patterns */
if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) &&
(dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN31)) {
(dwRenderStateType <= D3DRENDERSTATE_STIPPLEPATTERN31)) {
ERR(ddraw, "Unhandled stipple !\n");
} else {
/* All others state variables */
switch (dwRenderStateType) {
case D3DRENDERSTATE_TEXTUREHANDLE: {
case D3DRENDERSTATE_TEXTUREHANDLE: { /* 1 */
LPDIRECT3DTEXTURE2 tex = (LPDIRECT3DTEXTURE2) dwRenderState;
if (tex == NULL) {
@ -131,13 +134,21 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
} else {
TRACE(ddraw, "setting OpenGL texture handle : %d\n", tex->tex_name);
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
/* Default parameters */
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;
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 */
if (dwRenderState)
@ -146,6 +157,31 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
glDisable(GL_DEPTH_TEST);
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 */
if (dwRenderState)
glDepthMask(GL_TRUE);
@ -153,6 +189,95 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
glDepthMask(GL_FALSE);
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 */
switch ((D3DCMPFUNC) dwRenderState) {
case D3DCMP_NEVER:
@ -192,8 +317,25 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
glDisable(GL_DITHER);
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:
FIXME(ddraw, "Unhandled Render State\n");
ERR(ddraw, "Unhandled Render State\n");
break;
}
}

View File

@ -96,7 +96,7 @@ static void fill_opengl_caps(D3DDEVICEDESC *d1, D3DDEVICEDESC *d2)
d1->dlcLightingCaps.dwSize = sizeof(D3DLIGHTINGCAPS);
d1->dlcLightingCaps.dwCaps = D3DLIGHTCAPS_DIRECTIONAL | D3DLIGHTCAPS_PARALLELPOINT | D3DLIGHTCAPS_POINT | D3DLIGHTCAPS_SPOT;
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->dpcTriCaps));
d1->dwDeviceRenderBitDepth = DDBD_16;
@ -160,6 +160,11 @@ int is_OpenGL(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE2 *de
odev->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
odev->buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
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->view_mat , id_mat, 16 * sizeof(float));
@ -594,10 +599,12 @@ static HRESULT WINAPI IDirect3DDevice2_SetRenderState(LPDIRECT3DDEVICE2 this,
D3DRENDERSTATETYPE dwRenderStateType,
DWORD dwRenderState)
{
OpenGL_IDirect3DDevice2 *odev = (OpenGL_IDirect3DDevice2 *) this;
TRACE(ddraw, "(%p)->(%d,%ld)\n", this, dwRenderStateType, dwRenderState);
/* Call the render state functions */
set_render_state(dwRenderStateType, dwRenderState);
set_render_state(dwRenderStateType, dwRenderState, &(odev->rs));
return DD_OK;
}
@ -756,6 +763,165 @@ static HRESULT WINAPI IDirect3DDevice2_MultiplyTransform(LPDIRECT3DDEVICE2 this,
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,
@ -765,147 +931,18 @@ static HRESULT WINAPI IDirect3DDevice2_DrawPrimitive(LPDIRECT3DDEVICE2 this,
DWORD vertcount,
DWORD dwFlags)
{
OpenGL_IDirect3DDevice2 *odev = (OpenGL_IDirect3DDevice2 *) this;
int vx_index;
TRACE(ddraw, "(%p)->(%d,%d,%p,%ld,%08lx): stub\n", this, d3dp, d3dv, lpvertex, vertcount, dwFlags);
/* Puts GL in the correct lighting mode */
switch (d3dv) {
case D3DVT_VERTEX:
TRACE(ddraw, "Standard Vertex\n");
glEnable(GL_LIGHTING);
break;
DRAW_PRIMITIVE(vertcount, vx_index);
case D3DVT_LVERTEX:
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;
return D3D_OK;
}
}
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;
}
static HRESULT WINAPI IDirect3DDevice2_DrawIndexedPrimitive(LPDIRECT3DDEVICE2 this,
D3DPRIMITIVETYPE d3dp,
D3DVERTEXTYPE d3dv,
@ -915,73 +952,14 @@ static HRESULT WINAPI IDirect3DDevice2_DrawIndexedPrimitive(LPDIRECT3DDEVICE2 th
DWORD indexcount,
DWORD dwFlags)
{
OpenGL_IDirect3DDevice2 *odev = (OpenGL_IDirect3DDevice2 *) this;
int vx_index;
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 */
switch (d3dv) {
case D3DVT_VERTEX:
glEnable(GL_LIGHTING);
break;
case D3DVT_LVERTEX:
case D3DVT_TLVERTEX:
glDisable(GL_LIGHTING);
break;
default:
break;
}
DRAW_PRIMITIVE(indexcount, lpindexes[vx_index]);
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;
return D3D_OK;
}
@ -1101,6 +1079,10 @@ int is_OpenGL_dx3(REFCLSID rguid, LPDIRECTDRAWSURFACE surface, LPDIRECT3DDEVICE
odev->ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
odev->buffer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,
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->view_mat = (LPD3DMATRIX) &id_mat;

View File

@ -275,7 +275,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPD3DSTATE ci = (LPD3DSTATE) instr;
/* 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;
}

View File

@ -84,6 +84,12 @@ static ULONG WINAPI IDirect3DTexture2_Release(LPDIRECT3DTEXTURE2 this)
FIXME( ddraw, "(%p)->() decrementing from %lu.\n", this, 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);
return 0;
}
@ -168,17 +174,19 @@ static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
ERR(ddraw, "Error in surface sizes\n");
return D3DERR_TEXTURE_LOAD_FAILED;
} else {
LPDIRECT3DDEVICE2 d3dd = (LPDIRECT3DDEVICE2) this->D3Ddevice;
/* LPDIRECT3DDEVICE2 d3dd = (LPDIRECT3DDEVICE2) this->D3Ddevice; */
/* I should put a macro for the calculus of bpp */
int bpp = (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ?
1 /* 8 bit of palette index */:
src_d->ddpfPixelFormat.x.dwRGBBitCount / 8 /* RGB bits for each colors */ );
GLuint current_texture;
/* Not sure if this is usefull ! */
memcpy(dst_d->y.lpSurface, src_d->y.lpSurface, src_d->dwWidth * src_d->dwHeight * bpp);
/* 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);
if (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
@ -186,14 +194,45 @@ static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
BYTE table[256][4];
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 */
for (i = 0; i < 256; i++) {
table[i][0] = pal->palents[i].peRed;
table[i][1] = pal->palents[i].peGreen;
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;
}
#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 */
glColorTableEXT(GL_TEXTURE_2D, /* target */
GL_RGBA, /* internal format */
@ -213,9 +252,11 @@ static HRESULT WINAPI IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2 this,
} else {
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,
DWORD dwFlags)
{
GLboolean ztest;
FIXME(ddraw, "(%p)->(%8ld,%p,%08lx): stub\n", this, dwCount, lpRects, dwFlags);
/* 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);
/* Clears the screen */
glGetBooleanv(GL_DEPTH_TEST, &ztest);
glDepthMask(GL_TRUE); /* Enables Z writing to be sure to delete also the Z buffer */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthMask(ztest);
}
return DD_OK;

View File

@ -46,6 +46,7 @@
#include "message.h"
#include "x11drv.h"
#include "options.h"
#include "objbase.h"
#ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h"
@ -100,7 +101,7 @@ static XF86VidModeModeInfo *orig_mode = NULL;
#endif
BOOL32
DDRAW_DGA_Available()
DDRAW_DGA_Available(void)
{
#ifdef HAVE_LIBXXF86DGA
int evbase, evret, fd;
@ -415,7 +416,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Unlock(
{
TRACE(ddraw,"(%p)->Unlock(%p)\n",this,surface);
if (!this->s.ddraw->e.xlib.paintable)
if (!this->s.ddraw->d.paintable)
return DD_OK;
/* 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
) {
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;
if (!flipto) {
@ -557,6 +558,9 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_SetPalette(
{
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++) {
XColor xc;
@ -567,6 +571,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_SetPalette(
xc.pixel = i;
TSXStoreColor(display,pal->cm,&xc);
}
TSXInstallColormap(display,pal->cm);
}
/* According to spec, we are only supposed to
@ -863,6 +868,11 @@ static ULONG WINAPI DGA_IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this) {
} else {
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);
return 0;
}
@ -1074,24 +1084,29 @@ static HRESULT WINAPI IDirectDrawSurface3_SetColorKey(
if( 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 )
{
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 )
{
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 )
{
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 )
@ -1152,25 +1167,25 @@ static HRESULT WINAPI IDirectDrawSurface3_GetColorKey(
if( 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 )
{
dwFlags &= ~DDCKEY_DESTBLT;
memcpy( lpDDColorKey, &(this->s.ckDestBlt), sizeof( *lpDDColorKey ) );
memcpy( lpDDColorKey, &(this->s.surface_desc.ddckCKDestBlt), sizeof( *lpDDColorKey ) );
}
if( 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 )
{
dwFlags &= ~DDCKEY_DESTOVERLAY;
memcpy( lpDDColorKey, &(this->s.ckDestOverlay), sizeof( *lpDDColorKey ) );
memcpy( lpDDColorKey, &(this->s.surface_desc.ddckCKDestOverlay), sizeof( *lpDDColorKey ) );
}
if( dwFlags )
@ -2427,7 +2442,7 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
_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;
/* We don't have a context for this window. Host off the desktop */
if( !this->d.drawable )
@ -2633,12 +2648,16 @@ static ULONG WINAPI DGA_IDirectDraw2_Release(LPDIRECTDRAW2 this) {
TSXF86DGADirectVideo(display,DefaultScreen(display),0);
#ifdef HAVE_LIBXXF86VM
if (orig_mode)
TSXF86VidModeSwitchToMode(display, DefaultScreen(display), orig_mode);
if (orig_mode->privsize)
TSXFree(orig_mode->private);
free(orig_mode);
orig_mode = NULL;
if (orig_mode) {
TSXF86VidModeSwitchToMode(
display,
DefaultScreen(display),
orig_mode);
if (orig_mode->privsize)
TSXFree(orig_mode->private);
free(orig_mode);
orig_mode = NULL;
}
#endif
#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 */
if (msg==WM_PAINT)
ddraw->e.xlib.paintable = 1;
ddraw->d.paintable = 1;
/* Now let the application deal with the rest of this */
if( ddraw->d.mainWindow )
@ -3232,7 +3251,7 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
}
BOOL32
DDRAW_XSHM_Available()
DDRAW_XSHM_Available(void)
{
#ifdef HAVE_LIBXXSHM
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
* hdc [I] Handle to device context
@ -153,8 +153,8 @@ INT32 WINAPI Escape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
* Not implemented: 0
* Failure: <0
*/
INT32 WINAPI ExtEscape32( HDC32 hdc, INT32 nEscape, INT32 cbInput,
LPCSTR lpszInData, INT32 cbOutput, LPSTR lpszOutData )
INT32 WINAPI ExtEscape( HDC32 hdc, INT32 nEscape, INT32 cbInput,
LPCSTR lpszInData, INT32 cbOutput, LPSTR lpszOutData )
{
FIXME(driver,"(0x%04x,0x%x,%d,%s,%d,%p):stub\n",
hdc,nEscape,cbInput,debugstr_a(lpszInData),cbOutput,lpszOutData);
@ -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");
return 0;

View File

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

View File

@ -127,13 +127,13 @@ BOOL32 WINAPI Arc32( HDC32 hdc, INT32 left, INT32 top, INT32 right,
}
/***********************************************************************
* ArcTo32 (GDI32.8)
* ArcTo (GDI32.8)
*/
BOOL32 WINAPI ArcTo32( HDC32 hdc,
INT32 left, INT32 top,
INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart,
INT32 xend, INT32 yend )
BOOL32 WINAPI ArcTo( HDC32 hdc,
INT32 left, INT32 top,
INT32 right, INT32 bottom,
INT32 xstart, INT32 ystart,
INT32 xend, INT32 yend )
{
BOOL32 result;
@ -819,10 +819,10 @@ 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,
DWORD polylines )
BOOL32 WINAPI PolyPolyline( HDC32 hdc, const POINT32* pt, const DWORD* counts,
DWORD polylines )
{
DC * dc = DC_GetDCPtr( hdc );
@ -1206,11 +1206,11 @@ 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,
FLOAT eStartAngle, FLOAT eSweepAngle)
BOOL32 WINAPI AngleArc(HDC32 hdc, INT32 x, INT32 y, DWORD dwRadius,
FLOAT eStartAngle, FLOAT eSweepAngle)
{
FIXME(gdi,"AngleArc, stub\n");
return 0;

View File

@ -39,6 +39,8 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth)
lpddraw->lpvtbl->fnCreatePalette(lpddraw,0,NULL,&lpddpal,NULL);
memset(&sdesc,0,sizeof(sdesc));
sdesc.dwSize=sizeof(sdesc);
sdesc.dwFlags = DDSD_CAPS;
sdesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if (lpddraw->lpvtbl->fnCreateSurface(lpddraw,&sdesc,&lpddsurf,NULL)||(!lpddsurf)) {
ERR(ddraw,"DirectDraw surface is not available\n");
lpddraw->lpvtbl->fnRelease(lpddraw);
@ -119,6 +121,9 @@ void VGA_Unlock(void)
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 )
{
char *dat;
@ -138,7 +143,7 @@ void VGA_Poll( WORD timer )
/* copy from virtual VGA frame buffer to DirectDraw surface */
for (Y=0; Y<Height; Y++,surf+=Pitch,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_refresh=1;

View File

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

View File

@ -400,6 +400,8 @@ file krnl386.exe
493 stub UTInit
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

View File

@ -360,7 +360,7 @@ file user.exe
384 pascal16 SetMenuContextHelpId(word word) SetMenuContextHelpId16
385 pascal16 GetMenuContextHelpId(word) GetMenuContextHelpId16
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
394 pascal16 DrawIconEx(word word word word word word word word word) DrawIconEx16
395 stub GetIconInfo

View File

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

View File

@ -111,7 +111,7 @@ typedef enum {
D3DLIGHT_SPOT = 2,
D3DLIGHT_DIRECTIONAL = 3,
D3DLIGHT_PARALLELPOINT = 4,
D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DLIGHT_FORCE_DWORD = 0x7fffffff
} D3DLIGHTTYPE;
typedef enum {
@ -121,9 +121,69 @@ typedef enum {
D3DPT_TRIANGLELIST = 4,
D3DPT_TRIANGLESTRIP = 5,
D3DPT_TRIANGLEFAN = 6,
D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
D3DPT_FORCE_DWORD = 0x7fffffff
} 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 {
D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle */
D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */

View File

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

View File

@ -37,22 +37,6 @@ typedef struct
int flags;
} 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 */
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 HFILE32 FILE_DupUnixHandle( int fd, DWORD access );
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,
LPSECURITY_ATTRIBUTES sa, DWORD creation,
DWORD attributes, HANDLE32 template );
@ -70,7 +54,9 @@ extern LPVOID FILE_dommap( int unix_handle, LPVOID start,
DWORD offset_high, DWORD offset_low,
int prot, int flags );
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 */
extern int DIR_Init(void);

View File

@ -35,21 +35,6 @@ typedef struct tagGDIOBJHDR
} 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
{
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 void MODULE_InitializeDLLs( struct _PDB32 *process, HMODULE32 root, DWORD type, LPVOID lpReserved );
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 WINAPI WIN32_GetProcAddress16( HMODULE32 hmodule, LPCSTR name );
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) */
/* The following are Wine-specific fields */
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_prev; /* List reference - list of PDB's */
} PDB32;

View File

@ -237,4 +237,15 @@
#define _vstprintf WINE_tchar_routine(vsprintf, vsprintf, vswprintf)
#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 */

View File

@ -3172,6 +3172,11 @@ typedef struct {
#define DM_PROMPT 4
#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_PAPERSIZE 0x00000002L
#define DM_PAPERLENGTH 0x00000004L

View File

@ -429,6 +429,22 @@ typedef struct
#define MWT_LEFTMULTIPLY 2
#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
{
FLOAT eM11;
@ -1453,6 +1469,8 @@ typedef struct
#define SYSTEM_FIXED_FONT 16
#define DEFAULT_GUI_FONT 17
#define STOCK_LAST 17
/* Metafile header structure */
typedef struct
{
@ -1470,7 +1488,7 @@ typedef struct
{
DWORD rdSize;
WORD rdFunction;
WORD rdParam[1];
WORD rdParm[1];
} METARECORD;
typedef METARECORD *PMETARECORD;
typedef METARECORD *LPMETARECORD;
@ -1951,24 +1969,26 @@ DECL_WINELIB_TYPE(ABORTPROC)
#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 */
BOOL32 WINAPI AngleArc32(HDC32, INT32, INT32, DWORD, FLOAT, FLOAT);
#define AngleArc WINELIB_NAME(AngleArc)
BOOL32 WINAPI ArcTo32(HDC32, INT32, INT32, INT32, INT32, INT32, INT32, INT32, INT32);
HENHMETAFILE32 WINAPI CloseEnhMetaFile32(HDC32);
#define CloseEnhMetaFile WINELIB_NAME(CloseEnhMetaFile)
BOOL32 WINAPI AngleArc(HDC32, INT32, INT32, DWORD, FLOAT, FLOAT);
BOOL32 WINAPI ArcTo(HDC32, INT32, INT32, INT32, INT32, INT32, INT32, INT32, INT32);
HENHMETAFILE32 WINAPI CloseEnhMetaFile(HDC32);
HBRUSH32 WINAPI CreateDIBPatternBrushPt(const void*,UINT32);
HDC32 WINAPI CreateEnhMetaFile32A(HDC32,LPCSTR,const RECT32*,LPCSTR);
HDC32 WINAPI CreateEnhMetaFile32W(HDC32,LPCWSTR,const RECT32*,LPCWSTR);
#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);
BOOL16 WINAPI FastWindowFrame(HDC16,const RECT16*,INT16,INT16,DWORD);
UINT16 WINAPI GDIRealizePalette(HDC16);
HPALETTE16 WINAPI GDISelectPalette(HDC16,HPALETTE16,WORD);
BOOL32 WINAPI GdiComment32(HDC32,UINT32,const BYTE *);
#define GdiComment WINELIB_NAME(GdiComment)
BOOL32 WINAPI GdiComment(HDC32,UINT32,const BYTE *);
DWORD WINAPI GetBitmapDimension(HBITMAP16);
DWORD WINAPI GetBrushOrg(HDC16);
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 GetCharWidthFloat32W(HDC32,UINT32,UINT32,PFLOAT);
#define GetCharWidthFloat WINELIB_NAME_AW(GetCharWidthFloat)
BOOL32 WINAPI GetColorAdjustment32(HDC32, LPCOLORADJUSTMENT);
#define GetColorAdjustment WINELIB_NAME(GetColorAdjustment)
BOOL32 WINAPI GetColorAdjustment(HDC32, LPCOLORADJUSTMENT);
HFONT16 WINAPI GetCurLogFont(HDC16);
DWORD WINAPI GetCurrentPosition(HDC16);
DWORD WINAPI GetDCHook(HDC16,FARPROC16*);
@ -2032,7 +2051,7 @@ HPALETTE32 WINAPI CreateHalftonePalette(HDC32);
BOOL32 WINAPI DeleteEnhMetaFile(HENHMETAFILE32);
INT32 WINAPI ExtSelectClipRgn(HDC32,HRGN32,INT32);
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);
HANDLE32 WINAPI GetCurrentObject(HDC32,UINT32);
BOOL32 WINAPI GetDCOrgEx(HDC32,LPPOINT32);
@ -2055,7 +2074,7 @@ BOOL32 WINAPI GetWorldTransform(HDC32,LPXFORM);
BOOL32 WINAPI ModifyWorldTransform(HDC32,const XFORM *, DWORD);
BOOL32 WINAPI PlayEnhMetaFile(HDC32,HENHMETAFILE32,const RECT32*);
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);
HENHMETAFILE32 WINAPI SetEnhMetaFileBits(UINT32,const BYTE *);
INT32 WINAPI SetGraphicsMode(HDC32,INT32);
@ -2580,7 +2599,7 @@ HPALETTE16 WINAPI SelectPalette16(HDC16,HPALETTE16,BOOL16);
HPALETTE32 WINAPI SelectPalette32(HDC32,HPALETTE32,BOOL32);
#define SelectPalette WINELIB_NAME(SelectPalette)
INT16 WINAPI SetAbortProc16(HDC16,SEGPTR);
INT32 WINAPI SetAbortProc32(HDC32,FARPROC32);
INT32 WINAPI SetAbortProc32(HDC32,ABORTPROC32);
#define SetAbortProc WINELIB_NAME(SetAbortProc)
INT16 WINAPI SetArcDirection16(HDC16,INT16);
INT32 WINAPI SetArcDirection32(HDC32,INT32);

View File

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

View File

@ -228,6 +228,7 @@ DECL_WINELIB_TYPE(DRAWSTATEPROC)
#define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
#define SBS_SIZEBOX 0x0008L
#define SBS_SIZEGRIP 0x0010L
/* EnableScrollBar() flags */
#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 DlgDirListComboBox32W(HWND32,LPWSTR,INT32,INT32,UINT32);
#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)
BOOL32 WINAPI DlgDirSelectEx32A(HWND32,LPSTR,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
old_com=1; /* assume .COM file */
image_start=0;
image_size=GetFileSize(HFILE16_TO_HFILE32(hFile),NULL);
image_size=GetFileSize(FILE_GetHandle32(hFile),NULL);
min_size=0x10000; max_size=0x100000;
mz_header.e_crlc=0;
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 (alloc) {
if ((hModule = MODULE_CreateDummyModule(&ofs)) < 32)
if ((hModule = MODULE_CreateDummyModule(&ofs, NULL)) < 32)
return hModule;
lpDosTask->hModule = hModule;

View File

@ -291,7 +291,7 @@ HINSTANCE32 MAIN_WinelibInit( int *argc, char *argv[] )
PROCESS_Current()->exe_modref = wm;
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->flags = NE_FFLAGS_WIN32;
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.
*/
HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs, LPCSTR modName )
{
HMODULE32 hModule;
NE_MODULE *pModule;
@ -240,9 +240,14 @@ HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs )
/* Module name */
pStr = (char *)pSegment;
pModule->name_table = (int)pStr - (int)pModule;
basename = strrchr(ofs->szPathName,'\\');
if (!basename) basename = ofs->szPathName;
else basename++;
if ( modName )
basename = modName;
else
{
basename = strrchr(ofs->szPathName,'\\');
if (!basename) basename = ofs->szPathName;
else basename++;
}
len = strlen(basename);
if ((s = strchr(basename,'.'))) len = s - basename;
if (len > 8) len = 8;

View File

@ -93,6 +93,8 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
DWORD oldstack;
WORD old_hSeg, new_hSeg;
THDB *thdb = THREAD_Current();
HFILE32 hFile32;
HFILE16 hFile16;
selfloadheader = (SELFLOADHEADER *)
PTR_SEG_OFF_TO_LIN(SEL(pSegTable->hSeg),0);
@ -111,12 +113,14 @@ BOOL32 NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
stack16Top->cs = 0;
TRACE(dll,"CallLoadAppSegProc(hmodule=0x%04x,hf=0x%04x,segnum=%d\n",
pModule->self,hf,segnum );
DuplicateHandle( GetCurrentProcess(), hf, GetCurrentProcess(), &hFile32,
0, FALSE, DUPLICATE_SAME_ACCESS );
hFile16 = FILE_AllocDosHandle( hFile32 );
new_hSeg = Callbacks->CallLoadAppSegProc(selfloadheader->LoadAppSeg,
pModule->self,
HFILE32_TO_HFILE16(hf),
pModule->self, hFile16,
segnum );
TRACE(dll,"Ret CallLoadAppSegProc: hSeg = 0x%04x\n",new_hSeg);
_lclose32( hf );
_lclose16( hFile16 );
if (SEL(new_hSeg) != SEL(old_hSeg)) {
/* Self loaders like creating their own selectors;
* they love asking for trouble to Wine developers
@ -390,6 +394,7 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
if (pModule->flags & NE_FFLAGS_SELFLOAD)
{
HFILE32 hf;
HFILE16 hFile16;
/* Handle self loading modules */
SELFLOADHEADER *selfloadheader;
STACK16FRAME *stack16Top;
@ -422,13 +427,14 @@ BOOL32 NE_LoadAllSegments( NE_MODULE *pModule )
stack16Top->ip = 0;
stack16Top->cs = 0;
hf = NE_OpenFile( pModule );
TRACE(dll,"CallBootAppProc(hModule=0x%04x,hf=0x%04x)\n",pModule->self,
HFILE32_TO_HFILE16(hf));
Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self,
HFILE32_TO_HFILE16(hf));
DuplicateHandle( GetCurrentProcess(), NE_OpenFile(pModule),
GetCurrentProcess(), &hf, 0, FALSE, DUPLICATE_SAME_ACCESS );
hFile16 = FILE_AllocDosHandle( hf );
TRACE(dll,"CallBootAppProc(hModule=0x%04x,hf=0x%04x)\n",
pModule->self,hFile16);
Callbacks->CallBootAppProc(selfloadheader->BootApp, pModule->self,hFile16);
TRACE(dll,"Return from CallBootAppProc\n");
_lclose32(hf);
_lclose16(hf);
/* some BootApp procs overwrite the segment handle of dgroup */
pSegTable[pModule->dgroup - 1].hSeg = saved_hSeg;
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
* 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;
HFILE32 hFile;
@ -464,6 +464,7 @@ static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs )
IMAGE_NT_HEADERS *nt;
IMAGE_SECTION_HEADER *pe_sec;
IMAGE_DATA_DIRECTORY *dir;
BY_HANDLE_FILE_INFORMATION bhfi;
int i, rawsize, lowest_va, lowest_fa, vma_size, file_size = 0;
DWORD load_addr, aoep, reloc = 0;
@ -574,7 +575,6 @@ static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs )
if (load_addr == 0)
{
/* We need to perform base relocations */
IMAGE_DATA_DIRECTORY *dir;
dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BASERELOC;
if (dir->Size)
reloc = dir->VirtualAddress;
@ -635,6 +635,11 @@ static HMODULE32 PE_LoadImage( LPCSTR name, OFSTRUCT *ofs )
if ( 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 */
UnmapViewOfFile( (LPVOID)hModule );
return (HMODULE32)load_addr;
@ -799,6 +804,7 @@ static WINE_MODREF *PE_CreateModule( PDB32 *process, HMODULE32 hModule,
HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
HFILE32 hFile, DWORD flags)
{
LPCSTR modName = NULL;
OFSTRUCT ofs;
HMODULE32 hModule32;
HMODULE16 hModule16;
@ -814,7 +820,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
if ((hModule32 = BUILTIN32_LoadImage( name, &ofs, FALSE )))
builtin = TRUE;
/* 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;
/* Now try the built-in even if disabled */
else if ((hModule32 = BUILTIN32_LoadImage( name, &ofs, TRUE )))
@ -826,7 +832,7 @@ HMODULE32 PE_LoadLibraryEx32A (LPCSTR name, PDB32 *process,
return 0;
/* 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->flags = NE_FFLAGS_LIBMODULE | NE_FFLAGS_SINGLEDATA |
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,
LPPROCESS_INFORMATION info )
{
LPCSTR modName = NULL;
HMODULE16 hModule16;
HMODULE32 hModule32;
HINSTANCE16 hInstance;
@ -865,13 +872,13 @@ HINSTANCE16 PE_CreateProcess( LPCSTR name, LPCSTR cmd_line,
WINE_MODREF *wm;
/* Load file */
if ((hModule32 = PE_LoadImage( name, &ofs )) < 32)
if ((hModule32 = PE_LoadImage( name, &ofs, &modName )) < 32)
return hModule32;
if (PE_HEADER(hModule32)->FileHeader.Characteristics & IMAGE_FILE_DLL)
return 20; /* FIXME: not the right error code */
/* 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->flags = NE_FFLAGS_WIN32;
pModule->module32 = hModule32;
@ -969,7 +976,6 @@ void PE_InitTls(THDB *thdb)
delta = wm->module - peh->OptionalHeader.ImageBase;
if (!peh->OptionalHeader.DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress)
continue;
FIXME(win32,"%s has TLS directory.\n",wm->longname);
pdir = (LPVOID)(wm->module + peh->OptionalHeader.
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 );
HFILE32 hFile32 = AccessResource32( pModule->module32, hRsrc32 );
return HFILE32_TO_HFILE16( hFile32 );
return FILE_AllocDosHandle( hFile32 );
}
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 struct lzstate {
HFILE32 lzfd; /* the handle used by the program */
struct lzstate {
HFILE32 realfd; /* the real filedescriptor */
CHAR lastchar; /* the last char of the filename */
@ -51,8 +50,13 @@ static struct lzstate {
BYTE *get; /* GETLEN bytes */
DWORD getcur; /* current read */
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 */
#define GET(lzs,b) _lzget(lzs,&b)
@ -132,7 +136,7 @@ INT32 WINAPI LZStart32(void)
*/
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)
* on failure, returns error code <0
* 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
* libc
@ -154,6 +157,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
struct lzfileheader head;
struct lzstate *lzs;
DWORD ret;
int i;
TRACE(file,"(%d)\n",hfSrc);
ret=read_header(hfSrc,&head);
@ -161,13 +165,12 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
_llseek32(hfSrc,0,SEEK_SET);
return ret?ret:hfSrc;
}
lzstates = HeapReAlloc( SystemHeap, 0, lzstates,
(++nroflzstates)*sizeof(struct lzstate) );
lzs = lzstates+(nroflzstates-1);
for (i = 0; i < MAX_LZSTATES; i++) if (!lzstates[i]) break;
if (i == MAX_LZSTATES) return LZERROR_GLOBALLOC;
lzstates[i] = lzs = HeapAlloc( SystemHeap, 0, sizeof(struct lzstate) );
memset(lzs,'\0',sizeof(*lzs));
lzs->realfd = hfSrc;
lzs->lzfd = hfSrc | 0x400;
lzs->lastchar = head.lastchar;
lzs->reallength = head.reallength;
@ -179,7 +182,7 @@ HFILE32 WINAPI LZInit32( HFILE32 hfSrc )
memset(lzs->table,' ',0x1000);
/* Yes, start 16 byte from the END of the table */
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 )
{
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 )
{
int i,howmuch;
int howmuch;
BYTE b,*buf;
struct lzstate *lzs;
buf=(LPBYTE)vbuf;
TRACE(file,"(%d,%p,%d)\n",fd,buf,toread);
howmuch=toread;
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
break;
if (i==nroflzstates)
return _lread32(fd,buf,toread);
lzs=lzstates+i;
if (!(lzs = GET_LZ_STATE(fd))) return _lread32(fd,buf,toread);
/* The decompressor itself is in a define, cause we need it twice
* 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 )
{
return LZSeek32( HFILE16_TO_HFILE32(fd), off, type );
if (IS_LZ_HANDLE(fd)) return LZSeek32( fd, off, type );
return _llseek16( fd, off, type );
}
@ -416,19 +416,13 @@ LONG WINAPI LZSeek16( HFILE16 fd, LONG off, INT16 type )
*/
LONG WINAPI LZSeek32( HFILE32 fd, LONG off, INT32 type )
{
int i;
struct lzstate *lzs;
LONG newwanted;
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() */
if (i==nroflzstates)
return _llseek32(fd,off,type);
lzs = lzstates+i;
newwanted = lzs->realwanted;
if (!(lzs = GET_LZ_STATE(fd))) return _llseek32(fd,off,type);
newwanted = lzs->realwanted;
switch (type) {
case 1: /* SEEK_CUR */
newwanted += off;
@ -455,7 +449,19 @@ LONG WINAPI LZSeek32( HFILE32 fd, LONG off, INT32 type )
*/
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 )
{
int usedlzinit=0,i,ret,wret;
int usedlzinit=0,ret,wret;
LONG len;
HFILE32 oldsrc = src;
#define BUFLEN 1000
@ -476,7 +482,7 @@ LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
INT32 WINAPI (*xread)(HFILE32,LPVOID,UINT32);
TRACE(file,"(%d,%d)\n",src,dest);
if (src<0x400) {
if (!IS_LZ_HANDLE(src)) {
src = LZInit32(src);
if (src!=oldsrc)
usedlzinit=1;
@ -484,11 +490,8 @@ LONG WINAPI LZCopy32( HFILE32 src, HFILE32 dest )
return 0;
}
for (i=0;i<nroflzstates;i++)
if (src==lzstates[i].lzfd)
break;
/* not compressed? just copy */
if (i==nroflzstates)
if (!IS_LZ_HANDLE(src))
xread=(INT32(*)(HFILE32,LPVOID,UINT32))_lread32;
else
xread=LZRead32;
@ -537,7 +540,7 @@ static LPSTR LZEXPAND_MangleName( LPCSTR fn )
*/
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 )
{
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 )
{
int i;
struct lzstate *lzs;
TRACE(file,"(%d)\n",fd);
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
break;
if (i==nroflzstates) {
_lclose32(fd);
return;
}
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 );
if (!(lzs = GET_LZ_STATE(fd))) _lclose32(fd);
else
{
if (lzs->get) HeapFree( GetProcessHeap(), 0, lzs->get );
CloseHandle(lzs->realfd);
lzstates[fd - 0x400] = NULL;
HeapFree( SystemHeap, 0, lzs );
}
}
/***********************************************************************
@ -632,7 +629,7 @@ void WINAPI LZClose32( HFILE32 fd )
LONG WINAPI CopyLZFile16( HFILE16 src, HFILE16 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 <sys/types.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
#ifdef __EMX__
@ -90,3 +96,49 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg )
#endif /* __i386__ */
}
#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)
*
*/
INT32 WINAPI SetAbortProc32(HDC32 hdc, FARPROC32 abrtprc)
INT32 WINAPI SetAbortProc32(HDC32 hdc, ABORTPROC32 abrtprc)
{
FIXME(print, "stub\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);

View File

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

View File

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

View File

@ -225,7 +225,7 @@ static void ioctlGetDeviceInfo( CONTEXT *context )
RESET_CFLAG(context);
/* 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 );
FILE_ReleaseFile( file );
@ -725,7 +725,7 @@ static BOOL32 INT21_CreateTempFile( CONTEXT *context )
sprintf( p, "wine%04x.%03d", (int)getpid(), counter );
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 );
return TRUE;
@ -919,7 +919,7 @@ static void fLock( CONTEXT * context )
BX_reg(context),
MAKELONG(DX_reg(context),CX_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(DI_reg(context),SI_reg(context)), 0)) {
AX_reg(context) = DOS_ExtendedError;
@ -932,7 +932,7 @@ static void fLock( CONTEXT * context )
BX_reg(context),
MAKELONG(DX_reg(context),CX_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(DI_reg(context),SI_reg(context)), 0)) {
AX_reg(context) = DOS_ExtendedError;
@ -1127,8 +1127,10 @@ void WINAPI DOS3Call( CONTEXT *context )
break;
case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */
_lread16(1, (BYTE *)&context->Eax, 1);
break;
TRACE(int21,"DIRECT CHARACTER INPUT WITH ECHO\n");
AL_reg(context) = CONSOLE_GetCharacter();
/* FIXME: no echo */
break;
case 0x02: /* WRITE CHARACTER TO STANDARD OUTPUT */
TRACE(int21, "Write Character to Standard Output\n");
@ -1177,13 +1179,15 @@ void WINAPI DOS3Call( CONTEXT *context )
break;
}
case 0x0b: /* GET STDIN STATUS */
{
CHAR dummy;
case 0x0b: {/* GET STDIN STATUS */
char x1,x2;
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 */
TRACE(int21,"SET VERIFY FLAG ignored\n");
/* we cannot change the behaviour anyway, so just ignore it */
@ -1457,16 +1461,6 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x3e: /* "CLOSE" - CLOSE FILE */
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);
break;
@ -1566,7 +1560,7 @@ void WINAPI DOS3Call( CONTEXT *context )
break;
case 0x02:{
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$"))
ASPI_DOS_HandleInt(context);
FILE_ReleaseFile( file );
@ -1685,19 +1679,19 @@ void WINAPI DOS3Call( CONTEXT *context )
HANDLE32 handle;
TRACE(int21,"DUP - DUPLICATE FILE HANDLE %d\n",BX_reg(context));
if ((bSetDOSExtendedError = !DuplicateHandle( GetCurrentProcess(),
HFILE16_TO_HFILE32(BX_reg(context)),
FILE_GetHandle32(BX_reg(context)),
GetCurrentProcess(), &handle,
0, TRUE, DUPLICATE_SAME_ACCESS )))
AX_reg(context) = HFILE_ERROR16;
else
AX_reg(context) = HFILE32_TO_HFILE16(handle);
AX_reg(context) = FILE_AllocDosHandle(handle);
break;
}
case 0x46: /* "DUP2", "FORCEDUP" - FORCE DUPLICATE FILE HANDLE */
TRACE(int21,"FORCEDUP - FORCE DUPLICATE FILE HANDLE %d to %d\n",
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;
case 0x47: /* "CWD" - GET CURRENT DIRECTORY */
@ -1848,7 +1842,7 @@ void WINAPI DOS3Call( CONTEXT *context )
FILETIME filetime;
TRACE(int21,"GET FILE DATE AND TIME for handle %d\n",
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;
else FileTimeToDosDateTime( &filetime, &DX_reg(context),
&CX_reg(context) );
@ -1863,7 +1857,7 @@ void WINAPI DOS3Call( CONTEXT *context )
DosDateTimeToFileTime( DX_reg(context), CX_reg(context),
&filetime );
bSetDOSExtendedError =
(!SetFileTime( HFILE16_TO_HFILE32(BX_reg(context)),
(!SetFileTime( FILE_GetHandle32(BX_reg(context)),
NULL, NULL, &filetime ));
}
break;
@ -1897,7 +1891,7 @@ void WINAPI DOS3Call( CONTEXT *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)));
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);
break;
@ -2022,7 +2016,7 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x68: /* "FFLUSH" - COMMIT FILE */
case 0x6a: /* COMMIT FILE */
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;
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?
* There are pretty complete routines in multimedia/mcicda.c already! */
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));
break;

View File

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

File diff suppressed because it is too large Load Diff

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 (!szFileName) {
if (lParam2) lpmmioinfo->adwInfo[0] =
HFILE16_TO_HFILE32(lpmmioinfo->adwInfo[0]);
FILE_GetHandle32(lpmmioinfo->adwInfo[0]);
return 0;
}

View File

@ -527,6 +527,16 @@ HBITMAP32 BITMAP_CopyBitmap(HBITMAP32 hbitmap)
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

View File

@ -1269,3 +1269,25 @@ UINT32 WINAPI SetBoundsRect32(HDC32 hdc, const RECT32* rect, UINT32 flags)
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");
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");
return 0;

View File

@ -526,133 +526,133 @@ void WINAPI PlayMetaFileRecord16(
break;
case META_DELETEOBJECT:
DeleteObject32(*(ht->objectHandle + *(mr->rdParam)));
*(ht->objectHandle + *(mr->rdParam)) = 0;
DeleteObject32(*(ht->objectHandle + *(mr->rdParm)));
*(ht->objectHandle + *(mr->rdParm)) = 0;
break;
case META_SETBKCOLOR:
SetBkColor16(hdc, MAKELONG(*(mr->rdParam), *(mr->rdParam + 1)));
SetBkColor16(hdc, MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break;
case META_SETBKMODE:
SetBkMode16(hdc, *(mr->rdParam));
SetBkMode16(hdc, *(mr->rdParm));
break;
case META_SETMAPMODE:
SetMapMode16(hdc, *(mr->rdParam));
SetMapMode16(hdc, *(mr->rdParm));
break;
case META_SETROP2:
SetROP216(hdc, *(mr->rdParam));
SetROP216(hdc, *(mr->rdParm));
break;
case META_SETRELABS:
SetRelAbs16(hdc, *(mr->rdParam));
SetRelAbs16(hdc, *(mr->rdParm));
break;
case META_SETPOLYFILLMODE:
SetPolyFillMode16(hdc, *(mr->rdParam));
SetPolyFillMode16(hdc, *(mr->rdParm));
break;
case META_SETSTRETCHBLTMODE:
SetStretchBltMode16(hdc, *(mr->rdParam));
SetStretchBltMode16(hdc, *(mr->rdParm));
break;
case META_SETTEXTCOLOR:
SetTextColor16(hdc, MAKELONG(*(mr->rdParam), *(mr->rdParam + 1)));
SetTextColor16(hdc, MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break;
case META_SETWINDOWORG:
SetWindowOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam));
SetWindowOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_SETWINDOWEXT:
SetWindowExt(hdc, *(mr->rdParam + 1), *(mr->rdParam));
SetWindowExt(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_SETVIEWPORTORG:
SetViewportOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam));
SetViewportOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_SETVIEWPORTEXT:
SetViewportExt(hdc, *(mr->rdParam + 1), *(mr->rdParam));
SetViewportExt(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_OFFSETWINDOWORG:
OffsetWindowOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam));
OffsetWindowOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_SCALEWINDOWEXT:
ScaleWindowExt(hdc, *(mr->rdParam + 3), *(mr->rdParam + 2),
*(mr->rdParam + 1), *(mr->rdParam));
ScaleWindowExt(hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParm + 1), *(mr->rdParm));
break;
case META_OFFSETVIEWPORTORG:
OffsetViewportOrg(hdc, *(mr->rdParam + 1), *(mr->rdParam));
OffsetViewportOrg(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_SCALEVIEWPORTEXT:
ScaleViewportExt(hdc, *(mr->rdParam + 3), *(mr->rdParam + 2),
*(mr->rdParam + 1), *(mr->rdParam));
ScaleViewportExt(hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParm + 1), *(mr->rdParm));
break;
case META_LINETO:
LineTo32(hdc, (INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
LineTo32(hdc, (INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_MOVETO:
MoveTo(hdc, *(mr->rdParam + 1), *(mr->rdParam));
MoveTo(hdc, *(mr->rdParm + 1), *(mr->rdParm));
break;
case META_EXCLUDECLIPRECT:
ExcludeClipRect16( hdc, *(mr->rdParam + 3), *(mr->rdParam + 2),
*(mr->rdParam + 1), *(mr->rdParam) );
ExcludeClipRect16( hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParm + 1), *(mr->rdParm) );
break;
case META_INTERSECTCLIPRECT:
IntersectClipRect16( hdc, *(mr->rdParam + 3), *(mr->rdParam + 2),
*(mr->rdParam + 1), *(mr->rdParam) );
IntersectClipRect16( hdc, *(mr->rdParm + 3), *(mr->rdParm + 2),
*(mr->rdParm + 1), *(mr->rdParm) );
break;
case META_ARC:
Arc32(hdc, (INT16)*(mr->rdParam + 7), (INT16)*(mr->rdParam + 6),
(INT16)*(mr->rdParam + 5), (INT16)*(mr->rdParam + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
Arc32(hdc, (INT16)*(mr->rdParm + 7), (INT16)*(mr->rdParm + 6),
(INT16)*(mr->rdParm + 5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_ELLIPSE:
Ellipse32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
Ellipse32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_FLOODFILL:
FloodFill32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
MAKELONG(*(mr->rdParam), *(mr->rdParam + 1)));
FloodFill32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break;
case META_PIE:
Pie32(hdc, (INT16)*(mr->rdParam + 7), (INT16)*(mr->rdParam + 6),
(INT16)*(mr->rdParam + 5), (INT16)*(mr->rdParam + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
Pie32(hdc, (INT16)*(mr->rdParm + 7), (INT16)*(mr->rdParm + 6),
(INT16)*(mr->rdParm + 5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_RECTANGLE:
Rectangle32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
Rectangle32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_ROUNDRECT:
RoundRect32(hdc, (INT16)*(mr->rdParam + 5), (INT16)*(mr->rdParam + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
RoundRect32(hdc, (INT16)*(mr->rdParm + 5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_PATBLT:
PatBlt16(hdc, *(mr->rdParam + 5), *(mr->rdParam + 4),
*(mr->rdParam + 3), *(mr->rdParam + 2),
MAKELONG(*(mr->rdParam), *(mr->rdParam + 1)));
PatBlt16(hdc, *(mr->rdParm + 5), *(mr->rdParm + 4),
*(mr->rdParm + 3), *(mr->rdParm + 2),
MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break;
case META_SAVEDC:
@ -660,60 +660,60 @@ void WINAPI PlayMetaFileRecord16(
break;
case META_SETPIXEL:
SetPixel32(hdc, (INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
MAKELONG(*(mr->rdParam), *(mr->rdParam + 1)));
SetPixel32(hdc, (INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
MAKELONG(*(mr->rdParm), *(mr->rdParm + 1)));
break;
case META_OFFSETCLIPRGN:
OffsetClipRgn16( hdc, *(mr->rdParam + 1), *(mr->rdParam) );
OffsetClipRgn16( hdc, *(mr->rdParm + 1), *(mr->rdParm) );
break;
case META_TEXTOUT:
s1 = *(mr->rdParam);
TextOut16(hdc, *(mr->rdParam + ((s1 + 1) >> 1) + 2),
*(mr->rdParam + ((s1 + 1) >> 1) + 1),
(char *)(mr->rdParam + 1), s1);
s1 = *(mr->rdParm);
TextOut16(hdc, *(mr->rdParm + ((s1 + 1) >> 1) + 2),
*(mr->rdParm + ((s1 + 1) >> 1) + 1),
(char *)(mr->rdParm + 1), s1);
break;
case META_POLYGON:
Polygon16(hdc, (LPPOINT16)(mr->rdParam + 1), *(mr->rdParam));
Polygon16(hdc, (LPPOINT16)(mr->rdParm + 1), *(mr->rdParm));
break;
case META_POLYPOLYGON:
PolyPolygon16(hdc, (LPPOINT16)(mr->rdParam + *(mr->rdParam) + 1),
(LPINT16)(mr->rdParam + 1), *(mr->rdParam));
PolyPolygon16(hdc, (LPPOINT16)(mr->rdParm + *(mr->rdParm) + 1),
(LPINT16)(mr->rdParm + 1), *(mr->rdParm));
break;
case META_POLYLINE:
Polyline16(hdc, (LPPOINT16)(mr->rdParam + 1), *(mr->rdParam));
Polyline16(hdc, (LPPOINT16)(mr->rdParm + 1), *(mr->rdParm));
break;
case META_RESTOREDC:
RestoreDC32(hdc, (INT16)*(mr->rdParam));
RestoreDC32(hdc, (INT16)*(mr->rdParm));
break;
case META_SELECTOBJECT:
SelectObject32(hdc, *(ht->objectHandle + *(mr->rdParam)));
SelectObject32(hdc, *(ht->objectHandle + *(mr->rdParm)));
break;
case META_CHORD:
Chord32(hdc, (INT16)*(mr->rdParam + 7), (INT16)*(mr->rdParam + 6),
(INT16)*(mr->rdParam+5), (INT16)*(mr->rdParam + 4),
(INT16)*(mr->rdParam + 3), (INT16)*(mr->rdParam + 2),
(INT16)*(mr->rdParam + 1), (INT16)*(mr->rdParam));
Chord32(hdc, (INT16)*(mr->rdParm + 7), (INT16)*(mr->rdParm + 6),
(INT16)*(mr->rdParm+5), (INT16)*(mr->rdParm + 4),
(INT16)*(mr->rdParm + 3), (INT16)*(mr->rdParm + 2),
(INT16)*(mr->rdParm + 1), (INT16)*(mr->rdParm));
break;
case META_CREATEPATTERNBRUSH:
switch (*(mr->rdParam))
switch (*(mr->rdParm))
{
case BS_PATTERN:
infohdr = (BITMAPINFOHEADER *)(mr->rdParam + 2);
infohdr = (BITMAPINFOHEADER *)(mr->rdParm + 2);
MF_AddHandle(ht, nHandles,
CreatePatternBrush32(CreateBitmap32(infohdr->biWidth,
infohdr->biHeight,
infohdr->biPlanes,
infohdr->biBitCount,
(LPSTR)(mr->rdParam +
(LPSTR)(mr->rdParm +
(sizeof(BITMAPINFOHEADER) / 2) + 4))));
break;
@ -721,45 +721,45 @@ void WINAPI PlayMetaFileRecord16(
s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2;
hndl = GlobalAlloc16(GMEM_MOVEABLE, s1);
ptr = GlobalLock16(hndl);
memcpy(ptr, mr->rdParam + 2, s1);
memcpy(ptr, mr->rdParm + 2, s1);
GlobalUnlock16(hndl);
MF_AddHandle(ht, nHandles,
CreateDIBPatternBrush32(hndl, *(mr->rdParam + 1)));
CreateDIBPatternBrush32(hndl, *(mr->rdParm + 1)));
GlobalFree16(hndl);
}
break;
case META_CREATEPENINDIRECT:
MF_AddHandle(ht, nHandles,
CreatePenIndirect16((LOGPEN16 *)(&(mr->rdParam))));
CreatePenIndirect16((LOGPEN16 *)(&(mr->rdParm))));
break;
case META_CREATEFONTINDIRECT:
MF_AddHandle(ht, nHandles,
CreateFontIndirect16((LOGFONT16 *)(&(mr->rdParam))));
CreateFontIndirect16((LOGFONT16 *)(&(mr->rdParm))));
break;
case META_CREATEBRUSHINDIRECT:
MF_AddHandle(ht, nHandles,
CreateBrushIndirect16((LOGBRUSH16 *)(&(mr->rdParam))));
CreateBrushIndirect16((LOGBRUSH16 *)(&(mr->rdParm))));
break;
/* W. Magro: Some new metafile operations. Not all debugged. */
case META_CREATEPALETTE:
MF_AddHandle(ht, nHandles,
CreatePalette16((LPLOGPALETTE)mr->rdParam));
CreatePalette16((LPLOGPALETTE)mr->rdParm));
break;
case META_SETTEXTALIGN:
SetTextAlign16(hdc, *(mr->rdParam));
SetTextAlign16(hdc, *(mr->rdParm));
break;
case META_SELECTPALETTE:
SelectPalette16(hdc, *(ht->objectHandle + *(mr->rdParam+1)),*(mr->rdParam));
SelectPalette16(hdc, *(ht->objectHandle + *(mr->rdParm+1)),*(mr->rdParm));
break;
case META_SETMAPPERFLAGS:
SetMapperFlags16(hdc, *(mr->rdParam));
SetMapperFlags16(hdc, *(mr->rdParm));
break;
case META_REALIZEPALETTE:
@ -777,12 +777,12 @@ void WINAPI PlayMetaFileRecord16(
LPSTR sot;
DWORD len;
s1 = mr->rdParam[2]; /* String length */
s1 = mr->rdParm[2]; /* String length */
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 */
if (mr->rdParam[3])
sot= (LPSTR)&mr->rdParm[4]; /* start_of_text */
if (mr->rdParm[3])
sot+=sizeof(RECT16); /* there is a rectangle, so add offset */
if (mr->rdSize == len / 2)
@ -796,13 +796,13 @@ void WINAPI PlayMetaFileRecord16(
sot,mr->rdSize);
WARN(metafile,
"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] */
}
ExtTextOut16( hdc, mr->rdParam[1], /* X position */
mr->rdParam[0], /* Y position */
mr->rdParam[3], /* options */
mr->rdParam[3] ? (LPRECT16) &mr->rdParam[4]:NULL, /* rectangle */
ExtTextOut16( hdc, mr->rdParm[1], /* X position */
mr->rdParm[0], /* Y position */
mr->rdParm[3], /* options */
mr->rdParm[3] ? (LPRECT16) &mr->rdParm[4]:NULL, /* rectangle */
sot, /* string */
s1, dxx); /* length, dx array */
if (dxx)
@ -813,40 +813,40 @@ void WINAPI PlayMetaFileRecord16(
case META_STRETCHDIB:
{
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[11]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[2] );
StretchDIBits16(hdc,mr->rdParam[10],mr->rdParam[9],mr->rdParam[8],
mr->rdParam[7],mr->rdParam[6],mr->rdParam[5],
mr->rdParam[4],mr->rdParam[3],bits,info,
mr->rdParam[2],MAKELONG(mr->rdParam[0],mr->rdParam[1]));
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[11]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[2] );
StretchDIBits16(hdc,mr->rdParm[10],mr->rdParm[9],mr->rdParm[8],
mr->rdParm[7],mr->rdParm[6],mr->rdParm[5],
mr->rdParm[4],mr->rdParm[3],bits,info,
mr->rdParm[2],MAKELONG(mr->rdParm[0],mr->rdParm[1]));
}
break;
case META_DIBSTRETCHBLT:
{
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[10]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[2] );
StretchDIBits16(hdc,mr->rdParam[9],mr->rdParam[8],mr->rdParam[7],
mr->rdParam[6],mr->rdParam[5],mr->rdParam[4],
mr->rdParam[3],mr->rdParam[2],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1]));
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[10]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[2] );
StretchDIBits16(hdc,mr->rdParm[9],mr->rdParm[8],mr->rdParm[7],
mr->rdParm[6],mr->rdParm[5],mr->rdParm[4],
mr->rdParm[3],mr->rdParm[2],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParm[0],mr->rdParm[1]));
}
break;
case META_STRETCHBLT:
{
HDC16 hdcSrc=CreateCompatibleDC16(hdc);
HBITMAP32 hbitmap=CreateBitmap32(mr->rdParam[10], /*Width */
mr->rdParam[11], /*Height*/
mr->rdParam[13], /*Planes*/
mr->rdParam[14], /*BitsPixel*/
(LPSTR)&mr->rdParam[15]); /*bits*/
HBITMAP32 hbitmap=CreateBitmap32(mr->rdParm[10], /*Width */
mr->rdParm[11], /*Height*/
mr->rdParm[13], /*Planes*/
mr->rdParm[14], /*BitsPixel*/
(LPSTR)&mr->rdParm[15]); /*bits*/
SelectObject32(hdcSrc,hbitmap);
StretchBlt16(hdc,mr->rdParam[9],mr->rdParam[8],
mr->rdParam[7],mr->rdParam[6],
hdcSrc,mr->rdParam[5],mr->rdParam[4],
mr->rdParam[3],mr->rdParam[2],
MAKELONG(mr->rdParam[0],mr->rdParam[1]));
StretchBlt16(hdc,mr->rdParm[9],mr->rdParm[8],
mr->rdParm[7],mr->rdParm[6],
hdcSrc,mr->rdParm[5],mr->rdParm[4],
mr->rdParm[3],mr->rdParm[2],
MAKELONG(mr->rdParm[0],mr->rdParm[1]));
DeleteDC32(hdcSrc);
}
break;
@ -854,16 +854,16 @@ void WINAPI PlayMetaFileRecord16(
case META_BITBLT: /* <-- not yet debugged */
{
HDC16 hdcSrc=CreateCompatibleDC16(hdc);
HBITMAP32 hbitmap=CreateBitmap32(mr->rdParam[7]/*Width */,
mr->rdParam[8]/*Height*/,
mr->rdParam[10]/*Planes*/,
mr->rdParam[11]/*BitsPixel*/,
(LPSTR)&mr->rdParam[12]/*bits*/);
HBITMAP32 hbitmap=CreateBitmap32(mr->rdParm[7]/*Width */,
mr->rdParm[8]/*Height*/,
mr->rdParm[10]/*Planes*/,
mr->rdParm[11]/*BitsPixel*/,
(LPSTR)&mr->rdParm[12]/*bits*/);
SelectObject32(hdcSrc,hbitmap);
BitBlt32(hdc,(INT16)mr->rdParam[6],(INT16)mr->rdParam[5],
(INT16)mr->rdParam[4],(INT16)mr->rdParam[3],
hdcSrc, (INT16)mr->rdParam[2],(INT16)mr->rdParam[1],
MAKELONG(0,mr->rdParam[0]));
BitBlt32(hdc,(INT16)mr->rdParm[6],(INT16)mr->rdParm[5],
(INT16)mr->rdParm[4],(INT16)mr->rdParm[3],
hdcSrc, (INT16)mr->rdParm[2],(INT16)mr->rdParm[1],
MAKELONG(0,mr->rdParm[0]));
DeleteDC32(hdcSrc);
}
break;
@ -879,51 +879,51 @@ void WINAPI PlayMetaFileRecord16(
break;
case META_FILLREGION:
FillRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)),
*(ht->objectHandle + *(mr->rdParam+1)));
FillRgn16(hdc, *(ht->objectHandle + *(mr->rdParm)),
*(ht->objectHandle + *(mr->rdParm+1)));
break;
case META_INVERTREGION:
InvertRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)));
InvertRgn16(hdc, *(ht->objectHandle + *(mr->rdParm)));
break;
case META_PAINTREGION:
PaintRgn16(hdc, *(ht->objectHandle + *(mr->rdParam)));
PaintRgn16(hdc, *(ht->objectHandle + *(mr->rdParm)));
break;
case META_SELECTCLIPREGION:
SelectClipRgn32(hdc, *(ht->objectHandle + *(mr->rdParam)));
SelectClipRgn32(hdc, *(ht->objectHandle + *(mr->rdParm)));
break;
case META_DIBCREATEPATTERNBRUSH:
/* *(mr->rdParam) may be BS_PATTERN or BS_DIBPATTERN: but there's no difference */
TRACE(metafile,"%d\n",*(mr->rdParam));
/* *(mr->rdParm) may be BS_PATTERN or BS_DIBPATTERN: but there's no difference */
TRACE(metafile,"%d\n",*(mr->rdParm));
s1 = mr->rdSize * 2 - sizeof(METARECORD) - 2;
hndl = GlobalAlloc16(GMEM_MOVEABLE, s1);
ptr = GlobalLock16(hndl);
memcpy(ptr, mr->rdParam + 2, s1);
memcpy(ptr, mr->rdParm + 2, s1);
GlobalUnlock16(hndl);
MF_AddHandle(ht, nHandles,CreateDIBPatternBrush16(hndl, *(mr->rdParam + 1)));
MF_AddHandle(ht, nHandles,CreateDIBPatternBrush16(hndl, *(mr->rdParm + 1)));
GlobalFree16(hndl);
break;
case META_DIBBITBLT:
{
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParam[8]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParam[0] );
StretchDIBits16(hdc,mr->rdParam[7],mr->rdParam[6],mr->rdParam[5],
mr->rdParam[4],mr->rdParam[3],mr->rdParam[2],
mr->rdParam[5],mr->rdParam[4],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParam[0],mr->rdParam[1]));
LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[8]);
LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[0] );
StretchDIBits16(hdc,mr->rdParm[7],mr->rdParm[6],mr->rdParm[5],
mr->rdParm[4],mr->rdParm[3],mr->rdParm[2],
mr->rdParm[5],mr->rdParm[4],bits,info,
DIB_RGB_COLORS,MAKELONG(mr->rdParm[0],mr->rdParm[1]));
}
break;
case META_SETTEXTCHAREXTRA:
SetTextCharacterExtra16(hdc, (INT16)*(mr->rdParam));
SetTextCharacterExtra16(hdc, (INT16)*(mr->rdParm));
break;
case META_SETTEXTJUSTIFICATION:
SetTextJustification32(hdc, *(mr->rdParam + 1), *(mr->rdParam));
SetTextJustification32(hdc, *(mr->rdParm + 1), *(mr->rdParm));
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:
*
* rdParam meaning
* rdParm meaning
* 0 Always 0?
* 1 Always 6?
* 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
* written as
* 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?
*
@ -1119,7 +1119,7 @@ static BOOL32 MF_Meta_CreateRegion( METARECORD *mr, HRGN32 hrgn )
INT16 y0, y1;
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) {
if(*start / 2 != (*start + 1) / 2) {
WARN(metafile, "Delimiter not even.\n");
@ -1215,7 +1215,7 @@ BOOL32 MF_MetaParam1(DC *dc, short func, short param1)
mr->rdSize = 4;
mr->rdFunction = func;
*(mr->rdParam) = param1;
*(mr->rdParm) = param1;
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->rdFunction = func;
*(mr->rdParam) = param2;
*(mr->rdParam + 1) = param1;
*(mr->rdParm) = param2;
*(mr->rdParm + 1) = param1;
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->rdFunction = func;
*(mr->rdParam) = param4;
*(mr->rdParam + 1) = param3;
*(mr->rdParam + 2) = param2;
*(mr->rdParam + 3) = param1;
*(mr->rdParm) = param4;
*(mr->rdParm + 1) = param3;
*(mr->rdParm + 2) = param2;
*(mr->rdParm + 3) = param1;
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->rdFunction = func;
*(mr->rdParam) = param6;
*(mr->rdParam + 1) = param5;
*(mr->rdParam + 2) = param4;
*(mr->rdParam + 3) = param3;
*(mr->rdParam + 4) = param2;
*(mr->rdParam + 5) = param1;
*(mr->rdParm) = param6;
*(mr->rdParm + 1) = param5;
*(mr->rdParm + 2) = param4;
*(mr->rdParm + 3) = param3;
*(mr->rdParm + 4) = param2;
*(mr->rdParm + 5) = param1;
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->rdFunction = func;
*(mr->rdParam) = param8;
*(mr->rdParam + 1) = param7;
*(mr->rdParam + 2) = param6;
*(mr->rdParam + 3) = param5;
*(mr->rdParam + 4) = param4;
*(mr->rdParam + 5) = param3;
*(mr->rdParam + 6) = param2;
*(mr->rdParam + 7) = param1;
*(mr->rdParm) = param8;
*(mr->rdParm + 1) = param7;
*(mr->rdParm + 2) = param6;
*(mr->rdParm + 3) = param5;
*(mr->rdParm + 4) = param4;
*(mr->rdParm + 5) = param3;
*(mr->rdParm + 6) = param2;
*(mr->rdParm + 7) = param1;
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->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;
mr->rdSize = sizeof(METARECORD) / 2;
mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index;
*(mr->rdParm) = index;
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);
mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
mr->rdSize = len / 2;
*(mr->rdParam) = logbrush->lbStyle;
*(mr->rdParam + 1) = DIB_RGB_COLORS;
infohdr = (BITMAPINFOHEADER *)(mr->rdParam + 2);
*(mr->rdParm) = logbrush->lbStyle;
*(mr->rdParm + 1) = DIB_RGB_COLORS;
infohdr = (BITMAPINFOHEADER *)(mr->rdParm + 2);
infohdr->biSize = sizeof(BITMAPINFOHEADER);
infohdr->biWidth = bmp->bitmap.bmWidth;
infohdr->biHeight = bmp->bitmap.bmHeight;
infohdr->biPlanes = bmp->bitmap.bmPlanes;
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),
bmp->bitmap.bmHeight * bmp->bitmap.bmWidthBytes);
GDI_HEAP_UNLOCK(logbrush->lbHatch);
@ -1386,9 +1386,9 @@ BOOL32 MF_CreatePatternBrush(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
memset(mr, 0, len);
mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
mr->rdSize = len / 2;
*(mr->rdParam) = logbrush->lbStyle;
*(mr->rdParam + 1) = LOWORD(logbrush->lbColor);
memcpy(mr->rdParam + 2, info, biSize + bmSize);
*(mr->rdParm) = logbrush->lbStyle;
*(mr->rdParm + 1) = LOWORD(logbrush->lbColor);
memcpy(mr->rdParm + 2, info, biSize + bmSize);
break;
default:
return FALSE;
@ -1406,7 +1406,7 @@ BOOL32 MF_CreatePatternBrush(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index;
*(mr->rdParm) = index;
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->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;
mr->rdSize = sizeof(METARECORD) / 2;
mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index;
*(mr->rdParm) = index;
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->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;
mr->rdSize = sizeof(METARECORD) / 2;
mr->rdFunction = META_SELECTOBJECT;
if ((index = MF_AddHandleDC( dc )) == -1) return FALSE;
*(mr->rdParam) = index;
*(mr->rdParm) = index;
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->rdFunction = META_TEXTOUT;
*(mr->rdParam) = count;
memcpy(mr->rdParam + 1, str, count);
*(mr->rdParam + ((count + 1) >> 1) + 1) = y;
*(mr->rdParam + ((count + 1) >> 1) + 2) = x;
*(mr->rdParm) = count;
memcpy(mr->rdParm + 1, str, count);
*(mr->rdParm + ((count + 1) >> 1) + 1) = y;
*(mr->rdParm + ((count + 1) >> 1) + 2) = x;
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2);
GlobalFree16(hmr);
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->rdFunction = META_EXTTEXTOUT;
*(mr->rdParam) = y;
*(mr->rdParam + 1) = x;
*(mr->rdParam + 2) = count;
*(mr->rdParam + 3) = flags;
if (rect) memcpy(mr->rdParam + 4, rect, sizeof(RECT16));
memcpy(mr->rdParam + (rect ? 8 : 4), str, count);
*(mr->rdParm) = y;
*(mr->rdParm + 1) = x;
*(mr->rdParm + 2) = count;
*(mr->rdParm + 3) = flags;
if (rect) memcpy(mr->rdParm + 4, rect, sizeof(RECT16));
memcpy(mr->rdParm + (rect ? 8 : 4), str, count);
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));
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2);
GlobalFree16(hmr);
@ -1544,8 +1544,8 @@ BOOL32 MF_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count)
mr->rdSize = len / 2;
mr->rdFunction = func;
*(mr->rdParam) = count;
memcpy(mr->rdParam + 1, pt, count * 4);
*(mr->rdParm) = count;
memcpy(mr->rdParm + 1, pt, count * 4);
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2);
GlobalFree16(hmr);
return ret;
@ -1570,23 +1570,23 @@ BOOL32 MF_BitBlt(DC *dcDest, short xDest, short yDest, short width,
return FALSE;
mr = (METARECORD *)GlobalLock16(hmr);
mr->rdFunction = META_BITBLT;
*(mr->rdParam + 7) = BM.bmWidth;
*(mr->rdParam + 8) = BM.bmHeight;
*(mr->rdParam + 9) = BM.bmWidthBytes;
*(mr->rdParam +10) = BM.bmPlanes;
*(mr->rdParam +11) = BM.bmBitsPixel;
*(mr->rdParm + 7) = BM.bmWidth;
*(mr->rdParm + 8) = BM.bmHeight;
*(mr->rdParm + 9) = BM.bmWidthBytes;
*(mr->rdParm +10) = BM.bmPlanes;
*(mr->rdParm +11) = BM.bmBitsPixel;
TRACE(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop);
if (GetBitmapBits32(dcSrc->w.hBitmap,BM.bmWidthBytes * BM.bmHeight,
mr->rdParam +12))
mr->rdParm +12))
{
mr->rdSize = len / sizeof(INT16);
*(mr->rdParam) = HIWORD(rop);
*(mr->rdParam + 1) = ySrc;
*(mr->rdParam + 2) = xSrc;
*(mr->rdParam + 3) = height;
*(mr->rdParam + 4) = width;
*(mr->rdParam + 5) = yDest;
*(mr->rdParam + 6) = xDest;
*(mr->rdParm) = HIWORD(rop);
*(mr->rdParm + 1) = ySrc;
*(mr->rdParm + 2) = xSrc;
*(mr->rdParm + 3) = height;
*(mr->rdParm + 4) = width;
*(mr->rdParm + 5) = yDest;
*(mr->rdParm + 6) = xDest;
ret = MF_WriteRecord( dcDest, mr, mr->rdSize * 2);
}
else
@ -1627,7 +1627,7 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
return FALSE;
mr = (METARECORD *)GlobalLock16(hmr);
mr->rdFunction = META_DIBSTRETCHBLT;
lpBMI=(LPBITMAPINFOHEADER)(mr->rdParam+10);
lpBMI=(LPBITMAPINFOHEADER)(mr->rdParm+10);
lpBMI->biSize = sizeof(BITMAPINFOHEADER);
lpBMI->biWidth = BM.bmWidth;
lpBMI->biHeight = BM.bmHeight;
@ -1652,27 +1652,27 @@ BOOL32 MF_StretchBlt(DC *dcDest, short xDest, short yDest, short widthDest,
return FALSE;
mr = (METARECORD *)GlobalLock16(hmr);
mr->rdFunction = META_STRETCHBLT;
*(mr->rdParam +10) = BM.bmWidth;
*(mr->rdParam +11) = BM.bmHeight;
*(mr->rdParam +12) = BM.bmWidthBytes;
*(mr->rdParam +13) = BM.bmPlanes;
*(mr->rdParam +14) = BM.bmBitsPixel;
*(mr->rdParm +10) = BM.bmWidth;
*(mr->rdParm +11) = BM.bmHeight;
*(mr->rdParm +12) = BM.bmWidthBytes;
*(mr->rdParm +13) = BM.bmPlanes;
*(mr->rdParm +14) = BM.bmBitsPixel;
TRACE(metafile,"MF_StretchBlt->len = %ld rop=%lx \n",len,rop);
if (GetBitmapBits32( dcSrc->w.hBitmap, BM.bmWidthBytes * BM.bmHeight,
mr->rdParam +15))
mr->rdParm +15))
#endif
{
mr->rdSize = len / sizeof(INT16);
*(mr->rdParam) = LOWORD(rop);
*(mr->rdParam + 1) = HIWORD(rop);
*(mr->rdParam + 2) = heightSrc;
*(mr->rdParam + 3) = widthSrc;
*(mr->rdParam + 4) = ySrc;
*(mr->rdParam + 5) = xSrc;
*(mr->rdParam + 6) = heightDest;
*(mr->rdParam + 7) = widthDest;
*(mr->rdParam + 8) = yDest;
*(mr->rdParam + 9) = xDest;
*(mr->rdParm) = LOWORD(rop);
*(mr->rdParm + 1) = HIWORD(rop);
*(mr->rdParm + 2) = heightSrc;
*(mr->rdParm + 3) = widthSrc;
*(mr->rdParm + 4) = ySrc;
*(mr->rdParm + 5) = xSrc;
*(mr->rdParm + 6) = heightDest;
*(mr->rdParm + 7) = widthDest;
*(mr->rdParm + 8) = yDest;
*(mr->rdParm + 9) = xDest;
ret = MF_WriteRecord( dcDest, mr, mr->rdSize * 2);
}
else
@ -1714,7 +1714,7 @@ INT16 MF_CreateRegion(DC *dc, HRGN32 hrgn)
memset(mr, 0, len);
Param = mr->rdParam + 11;
Param = mr->rdParm + 11;
StartBand = NULL;
pEndRect = (RECT32 *)rgndata->Buffer + rgndata->rdh.nCount;
@ -1744,17 +1744,17 @@ INT16 MF_CreateRegion(DC *dc, HRGN32 hrgn)
}
len = Param - (WORD *)mr;
mr->rdParam[0] = 0;
mr->rdParam[1] = 6;
mr->rdParam[2] = 0x1234;
mr->rdParam[3] = 0;
mr->rdParam[4] = len * 2;
mr->rdParam[5] = Bands;
mr->rdParam[6] = MaxBands;
mr->rdParam[7] = rgndata->rdh.rcBound.left;
mr->rdParam[8] = rgndata->rdh.rcBound.top;
mr->rdParam[9] = rgndata->rdh.rcBound.right;
mr->rdParam[10] = rgndata->rdh.rcBound.bottom;
mr->rdParm[0] = 0;
mr->rdParm[1] = 6;
mr->rdParm[2] = 0x1234;
mr->rdParm[3] = 0;
mr->rdParm[4] = len * 2;
mr->rdParm[5] = Bands;
mr->rdParm[6] = MaxBands;
mr->rdParm[7] = rgndata->rdh.rcBound.left;
mr->rdParm[8] = rgndata->rdh.rcBound.top;
mr->rdParm[9] = rgndata->rdh.rcBound.right;
mr->rdParm[10] = rgndata->rdh.rcBound.bottom;
mr->rdFunction = META_CREATEREGION;
mr->rdSize = len / 2;
ret = MF_WriteRecord( dc, mr, mr->rdSize * 2 );

View File

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

View File

@ -7,17 +7,17 @@ init MAIN_GdiInit
2 stdcall AddFontResourceA(str) AddFontResource32A
3 stub AddFontResourceTracking
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
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
10 stdcall BitBlt(long long long long long long long long long) BitBlt32
11 stub CancelDC
12 stub CheckColorsInGamut
13 stdcall ChoosePixelFormat(long ptr) ChoosePixelFormat
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
17 stdcall CloseMetaFile(long) CloseMetaFile32
18 stub ColorMatchToTarget
@ -76,7 +76,7 @@ init MAIN_GdiInit
71 stdcall DescribePixelFormat(long long long ptr) DescribePixelFormat
72 stub DeviceCapabilitiesExA
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
76 stdcall EndDoc(long) EndDoc32
77 stdcall EndPage(long) EndPage32
@ -97,7 +97,7 @@ init MAIN_GdiInit
92 stdcall ExcludeClipRect(long long long long long) ExcludeClipRect32
93 stdcall ExtCreatePen(long long ptr long ptr) ExtCreatePen32
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
97 stdcall ExtSelectClipRgn(long long long) ExtSelectClipRgn
98 stdcall ExtTextOutA(long long long long ptr str long ptr) ExtTextOut32A
@ -111,7 +111,7 @@ init MAIN_GdiInit
106 stub FreeImageColorMatcher
107 stub GdiAssociateObject
108 stub GdiCleanCacheDC
109 stdcall GdiComment(long long ptr) GdiComment32
109 stdcall GdiComment(long long ptr) GdiComment
110 stub GdiConvertAndCheckDC
111 stub GdiConvertBitmap
112 stub GdiConvertBrush
@ -166,7 +166,7 @@ init MAIN_GdiInit
161 stdcall GetCharacterPlacementW(long wstr long long ptr long) GetCharacterPlacement32W
162 stdcall GetClipBox(long ptr) GetClipBox32
163 stdcall GetClipRgn(long long) GetClipRgn32
164 stdcall GetColorAdjustment(long ptr) GetColorAdjustment32
164 stdcall GetColorAdjustment(long ptr) GetColorAdjustment
165 stdcall GetColorSpace(long) GetColorSpace
166 stdcall GetCurrentObject(long long) GetCurrentObject
167 stdcall GetCurrentPositionEx(long ptr) GetCurrentPositionEx32
@ -274,7 +274,7 @@ init MAIN_GdiInit
269 stdcall PolyBezierTo(long ptr long) PolyBezierTo32
270 stdcall PolyDraw(long ptr ptr long) PolyDraw
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
274 stub PolyTextOutW
275 stdcall Polygon(long ptr long) Polygon32

View File

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

View File

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

View File

@ -127,7 +127,7 @@ init Shell32LibMain
119 stdcall IsLFNDrive(str) IsLFNDrive32A
120 stub FileMenu_AbortInitMenu
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
124 stub FileMenu_AppendFilesForPidl
125 stub FileMenu_AddFilesForPidl
@ -180,14 +180,14 @@ init Shell32LibMain
172 stub SHCreateLinks
173 stub SHValidateUNC
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
177 stub DAD_SetDragImageFromListView
178 stub SHObjectProperties
179 stub SHGetNewLinkInfoA
180 stub SHGetNewLinkInfoW
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
184 stdcall ArrangeWindows(long long long long long) ArrangeWindows
185 stub SHHandleDiskFull
@ -375,5 +375,5 @@ init Shell32LibMain
1217 stub FOOBAR1217 # no joke! This is the real name!!
# later additions ... FIXME: incorrect ordinals
1218 stdcall SHGetSpecialFolderPathA(long long long long) SHGetSpecialFolderPath
1218 stdcall SHGetSpecialFolderPathA(long ptr long long) SHGetSpecialFolderPath32A
1219 stub DoEnvironmentSubstW

View File

@ -720,6 +720,15 @@ DWORD WINAPI GetProcessFlags( DWORD processid )
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]
* 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;
}
/***********************************************************************
* 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,
struct termios *term, struct winsize *winsize)
{
int fdm, fds;
char *ptr1, *ptr2;
char pts_name[512];
int temp, slave;
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;
req.handle = console->hread;
CLIENT_SendRequest(REQ_SET_CONSOLE_FD, dup(slave), 1,
&req, sizeof(req));
CLIENT_WaitReply( NULL, NULL, 0);
req.handle = console->hwrite;
CLIENT_SendRequest( REQ_SET_CONSOLE_FD, dup(slave), 1,
&req, sizeof(req));
CLIENT_WaitReply( NULL, NULL, 0);
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;
CLIENT_SendRequest( REQ_SET_CONSOLE_FD, dup(fds), 1, &req, sizeof(req) );
CLIENT_WaitReply( NULL, NULL, 0 );
req.handle = console->hwrite;
CLIENT_SendRequest( REQ_SET_CONSOLE_FD, dup(fds), 1, &req, sizeof(req) );
CLIENT_WaitReply( NULL, NULL, 0 );
if (term != NULL)
tcsetattr(console->infd, TCSANOW, term);
if (winsize != NULL)
ioctl(console->outfd, TIOCSWINSZ, winsize);
if (name != NULL)
strcpy(name, pts_name);
return fds;
}
}
return -1;
return temp; /* The same result as the openpty call */
}
/*************************************************************************

View File

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

View File

@ -300,7 +300,7 @@ BOOL32 WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent,
DWORD 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)
{
FIXME(dinput, "stub!\n");
#if 0
if (lpCallback)
lpCallback(NULL, lpvRef);
#endif
return DI_OK;
}

View File

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