网站首页  词典首页

请输入您要查询的函数:

 

术语 querytrace
释义 QueryTrace
语法:
C++
ULONG QueryTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__inout PEVENT_TRACE_PROPERTIES Properties
);
QueryTrace功能
该QueryTrace函数检索的属性设置,并在指定的跟踪会话活动会话统计信息。
该ControlTrace函数取代了这项功能。
参数
SessionHandle [in]
处理该事件的跟踪和统计其属性您想要查询,或NULL会话。您必须指定SessionHandle如果SessionName为NULL。然而,ETW忽略处理,如果SessionName不为NULL。句柄是由StartTrace函数返回。
SessionName [in]
指向一个以NULL结尾的字符串,指定跟踪会议的性质和统计您想要查询,或NULL事件的名称。您必须指定SessionName如果SessionHandle为NULL。
要指定NT内核记录器会议后,设立SessionName为KERNEL_LOGGER_NAME。
属性[ in , out ]
指针初始化EVENT_TRACE_PROPERTIES结构。
您只需要设置EVENT_TRACE_PROPERTIES结构Wnode.BufferSize成员。您可以使用的最大会话名称(1024字)和最大日志文件的名称(1024个字符)的长度来计算的缓冲区大小,如果不知道偏移。
在产量,结构成员包含的属性设置和跟踪会话活动会话统计信息。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是系统错误代码之一。下表列出了一些常见的错误及其原因。
返回codeDescription
以下ERROR_BAD_LENGTHOne是正确的:
物业的Wnode.BufferSize成员指定一个不正确的大小。
属性没有足够的空间分配举行会议的名称和日志文件的名称副本(如果使用)。
以下ERROR_INVALID_PARAMETEROne是正确的:
属性为NULL。
SessionName和SessionHandle都是空。
ERROR_ACCESS_DENIEDOnly具有管理权限的用户,在性能日志用户组的用户,服务本地系统,本地服务运行,是NetworkService可以查询事件跟踪会话。要授予受限用户能够查询跟踪会话,将它们添加到性能日志用户组或见EventAccessControl。
Windows XP和Windows 2000:任何人都可以控制跟踪会话。
ERROR_WMI_INSTANCE_NOT_FOUNDThe某次会议没有运行。
备注
控制器调用这个函数。
要更新一个跟踪会话事件的属性设置和会话数据,调用UpdateTrace功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesQueryTraceW(Unicode)和QueryTraceA(ANSI)的
参见
ControlTrace
QueryAllTraces
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==QueryTrace Function
The QueryTrace function retrieves the property settings and session statistics for the specified event tracing session.
The ControlTrace function supersedes this function.
Syntax
C++
ULONG QueryTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__inout PEVENT_TRACE_PROPERTIES Properties
);
Parameters
SessionHandle [in]
Handle to the event tracing session for whose properties and statistics you want to query, or NULL. You must specify SessionHandle if SessionName is NULL. However, ETW ignores the handle if SessionName is not NULL. The handle is returned by the StartTrace function.
SessionName [in]
Pointer to a null-terminated string that specifies the name of the event tracing session whose properties and statistics you want to query, or NULL. You must specify SessionName if SessionHandle is NULL.
To specify the NT Kernel Logger session, set SessionName to KERNEL_LOGGER_NAME.
Properties [in, out]
Pointer to an initialized EVENT_TRACE_PROPERTIES structure.
You only need to set the Wnode.BufferSize member of the EVENT_TRACE_PROPERTIES structure. You can use the maximum session name (1024 characters) and maximum log file name (1024 characters) lengths to calculate the buffer size and offsets if not known.
On output, the structure members contain the property settings and session statistics for the event tracing session.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is one of the system error codes . The following table includes some common errors and their causes.
Return codeDescription
ERROR_BAD_LENGTHOne of the following is true:
The Wnode.BufferSize member of Properties specifies an incorrect size.
Properties does not have sufficient space allocated to hold a copy of the session name and log file name (if used).
ERROR_INVALID_PARAMETEROne of the following is true:
Properties is NULL.
SessionName and SessionHandle are both NULL.
ERROR_ACCESS_DENIEDOnly users with administrative privileges, users in the Performance Log Users group, and services running as LocalSystem, LocalService, NetworkService can query event tracing sessions. To grant a restricted user the ability to query trace sessions, add them to the Performance Log Users group or see EventAccessControl .
Windows XP and Windows 2000: Anyone can control a trace session.
ERROR_WMI_INSTANCE_NOT_FOUNDThe given session is not running.

Remarks
Controllers call this function.
To update the property settings and session statistics for an event tracing session, call the UpdateTrace function.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesQueryTraceW (Unicode) and QueryTraceA (ANSI)
See Also
ControlTrace
QueryAllTraces
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364103(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 11:29:35