Commit 5de4010e authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

appxdeploymentclient: Add IPackageManager2 stub interface.

parent 0eb9e723
......@@ -25,6 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(appx);
struct package_manager
{
IPackageManager IPackageManager_iface;
IPackageManager2 IPackageManager2_iface;
LONG ref;
};
......@@ -49,6 +50,13 @@ static HRESULT WINAPI package_manager_QueryInterface( IPackageManager *iface, RE
return S_OK;
}
if (IsEqualGUID( iid, &IID_IPackageManager2 ))
{
*out = &impl->IPackageManager2_iface;
IInspectable_AddRef( *out );
return S_OK;
}
FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) );
*out = NULL;
return E_NOINTERFACE;
......@@ -226,6 +234,99 @@ static const struct IPackageManagerVtbl package_manager_vtbl =
package_manager_FindPackageByUserSecurityIdPackageFullName
};
DEFINE_IINSPECTABLE( package_manager2, IPackageManager2, struct package_manager, IPackageManager_iface );
static HRESULT WINAPI package_manager2_RemovePackageWithOptionsAsync( IPackageManager2 *iface, HSTRING name, RemovalOptions options,
IAsyncOperationWithProgress_DeploymentResult_DeploymentProgress **operation )
{
FIXME( "iface %p, name %s, options %d, operation %p stub!\n", iface, debugstr_hstring(name), options, operation );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_StagePackageWithOptionsAsync( IPackageManager2 *iface, IUriRuntimeClass *uri, IIterable_Uri *dependencies,
DeploymentOptions options, IAsyncOperationWithProgress_DeploymentResult_DeploymentProgress **operation )
{
FIXME( "iface %p, uri %p, dependencies %p, options %d, operation %p stub!\n", iface, uri, dependencies, options, operation );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_RegisterPackageByFullNameAsync( IPackageManager2 *iface, HSTRING name, IIterable_HSTRING *dependencies,
DeploymentOptions options, IAsyncOperationWithProgress_DeploymentResult_DeploymentProgress **operation )
{
FIXME( "iface %p, name %s, dependencies %p, options %d, operation %p stub!\n", iface, debugstr_hstring(name), dependencies, options, operation );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_FindPackagesWithPackageTypes( IPackageManager2 *iface, PackageTypes types, IIterable_Package **packages )
{
FIXME( "iface %p, types %d, packages %p stub!\n", iface, types, packages );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_FindPackagesByUserSecurityIdWithPackageTypes( IPackageManager2 *iface, HSTRING sid,
PackageTypes types, IIterable_Package **packages )
{
FIXME( "iface %p, sid %s, types %d, packages %p stub!\n", iface, debugstr_hstring(sid), types, packages );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_FindPackagesByNamePublisherWithPackageTypes( IPackageManager2 *iface, HSTRING name, HSTRING publisher,
PackageTypes types, IIterable_Package **packages )
{
FIXME( "iface %p, name %s, publisher %s, types %d, packages %p stub!\n", iface, debugstr_hstring(name), debugstr_hstring(publisher), types, packages );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_FindPackagesByUserSecurityIdNamePublisherWithPackageTypes( IPackageManager2 *iface, HSTRING sid, HSTRING name,
HSTRING publisher, PackageTypes types, IIterable_Package **packages )
{
FIXME( "iface %p, sid %s, name %s, publisher %s, types %d, packages %p stub!\n", iface, debugstr_hstring(sid), debugstr_hstring(name), debugstr_hstring(publisher), types, packages );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_FindPackagesByPackageFamilyNameWithPackageTypes( IPackageManager2 *iface, HSTRING family_name, PackageTypes types,
IIterable_Package **packages )
{
FIXME( "iface %p, family_name %s, types %d, packages %p stub!\n", iface, debugstr_hstring(family_name), types, packages );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_FindPackagesByUserSecurityIdPackageFamilyNameWithPackageTypes( IPackageManager2 *iface, HSTRING sid, HSTRING family_name,
PackageTypes types, IIterable_Package **packages )
{
FIXME( "iface %p, sid %s, family_name %s, types %d, packages %p stub!\n", iface, debugstr_hstring(sid), debugstr_hstring(family_name), types, packages );
return E_NOTIMPL;
}
static HRESULT WINAPI package_manager2_StageUserDataAsync( IPackageManager2 *iface, HSTRING name,
IAsyncOperationWithProgress_DeploymentResult_DeploymentProgress **operation )
{
FIXME( "iface %p, name %s, operation %p stub!\n", iface, debugstr_hstring(name), operation );
return E_NOTIMPL;
}
static const struct IPackageManager2Vtbl package_manager2_vtbl =
{
package_manager2_QueryInterface,
package_manager2_AddRef,
package_manager2_Release,
/* IInspectable methods */
package_manager2_GetIids,
package_manager2_GetRuntimeClassName,
package_manager2_GetTrustLevel,
/* IPackageManager2 methods */
package_manager2_RemovePackageWithOptionsAsync,
package_manager2_StagePackageWithOptionsAsync,
package_manager2_RegisterPackageByFullNameAsync,
package_manager2_FindPackagesWithPackageTypes,
package_manager2_FindPackagesByUserSecurityIdWithPackageTypes,
package_manager2_FindPackagesByNamePublisherWithPackageTypes,
package_manager2_FindPackagesByUserSecurityIdNamePublisherWithPackageTypes,
package_manager2_FindPackagesByPackageFamilyNameWithPackageTypes,
package_manager2_FindPackagesByUserSecurityIdPackageFamilyNameWithPackageTypes,
package_manager2_StageUserDataAsync,
};
struct package_manager_statics
{
IActivationFactory IActivationFactory_iface;
......@@ -304,6 +405,7 @@ static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInsp
}
impl->IPackageManager_iface.lpVtbl = &package_manager_vtbl;
impl->IPackageManager2_iface.lpVtbl = &package_manager2_vtbl;
impl->ref = 1;
*instance = (IInspectable *)&impl->IPackageManager_iface;
......
......@@ -38,4 +38,42 @@
extern IActivationFactory *package_manager_factory;
#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \
static inline impl_type *impl_from( iface_type *iface ) \
{ \
return CONTAINING_RECORD( iface, impl_type, iface_mem ); \
} \
static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \
} \
static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_AddRef( (IInspectable *)(expr) ); \
} \
static ULONG WINAPI pfx##_Release( iface_type *iface ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_Release( (IInspectable *)(expr) ); \
} \
static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \
} \
static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \
} \
static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \
{ \
impl_type *impl = impl_from( iface ); \
return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \
}
#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \
DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface )
#endif
......@@ -430,6 +430,7 @@ static void test_PackageManager(void)
IActivationFactory *factory;
IIterable_Package *packages;
IInspectable *inspectable;
IPackageManager2 *manager2;
IPackageManager *manager;
IIterator_Package *iter;
IPackage *package;
......@@ -479,6 +480,17 @@ static void test_PackageManager(void)
WindowsDeleteString( str );
WindowsDeleteString( str2 );
hr = IPackageManager_QueryInterface( manager, &IID_IPackageManager2, (void **)&manager2 );
ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IPackageManager2_FindPackagesWithPackageTypes( manager2, 1, &packages );
todo_wine
ok( hr == S_OK || broken(hr == E_ACCESSDENIED) /* Requires admin privileges */, "got hr %#lx.\n", hr );
if (hr == S_OK) IIterable_Package_Release( packages );
ref = IPackageManager2_Release( manager2 );
ok( ref == 2, "got ref %ld.\n", ref );
hr = IPackageManager_FindPackages( manager, &packages );
todo_wine
ok( hr == S_OK || broken(hr == E_ACCESSDENIED) /* w8adm */, "got hr %#lx.\n", hr );
......
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