- Timestamp:
- Aug 26, 1999, 5:05:14 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/makefile
r705 r707 1 # $Id: makefile,v 1.3 4 1999-08-26 12:55:36sandervl Exp $1 # $Id: makefile,v 1.35 1999-08-26 15:05:14 sandervl Exp $ 2 2 3 3 # … … 189 189 conin.OBJ: \ 190 190 .\conin.h \ 191 .\hmdevice.h \ 191 192 .\conin.cpp 192 193 193 194 conout.OBJ: \ 194 195 .\conout.h \ 196 .\hmdevice.h \ 195 197 .\conout.cpp 196 198 197 199 conbuffer.OBJ: \ 198 200 .\conbuffer.h \ 201 .\hmdevice.h \ 199 202 .\conbuffer.cpp 200 203 … … 265 268 hmopen32.OBJ: \ 266 269 .\hmopen32.cpp \ 270 .\hmdevice.h \ 267 271 .\hmopen32.h \ 268 272 $(PDWIN32_INCLUDE)\handlemanager.h … … 270 274 hmobjects.obj: \ 271 275 .\hmobjects.cpp \ 276 .\hmdevice.h \ 272 277 .\hmobjects.h \ 273 278 $(PDWIN32_INCLUDE)\handlemanager.h … … 304 309 305 310 virtual.obj: virtual.cpp $(PDWIN32_INCLUDE)\win\virtual.h $(PDWIN32_INCLUDE)\handlemanager.h mmap.h 306 mmap.obj: mmap.cpp mmap.h $(PDWIN32_INCLUDE)\vmutex.h oslibdos.h 311 mmap.obj: mmap.cpp mmap.h $(PDWIN32_INCLUDE)\vmutex.h oslibdos.h 307 312 308 313 pefile.OBJ: pefile.cpp $(PDWIN32_INCLUDE)\pefile.h -
trunk/src/kernel32/mmap.cpp
r705 r707 1 /* $Id: mmap.cpp,v 1.1 4 1999-08-26 12:55:36sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.15 1999-08-26 15:05:14 sandervl Exp $ */ 2 2 3 3 /* … … 31 31 VMutex globalmapMutex; 32 32 33 34 33 //****************************************************************************** 35 34 //TODO: sharing between processes … … 61 60 if(hMemFile != -1) 62 61 { 63 #if 064 62 if(DuplicateHandle(GetCurrentProcess(), hMemFile, GetCurrentProcess(), 65 63 &hMemFile, 0, FALSE, DUPLICATE_SAME_ACCESS) == FALSE) … … 68 66 goto fail; 69 67 } 70 #endif71 68 mSize = SetFilePointer(hMemFile, 0, NULL, FILE_END); 72 69 if(mSize == -1) { … … 180 177 size = mSize - offset; 181 178 } 182 *(char *)pageAddr = 0; //testestestest183 179 if(SetFilePointer(hMemFile, offset, NULL, FILE_BEGIN) != offset) { 184 180 dprintf(("Win32MemMap::commitPage: SetFilePointer failed to set pos to %x", offset)); -
trunk/src/kernel32/oslibdos.cpp
r705 r707 1 /* $Id: oslibdos.cpp,v 1. 1 1999-08-26 12:56:02sandervl Exp $ */1 /* $Id: oslibdos.cpp,v 1.2 1999-08-26 15:05:14 sandervl Exp $ */ 2 2 3 3 /* … … 20 20 #include <win32type.h> 21 21 #include <misc.h> 22 #include <initterm.h>22 #include "initterm.h" 23 23 #include "oslibdos.h" 24 24 … … 27 27 DWORD OSLibDosAllocMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags) 28 28 { 29 // return DosAllocMem(lplpMemAddr, size, flags | flAllocMem); 29 30 return DosAllocMem(lplpMemAddr, size, flags); 30 31 } … … 59 60 //****************************************************************************** 60 61 //****************************************************************************** 62 DWORD OSLibDosOpen(char *lpszFileName, DWORD flags) 63 { 64 APIRET rc; 65 HFILE hFile; 66 ULONG ulAction; 67 DWORD os2flags = OPEN_FLAGS_NOINHERIT; 68 69 70 if(flags & OSLIB_ACCESS_READONLY) 71 os2flags |= OPEN_ACCESS_READONLY; 72 else 73 if(flags & OSLIB_ACCESS_READWRITE) 74 os2flags |= OPEN_ACCESS_READWRITE; 75 76 if(flags & OSLIB_ACCESS_SHAREDENYNONE) 77 os2flags |= OPEN_SHARE_DENYNONE; 78 else 79 if(flags & OSLIB_ACCESS_SHAREDENYREAD) 80 os2flags |= OPEN_SHARE_DENYREAD; 81 else 82 if(flags & OSLIB_ACCESS_SHAREDENYWRITE) 83 os2flags |= OPEN_SHARE_DENYWRITE; 84 85 rc = DosOpen(lpszFileName, /* File path name */ 86 &hFile, /* File handle */ 87 &ulAction, /* Action taken */ 88 0L, /* File primary allocation */ 89 0L, /* File attribute */ 90 OPEN_ACTION_FAIL_IF_NEW | 91 OPEN_ACTION_OPEN_IF_EXISTS, /* Open function type */ 92 os2flags, 93 0L); /* No extended attribute */ 94 95 if(rc) { 96 return 0; 97 } 98 else return hFile; 99 } 100 //****************************************************************************** 101 //****************************************************************************** 102 DWORD OSLibDosClose(DWORD hFile) 103 { 104 return DosClose(hFile); 105 } 106 //****************************************************************************** 107 //****************************************************************************** 108 DWORD OSLibDosGetFileSize(DWORD hFile) 109 { 110 ULONG ulLocal, filesize = 0; 111 112 DosSetFilePtr(hFile, 0L, FILE_BEGIN, &ulLocal); 113 DosSetFilePtr(hFile, 0L, FILE_END, &filesize); 114 DosSetFilePtr(hFile, 0L, FILE_BEGIN, &ulLocal); 115 return filesize; 116 } 117 //****************************************************************************** 118 //****************************************************************************** 119 DWORD OSLibDosRead(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesRead) 120 { 121 return DosRead(hFile, lpBuffer, size, nrBytesRead); 122 } 123 //****************************************************************************** 124 //****************************************************************************** 125 DWORD OSLibDosWrite(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesWritten) 126 { 127 return DosWrite(hFile, lpBuffer, size, nrBytesWritten); 128 } 129 //****************************************************************************** 130 //****************************************************************************** 131 DWORD OSLibDosSetFilePtr(DWORD hFile, DWORD offset, DWORD method) 132 { 133 DWORD os2method; 134 DWORD newoffset; 135 APIRET rc; 136 137 switch(method) { 138 case OSLIB_SETPTR_FILE_CURRENT: 139 os2method = FILE_CURRENT; 140 break; 141 case OSLIB_SETPTR_FILE_BEGIN: 142 os2method = FILE_BEGIN ; 143 break; 144 case OSLIB_SETPTR_FILE_END: 145 os2method = FILE_END; 146 break; 147 default: 148 return OSLIB_ERROR_INVALID_PARAMETER; 149 } 150 rc = DosSetFilePtr(hFile, offset, os2method, &newoffset); 151 if(rc) { 152 return -1; 153 } 154 else return newoffset; 155 } 156 //****************************************************************************** 157 //****************************************************************************** -
trunk/src/kernel32/oslibdos.h
r705 r707 1 /* $Id: oslibdos.h,v 1. 1 1999-08-26 12:56:02sandervl Exp $ */1 /* $Id: oslibdos.h,v 1.2 1999-08-26 15:05:14 sandervl Exp $ */ 2 2 3 3 /* … … 22 22 #define OSLIB_ERROR_INVALID_ADDRESS 1 23 23 #define OSLIB_ERROR_ACCESS_DENIED 2 24 #define OSLIB_ERROR_INVALID_PARAMETER 3 24 25 25 26 #ifndef __OS2_H__ … … 49 50 #endif 50 51 52 #define OSLIB_ACCESS_READONLY 1 53 #define OSLIB_ACCESS_READWRITE 2 54 #define OSLIB_ACCESS_SHAREDENYNONE 4 55 #define OSLIB_ACCESS_SHAREDENYREAD 8 56 #define OSLIB_ACCESS_SHAREDENYWRITE 16 57 58 DWORD OSLibDosOpen(char *lpszFileName, DWORD flags); 59 DWORD OSLibDosClose(DWORD hFile); 60 DWORD OSLibDosGetFileSize(DWORD hFile); 61 DWORD OSLibDosRead(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesRead); 62 DWORD OSLibDosWrite(DWORD hFile, LPVOID lpBuffer, DWORD size, DWORD *nrBytesWritten); 63 64 #define OSLIB_SETPTR_FILE_CURRENT 1 65 #define OSLIB_SETPTR_FILE_BEGIN 2 66 #define OSLIB_SETPTR_FILE_END 3 67 68 DWORD OSLibDosSetFilePtr(DWORD hFile, DWORD offset, DWORD method); 69 51 70 #endif -
trunk/src/kernel32/virtual.cpp
r705 r707 1 /* $Id: virtual.cpp,v 1. 8 1999-08-26 12:55:37sandervl Exp $ */1 /* $Id: virtual.cpp,v 1.9 1999-08-26 15:05:14 sandervl Exp $ */ 2 2 3 3 /* … … 406 406 *pfdwOldProtect |= PAGE_READWRITE; 407 407 408 if( pageFlags &(PAG_WRITE | PAG_EXECUTE))408 if((pageFlags & (PAG_WRITE | PAG_EXECUTE)) == (PAG_WRITE | PAG_EXECUTE)) 409 409 *pfdwOldProtect |= PAGE_EXECUTE_READWRITE; 410 410 else … … 471 471 pmbiBuffer->Protect |= PAGE_READWRITE; 472 472 473 if( dAttr &(PAG_WRITE | PAG_EXECUTE))473 if((dAttr & (PAG_WRITE | PAG_EXECUTE)) == (PAG_WRITE | PAG_EXECUTE)) 474 474 pmbiBuffer->Protect |= PAGE_EXECUTE_READWRITE; 475 475 else
Note:
See TracChangeset
for help on using the changeset viewer.