shared data segment
-
Hi all, I have two dll 1)DLLHook- global hook dll 2)BHODLL- a BHO dll and a server application 3) DlgApp in DLL hook i have #pragma data_seg(".shared") map<_tstring,_tstring> g_map; // Other objects ##pragma comment(linker, "/section:.shared,RWS") In DlgAPP, I am inserting some values in map. Now I have to use these value in BHODLL. While I debug the BHO, i do not see and values in the map. As per my understanding the global data section will be avaible in all the process after installing hook.so the map should be avaible in BHO code. Is these possible? or I am doing something wrong? Thanks in advance. Regards Abhi Lahare
-
Hi all, I have two dll 1)DLLHook- global hook dll 2)BHODLL- a BHO dll and a server application 3) DlgApp in DLL hook i have #pragma data_seg(".shared") map<_tstring,_tstring> g_map; // Other objects ##pragma comment(linker, "/section:.shared,RWS") In DlgAPP, I am inserting some values in map. Now I have to use these value in BHODLL. While I debug the BHO, i do not see and values in the map. As per my understanding the global data section will be avaible in all the process after installing hook.so the map should be avaible in BHO code. Is these possible? or I am doing something wrong? Thanks in advance. Regards Abhi Lahare
That can not work. This is because a map is allocates memory on the heap which does not work using shared data segments because the heap is not part of the shared data segment. You need to use a structure that at compile time allocates the maximum storage necessary and does this in the shared data segment.
John
-
That can not work. This is because a map is allocates memory on the heap which does not work using shared data segments because the heap is not part of the shared data segment. You need to use a structure that at compile time allocates the maximum storage necessary and does this in the shared data segment.
John
Or create a memory mapped file and don't use a shared data segment at all...
Any sufficiently gross incompetence is nearly indistinguishable from malice.