Google Groups Home
Help | Sign in
Vista certification - Errors to be handled by Windows Error Reporting
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jeremi Reda  
View profile
 More options Nov 25 2007, 5:50 am
Newsgroups: borland.public.delphi.non-technical
From: "Jeremi Reda" <Jer...@reda.fsworld.co.uk>
Date: Sun, 25 Nov 2007 10:50:55 -0000
Local: Sun, Nov 25 2007 5:50 am
Subject: Vista certification - Errors to be handled by Windows Error Reporting
One of the requirements for Vista certification is,

"If a fault (such as an Access Violation) is injected into an application,
the application must allow Windows Error Reporting to report this crash."

I use Delphi 5 and any Access Violation is ultimately handled by the Delphi
exception handler which shows a simple message box.

Is there any way to let the Access Violation fall through to the Windows
Error Reporting facility?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco van de Voort  
View profile
 More options Nov 25 2007, 9:29 am
Newsgroups: borland.public.delphi.non-technical
From: Marco van de Voort <mar...@stack.nl>
Date: 25 Nov 2007 07:29:18 -0700
Local: Sun, Nov 25 2007 9:29 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting
On 2007-11-25, Jeremi Reda <Jer...@reda.fsworld.co.uk> wrote:

> One of the requirements for Vista certification is,

> "If a fault (such as an Access Violation) is injected into an application,
> the application must allow Windows Error Reporting to report this crash."

> I use Delphi 5 and any Access Violation is ultimately handled by the Delphi
> exception handler which shows a simple message box.

> Is there any way to let the Access Violation fall through to the Windows
> Error Reporting facility?

Don't know how, but I do know where, replace application.onexception
handler. Maybe replacing it with an empty method will even propagate it to
windows via SEH.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markus.Humm  
View profile
 More options Nov 25 2007, 11:45 am
Newsgroups: borland.public.delphi.non-technical
From: "Markus.Humm" <markus.h...@freenet.de>
Date: Sun, 25 Nov 2007 17:45:13 +0100
Local: Sun, Nov 25 2007 11:45 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting
Hello,

I think this MS requirement is just plain silly for Delphi developpers
as e.g. MadExcept and others will give you a very usefull stacktracke in
case of a exception which can be mailed directly to the developper where
MS error reporting surely won't/can't interpret the Delphi stack etc. so
it would only be able to record memory addresses and CPU state etc. but
that's not too helpfull. And by using this Windows error reporting MS
can possibly see all your problems because afaik their servers handle
this. I'm not too fond of this. Requiring a decent error handling is
justified but requiring one so tight coupled to MS is bad!
(shouldn't somebody tell this the EU commission? ;-))

Greetings

Markus


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Morgan  
View profile
 More options Nov 25 2007, 12:11 pm
Newsgroups: borland.public.delphi.non-technical
From: "Chris Morgan" <chris.nospam at lynxinfo dot co dot uk>
Date: Sun, 25 Nov 2007 17:11:51 -0000
Local: Sun, Nov 25 2007 12:11 pm
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting

> I think this MS requirement is just plain silly for Delphi developpers as
> e.g. MadExcept and others will give you a very usefull stacktracke in case
> of a exception which can be mailed directly to the developper where MS
> error reporting surely won't/can't interpret the Delphi stack etc. so it
> would only be able to record memory addresses and CPU state etc. but
> that's not too helpfull. And by using this Windows error reporting MS can
> possibly see all your problems because afaik their servers handle this.
> I'm not too fond of this. Requiring a decent error handling is justified
> but requiring one so tight coupled to MS is bad!
> (shouldn't somebody tell this the EU commission? ;-))

Vista-certification isn't compulsory. If you don't agree
with it, you can still sell your programs as vista-compatible.

cheers,

Chris


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andre Kaufmann  
View profile
 More options Nov 26 2007, 12:09 am
Newsgroups: borland.public.delphi.non-technical
From: Andre Kaufmann <andre.kaufmann_re_mo...@t-online.de>
Date: Mon, 26 Nov 2007 06:09:07 +0100
Local: Mon, Nov 26 2007 12:09 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting

Markus.Humm wrote:
> Hello,

> I think this MS requirement is just plain silly for Delphi developpers
> as e.g. MadExcept and others will give you a very usefull stacktracke in
> case of a exception which can be mailed directly to the developper where
> MS error reporting surely won't/can't interpret the Delphi stack etc. so
> it would only be able to record memory addresses and CPU state etc. but
> that's not too helpfull.

You at least can see the stack traces of exported functions. If Delphi
could support the Microsoft debugging format (PDB) too you would see
everything like variable content, thread states etc. at the crash.
Additionally all the tools available for Intel or Microsoft products
could be fully used with Delphi, e.g. profilers like VTune.

> And by using this Windows error reporting MS
> can possibly see all your problems because afaik their servers handle
> this.

You can download the reports of your own application from the Microsoft
servers, if you have been registered. AFAIK Microsoft simply drops the
reports of unregistered applications.

> I'm not too fond of this. Requiring a decent error handling is
> justified but requiring one so tight coupled to MS is bad!
> (shouldn't somebody tell this the EU commission? ;-))
> Greetings

> Markus

Andre

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremi Reda  
View profile
 More options Nov 26 2007, 5:09 am
Newsgroups: borland.public.delphi.non-technical
From: "Jeremi Reda" <Jer...@reda.fsworld.co.uk>
Date: Mon, 26 Nov 2007 10:09:04 -0000
Local: Mon, Nov 26 2007 5:09 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting
"Marco van de Voort" <mar...@stack.nl> wrote in message
news:slrnfkj56g.2j4l.marcov@snail.stack.nl...

I already use Application.OnException to do my own exception handling.
Leaving this empty simply hides the exception.

I agree with the other comments about the need for this, but I am being
forced down this road by my customer.  Normally you can always find how to
do things in Delphi, but I've been searching for days and can't find
anything.  Can anyone else help?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Graeme Geldenhuys  
View profile
 More options Nov 26 2007, 6:35 am
Newsgroups: borland.public.delphi.non-technical
From: Graeme Geldenhuys <grae...@spamfilter.co.za>
Date: Mon, 26 Nov 2007 13:35:47 +0200
Local: Mon, Nov 26 2007 6:35 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting

Markus.Humm wrote:
> this. I'm not too fond of this. Requiring a decent error handling is
> justified but requiring one so tight coupled to MS is bad!

It's probably so that Microsoft has a better chance to steal even more
information about your system (installed hardware/software).

Regards,
  - Graeme -

__________________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gert de Boom  
View profile
 More options Nov 26 2007, 10:23 am
Newsgroups: borland.public.delphi.non-technical
From: "Gert de Boom" <ask@nospam>
Date: Mon, 26 Nov 2007 16:23:33 +0100
Local: Mon, Nov 26 2007 10:23 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting
Here is a link to a partly succesful attempt:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2123486&SiteID=1

Maybe it wil get you on the right track?

Gert


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim McKeeth  
View profile
 More options Nov 26 2007, 3:01 pm
Newsgroups: borland.public.delphi.non-technical
From: "Jim McKeeth" <j...@mckeeth.org>
Date: 26 Nov 2007 13:01:59 -0700
Local: Mon, Nov 26 2007 3:01 pm
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting

Jeremi Reda wrote:
> I already use Application.OnException to do my own exception
> handling. Leaving this empty simply hides the exception.

How about in your Application.OnException handler just putting

raise e;

It pops up in the IDE a few times, but it eventually pops out to the OS
and kills the application just like a visual basic application.

If you wanted to be more creative you could use AcquireExceptionObject
to increment the use count on the exception in Application.OnException
and then save off the address and exception, terminate the application,
and then raise the exception inside your dpr (after Application.Run).
That seems to work to.

Here is the DPR code

------

begin
  GlobalException := nil;
  GlobalExceptionAddr := nil;
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm3, Form3);
  Application.Run;
  if assigned(GlobalException) then
    raise GlobalException at GlobalExceptionAddr;
end.

-----

Declare your globals as

-----

var
  GlobalException: Exception;
  GlobalExceptionAddr: Pointer;

-----

And then your new Application.OnException handler

-----

procedure TForm3.ApplicationEvents1Exception(Sender: TObject; E:
Exception);
  function ReturnAddr: Pointer;
  asm
          MOV     EAX,[EBP + 4]
  end;
begin
  GlobalExceptionAddr := ReturnAddr;
  GlobalException := E;
  AcquireExceptionObject;
  Application.Terminate; // Maybe set a flag first. . .
end;

-----

Same result, a little more elegant and control.  

I am presenting a session for CodeRage on Exceptions, although I didn't
do this in the presentation.  Would have been a good idea though I
guess.  I'll add the code to the download for the session though.

Is that what you were looking for?

--
-Jim McKeeth
www.DaviniciUnltd.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jim McKeeth  
View profile
 More options Nov 26 2007, 3:31 pm
Newsgroups: borland.public.delphi.non-technical
From: "Jim McKeeth" <j...@mckeeth.org>
Date: 26 Nov 2007 13:31:00 -0700
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting
OK, so I am going to comment on my code before someone else does:

> var
>   GlobalException: Exception;
>   GlobalExceptionAddr: Pointer;

OK, so ideally those should be ThreadVar or in some other way made
thread safe.  Maybe you could just use ExceptObject instead.  I might
play with that more.

Additionally

>   function ReturnAddr: Pointer;
>   asm
>           MOV     EAX,[EBP + 4]
>   end;

+ 4 is wrong.  I'm not going to figure out the right amount at this
moment, but +4 is wrong.

--
-Jim McKeeth
www.DavinciUnltd.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremi Reda  
View profile
 More options Nov 27 2007, 3:57 am
Newsgroups: borland.public.delphi.non-technical
From: "Jeremi Reda" <Jer...@reda.fsworld.co.uk>
Date: Tue, 27 Nov 2007 08:57:54 -0000
Local: Tues, Nov 27 2007 3:57 am
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting
Thanks,

As you say, this does call the Windows Error Reporting screen and allows me
to send details to MS.

I'm not sure how I'd find the problem from the information that gets sent to
MS, but that's another problem.

Thanks

Jeremi

"Jim McKeeth" <j...@mckeeth.org> wrote in message

news:474b3447@newsgroups.borland.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markus.Humm  
View profile
 More options Nov 27 2007, 1:03 pm
Newsgroups: borland.public.delphi.non-technical
From: "Markus.Humm" <markus.h...@freenet.de>
Date: Tue, 27 Nov 2007 19:03:18 +0100
Local: Tues, Nov 27 2007 1:03 pm
Subject: Re: Vista certification - Errors to be handled by Windows Error Reporting