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
c74e5a78
Commit
c74e5a78
authored
Feb 21, 2006
by
Dr J A Gow
Committed by
Alexandre Julliard
Feb 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix up permissions when opening streams.
Fix up permissions when opening streams in storage objects when storage object has been opened in transacted mode.
parent
54dfdb9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
12 deletions
+36
-12
storage32.c
dlls/ole32/storage32.c
+21
-12
storage32.c
dlls/ole32/tests/storage32.c
+15
-0
No files found.
dlls/ole32/storage32.c
View file @
c74e5a78
...
...
@@ -342,13 +342,16 @@ HRESULT WINAPI StorageBaseImpl_OpenStream(
}
/*
* Check that we're compatible with the parent's storage mode
* Check that we're compatible with the parent's storage mode, but
* only if we are not in transacted mode
*/
parent_grfMode
=
STGM_ACCESS_MODE
(
This
->
ancestorStorage
->
base
.
openFlags
);
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
parent_grfMode
)
)
{
res
=
STG_E_ACCESSDENIED
;
goto
end
;
if
(
!
(
This
->
ancestorStorage
->
base
.
openFlags
&
STGM_TRANSACTED
))
{
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
parent_grfMode
)
)
{
res
=
STG_E_ACCESSDENIED
;
goto
end
;
}
}
/*
...
...
@@ -472,13 +475,16 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage(
}
/*
* Check that we're compatible with the parent's storage mode
* Check that we're compatible with the parent's storage mode,
* but only if we are not transacted
*/
parent_grfMode
=
STGM_ACCESS_MODE
(
This
->
ancestorStorage
->
base
.
openFlags
);
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
parent_grfMode
)
)
{
res
=
STG_E_ACCESSDENIED
;
goto
end
;
if
(
!
(
This
->
ancestorStorage
->
base
.
openFlags
&
STGM_TRANSACTED
))
{
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
parent_grfMode
)
)
{
res
=
STG_E_ACCESSDENIED
;
goto
end
;
}
}
/*
...
...
@@ -869,10 +875,13 @@ HRESULT WINAPI StorageBaseImpl_CreateStream(
/*
* Check that we're compatible with the parent's storage mode
* if not in transacted mode
*/
parent_grfMode
=
STGM_ACCESS_MODE
(
This
->
ancestorStorage
->
base
.
openFlags
);
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
parent_grfMode
)
)
return
STG_E_ACCESSDENIED
;
if
(
!
(
parent_grfMode
&
STGM_TRANSACTED
))
{
if
(
STGM_ACCESS_MODE
(
grfMode
)
>
STGM_ACCESS_MODE
(
parent_grfMode
)
)
return
STG_E_ACCESSDENIED
;
}
/*
* Initialize the out parameter
...
...
dlls/ole32/tests/storage32.c
View file @
c74e5a78
...
...
@@ -608,6 +608,21 @@ static void test_storage_refcount(void)
r
=
IStream_Release
(
stm
);
ok
(
r
==
0
,
"stream not released
\n
"
);
/* test for grfMode open issue */
r
=
StgOpenStorage
(
filename
,
NULL
,
0x00010020
,
NULL
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgOpenStorage failed
\n
"
);
if
(
stg
)
{
r
=
IStorage_OpenStream
(
stg
,
stmname
,
0
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"OpenStream should succeed
\n
"
);
todo_wine
{
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"wrong ref count
\n
"
);
}
}
DeleteFileW
(
filename
);
}
...
...
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