NTDLL: fix DuplicateHandle flags
Mike McCormack
mike at codeweavers.com
Sat Jun 25 02:18:42 CDT 2005
This patch does not modify the over the wire server protocol, only the C
interface to it...
Mike
ChangeLog:
* moved DUPLICATE_SAME_ACCESS and DUPLICATE_CLOSE_SOURCE to winnt.h
* removed DUP_HANDLE_SAME_ACCESS and DUP_HANDLE_CLOSE_SOURCE
-------------- next part --------------
Index: dlls/kernel/process.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/process.c,v
retrieving revision 1.91
diff -u -p -r1.91 process.c
--- dlls/kernel/process.c 20 Jun 2005 10:40:37 -0000 1.91
+++ dlls/kernel/process.c 25 Jun 2005 07:17:08 -0000
@@ -2596,7 +2596,7 @@ HANDLE WINAPI ConvertToGlobalHandle(HAND
{
HANDLE ret = INVALID_HANDLE_VALUE;
DuplicateHandle( GetCurrentProcess(), hSrc, GetCurrentProcess(), &ret, 0, FALSE,
- DUP_HANDLE_MAKE_GLOBAL | DUP_HANDLE_SAME_ACCESS | DUP_HANDLE_CLOSE_SOURCE );
+ DUP_HANDLE_MAKE_GLOBAL | DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE );
return ret;
}
Index: dlls/kernel/vxd.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/vxd.c,v
retrieving revision 1.19
diff -u -p -r1.19 vxd.c
--- dlls/kernel/vxd.c 20 Jun 2005 10:40:37 -0000 1.19
+++ dlls/kernel/vxd.c 25 Jun 2005 07:17:08 -0000
@@ -261,7 +261,7 @@ done:
RtlLeaveCriticalSection( &vxd_section );
if (!DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), &handle, 0,
(sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle),
- DUP_HANDLE_SAME_ACCESS ))
+ DUPLICATE_SAME_ACCESS ))
handle = 0;
return handle;
}
Index: include/winbase.h
===================================================================
RCS file: /home/wine/wine/include/winbase.h,v
retrieving revision 1.239
diff -u -p -r1.239 winbase.h
--- include/winbase.h 22 Jun 2005 11:59:34 -0000 1.239
+++ include/winbase.h 25 Jun 2005 07:17:08 -0000
@@ -806,9 +806,6 @@ typedef DWORD (CALLBACK *LPPROGRESS_ROUT
#define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
#define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
-#define DUPLICATE_CLOSE_SOURCE 0x00000001
-#define DUPLICATE_SAME_ACCESS 0x00000002
-
#define HANDLE_FLAG_INHERIT 0x00000001
#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
Index: include/winnt.h
===================================================================
RCS file: /home/wine/wine/include/winnt.h,v
retrieving revision 1.212
diff -u -p -r1.212 winnt.h
--- include/winnt.h 20 Jun 2005 10:32:31 -0000 1.212
+++ include/winnt.h 25 Jun 2005 07:17:08 -0000
@@ -3268,6 +3268,8 @@ typedef enum tagSID_NAME_USE {
#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
FILE_READ_ATTRIBUTES | SYNCHRONIZE)
+#define DUPLICATE_CLOSE_SOURCE 0x00000001
+#define DUPLICATE_SAME_ACCESS 0x00000002
/* File attribute flags */
#define FILE_SHARE_READ 0x00000001L
Index: server/handle.c
===================================================================
RCS file: /home/wine/wine/server/handle.c,v
retrieving revision 1.34
diff -u -p -r1.34 handle.c
--- server/handle.c 21 Jun 2005 09:46:15 -0000 1.34
+++ server/handle.c 25 Jun 2005 07:17:09 -0000
@@ -488,7 +488,7 @@ obj_handle_t duplicate_handle( struct pr
struct object *obj = get_handle_obj( src, src_handle, 0, NULL );
if (!obj) return 0;
- if (options & DUP_HANDLE_SAME_ACCESS)
+ if (options & DUPLICATE_SAME_ACCESS)
{
struct handle_entry *entry = get_handle( src, src_handle );
if (entry)
@@ -571,7 +571,7 @@ DECL_HANDLER(dup_handle)
release_object( dst );
}
/* close the handle no matter what happened */
- if (req->options & DUP_HANDLE_CLOSE_SOURCE)
+ if (req->options & DUPLICATE_CLOSE_SOURCE)
{
if (src == current->process) close_handle( src, req->src_handle, &reply->fd );
else close_handle( src, req->src_handle, NULL );
Index: server/protocol.def
===================================================================
RCS file: /home/wine/wine/server/protocol.def,v
retrieving revision 1.142
diff -u -p -r1.142 protocol.def
--- server/protocol.def 20 Jun 2005 13:18:38 -0000 1.142
+++ server/protocol.def 25 Jun 2005 07:17:09 -0000
@@ -468,8 +468,6 @@ enum apc_type { APC_NONE, APC_USER, APC_
obj_handle_t handle; /* duplicated handle in dst process */
int fd; /* associated fd to close */
@END
-#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
-#define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
#define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
Index: include/wine/server_protocol.h
===================================================================
RCS file: /home/wine/wine/include/wine/server_protocol.h,v
retrieving revision 1.143
diff -u -p -r1.143 server_protocol.h
--- include/wine/server_protocol.h 20 Jun 2005 13:18:38 -0000 1.143
+++ include/wine/server_protocol.h 25 Jun 2005 07:17:09 -0000
@@ -579,8 +579,6 @@ struct dup_handle_reply
obj_handle_t handle;
int fd;
};
-#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
-#define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
#define DUP_HANDLE_MAKE_GLOBAL 0x80000000
More information about the wine-patches
mailing list