Advertisement
dllbridge

Untitled

Feb 8th, 2024
792
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.20 KB | None | 0 0
  1.  
  2. 0) extern "C" __declspec(dllexport)
  3.    - - - - - - - - - - - - - - - - -
  4. 1) int (*_rr)();
  5. 2) HMODULE  hDll = 0;
  6. 3) hDll = LoadLibrary("dll/for.dll");
  7. 4) _rr = (int(*)())GetProcAddress(hDll, "_rr");
  8. 5) FreeLibrary(hDll);
  9.  
  10.  
  11.  
  12. #ifdef __GNUC__ //*******************************     For GCC compiler      ******************  
  13.                 // !!! Обязательно инициализируйте в этой области все массивы и переменные !!!
  14.                                                                                  
  15.  __declspec (dllexport) int        _n              __attribute__((section (".shared"), shared))
  16.                                        = 123;  
  17.                                                                                                        
  18.  __declspec (dllexport) int    arr[22]             __attribute__((section (".shared"), shared))                              
  19.                                        = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};                                                                                                                                                        
  20. #endif
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement