diff -r 0a5e583393e1 -r 8e4bf84a7bb8 librazor/error.c --- a/librazor/error.c Tue Sep 09 15:27:12 2014 +0100 +++ b/librazor/error.c Thu Jul 07 11:04:10 2016 +0100 @@ -20,6 +20,9 @@ #ifdef MSWIN_API #include +#ifndef ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED +#define ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED 6832L +#endif #endif #include #include @@ -129,12 +132,28 @@ if (object) error->object = razor_utf16_to_utf8(object, -1); - FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER| - FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, err, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), - (LPWSTR)&buf, 0, NULL); - error->str = razor_utf16_to_utf8(buf, -1); - LocalFree(buf); + switch(err) { + case ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED: + /* + * Attempting to include files in a transaction on a filesystem + * that doesn't support them (only NTFS?) produces this error + * for which the default text isn't very informative. Try and + * give more useful information. + */ + error->str = strdup("Not allowed (perhaps the filesystem " + "doesn't support transactions)"); + break; + default: + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER| + FORMAT_MESSAGE_FROM_SYSTEM| + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, err, + MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), + (LPWSTR)&buf, 0, NULL); + error->str = razor_utf16_to_utf8(buf, -1); + LocalFree(buf); + break; + } return error; }