Commit 8c968f77 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

widl: Don't remove the FDUAL flag from non-dispatchable interfaces.

parent 413821f8
...@@ -208,9 +208,7 @@ library TestTypelib ...@@ -208,9 +208,7 @@ library TestTypelib
[ [
odl, odl,
uuid(a028db05-30f0-4b93-b17a-41c72f831d84), uuid(a028db05-30f0-4b93-b17a-41c72f831d84),
#if 0 /* FIXME: commented out as causes widl to generate incorrect typelib */
dual, dual,
#endif
oleautomation oleautomation
] ]
interface IKindaEnumWidget : IUnknown interface IKindaEnumWidget : IUnknown
......
...@@ -1507,16 +1507,10 @@ static void test_inheritance(void) ...@@ -1507,16 +1507,10 @@ static void test_inheritance(void)
FUNCDESC *pFD; FUNCDESC *pFD;
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
CHAR pathA[MAX_PATH]; CHAR pathA[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 = FALSE;
GetModuleFileNameA(NULL, pathA, MAX_PATH); GetModuleFileNameA(NULL, pathA, MAX_PATH);
MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, pathA, -1, path, MAX_PATH);
if(use_midl_tlb)
memcpy(path, tl_path, sizeof(tl_path));
hr = LoadTypeLib(path, &pTL); hr = LoadTypeLib(path, &pTL);
if(FAILED(hr)) return; if(FAILED(hr)) return;
...@@ -1592,17 +1586,13 @@ static void test_inheritance(void) ...@@ -1592,17 +1586,13 @@ static void test_inheritance(void)
hr = ITypeInfo_GetTypeAttr(pTI, &pTA); hr = ITypeInfo_GetTypeAttr(pTI, &pTA);
ok(hr == S_OK, "hr %08x\n", hr); ok(hr == S_OK, "hr %08x\n", hr);
if (hr == S_OK)
{
ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind); ok(pTA->typekind == TKIND_DISPATCH, "kind %04x\n", pTA->typekind);
ok(pTA->cbSizeVft == 7 * sizeof(void *), "sizevft %d\n", pTA->cbSizeVft); ok(pTA->cbSizeVft == 7 * sizeof(void *), "sizevft %d\n", pTA->cbSizeVft);
if(use_midl_tlb) {
ok(pTA->wTypeFlags == TYPEFLAG_FDUAL, "typeflags %x\n", pTA->wTypeFlags); ok(pTA->wTypeFlags == TYPEFLAG_FDUAL, "typeflags %x\n", pTA->wTypeFlags);
}
ok(pTA->cFuncs == 8, "cfuncs %d\n", pTA->cFuncs); ok(pTA->cFuncs == 8, "cfuncs %d\n", pTA->cFuncs);
ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes); ok(pTA->cImplTypes == 1, "cimpltypes %d\n", pTA->cImplTypes);
ITypeInfo_ReleaseTypeAttr(pTI, pTA); ITypeInfo_ReleaseTypeAttr(pTI, pTA);
}
hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href); hr = ITypeInfo_GetRefTypeOfImplType(pTI, 0, &href);
ok(hr == S_OK, "hr %08x\n", hr); ok(hr == S_OK, "hr %08x\n", hr);
hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p); hr = ITypeInfo_GetRefTypeInfo(pTI, href, &pTI_p);
...@@ -4903,8 +4893,8 @@ static void test_register_typelib(BOOL system_registration) ...@@ -4903,8 +4893,8 @@ static void test_register_typelib(BOOL system_registration)
{ TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE }, { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE },
{ TKIND_INTERFACE, TYPEFLAG_FOLEAUTOMATION }, { TKIND_INTERFACE, TYPEFLAG_FOLEAUTOMATION },
{ TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FOLEAUTOMATION }, { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FOLEAUTOMATION },
{ TKIND_DISPATCH, 0 /* TYPEFLAG_FDUAL - widl clears this flag for non-IDispatch derived interfaces */ }, { TKIND_DISPATCH, TYPEFLAG_FDUAL },
{ TKIND_DISPATCH, 0 /* TYPEFLAG_FDUAL - widl clears this flag for non-IDispatch derived interfaces */ }, { TKIND_DISPATCH, TYPEFLAG_FDUAL },
{ TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FDUAL }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FDUAL },
{ TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FDUAL }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FDUAL },
{ TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE },
...@@ -4979,7 +4969,8 @@ static void test_register_typelib(BOOL system_registration) ...@@ -4979,7 +4969,8 @@ static void test_register_typelib(BOOL system_registration)
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
ok(dual_attr->typekind == TKIND_INTERFACE, "%d: got kind %d\n", i, dual_attr->typekind); ok(dual_attr->typekind == TKIND_INTERFACE, "%d: got kind %d\n", i, dual_attr->typekind);
ok(dual_attr->wTypeFlags == (TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FOLEAUTOMATION | TYPEFLAG_FDUAL), "%d: got flags %04x\n", i, dual_attr->wTypeFlags); ok(dual_attr->wTypeFlags == (attrs[i].flags | TYPEFLAG_FOLEAUTOMATION),
"%d: got flags %04x\n", i, dual_attr->wTypeFlags);
ITypeInfo_ReleaseTypeAttr(dual_info, dual_attr); ITypeInfo_ReleaseTypeAttr(dual_info, dual_attr);
ITypeInfo_Release(dual_info); ITypeInfo_Release(dual_info);
......
...@@ -2166,10 +2166,6 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) ...@@ -2166,10 +2166,6 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
if (derived->name && !strcmp(derived->name, "IDispatch")) if (derived->name && !strcmp(derived->name, "IDispatch"))
msft_typeinfo->typeinfo->flags |= 0x1000; /* TYPEFLAG_FDISPATCHABLE */ msft_typeinfo->typeinfo->flags |= 0x1000; /* TYPEFLAG_FDISPATCHABLE */
/* can't be dual if it doesn't derive from IDispatch */
if (!(msft_typeinfo->typeinfo->flags & 0x1000)) /* TYPEFLAG_FDISPATCHABLE */
msft_typeinfo->typeinfo->flags &= ~0x40; /* TYPEFLAG_FDUAL */
if(type_iface_get_inherit(interface)) if(type_iface_get_inherit(interface))
add_impl_type(msft_typeinfo, type_iface_get_inherit(interface), add_impl_type(msft_typeinfo, type_iface_get_inherit(interface),
ref_importinfo); ref_importinfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment