Commit 8d3af569 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

pstorec: Fix QueryInterface() of IPStore.

parent be908f2f
...@@ -18249,6 +18249,7 @@ wine_fn_config_test dlls/propsys/tests propsys_test ...@@ -18249,6 +18249,7 @@ wine_fn_config_test dlls/propsys/tests propsys_test
wine_fn_config_dll psapi enable_psapi implib wine_fn_config_dll psapi enable_psapi implib
wine_fn_config_test dlls/psapi/tests psapi_test wine_fn_config_test dlls/psapi/tests psapi_test
wine_fn_config_dll pstorec enable_pstorec clean wine_fn_config_dll pstorec enable_pstorec clean
wine_fn_config_test dlls/pstorec/tests pstorec_test
wine_fn_config_dll qcap enable_qcap wine_fn_config_dll qcap enable_qcap
wine_fn_config_test dlls/qcap/tests qcap_test wine_fn_config_test dlls/qcap/tests qcap_test
wine_fn_config_dll qedit enable_qedit clean wine_fn_config_dll qedit enable_qedit clean
......
...@@ -3306,6 +3306,7 @@ WINE_CONFIG_TEST(dlls/propsys/tests) ...@@ -3306,6 +3306,7 @@ WINE_CONFIG_TEST(dlls/propsys/tests)
WINE_CONFIG_DLL(psapi,,[implib]) WINE_CONFIG_DLL(psapi,,[implib])
WINE_CONFIG_TEST(dlls/psapi/tests) WINE_CONFIG_TEST(dlls/psapi/tests)
WINE_CONFIG_DLL(pstorec,,[clean]) WINE_CONFIG_DLL(pstorec,,[clean])
WINE_CONFIG_TEST(dlls/pstorec/tests)
WINE_CONFIG_DLL(qcap) WINE_CONFIG_DLL(qcap)
WINE_CONFIG_TEST(dlls/qcap/tests) WINE_CONFIG_TEST(dlls/qcap/tests)
WINE_CONFIG_DLL(qedit,,[clean]) WINE_CONFIG_DLL(qedit,,[clean])
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winuser.h" #include "winuser.h"
#include "initguid.h"
#include "ole2.h" #include "ole2.h"
#include "pstore.h" #include "pstore.h"
...@@ -67,13 +68,13 @@ static HRESULT WINAPI PStore_fnQueryInterface( ...@@ -67,13 +68,13 @@ static HRESULT WINAPI PStore_fnQueryInterface(
{ {
PStore_impl *This = impl_from_IPStore(iface); PStore_impl *This = impl_from_IPStore(iface);
TRACE("%p %s\n",This,debugstr_guid(riid)); TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObj);
*ppvObj = NULL; *ppvObj = NULL;
if (IsEqualIID(riid, &IID_IUnknown)) if (IsEqualIID(riid, &IID_IPStore) || IsEqualIID(riid, &IID_IUnknown))
{ {
*ppvObj = This; *ppvObj = &This->IPStore_iface;
} }
if (*ppvObj) if (*ppvObj)
......
TESTDLL = pstorec.dll
C_SRCS = \
pstorec.c
/*
* Protected Storage Tests
*
* Copyright 2017 Nikolay Sivov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "initguid.h"
#include "ole2.h"
#include "pstore.h"
#include "wine/test.h"
static HRESULT (WINAPI *pPStoreCreateInstance)(IPStore **store, PST_PROVIDERID *id, void *reserved, DWORD flags);
static void test_PStoreCreateInstance(void)
{
IPStore *store;
IUnknown *unk;
HRESULT hr;
if (!pPStoreCreateInstance)
{
win_skip("PStoreCreateInstance is not available\n");
return;
}
hr = pPStoreCreateInstance(&store, NULL, NULL, 0);
if (hr == E_NOTIMPL)
{
/* this function does not work starting with Win8 */
win_skip("PStoreCreateInstance is not implemented on this system\n");
return;
}
ok(hr == S_OK, "Unexpected return value %#x.\n", hr);
hr = IPStore_QueryInterface(store, &IID_IUnknown, (void **)&unk);
ok(hr == S_OK, "Unexpected return value %#x.\n", hr);
IUnknown_Release(unk);
hr = IPStore_QueryInterface(store, &IID_IPStore, (void **)&unk);
ok(hr == S_OK, "Unexpected return value %#x.\n", hr);
IUnknown_Release(unk);
IPStore_Release(store);
}
START_TEST(pstorec)
{
HMODULE module = LoadLibraryA("pstorec");
pPStoreCreateInstance = (void *)GetProcAddress(module, "PStoreCreateInstance");
test_PStoreCreateInstance();
}
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