PFNGENERATEGROUPPOLICY callback function (userenv.h)

The GenerateGroupPolicy callback function is an application-defined callback function that each policy extension must export when generating RSoP data in the planning mode. The Group Policy Data Access Service (GPDAS) calls the function after the service simulates the loading of client-side extensions so that extensions can generate policy data.

The PFNGENERATEGROUPPOLICY type defines a pointer to this callback function. GenerateGroupPolicy is a placeholder for the application-defined function name.

Syntax

PFNGENERATEGROUPPOLICY Pfngenerategrouppolicy;

DWORD Pfngenerategrouppolicy(
  [in] DWORD dwFlags,
  [in] BOOL *pbAbort,
  [in] WCHAR *pwszSite,
  [in] PRSOP_TARGET pComputerTarget,
  [in] PRSOP_TARGET pUserTarget
)
{...}

Parameters

[in] dwFlags

A parameter that represents one or more of the following flags.

The policy is applied across a slow link.

GPO_INFO_FLAG_VERBOSE

Write verbose output to the event log.

[in] pbAbort

A value that specifies whether to continue processing GPOs. If this parameter is TRUE, GPO processing stops and the extension must deallocate its resources and return promptly. If this parameter is FALSE, GPO processing continues.

[in] pwszSite

A pointer to the site name of the target computer. This parameter can be NULL.

[in] pComputerTarget

A pointer to an RSOP_TARGET structure that contains information about a computer. This parameter can be NULL, but if it is NULL, the pUserTarget parameter is required.

[in] pUserTarget

A pointer to an RSOP_TARGET structure that contains information about a user. This parameter can be NULL, but if it is NULL, the pComputerTarget parameter is required.

Return value

If the function succeeds, the return value is ERROR_SUCCESS. Otherwise, the function returns one of the system error codes. For a complete list of error codes, see System Error Codes or the header file WinError.h.

Remarks

The policy extension must register this callback function at the registry key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\ClientExtensionGuid

GenerateGroupPolicy REG_SZ

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header userenv.h

See also

Group Policy Functions

Group Policy Overview

RSOP_TARGET