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
f3b4bd2b
Commit
f3b4bd2b
authored
May 12, 2010
by
Paul Vriens
Committed by
Alexandre Julliard
May 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Return the correct processor arch and type in wow64 mode.
parent
57ddceea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
6 deletions
+60
-6
cpu.c
dlls/kernel32/cpu.c
+17
-6
process.c
dlls/kernel32/tests/process.c
+43
-0
No files found.
dlls/kernel32/cpu.c
View file @
f3b4bd2b
...
...
@@ -170,13 +170,24 @@ VOID WINAPI GetSystemInfo(
VOID
WINAPI
GetNativeSystemInfo
(
LPSYSTEM_INFO
si
/* [out] Destination for system information, may not be NULL */
)
{
static
BOOL
reported
=
FALSE
;
if
(
!
reported
)
{
FIXME
(
"(%p) using GetSystemInfo()
\n
"
,
si
);
reported
=
TRUE
;
}
else
TRACE
(
"(%p) using GetSystemInfo()
\n
"
,
si
);
BOOL
is_wow64
;
GetSystemInfo
(
si
);
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
);
if
(
is_wow64
)
{
if
(
si
->
u
.
s
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
)
{
si
->
u
.
s
.
wProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_AMD64
;
si
->
dwProcessorType
=
PROCESSOR_AMD_X8664
;
}
else
{
FIXME
(
"Add the proper information for %d in wow64 mode
\n
"
,
si
->
u
.
s
.
wProcessorArchitecture
);
}
}
}
/***********************************************************************
...
...
dlls/kernel32/tests/process.c
View file @
f3b4bd2b
...
...
@@ -55,6 +55,8 @@
} while (0)
static
HINSTANCE
hkernel32
;
static
void
(
WINAPI
*
pGetNativeSystemInfo
)(
LPSYSTEM_INFO
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
LPVOID
(
WINAPI
*
pVirtualAllocEx
)(
HANDLE
,
LPVOID
,
SIZE_T
,
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pVirtualFreeEx
)(
HANDLE
,
LPVOID
,
SIZE_T
,
DWORD
);
static
BOOL
(
WINAPI
*
pQueryFullProcessImageNameA
)(
HANDLE
hProcess
,
DWORD
dwFlags
,
LPSTR
lpExeName
,
PDWORD
lpdwSize
);
...
...
@@ -194,6 +196,8 @@ static int init(void)
if
((
p
=
strrchr
(
exename
,
'/'
))
!=
NULL
)
exename
=
p
+
1
;
hkernel32
=
GetModuleHandleA
(
"kernel32"
);
pGetNativeSystemInfo
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetNativeSystemInfo"
);
pIsWow64Process
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"IsWow64Process"
);
pVirtualAllocEx
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"VirtualAllocEx"
);
pVirtualFreeEx
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"VirtualFreeEx"
);
pQueryFullProcessImageNameA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"QueryFullProcessImageNameA"
);
...
...
@@ -1767,6 +1771,44 @@ static void test_Handles(void)
#endif
}
static
void
test_SystemInfo
(
void
)
{
SYSTEM_INFO
si
,
nsi
;
BOOL
is_wow64
;
if
(
!
pGetNativeSystemInfo
)
{
win_skip
(
"GetNativeSystemInfo is not available
\n
"
);
return
;
}
if
(
!
pIsWow64Process
||
!
pIsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
))
is_wow64
=
FALSE
;
GetSystemInfo
(
&
si
);
pGetNativeSystemInfo
(
&
nsi
);
if
(
is_wow64
)
{
if
(
si
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
)
{
ok
(
nsi
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_AMD64
,
"Expected PROCESSOR_ARCHITECTURE_AMD64, got %d
\n
"
,
nsi
.
wProcessorArchitecture
);
ok
(
nsi
.
dwProcessorType
==
PROCESSOR_AMD_X8664
,
"Expected PROCESSOR_AMD_X8664, got %d
\n
"
,
nsi
.
dwProcessorType
);
}
}
else
{
ok
(
si
.
wProcessorArchitecture
==
nsi
.
wProcessorArchitecture
,
"Expected no difference for wProcessorArchitecture, got %d and %d
\n
"
,
si
.
wProcessorArchitecture
,
nsi
.
wProcessorArchitecture
);
ok
(
si
.
dwProcessorType
==
nsi
.
dwProcessorType
,
"Expected no difference for dwProcessorType, got %d and %d
\n
"
,
si
.
dwProcessorType
,
nsi
.
dwProcessorType
);
}
}
START_TEST
(
process
)
{
int
b
=
init
();
...
...
@@ -1791,6 +1833,7 @@ START_TEST(process)
test_ProcessNameA
();
test_ProcessName
();
test_Handles
();
test_SystemInfo
();
/* things that can be tested:
* lookup: check the way program to be executed is searched
* handles: check the handle inheritance stuff (+sec options)
...
...
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