- How can i get HANDLE to the memory region or mapped file ?
- What actually HANDLE is ?
Please do not answer like this :
A handle is an abstract reference to some resourc,e provided to you by another party (usually the OS), that you can hand back to reference that resource.
I'm interested in technical side
A
HANDLEis just some arbitrary nugget to some data.For example, it's returned by the following APIs:
CreateFile()andOpenProcess()- as you can tell, these two are very different, yet return the exact same data-type.Or for memory, you can get access to the heap (which is returned as a
HANDLEfromGetProcessHeap()) and then useHeapAlloc()against it.As MSDN points out, it's used in many other contexts:
http://msdn.microsoft.com/en-us/library/windows/apps/ms724211%28v=vs.85%29.aspx