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 acfa2878c66..6e2fa60b55f 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -402,6 +402,7 @@ struct property_value IReference_INT16 int16_iface; IReference_INT32 int32_iface; IReference_UINT32 uint32_iface; + IReference_INT64 int64_iface; IReference_boolean boolean_iface; IReference_FLOAT float_iface; IReference_DOUBLE double_iface; @@ -493,6 +494,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.uint32_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_INT64) && impl->type == PropertyType_Int64) + { + IReference_INT64_AddRef(&impl->irefs.int64_iface); + *out = &impl->irefs.int64_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_boolean) && impl->type == PropertyType_Boolean) { IReference_boolean_AddRef(&impl->irefs.boolean_iface); @@ -1014,6 +1021,31 @@ static const struct IReference_UINT32Vtbl iref_uint32_vtbl = iref_uint32_get_Value, };
+DEFINE_IINSPECTABLE_(iref_int64, IReference_INT64, struct property_value, + impl_from_IReference_INT64, irefs.int64_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_int64_get_Value(IReference_INT64 *iface, INT64 *value) +{ + struct property_value *impl = impl_from_IReference_INT64(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetInt64(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_INT64Vtbl iref_int64_vtbl = +{ + iref_int64_QueryInterface, + iref_int64_AddRef, + iref_int64_Release, + /* IInspectable methods */ + iref_int64_GetIids, + iref_int64_GetRuntimeClassName, + iref_int64_GetTrustLevel, + /* IReference<INT64> methods */ + iref_int64_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_boolean, IReference_boolean, struct property_value, impl_from_IReference_boolean, irefs.boolean_iface, &impl->IPropertyValue_iface);
@@ -1192,7 +1224,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateInt64(IPropertyVal INT64 value, IInspectable **property_value) { TRACE("iface %p, value %I64d, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_Int64); + create_primitive_property_value_iref(PropertyType_Int64, irefs.int64_iface.lpVtbl, iref_int64_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt64(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 6dcdfd6d801..4cebe43aaa7 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -740,6 +740,7 @@ static void test_IPropertyValueStatics(void) IReference_INT16 *iref_int16; IReference_INT32 *iref_int32; IReference_UINT32 *iref_uint32; + IReference_INT64 *iref_int64; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; IReference_FLOAT *iref_float; @@ -753,6 +754,7 @@ static void test_IPropertyValueStatics(void) INT16 ret_int16; INT32 ret_int32; UINT32 ret_uint32; + INT64 ret_int64; FLOAT ret_float; DOUBLE ret_double; GUID ret_guid; @@ -1011,6 +1013,7 @@ static void test_IPropertyValueStatics(void) 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(Int64, IReference_INT64, int64_value, iref_int64, ret_int64) 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)