Banned.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. /***
  6. * banned.h - list of Microsoft Security Development Lifecycle banned APIs
  7. *
  8. * Purpose:
  9. * This include file contains a list of banned API which should not be used in new code and
  10. * removed from legacy code over time
  11. * History
  12. * 01-Jan-2006 - mikehow - Initial Version
  13. * 22-Apr-2008 - mikehow - Updated to SDL 4.1, commented out recommendations and added memcpy
  14. * 26-Jan-2009 - mikehow - Updated to SDL 5.0, made the list sane, added compliance levels
  15. * 10-Feb-2009 - mikehow - Updated based on feedback from MS Office
  16. * 12-May-2009 - jpardue - Updated based on feedback from mikehow (added wmemcpy)
  17. *
  18. ***/
  19. // IMPORTANT:
  20. // Some of these functions are Windows specific, so you may want to add *nix specific banned function calls
  21. #ifndef _INC_BANNED
  22. # define _INC_BANNED
  23. #endif
  24. #ifdef _MSC_VER
  25. # pragma once
  26. # pragma deprecated (strcpy, strcpyA, strcpyW, wcscpy, _tcscpy, _mbscpy, StrCpy, StrCpyA, StrCpyW, lstrcpy, lstrcpyA, lstrcpyW, _tccpy, _mbccpy, _ftcscpy)
  27. # pragma deprecated (strcat, strcatA, strcatW, wcscat, _tcscat, _mbscat, StrCat, StrCatA, StrCatW, lstrcat, lstrcatA, lstrcatW, StrCatBuff, StrCatBuffA, StrCatBuffW, StrCatChainW, _tccat, _mbccat, _ftcscat)
  28. # pragma deprecated (wvsprintf, wvsprintfA, wvsprintfW, vsprintf, _vstprintf, vswprintf)
  29. # pragma deprecated (strncpy, wcsncpy, _tcsncpy, _mbsncpy, _mbsnbcpy, StrCpyN, StrCpyNA, StrCpyNW, StrNCpy, strcpynA, StrNCpyA, StrNCpyW, lstrcpyn, lstrcpynA, lstrcpynW)
  30. # pragma deprecated (strncat, wcsncat, _tcsncat, _mbsncat, _mbsnbcat, StrCatN, StrCatNA, StrCatNW, StrNCat, StrNCatA, StrNCatW, lstrncat, lstrcatnA, lstrcatnW, lstrcatn)
  31. # pragma deprecated (IsBadWritePtr, IsBadHugeWritePtr, IsBadReadPtr, IsBadHugeReadPtr, IsBadCodePtr, IsBadStringPtr)
  32. # pragma deprecated (gets, _getts, _gettws)
  33. # pragma deprecated (RtlCopyMemory, CopyMemory)
  34. # pragma deprecated (wnsprintf, wnsprintfA, wnsprintfW, sprintfW, sprintfA, wsprintf, wsprintfW, wsprintfA, sprintf, swprintf, _stprintf, _snwprintf, _snprintf, _sntprintf)
  35. # pragma deprecated (_vsnprintf, vsnprintf, _vsnwprintf, _vsntprintf, wvnsprintf, wvnsprintfA, wvnsprintfW)
  36. # pragma deprecated (strtok, _tcstok, wcstok, _mbstok)
  37. # pragma deprecated (makepath, _tmakepath, _makepath, _wmakepath)
  38. # pragma deprecated (_splitpath, _tsplitpath, _wsplitpath)
  39. # pragma deprecated (scanf, wscanf, _tscanf, sscanf, swscanf, _stscanf, snscanf, snwscanf, _sntscanf)
  40. # pragma deprecated (_itoa, _itow, _i64toa, _i64tow, _ui64toa, _ui64tot, _ui64tow, _ultoa, _ultot, _ultow)
  41. #if (_SDL_BANNED_LEVEL3)
  42. # pragma deprecated (CharToOem, CharToOemA, CharToOemW, OemToChar, OemToCharA, OemToCharW, CharToOemBuffA, CharToOemBuffW)
  43. # pragma deprecated (alloca, _alloca)
  44. # pragma deprecated (strlen, wcslen, _mbslen, _mbstrlen, StrLen, lstrlen)
  45. # pragma deprecated (ChangeWindowMessageFilter)
  46. #endif
  47. #ifndef PATHCCH_NO_DEPRECATE
  48. // Path APIs which assume MAX_PATH instead of requiring the caller to specify
  49. // the buffer size have been deprecated. Include <PathCch.h> and use the PathCch
  50. // equivalents instead.
  51. # pragma deprecated (PathAddBackslash, PathAddBackslashA, PathAddBackslashW)
  52. # pragma deprecated (PathAddExtension, PathAddExtensionA, PathAddExtensionW)
  53. # pragma deprecated (PathAppend, PathAppendA, PathAppendW)
  54. # pragma deprecated (PathCanonicalize, PathCanonicalizeA, PathCanonicalizeW)
  55. # pragma deprecated (PathCombine, PathCombineA, PathCombineW)
  56. # pragma deprecated (PathRenameExtension, PathRenameExtensionA, PathRenameExtensionW)
  57. #endif // PATHCCH_NO_DEPRECATE
  58. #else // _MSC_VER
  59. #endif /* _INC_BANNED */