Article content
In other words, after a variety of complicated internal processes we don't know, unmanaged code officially starts calling the Ispairuntime ProcessRequest method (Ispairuntime inherits the Iispairuntime interface, which interacts with COM, and exposes the ProcessRequest interface method). As for why to call this method, uncle is not very clear, can not find Microsoft related information Oh. But the uncle decided that this method is we enter httpruntime the official gate, then see.
public int ProcessRequest (IntPtr ECB, int iwrtype) {IntPtr phttpcompletion = IntPtr.Zero;
if (Iwrtype = = worker_request_type_in_proc_version_2) {phttpcompletion = ECB;
ECB = UNSAFENATIVEMETHODS.GETECB (phttpcompletion);
} isapiworkerrequest WR = null;
try {bool Useoop = (Iwrtype = = Worker_request_type_oop);
WR = Isapiworkerrequest.createworkerrequest (ECB, useoop); wr.
Initialize ();
Check if app path matches (need to restart app domain?) String Wrpath = wr.
Getapppathtranslated ();
String ADPath = httpruntime.appdomainapppathinternal;
if (ADPath = null | |
Stringutil.equalsignorecase (Wrpath, ADPath)) {Httpruntime.processrequestnodemand (WR);
return 0;
}
else {//need to restart app domain Httpruntime.shutdownappdomain (app Licationshutdownreason.physicalapplicationpathchanged, SR. GetString (SR.
Hosting_phys_path_changed, ADPath,
Wrpath));
return 1; } catch (Exception e) {try {Webbaseevent.raiseruntimeer
Ror (E, this); is the catch {}//Have we called hse_req_done_with_session?
If So, don ' t re-throw. if (WR!= null && WR. ECB = = IntPtr.Zero) {if (phttpcompletion!= intptr.zero) {Unsafenativemeth Ods.
Setdonewithsessioncalled (phttpcompletion); }//If this is a thread abort exception, cancel the abort if (E is Th
readabortexception) {thread.resetabort ();
}//Important:if this thread is being aborted because of a appdomain.unload, The CLR would still throw an appdomainunloadedexception.
The native caller//must special case cor_e_appdomainunloaded (0x80131014) and not
Call hse_req_done_with_session more than once.
return 0;
}//Re-throw If we have not called hse_req_done_with_session throw; }
}