ole32: Store SMWR storage instance role separately.
This commit is contained in:
parent
8a9ab424ff
commit
5132f60298
|
@ -385,9 +385,8 @@ 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)))
|
||||
/* locking interface is reported for writer only */
|
||||
else if (IsEqualGUID(&IID_IDirectWriterLock, riid) && This->lockingrole == SWMR_Writer)
|
||||
{
|
||||
*ppvObject = &This->IDirectWriterLock_iface;
|
||||
}
|
||||
|
@ -2785,6 +2784,13 @@ static HRESULT StorageImpl_Construct(
|
|||
This->base.ref = 1;
|
||||
This->base.create = create;
|
||||
|
||||
if (openFlags == (STGM_DIRECT_SWMR|STGM_READWRITE|STGM_SHARE_DENY_WRITE))
|
||||
This->base.lockingrole = SWMR_Writer;
|
||||
else if (openFlags == (STGM_DIRECT_SWMR|STGM_READ|STGM_SHARE_DENY_NONE))
|
||||
This->base.lockingrole = SWMR_Reader;
|
||||
else
|
||||
This->base.lockingrole = SWMR_None;
|
||||
|
||||
This->base.reverted = 0;
|
||||
|
||||
/*
|
||||
|
|
|
@ -163,6 +163,12 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN
|
|||
HRESULT STORAGE_CreateOleStream(IStorage*, DWORD) DECLSPEC_HIDDEN;
|
||||
HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName) DECLSPEC_HIDDEN;
|
||||
|
||||
enum swmr_mode
|
||||
{
|
||||
SWMR_None,
|
||||
SWMR_Writer,
|
||||
SWMR_Reader
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* StorageBaseImpl definitions.
|
||||
|
@ -223,6 +229,7 @@ struct StorageBaseImpl
|
|||
* the transacted snapshot or cache.
|
||||
*/
|
||||
StorageBaseImpl *transactedChild;
|
||||
enum swmr_mode lockingrole;
|
||||
};
|
||||
|
||||
/* virtual methods for StorageBaseImpl objects */
|
||||
|
|
Loading…
Reference in New Issue