| Author |
Message |
alehandro
Joined: 16 Nov 2010 Posts: 35
|
Posted: Tue Jan 25, 2011 4:31 pm Post subject: Pointers support |
|
|
Hi
does Reflector 7 support pointers? (ie unsafe types)
I'm asking because instead of pointers (->) I see the points (.)
Example:
public struct struct012c
{
public const int f00002e = 0x80;
public const int f00000f = 280;
public uint f00003f;
public uint f000040;
public uint f000031;
public enum0128 f00021a;
public unsafe struct0125* f000225;
public uint f000034;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=0x80, ArraySubType=UnmanagedType.U2)]
public char[] f0001e7;
}
and here is the usage (wrong):
public static unsafe int m000152(IntPtr A_0, uint A_1, delegate012e A_2, enum0130 A_3)
{
int num2;
int cb = sizeof(struct0125) + 0x10000;
IntPtr hglobal = Marshal.AllocHGlobal(cb);
try
{
struct012c structc;
structc = new struct012c {
f0001e7 = new char[0x80],
f00003f = (uint) Marshal.SizeOf(structc),
f000031 = A_1,
f000225 = (struct0125*) hglobal
};
structc.f000225.f000112 = (ushort) A_1;
structc.f000034 = (uint) cb;
num2 = acmFormatEnum(A_0, ref structc, A_2, IntPtr.Zero, A_3);
}
finally
{
Marshal.FreeHGlobal(hglobal);
}
return num2;
}
Please comment |
|
| Back to top |
|
 |
Clive Tong
Joined: 04 Dec 2008 Posts: 281
|
Posted: Wed Jan 26, 2011 9:31 am Post subject: |
|
|
-> seems to be used correctly in some circumstances.
For example, in the following,
| Code: |
public struct Foo
{
public unsafe Foo* x;
public int y;
}
static void Main(string[] args)
{
unsafe
{
Foo foo = new Foo();
int xx = foo.x->y;
Foo* bar = &foo;
int yy = bar->x->y;
}
}
|
Reflector uses -> for the top level indirections.
| Code: |
Foo foo = new Foo();
int y = foo.x.y;
Foo* fooPtr = &foo;
int num2 = fooPtr->x.y;
|
I've logged it as RP-947. |
|
| Back to top |
|
 |
alehandro
Joined: 16 Nov 2010 Posts: 35
|
Posted: Thu Jan 27, 2011 12:50 pm Post subject: |
|
|
| Thank you |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group