| 35 | #define SEMAPHORE_MAX 100 |
| 36 | |
| 37 | static QString errorCodeToString(DWORD errorCode) |
| 38 | { |
| 39 | QString result; |
| 40 | char *data = 0; |
| 41 | FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, |
| 42 | 0, errorCode, 0, |
| 43 | (char*)&data, 0, 0); |
| 44 | result = QString::fromLocal8Bit(data); |
| 45 | if (data != 0) |
| 46 | LocalFree(data); |
| 47 | |
| 48 | if (result.endsWith(QLatin1Char('\n'))) |
| 49 | result.truncate(result.length() - 1); |
| 50 | |
| 51 | return result; |
| 52 | } |
| 53 | |
| 54 | bool QtLockedFile::lock(LockMode mode, bool block) |
| 55 | { |
no test coverage detected