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
8aea0395
Commit
8aea0395
authored
Feb 25, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp/tests: Introduce get_machine_bitness() helper.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
160d961e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
dbghelp.c
dlls/dbghelp/tests/dbghelp.c
+21
-15
No files found.
dlls/dbghelp/tests/dbghelp.c
View file @
8aea0395
...
...
@@ -206,6 +206,23 @@ static BOOL ends_withW(const WCHAR* str, const WCHAR* suffix)
return
strlen
>=
sfxlen
&&
!
wcsicmp
(
str
+
strlen
-
sfxlen
,
suffix
);
}
static
unsigned
get_machine_bitness
(
USHORT
machine
)
{
switch
(
machine
)
{
case
IMAGE_FILE_MACHINE_I386
:
case
IMAGE_FILE_MACHINE_ARM
:
case
IMAGE_FILE_MACHINE_ARMNT
:
return
32
;
case
IMAGE_FILE_MACHINE_AMD64
:
case
IMAGE_FILE_MACHINE_ARM64
:
return
64
;
default:
ok
(
0
,
"Unsupported machine %x
\n
"
,
machine
);
return
0
;
}
}
static
USHORT
get_module_machine
(
const
char
*
path
)
{
HANDLE
hFile
,
hMap
;
...
...
@@ -570,22 +587,11 @@ static BOOL CALLBACK aggregate_cb(PCWSTR imagename, DWORD64 base, ULONG sz, PVOI
ok
(
ret
,
"SymGetModuleInfoW64 failed: %lu
\n
"
,
GetLastError
());
}
switch
(
im
.
MachineType
)
switch
(
get_machine_bitness
(
im
.
MachineType
)
)
{
case
IMAGE_FILE_MACHINE_UNKNOWN
:
break
;
case
IMAGE_FILE_MACHINE_I386
:
case
IMAGE_FILE_MACHINE_ARM
:
case
IMAGE_FILE_MACHINE_ARMNT
:
aggregation
->
count_32bit
++
;
break
;
case
IMAGE_FILE_MACHINE_AMD64
:
case
IMAGE_FILE_MACHINE_ARM64
:
aggregation
->
count_64bit
++
;
break
;
default:
ok
(
0
,
"Unsupported machine %lx
\n
"
,
im
.
MachineType
);
break
;
case
32
:
aggregation
->
count_32bit
++
;
break
;
case
64
:
aggregation
->
count_64bit
++
;
break
;
default:
break
;
}
if
(
ends_withW
(
imagename
,
L".exe"
))
aggregation
->
count_exe
++
;
...
...
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