Share via


FreeLibraryAndExitThread (Windows CE 5.0)

Send Feedback

This 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 gives threads that are created and executed within a DLL an opportunity to safely unload the DLL and terminate themselves.

VOID FreeLibraryAndExitThread(HMODULEhModule,DWORDdwExitCode);

Parameters

  • hModule
    [in] Handle to the DLL module whose reference count the function decrements.

    The LoadLibrary or GetModuleHandle function returns this handle.

  • dwExitCode
    [in] Specifies the exit code for the calling thread.

Return Values

None.

Invalid hModule handles are ignored.

Remarks

The FreeLibraryAndExitThread function is implemented as follows:

FreeLibrary(hModule);
ExitThread(dwExitCode);

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Winbase.h.
Link Library: Coredll.dll.

See Also

FreeLibrary | ExitThread | LoadLibrary | DisableThreadLibraryCalls

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.