From: Vibhav Pant vibhavp@gmail.com
--- dlls/vccorlib140/tests/Makefile.in | 2 +- dlls/vccorlib140/tests/vccorlib.c | 424 ++++++++++++++++++++++++++++- dlls/vccorlib140/vccorlib.c | 66 +++++ dlls/vccorlib140/vccorlib140.spec | 99 +++---- 4 files changed, 529 insertions(+), 62 deletions(-)
diff --git a/dlls/vccorlib140/tests/Makefile.in b/dlls/vccorlib140/tests/Makefile.in index 9d20ff64424..7d19fceb468 100644 --- a/dlls/vccorlib140/tests/Makefile.in +++ b/dlls/vccorlib140/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = vccorlib140.dll -IMPORTS = combase ole32 uuid +IMPORTS = combase ole32 oleaut32 uuid
SOURCES = \ vccorlib.c diff --git a/dlls/vccorlib140/tests/vccorlib.c b/dlls/vccorlib140/tests/vccorlib.c index 1b597a9325a..d6180578fbe 100644 --- a/dlls/vccorlib140/tests/vccorlib.c +++ b/dlls/vccorlib140/tests/vccorlib.c @@ -22,11 +22,13 @@ #define COBJMACROS
#include <stdbool.h> +#include <stdint.h>
#include "initguid.h" #include "activation.h" #include "objbase.h" #include "weakreference.h" +#include "restrictederrorinfo.h" #define WIDL_using_Windows_Foundation #include "windows.foundation.h" #include "winstring.h" @@ -110,6 +112,22 @@ DEFINE_EXPECT(PostInitialize); DEFINE_EXPECT(PreUninitialize); DEFINE_EXPECT(PostUninitialize);
+#define WINRT_EXCEPTIONS \ + WINRT_EXCEPTION(AccessDenied, E_ACCESSDENIED) \ + WINRT_EXCEPTION(ChangedState, E_CHANGED_STATE) \ + WINRT_EXCEPTION(ClassNotRegistered, REGDB_E_CLASSNOTREG) \ + WINRT_EXCEPTION(Disconnected, RPC_E_DISCONNECTED) \ + WINRT_EXCEPTION(Failure, E_FAIL) \ + WINRT_EXCEPTION(InvalidArgument, E_INVALIDARG) \ + WINRT_EXCEPTION(InvalidCast, E_NOINTERFACE) \ + WINRT_EXCEPTION(NotImplemented, E_NOTIMPL) \ + WINRT_EXCEPTION(NullReference, E_POINTER) \ + WINRT_EXCEPTION(ObjectDisposed, RO_E_CLOSED) \ + WINRT_EXCEPTION(OperationCanceled, E_ABORT) \ + WINRT_EXCEPTION(OutOfBounds, E_BOUNDS) \ + WINRT_EXCEPTION(OutOfMemory, E_OUTOFMEMORY) \ + WINRT_EXCEPTION(WrongThread, RPC_E_WRONG_THREAD) + struct __abi_type_descriptor { const WCHAR *name; @@ -130,6 +148,12 @@ static int (__cdecl *p_platform_type_GetTypeCode)(void *); static HSTRING (__cdecl *p_platform_type_ToString)(void *); static HSTRING (__cdecl *p_platform_type_get_FullName)(void *); static void *(WINAPI *pCreateValue)(int type, const void *); +static void *(__cdecl *pCreateException)(HRESULT); +static void *(__cdecl *pCreateExceptionWithMessage)(HRESULT, HSTRING); +static HSTRING (__cdecl *p_platform_exception_get_Message)(void *); +static void *(__cdecl *pAllocateException)(size_t); +static void *(__cdecl *pAllocateExceptionWithWeakRef)(ptrdiff_t, size_t); +static void (__cdecl *pFreeException)(void *);
static void *(__cdecl *p__RTtypeid)(const void *); static const char *(__thiscall *p_type_info_name)(void *); @@ -137,11 +161,13 @@ static const char *(__thiscall *p_type_info_raw_name)(void *); static int (__thiscall *p_type_info_opequals_equals)(void *, void *); static int (__thiscall *p_type_info_opnot_equals)(void *, void *);
+static HMODULE hmod; + static BOOL init(void) { - HMODULE hmod = LoadLibraryA("vccorlib140.dll"); HMODULE msvcrt = LoadLibraryA("msvcrt.dll");
+ hmod = LoadLibraryA("vccorlib140.dll"); if (!hmod) { win_skip("vccorlib140.dll not available\n"); @@ -173,6 +199,15 @@ static BOOL init(void) p_platform_type_ToString = (void *)GetProcAddress(hmod, "?ToString@Type@Platform@@U$AAAP$AAVString@2@XZ"); p_platform_type_get_FullName = (void *)GetProcAddress(hmod, "?get@FullName@Type@Platform@@Q$AAAP$AAVString@3@XZ"); pCreateValue = (void *)GetProcAddress(hmod, "?CreateValue@Details@Platform@@YAP$AAVObject@2@W4TypeCode@2@PBX@Z"); + pCreateException = (void *)GetProcAddress(hmod, "?CreateException@Exception@Platform@@SAP$AAV12@H@Z"); + pCreateExceptionWithMessage = (void *)GetProcAddress(hmod, + "?CreateException@Exception@Platform@@SAP$AAV12@HP$AAVString@2@@Z"); + p_platform_exception_get_Message = (void *)GetProcAddress(hmod, + "?get@Message@Exception@Platform@@Q$AAAP$AAVString@3@XZ"); + pAllocateException = (void *)GetProcAddress(hmod, "?AllocateException@Heap@Details@Platform@@SAPAXI@Z"); + pAllocateExceptionWithWeakRef = (void *)GetProcAddress(hmod, + "?AllocateException@Heap@Details@Platform@@SAPAXII@Z"); + pFreeException = (void *)GetProcAddress(hmod, "?FreeException@Heap@Details@Platform@@SAXPAX@Z"); p_type_info_name = (void *)GetProcAddress(msvcrt, "?name@type_info@@QBAPBDXZ"); p_type_info_raw_name = (void *)GetProcAddress(msvcrt, "?raw_name@type_info@@QBAPBDXZ"); p_type_info_opequals_equals = (void *)GetProcAddress(msvcrt, "??8type_info@@QBAHABV0@@Z"); @@ -198,6 +233,16 @@ static BOOL init(void) "?get@FullName@Type@Platform@@QE$AAAPE$AAVString@3@XZ"); pCreateValue = (void *)GetProcAddress(hmod, "?CreateValue@Details@Platform@@YAPE$AAVObject@2@W4TypeCode@2@PEBX@Z"); + pCreateException = (void *)GetProcAddress(hmod, + "?CreateException@Exception@Platform@@SAPE$AAV12@H@Z"); + pCreateExceptionWithMessage = (void *)GetProcAddress(hmod, + "?CreateException@Exception@Platform@@SAPE$AAV12@HPE$AAVString@2@@Z"); + p_platform_exception_get_Message = (void *)GetProcAddress(hmod, + "?get@Message@Exception@Platform@@QE$AAAPE$AAVString@3@XZ"); + pAllocateException = (void *)GetProcAddress(hmod, "?AllocateException@Heap@Details@Platform@@SAPEAX_K@Z"); + pAllocateExceptionWithWeakRef = (void *)GetProcAddress(hmod, + "?AllocateException@Heap@Details@Platform@@SAPEAX_K0@Z"); + pFreeException = (void *)GetProcAddress(hmod, "?FreeException@Heap@Details@Platform@@SAXPEAX@Z"); p_type_info_name = (void *)GetProcAddress(msvcrt, "?name@type_info@@QEBAPEBDXZ"); p_type_info_raw_name = (void *)GetProcAddress(msvcrt, "?raw_name@type_info@@QEBAPEBDXZ"); p_type_info_opequals_equals = (void *)GetProcAddress(msvcrt, "??8type_info@@QEBAHAEBV0@@Z"); @@ -222,6 +267,16 @@ static BOOL init(void) "?get@FullName@Type@Platform@@Q$AAAP$AAVString@3@XZ"); pCreateValue = (void *)GetProcAddress(hmod, "?CreateValue@Details@Platform@@YGP$AAVObject@2@W4TypeCode@2@PBX@Z"); + pCreateException = (void *)GetProcAddress(hmod, + "?CreateException@Exception@Platform@@SAP$AAV12@H@Z"); + pCreateExceptionWithMessage = (void *)GetProcAddress(hmod, + "?CreateException@Exception@Platform@@SAP$AAV12@HP$AAVString@2@@Z"); + p_platform_exception_get_Message = (void *)GetProcAddress(hmod, + "?get@Message@Exception@Platform@@Q$AAAP$AAVString@3@XZ"); + pAllocateException = (void *)GetProcAddress(hmod, "?AllocateException@Heap@Details@Platform@@SAPAXI@Z"); + pAllocateExceptionWithWeakRef = (void *)GetProcAddress(hmod, + "?AllocateException@Heap@Details@Platform@@SAPAXII@Z"); + pFreeException = (void *)GetProcAddress(hmod, "?FreeException@Heap@Details@Platform@@SAXPAX@Z"); p_type_info_name = (void *)GetProcAddress(msvcrt, "?name@type_info@@QBEPBDXZ"); p_type_info_raw_name = (void *)GetProcAddress(msvcrt, "?raw_name@type_info@@QBEPBDXZ"); p_type_info_opequals_equals = (void *)GetProcAddress(msvcrt, "??8type_info@@QBEHABV0@@Z"); @@ -240,6 +295,12 @@ static BOOL init(void) ok(p_platform_type_ToString != NULL, "Platform::Type::ToString not available\n"); ok(p_platform_type_get_FullName != NULL, "Platform::Type::FullName not available\n"); ok(pCreateValue != NULL, "CreateValue not available\n"); + ok(pCreateException != NULL, "CreateException not available\n"); + ok(pCreateExceptionWithMessage != NULL, "CreateExceptionWithMessage not available\n"); + ok(p_platform_exception_get_Message != NULL, "Platform::Exception::Message::get not available\n"); + ok(pAllocateException != NULL, "AllocateException not available\n"); + ok(pAllocateExceptionWithWeakRef != NULL, "AllocateExceptionWithWeakRef not available.\n"); + ok(pFreeException != NULL, "FreeException not available\n");
ok(p_type_info_name != NULL, "type_info::name not available\n"); ok(p_type_info_raw_name != NULL, "type_info::raw_name not available\n"); @@ -444,7 +505,7 @@ static void test_GetIidsFn(void)
static void test_Allocate(void) { - void *addr; + void *addr, **ptr, **base;
addr = pAllocate(0); ok(!!addr, "got addr %p\n", addr); @@ -454,6 +515,35 @@ static void test_Allocate(void) ok(!!addr, "got addr %p\n", addr); pFree(addr); pFree(NULL); + + /* AllocateException allocates additional space for two pointer-width fields, with the second field used as the + * back-pointer to the exception data. */ + addr = pAllocateException(0); + todo_wine ok(!!addr, "got addr %p\n", addr); + if (!addr) return; + ptr = (void **)((ULONG_PTR)addr - sizeof(void *)); + *ptr = NULL; /* The write should succeed. */ + base = (void **)((ULONG_PTR)addr - 2 * sizeof(void *)); + *base = NULL; + /* Since base is the actual allocation base, Free(base) should succeed. */ + pFree(base); + + addr = pAllocateException(sizeof(void *)); + ok(!!addr, "got addr %p\n", addr); + ptr = (void **)((ULONG_PTR)addr - sizeof(void *)); + *ptr = NULL; + base = (void **)((ULONG_PTR)addr - 2 * sizeof(void *)); + *base = NULL; + /* FreeException will derive the allocation base itself. */ + pFreeException(addr); + + /* Do what AllocateException does, manually. */ + base = pAllocate(sizeof(void *) * 2 + sizeof(UINT32)); + ok(!!base, "got base %p\n", base); + /* addr is what AllocateException would return. */ + addr = (void *)((ULONG_PTR)base + sizeof(void *) * 2); + /* FreeException should succeed with addr. */ + pFreeException(addr); }
#define test_refcount(a, b) test_refcount_(__LINE__, (a), (b)) @@ -473,7 +563,8 @@ struct control_block LONG ref_strong; IUnknown *object; bool is_inline; - UINT16 unknown; + UINT8 unknown; + bool is_exception; #ifdef _WIN32 char _padding[4]; #endif @@ -606,7 +697,8 @@ static void test_AllocateWithWeakRef_inline(void) ok(object->weakref->ref_strong == 1, "got ref_strong %lu\n", object->weakref->ref_strong); ok(object->weakref->object == &object->IUnknown_iface, "got object %p != %p\n", object->weakref->object, &object->IUnknown_iface); - ok(object->weakref->unknown == 0, "got unknown %d\n", object->weakref->unknown); + todo_wine ok(object->weakref->unknown == 0, "got unknown %d\n", object->weakref->unknown); + ok(!object->weakref->is_exception, "got is_exception %d\n", object->weakref->is_exception); /* The object is allocate within the weakref. */ ok((char *)object->weakref == ((char *)object - sizeof(struct control_block)), "got %p != %p\n", object->weakref, (char *)object - sizeof(struct control_block)); @@ -664,6 +756,49 @@ static void test_AllocateWithWeakRef(void) ok(object->weakref->object == &object->IUnknown_iface, "got object %p != %p\n", object->weakref->object, &object->IUnknown_iface); ok(object->weakref->unknown == 0, "got unknown %d\n", object->weakref->unknown); + ok(!object->weakref->is_exception, "got is_exception %d\n", object->weakref->is_exception); + + hr = IWeakReference_Resolve(weakref, &IID_IAgileObject, (IInspectable **)&out); + ok(hr == S_OK, "got hr %#lx\n", hr); + test_refcount(&object->IUnknown_iface, 2); + IUnknown_Release(out); + + call_func1(pReleaseTarget, object->weakref); + hr = IWeakReference_Resolve(weakref, &IID_IAgileObject, (IInspectable **)&out); + ok(hr == S_OK, "got hr %#lx\n", hr); + test_refcount(&object->IUnknown_iface, 2); + IUnknown_Release(out); + + count = IWeakReference_AddRef(weakref); + ok(count == 2, "got count %lu\n", count); + + count = IUnknown_Release(&object->IUnknown_iface); + ok(count == 0, "got count %lu\n", count); + test_refcount(weakref, 1); + out = (IUnknown *)0xdeadbeef; + hr = IWeakReference_Resolve(weakref, &IID_IAgileObject, (IInspectable **)&out); + ok(hr == S_OK, "got hr %#lx\n", hr); + ok(out == (IUnknown *)0xdeadbeef, "got out %p\n", out); + count = IWeakReference_Release(weakref); + ok(count == 0, "got count %lu\n", count); + + /* AllocateExceptionWithWeakRef will not store the control block inline, regardless of the size. */ + object = pAllocateExceptionWithWeakRef(offsetof(struct unknown_impl, weakref), sizeof(struct unknown_impl)); + todo_wine ok(object != NULL, "got object %p\n", object); + if (!object) return; + + object->strong_ref_free_val = -100; + ok(object->weakref != NULL, "got weakref %p\n", object->weakref); + object->IUnknown_iface.lpVtbl = &unknown_impl_vtbl; + weakref = &object->weakref->IWeakReference_iface; + + test_refcount(weakref, 1); + ok(!object->weakref->is_inline, "got is_inline %d\n", object->weakref->is_inline); + ok(object->weakref->ref_strong == 1, "got ref_strong %lu\n", object->weakref->ref_strong); + ok(object->weakref->object == &object->IUnknown_iface, "got object %p != %p\n", object->weakref->object, + &object->IUnknown_iface); + ok(object->weakref->unknown == 0, "got unknown %d\n", object->weakref->unknown); + ok(object->weakref->is_exception, "got is_exception %d\n", object->weakref->is_exception);
hr = IWeakReference_Resolve(weakref, &IID_IAgileObject, (IInspectable **)&out); ok(hr == S_OK, "got hr %#lx\n", hr); @@ -1020,6 +1155,286 @@ static void test_CreateValue(void) pUninitializeData(0); }
+typedef struct __type_info +{ + const void *vtable; + char *name; + char mangled[128]; +} rtti_type_info; +typedef struct +{ + UINT flags; + unsigned int type_info; + DWORD offsets[3]; + unsigned int size; + unsigned int copy_ctor; +} cxx_type_info; +typedef struct +{ + UINT count; + unsigned int info[1]; +} cxx_type_info_table; +typedef struct +{ + UINT flags; + unsigned int destructor; + unsigned int custom_handler; + unsigned int type_info_table; +} cxx_exception_type; + +struct exception_inner +{ + /* This only gets set when the exception is thrown. */ + BSTR message1; + /* Likewise, but can also be set by CreateExceptionWithMessage. */ + BSTR message2; + void *unknown1; + void *unknown2; + HRESULT hr; + /* Only gets set when the exception is thrown. */ + IRestrictedErrorInfo *error_info; + const cxx_exception_type *exception_type; + UINT32 unknown3; + void *unknown4; +}; + +struct platform_exception +{ + IInspectable IInspectable_iface; + const void *IPrintable_iface; + const void *IEquatable_iface; + IClosable IClosable_iface; + struct exception_inner inner; + /* Exceptions use the weakref control block for reference counting, even though they don't implement + * IWeakReferenceSource. */ + struct control_block *control_block; + /* This is lazily initialized, i.e, only when QueryInterface(IID_IMarshal) gets called. The default value is + * UINTPTR_MAX/-1 */ + IUnknown *marshal; +}; + +static void test_interface_layout_(int line, IUnknown *iface, const GUID *iid, const void *exp_ptr) +{ + IUnknown *out = NULL; + HRESULT hr; + + hr = IUnknown_QueryInterface(iface, iid, (void **)&out); + ok_(__FILE__, line)(hr == S_OK, "got hr %#lx\n", hr); + if (SUCCEEDED(hr)) + { + ok_(__FILE__, line)((ULONG_PTR)out == (ULONG_PTR)exp_ptr, "got out %p != %p\n", out, exp_ptr); + IUnknown_Release(out); + } +} +#define test_interface_layout(iface, iid, exp_ptr) test_interface_layout_(__LINE__, (IUnknown *)(iface), iid, exp_ptr) + +static void test_exceptions(void) +{ +#define EXCEPTION_RTTI_NAME(name) (sizeof(void *) == 8) ? ".PE$AAV" #name "Exception@Platform@@" : ".P$AAV" #name "Exception@Platform@@" +#define WINRT_EXCEPTION(name, hr) \ + {hr, L"Platform." #name "Exception", ".?AV" #name "Exception@Platform@@", "class Platform::" #name "Exception", EXCEPTION_RTTI_NAME(name)}, + const struct exception_test_case + { + HRESULT hr; + const WCHAR *exp_winrt_name; + const char *exp_rtti_mangled_name; + const char *exp_rtti_name; + /* The mangled RTTI name of the cxx_exception_type received by the exception handler/filter. */ + const char *exp_exception_rtti_mangled_name; + } test_cases[] = { + WINRT_EXCEPTIONS + /* Generic exceptions */ + {E_HANDLE, L"Platform.COMException", ".?AVCOMException@Platform@@", "class Platform::COMException", EXCEPTION_RTTI_NAME(COM)}, + {0xdeadbeef, L"Platform.COMException", ".?AVCOMException@Platform@@", "class Platform::COMException", EXCEPTION_RTTI_NAME(COM)}, + }; +#undef EXCEPTION_RTTI_NAME +#undef WINRT_EXCEPTION + const ULONG_PTR base = sizeof(void *) == 8 ? (ULONG_PTR)hmod : 0; + const struct exception_test_case *cur_test; + HSTRING_HEADER hdr; + HSTRING msg; + HRESULT hr; + ULONG i; + + hr = WindowsCreateStringReference(L"foo", 3, &hdr, &msg); + ok(hr == S_OK, "got hr %#lx\n", hr); + + for (i = 0; i < ARRAY_SIZE(test_cases); i++) + { + const cxx_type_info_table *type_info_table; + const char *rtti_name, *rtti_raw_name; + const struct exception_inner *inner; + const rtti_type_info *rtti_info; + const cxx_exception_type *type; + struct platform_exception *obj; + const cxx_type_info *cxx_info; + IInspectable *inspectable; + const WCHAR *bufW; + INT32 j, ret = 0; + void *type_info; + WCHAR buf[256]; + IUnknown *out; + HSTRING str; + ULONG count; + HRESULT hr; + GUID *iids; + + winetest_push_context("test_cases[%lu]", i); + + cur_test = &test_cases[i]; + obj = pCreateException(cur_test->hr); + todo_wine ok(obj != NULL, "got obj %p\n", obj); + if (!obj) + { + winetest_pop_context(); + continue; + } + + inspectable = (IInspectable *)obj; + /* Verify that the IMarshal field is lazily-initialized. */ + ok((ULONG_PTR)obj->marshal == UINTPTR_MAX, "got marshal %p\n", obj->marshal); + todo_wine check_interface(inspectable, &IID_IMarshal); + ok(obj->marshal != NULL && (ULONG_PTR)obj->marshal != UINTPTR_MAX, "got marshal %p\n", obj->marshal); + + test_interface_layout(obj, &IID_IUnknown, &obj->IInspectable_iface); + test_interface_layout(obj, &IID_IInspectable, &obj->IInspectable_iface); + test_interface_layout(obj, &IID_IAgileObject, &obj->IInspectable_iface); + todo_wine test_interface_layout(obj, &IID_IPrintable, &obj->IPrintable_iface); + todo_wine test_interface_layout(obj, &IID_IEquatable, &obj->IEquatable_iface); + test_interface_layout(obj, &IID_IClosable, &obj->IClosable_iface); + + hr = IInspectable_GetRuntimeClassName(inspectable, &str); + ok(hr == S_OK, "got hr %#lx\n", hr); + bufW = WindowsGetStringRawBuffer(str, NULL); + ok(!wcscmp(cur_test->exp_winrt_name, bufW), "got str %s != %s\n", debugstr_hstring(str), + debugstr_w(cur_test->exp_winrt_name)); + WindowsDeleteString(str); + + /* Verify control block fields. */ + ok(!obj->control_block->is_inline, "got is_inline %d\n", obj->control_block->is_inline); + ok(obj->control_block->ref_strong == 1, "got ref_strong %lu\n", obj->control_block->ref_strong); + ok(obj->control_block->object == (IUnknown *)&obj->IInspectable_iface, "got object %p != %p\n", + obj->control_block->object, &obj->IInspectable_iface); + ok(obj->control_block->unknown == 0, "got unknown %d\n", obj->control_block->unknown); + ok(obj->control_block->is_exception, "got is_exception %d\n", obj->control_block->is_exception); + test_refcount(obj->control_block, 1); + count = IInspectable_AddRef(inspectable); + ok(count == 2, "got count %lu\n", count); + ok(obj->control_block->ref_strong == 2, "got ref_strong %lu\n", obj->control_block->ref_strong); + count = IInspectable_Release(inspectable); + ok(count == 1, "got count %lu\n", count); + ok(obj->control_block->ref_strong == 1, "got ref_strong %lu\n", obj->control_block->ref_strong); + + /* While Exceptions do *not* implement IWeakReferenceSource, the control block vtable still implements + * IWeakReference. */ + hr = IInspectable_QueryInterface(inspectable, &IID_IWeakReferenceSource, (void **)&out); + ok(hr == E_NOINTERFACE, "got hr %#lx\n", hr); + + hr = IWeakReference_Resolve(&obj->control_block->IWeakReference_iface, &IID_IAgileObject, (IInspectable **)&out); + ok(hr == S_OK, "got hr %#lx\n", hr); + test_refcount(inspectable, 2); + count = IUnknown_Release(out); + ok(count == 1, "got count %lu\n", count); + test_refcount(inspectable, 1); + ok(obj->control_block->ref_strong == 1, "got ref_strong %lu\n", obj->control_block->ref_strong); + + count = 1; + /* GetIids does not return any IIDs for Platform::Exception objects. */ + hr = IInspectable_GetIids(inspectable, &count, &iids); + ok(hr == S_OK, "got hr %#lx\n", hr); + ok(count == 0, "got count %lu\n", count); + CoTaskMemFree(iids); + + type_info = p__RTtypeid(obj); + ok(type_info != NULL, "got type_info %p\n", type_info); + rtti_name = (char *)call_func1(p_type_info_name, type_info); + ok(rtti_name && !strcmp(rtti_name, cur_test->exp_rtti_name), "got rtti_name %s != %s\n", + debugstr_a(rtti_name), debugstr_a(cur_test->exp_rtti_name)); + rtti_raw_name = (char *)call_func1(p_type_info_raw_name, type_info); + ok(rtti_raw_name && !strcmp(rtti_raw_name, cur_test->exp_rtti_mangled_name), "got rtti_raw_name %s != %s\n", + debugstr_a(rtti_raw_name), debugstr_a(cur_test->exp_rtti_mangled_name)); + + /* By default, the message returned is from FormatMessageW. */ + str = p_platform_exception_get_Message(obj); + ret = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, cur_test->hr, 0, buf, ARRAY_SIZE(buf), NULL); + ok(!!str == !!ret, "got str %s\n", debugstr_hstring(str)); + if(ret) + { + bufW = WindowsGetStringRawBuffer(str, NULL); + ok(!wcscmp(bufW, buf), "got str %s != %s\n", debugstr_hstring(str), debugstr_w(buf)); + } + WindowsDeleteString(str); + + inner = *(const struct exception_inner **)((ULONG_PTR)obj - sizeof(ULONG_PTR)); + ok(inner == &obj->inner, "got inner %p != %p\n", inner, &obj->inner); + ok(inner->message1 == NULL, "got message1 %p\n", inner->message1); + ok(inner->message2 == NULL, "got message2 %p\n", inner->message2); + ok(inner->unknown1 == NULL, "got unknown1 %p\n", inner->unknown1); + ok(inner->unknown2 == NULL, "got unknown2 %p\n", inner->unknown2); + ok(inner->hr == cur_test->hr, "got hr %#lx != %#lx\n", inner->hr, cur_test->hr); + ok(inner->error_info == NULL, "got error_info %p\n", inner->error_info); + ok(inner->exception_type != NULL, "got exception_type %p\n", inner->exception_type); + if (sizeof(void *) == 8) + ok(inner->unknown3 == 64, "got unknown3 %u\n", inner->unknown3); + else + ok(inner->unknown3 == 32, "got unknown3 %u \n", inner->unknown3); + + type = inner->exception_type; + ok(type->flags == 16, "got flags %#x\n", type->flags); + /* There is no destructor, presumbly because COMException objects already have COM semantics? */ + ok(type->destructor == 0, "got destructor %#x\n", type->destructor); + ok(type->custom_handler == 0, "got custom_handler %#x\n", type->custom_handler); + ok(type->type_info_table != 0, "got type_info_table %#x\n", type->type_info_table); + + type_info_table = (cxx_type_info_table *)(base + type->type_info_table); + ok(type_info_table->count != 0, "got count %u\n", type_info_table->count); + + for (j = 0; 0 && j < type_info_table->count; j++) + { + winetest_push_context("j=%u", j); + + cxx_info = (cxx_type_info *)(base + type_info_table->info[j]); + ok(cxx_info->size == 8, "got size %u\n", cxx_info->size); + ok(cxx_info->copy_ctor == 0, "got copy_ctor %#x\n", cxx_info->copy_ctor); /* No copy constructor as well. */ + ok(cxx_info->type_info != 0, "got type_info"); + + winetest_pop_context(); + } + + cxx_info = (cxx_type_info *)(base + type_info_table->info[0]); + rtti_info = (rtti_type_info *)(base + cxx_info->type_info); + ok(!strcmp(rtti_info->mangled, cur_test->exp_exception_rtti_mangled_name), "got mangled %s != %s\n", + debugstr_a(rtti_info->mangled), debugstr_a(cur_test->exp_exception_rtti_mangled_name)); + + count = IInspectable_Release(inspectable); + ok(count == 0, "got count %lu\n", count); + + /* Create an Exception object with a custom message. */ + inspectable = pCreateExceptionWithMessage(cur_test->hr, msg); + ok(inspectable != NULL, "got excp %p\n", inspectable); + str = p_platform_exception_get_Message(inspectable); + hr = WindowsCompareStringOrdinal(str, msg, &ret); + ok(hr == S_OK, "got hr %#lx\n", hr); + ok(!ret, "got str %s != %s\n", debugstr_hstring(str), debugstr_hstring(msg)); + WindowsDeleteString(str); + + inner = (const struct exception_inner *)*(ULONG_PTR *)((ULONG_PTR)inspectable - sizeof(ULONG_PTR)); + ok(inner->message1 == NULL, "got message1 %p\n", inner->message1); + ok(inner->message2 != NULL, "got message2 %p\n", inner->message2); + ok(inner->unknown1 == NULL, "got unknown3 %p\n", inner->unknown1); + ok(inner->unknown2 == NULL, "got unknown4 %p\n", inner->unknown2); + bufW = WindowsGetStringRawBuffer(msg, NULL); + ok(!wcscmp(inner->message2, bufW), "got message2 %s != %s\n", debugstr_w(inner->message2), debugstr_w(bufW)); + ret = SysStringLen(inner->message2); /* Verify that message2 is a BSTR. */ + ok(ret == wcslen(inner->message2), "got ret %u != %Iu\n", ret, wcslen(inner->message2)); + + count = IInspectable_Release(inspectable); + ok(count == 0, "got count %lu\n", count); + + winetest_pop_context(); + } +} + START_TEST(vccorlib) { if(!init()) @@ -1033,4 +1448,5 @@ START_TEST(vccorlib) test_AllocateWithWeakRef(); test___abi_make_type_id(); test_CreateValue(); + test_exceptions(); } diff --git a/dlls/vccorlib140/vccorlib.c b/dlls/vccorlib140/vccorlib.c index 3294aab6dd0..fffaeea3bdd 100644 --- a/dlls/vccorlib140/vccorlib.c +++ b/dlls/vccorlib140/vccorlib.c @@ -101,6 +101,12 @@ void *__cdecl Allocate(size_t size) return addr; }
+void *__cdecl AllocateException(size_t size) +{ + FIXME("(%Iu): stub!\n", size); + return NULL; +} + void __cdecl Free(void *addr) { TRACE("(%p)\n", addr); @@ -108,6 +114,11 @@ void __cdecl Free(void *addr) free(addr); }
+void __cdecl FreeException(void *addr) +{ + FIXME("(%p): stub!\n", addr); +} + struct control_block { IWeakReference IWeakReference_iface; @@ -221,6 +232,12 @@ void *__cdecl AllocateWithWeakRef(ptrdiff_t offset, size_t size) return weakref->object; }
+void *__cdecl AllocateExceptionWithWeakRef(ptrdiff_t offset, size_t size) +{ + FIXME("(%Iu, %Iu): stub!\n", offset, size); + return NULL; +} + DEFINE_THISCALL_WRAPPER(control_block_ReleaseTarget, 4) void __thiscall control_block_ReleaseTarget(struct control_block *weakref) { @@ -557,6 +574,55 @@ void *WINAPI CreateValue(int typecode, const void *val) return obj; }
+void *__cdecl CreateExceptionWithMessage(HRESULT hr, HSTRING msg) +{ + FIXME("(%#lx, %s): stub!\n", hr, debugstr_hstring(msg)); + return NULL; +} + +void *__cdecl CreateException(HRESULT hr) +{ + FIXME("(%#lx): stub!\n", hr); + return NULL; +} + +void WINAPI __abi_WinRTraiseCOMException(HRESULT hr) +{ + FIXME("(%#lx): stub!\n", hr); +} + +#define WINRT_EXCEPTIONS \ + WINRT_EXCEPTION(AccessDenied, E_ACCESSDENIED) \ + WINRT_EXCEPTION(ChangedState, E_CHANGED_STATE) \ + WINRT_EXCEPTION(ClassNotRegistered, REGDB_E_CLASSNOTREG) \ + WINRT_EXCEPTION(Disconnected, RPC_E_DISCONNECTED) \ + WINRT_EXCEPTION(Failure, E_FAIL) \ + WINRT_EXCEPTION(InvalidArgument, E_INVALIDARG) \ + WINRT_EXCEPTION(InvalidCast, E_NOINTERFACE) \ + WINRT_EXCEPTION(NotImplemented, E_NOTIMPL) \ + WINRT_EXCEPTION(NullReference, E_POINTER) \ + WINRT_EXCEPTION(ObjectDisposed, RO_E_CLOSED) \ + WINRT_EXCEPTION(OperationCanceled, E_ABORT) \ + WINRT_EXCEPTION(OutOfBounds, E_BOUNDS) \ + WINRT_EXCEPTION(OutOfMemory, E_OUTOFMEMORY) \ + WINRT_EXCEPTION(WrongThread, RPC_E_WRONG_THREAD) + +#define WINRT_EXCEPTION(name, hr) \ + void WINAPI __abi_WinRTraise##name##Exception(void) \ + { \ + FIXME("(): stub!\n"); \ + } + +WINRT_EXCEPTIONS + +#undef WINRT_EXCEPTION + +HSTRING __cdecl platform_exception_get_Message(void *excp) +{ + FIXME("(%p): stub!\n", excp); + return NULL; +} + BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { if (reason == DLL_PROCESS_ATTACH) diff --git a/dlls/vccorlib140/vccorlib140.spec b/dlls/vccorlib140/vccorlib140.spec index d146b07d30e..78f090754cc 100644 --- a/dlls/vccorlib140/vccorlib140.spec +++ b/dlls/vccorlib140/vccorlib140.spec @@ -68,8 +68,8 @@ @ stub -arch=win64 ?FlushFactoryCache@@YAXXZ @ cdecl -arch=win32 ?Free@Heap@Details@Platform@@SAXPAX@Z(ptr) Free @ cdecl -arch=win64 ?Free@Heap@Details@Platform@@SAXPEAX@Z(ptr) Free -@ stub -arch=win32 ?FreeException@Heap@Details@Platform@@SAXPAX@Z -@ stub -arch=win64 ?FreeException@Heap@Details@Platform@@SAXPEAX@Z +@ cdecl -arch=win32 ?FreeException@Heap@Details@Platform@@SAXPAX@Z(ptr) FreeException +@ cdecl -arch=win64 ?FreeException@Heap@Details@Platform@@SAXPEAX@Z(ptr) FreeException @ stub -arch=i386 ?GetActivationFactory@Details@Platform@@YGJPAVModuleBase@1WRL@Microsoft@@PAUHSTRING__@@PAPAUIActivationFactory@@@Z @ stub -arch=arm ?GetActivationFactory@Details@Platform@@YAJPAVModuleBase@1WRL@Microsoft@@PAUHSTRING__@@PAPAUIActivationFactory@@@Z @ stub -arch=win64 ?GetActivationFactory@Details@Platform@@YAJPEAVModuleBase@1WRL@Microsoft@@PEAUHSTRING__@@PEAPEAUIActivationFactory@@@Z @@ -295,53 +295,38 @@ @ stub -arch=win64 ?__abi_ObjectToString@__abi_details@@YAPE$AAVString@Platform@@PE$AAVObject@3@_N@Z @ stub -arch=win32 ?__abi_Resolve@ControlBlock@Details@Platform@@UAGJAAVGuid@3@PAPAU__abi_IInspectable@@@Z @ stub -arch=win64 ?__abi_Resolve@ControlBlock@Details@Platform@@UEAAJAEAVGuid@3@PEAPEAU__abi_IInspectable@@@Z -@ stub -arch=i386 ?__abi_WinRTraiseAccessDeniedException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseAccessDeniedException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseAccessDeniedException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseCOMException@@YGXJ@Z -@ stub -arch=arm ?__abi_WinRTraiseCOMException@@YAXJ@Z -@ stub -arch=win64 ?__abi_WinRTraiseCOMException@@YAXJ@Z -@ stub -arch=i386 ?__abi_WinRTraiseChangedStateException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseChangedStateException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseChangedStateException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseClassNotRegisteredException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseClassNotRegisteredException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseClassNotRegisteredException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseDisconnectedException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseDisconnectedException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseDisconnectedException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseFailureException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseFailureException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseFailureException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseInvalidArgumentException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseInvalidArgumentException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseInvalidArgumentException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseInvalidCastException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseInvalidCastException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseInvalidCastException@@YAXXZ +@ stdcall -arch=i386 ?__abi_WinRTraiseAccessDeniedException@@YGXXZ() __abi_WinRTraiseAccessDeniedException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseAccessDeniedException@@YAXXZ() __abi_WinRTraiseAccessDeniedException +@ stdcall -arch=i386 ?__abi_WinRTraiseCOMException@@YGXJ@Z(long) __abi_WinRTraiseCOMException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseCOMException@@YAXJ@Z(long) __abi_WinRTraiseCOMException +@ stdcall -arch=i386 ?__abi_WinRTraiseChangedStateException@@YGXXZ() __abi_WinRTraiseChangedStateException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseChangedStateException@@YAXXZ() __abi_WinRTraiseChangedStateException +@ stdcall -arch=i386 ?__abi_WinRTraiseClassNotRegisteredException@@YGXXZ() __abi_WinRTraiseClassNotRegisteredException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseClassNotRegisteredException@@YAXXZ() __abi_WinRTraiseClassNotRegisteredException +@ stdcall -arch=i386 ?__abi_WinRTraiseDisconnectedException@@YGXXZ() __abi_WinRTraiseDisconnectedException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseDisconnectedException@@YAXXZ() __abi_WinRTraiseDisconnectedException +@ stdcall -arch=i386 ?__abi_WinRTraiseFailureException@@YGXXZ() __abi_WinRTraiseFailureException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseFailureException@@YAXXZ() __abi_WinRTraiseFailureException +@ stdcall -arch=i386 ?__abi_WinRTraiseInvalidArgumentException@@YGXXZ() __abi_WinRTraiseInvalidArgumentException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseInvalidArgumentException@@YAXXZ() __abi_WinRTraiseInvalidArgumentException +@ stdcall -arch=i386 ?__abi_WinRTraiseInvalidCastException@@YGXXZ() __abi_WinRTraiseInvalidCastException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseInvalidCastException@@YAXXZ() __abi_WinRTraiseInvalidCastException @ stub -arch=win32 ??0IntPtr@Platform@@QAA@H@Z @ stub -arch=win64 ??0IntPtr@Platform@@QEAA@H@Z -@ stub -arch=i386 ?__abi_WinRTraiseNotImplementedException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseNotImplementedException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseNotImplementedException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseNullReferenceException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseNullReferenceException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseNullReferenceException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseObjectDisposedException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseObjectDisposedException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseObjectDisposedException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseOperationCanceledException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseOperationCanceledException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseOperationCanceledException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseOutOfBoundsException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseOutOfBoundsException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseOutOfBoundsException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseOutOfMemoryException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseOutOfMemoryException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseOutOfMemoryException@@YAXXZ -@ stub -arch=i386 ?__abi_WinRTraiseWrongThreadException@@YGXXZ -@ stub -arch=arm ?__abi_WinRTraiseWrongThreadException@@YAXXZ -@ stub -arch=win64 ?__abi_WinRTraiseWrongThreadException@@YAXXZ +@ stdcall -arch=i386 ?__abi_WinRTraiseNotImplementedException@@YGXXZ() __abi_WinRTraiseNotImplementedException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseNotImplementedException@@YAXXZ() __abi_WinRTraiseNotImplementedException +@ stdcall -arch=i386 ?__abi_WinRTraiseNullReferenceException@@YGXXZ() __abi_WinRTraiseNullReferenceException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseNullReferenceException@@YAXXZ() __abi_WinRTraiseNullReferenceException +@ stdcall -arch=i386 ?__abi_WinRTraiseObjectDisposedException@@YGXXZ() __abi_WinRTraiseObjectDisposedException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseObjectDisposedException@@YAXXZ() __abi_WinRTraiseObjectDisposedException +@ stdcall -arch=i386 ?__abi_WinRTraiseOperationCanceledException@@YGXXZ() __abi_WinRTraiseOperationCanceledException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseOperationCanceledException@@YAXXZ() __abi_WinRTraiseOperationCanceledException +@ stdcall -arch=i386 ?__abi_WinRTraiseOutOfBoundsException@@YGXXZ() __abi_WinRTraiseOutOfBoundsException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseOutOfBoundsException@@YAXXZ() __abi_WinRTraiseOutOfBoundsException +@ stdcall -arch=i386 ?__abi_WinRTraiseOutOfMemoryException@@YGXXZ() __abi_WinRTraiseOutOfMemoryException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseOutOfMemoryException@@YAXXZ() __abi_WinRTraiseOutOfMemoryException +@ stdcall -arch=i386 ?__abi_WinRTraiseWrongThreadException@@YGXXZ() __abi_WinRTraiseWrongThreadException +@ stdcall -arch=arm,win64 ?__abi_WinRTraiseWrongThreadException@@YAXXZ() __abi_WinRTraiseWrongThreadException @ stub -arch=i386 ?__abi_cast_Object_to_String@__abi_details@@YGP$AAVString@Platform@@_NP$AAVObject@3@@Z @ stub -arch=arm ?__abi_cast_Object_to_String@__abi_details@@YAP$AAVString@Platform@@_NP$AAVObject@3@@Z @ stub -arch=win64 ?__abi_cast_Object_to_String@__abi_details@@YAPE$AAVString@Platform@@_NPE$AAVObject@3@@Z @@ -372,8 +357,8 @@ @ stub -arch=win64 ?get@HasInverse@Matrix3D@Media3D@Media@Xaml@UI@Windows@@QEAA_NXZ @ stub -arch=win32 ??0InvalidArgumentException@Platform@@Q$AAA@P$AAVString@1@@Z @ stub -arch=win64 ??0InvalidArgumentException@Platform@@QE$AAA@PE$AAVString@1@@Z -@ stub -arch=win32 ?get@Message@Exception@Platform@@Q$AAAP$AAVString@3@XZ -@ stub -arch=win64 ?get@Message@Exception@Platform@@QE$AAAPE$AAVString@3@XZ +@ cdecl -arch=win32 ?get@Message@Exception@Platform@@Q$AAAP$AAVString@3@XZ(ptr) platform_exception_get_Message +@ cdecl -arch=win64 ?get@Message@Exception@Platform@@QE$AAAPE$AAVString@3@XZ(ptr) platform_exception_get_Message @ stub ?get@ObjectCount@Heap@Details@Platform@@SAHXZ @ stub -arch=win32 ?get@Right@Rect@Foundation@Windows@@QAAMXZ @ stub -arch=win64 ?get@Right@Rect@Foundation@Windows@@QEAAMXZ @@ -507,19 +492,19 @@ @ cdecl -arch=win64 ?Allocate@Heap@Details@Platform@@SAPEAX_K@Z(long) Allocate @ cdecl -arch=win32 ?Allocate@Heap@Details@Platform@@SAPAXII@Z(long long) AllocateWithWeakRef @ cdecl -arch=win64 ?Allocate@Heap@Details@Platform@@SAPEAX_K0@Z(long long) AllocateWithWeakRef -@ stub -arch=win32 ?AllocateException@Heap@Details@Platform@@SAPAXI@Z -@ stub -arch=win64 ?AllocateException@Heap@Details@Platform@@SAPEAX_K0@Z -@ stub -arch=win32 ?AllocateException@Heap@Details@Platform@@SAPAXII@Z -@ stub -arch=win64 ?AllocateException@Heap@Details@Platform@@SAPEAX_K@Z +@ cdecl -arch=win32 ?AllocateException@Heap@Details@Platform@@SAPAXI@Z(long) AllocateException +@ cdecl -arch=win64 ?AllocateException@Heap@Details@Platform@@SAPEAX_K0@Z(long long) AllocateExceptionWithWeakRef +@ cdecl -arch=win32 ?AllocateException@Heap@Details@Platform@@SAPAXII@Z(long long) AllocateExceptionWithWeakRef +@ cdecl -arch=win64 ?AllocateException@Heap@Details@Platform@@SAPEAX_K@Z(long) AllocateException @ stub ?Compare@Duration@Xaml@UI@Windows@@SAHV1234@0@Z @ stub -arch=win32 ??0COMException@Platform@@Q$AAA@HP$AAVString@1@@Z @ stub -arch=win64 ??0COMException@Platform@@QE$AAA@HPE$AAVString@1@@Z @ stub -arch=win32 ?Contains@Rect@Foundation@Windows@@QAA_NVPoint@23@@Z @ stub -arch=win64 ?Contains@Rect@Foundation@Windows@@QEAA_NVPoint@23@@Z -@ stub -arch=win32 ?CreateException@Exception@Platform@@SAP$AAV12@H@Z -@ stub -arch=win64 ?CreateException@Exception@Platform@@SAPE$AAV12@H@Z -@ stub -arch=win32 ?CreateException@Exception@Platform@@SAP$AAV12@HP$AAVString@2@@Z -@ stub -arch=win64 ?CreateException@Exception@Platform@@SAPE$AAV12@HPE$AAVString@2@@Z +@ cdecl -arch=win32 ?CreateException@Exception@Platform@@SAP$AAV12@H@Z(long) CreateException +@ cdecl -arch=win64 ?CreateException@Exception@Platform@@SAPE$AAV12@H@Z(long) CreateException +@ cdecl -arch=win32 ?CreateException@Exception@Platform@@SAP$AAV12@HP$AAVString@2@@Z(long ptr) CreateExceptionWithMessage +@ cdecl -arch=win64 ?CreateException@Exception@Platform@@SAPE$AAV12@HPE$AAVString@2@@Z(long ptr) CreateExceptionWithMessage @ stdcall -arch=i386 ?CreateValue@Details@Platform@@YGP$AAVObject@2@W4TypeCode@2@PBX@Z(long ptr) CreateValue @ stdcall -arch=arm ?CreateValue@Details@Platform@@YAP$AAVObject@2@W4TypeCode@2@PBX@Z(long ptr) CreateValue @ stdcall -arch=win64 ?CreateValue@Details@Platform@@YAPE$AAVObject@2@W4TypeCode@2@PEBX@Z(long ptr) CreateValue