网站首页  词典首页

请输入您要查询的函数:

 

术语 disablethreadlibrarycalls
释义 DisableThreadLibraryCalls
语法:
C++
BOOL WINAPI DisableThreadLibraryCalls(
__in HMODULE hModule
);
DisableThreadLibraryCalls功能
禁用DLL_THREAD_ATTACH和DLL_THREAD_DETACH的通知指定的动态链接库(DLL)。这可以减少一些应用工作集大小。
参数
hModule [in]
句柄到DLL模块而DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知都被禁用。的LoadLibrary,LoadLibraryEx,或GetModuleHandle函数返回此句柄。 Note that you cannot call GetModuleHandle with NULL because this returns the base address of the executable image, not the DLL image.
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。该DisableThreadLibraryCalls函数失败如果hModule指明了积极的静态线程本地存储,该DLL或者hModule是一个无效的模块句柄。为了获得更多错误信息,调用GetLastError。
备注
该DisableThreadLibraryCalls函数允许一个DLL禁用DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知电话。这可能是一个多线程应用程序具有许多DLL,频繁创建和删除线程有用的优化,其DLL不需要这些线程的附着Level的通知/分队。远程过程调用(RPC)服务器应用程序就是这样一个应用实例。在这种类型的应用程序,DLL初始化例程常常保留在内存中的服务DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知。通过禁用通知,该DLL初始化代码没有分页,因为线程创建或删除,从而减少应用程序的工作集大小的代码。为落实优化,修改一个DLL的DLL_PROCESS_ATTACH代码来调用DisableThreadLibraryCalls。
不要打电话从链接到静态的C运行时库(CRT)的DLL这个功能。在静态CRT需要DLL_THREAD_ATTACH和DLL_THREAD_DETATCH通知正常工作。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
动态链接库的入口点函数
动态链接库函数
FreeLibraryAndExitThread
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==DisableThreadLibraryCalls Function
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.
Syntax
C++
BOOL WINAPI DisableThreadLibraryCalls(
__in HMODULE hModule
);
Parameters
hModule [in]
A handle to the DLL module for which the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications are to be disabled. The LoadLibrary , LoadLibraryEx , or GetModuleHandle function returns this handle. Note that you cannot call GetModuleHandle with NULL because this returns the base address of the executable image, not the DLL image.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. The DisableThreadLibraryCalls function fails if the DLL specified by hModule has active static thread local storage, or if hModule is an invalid module handle. To get extended error information, call GetLastError .
Remarks
The DisableThreadLibraryCalls function lets a DLL disable the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls. This can be a useful optimization for multithreaded applications that have many DLLs, frequently create and delete threads, and whose DLLs do not need these thread-level notifications of attachment/detachment. A remote procedure call (RPC) server application is an example of such an application. In these sorts of applications, DLL initialization routines often remain in memory to service DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications. By disabling the notifications, the DLL initialization code is not paged in because a thread is created or deleted, thus reducing the size of the application's working code set. To implement the optimization, modify a DLL's DLL_PROCESS_ATTACH code to call DisableThreadLibraryCalls.
Do not call this function from a DLL that is linked to the static C run-time library (CRT). The static CRT requires DLL_THREAD_ATTACH and DLL_THREAD_DETATCH notifications to function properly.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Dynamic-Link Library Entry-Point Function
Dynamic-Link Library Functions
FreeLibraryAndExitThread
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682579(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:18:38