* Don't redirect stdlib wchar functions to our test platform shims.
* Fix bad find-replaces.
* Remove unused overload and last wchar shadowing.
if (NULL == pwszInput) return NULL;
- cchInput = wcslen(pwszInput);
+ cchInput = TP_slen(pwszInput);
pszOutput = new char[ cchInput + 1];
for(size_t i=0; i<=cchInput; i++)
return 0;
#else
int retVal = 0;
- char *assignment = (char*) malloc(sizeof(char) * (wcslen(name) + wcslen(value) + 1));
+ char *assignment = (char*) malloc(sizeof(char) * (TP_slen(name) + TP_slen(value) + 1));
sprintf(assignment, "%s=%s", HackyConvertToSTR(name), HackyConvertToSTR(value));
if (0 != putenv(assignment))
char nativeFullPath[MAX_PATH];
(void)realpath(HackyConvertToSTR(fileName), nativeFullPath);
LPWSTR fullPathForCLR = HackyConvertToWSTR(nativeFullPath);
- wcscpy_s(lpBuffer, MAX_PATH, fullPathForCLR);
- return wcslen(lpBuffer);
+ TP_scpy_s(lpBuffer, MAX_PATH, fullPathForCLR);
+ return TP_slen(lpBuffer);
#endif
}
DWORD TP_CreateThread(THREAD_ID* tThread, LPTHREAD_START_ROUTINE worker, LPVOID lpParameter)
#else
if(psz == NULL)
return NULL;
- return CoreClrBStrAlloc(psz, (DWORD)wcslen(psz));
+ return CoreClrBStrAlloc(psz, (DWORD)TP_slen(psz));
#endif
}
return 0;
}
-int TP_wcsncpy_s(LPWSTR strDestination, size_t size1, LPCWSTR strSource)
-{
- return wcsncpy_s(strDestination, size1, strSource, 0);
-}
-
int TP_wcsncmp(LPCWSTR str1, LPCWSTR str2,size_t len)
{
// < 0 str1 less than str2
int TP_wmemcmp(LPCWSTR str1, LPCWSTR str2,size_t len)
{
- return wcsncmp(str1, str2, len);
+ return TP_wcsncmp(str1, str2, len);
}
size_t TP_strncpy_s(char* strDest, size_t numberOfElements, const char *strSource, size_t count);
size_t TP_strcpy_s(char *dest, size_t n, char const *src);
int TP_wcsncpy_s(LPWSTR strDestination, size_t size1, LPCWSTR strSource, size_t size2);
-int TP_wcsncpy_s(LPWSTR strDestination, size_t size1, LPCWSTR strSource);
int TP_wcsncmp(LPCWSTR str1, LPCWSTR str2,size_t len);
int TP_wmemcmp(LPCWSTR str1, LPCWSTR str2,size_t len);
#define TP_GetProcAddress(m,e) dlsym(m,e)
#define TP_rand arc4random
#define TP_srand srandom
-#define wcscpy_s TP_scpy_s
-#define wcscat_s TP_scat_s
#define GetFullPathNameW(fname,buflen,buf,filepart) TP_GetFullPathName(fname,buflen,buf)
-#define wcslen TP_slen
-#define _wgetenv_s TP_getenv_s
-#define _wputenv_s TP_putenv_s
#define ZeroMemory TP_ZeroMemory
#define _itow_s TP_itow_s
#define _itoa_s TP_itoa_s
-#define wcsstr TP_sstr
#define strcmp TP_scmp_s
-#define wcscmp TP_wcmp_s
#define strncpy_s TP_strncpy_s
#define strcpy_s TP_strcpy_s
-#define wcsncpy_s TP_wcsncpy_s
-#define wcsncpy_s TP_wcsncpy_s
-#define wcsncmp TP_wcsncmp
-#define wmemcmp TP_wmemcmp
#endif
#endif
BlittableRecord* pData = (BlittableRecord*)pvData;
- if (wcscmp(szFieldName, W("a")) == 0)
+ if (TP_wcmp_s(szFieldName, W("a")) == 0)
{
VariantClear(pvarField);
V_VT(pvarField) = VT_I4;
NonBlittableRecord* pData = (NonBlittableRecord*)pvData;
- if (wcscmp(szFieldName, W("b")) == 0)
+ if (TP_wcmp_s(szFieldName, W("b")) == 0)
{
VariantClear(pvarField);
V_VT(pvarField) = VT_BOOL;
for (int j = 1; j < NamesCount; ++j)
{
const WCHAR *nameMaybe = Names[j];
- if (::wcscmp(name, nameMaybe) == 0)
+ if (::TP_wcmp_s(name, nameMaybe) == 0)
{
*curr = DISPID{ j };
break;
0,
REG_SZ,
reinterpret_cast<const BYTE*>(fullPath),
- static_cast<DWORD>(::wcslen(fullPath) + 1) * sizeof(fullPath[0]));
+ static_cast<DWORD>(::TP_slen(fullPath) + 1) * sizeof(fullPath[0]));
if (res != ERROR_SUCCESS)
return __HRESULT_FROM_WIN32(res);
0,
REG_SZ,
reinterpret_cast<const BYTE*>(threadingModel),
- static_cast<DWORD>(::wcslen(threadingModel) + 1) * sizeof(threadingModel[0]));
+ static_cast<DWORD>(::TP_slen(threadingModel) + 1) * sizeof(threadingModel[0]));
if (res != ERROR_SUCCESS)
return __HRESULT_FROM_WIN32(res);
}
if (a == nullptr || b == nullptr)
return E_POINTER;
- size_t aLen = ::wcslen(a);
- size_t bLen = ::wcslen(b);
+ size_t aLen = ::TP_slen(a);
+ size_t bLen = ::TP_slen(b);
auto buf = (LPWSTR)::CoTaskMemAlloc((aLen + bLen + 1) * sizeof(*b));
- ::wcscpy_s(buf, aLen + 1, a);
- ::wcscpy_s(buf + aLen, bLen + 1, b);
+ ::TP_scpy_s(buf, aLen + 1, a);
+ ::TP_scpy_s(buf + aLen, bLen + 1, b);
*pRetVal = buf;
return S_OK;
UINT bLen = ::SysStringLen(b);
BSTR buf = ::SysAllocStringByteLen(nullptr, (aLen + bLen) * sizeof(a[0]));
- ::wcscpy_s(buf, aLen + 1, a);
- ::wcscpy_s(buf + aLen, bLen + 1, b);
+ ::TP_scpy_s(buf, aLen + 1, a);
+ ::TP_scpy_s(buf + aLen, bLen + 1, b);
*pRetVal = buf;
return S_OK;
{
HRESULT hr;
RETURN_IF_FAILED(Reverse(*a, pRetVal));
- ReverseInplace(::wcslen(*a), *a);
+ ReverseInplace(::TP_slen(*a), *a);
return S_OK;
}
DEF_FUNC(Reverse_LPWStr_InRef)(
{
HRESULT hr;
RETURN_IF_FAILED(Reverse(a, pRetVal));
- ReverseInplace(::wcslen(a), a);
+ ReverseInplace(::TP_slen(a), a);
return S_OK;
}
DEF_FUNC(Reverse_SB_LPWStr_Ref)(
{
HRESULT hr;
RETURN_IF_FAILED(Reverse(*a, pRetVal));
- ReverseInplace(::wcslen(*a), *a);
+ ReverseInplace(::TP_slen(*a), *a);
return S_OK;
}
DEF_FUNC(Reverse_SB_LPWStr_InRef)(
{
HRESULT hr;
RETURN_IF_FAILED(Reverse(*a, pRetVal));
- ReverseInplace(::wcslen(*a), *a);
+ ReverseInplace(::TP_slen(*a), *a);
return S_OK;
}
DEF_FUNC(Reverse_SB_LPWStr_Out)(
{
HRESULT hr;
RETURN_IF_FAILED(Reverse(a, b));
- ReverseInplace(::wcslen(a), a);
+ ReverseInplace(::TP_slen(a), a);
return S_OK;
}
DEF_FUNC(Reverse_SB_LPWStr_OutAttr)(
/*[in,out]*/ LPWSTR a,
/*[out]*/ LPWSTR b)
{
- size_t len = ::wcslen(a);
+ size_t len = ::TP_slen(a);
ReverseInplace(len, a);
size_t byteLen = (len + 1) * sizeof(*a);
::memcpy_s(b, byteLen, a, byteLen);
{
BSTR str;
VarBstrFromDate(StDate->dt, LCID_ENGLISH, VAR_FOURDIGITYEARS, &str);
- if(wcscmp(L"7/4/2008", (wchar_t *)str) != 0 )
+ if(TP_wcmp_s(L"7/4/2008", (wchar_t *)str) != 0 )
{
wprintf(L"FAILURE! InDATE expected '07/04/2008' but received: %s\n", str);
return FALSE;
wprintf(L"FAILURE! iInt expected 100 but received: %d\n", StDate->iInt);
return FALSE;
}
- if(wcscmp(L"Managed", (wchar_t *)(StDate->bstr)) != 0 )
+ if(TP_wcmp_s(L"Managed", (wchar_t *)(StDate->bstr)) != 0 )
{
wprintf(L"FAILURE! bstr expected 'Managed' but received: %s\n", StDate->bstr);
return FALSE;
{
BSTR str;
VarBstrFromDate(StDate->dt, LCID_ENGLISH, VAR_FOURDIGITYEARS, &str);
- if(wcscmp(L"7/4/2008", (wchar_t *)str) != 0 )
+ if(TP_wcmp_s(L"7/4/2008", (wchar_t *)str) != 0 )
{
wprintf(L"FAILURE! InDATE expected '07/04/2008' but received: %s\n", str);
return FALSE;
VarBstrFromDate(d, LCID_ENGLISH, VAR_FOURDIGITYEARS, &str);
- if(wcscmp(L"7/4/2008", (wchar_t *)str) != 0 )
+ if(TP_wcmp_s(L"7/4/2008", (wchar_t *)str) != 0 )
{
wprintf(L"FAILURE! InDATE expected '07/04/2008' but received: %s\n", str);
return FALSE;
VarBstrFromDate(*d, LCID_ENGLISH, VAR_FOURDIGITYEARS, &str);
- if(wcscmp(L"7/4/2008", (wchar_t *)str) != 0 )
+ if(TP_wcmp_s(L"7/4/2008", (wchar_t *)str) != 0 )
{
wprintf(L"FAILURE! InDATE expected '07/04/2008' but received: %s\n", str);
return FALSE;
//Verify the changes are visible
VarBstrFromDate(ptoD, LCID_ENGLISH, VAR_FOURDIGITYEARS, &str);
- if(wcscmp(L"8/14/1947", (wchar_t *)str) != 0 )
+ if(TP_wcmp_s(L"8/14/1947", (wchar_t *)str) != 0 )
{
wprintf(L"FAILURE! RevP_Marshal_InOut_cdecl : InDATE expected '8/14/1947' but received: %s\n", str);
return FALSE;
date = d();
VarBstrFromDate(date, LCID_ENGLISH, VAR_FOURDIGITYEARS, &str);
- if(wcscmp(L"7/4/2008", (wchar_t *)str) != 0 )
+ if(TP_wcmp_s(L"7/4/2008", (wchar_t *)str) != 0 )
{
wprintf(L"FAILURE! RevP_Marshal_Ret_stdcall : InDATE expected '07/04/2008' but received: %s\n", str);
return FALSE;
extern "C" DLL_EXPORT bool STDMETHODCALLTYPE MarshalStringPointer_InOut(/*[in,out]*/LPWSTR *s)
{
//Check the Input
- size_t len = wcslen(*s);
- if((len != lenstrManaged)||(wcsncmp(*s,strManaged, lenstrManaged)!=0))
+ size_t len = TP_slen(*s);
+ if((len != lenstrManaged)||(TP_wcsncmp(*s,strManaged, lenstrManaged)!=0))
{
printf("Error in Function MarshalStringPointer_InOut\n");
size_t length = lenstrNative + 1;
*s = (LPWSTR)CoreClrAlloc(length * sizeof(WCHAR));
memset(*s,'\0',length * sizeof(WCHAR));
- wcsncpy_s(*s,length,strNative,lenstrNative);
+ TP_wcsncpy_s(*s,length,strNative,lenstrNative);
//Return
return true;
{
*curr = DISPID_UNKNOWN;
LPOLESTR name = rgszNames[i];
- if(wcscmp(name, W("GetEnumerator")) == 0)
+ if(TP_wcmp_s(name, W("GetEnumerator")) == 0)
{
*curr = DISPID_NEWENUM;
}
LPCWSTR str = d(s);
LPCWSTR ret = W("Return");
- size_t lenstr = wcslen(str);
- size_t lenret = wcslen(ret);
+ size_t lenstr = TP_slen(str);
+ size_t lenret = TP_slen(ret);
- if((lenret != lenstr)||(wcsncmp(str,ret,lenstr)!=0))
+ if((lenret != lenstr)||(TP_wcsncmp(str,ret,lenstr)!=0))
{
printf("Error in RPinvoke_DelMarshal_InOut, Returned value didn't match\n");
return FALSE;
extern "C" LPWSTR ReturnString()
{
- size_t length = wcslen(strReturn)+1;
+ size_t length = TP_slen(strReturn)+1;
LPWSTR ret = (LPWSTR)CoreClrAlloc(sizeof(WCHAR)*length);
memset(ret,'\0', sizeof(WCHAR)*length);
- wcsncpy_s(ret,length,strReturn,length-1);
+ TP_wcsncpy_s(ret,length,strReturn,length-1);
return ret;
}
extern "C" LPWSTR ReturnErrString()
{
- size_t length = wcslen(strErrReturn)+1;
+ size_t length = TP_slen(strErrReturn)+1;
LPWSTR ret = (LPWSTR)CoreClrAlloc(sizeof(WCHAR)*length);
memset(ret,'\0', sizeof(WCHAR)*length);
- wcsncpy_s(ret,length,strErrReturn,length-1);
+ TP_wcsncpy_s(ret,length,strErrReturn,length-1);
return ret;
}
{
//Check the Input
- size_t len = wcslen(s);
+ size_t len = TP_slen(s);
- if((len != lenstrManaged)||(wmemcmp(s,(WCHAR*)strManaged,len)!=0))
+ if((len != lenstrManaged)||(TP_wmemcmp(s,(WCHAR*)strManaged,len)!=0))
{
printf("Error in Function Marshal_InOut(Native Client)\n");
return ReturnErrString();
}
//In-Place Change
- wcsncpy_s(s,len+1,strNative,lenstrNative);
+ TP_wcsncpy_s(s,len+1,strNative,lenstrNative);
//Return
return ReturnString();
memset(s,0, sizeof(WCHAR)*(lenstrNative + 1));
//In-Place Change
- wcsncpy_s(s,lenstrNative+1,strNative,lenstrNative);
+ TP_wcsncpy_s(s,lenstrNative+1,strNative,lenstrNative);
//Return
return ReturnString();
extern "C" DLL_EXPORT LPWSTR MarshalPointer_InOut(/*[in,out]*/LPWSTR *s)
{
//Check the Input
- size_t len = wcslen(*s);
- if((len != lenstrManaged)||(wmemcmp(*s,(WCHAR*)strManaged,len)!=0))
+ size_t len = TP_slen(*s);
+ if((len != lenstrManaged)||(TP_wmemcmp(*s,(WCHAR*)strManaged,len)!=0))
{
printf("Error in Function MarshalPointer_InOut\n");
return ReturnErrString();
size_t length = lenstrNative + 1;
*s = (LPWSTR)CoreClrAlloc(length * sizeof(WCHAR));
memset(*s,'\0',length * sizeof(WCHAR));
- wcsncpy_s(*s,length,strNative,lenstrNative);
+ TP_wcsncpy_s(*s,length,strNative,lenstrNative);
//Return
return ReturnString();
size_t length = lenstrNative+1;
*s = (LPWSTR)CoreClrAlloc(sizeof(WCHAR)*length);
memset(*s, '\0', length * sizeof(WCHAR));
- wcsncpy_s(*s,length,strNative,lenstrNative);
+ TP_wcsncpy_s(*s,length,strNative,lenstrNative);
return ReturnString();
}
LPWSTR expectedret =(LPWSTR)W("Native");
LPWSTR expectedstr = (LPWSTR)W("m");
- size_t lenret = wcslen(ret);
- size_t lenexpectedret = wcslen(expectedret);
- if((lenret != lenexpectedret)||(wcsncmp(ret,expectedret,lenret)!=0))
+ size_t lenret = TP_slen(ret);
+ size_t lenexpectedret = TP_slen(expectedret);
+ if((lenret != lenexpectedret)||(TP_wcsncmp(ret,expectedret,lenret)!=0))
{
printf("Error in ReverseP_MarshalStrB_InOut, Returned value didn't match\n");
return FALSE;
}
- size_t lenstr = wcslen(s);
- size_t lenexpectedstr = wcslen(expectedstr);
- if((lenstr != lenexpectedstr)||(wcsncmp(s,expectedstr,lenstr)!=0))
+ size_t lenstr = TP_slen(s);
+ size_t lenexpectedstr = TP_slen(expectedstr);
+ if((lenstr != lenexpectedstr)||(TP_wcsncmp(s,expectedstr,lenstr)!=0))
{
printf("Error in ReverseP_MarshalStrB_InOut, Changed value didn't reflect on native side.\n");
return FALSE;
LPWSTR expectedret = (LPWSTR)W("Native");
LPWSTR expectedstr = (LPWSTR)W("Managed");
- size_t lenret = wcslen(ret);
- size_t lenexpectedret = wcslen(expectedret);
- if((lenret != lenexpectedret)||(wcsncmp(ret,expectedret,lenret)!=0))
+ size_t lenret = TP_slen(ret);
+ size_t lenexpectedret = TP_slen(expectedret);
+ if((lenret != lenexpectedret)||(TP_wcsncmp(ret,expectedret,lenret)!=0))
{
printf("Error in ReverseP_MarshalStrB_Out, Returned value didn't match\n");
return FALSE;
}
- size_t lenstr = wcslen(s);
- size_t lenexpectedstr = wcslen(expectedstr);
- if((lenstr != lenexpectedstr)||(wcsncmp(s,expectedstr,lenstr)!=0))
+ size_t lenstr = TP_slen(s);
+ size_t lenexpectedstr = TP_slen(expectedstr);
+ if((lenstr != lenexpectedstr)||(TP_wcsncmp(s,expectedstr,lenstr)!=0))
{
printf("Error in ReverseP_MarshalStrB_Out, Changed value didn't reflect on native side.\n");
return FALSE;
if ((srcstring == NULL) || (*srcstring == L'\0')) {
return 0;
}
- size_t cchUTF16 = wcslen(srcstring) + 1;
+ size_t cchUTF16 = TP_slen(srcstring) + 1;
int cbUTF8 = WideCharToMultiByte(CP_UTF8, 0,
srcstring,
(int)cchUTF16,
extern "C" DLL_EXPORT BOOL Marshal_Unicode(LPCWSTR expected, LPWSTR actual, LPCWSTR newValue)
{
- bool result = wcscmp(expected, actual) == 0;
+ bool result = TP_wcmp_s(expected, actual) == 0;
- wcscpy_s(actual, wcslen(actual), newValue);
+ TP_scpy_s(actual, TP_slen(actual), newValue);
return result;
}
#else
LPCWSTR strSource = u"change string";
#endif
- size_t len = wcslen(strSource);
+ size_t len = TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
- wcscpy_s((WCHAR*)temp, (len+1), strSource);
+ TP_scpy_s((WCHAR*)temp, (len+1), strSource);
p->f1 = temp;
p->f2 = L'n';
}
if(temp != NULL)
{
memset((LPWSTR)temp,0,len+1);
- wcsncpy_s((WCHAR*)temp, len, strSource, len);
+ TP_wcsncpy_s((WCHAR*)temp, len, strSource, len);
p->f1 = temp;
p->f2 = L'n';
}
CharSetUnicodeSequential argstr;
WCHAR* strSource = (WCHAR*)(W("change string"));
- size_t len = wcslen(strSource);
+ size_t len = TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
//wcscpy((WCHAR*)temp, (len+1)*sizeof(WCHAR), strSource);
- wcscpy_s((WCHAR*)temp,len+1,strSource);
+ TP_scpy_s((WCHAR*)temp,len+1,strSource);
argstr.f1 = temp;
argstr.f2 = 'n';
}
CharSetUnicodeSequential argstr;
WCHAR* strSource = (WCHAR*)(W("change string"));
- size_t len = wcslen(strSource);
+ size_t len = TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
//wcscpy((WCHAR*)temp, (len+1)*sizeof(WCHAR), strSource);
- wcscpy_s((WCHAR*)temp,len+1,strSource);
+ TP_scpy_s((WCHAR*)temp,len+1,strSource);
argstr.f1 = temp;
argstr.f2 = 'n';
}
}
WCHAR* strSource = (WCHAR*)(W("change string"));
- size_t len = wcslen(strSource);
+ size_t len = TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
//wcscpy((WCHAR*)temp, (len+1)*sizeof(WCHAR), strSource);
- wcscpy_s((WCHAR*)temp,len+1,strSource);
+ TP_scpy_s((WCHAR*)temp,len+1,strSource);
argstr.f1 = temp;
argstr.f2 = 'n';
}
}
WCHAR* strSource = (WCHAR*)(W("change string"));
- size_t len = wcslen(strSource);
+ size_t len = TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
//wcscpy((WCHAR*)temp, (len+1)*sizeof(WCHAR), strSource);
- wcscpy_s((WCHAR*)temp,len+1,strSource);
+ TP_scpy_s((WCHAR*)temp,len+1,strSource);
argstr.f1 = temp;
argstr.f2 = 'n';
}
//Init
CharSetUnicodeSequential argstr{};
WCHAR* strSource = (WCHAR*)(W("change string"));
- size_t len =wcslen(strSource);
+ size_t len =TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
//wcscpy((WCHAR*)temp, (len+1)*sizeof(WCHAR), strSource);
- wcscpy_s((WCHAR*)temp,len+1,strSource);
+ TP_scpy_s((WCHAR*)temp,len+1,strSource);
argstr.f1 = temp;
argstr.f2 = 'n';
}
}
//Verify the value unchanged
- if(0 != wcscmp(const_cast<WCHAR*>(argstr.f1), const_cast<WCHAR*>(W("change string"))) || argstr.f2 != L'n')
+ if(0 != TP_wcmp_s(const_cast<WCHAR*>(argstr.f1), const_cast<WCHAR*>(W("change string"))) || argstr.f2 != L'n')
{
printf("The parameter for DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_Cdecl is wrong\n");
return FALSE;
//Init
CharSetUnicodeSequential argstr{};
WCHAR* strSource = (WCHAR*)(W("change string"));
- size_t len =wcslen(strSource);
+ size_t len =TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
//wcscpy((WCHAR*)temp, (len+1)*sizeof(WCHAR), strSource);
- wcscpy_s((WCHAR*)temp,len+1,strSource);
+ TP_scpy_s((WCHAR*)temp,len+1,strSource);
argstr.f1 = temp;
argstr.f2 = 'n';
}
}
//Verify the value unchanged
- if(0 != wcscmp(const_cast<WCHAR*>(argstr.f1), const_cast<WCHAR*>(W("change string"))) || argstr.f2 != L'n')
+ if(0 != TP_wcmp_s(const_cast<WCHAR*>(argstr.f1), const_cast<WCHAR*>(W("change string"))) || argstr.f2 != L'n')
{
printf("The parameter for DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_StdCall is wrong\n");
return FALSE;
void ChangeCharSetUnicodeSequential(CharSetUnicodeSequential* p)
{
LPCWSTR strSource = W("change string");
- size_t len = wcslen(strSource);
+ size_t len = TP_slen(strSource);
LPCWSTR temp = (LPCWSTR)CoreClrAlloc(sizeof(WCHAR)*(len+1));
if(temp != NULL)
{
- wcscpy_s((WCHAR*)temp, (len+1), strSource);
+ TP_scpy_s((WCHAR*)temp, (len+1), strSource);
p->f1 = temp;
p->f2 = L'n';
}
{
LPCWSTR expected= W("some string");
LPCWSTR actual = p->f1;
- if(0 != wcscmp(actual, expected))
+ if(0 != TP_wcmp_s(actual, expected))
{
return false;
}