Click here to Skip to main content
15,921,531 members
Home / Discussions / C#
   

C#

 
QuestionHow to read a value in a memory address using c#? [modified] Pin
j69prx22-Jan-09 10:27
j69prx22-Jan-09 10:27 
AnswerRe: How to read a value in a memory address using c#! Pin
EliottA22-Jan-09 10:29
EliottA22-Jan-09 10:29 
GeneralRe: How to read a value in a memory address using c#! Pin
Pete O'Hanlon22-Jan-09 10:45
mvePete O'Hanlon22-Jan-09 10:45 
GeneralRe: How to read a value in a memory address using c#! Pin
EliottA22-Jan-09 10:46
EliottA22-Jan-09 10:46 
GeneralRe: How to read a value in a memory address using c#! Pin
Jon Rista22-Jan-09 10:59
Jon Rista22-Jan-09 10:59 
GeneralRe: How to read a value in a memory address using c#! Pin
Daniel Grunwald22-Jan-09 11:52
Daniel Grunwald22-Jan-09 11:52 
GeneralRe: How to read a value in a memory address using c#! Pin
Jon Rista22-Jan-09 15:34
Jon Rista22-Jan-09 15:34 
GeneralRe: How to read a value in a memory address using c#! Pin
Daniel Grunwald22-Jan-09 20:50
Daniel Grunwald22-Jan-09 20:50 
Do you have any references for that?

In my understanding, "int* IncrementPointer(int *p) { return p++; }" is a simple increment of the pointer, no runtime checks. It doesn't matter whether p points to unmanaged memory or a pinned object on the GC heap.
.NET doesn't even try to remember the 'valid range' - it's just a simple pointer!

Looking for 'unchecked' in the C# specification, it only talks about integer overflows. No mention of pointers there.

However, when you dereference an invalid pointer, you might get a nice managed exception. But that's just because .NET converts Win32 access violations to exceptions (to NullReferenceException if the pointer was near null, AccessViolationException otherweise). It is still possible to read invalid data/crash the process/whatever - they're unsafe pointers!
GeneralRe: How to read a value in a memory address using c#! Pin
Jon Rista23-Jan-09 4:38
Jon Rista23-Jan-09 4:38 
AnswerRe: How to read a value in a memory address using c#! Pin
Ennis Ray Lynch, Jr.22-Jan-09 10:36
Ennis Ray Lynch, Jr.22-Jan-09 10:36 
GeneralRe: How to read a value in a memory address using c#! Pin
PIEBALDconsult22-Jan-09 18:55
mvePIEBALDconsult22-Jan-09 18:55 
GeneralRe: How to read a value in a memory address using c#! Pin
Guffa22-Jan-09 20:07
Guffa22-Jan-09 20:07 
Questiondynamic drag and drop window component Pin
anishkannan22-Jan-09 6:56
anishkannan22-Jan-09 6:56 
AnswerRe: dynamic drag and drop window component Pin
Rutvik Dave22-Jan-09 8:19
professionalRutvik Dave22-Jan-09 8:19 
QuestionCreate textbox using array & insert the text box values into sqlserver database using c# Pin
ramya_jkumar22-Jan-09 6:53
ramya_jkumar22-Jan-09 6:53 
AnswerRe: Create textbox using array & insert the text box values into sqlserver database using c# Pin
Wendelius22-Jan-09 8:08
mentorWendelius22-Jan-09 8:08 
Questioncalculating slope of a line Pin
steini144122-Jan-09 6:29
steini144122-Jan-09 6:29 
AnswerRe: calculating slope of a line Pin
DaveyM6922-Jan-09 6:42
professionalDaveyM6922-Jan-09 6:42 
GeneralRe: calculating slope of a line Pin
PIEBALDconsult22-Jan-09 8:38
mvePIEBALDconsult22-Jan-09 8:38 
AnswerRe: calculating slope of a line Pin
PIEBALDconsult22-Jan-09 6:51
mvePIEBALDconsult22-Jan-09 6:51 
GeneralRe: calculating slope of a line Pin
steini144122-Jan-09 7:10
steini144122-Jan-09 7:10 
GeneralRe: calculating slope of a line Pin
PIEBALDconsult22-Jan-09 7:12
mvePIEBALDconsult22-Jan-09 7:12 
AnswerRe: calculating slope of a line Pin
Ennis Ray Lynch, Jr.22-Jan-09 7:04
Ennis Ray Lynch, Jr.22-Jan-09 7:04 
GeneralRe: calculating slope of a line Pin
PIEBALDconsult22-Jan-09 7:14
mvePIEBALDconsult22-Jan-09 7:14 
GeneralRe: calculating slope of a line Pin
steini144122-Jan-09 7:46
steini144122-Jan-09 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.