propsys: Add a semi-stub for PSCreatePropertyStoreFromObject().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47958
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-11-03 00:13:37 +03:00 committed by Alexandre Julliard
parent d189b55d2f
commit acb2e4fc7a
4 changed files with 52 additions and 2 deletions

View File

@ -473,3 +473,19 @@ HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv
return ret;
}
HRESULT WINAPI PSCreatePropertyStoreFromObject(IUnknown *obj, DWORD access, REFIID riid, void **ret)
{
HRESULT hr;
TRACE("(%p, %d, %s, %p)\n", obj, access, debugstr_guid(riid), ret);
if (!obj || !ret)
return E_POINTER;
if (IsEqualIID(riid, &IID_IPropertyStore) && SUCCEEDED(hr = IUnknown_QueryInterface(obj, riid, ret)))
return hr;
FIXME("Unimplemented for %s.\n", debugstr_guid(riid));
return E_NOTIMPL;
}

View File

@ -68,7 +68,7 @@
@ stdcall PSCreateMemoryPropertyStore(ptr ptr)
@ stub PSCreateMultiplexPropertyStore
@ stub PSCreatePropertyChangeArray
@ stub PSCreatePropertyStoreFromObject
@ stdcall PSCreatePropertyStoreFromObject(ptr long ptr ptr)
@ stub PSCreatePropertyStoreFromPropertySetStorage
@ stub PSCreateSimplePropertyChange
@ stub PSEnumeratePropertyDescriptions

View File

@ -29,8 +29,8 @@
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "initguid.h"
#include "objbase.h"
#include "propsys.h"
#include "propvarutil.h"
#include "strsafe.h"
@ -1919,6 +1919,38 @@ static void test_propertystore(void)
IPropertyStore_Release(propstore);
}
static void test_PSCreatePropertyStoreFromObject(void)
{
IPropertyStore *propstore;
IUnknown *unk;
HRESULT hr;
hr = PSCreateMemoryPropertyStore(&IID_IPropertyStore, (void **)&propstore);
ok(hr == S_OK, "Failed to create property store, hr %#x.\n", hr);
hr = PSCreatePropertyStoreFromObject(NULL, STGM_READWRITE, &IID_IUnknown, (void **)&unk);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = PSCreatePropertyStoreFromObject((IUnknown *)propstore, STGM_READWRITE, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = PSCreatePropertyStoreFromObject((IUnknown *)propstore, STGM_READWRITE, &IID_IUnknown, (void **)&unk);
todo_wine
ok(hr == S_OK, "Failed to create wrapper, hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
ok(unk != (IUnknown *)propstore, "Unexpected object returned.\n");
IUnknown_Release(unk);
}
hr = PSCreatePropertyStoreFromObject((IUnknown *)propstore, STGM_READWRITE, &IID_IPropertyStore, (void **)&unk);
ok(hr == S_OK, "Failed to create wrapper, hr %#x.\n", hr);
ok(unk == (IUnknown *)propstore, "Unexpected object returned.\n");
IUnknown_Release(unk);
IPropertyStore_Release(propstore);
}
START_TEST(propsys)
{
test_PSStringFromPropertyKey();
@ -1941,4 +1973,5 @@ START_TEST(propsys)
test_persistserialized();
test_PSCreateMemoryPropertyStore();
test_propertystore();
test_PSCreatePropertyStoreFromObject();
}

View File

@ -800,6 +800,7 @@ cpp_quote("#define GUIDSTRING_MAX 39")
cpp_quote("#define PKEYSTR_MAX (GUIDSTRING_MAX + 1 + PKEY_PIDSTR_MAX)")
cpp_quote("HRESULT WINAPI PSCreateMemoryPropertyStore(REFIID,void **);")
cpp_quote("HRESULT WINAPI PSCreatePropertyStoreFromObject(IUnknown*,DWORD,REFIID,void **);")
cpp_quote("HRESULT WINAPI PSStringFromPropertyKey(REFPROPERTYKEY,LPWSTR,UINT);")
cpp_quote("HRESULT WINAPI PSPropertyKeyFromString(LPCWSTR,PROPERTYKEY*);")
cpp_quote("HRESULT WINAPI PSGetPropertyDescription(REFPROPERTYKEY,REFIID,void **);")