Executable load errors suppressed

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

dim

Dimitry Andric
May 31, 2008
203
0
Netherlands
#1
Hi,

I'm using Take Command 11.00.42 x64. I encountered an executable which
was linked to missing DLLs (in this case, a version of openssl.exe).

When I attempt to run this executable from TCC, I get no error message
whatsoever, but I simply get the prompt back. The exit code (%?) is
then set to 128.

If I run this from cmd.exe, I get a more informative error popup:

===== OpenSSL.exe - Unable To Locate Component

This application has failed to start because LIBEAY32.dll was not
found. Re-installing the application may fix this problem.
=====
Any idea why TCC seems to suppress these popups?
 

rconn

Administrator
Staff member
May 14, 2008
10,157
86
#2
> I'm using Take Command 11.00.42 x64. I encountered an executable which
> was linked to missing DLLs (in this case, a version of openssl.exe).
>
> When I attempt to run this executable from TCC, I get no error message
> whatsoever, but I simply get the prompt back. The exit code (%?) is
> then set to 128.
>
> If I run this from cmd.exe, I get a more informative error popup:
>
> ===== OpenSSL.exe - Unable To Locate Component
>
> This application has failed to start because LIBEAY32.dll was not
> found. Re-installing the application may fix this problem.
> ====> Any idea why TCC seems to suppress these popups?
TCC definitely isn't deliberately suppressing anything, though its process
startup is different (much more complex) than CMD.EXE's.

Does it behave the same way if you run the app from TCC 32-bit?

Rex Conn
JP Software
 

rconn

Administrator
Staff member
May 14, 2008
10,157
86
#3
> When I attempt to run this executable from TCC, I get no error message
> whatsoever, but I simply get the prompt back. The exit code (%?) is
> then set to 128.
A quick experiment shows that ShellExecute will display that popup, but
CreateProcess does not. (Curiously, CreateProcess immediately returns 1 for
success, which is *partially* true, since it passed the app off to the
loader, and after that it's the loader's problem.)

Since ShellExecute eventually calls CreateProcess, there's apparently some
mystery flag that should be passed, which will require some API hooking &
tracing to determine.

Rex Conn
JP Software
 

dim

Dimitry Andric
May 31, 2008
203
0
Netherlands
#4
On 2010-03-13 02:20, rconn wrote:

> TCC definitely isn't deliberately suppressing anything, though its process
> startup is different (much more complex) than CMD.EXE's.
>
> Does it behave the same way if you run the app from TCC 32-bit?
Yes. The OpenSSL.exe in question is a 32-bit app, btw.
 

dim

Dimitry Andric
May 31, 2008
203
0
Netherlands
#5
On 2010-03-13 03:01, rconn wrote:

> A quick experiment shows that ShellExecute will display that popup, but
> CreateProcess does not.
Strangely enough, in my case, a small program that just calls
CreateProcess (with almost all parameters set to NULL) *will* display
the error popup if run from either 32 or 64-bit cmd.exe, but not from
either 32 or 64-bit tcc.exe...

There is something strange going on. :)
 

rconn

Administrator
Staff member
May 14, 2008
10,157
86
#6
> ---Quote---
> > A quick experiment shows that ShellExecute will display that popup, but
> > CreateProcess does not.
> ---End Quote---
> Strangely enough, in my case, a small program that just calls
> CreateProcess (with almost all parameters set to NULL) *will* display
> the error popup if run from either 32 or 64-bit cmd.exe, but not from
> either 32 or 64-bit tcc.exe...
>
> There is something strange going on. :)
The problem turned out to be a third-party dll that was (rather
inconsiderately) changing the error mode and not resetting it when it was
done. I've fixed it for build 44, which should be uploaded in a day or two.

Rex Conn
JP Software