mirror of
https://github.com/reactos/reactos.git
synced 2024-06-15 09:01:42 +00:00
[CLT-2017]: The very last sync!
[SHUTDOWN]: shutdown -t causes crash. Patch by Michael Fritscher. (r74131 by Eric). <@dreimer> OMG!!!! <@hbelusca> hm dreimer? <@dreimer> ITS SO IMPORTANT!!!! <@hbelusca> ah you want it? <@hbelusca> ok <@hbelusca> let's add it :D <@dreimer> jkjkjk svn path=/branches/ReactOS-0.4.4-CLT2017/; revision=74133
This commit is contained in:
parent
c036b65fcd
commit
552610d60d
|
@ -56,12 +56,11 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
|
|||
break;
|
||||
|
||||
case L'c': /* Comment on reason for shutdown */
|
||||
if (index+1 > argc)
|
||||
return ERROR_INVALID_DATA;
|
||||
if(CheckCommentLength(argv[index+1]))
|
||||
{
|
||||
if (index+1 <= argc)
|
||||
pOpts->message = argv[index+1];
|
||||
else
|
||||
return ERROR_INVALID_DATA;
|
||||
pOpts->message = argv[index+1];
|
||||
index++;
|
||||
}
|
||||
else
|
||||
|
@ -72,10 +71,9 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
|
|||
break;
|
||||
|
||||
case L'd': /* Reason code [p|u:]xx:yy */
|
||||
if (index+1 <= argc)
|
||||
pOpts->reason = ParseReasonCode(argv[index+1]);
|
||||
else
|
||||
if (index+1 >= argc)
|
||||
return ERROR_INVALID_DATA;
|
||||
pOpts->reason = ParseReasonCode(argv[index+1]);
|
||||
index++;
|
||||
break;
|
||||
|
||||
|
@ -101,7 +99,10 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
|
|||
break;
|
||||
|
||||
case L'm': /* Target remote systems (UNC name/IP address) */
|
||||
if (index+1 >= argc)
|
||||
return ERROR_INVALID_DATA;
|
||||
pOpts->remote_system = argv[index+1];
|
||||
index++;
|
||||
break;
|
||||
|
||||
case L'p': /* Turn off local computer with no warning/time-out */
|
||||
|
@ -118,9 +119,12 @@ ParseArguments(struct CommandLineOptions* pOpts, int argc, WCHAR *argv[])
|
|||
break;
|
||||
|
||||
case L't': /* Shutdown delay */
|
||||
if (index+1 >= argc)
|
||||
return ERROR_INVALID_DATA;
|
||||
pOpts->shutdown_delay = _wtoi(argv[index+1]);
|
||||
if (pOpts->shutdown_delay > 0)
|
||||
pOpts->force = TRUE;
|
||||
index++;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue