}
#endregion
+ #region "Helper"
+ // ************************************************************
+ // Returns the appropriate exit code
+ // *************************************************************
+ static int ExitTest()
+ {
+ if (fails == 0)
+ {
+ Console.WriteLine("PASS");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAIL - " + fails + " failure(s) occurred");
+ return 101;
+ }
+ }
+ #endregion
+
#region ReversePInvoke
public static string Call_DelMarshal_InOut(string s)
ReportFailure("Method ReverseP_MarshalStrB_InOut[Managed Side],return value is false");
}
#endregion
- return 100;
+ return ExitTest();
}
}
}
-typedef LPCTSTR (__stdcall * Test_DelMarshal_InOut)(/*[in]*/ LPCSTR s);
+typedef LPCWSTR (__stdcall * Test_DelMarshal_InOut)(/*[in]*/ LPCSTR s);
extern "C" DLL_EXPORT BOOL __cdecl RPinvoke_DelMarshal_InOut(Test_DelMarshal_InOut d, /*[in]*/ LPCSTR s)
{
- LPCTSTR str = d(s);
- const char *ret = "Return";
+ LPCWSTR str = d(s);
+ LPCWSTR ret = W("Return");
- size_t lenstr = _tcslen(str);
- size_t lenret = _tcslen(ret);
+ size_t lenstr = wcslen(str);
+ size_t lenret = wcslen(ret);
- if((lenret != lenstr)||(_tcsncmp(str,ret,lenstr)!=0))
+ if((lenret != lenstr)||(wcsncmp(str,ret,lenstr)!=0))
{
printf("Error in RPinvoke_DelMarshal_InOut, Returned value didn't match\n");
return FALSE;