| 1140 | } |
| 1141 | |
| 1142 | HandlePtr dumpFile(const wchar_t* dir) |
| 1143 | { |
| 1144 | // try the given directory, if any |
| 1145 | if (dir) { |
| 1146 | HandlePtr h = tempFile(dir); |
| 1147 | if (h.get() != INVALID_HANDLE_VALUE) { |
| 1148 | return h; |
| 1149 | } |
| 1150 | } |
| 1151 | |
| 1152 | // try the current directory |
| 1153 | HandlePtr h = tempFile(L"."); |
| 1154 | if (h.get() != INVALID_HANDLE_VALUE) { |
| 1155 | return h; |
| 1156 | } |
| 1157 | |
| 1158 | std::wclog << L"cannot write dump file in current directory\n"; |
| 1159 | |
| 1160 | // try the temp directory |
| 1161 | const auto temp = tempDir(); |
| 1162 | |
| 1163 | if (!temp.empty()) { |
| 1164 | h = tempFile(temp.c_str()); |
| 1165 | if (h.get() != INVALID_HANDLE_VALUE) { |
| 1166 | return h; |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | return {}; |
| 1171 | } |
| 1172 | |
| 1173 | CoreDumpTypes coreDumpTypeFromString(const std::string& s) |
| 1174 | { |
no test coverage detected