Why Python ctypes can not FreeLibrary?

700 views Asked by At
>>>h=cdll.LoadLibrary('dll.dll')
>>>h.hello()       # messageBox
1
>>>windll.kernel32.FreeLibrary(h._handle)
1
>>>h.hello()      #and still have messageBox,Why....
1

and this is the dll source

#include <windows.h>
#define DLL_EXPORT __declspec(dllexport)
BOOL APIENTRY DllMain(HANDLE hModule, DWORD  fdwReason,LPVOID lpReserved)   {}

DLL_EXPORT void hello (void)
{
    MessageBox (0, "Hello World!", "From DLL", MB_ICONINFORMATION);
}
0

There are 0 answers