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
df4f0272
Commit
df4f0272
authored
Aug 13, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Use proper helpers for iface calls.
parent
153b94b3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
48 deletions
+48
-48
dragdrop.c
dlls/ole32/tests/dragdrop.c
+1
-1
hglobalstream.c
dlls/ole32/tests/hglobalstream.c
+1
-1
marshal.c
dlls/ole32/tests/marshal.c
+9
-9
moniker.c
dlls/ole32/tests/moniker.c
+1
-1
ole2.c
dlls/ole32/tests/ole2.c
+27
-27
storage32.c
dlls/ole32/tests/storage32.c
+9
-9
No files found.
dlls/ole32/tests/dragdrop.c
View file @
df4f0272
...
...
@@ -43,7 +43,7 @@ static HRESULT WINAPI DropTarget_QueryInterface(IDropTarget* iface, REFIID riid,
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDropTarget
))
{
I
Unknown
_AddRef
(
iface
);
I
DropTarget
_AddRef
(
iface
);
*
ppvObject
=
iface
;
return
S_OK
;
}
...
...
dlls/ole32/tests/hglobalstream.c
View file @
df4f0272
...
...
@@ -299,7 +299,7 @@ static HRESULT WINAPI TestStream_QueryInterface(IStream *iface, REFIID riid, voi
IsEqualIID
(
riid
,
&
IID_IStream
))
{
*
ppv
=
iface
;
I
Unknown
_AddRef
(
iface
);
I
Stream
_AddRef
(
iface
);
return
S_OK
;
}
*
ppv
=
NULL
;
...
...
dlls/ole32/tests/marshal.c
View file @
df4f0272
...
...
@@ -1442,7 +1442,7 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
trace
(
"call to proxy's QueryInterface from wrong apartment returned 0x%08x
\n
"
,
hr
);
/* now be really bad and release the proxy from the wrong apartment */
I
Unknown
_Release
(
cf
);
I
ClassFactory
_Release
(
cf
);
CoUninitialize
();
...
...
@@ -1475,7 +1475,7 @@ static void test_proxy_used_in_wrong_thread(void)
ok_more_than_one_lock
();
/* do a call that will fail, but result in IRemUnknown being used by the proxy */
I
ClassFactory
_QueryInterface
(
pProxy
,
&
IID_IStream
,
(
LPVOID
*
)
&
pStream
);
I
Unknown
_QueryInterface
(
pProxy
,
&
IID_IStream
,
(
LPVOID
*
)
&
pStream
);
/* create a thread that we can misbehave in */
thread
=
CreateThread
(
NULL
,
0
,
bad_thread_proc
,
pProxy
,
0
,
&
tid2
);
...
...
@@ -1500,7 +1500,7 @@ static HRESULT WINAPI MessageFilter_QueryInterface(IMessageFilter *iface, REFIID
IsEqualGUID
(
riid
,
&
IID_IClassFactory
))
{
*
ppvObj
=
iface
;
I
ClassFactory
_AddRef
(
iface
);
I
MessageFilter
_AddRef
(
iface
);
return
S_OK
;
}
...
...
@@ -2349,7 +2349,7 @@ static HRESULT WINAPI Test_SMI_QueryInterface(
IsEqualGUID
(
riid
,
&
IID_IStdMarshalInfo
))
{
*
ppvObj
=
iface
;
I
ClassFactory
_AddRef
(
iface
);
I
StdMarshalInfo
_AddRef
(
iface
);
return
S_OK
;
}
...
...
@@ -2471,10 +2471,10 @@ static void test_client_security(void)
ok_ole_success
(
hr
,
"CoUnmarshalInterface"
);
IStream_Release
(
pStream
);
hr
=
I
Unknown
_QueryInterface
(
pProxy
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnknown1
);
hr
=
I
ClassFactory
_QueryInterface
(
pProxy
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnknown1
);
ok_ole_success
(
hr
,
"IUnknown_QueryInterface IID_IUnknown"
);
hr
=
I
Unknown
_QueryInterface
(
pProxy
,
&
IID_IRemUnknown
,
(
LPVOID
*
)
&
pProxy2
);
hr
=
I
ClassFactory
_QueryInterface
(
pProxy
,
&
IID_IRemUnknown
,
(
LPVOID
*
)
&
pProxy2
);
ok_ole_success
(
hr
,
"IUnknown_QueryInterface IID_IStream"
);
hr
=
IUnknown_QueryInterface
(
pProxy2
,
&
IID_IUnknown
,
(
LPVOID
*
)
&
pUnknown2
);
...
...
@@ -2482,10 +2482,10 @@ static void test_client_security(void)
ok
(
pUnknown1
==
pUnknown2
,
"both proxy's IUnknowns should be the same - %p, %p
\n
"
,
pUnknown1
,
pUnknown2
);
hr
=
I
Unknown
_QueryInterface
(
pProxy
,
&
IID_IMarshal
,
(
LPVOID
*
)
&
pMarshal
);
hr
=
I
ClassFactory
_QueryInterface
(
pProxy
,
&
IID_IMarshal
,
(
LPVOID
*
)
&
pMarshal
);
ok_ole_success
(
hr
,
"IUnknown_QueryInterface IID_IMarshal"
);
hr
=
I
Unknown
_QueryInterface
(
pProxy
,
&
IID_IClientSecurity
,
(
LPVOID
*
)
&
pCliSec
);
hr
=
I
ClassFactory
_QueryInterface
(
pProxy
,
&
IID_IClientSecurity
,
(
LPVOID
*
)
&
pCliSec
);
ok_ole_success
(
hr
,
"IUnknown_QueryInterface IID_IClientSecurity"
);
hr
=
IClientSecurity_QueryBlanket
(
pCliSec
,
(
IUnknown
*
)
pProxy
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
...
...
@@ -2942,7 +2942,7 @@ static HRESULT WINAPI TestChannelHook_QueryInterface(IChannelHook *iface, REFIID
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IChannelHook
))
{
*
ppv
=
iface
;
I
Unknown
_AddRef
(
iface
);
I
ChannelHook
_AddRef
(
iface
);
return
S_OK
;
}
...
...
dlls/ole32/tests/moniker.c
View file @
df4f0272
...
...
@@ -723,7 +723,7 @@ static HRESULT WINAPI ParseDisplayName_QueryInterface(IParseDisplayName *iface,
IsEqualIID
(
riid
,
&
IID_IParseDisplayName
))
{
*
ppv
=
iface
;
I
Unknown
_AddRef
(
iface
);
I
ParseDisplayName
_AddRef
(
iface
);
return
S_OK
;
}
*
ppv
=
NULL
;
...
...
dlls/ole32/tests/ole2.c
View file @
df4f0272
...
...
@@ -616,7 +616,7 @@ static HRESULT WINAPI OleObjectCF_QueryInterface(IClassFactory *iface, REFIID ri
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IClassFactory
))
{
*
ppv
=
iface
;
I
Unknown
_AddRef
(
iface
);
I
ClassFactory
_AddRef
(
iface
);
return
S_OK
;
}
*
ppv
=
NULL
;
...
...
@@ -997,7 +997,7 @@ static HRESULT WINAPI AdviseSink_QueryInterface(IAdviseSink *iface, REFIID riid,
if
(
IsEqualIID
(
riid
,
&
IID_IAdviseSink
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
ppv
=
iface
;
I
Unknown
_AddRef
(
iface
);
I
AdviseSink
_AddRef
(
iface
);
return
S_OK
;
}
*
ppv
=
NULL
;
...
...
@@ -1279,11 +1279,11 @@ static void test_data_cache(void)
hr
=
CreateDataCache
(
NULL
,
&
CLSID_NULL
,
&
IID_IOleCache2
,
(
LPVOID
*
)
&
pOleCache
);
ok_ole_success
(
hr
,
"CreateDataCache"
);
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IPersistStorage
,
(
LPVOID
*
)
&
pPS
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IPersistStorage
,
(
LPVOID
*
)
&
pPS
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IPersistStorage)"
);
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IViewObject
,
(
LPVOID
*
)
&
pViewObject
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IViewObject
,
(
LPVOID
*
)
&
pViewObject
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IViewObject)"
);
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IOleCacheControl
,
(
LPVOID
*
)
&
pOleCacheControl
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IOleCacheControl
,
(
LPVOID
*
)
&
pOleCacheControl
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IOleCacheControl)"
);
hr
=
IViewObject_SetAdvise
(
pViewObject
,
DVASPECT_ICON
,
ADVF_PRIMEFIRST
,
&
AdviseSink
);
...
...
@@ -1299,16 +1299,16 @@ static void test_data_cache(void)
ok_ole_success
(
hr
,
"IPersistStorage_GetClassID"
);
ok
(
IsEqualCLSID
(
&
clsid
,
&
IID_NULL
),
"clsid should be blank
\n
"
);
hr
=
IOleCache_Uncache
(
pOleCache
,
0xdeadbeef
);
hr
=
IOleCache
2
_Uncache
(
pOleCache
,
0xdeadbeef
);
ok
(
hr
==
OLE_E_NOCONNECTION
,
"IOleCache_Uncache with invalid value should return OLE_E_NOCONNECTION instead of 0x%x
\n
"
,
hr
);
/* Both tests crash on NT4 and below. StgCreatePropSetStg is only available on w2k and above. */
if
(
GetProcAddress
(
GetModuleHandleA
(
"ole32.dll"
),
"StgCreatePropSetStg"
))
{
hr
=
IOleCache_Cache
(
pOleCache
,
NULL
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
NULL
,
0
,
&
dwConnection
);
ok
(
hr
==
E_INVALIDARG
,
"IOleCache_Cache with NULL fmtetc should have returned E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
hr
=
IOleCache_Cache
(
pOleCache
,
NULL
,
0
,
NULL
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"IOleCache_Cache with NULL pdwConnection should have returned E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
}
else
...
...
@@ -1323,7 +1323,7 @@ static void test_data_cache(void)
for
(
i
=
0
;
i
<
7
;
i
++
)
{
fmtetc
.
tymed
=
1
<<
i
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
if
((
fmtetc
.
cfFormat
==
CF_METAFILEPICT
&&
fmtetc
.
tymed
==
TYMED_MFPICT
)
||
(
fmtetc
.
cfFormat
==
CF_BITMAP
&&
fmtetc
.
tymed
==
TYMED_GDI
)
||
(
fmtetc
.
cfFormat
==
CF_DIB
&&
fmtetc
.
tymed
==
TYMED_HGLOBAL
)
||
...
...
@@ -1340,7 +1340,7 @@ static void test_data_cache(void)
fmtetc
.
cfFormat
,
fmtetc
.
tymed
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IOleCache_Uncache
(
pOleCache
,
dwConnection
);
hr
=
IOleCache
2
_Uncache
(
pOleCache
,
dwConnection
);
ok_ole_success
(
hr
,
"IOleCache_Uncache"
);
}
}
...
...
@@ -1349,13 +1349,13 @@ static void test_data_cache(void)
fmtetc
.
cfFormat
=
CF_BITMAP
;
fmtetc
.
dwAspect
=
DVASPECT_THUMBNAIL
;
fmtetc
.
tymed
=
TYMED_GDI
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok_ole_success
(
hr
,
"IOleCache_Cache"
);
fmtetc
.
cfFormat
=
0
;
fmtetc
.
dwAspect
=
DVASPECT_ICON
;
fmtetc
.
tymed
=
TYMED_MFPICT
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok_ole_success
(
hr
,
"IOleCache_Cache"
);
MultiByteToWideChar
(
CP_ACP
,
0
,
szSystemDir
,
-
1
,
wszPath
,
sizeof
(
wszPath
)
/
sizeof
(
wszPath
[
0
]));
...
...
@@ -1368,11 +1368,11 @@ static void test_data_cache(void)
stgmedium
.
pUnkForRelease
=
NULL
;
fmtetc
.
dwAspect
=
DVASPECT_CONTENT
;
hr
=
IOleCache_SetData
(
pOleCache
,
&
fmtetc
,
&
stgmedium
,
FALSE
);
hr
=
IOleCache
2
_SetData
(
pOleCache
,
&
fmtetc
,
&
stgmedium
,
FALSE
);
ok
(
hr
==
OLE_E_BLANK
,
"IOleCache_SetData for aspect not in cache should have return OLE_E_BLANK instead of 0x%08x
\n
"
,
hr
);
fmtetc
.
dwAspect
=
DVASPECT_ICON
;
hr
=
IOleCache_SetData
(
pOleCache
,
&
fmtetc
,
&
stgmedium
,
FALSE
);
hr
=
IOleCache
2
_SetData
(
pOleCache
,
&
fmtetc
,
&
stgmedium
,
FALSE
);
ok_ole_success
(
hr
,
"IOleCache_SetData"
);
ReleaseStgMedium
(
&
stgmedium
);
...
...
@@ -1421,7 +1421,7 @@ static void test_data_cache(void)
IPersistStorage_Release
(
pPS
);
IViewObject_Release
(
pViewObject
);
IOleCache_Release
(
pOleCache
);
IOleCache
2
_Release
(
pOleCache
);
IOleCacheControl_Release
(
pOleCacheControl
);
CHECK_NO_EXTRA_METHODS
();
...
...
@@ -1433,9 +1433,9 @@ static void test_data_cache(void)
hr
=
CreateDataCache
(
NULL
,
&
CLSID_NULL
,
&
IID_IOleCache2
,
(
LPVOID
*
)
&
pOleCache
);
ok_ole_success
(
hr
,
"CreateDataCache"
);
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IPersistStorage
,
(
LPVOID
*
)
&
pPS
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IPersistStorage
,
(
LPVOID
*
)
&
pPS
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IPersistStorage)"
);
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IViewObject
,
(
LPVOID
*
)
&
pViewObject
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IViewObject
,
(
LPVOID
*
)
&
pViewObject
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IViewObject)"
);
hr
=
IViewObject_SetAdvise
(
pViewObject
,
DVASPECT_ICON
,
ADVF_PRIMEFIRST
,
&
AdviseSink
);
...
...
@@ -1452,7 +1452,7 @@ static void test_data_cache(void)
fmtetc
.
lindex
=
-
1
;
fmtetc
.
ptd
=
NULL
;
fmtetc
.
tymed
=
TYMED_MFPICT
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok
(
hr
==
CACHE_S_SAMECACHE
,
"IOleCache_Cache with already loaded data format type should return CACHE_S_SAMECACHE instead of 0x%x
\n
"
,
hr
);
rcBounds
.
left
=
0
;
...
...
@@ -1486,13 +1486,13 @@ static void test_data_cache(void)
DeleteDC
(
hdcMem
);
todo_wine
{
hr
=
IOleCache_InitCache
(
pOleCache
,
&
DataObject
);
hr
=
IOleCache
2
_InitCache
(
pOleCache
,
&
DataObject
);
ok
(
hr
==
CACHE_E_NOCACHE_UPDATED
,
"IOleCache_InitCache should have returned CACHE_E_NOCACHE_UPDATED instead of 0x%08x
\n
"
,
hr
);
}
IPersistStorage_Release
(
pPS
);
IViewObject_Release
(
pViewObject
);
IOleCache_Release
(
pOleCache
);
IOleCache
2
_Release
(
pOleCache
);
todo_wine
{
CHECK_NO_EXTRA_METHODS
();
...
...
@@ -1503,16 +1503,16 @@ static void test_data_cache(void)
expected_method_list
=
methods_cachethenrun
;
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IDataObject
,
(
LPVOID
*
)
&
pCacheDataObject
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IDataObject
,
(
LPVOID
*
)
&
pCacheDataObject
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IDataObject)"
);
hr
=
IOleCache_QueryInterface
(
pOleCache
,
&
IID_IOleCacheControl
,
(
LPVOID
*
)
&
pOleCacheControl
);
hr
=
IOleCache
2
_QueryInterface
(
pOleCache
,
&
IID_IOleCacheControl
,
(
LPVOID
*
)
&
pOleCacheControl
);
ok_ole_success
(
hr
,
"IOleCache_QueryInterface(IID_IOleCacheControl)"
);
fmtetc
.
cfFormat
=
CF_METAFILEPICT
;
fmtetc
.
dwAspect
=
DVASPECT_CONTENT
;
fmtetc
.
tymed
=
TYMED_MFPICT
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok_ole_success
(
hr
,
"IOleCache_Cache"
);
hr
=
IDataObject_GetData
(
pCacheDataObject
,
&
fmtetc
,
&
stgmedium
);
...
...
@@ -1522,14 +1522,14 @@ static void test_data_cache(void)
fmtetc
.
dwAspect
=
DVASPECT_CONTENT
;
fmtetc
.
tymed
=
TYMED_HGLOBAL
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok
(
hr
==
CACHE_S_FORMATETC_NOTSUPPORTED
,
"got %08x
\n
"
,
hr
);
hr
=
IDataObject_GetData
(
pCacheDataObject
,
&
fmtetc
,
&
stgmedium
);
ok
(
hr
==
OLE_E_BLANK
,
"got %08x
\n
"
,
hr
);
fmtetc
.
cfFormat
=
cf_test_2
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
ADVF_PRIMEFIRST
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
ADVF_PRIMEFIRST
,
&
dwConnection
);
ok
(
hr
==
CACHE_S_FORMATETC_NOTSUPPORTED
,
"got %08x
\n
"
,
hr
);
hr
=
IDataObject_GetData
(
pCacheDataObject
,
&
fmtetc
,
&
stgmedium
);
...
...
@@ -1539,7 +1539,7 @@ static void test_data_cache(void)
ok_ole_success
(
hr
,
"IOleCacheControl_OnRun"
);
fmtetc
.
cfFormat
=
cf_test_3
;
hr
=
IOleCache_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
hr
=
IOleCache
2
_Cache
(
pOleCache
,
&
fmtetc
,
0
,
&
dwConnection
);
ok
(
hr
==
CACHE_S_FORMATETC_NOTSUPPORTED
,
"got %08x
\n
"
,
hr
);
fmtetc
.
cfFormat
=
cf_test_1
;
...
...
@@ -1557,7 +1557,7 @@ static void test_data_cache(void)
IOleCacheControl_Release
(
pOleCacheControl
);
IDataObject_Release
(
pCacheDataObject
);
IOleCache_Release
(
pOleCache
);
IOleCache
2
_Release
(
pOleCache
);
CHECK_NO_EXTRA_METHODS
();
...
...
dlls/ole32/tests/storage32.c
View file @
df4f0272
...
...
@@ -1332,7 +1332,7 @@ static void test_substorage_share(void)
ok
(
r
==
STG_E_REVERTED
,
"IStorage->CreateStream failed, hr=%08x
\n
"
,
r
);
if
(
r
==
S_OK
)
ISt
orage
_Release
(
stm
);
ISt
ream
_Release
(
stm
);
IStorage_Release
(
stg2
);
}
...
...
@@ -1347,13 +1347,13 @@ static void test_substorage_share(void)
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
ISt
orage
_Release
(
stm2
);
ISt
ream
_Release
(
stm2
);
r
=
IStorage_OpenStream
(
stg
,
stmname
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm2
);
ok
(
r
==
STG_E_ACCESSDENIED
,
"IStorage->OpenStream should fail %08x
\n
"
,
r
);
if
(
r
==
S_OK
)
ISt
orage
_Release
(
stm2
);
ISt
ream
_Release
(
stm2
);
/* cannot rename the stream while it's open */
r
=
IStorage_RenameElement
(
stg
,
stmname
,
othername
);
...
...
@@ -1367,7 +1367,7 @@ static void test_substorage_share(void)
r
=
IStream_Write
(
stm
,
"this shouldn't work
\n
"
,
20
,
NULL
);
ok
(
r
==
STG_E_REVERTED
,
"IStream_Write should fail %08x
\n
"
,
r
);
ISt
orage
_Release
(
stm
);
ISt
ream
_Release
(
stm
);
}
IStorage_Release
(
stg
);
...
...
@@ -1521,7 +1521,7 @@ static void test_revert(void)
ok
(
r
==
S_OK
,
"IStream_Write should succeed %08x
\n
"
,
r
);
IStream_Release
(
stm
);
ISt
ream
_Release
(
stg
);
ISt
orage
_Release
(
stg
);
r
=
DeleteFileA
(
filenameA
);
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
...
...
@@ -1651,7 +1651,7 @@ static void test_nonroot_transacted(void)
r
=
IStorage_CreateStorage
(
stg2
,
stgname
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg3
);
ok
(
r
==
S_OK
,
"IStorage->CreateStorage failed, hr=%08x
\n
"
,
r
);
if
(
r
==
S_OK
)
ISt
ream
_Release
(
stg3
);
ISt
orage
_Release
(
stg3
);
/* But changes cannot be committed. */
r
=
IStorage_Commit
(
stg2
,
0
);
...
...
@@ -1703,7 +1703,7 @@ static void test_nonroot_transacted(void)
IStorage_Release
(
stg2
);
}
ISt
ream
_Release
(
stg
);
ISt
orage
_Release
(
stg
);
r
=
DeleteFileA
(
filenameA
);
ok
(
r
==
TRUE
,
"deleted file
\n
"
);
...
...
@@ -2009,13 +2009,13 @@ static void test_readonly(void)
hr
=
IStorage_CreateStorage
(
stg2
,
streamW
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READ
,
0
,
0
,
&
stg3
);
ok
(
hr
==
STG_E_FILEALREADYEXISTS
,
"should fail, res=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ISt
ream
_Release
(
stg3
);
ISt
orage
_Release
(
stg3
);
/* CreateStorage on read-only storage, name does not exist */
hr
=
IStorage_CreateStorage
(
stg2
,
storageW
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READ
,
0
,
0
,
&
stg3
);
ok
(
hr
==
STG_E_ACCESSDENIED
,
"should fail, res=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ISt
ream
_Release
(
stg3
);
ISt
orage
_Release
(
stg3
);
/* DestroyElement on read-only storage, name exists */
hr
=
IStorage_DestroyElement
(
stg2
,
streamW
);
...
...
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