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
ffc4a49b
Commit
ffc4a49b
authored
Dec 04, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Always allow changes to read-only transacted storages.
The only time the write permissions of transacted storages matter is when committing.
parent
d49510e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
storage32.c
dlls/ole32/storage32.c
+15
-15
storage32.c
dlls/ole32/tests/storage32.c
+1
-1
No files found.
dlls/ole32/storage32.c
View file @
ffc4a49b
...
...
@@ -864,15 +864,16 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
(
grfMode
&
STGM_TRANSACTED
))
return
STG_E_INVALIDFUNCTION
;
/* Can't create a stream on read-only storage */
if
(
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
return
STG_E_ACCESSDENIED
;
/*
*
Check that we're compatible with the parent's storage mod
e
*
if not in transacted mode
*
Don't worry about permissions in transacted mode, as we can always writ
e
*
changes; we just can't always commit them.
*/
if
(
!
(
This
->
openFlags
&
STGM_TRANSACTED
))
{
/* Can't create a stream on read-only storage */
if
(
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
return
STG_E_ACCESSDENIED
;
/* Can't create a stream with greater access than the parent. */
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
This
->
openFlags
)
)
return
STG_E_ACCESSDENIED
;
}
...
...
@@ -899,11 +900,6 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
else
return
STG_E_FILEALREADYEXISTS
;
}
else
if
(
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
{
WARN
(
"read-only storage
\n
"
);
return
STG_E_ACCESSDENIED
;
}
/*
* memset the empty entry
...
...
@@ -1058,7 +1054,8 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
/*
* Check that we're compatible with the parent's storage mode
*/
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
This
->
openFlags
)
)
if
(
!
(
This
->
openFlags
&
STGM_TRANSACTED
)
&&
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
This
->
openFlags
)
)
{
WARN
(
"access denied
\n
"
);
return
STG_E_ACCESSDENIED
;
...
...
@@ -1075,7 +1072,8 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
* An element with this name already exists
*/
if
(
STGM_CREATE_MODE
(
grfMode
)
==
STGM_CREATE
&&
STGM_ACCESS_MODE
(
This
->
openFlags
)
!=
STGM_READ
)
((
This
->
openFlags
&
STGM_TRANSACTED
)
||
STGM_ACCESS_MODE
(
This
->
openFlags
)
!=
STGM_READ
))
{
hr
=
IStorage_DestroyElement
(
iface
,
pwcsName
);
if
(
FAILED
(
hr
))
...
...
@@ -1087,7 +1085,8 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
return
STG_E_FILEALREADYEXISTS
;
}
}
else
if
(
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
else
if
(
!
(
This
->
openFlags
&
STGM_TRANSACTED
)
&&
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
{
WARN
(
"read-only storage
\n
"
);
return
STG_E_ACCESSDENIED
;
...
...
@@ -1831,7 +1830,8 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
if
(
This
->
reverted
)
return
STG_E_REVERTED
;
if
(
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
if
(
!
(
This
->
openFlags
&
STGM_TRANSACTED
)
&&
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
return
STG_E_ACCESSDENIED
;
entryToDeleteRef
=
findElement
(
...
...
dlls/ole32/tests/storage32.c
View file @
ffc4a49b
...
...
@@ -1505,7 +1505,7 @@ static void test_nonroot_transacted(void)
{
/* The storage can be modified. */
r
=
IStorage_CreateStorage
(
stg2
,
stgname
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg3
);
todo_wine
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed, hr=%08x
\n
"
,
r
);
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed, hr=%08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStream_Release
(
stg3
);
...
...
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