• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8241 (tree)
Time2019-10-02 23:00:14
Authorzmatsuo

Log Message

ttproxyでSetI18DlgStrs()を使用するようにした

Change Summary

Incremental Difference

--- trunk/TTProxy/ProxyWSockHook.h (revision 8240)
+++ trunk/TTProxy/ProxyWSockHook.h (revision 8241)
@@ -750,58 +750,30 @@
750750 return Dialog::dispatch(message, wParam, lParam);
751751 }
752752 virtual bool onInitDialog() {
753- char uimsg[MAX_UIMSG], uitmp[MAX_UIMSG];
753+ const static DlgTextInfo text_info[] = {
754+ { 0, "DLG_OTHER_TITLE" },
755+ { IDC_GRP_COMMON, "DLG_OTHER_COMMON" },
756+ { IDC_TIMEOUT_LABEL, "DLG_OTHER_TIMEOUT" },
757+ { IDC_TIMEOUT_SECONDS, "DLG_OTHER_SECOND" },
758+ { IDC_LOGFILE_LABEL, "DLG_OTHER_LOG" },
759+ { IDC_REFER, "DLG_OTHER_REFER" },
760+ { IDC_GRP_SOCKS, "DLG_OTHER_SOCKS" },
761+ { IDC_RESOLVE_LABEL, "DLG_OTHER_RESOLV" },
762+ { IDC_GRP_TELNET, "DLG_OTHER_TELNET" },
763+ { IDC_HOSTNAME_LABEL, "DLG_OTHER_HOST" },
764+ { IDC_USERNAME_LABEL, "DLG_OTHER_USER" },
765+ { IDC_PASSWORD_LABEL, "DLG_OTHER_PASS" },
766+ { IDC_CONNECTED_LABEL, "DLG_OTHER_CONNECT" },
767+ { IDC_ERROR_LABEL, "DLG_OTHER_ERROR" },
768+// { IDOK, "BTN_OK" },
769+// { IDCANCEL, "BTN_CANCEL" },
770+ };
771+ char uimsg[MAX_UIMSG];
754772
755773 Dialog::onInitDialog();
756774
757- GetWindowText(uitmp, sizeof(uitmp));
758- UTIL_get_lang_msg("DLG_OTHER_TITLE", uimsg, sizeof(uimsg), uitmp);
759- SetWindowText(uimsg);
760- GetDlgItemText(IDC_GRP_COMMON, uitmp, sizeof(uitmp));
761- UTIL_get_lang_msg("DLG_OTHER_COMMON", uimsg, sizeof(uimsg), uitmp);
762- SetDlgItemText(IDC_GRP_COMMON, uimsg);
763- GetDlgItemText(IDC_TIMEOUT_LABEL, uitmp, sizeof(uitmp));
764- UTIL_get_lang_msg("DLG_OTHER_TIMEOUT", uimsg, sizeof(uimsg), uitmp);
765- SetDlgItemText(IDC_TIMEOUT_LABEL, uimsg);
766- GetDlgItemText(IDC_TIMEOUT_SECONDS, uitmp, sizeof(uitmp));
767- UTIL_get_lang_msg("DLG_OTHER_SECOND", uimsg, sizeof(uimsg), uitmp);
768- SetDlgItemText(IDC_TIMEOUT_SECONDS, uimsg);
769- GetDlgItemText(IDC_LOGFILE_LABEL, uitmp, sizeof(uitmp));
770- UTIL_get_lang_msg("DLG_OTHER_LOG", uimsg, sizeof(uimsg), uitmp);
771- SetDlgItemText(IDC_LOGFILE_LABEL, uimsg);
772- GetDlgItemText(IDC_REFER, uitmp, sizeof(uitmp));
773- UTIL_get_lang_msg("DLG_OTHER_REFER", uimsg, sizeof(uimsg), uitmp);
774- SetDlgItemText(IDC_REFER, uimsg);
775- GetDlgItemText(IDC_GRP_SOCKS, uitmp, sizeof(uitmp));
776- UTIL_get_lang_msg("DLG_OTHER_SOCKS", uimsg, sizeof(uimsg), uitmp);
777- SetDlgItemText(IDC_GRP_SOCKS, uimsg);
778- GetDlgItemText(IDC_RESOLVE_LABEL, uitmp, sizeof(uitmp));
779- UTIL_get_lang_msg("DLG_OTHER_RESOLV", uimsg, sizeof(uimsg), uitmp);
780- SetDlgItemText(IDC_RESOLVE_LABEL, uimsg);
781- GetDlgItemText(IDC_GRP_TELNET, uitmp, sizeof(uitmp));
782- UTIL_get_lang_msg("DLG_OTHER_TELNET", uimsg, sizeof(uimsg), uitmp);
783- SetDlgItemText(IDC_GRP_TELNET, uimsg);
784- GetDlgItemText(IDC_HOSTNAME_LABEL, uitmp, sizeof(uitmp));
785- UTIL_get_lang_msg("DLG_OTHER_HOST", uimsg, sizeof(uimsg), uitmp);
786- SetDlgItemText(IDC_HOSTNAME_LABEL, uimsg);
787- GetDlgItemText(IDC_USERNAME_LABEL, uitmp, sizeof(uitmp));
788- UTIL_get_lang_msg("DLG_OTHER_USER", uimsg, sizeof(uimsg), uitmp);
789- SetDlgItemText(IDC_USERNAME_LABEL, uimsg);
790- GetDlgItemText(IDC_PASSWORD_LABEL, uitmp, sizeof(uitmp));
791- UTIL_get_lang_msg("DLG_OTHER_PASS", uimsg, sizeof(uimsg), uitmp);
792- SetDlgItemText(IDC_PASSWORD_LABEL, uimsg);
793- GetDlgItemText(IDC_CONNECTED_LABEL, uitmp, sizeof(uitmp));
794- UTIL_get_lang_msg("DLG_OTHER_CONNECT", uimsg, sizeof(uimsg), uitmp);
795- SetDlgItemText(IDC_CONNECTED_LABEL, uimsg);
796- GetDlgItemText(IDC_ERROR_LABEL, uitmp, sizeof(uitmp));
797- UTIL_get_lang_msg("DLG_OTHER_ERROR", uimsg, sizeof(uimsg), uitmp);
798- SetDlgItemText(IDC_ERROR_LABEL, uimsg);
799- GetDlgItemText(IDOK, uitmp, sizeof(uitmp));
800- UTIL_get_lang_msg("BTN_OK", uimsg, sizeof(uimsg), uitmp);
801- SetDlgItemText(IDOK, uimsg);
802- GetDlgItemText(IDCANCEL, uitmp, sizeof(uitmp));
803- UTIL_get_lang_msg("BTN_CANCEL", uimsg, sizeof(uimsg), uitmp);
804- SetDlgItemText(IDCANCEL, uimsg);
775+ HWND hWnd = (HWND)this;
776+ SetI18DlgStrs("TTProxy", hWnd, text_info, _countof(text_info), UILanguageFile);
805777
806778 host = GetDlgItem(IDC_HOSTNAME);
807779 user = GetDlgItem(IDC_USERNAME);
@@ -910,40 +882,24 @@
910882 return Dialog::dispatch(message, wParam, lParam);
911883 }
912884 virtual bool onInitDialog() {
913- char uimsg[MAX_UIMSG], uitmp[MAX_UIMSG];
885+ char uimsg[MAX_UIMSG];
914886
915887 Dialog::onInitDialog();
916888
917- GetWindowText(uitmp, sizeof(uitmp));
918- UTIL_get_lang_msg("DLG_SETUP_TITLE", uimsg, sizeof(uimsg), uitmp);
919- SetWindowText(uimsg);
920- GetDlgItemText(IDC_URL_LABEL, uitmp, sizeof(uitmp));
921- UTIL_get_lang_msg("DLG_SETUP_URL", uimsg, sizeof(uimsg), uitmp);
922- SetDlgItemText(IDC_URL_LABEL, uimsg);
923- GetDlgItemText(IDC_TYPE_LEBEL, uitmp, sizeof(uitmp));
924- UTIL_get_lang_msg("DLG_SETUP_TYPE", uimsg, sizeof(uimsg), uitmp);
925- SetDlgItemText(IDC_TYPE_LEBEL, uimsg);
926- GetDlgItemText(IDC_HOSTNAME_LABEL, uitmp, sizeof(uitmp));
927- UTIL_get_lang_msg("DLG_SETUP_HOST", uimsg, sizeof(uimsg), uitmp);
928- SetDlgItemText(IDC_HOSTNAME_LABEL, uimsg);
929- GetDlgItemText(IDC_PORT_LABEL, uitmp, sizeof(uitmp));
930- UTIL_get_lang_msg("DLG_SETUP_PORT", uimsg, sizeof(uimsg), uitmp);
931- SetDlgItemText(IDC_PORT_LABEL, uimsg);
932- GetDlgItemText(IDC_USERNAME_LABEL, uitmp, sizeof(uitmp));
933- UTIL_get_lang_msg("DLG_SETUP_USER", uimsg, sizeof(uimsg), uitmp);
934- SetDlgItemText(IDC_USERNAME_LABEL, uimsg);
935- GetDlgItemText(IDC_PASSWORD_LABEL, uitmp, sizeof(uitmp));
936- UTIL_get_lang_msg("DLG_SETUP_PASS", uimsg, sizeof(uimsg), uitmp);
937- SetDlgItemText(IDC_PASSWORD_LABEL, uimsg);
938- GetDlgItemText(IDC_OPTIONS, uitmp, sizeof(uitmp));
939- UTIL_get_lang_msg("DLG_SETUP_OTHER", uimsg, sizeof(uimsg), uitmp);
940- SetDlgItemText(IDC_OPTIONS, uimsg);
941- GetDlgItemText(IDOK, uitmp, sizeof(uitmp));
942- UTIL_get_lang_msg("BTN_OK", uimsg, sizeof(uimsg), uitmp);
943- SetDlgItemText(IDOK, uimsg);
944- GetDlgItemText(IDCANCEL, uitmp, sizeof(uitmp));
945- UTIL_get_lang_msg("BTN_CANCEL", uimsg, sizeof(uimsg), uitmp);
946- SetDlgItemText(IDCANCEL, uimsg);
889+ const static DlgTextInfo text_info[] = {
890+ { 0, "DLG_SETUP_TITLE" },
891+ { IDC_URL_LABEL, "DLG_SETUP_URL" },
892+ { IDC_TYPE_LEBEL, "DLG_SETUP_TYPE" },
893+ { IDC_HOSTNAME_LABEL, "DLG_SETUP_HOST" },
894+ { IDC_PORT_LABEL, "DLG_SETUP_PORT" },
895+ { IDC_USERNAME_LABEL, "DLG_SETUP_USER" },
896+ { IDC_PASSWORD_LABEL, "DLG_SETUP_PASS" },
897+ { IDC_OPTIONS, "DLG_SETUP_OTHER" },
898+// { IDOK, "BTN_OK" },
899+// { IDCANCEL, "BTN_CANCEL" },
900+ };
901+ HWND hWnd = HWND(this); // うまく動かない?
902+ SetI18DlgStrs("TTProxy", hWnd, text_info, _countof(text_info), UILanguageFile);
947903
948904 url <<= GetDlgItem(IDC_URL);
949905 type <<= GetDlgItem(IDC_TYPE);
@@ -1539,22 +1495,22 @@
15391495
15401496 buf[0] VER protocol version: X'05'
15411497 buf[1] REP Reply field:
1542- o X'00' succeeded
1543- o X'01' general SOCKS server failure
1544- o X'02' connection not allowed by ruleset
1545- o X'03' Network unreachable
1546- o X'04' Host unreachable
1547- o X'05' Connection refused
1548- o X'06' TTL expired
1549- o X'07' Command not supported
1550- o X'08' Address type not supported
1551- o X'09' to X'FF' unassigned
1552- buf[2] RSV RESERVED: X'00'
1553- buf[3] ATYP address type of following address
1554- o IP V4 address: X'01'
1555- o DOMAINNAME: X'03'
1556- o IP V6 address: X'04'
1557- buf[4:N] BND.ADDR server bound address
1498+ o X'00' succeeded
1499+ o X'01' general SOCKS server failure
1500+ o X'02' connection not allowed by ruleset
1501+ o X'03' Network unreachable
1502+ o X'04' Host unreachable
1503+ o X'05' Connection refused
1504+ o X'06' TTL expired
1505+ o X'07' Command not supported
1506+ o X'08' Address type not supported
1507+ o X'09' to X'FF' unassigned
1508+ buf[2] RSV RESERVED: X'00'
1509+ buf[3] ATYP address type of following address
1510+ o IP V4 address: X'01'
1511+ o DOMAINNAME: X'03'
1512+ o IP V6 address: X'04'
1513+ buf[4:N] BND.ADDR server bound address
15581514 buf[N+1] BND.PORT server bound port in network octet order
15591515 */
15601516 if (buf[0] != SOCKS5_VERSION || buf[1] != SOCKS5_REP_SUCCEEDED) { /* check reply code */
@@ -1667,9 +1623,9 @@
16671623 buf[1] CD
16681624 90 request granted
16691625 91 request rejected or failed
1670- 92 request rejected becasue SOCKS server cannot connect to
1626+ 92 request rejected becasue SOCKS server cannot connect to
16711627 identd on the client
1672- 93 request rejected because the client program and identd
1628+ 93 request rejected because the client program and identd
16731629 report different user-ids
16741630 buf[2:3] DSTPORT ポート番号
16751631 buf[4:7] DSTIP IPアドレス
Show on old repository browser