Commit Graph

304 Commits

Author SHA1 Message Date
Alexandre Julliard 0673ddf3a5 msvcrt: Export the onexit functions from the import library.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-26 20:24:01 +01:00
Piotr Caban 462caf8fbd msvcrt: Use _stricmp instead of strcasecmp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-26 13:50:34 +01:00
Gijs Vermeulen 3229074824 msvcr120: Add [to]wctrans.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46848
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-21 22:57:51 +01:00
Piotr Caban b633777ed4 msvcrt: Use correct locale when comparing strings in getenv.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-18 10:12:16 +01:00
Nikolay Sivov 8c8d8e80f5 ucrtbase: Add ilogb* functions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-28 21:37:30 +01:00
Piotr Caban a808235e45 msvcrt: Use mbtowc/wctomb for string conversion in printf.
This changes printf behaviour for C locale.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-15 15:06:28 +01:00
Piotr Caban e867af3bfe msvcrt: Optimize tolower function when locale was never changed.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-23 17:41:52 +01:00
Alexandre Julliard dd016c031a msvcrt: Add some more MSVCRT prefixes to avoid conflicts with recent Mingw.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-14 18:24:46 +01:00
Alexandre Julliard e4d34098a6 msvcrt: Fix __p__fmode() prototype.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-14 18:24:46 +01:00
Piotr Caban 84f5d8a619 msvcr120: Added _Cbuild implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-01 19:12:29 -07:00
Piotr Caban 7122c9d41d msvcr110: Try SNAME when matching locale.
Based on patch by Daniel Lehman.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-09 19:47:28 +02:00
Piotr Caban 9999c59c48 ucrtbase: Add __processing_throw implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-20 23:19:59 +01:00
Piotr Caban f82af4d2bb ucrtbase: Add __current_exception_context() implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-20 23:19:50 +01:00
Michael Stefaniuc caf0d0f5fd msvcrt: Use the global HeapAlloc() wrappers.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-02 14:42:37 +01:00
Piotr Caban 31bf13e92b msvcrt: Fix IO initialization when invalid handles are passed.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-15 10:50:10 +01:00
Alexandre Julliard 7726157e19 msvcrt: Use WINAPIV calling convention for variadic functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-02 10:20:02 +01:00
Gijs Vermeulen 7f9c2dabc3 msvcrt: Add vf[w]printf_p & vf[w]printf_p_l.
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-16 15:26:32 +02:00
Martin Storsjo 3d3d080688 msvcrt: Implement setjmp/longjmp on aarch64.
Also include the rest of except_*.c (based on except_arm.c) as stubs.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-08 16:23:14 +02:00
Józef Kucia 2a2f525eb3 msvcrt: Fix precision handling for string arguments.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-08-31 20:15:32 +02:00
Piotr Caban b2eab1a0e7 msvcrt: Add improper_scheduler_detach class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 08:52:47 +02:00
Piotr Caban 1e58032098 msvcrt: Add improper_scheduler_attach class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-31 08:52:18 +02:00
Piotr Caban e71edd0a1e msvcrt: Add SchedulerPolicy class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-27 16:54:23 +02:00
Piotr Caban 9bb7731e8e msvcrt: Add invalid_scheduler_policy_thread_specification class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-27 16:54:23 +02:00
Piotr Caban 04d8ace09d msvcrt: Add invalid_scheduler_policy_value class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-27 16:54:23 +02:00
Piotr Caban 11fbb1023d msvcrt: Add invalid_scheduler_policy_key class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-27 16:54:23 +02:00
Piotr Caban 90307e067f msvcrt: Add helper for exception throwing.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-27 16:54:23 +02:00
Piotr Caban de600ada77 msvcrt: Add improper_lock class implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-27 16:54:22 +02:00
Piotr Caban 2458f06380 msvcrt: Throw throw_scheduler_resource_allocation_error on Context tls index allocation error.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-23 17:07:58 +01:00
Piotr Caban 3dff8b8213 msvcrt: Add ExternalContextBase class stub.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-23 17:07:55 +01:00
Daniel Lehman dfd28affe3 msvcrt: Implement Concurrency::event.
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-20 13:21:50 +01:00
Daniel Lehman 8ec8aba3ad msvcrt: Add Concurrency::event stubs.
Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-15 17:32:25 +01:00
Jacek Caban 60c98caa94 msvcrt: Added lldiv implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-20 19:29:39 +01:00
Piotr Caban a6ffb1d2cf msvcrt: Support fdiv m64fp in i386 _fpieee_flt.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 01:10:21 +09:00
Piotr Caban dc0e3d0a9c msvcrt: Add _fpieee_flt stub.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-25 01:10:21 +09:00
Piotr Caban e38cbd82bd msvcrt: Add wcsftime_l.
Based on Daniel Lehman's patch.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-08-11 12:07:56 +09:00
Piotr Caban d7dd5d8fe4 msvcr100: Fix compilation on NetBSD (conflicting fenv_t definitions).
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-15 21:35:12 +09:00
Piotr Caban 1150c0454d msvcr120: Add fegetenv implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-05 23:22:04 +09:00
Piotr Caban c35d07fcd1 ucrtbase: Add _set_thread_local_invalid_parameter_handler implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-21 11:23:29 +09:00
Piotr Caban de12cd580a msvcr100: Add missing fields to lconv structure.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-05 01:27:53 +09:00
Piotr Caban ee5e06591f msvcrt: Fix i386 rethrown exceptions handling.
When __CxxRegisterExceptionObject was used and there was no
catch_function_nested_handler frame to rewind
nested_frame.frame_info.rec was incorrectly set to current exception.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-08 00:10:44 +09:00
Piotr Caban 4a397b4009 msvcrt: Destroy thrown c++ object before calling handler in _except_handler4_common.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-18 22:20:03 +09:00
Piotr Caban 2296261600 msvcr80: Use Cxx(Un)RegisterExceptionObject helpers in i386 nested exception handler.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-17 11:32:31 +09:00
Piotr Caban 11ccffea08 msvcrt: Add __CxxRegisterExceptionObject implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-17 11:32:15 +09:00
Piotr Caban 0204517401 msvcr80: Add _CreateFrameInfo implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-17 11:32:04 +09:00
Piotr Caban d4450b9195 msvcr110: Fix __lc_time_data definition.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 21:19:21 +09: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 1fecaae973 ucrtbase: Handle the _s variant of vsscanf.
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:37 +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 b09aadd202 ucrtbase: Handle the swprintf style termination and return values.
When neither the "legacy vsprintf null termination" nor the "standard
snprintf behaviour" flags are specified, the functions return -2 when
the output string didn't fit (similar to old style msvcrt _snprintf that
returned -1), but they are null terminated (similar to the C99 snprintf
style behaviour). This is the same way as the C99 swprintf function
behaves.

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:42 +09:00
Martin Storsjo fcf9ec8080 ucrtbase: Add defines for the printf/scanf options constants.
Avoid using hardcoded magic numbers for these options.

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-02 23:02: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
Piotr Caban cf20731447 msvcrt: Add _mbscat_s_l implementation. 2015-07-07 16:52:20 +09:00
Piotr Caban e9eec98d5c msvcrt: Cache locale string to LCID conversion results. 2015-06-24 22:57:00 +09:00
Piotr Caban f55192aabc msvcr120: Add ___lc_locale_name_func implementation. 2015-06-17 20:01:17 +09:00
Daniel Lehman bc1eaf7a0f msvcrt: Add _W_Getdays. 2015-06-10 15:26:10 +09:00
Orion Poplawski 8bf1732962 msvcrt: Bump MSVCRT_MB_LEN_MAX to 5 and use it in MSVCRT__wctomb_l for default buffer lengthSet MB_LEN_MAX to 5 to match MSVCRT_MB_LEN_MAX. 2015-02-03 14:38:40 +09:00
Martin Storsjo 5f395ee8e6 msvcr120: Implement the _dclass/_fdclass/_ldclass functions. 2014-12-09 18:48:49 +01:00
Yifu Wang 08d0508993 msvcr120: Added wchar_t* fields to struct MSVCRT_lconv. 2014-12-03 21:34:27 +01: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
Iván Matellanes 975a95a25b msvcrt: Added _fputc_nolock implementation. 2014-11-05 13:14:03 +09:00
Iván Matellanes 156684ba91 msvcrt: Added _fgetwc_nolock implementation. 2014-10-31 15:35:36 +09:00
Iván Matellanes 878b4a9280 msvcrt: Added _fgetc_nolock implementation. 2014-10-31 15:35:24 +09:00
Iván Matellanes 4bb80afedc msvcrt: Added _fflush_nolock implementation.
Thanks to Piotr Caban for the test.
2014-10-27 19:03:57 +09:00
Iván Matellanes 5077d8c137 msvcrt: Added _fseeki64_nolock implementation. 2014-10-16 13:02:16 +09:00
Iván Matellanes 7cf0c877b3 msvcrt: Added _ftelli64_nolock implementation. 2014-10-16 13:01:59 +09:00
Iván Matellanes 25d7a1bbbf msvcrt: Added _fwrite_nolock() implementation. 2014-10-13 18:09:06 +09:00
Iván Matellanes 206ea48f20 msvcrt: Added _fread_nolock() implementation. 2014-10-13 18:08:54 +09:00
Iván Matellanes 9fda14a9d6 msvcrt: Added _fclose_nolock() implementation. 2014-10-08 14:47:46 +02:00
Piotr Caban 43be238331 msvcr80: Throw bad_alloc exception when operator new fails. 2014-09-02 20:54:47 +02:00
Nikolay Sivov 60de49770c msvcrt: Implement llabs(). 2014-08-29 20:38:42 +02:00
Piotr Caban 18a416f7d5 msvcrt: Support NULL buffer in setvbuf. 2014-06-26 19:00:41 +02:00
Piotr Caban 7f23c57d09 msvcr100: Add critical_section class implementation. 2014-06-24 13:31:28 +02:00
Piotr Caban cda83f9c33 msvcr100: Add _SpinWait implementation. 2014-06-23 10:07:01 +02:00
Piotr Caban d48314c8a5 msvcrt: Don't use default process heap. 2014-04-22 14:46:43 +02:00
Piotr Caban a6e53eaed2 msvcr90: Share the source code with msvcrt. 2014-04-16 18:05:41 +02:00
Piotr Caban e70bf5f8c6 msvcrt: Fix compilation errors on Mingw. 2014-04-16 18:00:01 +02:00
Piotr Caban b01f888129 msvcrt: Fix internal LONG_MAX and ULONG_MAX definitions. 2013-09-25 19:30:23 +02:00
Piotr Caban 33d697c001 msvcrt: Add _wsetlocale implementation. 2013-08-29 19:56:17 +02:00
Piotr Caban ff7388ca3f msvcrt: Added _mbstok_s_l implementation. 2013-04-30 18:44:46 +02:00
Jactry Zeng 7cd91b6452 msvcrt: Fixed typo of _strncoll and _strncoll_l. 2013-04-29 20:30:55 +02:00
Piotr Caban 280f8237b5 msvcrt: Move fread_s function to msvcrt. 2013-03-28 18:54:42 +01:00
Piotr Caban 06c6773844 msvcrt: Added _wtol_l implementation. 2013-03-27 20:12:29 +01:00
Piotr Caban 9c4be83a78 msvcrt: Added _set_output_format implementation. 2013-03-27 12:13:20 +01:00
Piotr Caban 6eeb000c90 msvcrt: Fixed fgetwc behavior on multibyte characters and Unicode files. 2013-03-25 16:24:13 +01:00
Piotr Caban 14a81773c7 msvcrt: Added __pxcptinfoptrs implementation. 2013-03-05 12:44:30 +01:00
André Hentschel 874d077ca6 msvcrt: Add a new file for the ARM exception handling. 2013-02-27 19:23:45 +01:00
Nikolay Sivov eab914b968 msvcrt: Move demangler flags to a header and use them. 2013-02-25 10:40:36 +01:00
Piotr Caban a968a1ad6d msvcrt: Return child exit code in _pclose function.
Based on a patch by Borut Ražem.
2013-01-18 13:28:59 +01:00
Piotr Caban 7f4e1c65b1 msvcrt: Added support for commit flag in fopen. 2013-01-18 13:28:58 +01:00
Alexandre Julliard afee133b65 msvcrt: Fix incorrect use of the system wctomb function. 2013-01-14 13:47:00 +01:00
Piotr Caban ebfa653618 msvcrt: Make fputwc encoding aware. 2013-01-11 12:04:08 +01:00
Piotr Caban 4ffa9364eb msvcrt: Simplify fseek implementation. 2013-01-10 12:28:39 +01:00
Piotr Caban 96be6eb570 msvcrt: Added support for unicode open mode in msvcrt_get_flags function. 2013-01-10 12:26:53 +01:00
Piotr Caban dbec250635 msvcrt: Added _stricmp_l implementation. 2012-12-24 13:34:04 +01:00
Piotr Caban 7afc98a7f7 msvcrt: Fixed codepage setting code in create_locale. 2012-12-18 12:38:12 +01:00
Piotr Caban 3b5ab1b48f msvcrt: Added _atodbl_l implementation. 2012-12-17 20:31:25 +01:00