🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16476

Shared memory question

#16476
From: MWP
Date: Wed, 14 May 2003 08:43
10 lines
1431 bytes
Hi all,

Im using:
SharedMem = CreateFileMapping(INVALID_HANDLE_VALUE, &SA_ShMem, PAGE_READWRITE, 0, sizeof(_Shared), "$Monitor-Data$");
Shared = (_Shared*)MapViewOfFile(SharedMem, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(_Shared));

To share some memory that is to be used by other applications.
Is there a way to share the memory, but to make it read-only to other processes?
Setting read-only flags in the above code also stops the local process from being able to write to it.
Technical Details
Message-ID: <3ec201ad$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e0ac8188bda6f9e,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-14 01:48:07 PST
From: "MWP" <mwp@overclockers.com.au>
Sender: "MWP" <mwp@overclockers.com.au>
Reply-To: "MWP" <mwp@overclockers.com.au>
Subject: Shared memory question
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 203.16.214.242 203.16.214.242    
X-Forwarded-For: unknown, 150.101.76.247
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3ec201ad$1@newsgroups.borland.com>
Date: 14 May 2003 01:43:25 -0700
X-Trace: newsgroups.borland.com 1052901805 207.105.83.65 (14 May 2003 01:43:25 -0700)
Lines: 10
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail