From 1a833d15a42655464763347efa2a4085af8a741e Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Wed, 1 Jun 2011 06:18:56 +0000 Subject: [PATCH] Eina : eina_file_win32.c : add share mode when opening a file On Windows, if you want to open the same file several times, you have to tell it can... No ChangeLog as that code is work in progress) SVN revision: 59857 --- legacy/eina/src/lib/eina_file_win32.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/legacy/eina/src/lib/eina_file_win32.c b/legacy/eina/src/lib/eina_file_win32.c index a16fd28a9c..259dca6743 100644 --- a/legacy/eina/src/lib/eina_file_win32.c +++ b/legacy/eina/src/lib/eina_file_win32.c @@ -778,17 +778,20 @@ eina_file_open(const char *filename, Eina_Bool shared) /* FIXME: always open absolute path (need to fix filename according to current directory) */ + /* FIXME: how to emulate shm_open ? Just OpenFileMapping ? */ +#if 0 if (shared) - /* FIXME: shm_open is maybe not really that */ handle = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); else - handle = CreateFile(filename, GENERIC_READ, 0, +#endif + handle = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); - if (handle == INVALID_HANDLE_VALUE) return NULL; + if (handle == INVALID_HANDLE_VALUE) + return NULL; fm = CreateFileMapping(handle, NULL, PAGE_READONLY, 0, 0, NULL); if (!fm)