Re: Riddle Me This

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"pbd22" <dushkin@xxxxxxxxx> wrote in message news:a023891e-6d6a-4c77-a39c-758f112cb81f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


What makes you think the exec is not started, is the process not visible in
the process list?

That is right.

If not, how does the program signals success/failure to
the parent process (the service in this case)?

Well, its a queue. There is no return value. We know the proccess
takes
about 2 seconds. So, it should run accordingly. If one is running when
the
other wants to run, it queues until the first one is done.

How do you start the exec, show us the code that start the exec.

Here is the code:

if (filetype = true)
{

try
{

ProcessStartInfo psi = new
ProcessStartInfo(exepath, args);

lock (_objLock)
{
if (_fProcessRunning)
{
_procq.Enqueue(psi);
psi = null;
}

_fProcessRunning = true;
}

if (psi != null)
{
StartAProcess(psi);
}

}
catch (Exception e)
{
eventLog1.WriteEntry("Error parsing file:" +
e.Message, EventLogEntryType.Error);
return;
}

}

}

void StartAProcess(ProcessStartInfo psi)
{

try
{

Process process = new Process();

process.StartInfo = psi;
process.EnableRaisingEvents = true;

process.Exited += ProcessExitedHandler;

process.Start();
}
catch (Exception e)
{
eventLog1.WriteEntry("Error with StartAProcess
method:" + e.Message, EventLogEntryType.Error);
return;
}

}

void ProcessExitedHandler(object sender, EventArgs e)
{

ProcessStartInfo psi = null;

lock (_objLock)
{
if (_procq.Count > 0)
{
psi = _procq.Dequeue();
}
else
{
_fProcessRunning = false;
}
}

if (psi != null)
{
StartAProcess(psi);
}

}


Give also some details about the exec, type of program,

VB6 application. That has been stripped of all UI "stuff".

what security and user context does it require to run in,

Can you tell me how I would find that out?

does it expect a user profile to be loaded?

No. It simply does the following:

Opens a file.
Extracts metadata.
Writes metadata to text file.
Closes file.

Thanks a ton!
Peter



What I wan is the Service code that initiate a process start, that is the call site of the piece of code you posted above (starting with if (filetype = true), which is not the start of a method I suppose. I also would suggest you to add some logging stuff to the above code.
Also, you can't strip all UI stuff from VB6 application,a VB6 application is by definition a windows application, which makes it hard to get started from a Windows Service.

Willy.

.