Commit Graph

77 Commits

Author SHA1 Message Date
Eric Pouech 9ddcbb5f64 msvcr*: Use correct integral type in Interlocked* calls.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-04 19:42:01 +01:00
Piotr Caban 5e3f959aed msvcrt: Simplify throw_exception helper.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-20 19:03:33 +02:00
Piotr Caban f67f1ce79e msvcrt: Remove non-needed defines from msvcrt.h.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 16:41:16 +01:00
Piotr Caban 6d799bfa06 msvcrt: Use heap structures and definitions from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-02 11:57:40 +01:00
Piotr Caban d784dbb899 msvcrt: Remove MSVCRT_ prefix from heap.c functions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 14:00:31 +01:00
Piotr Caban eeada5682b msvcrt: Remove MSVCRT_ prefix from errno.c functions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 14:00:25 +01:00
Piotr Caban 1317b935ef msvcrt: Use errno values from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 21:36:12 +01:00
Piotr Caban fa272adaeb msvcrt: Use simple type definitions from public header.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-27 21:59:39 +01:00
Piotr Caban c302397c73 msvcrt: Remove MSVCRT_wchar_t type.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-27 21:59:39 +01:00
Alexandre Julliard 0edef50dfa msvcrt: Use the public standard type definitions where possible in msvcrt.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-20 19:01:04 +01:00
Alexandre Julliard 191bdeaff3 msvcrt: Build with msvcrt headers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-19 21:23:22 +01:00
Alexandre Julliard 6482ce7666 msvcrt: Enable multi-thread locking by default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-19 21:23:21 +01:00
Piotr Caban 6113a251ef msvcrt: Reimplement _set_new_mode function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 20:40:27 +01:00
Piotr Caban 7e9cba139d msvcrt: Use _callnewh in operator new implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 20:40:21 +01:00
Piotr Caban 70ac780e6e msvcrt: Respect allocation mode in malloc.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 20:40:17 +01:00
Jacek Caban 055ca5e4d9 msvcrt: Use memmove to copy memory in memcpy_s.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-05 10:48:19 -05:00
Jacek Caban be56a83fd0 msvcrt: Use memmove to copy memory in wmemcpy_s.
Fixes memory corruption in Outlook 2016.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-05 10:48:16 -05:00
Alex Henrie b917cc66f4 msvcrt: Add DECLSPEC_HOTPATCH to functions patched by libtcmalloc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45199
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-19 18:20:08 +02:00
Alex Henrie 42ab0af66b msvcrt: Don't include MSVC 8.0+ heap functions in SOs for older DLLs.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-02 15:52:22 +01: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 c5d733e1ac msvcrt: Implement caching in Concurrency::Alloc.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-24 20:51:40 +01:00
Gijs Vermeulen 9b6455359a msvcrt: Add stub for Concurrency::Free.
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-03-20 13:21:17 +01:00
Gijs Vermeulen 32a4bec909 msvcrt: Add stub for Concurrency::Alloc.
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-03-20 13:21:09 +01:00
Alex Henrie 8a69c5d81f ucrtbase: Implement _realloc_base.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 22:27:50 +09:00
Alex Henrie e4b8bc0edc ucrtbase: Implement _free_base.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 22:27:50 +09:00
Alex Henrie 5325b8c951 ucrtbase: Implement _malloc_base.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 22:27:50 +09:00
Alex Henrie fdc57d497b ucrtbase: Implement _calloc_base.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-17 22:27:50 +09:00
Nikolay Sivov 50dd4b8928 msvcrt: Handle overflow in calloc().
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-27 20:49:42 +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
Martin Storsjo 91ed0d7963 msvcrt: Don't lock the heap in operator_new.
The native msvcrt/msvcp allow two threads to be calling
the new handler simultaneously.

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-09 23:10:06 +09:00
Martin Storsjo e66758dd53 msvcrt: Pass on the return value in _callnewh.
Also try to avoid race conditions by storing the new handler in a local
variable before checking whether it's non-null.

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-09 23:10:06 +09:00
Piotr Caban 43be238331 msvcr80: Throw bad_alloc exception when operator new fails. 2014-09-02 20:54:47 +02:00
Piotr Caban 608605c7dc msvcrt: Allocate data with 16-bytes alignement if small blocks heap is used. 2014-06-18 19:54:27 +02:00
Piotr Caban d48314c8a5 msvcrt: Don't use default process heap. 2014-04-22 14:46:43 +02:00
Piotr Caban beeea28a53 msvcr100: Move functions implementation to msvcrt. 2014-04-16 18:00:15 +02:00
Piotr Caban e70bf5f8c6 msvcrt: Fix compilation errors on Mingw. 2014-04-16 18:00:01 +02:00
Piotr Caban 4716cd37ee msvcrt: Fixed debug message in strncpy_s. 2013-04-05 20:39:07 +02:00
Piotr Caban 7771552f24 msvcrt: Don't fail when _aligned_offset_malloc is used with size=0. 2012-12-19 14:38:58 +01:00
Piotr Caban bdf9a9f9bd msvcrt: Fixed strncpy_s behavior when count equals 0. 2012-09-07 19:15:29 +02:00
Dan Kegel 4956045842 msvcrt: memmove_s shouldn't zero its output buffer on error. 2012-08-17 14:03:15 +02:00
Alexandre Julliard 06989a0483 msvcrt: Make sure that errno is always set when calling the invalid parameter handler. 2012-07-26 11:05:32 +02:00
Piotr Caban 45dc6c0e22 msvcrt: Improve operator new implementation. 2011-09-13 11:27:45 +02:00
Eric Pouech c10a6d74d5 msvcrt: Use the parameter checking macros for strncpy_s. 2010-11-01 12:34:46 +01:00
Alexander Scott-Johns 2663079c60 msvcrt: Rename _TRUNCATE to MSVCRT__TRUNCATE. 2010-06-07 13:51:34 +02:00
Marcus Meissner f10af18f28 msvcrt: Add some missing CDECL. 2010-05-13 11:51:00 +02:00
Piotr Caban 776998866a msvcrt: Added _get_heap_handle implementation. 2010-04-21 11:07:46 +02:00
Piotr Caban 23d0369d9d msvcrt: Added strncpy_s implementation. 2010-04-21 11:07:45 +02:00
Alexandre Julliard 300978283a msvcrt: Implement the missing exception constructor functions. 2010-04-13 17:19:27 +02:00
Piotr Caban 8fc18b6b48 msvcrt: Added memmove_s and memcpy_s implementation. 2010-04-12 17:48:21 +02:00
Alexandre Julliard d8ab5a14aa msvcrt: Use intptr_t or size_t instead of long where appropriate. 2008-12-12 10:19:55 +01:00