Commit 50436da5 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

ole32: Fix StgOpenStorage's handling of the STGM_PRIORITY flag.

parent 3217e534
......@@ -5911,7 +5911,7 @@ HRESULT WINAPI StgOpenStorage(
/*
* Validate the sharing mode
*/
if (!(grfMode & STGM_TRANSACTED))
if (!(grfMode & (STGM_TRANSACTED|STGM_PRIORITY)))
switch(STGM_SHARE_MODE(grfMode))
{
case STGM_SHARE_EXCLUSIVE:
......
......@@ -448,6 +448,32 @@ static void test_open_storage(void)
ok(r == 0, "wrong ref count\n");
}
/* open like visio 2003 */
stg = NULL;
r = StgOpenStorage( filename, NULL, STGM_PRIORITY | STGM_SHARE_DENY_NONE, NULL, 0, &stg);
ok(r == S_OK, "should succeed\n");
if (stg)
IStorage_Release(stg);
/* test other sharing modes with STGM_PRIORITY */
stg = NULL;
r = StgOpenStorage( filename, NULL, STGM_PRIORITY | STGM_SHARE_EXCLUSIVE, NULL, 0, &stg);
ok(r == S_OK, "should succeed\n");
if (stg)
IStorage_Release(stg);
stg = NULL;
r = StgOpenStorage( filename, NULL, STGM_PRIORITY | STGM_SHARE_DENY_WRITE, NULL, 0, &stg);
ok(r == S_OK, "should succeed\n");
if (stg)
IStorage_Release(stg);
stg = NULL;
r = StgOpenStorage( filename, NULL, STGM_PRIORITY | STGM_SHARE_DENY_READ, 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");
}
......
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