template<>
bool IsObjectEquals(LPCSTR o1, LPCSTR o2)
{
- int cLen1 = strlen(o1);
- int cLen2 = strlen(o2);
+ size_t cLen1 = strlen(o1);
+ size_t cLen2 = strlen(o2);
if (cLen1 != cLen2 )
{
using System.Threading;
using System.Globalization;
using System.Runtime.InteropServices;
+#pragma warning disable 618
public partial class FunctionPtr
{
Console.WriteLine("Simple method to get a delegate for");
}
}
+#pragma warning restore 618
\ No newline at end of file
using System.Threading;
using System.Globalization;
using System.Runtime.InteropServices;
-
+#pragma warning disable 618
public partial class FunctionPtr
{
delegate void VoidDelegate();
return retVal;
}
-}
\ No newline at end of file
+}
+#pragma warning restore 618
\ No newline at end of file
using System;
using System.Security;
using System.Runtime.InteropServices;
+#pragma warning disable 618
partial class FunctionPtr
{
if (l != 999999999999)
throw new Exception("Failed multicast call");
}
-}
\ No newline at end of file
+}
+#pragma warning restore 618
\ No newline at end of file
using System.Reflection;
using System.Runtime.InteropServices;
using CoreFXTestLibrary;
+#pragma warning disable 618
public class GetObjectForNativeVariantTest
{
return 100;
}
}
+#pragma warning restore 618
\ No newline at end of file
using System.Reflection;
using System.Runtime.InteropServices;
using CoreFXTestLibrary;
-
+#pragma warning disable 618
public class GetObjectsForNativeVariantsTest
{
[StructLayout(LayoutKind.Sequential)]
return 100;
}
}
+#pragma warning restore 618
\ No newline at end of file
using System.Collections.Generic;
using CoreFXTestLibrary;
+#pragma warning disable 618
+
public class TestClass
{
public int value;
public void GetComInterfaceForObjectTest()
{
- //test null
- IntPtr nullPtr = Marshal.GetComInterfaceForObject(null, typeof(object));
+
+ //test null
+ IntPtr nullPtr = Marshal.GetComInterfaceForObject(null, typeof(object));
if (nullPtr != IntPtr.Zero)
throw new Exception("A valid ptr was returned for null object.");
}
}
+#pragma warning restore 618
#include <stdio.h>
#include <stdlib.h>
-int LEN = 10;
+size_t LEN = 10;
extern "C" BOOL DLL_EXPORT _cdecl MarshalRefCharArray_Cdecl(char ** pstr)
{
//Check the Input
public static Sstr_simple DoCdeclSimpleStruct(Sstr_simple p, ref bool retval)
{
IntPtr st = CdeclSimpleStruct(p, ref retval);
- Sstr_simple simple = (Sstr_simple)Marshal.PtrToStructure(st, typeof(Sstr_simple));
+ Sstr_simple simple = Marshal.PtrToStructure<Sstr_simple>(st);
return simple;
}
public static ExplStruct DoCdeclSimpleExplStruct(ExplStruct p, ref bool retval)
{
IntPtr st = CdeclSimpleExplStruct(p, ref retval);
- ExplStruct simple = (ExplStruct)Marshal.PtrToStructure(st, typeof(ExplStruct));
+ ExplStruct simple = Marshal.PtrToStructure<ExplStruct>(st);
return simple;
}
CdeclSimpleStructDelegate std = GetFptrCdeclSimpleStruct(16);
IntPtr st = std(simple, ref retval);
- simple = (Sstr_simple)Marshal.PtrToStructure(st, typeof(Sstr_simple));
+ simple = Marshal.PtrToStructure<Sstr_simple>(st);
if (retval == false)
CdeclSimpleExplStructDelegate std = GetFptrCdeclSimpleExplStruct(20);
IntPtr st = std(p, ref retval);
- p = (ExplStruct)Marshal.PtrToStructure(st, typeof(ExplStruct));
+ p = Marshal.PtrToStructure<ExplStruct>(st);
if (retval == false)
{
retVal = retVal && PosTest1();
retVal = retVal && PosTest2();
retVal = retVal && PosTest3();
- retVal = retVal && PosTest4();
+
+ // https://github.com/dotnet/coreclr/issues/4193
+ // retVal = retVal && PosTest4();
if (!retVal)
Console.WriteLine("FAIL");
{
printf("Error in Function MarshalPointer_InOut\n");
- for(int i = 0; i< lenstrManaged;++i)
+ for(size_t i = 0; i< lenstrManaged;++i)
putchar(*(((char *)strManaged)+i));
- for( int j = 0; j < len; ++j)
+ for( size_t j = 0; j < len; ++j)
putchar(*(((char *)*s) + j));
return ReturnErrorString();
extern "C" DLL_EXPORT int __cdecl Writeline(char * pFormat, int i, char c, double d, short s, unsigned u)
{
int sum = i;
- for (size_t i = 0; i < strlen(pFormat); i++)
+ for (size_t it = 0; it < strlen(pFormat); it++)
{
sum += (int)(*pFormat);
}
extern "C" DLL_EXPORT BOOL __cdecl RPinvoke_DelMarshal_InOut(Test_DelMarshal_InOut d, /*[in]*/ LPCSTR s)
{
LPCTSTR str = d(s);
- LPTSTR ret = (LPTSTR)W("Return");
+ const char *ret = "Return";
size_t lenstr = _tcslen(str);
size_t lenret = _tcslen(ret);
JIT/Methodical/Boxing/xlang/_relsin_cs_il/_relsin_cs_il.sh
JIT/Methodical/localloc/call/call01_small/call01_small.sh
JIT/Regression/Dev11/External/dev11_145295/CSharpPart/CSharpPart.sh
-Interop/SimpleStruct/SimpleStruct/SimpleStruct.sh
Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutExp/MarshalStructAsLayoutExp.sh
Interop/StructMarshalling/PInvoke/MarshalStructAsLayoutSeq/MarshalStructAsLayoutSeq.sh
Interop/ArrayMarshalling/ByValArray/MarshalArrayByValTest/MarshalArrayByValTest.sh