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
a0d262c5
Commit
a0d262c5
authored
Aug 27, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Overwrite previous CompObj instead of failing.
parent
19c572f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
storage32.c
dlls/ole32/storage32.c
+2
-2
storage32.c
dlls/ole32/tests/storage32.c
+66
-0
No files found.
dlls/ole32/storage32.c
View file @
a0d262c5
...
...
@@ -7193,9 +7193,9 @@ static HRESULT STORAGE_WriteCompObj( LPSTORAGE pstg, CLSID *clsid,
debugstr_w
(
lpszUserType
),
debugstr_w
(
szClipName
),
debugstr_w
(
szProgIDName
));
/* Create a CompObj stream
if it doesn't exist
*/
/* Create a CompObj stream */
r
=
IStorage_CreateStream
(
pstg
,
szwStreamName
,
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
pstm
);
STGM_
CREATE
|
STGM_
WRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
pstm
);
if
(
FAILED
(
r
)
)
return
r
;
...
...
dlls/ole32/tests/storage32.c
View file @
a0d262c5
...
...
@@ -1405,6 +1405,71 @@ static void test_simple(void)
DeleteFileA
(
filenameA
);
}
static
void
test_fmtusertypestg
(
void
)
{
IStorage
*
stg
;
IEnumSTATSTG
*
stat
;
HRESULT
hr
;
static
const
WCHAR
fileW
[]
=
{
'f'
,
'm'
,
't'
,
't'
,
'e'
,
's'
,
't'
,
0
};
static
WCHAR
userTypeW
[]
=
{
'S'
,
't'
,
'g'
,
'U'
,
's'
,
'r'
,
'T'
,
'y'
,
'p'
,
'e'
,
0
};
static
WCHAR
strmNameW
[]
=
{
1
,
'C'
,
'o'
,
'm'
,
'p'
,
'O'
,
'b'
,
'j'
,
0
};
hr
=
StgCreateDocfile
(
fileW
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"should succeed, res=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* try to write the stream */
hr
=
WriteFmtUserTypeStg
(
stg
,
0
,
userTypeW
);
ok
(
hr
==
S_OK
,
"should succeed, res=%x
\n
"
,
hr
);
/* check that the stream was created */
hr
=
IStorage_EnumElements
(
stg
,
0
,
NULL
,
0
,
&
stat
);
ok
(
hr
==
S_OK
,
"should succeed, res=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
BOOL
found
=
FALSE
;
STATSTG
statstg
;
DWORD
got
;
while
((
hr
=
IEnumSTATSTG_Next
(
stat
,
1
,
&
statstg
,
&
got
))
==
S_OK
&&
got
==
1
)
{
if
(
lstrcmpW
(
statstg
.
pwcsName
,
strmNameW
)
==
0
)
found
=
TRUE
;
else
ok
(
0
,
"found unexpected stream or storage
\n
"
);
}
ok
(
found
==
TRUE
,
"expected storage to contain stream
\\
0001CompObj
\n
"
);
IEnumSTATSTG_Release
(
stat
);
}
/* re-write the stream */
hr
=
WriteFmtUserTypeStg
(
stg
,
0
,
userTypeW
);
ok
(
hr
==
S_OK
,
"should succeed, res=%x
\n
"
,
hr
);
/* check that the stream is still there */
hr
=
IStorage_EnumElements
(
stg
,
0
,
NULL
,
0
,
&
stat
);
ok
(
hr
==
S_OK
,
"should succeed, res=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
BOOL
found
=
FALSE
;
STATSTG
statstg
;
DWORD
got
;
while
((
hr
=
IEnumSTATSTG_Next
(
stat
,
1
,
&
statstg
,
&
got
))
==
S_OK
&&
got
==
1
)
{
if
(
lstrcmpW
(
statstg
.
pwcsName
,
strmNameW
)
==
0
)
found
=
TRUE
;
else
ok
(
0
,
"found unexpected stream or storage
\n
"
);
}
ok
(
found
==
TRUE
,
"expected storage to contain stream
\\
0001CompObj
\n
"
);
IEnumSTATSTG_Release
(
stat
);
}
IStorage_Release
(
stg
);
DeleteFileW
(
fileW
);
}
}
START_TEST
(
storage32
)
{
CHAR
temp
[
MAX_PATH
];
...
...
@@ -1431,4 +1496,5 @@ START_TEST(storage32)
test_writeclassstg
();
test_readonly
();
test_simple
();
test_fmtusertypestg
();
}
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