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
584427fc
Commit
584427fc
authored
Feb 16, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Avoid redefining the DuplicateHandle() constants.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d3df2b12
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
18 additions
and
21 deletions
+18
-21
process.c
dlls/kernel32/process.c
+1
-1
vxd.c
dlls/krnl386.exe16/vxd.c
+1
-1
heap.c
dlls/ntdll/heap.c
+1
-1
device.c
dlls/wineandroid.drv/device.c
+2
-2
server_protocol.h
include/wine/server_protocol.h
+0
-3
winnt.h
include/winnt.h
+3
-0
handle.c
server/handle.c
+6
-6
protocol.def
server/protocol.def
+0
-3
thread.c
server/thread.c
+2
-2
winstation.c
server/winstation.c
+2
-2
No files found.
dlls/kernel32/process.c
View file @
584427fc
...
...
@@ -273,7 +273,7 @@ HANDLE WINAPI ConvertToGlobalHandle(HANDLE hSrc)
{
HANDLE
ret
=
INVALID_HANDLE_VALUE
;
DuplicateHandle
(
GetCurrentProcess
(),
hSrc
,
GetCurrentProcess
(),
&
ret
,
0
,
FALSE
,
DUP
_HANDLE_MAKE_GLOBAL
|
DUP_HANDLE_SAME_ACCESS
|
DUP_HANDL
E_CLOSE_SOURCE
);
DUP
LICATE_MAKE_GLOBAL
|
DUPLICATE_SAME_ACCESS
|
DUPLICAT
E_CLOSE_SOURCE
);
return
ret
;
}
...
...
dlls/krnl386.exe16/vxd.c
View file @
584427fc
...
...
@@ -213,7 +213,7 @@ done:
RtlLeaveCriticalSection
(
&
vxd_section
);
if
(
!
DuplicateHandle
(
GetCurrentProcess
(),
handle
,
GetCurrentProcess
(),
&
handle
,
0
,
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
),
DUP
_HANDL
E_SAME_ACCESS
))
DUP
LICAT
E_SAME_ACCESS
))
handle
=
0
;
return
handle
;
}
...
...
dlls/ntdll/heap.c
View file @
584427fc
...
...
@@ -975,7 +975,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
if
(
!
sem
)
NtCreateSemaphore
(
&
sem
,
SEMAPHORE_ALL_ACCESS
,
NULL
,
0
,
1
);
NtDuplicateObject
(
NtCurrentProcess
(),
sem
,
NtCurrentProcess
(),
&
sem
,
0
,
0
,
DUP
_HANDLE_MAKE_GLOBAL
|
DUP_HANDLE_SAME_ACCESS
|
DUP_HANDL
E_CLOSE_SOURCE
);
DUP
LICATE_MAKE_GLOBAL
|
DUPLICATE_SAME_ACCESS
|
DUPLICAT
E_CLOSE_SOURCE
);
heap
->
critSection
.
LockSemaphore
=
sem
;
RtlFreeHeap
(
processHeap
,
0
,
heap
->
critSection
.
DebugInfo
);
heap
->
critSection
.
DebugInfo
=
NULL
;
...
...
dlls/wineandroid.drv/device.c
View file @
584427fc
...
...
@@ -332,7 +332,7 @@ static int duplicate_fd( HANDLE client, int fd )
if
(
!
wine_server_fd_to_handle
(
dup
(
fd
),
GENERIC_READ
|
SYNCHRONIZE
,
0
,
&
handle
))
DuplicateHandle
(
GetCurrentProcess
(),
handle
,
client
,
&
ret
,
DUPLICATE_SAME_ACCESS
,
FALSE
,
DUP_HANDL
E_CLOSE_SOURCE
);
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
|
DUPLICAT
E_CLOSE_SOURCE
);
if
(
!
ret
)
return
-
1
;
return
HandleToLong
(
ret
);
...
...
@@ -348,7 +348,7 @@ static int map_native_handle( union native_handle_buffer *dest, const native_han
{
HANDLE
ret
=
0
;
if
(
!
DuplicateHandle
(
GetCurrentProcess
(),
mapping
,
client
,
&
ret
,
DUPLICATE_SAME_ACCESS
,
FALSE
,
DUP_HANDL
E_CLOSE_SOURCE
))
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
|
DUPLICAT
E_CLOSE_SOURCE
))
return
-
ENOSPC
;
dest
->
handle
.
numFds
=
0
;
dest
->
handle
.
numInts
=
1
;
...
...
include/wine/server_protocol.h
View file @
584427fc
...
...
@@ -1259,9 +1259,6 @@ struct dup_handle_reply
int
closed
;
char
__pad_20
[
4
];
};
#define DUP_HANDLE_CLOSE_SOURCE DUPLICATE_CLOSE_SOURCE
#define DUP_HANDLE_SAME_ACCESS DUPLICATE_SAME_ACCESS
#define DUP_HANDLE_MAKE_GLOBAL 0x80000000
...
...
include/winnt.h
View file @
584427fc
...
...
@@ -5531,6 +5531,9 @@ typedef struct _QUOTA_LIMITS_EX {
#define DUPLICATE_CLOSE_SOURCE 0x00000001
#define DUPLICATE_SAME_ACCESS 0x00000002
#ifdef __WINESRC__
#define DUPLICATE_MAKE_GLOBAL 0x80000000
/* Not a Windows flag */
#endif
/* File attribute flags */
#define FILE_SHARE_READ 0x00000001
...
...
server/handle.c
View file @
584427fc
...
...
@@ -566,7 +566,7 @@ obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, str
src_access
=
obj
->
ops
->
map_access
(
obj
,
GENERIC_ALL
);
src_access
&=
~
RESERVED_ALL
;
if
(
options
&
DUP
_HANDL
E_SAME_ACCESS
)
if
(
options
&
DUP
LICAT
E_SAME_ACCESS
)
access
=
src_access
;
else
access
=
obj
->
ops
->
map_access
(
obj
,
access
)
&
~
RESERVED_ALL
;
...
...
@@ -581,16 +581,16 @@ obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, str
return
0
;
}
if
(
options
&
DUP
_HANDL
E_MAKE_GLOBAL
)
if
(
options
&
DUP
LICAT
E_MAKE_GLOBAL
)
res
=
alloc_global_handle
(
obj
,
access
);
else
res
=
alloc_handle_no_access_check
(
dst
,
obj
,
access
,
attr
);
}
else
{
if
(
options
&
DUP
_HANDL
E_MAKE_GLOBAL
)
if
(
options
&
DUP
LICAT
E_MAKE_GLOBAL
)
res
=
alloc_global_handle_no_access_check
(
obj
,
access
);
else
if
((
options
&
DUP
_HANDL
E_CLOSE_SOURCE
)
&&
src
==
dst
&&
else
if
((
options
&
DUP
LICAT
E_CLOSE_SOURCE
)
&&
src
==
dst
&&
entry
&&
!
(
entry
->
access
&
RESERVED_CLOSE_PROTECT
))
{
if
(
attr
&
OBJ_INHERIT
)
access
|=
RESERVED_INHERIT
;
...
...
@@ -665,7 +665,7 @@ DECL_HANDLER(dup_handle)
reply
->
handle
=
0
;
if
((
src
=
get_process_from_handle
(
req
->
src_process
,
PROCESS_DUP_HANDLE
)))
{
if
(
req
->
options
&
DUP
_HANDL
E_MAKE_GLOBAL
)
if
(
req
->
options
&
DUP
LICAT
E_MAKE_GLOBAL
)
{
reply
->
handle
=
duplicate_handle
(
src
,
req
->
src_handle
,
NULL
,
req
->
access
,
req
->
attributes
,
req
->
options
);
...
...
@@ -677,7 +677,7 @@ DECL_HANDLER(dup_handle)
release_object
(
dst
);
}
/* close the handle no matter what happened */
if
((
req
->
options
&
DUP
_HANDL
E_CLOSE_SOURCE
)
&&
(
src
!=
dst
||
req
->
src_handle
!=
reply
->
handle
))
if
((
req
->
options
&
DUP
LICAT
E_CLOSE_SOURCE
)
&&
(
src
!=
dst
||
req
->
src_handle
!=
reply
->
handle
))
reply
->
closed
=
!
close_handle
(
src
,
req
->
src_handle
);
reply
->
self
=
(
src
==
current
->
process
);
release_object
(
src
);
...
...
server/protocol.def
View file @
584427fc
...
...
@@ -1122,9 +1122,6 @@ typedef struct
int self; /* is the source the current process? */
int closed; /* whether the source handle has been closed */
@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 */
/* Make an object temporary */
...
...
server/thread.c
View file @
584427fc
...
...
@@ -1644,7 +1644,7 @@ DECL_HANDLER(select)
if
(
apc
->
result
.
type
==
APC_CREATE_THREAD
)
/* transfer the handle to the caller process */
{
obj_handle_t
handle
=
duplicate_handle
(
current
->
process
,
apc
->
result
.
create_thread
.
handle
,
apc
->
caller
->
process
,
0
,
0
,
DUP
_HANDL
E_SAME_ACCESS
);
apc
->
caller
->
process
,
0
,
0
,
DUP
LICAT
E_SAME_ACCESS
);
close_handle
(
current
->
process
,
apc
->
result
.
create_thread
.
handle
);
apc
->
result
.
create_thread
.
handle
=
handle
;
clear_error
();
/* ignore errors from the above calls */
...
...
@@ -1740,7 +1740,7 @@ DECL_HANDLER(queue_apc)
{
/* duplicate the handle into the target process */
obj_handle_t
handle
=
duplicate_handle
(
current
->
process
,
apc
->
call
.
map_view
.
handle
,
process
,
0
,
0
,
DUP
_HANDL
E_SAME_ACCESS
);
process
,
0
,
0
,
DUP
LICAT
E_SAME_ACCESS
);
if
(
handle
)
apc
->
call
.
map_view
.
handle
=
handle
;
else
{
...
...
server/winstation.c
View file @
584427fc
...
...
@@ -376,7 +376,7 @@ void connect_process_winstation( struct process *process, struct thread *parent_
else
if
(
parent_process
->
winstation
)
{
handle
=
duplicate_handle
(
parent_process
,
parent_process
->
winstation
,
process
,
0
,
0
,
DUP
_HANDL
E_SAME_ACCESS
);
process
,
0
,
0
,
DUP
LICAT
E_SAME_ACCESS
);
winstation
=
(
struct
winstation
*
)
get_handle_obj
(
process
,
handle
,
0
,
&
winstation_ops
);
}
if
(
!
winstation
)
goto
done
;
...
...
@@ -400,7 +400,7 @@ void connect_process_winstation( struct process *process, struct thread *parent_
if
(
!
desktop
||
desktop
->
winstation
!=
winstation
)
goto
done
;
handle
=
duplicate_handle
(
parent_process
,
handle
,
process
,
0
,
0
,
DUP
_HANDL
E_SAME_ACCESS
);
handle
=
duplicate_handle
(
parent_process
,
handle
,
process
,
0
,
0
,
DUP
LICAT
E_SAME_ACCESS
);
}
if
(
handle
)
set_process_default_desktop
(
process
,
desktop
,
handle
);
...
...
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