diff options
author | Adrien Nader <adrien@notk.org> | 2015-02-11 11:58:28 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-02-11 16:38:15 +0100 |
commit | f71a78edcb2fbb2a6156abce3ab8f523eed09c66 (patch) | |
tree | 799b485045f73627c90d80f37f981d25a94d63a5 /src | |
parent | 9d1504dba11ed3d7c7f6c82fb1d1b5a7acbe4474 (diff) |
eina: correctly handle and report Eina_File error on Windows.
@fix
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/eina/eina_file_win32.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c index 01d0c9fa4c..4398e0b384 100644 --- a/src/lib/eina/eina_file_win32.c +++ b/src/lib/eina/eina_file_win32.c | |||
@@ -372,7 +372,7 @@ eina_file_real_close(Eina_File *file) | |||
372 | free(map); | 372 | free(map); |
373 | } | 373 | } |
374 | 374 | ||
375 | if (file->global_map != MAP_FAILED) | 375 | if (file->global_map != MAP_FAILED && file->handle != NULL) |
376 | UnmapViewOfFile(file->global_map); | 376 | UnmapViewOfFile(file->global_map); |
377 | 377 | ||
378 | if (file->fm) CloseHandle(file->fm); | 378 | if (file->fm) CloseHandle(file->fm); |
@@ -728,6 +728,17 @@ eina_file_open(const char *path, Eina_Bool shared) | |||
728 | 728 | ||
729 | if (handle == INVALID_HANDLE_VALUE) | 729 | if (handle == INVALID_HANDLE_VALUE) |
730 | { | 730 | { |
731 | LPVOID lpMsgBuf; | ||
732 | |||
733 | FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | | ||
734 | FORMAT_MESSAGE_FROM_SYSTEM | | ||
735 | FORMAT_MESSAGE_IGNORE_INSERTS, | ||
736 | NULL, | ||
737 | GetLastError(), | ||
738 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), | ||
739 | (LPTSTR) &lpMsgBuf, | ||
740 | 0, NULL); | ||
741 | |||
731 | switch (GetLastError()) | 742 | switch (GetLastError()) |
732 | { | 743 | { |
733 | case ERROR_FILE_NOT_FOUND: | 744 | case ERROR_FILE_NOT_FOUND: |