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
11cd5113
Commit
11cd5113
authored
Jun 13, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Support the lower memory limit in MEM_ADDRESS_REQUIREMENTS.
parent
2705e6c3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
129 additions
and
50 deletions
+129
-50
virtual.c
dlls/ntdll/tests/virtual.c
+62
-0
loader.c
dlls/ntdll/unix/loader.c
+19
-16
server.c
dlls/ntdll/unix/server.c
+15
-12
thread.c
dlls/ntdll/unix/thread.c
+4
-4
unix_private.h
dlls/ntdll/unix/unix_private.h
+9
-7
virtual.c
dlls/ntdll/unix/virtual.c
+0
-0
server_protocol.h
include/wine/server_protocol.h
+7
-4
protocol.def
server/protocol.def
+6
-3
request.h
server/request.h
+1
-1
trace.c
server/trace.c
+5
-2
make_requests
tools/make_requests
+1
-1
No files found.
dlls/ntdll/tests/virtual.c
View file @
11cd5113
...
...
@@ -906,6 +906,68 @@ static void test_NtAllocateVirtualMemoryEx_address_requirements(void)
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
void
*
)
0x20001000
;
a
.
Alignment
=
0
;
size
=
0x1000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
void
*
)(
0x20001000
-
1
);
size
=
0x1000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
void
*
)(
0x20001000
+
1
);
size
=
0x1000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
void
*
)
0x30000000
;
a
.
HighestEndingAddress
=
(
void
*
)
0x20000000
;
size
=
0x1000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
void
*
)
0x20000000
;
a
.
HighestEndingAddress
=
0
;
size
=
0x1000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
!
status
,
"Unexpected status %08lx.
\n
"
,
status
);
ok
(
addr
>=
(
void
*
)
0x20000000
,
"Unexpected addr %p.
\n
"
,
addr
);
size
=
0
;
status
=
NtFreeVirtualMemory
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
ok
(
!
status
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
void
*
)
0x20000000
;
a
.
HighestEndingAddress
=
(
void
*
)
0x2fffffff
;
size
=
0x1000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
!
status
,
"Unexpected status %08lx.
\n
"
,
status
);
ok
(
addr
>=
(
void
*
)
0x20000000
&&
addr
<
(
void
*
)
0x30000000
,
"Unexpected addr %p.
\n
"
,
addr
);
size
=
0
;
status
=
NtFreeVirtualMemory
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
ok
(
!
status
,
"Unexpected status %08lx.
\n
"
,
status
);
a
.
LowestStartingAddress
=
(
char
*
)
si
.
lpMaximumApplicationAddress
+
1
;
a
.
HighestEndingAddress
=
0
;
size
=
0x10000
;
addr
=
NULL
;
status
=
pNtAllocateVirtualMemoryEx
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RESERVE
,
PAGE_EXECUTE_READWRITE
,
ext
,
1
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Unexpected status %08lx.
\n
"
,
status
);
}
struct
test_stack_size_thread_args
...
...
dlls/ntdll/unix/loader.c
View file @
11cd5113
...
...
@@ -1396,7 +1396,8 @@ static NTSTATUS open_dll_file( const char *name, OBJECT_ATTRIBUTES *attr, HANDLE
*/
static
NTSTATUS
open_builtin_pe_file
(
const
char
*
name
,
OBJECT_ATTRIBUTES
*
attr
,
void
**
module
,
SIZE_T
*
size
,
SECTION_IMAGE_INFORMATION
*
image_info
,
ULONG_PTR
limit
,
WORD
machine
,
BOOL
prefer_native
)
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
,
WORD
machine
,
BOOL
prefer_native
)
{
NTSTATUS
status
;
HANDLE
mapping
;
...
...
@@ -1405,7 +1406,8 @@ static NTSTATUS open_builtin_pe_file( const char *name, OBJECT_ATTRIBUTES *attr,
status
=
open_dll_file
(
name
,
attr
,
&
mapping
);
if
(
!
status
)
{
status
=
virtual_map_builtin_module
(
mapping
,
module
,
size
,
image_info
,
limit
,
machine
,
prefer_native
);
status
=
virtual_map_builtin_module
(
mapping
,
module
,
size
,
image_info
,
limit_low
,
limit_high
,
machine
,
prefer_native
);
NtClose
(
mapping
);
}
return
status
;
...
...
@@ -1447,8 +1449,9 @@ static NTSTATUS open_builtin_so_file( const char *name, OBJECT_ATTRIBUTES *attr,
* find_builtin_dll
*/
static
NTSTATUS
find_builtin_dll
(
UNICODE_STRING
*
nt_name
,
void
**
module
,
SIZE_T
*
size_ptr
,
SECTION_IMAGE_INFORMATION
*
image_info
,
ULONG_PTR
limit
,
USHORT
search_machine
,
USHORT
load_machine
,
BOOL
prefer_native
)
SECTION_IMAGE_INFORMATION
*
image_info
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
,
USHORT
search_machine
,
USHORT
load_machine
,
BOOL
prefer_native
)
{
unsigned
int
i
,
pos
,
namepos
,
maxlen
=
0
;
unsigned
int
len
=
nt_name
->
Length
/
sizeof
(
WCHAR
);
...
...
@@ -1487,7 +1490,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file
[
pos
+
len
+
1
]
=
0
;
ptr
=
prepend_build_dir_path
(
file
+
pos
,
".dll"
,
pe_dir
,
"/dlls"
);
status
=
open_builtin_pe_file
(
ptr
,
&
attr
,
module
,
size_ptr
,
image_info
,
limit
,
load_machine
,
prefer_native
);
limit
_low
,
limit_high
,
load_machine
,
prefer_native
);
ptr
=
prepend_build_dir_path
(
file
+
pos
,
".dll"
,
""
,
"/dlls"
);
if
(
status
!=
STATUS_DLL_NOT_FOUND
)
goto
done
;
if
(
try_so
)
...
...
@@ -1501,7 +1504,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file
[
pos
+
len
+
1
]
=
0
;
ptr
=
prepend_build_dir_path
(
file
+
pos
,
".exe"
,
pe_dir
,
"/programs"
);
status
=
open_builtin_pe_file
(
ptr
,
&
attr
,
module
,
size_ptr
,
image_info
,
limit
,
load_machine
,
prefer_native
);
limit
_low
,
limit_high
,
load_machine
,
prefer_native
);
ptr
=
prepend_build_dir_path
(
file
+
pos
,
".exe"
,
""
,
"/programs"
);
if
(
status
!=
STATUS_DLL_NOT_FOUND
)
goto
done
;
if
(
try_so
)
...
...
@@ -1518,7 +1521,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file
[
pos
+
len
+
1
]
=
0
;
ptr
=
prepend
(
ptr
,
pe_dir
,
strlen
(
pe_dir
)
);
ptr
=
prepend
(
ptr
,
dll_paths
[
i
],
strlen
(
dll_paths
[
i
])
);
status
=
open_builtin_pe_file
(
ptr
,
&
attr
,
module
,
size_ptr
,
image_info
,
limit
,
status
=
open_builtin_pe_file
(
ptr
,
&
attr
,
module
,
size_ptr
,
image_info
,
limit
_low
,
limit_high
,
load_machine
,
prefer_native
);
/* use so dir for unix lib */
ptr
=
file
+
pos
;
...
...
@@ -1533,7 +1536,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
}
file
[
pos
+
len
+
1
]
=
0
;
ptr
=
prepend
(
file
+
pos
,
dll_paths
[
i
],
strlen
(
dll_paths
[
i
])
);
status
=
open_builtin_pe_file
(
ptr
,
&
attr
,
module
,
size_ptr
,
image_info
,
limit
,
status
=
open_builtin_pe_file
(
ptr
,
&
attr
,
module
,
size_ptr
,
image_info
,
limit
_low
,
limit_high
,
load_machine
,
prefer_native
);
if
(
status
==
STATUS_NOT_SUPPORTED
)
{
...
...
@@ -1568,7 +1571,7 @@ done:
* Return STATUS_IMAGE_ALREADY_LOADED if we should keep the native one that we have found.
*/
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
WCHAR
*
filename
,
USHORT
machine
,
void
**
module
,
SIZE_T
*
size
,
ULONG_PTR
limit
)
void
**
module
,
SIZE_T
*
size
,
ULONG_PTR
limit
_low
,
ULONG_PTR
limit_high
)
{
NTSTATUS
status
;
UNICODE_STRING
nt_name
;
...
...
@@ -1598,10 +1601,10 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, USHOR
case
LO_NATIVE_BUILTIN
:
return
STATUS_IMAGE_ALREADY_LOADED
;
case
LO_BUILTIN
:
return
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
limit
,
return
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
limit
_low
,
limit_high
,
image_info
->
machine
,
machine
,
FALSE
);
default:
status
=
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
limit
,
status
=
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
limit
_low
,
limit_high
,
image_info
->
machine
,
machine
,
(
loadorder
==
LO_DEFAULT
)
);
if
(
status
==
STATUS_DLL_NOT_FOUND
||
status
==
STATUS_NOT_SUPPORTED
)
return
STATUS_IMAGE_ALREADY_LOADED
;
...
...
@@ -1691,7 +1694,7 @@ static NTSTATUS open_main_image( WCHAR *image, void **module, SECTION_IMAGE_INFO
status
=
open_dll_file
(
unix_name
,
&
attr
,
&
mapping
);
if
(
!
status
)
{
status
=
virtual_map_module
(
mapping
,
module
,
&
size
,
info
,
0
,
machine
);
status
=
virtual_map_module
(
mapping
,
module
,
&
size
,
info
,
0
,
0
,
machine
);
if
(
status
==
STATUS_IMAGE_MACHINE_TYPE_MISMATCH
&&
info
->
ComPlusNativeReady
)
{
info
->
Machine
=
native_machine
;
...
...
@@ -1763,7 +1766,7 @@ NTSTATUS load_main_exe( const WCHAR *dos_name, const char *unix_name, const WCHA
/* if path is in system dir, we can load the builtin even if the file itself doesn't exist */
if
(
loadorder
!=
LO_NATIVE
&&
is_builtin_path
(
&
nt_name
,
&
search_machine
))
{
status
=
find_builtin_dll
(
&
nt_name
,
module
,
&
size
,
&
main_image_info
,
0
,
status
=
find_builtin_dll
(
&
nt_name
,
module
,
&
size
,
&
main_image_info
,
0
,
0
,
search_machine
,
load_machine
,
FALSE
);
if
(
status
!=
STATUS_DLL_NOT_FOUND
)
return
status
;
}
...
...
@@ -1793,7 +1796,7 @@ NTSTATUS load_start_exe( WCHAR **image, void **module )
wcscpy
(
*
image
,
get_machine_wow64_dir
(
current_machine
));
wcscat
(
*
image
,
startW
);
init_unicode_string
(
&
nt_name
,
*
image
);
status
=
find_builtin_dll
(
&
nt_name
,
module
,
&
size
,
&
main_image_info
,
0
,
current_machine
,
0
,
FALSE
);
status
=
find_builtin_dll
(
&
nt_name
,
module
,
&
size
,
&
main_image_info
,
0
,
0
,
current_machine
,
0
,
FALSE
);
if
(
status
)
{
MESSAGE
(
"wine: failed to load start.exe: %x
\n
"
,
status
);
...
...
@@ -1897,7 +1900,7 @@ static void load_ntdll(void)
name
=
malloc
(
strlen
(
ntdll_dir
)
+
strlen
(
pe_dir
)
+
sizeof
(
"/ntdll.dll.so"
)
);
if
(
build_dir
)
sprintf
(
name
,
"%s%s/ntdll.dll"
,
ntdll_dir
,
pe_dir
);
else
sprintf
(
name
,
"%s%s/ntdll.dll"
,
dll_dir
,
pe_dir
);
status
=
open_builtin_pe_file
(
name
,
&
attr
,
&
module
,
&
size
,
&
info
,
0
,
current_machine
,
FALSE
);
status
=
open_builtin_pe_file
(
name
,
&
attr
,
&
module
,
&
size
,
&
info
,
0
,
0
,
current_machine
,
FALSE
);
if
(
status
==
STATUS_DLL_NOT_FOUND
)
{
sprintf
(
name
,
"%s/ntdll.dll.so"
,
ntdll_dir
);
...
...
@@ -1997,7 +2000,7 @@ static void load_wow64_ntdll( USHORT machine )
wcscpy
(
path
,
get_machine_wow64_dir
(
machine
));
wcscat
(
path
,
ntdllW
);
init_unicode_string
(
&
nt_name
,
path
);
status
=
find_builtin_dll
(
&
nt_name
,
&
module
,
&
size
,
&
info
,
0
,
machine
,
0
,
FALSE
);
status
=
find_builtin_dll
(
&
nt_name
,
&
module
,
&
size
,
&
info
,
0
,
0
,
machine
,
0
,
FALSE
);
switch
(
status
)
{
case
STATUS_IMAGE_NOT_AT_BASE
:
...
...
dlls/ntdll/unix/server.c
View file @
11cd5113
...
...
@@ -423,21 +423,22 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
result
->
virtual_alloc_ex
.
status
=
STATUS_WORKING_SET_LIMIT_RANGE
;
break
;
}
if
(
call
->
virtual_alloc_ex
.
limit
||
call
->
virtual_alloc_ex
.
align
)
if
(
call
->
virtual_alloc_ex
.
limit
_low
||
call
->
virtual_alloc_ex
.
limit_high
||
call
->
virtual_alloc_ex
.
align
)
{
SYSTEM_BASIC_INFORMATION
sbi
;
SIZE_T
limit
,
align
;
SIZE_T
limit
_low
,
limit_high
,
align
;
virtual_get_system_info
(
&
sbi
,
is_wow64
()
);
limit
=
min
(
(
ULONG_PTR
)
sbi
.
HighestUserAddress
,
call
->
virtual_alloc_ex
.
limit
);
limit_low
=
call
->
virtual_alloc_ex
.
limit_low
;
limit_high
=
min
(
(
ULONG_PTR
)
sbi
.
HighestUserAddress
,
call
->
virtual_alloc_ex
.
limit_high
);
align
=
call
->
virtual_alloc_ex
.
align
;
if
(
align
!=
call
->
virtual_alloc_ex
.
align
)
if
(
limit_low
!=
call
->
virtual_alloc_ex
.
limit_low
||
align
!=
call
->
virtual_alloc_ex
.
align
)
{
result
->
virtual_alloc_ex
.
status
=
STATUS_WORKING_SET_LIMIT_RANGE
;
break
;
}
r
.
LowestStartingAddress
=
NULL
;
r
.
HighestEndingAddress
=
(
void
*
)
limit
;
r
.
LowestStartingAddress
=
(
void
*
)
limit_low
;
r
.
HighestEndingAddress
=
(
void
*
)
limit
_high
;
r
.
Alignment
=
align
;
ext
[
count
].
Type
=
MemExtendedParameterAddressRequirements
;
ext
[
count
].
Pointer
=
&
r
;
...
...
@@ -572,25 +573,27 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
MEM_EXTENDED_PARAMETER
ext
[
2
];
ULONG
count
=
0
;
LARGE_INTEGER
offset
;
ULONG_PTR
limit_low
,
limit_high
;
result
->
type
=
call
->
type
;
addr
=
wine_server_get_ptr
(
call
->
map_view_ex
.
addr
);
size
=
call
->
map_view_ex
.
size
;
offset
.
QuadPart
=
call
->
map_view_ex
.
offset
;
if
((
ULONG_PTR
)
addr
!=
call
->
map_view_ex
.
addr
||
size
!=
call
->
map_view_ex
.
size
)
limit_low
=
call
->
map_view_ex
.
limit_low
;
if
((
ULONG_PTR
)
addr
!=
call
->
map_view_ex
.
addr
||
size
!=
call
->
map_view_ex
.
size
||
limit_low
!=
call
->
map_view_ex
.
limit_low
)
{
result
->
map_view_ex
.
status
=
STATUS_WORKING_SET_LIMIT_RANGE
;
break
;
}
if
(
call
->
map_view_ex
.
limit
)
if
(
call
->
map_view_ex
.
limit
_low
||
call
->
map_view_ex
.
limit_high
)
{
SYSTEM_BASIC_INFORMATION
sbi
;
ULONG_PTR
limit
;
virtual_get_system_info
(
&
sbi
,
is_wow64
()
);
limit
=
min
(
(
ULONG_PTR
)
sbi
.
HighestUserAddress
,
call
->
map_view_ex
.
limit
);
addr_req
.
LowestStartingAddress
=
NULL
;
addr_req
.
HighestEndingAddress
=
(
void
*
)
limit
;
limit
_high
=
min
(
(
ULONG_PTR
)
sbi
.
HighestUserAddress
,
call
->
map_view_ex
.
limit_high
);
addr_req
.
LowestStartingAddress
=
(
void
*
)
limit_low
;
addr_req
.
HighestEndingAddress
=
(
void
*
)
limit
_high
;
addr_req
.
Alignment
=
0
;
ext
[
count
].
Type
=
MemExtendedParameterAddressRequirements
;
ext
[
count
].
Pointer
=
&
addr_req
;
...
...
dlls/ntdll/unix/thread.c
View file @
11cd5113
...
...
@@ -1180,7 +1180,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE
NTSTATUS
status
;
/* kernel stack */
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
0
,
kernel_stack_size
,
kernel_stack_size
,
FALSE
)))
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
0
,
0
,
kernel_stack_size
,
kernel_stack_size
,
FALSE
)))
return
status
;
thread_data
->
kernel_stack
=
stack
.
DeallocationStack
;
...
...
@@ -1191,7 +1191,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE
((
get_machine_context_size
(
main_image_info
.
Machine
)
+
7
)
&
~
7
)
+
sizeof
(
ULONG64
);
/* 64-bit stack */
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
0
,
0x40000
,
0x40000
,
TRUE
)))
return
status
;
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
0
,
0
,
0
x40000
,
0x40000
,
TRUE
)))
return
status
;
cpu
=
(
WOW64_CPURESERVED
*
)(((
ULONG_PTR
)
stack
.
StackBase
-
cpusize
)
&
~
15
);
cpu
->
Machine
=
main_image_info
.
Machine
;
...
...
@@ -1201,7 +1201,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE
teb
->
DeallocationStack
=
stack
.
DeallocationStack
;
/* 32-bit stack */
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
limit
?
limit
:
0x7fffffff
,
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
0
,
limit
?
limit
:
0x7fffffff
,
reserve_size
,
commit_size
,
TRUE
)))
return
status
;
wow_teb
->
Tib
.
StackBase
=
PtrToUlong
(
stack
.
StackBase
);
...
...
@@ -1216,7 +1216,7 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR limit, SIZE_T reserve_size, SIZE
}
/* native stack */
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
limit
,
reserve_size
,
commit_size
,
TRUE
)))
if
((
status
=
virtual_alloc_thread_stack
(
&
stack
,
0
,
limit
,
reserve_size
,
commit_size
,
TRUE
)))
return
status
;
teb
->
Tib
.
StackBase
=
stack
.
StackBase
;
teb
->
Tib
.
StackLimit
=
stack
.
StackLimit
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
11cd5113
...
...
@@ -174,7 +174,7 @@ extern char **build_envp( const WCHAR *envW ) DECLSPEC_HIDDEN;
extern
char
*
get_alternate_wineloader
(
WORD
machine
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
exec_wineloader
(
char
**
argv
,
int
socketfd
,
const
pe_image_info_t
*
pe_info
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
WCHAR
*
filename
,
USHORT
machine
,
void
**
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG_PTR
limit
)
DECLSPEC_HIDDEN
;
void
**
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG_PTR
limit
_low
,
ULONG_PTR
limit_high
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_builtin_path
(
const
UNICODE_STRING
*
path
,
WORD
*
machine
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
load_main_exe
(
const
WCHAR
*
name
,
const
char
*
unix_name
,
const
WCHAR
*
curdir
,
USHORT
load_machine
,
WCHAR
**
image
,
void
**
module
)
DECLSPEC_HIDDEN
;
...
...
@@ -220,18 +220,20 @@ extern void *anon_mmap_alloc( size_t size, int prot ) DECLSPEC_HIDDEN;
extern
void
virtual_init
(
void
)
DECLSPEC_HIDDEN
;
extern
ULONG_PTR
get_system_affinity_mask
(
void
)
DECLSPEC_HIDDEN
;
extern
void
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
,
BOOL
wow64
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_map_builtin_module
(
HANDLE
mapping
,
void
**
module
,
SIZE_T
*
size
,
SECTION_IMAGE_INFORMATION
*
info
,
ULONG_PTR
limit
,
WORD
machine
,
BOOL
prefer_native
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_map_module
(
HANDLE
mapping
,
void
**
module
,
SIZE_T
*
size
,
SECTION_IMAGE_INFORMATION
*
info
,
ULONG_PTR
limit
,
USHORT
machine
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_map_builtin_module
(
HANDLE
mapping
,
void
**
module
,
SIZE_T
*
size
,
SECTION_IMAGE_INFORMATION
*
info
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
,
WORD
machine
,
BOOL
prefer_native
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_map_module
(
HANDLE
mapping
,
void
**
module
,
SIZE_T
*
size
,
SECTION_IMAGE_INFORMATION
*
info
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
,
USHORT
machine
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_create_builtin_view
(
void
*
module
,
const
UNICODE_STRING
*
nt_name
,
pe_image_info_t
*
info
,
void
*
so_handle
)
DECLSPEC_HIDDEN
;
extern
TEB
*
virtual_alloc_first_teb
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_teb
(
TEB
**
ret_teb
)
DECLSPEC_HIDDEN
;
extern
void
virtual_free_teb
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_clear_tls_index
(
ULONG
index
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
ULONG_PTR
limit
,
SIZE_T
reserve_size
,
SIZE_T
commit_size
,
BOOL
guard_page
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
ULONG_PTR
limit
_low
,
ULONG_PTR
limit_high
,
SIZE_T
reserve_size
,
SIZE_T
commit_size
,
BOOL
guard_page
)
DECLSPEC_HIDDEN
;
extern
void
virtual_map_user_shared_data
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_handle_fault
(
void
*
addr
,
DWORD
err
,
void
*
stack
)
DECLSPEC_HIDDEN
;
extern
unsigned
int
virtual_locked_server_call
(
void
*
req_ptr
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/virtual.c
View file @
11cd5113
This diff is collapsed.
Click to expand it.
include/wine/server_protocol.h
View file @
11cd5113
...
...
@@ -527,7 +527,8 @@ typedef union
unsigned
int
op_type
;
client_ptr_t
addr
;
mem_size_t
size
;
mem_size_t
limit
;
mem_size_t
limit_low
;
mem_size_t
limit_high
;
mem_size_t
align
;
unsigned
int
prot
;
unsigned
int
attributes
;
...
...
@@ -591,10 +592,12 @@ typedef union
client_ptr_t
addr
;
mem_size_t
size
;
file_pos_t
offset
;
mem_size_t
limit
;
mem_size_t
limit_low
;
mem_size_t
limit_high
;
unsigned
int
alloc_type
;
unsigned
short
prot
;
unsigned
int
prot
;
unsigned
short
machine
;
unsigned
short
__pad
[
3
];
}
map_view_ex
;
struct
{
...
...
@@ -6414,7 +6417,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 77
5
#define SERVER_PROTOCOL_VERSION 77
6
/* ### protocol_version end ### */
...
...
server/protocol.def
View file @
11cd5113
...
...
@@ -543,7 +543,8 @@ typedef union
unsigned int op_type; /* type of operation */
client_ptr_t addr; /* requested address */
mem_size_t size; /* allocation size */
mem_size_t limit; /* allocation address limit */
mem_size_t limit_low; /* allocation address limits */
mem_size_t limit_high;
mem_size_t align; /* allocation alignment */
unsigned int prot; /* memory protection flags */
unsigned int attributes; /* memory extended attributes */
...
...
@@ -607,10 +608,12 @@ typedef union
client_ptr_t addr; /* requested address */
mem_size_t size; /* allocation size */
file_pos_t offset; /* file offset */
mem_size_t limit; /* allocation address limit */
mem_size_t limit_low; /* allocation address limits */
mem_size_t limit_high;
unsigned int alloc_type; /* allocation type */
unsigned
short
prot; /* memory protection flags */
unsigned
int
prot; /* memory protection flags */
unsigned short machine; /* requested machine for image mappings */
unsigned short __pad[3];
} map_view_ex;
struct
{
...
...
server/request.h
View file @
11cd5113
...
...
@@ -689,7 +689,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
C_ASSERT
(
sizeof
(
abstime_t
)
==
8
);
C_ASSERT
(
sizeof
(
affinity_t
)
==
8
);
C_ASSERT
(
sizeof
(
apc_call_t
)
==
48
);
C_ASSERT
(
sizeof
(
apc_call_t
)
==
64
);
C_ASSERT
(
sizeof
(
apc_param_t
)
==
8
);
C_ASSERT
(
sizeof
(
apc_result_t
)
==
40
);
C_ASSERT
(
sizeof
(
async_data_t
)
==
40
);
...
...
server/trace.c
View file @
11cd5113
...
...
@@ -192,7 +192,8 @@ static void dump_apc_call( const char *prefix, const apc_call_t *call )
case
APC_VIRTUAL_ALLOC_EX
:
dump_uint64
(
"APC_VIRTUAL_ALLOC_EX,addr="
,
&
call
->
virtual_alloc_ex
.
addr
);
dump_uint64
(
",size="
,
&
call
->
virtual_alloc_ex
.
size
);
dump_uint64
(
",limit="
,
&
call
->
virtual_alloc_ex
.
limit
);
dump_uint64
(
",limit_low="
,
&
call
->
virtual_alloc_ex
.
limit_low
);
dump_uint64
(
",limit_high="
,
&
call
->
virtual_alloc_ex
.
limit_high
);
dump_uint64
(
",align="
,
&
call
->
virtual_alloc_ex
.
align
);
fprintf
(
stderr
,
",op_type=%x,prot=%x,attributes=%x"
,
call
->
virtual_alloc_ex
.
op_type
,
call
->
virtual_alloc_ex
.
prot
,
...
...
@@ -236,7 +237,8 @@ static void dump_apc_call( const char *prefix, const apc_call_t *call )
dump_uint64
(
",addr="
,
&
call
->
map_view_ex
.
addr
);
dump_uint64
(
",size="
,
&
call
->
map_view_ex
.
size
);
dump_uint64
(
",offset="
,
&
call
->
map_view_ex
.
offset
);
dump_uint64
(
",limit="
,
&
call
->
map_view_ex
.
limit
);
dump_uint64
(
",limit_low="
,
&
call
->
map_view_ex
.
limit_low
);
dump_uint64
(
",limit_high="
,
&
call
->
map_view_ex
.
limit_high
);
fprintf
(
stderr
,
",alloc_type=%x,prot=%x,machine=%04x"
,
call
->
map_view_ex
.
alloc_type
,
call
->
map_view_ex
.
prot
,
call
->
map_view_ex
.
machine
);
break
;
...
...
@@ -549,6 +551,7 @@ static void dump_varargs_apc_call( const char *prefix, data_size_t size )
dump_apc_call
(
prefix
,
call
);
size
=
sizeof
(
*
call
);
}
else
fprintf
(
stderr
,
"%s{}"
,
prefix
);
remove_data
(
size
);
}
...
...
tools/make_requests
View file @
11cd5113
...
...
@@ -53,7 +53,7 @@ my %formats =
"ioctl_code_t"
=>
[
4
,
4
,
"&dump_ioctl_code"
],
"hw_input_t"
=>
[
40
,
8
,
"&dump_hw_input"
],
# varargs-only structures
"apc_call_t"
=>
[
48
,
8
],
"apc_call_t"
=>
[
64
,
8
],
"context_t"
=>
[
1720
,
8
],
"cursor_pos_t"
=>
[
24
,
8
],
"debug_event_t"
=>
[
160
,
8
],
...
...
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