🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Memory mapped files in a Service

#163
From: Mike Collins
Date: Sun, 29 Jun 2008 01:18
44 lines
2466 bytes
Hay Colin, most of what i know is based on what remy has told me on this 
forum, but here goes...

> BTW: does Windows 2K < include Windows 2K or just NT/9x.

 - this includes Win2K - Global\\ is not valid on 2k

> The fact is that all objects are created without error.
> However when you open the named object it simply says
> file not found.

- Yep, the objects will be created without error - this does not mean that 
they are *visible* from outside the session that they are created in

> Open file mapping ...
> .... File Not found.

- this pretty much confirms what we're saying...

> What does ProcExplorer.exe show up as the file map name?
> Have to double check this....

- ProcExplorer is a god-send... Check it out from SysInternals...

>      mmHandle = CreateFileMapping((HANDLE) 0xFFFFFFFF,
>                  &sa, PAGE_READWRITE, 0, mmSize, __TEXT(mmName));

- does your mmName contain the "Global\\" prefix?  if not, include it, 
perminantly and see what you get - if works for me...


>    hFileMapT = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE,
>       FALSE, __TEXT(mmName));

- Like wise, make sure mmName here also contains the "Global\\" prefix.

Another point worth mentioning is that you should, depending on what you are 
doing with your MMF, protect access to it using a mutex, because there is 
the possibility that you *server Sis writting to the MMF, while yout 
*client* is trying to access it...

HTH

Mike C
Technical Details
Message-ID: <4866d229@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <48637046$1@newsgroups.borland.com> <4863ab8c$1@newsgroups.borland.com> <48662A60.3060605@myhost.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ef43529cc999a6b2
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@TheBottomOfThePost>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <48637046$1@newsgroups.borland.com> <4863ab8c$1@newsgroups.borland.com> <48662A60.3060605@myhost.com>
Subject: Re: Memory mapped files in a Service
Date: Sun, 29 Jun 2008 01:18:44 -0000
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
NNTP-Posting-Host: 89.241.117.34
Message-ID: <4866d229@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1214698025 89.241.117.34 (28 Jun 2008 17:07:05 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail