Relax the share mode validation for transacted storage, with a test.
This commit is contained in:
parent
3915b16762
commit
908e9e889e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue