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
60efdd55
Commit
60efdd55
authored
Dec 01, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't set last error in close_handle(), return the error code instead.
parent
1a6c4721
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
29 deletions
+11
-29
handle.c
server/handle.c
+8
-25
handle.h
server/handle.h
+1
-1
winstation.c
server/winstation.c
+2
-3
No files found.
server/handle.c
View file @
60efdd55
...
...
@@ -347,35 +347,22 @@ struct handle_table *copy_handle_table( struct process *process, struct process
}
/* close a handle and decrement the refcount of the associated object */
/* return 1 if OK, 0 on error */
int
close_handle
(
struct
process
*
process
,
obj_handle_t
handle
)
unsigned
int
close_handle
(
struct
process
*
process
,
obj_handle_t
handle
)
{
struct
handle_table
*
table
;
struct
handle_entry
*
entry
;
struct
object
*
obj
;
if
(
!
(
entry
=
get_handle
(
process
,
handle
)))
{
set_error
(
STATUS_INVALID_HANDLE
);
return
0
;
}
if
(
entry
->
access
&
RESERVED_CLOSE_PROTECT
)
{
set_error
(
STATUS_HANDLE_NOT_CLOSABLE
);
return
0
;
}
if
(
!
(
entry
=
get_handle
(
process
,
handle
)))
return
STATUS_INVALID_HANDLE
;
if
(
entry
->
access
&
RESERVED_CLOSE_PROTECT
)
return
STATUS_HANDLE_NOT_CLOSABLE
;
obj
=
entry
->
ptr
;
if
(
!
obj
->
ops
->
close_handle
(
obj
,
process
,
handle
))
{
set_error
(
STATUS_HANDLE_NOT_CLOSABLE
);
return
0
;
}
if
(
!
obj
->
ops
->
close_handle
(
obj
,
process
,
handle
))
return
STATUS_HANDLE_NOT_CLOSABLE
;
entry
->
ptr
=
NULL
;
table
=
handle_is_global
(
handle
)
?
global_table
:
process
->
handles
;
if
(
entry
<
table
->
entries
+
table
->
free
)
table
->
free
=
entry
-
table
->
entries
;
if
(
entry
==
table
->
entries
+
table
->
last
)
shrink_handle_table
(
table
);
release_object
(
obj
);
return
1
;
return
STATUS_SUCCESS
;
}
/* retrieve the object corresponding to one of the magic pseudo-handles */
...
...
@@ -567,7 +554,8 @@ unsigned int get_handle_table_count( struct process *process )
/* close a handle */
DECL_HANDLER
(
close_handle
)
{
close_handle
(
current
->
process
,
req
->
handle
);
unsigned
int
err
=
close_handle
(
current
->
process
,
req
->
handle
);
set_error
(
err
);
}
/* set a handle information */
...
...
@@ -596,12 +584,7 @@ DECL_HANDLER(dup_handle)
release_object
(
dst
);
}
/* close the handle no matter what happened */
if
(
req
->
options
&
DUP_HANDLE_CLOSE_SOURCE
)
{
unsigned
int
err
=
get_error
();
/* don't overwrite error from the above calls */
reply
->
closed
=
close_handle
(
src
,
req
->
src_handle
);
set_error
(
err
);
}
if
(
req
->
options
&
DUP_HANDLE_CLOSE_SOURCE
)
reply
->
closed
=
!
close_handle
(
src
,
req
->
src_handle
);
reply
->
self
=
(
src
==
current
->
process
);
release_object
(
src
);
}
...
...
server/handle.h
View file @
60efdd55
...
...
@@ -38,7 +38,7 @@ extern obj_handle_t alloc_handle( struct process *process, void *obj,
unsigned
int
access
,
unsigned
int
attr
);
extern
obj_handle_t
alloc_handle_no_access_check
(
struct
process
*
process
,
void
*
ptr
,
unsigned
int
access
,
unsigned
int
attr
);
extern
int
close_handle
(
struct
process
*
process
,
obj_handle_t
handle
);
extern
unsigned
int
close_handle
(
struct
process
*
process
,
obj_handle_t
handle
);
extern
struct
object
*
get_handle_obj
(
struct
process
*
process
,
obj_handle_t
handle
,
unsigned
int
access
,
const
struct
object_ops
*
ops
);
extern
unsigned
int
get_handle_access
(
struct
process
*
process
,
obj_handle_t
handle
);
...
...
server/winstation.c
View file @
60efdd55
...
...
@@ -403,7 +403,6 @@ void close_thread_desktop( struct thread *thread )
thread
->
desktop
=
0
;
if
(
handle
)
close_handle
(
thread
->
process
,
handle
);
clear_error
();
/* ignore errors */
}
/* set the reply data from the object name */
...
...
@@ -458,7 +457,7 @@ DECL_HANDLER(close_winstation)
if
((
winstation
=
(
struct
winstation
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
&
winstation_ops
)))
{
if
(
!
close_handle
(
current
->
process
,
req
->
handle
))
set_error
(
STATUS_ACCESS_DENIED
);
if
(
close_handle
(
current
->
process
,
req
->
handle
))
set_error
(
STATUS_ACCESS_DENIED
);
release_object
(
winstation
);
}
}
...
...
@@ -544,7 +543,7 @@ DECL_HANDLER(close_desktop)
if
((
desktop
=
(
struct
desktop
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
&
desktop_ops
)))
{
if
(
!
close_handle
(
current
->
process
,
req
->
handle
))
set_error
(
STATUS_DEVICE_BUSY
);
if
(
close_handle
(
current
->
process
,
req
->
handle
))
set_error
(
STATUS_DEVICE_BUSY
);
release_object
(
desktop
);
}
}
...
...
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