Changeset 657 for trunk/src/kernel32/virtual.cpp
- Timestamp:
- Aug 24, 1999, 2:23:54 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/virtual.cpp
r607 r657 1 /* $Id: virtual.cpp,v 1. 1 1999-08-21 16:30:31sandervl Exp $ */1 /* $Id: virtual.cpp,v 1.2 1999-08-24 12:23:25 sandervl Exp $ */ 2 2 3 3 /* 4 4 * Win32 virtual memory functions 5 5 * 6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) (OS/2 Port) 7 * 8 * NOTE: Quick 'n dirty implementation (read entire file in memory) 9 * Not tested, nor complete (write mapping & protection) 10 * 11 * Based on Wine code (memory\virtual.c): 6 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl) 7 * 8 * Parts (VIRTUAL_MapFileA/W) based on Wine code (memory\virtual.c): 12 9 * 13 10 * Copyright 1997 Alexandre Julliard … … 22 19 #include <win\virtual.h> 23 20 #include <heapstring.h> 24 21 #include "mmap.h" 25 22 26 23 /*********************************************************************** … … 43 40 HANDLE dupHandle; 44 41 45 if(DuplicateHandle(GetCurrentProcess(), hFile, GetCurrentProcess(), 42 if((hFile == -1 && size_low == 0) || size_high || 43 protect & (PAGE_READONLY|PAGE_READWRITE|PAGE_WRITECOPY|SEC_COMMIT|SEC_IMAGE|SEC_RESERVE|SEC_NOCACHE) || 44 ((protect & SEC_COMMIT) && (protect & SEC_RESERVE))) 45 { 46 47 dprintf(("CreateFileMappingA: invalid parameter (combination)!")); 48 SetLastError(ERROR_INVALID_PARAMETER); 49 return 0; 50 } 51 if(DuplicateHandle(GetCurrentProcess(), hFile, GetCurrentProcess(), 46 52 &dupHandle, 0, FALSE, DUPLICATE_SAME_ACCESS) == FALSE) 47 48 49 50 51 returndupHandle;53 { 54 dprintf(("CreateFileMappingA: DuplicateHandle failed!")); 55 return 0; 56 } 57 return dupHandle; 52 58 } 53 59 … … 239 245 LPVOID ptr = NULL; 240 246 241 hFile = CreateFileA( 242 247 hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL, 248 OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); 243 249 if (hFile != INVALID_HANDLE_VALUE) 244 250 {
Note:
See TracChangeset
for help on using the changeset viewer.