mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 23:05:03 +00:00
Fix WinExec return value
svn path=/trunk/; revision=9970
This commit is contained in:
parent
7bca32fad2
commit
386450b018
1 changed files with 21 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: proc.c,v 1.62 2004/05/29 15:10:28 navaraf Exp $
|
/* $Id: proc.c,v 1.63 2004/07/02 12:18:04 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -380,7 +380,6 @@ WinExec(LPCSTR lpCmdLine,
|
||||||
{
|
{
|
||||||
STARTUPINFOA StartupInfo;
|
STARTUPINFOA StartupInfo;
|
||||||
PROCESS_INFORMATION ProcessInformation;
|
PROCESS_INFORMATION ProcessInformation;
|
||||||
HINSTANCE hInst;
|
|
||||||
DWORD dosErr;
|
DWORD dosErr;
|
||||||
|
|
||||||
RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
|
RtlZeroMemory(&StartupInfo, sizeof(StartupInfo));
|
||||||
|
@ -388,7 +387,7 @@ WinExec(LPCSTR lpCmdLine,
|
||||||
StartupInfo.wShowWindow = uCmdShow;
|
StartupInfo.wShowWindow = uCmdShow;
|
||||||
StartupInfo.dwFlags = 0;
|
StartupInfo.dwFlags = 0;
|
||||||
|
|
||||||
hInst = (HINSTANCE)CreateProcessA(NULL,
|
if (! CreateProcessA(NULL,
|
||||||
(PVOID)lpCmdLine,
|
(PVOID)lpCmdLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -397,11 +396,10 @@ WinExec(LPCSTR lpCmdLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&StartupInfo,
|
&StartupInfo,
|
||||||
&ProcessInformation);
|
&ProcessInformation))
|
||||||
if ( hInst == NULL )
|
|
||||||
{
|
{
|
||||||
dosErr = GetLastError();
|
dosErr = GetLastError();
|
||||||
return dosErr;
|
return dosErr < 32 ? dosErr : ERROR_BAD_FORMAT;
|
||||||
}
|
}
|
||||||
if (NULL != lpfnGlobalRegisterWaitForInputIdle)
|
if (NULL != lpfnGlobalRegisterWaitForInputIdle)
|
||||||
{
|
{
|
||||||
|
@ -410,9 +408,10 @@ WinExec(LPCSTR lpCmdLine,
|
||||||
10000
|
10000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
NtClose (ProcessInformation.hProcess);
|
NtClose(ProcessInformation.hProcess);
|
||||||
NtClose (ProcessInformation.hThread);
|
NtClose(ProcessInformation.hThread);
|
||||||
return 0;
|
|
||||||
|
return 33; /* Something bigger than 31 means success. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue