I've been given an ISAPI extension dll compiled in VC6 which calls "ServerSupportFunction" through MFC's CHttpServerContext class. The code looks something like (assume Ctx is object of the class CHttpServerContext)
CString str;
str = "Content-Type: text/plain\r\n";
str += "Content-Length: 200\r\n";
str += "\r\n";
DWORD len = str.GetLength();
Ctx->ServerSupportFunction(HSE_REQ_SEND_RESPONSE_HEADER,NULL,
&len,
(LPWORD)(LPCTSTR)str);
when running on windows 2003 IIS6 , this code works fine. If running on windows 2008 IIS7 it returns a windows error code of ERROR_INVALID_PARAMETER
if i change the last parameter to be (LPWORD)"Content-Type: text/plain\r\n\r\n" instaed of using CString , the function call succeed. The dll is compiled in windows xp with VC6 with static MFC .
Since i reluctant to change the dll code , does anyone know of a reason why this problem occurs in windows 2008 and how it can be solved?
Was there any change in windows 2008 affecting this? (I didn't found any) Can it be related to the machine codepage? Should the dll compiled differenatly?(maybe without UNICODE)