网站首页  词典首页

请输入您要查询的函数:

 

术语 opentrace
释义 OpenTrace
语法:
C++
TRACEHANDLE OpenTrace(
__inout PEVENT_TRACE_LOGFILE Logfile
);
OpenTrace功能
该OpenTrace函数打开实时跟踪会话或日志文件的消费。
参数
日志文件[中,输出]
指针的EVENT_TRACE_LOGFILE结构。结构指定源从中消费事件(从一个日志文件或实时会议),并指定回调的消费者希望使用接收的事件。
返回值
如果函数成功,它返回的句柄跟踪。
如果函数失败,返回INVALID_PROCESSTRACE_HANDLE。
在此之前的Windows 7:如果函数失败,则返回INVALID_HANDLE_VALUE。为了避免编译时错误,铸造INVALID_HANDLE_VALUE以TRACEHANDLE如下:
(TRACEHANDLE)INVALID_HANDLE_VALUE

为了获得更多错误信息,使用GetLastError函数。下表列出了常见的错误及其原因。
返回codeDescription
ERROR_INVALID_PARAMETERThe日志文件参数是NULL。
ERROR_BAD_PATHNAMEIf您没有指定EVENT_TRACE_LOGFILE LoggerName会员,您必须指定一个有效的日志文件的名称。
ERROR_ACCESS_DENIEDOnly具有管理权限的用户,在性能日志用户组的用户,服务本地系统,本地服务运行,是NetworkService可以消耗实时事件。要授予受限用户能够实时消费活动,将它们添加到性能日志用户组。
Windows XP和Windows 2000:任何人都可以消耗实时事件。
备注
消费者调用这个函数。
在调用OpenTrace,调用ProcessTrace函数来处理事件。当您完成处理事件,调用闭迹函数。
请注意您可以只从一个过程的实时会话事件。
实例
举一个例子,它使用OpenTrace,请打开一个跟踪会话和处理事件。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesOpenTraceW(Unicode)和OpenTraceA(ANSI)的
参见
闭迹
EVENT_TRACE_LOGFILE
ProcessTrace
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==OpenTrace Function
The OpenTrace function opens a real-time trace session or log file for consuming.
Syntax
C++
TRACEHANDLE OpenTrace(
__inout PEVENT_TRACE_LOGFILE Logfile
);
Parameters
Logfile [in, out]
Pointer to an EVENT_TRACE_LOGFILE structure. The structure specifies the source from which to consume events (from a log file or the session in real time) and specifies the callbacks the consumer wants to use to receive the events.
Return Value
If the function succeeds, it returns a handle to the trace.
If the function fails, it returns INVALID_PROCESSTRACE_HANDLE.
Prior to Windows 7: If the function fails, it returns INVALID_HANDLE_VALUE. To avoid compile-time errors, cast INVALID_HANDLE_VALUE to TRACEHANDLE as follows:
(TRACEHANDLE)INVALID_HANDLE_VALUE
.
To get extended error information, use the GetLastError function. The following table lists common errors and their causes.
Return codeDescription
ERROR_INVALID_PARAMETERThe Logfile parameter is NULL.
ERROR_BAD_PATHNAMEIf you did not specify the LoggerName member of EVENT_TRACE_LOGFILE, you must specify a valid log file name.
ERROR_ACCESS_DENIEDOnly users with administrative privileges, users in the Performance Log Users group, and services running as LocalSystem, LocalService, NetworkService can consume events in real time. To grant a restricted user the ability to consume events in real time, add them to the Performance Log Users group.
Windows XP and Windows 2000: Anyone can consume real time events.

Remarks
Consumers call this function.
After calling OpenTrace, call the ProcessTrace function to process the events. When you have finished processing events, call the CloseTrace function.
Note that you can process events from only one real-time session.
Examples
For an example that uses OpenTrace, see Opening a Trace Session and Processing Events .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesOpenTraceW (Unicode) and OpenTraceA (ANSI)
See Also
CloseTrace
EVENT_TRACE_LOGFILE
ProcessTrace
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364089(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:19:16