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
f2f9d8b2
Commit
f2f9d8b2
authored
Apr 23, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbgeng: Implement IsPointer64Bit().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
911050d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
dbgeng.c
dlls/dbgeng/dbgeng.c
+46
-2
dbgeng.c
dlls/dbgeng/tests/dbgeng.c
+9
-0
No files found.
dlls/dbgeng/dbgeng.c
View file @
f2f9d8b2
...
...
@@ -57,6 +57,7 @@ struct target_process
unsigned
int
unloaded
;
BOOL
initialized
;
}
modules
;
ULONG
cpu_type
;
};
struct
debug_client
...
...
@@ -79,6 +80,21 @@ static struct target_process *debug_client_get_target(struct debug_client *debug
return
LIST_ENTRY
(
list_head
(
&
debug_client
->
targets
),
struct
target_process
,
entry
);
}
static
WORD
debug_target_get_module_machine
(
struct
target_process
*
target
,
HMODULE
module
)
{
IMAGE_DOS_HEADER
dos
=
{
0
};
WORD
machine
=
0
;
ReadProcessMemory
(
target
->
handle
,
module
,
&
dos
,
sizeof
(
dos
),
NULL
);
if
(
dos
.
e_magic
==
IMAGE_DOS_SIGNATURE
)
{
ReadProcessMemory
(
target
->
handle
,
(
const
char
*
)
module
+
dos
.
e_lfanew
+
4
/* signature */
,
&
machine
,
sizeof
(
machine
),
NULL
);
}
return
machine
;
}
static
HRESULT
debug_target_init_modules_info
(
struct
target_process
*
target
)
{
unsigned
int
i
,
count
;
...
...
@@ -123,6 +139,8 @@ static HRESULT debug_target_init_modules_info(struct target_process *target)
}
}
target
->
cpu_type
=
debug_target_get_module_machine
(
target
,
modules
[
0
]);
heap_free
(
modules
);
target
->
modules
.
loaded
=
count
;
...
...
@@ -2465,9 +2483,35 @@ static HRESULT STDMETHODCALLTYPE debugcontrol_GetPageSize(IDebugControl2 *iface,
static
HRESULT
STDMETHODCALLTYPE
debugcontrol_IsPointer64Bit
(
IDebugControl2
*
iface
)
{
FIXME
(
"%p stub.
\n
"
,
iface
);
struct
debug_client
*
debug_client
=
impl_from_IDebugControl2
(
iface
);
static
struct
target_process
*
target
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p.
\n
"
,
iface
);
if
(
!
(
target
=
debug_client_get_target
(
debug_client
)))
return
E_UNEXPECTED
;
if
(
FAILED
(
hr
=
debug_target_init_modules_info
(
target
)))
return
hr
;
switch
(
target
->
cpu_type
)
{
case
IMAGE_FILE_MACHINE_I386
:
case
IMAGE_FILE_MACHINE_ARM
:
hr
=
S_FALSE
;
break
;
case
IMAGE_FILE_MACHINE_IA64
:
case
IMAGE_FILE_MACHINE_AMD64
:
case
IMAGE_FILE_MACHINE_ARM64
:
hr
=
S_OK
;
break
;
default:
FIXME
(
"Unexpected cpu type %#x.
\n
"
,
target
->
cpu_type
);
hr
=
E_UNEXPECTED
;
}
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
debugcontrol_ReadBugCheckData
(
IDebugControl2
*
iface
,
ULONG
*
code
,
ULONG64
*
arg1
,
...
...
dlls/dbgeng/tests/dbgeng.c
View file @
f2f9d8b2
...
...
@@ -347,6 +347,9 @@ static void test_module_information(void)
hr
=
client
->
lpVtbl
->
QueryInterface
(
client
,
&
IID_IDebugDataSpaces
,
(
void
**
)
&
dataspaces
);
ok
(
hr
==
S_OK
,
"Failed to get interface pointer, hr %#x.
\n
"
,
hr
);
hr
=
control
->
lpVtbl
->
IsPointer64Bit
(
control
);
ok
(
hr
==
E_UNEXPECTED
,
"Unexpected hr %#x.
\n
"
,
hr
);
event
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
event_name
);
ok
(
event
!=
NULL
,
"Failed to create event.
\n
"
);
...
...
@@ -359,9 +362,15 @@ static void test_module_information(void)
hr
=
client
->
lpVtbl
->
AttachProcess
(
client
,
0
,
info
.
dwProcessId
,
DEBUG_ATTACH_NONINVASIVE
);
ok
(
hr
==
S_OK
,
"Failed to attach to process, hr %#x.
\n
"
,
hr
);
hr
=
control
->
lpVtbl
->
IsPointer64Bit
(
control
);
ok
(
hr
==
E_UNEXPECTED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
control
->
lpVtbl
->
WaitForEvent
(
control
,
0
,
INFINITE
);
ok
(
hr
==
S_OK
,
"Waiting for event failed, hr %#x.
\n
"
,
hr
);
hr
=
control
->
lpVtbl
->
IsPointer64Bit
(
control
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get pointer length, hr %#x.
\n
"
,
hr
);
/* Number of modules. */
hr
=
symbols
->
lpVtbl
->
GetNumberModules
(
symbols
,
&
loaded
,
&
unloaded
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
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