Using ADPlus to get a minidump of a crashing process

ADPlus is a debugging tool that Microsoft includes in their windows debugging toolkit. It can (among other things) create a minidump when an application crashes. It uses the command line debugger (CDB) and waits for the application to crash. It then generates a large heap dump of the process. This is useful for applications and process’s that have no mechanism for handling unhandled exceptions.

It works like this:

adplus –p <process ID> -crash –o C:outputdir

Where process ID is the id of the process to monitor (Or you simply supply the name of the application.

-crash signifies you want it to monitor for crashes in the target app.

-o is the specified output directory.

3dsmax: Using a different plugin.ini from the command line doesn’t seem to work

3dsmax has a command line parameter –p, that allows you to specify a different plugin.ini file from the default one. The documentation for the command line parameters is here.

However, in practice this is tricky to use. For instance if you pass in a full path to a ini file, like this, it doesn’t work:

3dsmax –p “C:3dsmaxfooother.ini”

I researched this problem back in October, and it found a solution. Unfortunately the fix was postponed for the 3dsmax 2012 release, as it was a legacy issue. However here is what I found:

Short Answer:

Max assumes the alternate path contains JUST the filename, not the full path to the alternate INI file. Also that it assumes the alternate INI file is in the root folder of 3dsmax.

Detailed Answer:

If I pass the following command line to max:

-p "C:Program filesautodesk3dsmaxAlt_Plugin.UserSettings_alt.ini"

Max will store it, and move on.

Later in the Constructor for App (app.cpp), the GetUserPluginSettingFilePath() method is called. Now this method concatenates the root folder of max (i.e. getDir(APP_MAXDATA_DIR) ), with the ‘user plugin filename’ that has already been set.  So normally you get a concatenation of:

“C:Program filesautodesk3dsmax”



For a result of

“C:Program filesautodesk3dsmaxPlugin.usersettings.ini”

But when you specify via the command line –p and a full path of the file, it concatenates the root folder with the user specified filename. With the result being a mangled name like this:

“C:Program filesautodesk3dsmax” + “C:Program filesautodesk3dsmaxPlugin.usersettings_Alt.ini” 

The result:

“C:Program filesautodesk3dsmax”C:Program filesautodesk3dsmaxPlugin.usersettings_Alt”

The system then checks to see if that file exists, which it obviously does not. It then has checks in place for when it does not exist, and then moves on, ignoring the user specified file.

Hence why users complain that the command line parameter doesn’t work.