Compartilhar via


Property Inheritance in ABO

This topic describes how inheritance works in ABO. It is recommended that you read Metabase Structure before working with metabase property inheritance in ABO.

How Inheritance Works in IIS

The IIS metabase allows properties to inherit values from parent nodes. For the Web application developer, inheritance is an efficient tool for setting properties. Inheritance also keeps the physical size of the metabase configuration file manageable. But inheritance requires extra processing time when IIS tries to access the value of the property at the child node.

If you add a data entry to a key and specify it as inheritable, all of its subkeys can access that data. For example, if you add the inheritable data MD_MYDATA to the key /LM, the subkeys /LM/W3SVC and /LM/MSFTPSVC can also return MD_MYDATA; their subkeys can also return MD_MYDATA. However, if a subkey already has data with the same metabase identifier set, the inheritable data is not applied to it, nor to its subkeys. Inheritance cannot skip keys because keys inherit data from the nearest parent key where the identifier is set.

Setting and Retrieving Inherited Data

You can specify that an entry is inheritable by setting the METADATA_INHERIT flag in the dwMDAttributes member of the METADATA_RECORD structure that is passed to the SetData method.

When retrieving data, you can specify that inherited data be returned by setting the METADATA_INHERIT flag in the dwMDAttributes member of the METADATA_RECORD structure that is passed to the GetData or EnumData method. For the GetAllData method, you must specify this flag in the dwMDAttributes parameter. If the METADATA_INHERIT flag is not set, inherited data is not returned.

You can use the METADATA_PARTIAL_PATH flag to specify that inherited data be returned, even if a requested path does not exist. If you add the same inheritable data at the key /LM as in the preceding example, a subkey /LM/MySvc would return the inheritable data, MD_MYDATA, regardless of whether that key actually exists in the metabase. The METADATA_PARTIAL_PATH flag applies only if the METADATA_INHERIT flag is also set.

You can use the METADATA_PARTIAL_PATH flag to minimize the number of keys you create in the metabase. For example, if files in a directory have no metabase data of their own, you can specify data as inheritable at the directory key and use the METADATA_PARTIAL_PATH flag to return inherited data for individual files without having to create keys for them.

You can use the METADATA_ISINHERITED flag to determine if retrieved data is local or inherited. If specified on a call to any method that retrieves data, the method will return METADATA_ISINHERITED for inherited data elements.

See Also