Red Gate forums :: View topic - Pointers support
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
.NET Reflector 7 EAP
.NET Reflector 7 EAP forum

Pointers support

Search in .NET Reflector 7 EAP forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
alehandro



Joined: 16 Nov 2010
Posts: 35

PostPosted: Tue Jan 25, 2011 4:31 pm    Post subject: Pointers support Reply with quote

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
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Wed Jan 26, 2011 9:31 am    Post subject: Reply with quote

-> 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
View user's profile Send private message
alehandro



Joined: 16 Nov 2010
Posts: 35

PostPosted: Thu Jan 27, 2011 12:50 pm    Post subject: Reply with quote

Thank you
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. 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