Commit graph

43719 commits

Author SHA1 Message Date
Eric Kohl 44e8c0e71a [RTL]
Change RtlLockBootStatusData prototype according to http://cookp.com/%2F/thread/1111206/how%20can%20i%20detect%20last%20boot%20success

svn path=/trunk/; revision=49026
2010-10-06 20:43:51 +00:00
Aleksey Bragin 3e76d8224e [NTDLL]
- LoadImageFileExecutionOptions() improvements:
 * Apply certain heap flags if the process is being debugged (only if NtGlobalFlags is not overridden).
 * Implement enabling page heap and reading image-specific configuration values.
- Add page heap configuration values to the Heap Manager.

svn path=/trunk/; revision=49025
2010-10-06 20:34:30 +00:00
Aleksey Bragin 257ce7ee90 - Respectively fix incorrect data type for GlobalFlags in ReactOS registry.
svn path=/trunk/; revision=49022
2010-10-06 17:25:15 +00:00
Aleksey Bragin 83b1daf183 [NTDLL]
- Fix loading of GlobalFlags in Image File Execution Options. I really wonder who had that brilliant idea that bitwise flags would be stored as a string in the registry.
- If there is a GlobalFlags value specified in the registr for that specific image, it means that value should overwrite NtGlobalFlags. Fix that too (previously it was ORing which made no sense).

svn path=/trunk/; revision=49021
2010-10-06 17:18:22 +00:00
Kamil Hornicek 2ff3b055ce [CMD]
Use the full name we get from SearchForExecutable when building the command line for CreateProcess so we get proper name in argv[0] later.

svn path=/trunk/; revision=49020
2010-10-06 16:44:09 +00:00
Sir Richard c617645ef3 [NTOS]: Fix bugs in the VAD algorithms, we should be rounding up, not down.
svn path=/trunk/; revision=49019
2010-10-06 16:25:30 +00:00
Timo Kreuzer 82280e1435 [NTOSKRNL]
Alternative workaround for pentium lock errata: Instead of burdening the page fault handler, just mark the IDT page as Write-Through if the bug is present. According to http://www.rcollins.org/Errata/Dec97/F00FBug.html it shall prevent the lock up. Please test. Dedicated to elhoir.

svn path=/trunk/; revision=49018
2010-10-06 14:39:56 +00:00
Ged Murphy 90bd7eaa64 - Implement monitor bitmap support for the display dialog
- Fix incorrect codepage values
- Look for applets in windows dir as well as system dir
- Patch by Carlo Bramix
See issue #3158 for more details.

svn path=/trunk/; revision=49017
2010-10-06 14:13:00 +00:00
Sir Richard 1689cea28b [NTOS]: Temporary debugging.
svn path=/trunk/; revision=49016
2010-10-06 13:32:58 +00:00
Giannis Adamopoulos aeb9c9ca8f [win32k]
- co_UserDestroyWindow: Send WM_PARENTNOTIFY message in correct order

svn path=/trunk/; revision=49014
2010-10-06 13:10:00 +00:00
Timo Kreuzer b70ce19480 remove svn:merginfo
svn path=/trunk/; revision=49013
2010-10-06 12:30:23 +00:00
Timo Kreuzer 888d3b5244 [NTOSKRNL]
- Add amd64 versions of MI_MAKE_PROTOTYPE_PTE and MiProtoPteToPte
- Remove outdated external declarations
- disable deprecated amd64 code
- use MiFillSystemPageDirectory only for 2 paging levels
- Fixes amd64 build

svn path=/trunk/; revision=49012
2010-10-06 12:16:51 +00:00
Giannis Adamopoulos 8ee22f5275 [win32k]
- Send WM_PARENTNOTIFY message when a window is destroyed

svn path=/trunk/; revision=49011
2010-10-06 11:14:58 +00:00
Aleksey Bragin b2e1788e8e [RTL/HEAP]
- Implement missing parts of a virtual block allocations support.
- Minor fixes to handling extra stuff in heap blocks.
- Wine's heap regression tests now run through the end without crashing and show 277 failures.

svn path=/trunk/; revision=49010
2010-10-06 09:19:24 +00:00
Sir Richard 3ca783f940 Lame... build fix.
svn path=/trunk/; revision=49008
2010-10-06 04:34:36 +00:00
Aleksey Bragin 850e197b58 [RTL/HEAP]
- First commit of a heap manager rewrite. It introduces a totally new heap manager, with the following features:
* Actually resembles real NT's heap manager;
* Based on data structures similar to Windows 2003 and Vista+'s heap structures;
* Supporting advanced heap flags (e.g. useful for debugging);
* Substantially lower fragmentation rates (and thus speed and reliability) than the existing Wine's implementation. It's going to be further enhanced by adding a frontend allocator (for example, as lookaside lists, or as a Low Fragmentation Heap alike frontend in Vista+ systems);
* Real support for user-defined flags and native support for user-defined values;
* Native support for a custom commit routine, which is very important for trunk's win32 subsystem;
* Reserving, committing, decommitting and freeing on the fly, unlike existing heap manager which prefers to reserve and commit as much as possible, and doesn't decommit when it's no longer necessary;
* Support for per process heaps, with a proper lock;
* Reserved support for a special so-called debug heap allocator (to be implemented in heapdbg.c) which will be useful for finding heap corruptions.

The committed code is a result of a month of work, and is a heavy work-in-progress one. It already implements the bare minimum required to boot to 3rd stage and run FireFox 3, however many rare codepaths are not implemented yet and there is some maintenance work to do (e.g. move structures and defines to a standalone header file). A list of used references is stated in the header of a source file for now.

svn path=/trunk/; revision=49007
2010-10-05 21:43:48 +00:00
James Tabor da848d062f - Fix build from 49005.
svn path=/trunk/; revision=49006
2010-10-05 20:18:04 +00:00
James Tabor 76bac9c7df [Win32k|User32]
- Implement NtUserGetMenuIndex, see Bug 5528.

svn path=/trunk/; revision=49005
2010-10-05 20:13:32 +00:00
Sir Richard 44e3333652 [NTOS]: High-level interface fixes to NtAllocateVirtualMemory/NtFreeVirtualMemory:
- Validate MEM_LARGE_PAGES, MEM_PHYSICAL flags. Check for permission to use MEM_LARGE_PAGES.
        - Validate protection mask.
        - Validate MEM_RELEASE and MEM_DECOMMIT.
        - Perform correct SEH in NtFreeVirtualMemory.
        - Protect against overflows past VAD/User address ranegs.
        - Only reference the process by handle if this isn't already the current process.
        - If this isn't the current process, attach to it during the duration of the VM operation.

svn path=/trunk/; revision=49004
2010-10-05 20:00:32 +00:00
Aleksey Bragin 58ed576929 [RTL]
- Fix heap code to actually use the new lock instead of using RTL_CRITICAL_SECTION.
- Fix a ROUND_UP and ROUND_DOWN macros: it is a *rule* to wrap every argument in braces in a macro, otherwise shit happens. A couple of days were lost fighting a strange bug in the new heap manager code where it was doing ROUND_UP(Heap + 1, PAGE_SIZE)...

svn path=/trunk/; revision=49003
2010-10-05 19:33:42 +00:00
Sir Richard d8f6e7ccc9 [NTOS]: Build fix.
svn path=/trunk/; revision=49002
2010-10-05 17:01:41 +00:00
Giannis Adamopoulos 947bd17104 [win32k]
- Don't place new windows with default position at the top left corner of the screen
See issue #5484 for more details.

svn path=/trunk/; revision=49001
2010-10-05 16:41:38 +00:00
Sir Richard 553f068d37 [NTOS]: Fix whitespace typo in comment (two spaces instead of one).
That's right. I'm not a fun person.

svn path=/trunk/; revision=49000
2010-10-05 15:59:47 +00:00
Sir Richard 7d21cf7abd [NTOS]: Delete a bunch of junk, 5 less files in Mm now (also moved some functions around). Delete unused functions where found.
[NTOS]: The modified page writer should run at a high priority such as 27, not in idle mode at priority 1 -- otherwise dirty pages never get flushed out.
[NTOS]: Reimplement MmGetFileNameForAddress, MmGetFileNameForSection, MmGetFileObjectForSection to also support ARM3 sections. Shouldn't affect anything other than the user-mode debugging support.

svn path=/trunk/; revision=48999
2010-10-05 15:55:52 +00:00
Sir Richard 103fbf8518 [NTOS]: When shutting down, call Cc to flush the dirty cached pages, otherwise these might've gotten lost (and lead to lost/corrupted data on disk).
[NTOS]: Don't assume that CcFlushDirtyPages will run with APCs disabled. Go ahead and actually enter/leave a critical region (Acquire/ReleaseForLazyWrite depend on this). The guarded mutex does disable APCs, but it's released when the actual flush happens.

svn path=/trunk/; revision=48998
2010-10-05 15:52:00 +00:00
Sir Richard 29764be430 [NTOS]: Implement ARM3 version of MmMapViewOfSection, only for ARM3 pagefile-backed sections, and without any special flag support. Tested and works great, with the new pagefault code correctly finding the Prototype PTE for the VAD.
[NTOS]: Make every VAD insert also create a MEMORY_AREA. Now the two address space views should be completely synchronized and we can try removing the hack that was done for PEB/TEB support (which will remove the 200 thread regression).
[NTOS]: Implement MiGetNextNode and MiFindEmptyAddressRangeInTree.

svn path=/trunk/; revision=48997
2010-10-05 14:36:09 +00:00
Aleksey Bragin faa70e3d70 [HEAP]
- Move on to using a real HEAP_LOCK structure for a heap lock.
- Implement kernel-mode counterparts of this lock too. Right now these don't introduce much of a difference, but they are going to be properly used by the new heap manager code.

svn path=/trunk/; revision=48994
2010-10-05 12:42:55 +00:00
Sir Richard 04a028b58e [NTOS]: Add the tiny little bit of code required to correctly handle user-mode faults on ARM3 mapped sections in certain limited scenarios.
svn path=/trunk/; revision=48993
2010-10-05 08:14:02 +00:00
Sir Richard 121276a884 [NTOS]: Delete deprecated handling of MEMORY_AREA_IO_MAPPING. Delete all MEMORY_AREA definitions except the ones for SEGMENT_VIEW and VIRTUAL_MEMORY. All other memory is now owned by ARM3!
[NTOS]: Delete WriteCopyView flag from MEMORY_AREA (unused, and was taking up 4 bytes due to alignment), and add a Vad pointer (takes up 4 bytes -- no actual size change).
[NTOS]: For VM and Section MEMORY_AREAs mapped in user-mode, build a "fake" VAD and insert it into the VAD Root of the Process. This means there is now a consistent view between ARM3 and RosMm in terms of user-mode address space layout, which will come in handy later.
[NTOS]: Destroy the MEMORY_AREA's VAD when the MEMORY_AREA itself is deleted. Watch out for the scenario explained in a previous check-in, where the VAD was caught by the MmCleanProcessAddressSpace vad-cleanup-loop.
[NTOS]: Implement MiInsertVad to restore the old functionality of MiInsertNode when the current parent and insertion result is not yet known. It obtains the information and calls MiInsertNode.

svn path=/trunk/; revision=48992
2010-10-05 05:07:13 +00:00
Sir Richard 4499f604f5 [NTOS]: Add a _64K macro definition so we can stop typing out 65536 all the time.
svn path=/trunk/; revision=48991
2010-10-05 05:01:15 +00:00
Sir Richard 46b0236d75 [NTOS]: Use the Spare flag in the VAD as a ReactOS/MemoryArea specific flag to signify that this VAD is associated with a MEMORY_AREA and should be unlinked at process exit, but not freed. This is because MemoryAreas themselves are cleaned up later, and in the future their associated VADs (not yet in Trunk) will also be parsed. In the process death scenario, those VADs will be freed, but not unlinked (since it would already have been unlinked).
svn path=/trunk/; revision=48990
2010-10-05 05:00:19 +00:00
Sir Richard b5e84d5641 [NTOS]: Nobody uses MEMORY_AREA_SYSTEM anymore, call these MEMORY_AREA_OWNED_BY_ARM3 for now. We'll have to sync this code with x86 later anyway.
svn path=/trunk/; revision=48989
2010-10-05 04:58:26 +00:00
Sir Richard 35beef2751 [NTOS]: Nobody actually writes TRUE for WriteCopyView in the MEMORY_AREA data structure, so this field is useless (always false). Remove all instances of its use.
svn path=/trunk/; revision=48988
2010-10-05 04:57:32 +00:00
Sir Richard fe408085b7 [NTOS]: We don't support SEC_BASED for ARM3 sectios either, ASSERT that.
svn path=/trunk/; revision=48987
2010-10-05 04:56:04 +00:00
Sir Richard d2d2aa1188 [NTOS]: Nobody reads/checks for MEMORY_AREA_CACHE_SEGMENT. Might as well just call this zero (no logical change).
svn path=/trunk/; revision=48986
2010-10-05 04:53:32 +00:00
Giannis Adamopoulos dc6b43fdc5 [win32k]
- Reduce duplicated code in co_UserCreateWindowEx, co_IntSetParent and co_WinPosSetWindowPos
- based on wine

svn path=/trunk/; revision=48982
2010-10-04 21:44:58 +00:00
Sir Richard 7c8612ecb3 [NTOS]: Implement MiMapViewInSystemSpace, all it took was another 250 lines and we can now map ARM3 sections into memory. Accessing them causes a fault, which we correctly handle with the prototype PTE fault code.
[NTOS]: Added a bogus allocation flag that can be used with Nt/MmCreateSection and MmMapViewInSystemSpace to take the ARM3 path instead. Only for internal testing at the moment.
Now we need to look at how to allow mapping these into user-space as well...

svn path=/trunk/; revision=48981
2010-10-04 20:19:03 +00:00
Sir Richard b45cdc574c [NTOS]: Implement MmCreateArm3Section, which creates ARM3-backed sections, but only for pagefile-backed memory at the moment. It uses MiCreatePagingFileMap and creates the expected Segment, Subsection, ControlArea and Section objects described in Windows kernel internals literrature. It's surprisingly easy and only takes 200 lines of code.
svn path=/trunk/; revision=48980
2010-10-04 19:31:16 +00:00
Sir Richard 5518b60eac [NTOS]: Implement/fixup the code paths during page faults that are needed to succesfuly resolve a demand page associated with a pagefile backed ARM3 section (which uses Prototype PTEs). A lot of the code was already there but assumed we were using Prototype PTEs only for the shared user data page. By combining that code with the typical demand-zero fault code, we obtain the needed paths. For now, only tested with ARM3 sections that are page-filed backed (not image or data-file backed) mapped into system view space (MmMapViewOfSectionInSystemSpace), not user-mode addresses (which need VADs). The code to actually create/map these doesn't exist in trunk yet, the purpose of this checkin is to test the new fault changes to make sure they don't cause negative effects to already-working faults.
svn path=/trunk/; revision=48979
2010-10-04 18:51:07 +00:00
Sir Richard 9dc0c0d12a [NTOS]: Initialize system views by calling MiInitializeSystemSpaceMap. This sets up the lock, bitmap, and hash table.
svn path=/trunk/; revision=48978
2010-10-04 18:36:37 +00:00
Sir Richard 566335dd79 [NTOS]: Define MI_MAKE_PROTOTYPE_PTE macro to make a real prototype PTE from a PTE. Define counter-part MiProtoPteToPte to recover the true PTE from a given Prototype PTE.
[NTOS]: Define MI_PTE_LOOKUP_NEEDED instead of using 0xFFFF. The name was found in checked build assertion strings.
[NTOS]: Add MM_VIEW (used for System-mapped Section Views) and MM_SESSSION (used to define the system/session view mappings) structure definitions.

svn path=/trunk/; revision=48977
2010-10-04 18:34:41 +00:00
Sir Richard ee353ad690 [NTOS]: Go ahead and now fill out the OriginalPte field for PFNs initialized with MiInitializePfn(ForOtherProcess). They should only belong to ARM3 so they'll never have SwapEntry/RMAP associated with them. This functionality is important for future Prototype PTE support, among other things, as it lets us get the original PTE value written for a given PFN entry.
svn path=/trunk/; revision=48976
2010-10-04 18:22:50 +00:00
James Tabor 251be92abf [PSDK] - Add more track popup menu types.
svn path=/trunk/; revision=48975
2010-10-04 15:41:25 +00:00
James Tabor aea07215a8 [Win32k]
- Fixed ValidateTimerCallback, always returning true and just spinning in the loop.
- Add one more process information flag with a point type and capturing the hit test in desktop structure.

svn path=/trunk/; revision=48970
2010-10-03 19:18:19 +00:00
Cameron Gutman e14624d8ca [NDIS]
- Disable timer queuing code (hackfix for various network driver failures)
- Also needs to be merged into 0.3.12

svn path=/trunk/; revision=48968
2010-10-03 15:18:57 +00:00
Sir Richard b01fc3d9a7 [NTOS]: Move all the Nt*Section API interfaces into ARM3 and rewrite most of the code to perform the same parameter validation and input checks as Windows does. Support all protection masks. Use correct section object access mask. Use appropriate SEH where needed. Pass 0-initialized local instead of NULL when needed. Don't assume certain parameters are OPTIONAL when they are not. Don't return SEH failures at the end of the system call, the kernel usually returns the result of the system call proper. Call DbgkMapViewOfSection in scenarios where it would not have gotten called before. Protect against certain kinds of kernel-mode access from user-mode.
[NTOS]: Move unimplemented Mm*Section APIs into ARM3 as well.

svn path=/trunk/; revision=48959
2010-10-02 02:14:39 +00:00
Sir Richard 706c5f3899 [PSDK]: Add missing SEC_XXX definitions for Server 2003 (Vista ones still missing).
[KERNEL32]: NtCreateSection should not be called with merely SEC_FILE: this says nothing about what kind of operation should be done (a commit, a reserve, etc?). Use SEC_COMMIT instead to specify correct operation. This works in ReactOS as of now, but would've failed after the NtSection* API rewrite.
[KERNEL32]: CreateFileMappingW should also accept/allow SEC_LARGE_PAGES, even if we don't suppport it yet.

svn path=/trunk/; revision=48958
2010-10-02 01:12:53 +00:00
Matthias Kupfer 93a1ceb834 Yugoslavia no longer exists for some time, replaced by Serbia as successor of country code (phone)
svn path=/trunk/; revision=48955
2010-10-01 19:54:27 +00:00
Johannes Anderwald a53b8966ba [VIDEOPRT]
- Add sanity checks
- Implement VideoPortGetCommonBuffer, VideoPortLockPages


See issue #5629 for more details.

svn path=/trunk/; revision=48954
2010-10-01 17:43:03 +00:00
Jérôme Gardou 2374c7cb8d [XCOPY]
- Fix compilation with msvc
1. Someone should send this to wine (this is NOT lazyness)
2. Someone should tell mingw dev about http://msdn.microsoft.com/en-us/library/aa381050%28v=VS.85%29.aspx

svn path=/trunk/; revision=48948
2010-09-30 21:45:36 +00:00