Share via


Security-Enhanced CRT Functions for Windows Embedded CE

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/27/2008

The Windows Embedded CE 6.0 compilers support a substantial subset of the secure versions of run-time library routines that are available in Visual C++ 2005.

For further information concerning Security Enhancements in the CRT, see CRT Security Enhancements.

In addition, the safe string functions offer more secure implementations of many string functions. For more information, see Safe String Functions.

CRT Functions

The following table shows the security-enhanced CRT functions that are supported by Windows Embedded CE 6.0.

Security-enhanced CRT function Description

_ecvt_s

Converts a double number to a string.

Security-enhanced version of deprecated function _ecvt. Validates parameters and sets errno. Template overload available.

_fcvt_s

Converts a floating-point number to a string.

Security-enhanced version of deprecated function _fcvt. Validates parameters and sets errno. Template overload available.

_freea

Deallocates or frees a memory block.

_gcvt_s

Converts a floating-point value to a string.

Security-enhanced version of deprecated function _gcvt. Validates parameters and sets errno. Template overload available.

_itoa_s, _itow_s,

Converts an integer to a string.

Security-enhanced versions of deprecated functions _itoa and _itow. Validates parameters and sets errno. Template overload available.

Windows Embedded CE 6.0 does not support forms of this function that convert int64 values, _i64toa_s, _ui64toa_s, _i64tow_s, and _ui64tow_s.

_ltoa_s, _ltow_s

Converts a long integer to a string.

Security-enhanced versions of deprecated functions _ltoa and _ltow. Validates parameters, won't write past end of buffer.

_malloca

Allocates memory on the stack.

Security-enhanced version of deprecated function _alloca.

_recalloc

Reallocates memory blocks.

_set_invalid_parameter_handler

Sets a function to be called when the CRT detects an invalid argument.

_snprintf_s, _snwprintf_s

Writes formatted data to a string.

Security-enhanced versions of deprecated functions _snprintf and _snwprintf. Validates parameters, returns errors. Template overload available.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter, snprintf_s_l, and snwprintf_s_l.

_strlwr_s, _wcslwr_s

Converts a string to lowercase, using the current locale or a locale object passed in.

Security-enhanced versions of deprecated function _strlwr and _wcslwr.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms of this function that use the Locale parameter, _mbslwr_s, _mbslwr_s_l and _wcslwr_s_l.

_strnset_s, _wcsnset_s

Initializes characters of a string to a given character.

Security-enhanced versions of deprecated functions _strnset and _wcsnet.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strnset_s_l, _mbsnset_s, _mbsnset_s_l and _wcsnset_s_l.

_strset_s, _wcsset_s

Sets characters of a string to a character.

Security-enhanced versions of deprecated functions _strset and _wcsset.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strset_s_l, _mbsset_s, _mbsset_s_l and _wcsset_s_l.

_strupr_s, _wcsupr_s

Converts a string to uppercase, using the current locale or a specified locale passed in.

Security-enhanced versions of deprecated functions _strup and _wcsrup.

_ultoa_s, _ultow_s

Converts an unsigned long integer to a string.

Security-enhanced versions of deprecated functions _ultoa and _ultow. Sets errno, template overload available.

_vfprintf_s, _vfwprintf_s

Writes formatted output using a pointer to a list of arguments.

Security-enhanced versions of vfprintf and vfwprintf.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter _vfprintf_s_l and vfwprintf_s_l.

_vsnprintf_s, _vsnwprintf_s

Writes formatted output using a pointer to a list of arguments.

Security-enhanced versions of deprecated functions vsnprintf and _vsnwprintf.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter _vsnprintf_s_l and vsnwprintf_s_l.

clearerr_s

Resets the error indicator for a stream.

Security-enhanced version of clearerr.

controlfp_s

Gets and sets the floating-point control word.

Security-enhanced version of deprecated function _controlfp. Returns error for bad parameters.

fopen_s¸ _wfopen_s

Opens a file.

Security-enhanced versions of deprecated functions fopen and _wfopen. Denies read/write sharing by default.

fprintf_s, fwprintf_s

Prints formatted data to a stream.

Security-enhanced versions of deprecated functions fprintf and fwprintf.

Windows Embedded CE 6.0 does not support forms of this function that accept a Locale parameter, _fprint_s_l and fwprint_s_l.

fread

Reads data from a stream. Invokes the invalid parameter handler.

fscanf_s, _fwscanf_s

Reads formatted data from a stream.

Security-enhanced versions of deprecated functions fscanf and fwscanf. Requires buffer length.

Windows Embedded CE 6.0 does not support forms of this function that accept a Locale parameter,_fscanf_s_l and fwscanf_s_l.

gets_s, _getws_s

Gets a line from the stdin stream.

Security-enhanced version of deprecated functions gets and _getws. Template overload available.

mbstowcs_s

Converts a sequence of multibyte characters to a corresponding sequence of wide characters.

Security-enhanced version of deprecated function mbstowcs. Takes a buffer size and won't write past end of buffer. Template overload available.

Windows Embedded CE 6.0 does not support the form of this function that uses the Locale parameter, _mbstowcs_s_l.

memcpy_s

Copies bytes between buffers.

Security-enhanced version of deprecated function memcpy.

memmove_s

Moves one buffer to another.

Security-enhanced version of deprecated function memmove.

printf_s, wprintf_s

Prints formatted output to the standard output stream.

Security-enhanced versions of printf and wprintf.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter printf_s_l, and wprintf_s_l.

qsort_s

Performs a quick sort.

Security-enhanced version of qsort.

rand_s

Generates a pseudorandom number.

Security-enhanced version of rand.

To use this function, you must add filesys.dll to your run-time image by including one of the following SYSGEN variables:

  • SYSGEN_FSROMONLY
  • SYSGEN_FSREGRAM
  • SYSGEN_FSREGHIVE
  • SYSGEN_FSREPLBIT
  • SYSGEN_FSDBASE
  • SYSGEN_FSPASSWORD
  • SYSGEN_ACL
  • SYSGEN_ACCOUNTDB

scanf_s, wscanf_s

Reads formatted data from the standard input stream.

Security-enhanced versions of deprecated functions scanf and wscanf. Requires buffer size.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter, scanf_s_l, and wscanf _s_l.

sprintf_s, swprintf_s

Writes formatted data to a string.

Security-enhanced versions of deprecated functions sprintf and swprintf.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter, sprintf_s_l, and swprintf_s_l.

sscanf_s, swscanf_s

Reads formatted data from a string.

Security-enhanced versions of sscanf and swscanf. Requires buffer size.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter, sscanf_s_l, swscanf_s_l.

strcat_s, wsccat_s

Appends a string.

Security-enhanced versions of deprecated functions strcat and wcscat. Template overload available.

Windows Embedded CE 6.0 does not support the multibyte form of this function, _mbscat_s.

strcpy_s, wcscpy_s

Copies a string.

Security-enhanced versions of deprecated functions strcpy and wcscpy. Buffers require NULL termination and should assert on truncation. Template overload available.

Windows Embedded CE 6.0 does not support the multibyte form of this function, _mbscpy_s.

strncat_s, wcsncat_s

Appends characters to a string.

Security-enhanced versions of deprecated functions strncat and wcsncat. Validates parameters, template overload available.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strncat_s_l, _mbsncat_s, _mbsncat_s_l and _wcsncat_s_l.

strncpy_s, wcsncpy_s

Copies characters of one string to another.

Security-enhanced versions of deprecated functions strncpy and wcsncpy. Template overload available.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strncpy_s_l, _mbsncpy_s, _mbsncpy_s_l and _wcsncpy_s_l.

strnlen, wcsnlen

Gets the length of a string, using the current locale or one that has been passed in.

More secure than previous versions of strlen and wcslen.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strnlen_s_l, _mbsnlen_s, _mbsnlen_s_l and _wcsnlen_s_l.

strtok_s, wcstok_s

Finds the next token in a string, using the current locale or a locale passed in.

Security-enhanced versions of deprecated functions strtok and wcstok.

Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strtok_s_l, _mbstok_s, _mbstok_s_l and _wcstok_s_l.

vprintf_s, vwprintf_s

Writes formatted output using a pointer to a list of arguments.

Security-enhanced versions of deprecated functions vprintf and vwprintf.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter _vprintf_s_l and vwprintf_s_l.

vsprintf_s, vswprintf_s

Writes formatted output using a pointer to a list of arguments.

Security-enhanced versions of deprecated functions vsprintf and vswprintf. Validates parameters and sets errno. Template overload available.

Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter _vsprintf_s_l and vswprintf_s_l.

wcstombs_s

Converts a sequence of wide characters to a corresponding sequence of multibyte characters.

Security-enhanced version of deprecated function wcstombs. Template overload available.

Windows Embedded CE 6.0 does not support the form of this function that uses the Locale parameter wcstombs_s_l.

See Also

Other Resources

C/C++ Libraries for Windows Embedded CE
Safe String Functions