From 3dff5bef29e2f23d02c5fb9833732dca8e4b0eae Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 16 Aug 2013 21:13:36 +0000 Subject: [PATCH] [CRT] * Annotate mbstring_s.h. * Update _mbsnbcpy_s() annotation in mbstring.h. svn path=/trunk/; revision=59755 --- reactos/include/crt/mbstring.h | 11 +- reactos/include/crt/sec_api/mbstring_s.h | 268 ++++++++++++++++++++--- 2 files changed, 245 insertions(+), 34 deletions(-) diff --git a/reactos/include/crt/mbstring.h b/reactos/include/crt/mbstring.h index 87ec6e397f0..b897196a4b6 100644 --- a/reactos/include/crt/mbstring.h +++ b/reactos/include/crt/mbstring.h @@ -3,6 +3,7 @@ * This file is part of the w64 mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER within this package. */ + #ifndef _INC_MBSTRING #define _INC_MBSTRING @@ -390,13 +391,13 @@ extern "C" { _In_ size_t _Count); _CRTIMP - int + errno_t __cdecl _mbsnbcpy_s( - _Out_writes_z_(size) unsigned char* dst, - _In_ size_t size, - _In_z_ const unsigned char* src, - _In_ size_t n); + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount); _CRTIMP unsigned char* diff --git a/reactos/include/crt/sec_api/mbstring_s.h b/reactos/include/crt/sec_api/mbstring_s.h index 6b2b188f8b7..35e0efdae02 100644 --- a/reactos/include/crt/sec_api/mbstring_s.h +++ b/reactos/include/crt/sec_api/mbstring_s.h @@ -3,6 +3,7 @@ * This file is part of the w64 mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER within this package. */ + #ifndef _INC_MBSTRING_S #define _INC_MBSTRING_S @@ -16,37 +17,246 @@ extern "C" { #ifndef _MBSTRING_S_DEFINED #define _MBSTRING_S_DEFINED - _CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); - _CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); - _CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes); - _CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); - _CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); - _CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount); - _CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); - _CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); - _CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount); - _CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val); - _CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale); - _CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context); - _CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes); - _CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); - _CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src); - _CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale); -#endif + + _CRTIMP + errno_t + __cdecl + _mbscat_s( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src); + + _CRTIMP + errno_t + __cdecl + _mbscat_s_l( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbscpy_s( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src); + + _CRTIMP + errno_t + __cdecl + _mbscpy_s_l( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbslwr_s( + _Inout_updates_opt_z_(_SizeInBytes) unsigned char *_Str, + _In_ size_t _SizeInBytes); + + _CRTIMP + errno_t + __cdecl + _mbslwr_s_l( + _Inout_updates_opt_z_(_SizeInBytes) unsigned char *_Str, + _In_ size_t _SizeInBytes, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsnbcat_s( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount); + + _CRTIMP + errno_t + __cdecl + _mbsnbcat_s_l( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsnbcpy_s( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount); + + _CRTIMP + errno_t + __cdecl + _mbsnbcpy_s_l( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsnbset_s( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_ unsigned int _Ch, + _In_ size_t _MaxCount); + + _CRTIMP + errno_t + __cdecl + _mbsnbset_s_l( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_ unsigned int _Ch, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsncat_s( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount); + + _CRTIMP + errno_t + __cdecl + _mbsncat_s_l( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsncpy_s( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount); + + _CRTIMP + errno_t + __cdecl + _mbsncpy_s_l( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_z_ const unsigned char *_Src, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsnset_s( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_ unsigned int _Val, + _In_ size_t _MaxCount); + + _CRTIMP + errno_t + __cdecl + _mbsnset_s_l( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_ unsigned int _Val, + _In_ size_t _MaxCount, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsset_s( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_ unsigned int _Val); + + _CRTIMP + errno_t + __cdecl + _mbsset_s_l( + _Inout_updates_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _In_ unsigned int _Val, + _In_opt_ _locale_t _Locale); + + _Check_return_ + _CRTIMP + unsigned char * + __cdecl + _mbstok_s( + _Inout_opt_z_ unsigned char *_Str, + _In_z_ const unsigned char *_Delim, + _Inout_ _Deref_prepost_opt_z_ unsigned char **_Context); + + _Check_return_ + _CRTIMP + unsigned char * + __cdecl + _mbstok_s_l( + _Inout_opt_z_ unsigned char *_Str, + _In_z_ const unsigned char *_Delim, + _Inout_ _Deref_prepost_opt_z_ unsigned char **_Context, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbsupr_s( + _Inout_updates_z_(_SizeInBytes) unsigned char *_Str, + _In_ size_t _SizeInBytes); + + _CRTIMP + errno_t + __cdecl + _mbsupr_s_l( + _Inout_updates_z_(_SizeInBytes) unsigned char *_Str, + _In_ size_t _SizeInBytes, + _In_opt_ _locale_t _Locale); + + _CRTIMP + errno_t + __cdecl + _mbccpy_s( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _Out_opt_ int *_PCopied, + _In_z_ const unsigned char *_Src); + + _CRTIMP + errno_t + __cdecl + _mbccpy_s_l( + _Out_writes_z_(_DstSizeInBytes) unsigned char *_Dst, + _In_ size_t _DstSizeInBytes, + _Out_opt_ int *_PCopied, + _In_z_ const unsigned char *_Src, + _In_opt_ _locale_t _Locale); + +#endif /* _MBSTRING_S_DEFINED */ #ifdef __cplusplus } #endif -#endif -#endif +#endif /* MINGW_HAS_SECURE_API */ + +#endif /* _INC_MBSTRING_S */