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
ad93413c
Commit
ad93413c
authored
Jul 01, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store session id in the process and return it at process init time.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f5238be3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
13 additions
and
5 deletions
+13
-5
env.c
dlls/ntdll/unix/env.c
+0
-1
server.c
dlls/ntdll/unix/server.c
+1
-0
server_protocol.h
include/wine/server_protocol.h
+2
-2
directory.c
server/directory.c
+1
-1
process.c
server/process.c
+1
-0
process.h
server/process.h
+3
-0
protocol.def
server/protocol.def
+1
-0
request.h
server/request.h
+2
-1
thread.c
server/thread.c
+1
-0
trace.c
server/trace.c
+1
-0
No files found.
dlls/ntdll/unix/env.c
View file @
ad93413c
...
@@ -2006,7 +2006,6 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module )
...
@@ -2006,7 +2006,6 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module )
peb
->
ImageSubSystem
=
main_image_info
.
SubSystemType
;
peb
->
ImageSubSystem
=
main_image_info
.
SubSystemType
;
peb
->
ImageSubSystemMajorVersion
=
main_image_info
.
MajorSubsystemVersion
;
peb
->
ImageSubSystemMajorVersion
=
main_image_info
.
MajorSubsystemVersion
;
peb
->
ImageSubSystemMinorVersion
=
main_image_info
.
MinorSubsystemVersion
;
peb
->
ImageSubSystemMinorVersion
=
main_image_info
.
MinorSubsystemVersion
;
peb
->
SessionId
=
1
;
if
(
NtCurrentTeb
()
->
WowTebOffset
)
if
(
NtCurrentTeb
()
->
WowTebOffset
)
{
{
...
...
dlls/ntdll/unix/server.c
View file @
ad93413c
...
@@ -1513,6 +1513,7 @@ size_t server_init_process(void)
...
@@ -1513,6 +1513,7 @@ size_t server_init_process(void)
ret
=
wine_server_call
(
req
);
ret
=
wine_server_call
(
req
);
pid
=
reply
->
pid
;
pid
=
reply
->
pid
;
tid
=
reply
->
tid
;
tid
=
reply
->
tid
;
peb
->
SessionId
=
reply
->
session_id
;
info_size
=
reply
->
info_size
;
info_size
=
reply
->
info_size
;
server_start_time
=
reply
->
server_start
;
server_start_time
=
reply
->
server_start
;
supported_machines_count
=
wine_server_reply_size
(
reply
)
/
sizeof
(
*
supported_machines
);
supported_machines_count
=
wine_server_reply_size
(
reply
)
/
sizeof
(
*
supported_machines
);
...
...
include/wine/server_protocol.h
View file @
ad93413c
...
@@ -933,9 +933,9 @@ struct init_first_thread_reply
...
@@ -933,9 +933,9 @@ struct init_first_thread_reply
process_id_t
pid
;
process_id_t
pid
;
thread_id_t
tid
;
thread_id_t
tid
;
timeout_t
server_start
;
timeout_t
server_start
;
unsigned
int
session_id
;
data_size_t
info_size
;
data_size_t
info_size
;
/* VARARG(machines,ushorts); */
/* VARARG(machines,ushorts); */
char
__pad_28
[
4
];
};
};
...
@@ -6251,7 +6251,7 @@ union generic_reply
...
@@ -6251,7 +6251,7 @@ union generic_reply
/* ### protocol_version begin ### */
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 72
0
#define SERVER_PROTOCOL_VERSION 72
1
/* ### protocol_version end ### */
/* ### protocol_version end ### */
...
...
server/directory.c
View file @
ad93413c
...
@@ -462,7 +462,7 @@ void init_directories( struct fd *intl_fd )
...
@@ -462,7 +462,7 @@ void init_directories( struct fd *intl_fd )
/* sessions */
/* sessions */
create_session
(
0
);
create_session
(
0
);
create_session
(
1
);
create_session
(
default_session_id
);
/* object types */
/* object types */
...
...
server/process.c
View file @
ad93413c
...
@@ -686,6 +686,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
...
@@ -686,6 +686,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
process
->
affinity
=
parent
->
affinity
;
process
->
affinity
=
parent
->
affinity
;
}
}
if
(
!
process
->
handles
||
!
process
->
token
)
goto
error
;
if
(
!
process
->
handles
||
!
process
->
token
)
goto
error
;
process
->
session_id
=
default_session_id
;
/* Assign a high security label to the token. The default would be medium
/* Assign a high security label to the token. The default would be medium
* but Wine provides admin access to all applications right now so high
* but Wine provides admin access to all applications right now so high
...
...
server/process.h
View file @
ad93413c
...
@@ -51,6 +51,7 @@ struct process
...
@@ -51,6 +51,7 @@ struct process
struct
fd
*
msg_fd
;
/* fd for sendmsg/recvmsg */
struct
fd
*
msg_fd
;
/* fd for sendmsg/recvmsg */
process_id_t
id
;
/* id of the process */
process_id_t
id
;
/* id of the process */
process_id_t
group_id
;
/* group id of the process */
process_id_t
group_id
;
/* group id of the process */
unsigned
int
session_id
;
/* session id */
struct
timeout_user
*
sigkill_timeout
;
/* timeout for final SIGKILL */
struct
timeout_user
*
sigkill_timeout
;
/* timeout for final SIGKILL */
unsigned
short
machine
;
/* client machine type */
unsigned
short
machine
;
/* client machine type */
int
unix_pid
;
/* Unix pid for final SIGKILL */
int
unix_pid
;
/* Unix pid for final SIGKILL */
...
@@ -142,4 +143,6 @@ static inline int is_process_init_done( struct process *process )
...
@@ -142,4 +143,6 @@ static inline int is_process_init_done( struct process *process )
return
process
->
startup_state
==
STARTUP_DONE
;
return
process
->
startup_state
==
STARTUP_DONE
;
}
}
static
const
unsigned
int
default_session_id
=
1
;
#endif
/* __WINE_SERVER_PROCESS_H */
#endif
/* __WINE_SERVER_PROCESS_H */
server/protocol.def
View file @
ad93413c
...
@@ -911,6 +911,7 @@ typedef struct
...
@@ -911,6 +911,7 @@ typedef struct
process_id_t pid; /* process id of the new thread's process */
process_id_t pid; /* process id of the new thread's process */
thread_id_t tid; /* thread id of the new thread */
thread_id_t tid; /* thread id of the new thread */
timeout_t server_start; /* server start time */
timeout_t server_start; /* server start time */
unsigned int session_id; /* process session id */
data_size_t info_size; /* total size of startup info */
data_size_t info_size; /* total size of startup info */
VARARG(machines,ushorts); /* array of supported machines */
VARARG(machines,ushorts); /* array of supported machines */
@END
@END
...
...
server/request.h
View file @
ad93413c
...
@@ -752,7 +752,8 @@ C_ASSERT( sizeof(struct init_first_thread_request) == 32 );
...
@@ -752,7 +752,8 @@ C_ASSERT( sizeof(struct init_first_thread_request) == 32 );
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
pid
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
pid
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
tid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
tid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
server_start
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
server_start
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
info_size
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
session_id
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_reply
,
info_size
)
==
28
);
C_ASSERT
(
sizeof
(
struct
init_first_thread_reply
)
==
32
);
C_ASSERT
(
sizeof
(
struct
init_first_thread_reply
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
unix_tid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
unix_tid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
reply_fd
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_thread_request
,
reply_fd
)
==
16
);
...
...
server/thread.c
View file @
ad93413c
...
@@ -1431,6 +1431,7 @@ DECL_HANDLER(init_first_thread)
...
@@ -1431,6 +1431,7 @@ DECL_HANDLER(init_first_thread)
reply
->
pid
=
get_process_id
(
process
);
reply
->
pid
=
get_process_id
(
process
);
reply
->
tid
=
get_thread_id
(
current
);
reply
->
tid
=
get_thread_id
(
current
);
reply
->
session_id
=
process
->
session_id
;
reply
->
info_size
=
get_process_startup_info_size
(
process
);
reply
->
info_size
=
get_process_startup_info_size
(
process
);
reply
->
server_start
=
server_start_time
;
reply
->
server_start
=
server_start_time
;
set_reply_data
(
supported_machines
,
set_reply_data
(
supported_machines
,
...
...
server/trace.c
View file @
ad93413c
...
@@ -1530,6 +1530,7 @@ static void dump_init_first_thread_reply( const struct init_first_thread_reply *
...
@@ -1530,6 +1530,7 @@ static void dump_init_first_thread_reply( const struct init_first_thread_reply *
fprintf
(
stderr
,
" pid=%04x"
,
req
->
pid
);
fprintf
(
stderr
,
" pid=%04x"
,
req
->
pid
);
fprintf
(
stderr
,
", tid=%04x"
,
req
->
tid
);
fprintf
(
stderr
,
", tid=%04x"
,
req
->
tid
);
dump_timeout
(
", server_start="
,
&
req
->
server_start
);
dump_timeout
(
", server_start="
,
&
req
->
server_start
);
fprintf
(
stderr
,
", session_id=%08x"
,
req
->
session_id
);
fprintf
(
stderr
,
", info_size=%u"
,
req
->
info_size
);
fprintf
(
stderr
,
", info_size=%u"
,
req
->
info_size
);
dump_varargs_ushorts
(
", machines="
,
cur_size
);
dump_varargs_ushorts
(
", machines="
,
cur_size
);
}
}
...
...
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