winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
715 discussions
Start a n
N
ew thread
Huw Davies : oleaut32: Fix CreateDispTypeInfo to store the correct number of functions.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: b698b2909b60b72c35743d9691c1da337d9f7423 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b698b2909b60b72c35743d969…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri May 18 13:57:05 2007 +0100 oleaut32: Fix CreateDispTypeInfo to store the correct number of functions. --- dlls/oleaut32/tests/typelib.c | 5 +++++ dlls/oleaut32/typelib.c | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index a963834..d19afd3 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -350,10 +350,15 @@ static void test_CreateDispTypeInfo(void) hr = ITypeInfo_GetTypeAttr(pTI2, &pTypeAttr); ok(hr == S_OK, "hr %08x\n", hr); ok(pTypeAttr->typekind == TKIND_INTERFACE, "typekind %0x\n", pTypeAttr->typekind); + ok(pTypeAttr->cFuncs == 4, "cFuncs %d\n", pTypeAttr->cFuncs); + ok(IsEqualGUID(&pTypeAttr->guid, &GUID_NULL), "guid {%08x-...}\n", pTypeAttr->guid.Data1); + ok(pTypeAttr->wTypeFlags == 0, "typeflags %08x\n", pTypeAttr->wTypeFlags); + ITypeInfo_ReleaseTypeAttr(pTI2, pTypeAttr); hr = ITypeInfo_GetFuncDesc(pTI2, 0, &pFuncDesc); ok(hr == S_OK, "hr %08x\n", hr); + ok(pFuncDesc->memid == 0x123, "memid %x\n", pFuncDesc->memid); ok(pFuncDesc->funckind == FUNC_VIRTUAL, "funckind %d\n", pFuncDesc->funckind); ok(pFuncDesc->invkind == methdata[0].wFlags, "invkind %d\n", pFuncDesc->invkind); ok(pFuncDesc->callconv == methdata[0].cc, "callconv %d\n", pFuncDesc->callconv); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index a0d4ee4..f3ee2bf 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -6884,6 +6884,7 @@ HRESULT WINAPI CreateDispTypeInfo( (*ppFuncDesc)->ctCustData = 0; (*ppFuncDesc)->pCustData = NULL; (*ppFuncDesc)->next = NULL; + pTIIface->TypeAttr.cFuncs++; ppFuncDesc = &(*ppFuncDesc)->next; }
1
0
0
0
Huw Davies : oleaut32: non-dual dispinterfaces should be marshaled via IDispatch.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: c24a53dc2844c24fe44af7c1f4bba421831ea0f9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c24a53dc2844c24fe44af7c1f…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 17 15:29:41 2007 +0100 oleaut32: non-dual dispinterfaces should be marshaled via IDispatch. --- dlls/oleaut32/tmarshal.c | 167 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 118 insertions(+), 49 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index f11d835..3772910 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -320,49 +320,49 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { return hres; } -/* Determine nr of functions. Since we use the toplevel interface and all - * inherited ones have lower numbers, we are ok to not to descent into - * the inheritance tree I think. +/* + * Determine the number of functions including all inherited functions. + * Note for non-dual dispinterfaces we simply return the size of IDispatch. */ -static int _nroffuncs(ITypeInfo *tinfo) { - int n, i, j; - const FUNCDESC *fdesc; - HRESULT hres; +static HRESULT num_of_funcs(ITypeInfo *tinfo, unsigned int *num) +{ + HRESULT hres; TYPEATTR *attr; ITypeInfo *tinfo2; - n=0; + *num = 0; hres = ITypeInfo_GetTypeAttr(tinfo, &attr); if (hres) { ERR("GetTypeAttr failed with %x\n",hres); return hres; } - /* look in inherited ifaces. */ - for (j=0;j<attr->cImplTypes;j++) { + + if(attr->typekind == TKIND_DISPATCH && (attr->wTypeFlags & TYPEFLAG_FDUAL)) + { HREFTYPE href; - hres = ITypeInfo_GetRefTypeOfImplType(tinfo, j, &href); - if (hres) { - ERR("Did not find a reftype for interface offset %d?\n",j); - break; + hres = ITypeInfo_GetRefTypeOfImplType(tinfo, -1, &href); + if(FAILED(hres)) + { + ERR("Unable to get interface href from dual dispinterface\n"); + goto end; } hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2); - if (hres) { - ERR("Did not find a typeinfo for reftype %d?\n",href); - continue; + if(FAILED(hres)) + { + ERR("Unable to get interface from dual dispinterface\n"); + goto end; } - n += _nroffuncs(tinfo2); + hres = num_of_funcs(tinfo2, num); ITypeInfo_Release(tinfo2); } - ITypeInfo_ReleaseTypeAttr(tinfo, attr); - i = 0; - while (1) { - hres = ITypeInfoImpl_GetInternalFuncDesc(tinfo,i,&fdesc); - if (hres) - return n; - n++; - i++; + else + { + *num = attr->cbSizeVft / 4; } - /*NOTREACHED*/ + + end: + ITypeInfo_ReleaseTypeAttr(tinfo, attr); + return hres; } #ifdef __i386__ @@ -1215,6 +1215,37 @@ static HRESULT get_funcdesc(ITypeInfo *tinfo, int iMethod, ITypeInfo **tactual, ERR("GetTypeAttr failed with %x\n",hr); return hr; } + + if(attr->typekind == TKIND_DISPATCH) + { + if(attr->wTypeFlags & TYPEFLAG_FDUAL) + { + HREFTYPE href; + ITypeInfo *tinfo2; + + hr = ITypeInfo_GetRefTypeOfImplType(tinfo, -1, &href); + if(FAILED(hr)) + { + ERR("Cannot get interface href from dual dispinterface\n"); + ITypeInfo_ReleaseTypeAttr(tinfo, attr); + return hr; + } + hr = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2); + if(FAILED(hr)) + { + ERR("Cannot get interface from dual dispinterface\n"); + ITypeInfo_ReleaseTypeAttr(tinfo, attr); + return hr; + } + hr = get_funcdesc(tinfo2, iMethod, tactual, fdesc, iname, fname, num); + ITypeInfo_Release(tinfo2); + ITypeInfo_ReleaseTypeAttr(tinfo, attr); + return hr; + } + ERR("Shouldn't be called with a non-dual dispinterface\n"); + return E_FAIL; + } + impl_types = attr->cImplTypes; ITypeInfo_ReleaseTypeAttr(tinfo, attr); @@ -1699,9 +1730,10 @@ PSFacBuf_CreateProxy( { HRESULT hres; ITypeInfo *tinfo; - int i, nroffuncs; + unsigned int i, nroffuncs; TMProxyImpl *proxy; TYPEATTR *typeattr; + BOOL defer_to_dispatch = FALSE; TRACE("(...%s...)\n",debugstr_guid(riid)); hres = _get_typeinfo_for_iid(riid,&tinfo); @@ -1709,7 +1741,14 @@ PSFacBuf_CreateProxy( ERR("No typeinfo for %s?\n",debugstr_guid(riid)); return hres; } - nroffuncs = _nroffuncs(tinfo); + + hres = num_of_funcs(tinfo, &nroffuncs); + if (FAILED(hres)) { + ERR("Cannot get number of functions for typeinfo %s\n",debugstr_guid(riid)); + ITypeInfo_Release(tinfo); + return hres; + } + proxy = CoTaskMemAlloc(sizeof(TMProxyImpl)); if (!proxy) return E_OUTOFMEMORY; @@ -1735,22 +1774,6 @@ PSFacBuf_CreateProxy( proxy->crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TMProxyImpl.crit"); proxy->lpvtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPBYTE)*nroffuncs); - for (i=0;i<nroffuncs;i++) { - switch (i) { - case 0: - proxy->lpvtbl[i] = ProxyIUnknown_QueryInterface; - break; - case 1: - proxy->lpvtbl[i] = ProxyIUnknown_AddRef; - break; - case 2: - proxy->lpvtbl[i] = ProxyIUnknown_Release; - break; - default: - hres = init_proxy_entry_point(proxy, i); - if(FAILED(hres)) return hres; - } - } /* if we derive from IDispatch then defer to its proxy for its methods */ hres = ITypeInfo_GetTypeAttr(tinfo, &typeattr); @@ -1774,15 +1797,61 @@ PSFacBuf_CreateProxy( } if (hres == S_OK) { - proxy->lpvtbl[3] = ProxyIDispatch_GetTypeInfoCount; - proxy->lpvtbl[4] = ProxyIDispatch_GetTypeInfo; - proxy->lpvtbl[5] = ProxyIDispatch_GetIDsOfNames; - proxy->lpvtbl[6] = ProxyIDispatch_Invoke; + defer_to_dispatch = TRUE; } } ITypeInfo_ReleaseTypeAttr(tinfo, typeattr); } + for (i=0;i<nroffuncs;i++) { + switch (i) { + case 0: + proxy->lpvtbl[i] = ProxyIUnknown_QueryInterface; + break; + case 1: + proxy->lpvtbl[i] = ProxyIUnknown_AddRef; + break; + case 2: + proxy->lpvtbl[i] = ProxyIUnknown_Release; + break; + case 3: + if(!defer_to_dispatch) + { + hres = init_proxy_entry_point(proxy, i); + if(FAILED(hres)) return hres; + } + else proxy->lpvtbl[3] = ProxyIDispatch_GetTypeInfoCount; + break; + case 4: + if(!defer_to_dispatch) + { + hres = init_proxy_entry_point(proxy, i); + if(FAILED(hres)) return hres; + } + else proxy->lpvtbl[4] = ProxyIDispatch_GetTypeInfo; + break; + case 5: + if(!defer_to_dispatch) + { + hres = init_proxy_entry_point(proxy, i); + if(FAILED(hres)) return hres; + } + else proxy->lpvtbl[5] = ProxyIDispatch_GetIDsOfNames; + break; + case 6: + if(!defer_to_dispatch) + { + hres = init_proxy_entry_point(proxy, i); + if(FAILED(hres)) return hres; + } + else proxy->lpvtbl[6] = ProxyIDispatch_Invoke; + break; + default: + hres = init_proxy_entry_point(proxy, i); + if(FAILED(hres)) return hres; + } + } + if (hres == S_OK) { *ppv = (LPVOID)proxy;
1
0
0
0
Huw Davies : oleaut32: Move the proxy thunk creation code to a separate function.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: f1da672df393d1fb0909e7f1c9282e6032cada8b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f1da672df393d1fb0909e7f1c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 17 15:23:51 2007 +0100 oleaut32: Move the proxy thunk creation code to a separate function. --- dlls/oleaut32/tmarshal.c | 104 ++++++++++++++++++++++++--------------------- 1 files changed, 55 insertions(+), 49 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 94c6e58..f11d835 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -1640,6 +1640,58 @@ static inline HRESULT get_facbuf_for_iid(REFIID riid, IPSFactoryBuffer **facbuf) &IID_IPSFactoryBuffer, (LPVOID*)facbuf); } +static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num) +{ + int j; + /* nrofargs without This */ + int nrofargs; + ITypeInfo *tinfo2; + TMAsmProxy *xasm = proxy->asmstubs + num; + HRESULT hres; + const FUNCDESC *fdesc; + + hres = get_funcdesc(proxy->tinfo, num, &tinfo2, &fdesc, NULL, NULL, NULL); + if (hres) { + ERR("GetFuncDesc %x should not fail here.\n",hres); + return hres; + } + ITypeInfo_Release(tinfo2); + /* some args take more than 4 byte on the stack */ + nrofargs = 0; + for (j=0;j<fdesc->cParams;j++) + nrofargs += _argsize(fdesc->lprgelemdescParam[j].tdesc.vt); + +#ifdef __i386__ + if (fdesc->callconv != CC_STDCALL) { + ERR("calling convention is not stdcall????\n"); + return E_FAIL; + } +/* popl %eax - return ptr + * pushl <nr> + * pushl %eax + * call xCall + * lret <nr> (+4) + * + * + * arg3 arg2 arg1 <method> <returnptr> + */ + xasm->popleax = 0x58; + xasm->pushlval = 0x6a; + xasm->nr = num; + xasm->pushleax = 0x50; + xasm->lcall = 0xe8; /* relative jump */ + xasm->xcall = (DWORD)xCall; + xasm->xcall -= (DWORD)&(xasm->lret); + xasm->lret = 0xc2; + xasm->bytestopop = (nrofargs+2)*4; /* pop args, This, iMethod */ + proxy->lpvtbl[num] = xasm; +#else + FIXME("not implemented on non i386\n"); + return E_FAIL; +#endif + return S_OK; +} + static HRESULT WINAPI PSFacBuf_CreateProxy( LPPSFACTORYBUFFER iface, IUnknown* pUnkOuter, REFIID riid, @@ -1648,7 +1700,6 @@ PSFacBuf_CreateProxy( HRESULT hres; ITypeInfo *tinfo; int i, nroffuncs; - const FUNCDESC *fdesc; TMProxyImpl *proxy; TYPEATTR *typeattr; @@ -1685,8 +1736,6 @@ PSFacBuf_CreateProxy( proxy->lpvtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPBYTE)*nroffuncs); for (i=0;i<nroffuncs;i++) { - TMAsmProxy *xasm = proxy->asmstubs+i; - switch (i) { case 0: proxy->lpvtbl[i] = ProxyIUnknown_QueryInterface; @@ -1697,52 +1746,9 @@ PSFacBuf_CreateProxy( case 2: proxy->lpvtbl[i] = ProxyIUnknown_Release; break; - default: { - int j; - /* nrofargs without This */ - int nrofargs; - ITypeInfo *tinfo2; - hres = get_funcdesc(tinfo,i,&tinfo2,&fdesc,NULL,NULL,NULL); - if (hres) { - ERR("GetFuncDesc %x should not fail here.\n",hres); - return hres; - } - ITypeInfo_Release(tinfo2); - /* some args take more than 4 byte on the stack */ - nrofargs = 0; - for (j=0;j<fdesc->cParams;j++) - nrofargs += _argsize(fdesc->lprgelemdescParam[j].tdesc.vt); - -#ifdef __i386__ - if (fdesc->callconv != CC_STDCALL) { - ERR("calling convention is not stdcall????\n"); - return E_FAIL; - } -/* popl %eax - return ptr - * pushl <nr> - * pushl %eax - * call xCall - * lret <nr> (+4) - * - * - * arg3 arg2 arg1 <method> <returnptr> - */ - xasm->popleax = 0x58; - xasm->pushlval = 0x6a; - xasm->nr = i; - xasm->pushleax = 0x50; - xasm->lcall = 0xe8; /* relative jump */ - xasm->xcall = (DWORD)xCall; - xasm->xcall -= (DWORD)&(xasm->lret); - xasm->lret = 0xc2; - xasm->bytestopop= (nrofargs+2)*4; /* pop args, This, iMethod */ - proxy->lpvtbl[i] = xasm; - break; -#else - FIXME("not implemented on non i386\n"); - return E_FAIL; -#endif - } + default: + hres = init_proxy_entry_point(proxy, i); + if(FAILED(hres)) return hres; } }
1
0
0
0
Huw Davies : oleaut32: Test for interface that derives from IUnknown.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: 117f21de45f9a038d012c75079845646cc9d01af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=117f21de45f9a038d012c7507…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 17 15:14:35 2007 +0100 oleaut32: Test for interface that derives from IUnknown. --- dlls/oleaut32/tests/typelib.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index cb85f3c..a963834 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -790,6 +790,32 @@ if(use_midl_tlb) { } ITypeInfo_Release(pTI); + + /* ItestIF2 is an interface which derives from IUnknown */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &IID_ItestIF2, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_INTERFACE, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 24, "sizevft %d\n", pTA->cbSizeVft); + ok(pTA->wTypeFlags == 0, "typeflags %x\n", pTA->wTypeFlags); +if(use_midl_tlb) { + ok(pTA->cFuncs == 1, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + /* Should have one method */ + hr = ITypeInfo_GetFuncDesc(pTI, 1, &pFD); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); + hr = ITypeInfo_GetFuncDesc(pTI, 0, &pFD); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pFD->memid == 0x60020000, "memid %08x\n", pFD->memid); + ok(pFD->oVft == 20, "oVft %d\n", pFD->oVft); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); +} + ITypeInfo_Release(pTI); + ITypeLib_Release(pTL); return;
1
0
0
0
Huw Davies : oleaut32: Tests for more 'syntax 2' dispinterfaces.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: 04a76cf561fcd231d04cdd271e251a7a8741a444 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=04a76cf561fcd231d04cdd271…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 17 11:47:16 2007 +0100 oleaut32: Tests for more 'syntax 2' dispinterfaces. --- dlls/oleaut32/tests/tmarshal.idl | 39 +++++++++++++++++++++ dlls/oleaut32/tests/typelib.c | 70 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/tmarshal.idl b/dlls/oleaut32/tests/tmarshal.idl index 24cc83b..2d1a9bc 100644 --- a/dlls/oleaut32/tests/tmarshal.idl +++ b/dlls/oleaut32/tests/tmarshal.idl @@ -228,4 +228,43 @@ library TestTypelib { [id(0x1236)] HRESULT fn6([in] int a); } + + [ + odl, + uuid(bdfa260b-ef40-43d3-b071-cddec919f132) + ] + interface ItestIF8 + { + HRESULT fn1([in] int x); + HRESULT fn2([out,retval] int *x); + } + + [ + odl, + uuid(51033a23-dc37-4f19-aa34-4d8a670458a0) + + ] + interface ItestIF9 : ItestIF8 + { + HRESULT fn3([in] int y); + } + + [ + odl, + uuid(2e8f14fe-0bce-42f0-8b7d-3af8393c7967) + ] + dispinterface ItestIF10 + { + interface ItestIF9; + } + + [ + odl, + uuid(7d9e9371-482e-4944-9b19-511fc705236f) + ] + dispinterface ItestIF11 + { + interface ItestIF7; + } + }; diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 49c1261..cb85f3c 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -720,6 +720,76 @@ if(use_midl_tlb) { ITypeInfo_ReleaseFuncDesc(pTI, pFD); ITypeInfo_Release(pTI); + /* ItestIF10 is a syntax 2 dispinterface which doesn't derive from IUnknown */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &DIID_ItestIF10, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft); + ok(pTA->wTypeFlags == TYPEFLAG_FDISPATCHABLE, "typeflags %x\n", pTA->wTypeFlags); +if(use_midl_tlb) { + ok(pTA->cFuncs == 3, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + hr = ITypeInfo_GetRefTypeOfImplType(pTI, -1, &href); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); + ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); + ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); + ITypeInfo_Release(pTI_p); + + /* Should have three methods */ + hr = ITypeInfo_GetFuncDesc(pTI, 3, &pFD); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); + hr = ITypeInfo_GetFuncDesc(pTI, 2, &pFD); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pFD->memid == 0x60010000, "memid %08x\n", pFD->memid); + ok(pFD->oVft == 8, "oVft %d\n", pFD->oVft); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); +} + ITypeInfo_Release(pTI); + + /* ItestIF11 is a syntax 2 dispinterface which derives from IDispatch */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &DIID_ItestIF11, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft); + ok(pTA->wTypeFlags == TYPEFLAG_FDISPATCHABLE, "typeflags %x\n", pTA->wTypeFlags); +if(use_midl_tlb) { + ok(pTA->cFuncs == 10, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); + ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); + ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); + ITypeInfo_Release(pTI_p); + + /* Should have ten methods */ + hr = ITypeInfo_GetFuncDesc(pTI, 10, &pFD); + ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); + hr = ITypeInfo_GetFuncDesc(pTI, 9, &pFD); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pFD->memid == 0x1236, "memid %08x\n", pFD->memid); + ok(pFD->oVft == 36, "oVft %d\n", pFD->oVft); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); +} + ITypeInfo_Release(pTI); + ITypeLib_Release(pTL); return;
1
0
0
0
Huw Davies : oleaut32: GetRefTypeOfImplType(0) on TKIND_DISPATCH typeinfos should always return an href to IDispatch.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: 78bf6946ba84a954326688ec351ddf50d53d5427 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=78bf6946ba84a954326688ec3…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon May 14 14:19:50 2007 +0100 oleaut32: GetRefTypeOfImplType(0) on TKIND_DISPATCH typeinfos should always return an href to IDispatch. --- dlls/oleaut32/tests/typelib.c | 17 ++--------- dlls/oleaut32/typelib.c | 59 ++++++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index d67e315..49c1261 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -615,9 +615,7 @@ if(use_midl_tlb) { hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); ok(hr == S_OK, "hr %08x\n", hr); hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); -todo_wine { ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); - } ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); ITypeInfo_Release(pTI_p); @@ -625,15 +623,10 @@ todo_wine { hr = ITypeInfo_GetFuncDesc(pTI, 6, &pFD); ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); hr = ITypeInfo_GetFuncDesc(pTI, 5, &pFD); -todo_wine { ok(hr == S_OK, "hr %08x\n", hr); -} - if(SUCCEEDED(hr)) - { - ok(pFD->memid == 0x60020000, "memid %08x\n", pFD->memid); - ok(pFD->oVft == 20, "oVft %d\n", pFD->oVft); - ITypeInfo_ReleaseFuncDesc(pTI, pFD); - } + ok(pFD->memid == 0x60020000, "memid %08x\n", pFD->memid); + ok(pFD->oVft == 20, "oVft %d\n", pFD->oVft); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); } ITypeInfo_Release(pTI); @@ -688,9 +681,7 @@ if(use_midl_tlb) { hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); ok(hr == S_OK, "hr %08x\n", hr); hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); -todo_wine { ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); - } ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); ITypeInfo_Release(pTI_p); if(use_midl_tlb) { @@ -719,9 +710,7 @@ if(use_midl_tlb) { hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); ok(hr == S_OK, "hr %08x\n", hr); hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); -todo_wine { ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); -} ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); ITypeInfo_Release(pTI_p); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 857145e..a0d4ee4 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -898,6 +898,9 @@ typedef struct tagITypeLibImpl library. Only used while reading MSFT typelibs */ struct list ref_list; /* list of ref types in this typelib */ + HREFTYPE dispatch_href; /* reference to IDispatch, -1 if unused */ + + /* typelibs are cached, keyed by path and index, so store the linked list info within them */ struct tagITypeLibImpl *next, *prev; WCHAR *path; @@ -2083,7 +2086,6 @@ static void MSFT_DoImplTypes(TLBContext *pcx, ITypeInfoImpl *pTI, int count, static ITypeInfoImpl * MSFT_DoTypeInfo( TLBContext *pcx, int count, - INT dispatch_href, ITypeLibImpl * pLibInfo) { MSFT_TypeInfoBase tiBase; @@ -2153,19 +2155,19 @@ static ITypeInfoImpl * MSFT_DoTypeInfo( tiBase.datatype1); break; case TKIND_DISPATCH: - ptiRet->impltypelist=TLB_Alloc(sizeof(TLBImplType)); + /* This is not -1 when the interface is a non-base dual interface or + when a dispinterface wraps an interface ie the idl 'dispinterface x {interface y;};'. + Note however that GetRefTypeOfImplType(0) always returns a ref to IDispatch and + not this interface. + */ if (tiBase.datatype1 != -1) { - MSFT_DoRefType(pcx, pLibInfo, tiBase.datatype1); - ptiRet->impltypelist->hRef = tiBase.datatype1; + ptiRet->impltypelist = TLB_Alloc(sizeof(TLBImplType)); + ptiRet->impltypelist->hRef = tiBase.datatype1; + MSFT_DoRefType(pcx, pLibInfo, tiBase.datatype1); } - else - { - MSFT_DoRefType(pcx, pLibInfo, dispatch_href); - ptiRet->impltypelist->hRef = dispatch_href; - } - break; + break; default: ptiRet->impltypelist=TLB_Alloc(sizeof(TLBImplType)); MSFT_DoRefType(pcx, pLibInfo, tiBase.datatype1); @@ -2363,6 +2365,7 @@ static ITypeLibImpl* TypeLibImpl_Constructor(void) pTypeLibImpl->ref = 1; list_init(&pTypeLibImpl->ref_list); + pTypeLibImpl->dispatch_href = -1; return pTypeLibImpl; } @@ -2558,6 +2561,10 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) } } + pTypeLibImpl->dispatch_href = tlbHeader.dispatchpos; + if(pTypeLibImpl->dispatch_href != -1) + MSFT_DoRefType(&cx, pTypeLibImpl, pTypeLibImpl->dispatch_href); + /* type info's */ if(tlbHeader.nrtypeinfos >= 0 ) { @@ -2567,7 +2574,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) for(i = 0; i<(int)tlbHeader.nrtypeinfos; i++) { - *ppTI = MSFT_DoTypeInfo(&cx, i, tlbHeader.dispatchpos, pTypeLibImpl); + *ppTI = MSFT_DoTypeInfo(&cx, i, pTypeLibImpl); ppTI = &((*ppTI)->next); (pTypeLibImpl->TypeInfoCount)++; @@ -2836,6 +2843,11 @@ static void SLTG_DoRefs(SLTG_RefInfo *pRef, ITypeLibImpl *pTL, (*import)->name = TLB_MultiByteToBSTR(fname); } ref_type->pImpTLInfo = *import; + + /* Store a reference to IDispatch */ + if(pTL->dispatch_href == -1 && IsEqualGUID(&(*import)->guid, &IID_StdOle) && type_num == 4) + pTL->dispatch_href = ref; + } else { /* internal ref */ ref_type->pImpTLInfo = TLB_REF_INTERNAL; } @@ -4702,22 +4714,17 @@ static HRESULT ITypeInfoImpl_GetInternalDispatchFuncDesc( ITypeInfo *iface, { ITypeInfoImpl *This = (ITypeInfoImpl *)iface; HRESULT hr; - UINT i; UINT implemented_funcs = 0; if (funcs) *funcs = 0; - for (i = 0; i < This->TypeAttr.cImplTypes; i++) + if(This->impltypelist) { - HREFTYPE href; ITypeInfo *pSubTypeInfo; UINT sub_funcs; - hr = ITypeInfo_GetRefTypeOfImplType(iface, i, &href); - if (FAILED(hr)) - return hr; - hr = ITypeInfo_GetRefTypeInfo(iface, href, &pSubTypeInfo); + hr = ITypeInfo_GetRefTypeInfo(iface, This->impltypelist->hRef, &pSubTypeInfo); if (FAILED(hr)) return hr; @@ -4755,8 +4762,7 @@ static HRESULT WINAPI ITypeInfo_fnGetFuncDesc( ITypeInfo2 *iface, UINT index, TRACE("(%p) index %d\n", This, index); - if ((This->TypeAttr.typekind == TKIND_DISPATCH) && - (This->TypeAttr.wTypeFlags & TYPEFLAG_FDUAL)) + if (This->TypeAttr.typekind == TKIND_DISPATCH) hr = ITypeInfoImpl_GetInternalDispatchFuncDesc((ITypeInfo *)iface, index, &internal_funcdesc, NULL); else @@ -4887,7 +4893,7 @@ static HRESULT WINAPI ITypeInfo_fnGetNames( ITypeInfo2 *iface, MEMBERID memid, } else { - if(This->TypeAttr.cImplTypes && + if(This->impltypelist && (This->TypeAttr.typekind==TKIND_INTERFACE || This->TypeAttr.typekind==TKIND_DISPATCH)) { /* recursive search */ ITypeInfo *pTInfo; @@ -4952,6 +4958,11 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType( hr = TYPE_E_ELEMENTNOTFOUND; } } + else if(index == 0 && This->TypeAttr.typekind == TKIND_DISPATCH) + { + /* All TKIND_DISPATCHs are made to look like they inherit from IDispatch */ + *pRefType = This->pTypeLib->dispatch_href; + } else { /* get element n from linked list */ @@ -5045,7 +5056,7 @@ static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface, } } /* not found, see if it can be found in an inherited interface */ - if(This->TypeAttr.cImplTypes) { + if(This->impltypelist) { /* recursive search */ ITypeInfo *pTInfo; ret=ITypeInfo_GetRefTypeInfo(iface, @@ -5883,7 +5894,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDocumentation( ITypeInfo2 *iface, } } - if(This->TypeAttr.cImplTypes && + if(This->impltypelist && (This->TypeAttr.typekind==TKIND_INTERFACE || This->TypeAttr.typekind==TKIND_DISPATCH)) { /* recursive search */ ITypeInfo *pTInfo; @@ -6998,7 +7009,7 @@ static HRESULT WINAPI ITypeComp_fnBind( } } /* FIXME: search each inherited interface, not just the first */ - if (hr == DISP_E_MEMBERNOTFOUND && This->TypeAttr.cImplTypes) { + if (hr == DISP_E_MEMBERNOTFOUND && This->impltypelist) { /* recursive search */ ITypeInfo *pTInfo; ITypeComp *pTComp;
1
0
0
0
Huw Davies : oleaut32: Fix return value in the element not found case.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: 356970e529d274f0f07acddd62dbf39ff82b18a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=356970e529d274f0f07acddd6…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri May 11 15:28:40 2007 +0100 oleaut32: Fix return value in the element not found case. --- dlls/oleaut32/tests/typelib.c | 4 ---- dlls/oleaut32/typelib.c | 2 +- 2 files changed, 1 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index fced34b..d67e315 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -623,9 +623,7 @@ todo_wine { /* Should have six methods */ hr = ITypeInfo_GetFuncDesc(pTI, 6, &pFD); -todo_wine{ ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); -} hr = ITypeInfo_GetFuncDesc(pTI, 5, &pFD); todo_wine { ok(hr == S_OK, "hr %08x\n", hr); @@ -662,9 +660,7 @@ todo_wine { ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); ITypeInfo_Release(pTI_p); hr = ITypeInfo_GetFuncDesc(pTI, 1, &pFD); -todo_wine { ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); - } hr = ITypeInfo_GetFuncDesc(pTI, 0, &pFD); ok(hr == S_OK, "hr %08x\n", hr); ok(pFD->memid == 0x1c, "memid %08x\n", pFD->memid); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 6c663ac..857145e 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -4692,7 +4692,7 @@ HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const F return S_OK; } - return E_INVALIDARG; + return TYPE_E_ELEMENTNOTFOUND; } /* internal function to make the inherited interfaces' methods appear
1
0
0
0
Huw Davies : oleaut32: Typelib inheritance tests.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: a3b8be05b77d7c42ab6c8b6290163834fcd6e30f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a3b8be05b77d7c42ab6c8b629…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri May 11 15:23:31 2007 +0100 oleaut32: Typelib inheritance tests. --- dlls/oleaut32/tests/tmarshal.idl | 70 ++++++++++++++++ dlls/oleaut32/tests/typelib.c | 168 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/tmarshal.idl b/dlls/oleaut32/tests/tmarshal.idl index e99dbc7..24cc83b 100644 --- a/dlls/oleaut32/tests/tmarshal.idl +++ b/dlls/oleaut32/tests/tmarshal.idl @@ -158,4 +158,74 @@ library TestTypelib interface IWidget; [source] interface IWidget; }; + + [ + odl, + uuid(375f8a9d-33d0-44f3-b972-61f8407899e0) + ] + interface ItestIF1 : IUnknown + { + HRESULT fn1([in] int x); + HRESULT fn2([out,retval] int *x); + } + + [ + odl, + uuid(094056a3-666f-4956-be12-1859668310b8) + ] + interface ItestIF2 : ItestIF1 + { + HRESULT fn3([in] int y); + } + + [ + odl, + uuid(33baba09-2e68-43ab-81fe-d84b403df2e5) + ] + dispinterface ItestIF3 + { + interface ItestIF2; + } + + [ + odl, + uuid(a01005c7-7491-42eb-94f3-668e37ce60a6) + ] + dispinterface ItestIF4 + { + properties: + methods: + [id(0x1c)] HRESULT fn([in] int z); + } + + [ + odl, + uuid(4ab61e25-c09f-4239-8f7f-7a018ea0199f), + dual + ] + interface ItestIF5 : ItestIF2 + { + [id(0x1234)] HRESULT fn4([in] int a); + [id(0x1235)] HRESULT fn5([in] int a); + } + + [ + odl, + uuid(ec236d8e-2cc7-44f2-b394-36c86ff3da74) + ] + interface ItestIF6 : IDispatch + { + [id(0x1234)] HRESULT fn4([in] int a); + [id(0x1235)] HRESULT fn5([in] int a); + } + + [ + odl, + uuid(f711b105-554d-4751-818c-46fcc5d7c0d5), + dual + ] + interface ItestIF7 : ItestIF6 + { + [id(0x1236)] HRESULT fn6([in] int a); + } }; diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 6b1b579..fced34b 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -29,6 +29,7 @@ #include "oleauto.h" #include "ocidl.h" #include "shlwapi.h" +#include "tmarshal.h" #define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr) @@ -573,6 +574,172 @@ static void test_QueryPathOfRegTypeLib(void) do_typelib_reg_key(&uid, 0, 0, NULL, 1); } +static void test_inheritance(void) +{ + HRESULT hr; + ITypeLib *pTL; + ITypeInfo *pTI, *pTI_p; + TYPEATTR *pTA; + HREFTYPE href; + FUNCDESC *pFD; + WCHAR path[MAX_PATH]; + static const WCHAR tl_path[] = {'.','\\','m','i','d','l','_','t','m','a','r','s','h','a','l','.','t','l','b',0}; + + BOOL use_midl_tlb = 0; + + GetModuleFileNameW(NULL, path, MAX_PATH); + + if(use_midl_tlb) + memcpy(path, tl_path, sizeof(tl_path)); + + hr = LoadTypeLib(path, &pTL); + if(FAILED(hr)) return; + + + /* ItestIF3 is a syntax 2 dispinterface */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &DIID_ItestIF3, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft); + ok(pTA->wTypeFlags == TYPEFLAG_FDISPATCHABLE, "typeflags %x\n", pTA->wTypeFlags); +if(use_midl_tlb) { + ok(pTA->cFuncs == 6, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); +todo_wine { + ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); + } + ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); + ITypeInfo_Release(pTI_p); + + /* Should have six methods */ + hr = ITypeInfo_GetFuncDesc(pTI, 6, &pFD); +todo_wine{ + ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); +} + hr = ITypeInfo_GetFuncDesc(pTI, 5, &pFD); +todo_wine { + ok(hr == S_OK, "hr %08x\n", hr); +} + if(SUCCEEDED(hr)) + { + ok(pFD->memid == 0x60020000, "memid %08x\n", pFD->memid); + ok(pFD->oVft == 20, "oVft %d\n", pFD->oVft); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); + } +} + ITypeInfo_Release(pTI); + + + /* ItestIF4 is a syntax 1 dispinterface */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &DIID_ItestIF4, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft); + ok(pTA->wTypeFlags == TYPEFLAG_FDISPATCHABLE, "typeflags %x\n", pTA->wTypeFlags); + ok(pTA->cFuncs == 1, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); + ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); + ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); + ITypeInfo_Release(pTI_p); + hr = ITypeInfo_GetFuncDesc(pTI, 1, &pFD); +todo_wine { + ok(hr == TYPE_E_ELEMENTNOTFOUND, "hr %08x\n", hr); + } + hr = ITypeInfo_GetFuncDesc(pTI, 0, &pFD); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pFD->memid == 0x1c, "memid %08x\n", pFD->memid); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); + ITypeInfo_Release(pTI); + + + /* ItestIF5 is dual with inherited ifaces which derive from IUnknown but not IDispatch */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &IID_ItestIF5, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft); +if(use_midl_tlb) { + ok(pTA->wTypeFlags == TYPEFLAG_FDUAL, "typeflags %x\n", pTA->wTypeFlags); + } + ok(pTA->cFuncs == 8, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); +todo_wine { + ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); + } + ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); + ITypeInfo_Release(pTI_p); +if(use_midl_tlb) { + hr = ITypeInfo_GetFuncDesc(pTI, 6, &pFD); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pFD->memid == 0x1234, "memid %08x\n", pFD->memid); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); +} + ITypeInfo_Release(pTI); + + /* ItestIF7 is dual with inherited ifaces which derive from Dispatch */ + hr = ITypeLib_GetTypeInfoOfGuid(pTL, &IID_ItestIF7, &pTI); + ok(hr == S_OK, "hr %08x\n", hr); + + hr = ITypeInfo_GetTypeAttr(pTI, &pTA); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); + ok(pTA->cbSizeVft == 28, "sizevft %d\n", pTA->cbSizeVft); + ok(pTA->wTypeFlags == (TYPEFLAG_FDISPATCHABLE|TYPEFLAG_FDUAL), "typeflags %x\n", pTA->wTypeFlags); + ok(pTA->cFuncs == 10, "cfuncs %d\n", pTA->cFuncs); + ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); + ITypeInfo_ReleaseTypeAttr(pTI, pTA); + + hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); + ok(hr == S_OK, "hr %08x\n", hr); + hr = ITypeInfo_GetTypeAttr(pTI_p, &pTA); +todo_wine { + ok(IsEqualGUID(&pTA->guid, &IID_IDispatch), "guid {%08x-....\n", pTA->guid.Data1); +} + ITypeInfo_ReleaseTypeAttr(pTI_p, pTA); + ITypeInfo_Release(pTI_p); + + hr = ITypeInfo_GetFuncDesc(pTI, 9, &pFD); + ok(hr == S_OK, "hr %08x\n", hr); + ok(pFD->memid == 0x1236, "memid %08x\n", pFD->memid); + ITypeInfo_ReleaseFuncDesc(pTI, pFD); + ITypeInfo_Release(pTI); + + ITypeLib_Release(pTL); + + return; +} + START_TEST(typelib) { ref_count_test(wszStdOle2); @@ -580,4 +747,5 @@ START_TEST(typelib) test_CreateDispTypeInfo(); test_TypeInfo(); test_QueryPathOfRegTypeLib(); + test_inheritance(); }
1
0
0
0
Alexandre Julliard : ntdll: Setup the shared user data structure at 0x7ffe0000.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: 5aa70b3d8045dd2922543befd7d0f1c3cf269b09 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5aa70b3d8045dd2922543befd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri May 18 18:09:03 2007 +0200 ntdll: Setup the shared user data structure at 0x7ffe0000. --- dlls/ntdll/loader.c | 2 ++ dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/thread.c | 16 +++++++++++++++- dlls/ntdll/version.c | 8 ++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 8d72936..0f50653 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -40,6 +40,7 @@ #include "wine/debug.h" #include "wine/server.h" #include "ntdll_misc.h" +#include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(module); WINE_DECLARE_DEBUG_CHANNEL(relay); @@ -2307,6 +2308,7 @@ void __wine_init_windows_dir( const WCHAR *windir, const WCHAR *sysdir ) LPWSTR buffer, p; RtlCreateUnicodeString( &system_dir, sysdir ); + strcpyW( user_shared_data->NtSystemRoot, windir ); /* prepend the system dir to the name of the already created modules */ mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 741aec4..c6ef77c 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -25,7 +25,6 @@ #include "windef.h" #include "winnt.h" #include "winternl.h" -#include "winioctl.h" #include "wine/server.h" #define MAX_NT_PATH_LENGTH 277 @@ -117,6 +116,7 @@ extern NTSTATUS DIR_get_unix_cwd( char **cwd ); extern NTSTATUS VIRTUAL_HandleFault(LPCVOID addr); extern void VIRTUAL_SetForceExec( BOOL enable ); extern void VIRTUAL_UseLargeAddressSpace(void); +extern struct _KUSER_SHARED_DATA *user_shared_data; /* code pages */ extern int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int dstlen); diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index fa30e53..30e441d 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -40,11 +40,14 @@ #include "wine/pthread.h" #include "wine/debug.h" #include "ntdll_misc.h" +#include "ddk/wdm.h" #include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(thread); WINE_DECLARE_DEBUG_CHANNEL(relay); +struct _KUSER_SHARED_DATA *user_shared_data = NULL; + /* info passed to a starting thread */ struct startup_info { @@ -225,6 +228,7 @@ HANDLE thread_init(void) void *addr; SIZE_T size, info_size; HANDLE exe_file = 0; + LARGE_INTEGER now; struct ntdll_thread_data *thread_data; struct ntdll_thread_regs *thread_regs; struct wine_pthread_thread_info thread_info; @@ -236,7 +240,8 @@ HANDLE thread_init(void) addr = (void *)0x7ffe0000; size = 0x10000; - NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, MEM_RESERVE, PAGE_READONLY ); + NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE ); + user_shared_data = addr; /* allocate and initialize the PEB */ @@ -325,6 +330,15 @@ HANDLE thread_init(void) /* initialize LDT locking */ wine_ldt_init_locking( ldt_lock, ldt_unlock ); + /* initialize time values in user_shared_data */ + NtQuerySystemTime( &now ); + user_shared_data->SystemTime.LowPart = now.LowPart; + user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = now.HighPart; + user_shared_data->u.TickCountQuad = (now.QuadPart - server_start_time) / 10000; + user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time; + user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart; + user_shared_data->TickCountMultiplier = 1 << 24; + return exe_file; } diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index f29b495..0f18833 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -34,6 +34,7 @@ #include "wine/unicode.h" #include "wine/debug.h" #include "ntdll_misc.h" +#include "ddk/wdm.h" WINE_DEFAULT_DEBUG_CHANNEL(ver); @@ -505,6 +506,13 @@ done: NtCurrentTeb()->Peb->OSBuildNumber = current_version->dwBuildNumber; NtCurrentTeb()->Peb->OSPlatformId = current_version->dwPlatformId; + user_shared_data->NtProductType = current_version->wProductType; + user_shared_data->ProductTypeIsValid = TRUE; + user_shared_data->MajorNtVersion = current_version->dwMajorVersion; + user_shared_data->MinorNtVersion = current_version->dwMinorVersion; + user_shared_data->MinorNtVersion = current_version->dwMinorVersion; + user_shared_data->SuiteMask = current_version->wSuiteMask; + TRACE( "got %d.%d plaform %d build %x name %s service pack %d.%d product %d\n", current_version->dwMajorVersion, current_version->dwMinorVersion, current_version->dwPlatformId, current_version->dwBuildNumber,
1
0
0
0
Alexandre Julliard : ntoskrnl.exe: Implemented a couple of time-related APIs.
by Alexandre Julliard
18 May '07
18 May '07
Module: wine Branch: master Commit: bd3a08b355f53b160b076bce9fab5b16056a01cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd3a08b355f53b160b076bce9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri May 18 16:48:54 2007 +0200 ntoskrnl.exe: Implemented a couple of time-related APIs. --- dlls/ntoskrnl.exe/ntoskrnl.c | 37 +++++++++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 6 ++-- include/ddk/wdm.h | 3 ++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index b0007fc..3bbb205 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -130,6 +130,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, IO_STACK_LOCATION irpsp; PDRIVER_DISPATCH dispatch = device->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]; NTSTATUS status; + LARGE_INTEGER count; TRACE( "ioctl %x device %p in_size %u out_size %u\n", code, device, in_size, *out_size ); @@ -159,6 +160,8 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, device->CurrentIrp = &irp; + KeQueryTickCount( &count ); /* update the global KeTickCount */ + if (TRACE_ON(relay)) DPRINTF( "%04x:Call driver dispatch %p (device=%p,irp=%p)\n", GetCurrentThreadId(), dispatch, device, &irp ); @@ -416,6 +419,37 @@ void WINAPI ExFreePoolWithTag( void *ptr, ULONG tag ) /*********************************************************************** + * KeQuerySystemTime (NTOSKRNL.EXE.@) + */ +void WINAPI KeQuerySystemTime( LARGE_INTEGER *time ) +{ + NtQuerySystemTime( time ); +} + + +/*********************************************************************** + * KeQueryTickCount (NTOSKRNL.EXE.@) + */ +void WINAPI KeQueryTickCount( LARGE_INTEGER *count ) +{ + count->QuadPart = NtGetTickCount(); + /* update the global variable too */ + KeTickCount.LowPart = count->u.LowPart; + KeTickCount.High1Time = count->u.HighPart; + KeTickCount.High2Time = count->u.HighPart; +} + + +/*********************************************************************** + * KeQueryTimeIncrement (NTOSKRNL.EXE.@) + */ +ULONG WINAPI KeQueryTimeIncrement(void) +{ + return 10000; +} + + +/*********************************************************************** * MmAllocateNonCachedMemory (NTOSKRNL.EXE.@) */ LPVOID WINAPI MmAllocateNonCachedMemory( SIZE_T size ) @@ -493,11 +527,14 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine( PCREATE_PROCESS_NOTIFY_ROUTINE */ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { + LARGE_INTEGER count; + switch(reason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( inst ); RtlAddVectoredExceptionHandler( TRUE, vectored_handler ); + KeQueryTickCount( &count ); /* initialize the global KeTickCount */ break; } return TRUE; diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 2a89b33..f199602 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -573,9 +573,9 @@ @ stub KeQueryInterruptTime @ stub KeQueryPriorityThread @ stub KeQueryRuntimeThread -@ stub KeQuerySystemTime -@ stub KeQueryTickCount -@ stub KeQueryTimeIncrement +@ stdcall KeQuerySystemTime(ptr) +@ stdcall KeQueryTickCount(ptr) +@ stdcall KeQueryTimeIncrement() @ stub KeRaiseUserException @ stub KeReadStateEvent @ stub KeReadStateMutant diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index f9db943..38b3625 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -874,6 +874,9 @@ NTSTATUS WINAPI IoDeleteSymbolicLink(UNICODE_STRING*); PEPROCESS WINAPI IoGetCurrentProcess(void); PKTHREAD WINAPI KeGetCurrentThread(void); +void WINAPI KeQuerySystemTime(LARGE_INTEGER*); +void WINAPI KeQueryTickCount(LARGE_INTEGER*); +ULONG WINAPI KeQueryTimeIncrement(void); LPVOID WINAPI MmAllocateNonCachedMemory(SIZE_T); void WINAPI MmFreeNonCachedMemory(PVOID,SIZE_T);
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200