网站首页  词典首页

请输入您要查询的函数:

 

术语 controlcallback
释义 ControlCallback
语法:
C++
ULONG WINAPI ControlCallback(
__in WMIDPREQUESTCODE RequestCode,
__in PVOID Context,
__in ULONG *Reserved,
__in PVOID Buffer
);
ControlCallback回调函数
供应商实现此功能,接收控制器启用或禁用的通知要求。
在WMIDPREQUEST类型定义一个指向这个回调函数。 ControlCallback是一个应用程序的占位符定义函数的名称。
参数
RequestCode [in]
请求代码。指定下列值之一。
ValueMeaning
WMI_ENABLE_EVENTSEnables的供应商。
WMI_DISABLE_EVENTSDisables的供应商。
语境 [in]
供应商定义的范围内。提供者使用了RegisterTraceGuids请求上下参数指定的范围内。
保留[in]
保留供内部使用。
缓冲区 [in]
指针WNODE_HEADER结构,其中包含有关会议的跟踪该供应商正在启用或禁用事件信息。
返回值
您应该返回ERROR_SUCCESS,如果回调成功。请注意,ETW忽略此函数的返回值,除非要求EnableTrace控制器,使提供者和提供者尚未称为RegisterTraceGuids。如果发生这种情况,RegisterTraceGuids将返回这个回调返回值,如果注册成功。
备注
这个函数指定使用的RegisterTraceGuids功能。当控制器调用EnableTrace功能可以启用,禁用或更改,使标志或级别,ETW调用此回调。提供程序启用或禁用基于RequestCode本身的价值。通常,供应商使用此值来设置一个全局标志,以表明它的启用状态。
提供者定义的解释被启用或禁用。一般来说,如果提供者被启用,它产生的事件,但在它被禁用,它没有。
ETW没有通过使旗帜和Level,使控制器传递给EnableTrace这个回调函数。来检索此信息,请调用GetTraceEnableFlags和GetTraceEnableLevel职能分别。
您还需要检索会议处理这为未来的需要回调。若要检索会话句柄,调用GetTraceLoggerHandle功能。
您的回调函数不能调用任何可能招致调用LoadLibrary(更具体的,任何需要加载器锁)。
实例
对于功能的ControlCallback例子执行,看到实现一个ControlCallback功能。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderEvntrace.h
参见
EnableTrace
GetTraceEnableFlags
GetTraceEnableLevel
GetTraceLoggerHandle
RegisterTraceGuids
WNODE_HEADER
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==ControlCallback Callback Function
Providers implement this function to receive enable or disable notification requests from controllers.
The WMIDPREQUEST type defines a pointer to this callback function. ControlCallback is a placeholder for the application-defined function name.
Syntax
C++
ULONG WINAPI ControlCallback(
__in WMIDPREQUESTCODE RequestCode,
__in PVOID Context,
__in ULONG *Reserved,
__in PVOID Buffer
);
Parameters
RequestCode [in]
Request code. Specify one of the following values.
ValueMeaning
WMI_ENABLE_EVENTSEnables the provider.
WMI_DISABLE_EVENTSDisables the provider.

Context [in]
Provider-defined context. The provider uses the RequestContext parameter of RegisterTraceGuids to specify the context.
Reserved [in]
Reserved for internal use.
Buffer [in]
Pointer to a WNODE_HEADER structure that contains information about the event tracing session for which the provider is being enabled or disabled.
Return Value
You should return ERROR_SUCCESS if the callback succeeds. Note that ETW ignores the return value for this function except when a controller calls EnableTrace to enable a provider and the provider has not yet called RegisterTraceGuids. When this occurs, RegisterTraceGuids will return the return value of this callback if the registration was successful.
Remarks
This function is specified using the RegisterTraceGuids function. When the controller calls the EnableTrace function to enable, disable, or change the enable flags or level, ETW calls this callback. The provider enables or disables itself based the RequestCode value. Typically, the provider uses this value to set a global flag to indicate its enabled state.
The provider defines its interpretation of being enabled or disabled. Generally, if a provider is enabled, it generates events, but while it is disabled, it does not.
ETW does not pass the enable flags and enable level that the controller passes to the EnableTrace function to this callback. To retrieve this information, call the GetTraceEnableFlags and GetTraceEnableLevel functions, respectively.
You also need to retrieve the session handle in this callback for future calls. To retrieve the session handle, call the GetTraceLoggerHandle function.
Your callback function must not call anything that may incur LoadLibrary (more specifically, anything that requires a loader lock).
Examples
For an example implementation of a ControlCallback function, see Implementing a ControlCallback Function .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderEvntrace.h
See Also
EnableTrace
GetTraceEnableFlags
GetTraceEnableLevel
GetTraceLoggerHandle
RegisterTraceGuids
WNODE_HEADER
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363693(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:23:21