网站首页  词典首页

请输入您要查询的函数:

 

术语 heapwalk
释义 HeapWalk
语法:
C++
BOOL WINAPI HeapWalk(
__in HANDLE hHeap,
__inout LPPROCESS_HEAP_ENTRY lpEntry
);
HeapWalk功能
枚举在指定的堆内存块。
参数
hHeap [in]
阿堆句柄。这是处理无论是HeapCreate或GetProcessHeap函数返回。
lpEntry [ in , out ]
一个 PROCESS_HEAP_ENTRY结构,保持特定堆枚举状态信息的指针。
如果HeapWalk函数成功,返回值TRUE,这种结构的成员包含有关在未来的堆内存块的信息。
要启动堆枚举,设置PROCESS_HEAP_ENTRY结构lpData领域为NULL。要继续特定的堆枚举函数调用HeapWalk反复,没有改变hHeap,lpEntry,或该PROCESS_HEAP_ENTRY结构的任何成员。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
如果堆的枚举终止成功满堆结束时,函数返回FALSE,而且GetLastError返回错误代码ERROR_NO_MORE_ITEMS。
备注
该HeapWalk功能主要是有用的,因为枚举调试堆是一个潜在的耗时的操作。在枚举过程中锁定块堆其他线程访问堆,可降解,特别是在对称多处理性能,(SMP)计算机。的副作用,直至堆被解锁。使用HeapLock和HeapUnlock功能来控制堆在堆枚举锁定。
要启动同PROCESS_HEAP_ENTRY结构lpData领域堆枚举,请HeapWalk指向lpEntry设置为NULL。
要继续堆枚举相同hHeap和lpEntry价值观,呼吁HeapWalk,并与PROCESS_HEAP_ENTRY结构从前面的调用HeapWalk不变。重复此过程,直到没有进一步的枚举,或需要,直到函数返回FALSE,GetLastError返回ERROR_NO_MORE_ITEMS,这表明堆的内存块都被列举。
没有HeapWalk需要特别呼吁终止堆枚举,因为没有枚举状态数据之外PROCESS_HEAP_ENTRY结构的内容维护。
HeapWalk可能会失败在多线程应用程序如果不是堆在堆枚举锁定。
实例
他列举了堆
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
堆函数
HeapLock
HeapReAlloc
HeapUnlock
HeapValidate
内存管理功能
PROCESS_HEAP_ENTRY
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==HeapWalk Function
Enumerates the memory blocks in the specified heap.
Syntax
C++
BOOL WINAPI HeapWalk(
__in HANDLE hHeap,
__inout LPPROCESS_HEAP_ENTRY lpEntry
);
Parameters
hHeap [in]
A handle to the heap. This handle is returned by either the HeapCreate or GetProcessHeap function.
lpEntry [in, out]
A pointer to a PROCESS_HEAP_ENTRY structure that maintains state information for a particular heap enumeration.
If the HeapWalk function succeeds, returning the value TRUE, this structure's members contain information about the next memory block in the heap.
To initiate a heap enumeration, set the lpData field of the PROCESS_HEAP_ENTRY structure to NULL. To continue a particular heap enumeration, call the HeapWalk function repeatedly, with no changes to hHeap, lpEntry, or any of the members of the PROCESS_HEAP_ENTRY structure.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
If the heap enumeration terminates successfully by reaching the end of the heap, the function returns FALSE, and GetLastError returns the error code ERROR_NO_MORE_ITEMS.
Remarks
The HeapWalk function is primarily useful for debugging because enumerating a heap is a potentially time-consuming operation. Locking the heap during enumeration blocks other threads from accessing the heap and can degrade performance, especially on symmetric multiprocessing (SMP) computers. The side effects can last until the heap is unlocked. Use the HeapLock and HeapUnlock functions to control heap locking during heap enumeration.
To initiate a heap enumeration, call HeapWalk with the lpData field of the PROCESS_HEAP_ENTRY structure pointed to by lpEntry set to NULL.
To continue a heap enumeration, call HeapWalk with the same hHeap and lpEntry values, and with the PROCESS_HEAP_ENTRY structure unchanged from the preceding call to HeapWalk. Repeat this process until you have no need for further enumeration, or until the function returns FALSE and GetLastError returns ERROR_NO_MORE_ITEMS, indicating that all of the heap's memory blocks have been enumerated.
No special call of HeapWalk is needed to terminate the heap enumeration, since no enumeration state data is maintained outside the contents of the PROCESS_HEAP_ENTRY structure.
HeapWalk can fail in a multithreaded application if the heap is not locked during the heap enumeration.
Examples
Enumerating a Heap
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Heap Functions
HeapLock
HeapReAlloc
HeapUnlock
HeapValidate
Memory Management Functions
PROCESS_HEAP_ENTRY
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa366710(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:16:10