[OLEAUT32] Sync with Wine Staging 2.2. CORE-12823

43c59f0 oleaut32: Accept DISP_E_PARAMNOTFOUND for missing optional parameters in ITypeInfo::Invoke implementation. (v3)
a4f9840 oleaut32: Fix calling function with instance and VARIANT return type. (v2)
78ee7f5 oleaut32: Standardize the heap_xxx() functions.
9e54ae7 oleaut32: Return proper interface pointers.
655af6d oleaut32: Fix OleTranslateColor spec file entry.

svn path=/trunk/; revision=74110
This commit is contained in:
Amine Khaldi 2017-03-05 21:50:37 +00:00
parent b400ac7ae6
commit 8a80051169
5 changed files with 59 additions and 42 deletions

View file

@ -373,7 +373,7 @@
418 stdcall OleLoadPicture(ptr long long ptr ptr)
419 stdcall OleCreatePictureIndirect(ptr ptr long ptr)
420 stdcall OleCreateFontIndirect(ptr ptr ptr)
421 stdcall OleTranslateColor(long long long)
421 stdcall OleTranslateColor(long long ptr)
422 stdcall OleLoadPictureFile(int128 ptr)
423 stdcall OleSavePictureFile(ptr wstr)
424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr)

View file

@ -457,7 +457,7 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface(
*ppvObject = 0;
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPicture, riid))
*ppvObject = This;
*ppvObject = &This->IPicture_iface;
else if (IsEqualIID(&IID_IDispatch, riid))
*ppvObject = &This->IDispatch_iface;
else if (IsEqualIID(&IID_IPictureDisp, riid))
@ -1003,7 +1003,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
BITMAPINFOHEADER bih;
UINT width, height;
UINT stride, buffersize;
BYTE *bits;
BYTE *bits, *mask = NULL;
WICRect rc;
IWICBitmapSource *real_source;
UINT x, y;
@ -1031,6 +1031,13 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
stride = 4 * width;
buffersize = stride * height;
mask = HeapAlloc(GetProcessHeap(), 0, buffersize);
if (!mask)
{
hr = E_OUTOFMEMORY;
goto end;
}
This->desc.u.bmp.hbitmap = CreateDIBSection(0, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void **)&bits, NULL, 0);
if (This->desc.u.bmp.hbitmap == 0)
{
@ -1059,10 +1066,10 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
if((*pixel & 0x80000000) == 0)
{
has_alpha = TRUE;
*pixel = black;
*(DWORD *)(mask + stride * y + 4 * x) = black;
}
else
*pixel = white;
*(DWORD *)(mask + stride * y + 4 * x) = white;
}
}
@ -1077,7 +1084,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
hdcref,
&bih,
CBM_INIT,
bits,
mask,
(BITMAPINFO*)&bih,
DIB_RGB_COLORS
);
@ -1106,6 +1113,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
}
end:
HeapFree(GetProcessHeap(), 0, mask);
IWICBitmapSource_Release(real_source);
return hr;
}

View file

@ -1592,30 +1592,6 @@ static void TLB_abort(void)
DebugBreak();
}
void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(unsigned size)
{
void *ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if (!ret) ERR("cannot allocate memory\n");
return ret;
}
void* __WINE_ALLOC_SIZE(1) heap_alloc(unsigned size)
{
void *ret = HeapAlloc(GetProcessHeap(), 0, size);
if (!ret) ERR("cannot allocate memory\n");
return ret;
}
void* __WINE_ALLOC_SIZE(2) heap_realloc(void *ptr, unsigned size)
{
return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
}
void heap_free(void *ptr)
{
HeapFree(GetProcessHeap(), 0, ptr);
}
/* returns the size required for a deep copy of a typedesc into a
* flat buffer */
static SIZE_T TLB_SizeTypeDesc( const TYPEDESC *tdesc, BOOL alloc_initial_space )
@ -5663,7 +5639,7 @@ static HRESULT WINAPI ITypeInfo_fnQueryInterface(
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid,&IID_ITypeInfo)||
IsEqualIID(riid,&IID_ITypeInfo2))
*ppvObject = This;
*ppvObject = &This->ITypeInfo2_iface;
else if(IsEqualIID(riid, &IID_ICreateTypeInfo) ||
IsEqualIID(riid, &IID_ICreateTypeInfo2))
*ppvObject = &This->ICreateTypeInfo2_iface;
@ -6861,8 +6837,17 @@ DispCallFunc(
break;
case VT_DECIMAL:
case VT_VARIANT:
args[0] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
call_method( func, argspos, args, &stack_offset );
if (pvInstance)
{
args[0] = (DWORD)pvInstance; /* arg 0 is a pointer to the instance */
args[1] = (DWORD)pvargResult; /* arg 1 is a pointer to the result */
call_method( func, argspos, args, &stack_offset );
}
else
{
args[0] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
call_method( func, argspos, args, &stack_offset );
}
break;
case VT_I8:
case VT_UI8:
@ -6947,8 +6932,17 @@ DispCallFunc(
break;
case VT_DECIMAL:
case VT_VARIANT:
args[0] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
call_method( func, argspos, args );
if (pvInstance)
{
args[0] = (DWORD_PTR)pvInstance; /* arg 0 is a pointer to the instance */
args[1] = (DWORD_PTR)pvargResult; /* arg 1 is a pointer to the result */
call_method( func, argspos, args );
}
else
{
args[0] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
call_method( func, argspos, args );
}
break;
case VT_HRESULT:
WARN("invalid return type %u\n", vtReturn);
@ -7154,7 +7148,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
break;
}
}
else if (src_arg)
else if (src_arg && !((wParamFlags & PARAMFLAG_FOPT) &&
V_VT(src_arg) == VT_ERROR && V_ERROR(src_arg) == DISP_E_PARAMNOTFOUND))
{
TRACE("%s\n", debugstr_variant(src_arg));

View file

@ -590,11 +590,25 @@ WORD typeofarray
#include "poppack.h"
/* heap allocation helpers */
extern void* heap_alloc_zero(unsigned size) DECLSPEC_HIDDEN __WINE_ALLOC_SIZE(1);
extern void* heap_alloc(unsigned size) DECLSPEC_HIDDEN __WINE_ALLOC_SIZE(1);
extern void* heap_realloc(void *ptr, unsigned size) DECLSPEC_HIDDEN;
extern void heap_free(void *ptr) DECLSPEC_HIDDEN;
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;

View file

@ -141,7 +141,7 @@ reactos/dll/win32/odbc32 # Synced to WineStaging-2.2. Depends on po
reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.11
reactos/dll/win32/ole32 # Synced to WineStaging-2.2
reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11
reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.23
reactos/dll/win32/oleaut32 # Synced to WineStaging-2.2
reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11
reactos/dll/win32/oledlg # Synced to WineStaging-1.9.23
reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.11