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
da7411fd
Commit
da7411fd
authored
Mar 23, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fixup CPU information for old Wow64 mode.
parent
8f52d8a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
wow64.c
dlls/ntdll/tests/wow64.c
+11
-4
system.c
dlls/ntdll/unix/system.c
+7
-2
No files found.
dlls/ntdll/tests/wow64.c
View file @
da7411fd
...
@@ -68,6 +68,17 @@ static void init(void)
...
@@ -68,6 +68,17 @@ static void init(void)
if
(
!
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
))
is_wow64
=
FALSE
;
if
(
!
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
))
is_wow64
=
FALSE
;
if
(
is_wow64
)
{
TEB64
*
teb64
=
ULongToPtr
(
NtCurrentTeb
()
->
GdiBatchCount
);
if
(
teb64
)
{
PEB64
*
peb64
=
ULongToPtr
(
teb64
->
Peb
);
old_wow64
=
!
peb64
->
LdrData
;
}
}
#define GET_PROC(func) p##func = (void *)GetProcAddress( ntdll, #func )
#define GET_PROC(func) p##func = (void *)GetProcAddress( ntdll, #func )
GET_PROC
(
NtQuerySystemInformation
);
GET_PROC
(
NtQuerySystemInformation
);
GET_PROC
(
NtQuerySystemInformationEx
);
GET_PROC
(
NtQuerySystemInformationEx
);
...
@@ -102,10 +113,6 @@ static void init(void)
...
@@ -102,10 +113,6 @@ static void init(void)
case
PROCESSOR_ARCHITECTURE_AMD64
:
case
PROCESSOR_ARCHITECTURE_AMD64
:
native_machine
=
IMAGE_FILE_MACHINE_AMD64
;
native_machine
=
IMAGE_FILE_MACHINE_AMD64
;
break
;
break
;
case
PROCESSOR_ARCHITECTURE_INTEL
:
old_wow64
=
TRUE
;
native_machine
=
IMAGE_FILE_MACHINE_AMD64
;
break
;
}
}
}
}
...
...
dlls/ntdll/unix/system.c
View file @
da7411fd
...
@@ -2570,8 +2570,13 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
...
@@ -2570,8 +2570,13 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
case
SystemCpuInformation
:
/* 1 */
case
SystemCpuInformation
:
/* 1 */
if
(
size
>=
(
len
=
sizeof
(
cpu_info
)))
if
(
size
>=
(
len
=
sizeof
(
cpu_info
)))
{
{
if
(
!
info
)
ret
=
STATUS_ACCESS_VIOLATION
;
SYSTEM_CPU_INFORMATION
cpu
=
cpu_info
;
else
memcpy
(
info
,
&
cpu_info
,
len
);
#ifndef _WIN64
if
(
is_wow64
&&
cpu
.
ProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
)
cpu
.
ProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_AMD64
;
#endif
memcpy
(
info
,
&
cpu
,
len
);
}
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
break
;
break
;
...
...
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