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
f082ff9e
Commit
f082ff9e
authored
Nov 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
twinapi.appcore: Stub Windows.System.Profile.AnalyticsInfo runtimeclass.
parent
ced55e1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
2 deletions
+113
-2
analytics_info.c
dlls/twinapi.appcore/analytics_info.c
+102
-2
twinapi.c
dlls/twinapi.appcore/tests/twinapi.c
+11
-0
No files found.
dlls/twinapi.appcore/analytics_info.c
View file @
f082ff9e
...
...
@@ -21,6 +21,98 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
twinapi
);
struct
analytics_version_info
{
IAnalyticsVersionInfo
IAnalyticsVersionInfo_iface
;
LONG
ref
;
};
static
inline
struct
analytics_version_info
*
impl_from_IAnalyticsVersionInfo
(
IAnalyticsVersionInfo
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
analytics_version_info
,
IAnalyticsVersionInfo_iface
);
}
static
HRESULT
WINAPI
analytics_version_info_QueryInterface
(
IAnalyticsVersionInfo
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
analytics_version_info
*
impl
=
impl_from_IAnalyticsVersionInfo
(
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_IAnalyticsVersionInfo
))
{
IAnalyticsVersionInfo_AddRef
(
(
*
out
=
&
impl
->
IAnalyticsVersionInfo_iface
)
);
return
S_OK
;
}
FIXME
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
)
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
analytics_version_info_AddRef
(
IAnalyticsVersionInfo
*
iface
)
{
struct
analytics_version_info
*
impl
=
impl_from_IAnalyticsVersionInfo
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
impl
->
ref
);
TRACE
(
"iface %p, ref %lu.
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
analytics_version_info_Release
(
IAnalyticsVersionInfo
*
iface
)
{
struct
analytics_version_info
*
impl
=
impl_from_IAnalyticsVersionInfo
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
impl
->
ref
);
TRACE
(
"iface %p, ref %lu.
\n
"
,
iface
,
ref
);
if
(
!
ref
)
free
(
impl
);
return
ref
;
}
static
HRESULT
WINAPI
analytics_version_info_GetIids
(
IAnalyticsVersionInfo
*
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
analytics_version_info_GetRuntimeClassName
(
IAnalyticsVersionInfo
*
iface
,
HSTRING
*
class_name
)
{
FIXME
(
"iface %p, class_name %p stub!
\n
"
,
iface
,
class_name
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
analytics_version_info_GetTrustLevel
(
IAnalyticsVersionInfo
*
iface
,
TrustLevel
*
trust_level
)
{
FIXME
(
"iface %p, trust_level %p stub!
\n
"
,
iface
,
trust_level
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
analytics_version_info_get_DeviceFamily
(
IAnalyticsVersionInfo
*
iface
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
analytics_version_info_get_DeviceFamilyVersion
(
IAnalyticsVersionInfo
*
iface
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
}
static
IAnalyticsVersionInfoVtbl
analytics_version_info_vtbl
=
{
analytics_version_info_QueryInterface
,
analytics_version_info_AddRef
,
analytics_version_info_Release
,
/* IInspectable methods */
analytics_version_info_GetIids
,
analytics_version_info_GetRuntimeClassName
,
analytics_version_info_GetTrustLevel
,
/* IAnalyticsVersionInfo methods */
analytics_version_info_get_DeviceFamily
,
analytics_version_info_get_DeviceFamilyVersion
,
};
struct
analytics_info_factory
{
IActivationFactory
IActivationFactory_iface
;
...
...
@@ -116,8 +208,16 @@ DEFINE_IINSPECTABLE( statics, IAnalyticsInfoStatics, struct analytics_info_facto
static
HRESULT
WINAPI
statics_get_VersionInfo
(
IAnalyticsInfoStatics
*
iface
,
IAnalyticsVersionInfo
**
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
struct
analytics_version_info
*
info
;
TRACE
(
"iface %p, out %p.
\n
"
,
iface
,
value
);
if
(
!
(
info
=
calloc
(
1
,
sizeof
(
*
info
)
)))
return
E_OUTOFMEMORY
;
info
->
IAnalyticsVersionInfo_iface
.
lpVtbl
=
&
analytics_version_info_vtbl
;
info
->
ref
=
1
;
*
value
=
&
info
->
IAnalyticsVersionInfo_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
statics_get_DeviceForm
(
IAnalyticsInfoStatics
*
iface
,
HSTRING
*
value
)
...
...
dlls/twinapi.appcore/tests/twinapi.c
View file @
f082ff9e
...
...
@@ -115,6 +115,7 @@ static void test_AnalyticsVersionInfo(void)
{
static
const
WCHAR
*
class_name
=
RuntimeClass_Windows_System_Profile_AnalyticsInfo
;
IAnalyticsInfoStatics
*
analytics_info_statics
;
IAnalyticsVersionInfo
*
analytics_version_info
;
IActivationFactory
*
factory
;
HSTRING
str
;
HRESULT
hr
;
...
...
@@ -139,6 +140,16 @@ static void test_AnalyticsVersionInfo(void)
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_IAnalyticsInfoStatics
,
(
void
**
)
&
analytics_info_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IAnalyticsInfoStatics_get_VersionInfo
(
analytics_info_statics
,
&
analytics_version_info
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
check_interface
(
analytics_version_info
,
&
IID_IUnknown
,
TRUE
);
check_interface
(
analytics_version_info
,
&
IID_IInspectable
,
TRUE
);
check_interface
(
analytics_version_info
,
&
IID_IAgileObject
,
TRUE
);
ref
=
IAnalyticsVersionInfo_Release
(
analytics_version_info
);
ok
(
ref
==
0
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IAnalyticsInfoStatics_Release
(
analytics_info_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