Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What "mapping" is all about?

What "mapping" is all about?

Scheduled Pinned Locked Moved C / C++ / MFC
questionperformancelounge
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LiYS
    wrote on last edited by
    #1

    Hi all: I've heard a lot terms which talks about "mapping", but my question is in the case of dll mapping what the heck “mapping” means here? My guess in general in this scenario is that, OS first load the dll from disk to memory, and this way makes the dll has addresses, and when an executable wants to use this dll, the OS simply make a address translation mechanism in which by using the specific address contained inside executable address space itself this dll can be accessed or called, it is just a process of address translation from address in executable to dll address. If this assumption is true, how about dynamic loading, what happened to GetProcAddress()? Just get a address inside executable? And I believe this assumption applies to all the situations that I can think of in which "mapping" is involved.


    G 1 Reply Last reply
    0
    • L LiYS

      Hi all: I've heard a lot terms which talks about "mapping", but my question is in the case of dll mapping what the heck “mapping” means here? My guess in general in this scenario is that, OS first load the dll from disk to memory, and this way makes the dll has addresses, and when an executable wants to use this dll, the OS simply make a address translation mechanism in which by using the specific address contained inside executable address space itself this dll can be accessed or called, it is just a process of address translation from address in executable to dll address. If this assumption is true, how about dynamic loading, what happened to GetProcAddress()? Just get a address inside executable? And I believe this assumption applies to all the situations that I can think of in which "mapping" is involved.


      G Offline
      G Offline
      GuyM
      wrote on last edited by
      #2

      What exactly is your question ... ?? :confused:

      L 1 Reply Last reply
      0
      • G GuyM

        What exactly is your question ... ?? :confused:

        L Offline
        L Offline
        LiYS
        wrote on last edited by
        #3

        Sorry, if the question is unclear, Just to reiterate, in short what "address mapping" means and does my previous assumption about it right.


        G 1 Reply Last reply
        0
        • L LiYS

          Sorry, if the question is unclear, Just to reiterate, in short what "address mapping" means and does my previous assumption about it right.


          G Offline
          G Offline
          GuyM
          wrote on last edited by
          #4

          Your assumption is correct. This is what happens when an executable calls a function from a DLL directly. With "GetProcAddress()", the DLL is loaded to memory (and mapped to addresses) when you call "LoadLibrary()". After the DLL is mapped, the call to "GetProcAddress()" will return the address that is mapped to that specific function. Hope this answers your question ... :)

          L 1 Reply Last reply
          0
          • G GuyM

            Your assumption is correct. This is what happens when an executable calls a function from a DLL directly. With "GetProcAddress()", the DLL is loaded to memory (and mapped to addresses) when you call "LoadLibrary()". After the DLL is mapped, the call to "GetProcAddress()" will return the address that is mapped to that specific function. Hope this answers your question ... :)

            L Offline
            L Offline
            LiYS
            wrote on last edited by
            #5

            Thanks for the reply, So, there's a address translation involved. From exe address space to the dll address space. I wonder is there any "official" reference?


            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups