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
a06db6cc
Commit
a06db6cc
authored
Apr 18, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Stub for IDirectWriterLock.
parent
c29f3dff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
2 deletions
+114
-2
storage32.c
dlls/ole32/storage32.c
+63
-2
storage32.h
dlls/ole32/storage32.h
+1
-0
storage32.c
dlls/ole32/tests/storage32.c
+50
-0
No files found.
dlls/ole32/storage32.c
View file @
a06db6cc
...
...
@@ -71,6 +71,11 @@ static inline StorageBaseImpl *impl_from_IStorage( IStorage *iface )
return
CONTAINING_RECORD
(
iface
,
StorageBaseImpl
,
IStorage_iface
);
}
static
inline
StorageBaseImpl
*
impl_from_IDirectWriterLock
(
IDirectWriterLock
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
StorageBaseImpl
,
IDirectWriterLock_iface
);
}
/****************************************************************************
* Storage32InternalImpl definitions.
*
...
...
@@ -380,6 +385,12 @@ static HRESULT WINAPI StorageBaseImpl_QueryInterface(
{
*
ppvObject
=
&
This
->
IPropertySetStorage_iface
;
}
/* locking interface is report for writer only */
else
if
(
IsEqualGUID
(
&
IID_IDirectWriterLock
,
riid
)
&&
(
This
->
openFlags
==
(
STGM_DIRECT_SWMR
|
STGM_READWRITE
|
STGM_SHARE_DENY_WRITE
)))
{
*
ppvObject
=
&
This
->
IDirectWriterLock_iface
;
}
else
return
E_NOINTERFACE
;
...
...
@@ -2648,6 +2659,55 @@ static HRESULT StorageImpl_GetFilename(StorageBaseImpl* iface, LPWSTR *result)
return
hr
;
}
static
HRESULT
WINAPI
directwriterlock_QueryInterface
(
IDirectWriterLock
*
iface
,
REFIID
riid
,
void
**
obj
)
{
StorageBaseImpl
*
This
=
impl_from_IDirectWriterLock
(
iface
);
return
IStorage_QueryInterface
(
&
This
->
IStorage_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
directwriterlock_AddRef
(
IDirectWriterLock
*
iface
)
{
StorageBaseImpl
*
This
=
impl_from_IDirectWriterLock
(
iface
);
return
IStorage_AddRef
(
&
This
->
IStorage_iface
);
}
static
ULONG
WINAPI
directwriterlock_Release
(
IDirectWriterLock
*
iface
)
{
StorageBaseImpl
*
This
=
impl_from_IDirectWriterLock
(
iface
);
return
IStorage_Release
(
&
This
->
IStorage_iface
);
}
static
HRESULT
WINAPI
directwriterlock_WaitForWriteAccess
(
IDirectWriterLock
*
iface
,
DWORD
timeout
)
{
StorageBaseImpl
*
This
=
impl_from_IDirectWriterLock
(
iface
);
FIXME
(
"(%p)->(%d): stub
\n
"
,
This
,
timeout
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
directwriterlock_ReleaseWriteAccess
(
IDirectWriterLock
*
iface
)
{
StorageBaseImpl
*
This
=
impl_from_IDirectWriterLock
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
directwriterlock_HaveWriteAccess
(
IDirectWriterLock
*
iface
)
{
StorageBaseImpl
*
This
=
impl_from_IDirectWriterLock
(
iface
);
FIXME
(
"(%p): stub
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
const
IDirectWriterLockVtbl
DirectWriterLockVtbl
=
{
directwriterlock_QueryInterface
,
directwriterlock_AddRef
,
directwriterlock_Release
,
directwriterlock_WaitForWriteAccess
,
directwriterlock_ReleaseWriteAccess
,
directwriterlock_HaveWriteAccess
};
/*
* Virtual function table for the IStorage32Impl class.
*/
...
...
@@ -2719,6 +2779,7 @@ static HRESULT StorageImpl_Construct(
This
->
base
.
IStorage_iface
.
lpVtbl
=
&
Storage32Impl_Vtbl
;
This
->
base
.
IPropertySetStorage_iface
.
lpVtbl
=
&
IPropertySetStorage_Vtbl
;
This
->
base
.
IDirectWriterLock_iface
.
lpVtbl
=
&
DirectWriterLockVtbl
;
This
->
base
.
baseVtbl
=
&
StorageImpl_BaseVtbl
;
This
->
base
.
openFlags
=
(
openFlags
&
~
STGM_CREATE
);
This
->
base
.
ref
=
1
;
...
...
@@ -7631,10 +7692,10 @@ HRESULT WINAPI StgOpenStorage(
goto
end
;
}
/* shared reading requires transacted mode */
/* shared reading requires transacted
or single writer
mode */
if
(
STGM_SHARE_MODE
(
grfMode
)
==
STGM_SHARE_DENY_WRITE
&&
STGM_ACCESS_MODE
(
grfMode
)
==
STGM_READWRITE
&&
!
(
grfMode
&
STGM_TRANSACTED
)
)
!
(
grfMode
&
STGM_TRANSACTED
)
&&
!
(
grfMode
&
STGM_DIRECT_SWMR
)
)
{
hr
=
STG_E_INVALIDFLAG
;
goto
end
;
...
...
dlls/ole32/storage32.h
View file @
a06db6cc
...
...
@@ -177,6 +177,7 @@ struct StorageBaseImpl
{
IStorage
IStorage_iface
;
IPropertySetStorage
IPropertySetStorage_iface
;
/* interface for adding a properties stream */
IDirectWriterLock
IDirectWriterLock_iface
;
LONG
ref
;
/*
...
...
dlls/ole32/tests/storage32.c
View file @
a06db6cc
...
...
@@ -3046,6 +3046,55 @@ static void test_convert(void)
DeleteFileW
(
filename
);
}
static
void
test_direct_swmr
(
void
)
{
static
const
WCHAR
fileW
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
IDirectWriterLock
*
dwlock
;
ULONG
ref
,
ref2
;
IStorage
*
stg
;
HRESULT
hr
;
/* it's possible to create in writer mode */
hr
=
StgCreateDocfile
(
fileW
,
STGM_CREATE
|
STGM_READWRITE
|
STGM_SHARE_DENY_WRITE
|
STGM_DIRECT_SWMR
,
0
,
&
stg
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
IStorage_Release
(
stg
);
DeleteFileW
(
fileW
);
}
hr
=
StgCreateDocfile
(
fileW
,
STGM_CREATE
|
STGM_READWRITE
|
STGM_SHARE_DENY_WRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IStorage_Release
(
stg
);
/* reader mode */
hr
=
StgOpenStorage
(
fileW
,
NULL
,
STGM_DIRECT_SWMR
|
STGM_READ
|
STGM_SHARE_DENY_NONE
,
NULL
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IStorage_QueryInterface
(
stg
,
&
IID_IDirectWriterLock
,
(
void
**
)
&
dwlock
);
ok
(
hr
==
E_NOINTERFACE
,
"got %08x
\n
"
,
hr
);
IStorage_Release
(
stg
);
/* writer mode */
hr
=
StgOpenStorage
(
fileW
,
NULL
,
STGM_DIRECT_SWMR
|
STGM_READWRITE
|
STGM_SHARE_DENY_WRITE
,
NULL
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ref
=
IStorage_AddRef
(
stg
);
IStorage_Release
(
stg
);
hr
=
IStorage_QueryInterface
(
stg
,
&
IID_IDirectWriterLock
,
(
void
**
)
&
dwlock
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ref2
=
IStorage_AddRef
(
stg
);
IStorage_Release
(
stg
);
ok
(
ref2
==
ref
+
1
,
"got %u
\n
"
,
ref2
);
IDirectWriterLock_Release
(
dwlock
);
IStorage_Release
(
stg
);
DeleteFileW
(
fileW
);
}
START_TEST
(
storage32
)
{
CHAR
temp
[
MAX_PATH
];
...
...
@@ -3090,4 +3139,5 @@ START_TEST(storage32)
test_copyto_recursive
();
test_hglobal_storage_creation
();
test_convert
();
test_direct_swmr
();
}
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