From 1e6b6718f3543b8379e2573df9a6d65e160a8214 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Wed, 29 Oct 2008 16:10:20 +0000 Subject: [PATCH] - MmMapViewOfSection: Don't forget to unlock the address space before returning -- fixes a bugcheck revealed by kernel32 Winetest "virtual" svn path=/trunk/; revision=37064 --- reactos/ntoskrnl/mm/section.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 7addcee5f90..1ced126cba2 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -4642,18 +4642,21 @@ MmMapViewOfSection(IN PVOID SectionObject, if ((Protect & (PAGE_READWRITE|PAGE_EXECUTE_READWRITE)) && !(Section->SectionPageProtection & (PAGE_READWRITE|PAGE_EXECUTE_READWRITE))) { + MmUnlockAddressSpace(AddressSpace); return STATUS_SECTION_PROTECTION; } /* check for read access */ if ((Protect & (PAGE_READONLY|PAGE_WRITECOPY|PAGE_EXECUTE_READ|PAGE_EXECUTE_WRITECOPY)) && !(Section->SectionPageProtection & (PAGE_READONLY|PAGE_READWRITE|PAGE_WRITECOPY|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY))) { + MmUnlockAddressSpace(AddressSpace); return STATUS_SECTION_PROTECTION; } /* check for execute access */ if ((Protect & (PAGE_EXECUTE|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY)) && !(Section->SectionPageProtection & (PAGE_EXECUTE|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY))) { + MmUnlockAddressSpace(AddressSpace); return STATUS_SECTION_PROTECTION; }