Robert Shearman : ole32: Copy the mode flags into the STATSTG structure in IStorage::Stat.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 5 15:24:15 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 5d051af6aea9d473843ca6aa2a39a02b808f7af3
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=5d051af6aea9d473843ca6aa2a39a02b808f7af3

Author: Robert Shearman <rob at codeweavers.com>
Date:   Wed May  3 14:49:51 2006 +0100

ole32: Copy the mode flags into the STATSTG structure in IStorage::Stat.

Copy the mode flags into the STATSTG structure in IStorage::Stat. Don't 
store the STGM_CREATE flag in openFlags, since it is only relevant when 
opening the stream and the tests show that it isn't returned in the 
STATSTG structure.

---

 dlls/ole32/storage32.c       |    6 ++++--
 dlls/ole32/tests/storage32.c |    8 +-------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 6369410..79362b5 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -647,6 +647,8 @@ HRESULT WINAPI StorageBaseImpl_Stat(
       &curProperty,
       grfStatFlag);
 
+    pstatstg->grfMode = This->openFlags;
+
     res = S_OK;
     goto end;
   }
@@ -2298,7 +2300,7 @@ HRESULT StorageImpl_Construct(
   This->base.lpVtbl = &Storage32Impl_Vtbl;
   This->base.pssVtbl = &IPropertySetStorage_Vtbl;
   This->base.v_destructor = &StorageImpl_Destroy;
-  This->base.openFlags = openFlags;
+  This->base.openFlags = (openFlags & ~STGM_CREATE);
 
   /*
    * This is the top-level storage so initialize the ancestor pointer
@@ -4163,7 +4165,7 @@ StorageInternalImpl* StorageInternalImpl
      */
     newStorage->base.lpVtbl = &Storage32InternalImpl_Vtbl;
     newStorage->base.v_destructor = &StorageInternalImpl_Destroy;
-    newStorage->base.openFlags = openFlags;
+    newStorage->base.openFlags = (openFlags & ~STGM_CREATE);
 
     /*
      * Keep the ancestor storage pointer and nail a reference to it.
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index 6f081e4..37492ed 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -55,9 +55,7 @@ static void test_hglobal_storage_stat(vo
 
     ok( stat.pwcsName == NULL, "storage name not null\n");
     ok( stat.type == 1, "type is wrong\n");
-    todo_wine {
     ok( stat.grfMode == 0x12, "grf mode is incorrect\n");
-    }
     ok( !memcmp(&stat.clsid, &test_stg_cls, sizeof test_stg_cls), "CLSID is wrong\n");
 
     refcount = IStorage_Release( stg );
@@ -693,10 +691,8 @@ static void test_storage_refcount(void)
         ok(statstg.type == STGTY_STORAGE, "Statstg type should have been STGTY_STORAGE instead of %ld\n", statstg.type);
         ok(statstg.cbSize.LowPart == 0, "Statstg cbSize.LowPart should have been 0 instead of %ld\n", statstg.cbSize.LowPart);
         ok(statstg.cbSize.HighPart == 0, "Statstg cbSize.HighPart should have been 0 instead of %ld\n", statstg.cbSize.HighPart);
-        todo_wine {
         ok(statstg.grfMode == (STGM_TRANSACTED|STGM_SHARE_DENY_WRITE|STGM_READWRITE),
             "Statstg grfMode should have been 0x10022 instead of 0x%lx\n", statstg.grfMode);
-        }
         ok(statstg.grfLocksSupported == 0, "Statstg grfLocksSupported should have been 0 instead of %ld\n", statstg.grfLocksSupported);
         ok(IsEqualCLSID(&statstg.clsid, &test_stg_cls), "Statstg clsid is not test_stg_cls\n");
         ok(statstg.grfStateBits == 0, "Statstg grfStateBits should have been 0 instead of %ld\n", statstg.grfStateBits);
@@ -712,10 +708,8 @@ static void test_storage_refcount(void)
         ok(statstg.type == STGTY_STORAGE, "Statstg type should have been STGTY_STORAGE instead of %ld\n", statstg.type);
         ok(statstg.cbSize.LowPart == 0, "Statstg cbSize.LowPart should have been 0 instead of %ld\n", statstg.cbSize.LowPart);
         ok(statstg.cbSize.HighPart == 0, "Statstg cbSize.HighPart should have been 0 instead of %ld\n", statstg.cbSize.HighPart);
-        todo_wine {
         ok(statstg.grfMode == STGM_SHARE_EXCLUSIVE,
-            "Statstg grfMode should have been 0x10022 instead of 0x%lx\n", statstg.grfMode);
-        }
+            "Statstg grfMode should have been STGM_SHARE_EXCLUSIVE instead of 0x%lx\n", statstg.grfMode);
         ok(statstg.grfLocksSupported == 0, "Statstg grfLocksSupported should have been 0 instead of %ld\n", statstg.grfLocksSupported);
         ok(IsEqualCLSID(&statstg.clsid, &CLSID_NULL), "Statstg clsid is not CLSID_NULL\n");
         ok(statstg.grfStateBits == 0, "Statstg grfStateBits should have been 0 instead of %ld\n", statstg.grfStateBits);




More information about the wine-cvs mailing list