371 Commits

Author SHA1 Message Date
Michael Stefaniuc
dbafbcccfc msvcrt: Remove redundant NULL checks before free().
Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-08 20:13:38 +09:00
Erich E. Hoover
6afda19f48 msvcrt: Add support for _fstat32i64.
Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-24 18:51:22 +09:00
Nikolay Sivov
21fd1d3729 msvcrt: Fix calloc() prototype.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-26 14:48:47 +09:00
Daniel Lehman
2f783c6828 ucrtbase: Add __stdio_common_vfwprintf.
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-13 23:01:06 +09:00
Piotr Caban
781b069ed8 msvcrt: Don't close HANDLE if stdout or stderr is sharing it.
Based on Qian Hong patch.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-20 12:09:19 +09:00
Piotr Caban
77feb6938d msvcrt: Add _wtmpnam_s implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-22 18:23:43 +01:00
Piotr Caban
9b6c93f6f2 msvcrt: Add tmpnam_s implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-22 18:23:36 +01:00
Martin Storsjo
8cc5b07e9d ucrtbase: Implement _get_stream_buffer_pointers.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-05 21:20:47 +09:00
Martin Storsjo
b9d0f5d562 ucrtbase: Implement the new printf corner case behaviour.
Check the option flags whether the new or old legacy behaviours are
wanted.

For _MSVCR_VER < 140, don't check the option flags but hardcode them to
TRUE. (This avoids having to manually add all three flags into every
caller of pf_printf.) Mask out any other flags, to avoid other
out-of-range flags to be interpreted as the other flags (positional
params, invoke invalid param handler).

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:19:12 +09:00
Martin Storsjo
1c8412d9e5 msvcrt: Refactor pf_printf to take options as flags instead of as BOOL parameter.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-04 19:18:56 +09:00
Martin Storsjo
255a7fe067 ucrtbase: Implement some printf functions.
Not all functions are implemented (yet not all variants are
implemented in the normal msvcrt either).

The new functions are more generalized and are C99 compliant.
They take an options parameter that e.g. for the snprintf
family of functions indicate whether the truncation and return
value should be handled as before or in the standards compliant
way.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-28 22:31:24 +09:00
Carlo Bramini
21a14e9612 msvcrt: SEEK_* macros from GLIBC should be replaced with safer MSVCRT_SEEK_* macros. 2015-08-19 08:39:02 +09:00
Carlo Bramini
13f34481b2 msvcrt: Use MSVCRT_xxx macros instead of the same ones from GLIBC. 2015-08-17 14:51:50 +09:00
Carlo Bramini
9b495caacf msvcrt: Call SetFilePointer() with correct parameters. 2015-08-17 14:51:46 +09:00
Iván Matellanes
ea2798f1ce msvcrt: _setmode should check if file descriptor is valid. 2015-08-05 23:45:50 +09:00
Piotr Caban
2294d3ba45 msvcrt: Don't call DeleteCriticalSection on static critical section. 2015-07-16 21:21:07 +09:00
Piotr Caban
eb9e00857a msvcrt: Write directly to the console in _putwch. 2015-06-15 14:49:04 +09:00
Piotr Caban
725e4733cf msvcrt: Remove no longer needed global lock from functions using fd critical sections. 2015-06-11 14:40:32 +09:00
Piotr Caban
6ed69c107f msvcrt: Avoid using global critical section while allocating new file descriptors. 2015-06-11 14:40:30 +09:00
Piotr Caban
e7fc237088 msvcrt: Don't use MSVCRT_fdend in msvcrt_create_io_inherit_block. 2015-06-11 14:40:14 +09:00
Piotr Caban
417b605687 msvcrt: Fix possible deadlock in dup2 function. 2015-06-11 14:40:01 +09:00
Piotr Caban
ba757eaec7 msvcrt: Use fd critical section in _write. 2015-06-04 19:02:31 +09:00
Piotr Caban
eec7a565be msvcrt: Don't lock __badioinfo. 2015-06-04 19:02:29 +09:00
Piotr Caban
f00b7f4058 msvcrt: Use fd critical section in _setmode. 2015-06-04 19:02:26 +09:00
Piotr Caban
bd6eaf918c msvcrt: Get rid of msvcrt_is_valid_fd helper. 2015-06-03 22:52:04 +09:00
Piotr Caban
9ce2a8a60c msvcrt: Use fd critical section in msvcrt_create_io_inherit_block. 2015-06-03 22:52:02 +09:00
Piotr Caban
86baccc9ae msvcrt: Get rid of msvcrt_fdtoh helper. 2015-06-03 22:52:00 +09:00
Piotr Caban
9278190d46 msvcrt: Use fd critical section in _futime64. 2015-06-03 22:51:57 +09:00
Piotr Caban
16285f5700 msvcrt: Use fd critical section in read. 2015-06-03 22:51:55 +09:00
Piotr Caban
b052afd4af msvcrt: Use fd critical section in msvcrt_free_fd. 2015-06-03 22:51:53 +09:00
Piotr Caban
c7b0fb5154 msvcrt: Use fd critical section in dup2. 2015-06-03 22:51:50 +09:00
Piotr Caban
760b78813d msvcrt: Don't ignore pmode attribute in _wsopen_s. 2015-04-17 14:53:53 +09:00
Michael Stefaniuc
278b70bdd0 msvcrt: Clarify comparison of the diff of two unsigneds with 0 (PVS-Studio). 2015-03-06 20:32:02 +09:00
Piotr Caban
90b68f9964 msvcrt: Reset write direction after flush on read/write stream. 2015-01-26 11:22:58 +01:00
Piotr Caban
7880525f44 msvcrt: Handle read buffer flushing in msvcrt_flush_buffer helper. 2015-01-26 11:22:54 +01:00
Piotr Caban
ba0d1586ff msvcrt: Drop read buffer in _flsbuf. 2015-01-21 18:08:11 +01:00
Piotr Caban
6c2d4f1092 msvcrt: Use fd critical section in _fstat64. 2014-12-05 20:48:02 +01:00
Piotr Caban
f2f45d5fe6 msvcrt: Use fd critical section in _chsize_s. 2014-12-05 20:48:01 +01:00
Piotr Caban
fa6de59770 msvcrt: Use fd critical section in _lseeki64. 2014-12-05 20:47:59 +01:00
Piotr Caban
ffdd16cc0d msvcrt: Use fd critical section in _locking. 2014-12-05 20:47:57 +01:00
Piotr Caban
9a4cfbc3ed msvcrt: Use fd critical section in _eof. 2014-12-05 20:47:55 +01:00
Iván Matellanes
17fcef507f msvcrt: Call the _nolock variant when the file is already locked. 2014-12-01 11:11:16 +01:00
Piotr Caban
afc6962a24 msvcrt: Use fd critical section in _close. 2014-11-11 23:55:52 +09:00
Piotr Caban
4508e665c0 msvcrt: Use fd critical section in _commit. 2014-11-11 23:55:49 +09:00
Piotr Caban
1d791f5db2 msvcrt: Rename msvcrt_get_ioinfo function. 2014-11-11 23:55:43 +09:00
Piotr Caban
0c4cb6ce5d msvcrt: Initialize file descriptor critical section. 2014-11-11 23:55:34 +09:00
Iván Matellanes
bcbd83d154 msvcrt: Added _fread_nolock_s implementation. 2014-11-10 19:25:15 +09:00
Iván Matellanes
4f807d9ae9 msvcrt: Added _ungetwc_nolock implementation. 2014-11-05 13:15:44 +09:00
Iván Matellanes
6f24dd9677 msvcrt: Added _ungetc_nolock implementation. 2014-11-05 13:15:20 +09:00
Iván Matellanes
b536ff62ef msvcrt: Added _fputwc_nolock implementation. 2014-11-05 13:14:35 +09:00