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
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
alloc_type
,
protect
,
machine
);
}
/***********************************************************************
* NtUnmapViewOfSection (NTDLL.@)
* ZwUnmapViewOfSection (NTDLL.@)
* unmap_view_of_section
*
* 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
;
unsigned
int
status
=
STATUS_NOT_MAPPED_VIEW
;
...
...
@@ -5244,42 +5246,52 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
}
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
;
if
(
builtin
->
refcount
>
1
)
{
TRACE
(
"not freeing in-use builtin %p
\n
"
,
view
->
base
);
builtin
->
refcount
--
;
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
return
STATUS_SUCCESS
;
}
TRACE
(
"not freeing in-use builtin %p
\n
"
,
view
->
base
);
builtin
->
refcount
--
;
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
return
STATUS_SUCCESS
;
}
}
}
SERVER_START_REQ
(
unmap_view
)
{
req
->
base
=
wine_server_client_ptr
(
view
->
base
);
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_START_REQ
(
unmap_view
)
{
req
->
base
=
wine_server_client_ptr
(
view
->
base
);
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
);
done:
server_leave_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
return
status
;
}
/***********************************************************************
* NtUnmapViewOfSection (NTDLL.@)
* ZwUnmapViewOfSection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtUnmapViewOfSection
(
HANDLE
process
,
PVOID
addr
)
{
return
unmap_view_of_section
(
process
,
addr
);
}
/***********************************************************************
* NtUnmapViewOfSectionEx (NTDLL.@)
* ZwUnmapViewOfSectionEx (NTDLL.@)
...
...
@@ -5287,7 +5299,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
NTSTATUS
WINAPI
NtUnmapViewOfSectionEx
(
HANDLE
process
,
PVOID
addr
,
ULONG
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