From: Porot Mo <porotmjp(a)gmail.com>
Signed-off-by: Porot Mo <porotmjp(a)gmail.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/oleaut32/tests/test_reg.idl | 13 ++++++++
dlls/oleaut32/tests/typelib.c | 55 ++++++++++++++++++++++++++++++--
2 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/dlls/oleaut32/tests/test_reg.idl b/dlls/oleaut32/tests/test_reg.idl
index c9be76b0273..d41f4bec52b 100644
--- a/dlls/oleaut32/tests/test_reg.idl
+++ b/dlls/oleaut32/tests/test_reg.idl
@@ -163,4 +163,17 @@ library register_test
UINT32 field;
HRESULT hr;
};
+
+ [
+ uuid(f073cd92-a199-11ea-bb37-0242ac130002),
+ dllname("test.dll")
+ ]
+ module TestGetDllEntry
+ {
+ [propget, entry(1)]
+ int test1([out] int *i);
+
+ [propput, entry(2)]
+ int test1([in] int i);
+ };
}
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 5e5b44a0345..c095d8ea0fb 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -831,18 +831,22 @@ static void test_TypeInfo(void)
static WCHAR wszBogus[] = { 'b','o','g','u','s',0 };
static WCHAR wszGetTypeInfo[] = { 'G','e','t','T','y','p','e','I','n','f','o',0 };
static WCHAR wszClone[] = {'C','l','o','n','e',0};
+ static WCHAR wszTestDll[] = {'t','e','s','t','.','d','l','l',0};
OLECHAR* bogus = wszBogus;
OLECHAR* pwszGetTypeInfo = wszGetTypeInfo;
OLECHAR* pwszClone = wszClone;
DISPID dispidMember;
DISPPARAMS dispparams;
GUID bogusguid = {0x806afb4f,0x13f7,0x42d2,{0x89,0x2c,0x6c,0x97,0xc3,0x6a,0x36,0xc1}};
+ static const GUID moduleTestGetDllEntryGuid = {0xf073cd92,0xa199,0x11ea,{0xbb,0x37,0x02,0x42,0xac,0x13,0x00,0x02}};
VARIANT var, res, args[2];
UINT count, i;
TYPEKIND kind;
const WCHAR *filename;
TYPEATTR *attr;
LONG l;
+ WORD ordinal;
+ BSTR bstrDllName, bstrName;
hr = LoadTypeLib(wszStdOle2, &pTypeLib);
ok_ole_success(hr, LoadTypeLib);
@@ -1025,6 +1029,52 @@ static void test_TypeInfo(void)
hr = LoadTypeLib(filename, &pTypeLib);
ok(hr == S_OK, "got 0x%08x\n", hr);
+ /* test GetDllEntry */
+ hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &moduleTestGetDllEntryGuid, &pTypeInfo);
+ ok_ole_success(hr, ITypeLib_GetTypeInfoOfGuid);
+ ok(pTypeInfo != NULL, "got NULL typeinfo\n");
+
+ /* wrong memberid -- wrong invkind */
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x6000000d, INVOKE_FUNC, &bstrDllName, &bstrName, &ordinal);
+ ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
+
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x6000000d, INVOKE_PROPERTYPUTREF, &bstrDllName, &bstrName, &ordinal);
+ ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
+
+ /* wrong memberid -- correct invkind */
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x6000000d, INVOKE_PROPERTYGET, &bstrDllName, &bstrName, &ordinal);
+ ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
+
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x6000000d, INVOKE_PROPERTYPUT, &bstrDllName, &bstrName, &ordinal);
+ ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
+
+ /* correct memberid -- wrong invkind */
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x60000000, INVOKE_FUNC, &bstrDllName, &bstrName, &ordinal);
+todo_wine
+ ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
+
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x60000000, INVOKE_PROPERTYPUTREF, &bstrDllName, &bstrName, &ordinal);
+todo_wine
+ ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
+
+ /* correct memberid -- correct invkind */
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x60000000, INVOKE_PROPERTYGET, &bstrDllName, &bstrName, &ordinal);
+ ok_ole_success(hr, ITypeInfo_GetDllEntry);
+ ok(!lstrcmpW(bstrDllName, wszTestDll), "got %s\n", wine_dbgstr_w(bstrDllName));
+ ok(bstrName == NULL, "got %s\n", wine_dbgstr_w(bstrName));
+ ok(ordinal == 1, "got ordinal: %04x\n", ordinal);
+ SysFreeString(bstrDllName);
+
+ hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x60000000, INVOKE_PROPERTYPUT, &bstrDllName, &bstrName, &ordinal);
+ ok_ole_success(hr, ITypeInfo_GetDllEntry);
+ ok(!lstrcmpW(bstrDllName, wszTestDll), "got %s\n", wine_dbgstr_w(bstrDllName));
+ ok(bstrName == NULL, "got %s\n", wine_dbgstr_w(bstrName));
+todo_wine
+ ok(ordinal == 2, "got ordinal: %04x\n", ordinal);
+ SysFreeString(bstrDllName);
+
+ ITypeInfo_Release(pTypeInfo);
+
hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &IID_IInvokeTest, &pTypeInfo);
ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -5092,7 +5142,8 @@ static void test_register_typelib(BOOL system_registration)
{ TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE },
{ TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE },
{ TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE },
- { TKIND_RECORD, 0 }
+ { TKIND_RECORD, 0 },
+ { TKIND_MODULE, 0 },
};
trace("Starting %s typelib registration tests\n",
@@ -5126,7 +5177,7 @@ static void test_register_typelib(BOOL system_registration)
ok(hr == S_OK, "got %08x\n", hr);
count = ITypeLib_GetTypeInfoCount(typelib);
- ok(count == 14, "got %d\n", count);
+ ok(count == 15, "got %d\n", count);
for(i = 0; i < count; i++)
{
--
2.23.0