Google Groups Home
Help | Sign in
Message from discussion SetLastError/CreateProcess bug on Vista/2008
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Corinna Vinschen  
View profile  
 More options Apr 26 2008, 11:55 am
Newsgroups: microsoft.public.win32.programmer.kernel
From: Corinna Vinschen <cori...@community.nospam>
Date: Sat, 26 Apr 2008 15:55:08 +0000 (UTC)
Local: Sat, Apr 26 2008 11:55 am
Subject: SetLastError/CreateProcess bug on Vista/2008
Hi,

consider a situation in which you're trying to start a subsequent
application which depends on a DLL which is missing on the system.
Usually you get a GUI box telling you that a DLL is missing.

However, if you don't want that, because you want to handle all such
errors in the parent process (in your own framework), you can call
SetErrorMode(SEM_FAILCRITICALERRORS).  So you have something along these
lines:

  SetErrorMode (SEM_FAILCRITICALERRORS);
  CreateProcess ("someprocess", "commandline", NULL, NULL, TRUE,
                 0, NULL, NULL, &si, &pi))
  handle_potential_errors ();

If you do this on Windows XP, it works fine.  No error box is opened.
Thus you can handle the problem in your own code.  Nice!

If you do the same on Vista or Server 2008, you lost.  Even though
SetErrorMode(SEM_FAILCRITICALERRORS) has been called, a box appears:

  someprocess.exe has stopped working

  Windows can check online for a solution to the problem.

  -> Check online [...]
  -> Close the program

  V View problem details

And the problem details contains the well-known fact that a DLL
is missing and the status code is 0xc0000135.

To avoid this box on Vista/2008, you must call

  SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);

in the parent process.  This appears to be at least an unnecessary
and backward incompatible change, but actually I think this is a bug.

A DLL was missing.  A missing DLL is *not* a general protection fault
and treating the status code STATUS_DLL_NOT_FOUND as a GP fault is...
a fault.

And it's a bug that the GUI box appears at all.  If you set the error
mode to 0, *two* boxes appear on the screen, one to inform the user that

  This application has failed to start because foo.dll was
  not found.  Re-installing the application may fix the problem.

and then, after the user has confirmed that box, the second box
described above appears.

Is there any chance that this can be fixed in Vista/2008?

Thanks,
Corinna

--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


    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.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google