网站首页  词典首页

请输入您要查询的函数:

 

术语 updatetrace
释义 UpdateTrace
语法:
C++
ULONG UpdateTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__inout PEVENT_TRACE_PROPERTIES Properties
);
UpdateTrace功能
该UpdateTrace函数更新属性指定的跟踪会话的事件设置。
该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结构。
在输入时,成员必须指定的属性,以更新的新值。有关资料上的属性,您可以更新,请备注。
在输出的结构成员包含已更新的设置和跟踪会话事件的统计数字。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是系统错误代码之一。下表列出了一些常见的错误及其原因。
返回codeDescription
ERROR_BAD_LENGTHThe缓冲区大小的性质Wnode委员,指定了一个不正确的大小。
以下ERROR_INVALID_PARAMETEROne是正确的:
SessionName和SessionHandle都是空。
属性为NULL。
物业的LogFileNameOffset成员是无效的。
物业的LoggerNameOffset成员是无效的。
Windows Server 2003和Windows XP中:该Wnode结构的Guid成员SystemTraceControlGuid,但SessionName参数不KERNEL_LOGGER_NAME。
ERROR_ACCESS_DENIEDOnly具有管理权限的用户,在性能日志用户组的用户,服务本地系统,本地服务运行,是NetworkService可以控制事件跟踪会话。要授予受限用户能够控制跟踪会话,将它们添加到性能日志用户组。
Windows XP和Windows 2000:任何人都可以控制跟踪会话。
备注
控制器调用这个函数。
在输入时,成员必须指定的属性,以更新的新值。您可以更新下列属性。
MemberUse
EnableFlagsSet为0禁用所有成员提供的内核。否则,您必须指定核心供应商,您要启用或保持启用。仅适用于NT内核记录器会话。
FlushTimerSet该成员如果您想改变的时间才刷新缓冲区。如果这个成员为0,成员不更新。
LogFileNameOffsetSet该会员如果您想切换到另一个日志文件。如果这个成员是0,文件名没有更新。如果偏移量不为零,您不要更改日志文件的名称,该函数返回一个错误。
LogFileModeSet该成员如果要打开和关闭EVENT_TRACE_REAL_TIME_MODE。要打开实时耗时关闭,设置为0的成员。要打开实时上耗费时间,设置此成员EVENT_TRACE_REAL_TIME_MODE,它将与目前的模式OR'd。
MaximumBuffersSet设置这个会员,如果您想改变缓冲区的最大数量ETW使用。如果这个成员为0,成员不更新。
至于私人记录会话,您可以只更新LogFileNameOffset和FlushTimer。
如果您使用的是新初始化EVENT_TRACE_PROPERTIES结构,您需要指定,比您要更新的成员外,只有成员,是Wnode.BufferSize,Wnode.Guid和Wnode.Flags。
如果您使用您的财产结构传递给StartTrace,确保LogFileNameOffset成员为0,除非您改变日志文件的名称。
假如ControlTrace您调用函数来查询当前会话属性,然后更新这些属性以更新会议,请确保您设置LogFileNameOffset为0(除非您正在改变日志文件的名称),并设置EVENT_TRACE_PROPERTIES.Wnode.Flags在WNODE_FLAG_TRACED_GUID。
要获得一个跟踪会话事件的属性设置和会话数据,调用ControlTrace功能。
实例
举一个例子,它使用UpdateTrace,请参阅更新的事件跟踪会话。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesUpdateTraceW(Unicode)和UpdateTraceA(ANSI)的
参见
ControlTrace
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==UpdateTrace Function
The UpdateTrace function updates the property setting of the specified event tracing session.
The ControlTrace function supersedes this function.
Syntax
C++
ULONG UpdateTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__inout PEVENT_TRACE_PROPERTIES Properties
);
Parameters
SessionHandle [in]
Handle to the event tracing session to update, 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 to update, 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.
On input, the members must specify the new values for the properties to update. For information on which properties you can update, see Remarks.
On output, the structure members contains the updated settings and 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_LENGTHThe BufferSize member of the Wnode member of Properties specifies an incorrect size.
ERROR_INVALID_PARAMETEROne of the following is true:
SessionName and SessionHandle are both NULL.
Properties is NULL.
The LogFileNameOffset member of Properties is not valid.
The LoggerNameOffset member of Properties is not valid.
Windows Server 2003 and Windows XP: The Guid member of the Wnode structure is SystemTraceControlGuid, but the SessionName parameter is not KERNEL_LOGGER_NAME.
ERROR_ACCESS_DENIEDOnly users with administrative privileges, users in the Performance Log Users group, and services running as LocalSystem, LocalService, NetworkService can control event tracing sessions. To grant a restricted user the ability to control trace sessions, add them to the Performance Log Users group.
Windows XP and Windows 2000: Anyone can control a trace session.

Remarks
Controllers call this function.
On input, the members must specify the new values for the properties to update. You can update the following properties.
MemberUse
EnableFlagsSet this member to 0 to disable all kernel providers. Otherwise, you must specify the kernel providers that you want to enable or keep enabled. Applies only to NT Kernel Logger sessions.
FlushTimerSet this member if you want to change the time to wait before flushing buffers. If this member is 0, the member is not updated.
LogFileNameOffsetSet this member if you want to switch to another log file. If this member is 0, the file name is not updated. If the offset is not zero and you do not change the log file name, the function returns an error.
LogFileModeSet this member if you want to turn EVENT_TRACE_REAL_TIME_MODE on and off. To turn real time consuming off, set this member to 0. To turn real time consuming on, set this member to EVENT_TRACE_REAL_TIME_MODE and it will be OR'd with the current modes.
MaximumBuffersSet set this member if you want to change the maximum number of buffers that ETW uses. If this member is 0, the member is not updated.

For private logger sessions, you can only update LogFileNameOffset and FlushTimer.
If you are using a newly initialized EVENT_TRACE_PROPERTIES structure, the only members you need to specify, other than the members you are updating, are Wnode.BufferSize, Wnode.Guid, and Wnode.Flags.
If you use the property structure you passed to StartTrace, make sure the LogFileNameOffset member is 0 unless you are changing the log file name.
If you call the ControlTrace function to query the current session properties and then update those properties to update the session, make sure you set LogFileNameOffset to 0 (unless you are changing the log file name) and set EVENT_TRACE_PROPERTIES.Wnode.Flags to WNODE_FLAG_TRACED_GUID.
To obtain the property settings and session statistics for an event tracing session, call the ControlTrace function.
Examples
For an example that uses UpdateTrace, see Updating an Event Tracing Session .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesUpdateTraceW (Unicode) and UpdateTraceA (ANSI)
See Also
ControlTrace
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364155(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:31:14