Commit Graph

308 Commits

Author SHA1 Message Date
Marcus Meissner 2e7dc35786 ntdll: Check and fix PE header protections. 2010-11-08 18:12:57 +01:00
Alexandre Julliard 3aa6e3bd89 ntdll: Explicitly check for failure to map page 0. 2010-11-04 17:48:01 +01:00
Alexandre Julliard 3fa03e1c78 ntdll: Report memory areas in DOS memory to be free even when not reserved. 2010-11-04 17:47:29 +01:00
André Hentschel 186ada5472 ntdll: Add Support for loading ARM PEs. 2010-11-02 11:16:37 +01:00
Alexandre Julliard e7c67c0cb1 ntdll: More complete implementation of NtAreMappedFilesTheSame. 2010-10-19 16:14:40 +02:00
Alexandre Julliard 31d37b3489 ntdll: Get rid of the FILE_VIEW typedef. 2010-10-19 15:34:36 +02:00
Alexandre Julliard 5393f0a947 ntdll: Fix the protection state of writable sections. 2010-08-26 18:06:10 +02:00
Marcus Meissner 2ca5513a62 ntdll: Set correct protection flags on sections in builtin DLLs. 2010-08-24 17:22:32 +02:00
Austin English b3b55ea4fa ntdll: Sparc support for map_image(). 2010-08-24 12:22:18 +02:00
Alexandre Julliard b9a13d6d81 ntdll: Print a warning when failing to set execute permissions on a section. 2010-06-16 20:06:47 +02:00
Alexandre Julliard 903488b354 ntdll: Make the DOS area accessible even when not using it to hide bugs in broken apps. 2010-06-15 18:29:07 +02:00
Michael Stefaniuc aef5374c8b ntdll: Remove superfluous "not NULL" check for the count arg. 2010-05-19 11:17:55 +02:00
Alexandre Julliard 4ce995451e ntdll: Build the virtual_release_address_space function on all platforms. 2010-04-09 16:50:20 +02:00
Alexandre Julliard 83c272a258 ntdll: Return STATUS_IMAGE_NOT_AT_BASE when an image mapping has to be relocated. 2010-03-03 20:05:40 +01:00
Gerald Pfeifer 43d0720335 ntdll: Guard debugging code by #ifdef instead of plain #if. 2009-12-08 12:32:58 +01:00
Alexandre Julliard 1a3777e2dc ntdll: Reject VirtualAlloc blocks in NtUnmapViewOfSection. 2009-11-04 19:53:00 +01:00
Eric Pouech f6ceedf6dd ntdll: In SYSTEM_BASIC_INFORMATION, the active processors field refers to the affinity mask. 2009-09-22 16:47:25 +02:00
Alexandre Julliard fdf191a9e0 ntdll: Define correct address space limits for x86_64. 2009-08-27 19:47:58 +02:00
Alexandre Julliard 2be006e497 ntdll: Fix a couple of system information structures for 64-bit. 2009-08-27 19:47:49 +02:00
Alexandre Julliard c10bdbefd6 ntdll: Don't free low address space for large address aware applications.
Many games set the LARGE_ADDRESS_AWARE flag but don't pass the
appropriate flags to d3dx9 to make it cope with it.
2009-08-05 11:23:02 +02:00
Alexandre Julliard df6c65623a ntdll: Add support for the MEM_RESET flag in VirtualAlloc, with tests. 2009-07-09 19:31:36 +02:00
Alexandre Julliard 58afa8aceb ntdll: Display write watch status in virtual traces. 2009-07-09 15:21:59 +02:00
Alexandre Julliard 1ac7576d47 ntdll: Disable releasing the address space on Mac OS since dyld doesn't support this. 2009-06-29 13:21:37 +02:00
Alexandre Julliard 09712593c8 ntdll: Release some address space after the process initialization is done. 2009-06-25 14:33:34 +02:00
Alexandre Julliard 54ac26b7af ntdll: Try any address in map_image no matter what the failure was for a fixed address. 2009-05-27 21:17:09 +02:00
Alexandre Julliard d5d0738fb9 ntdll: Tweak the file mapping permission checks some more, with tests. 2009-05-19 21:36:05 +02:00
Francois Gouget cb9a95f560 ntdll: virtual_free_system_view() is not used anymore so remove it. 2009-05-13 12:45:37 +02:00
Alexandre Julliard 61dcca5dbf ntdll: Don't pretend that the whole address space is reserved on non-i386. 2009-04-06 12:07:33 +02:00
Michael Stefaniuc d2f6f56873 ntdll: Remove superfluous pointer casts. 2009-03-23 12:40:53 +01:00
Alexandre Julliard 1056771b91 ntdll: Allocate the stack for all threads, don't rely on pthread to do it for us. 2009-02-23 14:24:59 +01:00
Alexandre Julliard d916d98d02 ntdll: Don't fail in NtMapViewOfSection for 4Gb+ files if an explicit size is specified. 2009-02-16 11:47:32 +01:00
Alexandre Julliard 5e7f7db923 ntdll: Ignore spurious write faults for a write watch that has been reset already. 2009-01-27 11:22:06 +01:00
Alexandre Julliard 858a7efdd4 ntdll: Check buffer for access in NtRead/WriteVirtualMemory.
This also triggers page faults needed for DIB section access and write
watches.
2009-01-15 12:06:16 +01:00
Alexandre Julliard 63bff0937f ntdll: Check buffer for access in NtReadFile before performing I/O.
This also triggers page faults needed for write watches.
2009-01-15 12:05:26 +01:00
Alexandre Julliard 39d4f9e272 ntdll: Check buffer for access in NtWriteFile before performing I/O.
This also triggers page faults needed for DIB section access.
2009-01-15 12:04:24 +01:00
Alexandre Julliard 6b07ac5453 ntdll: Fix pointer cast warnings on 64-bit. 2009-01-08 17:28:45 +01:00
Alexandre Julliard c86ec6445c server: Make a couple of fields smaller in the apc_call_t/apc_result_t structures. 2008-12-30 15:22:45 +01:00
Alexandre Julliard 838803ce24 server: Make the address parameters in inter-process virtual memory calls client_ptr_t.
Add explicit padding fields in the corresponding structures.
2008-12-30 15:05:38 +01:00
Alexandre Julliard d066a9a01a server: Make the mapping base address a client_ptr_t instead of a void pointer. 2008-12-30 14:18:21 +01:00
Alexandre Julliard 8e9c156e14 server: Make the address argument for read/write_process_memory a client_ptr_t. 2008-12-30 14:11:58 +01:00
Maarten Lankhorst 72423f5f6d ntdll: Make the loader process relocations correctly for x86_64. 2008-12-26 13:42:07 +01:00
Alexandre Julliard 29d9759156 server: Use mem_size_t instead of file_pos_t for memory mapping sizes. 2008-12-17 19:25:49 +01:00
Alexandre Julliard 401f4b717a server: Make mem_size_t always 64-bit. 2008-12-17 19:25:09 +01:00
Alexandre Julliard a2089abd94 ntdll: Enforce correct protection values in virtual memory functions. 2008-12-11 14:05:42 +01:00
Alexandre Julliard d1b3d484f7 server: Add functions for conversions between server object handles and pointer-style handles. 2008-12-08 16:05:17 +01:00
Maarten Lankhorst 269600bbed ntdll: Make 64-bits wine only able to load amd64 binaries. 2008-11-25 12:33:28 +01:00
Alexandre Julliard af8bb2e922 ntdll: Add support for virtual write watches. 2008-11-25 12:07:35 +01:00
Alexandre Julliard 81b9ca5dbd ntdll: Pass the error code to VIRTUAL_HandleFault, and allow it to ignore the exception.
Also rename it to virtual_handle_fault for consistency.
2008-11-25 12:02:16 +01:00
Alexandre Julliard aece8e0700 ntdll: Check for valid memory view size directly in VIRTUAL_FindView. 2008-11-25 11:58:50 +01:00
Alexandre Julliard f3e70ee00e ntdll: Get rid of the Wine-specific MEM_SYSTEM flag. 2008-11-18 20:14:46 +01:00
Alexandre Julliard f4eaa15aec kernel32: Moved allocation of the DOS memory area to ntdll. 2008-11-18 20:11:49 +01:00
Alexandre Julliard 28c411b627 ntdll: Get rid of the unaligned_mmap wrapper. 2008-11-17 20:34:19 +01:00
Alexandre Julliard a0c4bfef9d ntdll: Add private function to manage system virtual views instead of abusing NtAllocateVirtualMemory. 2008-11-14 17:40:54 +01:00
Alexandre Julliard 6c7ff61639 ntdll: Added stubs for NtGetWriteWatch and NtResetWriteWatch. 2008-11-14 11:02:15 +01:00
Alexandre Julliard 66a39678e9 ntdll: Store correct values in the various limits on all platforms instead of using 0. 2008-11-07 11:04:07 +01:00
Alexandre Julliard 1ca7b881d7 ntdll: Do not report non-reserved memory areas as free since we don't know what's in them. 2008-11-06 15:00:58 +01:00
Alexandre Julliard eb96fbf346 ntdll: Keep track of the current working set limit independently of system views that may be allocated beyond it. 2008-11-06 11:42:58 +01:00
Alexandre Julliard 5e2ed6bfe9 ntdll,server: Fixed access checks for OpenFileMapping and MapViewOfFile. 2008-11-05 20:32:32 +01:00
Alexandre Julliard f21096ad01 ntdll: Don't force anonymous file mappings to always be fully committed. 2008-11-05 12:31:49 +01:00
Alexandre Julliard cdce50f5be ntdll: Store the per-page committed status in the server for anonymous file mappings. 2008-11-05 12:31:37 +01:00
Alexandre Julliard 7e94787948 ntdll: Add a noexec flag for memory views where we don't want to force exec permission. 2008-11-04 13:16:01 +01:00
Alexandre Julliard 0b0b6c351a ntdll: Store the per-view flags in the high word of the page protection bits. 2008-11-04 13:05:37 +01:00
Alexandre Julliard 3d6313c9ce ntdll: Return more correct information for SystemBasicInformation and GetSystemInfo. 2008-11-03 13:34:13 +01:00
Alexandre Julliard 222e406deb ntdll: Create a separate heap for allocating memory views instead of using malloc. 2008-10-31 13:00:59 +01:00
Alexandre Julliard 56788cc5b6 ntdll: Use the end of the reserved area as address space limit, in case we have more than 3Gb available. 2008-10-28 13:51:36 +01:00
Alexandre Julliard eaae717ede ntdll: Make sure the last relocation contains some data. 2008-10-27 13:19:30 +01:00
John Reiser adda485933 ntdll: Tell valgrind to load the .pdb debugging info for the module that was just loaded. 2008-07-25 12:16:11 +02:00
Alexandre Julliard 8e5f281276 ntdll: Add some sanity checks for invalid relocation blocks. 2008-06-30 12:51:35 +02:00
Alexandre Julliard 58d076b419 ntdll: Force execute permission again on the stack after clearing it. 2008-06-26 21:10:57 +02:00
James Hawkins 36e73d296b ntdll: Remove NULL checks for attr, which has already been dereferenced. 2008-05-20 15:43:54 +02:00
Alexandre Julliard ce21f2924f ntdll: Use LdrProcessRelocationBlock to apply relocations.
Don't apply relocations to non page-aligned binaries.
2008-04-02 20:39:22 +02:00
Alexandre Julliard cc33f6c8a5 ntdll: Add a guard page at the bottom of the stack and raise a stack overflow exception when hit. 2008-04-01 17:40:37 +02:00
Alexandre Julliard 061bfac076 ntdll: Add support for handling page faults caused by guard pages on the thread stack. 2008-04-01 17:37:24 +02:00
Alexandre Julliard 600694546f ntdll: Moved stack allocation for thread and process to a common routine in virtual.c. 2008-04-01 14:11:44 +02:00
Dmitry Timoshkov bf89330fb6 ntdll: Do not perform base relocation if an image is not a DLL. 2008-01-17 14:25:15 +01:00
Alexandre Julliard a39ac0a701 ntdll: Print an error for unsupported shared writable mappings. 2008-01-03 13:20:03 +01:00
Dmitry Timoshkov f2f3de20ac ntdll: Initialize the APC call union to suppress valgrind warnings. Take 2. 2007-12-11 17:49:57 +01:00
Rob Shearman f98556c119 server: Add the name length to the object_attributes structure so that other variable length data can be present after object_attributes. 2007-10-30 14:18:05 +01:00
Rob Shearman 23df453d38 server: Make create_mapping use struct object_attributes and set the security descriptor of file mapping objects. 2007-10-26 12:45:29 +02:00
Alexandre Julliard 235532ce28 server: Use the file_pos_t type for file sizes and offsets in the protocol structures. 2007-10-10 14:06:25 +02:00
Peter Oberndorfer 073dd7dde2 ntdll: NtAreMappedFilesTheSame semi stub. 2007-09-27 12:47:15 +02:00
Andrew Talbot e3708a60b4 ntdll: Constify some variables. 2007-06-28 11:00:53 +02:00
Dmitry Timoshkov e142779b09 ntdll: Fix compilation warnings in 64-bit mode. 2007-05-23 13:10:20 +02:00
Andrew Talbot 9fe3b60f12 ntdll: Exclude unused headers. 2007-05-15 12:19:31 +02:00
Alexandre Julliard 9d09e699d6 ntdll: Get rid of the no longer used is_current_process function. 2007-01-18 15:18:12 +01:00
Alexandre Julliard 02e2fa7798 ntdll: Implementation of inter-process NtMapViewOfSection and NtUnmapViewOfSection. 2007-01-18 15:17:51 +01:00
Alexandre Julliard c122260b9d ntdll: Implemented NtLockVirtualMemory and NtUnlockVirtualMemory. 2007-01-16 09:50:08 +01:00
Alexandre Julliard 5a1ad74a67 ntdll: Implementation of inter-process NtFlushVirtualMemory. 2007-01-15 22:31:07 +01:00
Alexandre Julliard 1ea968016f ntdll: Implementation of inter-process VirtualProtectEx. 2007-01-15 22:30:04 +01:00
Alexandre Julliard 3d00239586 ntdll: Implementation of inter-process VirtualQueryEx. 2007-01-15 22:28:42 +01:00
Alexandre Julliard 7a00142bc1 ntdll: Implementation of inter-process VirtualAllocEx and VirtualFreeEx. 2007-01-15 22:27:40 +01:00
Alexandre Julliard 146fb0de02 ntdll: Make the virtual.c critical section uninterruptible by signals.
Based on a patch by Thomas Kho.
2007-01-12 20:15:52 +01:00
Alexandre Julliard 3c55f78f52 ntdll: Fix handling of 64-bit sizes in NtMapViewOfSection. 2007-01-12 15:01:44 +01:00
Alexandre Julliard 4cbe867a85 ntdll: Duplicate the mapping handle on the server side for NtMapViewOfSection. 2007-01-12 14:55:31 +01:00
Alexandre Julliard 5bd513640b ntdll: Moved the check for removable file in load_dll to the server. 2007-01-12 14:42:43 +01:00
Alexandre Julliard 9fed1205ca ntdll: File positions should be aligned to sector boundaries in PE loader. 2006-12-21 12:34:44 +01:00
Alexandre Julliard e5477b35f4 ntdll: Fixed typo in map_image. 2006-12-20 12:31:20 +01:00
Alexandre Julliard 3dc21d387b ntdll: Map the PE header up to the specified size, and clear the rest of the page. 2006-12-13 16:04:49 +01:00
Alexandre Julliard 94ac989534 ntdll: Fix the failing loader tests. 2006-12-07 15:34:36 +01:00
Alexandre Julliard 822be6c90f ntdll: Force exec permissions on all mmaps unless the app is marked NX-compatible. 2006-12-05 15:42:29 +01:00
Alexandre Julliard 8385f137b5 ntdll: Don't free the DOS area when a broken app passes a NULL pointer to NtFreeVirtualMemory. 2006-12-01 11:38:52 +01:00
Alexandre Julliard 83ce958793 ntdll: Store the fd type in the cache and return it in server_get_unix_fd. 2006-11-20 14:15:06 +01:00
Francois Gouget 30e44c85c8 Assorted spelling fixes. 2006-11-07 15:25:24 +01:00
Alexandre Julliard 9ddb9294da ntdll: Added a server_get_unix_fd function that avoids doing a dup() of the fd when not required. 2006-11-03 11:38:44 +01:00
Hans Leidekker f7b0ba7aa7 ntdll: Win64 printf format warning fixes. 2006-10-18 12:35:26 +02:00
Robert Shearman c88bbd8092 ntdll: NtAllocateVirtual with type of MEM_WRITE_WATCH fails with STATUS_NOT_SUPPORTED on Win2000 instead of STATUS_INVALID_PARAMETER. 2006-09-28 11:55:45 +02:00
Alexandre Julliard f114ba119c ntdll: Use the right section size when setting protections.
Use the same size computation when setting section protections than
when mapping it in the first place (reported by Nicholas Miell).
2006-07-30 09:59:46 +02:00
Alexandre Julliard 6c9ade0529 ntdll: Allocate the PEB with NtAllocateVirtualMemory too. 2006-07-24 15:19:32 +02:00
Alexandre Julliard cc297050f9 ntdll: Support memory allocations inside reserved areas. 2006-07-24 14:00:19 +02:00
Alexandre Julliard c060cdbc14 ntdll: Propagate the MEM_TOP_DOWN flag into the map_view() function. 2006-07-24 13:59:44 +02:00
Alexandre Julliard 0c453bc7c6 ntdll: Use NtAllocateVirtualMemory to allocate all TEBs except the first one. 2006-07-21 20:20:30 +02:00
Alexandre Julliard 2cb0f43224 kernel: Added support for exec'ing a new Win32 process.
Use it to restart execution if the main binary can't be loaded because
of address space conflicts, and also for Win16/DOS support.
2006-07-19 14:12:58 +02:00
Alexandre Julliard c79cf02fae ntdll: Make sure to not unmap anything from reserved areas
when using NtFreeVirtualMemory with the MEM_SYSTEM flag.
2006-07-13 20:47:07 +02:00
Alexandre Julliard bb63a325d7 ntdll: Use the map_view() function to allocate TEBs, now that it supports an arbitrary granularity. 2006-07-13 20:38:31 +02:00
Alexandre Julliard 8f47bd0306 ntdll: Support for arbitrary memory allocation granularity. 2006-07-13 20:36:41 +02:00
Dmitry Timoshkov 0042ad4fc7 ntdll: Compile VIRTUAL_Dump only when somebody really needs it. 2006-06-20 20:39:17 +02:00
Francois Gouget f248440dd4 ntdll: Use page_size instead of page_mask+1. 2006-06-16 11:31:51 +02:00
Robert Shearman 850ae994c6 ntdll: Change the test for no relocation information to use the
IMAGE_FILE_RELOCS_STRIPPED flag instead of a zero sized relocations
section.

This fixes loading of resource-only DLLs that have a load-address of 
0x400000.
2006-06-14 13:37:25 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Marcus Meissner 08c2555dd8 ntdll: Make the section with AddressOfEntryPoint in it executable. 2006-05-09 12:47:25 +02:00
Detlef Riekenberg 44aab2e23f ntdll: Added ARM architecture. 2006-04-08 15:49:24 +02:00
Alexandre Julliard 959bbf8b75 server: Get rid of alignment requirements in write_process_memory request.
All the alignment handling is now done in the write_process_memory
function inside the server.
2006-04-07 18:41:58 +02:00
Alexandre Julliard 18d7980fd8 ntdll: Limit header_size to the file size. 2006-03-27 21:29:46 +02:00
Alexandre Julliard 7bd0cdafc2 ntdll: Use PROT_NONE instead of 0. 2006-02-24 11:31:24 +01:00
Francois Gouget f8ed165609 ntdll: Protect sys/stat.h inclusion. 2006-02-07 21:17:45 +01:00
Alexandre Julliard eca9e4449c ntdll: Round PE header size to a page boundary for size checks. 2006-01-13 13:52:07 +01:00
Alexandre Julliard 9eae2d714d ntdll: Round up the mapping size in map_file_into_view when setting
the protection bytes.
2006-01-11 20:59:07 +01:00
Alexandre Julliard 67f29999a3 ntdll: Check file size when mapping image sections to avoid SIGBUS errors. 2006-01-03 17:39:23 +01:00
Alexandre Julliard efffa66330 ntdll: Don't use a real guard page at the bottom of the stack.
A no-access page is enough, we can't properly raise an overflow
exception anyway.
2005-12-17 18:47:03 +01:00
Alexandre Julliard 354e7700b3 ntdll: Fixes in virtual memory protection flags.
Tweak reporting of virtual protection flags and address space limit to
yield results closer to what Windows does.
2005-12-14 12:17:59 +01:00
Alexandre Julliard f3dad37ba2 TEB.StackLimit should not include the guard page. 2005-12-12 17:28:32 +01:00
Alexandre Julliard 59797f292e Pass specific access rights to wine_server_handle_to_fd. 2005-12-12 17:15:26 +01:00
Vitaliy Margolen 348a3d912b Move mapping (section) objects into directory name space. 2005-12-02 16:13:13 +01:00
Alexandre Julliard cb56bdf884 Check for need to add area to the reserved list also on unmap. 2005-12-01 18:44:04 +01:00
Alexandre Julliard e3ef6314fd Ignore the large address space flag when version is win9x. 2005-12-01 18:42:39 +01:00
Ge van Geldorp 1a1583a364 Match PSDK STATUS_* definitions. 2005-11-28 17:32:54 +01:00
Vitaliy Margolen a996000ad5 - Send whole OBJECT_ATTRIBUTES.Attributes to the server not just an
inherit flag.
- Pass DesiredAccess to the server when creating mailslot.
2005-10-27 18:30:37 +00:00
Francois Gouget baab789ce8 Replace the 'if (!cond) ; else code' construct with the standard 'do {
code } while (0)' construct combined with a regular 'if'.
2005-09-26 09:57:38 +00:00
Alexandre Julliard 9f859692f9 Replace DPRINTF by TRACE in a few places. 2005-09-25 15:23:21 +00:00
Alexandre Julliard 489c6b3865 Ignore relocations for unmapped pages. 2005-09-21 09:47:12 +00:00
Alexandre Julliard 06ea6e6e3f Fixed a few pointer truncation bugs for 64-bit platforms. 2005-09-16 18:54:19 +00:00
Alexandre Julliard fb9cead92b Support arbitrary sizes for the thread signal stack, and set the
default size from the MINSIGSTKSZ constant.
2005-09-14 10:36:58 +00:00
Alexandre Julliard 261e376495 Fixed a number of pointer to integer conversions that wouldn't work
right on a 64-bit platform.
2005-09-12 15:14:06 +00:00
Alexandre Julliard 22a5332661 Added descriptions for a few more machine types. 2005-09-09 10:42:42 +00:00
Alexandre Julliard 20a1a203c6 Use a more portable scheme for storing the name of a critical
section.
2005-09-09 10:19:44 +00:00
Alexandre Julliard 0f41df1681 Use FILE_GetDeviceInfo in NtMapViewOfSection to avoid having to fetch
the file descriptor twice.
2005-08-25 10:23:23 +00:00
Alexandre Julliard 4ebd2fc0ff Better handling of conflicting section information between
SizeOfRawData and VirtualSize.
2005-08-15 14:50:06 +00:00
Alexandre Julliard 8c375c7fd4 Don't map data beyond the virtual size of a section. 2005-08-12 11:21:45 +00:00
Alexandre Julliard 9f32a5c865 Added a VIRTUAL_alloc_teb function to allocate TEBs while making sure
they don't end up above the address space limit.
2005-08-09 10:43:47 +00:00
Dmitry Timoshkov 40dd77bf5a Make VIRTUAL_HandleFault return an NTSTATUS. 2005-07-15 11:43:09 +00:00