IFhConfigMgr::AddRemoveExcludeRule method (fhcfg.h)
Adds an exclusion rule to the exclusion list or removes a rule from the list.
Note
IFhConfigMgr is deprecated and may be altered or unavailable in future releases.
Syntax
HRESULT AddRemoveExcludeRule(
[in] BOOL Add,
[in] FH_PROTECTED_ITEM_CATEGORY Category,
[in] BSTR Item
);
Parameters
[in] Add
If this parameter is TRUE, a new exclusion rule is added. If it is set to FALSE, an existing exclusion rule is removed.
[in] Category
Specifies the type of the exclusion rule. See the FH_PROTECTED_ITEM_CATEGORY enumeration for possible values.
[in] Item
The folder path or library name or GUID of the item that the exclusion rule applies to.
Return value
S_OK on success, or an unsuccessful HRESULT value on failure. Possible unsuccessful HRESULT values include values defined in the FhErrors.h header file.
Remarks
The File History protection scope is the set of files that are backed up by the File History feature. It contains inclusion rules and exclusion rules. Inclusion rules specify the files and folders that are included. Exclusion rules specify the files and folders that are excluded.
The default protection scope includes all folders from all user libraries and the Contacts, Desktop, and Favorites folders.
Exclusion rules take precedence over inclusion rules. In other words, if an inclusion rule conflicts with an exclusion rule, the File History feature follows the exclusion rule.
To reduce the protection scope, use the IFhConfigMgr::AddRemoveExcludeRule to add exclusion rules.
This method can be used to add or remove exclusion rules. It cannot be used to modify inclusion rules.
User libraries can be enumerated by calling the SHGetKnownFolderItem function and the methods of the IShellItem and IEnumShellItems interfaces.
Standard folders and libraries are specified by a GUID, prefixed with an asterisk. For example, *a990ae9f-a03b-4e80-94bc-9912d7504104 specifies the Pictures library. For a list of standard folders and libraries and their GUIDs, see the KNOWNFOLDERID documentation.
Custom libraries are specified by name. Folders are specified by their full path (for example, C:\Users\Public\Videos).
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps only] |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | fhcfg.h |