Alexandre Julliard writes:
 > It probably doesn't work this way under NT no, since you cannot have a
 > shared area mapped at the same address in all processes on NT. And I'd
 > be tempted to say that this is a "feature" we don't want to support
 > either.

I have not been able to test this under NT yet, but have fond another
nasty "feature" and am not sure, if this is known:

The Office 97 applications create some anonymous shared file mappings 
with the SEC_RESERVE flag set, for exammple:

CreateFileMappingA (hFile=4294967295, sa=0x0, protect=67108868, 
    size_high=0, size_low=126972, name=0x40d10206 "Mso97SharedDg1921")

they later map the mapping into their address space, after that, the
following is in /proc/*/maps:

40dbe000-40ddd000 ---s 00000000 08:07 389100     /tmp/fileRpPI3I (deleted)

then they commit some part of that memory:

trace:virtual:VirtualAlloc 40dc0000 00001000 1000 00000004

/proc/*/maps looks now like this:

40dbe000-40dc0000 ---s 00000000 08:07 389100     /tmp/fileRpPI3I (deleted)
40dc0000-40dc1000 rw-s 00002000 08:07 389100     /tmp/fileRpPI3I (deleted)
40dc1000-40ddd000 ---s 00003000 08:07 389100     /tmp/fileRpPI3I (deleted)

Now, the bad thing is, that the same access permissions are expected
by any other office application, which is started after that. They
just map the mapping into their own address space and don`t call
VirtualAlloc, but access the region immediately. 

I have verified under win95, that this is possible. In fact, as soon
as pages are commited by one process, they are available to the
other processes, which have the same section mapped, too. 

 > If we really want to do this we could create a huge temp file, map it
 > into all processes on startup (praying that the mapping address we
 > choose is always free), and then put all shared allocations in there
 > with some kind of synchronization mechanism. And then of course any
 > application with a wild pointer will crash all the others, since there
 > is no longer any memory protection in the whole shared area.

Yes, like on windows. But how could this approach solve the second
problem?

Greetings, 

Peter

-- 
Peter Ganten
[EMAIL PROTECTED]

Reply via email to