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
2ff7a767
Commit
2ff7a767
authored
Jun 23, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a native_machine global variable.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a7f39e3f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
4 deletions
+7
-4
debugger.c
server/debugger.c
+1
-1
mapping.c
server/mapping.c
+1
-1
object.h
server/object.h
+1
-0
process.c
server/process.c
+1
-1
registry.c
server/registry.c
+3
-1
No files found.
server/debugger.c
View file @
2ff7a767
...
@@ -134,7 +134,7 @@ static const struct object_ops debug_obj_ops =
...
@@ -134,7 +134,7 @@ static const struct object_ops debug_obj_ops =
/* get a pointer to TEB->ArbitraryUserPointer in the client address space */
/* get a pointer to TEB->ArbitraryUserPointer in the client address space */
static
client_ptr_t
get_teb_user_ptr
(
struct
thread
*
thread
)
static
client_ptr_t
get_teb_user_ptr
(
struct
thread
*
thread
)
{
{
unsigned
int
ptr_size
=
is_machine_64bit
(
supported_machines
[
0
]
)
?
8
:
4
;
unsigned
int
ptr_size
=
is_machine_64bit
(
native_machine
)
?
8
:
4
;
return
thread
->
teb
+
5
*
ptr_size
;
return
thread
->
teb
+
5
*
ptr_size
;
}
}
...
...
server/mapping.c
View file @
2ff7a767
...
@@ -717,7 +717,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
...
@@ -717,7 +717,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
break
;
break
;
case
IMAGE_NT_OPTIONAL_HDR64_MAGIC
:
case
IMAGE_NT_OPTIONAL_HDR64_MAGIC
:
if
(
!
is_machine_64bit
(
supported_machines
[
0
]
))
return
STATUS_INVALID_IMAGE_WIN_64
;
if
(
!
is_machine_64bit
(
native_machine
))
return
STATUS_INVALID_IMAGE_WIN_64
;
if
(
!
is_machine_64bit
(
nt
.
FileHeader
.
Machine
))
return
STATUS_INVALID_IMAGE_FORMAT
;
if
(
!
is_machine_64bit
(
nt
.
FileHeader
.
Machine
))
return
STATUS_INVALID_IMAGE_FORMAT
;
if
(
!
is_machine_supported
(
nt
.
FileHeader
.
Machine
))
return
STATUS_INVALID_IMAGE_FORMAT
;
if
(
!
is_machine_supported
(
nt
.
FileHeader
.
Machine
))
return
STATUS_INVALID_IMAGE_FORMAT
;
...
...
server/object.h
View file @
2ff7a767
...
@@ -240,6 +240,7 @@ extern void generate_startup_debug_events( struct process *process );
...
@@ -240,6 +240,7 @@ extern void generate_startup_debug_events( struct process *process );
extern
unsigned
int
supported_machines_count
;
extern
unsigned
int
supported_machines_count
;
extern
unsigned
short
supported_machines
[
8
];
extern
unsigned
short
supported_machines
[
8
];
extern
unsigned
short
native_machine
;
extern
void
init_registry
(
void
);
extern
void
init_registry
(
void
);
extern
void
flush_registry
(
void
);
extern
void
flush_registry
(
void
);
...
...
server/process.c
View file @
2ff7a767
...
@@ -1088,7 +1088,7 @@ int set_process_debug_flag( struct process *process, int flag )
...
@@ -1088,7 +1088,7 @@ int set_process_debug_flag( struct process *process, int flag )
char
data
=
(
flag
!=
0
);
char
data
=
(
flag
!=
0
);
client_ptr_t
peb32
=
0
;
client_ptr_t
peb32
=
0
;
if
(
!
is_machine_64bit
(
process
->
machine
)
&&
is_machine_64bit
(
supported_machines
[
0
]
))
if
(
!
is_machine_64bit
(
process
->
machine
)
&&
is_machine_64bit
(
native_machine
))
peb32
=
process
->
peb
+
0x1000
;
peb32
=
process
->
peb
+
0x1000
;
/* BeingDebugged flag is the byte at offset 2 in the PEB */
/* BeingDebugged flag is the byte at offset 2 in the PEB */
...
...
server/registry.c
View file @
2ff7a767
...
@@ -147,6 +147,7 @@ static struct save_branch_info save_branch_info[MAX_SAVE_BRANCH_INFO];
...
@@ -147,6 +147,7 @@ static struct save_branch_info save_branch_info[MAX_SAVE_BRANCH_INFO];
unsigned
int
supported_machines_count
=
0
;
unsigned
int
supported_machines_count
=
0
;
unsigned
short
supported_machines
[
8
];
unsigned
short
supported_machines
[
8
];
unsigned
short
native_machine
=
0
;
/* information about a file being loaded */
/* information about a file being loaded */
struct
file_load_info
struct
file_load_info
...
@@ -1790,6 +1791,7 @@ static void init_supported_machines(void)
...
@@ -1790,6 +1791,7 @@ static void init_supported_machines(void)
#error Unsupported machine
#error Unsupported machine
#endif
#endif
supported_machines_count
=
count
;
supported_machines_count
=
count
;
native_machine
=
supported_machines
[
0
];
}
}
/* registry initialisation */
/* registry initialisation */
...
@@ -2071,7 +2073,7 @@ void flush_registry(void)
...
@@ -2071,7 +2073,7 @@ void flush_registry(void)
/* determine if the thread is wow64 (32-bit client running on 64-bit prefix) */
/* determine if the thread is wow64 (32-bit client running on 64-bit prefix) */
static
int
is_wow64_thread
(
struct
thread
*
thread
)
static
int
is_wow64_thread
(
struct
thread
*
thread
)
{
{
return
(
is_machine_64bit
(
supported_machines
[
0
]
)
&&
!
is_machine_64bit
(
thread
->
process
->
machine
));
return
(
is_machine_64bit
(
native_machine
)
&&
!
is_machine_64bit
(
thread
->
process
->
machine
));
}
}
...
...
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