Re: CreateProcess in a loop
- From: one-trick-pony <worldofpain.aamir@xxxxxxxxx>
- Date: Tue, 21 Aug 2007 06:52:39 -0700
I reviewed the problem and narrowed down the issue. The first time
loop is executed, process is created succesfully. However, the second
time around, CreateProcess fails. GetLastError() reports
ERROR_SUCCESS or 0.
STARTUPINFO si;
PROCESS_INFORMATION pi;
int i = 0;
while ( i < 6 )
{
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
CreateProcess(function arguments);
DWORD err = GetLastError();
WaitForSingleObject(some arguments);
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
i++;
}
I turned on debugger and first time process is created fine. It
runs. When loops is executed second time things go bad.
si = {cb=68 lpReserved=0x00000000 <Bad Ptr> lpDesktop=0x00000000 <Bad
Ptr> ...} . This is what VS2005 compiler reports during iterations.
Whats going on? The words "Bad Ptr" is raising an alarm. Need help.
I can provide more details if needed.
.
- Follow-Ups:
- Re: CreateProcess in a loop
- From: Joseph M . Newcomer
- Re: CreateProcess in a loop
- From: one-trick-pony
- Re: CreateProcess in a loop
- From: one-trick-pony
- Re: CreateProcess in a loop
- From: one-trick-pony
- Re: CreateProcess in a loop
- References:
- CreateProcess in a loop
- From: one-trick-pony
- Re: CreateProcess in a loop
- From: David Lowndes
- Re: CreateProcess in a loop
- From: one-trick-pony
- Re: CreateProcess in a loop
- From: Joseph M . Newcomer
- CreateProcess in a loop
- Prev by Date: Re: Visual C++ wont autcomplete?
- Next by Date: Re: CreateProcess in a loop
- Previous by thread: Re: CreateProcess in a loop
- Next by thread: Re: CreateProcess in a loop
- Index(es):
Relevant Pages
|