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)