Wednesday, 15 May 2013

c++ - Using callback in exe between DLL instances -



c++ - Using callback in exe between DLL instances -

i've written c++ exe binds dll windows hooks, entails injecting instance of dll each process. have 1 exe, , 1 or more dll instances @ time.

i know in dll can utilize #pragma data_seg(...) , linker comment share info between dlls caveat may not share pointers way obvious reasons (dynamic memory addresses, pointer offsets etc)

however, might go in opposite direction? is, have callback function in exe dlls can invoke? theory beingness if can define function location 'fixed' in memory in exe, should safe dll instance phone call it?

is possible? i'm worried exe low level such approach.

if not, there mechanism can utilize share single callback function between multiple dll instances?

many thanks

no, cannot set function pointer shared segment. still accessing process-local memory address across process boundaries, , not good.

what can instead have exe set hwnd owns shared segment. hwnd can shared across process boundaries. way, multiple instances of dll can send message hwnd when needed, , exe can process messages sees fit do.

c++ winapi

No comments:

Post a Comment