SetLogFileSizeWithPolicy function (clfsmgmtw32.h)
Adds or deletes containers from a log based on the state of the installed policies.
Syntax
CLFSUSER_API BOOL SetLogFileSizeWithPolicy(
[in] HANDLE hLog,
[in] PULONGLONG pDesiredSize,
[out] PULONGLONG pResultingSize
);
Parameters
[in] hLog
A handle to a log.
[in] pDesiredSize
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.
Value | Meaning |
---|---|
|
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. |
[out] pResultingSize
A pointer to a valid ULONGLONG data variable, receives the number of containers in the resized log upon success.
Return value
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.
Remarks
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.
Examples
For an example that uses this function, see Creating a Log File.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 R2 [desktop apps only] |
Target Platform | Windows |
Header | clfsmgmtw32.h |
Library | Clfsw32.lib |
DLL | Clfsw32.dll |