Vincent Povirk : ole32: Move the create attribute from StorageImpl to StorageBaseImpl.

Alexandre Julliard julliard at winehq.org
Fri Dec 4 09:11:29 CST 2009


Module: wine
Branch: master
Commit: 5456724fd77b2c5e8e40c87d5c24cb8e1b27a96f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5456724fd77b2c5e8e40c87d5c24cb8e1b27a96f

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Dec  2 11:37:54 2009 -0600

ole32: Move the create attribute from StorageImpl to StorageBaseImpl.

This is to avoid accessing the top-level StorageImpl directly.

---

 dlls/ole32/stg_stream.c |    2 +-
 dlls/ole32/storage32.c  |    4 +++-
 dlls/ole32/storage32.h  |    5 +++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c
index 60cbb88..bf88c64 100644
--- a/dlls/ole32/stg_stream.c
+++ b/dlls/ole32/stg_stream.c
@@ -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;
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index e7a8c73..971f44a 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -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;
   }
 
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index 508bd70..59a8fb9 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -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];




More information about the wine-cvs mailing list