Getting the address of a pointer

  • Thread starter Thread starter Rob Nicholson
  • Start date Start date
R

Rob Nicholson

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.
 
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.
 
Rob,

Rob Nicholson said:
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.

What pointers are you talking about? Are you dealing with unmanaged code?
 
Currently I am finding one support professional for you on this issue.
When
any update, we will reply here at the first time.

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.
 
Hi Rob,

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

If I have any misunderstanding, 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.
 
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.
 
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 :-)

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.
 
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.ReferenceEquals(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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top