| 1 | // Licensed to the .NET Foundation under one or more agreements. |
| 2 | // The .NET Foundation licenses this file to you under the MIT license. |
| 3 | // See the LICENSE file in the project root for more information. |
| 4 | |
| 5 | #include <xplatform.h> |
| 6 | #include "platformdefines.h" |
| 7 | |
| 8 | extern "C" DLL_EXPORT BOOL Marshal_Ansi(LPCSTR expected, LPSTR actual, LPCSTR newValue) |
| 9 | { |
| 10 | bool result = strcmp(expected, actual) == 0; |
| 11 | |
| 12 | strcpy_s(actual, strlen(actual), newValue); |
| 13 | |
| 14 | return result; |
| 15 | } |
| 16 | |
| 17 | extern "C" DLL_EXPORT BOOL Marshal_Unicode(LPCWSTR expected, LPWSTR actual, LPCWSTR newValue) |
| 18 | { |
| 19 | bool result = wcscmp(expected, actual) == 0; |
| 20 | |
| 21 | wcscpy_s(actual, wcslen(actual), newValue); |
| 22 | |
| 23 | return result; |
| 24 | } |
| 25 | |
| 26 | |
| 27 | extern "C" DLL_EXPORT BOOL Marshal_Invalid(LPCSTR value) |
| 28 | { |
| 29 | return FALSE; |
| 30 | } |
| 31 | |