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
3cd2a80e
Commit
3cd2a80e
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: Add test for freeing the parent of a storage.
parent
9d9070ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
storage32.c
dlls/ole32/tests/storage32.c
+20
-2
No files found.
dlls/ole32/tests/storage32.c
View file @
3cd2a80e
...
...
@@ -1290,12 +1290,13 @@ static void test_revert(void)
static
void
test_parent_free
(
void
)
{
IStorage
*
stg
=
NULL
,
*
stg2
=
NULL
;
IStorage
*
stg
=
NULL
,
*
stg2
=
NULL
,
*
stg3
=
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
;
STATSTG
statstg
;
DeleteFileA
(
filenameA
);
...
...
@@ -1304,7 +1305,7 @@ static void test_parent_free(void)
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
/* c
ommit
a new storage */
/* c
reate
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
);
...
...
@@ -1314,15 +1315,32 @@ static void test_parent_free(void)
r
=
IStorage_CreateStream
(
stg2
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
if
(
r
==
S_OK
)
{
/* create a storage inside the new storage */
r
=
IStorage_CreateStorage
(
stg2
,
stgname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stg3
);
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed
\n
"
);
}
/* free the parent */
ref
=
IStorage_Release
(
stg2
);
ok
(
ref
==
0
,
"IStorage still has %u references
\n
"
,
ref
);
/* child objects are invalid */
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
);
r
=
IStorage_Stat
(
stg3
,
&
statstg
,
STATFLAG_NONAME
);
todo_wine
ok
(
r
==
STG_E_REVERTED
,
"IStorage_Stat should fail %08x
\n
"
,
r
);
r
=
IStorage_SetStateBits
(
stg3
,
1
,
1
);
todo_wine
ok
(
r
==
STG_E_REVERTED
,
"IStorage_Stat should fail %08x
\n
"
,
r
);
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