[OLEAUT32] Sync with Wine Staging 3.3. CORE-14434

This commit is contained in:
Amine Khaldi 2018-03-04 13:14:52 +01:00
parent 004d830fe9
commit d506c2af65
20 changed files with 493 additions and 85 deletions

View file

@ -22,9 +22,22 @@
* comments just above that function for information. * comments just above that function for information.
*/ */
#include "precomp.h"
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include <string.h>
#define COBJMACROS
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "olectl.h"
#include "connpt.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);

View file

@ -19,7 +19,23 @@
* *
*/ */
#include "precomp.h" #include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "winerror.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);

View file

@ -18,8 +18,14 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <stdarg.h>
#include "precomp.h" #include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "objbase.h"
#include "oaidl.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);

View file

@ -18,12 +18,29 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include "config.h"
#include <initguid.h> #include <stdarg.h>
#include <oleaut32_oaidl.h> #include <string.h>
#include <limits.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "ole2.h"
#include "olectl.h"
#include "oleauto.h"
#include "initguid.h"
#include "typelib.h" #include "typelib.h"
#include "oleaut32_oaidl.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(heap); WINE_DECLARE_DEBUG_CHANNEL(heap);

View file

@ -21,8 +21,28 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "precomp.h" #define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "oleauto.h" /* for SysAllocString(....) */
#include "ole2.h"
#include "olectl.h"
#include "wine/debug.h"
#include "connpt.h" /* for CreateConnectionPoint */
#include "oaidl.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);

View file

@ -36,14 +36,34 @@
* *
*/ */
#include "precomp.h" #include "config.h"
#include "wine/port.h"
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <initguid.h> #define COBJMACROS
#include <wincodec.h> #define NONAMELESSUNION
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "olectl.h"
#include "oleauto.h"
#include "connpt.h"
#include "urlmon.h"
#include "initguid.h"
#include "wincodec.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/library.h"
WINE_DEFAULT_DEBUG_CHANNEL(olepicture); WINE_DEFAULT_DEBUG_CHANNEL(olepicture);

View file

@ -19,9 +19,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include <stdarg.h>
#include <oledlg.h> #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "ole2.h"
#include "olectl.h"
#include "oledlg.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
@ -177,7 +186,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
lpParams->lplpUnk, lpParams->cPages, lpParams->lpPages, lpParams->lplpUnk, lpParams->cPages, lpParams->lpPages,
lpParams->lcid, lpParams->dispidInitialProperty); lpParams->lcid, lpParams->dispidInitialProperty);
if(!lpParams->lplpUnk || !lpParams->lpPages) if(!lpParams->lpPages)
return E_POINTER; return E_POINTER;
if(lpParams->cbStructSize != sizeof(OCPFIPARAMS)) { if(lpParams->cbStructSize != sizeof(OCPFIPARAMS)) {
@ -279,7 +288,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
res = IPropertyPage_SetObjects(property_page[i], res = IPropertyPage_SetObjects(property_page[i],
lpParams->cObjects, lpParams->lplpUnk); lpParams->cObjects, lpParams->lplpUnk);
if(FAILED(res)) if(FAILED(res))
continue; WARN("SetObjects() failed, hr %#x.\n", res);
res = IPropertyPage_GetPageInfo(property_page[i], &page_info); res = IPropertyPage_GetPageInfo(property_page[i], &page_info);
if(FAILED(res)) if(FAILED(res))
@ -299,10 +308,8 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
PropertySheetW(&property_sheet); PropertySheetW(&property_sheet);
for(i=0; i<lpParams->cPages; i++) { for(i=0; i<lpParams->cPages; i++) {
if(property_page[i]) { if(property_page[i])
IPropertyPage_SetPageSite(property_page[i], NULL);
IPropertyPage_Release(property_page[i]); IPropertyPage_Release(property_page[i]);
}
} }
HeapFree(GetProcessHeap(), 0, dialogs); HeapFree(GetProcessHeap(), 0, dialogs);

View file

@ -1,3 +1,4 @@
#ifndef _OLEAUT32_PCH_ #ifndef _OLEAUT32_PCH_
#define _OLEAUT32_PCH_ #define _OLEAUT32_PCH_
@ -28,4 +29,4 @@
#include "variant.h" #include "variant.h"
#include "resource.h" #include "resource.h"
#endif /* _OLEAUT32_PCH_ */ #endif /* !_OLEAUT32_PCH_ */

View file

@ -16,7 +16,20 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oaidl.h"
#include "oleauto.h"
#include "variant.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);

View file

@ -17,10 +17,11 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef WINE_OLEAUT32_RESOURCE_H #ifndef WINE_OLEAUT32_RESOURCE_H
#define WINE_OLEAUT32_RESOURCE_H #define WINE_OLEAUT32_RESOURCE_H
#include <windef.h>
/* Localised boolean text */ /* Localised boolean text */
#define IDS_TRUE 100 #define IDS_TRUE 100
#define IDS_FALSE 101 #define IDS_FALSE 101

View file

@ -31,7 +31,19 @@
* 0x10: SAFEARRAYBOUNDS[0...] * 0x10: SAFEARRAYBOUNDS[0...]
*/ */
#include "precomp.h" #include "config.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include "windef.h"
#include "winerror.h"
#include "winbase.h"
#include "variant.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(variant); WINE_DEFAULT_DEBUG_CHANNEL(variant);

View file

@ -21,11 +21,32 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "winuser.h"
#include "ole2.h"
#include "propidl.h" /* for LPSAFEARRAY_User* functions */
#include "typelib.h" #include "typelib.h"
#include "variant.h"
#include <wine/exception.h> #include "wine/debug.h"
#include "wine/exception.h"
static const WCHAR IDispatchW[] = { 'I','D','i','s','p','a','t','c','h',0}; static const WCHAR IDispatchW[] = { 'I','D','i','s','p','a','t','c','h',0};

View file

@ -47,12 +47,34 @@
* *
*/ */
#include "precomp.h" #include "config.h"
#include "wine/port.h"
#include <winternl.h> #include <stdlib.h>
#include <lzexpand.h> #include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "winuser.h"
#include "winternl.h"
#include "lzexpand.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "typelib.h" #include "typelib.h"
#include "wine/debug.h"
#include "variant.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(typelib); WINE_DECLARE_DEBUG_CHANNEL(typelib);
@ -2415,7 +2437,7 @@ MSFT_DoFuncs(TLBContext* pcx,
ptfd->funcdesc.callconv = (pFuncRec->FKCCIC) >> 8 & 0xF; ptfd->funcdesc.callconv = (pFuncRec->FKCCIC) >> 8 & 0xF;
ptfd->funcdesc.cParams = pFuncRec->nrargs ; ptfd->funcdesc.cParams = pFuncRec->nrargs ;
ptfd->funcdesc.cParamsOpt = pFuncRec->nroargs ; ptfd->funcdesc.cParamsOpt = pFuncRec->nroargs ;
ptfd->funcdesc.oVft = pFuncRec->VtableOffset & ~1; ptfd->funcdesc.oVft = (pFuncRec->VtableOffset & ~1) * sizeof(void *) / pTI->pTypeLib->ptr_size;
ptfd->funcdesc.wFuncFlags = LOWORD(pFuncRec->Flags) ; ptfd->funcdesc.wFuncFlags = LOWORD(pFuncRec->Flags) ;
/* nameoffset is sometimes -1 on the second half of a propget/propput /* nameoffset is sometimes -1 on the second half of a propget/propput
@ -3501,10 +3523,6 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
/* name, eventually add to a hash table */ /* name, eventually add to a hash table */
pTypeLibImpl->Name = MSFT_ReadName(&cx, tlbHeader.NameOffset); pTypeLibImpl->Name = MSFT_ReadName(&cx, tlbHeader.NameOffset);
TRACE("%s, syskind %d, version %d.%d, flags %04x\n",
debugstr_w(pTypeLibImpl->Name->str), pTypeLibImpl->syskind,
pTypeLibImpl->ver_major, pTypeLibImpl->ver_minor, pTypeLibImpl->libflags);
/* help info */ /* help info */
pTypeLibImpl->DocString = MSFT_ReadString(&cx, tlbHeader.helpstring); pTypeLibImpl->DocString = MSFT_ReadString(&cx, tlbHeader.helpstring);
pTypeLibImpl->HelpFile = MSFT_ReadString(&cx, tlbHeader.helpfile); pTypeLibImpl->HelpFile = MSFT_ReadString(&cx, tlbHeader.helpfile);
@ -4241,7 +4259,7 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI,
pFuncDesc->funcdesc.callconv = pFunc->nacc & 0x7; pFuncDesc->funcdesc.callconv = pFunc->nacc & 0x7;
pFuncDesc->funcdesc.cParams = pFunc->nacc >> 3; pFuncDesc->funcdesc.cParams = pFunc->nacc >> 3;
pFuncDesc->funcdesc.cParamsOpt = (pFunc->retnextopt & 0x7e) >> 1; pFuncDesc->funcdesc.cParamsOpt = (pFunc->retnextopt & 0x7e) >> 1;
pFuncDesc->funcdesc.oVft = pFunc->vtblpos & ~1; pFuncDesc->funcdesc.oVft = (pFunc->vtblpos & ~1) * sizeof(void *) / pTI->pTypeLib->ptr_size;
if (pFunc->helpstring != 0xffff) if (pFunc->helpstring != 0xffff)
pFuncDesc->HelpString = decode_string(hlp_strings, pBlk + pFunc->helpstring, pNameTable - pBlk, pTI->pTypeLib); pFuncDesc->HelpString = decode_string(hlp_strings, pBlk + pFunc->helpstring, pNameTable - pBlk, pTI->pTypeLib);
@ -6531,6 +6549,44 @@ DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args)
return 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 );
__ASM_GLOBAL_FUNC( call_method,
/* r0 = *func
* r1 = nb_stk_args
* r2 = *stk_args (pointer to 'nb_stk_args' DWORD values to push on stack)
* r3 = *reg_args (pointer to 8, 64-bit d0-d7 (double) values OR as 16, 32-bit s0-s15 (float) values, followed by 4, 32-bit (DWORD) r0-r3 values)
*/
"push {fp, lr}\n\t" /* Save frame pointer and return address (stack still aligned to 8 bytes) */
"mov fp, sp\n\t" /* Save stack pointer as our frame for cleaning the stack on return */
"lsls r1, r1, #2\n\t" /* r1 = nb_stk_args * sizeof(DWORD) */
"beq 1f\n\t" /* Skip allocation if no stack args */
"add r2, r2, r1\n" /* Calculate ending address of incoming stack data */
"2:\tldr ip, [r2, #-4]!\n\t" /* Get next value */
"str ip, [sp, #-4]!\n\t" /* Push it on the stack */
"subs r1, r1, #4\n\t" /* Decrement count */
"bgt 2b\n\t" /* Loop till done */
"1:\n\t"
#ifndef __SOFTFP__
"vldm r3!, {s0-s15}\n\t" /* Load the s0-s15/d0-d7 arguments */
#endif
"mov ip, r0\n\t" /* Save the function call address to ip before we nuke r0 with arguments to pass */
"ldm r3, {r0-r3}\n\t" /* Load the r0-r3 arguments */
"blx ip\n\t" /* Call the target function */
"mov sp, fp\n\t" /* Clean the stack using fp */
"pop {fp, pc}\n\t" /* Restore fp and return */
)
/* same function but returning single/double floating point */
static float (CDECL * const call_float_method)(void *, int, const DWORD *, const DWORD *) = (void *)call_method;
static double (CDECL * const call_double_method)(void *, int, const DWORD *, const DWORD *) = (void *)call_method;
#endif /* __x86_64__ */ #endif /* __x86_64__ */
static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt) static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
@ -6562,7 +6618,6 @@ static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc,
break; break;
case TKIND_ALIAS: case TKIND_ALIAS:
tdesc = &tattr->tdescAlias;
hr = typedescvt_to_variantvt(tinfo2, &tattr->tdescAlias, vt); hr = typedescvt_to_variantvt(tinfo2, &tattr->tdescAlias, vt);
break; break;
@ -6956,6 +7011,182 @@ DispCallFunc(
TRACE("retval: %s\n", debugstr_variant(pvargResult)); TRACE("retval: %s\n", debugstr_variant(pvargResult));
return S_OK; return S_OK;
#elif defined(__arm__)
int argspos;
void *func;
UINT i;
DWORD *args;
struct {
#ifndef __SOFTFP__
union {
float s[16];
double d[8];
} sd;
#endif
DWORD r[4];
} regs;
int rcount; /* 32-bit register index count */
#ifndef __SOFTFP__
int scount = 0; /* single-precision float register index count */
int dcount = 0; /* double-precision float register index count */
#endif
TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult));
if (cc != CC_STDCALL && cc != CC_CDECL)
{
FIXME("unsupported calling convention %d\n",cc);
return E_INVALIDARG;
}
argspos = 0;
rcount = 0;
/* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */
/* first as it will need to be in the 'r' registers: */
switch (vtReturn)
{
case VT_DECIMAL:
case VT_VARIANT:
regs.r[rcount++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
break;
case VT_HRESULT:
WARN("invalid return type %u\n", vtReturn);
return E_INVALIDARG;
default: /* And all others are in 'r', 's', or 'd' registers or have no return value */
break;
}
if (pvInstance)
{
const FARPROC *vtable = *(FARPROC **)pvInstance;
func = vtable[oVft/sizeof(void *)];
regs.r[rcount++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */
}
else func = (void *)oVft;
/* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */
args = heap_alloc( sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 );
for (i = 0; i < cActuals; i++)
{
VARIANT *arg = prgpvarg[i];
DWORD *pdwarg = (DWORD *)(arg); /* a reinterpret_cast of the variant, used for copying structures when they are split between registers and stack */
int ntemp; /* Used for counting words split between registers and stack */
switch (prgvt[i])
{
case VT_EMPTY:
break;
case VT_R8: /* these must be 8-byte aligned, and put in 'd' regs or stack, as they are double-floats */
case VT_DATE:
#ifndef __SOFTFP__
dcount = max( (scount + 1) / 2, dcount );
if (dcount < 8)
{
regs.sd.d[dcount++] = V_R8(arg);
}
else
{
argspos += (argspos % 2); /* align argspos to 8-bytes */
memcpy( &args[argspos], &V_R8(arg), sizeof(V_R8(arg)) );
argspos += sizeof(V_R8(arg)) / sizeof(DWORD);
}
break;
#endif
case VT_I8: /* these must be 8-byte aligned, and put in 'r' regs or stack, as they are long-longs */
case VT_UI8:
case VT_CY:
if (rcount < 3)
{
rcount += (rcount % 2); /* align rcount to 8-byte register pair */
memcpy( &regs.r[rcount], &V_UI8(arg), sizeof(V_UI8(arg)) );
rcount += sizeof(V_UI8(arg)) / sizeof(DWORD);
}
else
{
rcount = 4; /* Make sure we flag that all 'r' regs are full */
argspos += (argspos % 2); /* align argspos to 8-bytes */
memcpy( &args[argspos], &V_UI8(arg), sizeof(V_UI8(arg)) );
argspos += sizeof(V_UI8(arg)) / sizeof(DWORD);
}
break;
case VT_DECIMAL: /* these structures are 8-byte aligned, and put in 'r' regs or stack, can be split between the two */
case VT_VARIANT:
/* 8-byte align 'r' and/or stack: */
if (rcount < 3)
rcount += (rcount % 2);
else
{
rcount = 4;
argspos += (argspos % 2);
}
ntemp = sizeof(*arg) / sizeof(DWORD);
while (ntemp > 0)
{
if (rcount < 4)
regs.r[rcount++] = *pdwarg++;
else
args[argspos++] = *pdwarg++;
--ntemp;
}
break;
case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */
if (rcount < 4)
regs.r[rcount++] = V_BOOL(arg);
else
args[argspos++] = V_BOOL(arg);
break;
case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */
#ifndef __SOFTFP__
if (!(scount % 2)) scount = max( scount, dcount * 2 );
if (scount < 16)
regs.sd.s[scount++] = V_R4(arg);
else
args[argspos++] = V_UI4(arg);
break;
#endif
default:
if (rcount < 4)
regs.r[rcount++] = V_UI4(arg);
else
args[argspos++] = V_UI4(arg);
break;
}
TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg));
}
argspos += (argspos % 2); /* Make sure stack function alignment is 8-byte */
switch (vtReturn)
{
case VT_EMPTY: /* EMPTY = no return value */
case VT_DECIMAL: /* DECIMAL and VARIANT already have a pointer argument passed (see above) */
case VT_VARIANT:
call_method( func, argspos, args, (DWORD*)&regs );
break;
case VT_R4:
V_R4(pvargResult) = call_float_method( func, argspos, args, (DWORD*)&regs );
break;
case VT_R8:
case VT_DATE:
V_R8(pvargResult) = call_double_method( func, argspos, args, (DWORD*)&regs );
break;
case VT_I8:
case VT_UI8:
case VT_CY:
V_UI8(pvargResult) = call_method( func, argspos, args, (DWORD*)&regs );
break;
default:
V_UI4(pvargResult) = call_method( func, argspos, args, (DWORD*)&regs );
break;
}
heap_free( args );
if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn;
TRACE("retval: %s\n", debugstr_variant(pvargResult));
return S_OK;
#else #else
FIXME( "(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n", FIXME( "(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n",
pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult)); pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult));
@ -7049,7 +7280,6 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
UINT cNamedArgs = pDispParams->cNamedArgs; UINT cNamedArgs = pDispParams->cNamedArgs;
DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs; DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs;
UINT vargs_converted=0; UINT vargs_converted=0;
ULONG_PTR offset;
hres = S_OK; hres = S_OK;
@ -7298,11 +7528,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
break; break;
} }
} }
if (FAILED(hres)) if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */
{
ERR("failed: %08x\n", hres);
goto func_fail; /* FIXME: we don't free changed types here */
}
/* VT_VOID is a special case for return types, so it is not /* VT_VOID is a special case for return types, so it is not
* handled in the general function */ * handled in the general function */
@ -7315,16 +7541,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */ if (FAILED(hres)) goto func_fail; /* FIXME: we don't free changed types here */
} }
offset = func_desc->oVft & 0xFFFC; hres = DispCallFunc(pIUnk, func_desc->oVft & 0xFFFC, func_desc->callconv,
#ifdef _WIN64
if (This->pTypeLib->syskind == SYS_WIN32)
{
offset *= 2;
TRACE("extended offset to %#lx for SYS_WIN32\n", offset);
}
#endif
TRACE("func_desc->oVft %#x, offset %#lx\n", func_desc->oVft, offset);
hres = DispCallFunc(pIUnk, offset, func_desc->callconv,
V_VT(&varresult), func_desc->cParams, rgvt, V_VT(&varresult), func_desc->cParams, rgvt,
prgpvarg, &varresult); prgpvarg, &varresult);
@ -7451,7 +7668,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
* pointer to be valid */ * pointer to be valid */
VariantInit(pVarResult); VariantInit(pVarResult);
hres = IDispatch_Invoke(pDispatch, DISPID_VALUE, &IID_NULL, hres = IDispatch_Invoke(pDispatch, DISPID_VALUE, &IID_NULL,
GetSystemDefaultLCID(), INVOKE_PROPERTYGET, GetSystemDefaultLCID(), wFlags,
pDispParams, pVarResult, pExcepInfo, pArgErr); pDispParams, pVarResult, pExcepInfo, pArgErr);
IDispatch_Release(pDispatch); IDispatch_Release(pDispatch);
} }

View file

@ -21,6 +21,12 @@
#ifndef _WINE_TYPELIB_H #ifndef _WINE_TYPELIB_H
#define _WINE_TYPELIB_H #define _WINE_TYPELIB_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "oleauto.h"
#define HELPDLLFLAG (0x0100) #define HELPDLLFLAG (0x0100)
#define DO_NOT_SEEK (-1) #define DO_NOT_SEEK (-1)
@ -590,26 +596,6 @@ WORD typeofarray
#include "poppack.h" #include "poppack.h"
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc( SIZE_T size )
{
return HeapAlloc( GetProcessHeap(), 0, size );
}
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero( SIZE_T size )
{
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size );
}
static inline void* __WINE_ALLOC_SIZE(2) heap_realloc( LPVOID mem, SIZE_T size )
{
return HeapReAlloc( GetProcessHeap(), 0, mem, size );
}
static inline BOOL heap_free( LPVOID mem )
{
return HeapFree( GetProcessHeap(), 0, mem );
}
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc ) DECLSPEC_HIDDEN; HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc ) DECLSPEC_HIDDEN;
extern DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args) DECLSPEC_HIDDEN; extern DWORD _invoke(FARPROC func, CALLCONV callconv, int nrargs, DWORD_PTR *args) DECLSPEC_HIDDEN;

View file

@ -19,7 +19,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include <stdarg.h>
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "ole2.h"
#include "oleauto.h"
#include "typelib.h"
#include "ocidl.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);

View file

@ -25,7 +25,19 @@
* Please submit a test case if you find a difference. * Please submit a test case if you find a difference.
*/ */
#include "precomp.h" #include "config.h"
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wine/unicode.h"
#include "winerror.h"
#include "variant.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(variant); WINE_DEFAULT_DEBUG_CHANNEL(variant);

View file

@ -25,7 +25,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #include "config.h"
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wine/unicode.h"
#include "winerror.h"
#include "variant.h"
#include "resource.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(variant); WINE_DEFAULT_DEBUG_CHANNEL(variant);
@ -2145,7 +2161,7 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
multiplier10, divisor10); multiplier10, divisor10);
if (dwVtBits & (INTEGER_VTBITS|VTBIT_DECIMAL) && if (dwVtBits & (INTEGER_VTBITS|VTBIT_DECIMAL) &&
(!fractionalDigits || !(dwVtBits & (REAL_VTBITS|VTBIT_CY|VTBIT_DECIMAL)))) (!fractionalDigits || !(dwVtBits & (REAL_VTBITS|VTBIT_DECIMAL))))
{ {
/* We have one or more integer output choices, and either: /* We have one or more integer output choices, and either:
* 1) An integer input value, or * 1) An integer input value, or
@ -2259,7 +2275,7 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
V_I8(pVarDst) = -ul64; V_I8(pVarDst) = -ul64;
return S_OK; return S_OK;
} }
else if ((dwVtBits & REAL_VTBITS) == VTBIT_DECIMAL) else if ((dwVtBits & (REAL_VTBITS|VTBIT_DECIMAL)) == VTBIT_DECIMAL)
{ {
/* Decimal is only output choice left - fast path */ /* Decimal is only output choice left - fast path */
V_VT(pVarDst) = VT_DECIMAL; V_VT(pVarDst) = VT_DECIMAL;
@ -2321,7 +2337,7 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
V_UI8(pVarDst) = ul64; V_UI8(pVarDst) = ul64;
return S_OK; return S_OK;
} }
else if ((dwVtBits & REAL_VTBITS) == VTBIT_DECIMAL) else if ((dwVtBits & (REAL_VTBITS|VTBIT_DECIMAL)) == VTBIT_DECIMAL)
{ {
/* Decimal is only output choice left - fast path */ /* Decimal is only output choice left - fast path */
V_VT(pVarDst) = VT_DECIMAL; V_VT(pVarDst) = VT_DECIMAL;
@ -2376,8 +2392,8 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
{ {
if (whole < dblMinimums[10] && whole != 0) if (whole < dblMinimums[10] && whole != 0)
{ {
dwVtBits &= ~(VTBIT_R4|VTBIT_R8|VTBIT_CY); /* Underflow */ whole = 0; /* ignore underflow */
bOverflow = TRUE; divisor10 = 0;
break; break;
} }
whole = whole / dblMultipliers[10]; whole = whole / dblMultipliers[10];
@ -2387,8 +2403,8 @@ HRESULT WINAPI VarNumFromParseNum(NUMPARSE *pNumprs, BYTE *rgbDig,
{ {
if (whole < dblMinimums[divisor10] && whole != 0) if (whole < dblMinimums[divisor10] && whole != 0)
{ {
dwVtBits &= ~(VTBIT_R4|VTBIT_R8|VTBIT_CY); /* Underflow */ whole = 0; /* ignore underflow */
bOverflow = TRUE; divisor10 = 0;
} }
else else
whole = whole / dblMultipliers[divisor10]; whole = whole / dblMultipliers[divisor10];

View file

@ -20,6 +20,10 @@
#pragma once #pragma once
#include "windef.h"
#include "winerror.h"
#include "objbase.h"
#include "oleauto.h"
#include <math.h> #include <math.h>
/* Get just the type from a variant pointer */ /* Get just the type from a variant pointer */

View file

@ -18,7 +18,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "precomp.h" #define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "wine/debug.h"
#include "wine/unicode.h"
#include "winbase.h"
#include "winuser.h"
#include "winnt.h"
#include "variant.h"
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(variant); WINE_DEFAULT_DEBUG_CHANNEL(variant);
@ -5362,7 +5372,7 @@ static HRESULT VARIANT_DI_normalize(VARIANT_DI * val, int exponent2, BOOL isDoub
end of the bit representation, down to the precision guaranteed by the end of the bit representation, down to the precision guaranteed by the
floating point number. */ floating point number. */
if (isDouble) { if (isDouble) {
while (exponent10 < 0 && (val->bitsnum[2] != 0 || (val->bitsnum[2] == 0 && (val->bitsnum[1] & 0xFFE00000) != 0))) { while (exponent10 < 0 && (val->bitsnum[2] != 0 || (val->bitsnum[1] & 0xFFE00000) != 0)) {
int rem10; int rem10;
rem10 = VARIANT_int_divbychar(val->bitsnum, 3, 10); rem10 = VARIANT_int_divbychar(val->bitsnum, 3, 10);

View file

@ -141,7 +141,7 @@ reactos/dll/win32/odbc32 # Synced to WineStaging-2.9. Depends on po
reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9 reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9
reactos/dll/win32/ole32 # Synced to Wine-3.0 reactos/dll/win32/ole32 # Synced to Wine-3.0
reactos/dll/win32/oleacc # Synced to WineStaging-2.9 reactos/dll/win32/oleacc # Synced to WineStaging-2.9
reactos/dll/win32/oleaut32 # Synced to WineStaging-2.16 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3
reactos/dll/win32/olecli32 # Synced to WineStaging-2.9 reactos/dll/win32/olecli32 # Synced to WineStaging-2.9
reactos/dll/win32/oledlg # Synced to WineStaging-2.9 reactos/dll/win32/oledlg # Synced to WineStaging-2.9
reactos/dll/win32/olepro32 # Synced to WineStaging-2.9 reactos/dll/win32/olepro32 # Synced to WineStaging-2.9