Thanks,
Sela.
No, I don't think there is any API for that. What you can do is have
the creating process store the size at a known offset in the shared
memory so the second process can read it.
--
Scott McPhillips [MVP VC++]
Not really, but you might be able to make a good guess based on
VirtualQuery. It's better to either know that it's a fixed size or use
Scott's suggestion.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Hi,
The following weblinks will provide additional pointers
about Managing Memory-Mapped Files and memory limits:
http://msdn2.microsoft.com/en-us/library/ms810613.aspx
http://msdn2.microsoft.com/en-us/library/aa366778.aspx
Kellie.
"Sela" wrote:
Thanks for all the answers guys. I needed it to create a general purpose
class for shared memory, but if there's no way, there's no way.
"Sela" <Se...@discussions.microsoft.com> wrote in message
news:228E64C6-4151-4B1F...@microsoft.com...
"Arkady Frenkel" wrote:
That will take too long (CPU time that is). I'll just let my users know
about this problem via the class documentation and they'll decide them selves
the way to solve this problem that fits their application the most.
The size of shared object can be represented as DWORD written at the
begining of the file (in cases of big amount of data use QWORD). Each client
that wants to use shared memory objects reads that value, obtains offset to
the end of shared memory and then can write any data to it, of course client
should update the length after adding the data to file. Also, do not forget
about syncronization. Usually, named objects are used to syncronyze access
to MMF.
--
Vladimir, Windows SDK MVP
"Sela" <Se...@discussions.microsoft.com> wrote in message
news:740BFF5D-67BC-4B07...@microsoft.com...