Commit eed12099 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

ole32: STGM_PRIORITY implies STGM_SHARE_EXCLUSIVE.

parent 7bffb5e4
...@@ -5908,10 +5908,17 @@ HRESULT WINAPI StgOpenStorage( ...@@ -5908,10 +5908,17 @@ HRESULT WINAPI StgOpenStorage(
goto end; 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 * Validate the sharing mode
*/ */
if (!(grfMode & (STGM_TRANSACTED|STGM_PRIORITY))) if (!(grfMode & STGM_TRANSACTED))
switch(STGM_SHARE_MODE(grfMode)) switch(STGM_SHARE_MODE(grfMode))
{ {
case STGM_SHARE_EXCLUSIVE: case STGM_SHARE_EXCLUSIVE:
......
...@@ -474,6 +474,13 @@ static void test_open_storage(void) ...@@ -474,6 +474,13 @@ static void test_open_storage(void)
if (stg) if (stg)
IStorage_Release(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); r = DeleteFileW(filename);
ok(r, "file didn't exist\n"); ok(r, "file didn't exist\n");
} }
......
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