This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients amaury.forgeotdarc, belopolsky, giampaolo.rodola, meador.inge, theller
Date 2017-05-05.19:08:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494011335.58.0.17324461336.issue30286@psf.upfronthosting.co.za>
In-reply-to
Content
http://stackoverflow.com/questions/23522055/error-when-unload-a-64bit-dll-using-ctypes-windll

Adding "ctypes.windll.kernel32.FreeLibrary.argtypes = [wintypes.HMODULE]" fixes the issue. This works: 

import ctypes
from ctypes import wintypes
path = 'C:\\Python35-64\\vcruntime140.dll'
cfile = ctypes.CDLL(path)
print(cfile._handle)
ctypes.windll.kernel32.FreeLibrary.argtypes = [wintypes.HMODULE]
ctypes.windll.kernel32.FreeLibrary(cfile._handle)
History
Date User Action Args
2017-05-05 19:08:55giampaolo.rodolasetrecipients: + giampaolo.rodola, theller, amaury.forgeotdarc, belopolsky, meador.inge
2017-05-05 19:08:55giampaolo.rodolasetmessageid: <1494011335.58.0.17324461336.issue30286@psf.upfronthosting.co.za>
2017-05-05 19:08:55giampaolo.rodolalinkissue30286 messages
2017-05-05 19:08:55giampaolo.rodolacreate