The information in this article applies to:
SYMPTOMSWhen an MFC ISAPI extension DLL generates HTML text whose length is exactly a multiple of 4096 bytes, an access violation is generated in Internet Information Server (IIS). This results in a crash of IIS if your ISAPI DLL is running in process, or a crash of the process hosting your ISAPI DLL (usually mtx.exe) if you are running out of process under IIS 4. CAUSEThere is a bug with the CHtmlStream class (in the CHtmlStream::Detach() method), where a null character is appended to the end of the stream to end the string. The buffer is allocated in 4K increments, and if the size of the stream is a multiple of 4K, the null character is written in memory that has not been allocated. RESOLUTION
To work around this problem, make sure that the length of the CHtmlStream
is not a multiple of 4096. You can use code similar to this:
You will need to do this at the end of any function that returns data to the server. Here is an example:
You want to put this code at the end of the proc because any of the code before this may change the size of the buffer. STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this bug and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
Additional query words: kbVC420bug kbDSupport
Keywords : kbISAPI kbMFC kbVC kbVC410bug kbVC500bug iisapi |
Last Reviewed: April 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |