From 5d051af6aea9d473843ca6aa2a39a02b808f7af3 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 3 May 2006 14:49:51 +0100 Subject: [PATCH] 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 6369410b56f..79362b5765e 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_Construct( */ 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 6f081e44e26..37492edc9d8 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -55,9 +55,7 @@ static void test_hglobal_storage_stat(void) 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); -- 2.11.4.GIT