cvs: /php4/sapi/isapi php4isapi.c

From: Date: Sun, 19 Mar 2000 17:59:35 +0000
Subject: cvs: /php4/sapi/isapi php4isapi.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-12408@lists.php.net to get a copy of this message
shane Sun Mar 19 09:59:35 2000 EDT Modified files: /php4/sapi/isapi php4isapi.c Log: just a little more detail in exception report Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.30 php4/sapi/isapi/php4isapi.c:1.31 --- php4/sapi/isapi/php4isapi.c:1.30 Fri Feb 25 21:03:41 2000 +++ php4/sapi/isapi/php4isapi.c Sun Mar 19 09:59:05 2000 @@ -504,6 +504,13 @@ #endif } +// ___except can only call a function, so we have to do this +// to retrieve the pointer. +BOOL exceptionhandler(LPEXCEPTION_POINTERS *e,LPEXCEPTION_POINTERS ep) +{ + *e=ep; + return TRUE; +} DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { @@ -513,6 +520,7 @@ CLS_FETCH(); ELS_FETCH(); PLS_FETCH(); + LPEXCEPTION_POINTERS e; if (setjmp(EG(bailout))!=0) { php_request_shutdown(NULL); @@ -532,8 +540,10 @@ if (SG(request_info).cookie_data) { efree(SG(request_info).cookie_data); } - } __except(EXCEPTION_EXECUTE_HANDLER) { + } __except(exceptionhandler(&e,GetExceptionInformation())) { +// } __except(EXCEPTION_EXECUTE_HANDLER) { #ifdef PHP_WIN32 + char buf[1024]; if (_exception_code()==EXCEPTION_STACK_OVERFLOW) { LPBYTE lpPage; static SYSTEM_INFO si; @@ -562,17 +572,17 @@ } CG(unclean_shutdown)=1; - php_isapi_report_exception("Stack overflow", sizeof("Stack overflow")-1 SLS_CC); + _snprintf(buf,sizeof(buf)-1,"PHP has encountered a Stack overflow"); } else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) { - php_isapi_report_exception("Access violation", sizeof("Access violation")-1 SLS_CC); + _snprintf(buf,sizeof(buf)-1,"PHP has encountered an Access Violation at %p",e->ExceptionRecord->ExceptionAddress); my_endthread(); } else { - php_isapi_report_exception("Unknown fatal exception", sizeof("Unknown fatal exception")-1 SLS_CC); + _snprintf(buf,sizeof(buf)-1,"PHP has encountered an Unhandled Exception Code %d at %p",e->ExceptionRecord->ExceptionCode , e->ExceptionRecord->ExceptionAddress); my_endthread(); } + php_isapi_report_exception(buf, strlen(buf) SLS_CC); #endif } - __try { php_request_shutdown(NULL); } __except(EXCEPTION_EXECUTE_HANDLER) {

« previous php.version4 (#12408) next »