Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jackie Jiang
wine
Commits
60efdd55
Commit
60efdd55
authored
15 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
server: Don't set last error in close_handle(), return the error code instead.
parent
1a6c4721
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/handle.c
+8
-25
8 additions, 25 deletions
server/handle.c
server/handle.h
+1
-1
1 addition, 1 deletion
server/handle.h
server/winstation.c
+2
-3
2 additions, 3 deletions
server/winstation.c
with
11 additions
and
29 deletions
server/handle.c
+
8
−
25
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
);
}
...
...
This diff is collapsed.
Click to expand it.
server/handle.h
+
1
−
1
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
);
...
...
This diff is collapsed.
Click to expand it.
server/winstation.c
+
2
−
3
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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment