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
0042cb3a
Commit
0042cb3a
authored
May 29, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed duplicate_handle to work with pseudo-handles (reported by Marcus
Meissner).
parent
f981c6cb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
handle.c
server/handle.c
+16
-5
No files found.
server/handle.c
View file @
0042cb3a
...
...
@@ -245,14 +245,25 @@ int duplicate_handle( struct process *src, int src_handle, struct process *dst,
unsigned
int
access
,
int
inherit
,
int
options
)
{
int
res
;
struct
handle_entry
*
entry
=
get_handle
(
src
,
src_handle
);
if
(
!
entry
)
return
-
1
;
struct
object
*
obj
=
get_handle_obj
(
src
,
src_handle
,
0
,
NULL
);
if
(
options
&
DUP_HANDLE_SAME_ACCESS
)
access
=
entry
->
access
;
if
(
!
obj
)
return
-
1
;
if
(
options
&
DUP_HANDLE_SAME_ACCESS
)
{
struct
handle_entry
*
entry
=
get_handle
(
src
,
src_handle
);
if
(
entry
)
access
=
entry
->
access
;
else
/* pseudo-handle, give it full access */
{
access
=
STANDARD_RIGHTS_ALL
|
SPECIFIC_RIGHTS_ALL
;
CLEAR_ERROR
();
}
}
if
(
options
&
DUP_HANDLE_MAKE_GLOBAL
)
dst
=
initial_process
;
access
&=
~
RESERVED_ALL
;
res
=
alloc_handle
(
dst
,
entry
->
ptr
,
access
,
inherit
);
if
(
options
&
DUP_HANDLE_MAKE_GLOBAL
)
res
=
HANDLE_LOCAL_TO_GLOBAL
(
res
);
res
=
alloc_handle
(
dst
,
obj
,
access
,
inherit
);
release_object
(
obj
);
if
((
options
&
DUP_HANDLE_MAKE_GLOBAL
)
&&
(
res
!=
-
1
))
res
=
HANDLE_LOCAL_TO_GLOBAL
(
res
);
return
res
;
}
...
...
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