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
763e96ab
Commit
763e96ab
authored
Jul 19, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Simplify set_process_name now that it doesn't have to handle winevdm.
parent
2cb0f432
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
33 deletions
+8
-33
process.c
dlls/kernel/process.c
+8
-33
No files found.
dlls/kernel/process.c
View file @
763e96ab
...
@@ -463,6 +463,7 @@ static void set_library_wargv( char **argv )
...
@@ -463,6 +463,7 @@ static void set_library_wargv( char **argv )
}
}
argv
[
argc
]
=
NULL
;
argv
[
argc
]
=
NULL
;
__wine_main_argc
=
argc
;
__wine_main_argv
=
argv
;
__wine_main_argv
=
argv
;
__wine_main_wargv
=
wargv
;
__wine_main_wargv
=
wargv
;
}
}
...
@@ -816,59 +817,33 @@ static void start_process( void *arg )
...
@@ -816,59 +817,33 @@ static void start_process( void *arg )
*
*
* Change the process name in the ps output.
* Change the process name in the ps output.
*/
*/
static
void
set_process_name
(
int
*
argc
,
char
*
argv
[],
char
*
name
)
static
void
set_process_name
(
int
argc
,
char
*
argv
[]
)
{
{
#ifdef HAVE_PRCTL
#ifdef HAVE_PRCTL
int
i
,
offset
;
int
i
,
offset
;
char
*
p
rctl_name
=
NULL
;
char
*
p
,
*
prctl_name
=
argv
[
1
]
;
char
*
end
=
argv
[
*
argc
-
1
]
+
strlen
(
argv
[
*
argc
-
1
])
+
1
;
char
*
end
=
argv
[
argc
-
1
]
+
strlen
(
argv
[
argc
-
1
])
+
1
;
#ifndef PR_SET_NAME
#ifndef PR_SET_NAME
# define PR_SET_NAME 15
# define PR_SET_NAME 15
#endif
#endif
if
(
!
name
)
{
char
*
p
;
prctl_name
=
argv
[
1
];
if
((
p
=
strrchr
(
prctl_name
,
'\\'
)))
prctl_name
=
p
+
1
;
if
((
p
=
strrchr
(
prctl_name
,
'\\'
)))
prctl_name
=
p
+
1
;
if
((
p
=
strrchr
(
prctl_name
,
'/'
)))
prctl_name
=
p
+
1
;
if
((
p
=
strrchr
(
prctl_name
,
'/'
)))
prctl_name
=
p
+
1
;
}
else
{
if
(
strlen
(
name
)
<=
strlen
(
argv
[
0
]))
prctl_name
=
name
;
}
if
(
prctl_name
&&
prctl
(
PR_SET_NAME
,
prctl_name
)
!=
-
1
)
if
(
prctl
(
PR_SET_NAME
,
prctl_name
)
!=
-
1
)
{
if
(
name
)
{
strcpy
(
argv
[
0
],
name
);
offset
=
argv
[
1
]
-
(
argv
[
0
]
+
strlen
(
name
)
+
1
);
memmove
(
argv
[
1
]
-
offset
,
argv
[
1
],
end
-
argv
[
1
]
);
memset
(
end
-
offset
,
0
,
offset
);
for
(
i
=
1
;
i
<
*
argc
;
i
++
)
argv
[
i
]
-=
offset
;
}
else
{
{
offset
=
argv
[
1
]
-
argv
[
0
];
offset
=
argv
[
1
]
-
argv
[
0
];
memmove
(
argv
[
1
]
-
offset
,
argv
[
1
],
end
-
argv
[
1
]
);
memmove
(
argv
[
1
]
-
offset
,
argv
[
1
],
end
-
argv
[
1
]
);
memset
(
end
-
offset
,
0
,
offset
);
memset
(
end
-
offset
,
0
,
offset
);
for
(
i
=
1
;
i
<
*
argc
;
i
++
)
argv
[
i
-
1
]
=
argv
[
i
]
-
offset
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
argv
[
i
-
1
]
=
argv
[
i
]
-
offset
;
argv
[
i
-
1
]
=
NULL
;
argv
[
i
-
1
]
=
NULL
;
(
*
argc
)
--
;
}
}
}
else
else
#endif
/* HAVE_PRCTL */
#endif
/* HAVE_PRCTL */
{
{
if
(
name
)
argv
[
0
]
=
name
;
else
{
/* remove argv[0] */
/* remove argv[0] */
memmove
(
argv
,
argv
+
1
,
*
argc
*
sizeof
(
argv
[
0
])
);
memmove
(
argv
,
argv
+
1
,
argc
*
sizeof
(
argv
[
0
])
);
(
*
argc
)
--
;
}
}
}
}
}
...
@@ -888,7 +863,7 @@ void __wine_kernel_init(void)
...
@@ -888,7 +863,7 @@ void __wine_kernel_init(void)
/* Initialize everything */
/* Initialize everything */
if
(
!
process_init
())
exit
(
1
);
if
(
!
process_init
())
exit
(
1
);
set_process_name
(
&
__wine_main_argc
,
__wine_main_argv
,
NULL
);
set_process_name
(
__wine_main_argc
,
__wine_main_argv
);
set_library_wargv
(
__wine_main_argv
);
set_library_wargv
(
__wine_main_argv
);
if
(
peb
->
ProcessParameters
->
ImagePathName
.
Buffer
)
if
(
peb
->
ProcessParameters
->
ImagePathName
.
Buffer
)
...
...
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