ShellExecuteEx shenanigans?

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
eccentric
GamingTools Subscriber
Posts: 7
Joined: Sat Aug 30, 2008 6:18 pm

ShellExecuteEx shenanigans?

Post by eccentric » Thu Aug 27, 2009 6:33 pm

I have this C#/.NET code inside isxeq2/innerspace on Windows Vista where strFileName is a string containing the absolute path of a text file:

Code: Select all

try
{
	if (File.Exists(strFileName))
	{
		Program.Log("Shell executing \"{0}\"...", strFileName);

		Process p = new System.Diagnostics.Process();
		p.StartInfo.FileName = strFileName;
		p.StartInfo.UseShellExecute = true;
		p.StartInfo.ErrorDialog = false;

		p.Start();
	}
	else
	{
		Program.Log("Shell execute error: Cannot find file \"{0}\".", strFileName);
	}
}
catch (Exception e)
{
	OnUnhandledException(e);
}
The problem is, after passing the file existence check, the call to Process.Start() throws a "file not found" exception which is clearly bogus. Furthermore, security is not the problem because strFileName is copied verbatim from another string used to open the file from inside my bot at startup.

From what I've been told, Process.Start() is layered on top of the ShellExecuteEx() Win32 function. Does Innerspace have a function hook in place that is botching up the string?

eccentric
GamingTools Subscriber
Posts: 7
Joined: Sat Aug 30, 2008 6:18 pm

Post by eccentric » Thu Aug 27, 2009 7:13 pm

Oh another thing... I have to do this code from a worker thread because Process.Start() terminates the entire EQ2 process when called from the bot entry point.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Fri Aug 28, 2009 12:04 am

I'll check on it, thanks for the details

eccentric
GamingTools Subscriber
Posts: 7
Joined: Sat Aug 30, 2008 6:18 pm

Post by eccentric » Tue Sep 01, 2009 5:59 pm

Another exception I'm getting is "Not enough storage is available to complete this operation".

The shell execute seems to work ok when client is freshly loaded, but degrades to throwing exceptions after several hours.

Post Reply