ReactOS 0.4.16-dev-2104-gb84fa49
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 2289 of file string.c.

2290{
2291 unsigned __int64 val;
2292 BOOL is_negative;
2293 wchar_t buffer[65], *pos;
2294
2295 if (value < 0 && radix == 10)
2296 {
2297 is_negative = TRUE;
2298 val = -value;
2299 }
2300 else
2301 {
2302 is_negative = FALSE;
2303 val = value;
2304 }
2305
2306 pos = buffer + 64;
2307 *pos = '\0';
2308
2309 do
2310 {
2311 int digit = val % radix;
2312 val /= radix;
2313
2314 if (digit < 10)
2315 *--pos = '0' + digit;
2316 else
2317 *--pos = 'a' + digit - 10;
2318 }
2319 while (val != 0);
2320
2321 if (is_negative)
2322 *--pos = '-';
2323
2324 memcpy(str, pos, (buffer + 65 - pos) * sizeof(wchar_t));
2325 return str;
2326}
#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 lltow(), and TimeToMsString().

◆ _i64tow_s()

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

Definition at line 2591 of file string.c.

2592{
2593 unsigned __int64 val;
2594 unsigned int digit;
2595 BOOL is_negative;
2596 wchar_t buffer[65], *pos;
2597 size_t len;
2598
2599 if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
2600 if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL;
2601 if (!MSVCRT_CHECK_PMT(radix >= 2 && radix <= 36))
2602 {
2603 str[0] = '\0';
2604 return EINVAL;
2605 }
2606
2607 if (value < 0 && radix == 10)
2608 {
2609 is_negative = TRUE;
2610 val = -value;
2611 }
2612 else
2613 {
2614 is_negative = FALSE;
2615 val = value;
2616 }
2617
2618 pos = buffer + 64;
2619 *pos = '\0';
2620
2621 do
2622 {
2623 digit = val % radix;
2624 val /= radix;
2625
2626 if (digit < 10)
2627 *--pos = '0' + digit;
2628 else
2629 *--pos = 'a' + digit - 10;
2630 }
2631 while (val != 0);
2632
2633 if (is_negative)
2634 *--pos = '-';
2635
2636 len = buffer + 65 - pos;
2637 if (len > size)
2638 {
2639 size_t i;
2640 wchar_t *p = str;
2641
2642 /* Copy the temporary buffer backwards up to the available number of
2643 * characters. Don't copy the negative sign if present. */
2644
2645 if (is_negative)
2646 {
2647 p++;
2648 size--;
2649 }
2650
2651 for (pos = buffer + 63, i = 0; i < size; i++)
2652 *p++ = *pos--;
2653
2654 str[0] = '\0';
2655 MSVCRT_INVALID_PMT("str[size] is too small", ERANGE);
2656 return ERANGE;
2657 }
2658
2659 memcpy(str, pos, len * sizeof(wchar_t));
2660 return 0;
2661}
#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 2135 of file string.c.

2136{
2137 return ltow_helper(value, str, SIZE_MAX, radix) ? NULL : str;
2138}
#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:2004

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

◆ _itow_s()

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

Definition at line 2127 of file string.c.

2128{
2129 return _ltow_s(value, str, size, radix);
2130}
int CDECL _ltow_s(__msvcrt_long value, wchar_t *str, size_t size, int radix)
Definition: string.c:2087

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 2143 of file string.c.

2144{
2145 return ltow_helper(value, str, SIZE_MAX, radix) ? NULL : str;
2146}

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

◆ _ltow_s()

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

Definition at line 2087 of file string.c.

2088{
2089 if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL;
2090 if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL;
2091 if (!MSVCRT_CHECK_PMT(radix >= 2 && radix <= 36))
2092 {
2093 str[0] = '\0';
2094 return EINVAL;
2095 }
2096
2097 return ltow_helper(value, str, size, radix);
2098}

Referenced by _itow_s().

◆ _mbstowcs_l()

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

Definition at line 3283 of file mbcs.c.

3285{
3287 size_t i, size;
3288
3289 if(!mbstr) {
3290 *_errno() = EINVAL;
3291 return -1;
3292 }
3293
3294 if(!locale)
3295 locinfo = get_locinfo();
3296 else
3297 locinfo = locale->locinfo;
3298
3299 if(!locinfo->lc_codepage) {
3300 if(!wcstr)
3301 return strlen(mbstr);
3302
3303 for(i=0; i<count; i++) {
3304 wcstr[i] = (unsigned char)mbstr[i];
3305 if(!wcstr[i]) break;
3306 }
3307 return i;
3308 }
3309
3310 /* Ignore count parameter */
3311 if(!wcstr) {
3312 size = MultiByteToWideChar(locinfo->lc_codepage,
3313 MB_ERR_INVALID_CHARS, mbstr, -1, NULL, 0);
3314 if(!size) {
3315 *_errno() = EILSEQ;
3316 return -1;
3317 }
3318 return size - 1;
3319 }
3320
3321 for(i=0, size=0; i<count; i++) {
3322 if(mbstr[size] == '\0')
3323 break;
3324
3325 if(locinfo->lc_codepage == CP_UTF8) {
3326 int j, chlen = get_utf8_char_len(mbstr[size]);
3327
3328 for(j = 1; j < chlen; j++)
3329 {
3330 if(!mbstr[size + j])
3331 {
3332 if(count) wcstr[0] = '\0';
3333 *_errno() = EILSEQ;
3334 return -1;
3335 }
3336 }
3337 size += chlen;
3338 }
3339 else
3340 size += (_isleadbyte_l((unsigned char)mbstr[size], locale) ? 2 : 1);
3341 }
3342
3343 if(size) {
3344 size = MultiByteToWideChar(locinfo->lc_codepage,
3345 MB_ERR_INVALID_CHARS, mbstr, size, wcstr, count);
3346 if(!size) {
3347 if(count) wcstr[0] = '\0';
3348 *_errno() = EILSEQ;
3349 return -1;
3350 }
3351 }
3352
3353 if(size<count)
3354 wcstr[size] = '\0';
3355
3356 return size;
3357}
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:1592
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:3269
#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 3371 of file mbcs.c.

3373{
3374 size_t conv;
3375 int err = 0;
3376
3377 if(!wcstr && !size) {
3378 conv = _mbstowcs_l(NULL, mbstr, 0, locale);
3379 if(ret)
3380 *ret = conv+1;
3381 return 0;
3382 }
3383
3384 if (!MSVCRT_CHECK_PMT(wcstr != NULL)) return EINVAL;
3385 if (!MSVCRT_CHECK_PMT(mbstr != NULL)) {
3386 if(size) wcstr[0] = '\0';
3387 return EINVAL;
3388 }
3389
3390 if(count==_TRUNCATE || size<count)
3391 conv = size;
3392 else
3393 conv = count;
3394
3395 conv = _mbstowcs_l(wcstr, mbstr, conv, locale);
3396 if(conv<size)
3397 wcstr[conv++] = '\0';
3398 else if(conv==size && count==_TRUNCATE && wcstr[conv-1]!='\0') {
3399 wcstr[conv-1] = '\0';
3400 err = STRUNCATE;
3401 }else if(conv==size && wcstr[conv-1]!='\0') {
3402 MSVCRT_INVALID_PMT("wcstr[size] is too small", ERANGE);
3403 if(size)
3404 wcstr[0] = '\0';
3405 return ERANGE;
3406 }
3407
3408 if(ret)
3409 *ret = conv;
3410 return err;
3411}
#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 3161 of file mbcs.c.

3162{
3164 wchar_t tmpdst;
3165
3166 if(!locale)
3167 locinfo = get_locinfo();
3168 else
3169 locinfo = locale->locinfo;
3170
3171 if(n <= 0 || !str)
3172 return 0;
3173
3174 if(!*str) {
3175 if(dst) *dst = 0;
3176 return 0;
3177 }
3178
3179 if(!locinfo->lc_codepage) {
3180 if(dst) *dst = (unsigned char)*str;
3181 return 1;
3182 }
3183 if(n>=2 && _isleadbyte_l((unsigned char)*str, locale)) {
3184 if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, 2, &tmpdst, 1))
3185 return -1;
3186 if(dst) *dst = tmpdst;
3187 return 2;
3188 }
3189 if(!MultiByteToWideChar(locinfo->lc_codepage, 0, str, 1, &tmpdst, 1))
3190 return -1;
3191 if(dst) *dst = tmpdst;
3192 return 1;
3193}
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 2223 of file string.c.

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

Referenced by ulltow().

◆ _ui64tow_s()

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

Definition at line 2370 of file string.c.

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

◆ _ultow()

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

Definition at line 2199 of file string.c.

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

Referenced by AddNewLayout(), BcdDeleteElement(), CliGetPreloadKeyboardLayouts(), RecycleBin5::DeleteFile(), 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 2462 of file string.c.

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

◆ _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 2720 of file wcs.c.

2722{
2723 return _wcstoi64_l(nptr, endptr, base, NULL);
2724}
__int64 CDECL _wcstoi64_l(const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
Definition: wcs.c:2655

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 2655 of file wcs.c.

2657{
2658 BOOL negative = FALSE, empty = TRUE;
2659 __int64 ret = 0;
2660
2661 TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale);
2662
2663 if (!MSVCRT_CHECK_PMT(nptr != NULL)) return 0;
2664 if (!MSVCRT_CHECK_PMT(base == 0 || base >= 2)) return 0;
2665 if (!MSVCRT_CHECK_PMT(base <= 36)) return 0;
2666
2667 if(endptr)
2668 *endptr = (wchar_t*)nptr;
2669
2670 while(_iswspace_l(*nptr, locale)) nptr++;
2671
2672 if(*nptr == '-') {
2673 negative = TRUE;
2674 nptr++;
2675 } else if(*nptr == '+')
2676 nptr++;
2677
2678 if((base==0 || base==16) && wctoint(*nptr, 1)==0 && (nptr[1]=='x' || nptr[1]=='X')) {
2679 base = 16;
2680 nptr += 2;
2681 }
2682
2683 if(base == 0) {
2684 if(wctoint(*nptr, 1)==0)
2685 base = 8;
2686 else
2687 base = 10;
2688 }
2689
2690 while(*nptr) {
2691 int v = wctoint(*nptr, base);
2692 if(v<0)
2693 break;
2694
2695 if(negative)
2696 v = -v;
2697
2698 nptr++;
2699 empty = FALSE;
2700
2701 if(!negative && (ret>I64_MAX/base || ret*base>I64_MAX-v)) {
2702 ret = I64_MAX;
2703 *_errno() = ERANGE;
2704 } else if(negative && (ret<I64_MIN/base || ret*base<I64_MIN-v)) {
2705 ret = I64_MIN;
2706 *_errno() = ERANGE;
2707 } else
2708 ret = ret*base + v;
2709 }
2710
2711 if(endptr && !empty)
2712 *endptr = (wchar_t*)nptr;
2713
2714 return ret;
2715}
static const WCHAR empty[]
Definition: main.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:2625
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 683 of file wcs.c.

685{
686 return wcsrtombs_l(mbstr, &wcstr, count, locale);
687}
static size_t wcsrtombs_l(char *mbstr, const wchar_t **wcstr, size_t count, _locale_t locale)
Definition: wcs.c:609

◆ _wcstoui64()

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

Definition at line 2885 of file wcs.c.

2887{
2888 return _wcstoui64_l(nptr, endptr, base, NULL);
2889}
unsigned __int64 CDECL _wcstoui64_l(const wchar_t *nptr, wchar_t **endptr, int base, _locale_t locale)
Definition: wcs.c:2826

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 2826 of file wcs.c.

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

2148{
2149 int len;
2150#ifdef __REACTOS__
2151 int maxlen;
2152 if (locale)
2153 maxlen = locale->locinfo->mb_cur_max;
2154 else
2155 maxlen = get_locinfo()->mb_cur_max;
2156 if (_wctomb_s_l(&len, dst, maxlen, ch, locale) != 0)
2157 return -1;
2158#else
2160#endif
2161 return len;
2162}
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:2074

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(), _wsystem(), _wtempnam(), compat_getenv(), INTERNET_LoadProxySettings(), msvcrt_search_executable(), START_TEST(), test_case_insensitive(), test_environment_manipulation(), and test_utf8().

◆ _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:2983
#define e
Definition: ke_i.h:82
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:79
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:144

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)
Definition: utility.h:211

Referenced by ExplorerCmd::EvaluateOption(), 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 805 of file wcs.c.

806{
807 return _wcstod_l(str, NULL, NULL);
808}
double CDECL _wcstod_l(const wchar_t *str, wchar_t **end, _locale_t locale)
Definition: wcs.c:574

◆ _wtoi()

_ACRTIMP int __cdecl _wtoi ( const wchar_t str)

◆ _wtoi64()

_ACRTIMP __int64 __cdecl _wtoi64 ( const wchar_t str)

Definition at line 3040 of file wcs.c.

3041{
3042 return _wtoi64_l(str, NULL);
3043}
__int64 CDECL _wtoi64_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:3013

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

◆ _wtol()

Definition at line 2798 of file wcs.c.

2799{
2800 return _wtol_l(str, NULL);
2801}
__msvcrt_long __cdecl _wtol_l(const wchar_t *str, _locale_t locale)
Definition: wcs.c:2781

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

◆ mbstowcs()

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

Definition at line 3362 of file mbcs.c.

3364{
3365 return _mbstowcs_l(wcstr, mbstr, count, NULL);
3366}

◆ 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 158 of file freeldr.c.

159{
160 *wchar = (wchar_t)*mbchar;
161 return 1;
162}
#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 797 of file wcs.c.

798{
799 return _wcstod_l(lpszStr, end, NULL);
800}

Referenced by _wtof(), 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 2747 of file wcs.c.

2749{
2750 return _wcstol_l(s, end, base, NULL);
2751}
__msvcrt_long CDECL _wcstol_l(const wchar_t *s, wchar_t **end, int base, _locale_t locale)
Definition: wcs.c:2729

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(), deformat_index(), DelNodeRunDLL32W(), dialog_edit_control(), dialog_vcl_add_columns(), do_process_key(), ATL::CRegObject::do_process_key(), enum_locales_proc(), 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(), 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_ldids(), SetupStartPage(), SHLoadIndirectString(), start_debugger(), StrToIntW(), StrToNum(), test__wcstol(), TLB_ReadTypeLib(), tzset_from_environment_nolock(), UPDOWN_GetBuddyInt(), 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 692 of file wcs.c.

694{
695 return wcsrtombs_l(mbstr, &wcstr, count, NULL);
696}

◆ 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 776 of file wcs.c.

778{
779 return wcsrtombs_s_l(ret, mbstr, size, &wcstr, count, NULL);
780}
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:713

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 2912 of file wcs.c.

2913{
2914 return _wcstoul_l(s, end, base, NULL);
2915}
__msvcrt_ulong __cdecl _wcstoul_l(const wchar_t *s, wchar_t **end, int base, _locale_t locale)
Definition: wcs.c:2894

Referenced by _LocalOpenPrinterHandle(), AddNewLayout(), ArcGetNextTokenU(), BiEnumerateElements(), cmdAccounts(), cmdUser(), convert_hex_csv_to_hex(), convert_hex_to_dword(), CreateFreeLoaderIniForReactOSAndBootSector(), CreateKeyboardLayoutList(), CreateLogicalPartition(), CreatePrimaryMbrPartition(), 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(), InitializeDefaultUserLocale(), InitializeGlobalJobList(), InitTTFontCache(), Internal_EnumLanguageGroupLocales(), Internal_EnumSystemCodePages(), Internal_EnumSystemLanguageGroups(), IntLoadKeyboardLayout(), 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(), ReadRegDwordValue(), ReadSZFlagsFromRegistry(), SampFillUserDisplayCache(), SamrGetAliasMembership(), SelectDisk(), SelectPartition(), SelectVolume(), setid_main(), SortEnumProc(), SortTestEnumProc(), StrToColorref(), StrToNum(), test__wcstol(), 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 152 of file freeldr.c.

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