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
3f83b788
Commit
3f83b788
authored
Jun 11, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix storage locking for read-only exclusive mode.
parent
06e988a5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
storage32.c
dlls/ole32/storage32.c
+8
-0
storage32.c
dlls/ole32/tests/storage32.c
+2
-2
No files found.
dlls/ole32/storage32.c
View file @
3f83b788
...
...
@@ -5031,6 +5031,14 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
if
(
SUCCEEDED
(
hr
)
&&
(
share_mode
==
STGM_SHARE_DENY_WRITE
||
share_mode
==
STGM_SHARE_EXCLUSIVE
))
hr
=
StorageImpl_CheckLockRange
(
This
,
RANGELOCK_WRITE_FIRST
,
RANGELOCK_WRITE_LAST
,
STG_E_LOCKVIOLATION
);
if
(
SUCCEEDED
(
hr
)
&&
STGM_ACCESS_MODE
(
openFlags
)
==
STGM_READ
&&
share_mode
==
STGM_SHARE_EXCLUSIVE
)
{
hr
=
StorageImpl_CheckLockRange
(
This
,
0
,
RANGELOCK_CHECKLOCKS
-
1
,
STG_E_LOCKVIOLATION
);
if
(
SUCCEEDED
(
hr
))
hr
=
StorageImpl_CheckLockRange
(
This
,
RANGELOCK_CHECKLOCKS
+
1
,
RANGELOCK_LAST
,
STG_E_LOCKVIOLATION
);
}
/* Then grab our locks. */
if
(
SUCCEEDED
(
hr
)
&&
(
openFlags
&
STGM_PRIORITY
)
==
STGM_PRIORITY
)
{
...
...
dlls/ole32/tests/storage32.c
View file @
3f83b788
...
...
@@ -3185,8 +3185,8 @@ static const struct lock_test lock_tests[] = {
{
STGM_READWRITE
|
STGM_TRANSACTED
|
STGM_SHARE_DENY_WRITE
,
FALSE
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
,
rwdw_locked_bytes
,
rwdw_fail_ranges
,
FALSE
},
{
STGM_READ
|
STGM_SHARE_DENY_WRITE
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
no_locked_bytes
,
dw_fail_ranges
,
TRUE
},
{
STGM_READ
|
STGM_TRANSACTED
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
tr_locked_bytes
,
tr_fail_ranges
,
FALSE
},
{
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
roex_locked_bytes
,
roex_fail_ranges
,
TRU
E
},
{
STGM_READ
|
STGM_SHARE_EXCLUSIVE
|
STGM_TRANSACTED
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
roex_locked_bytes
,
roex_fail_ranges
,
TRU
E
},
{
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
roex_locked_bytes
,
roex_fail_ranges
,
FALS
E
},
{
STGM_READ
|
STGM_SHARE_EXCLUSIVE
|
STGM_TRANSACTED
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
roex_locked_bytes
,
roex_fail_ranges
,
FALS
E
},
};
static
BOOL
can_open
(
LPCWSTR
filename
,
DWORD
access
,
DWORD
sharing
)
...
...
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