Author: akhaldi Date: Thu Nov 17 22:59:30 2016 New Revision: 73286
URL: http://svn.reactos.org/svn/reactos?rev=73286&view=rev Log: [OLEAUT32_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
Modified: trunk/rostests/winetests/oleaut32/olefont.c trunk/rostests/winetests/oleaut32/olepicture.c trunk/rostests/winetests/oleaut32/safearray.c trunk/rostests/winetests/oleaut32/typelib.c trunk/rostests/winetests/oleaut32/vartest.c
Modified: trunk/rostests/winetests/oleaut32/olefont.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/olefont... ============================================================================== --- trunk/rostests/winetests/oleaut32/olefont.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/olefont.c [iso-8859-1] Thu Nov 17 22:59:30 2016 @@ -1235,6 +1235,7 @@ static void test_OleCreateFontIndirect(void) { FONTDESC fontdesc; + IUnknown *unk, *unk2; IFont *font; HRESULT hr;
@@ -1266,6 +1267,20 @@ hr = pOleCreateFontIndirect(&fontdesc, &IID_IFont, (void**)&font); EXPECT_HR(hr, S_OK); IFont_Release(font); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = CoGetClassObject(&CLSID_StdFont, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void**)&unk2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IUnknown_Release(unk); + IUnknown_Release(unk2); + + OleUninitialize(); }
START_TEST(olefont)
Modified: trunk/rostests/winetests/oleaut32/olepicture.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/olepict... ============================================================================== --- trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] Thu Nov 17 22:59:30 2016 @@ -173,6 +173,25 @@ 0x14, 0x00, 0x00, 0x00 };
+static HBITMAP stock_bm; + +static HDC create_render_dc( void ) +{ + HDC dc = CreateCompatibleDC( NULL ); + BITMAPINFO info = {{sizeof(info.bmiHeader), 100, 100, 1, 32, BI_RGB }}; + void *bits; + HBITMAP dib = CreateDIBSection( NULL, &info, DIB_RGB_COLORS, &bits, NULL, 0 ); + + stock_bm = SelectObject( dc, dib ); + return dc; +} + +static void delete_render_dc( HDC dc ) +{ + HBITMAP dib = SelectObject( dc, stock_bm ); + DeleteObject( dib ); + DeleteDC( dc ); +}
typedef struct NoStatStreamImpl { @@ -484,7 +503,7 @@ ok(hr == DISP_E_BADPARAMCOUNT, "IPictureDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08x\n", hr);
/* DISPID_PICT_RENDER */ - hdc = GetDC(0); + hdc = create_render_dc();
for (i = 0; i < sizeof(args)/sizeof(args[0]); i++) V_VT(&args[i]) = VT_I4; @@ -520,7 +539,7 @@ hr = IPictureDisp_Invoke(picdisp, DISPID_PICT_RENDER, &GUID_NULL, 0, DISPATCH_METHOD, &dispparams, &varresult, NULL, NULL); ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr);
- ReleaseDC(NULL, hdc); + delete_render_dc(hdc); IPictureDisp_Release(picdisp); }
@@ -704,7 +723,7 @@ OLE_XSIZE_HIMETRIC pWidth; OLE_YSIZE_HIMETRIC pHeight; COLORREF result, expected; - HDC hdc = GetDC(0); + HDC hdc = create_render_dc();
/* test IPicture::Render return code on uninitialized picture */ OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (VOID**)&pic); @@ -736,7 +755,7 @@ desc.u.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); if(!desc.u.icon.hicon){ win_skip("LoadIcon failed. Skipping...\n"); - ReleaseDC(NULL, hdc); + delete_render_dc(hdc); return; }
@@ -769,27 +788,22 @@ hres = picture_render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL); ole_expect(hres, S_OK);
- if(hres != S_OK) { - IPicture_Release(pic); - ReleaseDC(NULL, hdc); - return; - } + if(hres != S_OK) goto done;
/* Evaluate the rendered Icon */ result = GetPixel(hdc, 0, 0); ok(result == expected, "Color at 0,0 should be unchanged 0x%06X, but was 0x%06X\n", expected, result); result = GetPixel(hdc, 5, 5); - ok(result != expected || - broken(result == expected), /* WinNT 4.0 and older may claim they drew */ - /* the icon, even if they didn't. */ + ok(result != expected, "Color at 5,5 should have changed, but still was 0x%06X\n", expected); result = GetPixel(hdc, 10, 10); ok(result == expected, "Color at 10,10 should be unchanged 0x%06X, but was 0x%06X\n", expected, result);
+done: IPicture_Release(pic); - ReleaseDC(NULL, hdc); + delete_render_dc(hdc); }
static void test_get_Attributes(void)
Modified: trunk/rostests/winetests/oleaut32/safearray.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/safearr... ============================================================================== --- trunk/rostests/winetests/oleaut32/safearray.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/safearray.c [iso-8859-1] Thu Nov 17 22:59:30 2016 @@ -710,11 +710,9 @@ }
if (!pSafeArrayAllocDescriptorEx) - { return; - } - - for (i=0;i<sizeof(vttypes)/sizeof(vttypes[0]);i++) { + + for (i = 0; i < sizeof(vttypes)/sizeof(vttypes[0]); i++) { a = NULL; hres = pSafeArrayAllocDescriptorEx(vttypes[i].vt,1,&a); ok(hres == S_OK, "SafeArrayAllocDescriptorEx gave hres 0x%x\n", hres); @@ -768,7 +766,7 @@ } hres = SafeArrayDestroyDescriptor(a); ok(hres == S_OK,"SADD failed with hres %x\n",hres); - } + } }
static void test_SafeArrayAllocDestroyDescriptor(void)
Modified: trunk/rostests/winetests/oleaut32/typelib.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/typelib... ============================================================================== --- trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] Thu Nov 17 22:59:30 2016 @@ -229,15 +229,13 @@
static void test_TypeComp(void) { + ITypeComp *pTypeComp, *tcomp, *pTypeComp_tmp; + ITypeInfo *pTypeInfo, *ti, *pFontTypeInfo; ITypeLib *pTypeLib; - ITypeComp *pTypeComp; HRESULT hr; ULONG ulHash; DESCKIND desckind; BINDPTR bindptr; - ITypeInfo *pTypeInfo; - ITypeInfo *pFontTypeInfo; - ITypeComp *pTypeComp_tmp; static WCHAR wszStdFunctions[] = {'S','t','d','F','u','n','c','t','i','o','n','s',0}; static WCHAR wszSavePicture[] = {'S','a','v','e','P','i','c','t','u','r','e',0}; static WCHAR wszOLE_TRISTATE[] = {'O','L','E','_','T','R','I','S','T','A','T','E',0}; @@ -437,6 +435,17 @@
hr = ITypeInfo_GetTypeComp(pFontTypeInfo, &pTypeComp); ok_ole_success(hr, ITypeLib_GetTypeComp); + + hr = ITypeInfo_QueryInterface(pFontTypeInfo, &IID_ITypeComp, (void**)&tcomp); + ok(hr == S_OK, "got %08x\n", hr); + ok(tcomp == pTypeComp, "got %p, was %p\n", tcomp, pTypeComp); + + hr = ITypeComp_QueryInterface(tcomp, &IID_ITypeInfo, (void**)&ti); + ok(hr == S_OK, "got %08x\n", hr); + ok(ti == pFontTypeInfo, "got %p, was %p\n", ti, pFontTypeInfo); + ITypeInfo_Release(ti); + + ITypeComp_Release(tcomp);
ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszClone); hr = ITypeComp_Bind(pTypeComp, wszClone, ulHash, 0, &pTypeInfo, &desckind, &bindptr); @@ -1686,7 +1695,7 @@ ITypeInfo *interface1, *interface2, *dual, *unknown, *dispatch, *ti; ITypeInfo *tinfos[2]; ITypeInfo2 *ti2; - ITypeComp *tcomp; + ITypeComp *tcomp, *tcomp2; MEMBERID memids[2]; FUNCDESC funcdesc, *pfuncdesc; ELEMDESC elemdesc[5], *edesc; @@ -2026,6 +2035,8 @@ funcdesc.lprgelemdescParam = NULL; funcdesc.invkind = INVOKE_FUNC; funcdesc.cParams = 0; + funcdesc.cScodes = 1; + funcdesc.lprgscode = NULL; hres = ICreateTypeInfo_AddFuncDesc(createti, 1, &funcdesc); ok(hres == S_OK, "got %08x\n", hres);
@@ -3600,6 +3611,11 @@
hres = ITypeInfo_GetTypeComp(ti, &tcomp); ok(hres == S_OK, "got %08x\n", hres); + + hres = ITypeInfo_QueryInterface(ti, &IID_ITypeComp, (void**)&tcomp2); + ok(hres == S_OK, "got %08x\n", hres); + ok(tcomp == tcomp2, "got %p, was %p\n", tcomp2, tcomp); + ITypeComp_Release(tcomp2);
hres = ITypeComp_Bind(tcomp, invokeW, 0, INVOKE_FUNC, &interface1, &desckind, &bindptr); ok(hres == S_OK, "got %08x\n", hres);
Modified: trunk/rostests/winetests/oleaut32/vartest.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartest... ============================================================================== --- trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] Thu Nov 17 22:59:30 2016 @@ -727,12 +727,13 @@
/* DISPATCH */ V_VT(&v) = VT_DISPATCH; - V_DISPATCH(&v) = (IDispatch*)&test_myVariantClearImpl; + V_DISPATCH(&v) = (IDispatch*)&test_myVariantClearImpl.IUnknown_iface; test_myVariantClearImpl.events = 0; hres = VariantClear(&v); ok(hres == S_OK, "ret %08x\n", hres); ok(V_VT(&v) == 0, "vt %04x\n", V_VT(&v)); - ok(V_DISPATCH(&v) == (IDispatch*)&test_myVariantClearImpl, "dispatch %p\n", V_DISPATCH(&v)); + ok(V_DISPATCH(&v) == (IDispatch*)&test_myVariantClearImpl.IUnknown_iface, + "dispatch %p\n", V_DISPATCH(&v)); /* Check that Release got called, but nothing else */ ok(test_myVariantClearImpl.events == 0x4, "Unexpected call. events %08x\n", test_myVariantClearImpl.events);