summaryrefslogtreecommitdiffstats
path: root/osdep/subprocess-win.c
Commit message (Collapse)AuthorAgeFilesLines
* subprocess-win: don't change the mouse cursor in CreateProcesspavelxdd2017-12-141-1/+1
| | | | | | By default the CreateProcess changes the mouse cursor to IDC_APPSTARTING. The new flag added to STARTUPINFOEXW prevents changing the cursor from default arrow on creating a new process.
* subprocess-win: fix swprintf usageJames Ross-Gowan2017-07-291-1/+2
| | | | | | | The count parameter refers to the number of wide-characters to write to the buffer (including the terminating NUL character, which is always added,) not the number of bytes. See C99 7.24.2.3 or https://msdn.microsoft.com/en-us/library/ybk95axf.aspx
* subprocess-win: don't leak pipe handle on errorJames Ross-Gowan2017-07-281-1/+3
|
* subprocess-win: remove VLA usageJames Ross-Gowan2017-07-261-2/+4
| | | | This only ever waits on four handles at most anyway.
* osdep: rename atomics.h to atomic.hwm42016-09-071-1/+1
| | | | | The standard header is stdatomic.h, so the extra "s" freaks me out every time I look at it.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-111-1/+1
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* win32: use PIPE_REJECT_REMOTE_CLIENTSJames Ross-Gowan2015-12-201-1/+2
| | | | | This partially reverts c670488. mpv only supports Vista and up, so this flag is fine.
* win32: remove ProcThreadAttributeList dynamic loadingJames Ross-Gowan2015-12-201-36/+6
| | | | | These are always available in supported Windows versions, as is the EXTENDED_STARTUPINFO_PRESENT flag.
* win32: revert wchar_t changeswm42015-08-011-1/+1
| | | | | | | | | | | Revert "win32: more wchar_t -> WCHAR replacements" Revert "win32: replace wchar_t with WCHAR" Doing a "partial" port of this makes no sense anymore from my perspective. Revert the changes, as they're confusing without context, maintenance, and progress. These changes were a bit premature anyway, and might actually cause other issues (locale neutrality etc. as it was pointed out).
* win32: more wchar_t -> WCHAR replacementswm42015-07-301-1/+1
| | | | | | | | | | | | | This was essentially missing from commit 0b52ac8a. Since L"..." string literals have the type wchar_t[], we can't use them for UTF-16 strings. Use C11 u"..." string literals instead. These have the type char16_t[], but we simply assume char16_t is the same underlying type as WCHAR. In practice, they're both unsigned short. For this reason use -std=c11 on Windows. Since Windows is a "special" environment (we require either MinGW or Cygwin), we don't need to worry too much about compiler compatibility.
* subprocess, lua: export whether the process was killed by uswm42015-06-271-0/+1
| | | | | | | | We want to distinguish actual errors, and just aborting the program intentionally. Also be a bit more careful with handling the wait() exit status: do not called WEXITSTATUS() without checking WIFEXITED() first.
* subprocess-win: use the correct pipe namespaceJames Ross-Gowan2015-05-041-1/+1
| | | | | | This was a mistake, it should definitely be using the device namespace rather than the file namespace. As it says in the docs, all pipe names must start with \\.\pipe\
* subprocess-win: clarify argument escaping logicJames Ross-Gowan2015-03-241-8/+8
| | | | This bit always seemed confusing to me.
* subprocess-win: handle empty arguments correctlyJames Ross-Gowan2015-03-241-0/+6
|
* subprocess-win: Always quote argv[0]James Ross-Gowan2015-01-161-3/+5
| | | | | | | | | | | | | If the program name isn't quoted and the .exe it refers to isn't found, CreateProcess will add the program arguments to the program name and continue searching, so for "program arg1 arg2", CreateProcess would try "program.exe", "program arg1.exe", then "program arg1 arg2.exe". This behaviour is weird and not really desirable, so prevent it by always quoting the program name. When quoting argv[0], escape sequences shouldn't be used. msvcrt, .NET and CommandLineToArgvW all treat argv[0] literally and end it on the trailing quote, without processing escape sequences.
* win32: request UTF-16 API variants, Vista+ APIs, and COM C macroswm42015-01-071-1/+0
| | | | | Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
* subprocess: allow disabling redirection of stdout/stderrwm42015-01-011-2/+6
| | | | | | | | | If the stdout or stderr write callback is NULL, then don't redirect this stream. Preparation for the next commit. Not sure what to do on Windows; it seems STARTUPINFO doesn't allow redirection only one of them. So just let them write nothing. For our intended use-case (next commit), this is probably sensible.
* subprocess-win: remove a Vista-only flagJames Ross-Gowan2014-11-281-3/+2
| | | | | PIPE_REJECT_REMOTE_CLIENTS isn't supported on XP. It's not really needed, so remove it. Also fix error checking for CreateNamedPipe.
* subprocess: minor cosmetic cleanupwm42014-11-221-2/+3
| | | | | Don't recursively include the whole stream.h header; only include what's minimally needed, and handle the rest with forward declarations.
* lua: subprocess: move to osdep/subprocess-{win,posix}.cJames Ross-Gowan2014-11-221-0/+371
The subprocess code was already split into fairly general functions, separate from the Lua code. It's getting pretty big though, especially the Windows-specific parts, so move it into its own files.