Hi, sorry for the C++ Q but this is something that I?m able to do in assembly but just can figure out how in C++.

I?m writing a small app that need to establish a system wide hook. I need a shareable section in the hook dll so that I can have a handful of values that remain consistent. This is very easy to do in FASM but I?ve no idea how to do it in VC.

Would someone here know how to do is, or perhaps have a simple work around? Oh BTW I do intend to rewrite in FASM so even a very hacky work around would do, I?m just prototyping in C++.
Posted on 2005-08-24 20:01:38 by Eóin
for Visual C++:

#pragma data_seg(".shared")    // Make a new section that we'll make shared
HHOOK g_hHook=0;                // HHOOK from SetWindowsHook
#pragma data_seg()

...then apply the correct linker switches to make the section sharable.
Posted on 2005-08-24 20:05:57 by f0dder
Thank you, worked like a charm :D .
Posted on 2005-08-25 12:08:33 by Eóin