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
a2c405fa
Commit
a2c405fa
authored
Nov 17, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add a test for freeing the parent of an open stream.
parent
55604eb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
storage32.c
dlls/ole32/tests/storage32.c
+45
-0
No files found.
dlls/ole32/tests/storage32.c
View file @
a2c405fa
...
...
@@ -1288,6 +1288,50 @@ static void test_revert(void)
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
}
static
void
test_parent_free
(
void
)
{
IStorage
*
stg
=
NULL
,
*
stg2
=
NULL
;
HRESULT
r
;
IStream
*
stm
=
NULL
;
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
static
const
WCHAR
stgname
[]
=
{
'P'
,
'E'
,
'R'
,
'M'
,
'S'
,
'T'
,
'G'
,
0
};
ULONG
ref
;
DeleteFileA
(
filenameA
);
/* create the file */
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
/* commit a new storage */
r
=
IStorage_CreateStorage
(
stg
,
stgname
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg2
);
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed, hr=%08x
\n
"
,
r
);
if
(
r
==
S_OK
)
{
/* now create a stream inside the new storage */
r
=
IStorage_CreateStream
(
stg2
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
ref
=
IStorage_Release
(
stg2
);
ok
(
ref
==
0
,
"IStorage still has %u references
\n
"
,
ref
);
if
(
r
==
S_OK
)
{
r
=
IStream_Write
(
stm
,
"this should fail
\n
"
,
17
,
NULL
);
ok
(
r
==
STG_E_REVERTED
,
"IStream->Write sould fail, hr=%x
\n
"
,
r
);
IStream_Release
(
stm
);
}
}
IStorage_Release
(
stg
);
r
=
DeleteFileA
(
filenameA
);
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
}
static
void
test_nonroot_transacted
(
void
)
{
IStorage
*
stg
=
NULL
,
*
stg2
=
NULL
;
...
...
@@ -2422,6 +2466,7 @@ START_TEST(storage32)
test_transact
();
test_substorage_share
();
test_revert
();
test_parent_free
();
test_nonroot_transacted
();
test_ReadClassStm
();
test_access
();
...
...
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