Module: wine
Branch: refs/heads/master
Commit: 5d051af6aea9d473843ca6aa2a39a02b808f7af3
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=5d051af6aea9d473843ca6a…
Author: Robert Shearman <rob(a)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);
Module: wine
Branch: refs/heads/master
Commit: dd58e54e4384ed30ee7769960ff344b1876309e6
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=dd58e54e4384ed30ee77699…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Wed May 3 14:49:32 2006 +0100
ole32: Add tests for IStorage::Stat.
---
dlls/ole32/tests/storage32.c | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index 0a70ad5..6f081e4 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -646,6 +646,12 @@ static void test_storage_refcount(void)
STGM_READWRITE |STGM_TRANSACTED, 0, &stg);
ok(r==S_OK, "StgCreateDocfile failed\n");
+ r = WriteClassStg( stg, &test_stg_cls );
+ ok( r == S_OK, "WriteClassStg failed\n");
+
+ r = IStorage_Commit( stg, STGC_DEFAULT );
+ ok( r == S_OK, "IStorage_Commit failed\n");
+
/* now create a stream */
r = IStorage_CreateStream(stg, stmname, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, 0, &stm );
ok(r==S_OK, "IStorage->CreateStream failed\n");
@@ -680,10 +686,42 @@ static void test_storage_refcount(void)
static const WCHAR stmname2[] = { 'V','a','r','2','D','a','t','a',0 };
IStorage *stg2;
IStorage *stg3;
+ STATSTG statstg;
+
+ r = IStorage_Stat( stg, &statstg, STATFLAG_NONAME );
+ ok(r == S_OK, "Stat should have succeded instead of returning 0x%08lx\n", r);
+ 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);
+ ok(statstg.reserved == 0, "Statstg reserved should have been 0 instead of %ld\n", statstg.reserved);
r = IStorage_CreateStorage( stg, stgname, STGM_SHARE_EXCLUSIVE, 0, 0, &stg2 );
ok(r == S_OK, "CreateStorage should have succeeded instead of returning 0x%08lx\n", r);
+ r = IStorage_Stat( stg2, &statstg, STATFLAG_DEFAULT );
+ ok(r == S_OK, "Stat should have succeded instead of returning 0x%08lx\n", r);
+ ok(!lstrcmpW(statstg.pwcsName, stgname),
+ "Statstg pwcsName should have been the name the storage was created with\n");
+ 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);
+ }
+ 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);
+ ok(statstg.reserved == 0, "Statstg reserved should have been 0 instead of %ld\n", statstg.reserved);
+ CoTaskMemFree(statstg.pwcsName);
+
r = IStorage_CreateStorage( stg2, stgname2, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &stg3 );
ok(r == STG_E_ACCESSDENIED, "CreateStorage should have returned STG_E_ACCESSDENIED instead of 0x%08lx\n", r);
Module: wine
Branch: refs/heads/master
Commit: e52e4978b2ae14dcc57ca843801a5f8fb6fc9b83
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=e52e4978b2ae14dcc57ca84…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Wed May 3 14:46:17 2006 +0100
ntdll: Fix size check for NtQueryInformationToken(TokenGroups).
For NtQueryInformationToken(TokenGroups), don't do a size check before
the server call, as we don't know how many SIDs there are to return
and hence the needed buffer size.
---
dlls/ntdll/nt.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 6b6cccf..5ee757d 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -202,9 +202,6 @@ NTSTATUS WINAPI NtQueryInformationToken(
switch (tokeninfoclass)
{
- case TokenGroups:
- len = sizeof(TOKEN_GROUPS);
- break;
case TokenOwner:
len = sizeof(TOKEN_OWNER) + sizeof(SID);
break;