Author: akhaldi
Date: Sun Mar 5 21:50:37 2017
New Revision: 74110
URL:
http://svn.reactos.org/svn/reactos?rev=74110&view=rev
Log:
[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.
Modified:
trunk/reactos/dll/win32/oleaut32/oleaut32.spec
trunk/reactos/dll/win32/oleaut32/olepicture.c
trunk/reactos/dll/win32/oleaut32/typelib.c
trunk/reactos/dll/win32/oleaut32/typelib.h
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut3…
==============================================================================
--- trunk/reactos/dll/win32/oleaut32/oleaut32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/oleaut32/oleaut32.spec [iso-8859-1] Sun Mar 5 21:50:37 2017
@@ -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)
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] Sun Mar 5 21:50:37 2017
@@ -457,7 +457,7 @@
*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 @@
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 @@
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 @@
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 @@
hdcref,
&bih,
CBM_INIT,
- bits,
+ mask,
(BITMAPINFO*)&bih,
DIB_RGB_COLORS
);
@@ -1106,6 +1113,7 @@
}
end:
+ HeapFree(GetProcessHeap(), 0, mask);
IWICBitmapSource_Release(real_source);
return hr;
}
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] Sun Mar 5 21:50:37 2017
@@ -1590,30 +1590,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
@@ -5663,7 +5639,7 @@
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 @@
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 @@
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 @@
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));
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] Sun Mar 5 21:50:37 2017
@@ -590,11 +590,25 @@
#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;
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] Sun Mar 5 21:50:37 2017
@@ -141,7 +141,7 @@
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