perrizo
asked on
ISAPI Redirect Exception
Hi, I have written an ISAPI extension dll that host active scripting. It seems to be working well, except for one thing. When I redirect to a URL using...
pCtxt->ServerSupportFuncti on(HSE_REQ _SEND_URL, (LPVOID)(L PCSTR)st,N ULL,NULL);
the very next time the extension handles a request and tries to fire an ActiveX event I get an unhandled exception (type unkown?). If I do not do the redirect then the exception is never thrown. Can anyone help? I can supply some more code if necessary.
pCtxt->ServerSupportFuncti
the very next time the extension handles a request and tries to fire an ActiveX event I get an unhandled exception (type unkown?). If I do not do the redirect then the exception is never thrown. Can anyone help? I can supply some more code if necessary.
'(LPVOID)(LPCSTR)st' looks a bit suspicious - of what type is 'st' and what's the prototype of the method?
ASKER
st is a CString. I have used this format in another extension that was not an Active Scripting host and it seemed to work fine. Do you think this is a problem?
I think it looks like a candidate, but maybe not - at least there seems to be no information how long the string is...
jkr> at least there seems to be no information how long the string is...
Sure there is! The string is null-terminated!
..B ekiM
Sure there is! The string is null-terminated!
..B ekiM
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>Sure there is! The string is null-terminated!
Ooops, you're right... <blushing>
Well, the only excuse could be that I thought of it as
[in, out, string, size_is(...)]
Ooops, you're right... <blushing>
Well, the only excuse could be that I thought of it as
[in, out, string, size_is(...)]
ASKER
Mikeblas, You were correct... close at least. It sent me in the correct direction. Seems that when you call SetScriptSite VBScript.dll remembers which thread you called it from and only accepts messages from that thread. Funny thing was that when you do a redirect IIS always issues the next call on a different thread but, most of the time on a simple WriteClient IIS tends to issue the next call on the same thread. The problem/feature is outlined in KB article...
http://support.microsoft.com/support/kb/articles/q222/8/37.asp
Just thought you might find it interesting... thanks!
http://support.microsoft.com/support/kb/articles/q222/8/37.asp
Just thought you might find it interesting... thanks!
Great! Good luck with your project.
..B ekiM
..B ekiM