Author: akhaldi
Date: Tue Nov 17 11:59:11 2015
New Revision: 69915
URL:
http://svn.reactos.org/svn/reactos?rev=69915&view=rev
Log:
[OLEAUT32] Sync with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/reactos/dll/win32/oleaut32/CMakeLists.txt
trunk/reactos/dll/win32/oleaut32/oleaut.c
trunk/reactos/dll/win32/oleaut32/olepicture.c
trunk/reactos/dll/win32/oleaut32/tmarshal.c
trunk/reactos/dll/win32/oleaut32/typelib.c
trunk/reactos/dll/win32/oleaut32/typelib.h
trunk/reactos/dll/win32/oleaut32/usrmarshal.c
trunk/reactos/dll/win32/oleaut32/variant.c
trunk/reactos/dll/win32/oleaut32/vartype.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/oleaut32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/CMakeLists.txt [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -58,6 +58,6 @@
set_module_type(oleaut32 win32dll)
target_link_libraries(oleaut32 wine wineldr uuid ${PSEH_LIB})
add_delay_importlibs(oleaut32 comctl32 urlmon windowscodecs)
-add_importlibs(oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
+add_importlibs(oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 kernel32_vista msvcrt kernel32
ntdll)
add_pch(oleaut32 precomp.h SOURCE)
add_cd_file(TARGET oleaut32 DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut.…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -484,7 +484,7 @@
* Success: S_OK.
* Failure: HRESULT code.
*/
-HRESULT WINAPI RegisterActiveObject(
+HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject(
LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
) {
WCHAR guidbuf[80];
@@ -523,7 +523,7 @@
* Success: S_OK.
* Failure: HRESULT code.
*/
-HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved)
+HRESULT WINAPI DECLSPEC_HOTPATCH RevokeActiveObject(DWORD xregister,LPVOID reserved)
{
LPRUNNINGOBJECTTABLE runobtable;
HRESULT ret;
@@ -550,7 +550,7 @@
* Success: S_OK.
* Failure: HRESULT code.
*/
-HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk)
+HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN
*ppunk)
{
WCHAR guidbuf[80];
HRESULT ret;
Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepict…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -1190,6 +1190,8 @@
HDC hdcRef;
int i;
+ TRACE("(this %p, xbuf %p, xread %u)\n", This, xbuf, xread);
+
/*
FIXME("icon.idReserved=%d\n",cifd->idReserved);
FIXME("icon.idType=%d\n",cifd->idType);
@@ -1206,6 +1208,13 @@
FIXME("[%d] dwDIBOffset %d\n",i,cifd->idEntries[i].dwDIBOffset);
}
*/
+
+ /* Need at least one icon to do something. */
+ if (!cifd->idCount)
+ {
+ ERR("Invalid icon count of zero.\n");
+ return E_FAIL;
+ }
i=0;
/* If we have more than one icon, try to find the best.
* this currently means '32 pixel wide'.
@@ -1216,6 +1225,12 @@
break;
}
if (i==cifd->idCount) i=0;
+ }
+ if (xread < cifd->idEntries[i].dwDIBOffset + cifd->idEntries[i].dwDIBSize)
+ {
+ ERR("Icon data address %u is over %u bytes available.\n",
+ cifd->idEntries[i].dwDIBOffset + cifd->idEntries[i].dwDIBSize, xread);
+ return E_FAIL;
}
if (cifd->idType == 2)
{
Modified: trunk/reactos/dll/win32/oleaut32/tmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/tmarsha…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -469,7 +469,6 @@
#ifdef __i386__
#include "pshpack1.h"
-
typedef struct _TMAsmProxy {
DWORD lealeax;
BYTE pushleax;
@@ -481,7 +480,30 @@
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__ */
@@ -617,42 +639,51 @@
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) */
@@ -701,7 +732,7 @@
return ret;
}
default:
- return 4;
+ return sizeof(DWORD_PTR);
}
}
@@ -720,7 +751,7 @@
BOOL debugout,
BOOL dealloc,
TYPEDESC *tdesc,
- DWORD *arg,
+ DWORD_PTR *arg,
marshal_state *buf)
{
HRESULT hres = S_OK;
@@ -739,7 +770,7 @@
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;
@@ -750,7 +781,7 @@
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;
@@ -758,14 +789,14 @@
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;
@@ -835,7 +866,9 @@
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 */
@@ -843,6 +876,7 @@
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:
@@ -865,19 +899,19 @@
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)
@@ -904,6 +938,36 @@
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)("{");
@@ -925,7 +989,7 @@
debugout,
dealloc,
tdesc2,
- (DWORD*)(((LPBYTE)arg)+vdesc->u.oInst),
+ (DWORD_PTR *)(((LPBYTE)arg)+vdesc->u.oInst),
buf
);
ITypeInfo_ReleaseVarDesc(tinfo2, vdesc);
@@ -942,7 +1006,7 @@
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;
@@ -968,7 +1032,7 @@
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)(",");
@@ -1007,7 +1071,7 @@
BOOL debugout,
BOOL alloc,
TYPEDESC *tdesc,
- DWORD *arg,
+ DWORD_PTR *arg,
marshal_state *buf)
{
HRESULT hres = S_OK;
@@ -1040,7 +1104,7 @@
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:
@@ -1052,7 +1116,7 @@
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:
@@ -1063,7 +1127,7 @@
if (hres) ERR("Failed to read integer 4 byte\n");
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:
@@ -1073,7 +1137,7 @@
if (hres) ERR("Failed to read integer 4 byte\n");
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)
@@ -1113,7 +1177,9 @@
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 */
@@ -1121,6 +1187,7 @@
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:
@@ -1149,17 +1216,17 @@
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);
@@ -1195,6 +1262,34 @@
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;
@@ -1215,7 +1310,7 @@
debugout,
alloc,
&vdesc->elemdescVar.tdesc,
- (DWORD*)(((LPBYTE)arg)+vdesc->u.oInst),
+ (DWORD_PTR *)(((LPBYTE)arg)+vdesc->u.oInst),
buf
);
ITypeInfo_ReleaseVarDesc(tinfo2, vdesc);
@@ -1232,7 +1327,7 @@
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);
@@ -1258,7 +1353,7 @@
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(
@@ -1267,7 +1362,7 @@
debugout,
alloc,
&adesc->tdescElem,
- (DWORD*)(base + i*_xsize(&adesc->tdescElem, tinfo)),
+ (DWORD_PTR *)(base + i*_xsize(&adesc->tdescElem, tinfo)),
buf
);
return S_OK;
@@ -1397,7 +1492,7 @@
static DWORD WINAPI xCall(int method, void **args)
{
TMProxyImpl *tpinfo = args[0];
- DWORD *xargs;
+ DWORD_PTR *xargs;
const FUNCDESC *fdesc;
HRESULT hres;
int i;
@@ -1457,7 +1552,7 @@
if (nrofnames > sizeof(names)/sizeof(names[0]))
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)) {
@@ -1524,7 +1619,7 @@
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;
@@ -1785,11 +1880,7 @@
/* nrofargs including This */
int nrofargs = 1;
ITypeInfo *tinfo2;
-
-#ifdef __i386__
TMAsmProxy *xasm = proxy->asmstubs + num;
-#endif
-
HRESULT hres;
const FUNCDESC *fdesc;
@@ -1824,6 +1915,34 @@
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;
@@ -2050,12 +2169,13 @@
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);
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];
@@ -2120,7 +2240,7 @@
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;
@@ -2148,12 +2268,12 @@
}
}
- 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
@@ -2270,6 +2390,7 @@
ITypeInfo *tinfo;
TMStubImpl *stub;
TYPEATTR *typeattr;
+ IUnknown *obj;
TRACE("(%s,%p,%p)\n",debugstr_guid(riid),pUnkServer,ppStub);
@@ -2279,16 +2400,26 @@
return hres;
}
+ /* FIXME: This is not exactly right. We should probably call QI later. */
+ hres = IUnknown_QueryInterface(pUnkServer, riid, (void**)&obj);
+ if (FAILED(hres)) {
+ WARN("Could not get %s iface: %08x\n", debugstr_guid(riid), hres);
+ obj = pUnkServer;
+ IUnknown_AddRef(obj);
+ }
+
stub = CoTaskMemAlloc(sizeof(TMStubImpl));
- if (!stub)
+ if (!stub) {
+ IUnknown_Release(obj);
return E_OUTOFMEMORY;
+ }
stub->IRpcStubBuffer_iface.lpVtbl = &tmstubvtbl;
stub->ref = 1;
stub->tinfo = tinfo;
stub->dispatch_stub = NULL;
stub->dispatch_derivative = FALSE;
stub->iid = *riid;
- hres = IRpcStubBuffer_Connect(&stub->IRpcStubBuffer_iface,pUnkServer);
+ hres = IRpcStubBuffer_Connect(&stub->IRpcStubBuffer_iface, obj);
*ppStub = &stub->IRpcStubBuffer_iface;
TRACE("IRpcStubBuffer: %p\n", stub);
if (hres)
@@ -2303,6 +2434,7 @@
ITypeInfo_ReleaseTypeAttr(tinfo, typeattr);
}
+ IUnknown_Release(obj);
return hres;
}
@@ -2314,17 +2446,12 @@
PSFacBuf_CreateStub
};
-/* This is the whole PSFactoryBuffer object, just the vtableptr */
-static const IPSFactoryBufferVtbl *lppsfac = &psfacbufvtbl;
+static IPSFactoryBuffer psfac = { &psfacbufvtbl };
/***********************************************************************
* TMARSHAL_DllGetClassObject
*/
-HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
-{
- if (IsEqualIID(iid,&IID_IPSFactoryBuffer)) {
- *ppv = &lppsfac;
- return S_OK;
- }
- return E_NOINTERFACE;
-}
+HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid, void **ppv)
+{
+ return IPSFactoryBuffer_QueryInterface(&psfac, iid, ppv);
+}
Modified: trunk/reactos/dll/win32/oleaut32/typelib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -56,67 +56,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(typelib);
-
-#ifdef __REACTOS__
-/* FIXME: Vista+ */
-#define STATUS_SUCCESS ((NTSTATUS)0x00000000)
-static BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLASS
class,
- LPVOID info, DWORD size )
-{
- NTSTATUS status;
- IO_STATUS_BLOCK io;
-
- switch (class)
- {
- case FileBasicInfo:
- case FileStandardInfo:
- case FileRenameInfo:
- case FileDispositionInfo:
- case FileAllocationInfo:
- case FileEndOfFileInfo:
- case FileStreamInfo:
- case FileCompressionInfo:
- case FileAttributeTagInfo:
- case FileIoPriorityHintInfo:
- case FileRemoteProtocolInfo:
- case FileFullDirectoryInfo:
- case FileFullDirectoryRestartInfo:
- case FileStorageInfo:
- case FileAlignmentInfo:
- case FileIdInfo:
- case FileIdExtdDirectoryInfo:
- case FileIdExtdDirectoryRestartInfo:
- FIXME( "%p, %u, %p, %u\n", handle, class, info, size );
- SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
- return FALSE;
-
- case FileNameInfo:
- status = NtQueryInformationFile( handle, &io, info, size, FileNameInformation
);
- if (status != STATUS_SUCCESS)
- {
- SetLastError( RtlNtStatusToDosError( status ) );
- return FALSE;
- }
- return TRUE;
-
- case FileIdBothDirectoryRestartInfo:
- case FileIdBothDirectoryInfo:
- status = NtQueryDirectoryFile( handle, NULL, NULL, NULL, &io, info, size,
- FileIdBothDirectoryInformation, FALSE, NULL,
- (class == FileIdBothDirectoryRestartInfo) );
- if (status != STATUS_SUCCESS)
- {
- SetLastError( RtlNtStatusToDosError( status ) );
- return FALSE;
- }
- return TRUE;
-
- default:
- SetLastError( ERROR_INVALID_PARAMETER );
- return FALSE;
- }
-}
-#endif
typedef struct
{
@@ -6442,15 +6381,15 @@
* 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");
}
@@ -6458,7 +6397,7 @@
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);
@@ -6515,6 +6454,34 @@
/* same function but returning floating point */
static double (CDECL * const call_double_method)(void*,int,const DWORD_PTR*) = (void
*)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;
+}
+
#endif /* __x86_64__ */
static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE
*vt)
@@ -6652,13 +6619,13 @@
return hr;
}
-static HRESULT get_iface_guid(ITypeInfo *tinfo, const TYPEDESC *tdesc, GUID *guid)
+static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
{
ITypeInfo *tinfo2;
TYPEATTR *tattr;
HRESULT hres;
- hres = ITypeInfo_GetRefTypeInfo(tinfo, tdesc->u.hreftype, &tinfo2);
+ hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
if(FAILED(hres))
return hres;
@@ -6670,13 +6637,28 @@
switch(tattr->typekind) {
case TKIND_ALIAS:
- hres = get_iface_guid(tinfo2, &tattr->tdescAlias, guid);
+ hres = get_iface_guid(tinfo2, tattr->tdescAlias.u.hreftype, guid);
break;
case TKIND_INTERFACE:
case TKIND_DISPATCH:
*guid = tattr->guid;
break;
+
+ case TKIND_COCLASS: {
+ 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)) break;
+
+ if(i < tattr->cImplTypes) {
+ hres = ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href);
+ if(SUCCEEDED(hres)) hres = get_iface_guid(tinfo2, href, guid);
+ } else hres = E_UNEXPECTED;
+ break;
+ }
default:
ERR("Unexpected typekind %d\n", tattr->typekind);
@@ -7118,7 +7100,7 @@
}
V_VT(&rgvarg[i]) = rgvt[i];
}
- else if (rgvt[i] == (VT_VARIANT | VT_ARRAY) &&
func_desc->cParamsOpt < 0 && i == func_desc->cParams-1)
+ else if ((rgvt[i] == (VT_VARIANT | VT_ARRAY) || rgvt[i] ==
(VT_VARIANT | VT_ARRAY | VT_BYREF)) && func_desc->cParamsOpt < 0)
{
SAFEARRAY *a;
SAFEARRAYBOUND bound;
@@ -7147,7 +7129,10 @@
SafeArrayDestroy(a);
break;
}
- V_ARRAY(&rgvarg[i]) = a;
+ if (rgvt[i] & VT_BYREF)
+ V_BYREF(&rgvarg[i]) = &a;
+ else
+ V_ARRAY(&rgvarg[i]) = a;
V_VT(&rgvarg[i]) = rgvt[i];
}
else if ((rgvt[i] & VT_BYREF) &&
!V_ISBYREF(src_arg))
@@ -7193,7 +7178,10 @@
IUnknown *userdefined_iface;
GUID guid;
- hres = get_iface_guid((ITypeInfo*)iface, tdesc->vt == VT_PTR ?
tdesc->u.lptdesc : tdesc, &guid);
+ if (tdesc->vt == VT_PTR)
+ tdesc = tdesc->u.lptdesc;
+
+ hres = get_iface_guid((ITypeInfo*)iface, tdesc->u.hreftype,
&guid);
if(FAILED(hres))
break;
@@ -7922,19 +7910,19 @@
ITypeLib * *ppTLib, UINT *pIndex)
{
ITypeInfoImpl *This = impl_from_ITypeInfo2(iface);
-
+
/* If a pointer is null, we simply ignore it, the ATL in particular passes pIndex as
0 */
if (pIndex) {
*pIndex=This->index;
TRACE("returning pIndex=%d\n", *pIndex);
}
-
+
if (ppTLib) {
- *ppTLib=(LPTYPELIB )(This->pTypeLib);
+ *ppTLib = (ITypeLib *)&This->pTypeLib->ITypeLib2_iface;
ITypeLib_AddRef(*ppTLib);
TRACE("returning ppTLib=%p\n", *ppTLib);
}
-
+
return S_OK;
}
Modified: trunk/reactos/dll/win32/oleaut32/typelib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/typelib.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/typelib.h [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -598,7 +598,7 @@
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;
Modified: trunk/reactos/dll/win32/oleaut32/usrmarshal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/usrmars…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -333,11 +333,12 @@
ptr = *(DWORD*)Buffer;
Buffer += sizeof(DWORD);
+ /* Clear any existing interface which WdtpInterfacePointer_UserUnmarshal()
+ would try to release. This has been done already with a VariantClear(). */
+ *ppunk = NULL;
+
if(!ptr)
- {
- *ppunk = NULL;
return Buffer;
- }
return WdtpInterfacePointer_UserUnmarshal(pFlags, Buffer, ppunk, riid);
}
Modified: trunk/reactos/dll/win32/oleaut32/variant.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -3590,7 +3590,7 @@
}
/* Determine return type */
- if (!(rightvt == VT_EMPTY))
+ if (rightvt != VT_EMPTY)
{
if (leftvt == VT_NULL || rightvt == VT_NULL)
{
@@ -3623,7 +3623,7 @@
else if (leftvt == VT_R4 || rightvt == VT_R4)
resvt = VT_R4;
}
- else if (leftvt == VT_NULL && rightvt == VT_EMPTY)
+ else if (leftvt == VT_NULL)
{
V_VT(result) = VT_NULL;
hres = S_OK;
Modified: trunk/reactos/dll/win32/oleaut32/vartype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -2938,28 +2938,28 @@
HRESULT WINAPI VarR4FromDec(DECIMAL* pDecIn, float *pFltOut)
{
BYTE scale = DEC_SCALE(pDecIn);
- int divisor = 1;
+ double divisor = 1.0;
double highPart;
if (scale > DEC_MAX_SCALE || DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
return E_INVALIDARG;
while (scale--)
- divisor *= 10;
+ divisor *= 10.0;
if (DEC_SIGN(pDecIn))
divisor = -divisor;
if (DEC_HI32(pDecIn))
{
- highPart = (double)DEC_HI32(pDecIn) / (double)divisor;
+ highPart = (double)DEC_HI32(pDecIn) / divisor;
highPart *= 4294967296.0F;
highPart *= 4294967296.0F;
}
else
highPart = 0.0;
- *pFltOut = (double)DEC_LO64(pDecIn) / (double)divisor + highPart;
+ *pFltOut = (double)DEC_LO64(pDecIn) / divisor + highPart;
return S_OK;
}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Nov 17 11:59:11 2015
@@ -146,7 +146,7 @@
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.47
reactos/dll/win32/ole32 # Synced to WineStaging-1.7.55
reactos/dll/win32/oleacc # Synced to WineStaging-1.7.47
-reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.47
+reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.55
reactos/dll/win32/olecli32 # Synced to WineStaging-1.7.47
reactos/dll/win32/oledlg # Synced to WineStaging-1.7.47
reactos/dll/win32/olepro32 # Synced to WineStaging-1.7.47