mirror of
https://github.com/reactos/wine.git
synced 2025-02-18 03:48:01 +00:00
propsys: Implement IPropertyStoreCache::SetState.
This commit is contained in:
parent
c3748c7daa
commit
f833061e50
@ -381,8 +381,22 @@ static HRESULT WINAPI PropertyStore_GetValueAndState(IPropertyStoreCache *iface,
|
||||
static HRESULT WINAPI PropertyStore_SetState(IPropertyStoreCache *iface,
|
||||
REFPROPERTYKEY key, PSC_STATE pstate)
|
||||
{
|
||||
FIXME("%p,%p,%d: stub\n", iface, key, pstate);
|
||||
return E_NOTIMPL;
|
||||
PropertyStore *This = impl_from_IPropertyStoreCache(iface);
|
||||
propstore_value *value;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("%p,%p,%d\n", iface, key, pstate);
|
||||
|
||||
EnterCriticalSection(&This->lock);
|
||||
|
||||
hr = PropertyStore_LookupValue(This, key, 0, &value);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
value->state = pstate;
|
||||
|
||||
LeaveCriticalSection(&This->lock);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PropertyStore_SetValueAndState(IPropertyStoreCache *iface,
|
||||
|
@ -144,7 +144,7 @@ static void test_inmemorystore(void)
|
||||
|
||||
/* Set state on an unset field */
|
||||
hr = IPropertyStoreCache_SetState(propcache, &pkey, PSC_NORMAL);
|
||||
todo_wine ok(hr == TYPE_E_ELEMENTNOTFOUND, "SetState failed, hr=%x\n", hr);
|
||||
ok(hr == TYPE_E_ELEMENTNOTFOUND, "SetState failed, hr=%x\n", hr);
|
||||
|
||||
/* Manipulate state on already set field */
|
||||
pkey.fmtid = PKEY_WineTest;
|
||||
@ -156,12 +156,12 @@ static void test_inmemorystore(void)
|
||||
ok(state == PSC_NORMAL, "expected PSC_NORMAL, got %d\n", state);
|
||||
|
||||
hr = IPropertyStoreCache_SetState(propcache, &pkey, 10);
|
||||
todo_wine ok(hr == S_OK, "SetState failed, hr=%x\n", hr);
|
||||
ok(hr == S_OK, "SetState failed, hr=%x\n", hr);
|
||||
|
||||
state = 0xdeadbeef;
|
||||
hr = IPropertyStoreCache_GetState(propcache, &pkey, &state);
|
||||
ok(hr == S_OK, "GetState failed, hr=%x\n", hr);
|
||||
todo_wine ok(state == 10, "expected 10, got %d\n", state);
|
||||
ok(state == 10, "expected 10, got %d\n", state);
|
||||
|
||||
propvar.vt = VT_I4;
|
||||
propvar.u.lVal = 12346;
|
||||
|
Loading…
x
Reference in New Issue
Block a user