c++看dynamic linking的 module define format:
1 LIBRARY GlobalHookDll //dll名称
2 EXPORTS
3 SetHook @3
4 SEGMENTS //共享memory段
5 .MySec READ WRITE SHARED
2 EXPORTS
3 SetHook @3
4 SEGMENTS //共享memory段
5 .MySec READ WRITE SHARED
等价于下面:
//use share memory
#pragma data_seg(".MySec") //the name of setion's length must less than 8
HWND g_hWnd = NULL;
#pragma data_seg()
/*#pragma comment(linker,"/section:.MySec,RWS")*/
#pragma data_seg(".MySec") //the name of setion's length must less than 8
HWND g_hWnd = NULL;
#pragma data_seg()
/*#pragma comment(linker,"/section:.MySec,RWS")*/