include <Windows.h> #include <stdio.h> #include <string.h> #ifdef __cplusplus extern "c" { #endif __declspec(dllexport)char abc; __declspec(dllexport)char hello; #ifdef __cplusplus } #endif int main (void) { HMODULE hMod; int *pGlobal,i,pG; BOOL fFreeResult; char d[]="abc"; char g[]="hello"; for(i=0;i<5;i++) { hMod = GetModuleHandle (NULL); pGlobal = (int*)GetProcAddress (hMod, d); fFreeResult = FreeLibrary(hMod); hMod = GetModuleHandle (NULL); pG = (int*)GetProcAddress (hMod, g); printf("%u\t%u\n",pGlobal,pG); } return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)