6 * Copyright (C) 2014 Eric Biggers
8 * This file is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the Free
10 * Software Foundation; either version 3 of the License, or (at your option) any
13 * This file is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this file; if not, see http://www.gnu.org/licenses/.
26 #include "wimlib/progress.h"
29 report_error(wimlib_progress_func_t progfunc,
30 void *progctx, int error_code, const tchar *path)
33 union wimlib_progress_info progress;
35 if (error_code == WIMLIB_ERR_SUCCESS ||
36 error_code == WIMLIB_ERR_ABORTED_BY_PROGRESS ||
37 error_code == WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS)
40 progress.handle_error.path = path;
41 progress.handle_error.error_code = error_code;
42 progress.handle_error.will_ignore = false;
45 /* Hack for Windows... */
47 wchar_t *p_question_mark = NULL;
49 if (!wcsncmp(path, L"\\??\\", 4)) {
50 /* Trivial transformation: NT namespace => Win32 namespace */
51 p_question_mark = (wchar_t *)&path[1];
52 *p_question_mark = L'\\';
56 ret = call_progress(progfunc, WIMLIB_PROGRESS_MSG_HANDLE_ERROR,
61 *p_question_mark = L'?';
67 if (!progress.handle_error.will_ignore)