Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ttxssh.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2789 by yutakakn, Tue Feb 22 08:48:11 2005 UTC revision 2792 by yutakakn, Mon Feb 28 14:51:44 2005 UTC
# Line 1380  static void append_about_text(HWND dlg, Line 1380  static void append_about_text(HWND dlg,
1380                                             (LPARAM) (char FAR *) "\r\n");                                             (LPARAM) (char FAR *) "\r\n");
1381  }  }
1382    
1383    // 実行ファイルからバージョン情報を得る (2005.2.28 yutaka)
1384    static void get_file_version(char *exefile, int *major, int *minor, int *release, int *build)
1385    {
1386            typedef struct {
1387                    WORD wLanguage;
1388                    WORD wCodePage;
1389            } LANGANDCODEPAGE, *LPLANGANDCODEPAGE;
1390            LPLANGANDCODEPAGE lplgcode;
1391            UINT unLen;
1392            DWORD size;
1393            char *buf = NULL;
1394            BOOL ret;
1395            int i;
1396            char fmt[80];
1397            char *pbuf;
1398    
1399            size = GetFileVersionInfoSize(exefile, NULL);
1400            if (size == 0) {
1401                    goto error;
1402            }
1403            buf = malloc(size);
1404            ZeroMemory(buf, size);
1405    
1406            if (GetFileVersionInfo(exefile, 0, size, buf) == FALSE) {
1407                    goto error;
1408            }
1409    
1410            ret = VerQueryValue(buf,
1411                            "\\VarFileInfo\\Translation",
1412                            (LPVOID *)&lplgcode, &unLen);
1413            if (ret == FALSE)
1414                    goto error;
1415    
1416            for (i = 0 ; i < (int)(unLen / sizeof(LANGANDCODEPAGE)) ; i++) {
1417                    _snprintf(fmt, sizeof(fmt), "\\StringFileInfo\\%04x%04x\\FileVersion",
1418                            lplgcode[i].wLanguage, lplgcode[i].wCodePage);
1419                    VerQueryValue(buf, fmt, &pbuf, &unLen);
1420                    if (unLen > 0) { // get success
1421                            int n, a, b, c, d;
1422    
1423                            n = sscanf(pbuf, "%d, %d, %d, %d", &a, &b, &c, &d);
1424                            if (n == 4) { // convert success
1425                                    *major = a;
1426                                    *minor = b;
1427                                    *release = c;
1428                                    *build = d;
1429                                    break;
1430                            }
1431                    }
1432            }
1433    
1434            free(buf);
1435            return;
1436    
1437    error:
1438            free(buf);
1439            *major = *minor = *release = *build = 0;
1440    }
1441    
1442  static void init_about_dlg(PTInstVar pvar, HWND dlg)  static void init_about_dlg(PTInstVar pvar, HWND dlg)
1443  {  {
1444          char buf[1024];          char buf[1024];
1445            int a, b, c, d;
1446    
1447            // TTSSHのバージョンを設定する (2005.2.28 yutaka)
1448            get_file_version("ttxssh.dll", &a, &b, &c, &d);
1449            _snprintf(buf, sizeof(buf), "TTSSH\r\nTeraterm Secure Shell extension, %d.%d", a, b);
1450            SendMessage(GetDlgItem(dlg, IDC_TTSSH_VERSION), WM_SETTEXT, 0, (LPARAM)buf);
1451    
1452          // OpenSSLのバージョンを設定する (2005.1.24 yutaka)          // OpenSSLのバージョンを設定する (2005.1.24 yutaka)
1453          SendMessage(GetDlgItem(dlg, IDC_OPENSSL_VERSION), WM_SETTEXT, 0, (LPARAM)OPENSSL_VERSION_TEXT);          SendMessage(GetDlgItem(dlg, IDC_OPENSSL_VERSION), WM_SETTEXT, 0, (LPARAM)OPENSSL_VERSION_TEXT);
# Line 2119  int CALLBACK LibMain(HANDLE hInstance, W Line 2184  int CALLBACK LibMain(HANDLE hInstance, W
2184    
2185  /*  /*
2186   * $Log: not supported by cvs2svn $   * $Log: not supported by cvs2svn $
2187     * Revision 1.11  2005/02/22 08:48:11  yutakakn
2188     * TTSSH setupダイアログに HeartBeat 設定を追加。
2189     * TTSSH authentication setupダイアログに keyboard-interactive 設定を追加。
2190     *
2191   * Revision 1.10  2005/01/27 13:30:33  yutakakn   * Revision 1.10  2005/01/27 13:30:33  yutakakn
2192   * 公開鍵認証自動ログインをサポート。   * 公開鍵認証自動ログインをサポート。
2193   * /auth=publickey, /keyfile オプションを新規追加した。   * /auth=publickey, /keyfile オプションを新規追加した。

Legend:
Removed from v.2789  
changed lines
  Added in v.2792

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26