From: Samuel B. <sam...@ur...> - 2003-12-29 16:23:18
|
Success! The GCC manual describes the following windows-specific feature on: http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Variable-Attributes.html. Defining int foobar __attribute__((section ("fooshare"), shared)) = 42; like that, the same value is shared by all instances of my DLL, no matter in which process context the module is run. Luke, thank you very much. Samuel > Try looking in the GCC manual for __attribute__((shared)) and also search > this mailing list for examples. > > Luke > > in a hook procedure called back by the system - in the context of the > > process that raised the respective event, however - I need to access > > values stored in the context of my own process. Someone advised me > > to use the following construction: > > > > #pragma data_seg("fooshare") > > __declspec(allocate("fooshare")) int foobar = 42; > > #pragma data_seg() > > #pragma comment(linker, "/SECTION:fooshare,RWS") > > > > With Visual C++ this works fine, with MinGW it does not. In fact, it's > > Microsoft specific. MinGW just warns me that it ignores 'allocate', and my > > process and the hooked process see different values. Can anybody give a > > hint, please? |