X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinpgen.c;h=c4f4de45b4b180de18a6dda492bc7d9e0c64d0e5;hb=HEAD;hp=277c09143134b36a73eec0d19e24ef1f8ca59ade;hpb=57477cb7caa7d48b93ab4c3bf3e4db5468dcb3ed;p=PuTTY.git diff --git a/windows/winpgen.c b/windows/winpgen.c index 277c0914..c4f4de45 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -134,7 +134,7 @@ static void progress_update(void *param, int action, int phase, int iprogress) } } -extern char ver[]; +extern const char ver[]; struct PassphraseProcStruct { char **passphrase; @@ -297,10 +297,12 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, } { + char *buildinfo_text = buildinfo("\r\n"); char *text = dupprintf - ("Pageant\r\n\r\n%s\r\n\r\n%s", - ver, + ("PuTTYgen\r\n\r\n%s\r\n\r\n%s\r\n\r\n%s", + ver, buildinfo_text, "\251 " SHORT_COPYRIGHT_DETAILS ". All rights reserved."); + sfree(buildinfo_text); SetDlgItemText(hwnd, 1000, text); sfree(text); } @@ -317,6 +319,12 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, EnableWindow(hwnd, 1); SetActiveWindow(hwnd); return 0; + case 102: + /* Load web browser */ + ShellExecute(hwnd, "open", + "http://www.chiark.greenend.org.uk/~sgtatham/putty/", + 0, 0, SW_SHOWDEFAULT); + return 0; } return 0; case WM_CLOSE: @@ -1515,10 +1523,12 @@ void cleanup_exit(int code) int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { - int argc; + int argc, i; char **argv; int ret; + dll_hijacking_protection(); + InitCommonControls(); hinst = inst; hwnd = NULL; @@ -1530,36 +1540,24 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) split_into_argv(cmdline, &argc, &argv, NULL); - if (argc > 0) { - if (!strcmp(argv[0], "-pgpfp")) { + for (i = 0; i < argc; i++) { + if (!strcmp(argv[i], "-pgpfp")) { pgp_fingerprints(); - exit(1); + return 1; + } else if (!strcmp(argv[i], "-restrict-acl") || + !strcmp(argv[i], "-restrict_acl") || + !strcmp(argv[i], "-restrictacl")) { + restrict_process_acl(); } else { /* * Assume the first argument to be a private key file, and * attempt to load it. */ - cmdline_keyfile = argv[0]; + cmdline_keyfile = argv[i]; + break; } } -#ifndef UNPROTECT - /* - * Protect our process. - */ - { - char *error = NULL; - if (!setprocessacl(error)) { - char *message = dupprintf("Could not restrict process ACL: %s", - error); - MessageBox(NULL, message, "PuTTYgen Warning", - MB_ICONWARNING | MB_OK); - sfree(message); - sfree(error); - } - } -#endif - random_ref(); ret = DialogBox(hinst, MAKEINTRESOURCE(201), NULL, MainDlgProc) != IDOK;