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
d27624be
Commit
d27624be
authored
May 03, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store process file name in startup info.
Fixed exe_file handling.
parent
3633d1e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
16 deletions
+43
-16
process.h
include/process.h
+0
-1
server.h
include/server.h
+3
-1
process.c
scheduler/process.c
+6
-5
process.c
server/process.c
+28
-7
trace.c
server/trace.c
+6
-2
No files found.
include/process.h
View file @
d27624be
...
...
@@ -95,7 +95,6 @@ typedef struct _PDB
struct
_SERVICETABLE
*
service_table
;
/* Service table for service thread */
HANDLE
idle_event
;
/* event to signal, when the process is idle */
HANDLE16
main_queue
;
/* main message queue of the process */
HFILE
exe_file
;
/* handle to main exe file */
}
PDB
;
/* Process flags */
...
...
include/server.h
View file @
d27624be
...
...
@@ -113,6 +113,7 @@ struct new_process_request
IN
int
hstderr
;
/* handle for stderr */
IN
int
cmd_show
;
/* main window show mode */
IN
int
alloc_fd
;
/* create the fd pair right now? */
IN
char
filename
[
1
];
/* file name of main exe */
};
...
...
@@ -160,6 +161,7 @@ struct init_process_request
OUT
int
hstdout
;
/* handle for stdout */
OUT
int
hstderr
;
/* handle for stderr */
OUT
int
cmd_show
;
/* main window show mode */
OUT
char
filename
[
1
];
/* file name of main exe */
};
...
...
@@ -1253,7 +1255,7 @@ enum request
REQ_NB_REQUESTS
};
#define SERVER_PROTOCOL_VERSION 1
0
#define SERVER_PROTOCOL_VERSION 1
1
/* ### make_requests end ### */
/* Everything above this line is generated automatically by tools/make_requests */
...
...
scheduler/process.c
View file @
d27624be
...
...
@@ -39,6 +39,7 @@ DECLARE_DEBUG_CHANNEL(win32);
static
ENVDB
initial_envdb
;
static
STARTUPINFOA
initial_startup
;
static
HFILE
main_exe_file
=
-
1
;
static
PDB
*
PROCESS_First
;
...
...
@@ -195,7 +196,6 @@ static BOOL PROCESS_CreateEnvDB(void)
req
->
ldt_flags
=
ldt_flags_copy
;
req
->
ppid
=
getppid
();
if
(
server_call
(
REQ_INIT_PROCESS
))
return
FALSE
;
pdb
->
exe_file
=
req
->
exe_file
;
startup
->
dwFlags
=
req
->
start_flags
;
startup
->
wShowWindow
=
req
->
cmd_show
;
env_db
->
hStdin
=
startup
->
hStdInput
=
req
->
hstdin
;
...
...
@@ -292,7 +292,7 @@ BOOL PROCESS_Init( BOOL win32 )
req
->
ldt_flags
=
ldt_flags_copy
;
req
->
ppid
=
getppid
();
if
(
server_call
(
REQ_INIT_PROCESS
))
return
FALSE
;
pdb
->
exe_file
=
req
->
exe_file
;
main_
exe_file
=
req
->
exe_file
;
initial_startup
.
dwFlags
=
req
->
start_flags
;
initial_startup
.
wShowWindow
=
req
->
cmd_show
;
initial_envdb
.
hStdin
=
initial_startup
.
hStdInput
=
req
->
hstdin
;
...
...
@@ -337,7 +337,7 @@ BOOL PROCESS_Init( BOOL win32 )
*
* Load system DLLs into the initial process (and initialize them)
*/
static
int
load_system_dlls
(
void
)
static
in
line
in
t
load_system_dlls
(
void
)
{
char
driver
[
MAX_PATH
];
...
...
@@ -446,14 +446,13 @@ static void start_process(void)
*/
void
PROCESS_Init32
(
HFILE
hFile
,
LPCSTR
filename
,
LPCSTR
cmd_line
)
{
WORD
version
;
HMODULE
main_module
;
PDB
*
pdb
=
PROCESS_Current
();
pdb
->
env_db
->
cmd_line
=
HEAP_strdupA
(
GetProcessHeap
(),
0
,
cmd_line
);
/* load main module */
if
((
main_module
=
PE_LoadImage
(
hFile
,
filename
,
&
version
))
<
32
)
if
((
main_module
=
PE_LoadImage
(
hFile
,
filename
))
<
32
)
ExitProcess
(
main_module
);
#if 0
if (PE_HEADER(main_module)->FileHeader.Characteristics & IMAGE_FILE_DLL)
...
...
@@ -727,6 +726,7 @@ BOOL PROCESS_CreateUnixProcess( LPCSTR filename, LPCSTR cmd_line, LPCSTR env,
}
req
->
cmd_show
=
startup
->
wShowWindow
;
req
->
alloc_fd
=
0
;
lstrcpynA
(
req
->
filename
,
unixfilename
,
server_remaining
(
req
->
filename
)
);
if
(
server_call
(
REQ_NEW_PROCESS
))
return
FALSE
;
/* fork and execute */
...
...
@@ -948,6 +948,7 @@ PDB *PROCESS_Create( NE_MODULE *pModule, HFILE hFile, LPCSTR cmd_line, LPCSTR en
}
req
->
cmd_show
=
startup
->
wShowWindow
;
req
->
alloc_fd
=
1
;
req
->
filename
[
0
]
=
0
;
if
(
server_call_fd
(
REQ_NEW_PROCESS
,
-
1
,
&
fd
))
goto
error
;
if
(
pModule
->
module32
)
/* Win32 process */
...
...
server/process.c
View file @
d27624be
...
...
@@ -63,11 +63,12 @@ struct startup_info
int
inherit_all
;
/* inherit all handles from parent */
int
create_flags
;
/* creation flags */
int
start_flags
;
/* flags from startup info */
int
exe_file
;
/* file handle for main exe */
int
hstdin
;
/* handle for stdin */
int
hstdout
;
/* handle for stdout */
int
hstderr
;
/* handle for stderr */
int
cmd_show
;
/* main window show mode */
struct
file
*
exe_file
;
/* file handle for main exe */
char
*
filename
;
/* file name for main exe */
struct
process
*
process
;
/* created process */
struct
thread
*
thread
;
/* created thread */
};
...
...
@@ -229,10 +230,9 @@ static void init_process( int ppid, struct init_process_request *req )
/* retrieve the main exe file */
req
->
exe_file
=
-
1
;
if
(
parent
&&
info
->
exe_file
!=
-
1
)
if
(
parent
&&
info
->
exe_file
)
{
if
(
!
(
process
->
exe
.
file
=
get_file_obj
(
parent
,
info
->
exe_file
,
GENERIC_READ
)))
goto
error
;
process
->
exe
.
file
=
(
struct
file
*
)
grab_object
(
info
->
exe_file
);
if
((
req
->
exe_file
=
alloc_handle
(
process
,
process
->
exe
.
file
,
GENERIC_READ
,
0
))
==
-
1
)
goto
error
;
}
...
...
@@ -256,6 +256,7 @@ static void init_process( int ppid, struct init_process_request *req )
{
req
->
start_flags
=
info
->
start_flags
;
req
->
cmd_show
=
info
->
cmd_show
;
strcpy
(
req
->
filename
,
info
->
filename
);
info
->
process
=
(
struct
process
*
)
grab_object
(
process
);
info
->
thread
=
(
struct
thread
*
)
grab_object
(
current
);
wake_up
(
&
info
->
obj
,
0
);
...
...
@@ -264,6 +265,7 @@ static void init_process( int ppid, struct init_process_request *req )
{
req
->
start_flags
=
STARTF_USESTDHANDLES
;
req
->
cmd_show
=
0
;
req
->
filename
[
0
]
=
0
;
}
error:
}
...
...
@@ -305,6 +307,8 @@ static void startup_info_destroy( struct object *obj )
{
struct
startup_info
*
info
=
(
struct
startup_info
*
)
obj
;
assert
(
obj
->
ops
==
&
startup_info_ops
);
if
(
info
->
filename
)
free
(
info
->
filename
);
if
(
info
->
exe_file
)
release_object
(
info
->
exe_file
);
if
(
info
->
process
)
release_object
(
info
->
process
);
if
(
info
->
thread
)
release_object
(
info
->
thread
);
}
...
...
@@ -314,8 +318,8 @@ 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 flags=%x in=%d out=%d err=%d
\n
"
,
info
->
start_flags
,
info
->
hstdin
,
info
->
hstdout
,
info
->
hstderr
);
fprintf
(
stderr
,
"Startup info flags=%x in=%d out=%d err=%d
name='%s'
\n
"
,
info
->
start_flags
,
info
->
hstdin
,
info
->
hstdout
,
info
->
hstderr
,
info
->
filename
);
}
static
int
startup_info_signaled
(
struct
object
*
obj
,
struct
thread
*
thread
)
...
...
@@ -699,6 +703,7 @@ struct module_snapshot *module_snap( struct process *process, int *count )
/* create a new process */
DECL_HANDLER
(
new_process
)
{
size_t
len
=
get_req_strlen
(
req
,
req
->
filename
);
struct
startup_info
*
info
;
int
sock
[
2
];
...
...
@@ -713,14 +718,29 @@ DECL_HANDLER(new_process)
info
->
inherit_all
=
req
->
inherit_all
;
info
->
create_flags
=
req
->
create_flags
;
info
->
start_flags
=
req
->
start_flags
;
info
->
exe_file
=
req
->
exe_file
;
info
->
hstdin
=
req
->
hstdin
;
info
->
hstdout
=
req
->
hstdout
;
info
->
hstderr
=
req
->
hstderr
;
info
->
cmd_show
=
req
->
cmd_show
;
info
->
exe_file
=
NULL
;
info
->
filename
=
NULL
;
info
->
process
=
NULL
;
info
->
thread
=
NULL
;
if
((
req
->
exe_file
!=
-
1
)
&&
!
(
info
->
exe_file
=
get_file_obj
(
current
->
process
,
req
->
exe_file
,
GENERIC_READ
)))
{
release_object
(
info
);
return
;
}
if
(
!
(
info
->
filename
=
memdup
(
req
->
filename
,
len
+
1
)))
{
release_object
(
info
);
return
;
}
info
->
filename
[
len
]
=
0
;
if
(
req
->
alloc_fd
)
{
if
(
socketpair
(
AF_UNIX
,
SOCK_STREAM
,
0
,
sock
)
==
-
1
)
...
...
@@ -753,6 +773,7 @@ DECL_HANDLER(wait_process)
req
->
tid
=
0
;
req
->
phandle
=
-
1
;
req
->
thandle
=
-
1
;
req
->
event
=
-
1
;
if
(
req
->
cancel
)
{
release_object
(
current
->
info
);
...
...
server/trace.c
View file @
d27624be
...
...
@@ -223,7 +223,9 @@ static void dump_new_process_request( const struct new_process_request *req )
fprintf
(
stderr
,
" hstdout=%d,"
,
req
->
hstdout
);
fprintf
(
stderr
,
" hstderr=%d,"
,
req
->
hstderr
);
fprintf
(
stderr
,
" cmd_show=%d,"
,
req
->
cmd_show
);
fprintf
(
stderr
,
" alloc_fd=%d"
,
req
->
alloc_fd
);
fprintf
(
stderr
,
" alloc_fd=%d,"
,
req
->
alloc_fd
);
fprintf
(
stderr
,
" filename="
);
dump_string
(
req
,
req
->
filename
);
}
static
void
dump_wait_process_request
(
const
struct
wait_process_request
*
req
)
...
...
@@ -274,7 +276,9 @@ static void dump_init_process_reply( const struct init_process_request *req )
fprintf
(
stderr
,
" hstdin=%d,"
,
req
->
hstdin
);
fprintf
(
stderr
,
" hstdout=%d,"
,
req
->
hstdout
);
fprintf
(
stderr
,
" hstderr=%d,"
,
req
->
hstderr
);
fprintf
(
stderr
,
" cmd_show=%d"
,
req
->
cmd_show
);
fprintf
(
stderr
,
" cmd_show=%d,"
,
req
->
cmd_show
);
fprintf
(
stderr
,
" filename="
);
dump_string
(
req
,
req
->
filename
);
}
static
void
dump_init_process_done_request
(
const
struct
init_process_done_request
*
req
)
...
...
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