Author Topic: IPC between 32- and 64-bit apps using SendMessage  (Read 8583 times)

jj2007

  • Member
  • *****
  • Posts: 13274
  • Assembly is fun ;-)
    • MasmBasic
IPC between 32- and 64-bit apps using SendMessage
« on: March 20, 2013, 09:09:46 PM »
Since calling 32-bit dlls from the 64-bit world seems not to work, I tested IPC using RegisterWindowMessage and SendMessage. You can't use pointers, of course, but two dwords (or two REAL4) can in some cases be sufficient to tap a 32-bit library from a 64-bit app.

Results show that it's not a good solution for an innermost loop that runs a Million times: A single exchange of dwords takes roughly 10-30,000 cycles. Still, if some specific app ported from 32- to 64-bit depends on some exotic old 32-bit library, and speed is not an issue, it might be an option.

Attached three executables - extract to some folder and launch client.exe. The sources are also there, in an arc file with two PellesC projects and Client.asm (or Client.asc for those not scared of colours ;))
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.

qWord

  • Member
  • *****
  • Posts: 1475
  • The base type of a type is the type itself
    • SmplMath macros
Re: IPC between 32- and 64-bit apps using SendMessage
« Reply #1 on: March 21, 2013, 01:23:17 AM »
Which obscure packer do we need to unpack *.arc files? - zip files seems to be too trivial for that task.
MREAL macros - when you need floating point arithmetic while assembling!

frktons

  • Member
  • ****
  • Posts: 512
Re: IPC between 32- and 64-bit apps using SendMessage
« Reply #2 on: March 21, 2013, 01:35:20 AM »
Which obscure packer do we need to unpack *.arc files? - zip files seems to be too trivial for that task.
Try WinRAR.
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

anta40

  • Member
  • ***
  • Posts: 315
Re: IPC between 32- and 64-bit apps using SendMessage
« Reply #3 on: March 21, 2013, 01:36:04 AM »

frktons

  • Member
  • ****
  • Posts: 512
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

jj2007

  • Member
  • *****
  • Posts: 13274
  • Assembly is fun ;-)
    • MasmBasic
Re: IPC between 32- and 64-bit apps using SendMessage
« Reply #5 on: March 21, 2013, 01:51:53 AM »
Which obscure packer...

Simply the best - FreeArc

Ok, here is the version for the WinZip fans ;-)
Masm32 Tips, Tricks and Traps

Some members can't live without insulting others. It tells us a lot about them.