The property table utility functions handle multiple properties using an array of RESUTIL_PROPERTY_ITEM structures. Also known as a property table, the RESUTIL_PROPERTY_ITEM array describes properties. Each entry in the table includes the property's name, cluster database key, format, default value, minimum and maximum values, a set of flags, and an offset to a parameter block containing the location of the property's data. A parameter block is a structure that includes as members either the data for properties in a property table or pointers to the properties' data.
For example, the following structure shows a typical parameter block for a Generic Application resource:
typedef struct _GENAPP_PARAMS {
LPWSTR CommandLine;
LPWSTR CurrentDirectory;
DWORD UseNetworkName;
DWORD InteractWithDesktop;
} GENAPP_PARAMS, *PGENAPP_PARAMS;
The GENAPP_PARAMS structure contains one member for each of the properties defined for a Generic Application resource. The first two members are pointers to the CommandLine and CurrentDirectory strings; the second two members are the actual UseNetworkName and InteractWithDesktop values.
Each of the entries in the property table created to describe these Generic Application properties has an offset to the member in the GENAPP_PARAMS parameter block that either points to or contains the data. The property table would be defined as follows:
RESUTIL_PROPERTY_ITEM GenAppResPrivateProps[] = {
{PARAM_NAME__COMMAND_LINE, NULL,
CLUSPROP_FORMAT_SZ, 0, 0, 0,
RESUTIL_PROPITEM_REQUIRED,
FIELD_OFFSET(GENAPP_PARAMS,CommandLine) },
{PARAM_NAME__CURRENT_DIRECTORY, NULL,
CLUSPROP_FORMAT_SZ, 0, 0, 0,
RESUTIL_PROPITEM_REQUIRED,
FIELD_OFFSET(GENAPP_PARAMS,CurrentDirectory) },
{PARAM_NAME__INTERACTWITHDESKTOP, NULL,
CLUSPROP_FORMAT_DWORD,
PARAM_DEFAULT__INTERACTWITHDESKTOP,
PARAM_MIN__INTERACTWITHDESKTOP,
PARAM_MAX__INTERACTWITHDESKTOP,
RESUTIL_PROPITEM_REQUIRED,
FIELD_OFFSET(GENAPP_PARAMS,InteractWithDesktop) },
{PARAM_NAME__USENETWORKNAME, NULL,
CLUSPROP_FORMAT_DWORD,
PARAM_DEFAULT__USENETWORKNAME,
PARAM_MIN__USENETWORKNAME,
PARAM_MAX__USENETWORKNAME,
RESUTIL_PROPITEM_REQUIRED,
FIELD_OFFSET(GENAPP_PARAMS,UseNetworkName) },
{0 }
};
The property table utility functions are briefly described in the following table; notice that some of the property table functions are also used for property lists:
Function | Description |
---|---|
ResUtilDupParameterBlock | Duplicates a parameter block. |
ResUtilEnumProperties | Enumerates the properties of a resource. |
ResUtilFreeParameterBlock | Frees a specified parameter block. |
ResUtilGetAllProperties | Returns all of the default and unknown properties for a cluster object, such as a resource or group. This function is also used for working with a property list. |
ResUtilGetProperties | Returns specified properties for a resource. This function is also used for working with a property list. |
ResUtilGetProperty | Returns one of a resource's properties. |
ResUtilGetPropertySize | Returns the total number of bytes required for one or more property values. |
ResUtilSetPropertyParameterBlock | Sets properties for a resource from a parameter block. |
ResUtilSetPropertyTable | Sets properties for a resource based on a property list from a property table. |
ResUtilVerifyPropertyTable | Validates properties for a resource based on a property list from a property table. |