From: Vibhav Pant vibhavp@gmail.com
--- dlls/wintypes/propertyset.c | 10 ++++++++-- dlls/wintypes/tests/wintypes.c | 10 ---------- 2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/dlls/wintypes/propertyset.c b/dlls/wintypes/propertyset.c index 0b2afdff8af..579aa5cdc60 100644 --- a/dlls/wintypes/propertyset.c +++ b/dlls/wintypes/propertyset.c @@ -210,8 +210,14 @@ static HRESULT STDMETHODCALLTYPE propertyset_get_Size( IMap_HSTRING_IInspectable
static HRESULT STDMETHODCALLTYPE propertyset_HasKey( IMap_HSTRING_IInspectable *iface, HSTRING key, boolean *exists ) { - FIXME( "(%p, %s, %p) stub!\n", iface, debugstr_hstring( key ), exists ); - return E_NOTIMPL; + struct propertyset *impl = impl_from_IMap_HSTRING_IInspectable( iface ); + + TRACE( "(%p, %s, %p)\n", iface, debugstr_hstring( key ), exists ); + + AcquireSRWLockExclusive( &impl->lock); + *exists = !!rb_get( &impl->entries, key ); + ReleaseSRWLockExclusive( &impl->lock ); + return S_OK; }
static HRESULT STDMETHODCALLTYPE propertyset_GetView( IMap_HSTRING_IInspectable *iface, IMapView_HSTRING_IInspectable **view ) diff --git a/dlls/wintypes/tests/wintypes.c b/dlls/wintypes/tests/wintypes.c index 9e1d81404fe..5dc95648bb0 100644 --- a/dlls/wintypes/tests/wintypes.c +++ b/dlls/wintypes/tests/wintypes.c @@ -1315,9 +1315,7 @@ static void test_IPropertySet(void)
boolean = TRUE; hr = IMap_HSTRING_IInspectable_HasKey( map, NULL, &boolean ); - todo_wine ok( hr == S_OK, "HasKey failed, got %#lx\n", hr ); - todo_wine ok( !boolean, "Got boolean %d.\n", boolean ); hr = IMap_HSTRING_IInspectable_Lookup( map, NULL, &val ); todo_wine @@ -1339,9 +1337,7 @@ static void test_IPropertySet(void) ok( hr == S_OK, "Insert failed, got %#lx\n", hr ); boolean = FALSE; hr = IMap_HSTRING_IInspectable_HasKey( map, NULL, &boolean ); - todo_wine ok( hr == S_OK, "HasKey failed, got %#lx\n", hr ); - todo_wine ok( boolean, "Got boolean %d.\n", boolean ); hr = IMap_HSTRING_IInspectable_Lookup( map, NULL, &val ); todo_wine @@ -1372,9 +1368,7 @@ static void test_IPropertySet(void) ok( !boolean, "Got boolean %d.\n", boolean ); boolean = FALSE; hr = IMap_HSTRING_IInspectable_HasKey( map, key1, &boolean ); - todo_wine ok( hr == S_OK, "HasKey failed, got %#lx\n", hr ); - todo_wine ok( boolean, "Got boolean %d.\n", boolean ); hr = IMap_HSTRING_IInspectable_Lookup( map, key1, &val ); todo_wine @@ -1398,9 +1392,7 @@ static void test_IPropertySet(void) ok( hr == S_OK, "WindowsCreateString failed, got %#lx\n", hr ); boolean = TRUE; hr = IMap_HSTRING_IInspectable_HasKey( map, key2, &boolean ); - todo_wine ok( hr == S_OK, "HasKey failed, got %#lx\n", hr ); - todo_wine ok( !boolean, "Got boolean %d.\n", boolean ); hr = IPropertyValueStatics_CreateUInt64( propval_statics, 0xdeadbeefdeadbeef, &val3 ); ok( hr == S_OK, "CreateUInt32 failed, got %#lx\n", hr ); @@ -1411,9 +1403,7 @@ static void test_IPropertySet(void) ok( !boolean, "Got boolean %d.\n", boolean ); boolean = FALSE; hr = IMap_HSTRING_IInspectable_HasKey( map, key2, &boolean ); - todo_wine ok( hr == S_OK, "HasKey failed, got %#lx\n", hr ); - todo_wine ok( boolean, "Got boolean %d.\n", boolean ); hr = IMap_HSTRING_IInspectable_Lookup( map, key2, &val ); todo_wine