Skip to content

Commit

Permalink
Print verbose error message when x26x.exe fails to execute
Browse files Browse the repository at this point in the history
  • Loading branch information
9adefaf01e5bf6426d838cd20eae582d2b6ba647 committed Sep 13, 2014
1 parent 7d6a5f6 commit e247540
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions avs4x26x.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if( avs_h.func.avs_function_exists( avs_h.env, "AutoloadPlugins" ) )
{ \
res = avs_h.func.avs_invoke( avs_h.env, "AutoloadPlugins", avs_new_value_array( NULL, 0 ), NULL ); \
if( avs_is_error( res ) ) \
fprintf( stderr, "AutoloadPlugins failed: %s\n", avs_as_string( res ) ); \
print_error( "AutoloadPlugins failed: %s\n", avs_as_string( res ) ); \
}

char* generate_new_commandline(int argc, char *argv[], int b_hbpp_vfw, int i_frame_total,
Expand Down Expand Up @@ -1054,7 +1054,12 @@ int main(int argc, char *argv[])

if (!CreateProcess(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &si_info, &pi_info))
{
print_error("Error: Failed to create process <%d>!", (int)GetLastError());
LPVOID error_message;
DWORD error = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, 0, (LPTSTR)&error_message, 0, NULL);
print_error( "Error %d: Failed to create process. %s", error, (LPCTSTR)error_message);
LocalFree(error_message);
free(cmd);
goto pipe_fail;
}
Expand Down

0 comments on commit e247540

Please sign in to comment.