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.

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 codeDescription
WBEM_S_NO_ERROR

The user has permission to subscribe to an event.

WBEM_E_ACCESS_DENIED

The user does not have permission to access an event.

WBEM_E_FAILED

Indicates a provider failure.

WBEM_S_SUBJECT_TO_SDS

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.

 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemprov.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Wbemsvc.dll

See also

IWbemEventProviderSecurity
SELECT Statement for Event Queries
IWbemEventProvider
Securing WMI Events

 

 

Show:
© 2014 Microsoft