Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ee567bb1
Commit
ee567bb1
authored
Feb 17, 2023
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
Sep 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.applicationmodel: Implement IPackageStatics::get_Current().
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52665
parent
612375a5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
2 deletions
+144
-2
package.c
dlls/windows.applicationmodel/package.c
+122
-2
private.h
dlls/windows.applicationmodel/private.h
+1
-0
application.c
dlls/windows.applicationmodel/tests/application.c
+14
-0
model.c
dlls/windows.applicationmodel/tests/model.c
+7
-0
No files found.
dlls/windows.applicationmodel/package.c
View file @
ee567bb1
...
...
@@ -115,14 +115,134 @@ static const struct IActivationFactoryVtbl factory_vtbl =
factory_ActivateInstance
,
};
DEFINE_IINSPECTABLE
(
package_statics
,
IPackageStatics
,
struct
package_statics
,
IActivationFactory_iface
)
struct
package
{
IPackage
IPackage_iface
;
LONG
ref
;
};
static
HRESULT
WINAPI
package_statics_get_Current
(
IPackageStatics
*
iface
,
IPackage
**
value
)
static
inline
struct
package
*
impl_from_IPackage
(
IPackage
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
package
,
IPackage_iface
);
}
static
HRESULT
WINAPI
package_QueryInterface
(
IPackage
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
package
*
impl
=
impl_from_IPackage
(
iface
);
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IInspectable
)
||
IsEqualGUID
(
iid
,
&
IID_IAgileObject
)
||
IsEqualGUID
(
iid
,
&
IID_IPackage
))
{
*
out
=
&
impl
->
IPackage_iface
;
IInspectable_AddRef
(
*
out
);
return
S_OK
;
}
FIXME
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
)
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
package_AddRef
(
IPackage
*
iface
)
{
struct
package
*
impl
=
impl_from_IPackage
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
impl
->
ref
);
TRACE
(
"iface %p increasing refcount to %lu.
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
package_Release
(
IPackage
*
iface
)
{
struct
package
*
impl
=
impl_from_IPackage
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
impl
->
ref
);
TRACE
(
"iface %p decreasing refcount to %lu.
\n
"
,
iface
,
ref
);
if
(
!
ref
)
free
(
impl
);
return
ref
;
}
static
HRESULT
WINAPI
package_GetIids
(
IPackage
*
iface
,
ULONG
*
iid_count
,
IID
**
iids
)
{
FIXME
(
"iface %p, iid_count %p, iids %p stub!
\n
"
,
iface
,
iid_count
,
iids
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
package_GetRuntimeClassName
(
IPackage
*
iface
,
HSTRING
*
class_name
)
{
FIXME
(
"iface %p, class_name %p stub!
\n
"
,
iface
,
class_name
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
package_GetTrustLevel
(
IPackage
*
iface
,
TrustLevel
*
trust_level
)
{
FIXME
(
"iface %p, trust_level %p stub!
\n
"
,
iface
,
trust_level
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
package_get_Id
(
IPackage
*
iface
,
IPackageId
**
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
package_get_InstalledLocation
(
IPackage
*
iface
,
IStorageFolder
**
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
package_get_IsFramework
(
IPackage
*
iface
,
boolean
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
package_get_Dependencies
(
IPackage
*
iface
,
IVectorView_Package
**
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
static
const
struct
IPackageVtbl
package_vtbl
=
{
package_QueryInterface
,
package_AddRef
,
package_Release
,
/* IInspectable methods */
package_GetIids
,
package_GetRuntimeClassName
,
package_GetTrustLevel
,
/* IPackage methods */
package_get_Id
,
package_get_InstalledLocation
,
package_get_IsFramework
,
package_get_Dependencies
,
};
DEFINE_IINSPECTABLE
(
package_statics
,
IPackageStatics
,
struct
package_statics
,
IActivationFactory_iface
)
static
HRESULT
WINAPI
package_statics_get_Current
(
IPackageStatics
*
iface
,
IPackage
**
value
)
{
struct
package
*
impl
;
TRACE
(
"iface %p, value %p
\n
"
,
iface
,
value
);
if
(
!
value
)
return
E_INVALIDARG
;
if
(
!
(
impl
=
calloc
(
1
,
sizeof
(
*
impl
)
)))
return
E_OUTOFMEMORY
;
impl
->
IPackage_iface
.
lpVtbl
=
&
package_vtbl
;
impl
->
ref
=
1
;
*
value
=
&
impl
->
IPackage_iface
;
TRACE
(
"created IPackage %p.
\n
"
,
*
value
);
return
S_OK
;
}
static
const
struct
IPackageStaticsVtbl
package_statics_vtbl
=
{
package_statics_QueryInterface
,
...
...
dlls/windows.applicationmodel/private.h
View file @
ee567bb1
...
...
@@ -33,6 +33,7 @@
#define WIDL_using_Windows_Foundation_Collections
#include "windows.foundation.h"
#define WIDL_using_Windows_ApplicationModel
#define WIDL_using_Windows_Storage
#include "windows.applicationmodel.h"
extern
IActivationFactory
*
package_factory
;
...
...
dlls/windows.applicationmodel/tests/application.c
View file @
ee567bb1
...
...
@@ -58,6 +58,7 @@ static void test_PackageStatics(void)
static
const
WCHAR
*
package_statics_name
=
L"Windows.ApplicationModel.Package"
;
IPackageStatics
*
package_statics
;
IActivationFactory
*
factory
;
IPackage
*
package
;
HSTRING
str
;
HRESULT
hr
;
LONG
ref
;
...
...
@@ -80,6 +81,19 @@ static void test_PackageStatics(void)
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IPackageStatics
,
(
void
**
)
&
package_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IPackageStatics_get_Current
(
package_statics
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IPackageStatics_get_Current
(
package_statics
,
&
package
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
package
!=
NULL
,
"got NULL package %p.
\n
"
,
package
);
check_interface
(
package
,
&
IID_IUnknown
);
check_interface
(
package
,
&
IID_IInspectable
);
check_interface
(
package
,
&
IID_IAgileObject
);
check_interface
(
package
,
&
IID_IPackage
);
ref
=
IPackage_Release
(
package
);
ok
(
!
ref
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IPackageStatics_Release
(
package_statics
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
...
...
dlls/windows.applicationmodel/tests/model.c
View file @
ee567bb1
...
...
@@ -543,6 +543,7 @@ static void test_PackageStatics(void)
static
const
WCHAR
*
package_statics_name
=
L"Windows.ApplicationModel.Package"
;
IPackageStatics
*
package_statics
;
IActivationFactory
*
factory
;
IPackage
*
package
;
HSTRING
str
;
HRESULT
hr
;
LONG
ref
;
...
...
@@ -565,6 +566,12 @@ static void test_PackageStatics(void)
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IPackageStatics
,
(
void
**
)
&
package_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IPackageStatics_get_Current
(
package_statics
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IPackageStatics_get_Current
(
package_statics
,
&
package
);
todo_wine
ok
(
hr
==
0x80073d54
,
"got hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
package
,
"got package %p.
\n
"
,
package
);
ref
=
IPackageStatics_Release
(
package_statics
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment