Bewerken

Delen via


ClfsMgmtSetLogFileSize function (wdm.h)

The ClfsMgmtSetLogFileSize routine adds containers to a log or deletes containers from a log.

Syntax

CLFSUSER_API NTSTATUS ClfsMgmtSetLogFileSize(
  [in]           PLOG_FILE_OBJECT                     LogFile,
  [in]           PULONGLONG                           NewSizeInContainers,
  [out]          PULONGLONG                           ResultingSizeInContainers,
  [in, optional] PCLFS_SET_LOG_SIZE_COMPLETE_CALLBACK CompletionRoutine,
  [in, optional] PVOID                                CompletionRoutineData
);

Parameters

[in] LogFile

A pointer to a LOG_FILE_OBJECT structure that represents the CLFS log, or a stream within the log, to which containers are being added or deleted.

[in] NewSizeInContainers

A pointer to the requested log size. The caller sets this parameter to one of the following values.

Value Meaning
0 Enforce the minimum size policy. For more information about this policy, see ClfsMgmtInstallPolicy.

If a minimum size policy is not installed, one of the following occurs:

  • If the log currently has less than 2 containers, the log will be expanded to a size of 2 containers.
  • If the log currently has 2 or more containers, no changes are made and the call succeeds.
If a minimum size policy is installed, one of the following occurs:
  • If the log currently has less than the minimum number of containers specified by the minimum size policy, the log expands to the policy-specified minimum number of containers.
  • If the number of containers in the log is greater than or equal to the minimum number of containers specified by the minimum size policy, no changes are made and the call succeeds with no error.
1 Invalid value. The call fails and returns STATUS_INVALID_VALUE.
2 to 1023 The desired size of the log, expressed as the number of containers.

If this number is smaller than the minimum number of containers specified by the installed policy, the call fails with ERROR_COULD_NOT_RESIZE_LOG.

If this number is larger than the maximum number of containers specified by the installed policy, the log expands only as far as the policy-specified maximum number of containers, and the call succeeds with no error.

1024 to MAXULONGLONG If no maximum size policy is installed, the call fails and returns ERROR_LOG_POLICY_CONFLICT.

If a maximum size policy is installed, the log expands to the maximum number of containers specified by the maximum size policy and the call succeeds with no error.

 

To determine the actual log size, which might be different from the requested size, use the ResultingSizeInContainers parameter.

[out] ResultingSizeInContainers

A pointer to the resulting log size. If successful, the routine writes the actual size of the log, expressed as the number of containers in the log, to the location pointed to by this parameter.

[in, optional] CompletionRoutine

Not used. Set to NULL.

[in, optional] CompletionRoutineData

Not used. Set to NULL.

Return value

The ClfsMgmtSetLogFileSize routine returns one of the following NTSTATUS values:

Return code Description
STATUS_SUCCESS
The log file size has been set. The ResultingSizeInContainers parameter contains the current size of the log.
STATUS_UNSUCCESSFUL
CLFS management was not able to set the log file size.
STATUS_INVALID_PARAMETER_1
The value of the LogFile parameter is NULL, or the contents of the NewSizeInContainers parameter is 1.
STATUS_INVALID_PARAMETER_2
The value of the NewSizeInContainers parameter is NULL.
STATUS_LOG_POLICY_INVALID
There is a conflict between the maximum size and minimum size policies for the log.
STATUS_COULD_NOT_RESIZE_LOG
CLFS management could not delete enough containers to reach NewSizeInContainers.
STATUS_LOG_POLICY_CONFLICT
CLFS management could not add enough containers to the log to reach NewSizeInContainers. This might be due to a conflict with a policy that the client set.
 

This routine might also return other NTSTATUS Values.

Remarks

The ClfsMgmtSetLogFileSize routine is typically used only when a client starts or stops. Do not call the ClfsMgmtSetLogFileSize routine from within your ClfsAdvanceTailCallback function.

Requirements

Requirement Value
Minimum supported client Available starting with Windows Server 2003 R2 and Windows Vista.
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_TYPE

ClfsMgmtInstallPolicy