Microsoft KB Archive/332089

= IIS 6.0: Invalid Parameter Error When Setting a String Property in the Metabase =

Article ID: 332089

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Server 1.01
 * Microsoft Internet Information Services 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.



RESOLUTION
For more information about the METADATA_RECORD structure and its use, see the following Microsoft Web sites:

http://msdn.microsoft.com/library/en-us/iisref/htm/ref_abo_imsstrcmdrec.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/AdministrationTasksUsingtheIISAdminBaseObjectABO.asp



STATUS
This behavior is by design.

Additional query words: iis 5

Keywords: kbprb kbpending KB332089

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.