Can't CreateProcess from custom shell

G

Guest

Hello,

I am trying to Invoke another process located on my XPe image by calling
CreateProcess. The call to CreateProcess succeeds without error but the
process is never started. I am using Minlogon and my Custom shell.

Thanks
 
M

Mike Warren

Dave said:
I am trying to Invoke another process located on my XPe image by
calling CreateProcess. The call to CreateProcess succeeds without
error but the process is never started. I am using Minlogon and my
Custom shell.

I use ShellExecute without any problems.

Is it possible that a resource that the called program needs
is not available on the runtime? Try running the program from
a command prompt.

-Mike
 
G

Guest

Thanks Mike I will try adding the command shell. I have a feeling I might be
missing the Windows Subsystem Component.
 
G

Guest

Sorry Mike I am a little slow on Monday mornings... I can't execute from the
command prompt as I am running my own custom shell.

None of the Run key's seem to be working in the registry either? As I
understand it the FBA is supposed to execute the Windows\Run command after
every logon??? I can't get any process to execute other than my custom shell
application.

-Dave
 
K

KM

Dave,

Can you show us the exact CreateProcess call you are making?
What the current directory parameter you are passing in there?
Did you try to launch some "easy-to-launch" processes like Notepad or etc.?
 
M

Mike Warren

Dave said:
Sorry Mike I am a little slow on Monday mornings... I can't execute
from the command prompt as I am running my own custom shell.

I include "CMD- Windows Command Processor" in my images
and add a a secret key combination (usually Ctrl+Shift+P) to my
custom shell to call cmd.exe using ShellExecute. This adds very
little to the image size but is a great help for debugging.
None of the Run key's seem to be working in the registry either?

My understanding is that Run and RunOnce are normally executed
by the Explorer shell.

-Mike
 
G

Guest

That is a good idea. Let me try executing notepad and see what happens. My
code is based on dynamic strings loaded from an INI file located in the
Windows directory. I have tested it under the Explorer shell and it all
works... The code looks like this:

// CDlgFBI message handlers
void CDlgFBI::StartProcess(CString strPath, CString strWork)
{
// get the default startup information
STARTUPINFO startUp = { 0 };
startUp.cb = sizeof (STARTUPINFO);
GetStartupInfo(&startUp);
// create the process
PROCESS_INFORMATION pi = { 0 };
BOOL fRet = CreateProcess(strPath, NULL, NULL, NULL, TRUE, 0, NULL,
strWork, &startUp, &pi);
ASSERT(fRet);
}

void CDlgFBI::OnBnClickedInstallChipset()
{
// get executable and working directory from the INI
CString strWorkingDir = theApp.GetProfileString(_T("Install"),
_T("WorkingDir"));
CString strPath = theApp.GetProfileString(_T("Install"), _T("Chipset"));

StartProcess(strPath, strWorkingDir);
}

The INI entries are:

[Install]
WorkingDir="C:\NVIDIA"
Chipset="C:\NVIDIA\Chipset\Setup.exe"
 
G

Guest

OK I was able to execute notepad. So it looks like I have another problem.
Possibly a dependency problem with the application I am trying to execute.

Thank You
 
K

KM

Dave,

Well.. Dependencies are the first place you should look at.

Then keep in mind that you specify the correct working directory path to launch your application. Obviously, notepad would be less
of the problem here.

Where is located your INI file? How are you sure your custom shell app reads the settings from the INI file properly? (important
settings are e.g. WorkingDir)

Also, make sure your application doesn't rely on some custom locations for some Dlls (like \Program files\..., etc.). I don't think
you have set up Path environment variable.
 
G

Guest

It turns out that the executables were "blocked" by Windows. Prompting
whether the file should be executed or not. I have the "EnableDefaultReply"
enabled in my image which was telling Windows to not execute the application.
I was able to "unblock" the exe's and everything is working great.

Thank You
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top