exec を Unicode 対応にした
@@ -67,6 +67,7 @@ | ||
67 | 67 | #include "win16api.h" |
68 | 68 | #include "ttl_gui.h" |
69 | 69 | #include "codeconv.h" |
70 | +#include "layer_for_unicode.h" | |
70 | 71 | |
71 | 72 | #define TTERMCOMMAND "TTERMPRO /D=" |
72 | 73 | #define CYGTERMCOMMAND "cyglaunch -o /D=" |
@@ -1017,7 +1018,7 @@ | ||
1017 | 1018 | int wait = 0; |
1018 | 1019 | DWORD ret; |
1019 | 1020 | WORD Err; |
1020 | - STARTUPINFO sui; | |
1021 | + STARTUPINFOW sui; | |
1021 | 1022 | PROCESS_INFORMATION pi; |
1022 | 1023 | BOOL bRet; |
1023 | 1024 |
@@ -1060,17 +1061,18 @@ | ||
1060 | 1061 | |
1061 | 1062 | if (Err!=0) return Err; |
1062 | 1063 | |
1063 | - memset(&sui, 0, sizeof(STARTUPINFO)); | |
1064 | + memset(&sui, 0, sizeof(sui)); | |
1064 | 1065 | sui.cb = sizeof(STARTUPINFO); |
1065 | 1066 | sui.wShowWindow = mode; |
1066 | 1067 | sui.dwFlags = STARTF_USESHOWWINDOW; |
1067 | - tc StrT = tc::fromUtf8(Str); | |
1068 | - tc CurDirT = tc::fromUtf8(CurDir); | |
1069 | - LPTSTR StrT_NC = (TCHAR *)(const TCHAR *)StrT; | |
1070 | - if (CurDir[0] == 0) | |
1071 | - bRet = CreateProcess(NULL, StrT_NC, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &sui, &pi); | |
1072 | - else | |
1073 | - bRet = CreateProcess(NULL, StrT_NC, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, CurDirT, &sui, &pi); | |
1068 | + wc StrW = wc::fromUtf8(Str); | |
1069 | + wc CurDirW = wc::fromUtf8(CurDir); | |
1070 | + const wchar_t *pStrW = StrW; | |
1071 | + const wchar_t *pCurdirW = NULL; | |
1072 | + if (CurDir[0] != 0) { | |
1073 | + pCurdirW = CurDirW; | |
1074 | + } | |
1075 | + bRet = _CreateProcessW(NULL, (LPWSTR)pStrW, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, pCurdirW, &sui, &pi); | |
1074 | 1076 | if (bRet == FALSE) { |
1075 | 1077 | // 実行できなかった場合、resultに-1を返す |
1076 | 1078 | SetResult(-1); |