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
0d3d456b
Commit
0d3d456b
authored
Dec 08, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Make object handles ints instead of pointers.
parent
fea2aa55
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
12 deletions
+12
-12
server_protocol.h
include/wine/server_protocol.h
+1
-1
handle.c
server/handle.c
+7
-7
process.c
server/process.c
+1
-1
protocol.def
server/protocol.def
+1
-1
request.c
server/request.c
+1
-1
trace.c
server/trace.c
+0
-0
make_requests
tools/make_requests
+1
-1
No files found.
include/wine/server_protocol.h
View file @
0d3d456b
...
...
@@ -15,7 +15,7 @@
#include <windef.h>
#include <winbase.h>
typedef
void
*
obj_handle_t
;
typedef
unsigned
int
obj_handle_t
;
typedef
void
*
user_handle_t
;
typedef
unsigned
short
atom_t
;
typedef
unsigned
int
process_id_t
;
...
...
server/handle.c
View file @
0d3d456b
...
...
@@ -72,11 +72,11 @@ static struct handle_table *global_table;
/* handles are a multiple of 4 under NT; handle 0 is not used */
static
inline
obj_handle_t
index_to_handle
(
int
index
)
{
return
(
obj_handle_t
)((
unsigned
long
)(
index
+
1
)
<<
2
);
return
(
obj_handle_t
)((
index
+
1
)
<<
2
);
}
static
inline
int
handle_to_index
(
obj_handle_t
handle
)
{
return
(
(
unsigned
long
)
handle
>>
2
)
-
1
;
return
(
handle
>>
2
)
-
1
;
}
/* global handle conversion */
...
...
@@ -85,16 +85,16 @@ static inline int handle_to_index( obj_handle_t handle )
static
inline
int
handle_is_global
(
obj_handle_t
handle
)
{
return
(
(
unsigned
long
)
handle
^
HANDLE_OBFUSCATOR
)
<
0x10000
;
return
(
handle
^
HANDLE_OBFUSCATOR
)
<=
(
MAX_HANDLE_ENTRIES
<<
2
)
;
}
static
inline
obj_handle_t
handle_local_to_global
(
obj_handle_t
handle
)
{
if
(
!
handle
)
return
0
;
return
(
obj_handle_t
)((
unsigned
long
)
handle
^
HANDLE_OBFUSCATOR
)
;
return
handle
^
HANDLE_OBFUSCATOR
;
}
static
inline
obj_handle_t
handle_global_to_local
(
obj_handle_t
handle
)
{
return
(
obj_handle_t
)((
unsigned
long
)
handle
^
HANDLE_OBFUSCATOR
)
;
return
handle
^
HANDLE_OBFUSCATOR
;
}
...
...
@@ -137,7 +137,7 @@ static void handle_table_dump( struct object *obj, int verbose )
for
(
i
=
0
;
i
<=
table
->
last
;
i
++
,
entry
++
)
{
if
(
!
entry
->
ptr
)
continue
;
fprintf
(
stderr
,
" %
p
: %p %08x "
,
fprintf
(
stderr
,
" %
04x
: %p %08x "
,
index_to_handle
(
i
),
entry
->
ptr
,
entry
->
access
);
entry
->
ptr
->
ops
->
dump
(
entry
->
ptr
,
0
);
}
...
...
@@ -381,7 +381,7 @@ int close_handle( struct process *process, obj_handle_t handle )
/* retrieve the object corresponding to one of the magic pseudo-handles */
static
inline
struct
object
*
get_magic_handle
(
obj_handle_t
handle
)
{
switch
(
(
unsigned
long
)
handle
)
switch
(
handle
)
{
case
0xfffffffe
:
/* current thread pseudo-handle */
return
&
current
->
obj
;
...
...
server/process.c
View file @
0d3d456b
...
...
@@ -477,7 +477,7 @@ static void startup_info_dump( struct object *obj, int verbose )
struct
startup_info
*
info
=
(
struct
startup_info
*
)
obj
;
assert
(
obj
->
ops
==
&
startup_info_ops
);
fprintf
(
stderr
,
"Startup info in=%
p out=%p err=%p
\n
"
,
fprintf
(
stderr
,
"Startup info in=%
04x out=%04x err=%04x
\n
"
,
info
->
hstdin
,
info
->
hstdout
,
info
->
hstderr
);
}
...
...
server/protocol.def
View file @
0d3d456b
...
...
@@ -31,7 +31,7 @@
#include <windef.h>
#include <winbase.h>
typedef
void *
obj_handle_t;
typedef
unsigned int
obj_handle_t;
typedef void *user_handle_t;
typedef unsigned short atom_t;
typedef unsigned int process_id_t;
...
...
server/request.c
View file @
0d3d456b
...
...
@@ -432,7 +432,7 @@ int send_client_fd( struct process *process, int fd, obj_handle_t handle )
int
ret
;
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *fd* %
p
-> %d
\n
"
,
fprintf
(
stderr
,
"%04x: *fd* %
04x
-> %d
\n
"
,
current
?
current
->
id
:
process
->
id
,
handle
,
fd
);
#ifdef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
...
...
server/trace.c
View file @
0d3d456b
This diff is collapsed.
Click to expand it.
tools/make_requests
View file @
0d3d456b
...
...
@@ -33,7 +33,7 @@ my %formats =
"void*"
=>
"%p"
,
"size_t"
=>
"%lu (unsigned long)"
,
"data_size_t"
=>
"%u"
,
"obj_handle_t"
=>
"%
p
"
,
"obj_handle_t"
=>
"%
04x
"
,
"atom_t"
=>
"%04x"
,
"user_handle_t"
=>
"%p"
,
"process_id_t"
=>
"%04x"
,
...
...
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