Commit 908e9e88 authored by Richard Cohen's avatar Richard Cohen Committed by Alexandre Julliard

Relax the share mode validation for transacted storage, with a test.

parent 3915b167
......@@ -5802,15 +5802,16 @@ HRESULT WINAPI StgOpenStorage(
/*
* Validate the sharing mode
*/
switch(STGM_SHARE_MODE(grfMode))
{
case STGM_SHARE_EXCLUSIVE:
case STGM_SHARE_DENY_WRITE:
break;
default:
hr = STG_E_INVALIDFLAG;
goto end;
}
if (!(grfMode & STGM_TRANSACTED))
switch(STGM_SHARE_MODE(grfMode))
{
case STGM_SHARE_EXCLUSIVE:
case STGM_SHARE_DENY_WRITE:
break;
default:
hr = STG_E_INVALIDFLAG;
goto end;
}
/*
* Validate the STGM flags
......
......@@ -393,6 +393,14 @@ static void test_open_storage(void)
ok(r==STG_E_INVALIDFLAG, "StgOpenStorage failed\n");
/* open it for real */
r = StgOpenStorage( filename, NULL, STGM_SHARE_DENY_NONE | STGM_READ | STGM_TRANSACTED, NULL, 0, &stg); /* XLViewer 97/2000 */
ok(r==S_OK, "StgOpenStorage failed\n");
if(stg)
{
r = IStorage_Release(stg);
ok(r == 0, "wrong ref count\n");
}
r = StgOpenStorage( filename, NULL, STGM_SHARE_DENY_WRITE | STGM_READ, NULL, 0, &stg);
ok(r==S_OK, "StgOpenStorage failed\n");
if(stg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment