IIS 6.0: Invalid Parameter Error When Setting a String Property in the Metabase (332089)



The information in this article applies to:

  • Microsoft Internet Information Services
  • Microsoft Internet Information Services version 6.0

This article was previously published under Q332089

SYMPTOMS

When you are setting a string value in the Internet Information Services (IIS) 6.0 Metabase by using the SetData method of the IIS Admin Base Object (ABO), you may receive the following error message:
E R R O R _ I N V A L I D _ P A R A M E T E R
You may receive the error when setting the value on a server that is running IIS 6.0 using the same code that did not generate an error in earlier versions of IIS.

CAUSE

The parameter that is passed to the SetData method and that specifies the length of the data in bytes does not include a terminating null character at the end of the string.

MORE INFORMATION

The METADATA_RECORD structure contains information about a metabase entry. The entry is used as an input parameter by the SetData method and as an input/output parameter by methods that retrieve data from the metabase. For example, the methods GetData, EnumData, or GetAllData.

The METADATA_RECORD structure contains a DWORD that specifies the length of the data in bytes (for example, dwMDDataLen). If the data is a string, this value should include the ending null character.

Earlier versions of IIS do not verify that the string that is being passed is null terminated. Because a string without the null terminating character has the potential to generate an access violation or return invalid data when read, IIS version 6.0 verifies that the string is null terminated.

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:7/25/2003
Keywords:kbpending kbprb KB332089 kbAudDeveloper