NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: avcaballero on November 18, 2015, 04:38:30 PM

Title: Sharing data in dll with nasmx and golink
Post by: avcaballero on November 18, 2015, 04:38:30 PM
Hello, I'm dealing with dlls. I stuck sharing data between dll and my process. I have done that using something similar to encapsulation on oop, creating a function in the dll we can call from our process and that tell us what is its value. Nevertheless I'd like to share data, using any switch in the dll. Any help, please?
Title: Re: Sharing data in dll with nasmx and golink
Post by: Bryant Keller on February 12, 2016, 06:40:46 PM
You should be able to share variables in exactly the same way you share procedures. Using the EXPORT directive (or /export command for Golink) when linking your DLL. I think the reason this gets confusing is because of Microsoft's naming convention for GetProcAddress.. that's not "Get Procedure Address" (as it's usually interpreted) instead it's actually "Get Process Address".. Microsoft defines its purpose as "Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL)." The bold section is important to remember. If you're using GoLink, I suggest taking a look at this page (http://www.godevtool.com/GolinkHelp/GoLink.htm#impexp).

HtH,
~Bryant