FreeLibrary
The FreeLibrary
function decrements the reference count of the loaded dynamic-link library
(DLL) module. When the reference count reaches zero, the module is unmapped
from the address space of the calling process and the handle is no longer
valid. This function supersedes the FreeModule1_CW3PP function.
BOOL FreeLibrary(
HMODULE hLibModule |
// handle to loaded
library module |
); |
|
Parameters
hLibModule
Identifies
the loaded library module. The LoadLibrary
Return Values
If the
function succeeds, the return value is nonzero.
If the
function fails, the return value is zero. To get extended error information,
call GetLastError
Remarks
Each process
maintains a reference count for each loaded library module. This reference
count is incremented each time LoadLibrary
Before
unmapping a library module, the system enables the DLL to detach from the
process by calling the DLL s DllEntryPoint
Calling FreeLibrary
does not affect other processes using the same library module.
See Also