The ILogPlugin::QueryExtraLoggingFields method returns incorrectly formatted data in IIS 6.0 (883661)



The information in this article applies to:

  • Microsoft Internet Information Services version 6.0

SYMPTOMS

When you create a custom logging module in Microsoft Internet Information Services (IIS) 6.0, and you use the ILogPlugin::QueryExtraLoggingFields method to retrieve custom headers in the custom logging module, the ILogPlugin::QueryExtraLoggingFields method retrieves header data that is incorrectly formatted.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows Server 2003 that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

No prerequisites are required.

Restart requirement

Stop IIS before you install this hotfix, and then restart IIS after you install this hotfix.

Note To stop IIS, click Start, click Run, type iisreset /stop in the Open box, and then click OK. To start IIS after you stop it, click Start, click Run, type iisreset /start in the Open box, and then click OK.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Microsoft Windows Server 2003

Date         Time   Version        Size    File name
-------------------------------------------------------
26-Aug-2004  22:08  6.0.3790.206  343,040  W3core.dll       
26-Aug-2004  22:08  6.0.3790.206    9,728  W3comlog.dll

Microsoft Windows Server 2003, 64-Bit Edition

Date         Time   Version        Size    File name
-------------------------------------------------------------
26-Aug-2004  22:08  6.0.3790.206   21,504  W3comlog.dll  IA64
26-Aug-2004  22:08  6.0.3790.206  951,808  W3core.dll    IA64

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

The following is an example that demonstrates the problem that occurs when the custom headers are logged. In this example, A, B, and C are custom headers.

The IIS logging module processes header A, header B, and header C as follows:
STDMETHODIMP CLogMod::QueryExtraLoggingFields(PDWORD cbSize, PCHAR szParameters)

{

CHAR szExtraHeaders[] = "A:\0B:\0C:\0Host:\0\0";

if(sizeof(szExtraHeaders) > *cbSize)

{

*cbSize = sizeof(szExtraHeaders);

return ERROR_INSUFFICIENT_BUFFER;

}

 

memmove(szParameters, szExtraHeaders, sizeof(szExtraHeaders));

*cbSize = sizeof(szExtraHeaders);

return S_OK;

}
The headers are retrieved as follows:
STDMETHODIMP CLogMod::LogInformation(IInetLogInformation *pLogObj)

{

 

char szExtra[1024] = "";

CHAR *szHeaders;

DWORD dwSize;

memset(szExtra, 0, sizeof(szExtra));

dwSize = sizeof(szExtra);

szHeaders = pLogObj->GetExtraHTTPHeaders(szExtra, &dwSize);

.

}
In this example, if the client sends header A and header C, and does not send header B, the following incorrect string is returned:

Value_for_A\0Value_for_C\0\0

The correct string is listed as follows, where "\0" (without the quotation marks) is the value for the missing header B:

Value_for_A\0\0Value_for_C\0\0

REFERENCES

For more information about the LogMod.exe sample IIS logging module, click the following article number to view the article in the Microsoft Knowledge Base:

259552 IIS logging module

For more information about the ILogPlugin::QueryExtraLoggingFields method, visit the following Microsoft Web site: For more information about custom logging modules in IIS 6.0, visit the following Microsoft Web sites: For more information about standard terminology that is used to describe Microsoft software updates, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Modification Type:MajorLast Reviewed:6/21/2006
Keywords:kbBug kbfix kbWinServ2003preSP1fix kbHotfixServer kbQFE KB883661 kbAudITPRO kbAudDeveloper