Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a4af2b2b
Commit
a4af2b2b
authored
Aug 20, 2020
by
Paul Gofman
Committed by
Alexandre Julliard
Aug 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement GetEnabledXStateFeatures().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
97b5ad75
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
61 additions
and
19 deletions
+61
-19
api-ms-win-core-xstate-l1-1-0.spec
...win-core-xstate-l1-1-0/api-ms-win-core-xstate-l1-1-0.spec
+1
-1
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
process.c
dlls/kernel32/process.c
+0
-9
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
memory.c
dlls/kernelbase/memory.c
+18
-0
exception.c
dlls/ntdll/exception.c
+10
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
virtual.c
dlls/ntdll/tests/virtual.c
+26
-7
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-0
wdm.h
include/ddk/wdm.h
+1
-0
winbase.h
include/winbase.h
+1
-0
No files found.
dlls/api-ms-win-core-xstate-l1-1-0/api-ms-win-core-xstate-l1-1-0.spec
View file @
a4af2b2b
@ stub RtlCopyExtendedContext
@ st
ub
RtlGetEnabledExtendedFeatures
@ st
dcall RtlGetEnabledExtendedFeatures(int64) ntdll.
RtlGetEnabledExtendedFeatures
@ stub RtlGetExtendedContextLength
@ stub RtlGetExtendedFeaturesMask
@ stub RtlInitializeExtendedContext
...
...
dlls/kernel32/kernel32.spec
View file @
a4af2b2b
...
...
@@ -659,7 +659,7 @@
# @ stub GetDurationFormatEx
@ stdcall -import GetDynamicTimeZoneInformation(ptr)
@ stdcall -import GetDynamicTimeZoneInformationEffectiveYears(ptr ptr ptr)
@ stdcall -ret64 -arch=i386,x86_64 GetEnabledXStateFeatures()
@ stdcall -
import -
ret64 -arch=i386,x86_64 GetEnabledXStateFeatures()
@ stdcall -import GetEnvironmentStrings()
@ stdcall -import GetEnvironmentStringsA()
@ stdcall -import GetEnvironmentStringsW()
...
...
dlls/kernel32/process.c
View file @
a4af2b2b
...
...
@@ -742,15 +742,6 @@ DWORD WINAPI GetMaximumProcessorCount(WORD group)
}
/***********************************************************************
* GetEnabledXStateFeatures (KERNEL32.@)
*/
DWORD64
WINAPI
GetEnabledXStateFeatures
(
void
)
{
FIXME
(
"
\n
"
);
return
0
;
}
/***********************************************************************
* GetFirmwareEnvironmentVariableA (KERNEL32.@)
*/
DWORD
WINAPI
GetFirmwareEnvironmentVariableA
(
LPCSTR
name
,
LPCSTR
guid
,
PVOID
buffer
,
DWORD
size
)
...
...
dlls/kernelbase/kernelbase.spec
View file @
a4af2b2b
...
...
@@ -493,7 +493,7 @@
# @ stub GetEffectivePackageStatusForUser
# @ stub GetEightBitStringToUnicodeSizeRoutine
# @ stub GetEightBitStringToUnicodeStringRoutine
@ stdcall -ret64 -arch=i386,x86_64 GetEnabledXStateFeatures()
kernel32.GetEnabledXStateFeatures
@ stdcall -ret64 -arch=i386,x86_64 GetEnabledXStateFeatures()
@ stdcall GetEnvironmentStrings() GetEnvironmentStringsA
@ stdcall GetEnvironmentStringsA()
@ stdcall GetEnvironmentStringsW()
...
...
dlls/kernelbase/memory.c
View file @
a4af2b2b
...
...
@@ -33,6 +33,7 @@
#include "winnls.h"
#include "winternl.h"
#include "winerror.h"
#include "ddk/wdm.h"
#include "kernelbase.h"
#include "wine/exception.h"
...
...
@@ -1170,6 +1171,23 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocExNuma( HANDLE process, void *addr,
/***********************************************************************
* CPU functions
***********************************************************************/
#if defined(__i386__) || defined(__x86_64__)
/***********************************************************************
* GetEnabledXStateFeatures (kernelbase.@)
*/
DWORD64
WINAPI
GetEnabledXStateFeatures
(
void
)
{
TRACE
(
"
\n
"
);
return
RtlGetEnabledExtendedFeatures
(
~
(
ULONG64
)
0
);
}
#endif
/***********************************************************************
* Firmware functions
***********************************************************************/
...
...
dlls/ntdll/exception.c
View file @
a4af2b2b
...
...
@@ -30,6 +30,7 @@
#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
#include "ddk/wdm.h"
#include "wine/exception.h"
#include "wine/server.h"
#include "wine/list.h"
...
...
@@ -655,3 +656,12 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT_PTR max )
__ENDTRY
return
FALSE
;
}
/**********************************************************************
* RtlGetEnabledExtendedFeatures (NTDLL.@)
*/
ULONG64
WINAPI
RtlGetEnabledExtendedFeatures
(
ULONG64
feature_mask
)
{
return
user_shared_data
->
XState
.
EnabledFeatures
&
feature_mask
;
}
dlls/ntdll/ntdll.spec
View file @
a4af2b2b
...
...
@@ -693,6 +693,7 @@
@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr)
@ stub RtlGetElementGenericTable
# @ stub RtlGetElementGenericTableAvl
@ stdcall RtlGetEnabledExtendedFeatures(int64)
@ stdcall RtlGetExePath(wstr ptr)
# @ stub RtlGetFirstRange
@ stdcall RtlGetFrame()
...
...
dlls/ntdll/tests/virtual.c
View file @
a4af2b2b
...
...
@@ -29,7 +29,9 @@
static
unsigned
int
page_size
;
static
DWORD64
(
WINAPI
*
pGetEnabledXStateFeatures
)(
void
);
static
NTSTATUS
(
WINAPI
*
pRtlCreateUserStack
)(
SIZE_T
,
SIZE_T
,
ULONG
,
SIZE_T
,
SIZE_T
,
INITIAL_TEB
*
);
static
ULONG64
(
WINAPI
*
pRtlGetEnabledExtendedFeatures
)(
ULONG64
);
static
NTSTATUS
(
WINAPI
*
pRtlFreeUserStack
)(
void
*
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
const
BOOL
is_win64
=
sizeof
(
void
*
)
!=
sizeof
(
int
);
...
...
@@ -543,6 +545,7 @@ static void test_user_shared_data(void)
};
const
KSHARED_USER_DATA
*
user_shared_data
=
(
void
*
)
0x7ffe0000
;
XSTATE_CONFIGURATION
xstate
=
user_shared_data
->
XState
;
ULONG64
feature_mask
;
unsigned
int
i
;
ok
(
user_shared_data
->
NumberOfPhysicalPages
==
sbi
.
MmNumberOfPhysicalPages
,
...
...
@@ -560,17 +563,24 @@ static void test_user_shared_data(void)
||
broken
(
!
user_shared_data
->
ActiveGroupCount
)
/* before Win7 */
,
"Got unexpected ActiveGroupCount %u.
\n
"
,
user_shared_data
->
ActiveGroupCount
);
if
(
!
pRtlGetEnabledExtendedFeatures
)
{
skip
(
"RtlGetEnabledExtendedFeatures is not available.
\n
"
);
return
;
}
feature_mask
=
pRtlGetEnabledExtendedFeatures
(
~
(
ULONG64
)
0
);
if
(
!
feature_mask
)
{
skip
(
"XState features are not available.
\n
"
);
return
;
}
if
(
!
xstate
.
EnabledFeatures
)
{
struct
old_xstate_configuration
*
xs_old
=
(
struct
old_xstate_configuration
*
)((
char
*
)
user_shared_data
+
0x3e0
);
if
(
!
xs_old
->
EnabledFeatures
)
{
skip
(
"XState features are not supported.
\n
"
);
return
;
}
memset
(
&
xstate
,
0
,
sizeof
(
xstate
));
xstate
.
EnabledFeatures
=
xstate
.
EnabledVolatileFeatures
=
xs_old
->
EnabledFeatures
;
memcpy
(
&
xstate
.
Size
,
&
xs_old
->
Size
,
sizeof
(
*
xs_old
)
-
offsetof
(
struct
old_xstate_configuration
,
Size
));
...
...
@@ -580,6 +590,14 @@ static void test_user_shared_data(void)
}
trace
(
"XState EnabledFeatures %s.
\n
"
,
wine_dbgstr_longlong
(
xstate
.
EnabledFeatures
));
feature_mask
=
pRtlGetEnabledExtendedFeatures
(
0
);
ok
(
!
feature_mask
,
"Got unexpected feature_mask %s.
\n
"
,
wine_dbgstr_longlong
(
feature_mask
));
feature_mask
=
pRtlGetEnabledExtendedFeatures
(
~
(
ULONG64
)
0
);
ok
(
feature_mask
==
xstate
.
EnabledFeatures
,
"Got unexpected feature_mask %s.
\n
"
,
wine_dbgstr_longlong
(
feature_mask
));
feature_mask
=
pGetEnabledXStateFeatures
();
ok
(
feature_mask
==
xstate
.
EnabledFeatures
,
"Got unexpected feature_mask %s.
\n
"
,
wine_dbgstr_longlong
(
feature_mask
));
ok
((
xstate
.
EnabledFeatures
&
SUPPORTED_XSTATE_FEATURES
)
==
SUPPORTED_XSTATE_FEATURES
,
"Got unexpected EnabledFeatures %s.
\n
"
,
wine_dbgstr_longlong
(
xstate
.
EnabledFeatures
));
ok
((
xstate
.
EnabledVolatileFeatures
&
SUPPORTED_XSTATE_FEATURES
)
==
xstate
.
EnabledFeatures
,
...
...
@@ -623,10 +641,11 @@ START_TEST(virtual)
mod
=
GetModuleHandleA
(
"kernel32.dll"
);
pIsWow64Process
=
(
void
*
)
GetProcAddress
(
mod
,
"IsWow64Process"
);
pGetEnabledXStateFeatures
=
(
void
*
)
GetProcAddress
(
mod
,
"GetEnabledXStateFeatures"
);
mod
=
GetModuleHandleA
(
"ntdll.dll"
);
pRtlCreateUserStack
=
(
void
*
)
GetProcAddress
(
mod
,
"RtlCreateUserStack"
);
pRtlFreeUserStack
=
(
void
*
)
GetProcAddress
(
mod
,
"RtlFreeUserStack"
);
pRtlGetEnabledExtendedFeatures
=
(
void
*
)
GetProcAddress
(
mod
,
"RtlGetEnabledExtendedFeatures"
);
NtQuerySystemInformation
(
SystemBasicInformation
,
&
sbi
,
sizeof
(
sbi
),
NULL
);
trace
(
"system page size %#x
\n
"
,
sbi
.
PageSize
);
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
a4af2b2b
...
...
@@ -1105,6 +1105,7 @@
@ stdcall RtlGetProductInfo(long long long long ptr)
@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr)
@ stub RtlGetSetBootStatusData
@ stdcall RtlGetEnabledExtendedFeatures(int64)
@ stdcall RtlGetVersion(ptr)
@ stdcall RtlHashUnicodeString(ptr long long ptr)
@ stdcall RtlIdnToAscii(long wstr long ptr ptr)
...
...
include/ddk/wdm.h
View file @
a4af2b2b
...
...
@@ -1841,6 +1841,7 @@ void WINAPI RtlCopyMemoryNonTemporal(void*,const void*,SIZE_T);
#else
#define RtlCopyMemoryNonTemporal RtlCopyMemory
#endif
ULONG64
WINAPI
RtlGetEnabledExtendedFeatures
(
ULONG64
);
BOOLEAN
WINAPI
RtlIsNtDdiVersionAvailable
(
ULONG
);
NTSTATUS
WINAPI
ZwAddBootEntry
(
PUNICODE_STRING
,
PUNICODE_STRING
);
...
...
include/winbase.h
View file @
a4af2b2b
...
...
@@ -2136,6 +2136,7 @@ WINBASEAPI DWORD WINAPI GetDllDirectoryW(DWORD,LPWSTR);
WINBASEAPI
UINT
WINAPI
GetDriveTypeA
(
LPCSTR
);
WINBASEAPI
UINT
WINAPI
GetDriveTypeW
(
LPCWSTR
);
#define GetDriveType WINELIB_NAME_AW(GetDriveType)
WINBASEAPI
DWORD64
WINAPI
GetEnabledXStateFeatures
(
void
);
WINBASEAPI
LPSTR
WINAPI
GetEnvironmentStringsA
(
void
);
WINBASEAPI
LPWSTR
WINAPI
GetEnvironmentStringsW
(
void
);
#define GetEnvironmentStrings WINELIB_NAME_AW(GetEnvironmentStrings)
...
...
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