R
Richard A. Lowe
I've seen a number of people mention potential problems with the
StructLayoutAttribute possibly causing problems and it came up again in Ray
Z's post titled "covert between byte[] and int[]" just a bit earlier in this
newsgroup. So in trying some funky things with StructLayout and FieldOffset
to get a solution to that problem, I wrote some code that should never see
the light of day, but that nonetheless causes a total abnormal end in my
simple example (short, complete console app example posted to my blog here:
http://blogs.geekdojo.net/richard/posts/262.aspx )
What this code does is use two classes and the StructLayoutAttribute to
'unnaturally' manipulate a byte[] to become an int[]. However, after
several iterations of the loop (20 in my case) where it's doing the same
thing the program exits without an exception. Obviously this code is
contrived and not the correct way to marshal this data around. Still I'd
like to know if this is a problem security or framework-wise, or just a
"don't do that".
Thanks,
Richard
StructLayoutAttribute possibly causing problems and it came up again in Ray
Z's post titled "covert between byte[] and int[]" just a bit earlier in this
newsgroup. So in trying some funky things with StructLayout and FieldOffset
to get a solution to that problem, I wrote some code that should never see
the light of day, but that nonetheless causes a total abnormal end in my
simple example (short, complete console app example posted to my blog here:
http://blogs.geekdojo.net/richard/posts/262.aspx )
What this code does is use two classes and the StructLayoutAttribute to
'unnaturally' manipulate a byte[] to become an int[]. However, after
several iterations of the loop (20 in my case) where it's doing the same
thing the program exits without an exception. Obviously this code is
contrived and not the correct way to marshal this data around. Still I'd
like to know if this is a problem security or framework-wise, or just a
"don't do that".
Thanks,
Richard