Sweden-Number/dlls/kernel32
Ken Thomases a73045d6a0 kernel32: Overhaul the handling of argv in set_process_name().
This fixes several problems with the code:

* The code had been assuming that the argument strings pointed to by the argv
  array are contiguous iff certain process-name-setting functions are available.
  This doesn't seem reliable.  Instead, test if it's true and shift the strings
  if so.

  However, setproctitle() is specifically documented as a preferred alternative
  to the technique of overwriting the arg strings, so don't shift the strings
  if that's available.

* Use the last path component, recognizing backslash as a path separator, for
  setprogname() in addition to prctl().  First, setprogname() is documented as
  searching for the last component itself, but it doesn't understand Windows-
  style paths, so we need to help it.  Second, on some platforms (e.g. macOS),
  setprogname(), like prctl(), has a fairly small internal length limit (e.g.
  32 characters).  So, concentrate on the most meaningful part of the path.

* Remove argv[0] from argv whether or not there are any process-name-setting
  functions available.  This is necessary for the proper functioning of Wine,
  so it must be done on all platforms.  This part of the logic was lost with
  commit 5a4576ee0.

* Call all available process-name-setting functions instead of treating them
  as mutually exclusive alternatives.  This is also logic that was lost with
  commit 5a4576ee0.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-15 11:16:11 +09:00
..
nls kernel32/nls: Fix LOCALE_SMONTHNAME5/LOCALE_SABBREVMONTHNAME5 for LANG_PERSIAN. 2016-05-20 12:52:59 +09:00
tests kernel32/tests: Use inline implementation of NtCurrentTeb for debugger tests. 2016-07-15 11:13:15 +09:00
Makefile.in
actctx.c
atom.c
change.c
comm.c
computername.c
console.c
console_private.h
cpu.c kernel32: Fix typo of i386 macro name in GetLargePageMinimum(). 2016-06-20 20:06:38 +09:00
debugger.c
editline.c kernel32: Fix memory leak in WCEL_FindPrevInHist. 2016-07-05 23:22:05 +09:00
environ.c
except.c
fiber.c
file.c kernel32: Don't cache the full directory in FindFirstFileEx. 2016-05-05 01:27:44 +09:00
format_msg.c
heap.c
kernel32.spec ntdll: Add RtlRestoreContext implementation. 2016-07-06 11:49:33 +09:00
kernel_main.c
kernel_private.h
lcformat.c
locale.c kernel32: Fix typos in a couple of comments. 2016-07-04 11:01:42 +09:00
locale_rc.rc
lzexpand.c
module.c
nameprep.c
oldconfig.c
path.c
powermgnt.c
process.c kernel32: Overhaul the handling of argv in set_process_name(). 2016-07-15 11:16:11 +09:00
profile.c
resource.c
string.c
sync.c
tape.c
term.c
thread.c
time.c
toolhelp.c
version.c
version.rc
virtual.c kernel32: Spelling fixes. 2016-05-30 11:57:07 +09:00
volume.c kernel32: Fix typos in a couple of comments. 2016-07-04 11:01:42 +09:00
wer.c
winerror.mc