术语 | getprocessheaps |
释义 | GetProcessHeaps 语法: C++ DWORD WINAPI GetProcessHeaps( __in DWORD NumberOfHeaps, __out PHANDLE ProcessHeaps ); GetProcessHeaps功能 返回活跃堆处理和检索的数量为调用进程的积极堆所有。 参数 NumberOfHeaps [in] 在堆的最大句柄数可分为存储在缓冲区中指向ProcessHeaps。 ProcessHeaps [out] A到接收缓冲区的堆句柄数组的指针。 返回值 返回值是句柄数的堆,这对于调用进程活跃。 如果返回值小于或等于NumberOfHeaps的函数存储的数目堆缓冲区句柄指向ProcessHeaps。 如果返回值大于NumberOfHeaps更大,缓冲指向ProcessHeaps太小,无法容纳所有的堆句柄调用过程,函数存储在缓冲区中NumberOfHeaps处理。使用返回值分配的缓冲区足够大,以接收所有的处理,并再次调用该函数。 如果返回值为0,则函数失败,因为每一个进程都至少有一个积极的堆,该进程的默认堆。为了获得更多错误信息,调用GetLastError。 备注 该GetProcessHeaps函数获得的句柄调用进程的默认堆,加上通过调用句柄中的任何进程线程HeapCreate函数创建的任何其他私人堆。 该GetProcessHeaps功能主要是对调试有用,因为该函数检索私人堆一些可能被其他在这个过程中创建和运行代码后可能会GetProcessHeaps回报销毁。销毁堆句柄无效的堆,并处理可能会导致这些应用程序中的未定义的行为继续使用。堆职能应要求只在调用进程的默认堆和私人堆的进程创建和管理。 要获取的句柄调用进程的进程堆,使用GetProcessHeap功能。 实例 有关示例,请参阅使用过程堆。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 GetProcessHeap 堆函数 HeapCreate 内存管理功能 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==GetProcessHeaps Function Returns the number of active heaps and retrieves handles to all of the active heaps for the calling process. Syntax C++ DWORD WINAPI GetProcessHeaps( __in DWORD NumberOfHeaps, __out PHANDLE ProcessHeaps ); Parameters NumberOfHeaps [in] The maximum number of heap handles that can be stored into the buffer pointed to by ProcessHeaps. ProcessHeaps [out] A pointer to a buffer that receives an array of heap handles. Return Value The return value is the number of handles to heaps that are active for the calling process. If the return value is less than or equal to NumberOfHeaps, the function has stored that number of heap handles in the buffer pointed to by ProcessHeaps. If the return value is greater than NumberOfHeaps, the buffer pointed to by ProcessHeaps is too small to hold all the heap handles for the calling process, and the function stores NumberOfHeaps handles in the buffer. Use the return value to allocate a buffer that is large enough to receive all of the handles, and call the function again. If the return value is zero, the function has failed because every process has at least one active heap, the default heap for the process. To get extended error information, call GetLastError . Remarks The GetProcessHeaps function obtains a handle to the default heap of the calling process, plus handles to any additional private heaps created by calling the HeapCreate function on any thread in the process. The GetProcessHeaps function is primarily useful for debugging, because some of the private heaps retrieved by the function may have been created by other code running in the process and may be destroyed after GetProcessHeaps returns. Destroying a heap invalidates the handle to the heap, and continued use of such handles can cause undefined behavior in the application. Heap functions should be called only on the default heap of the calling process and on private heaps that the process creates and manages. To obtain a handle to the process heap of the calling process, use the GetProcessHeap function. Examples For an example, see Getting Process Heaps . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also GetProcessHeap Heap Functions HeapCreate Memory Management Functions Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/aa366571(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。