Parsing Property Lists

The recommended way to parse a property list is to use one of the property list parsing functions to locate a specific type of value. Both cluster-aware applications and resource DLLs can use these functions.

If no parsing function exists for the type of data you are seeking, you can parse the property list with CLUSPROP_BUFFER_HELPER (see Using CLUSPROP_BUFFER_HELPER).

#include <windows.h>

//////////////////////////////////////////////////////////////////////

#include "ClusDocEx.h"

//////////////////////////////////////////////////////////////////////

#ifndef _CLUSDOCEX_GRPGETRWCDWPROPVALUE_CPP
#define _CLUSDOCEX_GRPGETRWCDWPROPVALUE_CPP
//--------------------------------------------------------------------
//
//  ClusDocEx_GrpGetRWCDwPropValue
//
//  Retrieves a read-write common (RWC) group property value
//  of type DWORD.
//
//  Arguments:
//      IN HGROUP hGroup            Handle to the group.
//      IN LPWSTR lpszPropName      Name of property to find.
//      OUT LPDWORD lpdwPropValue   Returns the value of property.
//
// Return Value:
//      System error code
//
//--------------------------------------------------------------------
DWORD GrpGetRWCDwPropValue( 
    IN HGROUP hGroup,
    IN LPCWSTR lpszPropName,
    OUT LPDWORD lpdwPropValue
)
{
    DWORD dwResult = ERROR_SUCCESS;
    DWORD cbPropListSize = 0;

//  Retrieve a property list

    LPVOID lpPropList = ClusDocEx_GrpGetControlCodeOutput(
                            hGroup,
                            NULL,
                            CLUSCTL_GROUP_GET_COMMON_PROPERTIES,
                            &amp;cbPropListSize );

    if( lpPropList != NULL )
    {

    //  Parse the property list for the property specified
    //  by lpszPropName.

        dwResult = ResUtilFindDwordProperty( 
                       lpPropList, 
                       cbPropListSize, 
                       lpszPropName, 
                       lpdwPropValue );

        if ( dwResult != ERROR_SUCCESS )
        {
        //  Add error handling if necessary.
        }

        LocalFree( lpPropList );

    }
    else
    {
        dwResult = GetLastError();
    }

    return dwResult;

}
//
//  end GrpGetRWCDwProp()
//--------------------------------------------------------------------
#endif