Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3410354d
Commit
3410354d
authored
Jan 18, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix NtDuplicateObject to only close the file descriptor if it's in the same process.
parent
027491f6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
3 deletions
+10
-3
om.c
dlls/ntdll/om.c
+5
-2
server_protocol.h
include/wine/server_protocol.h
+2
-1
handle.c
server/handle.c
+1
-0
protocol.def
server/protocol.def
+1
-0
trace.c
server/trace.c
+1
-0
No files found.
dlls/ntdll/om.c
View file @
3410354d
...
@@ -314,8 +314,11 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source,
...
@@ -314,8 +314,11 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source,
if
(
dest
)
*
dest
=
reply
->
handle
;
if
(
dest
)
*
dest
=
reply
->
handle
;
if
(
reply
->
closed
)
if
(
reply
->
closed
)
{
{
int
fd
=
server_remove_fd_from_cache
(
source
);
if
(
reply
->
self
)
if
(
fd
!=
-
1
)
close
(
fd
);
{
int
fd
=
server_remove_fd_from_cache
(
source
);
if
(
fd
!=
-
1
)
close
(
fd
);
}
}
}
else
if
(
options
&
DUPLICATE_CLOSE_SOURCE
)
else
if
(
options
&
DUPLICATE_CLOSE_SOURCE
)
WARN
(
"failed to close handle %p in process %p
\n
"
,
source
,
source_process
);
WARN
(
"failed to close handle %p in process %p
\n
"
,
source
,
source_process
);
...
...
include/wine/server_protocol.h
View file @
3410354d
...
@@ -740,6 +740,7 @@ struct dup_handle_reply
...
@@ -740,6 +740,7 @@ struct dup_handle_reply
{
{
struct
reply_header
__header
;
struct
reply_header
__header
;
obj_handle_t
handle
;
obj_handle_t
handle
;
int
self
;
int
closed
;
int
closed
;
};
};
#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
...
@@ -4575,6 +4576,6 @@ union generic_reply
...
@@ -4575,6 +4576,6 @@ union generic_reply
struct
query_symlink_reply
query_symlink_reply
;
struct
query_symlink_reply
query_symlink_reply
;
};
};
#define SERVER_PROTOCOL_VERSION 27
0
#define SERVER_PROTOCOL_VERSION 27
1
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/handle.c
View file @
3410354d
...
@@ -536,6 +536,7 @@ DECL_HANDLER(dup_handle)
...
@@ -536,6 +536,7 @@ DECL_HANDLER(dup_handle)
reply
->
closed
=
close_handle
(
src
,
req
->
src_handle
);
reply
->
closed
=
close_handle
(
src
,
req
->
src_handle
);
set_error
(
err
);
set_error
(
err
);
}
}
reply
->
self
=
(
src
==
current
->
process
);
release_object
(
src
);
release_object
(
src
);
}
}
}
}
server/protocol.def
View file @
3410354d
...
@@ -635,6 +635,7 @@ typedef union
...
@@ -635,6 +635,7 @@ typedef union
unsigned int options; /* duplicate options (see below) */
unsigned int options; /* duplicate options (see below) */
@REPLY
@REPLY
obj_handle_t handle; /* duplicated handle in dst process */
obj_handle_t handle; /* duplicated handle in dst process */
int self; /* is the source the current process? */
int closed; /* whether the source handle has been closed */
int closed; /* whether the source handle has been closed */
@END
@END
#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
...
...
server/trace.c
View file @
3410354d
...
@@ -1025,6 +1025,7 @@ static void dump_dup_handle_request( const struct dup_handle_request *req )
...
@@ -1025,6 +1025,7 @@ static void dump_dup_handle_request( const struct dup_handle_request *req )
static
void
dump_dup_handle_reply
(
const
struct
dup_handle_reply
*
req
)
static
void
dump_dup_handle_reply
(
const
struct
dup_handle_reply
*
req
)
{
{
fprintf
(
stderr
,
" handle=%p,"
,
req
->
handle
);
fprintf
(
stderr
,
" handle=%p,"
,
req
->
handle
);
fprintf
(
stderr
,
" self=%d,"
,
req
->
self
);
fprintf
(
stderr
,
" closed=%d"
,
req
->
closed
);
fprintf
(
stderr
,
" closed=%d"
,
req
->
closed
);
}
}
...
...
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