1997-03-05 09:22:35 +01:00
|
|
|
/*
|
|
|
|
* Win32 virtual memory functions
|
|
|
|
*
|
|
|
|
* Copyright 1997 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
|
|
|
|
2001-11-06 21:57:11 +01:00
|
|
|
#include "config.h"
|
2001-10-14 18:25:47 +02:00
|
|
|
#include "wine/port.h"
|
1999-07-10 15:16:29 +02:00
|
|
|
|
1997-03-05 09:22:35 +01:00
|
|
|
#include <fcntl.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
1997-03-05 09:22:35 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
2002-09-17 20:54:42 +02:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
1999-07-10 15:16:29 +02:00
|
|
|
#endif
|
2002-09-17 20:54:42 +02:00
|
|
|
|
2003-01-07 21:36:20 +01:00
|
|
|
#define NONAMELESSUNION
|
|
|
|
#define NONAMELESSSTRUCT
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "ntstatus.h"
|
|
|
|
#include "windef.h"
|
1997-03-05 09:22:35 +01:00
|
|
|
#include "winbase.h"
|
2003-08-20 20:22:31 +02:00
|
|
|
#include "winnls.h"
|
2002-09-17 20:54:42 +02:00
|
|
|
#include "winternl.h"
|
1997-03-05 09:22:35 +01:00
|
|
|
#include "winerror.h"
|
2002-09-17 20:54:42 +02:00
|
|
|
#include "wine/exception.h"
|
2002-12-13 00:34:01 +01:00
|
|
|
#include "excpt.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1997-03-05 09:22:35 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(virtual);
|
2005-03-22 22:16:39 +01:00
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(seh);
|
Release 971221
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
* [Make.rules.in] [Makefile.in] [documentation/Makefile.in]
[documentation/README.documentation]
First cut at Wine API documentation. No longer install reference
manual by default.
Wed Dec 17 21:32:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed GetTempFileName16() to use current path of requested drive
as needed.
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/dciman32.spec]
[if1632/msvfw32.spec] [if1632/tapi32.spec] [if1632/wow32.spec]
Added misc DLLs needed by various apps.
Wed Dec 17 12:01:50 1997 Morten Eriksen <mortene@sim.no>
* [if1632/gdi32.spec] [include/windows.h] [objects/palette.c]
Inserted empty stub for CreateHalftonePalette.
Tue Dec 16 22:08:06 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [windows/mdi.c]
Use VK_TAB instead of VK_SEPARATOR in TranslateMDISysAccel().
* [graphics/metafiledrv/init.c]
DeleteDC() on a MetaDC doesn't do anything - it shouldn't. Therefore
fix cleanup of MetaDCs in CloseMetaFile(); they now actually get
removed from the GDI heap!
* [graphics/x11drv/xfont.c]
Preserve FO_MATCH_XYINDEP flag in XFONT_MatchFIList(). Should reduce
the number of bold-italic matches.
Tue Dec 16 20:11:43 1997 Bertho Stultiens <bertho@panter.soci.aau.dk>
* [graphics/painting.c]
Included an implementation of DrawState
* [if1632/thunk.c]
Changed many fprintfs into dprintf_thunk
* [include/cache.h] [graphics/cache.c]
New files to hold cached handles to regulary used GDI object.
* [include/windows.h]
Added DRAWSTATExx typedefs
Added DSS_DEFAULT define for DrawState
* [objects/text.c]
New implementation of GrayString()
* [controls/uitools.c]
Implemented DrawFrameControl() functions
Changed DrawEdge() behaviour to win95 implementation
Mon Dec 15 23:43:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/path.c] [include/path.h] [graphics/painting.c]
[if1632/gdi32.spec] [include/gdi.h] [include/windows.h]
[objects/dc.c]
Added preliminary support for GDI paths.
* [objects/dc.c]
Added DC_Init_DC_INFO function for initializing WIN_DC_INFO
structure.
* [include/windows.h] [include/gdi.h] [objects/gdiobj.c]
Added DEFAULT_GUI_FONT.
* [include/winerror.h]
Added a few error codes.
* [memory/heap.c]
Changed HeapAlloc to make the correct calls to SetLastError
(now conforms to NT's behaviour).
* [windows/win.c]
Changed WIN_CreateWindowEx to allow child windows with zero
width / height.
Sun Dec 14 12:01:07 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/*] [relay32/*]
Moved all 32-bit relay stuff to relay32/
* [fi1632/thunk.c] [win32/kernel32.c]
Moved all KERNEL32 ordinal functions to kernel32.c
* [memory/selector.c]
Initialize selectors in AllocSelectorArray.
* [tools/build.c]
Generate C instead of assembly for Win32 relays.
Fixed stack corruption in CallTo16 functions, found by Bertho
Stultiens.
Sun Dec 14 10:55:00 1997 Andreas Mohr <100.30936@germany.net>
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/ole2thk.spec]
Added built-in OLE2THK.DLL.
* [if1632/toolhelp.spec] [include/toolhelp.h] [memory/selector.c]
[misc/toolhelp.c]
Added stubs for StackTraceFirst(), StackTraceCSIPFirst(),
StackTraceNext(), UTSelectorOffsetToLinear()
and UTLinearToSelectorOffset().
Sat Dec 13 17:26:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c]
32-bit API fixes for reported problems (thanks to Marcus
and David).
* [graphics/x11drv/xfont.c]
Little tweak in point size calculation.
* [windows/defwnd.c] [windows/dce.c] [windows/winhelp.c]
[windows/winproc.c] [windows/win.c]
Bug fixes.
Sat Dec 13 16:35:14 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [files/dos_fs.c]
OpenFile with empty filename and OF_PARSE returns current dir.
* [misc/commdlg.c]
Ignore initial dir if bogus.
* [files/file.c]
Locking an identic region in a file must not be an error.
* [misc/lstr.c]
Use wide char ctype functions.
Fri Dec 12 23:46:22 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/drive.c]
First attempt for GetDiskFreeSpaceEx.
Fri Dec 12 23:18:41 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_resource.c]
Fixed wrongly appearing menus problem (only use default lookups in
last resource subtree).
* [multimedia/*.c]
Added win32 support for time* and joy* lowlevel drivers,
(not excessively tested), some misc fixes and cleanups.
* [misc/shellord.c][misc/shell.c][ole/folders.c][ole/ifs.c]
[include/interfaces.h][include/shlobj.h]
Added some more undocumented SHELL32 functions, some shell folder
interface stubs added, SHGetMalloc, SHGetDesktopFolder,
SHGetSpecialFolderLocation, SHGetPathFromIDList stubs added,
IMalloc, IUnknown implemented.
* [windows/msgbox.c]
Implemented MessageBoxIndirect*, some internal changes.
* [if1632/thunk.c]
KERNEL_431 implemented.
* [objects/gdiobj.c]
GetCurrentObject implemented.
Wed Dec 3 01:09:17 1997 Gordon Chaffee <chaffee@apu.cs.berkeley.edu>
* [objects/dib.c]
Fix a couple small DIB problems.
* [controls/edit.c]
Fix a typo.
* [files/dos_fs.c]
Try normal readdir in case fs is specified as vfat but isn't.
* [files/profile.c]
Implementation of WritePrivateProfileSection32A from Uwe Bonnes.
* [misc/printdrv.c]
OpenPrinter32A stub, helps Word97 start.
* [objects/text.c]
Fixup implementation of GetTextCharsetInfo.
* [scheduler/process.c]
Fix environment variable expansion.
* [win32/code_page.c]
Make MultiByteToWideChar and WideCharToMultiByte conform in return
values and error conditions to those in Windows NT 4.0.
* [windows/message.c]
Fix broadcasting problems in Win32. The Win32 docs say to use
HWND_TOPMOST to broadcast to all Win32 Windows.
* [memory/virtual.c] [loader/pe_image.c]
Do not map in VirtualAlloc if address is specified and space is
not available. This is required by Win32.
* [include/pen.h] [include/x11drv.h] [objects/dc.c]
[objects/pen.c] [graphics/x11drv/pen.c]
Support for ExtCreatePen.
Tue Dec 2 20:22:06 1997 Morten Welinder <terra@diku.dk>
* [*/*.c] [*/*.h]
Add lots of prototypes.
* [if1632/kernel32.spec][include/windows.h][include/winnt.h]
[misc/cpu.c]
Define IsProcessorFeaturePresent.
* [misc/crtdll.c]
(CRTDLL__getcwd): Allocate enough memory for the terminating zero.
* [misc/ver.c]
Improve check for null component in _find_data[AW]. Plug leaks
in VerQueryValue*.
* [win32/console.c][if1632/kernel32.spec]
Add stubs for GetConsoleCursorInfo32, SetConsoleCursorInfo32.
* [windows/message.c][if1632/user32.spec][include/windows.h]
Define SendMessageTimeout*.
* [graphics/x11drv/xfont.c]
Change algorithm of __genericCheckSum to be alignment safe.
* [misc/main.c] [misc/winsock.c] [misc/winsock_dns.c]
Include winsock.h early to avoid Solaris problem.
* [include/windows.h]
Undef FSHIFT before we define it.
* [rc/winerc.c]
Include <fcntl.h> instead of <sys/fcntl.h>.
* [files/file.c]
Use strerror in FILE_SetDosError if available.
* [include/config.h.in] [configure.in]
Check for strerror.
* [objects/gdiobj.c]
Make static font structures aligned.
Mon Dec 1 10:10:21 1997 Karl Garrison <karlos@eznet.net>
* [win32/console.c] [if1632/kernel32.spec] [include/windows.h]
Added stub for GetNumberOfConsoleMouseButtons.
Added stub for PeekConsoleInput(A,W).
Fixed parameter list for WriteConsole(A,W).
GetNumberOfConsoleInputEvents now returns 0 events instead of 1
(since low-level console functions are not yet supported).
GetConsoleMode no longer returns ENABLE_WINDOW_INPUT and
ENABLE_MOUSE_INPUT since these are not currently implemented.
1997-12-21 20:17:50 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
static unsigned int page_size;
|
2000-05-01 23:23:02 +02:00
|
|
|
|
|
|
|
/* filter for page-fault exceptions */
|
|
|
|
static WINE_EXCEPTION_FILTER(page_fault)
|
|
|
|
{
|
|
|
|
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
|
|
|
|
return EXCEPTION_EXECUTE_HANDLER;
|
|
|
|
return EXCEPTION_CONTINUE_SEARCH;
|
|
|
|
}
|
|
|
|
|
1997-03-05 09:22:35 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualAlloc (KERNEL32.@)
|
|
|
|
* Reserves or commits a region of pages in virtual address space
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
2002-09-17 20:54:42 +02:00
|
|
|
* Base address of allocated region of pages
|
1998-03-29 21:44:57 +02:00
|
|
|
* NULL: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
LPVOID WINAPI VirtualAlloc(
|
|
|
|
LPVOID addr, /* [in] Address of region to reserve or commit */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size, /* [in] Size of region */
|
2002-09-17 20:54:42 +02:00
|
|
|
DWORD type, /* [in] Type of allocation */
|
|
|
|
DWORD protect)/* [in] Type of access protection */
|
2001-10-09 23:50:44 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
return VirtualAllocEx( GetCurrentProcess(), addr, size, type, protect );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualAllocEx (KERNEL32.@)
|
1997-03-05 09:22:35 +01:00
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* Seems to be just as VirtualAlloc, but with process handle.
|
2005-11-08 12:01:03 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Base address of allocated region of pages
|
|
|
|
* NULL: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
LPVOID WINAPI VirtualAllocEx(
|
|
|
|
HANDLE hProcess, /* [in] Handle of process to do mem operation */
|
|
|
|
LPVOID addr, /* [in] Address of region to reserve or commit */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size, /* [in] Size of region */
|
2002-09-17 20:54:42 +02:00
|
|
|
DWORD type, /* [in] Type of allocation */
|
|
|
|
DWORD protect ) /* [in] Type of access protection */
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
2004-10-11 22:59:06 +02:00
|
|
|
LPVOID ret = addr;
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status;
|
1997-03-05 09:22:35 +01:00
|
|
|
|
2004-10-11 22:59:06 +02:00
|
|
|
if ((status = NtAllocateVirtualMemory( hProcess, &ret, 0, &size, type, protect )))
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
ret = NULL;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
return ret;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualFree (KERNEL32.@)
|
|
|
|
* Release or decommits a region of pages in virtual address space.
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
2002-09-17 20:54:42 +02:00
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
BOOL WINAPI VirtualFree(
|
|
|
|
LPVOID addr, /* [in] Address of region of committed pages */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size, /* [in] Size of region */
|
2002-09-17 20:54:42 +02:00
|
|
|
DWORD type /* [in] Type of operation */
|
1998-03-29 21:44:57 +02:00
|
|
|
) {
|
2002-09-17 20:54:42 +02:00
|
|
|
return VirtualFreeEx( GetCurrentProcess(), addr, size, type );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualFreeEx (KERNEL32.@)
|
|
|
|
* Release or decommits a region of pages in virtual address space.
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
2002-09-17 20:54:42 +02:00
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-21 03:21:00 +02:00
|
|
|
BOOL WINAPI VirtualFreeEx( HANDLE process, LPVOID addr, SIZE_T size, DWORD type )
|
2002-09-17 20:54:42 +02:00
|
|
|
{
|
|
|
|
NTSTATUS status = NtFreeVirtualMemory( process, &addr, &size, type );
|
|
|
|
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return !status;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualLock (KERNEL32.@)
|
|
|
|
* Locks the specified region of virtual address space
|
1997-03-05 09:22:35 +01:00
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* NOTE
|
|
|
|
* Always returns TRUE
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
BOOL WINAPI VirtualLock( LPVOID addr, /* [in] Address of first byte of range to lock */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size ) /* [in] Number of bytes in range to lock */
|
2001-10-09 23:50:44 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status = NtLockVirtualMemory( GetCurrentProcess(), &addr, &size, 1 );
|
|
|
|
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return !status;
|
2001-10-09 23:50:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-30 01:59:26 +02:00
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualUnlock (KERNEL32.@)
|
|
|
|
* Unlocks a range of pages in the virtual address space
|
2002-07-30 01:59:26 +02:00
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* NOTE
|
|
|
|
* Always returns TRUE
|
2000-08-14 22:20:01 +02:00
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* RETURNS
|
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
Release 980628
Sun Jun 28 18:37:02 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c]
Moved page-fault handling to INSTR_EmulateInstruction.
* [scheduler/thread.c]
Added locking and check for own thread in Suspend/ResumeThread.
Sat Jun 27 21:25:21 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c]
[graphics/x11drv/bitblt.c] [include/bitmap.h]
Improved DIB section handling using page fault handlers.
(Note: This patch includes code contributed by Matthew J. Francis.)
* [memory/virtual.c] [if1632/signal.c] [include/global.h]
Page Fault handler support added.
* [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c]
[misc/winsock_dns.c] [include/sig_context.h] [include/thread.h]
16-bit %fs handling improved: Always preserve 16-bit %fs value,
always restore 32-bit %fs value for signal handlers.
* [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c]
[loader/ne/resource.c] [include/callback.h] [include/module.h]
[if1632/kernel.spec] [if1632/wprocs.spec]
Resource Handler function pointer stored as 16-bit SEGPTR.
* [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec]
[if1632/kernel.spec] [loader/ne/module.c]
Some minor incompatibilities fixed (Win32s relies on those):
GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize
should cope with having the WINDOWPOS structure trashed;
the OFSTRUCT in the NE module image should be placed *last*.
* [include/windows.h]
Missing prototype for FlushViewOfFile.
* [loader/task.c]
Bugfix: Command line should *not* start with a blank.
* [loader/ne/segment.c]
Bugfix: Fixups to offset 0 were never applied.
* [misc/lstr.c]
Use debugstr_a in OutputDebugString16.
* [msdos/dpmi.c]
Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added.
* [msdos/int21.c]
Stub for int 21 AX=440d CL=6f (get drive map information) added.
Fri Jun 26 18:08:30 1998 Rein Klazes <rklazes@casema.net>
* [windows/winpos.c]
Fix small buglet that mixed up maximized and minimized windows.
* [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c]
[graphics/x11drv/graphics.c]
Fix some bugs with lines joining styles. Draws rectangles
with thick pens now correctly.
Fri Jun 26 16:22:23 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c]
Fixed bug I introduced last release in InternalExtractIcon.
* [win32/file.c]
Added documentation for CreateFile32A.
* [documentation/wine.man]
Updated manpage.
* [ChangeLog]
Added my entry from last release.
Fri Jun 26 13:33:30 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h]
[include/print.h] [objects/gdiobj.c]
First stages of an internal Postscript driver. See
graphics/psdrv/README . Should print text (badly) from win3.1 notepad,
write and winword6.
* [documentation/printing]
Some notes on printing.
* [controls/edit.c]
Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle.
EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS
and not as an action as the docs say. This actually makes more sense.
Scroll the caret back to zero after a WM_SETTEXT.
Fri Jun 26 10:56:25 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/snoop.c]
Added win16 inter-dll snooping.
* [win32/ordinals.c]
KERNEL_485 is GetProcessDword.
* [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c]
Added xcalloc so we 0 initialize XImages.
Fixes/Hides the 'junk around MOPYFish'.
* [misc/ntdll.c]
Some stubs added.
Thu Jun 25 15:22:43 1998 Adrian Harvey <adrian@select.com.au>
* [scheduler/thread.c]
Implemented SuspendThread and ResumeThread.
Thu Jun 25 00:55:03 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c]
[relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in]
[documentation/status/directplay]
Added preliminary support for DirectPlay & DirectPlayLobby. Moved the
preliminary stubs put in the dsound files into two new files
dplay.h and dplay.c.
Added new debug channel (dplay) for this.
Created new document to keep track of implementation.
* [include/winioctl.h][win32/device.c]
Added some framework in DeviceIoControl to, in the future, support
the "builtin" windows dwIoControlCodes. Added new header file
winioctl.h .
* [multimedia/mmsystem.c]
Added slightly improved debugging information for PlaySound.
Wed Jun 24 12:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [files/profile.c][graphics/x11drv/xfont.c][loader/module.c]
Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp,
lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp
because it's not necessary to support locale on such places.
It causes a huge overhead and even fails sometimes
* [include/oleauto.h][include/winerror.h]
Added some ole-related constants.
* [misc/shell.c]
SHELL32_DllGetClassObject, SHGetSpecialFolderLocation,
SHGetPathFromIDList improved the stubs
* [ole/folders.c]
IShellFolder* functions rewrote the stubs so don't crash and give
something sensible back, started implementation of.
* [ole/typelib.c][relay32/oleaut32.spec]
LoadTypeLib32, RegisterTypeLib stub.
* [ole/ole2nls.c]
Fixed a buffer overrun in CompareString32A.
Test for a bad pointer in LCMapString32A (happens
in winhlp32 while building a index for searching).
* [relay32/oleaut32.spec] [ole/typelib.c]
Added stub for LoadTypeLib (ole32) to make excel95 happy.
Tue Jun 23 22:47:09 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [relay32/kernel32.spec]
Added WritePrivateProfileStructA, GetPrivateProfileStructA,
GetPrivateProfileSectionNames16.
Tue Jun 23 01:34:43 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases.
LCMapString32A: Map final '\0' for '\0'-terminated strings.
* [misc/shellord.c] [files/profile.c] [graphics/driver.c]
[loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c]
Changed lstrcmpi32A -> strcasecmp. Should be OK in these places.
Sat Jun 20 23:40:00 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/]
Wrc version 1.0.2 (20-Jun-1998). Please revert to
the file tools/wrc/CHANGES for details.
Sat Jun 20 14:58:00 1998 Marcel Baur <mbaur@g26.ethz.ch>
* [ole/ole2nls.c] [ole/nls/*]
Added the first 57 nls files, most are not yet complete.
Wed Jun 17 11:16:54 1998 David Luyer <luyer@ucs.uwa.edu.au>
* [relay32/relay386.c] [if1632/relay.c]
Move debug_relay_(include|exclude)_list handling into
seperate function RELAY_ShowDebugmsgsRelay(). Include
checking of this for 16 bit calls (originally only
32-bit calls).
* [relay32/snoop.c] [misc/main.c]
Add debug_snoop_(include|exclude)_list as per the relay stuff.
Fix typo and add information on -debugmsg +/-relay=... in
help on -debugmsg. Refer to availability of snoop too.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/header.c][include/header.h][include/commctrl.h]
Added owner draw support.
* [windows/nonclient.c][windows/sysmetics.c]
Fixed menu bar height for Win95 look.
Split NC_AdjustRect95() into NC_AdjustRectOuter95() and
NC_AdjustRectInner95 to fix a menu bar bug.
Improved Win95 look.
* [controls/progress.c]
Improved drawing code. Borders will be drawn by non-client code.
* [controls/updown.c]
Changed memory allocation and fixed some bugs.
* [controls/toolbar.c]
Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs.
Several improvements.
* [misc/shell.c]
Added stub for BrowseForFoldersA().
* [misc/shellord.c]
Added stub for SHELL32_147().
* [controls/comctl32undoc.c]
Minor changes.
* [documentation/common_controls]
New File: Documentation about development status, undocumented
features and functions of the common controls.
1998-06-28 20:40:26 +02:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
BOOL WINAPI VirtualUnlock( LPVOID addr, /* [in] Address of first byte of range */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size ) /* [in] Number of bytes in range */
|
Release 980628
Sun Jun 28 18:37:02 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c]
Moved page-fault handling to INSTR_EmulateInstruction.
* [scheduler/thread.c]
Added locking and check for own thread in Suspend/ResumeThread.
Sat Jun 27 21:25:21 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c]
[graphics/x11drv/bitblt.c] [include/bitmap.h]
Improved DIB section handling using page fault handlers.
(Note: This patch includes code contributed by Matthew J. Francis.)
* [memory/virtual.c] [if1632/signal.c] [include/global.h]
Page Fault handler support added.
* [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c]
[misc/winsock_dns.c] [include/sig_context.h] [include/thread.h]
16-bit %fs handling improved: Always preserve 16-bit %fs value,
always restore 32-bit %fs value for signal handlers.
* [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c]
[loader/ne/resource.c] [include/callback.h] [include/module.h]
[if1632/kernel.spec] [if1632/wprocs.spec]
Resource Handler function pointer stored as 16-bit SEGPTR.
* [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec]
[if1632/kernel.spec] [loader/ne/module.c]
Some minor incompatibilities fixed (Win32s relies on those):
GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize
should cope with having the WINDOWPOS structure trashed;
the OFSTRUCT in the NE module image should be placed *last*.
* [include/windows.h]
Missing prototype for FlushViewOfFile.
* [loader/task.c]
Bugfix: Command line should *not* start with a blank.
* [loader/ne/segment.c]
Bugfix: Fixups to offset 0 were never applied.
* [misc/lstr.c]
Use debugstr_a in OutputDebugString16.
* [msdos/dpmi.c]
Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added.
* [msdos/int21.c]
Stub for int 21 AX=440d CL=6f (get drive map information) added.
Fri Jun 26 18:08:30 1998 Rein Klazes <rklazes@casema.net>
* [windows/winpos.c]
Fix small buglet that mixed up maximized and minimized windows.
* [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c]
[graphics/x11drv/graphics.c]
Fix some bugs with lines joining styles. Draws rectangles
with thick pens now correctly.
Fri Jun 26 16:22:23 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c]
Fixed bug I introduced last release in InternalExtractIcon.
* [win32/file.c]
Added documentation for CreateFile32A.
* [documentation/wine.man]
Updated manpage.
* [ChangeLog]
Added my entry from last release.
Fri Jun 26 13:33:30 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h]
[include/print.h] [objects/gdiobj.c]
First stages of an internal Postscript driver. See
graphics/psdrv/README . Should print text (badly) from win3.1 notepad,
write and winword6.
* [documentation/printing]
Some notes on printing.
* [controls/edit.c]
Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle.
EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS
and not as an action as the docs say. This actually makes more sense.
Scroll the caret back to zero after a WM_SETTEXT.
Fri Jun 26 10:56:25 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/snoop.c]
Added win16 inter-dll snooping.
* [win32/ordinals.c]
KERNEL_485 is GetProcessDword.
* [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c]
Added xcalloc so we 0 initialize XImages.
Fixes/Hides the 'junk around MOPYFish'.
* [misc/ntdll.c]
Some stubs added.
Thu Jun 25 15:22:43 1998 Adrian Harvey <adrian@select.com.au>
* [scheduler/thread.c]
Implemented SuspendThread and ResumeThread.
Thu Jun 25 00:55:03 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c]
[relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in]
[documentation/status/directplay]
Added preliminary support for DirectPlay & DirectPlayLobby. Moved the
preliminary stubs put in the dsound files into two new files
dplay.h and dplay.c.
Added new debug channel (dplay) for this.
Created new document to keep track of implementation.
* [include/winioctl.h][win32/device.c]
Added some framework in DeviceIoControl to, in the future, support
the "builtin" windows dwIoControlCodes. Added new header file
winioctl.h .
* [multimedia/mmsystem.c]
Added slightly improved debugging information for PlaySound.
Wed Jun 24 12:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [files/profile.c][graphics/x11drv/xfont.c][loader/module.c]
Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp,
lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp
because it's not necessary to support locale on such places.
It causes a huge overhead and even fails sometimes
* [include/oleauto.h][include/winerror.h]
Added some ole-related constants.
* [misc/shell.c]
SHELL32_DllGetClassObject, SHGetSpecialFolderLocation,
SHGetPathFromIDList improved the stubs
* [ole/folders.c]
IShellFolder* functions rewrote the stubs so don't crash and give
something sensible back, started implementation of.
* [ole/typelib.c][relay32/oleaut32.spec]
LoadTypeLib32, RegisterTypeLib stub.
* [ole/ole2nls.c]
Fixed a buffer overrun in CompareString32A.
Test for a bad pointer in LCMapString32A (happens
in winhlp32 while building a index for searching).
* [relay32/oleaut32.spec] [ole/typelib.c]
Added stub for LoadTypeLib (ole32) to make excel95 happy.
Tue Jun 23 22:47:09 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [relay32/kernel32.spec]
Added WritePrivateProfileStructA, GetPrivateProfileStructA,
GetPrivateProfileSectionNames16.
Tue Jun 23 01:34:43 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases.
LCMapString32A: Map final '\0' for '\0'-terminated strings.
* [misc/shellord.c] [files/profile.c] [graphics/driver.c]
[loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c]
Changed lstrcmpi32A -> strcasecmp. Should be OK in these places.
Sat Jun 20 23:40:00 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/]
Wrc version 1.0.2 (20-Jun-1998). Please revert to
the file tools/wrc/CHANGES for details.
Sat Jun 20 14:58:00 1998 Marcel Baur <mbaur@g26.ethz.ch>
* [ole/ole2nls.c] [ole/nls/*]
Added the first 57 nls files, most are not yet complete.
Wed Jun 17 11:16:54 1998 David Luyer <luyer@ucs.uwa.edu.au>
* [relay32/relay386.c] [if1632/relay.c]
Move debug_relay_(include|exclude)_list handling into
seperate function RELAY_ShowDebugmsgsRelay(). Include
checking of this for 16 bit calls (originally only
32-bit calls).
* [relay32/snoop.c] [misc/main.c]
Add debug_snoop_(include|exclude)_list as per the relay stuff.
Fix typo and add information on -debugmsg +/-relay=... in
help on -debugmsg. Refer to availability of snoop too.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/header.c][include/header.h][include/commctrl.h]
Added owner draw support.
* [windows/nonclient.c][windows/sysmetics.c]
Fixed menu bar height for Win95 look.
Split NC_AdjustRect95() into NC_AdjustRectOuter95() and
NC_AdjustRectInner95 to fix a menu bar bug.
Improved Win95 look.
* [controls/progress.c]
Improved drawing code. Borders will be drawn by non-client code.
* [controls/updown.c]
Changed memory allocation and fixed some bugs.
* [controls/toolbar.c]
Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs.
Several improvements.
* [misc/shell.c]
Added stub for BrowseForFoldersA().
* [misc/shellord.c]
Added stub for SHELL32_147().
* [controls/comctl32undoc.c]
Minor changes.
* [documentation/common_controls]
New File: Documentation about development status, undocumented
features and functions of the common controls.
1998-06-28 20:40:26 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status = NtUnlockVirtualMemory( GetCurrentProcess(), &addr, &size, 1 );
|
|
|
|
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return !status;
|
Release 980628
Sun Jun 28 18:37:02 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/signal.c] [miscemu/instr.c] [memory/virtual.c]
Moved page-fault handling to INSTR_EmulateInstruction.
* [scheduler/thread.c]
Added locking and check for own thread in Suspend/ResumeThread.
Sat Jun 27 21:25:21 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [objects/dib.c] [objects/bitmap.c] [objects/oembitmap.c]
[graphics/x11drv/bitblt.c] [include/bitmap.h]
Improved DIB section handling using page fault handlers.
(Note: This patch includes code contributed by Matthew J. Francis.)
* [memory/virtual.c] [if1632/signal.c] [include/global.h]
Page Fault handler support added.
* [if1632/signal.c] [loader/signal.c] [tools/build.c] [misc/system.c]
[misc/winsock_dns.c] [include/sig_context.h] [include/thread.h]
16-bit %fs handling improved: Always preserve 16-bit %fs value,
always restore 32-bit %fs value for signal handlers.
* [if1632/thunk.c] [loader/module.c] [misc/callback.c] [windows/user.c]
[loader/ne/resource.c] [include/callback.h] [include/module.h]
[if1632/kernel.spec] [if1632/wprocs.spec]
Resource Handler function pointer stored as 16-bit SEGPTR.
* [loader/task.c] [windows/win.c] [windows/winpos.c] [if1632/user.spec]
[if1632/kernel.spec] [loader/ne/module.c]
Some minor incompatibilities fixed (Win32s relies on those):
GetExePtr, IsWindow16 should set ES on return; WINPOS_SendNCCalcSize
should cope with having the WINDOWPOS structure trashed;
the OFSTRUCT in the NE module image should be placed *last*.
* [include/windows.h]
Missing prototype for FlushViewOfFile.
* [loader/task.c]
Bugfix: Command line should *not* start with a blank.
* [loader/ne/segment.c]
Bugfix: Fixups to offset 0 were never applied.
* [misc/lstr.c]
Use debugstr_a in OutputDebugString16.
* [msdos/dpmi.c]
Stub for int 31 BL=2f AX=7a20 (NetWare: Get VLM Call Address) added.
* [msdos/int21.c]
Stub for int 21 AX=440d CL=6f (get drive map information) added.
Fri Jun 26 18:08:30 1998 Rein Klazes <rklazes@casema.net>
* [windows/winpos.c]
Fix small buglet that mixed up maximized and minimized windows.
* [include/x11drv.h] [objects/dc.c] [graphics/x11drv/pen.c]
[graphics/x11drv/graphics.c]
Fix some bugs with lines joining styles. Draws rectangles
with thick pens now correctly.
Fri Jun 26 16:22:23 1998 James Juran <jrj120@psu.edu>
* [misc/shell.c]
Fixed bug I introduced last release in InternalExtractIcon.
* [win32/file.c]
Added documentation for CreateFile32A.
* [documentation/wine.man]
Updated manpage.
* [ChangeLog]
Added my entry from last release.
Fri Jun 26 13:33:30 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*] [if1632/wineps.spec] [include/psdrv.h]
[include/print.h] [objects/gdiobj.c]
First stages of an internal Postscript driver. See
graphics/psdrv/README . Should print text (badly) from win3.1 notepad,
write and winword6.
* [documentation/printing]
Some notes on printing.
* [controls/edit.c]
Strip off WS_BORDER in WM_NCREATE, edit draws its own rectangle.
EC_USEFONTINFO seems to be used as a left/right value for EM_SETMARGINS
and not as an action as the docs say. This actually makes more sense.
Scroll the caret back to zero after a WM_SETTEXT.
Fri Jun 26 10:56:25 1998 Marcus Meissner <marcus@jet.franken.de>
* [if1632/snoop.c]
Added win16 inter-dll snooping.
* [win32/ordinals.c]
KERNEL_485 is GetProcessDword.
* [include/xmalloc.h][include/bitmap.h][misc/xmalloc.c]
Added xcalloc so we 0 initialize XImages.
Fixes/Hides the 'junk around MOPYFish'.
* [misc/ntdll.c]
Some stubs added.
Thu Jun 25 15:22:43 1998 Adrian Harvey <adrian@select.com.au>
* [scheduler/thread.c]
Implemented SuspendThread and ResumeThread.
Thu Jun 25 00:55:03 1998 Peter Hunnisett <hunnise@nortel.ca>
* [include/debug.h,dplay.h,dsound.h][multimedia/dsound.c,dplay.c]
[relay32/dplayx.spec,dplay.spec][multimedia/Makefile.in]
[documentation/status/directplay]
Added preliminary support for DirectPlay & DirectPlayLobby. Moved the
preliminary stubs put in the dsound files into two new files
dplay.h and dplay.c.
Added new debug channel (dplay) for this.
Created new document to keep track of implementation.
* [include/winioctl.h][win32/device.c]
Added some framework in DeviceIoControl to, in the future, support
the "builtin" windows dwIoControlCodes. Added new header file
winioctl.h .
* [multimedia/mmsystem.c]
Added slightly improved debugging information for PlaySound.
Wed Jun 24 12:00:00 1998 Juergen Schmied <juergen.schmied@metronet.de>
* [files/profile.c][graphics/x11drv/xfont.c][loader/module.c]
Changed lstrcmpi32A to strcasecmp, lstrncmpi32A to strncasecmp,
lstrcpy32A to strcpy, lstrlen32A to strlen, lstrcmp32A to strcmp
because it's not necessary to support locale on such places.
It causes a huge overhead and even fails sometimes
* [include/oleauto.h][include/winerror.h]
Added some ole-related constants.
* [misc/shell.c]
SHELL32_DllGetClassObject, SHGetSpecialFolderLocation,
SHGetPathFromIDList improved the stubs
* [ole/folders.c]
IShellFolder* functions rewrote the stubs so don't crash and give
something sensible back, started implementation of.
* [ole/typelib.c][relay32/oleaut32.spec]
LoadTypeLib32, RegisterTypeLib stub.
* [ole/ole2nls.c]
Fixed a buffer overrun in CompareString32A.
Test for a bad pointer in LCMapString32A (happens
in winhlp32 while building a index for searching).
* [relay32/oleaut32.spec] [ole/typelib.c]
Added stub for LoadTypeLib (ole32) to make excel95 happy.
Tue Jun 23 22:47:09 1998 Alex Priem <alexp@sci.kun.nl>
* [files/profile.c] [relay32/kernel32.spec]
Added WritePrivateProfileStructA, GetPrivateProfileStructA,
GetPrivateProfileSectionNames16.
Tue Jun 23 01:34:43 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [ole/ole2nls.c]
GetStringTypeEx32A: Implemented CT_CTYPE2 and CT_CTYPE3 cases.
LCMapString32A: Map final '\0' for '\0'-terminated strings.
* [misc/shellord.c] [files/profile.c] [graphics/driver.c]
[loader/module.c] [msdos/int21.c] [windows/driver.c] [files/drive.c]
Changed lstrcmpi32A -> strcasecmp. Should be OK in these places.
Sat Jun 20 23:40:00 1998 Bertho Stultiens <bertho@akhphd.au.dk>
* [tools/wrc/]
Wrc version 1.0.2 (20-Jun-1998). Please revert to
the file tools/wrc/CHANGES for details.
Sat Jun 20 14:58:00 1998 Marcel Baur <mbaur@g26.ethz.ch>
* [ole/ole2nls.c] [ole/nls/*]
Added the first 57 nls files, most are not yet complete.
Wed Jun 17 11:16:54 1998 David Luyer <luyer@ucs.uwa.edu.au>
* [relay32/relay386.c] [if1632/relay.c]
Move debug_relay_(include|exclude)_list handling into
seperate function RELAY_ShowDebugmsgsRelay(). Include
checking of this for 16 bit calls (originally only
32-bit calls).
* [relay32/snoop.c] [misc/main.c]
Add debug_snoop_(include|exclude)_list as per the relay stuff.
Fix typo and add information on -debugmsg +/-relay=... in
help on -debugmsg. Refer to availability of snoop too.
Tue Jun 10 22:00:18 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/header.c][include/header.h][include/commctrl.h]
Added owner draw support.
* [windows/nonclient.c][windows/sysmetics.c]
Fixed menu bar height for Win95 look.
Split NC_AdjustRect95() into NC_AdjustRectOuter95() and
NC_AdjustRectInner95 to fix a menu bar bug.
Improved Win95 look.
* [controls/progress.c]
Improved drawing code. Borders will be drawn by non-client code.
* [controls/updown.c]
Changed memory allocation and fixed some bugs.
* [controls/toolbar.c]
Fixed TB_BUTTONSTRUCTSIZE bug in MFC programs.
Several improvements.
* [misc/shell.c]
Added stub for BrowseForFoldersA().
* [misc/shellord.c]
Added stub for SHELL32_147().
* [controls/comctl32undoc.c]
Minor changes.
* [documentation/common_controls]
New File: Documentation about development status, undocumented
features and functions of the common controls.
1998-06-28 20:40:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-14 21:31:36 +02:00
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualProtect (KERNEL32.@)
|
|
|
|
* Changes the access protection on a region of committed pages
|
1998-03-15 21:29:56 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE: Success
|
2002-09-17 20:54:42 +02:00
|
|
|
* FALSE: Failure
|
|
|
|
*/
|
|
|
|
BOOL WINAPI VirtualProtect(
|
|
|
|
LPVOID addr, /* [in] Address of region of committed pages */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size, /* [in] Size of region */
|
2002-09-17 20:54:42 +02:00
|
|
|
DWORD new_prot, /* [in] Desired access protection */
|
|
|
|
LPDWORD old_prot /* [out] Address of variable to get old protection */
|
1998-03-29 21:44:57 +02:00
|
|
|
) {
|
2002-09-17 20:54:42 +02:00
|
|
|
return VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualProtectEx (KERNEL32.@)
|
|
|
|
* Changes the access protection on a region of committed pages in the
|
|
|
|
* virtual address space of a specified process
|
1998-03-29 21:44:57 +02:00
|
|
|
*
|
|
|
|
* RETURNS
|
2002-09-17 20:54:42 +02:00
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
BOOL WINAPI VirtualProtectEx(
|
|
|
|
HANDLE process, /* [in] Handle of process */
|
|
|
|
LPVOID addr, /* [in] Address of region of committed pages */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size, /* [in] Size of region */
|
2002-09-17 20:54:42 +02:00
|
|
|
DWORD new_prot, /* [in] Desired access protection */
|
|
|
|
LPDWORD old_prot /* [out] Address of variable to get old protection */ )
|
2000-05-01 23:23:02 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status = NtProtectVirtualMemory( process, &addr, &size, new_prot, old_prot );
|
|
|
|
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return !status;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualQuery (KERNEL32.@)
|
|
|
|
* Provides info about a range of pages in virtual address space
|
1998-03-15 21:29:56 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
2002-09-17 20:54:42 +02:00
|
|
|
* Number of bytes returned in information buffer
|
|
|
|
* or 0 if addr is >= 0xc0000000 (kernel space).
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T WINAPI VirtualQuery(
|
2002-09-17 20:54:42 +02:00
|
|
|
LPCVOID addr, /* [in] Address of region */
|
2002-11-04 23:43:24 +01:00
|
|
|
PMEMORY_BASIC_INFORMATION info, /* [out] Address of info buffer */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T len /* [in] Size of buffer */
|
2002-09-17 20:54:42 +02:00
|
|
|
) {
|
|
|
|
return VirtualQueryEx( GetCurrentProcess(), addr, info, len );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* VirtualQueryEx (KERNEL32.@)
|
|
|
|
* Provides info about a range of pages in virtual address space of a
|
|
|
|
* specified process
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Number of bytes returned in information buffer
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T WINAPI VirtualQueryEx(
|
2002-09-17 20:54:42 +02:00
|
|
|
HANDLE process, /* [in] Handle of process */
|
|
|
|
LPCVOID addr, /* [in] Address of region */
|
2002-11-04 23:43:24 +01:00
|
|
|
PMEMORY_BASIC_INFORMATION info, /* [out] Address of info buffer */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T len /* [in] Size of buffer */ )
|
1998-03-29 21:44:57 +02:00
|
|
|
{
|
2005-07-15 12:01:30 +02:00
|
|
|
SIZE_T ret;
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
if ((status = NtQueryVirtualMemory( process, addr, MemoryBasicInformation, info, len, &ret )))
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
ret = 0;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
return ret;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-13 22:13:18 +02:00
|
|
|
* CreateFileMappingA (KERNEL32.@)
|
1998-03-15 21:29:56 +01:00
|
|
|
* Creates a named or unnamed file-mapping object for the specified file
|
|
|
|
*
|
|
|
|
* RETURNS
|
1998-03-29 21:44:57 +02:00
|
|
|
* Handle: Success
|
|
|
|
* 0: Mapping object does not exist
|
1998-03-15 21:29:56 +01:00
|
|
|
* NULL: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE WINAPI CreateFileMappingA(
|
2000-10-14 01:06:13 +02:00
|
|
|
HANDLE hFile, /* [in] Handle of file to map */
|
1998-04-13 14:21:30 +02:00
|
|
|
SECURITY_ATTRIBUTES *sa, /* [in] Optional security attributes*/
|
1998-03-29 21:44:57 +02:00
|
|
|
DWORD protect, /* [in] Protection for mapping object */
|
|
|
|
DWORD size_high, /* [in] High-order 32 bits of object size */
|
|
|
|
DWORD size_low, /* [in] Low-order 32 bits of object size */
|
1998-04-13 14:21:30 +02:00
|
|
|
LPCSTR name /* [in] Name of file-mapping object */ )
|
|
|
|
{
|
2001-11-30 19:46:42 +01:00
|
|
|
WCHAR buffer[MAX_PATH];
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
|
2001-11-30 19:46:42 +01:00
|
|
|
if (!name) return CreateFileMappingW( hFile, sa, protect, size_high, size_low, NULL );
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
|
2001-11-30 19:46:42 +01:00
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
|
|
|
return 0;
|
|
|
|
}
|
2001-11-30 19:46:42 +01:00
|
|
|
return CreateFileMappingW( hFile, sa, protect, size_high, size_low, buffer );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-13 22:13:18 +02:00
|
|
|
* CreateFileMappingW (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
* See CreateFileMappingA.
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
HANDLE WINAPI CreateFileMappingW( HANDLE hFile, LPSECURITY_ATTRIBUTES sa,
|
|
|
|
DWORD protect, DWORD size_high,
|
1999-11-25 22:30:24 +01:00
|
|
|
DWORD size_low, LPCWSTR name )
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
static const int sec_flags = SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_COMMIT | SEC_NOCACHE;
|
|
|
|
|
2000-08-30 02:00:48 +02:00
|
|
|
HANDLE ret;
|
2002-09-17 20:54:42 +02:00
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING nameW;
|
|
|
|
NTSTATUS status;
|
|
|
|
DWORD access, sec_type;
|
|
|
|
LARGE_INTEGER size;
|
|
|
|
|
|
|
|
attr.Length = sizeof(attr);
|
|
|
|
attr.RootDirectory = 0;
|
|
|
|
attr.ObjectName = NULL;
|
2005-09-21 13:42:30 +02:00
|
|
|
attr.Attributes = OBJ_CASE_INSENSITIVE |
|
2005-09-30 12:33:43 +02:00
|
|
|
((sa && sa->bInheritHandle) ? OBJ_INHERIT : 0);
|
2002-09-17 20:54:42 +02:00
|
|
|
attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
|
|
|
|
attr.SecurityQualityOfService = NULL;
|
1999-11-25 22:30:24 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
if (name)
|
|
|
|
{
|
|
|
|
RtlInitUnicodeString( &nameW, name );
|
|
|
|
attr.ObjectName = &nameW;
|
|
|
|
}
|
1999-11-25 22:30:24 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
sec_type = protect & sec_flags;
|
|
|
|
protect &= ~sec_flags;
|
|
|
|
if (!sec_type) sec_type = SEC_COMMIT;
|
1999-11-25 22:30:24 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
switch(protect)
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
case 0:
|
2004-05-21 22:58:44 +02:00
|
|
|
protect = PAGE_READONLY; /* Win9x compatibility */
|
|
|
|
/* fall through */
|
2002-09-17 20:54:42 +02:00
|
|
|
case PAGE_READONLY:
|
|
|
|
case PAGE_WRITECOPY:
|
|
|
|
access = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ;
|
|
|
|
break;
|
|
|
|
case PAGE_READWRITE:
|
|
|
|
access = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
2000-08-30 02:00:48 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
if (hFile == INVALID_HANDLE_VALUE)
|
1999-11-25 22:30:24 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
hFile = 0;
|
|
|
|
if (!size_low && !size_high)
|
1999-11-25 22:30:24 +01:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-23 02:51:33 +01:00
|
|
|
size.u.LowPart = size_low;
|
|
|
|
size.u.HighPart = size_high;
|
1999-11-25 22:30:24 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
status = NtCreateSection( &ret, access, &attr, &size, protect, sec_type, hFile );
|
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
2000-08-30 02:00:48 +02:00
|
|
|
return ret;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-13 22:13:18 +02:00
|
|
|
* OpenFileMappingA (KERNEL32.@)
|
1998-03-29 21:44:57 +02:00
|
|
|
* Opens a named file-mapping object.
|
1998-03-15 21:29:56 +01:00
|
|
|
*
|
|
|
|
* RETURNS
|
1998-03-29 21:44:57 +02:00
|
|
|
* Handle: Success
|
1998-03-15 21:29:56 +01:00
|
|
|
* NULL: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE WINAPI OpenFileMappingA(
|
1998-03-29 21:44:57 +02:00
|
|
|
DWORD access, /* [in] Access mode */
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL inherit, /* [in] Inherit flag */
|
1999-01-01 18:01:18 +01:00
|
|
|
LPCSTR name ) /* [in] Name of file-mapping object */
|
|
|
|
{
|
2001-11-30 19:46:42 +01:00
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
|
|
|
|
if (!name) return OpenFileMappingW( access, inherit, NULL );
|
|
|
|
|
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
|
|
|
return 0;
|
|
|
|
}
|
2001-11-30 19:46:42 +01:00
|
|
|
return OpenFileMappingW( access, inherit, buffer );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-13 22:13:18 +02:00
|
|
|
* OpenFileMappingW (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
* See OpenFileMappingA.
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE WINAPI OpenFileMappingW( DWORD access, BOOL inherit, LPCWSTR name)
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING nameW;
|
2000-08-30 02:00:48 +02:00
|
|
|
HANDLE ret;
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
if (!name)
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
2000-08-30 02:00:48 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
attr.Length = sizeof(attr);
|
|
|
|
attr.RootDirectory = 0;
|
|
|
|
attr.ObjectName = &nameW;
|
2005-09-30 12:33:43 +02:00
|
|
|
attr.Attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0);
|
2002-09-17 20:54:42 +02:00
|
|
|
attr.SecurityDescriptor = NULL;
|
|
|
|
attr.SecurityQualityOfService = NULL;
|
|
|
|
RtlInitUnicodeString( &nameW, name );
|
|
|
|
|
|
|
|
if (access == FILE_MAP_COPY) access = FILE_MAP_READ;
|
|
|
|
|
|
|
|
if ((status = NtOpenSection( &ret, access, &attr )))
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
ret = 0;
|
2000-08-30 02:00:48 +02:00
|
|
|
}
|
|
|
|
return ret;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-13 22:13:18 +02:00
|
|
|
* MapViewOfFile (KERNEL32.@)
|
1998-03-15 21:29:56 +01:00
|
|
|
* Maps a view of a file into the address space
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Starting address of mapped view
|
|
|
|
* NULL: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
1998-03-15 21:29:56 +01:00
|
|
|
LPVOID WINAPI MapViewOfFile(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE mapping, /* [in] File-mapping object to map */
|
1998-03-29 21:44:57 +02:00
|
|
|
DWORD access, /* [in] Access mode */
|
|
|
|
DWORD offset_high, /* [in] High-order 32 bits of file offset */
|
|
|
|
DWORD offset_low, /* [in] Low-order 32 bits of file offset */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T count /* [in] Number of bytes to map */
|
1998-03-15 21:29:56 +01:00
|
|
|
) {
|
1997-03-05 09:22:35 +01:00
|
|
|
return MapViewOfFileEx( mapping, access, offset_high,
|
|
|
|
offset_low, count, NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-13 22:13:18 +02:00
|
|
|
* MapViewOfFileEx (KERNEL32.@)
|
1998-03-15 21:29:56 +01:00
|
|
|
* Maps a view of a file into the address space
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Starting address of mapped view
|
|
|
|
* NULL: Failure
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
1998-03-15 21:29:56 +01:00
|
|
|
LPVOID WINAPI MapViewOfFileEx(
|
1999-02-26 12:11:13 +01:00
|
|
|
HANDLE handle, /* [in] File-mapping object to map */
|
1998-03-29 21:44:57 +02:00
|
|
|
DWORD access, /* [in] Access mode */
|
|
|
|
DWORD offset_high, /* [in] High-order 32 bits of file offset */
|
|
|
|
DWORD offset_low, /* [in] Low-order 32 bits of file offset */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T count, /* [in] Number of bytes to map */
|
1998-03-29 21:44:57 +02:00
|
|
|
LPVOID addr /* [in] Suggested starting address for mapped view */
|
1998-03-15 21:29:56 +01:00
|
|
|
) {
|
2002-09-17 20:54:42 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
LARGE_INTEGER offset;
|
|
|
|
ULONG protect;
|
|
|
|
|
2004-01-23 02:51:33 +01:00
|
|
|
offset.u.LowPart = offset_low;
|
|
|
|
offset.u.HighPart = offset_high;
|
2002-09-17 20:54:42 +02:00
|
|
|
|
|
|
|
if (access & FILE_MAP_WRITE) protect = PAGE_READWRITE;
|
|
|
|
else if (access & FILE_MAP_READ) protect = PAGE_READONLY;
|
|
|
|
else if (access & FILE_MAP_COPY) protect = PAGE_WRITECOPY;
|
|
|
|
else protect = PAGE_NOACCESS;
|
1997-03-05 09:22:35 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
if ((status = NtMapViewOfSection( handle, GetCurrentProcess(), &addr, 0, 0, &offset,
|
|
|
|
&count, ViewShare, 0, protect )))
|
2000-12-22 03:04:15 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
addr = NULL;
|
2000-12-22 03:04:15 +01:00
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
return addr;
|
|
|
|
}
|
2000-08-14 22:20:01 +02:00
|
|
|
|
2000-12-22 03:04:15 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* UnmapViewOfFile (KERNEL32.@)
|
|
|
|
* Unmaps a mapped view of a file.
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* Should addr be an LPCVOID?
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
|
|
|
*/
|
|
|
|
BOOL WINAPI UnmapViewOfFile( LPVOID addr ) /* [in] Address where mapped view begins */
|
|
|
|
{
|
|
|
|
NTSTATUS status = NtUnmapViewOfSection( GetCurrentProcess(), addr );
|
|
|
|
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
|
|
|
return !status;
|
|
|
|
}
|
1999-01-01 18:01:18 +01:00
|
|
|
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* FlushViewOfFile (KERNEL32.@)
|
|
|
|
* Writes to the disk a byte range within a mapped view of a file
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* TRUE: Success
|
|
|
|
* FALSE: Failure
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FlushViewOfFile( LPCVOID base, /* [in] Start address of byte range to flush */
|
2002-09-21 03:21:00 +02:00
|
|
|
SIZE_T size ) /* [in] Number of bytes in range */
|
2002-09-17 20:54:42 +02:00
|
|
|
{
|
|
|
|
NTSTATUS status = NtFlushVirtualMemory( GetCurrentProcess(), &base, &size, 0 );
|
|
|
|
if (status)
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
if (status == STATUS_NOT_MAPPED_DATA) status = STATUS_SUCCESS;
|
|
|
|
else SetLastError( RtlNtStatusToDosError(status) );
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
return !status;
|
|
|
|
}
|
1997-03-05 09:22:35 +01:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsBadReadPtr (KERNEL32.@)
|
|
|
|
*
|
2005-11-08 12:01:03 +01:00
|
|
|
* Check for read access on a memory block.
|
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* RETURNS
|
|
|
|
* FALSE: Process has read access to entire block
|
|
|
|
* TRUE: Otherwise
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsBadReadPtr(
|
|
|
|
LPCVOID ptr, /* [in] Address of memory block */
|
|
|
|
UINT size ) /* [in] Size of block */
|
|
|
|
{
|
|
|
|
if (!size) return FALSE; /* handle 0 size case w/o reference */
|
2005-03-25 17:38:50 +01:00
|
|
|
if (!ptr) return TRUE;
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
if (!page_size) page_size = getpagesize();
|
|
|
|
__TRY
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
volatile const char *p = ptr;
|
|
|
|
char dummy;
|
|
|
|
UINT count = size;
|
|
|
|
|
|
|
|
while (count > page_size)
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
dummy = *p;
|
|
|
|
p += page_size;
|
|
|
|
count -= page_size;
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
dummy = p[0];
|
|
|
|
dummy = p[count - 1];
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
}
|
2005-03-22 22:16:39 +01:00
|
|
|
__EXCEPT(page_fault)
|
|
|
|
{
|
|
|
|
TRACE_(seh)("%p caused page fault during read\n", ptr);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
__ENDTRY
|
|
|
|
return FALSE;
|
|
|
|
}
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
|
2001-10-09 23:50:44 +02:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* IsBadWritePtr (KERNEL32.@)
|
|
|
|
*
|
2005-11-08 12:01:03 +01:00
|
|
|
* Check for write access on a memory block.
|
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* RETURNS
|
|
|
|
* FALSE: Process has write access to entire block
|
|
|
|
* TRUE: Otherwise
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsBadWritePtr(
|
|
|
|
LPVOID ptr, /* [in] Address of memory block */
|
|
|
|
UINT size ) /* [in] Size of block in bytes */
|
|
|
|
{
|
|
|
|
if (!size) return FALSE; /* handle 0 size case w/o reference */
|
2005-03-25 17:38:50 +01:00
|
|
|
if (!ptr) return TRUE;
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
if (!page_size) page_size = getpagesize();
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
volatile char *p = ptr;
|
|
|
|
UINT count = size;
|
2001-10-09 23:50:44 +02:00
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
while (count > page_size)
|
|
|
|
{
|
|
|
|
*p |= 0;
|
|
|
|
p += page_size;
|
|
|
|
count -= page_size;
|
|
|
|
}
|
|
|
|
p[0] |= 0;
|
|
|
|
p[count - 1] |= 0;
|
|
|
|
}
|
2005-03-22 22:16:39 +01:00
|
|
|
__EXCEPT(page_fault)
|
|
|
|
{
|
|
|
|
TRACE_(seh)("%p caused page fault during write\n", ptr);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
__ENDTRY
|
|
|
|
return FALSE;
|
|
|
|
}
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* IsBadHugeReadPtr (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
*
|
|
|
|
* Check for read access on a memory block.
|
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* RETURNS
|
|
|
|
* FALSE: Process has read access to entire block
|
|
|
|
* TRUE: Otherwise
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsBadHugeReadPtr(
|
|
|
|
LPCVOID ptr, /* [in] Address of memory block */
|
|
|
|
UINT size /* [in] Size of block */
|
|
|
|
) {
|
|
|
|
return IsBadReadPtr( ptr, size );
|
|
|
|
}
|
Release 970415
Mon Apr 14 11:22:54 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c]
Minor changes to help debug problems.
* [if1632/dummy.c] [if1632/gdi.spec]
Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.
* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
StartDoc16, EndDoc16 new functions.
Sun Apr 13 11:18:35 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [memory/virtual.c]
Implemented MapViewOfFile.
* [debugger/dbg.y]
Added 'info maps' command.
Fri Apr 11 16:34:08 1997 Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>
* [controls/edit.c] [controls/EDIT.TODO]
Started restructuring. Performance improvements.
Fixed: wordwrap, scrollbar handling, scrolling, painting,
EditWndProc() is now reentrant, wordbreak procs,
better compliance to specs.
New: margins, format rectangle.
* [controls/widgets.c]
Changed the cursor for the edit control class to an I-beam.
* [include/callback.h]
Added 32 bit wordbreak callback.
Mon Apr 7 20:53:28 1997 Albrecht Kleine <kleine@ak.sax.de>
* [objects/metafile.c]
Added handling of some more metafile records:
META_CREATEREGION, META_INVERTREGION etc.
Sat Apr 5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
* [loader/signal.c]
Define kernel sigaction ourselves instead of getting it
from the kernel source.
Wed Apr 2 21:05:00 1997 Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
* [control/menu.c]
Fix return value range for GetMenuState.
* [files/file.c]
Always fill out ofs->szPathName in FILE_DoOpenFile.
* [memory/string.c]
Add debug option string.
* [objects/cursoricon.c]
Fix return value for DestroyIcon32.
Mon Mar 31 17:16:12 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
Added description of the source tree. Moved several
files to fit it.
* [misc/shell.c]
Use Win32 heap functions.
1997-04-15 19:19:52 +02:00
|
|
|
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* IsBadHugeWritePtr (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
*
|
|
|
|
* Check for write access on a memory block.
|
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* RETURNS
|
|
|
|
* FALSE: Process has write access to entire block
|
|
|
|
* TRUE: Otherwise
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsBadHugeWritePtr(
|
|
|
|
LPVOID ptr, /* [in] Address of memory block */
|
|
|
|
UINT size /* [in] Size of block */
|
|
|
|
) {
|
|
|
|
return IsBadWritePtr( ptr, size );
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-11-30 18:45:40 +01:00
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* IsBadCodePtr (KERNEL32.@)
|
1998-03-15 21:29:56 +01:00
|
|
|
*
|
2005-11-08 12:01:03 +01:00
|
|
|
* Check for read access on a memory address.
|
|
|
|
*
|
1998-03-15 21:29:56 +01:00
|
|
|
* RETURNS
|
2002-09-17 20:54:42 +02:00
|
|
|
* FALSE: Process has read access to specified memory
|
|
|
|
* TRUE: Otherwise
|
1997-11-30 18:45:40 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
BOOL WINAPI IsBadCodePtr( FARPROC ptr ) /* [in] Address of function */
|
|
|
|
{
|
|
|
|
return IsBadReadPtr( ptr, 1 );
|
|
|
|
}
|
1997-11-30 18:45:40 +01:00
|
|
|
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* IsBadStringPtrA (KERNEL32.@)
|
|
|
|
*
|
2005-11-08 12:01:03 +01:00
|
|
|
* Check for read access on a range of memory pointed to by a string pointer.
|
|
|
|
*
|
2002-09-17 20:54:42 +02:00
|
|
|
* RETURNS
|
|
|
|
* FALSE: Read access to all bytes in string
|
|
|
|
* TRUE: Else
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsBadStringPtrA(
|
|
|
|
LPCSTR str, /* [in] Address of string */
|
|
|
|
UINT max ) /* [in] Maximum size of string */
|
|
|
|
{
|
2005-03-25 17:38:50 +01:00
|
|
|
if (!str) return TRUE;
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
__TRY
|
1997-11-30 18:45:40 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
volatile const char *p = str;
|
|
|
|
while (p != str + max) if (!*p++) break;
|
1997-11-30 18:45:40 +01:00
|
|
|
}
|
2005-03-22 22:16:39 +01:00
|
|
|
__EXCEPT(page_fault)
|
|
|
|
{
|
|
|
|
TRACE_(seh)("%p caused page fault during read\n", str);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
__ENDTRY
|
1997-11-30 18:45:40 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
1998-03-15 21:29:56 +01:00
|
|
|
|
1998-03-29 21:44:57 +02:00
|
|
|
|
1997-03-05 09:22:35 +01:00
|
|
|
/***********************************************************************
|
2002-09-17 20:54:42 +02:00
|
|
|
* IsBadStringPtrW (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
* See IsBadStringPtrA.
|
1997-03-05 09:22:35 +01:00
|
|
|
*/
|
2002-09-17 20:54:42 +02:00
|
|
|
BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT max )
|
|
|
|
{
|
2005-03-25 17:38:50 +01:00
|
|
|
if (!str) return TRUE;
|
|
|
|
|
2002-09-17 20:54:42 +02:00
|
|
|
__TRY
|
1997-03-05 09:22:35 +01:00
|
|
|
{
|
2002-09-17 20:54:42 +02:00
|
|
|
volatile const WCHAR *p = str;
|
|
|
|
while (p != str + max) if (!*p++) break;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|
2005-03-22 22:16:39 +01:00
|
|
|
__EXCEPT(page_fault)
|
|
|
|
{
|
|
|
|
TRACE_(seh)("%p caused page fault during read\n", str);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-09-17 20:54:42 +02:00
|
|
|
__ENDTRY
|
|
|
|
return FALSE;
|
1997-03-05 09:22:35 +01:00
|
|
|
}
|