MapViewOfFileEx(): Does porting an application to x64 require us to specify a different address (64-bit) for the argument lpBaseAddress?

  • Thread starter Thread starter Anurag_S_Sharma
  • Start date Start date
A

Anurag_S_Sharma

Guest
I'm in the process of porting an existing win32 application to x64. In one of the modules, I see a fixed based address passed to MapViewOfFileEx() as "lpBaseAddress" argument. The value passed is 0x20000000.

In one of the porting guidelines, I read that we should stay away from such "magic numbers" while porting to x64. But, the code using the base address 0x20000000 is a legacy one and is called from lots of other modules for shared memory allocation. So, I'm hesitant to change the value of this address while porting to x64.

I'd like to know if the code ported to x64 will work well with the same base address?

As a side note, I also see the current (x86) code links, ie invokes the linker with /base option value of 0x1C000000, ie -base:0x1C000000.

Does this have any relation to the valid value of base address we can request from MapViewOfFileEx()?

Any insight/ideas will be greatly appreciated.

Thanks,


--ANURAG.

Continue reading...
 
Back
Top