@@ -325,6 +325,26 @@ UpCommand(
325325}
326326
327327
328+ DWORD
329+ WINAPI
330+ ExecCommand (
331+ LPCWSTR pwszMachine ,
332+ LPWSTR * argv ,
333+ DWORD dwCurrentIndex ,
334+ DWORD dwArgCount ,
335+ DWORD dwFlags ,
336+ LPCVOID pvData ,
337+ BOOL * pbDone )
338+ {
339+ DPRINT ("ExecCommand()\n" );
340+
341+ if (dwArgCount - dwCurrentIndex != 1 )
342+ return ERROR_INVALID_SYNTAX ;
343+
344+ return RunScript (argv [dwCurrentIndex ]);
345+ }
346+
347+
328348DWORD
329349WINAPI
330350ExitCommand (
@@ -372,7 +392,7 @@ PopdCommand(
372392 DPRINT ("PopdCommand()\n" );
373393
374394 if (pContextStackHead == NULL )
375- return 0 ;
395+ return ERROR_SUCCESS ;
376396
377397 pEntry = pContextStackHead ;
378398
@@ -412,7 +432,7 @@ PushdCommand(
412432
413433 pEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY , sizeof (CONTEXT_STACK_ENTRY ));
414434 if (pEntry == NULL )
415- return 1 ;
435+ return ERROR_NOT_ENOUGH_MEMORY ;
416436
417437 pEntry -> pContext = pCurrentContext ;
418438 if (pContextStackHead == NULL )
@@ -446,6 +466,7 @@ CreateRootContext(VOID)
446466 AddContextCommand (pRootContext , L".." , UpCommand , IDS_HLP_UP , IDS_HLP_UP_EX , 0 );
447467 AddContextCommand (pRootContext , L"?" , NULL , IDS_HLP_HELP , IDS_HLP_HELP_EX , 0 );
448468 AddContextCommand (pRootContext , L"bye" , ExitCommand , IDS_HLP_EXIT , IDS_HLP_EXIT_EX , 0 );
469+ AddContextCommand (pRootContext , L"exec" , ExecCommand , IDS_HLP_EXEC , IDS_HLP_EXEC_EX , 0 );
449470 AddContextCommand (pRootContext , L"exit" , ExitCommand , IDS_HLP_EXIT , IDS_HLP_EXIT_EX , 0 );
450471 AddContextCommand (pRootContext , L"help" , NULL , IDS_HLP_HELP , IDS_HLP_HELP_EX , 0 );
451472 AddContextCommand (pRootContext , L"popd" , PopdCommand , IDS_HLP_POPD , IDS_HLP_POPD_EX , 0 );
0 commit comments