网站首页  词典首页

请输入您要查询的函数:

 

术语 stoptrace
释义 StopTrace
语法:
C++
ULONG StopTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__out PEVENT_TRACE_PROPERTIES Properties
);
StopTrace功能
该StopTrace函数停止指定的事件跟踪会话。
该ControlTrace函数取代了这项功能。
参数
SessionHandle [in]
句柄事件跟踪会话,您要停止,或NULL。您必须指定SessionHandle如果SessionName为NULL。然而,ETW忽略处理,如果SessionName不为NULL。句柄是由StartTrace函数返回。
SessionName [in]
指向一个以NULL结尾的字符串,指定跟踪会话,您要停止,或NULL事件的名称。您必须指定SessionName如果SessionHandle为NULL。
要指定NT内核记录器会议后,设立SessionName为KERNEL_LOGGER_NAME。
属性[out]
指针的EVENT_TRACE_PROPERTIES结构,接收最后属性和会话统计信息。
如果您使用的是新初始化的结构,您只需要设置Wnode.BufferSize,Wnode.Guid,LoggerNameOffset和结构LogFileNameOffset成员。您可以使用的最大会话名称(1024字)和最大日志文件的名称(1024个字符)的长度来计算的缓冲区大小,如果不知道偏移。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是系统错误代码之一。下表列出了一些常见的错误及其原因。
返回codeDescription
以下ERROR_BAD_LENGTHOne是正确的:
物业的Wnode.BufferSize成员指定一个不正确的大小。
属性没有足够的空间分配举行会议的名称和日志文件的名称副本(如果使用)。
以下ERROR_INVALID_PARAMETEROne是正确的:
属性为NULL。
SessionName和SessionHandle都是空。
ERROR_ACCESS_DENIEDOnly具有管理权限的用户,在性能日志用户组的用户,服务本地系统,本地服务运行,是NetworkService可以控制事件跟踪会话。要授予受限用户能够控制跟踪会话,将它们添加到性能日志用户组。
Windows XP和Windows 2000:任何人都可以控制跟踪会话。
备注
控制器调用这个函数。
如果LogFileMode包含EVENT_TRACE_FILE_MODE_PREALLOCATE,StartTrace扩展日志文件MaximumFileSize字节。在该文件占用伐木,为圆形,连续记录了整个空间。当您停止记录,日志文件减少到所需的大小。
注意,它是不可靠的停止跟踪从DllMain会议。
实例
有关示例使用StopTrace,见停止的事件跟踪会话。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesStopTraceW(Unicode)和StopTraceA(ANSI)的
参见
ControlTrace
StartTrace
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==StopTrace Function
The StopTrace function stops the specified event tracing session.
The ControlTrace function supersedes this function.
Syntax
C++
ULONG StopTrace(
__in TRACEHANDLE SessionHandle,
__in LPCTSTR SessionName,
__out PEVENT_TRACE_PROPERTIES Properties
);
Parameters
SessionHandle [in]
Handle to the event tracing session that you want to stop, 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 that you want to stop, or NULL. You must specify SessionName if SessionHandle is NULL.
To specify the NT Kernel Logger session, set SessionName to KERNEL_LOGGER_NAME.
Properties [out]
Pointer to an EVENT_TRACE_PROPERTIES structure that receives the final properties and statistics for the session.
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.
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 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.
If LogFileMode contains EVENT_TRACE_FILE_MODE_PREALLOCATE, StartTrace extends the log file to MaximumFileSize bytes. The file occupies the entire space during logging, for both circular and sequential logs. When you stop the logger, the log file is reduced to the size needed.
Note that it is not safe to stop a trace session from DllMain.
Examples
For an example using StopTrace, see Stopping an Event Tracing Session .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesStopTraceW (Unicode) and StopTraceA (ANSI)
See Also
ControlTrace
StartTrace
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364119(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:16:09