Getting the address of a pointer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Nicholson

    #1

    Getting the address of a pointer

    I've got a suspicion that two user (and therefore threads) in an ASP.NET
    application are sharing the same pointers - which they shouldn't be! The
    easiest way for me to possibly debug this is to compare the addresses of the
    pointers but VB.NET has lost ObjPtr so this is a bit tricky.

    Is there a way to debug the address of a variable/pointers like this?

    Thanks, Rob.


  • Wei-Dong XU [MSFT]

    #2
    RE: Getting the address of a pointer

    Hi Rob,

    Currently I am finding one support professional for you on this issue. When
    any update, we will reply here at the first time.

    Best Regards,
    Wei-Dong XU
    Microsoft Product Support Services
    This posting is provided "AS IS" with no warranties, and confers no rights.
    It is my pleasure to be of assistance.

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Getting the address of a pointer

      Rob,

      "Rob Nicholson" <informed@commu nity.nospam> schrieb:[color=blue]
      > I've got a suspicion that two user (and therefore threads) in an ASP.NET
      > application are sharing the same pointers - which they shouldn't be! The
      > easiest way for me to possibly debug this is to compare the addresses of
      > the
      > pointers but VB.NET has lost ObjPtr so this is a bit tricky.[/color]

      What pointers are you talking about? Are you dealing with unmanaged code?

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Rob Nicholson

        #4
        Re: Getting the address of a pointer

        > Currently I am finding one support professional for you on this issue.
        When[color=blue]
        > any update, we will reply here at the first time.[/color]

        Hi - doesn't matter now thanks. I didn't need to print out the address in
        the end - that was just my "old ways" showing whereby looking at hex numbers
        to check pointers :-) I was able to simply "?Ptr1 is Ptr2" in the command
        window to achieve the same result.

        Thanks, Rob.


        Comment

        • Peter Huang [MSFT]

          #5
          Re: Getting the address of a pointer

          Hi Rob,

          As Herfried said, what do you mean by Ptr?
          If you mean the Object reference, in .NET we can use the
          Object.Referenc eEquals Method to determines whether the specified Object
          instances are the same instance.

          If I have any misunderstandin g, please feel free to post here.
          Best regards,

          Peter Huang
          Microsoft Online Partner Support

          Get Secure! - www.microsoft.com/security
          This posting is provided "AS IS" with no warranties, and confers no rights.

          Comment

          • Rob Nicholson

            #6
            Re: Getting the address of a pointer

            > What pointers are you talking about? Are you dealing with unmanaged code?

            The pointers that VB.NET uses all over the place. They might have a new
            fancy name, but they are pointers still when it comes down to it :-)

            Rob.


            Comment

            • Rob Nicholson

              #7
              Re: Getting the address of a pointer

              > The pointers that VB.NET uses all over the place. They might have a new[color=blue]
              > fancy name, but they are pointers still when it comes down to it :-)[/color]

              And before you say, I know they're not really pointers in the C++ sense of
              the word, i.e. a 32 bit variable that holds the address of something else,
              e.g. an object :-) But they still *work* like pointers/references. I assume
              under the hood they are indirect references to the actual object/memory to
              allow the garbage collector to move this around behind the scenes.

              Cheers, Rob.


              Comment

              • Peter Huang [MSFT]

                #8
                Re: Getting the address of a pointer

                Hi

                If so I think you means the reference in vb.net.
                Did my suggestion help you?

                e.g.
                Dim o1 as MyClass
                Dim o2 as New MyClass
                o1 = o2
                Object.Referenc eEquals(o1,o2) will be TRUE.


                Best regards,

                Peter Huang
                Microsoft Online Partner Support

                Get Secure! - www.microsoft.com/security
                This posting is provided "AS IS" with no warranties, and confers no rights.

                Comment

                • Rob Nicholson

                  #9
                  Re: Getting the address of a pointer

                  > If so I think you means the reference in vb.net.[color=blue]
                  > Did my suggestion help you?[/color]

                  Yes - but is "o1 is o2" then same?

                  Cheers, Rob.


                  Comment

                  • Herfried K. Wagner [MVP]

                    #10
                    Re: Getting the address of a pointer

                    "Rob Nicholson" <informed@commu nity.nospam> schrieb:[color=blue][color=green]
                    >> If so I think you means the reference in vb.net.
                    >> Did my suggestion help you?[/color]
                    >
                    > Yes - but is "o1 is o2" then same?[/color]

                    Yes.

                    --
                    M S Herfried K. Wagner
                    M V P <URL:http://dotnet.mvps.org/>
                    V B <URL:http://classicvb.org/petition/>

                    Comment

                    • Peter Huang [MSFT]

                      #11
                      RE: Getting the address of a pointer

                      Hi Rob,

                      If you still have any concern for this issue, please feel free to post here.

                      Best regards,

                      Peter Huang
                      Microsoft Online Partner Support

                      Get Secure! - www.microsoft.com/security
                      This posting is provided "AS IS" with no warranties, and confers no rights.

                      Comment

                      Working...