mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against ebae298aa4d2711fef35d4ac60c6012438f36d61.
This commit is contained in:
parent
a1b38470f1
commit
84f6fd6c09
@ -1,31 +0,0 @@
|
||||
From 1cee10b74621b8d70ff31b6e358ee52bd57e695e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B3zef=20Kucia?= <jkucia@codeweavers.com>
|
||||
Date: Sat, 2 Jan 2016 11:48:45 +0100
|
||||
Subject: [PATCH] ddraw: Prevent division by zero in viewport_activate.
|
||||
Reply-To: wine-devel <wine-devel@winehq.org>
|
||||
|
||||
This just stop the crash, without fixing the actual cause.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36763
|
||||
---
|
||||
dlls/ddraw/viewport.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c
|
||||
index 5ebc41e..16cdad4 100644
|
||||
--- a/dlls/ddraw/viewport.c
|
||||
+++ b/dlls/ddraw/viewport.c
|
||||
@@ -71,6 +71,10 @@ void viewport_activate(struct d3d_viewport *This, BOOL ignore_lights)
|
||||
/* And copy the values in the structure used by the device */
|
||||
if (This->use_vp2)
|
||||
{
|
||||
+ if (!This->viewports.vp2.dvMinZ && !This->viewports.vp2.dvMaxZ
|
||||
+ && !This->viewports.vp2.dvClipWidth && !This->viewports.vp2.dvClipHeight)
|
||||
+ return;
|
||||
+
|
||||
vp.dwX = This->viewports.vp2.dwX;
|
||||
vp.dwY = This->viewports.vp2.dwY;
|
||||
vp.dwHeight = This->viewports.vp2.dwHeight;
|
||||
--
|
||||
2.4.10
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [36763] Prevent division by zero in viewport_activate
|
@ -1,127 +0,0 @@
|
||||
From 3c6e50c54130738fadbb4b7e1a05a5a0c9c9b538 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 15 Nov 2015 00:39:08 +0100
|
||||
Subject: oleaut32: Handle TKIND_COCLASS in proxy/stub marshalling.
|
||||
|
||||
Based on a patch by Jan T. Ohlsen.
|
||||
---
|
||||
dlls/oleaut32/tmarshal.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 66 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
|
||||
index f4ce311..0211387 100644
|
||||
--- a/dlls/oleaut32/tmarshal.c
|
||||
+++ b/dlls/oleaut32/tmarshal.c
|
||||
@@ -851,7 +851,9 @@ serialize_param(
|
||||
return hres;
|
||||
}
|
||||
ITypeInfo_GetTypeAttr(tinfo2,&tattr);
|
||||
- derefhere = (tattr->typekind != TKIND_DISPATCH && tattr->typekind != TKIND_INTERFACE);
|
||||
+ derefhere = (tattr->typekind != TKIND_DISPATCH &&
|
||||
+ tattr->typekind != TKIND_INTERFACE &&
|
||||
+ tattr->typekind != TKIND_COCLASS);
|
||||
}
|
||||
break;
|
||||
case TKIND_ENUM: /* confirmed */
|
||||
@@ -859,6 +861,7 @@ serialize_param(
|
||||
break;
|
||||
case TKIND_DISPATCH: /* will be done in VT_USERDEFINED case */
|
||||
case TKIND_INTERFACE: /* will be done in VT_USERDEFINED case */
|
||||
+ case TKIND_COCLASS: /* will be done in VT_USERDEFINED case */
|
||||
derefhere=FALSE;
|
||||
break;
|
||||
default:
|
||||
@@ -920,6 +923,36 @@ serialize_param(
|
||||
if (dealloc)
|
||||
IUnknown_Release((LPUNKNOWN)arg);
|
||||
break;
|
||||
+ case TKIND_COCLASS: {
|
||||
+ GUID iid = tattr->guid;
|
||||
+ unsigned int i;
|
||||
+ int type_flags;
|
||||
+
|
||||
+ for(i = 0; i < tattr->cImplTypes; i++) {
|
||||
+ if(SUCCEEDED(ITypeInfo_GetImplTypeFlags(tinfo2, i, &type_flags)) &&
|
||||
+ type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) {
|
||||
+ ITypeInfo *tinfo3;
|
||||
+ TYPEATTR *tattr2;
|
||||
+ HREFTYPE href;
|
||||
+ if(FAILED(ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href)))
|
||||
+ break;
|
||||
+ if(FAILED(ITypeInfo_GetRefTypeInfo(tinfo2, href, &tinfo3)))
|
||||
+ break;
|
||||
+ if(SUCCEEDED(ITypeInfo_GetTypeAttr(tinfo3, &tattr2))) {
|
||||
+ iid = tattr2->guid;
|
||||
+ ITypeInfo_ReleaseTypeAttr(tinfo3, tattr2);
|
||||
+ }
|
||||
+ ITypeInfo_Release(tinfo3);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if(writeit)
|
||||
+ hres=_marshal_interface(buf, &iid, (LPUNKNOWN)arg);
|
||||
+ if(dealloc)
|
||||
+ IUnknown_Release((LPUNKNOWN)arg);
|
||||
+ break;
|
||||
+ }
|
||||
case TKIND_RECORD: {
|
||||
int i;
|
||||
if (debugout) TRACE_(olerelay)("{");
|
||||
@@ -1129,7 +1162,9 @@ deserialize_param(
|
||||
return hres;
|
||||
}
|
||||
ITypeInfo_GetTypeAttr(tinfo2,&tattr);
|
||||
- derefhere = (tattr->typekind != TKIND_DISPATCH && tattr->typekind != TKIND_INTERFACE);
|
||||
+ derefhere = (tattr->typekind != TKIND_DISPATCH &&
|
||||
+ tattr->typekind != TKIND_INTERFACE &&
|
||||
+ tattr->typekind != TKIND_COCLASS);
|
||||
}
|
||||
break;
|
||||
case TKIND_ENUM: /* confirmed */
|
||||
@@ -1137,6 +1172,7 @@ deserialize_param(
|
||||
break;
|
||||
case TKIND_DISPATCH: /* will be done in VT_USERDEFINED case */
|
||||
case TKIND_INTERFACE: /* will be done in VT_USERDEFINED case */
|
||||
+ case TKIND_COCLASS: /* will be done in VT_USERDEFINED case */
|
||||
derefhere=FALSE;
|
||||
break;
|
||||
default:
|
||||
@@ -1211,6 +1247,34 @@ deserialize_param(
|
||||
if (readit)
|
||||
hres = _unmarshal_interface(buf,&(tattr->guid),(LPUNKNOWN*)arg);
|
||||
break;
|
||||
+ case TKIND_COCLASS: {
|
||||
+ GUID iid = tattr->guid;
|
||||
+ unsigned int i;
|
||||
+ int type_flags;
|
||||
+
|
||||
+ for(i = 0; i < tattr->cImplTypes; i++) {
|
||||
+ if(SUCCEEDED(ITypeInfo_GetImplTypeFlags(tinfo2, i, &type_flags)) &&
|
||||
+ type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) {
|
||||
+ ITypeInfo *tinfo3;
|
||||
+ TYPEATTR *tattr2;
|
||||
+ HREFTYPE href;
|
||||
+ if(FAILED(ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href)))
|
||||
+ break;
|
||||
+ if(FAILED(ITypeInfo_GetRefTypeInfo(tinfo2, href, &tinfo3)))
|
||||
+ break;
|
||||
+ if(SUCCEEDED(ITypeInfo_GetTypeAttr(tinfo3, &tattr2))) {
|
||||
+ iid = tattr2->guid;
|
||||
+ ITypeInfo_ReleaseTypeAttr(tinfo3, tattr2);
|
||||
+ }
|
||||
+ ITypeInfo_Release(tinfo3);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if(readit)
|
||||
+ hres = _unmarshal_interface(buf, &iid, (LPUNKNOWN*)arg);
|
||||
+ break;
|
||||
+ }
|
||||
case TKIND_RECORD: {
|
||||
int i;
|
||||
|
||||
--
|
||||
2.6.2
|
||||
|
@ -1,393 +0,0 @@
|
||||
From 66e6fc41a321121dd1b19de16b700ffa5ad52989 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 15 Nov 2015 04:25:27 +0100
|
||||
Subject: [PATCH] oleaut32: Initial preparation to make marshalling compatible
|
||||
with x86_64.
|
||||
|
||||
---
|
||||
dlls/oleaut32/tmarshal.c | 94 ++++++++++++++++++++++++++----------------------
|
||||
dlls/oleaut32/typelib.c | 8 ++---
|
||||
dlls/oleaut32/typelib.h | 2 +-
|
||||
3 files changed, 57 insertions(+), 47 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
|
||||
index afb1b67..49cbf81 100644
|
||||
--- a/dlls/oleaut32/tmarshal.c
|
||||
+++ b/dlls/oleaut32/tmarshal.c
|
||||
@@ -635,42 +635,51 @@ static const IRpcProxyBufferVtbl tmproxyvtable = {
|
||||
TMProxyImpl_Disconnect
|
||||
};
|
||||
|
||||
-/* how much space do we use on stack in DWORD steps. */
|
||||
+/* how much space do we use on stack in DWORD_PTR steps. */
|
||||
static int
|
||||
_argsize(TYPEDESC *tdesc, ITypeInfo *tinfo) {
|
||||
+ DWORD ret;
|
||||
switch (tdesc->vt) {
|
||||
case VT_I8:
|
||||
case VT_UI8:
|
||||
- return 8/sizeof(DWORD);
|
||||
+ ret = 8;
|
||||
+ break;
|
||||
case VT_R8:
|
||||
- return sizeof(double)/sizeof(DWORD);
|
||||
+ ret = sizeof(double);
|
||||
+ break;
|
||||
case VT_CY:
|
||||
- return sizeof(CY)/sizeof(DWORD);
|
||||
+ ret = sizeof(CY);
|
||||
+ break;
|
||||
case VT_DATE:
|
||||
- return sizeof(DATE)/sizeof(DWORD);
|
||||
+ ret = sizeof(DATE);
|
||||
+ break;
|
||||
case VT_DECIMAL:
|
||||
- return (sizeof(DECIMAL)+3)/sizeof(DWORD);
|
||||
+ ret = sizeof(DECIMAL);
|
||||
+ break;
|
||||
case VT_VARIANT:
|
||||
- return (sizeof(VARIANT)+3)/sizeof(DWORD);
|
||||
+ ret = sizeof(VARIANT);
|
||||
+ break;
|
||||
case VT_USERDEFINED:
|
||||
{
|
||||
ITypeInfo *tinfo2;
|
||||
TYPEATTR *tattr;
|
||||
HRESULT hres;
|
||||
- DWORD ret;
|
||||
|
||||
hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2);
|
||||
if (FAILED(hres))
|
||||
return 0; /* should fail critically in serialize_param */
|
||||
ITypeInfo_GetTypeAttr(tinfo2,&tattr);
|
||||
- ret = (tattr->cbSizeInstance+3)/sizeof(DWORD);
|
||||
+ ret = tattr->cbSizeInstance;
|
||||
ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
|
||||
ITypeInfo_Release(tinfo2);
|
||||
- return ret;
|
||||
+ break;
|
||||
}
|
||||
default:
|
||||
- return 1;
|
||||
+ ret = sizeof(DWORD_PTR);
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
+ return (ret + sizeof(DWORD_PTR) - 1) / sizeof(DWORD_PTR);
|
||||
}
|
||||
|
||||
/* how much space do we use on the heap (in bytes) */
|
||||
@@ -719,7 +728,7 @@ _xsize(const TYPEDESC *td, ITypeInfo *tinfo) {
|
||||
return ret;
|
||||
}
|
||||
default:
|
||||
- return 4;
|
||||
+ return sizeof(DWORD_PTR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -738,7 +747,7 @@ serialize_param(
|
||||
BOOL debugout,
|
||||
BOOL dealloc,
|
||||
TYPEDESC *tdesc,
|
||||
- DWORD *arg,
|
||||
+ DWORD_PTR *arg,
|
||||
marshal_state *buf)
|
||||
{
|
||||
HRESULT hres = S_OK;
|
||||
@@ -757,7 +766,7 @@ serialize_param(
|
||||
case VT_R8:
|
||||
case VT_CY:
|
||||
hres = S_OK;
|
||||
- if (debugout) TRACE_(olerelay)("%x%x\n",arg[0],arg[1]);
|
||||
+ if (debugout) TRACE_(olerelay)("%s\n", wine_dbgstr_longlong(*(ULONGLONG *)arg));
|
||||
if (writeit)
|
||||
hres = xbuf_add(buf,(LPBYTE)arg,8);
|
||||
return hres;
|
||||
@@ -768,7 +777,7 @@ serialize_param(
|
||||
case VT_R4:
|
||||
case VT_UI4:
|
||||
hres = S_OK;
|
||||
- if (debugout) TRACE_(olerelay)("%x\n",*arg);
|
||||
+ if (debugout) TRACE_(olerelay)("%x\n", *(DWORD *)arg);
|
||||
if (writeit)
|
||||
hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
|
||||
return hres;
|
||||
@@ -776,14 +785,14 @@ serialize_param(
|
||||
case VT_UI2:
|
||||
case VT_BOOL:
|
||||
hres = S_OK;
|
||||
- if (debugout) TRACE_(olerelay)("%04x\n",*arg & 0xffff);
|
||||
+ if (debugout) TRACE_(olerelay)("%04x\n", *(WORD *)arg);
|
||||
if (writeit)
|
||||
hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
|
||||
return hres;
|
||||
case VT_I1:
|
||||
case VT_UI1:
|
||||
hres = S_OK;
|
||||
- if (debugout) TRACE_(olerelay)("%02x\n",*arg & 0xff);
|
||||
+ if (debugout) TRACE_(olerelay)("%02x\n", *(BYTE *)arg);
|
||||
if (writeit)
|
||||
hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
|
||||
return hres;
|
||||
@@ -886,19 +895,19 @@ serialize_param(
|
||||
if (debugout) TRACE_(olerelay)("NULL");
|
||||
return S_OK;
|
||||
}
|
||||
- hres = serialize_param(tinfo,writeit,debugout,dealloc,tdesc->u.lptdesc,(DWORD*)*arg,buf);
|
||||
+ hres = serialize_param(tinfo,writeit,debugout,dealloc,tdesc->u.lptdesc,(DWORD_PTR *)*arg,buf);
|
||||
if (derefhere && dealloc) HeapFree(GetProcessHeap(),0,(LPVOID)*arg);
|
||||
return hres;
|
||||
}
|
||||
case VT_UNKNOWN:
|
||||
- if (debugout) TRACE_(olerelay)("unk(0x%x)",*arg);
|
||||
+ if (debugout) TRACE_(olerelay)("unk(0x%lx)", *arg);
|
||||
if (writeit)
|
||||
hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
|
||||
if (dealloc && *(IUnknown **)arg)
|
||||
IUnknown_Release((LPUNKNOWN)*arg);
|
||||
return hres;
|
||||
case VT_DISPATCH:
|
||||
- if (debugout) TRACE_(olerelay)("idisp(0x%x)",*arg);
|
||||
+ if (debugout) TRACE_(olerelay)("idisp(0x%lx)", *arg);
|
||||
if (writeit)
|
||||
hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg);
|
||||
if (dealloc && *(IUnknown **)arg)
|
||||
@@ -976,7 +985,7 @@ serialize_param(
|
||||
debugout,
|
||||
dealloc,
|
||||
tdesc2,
|
||||
- (DWORD*)(((LPBYTE)arg)+vdesc->u.oInst),
|
||||
+ (DWORD_PTR *)(((LPBYTE)arg)+vdesc->u.oInst),
|
||||
buf
|
||||
);
|
||||
ITypeInfo_ReleaseVarDesc(tinfo2, vdesc);
|
||||
@@ -993,7 +1002,7 @@ serialize_param(
|
||||
break;
|
||||
case TKIND_ENUM:
|
||||
hres = S_OK;
|
||||
- if (debugout) TRACE_(olerelay)("%x",*arg);
|
||||
+ if (debugout) TRACE_(olerelay)("%x", *(DWORD *)arg);
|
||||
if (writeit)
|
||||
hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
|
||||
break;
|
||||
@@ -1019,7 +1028,7 @@ serialize_param(
|
||||
if (debugout) TRACE_(olerelay)("[");
|
||||
for (i=0;i<arrsize;i++) {
|
||||
LPBYTE base = _passbyref(&adesc->tdescElem, tinfo) ? (LPBYTE) *arg : (LPBYTE) arg;
|
||||
- hres = serialize_param(tinfo, writeit, debugout, dealloc, &adesc->tdescElem, (DWORD*)((LPBYTE)base+i*_xsize(&adesc->tdescElem, tinfo)), buf);
|
||||
+ hres = serialize_param(tinfo, writeit, debugout, dealloc, &adesc->tdescElem, (DWORD_PTR *)((LPBYTE)base+i*_xsize(&adesc->tdescElem, tinfo)), buf);
|
||||
if (hres)
|
||||
return hres;
|
||||
if (debugout && (i<arrsize-1)) TRACE_(olerelay)(",");
|
||||
@@ -1058,7 +1067,7 @@ deserialize_param(
|
||||
BOOL debugout,
|
||||
BOOL alloc,
|
||||
TYPEDESC *tdesc,
|
||||
- DWORD *arg,
|
||||
+ DWORD_PTR *arg,
|
||||
marshal_state *buf)
|
||||
{
|
||||
HRESULT hres = S_OK;
|
||||
@@ -1091,7 +1100,7 @@ deserialize_param(
|
||||
hres = xbuf_get(buf,(LPBYTE)arg,8);
|
||||
if (hres) ERR("Failed to read integer 8 byte\n");
|
||||
}
|
||||
- if (debugout) TRACE_(olerelay)("%x%x",arg[0],arg[1]);
|
||||
+ if (debugout) TRACE_(olerelay)("%s", wine_dbgstr_longlong(*(ULONGLONG *)arg));
|
||||
return hres;
|
||||
case VT_ERROR:
|
||||
case VT_I4:
|
||||
@@ -1103,7 +1112,7 @@ deserialize_param(
|
||||
hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
|
||||
if (hres) ERR("Failed to read integer 4 byte\n");
|
||||
}
|
||||
- if (debugout) TRACE_(olerelay)("%x",*arg);
|
||||
+ if (debugout) TRACE_(olerelay)("%x", *(DWORD *)arg);
|
||||
return hres;
|
||||
case VT_I2:
|
||||
case VT_UI2:
|
||||
@@ -1114,7 +1123,7 @@ deserialize_param(
|
||||
if (hres) ERR("Failed to read integer 4 byte\n");
|
||||
else memcpy(arg,&x,2);
|
||||
}
|
||||
- if (debugout) TRACE_(olerelay)("%04x",*arg & 0xffff);
|
||||
+ if (debugout) TRACE_(olerelay)("%04x", *(WORD *)arg);
|
||||
return hres;
|
||||
case VT_I1:
|
||||
case VT_UI1:
|
||||
@@ -1124,7 +1133,7 @@ deserialize_param(
|
||||
if (hres) ERR("Failed to read integer 4 byte\n");
|
||||
else memcpy(arg,&x,1);
|
||||
}
|
||||
- if (debugout) TRACE_(olerelay)("%02x",*arg & 0xff);
|
||||
+ if (debugout) TRACE_(olerelay)("%02x", *(BYTE *)arg);
|
||||
return hres;
|
||||
case VT_BSTR: {
|
||||
if (readit)
|
||||
@@ -1203,17 +1212,17 @@ deserialize_param(
|
||||
if (alloc) {
|
||||
/* Allocate space for the referenced struct */
|
||||
if (derefhere)
|
||||
- *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo));
|
||||
+ *arg=(DWORD_PTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo));
|
||||
}
|
||||
if (derefhere)
|
||||
- return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, (LPDWORD)*arg, buf);
|
||||
+ return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, (DWORD_PTR *)*arg, buf);
|
||||
else
|
||||
return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, arg, buf);
|
||||
}
|
||||
case VT_UNKNOWN:
|
||||
/* FIXME: UNKNOWN is unknown ..., but allocate 4 byte for it */
|
||||
if (alloc)
|
||||
- *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DWORD));
|
||||
+ *arg=(DWORD_PTR)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DWORD_PTR));
|
||||
hres = S_OK;
|
||||
if (readit)
|
||||
hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg);
|
||||
@@ -1297,7 +1306,7 @@ deserialize_param(
|
||||
debugout,
|
||||
alloc,
|
||||
&vdesc->elemdescVar.tdesc,
|
||||
- (DWORD*)(((LPBYTE)arg)+vdesc->u.oInst),
|
||||
+ (DWORD_PTR *)(((LPBYTE)arg)+vdesc->u.oInst),
|
||||
buf
|
||||
);
|
||||
ITypeInfo_ReleaseVarDesc(tinfo2, vdesc);
|
||||
@@ -1314,7 +1323,7 @@ deserialize_param(
|
||||
hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
|
||||
if (hres) ERR("Failed to read enum (4 byte)\n");
|
||||
}
|
||||
- if (debugout) TRACE_(olerelay)("%x",*arg);
|
||||
+ if (debugout) TRACE_(olerelay)("%x", *(DWORD *)arg);
|
||||
break;
|
||||
default:
|
||||
ERR("Unhandled typekind %d\n",tattr->typekind);
|
||||
@@ -1340,7 +1349,7 @@ deserialize_param(
|
||||
if (_passbyref(&adesc->tdescElem, tinfo))
|
||||
{
|
||||
base = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo) * arrsize);
|
||||
- *arg = (DWORD) base;
|
||||
+ *arg = (DWORD_PTR)base;
|
||||
}
|
||||
for (i=0;i<arrsize;i++)
|
||||
deserialize_param(
|
||||
@@ -1349,7 +1358,7 @@ deserialize_param(
|
||||
debugout,
|
||||
alloc,
|
||||
&adesc->tdescElem,
|
||||
- (DWORD*)(base + i*_xsize(&adesc->tdescElem, tinfo)),
|
||||
+ (DWORD_PTR *)(base + i*_xsize(&adesc->tdescElem, tinfo)),
|
||||
buf
|
||||
);
|
||||
return S_OK;
|
||||
@@ -1479,7 +1488,7 @@ static inline BOOL is_out_elem(const ELEMDESC *elem)
|
||||
static DWORD WINAPI xCall(int method, void **args)
|
||||
{
|
||||
TMProxyImpl *tpinfo = args[0];
|
||||
- DWORD *xargs;
|
||||
+ DWORD_PTR *xargs;
|
||||
const FUNCDESC *fdesc;
|
||||
HRESULT hres;
|
||||
int i;
|
||||
@@ -1539,7 +1548,7 @@ static DWORD WINAPI xCall(int method, void **args)
|
||||
if (nrofnames > ARRAY_SIZE(names))
|
||||
ERR("Need more names!\n");
|
||||
|
||||
- xargs = (DWORD *)(args + 1);
|
||||
+ xargs = (DWORD_PTR *)(args + 1);
|
||||
for (i=0;i<fdesc->cParams;i++) {
|
||||
ELEMDESC *elem = fdesc->lprgelemdescParam+i;
|
||||
if (TRACE_ON(olerelay)) {
|
||||
@@ -1606,7 +1615,7 @@ static DWORD WINAPI xCall(int method, void **args)
|
||||
buf.curoff = 0;
|
||||
|
||||
/* generic deserializer using typelib description */
|
||||
- xargs = (DWORD *)(args + 1);
|
||||
+ xargs = (DWORD_PTR *)(args + 1);
|
||||
status = S_OK;
|
||||
for (i=0;i<fdesc->cParams;i++) {
|
||||
ELEMDESC *elem = fdesc->lprgelemdescParam+i;
|
||||
@@ -2133,7 +2142,8 @@ TMStubImpl_Invoke(
|
||||
const FUNCDESC *fdesc;
|
||||
TMStubImpl *This = impl_from_IRpcStubBuffer(iface);
|
||||
HRESULT hres;
|
||||
- DWORD *args = NULL, res, *xargs, nrofargs;
|
||||
+ DWORD_PTR *args = NULL, *xargs;
|
||||
+ DWORD res, nrofargs;
|
||||
marshal_state buf;
|
||||
UINT nrofnames = 0;
|
||||
BSTR names[10];
|
||||
@@ -2198,7 +2208,7 @@ TMStubImpl_Invoke(
|
||||
nrofargs = 0;
|
||||
for (i=0;i<fdesc->cParams;i++)
|
||||
nrofargs += _argsize(&fdesc->lprgelemdescParam[i].tdesc, tinfo);
|
||||
- args = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(nrofargs+1)*sizeof(DWORD));
|
||||
+ args = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nrofargs+1)*sizeof(DWORD_PTR));
|
||||
if (!args)
|
||||
{
|
||||
hres = E_OUTOFMEMORY;
|
||||
@@ -2226,12 +2236,12 @@ TMStubImpl_Invoke(
|
||||
}
|
||||
}
|
||||
|
||||
- args[0] = (DWORD)This->pUnk;
|
||||
+ args[0] = (DWORD_PTR)This->pUnk;
|
||||
|
||||
__TRY
|
||||
{
|
||||
res = _invoke(
|
||||
- (*((FARPROC**)args[0]))[fdesc->oVft/4],
|
||||
+ (*((FARPROC**)args[0]))[fdesc->oVft / sizeof(DWORD_PTR)],
|
||||
fdesc->callconv,
|
||||
(xargs-args),
|
||||
args
|
||||
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
|
||||
index a3b317a..9c575ba 100644
|
||||
--- a/dlls/oleaut32/typelib.c
|
||||
+++ b/dlls/oleaut32/typelib.c
|
||||
@@ -6360,15 +6360,15 @@ __ASM_GLOBAL_FUNC( call_double_method,
|
||||
* Invokes a method, or accesses a property of an object, that implements the
|
||||
* interface described by the type description.
|
||||
*/
|
||||
-DWORD
|
||||
-_invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) {
|
||||
+DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args)
|
||||
+{
|
||||
DWORD res;
|
||||
int stack_offset;
|
||||
|
||||
if (TRACE_ON(ole)) {
|
||||
int i;
|
||||
TRACE("Calling %p(",func);
|
||||
- for (i=0;i<min(nrargs,30);i++) TRACE("%08x,",args[i]);
|
||||
+ for (i=0;i<min(nrargs,30);i++) TRACE("%08lx,",args[i]);
|
||||
if (nrargs > 30) TRACE("...");
|
||||
TRACE(")\n");
|
||||
}
|
||||
@@ -6376,7 +6376,7 @@ _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) {
|
||||
switch (callconv) {
|
||||
case CC_STDCALL:
|
||||
case CC_CDECL:
|
||||
- res = call_method( func, nrargs, args, &stack_offset );
|
||||
+ res = call_method(func, nrargs, (DWORD *)args, &stack_offset);
|
||||
break;
|
||||
default:
|
||||
FIXME("unsupported calling convention %d\n",callconv);
|
||||
diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h
|
||||
index 629ed72..b91c66a 100644
|
||||
--- a/dlls/oleaut32/typelib.h
|
||||
+++ b/dlls/oleaut32/typelib.h
|
||||
@@ -597,7 +597,7 @@ WORD typeofarray
|
||||
|
||||
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc ) DECLSPEC_HIDDEN;
|
||||
|
||||
-extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) DECLSPEC_HIDDEN;
|
||||
+extern DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,65 +0,0 @@
|
||||
From 72b03c09586eea8c5cef4c0234e5f2dceea4cafd Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 15 Nov 2015 05:06:30 +0100
|
||||
Subject: [PATCH] oleaut32: Implement TMStubImpl_Invoke on x86_64.
|
||||
|
||||
---
|
||||
dlls/oleaut32/tmarshal.c | 2 +-
|
||||
dlls/oleaut32/typelib.c | 28 ++++++++++++++++++++++++++++
|
||||
2 files changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
|
||||
index f27f4c6..16db64f 100644
|
||||
--- a/dlls/oleaut32/tmarshal.c
|
||||
+++ b/dlls/oleaut32/tmarshal.c
|
||||
@@ -2137,7 +2137,7 @@ static HRESULT WINAPI
|
||||
TMStubImpl_Invoke(
|
||||
LPRPCSTUBBUFFER iface, RPCOLEMESSAGE* xmsg,IRpcChannelBuffer*rpcchanbuf)
|
||||
{
|
||||
-#ifdef __i386__
|
||||
+#if defined(__i386__) || defined(__x86_64__)
|
||||
int i;
|
||||
const FUNCDESC *fdesc;
|
||||
TMStubImpl *This = impl_from_IRpcStubBuffer(iface);
|
||||
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
|
||||
index 58a8aae..fa9f4d9 100644
|
||||
--- a/dlls/oleaut32/typelib.c
|
||||
+++ b/dlls/oleaut32/typelib.c
|
||||
@@ -6433,6 +6433,34 @@ __ASM_GLOBAL_FUNC( call_method,
|
||||
__ASM_GLOBAL_FUNC( call_double_method,
|
||||
"jmp " __ASM_NAME("call_method") )
|
||||
|
||||
+DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args)
|
||||
+{
|
||||
+ DWORD res;
|
||||
+
|
||||
+ if (TRACE_ON(ole))
|
||||
+ {
|
||||
+ int i;
|
||||
+ TRACE("Calling %p(", func);
|
||||
+ for (i=0; i<min(nrargs, 30); i++) TRACE("%016lx,", args[i]);
|
||||
+ if (nrargs > 30) TRACE("...");
|
||||
+ TRACE(")\n");
|
||||
+ }
|
||||
+
|
||||
+ switch (callconv) {
|
||||
+ case CC_STDCALL:
|
||||
+ case CC_CDECL:
|
||||
+ res = call_method(func, nrargs, args);
|
||||
+ break;
|
||||
+ default:
|
||||
+ FIXME("unsupported calling convention %d\n", callconv);
|
||||
+ res = -1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("returns %08x\n", res);
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
#elif defined(__arm__)
|
||||
|
||||
extern LONGLONG CDECL call_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args );
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,94 +0,0 @@
|
||||
From b4d8caeafdf2ad8dc4e3b499834f89236a639d49 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 15 Nov 2015 05:09:53 +0100
|
||||
Subject: oleaut32: Implement asm proxys for x86_64.
|
||||
|
||||
---
|
||||
dlls/oleaut32/tmarshal.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 52 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
|
||||
index bcea046..e53da96 100644
|
||||
--- a/dlls/oleaut32/tmarshal.c
|
||||
+++ b/dlls/oleaut32/tmarshal.c
|
||||
@@ -490,7 +490,6 @@ static HRESULT num_of_funcs(ITypeInfo *tinfo, unsigned int *num,
|
||||
#ifdef __i386__
|
||||
|
||||
#include "pshpack1.h"
|
||||
-
|
||||
typedef struct _TMAsmProxy {
|
||||
DWORD lealeax;
|
||||
BYTE pushleax;
|
||||
@@ -502,10 +501,33 @@ typedef struct _TMAsmProxy {
|
||||
WORD bytestopop;
|
||||
WORD nop;
|
||||
} TMAsmProxy;
|
||||
+#include "poppack.h"
|
||||
+
|
||||
+#elif defined(__x86_64__)
|
||||
|
||||
+#include "pshpack1.h"
|
||||
+typedef struct _TMAsmProxy {
|
||||
+ BYTE pushq_rbp;
|
||||
+ BYTE movq_rsp_rbp[3];
|
||||
+ DWORD subq_0x20_rsp;
|
||||
+ DWORD movq_rcx_0x10rbp;
|
||||
+ DWORD movq_rdx_0x18rbp;
|
||||
+ DWORD movq_r8_0x20rbp;
|
||||
+ DWORD movq_r9_0x28rbp;
|
||||
+ BYTE movq_rcx[3];
|
||||
+ DWORD nr;
|
||||
+ DWORD leaq_0x10rbp_rdx;
|
||||
+ WORD movq_rax;
|
||||
+ void *xcall;
|
||||
+ WORD callq_rax;
|
||||
+ BYTE movq_rbp_rsp[3];
|
||||
+ BYTE popq_rbp;
|
||||
+ BYTE ret;
|
||||
+ DWORD nop;
|
||||
+} TMAsmProxy;
|
||||
#include "poppack.h"
|
||||
|
||||
-#else /* __i386__ */
|
||||
+#else
|
||||
# warning You need to implement stubless proxies for your architecture
|
||||
typedef struct _TMAsmProxy {
|
||||
} TMAsmProxy;
|
||||
@@ -1845,6 +1867,34 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
|
||||
xasm->bytestopop = nrofargs * 4;
|
||||
xasm->nop = 0x9090;
|
||||
proxy->lpvtbl[fdesc->oVft / sizeof(void *)] = xasm;
|
||||
+
|
||||
+#elif defined(__x86_64__)
|
||||
+
|
||||
+ xasm->pushq_rbp = 0x55; /* pushq %rbp */
|
||||
+ xasm->movq_rsp_rbp[0] = 0x48; /* movq %rsp,%rbp */
|
||||
+ xasm->movq_rsp_rbp[1] = 0x89;
|
||||
+ xasm->movq_rsp_rbp[2] = 0xe5;
|
||||
+ xasm->subq_0x20_rsp = 0x20ec8348; /* subq 0x20,%rsp */
|
||||
+ xasm->movq_rcx_0x10rbp = 0x104d8948; /* movq %rcx,0x10(%rbp) */
|
||||
+ xasm->movq_rdx_0x18rbp = 0x18558948; /* movq %rdx,0x18(%rbp) */
|
||||
+ xasm->movq_r8_0x20rbp = 0x2045894c; /* movq %r8,0x20(%rbp) */
|
||||
+ xasm->movq_r9_0x28rbp = 0x284d894c; /* movq %r9,0x28(%rbp) */
|
||||
+ xasm->movq_rcx[0] = 0x48; /* movq <num>,%rcx */
|
||||
+ xasm->movq_rcx[1] = 0xc7;
|
||||
+ xasm->movq_rcx[2] = 0xc1;
|
||||
+ xasm->nr = num;
|
||||
+ xasm->leaq_0x10rbp_rdx = 0x10558d48; /* leaq 0x10(%rbp),%rdx */
|
||||
+ xasm->movq_rax = 0xb848; /* movq <xCall>,%rax */
|
||||
+ xasm->xcall = xCall;
|
||||
+ xasm->callq_rax = 0xd0ff; /* callq *%rax */
|
||||
+ xasm->movq_rbp_rsp[0] = 0x48; /* movq %rbp,%rsp */
|
||||
+ xasm->movq_rbp_rsp[1] = 0x89;
|
||||
+ xasm->movq_rbp_rsp[2] = 0xec;
|
||||
+ xasm->popq_rbp = 0x5d; /* popq %rbp */
|
||||
+ xasm->ret = 0xc3; /* ret */
|
||||
+ xasm->nop = 0x90909090; /* nop */
|
||||
+ proxy->lpvtbl[fdesc->oVft / sizeof(void *)] = xasm;
|
||||
+
|
||||
#else
|
||||
FIXME("not implemented on non i386\n");
|
||||
return E_FAIL;
|
||||
--
|
||||
2.6.2
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [26768] Implement stubless proxies on x86_64
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "e9e12bda62fee68e9fbac5849f7ad1e199ee38b7"
|
||||
echo "ebae298aa4d2711fef35d4ac60c6012438f36d61"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -126,7 +126,6 @@ patch_enable_all ()
|
||||
enable_ddraw_Fix_Typos="$1"
|
||||
enable_ddraw_FlipToGDISurface="$1"
|
||||
enable_ddraw_IDirect3DTexture2_Load="$1"
|
||||
enable_ddraw_Prevent_viewport_crash="$1"
|
||||
enable_ddraw_Silence_FIXMEs="$1"
|
||||
enable_ddraw_Write_Vtable="$1"
|
||||
enable_dinput_Deadlock="$1"
|
||||
@ -255,7 +254,6 @@ patch_enable_all ()
|
||||
enable_oleaut32_OleLoadPicture="$1"
|
||||
enable_oleaut32_OleLoadPictureFile="$1"
|
||||
enable_oleaut32_TKIND_COCLASS="$1"
|
||||
enable_oleaut32_x86_64_Marshaller="$1"
|
||||
enable_opengl32_wglChoosePixelFormat="$1"
|
||||
enable_packager_DllMain="$1"
|
||||
enable_quartz_MediaSeeking_Positions="$1"
|
||||
@ -541,9 +539,6 @@ patch_enable ()
|
||||
ddraw-IDirect3DTexture2_Load)
|
||||
enable_ddraw_IDirect3DTexture2_Load="$2"
|
||||
;;
|
||||
ddraw-Prevent_viewport_crash)
|
||||
enable_ddraw_Prevent_viewport_crash="$2"
|
||||
;;
|
||||
ddraw-Silence_FIXMEs)
|
||||
enable_ddraw_Silence_FIXMEs="$2"
|
||||
;;
|
||||
@ -928,9 +923,6 @@ patch_enable ()
|
||||
oleaut32-TKIND_COCLASS)
|
||||
enable_oleaut32_TKIND_COCLASS="$2"
|
||||
;;
|
||||
oleaut32-x86_64_Marshaller)
|
||||
enable_oleaut32_x86_64_Marshaller="$2"
|
||||
;;
|
||||
opengl32-wglChoosePixelFormat)
|
||||
enable_opengl32_wglChoosePixelFormat="$2"
|
||||
;;
|
||||
@ -3241,21 +3233,6 @@ if test "$enable_ddraw_IDirect3DTexture2_Load" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ddraw-Prevent_viewport_crash
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#36763] Prevent division by zero in viewport_activate
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ddraw/viewport.c
|
||||
# |
|
||||
if test "$enable_ddraw_Prevent_viewport_crash" -eq 1; then
|
||||
patch_apply ddraw-Prevent_viewport_crash/0001-ddraw-Prevent-division-by-zero-in-viewport_acti.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Józef Kucia", "ddraw: Prevent division by zero in viewport_activate.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ddraw-Silence_FIXMEs
|
||||
# |
|
||||
# | Modified files:
|
||||
@ -5469,40 +5446,19 @@ fi
|
||||
# | * [#39799] Implement ITypeInfo_fnInvoke for TKIND_COCLASS
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/oleaut32/tests/tmarshal.c, dlls/oleaut32/tmarshal.c, dlls/oleaut32/typelib.c
|
||||
# | * dlls/oleaut32/tests/tmarshal.c, dlls/oleaut32/typelib.c
|
||||
# |
|
||||
if test "$enable_oleaut32_TKIND_COCLASS" -eq 1; then
|
||||
patch_apply oleaut32-TKIND_COCLASS/0001-oleaut32-Pass-a-HREFTYPE-to-get_iface_guid.patch
|
||||
patch_apply oleaut32-TKIND_COCLASS/0002-oleaut32-Implement-ITypeInfo_fnInvoke-for-TKIND_COCL.patch
|
||||
patch_apply oleaut32-TKIND_COCLASS/0003-oleaut32-Handle-TKIND_COCLASS-in-proxy-stub-marshall.patch
|
||||
patch_apply oleaut32-TKIND_COCLASS/0004-oleaut32-tests-Add-a-test-for-TKIND_COCLASS-in-proxy.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32: Pass a HREFTYPE to get_iface_guid.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32: Implement ITypeInfo_fnInvoke for TKIND_COCLASS in arguments.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32: Handle TKIND_COCLASS in proxy/stub marshalling.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32/tests: Add a test for TKIND_COCLASS in proxy/stub marshalling.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset oleaut32-x86_64_Marshaller
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#26768] Implement stubless proxies on x86_64
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/oleaut32/tmarshal.c, dlls/oleaut32/typelib.c, dlls/oleaut32/typelib.h
|
||||
# |
|
||||
if test "$enable_oleaut32_x86_64_Marshaller" -eq 1; then
|
||||
patch_apply oleaut32-x86_64_Marshaller/0001-oleaut32-Initial-preparation-to-make-marshalling-com.patch
|
||||
patch_apply oleaut32-x86_64_Marshaller/0002-oleaut32-Implement-TMStubImpl_Invoke-on-x86_64.patch
|
||||
patch_apply oleaut32-x86_64_Marshaller/0003-oleaut32-Implement-asm-proxys-for-x86_64.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32: Initial preparation to make marshalling compatible with x86_64.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32: Implement TMStubImpl_Invoke on x86_64.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "oleaut32: Implement asm proxys for x86_64.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset opengl32-wglChoosePixelFormat
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user