Adds or deletes containers from a log based on the state of the installed policies.
CLFSUSER_API BOOL SetLogFileSizeWithPolicy( IN HANDLE hLog, IN PULONGLONG pDesiredSize, OUT PULONGLONG pResultingSize );
A handle to a log.
A pointer to a value that specifies the requested log size, expressed as one of the following values. For the actual resultant size, refer to the pResultingSize parameter.
Enforce the minimum size policy.
If a minimum size policy is not installed, one of the following occurs:
If a minimum size policy is installed, one of the following occurs:
For more information, see InstallLogPolicy.
||Not a valid value; the function call fails with ERROR_INVALID_PARAMETER.|
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 function 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 function succeeds with no error.
If no maximum size policy is installed, the function call fails with 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 function succeeds with no error.
A pointer to a valid ULONGLONG data variable, receives the number of containers in the resized log upon success.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
Containers are created using the same security attributes as the .blf file and are created within the context of the application, not the context of the owner of the .blf file. For more information about .blf files, see Log Types. If containers are deleted, they are deleted using the security context of the calling application.
For an example that uses this function, see Creating a Log File.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 R2 [desktop apps only]|