From c3747824367dbcbe74777c166b6d5d41d6de5dce Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 13 Jul 2021 21:59:48 +0200 Subject: Windows: replace insecure wcscpy/wcscat/strcpy runtime functions with secure equivalents This fixed failure to build driver for ARM64 with latest VS 2019 --- src/Common/Tcdefs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Common/Tcdefs.h') diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h index d01ea63b..2113c81c 100644 --- a/src/Common/Tcdefs.h +++ b/src/Common/Tcdefs.h @@ -180,10 +180,10 @@ typedef uint64 uint_64t; typedef CHAR16 wchar_t; typedef int LONG; -#define wcscpy StrCpy +#define StringCchCopyW StrCpyS #define wcslen StrLen #define wcscmp StrCmp -#define wcscat StrCat +#define StringCchCatW StrCatS #define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count)) #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch)) @@ -195,7 +195,7 @@ typedef int LONG; #define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch) #define strcmp AsciiStrCmp #define strncmp(string1,string2,count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count))) -#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource) +#define StringCchCopyA(strDest,strMaxSize,strSource) AsciiStrCpyS(strDest,strMaxSize,strSource) #define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count) #define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE)) #define strstr AsciiStrStr -- cgit v1.2.3