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
a6a91a44
Commit
a6a91a44
authored
Feb 21, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement and test IPropertySetStorage.
parent
2f254604
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
1 deletion
+127
-1
Makefile.in
dlls/ole32/Makefile.in
+1
-0
stg_prop.c
dlls/ole32/stg_prop.c
+0
-0
storage32.c
dlls/ole32/storage32.c
+6
-1
storage32.h
dlls/ole32/storage32.h
+4
-0
storage32.c
dlls/ole32/tests/storage32.c
+116
-0
No files found.
dlls/ole32/Makefile.in
View file @
a6a91a44
...
...
@@ -34,6 +34,7 @@ C_SRCS = \
regsvr.c
\
rpc.c
\
stg_bigblockfile.c
\
stg_prop.c
\
stg_stream.c
\
storage32.c
\
stubmanager.c
...
...
dlls/ole32/stg_prop.c
0 → 100644
View file @
a6a91a44
This diff is collapsed.
Click to expand it.
dlls/ole32/storage32.c
View file @
a6a91a44
...
...
@@ -222,7 +222,7 @@ static IEnumSTATSTGVtbl IEnumSTATSTGImpl_Vtbl =
IEnumSTATSTGImpl_Clone
};
extern
IPropertySetStorageVtbl
IPropertySetStorage_Vtbl
;
...
...
@@ -266,6 +266,10 @@ HRESULT WINAPI StorageBaseImpl_QueryInterface(
{
*
ppvObject
=
(
IStorage
*
)
This
;
}
else
if
(
memcmp
(
&
IID_IPropertySetStorage
,
riid
,
sizeof
(
IID_IPropertySetStorage
))
==
0
)
{
*
ppvObject
=
(
IStorage
*
)
&
This
->
pssVtbl
;
}
/*
* Check that we obtained an interface.
...
...
@@ -2214,6 +2218,7 @@ HRESULT StorageImpl_Construct(
* Initialize the virtual function table.
*/
This
->
lpVtbl
=
&
Storage32Impl_Vtbl
;
This
->
pssVtbl
=
&
IPropertySetStorage_Vtbl
;
This
->
v_destructor
=
&
StorageImpl_Destroy
;
/*
...
...
dlls/ole32/storage32.h
View file @
a6a91a44
...
...
@@ -207,6 +207,8 @@ struct StorageBaseImpl
IStorageVtbl
*
lpVtbl
;
/* Needs to be the first item in the struct
* since we want to cast this in a Storage32 pointer */
IPropertySetStorageVtbl
*
pssVtbl
;
/* interface for adding a properties stream */
/*
* Reference count of this object
*/
...
...
@@ -301,6 +303,8 @@ struct StorageImpl
IStorageVtbl
*
lpVtbl
;
/* Needs to be the first item in the struct
* since we want to cast this in a Storage32 pointer */
IPropertySetStorageVtbl
*
pssVtbl
;
/* interface for adding a properties stream */
/*
* Declare the member of the Storage32BaseImpl class to allow
* casting as a Storage32BaseImpl
...
...
dlls/ole32/tests/storage32.c
View file @
a6a91a44
...
...
@@ -309,10 +309,126 @@ void test_open_storage(void)
ok
(
r
,
"file didn't exist
\n
"
);
}
void
test_storage_suminfo
(
void
)
{
static
const
WCHAR
szDot
[]
=
{
'.'
,
0
};
static
const
WCHAR
szPrefix
[]
=
{
's'
,
't'
,
'g'
,
0
};
WCHAR
filename
[
MAX_PATH
];
IStorage
*
stg
=
NULL
;
IPropertySetStorage
*
propset
=
NULL
;
IPropertyStorage
*
ps
=
NULL
;
HRESULT
r
;
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
"
);
r
=
IStorage_QueryInterface
(
stg
,
&
IID_IPropertySetStorage
,
(
LPVOID
)
&
propset
);
ok
(
r
==
S_OK
,
"query interface failed
\n
"
);
/* delete it */
r
=
IPropertySetStorage_Delete
(
propset
,
&
FMTID_SummaryInformation
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"deleted property set storage
\n
"
);
r
=
IPropertySetStorage_Open
(
propset
,
&
FMTID_SummaryInformation
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"opened property set storage
\n
"
);
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"created property set storage
\n
"
);
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
STGM_READ
,
&
ps
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"created property set storage
\n
"
);
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
0
,
&
ps
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"created property set storage
\n
"
);
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"created property set storage
\n
"
);
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
STGM_CREATE
|
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"created property set storage
\n
"
);
/* now try really creating a a property set */
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
STGM_CREATE
|
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
S_OK
,
"failed to create property set storage
\n
"
);
if
(
ps
)
IPropertyStorage_Release
(
ps
);
/* now try creating the same thing again */
r
=
IPropertySetStorage_Create
(
propset
,
&
FMTID_SummaryInformation
,
NULL
,
0
,
STGM_CREATE
|
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
S_OK
,
"failed to create property set storage
\n
"
);
if
(
ps
)
IPropertyStorage_Release
(
ps
);
/* should be able to open it */
r
=
IPropertySetStorage_Open
(
propset
,
&
FMTID_SummaryInformation
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
S_OK
,
"open failed
\n
"
);
if
(
r
==
S_OK
)
IPropertyStorage_Release
(
ps
);
/* delete it */
r
=
IPropertySetStorage_Delete
(
propset
,
&
FMTID_SummaryInformation
);
ok
(
r
==
S_OK
,
"failed to delete property set storage
\n
"
);
/* try opening with an invalid FMTID */
r
=
IPropertySetStorage_Open
(
propset
,
NULL
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
E_INVALIDARG
,
"open succeeded
\n
"
);
if
(
r
==
S_OK
)
IPropertyStorage_Release
(
ps
);
/* try a bad guid */
r
=
IPropertySetStorage_Open
(
propset
,
&
IID_IStorage
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"open succeeded
\n
"
);
if
(
r
==
S_OK
)
IPropertyStorage_Release
(
ps
);
/* try some invalid flags */
r
=
IPropertySetStorage_Open
(
propset
,
&
FMTID_SummaryInformation
,
STGM_CREATE
|
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_INVALIDFLAG
,
"open succeeded
\n
"
);
if
(
r
==
S_OK
)
IPropertyStorage_Release
(
ps
);
/* after deleting it, it should be gone */
r
=
IPropertySetStorage_Open
(
propset
,
&
FMTID_SummaryInformation
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
&
ps
);
ok
(
r
==
STG_E_FILENOTFOUND
,
"open failed
\n
"
);
if
(
r
==
S_OK
)
IPropertyStorage_Release
(
ps
);
printf
(
"r = %08lx
\n
"
,
r
);
r
=
IPropertySetStorage_Release
(
propset
);
ok
(
r
==
1
,
"ref count wrong
\n
"
);
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"ref count wrong
\n
"
);
DeleteFileW
(
filename
);
}
START_TEST
(
storage32
)
{
test_hglobal_storage_stat
();
test_create_storage_modes
();
test_storage_stream
();
test_open_storage
();
test_storage_suminfo
();
}
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