Solved

ISAPI Redirect Exception

Posted on 2000-02-17
8
281 Views
Last Modified: 2013-11-20
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->ServerSupportFunction(HSE_REQ_SEND_URL,(LPVOID)(LPCSTR)st,NULL,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.
0
Comment
Question by:perrizo
  • 3
  • 3
  • 2
8 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 2533005
'(LPVOID)(LPCSTR)st' looks a bit suspicious - of what type is 'st' and what's the prototype of the method?
0
 
LVL 1

Author Comment

by:perrizo
ID: 2533014
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?
0
 
LVL 86

Expert Comment

by:jkr
ID: 2533160
I think it looks like a candidate, but maybe not - at least there seems to be no information how long the string is...
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2533412
jkr> at least there seems to be no information how long the string is...

Sure there is! The string is null-terminated!

..B ekiM
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 11

Accepted Solution

by:
mikeblas earned 400 total points
ID: 2533418
Please provide the code you're using to fire the event in the script, perrizo. Without seeing anything, it seems most likely that the IDispatch you're using to fire the event has become invalid. Maybe you're still holding on to the dispatch from the previous instance of the scripting engine.

..B ekiM
0
 
LVL 86

Expert Comment

by:jkr
ID: 2534778
>>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(...)]
0
 
LVL 1

Author Comment

by:perrizo
ID: 2552464
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!
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2552890
Great!  Good luck with your project.

..B ekiM
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now