Welcome to MSDN Blogs Sign in | Join | Help

Image File Execution Options

There is well-known (or not so well-known, depending on what you do) feature in NT family system, called “Image File Execution Options”.

 

It is really in the registry

 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options

 

Create a sub key, with the name as your executable without the path (i.e. notepad.exe). When your application starts, OS will look for specific registry values under that reg key, and act accordingly.

 

Regmon (http://www.sysinternals.com/ntw2k/source/regmon.shtml) trace of a helloworld app shows the following registry value is queried:

 

Debugger,

DisableHeapLookaside,

ShutdownFlags,

MinimumStackCommitInBytes,

ExecuteOptions,

GlobalFlag,

DebugProcessHeapOnly,

ApplicationGoo,

RpcThreadPoolThrottle,

 

 

Debugger” is discussed in many articles, like this one http://support.microsoft.com/default.aspx?kbid=238788. It is a way to automatically launch a debugger when an application starts.

 

DisableHeapLookaside” is discussed here http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q195/0/09.ASP&NoWebContent=1&NoWebContent=1. A way to fall back to ancient heap manager.

 

ShutdownFlags” is discussed here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/appendix/hh/appendix/enhancements5_5ppv.asp. A way to detect heap leak.

 

RpcThreadPoolThrottle” is discussed here http://support.microsoft.com/default.aspx?scid=%2Fservicedesks%2Fbin%2Fkbsearch.asp%3FArticle%3D267255.

 

GlobalFlag” is controlled by a tool called gflags.exe, which is documented in MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ddtools/hh/ddtools/gflags_00s3.asp. It is bundled with windows debugger (http://www.microsoft.com/whdc/devtools/debugging/default.mspx), which in my opinion, the best debugger ever created.

 

If you play with gflags.exe more, you will found more interesting registry values under Image File Execution Options.

 

I can’t find anything for “ApplicationGoo”. But you can see that in a vanilla WindowsXP system, several reg keys are already presented in Image File Execution Options with ApplicationGoo set to random binaries. I suspect this is something to do with AppCompat.

 

I can’t find anything for “MinimumStackCommitInBytes”, “ExecuteOptions” and “DebugProcessHeapOnly”. But it is very easy to decipher their meaning from their name (except ExecuteOptions, which I suspect is yet another AppCompat goo).

 

There is another one “BreakOnDllLoad”, which is discussed here http://www.west-wind.com/presentations/iis5Debug.htm. But with the “sxe ld” command in windows debugger, I think it is much less useful. Of course if you are using something other than windows debugger, it will help you to determine why (and when) a certain dll is loaded.

Published Wednesday, April 28, 2004 7:51 PM by junfeng
Filed under:

Comments

# Image File Execution Options

Thursday, April 29, 2004 2:49 AM by Sergey Simakov blog

# Image File Execution Options

Friday, May 07, 2004 10:03 AM by The Old New Thing
Handy registry key for debugging.

# Image File Execution Options

Friday, May 07, 2004 11:53 AM by The Old New Thing
Handy registry key for debugging.

# re: Image File Execution Options

Saturday, May 15, 2004 8:33 AM by Bruce Williams [MSFT]
You are right - the ApplicationGoo key is for AppCompat. I don't know how its binary value gets interpreted.

# re: Image File Execution Options

Wednesday, May 26, 2004 11:55 AM by Johan Johansson
I'd be more impressed by WinDbg if it handled paths with spaces in them.

# How to have fun... at the expense of your coworkers

Monday, July 12, 2004 12:22 PM by Loosely Coupled

# How to have fun... at the expense of your coworkers

Monday, July 12, 2004 12:22 PM by Loosely Coupled

# How to have fun... at the expense of your coworkers

Monday, July 12, 2004 12:24 PM by Loosely Coupled

# How to have fun... at the expense of your coworkers

Monday, July 12, 2004 12:25 PM by Loosely Coupled

# Image File Execution Options

Saturday, August 14, 2004 7:10 AM by Sergey Simakov blog

# Debugging Application Startup

Saturday, August 14, 2004 7:29 PM by NUnitAddin

# Avviare automaticamente il debugger

Friday, September 24, 2004 11:08 AM by Sergio

# Inside 'Image File Execution Options' debugging

Monday, February 21, 2005 5:52 PM by greggm's WebLog

# A Real Head-Scratcher Courtesy The CLR And Office Teams

Tuesday, February 07, 2006 9:28 PM by Dan McKinley
"Why the hell is this application insisting on loading an old version of the CLR?" I'm guessing that's...

# IFEO and Managed-debugging

Thursday, February 16, 2006 2:16 PM by Mike Stall's .NET Debugging Blog
Be careful  of Image File Execution Options (IFEO) with managed debugging - it won't work like you...

# Image File Execution Options

Thursday, February 08, 2007 10:28 PM by Wes' Puzzling Blog

Every now and than while debugging I need to either determine when a dll/module is loaded or need to

# Image File Execution Options

Thursday, February 08, 2007 10:29 PM by Wes' Blog

Every now and than while debugging I need to either determine when a dll/module is loaded or need to

# Trace-ProcessCreation: wrapping existing code with a cmdlet

Tuesday, February 20, 2007 3:27 PM by James Manning's blog

I was spamming asking around earlier this week about how to monitor process creation in windows. I was

# MITHUN SHANBHAG’S BLOG » Blog Archive » Image File Execution Options (IFEO)

# Root causing a "not reproducible" KMDF installation issue- part 2: Not stupid, merely human

Friday, August 10, 2007 1:47 PM by Trouble Ahead- Trouble Behind

In the last installment, we had a workaround, so people could get on with their lives. BUT , there's

# Root causing a "not reproducible" KMDF installation issue- part 2: Not stupid, merely human

Friday, August 10, 2007 1:48 PM by Noticias externas

In the last installment, we had a workaround, so people could get on with their lives. BUT , there's

# MSDN Blog Postings » Root causing a "not reproducible" KMDF installation issue- part 2: Not stupid, merely human

# Not a kernel guy » Blog Archive » ?????????????????????? ?????????? «Image File Execution Options».

New Comments to this post are disabled
 
Page view tracker