Hello i have WCF Service and at some point of my program i am getting pointer to byte array. I want to copy bytes from this byte array/pointer to another byte array and send it to client.
// EDIT : THis code is TOTALLY wrong please see post under to see code and proper problem. Sorry for mistake.
byte arrbyt = new byte[params.ActualSize + 1];
int isize = Marshal.SizeOf(typeof(byte))*arrbyt.Length;
IntPtr pt = Marshal.AllocHGlobal(isize);
int ind = 0;
while (read != 0)
str.RemoteRead(out *(byte*)pt, size, out read);
Marshal.Copy(pt, arrbyt, 0, isize);
//after that arrbyt is still empty but pt has good values in it. I tryied also with stackalloc and then IntPtr to it and then Marshal.Copy but the result was the same.
//Does any one had similar problem or have an idea how to copy bytes from pt to other array?
//edit RemoteRead is like ISequentialStream::Read M
View Complete Post