Windows: open files for read+write sharing, to match Unix.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 17 Mar 2010 17:04:01 -0400
changeset 1067 67221fb394d8
parent 1066 e1d83e3b5d32
child 1069 2f0de4ad18a5
Windows: open files for read+write sharing, to match Unix.
src/platform_pocketpc.c
src/platform_windows.c
--- a/src/platform_pocketpc.c	Wed Mar 17 15:35:29 2010 -0400
+++ b/src/platform_pocketpc.c	Wed Mar 17 17:04:01 2010 -0400
@@ -331,8 +331,8 @@
     wchar_t *w_fname = NULL;
 
     UTF8_TO_UNICODE_STACK_MACRO(w_fname, fname);
-    fileHandle = CreateFile(w_fname, mode, FILE_SHARE_READ, NULL,
-                            creation, FILE_ATTRIBUTE_NORMAL, NULL);
+    fileHandle = CreateFile(w_fname, mode, FILE_SHARE_READ | FILE_SHARE_WRITE,
+                            NULL, creation, FILE_ATTRIBUTE_NORMAL, NULL);
     __PHYSFS_smallFree(w_fname);
 
     BAIL_IF_MACRO(fileHandle == INVALID_HANDLE_VALUE, win32strerror(), NULL);
--- a/src/platform_windows.c	Wed Mar 17 15:35:29 2010 -0400
+++ b/src/platform_windows.c	Wed Mar 17 17:04:01 2010 -0400
@@ -989,8 +989,8 @@
 
     UTF8_TO_UNICODE_STACK_MACRO(wfname, fname);
     BAIL_IF_MACRO(wfname == NULL, ERR_OUT_OF_MEMORY, NULL);
-    fileHandle = pCreateFileW(wfname, mode, FILE_SHARE_READ, NULL,
-                              creation, FILE_ATTRIBUTE_NORMAL, NULL);
+    fileHandle = pCreateFileW(wfname, mode, FILE_SHARE_READ | FILE_SHARE_WRITE,
+                              NULL, creation, FILE_ATTRIBUTE_NORMAL, NULL);
     __PHYSFS_smallFree(wfname);
 
     BAIL_IF_MACRO