8 int res = 0, got_program;
14 got_program = (program !=
NULL) && (program->
data !=
NULL);
24 if( application==program->
data ) {
34 arguments = alloca( len_arguments + 1 );
38 arguments[len_arguments] = 0;
41 len_program = strlen( buffer );
44 arguments = alloca( len_program + len_arguments + 2 );
47 FB_MEMCPY( arguments, buffer, len_program );
48 arguments[len_program] =
' ';
49 if( len_arguments!=0 )
50 FB_MEMCPY( arguments + len_program + 1, args->
data, len_arguments );
51 arguments[len_program + len_arguments + 1] = 0;
66 res = _spawnl( _P_WAIT, buffer, buffer, arguments,
NULL );
68 res = _execl( buffer, buffer, arguments,
NULL );
70 STARTUPINFO StartupInfo;
71 PROCESS_INFORMATION ProcessInfo;
72 memset( &StartupInfo, 0,
sizeof(StartupInfo) );
73 StartupInfo.cb =
sizeof(StartupInfo);
75 if( !CreateProcess(
NULL,
79 CREATE_DEFAULT_ERROR_MODE,
88 CloseHandle( ProcessInfo.hThread );
91 WaitForSingleObject( ProcessInfo.hProcess,
93 if( !GetExitCodeProcess( ProcessInfo.hProcess, &dwExitCode ) ) {
96 res = (int) dwExitCode;
98 CloseHandle( ProcessInfo.hProcess );
100 res = (int) ProcessInfo.hProcess;