ole32: STGM_PRIORITY implies STGM_SHARE_EXCLUSIVE.

This commit is contained in:
Mike McCormack 2006-04-03 18:52:11 +09:00 committed by Alexandre Julliard
parent 7bffb5e42d
commit eed120995b
2 changed files with 15 additions and 1 deletions

View File

@ -5908,10 +5908,17 @@ HRESULT WINAPI StgOpenStorage(
goto end;
}
/* STGM_PRIORITY implies exclusive access */
if (grfMode & STGM_PRIORITY)
{
grfMode &= ~0xf0; /* remove the existing sharing mode */
grfMode |= STGM_SHARE_EXCLUSIVE;
}
/*
* Validate the sharing mode
*/
if (!(grfMode & (STGM_TRANSACTED|STGM_PRIORITY)))
if (!(grfMode & STGM_TRANSACTED))
switch(STGM_SHARE_MODE(grfMode))
{
case STGM_SHARE_EXCLUSIVE:

View File

@ -474,6 +474,13 @@ static void test_open_storage(void)
if (stg)
IStorage_Release(stg);
/* open like Project 2003 */
stg = NULL;
r = StgOpenStorage( filename, NULL, STGM_PRIORITY, NULL, 0, &stg);
ok(r == S_OK, "should succeed\n");
if (stg)
IStorage_Release(stg);
r = DeleteFileW(filename);
ok(r, "file didn't exist\n");
}