For React Native.
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)
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 6e2fa60b55f..7c8d7c55232 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -403,6 +403,7 @@ struct property_value IReference_INT32 int32_iface; IReference_UINT32 uint32_iface; IReference_INT64 int64_iface; + IReference_UINT64 uint64_iface; IReference_boolean boolean_iface; IReference_FLOAT float_iface; IReference_DOUBLE double_iface; @@ -500,6 +501,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.int64_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_UINT64) && impl->type == PropertyType_UInt64) + { + IReference_UINT64_AddRef(&impl->irefs.uint64_iface); + *out = &impl->irefs.uint64_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_boolean) && impl->type == PropertyType_Boolean) { IReference_boolean_AddRef(&impl->irefs.boolean_iface); @@ -1046,6 +1053,31 @@ static const struct IReference_INT64Vtbl iref_int64_vtbl = iref_int64_get_Value, };
+DEFINE_IINSPECTABLE_(iref_uint64, IReference_UINT64, struct property_value, + impl_from_IReference_UINT64, irefs.uint64_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_uint64_get_Value(IReference_UINT64 *iface, UINT64 *value) +{ + struct property_value *impl = impl_from_IReference_UINT64(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetUInt64(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_UINT64Vtbl iref_uint64_vtbl = +{ + iref_uint64_QueryInterface, + iref_uint64_AddRef, + iref_uint64_Release, + /* IInspectable methods */ + iref_uint64_GetIids, + iref_uint64_GetRuntimeClassName, + iref_uint64_GetTrustLevel, + /* IReference<UINT64> methods */ + iref_uint64_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_boolean, IReference_boolean, struct property_value, impl_from_IReference_boolean, irefs.boolean_iface, &impl->IPropertyValue_iface);
@@ -1231,7 +1263,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt64(IPropertyVa UINT64 value, IInspectable **property_value) { TRACE("iface %p, value %I64u, property_value %p.\n", iface, value, property_value); - return create_primitive_property_value(PropertyType_UInt64); + create_primitive_property_value_iref(PropertyType_UInt64, irefs.uint64_iface.lpVtbl, iref_uint64_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateSingle(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 4cebe43aaa7..9f8358a1157 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -741,6 +741,7 @@ static void test_IPropertyValueStatics(void) IReference_INT32 *iref_int32; IReference_UINT32 *iref_uint32; IReference_INT64 *iref_int64; + IReference_UINT64 *iref_uint64; IReference_boolean *iref_boolean; IReference_HSTRING *iref_hstring; IReference_FLOAT *iref_float; @@ -755,6 +756,7 @@ static void test_IPropertyValueStatics(void) INT32 ret_int32; UINT32 ret_uint32; INT64 ret_int64; + UINT64 ret_uint64; FLOAT ret_float; DOUBLE ret_double; GUID ret_guid; @@ -1014,6 +1016,7 @@ static void test_IPropertyValueStatics(void) 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(UInt64, IReference_UINT64, uint64_value, iref_uint64, ret_uint64) 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)
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 7c8d7c55232..c4baca200b7 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -407,6 +407,7 @@ struct property_value IReference_boolean boolean_iface; IReference_FLOAT float_iface; IReference_DOUBLE double_iface; + IReference_DateTime datetime_iface; IReference_GUID guid_iface; IReference_HSTRING hstring_iface; } irefs; @@ -525,6 +526,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.double_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_DateTime) && impl->type == PropertyType_DateTime) + { + IReference_DateTime_AddRef(&impl->irefs.datetime_iface); + *out = &impl->irefs.datetime_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_GUID) && impl->type == PropertyType_Guid) { IReference_GUID_AddRef(&impl->irefs.guid_iface); @@ -1178,6 +1185,31 @@ static const struct IReference_DOUBLEVtbl iref_double_vtbl = iref_double_get_Value, };
+DEFINE_IINSPECTABLE_(iref_datetime, IReference_DateTime, struct property_value, + impl_from_IReference_DateTime, irefs.datetime_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_datetime_get_Value(IReference_DateTime *iface, DateTime *value) +{ + struct property_value *impl = impl_from_IReference_DateTime(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetDateTime(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_DateTimeVtbl iref_datetime_vtbl = +{ + iref_datetime_QueryInterface, + iref_datetime_AddRef, + iref_datetime_Release, + /* IInspectable methods */ + iref_datetime_GetIids, + iref_datetime_GetRuntimeClassName, + iref_datetime_GetTrustLevel, + /* IReference<DateTime> methods */ + iref_datetime_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_guid, IReference_GUID, struct property_value, impl_from_IReference_GUID, irefs.guid_iface, &impl->IPropertyValue_iface);
@@ -1319,7 +1351,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateDateTime(IProperty DateTime value, IInspectable **property_value) { TRACE("iface %p, value %I64d, property_value %p.\n", iface, value.UniversalTime, property_value); - return create_primitive_property_value(PropertyType_DateTime); + create_primitive_property_value_iref(PropertyType_DateTime, irefs.datetime_iface.lpVtbl, iref_datetime_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateTimeSpan(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 9f8358a1157..e09354e80f6 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -746,6 +746,7 @@ static void test_IPropertyValueStatics(void) IReference_HSTRING *iref_hstring; IReference_FLOAT *iref_float; IReference_DOUBLE *iref_double; + IReference_DateTime *iref_datetime; IReference_GUID *iref_guid; IPropertyValue *value = NULL; enum PropertyType type; @@ -759,6 +760,7 @@ static void test_IPropertyValueStatics(void) UINT64 ret_uint64; FLOAT ret_float; DOUBLE ret_double; + struct DateTime ret_datetime; GUID ret_guid; boolean ret; HRESULT hr; @@ -1021,6 +1023,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(DateTime, IReference_DateTime, datetime_value, iref_datetime, ret_datetime) 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 c4baca200b7..edda8e63357 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -409,6 +409,7 @@ struct property_value IReference_DOUBLE double_iface; IReference_DateTime datetime_iface; IReference_GUID guid_iface; + IReference_Point point_iface; IReference_HSTRING hstring_iface; } irefs; PropertyType type; @@ -538,6 +539,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.guid_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_Point) && impl->type == PropertyType_Point) + { + IReference_Point_AddRef(&impl->irefs.point_iface); + *out = &impl->irefs.point_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_HSTRING) && impl->type == PropertyType_String) { IReference_HSTRING_AddRef(&impl->irefs.hstring_iface); @@ -1235,6 +1242,31 @@ static const struct IReference_GUIDVtbl iref_guid_vtbl = iref_guid_get_Value, };
+DEFINE_IINSPECTABLE_(iref_point, IReference_Point, struct property_value, + impl_from_IReference_Point, irefs.point_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_point_get_Value(IReference_Point *iface, Point *value) +{ + struct property_value *impl = impl_from_IReference_Point(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetPoint(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_PointVtbl iref_point_vtbl = +{ + iref_point_QueryInterface, + iref_point_AddRef, + iref_point_Release, + /* IInspectable methods */ + iref_point_GetIids, + iref_point_GetRuntimeClassName, + iref_point_GetTrustLevel, + /* IReference<Point> methods */ + iref_point_get_Value, +}; + DEFINE_IINSPECTABLE(property_value_statics, IPropertyValueStatics, struct property_value_statics, IActivationFactory_iface)
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateEmpty(IPropertyValueStatics *iface, @@ -1365,7 +1397,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreatePoint(IPropertyVal Point value, IInspectable **property_value) { TRACE("iface %p, value (%f, %f), property_value %p.\n", iface, value.X, value.Y, property_value); - return create_primitive_property_value(PropertyType_Point); + create_primitive_property_value_iref(PropertyType_Point, irefs.point_iface.lpVtbl, iref_point_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateSize(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index e09354e80f6..0f1ef5d45b1 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -748,6 +748,7 @@ static void test_IPropertyValueStatics(void) IReference_DOUBLE *iref_double; IReference_DateTime *iref_datetime; IReference_GUID *iref_guid; + IReference_Point *iref_point; IPropertyValue *value = NULL; enum PropertyType type; unsigned int i, count; @@ -762,6 +763,7 @@ static void test_IPropertyValueStatics(void) DOUBLE ret_double; struct DateTime ret_datetime; GUID ret_guid; + struct Point ret_point; boolean ret; HRESULT hr;
@@ -1025,6 +1027,7 @@ static void test_IPropertyValueStatics(void) TEST_PROPERTY_VALUE_IREFERENCE(Double, IReference_DOUBLE, double_value, iref_double, ret_double) TEST_PROPERTY_VALUE_IREFERENCE(DateTime, IReference_DateTime, datetime_value, iref_datetime, ret_datetime) TEST_PROPERTY_VALUE_IREFERENCE(Guid, IReference_GUID, IID_IPropertyValue, iref_guid, ret_guid) + TEST_PROPERTY_VALUE_IREFERENCE(Point, IReference_Point, point_value, iref_point, ret_point)
#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 edda8e63357..4d16e8b21a5 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -410,6 +410,7 @@ struct property_value IReference_DateTime datetime_iface; IReference_GUID guid_iface; IReference_Point point_iface; + IReference_Rect rect_iface; IReference_HSTRING hstring_iface; } irefs; PropertyType type; @@ -545,6 +546,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.point_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_Rect) && impl->type == PropertyType_Rect) + { + IReference_Rect_AddRef(&impl->irefs.rect_iface); + *out = &impl->irefs.rect_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_HSTRING) && impl->type == PropertyType_String) { IReference_HSTRING_AddRef(&impl->irefs.hstring_iface); @@ -1267,6 +1274,31 @@ static const struct IReference_PointVtbl iref_point_vtbl = iref_point_get_Value, };
+DEFINE_IINSPECTABLE_(iref_rect, IReference_Rect, struct property_value, + impl_from_IReference_Rect, irefs.rect_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_rect_get_Value(IReference_Rect *iface, Rect *value) +{ + struct property_value *impl = impl_from_IReference_Rect(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetRect(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_RectVtbl iref_rect_vtbl = +{ + iref_rect_QueryInterface, + iref_rect_AddRef, + iref_rect_Release, + /* IInspectable methods */ + iref_rect_GetIids, + iref_rect_GetRuntimeClassName, + iref_rect_GetTrustLevel, + /* IReference<Rect> methods */ + iref_rect_get_Value, +}; + DEFINE_IINSPECTABLE(property_value_statics, IPropertyValueStatics, struct property_value_statics, IActivationFactory_iface)
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateEmpty(IPropertyValueStatics *iface, @@ -1412,7 +1444,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateRect(IPropertyValu { TRACE("iface %p, value (%f, %f %fx%f), property_value %p.\n", iface, value.X, value.Y, value.Width, value.Height, property_value); - return create_primitive_property_value(PropertyType_Rect); + create_primitive_property_value_iref(PropertyType_Rect, irefs.rect_iface.lpVtbl, iref_rect_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateUInt8Array(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 0f1ef5d45b1..be2265ddc71 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -749,6 +749,7 @@ static void test_IPropertyValueStatics(void) IReference_DateTime *iref_datetime; IReference_GUID *iref_guid; IReference_Point *iref_point; + IReference_Rect *iref_rect; IPropertyValue *value = NULL; enum PropertyType type; unsigned int i, count; @@ -764,6 +765,7 @@ static void test_IPropertyValueStatics(void) struct DateTime ret_datetime; GUID ret_guid; struct Point ret_point; + struct Rect ret_rect; boolean ret; HRESULT hr;
@@ -1028,6 +1030,7 @@ static void test_IPropertyValueStatics(void) TEST_PROPERTY_VALUE_IREFERENCE(DateTime, IReference_DateTime, datetime_value, iref_datetime, ret_datetime) TEST_PROPERTY_VALUE_IREFERENCE(Guid, IReference_GUID, IID_IPropertyValue, iref_guid, ret_guid) TEST_PROPERTY_VALUE_IREFERENCE(Point, IReference_Point, point_value, iref_point, ret_point) + TEST_PROPERTY_VALUE_IREFERENCE(Rect, IReference_Rect, rect_value, iref_rect, ret_rect)
#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 4d16e8b21a5..697e896f10e 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -410,6 +410,7 @@ struct property_value IReference_DateTime datetime_iface; IReference_GUID guid_iface; IReference_Point point_iface; + IReference_Size size_iface; IReference_Rect rect_iface; IReference_HSTRING hstring_iface; } irefs; @@ -546,6 +547,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.point_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_Size) && impl->type == PropertyType_Size) + { + IReference_Size_AddRef(&impl->irefs.size_iface); + *out = &impl->irefs.size_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_Rect) && impl->type == PropertyType_Rect) { IReference_Rect_AddRef(&impl->irefs.rect_iface); @@ -1274,6 +1281,31 @@ static const struct IReference_PointVtbl iref_point_vtbl = iref_point_get_Value, };
+DEFINE_IINSPECTABLE_(iref_size, IReference_Size, struct property_value, + impl_from_IReference_Size, irefs.size_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_size_get_Value(IReference_Size *iface, Size *value) +{ + struct property_value *impl = impl_from_IReference_Size(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetSize(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_SizeVtbl iref_size_vtbl = +{ + iref_size_QueryInterface, + iref_size_AddRef, + iref_size_Release, + /* IInspectable methods */ + iref_size_GetIids, + iref_size_GetRuntimeClassName, + iref_size_GetTrustLevel, + /* IReference<Size> methods */ + iref_size_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_rect, IReference_Rect, struct property_value, impl_from_IReference_Rect, irefs.rect_iface, &impl->IPropertyValue_iface);
@@ -1436,7 +1468,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateSize(IPropertyValu Size value, IInspectable **property_value) { TRACE("iface %p, value (%fx%f), property_value %p.\n", iface, value.Width, value.Height, property_value); - return create_primitive_property_value(PropertyType_Size); + create_primitive_property_value_iref(PropertyType_Size, irefs.size_iface.lpVtbl, iref_size_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreateRect(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index be2265ddc71..d4a07e01331 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -749,6 +749,7 @@ static void test_IPropertyValueStatics(void) IReference_DateTime *iref_datetime; IReference_GUID *iref_guid; IReference_Point *iref_point; + IReference_Size *iref_size; IReference_Rect *iref_rect; IPropertyValue *value = NULL; enum PropertyType type; @@ -765,6 +766,7 @@ static void test_IPropertyValueStatics(void) struct DateTime ret_datetime; GUID ret_guid; struct Point ret_point; + struct Size ret_size; struct Rect ret_rect; boolean ret; HRESULT hr; @@ -1030,6 +1032,7 @@ static void test_IPropertyValueStatics(void) TEST_PROPERTY_VALUE_IREFERENCE(DateTime, IReference_DateTime, datetime_value, iref_datetime, ret_datetime) TEST_PROPERTY_VALUE_IREFERENCE(Guid, IReference_GUID, IID_IPropertyValue, iref_guid, ret_guid) TEST_PROPERTY_VALUE_IREFERENCE(Point, IReference_Point, point_value, iref_point, ret_point) + TEST_PROPERTY_VALUE_IREFERENCE(Size, IReference_Size, size_value, iref_size, ret_size) TEST_PROPERTY_VALUE_IREFERENCE(Rect, IReference_Rect, rect_value, iref_rect, ret_rect)
#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 697e896f10e..cb0a9b6fab0 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -408,6 +408,7 @@ struct property_value IReference_FLOAT float_iface; IReference_DOUBLE double_iface; IReference_DateTime datetime_iface; + IReference_TimeSpan timespan_iface; IReference_GUID guid_iface; IReference_Point point_iface; IReference_Size size_iface; @@ -535,6 +536,12 @@ static HRESULT STDMETHODCALLTYPE property_value_QueryInterface(IPropertyValue *i *out = &impl->irefs.datetime_iface; return S_OK; } + else if (IsEqualIID(riid, &IID_IReference_TimeSpan) && impl->type == PropertyType_TimeSpan) + { + IReference_TimeSpan_AddRef(&impl->irefs.timespan_iface); + *out = &impl->irefs.timespan_iface; + return S_OK; + } else if (IsEqualIID(riid, &IID_IReference_GUID) && impl->type == PropertyType_Guid) { IReference_GUID_AddRef(&impl->irefs.guid_iface); @@ -1231,6 +1238,31 @@ static const struct IReference_DateTimeVtbl iref_datetime_vtbl = iref_datetime_get_Value, };
+DEFINE_IINSPECTABLE_(iref_timespan, IReference_TimeSpan, struct property_value, + impl_from_IReference_TimeSpan, irefs.timespan_iface, &impl->IPropertyValue_iface); + +static HRESULT STDMETHODCALLTYPE iref_timespan_get_Value(IReference_TimeSpan *iface, TimeSpan *value) +{ + struct property_value *impl = impl_from_IReference_TimeSpan(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + return property_value_GetTimeSpan(&impl->IPropertyValue_iface, value); +} + +static const struct IReference_TimeSpanVtbl iref_timespan_vtbl = +{ + iref_timespan_QueryInterface, + iref_timespan_AddRef, + iref_timespan_Release, + /* IInspectable methods */ + iref_timespan_GetIids, + iref_timespan_GetRuntimeClassName, + iref_timespan_GetTrustLevel, + /* IReference<TimeSpan> methods */ + iref_timespan_get_Value, +}; + DEFINE_IINSPECTABLE_(iref_guid, IReference_GUID, struct property_value, impl_from_IReference_GUID, irefs.guid_iface, &impl->IPropertyValue_iface);
@@ -1454,7 +1486,7 @@ static HRESULT STDMETHODCALLTYPE property_value_statics_CreateTimeSpan(IProperty TimeSpan value, IInspectable **property_value) { TRACE("iface %p, value %I64d, property_value %p.\n", iface, value.Duration, property_value); - return create_primitive_property_value(PropertyType_TimeSpan); + create_primitive_property_value_iref(PropertyType_TimeSpan, irefs.timespan_iface.lpVtbl, iref_timespan_vtbl); }
static HRESULT STDMETHODCALLTYPE property_value_statics_CreatePoint(IPropertyValueStatics *iface, diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index d4a07e01331..1ab3f4b9af8 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -747,6 +747,7 @@ static void test_IPropertyValueStatics(void) IReference_FLOAT *iref_float; IReference_DOUBLE *iref_double; IReference_DateTime *iref_datetime; + IReference_TimeSpan *iref_timespan; IReference_GUID *iref_guid; IReference_Point *iref_point; IReference_Size *iref_size; @@ -764,6 +765,7 @@ static void test_IPropertyValueStatics(void) FLOAT ret_float; DOUBLE ret_double; struct DateTime ret_datetime; + struct TimeSpan ret_timespan; GUID ret_guid; struct Point ret_point; struct Size ret_size; @@ -1030,6 +1032,7 @@ static void test_IPropertyValueStatics(void) 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(DateTime, IReference_DateTime, datetime_value, iref_datetime, ret_datetime) + TEST_PROPERTY_VALUE_IREFERENCE(TimeSpan, IReference_TimeSpan, timespan_value, iref_timespan, ret_timespan) TEST_PROPERTY_VALUE_IREFERENCE(Guid, IReference_GUID, IID_IPropertyValue, iref_guid, ret_guid) TEST_PROPERTY_VALUE_IREFERENCE(Point, IReference_Point, point_value, iref_point, ret_point) TEST_PROPERTY_VALUE_IREFERENCE(Size, IReference_Size, size_value, iref_size, ret_size)