ClfsMgmtInstallPolicy function (wdm.h)

The ClfsMgmtInstallPolicy routine adds a CLFS_MGMT_POLICY structure to a physical log.

Syntax

CLFSUSER_API NTSTATUS ClfsMgmtInstallPolicy(
  [in] PLOG_FILE_OBJECT  LogFile,
  [in] PCLFS_MGMT_POLICY Policy,
  [in] ULONG             PolicyLength
);

Parameters

[in] LogFile

A pointer to a LOG_FILE_OBJECT structure that represents the CLFS log that this instance of the CLFS_MGMT_POLICY structure will apply to. The policy applies to all streams within the log, even if a single stream within the log was specified.

[in] Policy

A pointer to a CLFS_MGMT_POLICY structure that contains the policy to be installed.

[in] PolicyLength

The length, in bytes, of the structure pointed to by the Policy parameter.

Return value

The ClfsMgmtInstallPolicy routine returns one of the following NTSTATUS values:

Return code Description
STATUS_SUCCESS
The policy has been installed.
STATUS_INVALID_PARAMETER_1
A NULL value was supplied for the LogFile parameter.
STATUS_INVALID_PARAMETER_2
A NULL value was supplied for the Policy parameter.
STATUS_INVALID_PARAMETER_3
The value of the PolicyLength parameter is less than the size of an instance of the CLFS_MGMT_POLICY structure.
STATUS_NOT_SUPPORTED
The PolicyFlags member of the CLFS_MGMT_POLICY_STRUCTURE pointed to by the Policy parameter specifies any flag other than LOG_POLICY_OVERWRITE.
STATUS_INVALID_PARAMETER
One of the following conditions is true:
  • The Policy parameter's Version member is not equal to CLFS_MGMT_POLICY_VERSION.
  • The value of the Policy parameter is equal to ClfsMgmtPolicyInvalid.
  • The Policy parameter's PolicyFlags member specifies any flag other than LOG_POLICY_OVERWRITE.
STATUS_LOG_POLICY_ALREADY_INSTALLED
The log already has a policy of this type, and the LOG_POLICY_OVERWRITE flag is not set.
STATUS_INSUFFICIENT_RESOURCES
There is insufficient memory to complete the operation.
 

This routine might also return other NTSTATUS Values.

Remarks

Policies are volatile. When all handles to the log are closed, the policies will be lost. You should install policies each time you register the first client.

You should only register a CLFS_MGMT_POLICY structure whose PolicyType member is equal to ClfsMgmtPolicyNewContainerSize before the first container in the log is created. Any subsequent registrations are ignored.

The log policy that is installed applies to the physical log, even if the LogFile parameter specifies a log stream.

Requirements

Requirement Value
Minimum supported client Available in Windows Server 2003 R2, Windows Vista, and later versions of Windows.
Target Platform Desktop
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library Clfs.lib
DLL Clfs.sys
IRQL <= APC_LEVEL

See also

CLFS_MGMT_POLICY