Forum posts for svchost.exe

CreateProcess() and ShellExecute() freeze when waiting for svchost.exe

Under Windows 8 I'm starting an external program but it get stuck as a background process waiting for svchost.exe to return. If I start the same application manually (double click) it starts just fine.
If I run the same code under Windows 7, it works just fine.

I have mainly tried 3 ways of executing the application:

ShellExecute(NULL,L'open','MyApp.exe',NULL,NULL,SW_SHOWNORMAL);


This returns ok but the application freeze waiting for svchost.exe.
Then I tried the Extended version.

SHELLEXECUTEINFO ShExecInfo;

ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = Application->MainFormHandle;
ShExecInfo.lpVerb = L'open';
ShExecInfo.lpFile = L'MyApp.exe'
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = L'MyWorkDir';
ShExecInfo.nShow = SW_SHOWNORMAL;
ShExecInfo.hInstApp = NULL;

res = ShellExecuteEx(&ShExecInfo);


This also returns ok and I hInstApp is set, but still freeze as before.
Then I tried CreateProcess().

STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));

res = CreateProcess(L'MyApp.exe',NULL,NULL,NULL,false,0,NULL,L'MyWorkDir',&si,&pi);


This also returns ok and the PROCESS_INFORMATION is filled in correctly, but still it freeze.
RAD Studio shows a debug message when I create the process:

Application '??C:WindowsProgram Files (x86) ... MyApp.exe' found in cache
Application '??C:WindowsProgram Files (x86) ... MyApp.exe' cache bypassed reason 0x86


In Windows 8 Task manager I can see that the Process is waiting on svchost.exe to return.

View complete forum thread with replies

Other posts related to svchost.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Why is svchost.exe terminating my C# application?
Shared process service via svchost.exe in .NET
How to hide svchost.exe (dos prompt) when executing a scheduled task in Windows
Solving 100% cpu hang of svchost.exe hosting WCF service on IIS 6.0?
.Net Application extrem slow. After killing svchost.exe it runs again fast. Any idea?
how can i use svchost.exe to host my own services?
System becomes very slow to figure out this want to know more about System32 Folder
Windows XP - server process (svchost.exe -k netsvcs) starts after about 10 minutes
Memory leak in svchost.exe while running a particular windows service
Can I use svchost.exe to host my own services?
Svchost: How to make it run only one module per instance of svchost.exe? How to get extended…
ESET Firewall rules for svchost.exe and javaw.exe?
Why is the CommandLine property of a svchost.exe WIN32_Process null?
CreateProcess() and ShellExecute() freeze when waiting for svchost.exe

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.