473,796 Members | 2,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SharedMemory Base address mapping

Hi

I wonder... Is it possible to define the address to which shared memory will be mapped
In other words is it possible to apriory define the address MapViewOfFile returns
Dlls are being loaded and relocated on the relocation table during Process Creation, is it possible to use/manipulate this mechanism somehow...

Nadav.
Nov 17 '05 #1
3 1636
"Nadav" <an*******@disc ussions.microso ft.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
I wonder... Is it possible to define the address to which shared memory will be mapped? In other words is it possible to apriory define the address MapViewOfFile returns? Dlls are being loaded and relocated on the relocation table during Process

Creation, is it possible to use/manipulate this mechanism somehow... ?

Check the docs for MapViewOfFileEx () to see if it will do what you want.

Note that in general, because a virtual address is available in one process
you can not make any claim about the same address in other.

Regards,
Will
Nov 17 '05 #2
Hi William

Thanks for your reply, I wonder... Concerning the shared mem mapping is the first thing I do on process startup, doesn't existing memory layout of multiple process may include cases where no two processes may have the same memory block mapped to the same address, e.g. a memory block of about 0.25GB is about to be mapped to the same address of several process ( using MapViewOfFileEx ), is it possible that no continues memory block at the same address ( in each process ) can be found for all process, what is the feasibility for such a scenario? I guess I would have to implement some hand-shake mechanism to achieve this task ( in case it is feasible )..

Nadav

Nov 17 '05 #3
"Nadav" <an*******@disc ussions.microso ft.com> wrote in message
news:17******** *************** ***********@mic rosoft.com...
Thanks for your reply,
You are welcome.
I wonder... Concerning the shared mem mapping is
the first thing I do on process startup, doesn't
existing memory layout of multiple process may
include cases where no two processes may have
the same memory block mapped to the same
address, e.g. a memory block of about 0.25GB is
about to be mapped to the same address of several
process ( using MapViewOfFileEx ), is it possible
that no continues memory block at the same address
( in each process ) can be found for all process, what
is the feasibility for such a scenario?
I should have been clearer but yes, it is possible that two processes may
not be able to share the same sized block at a common "virtual address". The
point is that the mapping is "per-process". Unlike the case on 9x, it is a
process' view of the shared memory which is associated with an address. On
9x, the shared memory block itself is associated with the shared address.
I guess I would have to implement some hand-shake
mechanism to achieve this task ( in case it is feasible )...


Yes, you could do that.

I would, however, suggest that you not store pointers in the shared memory.
That's because unless those pointers reference locations in the shared
memory, they are invalid outside of the process that "created" them. In
other words, you can only share references to what is truly shared. :-) So,
if you find a need to share pointers you would store offsets from the start
of the shared memory instead. In that way, each of the processes mapping the
memory could map at any convenient address.

Regards,
Will
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1577
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema' referenced in this document. The value for the 'base' attribute is invalid - 'xsd:string' is an invalid value for the 'base' attribute. An error occured at the file:///C:Program Files/Microsoft Visual Studio .NET 2003...
8
3081
by: TS | last post by:
I am trying to get set a property of a control on the inherited class from base class. I imagine i have to use reflection, so could someone give me the code to do it? something like this? this.GetType().GetMember("panel1").SetValue(xx).Left = 44;
1
2325
by: Steve Guidos | last post by:
We are writing a set of Windows Services using C#.NET that will run on the same server. One of the developers here said that we should assign each service its own Base Address using the Properties page, so that the services won't conflict with each other. I cannot seem to find any information about when to set the Base Address or what its practical effect would be. My impression is that the BaseAddress is just a "suggested" base address,...
5
1962
by: Michael | last post by:
Hi, Could you tell me whether the following two statement are the same? Derived class is derived from Base class. 1. Base* ptr1; 2. Derived * ptr2; Does it mean ptr1 is the same as ptr2?
3
1231
by: Jim Langston | last post by:
I am attempting to map the variables in a class or structure to use with MySQL. I got something to work but I'm not happy with it. Here is a snippet showing what I'm not happy with: class COffsetMap { public: COffsetMap() {} virtual ~COffsetMap() {} void SetBase( void* Base ) { Base_ = reinterpret_cast<char*>( Base ); }
32
2186
by: moleskyca1 | last post by:
This may be stupid question, but why is sizeof(Base) == 1 in: int main(int argc, char* argv) { class Base { }; cout << sizeof(Base) << endl; return 0; }
3
8443
by: Newish | last post by:
Hi Regarding DLL base address: 1) What does it mean? 2) Should it ever be changed? 3) What are the rules to change it?
5
2576
by: alan | last post by:
Hello world, I'm wondering if it's possible to implement some sort of class/object that can perform mapping from class types to strings? I will know the class type at compile time, like so: const char *s = string_mapper<thetype>(); However I do not know the string to be associated with the type at compile time, and will need a way to set up the mapping, to be created at run time, possibly like so: void foo(char*...
0
1320
by: =?Utf-8?B?Zmplcm9uaW1v?= | last post by:
Hi all, As I mentioned in a previous thread (see 'Dbghelp, symbols and templates' in microsoft.public.windbg), we created a powerful symbol engine using dbghelp to dump the contents of the stack symbols when an exception occurs. The engine is able to dereference and process UDT symbols up to their highest base class. It also supports multiple inheritance. However, we are having trouble with virtual inheritance. Documentation is very...
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.