Commit graph

31706 commits

Author SHA1 Message Date
ReactOS Portable Systems Group a5a0461289 Now that MADDRESS_SPACE became nearly an empty structure pointing only at the root, it can completely go away. Now VadRoot really is a MM_AVL_TABLE structure.
The BalancedRoot.u1.Parent now points to what used to be MemoryAreaRoot. This isn't really the most proper fix out there -- the problem is that React starts with an no root, while Windows
starts with an empty balanced root. So for now we keep doing it the React way, which means we have about 10 ugly typecast hacks. On the other hand, we got rid of more than 100 of them.


svn path=/trunk/; revision=34881
2008-07-28 01:49:23 +00:00
ReactOS Portable Systems Group 7c1492c712 The address space creation lock is a guarded mutex, not a pushlock, in NT 5.2. While it is commendable to attempt using Vista optimizations (it is a push lock on Vista) in order to speed up
the kernel, it is entirely stupid to do so by completing ignoring the ramifications of this change, and furthermore, to pollute the kernel with typecasts, as well as to introduce non-standard
behavior. Ironically it is ion himself who made this change.

svn path=/trunk/; revision=34879
2008-07-28 01:11:19 +00:00
ReactOS Portable Systems Group 34954b16a4 There is no point in saving the address of the address space lock in the address space structure anymore, since this lock is always the address creation lock of the owner process,
and there's always an owner process now.

svn path=/trunk/; revision=34878
2008-07-28 00:56:39 +00:00
ReactOS Portable Systems Group 71f2416876 Looks like this address space nonsense made even less sense than originally understood. The kernel address space was something created very early-on, and associated with a global variable
that actually contained the address space itself (so it wasn't part of any process). Its locks however, were associated to the "current process", which, when this function is called, is the
idle process (which later is cloned into the initial system process). Shortly thereafter, the address space of the "current process" (still, at this point, the idle process) was initialized
with the function reserved for real processes (MmInitializeProcessAddressSpace), which among other things, performed a couple of user-mode mappings (which are irrelevant and should not be
part of the system process address space). This created a weird schism: the kernel address space was actually a global variable associated with no process at all, while the kernel process
had its own address space as well (which was not the kernel address space). It's a miracle this didn't screw anything up especially since whether or not the address space has an owner
determined the lowest address (which means that if the kernel process allocated a memory with its *own* address space, the code would think it was a user-mode process).
This patch gets rid of the kernel address space as a static structure, and instead makes it a pointer into the idle/system process' address space. It also gets rid of MmInitializeKernelAddresSpace
and instead makes use of the existing MmInitializeHandBuiltProcess, cleaning up the user-mode allocations previously made. Even though all address spaces now have an owner and are part of a
process, MmGetAddressSpaceOwner will still return NULL for now, to remain backwards compatible with legacy code.


svn path=/trunk/; revision=34876
2008-07-28 00:43:57 +00:00
ReactOS Portable Systems Group 487609a995 The puzzle of the design decisions behind the React address space structure continues to be troubling (perhaps there was no design?). Every time a process address space is initialized,
the owner process is stored (which we now use to figure out the lowest address). Recall that NULL means kernel, anything else means per-process. This is great, except that after some
painfull header groking, one understands that the PMADDRESS_SPACE structure is actually *not* a separate structure, but embedded within PEPROCESS itself. It is a React-specific structure
(hence the attempts to get rid of it), that seems to have been "overloaded" on top of the VadRoot structure that Windows uses for user-mode memory allocations. To clarify, this structure
is actually embedded inside the process that owns it, except for the kernel address space, which is a global variable. So there's absolutely *no* point in saving a reference to the owner
process, since we'll always be embedded inside it (except for kernel address space).
This patch creates the MmGetAddressSpaceOwner macro which either returns NULL for kernel address space, or uses the CONTAINING_RECORD macro to return the owner (embedded) process. 


svn path=/trunk/; revision=34873
2008-07-27 23:53:04 +00:00
ReactOS Portable Systems Group 908aede2ef - Remove MiGetUserPageDirectoryCount from the ARM Mm since this function is now useless after our cleanups.
svn path=/trunk/; revision=34872
2008-07-27 23:48:19 +00:00
ReactOS Portable Systems Group 62278bab4a More over-engineering: there really isn't any reason to keep track of the "LowestAddress" of the process' addres space. At first sight, this looked like a dynamic value that would define the
lowest address at which the process has allocated memory, but this isn't the case -- the variable actually defines the lowest valid address a process can allocate memory at. This is pretty
much a static value, that was compute by MmInitializeProcessAddressSpace, to either MM_LOWEST_USER_ADDRESS or MmSystemRangeStart, based on whether or not the address space has an owner process
(meaning it is a user-mode address space) or not (meaning it is a kernel mode address space).
This patch removes that value and all the complex code around checking it, and replaces it with a much simpler design: if there is an owner process, use MM_LOWEST_USER_ADDRESS during gap
calculations, otherwise, use MmSystemRangeStart. This is both faster, and wastes less space by not tracking static data.


svn path=/trunk/; revision=34869
2008-07-27 23:03:20 +00:00
Johannes Anderwald bbf489032b - implement changing drive volume name
- display default volume label "local disk" if there is no title
- verify that provided clsid is valid
- display drive property dialog
- note: changing volume label currently leads to a crash

svn path=/trunk/; revision=34867
2008-07-27 22:58:19 +00:00
ReactOS Portable Systems Group 8daee04c2a It seems unclear as to what the point of the Page Reference Count Table in the React Addres Space structure really was. It seems an over-engineered approach that actually causes more problems
then it attempts to solve. The idea is to be able to unmap PDEs when they are not required anymore (a noble idea), which saves you 4KB of non-paged pool whenever a process frees a chunk
of 4MB memory (oversimplification). The problem is that to keep track of this, an extremly expensive series of branches, comparisons, masks and shifts is applied every single time that
a page is mapped or unmapped. It also adds 8KB of non-paged pool to keep track of the references, which in some cases can be more wasteful than keeping the page tables around.
Finally, if the process quickly allocates and de-allocates memory in the same PDE range, we will effectively map and unmap the PDE continously, fragmenting hyperspace and slowing down perf.
This patch removes this functionality from the system and re-uses the code that was already present in Mmi386ReleaseMmInfo (with some optimizations and changes) to do this unmapping when the
process exists. This should make things faster, with a very small amount of increased memory footprint (we're talking about less than 100kb of non paged pool, in worse-case scenarios). 


svn path=/trunk/; revision=34865
2008-07-27 22:39:54 +00:00
ReactOS Portable Systems Group ac0487dfa5 - Fix a couple of bugs, and majorly refactor MmDeleteVirtualMapping to sync it to the x86 version somewhat more.
svn path=/trunk/; revision=34859
2008-07-27 20:58:23 +00:00
Jeffrey Morlan 8054941a9f - Work with screen buffer data using pointers rather than offsets; remove confusing GET_CELL_BUFFER and SET_CELL_BUFFER macros.
- CsrFreeProcessData: Merge two ifs with the same condition.
- Use the pointer-to-pointer trick to simplify linked list handling in CsrFreeProcessData, IntInsertAliasHeader, IntInsertAliasEntry, and IntDeleteAliasEntry.

svn path=/trunk/; revision=34858
2008-07-27 20:08:18 +00:00
ReactOS Portable Systems Group 027390f247 - Major cleanup, refactoring, and bugfixing of ARM Mm code in preparation for user-mode support.
- Sync the code a lot closer to its x86 counterpart, still more work to be done.
- Very soon, it should be possible to share upward of 50% of the new ARM code with the x86 version of React as well and unify the implementations.

svn path=/trunk/; revision=34857
2008-07-27 19:52:41 +00:00
Hervé Poussineau 246c0ca9d0 Revert r34848 and r34850, and replace them by a real fix (hinted by Colin Finck)
svn path=/trunk/; revision=34856
2008-07-27 19:39:05 +00:00
Colin Finck f5c074984b Maciej Bialas (bjauy@tlen.pl)
- Add '#include <cstring>', so newer gcc's don't complain about a missing memset function

See issue #3595 for more details.

svn path=/trunk/; revision=34855
2008-07-27 19:10:44 +00:00
Hervé Poussineau e66ffe54fe Fix code to correctly handle first object file.
It was luckily working because first file was always conditional.

svn path=/trunk/; revision=34854
2008-07-27 17:12:44 +00:00
Hervé Poussineau 241493fe8e Fix typo
svn path=/trunk/; revision=34853
2008-07-27 16:33:57 +00:00
Hervé Poussineau d4d0c4fdf6 Resolve <if> and <ifnot> elements during parsing time.
Backend don't have to deal anymore with if-able modules, defines, ...

svn path=/trunk/; revision=34852
2008-07-27 16:17:50 +00:00
Aleksey Bragin e880f2361a - ntdll should be the last library in the list, not the first or somewhere in the middle ("as it imports from nothing and everything else should be resolved with it", by Herve). This fixes some base system DLLs dependency on msvcrt (which doesn't exist in Windows). Thanks Herve!
svn path=/trunk/; revision=34851
2008-07-27 16:03:38 +00:00
Hervé Poussineau f958aedf05 Define __LINUX__ for build tools if host is Linux
svn path=/trunk/; revision=34850
2008-07-27 15:49:18 +00:00
Hervé Poussineau 4d5f9f73ed Add a variable to include support for ELF format
svn path=/trunk/; revision=34849
2008-07-27 15:48:00 +00:00
Hervé Poussineau 9f882f816a Define __LINUX__ for build tools if host is Linux
svn path=/trunk/; revision=34848
2008-07-27 15:32:40 +00:00
Jeffrey Morlan f3fa3ee47e Improvements to cmd ConPrintfPaging:
- Even if there is a console, don't do paging when output is redirected to a file; it would just confuse users with prompts they can't see.
- Instead of WriteFile, use WriteConsole (which has a convenient Unicode version).
- Rework the paging algorithm: don't treat end of string the same way as end-of-line (was causing nul bytes to be output after strings that didn't end with \n), and output multiple lines at once when possible.
- Use the screen buffer width, not the window width, to determine when wrapping will happen.
- Take the initial cursor position into account.

svn path=/trunk/; revision=34847
2008-07-27 14:03:44 +00:00
Hervé Poussineau 12a1603c6e Factorize code for simple module types
svn path=/trunk/; revision=34846
2008-07-27 14:01:24 +00:00
Colin Finck 6b50b9e320 Daniel Verkamp (daniel.verkamp@gmail.com):
- Fix buildno warnings when compiled with GCC 4.2.x or later
See issue #3578 for more details.

svn path=/trunk/; revision=34844
2008-07-27 13:34:53 +00:00
Hervé Poussineau 72fbdac08a Use hal.spec file for i386 build
svn path=/trunk/; revision=34841
2008-07-27 09:56:21 +00:00
Hervé Poussineau 615f0216fa Add support for fastcall functions in .spec files
svn path=/trunk/; revision=34837
2008-07-27 09:12:37 +00:00
Hervé Poussineau 0bd0421c3b Add a .spec file for HAL exports. Don't use it yet
svn path=/trunk/; revision=34836
2008-07-27 09:07:59 +00:00
Hervé Poussineau 127f001ffc Preprocess kernel .spec files
svn path=/trunk/; revision=34830
2008-07-27 08:26:42 +00:00
Hervé Poussineau f9299e18b2 Prevent code duplication when translating GCC platform defines to MSVC ones.
svn path=/trunk/; revision=34829
2008-07-27 08:18:07 +00:00
Art Yerkes 43bf5f1b02 More specific error messages. More correct according to winetests.
svn path=/trunk/; revision=34828
2008-07-27 08:12:12 +00:00
ReactOS Portable Systems Group 27fab2e256 - Build "smlib", "nt", and "smss" on ARM, since the kernel now tries to load the first user-mode process.
- MmCreateProcessAddressSpace is unimplemented.


svn path=/trunk/; revision=34825
2008-07-27 05:44:56 +00:00
ReactOS Portable Systems Group ea820b22a1 - On ARM, print out a message and freeze execution inside the native process main routine wrapper. This is essentially the first line of code that will execute in user-mode, and we need to know (celebrate) about it.
svn path=/trunk/; revision=34824
2008-07-27 05:40:31 +00:00
ReactOS Portable Systems Group 8fbd2ddb5b - Fix NTDLL exports on ARM.
svn path=/trunk/; revision=34823
2008-07-27 05:39:31 +00:00
ReactOS Portable Systems Group 8dbe67ba2f - Fix double semicolon.
svn path=/trunk/; revision=34822
2008-07-27 05:39:17 +00:00
ReactOS Portable Systems Group 574cb20678 - MmDeleteVirtualMapping can be called for memory that isn't mapped yet -- just ignore this like we do on x86.
- This gets us much farther, to the point where we try to load smss.exe but can't find it.


svn path=/trunk/; revision=34821
2008-07-27 05:38:51 +00:00
ReactOS Portable Systems Group b66ab06e30 - Stop adding those damn @ decorations to ARM builds.
svn path=/trunk/; revision=34820
2008-07-27 05:37:54 +00:00
ReactOS Portable Systems Group 54f208ec84 - Silence debug prints.
svn path=/trunk/; revision=34819
2008-07-27 05:37:38 +00:00
James Tabor 5296beccd9 Turn off WH_CALLWNDPROC and WH_GETMESSAGE debug spam.
svn path=/trunk/; revision=34818
2008-07-27 00:56:18 +00:00
Jeffrey Morlan b1086dbdae Move console alias functions from csrss to win32csr, and make aliases per-console.
svn path=/trunk/; revision=34817
2008-07-27 00:41:45 +00:00
Jeffrey Morlan 198d88a60b - In cmd, add ConOutResPrintf and ConErrResPrintf functions for printf-ing from a resource string; use it to shorten several instances of LoadString+Con*Printf.
- Also change FilePromptYN and FilePromptYNA to take a resource ID. Remove varargs code which nobody used (and didn't actually work anyway)

svn path=/trunk/; revision=34816
2008-07-26 22:49:49 +00:00
Matthias Kupfer 33ab9a11a5 reenable Norwegian language and keyboard layout (tested by Frode Lillerud)
svn path=/trunk/; revision=34815
2008-07-26 22:20:02 +00:00
James Tabor 5bf50a8d93 - Fix crash in callback and disable HCBT_CREATEWND until it is implemented correctly. Hooks seem to be working.
svn path=/trunk/; revision=34814
2008-07-26 22:06:31 +00:00
Jeffrey Morlan 6320253c94 In mkdir, don't add a backslash to the end - it can trick CreateDirectory into creating a dir with the name of a DOS device (even in Windows).
svn path=/trunk/; revision=34810
2008-07-26 17:15:37 +00:00
Jeffrey Morlan cbf6a79f07 - IntWriteConsoleInput: Copy the data *to* the capture buffer, not *from* it!
- Move code for handling ^C (plus that weird pseudo-scrolling thing) from ConioProcessChar to ConioProcessKey, so that WriteConsoleInput won't generate ctrl events.
- ConioProcessChar: Remove redundant NULL == Console checks (Console can't be NULL at this point), and move debug message into the check in ConioProcessKey.

svn path=/trunk/; revision=34808
2008-07-26 15:20:21 +00:00
James Tabor e153b69952 - Attempt to initiate hook set from kernel space.
svn path=/trunk/; revision=34807
2008-07-26 12:27:40 +00:00
Aleksey Bragin 138fbd967b Jon Griffiths
msvcrt: Implement ___setlc_active_func/___unguarded_readlc_active_add_func

svn path=/trunk/; revision=34806
2008-07-26 11:54:54 +00:00
Aleksey Bragin 9db3c82bb7 - Sync with Wine (null-initializing some exported data).
svn path=/trunk/; revision=34805
2008-07-26 11:45:59 +00:00
James Tabor 37cf6bcd75 - Fix boot add missing return.
svn path=/trunk/; revision=34799
2008-07-26 00:25:42 +00:00
James Tabor 996438fdc6 - Replace Global flag.
svn path=/trunk/; revision=34797
2008-07-26 00:03:31 +00:00
James Tabor 9bec76e407 - Fix NtUserCallMsgFilter so it initiates the hook call.
svn path=/trunk/; revision=34794
2008-07-25 23:08:50 +00:00