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
8d58a91f
Commit
8d58a91f
authored
Mar 05, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Allow CopyTo to succeed in spite of already open source streams.
parent
2bb93d39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
storage32.c
dlls/ole32/storage32.c
+22
-4
storage32.c
dlls/ole32/tests/storage32.c
+1
-1
No files found.
dlls/ole32/storage32.c
View file @
8d58a91f
...
@@ -1599,11 +1599,15 @@ static HRESULT WINAPI StorageBaseImpl_CopyTo(
...
@@ -1599,11 +1599,15 @@ static HRESULT WINAPI StorageBaseImpl_CopyTo(
SNB
snbExclude
,
/* [unique][in] */
SNB
snbExclude
,
/* [unique][in] */
IStorage
*
pstgDest
)
/* [unique][in] */
IStorage
*
pstgDest
)
/* [unique][in] */
{
{
StorageBaseImpl
*
const
This
=
(
StorageBaseImpl
*
)
iface
;
IEnumSTATSTG
*
elements
=
0
;
IEnumSTATSTG
*
elements
=
0
;
STATSTG
curElement
,
strStat
;
STATSTG
curElement
,
strStat
;
HRESULT
hr
;
HRESULT
hr
;
IStorage
*
pstgTmp
,
*
pstgChild
;
IStorage
*
pstgTmp
,
*
pstgChild
;
IStream
*
pstrTmp
,
*
pstrChild
;
IStream
*
pstrTmp
,
*
pstrChild
;
DirRef
srcEntryRef
;
DirEntry
srcEntry
;
BOOL
skip
=
FALSE
,
skip_storage
=
FALSE
,
skip_stream
=
FALSE
;
BOOL
skip
=
FALSE
,
skip_storage
=
FALSE
,
skip_stream
=
FALSE
;
int
i
;
int
i
;
...
@@ -1728,11 +1732,25 @@ static HRESULT WINAPI StorageBaseImpl_CopyTo(
...
@@ -1728,11 +1732,25 @@ static HRESULT WINAPI StorageBaseImpl_CopyTo(
goto
cleanup
;
goto
cleanup
;
/*
/*
* open child stream storage
* open child stream storage. This operation must succeed even if the
* stream is already open, so we use internal functions to do it.
*/
*/
hr
=
IStorage_OpenStream
(
iface
,
curElement
.
pwcsName
,
NULL
,
srcEntryRef
=
findElement
(
This
,
This
->
storageDirEntry
,
curElement
.
pwcsName
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
&
srcEntry
);
0
,
&
pstrChild
);
if
(
!
srcEntryRef
)
{
ERR
(
"source stream not found
\n
"
);
hr
=
STG_E_DOCFILECORRUPT
;
}
if
(
hr
==
S_OK
)
{
pstrChild
=
(
IStream
*
)
StgStreamImpl_Construct
(
This
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
srcEntryRef
);
if
(
pstrChild
)
IStream_AddRef
(
pstrChild
);
else
hr
=
E_OUTOFMEMORY
;
}
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
{
...
...
dlls/ole32/tests/storage32.c
View file @
8d58a91f
...
@@ -2750,7 +2750,7 @@ static void test_copyto_locking(void)
...
@@ -2750,7 +2750,7 @@ static void test_copyto_locking(void)
/* Try to copy the storage while the stream is open */
/* Try to copy the storage while the stream is open */
r
=
IStorage_CopyTo
(
stg2
,
0
,
NULL
,
NULL
,
stg3
);
r
=
IStorage_CopyTo
(
stg2
,
0
,
NULL
,
NULL
,
stg3
);
todo_wine
ok
(
r
==
S_OK
,
"IStorage->CopyTo failed, hr=%08x
\n
"
,
r
);
ok
(
r
==
S_OK
,
"IStorage->CopyTo failed, hr=%08x
\n
"
,
r
);
IStream_Release
(
stm
);
IStream_Release
(
stm
);
...
...
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