[PATCH 4/4] wineserver: Return Access Denied when attempting to delete mapped file

Ben Peddell klightspeed at netspace.net.au
Wed Jun 27 20:34:28 CDT 2012


Windows NT returns STATUS_ACCESS_DENIED when attempting to delete a
mapped file.

---
 server/fd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/server/fd.c b/server/fd.c
index 7b85593..ada4802 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1510,6 +1510,8 @@ static unsigned int check_sharing( struct fd *fd, unsigned int access, unsigned
         return STATUS_CANNOT_DELETE;
     if ((existing_access & FILE_MAPPING_ACCESS) && (open_flags & O_TRUNC))
         return STATUS_USER_MAPPED_FILE;
+    if ((existing_access & FILE_MAPPING_ACCESS) && (options & FILE_DELETE_ON_CLOSE))
+        return STATUS_ACCESS_DENIED;
     if (!(access & all_access))
         return 0;  /* if access mode is 0, sharing mode is ignored (except for mappings) */
     if (((existing_access & read_access) && !(sharing & FILE_SHARE_READ)) ||
-- 
1.7.3.4




More information about the wine-patches mailing list