PolicyDllInit callback function

A Policy DLL's PolicyDllInit callback function is the first Policy DLL function called by FESF.  A Solution's Policy DLL is responsible for performing initialization in this function.

Syntax

bool

PolicyDllInit(

    VOID

)

 

Parameters

(none)

Return value

If PolicyDllInit succeeds, it returns TRUE.  Otherwise, it returns FALSE.

Returning FALSE will result in FESF not calling any further functions in the Policy DLL.

Remarks

All Policy DLLs must implement this callback function.  If this callback function is not implemented, the state and operation of FESF will be undefined. This callback must be named PolicyDllInit and is the only Policy DLL callback that the FESF Policy Service locates by name.

A Policy DLL's PolicyDllInit callback function is called by FESF to allow the Policy DLL to perform initialization.  The Policy DLL first performs any internal initialization it may require and then must call FePolSetConfiguration

In terms of FESF, the primary operation performed by the Policy DLL within PolicyDllInit is to build an FE_POLICY_CONFIG structure and pass a pointer to this structure to FESF by calling FePolSetConfiguration.  The FE_POLICY_CONFIG structure contains the following information:

      The version of the FE Policy Interface supported by the Policy DLL.

      Whether FESF Policy Caching should be enabled.

      Default behaviors for hard link creation, rename operations, and inconsistent file handling.

      A list of one or more CNG Algorithms and associated properties, along with a unique algorithm identifier (the Algorithm ID) that will be used by the Policy DLL to refer to each.

      A list of zero or more Virtualization Filters to ignore and the paths that those Virtualization Filters implement.

      Pointers to the Policy callback functions that are implemented by the Policy DLL.

As soon as FePolSetConfiguration has been called, FESF will begin calling callbacks in the Policy DLL.

To enable clean-up operations FESF will call the Policy DLL's PolUnInit callback function during shutdown.  Note that PolUnInit is called through the pointer provided in the FE_POLICY_CONFIG structure and is not located by name.

Examples

For an example implementation of PolicyDllInit, see the documentation for FePolSetConfiguration.

See Also

The FESF Sample Solution contains an example implementation of this callback function.  This example is part of the provided UM_Sample Visual Studio Solution, the SampPolicy project, and is located in the file SampPolicy.cpp.

Requirements

Software version

FESF V1 (or later)

Library

FESFPolicy.lib

Header

PolDllApi.h