ReactOS 0.4.17-dev-357-ga8f14ff
corecrt_wstdlib.h File Reference
#include <corecrt.h>
Include dependency graph for corecrt_wstdlib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

_ACRTIMP wchar_t *__cdecl _itow (int, wchar_t *, int)
 
_ACRTIMP errno_t __cdecl _itow_s (int, wchar_t *, size_t, int)
 
_ACRTIMP wchar_t *__cdecl _i64tow (__int64, wchar_t *, int)
 
_ACRTIMP errno_t __cdecl _i64tow_s (__int64, wchar_t *, size_t, int)
 
_ACRTIMP wchar_t *__cdecl _ltow (__msvcrt_long, wchar_t *, int)
 
_ACRTIMP errno_t __cdecl _ltow_s (__msvcrt_long, wchar_t *, size_t, int)
 
_ACRTIMP wchar_t *__cdecl _ui64tow (unsigned __int64, wchar_t *, int)
 
_ACRTIMP errno_t __cdecl _ui64tow_s (unsigned __int64, wchar_t *, size_t, int)
 
_ACRTIMP wchar_t *__cdecl _ultow (__msvcrt_ulong, wchar_t *, int)
 
_ACRTIMP errno_t __cdecl _ultow_s (__msvcrt_ulong, wchar_t *, size_t, int)
 
_ACRTIMP wchar_t *__cdecl _wfullpath (wchar_t *, const wchar_t *, size_t)
 
_ACRTIMP wchar_t *__cdecl _wgetenv (const wchar_t *)
 
_ACRTIMP errno_t __cdecl _wgetenv_s (size_t *, wchar_t *, size_t, const wchar_t *)
 
_ACRTIMP void __cdecl _wmakepath (wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *)
 
_ACRTIMP int __cdecl _wmakepath_s (wchar_t *, size_t, const wchar_t *, const wchar_t *, const wchar_t *, const wchar_t *)
 
_ACRTIMP void __cdecl _wperror (const wchar_t *)
 
_ACRTIMP int __cdecl _wputenv (const wchar_t *)
 
_ACRTIMP void __cdecl _wsearchenv (const wchar_t *, const wchar_t *, wchar_t *)
 
_ACRTIMP void __cdecl _wsplitpath (const wchar_t *, wchar_t *, wchar_t *, wchar_t *, wchar_t *)
 
_ACRTIMP errno_t __cdecl _wsplitpath_s (const wchar_t *, wchar_t *, size_t, wchar_t *, size_t, wchar_t *, size_t, wchar_t *, size_t)
 
_ACRTIMP int __cdecl _wsystem (const wchar_t *)
 
_ACRTIMP double __cdecl _wtof (const wchar_t *)
 
_ACRTIMP int __cdecl _wtoi (const wchar_t *)
 
_ACRTIMP __int64 __cdecl _wtoi64 (const wchar_t *)
 
_ACRTIMP __msvcrt_long __cdecl _wtol (const wchar_t *)
 
_ACRTIMP size_t __cdecl mbstowcs (wchar_t *, const char *, size_t)
 
_ACRTIMP size_t __cdecl _mbstowcs_l (wchar_t *, const char *, size_t, _locale_t)
 
_ACRTIMP errno_t __cdecl mbstowcs_s (size_t *, wchar_t *, size_t, const char *, size_t)
 
_ACRTIMP errno_t __cdecl _mbstowcs_s_l (size_t *, wchar_t *, size_t, const char *, size_t, _locale_t)
 
_ACRTIMP int __cdecl mbtowc (wchar_t *, const char *, size_t)
 
_ACRTIMP int __cdecl _mbtowc_l (wchar_t *, const char *, size_t, _locale_t)
 
_ACRTIMP float __cdecl wcstof (const wchar_t *, wchar_t **)
 
_ACRTIMP float __cdecl _wcstof_l (const wchar_t *, wchar_t **, _locale_t)
 
_ACRTIMP double __cdecl wcstod (const wchar_t *, wchar_t **)
 
_ACRTIMP __msvcrt_long __cdecl wcstol (const wchar_t *, wchar_t **, int)
 
_ACRTIMP size_t __cdecl wcstombs (char *, const wchar_t *, size_t)
 
_ACRTIMP size_t __cdecl _wcstombs_l (char *, const wchar_t *, size_t, _locale_t)
 
_ACRTIMP errno_t __cdecl wcstombs_s (size_t *, char *, size_t, const wchar_t *, size_t)
 
_ACRTIMP __msvcrt_ulong __cdecl wcstoul (const wchar_t *, wchar_t **, int)
 
_ACRTIMP int __cdecl wctomb (char *, wchar_t)
 
_ACRTIMP int __cdecl _wctomb_l (char *, wchar_t, _locale_t)
 
_ACRTIMP __int64 __cdecl _wcstoi64 (const wchar_t *, wchar_t **, int)
 
_ACRTIMP __int64 __cdecl _wcstoi64_l (const wchar_t *, wchar_t **, int, _locale_t)
 
_ACRTIMP unsigned __int64 __cdecl _wcstoui64 (const wchar_t *, wchar_t **, int)
 
_ACRTIMP unsigned __int64 __cdecl _wcstoui64_l (const wchar_t *, wchar_t **, int, _locale_t)
 
_ACRTIMP __int64 __cdecl wcstoll (const wchar_t *, wchar_t **, int)
 
_ACRTIMP __int64 __cdecl _wcstoll_l (const wchar_t *, wchar_t **, int, _locale_t)
 
_ACRTIMP unsigned __int64 __cdecl wcstoull (const wchar_t *, wchar_t **, int)
 
_ACRTIMP unsigned __int64 __cdecl _wcstoull_l (const wchar_t *, wchar_t **, int, _locale_t)
 

Function Documentation

◆ _i64tow()

_ACRTIMP wchar_t *__cdecl _i64tow ( __int64  value,
wchar_t str,
int  radix 
)

Definition at line 2294 of file string.c.

2295{
2296 unsigned __int64 val;
2297 BOOL is_negative;
2298 wchar_t buffer[65], *pos;
2299
2300 if (value < 0 && radix == 10)
2301 {
2302 is_negative = TRUE;
2303 val = -value;
2304 }
2305 else
2306 {
2307 is_negative = FALSE;
2308 val = value;
2309 }
2310
2311 pos = buffer + 64;
2312 *pos = '\0';
2313
2314 do
2315 {
2316 int digit = val % radix;
2317 val /= radix;
2318
2319 if (digit < 10)
2320 *--pos = '0' + digit;
2321 else
2322 *--pos = 'a' + digit - 10;
2323 }
2324 while (val != 0);
2325
2326 if (is_negative)
2327 *--pos = '-';
2328
2329 memcpy(str, pos, (buffer + 65 - pos) * sizeof(wchar_t));
2330 return str;
2331}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define __int64
Definition: corecrt.h:72
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint buffer
Definition: glext.h:5915
GLuint GLfloat * val
Definition: glext.h:7180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const WCHAR * str
Definition: pdh_main.c:96
size_t const unsigned const radix
Definition: xtoa.cpp:37

Referenced by InitFunctionPtrs(), lltow(), and TimeToMsString().

◆ _i64tow_s()

_ACRTIMP errno_t __cdecl _i64tow_s ( __int64  value,
wchar_t str,
size_t  size,
int  radix 
)

Definition at line 2596 of file string.c.

2597{
2598 unsigned __int64 val;
2599 unsigned int digit;
2600 BOOL is_negative;
2601 wchar_t buffer[65], *pos;
2602 size_t len;
2603
2604 if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
2605 if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL;
2606 if (!MSVCRT_CHECK_PMT(radix >= 2 && radix <= 36))
2607 {
2608 str[0] = '\0';
2609 return EINVAL;
2610 }
2611
2612 if (value < 0 && radix == 10)
2613 {
2614 is_negative = TRUE;
2615 val = -value;
2616 }
2617 else
2618 {
2619 is_negative = FALSE;
2620 val = value;
2621 }
2622
2623 pos = buffer + 64;
2624 *pos = '\0';
2625
2626 do
2627 {
2628 digit = val % radix;
2629 val /= radix;
2630
2631 if (digit < 10)
2632 *--pos = '0' + digit;
2633 else
2634 *--pos = 'a' + digit - 10;
2635 }
2636 while (val != 0);
2637
2638 if (is_negative)
2639 *--pos = '-';
2640
2641 len = buffer + 65 - pos;
2642 if (len > size)
2643 {
2644 size_t i;
2645 wchar_t *p = str;
2646
2647 /* Copy the temporary buffer backwards up to the available number of
2648 * characters. Don't copy the negative sign if present. */
2649
2650 if (is_negative)
2651 {
2652 p++;
2653 size--;
2654 }
2655
2656 for (pos = buffer + 63, i = 0; i < size; i++)
2657 *p++ = *pos--;
2658
2659 str[0] = '\0';
2660 MSVCRT_INVALID_PMT("str[size] is too small", ERANGE);
2661 return ERANGE;
2662 }
2663
2664 memcpy(str, pos, len * sizeof(wchar_t));
2665 return 0;
2666}
#define NULL
Definition: types.h:112
#define EINVAL
Definition: errno.h:44
#define ERANGE
Definition: errno.h:55
#define MSVCRT_INVALID_PMT(x, err)
Definition: msvcrt.h:376
#define MSVCRT_CHECK_PMT(x)
Definition: msvcrt.h:378
GLsizeiptr size
Definition: glext.h:5919
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ _itow()

_ACRTIMP wchar_t *__cdecl _itow ( int  value,
wchar_t str,
int  radix 
)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the Wine project.

Definition at line 2140 of file string.c.

2141{
2142 return ltow_helper(value, str, SIZE_MAX, radix) ? NULL : str;
2143}
#define SIZE_MAX
Definition: limits.h:49
static int ltow_helper(__msvcrt_long value, wchar_t *str, size_t size, int radix)
Definition: string.c:2009

Referenced by _CrtDbgReportWindow(), FormatBytes(), InitFunctionPtrs(), InitNumOfFracSymbCB(), SaveUserLocale(), SetMaxDate(), SetNTPServer(), SpiStoreSzInt(), and stringify_array().

◆ _itow_s()

_ACRTIMP errno_t __cdecl _itow_s ( int  value,
wchar_t str,
size_t  size,
int  radix 
)

Definition at line 2132 of file string.c.

2133{
2134 return _ltow_s(value, str, size, radix);
2135}
int CDECL _ltow_s(__msvcrt_long value, wchar_t *str, size_t size, int radix)
Definition: string.c:2092

Referenced by __acrt_get_qualified_locale(), __acrt_get_qualified_locale_downlevel(), and _VCrtDbgReportW().

◆ _ltow()

_ACRTIMP wchar_t *__cdecl _ltow ( __msvcrt_long  value,
wchar_t str,
int  radix 
)

Definition at line 2148 of file string.c.

2149{
2150 return ltow_helper(value, str, SIZE_MAX, radix) ? NULL : str;
2151}

Referenced by _itow(), calc_url_length(), InitFunctionPtrs(), and InternetCreateUrlW().

◆ _ltow_s()

_ACRTIMP errno_t __cdecl _ltow_s ( __msvcrt_long  value,
wchar_t str,
size_t  size,
int  radix 
)

Definition at line 2092 of file string.c.

2093{
2094 if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
2095 if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL;
2096 if (!MSVCRT_CHECK_PMT(radix >= 2 && radix <= 36))
2097 {
2098 str[0] = '\0';
2099 return EINVAL;
2100 }
2101
2102 return ltow_helper(value, str, size, radix);
2103}

Referenced by _itow_s(), and double_to_string().

◆ _mbstowcs_l()

_ACRTIMP size_t __cdecl _mbstowcs_l ( wchar_t wcstr,
const char mbstr,
size_t  count,
_locale_t  locale 
)

Definition at line 3288 of file mbcs.c.

3290{
3292 size_t i, size;
3293
3294 if(!mbstr) {
3295 *_errno() = EINVAL;
3296 return -1;
3297 }
3298
3299 if(!locale)
3300 locinfo = get_locinfo();
3301 else
3302 locinfo = locale->locinfo;
3303
3304 if(!locinfo->lc_codepage) {
3305 if(!wcstr)
3306 return strlen(mbstr);
3307
3308 for(i=0; i<count; i++) {
3309 wcstr[i] = (unsigned char)mbstr[i];
3310 if(!wcstr[i]) break;
3311 }
3312 return i;
3313 }
3314
3315 /* Ignore count parameter */
3316 if(!wcstr) {
3317 size = MultiByteToWideChar(locinfo->lc_codepage,
3318 MB_ERR_INVALID_CHARS, mbstr, -1, NULL, 0);
3319 if(!size) {
3320 *_errno() = EILSEQ;
3321 return -1;
3322 }
3323 return size - 1;
3324 }
3325
3326 for(i=0, size=0; i<count; i++) {
3327 if(mbstr[size] == '\0')
3328 break;
3329
3330 if(locinfo->lc_codepage == CP_UTF8) {
3331 int j, chlen = get_utf8_char_len(mbstr[size]);
3332
3333 for(j = 1; j < chlen; j++)
3334 {
3335 if(!mbstr[size + j])
3336 {
3337 if(count) wcstr[0] = '\0';
3338 *_errno() = EILSEQ;
3339 return -1;
3340 }
3341 }
3342 size += chlen;
3343 }
3344 else
3345 size += (_isleadbyte_l((unsigned char)mbstr[size], locale) ? 2 : 1);
3346 }
3347
3348 if(size) {
3349 size = MultiByteToWideChar(locinfo->lc_codepage,
3350 MB_ERR_INVALID_CHARS, mbstr, size, wcstr, count);
3351 if(!size) {
3352 if(count) wcstr[0] = '\0';
3353 *_errno() = EILSEQ;
3354 return -1;
3355 }
3356 }
3357
3358 if(size<count)
3359 wcstr[size] = '\0';
3360
3361 return size;
3362}
Definition: _locale.h:75
#define _isleadbyte_l(_C, _L)
#define MultiByteToWideChar
Definition: compat.h:110
int *CDECL _errno(void)
Definition: errno.c:215
#define EILSEQ
Definition: errno.h:62
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
else locinfo
Definition: scanf.h:225
unsigned char
Definition: typeof.h:29
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define MB_ERR_INVALID_CHARS
Definition: unicode.h:41
static int get_utf8_char_len(char ch)
Definition: mbcs.c:3274
#define CP_UTF8
Definition: nls.h:20
#define get_locinfo()
Definition: winesup.h:25

◆ _mbstowcs_s_l()

_ACRTIMP errno_t __cdecl _mbstowcs_s_l ( size_t ret,
wchar_t wcstr,
size_t  size,
const char mbstr,
size_t  count,
_locale_t  locale 
)

Definition at line 3376 of file mbcs.c.

3378{
3379 size_t conv;
3380 int err = 0;
3381
3382 if(!wcstr && !size) {
3383 conv = _mbstowcs_l(NULL, mbstr, 0, locale);
3384 if(ret)
3385 *ret = conv+1;
3386 return 0;
3387 }
3388
3389 if (!MSVCRT_CHECK_PMT(wcstr != NULL)) return EINVAL;
3390 if (!MSVCRT_CHECK_PMT(mbstr != NULL)) {
3391 if(size) wcstr[0] = '\0';
3392 return EINVAL;
3393 }
3394
3395 if(count==_TRUNCATE || size<count)
3396 conv = size;
3397 else
3398 conv = count;
3399
3400 conv = _mbstowcs_l(wcstr, mbstr, conv, locale);
3401 if(conv<size)
3402 wcstr[conv++] = '\0';
3403 else if(conv==size && count==_TRUNCATE && wcstr[conv-1]!='\0') {
3404 wcstr[conv-1] = '\0';
3405 err = STRUNCATE;
3406 }else if(conv==size && wcstr[conv-1]!='\0') {
3407 MSVCRT_INVALID_PMT("wcstr[size] is too small", ERANGE);
3408 if(size)
3409 wcstr[0] = '\0';
3410 return ERANGE;
3411 }
3412
3413 if(ret)
3414 *ret = conv;
3415 return err;
3416}
#define STRUNCATE
Definition: errno.h:64
#define _TRUNCATE
Definition: stdlib.h:45
return ret
Definition: mutex.c:146
#define err(...)
_mbstowcs_l
Definition: stdlib.h:951

◆ _mbtowc_l()

_ACRTIMP int __cdecl _mbtowc_l ( wchar_t dst,
const char str,
size_t  n,
_locale_t  locale 
)

Definition at line 3166 of file mbcs.c.

3167{
3169 wchar_t tmpdst;
3170
3171 if(!locale)
3172 locinfo = get_locinfo();
3173 else
3174 locinfo = locale->locinfo;
3175
3176 if(n <= 0 || !str)
3177 return 0;
3178
3179 if(!*str) {
3180 if(dst) *dst = 0;
3181 return 0;
3182 }
3183
3184 if(!locinfo->lc_codepage) {
3185 if(dst) *dst = (unsigned char)*str;
3186 return 1;
3187 }
3188 if(n>=2 && _isleadbyte_l((unsigned char)*str, locale)) {
3189 if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, 2, &tmpdst, 1))
3190 return -1;
3191 if(dst) *dst = tmpdst;
3192 return 2;
3193 }
3194 if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, 1, &tmpdst, 1))
3195 return -1;
3196 if(dst) *dst = tmpdst;
3197 return 1;
3198}
GLdouble n
Definition: glext.h:7729
GLenum GLenum dst
Definition: glext.h:6340

Referenced by mbstowcs_len(), mbtowc(), and __crt_stdio_input::input_processor< Character, InputAdapter >::write_character().

◆ _ui64tow()

_ACRTIMP wchar_t *__cdecl _ui64tow ( unsigned  __int64,
wchar_t str,
int  radix 
)

Definition at line 2228 of file string.c.

2229{
2230 wchar_t buffer[65], *pos;
2231
2232 pos = &buffer[64];
2233 *pos = '\0';
2234
2235 do {
2236 int digit = value % radix;
2237 value /= radix;
2238
2239 if (digit < 10)
2240 *--pos = '0' + digit;
2241 else
2242 *--pos = 'a' + digit - 10;
2243 } while (value != 0);
2244
2245 memcpy(str, pos, (buffer + 65 - pos) * sizeof(wchar_t));
2246 return str;
2247}

Referenced by InitFunctionPtrs(), and ulltow().

◆ _ui64tow_s()

_ACRTIMP errno_t __cdecl _ui64tow_s ( unsigned  __int64,
wchar_t str,
size_t  size,
int  radix 
)

Definition at line 2375 of file string.c.

2377{
2378 wchar_t buffer[65], *pos;
2379 int digit;
2380
2381 if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
2382 if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL;
2383 if (!MSVCRT_CHECK_PMT(radix >= 2 && radix <= 36))
2384 {
2385 str[0] = '\0';
2386 return EINVAL;
2387 }
2388
2389 pos = &buffer[64];
2390 *pos = '\0';
2391
2392 do {
2393 digit = value % radix;
2394 value = value / radix;
2395 if (digit < 10)
2396 *--pos = '0' + digit;
2397 else
2398 *--pos = 'a' + digit - 10;
2399 } while (value != 0);
2400
2401 if(buffer-pos+65 > size) {
2402 MSVCRT_INVALID_PMT("str[size] is too small", EINVAL);
2403 return EINVAL;
2404 }
2405
2406 memcpy(str, pos, (buffer-pos+65)*sizeof(wchar_t));
2407 return 0;
2408}

◆ _ultow()

_ACRTIMP wchar_t *__cdecl _ultow ( __msvcrt_ulong  value,
wchar_t str,
int  radix 
)

Definition at line 2204 of file string.c.

2205{
2206 wchar_t buffer[33], *pos;
2207
2208 pos = &buffer[32];
2209 *pos = '\0';
2210
2211 do {
2212 int digit = value % radix;
2213 value /= radix;
2214
2215 if (digit < 10)
2216 *--pos = '0' + digit;
2217 else
2218 *--pos = 'a' + digit - 10;
2219 } while (value != 0);
2220
2221 memcpy(str, pos, (buffer + 33 - pos) * sizeof(wchar_t));
2222 return str;
2223}

Referenced by AddNewLayout(), CliGetPreloadKeyboardLayouts(), RecycleBin5::DeleteFile(), InitFunctionPtrs(), IntLoadPreloadKeyboardLayouts(), OnInitDialog(), PerformancePageRefreshThread(), PrintingThreadProc(), ScmWaitForServiceConnect(), and ShowItemError().

◆ _ultow_s()

_ACRTIMP errno_t __cdecl _ultow_s ( __msvcrt_ulong  value,
wchar_t str,
size_t  size,
int  radix 
)

Definition at line 2467 of file string.c.

2468{
2470 WCHAR buffer[33], *pos;
2471 size_t len;
2472
2473 if (!str || !size || radix < 2 || radix > 36)
2474 {
2475 if (str && size)
2476 str[0] = '\0';
2477
2478 *_errno() = EINVAL;
2479 return EINVAL;
2480 }
2481
2482 pos = buffer + 32;
2483 *pos = '\0';
2484
2485 do
2486 {
2487 digit = value % radix;
2488 value /= radix;
2489
2490 if (digit < 10)
2491 *--pos = '0' + digit;
2492 else
2493 *--pos = 'a' + digit - 10;
2494 }
2495 while (value != 0);
2496
2497 len = buffer + 33 - pos;
2498 if (len > size)
2499 {
2500 size_t i;
2501 WCHAR *p = str;
2502
2503 /* Copy the temporary buffer backwards up to the available number of
2504 * characters. */
2505
2506 for (pos = buffer + 31, i = 0; i < size; i++)
2507 *p++ = *pos--;
2508
2509 str[0] = '\0';
2510 *_errno() = ERANGE;
2511 return ERANGE;
2512 }
2513
2514 memcpy(str, pos, len * sizeof(wchar_t));
2515 return 0;
2516}
unsigned long __msvcrt_ulong
Definition: corecrt.h:168
short WCHAR
Definition: pedump.c:58

◆ _wcstof_l()

_ACRTIMP float __cdecl _wcstof_l ( const wchar_t string,
wchar_t **  end_ptr,
_locale_t  locale 
)

Definition at line 122 of file strtod.cpp.

127{
128 return common_strtod_l<float>(string, end_ptr, locale);
129}

◆ _wcstoi64()

_ACRTIMP __int64 __cdecl _wcstoi64 ( const wchar_t nptr,
wchar_t **  endptr,
int  base 
)

Definition at line 2725 of file wcs.c.

2727{
2728 return _wcstoi64_l(nptr, endptr, base, NULL);
2729}
__int64 CDECL _wcstoi64_l(const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
Definition: wcs.c:2660

Referenced by DumpDisk(), and DumpPartition().

◆ _wcstoi64_l()

_ACRTIMP __int64 __cdecl _wcstoi64_l ( const wchar_t nptr,
wchar_t **  endptr,
int  base,
_locale_t  locale 
)

Definition at line 2660 of file wcs.c.

2662{
2663 BOOL negative = FALSE, empty = TRUE;
2664 __int64 ret = 0;
2665
2666 TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
2667
2668 if (!MSVCRT_CHECK_PMT(nptr != NULL)) return 0;
2669 if (!MSVCRT_CHECK_PMT(base == 0 || base >= 2)) return 0;
2670 if (!MSVCRT_CHECK_PMT(base <= 36)) return 0;
2671
2672 if(endptr)
2673 *endptr = (wchar_t*)nptr;
2674
2675 while(_iswspace_l(*nptr, locale)) nptr++;
2676
2677 if(*nptr == '-') {
2678 negative = TRUE;
2679 nptr++;
2680 } else if(*nptr == '+')
2681 nptr++;
2682
2683 if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) {
2684 base = 16;
2685 nptr += 2;
2686 }
2687
2688 if(base == 0) {
2689 if(wctoint(*nptr, 1)==0)
2690 base = 8;
2691 else
2692 base = 10;
2693 }
2694
2695 while(*nptr) {
2696 int v = wctoint(*nptr, base);
2697 if(v<0)
2698 break;
2699
2700 if(negative)
2701 v = -v;
2702
2703 nptr++;
2704 empty = FALSE;
2705
2706 if(!negative && (ret>I64_MAX/base || ret*base>I64_MAX-v)) {
2707 ret = I64_MAX;
2708 *_errno() = ERANGE;
2709 } else if(negative && (ret<I64_MIN/base || ret*base<I64_MIN-v)) {
2710 ret = I64_MIN;
2711 *_errno() = ERANGE;
2712 } else
2713 ret = ret*base + v;
2714 }
2715
2716 if(endptr && !empty)
2717 *endptr = (wchar_t*)nptr;
2718
2719 return ret;
2720}
static const WCHAR empty[1]
Definition: string.c:47
#define I64_MIN
Definition: limits.h:41
#define I64_MAX
Definition: limits.h:42
static int wctoint(WCHAR c, int base)
Definition: wcs.c:2630
const GLdouble * v
Definition: gl.h:2040
#define debugstr_w
Definition: kernel32.h:32
#define _iswspace_l(_c, _p)
Definition: ctype.h:681
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by _wcstoi64(), _wcstol_l(), _wcstoul_l(), _wtoi_l(), and _wtol_l().

◆ _wcstoll_l()

_ACRTIMP __int64 __cdecl _wcstoll_l ( const wchar_t string,
wchar_t **  end_ptr,
int  base,
_locale_t  locale 
)

Definition at line 321 of file strtox.cpp.

327{
328 return __crt_strtox::parse_integer_from_string<long long>(string, end_ptr, base, locale);
329}

◆ _wcstombs_l()

_ACRTIMP size_t __cdecl _wcstombs_l ( char mbstr,
const wchar_t wcstr,
size_t  count,
_locale_t  locale 
)

Definition at line 688 of file wcs.c.

690{
691 return wcsrtombs_l(mbstr, &wcstr, count, locale);
692}
static size_t wcsrtombs_l(char *mbstr, const wchar_t **wcstr, size_t count, _locale_t locale)
Definition: wcs.c:614

◆ _wcstoui64()

_ACRTIMP unsigned __int64 __cdecl _wcstoui64 ( const wchar_t nptr,
wchar_t **  endptr,
int  base 
)

Definition at line 2890 of file wcs.c.

2892{
2893 return _wcstoui64_l(nptr, endptr, base, NULL);
2894}
unsigned __int64 CDECL _wcstoui64_l(const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
Definition: wcs.c:2831

Referenced by CreateEfiPartition(), CreateExtendedPartition(), CreateLogicalPartition(), CreateMsrPartition(), CreatePartitionPage(), CreatePrimaryPartition(), gpt_main(), and wWinMain().

◆ _wcstoui64_l()

_ACRTIMP unsigned __int64 __cdecl _wcstoui64_l ( const wchar_t nptr,
wchar_t **  endptr,
int  base,
_locale_t  locale 
)

Definition at line 2831 of file wcs.c.

2833{
2834 BOOL negative = FALSE, empty = TRUE;
2835 unsigned __int64 ret = 0;
2836
2837 TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
2838
2839 if (!MSVCRT_CHECK_PMT(nptr != NULL)) return 0;
2840 if (!MSVCRT_CHECK_PMT(base == 0 || base >= 2)) return 0;
2841 if (!MSVCRT_CHECK_PMT(base <= 36)) return 0;
2842
2843 if(endptr)
2844 *endptr = (wchar_t*)nptr;
2845
2846 while(_iswspace_l(*nptr, locale)) nptr++;
2847
2848 if(*nptr == '-') {
2849 negative = TRUE;
2850 nptr++;
2851 } else if(*nptr == '+')
2852 nptr++;
2853
2854 if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) {
2855 base = 16;
2856 nptr += 2;
2857 }
2858
2859 if(base == 0) {
2860 if(wctoint(*nptr, 1)==0)
2861 base = 8;
2862 else
2863 base = 10;
2864 }
2865
2866 while(*nptr) {
2867 int v = wctoint(*nptr, base);
2868 if(v<0)
2869 break;
2870
2871 nptr++;
2872 empty = FALSE;
2873
2874 if(ret>UI64_MAX/base || ret*base>UI64_MAX-v) {
2875 ret = UI64_MAX;
2876 *_errno() = ERANGE;
2877 } else
2878 ret = ret*base + v;
2879 }
2880
2881 if(endptr && !empty)
2882 *endptr = (wchar_t*)nptr;
2883
2884 return negative ? -ret : ret;
2885}
#define UI64_MAX
Definition: limits.h:43

Referenced by _wcstoui64().

◆ _wcstoull_l()

_ACRTIMP unsigned __int64 __cdecl _wcstoull_l ( const wchar_t string,
wchar_t **  end_ptr,
int  base,
_locale_t  locale 
)

Definition at line 382 of file strtox.cpp.

388{
389 return __crt_strtox::parse_integer_from_string<unsigned long long>(string, end_ptr, base, locale);
390}

◆ _wctomb_l()

_ACRTIMP int __cdecl _wctomb_l ( char dst,
wchar_t  ch,
_locale_t  locale 
)

Definition at line 2152 of file wcs.c.

2153{
2154 int len;
2155#ifdef __REACTOS__
2156 int maxlen;
2157 if (locale)
2158 maxlen = locale->locinfo->mb_cur_max;
2159 else
2160 maxlen = get_locinfo()->mb_cur_max;
2161 if (_wctomb_s_l(&len, dst, maxlen, ch, locale) != 0)
2162 return -1;
2163#else
2165#endif
2166 return len;
2167}
unsigned char ch[4][2]
Definition: console.c:118
#define MB_LEN_MAX
Definition: limits.h:7
int CDECL _wctomb_s_l(int *len, char *mbchar, size_t size, wchar_t wch, _locale_t locale)
Definition: wcs.c:2079

Referenced by wcstombs_len(), and wctomb().

◆ _wfullpath()

_ACRTIMP wchar_t *__cdecl _wfullpath ( wchar_t absPath,
const wchar_t relPath,
size_t  size 
)

Definition at line 1218 of file dir.c.

1219{
1220 DWORD rc;
1221 WCHAR* buffer;
1222 WCHAR* lastpart;
1223 BOOL alloced = FALSE;
1224
1225 if (!relPath || !*relPath)
1226 return _wgetcwd(absPath, size);
1227
1228 if (absPath == NULL)
1229 {
1230 buffer = malloc(MAX_PATH * sizeof(WCHAR));
1231 size = MAX_PATH;
1232 alloced = TRUE;
1233 }
1234 else
1235 buffer = absPath;
1236
1237 if (size < 4)
1238 {
1239 *_errno() = ERANGE;
1240 return NULL;
1241 }
1242
1243 TRACE(":resolving relative path %s\n",debugstr_w(relPath));
1244
1245 rc = GetFullPathNameW(relPath,size,buffer,&lastpart);
1246
1247 if (rc > 0 && rc <= size )
1248 return buffer;
1249 else
1250 {
1251 if (alloced)
1252 free(buffer);
1253 return NULL;
1254 }
1255}
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
wchar_t *CDECL _wgetcwd(wchar_t *buf, int size)
Definition: dir.c:785
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by _fullpath(), _wsearchenv_s(), and throw().

◆ _wgetenv()

_ACRTIMP wchar_t *__cdecl _wgetenv ( const wchar_t name)

Definition at line 254 of file environ.c.

255{
256 wchar_t *ret;
257
258 if (!MSVCRT_CHECK_PMT(name != NULL)) return NULL;
259
263 return ret;
264}
static wchar_t * wgetenv_helper(const wchar_t *name)
Definition: environ.c:239
void CDECL _lock(int locknum)
Definition: lock.c:85
void CDECL _unlock(int locknum)
Definition: lock.c:114
#define _ENV_LOCK
Definition: mtdll.h:36
Definition: name.c:39

Referenced by _tgetenv(), _wsearchenv_s(), _wtempnam(), compat_getenv(), get_mono_path_datadir(), INTERNET_LoadProxySettings(), msvcrt_search_executable(), START_TEST(), test_case_insensitive(), test_environment_manipulation(), test_utf8(), and WinHttpGetDefaultProxyConfiguration().

◆ _wgetenv_s()

_ACRTIMP errno_t __cdecl _wgetenv_s ( size_t ret_len,
wchar_t buffer,
size_t  len,
const wchar_t varname 
)

Definition at line 533 of file environ.c.

535{
536 wchar_t *e;
537
538 if (!MSVCRT_CHECK_PMT(ret_len != NULL)) return EINVAL;
539 *ret_len = 0;
540 if (!MSVCRT_CHECK_PMT((buffer && len > 0) || (!buffer && !len))) return EINVAL;
541 if (buffer) buffer[0] = 0;
542
544 e = wgetenv_helper(varname);
545 if (e)
546 {
547 *ret_len = wcslen(e) + 1;
548 if (len >= *ret_len) wcscpy(buffer, e);
549 }
551
552 if (!e || !len) return 0;
553 if (len < *ret_len) return ERANGE;
554 return 0;
555}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define e
Definition: ke_i.h:82
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:81
wcscpy

Referenced by get_tz_environment_variable().

◆ _wmakepath()

_ACRTIMP void __cdecl _wmakepath ( wchar_t path,
const wchar_t drive,
const wchar_t directory,
const wchar_t filename,
const wchar_t extension 
)

Definition at line 1357 of file dir.c.

1359{
1360 wchar_t *p = path;
1361
1362 TRACE("%s %s %s %s\n", debugstr_w(drive), debugstr_w(directory),
1363 debugstr_w(filename), debugstr_w(extension));
1364
1365 if ( !path )
1366 return;
1367
1368 if (drive && drive[0])
1369 {
1370 *p++ = drive[0];
1371 *p++ = ':';
1372 }
1373 if (directory && directory[0])
1374 {
1375 unsigned int len = wcslen(directory);
1376 memmove(p, directory, len * sizeof(wchar_t));
1377 p += len;
1378 if (p[-1] != '/' && p[-1] != '\\')
1379 *p++ = '\\';
1380 }
1381 if (filename && filename[0])
1382 {
1383 unsigned int len = wcslen(filename);
1384 memmove(p, filename, len * sizeof(wchar_t));
1385 p += len;
1386 }
1387 if (extension && extension[0])
1388 {
1389 if (extension[0] != '.')
1390 *p++ = '.';
1391 wcscpy(p, extension);
1392 }
1393 else
1394 *p = '\0';
1395
1396 TRACE("returning %s\n", debugstr_w(path));
1397}
const char * filename
Definition: ioapi.h:137
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by test_makepath().

◆ _wmakepath_s()

_ACRTIMP int __cdecl _wmakepath_s ( wchar_t path,
size_t  size,
const wchar_t drive,
const wchar_t directory,
const wchar_t filename,
const wchar_t extension 
)

Definition at line 1508 of file dir.c.

1511{
1512 wchar_t *p = path;
1513
1514 if (!path || !size)
1515 {
1516 *_errno() = EINVAL;
1517 return EINVAL;
1518 }
1519
1520 if (drive && drive[0])
1521 {
1522 if (size <= 2)
1523 goto range;
1524
1525 *p++ = drive[0];
1526 *p++ = ':';
1527 size -= 2;
1528 }
1529
1530 if (directory && directory[0])
1531 {
1532 unsigned int len = wcslen(directory);
1533 unsigned int needs_separator = directory[len - 1] != '/' && directory[len - 1] != '\\';
1534 unsigned int copylen = min(size - 1, len);
1535
1536 if (size < 2)
1537 goto range;
1538
1539 memmove(p, directory, copylen * sizeof(wchar_t));
1540
1541 if (size <= len)
1542 goto range;
1543
1544 p += copylen;
1545 size -= copylen;
1546
1547 if (needs_separator)
1548 {
1549 if (size < 2)
1550 goto range;
1551
1552 *p++ = '\\';
1553 size -= 1;
1554 }
1555 }
1556
1557 if (filename && filename[0])
1558 {
1559 unsigned int len = wcslen(filename);
1560 unsigned int copylen = min(size - 1, len);
1561
1562 if (size < 2)
1563 goto range;
1564
1565 memmove(p, filename, copylen * sizeof(wchar_t));
1566
1567 if (size <= len)
1568 goto range;
1569
1570 p += len;
1571 size -= len;
1572 }
1573
1574 if (extension && extension[0])
1575 {
1576 unsigned int len = wcslen(extension);
1577 unsigned int needs_period = extension[0] != '.';
1578 unsigned int copylen;
1579
1580 if (size < 2)
1581 goto range;
1582
1583 if (needs_period)
1584 {
1585 *p++ = '.';
1586 size -= 1;
1587 }
1588
1589 copylen = min(size - 1, len);
1590 memcpy(p, extension, copylen * sizeof(wchar_t));
1591
1592 if (size <= len)
1593 goto range;
1594
1595 p += copylen;
1596 }
1597
1598 *p = '\0';
1599 return 0;
1600
1601range:
1602 path[0] = '\0';
1603 *_errno() = ERANGE;
1604 return ERANGE;
1605}
GLenum GLint * range
Definition: glext.h:7539
#define min(a, b)
Definition: monoChain.cc:55

Referenced by _wmakepath().

◆ _wperror()

_ACRTIMP void __cdecl _wperror ( const wchar_t str)

Definition at line 354 of file errno.c.

355{
356 size_t size;
357 char *buffer = NULL;
358
359 if (str && *str)
360 {
361 size = wcstombs(NULL, str, 0);
362 if (size == -1) return;
363 size++;
364 buffer = malloc(size);
365 if (!buffer) return;
366 if (wcstombs(buffer, str, size) == -1)
367 {
368 free(buffer);
369 return;
370 }
371 }
372 perror(buffer);
373 free(buffer);
374}
void CDECL perror(const char *str)
Definition: errno.c:337
wcstombs
Definition: stdlib.h:1013

Referenced by PerformRegAction(), ReadFromFile(), and REGPROC_open_export_file().

◆ _wputenv()

_ACRTIMP int __cdecl _wputenv ( const wchar_t str)

Definition at line 377 of file environ.c.

378{
379 const wchar_t *eq;
380
381 TRACE("%s\n", debugstr_w(str));
382
383 if (!str || !(eq = wcschr(str, '=')))
384 return -1;
385
386 return wputenv_helper(str, NULL, eq);
387}
#define wcschr
Definition: compat.h:17
static int wputenv_helper(const wchar_t *name, const wchar_t *val, const wchar_t *eq)
Definition: environ.c:316
#define eq(received, expected, label, type)
Definition: locale.c:179

Referenced by test__wenviron(), test_case_insensitive(), test_environment_manipulation(), and test_utf8().

◆ _wsearchenv()

_ACRTIMP void __cdecl _wsearchenv ( const wchar_t file,
const wchar_t env,
wchar_t buf 
)

Definition at line 1796 of file dir.c.

1797{
1799}
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:171
int CDECL _wsearchenv_s(const wchar_t *file, const wchar_t *env, wchar_t *buf, size_t count)
Definition: dir.c:1710
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
Definition: fci.c:127

Referenced by test_searchenv().

◆ _wsplitpath()

_ACRTIMP void __cdecl _wsplitpath ( const wchar_t inpath,
wchar_t drv,
wchar_t dir,
wchar_t fname,
wchar_t ext 
)

Definition at line 1206 of file dir.c.

1208{
1209 _wsplitpath_s(inpath, drv, drv ? _MAX_DRIVE : 0, dir, dir ? _MAX_DIR : 0,
1210 fname, fname ? _MAX_FNAME : 0, ext, ext ? _MAX_EXT : 0);
1211}
unsigned int dir
Definition: maze.c:112
static const WCHAR *const ext[]
Definition: module.c:53
#define _MAX_FNAME
Definition: stdlib.h:38
#define _MAX_DIR
Definition: stdlib.h:39
#define _MAX_DRIVE
Definition: stdlib.h:37
#define _MAX_EXT
Definition: stdlib.h:40
#define _wsplitpath_s(f, d, dl, p, pl, n, nl, e, el)

Referenced by GetSystemDrive(), UXTHEME_FormatParseMessage(), and XCOPY_ProcessDestParm().

◆ _wsplitpath_s()

_ACRTIMP errno_t __cdecl _wsplitpath_s ( const wchar_t inpath,
wchar_t drive,
size_t  sz_drive,
wchar_t dir,
size_t  sz_dir,
wchar_t fname,
size_t  sz_fname,
wchar_t ext,
size_t  sz_ext 
)

Definition at line 1124 of file dir.c.

1129{
1130 const wchar_t *p, *end;
1131
1132 if (!inpath || (!drive && sz_drive) ||
1133 (drive && !sz_drive) ||
1134 (!dir && sz_dir) ||
1135 (dir && !sz_dir) ||
1136 (!fname && sz_fname) ||
1137 (fname && !sz_fname) ||
1138 (!ext && sz_ext) ||
1139 (ext && !sz_ext))
1140 {
1141 *_errno() = EINVAL;
1142 return EINVAL;
1143 }
1144
1145 if (inpath[0] && inpath[1] == ':')
1146 {
1147 if (drive)
1148 {
1149 if (sz_drive <= 2) goto do_error;
1150 drive[0] = inpath[0];
1151 drive[1] = inpath[1];
1152 drive[2] = 0;
1153 }
1154 inpath += 2;
1155 }
1156 else if (drive) drive[0] = '\0';
1157
1158 /* look for end of directory part */
1159 end = NULL;
1160 for (p = inpath; *p; p++) if (*p == '/' || *p == '\\') end = p + 1;
1161
1162 if (end) /* got a directory */
1163 {
1164 if (dir)
1165 {
1166 if (sz_dir <= end - inpath) goto do_error;
1167 memcpy( dir, inpath, (end - inpath) * sizeof(wchar_t) );
1168 dir[end - inpath] = 0;
1169 }
1170 inpath = end;
1171 }
1172 else if (dir) dir[0] = 0;
1173
1174 /* look for extension: what's after the last dot */
1175 end = NULL;
1176 for (p = inpath; *p; p++) if (*p == '.') end = p;
1177
1178 if (!end) end = p; /* there's no extension */
1179
1180 if (fname)
1181 {
1182 if (sz_fname <= end - inpath) goto do_error;
1183 memcpy( fname, inpath, (end - inpath) * sizeof(wchar_t) );
1184 fname[end - inpath] = 0;
1185 }
1186 if (ext)
1187 {
1188 if (sz_ext <= wcslen(end)) goto do_error;
1189 wcscpy( ext, end );
1190 }
1191 return 0;
1192do_error:
1193 if (drive) drive[0] = '\0';
1194 if (dir) dir[0] = '\0';
1195 if (fname) fname[0]= '\0';
1196 if (ext) ext[0]= '\0';
1197 *_errno() = ERANGE;
1198 return ERANGE;
1199}
GLuint GLuint end
Definition: gl.h:1545

◆ _wsystem()

_ACRTIMP int __cdecl _wsystem ( const wchar_t cmd)

Definition at line 1254 of file process.c.

1255{
1256 int res;
1257 wchar_t *comspec, *fullcmd;
1258 unsigned int len;
1259
1260 comspec = msvcrt_get_comspec();
1261
1262 if (cmd == NULL)
1263 {
1264 if (comspec == NULL)
1265 {
1266 *_errno() = ENOENT;
1267 return 0;
1268 }
1269 HeapFree(GetProcessHeap(), 0, comspec);
1270 return 1;
1271 }
1272
1273 if (comspec == NULL)
1274 return -1;
1275
1276 len = wcslen(comspec) + wcslen(cmd) + 5;
1277
1278 if (!(fullcmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(wchar_t))))
1279 {
1280 HeapFree(GetProcessHeap(), 0, comspec);
1281 return -1;
1282 }
1283 wcscpy(fullcmd, comspec);
1284 wcscat(fullcmd, L" /c ");
1285 wcscat(fullcmd, cmd);
1286
1287 res = msvcrt_spawn(_P_WAIT, comspec, fullcmd, NULL, 1);
1288
1289 HeapFree(GetProcessHeap(), 0, comspec);
1290 HeapFree(GetProcessHeap(), 0, fullcmd);
1291 return res;
1292}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ENOENT
Definition: errno.h:25
#define _P_WAIT
Definition: process.h:15
static intptr_t msvcrt_spawn(int flags, const wchar_t *exe, wchar_t *cmdline, wchar_t *env, int use_path)
Definition: process.c:135
static wchar_t * msvcrt_get_comspec(void)
Definition: process.c:346
#define L(x)
Definition: resources.c:13
GLuint res
Definition: glext.h:9613
wcscat
Definition: ftp_var.h:139

Referenced by system().

◆ _wtof()

_ACRTIMP double __cdecl _wtof ( const wchar_t str)

Definition at line 810 of file wcs.c.

811{
812 return _wcstod_l(str, NULL, NULL);
813}
double CDECL _wcstod_l(const wchar_t *str, wchar_t **end, _locale_t locale)
Definition: wcs.c:579

◆ _wtoi()

_ACRTIMP int __cdecl _wtoi ( const wchar_t str)

◆ _wtoi64()

_ACRTIMP __int64 __cdecl _wtoi64 ( const wchar_t str)

Definition at line 3045 of file wcs.c.

3046{
3047 return _wtoi64_l(str, NULL);
3048}
__int64 CDECL _wtoi64_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:3018

Referenced by InitFunctionPtrs(), BtrfsBalance::SaveBalanceOpts(), and wtoll().

◆ _wtol()

Definition at line 2803 of file wcs.c.

2804{
2805 return _wtol_l(str, NULL);
2806}
__msvcrt_long __cdecl _wtol_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:2786

Referenced by ApplyParameterStringsToMessage(), BuildCodePageList(), InitFunctionPtrs(), InstalledCPProc(), LoadRegistrySettings(), ProcessCodePage(), and XCOPY_ParseCommandLine().

◆ mbstowcs()

_ACRTIMP size_t __cdecl mbstowcs ( wchar_t wcstr,
const char mbstr,
size_t  count 
)

Definition at line 3367 of file mbcs.c.

3369{
3370 return _mbstowcs_l(wcstr, mbstr, count, NULL);
3371}

◆ mbstowcs_s()

_ACRTIMP errno_t __cdecl mbstowcs_s ( size_t pConvertedChars,
wchar_t pwcs,
size_t  sizeInWords,
const char s,
size_t  n 
)

Definition at line 316 of file mbstowcs.cpp.

323{
324 __crt_cached_ptd_host ptd;
325 return _mbstowcs_internal(pConvertedChars, pwcs, sizeInWords, s, n, ptd);
326}
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
GLdouble s
Definition: gl.h:2039
static errno_t __cdecl _mbstowcs_internal(size_t *pConvertedChars, wchar_t *pwcs, size_t sizeInWords, const char *s, size_t n, __crt_cached_ptd_host &ptd)
Definition: mbstowcs.cpp:232
_In_z_ const wchar_t * pwcs
Definition: wcstombs.cpp:85

Referenced by __acrt_OutputDebugStringA(), _VCrtDbgReportA(), append_message(), and call_wsetlocale().

◆ mbtowc()

_ACRTIMP int __cdecl mbtowc ( wchar_t wchar,
const char mbchar,
size_t  count 
)

Definition at line 159 of file freeldr.c.

160{
161 *wchar = (wchar_t)*mbchar;
162 return 1;
163}
#define wchar_t
Definition: wchar.h:102
size_t const wchar_t const wchar
Definition: wcrtomb.cpp:53

◆ wcstod()

_ACRTIMP double __cdecl wcstod ( const wchar_t lpszStr,
wchar_t **  end 
)

Definition at line 802 of file wcs.c.

803{
804 return _wcstod_l(lpszStr, end, NULL);
805}

Referenced by number_from_string(), CAttributesDialog::OnEdit1(), and CAttributesDialog::OnEdit2().

◆ wcstof()

float __cdecl wcstof ( const wchar_t __restrict__,
wchar_t **  __restrict__ 
)

Definition at line 114 of file strtod.cpp.

118{
119 return common_strtod_l<float>(string, end_ptr, nullptr);
120}

◆ wcstol()

_ACRTIMP __msvcrt_long __cdecl wcstol ( const wchar_t s,
wchar_t **  end,
int  base 
)

Definition at line 2752 of file wcs.c.

2754{
2755 return _wcstol_l(s, end, base, NULL);
2756}
__msvcrt_long CDECL _wcstol_l(const wchar_t *s, wchar_t **end, int base, _locale_t locale)
Definition: wcs.c:2734

Referenced by build_createsql_columns(), build_zonemap_from_reg(), check_language(), check_transform_applicable(), CheckUnattendedSetup(), cmdConfig(), cmdHelpMsg(), construct_record(), ConvertTimeString(), custom_action_server(), date_parse(), decode_url(), deformat_index(), DelNodeRunDLL32W(), dialog_edit_control(), dialog_vcl_add_columns(), do_process_key(), ATL::CRegObject::do_process_key(), EnumOLEVERB_Next(), event_set_install_level(), fill_source_list(), FindPortNum(), get_dialog_font_point_size(), get_token(), CFSFolder::GetCustomViewInfo(), GetIntField(), GetKeyboardLayoutCP(), GetLongValue(), GetRegInt(), GetUserGeoID(), GetZipCodePage(), HTTP_GetResponseHeaders(), HttpProtocol_start_downloading(), SEALED_::IMsTscAx::Connect(), InitFunctionPtrs(), CCleanupHandler::Initialize(), InternetCrackUrlW(), InternetTimeToSystemTimeW(), IPADDRESS_ConstrainField(), IPADDRESS_GetAddress(), is_uninstallable(), IsFlag(), LanguagePage(), LaunchINFSectionExW(), LaunchINFSectionW(), lineGetCountryW(), LoadSetupData(), locale_return_reg_number(), margin_edit_notification(), mark_task_process(), MMDevPropStore_GetAt(), MONTHCAL_SetFirstDayOfWeek(), MSI_DatabaseImport(), msi_get_font_file_version(), msi_get_property_int(), MSI_OpenPackageW(), msi_parse_version_string(), msi_version_str_to_dword(), MsiSourceListEnumMediaDisksW(), PackageIdFromFullName(), parse_filetime(), parse_languages(), parse_prop(), parse_suminfo(), parse_version(), ParseArgument(), ParseUnattend(), PersistFile_Load(), PROPVAR_ConvertNumber(), RegLoadMUIStringW(), CInstalledApplicationInfo::RetrieveInstallDate(), rpcrt4_http_internet_connect(), set_host_properties(), set_ldids(), set_server_for_hostname(), SetupStartPage(), SHLoadIndirectString(), SHRegGetIntW(), start_debugger(), StrToIntW(), StrToNum(), test__wcstol(), TLB_ReadTypeLib(), tzset_from_environment_nolock(), UPDOWN_GetBuddyInt(), variant_from_dt(), WinHttpTimeToSystemTime(), wmain(), WshShortcut_put_IconLocation(), and WSPStringToAddress().

◆ wcstoll()

_ACRTIMP __int64 __cdecl wcstoll ( const wchar_t string,
wchar_t **  end_ptr,
int  base 
)

Definition at line 291 of file strtox.cpp.

296{
297 return __crt_strtox::parse_integer_from_string<long long>(string, end_ptr, base, nullptr);
298}

◆ wcstombs()

_ACRTIMP size_t __cdecl wcstombs ( char mbstr,
const wchar_t wcstr,
size_t  count 
)

Definition at line 697 of file wcs.c.

699{
700 return wcsrtombs_l(mbstr, &wcstr, count, NULL);
701}

◆ wcstombs_s()

_ACRTIMP errno_t __cdecl wcstombs_s ( size_t ret,
char mbstr,
size_t  size,
const wchar_t wcstr,
size_t  count 
)

Definition at line 781 of file wcs.c.

783{
784 return wcsrtombs_s_l(ret, mbstr, size, &wcstr, count, NULL);
785}
static int wcsrtombs_s_l(size_t *ret, char *mbstr, size_t size, const wchar_t **wcstr, size_t count, _locale_t locale)
Definition: wcs.c:718

Referenced by _VCrtDbgReportW(), _wperror(), and process_sub().

◆ wcstoul()

_ACRTIMP __msvcrt_ulong __cdecl wcstoul ( const wchar_t s,
wchar_t **  end,
int  base 
)

Definition at line 2917 of file wcs.c.

2918{
2919 return _wcstoul_l(s, end, base, NULL);
2920}
__msvcrt_ulong __cdecl _wcstoul_l(const wchar_t *s, wchar_t **end, int base, _locale_t locale)
Definition: wcs.c:2899

Referenced by _LocalOpenPrinterHandle(), AddNewLayout(), ArcGetNextTokenU(), calinfo_procW(), calinfoex_procW(), check_node_provider_desc_prefix_(), cmdAccounts(), cmdUser(), convert_hex_csv_to_hex(), convert_hex_to_dword(), CreateFreeLoaderIniForReactOSAndBootSector(), CreateKeyboardLayoutList(), CreateLogicalPartition(), CreatePrimaryMbrPartition(), CRTDLL_wcstoul(), do_process_key(), ATL::CRegObject::do_process_key(), do_reg_operation(), DoParse(), DosStart(), DWORDfromString(), FontProc(), FontSizeList_GetSelectedFontSize(), format_main(), FreeLdrMigrateBootDrivePartWorker(), GeneralPropertyPageLocalesEnumProc(), get_regdata(), CicProfile::GetCodePageA(), GetDeviceLocationString(), GetDWordValue(), GetHKLSubstitute(), GetLPTTransmissionRetryTimeout(), GetProfiles(), GetSpecialKLID(), GetTimeZoneListIndex(), GetULONG(), GetUsedPorts(), HTTP_HttpQueryInfoW(), HTTP_ParseDateAsAsctime(), HTTP_ParseRfc1123Date(), HTTP_ParseRfc850Date(), HTTP_ParseTime(), HTTP_ProcessExpires(), ImageFile_ParseCmdline(), init_locale(), InitFunctionPtrs(), InitializeDefaultUserLocale(), InitializeGlobalJobList(), InitTTFontCache(), Internal_EnumLanguageGroupLocales(), Internal_EnumSystemCodePages(), Internal_EnumSystemLanguageGroups(), IntLoadKeyboardLayout(), IpAddAddress(), IpAddDns(), IpSetAddress(), CAvailableApplicationInfo::IsCompatible(), IsLayoutExists(), IsValidLanguageGroup(), KLIDFromSpecialHKL(), LoadCurrentLocale(), LoadKeyboardLayoutW(), LocalesEnumProc(), lookup_manifest_file(), MAIN_LoadSettings(), mciSendStringW(), modify_dword_dlgproc(), NtPathToDiskPartComponents(), ObjectFromLresult(), OLEUTL_ReadRegistryDWORDValue(), parse_data_type(), parse_ipv6_component(), ParseCmdline(), ParseCmdLine(), ParseDaysOfMonth(), ParseId(), CConfiguration::ParseParameters(), ParseSetupInf(), ParseTime(), ProcessCommandLine(), ProcessDisplayRegistry(), ProcessKeyboardLayoutRegistry(), query_headers(), ReadRegDwordValue(), ReadSZFlagsFromRegistry(), SampFillUserDisplayCache(), SamrGetAliasMembership(), SelectDisk(), SelectPartition(), SelectVolume(), setid_main(), SetupGetBinaryField(), SortEnumProc(), SortTestEnumProc(), StrToColorref(), StrToNum(), test__wcstol(), test_keyboard_layout_name(), Test_KLID(), UnescapeHex(), UnescapeOther(), UniqueIdDisk(), UpdateKBLayout(), UpdateRegistry(), VarDateFromStr(), wmain(), and wWinMain().

◆ wcstoull()

_ACRTIMP unsigned __int64 __cdecl wcstoull ( const wchar_t string,
wchar_t **  end_ptr,
int  base 
)

Definition at line 352 of file strtox.cpp.

357{
358 return __crt_strtox::parse_integer_from_string<unsigned long long>(string, end_ptr, base, nullptr);
359}

◆ wctomb()

_ACRTIMP int __cdecl wctomb ( char mbchar,
wchar_t  wchar 
)

Definition at line 153 of file freeldr.c.

154{
155 *mbchar = (char)wchar;
156 return 1;
157}