IGPEInformation::PolicyChanged method (gpedit.h)

The PolicyChanged method informs the Group Policy Object Editor that policy settings have changed.

Syntax

HRESULT PolicyChanged(
  [in] BOOL bMachine,
  [in] BOOL bAdd,
  [in] GUID *pGuidExtension,
  [in] GUID *pGuidSnapin
);

Parameters

[in] bMachine

Specifies whether computer or user policy has changed. If this value is TRUE, computer policy has changed. If this value is FALSE, user policy has changed.

[in] bAdd

Specifies whether this is an add or delete operation. If this parameter is FALSE, the last policy setting for the specified extension pGuidExtension is removed. In all other cases, this parameter is TRUE.

[in] pGuidExtension

Pointer to the GUID or unique name of the snap-in extension that will process policy. If the GPO is to be processed by the snap-in that processes .pol files, this parameter must specify the REGISTRY_EXTENSION_GUID value.

[in] pGuidSnapin

Pointer to the GUID or unique name of the snap-in extension making this method call.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in the Platform SDK header file WinError.h.

Remarks

An extension must call this method every time it makes a change to a group policy object. Note that when you write an MMC snap-in you must implement the IComponentData interface and call the IComponentData::Notify method. To get the IGPEInformation interface, set the event parameter of the IComponentData::Notify method to be MMCN_EXPAND and the arg parameter to TRUE. You can then obtain the IGPEInformation interface by calling QueryInterface and by using the usual Rules for Implementing QueryInterface.

For example, you can obtain the interface by calling as follows.

lpDataObject->QueryInterface(IID_IGPEInformation, (LPVOID lpDataObject->*)&m_pGPTInformation);

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header gpedit.h
DLL Gpedit.dll

See also

Group Policy Interfaces

Group Policy Overview

IGPEInformation