Is this list correct?
unsigned int(c) -> uint(c#) const char*(c) -> String(c#) unsigned int*(c) -> uint[](c#) unsigned char*(c) -> byte[](c#)
I think there's a mistake here because with these 4 parameters for native function I have PInvokeStackImbalance.
C function is:
bool something
(unsigned char *a,
unsigned int a_length,
unsigned char *b,
unsigned int *b_length);
PInvoke is:
[DllImport(@"lib.dll", EntryPoint = "something")]<br>
public static extern bool something(
byte[] a,
uint a_length,
byte[] b,
uint[] b_length);
MarshalAs(UnmanagedType.LPStr)attribute), but you should make sure that last two parameters are actually arrays and not simply references (because you will have to know array sizes in order to allocate them on the managed size, before marshaling). Posting both signatures and explaining what the method does will help a lot.