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
2fc07359
Commit
2fc07359
authored
Mar 01, 2024
by
Daniel Lehman
Committed by
Alexandre Julliard
Mar 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Do not lock storage in read-only deny-write mode.
parent
6fa14583
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
storage32.c
dlls/ole32/storage32.c
+5
-3
storage32.c
dlls/ole32/tests/storage32.c
+1
-1
No files found.
dlls/ole32/storage32.c
View file @
2fc07359
...
...
@@ -5036,7 +5036,7 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
ULARGE_INTEGER
offset
;
ULARGE_INTEGER
cb
;
DWORD
share_mode
=
STGM_SHARE_MODE
(
openFlags
);
BOOL
supported
;
BOOL
supported
,
ro_denyw
;
if
(
openFlags
&
STGM_NOSNAPSHOT
)
{
...
...
@@ -5045,6 +5045,8 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
else
if
(
share_mode
!=
STGM_SHARE_EXCLUSIVE
)
share_mode
=
STGM_SHARE_DENY_WRITE
;
}
ro_denyw
=
(
STGM_ACCESS_MODE
(
openFlags
)
==
STGM_READ
)
&&
(
share_mode
==
STGM_SHARE_DENY_WRITE
);
/* Wrap all other locking inside a single lock so we can check ranges safely */
offset
.
QuadPart
=
RANGELOCK_CHECKLOCKS
;
cb
.
QuadPart
=
1
;
...
...
@@ -5088,7 +5090,7 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
hr
=
StorageImpl_LockOne
(
This
,
RANGELOCK_PRIORITY2_FIRST
,
RANGELOCK_PRIORITY2_LAST
);
}
if
(
SUCCEEDED
(
hr
)
&&
(
STGM_ACCESS_MODE
(
openFlags
)
!=
STGM_WRITE
))
if
(
SUCCEEDED
(
hr
)
&&
(
STGM_ACCESS_MODE
(
openFlags
)
!=
STGM_WRITE
)
&&
!
ro_denyw
)
hr
=
StorageImpl_LockOne
(
This
,
RANGELOCK_READ_FIRST
,
RANGELOCK_READ_LAST
);
if
(
SUCCEEDED
(
hr
)
&&
(
STGM_ACCESS_MODE
(
openFlags
)
!=
STGM_READ
))
...
...
@@ -5097,7 +5099,7 @@ static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
if
(
SUCCEEDED
(
hr
)
&&
(
share_mode
==
STGM_SHARE_DENY_READ
||
share_mode
==
STGM_SHARE_EXCLUSIVE
))
hr
=
StorageImpl_LockOne
(
This
,
RANGELOCK_DENY_READ_FIRST
,
RANGELOCK_DENY_READ_LAST
);
if
(
SUCCEEDED
(
hr
)
&&
(
share_mode
==
STGM_SHARE_DENY_WRITE
||
share_mode
==
STGM_SHARE_EXCLUSIVE
))
if
(
SUCCEEDED
(
hr
)
&&
(
share_mode
==
STGM_SHARE_DENY_WRITE
||
share_mode
==
STGM_SHARE_EXCLUSIVE
)
&&
!
ro_denyw
)
hr
=
StorageImpl_LockOne
(
This
,
RANGELOCK_DENY_WRITE_FIRST
,
RANGELOCK_DENY_WRITE_LAST
);
if
(
SUCCEEDED
(
hr
)
&&
(
openFlags
&
STGM_NOSNAPSHOT
)
==
STGM_NOSNAPSHOT
)
...
...
dlls/ole32/tests/storage32.c
View file @
2fc07359
...
...
@@ -3394,7 +3394,7 @@ static const struct lock_test lock_tests[] = {
{
STGM_READWRITE
|
STGM_TRANSACTED
,
FALSE
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
rw_locked_bytes
,
rw_fail_ranges
,
FALSE
},
{
STGM_READWRITE
|
STGM_TRANSACTED
|
STGM_NOSNAPSHOT
,
FALSE
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
nosn_locked_bytes
,
rwdw_fail_ranges
,
FALSE
},
{
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
,
TRU
E
},
{
STGM_READ
|
STGM_SHARE_DENY_WRITE
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
no_locked_bytes
,
dw_fail_ranges
,
FALS
E
},
{
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
,
FALSE
},
{
STGM_READ
|
STGM_SHARE_EXCLUSIVE
|
STGM_TRANSACTED
,
FALSE
,
GENERIC_READ
,
FILE_SHARE_READ
,
roex_locked_bytes
,
roex_fail_ranges
,
FALSE
},
...
...
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