ole32: STGM_PRIORITY implies STGM_SHARE_EXCLUSIVE.
This commit is contained in:
parent
7bffb5e42d
commit
eed120995b
|
@ -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:
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue