mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
kernel: Fixed set_process_name for the winevdm case.
This commit is contained in:
parent
bbe490abcc
commit
fcb771d9c0
@ -873,26 +873,30 @@ static void set_process_name( int *argc, char *argv[], char *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];
|
||||
memmove( argv[1] - offset, argv[1], end - argv[1] );
|
||||
memset( end - offset, 0, offset );
|
||||
for (i = 1; i < *argc; i++) argv[i-1] = argv[i] - offset;
|
||||
argv[i-1] = NULL;
|
||||
(*argc)--;
|
||||
}
|
||||
memmove( argv[1] - offset, argv[1], end - argv[1] );
|
||||
memset( end - offset, 0, offset );
|
||||
for (i = 1; i < *argc; i++) argv[i-1] = argv[i] - offset;
|
||||
argv[i-1] = NULL;
|
||||
(*argc)--;
|
||||
return;
|
||||
}
|
||||
#endif /* HAVE_PRCTL */
|
||||
|
||||
if (name) argv[0] = name;
|
||||
else
|
||||
#endif /* HAVE_PRCTL */
|
||||
{
|
||||
/* remove argv[0] */
|
||||
memmove( argv, argv + 1, *argc * sizeof(argv[0]) );
|
||||
(*argc)--;
|
||||
if (name) argv[0] = name;
|
||||
else
|
||||
{
|
||||
/* remove argv[0] */
|
||||
memmove( argv, argv + 1, *argc * sizeof(argv[0]) );
|
||||
(*argc)--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user