flat assembler
Message board for the users of flat assembler.
Index
> Main > Mixing 32/64-bit DLLs under 64-bit OS |
Author |
|
Madis731 30 Oct 2007, 09:17
Hi,
This is a help-seeking thread. As you know its *impossible* to access 32-bit DLLs with a 64-bit app and vice versa. As assembly programmers you also know why http://www.intel.com/cd/ids/developer/asmo-na/eng/microprocessors/itanium/optimization/19109.htm Intel is only one answer that I found, but 90% say COM is the way to go. Accessing DLL results from a file (that is inter-architectural) is not an option because all of the caches and HDD speed and API overhead, that might make simple queries into "millisecond hell". I had an idea to pass info through registry, but its slow too. And slow is not always the first excuse. Clumsy :S I might say. There's one more way, that I've considered - the web - basically some TCP packages. WHY? Lets say you have two closed source DLLs - one of them 32-bit, other 64. You NEED to use them in your project and their creators' e-mails are down What I'm hoping to do is use some mechanism to copy all the valuable data from a 32-bit DLL to a "shadow" 64-bit DLL. Maybe there are even tools for that I haven't found yet. There's FASM\EXAMPLES\DLL\ERRORMSG.ASM for starting. Tell me if you have any ideas. 64APP => calls 64DLL("shadow") would be the best, but 64APP => calls 64DLL => maybe a conversion here => re-calls 32DLL with the parameters Thank You in advance, Madis |
|||
30 Oct 2007, 09:17 |
|
Madis731 30 Oct 2007, 11:25
Yup - IPC - but the problem is 32/64 boundary :S they can't have access to each-others' process space. One is 32 and the other - logically 64 bits
|
|||
30 Oct 2007, 11:25 |
|
f0dder 30 Oct 2007, 11:29
32- and 64-bit app can still surely talk to eachother via pipes/sockets/etc, though? Yeah, you probably can't just set up a named memory mapped file and access that (try, though? ), hence the marshaling of data through your pipe/socket/whatever.
Yes, it does mean a speed hit and annoying code... COM might be the answer to avoid writing marshaling code yourself, although I dunno what it has to say about 32<>64. |
|||
30 Oct 2007, 11:29 |
|
LocoDelAssembly 30 Oct 2007, 15:55
Hey, why shared memory can't be used? I think that it would be just a matter of size limits between them but every process has its own page table and hence every process maps a memory region at the virtual addresses them want.
|
|||
30 Oct 2007, 15:55 |
|
Madis731 06 Nov 2007, 14:23
I'm half-way marshaling events through WM_COPYDATA messages. The only problem is that event gets delivered and message properties, but not the message itself :S
Ref#1= http://msdn2.microsoft.com/en-us/library/ms649009.aspx Couldn't understand Ref#2 quite well: http://docs.hp.com/en/5966-9844/ch02s08.html maybe its HP only ^o) I've been extremely busy, but I'll try to put up some samples in the near days... EDIT: ...thankfully there are weekends I'll attach a 7z file and some instructions follow: DIALOG64 should be the one sending messages, but the message written isn't sent right now. RECEIVE32 should take the message and do sth with it and then sending sth else back. Now it only prints the .dwData which shouldn't be a string at all, but a DWORD value. .lpData seems to be pointing *somewhere*, but its empty. .cbData is lost Can anyone point me to an error or misleading documentation perhaps...!? Thx, Madis
|
|||||||||||
06 Nov 2007, 14:23 |
|
Madis731 07 Jan 2008, 08:46
Dropped WM_COPYDATA completely. Pipes worked. I already gave an answer on another thread: http://board.flatassembler.net/topic.php?t=7877
|
|||||||||||
07 Jan 2008, 08:46 |
|
f0dder 24 Jan 2008, 12:20
Memory mapping works as well, no problems across 32/64bit processes. Tested on XP64.
_________________ - carpe noctem |
|||||||||||
24 Jan 2008, 12:20 |
|
Madis731 25 Jan 2008, 19:26
Wow, thx man I don't know where did I go wrong... but now I know
I guess because its so simple its awfully faster than pipes too. |
|||
25 Jan 2008, 19:26 |
|
f0dder 26 Jan 2008, 01:20
Madis731 wrote: Wow, thx man I don't know where did I go wrong... but now I know It's the fastest form of IPC you can do, since there's no kernel detours involved once the mapping is established - you share the same physical memory, even if the virtual addresses are different. Of course you still need to find a way to synchronize access, but I'll leave that pain to you _________________ - carpe noctem |
|||
26 Jan 2008, 01:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.