From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.web/json_value.c | 12 ++++++++++-- dlls/windows.web/tests/web.c | 5 ----- 2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/windows.web/json_value.c b/dlls/windows.web/json_value.c index 87b3365f199..dfd3820b915 100644 --- a/dlls/windows.web/json_value.c +++ b/dlls/windows.web/json_value.c @@ -120,6 +120,7 @@ struct json_value IJsonValue IJsonValue_iface; LONG ref;
+ JsonValueType json_value_type; HSTRING string_value; };
@@ -192,8 +193,14 @@ static HRESULT WINAPI json_value_GetTrustLevel( IJsonValue *iface, TrustLevel *t
static HRESULT WINAPI json_value_get_ValueType( IJsonValue *iface, JsonValueType *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + struct json_value *impl = impl_from_IJsonValue( iface ); + + TRACE( "iface %p, value %p\n", iface, value ); + + if (!value) return E_POINTER; + + *value = impl->json_value_type; + return S_OK; }
static HRESULT WINAPI json_value_Stringify( IJsonValue *iface, HSTRING *value ) @@ -289,6 +296,7 @@ static HRESULT WINAPI json_value_statics_CreateStringValue( IJsonValueStatics *i
impl->IJsonValue_iface.lpVtbl = &json_value_vtbl; impl->ref = 1; + impl->json_value_type = JsonValueType_String; if (FAILED(hr = WindowsDuplicateString( input, &impl->string_value ))) { free( impl ); diff --git a/dlls/windows.web/tests/web.c b/dlls/windows.web/tests/web.c index 28771931fec..a4072a92db3 100644 --- a/dlls/windows.web/tests/web.c +++ b/dlls/windows.web/tests/web.c @@ -123,12 +123,9 @@ static void test_JsonValueStatics(void) hr = IJsonValueStatics_CreateStringValue( json_value_statics, NULL, &json_value ); ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IJsonValue_get_ValueType( json_value, NULL ); - todo_wine ok( hr == E_POINTER, "got hr %#lx.\n", hr ); hr = IJsonValue_get_ValueType( json_value, &json_value_type ); - todo_wine ok( json_value_type == JsonValueType_String, "got JsonValueType %d.\n", json_value_type ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); ref = IJsonValue_Release( json_value ); ok( ref == 0, "got ref %ld.\n", ref ); @@ -139,9 +136,7 @@ static void test_JsonValueStatics(void) hr = IJsonValueStatics_CreateStringValue( json_value_statics, str, &json_value ); ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IJsonValue_get_ValueType( json_value, &json_value_type ); - todo_wine ok( json_value_type == JsonValueType_String, "got JsonValueType %d.\n", json_value_type ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); WindowsDeleteString( str ); ref = IJsonValue_Release( json_value );