summaryrefslogtreecommitdiffstats
path: root/osdep/win32-console-wrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* win32-console-wrapper: fix printf specifiersKacper Michajłow2024-03-191-1/+1
| | | | | | | | | | | %s is evaluated as wchar_t only in "Windows classic" semantic. It is not C standard compliant. %ls is compatible with both and means the same wchar_t format. This commit fixes error output from mpv.com. See: https://devblogs.microsoft.com/oldnewthing/?p=102823
* win32: don't pass std handles if they are attached to consoleKacper Michajłow2024-03-191-15/+20
| | | | | | | | | | | This is default behavior to attach to existing console, passing custom handles is useful if we want to replace them, but in case they are already attached to console we want to attach to console directly. In theory, it should work out of the box because "console-like" handles should be managed by Windows internally, which works for INPUT and OUTPUT, but in certain cases, not for ERROR. This allows using VT features in those cases for stderr too.
* various: use correct PATH_MAX for win32sfan52023-12-271-2/+6
| | | | | | | | In commit c09245cdf2491211f3e0bfe47f28cc0e0a2e05c8 long-path support was enabled for mpv without actually making sure that there was no code left that used the old limit (260 Unicode chars) for buffer sizes. This commit fixes all but one case.
* win32-console-wrapper: silence missing prototype warningsJames Ross-Gowan2019-05-101-2/+4
|
* win32: fix some Clang warningsJames Ross-Gowan2016-11-171-3/+3
| | | | | | | | - win32-console-wrapper.c was inconsistently using the explicit Unicode versions of some Windows API functions and structures. - vo.c should use llabs for int64_t, since long is 32-bit on Windows. - vo_direct3d.c had a potential use of an uninitialized variable if it took the first goto error_exit.
* win32: fix fd://James Ross-Gowan2016-01-071-0/+7
| | | | | | | | Windows definitely supports Unix-style fd inheritance. This mostly worked when launched from mpv.exe, though mpv should change the file mode to O_BINARY. When launched from mpv.com, the wrapper must pass the list of handles (stored in the undocumented lpReserved2 and cbReserved2 fields) to the mpv process.
* win32: only attach to the console from mpv.comJames Ross-Gowan2015-04-111-0/+4
| | | | | | | | | | | | | | | | | | | Previously, mpv.exe used the --terminal option to decide whether to attach to the parent process's console, which made it impossible to tell whether mpv would attach to the console before the config files were parsed. Instead, make mpv always attach to the console when launched from the console wrapper (mpv.com) and never attach otherwise. This will be useful for the next commit, which will use the presence of the console to decide whether to use the pseudo-gui profile. This change should also be an improvement in behavior. The old code would attach to the parent process's console, regardless of whether it was mpv.com or some other program like cmd.exe. This could be confusing, since mpv.exe is marked as a Windows GUI program and shouldn't write text to its parent process's console when launched directly. (See #768.) Visual Studio does something similar with its devenv.com wrapper. devenv.exe only attaches to the console when launched from devenv.com.
* win32-console-wrapper: use child process exit codeMartin Herkt2014-01-061-4/+6
|
* win32-console-wrapper: remove command line manglingMartin Herkt2014-01-061-11/+2
| | | | This wasn't really necessary and caused a lot of problems.
* win32-console-wrapper: Fix heap corruptionMartin Herkt2014-01-061-1/+1
| | | | FUCK the Windows API.
* Add Windows console wrapper program (mpv.com)Martin Herkt2014-01-021-0/+83