From: Vibhav Pant vibhavp@gmail.com
--- dlls/vccorlib140/tests/vccorlib.c | 19 ++++++++----------- dlls/vccorlib140/vccorlib.c | 31 +++++++++++++++++++------------ 2 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/dlls/vccorlib140/tests/vccorlib.c b/dlls/vccorlib140/tests/vccorlib.c index cafe95faf77..2f32eee36d2 100644 --- a/dlls/vccorlib140/tests/vccorlib.c +++ b/dlls/vccorlib140/tests/vccorlib.c @@ -701,22 +701,22 @@ static void test___abi_make_type_id(void) WindowsDeleteString(str);
equals = p_platform_type_Equals_Object(type_obj, type_obj); - todo_wine ok(equals, "got equals %d\n", equals); + ok(equals, "got equals %d\n", equals); equals = p_platform_type_Equals_Object(type_obj, NULL); ok(!equals, "got equals %d\n", equals);
typecode = p_platform_type_GetTypeCode(type_obj); - todo_wine ok(typecode == 0xdeadbeef, "got typecode %d\n", typecode); + ok(typecode == 0xdeadbeef, "got typecode %d\n", typecode);
str = p_platform_type_ToString(type_obj); buf = WindowsGetStringRawBuffer(str, NULL); - todo_wine ok(buf && !wcscmp(buf, L"foo"), "got buf %s\n", debugstr_w(buf)); + ok(buf && !wcscmp(buf, L"foo"), "got buf %s\n", debugstr_w(buf)); WindowsDeleteString(str);
str = p_platform_type_get_FullName(type_obj); - todo_wine ok(str != NULL, "got str %p\n", str); + ok(str != NULL, "got str %p\n", str); buf = WindowsGetStringRawBuffer(str, NULL); - todo_wine ok(buf && !wcscmp(buf, L"foo"), "got buf %s != %s\n", debugstr_w(buf), debugstr_w(L"foo")); + ok(buf && !wcscmp(buf, L"foo"), "got buf %s != %s\n", debugstr_w(buf), debugstr_w(L"foo")); WindowsDeleteString(str);
type_obj2 = p___abi_make_type_id(&desc); @@ -731,13 +731,13 @@ static void test___abi_make_type_id(void) todo_wine check_interface(type_obj2, &IID_IPrintable);
equals = p_platform_type_Equals_Object(type_obj2, type_obj); - todo_wine ok(equals, "got equals %d\n", equals); + ok(equals, "got equals %d\n", equals);
count = IInspectable_Release(type_obj); ok(count == 0, "got count %lu\n", count);
equals = p_platform_type_Equals_Object(NULL, NULL); - todo_wine ok(equals, "got equals %d\n", equals); + ok(equals, "got equals %d\n", equals);
type_obj = p___abi_make_type_id(&desc2); ok(type_obj != NULL, "got type_obj %p\n", type_obj); @@ -756,7 +756,7 @@ static void test___abi_make_type_id(void) ok(!equals, "got equals %d\n", equals);
typecode = p_platform_type_GetTypeCode(type_obj); - todo_wine ok(typecode == 1, "got typecode %d\n", typecode); + ok(typecode == 1, "got typecode %d\n", typecode);
str = p_platform_type_ToString(type_obj); ok(str == NULL, "got str %s\n", debugstr_hstring(str)); @@ -769,9 +769,6 @@ static void test___abi_make_type_id(void)
count = IInspectable_Release(type_obj2); ok(count == 0, "got count %lu\n", count); - - typecode = p_platform_type_GetTypeCode(NULL); - ok(typecode == 0, "got typecode %d\n", typecode); }
START_TEST(vccorlib) diff --git a/dlls/vccorlib140/vccorlib.c b/dlls/vccorlib140/vccorlib.c index 27ccdfe178c..ff4cbf12b20 100644 --- a/dlls/vccorlib140/vccorlib.c +++ b/dlls/vccorlib140/vccorlib.c @@ -362,30 +362,37 @@ void *WINAPI __abi_make_type_id(const struct __abi_type_descriptor *desc) return &obj->IClosable_iface; }
-bool __cdecl platform_type_Equals_Object(void *this, void *object) +bool __cdecl platform_type_Equals_Object(struct platform_type *this, struct platform_type *object) { - FIXME("(%p, %p) stub\n", this, object); + TRACE("(%p, %p)\n", this, object);
- return false; + return this == object || (this && object && this->desc == object->desc); }
-int __cdecl platform_type_GetTypeCode(void *this) +int __cdecl platform_type_GetTypeCode(struct platform_type *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this);
- return 0; + return this->desc->type_id; }
-HSTRING __cdecl platform_type_ToString(void *this) +HSTRING __cdecl platform_type_ToString(struct platform_type *this) { - FIXME("(%p) stub\n", this); + HSTRING str = NULL; + HRESULT hr; + + TRACE("(%p)\n", this);
- return NULL; + /* TODO: Throw a COMException if this fails */ + hr = WindowsCreateString(this->desc->name, this->desc->name ? wcslen(this->desc->name) : 0, &str); + if (FAILED(hr)) + FIXME("WindowsCreateString failed: %#lx\n", hr); + return str; }
-HSTRING __cdecl platform_type_get_FullName(void *type) +HSTRING __cdecl platform_type_get_FullName(struct platform_type *type) { - FIXME("(%p) stub\n", type); + TRACE("(%p)\n", type);
- return NULL; + return platform_type_ToString(type); }