Changeset 1151 for trunk/src/kernel32/virtual.cpp
- Timestamp:
- Oct 6, 1999, 11:58:24 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/virtual.cpp
r780 r1151 1 /* $Id: virtual.cpp,v 1.1 2 1999-09-01 19:12:18phaller Exp $ */1 /* $Id: virtual.cpp,v 1.13 1999-10-06 09:58:24 phaller Exp $ */ 2 2 3 3 /* … … 15 15 * 16 16 */ 17 18 #include <odin.h> 19 #include <odinwrap.h> 17 20 18 21 #include <os2win.h> … … 24 27 #include "mmap.h" 25 28 #include "oslibdos.h" 29 30 31 ODINDEBUGCHANNEL(KERNEL32-VIRTUAL) 32 26 33 27 34 /*********************************************************************** … … 358 365 //****************************************************************************** 359 366 //****************************************************************************** 360 BOOL WIN32API VirtualFree(LPVOID lpvAddress, DWORD cbSize, DWORD FreeType) 361 { 362 DWORD rc; 363 364 dprintf(("VirtualFree at %d; %d bytes, freetype %d\n", (int)lpvAddress, cbSize, FreeType)); 365 366 if(lpvAddress == NULL || cbSize == 0) { 367 SetLastError(ERROR_INVALID_PARAMETER); 368 return(FALSE); 369 } 370 if(FreeType & MEM_DECOMMIT) { 371 rc = OSLibDosSetMem(lpvAddress, cbSize, PAG_DECOMMIT); 372 } 373 else rc = OSLibDosFreeMem(lpvAddress); //MEM_RELEASE, cbSize == 0 (or should be) 374 375 if(rc) { 376 SetLastError(ERROR_GEN_FAILURE); 377 return(FALSE); 378 } 367 ODINFUNCTION3(BOOL, VirtualFree, LPVOID, lpvAddress, 368 DWORD, cbSize, 369 DWORD, FreeType) 370 { 371 DWORD rc; 372 373 // verify parameters 374 if ( (lpvAddress == NULL) || 375 ( (FreeType & MEM_RELEASE) && 376 (cbSize != 0) ) 377 ) 378 { 379 SetLastError(ERROR_INVALID_PARAMETER); 380 return(FALSE); 381 } 382 383 if(FreeType & MEM_DECOMMIT) 384 rc = OSLibDosSetMem(lpvAddress, cbSize, PAG_DECOMMIT); 385 else 386 rc = OSLibDosFreeMem(lpvAddress); //MEM_RELEASE, cbSize == 0 (or should be) 387 388 if(rc) 389 { 390 SetLastError(ERROR_GEN_FAILURE); 391 return(FALSE); 392 } 393 379 394 return(TRUE); 380 395 }
Note:
See TracChangeset
for help on using the changeset viewer.