Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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.


HRESULT AccessCheck(
  [in]       WBEM_CWSTR wszQueryLanguage,
  [in]       WBEM_CWSTR wszQuery,
  [in]       long       lSidLength,
  [inconst BYTE       *pSid


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 codeDescription

The user has permission to subscribe to an event.


The user does not have permission to access an event.


Indicates a provider failure.


Windows Server 2003:   When returned by a provider, WMI checks the SECURITY_DESCRIPTOR property in __Event, and only sends events to consumers with access permission.



Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003


Wbemprov.h (include Wbemidl.h)





See also

SELECT Statement for Event Queries
Securing WMI Events



© 2015 Microsoft