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
082d0910
Commit
082d0910
authored
Jun 18, 2014
by
Francois Gouget
Committed by
Alexandre Julliard
Jun 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Return the correct error in FileLockBytesImpl_*LockRegion*().
parent
bea2c6f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
filelockbytes.c
dlls/ole32/filelockbytes.c
+16
-6
No files found.
dlls/ole32/filelockbytes.c
View file @
082d0910
...
...
@@ -313,6 +313,19 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
return
hr
;
}
static
HRESULT
get_lock_error
(
void
)
{
switch
(
GetLastError
())
{
case
ERROR_LOCK_VIOLATION
:
return
STG_E_LOCKVIOLATION
;
break
;
case
ERROR_ACCESS_DENIED
:
return
STG_E_ACCESSDENIED
;
break
;
case
ERROR_NOT_SUPPORTED
:
return
STG_E_INVALIDFUNCTION
;
break
;
default:
FIXME
(
"no mapping for error %d
\n
"
,
GetLastError
());
return
STG_E_INVALIDFUNCTION
;
}
}
static
HRESULT
WINAPI
FileLockBytesImpl_LockRegion
(
ILockBytes
*
iface
,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
,
DWORD
dwLockType
)
{
...
...
@@ -334,8 +347,7 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface,
if
(
LockFileEx
(
This
->
hfile
,
lock_flags
,
0
,
cb
.
u
.
LowPart
,
cb
.
u
.
HighPart
,
&
ol
))
return
S_OK
;
else
return
STG_E_ACCESSDENIED
;
return
get_lock_error
();
}
HRESULT
FileLockBytesImpl_LockRegionSync
(
ILockBytes
*
iface
,
...
...
@@ -353,8 +365,7 @@ HRESULT FileLockBytesImpl_LockRegionSync(ILockBytes* iface,
if
(
LockFileEx
(
This
->
hfile
,
LOCKFILE_EXCLUSIVE_LOCK
,
0
,
cb
.
u
.
LowPart
,
cb
.
u
.
HighPart
,
&
ol
))
return
S_OK
;
else
return
STG_E_ACCESSDENIED
;
return
get_lock_error
();
}
static
HRESULT
WINAPI
FileLockBytesImpl_UnlockRegion
(
ILockBytes
*
iface
,
...
...
@@ -374,8 +385,7 @@ static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface,
if
(
UnlockFileEx
(
This
->
hfile
,
0
,
cb
.
u
.
LowPart
,
cb
.
u
.
HighPart
,
&
ol
))
return
S_OK
;
else
return
STG_E_ACCESSDENIED
;
return
get_lock_error
();
}
static
HRESULT
WINAPI
FileLockBytesImpl_Stat
(
ILockBytes
*
iface
,
...
...
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