summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/eina/eina_file_win32.c13
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: