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
7df35e9b
Commit
7df35e9b
authored
Sep 12, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Test creation of a storage on an ILockBytes containing data.
parent
c67ca538
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
storage32.c
dlls/ole32/tests/storage32.c
+47
-0
No files found.
dlls/ole32/tests/storage32.c
View file @
7df35e9b
...
...
@@ -2943,6 +2943,52 @@ static void test_copyto_recursive(void)
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
}
static
void
test_hglobal_storage_creation
(
void
)
{
ILockBytes
*
ilb
=
NULL
;
IStorage
*
stg
=
NULL
;
HRESULT
r
;
STATSTG
stat
;
char
junk
[
512
];
ULARGE_INTEGER
offset
;
r
=
CreateILockBytesOnHGlobal
(
NULL
,
TRUE
,
&
ilb
);
ok
(
r
==
S_OK
,
"CreateILockBytesOnHGlobal failed, hr=%x
\n
"
,
r
);
offset
.
QuadPart
=
0
;
memset
(
junk
,
0xaa
,
512
);
r
=
ILockBytes_WriteAt
(
ilb
,
offset
,
junk
,
512
,
NULL
);
ok
(
r
==
S_OK
,
"ILockBytes_WriteAt failed, hr=%x
\n
"
,
r
);
offset
.
QuadPart
=
2000
;
r
=
ILockBytes_WriteAt
(
ilb
,
offset
,
junk
,
512
,
NULL
);
ok
(
r
==
S_OK
,
"ILockBytes_WriteAt failed, hr=%x
\n
"
,
r
);
r
=
StgCreateDocfileOnILockBytes
(
ilb
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgCreateDocfileOnILockBytes failed, hr=%x
\n
"
,
r
);
IStorage_Release
(
stg
);
r
=
StgOpenStorageOnILockBytes
(
ilb
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
NULL
,
0
,
&
stg
);
todo_wine
ok
(
r
==
S_OK
,
"StgOpenStorageOnILockBytes failed, hr=%x
\n
"
,
r
);
if
(
SUCCEEDED
(
r
))
{
r
=
IStorage_Stat
(
stg
,
&
stat
,
STATFLAG_NONAME
);
ok
(
r
==
S_OK
,
"StgOpenStorageOnILockBytes failed, hr=%x
\n
"
,
r
);
ok
(
IsEqualCLSID
(
&
stat
.
clsid
,
&
GUID_NULL
),
"unexpected CLSID value
\n
"
);
IStorage_Release
(
stg
);
}
r
=
ILockBytes_Stat
(
ilb
,
&
stat
,
STATFLAG_NONAME
);
ok
(
r
==
S_OK
,
"ILockBytes_Stat failed, hr=%x
\n
"
,
r
);
ok
(
stat
.
cbSize
.
LowPart
<
2512
,
"expected truncated size, got %d
\n
"
,
stat
.
cbSize
.
LowPart
);
ILockBytes_Release
(
ilb
);
}
START_TEST
(
storage32
)
{
CHAR
temp
[
MAX_PATH
];
...
...
@@ -2985,4 +3031,5 @@ START_TEST(storage32)
test_substorage_enum
();
test_copyto_locking
();
test_copyto_recursive
();
test_hglobal_storage_creation
();
}
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