Commit 407bec81 authored by Wez's avatar Wez Committed by Commit Bot

Reset out-parameters when blocking NtMapViewOfSection.

Clear the |*base|-address out-parameter to null in case of blocking, to
ensure that calling-code won't get confused by seeing a failure NTSTATUS
with a non-null base-address.  e.g. Win32's MapViewOfFile() returns the
base-pointer as its result, using null to indicate failure, and leaves
the Win32 GetLastError() set based on the NTSTATUS.

Bug: 864351, 870663
Change-Id: I0aa2aacd1075224100d10d6291a416849f6d227b
Reviewed-on: https://chromium-review.googlesource.com/1211322Reviewed-by: default avatarRobert Shield <robertshield@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589353}
parent 56bebe81
...@@ -331,6 +331,7 @@ NTSTATUS NewNtMapViewOfSectionImpl( ...@@ -331,6 +331,7 @@ NTSTATUS NewNtMapViewOfSectionImpl(
if (block) { if (block) {
assert(g_nt_unmap_view_of_section_func); assert(g_nt_unmap_view_of_section_func);
g_nt_unmap_view_of_section_func(process, *base); g_nt_unmap_view_of_section_func(process, *base);
*base = nullptr;
ret = STATUS_UNSUCCESSFUL; ret = STATUS_UNSUCCESSFUL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment