IWbemEventProviderSecurity::AccessCheck method
The AccessCheck method is implemented by an event provider and called by Windows Management Instrumentation (WMI) when a consumer subscribes to an event specified in wszQuery. A consumer that has access permission for an event can subscribe to that event. A consumer that does not have access permission for an event cannot subscribe to that event. For more information, see Writing an Event Provider and Securing WMI Events.
For a temporary consumer, WMI sets the PSID supplied in the pSid parameter to NULL and the call is made by impersonating the consumer. For a permanent consumer, WMI sets the PSID with the security identifier (SID) of the user who created the subscription.
Syntax
HRESULT AccessCheck( [in] WBEM_CWSTR wszQueryLanguage, [in] WBEM_CWSTR wszQuery, [in] long lSidLength, [in] const BYTE *pSid );
Parameters
- wszQueryLanguage [in]
-
Language of the following query filter, which is "WQL".
- wszQuery [in]
-
Text of the event query filter, which is registered by a logical consumer.
- lSidLength [in]
-
Integer that contains the security identifier (SID) length, or 0 (zero) if the subscription builder token is available.
- pSid [in]
-
Pointer to the constant byte integer type that contains the SID, or NULL if the subscription builder's token is available.
Return value
This method returns an HRESULT that indicates the status of the method call. The following table lists the value contained in an HRESULT.
| Return code | Description |
|---|---|
|
The user has permission to subscribe to an event. |
|
The user does not have permission to access an event. |
|
Indicates a provider failure. |
|
|
Examples
For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.
For C++ code examples, see WMI C++ Application Examples.
Requirements
|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server | Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- IWbemEventProviderSecurity
- SELECT Statement for Event Queries
- IWbemEventProvider
- Securing WMI Events
Send comments about this topic to Microsoft
Build date: 11/19/2012
