Commit Graph

1963 Commits

Author SHA1 Message Date
Piotr Caban a36b5f0741 msvcrt: Fix mbtowc behavior for buffers containing more than one character.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-14 12:09:22 +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
André Hentschel a313c9b7f9 msvcrt/tests: Don't test function directly when reporting errno.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-05 01:27:52 +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 f3465ecbae ucrtbase: Implement _execute_onexit_table().
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:48:58 +09:00
Piotr Caban 4f8aafbe28 msvcr120: Add __ExceptionPtrToBool implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-27 12:41:19 +09:00
Nikolay Sivov 5f490de459 ucrtbase: Implement _register_onexit_function().
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 21:37:15 +09:00
Nikolay Sivov 4551b72e75 ucrtbase: Implement _initialize_onexit_table().
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 21:37:09 +09:00
Francois Gouget 8e382e97e9 msvcrt: The fpclass() constants are not defines.
Solaris is the only platform that has fpclass() and it defines
the constants in the fpclass_t enum.
So this reverts commit b004771314.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-04-26 14:48:52 +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 4f6f0f09fd ucrtbase: Add __std_exception_destroy/copy.
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:36:01 +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 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
Daniel Lehman d9a0c55e7e msvcr120: Add remainder.
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-07 20:58:11 +09:00
Daniel Lehman 2841a05025 ucrtbase: Return initial env snapshot in _get_initial_narrow_environment.
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-06 20:07:32 +09:00
Daniel Lehman 46000add48 ucrtbase: Add _get_initial_wide_environment.
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-06 20:07:27 +09:00
Daniel Lehman 2ea84373cf ucrtbase: Add some wide functions called on startup.
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-05 12:51:09 +09:00
Daniel Lehman 9acfcb0eba msvcr120: Add scalbn.
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-05 00:06:44 +09:00
Daniel Lehman e084240415 msvcr120: Add asinh.
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-03-31 19:49:41 +09:00
Piotr Caban 953d6c88d1 msvcrt: Handle frames with CXX_FRAME_MAGIC_VC6 and CXX_FRAME_MAGIC_VC7 magic value.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-29 11:11:59 +09:00
Piotr Caban 63aea551ca msvcrt: Add x86_64 __CxxFrameHandler implementation.
Known issues:
  - exceptions are destroyed too late in case of rethrow
  - no longer used cxx_frame_info structures are freed incorrectly

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-29 11:11:52 +09:00
Piotr Caban 776c4a1617 msvcrt: Improve dump_function_descr helper.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-29 11:11:33 +09:00
Piotr Caban bc71c7decb msvcrt: Call C structured exception translator in x86_64 __CxxFrameHandler.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-29 11:11:31 +09:00
Piotr Caban 97567074a5 msvcrt: Update previous exception stored in cxx_frame_info after frames unwinding.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-23 22:58:23 +09:00
Piotr Caban 3a0b3c5bc8 msvcrt: Register exception object before unwinding.
Thrown object was incorrectly freed in following situation:
try {
     try {
         throw obj;
     } catch(...) {
         throw;
     }
} catch(...) {
     //use object here
}

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 12:20:31 +09:00
Piotr Caban fdcdbf306a msvcrt: Restore exception object stored in thread storage after frames unwinding.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 12:20:25 +09:00
Piotr Caban 3350364d8b msvcrt: Dump exception information in x86_64 __CxxFrameHandler.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 12:20:19 +09:00
Piotr Caban 1a8015cb4d msvcrt: Fix exception parameters number validation in x86_64 __CxxDetectRethrow.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-22 12:20:10 +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 856f0f9d13 msvcrt: Handle non c++ exceptions in __DestructExceptionObject.
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 8348d4b40e msvcrt: Add __CxxUnregisterExceptionObject partial implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-17 11:32:25 +09:00
Piotr Caban 76411c8dc5 msvcrt: Add __DestructExceptionObject implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-17 11:32:20 +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 29f547d2ce msvcr80: Add _FindAndUnlinkFrame implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-17 11:32:09 +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 f085be3028 msvcrt: Destroy exception object when frame storing it is unwound.
Thrown object was incorrectly freed in following situation:
try {
     throw obj;
} catch(object &obj) {
     try {
         throw 1;
     } catch(...) {}

     //use object here
}

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-16 21:59:41 +09:00
Piotr Caban 2d4b48a58d msvcrt: Handle try blocks inside current catch block in nested frame handler.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-16 21:59:41 +09:00
Piotr Caban 941e4f7e9d msvcrt: Destroy exception object if it's no longer used when exiting catch.
Thrown object was incorrectly freed in following situation:
try {
     throw obj;
} catch(object &obj) {
     try {
         throw;
     } catch(...) {}

     //use object here
}

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-16 21:59:41 +09:00
Piotr Caban 0ef61844b8 msvcrt: Add i386 _IsExceptionObjectToBeDestroyed implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-16 21:59:41 +09:00
Piotr Caban 97b9ff81b8 msvcrt: Fix 64-bit _CxxThrowException implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-25 22:45:07 +09:00
Frédéric Delanoy 0da6cca13c msvcrt/tests: Use todo_wine_if() in tests.
Signed-off-by: Frédéric Delanoy <frederic.delanoy@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-22 19:54:49 +09:00
Piotr Caban 96d476584e msvcrt/tests: Add close tests on file descriptors that use the same HANDLE.
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:22 +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 4ee316a997 msvcr120: Add wcstof implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-19 15:10:20 +09:00
Bernhard Übelacker 78716aebf8 msvcr120: Implement strtof and _strtof_l.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-19 15:10:20 +09:00
Piotr Caban aff5d2c1f3 msvcrt: Don't use isdigit in places where only 0-9 digits are handled.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-19 15:10:20 +09:00
Francois Gouget 981c16e4e6 msvcrt/tests: Fix the Norwegian locale tests on Windows 10.
Also add comments to indicate which Windows version returns what.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-18 22:58:25 +09:00
Sebastian Lackner 340f1615bd msvcrt/tests: Use brackets to protect arguments in call_func2 macro.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-11 20:26:22 +09:00
Rafał Harabień ad9ab7c40b msvcr120: Implement atoll, _atoll_l, _wtoll, _wtoll_l.
Signed-off-by: Rafał Harabień <rafalh1992@o2.pl>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-09 23:25:57 +09:00
Paul Gofman faf59e5f06 msvcrt: Handle of thread created by _beginthread should not be closed on thread detach.
Handle should be closed if _endthread is called or thread function
exits. If thread is terminated by ExitThread or _endthreadex, thread
handle remains valid.

Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-01 21:41:22 +09:00
Piotr Caban 6ac2acc34f msvcrt: Add support for $$B datatype description format in unDName.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-21 17:01:45 +09:00
Piotr Caban 112ad7fc87 msvcrt: Add support for member function pointers demangling in unDName function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-21 17:01:45 +09:00
Piotr Caban 59ed8c593c msvcr110: Add _W_Gettnames implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 21:19:27 +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 9189eb2208 msvcrt: Fix size test of structure returned by _Gettnames.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 21:19:17 +09:00
Piotr Caban ecfc10bbfb msvcrt: Add _crt_debugger_hook implementation.
Based on a patch by Andrey Zhezherun.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-20 01:48:52 +09:00
Piotr Caban 68fedc1268 msvcr120: Add _set_FMA3_enable stub.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-19 14:31:46 +09:00
Piotr Caban 4083af404b msvcr120: Add _dpcomp implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-19 01:59:58 +09:00
Piotr Caban 0806b06f2b msvcrt: Fix modff signature.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-16 01:06:46 +09:00
Alexandre Julliard 0ea5a01ca2 msvcrt/tests: Don't check array pointer for NULL.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-13 01:56:06 +09:00
Alexandre Julliard e4f92e04a7 msvcrt: Don't import atexit to avoid conflicts with the Mingw runtime.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-01-12 19:10:03 +09:00
YongHao Hu 072f34be73 msvcr120: Enable MSVCRT__nextafterf when _MSVCR_VER>=120.
Signed-off-by: YongHao Hu <christopherwuy@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-29 17:51:59 +01:00
André Hentschel 51098fcd94 msvcrt: Don't continue on demangle failure (Coverity).
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-23 16:32:13 +01:00
Nikolay Sivov 7e86ab3df6 msvcrt: Fix cwscanf* prototypes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-23 16:32:09 +01:00
Nikolay Sivov d99727bcb3 msvcrt: Fix char to int promotion that breaks pattern lookup.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-23 16:31:53 +01: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
Paul Gofman a3c818b33d msvcrt: Rename __libm_sse2_* functions to fix compilation when using Intel compiler.
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-22 13:51:32 +01:00
Piotr Caban 9f532321d0 msvcrt: Return error if last known character is further in the string then current character.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-21 18:20:00 +01:00
Piotr Caban 5e10634a5a msvcrt: Add _strtol_l implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-21 18:19:54 +01:00
Sebastian Lackner e00999ccf4 msvcrt: Fix specfile entry for $I10_OUTPUT and _wcstod_l.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-30 23:16:47 +09:00
Andrey Gusev 8bfc9bd2ee Assorted typos fixes.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-27 15:38:30 +09:00
Hugh McMaster 11669fa5e2 Assorted spelling and grammar fixes.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-17 22:56:40 +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
Martin Storsjo 78ce165f11 ucrtbase: Implement __std_type_info_compare.
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-06 21:59:08 +09: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 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 4a79e54917 ucrtbase: Handle the C99 'z' size_t specifier for integers.
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:32 +09:00
Martin Storsjo 494572ed4d msvcrt: Interpret 'I' as size_t size specifier for integer conversions.
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:27 +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 1d17e85026 msvcrt: Ignore 'N' as format length modifier for pointers, just like 'F'.
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:07 +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
Martin Storsjo 2a74c9a8ed ucrtbase: Fix the function name in a comment.
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:23 +09:00
Martin Storsjo 436eb3639c ucrtbase: Implement 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-10-29 21:20:09 +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
Martin Storsjo bf4493404c msvcrt: Remove a stray semicolon.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-15 23:35:29 +09:00
Nikolay Sivov d8623f8241 msvcrt/tests: Use matching type to get array element count (PVS-Studio).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-13 18:41:17 +09:00
Sebastian Lackner 4e941a9289 msvcrt: Pass cookie reference to msvcrt_local_unwind4 instead of value.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
2015-10-05 22:27:13 +09:00
Martin Storsjo 8578702e06 ucrtbase: Make the strtod implementation C99 compatible.
Add a test for ucrtbase that verifies these aspects of the C99
behaviour of strtod.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-10-02 20:50:10 +09:00
Piotr Caban aa612612b7 msvcr60: Fix _mbscoll implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-10-02 15:38:35 +09:00
Piotr Caban 07762576c4 msvcrt: Add i386 __CxxExceptionFilter implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-10-01 16:32:34 +09:00
Piotr Caban f9bae3e5a2 msvcrt: Only create locale categories that have changed in setlocale function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:13 +02:00
Piotr Caban f075043273 msvcrt: Use create_locinfo helper in setlocale implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:12 +02:00
Piotr Caban ca8ef840ad msvcrt: Add create_locinfo helper function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:10 +02:00
Piotr Caban 905daf251a msvcrt: Pass pthreadlocinfo to set_lc_locale_name function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:04 +02:00
Piotr Caban d04c895b91 msvcrt: Pass pthreadlocinfo to update_threadlocinfo_category helper function.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
2015-09-25 21:04:00 +02:00