Commit graph

74 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
65ce146169 Create a branch for working on csrss and co.
svn path=/branches/ros-csrss/; revision=57561
2012-10-14 13:04:31 +00:00
Timo Kreuzer
ad26240c79 [RTL]
Implement RtlpSafeCopyMemory, which uses SEH to copy the memory (not in freeldr)
Make RtlLargeIntegerToChar use RtlpSafeCopyMemory to copy the string to the target buffer.
CORE-3767 #resolve

svn path=/trunk/; revision=57295
2012-09-14 09:56:23 +00:00
Roel Messiant
2e6e9dd622 [NTOSKRNL]
- Keep APC delivery disabled while holding a Heap Lock, not just while acquiring/releasing it (Dedicated to Timo and Ged).
- Store the Heap Lock in non-paged pool, the only place where executive resources belong (Dedicated to patient people).
[RTL]
- Restructure/simplify/correct Heap and Heap Segment initialization (partially to cope with the changed Heap Lock interface).
- Restrict the location of Heap Segment headers to the base address of the Heap Segment (which frees up a whopping 60 bytes per Heap!).
- Cater for acquiring the Heap Lock exclusively or shared (the latter is only available in kernel-mode); only exclusive locking is used for now.
- Use a plain critical section to guard the Process Heap list, no reason to disguise it as a Heap Lock (saves us a handful more bytes).


svn path=/trunk/; revision=53761
2011-09-19 16:52:37 +00:00
Roel Messiant
1a7296bb39 [NTOSKRNL]
Disable normal APC delivery while acquiring/releasing a heap lock. Also, BOOLEAN != NTSTATUS.


svn path=/trunk/; revision=53729
2011-09-17 20:26:31 +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
Timo Kreuzer
19540dcad5 [NTOSKRNL]
- Add KiGetLinkedTrapFrame for amd64
- Add MiAddressToPti
- Fix MmCreateProcessAddressSpace, MmInitializeHandBuiltProcess prototype (ULONG -> ULONG_PTR)
- #if out some C_ASSERTs for other architectures than x86
- #define InitializeSListHead to RtlInitializeSListHead on amd64
- Don't implement MiSyncARM3WithROS on amd64
- Implement RtlPcToFileHeader, RtlpGetStackLimits

svn path=/trunk/; revision=48219
2010-07-23 23:30:00 +00:00
Timo Kreuzer
677bd3c418 [NTOSKRNL]
- #if out RtlpCaptureStackLimits on amd64 as well

svn path=/trunk/; revision=48087
2010-07-16 17:53:00 +00:00
Timo Kreuzer
8dc269c258 [NTOSKRNL]
- Fix RtlWalkFrameChain to do usermode back traces for threads that are not system threads. Also use _SEH2_YIELD when leaving the SEH block.

svn path=/trunk/; revision=47066
2010-04-30 22:47:44 +00:00
Timo Kreuzer
fb69e522da Merge from amd64-branch:
44501 (tkreuzer)
[NDK]
- Add CLIENT_ID32/64
- Create explicit 32/64 bit versions of PEB, GDI_TEB_BATCH and TEB, using macros.
- Fix some member names.


44503 (tkreuzer)
[CMD]
Fix a teb member name

44504 (tkreuzer)
[NTSOKRNL]
Fix a teb member name

44506 (tkreuzer)
[NDK]
fix a typo in the TEB definition

44511 (tkreuzer)
[NDK]
- Add Wx86ThreadState
- Add WinXP version of ACTIVATION_CONTEXT_STACK
- rtltypes doesn't depend on pstypes, but the opposite way around now

44512 (tkreuzer)
[NDK]
Fix some dependencies

44521 (tkreuzer)
[NTDKK]
- Don't use PEB::FastPeb(Un)LockRoutine, these members are deprecated since Windows 2003, use RtlEnter/LeaveCriticalSection instead.

44523 (tkreuzer)
[NTDLL]
Fix usage of PEB::KernelCallbacktable. It's a PVOID.

44524 (tkreuzer)
NDK]
- Add missing TEB member for Vista

44525 (tkreuzer)
[NDK]
Fix a TEB array size.

44526 (tkreuzer)
[USER32]
More fix of TEB::KernelCallbackTable usage

svn path=/trunk/; revision=46434
2010-03-25 12:22:59 +00:00
Timo Kreuzer
32014b63b8 [NTOSKRNL]
"Fix things": Add architecture specific macros KeGetTrapFrame, KeGetExceptionFrame and KeGetContextSwitches. Should fix kernel build on arm. Patch by Alex, modified by me.

svn path=/trunk/; revision=44640
2009-12-17 20:58:58 +00:00
Timo Kreuzer
c5a2bbe739 [NDK]
- Add CLIENT_ID32/64
- Create explicit 32/64 bit versions of PEB, GDI_TEB_BATCH and TEB, using macros. Thanks to Alex for feedback and suggestions.
- Fix some member names.
- Note to self: fix rostests, too!

svn path=/branches/ros-amd64-bringup/; revision=44501
2009-12-10 00:35:12 +00:00
Timo Kreuzer
843b9ee1eb Merge trunk HEAD (r44067)
svn path=/branches/ros-amd64-bringup/; revision=44069
2009-11-10 02:40:48 +00:00
Timo Kreuzer
4896a4fbb2 use RtlPcToFileHeader instead of RtlpLookupModuleBase
svn path=/branches/ros-amd64-bringup/; revision=43980
2009-11-05 20:57:53 +00:00
Stefan Ginsberg
f84d5a02f4 - Fix support for /CRASHDEBUG and /NODEBUG; we didn't respect those settings properly and would initialize KD at boot even if they were set.
- Re-enable the breakpoint in vDbgPrintExWithPrefixInternal() as this works properly now. Without this breakpoint some break-in requests got lost if the break-in occurred when handling a debug print (happened a lot at boot).
- Implement Command String support for DbgCommandString() -- we now handle every debug service call.
- Implement NtSetDebugFilterState() and NtQueryDebugFilterState() for KD, meaning we now support debug filters properly.
- Implement KdRefreshDebuggerNotPresent(), KdChangeOption() and KdPowerTransition(). Stub KdSystemDebugControl() to return error status instead of hanging the system.
- Stub the rest of the KD API to print a warning and return a failure packet instead of hanging.
- Set and respect KdpContextSent when getting and setting the thread context -- WinDbg doesn't seem to rely on this, but better safe than sorry.
- Support MP when getting and setting the thread context too -- if the context is operation is for another processor than the current, just get it through the KiProcessorBlock array.
- Initialize the MajorVersion in the KD version block more properly -- the high byte is the major identifier (0 for NT). Add the required DBGKD_MAJOR_TYPES enumeration to wdbgexts.h.
- Simplify setting and clearing the InDbgPrint flag in the TEB to minimize the impact on kernel execution; use 2 dedicated routines instead of a generic one.
- KdpSymbol doesn't return anything, so don't return an ignore status from KdpReportLoadSymbolsStateChange.
- Expose the KdpDefaultRetries and Kd_WIN2000_Mask variables to the registry and add them to KDBG too (unused there).
- No reason to implement KdpSysGetVersion per architecture; move it back to the generic code.
- Add some ARM offsets to the debugger data block that (N/A on other architectures).
- Fix the default size of the DbgPrint log buffer for free builds to save some space. It should be 4 KB for a free build and 32 KB for a checked build.
- Move KeDisableInterrupts to cpu.c as it fits here more than in the IRQ support code in irqobj.c.
- Use KeDisableInterrupts in KeFreezeExecution instead of checking the x86 EFLAG directly.

svn path=/trunk/; revision=43912
2009-11-02 17:45:51 +00:00
Timo Kreuzer
cc5c0a0816 Merge trunk head (r43756)
svn path=/branches/ros-amd64-bringup/; revision=43759
2009-10-25 22:13:11 +00:00
Stefan Ginsberg
10bbe664b7 - Replace RtlpGetExceptionAddress by the _ReturnAddress intrinsic and add it to ARM intrin.h as it was missing.
- Simplify RtlpCheckForActiveDebugger: Remove the BOOLEAN parameter as we would always pass it FALSE. Always return FALSE false from kernel mode for simplicity.
- Fix a critical flaw in our exception support: RtlRaiseException and RtlRaiseStatus were implemented in C on x86. This lead to unpredictable register corruption because the compiler could not know that it had to preserve non-volatile registers before calling RtlCaptureContext as the saved context is later used to restore the caller in case the exception is handled and execution is continued. This made the functions unsafe to return from as any non-volatile register could be corrupted. Implement them in assembly for x86 to safely capture the context using only EBP and ESP. The C versions of those routines are still used and shared for the other architectures we support -- needs to be determined if this is safe and correct for those architectures.
- The ntdll exception Wine exposed this issue, and all tests now pass. The remaining failures on the build server are caused by missing or incomplete debug register support in KVM/QEMU. Run the test in another VM or on real hardware and all the tests will pass.
- Implement Debug Prompt (DbgPrompt) support for KD and KDBG. The KDBG implementation reads the prompt from keyboard or serial depending on the mode so that sysreg and rosdbg can support it too.
- Properly implement RtlAssert using DbgPrompt to prompt for the action to take instead of always doing a breakpoint. The new implementation is disabled until sysreg can support this. Also move RtlAssert to its own file as it has nothing to do with the error routines (nor does it belong in exception.c).
- Note that DbgPrompt was already used in PspCatchCriticalBreak, and this would have resulted in a silent hang as BREAKPOINT_PROMPT wasn't handled at all by KDBG.
- Implement KiRaiseAssertion (10 lines of code with the trap macros) and thus support NT_ASSERT. Add partial support for it to KDBG to print out a warning and the address of the failure, but don't do anything else. Also add NT_ASSERT to the DDK headers so that we can use it, but don't use it yet as the ARM method of performing this has not been decided nor implemented.
- KiTrap3 doesn't set STATUS_SUCCESS but BREAKPOINT_BREAK. They have the same numerical value but very different meaning -- BREAKPOINT_BREAK means that the exception is a software breakpoint and not a debug service call. Fix some comments to document that this is what is checked for.
- Fix inverted and broken logic in KdpReport. It would never pass second chance exceptions to the debugger, didn't respect the stop-on-exception flag properly and would always fail to handle some special exceptions in both first and second chance instead of just failing to handle it in first chance. Clean up, reformat and document what is going on.
- The DebugPrint and DebugPrompt support routines only perform a 2D interrupt on x86; use more portable comments.
- Add Alex to the programmer section of x86's kdsup.c -- he wrote KdpGetStateChange, KdpSetContextState and the code that was previously in KdpRead/WriteControlSpace.
- Add my name to the parts of KD where I have made significant work on getting KD/WinDbg support up and running.
- KD debugging is now quite functional and stable. Some bugs and stubs remain to be flushed out, but overall KD is now much better and easier to use than KDBG.

svn path=/trunk/; revision=43705
2009-10-23 22:51:39 +00:00
Timo Kreuzer
cb662b3fc9 Sync to trunk HEAD (r43416)
svn path=/branches/ros-amd64-bringup/; revision=43422
2009-10-12 22:00:47 +00:00
Stefan Ginsberg
3c5b2d9a61 Mega KD64 revival patch:
KD64
- Fix some 64-bit issues and some x86 specificness.
- Sub out some KdpTrap cases more properly.
- Implement support for .crash and .reboot. Does not seem to work currently because of weird issues.
- Implement KdpDprintf to send strings directly to the debugger from inside of KD64. Use it in KdEnterDebugger instead of DbgPrint so we won't try to enter the debugger recursively.
- Implement KdUpdateDataBlock to set the KeUserCallbackDispatcher pointer in the debugger block after its address is retrieved from ntdll.
- Don't assume breakpoints are 1 byte long in portable code -- use KD_BREAKPOINT_SIZE and define it per architecture.
- KdpStub: KdEnableDebugger returns NTSTATUS, not TRUE/FALSE.

Other
- wdbgexts.h: Properly define CURRENT_KD_SECONDARY_VERSION for AMD64.
- Make PsNtosImageBase pointer-sized as it should be.
- Change the definition of KDSTATUS so it is guaranteed to be 32-bit.
- Fix a critical bug in KiRestoreProcessorControlState: it didn't clear the busy flag in the TSS before reloading the task register, resulting in a GPF if we tried to reload the same register.
- Add macros for getting and setting special purpose registers (the Program Counter and the "return register") in portable code instead of using #ifdef every time. Do likewise for setting IMAGE_FILE_MACHINE_XXX, using a new IMAGE_FILE_MACHINE_ARCHITECTURE macro.
- Don't refer to the Program Counter as "Eip" in portable code.
- Define DBG_STATUS_CONTROL_C for assembly code and use it in KeUpdateSystemTime.

svn path=/trunk/; revision=43283
2009-10-04 16:53:15 +00:00
Timo Kreuzer
f9c2afd00a Sync with trunk r43000
svn path=/branches/ros-amd64-bringup/; revision=43079
2009-09-19 13:58:16 +00:00
Stefan Ginsberg
beba1269e6 - Get rid of TAG() from the kernel
- mmtypes.h: Goodbye TAG(), you won't be missed

svn path=/trunk/; revision=42920
2009-08-24 18:19:53 +00:00
Aleksey Bragin
9e804e5230 - Rewrite RtlpCreateAtomHandle to readable code and fix a problem spotted in bug 4788.
svn path=/trunk/; revision=42635
2009-08-12 11:42:34 +00:00
Timo Kreuzer
4135e99ab6 Merge trunk head (r41474)
svn path=/branches/ros-amd64-bringup/; revision=41488
2009-06-20 13:45:51 +00:00
Stefan Ginsberg
88e9b2a513 - In Win32 DBG is defined to 0 for a non-debug build and to 1 for a debug build. In ReactOS we do this slightly different: DBG is correctly defined to 1 for debug, but not defined at all on non-debug/release build. Because gcc is awesome we can then check for debug compilation with both #ifdef DBG and #if DBG (error free! yay gcc!), and so we have mixed usage all over the tree.
- Fix this by defining DBG on non-debug build too and deprecate all usage of #ifdef DBG.

svn path=/trunk/; revision=41436
2009-06-17 12:44:05 +00:00
Timo Kreuzer
d00a945f03 sync to trunk head (37853) (except rbuild changes)
This breaks everything. Sorry, but it has to be done.
Will fix ASAP.

svn path=/branches/ros-amd64-bringup/; revision=37867
2008-12-05 15:30:17 +00:00
Stefan Ginsberg
165bfe865b - STDCALL -> NTAPI
svn path=/trunk/; revision=37745
2008-11-29 20:47:48 +00:00
KJK::Hyperion
c086cc2302 Everything
Migrate ntoskrnl to PSEH 2.0. The code should speak for itself

modified   ntoskrnl/ex/atom.c
   _SEH_LEAVE was used improperly in NtQueryInformationAtom. As a free bonus, the upgrade to PSEH 2.0 (and to _SEH2_LEAVE) fixes the potential bug

modified   ntoskrnl/fsrtl/fastio.c
   Corrected exception filter logic

modified   ntoskrnl/include/internal/ex.h
   Goodbye _SEH_ExSystemExceptionFilter, you won't be missed

modified   ntoskrnl/include/internal/ntoskrnl.h
   Don't FORCEINLINE functions that use SEH, it's bad form and the compiler doesn't like

modified   ntoskrnl/ke/i386/usercall.c
   Dispatch the correct EXCEPTION_RECORD in case of exception inside KiInitializeUserApc

modified   ntoskrnl/ke/powerpc/exp.c
   Removed bogus, unused SEH code

modified   ntoskrnl/ntoskrnl-generic.rbuild
   Sources using PSEH 2.0 must be compiled with -fno-unit-at-a-time due to a GCC bug. See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982 and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38054
   Apparently, -fno-unit-at-a-time makes GCC crash when using precompiled headers. Disable precompiled headers for ntoskrnl

svn path=/trunk/; revision=37615
2008-11-24 13:40:26 +00:00
Timo Kreuzer
9726adc85e "[00:08] Stefan100: 5) Alex_Ionescu will have your head"
Well, no risk, no fun... ;-)
Implement RtlpGetStackLimits

svn path=/branches/ros-amd64-bringup/; revision=37426
2008-11-18 00:31:22 +00:00
Timo Kreuzer
f3668beb0c Implement RtlLookupFunctionTable, RtlLookupFunctionEntry and a usermode/kernelmode version of RtlpLookupModuleBase helper function.
svn path=/branches/ros-amd64-bringup/; revision=37308
2008-11-12 15:24:40 +00:00
Timo Kreuzer
3552ed757c sync to trunk revision 36500
svn path=/branches/ros-amd64-bringup/; revision=36846
2008-10-20 15:46:20 +00:00
Stefan Ginsberg
420195308d - Uncomment NTDLL exports which we implement, and add stubs for numerous routines
- Add missing prototypes to NDK
- Implement RtlInterlockedCompareExchange64 and RtlGetCurrentProcessorNumber
- Rename RtlpCurrentPeb to RtlGetCurrentPeb and export it from NTDLL

svn path=/trunk/; revision=36166
2008-09-12 15:09:17 +00:00
Timo Kreuzer
53181b207f sync to trunk head (35945)
svn path=/branches/ros-amd64-bringup/; revision=35954
2008-09-05 00:03:53 +00:00
Hervé Poussineau
d2ba8bac96 Replace some ExFreePool by ExFreePoolWithTag
svn path=/trunk/; revision=35834
2008-08-31 15:29:21 +00:00
Stefan Ginsberg
12f349df1d - Remove the (now deprecated) ntoskrnl/internal/debug.h header and fix all its includers to use the global debug.h
svn path=/trunk/; revision=35806
2008-08-30 16:31:06 +00:00
Hervé Poussineau
c1f3e0fa1c win32k: Add tags when allocating memory
ntoskrnl: Relax checks when freeing a string

svn path=/trunk/; revision=35769
2008-08-29 21:19:41 +00:00
Stefan Ginsberg
13362ee99b - Remove KEBUGCHECK and KEBUGCHECKEX macros
- Replace "KeBugCheck(0)" by ASSERT(FALSE)
- Replace deprecated "CPRINT" by DRINT1

svn path=/trunk/; revision=35600
2008-08-24 15:48:05 +00:00
Stefan Ginsberg
b736cabdae - Remove dead code
svn path=/trunk/; revision=35462
2008-08-19 21:09:58 +00:00
Timo Kreuzer
4972cd28d6 - do not define -nostartfiles for kernel, it looks like ld creates unaligned section pointers then
- comment out RtlCapturestackLimits
- use KeGetCurrentPrcb instead if KetGetPcr()->Prcb
- fix use of KPCR->Prcb
- use %p instead of %08x for ULONG_PTR
- update stubs
- add more files to build
- add FrLdrDbgPrint prototype to ntoskrnl.h

svn path=/branches/ros-amd64-bringup/; revision=34971
2008-07-31 02:20:15 +00:00
ReactOS Portable Systems Group
a6b9a98b82 - Fix incorrect definition of PCR and USERPCR which was making us incorrect memory.
- Fix incorrect definition of ARM_CONTROL_REGISTER, which was stopping us from correctly enabling High Vectors.
- The RtlCaptureStackLimits and RtlWakeChainFrame routines in libsupp.c cannot possibly be portable across all architectures -- separated ARM versions in an arm directory.
- Setup the panic stack for abort/undefined exceptions, and the interrupt stack for FIQs.
- Implement support for exceptions! We can now display the address which caused a data abort, and begin handling exceptions.
- Implement all the HAL Spinlock/IRQL functions except KfRaise/LowerIrql which actually do the work.
- We're booting all the way to setting up the user_shared_data memory area.

svn path=/trunk/; revision=32653
2008-03-11 02:45:13 +00:00
ReactOS Portable Systems Group
fb86c24408 We can now build the ARM kernel (but not link it).
We now define _disable and _enable for ARM.
We shouldn't define KeRaiseIrqlToSynchLevel for each architecture, since the prototype is portable itself.
It was a mistake to guard against x86 only system calls -- the system calls should be the same on all archs, just return STATUS_NOT_IMPLEMENTED if they don't make sense. Undo the guards.
We now define KeGetPcr() as portable -- it's PCR itself that is a per-arch define.
We now support ARM in RtlWalkFrameChain.
We now support ARM in PspCreateThread.
We now define KeArchHaltProcessor for ARM by using Wait-For-Interrupt Mode.
We now define KeArmInitThreadWithContext for ARM.
KiRestore/SaveProcessorControlState are portable prototypes, we now define them as such.
Bochs KD code should use the portable WRITE/READ_PORT_UCHAR defines, we now do so.
We now support ARM in SharedUserData->ImageNumberLow/High during ExpInitializeExecutive.
NtQuerySytemInformation for SystemProcessorInformation has now been fixed to use the portable KeProcesssorXxx variables instead of reading from the non-portable PRCB values.
We now support NtFlushInstructionCache for ARM by flushing the I-Cache.

svn path=/trunk/; revision=32197
2008-02-07 20:04:31 +00:00
Aleksey Bragin
697723f229 - Fix default buffer size for user-mode RtlQueryRegistryValues queries, this removes warnings on debug log about buffer being too small (it was!).
- Remove ARC tree dump since this code has now been proven to work.
- Sync PointerFree with WINE, removing the unhandled data type=warning.

svn path=/trunk/; revision=31172
2007-12-11 21:52:12 +00:00
Thomas Bluemel
4b146b2b27 Silence possible uninitialized variable warning when compiled with full optimizations
svn path=/trunk/; revision=29989
2007-10-30 22:38:43 +00:00
Daniel Reimer
ae7da04787 Delete all Trailing spaces in code.
svn path=/trunk/; revision=29690
2007-10-19 23:21:45 +00:00
Art Yerkes
0abf169695 All remaining changes from the PPC branch. Not well tested yet. Many things
are indeed still stubs or WIP code.

Some people have been interested in helping out from some time and I'm sorry
I haven't been able to do this merge finally for a while.

svn path=/trunk/; revision=29407
2007-10-06 07:53:20 +00:00
Aleksey Bragin
fe7669dea4 - KeRosCaptureUserStackBackTrace is now created, which calls RtlWalkFrameChain with the user-mode flag, meaning that bugchecks finally show the user-mode stack again!
- KeRosDumpStackFrames is fixed so that if the EIP can't be found in a module list, it's still displayed (just without the module name). Previously the EIP would not be shown, resulting in code running on the heap/stack/somewhere else not being shown as part of the trace.

svn path=/trunk/; revision=29332
2007-10-01 17:58:49 +00:00
Aleksey Bragin
18064031f9 - Fix multiple bugs in RtlWalkFrameChain and secure it against any possibility of a bugcheck while walking the stack.
- Fix bugs in RtlUnwind and RtlExceptionDispatch which assumed the DPC stack size was 4KB instead of 12KB.
- Fix multiple bugs in RtlpGetStackLimits and seure it against bugchecks. Properly detect DPC or invalid stacks.
- PsConvertToGuiThread should acquire a guarded region, not a critical section, to stop all APCs.
- Fix bug in bugzilla reporting which was making things crash.
- Unlock address space before raising to HIGH_LEVEL in KeBugCheck.
- Display blue screen at APC_LEVEL, to avoid the assertion in procobj.c when trying to attach to csrss. This should fix the recursive bugchecking when the GUI is up, and also take down the GUI properly. The fix is a hack.
- Fix bogus implementation of IoGetStackLimits and make it work properly.
- Make MmCreateKernelStack return the base of the stack, not the limit, and fix all callers appropriately.
- Remove svn:needs-lock properties of various files, whose contents either changes too often or whose contents is definately clean.

Bugreports and information - by Alex.

svn path=/trunk/; revision=29244
2007-09-27 13:07:43 +00:00
Alex Ionescu
b4e9b56b39 - Added more improvements/fixes to the Executive Initialization code:
- We now print out error messages at each SESSIONX_INITIALIZATION_FAILURE directly on the screen.
  - Build CmNtCSDVersion to include SP1 and our SVN Revision number.
  - Build CmNtSpBuildNumber with the actual SP1 build number.
  - Detect Headless Terminal usage.
  - Build and create the CmVersionString.
  - Display a startup banner similar to Windows based on the CmVersionString, also indicating the SVN revision.
  - Fix some bugs in the timezone code.
  - Display a second startup banner like Windows's, displaying memory and CPU counts.
  - Add calls to initialize RANGE_LISTs, the Prefetecher, XIP Support and Phase 2 Executive Initialization.
  - Parse the command line to detect /SAFEBOOT: switch and which type of safe mode boot this is.
  - Display an optional third startup banner showing which safemode boot type this is.
  - Detect /BOOTLOG switch and display a fourth startup banner if it's enabled, but don't initialize boot logging yet.
  - Don't allow driver loading to push the progress bar beyond 75%.
  - Write safe-boot type to registry, detect AlternateShell mode and validate that one is configured.
  - Write MININT key to registry if booting in WinPE (LiveCD) mode.
  - Don't leak smss environment and parameters anymore.
  - Cleanup and reformat some code, use VER_ constants instead of magic numbers.

svn path=/trunk/; revision=26659
2007-05-09 00:44:45 +00:00
Alex Ionescu
3e42c58603 - Implement new ExHandle* implementation using pushlocks and the Windows 2003 HANDLE_TABLE structure and semantics. Only the currently used base APIs were implemented; support for audit masks still disabled, debug/tracing calls disabled.
- Remove manual overrides of NTDDI_VERSION all over the thread and set it once globally, since ExHandle* was the only non-updated package. The entire kernel now builds with Windows 2003 SP1 as a target.
- Remove this entry from kernel fun.

svn path=/trunk/; revision=25586
2007-01-22 08:15:17 +00:00
Alex Ionescu
c39989df1b - Fix SleepEx.
- Put volatile statements in EX_RUNDOWN_REF, IRP, DEVICE_OBJECT, ERESOURCE, FILE_OBJECT, IO_REMOVE_LOCK, WORK_QUEUE_ITEM where required (thanks to Microsoft's changes in the WDK to mark the fields properly).
- Update FILE_OBJECT definition.
- Add some asserts to some I/O functions.
- Add stub support for File Objects created by XP+ Drivers which have File Object Extensions.
- Add some fixes to IopDeleteFile, including proper reference counting for the DO and VPB, as well as cleanup when the file is closed without a handle.
- Fix a bug in IopSecurityFile.
- Queue and unqueue IRPs in all I/O functions.
- Fully support IRP cancellation now.
- Fix critical bugs in NtDeviceIoControlFile and NtDeviceFsControlFile which were causing double queueing of IRPs and freeing of invalid memory, as well as invalid paramter checking for user-mode buffers.
- Add exhaustive validation checks to IoCreateFile, add more failure cases, and validate the EA buffer. Also support IO_ATTACH_DEVICE_API flag.
- Implement IoCreateStreamFileObjectEx and IoCreateStreamFileObjectLite and fix several bugs in the original implementation of IoCreateStreamFileObject.
- Fix a bug in RtlRaiseException.
- Update Io*ShareAccess routines to support XP+ style semantics related to special File Object flags which disable their use.
- Add validation to all Query/Set routines so that information clasess, lengths, buffers and alignment are properly checked.
- Also add an array for the proper acess rights that each query/set operation requires.
- Check backup/restore privileges during I/O File operations.
- Check traverse access during I/O File Operations.
- Check access privileges to the device during I/O file operations.
- Rename IopReferenceDeviceObject and also verify if an exclusive DO is trying to be invalidly opened.
- Support various extra security checks during I/O File/Device Parse Routine.
- Fix a bug during IopCleanupIrp so that we don't dereference the File OBject if this was a create operation.
- Fix some bogus asserts in IofCompleteRequest, and save the IRP Flags before signalling it's event, since the driver might've freed it behind our back.
- Fix a large bug in ObInsertObject which affected the insert of unnamed objects with forced security options (Such as process/threads).
- Fix the creation of the Process/Thread/Job Obejct Types to that security information is forced.
- Remove "Fix PS!!!" messages since the bug is now fixed and these objects now get proper security descriptors.
- Fix another bug in ObInsertObjet which wasn't properly validating user-mode objects and always assumed kernel mode.
- Silence multiple trace/checkpoint messages that have accumulated throughout time for various debugging purposes.

svn path=/trunk/; revision=25118
2006-12-10 18:40:30 +00:00
Alex Ionescu
6d56cb39a6 - Fix dozens of missing typecast errors.
- Other MSVC/WDK compatibility fixes.

svn path=/trunk/; revision=24657
2006-10-26 01:49:51 +00:00
Alex Ionescu
0bfcd77883 - Implement ExpInitNls to initialize the NLS Section using the new semantics recently implemented. Works pretty much like the previous code in rtl/nls.c except it uses the new variable names as well as maps a view of the NLS Table into the system process.c
- Delete rtl/nls.c and all the associated deprecated code.
- Do MmInit1 and SharedUserData stuff *after* initializing the initial thread, to avoid an ASSERT during bootup.

svn path=/trunk/; revision=24408
2006-10-05 01:44:54 +00:00