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
e40eab97
Commit
e40eab97
authored
May 17, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Only check the is_wow64 flag on 32-bit platforms.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8ff0c12
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
19 deletions
+34
-19
process.c
dlls/ntdll/unix/process.c
+7
-8
server.c
dlls/ntdll/unix/server.c
+3
-1
thread.c
dlls/ntdll/unix/thread.c
+7
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+3
-1
virtual.c
dlls/ntdll/unix/virtual.c
+14
-8
No files found.
dlls/ntdll/unix/process.c
View file @
e40eab97
...
...
@@ -999,6 +999,7 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
pbi
.
BasePriority
=
reply
->
priority
;
pbi
.
UniqueProcessId
=
reply
->
pid
;
pbi
.
InheritedFromUniqueProcessId
=
reply
->
ppid
;
#ifndef _WIN64
if
(
is_wow64
)
{
if
(
reply
->
machine
!=
native_machine
)
...
...
@@ -1006,6 +1007,7 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
else
pbi
.
PebBaseAddress
=
NULL
;
}
#endif
}
}
SERVER_END_REQ
;
...
...
@@ -1260,20 +1262,17 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
if
(
size
!=
len
)
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
else
if
(
!
info
)
ret
=
STATUS_ACCESS_VIOLATION
;
else
if
(
!
handle
)
ret
=
STATUS_INVALID_HANDLE
;
else
if
(
handle
==
GetCurrentProcess
())
*
(
ULONG_PTR
*
)
info
=
!!
NtCurrentTeb
()
->
WowTebOffset
;
else
{
ULONG_PTR
val
=
0
;
if
(
handle
==
GetCurrentProcess
())
val
=
is_wow64
;
else
if
(
is_win64
||
is_wow64
)
SERVER_START_REQ
(
get_process_info
)
{
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
if
(
!
(
ret
=
wine_server_call
(
req
)))
val
=
(
reply
->
machine
!=
native_machine
);
}
SERVER_END_REQ
;
req
->
handle
=
wine_server_obj_handle
(
handle
);
if
(
!
(
ret
=
wine_server_call
(
req
)))
val
=
(
reply
->
machine
!=
native_machine
);
}
SERVER_END_REQ
;
*
(
ULONG_PTR
*
)
info
=
val
;
}
break
;
...
...
dlls/ntdll/unix/server.c
View file @
e40eab97
...
...
@@ -104,8 +104,10 @@ static const char *server_dir;
unsigned
int
supported_machines_count
=
0
;
USHORT
supported_machines
[
8
]
=
{
0
};
USHORT
native_machine
=
0
;
BOOL
is_wow64
=
FALSE
;
BOOL
process_exiting
=
FALSE
;
#ifndef _WIN64
BOOL
is_wow64
=
FALSE
;
#endif
timeout_t
server_start_time
=
0
;
/* time of server startup */
...
...
dlls/ntdll/unix/thread.c
View file @
e40eab97
...
...
@@ -233,7 +233,9 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
NTSTATUS
status
;
if
(
zero_bits
>
21
&&
zero_bits
<
32
)
return
STATUS_INVALID_PARAMETER_3
;
if
(
!
is_win64
&&
!
is_wow64
&&
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_3
;
#ifndef _WIN64
if
(
!
is_wow64
&&
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_3
;
#endif
if
(
process
!=
NtCurrentProcess
())
{
...
...
@@ -950,6 +952,7 @@ BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LA
#endif
}
#ifndef _WIN64
static
BOOL
is_process_wow64
(
const
CLIENT_ID
*
id
)
{
HANDLE
handle
;
...
...
@@ -965,6 +968,7 @@ static BOOL is_process_wow64( const CLIENT_ID *id )
}
return
ret
;
}
#endif
/******************************************************************************
* NtQueryInformationThread (NTDLL.@)
...
...
@@ -1000,6 +1004,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
SERVER_END_REQ
;
if
(
status
==
STATUS_SUCCESS
)
{
#ifndef _WIN64
if
(
is_wow64
)
{
if
(
is_process_wow64
(
&
info
.
ClientId
))
...
...
@@ -1007,6 +1012,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
else
info
.
TebBaseAddress
=
NULL
;
}
#endif
if
(
data
)
memcpy
(
data
,
&
info
,
min
(
length
,
sizeof
(
info
)
));
if
(
ret_len
)
*
ret_len
=
min
(
length
,
sizeof
(
info
)
);
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
e40eab97
...
...
@@ -125,13 +125,15 @@ extern WCHAR **main_wargv DECLSPEC_HIDDEN;
extern
const
WCHAR
system_dir
[]
DECLSPEC_HIDDEN
;
extern
unsigned
int
supported_machines_count
DECLSPEC_HIDDEN
;
extern
USHORT
supported_machines
[
8
]
DECLSPEC_HIDDEN
;
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
extern
BOOL
process_exiting
DECLSPEC_HIDDEN
;
extern
HANDLE
keyed_event
DECLSPEC_HIDDEN
;
extern
timeout_t
server_start_time
DECLSPEC_HIDDEN
;
extern
sigset_t
server_block_set
DECLSPEC_HIDDEN
;
extern
struct
_KUSER_SHARED_DATA
*
user_shared_data
DECLSPEC_HIDDEN
;
extern
SYSTEM_CPU_INFORMATION
cpu_info
DECLSPEC_HIDDEN
;
#ifndef _WIN64
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
#endif
#ifdef __i386__
extern
struct
ldt_copy
__wine_ldt_copy
DECLSPEC_HIDDEN
;
#endif
...
...
dlls/ntdll/unix/virtual.c
View file @
e40eab97
...
...
@@ -722,7 +722,9 @@ static void free_ranges_insert_view( struct file_view *view )
(
range
->
end
==
view_base
&&
next
->
base
>=
view_end
))
{
/* on Win64, assert that it's correctly aligned so we're not going to be in trouble later */
assert
(
(
!
is_win64
&&
!
is_wow64
)
||
view
->
base
==
view_base
);
#ifdef _WIN64
assert
(
view
->
base
==
view_base
);
#endif
WARN
(
"range %p - %p is already mapped
\n
"
,
view_base
,
view_end
);
return
;
}
...
...
@@ -2962,7 +2964,7 @@ NTSTATUS virtual_alloc_teb( TEB **ret_teb )
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
ptr
,
0
,
&
block_size
,
MEM_COMMIT
,
PAGE_READWRITE
);
}
*
ret_teb
=
teb
=
init_teb
(
ptr
,
NtCurrentTeb
()
->
Peb
,
is_wow64
);
*
ret_teb
=
teb
=
init_teb
(
ptr
,
NtCurrentTeb
()
->
Peb
,
!!
NtCurrentTeb
()
->
WowTebOffset
);
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
if
((
status
=
signal_alloc_thread
(
teb
)))
...
...
@@ -3674,7 +3676,9 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG_PTR z
if
(
!
size
)
return
STATUS_INVALID_PARAMETER
;
if
(
zero_bits
>
21
&&
zero_bits
<
32
)
return
STATUS_INVALID_PARAMETER_3
;
if
(
!
is_win64
&&
!
is_wow64
&&
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_3
;
#ifndef _WIN64
if
(
!
is_wow64
&&
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_3
;
#endif
if
(
process
!=
NtCurrentProcess
())
{
...
...
@@ -4344,8 +4348,6 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
/* Check parameters */
if
(
zero_bits
>
21
&&
zero_bits
<
32
)
return
STATUS_INVALID_PARAMETER_4
;
if
(
!
is_win64
&&
!
is_wow64
&&
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_4
;
/* If both addr_ptr and zero_bits are passed, they have match */
if
(
*
addr_ptr
&&
zero_bits
&&
zero_bits
<
32
&&
...
...
@@ -4356,10 +4358,14 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
return
STATUS_INVALID_PARAMETER_4
;
#ifndef _WIN64
if
(
!
is_wow64
&&
(
alloc_type
&
AT_ROUND_TO_PAGE
)
)
if
(
!
is_wow64
)
{
*
addr_ptr
=
ROUND_ADDR
(
*
addr_ptr
,
page_mask
);
mask
=
page_mask
;
if
(
zero_bits
>=
32
)
return
STATUS_INVALID_PARAMETER_4
;
if
(
alloc_type
&
AT_ROUND_TO_PAGE
)
{
*
addr_ptr
=
ROUND_ADDR
(
*
addr_ptr
,
page_mask
);
mask
=
page_mask
;
}
}
#endif
...
...
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