| 1203 | } |
| 1204 | |
| 1205 | OutputHandler::~OutputHandler() |
| 1206 | { |
| 1207 | if (have_pipe()) { |
| 1208 | if (m_output_str.length() > 0) |
| 1209 | WriteToNamedPipe(m_hPipe, m_output_str); |
| 1210 | else |
| 1211 | WriteToNamedPipe(m_hPipe, wstring(CMD_PIPE_SUCCESS_STR)); |
| 1212 | FlushFileBuffers(m_hPipe); |
| 1213 | DisconnectNamedPipe(m_hPipe); |
| 1214 | CloseHandle(m_hPipe); |
| 1215 | } else if (!m_have_console) { |
| 1216 | if (m_output_str.length() >= CMD_PIPE_RESPONSE_LENGTH) { |
| 1217 | bool success = wcsncmp(m_output_str.c_str(), CMD_PIPE_SUCCESS_STR, CMD_PIPE_RESPONSE_LENGTH) == 0; |
| 1218 | ::MessageBox(NULL, m_output_str.c_str() + CMD_PIPE_RESPONSE_LENGTH, |
| 1219 | L"cppcryptfs", MB_OK | (success ? 0 : MB_ICONERROR)); |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | if (m_have_console) |
| 1224 | CloseConsole(); |
| 1225 | } |
| 1226 | int OutputHandler::print(int type, const wchar_t* fmt, ...) |
| 1227 | { |
| 1228 | int ret = 0; |
nothing calls this directly
no test coverage detected