网站首页  词典首页

请输入您要查询的函数:

 

术语 waitfordebugevent
释义 WaitForDebugEvent
语法:
C++
BOOL WINAPI WaitForDebugEvent(
__out LPDEBUG_EVENT lpDebugEvent,
__in DWORD dwMilliseconds
);
WaitForDebugEvent函数
一个调试事件发生在等待的过程正在调试。
参数
lpDebugEvent [out]
一个 DEBUG_EVENT结构,接收有关调试事件信息的指针。
dwMilliseconds的 [in]
的毫秒数等待调试事件。如果此参数为零,调试的事件,并返回该功能试验,立即。如果该参数是无限的,该函数不返回,直到调试事件发生。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
只有创建的线程被调试可以调用WaitForDebugEvent的过程。
当CREATE_PROCESS_DEBUG_EVENT发生时,调试应用程序收到一个句柄的进程映像文件正在调试,句柄的进程正在调试,以及处理的过程初始线程正在调试的DEBUG_EVENT结构。这些句柄的成员中返回的u.CreateProcessInfo.hFile(图像文件),u.CreateProcessInfo.hProcess(进程),u.CreateProcessInfo.hThread(初始线程)。如果系统先前报道EXIT_PROCESS_DEBUG_EVENT调试时,系统关闭句柄的进程和线程调试程序时调用ContinueDebugEvent功能。调试器应该关闭句柄调用CloseHandle函数的图像文件。
同样,当一CREATE_THREAD_DEBUG_EVENT发生时,调试应用程序收到一个线程句柄造成的建立在DEBUG_EVENT结构u.CreateThread.hThread成员调试事件。如果系统先前报道EXIT_THREAD_DEBUG_EVENT调试时,系统关闭句柄线程调试时调用ContinueDebugEvent功能。
当LOAD_DLL_DEBUG_EVENT发生时,调试应用程序收到一个句柄在DEBUG_EVENT结构u.LoadDll.hFile成员加载的DLL。这种处理应该由调试应用程序通过调用关闭CloseHandle函数。
警告:不要队列异步过程调用(APC)的线程调用WaitForDebugEvent。
实例
有关示例,请参见编写调试器的主循环。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
ContinueDebugEvent
DebugActiveProcess
DebugBreak
DEBUG_EVENT
调试事件
调试功能
OutputDebugString的
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==WaitForDebugEvent Function
Waits for a debugging event to occur in a process being debugged.
Syntax
C++
BOOL WINAPI WaitForDebugEvent(
__out LPDEBUG_EVENT lpDebugEvent,
__in DWORD dwMilliseconds
);
Parameters
lpDebugEvent [out]
A pointer to a DEBUG_EVENT structure that receives information about the debugging event.
dwMilliseconds [in]
The number of milliseconds to wait for a debugging event. If this parameter is zero, the function tests for a debugging event and returns immediately. If the parameter is INFINITE, the function does not return until a debugging event has occurred.
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 .
Remarks
Only the thread that created the process being debugged can call WaitForDebugEvent.
When a CREATE_PROCESS_DEBUG_EVENT occurs, the debugger application receives a handle to the image file of the process being debugged, a handle to the process being debugged, and a handle to the initial thread of the process being debugged in the DEBUG_EVENT structure. The members these handles are returned in are u.CreateProcessInfo.hFile (image file), u.CreateProcessInfo.hProcess (process), and u.CreateProcessInfo.hThread (initial thread). If the system previously reported an EXIT_PROCESS_DEBUG_EVENT debugging event, the system closes the handles to the process and thread when the debugger calls the ContinueDebugEvent function. The debugger should close the handle to the image file by calling the CloseHandle function.
Similarly, when a CREATE_THREAD_DEBUG_EVENT occurs, the debugger application receives a handle to the thread whose creation caused the debugging event in the u.CreateThread.hThread member of the DEBUG_EVENT structure. If the system previously reported an EXIT_THREAD_DEBUG_EVENT debugging event, the system closes the handles to the thread when the debugger calls the ContinueDebugEvent function.
When a LOAD_DLL_DEBUG_EVENT occurs, the debugger application receives a handle to the loaded DLL in the u.LoadDll.hFile member of the DEBUG_EVENT structure. This handle should be closed by the debugger application by calling the CloseHandle function.
Warning Do not queue an asynchronous procedure call (APC) to a thread that calls WaitForDebugEvent.
Examples
For an example, see Writing the Debugger's Main Loop .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
ContinueDebugEvent
DebugActiveProcess
DebugBreak
DEBUG_EVENT
Debugging Events
Debugging Functions
OutputDebugString
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms681423(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:23:55