PolGetLockRounding callback function

When present, a Policy DLL's PolGetLockRounding callback function is called to find the “lock rounding” which should be associated with all accessors to that file prior to the locking request being sent to the remote server.  See Remarks.

Syntax

FESF_LOCK_ROUNDING

POL_GET_ROUNDING(

    _In_ FE_POLICY_PATH_INFORMATION* PolicyPathInfo

);

Parameters

PolicyPathInfo [in]

The name information about the file. The VolumeGuid member will always be FE_NETWORK_GUID.

Return value

The Dll must return one of these values:

      FESF_LOCK_ROUNDING::AlwaysOn  to indicate that all ranges are always rounded

      FESF_LOCK_ROUNDING::InsideFileOnly to indicate that rounding should only be applied within the current length of the file.  This is the usual default

      FESF_LOCK_ROUNDING::Off  to indicate that rounding should never be applied for this file.

Remarks

This function is called to set the rounding applied to LockFile operations prior to the request being passed across to remote file servers.  All IO from FESF is done via the cache and hence is aligned to page boundaries.  It is therefore usual to round all byte range lock requests out to the page boundary – this ensures that IO will always be accepted by the remote server.

Some applications are known to use byte range locks not to protect against application conflict, but rather to signal between remote copies of the application.  Typically, such applications will lock a single byte, usually well beyond the end of file, but occasionally within the file.  In this situation, the rounding of byte range locks stops the application from functioning whilst suppressing the lock rounding does not impede function (since it is not being used to arbitrate access to regions of the file).

The default rounding applied by FESF is to round to the page boundaries up to the end of file (plus a small margin).  This has been found to be the best compromise.  This default behavior can be overridden on a system wide basis by a registry setting.

This API allows control of the rounding on a per file basis.  So, for instance, files only accessed by Outlook, which is known to use lock rounding within the file in certain versions, can be marked as “never round”.

Examples

See Also

Requirements

Software version

FESF V1.8 (or later)

Library

FESFPolicy.lib

Header

PolDllApi.h