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
f21096ad
Commit
f21096ad
authored
Nov 05, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't force anonymous file mappings to always be fully committed.
parent
cdce50f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
25 deletions
+7
-25
virtual.c
dlls/kernel32/tests/virtual.c
+0
-5
virtual.c
dlls/ntdll/virtual.c
+7
-20
No files found.
dlls/kernel32/tests/virtual.c
View file @
f21096ad
...
...
@@ -531,9 +531,7 @@ static void test_MapViewOfFile(void)
ok
(
info
.
AllocationBase
==
ptr
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
MAPPING_SIZE
,
"RegionSize should have been 0x%x but was 0x%x
\n
"
,
MAPPING_SIZE
,
(
unsigned
int
)
info
.
RegionSize
);
todo_wine
ok
(
info
.
State
==
MEM_RESERVE
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
todo_wine
ok
(
info
.
Protect
==
0
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
...
...
@@ -543,9 +541,7 @@ todo_wine
ok
(
info
.
AllocationBase
==
ptr2
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
MAPPING_SIZE
,
"RegionSize should have been 0x%x but was 0x%x
\n
"
,
MAPPING_SIZE
,
(
unsigned
int
)
info
.
RegionSize
);
todo_wine
ok
(
info
.
State
==
MEM_RESERVE
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
todo_wine
ok
(
info
.
Protect
==
0
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
...
...
@@ -570,7 +566,6 @@ todo_wine
ok
(
info
.
BaseAddress
==
ptr2
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr2
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
todo_wine
ok
(
info
.
RegionSize
==
0x10000
,
"RegionSize should have been 0x10000 but was 0x%x
\n
"
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_COMMIT
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
PAGE_READWRITE
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
...
...
dlls/ntdll/virtual.c
View file @
f21096ad
...
...
@@ -824,7 +824,7 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start
off_t
offset
,
unsigned
int
vprot
,
BOOL
removable
)
{
void
*
ptr
;
int
prot
=
VIRTUAL_GetUnixProt
(
vprot
);
int
prot
=
VIRTUAL_GetUnixProt
(
vprot
|
VPROT_COMMITTED
/* make sure it is accessible */
);
BOOL
shared_write
=
(
vprot
&
VPROT_WRITE
)
!=
0
;
assert
(
start
<
view
->
size
);
...
...
@@ -1422,15 +1422,15 @@ void VIRTUAL_SetForceExec( BOOL enable )
LIST_FOR_EACH_ENTRY
(
view
,
&
views_list
,
struct
file_view
,
entry
)
{
UINT
i
,
count
;
int
unix_prot
;
char
*
addr
=
view
->
base
;
BYTE
prot
=
view
->
prot
[
0
];
BYTE
commit
=
view
->
mapping
?
VPROT_COMMITTED
:
0
;
/* file mappings are always accessible */
int
unix_prot
=
VIRTUAL_GetUnixProt
(
view
->
prot
[
0
]
|
commit
);
if
(
view
->
protect
&
VPROT_NOEXEC
)
continue
;
for
(
count
=
i
=
1
;
i
<
view
->
size
>>
page_shift
;
i
++
,
count
++
)
{
i
f
(
view
->
prot
[
i
]
==
prot
)
continue
;
unix_prot
=
VIRTUAL_GetUnixProt
(
prot
)
;
i
nt
prot
=
VIRTUAL_GetUnixProt
(
view
->
prot
[
i
]
|
commit
)
;
if
(
prot
==
unix_prot
)
continue
;
if
((
unix_prot
&
PROT_READ
)
&&
!
(
unix_prot
&
PROT_EXEC
))
{
TRACE
(
"%s exec prot for %p-%p
\n
"
,
...
...
@@ -1440,12 +1440,11 @@ void VIRTUAL_SetForceExec( BOOL enable )
unix_prot
|
(
force_exec_prot
?
PROT_EXEC
:
0
)
);
}
addr
+=
(
count
<<
page_shift
);
prot
=
view
->
prot
[
i
]
;
unix_prot
=
prot
;
count
=
0
;
}
if
(
count
)
{
unix_prot
=
VIRTUAL_GetUnixProt
(
prot
);
if
((
unix_prot
&
PROT_READ
)
&&
!
(
unix_prot
&
PROT_EXEC
))
{
TRACE
(
"%s exec prot for %p-%p
\n
"
,
...
...
@@ -2012,11 +2011,7 @@ NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJEC
}
vprot
=
VIRTUAL_GetProt
(
protect
);
if
(
sec_flags
&
SEC_RESERVE
)
{
if
(
file
)
return
STATUS_INVALID_PARAMETER
;
}
else
vprot
|=
VPROT_COMMITTED
;
if
(
!
(
sec_flags
&
SEC_RESERVE
))
vprot
|=
VPROT_COMMITTED
;
if
(
sec_flags
&
SEC_NOCACHE
)
vprot
|=
VPROT_NOCACHE
;
if
(
sec_flags
&
SEC_IMAGE
)
vprot
|=
VPROT_IMAGE
;
...
...
@@ -2200,14 +2195,6 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
goto
done
;
}
/* FIXME: If a mapping is created with SEC_RESERVE and a process,
* which has a view of this mapping commits some pages, they will
* appear committed in all other processes, which have the same
* view created. Since we don't support this yet, we create the
* whole mapping committed.
*/
prot
|=
VPROT_COMMITTED
;
/* Reserve a properly aligned area */
server_enter_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
...
...
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