For React Native.
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/tests/wintypes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 0c9ca1a9ccb..5ec536b49f8 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -996,9 +996,9 @@ static void test_IPropertyValueStatics(void) IInspectable_Release(inspectable); \ } while (0);
- TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, TRUE, iref_boolean, ret) + TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, boolean_value, iref_boolean, ret) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str) - TEST_PROPERTY_VALUE_IREFERENCE(Double, IReference_DOUBLE, 1.5, iref_double, ret_double) + TEST_PROPERTY_VALUE_IREFERENCE(Double, IReference_DOUBLE, double_value, iref_double, ret_double)
#undef TEST_PROPERTY_VALUE_IREFERENCE
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/main.c | 36 ++++++++++++++++++++++++++++++++-- dlls/wintypes/tests/wintypes.c | 3 +++ 2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index e5ed6d3b335..c27d8964d80 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 Zhiyi Zhang for CodeWeavers + * Copyright 2022-2025 Zhiyi Zhang for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -398,6 +398,7 @@ struct property_value IPropertyValue IPropertyValue_iface; union { + IReference_UINT32 uint32_iface; IReference_boolean boolean_iface; IReference_DOUBLE double_iface; IReference_HSTRING hstring_iface; @@ -463,6 +464,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->IPropertyValue_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_UINT32) && impl->type == PropertyType_UInt32) + { + IReference_UINT32_AddRef(&impl->irefs.uint32_iface); + *out = &impl->irefs.uint32_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_boolean) && impl->type == PropertyType_Boolean) { IReference_boolean_AddRef(&impl->irefs.boolean_iface); @@ -872,6 +879,31 @@ static HRESULT _create_primitive_property_value(PropertyType type, void *value, return hr; \ } while (0)
+DEFINE_IINSPECTABLE_(iref_uint32, IReference_UINT32, struct property_value, + impl_from_IReference_UINT32, irefs.uint32_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_uint32_get_Value(IReference_UINT32 *iface, UINT32 *value) +{ + struct property_value *impl = impl_from_IReference_UINT32(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetUInt32(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_UINT32Vtbl iref_uint32_vtbl = +{ + iref_uint32_QueryInterface, + iref_uint32_AddRef, + iref_uint32_Release, + /* IInspectable methods */ + iref_uint32_GetIids, + iref_uint32_GetRuntimeClassName, + iref_uint32_GetTrustLevel, + /* IReference<UINT32> methods */ + iref_uint32_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_boolean, IReference_boolean, struct property_value, impl_from_IReference_boolean, irefs.boolean_iface, &impl->IPropertyValue_iface);
@@ -993,7 +1025,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt32(IPropertyVa UINT32 value, IInspectable **property_value) { TRACE("iface %p, value %u, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_UInt32); + create_primitive_property_value_iref(PropertyType_UInt32, irefs.uint32_iface.lpVtbl, iref_uint32_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateInt64(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 5ec536b49f8..a0d293c692e 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -736,6 +736,7 @@ static void test_IPropertyValueStatics(void) IInspectable *inspectable = NULL, *tmp_inspectable = NULL; IPropertyValueStatics *statics = NULL; IActivationFactory *factory = NULL; + IReference_UINT32 *iref_uint32; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; IReference_DOUBLE *iref_double; @@ -744,6 +745,7 @@ static void test_IPropertyValueStatics(void) unsigned int i, count; BYTE byte, *ptr_byte; HSTRING str, ret_str; + UINT32 ret_uint32; DOUBLE ret_double; boolean ret; HRESULT hr; @@ -996,6 +998,7 @@ static void test_IPropertyValueStatics(void) IInspectable_Release(inspectable); \ } while (0);
+ TEST_PROPERTY_VALUE_IREFERENCE(UInt32, IReference_UINT32, uint32_value, iref_uint32, ret_uint32) TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, boolean_value, iref_boolean, ret) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str) TEST_PROPERTY_VALUE_IREFERENCE(Double, IReference_DOUBLE, double_value, iref_double, ret_double)
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/main.c | 34 +++++++++++++++++++++++++++++++++- dlls/wintypes/tests/wintypes.c | 2 ++ 2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index c27d8964d80..a04ac7706bc 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -398,6 +398,7 @@ struct property_value IPropertyValue IPropertyValue_iface; union { + IReference_BYTE byte_iface; IReference_UINT32 uint32_iface; IReference_boolean boolean_iface; IReference_DOUBLE double_iface; @@ -464,6 +465,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->IPropertyValue_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_BYTE) && impl->type == PropertyType_UInt8) + { + IReference_BYTE_AddRef(&impl->irefs.byte_iface); + *out = &impl->irefs.byte_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_UINT32) && impl->type == PropertyType_UInt32) { IReference_UINT32_AddRef(&impl->irefs.uint32_iface); @@ -879,6 +886,31 @@ static HRESULT _create_primitive_property_value(PropertyType type, void *value, return hr; \ } while (0)
+DEFINE_IINSPECTABLE_(iref_byte, IReference_BYTE, struct property_value, + impl_from_IReference_BYTE, irefs.byte_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_byte_get_Value(IReference_BYTE *iface, UINT8 *value) +{ + struct property_value *impl = impl_from_IReference_BYTE(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetUInt8(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_BYTEVtbl iref_byte_vtbl = +{ + iref_byte_QueryInterface, + iref_byte_AddRef, + iref_byte_Release, + /* IInspectable methods */ + iref_byte_GetIids, + iref_byte_GetRuntimeClassName, + iref_byte_GetTrustLevel, + /* IReference<BYTE> methods */ + iref_byte_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_uint32, IReference_UINT32, struct property_value, impl_from_IReference_UINT32, irefs.uint32_iface, &impl->IPropertyValue_iface);
@@ -997,7 +1029,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt8(IPropertyVal BYTE value, IInspectable **property_value) { TRACE("iface %p, value %#x, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_UInt8); + create_primitive_property_value_iref(PropertyType_UInt8, irefs.byte_iface.lpVtbl, iref_byte_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateInt16(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index a0d293c692e..f4799151df1 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -736,6 +736,7 @@ static void test_IPropertyValueStatics(void) IInspectable *inspectable = NULL, *tmp_inspectable = NULL; IPropertyValueStatics *statics = NULL; IActivationFactory *factory = NULL; + IReference_BYTE *iref_byte; IReference_UINT32 *iref_uint32; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; @@ -998,6 +999,7 @@ static void test_IPropertyValueStatics(void) IInspectable_Release(inspectable); \ } while (0);
+ TEST_PROPERTY_VALUE_IREFERENCE(UInt8, IReference_BYTE, byte_value, iref_byte, byte) TEST_PROPERTY_VALUE_IREFERENCE(UInt32, IReference_UINT32, uint32_value, iref_uint32, ret_uint32) TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, boolean_value, iref_boolean, ret) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str)
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/main.c | 34 +++++++++++++++++++++++++++++++++- dlls/wintypes/tests/wintypes.c | 3 +++ 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index a04ac7706bc..41d58e08b29 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -401,6 +401,7 @@ struct property_value IReference_BYTE byte_iface; IReference_UINT32 uint32_iface; IReference_boolean boolean_iface; + IReference_FLOAT float_iface; IReference_DOUBLE double_iface; IReference_HSTRING hstring_iface; } irefs; @@ -483,6 +484,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.boolean_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_FLOAT) && impl->type == PropertyType_Single) + { + IReference_FLOAT_AddRef(&impl->irefs.float_iface); + *out = &impl->irefs.float_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_DOUBLE) && impl->type == PropertyType_Double) { IReference_DOUBLE_AddRef(&impl->irefs.double_iface); @@ -986,6 +993,31 @@ static const struct IReference_HSTRINGVtbl iref_hstring_vtbl = iref_hstring_get_Value, };
+DEFINE_IINSPECTABLE_(iref_float, IReference_FLOAT, struct property_value, + impl_from_IReference_FLOAT, irefs.float_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_float_get_Value(IReference_FLOAT *iface, FLOAT *value) +{ + struct property_value *impl = impl_from_IReference_FLOAT(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetSingle(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_FLOATVtbl iref_float_vtbl = +{ + iref_float_QueryInterface, + iref_float_AddRef, + iref_float_Release, + /* IInspectable methods */ + iref_float_GetIids, + iref_float_GetRuntimeClassName, + iref_float_GetTrustLevel, + /* IReference<FLOAT> methods */ + iref_float_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_double, IReference_DOUBLE, struct property_value, impl_from_IReference_DOUBLE, irefs.double_iface, &impl->IPropertyValue_iface);
@@ -1078,7 +1110,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateSingle(IPropertyVa FLOAT value, IInspectable **property_value) { TRACE("iface %p, value %f, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_Single); + create_primitive_property_value_iref(PropertyType_Single, irefs.float_iface.lpVtbl, iref_float_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateDouble(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index f4799151df1..acf1e949787 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -740,6 +740,7 @@ static void test_IPropertyValueStatics(void) IReference_UINT32 *iref_uint32; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; + IReference_FLOAT *iref_float; IReference_DOUBLE *iref_double; IPropertyValue *value = NULL; enum PropertyType type; @@ -747,6 +748,7 @@ static void test_IPropertyValueStatics(void) BYTE byte, *ptr_byte; HSTRING str, ret_str; UINT32 ret_uint32; + FLOAT ret_float; DOUBLE ret_double; boolean ret; HRESULT hr; @@ -1003,6 +1005,7 @@ static void test_IPropertyValueStatics(void) TEST_PROPERTY_VALUE_IREFERENCE(UInt32, IReference_UINT32, uint32_value, iref_uint32, ret_uint32) TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, boolean_value, iref_boolean, ret) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str) + TEST_PROPERTY_VALUE_IREFERENCE(Single, IReference_FLOAT, float_value, iref_float, ret_float) TEST_PROPERTY_VALUE_IREFERENCE(Double, IReference_DOUBLE, double_value, iref_double, ret_double)
#undef TEST_PROPERTY_VALUE_IREFERENCE
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/main.c | 34 +++++++++++++++++++++++++++++++++- dlls/wintypes/tests/wintypes.c | 5 ++++- 2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index 41d58e08b29..5b48851e8c7 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -403,6 +403,7 @@ struct property_value IReference_boolean boolean_iface; IReference_FLOAT float_iface; IReference_DOUBLE double_iface; + IReference_GUID guid_iface; IReference_HSTRING hstring_iface; } irefs; PropertyType type; @@ -496,6 +497,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.double_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_GUID) && impl->type == PropertyType_Guid) + { + IReference_GUID_AddRef(&impl->irefs.guid_iface); + *out = &impl->irefs.guid_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_HSTRING) && impl->type == PropertyType_String) { IReference_HSTRING_AddRef(&impl->irefs.hstring_iface); @@ -1043,6 +1050,31 @@ static const struct IReference_DOUBLEVtbl iref_double_vtbl = iref_double_get_Value, };
+DEFINE_IINSPECTABLE_(iref_guid, IReference_GUID, struct property_value, + impl_from_IReference_GUID, irefs.guid_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_guid_get_Value(IReference_GUID *iface, GUID *value) +{ + struct property_value *impl = impl_from_IReference_GUID(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetGuid(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_GUIDVtbl iref_guid_vtbl = +{ + iref_guid_QueryInterface, + iref_guid_AddRef, + iref_guid_Release, + /* IInspectable methods */ + iref_guid_GetIids, + iref_guid_GetRuntimeClassName, + iref_guid_GetTrustLevel, + /* IReference<GUID> methods */ + iref_guid_get_Value, +}; + DEFINE_IINSPECTABLE(property_value_statics, IPropertyValueStatics, struct property_value_statics, IActivationFactory_iface)
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateEmpty(IPropertyValueStatics *iface, @@ -1152,7 +1184,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateGuid(IPropertyValu GUID value, IInspectable **property_value) { TRACE("iface %p, value %s, property_value %p.\n", iface, wine_dbgstr_guid(&value), property_value); - return create_primitive_property_value(PropertyType_Guid); + create_primitive_property_value_iref(PropertyType_Guid, irefs.guid_iface.lpVtbl, iref_guid_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateDateTime(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index acf1e949787..4f5541858df 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -742,6 +742,7 @@ static void test_IPropertyValueStatics(void) IReference_HSTRING *iref_hstring; IReference_FLOAT *iref_float; IReference_DOUBLE *iref_double; + IReference_GUID *iref_guid; IPropertyValue *value = NULL; enum PropertyType type; unsigned int i, count; @@ -750,6 +751,7 @@ static void test_IPropertyValueStatics(void) UINT32 ret_uint32; FLOAT ret_float; DOUBLE ret_double; + GUID ret_guid; boolean ret; HRESULT hr;
@@ -994,7 +996,7 @@ static void test_IPropertyValueStatics(void) \ hr = IFACE_TYPE##_get_Value(RET_OBJ, &RET_VALUE); \ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); \ - ok(RET_VALUE == VALUE, "Got unexpected value.\n"); \ + ok(!memcmp(&RET_VALUE, &VALUE, sizeof(VALUE)), "Got unexpected value.\n"); \ \ IFACE_TYPE##_Release(RET_OBJ); \ IPropertyValue_Release(value); \ @@ -1007,6 +1009,7 @@ static void test_IPropertyValueStatics(void) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str) TEST_PROPERTY_VALUE_IREFERENCE(Single, IReference_FLOAT, float_value, iref_float, ret_float) TEST_PROPERTY_VALUE_IREFERENCE(Double, IReference_DOUBLE, double_value, iref_double, ret_double) + TEST_PROPERTY_VALUE_IREFERENCE(Guid, IReference_GUID, IID_IPropertyValue, iref_guid, ret_guid)
#undef TEST_PROPERTY_VALUE_IREFERENCE
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/main.c | 34 +++++++++++++++++++++++++++++++++- dlls/wintypes/tests/wintypes.c | 3 +++ 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index 5b48851e8c7..eaf5b776bc4 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -399,6 +399,7 @@ struct property_value union { IReference_BYTE byte_iface; + IReference_INT16 int16_iface; IReference_UINT32 uint32_iface; IReference_boolean boolean_iface; IReference_FLOAT float_iface; @@ -473,6 +474,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.byte_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_INT16) && impl->type == PropertyType_Int16) + { + IReference_INT16_AddRef(&impl->irefs.int16_iface); + *out = &impl->irefs.int16_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_UINT32) && impl->type == PropertyType_UInt32) { IReference_UINT32_AddRef(&impl->irefs.uint32_iface); @@ -925,6 +932,31 @@ static const struct IReference_BYTEVtbl iref_byte_vtbl = iref_byte_get_Value, };
+DEFINE_IINSPECTABLE_(iref_int16, IReference_INT16, struct property_value, + impl_from_IReference_INT16, irefs.int16_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_int16_get_Value(IReference_INT16 *iface, INT16 *value) +{ + struct property_value *impl = impl_from_IReference_INT16(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetInt16(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_INT16Vtbl iref_int16_vtbl = +{ + iref_int16_QueryInterface, + iref_int16_AddRef, + iref_int16_Release, + /* IInspectable methods */ + iref_int16_GetIids, + iref_int16_GetRuntimeClassName, + iref_int16_GetTrustLevel, + /* IReference<INT16> methods */ + iref_int16_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_uint32, IReference_UINT32, struct property_value, impl_from_IReference_UINT32, irefs.uint32_iface, &impl->IPropertyValue_iface);
@@ -1100,7 +1132,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateInt16(IPropertyVal INT16 value, IInspectable **property_value) { TRACE("iface %p, value %d, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_Int16); + create_primitive_property_value_iref(PropertyType_Int16, irefs.int16_iface.lpVtbl, iref_int16_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt16(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 4f5541858df..baf982b7833 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -737,6 +737,7 @@ static void test_IPropertyValueStatics(void) IPropertyValueStatics *statics = NULL; IActivationFactory *factory = NULL; IReference_BYTE *iref_byte; + IReference_INT16 *iref_int16; IReference_UINT32 *iref_uint32; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; @@ -748,6 +749,7 @@ static void test_IPropertyValueStatics(void) unsigned int i, count; BYTE byte, *ptr_byte; HSTRING str, ret_str; + INT16 ret_int16; UINT32 ret_uint32; FLOAT ret_float; DOUBLE ret_double; @@ -1004,6 +1006,7 @@ static void test_IPropertyValueStatics(void) } while (0);
TEST_PROPERTY_VALUE_IREFERENCE(UInt8, IReference_BYTE, byte_value, iref_byte, byte) + TEST_PROPERTY_VALUE_IREFERENCE(Int16, IReference_INT16, int16_value, iref_int16, ret_int16) TEST_PROPERTY_VALUE_IREFERENCE(UInt32, IReference_UINT32, uint32_value, iref_uint32, ret_uint32) TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, boolean_value, iref_boolean, ret) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str)
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/wintypes/main.c | 34 +++++++++++++++++++++++++++++++++- dlls/wintypes/tests/wintypes.c | 3 +++ 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index eaf5b776bc4..acfa2878c66 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -400,6 +400,7 @@ struct property_value { IReference_BYTE byte_iface; IReference_INT16 int16_iface; + IReference_INT32 int32_iface; IReference_UINT32 uint32_iface; IReference_boolean boolean_iface; IReference_FLOAT float_iface; @@ -480,6 +481,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.int16_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_INT32) && impl->type == PropertyType_Int32) + { + IReference_INT32_AddRef(&impl->irefs.int32_iface); + *out = &impl->irefs.int32_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_UINT32) && impl->type == PropertyType_UInt32) { IReference_UINT32_AddRef(&impl->irefs.uint32_iface); @@ -957,6 +964,31 @@ static const struct IReference_INT16Vtbl iref_int16_vtbl = iref_int16_get_Value, };
+DEFINE_IINSPECTABLE_(iref_int32, IReference_INT32, struct property_value, + impl_from_IReference_INT32, irefs.int32_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_int32_get_Value(IReference_INT32 *iface, INT32 *value) +{ + struct property_value *impl = impl_from_IReference_INT32(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetInt32(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_INT32Vtbl iref_int32_vtbl = +{ + iref_int32_QueryInterface, + iref_int32_AddRef, + iref_int32_Release, + /* IInspectable methods */ + iref_int32_GetIids, + iref_int32_GetRuntimeClassName, + iref_int32_GetTrustLevel, + /* IReference<INT32> methods */ + iref_int32_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_uint32, IReference_UINT32, struct property_value, impl_from_IReference_UINT32, irefs.uint32_iface, &impl->IPropertyValue_iface);
@@ -1146,7 +1178,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateInt32(IPropertyVal INT32 value, IInspectable **property_value) { TRACE("iface %p, value %d, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_Int32); + create_primitive_property_value_iref(PropertyType_Int32, irefs.int32_iface.lpVtbl, iref_int32_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt32(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index baf982b7833..6dcdfd6d801 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -738,6 +738,7 @@ static void test_IPropertyValueStatics(void) IActivationFactory *factory = NULL; IReference_BYTE *iref_byte; IReference_INT16 *iref_int16; + IReference_INT32 *iref_int32; IReference_UINT32 *iref_uint32; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; @@ -750,6 +751,7 @@ static void test_IPropertyValueStatics(void) BYTE byte, *ptr_byte; HSTRING str, ret_str; INT16 ret_int16; + INT32 ret_int32; UINT32 ret_uint32; FLOAT ret_float; DOUBLE ret_double; @@ -1007,6 +1009,7 @@ static void test_IPropertyValueStatics(void)
TEST_PROPERTY_VALUE_IREFERENCE(UInt8, IReference_BYTE, byte_value, iref_byte, byte) TEST_PROPERTY_VALUE_IREFERENCE(Int16, IReference_INT16, int16_value, iref_int16, ret_int16) + TEST_PROPERTY_VALUE_IREFERENCE(Int32, IReference_INT32, int32_value, iref_int32, ret_int32) TEST_PROPERTY_VALUE_IREFERENCE(UInt32, IReference_UINT32, uint32_value, iref_uint32, ret_uint32) TEST_PROPERTY_VALUE_IREFERENCE(Boolean, IReference_boolean, boolean_value, iref_boolean, ret) TEST_PROPERTY_VALUE_IREFERENCE(String, IReference_HSTRING, str, iref_hstring, ret_str)