Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After change to http.sys, errors on production servers after a few days of operation
#5
I'll split my response into more than one post because I think it will be simpler.

2)

I have never used myself TStSpawnApplication. The code looks solid, although it uses ShellExecuteEx() instead of the (IMO the preferred way to start another application) CreateProcess() Windows API.

In the old days we used to recommend ShellExecute(Ex) to start other processes, but a long time ago we found that it used to fail (mainly in ISAPI apps) under some special circumstances. Instead of banging our heads against the wall trying to fix it we just replaced it by CreateProcess() and the issues went away.
That's how the routine ExecProcess() in IWUtils was born. We don't use it ourselves in IW but we recommend our uses to use it whenever they want to run other processes from within an IW app. It's simple and don't have all the bells and whistles but works great.

AFAIK, ShellExecuteEx() does much more than CreateProcess() (including some Registry checks) and in the end it calls CreateProcess to do the actual job. The fact that it does some extra stuff (including Registry access) suggests me that it is more prone to fail.

Maybe it's worth a try and see if the problems go away. If you want, feel free to copy our ExecProcess() routine to the other application codebase and use it from there independently from IntraWeb.
Reply


Messages In This Thread
RE: After change to http.sys, errors on production servers after a few days of operation - by Alexandre Machado - 01-05-2023, 11:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)