i am getting this error, on the conquer sx source
in this code and it highlights the part i have in red
can someone help
Code:
PInvokeStackImbalance was detected Message: A call to PInvoke function 'NewestCOServer!NewestCOServer.Native::memcpy' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
Code:
unsafe void WaitData(IAsyncResult Res)
{
try
{
StateObj S = (StateObj)Res.AsyncState;
SocketError SE;
try
{
if (S.Sock.Connected)
{
uint DataLen = (uint)S.Sock.EndReceive(Res, out SE);
if (SE == SocketError.Success && DataLen != 0)
{
byte[] RData = new byte[DataLen];
fixed (byte* p = RData, p2 = S.Data)
[COLOR="Red"]Native.memcpy(p, p2, DataLen);[/COLOR]
if (DataHandler != null)
DataHandler.Invoke(S, RData);
S.Sock.BeginReceive(S.Data, 0, 1024, SocketFlags.None, new AsyncCallback(WaitData), S);
}
else if (DCHandler != null)
DCHandler.Invoke(S);
}
else if (DCHandler != null)
DCHandler.Invoke(S);
}
catch
{
if (DCHandler != null)
DCHandler.Invoke(S);
}
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}