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
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.
Much apreciated, JJ, you're an eagle :t