Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Also, is it not possible to simply use pointers to some memory freely without having Windows allocate it first? What would the side-effects be?</p> </blockquote> <p>The side effects are simple: your application would crash.</p> <p>Windows (and every other sane OS) uses virtual memory: the OS maps physical memory into the virtual address space that your process sees. And it performs this mapping on demand: when you ask it to allocate a block of memory, it maps a corresponding range of virtual memory addresses to a valid chunk of memory.</p> <p>Writing to an arbitrary address means you'll hit a memory page that has not been mapped by the OS to any backing memory. Then you'll get an access violation (or segmentation fault on *nix)</p> <blockquote> <p>Is there a fixed position in memory for DLL files</p> </blockquote> <p>Nope. How could there be? If you had <em>one</em> DLL file, it could be done. What if your application loads two DLLs? What if it loads 40? 400? And each DLL has a different size, so if they were loaded into fixed locations, they might end up overlapping.</p> <p>On top of this, recent versions of Windows perform address space randomization: to mitigate certain security exploits, Windows tries to ensure that it loads DLLs and executables to <em>different</em> locations if you launch the application multiple times.</p> <p>In short: your process runs under Windows. It is a Windows citizen and has to obey Windows laws. If it needs to access a resource (including, but not limited to, memory), it has to ask Windows to please make that resource available.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload