网站首页  词典首页

请输入您要查询的函数:

 

术语 flushtrace
释义 FlushTrace
语法:
C++
ULONG FlushTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__inout PEVENT_TRACE_PROPERTIES Properties
);
FlushTrace功能
该FlushTrace函数会导致一个事件跟踪会议,立即提供了缓冲的事件指定的会话。 (事件跟踪会话不提供积极的事件,直到缓冲区已满。)
该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结构。
如果您使用的是新初始化的结构,您只需要设置Wnode.BufferSize,Wnode.Guid,LoggerNameOffset和结构LogFileNameOffset成员。您可以使用的最大会话名称(1024字)和最大日志文件的名称(1024个字符)的长度来计算的缓冲区大小,如果不知道偏移。
在产量,结构属性设置接收和跟踪会话,这反映了刷新后的会话状态事件会话统计信息。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是系统错误代码之一。下表列出了一些常见的错误及其原因。
返回codeDescription
以下ERROR_INVALID_PARAMETEROne是正确的:
属性为NULL。
SessionName和SessionHandle都是空。
以下ERROR_BAD_LENGTHOne是正确的:
物业的Wnode.BufferSize成员指定一个不正确的大小。
属性没有足够的空间分配举行会议的名称和日志文件的名称副本(如果使用)。
ERROR_ACCESS_DENIEDOnly具有管理权限的用户,在性能日志用户组的用户,服务本地系统,本地服务运行,是NetworkService可以控制事件跟踪会话。要授予受限用户能够控制跟踪会话,将它们添加到性能日志用户组。
Windows XP和Windows 2000:任何人都可以控制跟踪会话。
备注
控制器调用这个函数。
通常,您不需要自己刷新缓冲区。但是,您可能需要刷新缓冲区,如果事件发生率低,您提供实时的事件。
请注意,是不可靠的从DllMain刷新缓冲区。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesFlushTraceW(Unicode)和FlushTraceA(ANSI)的
参见
ControlTrace
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==FlushTrace Function
The FlushTrace function causes an event tracing session to immediately deliver buffered events for the specified session. (An event tracing session does not deliver events until an active buffer is full.)
The ControlTrace function supersedes this function.
Syntax
C++
ULONG FlushTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__inout PEVENT_TRACE_PROPERTIES Properties
);
Parameters
SessionHandle [in]
Handle to the event tracing session for whose buffers you want to flush, 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 buffers you want to flush, 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.
If you are using a newly initialized structure, you only need to set the Wnode.BufferSize, Wnode.Guid, LoggerNameOffset, and LogFileNameOffset members of the 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 receives the property settings and session statistics of the event tracing session, which reflect the state of the session after the flush.
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_INVALID_PARAMETEROne of the following is true:
Properties is NULL.
SessionName and SessionHandle are both NULL.
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_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.
Typically, you do not need to flush buffers yourself. However, you may want to flush buffers if the event rate is low and you are delivering events in real time.
Note that it is not safe to flush buffers from DllMain.
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesFlushTraceW (Unicode) and FlushTraceA (ANSI)
See Also
ControlTrace
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363891(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:30:31