ole32: Move the create attribute from StorageImpl to StorageBaseImpl.

This is to avoid accessing the top-level StorageImpl directly.
This commit is contained in:
Vincent Povirk 2009-12-02 11:37:54 -06:00 committed by Alexandre Julliard
parent b6dc718c44
commit 5456724fd7
3 changed files with 7 additions and 4 deletions

View File

@ -868,7 +868,7 @@ static HRESULT WINAPI StgStreamImpl_Stat(
pstatstg->grfMode = This->grfMode;
/* In simple create mode cbSize is the current pos */
if((This->parentStorage->openFlags & STGM_SIMPLE) && root->create)
if((This->parentStorage->openFlags & STGM_SIMPLE) && This->parentStorage->create)
pstatstg->cbSize = This->currentPosition;
return S_OK;

View File

@ -2276,7 +2276,7 @@ static HRESULT StorageImpl_Construct(
This->base.v_destructor = StorageImpl_Destroy;
This->base.openFlags = (openFlags & ~STGM_CREATE);
This->base.ref = 1;
This->create = create;
This->base.create = create;
/*
* This is the top-level storage so initialize the ancestor pointer
@ -4131,6 +4131,8 @@ static StorageInternalImpl* StorageInternalImpl_Construct(
*/
newStorage->base.storageDirEntry = storageDirEntry;
newStorage->base.create = 0;
return newStorage;
}

View File

@ -235,6 +235,9 @@ struct StorageBaseImpl
* State bits appear to only be preserved while running. No in the stream
*/
DWORD stateBits;
BOOL create; /* Was the storage created or opened.
The behaviour of STGM_SIMPLE depends on this */
};
/****************************************************************************
@ -260,8 +263,6 @@ struct StorageImpl
*/
HANDLE hFile; /* Physical support for the Docfile */
LPOLESTR pwcsName; /* Full path of the document file */
BOOL create; /* Was the storage created or opened.
The behaviour of STGM_SIMPLE depends on this */
/* FIXME: should this be in Storage32BaseImpl ? */
WCHAR filename[DIRENTRY_NAME_BUFFER_LEN];