Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
cf75c536
Commit
cf75c536
authored
May 08, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
May 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Use real blocking operations for storage locking when possible.
parent
45dd716e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
filelockbytes.c
dlls/ole32/filelockbytes.c
+19
-0
storage32.c
dlls/ole32/storage32.c
+4
-1
storage32.h
dlls/ole32/storage32.h
+2
-0
No files found.
dlls/ole32/filelockbytes.c
View file @
cf75c536
...
...
@@ -356,6 +356,25 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface,
return
STG_E_ACCESSDENIED
;
}
HRESULT
FileLockBytesImpl_LockRegionSync
(
ILockBytes
*
iface
,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
)
{
FileLockBytesImpl
*
This
=
impl_from_ILockBytes
(
iface
);
OVERLAPPED
ol
;
if
(
iface
->
lpVtbl
!=
&
FileLockBytesImpl_Vtbl
)
return
E_NOTIMPL
;
ol
.
hEvent
=
0
;
ol
.
u
.
s
.
Offset
=
libOffset
.
u
.
LowPart
;
ol
.
u
.
s
.
OffsetHigh
=
libOffset
.
u
.
HighPart
;
if
(
LockFileEx
(
This
->
hfile
,
LOCKFILE_EXCLUSIVE_LOCK
,
0
,
cb
.
u
.
LowPart
,
cb
.
u
.
HighPart
,
&
ol
))
return
S_OK
;
else
return
STG_E_ACCESSDENIED
;
}
static
HRESULT
WINAPI
FileLockBytesImpl_UnlockRegion
(
ILockBytes
*
iface
,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
,
DWORD
dwLockType
)
{
...
...
dlls/ole32/storage32.c
View file @
cf75c536
...
...
@@ -2831,8 +2831,11 @@ static HRESULT StorageImpl_LockRegionSync(StorageImpl *This, ULARGE_INTEGER offs
{
HRESULT
hr
;
/* potential optimization: if we have an HFILE use LockFileEx in blocking mode directly */
/* if it's a FileLockBytesImpl use LockFileEx in blocking mode */
if
(
SUCCEEDED
(
FileLockBytesImpl_LockRegionSync
(
This
->
lockBytes
,
offset
,
cb
)))
return
S_OK
;
/* otherwise we have to fake it based on an async lock */
do
{
int
delay
=
0
;
...
...
dlls/ole32/storage32.h
View file @
cf75c536
...
...
@@ -157,6 +157,8 @@ struct DirEntry
HRESULT
FileLockBytesImpl_Construct
(
HANDLE
hFile
,
DWORD
openFlags
,
LPCWSTR
pwcsName
,
ILockBytes
**
pLockBytes
)
DECLSPEC_HIDDEN
;
HRESULT
FileLockBytesImpl_LockRegionSync
(
ILockBytes
*
iface
,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
)
DECLSPEC_HIDDEN
;
/*************************************************************************
* Ole Convert support
*/
...
...
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