News:

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

Main Menu

Sharing data between dll and our process

Started by avcaballero, November 18, 2015, 08:15:29 PM

Previous topic - Next topic

avcaballero

Hello, I am dealing with dll examples and I have a trouble with sharing data between dll and my process. I have avoiding the problems as the encapsulating OOP, calling a routine in the dll that tells us the value of this variable. But I know there are ways to doing it using dll options, etc. (asm and c concerning) but for the moment I'm stuck and I have no much time, so if anyone wants to help    :P

jj2007

Build as DLL:
include \masm32\include\masm32rt.inc

ShareLen=256*1024 ; 256k

MyData segment shared 'bss'
OneDay LABEL BYTE
  ORG $+ShareLen-1
  db ?
MyData ends

.code
GetPtr2SharedMem proc ; $export
  mov eax, offset OneDay
  retn
GetPtr2SharedMem endp

LibMain proc instance:DWORD, reason:DWORD, unused:DWORD
    m2m eax, TRUE
    ret
LibMain endp

end LibMain


Sources attached.

avcaballero