@@ -4155,7 +4155,7 @@ mch_system_classic(char *cmd, int options)
41554155 si .cbReserved2 = 0 ;
41564156 si .lpReserved2 = NULL ;
41574157
4158- /* There is a strange error on Windows 95 when using "c:\\ command.com".
4158+ /* There is a strange error on Windows 95 when using "c:\command.com".
41594159 * When the "c:\\" is left out it works OK...? */
41604160 if (mch_windows95 ()
41614161 && (STRNICMP (cmd , "c:/command.com" , 14 ) == 0
@@ -5032,6 +5032,59 @@ mch_call_shell(
50325032 return x ;
50335033}
50345034
5035+ #if defined(FEAT_JOB ) || defined(PROTO )
5036+ void
5037+ mch_start_job (char * cmd , job_T * job )
5038+ {
5039+ STARTUPINFO si ;
5040+ PROCESS_INFORMATION pi ;
5041+
5042+ ZeroMemory (& si , sizeof (si ));
5043+ si .cb = sizeof (si );
5044+
5045+ if (!vim_create_process (cmd , FALSE,
5046+ CREATE_DEFAULT_ERROR_MODE |
5047+ CREATE_NEW_PROCESS_GROUP |
5048+ CREATE_NO_WINDOW ,
5049+ & si , & pi ))
5050+ job -> jv_status = JOB_FAILED ;
5051+ else
5052+ {
5053+ job -> jf_pi = pi ;
5054+ job -> jv_status = JOB_STARTED ;
5055+ }
5056+ }
5057+
5058+ char *
5059+ mch_job_status (job_T * job )
5060+ {
5061+ DWORD dwExitCode = 0 ;
5062+
5063+ if (!GetExitCodeProcess (job -> jf_pi .hProcess , & dwExitCode ))
5064+ return "dead" ;
5065+ if (dwExitCode != STILL_ACTIVE )
5066+ {
5067+ CloseHandle (job -> jf_pi .hProcess );
5068+ CloseHandle (job -> jf_pi .hThread );
5069+ return "dead" ;
5070+ }
5071+ return "run" ;
5072+ }
5073+
5074+ int
5075+ mch_stop_job (job_T * job , char_u * how )
5076+ {
5077+ if (STRCMP (how , "kill" ) == 0 )
5078+ TerminateProcess (job -> jf_pi .hProcess , 0 );
5079+ else
5080+ return GenerateConsoleCtrlEvent (
5081+ STRCMP (how , "hup" ) == 0 ?
5082+ CTRL_BREAK_EVENT : CTRL_C_EVENT ,
5083+ job -> jf_pi .dwProcessId ) ? OK : FAIL ;
5084+ return OK ;
5085+ }
5086+ #endif
5087+
50355088
50365089#ifndef FEAT_GUI_W32
50375090
0 commit comments