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
181b3cf0
Commit
181b3cf0
authored
Nov 23, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Implement the file sharing check for delete on close with an existing image mapping.
parent
923d582f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
file.c
dlls/kernel32/tests/file.c
+1
-1
fd.c
server/fd.c
+2
-0
trace.c
server/trace.c
+1
-0
No files found.
dlls/kernel32/tests/file.c
View file @
181b3cf0
...
...
@@ -1872,7 +1872,7 @@ static void test_file_sharing(void)
ok
(
h2
==
INVALID_HANDLE_VALUE
,
"create succeeded for map %x
\n
"
,
mapping_modes
[
a1
]
);
ok
(
ret
==
ERROR_SHARING_VIOLATION
,
"wrong error code %d for %x
\n
"
,
ret
,
mapping_modes
[
a1
]
);
}
else
if
(
mapping_modes
[
a1
]
&
SEC_IMAGE
)
todo_wine
else
if
(
mapping_modes
[
a1
]
&
SEC_IMAGE
)
{
ok
(
h2
==
INVALID_HANDLE_VALUE
,
"create succeeded for map %x
\n
"
,
mapping_modes
[
a1
]
);
ok
(
ret
==
ERROR_ACCESS_DENIED
,
"wrong error code %d for %x
\n
"
,
ret
,
mapping_modes
[
a1
]
);
...
...
server/fd.c
View file @
181b3cf0
...
...
@@ -1577,6 +1577,8 @@ static unsigned int check_sharing( struct fd *fd, unsigned int access, unsigned
if
(((
existing_access
&
FILE_MAPPING_WRITE
)
&&
!
(
sharing
&
FILE_SHARE_WRITE
))
||
((
existing_access
&
FILE_MAPPING_IMAGE
)
&&
(
access
&
FILE_SHARE_WRITE
)))
return
STATUS_SHARING_VIOLATION
;
if
((
existing_access
&
FILE_MAPPING_IMAGE
)
&&
(
options
&
FILE_DELETE_ON_CLOSE
))
return
STATUS_CANNOT_DELETE
;
if
((
existing_access
&
FILE_MAPPING_ACCESS
)
&&
(
open_flags
&
O_TRUNC
))
return
STATUS_USER_MAPPED_FILE
;
if
(
!
access
)
return
0
;
/* if access mode is 0, sharing mode is ignored (except for mappings) */
...
...
server/trace.c
View file @
181b3cf0
...
...
@@ -4555,6 +4555,7 @@ static const struct
{
"BUFFER_OVERFLOW"
,
STATUS_BUFFER_OVERFLOW
},
{
"BUFFER_TOO_SMALL"
,
STATUS_BUFFER_TOO_SMALL
},
{
"CANCELLED"
,
STATUS_CANCELLED
},
{
"CANNOT_DELETE"
,
STATUS_CANNOT_DELETE
},
{
"CANT_OPEN_ANONYMOUS"
,
STATUS_CANT_OPEN_ANONYMOUS
},
{
"CHILD_MUST_BE_VOLATILE"
,
STATUS_CHILD_MUST_BE_VOLATILE
},
{
"DEBUGGER_INACTIVE"
,
STATUS_DEBUGGER_INACTIVE
},
...
...
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