Commit cc98619c authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

ole32: Add an internal vtable to StorageBaseImpl objects.

parent f434ab1f
......@@ -378,7 +378,7 @@ static ULONG WINAPI StorageBaseImpl_Release(
* destructor of the appropriate derived class. To do this, we are
* using virtual functions to implement the destructor.
*/
This->v_destructor(This);
StorageBaseImpl_Destroy(This);
}
return ref;
......@@ -2219,6 +2219,11 @@ static const IStorageVtbl Storage32Impl_Vtbl =
StorageBaseImpl_Stat
};
static const StorageBaseImplVtbl StorageImpl_BaseVtbl =
{
StorageImpl_Destroy
};
static HRESULT StorageImpl_Construct(
HANDLE hFile,
LPCOLESTR pwcsName,
......@@ -2249,7 +2254,7 @@ static HRESULT StorageImpl_Construct(
This->base.lpVtbl = &Storage32Impl_Vtbl;
This->base.pssVtbl = &IPropertySetStorage_Vtbl;
This->base.v_destructor = StorageImpl_Destroy;
This->base.baseVtbl = &StorageImpl_BaseVtbl;
This->base.openFlags = (openFlags & ~STGM_CREATE);
This->base.ref = 1;
This->base.create = create;
......@@ -4074,6 +4079,11 @@ static const IStorageVtbl Storage32InternalImpl_Vtbl =
StorageBaseImpl_Stat
};
static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl =
{
StorageInternalImpl_Destroy
};
/******************************************************************************
** Storage32InternalImpl implementation
*/
......@@ -4097,7 +4107,7 @@ static StorageInternalImpl* StorageInternalImpl_Construct(
* Initialize the virtual function table.
*/
newStorage->base.lpVtbl = &Storage32InternalImpl_Vtbl;
newStorage->base.v_destructor = StorageInternalImpl_Destroy;
newStorage->base.baseVtbl = &StorageInternalImpl_BaseVtbl;
newStorage->base.openFlags = (openFlags & ~STGM_CREATE);
/*
......
......@@ -114,6 +114,7 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF;
* module.
*/
typedef struct StorageBaseImpl StorageBaseImpl;
typedef struct StorageBaseImplVtbl StorageBaseImplVtbl;
typedef struct StorageImpl StorageImpl;
typedef struct BlockChainStream BlockChainStream;
typedef struct SmallBlockChainStream SmallBlockChainStream;
......@@ -179,6 +180,7 @@ HRESULT BIGBLOCKFILE_WriteAt(LPBIGBLOCKFILE This, ULARGE_INTEGER offset,
void OLECONVERT_CreateOleStream(LPSTORAGE pStorage);
HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName);
/****************************************************************************
* Storage32BaseImpl definitions.
*
......@@ -222,9 +224,9 @@ struct StorageBaseImpl
DirRef storageDirEntry;
/*
* virtual Destructor method.
* virtual methods.
*/
void (*v_destructor)(StorageBaseImpl*);
const StorageBaseImplVtbl *baseVtbl;
/*
* flags that this storage was opened or created with
......@@ -243,6 +245,16 @@ struct StorageBaseImpl
The behaviour of STGM_SIMPLE depends on this */
};
/* virtual methods for StorageBaseImpl objects */
struct StorageBaseImplVtbl {
void (*Destroy)(StorageBaseImpl*);
};
static inline void StorageBaseImpl_Destroy(StorageBaseImpl *This)
{
This->baseVtbl->Destroy(This);
}
/****************************************************************************
* StorageBaseImpl stream list handlers
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment