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
c62a4ad8
Commit
c62a4ad8
authored
Nov 19, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Forbid opening the same storage twice.
parent
d3c0a3a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
storage32.c
dlls/ole32/storage32.c
+23
-0
storage32.c
dlls/ole32/tests/storage32.c
+2
-2
No files found.
dlls/ole32/storage32.c
View file @
c62a4ad8
...
...
@@ -113,6 +113,7 @@ static BOOL StorageImpl_ReadDWordFromBigBlock( StorageImpl* This,
ULONG
blockIndex
,
ULONG
offset
,
DWORD
*
value
);
static
BOOL
StorageBaseImpl_IsStreamOpen
(
StorageBaseImpl
*
stg
,
DirRef
streamEntry
);
static
BOOL
StorageBaseImpl_IsStorageOpen
(
StorageBaseImpl
*
stg
,
DirRef
storageEntry
);
static
void
StorageInternalImpl_Invalidate
(
StorageInternalImpl
*
This
);
/* OLESTREAM memory structure to use for Get and Put Routines */
...
...
@@ -579,6 +580,13 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage(
if
(
(
storageEntryRef
!=
DIRENTRY_NULL
)
&&
(
currentEntry
.
stgType
==
STGTY_STORAGE
)
)
{
if
(
StorageBaseImpl_IsStorageOpen
(
This
,
storageEntryRef
))
{
/* A single storage cannot be opened a second time. */
res
=
STG_E_ACCESSDENIED
;
goto
end
;
}
newStorage
=
StorageInternalImpl_Construct
(
This
->
ancestorStorage
,
grfMode
,
...
...
@@ -1875,6 +1883,21 @@ static BOOL StorageBaseImpl_IsStreamOpen(StorageBaseImpl * stg, DirRef streamEnt
return
FALSE
;
}
static
BOOL
StorageBaseImpl_IsStorageOpen
(
StorageBaseImpl
*
stg
,
DirRef
storageEntry
)
{
StorageInternalImpl
*
childstg
;
LIST_FOR_EACH_ENTRY
(
childstg
,
&
stg
->
storageHead
,
StorageInternalImpl
,
ParentListEntry
)
{
if
(
childstg
->
base
.
storageDirEntry
==
storageEntry
)
{
return
TRUE
;
}
}
return
FALSE
;
}
static
void
StorageBaseImpl_DeleteAll
(
StorageBaseImpl
*
stg
)
{
struct
list
*
cur
,
*
cur2
;
...
...
dlls/ole32/tests/storage32.c
View file @
c62a4ad8
...
...
@@ -1060,13 +1060,13 @@ static void test_substorage_share(void)
if
(
r
==
S_OK
)
{
r
=
IStorage_OpenStorage
(
stg
,
stgname
,
NULL
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg3
);
todo_wine
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStorage should fail %08x
\n
"
,
r
);
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStorage should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStorage_Release
(
stg3
);
r
=
IStorage_OpenStorage
(
stg
,
stgname
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg3
);
todo_wine
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStorage should fail %08x
\n
"
,
r
);
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStorage should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
IStorage_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