The FreeLibraryAndExitThread function decrements the reference count of a loaded dynamic-link library (DLL) by one, and then calls ExitThread to terminate the calling thread. The function does not return.
The FreeLibraryAndExitThread function gives threads that are created and executed within a dynamic-link library an opportunity to safely unload the DLL and terminate themselves.
VOID FreeLibraryAndExitThread(
HMODULE hLibModule, // dynamic-link library whose reference count
// is to decrement
DWORD dwExitCode // exit code for thread
);
The function has no return value. The function does not return. Invalid hLibModule handles are ignored.
The FreeLibraryAndExitThread function is implemented as:
FreeLibrary(hLibModule);
ExitThread(dwExitCode);
Refer to the reference pages for FreeLibrary and ExitThread for further information on those functions.
Windows NT: Requires version 3.5 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Dynamic-Link Libraries Overview, Dynamic-Link Library Functions, FreeLibrary, ExitThread, DisableThreadLibraryCalls