Windows/WinCE: Improve the run-time dynamic linking scheme
authorChris Dickens <christopher.a.dickens@gmail.com>
Thu, 28 Jan 2016 08:29:58 +0000 (00:29 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Thu, 28 Jan 2016 08:55:10 +0000 (00:55 -0800)
commit57cfbb444e03179a4e4eafba18416209f0db1d1c
tree1e63642a0c82491d9e771aa9780be0ca0145d30a
parent452e7bd68383c43b75e6b12791f5721fbaea4697
Windows/WinCE: Improve the run-time dynamic linking scheme

Prior to this commit, the Windows and WinCE backends had a specific
shortcoming when loading DLLs, that being that once loaded they were
never unloaded. This commit improves this by providing a means to
unload the DLLs during cleanup.

Note that the use of GetModuleHandle() has been removed in favor of
the exclusive use of LoadLibrary(). This was done to ensure that a
reference count is taken against the loaded DLL, which guards against
some other part of the application unloading the DLL that libusb
is currently using.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/wince_usb.c
libusb/os/wince_usb.h
libusb/os/windows_common.h
libusb/os/windows_nt_common.c
libusb/os/windows_winusb.c
libusb/os/windows_winusb.h
libusb/version_nano.h