Create a message from a Windows error code
| 40 | |
| 41 | // Create a message from a Windows error code |
| 42 | static wxString SystemError() |
| 43 | { |
| 44 | WCHAR * lpMsgBuf = NULL; |
| 45 | |
| 46 | FormatMessageW( |
| 47 | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, |
| 48 | NULL, |
| 49 | GetLastError(), |
| 50 | 0, // Default language |
| 51 | (LPWSTR) &lpMsgBuf, |
| 52 | 0, |
| 53 | NULL |
| 54 | ); |
| 55 | |
| 56 | wxString ret(lpMsgBuf); |
| 57 | LocalFree(lpMsgBuf); |
| 58 | return ret; |
| 59 | } |
| 60 | |
| 61 | // Create a file in sparse mode |
| 62 | bool PlatformSpecific::CreateSparseFile(const CPath& name, uint64_t size) |