Kernel32DisableThreadLibraryCalls Method
Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL).
This can reduce the size of the working set for some applications.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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, SetLastError = true)]
public static bool DisableThreadLibraryCalls(
IntPtr hModule
)
<DllImportAttribute("Kernel32.dll", ExactSpelling := true, SetLastError := true>]
Public Shared Function DisableThreadLibraryCalls (
hModule As IntPtr
) As Boolean
Dim hModule As IntPtr
Dim returnValue As Boolean
returnValue = Kernel32.DisableThreadLibraryCalls(hModule)
public:
[DllImportAttribute(L"Kernel32.dll", ExactSpelling = true, SetLastError = true)]
static bool DisableThreadLibraryCalls(
[InAttribute] IntPtr hModule
)
[<DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)>]
static member DisableThreadLibraryCalls :
hModule : IntPtr -> bool
No code example is currently available or this language may not be supported.
- hModule IntPtr
-
A handle to the DLL module for which the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications are to be disabled.
The LoadLibrary(String), LoadLibraryEx(String, IntPtr, LoadLibraryFlags),
or GetModuleHandle(String) function returns this handle.
Note that you cannot call GetModuleHandle(String) with because
this returns the base address of the executable image, not the DLL image.
The DisableThreadLibraryCalls(IntPtr) function fails if the DLL specified by
hModule has active static thread local storage,
or if hModule is an invalid module handle.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.