The METADATA_RECORD structure contains information about a metabase entry. It is used as an input parameter by the SetData method and as an [in,out] parameter by methods that retrieve data from the metabase, such as GetData, EnumData, or GetAllData.

Example Code

typedef struct  _METADATA_RECORD {  
  DWORD dwMDIdentifier;  
  DWORD dwMDAttributes;  
  DWORD dwMDUserType;  
  DWORD dwMDDataType;  
  DWORD dwMDDataLen;  
  unsigned char *pbMDData;  
  DWORD dwMDDataTag;  


  • dwMDIdentifier
    A DWORD that uniquely identifies the metabase entry, for example, MD_SERVER_STATE.

  • dwMDAttributes
    Flags that specify how to set or get data from the metabase. This member can be set to one or more of the following values:




    Set: The data can be inherited.

    Get: Return inheritable data.


    For a string data item:

    Set: Indicates the string contains MD_INSERT_PATH_STRINGW.

    Get: Replace MD_INSERT_PATH_STRINGW with the path of the data item relative to the handle.


    Set: Not valid.

    Get: Mark data items that were inherited.


    Set: The data does not have any attributes.

    Get: Not applicable. Data is returned regardless of this flag setting.


    Set: Not valid.

    Get: Return S_OK and any inherited data even if the entire path is not present. This flag is only valid if METADATA_INHERIT is also set.


    Set: The data was retrieved by reference.

    Get: Not valid.


    Set: Store and transport the data in a secure fashion.

    Get: Not valid.


    Set: Do not save the data in long-term storage.

    Get: Not valid.

  • dwMDUserType
    A DWORD that specifies the user type of the data. When you use the SetData method to create a new data item, specify a user type above 2,000. User types 2,000 and below are reserved. When retrieving or updating data, this parameter specifies the user type assigned to the data item.

    IIS currently uses the following user types:

    User type



    The entry contains information specific to ASP application configuration.


    The entry contains information about a file, such as access permissions, or logon methods.


    The entry contains information specific to the server, such as ports in use and IP addresses.


    The entry contains information specific to Web application management.

  • dwMDDataType
    Identifies the type of data in the metabase entry. This parameter can be one of the following values:

    Data type



    Set: Not valid

    Get: Return data regardless of type.


    Binary data in any form.


    An unsigned 32-bit number.


    A null-terminated string that contains unexpanded environment variables, such as %PATH%. The environment variables are not expanded by the IIS Admin Base Object.


    An array of null-terminated strings, terminated by two null characters.


    A null-terminated string.

  • dwMDDataLen
    A DWORD that specifies the length of the data in bytes. If the data is a string, this value includes the ending null character. For multisz data (a list of strings), this includes an additional null character after the final string. For example, the length of a multisz string containing two strings would be:

    (wcslen(stringA) + 1) * sizeof(WCHAR) + (wcslen(stringB) + 1) * sizeof(WCHAR) + 1 * sizeof(WCHAR)

    In-process clients need to specify dwMDDataLen only when setting binary and multisz values in the metabase. Remote applications must specify dwMDDataLen for all data types.

  • pbMDData
    When METADATA_RECORD is being used with methods such as IMSAdminBase::SetData to set a value in the metabase, pbMDData points to a buffer that contains the new data. When METADATA_RECORD is being used with methods such as IMSAdminBase::GetData to retrieve data from the metabase, pbMDData points to a buffer that will receive the data.

  • dwMDDataTag
    Reserved. Do not use.


Client: Requires Windows XP Professional, Windows 2000 Professional, or Windows NT Workstation 4.0.

Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.

Product: IIS

Header: Declared in Mddefw.h; include iiscnfg.h, iadmw.h.