X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fhelp.c;h=e1e0345679fb1c55d10a6bda0261447a286b7b08;hb=HEAD;hp=febd0e6ec97ae7b9e5741c2db27842d51f1f5963;hpb=27a6dc15aef8b81f365bb0d87ee73ef4651e00d1;p=xboard.git diff --git a/winboard/help.c b/winboard/help.c index febd0e6..e1e0345 100644 --- a/winboard/help.c +++ b/winboard/help.c @@ -1,7 +1,7 @@ /* * help.h * - * Copyright 2009 Free Software Foundation, Inc. + * Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc. * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -24,11 +24,13 @@ #include #include +#include "config.h" +#include "help.h" FILE *debugFP; -int -HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) +HWND WINAPI +HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data ) { PROCESS_INFORMATION helpProcInfo; STARTUPINFO siStartInfo; @@ -36,13 +38,13 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) static int status = 0; FILE *f; - if(status < 0) return 0; + if(status < 0) return NULL; if(!status) { f = fopen(helpFile, "r"); if(f == NULL) { status = -1; - return 0; + return NULL; } status = 1; fclose(f); @@ -59,10 +61,10 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) siStartInfo.hStdOutput = NULL; siStartInfo.hStdError = debugFP; - sprintf(buf, "Hh.exe %s", helpFile); + snprintf(buf, sizeof(buf)/sizeof(buf[0]),"Hh.exe %s", helpFile); // ignore the other parameters; just start the viewer with the help file - return CreateProcess(NULL, + if( CreateProcess(NULL, buf, /* command line */ NULL, /* process security attributes */ NULL, /* primary thread security attrs */ @@ -71,12 +73,13 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) NULL, /* use parent's environment */ NULL, &siStartInfo, /* STARTUPINFO pointer */ - &helpProcInfo); /* receives PROCESS_INFORMATION */ + &helpProcInfo) /* receives PROCESS_INFORMATION */ + ) return hwnd; else return NULL; } //HWND WINAPI int -MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD data) +MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD_PTR data) { static int status = 0; FILE *f;