Commit graph

49706 commits

Author SHA1 Message Date
Olaf Siejka a0f9dfe66d [TRANSLATION]
- Bulgarian translation update of several modules (bug no. 6840), by CCTANEB, minor fixes by me;
- Polish translation update of sysdm by me;



svn path=/trunk/; revision=55424
2012-02-05 12:21:11 +00:00
Timo Kreuzer d7bdbf2152 [NTOSKRNL]
- Fix a bug in CmpSetSystemValues, where an uninitialized handle would be closed in the failure path.
- Add a hack on top of the MI_GET_ROS_DATA(x) hack so that we can squeeze a pointer into a 32 bit field.
Make MmInitializeProcessAddressSpace amd64 ready and use a portable way to determine the page table base pfn in MiInitializeWorkingSetList
- Make MmProbeAndLockPages ready for 3 and 4 level page tables
add MiIsPteOnP*eBoundary macros - use  these in MmProbeAndLockPages
- Raise IRQL to SYNCH_LEVEL not DISPATCH_LEVEL in KiAcquireDispatcherLock
- Add MiNonPagedSystemSize for all architectures
- Fix amd64 definition of KERNEL_HANDLE_FLAG
- Fix definition of PrototypePte
- Fix KiGetLinkedTrapFrame()
- Make MmProtectTpPteMask 64 bit wide 
- Fix definition of MI_PTE_LOOKUP_NEEDED for amd64
- Impllement KiSendEOI() to be able to send an EOI from C code.
- Fix some MSVC/amd64 warnings

svn path=/trunk/; revision=55423
2012-02-04 23:08:20 +00:00
Timo Kreuzer cb837e18a1 [FREELDR]
- Don't map the low 1 MB into kernel space, it's pointless and leads to inconsistencies between reported memory type and what is found in the page tables. On x86 it works, because it uses an overcomplicated pfn initialization wih redundent checks. Anyway this memory, containing freeldr and real mode code, was simply wasted.
- Silence some debug prints
- Fix warnings

svn path=/trunk/; revision=55421
2012-02-04 21:53:09 +00:00
Sylvain Petreolle 98a73736a6 [ADVAPI32]
Don't export Vista+, unused and unimplemented APIs.
Some apps / tests detect their presence and try to use them.

svn path=/trunk/; revision=55419
2012-02-04 21:42:22 +00:00
Timo Kreuzer eb594c7610 [NDK]
Fix amd64 definitions of SYNCH_LEVEL, DISPATCH_LENGTH, KINTERRUPT, KTHREAD, KPROCESS, EPROCESS
- add MM_SHARED_USER_DATA_VA
- Add PsGetProcessSessionId prototype
- Remove duplicated RtlWow64Get/SetThreadContext prototypes

svn path=/trunk/; revision=55418
2012-02-04 21:16:52 +00:00
Eric Kohl 5a51670178 [ADVAPI32]
Add or fix parameter checks.

svn path=/trunk/; revision=55417
2012-02-04 19:56:21 +00:00
Timo Kreuzer 9fa8f0915e [RTL]
- Fix RtlLengthSecurityDescriptor
- Implement amd64 version of Implement RtlInitializeContext
- Add unwind info to amd64 debug asm functions
- Fix 64 bit HEAP_COMMON_ENTRY structure The resulting version doesn't exactly match the original windows one, but its compatible, as every field, except the dummy fields - which are omitted - is at its correct position.

svn path=/trunk/; revision=55415
2012-02-04 18:35:56 +00:00
Timo Kreuzer cbee83498e [NTDLL]
- Implement amd64 version of LdrInitializeThunk and KiUserApcDispatcher
- Export ExpInterlockedPopEntrySList* on amd64, too
- Fix some 64 bit issues

svn path=/trunk/; revision=55414
2012-02-04 18:25:25 +00:00
Timo Kreuzer 85bb9f1bce [XDK]
- fix ASSERTs in amd64 inline functions
- fix definition of KWAIT_BLOCK
These fixes are not critical, so I don't update wdm.h to avoid additional recompilation

svn path=/trunk/; revision=55413
2012-02-04 17:29:34 +00:00
Thomas Faber d5606434e4 [RTL]
- Work around Wine's misuse of critical section debug flags. Hopefully fixes KVM

svn path=/trunk/; revision=55410
2012-02-04 13:47:16 +00:00
Timo Kreuzer 5634a14cce [ASM]
Modify syscall stub macros to be compatible with the new amd64 stubs

svn path=/trunk/; revision=55409
2012-02-04 12:29:24 +00:00
Timo Kreuzer 61a48a890e [CMLIB]
Fix 64 bit / MSVC warnings

svn path=/trunk/; revision=55408
2012-02-04 12:23:27 +00:00
Timo Kreuzer afd88373ce [NTOSKRNL/MM/AMD64]
- Implement more of MmCreateProcessAddressSpace
- Acquire pfn lock and use MiRemoveZeroPage in MiGetPteForProcess

svn path=/trunk/; revision=55407
2012-02-04 12:13:53 +00:00
Eric Kohl 775cef8b4c [EVENTLOG]
- Change LogfInitializeNew and LogfInitializeExisting to return an NTSTATUS code instead of a BOOL value.
- LogfInitializeExisting no longer calls LogfInitializeNew when reading a log file fails but returns a proper status code instead.

svn path=/trunk/; revision=55406
2012-02-04 11:34:13 +00:00
Timo Kreuzer 597c140370 [NTOSKRNL/KE/AMD64]
- Fix stack alignment in KiSwitchToBootStack
- Handle ExceptionFrame == NULL in KeContextToTrapFrame and KeTrapFrameToContext
- Implement KiSwapContextInternal
- Fix KiSwapContext and KiThreadStartup
- Implement dispatching of user mode exceptions including in-paging of module data used by the kernel-debugger
- Implement KeInitializeInterrupt, KeConnectInterrupt, KeSynchronizeExecution
- Don't zero more than the actual PCR size in KiInitializePcr
- Add asm function KiInitializeSegments to initialize the segment selectors to proper values
- Initialize system call entrypoints in KiInitializeCpu
- Implement KiDpcInterruptHandler, KiIdleLoop, KiInitializeUserApc, KiSwapProcess, KiSystemCallHandler, KiInitializeContextThread, KiSwapContextResume
- Implement asm functions KiRetireDpcList, KiInterruptDispatch, KiSystemCallEntry64, KiZwSystemService

svn path=/trunk/; revision=55405
2012-02-04 11:32:13 +00:00
Timo Kreuzer de74279d5b [ASM/AMD64]
- Add multiple amd64 asm constant and structure offset definitions
- Add more unwind information to the amd64 trap entry code
- Add IRQL check, APC check and segment sanitize code to trap entry/exit

svn path=/trunk/; revision=55404
2012-02-04 11:01:19 +00:00
Timo Kreuzer 0fcb7d138d [NTOSKRNL/MM/AMD64]
- Add MI_REAL_SYSTEM_RANGE_START, which is the canonical system space base address, while MmSystemRangeStart variable contains a broken value, like on Windows.
- Define MmSystemRangeStart to MI_REAL_SYSTEM_RANGE_START, since on amd64 there is no dynamic system space start address and we don't want to use the broken address anywhere
- Add some more address layout definitions
- Add MiIsPteOnP*eBoundary() macro
- Add MMPPE, MI_WRITE_VALID_PPE and ValidKernelPpe definitions
- Fix initialization of PrototypePte
- Add mappings for VAD bitmap and working set list to MiInitializePageTable
- Fix calculations in MiBuildNonPagedPool
- Improve MiBuildSystemPteSpace
- Implement MiBuildPfnDatabase, MiAddDescriptorToDatabase, MiBuildPfnDatabaseFromPageTables, MiSetupPfnForPageTable all of these are written to be portable, yet they are untested on anything else than amd64 builds
- Mostly finish MiInitMachineDependent

svn path=/trunk/; revision=55403
2012-02-04 10:40:27 +00:00
Rafal Harabien adffed162f [BOOTDATA]
- Don't create paging files on livecd. Verified by Alex Ionescu.

svn path=/trunk/; revision=55402
2012-02-03 23:43:42 +00:00
Alex Ionescu b1e15cc96d [SMSS2]: Implement the rest of the code to create page files. All that's missing is the actual call to NtCreatePagingFile.
svn path=/trunk/; revision=55400
2012-02-03 23:11:28 +00:00
Timo Kreuzer b7f8e21b52 Fix gcc build
svn path=/trunk/; revision=55398
2012-02-03 21:12:18 +00:00
Timo Kreuzer 36a816a584 [NTOSKRNL]
- Rewrite MmFindGapBottomUp and MmFindGapTopDown, the old versions were broken and were first checking the address range after the first memory area and only used the area below (above) the first memory are when nothing free was found.
- Fix an ASSERT, that gets triggered now that the memory areas are created at the "right" locations
- Create a memory are for the boot loaded images, which previously could be overwritten happily by new memory areas, which was only prevented by the brokenness of the code
- Fix a few memory regions so that they are correct for amd64 builds as well

svn path=/trunk/; revision=55397
2012-02-03 20:59:35 +00:00
Thomas Faber 173b42e7cb [SMSS2]
- Properly handle an empty list in SmpSaveRegistryValue
- Compare the value string for equality, as the comment says, not inequality
- This fixes a crash, although another solution may perhaps be better

svn path=/trunk/; revision=55391
2012-02-03 11:21:15 +00:00
Timo Kreuzer 4895b9388e [SMSS2]
Fix MSVC build

svn path=/trunk/; revision=55384
2012-02-02 20:50:22 +00:00
Amine Khaldi 46ba8b17cc [NTOSKRNL]
* Fix MSVC build.

svn path=/trunk/; revision=55383
2012-02-02 20:45:49 +00:00
James Tabor 75c818eefb [User32]
- Attempt to fix the font leak when switching applications. Tested with other applications other than Acrobat Reader since it crashes when installing. See bug 5314.

svn path=/trunk/; revision=55362
2012-02-01 03:09:57 +00:00
Amine Khaldi 86b5a7c90b [README.WINE]
* Mark some modules, that are in sync with Wine 1.3.37, as such.

svn path=/trunk/; revision=55358
2012-01-31 20:53:40 +00:00
Giannis Adamopoulos 29a7102825 [user32_apitest]
- Add some more tests

svn path=/trunk/; revision=55349
2012-01-31 10:49:44 +00:00
Giannis Adamopoulos 3d8783aa35 [user32_apitest]
- Add a couple of tests for SPI_SETMOUSESPEED and SPI_GETMOUSESPEED
- inspired by bug 905

svn path=/trunk/; revision=55347
2012-01-31 09:58:05 +00:00
Alex Ionescu 5ebd3e62cf [SMSS2]: Implement helper functions for reading and writing to the BSD (What lets Windows know if this was a good boot/shutdown or a bad one, and to display the recovery settings or not (FreeLDR should do this...)). Implement the functions needed to launch native applications, and add support for launching autochk and any other bootexecute applications. Set the correct SessionID with the kernel by calling ProcessSessionInformation. Pending File Rename Operations are the last big thing left, plus actual pagefile creation.
[SMSS2]: Fix a bug in SmpParseCommandLine.

svn path=/trunk/; revision=55346
2012-01-31 02:38:42 +00:00
Alex Ionescu 292010dcd6 [NDK/RTL]: Fix RtlGetSetBootStatusData prototype and add the BSD Items that can be set with it.
svn path=/trunk/; revision=55345
2012-01-31 02:33:02 +00:00
Alex Ionescu b12e5cfc77 [SMSS2]: Implement SmpCreateDynamicEnvironmentVariables such that all the SMSS-generated variables are created. Compared to SMSS it has some bug fixes and also handles the safe-mode options key. Next step is to handle boot/setup/execute keys and get autochk running from SMSS2.
[SMSS]: No longer initialize the registry, let SMSS2 do that now.

svn path=/trunk/; revision=55343
2012-01-31 01:19:14 +00:00
Alex Ionescu 432f60ee68 [NDK]: D'oh.
svn path=/trunk/; revision=55342
2012-01-30 22:55:24 +00:00
Alex Ionescu 0f85c44176 [SMSS2]: Create and define the volume descriptor structure, and go ahead and build some volume descriptors!
svn path=/trunk/; revision=55340
2012-01-30 22:50:37 +00:00
Alex Ionescu 51dbd93981 [SMSS2]: Implement all the processing required for being able to create emergency, system, and manual-sized page files, on both fixed drives any "any" drives. Missing the code to build volume descriptors and to actually ask the kernel to create the file (right now, just prints what should be done and sizes).
svn path=/trunk/; revision=55335
2012-01-30 21:28:48 +00:00
Thomas Faber 2740865cc0 [COMCTL32]
- Fix the fix for MSVC build (r55306). This is the version accepted by Wine.

svn path=/trunk/; revision=55334
2012-01-30 20:29:12 +00:00
Alex Ionescu 973a9360b2 [SMSS2]: Implement command line and token parsing. Implement pagefile descriptor structure, format, flags, and parsing. They are now created as they should. Use SmpHeap instead of RtlGetProcessHeap() to keep code cleaner. Use SmpSystemRoot instead of NtSystemRoot now that it's being defined. "Environment" in registry should be parsed twice to handle nested expansions.
svn path=/trunk/; revision=55333
2012-01-30 19:29:30 +00:00
Alex Ionescu 51fe71aec3 [NTOSKRNL]: Keep doing the old region/swap work incorrectly, but at least return a correct size. Let's see if this fixes it.
svn path=/trunk/; revision=55330
2012-01-30 17:19:14 +00:00
Alex Ionescu 9f51b3ff35 [SMSS2]: Implement KnownDLL and DOSDevice initialization now that the kernel bugs are gone. Compared to SMSS, SMSS2 is smarter and uses a Ldr callback to manually add any imported DLLs of KnownDLLs to the KnownDLL list, which helps with long-term app launch performance. Next up will be environment and page file.
svn path=/trunk/; revision=55324
2012-01-30 10:22:21 +00:00
Alex Ionescu 864a1bc6ae [NTOSKRNL]: Here's another gem. SMSS2 couldn't call LdrVerifyImageCheckSum, nor could it create Known DLL sections (of course, magically SMSS could). Turns out what Mm expects in terms of file access rights when you map a section has almost nothing to do with what it should expect. Added a new function to ARM3 (which had most of the code there already) so correctly determine which file access rights should be needed. One big change is that you can now map sections with PAGE_EXECUTE if you only have FILE_EXECUTE (FILE_READ_DATA no longer required), as things should be.
svn path=/trunk/; revision=55323
2012-01-30 10:15:29 +00:00
Alex Ionescu 25c5926fcb [NDK]: LDR_CALLBACK's second parameter is a PCHAR.
svn path=/trunk/; revision=55321
2012-01-30 09:43:24 +00:00
Alex Ionescu 3c2b7f8a5b [NTOSKRNL]: One of my favorite bugfixes to date: While working on SMSS2, I notice that Win32->NT path conversion is failing and %SystemRoot% is not being translated. Yet, this is supposed to be part of the core environment that the kernel sends to SMSS! I analyze the old SMSS, and in there, it works. Puzzled, I DPRINT1 out the environment only to see that it is empty. I do the same in the kernel -- empty! The old SMSS is currently manually regenerating its critical environment, as if the kernel never sent it (which perfectly hid the bug that our kernel...actually did never send it!). But why were we sending no environment? It turns out our environment string was 0x10000 bytes, just one byte longer than MAX_USHORT and overflowing back to zero -- hence our Appends were all silently failing. But why was our environment string 0x10000, when we allocate 0x1000 bytes only? And here comes the Mm bug. When you allocate virtual memory in Windows you are forced to use 64K alignment, and Windows internally will align the VAD on a 64K boundary. In ReactOS however, we actually allocate, map, and reserve a full 64K memory area, as well as actually modify the region size that the caller has sent, returning the caller a 64K-aligned size no matter what (whereas Windows would return the original 4KB size). I've thus added a simple hack which still allocates a full 64K memory area (who knows what would break if not), but only aligns the region size to a page size -- less swap pages are reserved, and the caller only receives a page-aligned region, instead of 64K. This now fixes ExpLoadInitialProcess and anyone else that was requesting a 4KB page and getting 64KB in exchange...
svn path=/trunk/; revision=55320
2012-01-30 09:42:47 +00:00
Alex Ionescu b42b421bea [SMSS]: Co-exist with SMSS2 by using OBJ_OPENIF when creating object directories and sections, in case SMSS2 has already done so (which now it probably will).
[SMSS2]: Implement all the required registry configuration parsing functions. KnownDLLs, DosDevices, PageFiles, Subsystems, ExcludedKnownDLLs, PendingFileRenameOperations, ObjectDirectories, Environment keys are all processed and put into lists. Other than creating the object directories and setting the environment variables, though, no other work happens -- but we do DPRINT1 what should happen.

svn path=/trunk/; revision=55319
2012-01-30 08:02:17 +00:00
Alex Ionescu bb3783a524 [NTOSKRNL]: hubris [ˈhjuːbrɪs], hybris n.
1. Belief that Ob is perfect.
Fix a major bug which allowed user-mode applications to get kernel handles if they so requested -- of course, they woudl then be completely unable to use such handles. This pattern is seen in Rtl code which we share, and where the intent is to give kernel kernel handles, and user user handles, so OBJ_KERNEL_HANDLE is unconditionally used, which in NT had the right effect. For us though, it gave unusable user-handles. This had the direct effect of completely breaking RtlQueryRegistryValues from user-mode if the TOPKEY or SUBKEY flags were used.

svn path=/trunk/; revision=55318
2012-01-30 07:48:49 +00:00
Alex Ionescu ddeb8354e4 [SMSS2]: Initialize a bunch more internal stuff, and start parsing the registry for settings. Right now just ProtectionMode and AllowProtectedRenames are parsed. Stub functions needed for the rest of initialization. Create the \Sessions directory. Hack to work under setup. Loop BootExecute and PageFile entries. Create SMSS environment. Detect MiniNT mode (PE/LiveCD). Delete SAFEBOOT_OPTION if found.
svn path=/trunk/; revision=55317
2012-01-30 05:32:34 +00:00
Alex Ionescu bbaf1702fe [SMSS2]: Create the VolumesSafeForWriteAccess and Sm2ApiPort. Create all the required security descriptors. Create the two API threads. Initialize a bunch of other stuff needed for later. Initialize tag heap and enable hard errors. Api loop waits on the LPC port but nothing should be going through there for now.
svn path=/trunk/; revision=55314
2012-01-30 03:44:27 +00:00
Alex Ionescu 4459aa9ea3 [SMSS]: Oh, right, compilation units. I had forgotten how much I hate rbuild.
svn path=/trunk/; revision=55313
2012-01-30 03:16:47 +00:00
Alex Ionescu df41abd401 [SMSS2]: Oh, right, rbuild.
svn path=/trunk/; revision=55312
2012-01-30 02:49:16 +00:00
Alex Ionescu 88cd0f3813 [SMSS2]: Flesh out the _main function in the new SMSS, including the SEH filter and SmpTerminate support. Instead of launching Winlogon (The "initial command", we launch the ReactOS SMSS for now -- and kill the system if it is ever terminated, as we should). We use the right priority, set the right critical flags, use the correct debug parameters, and acquire/release the correct privileges. Only thing not supported is launching ntsd if the "Debug Initial Command" global flag is set. I promise to implement that once someone implements ntsd ;-)
svn path=/trunk/; revision=55311
2012-01-30 02:10:39 +00:00
Alex Ionescu 4e3bf71826 [RTL]: Document, define, implement, and export RtlSetThreadIsCritical.
svn path=/trunk/; revision=55310
2012-01-30 01:14:33 +00:00
Alex Ionescu 64cab88494 [SMLIB]: Add NT-compatible SmConnectToSm and SmExecPgm functions to smlib, which CSRSS and other subsystems can use to talk to SMSS (and SMSS when it talks to itself). Not yet used.
svn path=/trunk/; revision=55308
2012-01-30 00:12:38 +00:00