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
376bd69c
Commit
376bd69c
authored
Nov 10, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Handle NULL process handle in MapViewOfFile3().
Based on a patch by Nikolay Sivov.
parent
35b198c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
memory.c
dlls/kernelbase/memory.c
+2
-0
process.c
dlls/kernelbase/tests/process.c
+1
-1
virtual.c
dlls/ntdll/tests/virtual.c
+12
-0
No files found.
dlls/kernelbase/memory.c
View file @
376bd69c
...
...
@@ -265,6 +265,8 @@ LPVOID WINAPI DECLSPEC_HOTPATCH MapViewOfFile3( HANDLE handle, HANDLE process, P
LARGE_INTEGER
off
;
void
*
addr
;
if
(
!
process
)
process
=
GetCurrentProcess
();
addr
=
baseaddr
;
off
.
QuadPart
=
offset
;
if
(
!
set_ntstatus
(
NtMapViewOfSectionEx
(
handle
,
process
,
&
addr
,
&
off
,
&
size
,
alloc_type
,
protection
,
...
...
dlls/kernelbase/tests/process.c
View file @
376bd69c
...
...
@@ -123,7 +123,7 @@ static void test_MapViewOfFile3(void)
ok
(
mapping
!=
0
,
"CreateFileMapping error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ptr
=
pMapViewOfFile3
(
mapping
,
GetCurrentProcess
()
,
NULL
,
0
,
4096
,
0
,
PAGE_READONLY
,
NULL
,
0
);
ptr
=
pMapViewOfFile3
(
mapping
,
NULL
,
NULL
,
0
,
4096
,
0
,
PAGE_READONLY
,
NULL
,
0
);
ok
(
ptr
!=
NULL
,
"MapViewOfFile FILE_MAP_READ error %lu
\n
"
,
GetLastError
()
);
UnmapViewOfFile
(
ptr
);
...
...
dlls/ntdll/tests/virtual.c
View file @
376bd69c
...
...
@@ -1149,6 +1149,12 @@ static void test_NtMapViewOfSection(void)
ptr
=
NULL
;
size
=
0
;
offset
.
QuadPart
=
0
;
status
=
NtMapViewOfSection
(
mapping
,
NULL
,
&
ptr
,
0
,
0
,
&
offset
,
&
size
,
1
,
0
,
PAGE_READWRITE
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"NtMapViewOfSection returned %08lx
\n
"
,
status
);
ptr
=
NULL
;
size
=
0
;
offset
.
QuadPart
=
0
;
status
=
NtMapViewOfSection
(
mapping
,
process
,
&
ptr
,
0
,
0
,
&
offset
,
&
size
,
1
,
0
,
PAGE_READWRITE
);
ok
(
status
==
STATUS_SUCCESS
,
"NtMapViewOfSection returned %08lx
\n
"
,
status
);
ok
(
!
((
ULONG_PTR
)
ptr
&
0xffff
),
"returned memory %p is not aligned to 64k
\n
"
,
ptr
);
...
...
@@ -1422,6 +1428,12 @@ static void test_NtMapViewOfSectionEx(void)
ptr
=
NULL
;
size
=
0x1000
;
offset
.
QuadPart
=
0
;
status
=
pNtMapViewOfSectionEx
(
mapping
,
NULL
,
&
ptr
,
&
offset
,
&
size
,
0
,
PAGE_READWRITE
,
NULL
,
0
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"Unexpected status %08lx
\n
"
,
status
);
ptr
=
NULL
;
size
=
0x1000
;
offset
.
QuadPart
=
0
;
status
=
pNtMapViewOfSectionEx
(
mapping
,
process
,
&
ptr
,
&
offset
,
&
size
,
0
,
PAGE_READWRITE
,
NULL
,
0
);
ok
(
status
==
STATUS_SUCCESS
,
"Unexpected status %08lx
\n
"
,
status
);
ok
(
!
((
ULONG_PTR
)
ptr
&
0xffff
),
"returned memory %p is not aligned to 64k
\n
"
,
ptr
);
...
...
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