Commit acb2e4fc authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent d189b55d
......@@ -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;
}
......@@ -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
......
......@@ -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();
}
......@@ -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 **);")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment