[Win32utils-devel] Need some help with latest win32-mmap

Berger, Daniel Daniel.Berger at qwest.com
Wed Oct 11 11:06:06 EDT 2006

> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org 
> [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of 
> Johan Nilsson
> Sent: Wednesday, October 11, 2006 1:13 AM
> To: Development and ideas for win32utils projects
> Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap


> > 
> > In other news, it looks like I need to set a default size for 
> > MMap.open.
> > What sounds reasonabl? 1k?
> I haven't tried this myself, and judging from the MSDN docs it's also
> not entirely clear that it will work, but: Try using zero(0) 
> as the size
> when calling MapViewOfFile, and then use VirtualQuery to retrieve the
> size of the view.

Actually, I changed MMap.open to accept a hash of options that's simply
forwarded on to MMap.new (though the name is still a required argument),
so you can specify the size that way.  However, I think you're right
and, if it's possible, I'll do a VirtualQuery() to try to get the size
of the view when MMap.open is used if a size isn't specified explicitly.
That seems like a much friendlier way to go. :)

> If you want to persist the values, use a file as the backing store
> (could be an optional feature, e.g. :name => '/path/to/filename' ).

Well, there is a separate :file option.  I'm not sure I want to try to
guess whether :name refers to a file or not.  Or have I misunderstood?
> Oh, and use the "Global\" prefix for map names if you intend to share
> the data between different terminal server sessions (Win2k 
> and upwards).
> But I guess you already do that internally.

It will be up to the programmer to know details like that for the :name
option, though I can copy/paste the relevant section out of the MSDN

Thanks for the feedback.

- Dan

This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

More information about the win32utils-devel mailing list