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
2b22cf58
Commit
2b22cf58
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: Implement Windows.System.Profile.AnalyticsInfo_get_DeviceFamilyVersion.
parent
377aac9c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
4 deletions
+44
-4
Makefile.in
dlls/twinapi.appcore/Makefile.in
+1
-1
analytics_info.c
dlls/twinapi.appcore/analytics_info.c
+19
-2
Makefile.in
dlls/twinapi.appcore/tests/Makefile.in
+1
-1
twinapi.c
dlls/twinapi.appcore/tests/twinapi.c
+23
-0
No files found.
dlls/twinapi.appcore/Makefile.in
View file @
2b22cf58
EXTRADEFS
=
-D_CONTRACT_GEN
MODULE
=
twinapi.appcore.dll
IMPORTS
=
combase
IMPORTS
=
combase
advapi32
SOURCES
=
\
analytics_info.c
\
...
...
dlls/twinapi.appcore/analytics_info.c
View file @
2b22cf58
...
...
@@ -19,6 +19,8 @@
#include "private.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
twinapi
);
struct
analytics_version_info
...
...
@@ -95,8 +97,23 @@ static HRESULT WINAPI analytics_version_info_get_DeviceFamily( IAnalyticsVersion
static
HRESULT
WINAPI
analytics_version_info_get_DeviceFamilyVersion
(
IAnalyticsVersionInfo
*
iface
,
HSTRING
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
DWORD
revision
,
size
;
WCHAR
buffer
[
32
];
UINT64
version
;
UINT
len
;
TRACE
(
"iface %p, value %p
\n
"
,
iface
,
value
);
if
(
RegGetValueW
(
HKEY_LOCAL_MACHINE
,
L"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion"
,
L"UBR"
,
RRF_RT_REG_DWORD
,
NULL
,
&
revision
,
&
size
))
revision
=
0
;
version
=
NtCurrentTeb
()
->
Peb
->
OSMajorVersion
&
0xffff
;
version
=
(
version
<<
16
)
|
(
NtCurrentTeb
()
->
Peb
->
OSMinorVersion
&
0xffff
);
version
=
(
version
<<
16
)
|
(
NtCurrentTeb
()
->
Peb
->
OSBuildNumber
&
0xffff
);
version
=
(
version
<<
16
)
|
revision
;
len
=
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%I64u"
,
version
);
return
WindowsCreateString
(
buffer
,
len
,
value
);
}
static
IAnalyticsVersionInfoVtbl
analytics_version_info_vtbl
=
...
...
dlls/twinapi.appcore/tests/Makefile.in
View file @
2b22cf58
TESTDLL
=
twinapi.appcore.dll
IMPORTS
=
combase
IMPORTS
=
combase
advapi32
SOURCES
=
\
twinapi.c
dlls/twinapi.appcore/tests/twinapi.c
View file @
2b22cf58
...
...
@@ -25,6 +25,7 @@
#define COBJMACROS
#include "initguid.h"
#include "winstring.h"
#include "winternl.h"
#include "roapi.h"
#define WIDL_using_Windows_Foundation
...
...
@@ -118,6 +119,9 @@ static void test_AnalyticsVersionInfo(void)
IAnalyticsVersionInfo
*
analytics_version_info
;
IActivationFactory
*
factory
;
HSTRING
str
,
expect_str
;
DWORD
revision
,
size
;
WCHAR
buffer
[
32
];
UINT64
version
;
HRESULT
hr
;
INT32
res
;
LONG
ref
;
...
...
@@ -158,6 +162,25 @@ static void test_AnalyticsVersionInfo(void)
WindowsDeleteString
(
str
);
WindowsDeleteString
(
expect_str
);
if
(
RegGetValueW
(
HKEY_LOCAL_MACHINE
,
L"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion"
,
L"UBR"
,
RRF_RT_REG_DWORD
,
NULL
,
&
revision
,
&
size
))
revision
=
0
;
version
=
NtCurrentTeb
()
->
Peb
->
OSMajorVersion
&
0xffff
;
version
=
(
version
<<
16
)
|
(
NtCurrentTeb
()
->
Peb
->
OSMinorVersion
&
0xffff
);
version
=
(
version
<<
16
)
|
(
NtCurrentTeb
()
->
Peb
->
OSBuildNumber
&
0xffff
);
version
=
(
version
<<
16
)
|
revision
;
res
=
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%I64u"
,
version
);
hr
=
WindowsCreateString
(
buffer
,
res
,
&
expect_str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
IAnalyticsVersionInfo_get_DeviceFamilyVersion
(
analytics_version_info
,
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
WindowsCompareStringOrdinal
(
str
,
expect_str
,
&
res
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ok
(
!
res
||
broken
(
revision
==
0
)
/* Win11 */
,
"got unexpected string %s.
\n
"
,
debugstr_hstring
(
str
)
);
WindowsDeleteString
(
str
);
WindowsDeleteString
(
expect_str
);
ref
=
IAnalyticsVersionInfo_Release
(
analytics_version_info
);
ok
(
ref
==
0
,
"got ref %ld.
\n
"
,
ref
);
...
...
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