Kernel32FreeLibraryAndExitThread Method

Decrements the reference count of a loaded dynamic-link library (DLL) by one, then calls ExitThread to terminate the calling thread.

This function does not return a value. Invalid module handles are ignored.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", ExactSpelling = true)]
public static void FreeLibraryAndExitThread(
	IntPtr hModule,
	uint exitCode
)

Parameters

hModule  IntPtr
A handle to the DLL module whose reference count the function decrements. The LoadLibrary(String) or GetModuleHandleEx(GetModuleHandleExFlags, String, IntPtr) function returns this handle.

Do not call this function with a handle returned by the GetModuleHandle(String) function, since this function does not maintain a reference count for the module.

exitCode  UInt32
The exit code for the calling thread.

Remarks

See Also