News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

api functions that use addresses in 64bit programs

Started by jimg, April 04, 2018, 03:28:49 AM

Previous topic - Next topic

jimg

I'm working on a 32-bit program that will also run on 64-bit windows.

If I ask for memory in a 64-bit process using VirtualAllocEx, it only returns a 32bit address.

If I send a message to a control in the 64-bit process that requires an address, isn't it expecting a 64bit address?

If so, where do I get the upper part of the address.

hutch--

Jim,

The two systems are not compatible, 32 bit is size limited by the DWORD range, 64 bit has QWORD range. You can communicate between 32 and 64 bit processes but its done with messaging and inter process communication like memory mapped files, there is no direct data transfer between them.


sinsi

32 bit addresses are still valid in 64-bit processes, just that the upper 32 bits are all 0.
Using VirtualAllocEx in a 32-bit process to allocate memory in a 64-bit process will give you valid memory, just in the lower 4GB.