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
5071a287
Commit
5071a287
authored
Jul 05, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement SystemEmulation* information classes.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e64e056
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
4 deletions
+48
-4
info.c
dlls/ntdll/tests/info.c
+0
-0
system.c
dlls/ntdll/unix/system.c
+35
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-1
virtual.c
dlls/ntdll/unix/virtual.c
+12
-2
No files found.
dlls/ntdll/tests/info.c
View file @
5071a287
This diff is collapsed.
Click to expand it.
dlls/ntdll/unix/system.c
View file @
5071a287
...
...
@@ -2161,11 +2161,14 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
switch
(
class
)
{
case
SystemNativeBasicInformation
:
/* 114 */
if
(
!
is_win64
)
return
STATUS_INVALID_INFO_CLASS
;
/* fall through */
case
SystemBasicInformation
:
/* 0 */
{
SYSTEM_BASIC_INFORMATION
sbi
;
virtual_get_system_info
(
&
sbi
);
virtual_get_system_info
(
&
sbi
,
FALSE
);
len
=
sizeof
(
sbi
);
if
(
size
==
len
)
{
...
...
@@ -2659,6 +2662,37 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
break
;
}
case
SystemEmulationBasicInformation
:
/* 62 */
{
SYSTEM_BASIC_INFORMATION
sbi
;
virtual_get_system_info
(
&
sbi
,
!!
NtCurrentTeb
()
->
WowTebOffset
);
len
=
sizeof
(
sbi
);
if
(
size
==
len
)
{
if
(
!
info
)
ret
=
STATUS_ACCESS_VIOLATION
;
else
memcpy
(
info
,
&
sbi
,
len
);
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
break
;
}
case
SystemEmulationProcessorInformation
:
/* 63 */
if
(
size
>=
(
len
=
sizeof
(
cpu_info
)))
{
SYSTEM_CPU_INFORMATION
cpu
=
cpu_info
;
if
(
is_win64
)
{
if
(
cpu_info
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
)
cpu
.
ProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_INTEL
;
else
if
(
cpu_info
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_ARM64
)
cpu
.
ProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_ARM
;
}
memcpy
(
info
,
&
cpu
,
len
);
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
break
;
case
SystemExtendedHandleInformation
:
/* 64 */
{
struct
handle_info
*
handle_info
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
5071a287
...
...
@@ -198,7 +198,7 @@ extern void *anon_mmap_fixed( void *start, size_t size, int prot, int flags ) DE
extern
void
*
anon_mmap_alloc
(
size_t
size
,
int
prot
)
DECLSPEC_HIDDEN
;
extern
void
virtual_init
(
void
)
DECLSPEC_HIDDEN
;
extern
ULONG_PTR
get_system_affinity_mask
(
void
)
DECLSPEC_HIDDEN
;
extern
void
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
)
DECLSPEC_HIDDEN
;
extern
void
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
,
BOOL
wow64
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_map_builtin_module
(
HANDLE
mapping
,
void
**
module
,
SIZE_T
*
size
,
SECTION_IMAGE_INFORMATION
*
info
,
WORD
machine
,
BOOL
prefer_native
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_create_builtin_view
(
void
*
module
,
const
UNICODE_STRING
*
nt_name
,
...
...
dlls/ntdll/unix/virtual.c
View file @
5071a287
...
...
@@ -2682,7 +2682,7 @@ ULONG_PTR get_system_affinity_mask(void)
/***********************************************************************
* virtual_get_system_info
*/
void
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
)
void
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
,
BOOL
wow64
)
{
#if defined(HAVE_STRUCT_SYSINFO_TOTALRAM) && defined(HAVE_STRUCT_SYSINFO_MEM_UNIT)
struct
sysinfo
sinfo
;
...
...
@@ -2707,9 +2707,19 @@ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info )
info
->
MmNumberOfPhysicalPages
=
info
->
MmHighestPhysicalPage
-
info
->
MmLowestPhysicalPage
;
info
->
AllocationGranularity
=
granularity_mask
+
1
;
info
->
LowestUserAddress
=
(
void
*
)
0x10000
;
info
->
HighestUserAddress
=
(
char
*
)
user_space_limit
-
1
;
info
->
ActiveProcessorsAffinityMask
=
get_system_affinity_mask
();
info
->
NumberOfProcessors
=
peb
->
NumberOfProcessors
;
#ifdef _WIN64
if
(
wow64
)
{
if
(
main_image_info
.
ImageCharacteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
)
info
->
HighestUserAddress
=
(
char
*
)
0xc0000000
-
1
;
else
info
->
HighestUserAddress
=
(
char
*
)
0x7fff0000
-
1
;
return
;
}
#endif
info
->
HighestUserAddress
=
(
char
*
)
user_space_limit
-
1
;
}
...
...
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