Browse Source

allow more sharing in win32 mode

master
Felix von Leitner 17 years ago
parent
commit
2dfffe5e4e
  1. 2
      mmap/mmap_private.c
  2. 2
      mmap/mmap_read.c
  3. 2
      mmap/mmap_shared.c

2
mmap/mmap_private.c

@ -12,7 +12,7 @@ char* mmap_private(const char* filename,unsigned long* filesize) {
#ifdef __MINGW32__
HANDLE fd,m;
char* map;
fd=CreateFile(filename,GENERIC_WRITE|GENERIC_READ,FILE_SHARE_WRITE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
fd=CreateFile(filename,GENERIC_WRITE|GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if (fd==INVALID_HANDLE_VALUE)
return 0;
m=CreateFileMapping(fd,0,PAGE_WRITECOPY,0,0,NULL);

2
mmap/mmap_read.c

@ -12,7 +12,7 @@ extern char* mmap_read(const char* filename,unsigned long* filesize) {
#ifdef __MINGW32__
HANDLE fd,m;
char* map;
fd=CreateFile(filename,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
fd=CreateFile(filename,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if (fd==INVALID_HANDLE_VALUE)
return 0;
m=CreateFileMapping(fd,0,PAGE_READONLY,0,0,NULL);

2
mmap/mmap_shared.c

@ -12,7 +12,7 @@ extern char* mmap_shared(const char* filename,unsigned long* filesize) {
#ifdef __MINGW32__
HANDLE fd,m;
char* map;
fd=CreateFile(filename,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_WRITE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
fd=CreateFile(filename,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if (fd==INVALID_HANDLE_VALUE)
return 0;
m=CreateFileMapping(fd,0,PAGE_READWRITE,0,0,NULL);

Loading…
Cancel
Save