Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
371f6a48
Commit
371f6a48
authored
Nov 18, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Do not allow the same stream to be opened twice.
parent
53128d52
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
storage32.c
dlls/ole32/storage32.c
+24
-0
storage32.c
dlls/ole32/tests/storage32.c
+2
-2
No files found.
dlls/ole32/storage32.c
View file @
371f6a48
...
...
@@ -110,6 +110,8 @@ static BOOL StorageImpl_WriteDWordToBigBlock( StorageImpl* This,
static
BOOL
StorageImpl_ReadDWordFromBigBlock
(
StorageImpl
*
This
,
ULONG
blockIndex
,
ULONG
offset
,
DWORD
*
value
);
static
BOOL
StorageBaseImpl_IsStreamOpen
(
StorageBaseImpl
*
stg
,
DirRef
streamEntry
);
/* OLESTREAM memory structure to use for Get and Put Routines */
/* Used for OleConvertIStorageToOLESTREAM and OleConvertOLESTREAMToIStorage */
typedef
struct
...
...
@@ -453,6 +455,13 @@ static HRESULT WINAPI StorageBaseImpl_OpenStream(
if
(
(
streamEntryRef
!=
DIRENTRY_NULL
)
&&
(
currentEntry
.
stgType
==
STGTY_STREAM
)
)
{
if
(
StorageBaseImpl_IsStreamOpen
(
This
,
streamEntryRef
))
{
/* A single stream cannot be opened a second time. */
res
=
STG_E_ACCESSDENIED
;
goto
end
;
}
newStream
=
StgStreamImpl_Construct
(
This
,
grfMode
,
streamEntryRef
);
if
(
newStream
!=
0
)
...
...
@@ -1807,6 +1816,21 @@ void StorageBaseImpl_RemoveStream(StorageBaseImpl * stg, StgStreamImpl * strm)
list_remove
(
&
(
strm
->
StrmListEntry
));
}
static
BOOL
StorageBaseImpl_IsStreamOpen
(
StorageBaseImpl
*
stg
,
DirRef
streamEntry
)
{
StgStreamImpl
*
strm
;
LIST_FOR_EACH_ENTRY
(
strm
,
&
stg
->
strmHead
,
StgStreamImpl
,
StrmListEntry
)
{
if
(
strm
->
dirEntry
==
streamEntry
)
{
return
TRUE
;
}
}
return
FALSE
;
}
static
void
StorageBaseImpl_DeleteAll
(
StorageBaseImpl
*
stg
)
{
struct
list
*
cur
,
*
cur2
;
...
...
dlls/ole32/tests/storage32.c
View file @
371f6a48
...
...
@@ -1100,13 +1100,13 @@ static void test_substorage_share(void)
if
(
r
==
S_OK
)
{
r
=
IStorage_OpenStream
(
stg
,
stmname
,
NULL
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm2
);
todo_wine
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStorage_Release
(
stm2
);
r
=
IStorage_OpenStream
(
stg
,
stmname
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm2
);
todo_wine
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStorage_Release
(
stm2
);
...
...
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