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
5c3b0df7
Commit
5c3b0df7
authored
Feb 15, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Added a test showing OLE storage's IStorage/IStream refcounting
behaviour.
parent
948c49cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
storage32.c
dlls/ole32/tests/storage32.c
+46
-0
No files found.
dlls/ole32/tests/storage32.c
View file @
5c3b0df7
...
...
@@ -566,6 +566,51 @@ static void test_storage_suminfo(void)
DeleteFileW
(
filename
);
}
static
void
test_storage_refcount
(
void
)
{
static
const
WCHAR
szPrefix
[]
=
{
's'
,
't'
,
'g'
,
0
};
static
const
WCHAR
szDot
[]
=
{
'.'
,
0
};
WCHAR
filename
[
MAX_PATH
];
IStorage
*
stg
=
NULL
;
HRESULT
r
;
IStream
*
stm
=
NULL
;
static
const
WCHAR
stmname
[]
=
{
'C'
,
'O'
,
'N'
,
'T'
,
'E'
,
'N'
,
'T'
,
'S'
,
0
};
LARGE_INTEGER
pos
;
ULARGE_INTEGER
upos
;
STATSTG
stat
;
if
(
!
GetTempFileNameW
(
szDot
,
szPrefix
,
0
,
filename
))
return
;
DeleteFileW
(
filename
);
/* create the file */
r
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
/* now create a stream */
r
=
IStorage_CreateStream
(
stg
,
stmname
,
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
0
,
&
stm
);
ok
(
r
==
S_OK
,
"IStorage->CreateStream failed
\n
"
);
todo_wine
{
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"storage not released
\n
"
);
pos
.
QuadPart
=
0
;
r
=
IStream_Seek
(
stm
,
pos
,
0
,
&
upos
);
ok
(
r
==
STG_E_REVERTED
,
"seek should fail
\n
"
);
r
=
IStream_Stat
(
stm
,
&
stat
,
STATFLAG_DEFAULT
);
ok
(
r
==
STG_E_REVERTED
,
"stat should fail
\n
"
);
}
r
=
IStream_Release
(
stm
);
ok
(
r
==
0
,
"stream not released
\n
"
);
DeleteFileW
(
filename
);
}
START_TEST
(
storage32
)
{
test_hglobal_storage_stat
();
...
...
@@ -573,4 +618,5 @@ START_TEST(storage32)
test_storage_stream
();
test_open_storage
();
test_storage_suminfo
();
test_storage_refcount
();
}
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