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
cd8f0fba
Commit
cd8f0fba
authored
Nov 11, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
May 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Factor out unmap_view_of_section() function.
parent
03096546
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
29 deletions
+41
-29
virtual.c
dlls/ntdll/unix/virtual.c
+41
-29
No files found.
dlls/ntdll/unix/virtual.c
View file @
cd8f0fba
...
@@ -5219,11 +5219,13 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr
...
@@ -5219,11 +5219,13 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr
alloc_type
,
protect
,
machine
);
alloc_type
,
protect
,
machine
);
}
}
/***********************************************************************
/***********************************************************************
* NtUnmapViewOfSection (NTDLL.@)
* unmap_view_of_section
* ZwUnmapViewOfSection (NTDLL.@)
*
* NtUnmapViewOfSection[Ex] implementation.
*/
*/
NTSTATUS
WINAPI
NtUnmapViewOfS
ection
(
HANDLE
process
,
PVOID
addr
)
static
NTSTATUS
unmap_view_of_s
ection
(
HANDLE
process
,
PVOID
addr
)
{
{
struct
file_view
*
view
;
struct
file_view
*
view
;
unsigned
int
status
=
STATUS_NOT_MAPPED_VIEW
;
unsigned
int
status
=
STATUS_NOT_MAPPED_VIEW
;
...
@@ -5244,42 +5246,52 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
...
@@ -5244,42 +5246,52 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
}
}
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
if
((
view
=
find_view
(
addr
,
0
))
&&
!
is_view_valloc
(
view
))
if
(
!
(
view
=
find_view
(
addr
,
0
))
||
is_view_valloc
(
view
))
goto
done
;
if
(
view
->
protect
&
VPROT_SYSTEM
)
{
{
if
(
view
->
protect
&
VPROT_SYSTEM
)
struct
builtin_module
*
builtin
;
{
struct
builtin_module
*
builtin
;
LIST_FOR_EACH_ENTRY
(
builtin
,
&
builtin_modules
,
struct
builtin_module
,
entry
)
LIST_FOR_EACH_ENTRY
(
builtin
,
&
builtin_modules
,
struct
builtin_module
,
entry
)
{
if
(
builtin
->
module
!=
view
->
base
)
continue
;
if
(
builtin
->
refcount
>
1
)
{
{
if
(
builtin
->
module
!=
view
->
base
)
continue
;
TRACE
(
"not freeing in-use builtin %p
\n
"
,
view
->
base
);
if
(
builtin
->
refcount
>
1
)
builtin
->
refcount
--
;
{
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
TRACE
(
"not freeing in-use builtin %p
\n
"
,
view
->
base
);
return
STATUS_SUCCESS
;
builtin
->
refcount
--
;
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
return
STATUS_SUCCESS
;
}
}
}
}
}
}
SERVER_START_REQ
(
unmap_view
)
SERVER_START_REQ
(
unmap_view
)
{
{
req
->
base
=
wine_server_client_ptr
(
view
->
base
);
req
->
base
=
wine_server_client_ptr
(
view
->
base
);
status
=
wine_server_call
(
req
);
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
if
(
!
status
)
{
if
(
view
->
protect
&
SEC_IMAGE
)
release_builtin_module
(
view
->
base
);
delete_view
(
view
);
}
else
FIXME
(
"failed to unmap %p %x
\n
"
,
view
->
base
,
status
);
}
}
SERVER_END_REQ
;
if
(
!
status
)
{
if
(
view
->
protect
&
SEC_IMAGE
)
release_builtin_module
(
view
->
base
);
delete_view
(
view
);
}
else
FIXME
(
"failed to unmap %p %x
\n
"
,
view
->
base
,
status
);
done:
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
return
status
;
return
status
;
}
}
/***********************************************************************
* NtUnmapViewOfSection (NTDLL.@)
* ZwUnmapViewOfSection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtUnmapViewOfSection
(
HANDLE
process
,
PVOID
addr
)
{
return
unmap_view_of_section
(
process
,
addr
);
}
/***********************************************************************
/***********************************************************************
* NtUnmapViewOfSectionEx (NTDLL.@)
* NtUnmapViewOfSectionEx (NTDLL.@)
* ZwUnmapViewOfSectionEx (NTDLL.@)
* ZwUnmapViewOfSectionEx (NTDLL.@)
...
@@ -5287,7 +5299,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
...
@@ -5287,7 +5299,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
NTSTATUS
WINAPI
NtUnmapViewOfSectionEx
(
HANDLE
process
,
PVOID
addr
,
ULONG
flags
)
NTSTATUS
WINAPI
NtUnmapViewOfSectionEx
(
HANDLE
process
,
PVOID
addr
,
ULONG
flags
)
{
{
if
(
flags
)
FIXME
(
"Ignoring flags %#x.
\n
"
,
(
int
)
flags
);
if
(
flags
)
FIXME
(
"Ignoring flags %#x.
\n
"
,
(
int
)
flags
);
return
NtUnmapViewOfS
ection
(
process
,
addr
);
return
unmap_view_of_s
ection
(
process
,
addr
);
}
}
/******************************************************************************
/******************************************************************************
...
...
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