Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2e384c4f
Commit
2e384c4f
authored
Mar 04, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Use pstgPriority if specified in StgOpenStorage.
parent
cdc03fa9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
storage32.c
dlls/ole32/storage32.c
+12
-0
storage32.c
dlls/ole32/tests/storage32.c
+42
-1
No files found.
dlls/ole32/storage32.c
View file @
2e384c4f
...
...
@@ -7609,11 +7609,21 @@ HRESULT WINAPI StgOpenStorage(
HANDLE
hFile
=
0
;
DWORD
shareMode
;
DWORD
accessMode
;
LPWSTR
temp_name
=
NULL
;
TRACE
(
"(%s, %p, %x, %p, %d, %p)
\n
"
,
debugstr_w
(
pwcsName
),
pstgPriority
,
grfMode
,
snbExclude
,
reserved
,
ppstgOpen
);
if
(
pstgPriority
)
{
/* FIXME: Copy ILockBytes instead? But currently for STGM_PRIORITY it'll be read-only. */
hr
=
StorageBaseImpl_GetFilename
((
StorageBaseImpl
*
)
pstgPriority
,
&
temp_name
);
if
(
FAILED
(
hr
))
goto
end
;
pwcsName
=
temp_name
;
TRACE
(
"using filename %s
\n
"
,
debugstr_w
(
temp_name
));
}
if
(
pwcsName
==
0
)
{
hr
=
STG_E_INVALIDNAME
;
...
...
@@ -7775,6 +7785,8 @@ HRESULT WINAPI StgOpenStorage(
*
ppstgOpen
=
&
newStorage
->
IStorage_iface
;
end:
CoTaskMemFree
(
temp_name
);
if
(
pstgPriority
)
IStorage_Release
(
pstgPriority
);
TRACE
(
"<-- %08x, IStorage %p
\n
"
,
hr
,
ppstgOpen
?
*
ppstgOpen
:
NULL
);
return
hr
;
}
...
...
dlls/ole32/tests/storage32.c
View file @
2e384c4f
...
...
@@ -929,7 +929,48 @@ static void test_storage_refcount(void)
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"wrong ref count
\n
"
);
}
IStorage_Release
(
stgprio
);
/* Multiple STGM_PRIORITY opens are possible. */
r
=
StgOpenStorage
(
filename
,
NULL
,
STGM_PRIORITY
,
NULL
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgOpenStorage failed with error 0x%08x
\n
"
,
r
);
if
(
stg
)
{
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"wrong ref count
\n
"
);
}
r
=
StgOpenStorage
(
NULL
,
stgprio
,
STGM_TRANSACTED
|
STGM_SHARE_DENY_WRITE
|
STGM_READWRITE
,
NULL
,
0
,
&
stg
);
ok
(
r
==
S_OK
,
"StgOpenStorage failed with error 0x%08x
\n
"
,
r
);
if
(
stg
)
{
static
const
WCHAR
stgname
[]
=
{
' '
,
' '
,
' '
,
'2'
,
'9'
,
0
};
IStorage
*
stg2
;
STATSTG
statstg
;
r
=
IStorage_Stat
(
stg
,
&
statstg
,
STATFLAG_NONAME
);
ok
(
r
==
S_OK
,
"Stat should have succeeded instead of returning 0x%08x
\n
"
,
r
);
ok
(
statstg
.
type
==
STGTY_STORAGE
,
"Statstg type should have been STGTY_STORAGE instead of %d
\n
"
,
statstg
.
type
);
ok
(
U
(
statstg
.
cbSize
).
LowPart
==
0
,
"Statstg cbSize.LowPart should have been 0 instead of %d
\n
"
,
U
(
statstg
.
cbSize
).
LowPart
);
ok
(
U
(
statstg
.
cbSize
).
HighPart
==
0
,
"Statstg cbSize.HighPart should have been 0 instead of %d
\n
"
,
U
(
statstg
.
cbSize
).
HighPart
);
ok
(
statstg
.
grfMode
==
(
STGM_TRANSACTED
|
STGM_SHARE_DENY_WRITE
|
STGM_READWRITE
),
"Statstg grfMode should have been 0x10022 instead of 0x%x
\n
"
,
statstg
.
grfMode
);
ok
(
statstg
.
grfLocksSupported
==
0
,
"Statstg grfLocksSupported should have been 0 instead of %d
\n
"
,
statstg
.
grfLocksSupported
);
ok
(
IsEqualCLSID
(
&
statstg
.
clsid
,
&
test_stg_cls
),
"Statstg clsid is not test_stg_cls
\n
"
);
ok
(
statstg
.
grfStateBits
==
0
,
"Statstg grfStateBits should have been 0 instead of %d
\n
"
,
statstg
.
grfStateBits
);
ok
(
statstg
.
reserved
==
0
,
"Statstg reserved should have been 0 instead of %d
\n
"
,
statstg
.
reserved
);
r
=
IStorage_CreateStorage
(
stg
,
stgname
,
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg2
);
ok
(
r
==
S_OK
,
"CreateStorage should have succeeded instead of returning 0x%08x
\n
"
,
r
);
IStorage_Release
(
stg2
);
r
=
IStorage_Commit
(
stg
,
0
);
ok
(
r
==
S_OK
,
"Commit should have succeeded instead of returning 0x%08x
\n
"
,
r
);
r
=
IStorage_Release
(
stg
);
ok
(
r
==
0
,
"wrong ref count
\n
"
);
}
/* IStorage_Release(stgprio) not necessary because StgOpenStorage released it. */
DeleteFileA
(
filenameA
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment